/* Generated by Cython 3.2.8 */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
/* InitLimitedAPI */
#if defined(Py_LIMITED_API)
  #if !defined(CYTHON_LIMITED_API)
  #define CYTHON_LIMITED_API 1
  #endif
#elif defined(CYTHON_LIMITED_API)
  #ifdef _MSC_VER
  #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
  #else
  #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
  #endif
#endif

#include "Python.h"

    #if defined(Py_LIMITED_API)
    #define _pytype_enable_gc(t, traverse, clear)     do { (void)(traverse); (void)(clear); } while (0)
    #else
    #define _pytype_enable_gc(t, traverse, clear)     do { (t)->tp_traverse = (traverse); (t)->tp_clear = (clear); } while (0)
    #endif
    #if PY_VERSION_HEX < 0x030B0000 && !defined(Py_Version)
    #define Py_Version __Pyx_get_runtime_version()
    #endif
    
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x03080000
    #error Cython requires Python 3.8+.
#else
#define __PYX_ABI_VERSION "3_2_8"
#define CYTHON_HEX_VERSION 0x030208F0
#define CYTHON_FUTURE_DIVISION 1
/* CModulePreamble */
#include <stddef.h>
#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 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_CPYTHON_FREETHREADING 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
  #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_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 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 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 1
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#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_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 1
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #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_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #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
  #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_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
  #endif
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 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 (PYPY_VERSION_NUM >= 0x07031100)
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 0
#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_CPYTHON_FREETHREADING 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_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
  #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 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 (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef 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
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
  #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
  #ifndef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 1
  #endif
  #undef CYTHON_IMMORTAL_CONSTANTS
  #define CYTHON_IMMORTAL_CONSTANTS 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
  #ifdef Py_GIL_DISABLED
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
  #else
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #endif
  #if PY_VERSION_HEX < 0x030A0000
    #undef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #elif !defined(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
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || 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
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_FAST_GIL
    #define CYTHON_FAST_GIL 0
  #elif !defined(CYTHON_FAST_GIL)
    #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef 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
  #ifndef CYTHON_USE_SYS_MONITORING
    #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #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 && !CYTHON_USE_MODULE_STATE)
  #endif
  #ifndef 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
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
  #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
    #undef CYTHON_IMMORTAL_CONSTANTS
    #define CYTHON_IMMORTAL_CONSTANTS 0  // definitely won't work
  #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
    #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
#endif
#ifndef CYTHON_COMPRESS_STRINGS
  #define CYTHON_COMPRESS_STRINGS 1
#endif
#ifndef CYTHON_FAST_PYCCALL
#define CYTHON_FAST_PYCCALL  CYTHON_FAST_PYCALL
#endif
#ifndef CYTHON_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API
#define CYTHON_VECTORCALL  (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
#else
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL)
#endif
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #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<class T> 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 && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#  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)
#include <stdint.h>
typedef uintptr_t  __pyx_uintptr_t;
#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
#ifndef Py_UNREACHABLE
  #define Py_UNREACHABLE()  assert(0); abort()
#endif
#ifdef __cplusplus
  template <typename T>
  struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::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 < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))

/* CInitCode */
#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

/* PythonCompatibility */
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    #ifndef CO_OPTIMIZED
    static int CO_OPTIMIZED;
    #endif
    #ifndef CO_NEWLOCALS
    static int CO_NEWLOCALS;
    #endif
    #ifndef CO_VARARGS
    static int CO_VARARGS;
    #endif
    #ifndef CO_VARKEYWORDS
    static int CO_VARKEYWORDS;
    #endif
    #ifndef CO_ASYNC_GENERATOR
    static int CO_ASYNC_GENERATOR;
    #endif
    #ifndef CO_GENERATOR
    static int CO_GENERATOR;
    #endif
    #ifndef CO_COROUTINE
    static int CO_COROUTINE;
    #endif
#else
    #ifndef CO_COROUTINE
      #define CO_COROUTINE 0x80
    #endif
    #ifndef CO_ASYNC_GENERATOR
      #define CO_ASYNC_GENERATOR 0x200
    #endif
#endif
static int __Pyx_init_co_variables(void);
#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 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 Py_TPFLAGS_IMMUTABLETYPE
  #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
#endif
#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
  #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#ifndef 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
  #if PY_VERSION_HEX >= 0x030d00A4
  #  define __Pyx_PyCFunctionFast PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  #else
  #  define __Pyx_PyCFunctionFast _PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  #endif
#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))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_VERSION_HEX >= 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)(void)) {
#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 PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  #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_PyFrame_SetLineNumber(frame, lineno)
#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
#elif CYTHON_COMPILING_IN_GRAAL
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _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()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#endif
#if CYTHON_USE_MODULE_STATE
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;
}
#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
#else
#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
  #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
  #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
    ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
     (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
     __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
  #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
  #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#if CYTHON_COMPILING_IN_CPYTHON && 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 !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)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
#endif
#define __Pyx_PyObject_GetIterNextFunc(iterator)  __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
#if CYTHON_USE_TYPE_SPECS
#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 __Pyx_PyUnicode_READY(op)       (0)
  #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))
#else
  #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_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
#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)
    #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_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#elif 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
enum __Pyx_ReferenceSharing {
  __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
  __Pyx_ReferenceSharing_OwnStrongReference,
  __Pyx_ReferenceSharing_FunctionArgument,
  __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
};
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
    (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
      (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
      (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
#else
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
#endif
#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  #else
    #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
  #endif
#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #else
    #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
  #endif
#else
  #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
#endif
#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) (__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
    __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
#else
  #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyObject_GetItem(dict, key);
  if (*result == NULL) {
    if (PyErr_ExceptionMatches(PyExc_KeyError)) {
      PyErr_Clear();
      return 0;
    }
    return -1;
  }
  return 1;
}
#else
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyDict_GetItemWithError(dict, key);
  if (*result == NULL) {
    return PyErr_Occurred() ? -1 : 0;
  }
  Py_INCREF(*result);
  return 1;
}
#endif
#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
  #define __Pyx_VISIT_CONST(obj)  Py_VISIT(obj)
#else
  #define __Pyx_VISIT_CONST(obj)
#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_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
#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_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
#endif
#if CYTHON_ASSUME_SAFE_SIZE
  #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)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
#else
  #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)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
#define __Pyx_PyLong_AsHash_t   __Pyx_PyIndex_AsSsize_t
#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
    #define __Pyx_PySendResult PySendResult
#else
    typedef enum {
        PYGEN_RETURN = 0,
        PYGEN_ERROR = -1,
        PYGEN_NEXT = 1,
    } __Pyx_PySendResult;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
  typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
#else
  #define __Pyx_pyiter_sendfunc sendfunc
#endif
#if !CYTHON_USE_AM_SEND
#define __PYX_HAS_PY_AM_SEND 0
#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
#define __PYX_HAS_PY_AM_SEND 1
#else
#define __PYX_HAS_PY_AM_SEND 2  // our own backported implementation
#endif
#if __PYX_HAS_PY_AM_SEND < 2
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#else
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
        __Pyx_pyiter_sendfunc am_send;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
#endif
#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
#else
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
#endif
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get()
#else
#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
#ifdef __cplusplus
extern "C"
#endif
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
    int value;
    PyObject *py_value = PyObject_GetAttrString(inspect, name);
    if (!py_value) return 0;
    value = (int) PyLong_AsLong(py_value);
    Py_DECREF(py_value);
    *write_to = value;
    return value != -1 || !PyErr_Occurred();
}
static int __Pyx_init_co_variables(void) {
    PyObject *inspect;
    int result;
    inspect = PyImport_ImportModule("inspect");
    result =
#if !defined(CO_OPTIMIZED)
        __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
#endif
#if !defined(CO_NEWLOCALS)
        __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
#endif
#if !defined(CO_VARARGS)
        __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
#endif
#if !defined(CO_VARKEYWORDS)
        __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
#endif
#if !defined(CO_ASYNC_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
#endif
#if !defined(CO_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
#endif
#if !defined(CO_COROUTINE)
        __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
#endif
        1;
    Py_DECREF(inspect);
    return result ? 0 : -1;
}
#else
static int __Pyx_init_co_variables(void) {
    return 0;  // It's a limited API-only feature
}
#endif

/* MathInitCode */
#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  #ifndef _USE_MATH_DEFINES
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0
#endif
#ifndef CYTHON_CLINE_IN_TRACEBACK
#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#endif
#if CYTHON_CLINE_IN_TRACEBACK
#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; }
#else
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
#endif
#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 <petsc.h>

    #include "pyapicompat.h"
    #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 <petsc4py/pyscalar.h>
#include <petsc4py/pybuffer.h>
#include <petsc4py/numpy.h>
#include <stdlib.h>
#include "cython.h"
#include <petsc/private/garbagecollector.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>

    #include "lib-petsc/initpkg.h"
    
#include "pythread.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifdef CYTHON_FREETHREADING_COMPATIBLE
#if CYTHON_FREETHREADING_COMPATIBLE
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
#endif
#else
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
#endif
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#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 <cstdlib>
    #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 CYTHON_ASSUME_SAFE_MACROS
    #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_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
#else
    #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
#endif
#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_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
    return Py_NewRef(obj);
#else
    Py_INCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
    return Py_XNewRef(obj);
#else
    Py_XINCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
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_Long(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_PyLong_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))
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
#else
#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
#endif
#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#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
  #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 __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
#else
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#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__ */
/* PretendToInitialize */
#ifdef __cplusplus
#if __cplusplus > 201103L
#include <type_traits>
#endif
template <typename T>
static void __Pyx_pretend_to_initialize(T* ptr) {
#if __cplusplus > 201103L
    if ((std::is_trivially_default_constructible<T>::value))
#endif
        *ptr = T();
    (void)ptr;
}
#else
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
#endif


#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * const __pyx_cfilenm = __FILE__;
static const char *__pyx_filename;

/* #### Code section: filename_table ### */

static const char* const __pyx_f[] = {
  "petsc4py/PETSc.pyx",
  "petsc4py/PETSc/Const.pyx",
  "petsc4py/PETSc/Device.pyx",
  "petsc4py/PETSc/petscvec.pxi",
  "petsc4py/PETSc/petscdmda.pxi",
  "petsc4py/PETSc/libpetsc4py.pyx",
  "View.MemoryView",
  "petsc4py/PETSc/PETSc.pyx",
  "petsc4py/PETSc/arraynpy.pxi",
  "petsc4py/PETSc/dlpack.pxi",
  "petsc4py/PETSc/petscdef.pxi",
  "petsc4py/PETSc/petscopt.pxi",
  "petsc4py/PETSc/petscmpi.pxi",
  "petsc4py/PETSc/petscsys.pxi",
  "petsc4py/PETSc/petsclog.pxi",
  "petsc4py/PETSc/petscobj.pxi",
  "petsc4py/PETSc/petscvwr.pxi",
  "petsc4py/PETSc/petscdevice.pxi",
  "petsc4py/PETSc/petscis.pxi",
  "petsc4py/PETSc/petscmat.pxi",
  "petsc4py/PETSc/petscpc.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/Error.pyx",
  "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/Regressor.pyx",
  "petsc4py/PETSc/CAPI.pyx",
};
/* #### Code section: utility_code_proto_before_types ### */
/* Atomics.proto (used by UnpackUnboundCMethod) */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#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 <stdatomic.h>
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)))
    #include <atomic>
#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_ptr_type atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) atomic_load(value)
    #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #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_ptr_type std::atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) std::atomic_load(value)
    #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #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_ptr_type void*
    #define __pyx_nonatomic_ptr_type void*
    #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
    #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && defined(_MSC_VER)
    #include <intrin.h>
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type long
    #define __pyx_atomic_ptr_type void*
    #undef __pyx_nonatomic_int_type
    #define __pyx_nonatomic_int_type long
    #define __pyx_nonatomic_ptr_type void*
    #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
    #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
    #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
    #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
    #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
    static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
        __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #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

/* CriticalSectionsDefinition.proto (used by CriticalSections) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection void*
#define __Pyx_PyCriticalSection2 void*
#define __Pyx_PyCriticalSection_End(cs)
#define __Pyx_PyCriticalSection2_End(cs)
#else
#define __Pyx_PyCriticalSection PyCriticalSection
#define __Pyx_PyCriticalSection2 PyCriticalSection2
#define __Pyx_PyCriticalSection_End PyCriticalSection_End
#define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
#endif

/* CriticalSections.proto (used by ParseKeywordsImpl) */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
#define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
#else
#define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
#define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
#endif
#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
#define __Pyx_END_CRITICAL_SECTION() }
#else
#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
#endif

/* 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()

/* IncludeStructmemberH.proto (used by FixUpExtensionType) */
#include <structmember.h>

/* BufferFormatStructs.proto */
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name;
  const 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_ {
  const __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;
typedef struct {
  const __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;

/* 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])
#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
#define __Pyx_MEMSLICE_INIT  { 0, 0, { 0 }, { 0 }, { 0 } }
#if CYTHON_ATOMICS
    #define __pyx_add_acquisition_count(memview)\
             __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview))
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_atomic_decr_acq_rel(__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

/* #### 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 PyPetscSNESLineSearchObject;
struct PyPetscTSObject;
struct PyPetscTAOObject;
struct PyPetscTAOLineSearchObject;
struct PyPetscTAOTermObject;
struct PyPetscAOObject;
struct PyPetscDMObject;
struct PyPetscDMPlexTransformObject;
struct PyPetscDMSwarmCellDMObject;
struct PyPetscDSObject;
struct PyPetscPartitionerObject;
struct PyPetscDMLabelObject;
struct PyPetscRegressorObject;
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__PyVwr;
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 = <unsigned int>1
 *     kDLCUDA = <unsigned int>2
*/
enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType {

  /* "petsc4py/PETSc/dlpack.pxi":35
 *     kDLROCMHost = <unsigned int>11
 *     # kDLExtDev = <unsigned int>12
 *     kDLCUDAManaged = <unsigned int>13             # <<<<<<<<<<<<<<
 *     # kDLOneAPI = <unsigned int>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 = <unsigned int>0
 *     kDLUInt = <unsigned int>1
*/
enum __pyx_t_8petsc4py_5PETSc_DLDataTypeCode {

  /* "petsc4py/PETSc/dlpack.pxi":45
 *     kDLInt = <unsigned int>0
 *     kDLUInt = <unsigned int>1
 *     kDLFloat = <unsigned int>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":168
 *     raise KeyError(opt2str(pre, name))
 * 
 * cdef enum PetscOptType:             # <<<<<<<<<<<<<<
 *     OPT_BOOL
 *     OPT_BOOLARRAY
*/
enum __pyx_t_8petsc4py_5PETSc_PetscOptType {
  __pyx_e_8petsc4py_5PETSc_OPT_BOOL,
  __pyx_e_8petsc4py_5PETSc_OPT_BOOLARRAY,
  __pyx_e_8petsc4py_5PETSc_OPT_INT,
  __pyx_e_8petsc4py_5PETSc_OPT_INTARRAY,
  __pyx_e_8petsc4py_5PETSc_OPT_REAL,
  __pyx_e_8petsc4py_5PETSc_OPT_REALARRAY,
  __pyx_e_8petsc4py_5PETSc_OPT_SCALAR,
  __pyx_e_8petsc4py_5PETSc_OPT_SCALARARRAY,
  __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 = <unsigned int>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 = <unsigned int>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":43
 * #
 * 
 * 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":354
 * # --------------------------------------------------------------------
 * 
 * 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":915
 * # -----------------------------------------------------------------------------
 * 
 * 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":121
 * # --------------------------------------------------------------------
 * 
 * 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":129
 *     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 *__dummy__;
  PetscObject oval;
  PetscObject *obj;
};
typedef struct PyPetscObjectObject PyPetscObjectObject;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscObject_Type;

/* "petsc4py/PETSc.pxd":141
 *     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":147
 *     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":153
 *     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":160
 *     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":166
 *     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":172
 *     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":178
 *     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":184
 *     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":190
 *     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":196
 *     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":202
 *     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":208
 *     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":214
 *     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":220
 *     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":226
 *     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":232
 *     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":238
 *     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":244
 *     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":250
 *     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":256
 *     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":262
 *     cdef PetscSNES snes
 * 
 * ctypedef public api class SNESLineSearch(Object) [             # <<<<<<<<<<<<<<
 *     type   PyPetscSNESLineSearch_Type,
 *     object PyPetscSNESLineSearchObject,
*/
struct PyPetscSNESLineSearchObject {
  struct PyPetscObjectObject __pyx_base;
  SNESLineSearch snesls;
};
typedef struct PyPetscSNESLineSearchObject PyPetscSNESLineSearchObject;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscSNESLineSearch_Type;

/* "petsc4py/PETSc.pxd":268
 *     cdef PetscSNESLineSearch snesls
 * 
 * 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":274
 *     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":280
 *     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":286
 *     cdef PetscTAOLineSearch taols
 * 
 * ctypedef public api class TAOTerm(Object) [             # <<<<<<<<<<<<<<
 *     type   PyPetscTAOTerm_Type,
 *     object PyPetscTAOTermObject,
*/
struct PyPetscTAOTermObject {
  struct PyPetscObjectObject __pyx_base;
  TaoTerm taoterm;
};
typedef struct PyPetscTAOTermObject PyPetscTAOTermObject;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTAOTerm_Type;

/* "petsc4py/PETSc.pxd":292
 *     cdef PetscTAOTerm taoterm
 * 
 * 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":298
 *     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":304
 *     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":310
 *     cdef PetscDMPlexTransform tr
 * 
 * ctypedef public api class CellDM(Object) [             # <<<<<<<<<<<<<<
 *     type   PyPetscDMSwarmCellDM_Type,
 *     object PyPetscDMSwarmCellDMObject,
*/
struct PyPetscDMSwarmCellDMObject {
  struct PyPetscObjectObject __pyx_base;
  DMSwarmCellDM cdm;
};
typedef struct PyPetscDMSwarmCellDMObject PyPetscDMSwarmCellDMObject;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDMSwarmCellDM_Type;

/* "petsc4py/PETSc.pxd":316
 *     cdef PetscDMSwarmCellDM cdm
 * 
 * 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":322
 *     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":328
 *     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.pxd":334
 *     cdef PetscDMLabel dmlabel
 * 
 * ctypedef public api class Regressor(Object) [             # <<<<<<<<<<<<<<
 *     type   PyPetscRegressor_Type,
 *     object PyPetscRegressorObject,
*/
struct PyPetscRegressorObject {
  struct PyPetscObjectObject __pyx_base;
  PetscRegressor regressor;
};
typedef struct PyPetscRegressorObject PyPetscRegressorObject;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscRegressor_Type;

/* "petsc4py/PETSc/petscis.pxi":122
 * # --------------------------------------------------------------------
 * 
 * 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":503
 *     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":594
 * # --------------------------------------------------------------------
 * 
 * cdef class _Vec_LocalForm:             # <<<<<<<<<<<<<<
 * 
 *     cdef Vec gvec
*/
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:             # <<<<<<<<<<<<<<
 *     """The options database object.
 * 
*/
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":272
 * # --------------------------------------------------------------------
 * 
 * cdef class LogStage:             # <<<<<<<<<<<<<<
 *     """Logging support for different stages."""
 * 
*/
struct __pyx_obj_8petsc4py_5PETSc_LogStage {
  PyObject_HEAD
  PetscLogStage id;
};


/* "petsc4py/PETSc/Log.pyx":458
 * # --------------------------------------------------------------------
 * 
 * cdef class LogClass:             # <<<<<<<<<<<<<<
 *     """Logging support."""
 * 
*/
struct __pyx_obj_8petsc4py_5PETSc_LogClass {
  PyObject_HEAD
  PetscClassId id;
};


/* "petsc4py/PETSc/Log.pyx":535
 * # --------------------------------------------------------------------
 * 
 * cdef class LogEvent:             # <<<<<<<<<<<<<<
 *     """Logging support."""
 * 
*/
struct __pyx_obj_8petsc4py_5PETSc_LogEvent {
  PyObject_HEAD
  PetscLogEvent id;
};


/* "petsc4py/PETSc/Viewer.pyx":1033
 * # --------------------------------------------------------------------
 * 
 * cdef class ViewerHDF5(Viewer):             # <<<<<<<<<<<<<<
 *     """Viewer object for HDF5 file formats.
 * 
*/
struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5 {
  struct PyPetscViewerObject __pyx_base;
};


/* "petsc4py/PETSc/Mat.pyx":285
 * 
 * 
 * @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":23
 * 
 * 
 * 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":3
 * # --------------------------------------------------------------------
 * 
 * cdef class DMPlex(DM):             # <<<<<<<<<<<<<<
 *     """Encapsulate an unstructured mesh.
 * 
*/
struct __pyx_obj_8petsc4py_5PETSc_DMPlex {
  struct PyPetscDMObject __pyx_base;
};


/* "petsc4py/PETSc/DMStag.pyx":44
 * 
 * 
 * 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":32
 * 
 * 
 * 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":171
 * 
 * 
 * @cython.internal             # <<<<<<<<<<<<<<
 * cdef class _PyObj:
 * 
*/
struct __pyx_obj_8petsc4py_5PETSc__PyObj {
  PyObject_HEAD
  struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj *__pyx_vtab;
  PyObject *self;
  PyObject *name;
};


/* "petsc4py/PETSc/libpetsc4py.pyx":305
 * 
 * 
 * @cython.internal             # <<<<<<<<<<<<<<
 * cdef class _PyVwr(_PyObj):
 * 
*/
struct __pyx_obj_8petsc4py_5PETSc__PyVwr {
  struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base;
  PyObject *filename;
};


/* "petsc4py/PETSc/libpetsc4py.pyx":577
 * 
 * 
 * @cython.internal             # <<<<<<<<<<<<<<
 * cdef class _PyMat(_PyObj): pass
 * cdef inline _PyMat PyMat(PetscMat mat):
*/
struct __pyx_obj_8petsc4py_5PETSc__PyMat {
  struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base;
};


/* "petsc4py/PETSc/libpetsc4py.pyx":1428
 * 
 * 
 * @cython.internal             # <<<<<<<<<<<<<<
 * cdef class _PyPC(_PyObj): pass
 * cdef inline _PyPC PyPC(PetscPC pc):
*/
struct __pyx_obj_8petsc4py_5PETSc__PyPC {
  struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base;
};


/* "petsc4py/PETSc/libpetsc4py.pyx":1724
 * 
 * 
 * @cython.internal             # <<<<<<<<<<<<<<
 * cdef class _PyKSP(_PyObj): pass
 * cdef inline _PyKSP PyKSP(PetscKSP ksp):
*/
struct __pyx_obj_8petsc4py_5PETSc__PyKSP {
  struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base;
};


/* "petsc4py/PETSc/libpetsc4py.pyx":2067
 * 
 * 
 * @cython.internal             # <<<<<<<<<<<<<<
 * cdef class _PySNES(_PyObj): pass
 * cdef inline _PySNES PySNES(PetscSNES snes):
*/
struct __pyx_obj_8petsc4py_5PETSc__PySNES {
  struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base;
};


/* "petsc4py/PETSc/libpetsc4py.pyx":2390
 * 
 * 
 * @cython.internal             # <<<<<<<<<<<<<<
 * cdef class _PyTS(_PyObj): pass
 * cdef inline _PyTS PyTS(PetscTS ts):
*/
struct __pyx_obj_8petsc4py_5PETSc__PyTS {
  struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base;
};


/* "petsc4py/PETSc/libpetsc4py.pyx":2790
 * 
 * 
 * @cython.internal             # <<<<<<<<<<<<<<
 * cdef class _PyTao(_PyObj): pass
 * cdef inline _PyTao PyTao(PetscTAO tao):
*/
struct __pyx_obj_8petsc4py_5PETSc__PyTao {
  struct __pyx_obj_8petsc4py_5PETSc__PyObj __pyx_base;
};


/* "petsc4py/PETSc/Log.pyx":240
 *         return cputime
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def EventDecorator(cls, name=None, klass=None) -> Any:
 *         """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":243
 *     def EventDecorator(cls, name=None, klass=None) -> Any:
 *         """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":118
 * 
 * 
 * @cython.collection_type("sequence")             # <<<<<<<<<<<<<<
 * @cname("__pyx_array")
 * cdef class array:
*/
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":307
 * 
 * 
 * @cname('__pyx_MemviewEnum')             # <<<<<<<<<<<<<<
 * cdef class Enum(object):
 *     cdef object name
*/
struct __pyx_MemviewEnum_obj {
  PyObject_HEAD
  PyObject *name;
};


/* "View.MemoryView":342
 * 
 * 
 * @cname('__pyx_memoryview')             # <<<<<<<<<<<<<<
 * cdef class memoryview:
 * 
*/
struct __pyx_memoryview_obj {
  PyObject_HEAD
  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
  PyObject *obj;
  PyObject *_size;
  void *_unused;
  PyThread_type_lock lock;
  __pyx_atomic_int_type acquisition_count;
  Py_buffer view;
  int flags;
  int dtype_is_object;
  __Pyx_TypeInfo const *typeinfo;
};


/* "View.MemoryView":856
 * 
 * 
 * @cython.collection_type("sequence")             # <<<<<<<<<<<<<<
 * @cname('__pyx_memoryviewslice')
 * cdef class _memoryviewslice(memoryview):
*/
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:             # <<<<<<<<<<<<<<
 *     """Base class wrapping a PETSc object.
 * 
*/

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":91
 * 
 * 
 * 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":14
 * 
 * 
 * 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":223
 * # --------------------------------------------------------------------
 * 
 * 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":12
 * 
 * 
 * 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":1149
 * # --------------------------------------------------------------------
 * 
 * cdef class LGMap(Object):             # <<<<<<<<<<<<<<
 *     """Mapping from a local to a global ordering.
 * 
*/

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":17
 * 
 * 
 * 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":32
 * 
 * 
 * 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":16
 * 
 * 
 * cdef class Space(Object):             # <<<<<<<<<<<<<<
 *     """Function 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":573
 * 
 * 
 * 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":12
 * 
 * 
 * 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":23
 * 
 * 
 * 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":376
 * # --------------------------------------------------------------------
 * 
 * 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":17
 * 
 * 
 * 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":6257
 * # --------------------------------------------------------------------
 * 
 * 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":174
 * 
 * 
 * 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":375
 * 
 * 
 * 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":105
 * 
 * 
 * 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) PyPetscSNESLineSearch_Type;

/* "petsc4py/PETSc/SNES.pyx":2736
 * 
 * 
 * cdef class SNESLineSearch(Object):             # <<<<<<<<<<<<<<
 *     """Linesearch object used by SNES solvers.
 * 
*/

struct __pyx_vtabstruct_8petsc4py_5PETSc_SNESLineSearch {
  struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_SNESLineSearch *__pyx_vtabptr_8petsc4py_5PETSc_SNESLineSearch;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscTS_Type;

/* "petsc4py/PETSc/TS.pyx":139
 * 
 * 
 * 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":98
 * 
 * 
 * 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":2218
 * 
 * 
 * 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) PyPetscTAOTerm_Type;

/* "petsc4py/PETSc/TAO.pyx":2509
 * 
 * 
 * cdef class TAOTerm(Object):             # <<<<<<<<<<<<<<
 *     """TAO Term."""
 * 
*/

struct __pyx_vtabstruct_8petsc4py_5PETSc_TAOTerm {
  struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_TAOTerm *__pyx_vtabptr_8petsc4py_5PETSc_TAOTerm;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscAO_Type;

/* "petsc4py/PETSc/AO.pyx":13
 * 
 * 
 * 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":61
 * 
 * 
 * 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":3680
 * 
 * 
 * cdef class DMPlexTransform(Object):             # <<<<<<<<<<<<<<
 *     """Mesh transformations."""
 * 
*/

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) PyPetscDMSwarmCellDM_Type;

/* "petsc4py/PETSc/DMSwarm.pyx":1074
 * # --------------------------------------------------------------------
 * 
 * cdef class CellDM(Object):             # <<<<<<<<<<<<<<
 *     """CellDM object.
 * 
*/

struct __pyx_vtabstruct_8petsc4py_5PETSc_CellDM {
  struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_CellDM *__pyx_vtabptr_8petsc4py_5PETSc_CellDM;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscDS_Type;

/* "petsc4py/PETSc/DS.pyx":10
 * 
 * 
 * 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":17
 * 
 * 
 * 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;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyPetscRegressor_Type;

/* "petsc4py/PETSc/Regressor.pyx":24
 * 
 * 
 * cdef class Regressor(Object):             # <<<<<<<<<<<<<<
 *     """Regression solver.
 * 
*/

struct __pyx_vtabstruct_8petsc4py_5PETSc_Regressor {
  struct __pyx_vtabstruct_8petsc4py_5PETSc_Object __pyx_base;
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc_Regressor *__pyx_vtabptr_8petsc4py_5PETSc_Regressor;


/* "petsc4py/PETSc/petscis.pxi":122
 * # --------------------------------------------------------------------
 * 
 * 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 *);
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc__IS_buffer *__pyx_vtabptr_8petsc4py_5PETSc__IS_buffer;


/* "petsc4py/PETSc/petscvec.pxi":503
 *     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 *);
};
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":1033
 * # --------------------------------------------------------------------
 * 
 * cdef class ViewerHDF5(Viewer):             # <<<<<<<<<<<<<<
 *     """Viewer object for HDF5 file formats.
 * 
*/

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":23
 * 
 * 
 * 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":3
 * # --------------------------------------------------------------------
 * 
 * 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":44
 * 
 * 
 * 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":32
 * 
 * 
 * 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":171
 * 
 * 
 * @cython.internal             # <<<<<<<<<<<<<<
 * cdef class _PyObj:
 * 
*/

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 const *);
  char *(*getname)(struct __pyx_obj_8petsc4py_5PETSc__PyObj *);
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj *__pyx_vtabptr_8petsc4py_5PETSc__PyObj;


/* "petsc4py/PETSc/libpetsc4py.pyx":305
 * 
 * 
 * @cython.internal             # <<<<<<<<<<<<<<
 * cdef class _PyVwr(_PyObj):
 * 
*/

struct __pyx_vtabstruct_8petsc4py_5PETSc__PyVwr {
  struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj __pyx_base;
  int (*setfilename)(struct __pyx_obj_8petsc4py_5PETSc__PyVwr *, char const *);
  char *(*getfilename)(struct __pyx_obj_8petsc4py_5PETSc__PyVwr *);
};
static struct __pyx_vtabstruct_8petsc4py_5PETSc__PyVwr *__pyx_vtabptr_8petsc4py_5PETSc__PyVwr;


/* "petsc4py/PETSc/libpetsc4py.pyx":577
 * 
 * 
 * @cython.internal             # <<<<<<<<<<<<<<
 * cdef class _PyMat(_PyObj): pass
 * cdef inline _PyMat PyMat(PetscMat mat):
*/

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":1428
 * 
 * 
 * @cython.internal             # <<<<<<<<<<<<<<
 * cdef class _PyPC(_PyObj): pass
 * cdef inline _PyPC PyPC(PetscPC pc):
*/

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":1724
 * 
 * 
 * @cython.internal             # <<<<<<<<<<<<<<
 * cdef class _PyKSP(_PyObj): pass
 * cdef inline _PyKSP PyKSP(PetscKSP ksp):
*/

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":2067
 * 
 * 
 * @cython.internal             # <<<<<<<<<<<<<<
 * cdef class _PySNES(_PyObj): pass
 * cdef inline _PySNES PySNES(PetscSNES snes):
*/

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":2390
 * 
 * 
 * @cython.internal             # <<<<<<<<<<<<<<
 * cdef class _PyTS(_PyObj): pass
 * cdef inline _PyTS PyTS(PetscTS ts):
*/

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":2790
 * 
 * 
 * @cython.internal             # <<<<<<<<<<<<<<
 * cdef class _PyTao(_PyObj): pass
 * cdef inline _PyTao PyTao(PetscTAO tao):
*/

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":118
 * 
 * 
 * @cython.collection_type("sequence")             # <<<<<<<<<<<<<<
 * @cname("__pyx_array")
 * cdef class array:
*/

struct __pyx_vtabstruct_array {
  PyObject *(*get_memview)(struct __pyx_array_obj *);
};
static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;


/* "View.MemoryView":342
 * 
 * 
 * @cname('__pyx_memoryview')             # <<<<<<<<<<<<<<
 * cdef class memoryview:
 * 
*/

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":856
 * 
 * 
 * @cython.collection_type("sequence")             # <<<<<<<<<<<<<<
 * @cname('__pyx_memoryviewslice')
 * cdef class _memoryviewslice(memoryview):
*/

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;
  #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);\
          }
  #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 (used by PyObjectGetAttrStrNoError) */
#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 (used by PyErrFetchRestore) */
#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 (used by PyObjectGetAttrStrNoError) */
#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 (used by PyObjectGetAttrStrNoError) */
#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 (used by GetBuiltinName) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* TupleAndListFromArray.proto (used by fastcall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
#endif
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif

/* IncludeStringH.proto (used by BytesEquals) */
#include <string.h>

/* BytesEquals.proto (used by UnicodeEquals) */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto (used by fastcall) */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
#else
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
#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_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
    #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_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_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
#else
    #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_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
#endif
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
#else
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif

/* KeywordStringCheck.proto */
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(const char* function_name, PyObject *kw);

/* py_dict_items.proto (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

/* CallCFunction.proto (used by CallUnboundCMethod0) */
#define __Pyx_CallCFunction(cfunc, self, args)\
    ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
    ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
    ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
    ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)

/* PyObjectCall.proto (used by PyObjectFastCall) */
#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 (used by PyObjectFastCall) */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectFastCall.proto (used by PyObjectCallOneArg) */
#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 * const*args, size_t nargs, PyObject *kwargs);

/* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
typedef struct {
    PyObject *type;
    PyObject **method_name;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
    __pyx_atomic_int_type initialized;
#endif
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
#if !CYTHON_ATOMICS
    return 1;
#else
    __pyx_nonatomic_int_type expected = 0;
    if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
        return 0;
    }
    return expected;
#endif
}
static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
#if CYTHON_ATOMICS
    __pyx_atomic_store(&cfunc->initialized, 2);
#endif
}
#else
#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
#endif

/* CallUnboundCMethod0.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

/* py_dict_values.proto (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);

/* OwnedDictNext.proto (used by ParseKeywordsImpl) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
#else
CYTHON_INLINE
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
#endif

/* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywordsImpl.export */
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name
);
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);

/* CallUnboundCMethod2.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON
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

/* ParseKeywords.proto */
static CYTHON_INLINE int __Pyx_ParseKeywords(
    PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
    PyObject *kwds2, PyObject *values[],
    Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs
);

/* 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);

/* ArgTypeTestFunc.export */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* 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))

/* PyValueError_Check.proto */
#define __Pyx_PyExc_ValueError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_ValueError)

/* RaiseException.export */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* PyObjectFastCallMethod.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
#else
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
#endif

/* RaiseUnexpectedTypeError.proto */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);

/* PyMemoryError_Check.proto */
#define __Pyx_PyExc_MemoryError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_MemoryError)

/* BuildPyUnicode.proto (used by COrdinalToPyUnicode) */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const char* chars, int clength,
                                                int prepend_sign, char padding_char);

/* COrdinalToPyUnicode.proto (used by CIntToPyUnicode) */
static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value);
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t width, char padding_char);

/* GCCDiagnostics.proto (used by CIntToPyUnicode) */
#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif

/* IncludeStdlibH.proto (used by CIntToPyUnicode) */
#include <stdlib.h>

/* CIntToPyUnicode.proto */
#define __Pyx_PyUnicode_From_int(value, width, padding_char, format_char) (\
    ((format_char) == ('c')) ?\
        __Pyx_uchar___Pyx_PyUnicode_From_int(value, width, padding_char) :\
        __Pyx____Pyx_PyUnicode_From_int(value, width, padding_char, format_char)\
    )
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char);
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);

/* CIntToPyUnicode.proto */
#define __Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char) (\
    ((format_char) == ('c')) ?\
        __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char) :\
        __Pyx____Pyx_PyUnicode_From_Py_ssize_t(value, width, padding_char, format_char)\
    )
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char);
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);

/* JoinPyUnicode.export */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char);

/* 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 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, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck, unsafe_shared) :\
    (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, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
    (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, int unsafe_shared);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck, unsafe_shared) :\
    (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, int unsafe_shared);
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, int unsafe_shared);

/* 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

/* RejectKeywords.export */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);

/* PyTypeError_Check.proto */
#define __Pyx_PyExc_TypeError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_TypeError)

/* DivInt[Py_ssize_t].proto */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t, int b_is_constant);

/* 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 (used by GetModuleGlobalName) */
#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_XNewRef(__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_mstate_global->__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_LIMITED_API  ||  PY_VERSION_HEX >= 0x030C0000
  static int __pyx_assertions_enabled_flag;
  #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
  #if __clang__ || __GNUC__
  __attribute__((no_sanitize("thread")))
  #endif
  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

/* PyAssertionError_Check.proto */
#define __Pyx_PyExc_AssertionError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_AssertionError)

/* 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 (used by SaveResetException) */
#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

/* HasAttr.proto (used by ImportImpl) */
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_HasAttr(o, n)  PyObject_HasAttrWithError(o, n)
#else
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
#endif

/* ImportImpl.export */
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);

/* Import.proto */
static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);

/* 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)
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
    return 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)
#ifdef PyExceptionInstance_Check
  #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj)
#else
  #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException)
#endif

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)
#if !CYTHON_USE_TYPE_SLOTS
#define  __Pyx_PySequence_Multiply PySequence_Repeat
#else
static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
#endif

/* PyObjectFormatAndDecref.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);

/* PyObjectFormat.proto */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
#else
#define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
#endif

/* SetItemInt.proto */
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil, unsafe_shared)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck, unsafe_shared) :\
    (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, int unsafe_shared);

/* RaiseUnboundLocalError.proto */
static void __Pyx_RaiseUnboundLocalError(const char *varname);

/* PyIndexError_Check.proto */
#define __Pyx_PyExc_IndexError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_IndexError)

/* DivInt[long].proto */
static CYTHON_INLINE long __Pyx_div_long(long, long, int b_is_constant);

/* 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 (used by PyObjectCallMethod1) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectGetMethod.proto (used by PyObjectCallMethod1) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
#endif

/* PyObjectCallMethod1.proto (used by StringJoin) */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* StringJoin.proto */
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);

/* CIntToPyUnicode.proto */
#define __Pyx_PyUnicode_From_size_t(value, width, padding_char, format_char) (\
    ((format_char) == ('c')) ?\
        __Pyx_uchar___Pyx_PyUnicode_From_size_t(value, width, padding_char) :\
        __Pyx____Pyx_PyUnicode_From_size_t(value, width, padding_char, format_char)\
    )
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char);
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char, char format_char);

/* decode_c_string_utf16.proto (used by decode_c_bytes) */
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 (used by decode_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));

/* 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 && CYTHON_ASSUME_SAFE_SIZE
    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);
}

/* 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);

/* 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);

/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

/* FloatExceptionCheck.proto */
#define __PYX_CHECK_FLOAT_EXCEPTION(value, error_value)\
    ((error_value) == (error_value) ?\
     (value) == (error_value) :\
     (value) != (value))

/* PyKeyError_Check.proto */
#define __Pyx_PyExc_KeyError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_KeyError)

/* PyObject_Unicode.proto */
#define __Pyx_PyObject_Unicode(obj)\
    (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))

/* 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 && CYTHON_ASSUME_SAFE_SIZE
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

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

/* PyAttributeError_Check.proto */
#define __Pyx_PyExc_AttributeError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_AttributeError)

/* PyNotImplementedError_Check.proto */
#define __Pyx_PyExc_NotImplementedError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_NotImplementedError)

/* PyObjectDelAttr.proto (used by PyObjectSetAttrStr) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
#else
#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
#endif

/* 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)   __Pyx_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);

/* CallUnboundCMethod1.proto */
CYTHON_UNUSED
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

/* CIntToPyUnicode.proto */
#define __Pyx_PyUnicode_From_long(value, width, padding_char, format_char) (\
    ((format_char) == ('c')) ?\
        __Pyx_uchar___Pyx_PyUnicode_From_long(value, width, padding_char) :\
        __Pyx____Pyx_PyUnicode_From_long(value, width, padding_char, format_char)\
    )
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char);
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char);

/* 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);

/* 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));
}

/* PyLongCompare.proto */
static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* PyLongBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* PyObjectCallNoArg.proto (used by pyfrozenset_new) */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);

/* pyfrozenset_new.proto (used by PySetContains) */
static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it);

/* PySetContains.proto */
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq);

/* PyRuntimeError_Check.proto */
#define __Pyx_PyExc_RuntimeError_Check(obj)  __Pyx_TypeCheck(obj, PyExc_RuntimeError)

/* append.proto */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

/* RaiseClosureNameError.proto */
static 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

/* dict_setdefault.proto (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);

/* LimitedApiGetTypeDict.proto (used by SetItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
#endif

/* SetItemOnTypeDict.proto (used by FixUpExtensionType) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)

/* FixUpExtensionType.proto (used by FetchCommonType) */
static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);

/* AddModuleRef.proto (used by FetchSharedCythonModule) */
#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\
     __PYX_LIMITED_VERSION_HEX < 0x030d0000)
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
#else
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#endif

/* FetchSharedCythonModule.proto (used by FetchCommonType) */
static PyObject *__Pyx_FetchSharedCythonABIModule(void);

/* FetchCommonType.proto (used by CommonTypesMetaclass) */
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);

/* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
static int __pyx_CommonTypesMetaclass_init(PyObject *module);
#define __Pyx_CommonTypesMetaclass_USED

/* CallTypeTraverse.proto (used by CythonFunctionShared) */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
#endif

/* PyMethodNew.proto (used by CythonFunctionShared) */
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);

/* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
#endif

/* CythonFunctionShared.proto (used by CythonFunction) */
#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_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_weakreflist;
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_dict;
#endif
    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
    PyObject *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_mstate_global->__pyx_CyFunctionType)
#define __Pyx_CyOrPyCFunction_Check(obj)  __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj)  __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
#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 PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
                                                         PyTypeObject *defaults_type);
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_COMPILING_IN_LIMITED_API
#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 (used by pop) */
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 && CYTHON_ASSUME_SAFE_SIZE
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 !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

/* PyRange_Check.proto */
#if CYTHON_COMPILING_IN_PYPY && !defined(PyRange_Check)
  #define PyRange_Check(obj)  __Pyx_TypeCheck((obj), &PyRange_Type)
#endif

/* PyObjectVectorCallKwBuilder.proto (used by PyObjectVectorCallMethodKwBuilder) */
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#if CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall
#endif
#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n)
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict
#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n)
#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value)
#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value)
#endif

/* PyObjectVectorCallMethodKwBuilder.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_VectorcallMethod_CallFromBuilder PyObject_VectorcallMethod
#else
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#endif

/* PyLongCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* CallableCheck.proto */
#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
#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)

/* AllocateExtensionType.proto */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final);

/* DeallocKeepAlive.proto */
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_DeallocKeepAliveBegin(o) do {\
        _Py_atomic_store_uintptr_relaxed(&(o)->ob_tid, _Py_ThreadId());\
        _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 1);\
        _Py_atomic_store_ssize_relaxed(&(o)->ob_ref_shared, 0);\
    } while (0)
#define __Pyx_DeallocKeepAliveEnd(o)\
        _Py_atomic_store_uint32_relaxed(&(o)->ob_ref_local, 0)
#else
#define __Pyx_DeallocKeepAliveBegin(o) __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1)
#define __Pyx_DeallocKeepAliveEnd(o)   __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1)
#endif

/* CheckTypeForFreelists.proto */
#if CYTHON_USE_FREELISTS
#if CYTHON_USE_TYPE_SPECS
#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t) == (expected_tp)))
#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS  Py_TPFLAGS_IS_ABSTRACT
#else
#define __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, expected_tp, expected_size) ((int) ((t)->tp_basicsize == (expected_size)))
#define __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS  (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)
#endif
#define __PYX_CHECK_TYPE_FOR_FREELISTS(t, expected_tp, expected_size)\
    (__PYX_CHECK_FINAL_TYPE_FOR_FREELISTS((t), (expected_tp), (expected_size)) &\
     (int) (!__Pyx_PyType_HasFeature((t), __PYX_CHECK_TYPE_FOR_FREELIST_FLAGS)))
#endif

/* FunctionExport.proto */
static int __Pyx_ExportFunction(PyObject *api_dict, const char *name, void (*f)(void), const char *sig);

/* GetApiDict.proto */
static PyObject *__Pyx_ApiExport_GetApiDict(void);

/* ValidateBasesTuple.proto (used by PyType_Ready) */
#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 (used by MergeVTables) */
static void* __Pyx_GetVtable(PyTypeObject *type);

/* MergeVTables.proto */
static int __Pyx_MergeVtables(PyTypeObject *type);

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_2_8
#define __PYX_HAVE_RT_ImportType_proto_3_2_8
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_8(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_2_8(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_2_8 {
   __Pyx_ImportType_CheckSize_Error_3_2_8 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_2_8 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_2_8 = 2
};
static PyTypeObject *__Pyx_ImportType_3_2_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_8 check_size);
#endif

/* DelItemOnTypeDict.proto (used by SetupReduce) */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)

/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);

/* 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 < 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 */
#if !CYTHON_COMPILING_IN_LIMITED_API
#include "descrobject.h"
#endif
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 CYTHON_COMPILING_IN_PYPY
static int __Pyx_RegisterCleanup(void);
#else
#define __Pyx_RegisterCleanup() (0)
#endif

/* CLineInTraceback.proto (used by AddTraceback) */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#else
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#endif

/* CodeObjectCache.proto (used by AddTraceback) */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject __Pyx_CachedCodeObjectType;
#else
typedef PyCodeObject __Pyx_CachedCodeObjectType;
#endif
typedef struct {
    __Pyx_CachedCodeObjectType* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_int_type accessor_count;
  #endif
};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* 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;

/* MemviewRefcount.proto */
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);

/* 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);

/* MemviewSliceInit.proto */
static int __Pyx_init_memviewslice(
                struct __pyx_memoryview_obj *memview,
                int ndim,
                __Pyx_memviewslice *memviewslice,
                int memview_is_new_reference);

/* SliceMemoryviewSlice.proto */
static CYTHON_INLINE int __pyx_memoryview_slice_memviewslice(
        __Pyx_memviewslice *dst,
        Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
        int dim, int new_ndim, int *suboffset_dim,
        Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
        int have_start, int have_stop, int have_step,
        int is_slice);

/* IsLittleEndian.proto (used by BufferFormatCheck) */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);

/* BufferFormatCheck.proto (used by MemviewSliceValidateAndInit) */
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,
                              const __Pyx_TypeInfo* type);

/* TypeInfoCompare.proto (used by MemviewSliceValidateAndInit) */
static int __pyx_typeinfo_cmp(const __Pyx_TypeInfo *a, const __Pyx_TypeInfo *b);

/* MemviewSliceValidateAndInit.export */
static int __Pyx_ValidateAndInit_memviewslice(
                int *axes_specs,
                int c_or_f_flag,
                int buf_flags,
                int ndim,
                const __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(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);
/* MemviewSliceCopy.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);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From___pyx_anon_enum(int value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_InsertMode(InsertMode value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_ScatterMode(ScatterMode value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_NormType(NormType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PetscViewerFormat(PetscViewerFormat value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PetscFileMode(PetscFileMode value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PetscDeviceType(PetscDeviceType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PetscStreamType(PetscStreamType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PetscDeviceContextJoinMode(PetscDeviceContextJoinMode value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_ISGlobalToLocalMappingMode(ISGlobalToLocalMappingMode value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_VecOption(VecOption value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_MatOption(MatOption value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_MatAssemblyType(MatAssemblyType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_MatInfoType(MatInfoType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_MatStructure(MatStructure value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_MatDuplicateOption(MatDuplicateOption value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_MatFactorShiftType(MatFactorShiftType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_MatSORType(MatSORType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PCSide(PCSide value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PCASMType(PCASMType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PCGASMType(PCGASMType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PCMGType(PCMGType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PCMGCycleType(PCMGCycleType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PCCompositeType(PCCompositeType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PCFieldSplitSchurPreType(PCFieldSplitSchurPreType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PCFieldSplitSchurFactType(PCFieldSplitSchurFactType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PCPatchConstructType(PCPatchConstructType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PCHPDDMCoarseCorrectionType(PCHPDDMCoarseCorrectionType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PCDeflationSpaceType(PCDeflationSpaceType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PCFailedReason(PCFailedReason value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_KSPNormType(KSPNormType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_KSPConvergedReason(KSPConvergedReason value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_KSPHPDDMType(KSPHPDDMType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_KSPDMActive(KSPDMActive value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_SNESNormSchedule(SNESNormSchedule value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_SNESConvergedReason(SNESConvergedReason value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_SNESNewtonALCorrectionType(SNESNewtonALCorrectionType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_TSProblemType(TSProblemType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_TSEquationType(TSEquationType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_TSExactFinalTimeOption(TSExactFinalTimeOption value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_TSConvergedReason(TSConvergedReason value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_TaoConvergedReason(TaoConvergedReason value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_TaoBNCGType(TaoBNCGType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_TaoALMMType(TaoALMMType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_TaoLineSearchConvergedReason(TaoLineSearchConvergedReason value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_DMBoundaryType(DMBoundaryType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_DMPolytopeType(DMPolytopeType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_DMReorderDefaultFlag(DMReorderDefaultFlag value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_DMDAStencilType(DMDAStencilType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_DMDAInterpolationType(DMDAInterpolationType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_DMDAElementType(DMDAElementType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_DMStagStencilType(DMStagStencilType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_DMStagStencilLocation(DMStagStencilLocation value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_DMSwarmType(DMSwarmType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_DMSwarmMigrateType(DMSwarmMigrateType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_DMSwarmCollectType(DMSwarmCollectType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_DMSwarmPICLayoutType(DMSwarmPICLayoutType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PetscRegressorLinearType(PetscRegressorLinearType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PetscInt(PetscInt value);

/* CIntFromPy.proto */
static CYTHON_INLINE PetscInt __Pyx_PyLong_As_PetscInt(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE InsertMode __Pyx_PyLong_As_InsertMode(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE ScatterMode __Pyx_PyLong_As_ScatterMode(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PetscFileMode __Pyx_PyLong_As_PetscFileMode(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PetscDeviceType __Pyx_PyLong_As_PetscDeviceType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PetscStreamType __Pyx_PyLong_As_PetscStreamType(PyObject *);

/* TypeInfoToFormat.proto */
struct __pyx_typeinfo_string {
    char string[3];
};
static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(const __Pyx_TypeInfo *type);

/* CIntFromPy.proto */
static CYTHON_INLINE PetscDeviceContextJoinMode __Pyx_PyLong_As_PetscDeviceContextJoinMode(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int64_t __Pyx_PyLong_As_int64_t(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PetscMemType(PetscMemType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int64_t(int64_t value);

/* CIntFromPy.proto */
static CYTHON_INLINE MatStructure __Pyx_PyLong_As_MatStructure(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE MatDuplicateOption __Pyx_PyLong_As_MatDuplicateOption(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE MatAssemblyType __Pyx_PyLong_As_MatAssemblyType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE MatInfoType __Pyx_PyLong_As_MatInfoType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE MatFactorShiftType __Pyx_PyLong_As_MatFactorShiftType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE KSPConvergedReason __Pyx_PyLong_As_KSPConvergedReason(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE SNESConvergedReason __Pyx_PyLong_As_SNESConvergedReason(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE TaoConvergedReason __Pyx_PyLong_As_TaoConvergedReason(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE DMBoundaryType __Pyx_PyLong_As_DMBoundaryType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE DMDAStencilType __Pyx_PyLong_As_DMDAStencilType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE DMDAInterpolationType __Pyx_PyLong_As_DMDAInterpolationType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE DMDAElementType __Pyx_PyLong_As_DMDAElementType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE DMStagStencilType __Pyx_PyLong_As_DMStagStencilType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE DMStagStencilLocation __Pyx_PyLong_As_DMStagStencilLocation(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PetscClassId __Pyx_PyLong_As_PetscClassId(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PetscLogStage(PetscLogStage value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PetscClassId(PetscClassId value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PetscLogEvent(PetscLogEvent value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_MPI_Fint(MPI_Fint value);

/* CIntFromPy.proto */
static CYTHON_INLINE PetscViewerFormat __Pyx_PyLong_As_PetscViewerFormat(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PetscInt64(PetscInt64 value);

/* CIntFromPy.proto */
static CYTHON_INLINE PetscInt64 __Pyx_PyLong_As_PetscInt64(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE ISGlobalToLocalMappingMode __Pyx_PyLong_As_ISGlobalToLocalMappingMode(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE size_t __Pyx_PyLong_As_size_t(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint8_t(uint8_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint16_t(uint16_t value);

/* CIntFromPy.proto */
static CYTHON_INLINE enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType __Pyx_PyLong_As_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE VecOption __Pyx_PyLong_As_VecOption(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PetscOffloadMask(PetscOffloadMask value);

/* CIntFromPy.proto */
static CYTHON_INLINE NormType __Pyx_PyLong_As_NormType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE DMPolytopeType __Pyx_PyLong_As_DMPolytopeType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE MatOption __Pyx_PyLong_As_MatOption(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PCFailedReason __Pyx_PyLong_As_PCFailedReason(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PCASMType __Pyx_PyLong_As_PCASMType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PCGASMType __Pyx_PyLong_As_PCGASMType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PCCompositeType __Pyx_PyLong_As_PCCompositeType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PCFieldSplitSchurFactType __Pyx_PyLong_As_PCFieldSplitSchurFactType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PCFieldSplitSchurPreType __Pyx_PyLong_As_PCFieldSplitSchurPreType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PCMGType __Pyx_PyLong_As_PCMGType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PCMGCycleType __Pyx_PyLong_As_PCMGCycleType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PCPatchConstructType __Pyx_PyLong_As_PCPatchConstructType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PCHPDDMCoarseCorrectionType __Pyx_PyLong_As_PCHPDDMCoarseCorrectionType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PCDeflationSpaceType __Pyx_PyLong_As_PCDeflationSpaceType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE KSPDMActive __Pyx_PyLong_As_KSPDMActive(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PCSide __Pyx_PyLong_As_PCSide(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE KSPNormType __Pyx_PyLong_As_KSPNormType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE KSPHPDDMType __Pyx_PyLong_As_KSPHPDDMType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE SNESNormSchedule __Pyx_PyLong_As_SNESNormSchedule(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE SNESNewtonALCorrectionType __Pyx_PyLong_As_SNESNewtonALCorrectionType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE TSProblemType __Pyx_PyLong_As_TSProblemType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE TSEquationType __Pyx_PyLong_As_TSEquationType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE TSExactFinalTimeOption __Pyx_PyLong_As_TSExactFinalTimeOption(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE TSConvergedReason __Pyx_PyLong_As_TSConvergedReason(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE TaoBNCGType __Pyx_PyLong_As_TaoBNCGType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE TaoALMMType __Pyx_PyLong_As_TaoALMMType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE DMReorderDefaultFlag __Pyx_PyLong_As_DMReorderDefaultFlag(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE DMSwarmType __Pyx_PyLong_As_DMSwarmType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE DMSwarmPICLayoutType __Pyx_PyLong_As_DMSwarmPICLayoutType(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE PetscRegressorLinearType __Pyx_PyLong_As_PetscRegressorLinearType(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_char(char value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_MatProductType(MatProductType value);

/* UpdateUnpickledDict.proto */
static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index);

/* CheckUnpickleChecksum.proto */
static CYTHON_INLINE int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyLong_As_char(PyObject *);

/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName
#else
static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
#endif
#else  // !LIMITED_API
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif

/* GetRuntimeVersion.proto */
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
static unsigned long __Pyx_cached_runtime_version = 0;
static void __Pyx_init_runtime_version(void);
#else
#define __Pyx_init_runtime_version()
#endif
static unsigned long __Pyx_get_runtime_version(void);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);

/* DecompressString.proto */
static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);

/* MultiPhaseInitModuleState.proto */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
static PyObject *__Pyx_State_FindModule(void*);
static int __Pyx_State_AddModule(PyObject* module, void*);
static int __Pyx_State_RemoveModule(void*);
#elif CYTHON_USE_MODULE_STATE
#define __Pyx_State_FindModule PyState_FindModule
#define __Pyx_State_AddModule PyState_AddModule
#define __Pyx_State_RemoveModule PyState_RemoveModule
#endif

/* #### Code section: module_declarations ### */
/* CythonABIVersion.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
    #if CYTHON_METH_FASTCALL
        #define __PYX_FASTCALL_ABI_SUFFIX  "_fastcall"
    #else
        #define __PYX_FASTCALL_ABI_SUFFIX
    #endif
    #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#else
    #define __PYX_LIMITED_ABI_SUFFIX
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    #define __PYX_AM_SEND_ABI_SUFFIX
#elif __PYX_HAS_PY_AM_SEND == 2
    #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
#else
    #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
#endif
#ifndef __PYX_MONITORING_ABI_SUFFIX
    #define __PYX_MONITORING_ABI_SUFFIX
#endif
#if CYTHON_USE_TP_FINALIZE
    #define __PYX_TP_FINALIZE_ABI_SUFFIX
#else
    #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
#endif
#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
    #define __PYX_FREELISTS_ABI_SUFFIX
#else
    #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
#endif
#define CYTHON_ABI  __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."

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 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 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 const *__pyx_v_name); /* proto*/
static char *__pyx_f_8petsc4py_5PETSc_6_PyObj_getname(struct __pyx_obj_8petsc4py_5PETSc__PyObj *__pyx_v_self); /* proto*/
static int __pyx_f_8petsc4py_5PETSc_6_PyVwr_setfilename(struct __pyx_obj_8petsc4py_5PETSc__PyVwr *__pyx_v_self, char const *__pyx_v_name); /* proto*/
static char *__pyx_f_8petsc4py_5PETSc_6_PyVwr_getfilename(struct __pyx_obj_8petsc4py_5PETSc__PyVwr *__pyx_v_self); /* proto*/

/* Module declarations from "cython.view" */
static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char const *, 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[1024];
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 PetscErrorCode __pyx_f_8petsc4py_5PETSc_CHKERRMPI(int); /*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 void __pyx_f_8petsc4py_5PETSc_PetscTracebackAdd(PyObject *); /*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 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_b(PetscInt); /*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_b(PetscInt, PetscBool 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_b(PyObject *, PetscInt *, PetscBool **); /*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_BoolArray(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_IntArray(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_RealArray(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_ScalarArray(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_PetscDECREF(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 PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscObjectOptionsHandler_PYTHON(PetscObject, PetscOptionItems, void *); /*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 MatDuplicateOption __pyx_f_8petsc4py_5PETSc_matduplicateoption(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_coo(Mat, PyObject *, PyObject *); /*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 PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSP_PreSolve(KSP, Vec, Vec, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSP_PostSolve(KSP, Vec, Vec, 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 PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_NewtonALFunction(SNES, Vec, Vec, 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_Indicator(TS, PetscReal, Vec, PetscReal *, 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_InequalityConstraints(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_JacobianInequality(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 PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatHtoolKernelPython(PetscInt, PetscInt, PetscInt, PetscInt const *, PetscInt const *, PetscScalar *, void *); /*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_PyPetscSNESLineSearch_New(SNESLineSearch); /*proto*/
static SNESLineSearch __pyx_f_8petsc4py_5PETSc_PyPetscSNESLineSearch_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_PyPetscTAOTerm_New(TaoTerm); /*proto*/
static TaoTerm __pyx_f_8petsc4py_5PETSc_PyPetscTAOTerm_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 PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDMSwarmCellDM_New(DMSwarmCellDM); /*proto*/
static DMSwarmCellDM __pyx_f_8petsc4py_5PETSc_PyPetscDMSwarmCellDM_Get(PyObject *); /*proto*/
static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscRegressor_New(PetscRegressor); /*proto*/
static PetscRegressor __pyx_f_8petsc4py_5PETSc_PyPetscRegressor_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 const *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(char const *); /*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 int __pyx_f_8petsc4py_5PETSc_getCommSize(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 const *); /*proto*/
static int __pyx_f_8petsc4py_5PETSc_viewcontext(struct __pyx_obj_8petsc4py_5PETSc__PyObj *, PetscViewer); /*proto*/
static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyVwr *__pyx_f_8petsc4py_5PETSc_PyVwr(PetscViewer); /*proto*/
__PYX_EXTERN_C PetscErrorCode PetscViewerPythonGetContext(PetscViewer, void **); /*proto*/
__PYX_EXTERN_C PetscErrorCode PetscViewerPythonSetContext(PetscViewer, void *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerPythonSetType_PYTHON(PetscViewer, char const *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerPythonGetType_PYTHON(PetscViewer, char const **); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerPythonSetFilename_PYTHON(PetscViewer, char const *); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerPythonGetFilename_PYTHON(PetscViewer, char const **); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerPythonViewObject_PYTHON(PetscViewer, PetscObject); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerCreate_Python(PetscViewer); /*proto*/
static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerDestroy_Python_inner(PetscViewer); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerDestroy_Python(PetscViewer); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerSetUp_Python(PetscViewer); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerSetFromOptions_Python(PetscViewer, PetscOptionItems); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerView_Python(PetscViewer, PetscViewer); /*proto*/
static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerFlush_Python(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 const *); /*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_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 const *); /*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 PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCMatApplyTranspose_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 const *); /*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 const *); /*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 const *); /*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 const *); /*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 const *, char *); /*proto*/
static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo const *); /*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 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 const *); /*proto*/
/* #### Code section: typeinfo ### */
static const __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_property;
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_NotImplemented;
static PyObject *__pyx_builtin_Ellipsis;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_compile;
static PyObject *__pyx_builtin___import__;
static PyObject *__pyx_builtin_id;
/* #### Code section: string_decls ### */
static const char __pyx_k_c[] = "c";
static const char __pyx_k__7[] = "";
static const char __pyx_k_SOR[] = "SOR";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_mult[] = "mult";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_norm[] = "norm";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_scale[] = "scale";
static const char __pyx_k_shift[] = "shift";
static const char __pyx_k_solve[] = "solve";
static const char __pyx_k_fortran[] = "fortran";
static const char __pyx_k_multAdd[] = "multAdd";
static const char __pyx_k_dltensor[] = "dltensor";
static const char __pyx_k_imagPart[] = "imagPart";
static const char __pyx_k_realPart[] = "realPart";
static const char __pyx_k_rollback[] = "rollback";
static const char __pyx_k_conjugate[] = "conjugate";
static const char __pyx_k_duplicate[] = "duplicate";
static const char __pyx_k_getDiagonal[] = "getDiagonal";
static const char __pyx_k_interpolate[] = "interpolate";
static const char __pyx_k_setDiagonal[] = "setDiagonal";
static const char __pyx_k_zeroEntries[] = "zeroEntries";
static const char __pyx_k_evaluatestep[] = "evaluatestep";
static const char __pyx_k_diagonalScale[] = "diagonalScale";
static const char __pyx_k_stepTranspose[] = "stepTranspose";
static const char __pyx_k_used_dltensor[] = "used_dltensor";
static const char __pyx_k_productNumeric[] = "productNumeric";
static const char __pyx_k_productSymbolic[] = "productSymbolic";
static const char __pyx_k_zeroRowsColumns[] = "zeroRowsColumns";
static const char __pyx_k_Missing_matrices[] = "Missing matrices";
static const char __pyx_k_multTransposeAdd[] = "multTransposeAdd";
static const char __pyx_k_multDiagonalBlock[] = "multDiagonalBlock";
static const char __pyx_k_Missing_composed_id[] = "Missing composed id";
static const char __pyx_k_Cannot_evaluate_step[] = "Cannot evaluate step";
static const char __pyx_k_Unknown_product_type[] = "Unknown product type";
static const char __pyx_k_Corrupted_composed_id[] = "Corrupted composed id";
static const char __pyx_k_Article_Dalcin2011_Author_Lisan[] = "@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";
static const char __pyx_k_Python_context_not_set_call_one[] = "Python context not set, call one of \n * PetscViewerPythonSetType(viewer, \"[package.]module.class\")\n * PetscViewerSetFromOptions(viewer) and pass option -viewer_python_type [package.]module.class";
static const char __pyx_k_Python_context_not_set_call_one_2[] = "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";
static const char __pyx_k_Python_context_not_set_call_one_3[] = "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";
static const char __pyx_k_Python_context_not_set_call_one_4[] = "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";
static const char __pyx_k_Python_context_not_set_call_one_5[] = "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";
static const char __pyx_k_Python_context_not_set_call_one_6[] = "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";
static const char __pyx_k_Python_context_not_set_call_one_7[] = "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";
/* #### 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 */
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 */
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___cinit__(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_readonly, 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_26used(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_28setValue(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_30delValue(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_32getBool(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_34getBoolArray(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_36getInt(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_38getIntArray(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_40getReal(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_42getRealArray(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_44getScalar(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_46getScalarArray(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_48getString(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_50insertString(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_string); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_52getAll(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 PyObject *__pyx_pf_8petsc4py_5PETSc_8LogStage_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogStage *__pyx_v_self); /* 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_8LogClass_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogClass *__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_8LogEvent_2id___get__(struct __pyx_obj_8petsc4py_5PETSc_LogEvent *__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 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_objpre); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_28setOptionsHandler(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_handler); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_30destroyOptionsHandlers(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_32getComm(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_34getName(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_36setName(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_38getClassId(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_40getClassName(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_42getRefCount(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_44getId(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_46compose(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, struct PyPetscObjectObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_48query(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_50incRef(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_52decRef(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_54getAttr(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_56setAttr(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_58getDict(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_60stateIncrease(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_62stateGet(struct PyPetscObjectObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_64stateSet(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_66incrementTabLevel(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_tab, struct PyPetscObjectObject *__pyx_v_parent); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_68setTabLevel(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_70getTabLevel(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_2id___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_26setFromOptions(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_28setUp(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_30getFormat(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_32pushFormat(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_format); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_34popFormat(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_36getSubViewer(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_38restoreSubViewer(struct PyPetscViewerObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_sub); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_40STDOUT(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_42STDERR(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_44ASCII(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_46BINARY(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_48DRAW(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_50setASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_52getASCIITab(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_54addASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_56subtractASCIITab(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_tabs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_58pushASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_60popASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_62pushASCIITab(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_64popASCIITab(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_66useASCIITabs(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_68printfASCII(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_msg); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_70printfASCIISynchronized(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_msg); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_72flush(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_74setFileMode(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_76getFileMode(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_78setFileName(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_80getFileName(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_82setDrawInfo(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_84clearDraw(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_86createPython(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_88setPythonContext(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_90getPythonContext(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_92setPythonType(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_94getPythonType(struct PyPetscViewerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_96viewObjectPython(struct PyPetscViewerObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_obj); /* 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 PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_2create(struct PyPetscDeviceContextObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_4destroy(struct PyPetscDeviceContextObject *__pyx_v_self); /* 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_40partitioningToNumbering(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_42partitioningCount(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_npart); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_44getSize(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_46getLocalSize(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_48getSizes(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_50getBlockSize(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_52setBlockSize(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_54sort(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_56isSorted(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_58setPermutation(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_60isPermutation(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_62setIdentity(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_64isIdentity(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_66equal(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_68sum(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_70expand(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_72union(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_74intersect(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_76difference(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_78complement(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_nmin, PyObject *__pyx_v_nmax); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_80embed(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_drop); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_82renumber(struct PyPetscISObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_mult); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_84setIndices(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_86getIndices(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_88setBlockIndices(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_90getBlockIndices(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_92setStride(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_94getStride(struct PyPetscISObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_96getInfo(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_10load(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_12destroy(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_14create(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_16createIS(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_18createSF(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf, PyObject *__pyx_v_start); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_20getSize(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_22getBlockSize(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_24getIndices(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_26getBlockIndices(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_28getInfo(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_30getBlockInfo(struct PyPetscLGMapObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_32apply(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_34applyBlock(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_result); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_36applyIS(struct PyPetscLGMapObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_38applyInverse(struct PyPetscLGMapObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_40applyBlockInverse(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 PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_2view(struct PyPetscSFObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_4destroy(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_6create(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_8setType(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_sf_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_10getType(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_12setFromOptions(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_14setUp(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_16reset(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_18getGraph(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_20setGraph(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_22setRankOrder(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_24getMulti(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_26createInverse(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_28computeDegree(struct PyPetscSFObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_30createEmbeddedRootSF(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_selected); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_32createEmbeddedLeafSF(struct PyPetscSFObject *__pyx_v_self, PyObject *__pyx_v_selected); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_34createSectionSF(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_36distributeSection(struct PyPetscSFObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_rootSection, struct PyPetscSectionObject *__pyx_v_leafSection); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_38compose(struct PyPetscSFObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_40bcastBegin(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_42bcastEnd(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_44reduceBegin(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_46reduceEnd(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_48scatterBegin(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_50scatterEnd(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_52gatherBegin(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_54gatherEnd(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_56fetchAndOpBegin(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_58fetchAndOpEnd(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 */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_14__idiv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
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 */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_30__div__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_32__rdiv__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
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 */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_38__matmul__(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
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(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_184mDotBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_186mDotEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_188mtDot(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_190mtDotBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_192mtDotEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, 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_204mean(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_206min(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_208max(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_210normalize(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_212reciprocal(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_214exp(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_216log(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_218sqrtabs(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_220abs(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_222conjugate(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_224setRandom(struct PyPetscVecObject *__pyx_v_self, struct PyPetscRandomObject *__pyx_v_random); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_226permute(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_order, PyObject *__pyx_v_invert); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_228zeroEntries(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_230set(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_232isset(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_idx, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_234scale(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_236shift(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_238swap(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_240axpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_242isaxpy(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_244aypx(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alpha, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_246axpby(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_248waxpy(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_250maxpy(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_alphas, PyObject *__pyx_v_vecs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_252pointwiseMult(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_254pointwiseDivide(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_256pointwiseMin(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_258pointwiseMax(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_260pointwiseMaxAbs(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_262maxPointwiseDivide(struct PyPetscVecObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_264getValue(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_266getValues(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_indices, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_268getValuesStagStencil(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_270setValue(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_272setValues(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_274setValuesBlocked(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_276setValuesStagStencil(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_278setLGMap(struct PyPetscVecObject *__pyx_v_self, struct PyPetscLGMapObject *__pyx_v_lgmap); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_280getLGMap(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_282setValueLocal(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_284setValuesLocal(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_286setValuesBlockedLocal(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_288assemblyBegin(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_290assemblyEnd(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_292assemble(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_294strideScale(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_296strideSum(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_298strideMin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_300strideMax(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_302strideNorm(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_norm_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_304strideScatter(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_306strideGather(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_308localForm(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_310ghostUpdateBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_312ghostUpdateEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_314ghostUpdate(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_addv, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_316setMPIGhost(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_ghosts); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_318getGhostIS(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_320getSubVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, struct PyPetscVecObject *__pyx_v_subvec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_322restoreSubVector(struct PyPetscVecObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, struct PyPetscVecObject *__pyx_v_subvec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_324getNestSubVecs(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_326setNestSubVecs(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_sx, PyObject *__pyx_v_idxm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_328setDM(struct PyPetscVecObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_330getDM(struct PyPetscVecObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_332concatenate(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_vecs); /* 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_10createByCell(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_nc, PyObject *__pyx_v_ctype, PyObject *__pyx_v_qorder, PyObject *__pyx_v_prefix, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_12createLagrange(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_14getQuadrature(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_16getDimension(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_18getSpatialDimension(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_20getNumComponents(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_22setNumComponents(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_comp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_24getNumDof(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_26getTileSizes(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_28setTileSizes(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_30getFaceQuadrature(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_32setQuadrature(struct PyPetscFEObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_34setFaceQuadrature(struct PyPetscFEObject *__pyx_v_self, struct PyPetscQuadObject *__pyx_v_quad); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_36setType(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_fe_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_38getBasisSpace(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_40setBasisSpace(struct PyPetscFEObject *__pyx_v_self, struct PyPetscSpaceObject *__pyx_v_sp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_42setFromOptions(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_44setUp(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_46getDualSpace(struct PyPetscFEObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_48setDualSpace(struct PyPetscFEObject *__pyx_v_self, struct PyPetscDualSpaceObject *__pyx_v_dspace); /* 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 PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_2view(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_4destroy(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_6create(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_8clone(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_10setUp(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_12reset(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_14getNumFields(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_16setNumFields(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_numFields); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_18getFieldName(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_20setFieldName(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_fieldName); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_22getFieldComponents(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_24setFieldComponents(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_field, PyObject *__pyx_v_numComp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_26getChart(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_28setChart(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_pStart, PyObject *__pyx_v_pEnd); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_30getPermutation(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_32setPermutation(struct PyPetscSectionObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_perm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_34getDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_36setDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_38addDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_40getFieldDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_42setFieldDof(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_44addFieldDof(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_46getConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_48setConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_50addConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_numDof); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_52getFieldConstraintDof(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_54setFieldConstraintDof(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_56addFieldConstraintDof(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_58getConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_60setConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_indices); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_62getFieldConstraintIndices(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_64setFieldConstraintIndices(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_66getMaxDof(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_68getStorageSize(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_70getConstrainedStorageSize(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_72getOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_74setOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_offset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_76getFieldOffset(struct PyPetscSectionObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_78setFieldOffset(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_80getOffsetRange(struct PyPetscSectionObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_82createGlobalSection(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 */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_12__idiv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
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 */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_28__div__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_30__rdiv__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
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 */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_36__matmul__(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
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_58setVariableBlockSizes(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_blocks); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_60setVecType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_vec_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_62getVecType(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_64setNestVecType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_vec_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_66createAIJ(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_68createBAIJ(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_70createSBAIJ(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_72createAIJCRL(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_74setPreallocationNNZ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_nnz); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_76setPreallocationCOO(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_coo_i, PyObject *__pyx_v_coo_j); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_78setPreallocationCOOLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_coo_i, PyObject *__pyx_v_coo_j); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_80setPreallocationCSR(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_csr); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_82preallocatorPreallocate(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, PyObject *__pyx_v_fill); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_84createAIJWithArrays(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_86createDense(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_88createDenseCUDA(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_90setPreallocationDense(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_array); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_92createScatter(struct PyPetscMatObject *__pyx_v_self, struct PyPetscScatterObject *__pyx_v_scatter, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_94createNormal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_96createTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_98getTransposeMat(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_100createNormalHermitian(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_102createHermitianTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_104createLRC(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_106createSubMatrixVirtual(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_108createNest(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_110createH2OpusFromMat(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_112createHtoolFromKernel(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_spacedim, PyObject *__pyx_v_coords_target, PyObject *__pyx_v_coords_source, PyObject *__pyx_v_kernel, PyObject *__pyx_v_kernelctx, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_114createIS(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, struct PyPetscLGMapObject *__pyx_v_lgmapr, struct PyPetscLGMapObject *__pyx_v_lgmapc, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_116createConstantDiagonal(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_118createDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_diag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_120createPython(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_122setPythonContext(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_124getPythonContext(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_126setPythonType(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_128getPythonType(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_130setOptionsPrefix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_132getOptionsPrefix(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_134appendOptionsPrefix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_136setFromOptions(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_138setUp(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_140setOption(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_option, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_142getOption(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_option); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_144getType(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_146getSize(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_148getLocalSize(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_150getSizes(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_152getBlockSize(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_154getBlockSizes(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_156getOwnershipRange(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_158getOwnershipRanges(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_160getOwnershipRangeColumn(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_162getOwnershipRangesColumn(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_164getOwnershipIS(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_166getInfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_info); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_168duplicate(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_copy); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_170copy(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_result, PyObject *__pyx_v_structure); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_172load(struct PyPetscMatObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_174convert(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_mat_type, struct PyPetscMatObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_176transpose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_178setTransposePrecursor(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_180hermitianTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_182realPart(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_184imagPart(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_186conjugate(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_out); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_188permute(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_row, struct PyPetscISObject *__pyx_v_col); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_190equal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_192isTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, PyObject *__pyx_v_tol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_194isSymmetric(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_196isSymmetricKnown(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_198isHermitian(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_200isHermitianKnown(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_202isStructurallySymmetric(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_204isLinear(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_206zeroEntries(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_208getValue(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_210getValues(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_212getValuesCSR(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_214getRow(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_row); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_216getRowIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_symmetric, PyObject *__pyx_v_compressed); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_218getColumnIJ(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_symmetric, PyObject *__pyx_v_compressed); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_220setValue(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_222setValues(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_224setValuesRCV(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_226setValuesIJV(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_228setValuesCOO(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_coo_v, PyObject *__pyx_v_addv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_230setValuesCSR(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_232setValuesBlocked(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_234setValuesBlockedRCV(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_236setValuesBlockedIJV(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_238setValuesBlockedCSR(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_240setLGMap(struct PyPetscMatObject *__pyx_v_self, struct PyPetscLGMapObject *__pyx_v_rmap, struct PyPetscLGMapObject *__pyx_v_cmap); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_242getLGMap(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_244setValueLocal(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_246setValuesLocal(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_248setValuesLocalRCV(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_250setValuesLocalIJV(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_252setValuesLocalCSR(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_254setValuesBlockedLocal(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_256setValuesBlockedLocalRCV(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_258setValuesBlockedLocalIJV(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_260setValuesBlockedLocalCSR(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_262setStencil(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_264setValueStencil(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_266setValueStagStencil(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_268setValueBlockedStencil(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_270setValueBlockedStagStencil(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_272zeroRows(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_274zeroRowsLocal(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_276zeroRowsColumns(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_278zeroRowsColumnsLocal(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_280zeroRowsColumnsStencil(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_282storeValues(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_284retrieveValues(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_286assemblyBegin(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_288assemblyEnd(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_290assemble(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_assembly); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_292isAssembled(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_294findZeroRows(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_296createVecs(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_side); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_298createVecRight(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_300createVecLeft(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_302getColumnVector(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_column, struct PyPetscVecObject *__pyx_v_result); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_304getRedundantMatrix(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_306getDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_308getRowSum(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_result); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_310setDiagonal(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_diag, PyObject *__pyx_v_addv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_312diagonalScale(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_L, struct PyPetscVecObject *__pyx_v_R); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_314invertBlockDiagonal(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_316setNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_318getNullSpace(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_320setTransposeNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_322getTransposeNullSpace(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_324setNearNullSpace(struct PyPetscMatObject *__pyx_v_self, struct PyPetscNullSpaceObject *__pyx_v_nsp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_326getNearNullSpace(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_328mult(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_330multAdd(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_332multTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_334multTransposeAdd(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_336multHermitian(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_338multHermitianAdd(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_340SOR(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_342getDiagonalBlock(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_344increaseOverlap(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_iset, PyObject *__pyx_v_overlap); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_346createSubMatrix(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_348createSubMatrices(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_350createSchurComplement(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A00, struct PyPetscMatObject *__pyx_v_Ap00, struct PyPetscMatObject *__pyx_v_A01, struct PyPetscMatObject *__pyx_v_A10, struct PyPetscMatObject *__pyx_v_A11); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_352getSchurComplementSubMatrices(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_354getLocalSubMatrix(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_356restoreLocalSubMatrix(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_358norm(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_norm_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_360scale(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_362shift(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_364chop(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_366setRandom(struct PyPetscMatObject *__pyx_v_self, struct PyPetscRandomObject *__pyx_v_random); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_368axpy(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_370aypx(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_372matMult(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_374matTransposeMult(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_376transposeMatMult(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_378ptap(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_380rart(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_382matMatMult(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_384kron(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat, struct PyPetscMatObject *__pyx_v_result); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_386bindToCPU(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_flg); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_388boundToCPU(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_390getOrdering(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_ord_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_392reorderForNonzeroDiagonal(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_394factorLU(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_396factorSymbolicLU(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_398factorNumericLU(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_400factorILU(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_402factorSymbolicILU(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_404factorCholesky(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_406factorSymbolicCholesky(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_408factorNumericCholesky(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_410factorICC(struct PyPetscMatObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_isperm, PyObject *__pyx_v_options); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_412factorSymbolicICC(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_414getInertia(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_416setUnfactored(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_418setISAllowRepeated(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_allow); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_420getISAllowRepeated(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_422fixISLocalEmpty(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_fix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_424getISLocalMat(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_426restoreISLocalMat(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_local); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_428setISLocalMat(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_local); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_430setISPreallocation(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_nnz, PyObject *__pyx_v_onnz); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_432getLRCMats(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_434setLRCMats(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_436H2OpusOrthogonalize(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_438H2OpusCompress(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_tol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_440H2OpusLowRankUpdate(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_442HtoolGetPermutationSource(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_444HtoolGetPermutationTarget(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_446HtoolUsePermutation(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_use); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_448HtoolUseRecompression(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_use); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_450getLMVMJ0(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_452setLMVMJ0(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_J0); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_454getLMVMJ0KSP(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_456setLMVMJ0KSP(struct PyPetscMatObject *__pyx_v_self, struct PyPetscKSPObject *__pyx_v_ksp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_458allocateLMVM(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_460updateLMVM(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_462resetLMVM(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_destructive); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_464setMumpsIcntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl, PyObject *__pyx_v_ival); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_466getMumpsIcntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_468setMumpsCntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_470getMumpsCntl(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_472getMumpsInfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_474getMumpsInfog(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_476getMumpsRinfo(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_478getMumpsRinfog(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_icntl); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_480solveForward(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_482solveBackward(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_484solve(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_486solveTranspose(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_488solveAdd(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_490solveTransposeAdd(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_492matSolve(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_X); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_494setDenseLDA(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_lda); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_496getDenseLDA(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_498getDenseArray(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_readonly); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_500getDenseLocalMatrix(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_502getDenseSubMatrix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rbegin, PyObject *__pyx_v_rend, PyObject *__pyx_v_cbegin, PyObject *__pyx_v_cend); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_504restoreDenseSubMatrix(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_506getDenseColumnVec(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_508restoreDenseColumnVec(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_mode, struct PyPetscVecObject *__pyx_v_V); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_510getNestSize(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_512getNestISs(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_514getNestLocalISs(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_516getNestSubMatrix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_518getDM(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_520setDM(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_522__dlpack__(struct PyPetscMatObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_stream); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_524__dlpack_device__(struct PyPetscMatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_526toDLPack(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_36setUp(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_38reset(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_40setUpOnBlocks(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_42apply(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_44matApply(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_x, struct PyPetscMatObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_46applyTranspose(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_48matApplyTranspose(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_x, struct PyPetscMatObject *__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_70getBJacobiSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_72setASMType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_asmtype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_74setASMOverlap(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_overlap); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_76setASMLocalSubdomains(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nsd, PyObject *__pyx_v_is_sub, PyObject *__pyx_v_is_local); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_78setASMTotalSubdomains(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nsd, PyObject *__pyx_v_is_sub, PyObject *__pyx_v_is_local); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_80getASMSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_82setASMSortIndices(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_dosort); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_84setGASMType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_gasmtype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_86setGASMOverlap(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_overlap); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_88setGAMGType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_gamgtype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_90setGAMGLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_92setGAMGSmooths(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_smooths); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_94getHYPREType(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_96setHYPREType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_hypretype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_98setHYPREDiscreteCurl(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_100setHYPREDiscreteGradient(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_102setHYPRESetAlphaPoissonMatrix(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_104setHYPRESetBetaPoissonMatrix(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_106setHYPRESetInterpolations(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_108setHYPRESetEdgeConstantVectors(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_110setHYPREAMSSetInteriorNodes(struct PyPetscPCObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_interior); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_112setFactorSolverType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_solver); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_114getFactorSolverType(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_116setFactorSetUpSolverType(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_118setFactorOrdering(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_120setFactorPivot(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_zeropivot, PyObject *__pyx_v_inblocks); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_122setFactorShift(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_shift_type, PyObject *__pyx_v_amount); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_124setFactorLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_126getFactorMatrix(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_128setFieldSplitType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_130setFieldSplitIS(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_132setFieldSplitFields(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_bsize, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_134getFieldSplitSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_136getFieldSplitSchurGetSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_138getFieldSplitSubIS(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_splitname); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_140setFieldSplitSchurFactType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_142setFieldSplitSchurPreType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ptype, struct PyPetscMatObject *__pyx_v_pre); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_144setCompositeType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_ctype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_146getCompositePC(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_148addCompositePCType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_pc_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_150getKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_152getMGType(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_154setMGType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_mgtype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_156getMGLevels(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_158setMGLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_160getMGCoarseSolve(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_162setMGInterpolation(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_164getMGInterpolation(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_166setMGRestriction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_168getMGRestriction(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_170setMGRScale(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_rscale); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_172getMGRScale(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_174getMGSmoother(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_176getMGSmootherDown(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_178getMGSmootherUp(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_180setMGCycleType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_cycle_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_182setMGCycleTypeOnLevel(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, PyObject *__pyx_v_cycle_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_184setMGRhs(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_186setMGX(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_188setMGR(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_r); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_190setBDDCLocalAdjacency(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_csr); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_192setBDDCDivergenceMat(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_194setBDDCDiscreteGradient(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_196setBDDCChangeOfBasisMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_T, PyObject *__pyx_v_interior); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_198setBDDCPrimalVerticesIS(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_primv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_200setBDDCPrimalVerticesLocalIS(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_primv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_202setBDDCCoarseningRatio(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_cratio); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_204setBDDCLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_206setBDDCDirichletBoundaries(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_208setBDDCDirichletBoundariesLocal(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_210setBDDCNeumannBoundaries(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_212setBDDCNeumannBoundariesLocal(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_bndr); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_214setBDDCDofsSplitting(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_isfields); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_216setBDDCDofsSplittingLocal(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_isfields); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_218getPatchSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_220setPatchCellNumbering(struct PyPetscPCObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_222setPatchDiscretisationInfo(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_224setPatchComputeOperator(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_226setPatchComputeOperatorInteriorFacets(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_228setPatchComputeFunction(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_230setPatchComputeFunctionInteriorFacets(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_232setPatchConstructType(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_234setHPDDMAuxiliaryMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_uis, struct PyPetscMatObject *__pyx_v_uaux); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_236setHPDDMRHSMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_238getHPDDMComplexities(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_240setHPDDMHasNeumannMat(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_has); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_242setHPDDMCoarseCorrectionType(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_correction_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_244getHPDDMCoarseCorrectionType(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_246getHPDDMSTShareSubKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_248setHPDDMDeflationMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_uis, struct PyPetscMatObject *__pyx_v_U); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_250setSPAIEpsilon(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_252setSPAINBSteps(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nbsteps); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_254setSPAIMax(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_maxval); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_256setSPAIMaxNew(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_maxval); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_258setSPAIBlockSize(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_260setSPAICacheSize(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_262setSPAIVerbose(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_264setSPAISp(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_sym); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_266setDeflationInitOnly(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_flg); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_268setDeflationLevels(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_levels); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_270setDeflationReductionFactor(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_red); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_272setDeflationCorrectionFactor(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_fact); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_274setDeflationSpaceToCompute(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_space_type, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_276setDeflationSpace(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_W, PyObject *__pyx_v_transpose); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_278setDeflationProjectionNullSpaceMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_280setDeflationCoarseMat(struct PyPetscPCObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_282getDeflationCoarseKSP(struct PyPetscPCObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_284getDeflationPC(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_dmactive, 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_50addConvergenceTest(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs, PyObject *__pyx_v_prepend); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_52getConvergenceTest(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_54callConvergenceTest(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_56setConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_reset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_58getConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_60logConvergenceHistory(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rnorm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_62setMonitor(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_64getMonitor(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_66monitorCancel(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_68monitor(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_70setPCSide(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_side); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_72getPCSide(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_74setNormType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_normtype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_76getNormType(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_78setComputeEigenvalues(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_80getComputeEigenvalues(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_82setComputeSingularValues(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_84getComputeSingularValues(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_86setInitialGuessNonzero(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_88getInitialGuessNonzero(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_90setInitialGuessKnoll(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_92getInitialGuessKnoll(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_94setUseFischerGuess(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_model, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_96setUp(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_98reset(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_100setUpOnBlocks(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_102setPreSolve(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_presolve, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_104setPostSolve(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_postsolve, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_106solve(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_108solveTranspose(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_110matSolve(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_X); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_112matSolveTranspose(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_B, struct PyPetscMatObject *__pyx_v_X); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_114setIterationNumber(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_its); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_116getIterationNumber(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_118setResidualNorm(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_rnorm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_120getResidualNorm(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_122setConvergedReason(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_124getConvergedReason(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_126getCGObjectiveValue(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_128setHPDDMType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_hpddm_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_130getHPDDMType(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_132setErrorIfNotConverged(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_134getErrorIfNotConverged(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_136getRhs(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_138getSolution(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_140getWorkVecs(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_right, PyObject *__pyx_v_left); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_142buildSolution(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_144buildResidual(struct PyPetscKSPObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_r); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_146computeEigenvalues(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_148computeExtremeSingularValues(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_150setGMRESRestart(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_restart); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_152createPython(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_154setPythonContext(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_156getPythonContext(struct PyPetscKSPObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_158setPythonType(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_160getPythonType(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_28setTRTolerances(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_delta_min, PyObject *__pyx_v_delta_max, PyObject *__pyx_v_delta_0); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_30getTRTolerances(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_32setTRUpdateParameters(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_eta1, PyObject *__pyx_v_eta2, PyObject *__pyx_v_eta3, PyObject *__pyx_v_t1, PyObject *__pyx_v_t2); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_34getTRUpdateParameters(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_36setFASInterpolation(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_38getFASInterpolation(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_40setFASRestriction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_42getFASRestriction(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_44setFASInjection(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_46getFASInjection(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_48setFASRScale(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_50setFASLevels(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_levels, PyObject *__pyx_v_comms); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_52getFASLevels(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_54getFASCycleSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_56getFASCoarseSolve(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_58getFASSmoother(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_60getFASSmootherDown(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_62getFASSmootherUp(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_64getNPC(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_66hasNPC(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_68setNPC(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscSNESObject *__pyx_v_snes); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_70setNPCSide(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_side); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_72getNPCSide(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_74setLineSearchPreCheck(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_76setInitialGuess(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_78getInitialGuess(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_80setFunction(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_82getFunction(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_84setUpdate(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_86getUpdate(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_88setJacobian(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_90getJacobian(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_92setObjective(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_94getObjective(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_96computeFunction(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_98computeJacobian(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_100computeObjective(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_102setNGS(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_104getNGS(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_106computeNGS(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_108setTolerances(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_110getTolerances(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_112setDivergenceTolerance(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_dtol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_114getDivergenceTolerance(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_116setNormSchedule(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_normsched); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_118getNormSchedule(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_120setConvergenceTest(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_122getConvergenceTest(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_124callConvergenceTest(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_126converged(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_128setConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_length, PyObject *__pyx_v_reset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_130getConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_132logConvergenceHistory(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_norm, PyObject *__pyx_v_linear_its); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_134setResetCounters(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_reset); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_136setMonitor(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_138getMonitor(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_140monitorCancel(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_142monitor(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its, PyObject *__pyx_v_rnorm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_144setMaxFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_funcs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_146getMaxFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_148getFunctionEvaluations(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_150setMaxStepFailures(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_fails); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_152getMaxStepFailures(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_154getStepFailures(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_156setMaxKSPFailures(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_max_fails); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_158getMaxKSPFailures(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_160getKSPFailures(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_162setUp(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_164setUpMatrices(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_166reset(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_168solve(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_b, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_170setConvergedReason(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_172getConvergedReason(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_174setErrorIfNotConverged(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_176getErrorIfNotConverged(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_178setIterationNumber(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_its); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_180getIterationNumber(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_182setForceIteration(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_force); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_184setFunctionNorm(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_norm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_186getFunctionNorm(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_188getLinearSolveIterations(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_190getRhs(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_192getSolution(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_194setSolution(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_196getSolutionUpdate(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_198setKSP(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscKSPObject *__pyx_v_ksp); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_200getKSP(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_202setUseEW(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_204getUseEW(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_206setParamsEW(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_208getParamsEW(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_210setUseKSP(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_212getUseKSP(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_214setUseMF(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_216getUseMF(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_218setUseFD(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_220getUseFD(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_222setVariableBounds(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_224getVariableBounds(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_226getVIInactiveSet(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_228createPython(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_230setPythonContext(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_232getPythonContext(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_234setPythonType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_236getPythonType(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_238getCompositeSNES(struct PyPetscSNESObject *__pyx_v_self, int __pyx_v_n); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_240getCompositeNumber(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_242getNASMSNES(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_244getNASMNumber(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_246setPatchCellNumbering(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_248setPatchDiscretisationInfo(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_250setPatchComputeOperator(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_252setPatchComputeFunction(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_254setPatchConstructType(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_7use_ksp___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_7use_ksp_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 PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_256getLineSearch(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_258setLineSearch(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscSNESLineSearchObject *__pyx_v_linesearch); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_10linesearch___get__(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_4SNES_10linesearch_2__set__(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_260setNewtonALFunction(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_262getNewtonALLoadParameter(struct PyPetscSNESObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_264setNewtonALCorrectionType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_corrtype); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_14SNESLineSearch___cinit__(struct PyPetscSNESLineSearchObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_2create(struct PyPetscSNESLineSearchObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_4setFromOptions(struct PyPetscSNESLineSearchObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_6view(struct PyPetscSNESLineSearchObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_8getType(struct PyPetscSNESLineSearchObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_10setType(struct PyPetscSNESLineSearchObject *__pyx_v_self, PyObject *__pyx_v_ls_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_12getTolerances(struct PyPetscSNESLineSearchObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_14setTolerances(struct PyPetscSNESLineSearchObject *__pyx_v_self, PyObject *__pyx_v_minstep, PyObject *__pyx_v_maxstep, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol, PyObject *__pyx_v_ltol, PyObject *__pyx_v_max_its); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_16getOrder(struct PyPetscSNESLineSearchObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_18setOrder(struct PyPetscSNESLineSearchObject *__pyx_v_self, PyObject *__pyx_v_order); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_20destroy(struct PyPetscSNESLineSearchObject *__pyx_v_self); /* 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_20setARKIMEXFastSlowSplit(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_22getType(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_24getRKType(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_26getARKIMEXType(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_28setDIRKType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ts_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_30getDIRKType(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_32setProblemType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_ptype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_34getProblemType(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_36setEquationType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_eqtype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_38getEquationType(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_40setOptionsPrefix(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_42getOptionsPrefix(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_44appendOptionsPrefix(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_prefix); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_46setFromOptions(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_48setAppCtx(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_appctx); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_50getAppCtx(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_52setRHSFunction(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_54setRHSJacobian(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_56computeRHSFunction(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_58computeRHSFunctionLinear(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_60computeRHSJacobian(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_62computeRHSJacobianConstant(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_64getRHSFunction(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_66getRHSJacobian(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_68setIFunction(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_70setIJacobian(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_72setIJacobianP(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_74computeIFunction(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_76computeIJacobian(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_78computeIJacobianP(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_80getIFunction(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_82getIJacobian(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_84setI2Function(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_86setI2Jacobian(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_88computeI2Function(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_90computeI2Jacobian(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_92getI2Function(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_94getI2Jacobian(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_96setRHSSplitIS(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_splitname, struct PyPetscISObject *__pyx_v_iss); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_98setRHSSplitRHSFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_splitname, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_r, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_100setRHSSplitIFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_splitname, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_r, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_102setRHSSplitIJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_splitname, 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_104setSolution(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_106getSolution(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_108setSolution2(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u, struct PyPetscVecObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_110getSolution2(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_112setEvaluationTimes(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_tspan); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_114getEvaluationTimes(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_116getEvaluationSolutions(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_118setTimeSpan(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_tspan); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_120getTimeSpanSolutions(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_122getSNES(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_124getKSP(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_126getDM(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_128setDM(struct PyPetscTSObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_130setTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_132getTime(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_134getPrevTime(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_136getSolveTime(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_138setTimeStep(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_time_step); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_140getTimeStep(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_142setStepNumber(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_step_number); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_144getStepNumber(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_146setMaxTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_max_time); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_148getMaxTime(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_150setMaxSteps(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_max_steps); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_152getMaxSteps(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_154getSNESIterations(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_156getKSPIterations(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_158setMaxStepRejections(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_160getStepRejections(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_162setMaxSNESFailures(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_164getSNESFailures(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_166setErrorIfStepFails(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_168setTolerances(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_170getTolerances(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_172setExactFinalTime(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_option); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_174setConvergedReason(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_176getConvergedReason(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_178setMonitor(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_180getMonitor(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_182monitorCancel(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_184monitor(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_186setEventHandler(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_direction, PyObject *__pyx_v_terminate, PyObject *__pyx_v_indicator, PyObject *__pyx_v_postevent, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_188setEventTolerances(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_tol, PyObject *__pyx_v_vtol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_190getNumEvents(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_192setPreStep(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_194getPreStep(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_196setPostStep(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_198getPostStep(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_200setUp(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_202reset(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_204step(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_206restartStep(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_208rollBack(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_210solve(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_212interpolate(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_t, struct PyPetscVecObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_214setStepLimits(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_hmin, PyObject *__pyx_v_hmax); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_216getStepLimits(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_218setSaveTrajectory(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_220removeTrajectory(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_222getCostIntegral(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_224setCostGradients(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_vl, PyObject *__pyx_v_vm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_226getCostGradients(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_228setRHSJacobianP(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_230createQuadratureTS(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_forward); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_232getQuadratureTS(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_234setRHSJacobianP(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_236computeRHSJacobianP(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_238adjointSetSteps(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_adjoint_steps); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_240adjointSetUp(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_242adjointSolve(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_244adjointStep(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_246adjointReset(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_248createPython(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_250setPythonContext(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_252getPythonContext(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_254setPythonType(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_256getPythonType(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_258setTheta(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_theta); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_260getTheta(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_262setThetaEndpoint(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_264getThetaEndpoint(struct PyPetscTSObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_266setAlphaRadius(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_radius); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_268setAlphaParams(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_270getAlphaParams(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_38getObjective(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_40getGradient(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_42setObjectiveGradient(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_44getObjectiveAndGradient(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_46setVariableBounds(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_48setConstraints(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_50setHessian(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_52getHessian(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_54setJacobian(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_56setStateDesignIS(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscISObject *__pyx_v_state, struct PyPetscISObject *__pyx_v_design); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_58setJacobianState(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_60setJacobianDesign(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_62getLMVMMat(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_64setLMVMMat(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_M); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_66setEqualityConstraints(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_68getEqualityConstraints(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_70setJacobianEquality(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_72getJacobianEquality(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_74setInequalityConstraints(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_inequality_constraints, struct PyPetscVecObject *__pyx_v_c, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_76getInequalityConstraints(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_78setJacobianInequality(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian_inequality, 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_80getJacobianInequality(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_82setUpdate(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_84getUpdate(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_86computeObjective(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_88computeResidual(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_90computeGradient(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_g); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_92computeObjectiveGradient(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_g); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_94computeDualVariables(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_96computeVariableBounds(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_xl, struct PyPetscVecObject *__pyx_v_xu); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_98computeConstraints(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_100computeHessian(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_102computeJacobian(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_104setTolerances(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_106getTolerances(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_108setMaximumIterations(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_mit); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_110getMaximumIterations(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_112setMaximumFunctionEvaluations(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_mit); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_114getMaximumFunctionEvaluations(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_116setConstraintTolerances(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_catol, PyObject *__pyx_v_crtol); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_118getConstraintTolerances(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_120setConvergenceTest(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_122getConvergenceTest(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_124setConvergedReason(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_reason); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_126getConvergedReason(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_128setMonitor(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_130getMonitor(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_132cancelMonitor(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_134monitor(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_136solve(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_138getSolution(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_140setGradientNorm(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_142getGradientNorm(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_144setLMVMH0(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_146getLMVMH0(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_148getLMVMH0KSP(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_150getVariableBounds(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_152setBNCGType(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_cg_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_154getBNCGType(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_156setIterationNumber(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_its); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_158getIterationNumber(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_160getObjectiveValue(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_162getConvergedReason(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_164getSolutionNorm(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_166getSolutionStatus(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_168checkConverged(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_170getKSP(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_172getTerm(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_174addTerm(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_prefix, PyObject *__pyx_v_scale, PyObject *__pyx_v_term, struct PyPetscVecObject *__pyx_v_params, struct PyPetscMatObject *__pyx_v_mapmat); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_176getALMMSubsolver(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_178getALMMType(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_180setALMMSubsolver(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_subsolver); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_182setALMMType(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_tao_almm_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_184getBRGNSubsolver(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_186setBRGNRegularizerObjectiveGradient(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_188setBRGNRegularizerHessian(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_190setBRGNRegularizerWeight(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_192setBRGNSmoothL1Epsilon(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_epsilon); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_194setBRGNDictionaryMatrix(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_D); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_196getBRGNDampingVector(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_198createPython(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_200setPythonContext(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_202getPythonContext(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_204setPythonType(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_py_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_206getPythonType(struct PyPetscTAOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_208getLineSearch(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 PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_30setInitialStepLength(struct PyPetscTAOLineSearchObject *__pyx_v_self, PyObject *__pyx_v_s); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_7TAOTerm___cinit__(struct PyPetscTAOTermObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7TAOTerm_2view(struct PyPetscTAOTermObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7TAOTerm_4destroy(struct PyPetscTAOTermObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7TAOTerm_6create(struct PyPetscTAOTermObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7TAOTerm_8setType(struct PyPetscTAOTermObject *__pyx_v_self, PyObject *__pyx_v_term_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7TAOTerm_10getType(struct PyPetscTAOTermObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7TAOTerm_12setFromOptions(struct PyPetscTAOTermObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7TAOTerm_14setUp(struct PyPetscTAOTermObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7TAOTerm_16setSolutionTemplate(struct PyPetscTAOTermObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x); /* 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_32setUp(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_34setAppCtx(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_appctx); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_36getAppCtx(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_38getUseNatural(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_40setUseNatural(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_useNatural); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_42setBasicAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_useCone, PyObject *__pyx_v_useClosure); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_44getBasicAdjacency(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_46setFieldAdjacency(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_48getFieldAdjacency(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_50createSubDM(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_52setAuxiliaryVec(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_54getAuxiliaryVec(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_56setNumFields(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_numFields); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_58getNumFields(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_60setField(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_62getField(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_64addField(struct PyPetscDMObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_field, PyObject *__pyx_v_label); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_66clearFields(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_68copyFields(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, PyObject *__pyx_v_minDegree, PyObject *__pyx_v_maxDegree); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_70createDS(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_72clearDS(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_74getDS(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_76copyDS(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, PyObject *__pyx_v_minDegree, PyObject *__pyx_v_maxDegree); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_78copyDisc(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_80getBlockSize(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_82setVecType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_vec_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_84createGlobalVec(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_86createLocalVec(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_88getGlobalVec(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_90restoreGlobalVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_92getLocalVec(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_94restoreLocalVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_96globalToLocal(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_98localToGlobal(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_100localToLocal(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_102getLGMap(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_104getCoarseDM(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_106setCoarseDM(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_108getCoordinateDM(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_110getCoordinateSection(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_112setCoordinates(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_114getCoordinates(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_116setCoordinatesLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_118getCoordinatesLocal(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_120setCellCoordinateDM(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_122getCellCoordinateDM(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_124setCellCoordinateSection(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dim, struct PyPetscSectionObject *__pyx_v_sec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_126getCellCoordinateSection(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_128setCellCoordinates(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_130getCellCoordinates(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_132setCellCoordinatesLocal(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_134getCellCoordinatesLocal(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_136setCoordinateDisc(struct PyPetscDMObject *__pyx_v_self, struct PyPetscFEObject *__pyx_v_disc, PyObject *__pyx_v_localized, PyObject *__pyx_v_project); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_138getCoordinatesLocalized(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_140getSparseLocalize(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_142setSparseLocalize(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_144getBoundingBox(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_146getLocalBoundingBox(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_148localizeCoordinates(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_150getPeriodicity(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_152setPeriodicity(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_maxCell, PyObject *__pyx_v_Lstart, PyObject *__pyx_v_L); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_154setMatType(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_mat_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_156createMat(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_158createMassMatrix(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dmf); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_160createInterpolation(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_162createInjection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_164createRestriction(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_166convert(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dm_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_168refine(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_170coarsen(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_172refineHierarchy(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_nlevels); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_174coarsenHierarchy(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_nlevels); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_176getRefineLevel(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_178setRefineLevel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_level); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_180getCoarsenLevel(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_182adaptLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_label); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_184adaptMetric(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_186getLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_188setLocalSection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_190getLocalSection(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_192setGlobalSection(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_194getGlobalSection(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_196createSectionSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_localsec, struct PyPetscSectionObject *__pyx_v_globalsec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_198getSectionSF(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_200setSectionSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_202getPointSF(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_204setPointSF(struct PyPetscDMObject *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_206getNumLabels(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_208getLabelName(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_210hasLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_212createLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_214removeLabel(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_216getLabelValue(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_218setLabelValue(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_220clearLabelValue(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_222getLabelSize(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_224getLabelIdIS(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_226getStratumSize(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_228getStratumIS(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_230clearLabelStratum(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_232setLabelOutput(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_output); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_234getLabelOutput(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_236setKSPComputeOperators(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_238createFieldDecomposition(struct PyPetscDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_240setSNESFunction(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_242setSNESJacobian(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_244addCoarsenHook(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, PyObject *__pyx_v_readonly); /* 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_localizationHeight, PyObject *__pyx_v_sparseLocalize, 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_20createCoordinateSpace(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_localized, PyObject *__pyx_v_project); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_22createCohesiveSubmesh(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_24createColoring(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_depth, PyObject *__pyx_v_distance); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_26filter(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_label, PyObject *__pyx_v_value, PyObject *__pyx_v_ignoreHalo, PyObject *__pyx_v_sanitizeSubMesh, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_28getChart(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_30setChart(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_32getConeSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_34setConeSize(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_36getCone(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_38setCone(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_40insertCone(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_42insertConeOrientation(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_44getConeOrientation(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_46setConeOrientation(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_48setCellType(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_50getCellType(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_52getCellTypeLabel(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_54getSupportSize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_56setSupportSize(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_58getSupport(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_60setSupport(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_62getMaxSizes(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_64symmetrize(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_66stratify(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_68orient(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_70getCellNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_72getVertexNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_74createPointNumbering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_76getDepth(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_78getDepthStratum(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_svalue); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_80getHeightStratum(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_svalue); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_82getPointDepth(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_84getPointHeight(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_86getMeet(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_88getJoin(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_90getFullJoin(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_points); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_92getTransitiveClosure(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_94vecGetClosure(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_96getVecClosure(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_98setVecClosure(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_100setMatClosure(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_102generate(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_104setTriangleOptions(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_opts); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_106setTetGenOptions(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_opts); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_108markBoundaryFaces(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_110labelComplete(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscDMLabelObject *__pyx_v_label); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_112labelCohesiveComplete(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, PyObject *__pyx_v_split, struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_subdm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_114setAdjacencyUseAnchors(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_useAnchors); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_116getAdjacencyUseAnchors(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_118getAdjacency(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_120setPartitioner(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscPartitionerObject *__pyx_v_part); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_122getPartitioner(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_124rebalanceSharedPoints(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_126distribute(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_overlap); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_128distributeOverlap(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_overlap); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_130isDistributed(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_132isSimplex(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_134distributeGetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_136distributeSetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_138distributionSetName(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_140distributionGetName(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_142interpolate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_144uninterpolate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_146distributeField(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_148getMinRadius(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_150createCoarsePointIS(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_152createSection(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_154getPointLocal(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_156getPointLocalField(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_158getPointGlobal(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_point); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_160getPointGlobalField(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_162createClosureIndex(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_sec); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_164setRefinementUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_refinementUniform); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_166getRefinementUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_168setRefinementLimit(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_refinementLimit); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_170getRefinementLimit(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_172getOrdering(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_otype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_174permute(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscISObject *__pyx_v_perm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_176reorderGetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_178reorderSetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_180computeCellGeometryFVM(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_cell); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_182constructGhostCells(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_labelName); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_184getSubpointIS(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_186getSubpointMap(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_188metricSetFromOptions(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_190metricSetUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_uniform); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_192metricIsUniform(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_194metricSetIsotropic(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_isotropic); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_196metricIsIsotropic(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_198metricSetRestrictAnisotropyFirst(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_restrictAnisotropyFirst); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_200metricRestrictAnisotropyFirst(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_202metricSetNoInsertion(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_noInsert); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_204metricNoInsertion(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_206metricSetNoSwapping(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_noSwap); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_208metricNoSwapping(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_210metricSetNoMovement(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_noMove); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_212metricNoMovement(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_214metricSetNoSurf(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_noSurf); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_216metricNoSurf(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_218metricSetVerbosity(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_verbosity); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_220metricGetVerbosity(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_222metricSetNumIterations(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_numIter); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_224metricGetNumIterations(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_226metricSetMinimumMagnitude(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_h_min); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_228metricGetMinimumMagnitude(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_230metricSetMaximumMagnitude(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_h_max); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_232metricGetMaximumMagnitude(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_234metricSetMaximumAnisotropy(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_a_max); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_236metricGetMaximumAnisotropy(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_238metricSetTargetComplexity(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_targetComplexity); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_240metricGetTargetComplexity(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_242metricSetNormalizationOrder(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_p); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_244metricGetNormalizationOrder(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_246metricSetGradationFactor(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_beta); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_248metricGetGradationFactor(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_250metricSetHausdorffNumber(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_hausd); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_252metricGetHausdorffNumber(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_254metricCreate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_256metricCreateUniform(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_258metricCreateIsotropic(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_260metricDeterminantCreate(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_field); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_262metricEnforceSPD(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_264metricNormalize(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_266metricAverage2(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_268metricAverage3(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_270metricIntersection2(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_272metricIntersection3(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_274computeGradientClementInterpolant(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_276topologyView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_278coordinatesView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_280labelsView(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_282sectionView(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_284globalVectorView(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_286localVectorView(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_288topologyLoad(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_290coordinatesLoad(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_292labelsLoad(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_294sectionLoad(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_296globalVectorLoad(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_298localVectorLoad(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_300createNaturalVec(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_302naturalToGlobalBegin(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_nv, struct PyPetscVecObject *__pyx_v_gv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_304naturalToGlobalEnd(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_nv, struct PyPetscVecObject *__pyx_v_gv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_306globalToNaturalBegin(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gv, struct PyPetscVecObject *__pyx_v_nv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_308globalToNaturalEnd(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gv, struct PyPetscVecObject *__pyx_v_nv); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_310setMigrationSF(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSFObject *__pyx_v_sf); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_312getMigrationSF(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_314createGlobalToNaturalSF(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_section, struct PyPetscSFObject *__pyx_v_sfMigration); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_316migrateGlobalToNaturalSF(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dmOld, struct PyPetscSFObject *__pyx_v_sfNaturalOld, struct PyPetscSFObject *__pyx_v_sfMigration); /* 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_6createGlobalVectorFromFields(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldnames); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_8destroyGlobalVectorFromFields(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldnames); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_10createLocalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_12destroyLocalVectorFromField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_14createLocalVectorFromFields(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldnames); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_16destroyLocalVectorFromFields(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldnames); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_18initializeFieldRegister(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_20finalizeFieldRegister(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_22setLocalSizes(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_24registerField(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_26getField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_28restoreField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_30vectorDefineField(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldname); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_32addPoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_34addNPoints(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_npoints); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_36removePoint(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_38removePointAtIndex(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_40copyPoint(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_42getLocalSize(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_44getSize(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_46migrate(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_remove_sent_points); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_48collectViewCreate(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_50collectViewDestroy(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_52setCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_54getCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_56setType(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_dmswarm_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_58setPointsUniformCoordinates(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_60setPointCoordinates(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_62insertPointUsingCellDM(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_64setPointCoordinatesCellwise(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_coordinates); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_66viewFieldsXDMF(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_68viewXDMF(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_70sortGetAccess(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_72sortRestoreAccess(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_74sortGetPointsPerCell(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_e); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_76sortGetNumberOfPointsPerCell(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_e); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_78sortGetIsValid(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_80sortGetSizes(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_82projectFields(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, PyObject *__pyx_v_fieldnames, PyObject *__pyx_v_vecs, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_84addCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, struct PyPetscDMSwarmCellDMObject *__pyx_v_celldm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_86setCellDMActive(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_88getCellDMActive(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_90getCellDMByName(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_92getCellDMNames(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_94computeMoments(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_coord, PyObject *__pyx_v_weight); /* proto */
static int __pyx_pf_8petsc4py_5PETSc_6CellDM___cinit__(struct PyPetscDMSwarmCellDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6CellDM_2view(struct PyPetscDMSwarmCellDMObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6CellDM_4destroy(struct PyPetscDMSwarmCellDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6CellDM_6create(struct PyPetscDMSwarmCellDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, PyObject *__pyx_v_fields, PyObject *__pyx_v_coords); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6CellDM_8getDM(struct PyPetscDMSwarmCellDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6CellDM_10getCellID(struct PyPetscDMSwarmCellDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6CellDM_12getBlockSize(struct PyPetscDMSwarmCellDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_sw); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6CellDM_14getFields(struct PyPetscDMSwarmCellDMObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_6CellDM_16getCoordinateFields(struct PyPetscDMSwarmCellDMObject *__pyx_v_self); /* 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 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_48setSimpleDimension(struct PyPetscDualSpaceObject *__pyx_v_self, PyObject *__pyx_v_dim); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_50setSimpleFunctional(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 int __pyx_pf_8petsc4py_5PETSc_9Regressor___cinit__(struct PyPetscRegressorObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_2view(struct PyPetscRegressorObject *__pyx_v_self, struct PyPetscViewerObject *__pyx_v_viewer); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_4create(struct PyPetscRegressorObject *__pyx_v_self, PyObject *__pyx_v_comm); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_6setRegularizerWeight(struct PyPetscRegressorObject *__pyx_v_self, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_8setFromOptions(struct PyPetscRegressorObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_10setUp(struct PyPetscRegressorObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_12fit(struct PyPetscRegressorObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_X, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_14predict(struct PyPetscRegressorObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_X, struct PyPetscVecObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_16getTAO(struct PyPetscRegressorObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_18reset(struct PyPetscRegressorObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_20destroy(struct PyPetscRegressorObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_22setType(struct PyPetscRegressorObject *__pyx_v_self, PyObject *__pyx_v_regressor_type); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_24getType(struct PyPetscRegressorObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_26setLinearFitIntercept(struct PyPetscRegressorObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_28setLinearUseKSP(struct PyPetscRegressorObject *__pyx_v_self, PyObject *__pyx_v_flag); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_30getLinearKSP(struct PyPetscRegressorObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_32getLinearCoefficients(struct PyPetscRegressorObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_34getLinearIntercept(struct PyPetscRegressorObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_36setLinearType(struct PyPetscRegressorObject *__pyx_v_self, PyObject *__pyx_v_lineartype); /* proto */
static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_38getLinearType(struct PyPetscRegressorObject *__pyx_v_self); /* 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_SNESLineSearch(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_TAOTerm(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_CellDM(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_Regressor(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__PyVwr(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*/
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
/* SmallCodeConfig */
#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

typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  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 *PyPetscSNESLineSearch_Type;
  PyObject *PyPetscTS_Type;
  PyObject *PyPetscTAO_Type;
  PyObject *PyPetscTAOLineSearch_Type;
  PyObject *PyPetscTAOTerm_Type;
  PyObject *PyPetscAO_Type;
  PyObject *PyPetscDM_Type;
  PyObject *PyPetscDMPlexTransform_Type;
  PyObject *PyPetscDMSwarmCellDM_Type;
  PyObject *PyPetscDS_Type;
  PyObject *PyPetscPartitioner_Type;
  PyObject *PyPetscDMLabel_Type;
  PyObject *PyPetscRegressor_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__PyVwr;
  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;
  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_SNESLineSearch;
  PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TS;
  PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TAO;
  PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch;
  PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_TAOTerm;
  PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_AO;
  PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DM;
  PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform;
  PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_CellDM;
  PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DS;
  PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Partitioner;
  PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_DMLabel;
  PyTypeObject *__pyx_ptype_8petsc4py_5PETSc_Regressor;
  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__PyVwr;
  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;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
  __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop;
  PyObject *__pyx_k__18;
  PyObject *__pyx_k__19;
  PyObject *__pyx_k__20;
  PyObject *__pyx_k__21;
  PyObject *__pyx_k__22;
  PyObject *__pyx_k__23;
  PyObject *__pyx_k__24;
  PyObject *__pyx_k__25;
  PyObject *__pyx_k__26;
  PyObject *__pyx_slice[4];
  PyObject *__pyx_tuple[213];
  PyObject *__pyx_codeobj_tab[2052];
  PyObject *__pyx_string_tab[8741];
  PyObject *__pyx_number_tab[36];
/* #### Code section: module_state_contents ### */
/* CommonTypesMetaclass.module_state_decls */
PyTypeObject *__pyx_CommonTypesMetaclassType;

/* CachedMethodType.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_CachedMethodType;
#endif

/* CythonFunctionShared.module_state_decls */
PyTypeObject *__pyx_CyFunctionType;


#if CYTHON_USE_FREELISTS
struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator[8];
int __pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator;
#endif

#if CYTHON_USE_FREELISTS
struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct_1_decorator[8];
int __pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator;
#endif
/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;

/* #### Code section: module_state_end ### */
} __pyx_mstatetype;

#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_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))

#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
#else
static __pyx_mstatetype __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: constant_name_defines ### */
#define __pyx_kp_u_ __pyx_string_tab[0]
#define __pyx_kp_u_ARKIMEXType_str __pyx_string_tab[1]
#define __pyx_kp_u_A_matrix_with __pyx_string_tab[2]
#define __pyx_kp_u_Any_None __pyx_string_tab[3]
#define __pyx_kp_u_Argument_to_KSPSetDMActive __pyx_string_tab[4]
#define __pyx_kp_u_ArrayInt_None __pyx_string_tab[5]
#define __pyx_kp_u_ArrayScalar_None __pyx_string_tab[6]
#define __pyx_kp_u_Basic_constants_DECIDE_Use_a_de __pyx_string_tab[7]
#define __pyx_kp_u_Buffer_view_does_not_expose_stri __pyx_string_tab[8]
#define __pyx_kp_u_CSRSpec_CSRIndicesSpec __pyx_string_tab[9]
#define __pyx_kp_u_CSRSpec_CSRIndicesSpec_None __pyx_string_tab[10]
#define __pyx_kp_u_CSRSpec_tuple_CSRSpec_CSRSpec __pyx_string_tab[11]
#define __pyx_kp_u_Callable_DM_Comm_DM_None __pyx_string_tab[12]
#define __pyx_kp_u_Callable_DM_DM_Mat_None __pyx_string_tab[13]
#define __pyx_kp_u_Callable_DM_DM_tuple_Mat_Vec_Non __pyx_string_tab[14]
#define __pyx_kp_u_Callable_DM_Mat_None __pyx_string_tab[15]
#define __pyx_kp_u_Callable_DM_Sequence_int_tuple_I __pyx_string_tab[16]
#define __pyx_kp_u_Callable_DM_Vec_InsertMode_Vec_N __pyx_string_tab[17]
#define __pyx_kp_u_Callable_DM_Vec_None __pyx_string_tab[18]
#define __pyx_kp_u_Callable_DM_list_DM_tuple_list_S __pyx_string_tab[19]
#define __pyx_kp_u_Callable_DM_tuple_list_str_None __pyx_string_tab[20]
#define __pyx_kp_u_Callable_DM_tuple_list_str_None_2 __pyx_string_tab[21]
#define __pyx_kp_u_Can_only_create_a_buffer_that_is __pyx_string_tab[22]
#define __pyx_kp_u_Cannot_assign_to_read_only_memor __pyx_string_tab[23]
#define __pyx_kp_u_Cannot_create_writable_memory_vi __pyx_string_tab[24]
#define __pyx_kp_u_Cannot_index_with_type __pyx_string_tab[25]
#define __pyx_kp_u_Cannot_transpose_memoryview_with __pyx_string_tab[26]
#define __pyx_kp_u_Comm_None __pyx_string_tab[27]
#define __pyx_kp_u_DIRKType_str __pyx_string_tab[28]
#define __pyx_kp_u_DMLabel_None __pyx_string_tab[29]
#define __pyx_kp_u_DMPlexTransformType_str __pyx_string_tab[30]
#define __pyx_kp_u_DM_Boundary_types __pyx_string_tab[31]
#define __pyx_kp_u_DM_PolytopeType __pyx_string_tab[32]
#define __pyx_kp_u_DM_ReorderDefaultFlag __pyx_string_tab[33]
#define __pyx_kp_u_DM_Type __pyx_string_tab[34]
#define __pyx_kp_u_DM_Type_str __pyx_string_tab[35]
#define __pyx_kp_u_DM_types __pyx_string_tab[36]
#define __pyx_kp_u_DeviceContext_None __pyx_string_tab[37]
#define __pyx_kp_u_DeviceContext_StreamType_str_Non __pyx_string_tab[38]
#define __pyx_kp_u_Device_type_not_supported __pyx_string_tab[39]
#define __pyx_kp_u_Dimension_d_is_not_direct __pyx_string_tab[40]
#define __pyx_kp_u_DimsSpec_None __pyx_string_tab[41]
#define __pyx_kp_u_Distinguishes_among_types_of_exp __pyx_string_tab[42]
#define __pyx_kp_u_Distinguishes_linear_and_nonline __pyx_string_tab[43]
#define __pyx_kp_u_DuplicateOption_bool __pyx_string_tab[44]
#define __pyx_kp_u_ElementType_None __pyx_string_tab[45]
#define __pyx_kp_u_ElementType_str __pyx_string_tab[46]
#define __pyx_kp_u_Element_types __pyx_string_tab[47]
#define __pyx_kp_u_Empty_shape_tuple_for_cython_arr __pyx_string_tab[48]
#define __pyx_kp_u_Enum_describing_mapping_behavior __pyx_string_tab[49]
#define __pyx_kp_u_Expect_a_dltensor_field_pycapsul __pyx_string_tab[50]
#define __pyx_kp_u_Expect_a_dltensor_or_used_dltens __pyx_string_tab[51]
#define __pyx_kp_u_Factored_matrix_ordering_type_Se __pyx_string_tab[52]
#define __pyx_kp_u_Factored_matrix_shift_type_See_A __pyx_string_tab[53]
#define __pyx_kp_u_Factored_matrix_solver_type_See __pyx_string_tab[54]
#define __pyx_kp_u_FailedReason_str __pyx_string_tab[55]
#define __pyx_kp_u_FileMode_str __pyx_string_tab[56]
#define __pyx_kp_u_FileMode_str_None __pyx_string_tab[57]
#define __pyx_kp_u_GAMGType_str __pyx_string_tab[58]
#define __pyx_kp_u_Git_Date __pyx_string_tab[59]
#define __pyx_kp_u_Given __pyx_string_tab[60]
#define __pyx_kp_u_IS_Sequence_IS __pyx_string_tab[61]
#define __pyx_kp_u_IS_Sequence_IS_None __pyx_string_tab[62]
#define __pyx_kp_u_IS_Sequence_int __pyx_string_tab[63]
#define __pyx_kp_u_IS_Type_str __pyx_string_tab[64]
#define __pyx_kp_u_I_0_is __pyx_string_tab[65]
#define __pyx_kp_u_Indirect_dimensions_not_supporte __pyx_string_tab[66]
#define __pyx_kp_u_InfoType_None __pyx_string_tab[67]
#define __pyx_kp_u_Input_vector_has_no_tensor_infor __pyx_string_tab[68]
#define __pyx_kp_u_InsertModeSpec_None __pyx_string_tab[69]
#define __pyx_kp_u_InsertMode_None __pyx_string_tab[70]
#define __pyx_kp_u_Insertion_mode_Most_commonly_use __pyx_string_tab[71]
#define __pyx_kp_u_Interpolation_types __pyx_string_tab[72]
#define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_string_tab[73]
#define __pyx_kp_u_Invalid_mode_expected_r_w_or_rw __pyx_string_tab[74]
#define __pyx_kp_u_Invalid_mode_expected_rw_r_or_w __pyx_string_tab[75]
#define __pyx_kp_u_Invalid_shape_in_axis __pyx_string_tab[76]
#define __pyx_kp_u_JoinMode_str __pyx_string_tab[77]
#define __pyx_kp_u_KSPPostSolveFunction_None __pyx_string_tab[78]
#define __pyx_kp_u_KSPPreSolveFunction_None __pyx_string_tab[79]
#define __pyx_kp_u_KSP_ConvergedReason __pyx_string_tab[80]
#define __pyx_kp_u_KSP_Converged_Reason_CONVERGED_I __pyx_string_tab[81]
#define __pyx_kp_u_KSP_Type_The_available_types_are __pyx_string_tab[82]
#define __pyx_kp_u_KSP_norm_type_The_available_norm __pyx_string_tab[83]
#define __pyx_kp_u_LGMap_MapMode_str_None __pyx_string_tab[84]
#define __pyx_kp_u_LGMap_Type_str __pyx_string_tab[85]
#define __pyx_kp_u_LayoutSizeSpec_None __pyx_string_tab[86]
#define __pyx_kp_u_Linear_regressor_type_See_Also_p __pyx_string_tab[87]
#define __pyx_kp_u_Literal_r_R_right_Right_RIGHT_l __pyx_string_tab[88]
#define __pyx_kp_u_Local_to_global_map_types __pyx_string_tab[89]
#define __pyx_kp_u_LogClass_None __pyx_string_tab[90]
#define __pyx_kp_u_MatBlockSizeSpec_None __pyx_string_tab[91]
#define __pyx_kp_u_Mat_FactorShiftType_None __pyx_string_tab[92]
#define __pyx_kp_u_Mat_None __pyx_string_tab[93]
#define __pyx_kp_u_Mat_OrderingType __pyx_string_tab[94]
#define __pyx_kp_u_Mat_Sequence_Mat_None __pyx_string_tab[95]
#define __pyx_kp_u_Mat_SolverType_str __pyx_string_tab[96]
#define __pyx_kp_u_Mat_Type_str __pyx_string_tab[97]
#define __pyx_kp_u_Matrix_SOR_type_See_Also_petsc_M __pyx_string_tab[98]
#define __pyx_kp_u_Matrix_assembly_type_See_Also_pe __pyx_string_tab[99]
#define __pyx_kp_u_Matrix_duplicate_option_See_Also __pyx_string_tab[100]
#define __pyx_kp_u_Matrix_info_type __pyx_string_tab[101]
#define __pyx_kp_u_Matrix_modification_structure_Se __pyx_string_tab[102]
#define __pyx_kp_u_Matrix_option_See_Also_petsc_Mat __pyx_string_tab[103]
#define __pyx_kp_u_Matrix_type_See_Also_petsc_MatTy __pyx_string_tab[104]
#define __pyx_kp_u_MemoryView_of __pyx_string_tab[105]
#define __pyx_kp_u_Missing_input_parameters __pyx_string_tab[106]
#define __pyx_kp_u_More_constants_INFINITY_Very_la __pyx_string_tab[107]
#define __pyx_kp_u_Must_provide_as_many_communicato __pyx_string_tab[108]
#define __pyx_kp_u_Must_provide_both_sizes_and_poin __pyx_string_tab[109]
#define __pyx_kp_u_Must_provide_operator_for_USER_o __pyx_string_tab[110]
#define __pyx_kp_u_NNZSpec_None __pyx_string_tab[111]
#define __pyx_kp_u_Norm_type_Commonly_used_norm_typ __pyx_string_tab[112]
#define __pyx_kp_u_Not_for_rectangular_matrices __pyx_string_tab[113]
#define __pyx_kp_u_Not_for_type __pyx_string_tab[114]
#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[115]
#define __pyx_kp_u_Out_of_bounds_on_buffer_access_a __pyx_string_tab[116]
#define __pyx_kp_u_Out_of_memory_Allocated __pyx_string_tab[117]
#define __pyx_kp_u_PC_Side __pyx_string_tab[118]
#define __pyx_kp_u_PETSc_Error_Attributes_ierr_int __pyx_string_tab[119]
#define __pyx_kp_u_PETSc_Error_d __pyx_string_tab[120]
#define __pyx_kp_u_PetscOptionsHandlerFunction_None __pyx_string_tab[121]
#define __pyx_kp_u_Portable_Extensible_Toolkit_for __pyx_string_tab[122]
#define __pyx_kp_u_REGRESSOR_solver_type_See_Also_p __pyx_string_tab[123]
#define __pyx_kp_u_RKType_str __pyx_string_tab[124]
#define __pyx_kp_u_Random_Type_str __pyx_string_tab[125]
#define __pyx_kp_u_SF_None __pyx_string_tab[126]
#define __pyx_kp_u_SNESConvergedFunction_Literal_sk __pyx_string_tab[127]
#define __pyx_kp_u_SNESFunction_None __pyx_string_tab[128]
#define __pyx_kp_u_SNESGuessFunction_None __pyx_string_tab[129]
#define __pyx_kp_u_SNESJacobianFunction_None __pyx_string_tab[130]
#define __pyx_kp_u_SNESLSPreFunction_None __pyx_string_tab[131]
#define __pyx_kp_u_SNESMonitorFunction_None __pyx_string_tab[132]
#define __pyx_kp_u_SNESNEWTONAL_correction_type_See __pyx_string_tab[133]
#define __pyx_kp_u_SNESNGSFunction_None __pyx_string_tab[134]
#define __pyx_kp_u_SNESObjFunction_None __pyx_string_tab[135]
#define __pyx_kp_u_SNESUpdateFunction_None __pyx_string_tab[136]
#define __pyx_kp_u_SNES_linesearch_type_See_Also_pe __pyx_string_tab[137]
#define __pyx_kp_u_SNES_norm_schedule_See_Also_pets __pyx_string_tab[138]
#define __pyx_kp_u_SNES_solver_termination_reason_S __pyx_string_tab[139]
#define __pyx_kp_u_SNES_solver_type_See_Also_petsc __pyx_string_tab[140]
#define __pyx_kp_u_SORType_None __pyx_string_tab[141]
#define __pyx_kp_u_Scatter_mode_Most_commonly_used __pyx_string_tab[142]
#define __pyx_kp_u_Scatter_type_See_Also_petsc_VecS __pyx_string_tab[143]
#define __pyx_kp_u_Sequence_Comm_None __pyx_string_tab[144]
#define __pyx_kp_u_Sequence_IS_None __pyx_string_tab[145]
#define __pyx_kp_u_Sequence_Mat __pyx_string_tab[146]
#define __pyx_kp_u_Sequence_Scalar __pyx_string_tab[147]
#define __pyx_kp_u_Sequence_Scalar_None __pyx_string_tab[148]
#define __pyx_kp_u_Sequence_Sequence_Mat __pyx_string_tab[149]
#define __pyx_kp_u_Sequence_Sequence_float __pyx_string_tab[150]
#define __pyx_kp_u_Sequence_Stencil __pyx_string_tab[151]
#define __pyx_kp_u_Sequence_Vec __pyx_string_tab[152]
#define __pyx_kp_u_Sequence_bool __pyx_string_tab[153]
#define __pyx_kp_u_Sequence_float __pyx_string_tab[154]
#define __pyx_kp_u_Sequence_float_None __pyx_string_tab[155]
#define __pyx_kp_u_Sequence_int __pyx_string_tab[156]
#define __pyx_kp_u_Sequence_int_IS __pyx_string_tab[157]
#define __pyx_kp_u_Sequence_int_IS_None __pyx_string_tab[158]
#define __pyx_kp_u_Sequence_int_None __pyx_string_tab[159]
#define __pyx_kp_u_Sequence_int_float_complex __pyx_string_tab[160]
#define __pyx_kp_u_Sequence_str __pyx_string_tab[161]
#define __pyx_kp_u_Sequence_str_int_bool_None __pyx_string_tab[162]
#define __pyx_kp_u_StencilType_None __pyx_string_tab[163]
#define __pyx_kp_u_StencilType_str __pyx_string_tab[164]
#define __pyx_kp_u_Stencil_location_types __pyx_string_tab[165]
#define __pyx_kp_u_Stencil_types __pyx_string_tab[166]
#define __pyx_kp_u_StreamType_str __pyx_string_tab[167]
#define __pyx_kp_u_Structure_None __pyx_string_tab[168]
#define __pyx_kp_u_Swarm_PIC_layout_types __pyx_string_tab[169]
#define __pyx_kp_u_Swarm_collection_types __pyx_string_tab[170]
#define __pyx_kp_u_Swarm_migration_types __pyx_string_tab[171]
#define __pyx_kp_u_Swarm_types __pyx_string_tab[172]
#define __pyx_kp_u_TAOConvergedFunction_None __pyx_string_tab[173]
#define __pyx_kp_u_TAO_Augmented_Lagrangian_Multipl __pyx_string_tab[174]
#define __pyx_kp_u_TAO_Bound_Constrained_Conjugate __pyx_string_tab[175]
#define __pyx_kp_u_TAO_Line_Search_Termination_Reas __pyx_string_tab[176]
#define __pyx_kp_u_TAO_Line_Search_Types __pyx_string_tab[177]
#define __pyx_kp_u_TAO_Term_Types __pyx_string_tab[178]
#define __pyx_kp_u_TAO_solver_termination_reason_Se __pyx_string_tab[179]
#define __pyx_kp_u_TAO_solver_type_See_Also_petsc_T __pyx_string_tab[180]
#define __pyx_kp_u_TSI2Function_None __pyx_string_tab[181]
#define __pyx_kp_u_TSI2Jacobian_None __pyx_string_tab[182]
#define __pyx_kp_u_TSIFunction_None __pyx_string_tab[183]
#define __pyx_kp_u_TSIJacobian_None __pyx_string_tab[184]
#define __pyx_kp_u_TSIndicatorFunction_None __pyx_string_tab[185]
#define __pyx_kp_u_TSMonitorFunction_None __pyx_string_tab[186]
#define __pyx_kp_u_TSPostEventFunction_None __pyx_string_tab[187]
#define __pyx_kp_u_TSPostStepFunction_None __pyx_string_tab[188]
#define __pyx_kp_u_TSPreStepFunction_None __pyx_string_tab[189]
#define __pyx_kp_u_TSRHSFunction_None __pyx_string_tab[190]
#define __pyx_kp_u_TSRHSJacobianP_None __pyx_string_tab[191]
#define __pyx_kp_u_TSRHSJacobian_None __pyx_string_tab[192]
#define __pyx_kp_u_Tensor_dtype_does_not_match_PETS __pyx_string_tab[193]
#define __pyx_kp_u_The_ARKIMEX_subtype __pyx_string_tab[194]
#define __pyx_kp_u_The_ASM_subtype __pyx_string_tab[195]
#define __pyx_kp_u_The_DIRK_subtype __pyx_string_tab[196]
#define __pyx_kp_u_The_DM_cell_types __pyx_string_tab[197]
#define __pyx_kp_u_The_DM_reordering_default_flags __pyx_string_tab[198]
#define __pyx_kp_u_The_Discrete_System_types __pyx_string_tab[199]
#define __pyx_kp_u_The_GAMG_subtype __pyx_string_tab[200]
#define __pyx_kp_u_The_GASM_subtype __pyx_string_tab[201]
#define __pyx_kp_u_The_HPDDM_Krylov_solver_type __pyx_string_tab[202]
#define __pyx_kp_u_The_HPDDM_coarse_correction_type __pyx_string_tab[203]
#define __pyx_kp_u_The_MG_cycle_type __pyx_string_tab[204]
#define __pyx_kp_u_The_MG_subtype __pyx_string_tab[205]
#define __pyx_kp_u_The_RK_subtype __pyx_string_tab[206]
#define __pyx_kp_u_The_application_ordering_types __pyx_string_tab[207]
#define __pyx_kp_u_The_composite_type __pyx_string_tab[208]
#define __pyx_kp_u_The_deflation_space_subtype __pyx_string_tab[209]
#define __pyx_kp_u_The_dual_space_types __pyx_string_tab[210]
#define __pyx_kp_u_The_field_split_Schur_factorizat __pyx_string_tab[211]
#define __pyx_kp_u_The_field_split_Schur_subtype __pyx_string_tab[212]
#define __pyx_kp_u_The_finite_element_types __pyx_string_tab[213]
#define __pyx_kp_u_The_function_space_types __pyx_string_tab[214]
#define __pyx_kp_u_The_index_set_types __pyx_string_tab[215]
#define __pyx_kp_u_The_manner_in_which_the_precondi __pyx_string_tab[216]
#define __pyx_kp_u_The_method_for_ending_time_stepp __pyx_string_tab[217]
#define __pyx_kp_u_The_partitioner_types __pyx_string_tab[218]
#define __pyx_kp_u_The_partitioning_types __pyx_string_tab[219]
#define __pyx_kp_u_The_patch_construction_type __pyx_string_tab[220]
#define __pyx_kp_u_The_preconditioner_method __pyx_string_tab[221]
#define __pyx_kp_u_The_random_number_generator_type __pyx_string_tab[222]
#define __pyx_kp_u_The_reason_the_preconditioner_ha __pyx_string_tab[223]
#define __pyx_kp_u_The_reason_the_time_step_is_conv __pyx_string_tab[224]
#define __pyx_kp_u_The_star_forest_types __pyx_string_tab[225]
#define __pyx_kp_u_The_time_stepping_method __pyx_string_tab[226]
#define __pyx_kp_u_The_type_of_device_See_Also_Devi __pyx_string_tab[227]
#define __pyx_kp_u_The_type_of_join_to_perform_See __pyx_string_tab[228]
#define __pyx_kp_u_The_type_of_stream_See_Also_Devi __pyx_string_tab[229]
#define __pyx_kp_u_The_vector_type __pyx_string_tab[230]
#define __pyx_kp_u_Transformation_types __pyx_string_tab[231]
#define __pyx_kp_u_Type_None __pyx_string_tab[232]
#define __pyx_kp_u_Type_str __pyx_string_tab[233]
#define __pyx_kp_u_Type_str_None __pyx_string_tab[234]
#define __pyx_kp_u_Unable_to_convert_item_to_object __pyx_string_tab[235]
#define __pyx_kp_u_Unsupported_PetscScalar_type __pyx_string_tab[236]
#define __pyx_kp_u_Used_by_process __pyx_string_tab[237]
#define __pyx_kp_u_Vec_None __pyx_string_tab[238]
#define __pyx_kp_u_Vec_Sequence_Vec_None __pyx_string_tab[239]
#define __pyx_kp_u_Vec_Type_str __pyx_string_tab[240]
#define __pyx_kp_u_Vec_tuple_Vec_Vec __pyx_string_tab[241]
#define __pyx_kp_u_Vector_assembly_option __pyx_string_tab[242]
#define __pyx_kp_u_Vector_local_size __pyx_string_tab[243]
#define __pyx_kp_u_Viewer_FileMode_str_None __pyx_string_tab[244]
#define __pyx_kp_u_Viewer_Object_None __pyx_string_tab[245]
#define __pyx_kp_u_Viewer_file_mode __pyx_string_tab[246]
#define __pyx_kp_u_Viewer_format __pyx_string_tab[247]
#define __pyx_kp_u_Viewer_type __pyx_string_tab[248]
#define __pyx_kp_u_Window_size __pyx_string_tab[249]
#define __pyx_kp_u__10 __pyx_string_tab[250]
#define __pyx_kp_u__11 __pyx_string_tab[251]
#define __pyx_kp_u__12 __pyx_string_tab[252]
#define __pyx_kp_u__13 __pyx_string_tab[253]
#define __pyx_kp_u__14 __pyx_string_tab[254]
#define __pyx_kp_u__15 __pyx_string_tab[255]
#define __pyx_kp_u__16 __pyx_string_tab[256]
#define __pyx_kp_u__17 __pyx_string_tab[257]
#define __pyx_kp_u__2 __pyx_string_tab[258]
#define __pyx_kp_u__27 __pyx_string_tab[259]
#define __pyx_kp_u__28 __pyx_string_tab[260]
#define __pyx_kp_u__3 __pyx_string_tab[261]
#define __pyx_kp_u__4 __pyx_string_tab[262]
#define __pyx_kp_u__5 __pyx_string_tab[263]
#define __pyx_kp_u__7 __pyx_string_tab[264]
#define __pyx_kp_u__8 __pyx_string_tab[265]
#define __pyx_kp_u_a_2 __pyx_string_tab[266]
#define __pyx_kp_u_add_note __pyx_string_tab[267]
#define __pyx_kp_u_already_registered __pyx_string_tab[268]
#define __pyx_kp_u_and __pyx_string_tab[269]
#define __pyx_kp_u_and_number_or_processors __pyx_string_tab[270]
#define __pyx_kp_u_and_number_ownership_ranges __pyx_string_tab[271]
#define __pyx_kp_u_and_vector_local_size __pyx_string_tab[272]
#define __pyx_kp_u_and_vector_local_size_2 __pyx_string_tab[273]
#define __pyx_kp_u_array_size __pyx_string_tab[274]
#define __pyx_kp_u_array_size_2 __pyx_string_tab[275]
#define __pyx_kp_u_at __pyx_string_tab[276]
#define __pyx_kp_u_at_0x __pyx_string_tab[277]
#define __pyx_kp_u_bcPoints_is_a_required_argument __pyx_string_tab[278]
#define __pyx_kp_u_block_size __pyx_string_tab[279]
#define __pyx_kp_u_block_size_d_must_be_positive __pyx_string_tab[280]
#define __pyx_kp_u_block_size_not_set __pyx_string_tab[281]
#define __pyx_kp_u_bool_None __pyx_string_tab[282]
#define __pyx_kp_u_bool_int_float_Scalar_Sequence_b __pyx_string_tab[283]
#define __pyx_kp_u_bs __pyx_string_tab[284]
#define __pyx_kp_u_c_d __pyx_string_tab[285]
#define __pyx_kp_u_cannot_place_input_array_size __pyx_string_tab[286]
#define __pyx_kp_u_cannot_register __pyx_string_tab[287]
#define __pyx_kp_u_cell_indices_must_have_two_dimen __pyx_string_tab[288]
#define __pyx_kp_u_collections_abc __pyx_string_tab[289]
#define __pyx_kp_u_cols_shape __pyx_string_tab[290]
#define __pyx_kp_u_column_indices_but __pyx_string_tab[291]
#define __pyx_kp_u_column_indices_must_have_two_dim __pyx_string_tab[292]
#define __pyx_kp_u_communicator_not_owned __pyx_string_tab[293]
#define __pyx_kp_u_contiguous_and_direct __pyx_string_tab[294]
#define __pyx_kp_u_contiguous_and_indirect __pyx_string_tab[295]
#define __pyx_kp_u_converged_callback_already_set_o __pyx_string_tab[296]
#define __pyx_kp_u_coo_i_and_coo_j_must_have_the_sa __pyx_string_tab[297]
#define __pyx_kp_u_coordinates_must_have_two_dimens __pyx_string_tab[298]
#define __pyx_kp_u_coordinates_size_must_be_at_leas __pyx_string_tab[299]
#define __pyx_kp_u_coords_source_must_have_d_column __pyx_string_tab[300]
#define __pyx_kp_u_coords_source_must_have_two_dime __pyx_string_tab[301]
#define __pyx_kp_u_coords_source_size_must_be_at_le __pyx_string_tab[302]
#define __pyx_kp_u_coords_target_must_have_d_column __pyx_string_tab[303]
#define __pyx_kp_u_coords_target_must_have_two_dime __pyx_string_tab[304]
#define __pyx_kp_u_coords_target_size_must_be_at_le __pyx_string_tab[305]
#define __pyx_kp_u_coords_vertices_must_have_two_di __pyx_string_tab[306]
#define __pyx_kp_u_d_s __pyx_string_tab[307]
#define __pyx_kp_u_dict_int_ArrayInt __pyx_string_tab[308]
#define __pyx_kp_u_dict_str_Any_None __pyx_string_tab[309]
#define __pyx_kp_u_dict_str_bool_int_str __pyx_string_tab[310]
#define __pyx_kp_u_dict_str_float __pyx_string_tab[311]
#define __pyx_kp_u_dict_str_int_float __pyx_string_tab[312]
#define __pyx_kp_u_dict_str_str __pyx_string_tab[313]
#define __pyx_kp_u_disable __pyx_string_tab[314]
#define __pyx_kp_u_empty_citation __pyx_string_tab[315]
#define __pyx_kp_u_empty_name __pyx_string_tab[316]
#define __pyx_kp_u_enable __pyx_string_tab[317]
#define __pyx_kp_u_error_code_d __pyx_string_tab[318]
#define __pyx_kp_u_expected __pyx_string_tab[319]
#define __pyx_kp_u_expecting_a_C_contiguous_array __pyx_string_tab[320]
#define __pyx_kp_u_expecting_tuple_list_or_dict __pyx_string_tab[321]
#define __pyx_kp_u_float_None __pyx_string_tab[322]
#define __pyx_kp_u_float_tuple_float_float __pyx_string_tab[323]
#define __pyx_kp_u_gc __pyx_string_tab[324]
#define __pyx_kp_u_get1dCoordinatecArrays_for_DMSta __pyx_string_tab[325]
#define __pyx_kp_u_getVecArray_for_DMStag_not_yet_i __pyx_string_tab[326]
#define __pyx_kp_u_ghosts_size __pyx_string_tab[327]
#define __pyx_kp_u_given __pyx_string_tab[328]
#define __pyx_kp_u_global_size __pyx_string_tab[329]
#define __pyx_kp_u_got __pyx_string_tab[330]
#define __pyx_kp_u_got_differing_extents_in_dimensi __pyx_string_tab[331]
#define __pyx_kp_u_incompatible_array_sizes __pyx_string_tab[332]
#define __pyx_kp_u_incompatible_array_sizes_ni __pyx_string_tab[333]
#define __pyx_kp_u_incompatible_array_sizes_nv __pyx_string_tab[334]
#define __pyx_kp_u_incompatible_array_sizes_nv_d __pyx_string_tab[335]
#define __pyx_kp_u_incompatible_with_vector_local __pyx_string_tab[336]
#define __pyx_kp_u_input_arrays_have_incompatible_s __pyx_string_tab[337]
#define __pyx_kp_u_int_None __pyx_string_tab[338]
#define __pyx_kp_u_int_tuple_int_int __pyx_string_tab[339]
#define __pyx_kp_u_is_not_compatible_with_DMDA_loc __pyx_string_tab[340]
#define __pyx_kp_u_isenabled __pyx_string_tab[341]
#define __pyx_kp_u_itemsize_0_for_cython_array __pyx_string_tab[342]
#define __pyx_kp_u_key __pyx_string_tab[343]
#define __pyx_kp_u_list_DM __pyx_string_tab[344]
#define __pyx_kp_u_list_DeviceContext __pyx_string_tab[345]
#define __pyx_kp_u_list_IS __pyx_string_tab[346]
#define __pyx_kp_u_list_KSP __pyx_string_tab[347]
#define __pyx_kp_u_list_LGMap __pyx_string_tab[348]
#define __pyx_kp_u_list_Vec __pyx_string_tab[349]
#define __pyx_kp_u_list_float __pyx_string_tab[350]
#define __pyx_kp_u_list_int __pyx_string_tab[351]
#define __pyx_kp_u_list_str __pyx_string_tab[352]
#define __pyx_kp_u_list_tuple_SNESMonitorFunction_t __pyx_string_tab[353]
#define __pyx_kp_u_list_tuple_TAOMonitorFunction_tu __pyx_string_tab[354]
#define __pyx_kp_u_list_tuple_TSMonitorFunction_tup __pyx_string_tab[355]
#define __pyx_kp_u_local_and_global_sizes_cannot_be __pyx_string_tab[356]
#define __pyx_kp_u_local_size __pyx_string_tab[357]
#define __pyx_kp_u_mpi4py_MPI __pyx_string_tab[358]
#define __pyx_kp_u_name_3 __pyx_string_tab[359]
#define __pyx_kp_u_nj __pyx_string_tab[360]
#define __pyx_kp_u_no __pyx_string_tab[361]
#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[362]
#define __pyx_kp_u_non_zero_values __pyx_string_tab[363]
#define __pyx_kp_u_not_divisible_by_block_size __pyx_string_tab[364]
#define __pyx_kp_u_null_communicator __pyx_string_tab[365]
#define __pyx_kp_u_number_of_dimensions __pyx_string_tab[366]
#define __pyx_kp_u_nv __pyx_string_tab[367]
#define __pyx_kp_u_object_2 __pyx_string_tab[368]
#define __pyx_kp_u_only_and __pyx_string_tab[369]
#define __pyx_kp_u_option_prefix_must_be_string __pyx_string_tab[370]
#define __pyx_kp_u_option_prefix_should_not_have_sp __pyx_string_tab[371]
#define __pyx_kp_u_option_prefix_should_not_start_w __pyx_string_tab[372]
#define __pyx_kp_u_ownership_range_size __pyx_string_tab[373]
#define __pyx_kp_u_petsc4py_PETSc_AO_pyx __pyx_string_tab[374]
#define __pyx_kp_u_petsc4py_PETSc_Comm_pyx __pyx_string_tab[375]
#define __pyx_kp_u_petsc4py_PETSc_DMComposite_pyx __pyx_string_tab[376]
#define __pyx_kp_u_petsc4py_PETSc_DMDA_pyx __pyx_string_tab[377]
#define __pyx_kp_u_petsc4py_PETSc_DMLabel_pyx __pyx_string_tab[378]
#define __pyx_kp_u_petsc4py_PETSc_DMPlex_pyx __pyx_string_tab[379]
#define __pyx_kp_u_petsc4py_PETSc_DMShell_pyx __pyx_string_tab[380]
#define __pyx_kp_u_petsc4py_PETSc_DMStag_pyx __pyx_string_tab[381]
#define __pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx __pyx_string_tab[382]
#define __pyx_kp_u_petsc4py_PETSc_DMUtils_pyx __pyx_string_tab[383]
#define __pyx_kp_u_petsc4py_PETSc_DM_pyx __pyx_string_tab[384]
#define __pyx_kp_u_petsc4py_PETSc_DS_pyx __pyx_string_tab[385]
#define __pyx_kp_u_petsc4py_PETSc_DT_pyx __pyx_string_tab[386]
#define __pyx_kp_u_petsc4py_PETSc_Device_pyx __pyx_string_tab[387]
#define __pyx_kp_u_petsc4py_PETSc_Error_pyx __pyx_string_tab[388]
#define __pyx_kp_u_petsc4py_PETSc_FE_pyx __pyx_string_tab[389]
#define __pyx_kp_u_petsc4py_PETSc_IS_pyx __pyx_string_tab[390]
#define __pyx_kp_u_petsc4py_PETSc_KSP_pyx __pyx_string_tab[391]
#define __pyx_kp_u_petsc4py_PETSc_Log_pyx __pyx_string_tab[392]
#define __pyx_kp_u_petsc4py_PETSc_MatPartitioning_p __pyx_string_tab[393]
#define __pyx_kp_u_petsc4py_PETSc_Mat_pyx __pyx_string_tab[394]
#define __pyx_kp_u_petsc4py_PETSc_Object_pyx __pyx_string_tab[395]
#define __pyx_kp_u_petsc4py_PETSc_Options_pyx __pyx_string_tab[396]
#define __pyx_kp_u_petsc4py_PETSc_PC_pyx __pyx_string_tab[397]
#define __pyx_kp_u_petsc4py_PETSc_PETSc_pyx __pyx_string_tab[398]
#define __pyx_kp_u_petsc4py_PETSc_Partitioner_pyx __pyx_string_tab[399]
#define __pyx_kp_u_petsc4py_PETSc_Random_pyx __pyx_string_tab[400]
#define __pyx_kp_u_petsc4py_PETSc_Regressor_pyx __pyx_string_tab[401]
#define __pyx_kp_u_petsc4py_PETSc_SF_pyx __pyx_string_tab[402]
#define __pyx_kp_u_petsc4py_PETSc_SNES_pyx __pyx_string_tab[403]
#define __pyx_kp_u_petsc4py_PETSc_Scatter_pyx __pyx_string_tab[404]
#define __pyx_kp_u_petsc4py_PETSc_Section_pyx __pyx_string_tab[405]
#define __pyx_kp_u_petsc4py_PETSc_Space_pyx __pyx_string_tab[406]
#define __pyx_kp_u_petsc4py_PETSc_Sys_pyx __pyx_string_tab[407]
#define __pyx_kp_u_petsc4py_PETSc_TAO_pyx __pyx_string_tab[408]
#define __pyx_kp_u_petsc4py_PETSc_TS_pyx __pyx_string_tab[409]
#define __pyx_kp_u_petsc4py_PETSc_Vec_pyx __pyx_string_tab[410]
#define __pyx_kp_u_petsc4py_PETSc_Viewer_pyx __pyx_string_tab[411]
#define __pyx_kp_u_petsc4py_PETSc_cyclicgc_pxi __pyx_string_tab[412]
#define __pyx_kp_u_petsc4py_PETSc_petscdmcomposite __pyx_string_tab[413]
#define __pyx_kp_u_petsc4py_PETSc_petscdmda_pxi __pyx_string_tab[414]
#define __pyx_kp_u_petsc4py_PETSc_petscis_pxi __pyx_string_tab[415]
#define __pyx_kp_u_petsc4py_PETSc_petscvec_pxi __pyx_string_tab[416]
#define __pyx_kp_u_prefix_2 __pyx_string_tab[417]
#define __pyx_kp_u_r_2 __pyx_string_tab[418]
#define __pyx_kp_u_readonly_attribute __pyx_string_tab[419]
#define __pyx_kp_u_row_indices_must_have_two_dimens __pyx_string_tab[420]
#define __pyx_kp_u_rows_requires_a_row_pointer_of __pyx_string_tab[421]
#define __pyx_kp_u_s __pyx_string_tab[422]
#define __pyx_kp_u_side_r_not_understood __pyx_string_tab[423]
#define __pyx_kp_u_size_I_is __pyx_string_tab[424]
#define __pyx_kp_u_size_J_is __pyx_string_tab[425]
#define __pyx_kp_u_size_V_is __pyx_string_tab[426]
#define __pyx_kp_u_size_array_is __pyx_string_tab[427]
#define __pyx_kp_u_size_d_nnz_is __pyx_string_tab[428]
#define __pyx_kp_u_size_o_nnz_is __pyx_string_tab[429]
#define __pyx_kp_u_sizes_array_should_have_d_entrie __pyx_string_tab[430]
#define __pyx_kp_u_str_None __pyx_string_tab[431]
#define __pyx_kp_u_str_Options_Object_None __pyx_string_tab[432]
#define __pyx_kp_u_strided_and_direct __pyx_string_tab[433]
#define __pyx_kp_u_strided_and_direct_or_indirect __pyx_string_tab[434]
#define __pyx_kp_u_strided_and_indirect __pyx_string_tab[435]
#define __pyx_kp_u_tuple_Any_None __pyx_string_tab[436]
#define __pyx_kp_u_tuple_ArrayInt __pyx_string_tab[437]
#define __pyx_kp_u_tuple_ArrayInt_ArrayInt __pyx_string_tab[438]
#define __pyx_kp_u_tuple_ArrayInt_ArrayInt_ArraySca __pyx_string_tab[439]
#define __pyx_kp_u_tuple_ArrayInt_ArrayScalar __pyx_string_tab[440]
#define __pyx_kp_u_tuple_ArrayInt_Section __pyx_string_tab[441]
#define __pyx_kp_u_tuple_ArrayReal_ArrayInt __pyx_string_tab[442]
#define __pyx_kp_u_tuple_ArrayReal_ArrayReal __pyx_string_tab[443]
#define __pyx_kp_u_tuple_ArrayReal_ArrayReal_ArrayR __pyx_string_tab[444]
#define __pyx_kp_u_tuple_ArrayReal_list_Vec __pyx_string_tab[445]
#define __pyx_kp_u_tuple_DMDA_Vec __pyx_string_tab[446]
#define __pyx_kp_u_tuple_DMPlex_SF __pyx_string_tab[447]
#define __pyx_kp_u_tuple_DM_BoundaryType __pyx_string_tab[448]
#define __pyx_kp_u_tuple_DM_BoundaryType_int_str_bo __pyx_string_tab[449]
#define __pyx_kp_u_tuple_DM_BoundaryType_int_str_bo_2 __pyx_string_tab[450]
#define __pyx_kp_u_tuple_IS_DM __pyx_string_tab[451]
#define __pyx_kp_u_tuple_IS_IS __pyx_string_tab[452]
#define __pyx_kp_u_tuple_LGMap_LGMap __pyx_string_tab[453]
#define __pyx_kp_u_tuple_LayoutSizeSpec_LayoutSizeS __pyx_string_tab[454]
#define __pyx_kp_u_tuple_Mat_Mat __pyx_string_tab[455]
#define __pyx_kp_u_tuple_Mat_Mat_Mat_Mat_Mat __pyx_string_tab[456]
#define __pyx_kp_u_tuple_Mat_Mat_SNESJacobianFuncti __pyx_string_tab[457]
#define __pyx_kp_u_tuple_Mat_Mat_TAOHessianFunction __pyx_string_tab[458]
#define __pyx_kp_u_tuple_Mat_Mat_TSI2Jacobian __pyx_string_tab[459]
#define __pyx_kp_u_tuple_Mat_Mat_TSIJacobian __pyx_string_tab[460]
#define __pyx_kp_u_tuple_Mat_Mat_TSRHSJacobian __pyx_string_tab[461]
#define __pyx_kp_u_tuple_Mat_Mat_Vec_Mat __pyx_string_tab[462]
#define __pyx_kp_u_tuple_Mat_Mat_tuple_TAOConstrain __pyx_string_tab[463]
#define __pyx_kp_u_tuple_Mat_Vec __pyx_string_tab[464]
#define __pyx_kp_u_tuple_Object_None __pyx_string_tab[465]
#define __pyx_kp_u_tuple_SF_SF __pyx_string_tab[466]
#define __pyx_kp_u_tuple_Scalar_Scalar __pyx_string_tab[467]
#define __pyx_kp_u_tuple_Scalar_float __pyx_string_tab[468]
#define __pyx_kp_u_tuple_Scatter_Scatter __pyx_string_tab[469]
#define __pyx_kp_u_tuple_Scatter_Vec __pyx_string_tab[470]
#define __pyx_kp_u_tuple_Section_IS __pyx_string_tab[471]
#define __pyx_kp_u_tuple_Section_Vec __pyx_string_tab[472]
#define __pyx_kp_u_tuple_Sequence_int __pyx_string_tab[473]
#define __pyx_kp_u_tuple_Sequence_int_None __pyx_string_tab[474]
#define __pyx_kp_u_tuple_StencilType_int __pyx_string_tab[475]
#define __pyx_kp_u_tuple_TAOConvergedFunction_tuple __pyx_string_tab[476]
#define __pyx_kp_u_tuple_TAOUpdateFunction_tuple_An __pyx_string_tab[477]
#define __pyx_kp_u_tuple_TSPostStepFunction_tuple_A __pyx_string_tab[478]
#define __pyx_kp_u_tuple_TSPreStepFunction_tuple_An __pyx_string_tab[479]
#define __pyx_kp_u_tuple_Vec_DM __pyx_string_tab[480]
#define __pyx_kp_u_tuple_Vec_TAOGradientFunction __pyx_string_tab[481]
#define __pyx_kp_u_tuple_Vec_TAOObjectiveGradientFu __pyx_string_tab[482]
#define __pyx_kp_u_tuple_Vec_TSI2Function __pyx_string_tab[483]
#define __pyx_kp_u_tuple_Vec_TSIFunction __pyx_string_tab[484]
#define __pyx_kp_u_tuple_Vec_TSRHSFunction __pyx_string_tab[485]
#define __pyx_kp_u_tuple_Vec_Vec __pyx_string_tab[486]
#define __pyx_kp_u_tuple_Vec_Vec_TAOVariableBoundsF __pyx_string_tab[487]
#define __pyx_kp_u_tuple_Vec_list_IS __pyx_string_tab[488]
#define __pyx_kp_u_tuple_Vec_tuple_TAOConstraintsFu __pyx_string_tab[489]
#define __pyx_kp_u_tuple_bool_TS __pyx_string_tab[490]
#define __pyx_kp_u_tuple_bool_bool __pyx_string_tab[491]
#define __pyx_kp_u_tuple_float_ArrayReal_ArrayReal __pyx_string_tab[492]
#define __pyx_kp_u_tuple_float_TAOTerm_Vec_Mat __pyx_string_tab[493]
#define __pyx_kp_u_tuple_float_float __pyx_string_tab[494]
#define __pyx_kp_u_tuple_float_float_float __pyx_string_tab[495]
#define __pyx_kp_u_tuple_float_float_float_float_fl __pyx_string_tab[496]
#define __pyx_kp_u_tuple_float_float_float_float_fl_2 __pyx_string_tab[497]
#define __pyx_kp_u_tuple_float_float_float_int __pyx_string_tab[498]
#define __pyx_kp_u_tuple_float_float_str __pyx_string_tab[499]
#define __pyx_kp_u_tuple_int __pyx_string_tab[500]
#define __pyx_kp_u_tuple_int_ArrayInt_ArrayInt __pyx_string_tab[501]
#define __pyx_kp_u_tuple_int_IS __pyx_string_tab[502]
#define __pyx_kp_u_tuple_int_None __pyx_string_tab[503]
#define __pyx_kp_u_tuple_int_float __pyx_string_tab[504]
#define __pyx_kp_u_tuple_int_float_float_float_floa __pyx_string_tab[505]
#define __pyx_kp_u_tuple_int_int __pyx_string_tab[506]
#define __pyx_kp_u_tuple_int_int_None __pyx_string_tab[507]
#define __pyx_kp_u_tuple_int_int_int __pyx_string_tab[508]
#define __pyx_kp_u_tuple_int_int_int_None __pyx_string_tab[509]
#define __pyx_kp_u_tuple_int_int_int_int __pyx_string_tab[510]
#define __pyx_kp_u_tuple_list_IS_list_IS __pyx_string_tab[511]
#define __pyx_kp_u_tuple_list_Vec_list_Vec __pyx_string_tab[512]
#define __pyx_kp_u_tuple_list_Vec_list_Vec_list_Vec __pyx_string_tab[513]
#define __pyx_kp_u_tuple_list_list_list __pyx_string_tab[514]
#define __pyx_kp_u_tuple_str __pyx_string_tab[515]
#define __pyx_kp_u_tuple_str_IS __pyx_string_tab[516]
#define __pyx_kp_u_tuple_str_Sequence_int __pyx_string_tab[517]
#define __pyx_kp_u_tuple_tuple_float_float __pyx_string_tab[518]
#define __pyx_kp_u_tuple_tuple_int_int __pyx_string_tab[519]
#define __pyx_kp_u_tuple_tuple_int_tuple_int __pyx_string_tab[520]
#define __pyx_kp_u_tuple_tuple_int_tuple_int_tuple __pyx_string_tab[521]
#define __pyx_kp_u_type_dtype __pyx_string_tab[522]
#define __pyx_kp_u_unable_to_allocate_array_data __pyx_string_tab[523]
#define __pyx_kp_u_unable_to_allocate_shape_and_str __pyx_string_tab[524]
#define __pyx_kp_u_unhandled_PetscDeviceContextJoin __pyx_string_tab[525]
#define __pyx_kp_u_unhandled_PetscDeviceType_d __pyx_string_tab[526]
#define __pyx_kp_u_unhandled_PetscStreamType_d __pyx_string_tab[527]
#define __pyx_kp_u_unknown_boundary_type_s __pyx_string_tab[528]
#define __pyx_kp_u_unknown_device_type_s __pyx_string_tab[529]
#define __pyx_kp_u_unknown_element_type_s __pyx_string_tab[530]
#define __pyx_kp_u_unknown_error_handler __pyx_string_tab[531]
#define __pyx_kp_u_unknown_interpolation_type_s __pyx_string_tab[532]
#define __pyx_kp_u_unknown_join_mode_s __pyx_string_tab[533]
#define __pyx_kp_u_unknown_options_s __pyx_string_tab[534]
#define __pyx_kp_u_unknown_scatter_mode_s __pyx_string_tab[535]
#define __pyx_kp_u_unknown_shift_type_s __pyx_string_tab[536]
#define __pyx_kp_u_unknown_stencil_location_type_s __pyx_string_tab[537]
#define __pyx_kp_u_unknown_stencil_type_s __pyx_string_tab[538]
#define __pyx_kp_u_unknown_stream_type_s __pyx_string_tab[539]
#define __pyx_kp_u_vals_shape __pyx_string_tab[540]
#define __pyx_kp_u_values_must_have_two_or_more_dim __pyx_string_tab[541]
#define __pyx_kp_u_vector_size __pyx_string_tab[542]
#define __pyx_kp_u_w_2 __pyx_string_tab[543]
#define __pyx_n_u_A __pyx_string_tab[544]
#define __pyx_n_u_A00 __pyx_string_tab[545]
#define __pyx_n_u_A01 __pyx_string_tab[546]
#define __pyx_n_u_A10 __pyx_string_tab[547]
#define __pyx_n_u_A11 __pyx_string_tab[548]
#define __pyx_n_u_A11_mat __pyx_string_tab[549]
#define __pyx_n_u_AB __pyx_string_tab[550]
#define __pyx_n_u_ABC __pyx_string_tab[551]
#define __pyx_n_u_ABt __pyx_string_tab[552]
#define __pyx_n_u_ADD __pyx_string_tab[553]
#define __pyx_n_u_ADDITIVE __pyx_string_tab[554]
#define __pyx_n_u_ADD_ALL __pyx_string_tab[555]
#define __pyx_n_u_ADD_ALL_VALUES __pyx_string_tab[556]
#define __pyx_n_u_ADD_BC __pyx_string_tab[557]
#define __pyx_n_u_ADD_BC_VALUES __pyx_string_tab[558]
#define __pyx_n_u_ADD_VALUES __pyx_string_tab[559]
#define __pyx_n_u_ADIOS __pyx_string_tab[560]
#define __pyx_n_u_ADMM __pyx_string_tab[561]
#define __pyx_n_u_ADVANCED __pyx_string_tab[562]
#define __pyx_n_u_AGG __pyx_string_tab[563]
#define __pyx_n_u_AGGREGATION __pyx_string_tab[564]
#define __pyx_n_u_AI __pyx_string_tab[565]
#define __pyx_n_u_AIJ __pyx_string_tab[566]
#define __pyx_n_u_AIJCRL __pyx_string_tab[567]
#define __pyx_n_u_AIJCUSPARSE __pyx_string_tab[568]
#define __pyx_n_u_AIJMKL __pyx_string_tab[569]
#define __pyx_n_u_AIJPERM __pyx_string_tab[570]
#define __pyx_n_u_AIJSELL __pyx_string_tab[571]
#define __pyx_n_u_AIJVIENNACL __pyx_string_tab[572]
#define __pyx_n_u_AJ __pyx_string_tab[573]
#define __pyx_n_u_ALL __pyx_string_tab[574]
#define __pyx_n_u_ALLGATHER __pyx_string_tab[575]
#define __pyx_n_u_ALLGATHERV __pyx_string_tab[576]
#define __pyx_n_u_ALLTOALL __pyx_string_tab[577]
#define __pyx_n_u_ALMM __pyx_string_tab[578]
#define __pyx_n_u_ALMMType __pyx_string_tab[579]
#define __pyx_n_u_ALPHA __pyx_string_tab[580]
#define __pyx_n_u_ALPHA2 __pyx_string_tab[581]
#define __pyx_n_u_ALWAYS __pyx_string_tab[582]
#define __pyx_n_u_AMD __pyx_string_tab[583]
#define __pyx_n_u_ANDERSON __pyx_string_tab[584]
#define __pyx_n_u_AO __pyx_string_tab[585]
#define __pyx_n_u_AOType __pyx_string_tab[586]
#define __pyx_n_u_AO_app2petsc __pyx_string_tab[587]
#define __pyx_n_u_AO_createBasic __pyx_string_tab[588]
#define __pyx_n_u_AO_createMapping __pyx_string_tab[589]
#define __pyx_n_u_AO_createMemoryScalable __pyx_string_tab[590]
#define __pyx_n_u_AO_destroy __pyx_string_tab[591]
#define __pyx_n_u_AO_getType __pyx_string_tab[592]
#define __pyx_n_u_AO_petsc2app __pyx_string_tab[593]
#define __pyx_n_u_AO_view __pyx_string_tab[594]
#define __pyx_n_u_APPEND __pyx_string_tab[595]
#define __pyx_n_u_APPEND_UPDATE __pyx_string_tab[596]
#define __pyx_n_u_APPLY_LOWER __pyx_string_tab[597]
#define __pyx_n_u_APPLY_UPPER __pyx_string_tab[598]
#define __pyx_n_u_ARKIMEX __pyx_string_tab[599]
#define __pyx_n_u_ARKIMEX1BEE __pyx_string_tab[600]
#define __pyx_n_u_ARKIMEX2C __pyx_string_tab[601]
#define __pyx_n_u_ARKIMEX2D __pyx_string_tab[602]
#define __pyx_n_u_ARKIMEX2E __pyx_string_tab[603]
#define __pyx_n_u_ARKIMEX3 __pyx_string_tab[604]
#define __pyx_n_u_ARKIMEX4 __pyx_string_tab[605]
#define __pyx_n_u_ARKIMEX5 __pyx_string_tab[606]
#define __pyx_n_u_ARKIMEXA2 __pyx_string_tab[607]
#define __pyx_n_u_ARKIMEXARS122 __pyx_string_tab[608]
#define __pyx_n_u_ARKIMEXARS443 __pyx_string_tab[609]
#define __pyx_n_u_ARKIMEXBPR3 __pyx_string_tab[610]
#define __pyx_n_u_ARKIMEXL2 __pyx_string_tab[611]
#define __pyx_n_u_ARKIMEXPRSSP2 __pyx_string_tab[612]
#define __pyx_n_u_ARKIMEXType __pyx_string_tab[613]
#define __pyx_n_u_ARMIJO __pyx_string_tab[614]
#define __pyx_n_u_ASCII __pyx_string_tab[615]
#define __pyx_n_u_ASCII_COMMON __pyx_string_tab[616]
#define __pyx_n_u_ASCII_CSV __pyx_string_tab[617]
#define __pyx_n_u_ASCII_DENSE __pyx_string_tab[618]
#define __pyx_n_u_ASCII_FACTOR_INFO __pyx_string_tab[619]
#define __pyx_n_u_ASCII_GLVIS __pyx_string_tab[620]
#define __pyx_n_u_ASCII_IMPL __pyx_string_tab[621]
#define __pyx_n_u_ASCII_INDEX __pyx_string_tab[622]
#define __pyx_n_u_ASCII_INFO __pyx_string_tab[623]
#define __pyx_n_u_ASCII_INFO_DETAIL __pyx_string_tab[624]
#define __pyx_n_u_ASCII_LATEX __pyx_string_tab[625]
#define __pyx_n_u_ASCII_MATHEMATICA __pyx_string_tab[626]
#define __pyx_n_u_ASCII_MATLAB __pyx_string_tab[627]
#define __pyx_n_u_ASCII_MATRIXMARKET __pyx_string_tab[628]
#define __pyx_n_u_ASCII_PCICE __pyx_string_tab[629]
#define __pyx_n_u_ASCII_PYTHON __pyx_string_tab[630]
#define __pyx_n_u_ASCII_SYMMODU __pyx_string_tab[631]
#define __pyx_n_u_ASCII_XML __pyx_string_tab[632]
#define __pyx_n_u_ASFLS __pyx_string_tab[633]
#define __pyx_n_u_ASILS __pyx_string_tab[634]
#define __pyx_n_u_ASM __pyx_string_tab[635]
#define __pyx_n_u_ASMType __pyx_string_tab[636]
#define __pyx_n_u_ASPIN __pyx_string_tab[637]
#define __pyx_n_u_AU __pyx_string_tab[638]
#define __pyx_n_u_AV __pyx_string_tab[639]
#define __pyx_n_u_AccessModeSpec __pyx_string_tab[640]
#define __pyx_n_u_Amat __pyx_string_tab[641]
#define __pyx_n_u_Any __pyx_string_tab[642]
#define __pyx_n_u_Ap00 __pyx_string_tab[643]
#define __pyx_n_u_ArrayBool __pyx_string_tab[644]
#define __pyx_n_u_ArrayComplex __pyx_string_tab[645]
#define __pyx_n_u_ArrayInt __pyx_string_tab[646]
#define __pyx_n_u_ArrayReal __pyx_string_tab[647]
#define __pyx_n_u_ArrayScalar __pyx_string_tab[648]
#define __pyx_n_u_AssemblyType __pyx_string_tab[649]
#define __pyx_n_u_AtB __pyx_string_tab[650]
#define __pyx_n_u_B __pyx_string_tab[651]
#define __pyx_n_u_BACK __pyx_string_tab[652]
#define __pyx_n_u_BACKWARD_SWEEP __pyx_string_tab[653]
#define __pyx_n_u_BACK_DOWN __pyx_string_tab[654]
#define __pyx_n_u_BACK_DOWN_LEFT __pyx_string_tab[655]
#define __pyx_n_u_BACK_DOWN_RIGHT __pyx_string_tab[656]
#define __pyx_n_u_BACK_LEFT __pyx_string_tab[657]
#define __pyx_n_u_BACK_RIGHT __pyx_string_tab[658]
#define __pyx_n_u_BACK_UP __pyx_string_tab[659]
#define __pyx_n_u_BACK_UP_LEFT __pyx_string_tab[660]
#define __pyx_n_u_BACK_UP_RIGHT __pyx_string_tab[661]
#define __pyx_n_u_BAIJ __pyx_string_tab[662]
#define __pyx_n_u_BAIJMKL __pyx_string_tab[663]
#define __pyx_n_u_BALANCED __pyx_string_tab[664]
#define __pyx_n_u_BAS __pyx_string_tab[665]
#define __pyx_n_u_BASIC __pyx_string_tab[666]
#define __pyx_n_u_BASICSYMPLECTIC __pyx_string_tab[667]
#define __pyx_n_u_BCG __pyx_string_tab[668]
#define __pyx_n_u_BCGS __pyx_string_tab[669]
#define __pyx_n_u_BCGSL __pyx_string_tab[670]
#define __pyx_n_u_BDDC __pyx_string_tab[671]
#define __pyx_n_u_BDF __pyx_string_tab[672]
#define __pyx_n_u_BDM __pyx_string_tab[673]
#define __pyx_n_u_BE __pyx_string_tab[674]
#define __pyx_n_u_BEULER __pyx_string_tab[675]
#define __pyx_n_u_BFBCG __pyx_string_tab[676]
#define __pyx_n_u_BGCRODR __pyx_string_tab[677]
#define __pyx_n_u_BGMRES __pyx_string_tab[678]
#define __pyx_n_u_BICG __pyx_string_tab[679]
#define __pyx_n_u_BINARY __pyx_string_tab[680]
#define __pyx_n_u_BINARY_MATLAB __pyx_string_tab[681]
#define __pyx_n_u_BIORTH22 __pyx_string_tab[682]
#define __pyx_n_u_BISECTION __pyx_string_tab[683]
#define __pyx_n_u_BJACOBI __pyx_string_tab[684]
#define __pyx_n_u_BLMVM __pyx_string_tab[685]
#define __pyx_n_u_BLOCK __pyx_string_tab[686]
#define __pyx_n_u_BLOCKMAT __pyx_string_tab[687]
#define __pyx_n_u_BMRM __pyx_string_tab[688]
#define __pyx_n_u_BNCG __pyx_string_tab[689]
#define __pyx_n_u_BNCGType __pyx_string_tab[690]
#define __pyx_n_u_BNLS __pyx_string_tab[691]
#define __pyx_n_u_BNTL __pyx_string_tab[692]
#define __pyx_n_u_BNTR __pyx_string_tab[693]
#define __pyx_n_u_BOX __pyx_string_tab[694]
#define __pyx_n_u_BQNKLS __pyx_string_tab[695]
#define __pyx_n_u_BQNKTL __pyx_string_tab[696]
#define __pyx_n_u_BQNKTR __pyx_string_tab[697]
#define __pyx_n_u_BQNLS __pyx_string_tab[698]
#define __pyx_n_u_BQPIP __pyx_string_tab[699]
#define __pyx_n_u_BRGN __pyx_string_tab[700]
#define __pyx_n_u_BT __pyx_string_tab[701]
#define __pyx_n_u_Barrier __pyx_string_tab[702]
#define __pyx_n_u_BoundaryType __pyx_string_tab[703]
#define __pyx_n_u_C __pyx_string_tab[704]
#define __pyx_n_u_CALLBACKS __pyx_string_tab[705]
#define __pyx_n_u_CG __pyx_string_tab[706]
#define __pyx_n_u_CGLS __pyx_string_tab[707]
#define __pyx_n_u_CGNE __pyx_string_tab[708]
#define __pyx_n_u_CGS __pyx_string_tab[709]
#define __pyx_n_u_CHACO __pyx_string_tab[710]
#define __pyx_n_u_CHEBYSHEV __pyx_string_tab[711]
#define __pyx_n_u_CHOLESKY __pyx_string_tab[712]
#define __pyx_n_u_CHOLMOD __pyx_string_tab[713]
#define __pyx_n_u_CHOWILUVIENNACL __pyx_string_tab[714]
#define __pyx_n_u_CLASSIC __pyx_string_tab[715]
#define __pyx_n_u_CLASSICAL __pyx_string_tab[716]
#define __pyx_n_u_CN __pyx_string_tab[717]
#define __pyx_n_u_COLLECT_BASIC __pyx_string_tab[718]
#define __pyx_n_u_COLLECT_DMDABOUNDINGBOX __pyx_string_tab[719]
#define __pyx_n_u_COLLECT_GENERAL __pyx_string_tab[720]
#define __pyx_n_u_COLLECT_USER __pyx_string_tab[721]
#define __pyx_n_u_COMM_NULL __pyx_string_tab[722]
#define __pyx_n_u_COMM_SELF __pyx_string_tab[723]
#define __pyx_n_u_COMM_WORLD __pyx_string_tab[724]
#define __pyx_n_u_COMPOSITE __pyx_string_tab[725]
#define __pyx_n_u_CONSTANTDIAGONAL __pyx_string_tab[726]
#define __pyx_n_u_CONTINUE_ITERATING __pyx_string_tab[727]
#define __pyx_n_u_CONTINUE_SEARCH __pyx_string_tab[728]
#define __pyx_n_u_CONVERGED_ATOL __pyx_string_tab[729]
#define __pyx_n_u_CONVERGED_ATOL_NORMAL_EQUATIONS __pyx_string_tab[730]
#define __pyx_n_u_CONVERGED_EVENT __pyx_string_tab[731]
#define __pyx_n_u_CONVERGED_FNORM_ABS __pyx_string_tab[732]
#define __pyx_n_u_CONVERGED_FNORM_RELATIVE __pyx_string_tab[733]
#define __pyx_n_u_CONVERGED_GATOL __pyx_string_tab[734]
#define __pyx_n_u_CONVERGED_GRTOL __pyx_string_tab[735]
#define __pyx_n_u_CONVERGED_GTTOL __pyx_string_tab[736]
#define __pyx_n_u_CONVERGED_HAPPY_BREAKDOWN __pyx_string_tab[737]
#define __pyx_n_u_CONVERGED_ITERATING __pyx_string_tab[738]
#define __pyx_n_u_CONVERGED_ITS __pyx_string_tab[739]
#define __pyx_n_u_CONVERGED_MINF __pyx_string_tab[740]
#define __pyx_n_u_CONVERGED_NEG_CURVE __pyx_string_tab[741]
#define __pyx_n_u_CONVERGED_RTOL __pyx_string_tab[742]
#define __pyx_n_u_CONVERGED_RTOL_NORMAL_EQUATIONS __pyx_string_tab[743]
#define __pyx_n_u_CONVERGED_SNORM_RELATIVE __pyx_string_tab[744]
#define __pyx_n_u_CONVERGED_STEPTOL __pyx_string_tab[745]
#define __pyx_n_u_CONVERGED_STEP_LENGTH __pyx_string_tab[746]
#define __pyx_n_u_CONVERGED_TIME __pyx_string_tab[747]
#define __pyx_n_u_CONVERGED_USER __pyx_string_tab[748]
#define __pyx_n_u_COPY_VALUES __pyx_string_tab[749]
#define __pyx_n_u_CP __pyx_string_tab[750]
#define __pyx_n_u_CR __pyx_string_tab[751]
#define __pyx_n_u_CRANK_NICOLSON __pyx_string_tab[752]
#define __pyx_n_u_CSRIndicesSpec __pyx_string_tab[753]
#define __pyx_n_u_CUDA __pyx_string_tab[754]
#define __pyx_n_u_CURRENT __pyx_string_tab[755]
#define __pyx_n_u_CUSPARSE __pyx_string_tab[756]
#define __pyx_n_u_CellDM __pyx_string_tab[757]
#define __pyx_n_u_CellDM_create __pyx_string_tab[758]
#define __pyx_n_u_CellDM_destroy __pyx_string_tab[759]
#define __pyx_n_u_CellDM_getBlockSize __pyx_string_tab[760]
#define __pyx_n_u_CellDM_getCellID __pyx_string_tab[761]
#define __pyx_n_u_CellDM_getCoordinateFields __pyx_string_tab[762]
#define __pyx_n_u_CellDM_getDM __pyx_string_tab[763]
#define __pyx_n_u_CellDM_getFields __pyx_string_tab[764]
#define __pyx_n_u_CellDM_view __pyx_string_tab[765]
#define __pyx_n_u_Class __pyx_string_tab[766]
#define __pyx_n_u_Clone __pyx_string_tab[767]
#define __pyx_n_u_CollectType __pyx_string_tab[768]
#define __pyx_n_u_Comm __pyx_string_tab[769]
#define __pyx_n_u_Comm_barrier __pyx_string_tab[770]
#define __pyx_n_u_Comm_destroy __pyx_string_tab[771]
#define __pyx_n_u_Comm_duplicate __pyx_string_tab[772]
#define __pyx_n_u_Comm_getRank __pyx_string_tab[773]
#define __pyx_n_u_Comm_getSize __pyx_string_tab[774]
#define __pyx_n_u_Comm_tompi4py __pyx_string_tab[775]
#define __pyx_n_u_ComplexType __pyx_string_tab[776]
#define __pyx_n_u_CompositeType __pyx_string_tab[777]
#define __pyx_n_u_ConvergedReason __pyx_string_tab[778]
#define __pyx_n_u_Cvec __pyx_string_tab[779]
#define __pyx_n_u_D __pyx_string_tab[780]
#define __pyx_n_u_DA __pyx_string_tab[781]
#define __pyx_n_u_DAE_IMPLICIT_INDEX1 __pyx_string_tab[782]
#define __pyx_n_u_DAE_IMPLICIT_INDEX2 __pyx_string_tab[783]
#define __pyx_n_u_DAE_IMPLICIT_INDEX3 __pyx_string_tab[784]
#define __pyx_n_u_DAE_IMPLICIT_INDEXHI __pyx_string_tab[785]
#define __pyx_n_u_DAE_SEMI_EXPLICIT_INDEX1 __pyx_string_tab[786]
#define __pyx_n_u_DAE_SEMI_EXPLICIT_INDEX2 __pyx_string_tab[787]
#define __pyx_n_u_DAE_SEMI_EXPLICIT_INDEX3 __pyx_string_tab[788]
#define __pyx_n_u_DAE_SEMI_EXPLICIT_INDEXHI __pyx_string_tab[789]
#define __pyx_n_u_DB16 __pyx_string_tab[790]
#define __pyx_n_u_DB2 __pyx_string_tab[791]
#define __pyx_n_u_DB4 __pyx_string_tab[792]
#define __pyx_n_u_DB8 __pyx_string_tab[793]
#define __pyx_n_u_DECIDE __pyx_string_tab[794]
#define __pyx_n_u_DEFAULT __pyx_string_tab[795]
#define __pyx_n_u_DEFAULT_WITH_BARRIER __pyx_string_tab[796]
#define __pyx_n_u_DEFLATED __pyx_string_tab[797]
#define __pyx_n_u_DEFLATION __pyx_string_tab[798]
#define __pyx_n_u_DENSE __pyx_string_tab[799]
#define __pyx_n_u_DENSECUDA __pyx_string_tab[800]
#define __pyx_n_u_DENSEHIP __pyx_string_tab[801]
#define __pyx_n_u_DESTROY __pyx_string_tab[802]
#define __pyx_n_u_DETERMINE __pyx_string_tab[803]
#define __pyx_n_u_DGMRES __pyx_string_tab[804]
#define __pyx_n_u_DIAG __pyx_string_tab[805]
#define __pyx_n_u_DIAGONAL __pyx_string_tab[806]
#define __pyx_n_u_DIFFERENT __pyx_string_tab[807]
#define __pyx_n_u_DIFFERENT_NONZERO_PATTERN __pyx_string_tab[808]
#define __pyx_n_u_DIFFERENT_NZ __pyx_string_tab[809]
#define __pyx_n_u_DIRK __pyx_string_tab[810]
#define __pyx_n_u_DIRK657A __pyx_string_tab[811]
#define __pyx_n_u_DIRK658A __pyx_string_tab[812]
#define __pyx_n_u_DIRK7510SAL __pyx_string_tab[813]
#define __pyx_n_u_DIRK759A __pyx_string_tab[814]
#define __pyx_n_u_DIRK8614A __pyx_string_tab[815]
#define __pyx_n_u_DIRK8616SAL __pyx_string_tab[816]
#define __pyx_n_u_DIRKES122SAL __pyx_string_tab[817]
#define __pyx_n_u_DIRKES213SAL __pyx_string_tab[818]
#define __pyx_n_u_DIRKES324SAL __pyx_string_tab[819]
#define __pyx_n_u_DIRKES325SAL __pyx_string_tab[820]
#define __pyx_n_u_DIRKES648SA __pyx_string_tab[821]
#define __pyx_n_u_DIRKES7510SA __pyx_string_tab[822]
#define __pyx_n_u_DIRKES8516SAL __pyx_string_tab[823]
#define __pyx_n_u_DIRKS212 __pyx_string_tab[824]
#define __pyx_n_u_DIRKS659A __pyx_string_tab[825]
#define __pyx_n_u_DIRKS7511SAL __pyx_string_tab[826]
#define __pyx_n_u_DIRKType __pyx_string_tab[827]
#define __pyx_n_u_DISCGRAD __pyx_string_tab[828]
#define __pyx_n_u_DIVERGED_BREAKDOWN __pyx_string_tab[829]
#define __pyx_n_u_DIVERGED_BREAKDOWN_BICG __pyx_string_tab[830]
#define __pyx_n_u_DIVERGED_DTOL __pyx_string_tab[831]
#define __pyx_n_u_DIVERGED_FUNCTION_COUNT __pyx_string_tab[832]
#define __pyx_n_u_DIVERGED_FUNCTION_DOMAIN __pyx_string_tab[833]
#define __pyx_n_u_DIVERGED_FUNCTION_NANORINF __pyx_string_tab[834]
#define __pyx_n_u_DIVERGED_INDEFINITE_MAT __pyx_string_tab[835]
#define __pyx_n_u_DIVERGED_INDEFINITE_PC __pyx_string_tab[836]
#define __pyx_n_u_DIVERGED_INNER __pyx_string_tab[837]
#define __pyx_n_u_DIVERGED_JACOBIAN_DOMAIN __pyx_string_tab[838]
#define __pyx_n_u_DIVERGED_LINEAR_SOLVE __pyx_string_tab[839]
#define __pyx_n_u_DIVERGED_LINE_SEARCH __pyx_string_tab[840]
#define __pyx_n_u_DIVERGED_LOCAL_MIN __pyx_string_tab[841]
#define __pyx_n_u_DIVERGED_LS_FAILURE __pyx_string_tab[842]
#define __pyx_n_u_DIVERGED_MAXFCN __pyx_string_tab[843]
#define __pyx_n_u_DIVERGED_MAXITS __pyx_string_tab[844]
#define __pyx_n_u_DIVERGED_MAX_IT __pyx_string_tab[845]
#define __pyx_n_u_DIVERGED_NAN __pyx_string_tab[846]
#define __pyx_n_u_DIVERGED_NANORINF __pyx_string_tab[847]
#define __pyx_n_u_DIVERGED_NONLINEAR_SOLVE __pyx_string_tab[848]
#define __pyx_n_u_DIVERGED_NONSYMMETRIC __pyx_string_tab[849]
#define __pyx_n_u_DIVERGED_NULL __pyx_string_tab[850]
#define __pyx_n_u_DIVERGED_OBJECTIVE_DOMAIN __pyx_string_tab[851]
#define __pyx_n_u_DIVERGED_OBJECTIVE_NANORINF __pyx_string_tab[852]
#define __pyx_n_u_DIVERGED_PCSETUP_FAILED __pyx_string_tab[853]
#define __pyx_n_u_DIVERGED_STEP_REJECTED __pyx_string_tab[854]
#define __pyx_n_u_DIVERGED_TR_DELTA __pyx_string_tab[855]
#define __pyx_n_u_DIVERGED_TR_REDUCTION __pyx_string_tab[856]
#define __pyx_n_u_DIVERGED_USER __pyx_string_tab[857]
#define __pyx_n_u_DK __pyx_string_tab[858]
#define __pyx_n_u_DM __pyx_string_tab[859]
#define __pyx_n_u_DMActive __pyx_string_tab[860]
#define __pyx_n_u_DMBoundaryType __pyx_string_tab[861]
#define __pyx_n_u_DMCoarsenHookFunction __pyx_string_tab[862]
#define __pyx_n_u_DMComposite __pyx_string_tab[863]
#define __pyx_n_u_DMComposite_access __pyx_string_tab[864]
#define __pyx_n_u_DMComposite_access___enter __pyx_string_tab[865]
#define __pyx_n_u_DMComposite_access___exit __pyx_string_tab[866]
#define __pyx_n_u_DMComposite_addDM __pyx_string_tab[867]
#define __pyx_n_u_DMComposite_create __pyx_string_tab[868]
#define __pyx_n_u_DMComposite_gather __pyx_string_tab[869]
#define __pyx_n_u_DMComposite_getAccess __pyx_string_tab[870]
#define __pyx_n_u_DMComposite_getEntries __pyx_string_tab[871]
#define __pyx_n_u_DMComposite_getGlobalISs __pyx_string_tab[872]
#define __pyx_n_u_DMComposite_getLGMaps __pyx_string_tab[873]
#define __pyx_n_u_DMComposite_getLocalISs __pyx_string_tab[874]
#define __pyx_n_u_DMComposite_getNumber __pyx_string_tab[875]
#define __pyx_n_u_DMComposite_scatter __pyx_string_tab[876]
#define __pyx_n_u_DMDA __pyx_string_tab[877]
#define __pyx_n_u_DMDAElementType __pyx_string_tab[878]
#define __pyx_n_u_DMDAInterpolationType __pyx_string_tab[879]
#define __pyx_n_u_DMDAStencilType __pyx_string_tab[880]
#define __pyx_n_u_DMDA_Vec_array __pyx_string_tab[881]
#define __pyx_n_u_DMDA_Vec_array___enter __pyx_string_tab[882]
#define __pyx_n_u_DMDA_Vec_array___exit __pyx_string_tab[883]
#define __pyx_n_u_DMDA_create __pyx_string_tab[884]
#define __pyx_n_u_DMDA_createNaturalVec __pyx_string_tab[885]
#define __pyx_n_u_DMDA_duplicate __pyx_string_tab[886]
#define __pyx_n_u_DMDA_getAO __pyx_string_tab[887]
#define __pyx_n_u_DMDA_getBoundaryType __pyx_string_tab[888]
#define __pyx_n_u_DMDA_getCoordinateName __pyx_string_tab[889]
#define __pyx_n_u_DMDA_getCorners __pyx_string_tab[890]
#define __pyx_n_u_DMDA_getDim __pyx_string_tab[891]
#define __pyx_n_u_DMDA_getDof __pyx_string_tab[892]
#define __pyx_n_u_DMDA_getElementType __pyx_string_tab[893]
#define __pyx_n_u_DMDA_getElements __pyx_string_tab[894]
#define __pyx_n_u_DMDA_getFieldName __pyx_string_tab[895]
#define __pyx_n_u_DMDA_getGhostCorners __pyx_string_tab[896]
#define __pyx_n_u_DMDA_getGhostRanges __pyx_string_tab[897]
#define __pyx_n_u_DMDA_getInterpolationType __pyx_string_tab[898]
#define __pyx_n_u_DMDA_getOwnershipRanges __pyx_string_tab[899]
#define __pyx_n_u_DMDA_getProcSizes __pyx_string_tab[900]
#define __pyx_n_u_DMDA_getRanges __pyx_string_tab[901]
#define __pyx_n_u_DMDA_getRefinementFactor __pyx_string_tab[902]
#define __pyx_n_u_DMDA_getScatter __pyx_string_tab[903]
#define __pyx_n_u_DMDA_getSizes __pyx_string_tab[904]
#define __pyx_n_u_DMDA_getStencil __pyx_string_tab[905]
#define __pyx_n_u_DMDA_getStencilType __pyx_string_tab[906]
#define __pyx_n_u_DMDA_getStencilWidth __pyx_string_tab[907]
#define __pyx_n_u_DMDA_getVecArray __pyx_string_tab[908]
#define __pyx_n_u_DMDA_globalToNatural __pyx_string_tab[909]
#define __pyx_n_u_DMDA_naturalToGlobal __pyx_string_tab[910]
#define __pyx_n_u_DMDA_setBoundaryType __pyx_string_tab[911]
#define __pyx_n_u_DMDA_setCoordinateName __pyx_string_tab[912]
#define __pyx_n_u_DMDA_setDim __pyx_string_tab[913]
#define __pyx_n_u_DMDA_setDof __pyx_string_tab[914]
#define __pyx_n_u_DMDA_setElementType __pyx_string_tab[915]
#define __pyx_n_u_DMDA_setFieldName __pyx_string_tab[916]
#define __pyx_n_u_DMDA_setInterpolationType __pyx_string_tab[917]
#define __pyx_n_u_DMDA_setProcSizes __pyx_string_tab[918]
#define __pyx_n_u_DMDA_setRefinementFactor __pyx_string_tab[919]
#define __pyx_n_u_DMDA_setSizes __pyx_string_tab[920]
#define __pyx_n_u_DMDA_setStencil __pyx_string_tab[921]
#define __pyx_n_u_DMDA_setStencilType __pyx_string_tab[922]
#define __pyx_n_u_DMDA_setStencilWidth __pyx_string_tab[923]
#define __pyx_n_u_DMDA_setUniformCoordinates __pyx_string_tab[924]
#define __pyx_n_u_DMInterpolation __pyx_string_tab[925]
#define __pyx_n_u_DMInterpolation_create __pyx_string_tab[926]
#define __pyx_n_u_DMInterpolation_destroy __pyx_string_tab[927]
#define __pyx_n_u_DMInterpolation_evaluate __pyx_string_tab[928]
#define __pyx_n_u_DMInterpolation_getCoordinates __pyx_string_tab[929]
#define __pyx_n_u_DMInterpolation_getDim __pyx_string_tab[930]
#define __pyx_n_u_DMInterpolation_getDof __pyx_string_tab[931]
#define __pyx_n_u_DMInterpolation_getVector __pyx_string_tab[932]
#define __pyx_n_u_DMInterpolation_restoreVector __pyx_string_tab[933]
#define __pyx_n_u_DMInterpolation_setDim __pyx_string_tab[934]
#define __pyx_n_u_DMInterpolation_setDof __pyx_string_tab[935]
#define __pyx_n_u_DMInterpolation_setUp __pyx_string_tab[936]
#define __pyx_n_u_DMLabel __pyx_string_tab[937]
#define __pyx_n_u_DMLabel_addStrata __pyx_string_tab[938]
#define __pyx_n_u_DMLabel_addStrataIS __pyx_string_tab[939]
#define __pyx_n_u_DMLabel_addStratum __pyx_string_tab[940]
#define __pyx_n_u_DMLabel_clearStratum __pyx_string_tab[941]
#define __pyx_n_u_DMLabel_clearValue __pyx_string_tab[942]
#define __pyx_n_u_DMLabel_computeIndex __pyx_string_tab[943]
#define __pyx_n_u_DMLabel_convertToSection __pyx_string_tab[944]
#define __pyx_n_u_DMLabel_create __pyx_string_tab[945]
#define __pyx_n_u_DMLabel_createIndex __pyx_string_tab[946]
#define __pyx_n_u_DMLabel_destroy __pyx_string_tab[947]
#define __pyx_n_u_DMLabel_destroyIndex __pyx_string_tab[948]
#define __pyx_n_u_DMLabel_distribute __pyx_string_tab[949]
#define __pyx_n_u_DMLabel_duplicate __pyx_string_tab[950]
#define __pyx_n_u_DMLabel_filter __pyx_string_tab[951]
#define __pyx_n_u_DMLabel_gather __pyx_string_tab[952]
#define __pyx_n_u_DMLabel_getBounds __pyx_string_tab[953]
#define __pyx_n_u_DMLabel_getDefaultValue __pyx_string_tab[954]
#define __pyx_n_u_DMLabel_getNonEmptyStratumValues __pyx_string_tab[955]
#define __pyx_n_u_DMLabel_getNumValues __pyx_string_tab[956]
#define __pyx_n_u_DMLabel_getStratumIS __pyx_string_tab[957]
#define __pyx_n_u_DMLabel_getStratumSize __pyx_string_tab[958]
#define __pyx_n_u_DMLabel_getValue __pyx_string_tab[959]
#define __pyx_n_u_DMLabel_getValueIS __pyx_string_tab[960]
#define __pyx_n_u_DMLabel_hasPoint __pyx_string_tab[961]
#define __pyx_n_u_DMLabel_hasStratum __pyx_string_tab[962]
#define __pyx_n_u_DMLabel_hasValue __pyx_string_tab[963]
#define __pyx_n_u_DMLabel_insertIS __pyx_string_tab[964]
#define __pyx_n_u_DMLabel_permute __pyx_string_tab[965]
#define __pyx_n_u_DMLabel_reset __pyx_string_tab[966]
#define __pyx_n_u_DMLabel_setDefaultValue __pyx_string_tab[967]
#define __pyx_n_u_DMLabel_setStratumIS __pyx_string_tab[968]
#define __pyx_n_u_DMLabel_setValue __pyx_string_tab[969]
#define __pyx_n_u_DMLabel_stratumHasPoint __pyx_string_tab[970]
#define __pyx_n_u_DMLabel_view __pyx_string_tab[971]
#define __pyx_n_u_DMPlex __pyx_string_tab[972]
#define __pyx_n_u_DMPlexTransform __pyx_string_tab[973]
#define __pyx_n_u_DMPlexTransformType __pyx_string_tab[974]
#define __pyx_n_u_DMPlexTransform_apply __pyx_string_tab[975]
#define __pyx_n_u_DMPlexTransform_create __pyx_string_tab[976]
#define __pyx_n_u_DMPlexTransform_destroy __pyx_string_tab[977]
#define __pyx_n_u_DMPlexTransform_getType __pyx_string_tab[978]
#define __pyx_n_u_DMPlexTransform_setDM __pyx_string_tab[979]
#define __pyx_n_u_DMPlexTransform_setFromOptions __pyx_string_tab[980]
#define __pyx_n_u_DMPlexTransform_setType __pyx_string_tab[981]
#define __pyx_n_u_DMPlexTransform_setUp __pyx_string_tab[982]
#define __pyx_n_u_DMPlexTransform_view __pyx_string_tab[983]
#define __pyx_n_u_DMPlex_computeCellGeometryFVM __pyx_string_tab[984]
#define __pyx_n_u_DMPlex_computeGradientClementInt __pyx_string_tab[985]
#define __pyx_n_u_DMPlex_constructGhostCells __pyx_string_tab[986]
#define __pyx_n_u_DMPlex_coordinatesLoad __pyx_string_tab[987]
#define __pyx_n_u_DMPlex_coordinatesView __pyx_string_tab[988]
#define __pyx_n_u_DMPlex_create __pyx_string_tab[989]
#define __pyx_n_u_DMPlex_createBoxMesh __pyx_string_tab[990]
#define __pyx_n_u_DMPlex_createBoxSurfaceMesh __pyx_string_tab[991]
#define __pyx_n_u_DMPlex_createCGNS __pyx_string_tab[992]
#define __pyx_n_u_DMPlex_createCGNSFromFile __pyx_string_tab[993]
#define __pyx_n_u_DMPlex_createClosureIndex __pyx_string_tab[994]
#define __pyx_n_u_DMPlex_createCoarsePointIS __pyx_string_tab[995]
#define __pyx_n_u_DMPlex_createCohesiveSubmesh __pyx_string_tab[996]
#define __pyx_n_u_DMPlex_createColoring __pyx_string_tab[997]
#define __pyx_n_u_DMPlex_createCoordinateSpace __pyx_string_tab[998]
#define __pyx_n_u_DMPlex_createExodus __pyx_string_tab[999]
#define __pyx_n_u_DMPlex_createExodusFromFile __pyx_string_tab[1000]
#define __pyx_n_u_DMPlex_createFromCellList __pyx_string_tab[1001]
#define __pyx_n_u_DMPlex_createFromFile __pyx_string_tab[1002]
#define __pyx_n_u_DMPlex_createGlobalToNaturalSF __pyx_string_tab[1003]
#define __pyx_n_u_DMPlex_createGmsh __pyx_string_tab[1004]
#define __pyx_n_u_DMPlex_createNaturalVec __pyx_string_tab[1005]
#define __pyx_n_u_DMPlex_createPointNumbering __pyx_string_tab[1006]
#define __pyx_n_u_DMPlex_createSection __pyx_string_tab[1007]
#define __pyx_n_u_DMPlex_distribute __pyx_string_tab[1008]
#define __pyx_n_u_DMPlex_distributeField __pyx_string_tab[1009]
#define __pyx_n_u_DMPlex_distributeGetDefault __pyx_string_tab[1010]
#define __pyx_n_u_DMPlex_distributeOverlap __pyx_string_tab[1011]
#define __pyx_n_u_DMPlex_distributeSetDefault __pyx_string_tab[1012]
#define __pyx_n_u_DMPlex_distributionGetName __pyx_string_tab[1013]
#define __pyx_n_u_DMPlex_distributionSetName __pyx_string_tab[1014]
#define __pyx_n_u_DMPlex_filter __pyx_string_tab[1015]
#define __pyx_n_u_DMPlex_generate __pyx_string_tab[1016]
#define __pyx_n_u_DMPlex_getAdjacency __pyx_string_tab[1017]
#define __pyx_n_u_DMPlex_getAdjacencyUseAnchors __pyx_string_tab[1018]
#define __pyx_n_u_DMPlex_getCellNumbering __pyx_string_tab[1019]
#define __pyx_n_u_DMPlex_getCellType __pyx_string_tab[1020]
#define __pyx_n_u_DMPlex_getCellTypeLabel __pyx_string_tab[1021]
#define __pyx_n_u_DMPlex_getChart __pyx_string_tab[1022]
#define __pyx_n_u_DMPlex_getCone __pyx_string_tab[1023]
#define __pyx_n_u_DMPlex_getConeOrientation __pyx_string_tab[1024]
#define __pyx_n_u_DMPlex_getConeSize __pyx_string_tab[1025]
#define __pyx_n_u_DMPlex_getDepth __pyx_string_tab[1026]
#define __pyx_n_u_DMPlex_getDepthStratum __pyx_string_tab[1027]
#define __pyx_n_u_DMPlex_getFullJoin __pyx_string_tab[1028]
#define __pyx_n_u_DMPlex_getHeightStratum __pyx_string_tab[1029]
#define __pyx_n_u_DMPlex_getJoin __pyx_string_tab[1030]
#define __pyx_n_u_DMPlex_getMaxSizes __pyx_string_tab[1031]
#define __pyx_n_u_DMPlex_getMeet __pyx_string_tab[1032]
#define __pyx_n_u_DMPlex_getMigrationSF __pyx_string_tab[1033]
#define __pyx_n_u_DMPlex_getMinRadius __pyx_string_tab[1034]
#define __pyx_n_u_DMPlex_getOrdering __pyx_string_tab[1035]
#define __pyx_n_u_DMPlex_getPartitioner __pyx_string_tab[1036]
#define __pyx_n_u_DMPlex_getPointDepth __pyx_string_tab[1037]
#define __pyx_n_u_DMPlex_getPointGlobal __pyx_string_tab[1038]
#define __pyx_n_u_DMPlex_getPointGlobalField __pyx_string_tab[1039]
#define __pyx_n_u_DMPlex_getPointHeight __pyx_string_tab[1040]
#define __pyx_n_u_DMPlex_getPointLocal __pyx_string_tab[1041]
#define __pyx_n_u_DMPlex_getPointLocalField __pyx_string_tab[1042]
#define __pyx_n_u_DMPlex_getRefinementLimit __pyx_string_tab[1043]
#define __pyx_n_u_DMPlex_getRefinementUniform __pyx_string_tab[1044]
#define __pyx_n_u_DMPlex_getSubpointIS __pyx_string_tab[1045]
#define __pyx_n_u_DMPlex_getSubpointMap __pyx_string_tab[1046]
#define __pyx_n_u_DMPlex_getSupport __pyx_string_tab[1047]
#define __pyx_n_u_DMPlex_getSupportSize __pyx_string_tab[1048]
#define __pyx_n_u_DMPlex_getTransitiveClosure __pyx_string_tab[1049]
#define __pyx_n_u_DMPlex_getVecClosure __pyx_string_tab[1050]
#define __pyx_n_u_DMPlex_getVertexNumbering __pyx_string_tab[1051]
#define __pyx_n_u_DMPlex_globalToNaturalBegin __pyx_string_tab[1052]
#define __pyx_n_u_DMPlex_globalToNaturalEnd __pyx_string_tab[1053]
#define __pyx_n_u_DMPlex_globalVectorLoad __pyx_string_tab[1054]
#define __pyx_n_u_DMPlex_globalVectorView __pyx_string_tab[1055]
#define __pyx_n_u_DMPlex_insertCone __pyx_string_tab[1056]
#define __pyx_n_u_DMPlex_insertConeOrientation __pyx_string_tab[1057]
#define __pyx_n_u_DMPlex_interpolate __pyx_string_tab[1058]
#define __pyx_n_u_DMPlex_isDistributed __pyx_string_tab[1059]
#define __pyx_n_u_DMPlex_isSimplex __pyx_string_tab[1060]
#define __pyx_n_u_DMPlex_labelCohesiveComplete __pyx_string_tab[1061]
#define __pyx_n_u_DMPlex_labelComplete __pyx_string_tab[1062]
#define __pyx_n_u_DMPlex_labelsLoad __pyx_string_tab[1063]
#define __pyx_n_u_DMPlex_labelsView __pyx_string_tab[1064]
#define __pyx_n_u_DMPlex_localVectorLoad __pyx_string_tab[1065]
#define __pyx_n_u_DMPlex_localVectorView __pyx_string_tab[1066]
#define __pyx_n_u_DMPlex_markBoundaryFaces __pyx_string_tab[1067]
#define __pyx_n_u_DMPlex_metricAverage2 __pyx_string_tab[1068]
#define __pyx_n_u_DMPlex_metricAverage3 __pyx_string_tab[1069]
#define __pyx_n_u_DMPlex_metricCreate __pyx_string_tab[1070]
#define __pyx_n_u_DMPlex_metricCreateIsotropic __pyx_string_tab[1071]
#define __pyx_n_u_DMPlex_metricCreateUniform __pyx_string_tab[1072]
#define __pyx_n_u_DMPlex_metricDeterminantCreate __pyx_string_tab[1073]
#define __pyx_n_u_DMPlex_metricEnforceSPD __pyx_string_tab[1074]
#define __pyx_n_u_DMPlex_metricGetGradationFactor __pyx_string_tab[1075]
#define __pyx_n_u_DMPlex_metricGetHausdorffNumber __pyx_string_tab[1076]
#define __pyx_n_u_DMPlex_metricGetMaximumAnisotrop __pyx_string_tab[1077]
#define __pyx_n_u_DMPlex_metricGetMaximumMagnitude __pyx_string_tab[1078]
#define __pyx_n_u_DMPlex_metricGetMinimumMagnitude __pyx_string_tab[1079]
#define __pyx_n_u_DMPlex_metricGetNormalizationOrd __pyx_string_tab[1080]
#define __pyx_n_u_DMPlex_metricGetNumIterations __pyx_string_tab[1081]
#define __pyx_n_u_DMPlex_metricGetTargetComplexity __pyx_string_tab[1082]
#define __pyx_n_u_DMPlex_metricGetVerbosity __pyx_string_tab[1083]
#define __pyx_n_u_DMPlex_metricIntersection2 __pyx_string_tab[1084]
#define __pyx_n_u_DMPlex_metricIntersection3 __pyx_string_tab[1085]
#define __pyx_n_u_DMPlex_metricIsIsotropic __pyx_string_tab[1086]
#define __pyx_n_u_DMPlex_metricIsUniform __pyx_string_tab[1087]
#define __pyx_n_u_DMPlex_metricNoInsertion __pyx_string_tab[1088]
#define __pyx_n_u_DMPlex_metricNoMovement __pyx_string_tab[1089]
#define __pyx_n_u_DMPlex_metricNoSurf __pyx_string_tab[1090]
#define __pyx_n_u_DMPlex_metricNoSwapping __pyx_string_tab[1091]
#define __pyx_n_u_DMPlex_metricNormalize __pyx_string_tab[1092]
#define __pyx_n_u_DMPlex_metricRestrictAnisotropyF __pyx_string_tab[1093]
#define __pyx_n_u_DMPlex_metricSetFromOptions __pyx_string_tab[1094]
#define __pyx_n_u_DMPlex_metricSetGradationFactor __pyx_string_tab[1095]
#define __pyx_n_u_DMPlex_metricSetHausdorffNumber __pyx_string_tab[1096]
#define __pyx_n_u_DMPlex_metricSetIsotropic __pyx_string_tab[1097]
#define __pyx_n_u_DMPlex_metricSetMaximumAnisotrop __pyx_string_tab[1098]
#define __pyx_n_u_DMPlex_metricSetMaximumMagnitude __pyx_string_tab[1099]
#define __pyx_n_u_DMPlex_metricSetMinimumMagnitude __pyx_string_tab[1100]
#define __pyx_n_u_DMPlex_metricSetNoInsertion __pyx_string_tab[1101]
#define __pyx_n_u_DMPlex_metricSetNoMovement __pyx_string_tab[1102]
#define __pyx_n_u_DMPlex_metricSetNoSurf __pyx_string_tab[1103]
#define __pyx_n_u_DMPlex_metricSetNoSwapping __pyx_string_tab[1104]
#define __pyx_n_u_DMPlex_metricSetNormalizationOrd __pyx_string_tab[1105]
#define __pyx_n_u_DMPlex_metricSetNumIterations __pyx_string_tab[1106]
#define __pyx_n_u_DMPlex_metricSetRestrictAnisotro __pyx_string_tab[1107]
#define __pyx_n_u_DMPlex_metricSetTargetComplexity __pyx_string_tab[1108]
#define __pyx_n_u_DMPlex_metricSetUniform __pyx_string_tab[1109]
#define __pyx_n_u_DMPlex_metricSetVerbosity __pyx_string_tab[1110]
#define __pyx_n_u_DMPlex_migrateGlobalToNaturalSF __pyx_string_tab[1111]
#define __pyx_n_u_DMPlex_naturalToGlobalBegin __pyx_string_tab[1112]
#define __pyx_n_u_DMPlex_naturalToGlobalEnd __pyx_string_tab[1113]
#define __pyx_n_u_DMPlex_orient __pyx_string_tab[1114]
#define __pyx_n_u_DMPlex_permute __pyx_string_tab[1115]
#define __pyx_n_u_DMPlex_rebalanceSharedPoints __pyx_string_tab[1116]
#define __pyx_n_u_DMPlex_reorderGetDefault __pyx_string_tab[1117]
#define __pyx_n_u_DMPlex_reorderSetDefault __pyx_string_tab[1118]
#define __pyx_n_u_DMPlex_sectionLoad __pyx_string_tab[1119]
#define __pyx_n_u_DMPlex_sectionView __pyx_string_tab[1120]
#define __pyx_n_u_DMPlex_setAdjacencyUseAnchors __pyx_string_tab[1121]
#define __pyx_n_u_DMPlex_setCellType __pyx_string_tab[1122]
#define __pyx_n_u_DMPlex_setChart __pyx_string_tab[1123]
#define __pyx_n_u_DMPlex_setCone __pyx_string_tab[1124]
#define __pyx_n_u_DMPlex_setConeOrientation __pyx_string_tab[1125]
#define __pyx_n_u_DMPlex_setConeSize __pyx_string_tab[1126]
#define __pyx_n_u_DMPlex_setMatClosure __pyx_string_tab[1127]
#define __pyx_n_u_DMPlex_setMigrationSF __pyx_string_tab[1128]
#define __pyx_n_u_DMPlex_setPartitioner __pyx_string_tab[1129]
#define __pyx_n_u_DMPlex_setRefinementLimit __pyx_string_tab[1130]
#define __pyx_n_u_DMPlex_setRefinementUniform __pyx_string_tab[1131]
#define __pyx_n_u_DMPlex_setSupport __pyx_string_tab[1132]
#define __pyx_n_u_DMPlex_setSupportSize __pyx_string_tab[1133]
#define __pyx_n_u_DMPlex_setTetGenOptions __pyx_string_tab[1134]
#define __pyx_n_u_DMPlex_setTriangleOptions __pyx_string_tab[1135]
#define __pyx_n_u_DMPlex_setVecClosure __pyx_string_tab[1136]
#define __pyx_n_u_DMPlex_stratify __pyx_string_tab[1137]
#define __pyx_n_u_DMPlex_symmetrize __pyx_string_tab[1138]
#define __pyx_n_u_DMPlex_topologyLoad __pyx_string_tab[1139]
#define __pyx_n_u_DMPlex_topologyView __pyx_string_tab[1140]
#define __pyx_n_u_DMPlex_uninterpolate __pyx_string_tab[1141]
#define __pyx_n_u_DMPlex_vecGetClosure __pyx_string_tab[1142]
#define __pyx_n_u_DMPolytopeType __pyx_string_tab[1143]
#define __pyx_n_u_DMReorderDefaultFlag __pyx_string_tab[1144]
#define __pyx_n_u_DMRestrictHookFunction __pyx_string_tab[1145]
#define __pyx_n_u_DMShell __pyx_string_tab[1146]
#define __pyx_n_u_DMShell_create __pyx_string_tab[1147]
#define __pyx_n_u_DMShell_setCoarsen __pyx_string_tab[1148]
#define __pyx_n_u_DMShell_setCreateDomainDecomposi __pyx_string_tab[1149]
#define __pyx_n_u_DMShell_setCreateDomainDecomposi_2 __pyx_string_tab[1150]
#define __pyx_n_u_DMShell_setCreateFieldDecomposit __pyx_string_tab[1151]
#define __pyx_n_u_DMShell_setCreateGlobalVector __pyx_string_tab[1152]
#define __pyx_n_u_DMShell_setCreateInjection __pyx_string_tab[1153]
#define __pyx_n_u_DMShell_setCreateInterpolation __pyx_string_tab[1154]
#define __pyx_n_u_DMShell_setCreateLocalVector __pyx_string_tab[1155]
#define __pyx_n_u_DMShell_setCreateMatrix __pyx_string_tab[1156]
#define __pyx_n_u_DMShell_setCreateRestriction __pyx_string_tab[1157]
#define __pyx_n_u_DMShell_setCreateSubDM __pyx_string_tab[1158]
#define __pyx_n_u_DMShell_setGlobalToLocal __pyx_string_tab[1159]
#define __pyx_n_u_DMShell_setGlobalToLocalVecScatt __pyx_string_tab[1160]
#define __pyx_n_u_DMShell_setGlobalVector __pyx_string_tab[1161]
#define __pyx_n_u_DMShell_setLocalToGlobal __pyx_string_tab[1162]
#define __pyx_n_u_DMShell_setLocalToGlobalVecScatt __pyx_string_tab[1163]
#define __pyx_n_u_DMShell_setLocalToLocal __pyx_string_tab[1164]
#define __pyx_n_u_DMShell_setLocalToLocalVecScatte __pyx_string_tab[1165]
#define __pyx_n_u_DMShell_setLocalVector __pyx_string_tab[1166]
#define __pyx_n_u_DMShell_setMatrix __pyx_string_tab[1167]
#define __pyx_n_u_DMShell_setRefine __pyx_string_tab[1168]
#define __pyx_n_u_DMStag __pyx_string_tab[1169]
#define __pyx_n_u_DMStagStencilLocation __pyx_string_tab[1170]
#define __pyx_n_u_DMStagStencilType __pyx_string_tab[1171]
#define __pyx_n_u_DMStag_VecSplitToDMDA __pyx_string_tab[1172]
#define __pyx_n_u_DMStag_create __pyx_string_tab[1173]
#define __pyx_n_u_DMStag_createCompatibleDMStag __pyx_string_tab[1174]
#define __pyx_n_u_DMStag_get1dCoordinatecArrays __pyx_string_tab[1175]
#define __pyx_n_u_DMStag_getBoundaryTypes __pyx_string_tab[1176]
#define __pyx_n_u_DMStag_getCorners __pyx_string_tab[1177]
#define __pyx_n_u_DMStag_getDim __pyx_string_tab[1178]
#define __pyx_n_u_DMStag_getDof __pyx_string_tab[1179]
#define __pyx_n_u_DMStag_getEntriesPerElement __pyx_string_tab[1180]
#define __pyx_n_u_DMStag_getGhostCorners __pyx_string_tab[1181]
#define __pyx_n_u_DMStag_getGlobalSizes __pyx_string_tab[1182]
#define __pyx_n_u_DMStag_getIsFirstRank __pyx_string_tab[1183]
#define __pyx_n_u_DMStag_getIsLastRank __pyx_string_tab[1184]
#define __pyx_n_u_DMStag_getLocalSizes __pyx_string_tab[1185]
#define __pyx_n_u_DMStag_getLocationDof __pyx_string_tab[1186]
#define __pyx_n_u_DMStag_getLocationSlot __pyx_string_tab[1187]
#define __pyx_n_u_DMStag_getOwnershipRanges __pyx_string_tab[1188]
#define __pyx_n_u_DMStag_getProcSizes __pyx_string_tab[1189]
#define __pyx_n_u_DMStag_getProductCoordinateLocat __pyx_string_tab[1190]
#define __pyx_n_u_DMStag_getStencilType __pyx_string_tab[1191]
#define __pyx_n_u_DMStag_getStencilWidth __pyx_string_tab[1192]
#define __pyx_n_u_DMStag_getVecArray __pyx_string_tab[1193]
#define __pyx_n_u_DMStag_migrateVec __pyx_string_tab[1194]
#define __pyx_n_u_DMStag_setBoundaryTypes __pyx_string_tab[1195]
#define __pyx_n_u_DMStag_setCoordinateDMType __pyx_string_tab[1196]
#define __pyx_n_u_DMStag_setDof __pyx_string_tab[1197]
#define __pyx_n_u_DMStag_setGlobalSizes __pyx_string_tab[1198]
#define __pyx_n_u_DMStag_setOwnershipRanges __pyx_string_tab[1199]
#define __pyx_n_u_DMStag_setProcSizes __pyx_string_tab[1200]
#define __pyx_n_u_DMStag_setStencilType __pyx_string_tab[1201]
#define __pyx_n_u_DMStag_setStencilWidth __pyx_string_tab[1202]
#define __pyx_n_u_DMStag_setUniformCoordinates __pyx_string_tab[1203]
#define __pyx_n_u_DMStag_setUniformCoordinatesExpl __pyx_string_tab[1204]
#define __pyx_n_u_DMStag_setUniformCoordinatesProd __pyx_string_tab[1205]
#define __pyx_n_u_DMSwarm __pyx_string_tab[1206]
#define __pyx_n_u_DMSwarmCollectType __pyx_string_tab[1207]
#define __pyx_n_u_DMSwarmMigrateType __pyx_string_tab[1208]
#define __pyx_n_u_DMSwarmPICLayoutType __pyx_string_tab[1209]
#define __pyx_n_u_DMSwarmType __pyx_string_tab[1210]
#define __pyx_n_u_DMSwarm_addCellDM __pyx_string_tab[1211]
#define __pyx_n_u_DMSwarm_addNPoints __pyx_string_tab[1212]
#define __pyx_n_u_DMSwarm_addPoint __pyx_string_tab[1213]
#define __pyx_n_u_DMSwarm_collectViewCreate __pyx_string_tab[1214]
#define __pyx_n_u_DMSwarm_collectViewDestroy __pyx_string_tab[1215]
#define __pyx_n_u_DMSwarm_computeMoments __pyx_string_tab[1216]
#define __pyx_n_u_DMSwarm_copyPoint __pyx_string_tab[1217]
#define __pyx_n_u_DMSwarm_create __pyx_string_tab[1218]
#define __pyx_n_u_DMSwarm_createGlobalVectorFromFi __pyx_string_tab[1219]
#define __pyx_n_u_DMSwarm_createGlobalVectorFromFi_2 __pyx_string_tab[1220]
#define __pyx_n_u_DMSwarm_createLocalVectorFromFie __pyx_string_tab[1221]
#define __pyx_n_u_DMSwarm_createLocalVectorFromFie_2 __pyx_string_tab[1222]
#define __pyx_n_u_DMSwarm_destroyGlobalVectorFromF __pyx_string_tab[1223]
#define __pyx_n_u_DMSwarm_destroyGlobalVectorFromF_2 __pyx_string_tab[1224]
#define __pyx_n_u_DMSwarm_destroyLocalVectorFromFi __pyx_string_tab[1225]
#define __pyx_n_u_DMSwarm_destroyLocalVectorFromFi_2 __pyx_string_tab[1226]
#define __pyx_n_u_DMSwarm_finalizeFieldRegister __pyx_string_tab[1227]
#define __pyx_n_u_DMSwarm_getCellDM __pyx_string_tab[1228]
#define __pyx_n_u_DMSwarm_getCellDMActive __pyx_string_tab[1229]
#define __pyx_n_u_DMSwarm_getCellDMByName __pyx_string_tab[1230]
#define __pyx_n_u_DMSwarm_getCellDMNames __pyx_string_tab[1231]
#define __pyx_n_u_DMSwarm_getField __pyx_string_tab[1232]
#define __pyx_n_u_DMSwarm_getLocalSize __pyx_string_tab[1233]
#define __pyx_n_u_DMSwarm_getSize __pyx_string_tab[1234]
#define __pyx_n_u_DMSwarm_initializeFieldRegister __pyx_string_tab[1235]
#define __pyx_n_u_DMSwarm_insertPointUsingCellDM __pyx_string_tab[1236]
#define __pyx_n_u_DMSwarm_migrate __pyx_string_tab[1237]
#define __pyx_n_u_DMSwarm_projectFields __pyx_string_tab[1238]
#define __pyx_n_u_DMSwarm_registerField __pyx_string_tab[1239]
#define __pyx_n_u_DMSwarm_removePoint __pyx_string_tab[1240]
#define __pyx_n_u_DMSwarm_removePointAtIndex __pyx_string_tab[1241]
#define __pyx_n_u_DMSwarm_restoreField __pyx_string_tab[1242]
#define __pyx_n_u_DMSwarm_setCellDM __pyx_string_tab[1243]
#define __pyx_n_u_DMSwarm_setCellDMActive __pyx_string_tab[1244]
#define __pyx_n_u_DMSwarm_setLocalSizes __pyx_string_tab[1245]
#define __pyx_n_u_DMSwarm_setPointCoordinates __pyx_string_tab[1246]
#define __pyx_n_u_DMSwarm_setPointCoordinatesCellw __pyx_string_tab[1247]
#define __pyx_n_u_DMSwarm_setPointsUniformCoordina __pyx_string_tab[1248]
#define __pyx_n_u_DMSwarm_setType __pyx_string_tab[1249]
#define __pyx_n_u_DMSwarm_sortGetAccess __pyx_string_tab[1250]
#define __pyx_n_u_DMSwarm_sortGetIsValid __pyx_string_tab[1251]
#define __pyx_n_u_DMSwarm_sortGetNumberOfPointsPer __pyx_string_tab[1252]
#define __pyx_n_u_DMSwarm_sortGetPointsPerCell __pyx_string_tab[1253]
#define __pyx_n_u_DMSwarm_sortGetSizes __pyx_string_tab[1254]
#define __pyx_n_u_DMSwarm_sortRestoreAccess __pyx_string_tab[1255]
#define __pyx_n_u_DMSwarm_vectorDefineField __pyx_string_tab[1256]
#define __pyx_n_u_DMSwarm_viewFieldsXDMF __pyx_string_tab[1257]
#define __pyx_n_u_DMSwarm_viewXDMF __pyx_string_tab[1258]
#define __pyx_n_u_DMType __pyx_string_tab[1259]
#define __pyx_n_u_DM_adaptLabel __pyx_string_tab[1260]
#define __pyx_n_u_DM_adaptMetric __pyx_string_tab[1261]
#define __pyx_n_u_DM_addCoarsenHook __pyx_string_tab[1262]
#define __pyx_n_u_DM_addField __pyx_string_tab[1263]
#define __pyx_n_u_DM_appendOptionsPrefix __pyx_string_tab[1264]
#define __pyx_n_u_DM_clearDS __pyx_string_tab[1265]
#define __pyx_n_u_DM_clearFields __pyx_string_tab[1266]
#define __pyx_n_u_DM_clearLabelStratum __pyx_string_tab[1267]
#define __pyx_n_u_DM_clearLabelValue __pyx_string_tab[1268]
#define __pyx_n_u_DM_clone __pyx_string_tab[1269]
#define __pyx_n_u_DM_coarsen __pyx_string_tab[1270]
#define __pyx_n_u_DM_coarsenHierarchy __pyx_string_tab[1271]
#define __pyx_n_u_DM_convert __pyx_string_tab[1272]
#define __pyx_n_u_DM_copyDS __pyx_string_tab[1273]
#define __pyx_n_u_DM_copyDisc __pyx_string_tab[1274]
#define __pyx_n_u_DM_copyFields __pyx_string_tab[1275]
#define __pyx_n_u_DM_create __pyx_string_tab[1276]
#define __pyx_n_u_DM_createDS __pyx_string_tab[1277]
#define __pyx_n_u_DM_createFieldDecomposition __pyx_string_tab[1278]
#define __pyx_n_u_DM_createGlobalVec __pyx_string_tab[1279]
#define __pyx_n_u_DM_createInjection __pyx_string_tab[1280]
#define __pyx_n_u_DM_createInterpolation __pyx_string_tab[1281]
#define __pyx_n_u_DM_createLabel __pyx_string_tab[1282]
#define __pyx_n_u_DM_createLocalVec __pyx_string_tab[1283]
#define __pyx_n_u_DM_createMassMatrix __pyx_string_tab[1284]
#define __pyx_n_u_DM_createMat __pyx_string_tab[1285]
#define __pyx_n_u_DM_createRestriction __pyx_string_tab[1286]
#define __pyx_n_u_DM_createSectionSF __pyx_string_tab[1287]
#define __pyx_n_u_DM_createSubDM __pyx_string_tab[1288]
#define __pyx_n_u_DM_destroy __pyx_string_tab[1289]
#define __pyx_n_u_DM_getAppCtx __pyx_string_tab[1290]
#define __pyx_n_u_DM_getAuxiliaryVec __pyx_string_tab[1291]
#define __pyx_n_u_DM_getBasicAdjacency __pyx_string_tab[1292]
#define __pyx_n_u_DM_getBlockSize __pyx_string_tab[1293]
#define __pyx_n_u_DM_getBoundingBox __pyx_string_tab[1294]
#define __pyx_n_u_DM_getCellCoordinateDM __pyx_string_tab[1295]
#define __pyx_n_u_DM_getCellCoordinateSection __pyx_string_tab[1296]
#define __pyx_n_u_DM_getCellCoordinates __pyx_string_tab[1297]
#define __pyx_n_u_DM_getCellCoordinatesLocal __pyx_string_tab[1298]
#define __pyx_n_u_DM_getCoarseDM __pyx_string_tab[1299]
#define __pyx_n_u_DM_getCoarsenLevel __pyx_string_tab[1300]
#define __pyx_n_u_DM_getCoordinateDM __pyx_string_tab[1301]
#define __pyx_n_u_DM_getCoordinateDim __pyx_string_tab[1302]
#define __pyx_n_u_DM_getCoordinateSection __pyx_string_tab[1303]
#define __pyx_n_u_DM_getCoordinates __pyx_string_tab[1304]
#define __pyx_n_u_DM_getCoordinatesLocal __pyx_string_tab[1305]
#define __pyx_n_u_DM_getCoordinatesLocalized __pyx_string_tab[1306]
#define __pyx_n_u_DM_getDS __pyx_string_tab[1307]
#define __pyx_n_u_DM_getDimension __pyx_string_tab[1308]
#define __pyx_n_u_DM_getField __pyx_string_tab[1309]
#define __pyx_n_u_DM_getFieldAdjacency __pyx_string_tab[1310]
#define __pyx_n_u_DM_getGlobalSection __pyx_string_tab[1311]
#define __pyx_n_u_DM_getGlobalVec __pyx_string_tab[1312]
#define __pyx_n_u_DM_getLGMap __pyx_string_tab[1313]
#define __pyx_n_u_DM_getLabel __pyx_string_tab[1314]
#define __pyx_n_u_DM_getLabelIdIS __pyx_string_tab[1315]
#define __pyx_n_u_DM_getLabelName __pyx_string_tab[1316]
#define __pyx_n_u_DM_getLabelOutput __pyx_string_tab[1317]
#define __pyx_n_u_DM_getLabelSize __pyx_string_tab[1318]
#define __pyx_n_u_DM_getLabelValue __pyx_string_tab[1319]
#define __pyx_n_u_DM_getLocalBoundingBox __pyx_string_tab[1320]
#define __pyx_n_u_DM_getLocalSection __pyx_string_tab[1321]
#define __pyx_n_u_DM_getLocalVec __pyx_string_tab[1322]
#define __pyx_n_u_DM_getNumFields __pyx_string_tab[1323]
#define __pyx_n_u_DM_getNumLabels __pyx_string_tab[1324]
#define __pyx_n_u_DM_getOptionsPrefix __pyx_string_tab[1325]
#define __pyx_n_u_DM_getPeriodicity __pyx_string_tab[1326]
#define __pyx_n_u_DM_getPointSF __pyx_string_tab[1327]
#define __pyx_n_u_DM_getRefineLevel __pyx_string_tab[1328]
#define __pyx_n_u_DM_getSectionSF __pyx_string_tab[1329]
#define __pyx_n_u_DM_getSparseLocalize __pyx_string_tab[1330]
#define __pyx_n_u_DM_getStratumIS __pyx_string_tab[1331]
#define __pyx_n_u_DM_getStratumSize __pyx_string_tab[1332]
#define __pyx_n_u_DM_getType __pyx_string_tab[1333]
#define __pyx_n_u_DM_getUseNatural __pyx_string_tab[1334]
#define __pyx_n_u_DM_globalToLocal __pyx_string_tab[1335]
#define __pyx_n_u_DM_hasLabel __pyx_string_tab[1336]
#define __pyx_n_u_DM_load __pyx_string_tab[1337]
#define __pyx_n_u_DM_localToGlobal __pyx_string_tab[1338]
#define __pyx_n_u_DM_localToLocal __pyx_string_tab[1339]
#define __pyx_n_u_DM_localizeCoordinates __pyx_string_tab[1340]
#define __pyx_n_u_DM_refine __pyx_string_tab[1341]
#define __pyx_n_u_DM_refineHierarchy __pyx_string_tab[1342]
#define __pyx_n_u_DM_removeLabel __pyx_string_tab[1343]
#define __pyx_n_u_DM_restoreGlobalVec __pyx_string_tab[1344]
#define __pyx_n_u_DM_restoreLocalVec __pyx_string_tab[1345]
#define __pyx_n_u_DM_setAppCtx __pyx_string_tab[1346]
#define __pyx_n_u_DM_setAuxiliaryVec __pyx_string_tab[1347]
#define __pyx_n_u_DM_setBasicAdjacency __pyx_string_tab[1348]
#define __pyx_n_u_DM_setCellCoordinateDM __pyx_string_tab[1349]
#define __pyx_n_u_DM_setCellCoordinateSection __pyx_string_tab[1350]
#define __pyx_n_u_DM_setCellCoordinates __pyx_string_tab[1351]
#define __pyx_n_u_DM_setCellCoordinatesLocal __pyx_string_tab[1352]
#define __pyx_n_u_DM_setCoarseDM __pyx_string_tab[1353]
#define __pyx_n_u_DM_setCoordinateDim __pyx_string_tab[1354]
#define __pyx_n_u_DM_setCoordinateDisc __pyx_string_tab[1355]
#define __pyx_n_u_DM_setCoordinates __pyx_string_tab[1356]
#define __pyx_n_u_DM_setCoordinatesLocal __pyx_string_tab[1357]
#define __pyx_n_u_DM_setDimension __pyx_string_tab[1358]
#define __pyx_n_u_DM_setField __pyx_string_tab[1359]
#define __pyx_n_u_DM_setFieldAdjacency __pyx_string_tab[1360]
#define __pyx_n_u_DM_setFromOptions __pyx_string_tab[1361]
#define __pyx_n_u_DM_setGlobalSection __pyx_string_tab[1362]
#define __pyx_n_u_DM_setKSPComputeOperators __pyx_string_tab[1363]
#define __pyx_n_u_DM_setLabelOutput __pyx_string_tab[1364]
#define __pyx_n_u_DM_setLabelValue __pyx_string_tab[1365]
#define __pyx_n_u_DM_setLocalSection __pyx_string_tab[1366]
#define __pyx_n_u_DM_setMatType __pyx_string_tab[1367]
#define __pyx_n_u_DM_setNumFields __pyx_string_tab[1368]
#define __pyx_n_u_DM_setOptionsPrefix __pyx_string_tab[1369]
#define __pyx_n_u_DM_setPeriodicity __pyx_string_tab[1370]
#define __pyx_n_u_DM_setPointSF __pyx_string_tab[1371]
#define __pyx_n_u_DM_setRefineLevel __pyx_string_tab[1372]
#define __pyx_n_u_DM_setSNESFunction __pyx_string_tab[1373]
#define __pyx_n_u_DM_setSNESJacobian __pyx_string_tab[1374]
#define __pyx_n_u_DM_setSectionSF __pyx_string_tab[1375]
#define __pyx_n_u_DM_setSparseLocalize __pyx_string_tab[1376]
#define __pyx_n_u_DM_setType __pyx_string_tab[1377]
#define __pyx_n_u_DM_setUp __pyx_string_tab[1378]
#define __pyx_n_u_DM_setUseNatural __pyx_string_tab[1379]
#define __pyx_n_u_DM_setVecType __pyx_string_tab[1380]
#define __pyx_n_u_DM_view __pyx_string_tab[1381]
#define __pyx_n_u_DOF __pyx_string_tab[1382]
#define __pyx_n_u_DOWN __pyx_string_tab[1383]
#define __pyx_n_u_DOWN_LEFT __pyx_string_tab[1384]
#define __pyx_n_u_DOWN_RIGHT __pyx_string_tab[1385]
#define __pyx_n_u_DO_NOT_COPY_VALUES __pyx_string_tab[1386]
#define __pyx_n_u_DRAW __pyx_string_tab[1387]
#define __pyx_n_u_DRAW_BASIC __pyx_string_tab[1388]
#define __pyx_n_u_DRAW_CONTOUR __pyx_string_tab[1389]
#define __pyx_n_u_DRAW_LG __pyx_string_tab[1390]
#define __pyx_n_u_DRAW_LG_XRANGE __pyx_string_tab[1391]
#define __pyx_n_u_DRAW_PORTS __pyx_string_tab[1392]
#define __pyx_n_u_DROP __pyx_string_tab[1393]
#define __pyx_n_u_DS __pyx_string_tab[1394]
#define __pyx_n_u_DSType __pyx_string_tab[1395]
#define __pyx_n_u_DS_create __pyx_string_tab[1396]
#define __pyx_n_u_DS_destroy __pyx_string_tab[1397]
#define __pyx_n_u_DS_getComponents __pyx_string_tab[1398]
#define __pyx_n_u_DS_getCoordinateDimension __pyx_string_tab[1399]
#define __pyx_n_u_DS_getDimensions __pyx_string_tab[1400]
#define __pyx_n_u_DS_getFieldIndex __pyx_string_tab[1401]
#define __pyx_n_u_DS_getNumFields __pyx_string_tab[1402]
#define __pyx_n_u_DS_getSpatialDimension __pyx_string_tab[1403]
#define __pyx_n_u_DS_getTotalComponents __pyx_string_tab[1404]
#define __pyx_n_u_DS_getTotalDimensions __pyx_string_tab[1405]
#define __pyx_n_u_DS_getType __pyx_string_tab[1406]
#define __pyx_n_u_DS_setDiscretisation __pyx_string_tab[1407]
#define __pyx_n_u_DS_setFromOptions __pyx_string_tab[1408]
#define __pyx_n_u_DS_setType __pyx_string_tab[1409]
#define __pyx_n_u_DS_setUp __pyx_string_tab[1410]
#define __pyx_n_u_DS_view __pyx_string_tab[1411]
#define __pyx_n_u_DUMMY __pyx_string_tab[1412]
#define __pyx_n_u_DY __pyx_string_tab[1413]
#define __pyx_n_u_Datatype __pyx_string_tab[1414]
#define __pyx_n_u_DeflationSpaceType __pyx_string_tab[1415]
#define __pyx_n_u_Device __pyx_string_tab[1416]
#define __pyx_n_u_DeviceContext __pyx_string_tab[1417]
#define __pyx_n_u_DeviceContext_create __pyx_string_tab[1418]
#define __pyx_n_u_DeviceContext_destroy __pyx_string_tab[1419]
#define __pyx_n_u_DeviceContext_duplicate __pyx_string_tab[1420]
#define __pyx_n_u_DeviceContext_fork __pyx_string_tab[1421]
#define __pyx_n_u_DeviceContext_getCurrent __pyx_string_tab[1422]
#define __pyx_n_u_DeviceContext_getDevice __pyx_string_tab[1423]
#define __pyx_n_u_DeviceContext_getStreamType __pyx_string_tab[1424]
#define __pyx_n_u_DeviceContext_idle __pyx_string_tab[1425]
#define __pyx_n_u_DeviceContext_join __pyx_string_tab[1426]
#define __pyx_n_u_DeviceContext_setCurrent __pyx_string_tab[1427]
#define __pyx_n_u_DeviceContext_setDevice __pyx_string_tab[1428]
#define __pyx_n_u_DeviceContext_setFromOptions __pyx_string_tab[1429]
#define __pyx_n_u_DeviceContext_setStreamType __pyx_string_tab[1430]
#define __pyx_n_u_DeviceContext_setUp __pyx_string_tab[1431]
#define __pyx_n_u_DeviceContext_synchronize __pyx_string_tab[1432]
#define __pyx_n_u_DeviceContext_waitFor __pyx_string_tab[1433]
#define __pyx_n_u_DeviceJoinMode __pyx_string_tab[1434]
#define __pyx_n_u_DeviceType __pyx_string_tab[1435]
#define __pyx_n_u_Device_configure __pyx_string_tab[1436]
#define __pyx_n_u_Device_create __pyx_string_tab[1437]
#define __pyx_n_u_Device_destroy __pyx_string_tab[1438]
#define __pyx_n_u_Device_getDeviceId __pyx_string_tab[1439]
#define __pyx_n_u_Device_getDeviceType __pyx_string_tab[1440]
#define __pyx_n_u_Device_setDefaultType __pyx_string_tab[1441]
#define __pyx_n_u_Device_view __pyx_string_tab[1442]
#define __pyx_n_u_DimsSpec __pyx_string_tab[1443]
#define __pyx_n_u_DrawSize __pyx_string_tab[1444]
#define __pyx_n_u_DualSpace __pyx_string_tab[1445]
#define __pyx_n_u_DualSpaceType __pyx_string_tab[1446]
#define __pyx_n_u_DualSpace_create __pyx_string_tab[1447]
#define __pyx_n_u_DualSpace_destroy __pyx_string_tab[1448]
#define __pyx_n_u_DualSpace_duplicate __pyx_string_tab[1449]
#define __pyx_n_u_DualSpace_getDM __pyx_string_tab[1450]
#define __pyx_n_u_DualSpace_getDimension __pyx_string_tab[1451]
#define __pyx_n_u_DualSpace_getFunctional __pyx_string_tab[1452]
#define __pyx_n_u_DualSpace_getInteriorDimension __pyx_string_tab[1453]
#define __pyx_n_u_DualSpace_getLagrangeContinuity __pyx_string_tab[1454]
#define __pyx_n_u_DualSpace_getLagrangeTensor __pyx_string_tab[1455]
#define __pyx_n_u_DualSpace_getLagrangeTrimmed __pyx_string_tab[1456]
#define __pyx_n_u_DualSpace_getNumComponents __pyx_string_tab[1457]
#define __pyx_n_u_DualSpace_getNumDof __pyx_string_tab[1458]
#define __pyx_n_u_DualSpace_getOrder __pyx_string_tab[1459]
#define __pyx_n_u_DualSpace_getType __pyx_string_tab[1460]
#define __pyx_n_u_DualSpace_setDM __pyx_string_tab[1461]
#define __pyx_n_u_DualSpace_setLagrangeContinuity __pyx_string_tab[1462]
#define __pyx_n_u_DualSpace_setLagrangeTensor __pyx_string_tab[1463]
#define __pyx_n_u_DualSpace_setLagrangeTrimmed __pyx_string_tab[1464]
#define __pyx_n_u_DualSpace_setNumComponents __pyx_string_tab[1465]
#define __pyx_n_u_DualSpace_setOrder __pyx_string_tab[1466]
#define __pyx_n_u_DualSpace_setSimpleDimension __pyx_string_tab[1467]
#define __pyx_n_u_DualSpace_setSimpleFunctional __pyx_string_tab[1468]
#define __pyx_n_u_DualSpace_setType __pyx_string_tab[1469]
#define __pyx_n_u_DualSpace_setUp __pyx_string_tab[1470]
#define __pyx_n_u_DualSpace_view __pyx_string_tab[1471]
#define __pyx_n_u_Dup __pyx_string_tab[1472]
#define __pyx_n_u_DuplicateOption __pyx_string_tab[1473]
#define __pyx_n_u_EIMEX __pyx_string_tab[1474]
#define __pyx_n_u_EISENSTAT __pyx_string_tab[1475]
#define __pyx_n_u_ELEMENT __pyx_string_tab[1476]
#define __pyx_n_u_ELEMENTAL __pyx_string_tab[1477]
#define __pyx_n_u_ERROR_LOWER_TRIANGULAR __pyx_string_tab[1478]
#define __pyx_n_u_ESSL __pyx_string_tab[1479]
#define __pyx_n_u_EULER __pyx_string_tab[1480]
#define __pyx_n_u_EXACT __pyx_string_tab[1481]
#define __pyx_n_u_EXODUSII __pyx_string_tab[1482]
#define __pyx_n_u_EXOTIC __pyx_string_tab[1483]
#define __pyx_n_u_EXPLICIT __pyx_string_tab[1484]
#define __pyx_n_u_EXTRUDE __pyx_string_tab[1485]
#define __pyx_n_u_ElementType __pyx_string_tab[1486]
#define __pyx_n_u_Ellipsis __pyx_string_tab[1487]
#define __pyx_n_u_EquationType __pyx_string_tab[1488]
#define __pyx_n_u_Error __pyx_string_tab[1489]
#define __pyx_n_u_Error___bool __pyx_string_tab[1490]
#define __pyx_n_u_Error___init __pyx_string_tab[1491]
#define __pyx_n_u_Error___repr __pyx_string_tab[1492]
#define __pyx_n_u_Error___str __pyx_string_tab[1493]
#define __pyx_n_u_Event __pyx_string_tab[1494]
#define __pyx_n_u_EventDecorator __pyx_string_tab[1495]
#define __pyx_n_u_EventDecorator_locals_decorator __pyx_string_tab[1496]
#define __pyx_n_u_EventDecorator_locals_decorator_2 __pyx_string_tab[1497]
#define __pyx_n_u_ExactFinalTime __pyx_string_tab[1498]
#define __pyx_n_u_ExactFinalTimeOption __pyx_string_tab[1499]
#define __pyx_n_u_F __pyx_string_tab[1500]
#define __pyx_n_u_FACTOR_NUMERIC_ZEROPIVOT __pyx_string_tab[1501]
#define __pyx_n_u_FACTOR_OTHER __pyx_string_tab[1502]
#define __pyx_n_u_FACTOR_OUTMEMORY __pyx_string_tab[1503]
#define __pyx_n_u_FACTOR_STRUCT_ZEROPIVOT __pyx_string_tab[1504]
#define __pyx_n_u_FAILED __pyx_string_tab[1505]
#define __pyx_n_u_FAILED_ASCENT __pyx_string_tab[1506]
#define __pyx_n_u_FAILED_BADPARAMETER __pyx_string_tab[1507]
#define __pyx_n_u_FAILED_INFORNAN __pyx_string_tab[1508]
#define __pyx_n_u_FALSE __pyx_string_tab[1509]
#define __pyx_n_u_FAS __pyx_string_tab[1510]
#define __pyx_n_u_FBCGS __pyx_string_tab[1511]
#define __pyx_n_u_FBCGSR __pyx_string_tab[1512]
#define __pyx_n_u_FCG __pyx_string_tab[1513]
#define __pyx_n_u_FE __pyx_string_tab[1514]
#define __pyx_n_u_FETIDP __pyx_string_tab[1515]
#define __pyx_n_u_FEType __pyx_string_tab[1516]
#define __pyx_n_u_FE_create __pyx_string_tab[1517]
#define __pyx_n_u_FE_createByCell __pyx_string_tab[1518]
#define __pyx_n_u_FE_createDefault __pyx_string_tab[1519]
#define __pyx_n_u_FE_createLagrange __pyx_string_tab[1520]
#define __pyx_n_u_FE_destroy __pyx_string_tab[1521]
#define __pyx_n_u_FE_getBasisSpace __pyx_string_tab[1522]
#define __pyx_n_u_FE_getDimension __pyx_string_tab[1523]
#define __pyx_n_u_FE_getDualSpace __pyx_string_tab[1524]
#define __pyx_n_u_FE_getFaceQuadrature __pyx_string_tab[1525]
#define __pyx_n_u_FE_getNumComponents __pyx_string_tab[1526]
#define __pyx_n_u_FE_getNumDof __pyx_string_tab[1527]
#define __pyx_n_u_FE_getQuadrature __pyx_string_tab[1528]
#define __pyx_n_u_FE_getSpatialDimension __pyx_string_tab[1529]
#define __pyx_n_u_FE_getTileSizes __pyx_string_tab[1530]
#define __pyx_n_u_FE_setBasisSpace __pyx_string_tab[1531]
#define __pyx_n_u_FE_setDualSpace __pyx_string_tab[1532]
#define __pyx_n_u_FE_setFaceQuadrature __pyx_string_tab[1533]
#define __pyx_n_u_FE_setFromOptions __pyx_string_tab[1534]
#define __pyx_n_u_FE_setNumComponents __pyx_string_tab[1535]
#define __pyx_n_u_FE_setQuadrature __pyx_string_tab[1536]
#define __pyx_n_u_FE_setTileSizes __pyx_string_tab[1537]
#define __pyx_n_u_FE_setType __pyx_string_tab[1538]
#define __pyx_n_u_FE_setUp __pyx_string_tab[1539]
#define __pyx_n_u_FE_view __pyx_string_tab[1540]
#define __pyx_n_u_FFT __pyx_string_tab[1541]
#define __pyx_n_u_FFTW __pyx_string_tab[1542]
#define __pyx_n_u_FGMRES __pyx_string_tab[1543]
#define __pyx_n_u_FIELDSPLIT __pyx_string_tab[1544]
#define __pyx_n_u_FINAL __pyx_string_tab[1545]
#define __pyx_n_u_FINAL_ASSEMBLY __pyx_string_tab[1546]
#define __pyx_n_u_FINAL_ONLY __pyx_string_tab[1547]
#define __pyx_n_u_FLUSH __pyx_string_tab[1548]
#define __pyx_n_u_FLUSH_ASSEMBLY __pyx_string_tab[1549]
#define __pyx_n_u_FORCE_DIAGONAL_ENTRIES __pyx_string_tab[1550]
#define __pyx_n_u_FOREST __pyx_string_tab[1551]
#define __pyx_n_u_FORWARD __pyx_string_tab[1552]
#define __pyx_n_u_FORWARD_LOCAL __pyx_string_tab[1553]
#define __pyx_n_u_FORWARD_SWEEP __pyx_string_tab[1554]
#define __pyx_n_u_FR __pyx_string_tab[1555]
#define __pyx_n_u_FRB __pyx_string_tab[1556]
#define __pyx_n_u_FROBENIUS __pyx_string_tab[1557]
#define __pyx_n_u_FRONT __pyx_string_tab[1558]
#define __pyx_n_u_FRONT_DOWN __pyx_string_tab[1559]
#define __pyx_n_u_FRONT_DOWN_LEFT __pyx_string_tab[1560]
#define __pyx_n_u_FRONT_DOWN_RIGHT __pyx_string_tab[1561]
#define __pyx_n_u_FRONT_LEFT __pyx_string_tab[1562]
#define __pyx_n_u_FRONT_RIGHT __pyx_string_tab[1563]
#define __pyx_n_u_FRONT_UP __pyx_string_tab[1564]
#define __pyx_n_u_FRONT_UP_LEFT __pyx_string_tab[1565]
#define __pyx_n_u_FRONT_UP_RIGHT __pyx_string_tab[1566]
#define __pyx_n_u_FULL __pyx_string_tab[1567]
#define __pyx_n_u_FULL_SIZE __pyx_string_tab[1568]
#define __pyx_n_u_FV_GHOST __pyx_string_tab[1569]
#define __pyx_n_u_FactorShiftType __pyx_string_tab[1570]
#define __pyx_n_u_FailedReason __pyx_string_tab[1571]
#define __pyx_n_u_FieldSplitSchurFactType __pyx_string_tab[1572]
#define __pyx_n_u_FieldSplitSchurPreType __pyx_string_tab[1573]
#define __pyx_n_u_FileMode __pyx_string_tab[1574]
#define __pyx_n_u_Format __pyx_string_tab[1575]
#define __pyx_n_u_Free __pyx_string_tab[1576]
#define __pyx_n_u_G __pyx_string_tab[1577]
#define __pyx_n_u_GALERKIN __pyx_string_tab[1578]
#define __pyx_n_u_GAMG __pyx_string_tab[1579]
#define __pyx_n_u_GAMGType __pyx_string_tab[1580]
#define __pyx_n_u_GASM __pyx_string_tab[1581]
#define __pyx_n_u_GASMType __pyx_string_tab[1582]
#define __pyx_n_u_GATHER __pyx_string_tab[1583]
#define __pyx_n_u_GATHERV __pyx_string_tab[1584]
#define __pyx_n_u_GCR __pyx_string_tab[1585]
#define __pyx_n_u_GCRODR __pyx_string_tab[1586]
#define __pyx_n_u_GD __pyx_string_tab[1587]
#define __pyx_n_u_GENERAL __pyx_string_tab[1588]
#define __pyx_n_u_GEO __pyx_string_tab[1589]
#define __pyx_n_u_GETROW_UPPERTRIANGULAR __pyx_string_tab[1590]
#define __pyx_n_u_GHOSTED __pyx_string_tab[1591]
#define __pyx_n_u_GLEE __pyx_string_tab[1592]
#define __pyx_n_u_GLLE __pyx_string_tab[1593]
#define __pyx_n_u_GLOBAL_MAX __pyx_string_tab[1594]
#define __pyx_n_u_GLOBAL_SUM __pyx_string_tab[1595]
#define __pyx_n_u_GLTR __pyx_string_tab[1596]
#define __pyx_n_u_GLVIS __pyx_string_tab[1597]
#define __pyx_n_u_GMRES __pyx_string_tab[1598]
#define __pyx_n_u_GPCG __pyx_string_tab[1599]
#define __pyx_n_u_GROPPCG __pyx_string_tab[1600]
#define __pyx_n_u_Get_rank __pyx_string_tab[1601]
#define __pyx_n_u_Get_size __pyx_string_tab[1602]
#define __pyx_n_u_H __pyx_string_tab[1603]
#define __pyx_n_u_H2OPUS __pyx_string_tab[1604]
#define __pyx_n_u_H2OpusCompress __pyx_string_tab[1605]
#define __pyx_n_u_H2OpusLowRankUpdate __pyx_string_tab[1606]
#define __pyx_n_u_H2OpusOrthogonalize __pyx_string_tab[1607]
#define __pyx_n_u_HAAR __pyx_string_tab[1608]
#define __pyx_n_u_HALF __pyx_string_tab[1609]
#define __pyx_n_u_HALFL2SQUARED __pyx_string_tab[1610]
#define __pyx_n_u_HALF_SIZE __pyx_string_tab[1611]
#define __pyx_n_u_HALTED_LOWERBOUND __pyx_string_tab[1612]
#define __pyx_n_u_HALTED_MAXFCN __pyx_string_tab[1613]
#define __pyx_n_u_HALTED_OTHER __pyx_string_tab[1614]
#define __pyx_n_u_HALTED_RTOL __pyx_string_tab[1615]
#define __pyx_n_u_HALTED_UPPERBOUND __pyx_string_tab[1616]
#define __pyx_n_u_HALTED_USER __pyx_string_tab[1617]
#define __pyx_n_u_HASH __pyx_string_tab[1618]
#define __pyx_n_u_HDF5 __pyx_string_tab[1619]
#define __pyx_n_u_HDF5_MAT __pyx_string_tab[1620]
#define __pyx_n_u_HDF5_PETSC __pyx_string_tab[1621]
#define __pyx_n_u_HDF5_VIZ __pyx_string_tab[1622]
#define __pyx_n_u_HDF5_XDMF __pyx_string_tab[1623]
#define __pyx_n_u_HERMITIAN __pyx_string_tab[1624]
#define __pyx_n_u_HERMITIANTRANSPOSE __pyx_string_tab[1625]
#define __pyx_n_u_HEXAHEDRON __pyx_string_tab[1626]
#define __pyx_n_u_HIP __pyx_string_tab[1627]
#define __pyx_n_u_HMG __pyx_string_tab[1628]
#define __pyx_n_u_HOST __pyx_string_tab[1629]
#define __pyx_n_u_HPDDM __pyx_string_tab[1630]
#define __pyx_n_u_HPDDMCoarseCorrectionType __pyx_string_tab[1631]
#define __pyx_n_u_HPDDMType __pyx_string_tab[1632]
#define __pyx_n_u_HS __pyx_string_tab[1633]
#define __pyx_n_u_HTOOL __pyx_string_tab[1634]
#define __pyx_n_u_HYPRE __pyx_string_tab[1635]
#define __pyx_n_u_HYPRESSTRUCT __pyx_string_tab[1636]
#define __pyx_n_u_HYPRESTRUCT __pyx_string_tab[1637]
#define __pyx_n_u_HZ __pyx_string_tab[1638]
#define __pyx_n_u_Hmat __pyx_string_tab[1639]
#define __pyx_n_u_HtoolGetPermutationSource __pyx_string_tab[1640]
#define __pyx_n_u_HtoolGetPermutationTarget __pyx_string_tab[1641]
#define __pyx_n_u_HtoolUsePermutation __pyx_string_tab[1642]
#define __pyx_n_u_HtoolUseRecompression __pyx_string_tab[1643]
#define __pyx_n_u_I __pyx_string_tab[1644]
#define __pyx_n_u_IBCGS __pyx_string_tab[1645]
#define __pyx_n_u_ICC __pyx_string_tab[1646]
#define __pyx_n_u_IGNORE_LOWER_TRIANGULAR __pyx_string_tab[1647]
#define __pyx_n_u_IGNORE_NEGATIVE_INDICES __pyx_string_tab[1648]
#define __pyx_n_u_IGNORE_OFF_PROC_ENTRIES __pyx_string_tab[1649]
#define __pyx_n_u_IGNORE_ZERO_ENTRIES __pyx_string_tab[1650]
#define __pyx_n_u_ILU __pyx_string_tab[1651]
#define __pyx_n_u_IMPLICIT __pyx_string_tab[1652]
#define __pyx_n_u_INBLOCKS __pyx_string_tab[1653]
#define __pyx_n_u_INF __pyx_string_tab[1654]
#define __pyx_n_u_INFINITY __pyx_string_tab[1655]
#define __pyx_n_u_INITIAL_FINAL_ONLY __pyx_string_tab[1656]
#define __pyx_n_u_INITIAL_GUESS __pyx_string_tab[1657]
#define __pyx_n_u_INITIAL_ONLY __pyx_string_tab[1658]
#define __pyx_n_u_INSERT __pyx_string_tab[1659]
#define __pyx_n_u_INSERT_ALL __pyx_string_tab[1660]
#define __pyx_n_u_INSERT_ALL_VALUES __pyx_string_tab[1661]
#define __pyx_n_u_INSERT_BC __pyx_string_tab[1662]
#define __pyx_n_u_INSERT_BC_VALUES __pyx_string_tab[1663]
#define __pyx_n_u_INSERT_VALUES __pyx_string_tab[1664]
#define __pyx_n_u_INTERIOR_GHOST __pyx_string_tab[1665]
#define __pyx_n_u_INTERPOLATE __pyx_string_tab[1666]
#define __pyx_n_u_IPM __pyx_string_tab[1667]
#define __pyx_n_u_IS __pyx_string_tab[1668]
#define __pyx_n_u_ISType __pyx_string_tab[1669]
#define __pyx_n_u_IS___enter __pyx_string_tab[1670]
#define __pyx_n_u_IS___exit __pyx_string_tab[1671]
#define __pyx_n_u_IS_allGather __pyx_string_tab[1672]
#define __pyx_n_u_IS_buffer __pyx_string_tab[1673]
#define __pyx_n_u_IS_buffer___enter __pyx_string_tab[1674]
#define __pyx_n_u_IS_buffer___exit __pyx_string_tab[1675]
#define __pyx_n_u_IS_buildTwoSided __pyx_string_tab[1676]
#define __pyx_n_u_IS_complement __pyx_string_tab[1677]
#define __pyx_n_u_IS_copy __pyx_string_tab[1678]
#define __pyx_n_u_IS_create __pyx_string_tab[1679]
#define __pyx_n_u_IS_createBlock __pyx_string_tab[1680]
#define __pyx_n_u_IS_createGeneral __pyx_string_tab[1681]
#define __pyx_n_u_IS_createStride __pyx_string_tab[1682]
#define __pyx_n_u_IS_destroy __pyx_string_tab[1683]
#define __pyx_n_u_IS_difference __pyx_string_tab[1684]
#define __pyx_n_u_IS_duplicate __pyx_string_tab[1685]
#define __pyx_n_u_IS_embed __pyx_string_tab[1686]
#define __pyx_n_u_IS_equal __pyx_string_tab[1687]
#define __pyx_n_u_IS_expand __pyx_string_tab[1688]
#define __pyx_n_u_IS_getBlockIndices __pyx_string_tab[1689]
#define __pyx_n_u_IS_getBlockSize __pyx_string_tab[1690]
#define __pyx_n_u_IS_getIndices __pyx_string_tab[1691]
#define __pyx_n_u_IS_getInfo __pyx_string_tab[1692]
#define __pyx_n_u_IS_getLocalSize __pyx_string_tab[1693]
#define __pyx_n_u_IS_getSize __pyx_string_tab[1694]
#define __pyx_n_u_IS_getSizes __pyx_string_tab[1695]
#define __pyx_n_u_IS_getStride __pyx_string_tab[1696]
#define __pyx_n_u_IS_getType __pyx_string_tab[1697]
#define __pyx_n_u_IS_intersect __pyx_string_tab[1698]
#define __pyx_n_u_IS_invertPermutation __pyx_string_tab[1699]
#define __pyx_n_u_IS_isIdentity __pyx_string_tab[1700]
#define __pyx_n_u_IS_isPermutation __pyx_string_tab[1701]
#define __pyx_n_u_IS_isSorted __pyx_string_tab[1702]
#define __pyx_n_u_IS_load __pyx_string_tab[1703]
#define __pyx_n_u_IS_partitioningCount __pyx_string_tab[1704]
#define __pyx_n_u_IS_partitioningToNumbering __pyx_string_tab[1705]
#define __pyx_n_u_IS_renumber __pyx_string_tab[1706]
#define __pyx_n_u_IS_setBlockIndices __pyx_string_tab[1707]
#define __pyx_n_u_IS_setBlockSize __pyx_string_tab[1708]
#define __pyx_n_u_IS_setIdentity __pyx_string_tab[1709]
#define __pyx_n_u_IS_setIndices __pyx_string_tab[1710]
#define __pyx_n_u_IS_setPermutation __pyx_string_tab[1711]
#define __pyx_n_u_IS_setStride __pyx_string_tab[1712]
#define __pyx_n_u_IS_setType __pyx_string_tab[1713]
#define __pyx_n_u_IS_sort __pyx_string_tab[1714]
#define __pyx_n_u_IS_sum __pyx_string_tab[1715]
#define __pyx_n_u_IS_toGeneral __pyx_string_tab[1716]
#define __pyx_n_u_IS_union __pyx_string_tab[1717]
#define __pyx_n_u_IS_view __pyx_string_tab[1718]
#define __pyx_n_u_ITERATING __pyx_string_tab[1719]
#define __pyx_n_u_Imat __pyx_string_tab[1720]
#define __pyx_n_u_InfoType __pyx_string_tab[1721]
#define __pyx_n_u_InsertMode __pyx_string_tab[1722]
#define __pyx_n_u_InsertModeSpec __pyx_string_tab[1723]
#define __pyx_n_u_IntType __pyx_string_tab[1724]
#define __pyx_n_u_InterpolationType __pyx_string_tab[1725]
#define __pyx_n_u_Intracomm __pyx_string_tab[1726]
#define __pyx_n_u_J __pyx_string_tab[1727]
#define __pyx_n_u_J0 __pyx_string_tab[1728]
#define __pyx_n_u_JACOBI __pyx_string_tab[1729]
#define __pyx_n_u_Jmat __pyx_string_tab[1730]
#define __pyx_n_u_JoinMode __pyx_string_tab[1731]
#define __pyx_n_u_Jpre __pyx_string_tab[1732]
#define __pyx_n_u_KACZMARZ __pyx_string_tab[1733]
#define __pyx_n_u_KAIJ __pyx_string_tab[1734]
#define __pyx_n_u_KASKADE __pyx_string_tab[1735]
#define __pyx_n_u_KD __pyx_string_tab[1736]
#define __pyx_n_u_KEEP_NONZERO_PATTERN __pyx_string_tab[1737]
#define __pyx_n_u_KLU __pyx_string_tab[1738]
#define __pyx_n_u_KOKKOS __pyx_string_tab[1739]
#define __pyx_n_u_KSP __pyx_string_tab[1740]
#define __pyx_n_u_KSPConvergedReason __pyx_string_tab[1741]
#define __pyx_n_u_KSPConvergenceTestFunction __pyx_string_tab[1742]
#define __pyx_n_u_KSPDMActive __pyx_string_tab[1743]
#define __pyx_n_u_KSPHPDDMType __pyx_string_tab[1744]
#define __pyx_n_u_KSPMonitorFunction __pyx_string_tab[1745]
#define __pyx_n_u_KSPNormType __pyx_string_tab[1746]
#define __pyx_n_u_KSPONLY __pyx_string_tab[1747]
#define __pyx_n_u_KSPOperatorsFunction __pyx_string_tab[1748]
#define __pyx_n_u_KSPRHSFunction __pyx_string_tab[1749]
#define __pyx_n_u_KSPTRANSPOSEONLY __pyx_string_tab[1750]
#define __pyx_n_u_KSPType __pyx_string_tab[1751]
#define __pyx_n_u_KSP_addConvergenceTest __pyx_string_tab[1752]
#define __pyx_n_u_KSP_appendOptionsPrefix __pyx_string_tab[1753]
#define __pyx_n_u_KSP_buildResidual __pyx_string_tab[1754]
#define __pyx_n_u_KSP_buildSolution __pyx_string_tab[1755]
#define __pyx_n_u_KSP_callConvergenceTest __pyx_string_tab[1756]
#define __pyx_n_u_KSP_computeEigenvalues __pyx_string_tab[1757]
#define __pyx_n_u_KSP_computeExtremeSingularValues __pyx_string_tab[1758]
#define __pyx_n_u_KSP_create __pyx_string_tab[1759]
#define __pyx_n_u_KSP_createPython __pyx_string_tab[1760]
#define __pyx_n_u_KSP_destroy __pyx_string_tab[1761]
#define __pyx_n_u_KSP_getAppCtx __pyx_string_tab[1762]
#define __pyx_n_u_KSP_getCGObjectiveValue __pyx_string_tab[1763]
#define __pyx_n_u_KSP_getComputeEigenvalues __pyx_string_tab[1764]
#define __pyx_n_u_KSP_getComputeSingularValues __pyx_string_tab[1765]
#define __pyx_n_u_KSP_getConvergedReason __pyx_string_tab[1766]
#define __pyx_n_u_KSP_getConvergenceHistory __pyx_string_tab[1767]
#define __pyx_n_u_KSP_getConvergenceTest __pyx_string_tab[1768]
#define __pyx_n_u_KSP_getDM __pyx_string_tab[1769]
#define __pyx_n_u_KSP_getErrorIfNotConverged __pyx_string_tab[1770]
#define __pyx_n_u_KSP_getHPDDMType __pyx_string_tab[1771]
#define __pyx_n_u_KSP_getInitialGuessKnoll __pyx_string_tab[1772]
#define __pyx_n_u_KSP_getInitialGuessNonzero __pyx_string_tab[1773]
#define __pyx_n_u_KSP_getIterationNumber __pyx_string_tab[1774]
#define __pyx_n_u_KSP_getMonitor __pyx_string_tab[1775]
#define __pyx_n_u_KSP_getNormType __pyx_string_tab[1776]
#define __pyx_n_u_KSP_getOperators __pyx_string_tab[1777]
#define __pyx_n_u_KSP_getOptionsPrefix __pyx_string_tab[1778]
#define __pyx_n_u_KSP_getPC __pyx_string_tab[1779]
#define __pyx_n_u_KSP_getPCSide __pyx_string_tab[1780]
#define __pyx_n_u_KSP_getPythonContext __pyx_string_tab[1781]
#define __pyx_n_u_KSP_getPythonType __pyx_string_tab[1782]
#define __pyx_n_u_KSP_getResidualNorm __pyx_string_tab[1783]
#define __pyx_n_u_KSP_getRhs __pyx_string_tab[1784]
#define __pyx_n_u_KSP_getSolution __pyx_string_tab[1785]
#define __pyx_n_u_KSP_getTolerances __pyx_string_tab[1786]
#define __pyx_n_u_KSP_getType __pyx_string_tab[1787]
#define __pyx_n_u_KSP_getWorkVecs __pyx_string_tab[1788]
#define __pyx_n_u_KSP_logConvergenceHistory __pyx_string_tab[1789]
#define __pyx_n_u_KSP_matSolve __pyx_string_tab[1790]
#define __pyx_n_u_KSP_matSolveTranspose __pyx_string_tab[1791]
#define __pyx_n_u_KSP_monitor __pyx_string_tab[1792]
#define __pyx_n_u_KSP_monitorCancel __pyx_string_tab[1793]
#define __pyx_n_u_KSP_reset __pyx_string_tab[1794]
#define __pyx_n_u_KSP_setAppCtx __pyx_string_tab[1795]
#define __pyx_n_u_KSP_setComputeEigenvalues __pyx_string_tab[1796]
#define __pyx_n_u_KSP_setComputeOperators __pyx_string_tab[1797]
#define __pyx_n_u_KSP_setComputeRHS __pyx_string_tab[1798]
#define __pyx_n_u_KSP_setComputeSingularValues __pyx_string_tab[1799]
#define __pyx_n_u_KSP_setConvergedReason __pyx_string_tab[1800]
#define __pyx_n_u_KSP_setConvergenceHistory __pyx_string_tab[1801]
#define __pyx_n_u_KSP_setConvergenceTest __pyx_string_tab[1802]
#define __pyx_n_u_KSP_setDM __pyx_string_tab[1803]
#define __pyx_n_u_KSP_setDMActive __pyx_string_tab[1804]
#define __pyx_n_u_KSP_setErrorIfNotConverged __pyx_string_tab[1805]
#define __pyx_n_u_KSP_setFromOptions __pyx_string_tab[1806]
#define __pyx_n_u_KSP_setGMRESRestart __pyx_string_tab[1807]
#define __pyx_n_u_KSP_setHPDDMType __pyx_string_tab[1808]
#define __pyx_n_u_KSP_setInitialGuessKnoll __pyx_string_tab[1809]
#define __pyx_n_u_KSP_setInitialGuessNonzero __pyx_string_tab[1810]
#define __pyx_n_u_KSP_setIterationNumber __pyx_string_tab[1811]
#define __pyx_n_u_KSP_setMonitor __pyx_string_tab[1812]
#define __pyx_n_u_KSP_setNormType __pyx_string_tab[1813]
#define __pyx_n_u_KSP_setOperators __pyx_string_tab[1814]
#define __pyx_n_u_KSP_setOptionsPrefix __pyx_string_tab[1815]
#define __pyx_n_u_KSP_setPC __pyx_string_tab[1816]
#define __pyx_n_u_KSP_setPCSide __pyx_string_tab[1817]
#define __pyx_n_u_KSP_setPostSolve __pyx_string_tab[1818]
#define __pyx_n_u_KSP_setPreSolve __pyx_string_tab[1819]
#define __pyx_n_u_KSP_setPythonContext __pyx_string_tab[1820]
#define __pyx_n_u_KSP_setPythonType __pyx_string_tab[1821]
#define __pyx_n_u_KSP_setResidualNorm __pyx_string_tab[1822]
#define __pyx_n_u_KSP_setTolerances __pyx_string_tab[1823]
#define __pyx_n_u_KSP_setType __pyx_string_tab[1824]
#define __pyx_n_u_KSP_setUp __pyx_string_tab[1825]
#define __pyx_n_u_KSP_setUpOnBlocks __pyx_string_tab[1826]
#define __pyx_n_u_KSP_setUseFischerGuess __pyx_string_tab[1827]
#define __pyx_n_u_KSP_solve __pyx_string_tab[1828]
#define __pyx_n_u_KSP_solveTranspose __pyx_string_tab[1829]
#define __pyx_n_u_KSP_view __pyx_string_tab[1830]
#define __pyx_n_u_L __pyx_string_tab[1831]
#define __pyx_n_u_L1 __pyx_string_tab[1832]
#define __pyx_n_u_LAGRANGE __pyx_string_tab[1833]
#define __pyx_n_u_LASSO __pyx_string_tab[1834]
#define __pyx_n_u_LAYOUT_GAUSS __pyx_string_tab[1835]
#define __pyx_n_u_LAYOUT_REGULAR __pyx_string_tab[1836]
#define __pyx_n_u_LAYOUT_SUBDIVISION __pyx_string_tab[1837]
#define __pyx_n_u_LCD __pyx_string_tab[1838]
#define __pyx_n_u_LCL __pyx_string_tab[1839]
#define __pyx_n_u_LEFT __pyx_string_tab[1840]
#define __pyx_n_u_LGMRES __pyx_string_tab[1841]
#define __pyx_n_u_LGMap __pyx_string_tab[1842]
#define __pyx_n_u_LGMapMapMode __pyx_string_tab[1843]
#define __pyx_n_u_LGMapType __pyx_string_tab[1844]
#define __pyx_n_u_LGMap_apply __pyx_string_tab[1845]
#define __pyx_n_u_LGMap_applyBlock __pyx_string_tab[1846]
#define __pyx_n_u_LGMap_applyBlockInverse __pyx_string_tab[1847]
#define __pyx_n_u_LGMap_applyIS __pyx_string_tab[1848]
#define __pyx_n_u_LGMap_applyInverse __pyx_string_tab[1849]
#define __pyx_n_u_LGMap_create __pyx_string_tab[1850]
#define __pyx_n_u_LGMap_createIS __pyx_string_tab[1851]
#define __pyx_n_u_LGMap_createSF __pyx_string_tab[1852]
#define __pyx_n_u_LGMap_destroy __pyx_string_tab[1853]
#define __pyx_n_u_LGMap_getBlockIndices __pyx_string_tab[1854]
#define __pyx_n_u_LGMap_getBlockInfo __pyx_string_tab[1855]
#define __pyx_n_u_LGMap_getBlockSize __pyx_string_tab[1856]
#define __pyx_n_u_LGMap_getIndices __pyx_string_tab[1857]
#define __pyx_n_u_LGMap_getInfo __pyx_string_tab[1858]
#define __pyx_n_u_LGMap_getSize __pyx_string_tab[1859]
#define __pyx_n_u_LGMap_load __pyx_string_tab[1860]
#define __pyx_n_u_LGMap_setFromOptions __pyx_string_tab[1861]
#define __pyx_n_u_LGMap_setType __pyx_string_tab[1862]
#define __pyx_n_u_LGMap_view __pyx_string_tab[1863]
#define __pyx_n_u_LINEAR __pyx_string_tab[1864]
#define __pyx_n_u_LMVM __pyx_string_tab[1865]
#define __pyx_n_u_LMVMBADBROYDEN __pyx_string_tab[1866]
#define __pyx_n_u_LMVMBFGS __pyx_string_tab[1867]
#define __pyx_n_u_LMVMBROYDEN __pyx_string_tab[1868]
#define __pyx_n_u_LMVMDBFGS __pyx_string_tab[1869]
#define __pyx_n_u_LMVMDDFP __pyx_string_tab[1870]
#define __pyx_n_u_LMVMDFP __pyx_string_tab[1871]
#define __pyx_n_u_LMVMDIAGBBROYDEN __pyx_string_tab[1872]
#define __pyx_n_u_LMVMDQN __pyx_string_tab[1873]
#define __pyx_n_u_LMVMSR1 __pyx_string_tab[1874]
#define __pyx_n_u_LMVMSYMBADBROYDEN __pyx_string_tab[1875]
#define __pyx_n_u_LMVMSYMBROYDEN __pyx_string_tab[1876]
#define __pyx_n_u_LOAD_BALANCE __pyx_string_tab[1877]
#define __pyx_n_u_LOCAL __pyx_string_tab[1878]
#define __pyx_n_u_LOCALREF __pyx_string_tab[1879]
#define __pyx_n_u_LOCAL_BACKWARD_SWEEP __pyx_string_tab[1880]
#define __pyx_n_u_LOCAL_FORWARD_SWEEP __pyx_string_tab[1881]
#define __pyx_n_u_LOCAL_SYMMETRIC_SWEEP __pyx_string_tab[1882]
#define __pyx_n_u_LOWER __pyx_string_tab[1883]
#define __pyx_n_u_LPY __pyx_string_tab[1884]
#define __pyx_n_u_LRC __pyx_string_tab[1885]
#define __pyx_n_u_LSC __pyx_string_tab[1886]
#define __pyx_n_u_LSQR __pyx_string_tab[1887]
#define __pyx_n_u_LSTART __pyx_string_tab[1888]
#define __pyx_n_u_LU __pyx_string_tab[1889]
#define __pyx_n_u_LUSOL __pyx_string_tab[1890]
#define __pyx_n_u_LayoutSizeSpec __pyx_string_tab[1891]
#define __pyx_n_u_Left __pyx_string_tab[1892]
#define __pyx_n_u_LinearType __pyx_string_tab[1893]
#define __pyx_n_u_Log __pyx_string_tab[1894]
#define __pyx_n_u_LogClass __pyx_string_tab[1895]
#define __pyx_n_u_LogClass_activate __pyx_string_tab[1896]
#define __pyx_n_u_LogClass_deactivate __pyx_string_tab[1897]
#define __pyx_n_u_LogClass_getActive __pyx_string_tab[1898]
#define __pyx_n_u_LogClass_getName __pyx_string_tab[1899]
#define __pyx_n_u_LogClass_setActive __pyx_string_tab[1900]
#define __pyx_n_u_LogEvent __pyx_string_tab[1901]
#define __pyx_n_u_LogEvent___enter __pyx_string_tab[1902]
#define __pyx_n_u_LogEvent___exit __pyx_string_tab[1903]
#define __pyx_n_u_LogEvent_activate __pyx_string_tab[1904]
#define __pyx_n_u_LogEvent_begin __pyx_string_tab[1905]
#define __pyx_n_u_LogEvent_deactivate __pyx_string_tab[1906]
#define __pyx_n_u_LogEvent_end __pyx_string_tab[1907]
#define __pyx_n_u_LogEvent_getActive __pyx_string_tab[1908]
#define __pyx_n_u_LogEvent_getActiveAll __pyx_string_tab[1909]
#define __pyx_n_u_LogEvent_getName __pyx_string_tab[1910]
#define __pyx_n_u_LogEvent_getPerfInfo __pyx_string_tab[1911]
#define __pyx_n_u_LogEvent_setActive __pyx_string_tab[1912]
#define __pyx_n_u_LogEvent_setActiveAll __pyx_string_tab[1913]
#define __pyx_n_u_LogStage __pyx_string_tab[1914]
#define __pyx_n_u_LogStage___enter __pyx_string_tab[1915]
#define __pyx_n_u_LogStage___exit __pyx_string_tab[1916]
#define __pyx_n_u_LogStage_activate __pyx_string_tab[1917]
#define __pyx_n_u_LogStage_deactivate __pyx_string_tab[1918]
#define __pyx_n_u_LogStage_getActive __pyx_string_tab[1919]
#define __pyx_n_u_LogStage_getName __pyx_string_tab[1920]
#define __pyx_n_u_LogStage_getVisible __pyx_string_tab[1921]
#define __pyx_n_u_LogStage_pop __pyx_string_tab[1922]
#define __pyx_n_u_LogStage_push __pyx_string_tab[1923]
#define __pyx_n_u_LogStage_setActive __pyx_string_tab[1924]
#define __pyx_n_u_LogStage_setVisible __pyx_string_tab[1925]
#define __pyx_n_u_Log_Class __pyx_string_tab[1926]
#define __pyx_n_u_Log_Event __pyx_string_tab[1927]
#define __pyx_n_u_Log_EventDecorator __pyx_string_tab[1928]
#define __pyx_n_u_Log_Stage __pyx_string_tab[1929]
#define __pyx_n_u_Log_addFlops __pyx_string_tab[1930]
#define __pyx_n_u_Log_begin __pyx_string_tab[1931]
#define __pyx_n_u_Log_getCPUTime __pyx_string_tab[1932]
#define __pyx_n_u_Log_getFlops __pyx_string_tab[1933]
#define __pyx_n_u_Log_getTime __pyx_string_tab[1934]
#define __pyx_n_u_Log_isActive __pyx_string_tab[1935]
#define __pyx_n_u_Log_logFlops __pyx_string_tab[1936]
#define __pyx_n_u_Log_view __pyx_string_tab[1937]
#define __pyx_n_u_Lstart __pyx_string_tab[1938]
#define __pyx_n_u_Lvec __pyx_string_tab[1939]
#define __pyx_n_u_M __pyx_string_tab[1940]
#define __pyx_n_u_MAIJ __pyx_string_tab[1941]
#define __pyx_n_u_MAPPING __pyx_string_tab[1942]
#define __pyx_n_u_MASK __pyx_string_tab[1943]
#define __pyx_n_u_MAT __pyx_string_tab[1944]
#define __pyx_n_u_MATCHSTEP __pyx_string_tab[1945]
#define __pyx_n_u_MATHEMATICA __pyx_string_tab[1946]
#define __pyx_n_u_MATLAB __pyx_string_tab[1947]
#define __pyx_n_u_MATPARTITIONING __pyx_string_tab[1948]
#define __pyx_n_u_MAX __pyx_string_tab[1949]
#define __pyx_n_u_MAXCELL __pyx_string_tab[1950]
#define __pyx_n_u_MAX_VALUES __pyx_string_tab[1951]
#define __pyx_n_u_MEMORYSCALABLE __pyx_string_tab[1952]
#define __pyx_n_u_METISND __pyx_string_tab[1953]
#define __pyx_n_u_MEYER __pyx_string_tab[1954]
#define __pyx_n_u_MFFD __pyx_string_tab[1955]
#define __pyx_n_u_MG __pyx_string_tab[1956]
#define __pyx_n_u_MGCycleType __pyx_string_tab[1957]
#define __pyx_n_u_MGType __pyx_string_tab[1958]
#define __pyx_n_u_MIGRATE_BASIC __pyx_string_tab[1959]
#define __pyx_n_u_MIGRATE_DMCELLEXACT __pyx_string_tab[1960]
#define __pyx_n_u_MIGRATE_DMCELLNSCATTER __pyx_string_tab[1961]
#define __pyx_n_u_MIGRATE_USER __pyx_string_tab[1962]
#define __pyx_n_u_MIMEX __pyx_string_tab[1963]
#define __pyx_n_u_MINRES __pyx_string_tab[1964]
#define __pyx_n_u_MIRROR __pyx_string_tab[1965]
#define __pyx_n_u_MKL_CPARDISO __pyx_string_tab[1966]
#define __pyx_n_u_MKL_PARDISO __pyx_string_tab[1967]
#define __pyx_n_u_ML __pyx_string_tab[1968]
#define __pyx_n_u_MOAB __pyx_string_tab[1969]
#define __pyx_n_u_MORETHUENTE __pyx_string_tab[1970]
#define __pyx_n_u_MPI __pyx_string_tab[1971]
#define __pyx_n_u_MPIADJ __pyx_string_tab[1972]
#define __pyx_n_u_MPIAIJ __pyx_string_tab[1973]
#define __pyx_n_u_MPIAIJCRL __pyx_string_tab[1974]
#define __pyx_n_u_MPIAIJCUSPARSE __pyx_string_tab[1975]
#define __pyx_n_u_MPIAIJMKL __pyx_string_tab[1976]
#define __pyx_n_u_MPIAIJPERM __pyx_string_tab[1977]
#define __pyx_n_u_MPIAIJSELL __pyx_string_tab[1978]
#define __pyx_n_u_MPIAIJVIENNACL __pyx_string_tab[1979]
#define __pyx_n_u_MPIBAIJ __pyx_string_tab[1980]
#define __pyx_n_u_MPIBAIJMKL __pyx_string_tab[1981]
#define __pyx_n_u_MPICUDA __pyx_string_tab[1982]
#define __pyx_n_u_MPIDENSE __pyx_string_tab[1983]
#define __pyx_n_u_MPIDENSECUDA __pyx_string_tab[1984]
#define __pyx_n_u_MPIDENSEHIP __pyx_string_tab[1985]
#define __pyx_n_u_MPIHIP __pyx_string_tab[1986]
#define __pyx_n_u_MPIKAIJ __pyx_string_tab[1987]
#define __pyx_n_u_MPIKOKKOS __pyx_string_tab[1988]
#define __pyx_n_u_MPIMAIJ __pyx_string_tab[1989]
#define __pyx_n_u_MPISBAIJ __pyx_string_tab[1990]
#define __pyx_n_u_MPISELL __pyx_string_tab[1991]
#define __pyx_n_u_MPIVIENNACL __pyx_string_tab[1992]
#define __pyx_n_u_MPRK __pyx_string_tab[1993]
#define __pyx_n_u_MS __pyx_string_tab[1994]
#define __pyx_n_u_MULTIPLICATIVE __pyx_string_tab[1995]
#define __pyx_n_u_MULTISTAGE __pyx_string_tab[1996]
#define __pyx_n_u_MUMPS __pyx_string_tab[1997]
#define __pyx_n_u_MapMode __pyx_string_tab[1998]
#define __pyx_n_u_Mat __pyx_string_tab[1999]
#define __pyx_n_u_MatAssemblySpec __pyx_string_tab[2000]
#define __pyx_n_u_MatAssemblyType __pyx_string_tab[2001]
#define __pyx_n_u_MatBlockSizeSpec __pyx_string_tab[2002]
#define __pyx_n_u_MatDuplicateOption __pyx_string_tab[2003]
#define __pyx_n_u_MatFactorShiftType __pyx_string_tab[2004]
#define __pyx_n_u_MatHtoolKernelFunction __pyx_string_tab[2005]
#define __pyx_n_u_MatInfoType __pyx_string_tab[2006]
#define __pyx_n_u_MatNullFunction __pyx_string_tab[2007]
#define __pyx_n_u_MatOption __pyx_string_tab[2008]
#define __pyx_n_u_MatOrderingType __pyx_string_tab[2009]
#define __pyx_n_u_MatPartitioning __pyx_string_tab[2010]
#define __pyx_n_u_MatPartitioningType __pyx_string_tab[2011]
#define __pyx_n_u_MatPartitioning_apply __pyx_string_tab[2012]
#define __pyx_n_u_MatPartitioning_create __pyx_string_tab[2013]
#define __pyx_n_u_MatPartitioning_destroy __pyx_string_tab[2014]
#define __pyx_n_u_MatPartitioning_getType __pyx_string_tab[2015]
#define __pyx_n_u_MatPartitioning_setAdjacency __pyx_string_tab[2016]
#define __pyx_n_u_MatPartitioning_setFromOptions __pyx_string_tab[2017]
#define __pyx_n_u_MatPartitioning_setType __pyx_string_tab[2018]
#define __pyx_n_u_MatPartitioning_view __pyx_string_tab[2019]
#define __pyx_n_u_MatSORType __pyx_string_tab[2020]
#define __pyx_n_u_MatSizeSpec __pyx_string_tab[2021]
#define __pyx_n_u_MatSolverType __pyx_string_tab[2022]
#define __pyx_n_u_MatStructure __pyx_string_tab[2023]
#define __pyx_n_u_MatType __pyx_string_tab[2024]
#define __pyx_n_u_Mat_H2OpusCompress __pyx_string_tab[2025]
#define __pyx_n_u_Mat_H2OpusLowRankUpdate __pyx_string_tab[2026]
#define __pyx_n_u_Mat_H2OpusOrthogonalize __pyx_string_tab[2027]
#define __pyx_n_u_Mat_HtoolGetPermutationSource __pyx_string_tab[2028]
#define __pyx_n_u_Mat_HtoolGetPermutationTarget __pyx_string_tab[2029]
#define __pyx_n_u_Mat_HtoolUsePermutation __pyx_string_tab[2030]
#define __pyx_n_u_Mat_HtoolUseRecompression __pyx_string_tab[2031]
#define __pyx_n_u_Mat_SOR __pyx_string_tab[2032]
#define __pyx_n_u_Mat___div __pyx_string_tab[2033]
#define __pyx_n_u_Mat___dlpack __pyx_string_tab[2034]
#define __pyx_n_u_Mat___dlpack_device __pyx_string_tab[2035]
#define __pyx_n_u_Mat___idiv __pyx_string_tab[2036]
#define __pyx_n_u_Mat___rdiv __pyx_string_tab[2037]
#define __pyx_n_u_Mat_allocateLMVM __pyx_string_tab[2038]
#define __pyx_n_u_Mat_appendOptionsPrefix __pyx_string_tab[2039]
#define __pyx_n_u_Mat_assemble __pyx_string_tab[2040]
#define __pyx_n_u_Mat_assemblyBegin __pyx_string_tab[2041]
#define __pyx_n_u_Mat_assemblyEnd __pyx_string_tab[2042]
#define __pyx_n_u_Mat_axpy __pyx_string_tab[2043]
#define __pyx_n_u_Mat_aypx __pyx_string_tab[2044]
#define __pyx_n_u_Mat_bindToCPU __pyx_string_tab[2045]
#define __pyx_n_u_Mat_boundToCPU __pyx_string_tab[2046]
#define __pyx_n_u_Mat_chop __pyx_string_tab[2047]
#define __pyx_n_u_Mat_conjugate __pyx_string_tab[2048]
#define __pyx_n_u_Mat_convert __pyx_string_tab[2049]
#define __pyx_n_u_Mat_copy __pyx_string_tab[2050]
#define __pyx_n_u_Mat_create __pyx_string_tab[2051]
#define __pyx_n_u_Mat_createAIJ __pyx_string_tab[2052]
#define __pyx_n_u_Mat_createAIJCRL __pyx_string_tab[2053]
#define __pyx_n_u_Mat_createAIJWithArrays __pyx_string_tab[2054]
#define __pyx_n_u_Mat_createBAIJ __pyx_string_tab[2055]
#define __pyx_n_u_Mat_createConstantDiagonal __pyx_string_tab[2056]
#define __pyx_n_u_Mat_createDense __pyx_string_tab[2057]
#define __pyx_n_u_Mat_createDenseCUDA __pyx_string_tab[2058]
#define __pyx_n_u_Mat_createDiagonal __pyx_string_tab[2059]
#define __pyx_n_u_Mat_createH2OpusFromMat __pyx_string_tab[2060]
#define __pyx_n_u_Mat_createHermitianTranspose __pyx_string_tab[2061]
#define __pyx_n_u_Mat_createHtoolFromKernel __pyx_string_tab[2062]
#define __pyx_n_u_Mat_createIS __pyx_string_tab[2063]
#define __pyx_n_u_Mat_createLRC __pyx_string_tab[2064]
#define __pyx_n_u_Mat_createNest __pyx_string_tab[2065]
#define __pyx_n_u_Mat_createNormal __pyx_string_tab[2066]
#define __pyx_n_u_Mat_createNormalHermitian __pyx_string_tab[2067]
#define __pyx_n_u_Mat_createPython __pyx_string_tab[2068]
#define __pyx_n_u_Mat_createSBAIJ __pyx_string_tab[2069]
#define __pyx_n_u_Mat_createScatter __pyx_string_tab[2070]
#define __pyx_n_u_Mat_createSchurComplement __pyx_string_tab[2071]
#define __pyx_n_u_Mat_createSubMatrices __pyx_string_tab[2072]
#define __pyx_n_u_Mat_createSubMatrix __pyx_string_tab[2073]
#define __pyx_n_u_Mat_createSubMatrixVirtual __pyx_string_tab[2074]
#define __pyx_n_u_Mat_createTranspose __pyx_string_tab[2075]
#define __pyx_n_u_Mat_createVecLeft __pyx_string_tab[2076]
#define __pyx_n_u_Mat_createVecRight __pyx_string_tab[2077]
#define __pyx_n_u_Mat_createVecs __pyx_string_tab[2078]
#define __pyx_n_u_Mat_destroy __pyx_string_tab[2079]
#define __pyx_n_u_Mat_diagonalScale __pyx_string_tab[2080]
#define __pyx_n_u_Mat_duplicate __pyx_string_tab[2081]
#define __pyx_n_u_Mat_equal __pyx_string_tab[2082]
#define __pyx_n_u_Mat_factorCholesky __pyx_string_tab[2083]
#define __pyx_n_u_Mat_factorICC __pyx_string_tab[2084]
#define __pyx_n_u_Mat_factorILU __pyx_string_tab[2085]
#define __pyx_n_u_Mat_factorLU __pyx_string_tab[2086]
#define __pyx_n_u_Mat_factorNumericCholesky __pyx_string_tab[2087]
#define __pyx_n_u_Mat_factorNumericLU __pyx_string_tab[2088]
#define __pyx_n_u_Mat_factorSymbolicCholesky __pyx_string_tab[2089]
#define __pyx_n_u_Mat_factorSymbolicICC __pyx_string_tab[2090]
#define __pyx_n_u_Mat_factorSymbolicILU __pyx_string_tab[2091]
#define __pyx_n_u_Mat_factorSymbolicLU __pyx_string_tab[2092]
#define __pyx_n_u_Mat_findZeroRows __pyx_string_tab[2093]
#define __pyx_n_u_Mat_fixISLocalEmpty __pyx_string_tab[2094]
#define __pyx_n_u_Mat_getBlockSize __pyx_string_tab[2095]
#define __pyx_n_u_Mat_getBlockSizes __pyx_string_tab[2096]
#define __pyx_n_u_Mat_getColumnIJ __pyx_string_tab[2097]
#define __pyx_n_u_Mat_getColumnVector __pyx_string_tab[2098]
#define __pyx_n_u_Mat_getDM __pyx_string_tab[2099]
#define __pyx_n_u_Mat_getDenseArray __pyx_string_tab[2100]
#define __pyx_n_u_Mat_getDenseColumnVec __pyx_string_tab[2101]
#define __pyx_n_u_Mat_getDenseLDA __pyx_string_tab[2102]
#define __pyx_n_u_Mat_getDenseLocalMatrix __pyx_string_tab[2103]
#define __pyx_n_u_Mat_getDenseSubMatrix __pyx_string_tab[2104]
#define __pyx_n_u_Mat_getDiagonal __pyx_string_tab[2105]
#define __pyx_n_u_Mat_getDiagonalBlock __pyx_string_tab[2106]
#define __pyx_n_u_Mat_getISAllowRepeated __pyx_string_tab[2107]
#define __pyx_n_u_Mat_getISLocalMat __pyx_string_tab[2108]
#define __pyx_n_u_Mat_getInertia __pyx_string_tab[2109]
#define __pyx_n_u_Mat_getInfo __pyx_string_tab[2110]
#define __pyx_n_u_Mat_getLGMap __pyx_string_tab[2111]
#define __pyx_n_u_Mat_getLMVMJ0 __pyx_string_tab[2112]
#define __pyx_n_u_Mat_getLMVMJ0KSP __pyx_string_tab[2113]
#define __pyx_n_u_Mat_getLRCMats __pyx_string_tab[2114]
#define __pyx_n_u_Mat_getLocalSize __pyx_string_tab[2115]
#define __pyx_n_u_Mat_getLocalSubMatrix __pyx_string_tab[2116]
#define __pyx_n_u_Mat_getMumpsCntl __pyx_string_tab[2117]
#define __pyx_n_u_Mat_getMumpsIcntl __pyx_string_tab[2118]
#define __pyx_n_u_Mat_getMumpsInfo __pyx_string_tab[2119]
#define __pyx_n_u_Mat_getMumpsInfog __pyx_string_tab[2120]
#define __pyx_n_u_Mat_getMumpsRinfo __pyx_string_tab[2121]
#define __pyx_n_u_Mat_getMumpsRinfog __pyx_string_tab[2122]
#define __pyx_n_u_Mat_getNearNullSpace __pyx_string_tab[2123]
#define __pyx_n_u_Mat_getNestISs __pyx_string_tab[2124]
#define __pyx_n_u_Mat_getNestLocalISs __pyx_string_tab[2125]
#define __pyx_n_u_Mat_getNestSize __pyx_string_tab[2126]
#define __pyx_n_u_Mat_getNestSubMatrix __pyx_string_tab[2127]
#define __pyx_n_u_Mat_getNullSpace __pyx_string_tab[2128]
#define __pyx_n_u_Mat_getOption __pyx_string_tab[2129]
#define __pyx_n_u_Mat_getOptionsPrefix __pyx_string_tab[2130]
#define __pyx_n_u_Mat_getOrdering __pyx_string_tab[2131]
#define __pyx_n_u_Mat_getOwnershipIS __pyx_string_tab[2132]
#define __pyx_n_u_Mat_getOwnershipRange __pyx_string_tab[2133]
#define __pyx_n_u_Mat_getOwnershipRangeColumn __pyx_string_tab[2134]
#define __pyx_n_u_Mat_getOwnershipRanges __pyx_string_tab[2135]
#define __pyx_n_u_Mat_getOwnershipRangesColumn __pyx_string_tab[2136]
#define __pyx_n_u_Mat_getPythonContext __pyx_string_tab[2137]
#define __pyx_n_u_Mat_getPythonType __pyx_string_tab[2138]
#define __pyx_n_u_Mat_getRedundantMatrix __pyx_string_tab[2139]
#define __pyx_n_u_Mat_getRow __pyx_string_tab[2140]
#define __pyx_n_u_Mat_getRowIJ __pyx_string_tab[2141]
#define __pyx_n_u_Mat_getRowSum __pyx_string_tab[2142]
#define __pyx_n_u_Mat_getSchurComplementSubMatrice __pyx_string_tab[2143]
#define __pyx_n_u_Mat_getSize __pyx_string_tab[2144]
#define __pyx_n_u_Mat_getSizes __pyx_string_tab[2145]
#define __pyx_n_u_Mat_getTransposeMat __pyx_string_tab[2146]
#define __pyx_n_u_Mat_getTransposeNullSpace __pyx_string_tab[2147]
#define __pyx_n_u_Mat_getType __pyx_string_tab[2148]
#define __pyx_n_u_Mat_getValue __pyx_string_tab[2149]
#define __pyx_n_u_Mat_getValues __pyx_string_tab[2150]
#define __pyx_n_u_Mat_getValuesCSR __pyx_string_tab[2151]
#define __pyx_n_u_Mat_getVecType __pyx_string_tab[2152]
#define __pyx_n_u_Mat_hermitianTranspose __pyx_string_tab[2153]
#define __pyx_n_u_Mat_imagPart __pyx_string_tab[2154]
#define __pyx_n_u_Mat_increaseOverlap __pyx_string_tab[2155]
#define __pyx_n_u_Mat_invertBlockDiagonal __pyx_string_tab[2156]
#define __pyx_n_u_Mat_isAssembled __pyx_string_tab[2157]
#define __pyx_n_u_Mat_isHermitian __pyx_string_tab[2158]
#define __pyx_n_u_Mat_isHermitianKnown __pyx_string_tab[2159]
#define __pyx_n_u_Mat_isLinear __pyx_string_tab[2160]
#define __pyx_n_u_Mat_isStructurallySymmetric __pyx_string_tab[2161]
#define __pyx_n_u_Mat_isSymmetric __pyx_string_tab[2162]
#define __pyx_n_u_Mat_isSymmetricKnown __pyx_string_tab[2163]
#define __pyx_n_u_Mat_isTranspose __pyx_string_tab[2164]
#define __pyx_n_u_Mat_kron __pyx_string_tab[2165]
#define __pyx_n_u_Mat_load __pyx_string_tab[2166]
#define __pyx_n_u_Mat_matMatMult __pyx_string_tab[2167]
#define __pyx_n_u_Mat_matMult __pyx_string_tab[2168]
#define __pyx_n_u_Mat_matSolve __pyx_string_tab[2169]
#define __pyx_n_u_Mat_matTransposeMult __pyx_string_tab[2170]
#define __pyx_n_u_Mat_mult __pyx_string_tab[2171]
#define __pyx_n_u_Mat_multAdd __pyx_string_tab[2172]
#define __pyx_n_u_Mat_multHermitian __pyx_string_tab[2173]
#define __pyx_n_u_Mat_multHermitianAdd __pyx_string_tab[2174]
#define __pyx_n_u_Mat_multTranspose __pyx_string_tab[2175]
#define __pyx_n_u_Mat_multTransposeAdd __pyx_string_tab[2176]
#define __pyx_n_u_Mat_norm __pyx_string_tab[2177]
#define __pyx_n_u_Mat_permute __pyx_string_tab[2178]
#define __pyx_n_u_Mat_preallocatorPreallocate __pyx_string_tab[2179]
#define __pyx_n_u_Mat_ptap __pyx_string_tab[2180]
#define __pyx_n_u_Mat_rart __pyx_string_tab[2181]
#define __pyx_n_u_Mat_realPart __pyx_string_tab[2182]
#define __pyx_n_u_Mat_reorderForNonzeroDiagonal __pyx_string_tab[2183]
#define __pyx_n_u_Mat_resetLMVM __pyx_string_tab[2184]
#define __pyx_n_u_Mat_restoreDenseColumnVec __pyx_string_tab[2185]
#define __pyx_n_u_Mat_restoreDenseSubMatrix __pyx_string_tab[2186]
#define __pyx_n_u_Mat_restoreISLocalMat __pyx_string_tab[2187]
#define __pyx_n_u_Mat_restoreLocalSubMatrix __pyx_string_tab[2188]
#define __pyx_n_u_Mat_retrieveValues __pyx_string_tab[2189]
#define __pyx_n_u_Mat_scale __pyx_string_tab[2190]
#define __pyx_n_u_Mat_setBlockSize __pyx_string_tab[2191]
#define __pyx_n_u_Mat_setBlockSizes __pyx_string_tab[2192]
#define __pyx_n_u_Mat_setDM __pyx_string_tab[2193]
#define __pyx_n_u_Mat_setDenseLDA __pyx_string_tab[2194]
#define __pyx_n_u_Mat_setDiagonal __pyx_string_tab[2195]
#define __pyx_n_u_Mat_setFromOptions __pyx_string_tab[2196]
#define __pyx_n_u_Mat_setISAllowRepeated __pyx_string_tab[2197]
#define __pyx_n_u_Mat_setISLocalMat __pyx_string_tab[2198]
#define __pyx_n_u_Mat_setISPreallocation __pyx_string_tab[2199]
#define __pyx_n_u_Mat_setLGMap __pyx_string_tab[2200]
#define __pyx_n_u_Mat_setLMVMJ0 __pyx_string_tab[2201]
#define __pyx_n_u_Mat_setLMVMJ0KSP __pyx_string_tab[2202]
#define __pyx_n_u_Mat_setLRCMats __pyx_string_tab[2203]
#define __pyx_n_u_Mat_setMumpsCntl __pyx_string_tab[2204]
#define __pyx_n_u_Mat_setMumpsIcntl __pyx_string_tab[2205]
#define __pyx_n_u_Mat_setNearNullSpace __pyx_string_tab[2206]
#define __pyx_n_u_Mat_setNestVecType __pyx_string_tab[2207]
#define __pyx_n_u_Mat_setNullSpace __pyx_string_tab[2208]
#define __pyx_n_u_Mat_setOption __pyx_string_tab[2209]
#define __pyx_n_u_Mat_setOptionsPrefix __pyx_string_tab[2210]
#define __pyx_n_u_Mat_setPreallocationCOO __pyx_string_tab[2211]
#define __pyx_n_u_Mat_setPreallocationCOOLocal __pyx_string_tab[2212]
#define __pyx_n_u_Mat_setPreallocationCSR __pyx_string_tab[2213]
#define __pyx_n_u_Mat_setPreallocationDense __pyx_string_tab[2214]
#define __pyx_n_u_Mat_setPreallocationNNZ __pyx_string_tab[2215]
#define __pyx_n_u_Mat_setPythonContext __pyx_string_tab[2216]
#define __pyx_n_u_Mat_setPythonType __pyx_string_tab[2217]
#define __pyx_n_u_Mat_setRandom __pyx_string_tab[2218]
#define __pyx_n_u_Mat_setSizes __pyx_string_tab[2219]
#define __pyx_n_u_Mat_setStencil __pyx_string_tab[2220]
#define __pyx_n_u_Mat_setTransposeNullSpace __pyx_string_tab[2221]
#define __pyx_n_u_Mat_setTransposePrecursor __pyx_string_tab[2222]
#define __pyx_n_u_Mat_setType __pyx_string_tab[2223]
#define __pyx_n_u_Mat_setUnfactored __pyx_string_tab[2224]
#define __pyx_n_u_Mat_setUp __pyx_string_tab[2225]
#define __pyx_n_u_Mat_setValue __pyx_string_tab[2226]
#define __pyx_n_u_Mat_setValueBlockedStagStencil __pyx_string_tab[2227]
#define __pyx_n_u_Mat_setValueBlockedStencil __pyx_string_tab[2228]
#define __pyx_n_u_Mat_setValueLocal __pyx_string_tab[2229]
#define __pyx_n_u_Mat_setValueStagStencil __pyx_string_tab[2230]
#define __pyx_n_u_Mat_setValueStencil __pyx_string_tab[2231]
#define __pyx_n_u_Mat_setValues __pyx_string_tab[2232]
#define __pyx_n_u_Mat_setValuesBlocked __pyx_string_tab[2233]
#define __pyx_n_u_Mat_setValuesBlockedCSR __pyx_string_tab[2234]
#define __pyx_n_u_Mat_setValuesBlockedIJV __pyx_string_tab[2235]
#define __pyx_n_u_Mat_setValuesBlockedLocal __pyx_string_tab[2236]
#define __pyx_n_u_Mat_setValuesBlockedLocalCSR __pyx_string_tab[2237]
#define __pyx_n_u_Mat_setValuesBlockedLocalIJV __pyx_string_tab[2238]
#define __pyx_n_u_Mat_setValuesBlockedLocalRCV __pyx_string_tab[2239]
#define __pyx_n_u_Mat_setValuesBlockedRCV __pyx_string_tab[2240]
#define __pyx_n_u_Mat_setValuesCOO __pyx_string_tab[2241]
#define __pyx_n_u_Mat_setValuesCSR __pyx_string_tab[2242]
#define __pyx_n_u_Mat_setValuesIJV __pyx_string_tab[2243]
#define __pyx_n_u_Mat_setValuesLocal __pyx_string_tab[2244]
#define __pyx_n_u_Mat_setValuesLocalCSR __pyx_string_tab[2245]
#define __pyx_n_u_Mat_setValuesLocalIJV __pyx_string_tab[2246]
#define __pyx_n_u_Mat_setValuesLocalRCV __pyx_string_tab[2247]
#define __pyx_n_u_Mat_setValuesRCV __pyx_string_tab[2248]
#define __pyx_n_u_Mat_setVariableBlockSizes __pyx_string_tab[2249]
#define __pyx_n_u_Mat_setVecType __pyx_string_tab[2250]
#define __pyx_n_u_Mat_shift __pyx_string_tab[2251]
#define __pyx_n_u_Mat_solve __pyx_string_tab[2252]
#define __pyx_n_u_Mat_solveAdd __pyx_string_tab[2253]
#define __pyx_n_u_Mat_solveBackward __pyx_string_tab[2254]
#define __pyx_n_u_Mat_solveForward __pyx_string_tab[2255]
#define __pyx_n_u_Mat_solveTranspose __pyx_string_tab[2256]
#define __pyx_n_u_Mat_solveTransposeAdd __pyx_string_tab[2257]
#define __pyx_n_u_Mat_storeValues __pyx_string_tab[2258]
#define __pyx_n_u_Mat_toDLPack __pyx_string_tab[2259]
#define __pyx_n_u_Mat_transpose __pyx_string_tab[2260]
#define __pyx_n_u_Mat_transposeMatMult __pyx_string_tab[2261]
#define __pyx_n_u_Mat_updateLMVM __pyx_string_tab[2262]
#define __pyx_n_u_Mat_view __pyx_string_tab[2263]
#define __pyx_n_u_Mat_zeroEntries __pyx_string_tab[2264]
#define __pyx_n_u_Mat_zeroRows __pyx_string_tab[2265]
#define __pyx_n_u_Mat_zeroRowsColumns __pyx_string_tab[2266]
#define __pyx_n_u_Mat_zeroRowsColumnsLocal __pyx_string_tab[2267]
#define __pyx_n_u_Mat_zeroRowsColumnsStencil __pyx_string_tab[2268]
#define __pyx_n_u_Mat_zeroRowsLocal __pyx_string_tab[2269]
#define __pyx_n_u_MigrateType __pyx_string_tab[2270]
#define __pyx_n_u_Mode __pyx_string_tab[2271]
#define __pyx_n_u_N __pyx_string_tab[2272]
#define __pyx_n_u_N1 __pyx_string_tab[2273]
#define __pyx_n_u_N12 __pyx_string_tab[2274]
#define __pyx_n_u_N2 __pyx_string_tab[2275]
#define __pyx_n_u_NASH __pyx_string_tab[2276]
#define __pyx_n_u_NASM __pyx_string_tab[2277]
#define __pyx_n_u_NATIVE __pyx_string_tab[2278]
#define __pyx_n_u_NATURAL __pyx_string_tab[2279]
#define __pyx_n_u_NCG __pyx_string_tab[2280]
#define __pyx_n_u_NCGLINEAR __pyx_string_tab[2281]
#define __pyx_n_u_ND __pyx_string_tab[2282]
#define __pyx_n_u_ND_Pi __pyx_string_tab[2283]
#define __pyx_n_u_ND_Pi_Full __pyx_string_tab[2284]
#define __pyx_n_u_ND_Pi_mat __pyx_string_tab[2285]
#define __pyx_n_u_ND_full_mat __pyx_string_tab[2286]
#define __pyx_n_u_NEIGHBOR __pyx_string_tab[2287]
#define __pyx_n_u_NEST __pyx_string_tab[2288]
#define __pyx_n_u_NETWORK __pyx_string_tab[2289]
#define __pyx_n_u_NEWTONAL __pyx_string_tab[2290]
#define __pyx_n_u_NEWTONLS __pyx_string_tab[2291]
#define __pyx_n_u_NEWTONTR __pyx_string_tab[2292]
#define __pyx_n_u_NEW_NONZERO_ALLOCATION_ERR __pyx_string_tab[2293]
#define __pyx_n_u_NEW_NONZERO_LOCATIONS __pyx_string_tab[2294]
#define __pyx_n_u_NEW_NONZERO_LOCATION_ERR __pyx_string_tab[2295]
#define __pyx_n_u_NGMRES __pyx_string_tab[2296]
#define __pyx_n_u_NGS __pyx_string_tab[2297]
#define __pyx_n_u_NINFINITY __pyx_string_tab[2298]
#define __pyx_n_u_NLEQERR __pyx_string_tab[2299]
#define __pyx_n_u_NLS __pyx_string_tab[2300]
#define __pyx_n_u_NM __pyx_string_tab[2301]
#define __pyx_n_u_NN __pyx_string_tab[2302]
#define __pyx_n_u_NNZSpec __pyx_string_tab[2303]
#define __pyx_n_u_NO __pyx_string_tab[2304]
#define __pyx_n_u_NOERROR __pyx_string_tab[2305]
#define __pyx_n_u_NOFORMAT __pyx_string_tab[2306]
#define __pyx_n_u_NONBLOCKING __pyx_string_tab[2307]
#define __pyx_n_u_NONBLOCKING_WITH_BARRIER __pyx_string_tab[2308]
#define __pyx_n_u_NONE __pyx_string_tab[2309]
#define __pyx_n_u_NONLINEAR __pyx_string_tab[2310]
#define __pyx_n_u_NONZERO __pyx_string_tab[2311]
#define __pyx_n_u_NORMAL __pyx_string_tab[2312]
#define __pyx_n_u_NORMALHERMITIAN __pyx_string_tab[2313]
#define __pyx_n_u_NORM_1 __pyx_string_tab[2314]
#define __pyx_n_u_NORM_1_AND_2 __pyx_string_tab[2315]
#define __pyx_n_u_NORM_2 __pyx_string_tab[2316]
#define __pyx_n_u_NORM_ALWAYS __pyx_string_tab[2317]
#define __pyx_n_u_NORM_DEFAULT __pyx_string_tab[2318]
#define __pyx_n_u_NORM_FINAL_ONLY __pyx_string_tab[2319]
#define __pyx_n_u_NORM_FROBENIUS __pyx_string_tab[2320]
#define __pyx_n_u_NORM_INFINITY __pyx_string_tab[2321]
#define __pyx_n_u_NORM_INITIAL_FINAL_ONLY __pyx_string_tab[2322]
#define __pyx_n_u_NORM_INITIAL_ONLY __pyx_string_tab[2323]
#define __pyx_n_u_NORM_MAX __pyx_string_tab[2324]
#define __pyx_n_u_NORM_NATURAL __pyx_string_tab[2325]
#define __pyx_n_u_NORM_NONE __pyx_string_tab[2326]
#define __pyx_n_u_NORM_PRECONDITIONED __pyx_string_tab[2327]
#define __pyx_n_u_NORM_UNPRECONDITIONED __pyx_string_tab[2328]
#define __pyx_n_u_NOTSET __pyx_string_tab[2329]
#define __pyx_n_u_NOT_SET_VALUES __pyx_string_tab[2330]
#define __pyx_n_u_NO_OFF_PROC_ENTRIES __pyx_string_tab[2331]
#define __pyx_n_u_NO_OFF_PROC_ZERO_ROWS __pyx_string_tab[2332]
#define __pyx_n_u_NO_SYNC __pyx_string_tab[2333]
#define __pyx_n_u_NRICHARDSON __pyx_string_tab[2334]
#define __pyx_n_u_NTL __pyx_string_tab[2335]
#define __pyx_n_u_NTR __pyx_string_tab[2336]
#define __pyx_n_u_NULLLOC __pyx_string_tab[2337]
#define __pyx_n_u_NZ __pyx_string_tab[2338]
#define __pyx_n_u_NewtonALCorrectionType __pyx_string_tab[2339]
#define __pyx_n_u_None __pyx_string_tab[2340]
#define __pyx_n_u_NormSchedule __pyx_string_tab[2341]
#define __pyx_n_u_NormType __pyx_string_tab[2342]
#define __pyx_n_u_NormTypeSpec __pyx_string_tab[2343]
#define __pyx_n_u_NotImplemented __pyx_string_tab[2344]
#define __pyx_n_u_NullSpace __pyx_string_tab[2345]
#define __pyx_n_u_NullSpace_create __pyx_string_tab[2346]
#define __pyx_n_u_NullSpace_createRigidBody __pyx_string_tab[2347]
#define __pyx_n_u_NullSpace_destroy __pyx_string_tab[2348]
#define __pyx_n_u_NullSpace_getFunction __pyx_string_tab[2349]
#define __pyx_n_u_NullSpace_getVecs __pyx_string_tab[2350]
#define __pyx_n_u_NullSpace_hasConstant __pyx_string_tab[2351]
#define __pyx_n_u_NullSpace_remove __pyx_string_tab[2352]
#define __pyx_n_u_NullSpace_setFunction __pyx_string_tab[2353]
#define __pyx_n_u_NullSpace_test __pyx_string_tab[2354]
#define __pyx_n_u_NullSpace_view __pyx_string_tab[2355]
#define __pyx_n_u_ODE_EXPLICIT __pyx_string_tab[2356]
#define __pyx_n_u_ODE_IMPLICIT __pyx_string_tab[2357]
#define __pyx_n_u_OLS __pyx_string_tab[2358]
#define __pyx_n_u_OPENCL __pyx_string_tab[2359]
#define __pyx_n_u_OPERATOR __pyx_string_tab[2360]
#define __pyx_n_u_OPTION_MAX __pyx_string_tab[2361]
#define __pyx_n_u_OPTION_MIN __pyx_string_tab[2362]
#define __pyx_n_u_OWARMIJO __pyx_string_tab[2363]
#define __pyx_n_u_OWD __pyx_string_tab[2364]
#define __pyx_n_u_OWLQN __pyx_string_tab[2365]
#define __pyx_n_u_Object __pyx_string_tab[2366]
#define __pyx_n_u_Object___copy __pyx_string_tab[2367]
#define __pyx_n_u_Object___deepcopy __pyx_string_tab[2368]
#define __pyx_n_u_Object_appendOptionsPrefix __pyx_string_tab[2369]
#define __pyx_n_u_Object_compose __pyx_string_tab[2370]
#define __pyx_n_u_Object_decRef __pyx_string_tab[2371]
#define __pyx_n_u_Object_destroy __pyx_string_tab[2372]
#define __pyx_n_u_Object_destroyOptionsHandlers __pyx_string_tab[2373]
#define __pyx_n_u_Object_getAttr __pyx_string_tab[2374]
#define __pyx_n_u_Object_getClassId __pyx_string_tab[2375]
#define __pyx_n_u_Object_getClassName __pyx_string_tab[2376]
#define __pyx_n_u_Object_getComm __pyx_string_tab[2377]
#define __pyx_n_u_Object_getDict __pyx_string_tab[2378]
#define __pyx_n_u_Object_getId __pyx_string_tab[2379]
#define __pyx_n_u_Object_getName __pyx_string_tab[2380]
#define __pyx_n_u_Object_getOptionsPrefix __pyx_string_tab[2381]
#define __pyx_n_u_Object_getRefCount __pyx_string_tab[2382]
#define __pyx_n_u_Object_getTabLevel __pyx_string_tab[2383]
#define __pyx_n_u_Object_getType __pyx_string_tab[2384]
#define __pyx_n_u_Object_incRef __pyx_string_tab[2385]
#define __pyx_n_u_Object_incrementTabLevel __pyx_string_tab[2386]
#define __pyx_n_u_Object_query __pyx_string_tab[2387]
#define __pyx_n_u_Object_setAttr __pyx_string_tab[2388]
#define __pyx_n_u_Object_setFromOptions __pyx_string_tab[2389]
#define __pyx_n_u_Object_setName __pyx_string_tab[2390]
#define __pyx_n_u_Object_setOptionsHandler __pyx_string_tab[2391]
#define __pyx_n_u_Object_setOptionsPrefix __pyx_string_tab[2392]
#define __pyx_n_u_Object_setTabLevel __pyx_string_tab[2393]
#define __pyx_n_u_Object_stateGet __pyx_string_tab[2394]
#define __pyx_n_u_Object_stateIncrease __pyx_string_tab[2395]
#define __pyx_n_u_Object_stateSet __pyx_string_tab[2396]
#define __pyx_n_u_Object_view __pyx_string_tab[2397]
#define __pyx_n_u_Object_viewFromOptions __pyx_string_tab[2398]
#define __pyx_n_u_Op __pyx_string_tab[2399]
#define __pyx_n_u_Option __pyx_string_tab[2400]
#define __pyx_n_u_Options __pyx_string_tab[2401]
#define __pyx_n_u_Options_clear __pyx_string_tab[2402]
#define __pyx_n_u_Options_create __pyx_string_tab[2403]
#define __pyx_n_u_Options_delValue __pyx_string_tab[2404]
#define __pyx_n_u_Options_destroy __pyx_string_tab[2405]
#define __pyx_n_u_Options_getAll __pyx_string_tab[2406]
#define __pyx_n_u_Options_getBool __pyx_string_tab[2407]
#define __pyx_n_u_Options_getBoolArray __pyx_string_tab[2408]
#define __pyx_n_u_Options_getInt __pyx_string_tab[2409]
#define __pyx_n_u_Options_getIntArray __pyx_string_tab[2410]
#define __pyx_n_u_Options_getReal __pyx_string_tab[2411]
#define __pyx_n_u_Options_getRealArray __pyx_string_tab[2412]
#define __pyx_n_u_Options_getScalar __pyx_string_tab[2413]
#define __pyx_n_u_Options_getScalarArray __pyx_string_tab[2414]
#define __pyx_n_u_Options_getString __pyx_string_tab[2415]
#define __pyx_n_u_Options_hasName __pyx_string_tab[2416]
#define __pyx_n_u_Options_insertString __pyx_string_tab[2417]
#define __pyx_n_u_Options_prefixPop __pyx_string_tab[2418]
#define __pyx_n_u_Options_prefixPush __pyx_string_tab[2419]
#define __pyx_n_u_Options_setValue __pyx_string_tab[2420]
#define __pyx_n_u_Options_used __pyx_string_tab[2421]
#define __pyx_n_u_Options_view __pyx_string_tab[2422]
#define __pyx_n_u_OrderingType __pyx_string_tab[2423]
#define __pyx_n_u_P __pyx_string_tab[2424]
#define __pyx_n_u_P1 __pyx_string_tab[2425]
#define __pyx_n_u_P4EST __pyx_string_tab[2426]
#define __pyx_n_u_P8EST __pyx_string_tab[2427]
#define __pyx_n_u_PARDECOMP __pyx_string_tab[2428]
#define __pyx_n_u_PARMETIS __pyx_string_tab[2429]
#define __pyx_n_u_PARMS __pyx_string_tab[2430]
#define __pyx_n_u_PARTITIONINGAVERAGE __pyx_string_tab[2431]
#define __pyx_n_u_PARTITIONINGCHACO __pyx_string_tab[2432]
#define __pyx_n_u_PARTITIONINGCURRENT __pyx_string_tab[2433]
#define __pyx_n_u_PARTITIONINGHIERARCH __pyx_string_tab[2434]
#define __pyx_n_u_PARTITIONINGPARMETIS __pyx_string_tab[2435]
#define __pyx_n_u_PARTITIONINGPARTY __pyx_string_tab[2436]
#define __pyx_n_u_PARTITIONINGPTSCOTCH __pyx_string_tab[2437]
#define __pyx_n_u_PARTITIONINGSQUARE __pyx_string_tab[2438]
#define __pyx_n_u_PASTIX __pyx_string_tab[2439]
#define __pyx_n_u_PATCH __pyx_string_tab[2440]
#define __pyx_n_u_PBJACOBI __pyx_string_tab[2441]
#define __pyx_n_u_PC __pyx_string_tab[2442]
#define __pyx_n_u_PCASMType __pyx_string_tab[2443]
#define __pyx_n_u_PCCompositeType __pyx_string_tab[2444]
#define __pyx_n_u_PCDeflationSpaceType __pyx_string_tab[2445]
#define __pyx_n_u_PCFailedReason __pyx_string_tab[2446]
#define __pyx_n_u_PCFieldSplitSchurFactType __pyx_string_tab[2447]
#define __pyx_n_u_PCFieldSplitSchurPreType __pyx_string_tab[2448]
#define __pyx_n_u_PCGAMGType __pyx_string_tab[2449]
#define __pyx_n_u_PCGASMType __pyx_string_tab[2450]
#define __pyx_n_u_PCGD __pyx_string_tab[2451]
#define __pyx_n_u_PCHPDDMCoarseCorrectionType __pyx_string_tab[2452]
#define __pyx_n_u_PCMGCycleType __pyx_string_tab[2453]
#define __pyx_n_u_PCMGType __pyx_string_tab[2454]
#define __pyx_n_u_PCPatchConstructType __pyx_string_tab[2455]
#define __pyx_n_u_PCSide __pyx_string_tab[2456]
#define __pyx_n_u_PCType __pyx_string_tab[2457]
#define __pyx_n_u_PC_addCompositePCType __pyx_string_tab[2458]
#define __pyx_n_u_PC_appendOptionsPrefix __pyx_string_tab[2459]
#define __pyx_n_u_PC_apply __pyx_string_tab[2460]
#define __pyx_n_u_PC_applySymmetricLeft __pyx_string_tab[2461]
#define __pyx_n_u_PC_applySymmetricRight __pyx_string_tab[2462]
#define __pyx_n_u_PC_applyTranspose __pyx_string_tab[2463]
#define __pyx_n_u_PC_create __pyx_string_tab[2464]
#define __pyx_n_u_PC_createPython __pyx_string_tab[2465]
#define __pyx_n_u_PC_destroy __pyx_string_tab[2466]
#define __pyx_n_u_PC_getASMSubKSP __pyx_string_tab[2467]
#define __pyx_n_u_PC_getBJacobiSubKSP __pyx_string_tab[2468]
#define __pyx_n_u_PC_getCompositePC __pyx_string_tab[2469]
#define __pyx_n_u_PC_getDM __pyx_string_tab[2470]
#define __pyx_n_u_PC_getDeflationCoarseKSP __pyx_string_tab[2471]
#define __pyx_n_u_PC_getDeflationPC __pyx_string_tab[2472]
#define __pyx_n_u_PC_getFactorMatrix __pyx_string_tab[2473]
#define __pyx_n_u_PC_getFactorSolverType __pyx_string_tab[2474]
#define __pyx_n_u_PC_getFailedReason __pyx_string_tab[2475]
#define __pyx_n_u_PC_getFieldSplitSchurGetSubKSP __pyx_string_tab[2476]
#define __pyx_n_u_PC_getFieldSplitSubIS __pyx_string_tab[2477]
#define __pyx_n_u_PC_getFieldSplitSubKSP __pyx_string_tab[2478]
#define __pyx_n_u_PC_getHPDDMCoarseCorrectionType __pyx_string_tab[2479]
#define __pyx_n_u_PC_getHPDDMComplexities __pyx_string_tab[2480]
#define __pyx_n_u_PC_getHPDDMSTShareSubKSP __pyx_string_tab[2481]
#define __pyx_n_u_PC_getHYPREType __pyx_string_tab[2482]
#define __pyx_n_u_PC_getKSP __pyx_string_tab[2483]
#define __pyx_n_u_PC_getMGCoarseSolve __pyx_string_tab[2484]
#define __pyx_n_u_PC_getMGInterpolation __pyx_string_tab[2485]
#define __pyx_n_u_PC_getMGLevels __pyx_string_tab[2486]
#define __pyx_n_u_PC_getMGRScale __pyx_string_tab[2487]
#define __pyx_n_u_PC_getMGRestriction __pyx_string_tab[2488]
#define __pyx_n_u_PC_getMGSmoother __pyx_string_tab[2489]
#define __pyx_n_u_PC_getMGSmootherDown __pyx_string_tab[2490]
#define __pyx_n_u_PC_getMGSmootherUp __pyx_string_tab[2491]
#define __pyx_n_u_PC_getMGType __pyx_string_tab[2492]
#define __pyx_n_u_PC_getOperators __pyx_string_tab[2493]
#define __pyx_n_u_PC_getOptionsPrefix __pyx_string_tab[2494]
#define __pyx_n_u_PC_getPatchSubKSP __pyx_string_tab[2495]
#define __pyx_n_u_PC_getPythonContext __pyx_string_tab[2496]
#define __pyx_n_u_PC_getPythonType __pyx_string_tab[2497]
#define __pyx_n_u_PC_getType __pyx_string_tab[2498]
#define __pyx_n_u_PC_getUseAmat __pyx_string_tab[2499]
#define __pyx_n_u_PC_matApply __pyx_string_tab[2500]
#define __pyx_n_u_PC_matApplyTranspose __pyx_string_tab[2501]
#define __pyx_n_u_PC_reset __pyx_string_tab[2502]
#define __pyx_n_u_PC_setASMLocalSubdomains __pyx_string_tab[2503]
#define __pyx_n_u_PC_setASMOverlap __pyx_string_tab[2504]
#define __pyx_n_u_PC_setASMSortIndices __pyx_string_tab[2505]
#define __pyx_n_u_PC_setASMTotalSubdomains __pyx_string_tab[2506]
#define __pyx_n_u_PC_setASMType __pyx_string_tab[2507]
#define __pyx_n_u_PC_setBDDCChangeOfBasisMat __pyx_string_tab[2508]
#define __pyx_n_u_PC_setBDDCCoarseningRatio __pyx_string_tab[2509]
#define __pyx_n_u_PC_setBDDCDirichletBoundaries __pyx_string_tab[2510]
#define __pyx_n_u_PC_setBDDCDirichletBoundariesLoc __pyx_string_tab[2511]
#define __pyx_n_u_PC_setBDDCDiscreteGradient __pyx_string_tab[2512]
#define __pyx_n_u_PC_setBDDCDivergenceMat __pyx_string_tab[2513]
#define __pyx_n_u_PC_setBDDCDofsSplitting __pyx_string_tab[2514]
#define __pyx_n_u_PC_setBDDCDofsSplittingLocal __pyx_string_tab[2515]
#define __pyx_n_u_PC_setBDDCLevels __pyx_string_tab[2516]
#define __pyx_n_u_PC_setBDDCLocalAdjacency __pyx_string_tab[2517]
#define __pyx_n_u_PC_setBDDCNeumannBoundaries __pyx_string_tab[2518]
#define __pyx_n_u_PC_setBDDCNeumannBoundariesLocal __pyx_string_tab[2519]
#define __pyx_n_u_PC_setBDDCPrimalVerticesIS __pyx_string_tab[2520]
#define __pyx_n_u_PC_setBDDCPrimalVerticesLocalIS __pyx_string_tab[2521]
#define __pyx_n_u_PC_setCompositeType __pyx_string_tab[2522]
#define __pyx_n_u_PC_setCoordinates __pyx_string_tab[2523]
#define __pyx_n_u_PC_setDM __pyx_string_tab[2524]
#define __pyx_n_u_PC_setDeflationCoarseMat __pyx_string_tab[2525]
#define __pyx_n_u_PC_setDeflationCorrectionFactor __pyx_string_tab[2526]
#define __pyx_n_u_PC_setDeflationInitOnly __pyx_string_tab[2527]
#define __pyx_n_u_PC_setDeflationLevels __pyx_string_tab[2528]
#define __pyx_n_u_PC_setDeflationProjectionNullSpa __pyx_string_tab[2529]
#define __pyx_n_u_PC_setDeflationReductionFactor __pyx_string_tab[2530]
#define __pyx_n_u_PC_setDeflationSpace __pyx_string_tab[2531]
#define __pyx_n_u_PC_setDeflationSpaceToCompute __pyx_string_tab[2532]
#define __pyx_n_u_PC_setFactorLevels __pyx_string_tab[2533]
#define __pyx_n_u_PC_setFactorOrdering __pyx_string_tab[2534]
#define __pyx_n_u_PC_setFactorPivot __pyx_string_tab[2535]
#define __pyx_n_u_PC_setFactorSetUpSolverType __pyx_string_tab[2536]
#define __pyx_n_u_PC_setFactorShift __pyx_string_tab[2537]
#define __pyx_n_u_PC_setFactorSolverType __pyx_string_tab[2538]
#define __pyx_n_u_PC_setFailedReason __pyx_string_tab[2539]
#define __pyx_n_u_PC_setFieldSplitFields __pyx_string_tab[2540]
#define __pyx_n_u_PC_setFieldSplitIS __pyx_string_tab[2541]
#define __pyx_n_u_PC_setFieldSplitSchurFactType __pyx_string_tab[2542]
#define __pyx_n_u_PC_setFieldSplitSchurPreType __pyx_string_tab[2543]
#define __pyx_n_u_PC_setFieldSplitType __pyx_string_tab[2544]
#define __pyx_n_u_PC_setFromOptions __pyx_string_tab[2545]
#define __pyx_n_u_PC_setGAMGLevels __pyx_string_tab[2546]
#define __pyx_n_u_PC_setGAMGSmooths __pyx_string_tab[2547]
#define __pyx_n_u_PC_setGAMGType __pyx_string_tab[2548]
#define __pyx_n_u_PC_setGASMOverlap __pyx_string_tab[2549]
#define __pyx_n_u_PC_setGASMType __pyx_string_tab[2550]
#define __pyx_n_u_PC_setHPDDMAuxiliaryMat __pyx_string_tab[2551]
#define __pyx_n_u_PC_setHPDDMCoarseCorrectionType __pyx_string_tab[2552]
#define __pyx_n_u_PC_setHPDDMDeflationMat __pyx_string_tab[2553]
#define __pyx_n_u_PC_setHPDDMHasNeumannMat __pyx_string_tab[2554]
#define __pyx_n_u_PC_setHPDDMRHSMat __pyx_string_tab[2555]
#define __pyx_n_u_PC_setHYPREAMSSetInteriorNodes __pyx_string_tab[2556]
#define __pyx_n_u_PC_setHYPREDiscreteCurl __pyx_string_tab[2557]
#define __pyx_n_u_PC_setHYPREDiscreteGradient __pyx_string_tab[2558]
#define __pyx_n_u_PC_setHYPRESetAlphaPoissonMatrix __pyx_string_tab[2559]
#define __pyx_n_u_PC_setHYPRESetBetaPoissonMatrix __pyx_string_tab[2560]
#define __pyx_n_u_PC_setHYPRESetEdgeConstantVector __pyx_string_tab[2561]
#define __pyx_n_u_PC_setHYPRESetInterpolations __pyx_string_tab[2562]
#define __pyx_n_u_PC_setHYPREType __pyx_string_tab[2563]
#define __pyx_n_u_PC_setMGCycleType __pyx_string_tab[2564]
#define __pyx_n_u_PC_setMGCycleTypeOnLevel __pyx_string_tab[2565]
#define __pyx_n_u_PC_setMGInterpolation __pyx_string_tab[2566]
#define __pyx_n_u_PC_setMGLevels __pyx_string_tab[2567]
#define __pyx_n_u_PC_setMGR __pyx_string_tab[2568]
#define __pyx_n_u_PC_setMGRScale __pyx_string_tab[2569]
#define __pyx_n_u_PC_setMGRestriction __pyx_string_tab[2570]
#define __pyx_n_u_PC_setMGRhs __pyx_string_tab[2571]
#define __pyx_n_u_PC_setMGType __pyx_string_tab[2572]
#define __pyx_n_u_PC_setMGX __pyx_string_tab[2573]
#define __pyx_n_u_PC_setOperators __pyx_string_tab[2574]
#define __pyx_n_u_PC_setOptionsPrefix __pyx_string_tab[2575]
#define __pyx_n_u_PC_setPatchCellNumbering __pyx_string_tab[2576]
#define __pyx_n_u_PC_setPatchComputeFunction __pyx_string_tab[2577]
#define __pyx_n_u_PC_setPatchComputeFunctionInteri __pyx_string_tab[2578]
#define __pyx_n_u_PC_setPatchComputeOperator __pyx_string_tab[2579]
#define __pyx_n_u_PC_setPatchComputeOperatorInteri __pyx_string_tab[2580]
#define __pyx_n_u_PC_setPatchConstructType __pyx_string_tab[2581]
#define __pyx_n_u_PC_setPatchDiscretisationInfo __pyx_string_tab[2582]
#define __pyx_n_u_PC_setPythonContext __pyx_string_tab[2583]
#define __pyx_n_u_PC_setPythonType __pyx_string_tab[2584]
#define __pyx_n_u_PC_setReusePreconditioner __pyx_string_tab[2585]
#define __pyx_n_u_PC_setSPAIBlockSize __pyx_string_tab[2586]
#define __pyx_n_u_PC_setSPAICacheSize __pyx_string_tab[2587]
#define __pyx_n_u_PC_setSPAIEpsilon __pyx_string_tab[2588]
#define __pyx_n_u_PC_setSPAIMax __pyx_string_tab[2589]
#define __pyx_n_u_PC_setSPAIMaxNew __pyx_string_tab[2590]
#define __pyx_n_u_PC_setSPAINBSteps __pyx_string_tab[2591]
#define __pyx_n_u_PC_setSPAISp __pyx_string_tab[2592]
#define __pyx_n_u_PC_setSPAIVerbose __pyx_string_tab[2593]
#define __pyx_n_u_PC_setType __pyx_string_tab[2594]
#define __pyx_n_u_PC_setUp __pyx_string_tab[2595]
#define __pyx_n_u_PC_setUpOnBlocks __pyx_string_tab[2596]
#define __pyx_n_u_PC_setUseAmat __pyx_string_tab[2597]
#define __pyx_n_u_PC_view __pyx_string_tab[2598]
#define __pyx_n_u_PD __pyx_string_tab[2599]
#define __pyx_n_u_PDIPM __pyx_string_tab[2600]
#define __pyx_n_u_PERIODIC __pyx_string_tab[2601]
#define __pyx_n_u_PETSC __pyx_string_tab[2602]
#define __pyx_n_u_PFMG __pyx_string_tab[2603]
#define __pyx_n_u_PGMRES __pyx_string_tab[2604]
#define __pyx_n_u_PHR __pyx_string_tab[2605]
#define __pyx_n_u_PIC __pyx_string_tab[2606]
#define __pyx_n_u_PICLayoutType __pyx_string_tab[2607]
#define __pyx_n_u_PINFINITY __pyx_string_tab[2608]
#define __pyx_n_u_PIPEBCGS __pyx_string_tab[2609]
#define __pyx_n_u_PIPECG __pyx_string_tab[2610]
#define __pyx_n_u_PIPECG2 __pyx_string_tab[2611]
#define __pyx_n_u_PIPECGRR __pyx_string_tab[2612]
#define __pyx_n_u_PIPECR __pyx_string_tab[2613]
#define __pyx_n_u_PIPEFCG __pyx_string_tab[2614]
#define __pyx_n_u_PIPEFGMRES __pyx_string_tab[2615]
#define __pyx_n_u_PIPEGCR __pyx_string_tab[2616]
#define __pyx_n_u_PIPELCG __pyx_string_tab[2617]
#define __pyx_n_u_PIPEPRCG __pyx_string_tab[2618]
#define __pyx_n_u_PLEX __pyx_string_tab[2619]
#define __pyx_n_u_POINT __pyx_string_tab[2620]
#define __pyx_n_u_POINT_PRISM_TENSOR __pyx_string_tab[2621]
#define __pyx_n_u_POLYNOMIAL __pyx_string_tab[2622]
#define __pyx_n_u_POSITIVE_DEFINITE __pyx_string_tab[2623]
#define __pyx_n_u_POUNDERS __pyx_string_tab[2624]
#define __pyx_n_u_PREALLOCATOR __pyx_string_tab[2625]
#define __pyx_n_u_PRECONDITIONED __pyx_string_tab[2626]
#define __pyx_n_u_PREONLY __pyx_string_tab[2627]
#define __pyx_n_u_PRODUCT __pyx_string_tab[2628]
#define __pyx_n_u_PRP __pyx_string_tab[2629]
#define __pyx_n_u_PRP_PLUS __pyx_string_tab[2630]
#define __pyx_n_u_PSEUDO __pyx_string_tab[2631]
#define __pyx_n_u_PTRIMMED __pyx_string_tab[2632]
#define __pyx_n_u_PTSCOTCH __pyx_string_tab[2633]
#define __pyx_n_u_PYRAMID __pyx_string_tab[2634]
#define __pyx_n_u_PYTHON __pyx_string_tab[2635]
#define __pyx_n_u_PYVISTA __pyx_string_tab[2636]
#define __pyx_n_u_Partitioner __pyx_string_tab[2637]
#define __pyx_n_u_PartitionerType __pyx_string_tab[2638]
#define __pyx_n_u_Partitioner_create __pyx_string_tab[2639]
#define __pyx_n_u_Partitioner_destroy __pyx_string_tab[2640]
#define __pyx_n_u_Partitioner_getType __pyx_string_tab[2641]
#define __pyx_n_u_Partitioner_reset __pyx_string_tab[2642]
#define __pyx_n_u_Partitioner_setFromOptions __pyx_string_tab[2643]
#define __pyx_n_u_Partitioner_setShellPartition __pyx_string_tab[2644]
#define __pyx_n_u_Partitioner_setType __pyx_string_tab[2645]
#define __pyx_n_u_Partitioner_setUp __pyx_string_tab[2646]
#define __pyx_n_u_Partitioner_view __pyx_string_tab[2647]
#define __pyx_n_u_PatchConstructType __pyx_string_tab[2648]
#define __pyx_n_u_Pmat __pyx_string_tab[2649]
#define __pyx_n_u_PolytopeType __pyx_string_tab[2650]
#define __pyx_n_u_Print __pyx_string_tab[2651]
#define __pyx_n_u_ProblemType __pyx_string_tab[2652]
#define __pyx_n_u_PtAP __pyx_string_tab[2653]
#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[2654]
#define __pyx_n_u_Q0 __pyx_string_tab[2655]
#define __pyx_n_u_Q1 __pyx_string_tab[2656]
#define __pyx_n_u_QCG __pyx_string_tab[2657]
#define __pyx_n_u_QMD __pyx_string_tab[2658]
#define __pyx_n_u_QMRCGS __pyx_string_tab[2659]
#define __pyx_n_u_QN __pyx_string_tab[2660]
#define __pyx_n_u_QR __pyx_string_tab[2661]
#define __pyx_n_u_QUADRATIC __pyx_string_tab[2662]
#define __pyx_n_u_QUADRILATERAL __pyx_string_tab[2663]
#define __pyx_n_u_QUAD_PRISM_TENSOR __pyx_string_tab[2664]
#define __pyx_n_u_QUARTER __pyx_string_tab[2665]
#define __pyx_n_u_QUARTER_SIZE __pyx_string_tab[2666]
#define __pyx_n_u_Quad __pyx_string_tab[2667]
#define __pyx_n_u_Quad_create __pyx_string_tab[2668]
#define __pyx_n_u_Quad_destroy __pyx_string_tab[2669]
#define __pyx_n_u_Quad_duplicate __pyx_string_tab[2670]
#define __pyx_n_u_Quad_getData __pyx_string_tab[2671]
#define __pyx_n_u_Quad_getNumComponents __pyx_string_tab[2672]
#define __pyx_n_u_Quad_getOrder __pyx_string_tab[2673]
#define __pyx_n_u_Quad_setNumComponents __pyx_string_tab[2674]
#define __pyx_n_u_Quad_setOrder __pyx_string_tab[2675]
#define __pyx_n_u_Quad_view __pyx_string_tab[2676]
#define __pyx_n_u_R __pyx_string_tab[2677]
#define __pyx_n_u_RADAU5 __pyx_string_tab[2678]
#define __pyx_n_u_RAND __pyx_string_tab[2679]
#define __pyx_n_u_RAND48 __pyx_string_tab[2680]
#define __pyx_n_u_RANDER48 __pyx_string_tab[2681]
#define __pyx_n_u_RANDOM123 __pyx_string_tab[2682]
#define __pyx_n_u_RARt __pyx_string_tab[2683]
#define __pyx_n_u_RCM __pyx_string_tab[2684]
#define __pyx_n_u_READ __pyx_string_tab[2685]
#define __pyx_n_u_REDISTRIBUTE __pyx_string_tab[2686]
#define __pyx_n_u_REDUNDANT __pyx_string_tab[2687]
#define __pyx_n_u_REFINE1D __pyx_string_tab[2688]
#define __pyx_n_u_REFINEALFELD __pyx_string_tab[2689]
#define __pyx_n_u_REFINEBOUNDARYLAYER __pyx_string_tab[2690]
#define __pyx_n_u_REFINED __pyx_string_tab[2691]
#define __pyx_n_u_REFINEPOWELLSABIN __pyx_string_tab[2692]
#define __pyx_n_u_REFINEREGULAR __pyx_string_tab[2693]
#define __pyx_n_u_REFINESBR __pyx_string_tab[2694]
#define __pyx_n_u_REFINETOBOX __pyx_string_tab[2695]
#define __pyx_n_u_REFINETOSIMPLEX __pyx_string_tab[2696]
#define __pyx_n_u_RESTRICT __pyx_string_tab[2697]
#define __pyx_n_u_REVERSE __pyx_string_tab[2698]
#define __pyx_n_u_REVERSE_LOCAL __pyx_string_tab[2699]
#define __pyx_n_u_RHS __pyx_string_tab[2700]
#define __pyx_n_u_RICHARDSON __pyx_string_tab[2701]
#define __pyx_n_u_RIDGE __pyx_string_tab[2702]
#define __pyx_n_u_RIGHT __pyx_string_tab[2703]
#define __pyx_n_u_RK __pyx_string_tab[2704]
#define __pyx_n_u_RK1FE __pyx_string_tab[2705]
#define __pyx_n_u_RK2A __pyx_string_tab[2706]
#define __pyx_n_u_RK2B __pyx_string_tab[2707]
#define __pyx_n_u_RK3 __pyx_string_tab[2708]
#define __pyx_n_u_RK3BS __pyx_string_tab[2709]
#define __pyx_n_u_RK4 __pyx_string_tab[2710]
#define __pyx_n_u_RK5BS __pyx_string_tab[2711]
#define __pyx_n_u_RK5DP __pyx_string_tab[2712]
#define __pyx_n_u_RK5F __pyx_string_tab[2713]
#define __pyx_n_u_RK6VR __pyx_string_tab[2714]
#define __pyx_n_u_RK7VR __pyx_string_tab[2715]
#define __pyx_n_u_RK8VR __pyx_string_tab[2716]
#define __pyx_n_u_RKType __pyx_string_tab[2717]
#define __pyx_n_u_ROSW __pyx_string_tab[2718]
#define __pyx_n_u_ROWLENGTH __pyx_string_tab[2719]
#define __pyx_n_u_ROWSCALINGVIENNACL __pyx_string_tab[2720]
#define __pyx_n_u_ROW_ORIENTED __pyx_string_tab[2721]
#define __pyx_n_u_RT_Pi __pyx_string_tab[2722]
#define __pyx_n_u_RT_Pi_Full __pyx_string_tab[2723]
#define __pyx_n_u_RT_Pi_mat __pyx_string_tab[2724]
#define __pyx_n_u_RT_full_mat __pyx_string_tab[2725]
#define __pyx_n_u_RUNGE_KUTTA __pyx_string_tab[2726]
#define __pyx_n_u_Random __pyx_string_tab[2727]
#define __pyx_n_u_RandomType __pyx_string_tab[2728]
#define __pyx_n_u_Random_create __pyx_string_tab[2729]
#define __pyx_n_u_Random_destroy __pyx_string_tab[2730]
#define __pyx_n_u_Random_getInterval __pyx_string_tab[2731]
#define __pyx_n_u_Random_getSeed __pyx_string_tab[2732]
#define __pyx_n_u_Random_getType __pyx_string_tab[2733]
#define __pyx_n_u_Random_getValue __pyx_string_tab[2734]
#define __pyx_n_u_Random_getValueReal __pyx_string_tab[2735]
#define __pyx_n_u_Random_setFromOptions __pyx_string_tab[2736]
#define __pyx_n_u_Random_setInterval __pyx_string_tab[2737]
#define __pyx_n_u_Random_setSeed __pyx_string_tab[2738]
#define __pyx_n_u_Random_setType __pyx_string_tab[2739]
#define __pyx_n_u_Random_view __pyx_string_tab[2740]
#define __pyx_n_u_RealType __pyx_string_tab[2741]
#define __pyx_n_u_Reason __pyx_string_tab[2742]
#define __pyx_n_u_Regressor __pyx_string_tab[2743]
#define __pyx_n_u_RegressorLinearType __pyx_string_tab[2744]
#define __pyx_n_u_RegressorType __pyx_string_tab[2745]
#define __pyx_n_u_Regressor_create __pyx_string_tab[2746]
#define __pyx_n_u_Regressor_destroy __pyx_string_tab[2747]
#define __pyx_n_u_Regressor_fit __pyx_string_tab[2748]
#define __pyx_n_u_Regressor_getLinearCoefficients __pyx_string_tab[2749]
#define __pyx_n_u_Regressor_getLinearIntercept __pyx_string_tab[2750]
#define __pyx_n_u_Regressor_getLinearKSP __pyx_string_tab[2751]
#define __pyx_n_u_Regressor_getLinearType __pyx_string_tab[2752]
#define __pyx_n_u_Regressor_getTAO __pyx_string_tab[2753]
#define __pyx_n_u_Regressor_getType __pyx_string_tab[2754]
#define __pyx_n_u_Regressor_predict __pyx_string_tab[2755]
#define __pyx_n_u_Regressor_reset __pyx_string_tab[2756]
#define __pyx_n_u_Regressor_setFromOptions __pyx_string_tab[2757]
#define __pyx_n_u_Regressor_setLinearFitIntercept __pyx_string_tab[2758]
#define __pyx_n_u_Regressor_setLinearType __pyx_string_tab[2759]
#define __pyx_n_u_Regressor_setLinearUseKSP __pyx_string_tab[2760]
#define __pyx_n_u_Regressor_setRegularizerWeight __pyx_string_tab[2761]
#define __pyx_n_u_Regressor_setType __pyx_string_tab[2762]
#define __pyx_n_u_Regressor_setUp __pyx_string_tab[2763]
#define __pyx_n_u_Regressor_view __pyx_string_tab[2764]
#define __pyx_n_u_ReorderDefaultFlag __pyx_string_tab[2765]
#define __pyx_n_u_Right __pyx_string_tab[2766]
#define __pyx_n_u_S __pyx_string_tab[2767]
#define __pyx_n_u_SAME __pyx_string_tab[2768]
#define __pyx_n_u_SAME_NONZERO_PATTERN __pyx_string_tab[2769]
#define __pyx_n_u_SAME_NZ __pyx_string_tab[2770]
#define __pyx_n_u_SAVIENNACL __pyx_string_tab[2771]
#define __pyx_n_u_SAWS __pyx_string_tab[2772]
#define __pyx_n_u_SBAIJ __pyx_string_tab[2773]
#define __pyx_n_u_SCALAPACK __pyx_string_tab[2774]
#define __pyx_n_u_SCATTER __pyx_string_tab[2775]
#define __pyx_n_u_SCATTER_FORWARD __pyx_string_tab[2776]
#define __pyx_n_u_SCATTER_FORWARD_LOCAL __pyx_string_tab[2777]
#define __pyx_n_u_SCATTER_REVERSE __pyx_string_tab[2778]
#define __pyx_n_u_SCATTER_REVERSE_LOCAL __pyx_string_tab[2779]
#define __pyx_n_u_SCHUR __pyx_string_tab[2780]
#define __pyx_n_u_SCHURCOMPLEMENT __pyx_string_tab[2781]
#define __pyx_n_u_SECANT __pyx_string_tab[2782]
#define __pyx_n_u_SEGMENT __pyx_string_tab[2783]
#define __pyx_n_u_SEG_PRISM_TENSOR __pyx_string_tab[2784]
#define __pyx_n_u_SELF __pyx_string_tab[2785]
#define __pyx_n_u_SELFP __pyx_string_tab[2786]
#define __pyx_n_u_SELL __pyx_string_tab[2787]
#define __pyx_n_u_SEQ __pyx_string_tab[2788]
#define __pyx_n_u_SEQAIJ __pyx_string_tab[2789]
#define __pyx_n_u_SEQAIJCRL __pyx_string_tab[2790]
#define __pyx_n_u_SEQAIJCUSPARSE __pyx_string_tab[2791]
#define __pyx_n_u_SEQAIJMKL __pyx_string_tab[2792]
#define __pyx_n_u_SEQAIJPERM __pyx_string_tab[2793]
#define __pyx_n_u_SEQAIJSELL __pyx_string_tab[2794]
#define __pyx_n_u_SEQAIJVIENNACL __pyx_string_tab[2795]
#define __pyx_n_u_SEQBAIJ __pyx_string_tab[2796]
#define __pyx_n_u_SEQBAIJMKL __pyx_string_tab[2797]
#define __pyx_n_u_SEQCUDA __pyx_string_tab[2798]
#define __pyx_n_u_SEQCUFFT __pyx_string_tab[2799]
#define __pyx_n_u_SEQDENSE __pyx_string_tab[2800]
#define __pyx_n_u_SEQDENSECUDA __pyx_string_tab[2801]
#define __pyx_n_u_SEQDENSEHIP __pyx_string_tab[2802]
#define __pyx_n_u_SEQHIP __pyx_string_tab[2803]
#define __pyx_n_u_SEQKAIJ __pyx_string_tab[2804]
#define __pyx_n_u_SEQKOKKOS __pyx_string_tab[2805]
#define __pyx_n_u_SEQMAIJ __pyx_string_tab[2806]
#define __pyx_n_u_SEQSBAIJ __pyx_string_tab[2807]
#define __pyx_n_u_SEQSELL __pyx_string_tab[2808]
#define __pyx_n_u_SEQVIENNACL __pyx_string_tab[2809]
#define __pyx_n_u_SETUP_ERROR __pyx_string_tab[2810]
#define __pyx_n_u_SF __pyx_string_tab[2811]
#define __pyx_n_u_SFType __pyx_string_tab[2812]
#define __pyx_n_u_SF_bcastBegin __pyx_string_tab[2813]
#define __pyx_n_u_SF_bcastEnd __pyx_string_tab[2814]
#define __pyx_n_u_SF_compose __pyx_string_tab[2815]
#define __pyx_n_u_SF_computeDegree __pyx_string_tab[2816]
#define __pyx_n_u_SF_create __pyx_string_tab[2817]
#define __pyx_n_u_SF_createEmbeddedLeafSF __pyx_string_tab[2818]
#define __pyx_n_u_SF_createEmbeddedRootSF __pyx_string_tab[2819]
#define __pyx_n_u_SF_createInverse __pyx_string_tab[2820]
#define __pyx_n_u_SF_createSectionSF __pyx_string_tab[2821]
#define __pyx_n_u_SF_destroy __pyx_string_tab[2822]
#define __pyx_n_u_SF_distributeSection __pyx_string_tab[2823]
#define __pyx_n_u_SF_fetchAndOpBegin __pyx_string_tab[2824]
#define __pyx_n_u_SF_fetchAndOpEnd __pyx_string_tab[2825]
#define __pyx_n_u_SF_gatherBegin __pyx_string_tab[2826]
#define __pyx_n_u_SF_gatherEnd __pyx_string_tab[2827]
#define __pyx_n_u_SF_getGraph __pyx_string_tab[2828]
#define __pyx_n_u_SF_getMulti __pyx_string_tab[2829]
#define __pyx_n_u_SF_getType __pyx_string_tab[2830]
#define __pyx_n_u_SF_reduceBegin __pyx_string_tab[2831]
#define __pyx_n_u_SF_reduceEnd __pyx_string_tab[2832]
#define __pyx_n_u_SF_reset __pyx_string_tab[2833]
#define __pyx_n_u_SF_scatterBegin __pyx_string_tab[2834]
#define __pyx_n_u_SF_scatterEnd __pyx_string_tab[2835]
#define __pyx_n_u_SF_setFromOptions __pyx_string_tab[2836]
#define __pyx_n_u_SF_setGraph __pyx_string_tab[2837]
#define __pyx_n_u_SF_setRankOrder __pyx_string_tab[2838]
#define __pyx_n_u_SF_setType __pyx_string_tab[2839]
#define __pyx_n_u_SF_setUp __pyx_string_tab[2840]
#define __pyx_n_u_SF_view __pyx_string_tab[2841]
#define __pyx_n_u_SHARED __pyx_string_tab[2842]
#define __pyx_n_u_SHARE_NONZERO_PATTERN __pyx_string_tab[2843]
#define __pyx_n_u_SHELL __pyx_string_tab[2844]
#define __pyx_n_u_SIMPLE __pyx_string_tab[2845]
#define __pyx_n_u_SLICED __pyx_string_tab[2846]
#define __pyx_n_u_SNES __pyx_string_tab[2847]
#define __pyx_n_u_SNESConvergedFunction __pyx_string_tab[2848]
#define __pyx_n_u_SNESConvergedReason __pyx_string_tab[2849]
#define __pyx_n_u_SNESFunction __pyx_string_tab[2850]
#define __pyx_n_u_SNESGuessFunction __pyx_string_tab[2851]
#define __pyx_n_u_SNESJacobianFunction __pyx_string_tab[2852]
#define __pyx_n_u_SNESLineSearch __pyx_string_tab[2853]
#define __pyx_n_u_SNESLineSearchType __pyx_string_tab[2854]
#define __pyx_n_u_SNESLineSearch_create __pyx_string_tab[2855]
#define __pyx_n_u_SNESLineSearch_destroy __pyx_string_tab[2856]
#define __pyx_n_u_SNESLineSearch_getOrder __pyx_string_tab[2857]
#define __pyx_n_u_SNESLineSearch_getTolerances __pyx_string_tab[2858]
#define __pyx_n_u_SNESLineSearch_getType __pyx_string_tab[2859]
#define __pyx_n_u_SNESLineSearch_setFromOptions __pyx_string_tab[2860]
#define __pyx_n_u_SNESLineSearch_setOrder __pyx_string_tab[2861]
#define __pyx_n_u_SNESLineSearch_setTolerances __pyx_string_tab[2862]
#define __pyx_n_u_SNESLineSearch_setType __pyx_string_tab[2863]
#define __pyx_n_u_SNESLineSearch_view __pyx_string_tab[2864]
#define __pyx_n_u_SNESNGSFunction __pyx_string_tab[2865]
#define __pyx_n_u_SNESNewtonALCorrectionType __pyx_string_tab[2866]
#define __pyx_n_u_SNESNormSchedule __pyx_string_tab[2867]
#define __pyx_n_u_SNESObjFunction __pyx_string_tab[2868]
#define __pyx_n_u_SNESType __pyx_string_tab[2869]
#define __pyx_n_u_SNESUpdateFunction __pyx_string_tab[2870]
#define __pyx_n_u_SNES_appendOptionsPrefix __pyx_string_tab[2871]
#define __pyx_n_u_SNES_callConvergenceTest __pyx_string_tab[2872]
#define __pyx_n_u_SNES_computeFunction __pyx_string_tab[2873]
#define __pyx_n_u_SNES_computeJacobian __pyx_string_tab[2874]
#define __pyx_n_u_SNES_computeNGS __pyx_string_tab[2875]
#define __pyx_n_u_SNES_computeObjective __pyx_string_tab[2876]
#define __pyx_n_u_SNES_converged __pyx_string_tab[2877]
#define __pyx_n_u_SNES_create __pyx_string_tab[2878]
#define __pyx_n_u_SNES_createPython __pyx_string_tab[2879]
#define __pyx_n_u_SNES_destroy __pyx_string_tab[2880]
#define __pyx_n_u_SNES_getApplicationContext __pyx_string_tab[2881]
#define __pyx_n_u_SNES_getCompositeNumber __pyx_string_tab[2882]
#define __pyx_n_u_SNES_getCompositeSNES __pyx_string_tab[2883]
#define __pyx_n_u_SNES_getConvergedReason __pyx_string_tab[2884]
#define __pyx_n_u_SNES_getConvergenceHistory __pyx_string_tab[2885]
#define __pyx_n_u_SNES_getConvergenceTest __pyx_string_tab[2886]
#define __pyx_n_u_SNES_getDM __pyx_string_tab[2887]
#define __pyx_n_u_SNES_getDivergenceTolerance __pyx_string_tab[2888]
#define __pyx_n_u_SNES_getErrorIfNotConverged __pyx_string_tab[2889]
#define __pyx_n_u_SNES_getFASCoarseSolve __pyx_string_tab[2890]
#define __pyx_n_u_SNES_getFASCycleSNES __pyx_string_tab[2891]
#define __pyx_n_u_SNES_getFASInjection __pyx_string_tab[2892]
#define __pyx_n_u_SNES_getFASInterpolation __pyx_string_tab[2893]
#define __pyx_n_u_SNES_getFASLevels __pyx_string_tab[2894]
#define __pyx_n_u_SNES_getFASRestriction __pyx_string_tab[2895]
#define __pyx_n_u_SNES_getFASSmoother __pyx_string_tab[2896]
#define __pyx_n_u_SNES_getFASSmootherDown __pyx_string_tab[2897]
#define __pyx_n_u_SNES_getFASSmootherUp __pyx_string_tab[2898]
#define __pyx_n_u_SNES_getFunction __pyx_string_tab[2899]
#define __pyx_n_u_SNES_getFunctionEvaluations __pyx_string_tab[2900]
#define __pyx_n_u_SNES_getFunctionNorm __pyx_string_tab[2901]
#define __pyx_n_u_SNES_getInitialGuess __pyx_string_tab[2902]
#define __pyx_n_u_SNES_getIterationNumber __pyx_string_tab[2903]
#define __pyx_n_u_SNES_getJacobian __pyx_string_tab[2904]
#define __pyx_n_u_SNES_getKSP __pyx_string_tab[2905]
#define __pyx_n_u_SNES_getKSPFailures __pyx_string_tab[2906]
#define __pyx_n_u_SNES_getLineSearch __pyx_string_tab[2907]
#define __pyx_n_u_SNES_getLinearSolveIterations __pyx_string_tab[2908]
#define __pyx_n_u_SNES_getMaxFunctionEvaluations __pyx_string_tab[2909]
#define __pyx_n_u_SNES_getMaxKSPFailures __pyx_string_tab[2910]
#define __pyx_n_u_SNES_getMaxStepFailures __pyx_string_tab[2911]
#define __pyx_n_u_SNES_getMonitor __pyx_string_tab[2912]
#define __pyx_n_u_SNES_getNASMNumber __pyx_string_tab[2913]
#define __pyx_n_u_SNES_getNASMSNES __pyx_string_tab[2914]
#define __pyx_n_u_SNES_getNGS __pyx_string_tab[2915]
#define __pyx_n_u_SNES_getNPC __pyx_string_tab[2916]
#define __pyx_n_u_SNES_getNPCSide __pyx_string_tab[2917]
#define __pyx_n_u_SNES_getNewtonALLoadParameter __pyx_string_tab[2918]
#define __pyx_n_u_SNES_getNormSchedule __pyx_string_tab[2919]
#define __pyx_n_u_SNES_getObjective __pyx_string_tab[2920]
#define __pyx_n_u_SNES_getOptionsPrefix __pyx_string_tab[2921]
#define __pyx_n_u_SNES_getParamsEW __pyx_string_tab[2922]
#define __pyx_n_u_SNES_getPythonContext __pyx_string_tab[2923]
#define __pyx_n_u_SNES_getPythonType __pyx_string_tab[2924]
#define __pyx_n_u_SNES_getRhs __pyx_string_tab[2925]
#define __pyx_n_u_SNES_getSolution __pyx_string_tab[2926]
#define __pyx_n_u_SNES_getSolutionUpdate __pyx_string_tab[2927]
#define __pyx_n_u_SNES_getStepFailures __pyx_string_tab[2928]
#define __pyx_n_u_SNES_getTRTolerances __pyx_string_tab[2929]
#define __pyx_n_u_SNES_getTRUpdateParameters __pyx_string_tab[2930]
#define __pyx_n_u_SNES_getTolerances __pyx_string_tab[2931]
#define __pyx_n_u_SNES_getType __pyx_string_tab[2932]
#define __pyx_n_u_SNES_getUpdate __pyx_string_tab[2933]
#define __pyx_n_u_SNES_getUseEW __pyx_string_tab[2934]
#define __pyx_n_u_SNES_getUseFD __pyx_string_tab[2935]
#define __pyx_n_u_SNES_getUseKSP __pyx_string_tab[2936]
#define __pyx_n_u_SNES_getUseMF __pyx_string_tab[2937]
#define __pyx_n_u_SNES_getVIInactiveSet __pyx_string_tab[2938]
#define __pyx_n_u_SNES_getVariableBounds __pyx_string_tab[2939]
#define __pyx_n_u_SNES_hasNPC __pyx_string_tab[2940]
#define __pyx_n_u_SNES_logConvergenceHistory __pyx_string_tab[2941]
#define __pyx_n_u_SNES_monitor __pyx_string_tab[2942]
#define __pyx_n_u_SNES_monitorCancel __pyx_string_tab[2943]
#define __pyx_n_u_SNES_reset __pyx_string_tab[2944]
#define __pyx_n_u_SNES_setApplicationContext __pyx_string_tab[2945]
#define __pyx_n_u_SNES_setConvergedReason __pyx_string_tab[2946]
#define __pyx_n_u_SNES_setConvergenceHistory __pyx_string_tab[2947]
#define __pyx_n_u_SNES_setConvergenceTest __pyx_string_tab[2948]
#define __pyx_n_u_SNES_setDM __pyx_string_tab[2949]
#define __pyx_n_u_SNES_setDivergenceTolerance __pyx_string_tab[2950]
#define __pyx_n_u_SNES_setErrorIfNotConverged __pyx_string_tab[2951]
#define __pyx_n_u_SNES_setFASInjection __pyx_string_tab[2952]
#define __pyx_n_u_SNES_setFASInterpolation __pyx_string_tab[2953]
#define __pyx_n_u_SNES_setFASLevels __pyx_string_tab[2954]
#define __pyx_n_u_SNES_setFASRScale __pyx_string_tab[2955]
#define __pyx_n_u_SNES_setFASRestriction __pyx_string_tab[2956]
#define __pyx_n_u_SNES_setForceIteration __pyx_string_tab[2957]
#define __pyx_n_u_SNES_setFromOptions __pyx_string_tab[2958]
#define __pyx_n_u_SNES_setFunction __pyx_string_tab[2959]
#define __pyx_n_u_SNES_setFunctionNorm __pyx_string_tab[2960]
#define __pyx_n_u_SNES_setInitialGuess __pyx_string_tab[2961]
#define __pyx_n_u_SNES_setIterationNumber __pyx_string_tab[2962]
#define __pyx_n_u_SNES_setJacobian __pyx_string_tab[2963]
#define __pyx_n_u_SNES_setKSP __pyx_string_tab[2964]
#define __pyx_n_u_SNES_setLineSearch __pyx_string_tab[2965]
#define __pyx_n_u_SNES_setLineSearchPreCheck __pyx_string_tab[2966]
#define __pyx_n_u_SNES_setMaxFunctionEvaluations __pyx_string_tab[2967]
#define __pyx_n_u_SNES_setMaxKSPFailures __pyx_string_tab[2968]
#define __pyx_n_u_SNES_setMaxStepFailures __pyx_string_tab[2969]
#define __pyx_n_u_SNES_setMonitor __pyx_string_tab[2970]
#define __pyx_n_u_SNES_setNGS __pyx_string_tab[2971]
#define __pyx_n_u_SNES_setNPC __pyx_string_tab[2972]
#define __pyx_n_u_SNES_setNPCSide __pyx_string_tab[2973]
#define __pyx_n_u_SNES_setNewtonALCorrectionType __pyx_string_tab[2974]
#define __pyx_n_u_SNES_setNewtonALFunction __pyx_string_tab[2975]
#define __pyx_n_u_SNES_setNormSchedule __pyx_string_tab[2976]
#define __pyx_n_u_SNES_setObjective __pyx_string_tab[2977]
#define __pyx_n_u_SNES_setOptionsPrefix __pyx_string_tab[2978]
#define __pyx_n_u_SNES_setParamsEW __pyx_string_tab[2979]
#define __pyx_n_u_SNES_setPatchCellNumbering __pyx_string_tab[2980]
#define __pyx_n_u_SNES_setPatchComputeFunction __pyx_string_tab[2981]
#define __pyx_n_u_SNES_setPatchComputeOperator __pyx_string_tab[2982]
#define __pyx_n_u_SNES_setPatchConstructType __pyx_string_tab[2983]
#define __pyx_n_u_SNES_setPatchDiscretisationInfo __pyx_string_tab[2984]
#define __pyx_n_u_SNES_setPythonContext __pyx_string_tab[2985]
#define __pyx_n_u_SNES_setPythonType __pyx_string_tab[2986]
#define __pyx_n_u_SNES_setResetCounters __pyx_string_tab[2987]
#define __pyx_n_u_SNES_setSolution __pyx_string_tab[2988]
#define __pyx_n_u_SNES_setTRTolerances __pyx_string_tab[2989]
#define __pyx_n_u_SNES_setTRUpdateParameters __pyx_string_tab[2990]
#define __pyx_n_u_SNES_setTolerances __pyx_string_tab[2991]
#define __pyx_n_u_SNES_setType __pyx_string_tab[2992]
#define __pyx_n_u_SNES_setUp __pyx_string_tab[2993]
#define __pyx_n_u_SNES_setUpMatrices __pyx_string_tab[2994]
#define __pyx_n_u_SNES_setUpdate __pyx_string_tab[2995]
#define __pyx_n_u_SNES_setUseEW __pyx_string_tab[2996]
#define __pyx_n_u_SNES_setUseFD __pyx_string_tab[2997]
#define __pyx_n_u_SNES_setUseKSP __pyx_string_tab[2998]
#define __pyx_n_u_SNES_setUseMF __pyx_string_tab[2999]
#define __pyx_n_u_SNES_setVariableBounds __pyx_string_tab[3000]
#define __pyx_n_u_SNES_solve __pyx_string_tab[3001]
#define __pyx_n_u_SNES_view __pyx_string_tab[3002]
#define __pyx_n_u_SOCKET __pyx_string_tab[3003]
#define __pyx_n_u_SOR __pyx_string_tab[3004]
#define __pyx_n_u_SORTED_FULL __pyx_string_tab[3005]
#define __pyx_n_u_SORType __pyx_string_tab[3006]
#define __pyx_n_u_SPAI __pyx_string_tab[3007]
#define __pyx_n_u_SPD __pyx_string_tab[3008]
#define __pyx_n_u_SPECIAL __pyx_string_tab[3009]
#define __pyx_n_u_SPECTRAL __pyx_string_tab[3010]
#define __pyx_n_u_SPQR __pyx_string_tab[3011]
#define __pyx_n_u_SPRNG __pyx_string_tab[3012]
#define __pyx_n_u_SSFLS __pyx_string_tab[3013]
#define __pyx_n_u_SSILS __pyx_string_tab[3014]
#define __pyx_n_u_SSML_BFGS __pyx_string_tab[3015]
#define __pyx_n_u_SSML_BRDN __pyx_string_tab[3016]
#define __pyx_n_u_SSML_DFP __pyx_string_tab[3017]
#define __pyx_n_u_SSP __pyx_string_tab[3018]
#define __pyx_n_u_STAG __pyx_string_tab[3019]
#define __pyx_n_u_STANDARD __pyx_string_tab[3020]
#define __pyx_n_u_STAR __pyx_string_tab[3021]
#define __pyx_n_u_STCG __pyx_string_tab[3022]
#define __pyx_n_u_STDERR __pyx_string_tab[3023]
#define __pyx_n_u_STDOUT __pyx_string_tab[3024]
#define __pyx_n_u_STEPOVER __pyx_string_tab[3025]
#define __pyx_n_u_STRIDE __pyx_string_tab[3026]
#define __pyx_n_u_STRING __pyx_string_tab[3027]
#define __pyx_n_u_STRUCTURALLY_SYMMETRIC __pyx_string_tab[3028]
#define __pyx_n_u_STRUCTURE_ONLY __pyx_string_tab[3029]
#define __pyx_n_u_STRUMPACK __pyx_string_tab[3030]
#define __pyx_n_u_SUBMATRIX __pyx_string_tab[3031]
#define __pyx_n_u_SUBMAT_SINGLEIS __pyx_string_tab[3032]
#define __pyx_n_u_SUBPC_ERROR __pyx_string_tab[3033]
#define __pyx_n_u_SUBSET __pyx_string_tab[3034]
#define __pyx_n_u_SUBSET_NONZERO_PATTERN __pyx_string_tab[3035]
#define __pyx_n_u_SUBSET_NZ __pyx_string_tab[3036]
#define __pyx_n_u_SUBSET_OFF_PROC_ENTRIES __pyx_string_tab[3037]
#define __pyx_n_u_SUBSPACE __pyx_string_tab[3038]
#define __pyx_n_u_SUCCESS __pyx_string_tab[3039]
#define __pyx_n_u_SUCCESS_USER __pyx_string_tab[3040]
#define __pyx_n_u_SUM __pyx_string_tab[3041]
#define __pyx_n_u_SUNDIALS __pyx_string_tab[3042]
#define __pyx_n_u_SUPERLU __pyx_string_tab[3043]
#define __pyx_n_u_SUPERLU_DIST __pyx_string_tab[3044]
#define __pyx_n_u_SVD __pyx_string_tab[3045]
#define __pyx_n_u_SWARM __pyx_string_tab[3046]
#define __pyx_n_u_SYCL __pyx_string_tab[3047]
#define __pyx_n_u_SYMMETRIC __pyx_string_tab[3048]
#define __pyx_n_u_SYMMETRIC_MULTIPLICATIVE __pyx_string_tab[3049]
#define __pyx_n_u_SYMMETRY_ETERNAL __pyx_string_tab[3050]
#define __pyx_n_u_SYMMETRY_SWEEP __pyx_string_tab[3051]
#define __pyx_n_u_SYMMLQ __pyx_string_tab[3052]
#define __pyx_n_u_SYNC __pyx_string_tab[3053]
#define __pyx_n_u_SYSPFMG __pyx_string_tab[3054]
#define __pyx_n_u_Scalar __pyx_string_tab[3055]
#define __pyx_n_u_ScalarType __pyx_string_tab[3056]
#define __pyx_n_u_Scatter __pyx_string_tab[3057]
#define __pyx_n_u_ScatterMode __pyx_string_tab[3058]
#define __pyx_n_u_ScatterModeSpec __pyx_string_tab[3059]
#define __pyx_n_u_ScatterType __pyx_string_tab[3060]
#define __pyx_n_u_Scatter_begin __pyx_string_tab[3061]
#define __pyx_n_u_Scatter_copy __pyx_string_tab[3062]
#define __pyx_n_u_Scatter_create __pyx_string_tab[3063]
#define __pyx_n_u_Scatter_destroy __pyx_string_tab[3064]
#define __pyx_n_u_Scatter_end __pyx_string_tab[3065]
#define __pyx_n_u_Scatter_getType __pyx_string_tab[3066]
#define __pyx_n_u_Scatter_scatter __pyx_string_tab[3067]
#define __pyx_n_u_Scatter_setFromOptions __pyx_string_tab[3068]
#define __pyx_n_u_Scatter_setType __pyx_string_tab[3069]
#define __pyx_n_u_Scatter_setUp __pyx_string_tab[3070]
#define __pyx_n_u_Scatter_toAll __pyx_string_tab[3071]
#define __pyx_n_u_Scatter_toZero __pyx_string_tab[3072]
#define __pyx_n_u_Scatter_view __pyx_string_tab[3073]
#define __pyx_n_u_SchurFactType __pyx_string_tab[3074]
#define __pyx_n_u_SchurPreType __pyx_string_tab[3075]
#define __pyx_n_u_Section __pyx_string_tab[3076]
#define __pyx_n_u_Section_addConstraintDof __pyx_string_tab[3077]
#define __pyx_n_u_Section_addDof __pyx_string_tab[3078]
#define __pyx_n_u_Section_addFieldConstraintDof __pyx_string_tab[3079]
#define __pyx_n_u_Section_addFieldDof __pyx_string_tab[3080]
#define __pyx_n_u_Section_clone __pyx_string_tab[3081]
#define __pyx_n_u_Section_create __pyx_string_tab[3082]
#define __pyx_n_u_Section_createGlobalSection __pyx_string_tab[3083]
#define __pyx_n_u_Section_destroy __pyx_string_tab[3084]
#define __pyx_n_u_Section_getChart __pyx_string_tab[3085]
#define __pyx_n_u_Section_getConstrainedStorageSiz __pyx_string_tab[3086]
#define __pyx_n_u_Section_getConstraintDof __pyx_string_tab[3087]
#define __pyx_n_u_Section_getConstraintIndices __pyx_string_tab[3088]
#define __pyx_n_u_Section_getDof __pyx_string_tab[3089]
#define __pyx_n_u_Section_getFieldComponents __pyx_string_tab[3090]
#define __pyx_n_u_Section_getFieldConstraintDof __pyx_string_tab[3091]
#define __pyx_n_u_Section_getFieldConstraintIndice __pyx_string_tab[3092]
#define __pyx_n_u_Section_getFieldDof __pyx_string_tab[3093]
#define __pyx_n_u_Section_getFieldName __pyx_string_tab[3094]
#define __pyx_n_u_Section_getFieldOffset __pyx_string_tab[3095]
#define __pyx_n_u_Section_getMaxDof __pyx_string_tab[3096]
#define __pyx_n_u_Section_getNumFields __pyx_string_tab[3097]
#define __pyx_n_u_Section_getOffset __pyx_string_tab[3098]
#define __pyx_n_u_Section_getOffsetRange __pyx_string_tab[3099]
#define __pyx_n_u_Section_getPermutation __pyx_string_tab[3100]
#define __pyx_n_u_Section_getStorageSize __pyx_string_tab[3101]
#define __pyx_n_u_Section_reset __pyx_string_tab[3102]
#define __pyx_n_u_Section_setChart __pyx_string_tab[3103]
#define __pyx_n_u_Section_setConstraintDof __pyx_string_tab[3104]
#define __pyx_n_u_Section_setConstraintIndices __pyx_string_tab[3105]
#define __pyx_n_u_Section_setDof __pyx_string_tab[3106]
#define __pyx_n_u_Section_setFieldComponents __pyx_string_tab[3107]
#define __pyx_n_u_Section_setFieldConstraintDof __pyx_string_tab[3108]
#define __pyx_n_u_Section_setFieldConstraintIndice __pyx_string_tab[3109]
#define __pyx_n_u_Section_setFieldDof __pyx_string_tab[3110]
#define __pyx_n_u_Section_setFieldName __pyx_string_tab[3111]
#define __pyx_n_u_Section_setFieldOffset __pyx_string_tab[3112]
#define __pyx_n_u_Section_setNumFields __pyx_string_tab[3113]
#define __pyx_n_u_Section_setOffset __pyx_string_tab[3114]
#define __pyx_n_u_Section_setPermutation __pyx_string_tab[3115]
#define __pyx_n_u_Section_setUp __pyx_string_tab[3116]
#define __pyx_n_u_Section_view __pyx_string_tab[3117]
#define __pyx_n_u_Self __pyx_string_tab[3118]
#define __pyx_n_u_Sequence __pyx_string_tab[3119]
#define __pyx_n_u_Side __pyx_string_tab[3120]
#define __pyx_n_u_Size __pyx_string_tab[3121]
#define __pyx_n_u_SolverType __pyx_string_tab[3122]
#define __pyx_n_u_Space __pyx_string_tab[3123]
#define __pyx_n_u_SpaceType __pyx_string_tab[3124]
#define __pyx_n_u_Space_create __pyx_string_tab[3125]
#define __pyx_n_u_Space_destroy __pyx_string_tab[3126]
#define __pyx_n_u_Space_getDegree __pyx_string_tab[3127]
#define __pyx_n_u_Space_getDimension __pyx_string_tab[3128]
#define __pyx_n_u_Space_getNumComponents __pyx_string_tab[3129]
#define __pyx_n_u_Space_getNumVariables __pyx_string_tab[3130]
#define __pyx_n_u_Space_getPTrimmedFormDegree __pyx_string_tab[3131]
#define __pyx_n_u_Space_getPointPoints __pyx_string_tab[3132]
#define __pyx_n_u_Space_getPolynomialTensor __pyx_string_tab[3133]
#define __pyx_n_u_Space_getSumConcatenate __pyx_string_tab[3134]
#define __pyx_n_u_Space_getSumNumSubspaces __pyx_string_tab[3135]
#define __pyx_n_u_Space_getSumSubspace __pyx_string_tab[3136]
#define __pyx_n_u_Space_getTensorNumSubspaces __pyx_string_tab[3137]
#define __pyx_n_u_Space_getTensorSubspace __pyx_string_tab[3138]
#define __pyx_n_u_Space_getType __pyx_string_tab[3139]
#define __pyx_n_u_Space_setDegree __pyx_string_tab[3140]
#define __pyx_n_u_Space_setFromOptions __pyx_string_tab[3141]
#define __pyx_n_u_Space_setNumComponents __pyx_string_tab[3142]
#define __pyx_n_u_Space_setNumVariables __pyx_string_tab[3143]
#define __pyx_n_u_Space_setPTrimmedFormDegree __pyx_string_tab[3144]
#define __pyx_n_u_Space_setPointPoints __pyx_string_tab[3145]
#define __pyx_n_u_Space_setPolynomialTensor __pyx_string_tab[3146]
#define __pyx_n_u_Space_setSumConcatenate __pyx_string_tab[3147]
#define __pyx_n_u_Space_setSumNumSubspaces __pyx_string_tab[3148]
#define __pyx_n_u_Space_setSumSubspace __pyx_string_tab[3149]
#define __pyx_n_u_Space_setTensorNumSubspaces __pyx_string_tab[3150]
#define __pyx_n_u_Space_setTensorSubspace __pyx_string_tab[3151]
#define __pyx_n_u_Space_setType __pyx_string_tab[3152]
#define __pyx_n_u_Space_setUp __pyx_string_tab[3153]
#define __pyx_n_u_Space_view __pyx_string_tab[3154]
#define __pyx_n_u_Stage __pyx_string_tab[3155]
#define __pyx_n_u_Stencil __pyx_string_tab[3156]
#define __pyx_n_u_StencilLocation __pyx_string_tab[3157]
#define __pyx_n_u_StencilType __pyx_string_tab[3158]
#define __pyx_n_u_StreamType __pyx_string_tab[3159]
#define __pyx_n_u_Structure __pyx_string_tab[3160]
#define __pyx_n_u_Sys __pyx_string_tab[3161]
#define __pyx_n_u_Sys_Print __pyx_string_tab[3162]
#define __pyx_n_u_Sys_getDefaultComm __pyx_string_tab[3163]
#define __pyx_n_u_Sys_getVersion __pyx_string_tab[3164]
#define __pyx_n_u_Sys_getVersionInfo __pyx_string_tab[3165]
#define __pyx_n_u_Sys_hasExternalPackage __pyx_string_tab[3166]
#define __pyx_n_u_Sys_infoAllow __pyx_string_tab[3167]
#define __pyx_n_u_Sys_isFinalized __pyx_string_tab[3168]
#define __pyx_n_u_Sys_isInitialized __pyx_string_tab[3169]
#define __pyx_n_u_Sys_popErrorHandler __pyx_string_tab[3170]
#define __pyx_n_u_Sys_popSignalHandler __pyx_string_tab[3171]
#define __pyx_n_u_Sys_pushErrorHandler __pyx_string_tab[3172]
#define __pyx_n_u_Sys_registerCitation __pyx_string_tab[3173]
#define __pyx_n_u_Sys_setDefaultComm __pyx_string_tab[3174]
#define __pyx_n_u_Sys_sleep __pyx_string_tab[3175]
#define __pyx_n_u_Sys_splitOwnership __pyx_string_tab[3176]
#define __pyx_n_u_Sys_syncFlush __pyx_string_tab[3177]
#define __pyx_n_u_Sys_syncPrint __pyx_string_tab[3178]
#define __pyx_n_u_TAO __pyx_string_tab[3179]
#define __pyx_n_u_TAOALMMType __pyx_string_tab[3180]
#define __pyx_n_u_TAOBNCGType __pyx_string_tab[3181]
#define __pyx_n_u_TAOConstraintsFunction __pyx_string_tab[3182]
#define __pyx_n_u_TAOConvergedReason __pyx_string_tab[3183]
#define __pyx_n_u_TAOGradientFunction __pyx_string_tab[3184]
#define __pyx_n_u_TAOHessianFunction __pyx_string_tab[3185]
#define __pyx_n_u_TAOJacobianFunction __pyx_string_tab[3186]
#define __pyx_n_u_TAOJacobianResidualFunction __pyx_string_tab[3187]
#define __pyx_n_u_TAOLSGradientFunction __pyx_string_tab[3188]
#define __pyx_n_u_TAOLSObjectiveFunction __pyx_string_tab[3189]
#define __pyx_n_u_TAOLSObjectiveGradientFunction __pyx_string_tab[3190]
#define __pyx_n_u_TAOLineSearch __pyx_string_tab[3191]
#define __pyx_n_u_TAOLineSearchConvergedReason __pyx_string_tab[3192]
#define __pyx_n_u_TAOLineSearchType __pyx_string_tab[3193]
#define __pyx_n_u_TAOLineSearch_apply __pyx_string_tab[3194]
#define __pyx_n_u_TAOLineSearch_create __pyx_string_tab[3195]
#define __pyx_n_u_TAOLineSearch_destroy __pyx_string_tab[3196]
#define __pyx_n_u_TAOLineSearch_getOptionsPrefix __pyx_string_tab[3197]
#define __pyx_n_u_TAOLineSearch_getType __pyx_string_tab[3198]
#define __pyx_n_u_TAOLineSearch_setFromOptions __pyx_string_tab[3199]
#define __pyx_n_u_TAOLineSearch_setGradient __pyx_string_tab[3200]
#define __pyx_n_u_TAOLineSearch_setInitialStepLeng __pyx_string_tab[3201]
#define __pyx_n_u_TAOLineSearch_setObjective __pyx_string_tab[3202]
#define __pyx_n_u_TAOLineSearch_setObjectiveGradie __pyx_string_tab[3203]
#define __pyx_n_u_TAOLineSearch_setOptionsPrefix __pyx_string_tab[3204]
#define __pyx_n_u_TAOLineSearch_setType __pyx_string_tab[3205]
#define __pyx_n_u_TAOLineSearch_setUp __pyx_string_tab[3206]
#define __pyx_n_u_TAOLineSearch_useTAORoutine __pyx_string_tab[3207]
#define __pyx_n_u_TAOLineSearch_view __pyx_string_tab[3208]
#define __pyx_n_u_TAOMonitorFunction __pyx_string_tab[3209]
#define __pyx_n_u_TAOObjectiveFunction __pyx_string_tab[3210]
#define __pyx_n_u_TAOObjectiveGradientFunction __pyx_string_tab[3211]
#define __pyx_n_u_TAOResidualFunction __pyx_string_tab[3212]
#define __pyx_n_u_TAOTerm __pyx_string_tab[3213]
#define __pyx_n_u_TAOTermType __pyx_string_tab[3214]
#define __pyx_n_u_TAOTerm_create __pyx_string_tab[3215]
#define __pyx_n_u_TAOTerm_destroy __pyx_string_tab[3216]
#define __pyx_n_u_TAOTerm_getType __pyx_string_tab[3217]
#define __pyx_n_u_TAOTerm_setFromOptions __pyx_string_tab[3218]
#define __pyx_n_u_TAOTerm_setSolutionTemplate __pyx_string_tab[3219]
#define __pyx_n_u_TAOTerm_setType __pyx_string_tab[3220]
#define __pyx_n_u_TAOTerm_setUp __pyx_string_tab[3221]
#define __pyx_n_u_TAOTerm_view __pyx_string_tab[3222]
#define __pyx_n_u_TAOType __pyx_string_tab[3223]
#define __pyx_n_u_TAOUpdateFunction __pyx_string_tab[3224]
#define __pyx_n_u_TAO_addTerm __pyx_string_tab[3225]
#define __pyx_n_u_TAO_appendOptionsPrefix __pyx_string_tab[3226]
#define __pyx_n_u_TAO_cancelMonitor __pyx_string_tab[3227]
#define __pyx_n_u_TAO_checkConverged __pyx_string_tab[3228]
#define __pyx_n_u_TAO_computeConstraints __pyx_string_tab[3229]
#define __pyx_n_u_TAO_computeDualVariables __pyx_string_tab[3230]
#define __pyx_n_u_TAO_computeGradient __pyx_string_tab[3231]
#define __pyx_n_u_TAO_computeHessian __pyx_string_tab[3232]
#define __pyx_n_u_TAO_computeJacobian __pyx_string_tab[3233]
#define __pyx_n_u_TAO_computeObjective __pyx_string_tab[3234]
#define __pyx_n_u_TAO_computeObjectiveGradient __pyx_string_tab[3235]
#define __pyx_n_u_TAO_computeResidual __pyx_string_tab[3236]
#define __pyx_n_u_TAO_computeVariableBounds __pyx_string_tab[3237]
#define __pyx_n_u_TAO_create __pyx_string_tab[3238]
#define __pyx_n_u_TAO_createPython __pyx_string_tab[3239]
#define __pyx_n_u_TAO_destroy __pyx_string_tab[3240]
#define __pyx_n_u_TAO_getALMMSubsolver __pyx_string_tab[3241]
#define __pyx_n_u_TAO_getALMMType __pyx_string_tab[3242]
#define __pyx_n_u_TAO_getAppCtx __pyx_string_tab[3243]
#define __pyx_n_u_TAO_getBNCGType __pyx_string_tab[3244]
#define __pyx_n_u_TAO_getBRGNDampingVector __pyx_string_tab[3245]
#define __pyx_n_u_TAO_getBRGNSubsolver __pyx_string_tab[3246]
#define __pyx_n_u_TAO_getConstraintTolerances __pyx_string_tab[3247]
#define __pyx_n_u_TAO_getConvergedReason __pyx_string_tab[3248]
#define __pyx_n_u_TAO_getConvergenceTest __pyx_string_tab[3249]
#define __pyx_n_u_TAO_getEqualityConstraints __pyx_string_tab[3250]
#define __pyx_n_u_TAO_getGradient __pyx_string_tab[3251]
#define __pyx_n_u_TAO_getGradientNorm __pyx_string_tab[3252]
#define __pyx_n_u_TAO_getHessian __pyx_string_tab[3253]
#define __pyx_n_u_TAO_getInequalityConstraints __pyx_string_tab[3254]
#define __pyx_n_u_TAO_getIterationNumber __pyx_string_tab[3255]
#define __pyx_n_u_TAO_getJacobianEquality __pyx_string_tab[3256]
#define __pyx_n_u_TAO_getJacobianInequality __pyx_string_tab[3257]
#define __pyx_n_u_TAO_getKSP __pyx_string_tab[3258]
#define __pyx_n_u_TAO_getLMVMH0 __pyx_string_tab[3259]
#define __pyx_n_u_TAO_getLMVMH0KSP __pyx_string_tab[3260]
#define __pyx_n_u_TAO_getLMVMMat __pyx_string_tab[3261]
#define __pyx_n_u_TAO_getLineSearch __pyx_string_tab[3262]
#define __pyx_n_u_TAO_getMaximumFunctionEvaluation __pyx_string_tab[3263]
#define __pyx_n_u_TAO_getMaximumIterations __pyx_string_tab[3264]
#define __pyx_n_u_TAO_getMonitor __pyx_string_tab[3265]
#define __pyx_n_u_TAO_getObjective __pyx_string_tab[3266]
#define __pyx_n_u_TAO_getObjectiveAndGradient __pyx_string_tab[3267]
#define __pyx_n_u_TAO_getObjectiveValue __pyx_string_tab[3268]
#define __pyx_n_u_TAO_getOptionsPrefix __pyx_string_tab[3269]
#define __pyx_n_u_TAO_getPythonContext __pyx_string_tab[3270]
#define __pyx_n_u_TAO_getPythonType __pyx_string_tab[3271]
#define __pyx_n_u_TAO_getSolution __pyx_string_tab[3272]
#define __pyx_n_u_TAO_getSolutionNorm __pyx_string_tab[3273]
#define __pyx_n_u_TAO_getSolutionStatus __pyx_string_tab[3274]
#define __pyx_n_u_TAO_getTerm __pyx_string_tab[3275]
#define __pyx_n_u_TAO_getTolerances __pyx_string_tab[3276]
#define __pyx_n_u_TAO_getType __pyx_string_tab[3277]
#define __pyx_n_u_TAO_getUpdate __pyx_string_tab[3278]
#define __pyx_n_u_TAO_getVariableBounds __pyx_string_tab[3279]
#define __pyx_n_u_TAO_monitor __pyx_string_tab[3280]
#define __pyx_n_u_TAO_setALMMSubsolver __pyx_string_tab[3281]
#define __pyx_n_u_TAO_setALMMType __pyx_string_tab[3282]
#define __pyx_n_u_TAO_setAppCtx __pyx_string_tab[3283]
#define __pyx_n_u_TAO_setBNCGType __pyx_string_tab[3284]
#define __pyx_n_u_TAO_setBRGNDictionaryMatrix __pyx_string_tab[3285]
#define __pyx_n_u_TAO_setBRGNRegularizerHessian __pyx_string_tab[3286]
#define __pyx_n_u_TAO_setBRGNRegularizerObjectiveG __pyx_string_tab[3287]
#define __pyx_n_u_TAO_setBRGNRegularizerWeight __pyx_string_tab[3288]
#define __pyx_n_u_TAO_setBRGNSmoothL1Epsilon __pyx_string_tab[3289]
#define __pyx_n_u_TAO_setConstraintTolerances __pyx_string_tab[3290]
#define __pyx_n_u_TAO_setConstraints __pyx_string_tab[3291]
#define __pyx_n_u_TAO_setConvergedReason __pyx_string_tab[3292]
#define __pyx_n_u_TAO_setConvergenceTest __pyx_string_tab[3293]
#define __pyx_n_u_TAO_setEqualityConstraints __pyx_string_tab[3294]
#define __pyx_n_u_TAO_setFromOptions __pyx_string_tab[3295]
#define __pyx_n_u_TAO_setGradient __pyx_string_tab[3296]
#define __pyx_n_u_TAO_setGradientNorm __pyx_string_tab[3297]
#define __pyx_n_u_TAO_setHessian __pyx_string_tab[3298]
#define __pyx_n_u_TAO_setInequalityConstraints __pyx_string_tab[3299]
#define __pyx_n_u_TAO_setInitialTrustRegionRadius __pyx_string_tab[3300]
#define __pyx_n_u_TAO_setIterationNumber __pyx_string_tab[3301]
#define __pyx_n_u_TAO_setJacobian __pyx_string_tab[3302]
#define __pyx_n_u_TAO_setJacobianDesign __pyx_string_tab[3303]
#define __pyx_n_u_TAO_setJacobianEquality __pyx_string_tab[3304]
#define __pyx_n_u_TAO_setJacobianInequality __pyx_string_tab[3305]
#define __pyx_n_u_TAO_setJacobianResidual __pyx_string_tab[3306]
#define __pyx_n_u_TAO_setJacobianState __pyx_string_tab[3307]
#define __pyx_n_u_TAO_setLMVMH0 __pyx_string_tab[3308]
#define __pyx_n_u_TAO_setLMVMMat __pyx_string_tab[3309]
#define __pyx_n_u_TAO_setMaximumFunctionEvaluation __pyx_string_tab[3310]
#define __pyx_n_u_TAO_setMaximumIterations __pyx_string_tab[3311]
#define __pyx_n_u_TAO_setMonitor __pyx_string_tab[3312]
#define __pyx_n_u_TAO_setObjective __pyx_string_tab[3313]
#define __pyx_n_u_TAO_setObjectiveGradient __pyx_string_tab[3314]
#define __pyx_n_u_TAO_setOptionsPrefix __pyx_string_tab[3315]
#define __pyx_n_u_TAO_setPythonContext __pyx_string_tab[3316]
#define __pyx_n_u_TAO_setPythonType __pyx_string_tab[3317]
#define __pyx_n_u_TAO_setResidual __pyx_string_tab[3318]
#define __pyx_n_u_TAO_setSolution __pyx_string_tab[3319]
#define __pyx_n_u_TAO_setStateDesignIS __pyx_string_tab[3320]
#define __pyx_n_u_TAO_setTolerances __pyx_string_tab[3321]
#define __pyx_n_u_TAO_setType __pyx_string_tab[3322]
#define __pyx_n_u_TAO_setUp __pyx_string_tab[3323]
#define __pyx_n_u_TAO_setUpdate __pyx_string_tab[3324]
#define __pyx_n_u_TAO_setVariableBounds __pyx_string_tab[3325]
#define __pyx_n_u_TAO_solve __pyx_string_tab[3326]
#define __pyx_n_u_TAO_view __pyx_string_tab[3327]
#define __pyx_n_u_TCQMR __pyx_string_tab[3328]
#define __pyx_n_u_TELESCOPE __pyx_string_tab[3329]
#define __pyx_n_u_TENSOR __pyx_string_tab[3330]
#define __pyx_n_u_TETRAHEDRON __pyx_string_tab[3331]
#define __pyx_n_u_TFQMR __pyx_string_tab[3332]
#define __pyx_n_u_TFS __pyx_string_tab[3333]
#define __pyx_n_u_TH __pyx_string_tab[3334]
#define __pyx_n_u_THETA __pyx_string_tab[3335]
#define __pyx_n_u_THIRD __pyx_string_tab[3336]
#define __pyx_n_u_THIRD_SIZE __pyx_string_tab[3337]
#define __pyx_n_u_TRANSFORMFILTER __pyx_string_tab[3338]
#define __pyx_n_u_TRANSPOSE __pyx_string_tab[3339]
#define __pyx_n_u_TRIANGLE __pyx_string_tab[3340]
#define __pyx_n_u_TRI_PRISM __pyx_string_tab[3341]
#define __pyx_n_u_TRI_PRISM_TENSOR __pyx_string_tab[3342]
#define __pyx_n_u_TRON __pyx_string_tab[3343]
#define __pyx_n_u_TRUE __pyx_string_tab[3344]
#define __pyx_n_u_TS __pyx_string_tab[3345]
#define __pyx_n_u_TSARKIMEXType __pyx_string_tab[3346]
#define __pyx_n_u_TSConvergedReason __pyx_string_tab[3347]
#define __pyx_n_u_TSDIRKType __pyx_string_tab[3348]
#define __pyx_n_u_TSEquationType __pyx_string_tab[3349]
#define __pyx_n_u_TSExactFinalTime __pyx_string_tab[3350]
#define __pyx_n_u_TSIFunction __pyx_string_tab[3351]
#define __pyx_n_u_TSIRM __pyx_string_tab[3352]
#define __pyx_n_u_TSProblemType __pyx_string_tab[3353]
#define __pyx_n_u_TSRHSFunction __pyx_string_tab[3354]
#define __pyx_n_u_TSRHSJacobian __pyx_string_tab[3355]
#define __pyx_n_u_TSRKType __pyx_string_tab[3356]
#define __pyx_n_u_TSType __pyx_string_tab[3357]
#define __pyx_n_u_TS_adjointReset __pyx_string_tab[3358]
#define __pyx_n_u_TS_adjointSetSteps __pyx_string_tab[3359]
#define __pyx_n_u_TS_adjointSetUp __pyx_string_tab[3360]
#define __pyx_n_u_TS_adjointSolve __pyx_string_tab[3361]
#define __pyx_n_u_TS_adjointStep __pyx_string_tab[3362]
#define __pyx_n_u_TS_appendOptionsPrefix __pyx_string_tab[3363]
#define __pyx_n_u_TS_clone __pyx_string_tab[3364]
#define __pyx_n_u_TS_computeI2Function __pyx_string_tab[3365]
#define __pyx_n_u_TS_computeI2Jacobian __pyx_string_tab[3366]
#define __pyx_n_u_TS_computeIFunction __pyx_string_tab[3367]
#define __pyx_n_u_TS_computeIJacobian __pyx_string_tab[3368]
#define __pyx_n_u_TS_computeIJacobianP __pyx_string_tab[3369]
#define __pyx_n_u_TS_computeRHSFunction __pyx_string_tab[3370]
#define __pyx_n_u_TS_computeRHSFunctionLinear __pyx_string_tab[3371]
#define __pyx_n_u_TS_computeRHSJacobian __pyx_string_tab[3372]
#define __pyx_n_u_TS_computeRHSJacobianConstant __pyx_string_tab[3373]
#define __pyx_n_u_TS_computeRHSJacobianP __pyx_string_tab[3374]
#define __pyx_n_u_TS_create __pyx_string_tab[3375]
#define __pyx_n_u_TS_createPython __pyx_string_tab[3376]
#define __pyx_n_u_TS_createQuadratureTS __pyx_string_tab[3377]
#define __pyx_n_u_TS_destroy __pyx_string_tab[3378]
#define __pyx_n_u_TS_getARKIMEXType __pyx_string_tab[3379]
#define __pyx_n_u_TS_getAlphaParams __pyx_string_tab[3380]
#define __pyx_n_u_TS_getAppCtx __pyx_string_tab[3381]
#define __pyx_n_u_TS_getConvergedReason __pyx_string_tab[3382]
#define __pyx_n_u_TS_getCostGradients __pyx_string_tab[3383]
#define __pyx_n_u_TS_getCostIntegral __pyx_string_tab[3384]
#define __pyx_n_u_TS_getDIRKType __pyx_string_tab[3385]
#define __pyx_n_u_TS_getDM __pyx_string_tab[3386]
#define __pyx_n_u_TS_getEquationType __pyx_string_tab[3387]
#define __pyx_n_u_TS_getEvaluationSolutions __pyx_string_tab[3388]
#define __pyx_n_u_TS_getEvaluationTimes __pyx_string_tab[3389]
#define __pyx_n_u_TS_getI2Function __pyx_string_tab[3390]
#define __pyx_n_u_TS_getI2Jacobian __pyx_string_tab[3391]
#define __pyx_n_u_TS_getIFunction __pyx_string_tab[3392]
#define __pyx_n_u_TS_getIJacobian __pyx_string_tab[3393]
#define __pyx_n_u_TS_getKSP __pyx_string_tab[3394]
#define __pyx_n_u_TS_getKSPIterations __pyx_string_tab[3395]
#define __pyx_n_u_TS_getMaxSteps __pyx_string_tab[3396]
#define __pyx_n_u_TS_getMaxTime __pyx_string_tab[3397]
#define __pyx_n_u_TS_getMonitor __pyx_string_tab[3398]
#define __pyx_n_u_TS_getNumEvents __pyx_string_tab[3399]
#define __pyx_n_u_TS_getOptionsPrefix __pyx_string_tab[3400]
#define __pyx_n_u_TS_getPostStep __pyx_string_tab[3401]
#define __pyx_n_u_TS_getPreStep __pyx_string_tab[3402]
#define __pyx_n_u_TS_getPrevTime __pyx_string_tab[3403]
#define __pyx_n_u_TS_getProblemType __pyx_string_tab[3404]
#define __pyx_n_u_TS_getPythonContext __pyx_string_tab[3405]
#define __pyx_n_u_TS_getPythonType __pyx_string_tab[3406]
#define __pyx_n_u_TS_getQuadratureTS __pyx_string_tab[3407]
#define __pyx_n_u_TS_getRHSFunction __pyx_string_tab[3408]
#define __pyx_n_u_TS_getRHSJacobian __pyx_string_tab[3409]
#define __pyx_n_u_TS_getRKType __pyx_string_tab[3410]
#define __pyx_n_u_TS_getSNES __pyx_string_tab[3411]
#define __pyx_n_u_TS_getSNESFailures __pyx_string_tab[3412]
#define __pyx_n_u_TS_getSNESIterations __pyx_string_tab[3413]
#define __pyx_n_u_TS_getSolution __pyx_string_tab[3414]
#define __pyx_n_u_TS_getSolution2 __pyx_string_tab[3415]
#define __pyx_n_u_TS_getSolveTime __pyx_string_tab[3416]
#define __pyx_n_u_TS_getStepLimits __pyx_string_tab[3417]
#define __pyx_n_u_TS_getStepNumber __pyx_string_tab[3418]
#define __pyx_n_u_TS_getStepRejections __pyx_string_tab[3419]
#define __pyx_n_u_TS_getTheta __pyx_string_tab[3420]
#define __pyx_n_u_TS_getThetaEndpoint __pyx_string_tab[3421]
#define __pyx_n_u_TS_getTime __pyx_string_tab[3422]
#define __pyx_n_u_TS_getTimeSpanSolutions __pyx_string_tab[3423]
#define __pyx_n_u_TS_getTimeStep __pyx_string_tab[3424]
#define __pyx_n_u_TS_getTolerances __pyx_string_tab[3425]
#define __pyx_n_u_TS_getType __pyx_string_tab[3426]
#define __pyx_n_u_TS_interpolate __pyx_string_tab[3427]
#define __pyx_n_u_TS_load __pyx_string_tab[3428]
#define __pyx_n_u_TS_monitor __pyx_string_tab[3429]
#define __pyx_n_u_TS_monitorCancel __pyx_string_tab[3430]
#define __pyx_n_u_TS_removeTrajectory __pyx_string_tab[3431]
#define __pyx_n_u_TS_reset __pyx_string_tab[3432]
#define __pyx_n_u_TS_restartStep __pyx_string_tab[3433]
#define __pyx_n_u_TS_rollBack __pyx_string_tab[3434]
#define __pyx_n_u_TS_setARKIMEXFastSlowSplit __pyx_string_tab[3435]
#define __pyx_n_u_TS_setARKIMEXFullyImplicit __pyx_string_tab[3436]
#define __pyx_n_u_TS_setARKIMEXType __pyx_string_tab[3437]
#define __pyx_n_u_TS_setAlphaParams __pyx_string_tab[3438]
#define __pyx_n_u_TS_setAlphaRadius __pyx_string_tab[3439]
#define __pyx_n_u_TS_setAppCtx __pyx_string_tab[3440]
#define __pyx_n_u_TS_setConvergedReason __pyx_string_tab[3441]
#define __pyx_n_u_TS_setCostGradients __pyx_string_tab[3442]
#define __pyx_n_u_TS_setDIRKType __pyx_string_tab[3443]
#define __pyx_n_u_TS_setDM __pyx_string_tab[3444]
#define __pyx_n_u_TS_setEquationType __pyx_string_tab[3445]
#define __pyx_n_u_TS_setErrorIfStepFails __pyx_string_tab[3446]
#define __pyx_n_u_TS_setEvaluationTimes __pyx_string_tab[3447]
#define __pyx_n_u_TS_setEventHandler __pyx_string_tab[3448]
#define __pyx_n_u_TS_setEventTolerances __pyx_string_tab[3449]
#define __pyx_n_u_TS_setExactFinalTime __pyx_string_tab[3450]
#define __pyx_n_u_TS_setFromOptions __pyx_string_tab[3451]
#define __pyx_n_u_TS_setI2Function __pyx_string_tab[3452]
#define __pyx_n_u_TS_setI2Jacobian __pyx_string_tab[3453]
#define __pyx_n_u_TS_setIFunction __pyx_string_tab[3454]
#define __pyx_n_u_TS_setIJacobian __pyx_string_tab[3455]
#define __pyx_n_u_TS_setIJacobianP __pyx_string_tab[3456]
#define __pyx_n_u_TS_setMaxSNESFailures __pyx_string_tab[3457]
#define __pyx_n_u_TS_setMaxStepRejections __pyx_string_tab[3458]
#define __pyx_n_u_TS_setMaxSteps __pyx_string_tab[3459]
#define __pyx_n_u_TS_setMaxTime __pyx_string_tab[3460]
#define __pyx_n_u_TS_setMonitor __pyx_string_tab[3461]
#define __pyx_n_u_TS_setOptionsPrefix __pyx_string_tab[3462]
#define __pyx_n_u_TS_setPostStep __pyx_string_tab[3463]
#define __pyx_n_u_TS_setPreStep __pyx_string_tab[3464]
#define __pyx_n_u_TS_setProblemType __pyx_string_tab[3465]
#define __pyx_n_u_TS_setPythonContext __pyx_string_tab[3466]
#define __pyx_n_u_TS_setPythonType __pyx_string_tab[3467]
#define __pyx_n_u_TS_setRHSFunction __pyx_string_tab[3468]
#define __pyx_n_u_TS_setRHSJacobian __pyx_string_tab[3469]
#define __pyx_n_u_TS_setRHSJacobianP __pyx_string_tab[3470]
#define __pyx_n_u_TS_setRHSSplitIFunction __pyx_string_tab[3471]
#define __pyx_n_u_TS_setRHSSplitIJacobian __pyx_string_tab[3472]
#define __pyx_n_u_TS_setRHSSplitIS __pyx_string_tab[3473]
#define __pyx_n_u_TS_setRHSSplitRHSFunction __pyx_string_tab[3474]
#define __pyx_n_u_TS_setRKType __pyx_string_tab[3475]
#define __pyx_n_u_TS_setSaveTrajectory __pyx_string_tab[3476]
#define __pyx_n_u_TS_setSolution __pyx_string_tab[3477]
#define __pyx_n_u_TS_setSolution2 __pyx_string_tab[3478]
#define __pyx_n_u_TS_setStepLimits __pyx_string_tab[3479]
#define __pyx_n_u_TS_setStepNumber __pyx_string_tab[3480]
#define __pyx_n_u_TS_setTheta __pyx_string_tab[3481]
#define __pyx_n_u_TS_setThetaEndpoint __pyx_string_tab[3482]
#define __pyx_n_u_TS_setTime __pyx_string_tab[3483]
#define __pyx_n_u_TS_setTimeSpan __pyx_string_tab[3484]
#define __pyx_n_u_TS_setTimeStep __pyx_string_tab[3485]
#define __pyx_n_u_TS_setTolerances __pyx_string_tab[3486]
#define __pyx_n_u_TS_setType __pyx_string_tab[3487]
#define __pyx_n_u_TS_setUp __pyx_string_tab[3488]
#define __pyx_n_u_TS_solve __pyx_string_tab[3489]
#define __pyx_n_u_TS_step __pyx_string_tab[3490]
#define __pyx_n_u_TS_view __pyx_string_tab[3491]
#define __pyx_n_u_TWIST __pyx_string_tab[3492]
#define __pyx_n_u_T_2 __pyx_string_tab[3493]
#define __pyx_n_u_Type __pyx_string_tab[3494]
#define __pyx_n_u_U __pyx_string_tab[3495]
#define __pyx_n_u_UA __pyx_string_tab[3496]
#define __pyx_n_u_UMFPACK __pyx_string_tab[3497]
#define __pyx_n_u_UNIT __pyx_string_tab[3498]
#define __pyx_n_u_UNKNOWN __pyx_string_tab[3499]
#define __pyx_n_u_UNKNOWN_CELL __pyx_string_tab[3500]
#define __pyx_n_u_UNKNOWN_FACE __pyx_string_tab[3501]
#define __pyx_n_u_UNKNOWN_NONZERO_PATTERN __pyx_string_tab[3502]
#define __pyx_n_u_UNKNOWN_NZ __pyx_string_tab[3503]
#define __pyx_n_u_UNLIMITED __pyx_string_tab[3504]
#define __pyx_n_u_UNPRECONDITIONED __pyx_string_tab[3505]
#define __pyx_n_u_UNSPECIFIED __pyx_string_tab[3506]
#define __pyx_n_u_UNUSED_NONZERO_LOCATION_ERR __pyx_string_tab[3507]
#define __pyx_n_u_UP __pyx_string_tab[3508]
#define __pyx_n_u_UPDATE __pyx_string_tab[3509]
#define __pyx_n_u_UPPER __pyx_string_tab[3510]
#define __pyx_n_u_UP_LEFT __pyx_string_tab[3511]
#define __pyx_n_u_UP_RIGHT __pyx_string_tab[3512]
#define __pyx_n_u_USER __pyx_string_tab[3513]
#define __pyx_n_u_USE_HASH_TABLE __pyx_string_tab[3514]
#define __pyx_n_u_USE_INODES __pyx_string_tab[3515]
#define __pyx_n_u_Umat __pyx_string_tab[3516]
#define __pyx_n_u_Uvec __pyx_string_tab[3517]
#define __pyx_n_u_V __pyx_string_tab[3518]
#define __pyx_n_u_VANKA __pyx_string_tab[3519]
#define __pyx_n_u_VIENNACL __pyx_string_tab[3520]
#define __pyx_n_u_VINEWTONRSLS __pyx_string_tab[3521]
#define __pyx_n_u_VINEWTONSSLS __pyx_string_tab[3522]
#define __pyx_n_u_VPBJACOBI __pyx_string_tab[3523]
#define __pyx_n_u_VTK __pyx_string_tab[3524]
#define __pyx_n_u_VTK_VTR __pyx_string_tab[3525]
#define __pyx_n_u_VTK_VTS __pyx_string_tab[3526]
#define __pyx_n_u_VTK_VTU __pyx_string_tab[3527]
#define __pyx_n_u_VU __pyx_string_tab[3528]
#define __pyx_n_u_Vec __pyx_string_tab[3529]
#define __pyx_n_u_VecOption __pyx_string_tab[3530]
#define __pyx_n_u_VecSplitToDMDA __pyx_string_tab[3531]
#define __pyx_n_u_VecType __pyx_string_tab[3532]
#define __pyx_n_u_Vec_LocalForm __pyx_string_tab[3533]
#define __pyx_n_u_Vec_LocalForm___enter __pyx_string_tab[3534]
#define __pyx_n_u_Vec_LocalForm___exit __pyx_string_tab[3535]
#define __pyx_n_u_Vec___div __pyx_string_tab[3536]
#define __pyx_n_u_Vec___dlpack __pyx_string_tab[3537]
#define __pyx_n_u_Vec___dlpack_device __pyx_string_tab[3538]
#define __pyx_n_u_Vec___enter __pyx_string_tab[3539]
#define __pyx_n_u_Vec___exit __pyx_string_tab[3540]
#define __pyx_n_u_Vec___idiv __pyx_string_tab[3541]
#define __pyx_n_u_Vec___rdiv __pyx_string_tab[3542]
#define __pyx_n_u_Vec_abs __pyx_string_tab[3543]
#define __pyx_n_u_Vec_appendOptionsPrefix __pyx_string_tab[3544]
#define __pyx_n_u_Vec_assemble __pyx_string_tab[3545]
#define __pyx_n_u_Vec_assemblyBegin __pyx_string_tab[3546]
#define __pyx_n_u_Vec_assemblyEnd __pyx_string_tab[3547]
#define __pyx_n_u_Vec_attachDLPackInfo __pyx_string_tab[3548]
#define __pyx_n_u_Vec_axpby __pyx_string_tab[3549]
#define __pyx_n_u_Vec_axpy __pyx_string_tab[3550]
#define __pyx_n_u_Vec_aypx __pyx_string_tab[3551]
#define __pyx_n_u_Vec_bindToCPU __pyx_string_tab[3552]
#define __pyx_n_u_Vec_boundToCPU __pyx_string_tab[3553]
#define __pyx_n_u_Vec_buffer __pyx_string_tab[3554]
#define __pyx_n_u_Vec_buffer___enter __pyx_string_tab[3555]
#define __pyx_n_u_Vec_buffer___exit __pyx_string_tab[3556]
#define __pyx_n_u_Vec_chop __pyx_string_tab[3557]
#define __pyx_n_u_Vec_clearDLPackInfo __pyx_string_tab[3558]
#define __pyx_n_u_Vec_concatenate __pyx_string_tab[3559]
#define __pyx_n_u_Vec_conjugate __pyx_string_tab[3560]
#define __pyx_n_u_Vec_copy __pyx_string_tab[3561]
#define __pyx_n_u_Vec_create __pyx_string_tab[3562]
#define __pyx_n_u_Vec_createCUDAWithArrays __pyx_string_tab[3563]
#define __pyx_n_u_Vec_createGhost __pyx_string_tab[3564]
#define __pyx_n_u_Vec_createGhostWithArray __pyx_string_tab[3565]
#define __pyx_n_u_Vec_createHIPWithArrays __pyx_string_tab[3566]
#define __pyx_n_u_Vec_createLocalVector __pyx_string_tab[3567]
#define __pyx_n_u_Vec_createMPI __pyx_string_tab[3568]
#define __pyx_n_u_Vec_createNest __pyx_string_tab[3569]
#define __pyx_n_u_Vec_createSeq __pyx_string_tab[3570]
#define __pyx_n_u_Vec_createShared __pyx_string_tab[3571]
#define __pyx_n_u_Vec_createViennaCLWithArrays __pyx_string_tab[3572]
#define __pyx_n_u_Vec_createWithArray __pyx_string_tab[3573]
#define __pyx_n_u_Vec_createWithDLPack __pyx_string_tab[3574]
#define __pyx_n_u_Vec_destroy __pyx_string_tab[3575]
#define __pyx_n_u_Vec_dot __pyx_string_tab[3576]
#define __pyx_n_u_Vec_dotBegin __pyx_string_tab[3577]
#define __pyx_n_u_Vec_dotEnd __pyx_string_tab[3578]
#define __pyx_n_u_Vec_dotNorm2 __pyx_string_tab[3579]
#define __pyx_n_u_Vec_duplicate __pyx_string_tab[3580]
#define __pyx_n_u_Vec_equal __pyx_string_tab[3581]
#define __pyx_n_u_Vec_exp __pyx_string_tab[3582]
#define __pyx_n_u_Vec_getArray __pyx_string_tab[3583]
#define __pyx_n_u_Vec_getBlockSize __pyx_string_tab[3584]
#define __pyx_n_u_Vec_getBuffer __pyx_string_tab[3585]
#define __pyx_n_u_Vec_getCLContextHandle __pyx_string_tab[3586]
#define __pyx_n_u_Vec_getCLMemHandle __pyx_string_tab[3587]
#define __pyx_n_u_Vec_getCLQueueHandle __pyx_string_tab[3588]
#define __pyx_n_u_Vec_getCUDAHandle __pyx_string_tab[3589]
#define __pyx_n_u_Vec_getDM __pyx_string_tab[3590]
#define __pyx_n_u_Vec_getGhostIS __pyx_string_tab[3591]
#define __pyx_n_u_Vec_getHIPHandle __pyx_string_tab[3592]
#define __pyx_n_u_Vec_getLGMap __pyx_string_tab[3593]
#define __pyx_n_u_Vec_getLocalSize __pyx_string_tab[3594]
#define __pyx_n_u_Vec_getLocalVector __pyx_string_tab[3595]
#define __pyx_n_u_Vec_getNestSubVecs __pyx_string_tab[3596]
#define __pyx_n_u_Vec_getOffloadMask __pyx_string_tab[3597]
#define __pyx_n_u_Vec_getOptionsPrefix __pyx_string_tab[3598]
#define __pyx_n_u_Vec_getOwnershipRange __pyx_string_tab[3599]
#define __pyx_n_u_Vec_getOwnershipRanges __pyx_string_tab[3600]
#define __pyx_n_u_Vec_getSize __pyx_string_tab[3601]
#define __pyx_n_u_Vec_getSizes __pyx_string_tab[3602]
#define __pyx_n_u_Vec_getSubVector __pyx_string_tab[3603]
#define __pyx_n_u_Vec_getType __pyx_string_tab[3604]
#define __pyx_n_u_Vec_getValue __pyx_string_tab[3605]
#define __pyx_n_u_Vec_getValues __pyx_string_tab[3606]
#define __pyx_n_u_Vec_getValuesStagStencil __pyx_string_tab[3607]
#define __pyx_n_u_Vec_ghostUpdate __pyx_string_tab[3608]
#define __pyx_n_u_Vec_ghostUpdateBegin __pyx_string_tab[3609]
#define __pyx_n_u_Vec_ghostUpdateEnd __pyx_string_tab[3610]
#define __pyx_n_u_Vec_isaxpy __pyx_string_tab[3611]
#define __pyx_n_u_Vec_isset __pyx_string_tab[3612]
#define __pyx_n_u_Vec_load __pyx_string_tab[3613]
#define __pyx_n_u_Vec_localForm __pyx_string_tab[3614]
#define __pyx_n_u_Vec_log __pyx_string_tab[3615]
#define __pyx_n_u_Vec_mDot __pyx_string_tab[3616]
#define __pyx_n_u_Vec_mDotBegin __pyx_string_tab[3617]
#define __pyx_n_u_Vec_mDotEnd __pyx_string_tab[3618]
#define __pyx_n_u_Vec_max __pyx_string_tab[3619]
#define __pyx_n_u_Vec_maxPointwiseDivide __pyx_string_tab[3620]
#define __pyx_n_u_Vec_maxpy __pyx_string_tab[3621]
#define __pyx_n_u_Vec_mean __pyx_string_tab[3622]
#define __pyx_n_u_Vec_min __pyx_string_tab[3623]
#define __pyx_n_u_Vec_mtDot __pyx_string_tab[3624]
#define __pyx_n_u_Vec_mtDotBegin __pyx_string_tab[3625]
#define __pyx_n_u_Vec_mtDotEnd __pyx_string_tab[3626]
#define __pyx_n_u_Vec_norm __pyx_string_tab[3627]
#define __pyx_n_u_Vec_normBegin __pyx_string_tab[3628]
#define __pyx_n_u_Vec_normEnd __pyx_string_tab[3629]
#define __pyx_n_u_Vec_normalize __pyx_string_tab[3630]
#define __pyx_n_u_Vec_permute __pyx_string_tab[3631]
#define __pyx_n_u_Vec_placeArray __pyx_string_tab[3632]
#define __pyx_n_u_Vec_pointwiseDivide __pyx_string_tab[3633]
#define __pyx_n_u_Vec_pointwiseMax __pyx_string_tab[3634]
#define __pyx_n_u_Vec_pointwiseMaxAbs __pyx_string_tab[3635]
#define __pyx_n_u_Vec_pointwiseMin __pyx_string_tab[3636]
#define __pyx_n_u_Vec_pointwiseMult __pyx_string_tab[3637]
#define __pyx_n_u_Vec_reciprocal __pyx_string_tab[3638]
#define __pyx_n_u_Vec_resetArray __pyx_string_tab[3639]
#define __pyx_n_u_Vec_restoreCLMemHandle __pyx_string_tab[3640]
#define __pyx_n_u_Vec_restoreCUDAHandle __pyx_string_tab[3641]
#define __pyx_n_u_Vec_restoreHIPHandle __pyx_string_tab[3642]
#define __pyx_n_u_Vec_restoreLocalVector __pyx_string_tab[3643]
#define __pyx_n_u_Vec_restoreSubVector __pyx_string_tab[3644]
#define __pyx_n_u_Vec_scale __pyx_string_tab[3645]
#define __pyx_n_u_Vec_set __pyx_string_tab[3646]
#define __pyx_n_u_Vec_setArray __pyx_string_tab[3647]
#define __pyx_n_u_Vec_setBlockSize __pyx_string_tab[3648]
#define __pyx_n_u_Vec_setDM __pyx_string_tab[3649]
#define __pyx_n_u_Vec_setFromOptions __pyx_string_tab[3650]
#define __pyx_n_u_Vec_setLGMap __pyx_string_tab[3651]
#define __pyx_n_u_Vec_setMPIGhost __pyx_string_tab[3652]
#define __pyx_n_u_Vec_setNestSubVecs __pyx_string_tab[3653]
#define __pyx_n_u_Vec_setOption __pyx_string_tab[3654]
#define __pyx_n_u_Vec_setOptionsPrefix __pyx_string_tab[3655]
#define __pyx_n_u_Vec_setRandom __pyx_string_tab[3656]
#define __pyx_n_u_Vec_setSizes __pyx_string_tab[3657]
#define __pyx_n_u_Vec_setType __pyx_string_tab[3658]
#define __pyx_n_u_Vec_setUp __pyx_string_tab[3659]
#define __pyx_n_u_Vec_setValue __pyx_string_tab[3660]
#define __pyx_n_u_Vec_setValueLocal __pyx_string_tab[3661]
#define __pyx_n_u_Vec_setValues __pyx_string_tab[3662]
#define __pyx_n_u_Vec_setValuesBlocked __pyx_string_tab[3663]
#define __pyx_n_u_Vec_setValuesBlockedLocal __pyx_string_tab[3664]
#define __pyx_n_u_Vec_setValuesLocal __pyx_string_tab[3665]
#define __pyx_n_u_Vec_setValuesStagStencil __pyx_string_tab[3666]
#define __pyx_n_u_Vec_shift __pyx_string_tab[3667]
#define __pyx_n_u_Vec_sqrtabs __pyx_string_tab[3668]
#define __pyx_n_u_Vec_strideGather __pyx_string_tab[3669]
#define __pyx_n_u_Vec_strideMax __pyx_string_tab[3670]
#define __pyx_n_u_Vec_strideMin __pyx_string_tab[3671]
#define __pyx_n_u_Vec_strideNorm __pyx_string_tab[3672]
#define __pyx_n_u_Vec_strideScale __pyx_string_tab[3673]
#define __pyx_n_u_Vec_strideScatter __pyx_string_tab[3674]
#define __pyx_n_u_Vec_strideSum __pyx_string_tab[3675]
#define __pyx_n_u_Vec_sum __pyx_string_tab[3676]
#define __pyx_n_u_Vec_swap __pyx_string_tab[3677]
#define __pyx_n_u_Vec_tDot __pyx_string_tab[3678]
#define __pyx_n_u_Vec_tDotBegin __pyx_string_tab[3679]
#define __pyx_n_u_Vec_tDotEnd __pyx_string_tab[3680]
#define __pyx_n_u_Vec_toDLPack __pyx_string_tab[3681]
#define __pyx_n_u_Vec_view __pyx_string_tab[3682]
#define __pyx_n_u_Vec_waxpy __pyx_string_tab[3683]
#define __pyx_n_u_Vec_zeroEntries __pyx_string_tab[3684]
#define __pyx_n_u_View_MemoryView __pyx_string_tab[3685]
#define __pyx_n_u_Viewer __pyx_string_tab[3686]
#define __pyx_n_u_ViewerDrawSize __pyx_string_tab[3687]
#define __pyx_n_u_ViewerFileMode __pyx_string_tab[3688]
#define __pyx_n_u_ViewerFormat __pyx_string_tab[3689]
#define __pyx_n_u_ViewerHDF5 __pyx_string_tab[3690]
#define __pyx_n_u_ViewerHDF5_create __pyx_string_tab[3691]
#define __pyx_n_u_ViewerHDF5_getGroup __pyx_string_tab[3692]
#define __pyx_n_u_ViewerHDF5_getTimestep __pyx_string_tab[3693]
#define __pyx_n_u_ViewerHDF5_incrementTimestep __pyx_string_tab[3694]
#define __pyx_n_u_ViewerHDF5_popGroup __pyx_string_tab[3695]
#define __pyx_n_u_ViewerHDF5_popTimestepping __pyx_string_tab[3696]
#define __pyx_n_u_ViewerHDF5_pushGroup __pyx_string_tab[3697]
#define __pyx_n_u_ViewerHDF5_pushTimestepping __pyx_string_tab[3698]
#define __pyx_n_u_ViewerHDF5_setTimestep __pyx_string_tab[3699]
#define __pyx_n_u_ViewerType __pyx_string_tab[3700]
#define __pyx_n_u_Viewer_ASCII __pyx_string_tab[3701]
#define __pyx_n_u_Viewer_BINARY __pyx_string_tab[3702]
#define __pyx_n_u_Viewer_DRAW __pyx_string_tab[3703]
#define __pyx_n_u_Viewer_STDERR __pyx_string_tab[3704]
#define __pyx_n_u_Viewer_STDOUT __pyx_string_tab[3705]
#define __pyx_n_u_Viewer_addASCIITab __pyx_string_tab[3706]
#define __pyx_n_u_Viewer_clearDraw __pyx_string_tab[3707]
#define __pyx_n_u_Viewer_create __pyx_string_tab[3708]
#define __pyx_n_u_Viewer_createASCII __pyx_string_tab[3709]
#define __pyx_n_u_Viewer_createBinary __pyx_string_tab[3710]
#define __pyx_n_u_Viewer_createDraw __pyx_string_tab[3711]
#define __pyx_n_u_Viewer_createHDF5 __pyx_string_tab[3712]
#define __pyx_n_u_Viewer_createMPIIO __pyx_string_tab[3713]
#define __pyx_n_u_Viewer_createPython __pyx_string_tab[3714]
#define __pyx_n_u_Viewer_createVTK __pyx_string_tab[3715]
#define __pyx_n_u_Viewer_destroy __pyx_string_tab[3716]
#define __pyx_n_u_Viewer_flush __pyx_string_tab[3717]
#define __pyx_n_u_Viewer_getASCIITab __pyx_string_tab[3718]
#define __pyx_n_u_Viewer_getFileMode __pyx_string_tab[3719]
#define __pyx_n_u_Viewer_getFileName __pyx_string_tab[3720]
#define __pyx_n_u_Viewer_getFormat __pyx_string_tab[3721]
#define __pyx_n_u_Viewer_getPythonContext __pyx_string_tab[3722]
#define __pyx_n_u_Viewer_getPythonType __pyx_string_tab[3723]
#define __pyx_n_u_Viewer_getSubViewer __pyx_string_tab[3724]
#define __pyx_n_u_Viewer_getType __pyx_string_tab[3725]
#define __pyx_n_u_Viewer_popASCIISynchronized __pyx_string_tab[3726]
#define __pyx_n_u_Viewer_popASCIITab __pyx_string_tab[3727]
#define __pyx_n_u_Viewer_popFormat __pyx_string_tab[3728]
#define __pyx_n_u_Viewer_printfASCII __pyx_string_tab[3729]
#define __pyx_n_u_Viewer_printfASCIISynchronized __pyx_string_tab[3730]
#define __pyx_n_u_Viewer_pushASCIISynchronized __pyx_string_tab[3731]
#define __pyx_n_u_Viewer_pushASCIITab __pyx_string_tab[3732]
#define __pyx_n_u_Viewer_pushFormat __pyx_string_tab[3733]
#define __pyx_n_u_Viewer_restoreSubViewer __pyx_string_tab[3734]
#define __pyx_n_u_Viewer_setASCIITab __pyx_string_tab[3735]
#define __pyx_n_u_Viewer_setDrawInfo __pyx_string_tab[3736]
#define __pyx_n_u_Viewer_setFileMode __pyx_string_tab[3737]
#define __pyx_n_u_Viewer_setFileName __pyx_string_tab[3738]
#define __pyx_n_u_Viewer_setFromOptions __pyx_string_tab[3739]
#define __pyx_n_u_Viewer_setPythonContext __pyx_string_tab[3740]
#define __pyx_n_u_Viewer_setPythonType __pyx_string_tab[3741]
#define __pyx_n_u_Viewer_setType __pyx_string_tab[3742]
#define __pyx_n_u_Viewer_setUp __pyx_string_tab[3743]
#define __pyx_n_u_Viewer_subtractASCIITab __pyx_string_tab[3744]
#define __pyx_n_u_Viewer_useASCIITabs __pyx_string_tab[3745]
#define __pyx_n_u_Viewer_view __pyx_string_tab[3746]
#define __pyx_n_u_Viewer_viewObjectPython __pyx_string_tab[3747]
#define __pyx_n_u_Vmat __pyx_string_tab[3748]
#define __pyx_n_u_W __pyx_string_tab[3749]
#define __pyx_n_u_WBM __pyx_string_tab[3750]
#define __pyx_n_u_WINDOW __pyx_string_tab[3751]
#define __pyx_n_u_WRITE __pyx_string_tab[3752]
#define __pyx_n_u_WXY __pyx_string_tab[3753]
#define __pyx_n_u_X __pyx_string_tab[3754]
#define __pyx_n_u_ZERO_INITIAL_GUESS __pyx_string_tab[3755]
#define __pyx_n_u__29 __pyx_string_tab[3756]
#define __pyx_n_u__30 __pyx_string_tab[3757]
#define __pyx_n_u_a __pyx_string_tab[3758]
#define __pyx_n_u_a_max __pyx_string_tab[3759]
#define __pyx_n_u_abc __pyx_string_tab[3760]
#define __pyx_n_u_abort __pyx_string_tab[3761]
#define __pyx_n_u_abs __pyx_string_tab[3762]
#define __pyx_n_u_activate __pyx_string_tab[3763]
#define __pyx_n_u_adaptLabel __pyx_string_tab[3764]
#define __pyx_n_u_adaptMetric __pyx_string_tab[3765]
#define __pyx_n_u_adaptStep __pyx_string_tab[3766]
#define __pyx_n_u_addASCIITab __pyx_string_tab[3767]
#define __pyx_n_u_addCellDM __pyx_string_tab[3768]
#define __pyx_n_u_addCoarsenHook __pyx_string_tab[3769]
#define __pyx_n_u_addCompositePCType __pyx_string_tab[3770]
#define __pyx_n_u_addConstraintDof __pyx_string_tab[3771]
#define __pyx_n_u_addConvergenceTest __pyx_string_tab[3772]
#define __pyx_n_u_addDM __pyx_string_tab[3773]
#define __pyx_n_u_addDof __pyx_string_tab[3774]
#define __pyx_n_u_addField __pyx_string_tab[3775]
#define __pyx_n_u_addFieldConstraintDof __pyx_string_tab[3776]
#define __pyx_n_u_addFieldDof __pyx_string_tab[3777]
#define __pyx_n_u_addFlops __pyx_string_tab[3778]
#define __pyx_n_u_addNPoints __pyx_string_tab[3779]
#define __pyx_n_u_addPoint __pyx_string_tab[3780]
#define __pyx_n_u_addStrata __pyx_string_tab[3781]
#define __pyx_n_u_addStrataIS __pyx_string_tab[3782]
#define __pyx_n_u_addStratum __pyx_string_tab[3783]
#define __pyx_n_u_addTerm __pyx_string_tab[3784]
#define __pyx_n_u_addv __pyx_string_tab[3785]
#define __pyx_n_u_adj __pyx_string_tab[3786]
#define __pyx_n_u_adjacency __pyx_string_tab[3787]
#define __pyx_n_u_adjointReset __pyx_string_tab[3788]
#define __pyx_n_u_adjointSetSteps __pyx_string_tab[3789]
#define __pyx_n_u_adjointSetUp __pyx_string_tab[3790]
#define __pyx_n_u_adjointSolve __pyx_string_tab[3791]
#define __pyx_n_u_adjointStep __pyx_string_tab[3792]
#define __pyx_n_u_adjoint_steps __pyx_string_tab[3793]
#define __pyx_n_u_ai __pyx_string_tab[3794]
#define __pyx_n_u_aj __pyx_string_tab[3795]
#define __pyx_n_u_allGather __pyx_string_tab[3796]
#define __pyx_n_u_allocateLMVM __pyx_string_tab[3797]
#define __pyx_n_u_allocate_buffer __pyx_string_tab[3798]
#define __pyx_n_u_allopts __pyx_string_tab[3799]
#define __pyx_n_u_allow __pyx_string_tab[3800]
#define __pyx_n_u_almm_type __pyx_string_tab[3801]
#define __pyx_n_u_alpha __pyx_string_tab[3802]
#define __pyx_n_u_alpha2 __pyx_string_tab[3803]
#define __pyx_n_u_alpha_f __pyx_string_tab[3804]
#define __pyx_n_u_alpha_m __pyx_string_tab[3805]
#define __pyx_n_u_alphas __pyx_string_tab[3806]
#define __pyx_n_u_amat __pyx_string_tab[3807]
#define __pyx_n_u_amount __pyx_string_tab[3808]
#define __pyx_n_u_aname __pyx_string_tab[3809]
#define __pyx_n_u_annotate __pyx_string_tab[3810]
#define __pyx_n_u_ao __pyx_string_tab[3811]
#define __pyx_n_u_apc __pyx_string_tab[3812]
#define __pyx_n_u_app __pyx_string_tab[3813]
#define __pyx_n_u_app2petsc __pyx_string_tab[3814]
#define __pyx_n_u_appctx __pyx_string_tab[3815]
#define __pyx_n_u_append __pyx_string_tab[3816]
#define __pyx_n_u_appendOptionsPrefix __pyx_string_tab[3817]
#define __pyx_n_u_apply __pyx_string_tab[3818]
#define __pyx_n_u_applyBlock __pyx_string_tab[3819]
#define __pyx_n_u_applyBlockInverse __pyx_string_tab[3820]
#define __pyx_n_u_applyIS __pyx_string_tab[3821]
#define __pyx_n_u_applyInverse __pyx_string_tab[3822]
#define __pyx_n_u_applySymmetricLeft __pyx_string_tab[3823]
#define __pyx_n_u_applySymmetricRight __pyx_string_tab[3824]
#define __pyx_n_u_applyTranspose __pyx_string_tab[3825]
#define __pyx_n_u_arg __pyx_string_tab[3826]
#define __pyx_n_u_args __pyx_string_tab[3827]
#define __pyx_n_u_array __pyx_string_tab[3828]
#define __pyx_n_u_array_interface __pyx_string_tab[3829]
#define __pyx_n_u_array_w __pyx_string_tab[3830]
#define __pyx_n_u_asmtype __pyx_string_tab[3831]
#define __pyx_n_u_assemble __pyx_string_tab[3832]
#define __pyx_n_u_assemblies __pyx_string_tab[3833]
#define __pyx_n_u_assembly __pyx_string_tab[3834]
#define __pyx_n_u_assemblyBegin __pyx_string_tab[3835]
#define __pyx_n_u_assemblyEnd __pyx_string_tab[3836]
#define __pyx_n_u_astype __pyx_string_tab[3837]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[3838]
#define __pyx_n_u_atexit __pyx_string_tab[3839]
#define __pyx_n_u_atol __pyx_string_tab[3840]
#define __pyx_n_u_attachDLPackInfo __pyx_string_tab[3841]
#define __pyx_n_u_attr __pyx_string_tab[3842]
#define __pyx_n_u_au __pyx_string_tab[3843]
#define __pyx_n_u_author __pyx_string_tab[3844]
#define __pyx_n_u_authorinfo __pyx_string_tab[3845]
#define __pyx_n_u_aux __pyx_string_tab[3846]
#define __pyx_n_u_av __pyx_string_tab[3847]
#define __pyx_n_u_aval __pyx_string_tab[3848]
#define __pyx_n_u_axpby __pyx_string_tab[3849]
#define __pyx_n_u_axpy __pyx_string_tab[3850]
#define __pyx_n_u_aypx __pyx_string_tab[3851]
#define __pyx_n_u_b __pyx_string_tab[3852]
#define __pyx_n_u_b_vec __pyx_string_tab[3853]
#define __pyx_n_u_back __pyx_string_tab[3854]
#define __pyx_n_u_back_down __pyx_string_tab[3855]
#define __pyx_n_u_back_down_left __pyx_string_tab[3856]
#define __pyx_n_u_back_down_right __pyx_string_tab[3857]
#define __pyx_n_u_back_left __pyx_string_tab[3858]
#define __pyx_n_u_back_right __pyx_string_tab[3859]
#define __pyx_n_u_back_up __pyx_string_tab[3860]
#define __pyx_n_u_back_up_left __pyx_string_tab[3861]
#define __pyx_n_u_back_up_right __pyx_string_tab[3862]
#define __pyx_n_u_barrier __pyx_string_tab[3863]
#define __pyx_n_u_base __pyx_string_tab[3864]
#define __pyx_n_u_batchSize __pyx_string_tab[3865]
#define __pyx_n_u_bcComps __pyx_string_tab[3866]
#define __pyx_n_u_bcField __pyx_string_tab[3867]
#define __pyx_n_u_bcPoints __pyx_string_tab[3868]
#define __pyx_n_u_bcastBegin __pyx_string_tab[3869]
#define __pyx_n_u_bcastEnd __pyx_string_tab[3870]
#define __pyx_n_u_bccomps __pyx_string_tab[3871]
#define __pyx_n_u_bcfield __pyx_string_tab[3872]
#define __pyx_n_u_bcmp __pyx_string_tab[3873]
#define __pyx_n_u_bcpoints __pyx_string_tab[3874]
#define __pyx_n_u_bdLabel __pyx_string_tab[3875]
#define __pyx_n_u_bdlabel __pyx_string_tab[3876]
#define __pyx_n_u_bdvalue __pyx_string_tab[3877]
#define __pyx_n_u_begin __pyx_string_tab[3878]
#define __pyx_n_u_begin_args __pyx_string_tab[3879]
#define __pyx_n_u_begin_kargs __pyx_string_tab[3880]
#define __pyx_n_u_beta __pyx_string_tab[3881]
#define __pyx_n_u_bindFlg __pyx_string_tab[3882]
#define __pyx_n_u_bindToCPU __pyx_string_tab[3883]
#define __pyx_n_u_bits __pyx_string_tab[3884]
#define __pyx_n_u_blockSize __pyx_string_tab[3885]
#define __pyx_n_u_block_size_2 __pyx_string_tab[3886]
#define __pyx_n_u_blocks __pyx_string_tab[3887]
#define __pyx_n_u_blocksize __pyx_string_tab[3888]
#define __pyx_n_u_bndr __pyx_string_tab[3889]
#define __pyx_n_u_bool __pyx_string_tab[3890]
#define __pyx_n_u_bool_2 __pyx_string_tab[3891]
#define __pyx_n_u_boundToCPU __pyx_string_tab[3892]
#define __pyx_n_u_boundary __pyx_string_tab[3893]
#define __pyx_n_u_boundary_type __pyx_string_tab[3894]
#define __pyx_n_u_boundary_types __pyx_string_tab[3895]
#define __pyx_n_u_box __pyx_string_tab[3896]
#define __pyx_n_u_bs_2 __pyx_string_tab[3897]
#define __pyx_n_u_bsize __pyx_string_tab[3898]
#define __pyx_n_u_btx __pyx_string_tab[3899]
#define __pyx_n_u_bty __pyx_string_tab[3900]
#define __pyx_n_u_btype __pyx_string_tab[3901]
#define __pyx_n_u_btz __pyx_string_tab[3902]
#define __pyx_n_u_buf __pyx_string_tab[3903]
#define __pyx_n_u_buffer __pyx_string_tab[3904]
#define __pyx_n_u_buffer_w __pyx_string_tab[3905]
#define __pyx_n_u_buildResidual __pyx_string_tab[3906]
#define __pyx_n_u_buildSolution __pyx_string_tab[3907]
#define __pyx_n_u_buildTwoSided __pyx_string_tab[3908]
#define __pyx_n_u_builtins __pyx_string_tab[3909]
#define __pyx_n_u_bval __pyx_string_tab[3910]
#define __pyx_n_u_bval_ra __pyx_string_tab[3911]
#define __pyx_n_u_bval_rs __pyx_string_tab[3912]
#define __pyx_n_u_bvec __pyx_string_tab[3913]
#define __pyx_n_u_c __pyx_string_tab[3914]
#define __pyx_n_u_cCellType __pyx_string_tab[3915]
#define __pyx_n_u_cEnd __pyx_string_tab[3916]
#define __pyx_n_u_cStart __pyx_string_tab[3917]
#define __pyx_n_u_caddv __pyx_string_tab[3918]
#define __pyx_n_u_callConvergenceTest __pyx_string_tab[3919]
#define __pyx_n_u_callow __pyx_string_tab[3920]
#define __pyx_n_u_calpha __pyx_string_tab[3921]
#define __pyx_n_u_calpha2 __pyx_string_tab[3922]
#define __pyx_n_u_cancelMonitor __pyx_string_tab[3923]
#define __pyx_n_u_catol __pyx_string_tab[3924]
#define __pyx_n_u_catol_2 __pyx_string_tab[3925]
#define __pyx_n_u_cbatchSize __pyx_string_tab[3926]
#define __pyx_n_u_cbdlbl __pyx_string_tab[3927]
#define __pyx_n_u_cbegin __pyx_string_tab[3928]
#define __pyx_n_u_cblockSize __pyx_string_tab[3929]
#define __pyx_n_u_cblocksize __pyx_string_tab[3930]
#define __pyx_n_u_cbs __pyx_string_tab[3931]
#define __pyx_n_u_cbuffer __pyx_string_tab[3932]
#define __pyx_n_u_ccbegin __pyx_string_tab[3933]
#define __pyx_n_u_ccell __pyx_string_tab[3934]
#define __pyx_n_u_ccellNodeMaps __pyx_string_tab[3935]
#define __pyx_n_u_ccend __pyx_string_tab[3936]
#define __pyx_n_u_ccgid __pyx_string_tab[3937]
#define __pyx_n_u_ccnorm __pyx_string_tab[3938]
#define __pyx_n_u_ccomm __pyx_string_tab[3939]
#define __pyx_n_u_ccomms __pyx_string_tab[3940]
#define __pyx_n_u_ccomp __pyx_string_tab[3941]
#define __pyx_n_u_cconcatenate __pyx_string_tab[3942]
#define __pyx_n_u_cconeOrientation __pyx_string_tab[3943]
#define __pyx_n_u_cconePoint __pyx_string_tab[3944]
#define __pyx_n_u_cconePos __pyx_string_tab[3945]
#define __pyx_n_u_ccontains __pyx_string_tab[3946]
#define __pyx_n_u_ccontinuous __pyx_string_tab[3947]
#define __pyx_n_u_ccoo_i __pyx_string_tab[3948]
#define __pyx_n_u_ccoo_j __pyx_string_tab[3949]
#define __pyx_n_u_ccoord __pyx_string_tab[3950]
#define __pyx_n_u_cctx __pyx_string_tab[3951]
#define __pyx_n_u_cd0 __pyx_string_tab[3952]
#define __pyx_n_u_cdctx __pyx_string_tab[3953]
#define __pyx_n_u_cdegmax __pyx_string_tab[3954]
#define __pyx_n_u_cdegmin __pyx_string_tab[3955]
#define __pyx_n_u_cdegree __pyx_string_tab[3956]
#define __pyx_n_u_cdepth __pyx_string_tab[3957]
#define __pyx_n_u_cdestructive __pyx_string_tab[3958]
#define __pyx_n_u_cdevice __pyx_string_tab[3959]
#define __pyx_n_u_cdevice_id __pyx_string_tab[3960]
#define __pyx_n_u_cdevice_type __pyx_string_tab[3961]
#define __pyx_n_u_cdim __pyx_string_tab[3962]
#define __pyx_n_u_cdims __pyx_string_tab[3963]
#define __pyx_n_u_cdisplay __pyx_string_tab[3964]
#define __pyx_n_u_cdist __pyx_string_tab[3965]
#define __pyx_n_u_cdistance __pyx_string_tab[3966]
#define __pyx_n_u_cdivtol __pyx_string_tab[3967]
#define __pyx_n_u_cdm __pyx_string_tab[3968]
#define __pyx_n_u_cdmax __pyx_string_tab[3969]
#define __pyx_n_u_cdmin __pyx_string_tab[3970]
#define __pyx_n_u_cdms __pyx_string_tab[3971]
#define __pyx_n_u_cdof __pyx_string_tab[3972]
#define __pyx_n_u_cdofs __pyx_string_tab[3973]
#define __pyx_n_u_cdosort __pyx_string_tab[3974]
#define __pyx_n_u_cdtol __pyx_string_tab[3975]
#define __pyx_n_u_cdtype __pyx_string_tab[3976]
#define __pyx_n_u_ce __pyx_string_tab[3977]
#define __pyx_n_u_cell __pyx_string_tab[3978]
#define __pyx_n_u_cellNodeMaps __pyx_string_tab[3979]
#define __pyx_n_u_cellVertices __pyx_string_tab[3980]
#define __pyx_n_u_celldm __pyx_string_tab[3981]
#define __pyx_n_u_cellid __pyx_string_tab[3982]
#define __pyx_n_u_cells __pyx_string_tab[3983]
#define __pyx_n_u_cend __pyx_string_tab[3984]
#define __pyx_n_u_centityDepth __pyx_string_tab[3985]
#define __pyx_n_u_centroid __pyx_string_tab[3986]
#define __pyx_n_u_ceps __pyx_string_tab[3987]
#define __pyx_n_u_ceta1 __pyx_string_tab[3988]
#define __pyx_n_u_ceta2 __pyx_string_tab[3989]
#define __pyx_n_u_ceta3 __pyx_string_tab[3990]
#define __pyx_n_u_cexists __pyx_string_tab[3991]
#define __pyx_n_u_cexoid __pyx_string_tab[3992]
#define __pyx_n_u_cf __pyx_string_tab[3993]
#define __pyx_n_u_cfaces __pyx_string_tab[3994]
#define __pyx_n_u_cfact __pyx_string_tab[3995]
#define __pyx_n_u_cfield __pyx_string_tab[3996]
#define __pyx_n_u_cfieldname __pyx_string_tab[3997]
#define __pyx_n_u_cfieldnames __pyx_string_tab[3998]
#define __pyx_n_u_cfieldvecs __pyx_string_tab[3999]
#define __pyx_n_u_cfile __pyx_string_tab[4000]
#define __pyx_n_u_cfilename __pyx_string_tab[4001]
#define __pyx_n_u_cfill __pyx_string_tab[4002]
#define __pyx_n_u_cfill_param __pyx_string_tab[4003]
#define __pyx_n_u_cfirst __pyx_string_tab[4004]
#define __pyx_n_u_cfix __pyx_string_tab[4005]
#define __pyx_n_u_cflag __pyx_string_tab[4006]
#define __pyx_n_u_cflg __pyx_string_tab[4007]
#define __pyx_n_u_cflops __pyx_string_tab[4008]
#define __pyx_n_u_cformDegree __pyx_string_tab[4009]
#define __pyx_n_u_cfunc __pyx_string_tab[4010]
#define __pyx_n_u_cg_type __pyx_string_tab[4011]
#define __pyx_n_u_cgamma __pyx_string_tab[4012]
#define __pyx_n_u_cghostBcNodes __pyx_string_tab[4013]
#define __pyx_n_u_cgid __pyx_string_tab[4014]
#define __pyx_n_u_cglobalBcNodes __pyx_string_tab[4015]
#define __pyx_n_u_cgroup __pyx_string_tab[4016]
#define __pyx_n_u_cgsec __pyx_string_tab[4017]
#define __pyx_n_u_checkConverged __pyx_string_tab[4018]
#define __pyx_n_u_chop __pyx_string_tab[4019]
#define __pyx_n_u_ci __pyx_string_tab[4020]
#define __pyx_n_u_cibdiag __pyx_string_tab[4021]
#define __pyx_n_u_cid __pyx_string_tab[4022]
#define __pyx_n_u_cidx __pyx_string_tab[4023]
#define __pyx_n_u_cidxm __pyx_string_tab[4024]
#define __pyx_n_u_cignoreHalo __pyx_string_tab[4025]
#define __pyx_n_u_cignoreOutsideDomain __pyx_string_tab[4026]
#define __pyx_n_u_cimode __pyx_string_tab[4027]
#define __pyx_n_u_cindex __pyx_string_tab[4028]
#define __pyx_n_u_cindices __pyx_string_tab[4029]
#define __pyx_n_u_cinfo __pyx_string_tab[4030]
#define __pyx_n_u_cintdim __pyx_string_tab[4031]
#define __pyx_n_u_cinterp __pyx_string_tab[4032]
#define __pyx_n_u_cinvert __pyx_string_tab[4033]
#define __pyx_n_u_cis __pyx_string_tab[4034]
#define __pyx_n_u_cisSimplex __pyx_string_tab[4035]
#define __pyx_n_u_ciscol __pyx_string_tab[4036]
#define __pyx_n_u_ciscols __pyx_string_tab[4037]
#define __pyx_n_u_cisets __pyx_string_tab[4038]
#define __pyx_n_u_cisfields __pyx_string_tab[4039]
#define __pyx_n_u_cisfrom __pyx_string_tab[4040]
#define __pyx_n_u_cisrows __pyx_string_tab[4041]
#define __pyx_n_u_cisto __pyx_string_tab[4042]
#define __pyx_n_u_cit __pyx_string_tab[4043]
#define __pyx_n_u_citation __pyx_string_tab[4044]
#define __pyx_n_u_cits __pyx_string_tab[4045]
#define __pyx_n_u_cjoin_mode __pyx_string_tab[4046]
#define __pyx_n_u_ck __pyx_string_tab[4047]
#define __pyx_n_u_cl __pyx_string_tab[4048]
#define __pyx_n_u_class __pyx_string_tab[4049]
#define __pyx_n_u_class_getitem __pyx_string_tab[4050]
#define __pyx_n_u_classid __pyx_string_tab[4051]
#define __pyx_n_u_clayoutType __pyx_string_tab[4052]
#define __pyx_n_u_clbl __pyx_string_tab[4053]
#define __pyx_n_u_clear __pyx_string_tab[4054]
#define __pyx_n_u_clearDLPackInfo __pyx_string_tab[4055]
#define __pyx_n_u_clearDS __pyx_string_tab[4056]
#define __pyx_n_u_clearDraw __pyx_string_tab[4057]
#define __pyx_n_u_clearFields __pyx_string_tab[4058]
#define __pyx_n_u_clearLabelStratum __pyx_string_tab[4059]
#define __pyx_n_u_clearLabelValue __pyx_string_tab[4060]
#define __pyx_n_u_clearStratum __pyx_string_tab[4061]
#define __pyx_n_u_clearValue __pyx_string_tab[4062]
#define __pyx_n_u_clen __pyx_string_tab[4063]
#define __pyx_n_u_clevel __pyx_string_tab[4064]
#define __pyx_n_u_clevels __pyx_string_tab[4065]
#define __pyx_n_u_clgm __pyx_string_tab[4066]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[4067]
#define __pyx_n_u_clits __pyx_string_tab[4068]
#define __pyx_n_u_clocalizationHeight __pyx_string_tab[4069]
#define __pyx_n_u_clocalized __pyx_string_tab[4070]
#define __pyx_n_u_clone __pyx_string_tab[4071]
#define __pyx_n_u_closure __pyx_string_tab[4072]
#define __pyx_n_u_clower __pyx_string_tab[4073]
#define __pyx_n_u_cls __pyx_string_tab[4074]
#define __pyx_n_u_cltol __pyx_string_tab[4075]
#define __pyx_n_u_clvecs __pyx_string_tab[4076]
#define __pyx_n_u_cm __pyx_string_tab[4077]
#define __pyx_n_u_cmap __pyx_string_tab[4078]
#define __pyx_n_u_cmats __pyx_string_tab[4079]
#define __pyx_n_u_cmax __pyx_string_tab[4080]
#define __pyx_n_u_cmaxdegree __pyx_string_tab[4081]
#define __pyx_n_u_cmaxit __pyx_string_tab[4082]
#define __pyx_n_u_cmaxits __pyx_string_tab[4083]
#define __pyx_n_u_cmaxstep __pyx_string_tab[4084]
#define __pyx_n_u_cmin __pyx_string_tab[4085]
#define __pyx_n_u_cminradius __pyx_string_tab[4086]
#define __pyx_n_u_cminstep __pyx_string_tab[4087]
#define __pyx_n_u_cmode __pyx_string_tab[4088]
#define __pyx_n_u_cmps __pyx_string_tab[4089]
#define __pyx_n_u_cmsg __pyx_string_tab[4090]
#define __pyx_n_u_cn __pyx_string_tab[4091]
#define __pyx_n_u_cname __pyx_string_tab[4092]
#define __pyx_n_u_cnamelist __pyx_string_tab[4093]
#define __pyx_n_u_cnc __pyx_string_tab[4094]
#define __pyx_n_u_cncomps __pyx_string_tab[4095]
#define __pyx_n_u_cndof __pyx_string_tab[4096]
#define __pyx_n_u_cnfields __pyx_string_tab[4097]
#define __pyx_n_u_cnlocal __pyx_string_tab[4098]
#define __pyx_n_u_cnmax __pyx_string_tab[4099]
#define __pyx_n_u_cnmin __pyx_string_tab[4100]
#define __pyx_n_u_cnnz __pyx_string_tab[4101]
#define __pyx_n_u_cnorm __pyx_string_tab[4102]
#define __pyx_n_u_cnpoints __pyx_string_tab[4103]
#define __pyx_n_u_cnroots __pyx_string_tab[4104]
#define __pyx_n_u_cnum __pyx_string_tab[4105]
#define __pyx_n_u_cnumBatches __pyx_string_tab[4106]
#define __pyx_n_u_cnumBlocks __pyx_string_tab[4107]
#define __pyx_n_u_cnumComp __pyx_string_tab[4108]
#define __pyx_n_u_cnumDof __pyx_string_tab[4109]
#define __pyx_n_u_cnumFields __pyx_string_tab[4110]
#define __pyx_n_u_cnumProcs __pyx_string_tab[4111]
#define __pyx_n_u_cnumSumSpaces __pyx_string_tab[4112]
#define __pyx_n_u_cnumTensSpaces __pyx_string_tab[4113]
#define __pyx_n_u_cnvars __pyx_string_tab[4114]
#define __pyx_n_u_coarsen __pyx_string_tab[4115]
#define __pyx_n_u_coarsenHierarchy __pyx_string_tab[4116]
#define __pyx_n_u_coarsencontext __pyx_string_tab[4117]
#define __pyx_n_u_coarsenhook __pyx_string_tab[4118]
#define __pyx_n_u_coarsenhooks __pyx_string_tab[4119]
#define __pyx_n_u_cobj __pyx_string_tab[4120]
#define __pyx_n_u_code __pyx_string_tab[4121]
#define __pyx_n_u_coeffs __pyx_string_tab[4122]
#define __pyx_n_u_coffset __pyx_string_tab[4123]
#define __pyx_n_u_col __pyx_string_tab[4124]
#define __pyx_n_u_col_bsize __pyx_string_tab[4125]
#define __pyx_n_u_collectViewCreate __pyx_string_tab[4126]
#define __pyx_n_u_collectViewDestroy __pyx_string_tab[4127]
#define __pyx_n_u_coloring __pyx_string_tab[4128]
#define __pyx_n_u_colrng __pyx_string_tab[4129]
#define __pyx_n_u_cols __pyx_string_tab[4130]
#define __pyx_n_u_column __pyx_string_tab[4131]
#define __pyx_n_u_comega __pyx_string_tab[4132]
#define __pyx_n_u_comm __pyx_string_tab[4133]
#define __pyx_n_u_comms __pyx_string_tab[4134]
#define __pyx_n_u_comp __pyx_string_tab[4135]
#define __pyx_n_u_compile __pyx_string_tab[4136]
#define __pyx_n_u_complement __pyx_string_tab[4137]
#define __pyx_n_u_compose __pyx_string_tab[4138]
#define __pyx_n_u_compressed __pyx_string_tab[4139]
#define __pyx_n_u_compute __pyx_string_tab[4140]
#define __pyx_n_u_computeCellGeometryFVM __pyx_string_tab[4141]
#define __pyx_n_u_computeConstraints __pyx_string_tab[4142]
#define __pyx_n_u_computeDegree __pyx_string_tab[4143]
#define __pyx_n_u_computeDualVariables __pyx_string_tab[4144]
#define __pyx_n_u_computeEigenvalues __pyx_string_tab[4145]
#define __pyx_n_u_computeExtremeSingularValues __pyx_string_tab[4146]
#define __pyx_n_u_computeFunction __pyx_string_tab[4147]
#define __pyx_n_u_computeGradient __pyx_string_tab[4148]
#define __pyx_n_u_computeGradientClementInterpolan __pyx_string_tab[4149]
#define __pyx_n_u_computeHessian __pyx_string_tab[4150]
#define __pyx_n_u_computeI2Function __pyx_string_tab[4151]
#define __pyx_n_u_computeI2Jacobian __pyx_string_tab[4152]
#define __pyx_n_u_computeIFunction __pyx_string_tab[4153]
#define __pyx_n_u_computeIJacobian __pyx_string_tab[4154]
#define __pyx_n_u_computeIJacobianP __pyx_string_tab[4155]
#define __pyx_n_u_computeIndex __pyx_string_tab[4156]
#define __pyx_n_u_computeJacobian __pyx_string_tab[4157]
#define __pyx_n_u_computeMoments __pyx_string_tab[4158]
#define __pyx_n_u_computeNGS __pyx_string_tab[4159]
#define __pyx_n_u_computeObjective __pyx_string_tab[4160]
#define __pyx_n_u_computeObjectiveGradient __pyx_string_tab[4161]
#define __pyx_n_u_computeRHSFunction __pyx_string_tab[4162]
#define __pyx_n_u_computeRHSFunctionLinear __pyx_string_tab[4163]
#define __pyx_n_u_computeRHSJacobian __pyx_string_tab[4164]
#define __pyx_n_u_computeRHSJacobianConstant __pyx_string_tab[4165]
#define __pyx_n_u_computeRHSJacobianP __pyx_string_tab[4166]
#define __pyx_n_u_computeResidual __pyx_string_tab[4167]
#define __pyx_n_u_computeVariableBounds __pyx_string_tab[4168]
#define __pyx_n_u_concatenate __pyx_string_tab[4169]
#define __pyx_n_u_cone __pyx_string_tab[4170]
#define __pyx_n_u_coneOrientation __pyx_string_tab[4171]
#define __pyx_n_u_conePoint __pyx_string_tab[4172]
#define __pyx_n_u_conePos __pyx_string_tab[4173]
#define __pyx_n_u_configure __pyx_string_tab[4174]
#define __pyx_n_u_conforming __pyx_string_tab[4175]
#define __pyx_n_u_conjugate __pyx_string_tab[4176]
#define __pyx_n_u_connz __pyx_string_tab[4177]
#define __pyx_n_u_constant __pyx_string_tab[4178]
#define __pyx_n_u_constraints __pyx_string_tab[4179]
#define __pyx_n_u_constructGhostCells __pyx_string_tab[4180]
#define __pyx_n_u_context __pyx_string_tab[4181]
#define __pyx_n_u_continuous __pyx_string_tab[4182]
#define __pyx_n_u_converged __pyx_string_tab[4183]
#define __pyx_n_u_convert __pyx_string_tab[4184]
#define __pyx_n_u_convertToSection __pyx_string_tab[4185]
#define __pyx_n_u_coo_i __pyx_string_tab[4186]
#define __pyx_n_u_coo_j __pyx_string_tab[4187]
#define __pyx_n_u_coo_v __pyx_string_tab[4188]
#define __pyx_n_u_coord __pyx_string_tab[4189]
#define __pyx_n_u_coordinates __pyx_string_tab[4190]
#define __pyx_n_u_coordinatesLoad __pyx_string_tab[4191]
#define __pyx_n_u_coordinatesView __pyx_string_tab[4192]
#define __pyx_n_u_coordnames __pyx_string_tab[4193]
#define __pyx_n_u_coords __pyx_string_tab[4194]
#define __pyx_n_u_coords_source __pyx_string_tab[4195]
#define __pyx_n_u_coords_target __pyx_string_tab[4196]
#define __pyx_n_u_cop __pyx_string_tab[4197]
#define __pyx_n_u_copts __pyx_string_tab[4198]
#define __pyx_n_u_copy __pyx_string_tab[4199]
#define __pyx_n_u_copyDS __pyx_string_tab[4200]
#define __pyx_n_u_copyDisc __pyx_string_tab[4201]
#define __pyx_n_u_copyFields __pyx_string_tab[4202]
#define __pyx_n_u_copyPoint __pyx_string_tab[4203]
#define __pyx_n_u_copy_2 __pyx_string_tab[4204]
#define __pyx_n_u_corder __pyx_string_tab[4205]
#define __pyx_n_u_correction_type __pyx_string_tab[4206]
#define __pyx_n_u_corrtype __pyx_string_tab[4207]
#define __pyx_n_u_cost __pyx_string_tab[4208]
#define __pyx_n_u_cother __pyx_string_tab[4209]
#define __pyx_n_u_count __pyx_string_tab[4210]
#define __pyx_n_u_counts __pyx_string_tab[4211]
#define __pyx_n_u_coutput __pyx_string_tab[4212]
#define __pyx_n_u_coveringPoints __pyx_string_tab[4213]
#define __pyx_n_u_coverlap __pyx_string_tab[4214]
#define __pyx_n_u_cp __pyx_string_tab[4215]
#define __pyx_n_u_cpackage __pyx_string_tab[4216]
#define __pyx_n_u_cparallel __pyx_string_tab[4217]
#define __pyx_n_u_cpart __pyx_string_tab[4218]
#define __pyx_n_u_cpend __pyx_string_tab[4219]
#define __pyx_n_u_cperm __pyx_string_tab[4220]
#define __pyx_n_u_cpi __pyx_string_tab[4221]
#define __pyx_n_u_cpidlist __pyx_string_tab[4222]
#define __pyx_n_u_cpj __pyx_string_tab[4223]
#define __pyx_n_u_cpoint __pyx_string_tab[4224]
#define __pyx_n_u_cpoints __pyx_string_tab[4225]
#define __pyx_n_u_cprefix __pyx_string_tab[4226]
#define __pyx_n_u_cproject __pyx_string_tab[4227]
#define __pyx_n_u_cpstart __pyx_string_tab[4228]
#define __pyx_n_u_cpuarray __pyx_string_tab[4229]
#define __pyx_n_u_cputime __pyx_string_tab[4230]
#define __pyx_n_u_cqorder __pyx_string_tab[4231]
#define __pyx_n_u_cradius __pyx_string_tab[4232]
#define __pyx_n_u_crank __pyx_string_tab[4233]
#define __pyx_n_u_cratio __pyx_string_tab[4234]
#define __pyx_n_u_crbegin __pyx_string_tab[4235]
#define __pyx_n_u_creason __pyx_string_tab[4236]
#define __pyx_n_u_create __pyx_string_tab[4237]
#define __pyx_n_u_createAIJ __pyx_string_tab[4238]
#define __pyx_n_u_createAIJCRL __pyx_string_tab[4239]
#define __pyx_n_u_createAIJWithArrays __pyx_string_tab[4240]
#define __pyx_n_u_createASCII __pyx_string_tab[4241]
#define __pyx_n_u_createBAIJ __pyx_string_tab[4242]
#define __pyx_n_u_createBasic __pyx_string_tab[4243]
#define __pyx_n_u_createBinary __pyx_string_tab[4244]
#define __pyx_n_u_createBlock __pyx_string_tab[4245]
#define __pyx_n_u_createBoxMesh __pyx_string_tab[4246]
#define __pyx_n_u_createBoxSurfaceMesh __pyx_string_tab[4247]
#define __pyx_n_u_createByCell __pyx_string_tab[4248]
#define __pyx_n_u_createCGNS __pyx_string_tab[4249]
#define __pyx_n_u_createCGNSFromFile __pyx_string_tab[4250]
#define __pyx_n_u_createCUDAWithArrays __pyx_string_tab[4251]
#define __pyx_n_u_createClosureIndex __pyx_string_tab[4252]
#define __pyx_n_u_createCoarsePointIS __pyx_string_tab[4253]
#define __pyx_n_u_createCohesiveSubmesh __pyx_string_tab[4254]
#define __pyx_n_u_createColoring __pyx_string_tab[4255]
#define __pyx_n_u_createCompatibleDMStag __pyx_string_tab[4256]
#define __pyx_n_u_createConstantDiagonal __pyx_string_tab[4257]
#define __pyx_n_u_createCoordinateSpace __pyx_string_tab[4258]
#define __pyx_n_u_createDS __pyx_string_tab[4259]
#define __pyx_n_u_createDefault __pyx_string_tab[4260]
#define __pyx_n_u_createDefaultSF __pyx_string_tab[4261]
#define __pyx_n_u_createDense __pyx_string_tab[4262]
#define __pyx_n_u_createDenseCUDA __pyx_string_tab[4263]
#define __pyx_n_u_createDiagonal __pyx_string_tab[4264]
#define __pyx_n_u_createDraw __pyx_string_tab[4265]
#define __pyx_n_u_createEmbeddedLeafSF __pyx_string_tab[4266]
#define __pyx_n_u_createEmbeddedRootSF __pyx_string_tab[4267]
#define __pyx_n_u_createExodus __pyx_string_tab[4268]
#define __pyx_n_u_createExodusFromFile __pyx_string_tab[4269]
#define __pyx_n_u_createFieldDecomposition __pyx_string_tab[4270]
#define __pyx_n_u_createFromCellList __pyx_string_tab[4271]
#define __pyx_n_u_createFromFile __pyx_string_tab[4272]
#define __pyx_n_u_createGeneral __pyx_string_tab[4273]
#define __pyx_n_u_createGhost __pyx_string_tab[4274]
#define __pyx_n_u_createGhostWithArray __pyx_string_tab[4275]
#define __pyx_n_u_createGlobalSection __pyx_string_tab[4276]
#define __pyx_n_u_createGlobalToNaturalSF __pyx_string_tab[4277]
#define __pyx_n_u_createGlobalVec __pyx_string_tab[4278]
#define __pyx_n_u_createGlobalVector __pyx_string_tab[4279]
#define __pyx_n_u_createGlobalVectorFromField __pyx_string_tab[4280]
#define __pyx_n_u_createGlobalVectorFromFields __pyx_string_tab[4281]
#define __pyx_n_u_createGmsh __pyx_string_tab[4282]
#define __pyx_n_u_createH2OpusFromMat __pyx_string_tab[4283]
#define __pyx_n_u_createHDF5 __pyx_string_tab[4284]
#define __pyx_n_u_createHIPWithArrays __pyx_string_tab[4285]
#define __pyx_n_u_createHermitianTranspose __pyx_string_tab[4286]
#define __pyx_n_u_createHtoolFromKernel __pyx_string_tab[4287]
#define __pyx_n_u_createIS __pyx_string_tab[4288]
#define __pyx_n_u_createIndex __pyx_string_tab[4289]
#define __pyx_n_u_createInjection __pyx_string_tab[4290]
#define __pyx_n_u_createInterpolation __pyx_string_tab[4291]
#define __pyx_n_u_createInverse __pyx_string_tab[4292]
#define __pyx_n_u_createLRC __pyx_string_tab[4293]
#define __pyx_n_u_createLabel __pyx_string_tab[4294]
#define __pyx_n_u_createLagrange __pyx_string_tab[4295]
#define __pyx_n_u_createLocalVec __pyx_string_tab[4296]
#define __pyx_n_u_createLocalVector __pyx_string_tab[4297]
#define __pyx_n_u_createLocalVectorFromField __pyx_string_tab[4298]
#define __pyx_n_u_createLocalVectorFromFields __pyx_string_tab[4299]
#define __pyx_n_u_createMPI __pyx_string_tab[4300]
#define __pyx_n_u_createMPIIO __pyx_string_tab[4301]
#define __pyx_n_u_createMapping __pyx_string_tab[4302]
#define __pyx_n_u_createMassMatrix __pyx_string_tab[4303]
#define __pyx_n_u_createMat __pyx_string_tab[4304]
#define __pyx_n_u_createMatrix __pyx_string_tab[4305]
#define __pyx_n_u_createMemoryScalable __pyx_string_tab[4306]
#define __pyx_n_u_createNaturalVec __pyx_string_tab[4307]
#define __pyx_n_u_createNaturalVector __pyx_string_tab[4308]
#define __pyx_n_u_createNest __pyx_string_tab[4309]
#define __pyx_n_u_createNormal __pyx_string_tab[4310]
#define __pyx_n_u_createNormalHermitian __pyx_string_tab[4311]
#define __pyx_n_u_createPointNumbering __pyx_string_tab[4312]
#define __pyx_n_u_createPython __pyx_string_tab[4313]
#define __pyx_n_u_createQuadratureTS __pyx_string_tab[4314]
#define __pyx_n_u_createRestriction __pyx_string_tab[4315]
#define __pyx_n_u_createRigidBody __pyx_string_tab[4316]
#define __pyx_n_u_createSBAIJ __pyx_string_tab[4317]
#define __pyx_n_u_createSF __pyx_string_tab[4318]
#define __pyx_n_u_createScatter __pyx_string_tab[4319]
#define __pyx_n_u_createSchurComplement __pyx_string_tab[4320]
#define __pyx_n_u_createSection __pyx_string_tab[4321]
#define __pyx_n_u_createSectionSF __pyx_string_tab[4322]
#define __pyx_n_u_createSeq __pyx_string_tab[4323]
#define __pyx_n_u_createShared __pyx_string_tab[4324]
#define __pyx_n_u_createStride __pyx_string_tab[4325]
#define __pyx_n_u_createSubDM __pyx_string_tab[4326]
#define __pyx_n_u_createSubMatrices __pyx_string_tab[4327]
#define __pyx_n_u_createSubMatrix __pyx_string_tab[4328]
#define __pyx_n_u_createSubMatrixVirtual __pyx_string_tab[4329]
#define __pyx_n_u_createTranspose __pyx_string_tab[4330]
#define __pyx_n_u_createVTK __pyx_string_tab[4331]
#define __pyx_n_u_createVecLeft __pyx_string_tab[4332]
#define __pyx_n_u_createVecRight __pyx_string_tab[4333]
#define __pyx_n_u_createVecs __pyx_string_tab[4334]
#define __pyx_n_u_createViennaCLWithArrays __pyx_string_tab[4335]
#define __pyx_n_u_createWithArray __pyx_string_tab[4336]
#define __pyx_n_u_createWithDLPack __pyx_string_tab[4337]
#define __pyx_n_u_create_gvec __pyx_string_tab[4338]
#define __pyx_n_u_create_injection __pyx_string_tab[4339]
#define __pyx_n_u_create_interpolation __pyx_string_tab[4340]
#define __pyx_n_u_create_lvec __pyx_string_tab[4341]
#define __pyx_n_u_create_matrix __pyx_string_tab[4342]
#define __pyx_n_u_create_restriction __pyx_string_tab[4343]
#define __pyx_n_u_create_subdm __pyx_string_tab[4344]
#define __pyx_n_u_cred __pyx_string_tab[4345]
#define __pyx_n_u_credundant __pyx_string_tab[4346]
#define __pyx_n_u_credundantPoints __pyx_string_tab[4347]
#define __pyx_n_u_cremoteOffsets __pyx_string_tab[4348]
#define __pyx_n_u_crend __pyx_string_tab[4349]
#define __pyx_n_u_cres __pyx_string_tab[4350]
#define __pyx_n_u_crglbl __pyx_string_tab[4351]
#define __pyx_n_u_crows __pyx_string_tab[4352]
#define __pyx_n_u_crtol __pyx_string_tab[4353]
#define __pyx_n_u_crtol_0 __pyx_string_tab[4354]
#define __pyx_n_u_crtol_2 __pyx_string_tab[4355]
#define __pyx_n_u_crtol_max __pyx_string_tab[4356]
#define __pyx_n_u_cs __pyx_string_tab[4357]
#define __pyx_n_u_csanitize __pyx_string_tab[4358]
#define __pyx_n_u_cscale __pyx_string_tab[4359]
#define __pyx_n_u_csctm __pyx_string_tab[4360]
#define __pyx_n_u_csdim __pyx_string_tab[4361]
#define __pyx_n_u_csec __pyx_string_tab[4362]
#define __pyx_n_u_cselected __pyx_string_tab[4363]
#define __pyx_n_u_csf __pyx_string_tab[4364]
#define __pyx_n_u_cshift __pyx_string_tab[4365]
#define __pyx_n_u_csimplex __pyx_string_tab[4366]
#define __pyx_n_u_csize __pyx_string_tab[4367]
#define __pyx_n_u_csizes __pyx_string_tab[4368]
#define __pyx_n_u_csortype __pyx_string_tab[4369]
#define __pyx_n_u_csparseLocalize __pyx_string_tab[4370]
#define __pyx_n_u_csr __pyx_string_tab[4371]
#define __pyx_n_u_cstage __pyx_string_tab[4372]
#define __pyx_n_u_cstart __pyx_string_tab[4373]
#define __pyx_n_u_cstarts __pyx_string_tab[4374]
#define __pyx_n_u_cstate __pyx_string_tab[4375]
#define __pyx_n_u_cstep __pyx_string_tab[4376]
#define __pyx_n_u_cstol __pyx_string_tab[4377]
#define __pyx_n_u_cstratum __pyx_string_tab[4378]
#define __pyx_n_u_cstream_type __pyx_string_tab[4379]
#define __pyx_n_u_cstring __pyx_string_tab[4380]
#define __pyx_n_u_csubctxs __pyx_string_tab[4381]
#define __pyx_n_u_csubspaceOffsets __pyx_string_tab[4382]
#define __pyx_n_u_csuccess __pyx_string_tab[4383]
#define __pyx_n_u_csvalue __pyx_string_tab[4384]
#define __pyx_n_u_csx __pyx_string_tab[4385]
#define __pyx_n_u_ct1 __pyx_string_tab[4386]
#define __pyx_n_u_ct2 __pyx_string_tab[4387]
#define __pyx_n_u_ctab __pyx_string_tab[4388]
#define __pyx_n_u_ctabs __pyx_string_tab[4389]
#define __pyx_n_u_ctensor __pyx_string_tab[4390]
#define __pyx_n_u_cthreshold __pyx_string_tab[4391]
#define __pyx_n_u_ctimestep __pyx_string_tab[4392]
#define __pyx_n_u_ctitle __pyx_string_tab[4393]
#define __pyx_n_u_ctoindx __pyx_string_tab[4394]
#define __pyx_n_u_ctranspose __pyx_string_tab[4395]
#define __pyx_n_u_ctrimmed __pyx_string_tab[4396]
#define __pyx_n_u_ctx __pyx_string_tab[4397]
#define __pyx_n_u_ctx0 __pyx_string_tab[4398]
#define __pyx_n_u_ctxhdl __pyx_string_tab[4399]
#define __pyx_n_u_ctype __pyx_string_tab[4400]
#define __pyx_n_u_cudahandle __pyx_string_tab[4401]
#define __pyx_n_u_cupper __pyx_string_tab[4402]
#define __pyx_n_u_cuseCone __pyx_string_tab[4403]
#define __pyx_n_u_cuseInitialGuess __pyx_string_tab[4404]
#define __pyx_n_u_cval __pyx_string_tab[4405]
#define __pyx_n_u_cvals __pyx_string_tab[4406]
#define __pyx_n_u_cvalue __pyx_string_tab[4407]
#define __pyx_n_u_cvec __pyx_string_tab[4408]
#define __pyx_n_u_cvecs __pyx_string_tab[4409]
#define __pyx_n_u_cversion __pyx_string_tab[4410]
#define __pyx_n_u_cviewer __pyx_string_tab[4411]
#define __pyx_n_u_cweight __pyx_string_tab[4412]
#define __pyx_n_u_cweights __pyx_string_tab[4413]
#define __pyx_n_u_cycle_type __pyx_string_tab[4414]
#define __pyx_n_u_d __pyx_string_tab[4415]
#define __pyx_n_u_d_is __pyx_string_tab[4416]
#define __pyx_n_u_da __pyx_string_tab[4417]
#define __pyx_n_u_damp __pyx_string_tab[4418]
#define __pyx_n_u_data __pyx_string_tab[4419]
#define __pyx_n_u_date __pyx_string_tab[4420]
#define __pyx_n_u_davec __pyx_string_tab[4421]
#define __pyx_n_u_dctx __pyx_string_tab[4422]
#define __pyx_n_u_deactivate __pyx_string_tab[4423]
#define __pyx_n_u_debugger __pyx_string_tab[4424]
#define __pyx_n_u_decRef __pyx_string_tab[4425]
#define __pyx_n_u_decode __pyx_string_tab[4426]
#define __pyx_n_u_decomp __pyx_string_tab[4427]
#define __pyx_n_u_decorator __pyx_string_tab[4428]
#define __pyx_n_u_deepcopy __pyx_string_tab[4429]
#define __pyx_n_u_default __pyx_string_tab[4430]
#define __pyx_n_u_degree __pyx_string_tab[4431]
#define __pyx_n_u_delValue __pyx_string_tab[4432]
#define __pyx_n_u_delta_0 __pyx_string_tab[4433]
#define __pyx_n_u_delta_max __pyx_string_tab[4434]
#define __pyx_n_u_delta_min __pyx_string_tab[4435]
#define __pyx_n_u_dense __pyx_string_tab[4436]
#define __pyx_n_u_depth __pyx_string_tab[4437]
#define __pyx_n_u_design __pyx_string_tab[4438]
#define __pyx_n_u_destroy __pyx_string_tab[4439]
#define __pyx_n_u_destroyGlobalVectorFromField __pyx_string_tab[4440]
#define __pyx_n_u_destroyGlobalVectorFromFields __pyx_string_tab[4441]
#define __pyx_n_u_destroyIndex __pyx_string_tab[4442]
#define __pyx_n_u_destroyLocalVectorFromField __pyx_string_tab[4443]
#define __pyx_n_u_destroyLocalVectorFromFields __pyx_string_tab[4444]
#define __pyx_n_u_destroyOptionsHandlers __pyx_string_tab[4445]
#define __pyx_n_u_destructive __pyx_string_tab[4446]
#define __pyx_n_u_determinant __pyx_string_tab[4447]
#define __pyx_n_u_dev __pyx_string_tab[4448]
#define __pyx_n_u_devId __pyx_string_tab[4449]
#define __pyx_n_u_devel __pyx_string_tab[4450]
#define __pyx_n_u_device __pyx_string_tab[4451]
#define __pyx_n_u_device_id __pyx_string_tab[4452]
#define __pyx_n_u_device_type __pyx_string_tab[4453]
#define __pyx_n_u_diag __pyx_string_tab[4454]
#define __pyx_n_u_diagonalScale __pyx_string_tab[4455]
#define __pyx_n_u_diagonal_fill __pyx_string_tab[4456]
#define __pyx_n_u_dict __pyx_string_tab[4457]
#define __pyx_n_u_dict_2 __pyx_string_tab[4458]
#define __pyx_n_u_difference __pyx_string_tab[4459]
#define __pyx_n_u_dim __pyx_string_tab[4460]
#define __pyx_n_u_dims __pyx_string_tab[4461]
#define __pyx_n_u_direction __pyx_string_tab[4462]
#define __pyx_n_u_disc __pyx_string_tab[4463]
#define __pyx_n_u_display __pyx_string_tab[4464]
#define __pyx_n_u_dist __pyx_string_tab[4465]
#define __pyx_n_u_distance __pyx_string_tab[4466]
#define __pyx_n_u_distribute __pyx_string_tab[4467]
#define __pyx_n_u_distributeField __pyx_string_tab[4468]
#define __pyx_n_u_distributeGetDefault __pyx_string_tab[4469]
#define __pyx_n_u_distributeOverlap __pyx_string_tab[4470]
#define __pyx_n_u_distributeSection __pyx_string_tab[4471]
#define __pyx_n_u_distributeSetDefault __pyx_string_tab[4472]
#define __pyx_n_u_distributionGetName __pyx_string_tab[4473]
#define __pyx_n_u_distributionSetName __pyx_string_tab[4474]
#define __pyx_n_u_div __pyx_string_tab[4475]
#define __pyx_n_u_div_2 __pyx_string_tab[4476]
#define __pyx_n_u_divtol __pyx_string_tab[4477]
#define __pyx_n_u_dl_tensor __pyx_string_tab[4478]
#define __pyx_n_u_dlm_tensor __pyx_string_tab[4479]
#define __pyx_n_u_dlpack __pyx_string_tab[4480]
#define __pyx_n_u_dlpack_device __pyx_string_tab[4481]
#define __pyx_n_u_dltensor __pyx_string_tab[4482]
#define __pyx_n_u_dltype __pyx_string_tab[4483]
#define __pyx_n_u_dm __pyx_string_tab[4484]
#define __pyx_n_u_dmDet __pyx_string_tab[4485]
#define __pyx_n_u_dmGhosted __pyx_string_tab[4486]
#define __pyx_n_u_dmOld __pyx_string_tab[4487]
#define __pyx_n_u_dmOverlap __pyx_string_tab[4488]
#define __pyx_n_u_dmParallel __pyx_string_tab[4489]
#define __pyx_n_u_dmTo __pyx_string_tab[4490]
#define __pyx_n_u_dm_type __pyx_string_tab[4491]
#define __pyx_n_u_dmactive __pyx_string_tab[4492]
#define __pyx_n_u_dmc __pyx_string_tab[4493]
#define __pyx_n_u_dmcomm __pyx_string_tab[4494]
#define __pyx_n_u_dmf __pyx_string_tab[4495]
#define __pyx_n_u_dmlabel __pyx_string_tab[4496]
#define __pyx_n_u_dms __pyx_string_tab[4497]
#define __pyx_n_u_dmswarm_type __pyx_string_tab[4498]
#define __pyx_n_u_dmtype __pyx_string_tab[4499]
#define __pyx_n_u_doc __pyx_string_tab[4500]
#define __pyx_n_u_dof __pyx_string_tab[4501]
#define __pyx_n_u_dof0 __pyx_string_tab[4502]
#define __pyx_n_u_dof1 __pyx_string_tab[4503]
#define __pyx_n_u_dof2 __pyx_string_tab[4504]
#define __pyx_n_u_dof3 __pyx_string_tab[4505]
#define __pyx_n_u_dofs __pyx_string_tab[4506]
#define __pyx_n_u_done __pyx_string_tab[4507]
#define __pyx_n_u_dosort __pyx_string_tab[4508]
#define __pyx_n_u_dot __pyx_string_tab[4509]
#define __pyx_n_u_dotBegin __pyx_string_tab[4510]
#define __pyx_n_u_dotEnd __pyx_string_tab[4511]
#define __pyx_n_u_dotNorm2 __pyx_string_tab[4512]
#define __pyx_n_u_down __pyx_string_tab[4513]
#define __pyx_n_u_down_left __pyx_string_tab[4514]
#define __pyx_n_u_down_right __pyx_string_tab[4515]
#define __pyx_n_u_drop __pyx_string_tab[4516]
#define __pyx_n_u_ds __pyx_string_tab[4517]
#define __pyx_n_u_ds_type __pyx_string_tab[4518]
#define __pyx_n_u_dspace __pyx_string_tab[4519]
#define __pyx_n_u_dt __pyx_string_tab[4520]
#define __pyx_n_u_dtcol __pyx_string_tab[4521]
#define __pyx_n_u_dtcount __pyx_string_tab[4522]
#define __pyx_n_u_dtol __pyx_string_tab[4523]
#define __pyx_n_u_dtype __pyx_string_tab[4524]
#define __pyx_n_u_dtype_is_object __pyx_string_tab[4525]
#define __pyx_n_u_dualspace_type __pyx_string_tab[4526]
#define __pyx_n_u_dummy __pyx_string_tab[4527]
#define __pyx_n_u_duplicate __pyx_string_tab[4528]
#define __pyx_n_u_dvec __pyx_string_tab[4529]
#define __pyx_n_u_e __pyx_string_tab[4530]
#define __pyx_n_u_eigen __pyx_string_tab[4531]
#define __pyx_n_u_elem_type __pyx_string_tab[4532]
#define __pyx_n_u_element __pyx_string_tab[4533]
#define __pyx_n_u_elements __pyx_string_tab[4534]
#define __pyx_n_u_elems __pyx_string_tab[4535]
#define __pyx_n_u_emacs __pyx_string_tab[4536]
#define __pyx_n_u_embed __pyx_string_tab[4537]
#define __pyx_n_u_encode __pyx_string_tab[4538]
#define __pyx_n_u_end __pyx_string_tab[4539]
#define __pyx_n_u_end_args __pyx_string_tab[4540]
#define __pyx_n_u_end_kargs __pyx_string_tab[4541]
#define __pyx_n_u_enter __pyx_string_tab[4542]
#define __pyx_n_u_entityDepth __pyx_string_tab[4543]
#define __pyx_n_u_entries __pyx_string_tab[4544]
#define __pyx_n_u_entry __pyx_string_tab[4545]
#define __pyx_n_u_enum2str __pyx_string_tab[4546]
#define __pyx_n_u_enumerate __pyx_string_tab[4547]
#define __pyx_n_u_epe __pyx_string_tab[4548]
#define __pyx_n_u_epsilon __pyx_string_tab[4549]
#define __pyx_n_u_eqtype __pyx_string_tab[4550]
#define __pyx_n_u_equal __pyx_string_tab[4551]
#define __pyx_n_u_equality_constraints __pyx_string_tab[4552]
#define __pyx_n_u_ernc __pyx_string_tab[4553]
#define __pyx_n_u_errhandler __pyx_string_tab[4554]
#define __pyx_n_u_error __pyx_string_tab[4555]
#define __pyx_n_u_eta __pyx_string_tab[4556]
#define __pyx_n_u_eta1 __pyx_string_tab[4557]
#define __pyx_n_u_eta2 __pyx_string_tab[4558]
#define __pyx_n_u_eta3 __pyx_string_tab[4559]
#define __pyx_n_u_etype __pyx_string_tab[4560]
#define __pyx_n_u_eval __pyx_string_tab[4561]
#define __pyx_n_u_evaluate __pyx_string_tab[4562]
#define __pyx_n_u_evaluatestep __pyx_string_tab[4563]
#define __pyx_n_u_event __pyx_string_tab[4564]
#define __pyx_n_u_eventid __pyx_string_tab[4565]
#define __pyx_n_u_exc __pyx_string_tab[4566]
#define __pyx_n_u_exec __pyx_string_tab[4567]
#define __pyx_n_u_exit __pyx_string_tab[4568]
#define __pyx_n_u_exoid __pyx_string_tab[4569]
#define __pyx_n_u_exp __pyx_string_tab[4570]
#define __pyx_n_u_expand __pyx_string_tab[4571]
#define __pyx_n_u_f __pyx_string_tab[4572]
#define __pyx_n_u_faces __pyx_string_tab[4573]
#define __pyx_n_u_fact __pyx_string_tab[4574]
#define __pyx_n_u_factorCholesky __pyx_string_tab[4575]
#define __pyx_n_u_factorICC __pyx_string_tab[4576]
#define __pyx_n_u_factorILU __pyx_string_tab[4577]
#define __pyx_n_u_factorLU __pyx_string_tab[4578]
#define __pyx_n_u_factorNumericCholesky __pyx_string_tab[4579]
#define __pyx_n_u_factorNumericLU __pyx_string_tab[4580]
#define __pyx_n_u_factorSymbolicCholesky __pyx_string_tab[4581]
#define __pyx_n_u_factorSymbolicICC __pyx_string_tab[4582]
#define __pyx_n_u_factorSymbolicILU __pyx_string_tab[4583]
#define __pyx_n_u_factorSymbolicLU __pyx_string_tab[4584]
#define __pyx_n_u_factor_mallocs __pyx_string_tab[4585]
#define __pyx_n_u_fails __pyx_string_tab[4586]
#define __pyx_n_u_fe __pyx_string_tab[4587]
#define __pyx_n_u_fe_type __pyx_string_tab[4588]
#define __pyx_n_u_fetchAndOpBegin __pyx_string_tab[4589]
#define __pyx_n_u_fetchAndOpEnd __pyx_string_tab[4590]
#define __pyx_n_u_fget __pyx_string_tab[4591]
#define __pyx_n_u_field __pyx_string_tab[4592]
#define __pyx_n_u_fieldName __pyx_string_tab[4593]
#define __pyx_n_u_fieldname __pyx_string_tab[4594]
#define __pyx_n_u_fieldnames __pyx_string_tab[4595]
#define __pyx_n_u_fields __pyx_string_tab[4596]
#define __pyx_n_u_file __pyx_string_tab[4597]
#define __pyx_n_u_filename __pyx_string_tab[4598]
#define __pyx_n_u_fill __pyx_string_tab[4599]
#define __pyx_n_u_fill_param __pyx_string_tab[4600]
#define __pyx_n_u_fill_ratio_given __pyx_string_tab[4601]
#define __pyx_n_u_fill_ratio_needed __pyx_string_tab[4602]
#define __pyx_n_u_filter __pyx_string_tab[4603]
#define __pyx_n_u_finalize __pyx_string_tab[4604]
#define __pyx_n_u_finalizeFieldRegister __pyx_string_tab[4605]
#define __pyx_n_u_findZeroRows __pyx_string_tab[4606]
#define __pyx_n_u_first __pyx_string_tab[4607]
#define __pyx_n_u_fit __pyx_string_tab[4608]
#define __pyx_n_u_fitintercept __pyx_string_tab[4609]
#define __pyx_n_u_fix __pyx_string_tab[4610]
#define __pyx_n_u_fixISLocalEmpty __pyx_string_tab[4611]
#define __pyx_n_u_flag __pyx_string_tab[4612]
#define __pyx_n_u_flag1 __pyx_string_tab[4613]
#define __pyx_n_u_flag2 __pyx_string_tab[4614]
#define __pyx_n_u_flags __pyx_string_tab[4615]
#define __pyx_n_u_flg __pyx_string_tab[4616]
#define __pyx_n_u_flg2 __pyx_string_tab[4617]
#define __pyx_n_u_flip __pyx_string_tab[4618]
#define __pyx_n_u_float __pyx_string_tab[4619]
#define __pyx_n_u_flops __pyx_string_tab[4620]
#define __pyx_n_u_flush __pyx_string_tab[4621]
#define __pyx_n_u_fnorm __pyx_string_tab[4622]
#define __pyx_n_u_force __pyx_string_tab[4623]
#define __pyx_n_u_fork __pyx_string_tab[4624]
#define __pyx_n_u_formDegree __pyx_string_tab[4625]
#define __pyx_n_u_formSNESFunction __pyx_string_tab[4626]
#define __pyx_n_u_formSNESJacobian __pyx_string_tab[4627]
#define __pyx_n_u_format __pyx_string_tab[4628]
#define __pyx_n_u_fortran __pyx_string_tab[4629]
#define __pyx_n_u_forward __pyx_string_tab[4630]
#define __pyx_n_u_fpoint __pyx_string_tab[4631]
#define __pyx_n_u_front __pyx_string_tab[4632]
#define __pyx_n_u_front_down __pyx_string_tab[4633]
#define __pyx_n_u_front_down_left __pyx_string_tab[4634]
#define __pyx_n_u_front_down_right __pyx_string_tab[4635]
#define __pyx_n_u_front_left __pyx_string_tab[4636]
#define __pyx_n_u_front_right __pyx_string_tab[4637]
#define __pyx_n_u_front_up __pyx_string_tab[4638]
#define __pyx_n_u_front_up_left __pyx_string_tab[4639]
#define __pyx_n_u_front_up_right __pyx_string_tab[4640]
#define __pyx_n_u_fun __pyx_string_tab[4641]
#define __pyx_n_u_func __pyx_string_tab[4642]
#define __pyx_n_u_func_2 __pyx_string_tab[4643]
#define __pyx_n_u_function __pyx_string_tab[4644]
#define __pyx_n_u_functional __pyx_string_tab[4645]
#define __pyx_n_u_functools __pyx_string_tab[4646]
#define __pyx_n_u_fval __pyx_string_tab[4647]
#define __pyx_n_u_fvec __pyx_string_tab[4648]
#define __pyx_n_u_fwd __pyx_string_tab[4649]
#define __pyx_n_u_g __pyx_string_tab[4650]
#define __pyx_n_u_g2l __pyx_string_tab[4651]
#define __pyx_n_u_gamgtype __pyx_string_tab[4652]
#define __pyx_n_u_gamma __pyx_string_tab[4653]
#define __pyx_n_u_garbage_cleanup __pyx_string_tab[4654]
#define __pyx_n_u_garbage_view __pyx_string_tab[4655]
#define __pyx_n_u_gasmtype __pyx_string_tab[4656]
#define __pyx_n_u_gather __pyx_string_tab[4657]
#define __pyx_n_u_gatherBegin __pyx_string_tab[4658]
#define __pyx_n_u_gatherEnd __pyx_string_tab[4659]
#define __pyx_n_u_gatol __pyx_string_tab[4660]
#define __pyx_n_u_gatol_2 __pyx_string_tab[4661]
#define __pyx_n_u_gc __pyx_string_tab[4662]
#define __pyx_n_u_gdim __pyx_string_tab[4663]
#define __pyx_n_u_gdofs __pyx_string_tab[4664]
#define __pyx_n_u_generate __pyx_string_tab[4665]
#define __pyx_n_u_get __pyx_string_tab[4666]
#define __pyx_n_u_get1dCoordinatecArrays __pyx_string_tab[4667]
#define __pyx_n_u_getALMMSubsolver __pyx_string_tab[4668]
#define __pyx_n_u_getALMMType __pyx_string_tab[4669]
#define __pyx_n_u_getAO __pyx_string_tab[4670]
#define __pyx_n_u_getARKIMEXType __pyx_string_tab[4671]
#define __pyx_n_u_getASCIITab __pyx_string_tab[4672]
#define __pyx_n_u_getASMSubKSP __pyx_string_tab[4673]
#define __pyx_n_u_getAccess __pyx_string_tab[4674]
#define __pyx_n_u_getActive __pyx_string_tab[4675]
#define __pyx_n_u_getActiveAll __pyx_string_tab[4676]
#define __pyx_n_u_getAdjacency __pyx_string_tab[4677]
#define __pyx_n_u_getAdjacencyUseAnchors __pyx_string_tab[4678]
#define __pyx_n_u_getAll __pyx_string_tab[4679]
#define __pyx_n_u_getAlphaParams __pyx_string_tab[4680]
#define __pyx_n_u_getAppCtx __pyx_string_tab[4681]
#define __pyx_n_u_getApplicationContext __pyx_string_tab[4682]
#define __pyx_n_u_getArray __pyx_string_tab[4683]
#define __pyx_n_u_getAttr __pyx_string_tab[4684]
#define __pyx_n_u_getAuxiliaryVec __pyx_string_tab[4685]
#define __pyx_n_u_getBJacobiSubKSP __pyx_string_tab[4686]
#define __pyx_n_u_getBNCGType __pyx_string_tab[4687]
#define __pyx_n_u_getBRGNDampingVector __pyx_string_tab[4688]
#define __pyx_n_u_getBRGNSubsolver __pyx_string_tab[4689]
#define __pyx_n_u_getBasicAdjacency __pyx_string_tab[4690]
#define __pyx_n_u_getBasisSpace __pyx_string_tab[4691]
#define __pyx_n_u_getBlockIndices __pyx_string_tab[4692]
#define __pyx_n_u_getBlockInfo __pyx_string_tab[4693]
#define __pyx_n_u_getBlockSize __pyx_string_tab[4694]
#define __pyx_n_u_getBlockSizes __pyx_string_tab[4695]
#define __pyx_n_u_getBool __pyx_string_tab[4696]
#define __pyx_n_u_getBoolArray __pyx_string_tab[4697]
#define __pyx_n_u_getBoundaryType __pyx_string_tab[4698]
#define __pyx_n_u_getBoundaryTypes __pyx_string_tab[4699]
#define __pyx_n_u_getBoundingBox __pyx_string_tab[4700]
#define __pyx_n_u_getBounds __pyx_string_tab[4701]
#define __pyx_n_u_getBuffer __pyx_string_tab[4702]
#define __pyx_n_u_getCGObjectiveValue __pyx_string_tab[4703]
#define __pyx_n_u_getCLContextHandle __pyx_string_tab[4704]
#define __pyx_n_u_getCLMemHandle __pyx_string_tab[4705]
#define __pyx_n_u_getCLQueueHandle __pyx_string_tab[4706]
#define __pyx_n_u_getCPUTime __pyx_string_tab[4707]
#define __pyx_n_u_getCUDAHandle __pyx_string_tab[4708]
#define __pyx_n_u_getCellCoordinateDM __pyx_string_tab[4709]
#define __pyx_n_u_getCellCoordinateSection __pyx_string_tab[4710]
#define __pyx_n_u_getCellCoordinates __pyx_string_tab[4711]
#define __pyx_n_u_getCellCoordinatesLocal __pyx_string_tab[4712]
#define __pyx_n_u_getCellDM __pyx_string_tab[4713]
#define __pyx_n_u_getCellDMActive __pyx_string_tab[4714]
#define __pyx_n_u_getCellDMByName __pyx_string_tab[4715]
#define __pyx_n_u_getCellDMNames __pyx_string_tab[4716]
#define __pyx_n_u_getCellID __pyx_string_tab[4717]
#define __pyx_n_u_getCellNumbering __pyx_string_tab[4718]
#define __pyx_n_u_getCellType __pyx_string_tab[4719]
#define __pyx_n_u_getCellTypeLabel __pyx_string_tab[4720]
#define __pyx_n_u_getChart __pyx_string_tab[4721]
#define __pyx_n_u_getClassId __pyx_string_tab[4722]
#define __pyx_n_u_getClassName __pyx_string_tab[4723]
#define __pyx_n_u_getCoarseDM __pyx_string_tab[4724]
#define __pyx_n_u_getCoarsenLevel __pyx_string_tab[4725]
#define __pyx_n_u_getColumnIJ __pyx_string_tab[4726]
#define __pyx_n_u_getColumnVector __pyx_string_tab[4727]
#define __pyx_n_u_getComm __pyx_string_tab[4728]
#define __pyx_n_u_getComponents __pyx_string_tab[4729]
#define __pyx_n_u_getCompositeNumber __pyx_string_tab[4730]
#define __pyx_n_u_getCompositePC __pyx_string_tab[4731]
#define __pyx_n_u_getCompositeSNES __pyx_string_tab[4732]
#define __pyx_n_u_getComputeEigenvalues __pyx_string_tab[4733]
#define __pyx_n_u_getComputeSingularValues __pyx_string_tab[4734]
#define __pyx_n_u_getCone __pyx_string_tab[4735]
#define __pyx_n_u_getConeOrientation __pyx_string_tab[4736]
#define __pyx_n_u_getConeSize __pyx_string_tab[4737]
#define __pyx_n_u_getConstrainedStorageSize __pyx_string_tab[4738]
#define __pyx_n_u_getConstraintDof __pyx_string_tab[4739]
#define __pyx_n_u_getConstraintIndices __pyx_string_tab[4740]
#define __pyx_n_u_getConstraintTolerances __pyx_string_tab[4741]
#define __pyx_n_u_getConvergedReason __pyx_string_tab[4742]
#define __pyx_n_u_getConvergenceHistory __pyx_string_tab[4743]
#define __pyx_n_u_getConvergenceTest __pyx_string_tab[4744]
#define __pyx_n_u_getCoordinateDM __pyx_string_tab[4745]
#define __pyx_n_u_getCoordinateDim __pyx_string_tab[4746]
#define __pyx_n_u_getCoordinateDimension __pyx_string_tab[4747]
#define __pyx_n_u_getCoordinateFields __pyx_string_tab[4748]
#define __pyx_n_u_getCoordinateName __pyx_string_tab[4749]
#define __pyx_n_u_getCoordinateSection __pyx_string_tab[4750]
#define __pyx_n_u_getCoordinates __pyx_string_tab[4751]
#define __pyx_n_u_getCoordinatesLocal __pyx_string_tab[4752]
#define __pyx_n_u_getCoordinatesLocalized __pyx_string_tab[4753]
#define __pyx_n_u_getCorners __pyx_string_tab[4754]
#define __pyx_n_u_getCostGradients __pyx_string_tab[4755]
#define __pyx_n_u_getCostIntegral __pyx_string_tab[4756]
#define __pyx_n_u_getCurrent __pyx_string_tab[4757]
#define __pyx_n_u_getDIRKType __pyx_string_tab[4758]
#define __pyx_n_u_getDM __pyx_string_tab[4759]
#define __pyx_n_u_getDS __pyx_string_tab[4760]
#define __pyx_n_u_getData __pyx_string_tab[4761]
#define __pyx_n_u_getDefaultComm __pyx_string_tab[4762]
#define __pyx_n_u_getDefaultGlobalSection __pyx_string_tab[4763]
#define __pyx_n_u_getDefaultLocalSection __pyx_string_tab[4764]
#define __pyx_n_u_getDefaultSF __pyx_string_tab[4765]
#define __pyx_n_u_getDefaultSection __pyx_string_tab[4766]
#define __pyx_n_u_getDefaultValue __pyx_string_tab[4767]
#define __pyx_n_u_getDeflationCoarseKSP __pyx_string_tab[4768]
#define __pyx_n_u_getDeflationPC __pyx_string_tab[4769]
#define __pyx_n_u_getDegree __pyx_string_tab[4770]
#define __pyx_n_u_getDenseArray __pyx_string_tab[4771]
#define __pyx_n_u_getDenseColumnVec __pyx_string_tab[4772]
#define __pyx_n_u_getDenseLDA __pyx_string_tab[4773]
#define __pyx_n_u_getDenseLocalMatrix __pyx_string_tab[4774]
#define __pyx_n_u_getDenseSubMatrix __pyx_string_tab[4775]
#define __pyx_n_u_getDepth __pyx_string_tab[4776]
#define __pyx_n_u_getDepthStratum __pyx_string_tab[4777]
#define __pyx_n_u_getDevice __pyx_string_tab[4778]
#define __pyx_n_u_getDeviceId __pyx_string_tab[4779]
#define __pyx_n_u_getDeviceType __pyx_string_tab[4780]
#define __pyx_n_u_getDiagonal __pyx_string_tab[4781]
#define __pyx_n_u_getDiagonalBlock __pyx_string_tab[4782]
#define __pyx_n_u_getDict __pyx_string_tab[4783]
#define __pyx_n_u_getDim __pyx_string_tab[4784]
#define __pyx_n_u_getDimension __pyx_string_tab[4785]
#define __pyx_n_u_getDimensions __pyx_string_tab[4786]
#define __pyx_n_u_getDivergenceTolerance __pyx_string_tab[4787]
#define __pyx_n_u_getDof __pyx_string_tab[4788]
#define __pyx_n_u_getDualSpace __pyx_string_tab[4789]
#define __pyx_n_u_getElementType __pyx_string_tab[4790]
#define __pyx_n_u_getElements __pyx_string_tab[4791]
#define __pyx_n_u_getEntries __pyx_string_tab[4792]
#define __pyx_n_u_getEntriesPerElement __pyx_string_tab[4793]
#define __pyx_n_u_getEqualityConstraints __pyx_string_tab[4794]
#define __pyx_n_u_getEquationType __pyx_string_tab[4795]
#define __pyx_n_u_getErrorIfNotConverged __pyx_string_tab[4796]
#define __pyx_n_u_getEvaluationSolutions __pyx_string_tab[4797]
#define __pyx_n_u_getEvaluationTimes __pyx_string_tab[4798]
#define __pyx_n_u_getFASCoarseSolve __pyx_string_tab[4799]
#define __pyx_n_u_getFASCycleSNES __pyx_string_tab[4800]
#define __pyx_n_u_getFASInjection __pyx_string_tab[4801]
#define __pyx_n_u_getFASInterpolation __pyx_string_tab[4802]
#define __pyx_n_u_getFASLevels __pyx_string_tab[4803]
#define __pyx_n_u_getFASRestriction __pyx_string_tab[4804]
#define __pyx_n_u_getFASSmoother __pyx_string_tab[4805]
#define __pyx_n_u_getFASSmootherDown __pyx_string_tab[4806]
#define __pyx_n_u_getFASSmootherUp __pyx_string_tab[4807]
#define __pyx_n_u_getFaceQuadrature __pyx_string_tab[4808]
#define __pyx_n_u_getFactorMatrix __pyx_string_tab[4809]
#define __pyx_n_u_getFactorSolverType __pyx_string_tab[4810]
#define __pyx_n_u_getFailedReason __pyx_string_tab[4811]
#define __pyx_n_u_getField __pyx_string_tab[4812]
#define __pyx_n_u_getFieldAdjacency __pyx_string_tab[4813]
#define __pyx_n_u_getFieldComponents __pyx_string_tab[4814]
#define __pyx_n_u_getFieldConstraintDof __pyx_string_tab[4815]
#define __pyx_n_u_getFieldConstraintIndices __pyx_string_tab[4816]
#define __pyx_n_u_getFieldDof __pyx_string_tab[4817]
#define __pyx_n_u_getFieldIndex __pyx_string_tab[4818]
#define __pyx_n_u_getFieldName __pyx_string_tab[4819]
#define __pyx_n_u_getFieldOffset __pyx_string_tab[4820]
#define __pyx_n_u_getFieldSplitSchurGetSubKSP __pyx_string_tab[4821]
#define __pyx_n_u_getFieldSplitSubIS __pyx_string_tab[4822]
#define __pyx_n_u_getFieldSplitSubKSP __pyx_string_tab[4823]
#define __pyx_n_u_getFields __pyx_string_tab[4824]
#define __pyx_n_u_getFileMode __pyx_string_tab[4825]
#define __pyx_n_u_getFileName __pyx_string_tab[4826]
#define __pyx_n_u_getFlops __pyx_string_tab[4827]
#define __pyx_n_u_getFormat __pyx_string_tab[4828]
#define __pyx_n_u_getFullJoin __pyx_string_tab[4829]
#define __pyx_n_u_getFunction __pyx_string_tab[4830]
#define __pyx_n_u_getFunctionEvaluations __pyx_string_tab[4831]
#define __pyx_n_u_getFunctionNorm __pyx_string_tab[4832]
#define __pyx_n_u_getFunctionTolerances __pyx_string_tab[4833]
#define __pyx_n_u_getFunctionValue __pyx_string_tab[4834]
#define __pyx_n_u_getFunctional __pyx_string_tab[4835]
#define __pyx_n_u_getGhostCorners __pyx_string_tab[4836]
#define __pyx_n_u_getGhostIS __pyx_string_tab[4837]
#define __pyx_n_u_getGhostRanges __pyx_string_tab[4838]
#define __pyx_n_u_getGlobalISs __pyx_string_tab[4839]
#define __pyx_n_u_getGlobalSection __pyx_string_tab[4840]
#define __pyx_n_u_getGlobalSizes __pyx_string_tab[4841]
#define __pyx_n_u_getGlobalVec __pyx_string_tab[4842]
#define __pyx_n_u_getGradient __pyx_string_tab[4843]
#define __pyx_n_u_getGradientNorm __pyx_string_tab[4844]
#define __pyx_n_u_getGradientTolerances __pyx_string_tab[4845]
#define __pyx_n_u_getGraph __pyx_string_tab[4846]
#define __pyx_n_u_getGroup __pyx_string_tab[4847]
#define __pyx_n_u_getHIPHandle __pyx_string_tab[4848]
#define __pyx_n_u_getHPDDMCoarseCorrectionType __pyx_string_tab[4849]
#define __pyx_n_u_getHPDDMComplexities __pyx_string_tab[4850]
#define __pyx_n_u_getHPDDMSTShareSubKSP __pyx_string_tab[4851]
#define __pyx_n_u_getHPDDMType __pyx_string_tab[4852]
#define __pyx_n_u_getHYPREType __pyx_string_tab[4853]
#define __pyx_n_u_getHeightStratum __pyx_string_tab[4854]
#define __pyx_n_u_getHessian __pyx_string_tab[4855]
#define __pyx_n_u_getI2Function __pyx_string_tab[4856]
#define __pyx_n_u_getI2Jacobian __pyx_string_tab[4857]
#define __pyx_n_u_getIFunction __pyx_string_tab[4858]
#define __pyx_n_u_getIJacobian __pyx_string_tab[4859]
#define __pyx_n_u_getISAllowRepeated __pyx_string_tab[4860]
#define __pyx_n_u_getISLocalMat __pyx_string_tab[4861]
#define __pyx_n_u_getId __pyx_string_tab[4862]
#define __pyx_n_u_getIndices __pyx_string_tab[4863]
#define __pyx_n_u_getInequalityConstraints __pyx_string_tab[4864]
#define __pyx_n_u_getInertia __pyx_string_tab[4865]
#define __pyx_n_u_getInfo __pyx_string_tab[4866]
#define __pyx_n_u_getInitialGuess __pyx_string_tab[4867]
#define __pyx_n_u_getInitialGuessKnoll __pyx_string_tab[4868]
#define __pyx_n_u_getInitialGuessNonzero __pyx_string_tab[4869]
#define __pyx_n_u_getInt __pyx_string_tab[4870]
#define __pyx_n_u_getIntArray __pyx_string_tab[4871]
#define __pyx_n_u_getInteriorDimension __pyx_string_tab[4872]
#define __pyx_n_u_getInterpolationType __pyx_string_tab[4873]
#define __pyx_n_u_getInterval __pyx_string_tab[4874]
#define __pyx_n_u_getIsFirstRank __pyx_string_tab[4875]
#define __pyx_n_u_getIsLastRank __pyx_string_tab[4876]
#define __pyx_n_u_getIterationNumber __pyx_string_tab[4877]
#define __pyx_n_u_getJacobian __pyx_string_tab[4878]
#define __pyx_n_u_getJacobianEquality __pyx_string_tab[4879]
#define __pyx_n_u_getJacobianInequality __pyx_string_tab[4880]
#define __pyx_n_u_getJoin __pyx_string_tab[4881]
#define __pyx_n_u_getKSP __pyx_string_tab[4882]
#define __pyx_n_u_getKSPFailures __pyx_string_tab[4883]
#define __pyx_n_u_getKSPIterations __pyx_string_tab[4884]
#define __pyx_n_u_getLGMap __pyx_string_tab[4885]
#define __pyx_n_u_getLGMaps __pyx_string_tab[4886]
#define __pyx_n_u_getLMVMH0 __pyx_string_tab[4887]
#define __pyx_n_u_getLMVMH0KSP __pyx_string_tab[4888]
#define __pyx_n_u_getLMVMJ0 __pyx_string_tab[4889]
#define __pyx_n_u_getLMVMJ0KSP __pyx_string_tab[4890]
#define __pyx_n_u_getLMVMMat __pyx_string_tab[4891]
#define __pyx_n_u_getLRCMats __pyx_string_tab[4892]
#define __pyx_n_u_getLabel __pyx_string_tab[4893]
#define __pyx_n_u_getLabelIdIS __pyx_string_tab[4894]
#define __pyx_n_u_getLabelName __pyx_string_tab[4895]
#define __pyx_n_u_getLabelOutput __pyx_string_tab[4896]
#define __pyx_n_u_getLabelSize __pyx_string_tab[4897]
#define __pyx_n_u_getLabelValue __pyx_string_tab[4898]
#define __pyx_n_u_getLagrangeContinuity __pyx_string_tab[4899]
#define __pyx_n_u_getLagrangeTensor __pyx_string_tab[4900]
#define __pyx_n_u_getLagrangeTrimmed __pyx_string_tab[4901]
#define __pyx_n_u_getLineSearch __pyx_string_tab[4902]
#define __pyx_n_u_getLinearCoefficients __pyx_string_tab[4903]
#define __pyx_n_u_getLinearIntercept __pyx_string_tab[4904]
#define __pyx_n_u_getLinearKSP __pyx_string_tab[4905]
#define __pyx_n_u_getLinearSolveFailures __pyx_string_tab[4906]
#define __pyx_n_u_getLinearSolveIterations __pyx_string_tab[4907]
#define __pyx_n_u_getLinearType __pyx_string_tab[4908]
#define __pyx_n_u_getLocalBoundingBox __pyx_string_tab[4909]
#define __pyx_n_u_getLocalISs __pyx_string_tab[4910]
#define __pyx_n_u_getLocalSection __pyx_string_tab[4911]
#define __pyx_n_u_getLocalSize __pyx_string_tab[4912]
#define __pyx_n_u_getLocalSizes __pyx_string_tab[4913]
#define __pyx_n_u_getLocalSubMatrix __pyx_string_tab[4914]
#define __pyx_n_u_getLocalVec __pyx_string_tab[4915]
#define __pyx_n_u_getLocalVector __pyx_string_tab[4916]
#define __pyx_n_u_getLocationDof __pyx_string_tab[4917]
#define __pyx_n_u_getLocationSlot __pyx_string_tab[4918]
#define __pyx_n_u_getMGCoarseSolve __pyx_string_tab[4919]
#define __pyx_n_u_getMGInterpolation __pyx_string_tab[4920]
#define __pyx_n_u_getMGLevels __pyx_string_tab[4921]
#define __pyx_n_u_getMGRScale __pyx_string_tab[4922]
#define __pyx_n_u_getMGRestriction __pyx_string_tab[4923]
#define __pyx_n_u_getMGSmoother __pyx_string_tab[4924]
#define __pyx_n_u_getMGSmootherDown __pyx_string_tab[4925]
#define __pyx_n_u_getMGSmootherUp __pyx_string_tab[4926]
#define __pyx_n_u_getMGType __pyx_string_tab[4927]
#define __pyx_n_u_getMatrix __pyx_string_tab[4928]
#define __pyx_n_u_getMaxDof __pyx_string_tab[4929]
#define __pyx_n_u_getMaxFunctionEvaluations __pyx_string_tab[4930]
#define __pyx_n_u_getMaxKSPFailures __pyx_string_tab[4931]
#define __pyx_n_u_getMaxLinearSolveFailures __pyx_string_tab[4932]
#define __pyx_n_u_getMaxNonlinearStepFailures __pyx_string_tab[4933]
#define __pyx_n_u_getMaxSizes __pyx_string_tab[4934]
#define __pyx_n_u_getMaxStepFailures __pyx_string_tab[4935]
#define __pyx_n_u_getMaxSteps __pyx_string_tab[4936]
#define __pyx_n_u_getMaxTime __pyx_string_tab[4937]
#define __pyx_n_u_getMaximumFunctionEvaluations __pyx_string_tab[4938]
#define __pyx_n_u_getMaximumIterations __pyx_string_tab[4939]
#define __pyx_n_u_getMeet __pyx_string_tab[4940]
#define __pyx_n_u_getMigrationSF __pyx_string_tab[4941]
#define __pyx_n_u_getMinRadius __pyx_string_tab[4942]
#define __pyx_n_u_getMonitor __pyx_string_tab[4943]
#define __pyx_n_u_getMulti __pyx_string_tab[4944]
#define __pyx_n_u_getMumpsCntl __pyx_string_tab[4945]
#define __pyx_n_u_getMumpsIcntl __pyx_string_tab[4946]
#define __pyx_n_u_getMumpsInfo __pyx_string_tab[4947]
#define __pyx_n_u_getMumpsInfog __pyx_string_tab[4948]
#define __pyx_n_u_getMumpsRinfo __pyx_string_tab[4949]
#define __pyx_n_u_getMumpsRinfog __pyx_string_tab[4950]
#define __pyx_n_u_getNASMNumber __pyx_string_tab[4951]
#define __pyx_n_u_getNASMSNES __pyx_string_tab[4952]
#define __pyx_n_u_getNGS __pyx_string_tab[4953]
#define __pyx_n_u_getNPC __pyx_string_tab[4954]
#define __pyx_n_u_getNPCSide __pyx_string_tab[4955]
#define __pyx_n_u_getName __pyx_string_tab[4956]
#define __pyx_n_u_getNearNullSpace __pyx_string_tab[4957]
#define __pyx_n_u_getNestISs __pyx_string_tab[4958]
#define __pyx_n_u_getNestLocalISs __pyx_string_tab[4959]
#define __pyx_n_u_getNestSize __pyx_string_tab[4960]
#define __pyx_n_u_getNestSubMatrix __pyx_string_tab[4961]
#define __pyx_n_u_getNestSubVecs __pyx_string_tab[4962]
#define __pyx_n_u_getNewtonALLoadParameter __pyx_string_tab[4963]
#define __pyx_n_u_getNonEmptyStratumValuesIS __pyx_string_tab[4964]
#define __pyx_n_u_getNonlinearStepFailures __pyx_string_tab[4965]
#define __pyx_n_u_getNormSchedule __pyx_string_tab[4966]
#define __pyx_n_u_getNormType __pyx_string_tab[4967]
#define __pyx_n_u_getNullSpace __pyx_string_tab[4968]
#define __pyx_n_u_getNumComponents __pyx_string_tab[4969]
#define __pyx_n_u_getNumDof __pyx_string_tab[4970]
#define __pyx_n_u_getNumEvents __pyx_string_tab[4971]
#define __pyx_n_u_getNumFields __pyx_string_tab[4972]
#define __pyx_n_u_getNumLabels __pyx_string_tab[4973]
#define __pyx_n_u_getNumValues __pyx_string_tab[4974]
#define __pyx_n_u_getNumVariables __pyx_string_tab[4975]
#define __pyx_n_u_getNumber __pyx_string_tab[4976]
#define __pyx_n_u_getNumberDM __pyx_string_tab[4977]
#define __pyx_n_u_getObjective __pyx_string_tab[4978]
#define __pyx_n_u_getObjectiveAndGradient __pyx_string_tab[4979]
#define __pyx_n_u_getObjectiveValue __pyx_string_tab[4980]
#define __pyx_n_u_getOffloadMask __pyx_string_tab[4981]
#define __pyx_n_u_getOffset __pyx_string_tab[4982]
#define __pyx_n_u_getOffsetRange __pyx_string_tab[4983]
#define __pyx_n_u_getOperators __pyx_string_tab[4984]
#define __pyx_n_u_getOption __pyx_string_tab[4985]
#define __pyx_n_u_getOptionsPrefix __pyx_string_tab[4986]
#define __pyx_n_u_getOrder __pyx_string_tab[4987]
#define __pyx_n_u_getOrdering __pyx_string_tab[4988]
#define __pyx_n_u_getOwnershipIS __pyx_string_tab[4989]
#define __pyx_n_u_getOwnershipRange __pyx_string_tab[4990]
#define __pyx_n_u_getOwnershipRangeColumn __pyx_string_tab[4991]
#define __pyx_n_u_getOwnershipRanges __pyx_string_tab[4992]
#define __pyx_n_u_getOwnershipRangesColumn __pyx_string_tab[4993]
#define __pyx_n_u_getPC __pyx_string_tab[4994]
#define __pyx_n_u_getPCSide __pyx_string_tab[4995]
#define __pyx_n_u_getPTrimmedFormDegree __pyx_string_tab[4996]
#define __pyx_n_u_getParamsEW __pyx_string_tab[4997]
#define __pyx_n_u_getPartitioner __pyx_string_tab[4998]
#define __pyx_n_u_getPatchSubKSP __pyx_string_tab[4999]
#define __pyx_n_u_getPerfInfo __pyx_string_tab[5000]
#define __pyx_n_u_getPeriodicity __pyx_string_tab[5001]
#define __pyx_n_u_getPermutation __pyx_string_tab[5002]
#define __pyx_n_u_getPointDepth __pyx_string_tab[5003]
#define __pyx_n_u_getPointGlobal __pyx_string_tab[5004]
#define __pyx_n_u_getPointGlobalField __pyx_string_tab[5005]
#define __pyx_n_u_getPointHeight __pyx_string_tab[5006]
#define __pyx_n_u_getPointLocal __pyx_string_tab[5007]
#define __pyx_n_u_getPointLocalField __pyx_string_tab[5008]
#define __pyx_n_u_getPointPoints __pyx_string_tab[5009]
#define __pyx_n_u_getPointSF __pyx_string_tab[5010]
#define __pyx_n_u_getPolynomialTensor __pyx_string_tab[5011]
#define __pyx_n_u_getPostStep __pyx_string_tab[5012]
#define __pyx_n_u_getPreStep __pyx_string_tab[5013]
#define __pyx_n_u_getPrevTime __pyx_string_tab[5014]
#define __pyx_n_u_getProblemType __pyx_string_tab[5015]
#define __pyx_n_u_getProcSizes __pyx_string_tab[5016]
#define __pyx_n_u_getProductCoordinateLocationSlot __pyx_string_tab[5017]
#define __pyx_n_u_getPythonContext __pyx_string_tab[5018]
#define __pyx_n_u_getPythonType __pyx_string_tab[5019]
#define __pyx_n_u_getQuadrature __pyx_string_tab[5020]
#define __pyx_n_u_getQuadratureTS __pyx_string_tab[5021]
#define __pyx_n_u_getRHSFunction __pyx_string_tab[5022]
#define __pyx_n_u_getRHSJacobian __pyx_string_tab[5023]
#define __pyx_n_u_getRKType __pyx_string_tab[5024]
#define __pyx_n_u_getRanges __pyx_string_tab[5025]
#define __pyx_n_u_getRank __pyx_string_tab[5026]
#define __pyx_n_u_getReal __pyx_string_tab[5027]
#define __pyx_n_u_getRealArray __pyx_string_tab[5028]
#define __pyx_n_u_getRedundantMatrix __pyx_string_tab[5029]
#define __pyx_n_u_getRefCount __pyx_string_tab[5030]
#define __pyx_n_u_getRefineLevel __pyx_string_tab[5031]
#define __pyx_n_u_getRefinementFactor __pyx_string_tab[5032]
#define __pyx_n_u_getRefinementLimit __pyx_string_tab[5033]
#define __pyx_n_u_getRefinementUniform __pyx_string_tab[5034]
#define __pyx_n_u_getResidualNorm __pyx_string_tab[5035]
#define __pyx_n_u_getRhs __pyx_string_tab[5036]
#define __pyx_n_u_getRow __pyx_string_tab[5037]
#define __pyx_n_u_getRowIJ __pyx_string_tab[5038]
#define __pyx_n_u_getRowSum __pyx_string_tab[5039]
#define __pyx_n_u_getSNES __pyx_string_tab[5040]
#define __pyx_n_u_getSNESFailures __pyx_string_tab[5041]
#define __pyx_n_u_getSNESIterations __pyx_string_tab[5042]
#define __pyx_n_u_getScalar __pyx_string_tab[5043]
#define __pyx_n_u_getScalarArray __pyx_string_tab[5044]
#define __pyx_n_u_getScatter __pyx_string_tab[5045]
#define __pyx_n_u_getSchurComplementSubMatrices __pyx_string_tab[5046]
#define __pyx_n_u_getSection __pyx_string_tab[5047]
#define __pyx_n_u_getSectionSF __pyx_string_tab[5048]
#define __pyx_n_u_getSeed __pyx_string_tab[5049]
#define __pyx_n_u_getSize __pyx_string_tab[5050]
#define __pyx_n_u_getSizes __pyx_string_tab[5051]
#define __pyx_n_u_getSolution __pyx_string_tab[5052]
#define __pyx_n_u_getSolution2 __pyx_string_tab[5053]
#define __pyx_n_u_getSolutionNorm __pyx_string_tab[5054]
#define __pyx_n_u_getSolutionStatus __pyx_string_tab[5055]
#define __pyx_n_u_getSolutionUpdate __pyx_string_tab[5056]
#define __pyx_n_u_getSolveTime __pyx_string_tab[5057]
#define __pyx_n_u_getSparseLocalize __pyx_string_tab[5058]
#define __pyx_n_u_getSpatialDimension __pyx_string_tab[5059]
#define __pyx_n_u_getStencil __pyx_string_tab[5060]
#define __pyx_n_u_getStencilType __pyx_string_tab[5061]
#define __pyx_n_u_getStencilWidth __pyx_string_tab[5062]
#define __pyx_n_u_getStepFailures __pyx_string_tab[5063]
#define __pyx_n_u_getStepLimits __pyx_string_tab[5064]
#define __pyx_n_u_getStepNumber __pyx_string_tab[5065]
#define __pyx_n_u_getStepRejections __pyx_string_tab[5066]
#define __pyx_n_u_getStorageSize __pyx_string_tab[5067]
#define __pyx_n_u_getStratumIS __pyx_string_tab[5068]
#define __pyx_n_u_getStratumSize __pyx_string_tab[5069]
#define __pyx_n_u_getStreamType __pyx_string_tab[5070]
#define __pyx_n_u_getStride __pyx_string_tab[5071]
#define __pyx_n_u_getString __pyx_string_tab[5072]
#define __pyx_n_u_getSubVector __pyx_string_tab[5073]
#define __pyx_n_u_getSubViewer __pyx_string_tab[5074]
#define __pyx_n_u_getSubpointIS __pyx_string_tab[5075]
#define __pyx_n_u_getSubpointMap __pyx_string_tab[5076]
#define __pyx_n_u_getSumConcatenate __pyx_string_tab[5077]
#define __pyx_n_u_getSumNumSubspaces __pyx_string_tab[5078]
#define __pyx_n_u_getSumSubspace __pyx_string_tab[5079]
#define __pyx_n_u_getSupport __pyx_string_tab[5080]
#define __pyx_n_u_getSupportSize __pyx_string_tab[5081]
#define __pyx_n_u_getTAO __pyx_string_tab[5082]
#define __pyx_n_u_getTRTolerances __pyx_string_tab[5083]
#define __pyx_n_u_getTRUpdateParameters __pyx_string_tab[5084]
#define __pyx_n_u_getTabLevel __pyx_string_tab[5085]
#define __pyx_n_u_getTensorNumSubspaces __pyx_string_tab[5086]
#define __pyx_n_u_getTensorSubspace __pyx_string_tab[5087]
#define __pyx_n_u_getTerm __pyx_string_tab[5088]
#define __pyx_n_u_getTheta __pyx_string_tab[5089]
#define __pyx_n_u_getThetaEndpoint __pyx_string_tab[5090]
#define __pyx_n_u_getTileSizes __pyx_string_tab[5091]
#define __pyx_n_u_getTime __pyx_string_tab[5092]
#define __pyx_n_u_getTimeSpan __pyx_string_tab[5093]
#define __pyx_n_u_getTimeSpanSolutions __pyx_string_tab[5094]
#define __pyx_n_u_getTimeStep __pyx_string_tab[5095]
#define __pyx_n_u_getTimestep __pyx_string_tab[5096]
#define __pyx_n_u_getTolerances __pyx_string_tab[5097]
#define __pyx_n_u_getTotalComponents __pyx_string_tab[5098]
#define __pyx_n_u_getTotalDimensions __pyx_string_tab[5099]
#define __pyx_n_u_getTransitiveClosure __pyx_string_tab[5100]
#define __pyx_n_u_getTransposeMat __pyx_string_tab[5101]
#define __pyx_n_u_getTransposeNullSpace __pyx_string_tab[5102]
#define __pyx_n_u_getType __pyx_string_tab[5103]
#define __pyx_n_u_getUpdate __pyx_string_tab[5104]
#define __pyx_n_u_getUseAmat __pyx_string_tab[5105]
#define __pyx_n_u_getUseEW __pyx_string_tab[5106]
#define __pyx_n_u_getUseFD __pyx_string_tab[5107]
#define __pyx_n_u_getUseKSP __pyx_string_tab[5108]
#define __pyx_n_u_getUseMF __pyx_string_tab[5109]
#define __pyx_n_u_getUseNatural __pyx_string_tab[5110]
#define __pyx_n_u_getVIInactiveSet __pyx_string_tab[5111]
#define __pyx_n_u_getValue __pyx_string_tab[5112]
#define __pyx_n_u_getValueIS __pyx_string_tab[5113]
#define __pyx_n_u_getValueReal __pyx_string_tab[5114]
#define __pyx_n_u_getValues __pyx_string_tab[5115]
#define __pyx_n_u_getValuesCSR __pyx_string_tab[5116]
#define __pyx_n_u_getValuesStagStencil __pyx_string_tab[5117]
#define __pyx_n_u_getVariableBounds __pyx_string_tab[5118]
#define __pyx_n_u_getVecArray __pyx_string_tab[5119]
#define __pyx_n_u_getVecClosure __pyx_string_tab[5120]
#define __pyx_n_u_getVecLeft __pyx_string_tab[5121]
#define __pyx_n_u_getVecRight __pyx_string_tab[5122]
#define __pyx_n_u_getVecType __pyx_string_tab[5123]
#define __pyx_n_u_getVecs __pyx_string_tab[5124]
#define __pyx_n_u_getVector __pyx_string_tab[5125]
#define __pyx_n_u_getVersion __pyx_string_tab[5126]
#define __pyx_n_u_getVersionInfo __pyx_string_tab[5127]
#define __pyx_n_u_getVertexNumbering __pyx_string_tab[5128]
#define __pyx_n_u_getVisible __pyx_string_tab[5129]
#define __pyx_n_u_getWorkVecs __pyx_string_tab[5130]
#define __pyx_n_u_get_2 __pyx_string_tab[5131]
#define __pyx_n_u_getstate __pyx_string_tab[5132]
#define __pyx_n_u_ghostBcNodes __pyx_string_tab[5133]
#define __pyx_n_u_ghostUpdate __pyx_string_tab[5134]
#define __pyx_n_u_ghostUpdateBegin __pyx_string_tab[5135]
#define __pyx_n_u_ghostUpdateEnd __pyx_string_tab[5136]
#define __pyx_n_u_ghosted __pyx_string_tab[5137]
#define __pyx_n_u_ghosts __pyx_string_tab[5138]
#define __pyx_n_u_globalBcNodes __pyx_string_tab[5139]
#define __pyx_n_u_globalToLocal __pyx_string_tab[5140]
#define __pyx_n_u_globalToNatural __pyx_string_tab[5141]
#define __pyx_n_u_globalToNaturalBegin __pyx_string_tab[5142]
#define __pyx_n_u_globalToNaturalEnd __pyx_string_tab[5143]
#define __pyx_n_u_globalVectorLoad __pyx_string_tab[5144]
#define __pyx_n_u_globalVectorView __pyx_string_tab[5145]
#define __pyx_n_u_globalsec __pyx_string_tab[5146]
#define __pyx_n_u_gmax __pyx_string_tab[5147]
#define __pyx_n_u_gmin __pyx_string_tab[5148]
#define __pyx_n_u_gnorm __pyx_string_tab[5149]
#define __pyx_n_u_gord __pyx_string_tab[5150]
#define __pyx_n_u_gpuarray __pyx_string_tab[5151]
#define __pyx_n_u_gradient __pyx_string_tab[5152]
#define __pyx_n_u_group __pyx_string_tab[5153]
#define __pyx_n_u_grtol __pyx_string_tab[5154]
#define __pyx_n_u_grtol_2 __pyx_string_tab[5155]
#define __pyx_n_u_gsec __pyx_string_tab[5156]
#define __pyx_n_u_gsf __pyx_string_tab[5157]
#define __pyx_n_u_gsizes __pyx_string_tab[5158]
#define __pyx_n_u_gtol __pyx_string_tab[5159]
#define __pyx_n_u_gttol __pyx_string_tab[5160]
#define __pyx_n_u_gttol_2 __pyx_string_tab[5161]
#define __pyx_n_u_guess_knoll __pyx_string_tab[5162]
#define __pyx_n_u_guess_nonzero __pyx_string_tab[5163]
#define __pyx_n_u_gv __pyx_string_tab[5164]
#define __pyx_n_u_gvec __pyx_string_tab[5165]
#define __pyx_n_u_h __pyx_string_tab[5166]
#define __pyx_n_u_h_max __pyx_string_tab[5167]
#define __pyx_n_u_h_min __pyx_string_tab[5168]
#define __pyx_n_u_handle __pyx_string_tab[5169]
#define __pyx_n_u_handler __pyx_string_tab[5170]
#define __pyx_n_u_has __pyx_string_tab[5171]
#define __pyx_n_u_hasConstant __pyx_string_tab[5172]
#define __pyx_n_u_hasExternalPackage __pyx_string_tab[5173]
#define __pyx_n_u_hasLabel __pyx_string_tab[5174]
#define __pyx_n_u_hasLagrange __pyx_string_tab[5175]
#define __pyx_n_u_hasNPC __pyx_string_tab[5176]
#define __pyx_n_u_hasName __pyx_string_tab[5177]
#define __pyx_n_u_hasPoint __pyx_string_tab[5178]
#define __pyx_n_u_hasStratum __pyx_string_tab[5179]
#define __pyx_n_u_hasValue __pyx_string_tab[5180]
#define __pyx_n_u_has_const __pyx_string_tab[5181]
#define __pyx_n_u_hausd __pyx_string_tab[5182]
#define __pyx_n_u_hdl __pyx_string_tab[5183]
#define __pyx_n_u_height __pyx_string_tab[5184]
#define __pyx_n_u_hermitianTranspose __pyx_string_tab[5185]
#define __pyx_n_u_hessian __pyx_string_tab[5186]
#define __pyx_n_u_hierarchy __pyx_string_tab[5187]
#define __pyx_n_u_high __pyx_string_tab[5188]
#define __pyx_n_u_hiphandle __pyx_string_tab[5189]
#define __pyx_n_u_hist __pyx_string_tab[5190]
#define __pyx_n_u_hmat __pyx_string_tab[5191]
#define __pyx_n_u_hmax __pyx_string_tab[5192]
#define __pyx_n_u_hmaxr __pyx_string_tab[5193]
#define __pyx_n_u_hmin __pyx_string_tab[5194]
#define __pyx_n_u_hminr __pyx_string_tab[5195]
#define __pyx_n_u_hostmem __pyx_string_tab[5196]
#define __pyx_n_u_hpddm_type __pyx_string_tab[5197]
#define __pyx_n_u_hypretype __pyx_string_tab[5198]
#define __pyx_n_u_i __pyx_string_tab[5199]
#define __pyx_n_u_i_2 __pyx_string_tab[5200]
#define __pyx_n_u_ia __pyx_string_tab[5201]
#define __pyx_n_u_iadj __pyx_string_tab[5202]
#define __pyx_n_u_ibdiag __pyx_string_tab[5203]
#define __pyx_n_u_icntl __pyx_string_tab[5204]
#define __pyx_n_u_icntl_2 __pyx_string_tab[5205]
#define __pyx_n_u_icols __pyx_string_tab[5206]
#define __pyx_n_u_icomp __pyx_string_tab[5207]
#define __pyx_n_u_icone __pyx_string_tab[5208]
#define __pyx_n_u_id __pyx_string_tab[5209]
#define __pyx_n_u_idata __pyx_string_tab[5210]
#define __pyx_n_u_idim __pyx_string_tab[5211]
#define __pyx_n_u_idirs __pyx_string_tab[5212]
#define __pyx_n_u_idiv __pyx_string_tab[5213]
#define __pyx_n_u_idle __pyx_string_tab[5214]
#define __pyx_n_u_idof __pyx_string_tab[5215]
#define __pyx_n_u_idx __pyx_string_tab[5216]
#define __pyx_n_u_idxapp __pyx_string_tab[5217]
#define __pyx_n_u_idxm __pyx_string_tab[5218]
#define __pyx_n_u_idxout __pyx_string_tab[5219]
#define __pyx_n_u_idxpetsc __pyx_string_tab[5220]
#define __pyx_n_u_ierr __pyx_string_tab[5221]
#define __pyx_n_u_ifields __pyx_string_tab[5222]
#define __pyx_n_u_ig __pyx_string_tab[5223]
#define __pyx_n_u_ignoreHalo __pyx_string_tab[5224]
#define __pyx_n_u_ignoreOutsideDomain __pyx_string_tab[5225]
#define __pyx_n_u_ihist __pyx_string_tab[5226]
#define __pyx_n_u_iidx __pyx_string_tab[5227]
#define __pyx_n_u_ilda __pyx_string_tab[5228]
#define __pyx_n_u_ilocal __pyx_string_tab[5229]
#define __pyx_n_u_im __pyx_string_tab[5230]
#define __pyx_n_u_imag __pyx_string_tab[5231]
#define __pyx_n_u_imagPart __pyx_string_tab[5232]
#define __pyx_n_u_imex __pyx_string_tab[5233]
#define __pyx_n_u_imode __pyx_string_tab[5234]
#define __pyx_n_u_import __pyx_string_tab[5235]
#define __pyx_n_u_inact __pyx_string_tab[5236]
#define __pyx_n_u_inblocks __pyx_string_tab[5237]
#define __pyx_n_u_incRef __pyx_string_tab[5238]
#define __pyx_n_u_increaseOverlap __pyx_string_tab[5239]
#define __pyx_n_u_incrementTabLevel __pyx_string_tab[5240]
#define __pyx_n_u_incrementTimestep __pyx_string_tab[5241]
#define __pyx_n_u_index __pyx_string_tab[5242]
#define __pyx_n_u_indicator __pyx_string_tab[5243]
#define __pyx_n_u_indices __pyx_string_tab[5244]
#define __pyx_n_u_inequality_constraints __pyx_string_tab[5245]
#define __pyx_n_u_info __pyx_string_tab[5246]
#define __pyx_n_u_infoAllow __pyx_string_tab[5247]
#define __pyx_n_u_init __pyx_string_tab[5248]
#define __pyx_n_u_initialguess __pyx_string_tab[5249]
#define __pyx_n_u_initialize __pyx_string_tab[5250]
#define __pyx_n_u_initializeFieldRegister __pyx_string_tab[5251]
#define __pyx_n_u_inject __pyx_string_tab[5252]
#define __pyx_n_u_insertCone __pyx_string_tab[5253]
#define __pyx_n_u_insertConeOrientation __pyx_string_tab[5254]
#define __pyx_n_u_insertIS __pyx_string_tab[5255]
#define __pyx_n_u_insertPointUsingCellDM __pyx_string_tab[5256]
#define __pyx_n_u_insertString __pyx_string_tab[5257]
#define __pyx_n_u_int __pyx_string_tab[5258]
#define __pyx_n_u_intercept __pyx_string_tab[5259]
#define __pyx_n_u_interior __pyx_string_tab[5260]
#define __pyx_n_u_interp __pyx_string_tab[5261]
#define __pyx_n_u_interp_type __pyx_string_tab[5262]
#define __pyx_n_u_interpolate __pyx_string_tab[5263]
#define __pyx_n_u_interpolation __pyx_string_tab[5264]
#define __pyx_n_u_intersect __pyx_string_tab[5265]
#define __pyx_n_u_interval __pyx_string_tab[5266]
#define __pyx_n_u_invert __pyx_string_tab[5267]
#define __pyx_n_u_invertBlockDiagonal __pyx_string_tab[5268]
#define __pyx_n_u_invertPermutation __pyx_string_tab[5269]
#define __pyx_n_u_iorder __pyx_string_tab[5270]
#define __pyx_n_u_iorie __pyx_string_tab[5271]
#define __pyx_n_u_ipoints __pyx_string_tab[5272]
#define __pyx_n_u_iremote __pyx_string_tab[5273]
#define __pyx_n_u_irow __pyx_string_tab[5274]
#define __pyx_n_u_isActive __pyx_string_tab[5275]
#define __pyx_n_u_isAssembled __pyx_string_tab[5276]
#define __pyx_n_u_isDistributed __pyx_string_tab[5277]
#define __pyx_n_u_isFinalized __pyx_string_tab[5278]
#define __pyx_n_u_isHermitian __pyx_string_tab[5279]
#define __pyx_n_u_isHermitianKnown __pyx_string_tab[5280]
#define __pyx_n_u_isIdentity __pyx_string_tab[5281]
#define __pyx_n_u_isInitialized __pyx_string_tab[5282]
#define __pyx_n_u_isLinear __pyx_string_tab[5283]
#define __pyx_n_u_isPermutation __pyx_string_tab[5284]
#define __pyx_n_u_isSimplex __pyx_string_tab[5285]
#define __pyx_n_u_isSorted __pyx_string_tab[5286]
#define __pyx_n_u_isStructurallySymmetric __pyx_string_tab[5287]
#define __pyx_n_u_isSymmetric __pyx_string_tab[5288]
#define __pyx_n_u_isSymmetricKnown __pyx_string_tab[5289]
#define __pyx_n_u_isTranspose __pyx_string_tab[5290]
#define __pyx_n_u_isValid __pyx_string_tab[5291]
#define __pyx_n_u_is_coroutine __pyx_string_tab[5292]
#define __pyx_n_u_is_from __pyx_string_tab[5293]
#define __pyx_n_u_is_idle __pyx_string_tab[5294]
#define __pyx_n_u_is_local __pyx_string_tab[5295]
#define __pyx_n_u_is_sub __pyx_string_tab[5296]
#define __pyx_n_u_is_to __pyx_string_tab[5297]
#define __pyx_n_u_is_type __pyx_string_tab[5298]
#define __pyx_n_u_isapp __pyx_string_tab[5299]
#define __pyx_n_u_isaxpy __pyx_string_tab[5300]
#define __pyx_n_u_iscol __pyx_string_tab[5301]
#define __pyx_n_u_iscolors __pyx_string_tab[5302]
#define __pyx_n_u_iscols __pyx_string_tab[5303]
#define __pyx_n_u_iset __pyx_string_tab[5304]
#define __pyx_n_u_isets __pyx_string_tab[5305]
#define __pyx_n_u_isets_local __pyx_string_tab[5306]
#define __pyx_n_u_isetscols __pyx_string_tab[5307]
#define __pyx_n_u_isetsrows __pyx_string_tab[5308]
#define __pyx_n_u_isfields __pyx_string_tab[5309]
#define __pyx_n_u_islsqr __pyx_string_tab[5310]
#define __pyx_n_u_isotropic __pyx_string_tab[5311]
#define __pyx_n_u_isperm __pyx_string_tab[5312]
#define __pyx_n_u_ispetsc __pyx_string_tab[5313]
#define __pyx_n_u_isrow __pyx_string_tab[5314]
#define __pyx_n_u_isrows __pyx_string_tab[5315]
#define __pyx_n_u_iss __pyx_string_tab[5316]
#define __pyx_n_u_isset __pyx_string_tab[5317]
#define __pyx_n_u_istrata __pyx_string_tab[5318]
#define __pyx_n_u_isupp __pyx_string_tab[5319]
#define __pyx_n_u_item __pyx_string_tab[5320]
#define __pyx_n_u_items __pyx_string_tab[5321]
#define __pyx_n_u_itemsize __pyx_string_tab[5322]
#define __pyx_n_u_iterm __pyx_string_tab[5323]
#define __pyx_n_u_its __pyx_string_tab[5324]
#define __pyx_n_u_itype __pyx_string_tab[5325]
#define __pyx_n_u_ival __pyx_string_tab[5326]
#define __pyx_n_u_ival1 __pyx_string_tab[5327]
#define __pyx_n_u_ival2 __pyx_string_tab[5328]
#define __pyx_n_u_ival3 __pyx_string_tab[5329]
#define __pyx_n_u_ival_2 __pyx_string_tab[5330]
#define __pyx_n_u_j __pyx_string_tab[5331]
#define __pyx_n_u_ja __pyx_string_tab[5332]
#define __pyx_n_u_jacobian __pyx_string_tab[5333]
#define __pyx_n_u_jacobian_design __pyx_string_tab[5334]
#define __pyx_n_u_jacobian_equality __pyx_string_tab[5335]
#define __pyx_n_u_jacobian_inequality __pyx_string_tab[5336]
#define __pyx_n_u_jacobian_state __pyx_string_tab[5337]
#define __pyx_n_u_jacobianp __pyx_string_tab[5338]
#define __pyx_n_u_jdxm __pyx_string_tab[5339]
#define __pyx_n_u_jmat __pyx_string_tab[5340]
#define __pyx_n_u_join __pyx_string_tab[5341]
#define __pyx_n_u_join_mode __pyx_string_tab[5342]
#define __pyx_n_u_k __pyx_string_tab[5343]
#define __pyx_n_u_kargs __pyx_string_tab[5344]
#define __pyx_n_u_kernel __pyx_string_tab[5345]
#define __pyx_n_u_kernelctx __pyx_string_tab[5346]
#define __pyx_n_u_key_2 __pyx_string_tab[5347]
#define __pyx_n_u_keys __pyx_string_tab[5348]
#define __pyx_n_u_kind __pyx_string_tab[5349]
#define __pyx_n_u_klass __pyx_string_tab[5350]
#define __pyx_n_u_kron __pyx_string_tab[5351]
#define __pyx_n_u_ksp __pyx_string_tab[5352]
#define __pyx_n_u_ksp_type __pyx_string_tab[5353]
#define __pyx_n_u_kwargs __pyx_string_tab[5354]
#define __pyx_n_u_l __pyx_string_tab[5355]
#define __pyx_n_u_l2g __pyx_string_tab[5356]
#define __pyx_n_u_l2l __pyx_string_tab[5357]
#define __pyx_n_u_label __pyx_string_tab[5358]
#define __pyx_n_u_labelCohesiveComplete __pyx_string_tab[5359]
#define __pyx_n_u_labelComplete __pyx_string_tab[5360]
#define __pyx_n_u_labelName __pyx_string_tab[5361]
#define __pyx_n_u_labelsLoad __pyx_string_tab[5362]
#define __pyx_n_u_labelsView __pyx_string_tab[5363]
#define __pyx_n_u_lambda __pyx_string_tab[5364]
#define __pyx_n_u_lanes __pyx_string_tab[5365]
#define __pyx_n_u_layoutType __pyx_string_tab[5366]
#define __pyx_n_u_lda __pyx_string_tab[5367]
#define __pyx_n_u_leafSection __pyx_string_tab[5368]
#define __pyx_n_u_leafdata __pyx_string_tab[5369]
#define __pyx_n_u_leafsize __pyx_string_tab[5370]
#define __pyx_n_u_leafupdate __pyx_string_tab[5371]
#define __pyx_n_u_left __pyx_string_tab[5372]
#define __pyx_n_u_length __pyx_string_tab[5373]
#define __pyx_n_u_level __pyx_string_tab[5374]
#define __pyx_n_u_levels __pyx_string_tab[5375]
#define __pyx_n_u_lgm __pyx_string_tab[5376]
#define __pyx_n_u_lgmap __pyx_string_tab[5377]
#define __pyx_n_u_lgmap_type __pyx_string_tab[5378]
#define __pyx_n_u_lgmapc __pyx_string_tab[5379]
#define __pyx_n_u_lgmapr __pyx_string_tab[5380]
#define __pyx_n_u_lgmc __pyx_string_tab[5381]
#define __pyx_n_u_lgmr __pyx_string_tab[5382]
#define __pyx_n_u_lgms __pyx_string_tab[5383]
#define __pyx_n_u_linear_its __pyx_string_tab[5384]
#define __pyx_n_u_lineartype __pyx_string_tab[5385]
#define __pyx_n_u_linesearch __pyx_string_tab[5386]
#define __pyx_n_u_lis __pyx_string_tab[5387]
#define __pyx_n_u_list __pyx_string_tab[5388]
#define __pyx_n_u_lits __pyx_string_tab[5389]
#define __pyx_n_u_lmax __pyx_string_tab[5390]
#define __pyx_n_u_lmin __pyx_string_tab[5391]
#define __pyx_n_u_load __pyx_string_tab[5392]
#define __pyx_n_u_loc __pyx_string_tab[5393]
#define __pyx_n_u_locC __pyx_string_tab[5394]
#define __pyx_n_u_locX __pyx_string_tab[5395]
#define __pyx_n_u_local __pyx_string_tab[5396]
#define __pyx_n_u_localForm __pyx_string_tab[5397]
#define __pyx_n_u_localToGlobal __pyx_string_tab[5398]
#define __pyx_n_u_localToLocal __pyx_string_tab[5399]
#define __pyx_n_u_localVectorLoad __pyx_string_tab[5400]
#define __pyx_n_u_localVectorView __pyx_string_tab[5401]
#define __pyx_n_u_localizationHeight __pyx_string_tab[5402]
#define __pyx_n_u_localizeCoordinates __pyx_string_tab[5403]
#define __pyx_n_u_localized __pyx_string_tab[5404]
#define __pyx_n_u_localsec __pyx_string_tab[5405]
#define __pyx_n_u_locs __pyx_string_tab[5406]
#define __pyx_n_u_log __pyx_string_tab[5407]
#define __pyx_n_u_logConvergenceHistory __pyx_string_tab[5408]
#define __pyx_n_u_logFlops __pyx_string_tab[5409]
#define __pyx_n_u_low __pyx_string_tab[5410]
#define __pyx_n_u_lower __pyx_string_tab[5411]
#define __pyx_n_u_lpEnd __pyx_string_tab[5412]
#define __pyx_n_u_lpStart __pyx_string_tab[5413]
#define __pyx_n_u_lpy __pyx_string_tab[5414]
#define __pyx_n_u_ls __pyx_string_tab[5415]
#define __pyx_n_u_ls_type __pyx_string_tab[5416]
#define __pyx_n_u_lsf __pyx_string_tab[5417]
#define __pyx_n_u_lsize __pyx_string_tab[5418]
#define __pyx_n_u_lsnes __pyx_string_tab[5419]
#define __pyx_n_u_lstart __pyx_string_tab[5420]
#define __pyx_n_u_ltog __pyx_string_tab[5421]
#define __pyx_n_u_ltol __pyx_string_tab[5422]
#define __pyx_n_u_lv __pyx_string_tab[5423]
#define __pyx_n_u_lvec __pyx_string_tab[5424]
#define __pyx_n_u_lvecs __pyx_string_tab[5425]
#define __pyx_n_u_lx __pyx_string_tab[5426]
#define __pyx_n_u_ly __pyx_string_tab[5427]
#define __pyx_n_u_lz __pyx_string_tab[5428]
#define __pyx_n_u_m __pyx_string_tab[5429]
#define __pyx_n_u_mDot __pyx_string_tab[5430]
#define __pyx_n_u_mDotBegin __pyx_string_tab[5431]
#define __pyx_n_u_mDotEnd __pyx_string_tab[5432]
#define __pyx_n_u_main __pyx_string_tab[5433]
#define __pyx_n_u_major __pyx_string_tab[5434]
#define __pyx_n_u_mallocs __pyx_string_tab[5435]
#define __pyx_n_u_mapmat __pyx_string_tab[5436]
#define __pyx_n_u_markBoundaryFaces __pyx_string_tab[5437]
#define __pyx_n_u_mask __pyx_string_tab[5438]
#define __pyx_n_u_mat __pyx_string_tab[5439]
#define __pyx_n_u_matApply __pyx_string_tab[5440]
#define __pyx_n_u_matApplyTranspose __pyx_string_tab[5441]
#define __pyx_n_u_matMatMult __pyx_string_tab[5442]
#define __pyx_n_u_matMult __pyx_string_tab[5443]
#define __pyx_n_u_matSolve __pyx_string_tab[5444]
#define __pyx_n_u_matSolveTranspose __pyx_string_tab[5445]
#define __pyx_n_u_matTransposeMult __pyx_string_tab[5446]
#define __pyx_n_u_mat_type __pyx_string_tab[5447]
#define __pyx_n_u_matpartitioning_type __pyx_string_tab[5448]
#define __pyx_n_u_mats __pyx_string_tab[5449]
#define __pyx_n_u_max __pyx_string_tab[5450]
#define __pyx_n_u_maxCell __pyx_string_tab[5451]
#define __pyx_n_u_maxConeSize __pyx_string_tab[5452]
#define __pyx_n_u_maxDegree __pyx_string_tab[5453]
#define __pyx_n_u_maxDof __pyx_string_tab[5454]
#define __pyx_n_u_maxPointwiseDivide __pyx_string_tab[5455]
#define __pyx_n_u_maxSupportSize __pyx_string_tab[5456]
#define __pyx_n_u_max_fails __pyx_string_tab[5457]
#define __pyx_n_u_max_funcs __pyx_string_tab[5458]
#define __pyx_n_u_max_it __pyx_string_tab[5459]
#define __pyx_n_u_max_its __pyx_string_tab[5460]
#define __pyx_n_u_max_steps __pyx_string_tab[5461]
#define __pyx_n_u_max_time __pyx_string_tab[5462]
#define __pyx_n_u_maxdeg __pyx_string_tab[5463]
#define __pyx_n_u_maxpy __pyx_string_tab[5464]
#define __pyx_n_u_maxr __pyx_string_tab[5465]
#define __pyx_n_u_maxrank __pyx_string_tab[5466]
#define __pyx_n_u_maxstep __pyx_string_tab[5467]
#define __pyx_n_u_maxval __pyx_string_tab[5468]
#define __pyx_n_u_mc __pyx_string_tab[5469]
#define __pyx_n_u_mcell __pyx_string_tab[5470]
#define __pyx_n_u_mean __pyx_string_tab[5471]
#define __pyx_n_u_mem1 __pyx_string_tab[5472]
#define __pyx_n_u_mem2 __pyx_string_tab[5473]
#define __pyx_n_u_memhdl __pyx_string_tab[5474]
#define __pyx_n_u_memo __pyx_string_tab[5475]
#define __pyx_n_u_memory __pyx_string_tab[5476]
#define __pyx_n_u_memview __pyx_string_tab[5477]
#define __pyx_n_u_message __pyx_string_tab[5478]
#define __pyx_n_u_messageLength __pyx_string_tab[5479]
#define __pyx_n_u_metaclass __pyx_string_tab[5480]
#define __pyx_n_u_metric __pyx_string_tab[5481]
#define __pyx_n_u_metric1 __pyx_string_tab[5482]
#define __pyx_n_u_metric2 __pyx_string_tab[5483]
#define __pyx_n_u_metric3 __pyx_string_tab[5484]
#define __pyx_n_u_metricAverage2 __pyx_string_tab[5485]
#define __pyx_n_u_metricAverage3 __pyx_string_tab[5486]
#define __pyx_n_u_metricAvg __pyx_string_tab[5487]
#define __pyx_n_u_metricCreate __pyx_string_tab[5488]
#define __pyx_n_u_metricCreateIsotropic __pyx_string_tab[5489]
#define __pyx_n_u_metricCreateUniform __pyx_string_tab[5490]
#define __pyx_n_u_metricDeterminantCreate __pyx_string_tab[5491]
#define __pyx_n_u_metricEnforceSPD __pyx_string_tab[5492]
#define __pyx_n_u_metricGetGradationFactor __pyx_string_tab[5493]
#define __pyx_n_u_metricGetHausdorffNumber __pyx_string_tab[5494]
#define __pyx_n_u_metricGetMaximumAnisotropy __pyx_string_tab[5495]
#define __pyx_n_u_metricGetMaximumMagnitude __pyx_string_tab[5496]
#define __pyx_n_u_metricGetMinimumMagnitude __pyx_string_tab[5497]
#define __pyx_n_u_metricGetNormalizationOrder __pyx_string_tab[5498]
#define __pyx_n_u_metricGetNumIterations __pyx_string_tab[5499]
#define __pyx_n_u_metricGetTargetComplexity __pyx_string_tab[5500]
#define __pyx_n_u_metricGetVerbosity __pyx_string_tab[5501]
#define __pyx_n_u_metricInt __pyx_string_tab[5502]
#define __pyx_n_u_metricIntersection2 __pyx_string_tab[5503]
#define __pyx_n_u_metricIntersection3 __pyx_string_tab[5504]
#define __pyx_n_u_metricIsIsotropic __pyx_string_tab[5505]
#define __pyx_n_u_metricIsUniform __pyx_string_tab[5506]
#define __pyx_n_u_metricNoInsertion __pyx_string_tab[5507]
#define __pyx_n_u_metricNoMovement __pyx_string_tab[5508]
#define __pyx_n_u_metricNoSurf __pyx_string_tab[5509]
#define __pyx_n_u_metricNoSwapping __pyx_string_tab[5510]
#define __pyx_n_u_metricNormalize __pyx_string_tab[5511]
#define __pyx_n_u_metricRestrictAnisotropyFirst __pyx_string_tab[5512]
#define __pyx_n_u_metricSetFromOptions __pyx_string_tab[5513]
#define __pyx_n_u_metricSetGradationFactor __pyx_string_tab[5514]
#define __pyx_n_u_metricSetHausdorffNumber __pyx_string_tab[5515]
#define __pyx_n_u_metricSetIsotropic __pyx_string_tab[5516]
#define __pyx_n_u_metricSetMaximumAnisotropy __pyx_string_tab[5517]
#define __pyx_n_u_metricSetMaximumMagnitude __pyx_string_tab[5518]
#define __pyx_n_u_metricSetMinimumMagnitude __pyx_string_tab[5519]
#define __pyx_n_u_metricSetNoInsertion __pyx_string_tab[5520]
#define __pyx_n_u_metricSetNoMovement __pyx_string_tab[5521]
#define __pyx_n_u_metricSetNoSurf __pyx_string_tab[5522]
#define __pyx_n_u_metricSetNoSwapping __pyx_string_tab[5523]
#define __pyx_n_u_metricSetNormalizationOrder __pyx_string_tab[5524]
#define __pyx_n_u_metricSetNumIterations __pyx_string_tab[5525]
#define __pyx_n_u_metricSetRestrictAnisotropyFirst __pyx_string_tab[5526]
#define __pyx_n_u_metricSetTargetComplexity __pyx_string_tab[5527]
#define __pyx_n_u_metricSetUniform __pyx_string_tab[5528]
#define __pyx_n_u_metricSetVerbosity __pyx_string_tab[5529]
#define __pyx_n_u_mgtype __pyx_string_tab[5530]
#define __pyx_n_u_micro __pyx_string_tab[5531]
#define __pyx_n_u_migrate __pyx_string_tab[5532]
#define __pyx_n_u_migrateGlobalToNaturalSF __pyx_string_tab[5533]
#define __pyx_n_u_migrateVec __pyx_string_tab[5534]
#define __pyx_n_u_min __pyx_string_tab[5535]
#define __pyx_n_u_minDegree __pyx_string_tab[5536]
#define __pyx_n_u_mindeg __pyx_string_tab[5537]
#define __pyx_n_u_minor __pyx_string_tab[5538]
#define __pyx_n_u_minstep __pyx_string_tab[5539]
#define __pyx_n_u_mirror __pyx_string_tab[5540]
#define __pyx_n_u_mit __pyx_string_tab[5541]
#define __pyx_n_u_mit_2 __pyx_string_tab[5542]
#define __pyx_n_u_mlt __pyx_string_tab[5543]
#define __pyx_n_u_mode __pyx_string_tab[5544]
#define __pyx_n_u_model __pyx_string_tab[5545]
#define __pyx_n_u_module __pyx_string_tab[5546]
#define __pyx_n_u_mom __pyx_string_tab[5547]
#define __pyx_n_u_moments __pyx_string_tab[5548]
#define __pyx_n_u_monitor __pyx_string_tab[5549]
#define __pyx_n_u_monitorCancel __pyx_string_tab[5550]
#define __pyx_n_u_monitorlist __pyx_string_tab[5551]
#define __pyx_n_u_mpi4py __pyx_string_tab[5552]
#define __pyx_n_u_mpiabort __pyx_string_tab[5553]
#define __pyx_n_u_mr __pyx_string_tab[5554]
#define __pyx_n_u_mro_entries __pyx_string_tab[5555]
#define __pyx_n_u_msg __pyx_string_tab[5556]
#define __pyx_n_u_mstr __pyx_string_tab[5557]
#define __pyx_n_u_mtDot __pyx_string_tab[5558]
#define __pyx_n_u_mtDotBegin __pyx_string_tab[5559]
#define __pyx_n_u_mtDotEnd __pyx_string_tab[5560]
#define __pyx_n_u_mtype __pyx_string_tab[5561]
#define __pyx_n_u_mult __pyx_string_tab[5562]
#define __pyx_n_u_multAdd __pyx_string_tab[5563]
#define __pyx_n_u_multDiagonalBlock __pyx_string_tab[5564]
#define __pyx_n_u_multHermitian __pyx_string_tab[5565]
#define __pyx_n_u_multHermitianAdd __pyx_string_tab[5566]
#define __pyx_n_u_multTranspose __pyx_string_tab[5567]
#define __pyx_n_u_multTransposeAdd __pyx_string_tab[5568]
#define __pyx_n_u_multirootdata __pyx_string_tab[5569]
#define __pyx_n_u_n __pyx_string_tab[5570]
#define __pyx_n_u_nExtrax __pyx_string_tab[5571]
#define __pyx_n_u_nExtray __pyx_string_tab[5572]
#define __pyx_n_u_nExtraz __pyx_string_tab[5573]
#define __pyx_n_u_nLabels __pyx_string_tab[5574]
#define __pyx_n_u_na __pyx_string_tab[5575]
#define __pyx_n_u_nadj __pyx_string_tab[5576]
#define __pyx_n_u_name __pyx_string_tab[5577]
#define __pyx_n_u_name_2 __pyx_string_tab[5578]
#define __pyx_n_u_name_4 __pyx_string_tab[5579]
#define __pyx_n_u_names __pyx_string_tab[5580]
#define __pyx_n_u_napp __pyx_string_tab[5581]
#define __pyx_n_u_naturalToGlobal __pyx_string_tab[5582]
#define __pyx_n_u_naturalToGlobalBegin __pyx_string_tab[5583]
#define __pyx_n_u_naturalToGlobalEnd __pyx_string_tab[5584]
#define __pyx_n_u_nb __pyx_string_tab[5585]
#define __pyx_n_u_nbc __pyx_string_tab[5586]
#define __pyx_n_u_nbsteps __pyx_string_tab[5587]
#define __pyx_n_u_nc __pyx_string_tab[5588]
#define __pyx_n_u_ncells __pyx_string_tab[5589]
#define __pyx_n_u_ncf __pyx_string_tab[5590]
#define __pyx_n_u_ncolors __pyx_string_tab[5591]
#define __pyx_n_u_ncols __pyx_string_tab[5592]
#define __pyx_n_u_ncomp __pyx_string_tab[5593]
#define __pyx_n_u_ncone __pyx_string_tab[5594]
#define __pyx_n_u_ncoo __pyx_string_tab[5595]
#define __pyx_n_u_ncoo_i __pyx_string_tab[5596]
#define __pyx_n_u_ncoo_j __pyx_string_tab[5597]
#define __pyx_n_u_nctxs __pyx_string_tab[5598]
#define __pyx_n_u_ndarray __pyx_string_tab[5599]
#define __pyx_n_u_ndim __pyx_string_tab[5600]
#define __pyx_n_u_ndirs __pyx_string_tab[5601]
#define __pyx_n_u_ndof __pyx_string_tab[5602]
#define __pyx_n_u_ndofs __pyx_string_tab[5603]
#define __pyx_n_u_neig __pyx_string_tab[5604]
#define __pyx_n_u_neighs __pyx_string_tab[5605]
#define __pyx_n_u_nel __pyx_string_tab[5606]
#define __pyx_n_u_nen __pyx_string_tab[5607]
#define __pyx_n_u_nevents __pyx_string_tab[5608]
#define __pyx_n_u_new __pyx_string_tab[5609]
#define __pyx_n_u_new_2 __pyx_string_tab[5610]
#define __pyx_n_u_newao __pyx_string_tab[5611]
#define __pyx_n_u_newcdm __pyx_string_tab[5612]
#define __pyx_n_u_newcomm __pyx_string_tab[5613]
#define __pyx_n_u_newda __pyx_string_tab[5614]
#define __pyx_n_u_newdm __pyx_string_tab[5615]
#define __pyx_n_u_newdmc __pyx_string_tab[5616]
#define __pyx_n_u_newdmf __pyx_string_tab[5617]
#define __pyx_n_u_newdminterp __pyx_string_tab[5618]
#define __pyx_n_u_newdmlabel __pyx_string_tab[5619]
#define __pyx_n_u_newds __pyx_string_tab[5620]
#define __pyx_n_u_newdsp __pyx_string_tab[5621]
#define __pyx_n_u_newfe __pyx_string_tab[5622]
#define __pyx_n_u_newiset __pyx_string_tab[5623]
#define __pyx_n_u_newksp __pyx_string_tab[5624]
#define __pyx_n_u_newlgm __pyx_string_tab[5625]
#define __pyx_n_u_newls __pyx_string_tab[5626]
#define __pyx_n_u_newmat __pyx_string_tab[5627]
#define __pyx_n_u_newnsp __pyx_string_tab[5628]
#define __pyx_n_u_newpart __pyx_string_tab[5629]
#define __pyx_n_u_newpc __pyx_string_tab[5630]
#define __pyx_n_u_newquad __pyx_string_tab[5631]
#define __pyx_n_u_newregressor __pyx_string_tab[5632]
#define __pyx_n_u_newsct __pyx_string_tab[5633]
#define __pyx_n_u_newsec __pyx_string_tab[5634]
#define __pyx_n_u_newsf __pyx_string_tab[5635]
#define __pyx_n_u_newsnes __pyx_string_tab[5636]
#define __pyx_n_u_newsp __pyx_string_tab[5637]
#define __pyx_n_u_newtao __pyx_string_tab[5638]
#define __pyx_n_u_newtaols __pyx_string_tab[5639]
#define __pyx_n_u_newtaoterm __pyx_string_tab[5640]
#define __pyx_n_u_newtr __pyx_string_tab[5641]
#define __pyx_n_u_newts __pyx_string_tab[5642]
#define __pyx_n_u_newvec __pyx_string_tab[5643]
#define __pyx_n_u_newvwr __pyx_string_tab[5644]
#define __pyx_n_u_nf __pyx_string_tab[5645]
#define __pyx_n_u_nfields __pyx_string_tab[5646]
#define __pyx_n_u_ng __pyx_string_tab[5647]
#define __pyx_n_u_ngs __pyx_string_tab[5648]
#define __pyx_n_u_ni __pyx_string_tab[5649]
#define __pyx_n_u_nidx __pyx_string_tab[5650]
#define __pyx_n_u_niidx __pyx_string_tab[5651]
#define __pyx_n_u_nindex __pyx_string_tab[5652]
#define __pyx_n_u_nj_2 __pyx_string_tab[5653]
#define __pyx_n_u_nl __pyx_string_tab[5654]
#define __pyx_n_u_nleaves __pyx_string_tab[5655]
#define __pyx_n_u_nlevels __pyx_string_tab[5656]
#define __pyx_n_u_nlocal __pyx_string_tab[5657]
#define __pyx_n_u_nm __pyx_string_tab[5658]
#define __pyx_n_u_nmax __pyx_string_tab[5659]
#define __pyx_n_u_nmin __pyx_string_tab[5660]
#define __pyx_n_u_nnz __pyx_string_tab[5661]
#define __pyx_n_u_noInsert __pyx_string_tab[5662]
#define __pyx_n_u_noMove __pyx_string_tab[5663]
#define __pyx_n_u_noSurf __pyx_string_tab[5664]
#define __pyx_n_u_noSwap __pyx_string_tab[5665]
#define __pyx_n_u_no_2 __pyx_string_tab[5666]
#define __pyx_n_u_nodes __pyx_string_tab[5667]
#define __pyx_n_u_nodesPerCell __pyx_string_tab[5668]
#define __pyx_n_u_noffsets __pyx_string_tab[5669]
#define __pyx_n_u_noi __pyx_string_tab[5670]
#define __pyx_n_u_noidx __pyx_string_tab[5671]
#define __pyx_n_u_noj __pyx_string_tab[5672]
#define __pyx_n_u_none __pyx_string_tab[5673]
#define __pyx_n_u_nonzero __pyx_string_tab[5674]
#define __pyx_n_u_norie __pyx_string_tab[5675]
#define __pyx_n_u_norm __pyx_string_tab[5676]
#define __pyx_n_u_normBegin __pyx_string_tab[5677]
#define __pyx_n_u_normEnd __pyx_string_tab[5678]
#define __pyx_n_u_norm_1_2 __pyx_string_tab[5679]
#define __pyx_n_u_norm_type __pyx_string_tab[5680]
#define __pyx_n_u_normal __pyx_string_tab[5681]
#define __pyx_n_u_normalize __pyx_string_tab[5682]
#define __pyx_n_u_normsched __pyx_string_tab[5683]
#define __pyx_n_u_normtype __pyx_string_tab[5684]
#define __pyx_n_u_nout __pyx_string_tab[5685]
#define __pyx_n_u_nov __pyx_string_tab[5686]
#define __pyx_n_u_np_subctx __pyx_string_tab[5687]
#define __pyx_n_u_npart __pyx_string_tab[5688]
#define __pyx_n_u_npetsc __pyx_string_tab[5689]
#define __pyx_n_u_npoints __pyx_string_tab[5690]
#define __pyx_n_u_nproc __pyx_string_tab[5691]
#define __pyx_n_u_nprocs __pyx_string_tab[5692]
#define __pyx_n_u_npy_flags __pyx_string_tab[5693]
#define __pyx_n_u_nr __pyx_string_tab[5694]
#define __pyx_n_u_nranges __pyx_string_tab[5695]
#define __pyx_n_u_nremote __pyx_string_tab[5696]
#define __pyx_n_u_nroots __pyx_string_tab[5697]
#define __pyx_n_u_nrows __pyx_string_tab[5698]
#define __pyx_n_u_nsd __pyx_string_tab[5699]
#define __pyx_n_u_nsize __pyx_string_tab[5700]
#define __pyx_n_u_nsizes __pyx_string_tab[5701]
#define __pyx_n_u_nsp __pyx_string_tab[5702]
#define __pyx_n_u_nsubcomm __pyx_string_tab[5703]
#define __pyx_n_u_nsubcomm_2 __pyx_string_tab[5704]
#define __pyx_n_u_nsupp __pyx_string_tab[5705]
#define __pyx_n_u_nt __pyx_string_tab[5706]
#define __pyx_n_u_nterm __pyx_string_tab[5707]
#define __pyx_n_u_ntolr __pyx_string_tab[5708]
#define __pyx_n_u_ntype __pyx_string_tab[5709]
#define __pyx_n_u_null __pyx_string_tab[5710]
#define __pyx_n_u_numBatches __pyx_string_tab[5711]
#define __pyx_n_u_numBlocks __pyx_string_tab[5712]
#define __pyx_n_u_numCells __pyx_string_tab[5713]
#define __pyx_n_u_numComp __pyx_string_tab[5714]
#define __pyx_n_u_numCorners __pyx_string_tab[5715]
#define __pyx_n_u_numCoveringPoints __pyx_string_tab[5716]
#define __pyx_n_u_numDof __pyx_string_tab[5717]
#define __pyx_n_u_numFields __pyx_string_tab[5718]
#define __pyx_n_u_numGhostBcs __pyx_string_tab[5719]
#define __pyx_n_u_numGhostCells __pyx_string_tab[5720]
#define __pyx_n_u_numGlobalBcs __pyx_string_tab[5721]
#define __pyx_n_u_numIter __pyx_string_tab[5722]
#define __pyx_n_u_numMessages __pyx_string_tab[5723]
#define __pyx_n_u_numPoints __pyx_string_tab[5724]
#define __pyx_n_u_numProcs __pyx_string_tab[5725]
#define __pyx_n_u_numReductions __pyx_string_tab[5726]
#define __pyx_n_u_numStrata __pyx_string_tab[5727]
#define __pyx_n_u_numSubSpaces __pyx_string_tab[5728]
#define __pyx_n_u_numSumSpaces __pyx_string_tab[5729]
#define __pyx_n_u_numTensSpaces __pyx_string_tab[5730]
#define __pyx_n_u_numValues __pyx_string_tab[5731]
#define __pyx_n_u_numVertices __pyx_string_tab[5732]
#define __pyx_n_u_numprocs __pyx_string_tab[5733]
#define __pyx_n_u_nv_2 __pyx_string_tab[5734]
#define __pyx_n_u_nvtx __pyx_string_tab[5735]
#define __pyx_n_u_nxs __pyx_string_tab[5736]
#define __pyx_n_u_nxt __pyx_string_tab[5737]
#define __pyx_n_u_nz __pyx_string_tab[5738]
#define __pyx_n_u_nz_allocated __pyx_string_tab[5739]
#define __pyx_n_u_nz_unneeded __pyx_string_tab[5740]
#define __pyx_n_u_nz_used __pyx_string_tab[5741]
#define __pyx_n_u_nzdiag __pyx_string_tab[5742]
#define __pyx_n_u_o __pyx_string_tab[5743]
#define __pyx_n_u_oEnd __pyx_string_tab[5744]
#define __pyx_n_u_oStart __pyx_string_tab[5745]
#define __pyx_n_u_obj __pyx_string_tab[5746]
#define __pyx_n_u_obj_copy __pyx_string_tab[5747]
#define __pyx_n_u_object __pyx_string_tab[5748]
#define __pyx_n_u_objective __pyx_string_tab[5749]
#define __pyx_n_u_objgrad __pyx_string_tab[5750]
#define __pyx_n_u_objpre __pyx_string_tab[5751]
#define __pyx_n_u_objs __pyx_string_tab[5752]
#define __pyx_n_u_oc __pyx_string_tab[5753]
#define __pyx_n_u_oconverged __pyx_string_tab[5754]
#define __pyx_n_u_ocounts __pyx_string_tab[5755]
#define __pyx_n_u_octx __pyx_string_tab[5756]
#define __pyx_n_u_offset __pyx_string_tab[5757]
#define __pyx_n_u_oi __pyx_string_tab[5758]
#define __pyx_n_u_oidx __pyx_string_tab[5759]
#define __pyx_n_u_oindices __pyx_string_tab[5760]
#define __pyx_n_u_oj __pyx_string_tab[5761]
#define __pyx_n_u_ol __pyx_string_tab[5762]
#define __pyx_n_u_omega __pyx_string_tab[5763]
#define __pyx_n_u_ometric __pyx_string_tab[5764]
#define __pyx_n_u_onnz __pyx_string_tab[5765]
#define __pyx_n_u_op __pyx_string_tab[5766]
#define __pyx_n_u_open __pyx_string_tab[5767]
#define __pyx_n_u_operator __pyx_string_tab[5768]
#define __pyx_n_u_operators __pyx_string_tab[5769]
#define __pyx_n_u_option __pyx_string_tab[5770]
#define __pyx_n_u_options __pyx_string_tab[5771]
#define __pyx_n_u_opts __pyx_string_tab[5772]
#define __pyx_n_u_ord_type __pyx_string_tab[5773]
#define __pyx_n_u_order __pyx_string_tab[5774]
#define __pyx_n_u_orient __pyx_string_tab[5775]
#define __pyx_n_u_orientation __pyx_string_tab[5776]
#define __pyx_n_u_other __pyx_string_tab[5777]
#define __pyx_n_u_otype __pyx_string_tab[5778]
#define __pyx_n_u_ou __pyx_string_tab[5779]
#define __pyx_n_u_out __pyx_string_tab[5780]
#define __pyx_n_u_output __pyx_string_tab[5781]
#define __pyx_n_u_ov __pyx_string_tab[5782]
#define __pyx_n_u_oval __pyx_string_tab[5783]
#define __pyx_n_u_ovec __pyx_string_tab[5784]
#define __pyx_n_u_overlap __pyx_string_tab[5785]
#define __pyx_n_u_ownership_ranges __pyx_string_tab[5786]
#define __pyx_n_u_ozz __pyx_string_tab[5787]
#define __pyx_n_u_p __pyx_string_tab[5788]
#define __pyx_n_u_p1 __pyx_string_tab[5789]
#define __pyx_n_u_pEnd __pyx_string_tab[5790]
#define __pyx_n_u_pStart __pyx_string_tab[5791]
#define __pyx_n_u_pack __pyx_string_tab[5792]
#define __pyx_n_u_package __pyx_string_tab[5793]
#define __pyx_n_u_package_2 __pyx_string_tab[5794]
#define __pyx_n_u_parallel __pyx_string_tab[5795]
#define __pyx_n_u_params __pyx_string_tab[5796]
#define __pyx_n_u_parent __pyx_string_tab[5797]
#define __pyx_n_u_part __pyx_string_tab[5798]
#define __pyx_n_u_part_type __pyx_string_tab[5799]
#define __pyx_n_u_partitioning __pyx_string_tab[5800]
#define __pyx_n_u_partitioningCount __pyx_string_tab[5801]
#define __pyx_n_u_partitioningToNumbering __pyx_string_tab[5802]
#define __pyx_n_u_pbs __pyx_string_tab[5803]
#define __pyx_n_u_pc __pyx_string_tab[5804]
#define __pyx_n_u_pc_type __pyx_string_tab[5805]
#define __pyx_n_u_pconforming __pyx_string_tab[5806]
#define __pyx_n_u_pcratio __pyx_string_tab[5807]
#define __pyx_n_u_pd __pyx_string_tab[5808]
#define __pyx_n_u_pda __pyx_string_tab[5809]
#define __pyx_n_u_pdavec __pyx_string_tab[5810]
#define __pyx_n_u_pdim __pyx_string_tab[5811]
#define __pyx_n_u_periodic __pyx_string_tab[5812]
#define __pyx_n_u_perm __pyx_string_tab[5813]
#define __pyx_n_u_permutation __pyx_string_tab[5814]
#define __pyx_n_u_permute __pyx_string_tab[5815]
#define __pyx_n_u_peta __pyx_string_tab[5816]
#define __pyx_n_u_petsc __pyx_string_tab[5817]
#define __pyx_n_u_petsc2app __pyx_string_tab[5818]
#define __pyx_n_u_petsc4py_PETSc __pyx_string_tab[5819]
#define __pyx_n_u_pfield __pyx_string_tab[5820]
#define __pyx_n_u_pgord __pyx_string_tab[5821]
#define __pyx_n_u_phas __pyx_string_tab[5822]
#define __pyx_n_u_pi __pyx_string_tab[5823]
#define __pyx_n_u_pidlist __pyx_string_tab[5824]
#define __pyx_n_u_pinterior __pyx_string_tab[5825]
#define __pyx_n_u_pj __pyx_string_tab[5826]
#define __pyx_n_u_pl2l __pyx_string_tab[5827]
#define __pyx_n_u_placeArray __pyx_string_tab[5828]
#define __pyx_n_u_plevels __pyx_string_tab[5829]
#define __pyx_n_u_plexname __pyx_string_tab[5830]
#define __pyx_n_u_pmat __pyx_string_tab[5831]
#define __pyx_n_u_pname __pyx_string_tab[5832]
#define __pyx_n_u_pobj __pyx_string_tab[5833]
#define __pyx_n_u_poi __pyx_string_tab[5834]
#define __pyx_n_u_point __pyx_string_tab[5835]
#define __pyx_n_u_points __pyx_string_tab[5836]
#define __pyx_n_u_pointwiseDivide __pyx_string_tab[5837]
#define __pyx_n_u_pointwiseMax __pyx_string_tab[5838]
#define __pyx_n_u_pointwiseMaxAbs __pyx_string_tab[5839]
#define __pyx_n_u_pointwiseMin __pyx_string_tab[5840]
#define __pyx_n_u_pointwiseMult __pyx_string_tab[5841]
#define __pyx_n_u_poj __pyx_string_tab[5842]
#define __pyx_n_u_pop __pyx_string_tab[5843]
#define __pyx_n_u_popASCIISynchronized __pyx_string_tab[5844]
#define __pyx_n_u_popASCIITab __pyx_string_tab[5845]
#define __pyx_n_u_popErrorHandler __pyx_string_tab[5846]
#define __pyx_n_u_popFormat __pyx_string_tab[5847]
#define __pyx_n_u_popGroup __pyx_string_tab[5848]
#define __pyx_n_u_popSignalHandler __pyx_string_tab[5849]
#define __pyx_n_u_popTimestepping __pyx_string_tab[5850]
#define __pyx_n_u_pop_python_vfprintf __pyx_string_tab[5851]
#define __pyx_n_u_porder __pyx_string_tab[5852]
#define __pyx_n_u_position __pyx_string_tab[5853]
#define __pyx_n_u_positive_definite __pyx_string_tab[5854]
#define __pyx_n_u_postSolve __pyx_string_tab[5855]
#define __pyx_n_u_postStep __pyx_string_tab[5856]
#define __pyx_n_u_postevent __pyx_string_tab[5857]
#define __pyx_n_u_postsolve __pyx_string_tab[5858]
#define __pyx_n_u_poststep __pyx_string_tab[5859]
#define __pyx_n_u_pov __pyx_string_tab[5860]
#define __pyx_n_u_pr __pyx_string_tab[5861]
#define __pyx_n_u_pre __pyx_string_tab[5862]
#define __pyx_n_u_preSolve __pyx_string_tab[5863]
#define __pyx_n_u_preStep __pyx_string_tab[5864]
#define __pyx_n_u_pre_finalize __pyx_string_tab[5865]
#define __pyx_n_u_preallocatorPreallocate __pyx_string_tab[5866]
#define __pyx_n_u_precheck __pyx_string_tab[5867]
#define __pyx_n_u_predict __pyx_string_tab[5868]
#define __pyx_n_u_prefix __pyx_string_tab[5869]
#define __pyx_n_u_prefixPop __pyx_string_tab[5870]
#define __pyx_n_u_prefixPush __pyx_string_tab[5871]
#define __pyx_n_u_prepare __pyx_string_tab[5872]
#define __pyx_n_u_prepend __pyx_string_tab[5873]
#define __pyx_n_u_presolve __pyx_string_tab[5874]
#define __pyx_n_u_prestep __pyx_string_tab[5875]
#define __pyx_n_u_primv __pyx_string_tab[5876]
#define __pyx_n_u_printfASCII __pyx_string_tab[5877]
#define __pyx_n_u_printfASCIISynchronized __pyx_string_tab[5878]
#define __pyx_n_u_proc_sizes __pyx_string_tab[5879]
#define __pyx_n_u_procs __pyx_string_tab[5880]
#define __pyx_n_u_productNumeric __pyx_string_tab[5881]
#define __pyx_n_u_productSetFromOptions __pyx_string_tab[5882]
#define __pyx_n_u_productSymbolic __pyx_string_tab[5883]
#define __pyx_n_u_project __pyx_string_tab[5884]
#define __pyx_n_u_projectFields __pyx_string_tab[5885]
#define __pyx_n_u_property __pyx_string_tab[5886]
#define __pyx_n_u_psizes __pyx_string_tab[5887]
#define __pyx_n_u_ptap __pyx_string_tab[5888]
#define __pyx_n_u_ptr __pyx_string_tab[5889]
#define __pyx_n_u_ptrans __pyx_string_tab[5890]
#define __pyx_n_u_ptype __pyx_string_tab[5891]
#define __pyx_n_u_push __pyx_string_tab[5892]
#define __pyx_n_u_pushASCIISynchronized __pyx_string_tab[5893]
#define __pyx_n_u_pushASCIITab __pyx_string_tab[5894]
#define __pyx_n_u_pushErrorHandler __pyx_string_tab[5895]
#define __pyx_n_u_pushFormat __pyx_string_tab[5896]
#define __pyx_n_u_pushGroup __pyx_string_tab[5897]
#define __pyx_n_u_pushTimestepping __pyx_string_tab[5898]
#define __pyx_n_u_push_python_vfprintf __pyx_string_tab[5899]
#define __pyx_n_u_pv __pyx_string_tab[5900]
#define __pyx_n_u_pval __pyx_string_tab[5901]
#define __pyx_n_u_py_ctx __pyx_string_tab[5902]
#define __pyx_n_u_py_sub_ctxs __pyx_string_tab[5903]
#define __pyx_n_u_py_type __pyx_string_tab[5904]
#define __pyx_n_u_python __pyx_string_tab[5905]
#define __pyx_n_u_pyvec __pyx_string_tab[5906]
#define __pyx_n_u_pyx_capi __pyx_string_tab[5907]
#define __pyx_n_u_pyx_checksum __pyx_string_tab[5908]
#define __pyx_n_u_pyx_state __pyx_string_tab[5909]
#define __pyx_n_u_pyx_type __pyx_string_tab[5910]
#define __pyx_n_u_pyx_unpickle_Enum __pyx_string_tab[5911]
#define __pyx_n_u_pyx_vtable __pyx_string_tab[5912]
#define __pyx_n_u_q0 __pyx_string_tab[5913]
#define __pyx_n_u_q1 __pyx_string_tab[5914]
#define __pyx_n_u_qorder __pyx_string_tab[5915]
#define __pyx_n_u_qts __pyx_string_tab[5916]
#define __pyx_n_u_quad __pyx_string_tab[5917]
#define __pyx_n_u_qualname __pyx_string_tab[5918]
#define __pyx_n_u_query __pyx_string_tab[5919]
#define __pyx_n_u_queuehdl __pyx_string_tab[5920]
#define __pyx_n_u_r __pyx_string_tab[5921]
#define __pyx_n_u_radius __pyx_string_tab[5922]
#define __pyx_n_u_random __pyx_string_tab[5923]
#define __pyx_n_u_ranges __pyx_string_tab[5924]
#define __pyx_n_u_rank __pyx_string_tab[5925]
#define __pyx_n_u_rank0 __pyx_string_tab[5926]
#define __pyx_n_u_rank1 __pyx_string_tab[5927]
#define __pyx_n_u_rank2 __pyx_string_tab[5928]
#define __pyx_n_u_rart __pyx_string_tab[5929]
#define __pyx_n_u_ratol __pyx_string_tab[5930]
#define __pyx_n_u_rbegin __pyx_string_tab[5931]
#define __pyx_n_u_rbs __pyx_string_tab[5932]
#define __pyx_n_u_rdata __pyx_string_tab[5933]
#define __pyx_n_u_rdiv __pyx_string_tab[5934]
#define __pyx_n_u_read __pyx_string_tab[5935]
#define __pyx_n_u_readonly __pyx_string_tab[5936]
#define __pyx_n_u_ready __pyx_string_tab[5937]
#define __pyx_n_u_real __pyx_string_tab[5938]
#define __pyx_n_u_realPart __pyx_string_tab[5939]
#define __pyx_n_u_reason __pyx_string_tab[5940]
#define __pyx_n_u_rebalanceSharedPoints __pyx_string_tab[5941]
#define __pyx_n_u_reciprocal __pyx_string_tab[5942]
#define __pyx_n_u_red __pyx_string_tab[5943]
#define __pyx_n_u_reduce __pyx_string_tab[5944]
#define __pyx_n_u_reduceBegin __pyx_string_tab[5945]
#define __pyx_n_u_reduceEnd __pyx_string_tab[5946]
#define __pyx_n_u_reduce_cython __pyx_string_tab[5947]
#define __pyx_n_u_reduce_ex __pyx_string_tab[5948]
#define __pyx_n_u_redundant __pyx_string_tab[5949]
#define __pyx_n_u_redundantPoints __pyx_string_tab[5950]
#define __pyx_n_u_refcnt __pyx_string_tab[5951]
#define __pyx_n_u_refct __pyx_string_tab[5952]
#define __pyx_n_u_refine __pyx_string_tab[5953]
#define __pyx_n_u_refineHierarchy __pyx_string_tab[5954]
#define __pyx_n_u_refine_x __pyx_string_tab[5955]
#define __pyx_n_u_refine_y __pyx_string_tab[5956]
#define __pyx_n_u_refine_z __pyx_string_tab[5957]
#define __pyx_n_u_refinementLimit __pyx_string_tab[5958]
#define __pyx_n_u_refinementUniform __pyx_string_tab[5959]
#define __pyx_n_u_register __pyx_string_tab[5960]
#define __pyx_n_u_registerCitation __pyx_string_tab[5961]
#define __pyx_n_u_registerField __pyx_string_tab[5962]
#define __pyx_n_u_regressor_type __pyx_string_tab[5963]
#define __pyx_n_u_rej __pyx_string_tab[5964]
#define __pyx_n_u_release __pyx_string_tab[5965]
#define __pyx_n_u_remote __pyx_string_tab[5966]
#define __pyx_n_u_remoteOffsets __pyx_string_tab[5967]
#define __pyx_n_u_remove __pyx_string_tab[5968]
#define __pyx_n_u_removeLabel __pyx_string_tab[5969]
#define __pyx_n_u_removePoint __pyx_string_tab[5970]
#define __pyx_n_u_removePointAtIndex __pyx_string_tab[5971]
#define __pyx_n_u_removeTrajectory __pyx_string_tab[5972]
#define __pyx_n_u_remove_pts __pyx_string_tab[5973]
#define __pyx_n_u_remove_sent_points __pyx_string_tab[5974]
#define __pyx_n_u_rend __pyx_string_tab[5975]
#define __pyx_n_u_renumber __pyx_string_tab[5976]
#define __pyx_n_u_reorder __pyx_string_tab[5977]
#define __pyx_n_u_reorderForNonzeroDiagonal __pyx_string_tab[5978]
#define __pyx_n_u_reorderGetDefault __pyx_string_tab[5979]
#define __pyx_n_u_reorderSetDefault __pyx_string_tab[5980]
#define __pyx_n_u_replace __pyx_string_tab[5981]
#define __pyx_n_u_repr __pyx_string_tab[5982]
#define __pyx_n_u_res __pyx_string_tab[5983]
#define __pyx_n_u_reset __pyx_string_tab[5984]
#define __pyx_n_u_resetArray __pyx_string_tab[5985]
#define __pyx_n_u_resetLMVM __pyx_string_tab[5986]
#define __pyx_n_u_reshape __pyx_string_tab[5987]
#define __pyx_n_u_residual __pyx_string_tab[5988]
#define __pyx_n_u_restart __pyx_string_tab[5989]
#define __pyx_n_u_restartStep __pyx_string_tab[5990]
#define __pyx_n_u_restoreCLMemHandle __pyx_string_tab[5991]
#define __pyx_n_u_restoreCUDAHandle __pyx_string_tab[5992]
#define __pyx_n_u_restoreDenseColumnVec __pyx_string_tab[5993]
#define __pyx_n_u_restoreDenseSubMatrix __pyx_string_tab[5994]
#define __pyx_n_u_restoreField __pyx_string_tab[5995]
#define __pyx_n_u_restoreGlobalVec __pyx_string_tab[5996]
#define __pyx_n_u_restoreHIPHandle __pyx_string_tab[5997]
#define __pyx_n_u_restoreISLocalMat __pyx_string_tab[5998]
#define __pyx_n_u_restoreLocalSubMatrix __pyx_string_tab[5999]
#define __pyx_n_u_restoreLocalVec __pyx_string_tab[6000]
#define __pyx_n_u_restoreLocalVector __pyx_string_tab[6001]
#define __pyx_n_u_restoreSubVector __pyx_string_tab[6002]
#define __pyx_n_u_restoreSubViewer __pyx_string_tab[6003]
#define __pyx_n_u_restoreVector __pyx_string_tab[6004]
#define __pyx_n_u_restrictAnisotropy __pyx_string_tab[6005]
#define __pyx_n_u_restrictAnisotropyFirst __pyx_string_tab[6006]
#define __pyx_n_u_restrictSizes __pyx_string_tab[6007]
#define __pyx_n_u_restrictcontext __pyx_string_tab[6008]
#define __pyx_n_u_restricthook __pyx_string_tab[6009]
#define __pyx_n_u_restricthooks __pyx_string_tab[6010]
#define __pyx_n_u_restriction __pyx_string_tab[6011]
#define __pyx_n_u_result __pyx_string_tab[6012]
#define __pyx_n_u_retrieveValues __pyx_string_tab[6013]
#define __pyx_n_u_return __pyx_string_tab[6014]
#define __pyx_n_u_reuse __pyx_string_tab[6015]
#define __pyx_n_u_reverse __pyx_string_tab[6016]
#define __pyx_n_u_rgLabel __pyx_string_tab[6017]
#define __pyx_n_u_rhist __pyx_string_tab[6018]
#define __pyx_n_u_rhs __pyx_string_tab[6019]
#define __pyx_n_u_rhsjacobianp __pyx_string_tab[6020]
#define __pyx_n_u_right __pyx_string_tab[6021]
#define __pyx_n_u_rl __pyx_string_tab[6022]
#define __pyx_n_u_rmap __pyx_string_tab[6023]
#define __pyx_n_u_rnd __pyx_string_tab[6024]
#define __pyx_n_u_rnd_type __pyx_string_tab[6025]
#define __pyx_n_u_rng __pyx_string_tab[6026]
#define __pyx_n_u_rnorm __pyx_string_tab[6027]
#define __pyx_n_u_rollBack __pyx_string_tab[6028]
#define __pyx_n_u_rollback __pyx_string_tab[6029]
#define __pyx_n_u_rootSection __pyx_string_tab[6030]
#define __pyx_n_u_rootdata __pyx_string_tab[6031]
#define __pyx_n_u_row __pyx_string_tab[6032]
#define __pyx_n_u_row_bsize __pyx_string_tab[6033]
#define __pyx_n_u_rowmap __pyx_string_tab[6034]
#define __pyx_n_u_rowrng __pyx_string_tab[6035]
#define __pyx_n_u_rows __pyx_string_tab[6036]
#define __pyx_n_u_rp __pyx_string_tab[6037]
#define __pyx_n_u_rrtol __pyx_string_tab[6038]
#define __pyx_n_u_rscale __pyx_string_tab[6039]
#define __pyx_n_u_rsplit __pyx_string_tab[6040]
#define __pyx_n_u_rstart __pyx_string_tab[6041]
#define __pyx_n_u_rtol __pyx_string_tab[6042]
#define __pyx_n_u_rtol_0 __pyx_string_tab[6043]
#define __pyx_n_u_rtol_max __pyx_string_tab[6044]
#define __pyx_n_u_rtspan __pyx_string_tab[6045]
#define __pyx_n_u_rval __pyx_string_tab[6046]
#define __pyx_n_u_rval1 __pyx_string_tab[6047]
#define __pyx_n_u_rval2 __pyx_string_tab[6048]
#define __pyx_n_u_rval3 __pyx_string_tab[6049]
#define __pyx_n_u_rvec __pyx_string_tab[6050]
#define __pyx_n_u_rw __pyx_string_tab[6051]
#define __pyx_n_u_s1 __pyx_string_tab[6052]
#define __pyx_n_u_s2 __pyx_string_tab[6053]
#define __pyx_n_u_sEnd __pyx_string_tab[6054]
#define __pyx_n_u_sStart __pyx_string_tab[6055]
#define __pyx_n_u_s_2 __pyx_string_tab[6056]
#define __pyx_n_u_s_3 __pyx_string_tab[6057]
#define __pyx_n_u_s_is __pyx_string_tab[6058]
#define __pyx_n_u_sa __pyx_string_tab[6059]
#define __pyx_n_u_sanitizeSubMesh __pyx_string_tab[6060]
#define __pyx_n_u_scale __pyx_string_tab[6061]
#define __pyx_n_u_scale_2 __pyx_string_tab[6062]
#define __pyx_n_u_scatter __pyx_string_tab[6063]
#define __pyx_n_u_scatterBegin __pyx_string_tab[6064]
#define __pyx_n_u_scatterEnd __pyx_string_tab[6065]
#define __pyx_n_u_scatter_type __pyx_string_tab[6066]
#define __pyx_n_u_sdim __pyx_string_tab[6067]
#define __pyx_n_u_sec __pyx_string_tab[6068]
#define __pyx_n_u_seconds __pyx_string_tab[6069]
#define __pyx_n_u_section __pyx_string_tab[6070]
#define __pyx_n_u_sectionLoad __pyx_string_tab[6071]
#define __pyx_n_u_sectionSF __pyx_string_tab[6072]
#define __pyx_n_u_sectionView __pyx_string_tab[6073]
#define __pyx_n_u_sectiondm __pyx_string_tab[6074]
#define __pyx_n_u_seed __pyx_string_tab[6075]
#define __pyx_n_u_selected __pyx_string_tab[6076]
#define __pyx_n_u_self __pyx_string_tab[6077]
#define __pyx_n_u_sep __pyx_string_tab[6078]
#define __pyx_n_u_set __pyx_string_tab[6079]
#define __pyx_n_u_setALMMSubsolver __pyx_string_tab[6080]
#define __pyx_n_u_setALMMType __pyx_string_tab[6081]
#define __pyx_n_u_setARKIMEXFastSlowSplit __pyx_string_tab[6082]
#define __pyx_n_u_setARKIMEXFullyImplicit __pyx_string_tab[6083]
#define __pyx_n_u_setARKIMEXType __pyx_string_tab[6084]
#define __pyx_n_u_setASCIITab __pyx_string_tab[6085]
#define __pyx_n_u_setASMLocalSubdomains __pyx_string_tab[6086]
#define __pyx_n_u_setASMOverlap __pyx_string_tab[6087]
#define __pyx_n_u_setASMSortIndices __pyx_string_tab[6088]
#define __pyx_n_u_setASMTotalSubdomains __pyx_string_tab[6089]
#define __pyx_n_u_setASMType __pyx_string_tab[6090]
#define __pyx_n_u_setActive __pyx_string_tab[6091]
#define __pyx_n_u_setActiveAll __pyx_string_tab[6092]
#define __pyx_n_u_setAdjacency __pyx_string_tab[6093]
#define __pyx_n_u_setAdjacencyUseAnchors __pyx_string_tab[6094]
#define __pyx_n_u_setAlphaParams __pyx_string_tab[6095]
#define __pyx_n_u_setAlphaRadius __pyx_string_tab[6096]
#define __pyx_n_u_setAppCtx __pyx_string_tab[6097]
#define __pyx_n_u_setApplicationContext __pyx_string_tab[6098]
#define __pyx_n_u_setArray __pyx_string_tab[6099]
#define __pyx_n_u_setAttr __pyx_string_tab[6100]
#define __pyx_n_u_setAuxiliaryVec __pyx_string_tab[6101]
#define __pyx_n_u_setBDDCChangeOfBasisMat __pyx_string_tab[6102]
#define __pyx_n_u_setBDDCCoarseningRatio __pyx_string_tab[6103]
#define __pyx_n_u_setBDDCDirichletBoundaries __pyx_string_tab[6104]
#define __pyx_n_u_setBDDCDirichletBoundariesLocal __pyx_string_tab[6105]
#define __pyx_n_u_setBDDCDiscreteGradient __pyx_string_tab[6106]
#define __pyx_n_u_setBDDCDivergenceMat __pyx_string_tab[6107]
#define __pyx_n_u_setBDDCDofsSplitting __pyx_string_tab[6108]
#define __pyx_n_u_setBDDCDofsSplittingLocal __pyx_string_tab[6109]
#define __pyx_n_u_setBDDCLevels __pyx_string_tab[6110]
#define __pyx_n_u_setBDDCLocalAdjacency __pyx_string_tab[6111]
#define __pyx_n_u_setBDDCNeumannBoundaries __pyx_string_tab[6112]
#define __pyx_n_u_setBDDCNeumannBoundariesLocal __pyx_string_tab[6113]
#define __pyx_n_u_setBDDCPrimalVerticesIS __pyx_string_tab[6114]
#define __pyx_n_u_setBDDCPrimalVerticesLocalIS __pyx_string_tab[6115]
#define __pyx_n_u_setBNCGType __pyx_string_tab[6116]
#define __pyx_n_u_setBRGNDictionaryMatrix __pyx_string_tab[6117]
#define __pyx_n_u_setBRGNRegularizerHessian __pyx_string_tab[6118]
#define __pyx_n_u_setBRGNRegularizerObjectiveGradi __pyx_string_tab[6119]
#define __pyx_n_u_setBRGNRegularizerWeight __pyx_string_tab[6120]
#define __pyx_n_u_setBRGNSmoothL1Epsilon __pyx_string_tab[6121]
#define __pyx_n_u_setBasicAdjacency __pyx_string_tab[6122]
#define __pyx_n_u_setBasisSpace __pyx_string_tab[6123]
#define __pyx_n_u_setBlockIndices __pyx_string_tab[6124]
#define __pyx_n_u_setBlockSize __pyx_string_tab[6125]
#define __pyx_n_u_setBlockSizes __pyx_string_tab[6126]
#define __pyx_n_u_setBoundaryType __pyx_string_tab[6127]
#define __pyx_n_u_setBoundaryTypes __pyx_string_tab[6128]
#define __pyx_n_u_setCellCoordinateDM __pyx_string_tab[6129]
#define __pyx_n_u_setCellCoordinateSection __pyx_string_tab[6130]
#define __pyx_n_u_setCellCoordinates __pyx_string_tab[6131]
#define __pyx_n_u_setCellCoordinatesLocal __pyx_string_tab[6132]
#define __pyx_n_u_setCellDM __pyx_string_tab[6133]
#define __pyx_n_u_setCellDMActive __pyx_string_tab[6134]
#define __pyx_n_u_setCellType __pyx_string_tab[6135]
#define __pyx_n_u_setChart __pyx_string_tab[6136]
#define __pyx_n_u_setCoarseDM __pyx_string_tab[6137]
#define __pyx_n_u_setCoarsen __pyx_string_tab[6138]
#define __pyx_n_u_setCompositeType __pyx_string_tab[6139]
#define __pyx_n_u_setComputeEigenvalues __pyx_string_tab[6140]
#define __pyx_n_u_setComputeOperators __pyx_string_tab[6141]
#define __pyx_n_u_setComputeRHS __pyx_string_tab[6142]
#define __pyx_n_u_setComputeSingularValues __pyx_string_tab[6143]
#define __pyx_n_u_setCone __pyx_string_tab[6144]
#define __pyx_n_u_setConeOrientation __pyx_string_tab[6145]
#define __pyx_n_u_setConeSize __pyx_string_tab[6146]
#define __pyx_n_u_setConstraintDof __pyx_string_tab[6147]
#define __pyx_n_u_setConstraintIndices __pyx_string_tab[6148]
#define __pyx_n_u_setConstraintTolerances __pyx_string_tab[6149]
#define __pyx_n_u_setConstraints __pyx_string_tab[6150]
#define __pyx_n_u_setConvergedReason __pyx_string_tab[6151]
#define __pyx_n_u_setConvergenceHistory __pyx_string_tab[6152]
#define __pyx_n_u_setConvergenceTest __pyx_string_tab[6153]
#define __pyx_n_u_setCoordinateDMType __pyx_string_tab[6154]
#define __pyx_n_u_setCoordinateDim __pyx_string_tab[6155]
#define __pyx_n_u_setCoordinateDisc __pyx_string_tab[6156]
#define __pyx_n_u_setCoordinateName __pyx_string_tab[6157]
#define __pyx_n_u_setCoordinates __pyx_string_tab[6158]
#define __pyx_n_u_setCoordinatesLocal __pyx_string_tab[6159]
#define __pyx_n_u_setCostGradients __pyx_string_tab[6160]
#define __pyx_n_u_setCreateDomainDecomposition __pyx_string_tab[6161]
#define __pyx_n_u_setCreateDomainDecompositionScat __pyx_string_tab[6162]
#define __pyx_n_u_setCreateFieldDecomposition __pyx_string_tab[6163]
#define __pyx_n_u_setCreateGlobalVector __pyx_string_tab[6164]
#define __pyx_n_u_setCreateInjection __pyx_string_tab[6165]
#define __pyx_n_u_setCreateInterpolation __pyx_string_tab[6166]
#define __pyx_n_u_setCreateLocalVector __pyx_string_tab[6167]
#define __pyx_n_u_setCreateMatrix __pyx_string_tab[6168]
#define __pyx_n_u_setCreateRestriction __pyx_string_tab[6169]
#define __pyx_n_u_setCreateSubDM __pyx_string_tab[6170]
#define __pyx_n_u_setCurrent __pyx_string_tab[6171]
#define __pyx_n_u_setDIRKType __pyx_string_tab[6172]
#define __pyx_n_u_setDM __pyx_string_tab[6173]
#define __pyx_n_u_setDMActive __pyx_string_tab[6174]
#define __pyx_n_u_setDS __pyx_string_tab[6175]
#define __pyx_n_u_setDefaultComm __pyx_string_tab[6176]
#define __pyx_n_u_setDefaultGlobalSection __pyx_string_tab[6177]
#define __pyx_n_u_setDefaultLocalSection __pyx_string_tab[6178]
#define __pyx_n_u_setDefaultSF __pyx_string_tab[6179]
#define __pyx_n_u_setDefaultSection __pyx_string_tab[6180]
#define __pyx_n_u_setDefaultType __pyx_string_tab[6181]
#define __pyx_n_u_setDefaultValue __pyx_string_tab[6182]
#define __pyx_n_u_setDeflationCoarseMat __pyx_string_tab[6183]
#define __pyx_n_u_setDeflationCorrectionFactor __pyx_string_tab[6184]
#define __pyx_n_u_setDeflationInitOnly __pyx_string_tab[6185]
#define __pyx_n_u_setDeflationLevels __pyx_string_tab[6186]
#define __pyx_n_u_setDeflationProjectionNullSpaceM __pyx_string_tab[6187]
#define __pyx_n_u_setDeflationReductionFactor __pyx_string_tab[6188]
#define __pyx_n_u_setDeflationSpace __pyx_string_tab[6189]
#define __pyx_n_u_setDeflationSpaceToCompute __pyx_string_tab[6190]
#define __pyx_n_u_setDegree __pyx_string_tab[6191]
#define __pyx_n_u_setDenseLDA __pyx_string_tab[6192]
#define __pyx_n_u_setDevice __pyx_string_tab[6193]
#define __pyx_n_u_setDiagonal __pyx_string_tab[6194]
#define __pyx_n_u_setDim __pyx_string_tab[6195]
#define __pyx_n_u_setDimension __pyx_string_tab[6196]
#define __pyx_n_u_setDiscretisation __pyx_string_tab[6197]
#define __pyx_n_u_setDivergenceTolerance __pyx_string_tab[6198]
#define __pyx_n_u_setDof __pyx_string_tab[6199]
#define __pyx_n_u_setDrawInfo __pyx_string_tab[6200]
#define __pyx_n_u_setDualSpace __pyx_string_tab[6201]
#define __pyx_n_u_setElementType __pyx_string_tab[6202]
#define __pyx_n_u_setEqualityConstraints __pyx_string_tab[6203]
#define __pyx_n_u_setEquationType __pyx_string_tab[6204]
#define __pyx_n_u_setErrorIfNotConverged __pyx_string_tab[6205]
#define __pyx_n_u_setErrorIfStepFails __pyx_string_tab[6206]
#define __pyx_n_u_setEvaluationTimes __pyx_string_tab[6207]
#define __pyx_n_u_setEventHandler __pyx_string_tab[6208]
#define __pyx_n_u_setEventTolerances __pyx_string_tab[6209]
#define __pyx_n_u_setExactFinalTime __pyx_string_tab[6210]
#define __pyx_n_u_setFASInjection __pyx_string_tab[6211]
#define __pyx_n_u_setFASInterpolation __pyx_string_tab[6212]
#define __pyx_n_u_setFASLevels __pyx_string_tab[6213]
#define __pyx_n_u_setFASRScale __pyx_string_tab[6214]
#define __pyx_n_u_setFASRestriction __pyx_string_tab[6215]
#define __pyx_n_u_setFaceQuadrature __pyx_string_tab[6216]
#define __pyx_n_u_setFactorLevels __pyx_string_tab[6217]
#define __pyx_n_u_setFactorOrdering __pyx_string_tab[6218]
#define __pyx_n_u_setFactorPivot __pyx_string_tab[6219]
#define __pyx_n_u_setFactorSetUpSolverType __pyx_string_tab[6220]
#define __pyx_n_u_setFactorShift __pyx_string_tab[6221]
#define __pyx_n_u_setFactorSolverType __pyx_string_tab[6222]
#define __pyx_n_u_setFailedReason __pyx_string_tab[6223]
#define __pyx_n_u_setField __pyx_string_tab[6224]
#define __pyx_n_u_setFieldAdjacency __pyx_string_tab[6225]
#define __pyx_n_u_setFieldComponents __pyx_string_tab[6226]
#define __pyx_n_u_setFieldConstraintDof __pyx_string_tab[6227]
#define __pyx_n_u_setFieldConstraintIndices __pyx_string_tab[6228]
#define __pyx_n_u_setFieldDof __pyx_string_tab[6229]
#define __pyx_n_u_setFieldName __pyx_string_tab[6230]
#define __pyx_n_u_setFieldOffset __pyx_string_tab[6231]
#define __pyx_n_u_setFieldSplitFields __pyx_string_tab[6232]
#define __pyx_n_u_setFieldSplitIS __pyx_string_tab[6233]
#define __pyx_n_u_setFieldSplitSchurFactType __pyx_string_tab[6234]
#define __pyx_n_u_setFieldSplitSchurPreType __pyx_string_tab[6235]
#define __pyx_n_u_setFieldSplitType __pyx_string_tab[6236]
#define __pyx_n_u_setFileMode __pyx_string_tab[6237]
#define __pyx_n_u_setFileName __pyx_string_tab[6238]
#define __pyx_n_u_setForceIteration __pyx_string_tab[6239]
#define __pyx_n_u_setFromOptions __pyx_string_tab[6240]
#define __pyx_n_u_setFunction __pyx_string_tab[6241]
#define __pyx_n_u_setFunctionNorm __pyx_string_tab[6242]
#define __pyx_n_u_setFunctionTolerances __pyx_string_tab[6243]
#define __pyx_n_u_setGAMGLevels __pyx_string_tab[6244]
#define __pyx_n_u_setGAMGSmooths __pyx_string_tab[6245]
#define __pyx_n_u_setGAMGType __pyx_string_tab[6246]
#define __pyx_n_u_setGASMOverlap __pyx_string_tab[6247]
#define __pyx_n_u_setGASMType __pyx_string_tab[6248]
#define __pyx_n_u_setGMRESRestart __pyx_string_tab[6249]
#define __pyx_n_u_setGlobalSection __pyx_string_tab[6250]
#define __pyx_n_u_setGlobalSizes __pyx_string_tab[6251]
#define __pyx_n_u_setGlobalToLocal __pyx_string_tab[6252]
#define __pyx_n_u_setGlobalToLocalVecScatter __pyx_string_tab[6253]
#define __pyx_n_u_setGlobalVector __pyx_string_tab[6254]
#define __pyx_n_u_setGradient __pyx_string_tab[6255]
#define __pyx_n_u_setGradientNorm __pyx_string_tab[6256]
#define __pyx_n_u_setGraph __pyx_string_tab[6257]
#define __pyx_n_u_setHPDDMAuxiliaryMat __pyx_string_tab[6258]
#define __pyx_n_u_setHPDDMCoarseCorrectionType __pyx_string_tab[6259]
#define __pyx_n_u_setHPDDMDeflationMat __pyx_string_tab[6260]
#define __pyx_n_u_setHPDDMHasNeumannMat __pyx_string_tab[6261]
#define __pyx_n_u_setHPDDMRHSMat __pyx_string_tab[6262]
#define __pyx_n_u_setHPDDMType __pyx_string_tab[6263]
#define __pyx_n_u_setHYPREAMSSetInteriorNodes __pyx_string_tab[6264]
#define __pyx_n_u_setHYPREDiscreteCurl __pyx_string_tab[6265]
#define __pyx_n_u_setHYPREDiscreteGradient __pyx_string_tab[6266]
#define __pyx_n_u_setHYPRESetAlphaPoissonMatrix __pyx_string_tab[6267]
#define __pyx_n_u_setHYPRESetBetaPoissonMatrix __pyx_string_tab[6268]
#define __pyx_n_u_setHYPRESetEdgeConstantVectors __pyx_string_tab[6269]
#define __pyx_n_u_setHYPRESetInterpolations __pyx_string_tab[6270]
#define __pyx_n_u_setHYPREType __pyx_string_tab[6271]
#define __pyx_n_u_setHessian __pyx_string_tab[6272]
#define __pyx_n_u_setI2Function __pyx_string_tab[6273]
#define __pyx_n_u_setI2Jacobian __pyx_string_tab[6274]
#define __pyx_n_u_setIFunction __pyx_string_tab[6275]
#define __pyx_n_u_setIJacobian __pyx_string_tab[6276]
#define __pyx_n_u_setIJacobianP __pyx_string_tab[6277]
#define __pyx_n_u_setISAllowRepeated __pyx_string_tab[6278]
#define __pyx_n_u_setISLocalMat __pyx_string_tab[6279]
#define __pyx_n_u_setISPreallocation __pyx_string_tab[6280]
#define __pyx_n_u_setIdentity __pyx_string_tab[6281]
#define __pyx_n_u_setIndices __pyx_string_tab[6282]
#define __pyx_n_u_setInequalityConstraints __pyx_string_tab[6283]
#define __pyx_n_u_setInitial __pyx_string_tab[6284]
#define __pyx_n_u_setInitialGuess __pyx_string_tab[6285]
#define __pyx_n_u_setInitialGuessKnoll __pyx_string_tab[6286]
#define __pyx_n_u_setInitialGuessNonzero __pyx_string_tab[6287]
#define __pyx_n_u_setInitialStepLength __pyx_string_tab[6288]
#define __pyx_n_u_setInitialTrustRegionRadius __pyx_string_tab[6289]
#define __pyx_n_u_setInterpolationType __pyx_string_tab[6290]
#define __pyx_n_u_setInterval __pyx_string_tab[6291]
#define __pyx_n_u_setIterationNumber __pyx_string_tab[6292]
#define __pyx_n_u_setJacobian __pyx_string_tab[6293]
#define __pyx_n_u_setJacobianDesign __pyx_string_tab[6294]
#define __pyx_n_u_setJacobianEquality __pyx_string_tab[6295]
#define __pyx_n_u_setJacobianInequality __pyx_string_tab[6296]
#define __pyx_n_u_setJacobianResidual __pyx_string_tab[6297]
#define __pyx_n_u_setJacobianState __pyx_string_tab[6298]
#define __pyx_n_u_setKSP __pyx_string_tab[6299]
#define __pyx_n_u_setKSPComputeOperators __pyx_string_tab[6300]
#define __pyx_n_u_setLGMap __pyx_string_tab[6301]
#define __pyx_n_u_setLMVMH0 __pyx_string_tab[6302]
#define __pyx_n_u_setLMVMJ0 __pyx_string_tab[6303]
#define __pyx_n_u_setLMVMJ0KSP __pyx_string_tab[6304]
#define __pyx_n_u_setLMVMMat __pyx_string_tab[6305]
#define __pyx_n_u_setLRCMats __pyx_string_tab[6306]
#define __pyx_n_u_setLabelOutput __pyx_string_tab[6307]
#define __pyx_n_u_setLabelValue __pyx_string_tab[6308]
#define __pyx_n_u_setLagrangeContinuity __pyx_string_tab[6309]
#define __pyx_n_u_setLagrangeTensor __pyx_string_tab[6310]
#define __pyx_n_u_setLagrangeTrimmed __pyx_string_tab[6311]
#define __pyx_n_u_setLineSearch __pyx_string_tab[6312]
#define __pyx_n_u_setLineSearchPreCheck __pyx_string_tab[6313]
#define __pyx_n_u_setLinearFitIntercept __pyx_string_tab[6314]
#define __pyx_n_u_setLinearType __pyx_string_tab[6315]
#define __pyx_n_u_setLinearUseKSP __pyx_string_tab[6316]
#define __pyx_n_u_setLocalSection __pyx_string_tab[6317]
#define __pyx_n_u_setLocalSizes __pyx_string_tab[6318]
#define __pyx_n_u_setLocalToGlobal __pyx_string_tab[6319]
#define __pyx_n_u_setLocalToGlobalVecScatter __pyx_string_tab[6320]
#define __pyx_n_u_setLocalToLocal __pyx_string_tab[6321]
#define __pyx_n_u_setLocalToLocalVecScatter __pyx_string_tab[6322]
#define __pyx_n_u_setLocalVector __pyx_string_tab[6323]
#define __pyx_n_u_setMGCycleType __pyx_string_tab[6324]
#define __pyx_n_u_setMGCycleTypeOnLevel __pyx_string_tab[6325]
#define __pyx_n_u_setMGInterpolation __pyx_string_tab[6326]
#define __pyx_n_u_setMGLevels __pyx_string_tab[6327]
#define __pyx_n_u_setMGR __pyx_string_tab[6328]
#define __pyx_n_u_setMGRScale __pyx_string_tab[6329]
#define __pyx_n_u_setMGRestriction __pyx_string_tab[6330]
#define __pyx_n_u_setMGRhs __pyx_string_tab[6331]
#define __pyx_n_u_setMGType __pyx_string_tab[6332]
#define __pyx_n_u_setMGX __pyx_string_tab[6333]
#define __pyx_n_u_setMPIGhost __pyx_string_tab[6334]
#define __pyx_n_u_setMatClosure __pyx_string_tab[6335]
#define __pyx_n_u_setMatType __pyx_string_tab[6336]
#define __pyx_n_u_setMatrix __pyx_string_tab[6337]
#define __pyx_n_u_setMaxFunctionEvaluations __pyx_string_tab[6338]
#define __pyx_n_u_setMaxKSPFailures __pyx_string_tab[6339]
#define __pyx_n_u_setMaxLinearSolveFailures __pyx_string_tab[6340]
#define __pyx_n_u_setMaxNonlinearStepFailures __pyx_string_tab[6341]
#define __pyx_n_u_setMaxSNESFailures __pyx_string_tab[6342]
#define __pyx_n_u_setMaxStepFailures __pyx_string_tab[6343]
#define __pyx_n_u_setMaxStepRejections __pyx_string_tab[6344]
#define __pyx_n_u_setMaxSteps __pyx_string_tab[6345]
#define __pyx_n_u_setMaxTime __pyx_string_tab[6346]
#define __pyx_n_u_setMaximumFunctionEvaluations __pyx_string_tab[6347]
#define __pyx_n_u_setMaximumIterations __pyx_string_tab[6348]
#define __pyx_n_u_setMigrationSF __pyx_string_tab[6349]
#define __pyx_n_u_setMonitor __pyx_string_tab[6350]
#define __pyx_n_u_setMumpsCntl __pyx_string_tab[6351]
#define __pyx_n_u_setMumpsIcntl __pyx_string_tab[6352]
#define __pyx_n_u_setNGS __pyx_string_tab[6353]
#define __pyx_n_u_setNPC __pyx_string_tab[6354]
#define __pyx_n_u_setNPCSide __pyx_string_tab[6355]
#define __pyx_n_u_setName __pyx_string_tab[6356]
#define __pyx_n_u_setNearNullSpace __pyx_string_tab[6357]
#define __pyx_n_u_setNestSubVecs __pyx_string_tab[6358]
#define __pyx_n_u_setNestVecType __pyx_string_tab[6359]
#define __pyx_n_u_setNewtonALCorrectionType __pyx_string_tab[6360]
#define __pyx_n_u_setNewtonALFunction __pyx_string_tab[6361]
#define __pyx_n_u_setNormSchedule __pyx_string_tab[6362]
#define __pyx_n_u_setNormType __pyx_string_tab[6363]
#define __pyx_n_u_setNullSpace __pyx_string_tab[6364]
#define __pyx_n_u_setNumComponents __pyx_string_tab[6365]
#define __pyx_n_u_setNumFields __pyx_string_tab[6366]
#define __pyx_n_u_setNumVariables __pyx_string_tab[6367]
#define __pyx_n_u_setObjective __pyx_string_tab[6368]
#define __pyx_n_u_setObjectiveGradient __pyx_string_tab[6369]
#define __pyx_n_u_setOffset __pyx_string_tab[6370]
#define __pyx_n_u_setOperators __pyx_string_tab[6371]
#define __pyx_n_u_setOption __pyx_string_tab[6372]
#define __pyx_n_u_setOptionsHandler __pyx_string_tab[6373]
#define __pyx_n_u_setOptionsPrefix __pyx_string_tab[6374]
#define __pyx_n_u_setOrder __pyx_string_tab[6375]
#define __pyx_n_u_setOwnershipRanges __pyx_string_tab[6376]
#define __pyx_n_u_setPC __pyx_string_tab[6377]
#define __pyx_n_u_setPCSide __pyx_string_tab[6378]
#define __pyx_n_u_setPTrimmedFormDegree __pyx_string_tab[6379]
#define __pyx_n_u_setParamsEW __pyx_string_tab[6380]
#define __pyx_n_u_setPartitioner __pyx_string_tab[6381]
#define __pyx_n_u_setPatchCellNumbering __pyx_string_tab[6382]
#define __pyx_n_u_setPatchComputeFunction __pyx_string_tab[6383]
#define __pyx_n_u_setPatchComputeFunctionInteriorF __pyx_string_tab[6384]
#define __pyx_n_u_setPatchComputeOperator __pyx_string_tab[6385]
#define __pyx_n_u_setPatchComputeOperatorInteriorF __pyx_string_tab[6386]
#define __pyx_n_u_setPatchConstructType __pyx_string_tab[6387]
#define __pyx_n_u_setPatchDiscretisationInfo __pyx_string_tab[6388]
#define __pyx_n_u_setPeriodicity __pyx_string_tab[6389]
#define __pyx_n_u_setPermutation __pyx_string_tab[6390]
#define __pyx_n_u_setPointCoordinates __pyx_string_tab[6391]
#define __pyx_n_u_setPointCoordinatesCellwise __pyx_string_tab[6392]
#define __pyx_n_u_setPointPoints __pyx_string_tab[6393]
#define __pyx_n_u_setPointSF __pyx_string_tab[6394]
#define __pyx_n_u_setPointsUniformCoordinates __pyx_string_tab[6395]
#define __pyx_n_u_setPolynomialTensor __pyx_string_tab[6396]
#define __pyx_n_u_setPostSolve __pyx_string_tab[6397]
#define __pyx_n_u_setPostStep __pyx_string_tab[6398]
#define __pyx_n_u_setPreSolve __pyx_string_tab[6399]
#define __pyx_n_u_setPreStep __pyx_string_tab[6400]
#define __pyx_n_u_setPreallocationCOO __pyx_string_tab[6401]
#define __pyx_n_u_setPreallocationCOOLocal __pyx_string_tab[6402]
#define __pyx_n_u_setPreallocationCSR __pyx_string_tab[6403]
#define __pyx_n_u_setPreallocationDense __pyx_string_tab[6404]
#define __pyx_n_u_setPreallocationNNZ __pyx_string_tab[6405]
#define __pyx_n_u_setProblemType __pyx_string_tab[6406]
#define __pyx_n_u_setProcSizes __pyx_string_tab[6407]
#define __pyx_n_u_setPythonContext __pyx_string_tab[6408]
#define __pyx_n_u_setPythonType __pyx_string_tab[6409]
#define __pyx_n_u_setQuadrature __pyx_string_tab[6410]
#define __pyx_n_u_setRHSFunction __pyx_string_tab[6411]
#define __pyx_n_u_setRHSJacobian __pyx_string_tab[6412]
#define __pyx_n_u_setRHSJacobianP __pyx_string_tab[6413]
#define __pyx_n_u_setRHSSplitIFunction __pyx_string_tab[6414]
#define __pyx_n_u_setRHSSplitIJacobian __pyx_string_tab[6415]
#define __pyx_n_u_setRHSSplitIS __pyx_string_tab[6416]
#define __pyx_n_u_setRHSSplitRHSFunction __pyx_string_tab[6417]
#define __pyx_n_u_setRKType __pyx_string_tab[6418]
#define __pyx_n_u_setRandom __pyx_string_tab[6419]
#define __pyx_n_u_setRankOrder __pyx_string_tab[6420]
#define __pyx_n_u_setRefine __pyx_string_tab[6421]
#define __pyx_n_u_setRefineLevel __pyx_string_tab[6422]
#define __pyx_n_u_setRefinementFactor __pyx_string_tab[6423]
#define __pyx_n_u_setRefinementLimit __pyx_string_tab[6424]
#define __pyx_n_u_setRefinementUniform __pyx_string_tab[6425]
#define __pyx_n_u_setRegularizerWeight __pyx_string_tab[6426]
#define __pyx_n_u_setResetCounters __pyx_string_tab[6427]
#define __pyx_n_u_setResidual __pyx_string_tab[6428]
#define __pyx_n_u_setResidualNorm __pyx_string_tab[6429]
#define __pyx_n_u_setReusePreconditioner __pyx_string_tab[6430]
#define __pyx_n_u_setSNESFunction __pyx_string_tab[6431]
#define __pyx_n_u_setSNESJacobian __pyx_string_tab[6432]
#define __pyx_n_u_setSPAIBlockSize __pyx_string_tab[6433]
#define __pyx_n_u_setSPAICacheSize __pyx_string_tab[6434]
#define __pyx_n_u_setSPAIEpsilon __pyx_string_tab[6435]
#define __pyx_n_u_setSPAIMax __pyx_string_tab[6436]
#define __pyx_n_u_setSPAIMaxNew __pyx_string_tab[6437]
#define __pyx_n_u_setSPAINBSteps __pyx_string_tab[6438]
#define __pyx_n_u_setSPAISp __pyx_string_tab[6439]
#define __pyx_n_u_setSPAIVerbose __pyx_string_tab[6440]
#define __pyx_n_u_setSaveTrajectory __pyx_string_tab[6441]
#define __pyx_n_u_setSection __pyx_string_tab[6442]
#define __pyx_n_u_setSectionSF __pyx_string_tab[6443]
#define __pyx_n_u_setSeed __pyx_string_tab[6444]
#define __pyx_n_u_setShellPartition __pyx_string_tab[6445]
#define __pyx_n_u_setSimpleDimension __pyx_string_tab[6446]
#define __pyx_n_u_setSimpleFunctional __pyx_string_tab[6447]
#define __pyx_n_u_setSizes __pyx_string_tab[6448]
#define __pyx_n_u_setSolution __pyx_string_tab[6449]
#define __pyx_n_u_setSolution2 __pyx_string_tab[6450]
#define __pyx_n_u_setSolutionTemplate __pyx_string_tab[6451]
#define __pyx_n_u_setSparseLocalize __pyx_string_tab[6452]
#define __pyx_n_u_setStateDesignIS __pyx_string_tab[6453]
#define __pyx_n_u_setStencil __pyx_string_tab[6454]
#define __pyx_n_u_setStencilType __pyx_string_tab[6455]
#define __pyx_n_u_setStencilWidth __pyx_string_tab[6456]
#define __pyx_n_u_setStepLimits __pyx_string_tab[6457]
#define __pyx_n_u_setStepNumber __pyx_string_tab[6458]
#define __pyx_n_u_setStratumIS __pyx_string_tab[6459]
#define __pyx_n_u_setStreamType __pyx_string_tab[6460]
#define __pyx_n_u_setStride __pyx_string_tab[6461]
#define __pyx_n_u_setSumConcatenate __pyx_string_tab[6462]
#define __pyx_n_u_setSumNumSubspaces __pyx_string_tab[6463]
#define __pyx_n_u_setSumSubspace __pyx_string_tab[6464]
#define __pyx_n_u_setSupport __pyx_string_tab[6465]
#define __pyx_n_u_setSupportSize __pyx_string_tab[6466]
#define __pyx_n_u_setTRTolerances __pyx_string_tab[6467]
#define __pyx_n_u_setTRUpdateParameters __pyx_string_tab[6468]
#define __pyx_n_u_setTabLevel __pyx_string_tab[6469]
#define __pyx_n_u_setTensorNumSubspaces __pyx_string_tab[6470]
#define __pyx_n_u_setTensorSubspace __pyx_string_tab[6471]
#define __pyx_n_u_setTetGenOptions __pyx_string_tab[6472]
#define __pyx_n_u_setTheta __pyx_string_tab[6473]
#define __pyx_n_u_setThetaEndpoint __pyx_string_tab[6474]
#define __pyx_n_u_setTileSizes __pyx_string_tab[6475]
#define __pyx_n_u_setTime __pyx_string_tab[6476]
#define __pyx_n_u_setTimeSpan __pyx_string_tab[6477]
#define __pyx_n_u_setTimeStep __pyx_string_tab[6478]
#define __pyx_n_u_setTimestep __pyx_string_tab[6479]
#define __pyx_n_u_setTolerances __pyx_string_tab[6480]
#define __pyx_n_u_setTransposeNullSpace __pyx_string_tab[6481]
#define __pyx_n_u_setTransposePrecursor __pyx_string_tab[6482]
#define __pyx_n_u_setTriangleOptions __pyx_string_tab[6483]
#define __pyx_n_u_setType __pyx_string_tab[6484]
#define __pyx_n_u_setUnfactored __pyx_string_tab[6485]
#define __pyx_n_u_setUniformCoordinates __pyx_string_tab[6486]
#define __pyx_n_u_setUniformCoordinatesExplicit __pyx_string_tab[6487]
#define __pyx_n_u_setUniformCoordinatesProduct __pyx_string_tab[6488]
#define __pyx_n_u_setUp __pyx_string_tab[6489]
#define __pyx_n_u_setUpMatrices __pyx_string_tab[6490]
#define __pyx_n_u_setUpOnBlocks __pyx_string_tab[6491]
#define __pyx_n_u_setUpdate __pyx_string_tab[6492]
#define __pyx_n_u_setUseAmat __pyx_string_tab[6493]
#define __pyx_n_u_setUseEW __pyx_string_tab[6494]
#define __pyx_n_u_setUseFD __pyx_string_tab[6495]
#define __pyx_n_u_setUseFischerGuess __pyx_string_tab[6496]
#define __pyx_n_u_setUseKSP __pyx_string_tab[6497]
#define __pyx_n_u_setUseMF __pyx_string_tab[6498]
#define __pyx_n_u_setUseNatural __pyx_string_tab[6499]
#define __pyx_n_u_setValue __pyx_string_tab[6500]
#define __pyx_n_u_setValueBlockedStagStencil __pyx_string_tab[6501]
#define __pyx_n_u_setValueBlockedStencil __pyx_string_tab[6502]
#define __pyx_n_u_setValueLocal __pyx_string_tab[6503]
#define __pyx_n_u_setValueStagStencil __pyx_string_tab[6504]
#define __pyx_n_u_setValueStencil __pyx_string_tab[6505]
#define __pyx_n_u_setValues __pyx_string_tab[6506]
#define __pyx_n_u_setValuesBlocked __pyx_string_tab[6507]
#define __pyx_n_u_setValuesBlockedCSR __pyx_string_tab[6508]
#define __pyx_n_u_setValuesBlockedIJV __pyx_string_tab[6509]
#define __pyx_n_u_setValuesBlockedLocal __pyx_string_tab[6510]
#define __pyx_n_u_setValuesBlockedLocalCSR __pyx_string_tab[6511]
#define __pyx_n_u_setValuesBlockedLocalIJV __pyx_string_tab[6512]
#define __pyx_n_u_setValuesBlockedLocalRCV __pyx_string_tab[6513]
#define __pyx_n_u_setValuesBlockedRCV __pyx_string_tab[6514]
#define __pyx_n_u_setValuesCOO __pyx_string_tab[6515]
#define __pyx_n_u_setValuesCSR __pyx_string_tab[6516]
#define __pyx_n_u_setValuesIJV __pyx_string_tab[6517]
#define __pyx_n_u_setValuesLocal __pyx_string_tab[6518]
#define __pyx_n_u_setValuesLocalCSR __pyx_string_tab[6519]
#define __pyx_n_u_setValuesLocalIJV __pyx_string_tab[6520]
#define __pyx_n_u_setValuesLocalRCV __pyx_string_tab[6521]
#define __pyx_n_u_setValuesRCV __pyx_string_tab[6522]
#define __pyx_n_u_setValuesStagStencil __pyx_string_tab[6523]
#define __pyx_n_u_setVariableBlockSizes __pyx_string_tab[6524]
#define __pyx_n_u_setVariableBounds __pyx_string_tab[6525]
#define __pyx_n_u_setVecClosure __pyx_string_tab[6526]
#define __pyx_n_u_setVecType __pyx_string_tab[6527]
#define __pyx_n_u_setVisible __pyx_string_tab[6528]
#define __pyx_n_u_set_name __pyx_string_tab[6529]
#define __pyx_n_u_setdefault __pyx_string_tab[6530]
#define __pyx_n_u_setstate __pyx_string_tab[6531]
#define __pyx_n_u_setstate_cython __pyx_string_tab[6532]
#define __pyx_n_u_setup __pyx_string_tab[6533]
#define __pyx_n_u_sf __pyx_string_tab[6534]
#define __pyx_n_u_sfMigration __pyx_string_tab[6535]
#define __pyx_n_u_sfNaturalOld __pyx_string_tab[6536]
#define __pyx_n_u_sf_type __pyx_string_tab[6537]
#define __pyx_n_u_sfxc __pyx_string_tab[6538]
#define __pyx_n_u_shape __pyx_string_tab[6539]
#define __pyx_n_u_shape_arr __pyx_string_tab[6540]
#define __pyx_n_u_shape_strides __pyx_string_tab[6541]
#define __pyx_n_u_shift __pyx_string_tab[6542]
#define __pyx_n_u_shift_type __pyx_string_tab[6543]
#define __pyx_n_u_shiftamount __pyx_string_tab[6544]
#define __pyx_n_u_shifttype __pyx_string_tab[6545]
#define __pyx_n_u_side __pyx_string_tab[6546]
#define __pyx_n_u_simplex __pyx_string_tab[6547]
#define __pyx_n_u_sis __pyx_string_tab[6548]
#define __pyx_n_u_size __pyx_string_tab[6549]
#define __pyx_n_u_sizes __pyx_string_tab[6550]
#define __pyx_n_u_skip __pyx_string_tab[6551]
#define __pyx_n_u_sleep __pyx_string_tab[6552]
#define __pyx_n_u_sloc __pyx_string_tab[6553]
#define __pyx_n_u_slot __pyx_string_tab[6554]
#define __pyx_n_u_smax __pyx_string_tab[6555]
#define __pyx_n_u_smin __pyx_string_tab[6556]
#define __pyx_n_u_smooth __pyx_string_tab[6557]
#define __pyx_n_u_smooths __pyx_string_tab[6558]
#define __pyx_n_u_snes __pyx_string_tab[6559]
#define __pyx_n_u_snes_type __pyx_string_tab[6560]
#define __pyx_n_u_snesls __pyx_string_tab[6561]
#define __pyx_n_u_sol __pyx_string_tab[6562]
#define __pyx_n_u_sollist __pyx_string_tab[6563]
#define __pyx_n_u_sols __pyx_string_tab[6564]
#define __pyx_n_u_solve __pyx_string_tab[6565]
#define __pyx_n_u_solveAdd __pyx_string_tab[6566]
#define __pyx_n_u_solveBackward __pyx_string_tab[6567]
#define __pyx_n_u_solveForward __pyx_string_tab[6568]
#define __pyx_n_u_solveStep __pyx_string_tab[6569]
#define __pyx_n_u_solveTranspose __pyx_string_tab[6570]
#define __pyx_n_u_solveTransposeAdd __pyx_string_tab[6571]
#define __pyx_n_u_solver __pyx_string_tab[6572]
#define __pyx_n_u_sort __pyx_string_tab[6573]
#define __pyx_n_u_sortGetAccess __pyx_string_tab[6574]
#define __pyx_n_u_sortGetIsValid __pyx_string_tab[6575]
#define __pyx_n_u_sortGetNumberOfPointsPerCell __pyx_string_tab[6576]
#define __pyx_n_u_sortGetPointsPerCell __pyx_string_tab[6577]
#define __pyx_n_u_sortGetSizes __pyx_string_tab[6578]
#define __pyx_n_u_sortRestoreAccess __pyx_string_tab[6579]
#define __pyx_n_u_sortype __pyx_string_tab[6580]
#define __pyx_n_u_sp __pyx_string_tab[6581]
#define __pyx_n_u_spNew __pyx_string_tab[6582]
#define __pyx_n_u_spaceDim __pyx_string_tab[6583]
#define __pyx_n_u_space_type __pyx_string_tab[6584]
#define __pyx_n_u_spacedim __pyx_string_tab[6585]
#define __pyx_n_u_sparseLocalize __pyx_string_tab[6586]
#define __pyx_n_u_split __pyx_string_tab[6587]
#define __pyx_n_u_splitOwnership __pyx_string_tab[6588]
#define __pyx_n_u_splitname __pyx_string_tab[6589]
#define __pyx_n_u_sqrtabs __pyx_string_tab[6590]
#define __pyx_n_u_ssize __pyx_string_tab[6591]
#define __pyx_n_u_stage __pyx_string_tab[6592]
#define __pyx_n_u_stageid __pyx_string_tab[6593]
#define __pyx_n_u_star __pyx_string_tab[6594]
#define __pyx_n_u_start __pyx_string_tab[6595]
#define __pyx_n_u_starts __pyx_string_tab[6596]
#define __pyx_n_u_startswith __pyx_string_tab[6597]
#define __pyx_n_u_state __pyx_string_tab[6598]
#define __pyx_n_u_stateGet __pyx_string_tab[6599]
#define __pyx_n_u_stateIncrease __pyx_string_tab[6600]
#define __pyx_n_u_stateSet __pyx_string_tab[6601]
#define __pyx_n_u_staticmethod __pyx_string_tab[6602]
#define __pyx_n_u_staticproperty __pyx_string_tab[6603]
#define __pyx_n_u_staticproperty___get __pyx_string_tab[6604]
#define __pyx_n_u_stderr __pyx_string_tab[6605]
#define __pyx_n_u_stderr_2 __pyx_string_tab[6606]
#define __pyx_n_u_stdout __pyx_string_tab[6607]
#define __pyx_n_u_stdout_2 __pyx_string_tab[6608]
#define __pyx_n_u_stdout_is_stderr __pyx_string_tab[6609]
#define __pyx_n_u_stencil_type __pyx_string_tab[6610]
#define __pyx_n_u_stencil_width __pyx_string_tab[6611]
#define __pyx_n_u_stenciltype __pyx_string_tab[6612]
#define __pyx_n_u_step __pyx_string_tab[6613]
#define __pyx_n_u_stepTranspose __pyx_string_tab[6614]
#define __pyx_n_u_step_number __pyx_string_tab[6615]
#define __pyx_n_u_steplen __pyx_string_tab[6616]
#define __pyx_n_u_stol __pyx_string_tab[6617]
#define __pyx_n_u_stop __pyx_string_tab[6618]
#define __pyx_n_u_storeValues __pyx_string_tab[6619]
#define __pyx_n_u_str __pyx_string_tab[6620]
#define __pyx_n_u_str_2 __pyx_string_tab[6621]
#define __pyx_n_u_strata __pyx_string_tab[6622]
#define __pyx_n_u_stratify __pyx_string_tab[6623]
#define __pyx_n_u_stratum __pyx_string_tab[6624]
#define __pyx_n_u_stratumHasPoint __pyx_string_tab[6625]
#define __pyx_n_u_stream __pyx_string_tab[6626]
#define __pyx_n_u_stream_type __pyx_string_tab[6627]
#define __pyx_n_u_strideGather __pyx_string_tab[6628]
#define __pyx_n_u_strideMax __pyx_string_tab[6629]
#define __pyx_n_u_strideMin __pyx_string_tab[6630]
#define __pyx_n_u_strideNorm __pyx_string_tab[6631]
#define __pyx_n_u_strideScale __pyx_string_tab[6632]
#define __pyx_n_u_strideScatter __pyx_string_tab[6633]
#define __pyx_n_u_strideSum __pyx_string_tab[6634]
#define __pyx_n_u_strides __pyx_string_tab[6635]
#define __pyx_n_u_strides_arr __pyx_string_tab[6636]
#define __pyx_n_u_string __pyx_string_tab[6637]
#define __pyx_n_u_strip __pyx_string_tab[6638]
#define __pyx_n_u_struct __pyx_string_tab[6639]
#define __pyx_n_u_structure __pyx_string_tab[6640]
#define __pyx_n_u_stype __pyx_string_tab[6641]
#define __pyx_n_u_sub __pyx_string_tab[6642]
#define __pyx_n_u_subcomm __pyx_string_tab[6643]
#define __pyx_n_u_subcomm_2 __pyx_string_tab[6644]
#define __pyx_n_u_subctxs __pyx_string_tab[6645]
#define __pyx_n_u_subdm __pyx_string_tab[6646]
#define __pyx_n_u_subksp __pyx_string_tab[6647]
#define __pyx_n_u_submat __pyx_string_tab[6648]
#define __pyx_n_u_submats __pyx_string_tab[6649]
#define __pyx_n_u_subminor __pyx_string_tab[6650]
#define __pyx_n_u_subsolver __pyx_string_tab[6651]
#define __pyx_n_u_subsp __pyx_string_tab[6652]
#define __pyx_n_u_subspaceOffsets __pyx_string_tab[6653]
#define __pyx_n_u_subtractASCIITab __pyx_string_tab[6654]
#define __pyx_n_u_subvec __pyx_string_tab[6655]
#define __pyx_n_u_sum __pyx_string_tab[6656]
#define __pyx_n_u_supp __pyx_string_tab[6657]
#define __pyx_n_u_sval __pyx_string_tab[6658]
#define __pyx_n_u_sval1 __pyx_string_tab[6659]
#define __pyx_n_u_sval2 __pyx_string_tab[6660]
#define __pyx_n_u_svals __pyx_string_tab[6661]
#define __pyx_n_u_svalue __pyx_string_tab[6662]
#define __pyx_n_u_sw __pyx_string_tab[6663]
#define __pyx_n_u_swap __pyx_string_tab[6664]
#define __pyx_n_u_swidth __pyx_string_tab[6665]
#define __pyx_n_u_sx __pyx_string_tab[6666]
#define __pyx_n_u_sym __pyx_string_tab[6667]
#define __pyx_n_u_symm __pyx_string_tab[6668]
#define __pyx_n_u_symmetric __pyx_string_tab[6669]
#define __pyx_n_u_symmetrize __pyx_string_tab[6670]
#define __pyx_n_u_syncFlush __pyx_string_tab[6671]
#define __pyx_n_u_syncPrint __pyx_string_tab[6672]
#define __pyx_n_u_synchronize __pyx_string_tab[6673]
#define __pyx_n_u_sys __pyx_string_tab[6674]
#define __pyx_n_u_t __pyx_string_tab[6675]
#define __pyx_n_u_t1 __pyx_string_tab[6676]
#define __pyx_n_u_t2 __pyx_string_tab[6677]
#define __pyx_n_u_tDot __pyx_string_tab[6678]
#define __pyx_n_u_tDotBegin __pyx_string_tab[6679]
#define __pyx_n_u_tDotEnd __pyx_string_tab[6680]
#define __pyx_n_u_tab __pyx_string_tab[6681]
#define __pyx_n_u_tabs __pyx_string_tab[6682]
#define __pyx_n_u_tao __pyx_string_tab[6683]
#define __pyx_n_u_tao_almm_type __pyx_string_tab[6684]
#define __pyx_n_u_tao_type __pyx_string_tab[6685]
#define __pyx_n_u_targetComplexity __pyx_string_tab[6686]
#define __pyx_n_u_targs __pyx_string_tab[6687]
#define __pyx_n_u_tbline __pyx_string_tab[6688]
#define __pyx_n_u_tblist __pyx_string_tab[6689]
#define __pyx_n_u_tcmp __pyx_string_tab[6690]
#define __pyx_n_u_tdim __pyx_string_tab[6691]
#define __pyx_n_u_temp __pyx_string_tab[6692]
#define __pyx_n_u_tensor __pyx_string_tab[6693]
#define __pyx_n_u_term __pyx_string_tab[6694]
#define __pyx_n_u_term_type __pyx_string_tab[6695]
#define __pyx_n_u_terminate __pyx_string_tab[6696]
#define __pyx_n_u_test __pyx_string_tab[6697]
#define __pyx_n_u_theta __pyx_string_tab[6698]
#define __pyx_n_u_threshold __pyx_string_tab[6699]
#define __pyx_n_u_time __pyx_string_tab[6700]
#define __pyx_n_u_time_step __pyx_string_tab[6701]
#define __pyx_n_u_timestep __pyx_string_tab[6702]
#define __pyx_n_u_title __pyx_string_tab[6703]
#define __pyx_n_u_toAll __pyx_string_tab[6704]
#define __pyx_n_u_toDLPack __pyx_string_tab[6705]
#define __pyx_n_u_toGeneral __pyx_string_tab[6706]
#define __pyx_n_u_toZero __pyx_string_tab[6707]
#define __pyx_n_u_toindx __pyx_string_tab[6708]
#define __pyx_n_u_tol __pyx_string_tab[6709]
#define __pyx_n_u_tol_2 __pyx_string_tab[6710]
#define __pyx_n_u_tolist __pyx_string_tab[6711]
#define __pyx_n_u_tolr __pyx_string_tab[6712]
#define __pyx_n_u_tompi4py __pyx_string_tab[6713]
#define __pyx_n_u_topologyLoad __pyx_string_tab[6714]
#define __pyx_n_u_topologyView __pyx_string_tab[6715]
#define __pyx_n_u_tr_type __pyx_string_tab[6716]
#define __pyx_n_u_traceback __pyx_string_tab[6717]
#define __pyx_n_u_traceback_2 __pyx_string_tab[6718]
#define __pyx_n_u_trans __pyx_string_tab[6719]
#define __pyx_n_u_transpose __pyx_string_tab[6720]
#define __pyx_n_u_transposeMatMult __pyx_string_tab[6721]
#define __pyx_n_u_trimmed __pyx_string_tab[6722]
#define __pyx_n_u_ts __pyx_string_tab[6723]
#define __pyx_n_u_ts_type __pyx_string_tab[6724]
#define __pyx_n_u_tsadapt __pyx_string_tab[6725]
#define __pyx_n_u_tspan __pyx_string_tab[6726]
#define __pyx_n_u_tstep __pyx_string_tab[6727]
#define __pyx_n_u_tval __pyx_string_tab[6728]
#define __pyx_n_u_twist __pyx_string_tab[6729]
#define __pyx_n_u_typ __pyx_string_tab[6730]
#define __pyx_n_u_type_registry __pyx_string_tab[6731]
#define __pyx_n_u_typenum __pyx_string_tab[6732]
#define __pyx_n_u_typestr __pyx_string_tab[6733]
#define __pyx_n_u_u __pyx_string_tab[6734]
#define __pyx_n_u_uC __pyx_string_tab[6735]
#define __pyx_n_u_uCl __pyx_string_tab[6736]
#define __pyx_n_u_uN __pyx_string_tab[6737]
#define __pyx_n_u_ua __pyx_string_tab[6738]
#define __pyx_n_u_uaux __pyx_string_tab[6739]
#define __pyx_n_u_uis __pyx_string_tab[6740]
#define __pyx_n_u_uniform __pyx_string_tab[6741]
#define __pyx_n_u_uninterpolate __pyx_string_tab[6742]
#define __pyx_n_u_union __pyx_string_tab[6743]
#define __pyx_n_u_unit __pyx_string_tab[6744]
#define __pyx_n_u_unnamed __pyx_string_tab[6745]
#define __pyx_n_u_unpack __pyx_string_tab[6746]
#define __pyx_n_u_unused __pyx_string_tab[6747]
#define __pyx_n_u_unused1 __pyx_string_tab[6748]
#define __pyx_n_u_unused2 __pyx_string_tab[6749]
#define __pyx_n_u_unused3 __pyx_string_tab[6750]
#define __pyx_n_u_unuseda __pyx_string_tab[6751]
#define __pyx_n_u_unusedb __pyx_string_tab[6752]
#define __pyx_n_u_unusedc __pyx_string_tab[6753]
#define __pyx_n_u_unusedr __pyx_string_tab[6754]
#define __pyx_n_u_up __pyx_string_tab[6755]
#define __pyx_n_u_up_left __pyx_string_tab[6756]
#define __pyx_n_u_up_right __pyx_string_tab[6757]
#define __pyx_n_u_update __pyx_string_tab[6758]
#define __pyx_n_u_updateLMVM __pyx_string_tab[6759]
#define __pyx_n_u_upper __pyx_string_tab[6760]
#define __pyx_n_u_use __pyx_string_tab[6761]
#define __pyx_n_u_useASCIITabs __pyx_string_tab[6762]
#define __pyx_n_u_useAnchors __pyx_string_tab[6763]
#define __pyx_n_u_useClosure __pyx_string_tab[6764]
#define __pyx_n_u_useCone __pyx_string_tab[6765]
#define __pyx_n_u_useInitialGuess __pyx_string_tab[6766]
#define __pyx_n_u_useNatural __pyx_string_tab[6767]
#define __pyx_n_u_useTAORoutine __pyx_string_tab[6768]
#define __pyx_n_u_use_2 __pyx_string_tab[6769]
#define __pyx_n_u_used __pyx_string_tab[6770]
#define __pyx_n_u_useksp __pyx_string_tab[6771]
#define __pyx_n_u_uvec __pyx_string_tab[6772]
#define __pyx_n_u_v __pyx_string_tab[6773]
#define __pyx_n_u_val __pyx_string_tab[6774]
#define __pyx_n_u_val_2 __pyx_string_tab[6775]
#define __pyx_n_u_vals __pyx_string_tab[6776]
#define __pyx_n_u_value __pyx_string_tab[6777]
#define __pyx_n_u_values __pyx_string_tab[6778]
#define __pyx_n_u_varbounds __pyx_string_tab[6779]
#define __pyx_n_u_vatol __pyx_string_tab[6780]
#define __pyx_n_u_vclvec __pyx_string_tab[6781]
#define __pyx_n_u_vec __pyx_string_tab[6782]
#define __pyx_n_u_vecGetClosure __pyx_string_tab[6783]
#define __pyx_n_u_vecTo __pyx_string_tab[6784]
#define __pyx_n_u_vec_from __pyx_string_tab[6785]
#define __pyx_n_u_vec_index_ises __pyx_string_tab[6786]
#define __pyx_n_u_vec_to __pyx_string_tab[6787]
#define __pyx_n_u_vec_type __pyx_string_tab[6788]
#define __pyx_n_u_vecl __pyx_string_tab[6789]
#define __pyx_n_u_vecm __pyx_string_tab[6790]
#define __pyx_n_u_vecr __pyx_string_tab[6791]
#define __pyx_n_u_vecs __pyx_string_tab[6792]
#define __pyx_n_u_vecsl __pyx_string_tab[6793]
#define __pyx_n_u_vecsr __pyx_string_tab[6794]
#define __pyx_n_u_vectorDefineField __pyx_string_tab[6795]
#define __pyx_n_u_vectors __pyx_string_tab[6796]
#define __pyx_n_u_verbosity __pyx_string_tab[6797]
#define __pyx_n_u_version __pyx_string_tab[6798]
#define __pyx_n_u_vertexCoords __pyx_string_tab[6799]
#define __pyx_n_u_vg __pyx_string_tab[6800]
#define __pyx_n_u_viennaclvechandle __pyx_string_tab[6801]
#define __pyx_n_u_view __pyx_string_tab[6802]
#define __pyx_n_u_viewFieldsXDMF __pyx_string_tab[6803]
#define __pyx_n_u_viewFromOptions __pyx_string_tab[6804]
#define __pyx_n_u_viewObject __pyx_string_tab[6805]
#define __pyx_n_u_viewObjectPython __pyx_string_tab[6806]
#define __pyx_n_u_viewXDMF __pyx_string_tab[6807]
#define __pyx_n_u_viewer __pyx_string_tab[6808]
#define __pyx_n_u_vl __pyx_string_tab[6809]
#define __pyx_n_u_vlg __pyx_string_tab[6810]
#define __pyx_n_u_vm __pyx_string_tab[6811]
#define __pyx_n_u_vmat __pyx_string_tab[6812]
#define __pyx_n_u_vn __pyx_string_tab[6813]
#define __pyx_n_u_vol __pyx_string_tab[6814]
#define __pyx_n_u_vr __pyx_string_tab[6815]
#define __pyx_n_u_vrtol __pyx_string_tab[6816]
#define __pyx_n_u_vstr __pyx_string_tab[6817]
#define __pyx_n_u_vtol __pyx_string_tab[6818]
#define __pyx_n_u_vtolr __pyx_string_tab[6819]
#define __pyx_n_u_vtype __pyx_string_tab[6820]
#define __pyx_n_u_vwr __pyx_string_tab[6821]
#define __pyx_n_u_vwr_type __pyx_string_tab[6822]
#define __pyx_n_u_w __pyx_string_tab[6823]
#define __pyx_n_u_waitFor __pyx_string_tab[6824]
#define __pyx_n_u_waxpy __pyx_string_tab[6825]
#define __pyx_n_u_wctime __pyx_string_tab[6826]
#define __pyx_n_u_weight __pyx_string_tab[6827]
#define __pyx_n_u_width __pyx_string_tab[6828]
#define __pyx_n_u_wrapped_func __pyx_string_tab[6829]
#define __pyx_n_u_wraps __pyx_string_tab[6830]
#define __pyx_n_u_write __pyx_string_tab[6831]
#define __pyx_n_u_x __pyx_string_tab[6832]
#define __pyx_n_u_x_vec __pyx_string_tab[6833]
#define __pyx_n_u_xdiff __pyx_string_tab[6834]
#define __pyx_n_u_xdot __pyx_string_tab[6835]
#define __pyx_n_u_xdotdot __pyx_string_tab[6836]
#define __pyx_n_u_xl __pyx_string_tab[6837]
#define __pyx_n_u_xmax __pyx_string_tab[6838]
#define __pyx_n_u_xmax_2 __pyx_string_tab[6839]
#define __pyx_n_u_xmin __pyx_string_tab[6840]
#define __pyx_n_u_xmin_2 __pyx_string_tab[6841]
#define __pyx_n_u_xnorm __pyx_string_tab[6842]
#define __pyx_n_u_xs __pyx_string_tab[6843]
#define __pyx_n_u_xt __pyx_string_tab[6844]
#define __pyx_n_u_xu __pyx_string_tab[6845]
#define __pyx_n_u_xvec __pyx_string_tab[6846]
#define __pyx_n_u_xyz __pyx_string_tab[6847]
#define __pyx_n_u_y __pyx_string_tab[6848]
#define __pyx_n_u_ymax __pyx_string_tab[6849]
#define __pyx_n_u_ymax_2 __pyx_string_tab[6850]
#define __pyx_n_u_ymin __pyx_string_tab[6851]
#define __pyx_n_u_ymin_2 __pyx_string_tab[6852]
#define __pyx_n_u_ynorm __pyx_string_tab[6853]
#define __pyx_n_u_z __pyx_string_tab[6854]
#define __pyx_n_u_zeroEntries __pyx_string_tab[6855]
#define __pyx_n_u_zeroRows __pyx_string_tab[6856]
#define __pyx_n_u_zeroRowsColumns __pyx_string_tab[6857]
#define __pyx_n_u_zeroRowsColumnsLocal __pyx_string_tab[6858]
#define __pyx_n_u_zeroRowsColumnsStencil __pyx_string_tab[6859]
#define __pyx_n_u_zeroRowsLocal __pyx_string_tab[6860]
#define __pyx_n_u_zeropivot __pyx_string_tab[6861]
#define __pyx_n_u_zerorows __pyx_string_tab[6862]
#define __pyx_n_u_zmax __pyx_string_tab[6863]
#define __pyx_n_u_zmax_2 __pyx_string_tab[6864]
#define __pyx_n_u_zmin __pyx_string_tab[6865]
#define __pyx_n_u_zmin_2 __pyx_string_tab[6866]
#define __pyx_n_u_zoz __pyx_string_tab[6867]
#define __pyx_n_u_zzo __pyx_string_tab[6868]
#define __pyx_n_u_zzo_vec __pyx_string_tab[6869]
#define __pyx_kp_b_AO_PyObject_DM_PyObject_DMLabel __pyx_string_tab[6870]
#define __pyx_kp_b_T __pyx_string_tab[6871]
#define __pyx_kp_b__13 __pyx_string_tab[6872]
#define __pyx_kp_b__6 __pyx_string_tab[6873]
#define __pyx_kp_b__7 __pyx_string_tab[6874]
#define __pyx_kp_b__8 __pyx_string_tab[6875]
#define __pyx_kp_b__9 __pyx_string_tab[6876]
#define __pyx_kp_b_iso88591_00C1_a_Qd_q_a_1D_QgQgQa_z_wgQ __pyx_string_tab[6877]
#define __pyx_kp_b_iso88591_00Fa_0_B_1_a_q_E __pyx_string_tab[6878]
#define __pyx_kp_b_iso88591_00LA_41_a_1D_Q __pyx_string_tab[6879]
#define __pyx_kp_b_iso88591_00_3az_a_XQgQe6_G9A_QfG4q_A_hau __pyx_string_tab[6880]
#define __pyx_kp_b_iso88591_0_1_1_a_aq_a_AT_k_Naq_7_a_AT_k __pyx_string_tab[6881]
#define __pyx_kp_b_iso88591_0_E_a_at81 __pyx_string_tab[6882]
#define __pyx_kp_b_iso88591_0_Q_a_q_F_1_az_Q __pyx_string_tab[6883]
#define __pyx_kp_b_iso88591_0_U_1_a_at5 __pyx_string_tab[6884]
#define __pyx_kp_b_iso88591_0_V1A_a_2_4_1 __pyx_string_tab[6885]
#define __pyx_kp_b_iso88591_0_V3c_F_Q __pyx_string_tab[6886]
#define __pyx_kp_b_iso88591_0_a_4uF __pyx_string_tab[6887]
#define __pyx_kp_b_iso88591_0_a_AT_fA __pyx_string_tab[6888]
#define __pyx_kp_b_iso88591_0_a_U_1 __pyx_string_tab[6889]
#define __pyx_kp_b_iso88591_0_a_at5_1 __pyx_string_tab[6890]
#define __pyx_kp_b_iso88591_0_a_fAQ __pyx_string_tab[6891]
#define __pyx_kp_b_iso88591_0_a_q_F_Q __pyx_string_tab[6892]
#define __pyx_kp_b_iso88591_0_fAQ_a_q_E __pyx_string_tab[6893]
#define __pyx_kp_b_iso88591_0_fA_U_1_a_fCq_G1 __pyx_string_tab[6894]
#define __pyx_kp_b_iso88591_0_q_a_q_6_az_hd_q __pyx_string_tab[6895]
#define __pyx_kp_b_iso88591_0q_a_4waq_q __pyx_string_tab[6896]
#define __pyx_kp_b_iso88591_1 __pyx_string_tab[6897]
#define __pyx_kp_b_iso88591_11A_3az_a_XQgQe6_G9A_QfG4q_A_ha __pyx_string_tab[6898]
#define __pyx_kp_b_iso88591_11B_1_1_a_6_iuA_7_V9Cq_6_c_xq_a __pyx_string_tab[6899]
#define __pyx_kp_b_iso88591_11C_fTZZ_Qe5_e1E_q_WAU_q_vQfAU __pyx_string_tab[6900]
#define __pyx_kp_b_iso88591_11EQ __pyx_string_tab[6901]
#define __pyx_kp_b_iso88591_11LHTU_6Q_E_a_Qd_A __pyx_string_tab[6902]
#define __pyx_kp_b_iso88591_12_IYiq_a_a_1D_aq_V1G1G1A_Q_QfF __pyx_string_tab[6903]
#define __pyx_kp_b_iso88591_1A __pyx_string_tab[6904]
#define __pyx_kp_b_iso88591_1IQa_a_1D_Q __pyx_string_tab[6905]
#define __pyx_kp_b_iso88591_1L_1_1_1 __pyx_string_tab[6906]
#define __pyx_kp_b_iso88591_1_1A_a_e1 __pyx_string_tab[6907]
#define __pyx_kp_b_iso88591_1_1IQa_Q_ay_U_T_1F_q __pyx_string_tab[6908]
#define __pyx_kp_b_iso88591_1_1IQa_ay_U __pyx_string_tab[6909]
#define __pyx_kp_b_iso88591_1_1IQa_ay_WA __pyx_string_tab[6910]
#define __pyx_kp_b_iso88591_1_1_2WF_awat5 __pyx_string_tab[6911]
#define __pyx_kp_b_iso88591_1_1_7_vS_ha_vS_ha_xvQ_WA_WA __pyx_string_tab[6912]
#define __pyx_kp_b_iso88591_1_1_V4q_AT_t1 __pyx_string_tab[6913]
#define __pyx_kp_b_iso88591_1_1_a_4uA __pyx_string_tab[6914]
#define __pyx_kp_b_iso88591_1_1_a_Qd_q __pyx_string_tab[6915]
#define __pyx_kp_b_iso88591_1_1_a_at5_vQa __pyx_string_tab[6916]
#define __pyx_kp_b_iso88591_1_1_a_q_Jay_uAZuAQ __pyx_string_tab[6917]
#define __pyx_kp_b_iso88591_1_1_az_e1A_WA_M_Qd_q_4uAU_5_was __pyx_string_tab[6918]
#define __pyx_kp_b_iso88591_1_2 __pyx_string_tab[6919]
#define __pyx_kp_b_iso88591_1_2S_d_Q_1E_A_9AT_q_q_q_a_q_G6 __pyx_string_tab[6920]
#define __pyx_kp_b_iso88591_1_2S_d_Q_1E_A_fAQa_q_q_a_q_F_6 __pyx_string_tab[6921]
#define __pyx_kp_b_iso88591_1_2WA_fAQ_axq_A __pyx_string_tab[6922]
#define __pyx_kp_b_iso88591_1_2_a_at5_q __pyx_string_tab[6923]
#define __pyx_kp_b_iso88591_1_3 __pyx_string_tab[6924]
#define __pyx_kp_b_iso88591_1_3_XXaab_Q_2WF_Q_2WF_5_6_6_F_V __pyx_string_tab[6925]
#define __pyx_kp_b_iso88591_1_4q_a_AT_q_a_6_q __pyx_string_tab[6926]
#define __pyx_kp_b_iso88591_1_4s_4vQ_q_Q_4wit1_IT_c_IT_Qd_a __pyx_string_tab[6927]
#define __pyx_kp_b_iso88591_1_4s_a_3e3d_A_S_A_A_a_1D_gQc_q __pyx_string_tab[6928]
#define __pyx_kp_b_iso88591_1_4s_a_3e3d_A_S_A_A_a_AT_was_q __pyx_string_tab[6929]
#define __pyx_kp_b_iso88591_1_4vS_AQ_a_gQiq_Qe1_IQ_IQ_HD_q __pyx_string_tab[6930]
#define __pyx_kp_b_iso88591_1_7_a_Zr_as_q __pyx_string_tab[6931]
#define __pyx_kp_b_iso88591_1_7_a_q_Jas_q __pyx_string_tab[6932]
#define __pyx_kp_b_iso88591_1_7_z_q_a_fA __pyx_string_tab[6933]
#define __pyx_kp_b_iso88591_1_7_z_q_a_l __pyx_string_tab[6934]
#define __pyx_kp_b_iso88591_1_7_z_q_avQd __pyx_string_tab[6935]
#define __pyx_kp_b_iso88591_1_7_z_q_avQd_q __pyx_string_tab[6936]
#define __pyx_kp_b_iso88591_1_7_z_q_avQd_q_2 __pyx_string_tab[6937]
#define __pyx_kp_b_iso88591_1_7_z_q_axq_G1 __pyx_string_tab[6938]
#define __pyx_kp_b_iso88591_1_81A_a_Qd __pyx_string_tab[6939]
#define __pyx_kp_b_iso88591_1_9HA_a_Qd_a_at7_7_1_QgU_85 __pyx_string_tab[6940]
#define __pyx_kp_b_iso88591_1_A_A_Q_a_WCs_S_uAQ __pyx_string_tab[6941]
#define __pyx_kp_b_iso88591_1_A_a_1D_fAV6_vQ_vQa __pyx_string_tab[6942]
#define __pyx_kp_b_iso88591_1_D_a_q_G1G1_q __pyx_string_tab[6943]
#define __pyx_kp_b_iso88591_1_F_1_9AV1A_AT_gU __pyx_string_tab[6944]
#define __pyx_kp_b_iso88591_1_F_1_a_Qd_q __pyx_string_tab[6945]
#define __pyx_kp_b_iso88591_1_IQk_a_a_U_az_hd_uAQ __pyx_string_tab[6946]
#define __pyx_kp_b_iso88591_1_Jbbkkl_Q_2WF_Q_2WF_5_6_6_F_a __pyx_string_tab[6947]
#define __pyx_kp_b_iso88591_1_Q_Q_a_4uAT_vQe6 __pyx_string_tab[6948]
#define __pyx_kp_b_iso88591_1_Q_Q_a_l_1_a_at_q_wauBc __pyx_string_tab[6949]
#define __pyx_kp_b_iso88591_1_Q_a_4AT_q_uAQ __pyx_string_tab[6950]
#define __pyx_kp_b_iso88591_1_Q_a_4xq_uAZuAQ __pyx_string_tab[6951]
#define __pyx_kp_b_iso88591_1_Q_a_4xq_vQa __pyx_string_tab[6952]
#define __pyx_kp_b_iso88591_1_Q_a_AT_uAQ __pyx_string_tab[6953]
#define __pyx_kp_b_iso88591_1_Q_a_Qd_q_a_4AT_aq_1IQd_4t7_1 __pyx_string_tab[6954]
#define __pyx_kp_b_iso88591_1_Q_a_q_E_Zq_a_a_2Q_q __pyx_string_tab[6955]
#define __pyx_kp_b_iso88591_1_Q_a_q_E_a_a_4q_q __pyx_string_tab[6956]
#define __pyx_kp_b_iso88591_1_Qa __pyx_string_tab[6957]
#define __pyx_kp_b_iso88591_1_Qm1A_2WF_a_V1F __pyx_string_tab[6958]
#define __pyx_kp_b_iso88591_1_RR_pp_H_H_I_6_U_1_6_a_4uNBTT __pyx_string_tab[6959]
#define __pyx_kp_b_iso88591_1_RRccllm_1_81A_Q_7_t6_7_t6_aq __pyx_string_tab[6960]
#define __pyx_kp_b_iso88591_1_S_a_1D_aq_a_1A_q __pyx_string_tab[6961]
#define __pyx_kp_b_iso88591_1_U_1_a_q_F __pyx_string_tab[6962]
#define __pyx_kp_b_iso88591_1_Ya_1A_a_XQ_q __pyx_string_tab[6963]
#define __pyx_kp_b_iso88591_1_Ybbc_xq_a_q_uAQ_a_q_whaq_az_h __pyx_string_tab[6964]
#define __pyx_kp_b_iso88591_1_Zq_a_wha_1A __pyx_string_tab[6965]
#define __pyx_kp_b_iso88591_1_a __pyx_string_tab[6966]
#define __pyx_kp_b_iso88591_1_a_1D __pyx_string_tab[6967]
#define __pyx_kp_b_iso88591_1_a_1D_2 __pyx_string_tab[6968]
#define __pyx_kp_b_iso88591_1_a_1D_Qa __pyx_string_tab[6969]
#define __pyx_kp_b_iso88591_1_a_1D_Qd_a_4q_q __pyx_string_tab[6970]
#define __pyx_kp_b_iso88591_1_a_1D_Rq __pyx_string_tab[6971]
#define __pyx_kp_b_iso88591_1_a_1D_aq_q __pyx_string_tab[6972]
#define __pyx_kp_b_iso88591_1_a_1D_aq_q_2 __pyx_string_tab[6973]
#define __pyx_kp_b_iso88591_1_a_1D_auAQ_QfE __pyx_string_tab[6974]
#define __pyx_kp_b_iso88591_1_a_1D_avQa __pyx_string_tab[6975]
#define __pyx_kp_b_iso88591_1_a_1D_q_aq_vQa __pyx_string_tab[6976]
#define __pyx_kp_b_iso88591_1_a_2Q_6_A_AT_gQb_q_E_A __pyx_string_tab[6977]
#define __pyx_kp_b_iso88591_1_a_4q __pyx_string_tab[6978]
#define __pyx_kp_b_iso88591_1_a_4q_q __pyx_string_tab[6979]
#define __pyx_kp_b_iso88591_1_a_4uA __pyx_string_tab[6980]
#define __pyx_kp_b_iso88591_1_a_4uAQ_q __pyx_string_tab[6981]
#define __pyx_kp_b_iso88591_1_a_4uAQ_uAQ __pyx_string_tab[6982]
#define __pyx_kp_b_iso88591_1_a_4uAQ_y __pyx_string_tab[6983]
#define __pyx_kp_b_iso88591_1_a_4uAV1A __pyx_string_tab[6984]
#define __pyx_kp_b_iso88591_1_a_4vQfAQ_vQa __pyx_string_tab[6985]
#define __pyx_kp_b_iso88591_1_a_4vS __pyx_string_tab[6986]
#define __pyx_kp_b_iso88591_1_a_4vS_aq __pyx_string_tab[6987]
#define __pyx_kp_b_iso88591_1_a_4waq __pyx_string_tab[6988]
#define __pyx_kp_b_iso88591_1_a_AT __pyx_string_tab[6989]
#define __pyx_kp_b_iso88591_1_a_AT_q_F_q __pyx_string_tab[6990]
#define __pyx_kp_b_iso88591_1_a_A_d_q __pyx_string_tab[6991]
#define __pyx_kp_b_iso88591_1_a_Q_a_4uAQ_a_q_E_wavQ __pyx_string_tab[6992]
#define __pyx_kp_b_iso88591_1_a_Q_q_az_hd_q __pyx_string_tab[6993]
#define __pyx_kp_b_iso88591_1_a_Qd __pyx_string_tab[6994]
#define __pyx_kp_b_iso88591_1_a_Qd_q_uAQ __pyx_string_tab[6995]
#define __pyx_kp_b_iso88591_1_a_Qd_y __pyx_string_tab[6996]
#define __pyx_kp_b_iso88591_1_a_U_4q_a_4q_q __pyx_string_tab[6997]
#define __pyx_kp_b_iso88591_1_a_WAWAWAQ_axvQhfAQ __pyx_string_tab[6998]
#define __pyx_kp_b_iso88591_1_a_XQa_y __pyx_string_tab[6999]
#define __pyx_kp_b_iso88591_1_a_a __pyx_string_tab[7000]
#define __pyx_kp_b_iso88591_1_a_a_1D_Q __pyx_string_tab[7001]
#define __pyx_kp_b_iso88591_1_a_a_1D_aq_vQa __pyx_string_tab[7002]
#define __pyx_kp_b_iso88591_1_a_a_1D_haq_vQa __pyx_string_tab[7003]
#define __pyx_kp_b_iso88591_1_a_a_2_4_1 __pyx_string_tab[7004]
#define __pyx_kp_b_iso88591_1_a_a_4uAQ_vQa __pyx_string_tab[7005]
#define __pyx_kp_b_iso88591_1_a_a_4vS_avQa_xq_vQa __pyx_string_tab[7006]
#define __pyx_kp_b_iso88591_1_a_a_AT_vQa __pyx_string_tab[7007]
#define __pyx_kp_b_iso88591_1_a_a_Qd_Qa_1_G9A_1AQa_q __pyx_string_tab[7008]
#define __pyx_kp_b_iso88591_1_a_a_Qd_q_vQa __pyx_string_tab[7009]
#define __pyx_kp_b_iso88591_1_a_a_V1A_V1_q __pyx_string_tab[7010]
#define __pyx_kp_b_iso88591_1_a_a_at5_vQa __pyx_string_tab[7011]
#define __pyx_kp_b_iso88591_1_a_at5_vQa __pyx_string_tab[7012]
#define __pyx_kp_b_iso88591_1_a_at5_vQa_2 __pyx_string_tab[7013]
#define __pyx_kp_b_iso88591_1_a_at_q_vQa __pyx_string_tab[7014]
#define __pyx_kp_b_iso88591_1_a_e1CvQa_q_q_d __pyx_string_tab[7015]
#define __pyx_kp_b_iso88591_1_a_e81 __pyx_string_tab[7016]
#define __pyx_kp_b_iso88591_1_a_q_A __pyx_string_tab[7017]
#define __pyx_kp_b_iso88591_1_a_q_A_2 __pyx_string_tab[7018]
#define __pyx_kp_b_iso88591_1_a_q_E_Qa_q_q_d __pyx_string_tab[7019]
#define __pyx_kp_b_iso88591_1_a_q_E_q __pyx_string_tab[7020]
#define __pyx_kp_b_iso88591_1_a_q_HD __pyx_string_tab[7021]
#define __pyx_kp_b_iso88591_1_a_q_L __pyx_string_tab[7022]
#define __pyx_kp_b_iso88591_1_a_q_a_q_E_axq_a_5_1_awat1D_G9 __pyx_string_tab[7023]
#define __pyx_kp_b_iso88591_1_aq_a_q_F __pyx_string_tab[7024]
#define __pyx_kp_b_iso88591_1_auA_a_4wat1_q __pyx_string_tab[7025]
#define __pyx_kp_b_iso88591_1_axq_F __pyx_string_tab[7026]
#define __pyx_kp_b_iso88591_1_az_gT __pyx_string_tab[7027]
#define __pyx_kp_b_iso88591_1_b_a_1D_a __pyx_string_tab[7028]
#define __pyx_kp_b_iso88591_1_c_Q_a_1D_ar_q_a_2XV1Kq_A __pyx_string_tab[7029]
#define __pyx_kp_b_iso88591_1_c_Q_a_at7_2V1Ba_a_2XV1Kq_A __pyx_string_tab[7030]
#define __pyx_kp_b_iso88591_1_fAQ_a_U __pyx_string_tab[7031]
#define __pyx_kp_b_iso88591_1_fAQ_ay_U __pyx_string_tab[7032]
#define __pyx_kp_b_iso88591_1_ha_a_uAQ_a_a_4uF_a_q __pyx_string_tab[7033]
#define __pyx_kp_b_iso88591_1_havQ_1_a_1G1A_4wd_q_q __pyx_string_tab[7034]
#define __pyx_kp_b_iso88591_1_havQ_1_a_7_1_az_hd_1_q __pyx_string_tab[7035]
#define __pyx_kp_b_iso88591_1_havQ_q_a_AWAQ_az_hd_Q_q __pyx_string_tab[7036]
#define __pyx_kp_b_iso88591_1_k_a_1D_awaq_Qhe1A __pyx_string_tab[7037]
#define __pyx_kp_b_iso88591_1_q_S_U_1_q_S_U_1_axq_E_1 __pyx_string_tab[7038]
#define __pyx_kp_b_iso88591_1_q_a_AT __pyx_string_tab[7039]
#define __pyx_kp_b_iso88591_1_q_a_AT_q_uAQ __pyx_string_tab[7040]
#define __pyx_kp_b_iso88591_1_q_a_at5_vQa __pyx_string_tab[7041]
#define __pyx_kp_b_iso88591_1_q_a_q_F __pyx_string_tab[7042]
#define __pyx_kp_b_iso88591_1_r_a_1D_at1_q __pyx_string_tab[7043]
#define __pyx_kp_b_iso88591_1_r_a_4wat1_q __pyx_string_tab[7044]
#define __pyx_kp_b_iso88591_1_s_a_1D_as_a_3a_q __pyx_string_tab[7045]
#define __pyx_kp_b_iso88591_1_s_a_1D_at1_q __pyx_string_tab[7046]
#define __pyx_kp_b_iso88591_1_s_a_AT_A_a_3a_q __pyx_string_tab[7047]
#define __pyx_kp_b_iso88591_1_s_a_Qd_q_1_q __pyx_string_tab[7048]
#define __pyx_kp_b_iso88591_1_s_a_q_Kq_1_q __pyx_string_tab[7049]
#define __pyx_kp_b_iso88591_1_t1E_a_4wat1_q __pyx_string_tab[7050]
#define __pyx_kp_b_iso88591_1_t9AQ __pyx_string_tab[7051]
#define __pyx_kp_b_iso88591_1_t9AQ_2 __pyx_string_tab[7052]
#define __pyx_kp_b_iso88591_1_uE_e5_az_e1A_a_Qd_s_3aq_s_3aq __pyx_string_tab[7053]
#define __pyx_kp_b_iso88591_1_y_a_at_q_Q __pyx_string_tab[7054]
#define __pyx_kp_b_iso88591_22B_3az_a_XQgQe6_G9A_QfG4q_A_ha __pyx_string_tab[7055]
#define __pyx_kp_b_iso88591_22H_1M_1Jit1A_s_1_1_XQgQj_F_1_G __pyx_string_tab[7056]
#define __pyx_kp_b_iso88591_22J_ST_AQ_a_1D_RvT_1_a_1D_RvT_1 __pyx_string_tab[7057]
#define __pyx_kp_b_iso88591_22J_ST_AQ_a_1D_RvT_1_a_e2V4r __pyx_string_tab[7058]
#define __pyx_kp_b_iso88591_22J_ST_AQ_a_4uBfD_1_a_4uBfD_1 __pyx_string_tab[7059]
#define __pyx_kp_b_iso88591_22MQ_a_AT __pyx_string_tab[7060]
#define __pyx_kp_b_iso88591_2C_yXY_2WA_5_5_1_1D_d_1_Q_q_F_a __pyx_string_tab[7061]
#define __pyx_kp_b_iso88591_2_0_axq_G1A_axq_G1A_b_5_T_b_5_W __pyx_string_tab[7062]
#define __pyx_kp_b_iso88591_2_1IQa_a_4uA __pyx_string_tab[7063]
#define __pyx_kp_b_iso88591_2_1_F_1_a_4uAV1 __pyx_string_tab[7064]
#define __pyx_kp_b_iso88591_2_1_Qm1A_2WF_a_4wavV1 __pyx_string_tab[7065]
#define __pyx_kp_b_iso88591_2_1_Qm1A_2WF_a_fAV6 __pyx_string_tab[7066]
#define __pyx_kp_b_iso88591_2_A_fAQ_a_q_E __pyx_string_tab[7067]
#define __pyx_kp_b_iso88591_2_A_q_a_Qd __pyx_string_tab[7068]
#define __pyx_kp_b_iso88591_2_RS_5_F_6_F_4t2_3FgTQZZ_AQ_9G1 __pyx_string_tab[7069]
#define __pyx_kp_b_iso88591_2_RS_5_F_6_F_4t2_3FgTQZZ_AQ_9G1_2 __pyx_string_tab[7070]
#define __pyx_kp_b_iso88591_2_a_1D_QfAQ __pyx_string_tab[7071]
#define __pyx_kp_b_iso88591_2_a_1D_T __pyx_string_tab[7072]
#define __pyx_kp_b_iso88591_2_a_AT_q_aq __pyx_string_tab[7073]
#define __pyx_kp_b_iso88591_2_a_at5 __pyx_string_tab[7074]
#define __pyx_kp_b_iso88591_2_aq_a_q_Jk __pyx_string_tab[7075]
#define __pyx_kp_b_iso88591_2_uAQ_IQk_a_q_F __pyx_string_tab[7076]
#define __pyx_kp_b_iso88591_31_4AQ_a_4wa __pyx_string_tab[7077]
#define __pyx_kp_b_iso88591_31_AV1 __pyx_string_tab[7078]
#define __pyx_kp_b_iso88591_31_a_AT_avQa __pyx_string_tab[7079]
#define __pyx_kp_b_iso88591_31_a_Qd __pyx_string_tab[7080]
#define __pyx_kp_b_iso88591_31_a_U_q __pyx_string_tab[7081]
#define __pyx_kp_b_iso88591_31_a_at7_F_A __pyx_string_tab[7082]
#define __pyx_kp_b_iso88591_31_a_e3a __pyx_string_tab[7083]
#define __pyx_kp_b_iso88591_31_a_e4q __pyx_string_tab[7084]
#define __pyx_kp_b_iso88591_31_a_q_F_q __pyx_string_tab[7085]
#define __pyx_kp_b_iso88591_31_q_a_3fAQ_az_hd_q __pyx_string_tab[7086]
#define __pyx_kp_b_iso88591_31_uAQ_a_q_G83a __pyx_string_tab[7087]
#define __pyx_kp_b_iso88591_33C1_3az_a_XQgQe6_G9A_QfG4q_A_h __pyx_string_tab[7088]
#define __pyx_kp_b_iso88591_33JJ__hhi_1D_fF __pyx_string_tab[7089]
#define __pyx_kp_b_iso88591_37_1_vQa_a_fG1A __pyx_string_tab[7090]
#define __pyx_kp_b_iso88591_37_QR_A_4wfG3a_a_Qd_s __pyx_string_tab[7091]
#define __pyx_kp_b_iso88591_381_1_1_U_1_a_WCs_S __pyx_string_tab[7092]
#define __pyx_kp_b_iso88591_381_uAQ_a_at81 __pyx_string_tab[7093]
#define __pyx_kp_b_iso88591_39A_Q_4wfG3a_a_4uA __pyx_string_tab[7094]
#define __pyx_kp_b_iso88591_39A_Qa_a_q_F_a_Qd __pyx_string_tab[7095]
#define __pyx_kp_b_iso88591_39A_a __pyx_string_tab[7096]
#define __pyx_kp_b_iso88591_3EQ_5_Zq_9AV1A_a_WD_e1 __pyx_string_tab[7097]
#define __pyx_kp_b_iso88591_3_5_6_xq_havQ_q_a_q_wfAQ_az_hd __pyx_string_tab[7098]
#define __pyx_kp_b_iso88591_44Fa_a_1_haxq_1A_hawat6_r_Cq_G9 __pyx_string_tab[7099]
#define __pyx_kp_b_iso88591_44GyPQ_l_1_awat6_q_a __pyx_string_tab[7100]
#define __pyx_kp_b_iso88591_44H_1_DAQ_a_5Qd_vQa_uAQ __pyx_string_tab[7101]
#define __pyx_kp_b_iso88591_4A_1_1_a_aq_a_U_Ya_RRSST_7_a_AT __pyx_string_tab[7102]
#define __pyx_kp_b_iso88591_4A_4q_a_Qd_A __pyx_string_tab[7103]
#define __pyx_kp_b_iso88591_4A_Zq_9AV1A_a_4wfE __pyx_string_tab[7104]
#define __pyx_kp_b_iso88591_4A_a_WCq __pyx_string_tab[7105]
#define __pyx_kp_b_iso88591_4A_a_at5_1 __pyx_string_tab[7106]
#define __pyx_kp_b_iso88591_4A_a_fAXQa_ay_aq __pyx_string_tab[7107]
#define __pyx_kp_b_iso88591_4A_a_q_E __pyx_string_tab[7108]
#define __pyx_kp_b_iso88591_4A_a_q_E_6_1 __pyx_string_tab[7109]
#define __pyx_kp_b_iso88591_4A_a_q_E_vT __pyx_string_tab[7110]
#define __pyx_kp_b_iso88591_4A_axq_F_q __pyx_string_tab[7111]
#define __pyx_kp_b_iso88591_4A_r_aq_a_AT_k_4wauA_vQ __pyx_string_tab[7112]
#define __pyx_kp_b_iso88591_4A_uAQ_a_1D_XS __pyx_string_tab[7113]
#define __pyx_kp_b_iso88591_4HA_a_c_IQk_a_0_U_ar_q __pyx_string_tab[7114]
#define __pyx_kp_b_iso88591_4IQ_vQa_a_Qd __pyx_string_tab[7115]
#define __pyx_kp_b_iso88591_4N_1_1_9AZq_6_F_4s_a_3e3d_A_S_A __pyx_string_tab[7116]
#define __pyx_kp_b_iso88591_4N_n_eef_xq_a_q_Qa_a_xxq_az_hd __pyx_string_tab[7117]
#define __pyx_kp_b_iso88591_4O9A_A_A_a_4uD_q __pyx_string_tab[7118]
#define __pyx_kp_b_iso88591_4_a_1_q_q_IQk_a_at5_A_QRRS_a_4u __pyx_string_tab[7119]
#define __pyx_kp_b_iso88591_4s_S_q_F_1Cq_a_1Cq_q __pyx_string_tab[7120]
#define __pyx_kp_b_iso88591_4uCvQ_a_1D_q __pyx_string_tab[7121]
#define __pyx_kp_b_iso88591_4uCvQ_a_4q_q __pyx_string_tab[7122]
#define __pyx_kp_b_iso88591_4vS_AQ_Qd __pyx_string_tab[7123]
#define __pyx_kp_b_iso88591_4vS_AQ_a_q_G1A_q __pyx_string_tab[7124]
#define __pyx_kp_b_iso88591_4vS_q_4t1_AQ_a_q_Q_HA_IQ_HA __pyx_string_tab[7125]
#define __pyx_kp_b_iso88591_55OxWX_e1A_q_a_1D_WA __pyx_string_tab[7126]
#define __pyx_kp_b_iso88591_5GyPQ_U_1_Q_Q_a_Qd_s_a __pyx_string_tab[7127]
#define __pyx_kp_b_iso88591_5K8ST_5_aq_aq_a_4uD __pyx_string_tab[7128]
#define __pyx_kp_b_iso88591_5Q8_A_hawat1A_a_AT_d __pyx_string_tab[7129]
#define __pyx_kp_b_iso88591_5Q_5_a_q_HD_Q __pyx_string_tab[7130]
#define __pyx_kp_b_iso88591_5Q_9AZq_Ry_a_Qd_ar_1_A __pyx_string_tab[7131]
#define __pyx_kp_b_iso88591_5Q_a_1D_T __pyx_string_tab[7132]
#define __pyx_kp_b_iso88591_5Q_a_Qd_s __pyx_string_tab[7133]
#define __pyx_kp_b_iso88591_5Q_a_a_at6_Qa_Cs_vZq_5_Qa_a_AT __pyx_string_tab[7134]
#define __pyx_kp_b_iso88591_5Q_aq_a_4z_4q __pyx_string_tab[7135]
#define __pyx_kp_b_iso88591_5Q_uAQ_a_AT_hfA __pyx_string_tab[7136]
#define __pyx_kp_b_iso88591_5WJa_1_AT_t1_V4q __pyx_string_tab[7137]
#define __pyx_kp_b_iso88591_5XQ_5_Q_a_4uCvS_d_7_1_gQgQ_4uCv __pyx_string_tab[7138]
#define __pyx_kp_b_iso88591_5XQ_a_A_IQk_a_1_e_q __pyx_string_tab[7139]
#define __pyx_kp_b_iso88591_5XQ_a_c_IQk_a_1_e_q_q __pyx_string_tab[7140]
#define __pyx_kp_b_iso88591_5Ya_V3c_F_Q __pyx_string_tab[7141]
#define __pyx_kp_b_iso88591_5Ya_a __pyx_string_tab[7142]
#define __pyx_kp_b_iso88591_5_5_F_6_F_V1_IQ_4A_a_4w6OwVW __pyx_string_tab[7143]
#define __pyx_kp_b_iso88591_5_5_F_6_F_V1_IQ_4A_a_U2K7RS __pyx_string_tab[7144]
#define __pyx_kp_b_iso88591_5_5_a_q_HD_a_q __pyx_string_tab[7145]
#define __pyx_kp_b_iso88591_5_Q_8_E_ffg_Q_2WF_Q_2WF_Q_2WF_5 __pyx_string_tab[7146]
#define __pyx_kp_b_iso88591_5_a_XQ __pyx_string_tab[7147]
#define __pyx_kp_b_iso88591_5_a_at6 __pyx_string_tab[7148]
#define __pyx_kp_b_iso88591_5_a_at6_2 __pyx_string_tab[7149]
#define __pyx_kp_b_iso88591_5_ffg_xq_a_q_a_q_vV81A_az_hd_q __pyx_string_tab[7150]
#define __pyx_kp_b_iso88591_5_q_9AV1A_a_U __pyx_string_tab[7151]
#define __pyx_kp_b_iso88591_5_z_a_Qd_q_r_7_b_Q_Q_a_U_aq_a_A __pyx_string_tab[7152]
#define __pyx_kp_b_iso88591_5_z_a_Qd_q_r_7_b_a_a_1D_T_uAQ __pyx_string_tab[7153]
#define __pyx_kp_b_iso88591_5_z_a_Qd_q_r_7_b_e1A_a_U_a __pyx_string_tab[7154]
#define __pyx_kp_b_iso88591_66H_5_z_a_Qd_q_r_7_b_a_a_U_aq_q __pyx_string_tab[7155]
#define __pyx_kp_b_iso88591_66H_S_XQgQe6_T_G9A_Qj_Qa_q_Q_c __pyx_string_tab[7156]
#define __pyx_kp_b_iso88591_66II_kkrrs2_5Qa_q_a_1D_WG_q_1_Q __pyx_string_tab[7157]
#define __pyx_kp_b_iso88591_6a_6_Qa_a_q_G1 __pyx_string_tab[7158]
#define __pyx_kp_b_iso88591_6a_9AZq_a_1D_Q __pyx_string_tab[7159]
#define __pyx_kp_b_iso88591_6a_9AZq_a_1D_Q_2 __pyx_string_tab[7160]
#define __pyx_kp_b_iso88591_6a_9AZq_a_AT_q __pyx_string_tab[7161]
#define __pyx_kp_b_iso88591_6a_A_1IQa_a_AT_a __pyx_string_tab[7162]
#define __pyx_kp_b_iso88591_6a_A_9AZq_a_fA __pyx_string_tab[7163]
#define __pyx_kp_b_iso88591_6a_DAQ_a_1D_V1A_uAQ __pyx_string_tab[7164]
#define __pyx_kp_b_iso88591_6a_E_8_81Cq_1A_a_U_S __pyx_string_tab[7165]
#define __pyx_kp_b_iso88591_6a_a_at6_6_1 __pyx_string_tab[7166]
#define __pyx_kp_b_iso88591_6a_a_e2V2Q __pyx_string_tab[7167]
#define __pyx_kp_b_iso88591_6a_a_q_F_Q __pyx_string_tab[7168]
#define __pyx_kp_b_iso88591_6a_ay_V3gV1A __pyx_string_tab[7169]
#define __pyx_kp_b_iso88591_6a_r_a_U_q_A_q __pyx_string_tab[7170]
#define __pyx_kp_b_iso88591_6a_uAQ_a_4whc __pyx_string_tab[7171]
#define __pyx_kp_b_iso88591_6ha_a_A_IQk_a_2_4uL __pyx_string_tab[7172]
#define __pyx_kp_b_iso88591_6iq_Qa_a_Qd __pyx_string_tab[7173]
#define __pyx_kp_b_iso88591_6iq_U_1_7_Q_S_6_c_V6_a_fF_q __pyx_string_tab[7174]
#define __pyx_kp_b_iso88591_6nIQ_a_a_e1 __pyx_string_tab[7175]
#define __pyx_kp_b_iso88591_77I_S_XQgQe6_T_G9A_Qj_Qa_q_Q_A __pyx_string_tab[7176]
#define __pyx_kp_b_iso88591_77I_S_XQgQe6_T_G9A_Qj_Qa_q_Q_c __pyx_string_tab[7177]
#define __pyx_kp_b_iso88591_77K1_6_q_AV6_Qa_q_S_6_1_1A_Kq_Q __pyx_string_tab[7178]
#define __pyx_kp_b_iso88591_7_1_fAQ_a_fA __pyx_string_tab[7179]
#define __pyx_kp_b_iso88591_7_C_i_j_B_B_K_K_L_Q_2WF_5_6_6_F __pyx_string_tab[7180]
#define __pyx_kp_b_iso88591_7_Raab_a_5_A_6_M_6_M_6_M_6_M_vS __pyx_string_tab[7181]
#define __pyx_kp_b_iso88591_7_a_7_z_aq_1_WF_uAQ_a_4xy __pyx_string_tab[7182]
#define __pyx_kp_b_iso88591_7_a_Qd_Kwas_q __pyx_string_tab[7183]
#define __pyx_kp_b_iso88591_7_a_U_3a_a_3a_q __pyx_string_tab[7184]
#define __pyx_kp_b_iso88591_7_a_e1Cq_a_3a_q __pyx_string_tab[7185]
#define __pyx_kp_b_iso88591_7_a_e1Cq_a_3a_q_2 __pyx_string_tab[7186]
#define __pyx_kp_b_iso88591_7q_5A_Ya_1A_a_AT_q __pyx_string_tab[7187]
#define __pyx_kp_b_iso88591_7q_9_F_ggh_Q_2WF_5_6_6_F_F_IQ_Q __pyx_string_tab[7188]
#define __pyx_kp_b_iso88591_7q_A_9AZq_a_AT_a __pyx_string_tab[7189]
#define __pyx_kp_b_iso88591_7q_IQk_a_at5_s __pyx_string_tab[7190]
#define __pyx_kp_b_iso88591_7q_a_1D_auA __pyx_string_tab[7191]
#define __pyx_kp_b_iso88591_7q_a_4vQfAV1A __pyx_string_tab[7192]
#define __pyx_kp_b_iso88591_7q_a_4vT_q __pyx_string_tab[7193]
#define __pyx_kp_b_iso88591_7q_a_U __pyx_string_tab[7194]
#define __pyx_kp_b_iso88591_7q_a_q_A_a_1D_avQa_2U_Q_uCq_awa __pyx_string_tab[7195]
#define __pyx_kp_b_iso88591_7q_uAQ_a_e83a __pyx_string_tab[7196]
#define __pyx_kp_b_iso88591_7v_W_a_havQ_IWG7_auAU_3as_3aq_7 __pyx_string_tab[7197]
#define __pyx_kp_b_iso88591_7wj_1_a_U_6 __pyx_string_tab[7198]
#define __pyx_kp_b_iso88591_7xq_1_5_DAQ_a_AT_fF_1_uAQ __pyx_string_tab[7199]
#define __pyx_kp_b_iso88591_7xq_E_E_a_q_F_q __pyx_string_tab[7200]
#define __pyx_kp_b_iso88591_7y_W_a_q_a_2WF_2WF_QfA_WD_WF_81 __pyx_string_tab[7201]
#define __pyx_kp_b_iso88591_7z_aq_t1E_a_1D_fAS_q __pyx_string_tab[7202]
#define __pyx_kp_b_iso88591_812_Q_e1A_a_e1A_Q_a_1D_WAU_A_av __pyx_string_tab[7203]
#define __pyx_kp_b_iso88591_81A_a_AT_a __pyx_string_tab[7204]
#define __pyx_kp_b_iso88591_81A_a_AT_a_2 __pyx_string_tab[7205]
#define __pyx_kp_b_iso88591_81A_a_AT_a_3 __pyx_string_tab[7206]
#define __pyx_kp_b_iso88591_81A_a_Qd __pyx_string_tab[7207]
#define __pyx_kp_b_iso88591_81A_a_Qd_2 __pyx_string_tab[7208]
#define __pyx_kp_b_iso88591_81A_a_Qd_at1 __pyx_string_tab[7209]
#define __pyx_kp_b_iso88591_81A_a_at7 __pyx_string_tab[7210]
#define __pyx_kp_b_iso88591_81_1_81A_a_q_F __pyx_string_tab[7211]
#define __pyx_kp_b_iso88591_81_5_5_a_4xt1E_q __pyx_string_tab[7212]
#define __pyx_kp_b_iso88591_81_5_z_a_Qd_q_r_7_b_e1A_a_1D_T __pyx_string_tab[7213]
#define __pyx_kp_b_iso88591_81_E_a_Qd_a __pyx_string_tab[7214]
#define __pyx_kp_b_iso88591_81_E_a_at7 __pyx_string_tab[7215]
#define __pyx_kp_b_iso88591_81_E_a_ha __pyx_string_tab[7216]
#define __pyx_kp_b_iso88591_81_IQk_a_q_E __pyx_string_tab[7217]
#define __pyx_kp_b_iso88591_81_U_1_a_AT __pyx_string_tab[7218]
#define __pyx_kp_b_iso88591_81_e1A_e1A_a_AT_wa __pyx_string_tab[7219]
#define __pyx_kp_b_iso88591_81_iq_Qa_a_1_fF __pyx_string_tab[7220]
#define __pyx_kp_b_iso88591_81_iq_uAQ_a_4uHAWAQ_uAXU_1 __pyx_string_tab[7221]
#define __pyx_kp_b_iso88591_81_uAQ_Q_a_q_F_1_uAQ __pyx_string_tab[7222]
#define __pyx_kp_b_iso88591_81_uAQ_Q_a_q_F_1_uAQ_2 __pyx_string_tab[7223]
#define __pyx_kp_b_iso88591_81_uAQ_Q_a_q_F_1_vQa __pyx_string_tab[7224]
#define __pyx_kp_b_iso88591_81_uAQ_a_a_4uHAQ_uAQ __pyx_string_tab[7225]
#define __pyx_kp_b_iso88591_81_uAQ_s_a_at5_A_a_3a_q __pyx_string_tab[7226]
#define __pyx_kp_b_iso88591_81_uAQ_uAQ_q_q_a_0_V881A_a_4AT __pyx_string_tab[7227]
#define __pyx_kp_b_iso88591_81_y_q_a_q_E_q __pyx_string_tab[7228]
#define __pyx_kp_b_iso88591_88J_Q_9AZq_Cq_XQgQk_xq_T_G9A_au __pyx_string_tab[7229]
#define __pyx_kp_b_iso88591_88J_S_XQgQe6_T_G9A_Qj_Qa_q_Q_A __pyx_string_tab[7230]
#define __pyx_kp_b_iso88591_88KK_mmttu_5Qa_q_a_Qd_wg_3_q_q __pyx_string_tab[7231]
#define __pyx_kp_b_iso88591_8I_Xggvv_A_a_WF_6_WF_6_WF_6_a_W __pyx_string_tab[7232]
#define __pyx_kp_b_iso88591_8J_uAQ_q_9AXQa_a_1D_ha_a_q_F __pyx_string_tab[7233]
#define __pyx_kp_b_iso88591_8_0_A_Zq_Qiq_D_e1_hay_q_q_E_q_q __pyx_string_tab[7234]
#define __pyx_kp_b_iso88591_8_1_a_Qd_q_1A_vQa __pyx_string_tab[7235]
#define __pyx_kp_b_iso88591_8_5_a_4xt5 __pyx_string_tab[7236]
#define __pyx_kp_b_iso88591_8_E_U_81Cq_1A_a_1D_S_1 __pyx_string_tab[7237]
#define __pyx_kp_b_iso88591_8_M_7_we1_7_wfA_a_4vV1 __pyx_string_tab[7238]
#define __pyx_kp_b_iso88591_8_Qa_a_q_F __pyx_string_tab[7239]
#define __pyx_kp_b_iso88591_8_Ya_aq_d_1_vS_az_e6_q __pyx_string_tab[7240]
#define __pyx_kp_b_iso88591_8_a __pyx_string_tab[7241]
#define __pyx_kp_b_iso88591_8_a_1D_S __pyx_string_tab[7242]
#define __pyx_kp_b_iso88591_8_a_1D_avQfAQ __pyx_string_tab[7243]
#define __pyx_kp_b_iso88591_8_a_Qd_s_V6_PQ __pyx_string_tab[7244]
#define __pyx_kp_b_iso88591_8_a_Qd_uA __pyx_string_tab[7245]
#define __pyx_kp_b_iso88591_8_a_at5_A __pyx_string_tab[7246]
#define __pyx_kp_b_iso88591_8_a_e1 __pyx_string_tab[7247]
#define __pyx_kp_b_iso88591_8_uAQ_a_AT_1 __pyx_string_tab[7248]
#define __pyx_kp_b_iso88591_8_vT_wj_y_q_a_d_4vQ __pyx_string_tab[7249]
#define __pyx_kp_b_iso88591_99RR__w_x_A_A_B_7_vS_ha_vS_ha_x __pyx_string_tab[7250]
#define __pyx_kp_b_iso88591_99SSVVYYdd_B_B_E_E_F_bbv_w_E_E __pyx_string_tab[7251]
#define __pyx_kp_b_iso88591_9A4_a_b_awat7_gV1Cq_q __pyx_string_tab[7252]
#define __pyx_kp_b_iso88591_9AZq_a_V1 __pyx_string_tab[7253]
#define __pyx_kp_b_iso88591_9AZq_a_at5 __pyx_string_tab[7254]
#define __pyx_kp_b_iso88591_9A_1_7_z_q_a_iq __pyx_string_tab[7255]
#define __pyx_kp_b_iso88591_9A_2S_1_1E_A_1D_1AQ_a_at_b_QfAQ __pyx_string_tab[7256]
#define __pyx_kp_b_iso88591_9A_7_Q_S_6_c_V6_a_1D_fA_q __pyx_string_tab[7257]
#define __pyx_kp_b_iso88591_9A_Q_Q_a_4uD __pyx_string_tab[7258]
#define __pyx_kp_b_iso88591_9A_Zq_a_Qd_F __pyx_string_tab[7259]
#define __pyx_kp_b_iso88591_9A_fAQ_a_V1 __pyx_string_tab[7260]
#define __pyx_kp_b_iso88591_9A_fAQ_a_gQ __pyx_string_tab[7261]
#define __pyx_kp_b_iso88591_9A_q_1_A_a_q_E __pyx_string_tab[7262]
#define __pyx_kp_b_iso88591_9A_vQa_a_V1 __pyx_string_tab[7263]
#define __pyx_kp_b_iso88591_9_HD_z_a_q_E __pyx_string_tab[7264]
#define __pyx_kp_b_iso88591_9_Q_a_Qd_q_XQgQj_F_1_G9A_6_uA_A __pyx_string_tab[7265]
#define __pyx_kp_b_iso88591_9_U_1_hgS_PTTUUV_a_1D_AT_q __pyx_string_tab[7266]
#define __pyx_kp_b_iso88591_9_a __pyx_string_tab[7267]
#define __pyx_kp_b_iso88591_9_a_4uA __pyx_string_tab[7268]
#define __pyx_kp_b_iso88591_9_a_AT_fF_a __pyx_string_tab[7269]
#define __pyx_kp_b_iso88591_9_a_q_E __pyx_string_tab[7270]
#define __pyx_kp_b_iso88591_9_a_q_E_F_e5 __pyx_string_tab[7271]
#define __pyx_kp_b_iso88591_9_a_q_E_Q __pyx_string_tab[7272]
#define __pyx_kp_b_iso88591_9_t1E_a_1D_as_4y_5_q_y_Q_6_a_q __pyx_string_tab[7273]
#define __pyx_kp_b_iso88591_A8_A_hawat1A_a_1D_T __pyx_string_tab[7274]
#define __pyx_kp_b_iso88591_AAZZgg_I_I_J_5_6_6_F_9F_IQ_A_a __pyx_string_tab[7275]
#define __pyx_kp_b_iso88591_AAZZgg_I_I_J_a_at8_K1_5_6_6_F_I __pyx_string_tab[7276]
#define __pyx_kp_b_iso88591_A_0_4z_z_q_9AZq_l_1_a_Qe1A_AZvQa __pyx_string_tab[7277]
#define __pyx_kp_b_iso88591_A_0_q_y_2_q_q_HA_HA_vS_WA_vS_ha __pyx_string_tab[7278]
#define __pyx_kp_b_iso88591_A_0q_A_A_q_a_YaF_Q_q_a_a_Q_A_Q_8 __pyx_string_tab[7279]
#define __pyx_kp_b_iso88591_A_0q_a_AT_q_q __pyx_string_tab[7280]
#define __pyx_kp_b_iso88591_A_0q_a_Qd_q __pyx_string_tab[7281]
#define __pyx_kp_b_iso88591_A_10_E_a_Qd_q_AU_auD_fAQ_G9E_Qe3 __pyx_string_tab[7282]
#define __pyx_kp_b_iso88591_A_10_k_k_9AWAQ_7_V9G1A_9AWAQ_vS __pyx_string_tab[7283]
#define __pyx_kp_b_iso88591_A_10_k_k_9AWAQ_7_V9G1A_9AWAQ_vS_2 __pyx_string_tab[7284]
#define __pyx_kp_b_iso88591_A_1_1D_iq __pyx_string_tab[7285]
#define __pyx_kp_b_iso88591_A_1_1_A_havQ_9AWCq_t6_QfE_3aq_E __pyx_string_tab[7286]
#define __pyx_kp_b_iso88591_A_1_1_WF_a_1D_gQ __pyx_string_tab[7287]
#define __pyx_kp_b_iso88591_A_1_1_a_A_2_havQ_4vXQ_Rs_1_b_Q_E __pyx_string_tab[7288]
#define __pyx_kp_b_iso88591_A_1_2WF_1_2WF_9G1_vS_ha_vS_ha_z __pyx_string_tab[7289]
#define __pyx_kp_b_iso88591_A_1_2WF_9G1_vS_ha_vS_ha_z_q_1_e6 __pyx_string_tab[7290]
#define __pyx_kp_b_iso88591_A_1_2WF_9G1_vS_ha_vS_ha_z_q_A_4u __pyx_string_tab[7291]
#define __pyx_kp_b_iso88591_A_1_2WF_9G1_vS_ha_vS_ha_z_q_Q_1D __pyx_string_tab[7292]
#define __pyx_kp_b_iso88591_A_1_5_DAQ_1_q_a_1D_S_fD_aq_T_az __pyx_string_tab[7293]
#define __pyx_kp_b_iso88591_A_1_6_q_AV6_Qa_q_S_6_1_1A_Kq_Q_F __pyx_string_tab[7294]
#define __pyx_kp_b_iso88591_A_1_8_a_havQc_q_QRRS_at6_A __pyx_string_tab[7295]
#define __pyx_kp_b_iso88591_A_1_9A_9G1_vS_ha_vS_ha_z_q_31_4 __pyx_string_tab[7296]
#define __pyx_kp_b_iso88591_A_1_AQ_a_q_E_6_Rq_a_Qd_r_t2Q __pyx_string_tab[7297]
#define __pyx_kp_b_iso88591_A_1_AQ_a_q_E_6_Rq_a_Qd_r_t2Q_2 __pyx_string_tab[7298]
#define __pyx_kp_b_iso88591_A_1_A_1IQa_Q_a_az_vQa __pyx_string_tab[7299]
#define __pyx_kp_b_iso88591_A_1_A_CuAQd_wavEUUYYZ_awa_4r __pyx_string_tab[7300]
#define __pyx_kp_b_iso88591_A_1_E_L_zY_aab_Cq_a_1F_q __pyx_string_tab[7301]
#define __pyx_kp_b_iso88591_A_1_IQ4_Q_a_havQ_Q_Qe1_T_Q_vWA_5 __pyx_string_tab[7302]
#define __pyx_kp_b_iso88591_A_1_IQ_Q_a_havQ_Q_Qe1_T_Q_vWA_5 __pyx_string_tab[7303]
#define __pyx_kp_b_iso88591_A_1_IQ_Q_a_havQ_Q_Qe1_T_Q_vWA_5_2 __pyx_string_tab[7304]
#define __pyx_kp_b_iso88591_A_1_IQk_1_2WF_9G1_vS_ha_vS_ha_z __pyx_string_tab[7305]
#define __pyx_kp_b_iso88591_A_1_IQk_q_1_2WF_9G1_vS_ha_vS_ha __pyx_string_tab[7306]
#define __pyx_kp_b_iso88591_A_1_IQnA_s __pyx_string_tab[7307]
#define __pyx_kp_b_iso88591_A_1_Q_1_iq6_A_A_A_A_A_A_A_WF_uAQ __pyx_string_tab[7308]
#define __pyx_kp_b_iso88591_A_1_S_1_g5H_a_s_s_Cq_1_g5K6QR_8 __pyx_string_tab[7309]
#define __pyx_kp_b_iso88591_A_1_U_1_a_1_WF_a_AT_vWA_6_JgV1D __pyx_string_tab[7310]
#define __pyx_kp_b_iso88591_A_1_a_1_WF_awat6_6_JgV1D_fAT_vQd __pyx_string_tab[7311]
#define __pyx_kp_b_iso88591_A_1_a_1_WF_az_fG1_6_JgV1D_fAT_vQ __pyx_string_tab[7312]
#define __pyx_kp_b_iso88591_A_1_a_AQa_q __pyx_string_tab[7313]
#define __pyx_kp_b_iso88591_A_1_a_AT_q __pyx_string_tab[7314]
#define __pyx_kp_b_iso88591_A_1_a_AT_q_Q_a_t6_a_AV1A_wat1Cq __pyx_string_tab[7315]
#define __pyx_kp_b_iso88591_A_1_a_Qd_uAQ __pyx_string_tab[7316]
#define __pyx_kp_b_iso88591_A_1_a_at6_q __pyx_string_tab[7317]
#define __pyx_kp_b_iso88591_A_1_ay_q __pyx_string_tab[7318]
#define __pyx_kp_b_iso88591_A_1_iq_7_V9A_Zq_Qa_Zq_Qa_s_83c_s __pyx_string_tab[7319]
#define __pyx_kp_b_iso88591_A_1_t1A_s_1_A_q_Q_7_4vXQa_G9A_d __pyx_string_tab[7320]
#define __pyx_kp_b_iso88591_A_1_uAQ_uAQ_q_9AXQa_a_0_V881_a_4 __pyx_string_tab[7321]
#define __pyx_kp_b_iso88591_A_1_y_A_gQ_Qa_q_E_a_7_6_e1 __pyx_string_tab[7322]
#define __pyx_kp_b_iso88591_A_2_1_2WF_9G1_vS_ha_vS_ha_z_q_A __pyx_string_tab[7323]
#define __pyx_kp_b_iso88591_A_2_1_IQk_1_2WF_1_2WF_9G1_vS_ha __pyx_string_tab[7324]
#define __pyx_kp_b_iso88591_A_2_2_1D_83fA_iq_s_V_a_5_6_6_F_7 __pyx_string_tab[7325]
#define __pyx_kp_b_iso88591_A_2_2_1_83fA_iq_s_g_6_6_F_6_F_9F __pyx_string_tab[7326]
#define __pyx_kp_b_iso88591_A_2_2_c_2_1_a_1_a_1_a_1_a_1_a_1 __pyx_string_tab[7327]
#define __pyx_kp_b_iso88591_A_2_5_q_AQ_a_2_1 __pyx_string_tab[7328]
#define __pyx_kp_b_iso88591_A_2_A_A_A_4s_t9Cq_AQ_4wa_84y_t3a __pyx_string_tab[7329]
#define __pyx_kp_b_iso88591_A_2_havQ_6_A_AQ_Q __pyx_string_tab[7330]
#define __pyx_kp_b_iso88591_A_31_39A_1_2WF_9G1_vS_ha_vS_ha __pyx_string_tab[7331]
#define __pyx_kp_b_iso88591_A_31_39A_9G1_vS_ha_vS_ha_z_q_U_U __pyx_string_tab[7332]
#define __pyx_kp_b_iso88591_A_31_L_a_aq __pyx_string_tab[7333]
#define __pyx_kp_b_iso88591_A_33KKccllm6_HD_z_he7_A_5_a_XQha __pyx_string_tab[7334]
#define __pyx_kp_b_iso88591_A_3_Q_4wfG3a_a_at5_a __pyx_string_tab[7335]
#define __pyx_kp_b_iso88591_A_3_lZiij_1_ST2_fA_5_vXV1A_5_vXV __pyx_string_tab[7336]
#define __pyx_kp_b_iso88591_A_3e_5Qa __pyx_string_tab[7337]
#define __pyx_kp_b_iso88591_A_4A_4IQ_WA_vS_ha_vS_ha_1_1D_wa __pyx_string_tab[7338]
#define __pyx_kp_b_iso88591_A_4_1_2WF_1_2WF_9G1_vS_ha_vS_ha __pyx_string_tab[7339]
#define __pyx_kp_b_iso88591_A_4q __pyx_string_tab[7340]
#define __pyx_kp_b_iso88591_A_4vV_Qa_y_q_a_l_1_6_gQ_a_7_1_84 __pyx_string_tab[7341]
#define __pyx_kp_b_iso88591_A_67_Q_6a_a_a_Q_Q_q_XQd_xq_a_AQ __pyx_string_tab[7342]
#define __pyx_kp_b_iso88591_A_67_Q_6a_a_a_Q_Q_q_XQd_xq_a_AQ_2 __pyx_string_tab[7343]
#define __pyx_kp_b_iso88591_A_6oE_k_l_B_B_C_q_A_a_Qd_q_j_Q __pyx_string_tab[7344]
#define __pyx_kp_b_iso88591_A_7_7_a_Qd_q_6_Q_a_3a_a_3a_Q __pyx_string_tab[7345]
#define __pyx_kp_b_iso88591_A_7q_4G_Q_vQa_vQa_q_Qm1A_2WF_a_e __pyx_string_tab[7346]
#define __pyx_kp_b_iso88591_A_7q_7y_q_vS_ha_vS_ha_V1_a_Qd_9 __pyx_string_tab[7347]
#define __pyx_kp_b_iso88591_A_7y_4vV_Qa_y_q_Q_a_6_j_l_1_6_gQ __pyx_string_tab[7348]
#define __pyx_kp_b_iso88591_A_83fA_iq_s_q_E_V1_6_F_6_F_9F_7 __pyx_string_tab[7349]
#define __pyx_kp_b_iso88591_A_8_a_7_V9G1_7_V9Cq_6_c_Qm3fAQ_Q __pyx_string_tab[7350]
#define __pyx_kp_b_iso88591_A_8_j_2_vQa_vQa_vQa_Qa_a_4uG1F_f __pyx_string_tab[7351]
#define __pyx_kp_b_iso88591_A_9A_A_5_vXQ_A_9AS_6_A_a_gS_QfA __pyx_string_tab[7352]
#define __pyx_kp_b_iso88591_A_9A_A_5_vXQ_A_9AS_6_A_a_gS_QfA_2 __pyx_string_tab[7353]
#define __pyx_kp_b_iso88591_A_9A_havQ_a_QgQ __pyx_string_tab[7354]
#define __pyx_kp_b_iso88591_A_9A_havQ_y_q_V1_a_1G7_6_q __pyx_string_tab[7355]
#define __pyx_kp_b_iso88591_A_A0_1_7_Q_S_5_1_A_a_AT_s_q_a_q __pyx_string_tab[7356]
#define __pyx_kp_b_iso88591_A_A_5_B_q_5_C5_a_4uL_LPQ __pyx_string_tab[7357]
#define __pyx_kp_b_iso88591_A_A_9A_fG1_fG1_fA_A_3e5_3e5_F_F __pyx_string_tab[7358]
#define __pyx_kp_b_iso88591_A_A_IQB_havQ_e1_q_AS_3c_uA_2Rs_b __pyx_string_tab[7359]
#define __pyx_kp_b_iso88591_A_A_IQ_havQ_4q_e1_q_AS_7_as_1_q __pyx_string_tab[7360]
#define __pyx_kp_b_iso88591_A_A_IQ_havQ_Zq_6_e5_3c_uA_9AV1A __pyx_string_tab[7361]
#define __pyx_kp_b_iso88591_A_A_IQ_havQ_e1_q_AS_7_as_1_3c_uA __pyx_string_tab[7362]
#define __pyx_kp_b_iso88591_A_A_IQ_havQ_e1_q_AS_7_as_1_q_a_a __pyx_string_tab[7363]
#define __pyx_kp_b_iso88591_A_A_Q_a_AT_q_aq_aq_a_AT_uG7_1_q __pyx_string_tab[7364]
#define __pyx_kp_b_iso88591_A_A_a_AT_Qd_1_vQ __pyx_string_tab[7365]
#define __pyx_kp_b_iso88591_A_A_a_A_IQ0_Q_Q_1_nA_9G1_xq_4q_5 __pyx_string_tab[7366]
#define __pyx_kp_b_iso88591_A_A_a_A_IQ0_Q_Q_1_nA_9G1_xq_4q_5_2 __pyx_string_tab[7367]
#define __pyx_kp_b_iso88591_A_A_a_A_IQ2_Q_1_1__N_9G1_xq_4q_5 __pyx_string_tab[7368]
#define __pyx_kp_b_iso88591_A_A_a_aq_q __pyx_string_tab[7369]
#define __pyx_kp_b_iso88591_A_A_uCq __pyx_string_tab[7370]
#define __pyx_kp_b_iso88591_A_D __pyx_string_tab[7371]
#define __pyx_kp_b_iso88591_A_D_a_U_gT_WTXXY_Jawat5_T_uAT __pyx_string_tab[7372]
#define __pyx_kp_b_iso88591_A_E_Q_vQhas_3aq_A_az_e1A_4s_e1 __pyx_string_tab[7373]
#define __pyx_kp_b_iso88591_A_E_q __pyx_string_tab[7374]
#define __pyx_kp_b_iso88591_A_F_q __pyx_string_tab[7375]
#define __pyx_kp_b_iso88591_A_G1_a_at6_5_MYffggkkl_q __pyx_string_tab[7376]
#define __pyx_kp_b_iso88591_A_HA_6_az __pyx_string_tab[7377]
#define __pyx_kp_b_iso88591_A_HA_q __pyx_string_tab[7378]
#define __pyx_kp_b_iso88591_A_HD_z_5_1_a_4uF_V4q_q_gQgQ_4uF __pyx_string_tab[7379]
#define __pyx_kp_b_iso88591_A_IQ4_5_5_G7_vXQ_5_5_G7_vXQ_q_q __pyx_string_tab[7380]
#define __pyx_kp_b_iso88591_A_IQ4_q_havQ_IWG7_gQ_QfF_5_as_3a __pyx_string_tab[7381]
#define __pyx_kp_b_iso88591_A_IQV_havQ_IWG7_auAU_3as_3aq_7_Q __pyx_string_tab[7382]
#define __pyx_kp_b_iso88591_A_IQ_e1_q_AS_a_4vS_3c_4vQ __pyx_string_tab[7383]
#define __pyx_kp_b_iso88591_A_IQ_havQ_5_Zq_q_9AV1A_a_AWD_e4q __pyx_string_tab[7384]
#define __pyx_kp_b_iso88591_A_IQ_havQ_IWG7_auAU_3as_3aq_7_q __pyx_string_tab[7385]
#define __pyx_kp_b_iso88591_A_IQ_havQ_IWG7_q_Qe1Cq_1Cq_4s_a __pyx_string_tab[7386]
#define __pyx_kp_b_iso88591_A_IQ_havQ_Zq_q_9AV1A_a_awfE_Qa_a __pyx_string_tab[7387]
#define __pyx_kp_b_iso88591_A_IQ_q_V6_az_hd_6_N_4vQ_q_q __pyx_string_tab[7388]
#define __pyx_kp_b_iso88591_A_J_q_q_q_5_aq_a_4uE_a __pyx_string_tab[7389]
#define __pyx_kp_b_iso88591_A_Ja_fAQ_a_1D_2U_LA __pyx_string_tab[7390]
#define __pyx_kp_b_iso88591_A_K1_q_q_q_1E_q_a_Qd_uE __pyx_string_tab[7391]
#define __pyx_kp_b_iso88591_A_Meenno_5_6_6_F_6_IQ_4A_a_1_fAQ __pyx_string_tab[7392]
#define __pyx_kp_b_iso88591_A_Nff_H_H_I_0_HD_z_5_a_XQhawaq __pyx_string_tab[7393]
#define __pyx_kp_b_iso88591_A_Oq_1_IQ2_Zq_q_q_q_A_A_a_4q_A_C __pyx_string_tab[7394]
#define __pyx_kp_b_iso88591_A_Q1_Ya2_A_gV_1_A_gV_1_U_1_1_6 __pyx_string_tab[7395]
#define __pyx_kp_b_iso88591_A_Q_A_IQ_havQ_uAQ_uAQ_uAQ_q_a_Qg __pyx_string_tab[7396]
#define __pyx_kp_b_iso88591_A_Q_A_havQ_y_q_81A_a_az_hd_a_fA __pyx_string_tab[7397]
#define __pyx_kp_b_iso88591_A_Q_HA_q __pyx_string_tab[7398]
#define __pyx_kp_b_iso88591_A_Q_IQ_t1A_1_D_3awc_AQ_A_havQ_s __pyx_string_tab[7399]
#define __pyx_kp_b_iso88591_A_Q_Q_1_9A2_0_A_6_3fM_3fN_wl_1_Q __pyx_string_tab[7400]
#define __pyx_kp_b_iso88591_A_Q_Q_1_9A2_0_A_q_6_3fM_3fN_wl_1 __pyx_string_tab[7401]
#define __pyx_kp_b_iso88591_A_Q_Q_1_9A6_0_A_6_3fM_3fN_wl_1_Q __pyx_string_tab[7402]
#define __pyx_kp_b_iso88591_A_Q_Q_Q_9A0_uAQ_uAQ_q_Q_a_U_6_PQ __pyx_string_tab[7403]
#define __pyx_kp_b_iso88591_A_Q_Q_a_Qd_q_XQgQj_F_1_a_e1_A_G __pyx_string_tab[7404]
#define __pyx_kp_b_iso88591_A_Q_Q_q_YaX_7_z_q_7_z_q_7_z_q_7 __pyx_string_tab[7405]
#define __pyx_kp_b_iso88591_A_Q_a_1D_Qa_q __pyx_string_tab[7406]
#define __pyx_kp_b_iso88591_A_Q_a_1D_uAQ __pyx_string_tab[7407]
#define __pyx_kp_b_iso88591_A_Q_a_AT_q_uAQ __pyx_string_tab[7408]
#define __pyx_kp_b_iso88591_A_Q_a_AT_q_vQa __pyx_string_tab[7409]
#define __pyx_kp_b_iso88591_A_Q_a_Qd_uAQ __pyx_string_tab[7410]
#define __pyx_kp_b_iso88591_A_Q_a_U_1_uAQ __pyx_string_tab[7411]
#define __pyx_kp_b_iso88591_A_Q_a_at7_1_uAQ __pyx_string_tab[7412]
#define __pyx_kp_b_iso88591_A_Q_a_q_E_uAQ __pyx_string_tab[7413]
#define __pyx_kp_b_iso88591_A_Q_a_q_L_xq __pyx_string_tab[7414]
#define __pyx_kp_b_iso88591_A_Q_j_q_q_a_WCq_G6_Qa_5_WA_7_81G __pyx_string_tab[7415]
#define __pyx_kp_b_iso88591_A_Q_q_a_A_F_1_a_q_F_1_q_wavQ_7q __pyx_string_tab[7416]
#define __pyx_kp_b_iso88591_A_Q_q_a_Qd_a_1D_q_q_wavQ_1D_q_q __pyx_string_tab[7417]
#define __pyx_kp_b_iso88591_A_Qa_Qa_a_at6_q __pyx_string_tab[7418]
#define __pyx_kp_b_iso88591_A_Ql_iq_a_1D_fG1A __pyx_string_tab[7419]
#define __pyx_kp_b_iso88591_A_Ql_y_a_1D_e7_waq __pyx_string_tab[7420]
#define __pyx_kp_b_iso88591_A_Qm_a_4vU_gQa __pyx_string_tab[7421]
#define __pyx_kp_b_iso88591_A_Qm_y_a_V6 __pyx_string_tab[7422]
#define __pyx_kp_b_iso88591_A_R_IWG7_q_Qe1Cq_1Cq_a_4vS_3a_4s __pyx_string_tab[7423]
#define __pyx_kp_b_iso88591_A_Rq_a_1D_Qb_a_2Q_q __pyx_string_tab[7424]
#define __pyx_kp_b_iso88591_A_S_A_a_AT_b_avQe1_1 __pyx_string_tab[7425]
#define __pyx_kp_b_iso88591_A_S_S_S_S_a_AT_q_q_q_q_a_1A_a_1 __pyx_string_tab[7426]
#define __pyx_kp_b_iso88591_A_S_S_a_AT_q_q_vQ_a_1A_a_1A_d_1 __pyx_string_tab[7427]
#define __pyx_kp_b_iso88591_A_S_a_1D_Qaq_a_1A_q __pyx_string_tab[7428]
#define __pyx_kp_b_iso88591_A_S_a_q_F_1A_a_1A_q __pyx_string_tab[7429]
#define __pyx_kp_b_iso88591_A_S_q_hawauF_1_Qa_G9A_QfAT_auA_c __pyx_string_tab[7430]
#define __pyx_kp_b_iso88591_A_T_Q_87_87_q_1_a_q_ivV7_1_az_hd __pyx_string_tab[7431]
#define __pyx_kp_b_iso88591_A_T_a_a_1F_4uA_t1 __pyx_string_tab[7432]
#define __pyx_kp_b_iso88591_A_T_a_a_q_at5_E __pyx_string_tab[7433]
#define __pyx_kp_b_iso88591_A_T_q_a_q_az_hd_q __pyx_string_tab[7434]
#define __pyx_kp_b_iso88591_A_U_1_a_e6_A __pyx_string_tab[7435]
#define __pyx_kp_b_iso88591_A_YaB_1_a_7_Q_S_5_1_A_5_vWF_1_a __pyx_string_tab[7436]
#define __pyx_kp_b_iso88591_A_YaB_1_a_7_Q_S_5_1_A_5_vWF_1_az __pyx_string_tab[7437]
#define __pyx_kp_b_iso88591_A_YaB_1_q_7_Q_S_5_1_A_5_vXV1A_aw __pyx_string_tab[7438]
#define __pyx_kp_b_iso88591_A_YaJ_1_q_7_Q_S_5_1_A_5_vXV1A_aw __pyx_string_tab[7439]
#define __pyx_kp_b_iso88591_A_Ya_1_q_7_Q_S_5_1_A_5_vXV1A_a_A __pyx_string_tab[7440]
#define __pyx_kp_b_iso88591_A_Ya_5_6_Qc_S_s_Qa_q_xq_as_1_Q_X __pyx_string_tab[7441]
#define __pyx_kp_b_iso88591_A_Ya_q __pyx_string_tab[7442]
#define __pyx_kp_b_iso88591_A_Zq_fAQ_a_a_e6_A_6 __pyx_string_tab[7443]
#define __pyx_kp_b_iso88591_A_aJ_Q_Qa_Q_Q_q_2WF_2WF_2WF_a_1F __pyx_string_tab[7444]
#define __pyx_kp_b_iso88591_A_a_1 __pyx_string_tab[7445]
#define __pyx_kp_b_iso88591_A_a_1D __pyx_string_tab[7446]
#define __pyx_kp_b_iso88591_A_a_1D_Qa_AQ __pyx_string_tab[7447]
#define __pyx_kp_b_iso88591_A_a_1D_c __pyx_string_tab[7448]
#define __pyx_kp_b_iso88591_A_a_1D_c_q __pyx_string_tab[7449]
#define __pyx_kp_b_iso88591_A_a_1D_y __pyx_string_tab[7450]
#define __pyx_kp_b_iso88591_A_a_1_2 __pyx_string_tab[7451]
#define __pyx_kp_b_iso88591_A_a_3_XXaab_1_2WF_1_2WF_9G1_vS_h __pyx_string_tab[7452]
#define __pyx_kp_b_iso88591_A_a_4q_A_Cq_1A_q_q_vQe3c __pyx_string_tab[7453]
#define __pyx_kp_b_iso88591_A_a_4q_q_q_E_q_uAQ __pyx_string_tab[7454]
#define __pyx_kp_b_iso88591_A_a_A __pyx_string_tab[7455]
#define __pyx_kp_b_iso88591_A_a_AT __pyx_string_tab[7456]
#define __pyx_kp_b_iso88591_A_a_AT_aq __pyx_string_tab[7457]
#define __pyx_kp_b_iso88591_A_a_AT_aq_2 __pyx_string_tab[7458]
#define __pyx_kp_b_iso88591_A_a_AT_aq_uAQ __pyx_string_tab[7459]
#define __pyx_kp_b_iso88591_A_a_AT_b __pyx_string_tab[7460]
#define __pyx_kp_b_iso88591_A_a_AT_b_2 __pyx_string_tab[7461]
#define __pyx_kp_b_iso88591_A_a_AT_q __pyx_string_tab[7462]
#define __pyx_kp_b_iso88591_A_a_AT_q_uAQ __pyx_string_tab[7463]
#define __pyx_kp_b_iso88591_A_a_AT_q_vQa __pyx_string_tab[7464]
#define __pyx_kp_b_iso88591_A_a_AT_q_y __pyx_string_tab[7465]
#define __pyx_kp_b_iso88591_A_a_A_1_Q_A_1IQa_D_D_9HF_t1_5_a __pyx_string_tab[7466]
#define __pyx_kp_b_iso88591_A_a_A_1_Q_A_havQ_A_1IQa_D_D_9HF __pyx_string_tab[7467]
#define __pyx_kp_b_iso88591_A_a_A_IQ2_Q_Qa_5_6_auE_havQ_e1_q __pyx_string_tab[7468]
#define __pyx_kp_b_iso88591_A_a_A_IQ2_havQ_4q_Q_Qa_vS_q_5_6 __pyx_string_tab[7469]
#define __pyx_kp_b_iso88591_A_a_A_IQ6_A_1_A_a_havQ_7_4_1A_x __pyx_string_tab[7470]
#define __pyx_kp_b_iso88591_A_a_A_havQ_y_q_1_5_vXXQa_a_az_hd __pyx_string_tab[7471]
#define __pyx_kp_b_iso88591_A_a_A_havQ_y_q_81A_a_AWG7_1_az_h __pyx_string_tab[7472]
#define __pyx_kp_b_iso88591_A_a_A_havQ_y_q_81A_a_az_hd_a_fA __pyx_string_tab[7473]
#define __pyx_kp_b_iso88591_A_a_A_havQ_y_q_81A_a_az_hd_a_fA_2 __pyx_string_tab[7474]
#define __pyx_kp_b_iso88591_A_a_IQ4_havQ_Q_U_1_E_5_Qa_F_1_a __pyx_string_tab[7475]
#define __pyx_kp_b_iso88591_A_a_Oq_1_A_1_Q_IQd_V5_86_Q_Q_5Q __pyx_string_tab[7476]
#define __pyx_kp_b_iso88591_A_a_Q __pyx_string_tab[7477]
#define __pyx_kp_b_iso88591_A_a_Q_IQ4_havQ_Q_U_1_E_Qa_F_1_1 __pyx_string_tab[7478]
#define __pyx_kp_b_iso88591_A_a_Q_IQ4_havQ_Q_U_1_E_Qa_Q_1_1 __pyx_string_tab[7479]
#define __pyx_kp_b_iso88591_A_a_Q_z_IYk_a_az_a_AQgQgQgQa_k_a __pyx_string_tab[7480]
#define __pyx_kp_b_iso88591_A_a_Qd __pyx_string_tab[7481]
#define __pyx_kp_b_iso88591_A_a_Qd_q __pyx_string_tab[7482]
#define __pyx_kp_b_iso88591_A_a_Qd_q_2 __pyx_string_tab[7483]
#define __pyx_kp_b_iso88591_A_a_Qd_q_XQgQfF_1_hawavV1A_a_81 __pyx_string_tab[7484]
#define __pyx_kp_b_iso88591_A_a_Qd_q_aq __pyx_string_tab[7485]
#define __pyx_kp_b_iso88591_A_a_WA_6_q_E_a_9G1_q_1D_Q __pyx_string_tab[7486]
#define __pyx_kp_b_iso88591_A_a_a_1D_Qa_vQa __pyx_string_tab[7487]
#define __pyx_kp_b_iso88591_A_a_a_1D_T_Qd_1_uAQ __pyx_string_tab[7488]
#define __pyx_kp_b_iso88591_A_a_a_AT_q_Q_a_t6_a_AV1A_wat1Cq __pyx_string_tab[7489]
#define __pyx_kp_b_iso88591_A_a_a_AT_q_q __pyx_string_tab[7490]
#define __pyx_kp_b_iso88591_A_a_a_AT_q_q_2 __pyx_string_tab[7491]
#define __pyx_kp_b_iso88591_A_a_a_IQ4_q_AU_gQ_1_T_3axs_Qa_Q __pyx_string_tab[7492]
#define __pyx_kp_b_iso88591_A_a_a_M_Qd_Qa_Qd_Qa_3gQ_Qa_q_Qa __pyx_string_tab[7493]
#define __pyx_kp_b_iso88591_A_a_a_a_a_a_fA4_vQoV1A_vQoV1A_vQ __pyx_string_tab[7494]
#define __pyx_kp_b_iso88591_A_a_a_a_a_a_fAF_vQoV1A_vQoV1A_vQ __pyx_string_tab[7495]
#define __pyx_kp_b_iso88591_A_a_a_a_a_a_fA_vQoV1A_vQoV1A_vQo __pyx_string_tab[7496]
#define __pyx_kp_b_iso88591_A_a_a_a_a_a_fA_vQoV1A_vQoV1A_vQo_2 __pyx_string_tab[7497]
#define __pyx_kp_b_iso88591_A_a_a_at5_1HAQ_7_Q_F_3iq_G1IQ_5 __pyx_string_tab[7498]
#define __pyx_kp_b_iso88591_A_a_a_at5_vQa __pyx_string_tab[7499]
#define __pyx_kp_b_iso88591_A_a_a_q_E_vQa __pyx_string_tab[7500]
#define __pyx_kp_b_iso88591_A_a_a_q_vQa __pyx_string_tab[7501]
#define __pyx_kp_b_iso88591_A_a_at1 __pyx_string_tab[7502]
#define __pyx_kp_b_iso88591_A_a_at1_2 __pyx_string_tab[7503]
#define __pyx_kp_b_iso88591_A_a_at6 __pyx_string_tab[7504]
#define __pyx_kp_b_iso88591_A_a_at7_1_uAQ __pyx_string_tab[7505]
#define __pyx_kp_b_iso88591_A_a_auE_auE_auE_a_at1_Qa_Qa_Qa __pyx_string_tab[7506]
#define __pyx_kp_b_iso88591_A_a_az_gQa_vQa __pyx_string_tab[7507]
#define __pyx_kp_b_iso88591_A_a_e1A_uAQ __pyx_string_tab[7508]
#define __pyx_kp_b_iso88591_A_a_fAQ_y __pyx_string_tab[7509]
#define __pyx_kp_b_iso88591_A_a_havQ_1_Cq_1_hawauF_1_G9A_QfG __pyx_string_tab[7510]
#define __pyx_kp_b_iso88591_A_a_iq_1_1_1IQa_5_6_az_e6_1IQa_5 __pyx_string_tab[7511]
#define __pyx_kp_b_iso88591_A_a_iq_4wa_vS_ha_vS_ha_uF_Q_Qd_7 __pyx_string_tab[7512]
#define __pyx_kp_b_iso88591_A_a_j __pyx_string_tab[7513]
#define __pyx_kp_b_iso88591_A_a_k_t1E_Qa_e1A_Qa_e1A_a_1D_iwi __pyx_string_tab[7514]
#define __pyx_kp_b_iso88591_A_a_q_A __pyx_string_tab[7515]
#define __pyx_kp_b_iso88591_A_a_q_E_A __pyx_string_tab[7516]
#define __pyx_kp_b_iso88591_A_a_q_E_uAQ __pyx_string_tab[7517]
#define __pyx_kp_b_iso88591_A_a_q_IQD_q_fF_az_hd_AT_uA_q __pyx_string_tab[7518]
#define __pyx_kp_b_iso88591_A_a_q_IQ_q_86_waq_az_hd_AT_uA_q __pyx_string_tab[7519]
#define __pyx_kp_b_iso88591_A_a_q_IQ_q_9F_q_az_hd_AT_uA_q __pyx_string_tab[7520]
#define __pyx_kp_b_iso88591_A_a_q_IQ_q_V6_az_hd_AT_uA_q __pyx_string_tab[7521]
#define __pyx_kp_b_iso88591_A_a_q_L_vQa __pyx_string_tab[7522]
#define __pyx_kp_b_iso88591_A_a_q_a_A_7_3axs_axq_1_U_1_QfE_q __pyx_string_tab[7523]
#define __pyx_kp_b_iso88591_A_a_q_hauF_1_xq_fAQ_a_AT_s_1_q __pyx_string_tab[7524]
#define __pyx_kp_b_iso88591_A_a_y_q_a_6_HAWAWAQ_vS_j_Oq_5_wc __pyx_string_tab[7525]
#define __pyx_kp_b_iso88591_A_aq_aq_a_1D_c_AWAQ_xq __pyx_string_tab[7526]
#define __pyx_kp_b_iso88591_A_auA_T_Qa_2S_q_4q_Q_q __pyx_string_tab[7527]
#define __pyx_kp_b_iso88591_A_avQd __pyx_string_tab[7528]
#define __pyx_kp_b_iso88591_A_awat6 __pyx_string_tab[7529]
#define __pyx_kp_b_iso88591_A_awat6_q __pyx_string_tab[7530]
#define __pyx_kp_b_iso88591_A_d_1A_IQnA_s_q __pyx_string_tab[7531]
#define __pyx_kp_b_iso88591_A_e1A_a_0_RS __pyx_string_tab[7532]
#define __pyx_kp_b_iso88591_A_fAQ_a_1D_V1F_1 __pyx_string_tab[7533]
#define __pyx_kp_b_iso88591_A_fAQ_a_V1_q __pyx_string_tab[7534]
#define __pyx_kp_b_iso88591_A_fAQ_a_at5 __pyx_string_tab[7535]
#define __pyx_kp_b_iso88591_A_fAQ_a_q_E __pyx_string_tab[7536]
#define __pyx_kp_b_iso88591_A_fA_fAQ_5_a_1D_fD __pyx_string_tab[7537]
#define __pyx_kp_b_iso88591_A_fIS_1F_M_Q __pyx_string_tab[7538]
#define __pyx_kp_b_iso88591_A_ffoop_5_1_3d_A_V1D_at1_F_e5_3a __pyx_string_tab[7539]
#define __pyx_kp_b_iso88591_A_havQ_V1_g_a_6_q __pyx_string_tab[7540]
#define __pyx_kp_b_iso88591_A_iq_Q_V1_AT_awawaq_87_aq_87_aq __pyx_string_tab[7541]
#define __pyx_kp_b_iso88591_A_iq_havQ_V1_g_q_a_6_q __pyx_string_tab[7542]
#define __pyx_kp_b_iso88591_A_j_IQnA_s __pyx_string_tab[7543]
#define __pyx_kp_b_iso88591_A_k_A_a_AT_q_q_q_Qhe1HE __pyx_string_tab[7544]
#define __pyx_kp_b_iso88591_A_k_a_Qd_hawaxvXQa_hawaxvXQa_a __pyx_string_tab[7545]
#define __pyx_kp_b_iso88591_A_mKccllm_5_6_6_F_q_IQ_2_a_q_F_1 __pyx_string_tab[7546]
#define __pyx_kp_b_iso88591_A_q_1A_uAQ_a_e1_a_4uA __pyx_string_tab[7547]
#define __pyx_kp_b_iso88591_A_q_1IQa_a_q_E __pyx_string_tab[7548]
#define __pyx_kp_b_iso88591_A_q_1_2WF_1_2WF_9G1_vS_ha_vS_ha __pyx_string_tab[7549]
#define __pyx_kp_b_iso88591_A_q_1_a_AQ __pyx_string_tab[7550]
#define __pyx_kp_b_iso88591_A_q_1_a_AQ_2 __pyx_string_tab[7551]
#define __pyx_kp_b_iso88591_A_q_6_j_k_a_4vWA_a_V7 __pyx_string_tab[7552]
#define __pyx_kp_b_iso88591_A_q_7_vV1_4s_a_a_1A __pyx_string_tab[7553]
#define __pyx_kp_b_iso88591_A_q_HA_a_Q_6_a_Qa_9G1_y_1A_9AV1A __pyx_string_tab[7554]
#define __pyx_kp_b_iso88591_A_q_IQ_havQ_q_ay_az_hd_az_fA_a_4 __pyx_string_tab[7555]
#define __pyx_kp_b_iso88591_A_q_PPQ_1_A_Q_Q_A_ZqR_U_1_Q_U_q __pyx_string_tab[7556]
#define __pyx_kp_b_iso88591_A_q_Q_a_1D_Qd_1_G1D_q __pyx_string_tab[7557]
#define __pyx_kp_b_iso88591_A_q_a_1D_Qa_vQa __pyx_string_tab[7558]
#define __pyx_kp_b_iso88591_A_q_a_2_1A_q __pyx_string_tab[7559]
#define __pyx_kp_b_iso88591_A_q_a_4q_q_q_q_A_q __pyx_string_tab[7560]
#define __pyx_kp_b_iso88591_A_q_a_a_q_E_4q_Qat1AQ __pyx_string_tab[7561]
#define __pyx_kp_b_iso88591_A_q_a_fAQ_vQa __pyx_string_tab[7562]
#define __pyx_kp_b_iso88591_A_q_a_q_E_vQa __pyx_string_tab[7563]
#define __pyx_kp_b_iso88591_A_q_fA __pyx_string_tab[7564]
#define __pyx_kp_b_iso88591_A_q_j_k_a_4vWA __pyx_string_tab[7565]
#define __pyx_kp_b_iso88591_A_q_j_k_a_AT_xvV1_A __pyx_string_tab[7566]
#define __pyx_kp_b_iso88591_A_q_j_k_a_V7 __pyx_string_tab[7567]
#define __pyx_kp_b_iso88591_A_q_j_k_a_at6_vQ_a __pyx_string_tab[7568]
#define __pyx_kp_b_iso88591_A_q_j_k_a_at6_vQ_a_a_AT_xvV1_A __pyx_string_tab[7569]
#define __pyx_kp_b_iso88591_A_q_q_1_F_aq_87_aq_aq_U_1_e1A_av __pyx_string_tab[7570]
#define __pyx_kp_b_iso88591_A_q_q_E_XQd_4q_XQd_4q_AQc_A_AQ __pyx_string_tab[7571]
#define __pyx_kp_b_iso88591_A_q_q_Ya_9G1_y_1A_Qd_q_a_7_6_4AT __pyx_string_tab[7572]
#define __pyx_kp_b_iso88591_A_q_q_Yaq_V1A_S_a_gV6_AQ_a_AT_a __pyx_string_tab[7573]
#define __pyx_kp_b_iso88591_A_q_q_q_a_4q_A_q_q_E_q_vQe5_Q __pyx_string_tab[7574]
#define __pyx_kp_b_iso88591_A_q_t1_a_xq __pyx_string_tab[7575]
#define __pyx_kp_b_iso88591_A_q_vQa_vQa_vQa_Qm1A_2WF_a_4uG1F __pyx_string_tab[7576]
#define __pyx_kp_b_iso88591_A_q_y_0_6_F_6_F_5_a_IQk_a_q_F __pyx_string_tab[7577]
#define __pyx_kp_b_iso88591_A_q_y_1_2WF_WA_vS_ha_vS_ha_a_AT __pyx_string_tab[7578]
#define __pyx_kp_b_iso88591_A_q_y_1_2WF_q_vS_ha_vS_ha_V1_a_A __pyx_string_tab[7579]
#define __pyx_kp_b_iso88591_A_q_y_6_F_6_F_fA_IQ_q_a_q_E1A __pyx_string_tab[7580]
#define __pyx_kp_b_iso88591_A_q_y_6_F_6_F_wa_m6_4y_Cq_q_a_q __pyx_string_tab[7581]
#define __pyx_kp_b_iso88591_A_q_y_7_vS_gQ_vS_ha_xvQ_5Q_5Qd_q __pyx_string_tab[7582]
#define __pyx_kp_b_iso88591_A_q_y_7_vS_gQ_vS_ha_xvQ_6a_6at5 __pyx_string_tab[7583]
#define __pyx_kp_b_iso88591_A_q_y_7_vS_ha_vS_ha_xvQ_1D_Q_1D __pyx_string_tab[7584]
#define __pyx_kp_b_iso88591_A_q_y_87_vS_gQ_vS_ha_y_a_q_at5_a __pyx_string_tab[7585]
#define __pyx_kp_b_iso88591_A_q_y_87_vS_ha_vS_ha_y_a_AT_a_AT __pyx_string_tab[7586]
#define __pyx_kp_b_iso88591_A_q_y_87_vS_ha_vS_ha_y_a_q_E_q_E __pyx_string_tab[7587]
#define __pyx_kp_b_iso88591_A_q_y_9G1_2_uCvWA_vS_ha_V1_4vV1 __pyx_string_tab[7588]
#define __pyx_kp_b_iso88591_A_q_y_9G1_uCvWA_vS_ha_z_q_fN_fF __pyx_string_tab[7589]
#define __pyx_kp_b_iso88591_A_q_y_9G1_vS_ha_vS_ha_z_q_AT_oWA __pyx_string_tab[7590]
#define __pyx_kp_b_iso88591_A_q_y_9G1_vS_ha_vS_ha_z_q_AT_oWA_2 __pyx_string_tab[7591]
#define __pyx_kp_b_iso88591_A_q_y_F_6_F_6_F_fA_IQ_q_a_Qd_0_q __pyx_string_tab[7592]
#define __pyx_kp_b_iso88591_A_q_y_G1_vS_ha_vS_ha_q_2_AT_a_AT __pyx_string_tab[7593]
#define __pyx_kp_b_iso88591_A_q_y_V3c_F_Q __pyx_string_tab[7594]
#define __pyx_kp_b_iso88591_A_q_y_WA_oV1_uCvWA_vS_ha_KvQ_fAQ __pyx_string_tab[7595]
#define __pyx_kp_b_iso88591_A_q_y_WA_uCvWA_vS_ha_1_4v_G1_1_4 __pyx_string_tab[7596]
#define __pyx_kp_b_iso88591_A_q_y_gQ_vS_ha_vS_ha_6_4A_at5_at __pyx_string_tab[7597]
#define __pyx_kp_b_iso88591_A_q_y_q_vS_gQ_vS_ha_V1_a_U_U __pyx_string_tab[7598]
#define __pyx_kp_b_iso88591_A_q_y_q_vS_ha_vS_ha_V1_6a_0_U_0 __pyx_string_tab[7599]
#define __pyx_kp_b_iso88591_A_q_y_vS_ha_vS_ha_fA_q_e1_e1 __pyx_string_tab[7600]
#define __pyx_kp_b_iso88591_A_q_y_wa_vS_gQ_vS_ha_F_5Q_at5_at __pyx_string_tab[7601]
#define __pyx_kp_b_iso88591_A_q_y_wa_vS_gQ_vS_ha_F_6a_q_E_q __pyx_string_tab[7602]
#define __pyx_kp_b_iso88591_A_r_a_0_Zq_A_q __pyx_string_tab[7603]
#define __pyx_kp_b_iso88591_A_r_a_Zq_A_q __pyx_string_tab[7604]
#define __pyx_kp_b_iso88591_A_r_a_q_E_a_a_4q_q __pyx_string_tab[7605]
#define __pyx_kp_b_iso88591_A_t1_G9D_T_G1_a_AT_d_XTQXX_L __pyx_string_tab[7606]
#define __pyx_kp_b_iso88591_A_t5 __pyx_string_tab[7607]
#define __pyx_kp_b_iso88591_A_t5_2 __pyx_string_tab[7608]
#define __pyx_kp_b_iso88591_A_t6 __pyx_string_tab[7609]
#define __pyx_kp_b_iso88591_A_t9AQ __pyx_string_tab[7610]
#define __pyx_kp_b_iso88591_A_t9AQ_2 __pyx_string_tab[7611]
#define __pyx_kp_b_iso88591_A_t9AQ_3 __pyx_string_tab[7612]
#define __pyx_kp_b_iso88591_A_t9AQ_4 __pyx_string_tab[7613]
#define __pyx_kp_b_iso88591_A_t9AQ_IQnA_s_q __pyx_string_tab[7614]
#define __pyx_kp_b_iso88591_A_uAQ_uAQ_Qa_a_0_V881 __pyx_string_tab[7615]
#define __pyx_kp_b_iso88591_A_uE_e5_az_e1A_a_Qd_s_3aq_s_3aq __pyx_string_tab[7616]
#define __pyx_kp_b_iso88591_A_uE_e5_kYZ_a_Qd_q_a_q_E_Qc_Qc __pyx_string_tab[7617]
#define __pyx_kp_b_iso88591_A_uE_l_a_4q_A_q_Cq_1A_q_a_Qd_q __pyx_string_tab[7618]
#define __pyx_kp_b_iso88591_A_uE_l_a_Qd_q_a_U_3as_1_a_q_E_a __pyx_string_tab[7619]
#define __pyx_kp_b_iso88591_A_vQa __pyx_string_tab[7620]
#define __pyx_kp_b_iso88591_A_vQa_2 __pyx_string_tab[7621]
#define __pyx_kp_b_iso88591_A_wa_1_a_A_vQgV1D __pyx_string_tab[7622]
#define __pyx_kp_b_iso88591_A_wa_1_a_Q_vQgV1D __pyx_string_tab[7623]
#define __pyx_kp_b_iso88591_A_wavQ __pyx_string_tab[7624]
#define __pyx_kp_b_iso88591_A_xq_a __pyx_string_tab[7625]
#define __pyx_kp_b_iso88591_A_y_0_Q_5_vWIQfAQ_2S_T_3c_d_1Cs __pyx_string_tab[7626]
#define __pyx_kp_b_iso88591_A_y_0_Q_5_vWIQfAQ_2S_T_3c_d_1Cs_2 __pyx_string_tab[7627]
#define __pyx_kp_b_iso88591_A_y_1_Q_y_q_2S_T_3c_d_1Cs_at6_as __pyx_string_tab[7628]
#define __pyx_kp_b_iso88591_A_y_5_Q_AQ_AQ_wc_Qe1E_D_IT_7_t5 __pyx_string_tab[7629]
#define __pyx_kp_b_iso88591_A_y_8_AT_y_c __pyx_string_tab[7630]
#define __pyx_kp_b_iso88591_A_y_8_Qa_Zq_a_1D_c_q __pyx_string_tab[7631]
#define __pyx_kp_b_iso88591_A_y_8_Qa_Zq_a_V3avQfA __pyx_string_tab[7632]
#define __pyx_kp_b_iso88591_A_y_AT_vV86_A __pyx_string_tab[7633]
#define __pyx_kp_b_iso88591_A_y_AT_vV86_A_2 __pyx_string_tab[7634]
#define __pyx_kp_b_iso88591_A_y_AT_y_c __pyx_string_tab[7635]
#define __pyx_kp_b_iso88591_A_y_IQ_AQ_4vS_7_a __pyx_string_tab[7636]
#define __pyx_kp_b_iso88591_A_y_IQ_AQ_4vS_7_a_2 __pyx_string_tab[7637]
#define __pyx_kp_b_iso88591_A_y_Q_Q_5_vWIQfAQ_2S_T_3c_d_1Cs __pyx_string_tab[7638]
#define __pyx_kp_b_iso88591_A_y_Q_Q_5_vWIQfAQ_2S_T_3c_d_1Cs_2 __pyx_string_tab[7639]
#define __pyx_kp_b_iso88591_A_y_U_1_Zq_a_at6_s __pyx_string_tab[7640]
#define __pyx_kp_b_iso88591_A_y_U_1_Zq_a_q_F_6 __pyx_string_tab[7641]
#define __pyx_kp_b_iso88591_A_y_V3c_F_Q __pyx_string_tab[7642]
#define __pyx_kp_b_iso88591_A_y_V7 __pyx_string_tab[7643]
#define __pyx_kp_b_iso88591_A_y_aq_aq_Zq_a_1D_c_AWAV1 __pyx_string_tab[7644]
#define __pyx_kp_b_iso88591_A_y_aq_aq_Zq_a_F_QgS_q __pyx_string_tab[7645]
#define __pyx_kp_b_iso88591_A_y_q_IQgV1 __pyx_string_tab[7646]
#define __pyx_kp_b_iso88591_A_y_q_a_d_4q __pyx_string_tab[7647]
#define __pyx_kp_b_iso88591_BBTTU2_Qa_A_9L_6_HAWAYaq_1AXS_8 __pyx_string_tab[7648]
#define __pyx_kp_b_iso88591_BB_h_i_A_A_J_J_K_5_6_6_F_fA_IQ __pyx_string_tab[7649]
#define __pyx_kp_b_iso88591_BBppq0_Ba_HA_AZq_a_Qd_1_q_q __pyx_string_tab[7650]
#define __pyx_kp_b_iso88591_B_1_3az_a_XQgQe6_G9A_QfG4q_A_4s __pyx_string_tab[7651]
#define __pyx_kp_b_iso88591_B_1_A_l_1_7_Q_T_q_6_c_q_F_q_7_4 __pyx_string_tab[7652]
#define __pyx_kp_b_iso88591_B_fAQ_a_e6_q __pyx_string_tab[7653]
#define __pyx_kp_b_iso88591_C1_1M_1Jit1A_s_1_1_XQgQj_F_1_G9 __pyx_string_tab[7654]
#define __pyx_kp_b_iso88591_C1_1_1_81A_a_Qd __pyx_string_tab[7655]
#define __pyx_kp_b_iso88591_C1_b_b_a_U_iuD_QcQVVWWZZ_uA __pyx_string_tab[7656]
#define __pyx_kp_b_iso88591_C1_q_81A_a_q_E __pyx_string_tab[7657]
#define __pyx_kp_b_iso88591_C9A_3az_a_XQgQe6_G9A_QfG4q_A_4s __pyx_string_tab[7658]
#define __pyx_kp_b_iso88591_C9KWccllm_q_a_2WF_2WF_QfA_AT_E __pyx_string_tab[7659]
#define __pyx_kp_b_iso88591_C_yXY_5_F_6_F_V1_IQ_DA_a_6at5_g __pyx_string_tab[7660]
#define __pyx_kp_b_iso88591_C_yXY_5_F_6_F_V1_IQ_DA_a_U2YY_a __pyx_string_tab[7661]
#define __pyx_kp_b_iso88591_DA8_a_a_V1A_V1_q __pyx_string_tab[7662]
#define __pyx_kp_b_iso88591_DDVVW_1_0_q_7_Q_AQ_A_a_4vV81_q __pyx_string_tab[7663]
#define __pyx_kp_b_iso88591_DDYYkkttu_Cq_XQgQk_xq_A_hawa_k __pyx_string_tab[7664]
#define __pyx_kp_b_iso88591_DHFRS_uAQ_e1A_5_6_az_e6_a_U_s __pyx_string_tab[7665]
#define __pyx_kp_b_iso88591_DIQ_a __pyx_string_tab[7666]
#define __pyx_kp_b_iso88591_DI_Xddmmn_e1Cq_a_a_9E_A_Faq_E_a __pyx_string_tab[7667]
#define __pyx_kp_b_iso88591_EE_k_l_D_D_M_M_N_a_q_H_MQ_5_6_6 __pyx_string_tab[7668]
#define __pyx_kp_b_iso88591_FF__l_m_E_E_N_N_O_5_6_6_F_V1_IQ __pyx_string_tab[7669]
#define __pyx_kp_b_iso88591_F_1_uE_1_uCq_q_A_a_1_q_a_6_A_AQ __pyx_string_tab[7670]
#define __pyx_kp_b_iso88591_F_e1A_fAQ_Q_a_U_avQ_q __pyx_string_tab[7671]
#define __pyx_kp_b_iso88591_F_nIQ_havQ_A_ay_az_hd_az_fA_a_4 __pyx_string_tab[7672]
#define __pyx_kp_b_iso88591_F_nIQ_havQ_Q_axq_q_az_hd_ay_U_a __pyx_string_tab[7673]
#define __pyx_kp_b_iso88591_F_nIQ_havQ_a_az_hd_a_fA_a_4vWA __pyx_string_tab[7674]
#define __pyx_kp_b_iso88591_F_nIQ_havQ_az_az_hd_a_4wa_a_1D __pyx_string_tab[7675]
#define __pyx_kp_b_iso88591_F_vV1_uAQ_q_1_a_1D_X_a_az_AYaq __pyx_string_tab[7676]
#define __pyx_kp_b_iso88591_Fa_a_U __pyx_string_tab[7677]
#define __pyx_kp_b_iso88591_G1_Q_Q_a_az_fAXQd_AV6_PQ_a_4q_6 __pyx_string_tab[7678]
#define __pyx_kp_b_iso88591_GYY_a_N_10_a_a_q_Q_1_Rq_6_JfA_6 __pyx_string_tab[7679]
#define __pyx_kp_b_iso88591_G_Q_A_A_A_A_a_4vWF_AT_aq_y_5_WA __pyx_string_tab[7680]
#define __pyx_kp_b_iso88591_Gq_a_6at5_F_a_q __pyx_string_tab[7681]
#define __pyx_kp_b_iso88591_Gq_a_AT_fF_5_1 __pyx_string_tab[7682]
#define __pyx_kp_b_iso88591_Gq_a_q_F_we7_6QR __pyx_string_tab[7683]
#define __pyx_kp_b_iso88591_Gq_q_L_A_a_Qd_q_a_U_3as_1_Qhe1C __pyx_string_tab[7684]
#define __pyx_kp_b_iso88591_GyPQ_4wfJc_a_AT_c_s __pyx_string_tab[7685]
#define __pyx_kp_b_iso88591_GyPQ_Qa_A_6_xs_Cq_j_a_q_Cxy_5_q __pyx_string_tab[7686]
#define __pyx_kp_b_iso88591_GyPQ_fAQ_Qm1A_2WF_a_1D_V1F_a __pyx_string_tab[7687]
#define __pyx_kp_b_iso88591_HA2_iq_uAQ_uAQ_a_q_E_uAXU_1 __pyx_string_tab[7688]
#define __pyx_kp_b_iso88591_HA_5_z_a_Qd_q_r_7_b_Q_Q_a_1D_T __pyx_string_tab[7689]
#define __pyx_kp_b_iso88591_HA_5_z_a_Qd_q_r_7_b_Q_Q_a_U_aq __pyx_string_tab[7690]
#define __pyx_kp_b_iso88591_HA_IQnA_7_7_AT_q_AT __pyx_string_tab[7691]
#define __pyx_kp_b_iso88591_HA_Q_IQk_a_U_vQa __pyx_string_tab[7692]
#define __pyx_kp_b_iso88591_HA_Qa_a_at5 __pyx_string_tab[7693]
#define __pyx_kp_b_iso88591_HA_U_1_a_at5 __pyx_string_tab[7694]
#define __pyx_kp_b_iso88591_HA_U_1_a_at7 __pyx_string_tab[7695]
#define __pyx_kp_b_iso88591_HA_U_1_a_e1 __pyx_string_tab[7696]
#define __pyx_kp_b_iso88591_HA_U_1_a_q_E __pyx_string_tab[7697]
#define __pyx_kp_b_iso88591_HA_U_1_a_q_E_2 __pyx_string_tab[7698]
#define __pyx_kp_b_iso88591_HA_a_Qd_waq_7_a_3a_q __pyx_string_tab[7699]
#define __pyx_kp_b_iso88591_HA_a_a_WAT_Qa_a_a_4vT_Qa_vQa __pyx_string_tab[7700]
#define __pyx_kp_b_iso88591_HA_a_fE __pyx_string_tab[7701]
#define __pyx_kp_b_iso88591_HA_aq_a_4z __pyx_string_tab[7702]
#define __pyx_kp_b_iso88591_HA_aq_r_a_4z_1D_q __pyx_string_tab[7703]
#define __pyx_kp_b_iso88591_HA_e1A_a_1D_Q __pyx_string_tab[7704]
#define __pyx_kp_b_iso88591_HA_iq_uAQ_a_1D_XQgQa_uAXU_1 __pyx_string_tab[7705]
#define __pyx_kp_b_iso88591_HA_uAQ_4q_a_gXQfA_a_6_q __pyx_string_tab[7706]
#define __pyx_kp_b_iso88591_HA_uAQ_Q_a_V81A_vQa __pyx_string_tab[7707]
#define __pyx_kp_b_iso88591_HA_uAQ_Qa_a_AT_xq __pyx_string_tab[7708]
#define __pyx_kp_b_iso88591_HA_uAQ_a_q_E __pyx_string_tab[7709]
#define __pyx_kp_b_iso88591_HA_uAQ_q_a_1D_XQa_uAQ __pyx_string_tab[7710]
#define __pyx_kp_b_iso88591_HA_uAQ_uAQ_a_Zxq __pyx_string_tab[7711]
#define __pyx_kp_b_iso88591_HA_uA_7q_a_fHAQ_uAQ __pyx_string_tab[7712]
#define __pyx_kp_b_iso88591_H_6_q_AV6_Qa_q_S_6_1_1A_1E_1E_l __pyx_string_tab[7713]
#define __pyx_kp_b_iso88591_H_QR_fAQ_a_5Qd_q __pyx_string_tab[7714]
#define __pyx_kp_b_iso88591_H_Tmmz_S_S_Q_2WF_5_6_6_F_a_IQ_a __pyx_string_tab[7715]
#define __pyx_kp_b_iso88591_H_a_Qd_vV9E_A __pyx_string_tab[7716]
#define __pyx_kp_b_iso88591_IQ_1_81A_a_AT __pyx_string_tab[7717]
#define __pyx_kp_b_iso88591_IQ_6_F_AT_U_1_a_84q_1_a_4wfA_a __pyx_string_tab[7718]
#define __pyx_kp_b_iso88591_IQ_81A_a_4vQ __pyx_string_tab[7719]
#define __pyx_kp_b_iso88591_IQ_a __pyx_string_tab[7720]
#define __pyx_kp_b_iso88591_IQ_a_0_T __pyx_string_tab[7721]
#define __pyx_kp_b_iso88591_IQ_a_AT_Q __pyx_string_tab[7722]
#define __pyx_kp_b_iso88591_IQ_a_a_1D_q __pyx_string_tab[7723]
#define __pyx_kp_b_iso88591_IQ_a_a_Qd __pyx_string_tab[7724]
#define __pyx_kp_b_iso88591_IQ_a_a_e1 __pyx_string_tab[7725]
#define __pyx_kp_b_iso88591_IQ_fAQ_a_U __pyx_string_tab[7726]
#define __pyx_kp_b_iso88591_IQ_fAQ_a_U_2 __pyx_string_tab[7727]
#define __pyx_kp_b_iso88591_IQ_fAQ_a_q_E __pyx_string_tab[7728]
#define __pyx_kp_b_iso88591_IQ_q __pyx_string_tab[7729]
#define __pyx_kp_b_iso88591_IQk_a_4wa __pyx_string_tab[7730]
#define __pyx_kp_b_iso88591_IQk_a_at7 __pyx_string_tab[7731]
#define __pyx_kp_b_iso88591_IQnA __pyx_string_tab[7732]
#define __pyx_kp_b_iso88591_IQnA_2 __pyx_string_tab[7733]
#define __pyx_kp_b_iso88591_IQnA_3 __pyx_string_tab[7734]
#define __pyx_kp_b_iso88591_IUV2_q_q_q_q_5_1_q_a_U_q_F_1_5 __pyx_string_tab[7735]
#define __pyx_kp_b_iso88591_IUbbhhi_uAQ_e1A_s_5_6_az_e6_a_U __pyx_string_tab[7736]
#define __pyx_kp_b_iso88591_IXQ_E_E_a_q_E_a __pyx_string_tab[7737]
#define __pyx_kp_b_iso88591_I_P_eef_q_a_2WF_2WF_QfA_Qd_U_vQ __pyx_string_tab[7738]
#define __pyx_kp_b_iso88591_I_RS_a_hat7_s_e3a_QgQk_a_q_E_A __pyx_string_tab[7739]
#define __pyx_kp_b_iso88591_I_a_1D_WF_yPQ_q __pyx_string_tab[7740]
#define __pyx_kp_b_iso88591_J_Rq_a_AT_gV_eSTTVVW_q __pyx_string_tab[7741]
#define __pyx_kp_b_iso88591_Ja_fAQ_a_4wa __pyx_string_tab[7742]
#define __pyx_kp_b_iso88591_Ja_uAQ_fAQ_a_at6 __pyx_string_tab[7743]
#define __pyx_kp_b_iso88591_Jha_uA_E_a_AT_81 __pyx_string_tab[7744]
#define __pyx_kp_b_iso88591_K_9_5_z_a_Qd_q_r_7_b_q_q_xq_awa __pyx_string_tab[7745]
#define __pyx_kp_b_iso88591_K_IQ_e1A_fAQ_a_2WF_5_1_U_1_ay_U __pyx_string_tab[7746]
#define __pyx_kp_b_iso88591_Kddq_r_J_J_S_S_T_Q_2WF_5_6_6_F __pyx_string_tab[7747]
#define __pyx_kp_b_iso88591_LA_uAQ_a_at5 __pyx_string_tab[7748]
#define __pyx_kp_b_iso88591_LXggu_v_C_C_L_L_M_q_7_y_aq_7_y __pyx_string_tab[7749]
#define __pyx_kp_b_iso88591_L_2_WW_a0_Q_2WF_Q_2WF_5_6_6_F_9 __pyx_string_tab[7750]
#define __pyx_kp_b_iso88591_L_HA_uA_6e1A_y_q_a_U __pyx_string_tab[7751]
#define __pyx_kp_b_iso88591_L_XQ_uAQ_uAQ_Qa_a_fHHA __pyx_string_tab[7752]
#define __pyx_kp_b_iso88591_L_uAQ_uAQ_q_a_fHHAQ_uAQ __pyx_string_tab[7753]
#define __pyx_kp_b_iso88591_MQ_11H_a_a_e1A_a_4uE_7_TYY_ddii __pyx_string_tab[7754]
#define __pyx_kp_b_iso88591_M_2_a_Qd __pyx_string_tab[7755]
#define __pyx_kp_b_iso88591_M_5_q_Qd_a_at1 __pyx_string_tab[7756]
#define __pyx_kp_b_iso88591_M_A_a_AT_a __pyx_string_tab[7757]
#define __pyx_kp_b_iso88591_M_Qa_Qa_a_1D_Ya_q __pyx_string_tab[7758]
#define __pyx_kp_b_iso88591_M_Xaab_4A_6_ivQa_6_ivQa_a_fHA __pyx_string_tab[7759]
#define __pyx_kp_b_iso88591_M_a_1D_Q __pyx_string_tab[7760]
#define __pyx_kp_b_iso88591_M_a_A_1_1_a_4uHAU_hawauAU_D_aq __pyx_string_tab[7761]
#define __pyx_kp_b_iso88591_M_d_1_vS_az_e6 __pyx_string_tab[7762]
#define __pyx_kp_b_iso88591_M_uAQ_Qa_a_fHA __pyx_string_tab[7763]
#define __pyx_kp_b_iso88591_M_vQd_ivQ __pyx_string_tab[7764]
#define __pyx_kp_b_iso88591_N_1_A_A_2WF_2WF_ay_WE __pyx_string_tab[7765]
#define __pyx_kp_b_iso88591_N_1_q_a_t5_Q_ay_U_1_Zq_a_q __pyx_string_tab[7766]
#define __pyx_kp_b_iso88591_N_5_aq_5_a_q_E_Zq __pyx_string_tab[7767]
#define __pyx_kp_b_iso88591_Na_a_AT_fF_5_sRS __pyx_string_tab[7768]
#define __pyx_kp_b_iso88591_Na_a_U_wfIUV_q __pyx_string_tab[7769]
#define __pyx_kp_b_iso88591_O1_Q_a_Qd_q __pyx_string_tab[7770]
#define __pyx_kp_b_iso88591_O1_Q_y_q_a_Qd __pyx_string_tab[7771]
#define __pyx_kp_b_iso88591_O1_Q_y_q_a_V1 __pyx_string_tab[7772]
#define __pyx_kp_b_iso88591_O1_uAQ_axq_E __pyx_string_tab[7773]
#define __pyx_kp_b_iso88591_O9TU_Qa_A_a_4uI __pyx_string_tab[7774]
#define __pyx_kp_b_iso88591_OOhhu_v_N_N_W_W_X_S_V3Na_1_uCvW __pyx_string_tab[7775]
#define __pyx_kp_b_iso88591_O_R_mmy_z_I_I_U_U_d_d_s_s_I_I __pyx_string_tab[7776]
#define __pyx_kp_b_iso88591_O_g_h_A_A_N_N_f_f_o_o_p_Q_2WF_Q __pyx_string_tab[7777]
#define __pyx_kp_b_iso88591_Oq_a_Qd_vV9E_5PSST __pyx_string_tab[7778]
#define __pyx_kp_b_iso88591_Oq_j_Q_a_Qd_q_XQgQj_F_1_G9A_6_u __pyx_string_tab[7779]
#define __pyx_kp_b_iso88591_OwVW_5Qa_q_a_at5_L_l_a __pyx_string_tab[7780]
#define __pyx_kp_b_iso88591_PPQ_87_q_D___eef_Q_Q __pyx_string_tab[7781]
#define __pyx_kp_b_iso88591_PPWWX_5Qa_q_a_q_E_1Kq __pyx_string_tab[7782]
#define __pyx_kp_b_iso88591_PPYYZ_A_A_5_A_s_gT_q_7q_G_QUUVV __pyx_string_tab[7783]
#define __pyx_kp_b_iso88591_PP_u_v_C_C_d_d_e_Q_2WF_5_6_6_F __pyx_string_tab[7784]
#define __pyx_kp_b_iso88591_QQR_1_0_q_7_Q_AQ_A_a_Qd_ha_q __pyx_string_tab[7785]
#define __pyx_kp_b_iso88591_QQXXY0_5Qa_q_a_U_l_1_A __pyx_string_tab[7786]
#define __pyx_kp_b_iso88591_QQZZ_2_q_4wa_c_a_q_6_V3fCvYVWWX __pyx_string_tab[7787]
#define __pyx_kp_b_iso88591_QV_a_a_2WF_1_2WF_1_axq_F __pyx_string_tab[7788]
#define __pyx_kp_b_iso88591_Q_0q_a_AT_q __pyx_string_tab[7789]
#define __pyx_kp_b_iso88591_Q_1_Q_Qd_q_1A_QgQaq_D_xq_9AQ_q __pyx_string_tab[7790]
#define __pyx_kp_b_iso88591_Q_1_Q_U_3aq_QgQaq_D_xq_9AQ_q __pyx_string_tab[7791]
#define __pyx_kp_b_iso88591_Q_1_a_0_U_1_vQa __pyx_string_tab[7792]
#define __pyx_kp_b_iso88591_Q_1_a_1D_Q __pyx_string_tab[7793]
#define __pyx_kp_b_iso88591_Q_1_a_Qd_1A_uAQ __pyx_string_tab[7794]
#define __pyx_kp_b_iso88591_Q_1_a_U_6_q __pyx_string_tab[7795]
#define __pyx_kp_b_iso88591_Q_1_a_V2U_1_uAQ __pyx_string_tab[7796]
#define __pyx_kp_b_iso88591_Q_1_q_a_q_F_5_1_G9A_1Baq_q __pyx_string_tab[7797]
#define __pyx_kp_b_iso88591_Q_4A_1_a_A_F_7_7_Qa_y_auAU_7_4w __pyx_string_tab[7798]
#define __pyx_kp_b_iso88591_Q_4t1Cs_q_q_a_at4q_AQ_uAQ __pyx_string_tab[7799]
#define __pyx_kp_b_iso88591_Q_5_q_a_U_a __pyx_string_tab[7800]
#define __pyx_kp_b_iso88591_Q_6_gU_1_4t9AQ_AQ_az_e6_a_at5_a __pyx_string_tab[7801]
#define __pyx_kp_b_iso88591_Q_7_a_at6_a_at6_Q_a_Qd_gQaq_A_j __pyx_string_tab[7802]
#define __pyx_kp_b_iso88591_Q_8_a_U_uA_5 __pyx_string_tab[7803]
#define __pyx_kp_b_iso88591_Q_A_A_a_e1F_auAQ_6_Qd_gYa_Q_G9A __pyx_string_tab[7804]
#define __pyx_kp_b_iso88591_Q_A_a_AT_aq_y __pyx_string_tab[7805]
#define __pyx_kp_b_iso88591_Q_A_a_Qd_az_STTU_waxq_j_q_a __pyx_string_tab[7806]
#define __pyx_kp_b_iso88591_Q_A_a_e1A_uAQ __pyx_string_tab[7807]
#define __pyx_kp_b_iso88591_Q_A_az_e1A_a_at1_aq_aq_aq_uAQe1 __pyx_string_tab[7808]
#define __pyx_kp_b_iso88591_Q_E_E_F_a_a_WAT_Qa_3c_Yaq_XS_y __pyx_string_tab[7809]
#define __pyx_kp_b_iso88591_Q_Q_A_a_1D_fAV1G1G6QR_awfAXV1A __pyx_string_tab[7810]
#define __pyx_kp_b_iso88591_Q_Q_A_a_Qd_q_a_Qd_q_AV1Cq_D_y_G __pyx_string_tab[7811]
#define __pyx_kp_b_iso88591_Q_Q_V1_4uCq_Qe1A_9AV1D_awat6_q __pyx_string_tab[7812]
#define __pyx_kp_b_iso88591_Q_Q_V1_4uCq_Qe1A_q_c_FBUUVVZZ_a __pyx_string_tab[7813]
#define __pyx_kp_b_iso88591_Q_Q_V1_4vS_Qe1A_81F_4q_avQd_q_q __pyx_string_tab[7814]
#define __pyx_kp_b_iso88591_Q_Q_a_6_q_az_hd_q __pyx_string_tab[7815]
#define __pyx_kp_b_iso88591_Q_Q_a_AT_aq_uAQ __pyx_string_tab[7816]
#define __pyx_kp_b_iso88591_Q_Q_a_Qd __pyx_string_tab[7817]
#define __pyx_kp_b_iso88591_Q_Q_a_Qd_uAQ __pyx_string_tab[7818]
#define __pyx_kp_b_iso88591_Q_Q_a_U_1_az_hd __pyx_string_tab[7819]
#define __pyx_kp_b_iso88591_Q_Rq_a_e6_q_q __pyx_string_tab[7820]
#define __pyx_kp_b_iso88591_Q_S_1_a_AT_q_q_F_PQ_a_1A_a_4q_I __pyx_string_tab[7821]
#define __pyx_kp_b_iso88591_Q_S_S_a_at7_1F_1F_a_1A_a_1A_t9A __pyx_string_tab[7822]
#define __pyx_kp_b_iso88591_Q_S_a_AT_aq_a_1A_q __pyx_string_tab[7823]
#define __pyx_kp_b_iso88591_Q_S_a_AT_aq_a_1A_q_2 __pyx_string_tab[7824]
#define __pyx_kp_b_iso88591_Q_S_a_a_at7_1F_5_a_1A_t9AQ_9G1 __pyx_string_tab[7825]
#define __pyx_kp_b_iso88591_Q_U_1_U_1_a_q_F_avQ_a_6_q __pyx_string_tab[7826]
#define __pyx_kp_b_iso88591_Q_U_1_a_1D_t1D_a_4q_q __pyx_string_tab[7827]
#define __pyx_kp_b_iso88591_Q_a_1D_q_83fG1_Ya __pyx_string_tab[7828]
#define __pyx_kp_b_iso88591_Q_a_1D_q_uAQ __pyx_string_tab[7829]
#define __pyx_kp_b_iso88591_Q_a_1D_q_uAQ_2 __pyx_string_tab[7830]
#define __pyx_kp_b_iso88591_Q_a_1_l __pyx_string_tab[7831]
#define __pyx_kp_b_iso88591_Q_a_31D_S __pyx_string_tab[7832]
#define __pyx_kp_b_iso88591_Q_a_4vQa_83fG1_Ya __pyx_string_tab[7833]
#define __pyx_kp_b_iso88591_Q_a_4vQa_83fG1_Ya_2 __pyx_string_tab[7834]
#define __pyx_kp_b_iso88591_Q_a_4vQfA_a_6_q __pyx_string_tab[7835]
#define __pyx_kp_b_iso88591_Q_a_AT __pyx_string_tab[7836]
#define __pyx_kp_b_iso88591_Q_a_AT_2 __pyx_string_tab[7837]
#define __pyx_kp_b_iso88591_Q_a_AT_3 __pyx_string_tab[7838]
#define __pyx_kp_b_iso88591_Q_a_AT_4 __pyx_string_tab[7839]
#define __pyx_kp_b_iso88591_Q_a_AT_AQ_uAQ __pyx_string_tab[7840]
#define __pyx_kp_b_iso88591_Q_a_AT_AV1_a_6_q __pyx_string_tab[7841]
#define __pyx_kp_b_iso88591_Q_a_AT_aq_uAQ __pyx_string_tab[7842]
#define __pyx_kp_b_iso88591_Q_a_AT_q __pyx_string_tab[7843]
#define __pyx_kp_b_iso88591_Q_a_AT_q_q __pyx_string_tab[7844]
#define __pyx_kp_b_iso88591_Q_a_AT_vQa __pyx_string_tab[7845]
#define __pyx_kp_b_iso88591_Q_a_Qd __pyx_string_tab[7846]
#define __pyx_kp_b_iso88591_Q_a_Qd_2 __pyx_string_tab[7847]
#define __pyx_kp_b_iso88591_Q_a_Qd_3 __pyx_string_tab[7848]
#define __pyx_kp_b_iso88591_Q_a_Qd_q __pyx_string_tab[7849]
#define __pyx_kp_b_iso88591_Q_a_Qd_q_2 __pyx_string_tab[7850]
#define __pyx_kp_b_iso88591_Q_a_Qd_q_3 __pyx_string_tab[7851]
#define __pyx_kp_b_iso88591_Q_a_Qd_q_4 __pyx_string_tab[7852]
#define __pyx_kp_b_iso88591_Q_a_Qd_q_5 __pyx_string_tab[7853]
#define __pyx_kp_b_iso88591_Q_a_Qd_q_y __pyx_string_tab[7854]
#define __pyx_kp_b_iso88591_Q_a_Qd_r __pyx_string_tab[7855]
#define __pyx_kp_b_iso88591_Q_a_Qd_uAQ __pyx_string_tab[7856]
#define __pyx_kp_b_iso88591_Q_a_Qd_y __pyx_string_tab[7857]
#define __pyx_kp_b_iso88591_Q_a_Qd_y_2 __pyx_string_tab[7858]
#define __pyx_kp_b_iso88591_Q_a_U_1_y __pyx_string_tab[7859]
#define __pyx_kp_b_iso88591_Q_a_U_E_q __pyx_string_tab[7860]
#define __pyx_kp_b_iso88591_Q_a_V1A_q __pyx_string_tab[7861]
#define __pyx_kp_b_iso88591_Q_a_V1A_y __pyx_string_tab[7862]
#define __pyx_kp_b_iso88591_Q_a_a __pyx_string_tab[7863]
#define __pyx_kp_b_iso88591_Q_a_a_1D_aq_vQa __pyx_string_tab[7864]
#define __pyx_kp_b_iso88591_Q_a_a_4vQfF_vQa __pyx_string_tab[7865]
#define __pyx_kp_b_iso88591_Q_a_a_AT_aq_vQa __pyx_string_tab[7866]
#define __pyx_kp_b_iso88591_Q_a_a_AT_s_vQa __pyx_string_tab[7867]
#define __pyx_kp_b_iso88591_Q_a_a_Qd_q __pyx_string_tab[7868]
#define __pyx_kp_b_iso88591_Q_a_a_avQd_q_QgV1A __pyx_string_tab[7869]
#define __pyx_kp_b_iso88591_Q_a_a_e1A_uAQ __pyx_string_tab[7870]
#define __pyx_kp_b_iso88591_Q_a_a_q __pyx_string_tab[7871]
#define __pyx_kp_b_iso88591_Q_a_at5 __pyx_string_tab[7872]
#define __pyx_kp_b_iso88591_Q_a_at5_uAQ __pyx_string_tab[7873]
#define __pyx_kp_b_iso88591_Q_a_at6_A __pyx_string_tab[7874]
#define __pyx_kp_b_iso88591_Q_a_d_4q_A_q __pyx_string_tab[7875]
#define __pyx_kp_b_iso88591_Q_a_e1A_83fG1_Ya __pyx_string_tab[7876]
#define __pyx_kp_b_iso88591_Q_a_e1A_a_AT_fA_uARvQd_5_at1A __pyx_string_tab[7877]
#define __pyx_kp_b_iso88591_Q_a_e6 __pyx_string_tab[7878]
#define __pyx_kp_b_iso88591_Q_a_fAQ_1A_ay_xq_Q __pyx_string_tab[7879]
#define __pyx_kp_b_iso88591_Q_a_fAQ_uAQ __pyx_string_tab[7880]
#define __pyx_kp_b_iso88591_Q_a_fAQ_uAQ_2 __pyx_string_tab[7881]
#define __pyx_kp_b_iso88591_Q_a_gQa_uAQ __pyx_string_tab[7882]
#define __pyx_kp_b_iso88591_Q_a_gQa_uAQ_2 __pyx_string_tab[7883]
#define __pyx_kp_b_iso88591_Q_a_gQa_vQa __pyx_string_tab[7884]
#define __pyx_kp_b_iso88591_Q_a_gV1A __pyx_string_tab[7885]
#define __pyx_kp_b_iso88591_Q_a_q_E_axvQhfAQ __pyx_string_tab[7886]
#define __pyx_kp_b_iso88591_Q_a_q_F_6 __pyx_string_tab[7887]
#define __pyx_kp_b_iso88591_Q_a_q_HAT_a_4q_q __pyx_string_tab[7888]
#define __pyx_kp_b_iso88591_Q_avQd __pyx_string_tab[7889]
#define __pyx_kp_b_iso88591_Q_avQd_vQ __pyx_string_tab[7890]
#define __pyx_kp_b_iso88591_Q_avQd_vQ_q __pyx_string_tab[7891]
#define __pyx_kp_b_iso88591_Q_avQd_xq __pyx_string_tab[7892]
#define __pyx_kp_b_iso88591_Q_awat5_q __pyx_string_tab[7893]
#define __pyx_kp_b_iso88591_Q_axq_F_6 __pyx_string_tab[7894]
#define __pyx_kp_b_iso88591_Q_ay_U_4q_a_4q_q __pyx_string_tab[7895]
#define __pyx_kp_b_iso88591_Q_az_gQd_a_4q_q __pyx_string_tab[7896]
#define __pyx_kp_b_iso88591_Q_d_5_a_AT_as_a_3a_q __pyx_string_tab[7897]
#define __pyx_kp_b_iso88591_Q_d_5_a_AT_as_a_3a_q_2 __pyx_string_tab[7898]
#define __pyx_kp_b_iso88591_Q_e1A_fAQ_a_4wfA __pyx_string_tab[7899]
#define __pyx_kp_b_iso88591_Q_e1A_fAQ_a_a_Qd_fAQ_q __pyx_string_tab[7900]
#define __pyx_kp_b_iso88591_Q_fAQ_a_1D_Q __pyx_string_tab[7901]
#define __pyx_kp_b_iso88591_Q_fAQ_a_AT_fAV1A __pyx_string_tab[7902]
#define __pyx_kp_b_iso88591_Q_fAQ_a_AT_q __pyx_string_tab[7903]
#define __pyx_kp_b_iso88591_Q_k_a_Qd_uAXU_1 __pyx_string_tab[7904]
#define __pyx_kp_b_iso88591_Q_q_a_AT_aq_uAQ __pyx_string_tab[7905]
#define __pyx_kp_b_iso88591_Q_q_a_AT_aq_vQa __pyx_string_tab[7906]
#define __pyx_kp_b_iso88591_Q_q_a_Qd_at1A_uAQ __pyx_string_tab[7907]
#define __pyx_kp_b_iso88591_Q_q_a_U __pyx_string_tab[7908]
#define __pyx_kp_b_iso88591_Q_q_a_at6 __pyx_string_tab[7909]
#define __pyx_kp_b_iso88591_Q_q_a_q_E_y __pyx_string_tab[7910]
#define __pyx_kp_b_iso88591_Q_q_l_Yj_a_Q_q_1_WAWAXQa_e1A_fA __pyx_string_tab[7911]
#define __pyx_kp_b_iso88591_Q_s_a_Qd_A_a_3a_q __pyx_string_tab[7912]
#define __pyx_kp_b_iso88591_Q_s_a_Qd_A_a_3a_q_2 __pyx_string_tab[7913]
#define __pyx_kp_b_iso88591_Q_s_a_Qd_F_a_3a_t9AQ_Q __pyx_string_tab[7914]
#define __pyx_kp_b_iso88591_Q_s_a_at7_3a_a_3a_q __pyx_string_tab[7915]
#define __pyx_kp_b_iso88591_Q_t1E_a_Qd_A_a_3a_q __pyx_string_tab[7916]
#define __pyx_kp_b_iso88591_Q_t9AQ __pyx_string_tab[7917]
#define __pyx_kp_b_iso88591_Q_t9AQ_2 __pyx_string_tab[7918]
#define __pyx_kp_b_iso88591_Q_y_q_a_Qd_waq_uAQ __pyx_string_tab[7919]
#define __pyx_kp_b_iso88591_Qa_Qa_a_AT_vQ __pyx_string_tab[7920]
#define __pyx_kp_b_iso88591_Qa_a_1D_Q __pyx_string_tab[7921]
#define __pyx_kp_b_iso88591_Qa_a_AT_iq __pyx_string_tab[7922]
#define __pyx_kp_b_iso88591_Qa_a_Qd_a __pyx_string_tab[7923]
#define __pyx_kp_b_iso88591_Qe1_a_AT_d_A_q __pyx_string_tab[7924]
#define __pyx_kp_b_iso88591_Qhb_z_1_Qhb_z_1_Qhb_z_1_a_AT_vQ __pyx_string_tab[7925]
#define __pyx_kp_b_iso88591_RRS_fAQ_a_4uF_6_V7_A __pyx_string_tab[7926]
#define __pyx_kp_b_iso88591_RRYYZ_5Qa_q_a_e7_1A_Qk __pyx_string_tab[7927]
#define __pyx_kp_b_iso88591_RRkkx_y_Q_Q_Z_Z_a_4x_VW_5_6_6_F __pyx_string_tab[7928]
#define __pyx_kp_b_iso88591_Rq_a_1D_Qb_a_2Q_q __pyx_string_tab[7929]
#define __pyx_kp_b_iso88591_Rq_a_U_2Q_a_2Q_q __pyx_string_tab[7930]
#define __pyx_kp_b_iso88591_Rq_q_a_q_E_Qb_a_2Q_q __pyx_string_tab[7931]
#define __pyx_kp_b_iso88591_SST_Q_5Zq_1A_a_9G2_K1A_G9A_aq_Q __pyx_string_tab[7932]
#define __pyx_kp_b_iso88591_SSggh_xq_q_xq_aq_a_xq_6_a_q_E __pyx_string_tab[7933]
#define __pyx_kp_b_iso88591_S_1_a_q_E_6_6_q_a_1HF_aq_t9AQ_3 __pyx_string_tab[7934]
#define __pyx_kp_b_iso88591_S_a_1_fAQfF_a_1A_T_1_1 __pyx_string_tab[7935]
#define __pyx_kp_b_iso88591_S_a_4vQiq_a_9A_q __pyx_string_tab[7936]
#define __pyx_kp_b_iso88591_S_a_U_1A_a_1A_q __pyx_string_tab[7937]
#define __pyx_kp_b_iso88591_S_a_q_E_1_a_1A_q __pyx_string_tab[7938]
#define __pyx_kp_b_iso88591_S_a_q_E_6_q_a_1A_t9AQ_1 __pyx_string_tab[7939]
#define __pyx_kp_b_iso88591_S_a_q_F_1F_a_1A_4y_1 __pyx_string_tab[7940]
#define __pyx_kp_b_iso88591_TTU_5Qa_a_q_E_1A __pyx_string_tab[7941]
#define __pyx_kp_b_iso88591_T_aq __pyx_string_tab[7942]
#define __pyx_kp_b_iso88591_UUV_5Qa_a_U_l_1_AQ __pyx_string_tab[7943]
#define __pyx_kp_b_iso88591_UUV_5_a_q_E_1_A_a_F_1_9AV1A_HAW __pyx_string_tab[7944]
#define __pyx_kp_b_iso88591_UUV_Rq_a_Qe5_E_UR_bbcceef_q __pyx_string_tab[7945]
#define __pyx_kp_b_iso88591_UUbbz_D_D_E_83fA_iq_6_F_6_F_s_V __pyx_string_tab[7946]
#define __pyx_kp_b_iso88591_U_1_a_1D_Q __pyx_string_tab[7947]
#define __pyx_kp_b_iso88591_U_1_a_1_a_ay_V6_7_7_7_7_a_AT_vQ __pyx_string_tab[7948]
#define __pyx_kp_b_iso88591_U_1_a_AT_A __pyx_string_tab[7949]
#define __pyx_kp_b_iso88591_U_1_a_Qd_q __pyx_string_tab[7950]
#define __pyx_kp_b_iso88591_U_1_a_Qd_q_uAQ __pyx_string_tab[7951]
#define __pyx_kp_b_iso88591_U_1_a_at6 __pyx_string_tab[7952]
#define __pyx_kp_b_iso88591_U_1_a_e1 __pyx_string_tab[7953]
#define __pyx_kp_b_iso88591_U_1_a_q_E_q_y __pyx_string_tab[7954]
#define __pyx_kp_b_iso88591_U_1_az_e1 __pyx_string_tab[7955]
#define __pyx_kp_b_iso88591_U_1_q_XQgQj_F_1_a_e3a_a_a_G9A_A __pyx_string_tab[7956]
#define __pyx_kp_b_iso88591_U_1_y_q_a_AT_fA __pyx_string_tab[7957]
#define __pyx_kp_b_iso88591_U___E_A_nHAYa_A_4s_Cq_3e3fHA_a __pyx_string_tab[7958]
#define __pyx_kp_b_iso88591_V1A_a_at6 __pyx_string_tab[7959]
#define __pyx_kp_b_iso88591_V1A_a_at6_2 __pyx_string_tab[7960]
#define __pyx_kp_b_iso88591_V3c_F_Q __pyx_string_tab[7961]
#define __pyx_kp_b_iso88591_V6_fAQ_e1A_a_WF __pyx_string_tab[7962]
#define __pyx_kp_b_iso88591_VVW_5Qa_a_e7_1A_Qa __pyx_string_tab[7963]
#define __pyx_kp_b_iso88591_VVW_a_1D_WF_wfT_q __pyx_string_tab[7964]
#define __pyx_kp_b_iso88591_WA_a_1D_Qe1_1E_q __pyx_string_tab[7965]
#define __pyx_kp_b_iso88591_WA_a_Qd_q_Q_a_5_q __pyx_string_tab[7966]
#define __pyx_kp_b_iso88591_WJa_avU __pyx_string_tab[7967]
#define __pyx_kp_b_iso88591_WJa_fAQ_a_1D_a __pyx_string_tab[7968]
#define __pyx_kp_b_iso88591_WWX_5Qa_a_4uG_AQ_aq __pyx_string_tab[7969]
#define __pyx_kp_b_iso88591_WW_a_5_z_a_Qd_q_r_7_b_q_q_xq_aw __pyx_string_tab[7970]
#define __pyx_kp_b_iso88591_WWee_N_N_W_W_X_q_q_a_AT_fF_9GSY __pyx_string_tab[7971]
#define __pyx_kp_b_iso88591_W_H_a_a_at7_6_G4_2Ya __pyx_string_tab[7972]
#define __pyx_kp_b_iso88591_W_wjPQ_A_A_A_a_Qd_vV1Cq_AT_y_5 __pyx_string_tab[7973]
#define __pyx_kp_b_iso88591_Weenno_xq_a_q_9AZq_a_q_whaq_az __pyx_string_tab[7974]
#define __pyx_kp_b_iso88591_XQ2_iq_uAQ_uAQ_a_U_7_1_uAXU_1 __pyx_string_tab[7975]
#define __pyx_kp_b_iso88591_XQ_1IQa_a_WA __pyx_string_tab[7976]
#define __pyx_kp_b_iso88591_XQ_1IQa_a_at5 __pyx_string_tab[7977]
#define __pyx_kp_b_iso88591_XQ_1IQa_a_q_F __pyx_string_tab[7978]
#define __pyx_kp_b_iso88591_XQ_1IQa_a_q_F_2 __pyx_string_tab[7979]
#define __pyx_kp_b_iso88591_XQ_1IQa_a_q_F_3 __pyx_string_tab[7980]
#define __pyx_kp_b_iso88591_XQ_5_Q_a_at7_at1_a_4q_q __pyx_string_tab[7981]
#define __pyx_kp_b_iso88591_XQ_5_a_U_aq_uAQ __pyx_string_tab[7982]
#define __pyx_kp_b_iso88591_XQ_5_z_a_Qd_q_r_7_b_a_a_U_aq_uA __pyx_string_tab[7983]
#define __pyx_kp_b_iso88591_XQ_Q_7uAQ_a_j __pyx_string_tab[7984]
#define __pyx_kp_b_iso88591_XQ_Qa_a_q_E __pyx_string_tab[7985]
#define __pyx_kp_b_iso88591_XQ_U_1_a_4uA __pyx_string_tab[7986]
#define __pyx_kp_b_iso88591_XQ_U_1_a_U __pyx_string_tab[7987]
#define __pyx_kp_b_iso88591_XQ_U_1_a_at5 __pyx_string_tab[7988]
#define __pyx_kp_b_iso88591_XQ_U_1_a_e1 __pyx_string_tab[7989]
#define __pyx_kp_b_iso88591_XQ_U_1_y_q_a_q_E_q __pyx_string_tab[7990]
#define __pyx_kp_b_iso88591_XQ_a_Qd_q __pyx_string_tab[7991]
#define __pyx_kp_b_iso88591_XQ_a_a_WAT_Qa_3c_Yaq_XS_y_AQ_q __pyx_string_tab[7992]
#define __pyx_kp_b_iso88591_XQ_a_y_q_az_e7_1_vQa __pyx_string_tab[7993]
#define __pyx_kp_b_iso88591_XQ_e1A_a_4vQ __pyx_string_tab[7994]
#define __pyx_kp_b_iso88591_XQ_e1A_a_AT_a __pyx_string_tab[7995]
#define __pyx_kp_b_iso88591_XQ_e1A_a_at5 __pyx_string_tab[7996]
#define __pyx_kp_b_iso88591_XQ_q_a_A_F_1_a_1_F_1_a_4A_F_1_q __pyx_string_tab[7997]
#define __pyx_kp_b_iso88591_XQ_q_a_Qd_a_Qd_a_WAQ_q_wat2T_WA __pyx_string_tab[7998]
#define __pyx_kp_b_iso88591_XQ_uAQ_a_4uA __pyx_string_tab[7999]
#define __pyx_kp_b_iso88591_XQ_uAQ_a_Qb_XQa_az_hd_q __pyx_string_tab[8000]
#define __pyx_kp_b_iso88591_XQ_uAQ_a_Qd_A __pyx_string_tab[8001]
#define __pyx_kp_b_iso88591_XQ_uAQ_a_a_4whauA_a_5_q __pyx_string_tab[8002]
#define __pyx_kp_b_iso88591_XQ_uAQ_s_a_4whas_a_3a_q __pyx_string_tab[8003]
#define __pyx_kp_b_iso88591_XQ_uAQ_s_a_U_3a_a_3a_q __pyx_string_tab[8004]
#define __pyx_kp_b_iso88591_XQ_uAQ_y_q_b_a_Qd_whas_q __pyx_string_tab[8005]
#define __pyx_kp_b_iso88591_XQ_uA_7q_uAQ_a_at6_uAQ __pyx_string_tab[8006]
#define __pyx_kp_b_iso88591_XQ_wa_y_q_az_e7_7_a_7_q __pyx_string_tab[8007]
#define __pyx_kp_b_iso88591_XQ_y_q_a_Qd_q __pyx_string_tab[8008]
#define __pyx_kp_b_iso88591_XQ_y_q_t9AWA __pyx_string_tab[8009]
#define __pyx_kp_b_iso88591_XV1_4s_a_fAQ_a_a_Qd_6_q_vQa __pyx_string_tab[8010]
#define __pyx_kp_b_iso88591_XXf_g_B_B_P_P_Z_Z_q_q_a_Qd_vV9I __pyx_string_tab[8011]
#define __pyx_kp_b_iso88591_YaL_1_2WF_1_2WF_a_at6_q __pyx_string_tab[8012]
#define __pyx_kp_b_iso88591_Ya_1_2WF_1_2WF_a_Qd_vQ __pyx_string_tab[8013]
#define __pyx_kp_b_iso88591_Ya_7_Q_S_6_c_V6_a_Qd_a_q __pyx_string_tab[8014]
#define __pyx_kp_b_iso88591_Ya_7_Q_T_q_6_s_at7_6_avQd_q_q __pyx_string_tab[8015]
#define __pyx_kp_b_iso88591_Ya_7_z_aq_r_a_4wiq_A_q __pyx_string_tab[8016]
#define __pyx_kp_b_iso88591_Ya_a_4vQc_a_3a_q __pyx_string_tab[8017]
#define __pyx_kp_b_iso88591_Ya_a_4vWA __pyx_string_tab[8018]
#define __pyx_kp_b_iso88591_Ya_a_a_AT __pyx_string_tab[8019]
#define __pyx_kp_b_iso88591_Ya_fAQ_a_4xq __pyx_string_tab[8020]
#define __pyx_kp_b_iso88591_Ya_fAQ_a_e1 __pyx_string_tab[8021]
#define __pyx_kp_b_iso88591_Ya_q_a_1D_a __pyx_string_tab[8022]
#define __pyx_kp_b_iso88591_Ya_q_a_1D_a_2 __pyx_string_tab[8023]
#define __pyx_kp_b_iso88591_Ya_q_a_4vQ __pyx_string_tab[8024]
#define __pyx_kp_b_iso88591_Ya_vQd_d_6 __pyx_string_tab[8025]
#define __pyx_kp_b_iso88591_YfAQ_1 __pyx_string_tab[8026]
#define __pyx_kp_b_iso88591_Yggppq_xq_a_q_9AZq_a_az_hd_q __pyx_string_tab[8027]
#define __pyx_kp_b_iso88591_ZZ_7a_a_Qd_q __pyx_string_tab[8028]
#define __pyx_kp_b_iso88591_ZZ_k_l_F_F_I_I_L_L_M_8_NR_2_A_M __pyx_string_tab[8029]
#define __pyx_kp_b_iso88591_Zggv_w_C_C_R_R_Q_A_a_q_a_1D_avQ __pyx_string_tab[8030]
#define __pyx_kp_b_iso88591_Zq_fAQ_a_0_U __pyx_string_tab[8031]
#define __pyx_kp_b_iso88591_Zq_fAQ_a_AT_a __pyx_string_tab[8032]
#define __pyx_kp_b_iso88591_Zq_fAQ_a_Qd_q __pyx_string_tab[8033]
#define __pyx_kp_b_iso88591_Zq_fAQ_a_fA __pyx_string_tab[8034]
#define __pyx_kp_b_iso88591_Zq_fAQ_a_q_E __pyx_string_tab[8035]
#define __pyx_kp_b_iso88591_Zq_uAQ_vQa_vQa_vQa_a_AT_gWA __pyx_string_tab[8036]
#define __pyx_kp_b_iso88591__31 __pyx_string_tab[8037]
#define __pyx_kp_b_iso88591__32 __pyx_string_tab[8038]
#define __pyx_kp_b_iso88591_aD_81A_a_4vQ __pyx_string_tab[8039]
#define __pyx_kp_b_iso88591_a_0_U_a __pyx_string_tab[8040]
#define __pyx_kp_b_iso88591_a_0q_a_q_E_vQ __pyx_string_tab[8041]
#define __pyx_kp_b_iso88591_a_1AT_q __pyx_string_tab[8042]
#define __pyx_kp_b_iso88591_a_1D __pyx_string_tab[8043]
#define __pyx_kp_b_iso88591_a_1D_1Cq __pyx_string_tab[8044]
#define __pyx_kp_b_iso88591_a_1D_2 __pyx_string_tab[8045]
#define __pyx_kp_b_iso88591_a_1D_3 __pyx_string_tab[8046]
#define __pyx_kp_b_iso88591_a_1D_Qa_uAQ __pyx_string_tab[8047]
#define __pyx_kp_b_iso88591_a_1D_QfAV1F_1_a_Qd_q_vQc_V6_q __pyx_string_tab[8048]
#define __pyx_kp_b_iso88591_a_1D_Rq __pyx_string_tab[8049]
#define __pyx_kp_b_iso88591_a_1D_T_q __pyx_string_tab[8050]
#define __pyx_kp_b_iso88591_a_1D_q __pyx_string_tab[8051]
#define __pyx_kp_b_iso88591_a_1D_q_2 __pyx_string_tab[8052]
#define __pyx_kp_b_iso88591_a_1D_q_A __pyx_string_tab[8053]
#define __pyx_kp_b_iso88591_a_1D_q_Q_a_5_q __pyx_string_tab[8054]
#define __pyx_kp_b_iso88591_a_1D_q_y __pyx_string_tab[8055]
#define __pyx_kp_b_iso88591_a_1D_wa __pyx_string_tab[8056]
#define __pyx_kp_b_iso88591_a_1IQa_a_AT __pyx_string_tab[8057]
#define __pyx_kp_b_iso88591_a_1IQa_a_Qd_q __pyx_string_tab[8058]
#define __pyx_kp_b_iso88591_a_1IQa_a_Qd_q_q __pyx_string_tab[8059]
#define __pyx_kp_b_iso88591_a_1IQa_ay_U __pyx_string_tab[8060]
#define __pyx_kp_b_iso88591_a_1IQa_ay_U_2 __pyx_string_tab[8061]
#define __pyx_kp_b_iso88591_a_1_81A_a_4vQ __pyx_string_tab[8062]
#define __pyx_kp_b_iso88591_a_1_a_1D_Q __pyx_string_tab[8063]
#define __pyx_kp_b_iso88591_a_1_a_1_fAQ_uAQ __pyx_string_tab[8064]
#define __pyx_kp_b_iso88591_a_1_a_4uAQ_uAQ __pyx_string_tab[8065]
#define __pyx_kp_b_iso88591_a_1_a_Qd_q_6_q_q_d __pyx_string_tab[8066]
#define __pyx_kp_b_iso88591_a_1_a_Qd_q_uAQ __pyx_string_tab[8067]
#define __pyx_kp_b_iso88591_a_1_a_Qd_uAQ __pyx_string_tab[8068]
#define __pyx_kp_b_iso88591_a_1_a_a_q_E_fAQ_a_5_1_awat1D_G9 __pyx_string_tab[8069]
#define __pyx_kp_b_iso88591_a_1_a_at6_a_a_4q_q __pyx_string_tab[8070]
#define __pyx_kp_b_iso88591_a_1_a_at6_uAQ __pyx_string_tab[8071]
#define __pyx_kp_b_iso88591_a_2Q_a_at6_q __pyx_string_tab[8072]
#define __pyx_kp_b_iso88591_a_2_a_4uA_A_PQQR_uA_a_5_U_1 __pyx_string_tab[8073]
#define __pyx_kp_b_iso88591_a_3 __pyx_string_tab[8074]
#define __pyx_kp_b_iso88591_a_31D __pyx_string_tab[8075]
#define __pyx_kp_b_iso88591_a_4_1 __pyx_string_tab[8076]
#define __pyx_kp_b_iso88591_a_4q __pyx_string_tab[8077]
#define __pyx_kp_b_iso88591_a_4q_2 __pyx_string_tab[8078]
#define __pyx_kp_b_iso88591_a_4q_q __pyx_string_tab[8079]
#define __pyx_kp_b_iso88591_a_4q_q_q_q_A_q __pyx_string_tab[8080]
#define __pyx_kp_b_iso88591_a_4t1A_q __pyx_string_tab[8081]
#define __pyx_kp_b_iso88591_a_4t1D_y __pyx_string_tab[8082]
#define __pyx_kp_b_iso88591_a_4vQa_xq __pyx_string_tab[8083]
#define __pyx_kp_b_iso88591_a_4vQa_y __pyx_string_tab[8084]
#define __pyx_kp_b_iso88591_a_4vQa_y_2 __pyx_string_tab[8085]
#define __pyx_kp_b_iso88591_a_4vQfAQ __pyx_string_tab[8086]
#define __pyx_kp_b_iso88591_a_4vQfAQ_2 __pyx_string_tab[8087]
#define __pyx_kp_b_iso88591_a_4vU __pyx_string_tab[8088]
#define __pyx_kp_b_iso88591_a_4vV1D_q_A_G9A_Q_waq_as_7_1_q __pyx_string_tab[8089]
#define __pyx_kp_b_iso88591_a_4vWA __pyx_string_tab[8090]
#define __pyx_kp_b_iso88591_a_4vWA_2 __pyx_string_tab[8091]
#define __pyx_kp_b_iso88591_a_4vWA_3 __pyx_string_tab[8092]
#define __pyx_kp_b_iso88591_a_4wa __pyx_string_tab[8093]
#define __pyx_kp_b_iso88591_a_4waq_y __pyx_string_tab[8094]
#define __pyx_kp_b_iso88591_a_4xs __pyx_string_tab[8095]
#define __pyx_kp_b_iso88591_a_6Q_a_Qd_q_q __pyx_string_tab[8096]
#define __pyx_kp_b_iso88591_a_6_a_U __pyx_string_tab[8097]
#define __pyx_kp_b_iso88591_a_7_a_Qd_q_1_a_3a_q __pyx_string_tab[8098]
#define __pyx_kp_b_iso88591_a_81A_a_1D_q __pyx_string_tab[8099]
#define __pyx_kp_b_iso88591_a_81A_a_4vQ __pyx_string_tab[8100]
#define __pyx_kp_b_iso88591_a_81A_a_U __pyx_string_tab[8101]
#define __pyx_kp_b_iso88591_a_81A_a_e1 __pyx_string_tab[8102]
#define __pyx_kp_b_iso88591_a_81A_a_e1_2 __pyx_string_tab[8103]
#define __pyx_kp_b_iso88591_a_AQd_q __pyx_string_tab[8104]
#define __pyx_kp_b_iso88591_a_AQd_q_2 __pyx_string_tab[8105]
#define __pyx_kp_b_iso88591_a_AT __pyx_string_tab[8106]
#define __pyx_kp_b_iso88591_a_AT_1_y __pyx_string_tab[8107]
#define __pyx_kp_b_iso88591_a_AT_2 __pyx_string_tab[8108]
#define __pyx_kp_b_iso88591_a_AT_3 __pyx_string_tab[8109]
#define __pyx_kp_b_iso88591_a_AT_4 __pyx_string_tab[8110]
#define __pyx_kp_b_iso88591_a_AT_Qa_y __pyx_string_tab[8111]
#define __pyx_kp_b_iso88591_a_AT_aq_vQa __pyx_string_tab[8112]
#define __pyx_kp_b_iso88591_a_AT_aq_y __pyx_string_tab[8113]
#define __pyx_kp_b_iso88591_a_AT_b __pyx_string_tab[8114]
#define __pyx_kp_b_iso88591_a_AT_q_uAQ __pyx_string_tab[8115]
#define __pyx_kp_b_iso88591_a_AT_y __pyx_string_tab[8116]
#define __pyx_kp_b_iso88591_a_A_1IQa_a_1D __pyx_string_tab[8117]
#define __pyx_kp_b_iso88591_a_A_a_4q_A_q_Cq_1A_q_vQe3c __pyx_string_tab[8118]
#define __pyx_kp_b_iso88591_a_A_a_Qd_q_uAQ __pyx_string_tab[8119]
#define __pyx_kp_b_iso88591_a_A_a_e1A_vQa __pyx_string_tab[8120]
#define __pyx_kp_b_iso88591_a_F_a_1D_RuAU_q __pyx_string_tab[8121]
#define __pyx_kp_b_iso88591_a_IQa_q __pyx_string_tab[8122]
#define __pyx_kp_b_iso88591_a_IQk_a_Qd_A __pyx_string_tab[8123]
#define __pyx_kp_b_iso88591_a_Ja_a_Qd_q_AQ_auF_1 __pyx_string_tab[8124]
#define __pyx_kp_b_iso88591_a_L_a_at7 __pyx_string_tab[8125]
#define __pyx_kp_b_iso88591_a_Q __pyx_string_tab[8126]
#define __pyx_kp_b_iso88591_a_Q_1IQa_a_Qd_q __pyx_string_tab[8127]
#define __pyx_kp_b_iso88591_a_Q_2 __pyx_string_tab[8128]
#define __pyx_kp_b_iso88591_a_Q_3 __pyx_string_tab[8129]
#define __pyx_kp_b_iso88591_a_Q_4A_1_a_1_F_7_7_Qa_y_auAU_7 __pyx_string_tab[8130]
#define __pyx_kp_b_iso88591_a_Q_A_a_Qd_q_a_at5_AV1Cq_D_y_G9 __pyx_string_tab[8131]
#define __pyx_kp_b_iso88591_a_Q_Ya_a_WAQ_9G1_vS_ha_vS_ha_z __pyx_string_tab[8132]
#define __pyx_kp_b_iso88591_a_Q_a_4uAQ_uAQ __pyx_string_tab[8133]
#define __pyx_kp_b_iso88591_a_Q_a_Qd_1_uAQ __pyx_string_tab[8134]
#define __pyx_kp_b_iso88591_a_Q_a_Qd_q_uAQ __pyx_string_tab[8135]
#define __pyx_kp_b_iso88591_a_Q_a_Qd_q_y __pyx_string_tab[8136]
#define __pyx_kp_b_iso88591_a_Q_a_at6_uAQ __pyx_string_tab[8137]
#define __pyx_kp_b_iso88591_a_Q_a_l_1_uAQ __pyx_string_tab[8138]
#define __pyx_kp_b_iso88591_a_Qat1_q __pyx_string_tab[8139]
#define __pyx_kp_b_iso88591_a_Qat1_q_2 __pyx_string_tab[8140]
#define __pyx_kp_b_iso88591_a_Qd __pyx_string_tab[8141]
#define __pyx_kp_b_iso88591_a_Qd_2 __pyx_string_tab[8142]
#define __pyx_kp_b_iso88591_a_Qd_3 __pyx_string_tab[8143]
#define __pyx_kp_b_iso88591_a_Qd_4 __pyx_string_tab[8144]
#define __pyx_kp_b_iso88591_a_Qd_aq_uAQ __pyx_string_tab[8145]
#define __pyx_kp_b_iso88591_a_Qd_ay_WAQ_Qd_q __pyx_string_tab[8146]
#define __pyx_kp_b_iso88591_a_Qd_q __pyx_string_tab[8147]
#define __pyx_kp_b_iso88591_a_Qd_q_7_a_3a_q __pyx_string_tab[8148]
#define __pyx_kp_b_iso88591_a_Qd_q_vQa __pyx_string_tab[8149]
#define __pyx_kp_b_iso88591_a_Qd_q_y __pyx_string_tab[8150]
#define __pyx_kp_b_iso88591_a_Qd_r __pyx_string_tab[8151]
#define __pyx_kp_b_iso88591_a_Rq_a_Qd_q_a_2Q_q __pyx_string_tab[8152]
#define __pyx_kp_b_iso88591_a_S_1_a_Qd_q_q_a_1A_a_1A_1 __pyx_string_tab[8153]
#define __pyx_kp_b_iso88591_a_S_1_a_Qd_q_q_vQ_a_1HF_aq_t9AQ __pyx_string_tab[8154]
#define __pyx_kp_b_iso88591_a_S_1_a_at6_6_1_a_1A_a_1A_1 __pyx_string_tab[8155]
#define __pyx_kp_b_iso88591_a_S_S_a_Qd_q_q_a_1A_a_1A_1 __pyx_string_tab[8156]
#define __pyx_kp_b_iso88591_a_S_a_Qd_q_vQ_a_1A_t9AQ_1 __pyx_string_tab[8157]
#define __pyx_kp_b_iso88591_a_T __pyx_string_tab[8158]
#define __pyx_kp_b_iso88591_a_U_1_a_4uAQ_uAQ __pyx_string_tab[8159]
#define __pyx_kp_b_iso88591_a_U_1_q __pyx_string_tab[8160]
#define __pyx_kp_b_iso88591_a_U_1_q_2 __pyx_string_tab[8161]
#define __pyx_kp_b_iso88591_a_U_1_uAQ __pyx_string_tab[8162]
#define __pyx_kp_b_iso88591_a_U_1_uAQ_2 __pyx_string_tab[8163]
#define __pyx_kp_b_iso88591_a_U_iq __pyx_string_tab[8164]
#define __pyx_kp_b_iso88591_a_U_wfGSYYbbc_q __pyx_string_tab[8165]
#define __pyx_kp_b_iso88591_a_V1Cq_E_aq_Cq_1_q_e1_q __pyx_string_tab[8166]
#define __pyx_kp_b_iso88591_a_WA_a_Qd_q __pyx_string_tab[8167]
#define __pyx_kp_b_iso88591_a_WJa __pyx_string_tab[8168]
#define __pyx_kp_b_iso88591_a_XYa_a_1D_axq_Rq_A_7_5_V1A_9A __pyx_string_tab[8169]
#define __pyx_kp_b_iso88591_a_Ya_a_at6_Q_a_3a_q __pyx_string_tab[8170]
#define __pyx_kp_b_iso88591_a_a __pyx_string_tab[8171]
#define __pyx_kp_b_iso88591_a_a_1D_Q __pyx_string_tab[8172]
#define __pyx_kp_b_iso88591_a_a_1D_Qa_vQa __pyx_string_tab[8173]
#define __pyx_kp_b_iso88591_a_a_1D_Rq __pyx_string_tab[8174]
#define __pyx_kp_b_iso88591_a_a_1D_aq_q __pyx_string_tab[8175]
#define __pyx_kp_b_iso88591_a_a_1D_q_vQa __pyx_string_tab[8176]
#define __pyx_kp_b_iso88591_a_a_1D_q_vQa_2 __pyx_string_tab[8177]
#define __pyx_kp_b_iso88591_a_a_1_l_1_uAQ __pyx_string_tab[8178]
#define __pyx_kp_b_iso88591_a_a_2 __pyx_string_tab[8179]
#define __pyx_kp_b_iso88591_a_a_3 __pyx_string_tab[8180]
#define __pyx_kp_b_iso88591_a_a_4_2Q __pyx_string_tab[8181]
#define __pyx_kp_b_iso88591_a_a_4q __pyx_string_tab[8182]
#define __pyx_kp_b_iso88591_a_a_4q_2 __pyx_string_tab[8183]
#define __pyx_kp_b_iso88591_a_a_4t1D_vQ __pyx_string_tab[8184]
#define __pyx_kp_b_iso88591_a_a_4uAV1_a_6_q __pyx_string_tab[8185]
#define __pyx_kp_b_iso88591_a_a_4uE __pyx_string_tab[8186]
#define __pyx_kp_b_iso88591_a_a_4vQa_Q_a_t6_a_AV1A_wat1Cq __pyx_string_tab[8187]
#define __pyx_kp_b_iso88591_a_a_4vQa_vQa __pyx_string_tab[8188]
#define __pyx_kp_b_iso88591_a_a_4vS_AQ __pyx_string_tab[8189]
#define __pyx_kp_b_iso88591_a_a_4waq_vQa __pyx_string_tab[8190]
#define __pyx_kp_b_iso88591_a_a_4waq_vQa_2 __pyx_string_tab[8191]
#define __pyx_kp_b_iso88591_a_a_4z_uAQ __pyx_string_tab[8192]
#define __pyx_kp_b_iso88591_a_a_AT_at1A_G9A_1AQ_q __pyx_string_tab[8193]
#define __pyx_kp_b_iso88591_a_a_Q __pyx_string_tab[8194]
#define __pyx_kp_b_iso88591_a_a_Qd __pyx_string_tab[8195]
#define __pyx_kp_b_iso88591_a_a_Qd_1A_uAQ __pyx_string_tab[8196]
#define __pyx_kp_b_iso88591_a_a_Qd_2 __pyx_string_tab[8197]
#define __pyx_kp_b_iso88591_a_a_Qd_AQ_y __pyx_string_tab[8198]
#define __pyx_kp_b_iso88591_a_a_Qd_q_uAQ __pyx_string_tab[8199]
#define __pyx_kp_b_iso88591_a_a_Qd_q_uAQ_2 __pyx_string_tab[8200]
#define __pyx_kp_b_iso88591_a_a_Qd_q_vQa __pyx_string_tab[8201]
#define __pyx_kp_b_iso88591_a_a_Qd_uAQ __pyx_string_tab[8202]
#define __pyx_kp_b_iso88591_a_a_Qd_vQa __pyx_string_tab[8203]
#define __pyx_kp_b_iso88591_a_a_U_1_vQa __pyx_string_tab[8204]
#define __pyx_kp_b_iso88591_a_a_U_3a_a_3a_q __pyx_string_tab[8205]
#define __pyx_kp_b_iso88591_a_a_U_Q __pyx_string_tab[8206]
#define __pyx_kp_b_iso88591_a_a_V1A_at6_IQm1_q __pyx_string_tab[8207]
#define __pyx_kp_b_iso88591_a_a_V1A_vQa __pyx_string_tab[8208]
#define __pyx_kp_b_iso88591_a_a_V1F_1 __pyx_string_tab[8209]
#define __pyx_kp_b_iso88591_a_a_V1F_1_2 __pyx_string_tab[8210]
#define __pyx_kp_b_iso88591_a_a_a __pyx_string_tab[8211]
#define __pyx_kp_b_iso88591_a_a_a_2 __pyx_string_tab[8212]
#define __pyx_kp_b_iso88591_a_a_a_4vS_vQa __pyx_string_tab[8213]
#define __pyx_kp_b_iso88591_a_a_a_Qd __pyx_string_tab[8214]
#define __pyx_kp_b_iso88591_a_a_a_Qd_q_vQa __pyx_string_tab[8215]
#define __pyx_kp_b_iso88591_a_a_a_a_at6_vQgV1A __pyx_string_tab[8216]
#define __pyx_kp_b_iso88591_a_a_a_at6_q __pyx_string_tab[8217]
#define __pyx_kp_b_iso88591_a_a_a_at6_vQa __pyx_string_tab[8218]
#define __pyx_kp_b_iso88591_a_a_a_at6_vQa_2 __pyx_string_tab[8219]
#define __pyx_kp_b_iso88591_a_a_a_e1A_vQa __pyx_string_tab[8220]
#define __pyx_kp_b_iso88591_a_a_a_e1A_vQa_2 __pyx_string_tab[8221]
#define __pyx_kp_b_iso88591_a_a_a_e1Cq_aq_A_5_1_at4wiq_5_1 __pyx_string_tab[8222]
#define __pyx_kp_b_iso88591_a_a_at1 __pyx_string_tab[8223]
#define __pyx_kp_b_iso88591_a_a_at1_2 __pyx_string_tab[8224]
#define __pyx_kp_b_iso88591_a_a_at4q_AQ_y __pyx_string_tab[8225]
#define __pyx_kp_b_iso88591_a_a_at5_vQa __pyx_string_tab[8226]
#define __pyx_kp_b_iso88591_a_a_at6_Qa_Qd_q __pyx_string_tab[8227]
#define __pyx_kp_b_iso88591_a_a_at6_uAQ __pyx_string_tab[8228]
#define __pyx_kp_b_iso88591_a_a_at6_uAQ_2 __pyx_string_tab[8229]
#define __pyx_kp_b_iso88591_a_a_at7_1_vQa __pyx_string_tab[8230]
#define __pyx_kp_b_iso88591_a_a_at7_Q __pyx_string_tab[8231]
#define __pyx_kp_b_iso88591_a_a_e1A_uAQ __pyx_string_tab[8232]
#define __pyx_kp_b_iso88591_a_a_e1A_vQa __pyx_string_tab[8233]
#define __pyx_kp_b_iso88591_a_a_e1A_vQa_2 __pyx_string_tab[8234]
#define __pyx_kp_b_iso88591_a_a_fAQ_vQa __pyx_string_tab[8235]
#define __pyx_kp_b_iso88591_a_a_fAQ_vQa_2 __pyx_string_tab[8236]
#define __pyx_kp_b_iso88591_a_a_gQa_vQa __pyx_string_tab[8237]
#define __pyx_kp_b_iso88591_a_a_j_A __pyx_string_tab[8238]
#define __pyx_kp_b_iso88591_a_a_q __pyx_string_tab[8239]
#define __pyx_kp_b_iso88591_a_a_q_2 __pyx_string_tab[8240]
#define __pyx_kp_b_iso88591_a_a_q_E __pyx_string_tab[8241]
#define __pyx_kp_b_iso88591_a_a_q_E_Q_q __pyx_string_tab[8242]
#define __pyx_kp_b_iso88591_a_a_q_F_1_uAQ __pyx_string_tab[8243]
#define __pyx_kp_b_iso88591_a_a_q_G6_IQa_q __pyx_string_tab[8244]
#define __pyx_kp_b_iso88591_a_aq_A_q __pyx_string_tab[8245]
#define __pyx_kp_b_iso88591_a_aq_a_e1 __pyx_string_tab[8246]
#define __pyx_kp_b_iso88591_a_at1 __pyx_string_tab[8247]
#define __pyx_kp_b_iso88591_a_at1_2 __pyx_string_tab[8248]
#define __pyx_kp_b_iso88591_a_at1_3 __pyx_string_tab[8249]
#define __pyx_kp_b_iso88591_a_at6_Qa_az_fAS_at5_uAT_aq __pyx_string_tab[8250]
#define __pyx_kp_b_iso88591_a_at6_az_fAQ_Qd_q __pyx_string_tab[8251]
#define __pyx_kp_b_iso88591_a_at6_q_ay_q __pyx_string_tab[8252]
#define __pyx_kp_b_iso88591_a_at7_1_y __pyx_string_tab[8253]
#define __pyx_kp_b_iso88591_a_avQd __pyx_string_tab[8254]
#define __pyx_kp_b_iso88591_a_avQd_6_xq __pyx_string_tab[8255]
#define __pyx_kp_b_iso88591_a_avQd_q __pyx_string_tab[8256]
#define __pyx_kp_b_iso88591_a_awat5 __pyx_string_tab[8257]
#define __pyx_kp_b_iso88591_a_awat6_xq __pyx_string_tab[8258]
#define __pyx_kp_b_iso88591_a_awat7_gQa_vQa __pyx_string_tab[8259]
#define __pyx_kp_b_iso88591_a_axq_F __pyx_string_tab[8260]
#define __pyx_kp_b_iso88591_a_axq_F_2 __pyx_string_tab[8261]
#define __pyx_kp_b_iso88591_a_axq_F_A __pyx_string_tab[8262]
#define __pyx_kp_b_iso88591_a_axq_F_A_2 __pyx_string_tab[8263]
#define __pyx_kp_b_iso88591_a_axq_F_A_3 __pyx_string_tab[8264]
#define __pyx_kp_b_iso88591_a_axq_F_A_4 __pyx_string_tab[8265]
#define __pyx_kp_b_iso88591_a_axq_F_V1A_vQa __pyx_string_tab[8266]
#define __pyx_kp_b_iso88591_a_axq_F_V1A_vQa_2 __pyx_string_tab[8267]
#define __pyx_kp_b_iso88591_a_axq_F_WA __pyx_string_tab[8268]
#define __pyx_kp_b_iso88591_a_axq_G1A_vQa __pyx_string_tab[8269]
#define __pyx_kp_b_iso88591_a_ay_U_1_vQa __pyx_string_tab[8270]
#define __pyx_kp_b_iso88591_a_ay_WBa __pyx_string_tab[8271]
#define __pyx_kp_b_iso88591_a_az_fAV1F_1 __pyx_string_tab[8272]
#define __pyx_kp_b_iso88591_a_az_gQa_vQa __pyx_string_tab[8273]
#define __pyx_kp_b_iso88591_a_b_auAT_G1Cq_q __pyx_string_tab[8274]
#define __pyx_kp_b_iso88591_a_d_4q_y __pyx_string_tab[8275]
#define __pyx_kp_b_iso88591_a_e1A_a_q_E_q_uARvQd_5_at1A __pyx_string_tab[8276]
#define __pyx_kp_b_iso88591_a_e1A_uAQ __pyx_string_tab[8277]
#define __pyx_kp_b_iso88591_a_e1A_vQ __pyx_string_tab[8278]
#define __pyx_kp_b_iso88591_a_e1A_y __pyx_string_tab[8279]
#define __pyx_kp_b_iso88591_a_e7 __pyx_string_tab[8280]
#define __pyx_kp_b_iso88591_a_fAQ_a_AT_fAQ __pyx_string_tab[8281]
#define __pyx_kp_b_iso88591_a_fCq __pyx_string_tab[8282]
#define __pyx_kp_b_iso88591_a_fCq_2 __pyx_string_tab[8283]
#define __pyx_kp_b_iso88591_a_fD __pyx_string_tab[8284]
#define __pyx_kp_b_iso88591_a_haq_uAQ __pyx_string_tab[8285]
#define __pyx_kp_b_iso88591_a_has_a_a_4vWAS __pyx_string_tab[8286]
#define __pyx_kp_b_iso88591_a_q_A __pyx_string_tab[8287]
#define __pyx_kp_b_iso88591_a_q_A_2 __pyx_string_tab[8288]
#define __pyx_kp_b_iso88591_a_q_A_a_Qd __pyx_string_tab[8289]
#define __pyx_kp_b_iso88591_a_q_A_q __pyx_string_tab[8290]
#define __pyx_kp_b_iso88591_a_q_E_1 __pyx_string_tab[8291]
#define __pyx_kp_b_iso88591_a_q_E_1_HA_q_1D_Rq __pyx_string_tab[8292]
#define __pyx_kp_b_iso88591_a_q_E_q __pyx_string_tab[8293]
#define __pyx_kp_b_iso88591_a_q_E_q_2 __pyx_string_tab[8294]
#define __pyx_kp_b_iso88591_a_q_E_uAQ __pyx_string_tab[8295]
#define __pyx_kp_b_iso88591_a_q_a_Qd_q_a_U_3as_1_z_s_Q __pyx_string_tab[8296]
#define __pyx_kp_b_iso88591_a_q_a_a_e1AT_4q_Qaq __pyx_string_tab[8297]
#define __pyx_kp_b_iso88591_a_q_a_q_G1A_uAQ __pyx_string_tab[8298]
#define __pyx_kp_b_iso88591_a_q_aq_a_q_F_a __pyx_string_tab[8299]
#define __pyx_kp_b_iso88591_a_q_q_q_q_a_at5_1_6_A_7_1_6_1_6 __pyx_string_tab[8300]
#define __pyx_kp_b_iso88591_a_r_a_e1D_q __pyx_string_tab[8301]
#define __pyx_kp_b_iso88591_a_s_a_at6_Q_a_3a_q __pyx_string_tab[8302]
#define __pyx_kp_b_iso88591_a_s_a_at6_Q_a_3a_q_2 __pyx_string_tab[8303]
#define __pyx_kp_b_iso88591_a_s_a_l_3a_a_3a_q __pyx_string_tab[8304]
#define __pyx_kp_b_iso88591_a_uAQ_Qa_a_4uAXQa_QiuAQ __pyx_string_tab[8305]
#define __pyx_kp_b_iso88591_a_uE_1_uCq_q_G1F_vS_j_1G1 __pyx_string_tab[8306]
#define __pyx_kp_b_iso88591_a_wa_a_Qd_q __pyx_string_tab[8307]
#define __pyx_kp_b_iso88591_aq_a_U __pyx_string_tab[8308]
#define __pyx_kp_b_iso88591_ay_Q __pyx_string_tab[8309]
#define __pyx_kp_b_iso88591_ay_U_1_y __pyx_string_tab[8310]
#define __pyx_kp_b_iso88591_ay_V3fAQ_xq __pyx_string_tab[8311]
#define __pyx_kp_b_iso88591_ay_WAQ_uAQ __pyx_string_tab[8312]
#define __pyx_kp_b_iso88591_ay_WAQ_y __pyx_string_tab[8313]
#define __pyx_kp_b_iso88591_ay_a_F_q __pyx_string_tab[8314]
#define __pyx_kp_b_iso88591_ay_a_q __pyx_string_tab[8315]
#define __pyx_kp_b_iso88591_az_4q_q __pyx_string_tab[8316]
#define __pyx_kp_b_iso88591_az_a __pyx_string_tab[8317]
#define __pyx_kp_b_iso88591_az_a_2 __pyx_string_tab[8318]
#define __pyx_kp_b_iso88591_az_e1F_1 __pyx_string_tab[8319]
#define __pyx_kp_b_iso88591_az_e2Q __pyx_string_tab[8320]
#define __pyx_kp_b_iso88591_az_e6_a_a_1D_V1E_q __pyx_string_tab[8321]
#define __pyx_kp_b_iso88591_az_fAQ_uAQ __pyx_string_tab[8322]
#define __pyx_kp_b_iso88591_az_fAQ_y __pyx_string_tab[8323]
#define __pyx_kp_b_iso88591_az_fAQ_y_2 __pyx_string_tab[8324]
#define __pyx_kp_b_iso88591_az_fAS_Qd_q __pyx_string_tab[8325]
#define __pyx_kp_b_iso88591_az_fCvQa_xq __pyx_string_tab[8326]
#define __pyx_kp_b_iso88591_az_gS __pyx_string_tab[8327]
#define __pyx_kp_b_iso88591_az_gV1_iq_q __pyx_string_tab[8328]
#define __pyx_kp_b_iso88591_b_Q_a_1D_U_3a_a_3a_q __pyx_string_tab[8329]
#define __pyx_kp_b_iso88591_b_Q_a_U_5_A_a_3a_avQ __pyx_string_tab[8330]
#define __pyx_kp_b_iso88591_b_a_1D_t7_3a_q __pyx_string_tab[8331]
#define __pyx_kp_b_iso88591_b_a_4wd_Q_q __pyx_string_tab[8332]
#define __pyx_kp_b_iso88591_b_a_Qd_r_as_q __pyx_string_tab[8333]
#define __pyx_kp_b_iso88591_b_a_q_E_Q_a_3a_q __pyx_string_tab[8334]
#define __pyx_kp_b_iso88591_b_axq_G4was_q __pyx_string_tab[8335]
#define __pyx_kp_b_iso88591_c_a_1D_Qb_q __pyx_string_tab[8336]
#define __pyx_kp_b_iso88591_c_a_4uARq_q __pyx_string_tab[8337]
#define __pyx_kp_b_iso88591_c_a_U_2Q_q __pyx_string_tab[8338]
#define __pyx_kp_b_iso88591_c_a_at5_1_q __pyx_string_tab[8339]
#define __pyx_kp_b_iso88591_d_5_a_U_3a_a_3a_q __pyx_string_tab[8340]
#define __pyx_kp_b_iso88591_e1A_a_Qd __pyx_string_tab[8341]
#define __pyx_kp_b_iso88591_e1A_a_Qd_2 __pyx_string_tab[8342]
#define __pyx_kp_b_iso88591_e1A_e1A_b_a_1D_wgQc_q __pyx_string_tab[8343]
#define __pyx_kp_b_iso88591_e1A_s_a_AT_fA_auTU_Q __pyx_string_tab[8344]
#define __pyx_kp_b_iso88591_fAQ_a_4uA __pyx_string_tab[8345]
#define __pyx_kp_b_iso88591_fAQ_a_Qd_q __pyx_string_tab[8346]
#define __pyx_kp_b_iso88591_fAQ_a_Qd_q_2 __pyx_string_tab[8347]
#define __pyx_kp_b_iso88591_fAQ_a_e1 __pyx_string_tab[8348]
#define __pyx_kp_b_iso88591_fAQ_a_q_F_q __pyx_string_tab[8349]
#define __pyx_kp_b_iso88591_fAQ_ay_V1 __pyx_string_tab[8350]
#define __pyx_kp_b_iso88591_fAQ_ay_V6_a __pyx_string_tab[8351]
#define __pyx_kp_b_iso88591_fA_aq_Rq_a_at5_q_az_hd_q __pyx_string_tab[8352]
#define __pyx_kp_b_iso88591_gYa_a_a_1D_q __pyx_string_tab[8353]
#define __pyx_kp_b_iso88591_gZq_WA_a_at6_Q_az_fF_1_a_Qd_1_q __pyx_string_tab[8354]
#define __pyx_kp_b_iso88591_ha_5_Q_a_a_e4q_aq_q_a_9AQ_q __pyx_string_tab[8355]
#define __pyx_kp_b_iso88591_ha_5_Qa_a_2_4uD_uAQ __pyx_string_tab[8356]
#define __pyx_kp_b_iso88591_ha_5_a_AT_a __pyx_string_tab[8357]
#define __pyx_kp_b_iso88591_ha_5_a_q_F __pyx_string_tab[8358]
#define __pyx_kp_b_iso88591_ha_5_aq_A_a_4uD_1A_q_G9IWG1E_1 __pyx_string_tab[8359]
#define __pyx_kp_b_iso88591_ha_E_a_Qd_q __pyx_string_tab[8360]
#define __pyx_kp_b_iso88591_ha_Q_8_a_AT_iq_QiuAQ __pyx_string_tab[8361]
#define __pyx_kp_b_iso88591_ha_Q_IQk_a_Qd_q __pyx_string_tab[8362]
#define __pyx_kp_b_iso88591_ha_Qa_a_1D_c_xq __pyx_string_tab[8363]
#define __pyx_kp_b_iso88591_ha_U_1_a_1D_Q __pyx_string_tab[8364]
#define __pyx_kp_b_iso88591_ha_U_1_a_AT_q __pyx_string_tab[8365]
#define __pyx_kp_b_iso88591_ha_U_1_a_AT_q_2 __pyx_string_tab[8366]
#define __pyx_kp_b_iso88591_ha_U_1_a_Qd __pyx_string_tab[8367]
#define __pyx_kp_b_iso88591_ha_U_1_a_Qd_q __pyx_string_tab[8368]
#define __pyx_kp_b_iso88591_ha_U_1_a_U __pyx_string_tab[8369]
#define __pyx_kp_b_iso88591_ha_U_1_a_q_E __pyx_string_tab[8370]
#define __pyx_kp_b_iso88591_ha_U_1_a_q_L __pyx_string_tab[8371]
#define __pyx_kp_b_iso88591_ha_a_1_IQk_a_4uL_AWIUV __pyx_string_tab[8372]
#define __pyx_kp_b_iso88591_ha_aq_a_a_AT_Qa_uAQ __pyx_string_tab[8373]
#define __pyx_kp_b_iso88591_ha_aq_az_e6_uCq_N_5_T_q_a_5_q __pyx_string_tab[8374]
#define __pyx_kp_b_iso88591_ha_uAQ_4q_a_1D_xq_a_a_6_q __pyx_string_tab[8375]
#define __pyx_kp_b_iso88591_ha_uAQ_a_Qd_1 __pyx_string_tab[8376]
#define __pyx_kp_b_iso88591_ha_uAQ_a_Qd_a __pyx_string_tab[8377]
#define __pyx_kp_b_iso88591_ha_uAQ_a_at7 __pyx_string_tab[8378]
#define __pyx_kp_b_iso88591_ha_uAQ_a_at_XQa_vQa __pyx_string_tab[8379]
#define __pyx_kp_b_iso88591_ha_uAQ_a_at_XQa_vQa_2 __pyx_string_tab[8380]
#define __pyx_kp_b_iso88591_ha_uAQ_aq_a_Qd __pyx_string_tab[8381]
#define __pyx_kp_b_iso88591_ha_uAQ_e1A_a_q_F __pyx_string_tab[8382]
#define __pyx_kp_b_iso88591_ha_uAQ_q_a_at_XQa_uAQ __pyx_string_tab[8383]
#define __pyx_kp_b_iso88591_ha_uAQ_s_a_e81Kq_a_a_q __pyx_string_tab[8384]
#define __pyx_kp_b_iso88591_ha_uA_5Q_y_q_a_at5_xq_uAQ __pyx_string_tab[8385]
#define __pyx_kp_b_iso88591_ha_uA_7q_a_1D_haq_uAQ __pyx_string_tab[8386]
#define __pyx_kp_b_iso88591_havQ_0_a_AWAQ_a_Qat1_L_q __pyx_string_tab[8387]
#define __pyx_kp_b_iso88591_havQ_1_a_az_hd_q __pyx_string_tab[8388]
#define __pyx_kp_b_iso88591_havQ_Q_a_1G1A_az_hd_q __pyx_string_tab[8389]
#define __pyx_kp_b_iso88591_havQ_Q_a_1G1A_az_hd_q_q __pyx_string_tab[8390]
#define __pyx_kp_b_iso88591_havQ_Q_a_AWAQ_az_hd_q __pyx_string_tab[8391]
#define __pyx_kp_b_iso88591_havQ_Q_a_AWAQ_az_hd_q_2 __pyx_string_tab[8392]
#define __pyx_kp_b_iso88591_havQ_Q_a_az_a_F_q __pyx_string_tab[8393]
#define __pyx_kp_b_iso88591_havQ_Q_axq_q_az_hd_ay_U_q __pyx_string_tab[8394]
#define __pyx_kp_b_iso88591_havQ_Q_axq_q_az_hd_q __pyx_string_tab[8395]
#define __pyx_kp_b_iso88591_havQ_Q_axq_q_az_hd_q_2 __pyx_string_tab[8396]
#define __pyx_kp_b_iso88591_havQ_Q_axq_q_az_hd_q_3 __pyx_string_tab[8397]
#define __pyx_kp_b_iso88591_havQ_a_1G1A_az_hd_A_q __pyx_string_tab[8398]
#define __pyx_kp_b_iso88591_havQ_a_AWAQ_az_a_F_q __pyx_string_tab[8399]
#define __pyx_kp_b_iso88591_havQ_a_AWAT_q __pyx_string_tab[8400]
#define __pyx_kp_b_iso88591_havQ_a_Q_q __pyx_string_tab[8401]
#define __pyx_kp_b_iso88591_havQ_a_QgQa_az_hd_q __pyx_string_tab[8402]
#define __pyx_kp_b_iso88591_havQ_a_az_hd_q __pyx_string_tab[8403]
#define __pyx_kp_b_iso88591_havQ_a_q_q_az_hd_1_q __pyx_string_tab[8404]
#define __pyx_kp_b_iso88591_havQ_a_q_t1 __pyx_string_tab[8405]
#define __pyx_kp_b_iso88591_havQ_az_az_hd_q __pyx_string_tab[8406]
#define __pyx_kp_b_iso88591_havQ_q_a_AWAQ_az_hd_q __pyx_string_tab[8407]
#define __pyx_kp_b_iso88591_havQ_q_axq_q_az_hd_q __pyx_string_tab[8408]
#define __pyx_kp_b_iso88591_havQ_q_ay_az_hd_q __pyx_string_tab[8409]
#define __pyx_kp_b_iso88591_havQ_q_ay_az_hd_q_2 __pyx_string_tab[8410]
#define __pyx_kp_b_iso88591_havQ_q_ay_az_hd_q_3 __pyx_string_tab[8411]
#define __pyx_kp_b_iso88591_havQ_q_ay_az_hd_q_4 __pyx_string_tab[8412]
#define __pyx_kp_b_iso88591_i_R_ggh_q_a_2WF_2WF_QfA_q_G4uG6 __pyx_string_tab[8413]
#define __pyx_kp_b_iso88591_iq0_q_7_z_q_1_a_at7_1F_q __pyx_string_tab[8414]
#define __pyx_kp_b_iso88591_iq2_5_6_5_e1_AQ_A_k_wk9K1A_s_V1 __pyx_string_tab[8415]
#define __pyx_kp_b_iso88591_iq_1_Q_4q __pyx_string_tab[8416]
#define __pyx_kp_b_iso88591_iq_1_Q_4q_2 __pyx_string_tab[8417]
#define __pyx_kp_b_iso88591_iq_5_6_5_6_5_e1_AQ_A_k_wk9K1A_s __pyx_string_tab[8418]
#define __pyx_kp_b_iso88591_iq_5_6_a_fD_d __pyx_string_tab[8419]
#define __pyx_kp_b_iso88591_iq_7_Q_T_q_6_c_q_F_6_awat6_q_q __pyx_string_tab[8420]
#define __pyx_kp_b_iso88591_iq_Q_2WF_a_Qd_q __pyx_string_tab[8421]
#define __pyx_kp_b_iso88591_iq_V3c_F_Q __pyx_string_tab[8422]
#define __pyx_kp_b_iso88591_iq_a_1D_ha __pyx_string_tab[8423]
#define __pyx_kp_b_iso88591_iq_a_2WF_2WF_a_q_F __pyx_string_tab[8424]
#define __pyx_kp_b_iso88591_iq_a_6_a_Qd_q __pyx_string_tab[8425]
#define __pyx_kp_b_iso88591_iq_c_6_A_U_A_1D_Qb_a_2Q_q __pyx_string_tab[8426]
#define __pyx_kp_b_iso88591_iq_fAQ_a_AT_a __pyx_string_tab[8427]
#define __pyx_kp_b_iso88591_iq_haq_az_fG1A_q __pyx_string_tab[8428]
#define __pyx_kp_b_iso88591_iq_q_6_a_4uA __pyx_string_tab[8429]
#define __pyx_kp_b_iso88591_iq_q_6_iuAQ_a_q_XT_aq_q __pyx_string_tab[8430]
#define __pyx_kp_b_iso88591_iq_q_7_vV1_a_1D_a __pyx_string_tab[8431]
#define __pyx_kp_b_iso88591_iq_q_7_vV1_a_1D_a_2 __pyx_string_tab[8432]
#define __pyx_kp_b_iso88591_iq_q_S_U_1_q_S_U_1_a_1D_XXRq __pyx_string_tab[8433]
#define __pyx_kp_b_iso88591_iq_vQd_t9F __pyx_string_tab[8434]
#define __pyx_kp_b_iso88591_j_F_1_a_0_XQ __pyx_string_tab[8435]
#define __pyx_kp_b_iso88591_j_a_at7_7_1_Qhe1A __pyx_string_tab[8436]
#define __pyx_kp_b_iso88591_j_fAQ_a_Qd_q __pyx_string_tab[8437]
#define __pyx_kp_b_iso88591_j_fAQ_a_V1 __pyx_string_tab[8438]
#define __pyx_kp_b_iso88591_j_fAQ_a_at5 __pyx_string_tab[8439]
#define __pyx_kp_b_iso88591_k_5_Q_a_q_E_2Q __pyx_string_tab[8440]
#define __pyx_kp_b_iso88591_k_a_Qd_hawaxvXQa_hawaxvXQa_a_fI __pyx_string_tab[8441]
#define __pyx_kp_b_iso88591_k_a_fAWAQ_Qhe1A __pyx_string_tab[8442]
#define __pyx_kp_b_iso88591_l2IIggu_v_B_B_P_P_Y_Y_Z_0_xq_a __pyx_string_tab[8443]
#define __pyx_kp_b_iso88591_l_a_1D_a __pyx_string_tab[8444]
#define __pyx_kp_b_iso88591_l_uAQ_uAQ_a_at_XQ __pyx_string_tab[8445]
#define __pyx_kp_b_iso88591_l_uAQ_y_q_a_4uG1 __pyx_string_tab[8446]
#define __pyx_kp_b_iso88591_l_uA_6e1A_y_q_a_at5_xq __pyx_string_tab[8447]
#define __pyx_kp_b_iso88591_l_vQ_e1A_uAQ_e1A_a_WG81 __pyx_string_tab[8448]
#define __pyx_kp_b_iso88591_m1_E_Q_vQhas_3aq_A_az_e1A_4s_e1 __pyx_string_tab[8449]
#define __pyx_kp_b_iso88591_m81_uAQ_Qa_a_1D_ha __pyx_string_tab[8450]
#define __pyx_kp_b_iso88591_m9A_a_2Q_6_A_Qd_war_U_2Q __pyx_string_tab[8451]
#define __pyx_kp_b_iso88591_m9A_vQd_D_q __pyx_string_tab[8452]
#define __pyx_kp_b_iso88591_mC_iiu_v_D_D_M_M_N_xq_a_q_9AZq __pyx_string_tab[8453]
#define __pyx_kp_b_iso88591_m_Nn_eef_6_q_a_Qhe7_1_az_hd_q __pyx_string_tab[8454]
#define __pyx_kp_b_iso88591_m_jjsst6_44J_6_ivQa_6_ivQa_6_iv __pyx_string_tab[8455]
#define __pyx_kp_b_iso88591_nIQ_havQ_q_y_q_a_AWG1A_az_hd_Q __pyx_string_tab[8456]
#define __pyx_kp_b_iso88591_nN_12_5_z_a_Qd_q_r_7_b_1_a_e4z __pyx_string_tab[8457]
#define __pyx_kp_b_iso88591_oQ_q_31A_a_AT_Q __pyx_string_tab[8458]
#define __pyx_kp_b_iso88591_oQ_q_31A_a_AT_Q_q __pyx_string_tab[8459]
#define __pyx_kp_b_iso88591_o_AZZccd0_a_q_4wa_6_5_q_e1A_81F __pyx_string_tab[8460]
#define __pyx_kp_b_iso88591_q0_HKx_a_a_4y_9AVSTTZZ_aabbc_az __pyx_string_tab[8461]
#define __pyx_kp_b_iso88591_q0_Yiq_a_at7_7_7_7RSSXXYYZ_axvQ __pyx_string_tab[8462]
#define __pyx_kp_b_iso88591_q0_Yk_a_a_q_F_7_7_9AQ_axvQhfAZu __pyx_string_tab[8463]
#define __pyx_kp_b_iso88591_q_00C1_a_Qd_q_a_4uAWAWAQ_z_wgQ __pyx_string_tab[8464]
#define __pyx_kp_b_iso88591_q_1_a_AT_vQd_q __pyx_string_tab[8465]
#define __pyx_kp_b_iso88591_q_1_a_WAQ_uAQ __pyx_string_tab[8466]
#define __pyx_kp_b_iso88591_q_2_a_2_4uAQ_vQa __pyx_string_tab[8467]
#define __pyx_kp_b_iso88591_q_44J_a_q_F_81HAQ_ay_ay_aq __pyx_string_tab[8468]
#define __pyx_kp_b_iso88591_q_4uCvQ_a_Q_q __pyx_string_tab[8469]
#define __pyx_kp_b_iso88591_q_5_8881_awavQfAV1A_Q_a_1D_V6_v __pyx_string_tab[8470]
#define __pyx_kp_b_iso88591_q_5_8881_awavQfAV1A_a_1D_V6_q __pyx_string_tab[8471]
#define __pyx_kp_b_iso88591_q_7_a_AT_2U_3a_q __pyx_string_tab[8472]
#define __pyx_kp_b_iso88591_q_7_a_at9A __pyx_string_tab[8473]
#define __pyx_kp_b_iso88591_q_7_vV1_a_1D_q __pyx_string_tab[8474]
#define __pyx_kp_b_iso88591_q_7_vV1_a_4uA __pyx_string_tab[8475]
#define __pyx_kp_b_iso88591_q_7_vV1_a_4uA_2 __pyx_string_tab[8476]
#define __pyx_kp_b_iso88591_q_7_vV1_a_4wa __pyx_string_tab[8477]
#define __pyx_kp_b_iso88591_q_7_vV1_a_4z __pyx_string_tab[8478]
#define __pyx_kp_b_iso88591_q_7_vV1_a_Qd __pyx_string_tab[8479]
#define __pyx_kp_b_iso88591_q_7_vV1_a_Qd_2 __pyx_string_tab[8480]
#define __pyx_kp_b_iso88591_q_7_vV1_a_V1 __pyx_string_tab[8481]
#define __pyx_kp_b_iso88591_q_7_vV1_a_XQ __pyx_string_tab[8482]
#define __pyx_kp_b_iso88591_q_7_vV1_a_at4q_A __pyx_string_tab[8483]
#define __pyx_kp_b_iso88591_q_7_vV1_a_l __pyx_string_tab[8484]
#define __pyx_kp_b_iso88591_q_7_vV1_a_q_F __pyx_string_tab[8485]
#define __pyx_kp_b_iso88591_q_7_vV1_avQd_q __pyx_string_tab[8486]
#define __pyx_kp_b_iso88591_q_7_vV1_awat6 __pyx_string_tab[8487]
#define __pyx_kp_b_iso88591_q_7_vV1_awat6_2 __pyx_string_tab[8488]
#define __pyx_kp_b_iso88591_q_81A_a_4t1D __pyx_string_tab[8489]
#define __pyx_kp_b_iso88591_q_81A_a_e1 __pyx_string_tab[8490]
#define __pyx_kp_b_iso88591_q_9AZq_az_fA __pyx_string_tab[8491]
#define __pyx_kp_b_iso88591_q_9AZq_az_fA_2 __pyx_string_tab[8492]
#define __pyx_kp_b_iso88591_q_9AZq_az_fA_3 __pyx_string_tab[8493]
#define __pyx_kp_b_iso88591_q_9D_a_a_V1Cq_q __pyx_string_tab[8494]
#define __pyx_kp_b_iso88591_q_A_9AZq_a_fA __pyx_string_tab[8495]
#define __pyx_kp_b_iso88591_q_A_a_at7_1_1A __pyx_string_tab[8496]
#define __pyx_kp_b_iso88591_q_A_a_at81A_uAQ __pyx_string_tab[8497]
#define __pyx_kp_b_iso88591_q_A_a_q_F_5_a_5_q __pyx_string_tab[8498]
#define __pyx_kp_b_iso88591_q_A_q_q_4uAQ_a_1IQgQa_axvQa __pyx_string_tab[8499]
#define __pyx_kp_b_iso88591_q_HA_N_IQfD __pyx_string_tab[8500]
#define __pyx_kp_b_iso88591_q_H_iij_Q_2WF_Q_2WF_5_6_6_F_fA __pyx_string_tab[8501]
#define __pyx_kp_b_iso88591_q_IQ_a_q_F_5_QfE __pyx_string_tab[8502]
#define __pyx_kp_b_iso88591_q_IQoQ_a_at1 __pyx_string_tab[8503]
#define __pyx_kp_b_iso88591_q_Q_a_1D_Qb_a_2Q_q __pyx_string_tab[8504]
#define __pyx_kp_b_iso88591_q_Q_a_1D_Qd_a_4q_q __pyx_string_tab[8505]
#define __pyx_kp_b_iso88591_q_Q_a_2_4_1A_vQa __pyx_string_tab[8506]
#define __pyx_kp_b_iso88591_q_Q_a_2_4_1F_a_6_q __pyx_string_tab[8507]
#define __pyx_kp_b_iso88591_q_Q_a_4_1A_Zq_a_a_2Q_q __pyx_string_tab[8508]
#define __pyx_kp_b_iso88591_q_Q_a_4_1A_q __pyx_string_tab[8509]
#define __pyx_kp_b_iso88591_q_Q_a_4uAQ_az_hd __pyx_string_tab[8510]
#define __pyx_kp_b_iso88591_q_Q_a_at5_uAQ __pyx_string_tab[8511]
#define __pyx_kp_b_iso88591_q_Q_a_at5_vQa __pyx_string_tab[8512]
#define __pyx_kp_b_iso88591_q_Q_a_fAQ_Zq_a_a_2Q_q __pyx_string_tab[8513]
#define __pyx_kp_b_iso88591_q_Q_a_q_F_1_uAQ __pyx_string_tab[8514]
#define __pyx_kp_b_iso88591_q_Q_a_q_F_2Q_a_2Q_q __pyx_string_tab[8515]
#define __pyx_kp_b_iso88591_q_Q_awat5_Zq_a_a_2Q_q __pyx_string_tab[8516]
#define __pyx_kp_b_iso88591_q_Q_awat5_Zq_a_a_2Q_q_2 __pyx_string_tab[8517]
#define __pyx_kp_b_iso88591_q_Q_axq_F_1_Zq_a_a_2Q_q __pyx_string_tab[8518]
#define __pyx_kp_b_iso88591_q_Q_ay_WAQ_Zq_a_a_2Q_q __pyx_string_tab[8519]
#define __pyx_kp_b_iso88591_q_Q_q_a_AT_q_aq_wavQ __pyx_string_tab[8520]
#define __pyx_kp_b_iso88591_q_Qc_1_81Jay_Rq_a_4uI_1_q __pyx_string_tab[8521]
#define __pyx_kp_b_iso88591_q_Qd __pyx_string_tab[8522]
#define __pyx_kp_b_iso88591_q_Rq_a_Qd_q_q __pyx_string_tab[8523]
#define __pyx_kp_b_iso88591_q_Rq_awat5_1_a_2Q_q __pyx_string_tab[8524]
#define __pyx_kp_b_iso88591_q_Rq_awat5_1_q __pyx_string_tab[8525]
#define __pyx_kp_b_iso88591_q_Rq_axq_F_2Q_a_2Q_q __pyx_string_tab[8526]
#define __pyx_kp_b_iso88591_q_Rq_ay_U_2Q_a_2Q_q __pyx_string_tab[8527]
#define __pyx_kp_b_iso88591_q_S_1_a_at5_a_a_1HF_aq_t9AQ_3a __pyx_string_tab[8528]
#define __pyx_kp_b_iso88591_q_S_1_a_at6_6_fFRS_a_1A_a_4q_iq __pyx_string_tab[8529]
#define __pyx_kp_b_iso88591_q_S_a_at5_a_a_1A_t9AQ_1 __pyx_string_tab[8530]
#define __pyx_kp_b_iso88591_q_T_q_awat5_1_q __pyx_string_tab[8531]
#define __pyx_kp_b_iso88591_q_Ya_a_q_F_3a_a_3a_q __pyx_string_tab[8532]
#define __pyx_kp_b_iso88591_q_Yaq_7_Q_AT_XQa_q __pyx_string_tab[8533]
#define __pyx_kp_b_iso88591_q_Yiq_Q_a_WAWAWAQ_axvQhfAXU_1 __pyx_string_tab[8534]
#define __pyx_kp_b_iso88591_q_a_1D __pyx_string_tab[8535]
#define __pyx_kp_b_iso88591_q_a_1D_2 __pyx_string_tab[8536]
#define __pyx_kp_b_iso88591_q_a_1D_3 __pyx_string_tab[8537]
#define __pyx_kp_b_iso88591_q_a_1D_Rq __pyx_string_tab[8538]
#define __pyx_kp_b_iso88591_q_a_1D_q __pyx_string_tab[8539]
#define __pyx_kp_b_iso88591_q_a_1D_q_2 __pyx_string_tab[8540]
#define __pyx_kp_b_iso88591_q_a_4q __pyx_string_tab[8541]
#define __pyx_kp_b_iso88591_q_a_4q_q_q_q_uAQ __pyx_string_tab[8542]
#define __pyx_kp_b_iso88591_q_a_4uA __pyx_string_tab[8543]
#define __pyx_kp_b_iso88591_q_a_4vQfAV1A __pyx_string_tab[8544]
#define __pyx_kp_b_iso88591_q_a_4wavQa __pyx_string_tab[8545]
#define __pyx_kp_b_iso88591_q_a_4wc __pyx_string_tab[8546]
#define __pyx_kp_b_iso88591_q_a_AT __pyx_string_tab[8547]
#define __pyx_kp_b_iso88591_q_a_AT_Qa_y __pyx_string_tab[8548]
#define __pyx_kp_b_iso88591_q_a_AT_QfAQ __pyx_string_tab[8549]
#define __pyx_kp_b_iso88591_q_a_AT_aq_vQa __pyx_string_tab[8550]
#define __pyx_kp_b_iso88591_q_a_Q __pyx_string_tab[8551]
#define __pyx_kp_b_iso88591_q_a_Q_2 __pyx_string_tab[8552]
#define __pyx_kp_b_iso88591_q_a_Q_3 __pyx_string_tab[8553]
#define __pyx_kp_b_iso88591_q_a_Q_IQoQ __pyx_string_tab[8554]
#define __pyx_kp_b_iso88591_q_a_Qd_AQ_uAQ __pyx_string_tab[8555]
#define __pyx_kp_b_iso88591_q_a_Qd_aq_uAQ __pyx_string_tab[8556]
#define __pyx_kp_b_iso88591_q_a_Qd_q_a_1D_Qc_Qa_z_s_Q __pyx_string_tab[8557]
#define __pyx_kp_b_iso88591_q_a_Qd_q_vQa __pyx_string_tab[8558]
#define __pyx_kp_b_iso88591_q_a_Qd_s __pyx_string_tab[8559]
#define __pyx_kp_b_iso88591_q_a_V1A_az_hd_q __pyx_string_tab[8560]
#define __pyx_kp_b_iso88591_q_a_WAQ_y __pyx_string_tab[8561]
#define __pyx_kp_b_iso88591_q_a_XQa_uAQ __pyx_string_tab[8562]
#define __pyx_kp_b_iso88591_q_a_a __pyx_string_tab[8563]
#define __pyx_kp_b_iso88591_q_a_a_4uAQ_a_1D_Qa_wat1 __pyx_string_tab[8564]
#define __pyx_kp_b_iso88591_q_a_a_4uAQ_vQa __pyx_string_tab[8565]
#define __pyx_kp_b_iso88591_q_a_a_AT_vQa __pyx_string_tab[8566]
#define __pyx_kp_b_iso88591_q_a_a_at5_vQa __pyx_string_tab[8567]
#define __pyx_kp_b_iso88591_q_a_a_iq_1A __pyx_string_tab[8568]
#define __pyx_kp_b_iso88591_q_a_a_q_F_1_vQa __pyx_string_tab[8569]
#define __pyx_kp_b_iso88591_q_a_a_q_F_V1A_vQa __pyx_string_tab[8570]
#define __pyx_kp_b_iso88591_q_a_at1 __pyx_string_tab[8571]
#define __pyx_kp_b_iso88591_q_a_at1_2 __pyx_string_tab[8572]
#define __pyx_kp_b_iso88591_q_a_at1_3 __pyx_string_tab[8573]
#define __pyx_kp_b_iso88591_q_a_at1_q __pyx_string_tab[8574]
#define __pyx_kp_b_iso88591_q_a_at5_y __pyx_string_tab[8575]
#define __pyx_kp_b_iso88591_q_a_at7_1_uAQ __pyx_string_tab[8576]
#define __pyx_kp_b_iso88591_q_a_at_q __pyx_string_tab[8577]
#define __pyx_kp_b_iso88591_q_a_e3a __pyx_string_tab[8578]
#define __pyx_kp_b_iso88591_q_a_fAQ_q __pyx_string_tab[8579]
#define __pyx_kp_b_iso88591_q_a_fAT_a_4q_q __pyx_string_tab[8580]
#define __pyx_kp_b_iso88591_q_a_fAV1A __pyx_string_tab[8581]
#define __pyx_kp_b_iso88591_q_a_fAV1A_2 __pyx_string_tab[8582]
#define __pyx_kp_b_iso88591_q_a_fE __pyx_string_tab[8583]
#define __pyx_kp_b_iso88591_q_a_q_A __pyx_string_tab[8584]
#define __pyx_kp_b_iso88591_q_a_q_A_2 __pyx_string_tab[8585]
#define __pyx_kp_b_iso88591_q_a_q_A_3 __pyx_string_tab[8586]
#define __pyx_kp_b_iso88591_q_a_q_A_4 __pyx_string_tab[8587]
#define __pyx_kp_b_iso88591_q_a_q_A_IQ_a __pyx_string_tab[8588]
#define __pyx_kp_b_iso88591_q_a_q_A_IQoQ __pyx_string_tab[8589]
#define __pyx_kp_b_iso88591_q_a_q_A_q __pyx_string_tab[8590]
#define __pyx_kp_b_iso88591_q_a_q_D_Qa_vQ __pyx_string_tab[8591]
#define __pyx_kp_b_iso88591_q_a_q_E __pyx_string_tab[8592]
#define __pyx_kp_b_iso88591_q_a_q_E_y __pyx_string_tab[8593]
#define __pyx_kp_b_iso88591_q_a_q_F_1_y __pyx_string_tab[8594]
#define __pyx_kp_b_iso88591_q_a_q_F_1_y_2 __pyx_string_tab[8595]
#define __pyx_kp_b_iso88591_q_a_q_az_hd_q __pyx_string_tab[8596]
#define __pyx_kp_b_iso88591_q_a_t5_Q_axq_E_Zq_a_q __pyx_string_tab[8597]
#define __pyx_kp_b_iso88591_q_a_y_q_a_q_F_q_vQa __pyx_string_tab[8598]
#define __pyx_kp_b_iso88591_q_awat1 __pyx_string_tab[8599]
#define __pyx_kp_b_iso88591_q_awat1_q __pyx_string_tab[8600]
#define __pyx_kp_b_iso88591_q_awat6_A __pyx_string_tab[8601]
#define __pyx_kp_b_iso88591_q_awat6_F_1_xq __pyx_string_tab[8602]
#define __pyx_kp_b_iso88591_q_axq_A __pyx_string_tab[8603]
#define __pyx_kp_b_iso88591_q_axq_A_2 __pyx_string_tab[8604]
#define __pyx_kp_b_iso88591_q_axq_A_q __pyx_string_tab[8605]
#define __pyx_kp_b_iso88591_q_ay_Q __pyx_string_tab[8606]
#define __pyx_kp_b_iso88591_q_c_a_at6 __pyx_string_tab[8607]
#define __pyx_kp_b_iso88591_q_q_a_4vQgQa_axvQa __pyx_string_tab[8608]
#define __pyx_kp_b_iso88591_q_q_a_Qd_q_a_4uAS_AQ_z_s_Q __pyx_string_tab[8609]
#define __pyx_kp_b_iso88591_q_q_a_WAWAWAQ_G1F_G1F_q __pyx_string_tab[8610]
#define __pyx_kp_b_iso88591_q_q_a_WAZq_a_Q_q __pyx_string_tab[8611]
#define __pyx_kp_b_iso88591_q_q_a_as_az_hd_q __pyx_string_tab[8612]
#define __pyx_kp_b_iso88591_q_q_a_at81A_uAQ __pyx_string_tab[8613]
#define __pyx_kp_b_iso88591_q_q_a_fAT_q_A_a_4q_a_4q_a __pyx_string_tab[8614]
#define __pyx_kp_b_iso88591_q_q_q_a_Qd_q_a_Qd_q_Qe1A_5_U __pyx_string_tab[8615]
#define __pyx_kp_b_iso88591_q_q_q_a_U_1_a_at5_a_at5_vQ_q __pyx_string_tab[8616]
#define __pyx_kp_b_iso88591_q_r_a_4uAT_1D_q __pyx_string_tab[8617]
#define __pyx_kp_b_iso88591_q_s_S_Zs_Cq_a_q_F_3fAT_qPSSYYZZ __pyx_string_tab[8618]
#define __pyx_kp_b_iso88591_q_s_a_at5_A_a_3a_q __pyx_string_tab[8619]
#define __pyx_kp_b_iso88591_q_uAQ_az_e83a __pyx_string_tab[8620]
#define __pyx_kp_b_iso88591_q_uAS_1_81Jaxq_Rq_a_4uHKq_q __pyx_string_tab[8621]
#define __pyx_kp_b_iso88591_r_a_Qd_q_A_a_4q_q __pyx_string_tab[8622]
#define __pyx_kp_b_iso88591_r_a_WAT_q __pyx_string_tab[8623]
#define __pyx_kp_b_iso88591_r_a_fAT_a_4q_q __pyx_string_tab[8624]
#define __pyx_kp_b_iso88591_r_r_a_V1D_q_A_a __pyx_string_tab[8625]
#define __pyx_kp_b_iso88591_s_a_1D_AS_a_3a_q __pyx_string_tab[8626]
#define __pyx_kp_b_iso88591_s_a_4uAS_a_3a_q __pyx_string_tab[8627]
#define __pyx_kp_b_iso88591_s_a_4uBe1Cq_q __pyx_string_tab[8628]
#define __pyx_kp_b_iso88591_s_a_U_3a_a_3a_q __pyx_string_tab[8629]
#define __pyx_kp_b_iso88591_s_a_e1Cq_a_3a_q __pyx_string_tab[8630]
#define __pyx_kp_b_iso88591_s_a_e3e1Cq_q __pyx_string_tab[8631]
#define __pyx_kp_b_iso88591_s_a_fAS_a_3a_q __pyx_string_tab[8632]
#define __pyx_kp_b_iso88591_s_a_fAS_fA_a_3a_d_1A_Q __pyx_string_tab[8633]
#define __pyx_kp_b_iso88591_s_axq_E_Q_a_3a_q __pyx_string_tab[8634]
#define __pyx_kp_b_iso88591_s_ay_V1Cq_a_3a_q __pyx_string_tab[8635]
#define __pyx_kp_b_iso88591_s_az_fCwc_A_q __pyx_string_tab[8636]
#define __pyx_kp_b_iso88591_s_az_gQc_a_3a_q __pyx_string_tab[8637]
#define __pyx_kp_b_iso88591_t1E_a_fAS_a_3a_q __pyx_string_tab[8638]
#define __pyx_kp_b_iso88591_t4q_a_4s_5_vS_4t1E_Q_uAQ __pyx_string_tab[8639]
#define __pyx_kp_b_iso88591_t4q_a_4s_q_5_uAQ __pyx_string_tab[8640]
#define __pyx_kp_b_iso88591_t5_1_q_7_vV1_a_4wa __pyx_string_tab[8641]
#define __pyx_kp_b_iso88591_t5_1_q_7_vV1_a_at6 __pyx_string_tab[8642]
#define __pyx_kp_b_iso88591_t9A __pyx_string_tab[8643]
#define __pyx_kp_b_iso88591_t9AQ __pyx_string_tab[8644]
#define __pyx_kp_b_iso88591_t9AQ_2 __pyx_string_tab[8645]
#define __pyx_kp_b_iso88591_t_2 __pyx_string_tab[8646]
#define __pyx_kp_b_iso88591_t_3 __pyx_string_tab[8647]
#define __pyx_kp_b_iso88591_t_4 __pyx_string_tab[8648]
#define __pyx_kp_b_iso88591_uAQ_4q_a_Qd_a_6_q __pyx_string_tab[8649]
#define __pyx_kp_b_iso88591_uAQ_A_a_1D_XQm1_a_q __pyx_string_tab[8650]
#define __pyx_kp_b_iso88591_uAQ_Q_a_AT_havQ_a_6_q __pyx_string_tab[8651]
#define __pyx_kp_b_iso88591_uAQ_Q_a_at6_uAQ __pyx_string_tab[8652]
#define __pyx_kp_b_iso88591_uAQ_Q_a_at6_vQa __pyx_string_tab[8653]
#define __pyx_kp_b_iso88591_uAQ_Q_a_q_F_1_y __pyx_string_tab[8654]
#define __pyx_kp_b_iso88591_uAQ_a_Qd_at1 __pyx_string_tab[8655]
#define __pyx_kp_b_iso88591_uAQ_a_Qd_xq_y __pyx_string_tab[8656]
#define __pyx_kp_b_iso88591_uAQ_a_U __pyx_string_tab[8657]
#define __pyx_kp_b_iso88591_uAQ_a_Zq __pyx_string_tab[8658]
#define __pyx_kp_b_iso88591_uAQ_a_Zxq_vQa __pyx_string_tab[8659]
#define __pyx_kp_b_iso88591_uAQ_a_at7_Q __pyx_string_tab[8660]
#define __pyx_kp_b_iso88591_uAQ_q_q_a_1D_haq_a_q_F_1_waxq __pyx_string_tab[8661]
#define __pyx_kp_b_iso88591_uAQ_s_a_at7_3a_a_3a_q __pyx_string_tab[8662]
#define __pyx_kp_b_iso88591_uAQ_uAQ_1_a_Qd_HHAQ_vQa __pyx_string_tab[8663]
#define __pyx_kp_b_iso88591_uAQ_uAQ_Qa_a_at6 __pyx_string_tab[8664]
#define __pyx_kp_b_iso88591_uAQ_uAQ_a_1D_ha __pyx_string_tab[8665]
#define __pyx_kp_b_iso88591_uAQ_uAQ_a_Qd_xq __pyx_string_tab[8666]
#define __pyx_kp_b_iso88591_uA_8_a_Qd_uAQ __pyx_string_tab[8667]
#define __pyx_kp_b_iso88591_uE_e5_a_Qd_q_a_AT_as_3as_3as_1 __pyx_string_tab[8668]
#define __pyx_kp_b_iso88591_uE_e5_az_e1A_a_4q_Cq_1A_Cq_1A_a __pyx_string_tab[8669]
#define __pyx_kp_b_iso88591_uE_e5_az_e1A_a_4q_Cq_1A_Cq_1A_a_2 __pyx_string_tab[8670]
#define __pyx_kp_b_iso88591_vQ_U_1_Q_a_e6_q __pyx_string_tab[8671]
#define __pyx_kp_b_iso88591_vQ_aq_Rq_a_q_E_1Be1A_c_Qd_fA_1 __pyx_string_tab[8672]
#define __pyx_kp_b_iso88591_vQ_e1A_Q_a_4uF_6_PQ_q __pyx_string_tab[8673]
#define __pyx_kp_b_iso88591_vQd_1_YfA __pyx_string_tab[8674]
#define __pyx_kp_b_iso88591_vQd_YfA __pyx_string_tab[8675]
#define __pyx_kp_b_iso88591_w_x_E_E_f_f_g_k_Ja_Qk_Q_E_q_F_F __pyx_string_tab[8676]
#define __pyx_kp_b_iso88591_wa_r_a_at_QgV1D_y __pyx_string_tab[8677]
#define __pyx_kp_b_iso88591_xq2_uAQ_q_q_a_1D_gQgQa_QhfAQ __pyx_string_tab[8678]
#define __pyx_kp_b_iso88591_xq_5_t1_a_4_4q_a_Q_q __pyx_string_tab[8679]
#define __pyx_kp_b_iso88591_xq_E_a_Qd __pyx_string_tab[8680]
#define __pyx_kp_b_iso88591_xq_Q_8_a_Qd_y_QiuAQ __pyx_string_tab[8681]
#define __pyx_kp_b_iso88591_xq_Q_uAQ_y_q_a_q_E_uAQ __pyx_string_tab[8682]
#define __pyx_kp_b_iso88591_xq_Qa_a_1D_fAQ_xq __pyx_string_tab[8683]
#define __pyx_kp_b_iso88591_xq_U_1_Q_Q_a_Qd_s_4q_vQe6 __pyx_string_tab[8684]
#define __pyx_kp_b_iso88591_xq_U_1_a_AT_a __pyx_string_tab[8685]
#define __pyx_kp_b_iso88591_xq_U_1_a_AT_fAQ_y __pyx_string_tab[8686]
#define __pyx_kp_b_iso88591_xq_U_1_a_fA __pyx_string_tab[8687]
#define __pyx_kp_b_iso88591_xq_U_1_q_XQgQj_F_1_a_U_Q_a_a_G9 __pyx_string_tab[8688]
#define __pyx_kp_b_iso88591_xq_a_q_F __pyx_string_tab[8689]
#define __pyx_kp_b_iso88591_xq_e1A_a_1D __pyx_string_tab[8690]
#define __pyx_kp_b_iso88591_xq_e1A_a_Qd __pyx_string_tab[8691]
#define __pyx_kp_b_iso88591_xq_iq_Qa_a_Qd_a __pyx_string_tab[8692]
#define __pyx_kp_b_iso88591_xq_uAQ_a_4t1D __pyx_string_tab[8693]
#define __pyx_kp_b_iso88591_xq_uAQ_a_at_T_q __pyx_string_tab[8694]
#define __pyx_kp_b_iso88591_xq_uAQ_s_a_4uHAS_a_3a_q __pyx_string_tab[8695]
#define __pyx_kp_b_iso88591_xq_uAQ_s_a_AT_A_a_3a_q __pyx_string_tab[8696]
#define __pyx_kp_b_iso88591_xq_uA_6a_a_AT_xq_uAQ __pyx_string_tab[8697]
#define __pyx_kp_b_iso88591_xq_uA_7q_uAQ_a_0_V881A_uAQ __pyx_string_tab[8698]
#define __pyx_kp_b_iso88591_xq_y_q_a_q_E __pyx_string_tab[8699]
#define __pyx_kp_b_iso88591_xvQ_fAQ_a_a_Qd_aq_vQa __pyx_string_tab[8700]
#define __pyx_kp_b_iso88591_y_1_5_vV4q_b_az_gU_3as_Qd __pyx_string_tab[8701]
#define __pyx_kp_b_iso88591_y_4s_S_q_F_1Cq_a_3a_q __pyx_string_tab[8702]
#define __pyx_kp_b_iso88591_y_4s_S_q_F_1Cq_a_q_1_q __pyx_string_tab[8703]
#define __pyx_kp_b_iso88591_y_5_6_5_e1_AQ_S_5_5_1_q_F_aq_Q __pyx_string_tab[8704]
#define __pyx_kp_b_iso88591_y_6_F_q_a_WE_az_hd_q __pyx_string_tab[8705]
#define __pyx_kp_b_iso88591_y_6_q __pyx_string_tab[8706]
#define __pyx_kp_b_iso88591_y_7_V9Cq_AZq_q_a_1D_e7_wavQ_q __pyx_string_tab[8707]
#define __pyx_kp_b_iso88591_y_7_V9Cq_AZq_q_a_at6_WAV1_q __pyx_string_tab[8708]
#define __pyx_kp_b_iso88591_y_81A_a_Qd __pyx_string_tab[8709]
#define __pyx_kp_b_iso88591_y_a __pyx_string_tab[8710]
#define __pyx_kp_b_iso88591_y_a_2 __pyx_string_tab[8711]
#define __pyx_kp_b_iso88591_y_a_6_a_at5 __pyx_string_tab[8712]
#define __pyx_kp_b_iso88591_y_a_a_AT_a __pyx_string_tab[8713]
#define __pyx_kp_b_iso88591_y_aq_a_AT_q __pyx_string_tab[8714]
#define __pyx_kp_b_iso88591_y_c_6_A_e7_2Q_AT_ar_a_2Q_q __pyx_string_tab[8715]
#define __pyx_kp_b_iso88591_y_fAQ_Qm1A_2WF_a_1D_V1F __pyx_string_tab[8716]
#define __pyx_kp_b_iso88591_y_fAQ_a_AT __pyx_string_tab[8717]
#define __pyx_kp_b_iso88591_y_fAQ_a_Qd_q __pyx_string_tab[8718]
#define __pyx_kp_b_iso88591_y_haq_Q_2WA_1A_a_Qd_vQ_q __pyx_string_tab[8719]
#define __pyx_kp_b_iso88591_y_havQ_a_at6_A_q __pyx_string_tab[8720]
#define __pyx_kp_b_iso88591_y_q_1_A_a_1D_Q __pyx_string_tab[8721]
#define __pyx_kp_b_iso88591_y_q_4wfG3d_1_a_d_4vQ __pyx_string_tab[8722]
#define __pyx_kp_b_iso88591_y_q_a_AT_a __pyx_string_tab[8723]
#define __pyx_kp_b_iso88591_y_q_a_AT_gQa_a_Qaq __pyx_string_tab[8724]
#define __pyx_kp_b_iso88591_y_q_a_Qd __pyx_string_tab[8725]
#define __pyx_kp_b_iso88591_y_q_a_q_D_V1A_5_6_a_4q_Q_a_3a_q __pyx_string_tab[8726]
#define __pyx_kp_b_iso88591_y_q_a_q_E __pyx_string_tab[8727]
#define __pyx_kp_b_iso88591_y_q_b_a_Qd_was_q __pyx_string_tab[8728]
#define __pyx_kp_b_iso88591_zYZ_uAQ_vQa_vQa_vQa_q_a_at7_gWA __pyx_string_tab[8729]
#define __pyx_kp_b_iso88591_z_8_Q_az_fE __pyx_string_tab[8730]
#define __pyx_kp_b_iso88591_z_A_IQa_6_E_T_q_a_AT_IQ_q __pyx_string_tab[8731]
#define __pyx_kp_b_iso88591_z_A_vQa_vQa_4uAQ_a_1IWA __pyx_string_tab[8732]
#define __pyx_kp_b_iso88591_z_a_1D_axq_uAYe1A __pyx_string_tab[8733]
#define __pyx_kp_b_iso88591_z_a_Qd_q_uAYe1A __pyx_string_tab[8734]
#define __pyx_kp_b_iso88591_z_a_fAXQa_uAYe1A __pyx_string_tab[8735]
#define __pyx_kp_b_iso88591_z_e1A_fAQ_az_fF __pyx_string_tab[8736]
#define __pyx_kp_b_iso88591_z_fAQ_a_at5 __pyx_string_tab[8737]
#define __pyx_kp_b_iso88591_z_q_a_4vQ __pyx_string_tab[8738]
#define __pyx_kp_b_iso88591_z_q_a_WCq_G6_Qa_5_WA_7_HAWAWF_1 __pyx_string_tab[8739]
#define __pyx_n_b_O __pyx_string_tab[8740]
#define __pyx_float_0_ __pyx_number_tab[0]
#define __pyx_float_0_0 __pyx_number_tab[1]
#define __pyx_float_1_0 __pyx_number_tab[2]
#define __pyx_int_0 __pyx_number_tab[3]
#define __pyx_int_neg_1 __pyx_number_tab[4]
#define __pyx_int_1 __pyx_number_tab[5]
#define __pyx_int_2 __pyx_number_tab[6]
#define __pyx_int_3 __pyx_number_tab[7]
#define __pyx_int_4 __pyx_number_tab[8]
#define __pyx_int_5 __pyx_number_tab[9]
#define __pyx_int_6 __pyx_number_tab[10]
#define __pyx_int_7 __pyx_number_tab[11]
#define __pyx_int_8 __pyx_number_tab[12]
#define __pyx_int_9 __pyx_number_tab[13]
#define __pyx_int_10 __pyx_number_tab[14]
#define __pyx_int_13 __pyx_number_tab[15]
#define __pyx_int_17 __pyx_number_tab[16]
#define __pyx_int_18 __pyx_number_tab[17]
#define __pyx_int_19 __pyx_number_tab[18]
#define __pyx_int_23 __pyx_number_tab[19]
#define __pyx_int_32 __pyx_number_tab[20]
#define __pyx_int_34 __pyx_number_tab[21]
#define __pyx_int_43 __pyx_number_tab[22]
#define __pyx_int_45 __pyx_number_tab[23]
#define __pyx_int_46 __pyx_number_tab[24]
#define __pyx_int_47 __pyx_number_tab[25]
#define __pyx_int_48 __pyx_number_tab[26]
#define __pyx_int_59 __pyx_number_tab[27]
#define __pyx_int_83 __pyx_number_tab[28]
#define __pyx_int_93 __pyx_number_tab[29]
#define __pyx_int_96 __pyx_number_tab[30]
#define __pyx_int_97 __pyx_number_tab[31]
#define __pyx_int_109 __pyx_number_tab[32]
#define __pyx_int_111 __pyx_number_tab[33]
#define __pyx_int_112 __pyx_number_tab[34]
#define __pyx_int_136983863 __pyx_number_tab[35]
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
  __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(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);
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __Pyx_State_RemoveModule(NULL);
  #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_SNESLineSearch);
  Py_CLEAR(clear_module_state->PyPetscSNESLineSearch_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_TAOTerm);
  Py_CLEAR(clear_module_state->PyPetscTAOTerm_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_CellDM);
  Py_CLEAR(clear_module_state->PyPetscDMSwarmCellDM_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_Regressor);
  Py_CLEAR(clear_module_state->PyPetscRegressor_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__PyVwr);
  Py_CLEAR(clear_module_state->__pyx_type_8petsc4py_5PETSc__PyVwr);
  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_k__18);
  Py_CLEAR(clear_module_state->__pyx_k__19);
  Py_CLEAR(clear_module_state->__pyx_k__20);
  Py_CLEAR(clear_module_state->__pyx_k__21);
  Py_CLEAR(clear_module_state->__pyx_k__22);
  Py_CLEAR(clear_module_state->__pyx_k__23);
  Py_CLEAR(clear_module_state->__pyx_k__24);
  Py_CLEAR(clear_module_state->__pyx_k__25);
  Py_CLEAR(clear_module_state->__pyx_k__26);
  for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
  for (int i=0; i<213; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
  for (int i=0; i<2052; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<8741; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<36; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_clear_contents ### */
/* CommonTypesMetaclass.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);

/* CythonFunctionShared.module_state_clear */
Py_CLEAR(clear_module_state->__pyx_CyFunctionType);

/* #### Code section: module_state_clear_end ### */
return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(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);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
  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_SNESLineSearch);
  Py_VISIT(traverse_module_state->PyPetscSNESLineSearch_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_TAOTerm);
  Py_VISIT(traverse_module_state->PyPetscTAOTerm_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_CellDM);
  Py_VISIT(traverse_module_state->PyPetscDMSwarmCellDM_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_Regressor);
  Py_VISIT(traverse_module_state->PyPetscRegressor_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__PyVwr);
  Py_VISIT(traverse_module_state->__pyx_type_8petsc4py_5PETSc__PyVwr);
  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_k__18);
  Py_VISIT(traverse_module_state->__pyx_k__19);
  Py_VISIT(traverse_module_state->__pyx_k__20);
  Py_VISIT(traverse_module_state->__pyx_k__21);
  Py_VISIT(traverse_module_state->__pyx_k__22);
  Py_VISIT(traverse_module_state->__pyx_k__23);
  Py_VISIT(traverse_module_state->__pyx_k__24);
  Py_VISIT(traverse_module_state->__pyx_k__25);
  Py_VISIT(traverse_module_state->__pyx_k__26);
  for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
  for (int i=0; i<213; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
  for (int i=0; i<2052; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<8741; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  for (int i=0; i<36; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
/* #### Code section: module_state_traverse_contents ### */
/* CommonTypesMetaclass.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);

/* CythonFunctionShared.module_state_traverse */
Py_VISIT(traverse_module_state->__pyx_CyFunctionType);

/* #### Code section: module_state_traverse_end ### */
return 0;
}
#endif
/* #### Code section: module_code ### */

/* "petsc4py/PETSc/Device.pyx":34
 *     ("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(*)(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_SIZE
  __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);
  const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (__pyx_kwds_len > 0) {
    if (unlikely(__Pyx_CheckKeywordStrings("lambda", __pyx_kwds) == -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", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_PetscDeviceType(PETSC_DEVICE_DEFAULT()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 34, __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":137
 *         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_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shape,&__pyx_mstate_global->__pyx_n_u_itemsize,&__pyx_mstate_global->__pyx_n_u_format,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_allocate_buffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(6, 137, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(6, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(6, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(6, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(6, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(6, 137, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, i); __PYX_ERR(6, 137, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(6, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(6, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(6, 137, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(6, 137, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 137, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_c));
    }
    __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(6, 137, __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(6, 138, __pyx_L3_error)
    } else {

      /* "View.MemoryView":138
 * 
 *     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(6, 137, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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(6, 137, __pyx_L1_error)
  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
    PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(6, 137, __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":137
 *         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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  size_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11[5];
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_format);

  /* "View.MemoryView":143
 *         cdef Py_ssize_t dim
 * 
 *         self.ndim = <int> 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(6, 143, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(6, 143, __pyx_L1_error)
  __pyx_v_self->ndim = ((int)__pyx_t_1);

  /* "View.MemoryView":144
 * 
 *         self.ndim = <int> len(shape)
 *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not self.ndim:
*/
  __pyx_v_self->itemsize = __pyx_v_itemsize;

  /* "View.MemoryView":146
 *         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":147
 * 
 *         if not self.ndim:
 *             raise ValueError, "Empty shape tuple for cython.array"             # <<<<<<<<<<<<<<
 * 
 *         if itemsize <= 0:
*/
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_mstate_global->__pyx_kp_u_Empty_shape_tuple_for_cython_arr, 0, 0);
    __PYX_ERR(6, 147, __pyx_L1_error)

    /* "View.MemoryView":146
 *         self.itemsize = itemsize
 * 
 *         if not self.ndim:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Empty shape tuple for cython.array"
 * 
*/
  }

  /* "View.MemoryView":149
 *             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":150
 * 
 *         if itemsize <= 0:
 *             raise ValueError, "itemsize <= 0 for cython.array"             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(format, bytes):
*/
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_mstate_global->__pyx_kp_u_itemsize_0_for_cython_array, 0, 0);
    __PYX_ERR(6, 150, __pyx_L1_error)

    /* "View.MemoryView":149
 *             raise ValueError, "Empty shape tuple for cython.array"
 * 
 *         if itemsize <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError, "itemsize <= 0 for cython.array"
 * 
*/
  }

  /* "View.MemoryView":152
 *             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":153
 * 
 *         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_v_format;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "View.MemoryView":152
 *             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":154
 *         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_4 = __pyx_v_format;
  __Pyx_INCREF(__pyx_t_4);
  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(6, 154, __pyx_L1_error)
  __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":155
 *             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(6, 155, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(6, 155, __pyx_L1_error)
  __pyx_v_self->format = __pyx_t_7;

  /* "View.MemoryView":158
 * 
 * 
 *         self._shape = <Py_ssize_t *> 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":159
 * 
 *         self._shape = <Py_ssize_t *> 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":161
 *         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":162
 * 
 *         if not self._shape:
 *             raise MemoryError, "unable to allocate shape and strides."             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_shape_and_str, 0, 0);
    __PYX_ERR(6, 162, __pyx_L1_error)

    /* "View.MemoryView":161
 *         self._strides = self._shape + self.ndim
 * 
 *         if not self._shape:             # <<<<<<<<<<<<<<
 *             raise MemoryError, "unable to allocate shape and strides."
 * 
*/
  }

  /* "View.MemoryView":165
 * 
 * 
 *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
 *             if dim <= 0:
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
*/
  __pyx_t_8 = 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_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(6, 165, __pyx_L1_error)
      #endif
      if (__pyx_t_1 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1));
    #else
    __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1);
    #endif
    ++__pyx_t_1;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 165, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_dim = __pyx_t_9;
    __pyx_v_idx = __pyx_t_8;
    __pyx_t_8 = (__pyx_t_8 + 1);

    /* "View.MemoryView":166
 * 
 *         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":167
 *         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 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis;
      __pyx_t_11[1] = __pyx_t_5;
      __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_;
      __pyx_t_11[3] = __pyx_t_10;
      __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u__2;
      __pyx_t_12 = __Pyx_PyUnicode_Join(__pyx_t_11, 5, 22 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 1, 127);
      if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_12, 0, 0);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __PYX_ERR(6, 167, __pyx_L1_error)

      /* "View.MemoryView":166
 * 
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
 *             self._shape[idx] = dim
*/
    }

    /* "View.MemoryView":168
 *             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":165
 * 
 * 
 *         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":171
 * 
 *         cdef char order
 *         if mode == 'c':             # <<<<<<<<<<<<<<
 *             order = b'C'
 *             self.mode = u'c'
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(6, 171, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "View.MemoryView":172
 *         cdef char order
 *         if mode == 'c':
 *             order = b'C'             # <<<<<<<<<<<<<<
 *             self.mode = u'c'
 *         elif mode == 'fortran':
*/
    __pyx_v_order = 'C';

    /* "View.MemoryView":173
 *         if mode == 'c':
 *             order = b'C'
 *             self.mode = u'c'             # <<<<<<<<<<<<<<
 *         elif mode == 'fortran':
 *             order = b'F'
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_c);
    __Pyx_GOTREF(__pyx_v_self->mode);
    __Pyx_DECREF(__pyx_v_self->mode);
    __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_c;

    /* "View.MemoryView":171
 * 
 *         cdef char order
 *         if mode == 'c':             # <<<<<<<<<<<<<<
 *             order = b'C'
 *             self.mode = u'c'
*/
    goto __pyx_L11;
  }

  /* "View.MemoryView":174
 *             order = b'C'
 *             self.mode = u'c'
 *         elif mode == 'fortran':             # <<<<<<<<<<<<<<
 *             order = b'F'
 *             self.mode = u'fortran'
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(6, 174, __pyx_L1_error)
  if (likely(__pyx_t_3)) {

    /* "View.MemoryView":175
 *             self.mode = u'c'
 *         elif mode == 'fortran':
 *             order = b'F'             # <<<<<<<<<<<<<<
 *             self.mode = u'fortran'
 *         else:
*/
    __pyx_v_order = 'F';

    /* "View.MemoryView":176
 *         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_mstate_global->__pyx_n_u_fortran);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_fortran);
    __Pyx_GOTREF(__pyx_v_self->mode);
    __Pyx_DECREF(__pyx_v_self->mode);
    __pyx_v_self->mode = __pyx_mstate_global->__pyx_n_u_fortran;

    /* "View.MemoryView":174
 *             order = b'C'
 *             self.mode = u'c'
 *         elif mode == 'fortran':             # <<<<<<<<<<<<<<
 *             order = b'F'
 *             self.mode = u'fortran'
*/
    goto __pyx_L11;
  }

  /* "View.MemoryView":178
 *             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_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_12, 0, 0);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __PYX_ERR(6, 178, __pyx_L1_error)
  }
  __pyx_L11:;

  /* "View.MemoryView":180
 *             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":182
 *         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":183
 * 
 *         self.free_data = allocate_buffer
 *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
 * 
 *         if allocate_buffer:
*/
  __pyx_t_12 = PyObject_RichCompare(__pyx_v_format, __pyx_mstate_global->__pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 183, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_v_self->dtype_is_object = __pyx_t_3;

  /* "View.MemoryView":185
 *         self.dtype_is_object = format == b'O'
 * 
 *         if allocate_buffer:             # <<<<<<<<<<<<<<
 *             _allocate_buffer(self)
 * 
*/
  if (__pyx_v_allocate_buffer) {

    /* "View.MemoryView":186
 * 
 *         if allocate_buffer:
 *             _allocate_buffer(self)             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
*/
    __pyx_t_8 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 186, __pyx_L1_error)

    /* "View.MemoryView":185
 *         self.dtype_is_object = format == b'O'
 * 
 *         if allocate_buffer:             # <<<<<<<<<<<<<<
 *             _allocate_buffer(self)
 * 
*/
  }

  /* "View.MemoryView":137
 *         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_10);
  __Pyx_XDECREF(__pyx_t_12);
  __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":188
 *             _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":190
 *     @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":191
 *     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":192
 *         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_mstate_global->__pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(6, 192, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "View.MemoryView":193
 *         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":192
 *         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":194
 *             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_mstate_global->__pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(6, 194, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "View.MemoryView":195
 *                 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":194
 *             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":196
 *             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":197
 *                 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(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_mstate_global->__pyx_kp_u_Can_only_create_a_buffer_that_is, 0, 0);
      __PYX_ERR(6, 197, __pyx_L1_error)

      /* "View.MemoryView":196
 *             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":191
 *     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":198
 *             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":199
 *                 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":201
 *         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":202
 * 
 *         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":203
 *         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":204
 *             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":201
 *         info.len = self.len
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.ndim = self.ndim
 *             info.shape = self._shape
*/
    goto __pyx_L6;
  }

  /* "View.MemoryView":206
 *             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":207
 *         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":208
 *             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":210
 *             info.strides = NULL
 * 
 *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *         info.itemsize = self.itemsize
 *         info.readonly = 0
*/
  __pyx_v_info->suboffsets = NULL;

  /* "View.MemoryView":211
 * 
 *         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":212
 *         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":213
 *         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":214
 *         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":188
 *             _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":216
 *         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":217
 * 
 *     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":218
 *     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":217
 * 
 *     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":219
 *         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":220
 *             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":221
 *         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":220
 *             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":222
 *             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":219
 *         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":223
 *                 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":216
 *         info.obj = self
 * 
 *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
*/

  /* function exit code */
}

/* "View.MemoryView":225
 *         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__", 0);

  /* "View.MemoryView":227
 *     @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(6, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":225
 *         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":229
 *         return self.get_memview()
 * 
 *     @cname('get_memview')             # <<<<<<<<<<<<<<
 *     cdef get_memview(self):
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
*/

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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_memview", 0);

  /* "View.MemoryView":231
 *     @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":232
 *     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_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 232, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":229
 *         return self.get_memview()
 * 
 *     @cname('get_memview')             # <<<<<<<<<<<<<<
 *     cdef get_memview(self):
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
*/

  /* 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("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":234
 *         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":235
 * 
 *     def __len__(self):
 *         return self._shape[0]             # <<<<<<<<<<<<<<
 * 
 *     def __getattr__(self, attr):
*/
  __pyx_r = (__pyx_v_self->_shape[0]);
  goto __pyx_L0;

  /* "View.MemoryView":234
 *         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":237
 *         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__", 0);

  /* "View.MemoryView":238
 * 
 *     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_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 238, __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(6, 238, __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":237
 *         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":240
 *         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__", 0);

  /* "View.MemoryView":241
 * 
 *     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_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 241, __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(6, 241, __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":240
 *         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":243
 *         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__", 0);

  /* "View.MemoryView":244
 * 
 *     def __setitem__(self, item, value):
 *         self.memview[item] = value             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(6, 244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":243
 *         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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); 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__", 0);

  /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(6, 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(6, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(6, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(6, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 3, __pyx_L3_error)
    }
    __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(6, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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__", 0);

  /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(6, 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":253
 *         pass
 * 
 * @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":260
 *     cdef PyObject **p
 * 
 *     self.free_data = True             # <<<<<<<<<<<<<<
 *     self.data = <char *>malloc(self.len)
 *     if not self.data:
*/
  __pyx_v_self->free_data = 1;

  /* "View.MemoryView":261
 * 
 *     self.free_data = True
 *     self.data = <char *>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":262
 *     self.free_data = True
 *     self.data = <char *>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":263
 *     self.data = <char *>malloc(self.len)
 *     if not self.data:
 *         raise MemoryError, "unable to allocate array data."             # <<<<<<<<<<<<<<
 * 
 *     if self.dtype_is_object:
*/
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_MemoryError))), __pyx_mstate_global->__pyx_kp_u_unable_to_allocate_array_data, 0, 0);
    __PYX_ERR(6, 263, __pyx_L1_error)

    /* "View.MemoryView":262
 *     self.free_data = True
 *     self.data = <char *>malloc(self.len)
 *     if not self.data:             # <<<<<<<<<<<<<<
 *         raise MemoryError, "unable to allocate array data."
 * 
*/
  }

  /* "View.MemoryView":265
 *         raise MemoryError, "unable to allocate array data."
 * 
 *     if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *         p = <PyObject **> self.data
 *         for i in range(self.len // self.itemsize):
*/
  if (__pyx_v_self->dtype_is_object) {

    /* "View.MemoryView":266
 * 
 *     if self.dtype_is_object:
 *         p = <PyObject **> self.data             # <<<<<<<<<<<<<<
 *         for i in range(self.len // self.itemsize):
 *             p[i] = Py_None
*/
    __pyx_v_p = ((PyObject **)__pyx_v_self->data);

    /* "View.MemoryView":267
 *     if self.dtype_is_object:
 *         p = <PyObject **> 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(6, 267, __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(6, 267, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize, 0);
    __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":268
 *         p = <PyObject **> 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":269
 *         for i in range(self.len // self.itemsize):
 *             p[i] = Py_None
 *             Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 *     return 0
 * 
*/
      Py_INCREF(Py_None);
    }

    /* "View.MemoryView":265
 *         raise MemoryError, "unable to allocate array data."
 * 
 *     if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *         p = <PyObject **> self.data
 *         for i in range(self.len // self.itemsize):
*/
  }

  /* "View.MemoryView":270
 *             p[i] = Py_None
 *             Py_INCREF(Py_None)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":253
 *         pass
 * 
 * @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":273
 * 
 * 
 * @cname("__pyx_array_new")             # <<<<<<<<<<<<<<
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
 *     cdef array result
*/

static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char const *__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", 0);

  /* "View.MemoryView":276
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const 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_mstate_global->__pyx_n_u_fortran);
    __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_fortran;
  } else {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_c);
    __pyx_t_1 = __pyx_mstate_global->__pyx_n_u_c;
  }
  __pyx_v_mode = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":278
 *     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":279
 * 
 *     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 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 279, __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) != (0)) __PYX_ERR(6, 279, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(6, 279, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(6, 279, __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) != (0)) __PYX_ERR(6, 279, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 279, __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":278
 *     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":281
 *         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 = PyLong_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 281, __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) != (0)) __PYX_ERR(6, 281, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3) != (0)) __PYX_ERR(6, 281, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4) != (0)) __PYX_ERR(6, 281, __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) != (0)) __PYX_ERR(6, 281, __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(6, 281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_allocate_buffer, Py_False) < (0)) __PYX_ERR(6, 281, __pyx_L1_error)
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_mstate_global->__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 281, __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":282
 *     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":284
 *         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":273
 * 
 * 
 * @cname("__pyx_array_new")             # <<<<<<<<<<<<<<
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, const char *c_mode, char *buf):
 *     cdef array 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.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":310
 * 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_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(6, 310, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 310, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(6, 310, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(6, 310, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 310, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(6, 310, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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__", 0);

  /* "View.MemoryView":311
 *     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":310
 * 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":312
 *     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__", 0);

  /* "View.MemoryView":313
 *         self.name = name
 *     def __repr__(self):
 *         return self.name             # <<<<<<<<<<<<<<
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* "View.MemoryView":312
 *     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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); 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;
  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("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.name,)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
*/
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 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) != (0)) __PYX_ERR(6, 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 and _dict:
 *         state += (_dict,)
*/
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 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 and _dict:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
*/
  __pyx_t_3 = (__pyx_v__dict != 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__dict); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(6, 7, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None and _dict:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
*/
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 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) != (0)) __PYX_ERR(6, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None and _dict:
 *         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 and _dict:             # <<<<<<<<<<<<<<
 *         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_4, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 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)))) != (0)) __PYX_ERR(6, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(6, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None) != (0)) __PYX_ERR(6, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 13, __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) != (0)) __PYX_ERR(6, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1) != (0)) __PYX_ERR(6, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state) != (0)) __PYX_ERR(6, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 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_5, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 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)))) != (0)) __PYX_ERR(6, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_136983863);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_136983863);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_int_136983863) != (0)) __PYX_ERR(6, 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) != (0)) __PYX_ERR(6, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 15, __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) != (0)) __PYX_ERR(6, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(6, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(6, 16, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 16, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(6, 16, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(6, 16, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 16, __pyx_L3_error)
    }
    __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(6, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(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)             # <<<<<<<<<<<<<<
*/
  __pyx_t_1 = __pyx_v___pyx_state;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(6, 17, __pyx_L1_error)
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
    __PYX_ERR(6, 17, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 17, __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;

  /* "(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_XDECREF(__pyx_t_2);
  __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":356
 *     cdef const __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_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_obj,&__pyx_mstate_global->__pyx_n_u_flags,&__pyx_mstate_global->__pyx_n_u_dtype_is_object,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(6, 356, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(6, 356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(6, 356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(6, 356, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, i); __PYX_ERR(6, 356, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(6, 356, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(6, 356, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 356, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_flags = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 356, __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(6, 356, __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(6, 356, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "View.MemoryView":357
 * 
 *     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":358
 *     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:
 *             PyObject_GetBuffer(obj, &self.view, flags)
*/
  __pyx_v_self->flags = __pyx_v_flags;

  /* "View.MemoryView":359
 *         self.obj = obj
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
 *             PyObject_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
*/
  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_mstate_global->__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":360
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:
 *             PyObject_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
*/
    __pyx_t_3 = PyObject_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 360, __pyx_L1_error)

    /* "View.MemoryView":361
 *         if type(self) is memoryview or obj is not None:
 *             PyObject_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> 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":362
 *             PyObject_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> 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":363
 *             if <PyObject *> 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":361
 *         if type(self) is memoryview or obj is not None:
 *             PyObject_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)
*/
    }

    /* "View.MemoryView":359
 *         self.obj = obj
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
 *             PyObject_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
*/
  }

  /* "View.MemoryView":365
 *                 Py_INCREF(Py_None)
 * 
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():             # <<<<<<<<<<<<<<
 *             global __pyx_memoryview_thread_locks_used
 *             if (__pyx_memoryview_thread_locks_used < 8 and
*/
  __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
  if (__pyx_t_1) {

    /* "View.MemoryView":367
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():
 *             global __pyx_memoryview_thread_locks_used
 *             if (__pyx_memoryview_thread_locks_used < 8 and             # <<<<<<<<<<<<<<
 * 
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
*/
    __pyx_t_2 = (__pyx_memoryview_thread_locks_used < 8);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L9_bool_binop_done;
    }

    /* "View.MemoryView":369
 *             if (__pyx_memoryview_thread_locks_used < 8 and
 * 
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):             # <<<<<<<<<<<<<<
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *                 __pyx_memoryview_thread_locks_used += 1
*/
    __pyx_t_2 = (!__PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING());
    __pyx_t_1 = __pyx_t_2;
    __pyx_L9_bool_binop_done:;

    /* "View.MemoryView":367
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():
 *             global __pyx_memoryview_thread_locks_used
 *             if (__pyx_memoryview_thread_locks_used < 8 and             # <<<<<<<<<<<<<<
 * 
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
*/
    if (__pyx_t_1) {

      /* "View.MemoryView":370
 * 
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
 *                 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":371
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
 *                 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":367
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():
 *             global __pyx_memoryview_thread_locks_used
 *             if (__pyx_memoryview_thread_locks_used < 8 and             # <<<<<<<<<<<<<<
 * 
 *                     not __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING()):
*/
    }

    /* "View.MemoryView":372
 *                 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":373
 *                 __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":374
 *             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":375
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:
 *                     raise MemoryError             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
*/
        PyErr_NoMemory(); __PYX_ERR(6, 375, __pyx_L1_error)

        /* "View.MemoryView":374
 *             if self.lock is NULL:
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                     raise MemoryError
 * 
*/
      }

      /* "View.MemoryView":372
 *                 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":365
 *                 Py_INCREF(Py_None)
 * 
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():             # <<<<<<<<<<<<<<
 *             global __pyx_memoryview_thread_locks_used
 *             if (__pyx_memoryview_thread_locks_used < 8 and
*/
  }

  /* "View.MemoryView":377
 *                     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":378
 * 
 *         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_L14_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
    __pyx_t_1 = __pyx_t_2;
    __pyx_L14_bool_binop_done:;
    __pyx_v_self->dtype_is_object = __pyx_t_1;

    /* "View.MemoryView":377
 *                     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_L13;
  }

  /* "View.MemoryView":380
 *             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             # <<<<<<<<<<<<<<
 * 
 *         with cython.cdivision(True):
*/
  /*else*/ {
    __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
  }
  __pyx_L13:;

  /* "View.MemoryView":383
 * 
 *         with cython.cdivision(True):
 *             assert <Py_intptr_t>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0             # <<<<<<<<<<<<<<
 *         self.typeinfo = NULL
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = ((((Py_intptr_t)(&__pyx_v_self->acquisition_count)) % (sizeof(__pyx_atomic_int_type))) == 0);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(6, 383, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(6, 383, __pyx_L1_error)
  #endif

  /* "View.MemoryView":384
 *         with cython.cdivision(True):
 *             assert <Py_intptr_t>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
 *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(memoryview self):
*/
  __pyx_v_self->typeinfo = NULL;

  /* "View.MemoryView":356
 *     cdef const __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":386
 *         self.typeinfo = NULL
 * 
 *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
 *         if self.obj is not None:
 *             PyBuffer_Release(&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;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyThread_type_lock __pyx_t_5;
  PyThread_type_lock __pyx_t_6;

  /* "View.MemoryView":387
 * 
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:             # <<<<<<<<<<<<<<
 *             PyBuffer_Release(&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":388
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:
 *             PyBuffer_Release(&self.view)             # <<<<<<<<<<<<<<
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
 * 
*/
    PyBuffer_Release((&__pyx_v_self->view));

    /* "View.MemoryView":387
 * 
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:             # <<<<<<<<<<<<<<
 *             PyBuffer_Release(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":389
 *         if self.obj is not None:
 *             PyBuffer_Release(&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":391
 *         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":392
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL
 *             Py_DECREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *         cdef int i
*/
    Py_DECREF(Py_None);

    /* "View.MemoryView":389
 *         if self.obj is not None:
 *             PyBuffer_Release(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL
*/
  }
  __pyx_L3:;

  /* "View.MemoryView":396
 *         cdef int i
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:             # <<<<<<<<<<<<<<
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __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":397
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):             # <<<<<<<<<<<<<<
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1
*/
    __pyx_t_1 = __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING();
    if (__pyx_t_1) {
      __pyx_t_2 = 0;
    } else {
      __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":398
 *         if self.lock != NULL:
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __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":399
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __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":400
 *                 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":402
 *                     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":401
 *                     __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":400
 *                 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":403
 *                         __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":398
 *         if self.lock != NULL:
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __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":405
 *                     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":396
 *         cdef int i
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:             # <<<<<<<<<<<<<<
 *             for i in range(0 if __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() else __pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
*/
  }

  /* "View.MemoryView":386
 *         self.typeinfo = NULL
 * 
 *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
 *         if self.obj is not None:
 *             PyBuffer_Release(&self.view)
*/

  /* function exit code */
}

/* "View.MemoryView":407
 *                 PyThread_free_lock(self.lock)
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> 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", 0);

  /* "View.MemoryView":409
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
 * 
 *         for dim, idx in enumerate(index):
*/
  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);

  /* "View.MemoryView":411
 *         cdef char *itemp = <char *> 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(6, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 411, __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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(6, 411, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_3;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(6, 411, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
        #endif
        ++__pyx_t_3;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 411, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(6, 411, __pyx_L1_error)
          PyErr_Clear();
        }
        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":412
 * 
 *         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(6, 412, __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 == ((void *)NULL))) __PYX_ERR(6, 412, __pyx_L1_error)
    __pyx_v_itemp = __pyx_t_7;

    /* "View.MemoryView":411
 *         cdef char *itemp = <char *> 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":414
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
 *         return itemp             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_itemp;
  goto __pyx_L0;

  /* "View.MemoryView":407
 *                 PyThread_free_lock(self.lock)
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> 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":417
 * 
 * 
 *     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__", 0);

  /* "View.MemoryView":418
 * 
 *     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":419
 *     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":418
 * 
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:             # <<<<<<<<<<<<<<
 *             return self
 * 
*/
  }

  /* "View.MemoryView":421
 *             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(6, 421, __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_PyTuple_GET_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(6, 421, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(6, 421, __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":424
 * 
 *         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(6, 424, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "View.MemoryView":425
 *         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(6, 425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":424
 * 
 *         cdef char *itemp
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             return memview_slice(self, indices)
 *         else:
*/
  }

  /* "View.MemoryView":427
 *             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 == ((void *)NULL))) __PYX_ERR(6, 427, __pyx_L1_error)
    __pyx_v_itemp = __pyx_t_5;

    /* "View.MemoryView":428
 *         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(6, 428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":417
 * 
 * 
 *     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":430
 *             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":431
 * 
 *     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":432
 *     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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_Cannot_assign_to_read_only_memor, 0, 0);
    __PYX_ERR(6, 432, __pyx_L1_error)

    /* "View.MemoryView":431
 * 
 *     def __setitem__(memoryview self, object index, object value):
 *         if self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise TypeError, "Cannot assign to read-only memoryview"
 * 
*/
  }

  /* "View.MemoryView":434
 *             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(6, 434, __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_PyTuple_GET_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(6, 434, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(6, 434, __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":436
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             obj = self.is_slice(value)
 *             if obj is not None:
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(6, 436, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "View.MemoryView":437
 * 
 *         if have_slices:
 *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
 *             if obj is not None:
 *                 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(6, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_obj = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "View.MemoryView":438
 *         if have_slices:
 *             obj = self.is_slice(value)
 *             if obj is not None:             # <<<<<<<<<<<<<<
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
*/
    __pyx_t_4 = (__pyx_v_obj != Py_None);
    if (__pyx_t_4) {

      /* "View.MemoryView":439
 *             obj = self.is_slice(value)
 *             if obj is not None:
 *                 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(6, 439, __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(6, 439, __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":438
 *         if have_slices:
 *             obj = self.is_slice(value)
 *             if obj is not None:             # <<<<<<<<<<<<<<
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
*/
      goto __pyx_L5;
    }

    /* "View.MemoryView":441
 *                 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(6, 441, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(6, 441, __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(6, 441, __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":436
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             obj = self.is_slice(value)
 *             if obj is not None:
*/
    goto __pyx_L4;
  }

  /* "View.MemoryView":443
 *                 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(6, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "View.MemoryView":430
 *             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":445
 *             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;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_t_11;
  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":446
 * 
 *     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_mstate_global->__pyx_memoryview_type); 
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "View.MemoryView":447
 *     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":448
 *         if not isinstance(obj, memoryview):
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
 *                                  self.dtype_is_object)
 *             except TypeError:
*/
        __pyx_t_7 = NULL;
        __pyx_t_8 = __Pyx_PyLong_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 448, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_8);

        /* "View.MemoryView":449
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
 *             except TypeError:
 *                 return None
*/
        __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 449, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = 1;
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_v_obj, __pyx_t_8, __pyx_t_9};
          __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_10, (4-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 448, __pyx_L4_error)
          __Pyx_GOTREF((PyObject *)__pyx_t_6);
        }
        __Pyx_DECREF_SET(__pyx_v_obj, ((PyObject *)__pyx_t_6));
        __pyx_t_6 = 0;

        /* "View.MemoryView":447
 *     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;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "View.MemoryView":450
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 *             except TypeError:             # <<<<<<<<<<<<<<
 *                 return None
 * 
*/
      __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
      if (__pyx_t_11) {
        __Pyx_ErrRestore(0,0,0);

        /* "View.MemoryView":451
 *                                  self.dtype_is_object)
 *             except TypeError:
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *         return obj
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L7_except_return;
      }
      goto __pyx_L6_except_error;

      /* "View.MemoryView":447
 *     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":446
 * 
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
*/
  }

  /* "View.MemoryView":453
 *                 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":445
 *             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_XDECREF(__pyx_t_9);
  __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":455
 *         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", 0);

  /* "View.MemoryView":458
 *         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_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(6, 458, __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 == ((void *)NULL))) __PYX_ERR(6, 458, __pyx_L1_error)
  __pyx_v_msrc = (__pyx_t_1[0]);

  /* "View.MemoryView":459
 *         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_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(6, 459, __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 == ((void *)NULL))) __PYX_ERR(6, 459, __pyx_L1_error)
  __pyx_v_mdst = (__pyx_t_1[0]);

  /* "View.MemoryView":461
 *         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_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 461, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_mstate_global->__pyx_n_u_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 461, __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(6, 461, __pyx_L1_error)

  /* "View.MemoryView":455
 *         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":463
 *         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[128];
  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", 0);

  /* "View.MemoryView":465
 *     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":470
 *         cdef __Pyx_memviewslice *dst_slice
 *         cdef __Pyx_memviewslice tmp_slice
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
 * 
 *         if <size_t>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 == ((void *)NULL))) __PYX_ERR(6, 470, __pyx_L1_error)
  __pyx_v_dst_slice = __pyx_t_1;

  /* "View.MemoryView":472
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
 * 
 *         if <size_t>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":473
 * 
 *         if <size_t>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":474
 *         if <size_t>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":475
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
 *                 raise MemoryError             # <<<<<<<<<<<<<<
 *             item = tmp
 *         else:
*/
      PyErr_NoMemory(); __PYX_ERR(6, 475, __pyx_L1_error)

      /* "View.MemoryView":474
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             item = tmp
*/
    }

    /* "View.MemoryView":476
 *             if tmp == NULL:
 *                 raise MemoryError
 *             item = tmp             # <<<<<<<<<<<<<<
 *         else:
 *             item = <void *> array
*/
    __pyx_v_item = __pyx_v_tmp;

    /* "View.MemoryView":472
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":478
 *             item = tmp
 *         else:
 *             item = <void *> array             # <<<<<<<<<<<<<<
 * 
 *         try:
*/
  /*else*/ {
    __pyx_v_item = ((void *)__pyx_v_array);
  }
  __pyx_L3:;

  /* "View.MemoryView":480
 *             item = <void *> array
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 (<PyObject **> item)[0] = <PyObject *> value
*/
  /*try:*/ {

    /* "View.MemoryView":481
 * 
 *         try:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
*/
    if (__pyx_v_self->dtype_is_object) {

      /* "View.MemoryView":482
 *         try:
 *             if self.dtype_is_object:
 *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
 *             else:
 *                 self.assign_item_from_object(<char *> item, value)
*/
      (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);

      /* "View.MemoryView":481
 * 
 *         try:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
*/
      goto __pyx_L8;
    }

    /* "View.MemoryView":484
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
 *                 self.assign_item_from_object(<char *> 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(6, 484, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L8:;

    /* "View.MemoryView":488
 * 
 * 
 *             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":489
 * 
 *             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(6, 489, __pyx_L6_error)

      /* "View.MemoryView":488
 * 
 * 
 *             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":490
 *             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":493
 *                                 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;
       __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if ( 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);
      }
      __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":463
 *         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":495
 *             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", 0);

  /* "View.MemoryView":496
 * 
 *     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 == ((void *)NULL))) __PYX_ERR(6, 496, __pyx_L1_error)
  __pyx_v_itemp = __pyx_t_1;

  /* "View.MemoryView":497
 *     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(6, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":495
 *             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":499
 *         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;
  size_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_item_to_object", 0);

  /* "View.MemoryView":502
 *         """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_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_struct, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 502, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_struct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "View.MemoryView":505
 *         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(6, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":506
 * 
 *         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":507
 *         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_v_struct;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 507, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_6, __pyx_v_bytesitem};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_unpack, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 507, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_v_result = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "View.MemoryView":506
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
*/
    }

    /* "View.MemoryView":511
 *             raise ValueError, "Unable to convert item to object"
 *         else:
 *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
 *                 return result[0]
 *             return result
*/
    /*else:*/ {
      __pyx_t_8 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(6, 511, __pyx_L5_except_error)
      __pyx_t_9 = (__pyx_t_8 == 1);
      if (__pyx_t_9) {

        /* "View.MemoryView":512
 *         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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 512, __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":511
 *             raise ValueError, "Unable to convert item to object"
 *         else:
 *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
 *                 return result[0]
 *             return result
*/
      }

      /* "View.MemoryView":513
 *             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;

    /* "View.MemoryView":508
 *         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_6, &__pyx_t_5);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_mstate_global->__pyx_n_u_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 508, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_10);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_ErrRestore(__pyx_t_1, __pyx_t_6, __pyx_t_5);
    __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0;
    if (__pyx_t_11) {
      __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(6, 508, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_1);

      /* "View.MemoryView":509
 *             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(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_mstate_global->__pyx_kp_u_Unable_to_convert_item_to_object, 0, 0);
      __PYX_ERR(6, 509, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "View.MemoryView":506
 * 
 *         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":499
 *         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_10);
  __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":515
 *             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;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  char *__pyx_t_10;
  char *__pyx_t_11;
  Py_ssize_t __pyx_t_12;
  char *__pyx_t_13;
  char *__pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assign_item_from_object", 0);

  /* "View.MemoryView":518
 *         """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_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_struct, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 518, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_struct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "View.MemoryView":523
 *         cdef Py_ssize_t i
 * 
 *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
*/
  __pyx_t_3 = PyTuple_Check(__pyx_v_value); 
  if (__pyx_t_3) {

    /* "View.MemoryView":524
 * 
 *         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_mstate_global->__pyx_n_u_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 524, __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) != (0)) __PYX_ERR(6, 524, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 524, __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;
    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(6, 524, __pyx_L1_error)
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "View.MemoryView":523
 *         cdef Py_ssize_t i
 * 
 *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":526
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
 *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
 * 
 *         for i, c in enumerate(bytesvalue):
*/
  /*else*/ {
    __pyx_t_6 = __pyx_v_struct;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_1, __pyx_v_value};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_pack, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 526, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(6, 526, __pyx_L1_error)
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":528
 *             bytesvalue = struct.pack(self.view.format, value)
 * 
 *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
 *             itemp[i] = c
 * 
*/
  __pyx_t_8 = 0;
  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
    __PYX_ERR(6, 528, __pyx_L1_error)
  }
  __Pyx_INCREF(__pyx_v_bytesvalue);
  __pyx_t_9 = __pyx_v_bytesvalue;
  __pyx_t_11 = __Pyx_PyBytes_AsWritableString(__pyx_t_9); if (unlikely(__pyx_t_11 == ((char *)NULL))) __PYX_ERR(6, 528, __pyx_L1_error)
  __pyx_t_12 = __Pyx_PyBytes_GET_SIZE(__pyx_t_9); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(6, 528, __pyx_L1_error)
  __pyx_t_13 = (__pyx_t_11 + __pyx_t_12);
  for (__pyx_t_14 = __pyx_t_11; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
    __pyx_t_10 = __pyx_t_14;
    __pyx_v_c = (__pyx_t_10[0]);

    /* "View.MemoryView":529
 * 
 *         for i, c in enumerate(bytesvalue):
 *             itemp[i] = c             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
*/
    __pyx_v_i = __pyx_t_8;

    /* "View.MemoryView":528
 *             bytesvalue = struct.pack(self.view.format, value)
 * 
 *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
 *             itemp[i] = c
 * 
*/
    __pyx_t_8 = (__pyx_t_8 + 1);

    /* "View.MemoryView":529
 * 
 *         for i, c in enumerate(bytesvalue):
 *             itemp[i] = c             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
*/
    (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "View.MemoryView":515
 *             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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __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":531
 *             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":533
 *     @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":534
 *     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(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_mstate_global->__pyx_kp_u_Cannot_create_writable_memory_vi, 0, 0);
    __PYX_ERR(6, 534, __pyx_L1_error)

    /* "View.MemoryView":533
 *     @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":536
 *             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":537
 * 
 *         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":536
 *             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":539
 *             info.shape = self.view.shape
 *         else:
 *             info.shape = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_STRIDES:
*/
  /*else*/ {
    __pyx_v_info->shape = NULL;
  }
  __pyx_L6:;

  /* "View.MemoryView":541
 *             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":542
 * 
 *         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":541
 *             info.shape = NULL
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.strides = self.view.strides
 *         else:
*/
    goto __pyx_L7;
  }

  /* "View.MemoryView":544
 *             info.strides = self.view.strides
 *         else:
 *             info.strides = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_INDIRECT:
*/
  /*else*/ {
    __pyx_v_info->strides = NULL;
  }
  __pyx_L7:;

  /* "View.MemoryView":546
 *             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":547
 * 
 *         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":546
 *             info.strides = NULL
 * 
 *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
 *             info.suboffsets = self.view.suboffsets
 *         else:
*/
    goto __pyx_L8;
  }

  /* "View.MemoryView":549
 *             info.suboffsets = self.view.suboffsets
 *         else:
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
*/
  /*else*/ {
    __pyx_v_info->suboffsets = NULL;
  }
  __pyx_L8:;

  /* "View.MemoryView":551
 *             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":552
 * 
 *         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":551
 *             info.suboffsets = NULL
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.view.format
 *         else:
*/
    goto __pyx_L9;
  }

  /* "View.MemoryView":554
 *             info.format = self.view.format
 *         else:
 *             info.format = NULL             # <<<<<<<<<<<<<<
 * 
 *         info.buf = self.view.buf
*/
  /*else*/ {
    __pyx_v_info->format = NULL;
  }
  __pyx_L9:;

  /* "View.MemoryView":556
 *             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":557
 * 
 *         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":558
 *         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":559
 *         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":560
 *         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":561
 *         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":531
 *             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":564
 * 
 * 
 *     @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__", 0);

  /* "View.MemoryView":566
 *     @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(6, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(6, 566, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":567
 *     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(6, 567, __pyx_L1_error)

  /* "View.MemoryView":568
 *         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":564
 * 
 * 
 *     @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":570
 *         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__", 0);

  /* "View.MemoryView":572
 *     @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(6, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":570
 *         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":574
 *         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", 0);

  /* "View.MemoryView":575
 * 
 *     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":574
 *         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":577
 *         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__", 0);

  /* "View.MemoryView":579
 *     @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(6, 579, __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 = PyLong_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 579, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(6, 579, __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(6, 579, __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":577
 *         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":581
 *         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__", 0);

  /* "View.MemoryView":583
 *     @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":585
 *         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(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_mstate_global->__pyx_kp_u_Buffer_view_does_not_expose_stri, 0, 0);
    __PYX_ERR(6, 585, __pyx_L1_error)

    /* "View.MemoryView":583
 *     @property
 *     def strides(self):
 *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
 * 
 *             raise ValueError, "Buffer view does not expose strides"
*/
  }

  /* "View.MemoryView":587
 *             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(6, 587, __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 = PyLong_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 587, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(6, 587, __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(6, 587, __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":581
 *         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":589
 *         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__", 0);

  /* "View.MemoryView":591
 *     @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":592
 *     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_mstate_global->__pyx_tuple[0], __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":591
 *     @property
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
 *             return (-1,) * self.view.ndim
 * 
*/
  }

  /* "View.MemoryView":594
 *             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(6, 594, __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 = PyLong_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 594, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(6, 594, __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(6, 594, __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":589
 *         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":596
 *         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__", 0);

  /* "View.MemoryView":598
 *     @property
 *     def ndim(self):
 *         return self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":596
 *         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":600
 *         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__", 0);

  /* "View.MemoryView":602
 *     @property
 *     def itemsize(self):
 *         return self.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     @property
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":600
 *         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":604
 *         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__", 0);

  /* "View.MemoryView":606
 *     @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_mstate_global->__pyx_n_u_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 606, __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(6, 606, __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":604
 *         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":608
 *         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__", 0);

  /* "View.MemoryView":610
 *     @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":611
 *     def size(self):
 *         if self._size is None:
 *             result = 1             # <<<<<<<<<<<<<<
 * 
 *             for length in self.view.shape[:self.view.ndim]:
*/
    __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
    __pyx_v_result = __pyx_mstate_global->__pyx_int_1;

    /* "View.MemoryView":613
 *             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 = PyLong_FromSsize_t((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 613, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "View.MemoryView":614
 * 
 *             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(6, 614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
      __pyx_t_5 = 0;
    }

    /* "View.MemoryView":616
 *                 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":610
 *     @property
 *     def size(self):
 *         if self._size is None:             # <<<<<<<<<<<<<<
 *             result = 1
 * 
*/
  }

  /* "View.MemoryView":618
 *             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":608
 *         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":620
 *         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":621
 * 
 *     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":622
 *     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":621
 * 
 *     def __len__(self):
 *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
 *             return self.view.shape[0]
 * 
*/
  }

  /* "View.MemoryView":624
 *             return self.view.shape[0]
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":620
 *         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":626
 *         return 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r at 0x%x>" % (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;
  PyObject *__pyx_t_4[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "View.MemoryView":627
 * 
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
 *                                                id(self))
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 627, __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_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":628
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
*/
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
  __pyx_t_4[1] = __pyx_t_2;
  __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_at_0x;
  __pyx_t_4[3] = __pyx_t_3;
  __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__3;

  /* "View.MemoryView":627
 * 
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
 *                                                id(self))
 * 
*/
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":626
 *         return 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r at 0x%x>" % (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":630
 *                                                id(self))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r object>" % (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;
  PyObject *__pyx_t_3[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "View.MemoryView":631
 * 
 *     def __str__(self):
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 631, __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_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_1), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_MemoryView_of;
  __pyx_t_3[1] = __pyx_t_2;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u_object_2;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 8, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 631, __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":630
 *                                                id(self))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r object>" % (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":634
 * 
 * 
 *     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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_c_contig", __pyx_kwds); 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", 0);

  /* "View.MemoryView":637
 *         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 == ((void *)NULL))) __PYX_ERR(6, 637, __pyx_L1_error)
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":638
 *         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(6, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":634
 * 
 * 
 *     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":640
 *         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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("is_f_contig", __pyx_kwds); 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", 0);

  /* "View.MemoryView":643
 *         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 == ((void *)NULL))) __PYX_ERR(6, 643, __pyx_L1_error)
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":644
 *         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(6, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":640
 *         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":646
 *         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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy", __pyx_kwds); 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", 0);

  /* "View.MemoryView":648
 *     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":650
 *         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":651
 * 
 *         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), __pyx_k_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(6, 651, __pyx_L1_error)
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":656
 *                                    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(6, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":646
 *         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":658
 *         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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy_fortran", __pyx_kwds); 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", 0);

  /* "View.MemoryView":660
 *     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":662
 *         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":663
 * 
 *         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), __pyx_k_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(6, 663, __pyx_L1_error)
  __pyx_v_dst = __pyx_t_1;

  /* "View.MemoryView":668
 *                                 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(6, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":658
 *         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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); 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__", 0);

  /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(6, 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(6, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(6, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(6, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 3, __pyx_L3_error)
    }
    __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(6, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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__", 0);

  /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(6, 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":671
 * 
 * 
 * @cname('__pyx_memoryview_new')             # <<<<<<<<<<<<<<
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
*/

static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo const *__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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);

  /* "View.MemoryView":673
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
 *     result.typeinfo = typeinfo
 *     return result
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_o, __pyx_t_3, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_memoryview_type, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 673, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":674
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __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":675
 *     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":671
 * 
 * 
 * @cname('__pyx_memoryview_new')             # <<<<<<<<<<<<<<
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, const __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, 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_XDECREF(__pyx_t_4);
  __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":677
 *     return result
 * 
 * @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":679
 * @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_mstate_global->__pyx_memoryview_type); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "View.MemoryView":677
 *     return result
 * 
 * @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":681
 *     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;
  PyObject *__pyx_t_6[3];
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_unellipsify", 0);

  /* "View.MemoryView":687
 *     """
 *     cdef Py_ssize_t idx
 *     tup = <tuple>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(6, 687, __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) != (0)) __PYX_ERR(6, 687, __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":689
 *     tup = <tuple>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(6, 689, __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_mstate_global->__pyx_slice[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_mstate_global->__pyx_slice[0]) != (0)) __PYX_ERR(6, 689, __pyx_L1_error);
    }
  }
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":690
 * 
 *     result = [slice(None)] * ndim
 *     have_slices = False             # <<<<<<<<<<<<<<
 *     seen_ellipsis = False
 *     idx = 0
*/
  __pyx_v_have_slices = 0;

  /* "View.MemoryView":691
 *     result = [slice(None)] * ndim
 *     have_slices = False
 *     seen_ellipsis = False             # <<<<<<<<<<<<<<
 *     idx = 0
 *     for item in tup:
*/
  __pyx_v_seen_ellipsis = 0;

  /* "View.MemoryView":692
 *     have_slices = False
 *     seen_ellipsis = False
 *     idx = 0             # <<<<<<<<<<<<<<
 *     for item in tup:
 *         if item is Ellipsis:
*/
  __pyx_v_idx = 0;

  /* "View.MemoryView":693
 *     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(6, 693, __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_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(6, 693, __pyx_L1_error)
      #endif
      if (__pyx_t_4 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4));
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4);
    #endif
    ++__pyx_t_4;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":694
 *     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":695
 *     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":696
 *         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(6, 696, __pyx_L1_error)
        }
        __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v_tup); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(6, 696, __pyx_L1_error)
        __pyx_v_idx = (__pyx_v_idx + (__pyx_v_ndim - __pyx_t_5));

        /* "View.MemoryView":697
 *             if not seen_ellipsis:
 *                 idx += ndim - len(tup)
 *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
 *             have_slices = True
 *         else:
*/
        __pyx_v_seen_ellipsis = 1;

        /* "View.MemoryView":695
 *     for item in tup:
 *         if item is Ellipsis:
 *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
 *                 idx += ndim - len(tup)
 *                 seen_ellipsis = True
*/
      }

      /* "View.MemoryView":698
 *                 idx += ndim - len(tup)
 *                 seen_ellipsis = True
 *             have_slices = True             # <<<<<<<<<<<<<<
 *         else:
 *             if isinstance(item, slice):
*/
      __pyx_v_have_slices = 1;

      /* "View.MemoryView":694
 *     idx = 0
 *     for item in tup:
 *         if item is Ellipsis:             # <<<<<<<<<<<<<<
 *             if not seen_ellipsis:
 *                 idx += ndim - len(tup)
*/
      goto __pyx_L5;
    }

    /* "View.MemoryView":700
 *             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":701
 *         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":700
 *             have_slices = True
 *         else:
 *             if isinstance(item, slice):             # <<<<<<<<<<<<<<
 *                 have_slices = True
 *             elif not PyIndex_Check(item):
*/
        goto __pyx_L7;
      }

      /* "View.MemoryView":702
 *             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":703
 *                 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 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_item)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 703, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_Cannot_index_with_type;
        __pyx_t_6[1] = __pyx_t_3;
        __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u__4;
        __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, 24 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
        if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 703, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_t_7, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(6, 703, __pyx_L1_error)

        /* "View.MemoryView":702
 *             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":704
 *             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, PyLong_FromSsize_t, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(6, 704, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "View.MemoryView":705
 *                 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":693
 *     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":707
 *         idx += 1
 * 
 *     nslices = ndim - idx             # <<<<<<<<<<<<<<
 *     return have_slices or nslices, tuple(result)
 * 
*/
  __pyx_v_nslices = (__pyx_v_ndim - __pyx_v_idx);

  /* "View.MemoryView":708
 * 
 *     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(6, 708, __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 = PyLong_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 708, __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(6, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 708, __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) != (0)) __PYX_ERR(6, 708, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7) != (0)) __PYX_ERR(6, 708, __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":681
 *     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":710
 *     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":711
 * 
 * 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":712
 * 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":713
 *     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(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_mstate_global->__pyx_kp_u_Indirect_dimensions_not_supporte, 0, 0);
      __PYX_ERR(6, 713, __pyx_L1_error)

      /* "View.MemoryView":712
 * 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":714
 *         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":710
 *     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":720
 * 
 * 
 * @cname('__pyx_memview_slice')             # <<<<<<<<<<<<<<
 * cdef memoryview memview_slice(memoryview memview, object indices):
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim
*/

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", 0);

  /* "View.MemoryView":722
 * @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":729
 * 
 * 
 *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
 * 
 *     cdef _memoryviewslice memviewsliceobj
*/
  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));

  /* "View.MemoryView":733
 *     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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(6, 733, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(6, 733, __pyx_L1_error)
  #endif

  /* "View.MemoryView":735
 *     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_mstate_global->__pyx_memoryviewslice_type); 
  if (__pyx_t_1) {

    /* "View.MemoryView":736
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
 *         p_src = &memviewsliceobj.from_slice
 *     else:
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_memview);
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(6, 736, __pyx_L1_error)
    __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "View.MemoryView":737
 *     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":735
 *     assert memview.view.ndim > 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":739
 *         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":740
 *     else:
 *         slice_copy(memview, &src)
 *         p_src = &src             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_v_p_src = (&__pyx_v_src);
  }
  __pyx_L3:;

  /* "View.MemoryView":746
 * 
 * 
 *     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":747
 * 
 *     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":752
 * 
 * 
 *     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":753
 * 
 *     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":757
 *     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(6, 757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 757, __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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(6, 757, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_6, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_6;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(6, 757, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6));
        #else
        __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6);
        #endif
        ++__pyx_t_6;
      }
      if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 757, __pyx_L1_error)
    } else {
      __pyx_t_8 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_8)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(6, 757, __pyx_L1_error)
          PyErr_Clear();
        }
        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":758
 * 
 *     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":759
 *     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(6, 759, __pyx_L1_error)
      __pyx_v_cindex = __pyx_t_9;

      /* "View.MemoryView":760
 *         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(6, 760, __pyx_L1_error)

      /* "View.MemoryView":758
 * 
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
 *             cindex = index
 *             slice_memviewslice(
*/
      goto __pyx_L6;
    }

    /* "View.MemoryView":766
 *                 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":767
 *                 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":768
 *         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":769
 *             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":770
 *             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":766
 *                 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":772
 *             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_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 772, __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(6, 772, __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(6, 772, __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":773
 *         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_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 773, __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(6, 773, __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(6, 773, __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":774
 *             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_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 774, __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(6, 774, __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(6, 774, __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":776
 *             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_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 776, __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":777
 * 
 *             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_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 777, __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":778
 *             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_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 778, __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":780
 *             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(6, 780, __pyx_L1_error)

      /* "View.MemoryView":786
 *                 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":757
 *     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":788
 *             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_mstate_global->__pyx_memoryviewslice_type); 
  if (__pyx_t_1) {

    /* "View.MemoryView":789
 * 
 *     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":790
 *     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(6, 790, __pyx_L1_error) }

    /* "View.MemoryView":791
 *         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(6, 791, __pyx_L1_error) }

    /* "View.MemoryView":789
 * 
 *     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(6, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(6, 789, __pyx_L1_error)
    __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":788
 *             new_ndim += 1
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
*/
  }

  /* "View.MemoryView":794
 *                                     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":795
 *     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(6, 794, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "View.MemoryView":794
 *                                     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_mstate_global->__pyx_memoryview_type))))) __PYX_ERR(6, 794, __pyx_L1_error)
    __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":720
 * 
 * 
 * @cname('__pyx_memview_slice')             # <<<<<<<<<<<<<<
 * cdef memoryview memview_slice(memoryview memview, object indices):
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim
*/

  /* 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":801
 * 
 * 
 * @cname('__pyx_pybuffer_index')             # <<<<<<<<<<<<<<
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
 *                           Py_ssize_t dim) except NULL:
*/

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;
  PyObject *__pyx_t_4[3];
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pybuffer_index", 0);

  /* "View.MemoryView":804
 * 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":805
 *                           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":808
 *     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":809
 * 
 *     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(6, 809, __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(6, 809, __pyx_L1_error)
    }
    __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize, 0);

    /* "View.MemoryView":810
 *     if view.ndim == 0:
 *         shape = view.len // itemsize
 *         stride = itemsize             # <<<<<<<<<<<<<<
 *     else:
 *         shape = view.shape[dim]
*/
    __pyx_v_stride = __pyx_v_itemsize;

    /* "View.MemoryView":808
 *     cdef char *resultp
 * 
 *     if view.ndim == 0:             # <<<<<<<<<<<<<<
 *         shape = view.len // itemsize
 *         stride = itemsize
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":812
 *         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":813
 *     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":814
 *         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":815
 *         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":814
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *             suboffset = view.suboffsets[dim]
 * 
*/
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":817
 *             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":818
 * 
 *     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":819
 *     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":820
 *         index += view.shape[dim]
 *         if index < 0:
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"             # <<<<<<<<<<<<<<
 * 
 *     if index >= shape:
*/
      __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 820, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
      __pyx_t_4[1] = __pyx_t_3;
      __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u__5;
      __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 820, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_IndexError))), __pyx_t_5, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(6, 820, __pyx_L1_error)

      /* "View.MemoryView":819
 *     if index < 0:
 *         index += view.shape[dim]
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
*/
    }

    /* "View.MemoryView":817
 *             suboffset = view.suboffsets[dim]
 * 
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += view.shape[dim]
 *         if index < 0:
*/
  }

  /* "View.MemoryView":822
 *             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":823
 * 
 *     if index >= shape:
 *         raise IndexError, f"Out of bounds on buffer access (axis {dim})"             # <<<<<<<<<<<<<<
 * 
 *     resultp = bufp + index * stride
*/
    __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
    __pyx_t_4[1] = __pyx_t_5;
    __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u__5;
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 1, 127);
    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_IndexError))), __pyx_t_3, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(6, 823, __pyx_L1_error)

    /* "View.MemoryView":822
 *             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":825
 *         raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
 *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
 *     if suboffset >= 0:
 *         resultp = (<char **> resultp)[0] + suboffset
*/
  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));

  /* "View.MemoryView":826
 * 
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
*/
  __pyx_t_2 = (__pyx_v_suboffset >= 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":827
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:
 *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
 * 
 *     return resultp
*/
    __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);

    /* "View.MemoryView":826
 * 
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
*/
  }

  /* "View.MemoryView":829
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 *     return resultp             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_resultp;
  goto __pyx_L0;

  /* "View.MemoryView":801
 * 
 * 
 * @cname('__pyx_pybuffer_index')             # <<<<<<<<<<<<<<
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
 *                           Py_ssize_t dim) except NULL:
*/

  /* 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":834
 * 
 * 
 * @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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "View.MemoryView":836
 * @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":838
 *     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":839
 * 
 *     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":843
 * 
 *     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, 1);
  __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":844
 *     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":845
 *     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":846
 *         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":848
 *         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":849
 * 
 *         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_mstate_global->__pyx_kp_u_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 849, __pyx_L1_error)

      /* "View.MemoryView":848
 *         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":851
 *             _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":834
 * 
 * 
 * @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:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":869
 *     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":870
 * 
 *     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":869
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
 * 
*/

  /* function exit code */
}

/* "View.MemoryView":872
 *         __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", 0);

  /* "View.MemoryView":873
 * 
 *     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":874
 *     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(6, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":873
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
 *             return self.to_object_func(itemp)
 *         else:
*/
  }

  /* "View.MemoryView":876
 *             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(6, 876, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":872
 *         __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":878
 *             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", 0);

  /* "View.MemoryView":879
 * 
 *     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":880
 *     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(6, 880, __pyx_L1_error)

    /* "View.MemoryView":879
 * 
 *     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":882
 *             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(6, 882, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":878
 *             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":884
 *             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", 0);

  /* "View.MemoryView":885
 * 
 *     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":884
 *             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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); 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__", 0);

  /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(6, 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(6, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < (0)) __PYX_ERR(6, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(6, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 3, __pyx_L3_error)
    }
    __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(6, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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__", 0);

  /* "(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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(6, 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":904
 *     pass  # ignore failure, it's a minor issue
 * 
 * @cname('__pyx_memoryview_fromslice')             # <<<<<<<<<<<<<<
 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
 *                           int ndim,
*/

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 const *__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", 0);

  /* "View.MemoryView":913
 *     cdef _memoryviewslice result
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
 *         return None
 * 
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
  if (__pyx_t_1) {

    /* "View.MemoryView":914
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "View.MemoryView":913
 *     cdef _memoryviewslice result
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
 *         return None
 * 
*/
  }

  /* "View.MemoryView":919
 * 
 * 
 *     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(6, 919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 919, __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) != (0)) __PYX_ERR(6, 919, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_int_0) != (0)) __PYX_ERR(6, 919, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(6, 919, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_mstate_global->__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 919, __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":921
 *     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":922
 * 
 *     result.from_slice = memviewslice
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
 * 
 *     result.from_object = (<memoryview> memviewslice.memview)._get_base()
*/
  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);

  /* "View.MemoryView":924
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)
 * 
 *     result.from_object = (<memoryview> 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(6, 924, __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":925
 * 
 *     result.from_object = (<memoryview> 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":927
 *     result.typeinfo = memviewslice.memview.typeinfo
 * 
 *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
 *     result.view.buf = <void *> 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":928
 * 
 *     result.view = memviewslice.memview.view
 *     result.view.buf = <void *> 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":929
 *     result.view = memviewslice.memview.view
 *     result.view.buf = <void *> 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":930
 *     result.view.buf = <void *> 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":931
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
*/
  Py_INCREF(Py_None);

  /* "View.MemoryView":933
 *     Py_INCREF(Py_None)
 * 
 *     if (<memoryview>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":934
 * 
 *     if (<memoryview>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":933
 *     Py_INCREF(Py_None)
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
 *         result.flags = PyBUF_RECORDS
 *     else:
*/
    goto __pyx_L4;
  }

  /* "View.MemoryView":936
 *         result.flags = PyBUF_RECORDS
 *     else:
 *         result.flags = PyBUF_RECORDS_RO             # <<<<<<<<<<<<<<
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
*/
  /*else*/ {
    __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
  }
  __pyx_L4:;

  /* "View.MemoryView":938
 *         result.flags = PyBUF_RECORDS_RO
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
 * 
*/
  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);

  /* "View.MemoryView":939
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);

  /* "View.MemoryView":942
 * 
 * 
 *     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":943
 * 
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> 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":944
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break
*/
    __pyx_t_1 = (__pyx_v_suboffset >= 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":945
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
 *             break
 * 
*/
      __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);

      /* "View.MemoryView":946
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break             # <<<<<<<<<<<<<<
 * 
 *     result.view.len = result.view.itemsize
*/
      goto __pyx_L6_break;

      /* "View.MemoryView":944
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break
*/
    }
  }
  __pyx_L6_break:;

  /* "View.MemoryView":948
 *             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":949
 * 
 *     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 = PyLong_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "View.MemoryView":950
 *     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 = PyLong_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 950, __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(6, 950, __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(6, 950, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
  }

  /* "View.MemoryView":952
 *         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":953
 * 
 *     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":955
 *     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":904
 *     pass  # ignore failure, it's a minor issue
 * 
 * @cname('__pyx_memoryview_fromslice')             # <<<<<<<<<<<<<<
 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,
 *                           int ndim,
*/

  /* 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":957
 *     return result
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')             # <<<<<<<<<<<<<<
 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
 *                                                    __Pyx_memviewslice *mslice) except NULL:
*/

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", 0);

  /* "View.MemoryView":961
 *                                                    __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_mstate_global->__pyx_memoryviewslice_type); 
  if (__pyx_t_1) {

    /* "View.MemoryView":962
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):
 *         obj = memview             # <<<<<<<<<<<<<<
 *         return &obj.from_slice
 *     else:
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_memview);
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_memoryviewslice_type))))) __PYX_ERR(6, 962, __pyx_L1_error)
    __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "View.MemoryView":963
 *     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":961
 *                                                    __Pyx_memviewslice *mslice) except NULL:
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         obj = memview
 *         return &obj.from_slice
*/
  }

  /* "View.MemoryView":965
 *         return &obj.from_slice
 *     else:
 *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
 *         return mslice
 * 
*/
  /*else*/ {
    __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);

    /* "View.MemoryView":966
 *     else:
 *         slice_copy(memview, mslice)
 *         return mslice             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_slice_copy')
*/
    __pyx_r = __pyx_v_mslice;
    goto __pyx_L0;
  }

  /* "View.MemoryView":957
 *     return result
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')             # <<<<<<<<<<<<<<
 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,
 *                                                    __Pyx_memviewslice *mslice) except NULL:
*/

  /* 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":968
 *         return mslice
 * 
 * @cname('__pyx_memoryview_slice_copy')             # <<<<<<<<<<<<<<
 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
 *     cdef int dim
*/

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":973
 *     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":974
 * 
 *     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":975
 *     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":977
 *     suboffsets = memview.view.suboffsets
 * 
 *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
 *     dst.data = <char *> memview.view.buf
 * 
*/
  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);

  /* "View.MemoryView":978
 * 
 *     dst.memview = <__pyx_memoryview *> memview
 *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
 * 
 *     for dim in range(memview.view.ndim):
*/
  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);

  /* "View.MemoryView":980
 *     dst.data = <char *> 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":981
 * 
 *     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":982
 *     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":983
 *         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":968
 *         return mslice
 * 
 * @cname('__pyx_memoryview_slice_copy')             # <<<<<<<<<<<<<<
 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:
 *     cdef int dim
*/

  /* function exit code */
}

/* "View.MemoryView":985
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
 * 
 * @cname('__pyx_memoryview_copy_object')             # <<<<<<<<<<<<<<
 * cdef memoryview_copy(memoryview memview):
 *     "Create a new memoryview object"
*/

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", 0);

  /* "View.MemoryView":989
 *     "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":990
 *     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(6, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":985
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
 * 
 * @cname('__pyx_memoryview_copy_object')             # <<<<<<<<<<<<<<
 * cdef memoryview_copy(memoryview memview):
 *     "Create a new memoryview object"
*/

  /* 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":992
 *     return memoryview_copy_from_slice(memview, &memviewslice)
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')             # <<<<<<<<<<<<<<
 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
 *     """
*/

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", 0);

  /* "View.MemoryView":1000
 *     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_mstate_global->__pyx_memoryviewslice_type); 
  if (__pyx_t_1) {

    /* "View.MemoryView":1001
 * 
 *     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":1002
 *     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":1000
 *     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":1004
 *         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":1005
 *     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":1007
 *         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":1009
 *     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(6, 1007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":992
 *     return memoryview_copy_from_slice(memview, &memviewslice)
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')             # <<<<<<<<<<<<<<
 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):
 *     """
*/

  /* 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":1015
 * 
 * 
 * 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":1016
 * 
 * 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":1015
 * 
 * 
 * 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":1018
 *     return -arg if arg < 0 else arg
 * 
 * @cname('__pyx_get_best_slice_order')             # <<<<<<<<<<<<<<
 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
 *     """
*/

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":1024
 *     """
 *     cdef int i
 *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t f_stride = 0
 * 
*/
  __pyx_v_c_stride = 0;

  /* "View.MemoryView":1025
 *     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":1027
 *     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":1028
 * 
 *     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":1029
 *     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":1030
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]
 *             break             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
*/
      goto __pyx_L4_break;

      /* "View.MemoryView":1028
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             c_stride = mslice.strides[i]
 *             break
*/
    }
  }
  __pyx_L4_break:;

  /* "View.MemoryView":1032
 *             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":1033
 * 
 *     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":1034
 *     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":1035
 *         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":1033
 * 
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             f_stride = mslice.strides[i]
 *             break
*/
    }
  }
  __pyx_L7_break:;

  /* "View.MemoryView":1037
 *             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":1038
 * 
 *     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":1037
 *             break
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
 *         return 'C'
 *     else:
*/
  }

  /* "View.MemoryView":1040
 *         return 'C'
 *     else:
 *         return 'F'             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
*/
  /*else*/ {
    __pyx_r = 'F';
    goto __pyx_L0;
  }

  /* "View.MemoryView":1018
 *     return -arg if arg < 0 else arg
 * 
 * @cname('__pyx_get_best_slice_order')             # <<<<<<<<<<<<<<
 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:
 *     """
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1042
 *         return 'F'
 * 
 * @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,
*/

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":1050
 * 
 *     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":1051
 *     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":1052
 *     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":1053
 *     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":1055
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if (src_stride > 0 and dst_stride > 0 and
 *                 <size_t> src_stride == itemsize == <size_t> dst_stride):
*/
  __pyx_t_1 = (__pyx_v_ndim == 1);
  if (__pyx_t_1) {

    /* "View.MemoryView":1056
 * 
 *     if ndim == 1:
 *         if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *                 <size_t> src_stride == itemsize == <size_t> 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":1057
 *     if ndim == 1:
 *         if (src_stride > 0 and dst_stride > 0 and
 *                 <size_t> src_stride == itemsize == <size_t> 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":1056
 * 
 *     if ndim == 1:
 *         if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *                 <size_t> src_stride == itemsize == <size_t> dst_stride):
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
*/
    if (__pyx_t_1) {

      /* "View.MemoryView":1058
 *         if (src_stride > 0 and dst_stride > 0 and
 *                 <size_t> src_stride == itemsize == <size_t> 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":1056
 * 
 *     if ndim == 1:
 *         if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *                 <size_t> src_stride == itemsize == <size_t> dst_stride):
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
*/
      goto __pyx_L4;
    }

    /* "View.MemoryView":1060
 *             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":1061
 *         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":1062
 *             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":1063
 *                 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":1055
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if (src_stride > 0 and dst_stride > 0 and
 *                 <size_t> src_stride == itemsize == <size_t> dst_stride):
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":1065
 *                 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":1066
 *     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":1070
 *                                      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":1071
 *                                      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":1042
 *         return 'F'
 * 
 * @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,
*/

  /* function exit code */
}

/* "View.MemoryView":1073
 *             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":1076
 *                                   __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":1073
 *             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":1079
 *                              src.shape, dst.shape, ndim, itemsize)
 * 
 * @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"
*/

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":1082
 * 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":1084
 *     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":1085
 * 
 *     for shape in src.shape[:ndim]:
 *         size *= shape             # <<<<<<<<<<<<<<
 * 
 *     return size
*/
    __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
  }

  /* "View.MemoryView":1087
 *         size *= shape
 * 
 *     return size             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_fill_contig_strides_array')
*/
  __pyx_r = __pyx_v_size;
  goto __pyx_L0;

  /* "View.MemoryView":1079
 *                              src.shape, dst.shape, ndim, itemsize)
 * 
 * @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"
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1089
 *     return size
 * 
 * @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,
*/

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":1099
 *     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":1100
 * 
 *     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":1101
 *     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":1102
 *         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":1099
 *     cdef int idx
 * 
 *     if order == 'F':             # <<<<<<<<<<<<<<
 *         for idx in range(ndim):
 *             strides[idx] = stride
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":1104
 *             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":1105
 *     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":1106
 *         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":1108
 *             stride *= shape[idx]
 * 
 *     return stride             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
*/
  __pyx_r = __pyx_v_stride;
  goto __pyx_L0;

  /* "View.MemoryView":1089
 *     return size
 * 
 * @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,
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1110
 *     return stride
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')             # <<<<<<<<<<<<<<
 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
 *                              __Pyx_memviewslice *tmpslice,
*/

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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "View.MemoryView":1122
 *     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":1123
 * 
 *     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":1125
 *     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":1126
 * 
 *     result = malloc(size)
 *     if not result:             # <<<<<<<<<<<<<<
 *         _err_no_memory()
 * 
*/
  __pyx_t_2 = (!(__pyx_v_result != 0));
  if (__pyx_t_2) {

    /* "View.MemoryView":1127
 *     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(6, 1127, __pyx_L1_error)

    /* "View.MemoryView":1126
 * 
 *     result = malloc(size)
 *     if not result:             # <<<<<<<<<<<<<<
 *         _err_no_memory()
 * 
*/
  }

  /* "View.MemoryView":1130
 * 
 * 
 *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):
*/
  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);

  /* "View.MemoryView":1131
 * 
 *     tmpslice.data = <char *> 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":1132
 *     tmpslice.data = <char *> 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":1133
 *     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":1134
 *     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":1136
 *         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":1139
 * 
 * 
 *     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":1140
 * 
 *     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":1141
 *     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":1140
 * 
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
 *             tmpslice.strides[i] = 0
 * 
*/
    }
  }

  /* "View.MemoryView":1143
 *             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":1144
 * 
 *     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":1143
 *             tmpslice.strides[i] = 0
 * 
 *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
 *         memcpy(result, src.data, size)
 *     else:
*/
    goto __pyx_L9;
  }

  /* "View.MemoryView":1146
 *         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":1148
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "View.MemoryView":1110
 *     return stride
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')             # <<<<<<<<<<<<<<
 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,
 *                              __Pyx_memviewslice *tmpslice,
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1152
 * 
 * 
 * @cname('__pyx_memoryview_err_extents')             # <<<<<<<<<<<<<<
 * cdef int _err_extents(int i, Py_ssize_t extent1,
 *                              Py_ssize_t extent2) except -1 with gil:
*/

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;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4[7];
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("_err_extents", 0);

  /* "View.MemoryView":1155
 * 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 = __Pyx_PyUnicode_From_int(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent1, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent2, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_got_differing_extents_in_dimensi;
  __pyx_t_4[1] = __pyx_t_1;
  __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_got;
  __pyx_t_4[3] = __pyx_t_2;
  __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u_and;
  __pyx_t_4[5] = __pyx_t_3;
  __pyx_t_4[6] = __pyx_mstate_global->__pyx_kp_u__5;
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 7, 35 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127);
  if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __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;
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_ValueError))), __pyx_t_5, 0, 0);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __PYX_ERR(6, 1155, __pyx_L1_error)

  /* "View.MemoryView":1152
 * 
 * 
 * @cname('__pyx_memoryview_err_extents')             # <<<<<<<<<<<<<<
 * cdef int _err_extents(int i, Py_ssize_t extent1,
 *                              Py_ssize_t extent2) except -1 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_5);
  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "View.MemoryView":1157
 *     raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
 * 
 * @cname('__pyx_memoryview_err_dim')             # <<<<<<<<<<<<<<
 * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
 *     raise <object>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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("_err_dim", 0);
  __Pyx_INCREF(__pyx_v_msg);

  /* "View.MemoryView":1159
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
 *     raise <object>error, msg % dim             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err')
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1159, __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(6, 1159, __pyx_L1_error)

  /* "View.MemoryView":1157
 *     raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
 * 
 * @cname('__pyx_memoryview_err_dim')             # <<<<<<<<<<<<<<
 * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
 *     raise <object>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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "View.MemoryView":1161
 *     raise <object>error, msg % dim
 * 
 * @cname('__pyx_memoryview_err')             # <<<<<<<<<<<<<<
 * cdef int _err(PyObject *error, str msg) except -1 with gil:
 *     raise <object>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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("_err", 0);
  __Pyx_INCREF(__pyx_v_msg);

  /* "View.MemoryView":1163
 * @cname('__pyx_memoryview_err')
 * cdef int _err(PyObject *error, str msg) except -1 with gil:
 *     raise <object>error, msg             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err_no_memory')
*/
  __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_v_msg, 0, 0);
  __PYX_ERR(6, 1163, __pyx_L1_error)

  /* "View.MemoryView":1161
 *     raise <object>error, msg % dim
 * 
 * @cname('__pyx_memoryview_err')             # <<<<<<<<<<<<<<
 * cdef int _err(PyObject *error, str msg) except -1 with gil:
 *     raise <object>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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "View.MemoryView":1165
 *     raise <object>error, msg
 * 
 * @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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();

  /* "View.MemoryView":1167
 * @cname('__pyx_memoryview_err_no_memory')
 * cdef int _err_no_memory() except -1 with gil:
 *     raise MemoryError             # <<<<<<<<<<<<<<
 * 
 * 
*/
  PyErr_NoMemory(); __PYX_ERR(6, 1167, __pyx_L1_error)

  /* "View.MemoryView":1165
 *     raise <object>error, msg
 * 
 * @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;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "View.MemoryView":1170
 * 
 * 
 * @cname('__pyx_memoryview_copy_contents')             # <<<<<<<<<<<<<<
 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,
 *                                   __Pyx_memviewslice dst,
*/

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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "View.MemoryView":1179
 *     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":1180
 *     """
 *     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":1182
 *     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":1183
 *     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":1184
 *     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":1187
 *     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":1188
 * 
 *     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":1187
 *     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":1189
 *     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":1190
 *         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":1189
 *     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":1192
 *         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":1194
 *     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":1195
 * 
 *     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":1196
 *     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":1197
 *         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":1198
 *             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":1196
 *     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":1200
 *                 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(6, 1200, __pyx_L1_error)
      }
      __pyx_L7:;

      /* "View.MemoryView":1195
 * 
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
 *             if src.shape[i] == 1:
 *                 broadcasting = True
*/
    }

    /* "View.MemoryView":1202
 *                 _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":1203
 * 
 *         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_mstate_global->__pyx_kp_u_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 1203, __pyx_L1_error)

      /* "View.MemoryView":1202
 *                 _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":1205
 *             _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":1207
 *     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":1208
 * 
 *         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":1207
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 * 
 *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
 *             order = get_best_order(&dst, ndim)
 * 
*/
    }

    /* "View.MemoryView":1210
 *             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(6, 1210, __pyx_L1_error)
    __pyx_v_tmpdata = __pyx_t_7;

    /* "View.MemoryView":1211
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
 *         src = tmp             # <<<<<<<<<<<<<<
 * 
 *     if not broadcasting:
*/
    __pyx_v_src = __pyx_v_tmp;

    /* "View.MemoryView":1205
 *             _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":1213
 *         src = tmp
 * 
 *     if not broadcasting:             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = (!__pyx_v_broadcasting);
  if (__pyx_t_2) {

    /* "View.MemoryView":1216
 * 
 * 
 *         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":1217
 * 
 *         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":1216
 * 
 * 
 *         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":1218
 *         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":1219
 *             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":1218
 *         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":1221
 *             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":1223
 *         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":1224
 * 
 *             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":1225
 *             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":1226
 *             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":1227
 *             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":1221
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 *         if direct_copy:             # <<<<<<<<<<<<<<
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=False)
*/
    }

    /* "View.MemoryView":1213
 *         src = tmp
 * 
 *     if not broadcasting:             # <<<<<<<<<<<<<<
 * 
 * 
*/
  }

  /* "View.MemoryView":1229
 *             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":1232
 * 
 * 
 *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
 *         transpose_memslice(&dst)
 * 
*/
    __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 1232, __pyx_L1_error)

    /* "View.MemoryView":1233
 * 
 *         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(6, 1233, __pyx_L1_error)

    /* "View.MemoryView":1229
 *             return 0
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
 * 
 * 
*/
  }

  /* "View.MemoryView":1235
 *         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":1236
 * 
 *     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":1237
 *     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":1239
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 * 
 *     free(tmpdata)             # <<<<<<<<<<<<<<
 *     return 0
 * 
*/
  free(__pyx_v_tmpdata);

  /* "View.MemoryView":1240
 * 
 *     free(tmpdata)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1170
 * 
 * 
 * @cname('__pyx_memoryview_copy_contents')             # <<<<<<<<<<<<<<
 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,
 *                                   __Pyx_memviewslice dst,
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1242
 *     return 0
 * 
 * @cname('__pyx_memoryview_broadcast_leading')             # <<<<<<<<<<<<<<
 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,
 *                             int ndim,
*/

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":1247
 *                             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":1249
 *     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":1250
 * 
 *     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":1251
 *     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":1252
 *         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":1254
 *         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":1255
 * 
 *     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":1256
 *     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":1257
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]
 *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
 * 
 * 
*/
    (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
  }

  /* "View.MemoryView":1242
 *     return 0
 * 
 * @cname('__pyx_memoryview_broadcast_leading')             # <<<<<<<<<<<<<<
 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,
 *                             int ndim,
*/

  /* function exit code */
}

/* "View.MemoryView":1264
 * 
 * 
 * @cname('__pyx_memoryview_refcount_copying')             # <<<<<<<<<<<<<<
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
 * 
*/

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":1267
 * 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":1268
 * 
 *     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":1267
 * 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":1264
 * 
 * 
 * @cname('__pyx_memoryview_refcount_copying')             # <<<<<<<<<<<<<<
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
 * 
*/

  /* function exit code */
}

/* "View.MemoryView":1270
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
 * 
 * @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,
*/

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) {
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();

  /* "View.MemoryView":1274
 *                                              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":1270
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
 * 
 * @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,
*/

  /* function exit code */
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
}

/* "View.MemoryView":1276
 *     refcount_objects_in_slice(data, shape, strides, ndim, inc)
 * 
 * @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:
*/

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":1280
 *                                     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":1282
 *     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":1283
 * 
 *     for i in range(shape[0]):
 *         if ndim == 1:             # <<<<<<<<<<<<<<
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])
*/
    __pyx_t_4 = (__pyx_v_ndim == 1);
    if (__pyx_t_4) {

      /* "View.MemoryView":1284
 *     for i in range(shape[0]):
 *         if ndim == 1:
 *             if inc:             # <<<<<<<<<<<<<<
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
*/
      if (__pyx_v_inc) {

        /* "View.MemoryView":1285
 *         if ndim == 1:
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
 *             else:
 *                 Py_DECREF((<PyObject **> data)[0])
*/
        Py_INCREF((((PyObject **)__pyx_v_data)[0]));

        /* "View.MemoryView":1284
 *     for i in range(shape[0]):
 *         if ndim == 1:
 *             if inc:             # <<<<<<<<<<<<<<
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
*/
        goto __pyx_L6;
      }

      /* "View.MemoryView":1287
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
 *                 Py_DECREF((<PyObject **> 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":1283
 * 
 *     for i in range(shape[0]):
 *         if ndim == 1:             # <<<<<<<<<<<<<<
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])
*/
      goto __pyx_L5;
    }

    /* "View.MemoryView":1289
 *                 Py_DECREF((<PyObject **> 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":1291
 *             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":1276
 *     refcount_objects_in_slice(data, shape, strides, ndim, inc)
 * 
 * @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:
*/

  /* function exit code */
}

/* "View.MemoryView":1296
 * 
 * 
 * @cname('__pyx_memoryview_slice_assign_scalar')             # <<<<<<<<<<<<<<
 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
 *                               size_t itemsize, void *item,
*/

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":1300
 *                               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":1301
 *                               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":1302
 *     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":1296
 * 
 * 
 * @cname('__pyx_memoryview_slice_assign_scalar')             # <<<<<<<<<<<<<<
 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,
 *                               size_t itemsize, void *item,
*/

  /* function exit code */
}

/* "View.MemoryView":1305
 * 
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')             # <<<<<<<<<<<<<<
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
 *                               Py_ssize_t *strides, int ndim,
*/

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":1310
 *                               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":1311
 *     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":1313
 *     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":1314
 * 
 *     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":1315
 *     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":1316
 *         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":1313
 *     cdef Py_ssize_t extent = shape[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
*/
    goto __pyx_L3;
  }

  /* "View.MemoryView":1318
 *             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":1319
 *     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":1320
 *         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":1305
 * 
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')             # <<<<<<<<<<<<<<
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,
 *                               Py_ssize_t *strides, int ndim,
*/

  /* function exit code */
}

/* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
*/

/* 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(*)(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_type,&__pyx_mstate_global->__pyx_n_u_pyx_checksum,&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(6, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(6, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(6, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__pyx_unpickle_Enum", 0) < (0)) __PYX_ERR(6, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, i); __PYX_ERR(6, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(6, 4, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(6, 4, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(6, 4, __pyx_L3_error)
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyLong_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(6, 4, __pyx_L3_error)
    __pyx_v___pyx_state = ((PyObject*)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(6, 4, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v___pyx_state), (&PyTuple_Type), 1, "__pyx_state", 1))) __PYX_ERR(6, 4, __pyx_L1_error)
  __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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);

  /* "(tree fragment)":6
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state):
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')             # <<<<<<<<<<<<<<
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:
*/
  __pyx_t_1 = __Pyx_CheckUnpickleChecksum(__pyx_v___pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, __pyx_k_name); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 6, __pyx_L1_error)

  /* "(tree fragment)":7
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
 *     __pyx_result = Enum.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
*/
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_MemviewEnum_type);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  __pyx_t_5 = (__pyx_v___pyx_state != ((PyObject*)Py_None));
  if (__pyx_t_5) {

    /* "(tree fragment)":9
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
*/
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "cannot pass None into a C function argument that is declared 'not None'");
      __PYX_ERR(6, 9, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), __pyx_v___pyx_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
*/
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
 *     __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)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.name = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/

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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):
 *     __pyx_result.name = __pyx_state[0]             # <<<<<<<<<<<<<<
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 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, __pyx_state: tuple):
 *     __pyx_result.name = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)             # <<<<<<<<<<<<<<
*/
  __pyx_t_2 = __Pyx_UpdateUnpickledDict(((PyObject *)__pyx_v___pyx_result), __pyx_v___pyx_state, 1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 13, __pyx_L1_error)

  /* "(tree fragment)":11
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, __pyx_state: tuple):             # <<<<<<<<<<<<<<
 *     __pyx_result.name = __pyx_state[0]
 *     __Pyx_UpdateUnpickledDict(__pyx_result, __pyx_state, 1)
*/

  /* 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.__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":1355
 * 
 * 
 * @cname('__pyx_format_from_typeinfo')             # <<<<<<<<<<<<<<
 * cdef bytes format_from_typeinfo(const __Pyx_TypeInfo *type):
 *     cdef const __Pyx_StructField *field
*/

static PyObject *__pyx_format_from_typeinfo(__Pyx_TypeInfo const *__pyx_v_type) {
  __Pyx_StructField const *__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 const *__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;
  PyObject *__pyx_t_10[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("format_from_typeinfo", 0);

  /* "BufferFormatFromTypeInfo":1362
 *     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":1363
 * 
 *     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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(6, 1363, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(6, 1363, __pyx_L1_error)
    #endif

    /* "BufferFormatFromTypeInfo":1364
 *     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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(6, 1364, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(6, 1364, __pyx_L1_error)
    #endif

    /* "BufferFormatFromTypeInfo":1366
 *         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":1367
 * 
 *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:
 *             alignment = b'^'             # <<<<<<<<<<<<<<
 *         else:
 *             alignment = b''
*/
      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__6);
      __pyx_v_alignment = __pyx_mstate_global->__pyx_kp_b__6;

      /* "BufferFormatFromTypeInfo":1366
 *         assert type.fields.type != NULL
 * 
 *         if type.flags & __PYX_BUF_FLAGS_PACKED_STRUCT:             # <<<<<<<<<<<<<<
 *             alignment = b'^'
 *         else:
*/
      goto __pyx_L4;
    }

    /* "BufferFormatFromTypeInfo":1369
 *             alignment = b'^'
 *         else:
 *             alignment = b''             # <<<<<<<<<<<<<<
 * 
 *         parts = [b"T{"]
*/
    /*else*/ {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b__7);
      __pyx_v_alignment = __pyx_mstate_global->__pyx_kp_b__7;
    }
    __pyx_L4:;

    /* "BufferFormatFromTypeInfo":1371
 *             alignment = b''
 * 
 *         parts = [b"T{"]             # <<<<<<<<<<<<<<
 *         field = type.fields
 * 
*/
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b_T);
    __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_b_T);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_mstate_global->__pyx_kp_b_T) != (0)) __PYX_ERR(6, 1371, __pyx_L1_error);
    __pyx_v_parts = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "BufferFormatFromTypeInfo":1372
 * 
 *         parts = [b"T{"]
 *         field = type.fields             # <<<<<<<<<<<<<<
 * 
 *         while field.type:
*/
    __pyx_t_3 = __pyx_v_type->fields;
    __pyx_v_field = __pyx_t_3;

    /* "BufferFormatFromTypeInfo":1374
 *         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":1375
 * 
 *         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(6, 1375, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_part, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "BufferFormatFromTypeInfo":1376
 *         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_mstate_global->__pyx_kp_b__8); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1376, __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(6, 1376, __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(6, 1376, __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_mstate_global->__pyx_kp_b__8); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1376, __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(6, 1376, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "BufferFormatFromTypeInfo":1377
 *             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":1379
 *             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(6, 1379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_mstate_global->__pyx_kp_b__9); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_result = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "BufferFormatFromTypeInfo":1362
 *     cdef Py_ssize_t i
 * 
 *     if type.typegroup == 'S':             # <<<<<<<<<<<<<<
 *         assert type.fields != NULL
 *         assert type.fields.type != NULL
*/
    goto __pyx_L3;
  }

  /* "BufferFormatFromTypeInfo":1381
 *         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":1382
 *     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_PyBytes_FromString(__pyx_v_fmt.string); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_result = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "BufferFormatFromTypeInfo":1383
 *         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":1384
 *         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(6, 1384, __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(6, 1384, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_4))) __PYX_ERR(6, 1384, __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":1385
 *         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 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__11, __pyx_v_extents); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1385, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u__10;
      __pyx_t_10[1] = __pyx_t_5;
      __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u__5;
      __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1385, __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(6, 1385, __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(6, 1385, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "BufferFormatFromTypeInfo":1383
 *         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":1387
 *             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":1355
 * 
 * 
 * @cname('__pyx_format_from_typeinfo')             # <<<<<<<<<<<<<<
 * cdef bytes format_from_typeinfo(const __Pyx_TypeInfo *type):
 *     cdef const __Pyx_StructField *field
*/

  /* 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":31
 * # --------------------------------------------------------------------
 * 
 * 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", 0);

  /* "petsc4py/PETSc/PETSc.pyx":32
 * 
 * cdef inline object bytes2str(const char p[]):
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     cdef bytes s = <char*>p
*/
  __pyx_t_1 = (__pyx_v_p == NULL);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/PETSc.pyx":33
 * cdef inline object bytes2str(const char p[]):
 *     if p == NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     cdef bytes s = <char*>p
 *     if isinstance(s, str):
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "petsc4py/PETSc/PETSc.pyx":32
 * 
 * cdef inline object bytes2str(const char p[]):
 *     if p == NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     cdef bytes s = <char*>p
*/
  }

  /* "petsc4py/PETSc/PETSc.pyx":34
 *     if p == NULL:
 *         return None
 *     cdef bytes s = <char*>p             # <<<<<<<<<<<<<<
 *     if isinstance(s, str):
 *         return s
*/
  __pyx_t_2 = __Pyx_PyBytes_FromString(((char *)__pyx_v_p)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_s = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":35
 *         return None
 *     cdef bytes s = <char*>p
 *     if isinstance(s, str):             # <<<<<<<<<<<<<<
 *         return s
 *     else:
*/
  __pyx_t_1 = PyUnicode_Check(__pyx_v_s); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/PETSc.pyx":36
 *     cdef bytes s = <char*>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":35
 *         return None
 *     cdef bytes s = <char*>p
 *     if isinstance(s, str):             # <<<<<<<<<<<<<<
 *         return s
 *     else:
*/
  }

  /* "petsc4py/PETSc/PETSc.pyx":38
 *         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(7, 38, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/PETSc.pyx":31
 * # --------------------------------------------------------------------
 * 
 * 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":40
 *         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;
  size_t __pyx_t_5;
  char *__pyx_t_6;
  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":41
 * 
 * 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":42
 * 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":43
 *     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":41
 * 
 * cdef inline object str2bytes(object s, const char *p[]):
 *     if s is None:             # <<<<<<<<<<<<<<
 *         p[0] = NULL
 *         return None
*/
  }

  /* "petsc4py/PETSc/PETSc.pyx":44
 *         p[0] = NULL
 *         return None
 *     if not isinstance(s, bytes):             # <<<<<<<<<<<<<<
 *         s = s.encode()
 *     p[0] = <const char*>(<char*>s)
*/
  __pyx_t_1 = PyBytes_Check(__pyx_v_s); 
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/PETSc.pyx":45
 *         return None
 *     if not isinstance(s, bytes):
 *         s = s.encode()             # <<<<<<<<<<<<<<
 *     p[0] = <const char*>(<char*>s)
 *     return s
*/
    __pyx_t_4 = __pyx_v_s;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 45, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF_SET(__pyx_v_s, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/PETSc.pyx":44
 *         p[0] = NULL
 *         return None
 *     if not isinstance(s, bytes):             # <<<<<<<<<<<<<<
 *         s = s.encode()
 *     p[0] = <const char*>(<char*>s)
*/
  }

  /* "petsc4py/PETSc/PETSc.pyx":46
 *     if not isinstance(s, bytes):
 *         s = s.encode()
 *     p[0] = <const char*>(<char*>s)             # <<<<<<<<<<<<<<
 *     return s
 * 
*/
  __pyx_t_6 = __Pyx_PyObject_AsWritableString(__pyx_v_s); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(7, 46, __pyx_L1_error)
  (__pyx_v_p[0]) = ((char const *)((char *)__pyx_t_6));

  /* "petsc4py/PETSc/PETSc.pyx":47
 *         s = s.encode()
 *     p[0] = <const char*>(<char*>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":40
 *         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_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":49
 *     return s
 * 
 * cdef inline object S_(const char p[]):             # <<<<<<<<<<<<<<
 *     if p == NULL: return None
 *     cdef object s = <char*>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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("S_", 0);

  /* "petsc4py/PETSc/PETSc.pyx":50
 * 
 * cdef inline object S_(const char p[]):
 *     if p == NULL: return None             # <<<<<<<<<<<<<<
 *     cdef object s = <char*>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":51
 * cdef inline object S_(const char p[]):
 *     if p == NULL: return None
 *     cdef object s = <char*>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(7, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_s = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":52
 *     if p == NULL: return None
 *     cdef object s = <char*>p
 *     return s if isinstance(s, str) else s.decode()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyUnicode_Check(__pyx_v_s); 
  if (__pyx_t_1) {
    __Pyx_INCREF(__pyx_v_s);
    __pyx_t_2 = __pyx_v_s;
  } else {
    __pyx_t_4 = __pyx_v_s;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_decode, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 52, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __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":49
 *     return s
 * 
 * cdef inline object S_(const char p[]):             # <<<<<<<<<<<<<<
 *     if p == NULL: return None
 *     cdef object s = <char*>p
*/

  /* 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.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":69
 * cdef object PetscError = <object>PyExc_RuntimeError
 * 
 * cdef inline void PetscTracebackAdd(object exc) noexcept:             # <<<<<<<<<<<<<<
 *     if (<void*>PetscError) == NULL: return
 *     global tracebacklist
*/

static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_PetscTracebackAdd(PyObject *__pyx_v_exc) {
  __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("PetscTracebackAdd", 0);

  /* "petsc4py/PETSc/PETSc.pyx":70
 * 
 * cdef inline void PetscTracebackAdd(object exc) noexcept:
 *     if (<void*>PetscError) == NULL: return             # <<<<<<<<<<<<<<
 *     global tracebacklist
 *     exc._traceback[:] = tracebacklist[:]
*/
  __pyx_t_1 = (((void *)__pyx_v_8petsc4py_5PETSc_PetscError) == NULL);
  if (__pyx_t_1) {
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/PETSc.pyx":72
 *     if (<void*>PetscError) == NULL: return
 *     global tracebacklist
 *     exc._traceback[:] = tracebacklist[:]             # <<<<<<<<<<<<<<
 *     del tracebacklist[:]
 * 
*/
  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_8petsc4py_5PETSc_tracebacklist, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_exc, __pyx_mstate_global->__pyx_n_u_traceback); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetSlice(__pyx_t_3, __pyx_t_2, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1) < (0)) __PYX_ERR(7, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":73
 *     global tracebacklist
 *     exc._traceback[:] = tracebacklist[:]
 *     del tracebacklist[:]             # <<<<<<<<<<<<<<
 * 
 * cdef inline int SETERR(PetscErrorCode ierr) noexcept nogil:
*/
  if (__Pyx_PyObject_DelSlice(__pyx_v_8petsc4py_5PETSc_tracebacklist, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1) < (0)) __PYX_ERR(7, 73, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":69
 * cdef object PetscError = <object>PyExc_RuntimeError
 * 
 * cdef inline void PetscTracebackAdd(object exc) noexcept:             # <<<<<<<<<<<<<<
 *     if (<void*>PetscError) == NULL: return
 *     global tracebacklist
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("petsc4py.PETSc.PetscTracebackAdd", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "petsc4py/PETSc/PETSc.pyx":75
 *     del tracebacklist[:]
 * 
 * cdef inline int SETERR(PetscErrorCode ierr) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef PyObject *exception = NULL, *cause = NULL
 *     with gil:
*/

static CYTHON_INLINE int __pyx_f_8petsc4py_5PETSc_SETERR(PetscErrorCode __pyx_v_ierr) {
  PyObject *__pyx_v_exception;
  PyObject *__pyx_v_cause;
  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;
  PyGILState_STATE __pyx_gilstate_save;
  __Pyx_RefNannySetupContext("SETERR", 1);

  /* "petsc4py/PETSc/PETSc.pyx":76
 * 
 * cdef inline int SETERR(PetscErrorCode ierr) noexcept nogil:
 *     cdef PyObject *exception = NULL, *cause = NULL             # <<<<<<<<<<<<<<
 *     with gil:
 *         cause = PyErr_GetRaisedException()
*/
  __pyx_v_exception = NULL;
  __pyx_v_cause = NULL;

  /* "petsc4py/PETSc/PETSc.pyx":77
 * cdef inline int SETERR(PetscErrorCode ierr) noexcept nogil:
 *     cdef PyObject *exception = NULL, *cause = NULL
 *     with gil:             # <<<<<<<<<<<<<<
 *         cause = PyErr_GetRaisedException()
 *         if (<void*>PetscError) != NULL:
*/
  {
      PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
      /*try:*/ {

        /* "petsc4py/PETSc/PETSc.pyx":78
 *     cdef PyObject *exception = NULL, *cause = NULL
 *     with gil:
 *         cause = PyErr_GetRaisedException()             # <<<<<<<<<<<<<<
 *         if (<void*>PetscError) != NULL:
 *             PyErr_SetObject(PetscError, <long>ierr)
*/
        __pyx_v_cause = PyErr_GetRaisedException();

        /* "petsc4py/PETSc/PETSc.pyx":79
 *     with gil:
 *         cause = PyErr_GetRaisedException()
 *         if (<void*>PetscError) != NULL:             # <<<<<<<<<<<<<<
 *             PyErr_SetObject(PetscError, <long>ierr)
 *         else:
*/
        __pyx_t_1 = (((void *)__pyx_v_8petsc4py_5PETSc_PetscError) != NULL);
        if (__pyx_t_1) {

          /* "petsc4py/PETSc/PETSc.pyx":80
 *         cause = PyErr_GetRaisedException()
 *         if (<void*>PetscError) != NULL:
 *             PyErr_SetObject(PetscError, <long>ierr)             # <<<<<<<<<<<<<<
 *         else:
 *             PyErr_SetObject(<object>PyExc_RuntimeError, <long>ierr)
*/
          __pyx_t_2 = __pyx_v_8petsc4py_5PETSc_PetscError;
          __Pyx_INCREF(__pyx_t_2);
          __pyx_t_3 = __Pyx_PyLong_From_long(((long)__pyx_v_ierr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 80, __pyx_L4_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;

          /* "petsc4py/PETSc/PETSc.pyx":79
 *     with gil:
 *         cause = PyErr_GetRaisedException()
 *         if (<void*>PetscError) != NULL:             # <<<<<<<<<<<<<<
 *             PyErr_SetObject(PetscError, <long>ierr)
 *         else:
*/
          goto __pyx_L6;
        }

        /* "petsc4py/PETSc/PETSc.pyx":82
 *             PyErr_SetObject(PetscError, <long>ierr)
 *         else:
 *             PyErr_SetObject(<object>PyExc_RuntimeError, <long>ierr)             # <<<<<<<<<<<<<<
 *         exception = PyErr_GetRaisedException()
 *         PetscTracebackAdd(<object>exception)
*/
        /*else*/ {
          __pyx_t_3 = ((PyObject *)PyExc_RuntimeError);
          __Pyx_INCREF(__pyx_t_3);
          __pyx_t_2 = __Pyx_PyLong_From_long(((long)__pyx_v_ierr)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 82, __pyx_L4_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;
        }
        __pyx_L6:;

        /* "petsc4py/PETSc/PETSc.pyx":83
 *         else:
 *             PyErr_SetObject(<object>PyExc_RuntimeError, <long>ierr)
 *         exception = PyErr_GetRaisedException()             # <<<<<<<<<<<<<<
 *         PetscTracebackAdd(<object>exception)
 *         PyException_SetCause(exception, cause)
*/
        __pyx_v_exception = PyErr_GetRaisedException();

        /* "petsc4py/PETSc/PETSc.pyx":84
 *             PyErr_SetObject(<object>PyExc_RuntimeError, <long>ierr)
 *         exception = PyErr_GetRaisedException()
 *         PetscTracebackAdd(<object>exception)             # <<<<<<<<<<<<<<
 *         PyException_SetCause(exception, cause)
 *         PyErr_SetRaisedException(exception)
*/
        __pyx_f_8petsc4py_5PETSc_PetscTracebackAdd(((PyObject *)__pyx_v_exception));

        /* "petsc4py/PETSc/PETSc.pyx":85
 *         exception = PyErr_GetRaisedException()
 *         PetscTracebackAdd(<object>exception)
 *         PyException_SetCause(exception, cause)             # <<<<<<<<<<<<<<
 *         PyErr_SetRaisedException(exception)
 *     return 0
*/
        PyException_SetCause(__pyx_v_exception, __pyx_v_cause);

        /* "petsc4py/PETSc/PETSc.pyx":86
 *         PetscTracebackAdd(<object>exception)
 *         PyException_SetCause(exception, cause)
 *         PyErr_SetRaisedException(exception)             # <<<<<<<<<<<<<<
 *     return 0
 * 
*/
        PyErr_SetRaisedException(__pyx_v_exception);
      }

      /* "petsc4py/PETSc/PETSc.pyx":77
 * cdef inline int SETERR(PetscErrorCode ierr) noexcept nogil:
 *     cdef PyObject *exception = NULL, *cause = NULL
 *     with gil:             # <<<<<<<<<<<<<<
 *         cause = PyErr_GetRaisedException()
 *         if (<void*>PetscError) != NULL:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "petsc4py/PETSc/PETSc.pyx":87
 *         PyException_SetCause(exception, cause)
 *         PyErr_SetRaisedException(exception)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) except PETSC_ERR_PYTHON nogil:
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PETSc.pyx":75
 *     del tracebacklist[:]
 * 
 * cdef inline int SETERR(PetscErrorCode ierr) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef PyObject *exception = NULL, *cause = NULL
 *     with gil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("petsc4py.PETSc.SETERR", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  __Pyx_RefNannyFinishContextNogil()
  return __pyx_r;
}

/* "petsc4py/PETSc/PETSc.pyx":89
 *     return 0
 * 
 * cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) except PETSC_ERR_PYTHON nogil:             # <<<<<<<<<<<<<<
 *     if ierr == PETSC_SUCCESS:
 *         return PETSC_SUCCESS # no error
*/

static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_CHKERR(PetscErrorCode __pyx_v_ierr) {
  PetscErrorCode __pyx_r;
  int __pyx_t_1;

  /* "petsc4py/PETSc/PETSc.pyx":90
 * 
 * cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) except PETSC_ERR_PYTHON nogil:
 *     if ierr == PETSC_SUCCESS:             # <<<<<<<<<<<<<<
 *         return PETSC_SUCCESS # no error
 *     <void>SETERR(ierr)
*/
  __pyx_t_1 = (__pyx_v_ierr == PETSC_SUCCESS);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/PETSc.pyx":91
 * cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) except PETSC_ERR_PYTHON nogil:
 *     if ierr == PETSC_SUCCESS:
 *         return PETSC_SUCCESS # no error             # <<<<<<<<<<<<<<
 *     <void>SETERR(ierr)
 *     return PETSC_ERR_PYTHON
*/
    __pyx_r = PETSC_SUCCESS;
    goto __pyx_L0;

    /* "petsc4py/PETSc/PETSc.pyx":90
 * 
 * cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) except PETSC_ERR_PYTHON nogil:
 *     if ierr == PETSC_SUCCESS:             # <<<<<<<<<<<<<<
 *         return PETSC_SUCCESS # no error
 *     <void>SETERR(ierr)
*/
  }

  /* "petsc4py/PETSc/PETSc.pyx":92
 *     if ierr == PETSC_SUCCESS:
 *         return PETSC_SUCCESS # no error
 *     <void>SETERR(ierr)             # <<<<<<<<<<<<<<
 *     return PETSC_ERR_PYTHON
 * 
*/
  ((void)__pyx_f_8petsc4py_5PETSc_SETERR(__pyx_v_ierr));

  /* "petsc4py/PETSc/PETSc.pyx":93
 *         return PETSC_SUCCESS # no error
 *     <void>SETERR(ierr)
 *     return PETSC_ERR_PYTHON             # <<<<<<<<<<<<<<
 * 
 * # SETERRMPI Support
*/
  __pyx_r = PETSC_ERR_PYTHON;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PETSc.pyx":89
 *     return 0
 * 
 * cdef inline PetscErrorCode CHKERR(PetscErrorCode ierr) except PETSC_ERR_PYTHON nogil:             # <<<<<<<<<<<<<<
 *     if ierr == PETSC_SUCCESS:
 *         return PETSC_SUCCESS # no error
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/PETSc.pyx":105
 *     PetscErrorCode PetscERROR(MPI_Comm, const char[], PetscErrorCode, int, const char[], const char[])
 * 
 * cdef inline int SETERRMPI(int ierr) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef char mpi_err_str[MPI_MAX_ERROR_STRING]
 *     cdef int  result_len = <int>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;

  /* "petsc4py/PETSc/PETSc.pyx":107
 * cdef inline int SETERRMPI(int ierr) noexcept nogil:
 *     cdef char mpi_err_str[MPI_MAX_ERROR_STRING]
 *     cdef int  result_len = <int>sizeof(mpi_err_str)             # <<<<<<<<<<<<<<
 *     <void>memset(mpi_err_str, 0, <size_t>result_len)
 *     <void>MPI_Error_string(ierr, mpi_err_str, &result_len)
*/
  __pyx_v_result_len = ((int)(sizeof(__pyx_v_mpi_err_str)));

  /* "petsc4py/PETSc/PETSc.pyx":108
 *     cdef char mpi_err_str[MPI_MAX_ERROR_STRING]
 *     cdef int  result_len = <int>sizeof(mpi_err_str)
 *     <void>memset(mpi_err_str, 0, <size_t>result_len)             # <<<<<<<<<<<<<<
 *     <void>MPI_Error_string(ierr, mpi_err_str, &result_len)
 *     <void>result_len  # unused-but-set-variable
*/
  ((void)memset(__pyx_v_mpi_err_str, 0, ((size_t)__pyx_v_result_len)));

  /* "petsc4py/PETSc/PETSc.pyx":109
 *     cdef int  result_len = <int>sizeof(mpi_err_str)
 *     <void>memset(mpi_err_str, 0, <size_t>result_len)
 *     <void>MPI_Error_string(ierr, mpi_err_str, &result_len)             # <<<<<<<<<<<<<<
 *     <void>result_len  # unused-but-set-variable
 *     cdef char error_str[MPI_MAX_ERROR_STRING+64]
*/
  ((void)MPI_Error_string(__pyx_v_ierr, __pyx_v_mpi_err_str, (&__pyx_v_result_len)));

  /* "petsc4py/PETSc/PETSc.pyx":110
 *     <void>memset(mpi_err_str, 0, <size_t>result_len)
 *     <void>MPI_Error_string(ierr, mpi_err_str, &result_len)
 *     <void>result_len  # unused-but-set-variable             # <<<<<<<<<<<<<<
 *     cdef char error_str[MPI_MAX_ERROR_STRING+64]
 *     <void>PetscSNPrintf(error_str, sizeof(error_str), b"MPI Error %s %d", mpi_err_str, ierr)
*/
  ((void)__pyx_v_result_len);

  /* "petsc4py/PETSc/PETSc.pyx":112
 *     <void>result_len  # unused-but-set-variable
 *     cdef char error_str[MPI_MAX_ERROR_STRING+64]
 *     <void>PetscSNPrintf(error_str, sizeof(error_str), b"MPI Error %s %d", mpi_err_str, ierr)             # <<<<<<<<<<<<<<
 *     <void>PetscERROR(PETSC_COMM_SELF, "Unknown Python Function", PETSC_ERR_MPI, PETSC_ERROR_INITIAL, "%s", error_str)
 *     <void>SETERR(PETSC_ERR_MPI)
*/
  ((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":113
 *     cdef char error_str[MPI_MAX_ERROR_STRING+64]
 *     <void>PetscSNPrintf(error_str, sizeof(error_str), b"MPI Error %s %d", mpi_err_str, ierr)
 *     <void>PetscERROR(PETSC_COMM_SELF, "Unknown Python Function", PETSC_ERR_MPI, PETSC_ERROR_INITIAL, "%s", error_str)             # <<<<<<<<<<<<<<
 *     <void>SETERR(PETSC_ERR_MPI)
 *     return 0
*/
  ((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":114
 *     <void>PetscSNPrintf(error_str, sizeof(error_str), b"MPI Error %s %d", mpi_err_str, ierr)
 *     <void>PetscERROR(PETSC_COMM_SELF, "Unknown Python Function", PETSC_ERR_MPI, PETSC_ERROR_INITIAL, "%s", error_str)
 *     <void>SETERR(PETSC_ERR_MPI)             # <<<<<<<<<<<<<<
 *     return 0
 * 
*/
  ((void)__pyx_f_8petsc4py_5PETSc_SETERR(PETSC_ERR_MPI));

  /* "petsc4py/PETSc/PETSc.pyx":115
 *     <void>PetscERROR(PETSC_COMM_SELF, "Unknown Python Function", PETSC_ERR_MPI, PETSC_ERROR_INITIAL, "%s", error_str)
 *     <void>SETERR(PETSC_ERR_MPI)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscErrorCode CHKERRMPI(int ierr) except PETSC_ERR_PYTHON nogil:
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PETSc.pyx":105
 *     PetscErrorCode PetscERROR(MPI_Comm, const char[], PetscErrorCode, int, const char[], const char[])
 * 
 * cdef inline int SETERRMPI(int ierr) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef char mpi_err_str[MPI_MAX_ERROR_STRING]
 *     cdef int  result_len = <int>sizeof(mpi_err_str)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/PETSc.pyx":117
 *     return 0
 * 
 * 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;

  /* "petsc4py/PETSc/PETSc.pyx":118
 * 
 * cdef inline PetscErrorCode CHKERRMPI(int ierr) except PETSC_ERR_PYTHON nogil:
 *     if ierr == MPI_SUCCESS:             # <<<<<<<<<<<<<<
 *         return PETSC_SUCCESS
 *     <void>SETERRMPI(ierr)
*/
  __pyx_t_1 = (__pyx_v_ierr == MPI_SUCCESS);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/PETSc.pyx":119
 * cdef inline PetscErrorCode CHKERRMPI(int ierr) except PETSC_ERR_PYTHON nogil:
 *     if ierr == MPI_SUCCESS:
 *         return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 *     <void>SETERRMPI(ierr)
 *     return PETSC_ERR_PYTHON
*/
    __pyx_r = PETSC_SUCCESS;
    goto __pyx_L0;

    /* "petsc4py/PETSc/PETSc.pyx":118
 * 
 * cdef inline PetscErrorCode CHKERRMPI(int ierr) except PETSC_ERR_PYTHON nogil:
 *     if ierr == MPI_SUCCESS:             # <<<<<<<<<<<<<<
 *         return PETSC_SUCCESS
 *     <void>SETERRMPI(ierr)
*/
  }

  /* "petsc4py/PETSc/PETSc.pyx":120
 *     if ierr == MPI_SUCCESS:
 *         return PETSC_SUCCESS
 *     <void>SETERRMPI(ierr)             # <<<<<<<<<<<<<<
 *     return PETSC_ERR_PYTHON
 * 
*/
  ((void)__pyx_f_8petsc4py_5PETSc_SETERRMPI(__pyx_v_ierr));

  /* "petsc4py/PETSc/PETSc.pyx":121
 *         return PETSC_SUCCESS
 *     <void>SETERRMPI(ierr)
 *     return PETSC_ERR_PYTHON             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_r = PETSC_ERR_PYTHON;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PETSc.pyx":117
 *     return 0
 * 
 * cdef inline PetscErrorCode CHKERRMPI(int ierr) except PETSC_ERR_PYTHON nogil:             # <<<<<<<<<<<<<<
 *     if ierr == MPI_SUCCESS:
 *         return PETSC_SUCCESS
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/PETSc.pyx":146
 *     void PyPetscBuffer_Release(Py_buffer*)
 * 
 * cdef inline object toBool(PetscBool value):             # <<<<<<<<<<<<<<
 *     return True if value == PETSC_TRUE else False
 * cdef inline PetscBool asBool(object value) except? <PetscBool>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;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("toBool", 0);

  /* "petsc4py/PETSc/PETSc.pyx":147
 * 
 * cdef inline object toBool(PetscBool value):
 *     return True if value == PETSC_TRUE else False             # <<<<<<<<<<<<<<
 * cdef inline PetscBool asBool(object value) except? <PetscBool>0:
 *     return PETSC_TRUE if value else PETSC_FALSE
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = (__pyx_v_value == PETSC_TRUE);
  if (__pyx_t_2) {
    __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":146
 *     void PyPetscBuffer_Release(Py_buffer*)
 * 
 * cdef inline object toBool(PetscBool value):             # <<<<<<<<<<<<<<
 *     return True if value == PETSC_TRUE else False
 * cdef inline PetscBool asBool(object value) except? <PetscBool>0:
*/

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/PETSc.pyx":148
 * cdef inline object toBool(PetscBool value):
 *     return True if value == PETSC_TRUE else False
 * cdef inline PetscBool asBool(object value) except? <PetscBool>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":149
 *     return True if value == PETSC_TRUE else False
 * cdef inline PetscBool asBool(object value) except? <PetscBool>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(7, 149, __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":148
 * cdef inline object toBool(PetscBool value):
 *     return True if value == PETSC_TRUE else False
 * cdef inline PetscBool asBool(object value) except? <PetscBool>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":151
 *     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", 0);

  /* "petsc4py/PETSc/PETSc.pyx":152
 * 
 * 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_PyLong_From_PetscInt(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PETSc.pyx":151
 *     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":153
 * 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":154
 *     return value
 * cdef inline PetscInt asInt(object value) except? -1:
 *     return value             # <<<<<<<<<<<<<<
 * 
 * cdef inline object toReal(PetscReal value):
*/
  __pyx_t_1 = __Pyx_PyLong_As_PetscInt(__pyx_v_value); if (unlikely((__pyx_t_1 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(7, 154, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PETSc.pyx":153
 * 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":156
 *     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", 0);

  /* "petsc4py/PETSc/PETSc.pyx":157
 * 
 * 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(7, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PETSc.pyx":156
 *     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":158
 * 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":159
 *     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(7, 159, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PETSc.pyx":158
 * 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":161
 *     return value
 * 
 * cdef inline object toScalar(PetscScalar value):             # <<<<<<<<<<<<<<
 *     return PyPetscScalar_FromPetscScalar(value)
 * cdef inline PetscScalar asScalar(object value) except? <PetscScalar>-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", 0);

  /* "petsc4py/PETSc/PETSc.pyx":162
 * 
 * cdef inline object toScalar(PetscScalar value):
 *     return PyPetscScalar_FromPetscScalar(value)             # <<<<<<<<<<<<<<
 * cdef inline PetscScalar asScalar(object value) except? <PetscScalar>-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(7, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PETSc.pyx":161
 *     return value
 * 
 * cdef inline object toScalar(PetscScalar value):             # <<<<<<<<<<<<<<
 *     return PyPetscScalar_FromPetscScalar(value)
 * cdef inline PetscScalar asScalar(object value) except? <PetscScalar>-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":163
 * cdef inline object toScalar(PetscScalar value):
 *     return PyPetscScalar_FromPetscScalar(value)
 * cdef inline PetscScalar asScalar(object value) except? <PetscScalar>-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":164
 *     return PyPetscScalar_FromPetscScalar(value)
 * cdef inline PetscScalar asScalar(object value) except? <PetscScalar>-1.0:
 *     return PyPetscScalar_AsPetscScalar(value)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_1 = PyPetscScalar_AsPetscScalar(__pyx_v_value); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(7, 164, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PETSc.pyx":163
 * cdef inline object toScalar(PetscScalar value):
 *     return PyPetscScalar_FromPetscScalar(value)
 * cdef inline PetscScalar asScalar(object value) except? <PetscScalar>-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":72
 * # --------------------------------------------------------------------
 * 
 * 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":73
 * 
 * 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(8, 73, __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":72
 * # --------------------------------------------------------------------
 * 
 * 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":75
 *     return PyArray_FROM_O(ob)
 * 
 * cdef inline ndarray arange(start, stop, stride):             # <<<<<<<<<<<<<<
 *     cdef dtype descr = <dtype> 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":76
 * 
 * cdef inline ndarray arange(start, stop, stride):
 *     cdef dtype descr = <dtype> 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(8, 76, __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":77
 * cdef inline ndarray arange(start, stop, stride):
 *     cdef dtype descr = <dtype> 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(8, 77, __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":75
 *     return PyArray_FROM_O(ob)
 * 
 * cdef inline ndarray arange(start, stop, stride):             # <<<<<<<<<<<<<<
 *     cdef dtype descr = <dtype> 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":81
 * # --------------------------------------------------------------------
 * 
 * cdef inline ndarray empty_b(PetscInt size):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> size
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0)
*/

static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_empty_b(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_b", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":82
 * 
 * cdef inline ndarray empty_b(PetscInt size):
 *     cdef npy_intp s = <npy_intp> size             # <<<<<<<<<<<<<<
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0)
 * 
*/
  __pyx_v_s = ((npy_intp)__pyx_v_size);

  /* "petsc4py/PETSc/arraynpy.pxi":83
 * cdef inline ndarray empty_b(PetscInt size):
 *     cdef npy_intp s = <npy_intp> size
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0)             # <<<<<<<<<<<<<<
 * 
 * cdef inline ndarray empty_i(PetscInt size):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_BOOL, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 83, __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":81
 * # --------------------------------------------------------------------
 * 
 * cdef inline ndarray empty_b(PetscInt size):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> size
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("petsc4py.PETSc.empty_b", __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":85
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0)
 * 
 * cdef inline ndarray empty_i(PetscInt size):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":86
 * 
 * cdef inline ndarray empty_i(PetscInt size):
 *     cdef npy_intp s = <npy_intp> size             # <<<<<<<<<<<<<<
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0)
 * 
*/
  __pyx_v_s = ((npy_intp)__pyx_v_size);

  /* "petsc4py/PETSc/arraynpy.pxi":87
 * cdef inline ndarray empty_i(PetscInt size):
 *     cdef npy_intp s = <npy_intp> 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(8, 87, __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":85
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0)
 * 
 * cdef inline ndarray empty_i(PetscInt size):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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":89
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0)
 * 
 * cdef inline ndarray empty_r(PetscInt size):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":90
 * 
 * cdef inline ndarray empty_r(PetscInt size):
 *     cdef npy_intp s = <npy_intp> size             # <<<<<<<<<<<<<<
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0)
 * 
*/
  __pyx_v_s = ((npy_intp)__pyx_v_size);

  /* "petsc4py/PETSc/arraynpy.pxi":91
 * cdef inline ndarray empty_r(PetscInt size):
 *     cdef npy_intp s = <npy_intp> 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(8, 91, __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":89
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0)
 * 
 * cdef inline ndarray empty_r(PetscInt size):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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":93
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0)
 * 
 * cdef inline ndarray empty_s(PetscInt size):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":94
 * 
 * cdef inline ndarray empty_s(PetscInt size):
 *     cdef npy_intp s = <npy_intp> size             # <<<<<<<<<<<<<<
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0)
 * 
*/
  __pyx_v_s = ((npy_intp)__pyx_v_size);

  /* "petsc4py/PETSc/arraynpy.pxi":95
 * cdef inline ndarray empty_s(PetscInt size):
 *     cdef npy_intp s = <npy_intp> 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(8, 95, __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":93
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0)
 * 
 * cdef inline ndarray empty_s(PetscInt size):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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":97
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0)
 * 
 * cdef inline ndarray empty_c(PetscInt size):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":98
 * 
 * cdef inline ndarray empty_c(PetscInt size):
 *     cdef npy_intp s = <npy_intp> size             # <<<<<<<<<<<<<<
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0)
 * 
*/
  __pyx_v_s = ((npy_intp)__pyx_v_size);

  /* "petsc4py/PETSc/arraynpy.pxi":99
 * cdef inline ndarray empty_c(PetscInt size):
 *     cdef npy_intp s = <npy_intp> 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(8, 99, __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":97
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0)
 * 
 * cdef inline ndarray empty_c(PetscInt size):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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":101
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0)
 * 
 * cdef inline ndarray empty_p(PetscInt size):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":102
 * 
 * cdef inline ndarray empty_p(PetscInt size):
 *     cdef npy_intp s = <npy_intp> size             # <<<<<<<<<<<<<<
 *     return PyArray_EMPTY(1, &s, NPY_INTP, 0)
 * 
*/
  __pyx_v_s = ((npy_intp)__pyx_v_size);

  /* "petsc4py/PETSc/arraynpy.pxi":103
 * cdef inline ndarray empty_p(PetscInt size):
 *     cdef npy_intp s = <npy_intp> 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(8, 103, __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":101
 *     return PyArray_EMPTY(1, &s, NPY_PETSC_COMPLEX, 0)
 * 
 * cdef inline ndarray empty_p(PetscInt size):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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":107
 * # --------------------------------------------------------------------
 * 
 * cdef inline ndarray array_i(PetscInt size, const PetscInt* data):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":108
 * 
 * cdef inline ndarray array_i(PetscInt size, const PetscInt* data):
 *     cdef npy_intp s = <npy_intp> 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":109
 * cdef inline ndarray array_i(PetscInt size, const PetscInt* data):
 *     cdef npy_intp s = <npy_intp> size
 *     cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0)             # <<<<<<<<<<<<<<
 *     if data != NULL:
 *         memcpy(PyArray_DATA(ary), data, <size_t>size*sizeof(PetscInt))
*/
  __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_INT, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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 = <npy_intp> size
 *     cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0)
 *     if data != NULL:             # <<<<<<<<<<<<<<
 *         memcpy(PyArray_DATA(ary), data, <size_t>size*sizeof(PetscInt))
 *     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_INT, 0)
 *     if data != NULL:
 *         memcpy(PyArray_DATA(ary), data, <size_t>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":110
 *     cdef npy_intp s = <npy_intp> size
 *     cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_INT, 0)
 *     if data != NULL:             # <<<<<<<<<<<<<<
 *         memcpy(PyArray_DATA(ary), data, <size_t>size*sizeof(PetscInt))
 *     return ary
*/
  }

  /* "petsc4py/PETSc/arraynpy.pxi":112
 *     if data != NULL:
 *         memcpy(PyArray_DATA(ary), data, <size_t>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":107
 * # --------------------------------------------------------------------
 * 
 * cdef inline ndarray array_i(PetscInt size, const PetscInt* data):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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":114
 *     return ary
 * 
 * cdef inline ndarray array_r(PetscInt size, const PetscReal* data):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":115
 * 
 * cdef inline ndarray array_r(PetscInt size, const PetscReal* data):
 *     cdef npy_intp s = <npy_intp> 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":116
 * cdef inline ndarray array_r(PetscInt size, const PetscReal* data):
 *     cdef npy_intp s = <npy_intp> size
 *     cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0)             # <<<<<<<<<<<<<<
 *     if data != NULL:
 *         memcpy(PyArray_DATA(ary), data, <size_t>size*sizeof(PetscReal))
*/
  __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_REAL, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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 = <npy_intp> size
 *     cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0)
 *     if data != NULL:             # <<<<<<<<<<<<<<
 *         memcpy(PyArray_DATA(ary), data, <size_t>size*sizeof(PetscReal))
 *     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_REAL, 0)
 *     if data != NULL:
 *         memcpy(PyArray_DATA(ary), data, <size_t>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":117
 *     cdef npy_intp s = <npy_intp> size
 *     cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_REAL, 0)
 *     if data != NULL:             # <<<<<<<<<<<<<<
 *         memcpy(PyArray_DATA(ary), data, <size_t>size*sizeof(PetscReal))
 *     return ary
*/
  }

  /* "petsc4py/PETSc/arraynpy.pxi":119
 *     if data != NULL:
 *         memcpy(PyArray_DATA(ary), data, <size_t>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":114
 *     return ary
 * 
 * cdef inline ndarray array_r(PetscInt size, const PetscReal* data):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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":121
 *     return ary
 * 
 * cdef inline ndarray array_b(PetscInt size, const PetscBool* data):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":122
 * 
 * cdef inline ndarray array_b(PetscInt size, const PetscBool* data):
 *     cdef npy_intp s = <npy_intp> 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":123
 * cdef inline ndarray array_b(PetscInt size, const PetscBool* data):
 *     cdef npy_intp s = <npy_intp> size
 *     cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0)             # <<<<<<<<<<<<<<
 *     if data != NULL:
 *         memcpy(PyArray_DATA(ary), data, <size_t>size*sizeof(PetscBool))
*/
  __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_BOOL, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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 = <npy_intp> size
 *     cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0)
 *     if data != NULL:             # <<<<<<<<<<<<<<
 *         memcpy(PyArray_DATA(ary), data, <size_t>size*sizeof(PetscBool))
 *     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_BOOL, 0)
 *     if data != NULL:
 *         memcpy(PyArray_DATA(ary), data, <size_t>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":124
 *     cdef npy_intp s = <npy_intp> size
 *     cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_BOOL, 0)
 *     if data != NULL:             # <<<<<<<<<<<<<<
 *         memcpy(PyArray_DATA(ary), data, <size_t>size*sizeof(PetscBool))
 *     return ary
*/
  }

  /* "petsc4py/PETSc/arraynpy.pxi":126
 *     if data != NULL:
 *         memcpy(PyArray_DATA(ary), data, <size_t>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":121
 *     return ary
 * 
 * cdef inline ndarray array_b(PetscInt size, const PetscBool* data):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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":128
 *     return ary
 * 
 * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":129
 * 
 * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data):
 *     cdef npy_intp s = <npy_intp> 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":130
 * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data):
 *     cdef npy_intp s = <npy_intp> size
 *     cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0)             # <<<<<<<<<<<<<<
 *     if data != NULL:
 *         memcpy(PyArray_DATA(ary), data, <size_t>size*sizeof(PetscScalar))
*/
  __pyx_t_1 = ((PyObject *)PyArray_EMPTY(1, (&__pyx_v_s), NPY_PETSC_SCALAR, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/arraynpy.pxi":131
 *     cdef npy_intp s = <npy_intp> size
 *     cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0)
 *     if data != NULL:             # <<<<<<<<<<<<<<
 *         memcpy(PyArray_DATA(ary), data, <size_t>size*sizeof(PetscScalar))
 *     return ary
*/
  __pyx_t_2 = (__pyx_v_data != NULL);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/arraynpy.pxi":132
 *     cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0)
 *     if data != NULL:
 *         memcpy(PyArray_DATA(ary), data, <size_t>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":131
 *     cdef npy_intp s = <npy_intp> size
 *     cdef ndarray ary = PyArray_EMPTY(1, &s, NPY_PETSC_SCALAR, 0)
 *     if data != NULL:             # <<<<<<<<<<<<<<
 *         memcpy(PyArray_DATA(ary), data, <size_t>size*sizeof(PetscScalar))
 *     return ary
*/
  }

  /* "petsc4py/PETSc/arraynpy.pxi":133
 *     if data != NULL:
 *         memcpy(PyArray_DATA(ary), data, <size_t>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":128
 *     return ary
 * 
 * cdef inline ndarray array_s(PetscInt size, const PetscScalar* data):             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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":137
 * # --------------------------------------------------------------------
 * 
 * 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":138
 * 
 * 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(8, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/arraynpy.pxi":140
 *     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":141
 *         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":142
 *     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(8, 142, __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":137
 * # --------------------------------------------------------------------
 * 
 * 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":144
 *     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] = <PetscInt> 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":145
 * 
 * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data):
 *     cdef ndarray ary = iarray(ob, NPY_PETSC_INT)             # <<<<<<<<<<<<<<
 *     if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
 *     if data != NULL: data[0] = <PetscInt*> 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(8, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/arraynpy.pxi":146
 * cdef inline ndarray iarray_i(object ob, PetscInt* size, PetscInt** data):
 *     cdef ndarray ary = iarray(ob, NPY_PETSC_INT)
 *     if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)             # <<<<<<<<<<<<<<
 *     if data != NULL: data[0] = <PetscInt*> 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":147
 *     cdef ndarray ary = iarray(ob, NPY_PETSC_INT)
 *     if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
 *     if data != NULL: data[0] = <PetscInt*> 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":148
 *     if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
 *     if data != NULL: data[0] = <PetscInt*> 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":144
 *     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] = <PetscInt> 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":150
 *     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] = <PetscInt> 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":151
 * 
 * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data):
 *     cdef ndarray ary = iarray(ob, NPY_PETSC_REAL)             # <<<<<<<<<<<<<<
 *     if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
 *     if data != NULL: data[0] = <PetscReal*> 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(8, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/arraynpy.pxi":152
 * cdef inline ndarray iarray_r(object ob, PetscInt* size, PetscReal** data):
 *     cdef ndarray ary = iarray(ob, NPY_PETSC_REAL)
 *     if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)             # <<<<<<<<<<<<<<
 *     if data != NULL: data[0] = <PetscReal*> 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":153
 *     cdef ndarray ary = iarray(ob, NPY_PETSC_REAL)
 *     if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
 *     if data != NULL: data[0] = <PetscReal*> 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":154
 *     if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
 *     if data != NULL: data[0] = <PetscReal*> 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":150
 *     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] = <PetscInt> 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":156
 *     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] = <PetscInt> 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":157
 * 
 * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data):
 *     cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL)             # <<<<<<<<<<<<<<
 *     if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
 *     if data != NULL: data[0] = <PetscBool*> 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(8, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/arraynpy.pxi":158
 * cdef inline ndarray iarray_b(object ob, PetscInt* size, PetscBool** data):
 *     cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL)
 *     if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)             # <<<<<<<<<<<<<<
 *     if data != NULL: data[0] = <PetscBool*> 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":159
 *     cdef ndarray ary = iarray(ob, NPY_PETSC_BOOL)
 *     if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
 *     if data != NULL: data[0] = <PetscBool*> 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":160
 *     if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
 *     if data != NULL: data[0] = <PetscBool*> 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":156
 *     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] = <PetscInt> 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":162
 *     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] = <PetscInt> 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":163
 * 
 * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data):
 *     cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR)             # <<<<<<<<<<<<<<
 *     if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
 *     if data != NULL: data[0] = <PetscScalar*> 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(8, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/arraynpy.pxi":164
 * cdef inline ndarray iarray_s(object ob, PetscInt* size, PetscScalar** data):
 *     cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR)
 *     if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)             # <<<<<<<<<<<<<<
 *     if data != NULL: data[0] = <PetscScalar*> 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":165
 *     cdef ndarray ary = iarray(ob, NPY_PETSC_SCALAR)
 *     if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
 *     if data != NULL: data[0] = <PetscScalar*> 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":166
 *     if size != NULL: size[0] = <PetscInt> PyArray_SIZE(ary)
 *     if data != NULL: data[0] = <PetscScalar*> 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":162
 *     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] = <PetscInt> 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":170
 * # --------------------------------------------------------------------
 * 
 * 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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":171
 * 
 * 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(8, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/arraynpy.pxi":173
 *     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":174
 *         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":175
 *     if PyArray_ISCONTIGUOUS(ary): return ary
 *     if PyArray_ISFORTRAN(ary):    return ary
 *     return PyArray_Copy(ary)             # <<<<<<<<<<<<<<
 * 
 * cdef inline ndarray oarray_b(object ob, PetscInt* size, PetscBool** data):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)PyArray_Copy(__pyx_v_ary)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 175, __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":170
 * # --------------------------------------------------------------------
 * 
 * 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":177
 *     return PyArray_Copy(ary)
 * 
 * cdef inline ndarray oarray_b(object ob, PetscInt* size, PetscBool** data):             # <<<<<<<<<<<<<<
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_BOOL)
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
*/

static CYTHON_INLINE PyArrayObject *__pyx_f_8petsc4py_5PETSc_oarray_b(PyObject *__pyx_v_ob, PetscInt *__pyx_v_size, PetscBool **__pyx_v_data) {
  PyArrayObject *__pyx_v_ary = 0;
  Py_ssize_t __pyx_v_ssize;
  PyArrayObject *__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("oarray_b", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":178
 * 
 * cdef inline ndarray oarray_b(object ob, PetscInt* size, PetscBool** data):
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_BOOL)             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray(__pyx_v_ob, NPY_PETSC_BOOL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/arraynpy.pxi":179
 * cdef inline ndarray oarray_b(object ob, PetscInt* size, PetscBool** data):
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_BOOL)
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)             # <<<<<<<<<<<<<<
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscBool*> PyArray_DATA(ary)
*/
  __pyx_v_ssize = PyArray_SIZE(__pyx_v_ary);

  /* "petsc4py/PETSc/arraynpy.pxi":180
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_BOOL)
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize             # <<<<<<<<<<<<<<
 *     if data != NULL: data[0] = <PetscBool*> PyArray_DATA(ary)
 *     if ssize == 0 and data != NULL: data[0] = NULL
*/
  __pyx_t_2 = (__pyx_v_size != NULL);
  if (__pyx_t_2) {
    (__pyx_v_size[0]) = ((PetscInt)__pyx_v_ssize);
  }

  /* "petsc4py/PETSc/arraynpy.pxi":181
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscBool*> PyArray_DATA(ary)             # <<<<<<<<<<<<<<
 *     if ssize == 0 and data != NULL: data[0] = NULL
 *     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":182
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscBool*> PyArray_DATA(ary)
 *     if ssize == 0 and data != NULL: data[0] = NULL             # <<<<<<<<<<<<<<
 *     return ary
 * 
*/
  __pyx_t_3 = (__pyx_v_ssize == 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_data != NULL);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_2) {
    (__pyx_v_data[0]) = NULL;
  }

  /* "petsc4py/PETSc/arraynpy.pxi":183
 *     if data != NULL: data[0] = <PetscBool*> PyArray_DATA(ary)
 *     if ssize == 0 and data != NULL: data[0] = NULL
 *     return ary             # <<<<<<<<<<<<<<
 * 
 * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_ary);
  __pyx_r = __pyx_v_ary;
  goto __pyx_L0;

  /* "petsc4py/PETSc/arraynpy.pxi":177
 *     return PyArray_Copy(ary)
 * 
 * cdef inline ndarray oarray_b(object ob, PetscInt* size, PetscBool** data):             # <<<<<<<<<<<<<<
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_BOOL)
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("petsc4py.PETSc.oarray_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":185
 *     return ary
 * 
 * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data):             # <<<<<<<<<<<<<<
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_INT)
 *     cdef Py_ssize_t ssize = 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;
  Py_ssize_t __pyx_v_ssize;
  PyArrayObject *__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("oarray_i", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":186
 * 
 * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data):
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_INT)             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray(__pyx_v_ob, NPY_PETSC_INT)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/arraynpy.pxi":187
 * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data):
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_INT)
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)             # <<<<<<<<<<<<<<
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscInt*> PyArray_DATA(ary)
*/
  __pyx_v_ssize = PyArray_SIZE(__pyx_v_ary);

  /* "petsc4py/PETSc/arraynpy.pxi":188
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_INT)
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize             # <<<<<<<<<<<<<<
 *     if data != NULL: data[0] = <PetscInt*> PyArray_DATA(ary)
 *     if ssize == 0 and data != NULL: data[0] = NULL
*/
  __pyx_t_2 = (__pyx_v_size != NULL);
  if (__pyx_t_2) {
    (__pyx_v_size[0]) = ((PetscInt)__pyx_v_ssize);
  }

  /* "petsc4py/PETSc/arraynpy.pxi":189
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscInt*> PyArray_DATA(ary)             # <<<<<<<<<<<<<<
 *     if ssize == 0 and data != NULL: data[0] = NULL
 *     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":190
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscInt*> PyArray_DATA(ary)
 *     if ssize == 0 and data != NULL: data[0] = NULL             # <<<<<<<<<<<<<<
 *     return ary
 * 
*/
  __pyx_t_3 = (__pyx_v_ssize == 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_data != NULL);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_2) {
    (__pyx_v_data[0]) = NULL;
  }

  /* "petsc4py/PETSc/arraynpy.pxi":191
 *     if data != NULL: data[0] = <PetscInt*> PyArray_DATA(ary)
 *     if ssize == 0 and data != NULL: data[0] = NULL
 *     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":185
 *     return ary
 * 
 * cdef inline ndarray oarray_i(object ob, PetscInt* size, PetscInt** data):             # <<<<<<<<<<<<<<
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_INT)
 *     cdef Py_ssize_t ssize = 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":193
 *     return ary
 * 
 * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data):             # <<<<<<<<<<<<<<
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_REAL)
 *     cdef Py_ssize_t ssize = 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;
  Py_ssize_t __pyx_v_ssize;
  PyArrayObject *__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("oarray_r", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":194
 * 
 * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data):
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_REAL)             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray(__pyx_v_ob, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/arraynpy.pxi":195
 * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data):
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_REAL)
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)             # <<<<<<<<<<<<<<
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscReal*> PyArray_DATA(ary)
*/
  __pyx_v_ssize = PyArray_SIZE(__pyx_v_ary);

  /* "petsc4py/PETSc/arraynpy.pxi":196
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_REAL)
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize             # <<<<<<<<<<<<<<
 *     if data != NULL: data[0] = <PetscReal*> PyArray_DATA(ary)
 *     if ssize == 0 and data != NULL: data[0] = NULL
*/
  __pyx_t_2 = (__pyx_v_size != NULL);
  if (__pyx_t_2) {
    (__pyx_v_size[0]) = ((PetscInt)__pyx_v_ssize);
  }

  /* "petsc4py/PETSc/arraynpy.pxi":197
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscReal*> PyArray_DATA(ary)             # <<<<<<<<<<<<<<
 *     if ssize == 0 and data != NULL: data[0] = NULL
 *     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":198
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscReal*> PyArray_DATA(ary)
 *     if ssize == 0 and data != NULL: data[0] = NULL             # <<<<<<<<<<<<<<
 *     return ary
 * 
*/
  __pyx_t_3 = (__pyx_v_ssize == 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_data != NULL);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_2) {
    (__pyx_v_data[0]) = NULL;
  }

  /* "petsc4py/PETSc/arraynpy.pxi":199
 *     if data != NULL: data[0] = <PetscReal*> PyArray_DATA(ary)
 *     if ssize == 0 and data != NULL: data[0] = NULL
 *     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":193
 *     return ary
 * 
 * cdef inline ndarray oarray_r(object ob, PetscInt* size, PetscReal** data):             # <<<<<<<<<<<<<<
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_REAL)
 *     cdef Py_ssize_t ssize = 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":201
 *     return ary
 * 
 * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data):             # <<<<<<<<<<<<<<
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR)
 *     cdef Py_ssize_t ssize = 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;
  Py_ssize_t __pyx_v_ssize;
  PyArrayObject *__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("oarray_s", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":202
 * 
 * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data):
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR)             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray(__pyx_v_ob, NPY_PETSC_SCALAR)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/arraynpy.pxi":203
 * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data):
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR)
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)             # <<<<<<<<<<<<<<
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscScalar*> PyArray_DATA(ary)
*/
  __pyx_v_ssize = PyArray_SIZE(__pyx_v_ary);

  /* "petsc4py/PETSc/arraynpy.pxi":204
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR)
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize             # <<<<<<<<<<<<<<
 *     if data != NULL: data[0] = <PetscScalar*> PyArray_DATA(ary)
 *     if ssize == 0 and data != NULL: data[0] = NULL
*/
  __pyx_t_2 = (__pyx_v_size != NULL);
  if (__pyx_t_2) {
    (__pyx_v_size[0]) = ((PetscInt)__pyx_v_ssize);
  }

  /* "petsc4py/PETSc/arraynpy.pxi":205
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscScalar*> PyArray_DATA(ary)             # <<<<<<<<<<<<<<
 *     if ssize == 0 and data != NULL: data[0] = NULL
 *     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":206
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscScalar*> PyArray_DATA(ary)
 *     if ssize == 0 and data != NULL: data[0] = NULL             # <<<<<<<<<<<<<<
 *     return ary
 * 
*/
  __pyx_t_3 = (__pyx_v_ssize == 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_data != NULL);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_2) {
    (__pyx_v_data[0]) = NULL;
  }

  /* "petsc4py/PETSc/arraynpy.pxi":207
 *     if data != NULL: data[0] = <PetscScalar*> PyArray_DATA(ary)
 *     if ssize == 0 and data != NULL: data[0] = NULL
 *     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":201
 *     return ary
 * 
 * cdef inline ndarray oarray_s(object ob, PetscInt* size, PetscScalar** data):             # <<<<<<<<<<<<<<
 *     cdef ndarray ary = oarray(ob, NPY_PETSC_SCALAR)
 *     cdef Py_ssize_t ssize = 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":209
 *     return ary
 * 
 * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data):             # <<<<<<<<<<<<<<
 *     cdef ndarray ary = oarray(ob, NPY_INTP)
 *     cdef Py_ssize_t ssize = 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;
  Py_ssize_t __pyx_v_ssize;
  PyArrayObject *__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("oarray_p", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":210
 * 
 * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data):
 *     cdef ndarray ary = oarray(ob, NPY_INTP)             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray(__pyx_v_ob, NPY_INTP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/arraynpy.pxi":211
 * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data):
 *     cdef ndarray ary = oarray(ob, NPY_INTP)
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)             # <<<<<<<<<<<<<<
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <void*> PyArray_DATA(ary)
*/
  __pyx_v_ssize = PyArray_SIZE(__pyx_v_ary);

  /* "petsc4py/PETSc/arraynpy.pxi":212
 *     cdef ndarray ary = oarray(ob, NPY_INTP)
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize             # <<<<<<<<<<<<<<
 *     if data != NULL: data[0] = <void*> PyArray_DATA(ary)
 *     if ssize == 0 and data != NULL: data[0] = NULL
*/
  __pyx_t_2 = (__pyx_v_size != NULL);
  if (__pyx_t_2) {
    (__pyx_v_size[0]) = ((PetscInt)__pyx_v_ssize);
  }

  /* "petsc4py/PETSc/arraynpy.pxi":213
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <void*> PyArray_DATA(ary)             # <<<<<<<<<<<<<<
 *     if ssize == 0 and data != NULL: data[0] = NULL
 *     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":214
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <void*> PyArray_DATA(ary)
 *     if ssize == 0 and data != NULL: data[0] = NULL             # <<<<<<<<<<<<<<
 *     return ary
 * 
*/
  __pyx_t_3 = (__pyx_v_ssize == 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_data != NULL);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_2) {
    (__pyx_v_data[0]) = NULL;
  }

  /* "petsc4py/PETSc/arraynpy.pxi":215
 *     if data != NULL: data[0] = <void*> PyArray_DATA(ary)
 *     if ssize == 0 and data != NULL: data[0] = NULL
 *     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":209
 *     return ary
 * 
 * cdef inline ndarray oarray_p(object ob, PetscInt* size, void** data):             # <<<<<<<<<<<<<<
 *     cdef ndarray ary = oarray(ob, NPY_INTP)
 *     cdef Py_ssize_t ssize = 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":219
 * # --------------------------------------------------------------------
 * 
 * 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;
  Py_ssize_t __pyx_v_ssize;
  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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":220
 * 
 * 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)
 *     cdef Py_ssize_t ssize = 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(8, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/arraynpy.pxi":222
 *     cdef ndarray ary = PyArray_FROM_OTF(
 *         ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED)
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)             # <<<<<<<<<<<<<<
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscScalar*> PyArray_DATA(ary)
*/
  __pyx_v_ssize = PyArray_SIZE(__pyx_v_ary);

  /* "petsc4py/PETSc/arraynpy.pxi":223
 *         ob, NPY_PETSC_SCALAR, NPY_ARRAY_CARRAY|NPY_ARRAY_NOTSWAPPED)
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize             # <<<<<<<<<<<<<<
 *     if data != NULL: data[0] = <PetscScalar*> PyArray_DATA(ary)
 *     return ary
*/
  __pyx_t_2 = (__pyx_v_size != NULL);
  if (__pyx_t_2) {
    (__pyx_v_size[0]) = ((PetscInt)__pyx_v_ssize);
  }

  /* "petsc4py/PETSc/arraynpy.pxi":224
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscScalar*> 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":225
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscScalar*> 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":219
 * # --------------------------------------------------------------------
 * 
 * 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":227
 *     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;
  Py_ssize_t __pyx_v_ssize;
  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", 0);

  /* "petsc4py/PETSc/arraynpy.pxi":228
 * 
 * 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)
 *     cdef Py_ssize_t ssize = 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(8, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/arraynpy.pxi":230
 *     cdef ndarray ary = PyArray_FROM_OTF(
 *         ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED)
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)             # <<<<<<<<<<<<<<
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscScalar*> PyArray_DATA(ary)
*/
  __pyx_v_ssize = PyArray_SIZE(__pyx_v_ary);

  /* "petsc4py/PETSc/arraynpy.pxi":231
 *         ob, NPY_PETSC_SCALAR, NPY_ARRAY_FARRAY|NPY_ARRAY_NOTSWAPPED)
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize             # <<<<<<<<<<<<<<
 *     if data != NULL: data[0] = <PetscScalar*> PyArray_DATA(ary)
 *     return ary
*/
  __pyx_t_2 = (__pyx_v_size != NULL);
  if (__pyx_t_2) {
    (__pyx_v_size[0]) = ((PetscInt)__pyx_v_ssize);
  }

  /* "petsc4py/PETSc/arraynpy.pxi":232
 *     cdef Py_ssize_t ssize = PyArray_SIZE(ary)
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscScalar*> 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":233
 *     if size != NULL: size[0] = <PetscInt> ssize
 *     if data != NULL: data[0] = <PetscScalar*> 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":227
 *     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 = <DLManagedTensor *>PyCapsule_GetPointer(dltensor, b'dltensor')
 *         manager_deleter(dlm_tensor)
*/
  __pyx_t_1 = PyCapsule_IsValid(__pyx_v_dltensor, __pyx_k_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 = <DLManagedTensor *>PyCapsule_GetPointer(dltensor, b'dltensor')             # <<<<<<<<<<<<<<
 *         manager_deleter(dlm_tensor)
 * 
*/
    __pyx_t_2 = PyCapsule_GetPointer(__pyx_v_dltensor, __pyx_k_dltensor); if (unlikely(__pyx_t_2 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(9, 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 = <DLManagedTensor *>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 = <DLManagedTensor *>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":41
 *         PETSC_USE_POINTER
 * 
 * cdef inline PetscInsertMode insertmode(object mode) \             # <<<<<<<<<<<<<<
 *     except <PetscInsertMode>(-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":43
 * cdef inline PetscInsertMode insertmode(object mode) \
 *     except <PetscInsertMode>(-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":44
 *     except <PetscInsertMode>(-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":45
 *     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":46
 *     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_PyLong_As_InsertMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 46, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscdef.pxi":41
 *         PETSC_USE_POINTER
 * 
 * cdef inline PetscInsertMode insertmode(object mode) \             # <<<<<<<<<<<<<<
 *     except <PetscInsertMode>(-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":48
 *     else:               return mode
 * 
 * cdef inline PetscScatterMode scattermode(object mode) \             # <<<<<<<<<<<<<<
 *     except <PetscScatterMode>(-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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  ScatterMode __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scattermode", 0);

  /* "petsc4py/PETSc/petscdef.pxi":50
 * cdef inline PetscScatterMode scattermode(object mode) \
 *     except <PetscScatterMode>(-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":51
 *     except <PetscScatterMode>(-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":52
 *     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":53
 *     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 = PyUnicode_Check(__pyx_v_mode); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscdef.pxi":54
 *     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_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_forward, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(10, 54, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = SCATTER_FORWARD;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdef.pxi":55
 *     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_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_reverse, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(10, 55, __pyx_L1_error)
    if (likely(__pyx_t_1)) {
      __pyx_r = SCATTER_REVERSE;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdef.pxi":56
 *         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_3 = NULL;
      __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_unknown_scatter_mode_s, __pyx_v_mode); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 56, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 56, __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(10, 56, __pyx_L1_error)
    }

    /* "petsc4py/PETSc/petscdef.pxi":53
 *     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":57
 *         if mode == 'reverse': return PETSC_SCATTER_REVERSE
 *         else: raise ValueError("unknown scatter mode: %s" % mode)
 *     return mode             # <<<<<<<<<<<<<<
*/
  __pyx_t_6 = ((ScatterMode)__Pyx_PyLong_As_ScatterMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 57, __pyx_L1_error)
  __pyx_r = __pyx_t_6;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscdef.pxi":48
 *     else:               return mode
 * 
 * cdef inline PetscScatterMode scattermode(object mode) \             # <<<<<<<<<<<<<<
 *     except <PetscScatterMode>(-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_XDECREF(__pyx_t_4);
  __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":43
 * #
 * 
 * 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;
  size_t __pyx_t_4;
  int __pyx_t_5;
  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":44
 * 
 * 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":45
 * 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":44
 * 
 * cdef getprefix(prefix, deft=None):
 *     if prefix is None:             # <<<<<<<<<<<<<<
 *         prefix = deft
 *     elif isinstance(prefix, Options):
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/petscopt.pxi":46
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscopt.pxi":47
 *         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_mstate_global->__pyx_n_u_prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 47, __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":46
 *     if prefix is None:
 *         prefix = deft
 *     elif isinstance(prefix, Options):             # <<<<<<<<<<<<<<
 *         prefix = prefix.prefix
 *     elif isinstance(prefix, Object):
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/petscopt.pxi":48
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscopt.pxi":49
 *         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_v_prefix;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getOptionsPrefix, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 49, __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":48
 *     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":50
 *     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 = PyUnicode_Check(__pyx_v_prefix); 
  __pyx_t_5 = (!__pyx_t_1);
  if (unlikely(__pyx_t_5)) {

    /* "petsc4py/PETSc/petscopt.pxi":51
 *         prefix = prefix.getOptionsPrefix()
 *     elif not isinstance(prefix, str):
 *         raise TypeError('option prefix must be string')             # <<<<<<<<<<<<<<
 *     if not prefix:
 *         return None
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_option_prefix_must_be_string};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 51, __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(11, 51, __pyx_L1_error)

    /* "petsc4py/PETSc/petscopt.pxi":50
 *     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":52
 *     elif not isinstance(prefix, str):
 *         raise TypeError('option prefix must be string')
 *     if not prefix:             # <<<<<<<<<<<<<<
 *         return None
 *     if prefix.count(' '):
*/
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(11, 52, __pyx_L1_error)
  __pyx_t_1 = (!__pyx_t_5);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscopt.pxi":53
 *         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":52
 *     elif not isinstance(prefix, str):
 *         raise TypeError('option prefix must be string')
 *     if not prefix:             # <<<<<<<<<<<<<<
 *         return None
 *     if prefix.count(' '):
*/
  }

  /* "petsc4py/PETSc/petscopt.pxi":54
 *     if not prefix:
 *         return None
 *     if prefix.count(' '):             # <<<<<<<<<<<<<<
 *         raise ValueError('option prefix should not have spaces')
 *     if prefix.startswith('-'):
*/
  __pyx_t_3 = __pyx_v_prefix;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u__12};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_count, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 54, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(11, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_1)) {

    /* "petsc4py/PETSc/petscopt.pxi":55
 *         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_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_option_prefix_should_not_have_sp};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 55, __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(11, 55, __pyx_L1_error)

    /* "petsc4py/PETSc/petscopt.pxi":54
 *     if not prefix:
 *         return None
 *     if prefix.count(' '):             # <<<<<<<<<<<<<<
 *         raise ValueError('option prefix should not have spaces')
 *     if prefix.startswith('-'):
*/
  }

  /* "petsc4py/PETSc/petscopt.pxi":56
 *     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_v_prefix;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u__13};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_startswith, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(11, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_1)) {

    /* "petsc4py/PETSc/petscopt.pxi":57
 *         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 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_option_prefix_should_not_start_w};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 57, __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(11, 57, __pyx_L1_error)

    /* "petsc4py/PETSc/petscopt.pxi":56
 *     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":58
 *     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":43
 * #
 * 
 * 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_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":62
 * #
 * 
 * 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;
  PyObject *__pyx_t_4[5];
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("opt2str", 0);

  /* "petsc4py/PETSc/petscopt.pxi":63
 * 
 * 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(11, 63, __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":64
 * 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(11, 64, __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(11, 64, __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":65
 *     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 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_p), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_n), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_prefix_2;
  __pyx_t_4[1] = __pyx_t_1;
  __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_name_3;
  __pyx_t_4[3] = __pyx_t_3;
  __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__5;
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, 8 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 7 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
  if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscopt.pxi":62
 * #
 * 
 * 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_XDECREF(__pyx_t_5);
  __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":67
 *     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;
  PetscBool __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getopt_Bool", 0);

  /* "petsc4py/PETSc/petscopt.pxi":68
 * 
 * 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":69
 * 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":70
 *     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 toBool(asBool(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(11, 70, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":71
 *     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 toBool(asBool(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(11, 71, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":72
 *     CHKERR(PetscOptionsGetBool(opt, pre, name, &value, &flag))
 *     if flag==PETSC_TRUE: return toBool(value)
 *     if deft is not None: return toBool(asBool(deft))             # <<<<<<<<<<<<<<
 *     raise KeyError(opt2str(pre, name))
 * 
*/
  __pyx_t_2 = (__pyx_v_deft != Py_None);
  if (__pyx_t_2) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_deft); if (unlikely(__pyx_t_4 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(11, 72, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":73
 *     if flag==PETSC_TRUE: return toBool(value)
 *     if deft is not None: return toBool(asBool(deft))
 *     raise KeyError(opt2str(pre, name))             # <<<<<<<<<<<<<<
 * 
 * cdef getopt_BoolArray(PetscOptions opt, const char *pre, const char *name, object deft):
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_KeyError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 73, __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(11, 73, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":67
 *     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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":75
 *     raise KeyError(opt2str(pre, name))
 * 
 * cdef getopt_BoolArray(PetscOptions opt, const char *pre, const char *name, object deft):             # <<<<<<<<<<<<<<
 *     cdef PetscBool value[1024], *ivalue = value, *ivaluedeft = NULL
 *     cdef PetscInt nmax = 1024, ndeft = 0
*/

static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_BoolArray(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) {
  PetscBool __pyx_v_value[1024];
  PetscBool *__pyx_v_ivalue;
  PetscBool *__pyx_v_ivaluedeft;
  PetscInt __pyx_v_nmax;
  PetscInt __pyx_v_ndeft;
  PetscBool __pyx_v_flag;
  CYTHON_UNUSED PyObject *__pyx_v_unused = 0;
  PyObject *__pyx_7genexpr__pyx_v_d = 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;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PetscBool __pyx_t_7;
  PetscErrorCode __pyx_t_8;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getopt_BoolArray", 0);
  __Pyx_INCREF(__pyx_v_deft);

  /* "petsc4py/PETSc/petscopt.pxi":76
 * 
 * cdef getopt_BoolArray(PetscOptions opt, const char *pre, const char *name, object deft):
 *     cdef PetscBool value[1024], *ivalue = value, *ivaluedeft = NULL             # <<<<<<<<<<<<<<
 *     cdef PetscInt nmax = 1024, ndeft = 0
 *     cdef PetscBool flag = PETSC_FALSE
*/
  __pyx_v_ivalue = __pyx_v_value;
  __pyx_v_ivaluedeft = NULL;

  /* "petsc4py/PETSc/petscopt.pxi":77
 * cdef getopt_BoolArray(PetscOptions opt, const char *pre, const char *name, object deft):
 *     cdef PetscBool value[1024], *ivalue = value, *ivaluedeft = NULL
 *     cdef PetscInt nmax = 1024, ndeft = 0             # <<<<<<<<<<<<<<
 *     cdef PetscBool flag = PETSC_FALSE
 *     cdef object unused
*/
  __pyx_v_nmax = 0x400;
  __pyx_v_ndeft = 0;

  /* "petsc4py/PETSc/petscopt.pxi":78
 *     cdef PetscBool value[1024], *ivalue = value, *ivaluedeft = NULL
 *     cdef PetscInt nmax = 1024, ndeft = 0
 *     cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *     cdef object unused
 *     if deft is not None:
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/petscopt.pxi":80
 *     cdef PetscBool flag = PETSC_FALSE
 *     cdef object unused
 *     if deft is not None:             # <<<<<<<<<<<<<<
 *         deft = [toBool(asBool(d)) for d in deft]
 *         deft = iarray_b(deft, &ndeft, &ivaluedeft)
*/
  __pyx_t_1 = (__pyx_v_deft != Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscopt.pxi":81
 *     cdef object unused
 *     if deft is not None:
 *         deft = [toBool(asBool(d)) for d in deft]             # <<<<<<<<<<<<<<
 *         deft = iarray_b(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:
*/
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 81, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (likely(PyList_CheckExact(__pyx_v_deft)) || PyTuple_CheckExact(__pyx_v_deft)) {
        __pyx_t_3 = __pyx_v_deft; __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_deft); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 81, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 81, __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_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 81, __pyx_L6_error)
              #endif
              if (__pyx_t_4 >= __pyx_temp) break;
            }
            __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_4;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(11, 81, __pyx_L6_error)
              #endif
              if (__pyx_t_4 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4));
            #else
            __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4);
            #endif
            ++__pyx_t_4;
          }
          if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 81, __pyx_L6_error)
        } else {
          __pyx_t_6 = __pyx_t_5(__pyx_t_3);
          if (unlikely(!__pyx_t_6)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(11, 81, __pyx_L6_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_d, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_7genexpr__pyx_v_d); if (unlikely(__pyx_t_7 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(11, 81, __pyx_L6_error)
        __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 81, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(11, 81, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_d); __pyx_7genexpr__pyx_v_d = 0;
      goto __pyx_L10_exit_scope;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_d); __pyx_7genexpr__pyx_v_d = 0;
      goto __pyx_L1_error;
      __pyx_L10_exit_scope:;
    } /* exit inner scope */
    __Pyx_DECREF_SET(__pyx_v_deft, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscopt.pxi":82
 *     if deft is not None:
 *         deft = [toBool(asBool(d)) for d in deft]
 *         deft = iarray_b(deft, &ndeft, &ivaluedeft)             # <<<<<<<<<<<<<<
 *         if ndeft > nmax:
 *             unused = oarray_b(empty_b(ndeft), &nmax, &ivalue)
*/
    __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_b(__pyx_v_deft, (&__pyx_v_ndeft), (&__pyx_v_ivaluedeft))); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_deft, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscopt.pxi":83
 *         deft = [toBool(asBool(d)) for d in deft]
 *         deft = iarray_b(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:             # <<<<<<<<<<<<<<
 *             unused = oarray_b(empty_b(ndeft), &nmax, &ivalue)
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscBool))
*/
    __pyx_t_1 = (__pyx_v_ndeft > __pyx_v_nmax);
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/petscopt.pxi":84
 *         deft = iarray_b(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:
 *             unused = oarray_b(empty_b(ndeft), &nmax, &ivalue)             # <<<<<<<<<<<<<<
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscBool))
 *     CHKERR(PetscOptionsGetBoolArray(opt, pre, name, ivalue, &nmax, &flag))
*/
      __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_b(__pyx_v_ndeft)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 84, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_b(__pyx_t_2, (&__pyx_v_nmax), (&__pyx_v_ivalue))); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 84, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_unused = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "petsc4py/PETSc/petscopt.pxi":83
 *         deft = [toBool(asBool(d)) for d in deft]
 *         deft = iarray_b(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:             # <<<<<<<<<<<<<<
 *             unused = oarray_b(empty_b(ndeft), &nmax, &ivalue)
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscBool))
*/
    }

    /* "petsc4py/PETSc/petscopt.pxi":85
 *         if ndeft > nmax:
 *             unused = oarray_b(empty_b(ndeft), &nmax, &ivalue)
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscBool))             # <<<<<<<<<<<<<<
 *     CHKERR(PetscOptionsGetBoolArray(opt, pre, name, ivalue, &nmax, &flag))
 *     if flag==PETSC_TRUE: return array_b(nmax, ivalue).astype('bool')
*/
    (void)(memcpy(__pyx_v_ivalue, __pyx_v_ivaluedeft, (((size_t)__pyx_v_ndeft) * (sizeof(PetscBool)))));

    /* "petsc4py/PETSc/petscopt.pxi":80
 *     cdef PetscBool flag = PETSC_FALSE
 *     cdef object unused
 *     if deft is not None:             # <<<<<<<<<<<<<<
 *         deft = [toBool(asBool(d)) for d in deft]
 *         deft = iarray_b(deft, &ndeft, &ivaluedeft)
*/
  }

  /* "petsc4py/PETSc/petscopt.pxi":86
 *             unused = oarray_b(empty_b(ndeft), &nmax, &ivalue)
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscBool))
 *     CHKERR(PetscOptionsGetBoolArray(opt, pre, name, ivalue, &nmax, &flag))             # <<<<<<<<<<<<<<
 *     if flag==PETSC_TRUE: return array_b(nmax, ivalue).astype('bool')
 *     if deft is not None: return deft.astype('bool')
*/
  __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetBoolArray(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, __pyx_v_ivalue, (&__pyx_v_nmax), (&__pyx_v_flag))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 86, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":87
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscBool))
 *     CHKERR(PetscOptionsGetBoolArray(opt, pre, name, ivalue, &nmax, &flag))
 *     if flag==PETSC_TRUE: return array_b(nmax, ivalue).astype('bool')             # <<<<<<<<<<<<<<
 *     if deft is not None: return deft.astype('bool')
 *     raise KeyError(opt2str(pre, name))
*/
  __pyx_t_1 = (__pyx_v_flag == PETSC_TRUE);
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_b(__pyx_v_nmax, __pyx_v_ivalue)); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __pyx_t_6;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_bool};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_astype, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 87, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":88
 *     CHKERR(PetscOptionsGetBoolArray(opt, pre, name, ivalue, &nmax, &flag))
 *     if flag==PETSC_TRUE: return array_b(nmax, ivalue).astype('bool')
 *     if deft is not None: return deft.astype('bool')             # <<<<<<<<<<<<<<
 *     raise KeyError(opt2str(pre, name))
 * 
*/
  __pyx_t_1 = (__pyx_v_deft != Py_None);
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __pyx_v_deft;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_n_u_bool};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_astype, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 88, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":89
 *     if flag==PETSC_TRUE: return array_b(nmax, ivalue).astype('bool')
 *     if deft is not None: return deft.astype('bool')
 *     raise KeyError(opt2str(pre, name))             # <<<<<<<<<<<<<<
 * 
 * cdef getopt_Int(PetscOptions opt, const char *pre, const char *name, object deft):
*/
  __pyx_t_6 = NULL;
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_2};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_KeyError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 89, __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(11, 89, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":75
 *     raise KeyError(opt2str(pre, name))
 * 
 * cdef getopt_BoolArray(PetscOptions opt, const char *pre, const char *name, object deft):             # <<<<<<<<<<<<<<
 *     cdef PetscBool value[1024], *ivalue = value, *ivaluedeft = NULL
 *     cdef PetscInt nmax = 1024, ndeft = 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("petsc4py.PETSc.getopt_BoolArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF(__pyx_7genexpr__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_deft);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/petscopt.pxi":91
 *     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;
  PetscInt __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getopt_Int", 0);

  /* "petsc4py/PETSc/petscopt.pxi":92
 * 
 * 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":93
 * 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":94
 *     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 toInt(asInt(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(11, 94, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":95
 *     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 toInt(asInt(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(11, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":96
 *     CHKERR(PetscOptionsGetInt(opt, pre, name, &value, &flag))
 *     if flag==PETSC_TRUE: return toInt(value)
 *     if deft is not None: return toInt(asInt(deft))             # <<<<<<<<<<<<<<
 *     raise KeyError(opt2str(pre, name))
 * 
*/
  __pyx_t_2 = (__pyx_v_deft != Py_None);
  if (__pyx_t_2) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_deft); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(11, 96, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":97
 *     if flag==PETSC_TRUE: return toInt(value)
 *     if deft is not None: return toInt(asInt(deft))
 *     raise KeyError(opt2str(pre, name))             # <<<<<<<<<<<<<<
 * 
 * cdef getopt_IntArray(PetscOptions opt, const char *pre, const char *name, object deft):
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_KeyError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 97, __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(11, 97, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":91
 *     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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":99
 *     raise KeyError(opt2str(pre, name))
 * 
 * cdef getopt_IntArray(PetscOptions opt, const char *pre, const char *name, object deft):             # <<<<<<<<<<<<<<
 *     cdef PetscInt value[1024], *ivalue = value, *ivaluedeft = NULL
 *     cdef PetscInt nmax = 1024, ndeft = 0
*/

static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_IntArray(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) {
  PetscInt __pyx_v_value[1024];
  PetscInt *__pyx_v_ivalue;
  PetscInt *__pyx_v_ivaluedeft;
  PetscInt __pyx_v_nmax;
  PetscInt __pyx_v_ndeft;
  PetscBool __pyx_v_flag;
  CYTHON_UNUSED PyObject *__pyx_v_unused = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PetscErrorCode __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getopt_IntArray", 0);
  __Pyx_INCREF(__pyx_v_deft);

  /* "petsc4py/PETSc/petscopt.pxi":100
 * 
 * cdef getopt_IntArray(PetscOptions opt, const char *pre, const char *name, object deft):
 *     cdef PetscInt value[1024], *ivalue = value, *ivaluedeft = NULL             # <<<<<<<<<<<<<<
 *     cdef PetscInt nmax = 1024, ndeft = 0
 *     cdef PetscBool flag = PETSC_FALSE
*/
  __pyx_v_ivalue = __pyx_v_value;
  __pyx_v_ivaluedeft = NULL;

  /* "petsc4py/PETSc/petscopt.pxi":101
 * cdef getopt_IntArray(PetscOptions opt, const char *pre, const char *name, object deft):
 *     cdef PetscInt value[1024], *ivalue = value, *ivaluedeft = NULL
 *     cdef PetscInt nmax = 1024, ndeft = 0             # <<<<<<<<<<<<<<
 *     cdef PetscBool flag = PETSC_FALSE
 *     cdef object unused
*/
  __pyx_v_nmax = 0x400;
  __pyx_v_ndeft = 0;

  /* "petsc4py/PETSc/petscopt.pxi":102
 *     cdef PetscInt value[1024], *ivalue = value, *ivaluedeft = NULL
 *     cdef PetscInt nmax = 1024, ndeft = 0
 *     cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *     cdef object unused
 *     if deft is not None:
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/petscopt.pxi":104
 *     cdef PetscBool flag = PETSC_FALSE
 *     cdef object unused
 *     if deft is not None:             # <<<<<<<<<<<<<<
 *         deft = iarray_i(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:
*/
  __pyx_t_1 = (__pyx_v_deft != Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscopt.pxi":105
 *     cdef object unused
 *     if deft is not None:
 *         deft = iarray_i(deft, &ndeft, &ivaluedeft)             # <<<<<<<<<<<<<<
 *         if ndeft > nmax:
 *             unused = oarray_i(empty_i(ndeft), &nmax, &ivalue)
*/
    __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_deft, (&__pyx_v_ndeft), (&__pyx_v_ivaluedeft))); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_deft, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscopt.pxi":106
 *     if deft is not None:
 *         deft = iarray_i(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:             # <<<<<<<<<<<<<<
 *             unused = oarray_i(empty_i(ndeft), &nmax, &ivalue)
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscInt))
*/
    __pyx_t_1 = (__pyx_v_ndeft > __pyx_v_nmax);
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/petscopt.pxi":107
 *         deft = iarray_i(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:
 *             unused = oarray_i(empty_i(ndeft), &nmax, &ivalue)             # <<<<<<<<<<<<<<
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscInt))
 *     CHKERR(PetscOptionsGetIntArray(opt, pre, name, ivalue, &nmax, &flag))
*/
      __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_i(__pyx_v_ndeft)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_i(__pyx_t_2, (&__pyx_v_nmax), (&__pyx_v_ivalue))); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_unused = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "petsc4py/PETSc/petscopt.pxi":106
 *     if deft is not None:
 *         deft = iarray_i(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:             # <<<<<<<<<<<<<<
 *             unused = oarray_i(empty_i(ndeft), &nmax, &ivalue)
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscInt))
*/
    }

    /* "petsc4py/PETSc/petscopt.pxi":108
 *         if ndeft > nmax:
 *             unused = oarray_i(empty_i(ndeft), &nmax, &ivalue)
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscInt))             # <<<<<<<<<<<<<<
 *     CHKERR(PetscOptionsGetIntArray(opt, pre, name, ivalue, &nmax, &flag))
 *     if flag==PETSC_TRUE: return array_i(nmax, ivalue)
*/
    (void)(memcpy(__pyx_v_ivalue, __pyx_v_ivaluedeft, (((size_t)__pyx_v_ndeft) * (sizeof(PetscInt)))));

    /* "petsc4py/PETSc/petscopt.pxi":104
 *     cdef PetscBool flag = PETSC_FALSE
 *     cdef object unused
 *     if deft is not None:             # <<<<<<<<<<<<<<
 *         deft = iarray_i(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:
*/
  }

  /* "petsc4py/PETSc/petscopt.pxi":109
 *             unused = oarray_i(empty_i(ndeft), &nmax, &ivalue)
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscInt))
 *     CHKERR(PetscOptionsGetIntArray(opt, pre, name, ivalue, &nmax, &flag))             # <<<<<<<<<<<<<<
 *     if flag==PETSC_TRUE: return array_i(nmax, ivalue)
 *     if deft is not None: return deft
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetIntArray(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, __pyx_v_ivalue, (&__pyx_v_nmax), (&__pyx_v_flag))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 109, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":110
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscInt))
 *     CHKERR(PetscOptionsGetIntArray(opt, pre, name, ivalue, &nmax, &flag))
 *     if flag==PETSC_TRUE: return array_i(nmax, ivalue)             # <<<<<<<<<<<<<<
 *     if deft is not None: return deft
 *     raise KeyError(opt2str(pre, name))
*/
  __pyx_t_1 = (__pyx_v_flag == PETSC_TRUE);
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_nmax, __pyx_v_ivalue)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":111
 *     CHKERR(PetscOptionsGetIntArray(opt, pre, name, ivalue, &nmax, &flag))
 *     if flag==PETSC_TRUE: return array_i(nmax, ivalue)
 *     if deft is not None: return deft             # <<<<<<<<<<<<<<
 *     raise KeyError(opt2str(pre, name))
 * 
*/
  __pyx_t_1 = (__pyx_v_deft != Py_None);
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_deft);
    __pyx_r = __pyx_v_deft;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":112
 *     if flag==PETSC_TRUE: return array_i(nmax, ivalue)
 *     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_2 = NULL;
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_KeyError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 112, __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(11, 112, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":99
 *     raise KeyError(opt2str(pre, name))
 * 
 * cdef getopt_IntArray(PetscOptions opt, const char *pre, const char *name, object deft):             # <<<<<<<<<<<<<<
 *     cdef PetscInt value[1024], *ivalue = value, *ivaluedeft = NULL
 *     cdef PetscInt nmax = 1024, ndeft = 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("petsc4py.PETSc.getopt_IntArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF(__pyx_v_deft);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/petscopt.pxi":114
 *     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;
  PetscReal __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getopt_Real", 0);

  /* "petsc4py/PETSc/petscopt.pxi":115
 * 
 * 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":116
 * 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":117
 *     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 toReal(asReal(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(11, 117, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":118
 *     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 toReal(asReal(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(11, 118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":119
 *     CHKERR(PetscOptionsGetReal(opt, pre, name, &value, &flag))
 *     if flag==PETSC_TRUE: return toReal(value)
 *     if deft is not None: return toReal(asReal(deft))             # <<<<<<<<<<<<<<
 *     raise KeyError(opt2str(pre, name))
 * 
*/
  __pyx_t_2 = (__pyx_v_deft != Py_None);
  if (__pyx_t_2) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_deft); if (unlikely(__pyx_t_4 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(11, 119, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":120
 *     if flag==PETSC_TRUE: return toReal(value)
 *     if deft is not None: return toReal(asReal(deft))
 *     raise KeyError(opt2str(pre, name))             # <<<<<<<<<<<<<<
 * 
 * cdef getopt_RealArray(PetscOptions opt, const char *pre, const char *name, object deft):
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_KeyError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 120, __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(11, 120, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":114
 *     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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":122
 *     raise KeyError(opt2str(pre, name))
 * 
 * cdef getopt_RealArray(PetscOptions opt, const char *pre, const char *name, object deft):             # <<<<<<<<<<<<<<
 *     cdef PetscReal value[1024], *ivalue = value, *ivaluedeft = NULL
 *     cdef PetscInt nmax = 1024, ndeft = 0
*/

static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_RealArray(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) {
  PetscReal __pyx_v_value[1024];
  PetscReal *__pyx_v_ivalue;
  PetscReal *__pyx_v_ivaluedeft;
  PetscInt __pyx_v_nmax;
  PetscInt __pyx_v_ndeft;
  PetscBool __pyx_v_flag;
  CYTHON_UNUSED PyObject *__pyx_v_unused = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PetscErrorCode __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getopt_RealArray", 0);
  __Pyx_INCREF(__pyx_v_deft);

  /* "petsc4py/PETSc/petscopt.pxi":123
 * 
 * cdef getopt_RealArray(PetscOptions opt, const char *pre, const char *name, object deft):
 *     cdef PetscReal value[1024], *ivalue = value, *ivaluedeft = NULL             # <<<<<<<<<<<<<<
 *     cdef PetscInt nmax = 1024, ndeft = 0
 *     cdef PetscBool flag = PETSC_FALSE
*/
  __pyx_v_ivalue = __pyx_v_value;
  __pyx_v_ivaluedeft = NULL;

  /* "petsc4py/PETSc/petscopt.pxi":124
 * cdef getopt_RealArray(PetscOptions opt, const char *pre, const char *name, object deft):
 *     cdef PetscReal value[1024], *ivalue = value, *ivaluedeft = NULL
 *     cdef PetscInt nmax = 1024, ndeft = 0             # <<<<<<<<<<<<<<
 *     cdef PetscBool flag = PETSC_FALSE
 *     cdef object unused
*/
  __pyx_v_nmax = 0x400;
  __pyx_v_ndeft = 0;

  /* "petsc4py/PETSc/petscopt.pxi":125
 *     cdef PetscReal value[1024], *ivalue = value, *ivaluedeft = NULL
 *     cdef PetscInt nmax = 1024, ndeft = 0
 *     cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *     cdef object unused
 *     if deft is not None:
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/petscopt.pxi":127
 *     cdef PetscBool flag = PETSC_FALSE
 *     cdef object unused
 *     if deft is not None:             # <<<<<<<<<<<<<<
 *         deft = iarray_r(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:
*/
  __pyx_t_1 = (__pyx_v_deft != Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscopt.pxi":128
 *     cdef object unused
 *     if deft is not None:
 *         deft = iarray_r(deft, &ndeft, &ivaluedeft)             # <<<<<<<<<<<<<<
 *         if ndeft > nmax:
 *             unused = oarray_r(empty_r(ndeft), &nmax, &ivalue)
*/
    __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_r(__pyx_v_deft, (&__pyx_v_ndeft), (&__pyx_v_ivaluedeft))); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_deft, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscopt.pxi":129
 *     if deft is not None:
 *         deft = iarray_r(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:             # <<<<<<<<<<<<<<
 *             unused = oarray_r(empty_r(ndeft), &nmax, &ivalue)
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscReal))
*/
    __pyx_t_1 = (__pyx_v_ndeft > __pyx_v_nmax);
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/petscopt.pxi":130
 *         deft = iarray_r(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:
 *             unused = oarray_r(empty_r(ndeft), &nmax, &ivalue)             # <<<<<<<<<<<<<<
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscReal))
 *     CHKERR(PetscOptionsGetRealArray(opt, pre, name, ivalue, &nmax, &flag))
*/
      __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_r(__pyx_v_ndeft)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 130, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_t_2, (&__pyx_v_nmax), (&__pyx_v_ivalue))); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 130, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_unused = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "petsc4py/PETSc/petscopt.pxi":129
 *     if deft is not None:
 *         deft = iarray_r(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:             # <<<<<<<<<<<<<<
 *             unused = oarray_r(empty_r(ndeft), &nmax, &ivalue)
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscReal))
*/
    }

    /* "petsc4py/PETSc/petscopt.pxi":131
 *         if ndeft > nmax:
 *             unused = oarray_r(empty_r(ndeft), &nmax, &ivalue)
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscReal))             # <<<<<<<<<<<<<<
 *     CHKERR(PetscOptionsGetRealArray(opt, pre, name, ivalue, &nmax, &flag))
 *     if flag==PETSC_TRUE: return array_r(nmax, ivalue)
*/
    (void)(memcpy(__pyx_v_ivalue, __pyx_v_ivaluedeft, (((size_t)__pyx_v_ndeft) * (sizeof(PetscReal)))));

    /* "petsc4py/PETSc/petscopt.pxi":127
 *     cdef PetscBool flag = PETSC_FALSE
 *     cdef object unused
 *     if deft is not None:             # <<<<<<<<<<<<<<
 *         deft = iarray_r(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:
*/
  }

  /* "petsc4py/PETSc/petscopt.pxi":132
 *             unused = oarray_r(empty_r(ndeft), &nmax, &ivalue)
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscReal))
 *     CHKERR(PetscOptionsGetRealArray(opt, pre, name, ivalue, &nmax, &flag))             # <<<<<<<<<<<<<<
 *     if flag==PETSC_TRUE: return array_r(nmax, ivalue)
 *     if deft is not None: return deft
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetRealArray(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, __pyx_v_ivalue, (&__pyx_v_nmax), (&__pyx_v_flag))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 132, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":133
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscReal))
 *     CHKERR(PetscOptionsGetRealArray(opt, pre, name, ivalue, &nmax, &flag))
 *     if flag==PETSC_TRUE: return array_r(nmax, ivalue)             # <<<<<<<<<<<<<<
 *     if deft is not None: return deft
 *     raise KeyError(opt2str(pre, name))
*/
  __pyx_t_1 = (__pyx_v_flag == PETSC_TRUE);
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_r(__pyx_v_nmax, __pyx_v_ivalue)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":134
 *     CHKERR(PetscOptionsGetRealArray(opt, pre, name, ivalue, &nmax, &flag))
 *     if flag==PETSC_TRUE: return array_r(nmax, ivalue)
 *     if deft is not None: return deft             # <<<<<<<<<<<<<<
 *     raise KeyError(opt2str(pre, name))
 * 
*/
  __pyx_t_1 = (__pyx_v_deft != Py_None);
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_deft);
    __pyx_r = __pyx_v_deft;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":135
 *     if flag==PETSC_TRUE: return array_r(nmax, ivalue)
 *     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_2 = NULL;
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_KeyError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 135, __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(11, 135, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":122
 *     raise KeyError(opt2str(pre, name))
 * 
 * cdef getopt_RealArray(PetscOptions opt, const char *pre, const char *name, object deft):             # <<<<<<<<<<<<<<
 *     cdef PetscReal value[1024], *ivalue = value, *ivaluedeft = NULL
 *     cdef PetscInt nmax = 1024, ndeft = 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("petsc4py.PETSc.getopt_RealArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF(__pyx_v_deft);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/petscopt.pxi":137
 *     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;
  PetscScalar __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getopt_Scalar", 0);

  /* "petsc4py/PETSc/petscopt.pxi":138
 * 
 * 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":139
 * 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":140
 *     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 toScalar(asScalar(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(11, 140, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":141
 *     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 toScalar(asScalar(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(11, 141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":142
 *     CHKERR(PetscOptionsGetScalar(opt, pre, name, &value, &flag))
 *     if flag==PETSC_TRUE: return toScalar(value)
 *     if deft is not None: return toScalar(asScalar(deft))             # <<<<<<<<<<<<<<
 *     raise KeyError(opt2str(pre, name))
 * 
*/
  __pyx_t_2 = (__pyx_v_deft != Py_None);
  if (__pyx_t_2) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_deft); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_4, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(11, 142, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":143
 *     if flag==PETSC_TRUE: return toScalar(value)
 *     if deft is not None: return toScalar(asScalar(deft))
 *     raise KeyError(opt2str(pre, name))             # <<<<<<<<<<<<<<
 * 
 * cdef getopt_ScalarArray(PetscOptions opt, const char *pre, const char *name, object deft):
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(11, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_KeyError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 143, __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(11, 143, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":137
 *     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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":145
 *     raise KeyError(opt2str(pre, name))
 * 
 * cdef getopt_ScalarArray(PetscOptions opt, const char *pre, const char *name, object deft):             # <<<<<<<<<<<<<<
 *     cdef PetscScalar value[1024], *ivalue = value, *ivaluedeft = NULL
 *     cdef PetscInt nmax = 1024, ndeft = 0
*/

static PyObject *__pyx_f_8petsc4py_5PETSc_getopt_ScalarArray(PetscOptions __pyx_v_opt, char const *__pyx_v_pre, char const *__pyx_v_name, PyObject *__pyx_v_deft) {
  PetscScalar __pyx_v_value[1024];
  PetscScalar *__pyx_v_ivalue;
  PetscScalar *__pyx_v_ivaluedeft;
  PetscInt __pyx_v_nmax;
  PetscInt __pyx_v_ndeft;
  PetscBool __pyx_v_flag;
  CYTHON_UNUSED PyObject *__pyx_v_unused = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PetscErrorCode __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getopt_ScalarArray", 0);
  __Pyx_INCREF(__pyx_v_deft);

  /* "petsc4py/PETSc/petscopt.pxi":146
 * 
 * cdef getopt_ScalarArray(PetscOptions opt, const char *pre, const char *name, object deft):
 *     cdef PetscScalar value[1024], *ivalue = value, *ivaluedeft = NULL             # <<<<<<<<<<<<<<
 *     cdef PetscInt nmax = 1024, ndeft = 0
 *     cdef PetscBool flag = PETSC_FALSE
*/
  __pyx_v_ivalue = __pyx_v_value;
  __pyx_v_ivaluedeft = NULL;

  /* "petsc4py/PETSc/petscopt.pxi":147
 * cdef getopt_ScalarArray(PetscOptions opt, const char *pre, const char *name, object deft):
 *     cdef PetscScalar value[1024], *ivalue = value, *ivaluedeft = NULL
 *     cdef PetscInt nmax = 1024, ndeft = 0             # <<<<<<<<<<<<<<
 *     cdef PetscBool flag = PETSC_FALSE
 *     cdef object unused
*/
  __pyx_v_nmax = 0x400;
  __pyx_v_ndeft = 0;

  /* "petsc4py/PETSc/petscopt.pxi":148
 *     cdef PetscScalar value[1024], *ivalue = value, *ivaluedeft = NULL
 *     cdef PetscInt nmax = 1024, ndeft = 0
 *     cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *     cdef object unused
 *     if deft is not None:
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/petscopt.pxi":150
 *     cdef PetscBool flag = PETSC_FALSE
 *     cdef object unused
 *     if deft is not None:             # <<<<<<<<<<<<<<
 *         deft = iarray_s(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:
*/
  __pyx_t_1 = (__pyx_v_deft != Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscopt.pxi":151
 *     cdef object unused
 *     if deft is not None:
 *         deft = iarray_s(deft, &ndeft, &ivaluedeft)             # <<<<<<<<<<<<<<
 *         if ndeft > nmax:
 *             unused = oarray_s(empty_s(ndeft), &nmax, &ivalue)
*/
    __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_deft, (&__pyx_v_ndeft), (&__pyx_v_ivaluedeft))); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_deft, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscopt.pxi":152
 *     if deft is not None:
 *         deft = iarray_s(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:             # <<<<<<<<<<<<<<
 *             unused = oarray_s(empty_s(ndeft), &nmax, &ivalue)
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscScalar))
*/
    __pyx_t_1 = (__pyx_v_ndeft > __pyx_v_nmax);
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/petscopt.pxi":153
 *         deft = iarray_s(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:
 *             unused = oarray_s(empty_s(ndeft), &nmax, &ivalue)             # <<<<<<<<<<<<<<
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscScalar))
 *     CHKERR(PetscOptionsGetScalarArray(opt, pre, name, ivalue, &nmax, &flag))
*/
      __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_s(__pyx_v_ndeft)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_t_2, (&__pyx_v_nmax), (&__pyx_v_ivalue))); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_unused = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "petsc4py/PETSc/petscopt.pxi":152
 *     if deft is not None:
 *         deft = iarray_s(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:             # <<<<<<<<<<<<<<
 *             unused = oarray_s(empty_s(ndeft), &nmax, &ivalue)
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscScalar))
*/
    }

    /* "petsc4py/PETSc/petscopt.pxi":154
 *         if ndeft > nmax:
 *             unused = oarray_s(empty_s(ndeft), &nmax, &ivalue)
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscScalar))             # <<<<<<<<<<<<<<
 *     CHKERR(PetscOptionsGetScalarArray(opt, pre, name, ivalue, &nmax, &flag))
 *     if flag==PETSC_TRUE: return array_s(nmax, ivalue)
*/
    (void)(memcpy(__pyx_v_ivalue, __pyx_v_ivaluedeft, (((size_t)__pyx_v_ndeft) * (sizeof(PetscScalar)))));

    /* "petsc4py/PETSc/petscopt.pxi":150
 *     cdef PetscBool flag = PETSC_FALSE
 *     cdef object unused
 *     if deft is not None:             # <<<<<<<<<<<<<<
 *         deft = iarray_s(deft, &ndeft, &ivaluedeft)
 *         if ndeft > nmax:
*/
  }

  /* "petsc4py/PETSc/petscopt.pxi":155
 *             unused = oarray_s(empty_s(ndeft), &nmax, &ivalue)
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscScalar))
 *     CHKERR(PetscOptionsGetScalarArray(opt, pre, name, ivalue, &nmax, &flag))             # <<<<<<<<<<<<<<
 *     if flag==PETSC_TRUE: return array_s(nmax, ivalue)
 *     if deft is not None: return deft
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetScalarArray(__pyx_v_opt, __pyx_v_pre, __pyx_v_name, __pyx_v_ivalue, (&__pyx_v_nmax), (&__pyx_v_flag))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 155, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":156
 *         memcpy(ivalue, ivaluedeft, <size_t>ndeft*sizeof(PetscScalar))
 *     CHKERR(PetscOptionsGetScalarArray(opt, pre, name, ivalue, &nmax, &flag))
 *     if flag==PETSC_TRUE: return array_s(nmax, ivalue)             # <<<<<<<<<<<<<<
 *     if deft is not None: return deft
 *     raise KeyError(opt2str(pre, name))
*/
  __pyx_t_1 = (__pyx_v_flag == PETSC_TRUE);
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_s(__pyx_v_nmax, __pyx_v_ivalue)); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":157
 *     CHKERR(PetscOptionsGetScalarArray(opt, pre, name, ivalue, &nmax, &flag))
 *     if flag==PETSC_TRUE: return array_s(nmax, ivalue)
 *     if deft is not None: return deft             # <<<<<<<<<<<<<<
 *     raise KeyError(opt2str(pre, name))
 * 
*/
  __pyx_t_1 = (__pyx_v_deft != Py_None);
  if (__pyx_t_1) {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_deft);
    __pyx_r = __pyx_v_deft;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":158
 *     if flag==PETSC_TRUE: return array_s(nmax, ivalue)
 *     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_2 = NULL;
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_KeyError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 158, __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(11, 158, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":145
 *     raise KeyError(opt2str(pre, name))
 * 
 * cdef getopt_ScalarArray(PetscOptions opt, const char *pre, const char *name, object deft):             # <<<<<<<<<<<<<<
 *     cdef PetscScalar value[1024], *ivalue = value, *ivaluedeft = NULL
 *     cdef PetscInt nmax = 1024, ndeft = 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("petsc4py.PETSc.getopt_ScalarArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF(__pyx_v_deft);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/petscopt.pxi":160
 *     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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getopt_String", 0);

  /* "petsc4py/PETSc/petscopt.pxi":162
 * 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":163
 *     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 str(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(11, 163, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":164
 *     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 str(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(11, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":165
 *     CHKERR(PetscOptionsGetString(opt, pre, name, value, 1024, &flag))
 *     if flag==PETSC_TRUE: return bytes2str(value)
 *     if deft is not None: return str(deft)             # <<<<<<<<<<<<<<
 *     raise KeyError(opt2str(pre, name))
 * 
*/
  __pyx_t_2 = (__pyx_v_deft != Py_None);
  if (__pyx_t_2) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_v_deft); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":166
 *     if flag==PETSC_TRUE: return bytes2str(value)
 *     if deft is not None: return str(deft)
 *     raise KeyError(opt2str(pre, name))             # <<<<<<<<<<<<<<
 * 
 * cdef enum PetscOptType:
*/
  __pyx_t_4 = NULL;
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_opt2str(__pyx_v_pre, __pyx_v_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(11, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_KeyError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 166, __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(11, 166, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":160
 *     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_XDECREF(__pyx_t_5);
  __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":179
 *     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":181
 * 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":182
 *     # --
 *     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(11, 182, __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":183
 *     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":184
 *     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":183
 *     cdef const char *p = NULL
 *     prefix = str2bytes(prefix, &p)
 *     if p != NULL and p[0] == c'-':             # <<<<<<<<<<<<<<
 *         p = &p[1]
 *     # --
*/
  }

  /* "petsc4py/PETSc/petscopt.pxi":186
 *         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":187
 *     # --
 *     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(11, 187, __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":188
 *     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":189
 *     name = str2bytes(name, &n)
 *     if n != NULL and n[0] != c'-':
 *         name = b'-' + name             # <<<<<<<<<<<<<<
 *         name = str2bytes(name, &n)
 *     # --
*/
    __pyx_t_1 = PyNumber_Add(__pyx_mstate_global->__pyx_kp_b__13, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 189, __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":190
 *     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(11, 190, __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":188
 *     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":192
 *         name = str2bytes(name, &n)
 *     # --
 *     pr[0] = p             # <<<<<<<<<<<<<<
 *     nm[0] = n
 *     return (prefix, name)
*/
  (__pyx_v_pr[0]) = __pyx_v_p;

  /* "petsc4py/PETSc/petscopt.pxi":193
 *     # --
 *     pr[0] = p
 *     nm[0] = n             # <<<<<<<<<<<<<<
 *     return (prefix, name)
 * 
*/
  (__pyx_v_nm[0]) = __pyx_v_n;

  /* "petsc4py/PETSc/petscopt.pxi":194
 *     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(11, 194, __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) != (0)) __PYX_ERR(11, 194, __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) != (0)) __PYX_ERR(11, 194, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscopt.pxi":179
 *     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":196
 *     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_unused = 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("getopt", 0);

  /* "petsc4py/PETSc/petscopt.pxi":197
 * 
 * cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft):
 *     cdef const char *pr = NULL             # <<<<<<<<<<<<<<
 *     cdef const char *nm = NULL
 *     cdef object unused = getpair(prefix, name, &pr, &nm)
*/
  __pyx_v_pr = NULL;

  /* "petsc4py/PETSc/petscopt.pxi":198
 * cdef getopt(PetscOptions opt, PetscOptType otype, prefix, name, deft):
 *     cdef const char *pr = NULL
 *     cdef const char *nm = NULL             # <<<<<<<<<<<<<<
 *     cdef object unused = getpair(prefix, name, &pr, &nm)
 *     if otype == OPT_BOOL        : return getopt_Bool        (opt, pr, nm, deft)
*/
  __pyx_v_nm = NULL;

  /* "petsc4py/PETSc/petscopt.pxi":199
 *     cdef const char *pr = NULL
 *     cdef const char *nm = NULL
 *     cdef object unused = getpair(prefix, name, &pr, &nm)             # <<<<<<<<<<<<<<
 *     if otype == OPT_BOOL        : return getopt_Bool        (opt, pr, nm, deft)
 *     if otype == OPT_BOOLARRAY   : return getopt_BoolArray   (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(11, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_unused = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscopt.pxi":200
 *     cdef const char *nm = NULL
 *     cdef object unused = getpair(prefix, name, &pr, &nm)
 *     if otype == OPT_BOOL        : return getopt_Bool        (opt, pr, nm, deft)             # <<<<<<<<<<<<<<
 *     if otype == OPT_BOOLARRAY   : return getopt_BoolArray   (opt, pr, nm, deft)
 *     if otype == OPT_INT         : return getopt_Int         (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(11, 200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":201
 *     cdef object unused = getpair(prefix, name, &pr, &nm)
 *     if otype == OPT_BOOL        : return getopt_Bool        (opt, pr, nm, deft)
 *     if otype == OPT_BOOLARRAY   : return getopt_BoolArray   (opt, pr, nm, deft)             # <<<<<<<<<<<<<<
 *     if otype == OPT_INT         : return getopt_Int         (opt, pr, nm, deft)
 *     if otype == OPT_INTARRAY    : return getopt_IntArray    (opt, pr, nm, deft)
*/
  __pyx_t_2 = (__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_BOOLARRAY);
  if (__pyx_t_2) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_BoolArray(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":202
 *     if otype == OPT_BOOL        : return getopt_Bool        (opt, pr, nm, deft)
 *     if otype == OPT_BOOLARRAY   : return getopt_BoolArray   (opt, pr, nm, deft)
 *     if otype == OPT_INT         : return getopt_Int         (opt, pr, nm, deft)             # <<<<<<<<<<<<<<
 *     if otype == OPT_INTARRAY    : return getopt_IntArray    (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_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(11, 202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":203
 *     if otype == OPT_BOOLARRAY   : return getopt_BoolArray   (opt, pr, nm, deft)
 *     if otype == OPT_INT         : return getopt_Int         (opt, pr, nm, deft)
 *     if otype == OPT_INTARRAY    : return getopt_IntArray    (opt, pr, nm, deft)             # <<<<<<<<<<<<<<
 *     if otype == OPT_REAL        : return getopt_Real        (opt, pr, nm, deft)
 *     if otype == OPT_REALARRAY   : return getopt_RealArray   (opt, pr, nm, deft)
*/
  __pyx_t_2 = (__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_INTARRAY);
  if (__pyx_t_2) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_IntArray(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 203, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":204
 *     if otype == OPT_INT         : return getopt_Int         (opt, pr, nm, deft)
 *     if otype == OPT_INTARRAY    : return getopt_IntArray    (opt, pr, nm, deft)
 *     if otype == OPT_REAL        : return getopt_Real        (opt, pr, nm, deft)             # <<<<<<<<<<<<<<
 *     if otype == OPT_REALARRAY   : return getopt_RealArray   (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_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(11, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":205
 *     if otype == OPT_INTARRAY    : return getopt_IntArray    (opt, pr, nm, deft)
 *     if otype == OPT_REAL        : return getopt_Real        (opt, pr, nm, deft)
 *     if otype == OPT_REALARRAY   : return getopt_RealArray   (opt, pr, nm, deft)             # <<<<<<<<<<<<<<
 *     if otype == OPT_SCALAR      : return getopt_Scalar      (opt, pr, nm, deft)
 *     if otype == OPT_SCALARARRAY : return getopt_ScalarArray (opt, pr, nm, deft)
*/
  __pyx_t_2 = (__pyx_v_otype == __pyx_e_8petsc4py_5PETSc_OPT_REALARRAY);
  if (__pyx_t_2) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_RealArray(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":206
 *     if otype == OPT_REAL        : return getopt_Real        (opt, pr, nm, deft)
 *     if otype == OPT_REALARRAY   : return getopt_RealArray   (opt, pr, nm, deft)
 *     if otype == OPT_SCALAR      : return getopt_Scalar      (opt, pr, nm, deft)             # <<<<<<<<<<<<<<
 *     if otype == OPT_SCALARARRAY : return getopt_ScalarArray (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(11, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":207
 *     if otype == OPT_REALARRAY   : return getopt_RealArray   (opt, pr, nm, deft)
 *     if otype == OPT_SCALAR      : return getopt_Scalar      (opt, pr, nm, deft)
 *     if otype == OPT_SCALARARRAY : return getopt_ScalarArray (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_SCALARARRAY);
  if (__pyx_t_2) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getopt_ScalarArray(__pyx_v_opt, __pyx_v_pr, __pyx_v_nm, __pyx_v_deft); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":208
 *     if otype == OPT_SCALAR      : return getopt_Scalar      (opt, pr, nm, deft)
 *     if otype == OPT_SCALARARRAY : return getopt_ScalarArray (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(11, 208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscopt.pxi":196
 *     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_unused);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/petscopt.pxi":213
 * # 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":214
 * 
 * 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":215
 * 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":216
 *     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":217
 *     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(11, 217, __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":218
 *     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(11, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tokens = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscopt.pxi":219
 *     options = str2bytes(options, &s)
 *     cdef list tokens = []
 *     CHKERR(PetscTokenCreate(s, c' ', &t))             # <<<<<<<<<<<<<<
 *     try:
 *         CHKERR(PetscTokenFind(t, <const char**>&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(11, 219, __pyx_L1_error)

  /* "petsc4py/PETSc/petscopt.pxi":220
 *     cdef list tokens = []
 *     CHKERR(PetscTokenCreate(s, c' ', &t))
 *     try:             # <<<<<<<<<<<<<<
 *         CHKERR(PetscTokenFind(t, <const char**>&p))
 *         while p != NULL:
*/
  /*try:*/ {

    /* "petsc4py/PETSc/petscopt.pxi":221
 *     CHKERR(PetscTokenCreate(s, c' ', &t))
 *     try:
 *         CHKERR(PetscTokenFind(t, <const char**>&p))             # <<<<<<<<<<<<<<
 *         while p != NULL:
 *             tokens.append(bytes2str(p))
*/
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTokenFind(__pyx_v_t, ((char const **)(&__pyx_v_p)))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 221, __pyx_L4_error)

    /* "petsc4py/PETSc/petscopt.pxi":222
 *     try:
 *         CHKERR(PetscTokenFind(t, <const char**>&p))
 *         while p != NULL:             # <<<<<<<<<<<<<<
 *             tokens.append(bytes2str(p))
 *             CHKERR(PetscTokenFind(t, <const char**>&p))
*/
    while (1) {
      __pyx_t_3 = (__pyx_v_p != NULL);
      if (!__pyx_t_3) break;

      /* "petsc4py/PETSc/petscopt.pxi":223
 *         CHKERR(PetscTokenFind(t, <const char**>&p))
 *         while p != NULL:
 *             tokens.append(bytes2str(p))             # <<<<<<<<<<<<<<
 *             CHKERR(PetscTokenFind(t, <const char**>&p))
 *     finally:
*/
      __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_p); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 223, __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(11, 223, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "petsc4py/PETSc/petscopt.pxi":224
 *         while p != NULL:
 *             tokens.append(bytes2str(p))
 *             CHKERR(PetscTokenFind(t, <const char**>&p))             # <<<<<<<<<<<<<<
 *     finally:
 *         CHKERR(PetscTokenDestroy(&t))
*/
      __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscTokenFind(__pyx_v_t, ((char const **)(&__pyx_v_p)))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(11, 224, __pyx_L4_error)
    }
  }

  /* "petsc4py/PETSc/petscopt.pxi":226
 *             CHKERR(PetscTokenFind(t, <const char**>&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(11, 226, __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;
       __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if ( 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(11, 226, __pyx_L9_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);
      __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:;
      __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":227
 *     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":213
 * # 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":229
 *     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":230
 * 
 * cdef bint iskey(key):
 *     cdef const char *k = NULL             # <<<<<<<<<<<<<<
 *     cdef PetscBool b = PETSC_FALSE
 *     if key:
*/
  __pyx_v_k = NULL;

  /* "petsc4py/PETSc/petscopt.pxi":231
 * 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":232
 *     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(11, 232, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscopt.pxi":233
 *     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(11, 233, __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":234
 *     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(11, 234, __pyx_L1_error)

    /* "petsc4py/PETSc/petscopt.pxi":235
 *         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":236
 *         CHKERR(PetscOptionsValidKey(k, &b))
 *         if b == PETSC_TRUE:
 *             return True             # <<<<<<<<<<<<<<
 *     return False
 * 
*/
      __pyx_r = 1;
      goto __pyx_L0;

      /* "petsc4py/PETSc/petscopt.pxi":235
 *         key = str2bytes(key, &k)
 *         CHKERR(PetscOptionsValidKey(k, &b))
 *         if b == PETSC_TRUE:             # <<<<<<<<<<<<<<
 *             return True
 *     return False
*/
    }

    /* "petsc4py/PETSc/petscopt.pxi":232
 *     cdef const char *k = NULL
 *     cdef PetscBool b = PETSC_FALSE
 *     if key:             # <<<<<<<<<<<<<<
 *         key = str2bytes(key, &k)
 *         CHKERR(PetscOptionsValidKey(k, &b))
*/
  }

  /* "petsc4py/PETSc/petscopt.pxi":237
 *         if b == PETSC_TRUE:
 *             return True
 *     return False             # <<<<<<<<<<<<<<
 * 
 * cdef gettok(tokens):
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscopt.pxi":229
 *     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":239
 *     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", 0);

  /* "petsc4py/PETSc/petscopt.pxi":240
 * 
 * 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(11, 240, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscopt.pxi":241
 * 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_mstate_global->__pyx_int_0, 0, 1, Py_ssize_t, PyLong_FromSsize_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "petsc4py/PETSc/petscopt.pxi":240
 * 
 * cdef gettok(tokens):
 *     if tokens:             # <<<<<<<<<<<<<<
 *         return tokens.pop(0)
 *     else:
*/
  }

  /* "petsc4py/PETSc/petscopt.pxi":243
 *         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":239
 *     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":245
 *         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;
  size_t __pyx_t_5;
  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":246
 * 
 * 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(11, 246, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/petscopt.pxi":247
 * 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":246
 * 
 * cdef getkey(key, prefix):
 *     if not iskey(key):             # <<<<<<<<<<<<<<
 *         return None
 *     key = key[1:]
*/
  }

  /* "petsc4py/PETSc/petscopt.pxi":248
 *     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_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 248, __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":249
 *         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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u__13, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(11, 249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/petscopt.pxi":250
 *     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_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 250, __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":249
 *         return None
 *     key = key[1:]
 *     if key[0] == '-':             # <<<<<<<<<<<<<<
 *         key = key[1:]
 *     if not key.startswith(prefix):
*/
  }

  /* "petsc4py/PETSc/petscopt.pxi":251
 *     if key[0] == '-':
 *         key = key[1:]
 *     if not key.startswith(prefix):             # <<<<<<<<<<<<<<
 *         return None
 *     return key.replace(prefix, '', 1)
*/
  __pyx_t_4 = __pyx_v_key;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_prefix};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_startswith, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(11, 251, __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":252
 *         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":251
 *     if key[0] == '-':
 *         key = key[1:]
 *     if not key.startswith(prefix):             # <<<<<<<<<<<<<<
 *         return None
 *     return key.replace(prefix, '', 1)
*/
  }

  /* "petsc4py/PETSc/petscopt.pxi":253
 *     if not key.startswith(prefix):
 *         return None
 *     return key.replace(prefix, '', 1)             # <<<<<<<<<<<<<<
 * 
 * cdef parseopt(options, prefix):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_v_key;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_v_prefix, __pyx_mstate_global->__pyx_kp_u__7, __pyx_mstate_global->__pyx_int_1};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_replace, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(11, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscopt.pxi":245
 *         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_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":255
 *     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":256
 * 
 * cdef parseopt(options, prefix):
 *     if isinstance(options, str):             # <<<<<<<<<<<<<<
 *         tokens = tokenize(options)
 *     else:
*/
  __pyx_t_1 = PyUnicode_Check(__pyx_v_options); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscopt.pxi":257
 * 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(11, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_tokens = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscopt.pxi":256
 * 
 * cdef parseopt(options, prefix):
 *     if isinstance(options, str):             # <<<<<<<<<<<<<<
 *         tokens = tokenize(options)
 *     else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/petscopt.pxi":259
 *         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(11, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_tokens = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/petscopt.pxi":260
 *     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(11, 260, __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_mstate_global->__pyx_kp_u__7);
  __pyx_t_2 = __pyx_mstate_global->__pyx_kp_u__7;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscopt.pxi":262
 *     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(11, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_opts = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscopt.pxi":263
 *     # 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(11, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_first = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscopt.pxi":264
 *     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(11, 264, __pyx_L1_error)
    if (!__pyx_t_1) break;

    /* "petsc4py/PETSc/petscopt.pxi":265
 *     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(11, 265, __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":266
 *     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(11, 266, __pyx_L1_error)
    __pyx_t_3 = (!__pyx_t_1);
    if (__pyx_t_3) {

      /* "petsc4py/PETSc/petscopt.pxi":267
 *         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(11, 267, __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":266
 *     while first:
 *         key = getkey(first, prefix)
 *         if not key:             # <<<<<<<<<<<<<<
 *             first = gettok(tokens)
 *         else:
*/
      goto __pyx_L8;
    }

    /* "petsc4py/PETSc/petscopt.pxi":269
 *             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(11, 269, __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":270
 *         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(11, 270, __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(11, 270, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_3) {

        /* "petsc4py/PETSc/petscopt.pxi":271
 *             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":272
 *             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":270
 *         else:
 *             second = gettok(tokens)
 *             if getkey(second, prefix):             # <<<<<<<<<<<<<<
 *                 value = None
 *                 first = second
*/
        goto __pyx_L9;
      }

      /* "petsc4py/PETSc/petscopt.pxi":274
 *                 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":275
 *             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(11, 275, __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":276
 *                 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(11, 276, __pyx_L1_error)
    }
    __pyx_L8:;
  }

  /* "petsc4py/PETSc/petscopt.pxi":278
 *             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":255
 *     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;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  void *__pyx_t_5;
  int __pyx_t_6;
  MPI_Comm *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mpi4py_Comm_Get", 0);

  /* "petsc4py/PETSc/petscmpi.pxi":47
 *     object comm,
 * ) except? MPI_COMM_NULL:
 *     from mpi4py import MPI             # <<<<<<<<<<<<<<
 *     cdef PyMPICommGet *commget = \
 *         <PyMPICommGet*> Cython_ImportFunction(MPI, b"PyMPIComm_Get", b"MPI_Comm *(PyObject *)")
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_MPI};
    __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_mpi4py, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 47, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_t_2;
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_MPI};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_1, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 47, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      switch (__pyx_t_3) {
        case 0:
        __Pyx_INCREF(__pyx_t_4);
        __pyx_v_MPI = __pyx_t_4;
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscmpi.pxi":49
 *     from mpi4py import MPI
 *     cdef PyMPICommGet *commget = \
 *         <PyMPICommGet*> Cython_ImportFunction(MPI, b"PyMPIComm_Get", b"MPI_Comm *(PyObject *)")             # <<<<<<<<<<<<<<
 *     if commget == NULL: return MPI_COMM_NULL
 *     cdef MPI_Comm *ptr = commget(comm)
*/
  __pyx_t_5 = Cython_ImportFunction(__pyx_v_MPI, ((char *)"PyMPIComm_Get"), ((char *)"MPI_Comm *(PyObject *)")); if (unlikely(__pyx_t_5 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(12, 49, __pyx_L1_error)
  __pyx_v_commget = ((__pyx_t_8petsc4py_5PETSc_PyMPICommGet *)__pyx_t_5);

  /* "petsc4py/PETSc/petscmpi.pxi":50
 *     cdef PyMPICommGet *commget = \
 *         <PyMPICommGet*> 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_6 = (__pyx_v_commget == NULL);
  if (__pyx_t_6) {
    __pyx_r = MPI_COMM_NULL;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscmpi.pxi":51
 *         <PyMPICommGet*> 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
 *     return ptr[0]
*/
  __pyx_t_7 = __pyx_v_commget(__pyx_v_comm); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(12, 51, __pyx_L1_error)
  __pyx_v_ptr = __pyx_t_7;

  /* "petsc4py/PETSc/petscmpi.pxi":52
 *     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_6 = (__pyx_v_ptr == NULL);
  if (__pyx_t_6) {
    __pyx_r = MPI_COMM_NULL;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscmpi.pxi":53
 *     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_4);
  __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":55
 *     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;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  void *__pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mpi4py_Comm_New", 0);

  /* "petsc4py/PETSc/petscmpi.pxi":56
 * 
 * cdef inline object mpi4py_Comm_New(MPI_Comm comm):
 *     from mpi4py import MPI             # <<<<<<<<<<<<<<
 *     cdef PyMPICommNew *commnew = \
 *         <PyMPICommNew*> Cython_ImportFunction(MPI, b"PyMPIComm_New", b"PyObject *(MPI_Comm)")
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_MPI};
    __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_mpi4py, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 56, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_t_2;
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_MPI};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_1, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 56, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      switch (__pyx_t_3) {
        case 0:
        __Pyx_INCREF(__pyx_t_4);
        __pyx_v_MPI = __pyx_t_4;
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscmpi.pxi":58
 *     from mpi4py import MPI
 *     cdef PyMPICommNew *commnew = \
 *         <PyMPICommNew*> Cython_ImportFunction(MPI, b"PyMPIComm_New", b"PyObject *(MPI_Comm)")             # <<<<<<<<<<<<<<
 *     if commnew == NULL: return None
 *     return commnew(comm)
*/
  __pyx_t_5 = Cython_ImportFunction(__pyx_v_MPI, ((char *)"PyMPIComm_New"), ((char *)"PyObject *(MPI_Comm)")); if (unlikely(__pyx_t_5 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(12, 58, __pyx_L1_error)
  __pyx_v_commnew = ((__pyx_t_8petsc4py_5PETSc_PyMPICommNew *)__pyx_t_5);

  /* "petsc4py/PETSc/petscmpi.pxi":59
 *     cdef PyMPICommNew *commnew = \
 *         <PyMPICommNew*> Cython_ImportFunction(MPI, b"PyMPIComm_New", b"PyObject *(MPI_Comm)")
 *     if commnew == NULL: return None             # <<<<<<<<<<<<<<
 *     return commnew(comm)
 * 
*/
  __pyx_t_6 = (__pyx_v_commnew == NULL);
  if (__pyx_t_6) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscmpi.pxi":60
 *         <PyMPICommNew*> Cython_ImportFunction(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_1 = __pyx_v_commnew(__pyx_v_comm); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscmpi.pxi":55
 *     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_4);
  __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":62
 *     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;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  void *__pyx_t_5;
  int __pyx_t_6;
  MPI_Datatype *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mpi4py_Datatype_Get", 0);

  /* "petsc4py/PETSc/petscmpi.pxi":65
 *     object datatype,
 * ) except? MPI_DATATYPE_NULL:
 *     from mpi4py import MPI             # <<<<<<<<<<<<<<
 *     cdef PyMPIDatatypeGet *datatypeget = \
 *         <PyMPIDatatypeGet*> Cython_ImportFunction(MPI, b"PyMPIDatatype_Get", b"MPI_Datatype *(PyObject *)")
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_MPI};
    __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_mpi4py, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 65, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_t_2;
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_MPI};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_1, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 65, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      switch (__pyx_t_3) {
        case 0:
        __Pyx_INCREF(__pyx_t_4);
        __pyx_v_MPI = __pyx_t_4;
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscmpi.pxi":67
 *     from mpi4py import MPI
 *     cdef PyMPIDatatypeGet *datatypeget = \
 *         <PyMPIDatatypeGet*> Cython_ImportFunction(MPI, b"PyMPIDatatype_Get", b"MPI_Datatype *(PyObject *)")             # <<<<<<<<<<<<<<
 *     if datatypeget == NULL: return MPI_DATATYPE_NULL
 *     cdef MPI_Datatype *ptr = datatypeget(datatype)
*/
  __pyx_t_5 = Cython_ImportFunction(__pyx_v_MPI, ((char *)"PyMPIDatatype_Get"), ((char *)"MPI_Datatype *(PyObject *)")); if (unlikely(__pyx_t_5 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(12, 67, __pyx_L1_error)
  __pyx_v_datatypeget = ((__pyx_t_8petsc4py_5PETSc_PyMPIDatatypeGet *)__pyx_t_5);

  /* "petsc4py/PETSc/petscmpi.pxi":68
 *     cdef PyMPIDatatypeGet *datatypeget = \
 *         <PyMPIDatatypeGet*> 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_6 = (__pyx_v_datatypeget == NULL);
  if (__pyx_t_6) {
    __pyx_r = MPI_DATATYPE_NULL;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscmpi.pxi":69
 *         <PyMPIDatatypeGet*> 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
 *     return ptr[0]
*/
  __pyx_t_7 = __pyx_v_datatypeget(__pyx_v_datatype); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(12, 69, __pyx_L1_error)
  __pyx_v_ptr = __pyx_t_7;

  /* "petsc4py/PETSc/petscmpi.pxi":70
 *     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_6 = (__pyx_v_ptr == NULL);
  if (__pyx_t_6) {
    __pyx_r = MPI_DATATYPE_NULL;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscmpi.pxi":71
 *     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":62
 *     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_4);
  __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":73
 *     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;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  void *__pyx_t_5;
  int __pyx_t_6;
  MPI_Op *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mpi4py_Op_Get", 0);

  /* "petsc4py/PETSc/petscmpi.pxi":76
 *     object op,
 * ) except? MPI_OP_NULL:
 *     from mpi4py import MPI             # <<<<<<<<<<<<<<
 *     cdef PyMPIOpGet *opget = \
 *         <PyMPIOpGet*> Cython_ImportFunction(MPI, b"PyMPIOp_Get", b"MPI_Op *(PyObject *)")
*/
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_MPI};
    __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_mpi4py, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 76, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_t_2;
  __Pyx_GOTREF(__pyx_t_1);
  {
    PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_MPI};
    __pyx_t_3 = 0; {
      __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_1, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(12, 76, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      switch (__pyx_t_3) {
        case 0:
        __Pyx_INCREF(__pyx_t_4);
        __pyx_v_MPI = __pyx_t_4;
        break;
        default:;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscmpi.pxi":78
 *     from mpi4py import MPI
 *     cdef PyMPIOpGet *opget = \
 *         <PyMPIOpGet*> Cython_ImportFunction(MPI, b"PyMPIOp_Get", b"MPI_Op *(PyObject *)")             # <<<<<<<<<<<<<<
 *     if opget == NULL: return MPI_OP_NULL
 *     cdef MPI_Op *ptr = opget(op)
*/
  __pyx_t_5 = Cython_ImportFunction(__pyx_v_MPI, ((char *)"PyMPIOp_Get"), ((char *)"MPI_Op *(PyObject *)")); if (unlikely(__pyx_t_5 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(12, 78, __pyx_L1_error)
  __pyx_v_opget = ((__pyx_t_8petsc4py_5PETSc_PyMPIOpGet *)__pyx_t_5);

  /* "petsc4py/PETSc/petscmpi.pxi":79
 *     cdef PyMPIOpGet *opget = \
 *         <PyMPIOpGet*> 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_6 = (__pyx_v_opget == NULL);
  if (__pyx_t_6) {
    __pyx_r = MPI_OP_NULL;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscmpi.pxi":80
 *         <PyMPIOpGet*> 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
 *     return ptr[0]
*/
  __pyx_t_7 = __pyx_v_opget(__pyx_v_op); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(12, 80, __pyx_L1_error)
  __pyx_v_ptr = __pyx_t_7;

  /* "petsc4py/PETSc/petscmpi.pxi":81
 *     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_6 = (__pyx_v_ptr == NULL);
  if (__pyx_t_6) {
    __pyx_r = MPI_OP_NULL;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscmpi.pxi":82
 *     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":73
 *     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_4);
  __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":86
 * # --------------------------------------------------------------------
 * 
 * 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":87
 * 
 * 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":88
 * 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":89
 *     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 (<int>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":90
 *     cdef MPI_Comm tmp = comm[0]
 *     if tmp == MPI_COMM_NULL: return PETSC_SUCCESS
 *     comm[0] = MPI_COMM_NULL             # <<<<<<<<<<<<<<
 *     if not (<int>PetscInitializeCalled): return PETSC_SUCCESS
 *     if (<int>PetscFinalizeCalled): return PETSC_SUCCESS
*/
  (__pyx_v_comm[0]) = MPI_COMM_NULL;

  /* "petsc4py/PETSc/petscmpi.pxi":91
 *     if tmp == MPI_COMM_NULL: return PETSC_SUCCESS
 *     comm[0] = MPI_COMM_NULL
 *     if not (<int>PetscInitializeCalled): return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 *     if (<int>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":92
 *     comm[0] = MPI_COMM_NULL
 *     if not (<int>PetscInitializeCalled): return PETSC_SUCCESS
 *     if (<int>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":93
 *     if not (<int>PetscInitializeCalled): return PETSC_SUCCESS
 *     if (<int>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":86
 * # --------------------------------------------------------------------
 * 
 * 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":95
 *     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", 0);

  /* "petsc4py/PETSc/petscmpi.pxi":98
 *     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":99
 * ) 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":100
 *     cdef MPI_Comm retv = MPI_COMM_NULL
 *     if comm is None:
 *         retv = defv             # <<<<<<<<<<<<<<
 *     elif isinstance(comm, Comm):
 *         retv = (<Comm>comm).comm
*/
    __pyx_v_retv = __pyx_v_defv;

    /* "petsc4py/PETSc/petscmpi.pxi":99
 * ) 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":101
 *     if comm is None:
 *         retv = defv
 *     elif isinstance(comm, Comm):             # <<<<<<<<<<<<<<
 *         retv = (<Comm>comm).comm
 *     elif type(comm).__module__ == 'mpi4py.MPI':
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_comm, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscmpi.pxi":102
 *         retv = defv
 *     elif isinstance(comm, Comm):
 *         retv = (<Comm>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":101
 *     if comm is None:
 *         retv = defv
 *     elif isinstance(comm, Comm):             # <<<<<<<<<<<<<<
 *         retv = (<Comm>comm).comm
 *     elif type(comm).__module__ == 'mpi4py.MPI':
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/petscmpi.pxi":103
 *     elif isinstance(comm, Comm):
 *         retv = (<Comm>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_mstate_global->__pyx_n_u_module); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_mpi4py_MPI, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(12, 103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscmpi.pxi":104
 *         retv = (<Comm>comm).comm
 *     elif type(comm).__module__ == 'mpi4py.MPI':
 *         retv = mpi4py_Comm_Get(comm)             # <<<<<<<<<<<<<<
 *     else:
 *         retv = (<Comm?>comm).comm
*/
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Comm_Get(__pyx_v_comm); if (unlikely(__pyx_t_2 == ((MPI_Comm const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(12, 104, __pyx_L1_error)
    __pyx_v_retv = __pyx_t_2;

    /* "petsc4py/PETSc/petscmpi.pxi":103
 *     elif isinstance(comm, Comm):
 *         retv = (<Comm>comm).comm
 *     elif type(comm).__module__ == 'mpi4py.MPI':             # <<<<<<<<<<<<<<
 *         retv = mpi4py_Comm_Get(comm)
 *     else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/petscmpi.pxi":106
 *         retv = mpi4py_Comm_Get(comm)
 *     else:
 *         retv = (<Comm?>comm).comm             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  /*else*/ {
    if (!(likely(__Pyx_TypeTest(__pyx_v_comm, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm)))) __PYX_ERR(12, 106, __pyx_L1_error)
    __pyx_t_2 = ((struct PyPetscCommObject *)__pyx_v_comm)->comm;
    __pyx_v_retv = __pyx_t_2;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/petscmpi.pxi":107
 *     else:
 *         retv = (<Comm?>comm).comm
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * cdef inline Comm new_Comm(MPI_Comm comm):
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscmpi.pxi":95
 *     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":109
 *     return retv
 * 
 * cdef inline Comm new_Comm(MPI_Comm comm):             # <<<<<<<<<<<<<<
 *     cdef Comm ob = <Comm> 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new_Comm", 0);

  /* "petsc4py/PETSc/petscmpi.pxi":110
 * 
 * cdef inline Comm new_Comm(MPI_Comm comm):
 *     cdef Comm ob = <Comm> Comm()             # <<<<<<<<<<<<<<
 *     ob.comm = comm
 *     return ob
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 110, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_t_2 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ob = ((struct PyPetscCommObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscmpi.pxi":111
 * cdef inline Comm new_Comm(MPI_Comm comm):
 *     cdef Comm ob = <Comm> Comm()
 *     ob.comm = comm             # <<<<<<<<<<<<<<
 *     return ob
 * 
*/
  __pyx_v_ob->comm = __pyx_v_comm;

  /* "petsc4py/PETSc/petscmpi.pxi":112
 *     cdef Comm ob = <Comm> 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":109
 *     return retv
 * 
 * cdef inline Comm new_Comm(MPI_Comm comm):             # <<<<<<<<<<<<<<
 *     cdef Comm ob = <Comm> 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":116
 * # --------------------------------------------------------------------
 * 
 * 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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("comm_size", 0);

  /* "petsc4py/PETSc/petscmpi.pxi":117
 * 
 * cdef inline int comm_size(MPI_Comm comm) except ? -1:
 *     if comm == MPI_COMM_NULL: raise ValueError("null communicator")             # <<<<<<<<<<<<<<
 *     cdef int size = 0
 *     CHKERR(<PetscErrorCode>MPI_Comm_size(comm, &size))
*/
  __pyx_t_1 = (__pyx_v_comm == MPI_COMM_NULL);
  if (unlikely(__pyx_t_1)) {
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_null_communicator};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 117, __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(12, 117, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/petscmpi.pxi":118
 * cdef inline int comm_size(MPI_Comm comm) except ? -1:
 *     if comm == MPI_COMM_NULL: raise ValueError("null communicator")
 *     cdef int size = 0             # <<<<<<<<<<<<<<
 *     CHKERR(<PetscErrorCode>MPI_Comm_size(comm, &size))
 *     return size
*/
  __pyx_v_size = 0;

  /* "petsc4py/PETSc/petscmpi.pxi":119
 *     if comm == MPI_COMM_NULL: raise ValueError("null communicator")
 *     cdef int size = 0
 *     CHKERR(<PetscErrorCode>MPI_Comm_size(comm, &size))             # <<<<<<<<<<<<<<
 *     return size
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(((PetscErrorCode)MPI_Comm_size(__pyx_v_comm, (&__pyx_v_size)))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(12, 119, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmpi.pxi":120
 *     cdef int size = 0
 *     CHKERR(<PetscErrorCode>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":116
 * # --------------------------------------------------------------------
 * 
 * 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_XDECREF(__pyx_t_3);
  __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":122
 *     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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("comm_rank", 0);

  /* "petsc4py/PETSc/petscmpi.pxi":123
 * 
 * cdef inline int comm_rank(MPI_Comm comm) except ? -1:
 *     if comm == MPI_COMM_NULL: raise ValueError("null communicator")             # <<<<<<<<<<<<<<
 *     cdef int rank = 0
 *     CHKERR(<PetscErrorCode>MPI_Comm_rank(comm, &rank))
*/
  __pyx_t_1 = (__pyx_v_comm == MPI_COMM_NULL);
  if (unlikely(__pyx_t_1)) {
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_null_communicator};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 123, __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(12, 123, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/petscmpi.pxi":124
 * cdef inline int comm_rank(MPI_Comm comm) except ? -1:
 *     if comm == MPI_COMM_NULL: raise ValueError("null communicator")
 *     cdef int rank = 0             # <<<<<<<<<<<<<<
 *     CHKERR(<PetscErrorCode>MPI_Comm_rank(comm, &rank))
 *     return rank
*/
  __pyx_v_rank = 0;

  /* "petsc4py/PETSc/petscmpi.pxi":125
 *     if comm == MPI_COMM_NULL: raise ValueError("null communicator")
 *     cdef int rank = 0
 *     CHKERR(<PetscErrorCode>MPI_Comm_rank(comm, &rank))             # <<<<<<<<<<<<<<
 *     return rank
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(((PetscErrorCode)MPI_Comm_rank(__pyx_v_comm, (&__pyx_v_rank)))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(12, 125, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmpi.pxi":126
 *     cdef int rank = 0
 *     CHKERR(<PetscErrorCode>MPI_Comm_rank(comm, &rank))
 *     return rank             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_r = __pyx_v_rank;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscmpi.pxi":122
 *     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_XDECREF(__pyx_t_3);
  __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":58
 * 
 * 
 * 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;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15[4];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Sys_Sizes", 0);

  /* "petsc4py/PETSc/petscsys.pxi":65
 *    ) 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":66
 *     # 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(13, 66, __pyx_L1_error)
    __pyx_v_bs = __pyx_t_2;
    __pyx_v_b = __pyx_t_2;
  }

  /* "petsc4py/PETSc/petscsys.pxi":67
 *     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":69
 *     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":71
 *     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":72
 *     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(13, 72, __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_INCREF(__pyx_t_6);
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_7);
        } else {
          __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 72, __pyx_L5_error)
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 72, __pyx_L5_error)
          __Pyx_XGOTREF(__pyx_t_7);
        }
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 72, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 72, __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(13, 72, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(13, 72, __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(13, 72, __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":71
 *     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":73
 *     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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), ((PyObject *)(((PyTypeObject*)PyExc_ValueError))));
    if (__pyx_t_10) {
      __Pyx_ErrRestore(0,0,0);

      /* "petsc4py/PETSc/petscsys.pxi":74
 *         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);
      goto __pyx_L6_exception_handled;
    }
    goto __pyx_L7_except_error;

    /* "petsc4py/PETSc/petscsys.pxi":71
 *     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":75
 *     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 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(13, 75, __pyx_L1_error)
    __pyx_v_n = __pyx_t_2;
  }

  /* "petsc4py/PETSc/petscsys.pxi":76
 *         on = None; oN = size
 *     if on is not None: n = asInt(on)
 *     if oN is not None: N = asInt(oN)             # <<<<<<<<<<<<<<
 *     # check block, local, 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(13, 76, __pyx_L1_error)
    __pyx_v_N = __pyx_t_2;
  }

  /* "petsc4py/PETSc/petscsys.pxi":78
 *     if oN is not None: N = asInt(oN)
 *     # check block, local, 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)) {
    __pyx_t_6 = NULL;

    /* "petsc4py/PETSc/petscsys.pxi":79
 *     # check block, local, 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(13, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_11 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_block_size_d_must_be_positive, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(13, 79, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_12 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_11};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 78, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(13, 78, __pyx_L1_error)

    /* "petsc4py/PETSc/petscsys.pxi":78
 *     if oN is not None: N = asInt(oN)
 *     # check block, local, 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(
*/
  }

  /* "petsc4py/PETSc/petscsys.pxi":80
 *     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_13 = (__pyx_v_n == PETSC_DECIDE);
  if (__pyx_t_13) {
  } else {
    __pyx_t_1 = __pyx_t_13;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_13 = (__pyx_v_N == PETSC_DECIDE);
  __pyx_t_1 = __pyx_t_13;
  __pyx_L19_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {
    __pyx_t_11 = NULL;
    __pyx_t_12 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_local_and_global_sizes_cannot_be};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 80, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(13, 80, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/petscsys.pxi":82
 *     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_13 = (__pyx_v_n > 0);
  if (__pyx_t_13) {
  } else {
    __pyx_t_1 = __pyx_t_13;
    goto __pyx_L22_bool_binop_done;
  }
  __pyx_t_13 = ((__pyx_v_n % __pyx_v_bs) != 0);
  __pyx_t_1 = __pyx_t_13;
  __pyx_L22_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {
    __pyx_t_11 = NULL;

    /* "petsc4py/PETSc/petscsys.pxi":84
 *     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_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_6), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_14 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_6), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_14)) __PYX_ERR(13, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_15[0] = __pyx_mstate_global->__pyx_kp_u_local_size;
    __pyx_t_15[1] = __pyx_t_8;
    __pyx_t_15[2] = __pyx_mstate_global->__pyx_kp_u_not_divisible_by_block_size;
    __pyx_t_15[3] = __pyx_t_14;

    /* "petsc4py/PETSc/petscsys.pxi":83
 *         "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_PyUnicode_Join(__pyx_t_15, 4, 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_14));
    if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_12 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_6};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 82, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(13, 82, __pyx_L1_error)

    /* "petsc4py/PETSc/petscsys.pxi":82
 *     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)))
*/
  }

  /* "petsc4py/PETSc/petscsys.pxi":85
 *         "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_13 = (__pyx_v_N > 0);
  if (__pyx_t_13) {
  } else {
    __pyx_t_1 = __pyx_t_13;
    goto __pyx_L25_bool_binop_done;
  }
  __pyx_t_13 = ((__pyx_v_N % __pyx_v_bs) != 0);
  __pyx_t_1 = __pyx_t_13;
  __pyx_L25_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {
    __pyx_t_6 = NULL;

    /* "petsc4py/PETSc/petscsys.pxi":87
 *     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_11 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_11)) __PYX_ERR(13, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_14 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_11), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_14)) __PYX_ERR(13, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_11)) __PYX_ERR(13, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_8 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_11), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(13, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_15[0] = __pyx_mstate_global->__pyx_kp_u_global_size;
    __pyx_t_15[1] = __pyx_t_14;
    __pyx_t_15[2] = __pyx_mstate_global->__pyx_kp_u_not_divisible_by_block_size;
    __pyx_t_15[3] = __pyx_t_8;

    /* "petsc4py/PETSc/petscsys.pxi":86
 *         (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_11 = __Pyx_PyUnicode_Join(__pyx_t_15, 4, 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14) + 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_14) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8));
    if (unlikely(!__pyx_t_11)) __PYX_ERR(13, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_12 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_11};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(13, 85, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(13, 85, __pyx_L1_error)

    /* "petsc4py/PETSc/petscsys.pxi":85
 *         "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)))
*/
  }

  /* "petsc4py/PETSc/petscsys.pxi":89
 *         (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":90
 *     # 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":91
 *     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":92
 *     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":58
 * 
 * 
 * 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_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_14);
  __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":94
 *     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":100
 *     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":101
 *    ) 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":102
 *     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":103
 *     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":104
 *     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":105
 *     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(13, 105, __pyx_L1_error)

  /* "petsc4py/PETSc/petscsys.pxi":106
 *     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":107
 *     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":108
 *     _n[0] = n * bs
 *     _N[0] = N * bs
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscsys.pxi":94
 *     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", 0);

  /* "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(14, 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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 65, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(14, 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":65
 * # --------------------------------------------------------------------
 * 
 * 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":66
 * 
 * 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":67
 * 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":68
 *     if obj    == NULL: return PETSC_SUCCESS
 *     if obj[0] == NULL: return PETSC_SUCCESS
 *     return PetscObjectReference(obj[0])             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscErrorCode PetscDECREF(PetscObject *obj) noexcept nogil:
*/
  __pyx_r = PetscObjectReference((__pyx_v_obj[0]));
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscobj.pxi":65
 * # --------------------------------------------------------------------
 * 
 * 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":70
 *     return PetscObjectReference(obj[0])
 * 
 * cdef inline PetscErrorCode PetscDECREF(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_PetscDECREF(PetscObject *__pyx_v_obj) {
  PetscErrorCode __pyx_r;
  int __pyx_t_1;

  /* "petsc4py/PETSc/petscobj.pxi":71
 * 
 * cdef inline PetscErrorCode PetscDECREF(PetscObject *obj) noexcept nogil:
 *     if obj    == NULL: return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 *     if obj[0] == NULL: return PETSC_SUCCESS
 *     return PetscObjectDereference(obj[0])
*/
  __pyx_t_1 = (__pyx_v_obj == NULL);
  if (__pyx_t_1) {
    __pyx_r = PETSC_SUCCESS;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscobj.pxi":72
 * cdef inline PetscErrorCode PetscDECREF(PetscObject *obj) noexcept nogil:
 *     if obj    == NULL: return PETSC_SUCCESS
 *     if obj[0] == NULL: return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 *     return PetscObjectDereference(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":73
 *     if obj    == NULL: return PETSC_SUCCESS
 *     if obj[0] == NULL: return PETSC_SUCCESS
 *     return PetscObjectDereference(obj[0])             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscErrorCode PetscCLEAR(PetscObject* obj) noexcept nogil:
*/
  __pyx_r = PetscObjectDereference((__pyx_v_obj[0]));
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscobj.pxi":70
 *     return PetscObjectReference(obj[0])
 * 
 * cdef inline PetscErrorCode PetscDECREF(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":75
 *     return PetscObjectDereference(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":76
 * 
 * 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":77
 * 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":79
 *     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":80
 *     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":75
 *     return PetscObjectDereference(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":82
 *     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":83
 * 
 * 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":84
 * 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":86
 *     if obj[0] == NULL: return PETSC_SUCCESS
 *     cdef PetscObject tmp
 *     tmp = obj[0]; obj[0] = NULL             # <<<<<<<<<<<<<<
 *     if not (<int>PetscInitializeCalled): return PETSC_SUCCESS
 *     if     (<int>PetscFinalizeCalled):   return PETSC_SUCCESS
*/
  __pyx_v_tmp = (__pyx_v_obj[0]);
  (__pyx_v_obj[0]) = NULL;

  /* "petsc4py/PETSc/petscobj.pxi":87
 *     cdef PetscObject tmp
 *     tmp = obj[0]; obj[0] = NULL
 *     if not (<int>PetscInitializeCalled): return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 *     if     (<int>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":88
 *     tmp = obj[0]; obj[0] = NULL
 *     if not (<int>PetscInitializeCalled): return PETSC_SUCCESS
 *     if     (<int>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":89
 *     if not (<int>PetscInitializeCalled): return PETSC_SUCCESS
 *     if     (<int>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":82
 *     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":91
 *     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":92
 * 
 * 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":93
 * 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":94
 *     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":91
 *     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":114
 *         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) {
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();

  /* "petsc4py/PETSc/petscobj.pxi":115
 * 
 * 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":114
 *         PetscErrorCode (*python_destroy)(void*) noexcept nogil
 * 
 * cdef inline void Py_DecRef(PyObject *ob) noexcept with gil:             # <<<<<<<<<<<<<<
 *     _Py_DecRef(ob)
 * 
*/

  /* function exit code */
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
}

/* "petsc4py/PETSc/petscobj.pxi":117
 *     _Py_DecRef(ob)
 * 
 * cdef PetscErrorCode PetscDelPyDict(void* ptr) noexcept nogil:             # <<<<<<<<<<<<<<
 *     if ptr != NULL and Py_IsInitialized():
 *         Py_DecRef(<PyObject*>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":118
 * 
 * cdef PetscErrorCode PetscDelPyDict(void* ptr) noexcept nogil:
 *     if ptr != NULL and Py_IsInitialized():             # <<<<<<<<<<<<<<
 *         Py_DecRef(<PyObject*>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":119
 * cdef PetscErrorCode PetscDelPyDict(void* ptr) noexcept nogil:
 *     if ptr != NULL and Py_IsInitialized():
 *         Py_DecRef(<PyObject*>ptr)             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
    __pyx_f_8petsc4py_5PETSc_Py_DecRef(((PyObject *)__pyx_v_ptr));

    /* "petsc4py/PETSc/petscobj.pxi":118
 * 
 * cdef PetscErrorCode PetscDelPyDict(void* ptr) noexcept nogil:
 *     if ptr != NULL and Py_IsInitialized():             # <<<<<<<<<<<<<<
 *         Py_DecRef(<PyObject*>ptr)
 *     return PETSC_SUCCESS
*/
  }

  /* "petsc4py/PETSc/petscobj.pxi":120
 *     if ptr != NULL and Py_IsInitialized():
 *         Py_DecRef(<PyObject*>ptr)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef object PetscGetPyDict(PetscObject obj, bint create):
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscobj.pxi":117
 *     _Py_DecRef(ob)
 * 
 * cdef PetscErrorCode PetscDelPyDict(void* ptr) noexcept nogil:             # <<<<<<<<<<<<<<
 *     if ptr != NULL and Py_IsInitialized():
 *         Py_DecRef(<PyObject*>ptr)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/petscobj.pxi":122
 *     return PETSC_SUCCESS
 * 
 * cdef object PetscGetPyDict(PetscObject obj, bint create):             # <<<<<<<<<<<<<<
 *     if obj.python_context != NULL:
 *         return <object>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", 0);

  /* "petsc4py/PETSc/petscobj.pxi":123
 * 
 * cdef object PetscGetPyDict(PetscObject obj, bint create):
 *     if obj.python_context != NULL:             # <<<<<<<<<<<<<<
 *         return <object>obj.python_context
 *     if create:
*/
  __pyx_t_1 = (__pyx_v_obj->python_context != NULL);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscobj.pxi":124
 * cdef object PetscGetPyDict(PetscObject obj, bint create):
 *     if obj.python_context != NULL:
 *         return <object>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":123
 * 
 * cdef object PetscGetPyDict(PetscObject obj, bint create):
 *     if obj.python_context != NULL:             # <<<<<<<<<<<<<<
 *         return <object>obj.python_context
 *     if create:
*/
  }

  /* "petsc4py/PETSc/petscobj.pxi":125
 *     if obj.python_context != NULL:
 *         return <object>obj.python_context
 *     if create:             # <<<<<<<<<<<<<<
 *         obj.python_destroy = PetscDelPyDict
 *         obj.python_context = <void*>PyDict_New()
*/
  if (__pyx_v_create) {

    /* "petsc4py/PETSc/petscobj.pxi":126
 *         return <object>obj.python_context
 *     if create:
 *         obj.python_destroy = PetscDelPyDict             # <<<<<<<<<<<<<<
 *         obj.python_context = <void*>PyDict_New()
 *         return <object>obj.python_context
*/
    __pyx_v_obj->python_destroy = __pyx_f_8petsc4py_5PETSc_PetscDelPyDict;

    /* "petsc4py/PETSc/petscobj.pxi":127
 *     if create:
 *         obj.python_destroy = PetscDelPyDict
 *         obj.python_context = <void*>PyDict_New()             # <<<<<<<<<<<<<<
 *         return <object>obj.python_context
 *     return None
*/
    __pyx_t_2 = PyDict_New(); if (unlikely(__pyx_t_2 == ((void *)NULL))) __PYX_ERR(15, 127, __pyx_L1_error)
    __pyx_v_obj->python_context = ((void *)__pyx_t_2);

    /* "petsc4py/PETSc/petscobj.pxi":128
 *         obj.python_destroy = PetscDelPyDict
 *         obj.python_context = <void*>PyDict_New()
 *         return <object>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":125
 *     if obj.python_context != NULL:
 *         return <object>obj.python_context
 *     if create:             # <<<<<<<<<<<<<<
 *         obj.python_destroy = PetscDelPyDict
 *         obj.python_context = <void*>PyDict_New()
*/
  }

  /* "petsc4py/PETSc/petscobj.pxi":129
 *         obj.python_context = <void*>PyDict_New()
 *         return <object>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":122
 *     return PETSC_SUCCESS
 * 
 * cdef object PetscGetPyDict(PetscObject obj, bint create):             # <<<<<<<<<<<<<<
 *     if obj.python_context != NULL:
 *         return <object>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":131
 *     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", 0);

  /* "petsc4py/PETSc/petscobj.pxi":132
 * 
 * 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(15, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscobj.pxi":133
 * 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 = <PyObject*>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":134
 *     cdef object dct = PetscGetPyDict(o, False)
 *     if dct is None: return None
 *     cdef object key = bytes2str(name)             # <<<<<<<<<<<<<<
 *     cdef PyObject *d = <PyObject*>dct
 *     cdef PyObject *k = <PyObject*>key
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_key = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscobj.pxi":135
 *     if dct is None: return None
 *     cdef object key = bytes2str(name)
 *     cdef PyObject *d = <PyObject*>dct             # <<<<<<<<<<<<<<
 *     cdef PyObject *k = <PyObject*>key
 *     cdef PyObject *v = NULL
*/
  __pyx_v_d = ((PyObject *)__pyx_v_dct);

  /* "petsc4py/PETSc/petscobj.pxi":136
 *     cdef object key = bytes2str(name)
 *     cdef PyObject *d = <PyObject*>dct
 *     cdef PyObject *k = <PyObject*>key             # <<<<<<<<<<<<<<
 *     cdef PyObject *v = NULL
 *     v = PyDict_GetItem(d, k)
*/
  __pyx_v_k = ((PyObject *)__pyx_v_key);

  /* "petsc4py/PETSc/petscobj.pxi":137
 *     cdef PyObject *d = <PyObject*>dct
 *     cdef PyObject *k = <PyObject*>key
 *     cdef PyObject *v = NULL             # <<<<<<<<<<<<<<
 *     v = PyDict_GetItem(d, k)
 *     if v != NULL: return <object>v
*/
  __pyx_v_v = NULL;

  /* "petsc4py/PETSc/petscobj.pxi":138
 *     cdef PyObject *k = <PyObject*>key
 *     cdef PyObject *v = NULL
 *     v = PyDict_GetItem(d, k)             # <<<<<<<<<<<<<<
 *     if v != NULL: return <object>v
 *     return None
*/
  __pyx_t_3 = PyDict_GetItem(__pyx_v_d, __pyx_v_k); if (unlikely(PyErr_Occurred())) __PYX_ERR(15, 138, __pyx_L1_error)
  __pyx_v_v = __pyx_t_3;

  /* "petsc4py/PETSc/petscobj.pxi":139
 *     cdef PyObject *v = NULL
 *     v = PyDict_GetItem(d, k)
 *     if v != NULL: return <object>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":140
 *     v = PyDict_GetItem(d, k)
 *     if v != NULL: return <object>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":131
 *     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":142
 *     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", 0);

  /* "petsc4py/PETSc/petscobj.pxi":144
 * 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":145
 *     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(15, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_dct = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscobj.pxi":144
 * 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":147
 *         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(15, 147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_dct = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscobj.pxi":148
 *     else:
 *         dct = PetscGetPyDict(o, False)
 *         if dct is None: return None             # <<<<<<<<<<<<<<
 *     cdef str key = bytes2str(name)
 *     cdef PyObject *d = <PyObject*>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":149
 *         dct = PetscGetPyDict(o, False)
 *         if dct is None: return None
 *     cdef str key = bytes2str(name)             # <<<<<<<<<<<<<<
 *     cdef PyObject *d = <PyObject*>dct
 *     cdef PyObject *k = <PyObject*>key
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_2))) __PYX_ERR(15, 149, __pyx_L1_error)
  __pyx_v_key = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscobj.pxi":150
 *         if dct is None: return None
 *     cdef str key = bytes2str(name)
 *     cdef PyObject *d = <PyObject*>dct             # <<<<<<<<<<<<<<
 *     cdef PyObject *k = <PyObject*>key
 *     cdef PyObject *v = <PyObject*>p
*/
  __pyx_v_d = ((PyObject *)__pyx_v_dct);

  /* "petsc4py/PETSc/petscobj.pxi":151
 *     cdef str key = bytes2str(name)
 *     cdef PyObject *d = <PyObject*>dct
 *     cdef PyObject *k = <PyObject*>key             # <<<<<<<<<<<<<<
 *     cdef PyObject *v = <PyObject*>p
 *     PyDict_SetItem(d, k, v)
*/
  __pyx_v_k = ((PyObject *)__pyx_v_key);

  /* "petsc4py/PETSc/petscobj.pxi":152
 *     cdef PyObject *d = <PyObject*>dct
 *     cdef PyObject *k = <PyObject*>key
 *     cdef PyObject *v = <PyObject*>p             # <<<<<<<<<<<<<<
 *     PyDict_SetItem(d, k, v)
 *     if v == <PyObject*>None:
*/
  __pyx_v_v = ((PyObject *)__pyx_v_p);

  /* "petsc4py/PETSc/petscobj.pxi":153
 *     cdef PyObject *k = <PyObject*>key
 *     cdef PyObject *v = <PyObject*>p
 *     PyDict_SetItem(d, k, v)             # <<<<<<<<<<<<<<
 *     if v == <PyObject*>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(15, 153, __pyx_L1_error)

  /* "petsc4py/PETSc/petscobj.pxi":154
 *     cdef PyObject *v = <PyObject*>p
 *     PyDict_SetItem(d, k, v)
 *     if v == <PyObject*>None:             # <<<<<<<<<<<<<<
 *         PyDict_DelItem(d, k)
 *     return None
*/
  __pyx_t_1 = (__pyx_v_v == ((PyObject *)Py_None));
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscobj.pxi":155
 *     PyDict_SetItem(d, k, v)
 *     if v == <PyObject*>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(15, 155, __pyx_L1_error)

    /* "petsc4py/PETSc/petscobj.pxi":154
 *     cdef PyObject *v = <PyObject*>p
 *     PyDict_SetItem(d, k, v)
 *     if v == <PyObject*>None:             # <<<<<<<<<<<<<<
 *         PyDict_DelItem(d, k)
 *     return None
*/
  }

  /* "petsc4py/PETSc/petscobj.pxi":156
 *     if v == <PyObject*>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":142
 *     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":163
 *     object PyLong_FromVoidPtr(void*)
 * 
 * cdef inline Py_intptr_t Object_toFortran(PetscObject o) nogil:             # <<<<<<<<<<<<<<
 *     return <Py_intptr_t> 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":164
 * 
 * cdef inline Py_intptr_t Object_toFortran(PetscObject o) nogil:
 *     return <Py_intptr_t> o             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_r = ((Py_intptr_t)__pyx_v_o);
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscobj.pxi":163
 *     object PyLong_FromVoidPtr(void*)
 * 
 * cdef inline Py_intptr_t Object_toFortran(PetscObject o) nogil:             # <<<<<<<<<<<<<<
 *     return <Py_intptr_t> o
 * 
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/petscobj.pxi":168
 * # --------------------------------------------------------------------
 * 
 * cdef inline type subtype_DM(PetscDM dm):             # <<<<<<<<<<<<<<
 *     cdef PetscObject obj = <PetscObject> 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", 0);

  /* "petsc4py/PETSc/petscobj.pxi":169
 * 
 * cdef inline type subtype_DM(PetscDM dm):
 *     cdef PetscObject obj = <PetscObject> dm             # <<<<<<<<<<<<<<
 *     if obj == NULL: return DM
 *     # ---
*/
  __pyx_v_obj = ((PetscObject)__pyx_v_dm);

  /* "petsc4py/PETSc/petscobj.pxi":170
 * cdef inline type subtype_DM(PetscDM dm):
 *     cdef PetscObject obj = <PetscObject> 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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM);
    __pyx_r = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscobj.pxi":172
 *     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":173
 *     # ---
 *     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(15, 173, __pyx_L1_error)

  /* "petsc4py/PETSc/petscobj.pxi":174
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA);
    __pyx_r = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscobj.pxi":175
 *     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(15, 175, __pyx_L1_error)

  /* "petsc4py/PETSc/petscobj.pxi":176
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex);
    __pyx_r = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscobj.pxi":177
 *     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(15, 177, __pyx_L1_error)

  /* "petsc4py/PETSc/petscobj.pxi":178
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMComposite);
    __pyx_r = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMComposite;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscobj.pxi":179
 *     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(15, 179, __pyx_L1_error)

  /* "petsc4py/PETSc/petscobj.pxi":180
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell);
    __pyx_r = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscobj.pxi":181
 *     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(15, 181, __pyx_L1_error)

  /* "petsc4py/PETSc/petscobj.pxi":182
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag);
    __pyx_r = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscobj.pxi":183
 *     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(15, 183, __pyx_L1_error)

  /* "petsc4py/PETSc/petscobj.pxi":184
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm);
    __pyx_r = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscobj.pxi":186
 *     if match == PETSC_TRUE: return DMSwarm
 *     # ---
 *     return DM             # <<<<<<<<<<<<<<
 * 
 * cdef inline type subtype_Object(PetscObject obj):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM);
  __pyx_r = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscobj.pxi":168
 * # --------------------------------------------------------------------
 * 
 * cdef inline type subtype_DM(PetscDM dm):             # <<<<<<<<<<<<<<
 *     cdef PetscObject obj = <PetscObject> 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":188
 *     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", 0);

  /* "petsc4py/PETSc/petscobj.pxi":189
 * 
 * cdef inline type subtype_Object(PetscObject obj):
 *     cdef type klass = Object             # <<<<<<<<<<<<<<
 *     if obj == NULL: return klass
 *     cdef PetscClassId classid = 0
*/
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object);
  __pyx_v_klass = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;

  /* "petsc4py/PETSc/petscobj.pxi":190
 * 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":191
 *     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":192
 *     if obj == NULL: return klass
 *     cdef PetscClassId classid = 0
 *     CHKERR(PetscObjectGetClassId(obj, &classid))             # <<<<<<<<<<<<<<
 *     if classid == PETSC_DM_CLASSID:
 *         klass = subtype_DM(<PetscDM>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(15, 192, __pyx_L1_error)

  /* "petsc4py/PETSc/petscobj.pxi":193
 *     cdef PetscClassId classid = 0
 *     CHKERR(PetscObjectGetClassId(obj, &classid))
 *     if classid == PETSC_DM_CLASSID:             # <<<<<<<<<<<<<<
 *         klass = subtype_DM(<PetscDM>obj)
 *     else:
*/
  __pyx_t_1 = (__pyx_v_classid == DM_CLASSID);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscobj.pxi":194
 *     CHKERR(PetscObjectGetClassId(obj, &classid))
 *     if classid == PETSC_DM_CLASSID:
 *         klass = subtype_DM(<PetscDM>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(15, 194, __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":193
 *     cdef PetscClassId classid = 0
 *     CHKERR(PetscObjectGetClassId(obj, &classid))
 *     if classid == PETSC_DM_CLASSID:             # <<<<<<<<<<<<<<
 *         klass = subtype_DM(<PetscDM>obj)
 *     else:
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/petscobj.pxi":196
 *         klass = subtype_DM(<PetscDM>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(15, 196, __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":197
 *     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":188
 *     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/petscobj.pxi":201
 * # --------------------------------------------------------------------
 * 
 * cdef PetscErrorCode PetscObjectOptionsHandler_PYTHON(             # <<<<<<<<<<<<<<
 *     PetscObject obj,
 *     PetscOptionItems unused_PetscOptionsObject,
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscObjectOptionsHandler_PYTHON(PetscObject __pyx_v_obj, CYTHON_UNUSED PetscOptionItems __pyx_v_unused_PetscOptionsObject, CYTHON_UNUSED void *__pyx_v_unused_ctx) {
  struct PyPetscObjectObject *__pyx_v_pobj = 0;
  PyObject *__pyx_v_handler = 0;
  PetscErrorCode __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PetscObjectOptionsHandler_PYTHON", 0);

  /* "petsc4py/PETSc/petscobj.pxi":206
 *     void *unused_ctx,
 *    ) except PETSC_ERR_PYTHON with gil:
 *     cdef Object pobj = PyPetscObject_New(obj)             # <<<<<<<<<<<<<<
 *     cdef object handler = pobj.get_attr('__optshandler__')
 *     if handler is None: return PETSC_SUCCESS
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_PyPetscObject_New(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(15, 206, __pyx_L1_error)
  __pyx_v_pobj = ((struct PyPetscObjectObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscobj.pxi":207
 *    ) except PETSC_ERR_PYTHON with gil:
 *     cdef Object pobj = PyPetscObject_New(obj)
 *     cdef object handler = pobj.get_attr('__optshandler__')             # <<<<<<<<<<<<<<
 *     if handler is None: return PETSC_SUCCESS
 *     handler(pobj)
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *)__pyx_v_pobj->__pyx_vtab)->get_attr(__pyx_v_pobj, ((char *)"__optshandler__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_handler = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscobj.pxi":208
 *     cdef Object pobj = PyPetscObject_New(obj)
 *     cdef object handler = pobj.get_attr('__optshandler__')
 *     if handler is None: return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 *     handler(pobj)
 *     return PETSC_SUCCESS
*/
  __pyx_t_2 = (__pyx_v_handler == Py_None);
  if (__pyx_t_2) {
    __pyx_r = PETSC_SUCCESS;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscobj.pxi":209
 *     cdef object handler = pobj.get_attr('__optshandler__')
 *     if handler is None: return PETSC_SUCCESS
 *     handler(pobj)             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
*/
  __pyx_t_3 = NULL;
  __Pyx_INCREF(__pyx_v_handler);
  __pyx_t_4 = __pyx_v_handler; 
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_pobj)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscobj.pxi":210
 *     if handler is None: return PETSC_SUCCESS
 *     handler(pobj)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscobj.pxi":201
 * # --------------------------------------------------------------------
 * 
 * cdef PetscErrorCode PetscObjectOptionsHandler_PYTHON(             # <<<<<<<<<<<<<<
 *     PetscObject obj,
 *     PetscOptionItems unused_PetscOptionsObject,
*/

  /* 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.PetscObjectOptionsHandler_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_pobj);
  __Pyx_XDECREF(__pyx_v_handler);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscvwr.pxi":150
 * # ---
 * 
 * cdef inline PetscFileMode filemode(object mode) except <PetscFileMode>(-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":151
 * 
 * cdef inline PetscFileMode filemode(object mode) except <PetscFileMode>(-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":152
 * cdef inline PetscFileMode filemode(object mode) except <PetscFileMode>(-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":151
 * 
 * cdef inline PetscFileMode filemode(object mode) except <PetscFileMode>(-1):
 *     if mode is None:             # <<<<<<<<<<<<<<
 *         return PETSC_FILE_MODE_READ
 *     if isinstance(mode, str):
*/
  }

  /* "petsc4py/PETSc/petscvwr.pxi":153
 *     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 = PyUnicode_Check(__pyx_v_mode); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscvwr.pxi":154
 *         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_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_r, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(16, 154, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = FILE_MODE_READ;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscvwr.pxi":155
 *     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_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_w, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(16, 155, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = FILE_MODE_WRITE;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscvwr.pxi":156
 *         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_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_a, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(16, 156, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = FILE_MODE_APPEND;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscvwr.pxi":157
 *         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_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_kp_u_r_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(16, 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
 *         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_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_kp_u_w_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(16, 158, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = FILE_MODE_UPDATE;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscvwr.pxi":159
 *         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_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_kp_u_a_2, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(16, 159, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = FILE_MODE_APPEND_UPDATE;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscvwr.pxi":160
 *         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_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_u, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(16, 160, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = FILE_MODE_UPDATE;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscvwr.pxi":161
 *         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_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_au, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(16, 161, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = FILE_MODE_APPEND_UPDATE;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscvwr.pxi":162
 *         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_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_ua, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(16, 162, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = FILE_MODE_APPEND_UPDATE;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscvwr.pxi":153
 *     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":163
 *         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_PyLong_As_PetscFileMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(16, 163, __pyx_L1_error)
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscvwr.pxi":150
 * # ---
 * 
 * cdef inline PetscFileMode filemode(object mode) except <PetscFileMode>(-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":70
 *     PetscErrorCode PetscDeviceReference(PetscDevice)
 * 
 * cdef inline PetscDeviceType asDeviceType(object dtype) except <PetscDeviceType>(-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;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PetscDeviceType __pyx_t_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_RefNannySetupContext("asDeviceType", 0);
  __Pyx_INCREF(__pyx_v_dtype);

  /* "petsc4py/PETSc/petscdevice.pxi":71
 * 
 * cdef inline PetscDeviceType asDeviceType(object dtype) except <PetscDeviceType>(-1):
 *     if isinstance(dtype, str):             # <<<<<<<<<<<<<<
 *         dtype = dtype.upper()
 *         try:
*/
  __pyx_t_1 = PyUnicode_Check(__pyx_v_dtype); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscdevice.pxi":72
 * cdef inline PetscDeviceType asDeviceType(object dtype) except <PetscDeviceType>(-1):
 *     if isinstance(dtype, str):
 *         dtype = dtype.upper()             # <<<<<<<<<<<<<<
 *         try:
 *             return getattr(Device.Type, dtype)
*/
    __pyx_t_3 = __pyx_v_dtype;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_upper, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 72, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscdevice.pxi":73
 *     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_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "petsc4py/PETSc/petscdevice.pxi":74
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device), __pyx_mstate_global->__pyx_n_u_Type); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 74, __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(17, 74, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_8 = ((PetscDeviceType)__Pyx_PyLong_As_PetscDeviceType(__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(17, 74, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_8;
        goto __pyx_L8_try_return;

        /* "petsc4py/PETSc/petscdevice.pxi":73
 *     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;

      /* "petsc4py/PETSc/petscdevice.pxi":75
 *         try:
 *             return getattr(Device.Type, dtype)
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             raise ValueError("unknown device type: %s" % dtype)
 *     return dtype
*/
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_AttributeError))));
      if (__pyx_t_9) {
        __Pyx_AddTraceback("petsc4py.PETSc.asDeviceType", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_10) < 0) __PYX_ERR(17, 75, __pyx_L6_except_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_10);

        /* "petsc4py/PETSc/petscdevice.pxi":76
 *             return getattr(Device.Type, dtype)
 *         except AttributeError:
 *             raise ValueError("unknown device type: %s" % dtype)             # <<<<<<<<<<<<<<
 *     return dtype
 * 
*/
        __pyx_t_12 = NULL;
        __pyx_t_13 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_unknown_device_type_s, __pyx_v_dtype); if (unlikely(!__pyx_t_13)) __PYX_ERR(17, 76, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_4 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_13};
          __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(17, 76, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_Raise(__pyx_t_11, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __PYX_ERR(17, 76, __pyx_L6_except_error)
      }
      goto __pyx_L6_except_error;

      /* "petsc4py/PETSc/petscdevice.pxi":73
 *     if isinstance(dtype, str):
 *         dtype = dtype.upper()
 *         try:             # <<<<<<<<<<<<<<
 *             return getattr(Device.Type, dtype)
 *         except AttributeError:
*/
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L8_try_return:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdevice.pxi":71
 * 
 * cdef inline PetscDeviceType asDeviceType(object dtype) except <PetscDeviceType>(-1):
 *     if isinstance(dtype, str):             # <<<<<<<<<<<<<<
 *         dtype = dtype.upper()
 *         try:
*/
  }

  /* "petsc4py/PETSc/petscdevice.pxi":77
 *         except AttributeError:
 *             raise ValueError("unknown device type: %s" % dtype)
 *     return dtype             # <<<<<<<<<<<<<<
 * 
 * cdef inline str toDeviceType(PetscDeviceType dtype):
*/
  __pyx_t_8 = ((PetscDeviceType)__Pyx_PyLong_As_PetscDeviceType(__pyx_v_dtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(17, 77, __pyx_L1_error)
  __pyx_r = __pyx_t_8;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscdevice.pxi":70
 *     PetscErrorCode PetscDeviceReference(PetscDevice)
 * 
 * cdef inline PetscDeviceType asDeviceType(object dtype) except <PetscDeviceType>(-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_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __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":79
 *     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;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("toDeviceType", 0);

  /* "petsc4py/PETSc/petscdevice.pxi":80
 * 
 * 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":81
 * cdef inline str toDeviceType(PetscDeviceType dtype):
 *     try:
 *         return Device.Type.__enum2str[dtype]             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise NotImplementedError("unhandled PetscDeviceType %d" % <int>dtype)
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device), __pyx_mstate_global->__pyx_n_u_Type); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 81, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enum2str); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 81, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyLong_From_PetscDeviceType(__pyx_v_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 81, __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(17, 81, __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(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_6))) __PYX_ERR(17, 81, __pyx_L3_error)
      __pyx_r = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;
      goto __pyx_L7_try_return;

      /* "petsc4py/PETSc/petscdevice.pxi":80
 * 
 * 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":82
 *     try:
 *         return Device.Type.__enum2str[dtype]
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("unhandled PetscDeviceType %d" % <int>dtype)
 * 
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_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(17, 82, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);

      /* "petsc4py/PETSc/petscdevice.pxi":83
 *         return Device.Type.__enum2str[dtype]
 *     except KeyError:
 *         raise NotImplementedError("unhandled PetscDeviceType %d" % <int>dtype)             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscStreamType asStreamType(object stype) except <PetscStreamType>(-1):
*/
      __pyx_t_9 = NULL;
      __pyx_t_10 = __Pyx_PyLong_From_int(((int)__pyx_v_dtype)); if (unlikely(!__pyx_t_10)) __PYX_ERR(17, 83, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_unhandled_PetscDeviceType_d, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(17, 83, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_12 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_11};
        __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 83, __pyx_L5_except_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(17, 83, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "petsc4py/PETSc/petscdevice.pxi":80
 * 
 * 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":79
 *     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_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __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":85
 *         raise NotImplementedError("unhandled PetscDeviceType %d" % <int>dtype)
 * 
 * cdef inline PetscStreamType asStreamType(object stype) except <PetscStreamType>(-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;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PetscStreamType __pyx_t_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_RefNannySetupContext("asStreamType", 0);
  __Pyx_INCREF(__pyx_v_stype);

  /* "petsc4py/PETSc/petscdevice.pxi":86
 * 
 * cdef inline PetscStreamType asStreamType(object stype) except <PetscStreamType>(-1):
 *     if isinstance(stype, str):             # <<<<<<<<<<<<<<
 *         stype = stype.upper()
 *         try:
*/
  __pyx_t_1 = PyUnicode_Check(__pyx_v_stype); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscdevice.pxi":87
 * cdef inline PetscStreamType asStreamType(object stype) except <PetscStreamType>(-1):
 *     if isinstance(stype, str):
 *         stype = stype.upper()             # <<<<<<<<<<<<<<
 *         try:
 *             return getattr(DeviceContext.StreamType, stype)
*/
    __pyx_t_3 = __pyx_v_stype;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_upper, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 87, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_stype, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscdevice.pxi":88
 *     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_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "petsc4py/PETSc/petscdevice.pxi":89
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext), __pyx_mstate_global->__pyx_n_u_StreamType); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 89, __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(17, 89, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_8 = ((PetscStreamType)__Pyx_PyLong_As_PetscStreamType(__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(17, 89, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_8;
        goto __pyx_L8_try_return;

        /* "petsc4py/PETSc/petscdevice.pxi":88
 *     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;

      /* "petsc4py/PETSc/petscdevice.pxi":90
 *         try:
 *             return getattr(DeviceContext.StreamType, stype)
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             raise ValueError("unknown stream type: %s" % stype)
 *     return stype
*/
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_AttributeError))));
      if (__pyx_t_9) {
        __Pyx_AddTraceback("petsc4py.PETSc.asStreamType", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_10) < 0) __PYX_ERR(17, 90, __pyx_L6_except_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_10);

        /* "petsc4py/PETSc/petscdevice.pxi":91
 *             return getattr(DeviceContext.StreamType, stype)
 *         except AttributeError:
 *             raise ValueError("unknown stream type: %s" % stype)             # <<<<<<<<<<<<<<
 *     return stype
 * 
*/
        __pyx_t_12 = NULL;
        __pyx_t_13 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_unknown_stream_type_s, __pyx_v_stype); if (unlikely(!__pyx_t_13)) __PYX_ERR(17, 91, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_4 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_13};
          __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(17, 91, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_Raise(__pyx_t_11, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __PYX_ERR(17, 91, __pyx_L6_except_error)
      }
      goto __pyx_L6_except_error;

      /* "petsc4py/PETSc/petscdevice.pxi":88
 *     if isinstance(stype, str):
 *         stype = stype.upper()
 *         try:             # <<<<<<<<<<<<<<
 *             return getattr(DeviceContext.StreamType, stype)
 *         except AttributeError:
*/
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L8_try_return:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdevice.pxi":86
 * 
 * cdef inline PetscStreamType asStreamType(object stype) except <PetscStreamType>(-1):
 *     if isinstance(stype, str):             # <<<<<<<<<<<<<<
 *         stype = stype.upper()
 *         try:
*/
  }

  /* "petsc4py/PETSc/petscdevice.pxi":92
 *         except AttributeError:
 *             raise ValueError("unknown stream type: %s" % stype)
 *     return stype             # <<<<<<<<<<<<<<
 * 
 * cdef inline str toStreamType(PetscStreamType stype):
*/
  __pyx_t_8 = ((PetscStreamType)__Pyx_PyLong_As_PetscStreamType(__pyx_v_stype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(17, 92, __pyx_L1_error)
  __pyx_r = __pyx_t_8;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscdevice.pxi":85
 *         raise NotImplementedError("unhandled PetscDeviceType %d" % <int>dtype)
 * 
 * cdef inline PetscStreamType asStreamType(object stype) except <PetscStreamType>(-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_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __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":94
 *     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;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("toStreamType", 0);

  /* "petsc4py/PETSc/petscdevice.pxi":95
 * 
 * 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":96
 * cdef inline str toStreamType(PetscStreamType stype):
 *     try:
 *         return DeviceContext.StreamType.__enum2str[stype]             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise NotImplementedError("unhandled PetscStreamType %d" % <int>stype)
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext), __pyx_mstate_global->__pyx_n_u_StreamType); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 96, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enum2str); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 96, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyLong_From_PetscStreamType(__pyx_v_stype); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 96, __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(17, 96, __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(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_6))) __PYX_ERR(17, 96, __pyx_L3_error)
      __pyx_r = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;
      goto __pyx_L7_try_return;

      /* "petsc4py/PETSc/petscdevice.pxi":95
 * 
 * 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":97
 *     try:
 *         return DeviceContext.StreamType.__enum2str[stype]
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("unhandled PetscStreamType %d" % <int>stype)
 * 
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_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(17, 97, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);

      /* "petsc4py/PETSc/petscdevice.pxi":98
 *         return DeviceContext.StreamType.__enum2str[stype]
 *     except KeyError:
 *         raise NotImplementedError("unhandled PetscStreamType %d" % <int>stype)             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscDeviceContextJoinMode asJoinMode(object jmode) except <PetscDeviceContextJoinMode>(-1):
*/
      __pyx_t_9 = NULL;
      __pyx_t_10 = __Pyx_PyLong_From_int(((int)__pyx_v_stype)); if (unlikely(!__pyx_t_10)) __PYX_ERR(17, 98, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_unhandled_PetscStreamType_d, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(17, 98, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_12 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_11};
        __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 98, __pyx_L5_except_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(17, 98, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "petsc4py/PETSc/petscdevice.pxi":95
 * 
 * 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":94
 *     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_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __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":100
 *         raise NotImplementedError("unhandled PetscStreamType %d" % <int>stype)
 * 
 * cdef inline PetscDeviceContextJoinMode asJoinMode(object jmode) except <PetscDeviceContextJoinMode>(-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;
  size_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PetscDeviceContextJoinMode __pyx_t_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_RefNannySetupContext("asJoinMode", 0);
  __Pyx_INCREF(__pyx_v_jmode);

  /* "petsc4py/PETSc/petscdevice.pxi":101
 * 
 * cdef inline PetscDeviceContextJoinMode asJoinMode(object jmode) except <PetscDeviceContextJoinMode>(-1):
 *     if isinstance(jmode, str):             # <<<<<<<<<<<<<<
 *         jmode = jmode.upper()
 *         try:
*/
  __pyx_t_1 = PyUnicode_Check(__pyx_v_jmode); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscdevice.pxi":102
 * cdef inline PetscDeviceContextJoinMode asJoinMode(object jmode) except <PetscDeviceContextJoinMode>(-1):
 *     if isinstance(jmode, str):
 *         jmode = jmode.upper()             # <<<<<<<<<<<<<<
 *         try:
 *             return getattr(DeviceContext.JoinMode, jmode)
*/
    __pyx_t_3 = __pyx_v_jmode;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_upper, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 102, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_jmode, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscdevice.pxi":103
 *     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_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "petsc4py/PETSc/petscdevice.pxi":104
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext), __pyx_mstate_global->__pyx_n_u_JoinMode); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 104, __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(17, 104, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_8 = ((PetscDeviceContextJoinMode)__Pyx_PyLong_As_PetscDeviceContextJoinMode(__pyx_t_3)); if (unlikely(PyErr_Occurred())) __PYX_ERR(17, 104, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_8;
        goto __pyx_L8_try_return;

        /* "petsc4py/PETSc/petscdevice.pxi":103
 *     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;

      /* "petsc4py/PETSc/petscdevice.pxi":105
 *         try:
 *             return getattr(DeviceContext.JoinMode, jmode)
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             raise ValueError("unknown join mode: %s" % jmode)
 *     return jmode
*/
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_AttributeError))));
      if (__pyx_t_9) {
        __Pyx_AddTraceback("petsc4py.PETSc.asJoinMode", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_10) < 0) __PYX_ERR(17, 105, __pyx_L6_except_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_2);
        __Pyx_XGOTREF(__pyx_t_10);

        /* "petsc4py/PETSc/petscdevice.pxi":106
 *             return getattr(DeviceContext.JoinMode, jmode)
 *         except AttributeError:
 *             raise ValueError("unknown join mode: %s" % jmode)             # <<<<<<<<<<<<<<
 *     return jmode
 * 
*/
        __pyx_t_12 = NULL;
        __pyx_t_13 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_unknown_join_mode_s, __pyx_v_jmode); if (unlikely(!__pyx_t_13)) __PYX_ERR(17, 106, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_4 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_13};
          __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(17, 106, __pyx_L6_except_error)
          __Pyx_GOTREF(__pyx_t_11);
        }
        __Pyx_Raise(__pyx_t_11, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __PYX_ERR(17, 106, __pyx_L6_except_error)
      }
      goto __pyx_L6_except_error;

      /* "petsc4py/PETSc/petscdevice.pxi":103
 *     if isinstance(jmode, str):
 *         jmode = jmode.upper()
 *         try:             # <<<<<<<<<<<<<<
 *             return getattr(DeviceContext.JoinMode, jmode)
 *         except AttributeError:
*/
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L8_try_return:;
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdevice.pxi":101
 * 
 * cdef inline PetscDeviceContextJoinMode asJoinMode(object jmode) except <PetscDeviceContextJoinMode>(-1):
 *     if isinstance(jmode, str):             # <<<<<<<<<<<<<<
 *         jmode = jmode.upper()
 *         try:
*/
  }

  /* "petsc4py/PETSc/petscdevice.pxi":107
 *         except AttributeError:
 *             raise ValueError("unknown join mode: %s" % jmode)
 *     return jmode             # <<<<<<<<<<<<<<
 * 
 * cdef inline str toJoinMode(PetscDeviceContextJoinMode jmode):
*/
  __pyx_t_8 = ((PetscDeviceContextJoinMode)__Pyx_PyLong_As_PetscDeviceContextJoinMode(__pyx_v_jmode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(17, 107, __pyx_L1_error)
  __pyx_r = __pyx_t_8;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscdevice.pxi":100
 *         raise NotImplementedError("unhandled PetscStreamType %d" % <int>stype)
 * 
 * cdef inline PetscDeviceContextJoinMode asJoinMode(object jmode) except <PetscDeviceContextJoinMode>(-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_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __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":109
 *     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;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  size_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("toJoinMode", 0);

  /* "petsc4py/PETSc/petscdevice.pxi":110
 * 
 * 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":111
 * cdef inline str toJoinMode(PetscDeviceContextJoinMode jmode):
 *     try:
 *         return DeviceContext.JoinMode.__enum2str[jmode]             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise NotImplementedError("unhandled PetscDeviceContextJoinMode %d" % <int>jmode)
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext), __pyx_mstate_global->__pyx_n_u_JoinMode); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 111, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enum2str); if (unlikely(!__pyx_t_5)) __PYX_ERR(17, 111, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyLong_From_PetscDeviceContextJoinMode(__pyx_v_jmode); if (unlikely(!__pyx_t_4)) __PYX_ERR(17, 111, __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(17, 111, __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(PyUnicode_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_6))) __PYX_ERR(17, 111, __pyx_L3_error)
      __pyx_r = ((PyObject*)__pyx_t_6);
      __pyx_t_6 = 0;
      goto __pyx_L7_try_return;

      /* "petsc4py/PETSc/petscdevice.pxi":110
 * 
 * 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":112
 *     try:
 *         return DeviceContext.JoinMode.__enum2str[jmode]
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise NotImplementedError("unhandled PetscDeviceContextJoinMode %d" % <int>jmode)
*/
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_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(17, 112, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);

      /* "petsc4py/PETSc/petscdevice.pxi":113
 *         return DeviceContext.JoinMode.__enum2str[jmode]
 *     except KeyError:
 *         raise NotImplementedError("unhandled PetscDeviceContextJoinMode %d" % <int>jmode)             # <<<<<<<<<<<<<<
*/
      __pyx_t_9 = NULL;
      __pyx_t_10 = __Pyx_PyLong_From_int(((int)__pyx_v_jmode)); if (unlikely(!__pyx_t_10)) __PYX_ERR(17, 113, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_unhandled_PetscDeviceContextJoin, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(17, 113, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_12 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_11};
        __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(17, 113, __pyx_L5_except_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(17, 113, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "petsc4py/PETSc/petscdevice.pxi":110
 * 
 * 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":109
 *     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_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __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":108
 * # --------------------------------------------------------------------
 * 
 * cdef inline IS ref_IS(PetscIS iset):             # <<<<<<<<<<<<<<
 *     cdef IS ob = <IS> 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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ref_IS", 0);

  /* "petsc4py/PETSc/petscis.pxi":109
 * 
 * cdef inline IS ref_IS(PetscIS iset):
 *     cdef IS ob = <IS> IS()             # <<<<<<<<<<<<<<
 *     ob.iset = iset
 *     CHKERR(PetscINCREF(ob.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 109, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_t_2 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ob = ((struct PyPetscISObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscis.pxi":110
 * cdef inline IS ref_IS(PetscIS iset):
 *     cdef IS ob = <IS> IS()
 *     ob.iset = iset             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(ob.obj))
 *     return ob
*/
  __pyx_v_ob->iset = __pyx_v_iset;

  /* "petsc4py/PETSc/petscis.pxi":111
 *     cdef IS ob = <IS> IS()
 *     ob.iset = iset
 *     CHKERR(PetscINCREF(ob.obj))             # <<<<<<<<<<<<<<
 *     return ob
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(18, 111, __pyx_L1_error)

  /* "petsc4py/PETSc/petscis.pxi":112
 *     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":108
 * # --------------------------------------------------------------------
 * 
 * cdef inline IS ref_IS(PetscIS iset):             # <<<<<<<<<<<<<<
 *     cdef IS ob = <IS> 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":114
 *     return ob
 * 
 * cdef inline LGMap ref_LGMap(PetscLGMap lgm):             # <<<<<<<<<<<<<<
 *     cdef LGMap ob = <LGMap> 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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ref_LGMap", 0);

  /* "petsc4py/PETSc/petscis.pxi":115
 * 
 * cdef inline LGMap ref_LGMap(PetscLGMap lgm):
 *     cdef LGMap ob = <LGMap> LGMap()             # <<<<<<<<<<<<<<
 *     ob.lgm = lgm
 *     CHKERR(PetscINCREF(ob.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 115, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_t_2 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ob = ((struct PyPetscLGMapObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscis.pxi":116
 * cdef inline LGMap ref_LGMap(PetscLGMap lgm):
 *     cdef LGMap ob = <LGMap> LGMap()
 *     ob.lgm = lgm             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(ob.obj))
 *     return ob
*/
  __pyx_v_ob->lgm = __pyx_v_lgm;

  /* "petsc4py/PETSc/petscis.pxi":117
 *     cdef LGMap ob = <LGMap> LGMap()
 *     ob.lgm = lgm
 *     CHKERR(PetscINCREF(ob.obj))             # <<<<<<<<<<<<<<
 *     return ob
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(18, 117, __pyx_L1_error)

  /* "petsc4py/PETSc/petscis.pxi":118
 *     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":114
 *     return ob
 * 
 * cdef inline LGMap ref_LGMap(PetscLGMap lgm):             # <<<<<<<<<<<<<<
 *     cdef LGMap ob = <LGMap> 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":129
 *     cdef bint hasarray
 * 
 *     def __cinit__(self, IS iset):             # <<<<<<<<<<<<<<
 *         cdef PetscIS i = iset.iset
 *         CHKERR(PetscINCREF(<PetscObject*>&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_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_iset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(18, 129, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(18, 129, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(18, 129, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, i); __PYX_ERR(18, 129, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(18, 129, __pyx_L3_error)
    }
    __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(18, 129, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(18, 129, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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":130
 * 
 *     def __cinit__(self, IS iset):
 *         cdef PetscIS i = iset.iset             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(<PetscObject*>&i))
 *         self.iset = i
*/
  __pyx_t_1 = __pyx_v_iset->iset;
  __pyx_v_i = __pyx_t_1;

  /* "petsc4py/PETSc/petscis.pxi":131
 *     def __cinit__(self, IS iset):
 *         cdef PetscIS i = iset.iset
 *         CHKERR(PetscINCREF(<PetscObject*>&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(18, 131, __pyx_L1_error)

  /* "petsc4py/PETSc/petscis.pxi":132
 *         cdef PetscIS i = iset.iset
 *         CHKERR(PetscINCREF(<PetscObject*>&i))
 *         self.iset = i             # <<<<<<<<<<<<<<
 *         self.size = 0
 *         self.data = NULL
*/
  __pyx_v_self->iset = __pyx_v_i;

  /* "petsc4py/PETSc/petscis.pxi":133
 *         CHKERR(PetscINCREF(<PetscObject*>&i))
 *         self.iset = i
 *         self.size = 0             # <<<<<<<<<<<<<<
 *         self.data = NULL
 *         self.hasarray = 0
*/
  __pyx_v_self->size = 0;

  /* "petsc4py/PETSc/petscis.pxi":134
 *         self.iset = i
 *         self.size = 0
 *         self.data = NULL             # <<<<<<<<<<<<<<
 *         self.hasarray = 0
 * 
*/
  __pyx_v_self->data = NULL;

  /* "petsc4py/PETSc/petscis.pxi":135
 *         self.size = 0
 *         self.data = NULL
 *         self.hasarray = 0             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
*/
  __pyx_v_self->hasarray = 0;

  /* "petsc4py/PETSc/petscis.pxi":129
 *     cdef bint hasarray
 * 
 *     def __cinit__(self, IS iset):             # <<<<<<<<<<<<<<
 *         cdef PetscIS i = iset.iset
 *         CHKERR(PetscINCREF(<PetscObject*>&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":137
 *         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":138
 * 
 *     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":139
 *     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(18, 139, __pyx_L1_error)

    /* "petsc4py/PETSc/petscis.pxi":138
 * 
 *     def __dealloc__(self):
 *         if self.hasarray and self.iset != NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(ISRestoreIndices(self.iset, &self.data))
 *         CHKERR(ISDestroy(&self.iset))
*/
  }

  /* "petsc4py/PETSc/petscis.pxi":140
 *         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(18, 140, __pyx_L1_error)

  /* "petsc4py/PETSc/petscis.pxi":137
 *         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":144
 *     #
 * 
 *     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":145
 * 
 *     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":146
 *     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(18, 146, __pyx_L1_error)

    /* "petsc4py/PETSc/petscis.pxi":147
 *         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(18, 147, __pyx_L1_error)

    /* "petsc4py/PETSc/petscis.pxi":148
 *             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":145
 * 
 *     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":149
 *             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":144
 *     #
 * 
 *     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":151
 *         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":152
 * 
 *     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":153
 *     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":154
 *         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(18, 154, __pyx_L1_error)

    /* "petsc4py/PETSc/petscis.pxi":155
 *             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":156
 *             CHKERR(ISRestoreIndices(self.iset, &self.data))
 *             self.hasarray = 0
 *             self.data = NULL             # <<<<<<<<<<<<<<
 *         return 0
 * 
*/
    __pyx_v_self->data = NULL;

    /* "petsc4py/PETSc/petscis.pxi":152
 * 
 *     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":157
 *             self.hasarray = 0
 *             self.data = NULL
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     # buffer interface (PEP 3118)
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscis.pxi":151
 *         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":161
 *     # buffer interface (PEP 3118)
 * 
 *     cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1:             # <<<<<<<<<<<<<<
 *         self.acquire()
 *         PyPetscBuffer_FillInfo(view, <void*>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", 0);

  /* "petsc4py/PETSc/petscis.pxi":162
 * 
 *     cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1:
 *         self.acquire()             # <<<<<<<<<<<<<<
 *         PyPetscBuffer_FillInfo(view, <void*>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(18, 162, __pyx_L1_error)

  /* "petsc4py/PETSc/petscis.pxi":163
 *     cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1:
 *         self.acquire()
 *         PyPetscBuffer_FillInfo(view, <void*>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(18, 163, __pyx_L1_error)

  /* "petsc4py/PETSc/petscis.pxi":165
 *         PyPetscBuffer_FillInfo(view, <void*>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":166
 *                                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":161
 *     # buffer interface (PEP 3118)
 * 
 *     cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1:             # <<<<<<<<<<<<<<
 *         self.acquire()
 *         PyPetscBuffer_FillInfo(view, <void*>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":168
 *         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":169
 * 
 *     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":170
 *     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(18, 170, __pyx_L1_error)

  /* "petsc4py/PETSc/petscis.pxi":171
 *         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":168
 *         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":173
 *         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":174
 * 
 *     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(18, 174, __pyx_L1_error)

  /* "petsc4py/PETSc/petscis.pxi":173
 *         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":176
 *         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":177
 * 
 *     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(18, 177, __pyx_L1_error)

  /* "petsc4py/PETSc/petscis.pxi":176
 *         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":181
 *     # '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", 0);

  /* "petsc4py/PETSc/petscis.pxi":182
 * 
 *     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(18, 182, __pyx_L1_error)

  /* "petsc4py/PETSc/petscis.pxi":183
 *     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(18, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscis.pxi":181
 *     # '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":185
 *         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", 0);

  /* "petsc4py/PETSc/petscis.pxi":186
 * 
 *     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(18, 186, __pyx_L1_error)

  /* "petsc4py/PETSc/petscis.pxi":187
 *     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":185
 *         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":189
 *         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:189");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_10_IS_buffer_9__enter__ = {"__enter__", (PyCFunction)(void(*)(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__};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__enter__", __pyx_kwds); 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__", 0);

  /* "petsc4py/PETSc/petscis.pxi":190
 * 
 *     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(18, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscis.pxi":189
 *         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":192
 *         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:192");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_10_IS_buffer_11__exit__ = {"__exit__", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_10_IS_buffer_11__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10_IS_buffer_10__exit__};
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_SIZE
  __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);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__exit__", __pyx_kwds); 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__", 0);

  /* "petsc4py/PETSc/petscis.pxi":193
 * 
 *     def __exit__(self, *exc):
 *         return self.exit()             # <<<<<<<<<<<<<<
 * 
 *     # NumPy array 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(18, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscis.pxi":192
 *         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":198
 * 
 *     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__", 0);

  /* "petsc4py/PETSc/petscis.pxi":199
 *     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":200
 *         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":201
 *             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(18, 201, __pyx_L1_error)

    /* "petsc4py/PETSc/petscis.pxi":200
 *         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":202
 *             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(18, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_size = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscis.pxi":203
 *                 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(18, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscis.pxi":204
 *             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_mstate_global->__pyx_n_u_kind); if (unlikely(!__pyx_t_3)) __PYX_ERR(18, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_descr), __pyx_mstate_global->__pyx_n_u_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 204, __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) != (0)) __PYX_ERR(18, 204, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(18, 204, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_c_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 204, __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":205
 *             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(18, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_version, __pyx_mstate_global->__pyx_int_3) < (0)) __PYX_ERR(18, 205, __pyx_L1_error)

  /* "petsc4py/PETSc/petscis.pxi":206
 *             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_mstate_global->__pyx_n_u_data, ((PyObject *)__pyx_v_self)) < (0)) __PYX_ERR(18, 205, __pyx_L1_error)

  /* "petsc4py/PETSc/petscis.pxi":207
 *             return dict(version=3,
 *                         data=self,
 *                         shape=(size,),             # <<<<<<<<<<<<<<
 *                         typestr=typestr)
 * 
*/
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(18, 207, __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) != (0)) __PYX_ERR(18, 207, __pyx_L1_error);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_shape, __pyx_t_5) < (0)) __PYX_ERR(18, 205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/petscis.pxi":208
 *                         data=self,
 *                         shape=(size,),
 *                         typestr=typestr)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_typestr, __pyx_v_typestr) < (0)) __PYX_ERR(18, 205, __pyx_L1_error)
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscis.pxi":198
 * 
 *     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":223
 * # --------------------------------------------------------------------
 * 
 * cdef inline Vec ref_Vec(PetscVec vec):             # <<<<<<<<<<<<<<
 *     cdef Vec ob = <Vec> 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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ref_Vec", 0);

  /* "petsc4py/PETSc/petscvec.pxi":224
 * 
 * cdef inline Vec ref_Vec(PetscVec vec):
 *     cdef Vec ob = <Vec> Vec()             # <<<<<<<<<<<<<<
 *     ob.vec = vec
 *     CHKERR(PetscINCREF(ob.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 224, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_t_2 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ob = ((struct PyPetscVecObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":225
 * cdef inline Vec ref_Vec(PetscVec vec):
 *     cdef Vec ob = <Vec> Vec()
 *     ob.vec = vec             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(ob.obj))
 *     return ob
*/
  __pyx_v_ob->vec = __pyx_v_vec;

  /* "petsc4py/PETSc/petscvec.pxi":226
 *     cdef Vec ob = <Vec> Vec()
 *     ob.vec = vec
 *     CHKERR(PetscINCREF(ob.obj))             # <<<<<<<<<<<<<<
 *     return ob
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(3, 226, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":227
 *     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":223
 * # --------------------------------------------------------------------
 * 
 * cdef inline Vec ref_Vec(PetscVec vec):             # <<<<<<<<<<<<<<
 *     cdef Vec ob = <Vec> 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":233
 * # 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;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("vec_pos", 0);

  /* "petsc4py/PETSc/petscvec.pxi":234
 * 
 * cdef Vec vec_pos(Vec self):
 *     cdef Vec vec = type(self)()             # <<<<<<<<<<<<<<
 *     CHKERR(VecDuplicate(self.vec, &vec.vec))
 *     CHKERR(VecCopy(self.vec, vec.vec))
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(3, 234, __pyx_L1_error)
  __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":235
 * 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(3, 235, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":236
 *     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(3, 236, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":237
 *     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":233
 * # 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":239
 *     return vec
 * 
 * cdef Vec vec_neg(Vec self):             # <<<<<<<<<<<<<<
 *     cdef Vec 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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":240
 * 
 * cdef Vec vec_neg(Vec self):
 *     cdef Vec 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(3, 240, __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":241
 * cdef Vec vec_neg(Vec self):
 *     cdef Vec 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(3, 241, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":242
 *     cdef Vec 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":239
 *     return vec
 * 
 * cdef Vec vec_neg(Vec self):             # <<<<<<<<<<<<<<
 *     cdef Vec 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":244
 *     return vec
 * 
 * cdef Vec vec_abs(Vec self):             # <<<<<<<<<<<<<<
 *     cdef Vec 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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":245
 * 
 * cdef Vec vec_abs(Vec self):
 *     cdef Vec 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(3, 245, __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":246
 * cdef Vec vec_abs(Vec self):
 *     cdef Vec 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(3, 246, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":247
 *     cdef Vec 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":244
 *     return vec
 * 
 * cdef Vec vec_abs(Vec self):             # <<<<<<<<<<<<<<
 *     cdef Vec 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":251
 * # 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":252
 * 
 * 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":254
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscvec.pxi":255
 *     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;
    __pyx_t_2 = __pyx_v_other;
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(3, 255, __pyx_L1_error)
    __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscvec.pxi":256
 *     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(3, 256, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":254
 *     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":257
 *         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":258
 *         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(3, 258, __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_INCREF(__pyx_t_2);
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_5);
      } else {
        __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 258, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 258, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
      }
      #else
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 258, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 258, __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(3, 258, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(3, 258, __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(3, 258, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(3, 258, __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":259
 *     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_CHECK_FLOAT_EXCEPTION(__pyx_t_8, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(3, 259, __pyx_L1_error)
    __pyx_v_alpha = __pyx_t_8;

    /* "petsc4py/PETSc/petscvec.pxi":260
 *         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(3, 260, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":257
 *         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":262
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_8, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(3, 262, __pyx_L1_error)
    __pyx_v_alpha = __pyx_t_8;

    /* "petsc4py/PETSc/petscvec.pxi":263
 *     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(3, 263, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/petscvec.pxi":264
 *         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":251
 * # 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":266
 *     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":267
 * 
 * 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":269
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscvec.pxi":270
 *     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;
    __pyx_t_2 = __pyx_v_other;
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(3, 270, __pyx_L1_error)
    __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscvec.pxi":271
 *     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(3, 271, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":269
 *     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":272
 *         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":273
 *         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(3, 273, __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_INCREF(__pyx_t_2);
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_5);
      } else {
        __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 273, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 273, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
      }
      #else
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 273, __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(3, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(3, 273, __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(3, 273, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(3, 273, __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":274
 *     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_CHECK_FLOAT_EXCEPTION(__pyx_t_8, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(3, 274, __pyx_L1_error)
    __pyx_v_alpha = __pyx_t_8;

    /* "petsc4py/PETSc/petscvec.pxi":275
 *         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(3, 275, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":272
 *         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":277
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_8, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(3, 277, __pyx_L1_error)
    __pyx_v_alpha = __pyx_t_8;

    /* "petsc4py/PETSc/petscvec.pxi":278
 *     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(3, 278, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/petscvec.pxi":279
 *         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":266
 *     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":281
 *     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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":282
 * 
 * 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":284
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscvec.pxi":285
 *     cdef Vec vec
 *     if isinstance(other, Vec):
 *         vec = other             # <<<<<<<<<<<<<<
 *         CHKERR(VecPointwiseMult(self.vec, self.vec, vec.vec))
 *     else:
*/
    __pyx_t_2 = __pyx_v_other;
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(3, 285, __pyx_L1_error)
    __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscvec.pxi":286
 *     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(3, 286, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":284
 *     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":288
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_4, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(3, 288, __pyx_L1_error)
    __pyx_v_alpha = __pyx_t_4;

    /* "petsc4py/PETSc/petscvec.pxi":289
 *     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(3, 289, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/petscvec.pxi":290
 *         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":281
 *     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":292
 *     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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":293
 * 
 * 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":294
 * 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":296
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscvec.pxi":297
 *     cdef Vec vec
 *     if isinstance(other, Vec):
 *         vec = other             # <<<<<<<<<<<<<<
 *         CHKERR(VecPointwiseDivide(self.vec, self.vec, vec.vec))
 *     else:
*/
    __pyx_t_2 = __pyx_v_other;
    __Pyx_INCREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(3, 297, __pyx_L1_error)
    __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscvec.pxi":298
 *     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(3, 298, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":296
 *     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":300
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_4, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(3, 300, __pyx_L1_error)
    __pyx_v_alpha = __pyx_t_4;

    /* "petsc4py/PETSc/petscvec.pxi":301
 *     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(3, 301, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/petscvec.pxi":302
 *         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":292
 *     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":306
 * # 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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":307
 * 
 * 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(3, 307, __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(3, 307, __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":306
 * # 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":309
 *     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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":310
 * 
 * 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(3, 310, __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(3, 310, __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":309
 *     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":312
 *     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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":313
 * 
 * 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(3, 313, __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(3, 313, __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":312
 *     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":315
 *     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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":316
 * 
 * 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(3, 316, __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(3, 316, __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":315
 *     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":318
 *     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;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("vec_matmul", 0);

  /* "petsc4py/PETSc/petscvec.pxi":319
 * 
 * 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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscvec.pxi":320
 * 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 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_other};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dot, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 320, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "petsc4py/PETSc/petscvec.pxi":319
 * 
 * cdef object vec_matmul(Vec self, other):
 *     if isinstance(other, Vec):             # <<<<<<<<<<<<<<
 *         return self.dot(other)
 *     if isinstance(other, Mat):
*/
  }

  /* "petsc4py/PETSc/petscvec.pxi":321
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscvec.pxi":322
 *         return self.dot(other)
 *     if isinstance(other, Mat):
 *         result = other.createVecRight()             # <<<<<<<<<<<<<<
 *         other.multTranspose(self, result)
 *         return result
*/
    __pyx_t_3 = __pyx_v_other;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_createVecRight, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __pyx_v_result = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscvec.pxi":323
 *     if isinstance(other, Mat):
 *         result = other.createVecRight()
 *         other.multTranspose(self, result)             # <<<<<<<<<<<<<<
 *         return result
 *     return NotImplemented
*/
    __pyx_t_3 = __pyx_v_other;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_result};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_multTranspose, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscvec.pxi":324
 *         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":321
 *     if isinstance(other, Vec):
 *         return self.dot(other)
 *     if isinstance(other, Mat):             # <<<<<<<<<<<<<<
 *         result = other.createVecRight()
 *         other.multTranspose(self, result)
*/
  }

  /* "petsc4py/PETSc/petscvec.pxi":325
 *         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":318
 *     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_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":329
 * # 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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":330
 * 
 * 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(3, 330, __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":329
 * # 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":332
 *     return vec_add(self, other)
 * 
 * cdef Vec vec_rsub(Vec self, other):             # <<<<<<<<<<<<<<
 *     cdef Vec 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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":333
 * 
 * cdef Vec vec_rsub(Vec self, other):
 *     cdef Vec 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(3, 333, __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":334
 * cdef Vec vec_rsub(Vec self, other):
 *     cdef Vec 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(3, 334, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":335
 *     cdef Vec 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":332
 *     return vec_add(self, other)
 * 
 * cdef Vec vec_rsub(Vec self, other):             # <<<<<<<<<<<<<<
 *     cdef Vec 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":337
 *     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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":338
 * 
 * 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(3, 338, __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":337
 *     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":340
 *     return vec_mul(self, other)
 * 
 * cdef Vec vec_rdiv(Vec self, other):             # <<<<<<<<<<<<<<
 *     cdef Vec 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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":341
 * 
 * cdef Vec vec_rdiv(Vec self, other):
 *     cdef Vec 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(3, 341, __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":342
 * cdef Vec vec_rdiv(Vec self, other):
 *     cdef Vec 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(3, 342, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":343
 *     cdef Vec 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":340
 *     return vec_mul(self, other)
 * 
 * cdef Vec vec_rdiv(Vec self, other):             # <<<<<<<<<<<<<<
 *     cdef Vec 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":347
 * # --------------------------------------------------------------------
 * 
 * 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":349
 * 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(3, 349, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":350
 *                           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":347
 * # --------------------------------------------------------------------
 * 
 * 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":358
 *                                         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":359
 * 
 * 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":360
 * 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":361
 *     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":362
 *     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":363
 *     elif blocked:         setvalues = VecSetValuesBlocked
 *     elif local:           setvalues = VecSetValuesLocal
 *     else:                 setvalues = VecSetValues             # <<<<<<<<<<<<<<
 *     return setvalues
 * 
*/
  /*else*/ {
    __pyx_v_setvalues = VecSetValues;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/petscvec.pxi":364
 *     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":358
 *                                         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":366
 *     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_unused1 = 0;
  CYTHON_UNUSED PyObject *__pyx_v_unused2 = 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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9[6];
  size_t __pyx_t_10;
  __pyx_t_8petsc4py_5PETSc_VecSetValuesFcn *__pyx_t_11;
  InsertMode __pyx_t_12;
  PetscErrorCode __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("vecsetvalues", 0);

  /* "petsc4py/PETSc/petscvec.pxi":370
 *                              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":371
 *     # 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":372
 *     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(3, 372, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":373
 *     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":371
 *     # block size
 *     cdef PetscInt bs=1
 *     if blocked:             # <<<<<<<<<<<<<<
 *         CHKERR(VecGetBlockSize(V, &bs))
 *         if bs < 1: bs = 1
*/
  }

  /* "petsc4py/PETSc/petscvec.pxi":375
 *         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":376
 *     # indices and values
 *     cdef PetscInt ni=0, nv=0
 *     cdef PetscInt *i=NULL             # <<<<<<<<<<<<<<
 *     cdef PetscScalar *v=NULL
 *     cdef object unused1 = iarray_i(oi, &ni, &i)
*/
  __pyx_v_i = NULL;

  /* "petsc4py/PETSc/petscvec.pxi":377
 *     cdef PetscInt ni=0, nv=0
 *     cdef PetscInt *i=NULL
 *     cdef PetscScalar *v=NULL             # <<<<<<<<<<<<<<
 *     cdef object unused1 = iarray_i(oi, &ni, &i)
 *     cdef object unused2 = iarray_s(ov, &nv, &v)
*/
  __pyx_v_v = NULL;

  /* "petsc4py/PETSc/petscvec.pxi":378
 *     cdef PetscInt *i=NULL
 *     cdef PetscScalar *v=NULL
 *     cdef object unused1 = iarray_i(oi, &ni, &i)             # <<<<<<<<<<<<<<
 *     cdef object unused2 = 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(3, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_unused1 = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":379
 *     cdef PetscScalar *v=NULL
 *     cdef object unused1 = iarray_i(oi, &ni, &i)
 *     cdef object unused2 = 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(3, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_unused2 = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":380
 *     cdef object unused1 = iarray_i(oi, &ni, &i)
 *     cdef object unused2 = 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)) {
    __pyx_t_4 = NULL;

    /* "petsc4py/PETSc/petscvec.pxi":382
 *     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_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_incompatible_array_sizes_ni;
    __pyx_t_9[1] = __pyx_t_6;
    __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u_nv;
    __pyx_t_9[3] = __pyx_t_7;
    __pyx_t_9[4] = __pyx_mstate_global->__pyx_kp_u_bs;
    __pyx_t_9[5] = __pyx_t_8;

    /* "petsc4py/PETSc/petscvec.pxi":381
 *     cdef object unused2 = 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_PyUnicode_Join(__pyx_t_9, 6, 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 5 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8));
    if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __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;
    __pyx_t_10 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 380, __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(3, 380, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":380
 *     cdef object unused1 = iarray_i(oi, &ni, &i)
 *     cdef object unused2 = 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)))
*/
  }

  /* "petsc4py/PETSc/petscvec.pxi":384
 *         (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_11 = __pyx_f_8petsc4py_5PETSc_vecsetvalues_fcn(__pyx_v_blocked, __pyx_v_local); if (unlikely(__pyx_t_11 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(3, 384, __pyx_L1_error)
  __pyx_v_setvalues = __pyx_t_11;

  /* "petsc4py/PETSc/petscvec.pxi":385
 *     # 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_12 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oim); if (unlikely(__pyx_t_12 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(3, 385, __pyx_L1_error)
  __pyx_v_addv = __pyx_t_12;

  /* "petsc4py/PETSc/petscvec.pxi":387
 *     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(3, 387, __pyx_L1_error)
  __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_2); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(3, 387, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":388
 *     # 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":366
 *     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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("petsc4py.PETSc.vecsetvalues", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused1);
  __Pyx_XDECREF(__pyx_v_unused2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/petscvec.pxi":390
 *     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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7[4];
  size_t __pyx_t_8;
  PetscErrorCode __pyx_t_9;
  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":391
 * 
 * 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":392
 * 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":393
 *     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":394
 *     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(3, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_indices = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":395
 *     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":396
 *     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(3, 396, __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":397
 *     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_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 397, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_values, __pyx_mstate_global->__pyx_n_u_shape, __pyx_t_1) < (0)) __PYX_ERR(3, 397, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "petsc4py/PETSc/petscvec.pxi":395
 *     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":398
 *         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(3, 398, __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":399
 *         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)) {
    __pyx_t_3 = NULL;

    /* "petsc4py/PETSc/petscvec.pxi":401
 *     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_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_4), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_4), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_incompatible_array_sizes_ni;
    __pyx_t_7[1] = __pyx_t_5;
    __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_nv;
    __pyx_t_7[3] = __pyx_t_6;

    /* "petsc4py/PETSc/petscvec.pxi":400
 *     values = oarray_s(values, &nv, &v)
 *     if (ni != nv): raise ValueError(
 *         ("incompatible array sizes: "             # <<<<<<<<<<<<<<
 *          "ni=%d, nv=%d") % (toInt(ni), toInt(nv)))
 *     CHKERR(VecGetValues(vec, ni, i, v))
*/
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_7, 4, 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
    if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 399, __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(3, 399, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":399
 *         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)))
*/
  }

  /* "petsc4py/PETSc/petscvec.pxi":402
 *         ("incompatible array sizes: "
 *          "ni=%d, nv=%d") % (toInt(ni), toInt(nv)))
 *     CHKERR(VecGetValues(vec, ni, i, v))             # <<<<<<<<<<<<<<
 *     return values
 * 
*/
  __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetValues(__pyx_v_vec, __pyx_v_ni, __pyx_v_i, __pyx_v_v)); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(3, 402, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":403
 *          "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":390
 *     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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":407
 * # --------------------------------------------------------------------
 * 
 * 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("vec_getbuffer_r", 0);

  /* "petsc4py/PETSc/petscvec.pxi":408
 * 
 * cdef inline _Vec_buffer vec_getbuffer_r(Vec self):
 *     cdef _Vec_buffer buf = _Vec_buffer(self)             # <<<<<<<<<<<<<<
 *     buf.readonly = 1
 *     return buf
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 408, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":409
 * 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":410
 *     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":407
 * # --------------------------------------------------------------------
 * 
 * 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_XDECREF(__pyx_t_2);
  __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":412
 *     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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("vec_getbuffer_w", 0);

  /* "petsc4py/PETSc/petscvec.pxi":413
 * 
 * cdef inline _Vec_buffer vec_getbuffer_w(Vec self):
 *     cdef _Vec_buffer buf = _Vec_buffer(self)             # <<<<<<<<<<<<<<
 *     buf.readonly = 0
 *     return buf
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 413, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":414
 * 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":415
 *     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":412
 *     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_XDECREF(__pyx_t_2);
  __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":417
 *     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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":418
 * 
 * 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(3, 418, __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(3, 418, __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":417
 *     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":420
 *     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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":421
 * 
 * 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(3, 421, __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(3, 421, __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":420
 *     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":423
 *     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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9[4];
  size_t __pyx_t_10;
  PetscInt __pyx_t_11;
  int __pyx_t_12;
  int __pyx_t_13;
  char const *__pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("vec_setarray", 0);

  /* "petsc4py/PETSc/petscvec.pxi":424
 * 
 * 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":425
 * 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":426
 *     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(3, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ary = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":427
 *     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(3, 427, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":428
 *     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)) {
    __pyx_t_5 = NULL;

    /* "petsc4py/PETSc/petscvec.pxi":430
 *     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_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_6), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_6), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_array_size;
    __pyx_t_9[1] = __pyx_t_7;
    __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u_incompatible_with_vector_local;
    __pyx_t_9[3] = __pyx_t_8;

    /* "petsc4py/PETSc/petscvec.pxi":429
 *     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_6 = __Pyx_PyUnicode_Join(__pyx_t_9, 4, 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 37 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8));
    if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_10 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 428, __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(3, 428, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":428
 *     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)))
*/
  }

  /* "petsc4py/PETSc/petscvec.pxi":431
 *         "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(3, 431, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":432
 *         (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":433
 *     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":434
 *     try:
 *         if PyArray_NDIM(ary) == 0:
 *             for i from 0 <= i < nv:             # <<<<<<<<<<<<<<
 *                 vv[i] = va[0]
 *         else:
*/
      __pyx_t_11 = __pyx_v_nv;
      for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

        /* "petsc4py/PETSc/petscvec.pxi":435
 *         if PyArray_NDIM(ary) == 0:
 *             for i from 0 <= i < nv:
 *                 vv[i] = va[0]             # <<<<<<<<<<<<<<
 *         else:
 *             CHKERR(PetscMemcpy(vv, va, <size_t>nv*sizeof(PetscScalar)))
*/
        (__pyx_v_vv[__pyx_v_i]) = (__pyx_v_va[0]);
      }

      /* "petsc4py/PETSc/petscvec.pxi":433
 *     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":437
 *                 vv[i] = va[0]
 *         else:
 *             CHKERR(PetscMemcpy(vv, va, <size_t>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(3, 437, __pyx_L7_error)
    }
    __pyx_L9:;
  }

  /* "petsc4py/PETSc/petscvec.pxi":439
 *             CHKERR(PetscMemcpy(vv, va, <size_t>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(3, 439, __pyx_L1_error)
      goto __pyx_L8;
    }
    __pyx_L7_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 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;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
      if ( unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __Pyx_XGOTREF(__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_20);
      __pyx_t_12 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __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(3, 439, __pyx_L13_error)
      }
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_XGIVEREF(__pyx_t_17);
      __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
      __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
      goto __pyx_L1_error;
      __pyx_L13_error:;
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_XGIVEREF(__pyx_t_20);
      __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20);
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L8:;
  }

  /* "petsc4py/PETSc/petscvec.pxi":440
 *     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":423
 *     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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __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":442
 *     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;
  size_t __pyx_t_6;
  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_getitem", 0);
  __Pyx_INCREF(__pyx_v_i);

  /* "petsc4py/PETSc/petscvec.pxi":443
 * 
 * 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":444
 * 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":445
 *     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(3, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "petsc4py/PETSc/petscvec.pxi":444
 * 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":446
 *     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":447
 *         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(3, 447, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":448
 *     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_v_i;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_indices, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 448, __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 != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(3, 448, __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_INCREF(__pyx_t_5);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_7);
      } else {
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 448, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 448, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 448, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
      }
      #else
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 448, __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_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 448, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      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(3, 448, __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(3, 448, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __pyx_v_start = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_stop = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_stride = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "petsc4py/PETSc/petscvec.pxi":449
 *         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(3, 449, __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":446
 *     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":450
 *         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(3, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscvec.pxi":442
 *     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_7);
  __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":452
 *     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;
  size_t __pyx_t_7;
  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;
  __Pyx_RefNannySetupContext("vec_setitem", 0);
  __Pyx_INCREF(__pyx_v_i);

  /* "petsc4py/PETSc/petscvec.pxi":453
 * 
 * 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":454
 * 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":455
 *     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(3, 455, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "petsc4py/PETSc/petscvec.pxi":454
 * 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":456
 *     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":457
 *         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(3, 457, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":458
 *     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_v_i;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_indices, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    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(3, 458, __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_INCREF(__pyx_t_6);
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_8);
      } else {
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 458, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 458, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 458, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
      }
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
      index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 2; __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), 3) < (0)) __PYX_ERR(3, 458, __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(3, 458, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __pyx_v_start = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_v_stop = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_stride = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "petsc4py/PETSc/petscvec.pxi":459
 *         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(3, 459, __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":456
 *     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":460
 *         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(3, 460, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":461
 *         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":452
 *     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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __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":463
 *     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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":464
 * 
 * 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(3, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ctx0 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":465
 * 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":466
 *     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":467
 *     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":468
 *     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":469
 *     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":470
 *     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":471
 *     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":472
 *     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(<PetscInt>ndim), NULL, <void**>&shape_arr)
*/
  __pyx_v_mtype = PETSC_MEMTYPE_HOST;

  /* "petsc4py/PETSc/petscvec.pxi":473
 *     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(<PetscInt>ndim), NULL, <void**>&shape_arr)
 *         s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&strides_arr)
*/
  __pyx_t_2 = (__pyx_v_ctx0 == Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/petscvec.pxi":474
 *     cdef PetscMemType mtype = PETSC_MEMTYPE_HOST
 *     if ctx0 is None: # First time in, create a linear memory view
 *         s1 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&shape_arr)             # <<<<<<<<<<<<<<
 *         s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&strides_arr)
 *         CHKERR(VecGetLocalSize(self.vec, &n))
*/
    __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_ndim))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 474, __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(3, 474, __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":475
 *     if ctx0 is None: # First time in, create a linear memory view
 *         s1 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&shape_arr)
 *         s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&strides_arr)             # <<<<<<<<<<<<<<
 *         CHKERR(VecGetLocalSize(self.vec, &n))
 *         shape_arr[0] = <int64_t>n
*/
    __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_ndim))); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 475, __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(3, 475, __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":476
 *         s1 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&shape_arr)
 *         s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&strides_arr)
 *         CHKERR(VecGetLocalSize(self.vec, &n))             # <<<<<<<<<<<<<<
 *         shape_arr[0] = <int64_t>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(3, 476, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":477
 *         s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&strides_arr)
 *         CHKERR(VecGetLocalSize(self.vec, &n))
 *         shape_arr[0] = <int64_t>n             # <<<<<<<<<<<<<<
 *         strides_arr[0] = 1
 *     else:
*/
    (__pyx_v_shape_arr[0]) = ((int64_t)__pyx_v_n);

    /* "petsc4py/PETSc/petscvec.pxi":478
 *         CHKERR(VecGetLocalSize(self.vec, &n))
 *         shape_arr[0] = <int64_t>n
 *         strides_arr[0] = 1             # <<<<<<<<<<<<<<
 *     else:
 *         (_, _, ndim, s1, s2) = ctx0
*/
    (__pyx_v_strides_arr[0]) = 1;

    /* "petsc4py/PETSc/petscvec.pxi":473
 *     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(<PetscInt>ndim), NULL, <void**>&shape_arr)
 *         s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&strides_arr)
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/petscvec.pxi":480
 *         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(3, 480, __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_INCREF(__pyx_t_1);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3);
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 4);
        __Pyx_INCREF(__pyx_t_7);
      } else {
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 480, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 480, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 480, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 480, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 4, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 480, __pyx_L1_error)
        __Pyx_XGOTREF(__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 = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(3, 480, __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(3, 480, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(3, 480, __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(3, 480, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_t_10 = __Pyx_PyLong_As_int64_t(__pyx_t_5); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(3, 480, __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":482
 *         (_, _, 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(3, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_PyLong_From_PetscMemType(PETSC_MEMTYPE_HOST); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_7, __pyx_t_6, __pyx_t_5) < (0)) __PYX_ERR(3, 482, __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_PyLong_From_PetscMemType(PETSC_MEMTYPE_CUDA); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyLong_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCUDA); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_7, __pyx_t_5, __pyx_t_6) < (0)) __PYX_ERR(3, 482, __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_PyLong_From_PetscMemType(PETSC_MEMTYPE_HIP); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLROCM); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_7, __pyx_t_6, __pyx_t_5) < (0)) __PYX_ERR(3, 482, __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":483
 * 
 *     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(3, 483, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":484
 *     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(<PetscObject>self.vec, &devId))
*/
  __pyx_t_7 = __Pyx_PyLong_From_PetscMemType(__pyx_v_mtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_PyLong_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 484, __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(3, 484, __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":485
 *     CHKERR(VecGetCurrentMemType(self.vec, &mtype))
 *     dtype = devType_.get(mtype, kDLCPU)
 *     if dtype != kDLCPU:             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetDeviceId(<PetscObject>self.vec, &devId))
 *     ctx0 = (dtype, devId, ndim, s1, s2)
*/
  __pyx_t_6 = __Pyx_PyLong_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 485, __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(3, 485, __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(3, 485, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/petscvec.pxi":486
 *     dtype = devType_.get(mtype, kDLCPU)
 *     if dtype != kDLCPU:
 *         CHKERR(PetscObjectGetDeviceId(<PetscObject>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(3, 486, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":485
 *     CHKERR(VecGetCurrentMemType(self.vec, &mtype))
 *     dtype = devType_.get(mtype, kDLCPU)
 *     if dtype != kDLCPU:             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetDeviceId(<PetscObject>self.vec, &devId))
 *     ctx0 = (dtype, devId, ndim, s1, s2)
*/
  }

  /* "petsc4py/PETSc/petscvec.pxi":487
 *     if dtype != kDLCPU:
 *         CHKERR(PetscObjectGetDeviceId(<PetscObject>self.vec, &devId))
 *     ctx0 = (dtype, devId, ndim, s1, s2)             # <<<<<<<<<<<<<<
 *     self.set_attr('__dltensor_ctx__', ctx0)
 *     return ctx0
*/
  __pyx_t_5 = __Pyx_PyLong_From_PetscInt(__pyx_v_devId); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyLong_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 487, __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) != (0)) __PYX_ERR(3, 487, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5) != (0)) __PYX_ERR(3, 487, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6) != (0)) __PYX_ERR(3, 487, __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) != (0)) __PYX_ERR(3, 487, __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) != (0)) __PYX_ERR(3, 487, __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":488
 *         CHKERR(PetscObjectGetDeviceId(<PetscObject>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(3, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":489
 *     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":463
 *     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":493
 * # --------------------------------------------------------------------
 * 
 * cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil:             # <<<<<<<<<<<<<<
 *     if ro: CHKERR(VecGetArrayRead(v, <const PetscScalar**>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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "petsc4py/PETSc/petscvec.pxi":494
 * 
 * cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil:
 *     if ro: CHKERR(VecGetArrayRead(v, <const PetscScalar**>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(3, 494, __pyx_L1_error)
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/petscvec.pxi":495
 * cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil:
 *     if ro: CHKERR(VecGetArrayRead(v, <const PetscScalar**>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(3, 495, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/petscvec.pxi":496
 *     if ro: CHKERR(VecGetArrayRead(v, <const PetscScalar**>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":493
 * # --------------------------------------------------------------------
 * 
 * cdef int Vec_AcquireArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil:             # <<<<<<<<<<<<<<
 *     if ro: CHKERR(VecGetArrayRead(v, <const PetscScalar**>a))
 *     else:  CHKERR(VecGetArray(v, a))
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("petsc4py.PETSc.Vec_AcquireArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/petscvec.pxi":498
 *     return 0
 * 
 * cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil:             # <<<<<<<<<<<<<<
 *     if ro: CHKERR(VecRestoreArrayRead(v, <const PetscScalar**>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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "petsc4py/PETSc/petscvec.pxi":499
 * 
 * cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil:
 *     if ro: CHKERR(VecRestoreArrayRead(v, <const PetscScalar**>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(3, 499, __pyx_L1_error)
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/petscvec.pxi":500
 * cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil:
 *     if ro: CHKERR(VecRestoreArrayRead(v, <const PetscScalar**>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(3, 500, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/petscvec.pxi":501
 *     if ro: CHKERR(VecRestoreArrayRead(v, <const PetscScalar**>a))
 *     else:  CHKERR(VecRestoreArray(v, a))
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * cdef class _Vec_buffer:
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscvec.pxi":498
 *     return 0
 * 
 * cdef int Vec_ReleaseArray(PetscVec v, PetscScalar *a[], int ro) except -1 nogil:             # <<<<<<<<<<<<<<
 *     if ro: CHKERR(VecRestoreArrayRead(v, <const PetscScalar**>a))
 *     else:  CHKERR(VecRestoreArray(v, a))
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("petsc4py.PETSc.Vec_ReleaseArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/petscvec.pxi":511
 *     cdef bint hasarray
 * 
 *     def __cinit__(self, Vec vec, bint readonly=0):             # <<<<<<<<<<<<<<
 *         cdef PetscVec v = vec.vec
 *         CHKERR(PetscINCREF(<PetscObject*>&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_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,&__pyx_mstate_global->__pyx_n_u_readonly,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(3, 511, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 511, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 511, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(3, 511, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, i); __PYX_ERR(3, 511, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(3, 511, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 511, __pyx_L3_error)
        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(3, 511, __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(3, 511, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(3, 511, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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":512
 * 
 *     def __cinit__(self, Vec vec, bint readonly=0):
 *         cdef PetscVec v = vec.vec             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(<PetscObject*>&v))
 *         self.vec = v
*/
  __pyx_t_1 = __pyx_v_vec->vec;
  __pyx_v_v = __pyx_t_1;

  /* "petsc4py/PETSc/petscvec.pxi":513
 *     def __cinit__(self, Vec vec, bint readonly=0):
 *         cdef PetscVec v = vec.vec
 *         CHKERR(PetscINCREF(<PetscObject*>&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(3, 513, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":514
 *         cdef PetscVec v = vec.vec
 *         CHKERR(PetscINCREF(<PetscObject*>&v))
 *         self.vec = v             # <<<<<<<<<<<<<<
 *         self.size = 0
 *         self.data = NULL
*/
  __pyx_v_self->vec = __pyx_v_v;

  /* "petsc4py/PETSc/petscvec.pxi":515
 *         CHKERR(PetscINCREF(<PetscObject*>&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":516
 *         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":517
 *         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":518
 *         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":511
 *     cdef bint hasarray
 * 
 *     def __cinit__(self, Vec vec, bint readonly=0):             # <<<<<<<<<<<<<<
 *         cdef PetscVec v = vec.vec
 *         CHKERR(PetscINCREF(<PetscObject*>&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":520
 *         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":521
 * 
 *     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":522
 *     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(3, 522, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":521
 * 
 *     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":523
 *         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(3, 523, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":520
 *         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":527
 *     #
 * 
 *     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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "petsc4py/PETSc/petscvec.pxi":528
 * 
 *     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":529
 *     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(3, 529, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":530
 *         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(3, 530, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":531
 *             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":528
 * 
 *     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":532
 *             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":527
 *     #
 * 
 *     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:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.acquire", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/petscvec.pxi":534
 *         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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "petsc4py/PETSc/petscvec.pxi":535
 * 
 *     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":536
 *     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":537
 *         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(3, 537, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":538
 *             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":535
 * 
 *     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":539
 *             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":534
 *         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:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("petsc4py.PETSc._Vec_buffer.release", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/petscvec.pxi":543
 *     # buffer interface (PEP 3118)
 * 
 *     cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1:             # <<<<<<<<<<<<<<
 *         self.acquire()
 *         PyPetscBuffer_FillInfo(view, <void*>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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":544
 * 
 *     cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1:
 *         self.acquire()             # <<<<<<<<<<<<<<
 *         PyPetscBuffer_FillInfo(view, <void*>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(3, 544, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":545
 *     cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1:
 *         self.acquire()
 *         PyPetscBuffer_FillInfo(view, <void*>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(3, 545, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":547
 *         PyPetscBuffer_FillInfo(view, <void*>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":548
 *                                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":543
 *     # buffer interface (PEP 3118)
 * 
 *     cdef int acquirebuffer(self, Py_buffer *view, int flags) except -1:             # <<<<<<<<<<<<<<
 *         self.acquire()
 *         PyPetscBuffer_FillInfo(view, <void*>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":550
 *         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":551
 * 
 *     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":552
 *     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(3, 552, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":553
 *         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":550
 *         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":555
 *         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":556
 * 
 *     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(3, 556, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":555
 *         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":558
 *         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":559
 * 
 *     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(3, 559, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":558
 *         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":563
 *     # '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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":564
 * 
 *     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(3, 564, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":565
 *     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(3, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscvec.pxi":563
 *     # '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":567
 *         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", 0);

  /* "petsc4py/PETSc/petscvec.pxi":568
 * 
 *     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(3, 568, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":569
 *     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":567
 *         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":571
 *         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:571");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11_Vec_buffer_9__enter__ = {"__enter__", (PyCFunction)(void(*)(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__};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__enter__", __pyx_kwds); 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__", 0);

  /* "petsc4py/PETSc/petscvec.pxi":572
 * 
 *     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(3, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscvec.pxi":571
 *         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":574
 *         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:574");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11_Vec_buffer_11__exit__ = {"__exit__", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_11__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11_Vec_buffer_10__exit__};
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_SIZE
  __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);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__exit__", __pyx_kwds); 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__", 0);

  /* "petsc4py/PETSc/petscvec.pxi":575
 * 
 *     def __exit__(self, *exc):
 *         return self.exit()             # <<<<<<<<<<<<<<
 * 
 *     # NumPy array 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(3, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscvec.pxi":574
 *         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":580
 * 
 *     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__", 0);

  /* "petsc4py/PETSc/petscvec.pxi":581
 *     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":582
 *         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":583
 *             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(3, 583, __pyx_L1_error)

    /* "petsc4py/PETSc/petscvec.pxi":582
 *         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":584
 *             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(3, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_size = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":585
 *                 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(3, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":586
 *             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_mstate_global->__pyx_n_u_kind); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_descr), __pyx_mstate_global->__pyx_n_u_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 586, __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) != (0)) __PYX_ERR(3, 586, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(3, 586, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_c_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 586, __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":587
 *             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(3, 587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_version, __pyx_mstate_global->__pyx_int_3) < (0)) __PYX_ERR(3, 587, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":588
 *             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_mstate_global->__pyx_n_u_data, ((PyObject *)__pyx_v_self)) < (0)) __PYX_ERR(3, 587, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":589
 *             return dict(version=3,
 *                         data=self,
 *                         shape=(size,),             # <<<<<<<<<<<<<<
 *                         typestr=typestr)
 * 
*/
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 589, __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) != (0)) __PYX_ERR(3, 589, __pyx_L1_error);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_shape, __pyx_t_5) < (0)) __PYX_ERR(3, 587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":590
 *                         data=self,
 *                         shape=(size,),
 *                         typestr=typestr)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_typestr, __pyx_v_typestr) < (0)) __PYX_ERR(3, 587, __pyx_L1_error)
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscvec.pxi":580
 * 
 *     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":599
 *     cdef Vec lvec
 * 
 *     def __cinit__(self, Vec gvec):             # <<<<<<<<<<<<<<
 *         self.gvec = gvec
 *         self.lvec = Vec()
*/

/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_1__cinit__(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("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gvec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(3, 599, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 599, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(3, 599, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, i); __PYX_ERR(3, 599, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(3, 599, __pyx_L3_error)
    }
    __pyx_v_gvec = ((struct PyPetscVecObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 599, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc._Vec_LocalForm.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gvec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(3, 599, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm___cinit__(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8petsc4py_5PETSc_14_Vec_LocalForm___cinit__(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "petsc4py/PETSc/petscvec.pxi":600
 * 
 *     def __cinit__(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":601
 *     def __cinit__(self, Vec gvec):
 *         self.gvec = gvec
 *         self.lvec = Vec()             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 601, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __Pyx_GIVEREF((PyObject *)__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":599
 *     cdef Vec lvec
 * 
 *     def __cinit__(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_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc._Vec_LocalForm.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/petscvec.pxi":603
 *         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:603");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_14_Vec_LocalForm_3__enter__ = {"__enter__", (PyCFunction)(void(*)(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__};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__enter__", __pyx_kwds); 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__", 0);

  /* "petsc4py/PETSc/petscvec.pxi":604
 * 
 *     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":605
 *     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(3, 605, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":606
 *         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":603
 *         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":608
 *         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:608");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_14_Vec_LocalForm_5__exit__ = {"__exit__", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_5__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14_Vec_LocalForm_4__exit__};
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_SIZE
  __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);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__exit__", __pyx_kwds); 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__", 0);

  /* "petsc4py/PETSc/petscvec.pxi":609
 * 
 *     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":610
 *     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(3, 610, __pyx_L1_error)

  /* "petsc4py/PETSc/petscvec.pxi":611
 *         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":608
 *         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":569
 *     PetscErrorCode MatGetNearNullSpace(PetscMat, PetscNullSpace*)
 * 
 * cdef inline NullSpace ref_NullSpace(PetscNullSpace nsp):             # <<<<<<<<<<<<<<
 *     cdef NullSpace ob = <NullSpace> 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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ref_NullSpace", 0);

  /* "petsc4py/PETSc/petscmat.pxi":570
 * 
 * cdef inline NullSpace ref_NullSpace(PetscNullSpace nsp):
 *     cdef NullSpace ob = <NullSpace> NullSpace()             # <<<<<<<<<<<<<<
 *     ob.nsp = nsp
 *     CHKERR(PetscINCREF(ob.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 570, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_t_2 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ob = ((struct PyPetscNullSpaceObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":571
 * cdef inline NullSpace ref_NullSpace(PetscNullSpace nsp):
 *     cdef NullSpace ob = <NullSpace> NullSpace()
 *     ob.nsp = nsp             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(ob.obj))
 *     return ob
*/
  __pyx_v_ob->nsp = __pyx_v_nsp;

  /* "petsc4py/PETSc/petscmat.pxi":572
 *     cdef NullSpace ob = <NullSpace> NullSpace()
 *     ob.nsp = nsp
 *     CHKERR(PetscINCREF(ob.obj))             # <<<<<<<<<<<<<<
 *     return ob
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(19, 572, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":573
 *     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":569
 *     PetscErrorCode MatGetNearNullSpace(PetscMat, PetscNullSpace*)
 * 
 * cdef inline NullSpace ref_NullSpace(PetscNullSpace nsp):             # <<<<<<<<<<<<<<
 *     cdef NullSpace ob = <NullSpace> 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":575
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("NullSpace_Function", 0);

  /* "petsc4py/PETSc/petscmat.pxi":580
 *     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(19, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":581
 *    ) 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(19, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":582
 *     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(19, 582, __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(19, 582, __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_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 582, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 582, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 582, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 582, __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(19, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(19, 582, __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(19, 582, __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":583
 *     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(19, 583, __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)) != (0)) __PYX_ERR(19, 583, __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)) != (0)) __PYX_ERR(19, 583, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 583, __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(19, 583, __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(19, 583, __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(19, 583, __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(19, 583, __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(19, 583, __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":584
 *     (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":575
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscmat.pxi":588
 * # -----------------------------------------------------------------------------
 * 
 * cdef inline Mat ref_Mat(PetscMat mat):             # <<<<<<<<<<<<<<
 *     cdef Mat ob = <Mat> 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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ref_Mat", 0);

  /* "petsc4py/PETSc/petscmat.pxi":589
 * 
 * cdef inline Mat ref_Mat(PetscMat mat):
 *     cdef Mat ob = <Mat> Mat()             # <<<<<<<<<<<<<<
 *     ob.mat = mat
 *     CHKERR(PetscINCREF(ob.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 589, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_t_2 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ob = ((struct PyPetscMatObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":590
 * cdef inline Mat ref_Mat(PetscMat mat):
 *     cdef Mat ob = <Mat> Mat()
 *     ob.mat = mat             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(ob.obj))
 *     return ob
*/
  __pyx_v_ob->mat = __pyx_v_mat;

  /* "petsc4py/PETSc/petscmat.pxi":591
 *     cdef Mat ob = <Mat> Mat()
 *     ob.mat = mat
 *     CHKERR(PetscINCREF(ob.obj))             # <<<<<<<<<<<<<<
 *     return ob
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(19, 591, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":592
 *     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":588
 * # -----------------------------------------------------------------------------
 * 
 * cdef inline Mat ref_Mat(PetscMat mat):             # <<<<<<<<<<<<<<
 *     cdef Mat ob = <Mat> 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":598
 * # 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;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mat_pos", 0);

  /* "petsc4py/PETSc/petscmat.pxi":599
 * 
 * cdef Mat mat_pos(Mat self):
 *     cdef Mat mat = type(self)()             # <<<<<<<<<<<<<<
 *     CHKERR(MatDuplicate(self.mat, MAT_COPY_VALUES, &mat.mat))
 *     return mat
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(19, 599, __pyx_L1_error)
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":600
 * 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(19, 600, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":601
 *     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":598
 * # 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":603
 *     return mat
 * 
 * cdef Mat mat_neg(Mat self):             # <<<<<<<<<<<<<<
 *     cdef Mat 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", 0);

  /* "petsc4py/PETSc/petscmat.pxi":604
 * 
 * cdef Mat mat_neg(Mat self):
 *     cdef Mat 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(19, 604, __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":605
 * cdef Mat mat_neg(Mat self):
 *     cdef Mat 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(19, 605, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":606
 *     cdef Mat 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":603
 *     return mat
 * 
 * cdef Mat mat_neg(Mat self):             # <<<<<<<<<<<<<<
 *     cdef Mat 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":610
 * # 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;
  size_t __pyx_t_4;
  int __pyx_t_5;
  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("mat_iadd", 0);

  /* "petsc4py/PETSc/petscmat.pxi":611
 * 
 * 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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscmat.pxi":612
 * 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 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_1, __pyx_v_other};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_axpy, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 612, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":611
 * 
 * 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":613
 *     if isinstance(other, Mat):
 *         self.axpy(1, other)
 *     elif isinstance(other, (tuple, list)):             # <<<<<<<<<<<<<<
 *         alpha, mat = other
 *         self.axpy(alpha, mat)
*/
  __pyx_t_5 = PyTuple_Check(__pyx_v_other); 
  if (!__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = PyList_Check(__pyx_v_other); 
  __pyx_t_1 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscmat.pxi":614
 *         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(19, 614, __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_INCREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_3);
      } else {
        __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 614, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 614, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
      }
      #else
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < (0)) __PYX_ERR(19, 614, __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(19, 614, __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":615
 *     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 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_alpha, __pyx_v_mat};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_axpy, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 615, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":613
 *     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":616
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscmat.pxi":617
 *         self.axpy(alpha, mat)
 *     elif isinstance(other, Vec):
 *         self.setDiagonal(other, PETSC_ADD_VALUES)             # <<<<<<<<<<<<<<
 *     else:
 *         self.shift(other)
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyLong_From_InsertMode(ADD_VALUES); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_other, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setDiagonal, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 617, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":616
 *         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":619
 *         self.setDiagonal(other, PETSC_ADD_VALUES)
 *     else:
 *         self.shift(other)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  /*else*/ {
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_other};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_shift, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 619, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/petscmat.pxi":620
 *     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":610
 * # 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_6);
  __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":622
 *     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;
  size_t __pyx_t_4;
  int __pyx_t_5;
  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("mat_isub", 0);

  /* "petsc4py/PETSc/petscmat.pxi":623
 * 
 * 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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscmat.pxi":624
 * 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 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_mstate_global->__pyx_int_neg_1, __pyx_v_other};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_axpy, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 624, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":623
 * 
 * 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":625
 *     if isinstance(other, Mat):
 *         self.axpy(-1, other)
 *     elif isinstance(other, (tuple, list)):             # <<<<<<<<<<<<<<
 *         alpha, mat = other
 *         self.axpy(-alpha, mat)
*/
  __pyx_t_5 = PyTuple_Check(__pyx_v_other); 
  if (!__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = PyList_Check(__pyx_v_other); 
  __pyx_t_1 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscmat.pxi":626
 *         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(19, 626, __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_INCREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_3);
      } else {
        __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 626, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 626, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
      }
      #else
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 626, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 626, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_v_other); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 626, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < (0)) __PYX_ERR(19, 626, __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(19, 626, __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":627
 *     elif isinstance(other, (tuple, list)):
 *         alpha, mat = other
 *         self.axpy(-alpha, mat)             # <<<<<<<<<<<<<<
 *     elif isinstance(other, Vec):
 *         diag = other.copy()
*/
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = PyNumber_Negative(__pyx_v_alpha); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_6, __pyx_v_mat};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_axpy, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 627, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":625
 *     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":628
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscmat.pxi":629
 *         self.axpy(-alpha, mat)
 *     elif isinstance(other, Vec):
 *         diag = other.copy()             # <<<<<<<<<<<<<<
 *         diag.scale(-1)
 *         self.setDiagonal(diag, PETSC_ADD_VALUES)
*/
    __pyx_t_6 = __pyx_v_other;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_v_diag = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":630
 *     elif isinstance(other, Vec):
 *         diag = other.copy()
 *         diag.scale(-1)             # <<<<<<<<<<<<<<
 *         self.setDiagonal(diag, PETSC_ADD_VALUES)
 *         diag.destroy()
*/
    __pyx_t_6 = __pyx_v_diag;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_int_neg_1};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_scale, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 630, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":631
 *         diag = other.copy()
 *         diag.scale(-1)
 *         self.setDiagonal(diag, PETSC_ADD_VALUES)             # <<<<<<<<<<<<<<
 *         diag.destroy()
 *     else:
*/
    __pyx_t_6 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyLong_From_InsertMode(ADD_VALUES); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_diag, __pyx_t_2};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setDiagonal, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 631, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":632
 *         diag.scale(-1)
 *         self.setDiagonal(diag, PETSC_ADD_VALUES)
 *         diag.destroy()             # <<<<<<<<<<<<<<
 *     else:
 *         self.shift(-other)
*/
    __pyx_t_2 = __pyx_v_diag;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_destroy, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":628
 *         alpha, mat = other
 *         self.axpy(-alpha, mat)
 *     elif isinstance(other, Vec):             # <<<<<<<<<<<<<<
 *         diag = other.copy()
 *         diag.scale(-1)
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/petscmat.pxi":634
 *         diag.destroy()
 *     else:
 *         self.shift(-other)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  /*else*/ {
    __pyx_t_2 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = PyNumber_Negative(__pyx_v_other); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_shift, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 634, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/petscmat.pxi":635
 *     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":622
 *     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_6);
  __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":637
 *     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 *);
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mat_imul", 0);

  /* "petsc4py/PETSc/petscmat.pxi":638
 * 
 * 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":639
 * 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(19, 639, __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_INCREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 639, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 639, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 639, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 639, __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(19, 639, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(19, 639, __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(19, 639, __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":640
 *     if isinstance(other, (tuple, list)):
 *         L, R = other
 *         self.diagonalScale(L, R)             # <<<<<<<<<<<<<<
 *     else:
 *         self.scale(other)
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_L, __pyx_v_R};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_diagonalScale, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 640, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":638
 * 
 * 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":642
 *         self.diagonalScale(L, R)
 *     else:
 *         self.scale(other)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  /*else*/ {
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_other};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_scale, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 642, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/petscmat.pxi":643
 *     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":637
 *     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":645
 *     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 *);
  size_t __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":646
 * 
 * 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":647
 * 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(19, 647, __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_INCREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 647, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 647, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 647, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 647, __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(19, 647, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(19, 647, __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(19, 647, __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":648
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); 
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/petscmat.pxi":649
 *         L, R = other
 *         if isinstance(L, Vec):
 *             L = L.copy()             # <<<<<<<<<<<<<<
 *             L.reciprocal()
 *         if isinstance(R, Vec):
*/
      __pyx_t_3 = __pyx_v_L;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 649, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF_SET(__pyx_v_L, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "petsc4py/PETSc/petscmat.pxi":650
 *         if isinstance(L, Vec):
 *             L = L.copy()
 *             L.reciprocal()             # <<<<<<<<<<<<<<
 *         if isinstance(R, Vec):
 *             R = R.copy()
*/
      __pyx_t_3 = __pyx_v_L;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_reciprocal, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 650, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "petsc4py/PETSc/petscmat.pxi":648
 *     if isinstance(other, (tuple, list)):
 *         L, R = other
 *         if isinstance(L, Vec):             # <<<<<<<<<<<<<<
 *             L = L.copy()
 *             L.reciprocal()
*/
    }

    /* "petsc4py/PETSc/petscmat.pxi":651
 *             L = L.copy()
 *             L.reciprocal()
 *         if isinstance(R, Vec):             # <<<<<<<<<<<<<<
 *             R = R.copy()
 *             R.reciprocal()
*/
    __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_R, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); 
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/petscmat.pxi":652
 *             L.reciprocal()
 *         if isinstance(R, Vec):
 *             R = R.copy()             # <<<<<<<<<<<<<<
 *             R.reciprocal()
 *         self.diagonalScale(L, R)
*/
      __pyx_t_3 = __pyx_v_R;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_copy, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 652, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF_SET(__pyx_v_R, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "petsc4py/PETSc/petscmat.pxi":653
 *         if isinstance(R, Vec):
 *             R = R.copy()
 *             R.reciprocal()             # <<<<<<<<<<<<<<
 *         self.diagonalScale(L, R)
 *     else:
*/
      __pyx_t_3 = __pyx_v_R;
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_7 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_reciprocal, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 653, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "petsc4py/PETSc/petscmat.pxi":651
 *             L = L.copy()
 *             L.reciprocal()
 *         if isinstance(R, Vec):             # <<<<<<<<<<<<<<
 *             R = R.copy()
 *             R.reciprocal()
*/
    }

    /* "petsc4py/PETSc/petscmat.pxi":654
 *             R = R.copy()
 *             R.reciprocal()
 *         self.diagonalScale(L, R)             # <<<<<<<<<<<<<<
 *     else:
 *         other = 1/other
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_L, __pyx_v_R};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_diagonalScale, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":646
 * 
 * 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":656
 *         self.diagonalScale(L, R)
 *     else:
 *         other = 1/other             # <<<<<<<<<<<<<<
 *         self.scale(other)
 *     return self
*/
  /*else*/ {
    __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_mstate_global->__pyx_int_1, __pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 656, __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":657
 *     else:
 *         other = 1/other
 *         self.scale(other)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_other};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_scale, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 657, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/petscmat.pxi":658
 *         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":645
 *     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":662
 * # 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", 0);

  /* "petsc4py/PETSc/petscmat.pxi":663
 * 
 * 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(19, 663, __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(19, 663, __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":662
 * # 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":665
 *     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", 0);

  /* "petsc4py/PETSc/petscmat.pxi":666
 * 
 * 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(19, 666, __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(19, 666, __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":665
 *     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":668
 *     return mat_isub(mat_pos(self), other)
 * 
 * cdef Vec mat_mul_vec(Mat self, Vec other):             # <<<<<<<<<<<<<<
 *     cdef Vec result = self.createVecLeft()
 *     self.mult(other, result)
*/

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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mat_mul_vec", 0);

  /* "petsc4py/PETSc/petscmat.pxi":669
 * 
 * cdef Vec mat_mul_vec(Mat self, Vec other):
 *     cdef Vec result = self.createVecLeft()             # <<<<<<<<<<<<<<
 *     self.mult(other, result)
 *     return result
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_createVecLeft, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(19, 669, __pyx_L1_error)
  __pyx_v_result = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":670
 * cdef Vec mat_mul_vec(Mat self, Vec other):
 *     cdef Vec result = self.createVecLeft()
 *     self.mult(other, result)             # <<<<<<<<<<<<<<
 *     return result
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_other), ((PyObject *)__pyx_v_result)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_mult, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":671
 *     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":668
 *     return mat_isub(mat_pos(self), other)
 * 
 * cdef Vec mat_mul_vec(Mat self, Vec other):             # <<<<<<<<<<<<<<
 *     cdef Vec result = self.createVecLeft()
 *     self.mult(other, result)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":673
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mat_mul_mat", 0);

  /* "petsc4py/PETSc/petscmat.pxi":674
 * 
 * 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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_other)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_matMult, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(19, 674, __pyx_L1_error)
  __pyx_r = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscmat.pxi":673
 *     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_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":676
 *     return self.matMult(other)
 * 
 * cdef object mat_mul(Mat self, other):             # <<<<<<<<<<<<<<
 *     if isinstance(other, Vec):
 *         return mat_mul_vec(self, <Vec>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", 0);

  /* "petsc4py/PETSc/petscmat.pxi":677
 * 
 * cdef object mat_mul(Mat self, other):
 *     if isinstance(other, Vec):             # <<<<<<<<<<<<<<
 *         return mat_mul_vec(self, <Vec>other)
 *     elif isinstance(other, Mat):
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscmat.pxi":678
 * cdef object mat_mul(Mat self, other):
 *     if isinstance(other, Vec):
 *         return mat_mul_vec(self, <Vec>other)             # <<<<<<<<<<<<<<
 *     elif isinstance(other, Mat):
 *         return mat_mul_mat(self, <Mat>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(19, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "petsc4py/PETSc/petscmat.pxi":677
 * 
 * cdef object mat_mul(Mat self, other):
 *     if isinstance(other, Vec):             # <<<<<<<<<<<<<<
 *         return mat_mul_vec(self, <Vec>other)
 *     elif isinstance(other, Mat):
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":679
 *     if isinstance(other, Vec):
 *         return mat_mul_vec(self, <Vec>other)
 *     elif isinstance(other, Mat):             # <<<<<<<<<<<<<<
 *         return mat_mul_mat(self, <Mat>other)
 *     else:
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscmat.pxi":680
 *         return mat_mul_vec(self, <Vec>other)
 *     elif isinstance(other, Mat):
 *         return mat_mul_mat(self, <Mat>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(19, 680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "petsc4py/PETSc/petscmat.pxi":679
 *     if isinstance(other, Vec):
 *         return mat_mul_vec(self, <Vec>other)
 *     elif isinstance(other, Mat):             # <<<<<<<<<<<<<<
 *         return mat_mul_mat(self, <Mat>other)
 *     else:
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":682
 *         return mat_mul_mat(self, <Mat>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(19, 682, __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(19, 682, __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":676
 *     return self.matMult(other)
 * 
 * cdef object mat_mul(Mat self, other):             # <<<<<<<<<<<<<<
 *     if isinstance(other, Vec):
 *         return mat_mul_vec(self, <Vec>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":684
 *         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", 0);

  /* "petsc4py/PETSc/petscmat.pxi":685
 * 
 * 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(19, 685, __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(19, 685, __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":684
 *         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":687
 *     return mat_idiv(mat_pos(self), other)
 * 
 * cdef object mat_matmul(Mat self, other):             # <<<<<<<<<<<<<<
 *     if isinstance(other, Vec):
 *         return mat_mul_vec(self, <Vec>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", 0);

  /* "petsc4py/PETSc/petscmat.pxi":688
 * 
 * cdef object mat_matmul(Mat self, other):
 *     if isinstance(other, Vec):             # <<<<<<<<<<<<<<
 *         return mat_mul_vec(self, <Vec>other)
 *     if isinstance(other, Mat):
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscmat.pxi":689
 * cdef object mat_matmul(Mat self, other):
 *     if isinstance(other, Vec):
 *         return mat_mul_vec(self, <Vec>other)             # <<<<<<<<<<<<<<
 *     if isinstance(other, Mat):
 *         return mat_mul_mat(self, <Mat>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(19, 689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "petsc4py/PETSc/petscmat.pxi":688
 * 
 * cdef object mat_matmul(Mat self, other):
 *     if isinstance(other, Vec):             # <<<<<<<<<<<<<<
 *         return mat_mul_vec(self, <Vec>other)
 *     if isinstance(other, Mat):
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":690
 *     if isinstance(other, Vec):
 *         return mat_mul_vec(self, <Vec>other)
 *     if isinstance(other, Mat):             # <<<<<<<<<<<<<<
 *         return mat_mul_mat(self, <Mat>other)
 *     return NotImplemented
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscmat.pxi":691
 *         return mat_mul_vec(self, <Vec>other)
 *     if isinstance(other, Mat):
 *         return mat_mul_mat(self, <Mat>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(19, 691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "petsc4py/PETSc/petscmat.pxi":690
 *     if isinstance(other, Vec):
 *         return mat_mul_vec(self, <Vec>other)
 *     if isinstance(other, Mat):             # <<<<<<<<<<<<<<
 *         return mat_mul_mat(self, <Mat>other)
 *     return NotImplemented
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":692
 *     if isinstance(other, Mat):
 *         return mat_mul_mat(self, <Mat>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":687
 *     return mat_idiv(mat_pos(self), other)
 * 
 * cdef object mat_matmul(Mat self, other):             # <<<<<<<<<<<<<<
 *     if isinstance(other, Vec):
 *         return mat_mul_vec(self, <Vec>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":696
 * # 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", 0);

  /* "petsc4py/PETSc/petscmat.pxi":697
 * 
 * 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(19, 697, __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":696
 * # 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":699
 *     return mat_add(self, other)
 * 
 * cdef Mat mat_rsub(Mat self, other):             # <<<<<<<<<<<<<<
 *     cdef Mat 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mat_rsub", 0);

  /* "petsc4py/PETSc/petscmat.pxi":700
 * 
 * cdef Mat mat_rsub(Mat self, other):
 *     cdef Mat 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(19, 700, __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":701
 * cdef Mat mat_rsub(Mat self, other):
 *     cdef Mat mat = <Mat> mat_sub(self, other)
 *     mat.scale(-1)             # <<<<<<<<<<<<<<
 *     return mat
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_mat);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_int_neg_1};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_scale, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":702
 *     cdef Mat 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":699
 *     return mat_add(self, other)
 * 
 * cdef Mat mat_rsub(Mat self, other):             # <<<<<<<<<<<<<<
 *     cdef Mat 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_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":704
 *     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", 0);

  /* "petsc4py/PETSc/petscmat.pxi":705
 * 
 * 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(19, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(19, 705, __pyx_L1_error)
  __pyx_r = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscmat.pxi":704
 *     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":707
 *     return mat_mul(self, other)
 * 
 * cdef Mat mat_rdiv(Mat self, other):             # <<<<<<<<<<<<<<
 *     <void>self; <void>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", 0);

  /* "petsc4py/PETSc/petscmat.pxi":708
 * 
 * cdef Mat mat_rdiv(Mat self, other):
 *     <void>self; <void>other # unused             # <<<<<<<<<<<<<<
 *     return NotImplemented
 * 
*/
  ((void)__pyx_v_self);
  ((void)__pyx_v_other);

  /* "petsc4py/PETSc/petscmat.pxi":709
 * cdef Mat mat_rdiv(Mat self, other):
 *     <void>self; <void>other # unused
 *     return NotImplemented             # <<<<<<<<<<<<<<
 * 
 * # -----------------------------------------------------------------------------
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (!(likely(((__pyx_builtin_NotImplemented) == Py_None) || likely(__Pyx_TypeTest(__pyx_builtin_NotImplemented, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(19, 709, __pyx_L1_error)
  __Pyx_INCREF(__pyx_builtin_NotImplemented);
  __pyx_r = ((struct PyPetscMatObject *)__pyx_builtin_NotImplemented);
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscmat.pxi":707
 *     return mat_mul(self, other)
 * 
 * cdef Mat mat_rdiv(Mat self, other):             # <<<<<<<<<<<<<<
 *     <void>self; <void>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":713
 * # -----------------------------------------------------------------------------
 * 
 * cdef inline PetscMatStructure matstructure(object structure) \             # <<<<<<<<<<<<<<
 *     except <PetscMatStructure>(-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":715
 * cdef inline PetscMatStructure matstructure(object structure) \
 *     except <PetscMatStructure>(-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":716
 *     except <PetscMatStructure>(-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":717
 *     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":718
 *     elif structure is False: return MAT_DIFFERENT_NONZERO_PATTERN
 *     elif structure is True:  return MAT_SAME_NONZERO_PATTERN
 *     else:                    return structure             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscMatDuplicateOption matduplicateoption(object copy) \
*/
  /*else*/ {
    __pyx_t_2 = ((MatStructure)__Pyx_PyLong_As_MatStructure(__pyx_v_structure)); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 718, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscmat.pxi":713
 * # -----------------------------------------------------------------------------
 * 
 * cdef inline PetscMatStructure matstructure(object structure) \             # <<<<<<<<<<<<<<
 *     except <PetscMatStructure>(-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":720
 *     else:                    return structure
 * 
 * cdef inline PetscMatDuplicateOption matduplicateoption(object copy) \             # <<<<<<<<<<<<<<
 *     except <PetscMatDuplicateOption>(-1):
 *     if   copy is None:  return MAT_DO_NOT_COPY_VALUES
*/

static CYTHON_INLINE MatDuplicateOption __pyx_f_8petsc4py_5PETSc_matduplicateoption(PyObject *__pyx_v_copy) {
  MatDuplicateOption __pyx_r;
  int __pyx_t_1;
  MatDuplicateOption __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "petsc4py/PETSc/petscmat.pxi":722
 * cdef inline PetscMatDuplicateOption matduplicateoption(object copy) \
 *     except <PetscMatDuplicateOption>(-1):
 *     if   copy is None:  return MAT_DO_NOT_COPY_VALUES             # <<<<<<<<<<<<<<
 *     elif copy is False: return MAT_DO_NOT_COPY_VALUES
 *     elif copy is True:  return MAT_COPY_VALUES
*/
  __pyx_t_1 = (__pyx_v_copy == Py_None);
  if (__pyx_t_1) {
    __pyx_r = MAT_DO_NOT_COPY_VALUES;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscmat.pxi":723
 *     except <PetscMatDuplicateOption>(-1):
 *     if   copy is None:  return MAT_DO_NOT_COPY_VALUES
 *     elif copy is False: return MAT_DO_NOT_COPY_VALUES             # <<<<<<<<<<<<<<
 *     elif copy is True:  return MAT_COPY_VALUES
 *     else:               return copy
*/
  __pyx_t_1 = (__pyx_v_copy == Py_False);
  if (__pyx_t_1) {
    __pyx_r = MAT_DO_NOT_COPY_VALUES;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscmat.pxi":724
 *     if   copy is None:  return MAT_DO_NOT_COPY_VALUES
 *     elif copy is False: return MAT_DO_NOT_COPY_VALUES
 *     elif copy is True:  return MAT_COPY_VALUES             # <<<<<<<<<<<<<<
 *     else:               return copy
 * 
*/
  __pyx_t_1 = (__pyx_v_copy == Py_True);
  if (__pyx_t_1) {
    __pyx_r = MAT_COPY_VALUES;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscmat.pxi":725
 *     elif copy is False: return MAT_DO_NOT_COPY_VALUES
 *     elif copy is True:  return MAT_COPY_VALUES
 *     else:               return copy             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscMatAssemblyType assemblytype(object assembly) \
*/
  /*else*/ {
    __pyx_t_2 = ((MatDuplicateOption)__Pyx_PyLong_As_MatDuplicateOption(__pyx_v_copy)); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 725, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscmat.pxi":720
 *     else:                    return structure
 * 
 * cdef inline PetscMatDuplicateOption matduplicateoption(object copy) \             # <<<<<<<<<<<<<<
 *     except <PetscMatDuplicateOption>(-1):
 *     if   copy is None:  return MAT_DO_NOT_COPY_VALUES
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.matduplicateoption", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = ((MatDuplicateOption)-1L);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/petscmat.pxi":727
 *     else:               return copy
 * 
 * cdef inline PetscMatAssemblyType assemblytype(object assembly) \             # <<<<<<<<<<<<<<
 *     except <PetscMatAssemblyType>(-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":729
 * cdef inline PetscMatAssemblyType assemblytype(object assembly) \
 *     except <PetscMatAssemblyType>(-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":730
 *     except <PetscMatAssemblyType>(-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":731
 *     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":732
 *     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_PyLong_As_MatAssemblyType(__pyx_v_assembly)); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 732, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscmat.pxi":727
 *     else:               return copy
 * 
 * cdef inline PetscMatAssemblyType assemblytype(object assembly) \             # <<<<<<<<<<<<<<
 *     except <PetscMatAssemblyType>(-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":734
 *     else:                   return assembly
 * 
 * cdef inline PetscMatInfoType infotype(object info) \             # <<<<<<<<<<<<<<
 *     except <PetscMatInfoType>(-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":736
 * cdef inline PetscMatInfoType infotype(object info) \
 *     except <PetscMatInfoType>(-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":737
 *     except <PetscMatInfoType>(-1):
 *     if   info is None: return MAT_GLOBAL_SUM
 *     else:              return info             # <<<<<<<<<<<<<<
 * 
 * # -----------------------------------------------------------------------------
*/
  /*else*/ {
    __pyx_t_2 = ((MatInfoType)__Pyx_PyLong_As_MatInfoType(__pyx_v_info)); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 737, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscmat.pxi":734
 *     else:                   return assembly
 * 
 * cdef inline PetscMatInfoType infotype(object info) \             # <<<<<<<<<<<<<<
 *     except <PetscMatInfoType>(-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":741
 * # -----------------------------------------------------------------------------
 * 
 * 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", 0);

  /* "petsc4py/PETSc/petscmat.pxi":749
 *     # 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":750
 *     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(19, 750, __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_INCREF(__pyx_t_4);
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_5);
        } else {
          __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 750, __pyx_L3_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 750, __pyx_L3_error)
          __Pyx_XGOTREF(__pyx_t_5);
        }
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 750, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 750, __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(19, 750, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(19, 750, __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(19, 750, __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":749
 *     # 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":751
 *     try:
 *         rsize , csize = size
 *     except (TypeError, ValueError):             # <<<<<<<<<<<<<<
 *         rsize = csize = size
 *     # unpack row and column block sizes
*/
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches2(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), ((PyObject *)(((PyTypeObject*)PyExc_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(19, 751, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);

      /* "petsc4py/PETSc/petscmat.pxi":752
 *         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":749
 *     # 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":755
 *     # 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":756
 *     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(19, 756, __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_INCREF(__pyx_t_6);
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_4);
        } else {
          __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 756, __pyx_L13_error)
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 756, __pyx_L13_error)
          __Pyx_XGOTREF(__pyx_t_4);
        }
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 756, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 756, __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(19, 756, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(19, 756, __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(19, 756, __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":755
 *     # 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":757
 *     try:
 *         rbsize , cbsize = bsize
 *     except (TypeError, ValueError):             # <<<<<<<<<<<<<<
 *         rbsize = cbsize = bsize
 *     # split row and column sizes
*/
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches2(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), ((PyObject *)(((PyTypeObject*)PyExc_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(19, 757, __pyx_L15_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);

      /* "petsc4py/PETSc/petscmat.pxi":758
 *         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":755
 *     # 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":760
 *         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(19, 760, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":761
 *     # 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(19, 761, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":762
 *     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":741
 * # -----------------------------------------------------------------------------
 * 
 * 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":764
 *     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":772
 *    ) 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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(19, 772, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/petscmat.pxi":774
 *     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":775
 *     # 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(19, 775, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":776
 *     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":777
 *     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":778
 *     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(19, 778, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":779
 *     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(19, 779, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":781
 *     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":782
 *     # 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(19, 782, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":783
 *     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(19, 783, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":784
 *     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(19, 784, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":785
 *     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(19, 785, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":786
 *     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":787
 *     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":764
 *     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":789
 *     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;
  PyObject *__pyx_t_14[4];
  size_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Mat_AllocAIJ_NNZ", 0);

  /* "petsc4py/PETSc/petscmat.pxi":791
 * 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":792
 *     #
 *     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(19, 792, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":794
 *     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":795
 *     # 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(19, 795, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":796
 *     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":797
 *     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(19, 797, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":798
 *     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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_block_size_not_set, 0, 0);
        __PYX_ERR(19, 798, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(19, 798, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/petscmat.pxi":796
 *     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":801
 *     # 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":802
 *     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(19, 802, __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_INCREF(__pyx_t_7);
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_8);
        } else {
          __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 802, __pyx_L6_error)
          __Pyx_XGOTREF(__pyx_t_7);
          __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 802, __pyx_L6_error)
          __Pyx_XGOTREF(__pyx_t_8);
        }
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 802, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 802, __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(19, 802, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(19, 802, __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(19, 802, __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":801
 *     # 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":803
 *     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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), ((PyObject *)(((PyTypeObject*)PyExc_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(19, 803, __pyx_L8_except_error)
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_9);

      /* "petsc4py/PETSc/petscmat.pxi":804
 *         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":801
 *     # 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":806
 *         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":807
 *     # 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":808
 *     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(19, 808, __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":809
 *     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":810
 *         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":807
 *     # 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":811
 *         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":812
 *         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":813
 *     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(19, 813, __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":814
 *     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":815
 *         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":812
 *         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":816
 *         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":817
 *         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":818
 *     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":816
 *         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":820
 *         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)) {
    __pyx_t_7 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":822
 *     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_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_d_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_13 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_8), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m / __pyx_v_bs)); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_12 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_8), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 822, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_14[0] = __pyx_mstate_global->__pyx_kp_u_size_d_nnz_is;
    __pyx_t_14[1] = __pyx_t_13;
    __pyx_t_14[2] = __pyx_mstate_global->__pyx_kp_u_expected;
    __pyx_t_14[3] = __pyx_t_12;

    /* "petsc4py/PETSc/petscmat.pxi":821
 *     # 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_8 = __Pyx_PyUnicode_Join(__pyx_t_14, 4, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12));
    if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_15 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8};
      __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 820, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __PYX_ERR(19, 820, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":820
 *         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)))
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":823
 *         "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)) {
    __pyx_t_8 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":825
 *     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_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_o_n); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_12 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_7), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m / __pyx_v_bs)); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_13 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_7), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_14[0] = __pyx_mstate_global->__pyx_kp_u_size_o_nnz_is;
    __pyx_t_14[1] = __pyx_t_12;
    __pyx_t_14[2] = __pyx_mstate_global->__pyx_kp_u_expected;
    __pyx_t_14[3] = __pyx_t_13;

    /* "petsc4py/PETSc/petscmat.pxi":824
 *         (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_PyUnicode_Join(__pyx_t_14, 4, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13));
    if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_15 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
      __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 823, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __PYX_ERR(19, 823, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":823
 *         "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)))
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":827
 *         (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":828
 *     # 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(19, 828, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":829
 *     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(19, 829, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":827
 *         (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":830
 *         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":831
 *         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(19, 831, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":832
 *     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(19, 832, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":830
 *         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":833
 *         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":834
 *         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(19, 834, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":835
 *     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(19, 835, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":833
 *         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":836
 *         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":837
 *         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(19, 837, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":836
 *         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":838
 *     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":789
 *     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":840
 *     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;
  PyObject *__pyx_t_15[4];
  size_t __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Mat_AllocAIJ_CSR", 0);

  /* "petsc4py/PETSc/petscmat.pxi":842
 * 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":843
 *     #
 *     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(19, 843, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":845
 *     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":846
 *     # 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(19, 846, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":847
 *     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":848
 *     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(19, 848, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":849
 *     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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_block_size_not_set, 0, 0);
        __PYX_ERR(19, 849, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(19, 849, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/petscmat.pxi":847
 *     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":852
 *     # 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":853
 *     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(19, 853, __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_INCREF(__pyx_t_7);
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_8);
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
          __Pyx_INCREF(__pyx_t_9);
        } else {
          __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 853, __pyx_L6_error)
          __Pyx_XGOTREF(__pyx_t_7);
          __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 853, __pyx_L6_error)
          __Pyx_XGOTREF(__pyx_t_8);
          __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 853, __pyx_L6_error)
          __Pyx_XGOTREF(__pyx_t_9);
        }
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 853, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 853, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 853, __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(19, 853, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(19, 853, __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(19, 853, __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":852
 *     # 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":854
 *     try:
 *         oi, oj, ov = CSR
 *     except (TypeError, ValueError):             # <<<<<<<<<<<<<<
 *         oi, oj = CSR; ov = None
 *     # rows, cols, and values
*/
    __pyx_t_12 = __Pyx_PyErr_ExceptionMatches2(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), ((PyObject *)(((PyTypeObject*)PyExc_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(19, 854, __pyx_L8_except_error)
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "petsc4py/PETSc/petscmat.pxi":855
 *         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(19, 855, __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_INCREF(__pyx_t_10);
          __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_13);
        } else {
          __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 855, __pyx_L8_except_error)
          __Pyx_XGOTREF(__pyx_t_10);
          __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 855, __pyx_L8_except_error)
          __Pyx_XGOTREF(__pyx_t_13);
        }
        #else
        __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 855, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 855, __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(19, 855, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(19, 855, __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(19, 855, __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":852
 *     # 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":857
 *         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":858
 *     # 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":859
 *     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":860
 *     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":861
 *     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(19, 861, __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":862
 *     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(19, 862, __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":863
 *     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":864
 *     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(19, 864, __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":863
 *     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":865
 *     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":867
 *     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":868
 *     # 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 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":869
 *     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_9 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_13 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_9), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt(((__pyx_v_m / __pyx_v_bs) + 1)); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_9), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_15[0] = __pyx_mstate_global->__pyx_kp_u_size_I_is;
    __pyx_t_15[1] = __pyx_t_13;
    __pyx_t_15[2] = __pyx_mstate_global->__pyx_kp_u_expected;
    __pyx_t_15[3] = __pyx_t_10;

    /* "petsc4py/PETSc/petscmat.pxi":868
 *     # 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_9 = __Pyx_PyUnicode_Join(__pyx_t_15, 4, 11 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10));
    if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_16 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_16, (2-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 868, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(19, 868, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":867
 *     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":870
 *         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":871
 *                          (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_9 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":872
 *     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_8 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[0])); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_8), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_13 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_8), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_15[0] = __pyx_mstate_global->__pyx_kp_u_I_0_is;
    __pyx_t_15[1] = __pyx_t_10;
    __pyx_t_15[2] = __pyx_mstate_global->__pyx_kp_u_expected;
    __pyx_t_15[3] = __pyx_t_13;

    /* "petsc4py/PETSc/petscmat.pxi":871
 *                          (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_PyUnicode_Join(__pyx_t_15, 4, 8 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13));
    if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 871, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_16 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_8};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_16, (2-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 871, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(19, 871, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":870
 *         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":873
 *         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":874
 *                          (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 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":875
 *     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_9 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_13 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_9), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[(__pyx_v_ni - 1)])); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_9), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_15[0] = __pyx_mstate_global->__pyx_kp_u_size_J_is;
    __pyx_t_15[1] = __pyx_t_13;
    __pyx_t_15[2] = __pyx_mstate_global->__pyx_kp_u_expected;
    __pyx_t_15[3] = __pyx_t_10;

    /* "petsc4py/PETSc/petscmat.pxi":874
 *                          (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_9 = __Pyx_PyUnicode_Join(__pyx_t_15, 4, 11 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10));
    if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_16 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_9};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_16, (2-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 874, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(19, 874, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":873
 *         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":876
 *         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":877
 *                          (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_9 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":878
 *     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_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 878, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_8), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 878, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(((__pyx_v_nj * __pyx_v_bs) * __pyx_v_bs)); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 878, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_13 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_8), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 878, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_15[0] = __pyx_mstate_global->__pyx_kp_u_size_V_is;
    __pyx_t_15[1] = __pyx_t_10;
    __pyx_t_15[2] = __pyx_mstate_global->__pyx_kp_u_expected;
    __pyx_t_15[3] = __pyx_t_13;

    /* "petsc4py/PETSc/petscmat.pxi":877
 *                          (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_PyUnicode_Join(__pyx_t_15, 4, 11 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13));
    if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 877, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_16 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_8};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_16, (2-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 877, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(19, 877, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":876
 *         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":880
 *                          (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":881
 *     # 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(19, 881, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":882
 *     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(19, 882, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":880
 *                          (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":883
 *         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":884
 *         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(19, 884, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":885
 *     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(19, 885, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":883
 *         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":886
 *         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":887
 *         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(19, 887, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":888
 *     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(19, 888, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":886
 *         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":889
 *         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":840
 *     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":891
 *     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":892
 * 
 * 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":893
 * 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(19, 893, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "petsc4py/PETSc/petscmat.pxi":892
 * 
 * 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":894
 *     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":895
 *         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(19, 895, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "petsc4py/PETSc/petscmat.pxi":894
 *     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":896
 *     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":891
 *     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":898
 *     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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10[8];
  size_t __pyx_t_11;
  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":899
 * 
 * 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":900
 * 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(19, 900, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":901
 *     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(19, 901, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":902
 *     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":903
 *     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":904
 *     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":905
 *     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(19, 905, __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":906
 *     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)) {
      __pyx_t_4 = NULL;

      /* "petsc4py/PETSc/petscmat.pxi":908
 *         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_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 908, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 908, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 908, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 908, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 908, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 908, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m * __pyx_v_N)); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 908, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 908, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_size_array_is;
      __pyx_t_10[1] = __pyx_t_6;
      __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_expected;
      __pyx_t_10[3] = __pyx_t_7;
      __pyx_t_10[4] = __pyx_mstate_global->__pyx_n_u_x;
      __pyx_t_10[5] = __pyx_t_8;
      __pyx_t_10[6] = __pyx_mstate_global->__pyx_kp_u__14;
      __pyx_t_10[7] = __pyx_t_9;

      /* "petsc4py/PETSc/petscmat.pxi":907
 *         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_5 = __Pyx_PyUnicode_Join(__pyx_t_10, 8, 15 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9));
      if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __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;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_11 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 906, __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(19, 906, __pyx_L1_error)

      /* "petsc4py/PETSc/petscmat.pxi":906
 *     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)))
*/
    }

    /* "petsc4py/PETSc/petscmat.pxi":904
 *     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":909
 *             "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(19, 909, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":910
 *             (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(19, 910, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":911
 *     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":898
 *     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_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __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":920
 *                                         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":921
 * 
 * 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":922
 * 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":923
 *     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":924
 *     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":925
 *     elif blocked:         setvalues = MatSetValuesBlocked
 *     elif local:           setvalues = MatSetValuesLocal
 *     else:                 setvalues = MatSetValues             # <<<<<<<<<<<<<<
 *     return setvalues
 * 
*/
  /*else*/ {
    __pyx_v_setvalues = MatSetValues;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/petscmat.pxi":926
 *     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":920
 *                                         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":928
 *     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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9[6];
  size_t __pyx_t_10;
  __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_t_11;
  InsertMode __pyx_t_12;
  PetscErrorCode __pyx_t_13;
  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":932
 *                                         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":933
 *     # 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(19, 933, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/petscmat.pxi":934
 *     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":935
 *     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":937
 *     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":938
 *     # 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":939
 *     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":940
 *     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":941
 *     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(19, 941, __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":942
 *     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(19, 942, __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":943
 *     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(19, 943, __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":944
 *     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)) {
    __pyx_t_4 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":946
 *     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_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 946, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 946, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 946, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 946, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 946, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 946, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_incompatible_array_sizes_ni;
    __pyx_t_9[1] = __pyx_t_6;
    __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u_nj;
    __pyx_t_9[3] = __pyx_t_7;
    __pyx_t_9[4] = __pyx_mstate_global->__pyx_kp_u_nv;
    __pyx_t_9[5] = __pyx_t_8;

    /* "petsc4py/PETSc/petscmat.pxi":945
 *     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_PyUnicode_Join(__pyx_t_9, 6, 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 5 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8));
    if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 945, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __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;
    __pyx_t_10 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 944, __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(19, 944, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":944
 *     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)))
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":948
 *         (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_11 = __pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(__pyx_v_blocked, __pyx_v_local); if (unlikely(__pyx_t_11 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(19, 948, __pyx_L1_error)
  __pyx_v_setvalues = __pyx_t_11;

  /* "petsc4py/PETSc/petscmat.pxi":949
 *     # 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_12 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oaddv); if (unlikely(__pyx_t_12 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(19, 949, __pyx_L1_error)
  __pyx_v_addv = __pyx_t_12;

  /* "petsc4py/PETSc/petscmat.pxi":951
 *     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(19, 951, __pyx_L1_error)
  __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_2); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(19, 951, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":952
 *     # 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":928
 *     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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __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":954
 *     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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11[6];
  __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_t_12;
  InsertMode __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PetscErrorCode __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matsetvalues_rcv", 0);

  /* "petsc4py/PETSc/petscmat.pxi":959
 *                                             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":960
 *     # 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(19, 960, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/petscmat.pxi":961
 *     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":962
 *     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":964
 *     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":965
 *     # 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":966
 *     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":967
 *     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":968
 *     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(19, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_ai = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":969
 *     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(19, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_aj = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":970
 *     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(19, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_av = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":972
 *     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)) {
    __pyx_t_4 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":974
 *     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_5 = __Pyx_PyLong_From_int(PyArray_NDIM(__pyx_v_ai)); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_row_indices_must_have_two_dimens, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 972, __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(19, 972, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":972
 *     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)))
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":975
 *         ("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_6 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_expecting_a_C_contiguous_array};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 975, __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(19, 975, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/petscmat.pxi":977
 *     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)) {
    __pyx_t_6 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":979
 *     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_4 = __Pyx_PyLong_From_int(PyArray_NDIM(__pyx_v_aj)); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 979, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_column_indices_must_have_two_dim, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 979, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 977, __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(19, 977, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":977
 *     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)))
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":980
 *         ("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_5 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_expecting_a_C_contiguous_array};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 980, __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(19, 980, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/petscmat.pxi":982
 *     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)) {
    __pyx_t_5 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":984
 *     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_6 = __Pyx_PyLong_From_int(PyArray_NDIM(__pyx_v_av)); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_values_must_have_two_or_more_dim, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 982, __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(19, 982, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":982
 *     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)))
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":985
 *         ("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_4 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_expecting_a_C_contiguous_array};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 985, __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(19, 985, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/petscmat.pxi":988
 *         "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":989
 *     # 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":990
 *     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":991
 *     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":992
 *     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_8 = (__pyx_v_nm != PyArray_DIM(__pyx_v_aj, 0));
  if (!__pyx_t_8) {
  } else {
    __pyx_t_1 = __pyx_t_8;
    goto __pyx_L10_bool_binop_done;
  }

  /* "petsc4py/PETSc/petscmat.pxi":993
 *     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_8 = (__pyx_v_nm != PyArray_DIM(__pyx_v_av, 0));
  if (!__pyx_t_8) {
  } else {
    __pyx_t_1 = __pyx_t_8;
    goto __pyx_L10_bool_binop_done;
  }

  /* "petsc4py/PETSc/petscmat.pxi":994
 *     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_8 = ((((__pyx_v_si * __pyx_v_rbs) * __pyx_v_sj) * __pyx_v_cbs) != __pyx_v_sv);
  __pyx_t_1 = __pyx_t_8;
  __pyx_L10_bool_binop_done:;

  /* "petsc4py/PETSc/petscmat.pxi":992
 *     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":994
 *     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_4 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":997
 *         ("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_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ai), __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_aj), __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_av), __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_input_arrays_have_incompatible_s;
    __pyx_t_11[1] = __pyx_t_6;
    __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_cols_shape;
    __pyx_t_11[3] = __pyx_t_9;
    __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u_vals_shape;
    __pyx_t_11[5] = __pyx_t_10;

    /* "petsc4py/PETSc/petscmat.pxi":995
 *         (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") %
 *         (ai.shape, aj.shape, av.shape))
*/
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_11, 6, 50 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 13 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10));
    if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 994, __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(19, 994, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":992
 *     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":1000
 *     # MatSetValuesXXX function and insert mode
 *     cdef MatSetValuesFcn *setvalues = \
 *         matsetvalues_fcn(blocked, local)             # <<<<<<<<<<<<<<
 *     cdef PetscInsertMode addv = insertmode(oaddv)
 *     # actual calls
*/
  __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(__pyx_v_blocked, __pyx_v_local); if (unlikely(__pyx_t_12 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(19, 1000, __pyx_L1_error)
  __pyx_v_setvalues = __pyx_t_12;

  /* "petsc4py/PETSc/petscmat.pxi":1001
 *     cdef MatSetValuesFcn *setvalues = \
 *         matsetvalues_fcn(blocked, local)
 *     cdef PetscInsertMode addv = insertmode(oaddv)             # <<<<<<<<<<<<<<
 *     # actual calls
 *     cdef Py_ssize_t k=0
*/
  __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oaddv); if (unlikely(__pyx_t_13 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(19, 1001, __pyx_L1_error)
  __pyx_v_addv = __pyx_t_13;

  /* "petsc4py/PETSc/petscmat.pxi":1003
 *     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":1004
 *     # actual calls
 *     cdef Py_ssize_t k=0
 *     for k from 0 <= k < nm:             # <<<<<<<<<<<<<<
 *         CHKERR(setvalues(A,
 *                          <PetscInt>si, &i[k*si],
*/
  __pyx_t_14 = __pyx_v_nm;
  for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_14; __pyx_v_k++) {

    /* "petsc4py/PETSc/petscmat.pxi":1005
 *     cdef Py_ssize_t k=0
 *     for k from 0 <= k < nm:
 *         CHKERR(setvalues(A,             # <<<<<<<<<<<<<<
 *                          <PetscInt>si, &i[k*si],
 *                          <PetscInt>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(19, 1005, __pyx_L1_error)
    __pyx_t_15 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_2); if (unlikely(__pyx_t_15 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(19, 1005, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/petscmat.pxi":1009
 *                          <PetscInt>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":954
 *     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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __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":1011
 *     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_c;
  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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8[4];
  size_t __pyx_t_9;
  __pyx_t_8petsc4py_5PETSc_MatSetValuesFcn *__pyx_t_10;
  InsertMode __pyx_t_11;
  PetscInt __pyx_t_12;
  PetscInt __pyx_t_13;
  PetscErrorCode __pyx_t_14;
  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":1017
 *                                             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":1018
 *     # 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(19, 1018, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/petscmat.pxi":1019
 *     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":1020
 *     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":1022
 *     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":1023
 *     # 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":1024
 *     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":1025
 *     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":1026
 *     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(19, 1026, __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":1027
 *     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(19, 1027, __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":1028
 *     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(19, 1028, __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":1030
 *     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":1031
 *     # 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":1032
 *     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":1033
 *     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(19, 1033, __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":1032
 *     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":1035
 *         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":1036
 *     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(19, 1036, __pyx_L1_error)

      /* "petsc4py/PETSc/petscmat.pxi":1037
 *         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":1035
 *         om = iarray_i(om, &nm, &m)
 *     else:
 *         if not local:             # <<<<<<<<<<<<<<
 *             CHKERR(MatGetOwnershipRange(A, &rs, &re))
 *             rs //= rbs; re //= rbs
*/
    }

    /* "petsc4py/PETSc/petscmat.pxi":1038
 *             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":1040
 *         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)) {
    __pyx_t_4 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":1042
 *     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_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 1042, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 1042, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_nm + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 1042, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 1042, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_size_I_is;
    __pyx_t_8[1] = __pyx_t_6;
    __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_expected;
    __pyx_t_8[3] = __pyx_t_7;

    /* "petsc4py/PETSc/petscmat.pxi":1041
 *     # 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_5 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 11 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7));
    if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 1041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1040, __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(19, 1040, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1040
 *         nm = re - rs
 *     # check various sizes
 *     if (ni-1 != nm): raise ValueError(             # <<<<<<<<<<<<<<
 *         "size(I) is %d, expected %d" %
 *         (toInt(ni), toInt(nm+1)))
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1043
 *         "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)) {
    __pyx_t_5 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":1045
 *     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_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 1045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_4), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 1045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_From_long(0, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 1045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_I_0_is;
    __pyx_t_8[1] = __pyx_t_7;
    __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_expected;
    __pyx_t_8[3] = __pyx_t_4;

    /* "petsc4py/PETSc/petscmat.pxi":1044
 *         (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_6 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 8 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7));
    if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 1044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1043, __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(19, 1043, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1043
 *         "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))
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1046
 *         "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)) {
    __pyx_t_6 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":1048
 *     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_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 1048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 1048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[(__pyx_v_ni - 1)])); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 1048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 1048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_size_J_is;
    __pyx_t_8[1] = __pyx_t_4;
    __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_expected;
    __pyx_t_8[3] = __pyx_t_7;

    /* "petsc4py/PETSc/petscmat.pxi":1047
 *         (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_PyUnicode_Join(__pyx_t_8, 4, 11 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7));
    if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 1047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1046, __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(19, 1046, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1046
 *         "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])))
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1049
 *         "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)) {
    __pyx_t_5 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":1051
 *     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_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 1051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_6), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 1051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(((__pyx_v_nj * __pyx_v_rbs) * __pyx_v_cbs)); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 1051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_6), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 1051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_size_V_is;
    __pyx_t_8[1] = __pyx_t_7;
    __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_expected;
    __pyx_t_8[3] = __pyx_t_4;

    /* "petsc4py/PETSc/petscmat.pxi":1050
 *         (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_6 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 11 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
    if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 1050, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1049, __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(19, 1049, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1049
 *         "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)))
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1054
 *     # MatSetValuesXXX function and insert mode
 *     cdef MatSetValuesFcn *setvalues = \
 *         matsetvalues_fcn(blocked, local)             # <<<<<<<<<<<<<<
 *     cdef PetscInsertMode addv = insertmode(oaddv)
 *     # actual call
*/
  __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_matsetvalues_fcn(__pyx_v_blocked, __pyx_v_local); if (unlikely(__pyx_t_10 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(19, 1054, __pyx_L1_error)
  __pyx_v_setvalues = __pyx_t_10;

  /* "petsc4py/PETSc/petscmat.pxi":1055
 *     cdef MatSetValuesFcn *setvalues = \
 *         matsetvalues_fcn(blocked, local)
 *     cdef PetscInsertMode addv = insertmode(oaddv)             # <<<<<<<<<<<<<<
 *     # actual call
 *     cdef PetscInt k=0, c=0
*/
  __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oaddv); if (unlikely(__pyx_t_11 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(19, 1055, __pyx_L1_error)
  __pyx_v_addv = __pyx_t_11;

  /* "petsc4py/PETSc/petscmat.pxi":1057
 *     cdef PetscInsertMode addv = insertmode(oaddv)
 *     # actual call
 *     cdef PetscInt k=0, c=0             # <<<<<<<<<<<<<<
 *     cdef PetscInt irow=0, ncol=0, *icol=NULL
 *     cdef PetscScalar *sval=NULL
*/
  __pyx_v_k = 0;
  __pyx_v_c = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1058
 *     # actual call
 *     cdef PetscInt k=0, c=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":1059
 *     cdef PetscInt k=0, c=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":1060
 *     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_12 = __pyx_v_nm;
  for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_12; __pyx_v_k++) {

    /* "petsc4py/PETSc/petscmat.pxi":1061
 *     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_13 = (__pyx_v_m[__pyx_v_k]);
    } else {
      __pyx_t_13 = (__pyx_v_rs + __pyx_v_k);
    }
    __pyx_v_irow = __pyx_t_13;

    /* "petsc4py/PETSc/petscmat.pxi":1062
 *     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":1063
 *         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":1064
 *         ncol = i[k+1] - i[k]
 *         icol = j + i[k]
 *         if blocked:             # <<<<<<<<<<<<<<
 *             sval = v + i[k]*rbs*cbs
 *             for c from 0 <= c < ncol:
*/
    __pyx_t_1 = (__pyx_v_blocked != 0);
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/petscmat.pxi":1065
 *         icol = j + i[k]
 *         if blocked:
 *             sval = v + i[k]*rbs*cbs             # <<<<<<<<<<<<<<
 *             for c from 0 <= c < ncol:
 *                 CHKERR(setvalues(A, 1, &irow, 1, &icol[c],
*/
      __pyx_v_sval = (__pyx_v_v + (((__pyx_v_i[__pyx_v_k]) * __pyx_v_rbs) * __pyx_v_cbs));

      /* "petsc4py/PETSc/petscmat.pxi":1066
 *         if blocked:
 *             sval = v + i[k]*rbs*cbs
 *             for c from 0 <= c < ncol:             # <<<<<<<<<<<<<<
 *                 CHKERR(setvalues(A, 1, &irow, 1, &icol[c],
 *                                  &sval[c*rbs*cbs], addv))
*/
      __pyx_t_13 = __pyx_v_ncol;
      for (__pyx_v_c = 0; __pyx_v_c < __pyx_t_13; __pyx_v_c++) {

        /* "petsc4py/PETSc/petscmat.pxi":1067
 *             sval = v + i[k]*rbs*cbs
 *             for c from 0 <= c < ncol:
 *                 CHKERR(setvalues(A, 1, &irow, 1, &icol[c],             # <<<<<<<<<<<<<<
 *                                  &sval[c*rbs*cbs], addv))
 *         else:
*/
        __pyx_t_2 = __pyx_v_setvalues(__pyx_v_A, 1, (&__pyx_v_irow), 1, (&(__pyx_v_icol[__pyx_v_c])), (&(__pyx_v_sval[((__pyx_v_c * __pyx_v_rbs) * __pyx_v_cbs)])), __pyx_v_addv); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 1067, __pyx_L1_error)
        __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_2); if (unlikely(__pyx_t_14 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(19, 1067, __pyx_L1_error)
      }

      /* "petsc4py/PETSc/petscmat.pxi":1064
 *         ncol = i[k+1] - i[k]
 *         icol = j + i[k]
 *         if blocked:             # <<<<<<<<<<<<<<
 *             sval = v + i[k]*rbs*cbs
 *             for c from 0 <= c < ncol:
*/
      goto __pyx_L14;
    }

    /* "petsc4py/PETSc/petscmat.pxi":1070
 *                                  &sval[c*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":1071
 *         else:
 *             sval = v + i[k]
 *             CHKERR(setvalues(A, 1, &irow, ncol, icol, sval, addv))             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
      __pyx_t_14 = __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(19, 1071, __pyx_L1_error)
      __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_14); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(19, 1071, __pyx_L1_error)
    }
    __pyx_L14:;
  }

  /* "petsc4py/PETSc/petscmat.pxi":1072
 *             sval = v + i[k]
 *             CHKERR(setvalues(A, 1, &irow, ncol, icol, sval, addv))
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscErrorCode matsetvalues_coo(PetscMat A,
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscmat.pxi":1011
 *     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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __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":1074
 *     return PETSC_SUCCESS
 * 
 * cdef inline PetscErrorCode matsetvalues_coo(PetscMat A,             # <<<<<<<<<<<<<<
 *                                             object ocoo_v,
 *                                             object oaddv) except PETSC_ERR_PYTHON:
*/

static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_matsetvalues_coo(Mat __pyx_v_A, PyObject *__pyx_v_ocoo_v, PyObject *__pyx_v_oaddv) {
  PetscScalar *__pyx_v_v;
  InsertMode __pyx_v_addv;
  PetscErrorCode __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  InsertMode __pyx_t_2;
  PetscErrorCode __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matsetvalues_coo", 0);
  __Pyx_INCREF(__pyx_v_ocoo_v);

  /* "petsc4py/PETSc/petscmat.pxi":1077
 *                                             object ocoo_v,
 *                                             object oaddv) except PETSC_ERR_PYTHON:
 *     cdef PetscScalar *v = NULL             # <<<<<<<<<<<<<<
 *     cdef PetscInsertMode addv
 * 
*/
  __pyx_v_v = NULL;

  /* "petsc4py/PETSc/petscmat.pxi":1080
 *     cdef PetscInsertMode addv
 * 
 *     ocoo_v = iarray_s(ocoo_v, NULL, &v)             # <<<<<<<<<<<<<<
 *     addv = insertmode(oaddv)
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_ocoo_v, NULL, (&__pyx_v_v))); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_ocoo_v, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1081
 * 
 *     ocoo_v = iarray_s(ocoo_v, NULL, &v)
 *     addv = insertmode(oaddv)             # <<<<<<<<<<<<<<
 * 
 *     CHKERR(MatSetValuesCOO(A, v, addv))
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_oaddv); if (unlikely(__pyx_t_2 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(19, 1081, __pyx_L1_error)
  __pyx_v_addv = __pyx_t_2;

  /* "petsc4py/PETSc/petscmat.pxi":1083
 *     addv = insertmode(oaddv)
 * 
 *     CHKERR(MatSetValuesCOO(A, v, addv))             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetValuesCOO(__pyx_v_A, __pyx_v_v, __pyx_v_addv)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(19, 1083, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":1084
 * 
 *     CHKERR(MatSetValuesCOO(A, v, addv))
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscErrorCode matsetvalues_csr(PetscMat A,
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscmat.pxi":1074
 *     return PETSC_SUCCESS
 * 
 * cdef inline PetscErrorCode matsetvalues_coo(PetscMat A,             # <<<<<<<<<<<<<<
 *                                             object ocoo_v,
 *                                             object oaddv) except PETSC_ERR_PYTHON:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("petsc4py.PETSc.matsetvalues_coo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ocoo_v);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/petscmat.pxi":1086
 *     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":1090
 *                                             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(19, 1090, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":1091
 *                                             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":1086
 *     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":1093
 *     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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8[6];
  size_t __pyx_t_9;
  PetscErrorCode __pyx_t_10;
  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":1095
 * 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":1096
 *                          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":1097
 *     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":1098
 *     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(19, 1098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rows = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1099
 *     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(19, 1099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cols = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1100
 *     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":1101
 *     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(19, 1101, __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":1102
 *     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_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cols), __pyx_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1102, __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(19, 1102, __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_mstate_global->__pyx_n_u_shape, __pyx_t_4) < (0)) __PYX_ERR(19, 1102, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":1100
 *     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":1103
 *         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(19, 1103, __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":1104
 *         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)) {
    __pyx_t_3 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":1106
 *     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_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 1106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 1106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 1106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_incompatible_array_sizes_ni;
    __pyx_t_8[1] = __pyx_t_5;
    __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_nj;
    __pyx_t_8[3] = __pyx_t_6;
    __pyx_t_8[4] = __pyx_mstate_global->__pyx_kp_u_nv;
    __pyx_t_8[5] = __pyx_t_7;

    /* "petsc4py/PETSc/petscmat.pxi":1105
 *     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_PyUnicode_Join(__pyx_t_8, 6, 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 5 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7));
    if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __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;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_1};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 1104, __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(19, 1104, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1104
 *         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)))
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1107
 *         "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_10 = __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_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(19, 1107, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":1108
 *         (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":1093
 *     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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __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":1115
 *     PetscErrorCode MatFactorInfoDefaults(PetscBool, PetscBool, PetscMatFactorInfo*)
 * 
 * cdef inline PetscMatFactorShiftType matfactorshifttype(object st) \             # <<<<<<<<<<<<<<
 *     except <PetscMatFactorShiftType>(-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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  MatFactorShiftType __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("matfactorshifttype", 0);

  /* "petsc4py/PETSc/petscmat.pxi":1117
 * cdef inline PetscMatFactorShiftType matfactorshifttype(object st) \
 *     except <PetscMatFactorShiftType>(-1):
 *     if isinstance(st, str):             # <<<<<<<<<<<<<<
 *         if st == "none": return MAT_SHIFT_NONE
 *         if st == "nonzero": return MAT_SHIFT_NONZERO
*/
  __pyx_t_1 = PyUnicode_Check(__pyx_v_st); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscmat.pxi":1118
 *     except <PetscMatFactorShiftType>(-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_PyUnicode_Equals(__pyx_v_st, __pyx_mstate_global->__pyx_n_u_none, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(19, 1118, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = MAT_SHIFT_NONE;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscmat.pxi":1119
 *     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_PyUnicode_Equals(__pyx_v_st, __pyx_mstate_global->__pyx_n_u_nonzero, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(19, 1119, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = MAT_SHIFT_NONZERO;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscmat.pxi":1120
 *         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_PyUnicode_Equals(__pyx_v_st, __pyx_mstate_global->__pyx_n_u_positive_definite, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(19, 1120, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = MAT_SHIFT_POSITIVE_DEFINITE;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscmat.pxi":1121
 *         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_PyUnicode_Equals(__pyx_v_st, __pyx_mstate_global->__pyx_n_u_inblocks, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(19, 1121, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = MAT_SHIFT_INBLOCKS;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscmat.pxi":1122
 *         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_PyUnicode_Equals(__pyx_v_st, __pyx_mstate_global->__pyx_n_u_na, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(19, 1122, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = MAT_SHIFT_NONZERO;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscmat.pxi":1123
 *         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_PyUnicode_Equals(__pyx_v_st, __pyx_mstate_global->__pyx_n_u_pd, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(19, 1123, __pyx_L1_error)
    if (likely(__pyx_t_1)) {
      __pyx_r = MAT_SHIFT_POSITIVE_DEFINITE;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscmat.pxi":1124
 *         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_3 = NULL;
      __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_unknown_shift_type_s, __pyx_v_st); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 1124, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 1124, __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(19, 1124, __pyx_L1_error)
    }

    /* "petsc4py/PETSc/petscmat.pxi":1117
 * cdef inline PetscMatFactorShiftType matfactorshifttype(object st) \
 *     except <PetscMatFactorShiftType>(-1):
 *     if isinstance(st, str):             # <<<<<<<<<<<<<<
 *         if st == "none": return MAT_SHIFT_NONE
 *         if st == "nonzero": return MAT_SHIFT_NONZERO
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1125
 *         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_6 = ((MatFactorShiftType)__Pyx_PyLong_As_MatFactorShiftType(__pyx_v_st)); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 1125, __pyx_L1_error)
  __pyx_r = __pyx_t_6;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscmat.pxi":1115
 *     PetscErrorCode MatFactorInfoDefaults(PetscBool, PetscBool, PetscMatFactorInfo*)
 * 
 * cdef inline PetscMatFactorShiftType matfactorshifttype(object st) \             # <<<<<<<<<<<<<<
 *     except <PetscMatFactorShiftType>(-1):
 *     if isinstance(st, str):
*/

  /* 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.matfactorshifttype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = ((MatFactorShiftType)-1L);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/petscmat.pxi":1127
 *     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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscReal __pyx_t_6;
  PetscInt __pyx_t_7;
  MatFactorShiftType __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;
  __Pyx_RefNannySetupContext("matfactorinfo", 0);

  /* "petsc4py/PETSc/petscmat.pxi":1129
 * 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(19, 1129, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":1130
 *                                   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":1131
 *     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_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_opts};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(&PyDict_Type), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_options = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1133
 *     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_mstate_global->__pyx_n_u_fill, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_fill = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1134
 *     #
 *     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":1135
 *     cdef fill = options.pop('fill', None)
 *     if fill is not None:
 *         info.fill = asReal(fill)             # <<<<<<<<<<<<<<
 *     #
 *     cdef zeropivot = options.pop('zeropivot', None)
*/
    __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_6 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(19, 1135, __pyx_L1_error)
    __pyx_v_info->fill = __pyx_t_6;

    /* "petsc4py/PETSc/petscmat.pxi":1134
 *     #
 *     cdef fill = options.pop('fill', None)
 *     if fill is not None:             # <<<<<<<<<<<<<<
 *         info.fill = asReal(fill)
 *     #
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1137
 *         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_mstate_global->__pyx_n_u_zeropivot, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_zeropivot = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1138
 *     #
 *     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":1139
 *     cdef zeropivot = options.pop('zeropivot', None)
 *     if zeropivot is not None:
 *         info.zeropivot = asReal(zeropivot)             # <<<<<<<<<<<<<<
 *     #
 *     cdef levels = options.pop('levels', None)
*/
    __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_zeropivot); if (unlikely(__pyx_t_6 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(19, 1139, __pyx_L1_error)
    __pyx_v_info->zeropivot = __pyx_t_6;

    /* "petsc4py/PETSc/petscmat.pxi":1138
 *     #
 *     cdef zeropivot = options.pop('zeropivot', None)
 *     if zeropivot is not None:             # <<<<<<<<<<<<<<
 *         info.zeropivot = asReal(zeropivot)
 *     #
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1141
 *         info.zeropivot = asReal(zeropivot)
 *     #
 *     cdef levels = options.pop('levels', None)             # <<<<<<<<<<<<<<
 *     if levels is not None:
 *         info.levels  = <PetscReal>asInt(levels)
*/
  __pyx_t_3 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_mstate_global->__pyx_n_u_levels, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_levels = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1142
 *     #
 *     cdef levels = options.pop('levels', None)
 *     if levels is not None:             # <<<<<<<<<<<<<<
 *         info.levels  = <PetscReal>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":1143
 *     cdef levels = options.pop('levels', None)
 *     if levels is not None:
 *         info.levels  = <PetscReal>asInt(levels)             # <<<<<<<<<<<<<<
 *     cdef diagonal_fill = options.pop('diagonal_fill', None)
 *     if diagonal_fill is not None:
*/
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_levels); if (unlikely(__pyx_t_7 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(19, 1143, __pyx_L1_error)
    __pyx_v_info->levels = ((PetscReal)__pyx_t_7);

    /* "petsc4py/PETSc/petscmat.pxi":1142
 *     #
 *     cdef levels = options.pop('levels', None)
 *     if levels is not None:             # <<<<<<<<<<<<<<
 *         info.levels  = <PetscReal>asInt(levels)
 *     cdef diagonal_fill = options.pop('diagonal_fill', None)
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1144
 *     if levels is not None:
 *         info.levels  = <PetscReal>asInt(levels)
 *     cdef diagonal_fill = options.pop('diagonal_fill', None)             # <<<<<<<<<<<<<<
 *     if diagonal_fill is not None:
 *         info.diagonal_fill = <PetscReal>(<bint>diagonal_fill)
*/
  __pyx_t_3 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_mstate_global->__pyx_n_u_diagonal_fill, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_diagonal_fill = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1145
 *         info.levels  = <PetscReal>asInt(levels)
 *     cdef diagonal_fill = options.pop('diagonal_fill', None)
 *     if diagonal_fill is not None:             # <<<<<<<<<<<<<<
 *         info.diagonal_fill = <PetscReal>(<bint>diagonal_fill)
 *     #
*/
  __pyx_t_2 = (__pyx_v_diagonal_fill != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/petscmat.pxi":1146
 *     cdef diagonal_fill = options.pop('diagonal_fill', None)
 *     if diagonal_fill is not None:
 *         info.diagonal_fill = <PetscReal>(<bint>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(19, 1146, __pyx_L1_error)
    __pyx_v_info->diagonal_fill = ((PetscReal)__pyx_t_2);

    /* "petsc4py/PETSc/petscmat.pxi":1145
 *         info.levels  = <PetscReal>asInt(levels)
 *     cdef diagonal_fill = options.pop('diagonal_fill', None)
 *     if diagonal_fill is not None:             # <<<<<<<<<<<<<<
 *         info.diagonal_fill = <PetscReal>(<bint>diagonal_fill)
 *     #
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1148
 *         info.diagonal_fill = <PetscReal>(<bint>diagonal_fill)
 *     #
 *     cdef dt = options.pop('dt', None)             # <<<<<<<<<<<<<<
 *     if dt is not None:
 *         info.usedt = <PetscReal>PETSC_TRUE
*/
  __pyx_t_3 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_mstate_global->__pyx_n_u_dt, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_dt = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1149
 *     #
 *     cdef dt = options.pop('dt', None)
 *     if dt is not None:             # <<<<<<<<<<<<<<
 *         info.usedt = <PetscReal>PETSC_TRUE
 *         info.dt = asReal(dt)
*/
  __pyx_t_2 = (__pyx_v_dt != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/petscmat.pxi":1150
 *     cdef dt = options.pop('dt', None)
 *     if dt is not None:
 *         info.usedt = <PetscReal>PETSC_TRUE             # <<<<<<<<<<<<<<
 *         info.dt = asReal(dt)
 *     cdef dtcol = options.pop('dtcol', None)
*/
    __pyx_v_info->usedt = ((PetscReal)PETSC_TRUE);

    /* "petsc4py/PETSc/petscmat.pxi":1151
 *     if dt is not None:
 *         info.usedt = <PetscReal>PETSC_TRUE
 *         info.dt = asReal(dt)             # <<<<<<<<<<<<<<
 *     cdef dtcol = options.pop('dtcol', None)
 *     if dtcol is not None:
*/
    __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_dt); if (unlikely(__pyx_t_6 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(19, 1151, __pyx_L1_error)
    __pyx_v_info->dt = __pyx_t_6;

    /* "petsc4py/PETSc/petscmat.pxi":1149
 *     #
 *     cdef dt = options.pop('dt', None)
 *     if dt is not None:             # <<<<<<<<<<<<<<
 *         info.usedt = <PetscReal>PETSC_TRUE
 *         info.dt = asReal(dt)
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1152
 *         info.usedt = <PetscReal>PETSC_TRUE
 *         info.dt = asReal(dt)
 *     cdef dtcol = options.pop('dtcol', None)             # <<<<<<<<<<<<<<
 *     if dtcol is not None:
 *         info.usedt = <PetscReal>PETSC_TRUE
*/
  __pyx_t_3 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_mstate_global->__pyx_n_u_dtcol, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_dtcol = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1153
 *         info.dt = asReal(dt)
 *     cdef dtcol = options.pop('dtcol', None)
 *     if dtcol is not None:             # <<<<<<<<<<<<<<
 *         info.usedt = <PetscReal>PETSC_TRUE
 *         info.dtcol = asReal(dtcol)
*/
  __pyx_t_2 = (__pyx_v_dtcol != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/petscmat.pxi":1154
 *     cdef dtcol = options.pop('dtcol', None)
 *     if dtcol is not None:
 *         info.usedt = <PetscReal>PETSC_TRUE             # <<<<<<<<<<<<<<
 *         info.dtcol = asReal(dtcol)
 *     cdef dtcount = options.pop('dtcount', None)
*/
    __pyx_v_info->usedt = ((PetscReal)PETSC_TRUE);

    /* "petsc4py/PETSc/petscmat.pxi":1155
 *     if dtcol is not None:
 *         info.usedt = <PetscReal>PETSC_TRUE
 *         info.dtcol = asReal(dtcol)             # <<<<<<<<<<<<<<
 *     cdef dtcount = options.pop('dtcount', None)
 *     if dtcount is not None:
*/
    __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_dtcol); if (unlikely(__pyx_t_6 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(19, 1155, __pyx_L1_error)
    __pyx_v_info->dtcol = __pyx_t_6;

    /* "petsc4py/PETSc/petscmat.pxi":1153
 *         info.dt = asReal(dt)
 *     cdef dtcol = options.pop('dtcol', None)
 *     if dtcol is not None:             # <<<<<<<<<<<<<<
 *         info.usedt = <PetscReal>PETSC_TRUE
 *         info.dtcol = asReal(dtcol)
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1156
 *         info.usedt = <PetscReal>PETSC_TRUE
 *         info.dtcol = asReal(dtcol)
 *     cdef dtcount = options.pop('dtcount', None)             # <<<<<<<<<<<<<<
 *     if dtcount is not None:
 *         info.usedt = <PetscReal>PETSC_TRUE
*/
  __pyx_t_3 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_mstate_global->__pyx_n_u_dtcount, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_dtcount = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1157
 *         info.dtcol = asReal(dtcol)
 *     cdef dtcount = options.pop('dtcount', None)
 *     if dtcount is not None:             # <<<<<<<<<<<<<<
 *         info.usedt = <PetscReal>PETSC_TRUE
 *         info.dtcount = <PetscReal>asInt(dtcount)
*/
  __pyx_t_2 = (__pyx_v_dtcount != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/petscmat.pxi":1158
 *     cdef dtcount = options.pop('dtcount', None)
 *     if dtcount is not None:
 *         info.usedt = <PetscReal>PETSC_TRUE             # <<<<<<<<<<<<<<
 *         info.dtcount = <PetscReal>asInt(dtcount)
 *     #
*/
    __pyx_v_info->usedt = ((PetscReal)PETSC_TRUE);

    /* "petsc4py/PETSc/petscmat.pxi":1159
 *     if dtcount is not None:
 *         info.usedt = <PetscReal>PETSC_TRUE
 *         info.dtcount = <PetscReal>asInt(dtcount)             # <<<<<<<<<<<<<<
 *     #
 *     cdef shifttype = options.pop('shifttype', None)
*/
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dtcount); if (unlikely(__pyx_t_7 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(19, 1159, __pyx_L1_error)
    __pyx_v_info->dtcount = ((PetscReal)__pyx_t_7);

    /* "petsc4py/PETSc/petscmat.pxi":1157
 *         info.dtcol = asReal(dtcol)
 *     cdef dtcount = options.pop('dtcount', None)
 *     if dtcount is not None:             # <<<<<<<<<<<<<<
 *         info.usedt = <PetscReal>PETSC_TRUE
 *         info.dtcount = <PetscReal>asInt(dtcount)
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1161
 *         info.dtcount = <PetscReal>asInt(dtcount)
 *     #
 *     cdef shifttype = options.pop('shifttype', None)             # <<<<<<<<<<<<<<
 *     if shifttype is not None:
 *         info.shifttype = <PetscReal>matfactorshifttype(shifttype)
*/
  __pyx_t_3 = __Pyx_PyDict_Pop(__pyx_v_options, __pyx_mstate_global->__pyx_n_u_shifttype, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_shifttype = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1162
 *     #
 *     cdef shifttype = options.pop('shifttype', None)
 *     if shifttype is not None:             # <<<<<<<<<<<<<<
 *         info.shifttype = <PetscReal>matfactorshifttype(shifttype)
 *     cdef shiftamount = options.pop('shiftamount', None)
*/
  __pyx_t_2 = (__pyx_v_shifttype != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/petscmat.pxi":1163
 *     cdef shifttype = options.pop('shifttype', None)
 *     if shifttype is not None:
 *         info.shifttype = <PetscReal>matfactorshifttype(shifttype)             # <<<<<<<<<<<<<<
 *     cdef shiftamount = options.pop('shiftamount', None)
 *     if shiftamount is not None:
*/
    __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_matfactorshifttype(__pyx_v_shifttype); if (unlikely(__pyx_t_8 == ((MatFactorShiftType)((MatFactorShiftType)-1L)))) __PYX_ERR(19, 1163, __pyx_L1_error)
    __pyx_v_info->shifttype = ((PetscReal)__pyx_t_8);

    /* "petsc4py/PETSc/petscmat.pxi":1162
 *     #
 *     cdef shifttype = options.pop('shifttype', None)
 *     if shifttype is not None:             # <<<<<<<<<<<<<<
 *         info.shifttype = <PetscReal>matfactorshifttype(shifttype)
 *     cdef shiftamount = options.pop('shiftamount', None)
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1164
 *     if shifttype is not None:
 *         info.shifttype = <PetscReal>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_mstate_global->__pyx_n_u_shiftamount, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_shiftamount = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1165
 *         info.shifttype = <PetscReal>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":1166
 *     cdef shiftamount = options.pop('shiftamount', None)
 *     if shiftamount is not None:
 *         info.shiftamount = asReal(shiftamount)             # <<<<<<<<<<<<<<
 *     #
 *     if options:
*/
    __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_shiftamount); if (unlikely(__pyx_t_6 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(19, 1166, __pyx_L1_error)
    __pyx_v_info->shiftamount = __pyx_t_6;

    /* "petsc4py/PETSc/petscmat.pxi":1165
 *         info.shifttype = <PetscReal>matfactorshifttype(shifttype)
 *     cdef shiftamount = options.pop('shiftamount', None)
 *     if shiftamount is not None:             # <<<<<<<<<<<<<<
 *         info.shiftamount = asReal(shiftamount)
 *     #
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1168
 *         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(19, 1168, __pyx_L1_error)
  if (unlikely(__pyx_t_2)) {

    /* "petsc4py/PETSc/petscmat.pxi":1169
 *     #
 *     if options:
 *         raise ValueError("unknown options: %s"             # <<<<<<<<<<<<<<
 *                          % list(options.keys()))
 *     return PETSC_SUCCESS
*/
    __pyx_t_4 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":1170
 *     if options:
 *         raise ValueError("unknown options: %s"
 *                          % list(options.keys()))             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
    __pyx_t_9 = __Pyx_PyDict_Keys(__pyx_v_options); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 1170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PySequence_ListKeepNew(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 1170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_unknown_options_s, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 1170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_9};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1169, __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(19, 1169, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1168
 *         info.shiftamount = asReal(shiftamount)
 *     #
 *     if options:             # <<<<<<<<<<<<<<
 *         raise ValueError("unknown options: %s"
 *                          % list(options.keys()))
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1171
 *         raise ValueError("unknown options: %s"
 *                          % list(options.keys()))
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * # -----------------------------------------------------------------------------
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscmat.pxi":1127
 *     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_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __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":1175
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  size_t __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("mat_getitem", 0);

  /* "petsc4py/PETSc/petscmat.pxi":1176
 * 
 * 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":1177
 * 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(19, 1177, __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_INCREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1177, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 1177, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 1177, __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(19, 1177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(19, 1177, __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(19, 1177, __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":1178
 *     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":1179
 *     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(19, 1179, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1180
 *     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_v_rows;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_indices, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(19, 1180, __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 != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(19, 1180, __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_INCREF(__pyx_t_3);
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_8);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1180, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1180, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 1180, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
      }
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      #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(19, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
      index = 0; __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 = 1; __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 = 2; __pyx_t_8 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_9), 3) < (0)) __PYX_ERR(19, 1180, __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(19, 1180, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __pyx_v_start = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_stop = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_stride = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":1181
 *         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(19, 1181, __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":1178
 *     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":1182
 *         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":1183
 *         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(19, 1183, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1184
 *     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_8 = __pyx_v_cols;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_1};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_indices, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 1184, __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 != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(19, 1184, __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_INCREF(__pyx_t_1);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_3);
      } else {
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1184, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 1184, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1184, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
      }
      #else
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 1184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1184, __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_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 1184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
      index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_8 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      index = 2; __pyx_t_3 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_9), 3) < (0)) __PYX_ERR(19, 1184, __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(19, 1184, __pyx_L1_error)
      __pyx_L10_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_stop, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":1185
 *         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(19, 1185, __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":1182
 *         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":1186
 *         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(19, 1186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscmat.pxi":1175
 * # -----------------------------------------------------------------------------
 * 
 * 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_8);
  __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":1189
 * 
 * 
 * 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;
  size_t __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("mat_setitem", 0);

  /* "petsc4py/PETSc/petscmat.pxi":1190
 * 
 * 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":1191
 * 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(19, 1191, __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_INCREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1191, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 1191, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 1191, __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(19, 1191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(19, 1191, __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(19, 1191, __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":1192
 *     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":1193
 *     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(19, 1193, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1194
 *     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_v_rows;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_indices, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(19, 1194, __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 != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(19, 1194, __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_INCREF(__pyx_t_3);
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_8);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1194, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1194, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 1194, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
      }
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 1194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      #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(19, 1194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
      index = 0; __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 = 1; __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 = 2; __pyx_t_8 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_9), 3) < (0)) __PYX_ERR(19, 1194, __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(19, 1194, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __pyx_v_start = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_stop = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_stride = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":1195
 *         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(19, 1195, __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":1192
 *     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":1196
 *         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":1197
 *         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(19, 1197, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1198
 *     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_8 = __pyx_v_cols;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_1};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_indices, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 1198, __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 != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(19, 1198, __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_INCREF(__pyx_t_1);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_8);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_3);
      } else {
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1198, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 1198, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1198, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
      }
      #else
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 1198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1198, __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_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 1198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_9);
      index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_8 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_8);
      index = 2; __pyx_t_3 = __pyx_t_4(__pyx_t_9); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_9), 3) < (0)) __PYX_ERR(19, 1198, __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(19, 1198, __pyx_L1_error)
      __pyx_L10_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_stop, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_stride, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":1199
 *         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(19, 1199, __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":1196
 *         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":1200
 *         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(19, 1200, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":1201
 *         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":1189
 * 
 * 
 * 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_8);
  __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":1205
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  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":1209
 *                         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":1210
 *     # 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(19, 1210, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/petscmat.pxi":1211
 *     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":1212
 *     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":1214
 *     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":1215
 *     # 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":1216
 *     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(19, 1216, __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":1217
 *     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)) {
    __pyx_t_4 = NULL;

    /* "petsc4py/PETSc/petscmat.pxi":1218
 *     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_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 1218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_incompatible_array_sizes_nv_d, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 1218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 1217, __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(19, 1217, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1217
 *     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:
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1219
 *     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":1220
 *         "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(19, 1220, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1219
 *     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":1225
 *                                           v, im))
 *     else:
 *         CHKERR(MatSetValuesStencil(A,             # <<<<<<<<<<<<<<
 *                                    1, &r.stencil,
 *                                    1, &c.stencil,
*/
  /*else*/ {

    /* "petsc4py/PETSc/petscmat.pxi":1228
 *                                    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(19, 1225, __pyx_L1_error)
  }
  __pyx_L7:;

  /* "petsc4py/PETSc/petscmat.pxi":1229
 *                                    1, &c.stencil,
 *                                    v, im))
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * cdef mat_get_dlpack_ctx(Mat self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_0);
  __pyx_r = __pyx_mstate_global->__pyx_int_0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscmat.pxi":1205
 * # -----------------------------------------------------------------------------
 * 
 * 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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":1231
 *     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;
  size_t __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;
  PetscErrorCode __pyx_t_9;
  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", 0);

  /* "petsc4py/PETSc/petscmat.pxi":1232
 * 
 * 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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getType, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_n_u_dense, __pyx_t_1, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(19, 1232, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_4)) {

    /* "petsc4py/PETSc/petscmat.pxi":1233
 * 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 = NULL;
    __pyx_t_6 = __pyx_mstate_global->__pyx_kp_u_Not_for_type;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_t_8 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
      __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getType, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 1233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_t_3 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_7};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 1233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_3 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1233, __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(19, 1233, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1232
 * 
 * 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":1234
 *     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_1 = ((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_1)) __PYX_ERR(19, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ctx0 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1235
 *         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":1236
 *     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":1237
 *     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":1238
 *     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":1239
 *     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":1240
 *     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":1241
 *     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":1242
 *     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(<PetscInt>ndim), NULL, <void**>&shape_arr)
*/
  __pyx_v_mtype = PETSC_MEMTYPE_HOST;

  /* "petsc4py/PETSc/petscmat.pxi":1243
 *     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(<PetscInt>ndim), NULL, <void**>&shape_arr)
 *         s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&strides_arr)
*/
  __pyx_t_4 = (__pyx_v_ctx0 == Py_None);
  if (__pyx_t_4) {

    /* "petsc4py/PETSc/petscmat.pxi":1244
 *     cdef PetscMemType mtype = PETSC_MEMTYPE_HOST
 *     if ctx0 is None: # First time in, create a linear memory view
 *         s1 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&shape_arr)             # <<<<<<<<<<<<<<
 *         s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&strides_arr)
 *         CHKERR(MatGetSize(self.mat, NULL, &n))
*/
    __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_ndim))); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_1, NULL, ((void **)(&__pyx_v_shape_arr)))); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 1244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_s1, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":1245
 *     if ctx0 is None: # First time in, create a linear memory view
 *         s1 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&shape_arr)
 *         s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&strides_arr)             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetSize(self.mat, NULL, &n))
 *         CHKERR(MatGetLocalSize(self.mat, &m, NULL))
*/
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_ndim))); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 1245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_5, NULL, ((void **)(&__pyx_v_strides_arr)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_s2, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "petsc4py/PETSc/petscmat.pxi":1246
 *         s1 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&shape_arr)
 *         s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&strides_arr)
 *         CHKERR(MatGetSize(self.mat, NULL, &n))             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetLocalSize(self.mat, &m, NULL))
 *         CHKERR(MatDenseGetLDA(self.mat, &lda))
*/
    __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetSize(__pyx_v_self->mat, NULL, (&__pyx_v_n))); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(19, 1246, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1247
 *         s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&strides_arr)
 *         CHKERR(MatGetSize(self.mat, NULL, &n))
 *         CHKERR(MatGetLocalSize(self.mat, &m, NULL))             # <<<<<<<<<<<<<<
 *         CHKERR(MatDenseGetLDA(self.mat, &lda))
 *         shape_arr[0] = <int64_t>m
*/
    __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_self->mat, (&__pyx_v_m), NULL)); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(19, 1247, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1248
 *         CHKERR(MatGetSize(self.mat, NULL, &n))
 *         CHKERR(MatGetLocalSize(self.mat, &m, NULL))
 *         CHKERR(MatDenseGetLDA(self.mat, &lda))             # <<<<<<<<<<<<<<
 *         shape_arr[0] = <int64_t>m
 *         shape_arr[1] = <int64_t>n
*/
    __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetLDA(__pyx_v_self->mat, (&__pyx_v_lda))); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(19, 1248, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1249
 *         CHKERR(MatGetLocalSize(self.mat, &m, NULL))
 *         CHKERR(MatDenseGetLDA(self.mat, &lda))
 *         shape_arr[0] = <int64_t>m             # <<<<<<<<<<<<<<
 *         shape_arr[1] = <int64_t>n
 *         strides_arr[0] = 1
*/
    (__pyx_v_shape_arr[0]) = ((int64_t)__pyx_v_m);

    /* "petsc4py/PETSc/petscmat.pxi":1250
 *         CHKERR(MatDenseGetLDA(self.mat, &lda))
 *         shape_arr[0] = <int64_t>m
 *         shape_arr[1] = <int64_t>n             # <<<<<<<<<<<<<<
 *         strides_arr[0] = 1
 *         strides_arr[1] = <int64_t>lda
*/
    (__pyx_v_shape_arr[1]) = ((int64_t)__pyx_v_n);

    /* "petsc4py/PETSc/petscmat.pxi":1251
 *         shape_arr[0] = <int64_t>m
 *         shape_arr[1] = <int64_t>n
 *         strides_arr[0] = 1             # <<<<<<<<<<<<<<
 *         strides_arr[1] = <int64_t>lda
 *     else:
*/
    (__pyx_v_strides_arr[0]) = 1;

    /* "petsc4py/PETSc/petscmat.pxi":1252
 *         shape_arr[1] = <int64_t>n
 *         strides_arr[0] = 1
 *         strides_arr[1] = <int64_t>lda             # <<<<<<<<<<<<<<
 *     else:
 *         (_, _, ndim, s1, s2) = ctx0
*/
    (__pyx_v_strides_arr[1]) = ((int64_t)__pyx_v_lda);

    /* "petsc4py/PETSc/petscmat.pxi":1243
 *     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(<PetscInt>ndim), NULL, <void**>&shape_arr)
 *         s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&strides_arr)
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/petscmat.pxi":1254
 *         strides_arr[1] = <int64_t>lda
 *     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(19, 1254, __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_INCREF(__pyx_t_1);
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3);
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4);
        __Pyx_INCREF(__pyx_t_6);
      } else {
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 1254, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 1254, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 1254, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 1254, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 4, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 1254, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
      }
      #else
      {
        Py_ssize_t i;
        PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_5,&__pyx_t_2,&__pyx_t_7,&__pyx_t_6};
        for (i=0; i < 5; i++) {
          PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(19, 1254, __pyx_L1_error)
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[5] = {&__pyx_t_1,&__pyx_t_5,&__pyx_t_2,&__pyx_t_7,&__pyx_t_6};
      __pyx_t_8 = PyObject_GetIter(__pyx_v_ctx0); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 1254, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
      for (index=0; index < 5; index++) {
        PyObject* item = __pyx_t_10(__pyx_t_8); if (unlikely(!item)) goto __pyx_L5_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_8), 5) < (0)) __PYX_ERR(19, 1254, __pyx_L1_error)
      __pyx_t_10 = 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_10 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(19, 1254, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __pyx_t_11 = __Pyx_PyLong_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(19, 1254, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v__ = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v__, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_v_ndim = __pyx_t_11;
    __Pyx_DECREF_SET(__pyx_v_s1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_s2, __pyx_t_6);
    __pyx_t_6 = 0;
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/petscmat.pxi":1256
 *         (_, _, ndim, s1, s2) = ctx0
 * 
 *     devType_ = {PETSC_MEMTYPE_HOST : kDLCPU, PETSC_MEMTYPE_CUDA : kDLCUDA, PETSC_MEMTYPE_HIP : kDLROCM}             # <<<<<<<<<<<<<<
 *     CHKERR(MatGetCurrentMemType(self.mat, &mtype))
 *     dtype = devType_.get(mtype, kDLCPU)
*/
  __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyLong_From_PetscMemType(PETSC_MEMTYPE_HOST); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_7, __pyx_t_2) < (0)) __PYX_ERR(19, 1256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_PetscMemType(PETSC_MEMTYPE_CUDA); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCUDA); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_2, __pyx_t_7) < (0)) __PYX_ERR(19, 1256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyLong_From_PetscMemType(PETSC_MEMTYPE_HIP); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLROCM); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_6, __pyx_t_7, __pyx_t_2) < (0)) __PYX_ERR(19, 1256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_devType_ = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1257
 * 
 *     devType_ = {PETSC_MEMTYPE_HOST : kDLCPU, PETSC_MEMTYPE_CUDA : kDLCUDA, PETSC_MEMTYPE_HIP : kDLROCM}
 *     CHKERR(MatGetCurrentMemType(self.mat, &mtype))             # <<<<<<<<<<<<<<
 *     dtype = devType_.get(mtype, kDLCPU)
 *     if dtype != kDLCPU:
*/
  __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetCurrentMemType(__pyx_v_self->mat, (&__pyx_v_mtype))); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(19, 1257, __pyx_L1_error)

  /* "petsc4py/PETSc/petscmat.pxi":1258
 *     devType_ = {PETSC_MEMTYPE_HOST : kDLCPU, PETSC_MEMTYPE_CUDA : kDLCUDA, PETSC_MEMTYPE_HIP : kDLROCM}
 *     CHKERR(MatGetCurrentMemType(self.mat, &mtype))
 *     dtype = devType_.get(mtype, kDLCPU)             # <<<<<<<<<<<<<<
 *     if dtype != kDLCPU:
 *         CHKERR(PetscObjectGetDeviceId(<PetscObject>self.mat, &devId))
*/
  __pyx_t_6 = __Pyx_PyLong_From_PetscMemType(__pyx_v_mtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyDict_GetItemDefault(__pyx_v_devType_, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_dtype = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1259
 *     CHKERR(MatGetCurrentMemType(self.mat, &mtype))
 *     dtype = devType_.get(mtype, kDLCPU)
 *     if dtype != kDLCPU:             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetDeviceId(<PetscObject>self.mat, &devId))
 *     ctx0 = (dtype, devId, ndim, s1, s2)
*/
  __pyx_t_7 = __Pyx_PyLong_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 1259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_dtype, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 1259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(19, 1259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "petsc4py/PETSc/petscmat.pxi":1260
 *     dtype = devType_.get(mtype, kDLCPU)
 *     if dtype != kDLCPU:
 *         CHKERR(PetscObjectGetDeviceId(<PetscObject>self.mat, &devId))             # <<<<<<<<<<<<<<
 *     ctx0 = (dtype, devId, ndim, s1, s2)
 *     self.set_attr('__dltensor_ctx__', ctx0)
*/
    __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetDeviceId(((PetscObject)__pyx_v_self->mat), (&__pyx_v_devId))); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(19, 1260, __pyx_L1_error)

    /* "petsc4py/PETSc/petscmat.pxi":1259
 *     CHKERR(MatGetCurrentMemType(self.mat, &mtype))
 *     dtype = devType_.get(mtype, kDLCPU)
 *     if dtype != kDLCPU:             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetDeviceId(<PetscObject>self.mat, &devId))
 *     ctx0 = (dtype, devId, ndim, s1, s2)
*/
  }

  /* "petsc4py/PETSc/petscmat.pxi":1261
 *     if dtype != kDLCPU:
 *         CHKERR(PetscObjectGetDeviceId(<PetscObject>self.mat, &devId))
 *     ctx0 = (dtype, devId, ndim, s1, s2)             # <<<<<<<<<<<<<<
 *     self.set_attr('__dltensor_ctx__', ctx0)
 *     return ctx0
*/
  __pyx_t_2 = __Pyx_PyLong_From_PetscInt(__pyx_v_devId); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 1261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyLong_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 1261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 1261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_dtype);
  __Pyx_GIVEREF(__pyx_v_dtype);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_dtype) != (0)) __PYX_ERR(19, 1261, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2) != (0)) __PYX_ERR(19, 1261, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_7) != (0)) __PYX_ERR(19, 1261, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_s1);
  __Pyx_GIVEREF(__pyx_v_s1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_s1) != (0)) __PYX_ERR(19, 1261, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_s2);
  __Pyx_GIVEREF(__pyx_v_s2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_v_s2) != (0)) __PYX_ERR(19, 1261, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_7 = 0;
  __Pyx_DECREF_SET(__pyx_v_ctx0, __pyx_t_6);
  __pyx_t_6 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1262
 *         CHKERR(PetscObjectGetDeviceId(<PetscObject>self.mat, &devId))
 *     ctx0 = (dtype, devId, ndim, s1, s2)
 *     self.set_attr('__dltensor_ctx__', ctx0)             # <<<<<<<<<<<<<<
 *     return ctx0
 * 
*/
  __pyx_t_6 = ((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_6)) __PYX_ERR(19, 1262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "petsc4py/PETSc/petscmat.pxi":1263
 *     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":1231
 *     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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __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":367
 * # --------------------------------------------------------------------
 * 
 * cdef inline PC ref_PC(PetscPC pc):             # <<<<<<<<<<<<<<
 *     cdef PC ob = <PC> 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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ref_PC", 0);

  /* "petsc4py/PETSc/petscpc.pxi":368
 * 
 * cdef inline PC ref_PC(PetscPC pc):
 *     cdef PC ob = <PC> PC()             # <<<<<<<<<<<<<<
 *     ob.pc = pc
 *     CHKERR(PetscINCREF(ob.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 368, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_t_2 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ob = ((struct PyPetscPCObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":369
 * cdef inline PC ref_PC(PetscPC pc):
 *     cdef PC ob = <PC> PC()
 *     ob.pc = pc             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(ob.obj))
 *     return ob
*/
  __pyx_v_ob->pc = __pyx_v_pc;

  /* "petsc4py/PETSc/petscpc.pxi":370
 *     cdef PC ob = <PC> PC()
 *     ob.pc = pc
 *     CHKERR(PetscINCREF(ob.obj))             # <<<<<<<<<<<<<<
 *     return ob
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(20, 370, __pyx_L1_error)

  /* "petsc4py/PETSc/petscpc.pxi":371
 *     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":367
 * # --------------------------------------------------------------------
 * 
 * cdef inline PC ref_PC(PetscPC pc):             # <<<<<<<<<<<<<<
 *     cdef PC ob = <PC> 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":373
 *     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;
  char *__pyx_t_9;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCPatch_ComputeOperator", 0);

  /* "petsc4py/PETSc/petscpc.pxi":383
 *     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(20, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Vec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":384
 *     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(20, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Mat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":385
 *     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(20, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":386
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_cells)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Is = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":387
 *     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 = <object>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(20, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":388
 *     cdef IS Is = ref_IS(cells)
 *     cdef object context = Pc.get_attr("__patch_compute_operator__")
 *     if context is None and ctx != NULL: context = <object>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":389
 *     cdef object context = Pc.get_attr("__patch_compute_operator__")
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple             # <<<<<<<<<<<<<<
 *     (op, args, kargs) = context
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(20, 389, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(20, 389, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscpc.pxi":390
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple
 *     (op, args, kargs) = context             # <<<<<<<<<<<<<<
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>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(20, 390, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 390, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 390, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 390, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 390, __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(20, 390, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(20, 390, __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(20, 390, __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":391
 *     assert context is not None and type(context) is tuple
 *     (op, args, kargs) = context
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>dofmap             # <<<<<<<<<<<<<<
 *     cdef PetscInt[:] pydofsWithAll
 *     if dofmapWithAll != NULL:
*/
  if (!__pyx_v_dofmap) {
    PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
    __PYX_ERR(20, 391, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = Py_BuildValue("("  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_t_9 = PyBytes_AsString(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 391, __pyx_L1_error)
  #else
  __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_4);
  #endif
  __pyx_t_8 = __pyx_array_new(__pyx_t_5, sizeof(PetscInt), __pyx_t_9, "c", (char *) __pyx_v_dofmap); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 391, __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_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(20, 391, __pyx_L1_error)
  __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_pydofs = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "petsc4py/PETSc/petscpc.pxi":393
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>dofmap
 *     cdef PetscInt[:] pydofsWithAll
 *     if dofmapWithAll != NULL:             # <<<<<<<<<<<<<<
 *         pydofsWithAll = <PetscInt[:ndof]>dofmapWithAll
 *         dofsall = asarray(pydofsWithAll)
*/
  __pyx_t_2 = (__pyx_v_dofmapWithAll != NULL);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/petscpc.pxi":394
 *     cdef PetscInt[:] pydofsWithAll
 *     if dofmapWithAll != NULL:
 *         pydofsWithAll = <PetscInt[:ndof]>dofmapWithAll             # <<<<<<<<<<<<<<
 *         dofsall = asarray(pydofsWithAll)
 *     else:
*/
    if (!__pyx_v_dofmapWithAll) {
      PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
      __PYX_ERR(20, 394, __pyx_L1_error)
    }
    __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = Py_BuildValue("("  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #if CYTHON_COMPILING_IN_LIMITED_API
    __pyx_t_9 = PyBytes_AsString(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 394, __pyx_L1_error)
    #else
    __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_5);
    #endif
    __pyx_t_8 = __pyx_array_new(__pyx_t_4, sizeof(PetscInt), __pyx_t_9, "c", (char *) __pyx_v_dofmapWithAll); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 394, __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_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(20, 394, __pyx_L1_error)
    __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
    __pyx_v_pydofsWithAll = __pyx_t_10;
    __pyx_t_10.memview = NULL;
    __pyx_t_10.data = NULL;

    /* "petsc4py/PETSc/petscpc.pxi":395
 *     if dofmapWithAll != NULL:
 *         pydofsWithAll = <PetscInt[:ndof]>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(20, 395, __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(20, 395, __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":393
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>dofmap
 *     cdef PetscInt[:] pydofsWithAll
 *     if dofmapWithAll != NULL:             # <<<<<<<<<<<<<<
 *         pydofsWithAll = <PetscInt[:ndof]>dofmapWithAll
 *         dofsall = asarray(pydofsWithAll)
*/
    goto __pyx_L10;
  }

  /* "petsc4py/PETSc/petscpc.pxi":397
 *         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":398
 *     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(20, 398, __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(20, 398, __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(20, 398, __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(20, 398, __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)) != (0)) __PYX_ERR(20, 398, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(20, 398, __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)) != (0)) __PYX_ERR(20, 398, __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)) != (0)) __PYX_ERR(20, 398, __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)) != (0)) __PYX_ERR(20, 398, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_1) != (0)) __PYX_ERR(20, 398, __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)) != (0)) __PYX_ERR(20, 398, __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(20, 398, __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(20, 398, __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(20, 398, __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(20, 398, __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(20, 398, __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(20, 398, __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":399
 *         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":373
 *     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_10, 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscpc.pxi":401
 *     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;
  char *__pyx_t_9;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCPatch_ComputeFunction", 0);

  /* "petsc4py/PETSc/petscpc.pxi":411
 *     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(20, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Out = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":412
 *     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(20, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Vec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":413
 *     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(20, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":414
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_cells)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Is = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":415
 *     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 = <object>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(20, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":416
 *     cdef IS Is = ref_IS(cells)
 *     cdef object context = Pc.get_attr("__patch_compute_function__")
 *     if context is None and ctx != NULL: context = <object>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":417
 *     cdef object context = Pc.get_attr("__patch_compute_function__")
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple             # <<<<<<<<<<<<<<
 *     (op, args, kargs) = context
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(20, 417, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(20, 417, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscpc.pxi":418
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple
 *     (op, args, kargs) = context             # <<<<<<<<<<<<<<
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>dofmap
 *     cdef PetscInt[:] pydofsWithAll = <PetscInt[:ndof]>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(20, 418, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 418, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 418, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 418, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 418, __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(20, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(20, 418, __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(20, 418, __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":419
 *     assert context is not None and type(context) is tuple
 *     (op, args, kargs) = context
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>dofmap             # <<<<<<<<<<<<<<
 *     cdef PetscInt[:] pydofsWithAll = <PetscInt[:ndof]>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(20, 419, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = Py_BuildValue("("  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_t_9 = PyBytes_AsString(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 419, __pyx_L1_error)
  #else
  __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_4);
  #endif
  __pyx_t_8 = __pyx_array_new(__pyx_t_5, sizeof(PetscInt), __pyx_t_9, "c", (char *) __pyx_v_dofmap); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 419, __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_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(20, 419, __pyx_L1_error)
  __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_pydofs = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "petsc4py/PETSc/petscpc.pxi":420
 *     (op, args, kargs) = context
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>dofmap
 *     cdef PetscInt[:] pydofsWithAll = <PetscInt[:ndof]>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(20, 420, __pyx_L1_error)
  }
  __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = Py_BuildValue("("  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_t_9 = PyBytes_AsString(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 420, __pyx_L1_error)
  #else
  __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_5);
  #endif
  __pyx_t_8 = __pyx_array_new(__pyx_t_4, sizeof(PetscInt), __pyx_t_9, "c", (char *) __pyx_v_dofmapWithAll); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 420, __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_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(20, 420, __pyx_L1_error)
  __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_pydofsWithAll = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "petsc4py/PETSc/petscpc.pxi":421
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>dofmap
 *     cdef PetscInt[:] pydofsWithAll = <PetscInt[:ndof]>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(20, 421, __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(20, 421, __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(20, 421, __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(20, 421, __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(20, 421, __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(20, 421, __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)) != (0)) __PYX_ERR(20, 421, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5) != (0)) __PYX_ERR(20, 421, __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)) != (0)) __PYX_ERR(20, 421, __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)) != (0)) __PYX_ERR(20, 421, __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)) != (0)) __PYX_ERR(20, 421, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_1) != (0)) __PYX_ERR(20, 421, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_6) != (0)) __PYX_ERR(20, 421, __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(20, 421, __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(20, 421, __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(20, 421, __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(20, 421, __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(20, 421, __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(20, 421, __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":422
 *     cdef PetscInt[:] pydofsWithAll = <PetscInt[:ndof]>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":401
 *     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_10, 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscpc.pxi":424
 *     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;
  char *__pyx_t_9;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCPatch_ComputeOperatorInteriorFacets", 0);

  /* "petsc4py/PETSc/petscpc.pxi":434
 *     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(20, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Vec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":435
 *     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(20, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Mat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":436
 *     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(20, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":437
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_facets)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Is = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":438
 *     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 = <object>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(20, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":439
 *     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 = <object>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":440
 *     cdef object context = Pc.get_attr("__patch_compute_operator_interior_facets__")
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple             # <<<<<<<<<<<<<<
 *     (op, args, kargs) = context
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(20, 440, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(20, 440, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscpc.pxi":441
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple
 *     (op, args, kargs) = context             # <<<<<<<<<<<<<<
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>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(20, 441, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 441, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 441, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 441, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 441, __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(20, 441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(20, 441, __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(20, 441, __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":442
 *     assert context is not None and type(context) is tuple
 *     (op, args, kargs) = context
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>dofmap             # <<<<<<<<<<<<<<
 *     cdef PetscInt[:] pydofsWithAll
 *     if dofmapWithAll != NULL:
*/
  if (!__pyx_v_dofmap) {
    PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
    __PYX_ERR(20, 442, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = Py_BuildValue("("  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_t_9 = PyBytes_AsString(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 442, __pyx_L1_error)
  #else
  __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_4);
  #endif
  __pyx_t_8 = __pyx_array_new(__pyx_t_5, sizeof(PetscInt), __pyx_t_9, "c", (char *) __pyx_v_dofmap); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 442, __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_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(20, 442, __pyx_L1_error)
  __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_pydofs = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "petsc4py/PETSc/petscpc.pxi":444
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>dofmap
 *     cdef PetscInt[:] pydofsWithAll
 *     if dofmapWithAll != NULL:             # <<<<<<<<<<<<<<
 *         pydofsWithAll = <PetscInt[:ndof]>dofmapWithAll
 *         dofsall = asarray(pydofsWithAll)
*/
  __pyx_t_2 = (__pyx_v_dofmapWithAll != NULL);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/petscpc.pxi":445
 *     cdef PetscInt[:] pydofsWithAll
 *     if dofmapWithAll != NULL:
 *         pydofsWithAll = <PetscInt[:ndof]>dofmapWithAll             # <<<<<<<<<<<<<<
 *         dofsall = asarray(pydofsWithAll)
 *     else:
*/
    if (!__pyx_v_dofmapWithAll) {
      PyErr_SetString(PyExc_ValueError,"Cannot create cython.array from NULL pointer");
      __PYX_ERR(20, 445, __pyx_L1_error)
    }
    __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = Py_BuildValue("("  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #if CYTHON_COMPILING_IN_LIMITED_API
    __pyx_t_9 = PyBytes_AsString(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 445, __pyx_L1_error)
    #else
    __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_5);
    #endif
    __pyx_t_8 = __pyx_array_new(__pyx_t_4, sizeof(PetscInt), __pyx_t_9, "c", (char *) __pyx_v_dofmapWithAll); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 445, __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_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(20, 445, __pyx_L1_error)
    __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
    __pyx_v_pydofsWithAll = __pyx_t_10;
    __pyx_t_10.memview = NULL;
    __pyx_t_10.data = NULL;

    /* "petsc4py/PETSc/petscpc.pxi":446
 *     if dofmapWithAll != NULL:
 *         pydofsWithAll = <PetscInt[:ndof]>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(20, 446, __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(20, 446, __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":444
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>dofmap
 *     cdef PetscInt[:] pydofsWithAll
 *     if dofmapWithAll != NULL:             # <<<<<<<<<<<<<<
 *         pydofsWithAll = <PetscInt[:ndof]>dofmapWithAll
 *         dofsall = asarray(pydofsWithAll)
*/
    goto __pyx_L10;
  }

  /* "petsc4py/PETSc/petscpc.pxi":448
 *         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":449
 *     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(20, 449, __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(20, 449, __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(20, 449, __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(20, 449, __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)) != (0)) __PYX_ERR(20, 449, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(20, 449, __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)) != (0)) __PYX_ERR(20, 449, __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)) != (0)) __PYX_ERR(20, 449, __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)) != (0)) __PYX_ERR(20, 449, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_1) != (0)) __PYX_ERR(20, 449, __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)) != (0)) __PYX_ERR(20, 449, __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(20, 449, __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(20, 449, __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(20, 449, __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(20, 449, __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(20, 449, __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(20, 449, __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":450
 *         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":424
 *     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_10, 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscpc.pxi":452
 *     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;
  char *__pyx_t_9;
  __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCPatch_ComputeFunctionInteriorFacets", 0);

  /* "petsc4py/PETSc/petscpc.pxi":462
 *     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(20, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Out = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":463
 *     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(20, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Vec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":464
 *     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(20, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":465
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_facets)); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Is = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":466
 *     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 = <object>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(20, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":467
 *     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 = <object>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":468
 *     cdef object context = Pc.get_attr("__patch_compute_function_interior_facets__")
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple             # <<<<<<<<<<<<<<
 *     (op, args, kargs) = context
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(20, 468, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(20, 468, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscpc.pxi":469
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple
 *     (op, args, kargs) = context             # <<<<<<<<<<<<<<
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>dofmap
 *     cdef PetscInt[:] pydofsWithAll = <PetscInt[:ndof]>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(20, 469, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 469, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 469, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 469, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 469, __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(20, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(20, 469, __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(20, 469, __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":470
 *     assert context is not None and type(context) is tuple
 *     (op, args, kargs) = context
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>dofmap             # <<<<<<<<<<<<<<
 *     cdef PetscInt[:] pydofsWithAll = <PetscInt[:ndof]>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(20, 470, __pyx_L1_error)
  }
  __pyx_t_4 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = Py_BuildValue("("  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_t_9 = PyBytes_AsString(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 470, __pyx_L1_error)
  #else
  __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_4);
  #endif
  __pyx_t_8 = __pyx_array_new(__pyx_t_5, sizeof(PetscInt), __pyx_t_9, "c", (char *) __pyx_v_dofmap); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 470, __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_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(20, 470, __pyx_L1_error)
  __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_pydofs = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "petsc4py/PETSc/petscpc.pxi":471
 *     (op, args, kargs) = context
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>dofmap
 *     cdef PetscInt[:] pydofsWithAll = <PetscInt[:ndof]>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(20, 471, __pyx_L1_error)
  }
  __pyx_t_5 = __pyx_format_from_typeinfo(&__Pyx_TypeInfo_nn_PetscInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = Py_BuildValue("("  __PYX_BUILD_PY_SSIZE_T  ")", ((Py_ssize_t)__pyx_v_ndof)); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_t_9 = PyBytes_AsString(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(20, 471, __pyx_L1_error)
  #else
  __pyx_t_9 = PyBytes_AS_STRING(__pyx_t_5);
  #endif
  __pyx_t_8 = __pyx_array_new(__pyx_t_4, sizeof(PetscInt), __pyx_t_9, "c", (char *) __pyx_v_dofmapWithAll); if (unlikely(!__pyx_t_8)) __PYX_ERR(20, 471, __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_10 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn_PetscInt(((PyObject *)__pyx_t_8), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(20, 471, __pyx_L1_error)
  __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
  __pyx_v_pydofsWithAll = __pyx_t_10;
  __pyx_t_10.memview = NULL;
  __pyx_t_10.data = NULL;

  /* "petsc4py/PETSc/petscpc.pxi":472
 *     cdef PetscInt[:] pydofs = <PetscInt[:ndof]>dofmap
 *     cdef PetscInt[:] pydofsWithAll = <PetscInt[:ndof]>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(20, 472, __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(20, 472, __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(20, 472, __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(20, 472, __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(20, 472, __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(20, 472, __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)) != (0)) __PYX_ERR(20, 472, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5) != (0)) __PYX_ERR(20, 472, __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)) != (0)) __PYX_ERR(20, 472, __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)) != (0)) __PYX_ERR(20, 472, __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)) != (0)) __PYX_ERR(20, 472, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_1) != (0)) __PYX_ERR(20, 472, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_6) != (0)) __PYX_ERR(20, 472, __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(20, 472, __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(20, 472, __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(20, 472, __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(20, 472, __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(20, 472, __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(20, 472, __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":473
 *     cdef PetscInt[:] pydofsWithAll = <PetscInt[:ndof]>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":452
 *     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_10, 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscpc.pxi":475
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCPatch_UserConstructOperator", 0);

  /* "petsc4py/PETSc/petscpc.pxi":481
 *     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(20, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Pc = ((struct PyPetscPCObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":483
 *     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 = <object>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(20, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscpc.pxi":484
 *     cdef PetscInt i
 *     cdef object context = Pc.get_attr("__patch_construction_operator__")
 *     if context is None and ctx != NULL: context = <object>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":485
 *     cdef object context = Pc.get_attr("__patch_construction_operator__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(20, 485, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(20, 485, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscpc.pxi":486
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple
 *     (op, args, kargs) = context             # <<<<<<<<<<<<<<
 *     (patches, iterationSet) = op(Pc, *args, **kargs)
 *     n[0] = <PetscInt>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(20, 486, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 486, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 486, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 486, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 486, __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(20, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(20, 486, __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(20, 486, __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":487
 *     assert context is not None and type(context) is tuple
 *     (op, args, kargs) = context
 *     (patches, iterationSet) = op(Pc, *args, **kargs)             # <<<<<<<<<<<<<<
 *     n[0] = <PetscInt>len(patches)
 *     CHKERR(PetscMalloc(<size_t>n[0]*sizeof(PetscIS), userIS))
*/
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 487, __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)) != (0)) __PYX_ERR(20, 487, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 487, __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(20, 487, __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(20, 487, __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(20, 487, __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(20, 487, __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(20, 487, __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(20, 487, __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_INCREF(__pyx_t_4);
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_1);
    } else {
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 487, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 487, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
    }
    #else
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(20, 487, __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(20, 487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(20, 487, __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(20, 487, __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":488
 *     (op, args, kargs) = context
 *     (patches, iterationSet) = op(Pc, *args, **kargs)
 *     n[0] = <PetscInt>len(patches)             # <<<<<<<<<<<<<<
 *     CHKERR(PetscMalloc(<size_t>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(20, 488, __pyx_L1_error)
  (__pyx_v_n[0]) = ((PetscInt)__pyx_t_8);

  /* "petsc4py/PETSc/petscpc.pxi":489
 *     (patches, iterationSet) = op(Pc, *args, **kargs)
 *     n[0] = <PetscInt>len(patches)
 *     CHKERR(PetscMalloc(<size_t>n[0]*sizeof(PetscIS), userIS))             # <<<<<<<<<<<<<<
 *     for i in range(n[0]):
 *         userIS[0][i] = (<IS?>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(20, 489, __pyx_L1_error)

  /* "petsc4py/PETSc/petscpc.pxi":490
 *     n[0] = <PetscInt>len(patches)
 *     CHKERR(PetscMalloc(<size_t>n[0]*sizeof(PetscIS), userIS))
 *     for i in range(n[0]):             # <<<<<<<<<<<<<<
 *         userIS[0][i] = (<IS?>patches[i]).iset
 *         CHKERR(PetscINCREF(<PetscObject*>&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":491
 *     CHKERR(PetscMalloc(<size_t>n[0]*sizeof(PetscIS), userIS))
 *     for i in range(n[0]):
 *         userIS[0][i] = (<IS?>patches[i]).iset             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(<PetscObject*>&userIS[0][i]))
 *     userIterationSet[0] = (<IS?>iterationSet).iset
*/
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_patches, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(20, 491, __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":492
 *     for i in range(n[0]):
 *         userIS[0][i] = (<IS?>patches[i]).iset
 *         CHKERR(PetscINCREF(<PetscObject*>&userIS[0][i]))             # <<<<<<<<<<<<<<
 *     userIterationSet[0] = (<IS?>iterationSet).iset
 *     CHKERR(PetscINCREF(<PetscObject*>&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(20, 492, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/petscpc.pxi":493
 *         userIS[0][i] = (<IS?>patches[i]).iset
 *         CHKERR(PetscINCREF(<PetscObject*>&userIS[0][i]))
 *     userIterationSet[0] = (<IS?>iterationSet).iset             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(<PetscObject*>&userIterationSet[0]))
 *     return PETSC_SUCCESS
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_iterationSet, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(20, 493, __pyx_L1_error)
  __pyx_t_13 = ((struct PyPetscISObject *)__pyx_v_iterationSet)->iset;
  (__pyx_v_userIterationSet[0]) = __pyx_t_13;

  /* "petsc4py/PETSc/petscpc.pxi":494
 *         CHKERR(PetscINCREF(<PetscObject*>&userIS[0][i]))
 *     userIterationSet[0] = (<IS?>iterationSet).iset
 *     CHKERR(PetscINCREF(<PetscObject*>&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(20, 494, __pyx_L1_error)

  /* "petsc4py/PETSc/petscpc.pxi":495
 *     userIterationSet[0] = (<IS?>iterationSet).iset
 *     CHKERR(PetscINCREF(<PetscObject*>&userIterationSet[0]))
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscpc.pxi":475
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscksp.pxi":243
 * # -----------------------------------------------------------------------------
 * 
 * cdef inline KSP ref_KSP(PetscKSP ksp):             # <<<<<<<<<<<<<<
 *     cdef KSP ob = <KSP> 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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ref_KSP", 0);

  /* "petsc4py/PETSc/petscksp.pxi":244
 * 
 * cdef inline KSP ref_KSP(PetscKSP ksp):
 *     cdef KSP ob = <KSP> KSP()             # <<<<<<<<<<<<<<
 *     ob.ksp = ksp
 *     CHKERR(PetscINCREF(ob.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 244, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_t_2 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ob = ((struct PyPetscKSPObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":245
 * cdef inline KSP ref_KSP(PetscKSP ksp):
 *     cdef KSP ob = <KSP> KSP()
 *     ob.ksp = ksp             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(ob.obj))
 *     return ob
*/
  __pyx_v_ob->ksp = __pyx_v_ksp;

  /* "petsc4py/PETSc/petscksp.pxi":246
 *     cdef KSP ob = <KSP> KSP()
 *     ob.ksp = ksp
 *     CHKERR(PetscINCREF(ob.obj))             # <<<<<<<<<<<<<<
 *     return ob
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(21, 246, __pyx_L1_error)

  /* "petsc4py/PETSc/petscksp.pxi":247
 *     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":243
 * # -----------------------------------------------------------------------------
 * 
 * cdef inline KSP ref_KSP(PetscKSP ksp):             # <<<<<<<<<<<<<<
 *     cdef KSP ob = <KSP> 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":251
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSP_Converged", 0);

  /* "petsc4py/PETSc/petscksp.pxi":258
 *     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(21, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":259
 *    ) 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(21, 259, __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(21, 259, __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_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 259, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 259, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 259, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 259, __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(21, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(21, 259, __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(21, 259, __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":260
 *     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(21, 260, __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(21, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(21, 260, __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)) != (0)) __PYX_ERR(21, 260, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1) != (0)) __PYX_ERR(21, 260, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4) != (0)) __PYX_ERR(21, 260, __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(21, 260, __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(21, 260, __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(21, 260, __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(21, 260, __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(21, 260, __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(21, 260, __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":261
 *     (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":262
 *     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":263
 *     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":264
 *     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_PyLong_As_KSPConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(21, 264, __pyx_L1_error)
    (__pyx_v_r[0]) = __pyx_t_8;
  }
  __pyx_L5:;

  /* "petsc4py/PETSc/petscksp.pxi":265
 *     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":251
 * # -----------------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscksp.pxi":269
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSP_Monitor", 0);

  /* "petsc4py/PETSc/petscksp.pxi":275
 *     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(21, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":276
 *    ) 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(21, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_monitorlist = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":277
 *     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":278
 *     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(21, 278, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 278, __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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(21, 278, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_3;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(21, 278, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3);
        #endif
        ++__pyx_t_3;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 278, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(21, 278, __pyx_L1_error)
          PyErr_Clear();
        }
        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(21, 278, __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_INCREF(__pyx_t_6);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_8);
      } else {
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 278, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 278, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(21, 278, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
      }
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(21, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(21, 278, __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(21, 278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(21, 278, __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(21, 278, __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":279
 *     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(21, 279, __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(21, 279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(21, 279, __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)) != (0)) __PYX_ERR(21, 279, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5) != (0)) __PYX_ERR(21, 279, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8) != (0)) __PYX_ERR(21, 279, __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(21, 279, __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(21, 279, __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(21, 279, __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(21, 279, __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(21, 279, __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(21, 279, __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":278
 *     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":280
 *     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":269
 * # -----------------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscksp.pxi":284
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSP_ComputeRHS", 0);

  /* "petsc4py/PETSc/petscksp.pxi":289
 *     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(21, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":290
 *    ) 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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Rhs = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":291
 *     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 = <object>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(21, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":292
 *     cdef Vec Rhs = ref_Vec(rhs)
 *     cdef object context = Ksp.get_attr('__rhs__')
 *     if context is None and ctx != NULL: context = <object>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":293
 *     cdef object context = Ksp.get_attr('__rhs__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(21, 293, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(21, 293, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscksp.pxi":294
 *     if context is None and ctx != NULL: context = <object>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(21, 294, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 294, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 294, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 294, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 294, __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(21, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(21, 294, __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(21, 294, __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":295
 *     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(21, 295, __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)) != (0)) __PYX_ERR(21, 295, __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)) != (0)) __PYX_ERR(21, 295, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 295, __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(21, 295, __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(21, 295, __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(21, 295, __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(21, 295, __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(21, 295, __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":296
 *     (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":284
 * # -----------------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscksp.pxi":298
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSP_ComputeOps", 0);

  /* "petsc4py/PETSc/petscksp.pxi":304
 *     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(21, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":305
 *    ) 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(21, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Amat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":306
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_B)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Bmat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":307
 *     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 = <object>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(21, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":308
 *     cdef Mat Bmat = ref_Mat(B)
 *     cdef object context = Ksp.get_attr('__operators__')
 *     if context is None and ctx != NULL: context = <object>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":309
 *     cdef object context = Ksp.get_attr('__operators__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(21, 309, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(21, 309, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscksp.pxi":310
 *     if context is None and ctx != NULL: context = <object>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(21, 310, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 310, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 310, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 310, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 310, __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(21, 310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(21, 310, __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(21, 310, __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":311
 *     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(21, 311, __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)) != (0)) __PYX_ERR(21, 311, __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)) != (0)) __PYX_ERR(21, 311, __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)) != (0)) __PYX_ERR(21, 311, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 311, __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(21, 311, __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(21, 311, __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(21, 311, __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(21, 311, __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(21, 311, __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":312
 *     (computeops, args, kargs) = context
 *     computeops(Ksp, Amat, Bmat, *args, **kargs)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * # -----------------------------------------------------------------------------
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscksp.pxi":298
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscksp.pxi":316
 * # -----------------------------------------------------------------------------
 * 
 * cdef PetscErrorCode KSP_PreSolve(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     PetscVec rhs,
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSP_PreSolve(KSP __pyx_v_ksp, Vec __pyx_v_rhs, Vec __pyx_v_x, void *__pyx_v_ctx) {
  struct PyPetscKSPObject *__pyx_v_Ksp = 0;
  struct PyPetscVecObject *__pyx_v_Rhs = 0;
  struct PyPetscVecObject *__pyx_v_X = 0;
  PyObject *__pyx_v_context = 0;
  PyObject *__pyx_v_presolve = 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSP_PreSolve", 0);

  /* "petsc4py/PETSc/petscksp.pxi":322
 *     void* ctx,
 *    ) except PETSC_ERR_PYTHON with gil:
 *     cdef KSP Ksp = ref_KSP(ksp)             # <<<<<<<<<<<<<<
 *     cdef Vec Rhs = ref_Vec(rhs)
 *     cdef Vec X = ref_Vec(x)
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":323
 *    ) except PETSC_ERR_PYTHON with gil:
 *     cdef KSP Ksp = ref_KSP(ksp)
 *     cdef Vec Rhs = ref_Vec(rhs)             # <<<<<<<<<<<<<<
 *     cdef Vec X = ref_Vec(x)
 *     cdef object context = Ksp.get_attr('__presolve__')
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Rhs = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":324
 *     cdef KSP Ksp = ref_KSP(ksp)
 *     cdef Vec Rhs = ref_Vec(rhs)
 *     cdef Vec X = ref_Vec(x)             # <<<<<<<<<<<<<<
 *     cdef object context = Ksp.get_attr('__presolve__')
 *     if context is None and ctx != NULL: context = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_X = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":325
 *     cdef Vec Rhs = ref_Vec(rhs)
 *     cdef Vec X = ref_Vec(x)
 *     cdef object context = Ksp.get_attr('__presolve__')             # <<<<<<<<<<<<<<
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple
*/
  __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 *)"__presolve__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":326
 *     cdef Vec X = ref_Vec(x)
 *     cdef object context = Ksp.get_attr('__presolve__')
 *     if context is None and ctx != NULL: context = <object>ctx             # <<<<<<<<<<<<<<
 *     assert context is not None and type(context) is tuple
 *     (presolve, 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":327
 *     cdef object context = Ksp.get_attr('__presolve__')
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple             # <<<<<<<<<<<<<<
 *     (presolve, args, kargs) = context
 *     presolve(Ksp, Rhs, 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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(21, 327, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(21, 327, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscksp.pxi":328
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple
 *     (presolve, args, kargs) = context             # <<<<<<<<<<<<<<
 *     presolve(Ksp, Rhs, X, *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(21, 328, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 328, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 328, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 328, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 328, __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(21, 328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(21, 328, __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(21, 328, __pyx_L1_error)
    __pyx_L9_unpacking_done:;
  }
  __pyx_v_presolve = __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":329
 *     assert context is not None and type(context) is tuple
 *     (presolve, args, kargs) = context
 *     presolve(Ksp, Rhs, X, *args, **kargs)             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 329, __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)) != (0)) __PYX_ERR(21, 329, __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)) != (0)) __PYX_ERR(21, 329, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_X);
  __Pyx_GIVEREF((PyObject *)__pyx_v_X);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_X)) != (0)) __PYX_ERR(21, 329, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 329, __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(21, 329, __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(21, 329, __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(21, 329, __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(21, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_presolve, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 329, __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":330
 *     (presolve, args, kargs) = context
 *     presolve(Ksp, Rhs, X, *args, **kargs)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode KSP_PostSolve(
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscksp.pxi":316
 * # -----------------------------------------------------------------------------
 * 
 * cdef PetscErrorCode KSP_PreSolve(             # <<<<<<<<<<<<<<
 *     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_PreSolve", __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((PyObject *)__pyx_v_X);
  __Pyx_XDECREF(__pyx_v_context);
  __Pyx_XDECREF(__pyx_v_presolve);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kargs);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscksp.pxi":332
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode KSP_PostSolve(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     PetscVec rhs,
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSP_PostSolve(KSP __pyx_v_ksp, Vec __pyx_v_rhs, Vec __pyx_v_x, void *__pyx_v_ctx) {
  struct PyPetscKSPObject *__pyx_v_Ksp = 0;
  struct PyPetscVecObject *__pyx_v_Rhs = 0;
  struct PyPetscVecObject *__pyx_v_X = 0;
  PyObject *__pyx_v_context = 0;
  PyObject *__pyx_v_postsolve = 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSP_PostSolve", 0);

  /* "petsc4py/PETSc/petscksp.pxi":338
 *     void* ctx,
 *    ) except PETSC_ERR_PYTHON with gil:
 *     cdef KSP Ksp = ref_KSP(ksp)             # <<<<<<<<<<<<<<
 *     cdef Vec Rhs = ref_Vec(rhs)
 *     cdef Vec X = ref_Vec(x)
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":339
 *    ) except PETSC_ERR_PYTHON with gil:
 *     cdef KSP Ksp = ref_KSP(ksp)
 *     cdef Vec Rhs = ref_Vec(rhs)             # <<<<<<<<<<<<<<
 *     cdef Vec X = ref_Vec(x)
 *     cdef object context = Ksp.get_attr('__postsolve__')
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_rhs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Rhs = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":340
 *     cdef KSP Ksp = ref_KSP(ksp)
 *     cdef Vec Rhs = ref_Vec(rhs)
 *     cdef Vec X = ref_Vec(x)             # <<<<<<<<<<<<<<
 *     cdef object context = Ksp.get_attr('__postsolve__')
 *     if context is None and ctx != NULL: context = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_X = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":341
 *     cdef Vec Rhs = ref_Vec(rhs)
 *     cdef Vec X = ref_Vec(x)
 *     cdef object context = Ksp.get_attr('__postsolve__')             # <<<<<<<<<<<<<<
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple
*/
  __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 *)"__postsolve__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscksp.pxi":342
 *     cdef Vec X = ref_Vec(x)
 *     cdef object context = Ksp.get_attr('__postsolve__')
 *     if context is None and ctx != NULL: context = <object>ctx             # <<<<<<<<<<<<<<
 *     assert context is not None and type(context) is tuple
 *     (postsolve, 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":343
 *     cdef object context = Ksp.get_attr('__postsolve__')
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple             # <<<<<<<<<<<<<<
 *     (postsolve, args, kargs) = context
 *     postsolve(Ksp, Rhs, 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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(21, 343, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(21, 343, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscksp.pxi":344
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple
 *     (postsolve, args, kargs) = context             # <<<<<<<<<<<<<<
 *     postsolve(Ksp, Rhs, X, *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(21, 344, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 344, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 344, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 344, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 344, __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(21, 344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(21, 344, __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(21, 344, __pyx_L1_error)
    __pyx_L9_unpacking_done:;
  }
  __pyx_v_postsolve = __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":345
 *     assert context is not None and type(context) is tuple
 *     (postsolve, args, kargs) = context
 *     postsolve(Ksp, Rhs, X, *args, **kargs)             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 345, __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)) != (0)) __PYX_ERR(21, 345, __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)) != (0)) __PYX_ERR(21, 345, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_X);
  __Pyx_GIVEREF((PyObject *)__pyx_v_X);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_v_X)) != (0)) __PYX_ERR(21, 345, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(21, 345, __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(21, 345, __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(21, 345, __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(21, 345, __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(21, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_postsolve, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(21, 345, __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":346
 *     (postsolve, args, kargs) = context
 *     postsolve(Ksp, Rhs, X, *args, **kargs)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * # -----------------------------------------------------------------------------
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscksp.pxi":332
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode KSP_PostSolve(             # <<<<<<<<<<<<<<
 *     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_PostSolve", __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((PyObject *)__pyx_v_X);
  __Pyx_XDECREF(__pyx_v_context);
  __Pyx_XDECREF(__pyx_v_postsolve);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kargs);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscsnes.pxi":295
 * # -----------------------------------------------------------------------------
 * 
 * cdef inline SNES ref_SNES(PetscSNES snes):             # <<<<<<<<<<<<<<
 *     cdef SNES ob = <SNES> 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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ref_SNES", 0);

  /* "petsc4py/PETSc/petscsnes.pxi":296
 * 
 * cdef inline SNES ref_SNES(PetscSNES snes):
 *     cdef SNES ob = <SNES> SNES()             # <<<<<<<<<<<<<<
 *     ob.snes = snes
 *     CHKERR(PetscINCREF(ob.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 296, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_t_2 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ob = ((struct PyPetscSNESObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":297
 * cdef inline SNES ref_SNES(PetscSNES snes):
 *     cdef SNES ob = <SNES> SNES()
 *     ob.snes = snes             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(ob.obj))
 *     return ob
*/
  __pyx_v_ob->snes = __pyx_v_snes;

  /* "petsc4py/PETSc/petscsnes.pxi":298
 *     cdef SNES ob = <SNES> SNES()
 *     ob.snes = snes
 *     CHKERR(PetscINCREF(ob.obj))             # <<<<<<<<<<<<<<
 *     return ob
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(22, 298, __pyx_L1_error)

  /* "petsc4py/PETSc/petscsnes.pxi":299
 *     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":295
 * # -----------------------------------------------------------------------------
 * 
 * cdef inline SNES ref_SNES(PetscSNES snes):             # <<<<<<<<<<<<<<
 *     cdef SNES ob = <SNES> 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":303
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNES_InitialGuess", 0);

  /* "petsc4py/PETSc/petscsnes.pxi":308
 *     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(22, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":309
 *    ) 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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":310
 *     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 = <object>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(22, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":311
 *     cdef Vec  Xvec = ref_Vec(x)
 *     cdef object context = Snes.get_attr('__initialguess__')
 *     if context is None and ctx != NULL: context = <object>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":312
 *     cdef object context = Snes.get_attr('__initialguess__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(22, 312, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(22, 312, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscsnes.pxi":313
 *     if context is None and ctx != NULL: context = <object>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(22, 313, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 313, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 313, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 313, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 313, __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, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 313, __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, 313, __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":314
 *     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(22, 314, __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)) != (0)) __PYX_ERR(22, 314, __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)) != (0)) __PYX_ERR(22, 314, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 314, __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, 314, __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, 314, __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, 314, __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, 314, __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(22, 314, __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":315
 *     (initialguess, args, kargs) = context
 *     initialguess(Snes, Xvec, *args, **kargs)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * # -----------------------------------------------------------------------------
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscsnes.pxi":303
 * # -----------------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscsnes.pxi":319
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNES_PreCheck", 0);

  /* "petsc4py/PETSc/petscsnes.pxi":326
 *     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":327
 *    ) 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(22, 327, __pyx_L1_error)

  /* "petsc4py/PETSc/petscsnes.pxi":328
 *     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":329
 *     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(22, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":330
 *     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(22, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":331
 *     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 = <object>ctx
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_y)); if (unlikely(!__pyx_t_2)) __PYX_ERR(22, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_Yvec = ((struct PyPetscVecObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":332
 *     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 = <object>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(22, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_context = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":333
 *     cdef Vec  Yvec = ref_Vec(y)
 *     cdef object context = Snes.get_attr('__precheck__')
 *     if context is None and ctx != NULL: context = <object>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":334
 *     cdef object context = Snes.get_attr('__precheck__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(22, 334, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(22, 334, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscsnes.pxi":335
 *     if context is None and ctx != NULL: context = <object>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(22, 335, __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_INCREF(__pyx_t_2);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_6);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(22, 335, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 335, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 335, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(22, 335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 335, __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(22, 335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(22, 335, __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(22, 335, __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":336
 *     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(22, 336, __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)) != (0)) __PYX_ERR(22, 336, __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)) != (0)) __PYX_ERR(22, 336, __pyx_L1_error);
  __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 336, __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(22, 336, __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(22, 336, __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(22, 336, __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(22, 336, __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(22, 336, __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":337
 *     (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(22, 337, __pyx_L1_error)
  (__pyx_v_changed[0]) = __pyx_t_9;

  /* "petsc4py/PETSc/petscsnes.pxi":338
 *     b = precheck(Xvec, Yvec, *args, **kargs)
 *     changed[0] = asBool(b)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * # -----------------------------------------------------------------------------
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscsnes.pxi":319
 * # -----------------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscsnes.pxi":342
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNES_Function", 0);

  /* "petsc4py/PETSc/petscsnes.pxi":348
 *     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(22, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":349
 *    ) 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(22, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":350
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_f)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":351
 *     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 = <object>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(22, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":352
 *     cdef Vec  Fvec = ref_Vec(f)
 *     cdef object context = Snes.get_attr('__function__')
 *     if context is None and ctx != NULL: context = <object>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":353
 *     cdef object context = Snes.get_attr('__function__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(22, 353, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(22, 353, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscsnes.pxi":354
 *     if context is None and ctx != NULL: context = <object>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(22, 354, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 354, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 354, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 354, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 354, __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, 354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 354, __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, 354, __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":355
 *     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(22, 355, __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)) != (0)) __PYX_ERR(22, 355, __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)) != (0)) __PYX_ERR(22, 355, __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)) != (0)) __PYX_ERR(22, 355, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 355, __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, 355, __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, 355, __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, 355, __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, 355, __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(22, 355, __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":356
 *     (function, args, kargs) = context
 *     function(Snes, Xvec, Fvec, *args, **kargs)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * # -----------------------------------------------------------------------------
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscsnes.pxi":342
 * # -----------------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscsnes.pxi":360
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNES_Update", 0);

  /* "petsc4py/PETSc/petscsnes.pxi":364
 *     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(22, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":365
 *    ) 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(22, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":366
 *     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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(22, 366, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(22, 366, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscsnes.pxi":367
 *     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(22, 367, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 367, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 367, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 367, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 367, __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, 367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(22, 367, __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(22, 367, __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":368
 *     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(22, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 368, __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)) != (0)) __PYX_ERR(22, 368, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5) != (0)) __PYX_ERR(22, 368, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 368, __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(22, 368, __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(22, 368, __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(22, 368, __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(22, 368, __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(22, 368, __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":369
 *     (update, args, kargs) = context
 *     update(Snes, toInt(its), *args, **kargs)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * # -----------------------------------------------------------------------------
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscsnes.pxi":360
 * # -----------------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscsnes.pxi":373
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNES_Jacobian", 0);

  /* "petsc4py/PETSc/petscsnes.pxi":380
 *     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(22, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":381
 *    ) 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(22, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":382
 *     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(22, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":383
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Pmat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":384
 *     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 = <object>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(22, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":385
 *     cdef Mat  Pmat = ref_Mat(P)
 *     cdef object context = Snes.get_attr('__jacobian__')
 *     if context is None and ctx != NULL: context = <object>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":386
 *     cdef object context = Snes.get_attr('__jacobian__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(22, 386, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(22, 386, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscsnes.pxi":387
 *     if context is None and ctx != NULL: context = <object>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(22, 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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 387, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 387, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 387, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 387, __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, 387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 387, __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, 387, __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":388
 *     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(22, 388, __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)) != (0)) __PYX_ERR(22, 388, __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)) != (0)) __PYX_ERR(22, 388, __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)) != (0)) __PYX_ERR(22, 388, __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)) != (0)) __PYX_ERR(22, 388, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 388, __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, 388, __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, 388, __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, 388, __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, 388, __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(22, 388, __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":389
 *     (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":373
 * # -----------------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscsnes.pxi":393
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNES_Objective", 0);

  /* "petsc4py/PETSc/petscsnes.pxi":399
 *     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(22, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":400
 *    ) 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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":401
 *     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 = <object>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(22, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":402
 *     cdef Vec  Xvec = ref_Vec(x)
 *     cdef object context = Snes.get_attr('__objective__')
 *     if context is None and ctx != NULL: context = <object>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":403
 *     cdef object context = Snes.get_attr('__objective__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(22, 403, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(22, 403, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscsnes.pxi":404
 *     if context is None and ctx != NULL: context = <object>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(22, 404, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 404, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 404, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 404, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 404, __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, 404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 404, __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, 404, __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":405
 *     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(22, 405, __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)) != (0)) __PYX_ERR(22, 405, __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)) != (0)) __PYX_ERR(22, 405, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 405, __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, 405, __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, 405, __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, 405, __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, 405, __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(22, 405, __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":406
 *     (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(22, 406, __pyx_L1_error)
  (__pyx_v_o[0]) = __pyx_t_8;

  /* "petsc4py/PETSc/petscsnes.pxi":407
 *     obj = objective(Snes, Xvec, *args, **kargs)
 *     o[0] = asReal(obj)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * # -----------------------------------------------------------------------------
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscsnes.pxi":393
 * # -----------------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscsnes.pxi":411
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNES_NGS", 0);

  /* "petsc4py/PETSc/petscsnes.pxi":417
 *     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(22, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":418
 *    ) 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(22, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":419
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Bvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":420
 *     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 = <object>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(22, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":421
 *     cdef Vec  Bvec = ref_Vec(b)
 *     cdef object context = Snes.get_attr('__ngs__')
 *     if context is None and ctx != NULL: context = <object>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":422
 *     cdef object context = Snes.get_attr('__ngs__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(22, 422, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(22, 422, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscsnes.pxi":423
 *     if context is None and ctx != NULL: context = <object>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(22, 423, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 423, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 423, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 423, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 423, __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, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 423, __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, 423, __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":424
 *     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(22, 424, __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)) != (0)) __PYX_ERR(22, 424, __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)) != (0)) __PYX_ERR(22, 424, __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)) != (0)) __PYX_ERR(22, 424, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 424, __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, 424, __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, 424, __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, 424, __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, 424, __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(22, 424, __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":425
 *     (ngs, args, kargs) = context
 *     ngs(Snes, Xvec, Bvec, *args, **kargs)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * # -----------------------------------------------------------------------------
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscsnes.pxi":411
 * # -----------------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscsnes.pxi":429
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNES_Converged", 0);

  /* "petsc4py/PETSc/petscsnes.pxi":438
 *     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(22, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":439
 *    ) 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(22, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_it = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":440
 *     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(22, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_xn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":441
 *     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(22, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_gn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":442
 *     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 = <object>ctx
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_fnorm); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_fn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":443
 *     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 = <object>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(22, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":444
 *     cdef object fn = toReal(fnorm)
 *     cdef object context = Snes.get_attr('__converged__')
 *     if context is None and ctx != NULL: context = <object>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":445
 *     cdef object context = Snes.get_attr('__converged__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(22, 445, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(22, 445, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscsnes.pxi":446
 *     if context is None and ctx != NULL: context = <object>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(22, 446, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 446, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 446, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 446, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 446, __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, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 446, __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, 446, __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":447
 *     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(22, 447, __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) != (0)) __PYX_ERR(22, 447, __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) != (0)) __PYX_ERR(22, 447, __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) != (0)) __PYX_ERR(22, 447, __pyx_L1_error);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 447, __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)) != (0)) __PYX_ERR(22, 447, __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) != (0)) __PYX_ERR(22, 447, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5) != (0)) __PYX_ERR(22, 447, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 447, __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(22, 447, __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(22, 447, __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(22, 447, __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(22, 447, __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(22, 447, __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":448
 *     (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":449
 *     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":450
 *     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":451
 *     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_PyLong_As_SNESConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(22, 451, __pyx_L1_error)
    (__pyx_v_r[0]) = __pyx_t_8;
  }
  __pyx_L10:;

  /* "petsc4py/PETSc/petscsnes.pxi":452
 *     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":429
 * # -----------------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscsnes.pxi":456
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNES_Monitor", 0);

  /* "petsc4py/PETSc/petscsnes.pxi":462
 *     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(22, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":463
 *    ) 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(22, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_monitorlist = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":464
 *     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":465
 *     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(22, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_it = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":466
 *     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(22, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":467
 *     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(22, 467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 467, __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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(22, 467, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_3;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(22, 467, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3);
        #endif
        ++__pyx_t_3;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 467, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(22, 467, __pyx_L1_error)
          PyErr_Clear();
        }
        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, 467, __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_INCREF(__pyx_t_6);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_8);
      } else {
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 467, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 467, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 467, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
      }
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(22, 467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(22, 467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 467, __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, 467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 467, __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, 467, __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":468
 *     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(22, 468, __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)) != (0)) __PYX_ERR(22, 468, __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) != (0)) __PYX_ERR(22, 468, __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) != (0)) __PYX_ERR(22, 468, __pyx_L1_error);
    __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(22, 468, __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(22, 468, __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(22, 468, __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, 468, __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, 468, __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(22, 468, __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":467
 *     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":469
 *     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":456
 * # -----------------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscsnes.pxi":473
 * # -----------------------------------------------------------------------------
 * 
 * cdef PetscErrorCode SNES_NewtonALFunction(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     PetscVec  x,
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNES_NewtonALFunction(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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNES_NewtonALFunction", 0);

  /* "petsc4py/PETSc/petscsnes.pxi":479
 *     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(22, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Snes = ((struct PyPetscSNESObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":480
 *    ) 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('__newtonal_function__')
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":481
 *     cdef SNES Snes = ref_SNES(snes)
 *     cdef Vec  Xvec = ref_Vec(x)
 *     cdef Vec  Fvec = ref_Vec(f)             # <<<<<<<<<<<<<<
 *     cdef object context = Snes.get_attr('__newtonal_function__')
 *     if context is None and ctx != NULL: context = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_f)); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":482
 *     cdef Vec  Xvec = ref_Vec(x)
 *     cdef Vec  Fvec = ref_Vec(f)
 *     cdef object context = Snes.get_attr('__newtonal_function__')             # <<<<<<<<<<<<<<
 *     if context is None and ctx != NULL: context = <object>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 *)"__newtonal_function__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscsnes.pxi":483
 *     cdef Vec  Fvec = ref_Vec(f)
 *     cdef object context = Snes.get_attr('__newtonal_function__')
 *     if context is None and ctx != NULL: context = <object>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":484
 *     cdef object context = Snes.get_attr('__newtonal_function__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(22, 484, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(22, 484, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscsnes.pxi":485
 *     if context is None and ctx != NULL: context = <object>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(22, 485, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 485, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 485, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 485, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(22, 485, __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, 485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 485, __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, 485, __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":486
 *     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(22, 486, __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)) != (0)) __PYX_ERR(22, 486, __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)) != (0)) __PYX_ERR(22, 486, __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)) != (0)) __PYX_ERR(22, 486, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(22, 486, __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, 486, __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, 486, __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, 486, __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, 486, __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(22, 486, __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":487
 *     (function, args, kargs) = context
 *     function(Snes, Xvec, Fvec, *args, **kargs)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscsnes.pxi":473
 * # -----------------------------------------------------------------------------
 * 
 * cdef PetscErrorCode SNES_NewtonALFunction(             # <<<<<<<<<<<<<<
 *     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_NewtonALFunction", __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscts.pxi":359
 * # -----------------------------------------------------------------------------
 * 
 * cdef inline TS ref_TS(PetscTS ts):             # <<<<<<<<<<<<<<
 *     cdef TS ob = <TS> 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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ref_TS", 0);

  /* "petsc4py/PETSc/petscts.pxi":360
 * 
 * cdef inline TS ref_TS(PetscTS ts):
 *     cdef TS ob = <TS> TS()             # <<<<<<<<<<<<<<
 *     ob.ts = ts
 *     CHKERR(PetscINCREF(ob.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 360, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_t_2 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ob = ((struct PyPetscTSObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscts.pxi":361
 * cdef inline TS ref_TS(PetscTS ts):
 *     cdef TS ob = <TS> TS()
 *     ob.ts = ts             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(ob.obj))
 *     return ob
*/
  __pyx_v_ob->ts = __pyx_v_ts;

  /* "petsc4py/PETSc/petscts.pxi":362
 *     cdef TS ob = <TS> TS()
 *     ob.ts = ts
 *     CHKERR(PetscINCREF(ob.obj))             # <<<<<<<<<<<<<<
 *     return ob
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(23, 362, __pyx_L1_error)

  /* "petsc4py/PETSc/petscts.pxi":363
 *     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":359
 * # -----------------------------------------------------------------------------
 * 
 * cdef inline TS ref_TS(PetscTS ts):             # <<<<<<<<<<<<<<
 *     cdef TS ob = <TS> 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":367
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TS_RHSFunction", 0);

  /* "petsc4py/PETSc/petscts.pxi":374
 *     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(23, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":375
 *    ) 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(23, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":376
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_f)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":377
 *     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 = <object>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(23, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":378
 *     cdef Vec Fvec = ref_Vec(f)
 *     cdef object context = Ts.get_attr('__rhsfunction__')
 *     if context is None and ctx != NULL: context = <object>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":379
 *     cdef object context = Ts.get_attr('__rhsfunction__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(23, 379, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(23, 379, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscts.pxi":380
 *     if context is None and ctx != NULL: context = <object>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(23, 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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 380, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 380, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 380, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 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(23, 380, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 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(23, 380, __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":381
 *     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(23, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 381, __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)) != (0)) __PYX_ERR(23, 381, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5) != (0)) __PYX_ERR(23, 381, __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)) != (0)) __PYX_ERR(23, 381, __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)) != (0)) __PYX_ERR(23, 381, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 381, __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, 381, __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, 381, __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, 381, __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, 381, __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(23, 381, __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":382
 *     (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":367
 * # -----------------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscts.pxi":384
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TS_RHSJacobian", 0);

  /* "petsc4py/PETSc/petscts.pxi":392
 *     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(23, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":393
 *    ) 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(23, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":394
 *     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(23, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":395
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Pmat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":396
 *     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 = <object>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(23, 396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":397
 *     cdef Mat Pmat = ref_Mat(P)
 *     cdef object context = Ts.get_attr('__rhsjacobian__')
 *     if context is None and ctx != NULL: context = <object>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":398
 *     cdef object context = Ts.get_attr('__rhsjacobian__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(23, 398, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(23, 398, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscts.pxi":399
 *     if context is None and ctx != NULL: context = <object>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(23, 399, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 399, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 399, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 399, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 399, __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, 399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 399, __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, 399, __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":400
 *     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(23, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 400, __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)) != (0)) __PYX_ERR(23, 400, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5) != (0)) __PYX_ERR(23, 400, __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)) != (0)) __PYX_ERR(23, 400, __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)) != (0)) __PYX_ERR(23, 400, __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)) != (0)) __PYX_ERR(23, 400, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 400, __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, 400, __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, 400, __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, 400, __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, 400, __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(23, 400, __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":401
 *     (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":384
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscts.pxi":403
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TS_RHSJacobianP", 0);

  /* "petsc4py/PETSc/petscts.pxi":410
 *     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(23, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":411
 *    ) 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(23, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":412
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":413
 *     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 = <object>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(23, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":414
 *     cdef Mat Jmat = ref_Mat(J)
 *     cdef object context = Ts.get_attr('__rhsjacobianp__')
 *     if context is None and ctx != NULL: context = <object>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":415
 *     cdef object context = Ts.get_attr('__rhsjacobianp__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_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/petscts.pxi":416
 *     if context is None and ctx != NULL: context = <object>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(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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 416, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 416, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 416, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_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 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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_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":417
 *     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(23, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 417, __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)) != (0)) __PYX_ERR(23, 417, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5) != (0)) __PYX_ERR(23, 417, __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)) != (0)) __PYX_ERR(23, 417, __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)) != (0)) __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_jacobianp, __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_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/petscts.pxi":418
 *     (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":403
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscts.pxi":422
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TS_IFunction", 0);

  /* "petsc4py/PETSc/petscts.pxi":430
 *     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(23, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":431
 *    ) 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(23, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":432
 *     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(23, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":433
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_f)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":434
 *     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 = <object>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(23, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":435
 *     cdef Vec Fvec  = ref_Vec(f)
 *     cdef object context = Ts.get_attr('__ifunction__')
 *     if context is None and ctx != NULL: context = <object>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":436
 *     cdef object context = Ts.get_attr('__ifunction__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(23, 436, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(23, 436, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscts.pxi":437
 *     if context is None and ctx != NULL: context = <object>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(23, 437, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 437, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 437, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 437, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 437, __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, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 437, __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, 437, __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":438
 *     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(23, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 438, __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)) != (0)) __PYX_ERR(23, 438, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5) != (0)) __PYX_ERR(23, 438, __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)) != (0)) __PYX_ERR(23, 438, __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)) != (0)) __PYX_ERR(23, 438, __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)) != (0)) __PYX_ERR(23, 438, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 438, __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, 438, __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, 438, __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, 438, __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, 438, __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(23, 438, __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":439
 *     (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":422
 * # -----------------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscts.pxi":441
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TS_IJacobian", 0);

  /* "petsc4py/PETSc/petscts.pxi":451
 *     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(23, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":452
 *    ) 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(23, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":453
 *     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(23, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":454
 *     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(23, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":455
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Pmat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":456
 *     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 = <object>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(23, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":457
 *     cdef Mat  Pmat  = ref_Mat(P)
 *     cdef object context = Ts.get_attr('__ijacobian__')
 *     if context is None and ctx != NULL: context = <object>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":458
 *     cdef object context = Ts.get_attr('__ijacobian__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(23, 458, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(23, 458, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscts.pxi":459
 *     if context is None and ctx != NULL: context = <object>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(23, 459, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 459, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 459, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 459, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 459, __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, 459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 459, __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, 459, __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":460
 *     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(23, 460, __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(23, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 460, __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)) != (0)) __PYX_ERR(23, 460, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5) != (0)) __PYX_ERR(23, 460, __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)) != (0)) __PYX_ERR(23, 460, __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)) != (0)) __PYX_ERR(23, 460, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_4) != (0)) __PYX_ERR(23, 460, __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)) != (0)) __PYX_ERR(23, 460, __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)) != (0)) __PYX_ERR(23, 460, __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(23, 460, __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(23, 460, __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(23, 460, __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, 460, __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, 460, __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(23, 460, __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":461
 *     (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":441
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscts.pxi":463
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TS_IJacobianP", 0);

  /* "petsc4py/PETSc/petscts.pxi":472
 *     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(23, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":473
 *    ) 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(23, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":474
 *     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(23, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":475
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":476
 *     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 = <object>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(23, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":477
 *     cdef Mat  Jmat  = ref_Mat(J)
 *     cdef object context = Ts.get_attr('__ijacobianp__')
 *     if context is None and ctx != NULL: context = <object>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":478
 *     cdef object context = Ts.get_attr('__ijacobianp__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(23, 478, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(23, 478, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscts.pxi":479
 *     if context is None and ctx != NULL: context = <object>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(23, 479, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 479, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 479, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 479, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 479, __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, 479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 479, __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, 479, __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":480
 *     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(23, 480, __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(23, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 480, __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)) != (0)) __PYX_ERR(23, 480, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5) != (0)) __PYX_ERR(23, 480, __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)) != (0)) __PYX_ERR(23, 480, __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)) != (0)) __PYX_ERR(23, 480, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_4) != (0)) __PYX_ERR(23, 480, __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)) != (0)) __PYX_ERR(23, 480, __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(23, 480, __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(23, 480, __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(23, 480, __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, 480, __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, 480, __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(23, 480, __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":481
 *     (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":463
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscts.pxi":483
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TS_I2Function", 0);

  /* "petsc4py/PETSc/petscts.pxi":492
 *     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(23, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":493
 *    ) 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(23, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":494
 *     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(23, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":495
 *     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(23, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_XDDvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":496
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_f)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Fvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":497
 *     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 = <object>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(23, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":498
 *     cdef Vec Fvec  = ref_Vec(f)
 *     cdef object context = Ts.get_attr('__i2function__')
 *     if context is None and ctx != NULL: context = <object>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":499
 *     cdef object context = Ts.get_attr('__i2function__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(23, 499, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(23, 499, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscts.pxi":500
 *     if context is None and ctx != NULL: context = <object>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(23, 500, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 500, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 500, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 500, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 500, __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, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 500, __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, 500, __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":501
 *     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(23, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 501, __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)) != (0)) __PYX_ERR(23, 501, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5) != (0)) __PYX_ERR(23, 501, __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)) != (0)) __PYX_ERR(23, 501, __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)) != (0)) __PYX_ERR(23, 501, __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)) != (0)) __PYX_ERR(23, 501, __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)) != (0)) __PYX_ERR(23, 501, __pyx_L1_error);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 501, __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, 501, __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, 501, __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, 501, __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, 501, __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(23, 501, __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":502
 *     (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":483
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscts.pxi":504
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TS_I2Jacobian", 0);

  /* "petsc4py/PETSc/petscts.pxi":516
 *     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(23, 516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":517
 *    ) 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(23, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Xvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":518
 *     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(23, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_XDvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":519
 *     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(23, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_XDDvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":520
 *     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(23, 520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Jmat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":521
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v_P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Pmat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":522
 *     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 = <object>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(23, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":523
 *     cdef Mat  Pmat  = ref_Mat(P)
 *     cdef object context = Ts.get_attr('__i2jacobian__')
 *     if context is None and ctx != NULL: context = <object>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":524
 *     cdef object context = Ts.get_attr('__i2jacobian__')
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(23, 524, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(23, 524, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscts.pxi":525
 *     if context is None and ctx != NULL: context = <object>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(23, 525, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 525, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 525, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 525, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 525, __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, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 525, __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, 525, __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":526
 *     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(23, 526, __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(23, 526, __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(23, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyTuple_New(9); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 526, __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)) != (0)) __PYX_ERR(23, 526, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5) != (0)) __PYX_ERR(23, 526, __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)) != (0)) __PYX_ERR(23, 526, __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)) != (0)) __PYX_ERR(23, 526, __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)) != (0)) __PYX_ERR(23, 526, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_4) != (0)) __PYX_ERR(23, 526, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_t_1) != (0)) __PYX_ERR(23, 526, __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)) != (0)) __PYX_ERR(23, 526, __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)) != (0)) __PYX_ERR(23, 526, __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(23, 526, __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(23, 526, __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(23, 526, __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(23, 526, __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(23, 526, __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(23, 526, __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":527
 *     (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":504
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscts.pxi":531
 * # -----------------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TS_Monitor", 0);

  /* "petsc4py/PETSc/petscts.pxi":538
 *     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(23, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":539
 *    ) 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(23, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Vu = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":540
 *     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(23, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_monitorlist = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":541
 *     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":542
 *     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(23, 542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 542, __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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(23, 542, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_3;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(23, 542, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3);
        #endif
        ++__pyx_t_3;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(23, 542, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(23, 542, __pyx_L1_error)
          PyErr_Clear();
        }
        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, 542, __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_INCREF(__pyx_t_6);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_8);
      } else {
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 542, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 542, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 542, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
      }
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(23, 542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(23, 542, __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, 542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 542, __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, 542, __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":543
 *     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(23, 543, __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(23, 543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(23, 543, __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)) != (0)) __PYX_ERR(23, 543, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5) != (0)) __PYX_ERR(23, 543, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8) != (0)) __PYX_ERR(23, 543, __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)) != (0)) __PYX_ERR(23, 543, __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(23, 543, __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(23, 543, __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(23, 543, __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, 543, __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, 543, __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(23, 543, __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":542
 *     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":544
 *     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":531
 * # -----------------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscts.pxi":548
 * # -----------------------------------------------------------------------------
 * 
 * cdef PetscErrorCode TS_Indicator(             # <<<<<<<<<<<<<<
 *     PetscTS   ts,
 *     PetscReal time,
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TS_Indicator(TS __pyx_v_ts, PetscReal __pyx_v_time, Vec __pyx_v_u, PetscReal *__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_indicator = 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TS_Indicator", 0);

  /* "petsc4py/PETSc/petscts.pxi":555
 *     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('__indicator__')
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_TS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":556
 *    ) except PETSC_ERR_PYTHON with gil:
 *     cdef TS  Ts = ref_TS(ts)
 *     cdef Vec Vu = ref_Vec(u)             # <<<<<<<<<<<<<<
 *     cdef object context = Ts.get_attr('__indicator__')
 *     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(23, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Vu = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":557
 *     cdef TS  Ts = ref_TS(ts)
 *     cdef Vec Vu = ref_Vec(u)
 *     cdef object context = Ts.get_attr('__indicator__')             # <<<<<<<<<<<<<<
 *     if context is None: return PETSC_SUCCESS
 *     (indicator, 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 *)"__indicator__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":558
 *     cdef Vec Vu = ref_Vec(u)
 *     cdef object context = Ts.get_attr('__indicator__')
 *     if context is None: return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 *     (indicator, 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":559
 *     cdef object context = Ts.get_attr('__indicator__')
 *     if context is None: return PETSC_SUCCESS
 *     (indicator, 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(23, 559, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 559, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 559, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 559, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 559, __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(23, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(23, 559, __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(23, 559, __pyx_L1_error)
    __pyx_L5_unpacking_done:;
  }
  __pyx_v_indicator = __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":560
 *     if context is None: return PETSC_SUCCESS
 *     (indicator, args, kargs) = context
 *     cdef PetscInt nevents = 0             # <<<<<<<<<<<<<<
 *     CHKERR(TSGetNumEvents(ts, &nevents))
 *     cdef npy_intp s = <npy_intp> nevents
*/
  __pyx_v_nevents = 0;

  /* "petsc4py/PETSc/petscts.pxi":561
 *     (indicator, args, kargs) = context
 *     cdef PetscInt nevents = 0
 *     CHKERR(TSGetNumEvents(ts, &nevents))             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> nevents
 *     fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_REAL, 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(23, 561, __pyx_L1_error)

  /* "petsc4py/PETSc/petscts.pxi":562
 *     cdef PetscInt nevents = 0
 *     CHKERR(TSGetNumEvents(ts, &nevents))
 *     cdef npy_intp s = <npy_intp> nevents             # <<<<<<<<<<<<<<
 *     fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_REAL, fvalue)
 *     indicator(Ts, toReal(time), Vu, fvalue_array, *args, **kargs)
*/
  __pyx_v_s = ((npy_intp)__pyx_v_nevents);

  /* "petsc4py/PETSc/petscts.pxi":563
 *     CHKERR(TSGetNumEvents(ts, &nevents))
 *     cdef npy_intp s = <npy_intp> nevents
 *     fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_REAL, fvalue)             # <<<<<<<<<<<<<<
 *     indicator(Ts, toReal(time), Vu, fvalue_array, *args, **kargs)
 *     return PETSC_SUCCESS
*/
  __pyx_t_4 = ((PyObject *)PyArray_SimpleNewFromData(1, (&__pyx_v_s), NPY_PETSC_REAL, __pyx_v_fvalue)); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_fvalue_array = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/petscts.pxi":564
 *     cdef npy_intp s = <npy_intp> nevents
 *     fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_REAL, fvalue)
 *     indicator(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(23, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 564, __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)) != (0)) __PYX_ERR(23, 564, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4) != (0)) __PYX_ERR(23, 564, __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)) != (0)) __PYX_ERR(23, 564, __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)) != (0)) __PYX_ERR(23, 564, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 564, __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(23, 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;
  if (unlikely(__pyx_v_kargs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
    __PYX_ERR(23, 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(23, 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(23, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_indicator, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 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;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscts.pxi":565
 *     fvalue_array = PyArray_SimpleNewFromData(1, &s, NPY_PETSC_REAL, fvalue)
 *     indicator(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":548
 * # -----------------------------------------------------------------------------
 * 
 * cdef PetscErrorCode TS_Indicator(             # <<<<<<<<<<<<<<
 *     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_Indicator", __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_indicator);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kargs);
  __Pyx_XDECREF((PyObject *)__pyx_v_fvalue_array);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscts.pxi":567
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TS_PostEvent", 0);

  /* "petsc4py/PETSc/petscts.pxi":576
 *     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(23, 576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":577
 *    ) 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(23, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Vu = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":578
 *     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(23, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":579
 *     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 = <npy_intp> 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":580
 *     cdef object context = Ts.get_attr('__postevent__')
 *     if context is None: return PETSC_SUCCESS
 *     (postevent, args, kargs) = context             # <<<<<<<<<<<<<<
 *     cdef npy_intp s = <npy_intp> 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(23, 580, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 580, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 580, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 580, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 580, __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(23, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(23, 580, __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(23, 580, __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":581
 *     if context is None: return PETSC_SUCCESS
 *     (postevent, args, kargs) = context
 *     cdef npy_intp s = <npy_intp> 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":582
 *     (postevent, args, kargs) = context
 *     cdef npy_intp s = <npy_intp> 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(23, 582, __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":583
 *     cdef npy_intp s = <npy_intp> 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(23, 583, __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(23, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 583, __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)) != (0)) __PYX_ERR(23, 583, __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)) != (0)) __PYX_ERR(23, 583, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4) != (0)) __PYX_ERR(23, 583, __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)) != (0)) __PYX_ERR(23, 583, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3) != (0)) __PYX_ERR(23, 583, __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(23, 583, __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(23, 583, __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(23, 583, __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(23, 583, __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(23, 583, __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(23, 583, __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":584
 *     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":567
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscts.pxi":586
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TS_PreStep", 0);

  /* "petsc4py/PETSc/petscts.pxi":589
 *     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(23, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":590
 *    ) 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(23, 590, __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(23, 590, __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_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 590, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 590, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 590, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 590, __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(23, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(23, 590, __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(23, 590, __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":591
 *     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(23, 591, __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)) != (0)) __PYX_ERR(23, 591, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 591, __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(23, 591, __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(23, 591, __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, 591, __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, 591, __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(23, 591, __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":592
 *     (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":586
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscts.pxi":594
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TS_PostStep", 0);

  /* "petsc4py/PETSc/petscts.pxi":597
 *     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(23, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ts = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscts.pxi":598
 *    ) 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(23, 598, __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(23, 598, __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_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 598, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 598, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 598, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(23, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(23, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 598, __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(23, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(23, 598, __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(23, 598, __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":599
 *     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(23, 599, __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)) != (0)) __PYX_ERR(23, 599, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(23, 599, __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(23, 599, __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(23, 599, __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, 599, __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, 599, __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(23, 599, __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":600
 *     (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":594
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":286
 * # --------------------------------------------------------------------
 * 
 * cdef inline TAO ref_TAO(PetscTAO tao):             # <<<<<<<<<<<<<<
 *     cdef TAO ob = <TAO> 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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ref_TAO", 0);

  /* "petsc4py/PETSc/petsctao.pxi":287
 * 
 * cdef inline TAO ref_TAO(PetscTAO tao):
 *     cdef TAO ob = <TAO> TAO()             # <<<<<<<<<<<<<<
 *     ob.tao = tao
 *     CHKERR(PetscINCREF(ob.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 287, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_t_2 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ob = ((struct PyPetscTAOObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":288
 * cdef inline TAO ref_TAO(PetscTAO tao):
 *     cdef TAO ob = <TAO> TAO()
 *     ob.tao = tao             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(ob.obj))
 *     return ob
*/
  __pyx_v_ob->tao = __pyx_v_tao;

  /* "petsc4py/PETSc/petsctao.pxi":289
 *     cdef TAO ob = <TAO> TAO()
 *     ob.tao = tao
 *     CHKERR(PetscINCREF(ob.obj))             # <<<<<<<<<<<<<<
 *     return ob
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(24, 289, __pyx_L1_error)

  /* "petsc4py/PETSc/petsctao.pxi":290
 *     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":286
 * # --------------------------------------------------------------------
 * 
 * cdef inline TAO ref_TAO(PetscTAO tao):             # <<<<<<<<<<<<<<
 *     cdef TAO ob = <TAO> 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":294
 * # --------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_Objective", 0);

  /* "petsc4py/PETSc/petsctao.pxi":298
 *                                   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(24, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":299
 * 
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":300
 *     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 = <object>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(24, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":301
 *     cdef Vec x   = ref_Vec(_x)
 *     context = tao.get_attr("__objective__")
 *     if context is None and ctx != NULL: context = <object>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":302
 *     context = tao.get_attr("__objective__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(24, 302, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(24, 302, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petsctao.pxi":303
 *     if context is None and ctx != NULL: context = <object>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(24, 303, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 303, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 303, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 303, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 303, __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, 303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 303, __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, 303, __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":304
 *     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(24, 304, __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)) != (0)) __PYX_ERR(24, 304, __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)) != (0)) __PYX_ERR(24, 304, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 304, __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(24, 304, __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(24, 304, __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, 304, __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, 304, __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(24, 304, __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":305
 *     (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(24, 305, __pyx_L1_error)
  (__pyx_v__f[0]) = __pyx_t_8;

  /* "petsc4py/PETSc/petsctao.pxi":306
 *     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":294
 * # --------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":308
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_Residual", 0);

  /* "petsc4py/PETSc/petsctao.pxi":312
 *                                  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(24, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":313
 * 
 *     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(24, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":314
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__r)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_r = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":315
 *     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 = <object>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(24, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":316
 *     cdef Vec r   = ref_Vec(_r)
 *     context = tao.get_attr("__residual__")
 *     if context is None and ctx != NULL: context = <object>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":317
 *     context = tao.get_attr("__residual__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(24, 317, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(24, 317, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petsctao.pxi":318
 *     if context is None and ctx != NULL: context = <object>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(24, 318, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 318, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 318, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 318, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 318, __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, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 318, __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, 318, __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":319
 *     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(24, 319, __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)) != (0)) __PYX_ERR(24, 319, __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)) != (0)) __PYX_ERR(24, 319, __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)) != (0)) __PYX_ERR(24, 319, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 319, __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(24, 319, __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(24, 319, __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, 319, __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, 319, __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(24, 319, __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":320
 *     (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":308
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":322
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_Gradient", 0);

  /* "petsc4py/PETSc/petsctao.pxi":326
 *                                  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(24, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":327
 * 
 *     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(24, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":328
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_g = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":329
 *     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 = <object>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(24, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":330
 *     cdef Vec g   = ref_Vec(_g)
 *     context = tao.get_attr("__gradient__")
 *     if context is None and ctx != NULL: context = <object>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":331
 *     context = tao.get_attr("__gradient__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(24, 331, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(24, 331, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petsctao.pxi":332
 *     if context is None and ctx != NULL: context = <object>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(24, 332, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 332, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 332, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 332, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 332, __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, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 332, __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, 332, __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":333
 *     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(24, 333, __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)) != (0)) __PYX_ERR(24, 333, __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)) != (0)) __PYX_ERR(24, 333, __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)) != (0)) __PYX_ERR(24, 333, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 333, __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(24, 333, __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(24, 333, __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, 333, __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, 333, __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(24, 333, __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":334
 *     (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":322
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":336
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_ObjGrad", 0);

  /* "petsc4py/PETSc/petsctao.pxi":340
 *                                 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(24, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":341
 * 
 *     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(24, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":342
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_g = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":343
 *     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 = <object>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(24, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":344
 *     cdef Vec g   = ref_Vec(_g)
 *     context = tao.get_attr("__objgrad__")
 *     if context is None and ctx != NULL: context = <object>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":345
 *     context = tao.get_attr("__objgrad__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(24, 345, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(24, 345, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petsctao.pxi":346
 *     if context is None and ctx != NULL: context = <object>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(24, 346, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 346, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 346, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 346, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 346, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 346, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 346, __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, 346, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 346, __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, 346, __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":347
 *     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(24, 347, __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)) != (0)) __PYX_ERR(24, 347, __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)) != (0)) __PYX_ERR(24, 347, __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)) != (0)) __PYX_ERR(24, 347, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 347, __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(24, 347, __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(24, 347, __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, 347, __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, 347, __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(24, 347, __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":348
 *     (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(24, 348, __pyx_L1_error)
  (__pyx_v__f[0]) = __pyx_t_8;

  /* "petsc4py/PETSc/petsctao.pxi":349
 *     retv = objgrad(tao, x, g, *args, **kargs)
 *     _f[0] = asReal(retv)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode TAO_BRGNRegObjGrad(PetscTAO _tao,
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petsctao.pxi":336
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":351
 *     return PETSC_SUCCESS
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_BRGNRegObjGrad", 0);

  /* "petsc4py/PETSc/petsctao.pxi":355
 *                                        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(24, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":356
 * 
 *     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(24, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":357
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_g = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":358
 *     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 = <object>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(24, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":359
 *     cdef Vec g   = ref_Vec(_g)
 *     context = tao.get_attr("__brgnregobjgrad__")
 *     if context is None and ctx != NULL: context = <object>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":360
 *     context = tao.get_attr("__brgnregobjgrad__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(24, 360, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(24, 360, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petsctao.pxi":361
 *     if context is None and ctx != NULL: context = <object>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(24, 361, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 361, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 361, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 361, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 361, __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, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 361, __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, 361, __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":362
 *     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(24, 362, __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)) != (0)) __PYX_ERR(24, 362, __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)) != (0)) __PYX_ERR(24, 362, __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)) != (0)) __PYX_ERR(24, 362, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 362, __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(24, 362, __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(24, 362, __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, 362, __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, 362, __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(24, 362, __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":363
 *     (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(24, 363, __pyx_L1_error)
  (__pyx_v__f[0]) = __pyx_t_8;

  /* "petsc4py/PETSc/petsctao.pxi":364
 *     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":351
 *     return PETSC_SUCCESS
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":367
 * 
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_Constraints", 0);

  /* "petsc4py/PETSc/petsctao.pxi":371
 *                                     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(24, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":372
 * 
 *     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(24, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":373
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__r)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_r = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":374
 *     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 = <object>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(24, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":375
 *     cdef Vec r   = ref_Vec(_r)
 *     context = tao.get_attr("__constraints__")
 *     if context is None and ctx != NULL: context = <object>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":376
 *     context = tao.get_attr("__constraints__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(24, 376, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(24, 376, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petsctao.pxi":377
 *     if context is None and ctx != NULL: context = <object>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(24, 377, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 377, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 377, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 377, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 377, __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, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 377, __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, 377, __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":378
 *     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(24, 378, __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)) != (0)) __PYX_ERR(24, 378, __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)) != (0)) __PYX_ERR(24, 378, __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)) != (0)) __PYX_ERR(24, 378, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 378, __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(24, 378, __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(24, 378, __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, 378, __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, 378, __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(24, 378, __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":379
 *     (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":367
 * 
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":381
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_VarBounds", 0);

  /* "petsc4py/PETSc/petsctao.pxi":385
 *                                   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(24, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":386
 * 
 *     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(24, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_xl = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":387
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__xu)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_xu = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":388
 *     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 = <object>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(24, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":389
 *     cdef Vec xu  = ref_Vec(_xu)
 *     context = tao.get_attr("__varbounds__")
 *     if context is None and ctx != NULL: context = <object>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":390
 *     context = tao.get_attr("__varbounds__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(24, 390, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(24, 390, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petsctao.pxi":391
 *     if context is None and ctx != NULL: context = <object>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(24, 391, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 391, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 391, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 391, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 391, __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, 391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 391, __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, 391, __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":392
 *     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(24, 392, __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)) != (0)) __PYX_ERR(24, 392, __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)) != (0)) __PYX_ERR(24, 392, __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)) != (0)) __PYX_ERR(24, 392, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 392, __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(24, 392, __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(24, 392, __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, 392, __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, 392, __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(24, 392, __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":393
 *     (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":381
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":395
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_Hessian", 0);

  /* "petsc4py/PETSc/petsctao.pxi":400
 *                                 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(24, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":401
 *                                 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(24, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":402
 *     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(24, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_H = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":403
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":404
 *     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 = <object>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(24, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":405
 *     cdef Mat P   = ref_Mat(_P)
 *     context = tao.get_attr("__hessian__")
 *     if context is None and ctx != NULL: context = <object>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":406
 *     context = tao.get_attr("__hessian__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(24, 406, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(24, 406, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petsctao.pxi":407
 *     if context is None and ctx != NULL: context = <object>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(24, 407, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 407, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 407, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 407, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 407, __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, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 407, __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, 407, __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":408
 *     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(24, 408, __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)) != (0)) __PYX_ERR(24, 408, __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)) != (0)) __PYX_ERR(24, 408, __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)) != (0)) __PYX_ERR(24, 408, __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)) != (0)) __PYX_ERR(24, 408, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 408, __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(24, 408, __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(24, 408, __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, 408, __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, 408, __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(24, 408, __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":409
 *     (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":395
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":411
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_BRGNRegHessian", 0);

  /* "petsc4py/PETSc/petsctao.pxi":415
 *                                        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(24, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":416
 *                                        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(24, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":417
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__H)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_H = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":418
 *     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 = <object>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(24, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":419
 *     cdef Mat H   = ref_Mat(_H)
 *     context = tao.get_attr("__brgnreghessian__")
 *     if context is None and ctx != NULL: context = <object>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":420
 *     context = tao.get_attr("__brgnreghessian__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(24, 420, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(24, 420, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petsctao.pxi":421
 *     if context is None and ctx != NULL: context = <object>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(24, 421, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 421, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 421, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 421, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 421, __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, 421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 421, __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, 421, __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":422
 *     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(24, 422, __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)) != (0)) __PYX_ERR(24, 422, __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)) != (0)) __PYX_ERR(24, 422, __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)) != (0)) __PYX_ERR(24, 422, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 422, __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(24, 422, __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(24, 422, __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, 422, __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, 422, __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(24, 422, __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":423
 *     (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":411
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":425
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_Jacobian", 0);

  /* "petsc4py/PETSc/petsctao.pxi":430
 *                                  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(24, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":431
 *                                  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(24, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":432
 *     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(24, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":433
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":434
 *     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 = <object>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(24, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":435
 *     cdef Mat P   = ref_Mat(_P)
 *     context = tao.get_attr("__jacobian__")
 *     if context is None and ctx != NULL: context = <object>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":436
 *     context = tao.get_attr("__jacobian__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(24, 436, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(24, 436, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petsctao.pxi":437
 *     if context is None and ctx != NULL: context = <object>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(24, 437, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 437, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 437, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 437, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 437, __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, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 437, __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, 437, __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":438
 *     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(24, 438, __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)) != (0)) __PYX_ERR(24, 438, __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)) != (0)) __PYX_ERR(24, 438, __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)) != (0)) __PYX_ERR(24, 438, __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)) != (0)) __PYX_ERR(24, 438, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 438, __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(24, 438, __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(24, 438, __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, 438, __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, 438, __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(24, 438, __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":439
 *     (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":425
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":441
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_JacobianResidual", 0);

  /* "petsc4py/PETSc/petsctao.pxi":446
 *                                          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(24, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":447
 *                                          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(24, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":448
 *     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(24, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":449
 *     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 = <object>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_P = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":450
 *     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 = <object>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(24, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":451
 *     cdef Mat P   = ref_Mat(_P)
 *     context = tao.get_attr("__jacobian_residual__")
 *     if context is None and ctx != NULL: context = <object>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":452
 *     context = tao.get_attr("__jacobian_residual__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_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/petsctao.pxi":453
 *     if context is None and ctx != NULL: context = <object>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(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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 453, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 453, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 453, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_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 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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/petsctao.pxi":454
 *     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(24, 454, __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)) != (0)) __PYX_ERR(24, 454, __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)) != (0)) __PYX_ERR(24, 454, __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)) != (0)) __PYX_ERR(24, 454, __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)) != (0)) __PYX_ERR(24, 454, __pyx_L1_error);
  __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_1 = PyNumber_Add(__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;
  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_5 = __Pyx_PyObject_Call(__pyx_v_jacobian, __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;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":455
 *     (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":441
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":457
 *     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__Jp, Mat __pyx_v__Ji, 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_Jp = 0;
  struct PyPetscMatObject *__pyx_v_Ji = 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_JacobianState", 0);

  /* "petsc4py/PETSc/petsctao.pxi":463
 *                                       PetscMat  _Ji,
 *                                       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(24, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":464
 *                                       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 Jp  = ref_Mat(_Jp)
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":465
 *     cdef TAO tao = ref_TAO(_tao)
 *     cdef Vec x   = ref_Vec(_x)
 *     cdef Mat J   = ref_Mat(_J)             # <<<<<<<<<<<<<<
 *     cdef Mat Jp  = ref_Mat(_Jp)
 *     cdef Mat Ji  = ref_Mat(_Ji)
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":466
 *     cdef Vec x   = ref_Vec(_x)
 *     cdef Mat J   = ref_Mat(_J)
 *     cdef Mat Jp  = ref_Mat(_Jp)             # <<<<<<<<<<<<<<
 *     cdef Mat Ji  = ref_Mat(_Ji)
 *     context = tao.get_attr("__jacobian_state__")
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__Jp)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Jp = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":467
 *     cdef Mat J   = ref_Mat(_J)
 *     cdef Mat Jp  = ref_Mat(_Jp)
 *     cdef Mat Ji  = ref_Mat(_Ji)             # <<<<<<<<<<<<<<
 *     context = tao.get_attr("__jacobian_state__")
 *     if context is None and ctx != NULL: context = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__Ji)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Ji = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":468
 *     cdef Mat Jp  = ref_Mat(_Jp)
 *     cdef Mat Ji  = ref_Mat(_Ji)
 *     context = tao.get_attr("__jacobian_state__")             # <<<<<<<<<<<<<<
 *     if context is None and ctx != NULL: context = <object>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(24, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":469
 *     cdef Mat Ji  = ref_Mat(_Ji)
 *     context = tao.get_attr("__jacobian_state__")
 *     if context is None and ctx != NULL: context = <object>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":470
 *     context = tao.get_attr("__jacobian_state__")
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple # sanity check             # <<<<<<<<<<<<<<
 *     (jacobian, args, kargs) = context
 *     jacobian(tao, x, J, Jp, Ji, *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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(24, 470, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(24, 470, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petsctao.pxi":471
 *     if context is None and ctx != NULL: context = <object>ctx
 *     assert context is not None and type(context) is tuple # sanity check
 *     (jacobian, args, kargs) = context             # <<<<<<<<<<<<<<
 *     jacobian(tao, x, J, Jp, Ji, *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, 471, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 471, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 471, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 471, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 471, __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, 471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 471, __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, 471, __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":472
 *     assert context is not None and type(context) is tuple # sanity check
 *     (jacobian, args, kargs) = context
 *     jacobian(tao, x, J, Jp, Ji, *args, **kargs)             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 472, __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)) != (0)) __PYX_ERR(24, 472, __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)) != (0)) __PYX_ERR(24, 472, __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)) != (0)) __PYX_ERR(24, 472, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_Jp);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Jp);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_Jp)) != (0)) __PYX_ERR(24, 472, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_Ji);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Ji);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 4, ((PyObject *)__pyx_v_Ji)) != (0)) __PYX_ERR(24, 472, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 472, __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(24, 472, __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(24, 472, __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, 472, __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, 472, __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(24, 472, __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":473
 *     (jacobian, args, kargs) = context
 *     jacobian(tao, x, J, Jp, Ji, *args, **kargs)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode TAO_JacobianDesign(PetscTAO _tao,
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petsctao.pxi":457
 *     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_Jp);
  __Pyx_XDECREF((PyObject *)__pyx_v_Ji);
  __Pyx_XDECREF(__pyx_v_context);
  __Pyx_XDECREF(__pyx_v_jacobian);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kargs);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":475
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_JacobianDesign", 0);

  /* "petsc4py/PETSc/petsctao.pxi":479
 *                                        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(24, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":480
 *                                        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(24, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":481
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":482
 *     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 = <object>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(24, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":483
 *     cdef Mat J   = ref_Mat(_J)
 *     context = tao.get_attr("__jacobian_design__")
 *     if context is None and ctx != NULL: context = <object>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":484
 *     context = tao.get_attr("__jacobian_design__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(24, 484, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(24, 484, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petsctao.pxi":485
 *     if context is None and ctx != NULL: context = <object>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(24, 485, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 485, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 485, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 485, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 485, __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, 485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 485, __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, 485, __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":486
 *     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(24, 486, __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)) != (0)) __PYX_ERR(24, 486, __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)) != (0)) __PYX_ERR(24, 486, __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)) != (0)) __PYX_ERR(24, 486, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 486, __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(24, 486, __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(24, 486, __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, 486, __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, 486, __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(24, 486, __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":487
 *     (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":475
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":489
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_EqualityConstraints", 0);

  /* "petsc4py/PETSc/petsctao.pxi":493
 *                                             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(24, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":494
 *                                             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(24, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":495
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":496
 *     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 = <object>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(24, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":497
 *     cdef Vec c   = ref_Vec(_c)
 *     context = tao.get_attr("__equality_constraints__")
 *     if context is None and ctx != NULL: context = <object>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":498
 *     context = tao.get_attr("__equality_constraints__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(24, 498, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(24, 498, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petsctao.pxi":499
 *     if context is None and ctx != NULL: context = <object>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(24, 499, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 499, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 499, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 499, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 499, __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, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 499, __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, 499, __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":500
 *     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(24, 500, __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)) != (0)) __PYX_ERR(24, 500, __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)) != (0)) __PYX_ERR(24, 500, __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)) != (0)) __PYX_ERR(24, 500, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 500, __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(24, 500, __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(24, 500, __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, 500, __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, 500, __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(24, 500, __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":501
 *     (f, args, kargs) = context
 *     f(tao, x, c, *args, **kargs)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode TAO_InequalityConstraints(PetscTAO _tao,
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petsctao.pxi":489
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":503
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode TAO_InequalityConstraints(PetscTAO _tao,             # <<<<<<<<<<<<<<
 *                                               PetscVec  _x,
 *                                               PetscVec  _c,
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_InequalityConstraints(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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_InequalityConstraints", 0);

  /* "petsc4py/PETSc/petsctao.pxi":507
 *                                               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(24, 507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":508
 *                                               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("__inequality_constraints__")
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":509
 *     cdef TAO tao = ref_TAO(_tao)
 *     cdef Vec x   = ref_Vec(_x)
 *     cdef Vec c   = ref_Vec(_c)             # <<<<<<<<<<<<<<
 *     context = tao.get_attr("__inequality_constraints__")
 *     if context is None and ctx != NULL: context = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v__c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":510
 *     cdef Vec x   = ref_Vec(_x)
 *     cdef Vec c   = ref_Vec(_c)
 *     context = tao.get_attr("__inequality_constraints__")             # <<<<<<<<<<<<<<
 *     if context is None and ctx != NULL: context = <object>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 *)"__inequality_constraints__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":511
 *     cdef Vec c   = ref_Vec(_c)
 *     context = tao.get_attr("__inequality_constraints__")
 *     if context is None and ctx != NULL: context = <object>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":512
 *     context = tao.get_attr("__inequality_constraints__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(24, 512, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(24, 512, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petsctao.pxi":513
 *     if context is None and ctx != NULL: context = <object>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(24, 513, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 513, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 513, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 513, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 513, __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, 513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 513, __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, 513, __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":514
 *     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(24, 514, __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)) != (0)) __PYX_ERR(24, 514, __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)) != (0)) __PYX_ERR(24, 514, __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)) != (0)) __PYX_ERR(24, 514, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 514, __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(24, 514, __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(24, 514, __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, 514, __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, 514, __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(24, 514, __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":515
 *     (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":503
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode TAO_InequalityConstraints(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_InequalityConstraints", __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":517
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_JacobianEquality", 0);

  /* "petsc4py/PETSc/petsctao.pxi":522
 *                                          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(24, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":523
 *                                          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(24, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":524
 *     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(24, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":525
 *     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 = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":526
 *     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 = <object>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(24, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":527
 *     cdef Mat P   = ref_Mat(_P)
 *     context = tao.get_attr("__jacobian_equality__")
 *     if context is None and ctx != NULL: context = <object>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":528
 *     context = tao.get_attr("__jacobian_equality__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(24, 528, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(24, 528, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petsctao.pxi":529
 *     if context is None and ctx != NULL: context = <object>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(24, 529, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 529, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 529, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 529, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 529, __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, 529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 529, __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, 529, __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":530
 *     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(24, 530, __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)) != (0)) __PYX_ERR(24, 530, __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)) != (0)) __PYX_ERR(24, 530, __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)) != (0)) __PYX_ERR(24, 530, __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)) != (0)) __PYX_ERR(24, 530, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 530, __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(24, 530, __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(24, 530, __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, 530, __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, 530, __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(24, 530, __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":531
 *     (jacobian, args, kargs) = context
 *     jacobian(tao, x, J, P, *args, **kargs)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode TAO_JacobianInequality(PetscTAO _tao,
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petsctao.pxi":517
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":533
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode TAO_JacobianInequality(PetscTAO _tao,             # <<<<<<<<<<<<<<
 *                                            PetscVec  _x,
 *                                            PetscMat  _J,
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TAO_JacobianInequality(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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_JacobianInequality", 0);

  /* "petsc4py/PETSc/petsctao.pxi":538
 *                                            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(24, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":539
 *                                            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(24, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":540
 *     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_inequality__")
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__J)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":541
 *     cdef Vec x   = ref_Vec(_x)
 *     cdef Mat J   = ref_Mat(_J)
 *     cdef Mat P   = ref_Mat(_P)             # <<<<<<<<<<<<<<
 *     context = tao.get_attr("__jacobian_inequality__")
 *     if context is None and ctx != NULL: context = <object>ctx
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Mat(__pyx_v__P)); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":542
 *     cdef Mat J   = ref_Mat(_J)
 *     cdef Mat P   = ref_Mat(_P)
 *     context = tao.get_attr("__jacobian_inequality__")             # <<<<<<<<<<<<<<
 *     if context is None and ctx != NULL: context = <object>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_inequality__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":543
 *     cdef Mat P   = ref_Mat(_P)
 *     context = tao.get_attr("__jacobian_inequality__")
 *     if context is None and ctx != NULL: context = <object>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":544
 *     context = tao.get_attr("__jacobian_inequality__")
 *     if context is None and ctx != NULL: context = <object>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(24, 544, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(24, 544, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petsctao.pxi":545
 *     if context is None and ctx != NULL: context = <object>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(24, 545, __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_INCREF(__pyx_t_1);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 545, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 545, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 545, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 545, __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, 545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 545, __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, 545, __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":546
 *     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(24, 546, __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)) != (0)) __PYX_ERR(24, 546, __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)) != (0)) __PYX_ERR(24, 546, __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)) != (0)) __PYX_ERR(24, 546, __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)) != (0)) __PYX_ERR(24, 546, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 546, __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(24, 546, __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(24, 546, __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, 546, __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, 546, __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(24, 546, __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":547
 *     (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":533
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode TAO_JacobianInequality(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_JacobianInequality", __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":550
 * 
 * # 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_Update", 0);

  /* "petsc4py/PETSc/petsctao.pxi":554
 *     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(24, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":555
 *     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(24, 555, __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, 555, __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_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 555, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 555, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 555, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 555, __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, 555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 555, __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, 555, __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":556
 *     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(24, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 556, __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)) != (0)) __PYX_ERR(24, 556, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1) != (0)) __PYX_ERR(24, 556, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 556, __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(24, 556, __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(24, 556, __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, 556, __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, 556, __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(24, 556, __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":557
 *     (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":550
 * 
 * # 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":559
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_Converged", 0);

  /* "petsc4py/PETSc/petsctao.pxi":562
 *                                   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(24, 562, __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(24, 562, __pyx_L1_error)

  /* "petsc4py/PETSc/petsctao.pxi":564
 *     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(24, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":565
 *     # 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(24, 565, __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(24, 565, __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_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_6);
    } else {
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 565, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 565, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 565, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
    }
    #else
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 565, __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(24, 565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(24, 565, __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(24, 565, __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":566
 *     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(24, 566, __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)) != (0)) __PYX_ERR(24, 566, __pyx_L1_error);
  __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 566, __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(24, 566, __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(24, 566, __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(24, 566, __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(24, 566, __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(24, 566, __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":567
 *     (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":569
 *     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":570
 *     # 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_PyLong_BoolEqObjC(__pyx_v_reason, __pyx_mstate_global->__pyx_int_neg_1, -1L, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(24, 570, __pyx_L1_error)
  __pyx_t_9 = __pyx_t_10;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_9) {

    /* "petsc4py/PETSc/petsctao.pxi":571
 *     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":570
 *     # 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":572
 *     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_PyLong_BoolEqObjC(__pyx_v_reason, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(24, 572, __pyx_L1_error)
  __pyx_t_9 = __pyx_t_10;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_9) {

    /* "petsc4py/PETSc/petsctao.pxi":573
 *         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":572
 *     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":575
 *         creason = TAO_CONVERGED_USER
 *     else:
 *         creason = reason             # <<<<<<<<<<<<<<
 *         assert creason >= TAO_DIVERGED_USER
 *         assert creason <= TAO_CONVERGED_USER
*/
  /*else*/ {
    __pyx_t_11 = ((TaoConvergedReason)__Pyx_PyLong_As_TaoConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(24, 575, __pyx_L1_error)
    __pyx_v_creason = __pyx_t_11;

    /* "petsc4py/PETSc/petsctao.pxi":576
 *     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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(24, 576, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(24, 576, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/petsctao.pxi":577
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(24, 577, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(24, 577, __pyx_L1_error)
    #endif
  }
  __pyx_L6:;

  /* "petsc4py/PETSc/petsctao.pxi":578
 *         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(24, 578, __pyx_L1_error)

  /* "petsc4py/PETSc/petsctao.pxi":579
 *         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":559
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":581
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAO_Monitor", 0);

  /* "petsc4py/PETSc/petsctao.pxi":583
 * 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(24, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":584
 *                                 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(24, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_monitorlist = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":585
 *     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":586
 *     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(24, 586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 586, __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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(24, 586, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_3;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(24, 586, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_3);
        #endif
        ++__pyx_t_3;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(24, 586, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(24, 586, __pyx_L1_error)
          PyErr_Clear();
        }
        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, 586, __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_INCREF(__pyx_t_6);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_8);
      } else {
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 586, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 586, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(24, 586, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
      }
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(24, 586, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(24, 586, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(24, 586, __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, 586, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 586, __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, 586, __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":587
 *     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(24, 587, __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)) != (0)) __PYX_ERR(24, 587, __pyx_L1_error);
    __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(24, 587, __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(24, 587, __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(24, 587, __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, 587, __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, 587, __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(24, 587, __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":586
 *     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":588
 *     for (monitor, args, kargs) in monitorlist:
 *         monitor(tao, *args, **kargs)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petsctao.pxi":581
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":592
 * # --------------------------------------------------------------------
 * 
 * cdef inline TAOLineSearch ref_TAOLS(PetscTAOLineSearch taols):             # <<<<<<<<<<<<<<
 *     cdef TAOLineSearch ob = <TAOLineSearch> 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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ref_TAOLS", 0);

  /* "petsc4py/PETSc/petsctao.pxi":593
 * 
 * cdef inline TAOLineSearch ref_TAOLS(PetscTAOLineSearch taols):
 *     cdef TAOLineSearch ob = <TAOLineSearch> TAOLineSearch()             # <<<<<<<<<<<<<<
 *     ob.taols = taols
 *     CHKERR(PetscINCREF(ob.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 593, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_t_2 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ob = ((struct PyPetscTAOLineSearchObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":594
 * cdef inline TAOLineSearch ref_TAOLS(PetscTAOLineSearch taols):
 *     cdef TAOLineSearch ob = <TAOLineSearch> TAOLineSearch()
 *     ob.taols = taols             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(ob.obj))
 *     return ob
*/
  __pyx_v_ob->taols = __pyx_v_taols;

  /* "petsc4py/PETSc/petsctao.pxi":595
 *     cdef TAOLineSearch ob = <TAOLineSearch> TAOLineSearch()
 *     ob.taols = taols
 *     CHKERR(PetscINCREF(ob.obj))             # <<<<<<<<<<<<<<
 *     return ob
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(24, 595, __pyx_L1_error)

  /* "petsc4py/PETSc/petsctao.pxi":596
 *     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":592
 * # --------------------------------------------------------------------
 * 
 * cdef inline TAOLineSearch ref_TAOLS(PetscTAOLineSearch taols):             # <<<<<<<<<<<<<<
 *     cdef TAOLineSearch ob = <TAOLineSearch> 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":600
 * # --------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAOLS_Objective", 0);

  /* "petsc4py/PETSc/petsctao.pxi":605
 *                                     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(24, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ls = ((struct PyPetscTAOLineSearchObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":606
 * 
 *     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(24, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":607
 *     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(24, 607, __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, 607, __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_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 607, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 607, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 607, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 607, __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, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 607, __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, 607, __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":608
 *     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(24, 608, __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)) != (0)) __PYX_ERR(24, 608, __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)) != (0)) __PYX_ERR(24, 608, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 608, __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, 608, __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, 608, __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, 608, __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, 608, __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(24, 608, __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":609
 *     (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(24, 609, __pyx_L1_error)
  (__pyx_v__f[0]) = __pyx_t_7;

  /* "petsc4py/PETSc/petsctao.pxi":610
 *     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":600
 * # --------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":612
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAOLS_Gradient", 0);

  /* "petsc4py/PETSc/petsctao.pxi":617
 *                                    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(24, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ls = ((struct PyPetscTAOLineSearchObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":618
 * 
 *     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(24, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":619
 *     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(24, 619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_g = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":620
 *     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(24, 620, __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, 620, __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_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 620, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 620, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 620, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 620, __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, 620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 620, __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, 620, __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":621
 *     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(24, 621, __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)) != (0)) __PYX_ERR(24, 621, __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)) != (0)) __PYX_ERR(24, 621, __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)) != (0)) __PYX_ERR(24, 621, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 621, __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, 621, __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, 621, __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, 621, __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, 621, __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(24, 621, __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":622
 *     (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":612
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":625
 * 
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TAOLS_ObjGrad", 0);

  /* "petsc4py/PETSc/petsctao.pxi":631
 *                                   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(24, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ls = ((struct PyPetscTAOLineSearchObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":632
 * 
 *     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(24, 632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_x = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":633
 *     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(24, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_g = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":634
 *     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(24, 634, __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, 634, __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_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 634, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 634, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 634, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(24, 634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(24, 634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 634, __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, 634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 634, __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, 634, __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":635
 *     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(24, 635, __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)) != (0)) __PYX_ERR(24, 635, __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)) != (0)) __PYX_ERR(24, 635, __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)) != (0)) __PYX_ERR(24, 635, __pyx_L1_error);
  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(24, 635, __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, 635, __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, 635, __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, 635, __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, 635, __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(24, 635, __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":636
 *     (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(24, 636, __pyx_L1_error)
  (__pyx_v__f[0]) = __pyx_t_7;

  /* "petsc4py/PETSc/petsctao.pxi":637
 *     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":625
 * 
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petsctao.pxi":641
 * # --------------------------------------------------------------------
 * 
 * cdef inline TAOTerm ref_TAOTerm(PetscTAOTerm taoterm):             # <<<<<<<<<<<<<<
 *     cdef TAOTerm ob = <TAOTerm> TAOTerm()
 *     ob.taoterm = taoterm
*/

static CYTHON_INLINE struct PyPetscTAOTermObject *__pyx_f_8petsc4py_5PETSc_ref_TAOTerm(TaoTerm __pyx_v_taoterm) {
  struct PyPetscTAOTermObject *__pyx_v_ob = 0;
  struct PyPetscTAOTermObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ref_TAOTerm", 0);

  /* "petsc4py/PETSc/petsctao.pxi":642
 * 
 * cdef inline TAOTerm ref_TAOTerm(PetscTAOTerm taoterm):
 *     cdef TAOTerm ob = <TAOTerm> TAOTerm()             # <<<<<<<<<<<<<<
 *     ob.taoterm = taoterm
 *     CHKERR(PetscINCREF(ob.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOTerm, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(24, 642, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_t_2 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ob = ((struct PyPetscTAOTermObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petsctao.pxi":643
 * cdef inline TAOTerm ref_TAOTerm(PetscTAOTerm taoterm):
 *     cdef TAOTerm ob = <TAOTerm> TAOTerm()
 *     ob.taoterm = taoterm             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(ob.obj))
 *     return ob
*/
  __pyx_v_ob->taoterm = __pyx_v_taoterm;

  /* "petsc4py/PETSc/petsctao.pxi":644
 *     cdef TAOTerm ob = <TAOTerm> TAOTerm()
 *     ob.taoterm = taoterm
 *     CHKERR(PetscINCREF(ob.obj))             # <<<<<<<<<<<<<<
 *     return ob
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(24, 644, __pyx_L1_error)

  /* "petsc4py/PETSc/petsctao.pxi":645
 *     ob.taoterm = taoterm
 *     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":641
 * # --------------------------------------------------------------------
 * 
 * cdef inline TAOTerm ref_TAOTerm(PetscTAOTerm taoterm):             # <<<<<<<<<<<<<<
 *     cdef TAOTerm ob = <TAOTerm> TAOTerm()
 *     ob.taoterm = taoterm
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.ref_TAOTerm", __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":214
 * # --------------------------------------------------------------------
 * 
 * cdef inline PetscDMBoundaryType asBoundaryType(object boundary) \             # <<<<<<<<<<<<<<
 *     except <PetscDMBoundaryType>(-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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  DMBoundaryType __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("asBoundaryType", 0);

  /* "petsc4py/PETSc/petscdm.pxi":216
 * cdef inline PetscDMBoundaryType asBoundaryType(object boundary) \
 *     except <PetscDMBoundaryType>(-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":217
 *     except <PetscDMBoundaryType>(-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":216
 * cdef inline PetscDMBoundaryType asBoundaryType(object boundary) \
 *     except <PetscDMBoundaryType>(-1):
 *     if boundary is None:             # <<<<<<<<<<<<<<
 *         return DM_BOUNDARY_NONE
 *     if boundary is False:
*/
  }

  /* "petsc4py/PETSc/petscdm.pxi":218
 *     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":219
 *         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":218
 *     if boundary is None:
 *         return DM_BOUNDARY_NONE
 *     if boundary is False:             # <<<<<<<<<<<<<<
 *         return DM_BOUNDARY_NONE
 *     if boundary is True:
*/
  }

  /* "petsc4py/PETSc/petscdm.pxi":220
 *     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":221
 *         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":220
 *     if boundary is False:
 *         return DM_BOUNDARY_NONE
 *     if boundary is True:             # <<<<<<<<<<<<<<
 *         return DM_BOUNDARY_PERIODIC
 *     if isinstance(boundary, str):
*/
  }

  /* "petsc4py/PETSc/petscdm.pxi":222
 *     if boundary is True:
 *         return DM_BOUNDARY_PERIODIC
 *     if isinstance(boundary, str):             # <<<<<<<<<<<<<<
 *         if boundary == 'none':
 *             return DM_BOUNDARY_NONE
*/
  __pyx_t_1 = PyUnicode_Check(__pyx_v_boundary); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscdm.pxi":223
 *         return DM_BOUNDARY_PERIODIC
 *     if isinstance(boundary, str):
 *         if boundary == 'none':             # <<<<<<<<<<<<<<
 *             return DM_BOUNDARY_NONE
 *         elif boundary == 'ghosted':
*/
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_boundary, __pyx_mstate_global->__pyx_n_u_none, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(25, 223, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/petscdm.pxi":224
 *     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":223
 *         return DM_BOUNDARY_PERIODIC
 *     if isinstance(boundary, str):
 *         if boundary == 'none':             # <<<<<<<<<<<<<<
 *             return DM_BOUNDARY_NONE
 *         elif boundary == 'ghosted':
*/
    }

    /* "petsc4py/PETSc/petscdm.pxi":225
 *         if boundary == 'none':
 *             return DM_BOUNDARY_NONE
 *         elif boundary == 'ghosted':             # <<<<<<<<<<<<<<
 *             return DM_BOUNDARY_GHOSTED
 *         elif boundary == 'mirror':
*/
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_boundary, __pyx_mstate_global->__pyx_n_u_ghosted, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(25, 225, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/petscdm.pxi":226
 *             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":225
 *         if boundary == 'none':
 *             return DM_BOUNDARY_NONE
 *         elif boundary == 'ghosted':             # <<<<<<<<<<<<<<
 *             return DM_BOUNDARY_GHOSTED
 *         elif boundary == 'mirror':
*/
    }

    /* "petsc4py/PETSc/petscdm.pxi":227
 *         elif boundary == 'ghosted':
 *             return DM_BOUNDARY_GHOSTED
 *         elif boundary == 'mirror':             # <<<<<<<<<<<<<<
 *             return DM_BOUNDARY_MIRROR
 *         elif boundary == 'periodic':
*/
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_boundary, __pyx_mstate_global->__pyx_n_u_mirror, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(25, 227, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/petscdm.pxi":228
 *             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":227
 *         elif boundary == 'ghosted':
 *             return DM_BOUNDARY_GHOSTED
 *         elif boundary == 'mirror':             # <<<<<<<<<<<<<<
 *             return DM_BOUNDARY_MIRROR
 *         elif boundary == 'periodic':
*/
    }

    /* "petsc4py/PETSc/petscdm.pxi":229
 *         elif boundary == 'mirror':
 *             return DM_BOUNDARY_MIRROR
 *         elif boundary == 'periodic':             # <<<<<<<<<<<<<<
 *             return DM_BOUNDARY_PERIODIC
 *         elif boundary == 'twist':
*/
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_boundary, __pyx_mstate_global->__pyx_n_u_periodic, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(25, 229, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/petscdm.pxi":230
 *             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":229
 *         elif boundary == 'mirror':
 *             return DM_BOUNDARY_MIRROR
 *         elif boundary == 'periodic':             # <<<<<<<<<<<<<<
 *             return DM_BOUNDARY_PERIODIC
 *         elif boundary == 'twist':
*/
    }

    /* "petsc4py/PETSc/petscdm.pxi":231
 *         elif boundary == 'periodic':
 *             return DM_BOUNDARY_PERIODIC
 *         elif boundary == 'twist':             # <<<<<<<<<<<<<<
 *             return DM_BOUNDARY_TWIST
 *         else:
*/
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_boundary, __pyx_mstate_global->__pyx_n_u_twist, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(25, 231, __pyx_L1_error)
    if (likely(__pyx_t_1)) {

      /* "petsc4py/PETSc/petscdm.pxi":232
 *             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":231
 *         elif boundary == 'periodic':
 *             return DM_BOUNDARY_PERIODIC
 *         elif boundary == 'twist':             # <<<<<<<<<<<<<<
 *             return DM_BOUNDARY_TWIST
 *         else:
*/
    }

    /* "petsc4py/PETSc/petscdm.pxi":234
 *             return DM_BOUNDARY_TWIST
 *         else:
 *             raise ValueError("unknown boundary type: %s" % boundary)             # <<<<<<<<<<<<<<
 *     return boundary
 * 
*/
    /*else*/ {
      __pyx_t_3 = NULL;
      __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_unknown_boundary_type_s, __pyx_v_boundary); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 234, __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(25, 234, __pyx_L1_error)
    }

    /* "petsc4py/PETSc/petscdm.pxi":222
 *     if boundary is True:
 *         return DM_BOUNDARY_PERIODIC
 *     if isinstance(boundary, str):             # <<<<<<<<<<<<<<
 *         if boundary == 'none':
 *             return DM_BOUNDARY_NONE
*/
  }

  /* "petsc4py/PETSc/petscdm.pxi":235
 *         else:
 *             raise ValueError("unknown boundary type: %s" % boundary)
 *     return boundary             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscInt asBoundary(object boundary,
*/
  __pyx_t_6 = ((DMBoundaryType)__Pyx_PyLong_As_DMBoundaryType(__pyx_v_boundary)); if (unlikely(PyErr_Occurred())) __PYX_ERR(25, 235, __pyx_L1_error)
  __pyx_r = __pyx_t_6;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscdm.pxi":214
 * # --------------------------------------------------------------------
 * 
 * cdef inline PetscDMBoundaryType asBoundaryType(object boundary) \             # <<<<<<<<<<<<<<
 *     except <PetscDMBoundaryType>(-1):
 *     if boundary is None:
*/

  /* 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.asBoundaryType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = ((DMBoundaryType)-1L);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/petscdm.pxi":237
 *     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;
  PyTypeObject *__pyx_v_pyint = 0;
  PetscInt __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  DMBoundaryType __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  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":241
 *                                 PetscDMBoundaryType *_y,
 *                                 PetscDMBoundaryType *_z) except -1:
 *     cdef PetscInt dim = 0             # <<<<<<<<<<<<<<
 *     cdef object x=None, y=None, z=None
 *     # Use `type(0)` instead of `int` to workaround
*/
  __pyx_v_dim = 0;

  /* "petsc4py/PETSc/petscdm.pxi":242
 *                                 PetscDMBoundaryType *_z) except -1:
 *     cdef PetscInt dim = 0
 *     cdef object x=None, y=None, z=None             # <<<<<<<<<<<<<<
 *     # Use `type(0)` instead of `int` to workaround
 *     # Cython 3.1 failing to interpret `int` as a type
*/
  __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":245
 *     # Use `type(0)` instead of `int` to workaround
 *     # Cython 3.1 failing to interpret `int` as a type
 *     cdef type pyint = type(0)             # <<<<<<<<<<<<<<
 *     if boundary is None or \
 *        isinstance(boundary, str) or \
*/
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_mstate_global->__pyx_int_0)));
  __pyx_v_pyint = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_mstate_global->__pyx_int_0)));

  /* "petsc4py/PETSc/petscdm.pxi":246
 *     # Cython 3.1 failing to interpret `int` as a type
 *     cdef type pyint = type(0)
 *     if boundary is None or \             # <<<<<<<<<<<<<<
 *        isinstance(boundary, str) or \
 *        isinstance(boundary, pyint):
*/
  __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":247
 *     cdef type pyint = type(0)
 *     if boundary is None or \
 *        isinstance(boundary, str) or \             # <<<<<<<<<<<<<<
 *        isinstance(boundary, pyint):
 *         _x[0] = _y[0] = _z[0] = asBoundaryType(boundary)
*/
  __pyx_t_2 = PyUnicode_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":248
 *     if boundary is None or \
 *        isinstance(boundary, str) or \
 *        isinstance(boundary, pyint):             # <<<<<<<<<<<<<<
 *         _x[0] = _y[0] = _z[0] = asBoundaryType(boundary)
 *     else:
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_boundary, __pyx_v_pyint); 
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;

  /* "petsc4py/PETSc/petscdm.pxi":246
 *     # Cython 3.1 failing to interpret `int` as a type
 *     cdef type pyint = type(0)
 *     if boundary is None or \             # <<<<<<<<<<<<<<
 *        isinstance(boundary, str) or \
 *        isinstance(boundary, pyint):
*/
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscdm.pxi":249
 *        isinstance(boundary, str) or \
 *        isinstance(boundary, pyint):
 *         _x[0] = _y[0] = _z[0] = asBoundaryType(boundary)             # <<<<<<<<<<<<<<
 *     else:
 *         _x[0] = _y[0] = _z[0] = DM_BOUNDARY_NONE
*/
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asBoundaryType(__pyx_v_boundary); if (unlikely(__pyx_t_3 == ((DMBoundaryType)((DMBoundaryType)-1L)))) __PYX_ERR(25, 249, __pyx_L1_error)
    (__pyx_v__x[0]) = __pyx_t_3;
    (__pyx_v__y[0]) = __pyx_t_3;
    (__pyx_v__z[0]) = __pyx_t_3;

    /* "petsc4py/PETSc/petscdm.pxi":246
 *     # Cython 3.1 failing to interpret `int` as a type
 *     cdef type pyint = type(0)
 *     if boundary is None or \             # <<<<<<<<<<<<<<
 *        isinstance(boundary, str) or \
 *        isinstance(boundary, pyint):
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/petscdm.pxi":251
 *         _x[0] = _y[0] = _z[0] = asBoundaryType(boundary)
 *     else:
 *         _x[0] = _y[0] = _z[0] = DM_BOUNDARY_NONE             # <<<<<<<<<<<<<<
 *         boundary = tuple(boundary)
 *         dim = <PetscInt>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":252
 *     else:
 *         _x[0] = _y[0] = _z[0] = DM_BOUNDARY_NONE
 *         boundary = tuple(boundary)             # <<<<<<<<<<<<<<
 *         dim = <PetscInt>len(boundary)
 *         if   dim == 0: pass
*/
    __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_boundary); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_boundary, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "petsc4py/PETSc/petscdm.pxi":253
 *         _x[0] = _y[0] = _z[0] = DM_BOUNDARY_NONE
 *         boundary = tuple(boundary)
 *         dim = <PetscInt>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(25, 253, __pyx_L1_error)
    __pyx_v_dim = ((PetscInt)__pyx_t_5);

    /* "petsc4py/PETSc/petscdm.pxi":254
 *         boundary = tuple(boundary)
 *         dim = <PetscInt>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":255
 *         dim = <PetscInt>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(25, 255, __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_INCREF(__pyx_t_4);
        } else {
          __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 255, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_4);
        }
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        Py_ssize_t index = -1;
        __pyx_t_6 = PyObject_GetIter(__pyx_v_boundary); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
        index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 1) < (0)) __PYX_ERR(25, 255, __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, 255, __pyx_L1_error)
        __pyx_L9_unpacking_done:;
      }
      __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L7;
    }

    /* "petsc4py/PETSc/petscdm.pxi":256
 *         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(25, 256, __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_INCREF(__pyx_t_4);
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_6);
        } else {
          __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 256, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 256, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_6);
        }
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 256, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 256, __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(25, 256, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
        index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L10_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        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(25, 256, __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(25, 256, __pyx_L1_error)
        __pyx_L11_unpacking_done:;
      }
      __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_6);
      __pyx_t_6 = 0;
      goto __pyx_L7;
    }

    /* "petsc4py/PETSc/petscdm.pxi":257
 *         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(25, 257, __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_INCREF(__pyx_t_6);
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_4);
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
          __Pyx_INCREF(__pyx_t_8);
        } else {
          __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 257, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 257, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 257, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_8);
        }
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 257, __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(25, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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_4 = __pyx_t_7(__pyx_t_9); if (unlikely(!__pyx_t_4)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        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(25, 257, __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(25, 257, __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_4);
      __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_8);
      __pyx_t_8 = 0;
    }
    __pyx_L7:;

    /* "petsc4py/PETSc/petscdm.pxi":258
 *         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_3 = __pyx_f_8petsc4py_5PETSc_asBoundaryType(__pyx_v_x); if (unlikely(__pyx_t_3 == ((DMBoundaryType)((DMBoundaryType)-1L)))) __PYX_ERR(25, 258, __pyx_L1_error)
      (__pyx_v__x[0]) = __pyx_t_3;
    }

    /* "petsc4py/PETSc/petscdm.pxi":259
 *         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_3 = __pyx_f_8petsc4py_5PETSc_asBoundaryType(__pyx_v_y); if (unlikely(__pyx_t_3 == ((DMBoundaryType)((DMBoundaryType)-1L)))) __PYX_ERR(25, 259, __pyx_L1_error)
      (__pyx_v__y[0]) = __pyx_t_3;
    }

    /* "petsc4py/PETSc/petscdm.pxi":260
 *         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_3 = __pyx_f_8petsc4py_5PETSc_asBoundaryType(__pyx_v_z); if (unlikely(__pyx_t_3 == ((DMBoundaryType)((DMBoundaryType)-1L)))) __PYX_ERR(25, 260, __pyx_L1_error)
      (__pyx_v__z[0]) = __pyx_t_3;
    }
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/petscdm.pxi":261
 *         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":237
 *     return boundary
 * 
 * cdef inline PetscInt asBoundary(object boundary,             # <<<<<<<<<<<<<<
 *                                 PetscDMBoundaryType *_x,
 *                                 PetscDMBoundaryType *_y,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __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((PyObject *)__pyx_v_pyint);
  __Pyx_XDECREF(__pyx_v_boundary);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/petscdm.pxi":263
 *     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", 0);

  /* "petsc4py/PETSc/petscdm.pxi":267
 *                               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_mstate_global->__pyx_empty_tuple);
    __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscdm.pxi":268
 *                               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_PyLong_From_DMBoundaryType(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 268, __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) != (0)) __PYX_ERR(25, 268, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscdm.pxi":269
 *     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_PyLong_From_DMBoundaryType(__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyLong_From_DMBoundaryType(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 269, __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) != (0)) __PYX_ERR(25, 269, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(25, 269, __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":270
 *     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_PyLong_From_DMBoundaryType(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(25, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyLong_From_DMBoundaryType(__pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyLong_From_DMBoundaryType(__pyx_v_z); if (unlikely(!__pyx_t_3)) __PYX_ERR(25, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 270, __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) != (0)) __PYX_ERR(25, 270, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2) != (0)) __PYX_ERR(25, 270, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3) != (0)) __PYX_ERR(25, 270, __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":263
 *     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":274
 * # -----------------------------------------------------------------------------
 * 
 * cdef inline DM ref_DM(PetscDM dm):             # <<<<<<<<<<<<<<
 *     cdef DM ob = <DM> 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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ref_DM", 0);

  /* "petsc4py/PETSc/petscdm.pxi":275
 * 
 * cdef inline DM ref_DM(PetscDM dm):
 *     cdef DM ob = <DM> DM()             # <<<<<<<<<<<<<<
 *     ob.dm = dm
 *     CHKERR(PetscINCREF(ob.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 275, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_t_2 = ((PyObject *)__pyx_t_1);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF((PyObject *)__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ob = ((struct PyPetscDMObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscdm.pxi":276
 * cdef inline DM ref_DM(PetscDM dm):
 *     cdef DM ob = <DM> DM()
 *     ob.dm = dm             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(ob.obj))
 *     return ob
*/
  __pyx_v_ob->dm = __pyx_v_dm;

  /* "petsc4py/PETSc/petscdm.pxi":277
 *     cdef DM ob = <DM> DM()
 *     ob.dm = dm
 *     CHKERR(PetscINCREF(ob.obj))             # <<<<<<<<<<<<<<
 *     return ob
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ob->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(25, 277, __pyx_L1_error)

  /* "petsc4py/PETSc/petscdm.pxi":278
 *     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":274
 * # -----------------------------------------------------------------------------
 * 
 * cdef inline DM ref_DM(PetscDM dm):             # <<<<<<<<<<<<<<
 *     cdef DM ob = <DM> 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":282
 * # --------------------------------------------------------------------
 * 
 * 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("DM_PyCoarsenHook", 0);

  /* "petsc4py/PETSc/petscdm.pxi":288
 *    ) 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(25, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Fine = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscdm.pxi":289
 * 
 *     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(25, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Coarse = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscdm.pxi":290
 *     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(25, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hooks = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscdm.pxi":291
 *     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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(25, 291, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(25, 291, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscdm.pxi":292
 *     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(25, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 292, __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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(25, 292, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_4;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(25, 292, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4));
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4);
        #endif
        ++__pyx_t_4;
      }
      if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 292, __pyx_L1_error)
    } else {
      __pyx_t_6 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(25, 292, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_hook, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "petsc4py/PETSc/petscdm.pxi":293
 *     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(25, 293, __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_INCREF(__pyx_t_6);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_8);
      } else {
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 293, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 293, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 293, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
      }
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 293, __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(25, 293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(25, 293, __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(25, 293, __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":294
 *     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(25, 294, __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)) != (0)) __PYX_ERR(25, 294, __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)) != (0)) __PYX_ERR(25, 294, __pyx_L1_error);
    __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 294, __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(25, 294, __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(25, 294, __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(25, 294, __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(25, 294, __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(25, 294, __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":292
 *     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":295
 *         (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":282
 * # --------------------------------------------------------------------
 * 
 * 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscdm.pxi":297
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("DM_PyRestrictHook", 0);

  /* "petsc4py/PETSc/petscdm.pxi":306
 *    ) 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(25, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Fine = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscdm.pxi":307
 * 
 *     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(25, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Mrestrict = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscdm.pxi":308
 *     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(25, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Rscale = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscdm.pxi":309
 *     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(25, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Inject = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscdm.pxi":310
 *     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(25, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Coarse = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscdm.pxi":311
 *     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(25, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hooks = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscdm.pxi":312
 *     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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(25, 312, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(25, 312, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscdm.pxi":313
 *     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(25, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(25, 313, __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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(25, 313, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_1, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_4;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(25, 313, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4));
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4);
        #endif
        ++__pyx_t_4;
      }
      if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 313, __pyx_L1_error)
    } else {
      __pyx_t_6 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(25, 313, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_hook, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "petsc4py/PETSc/petscdm.pxi":314
 *     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(25, 314, __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_INCREF(__pyx_t_6);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_8);
      } else {
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 314, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 314, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 314, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
      }
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(25, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(25, 314, __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(25, 314, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(25, 314, __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(25, 314, __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":315
 *     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(25, 315, __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)) != (0)) __PYX_ERR(25, 315, __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)) != (0)) __PYX_ERR(25, 315, __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)) != (0)) __PYX_ERR(25, 315, __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)) != (0)) __PYX_ERR(25, 315, __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)) != (0)) __PYX_ERR(25, 315, __pyx_L1_error);
    __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(25, 315, __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(25, 315, __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(25, 315, __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(25, 315, __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(25, 315, __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(25, 315, __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":313
 *     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":316
 *         (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":297
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscdmda.pxi":88
 * # --------------------------------------------------------------------
 * 
 * cdef inline PetscDMDAStencilType asStencil(object stencil) \             # <<<<<<<<<<<<<<
 *     except <PetscDMDAStencilType>(-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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  DMDAStencilType __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("asStencil", 0);

  /* "petsc4py/PETSc/petscdmda.pxi":90
 * cdef inline PetscDMDAStencilType asStencil(object stencil) \
 *     except <PetscDMDAStencilType>(-1):
 *     if isinstance(stencil, str):             # <<<<<<<<<<<<<<
 *         if   stencil == "star": return DMDA_STENCIL_STAR
 *         elif stencil == "box":  return DMDA_STENCIL_BOX
*/
  __pyx_t_1 = PyUnicode_Check(__pyx_v_stencil); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscdmda.pxi":91
 *     except <PetscDMDAStencilType>(-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_PyUnicode_Equals(__pyx_v_stencil, __pyx_mstate_global->__pyx_n_u_star, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 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_PyUnicode_Equals(__pyx_v_stencil, __pyx_mstate_global->__pyx_n_u_box, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 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_3 = NULL;
      __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_unknown_stencil_type_s, __pyx_v_stencil); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 93, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 93, __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, 93, __pyx_L1_error)
    }

    /* "petsc4py/PETSc/petscdmda.pxi":90
 * cdef inline PetscDMDAStencilType asStencil(object stencil) \
 *     except <PetscDMDAStencilType>(-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_6 = ((DMDAStencilType)__Pyx_PyLong_As_DMDAStencilType(__pyx_v_stencil)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 94, __pyx_L1_error)
  __pyx_r = __pyx_t_6;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscdmda.pxi":88
 * # --------------------------------------------------------------------
 * 
 * cdef inline PetscDMDAStencilType asStencil(object stencil) \             # <<<<<<<<<<<<<<
 *     except <PetscDMDAStencilType>(-1):
 *     if isinstance(stencil, str):
*/

  /* 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.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", 0);

  /* "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_mstate_global->__pyx_n_u_star);
    __pyx_r = __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_box);
    __pyx_r = __pyx_mstate_global->__pyx_n_u_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 <PetscDMDAInterpolationType>(-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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  DMDAInterpolationType __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dainterpolationtype", 0);

  /* "petsc4py/PETSc/petscdmda.pxi":102
 * cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \
 *     except <PetscDMDAInterpolationType>(-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 = PyUnicode_Check(__pyx_v_itype); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscdmda.pxi":103
 *     except <PetscDMDAInterpolationType>(-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_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_q0, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 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_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Q0, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 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_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_q1, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 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_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Q1, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 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_4 = NULL;
      __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_unknown_interpolation_type_s, __pyx_v_itype); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 105, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 105, __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, 105, __pyx_L1_error)
    }

    /* "petsc4py/PETSc/petscdmda.pxi":102
 * cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \
 *     except <PetscDMDAInterpolationType>(-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_7 = ((DMDAInterpolationType)__Pyx_PyLong_As_DMDAInterpolationType(__pyx_v_itype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 106, __pyx_L1_error)
  __pyx_r = __pyx_t_7;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscdmda.pxi":100
 *     elif stype == DMDA_STENCIL_BOX:  return "box"
 * 
 * cdef inline PetscDMDAInterpolationType dainterpolationtype(object itype) \             # <<<<<<<<<<<<<<
 *     except <PetscDMDAInterpolationType>(-1):
 *     if (isinstance(itype, str)):
*/

  /* 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.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 <PetscDMDAElementType>(-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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  DMDAElementType __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("daelementtype", 0);

  /* "petsc4py/PETSc/petscdmda.pxi":110
 * cdef inline PetscDMDAElementType daelementtype(object etype) \
 *     except <PetscDMDAElementType>(-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 = PyUnicode_Check(__pyx_v_etype); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscdmda.pxi":111
 *     except <PetscDMDAElementType>(-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_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_p1, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 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_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_P1, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(4, 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_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_q1, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 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_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Q1, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(4, 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_4 = NULL;
      __pyx_t_5 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_unknown_element_type_s, __pyx_v_etype); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 113, __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, 113, __pyx_L1_error)
    }

    /* "petsc4py/PETSc/petscdmda.pxi":110
 * cdef inline PetscDMDAElementType daelementtype(object etype) \
 *     except <PetscDMDAElementType>(-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_7 = ((DMDAElementType)__Pyx_PyLong_As_DMDAElementType(__pyx_v_etype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 114, __pyx_L1_error)
  __pyx_r = __pyx_t_7;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscdmda.pxi":108
 *     return itype
 * 
 * cdef inline PetscDMDAElementType daelementtype(object etype) \             # <<<<<<<<<<<<<<
 *     except <PetscDMDAElementType>(-1):
 *     if (isinstance(etype, str)):
*/

  /* 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.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 = <PetscInt>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 = <PetscInt>len(dims)
 *     if   dim == 0: pass
*/
  __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 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 = <PetscInt>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(4, 131, __pyx_L1_error)
  __pyx_v_dim = ((PetscInt)__pyx_t_2);

  /* "petsc4py/PETSc/petscdmda.pxi":132
 *     dims = tuple(dims)
 *     dim = <PetscInt>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 = <PetscInt>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(4, 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);
        __Pyx_INCREF(__pyx_t_1);
      } else {
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 133, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
      }
      #else
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 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(4, 133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(4, 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(4, 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(4, 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_INCREF(__pyx_t_1);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 134, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 134, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 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(4, 134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(4, 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(4, 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(4, 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_INCREF(__pyx_t_4);
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_6);
      } else {
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 135, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 135, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 135, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
      }
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 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(4, 135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(4, 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(4, 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(4, 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(4, 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(4, 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", 0);

  /* "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_mstate_global->__pyx_empty_tuple);
    __pyx_r = __pyx_mstate_global->__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(4, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 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) != (0)) __PYX_ERR(4, 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(4, 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(4, 147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 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) != (0)) __PYX_ERR(4, 147, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(4, 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(4, 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(4, 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(4, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 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) != (0)) __PYX_ERR(4, 148, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2) != (0)) __PYX_ERR(4, 148, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3) != (0)) __PYX_ERR(4, 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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8[4];
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("asOwnershipRanges", 0);

  /* "petsc4py/PETSc/petscdmda.pxi":156
 *                                     PetscInt **_y,
 *                                     PetscInt **_z):
 *     cdef object ranges = list(ownership_ranges)             # <<<<<<<<<<<<<<
 *     cdef PetscInt rdim = <PetscInt>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(4, 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 = <PetscInt>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(4, 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 = <PetscInt>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 = <PetscInt>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)) {
    __pyx_t_4 = NULL;

    /* "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_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dim); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_rdim); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_number_of_dimensions;
    __pyx_t_8[1] = __pyx_t_6;
    __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_and_number_ownership_ranges;
    __pyx_t_8[3] = __pyx_t_7;

    /* "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_5 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7));
    if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 160, __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(4, 160, __pyx_L1_error)

    /* "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_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_1 = __Pyx_GetItemInt(__pyx_v_ranges, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_1, (&__pyx_v_nlx), __pyx_v__x)); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely((__Pyx_SetItemInt(__pyx_v_ranges, 0, __pyx_t_5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(4, 164, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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)) {
      __pyx_t_1 = NULL;

      /* "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(4, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_4), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_4), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_ownership_range_size;
      __pyx_t_8[1] = __pyx_t_7;
      __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_and_number_or_processors;
      __pyx_t_8[3] = __pyx_t_6;

      /* "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_4 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 26 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
      if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_4};
        __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 166, __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(4, 166, __pyx_L1_error)

      /* "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_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_5 = __Pyx_GetItemInt(__pyx_v_ranges, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_5, (&__pyx_v_nly), __pyx_v__y)); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely((__Pyx_SetItemInt(__pyx_v_ranges, 1, __pyx_t_4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(4, 170, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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)) {
      __pyx_t_5 = NULL;

      /* "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_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nly); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_n[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_ownership_range_size;
      __pyx_t_8[1] = __pyx_t_6;
      __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_and_number_or_processors;
      __pyx_t_8[3] = __pyx_t_7;

      /* "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_PyUnicode_Join(__pyx_t_8, 4, 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 26 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7));
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 172, __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(4, 172, __pyx_L1_error)

      /* "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_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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 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(4, 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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(4, 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)) {
      __pyx_t_4 = NULL;

      /* "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_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nlz); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_p[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_ownership_range_size;
      __pyx_t_8[1] = __pyx_t_7;
      __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_and_number_or_processors;
      __pyx_t_8[3] = __pyx_t_6;

      /* "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_5 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 26 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
      if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 178, __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(4, 178, __pyx_L1_error)

      /* "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_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_1 = __Pyx_PySequence_Tuple(__pyx_v_ranges); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __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", 0);

  /* "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(4, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 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) != (0)) __PYX_ERR(4, 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(4, 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(4, 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(4, 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(4, 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(4, 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 readonly, 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_readonly;
  int __pyx_v_DOF;
  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;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_da,&__pyx_mstate_global->__pyx_n_u_vec,&__pyx_mstate_global->__pyx_n_u_readonly,&__pyx_mstate_global->__pyx_n_u_DOF,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(4, 205, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(4, 205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(4, 205, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 4, i); __PYX_ERR(4, 205, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(4, 205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(4, 205, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(4, 205, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(4, 205, __pyx_L3_error)
        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]);
    __pyx_v_readonly = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_readonly == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 205, __pyx_L3_error)
    if (values[3]) {
      __pyx_v_DOF = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_DOF == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 205, __pyx_L3_error)
    } else {
      __pyx_v_DOF = ((int)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 4, __pyx_nargs); __PYX_ERR(4, 205, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, 0, "da", 0))) __PYX_ERR(4, 205, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(4, 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_readonly, __pyx_v_DOF);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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_readonly, 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;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11[4];
  size_t __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "petsc4py/PETSc/petscdmda.pxi":207
 *     def __cinit__(self, DMDA da, Vec vec, bint readonly, 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(4, 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(4, 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(4, 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(4, 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*/ {
    __pyx_t_7 = NULL;

    /* "petsc4py/PETSc/petscdmda.pxi":235
 *                 "Vector local size %d is not compatible "
 *                 "with DMDA local sizes %s"
 *                 % (<Py_ssize_t>n, toDims(dim, lxm, lym, lzm)))             # <<<<<<<<<<<<<<
 *         #
 *         cdef tuple starts = toDims(dim, xs, ys, zs)
*/
    __pyx_t_8 = __Pyx_PyUnicode_From_Py_ssize_t(((Py_ssize_t)__pyx_v_n), 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_lxm, __pyx_v_lym, __pyx_v_lzm); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_9), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_Vector_local_size;
    __pyx_t_11[1] = __pyx_t_8;
    __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_is_not_compatible_with_DMDA_loc;
    __pyx_t_11[3] = __pyx_t_10;

    /* "petsc4py/PETSc/petscdmda.pxi":233
 *         else:
 *             raise ValueError(
 *                 "Vector local size %d is not compatible "             # <<<<<<<<<<<<<<
 *                 "with DMDA local sizes %s"
 *                 % (<Py_ssize_t>n, toDims(dim, lxm, lym, lzm)))
*/
    __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_11, 4, 18 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 41 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10));
    if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_12 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_9};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(4, 232, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/petscdmda.pxi":237
 *                 % (<Py_ssize_t>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 = <Py_ssize_t>sizeof(PetscScalar)
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_xs, __pyx_v_ys, __pyx_v_zs); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_starts = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 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 = <Py_ssize_t>sizeof(PetscScalar)
 *         cdef Py_ssize_t f = <Py_ssize_t>dof
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_xm, __pyx_v_ym, __pyx_v_zm); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_sizes = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 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 = <Py_ssize_t>sizeof(PetscScalar)             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t f = <Py_ssize_t>dof
 *         cdef Py_ssize_t d = <Py_ssize_t>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 = <Py_ssize_t>sizeof(PetscScalar)
 *         cdef Py_ssize_t f = <Py_ssize_t>dof             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t d = <Py_ssize_t>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 = <Py_ssize_t>sizeof(PetscScalar)
 *         cdef Py_ssize_t f = <Py_ssize_t>dof
 *         cdef Py_ssize_t d = <Py_ssize_t>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 = <Py_ssize_t>dof
 *         cdef Py_ssize_t d = <Py_ssize_t>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_6 = __pyx_f_8petsc4py_5PETSc_toDims(__pyx_v_dim, __pyx_v_xm, __pyx_v_ym, __pyx_v_zm); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_shape = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "petsc4py/PETSc/petscdmda.pxi":243
 *         cdef Py_ssize_t d = <Py_ssize_t>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_6 = PyLong_FromSsize_t((__pyx_v_k * __pyx_v_f)); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = PyLong_FromSsize_t(((__pyx_v_k * __pyx_v_f) * __pyx_v_xm)); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = PyLong_FromSsize_t((((__pyx_v_k * __pyx_v_f) * __pyx_v_xm) * __pyx_v_ym)); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6) != (0)) __PYX_ERR(4, 243, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9) != (0)) __PYX_ERR(4, 243, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_7) != (0)) __PYX_ERR(4, 243, __pyx_L1_error);
  __pyx_t_6 = 0;
  __pyx_t_9 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_10, 0, __pyx_v_d, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (!(likely(PyTuple_CheckExact(__pyx_t_7)) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_7))) __PYX_ERR(4, 243, __pyx_L1_error)
  __pyx_v_strides = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 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_13 = (__pyx_v_f > 1);
  __pyx_t_2 = __pyx_t_13;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {
    __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_f); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7) != (0)) __PYX_ERR(4, 244, __pyx_L1_error);
    __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_shape, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF_SET(__pyx_v_shape, ((PyObject*)__pyx_t_7));
    __pyx_t_7 = 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, readonly)
*/
  if (!__pyx_v_DOF) {
  } else {
    __pyx_t_2 = __pyx_v_DOF;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_13 = (__pyx_v_f > 1);
  __pyx_t_2 = __pyx_t_13;
  __pyx_L8_bool_binop_done:;
  if (__pyx_t_2) {
    __pyx_t_7 = PyLong_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7) != (0)) __PYX_ERR(4, 245, __pyx_L1_error);
    __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_strides, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF_SET(__pyx_v_strides, ((PyObject*)__pyx_t_7));
    __pyx_t_7 = 0;
  }

  /* "petsc4py/PETSc/petscdmda.pxi":247
 *         if DOF or f > 1: strides += (k,)
 *         #
 *         self.vecbuf = _Vec_buffer(vec, readonly)             # <<<<<<<<<<<<<<
 *         self.starts = starts
 *         self.sizes = sizes
*/
  __pyx_t_10 = NULL;
  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_readonly); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_12 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_10, ((PyObject *)__pyx_v_vec), __pyx_t_9};
    __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 247, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_7);
  }
  __Pyx_GIVEREF((PyObject *)__pyx_t_7);
  __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_7);
  __pyx_t_7 = 0;

  /* "petsc4py/PETSc/petscdmda.pxi":248
 *         #
 *         self.vecbuf = _Vec_buffer(vec, readonly)
 *         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, readonly)
 *         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 readonly, 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_XDECREF(__pyx_t_10);
  __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", 0);

  /* "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(4, 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(4, 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_mstate_global->__pyx_n_u_shape, __pyx_t_4) < (0)) __PYX_ERR(4, 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_mstate_global->__pyx_n_u_strides, __pyx_t_4) < (0)) __PYX_ERR(4, 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", 0);

  /* "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(4, 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(4, 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(4, 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(4, 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(4, 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(4, 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(4, 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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15_DMDA_Vec_array_7__enter__ = {"__enter__", (PyCFunction)(void(*)(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__};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__enter__", __pyx_kwds); 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__", 0);

  /* "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(4, 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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15_DMDA_Vec_array_9__exit__ = {"__exit__", (PyCFunction)(void(*)(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__};
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_SIZE
  __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);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__exit__", __pyx_kwds); 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__", 0);

  /* "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(4, 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__", 0);
  __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__", 0);
  __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__", 0);
  __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__", 0);
  __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 readonly, 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__", 0);
  __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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 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(4, 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(4, 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_mstate_global->__pyx_int_0);
  __pyx_t_4 = __pyx_mstate_global->__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(4, 293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 293, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_5, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_5;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 293, __pyx_L1_error)
          #endif
          if (__pyx_t_5 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5));
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5);
        #endif
        ++__pyx_t_5;
      }
      if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 293, __pyx_L1_error)
    } else {
      __pyx_t_7 = __pyx_t_6(__pyx_t_3);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(4, 293, __pyx_L1_error)
          PyErr_Clear();
        }
        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_PyLong_AddObjC(__pyx_t_4, __pyx_mstate_global->__pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 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(4, 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(4, 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(4, 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(4, 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("adjust_index", 0);

  /* "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_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 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_mstate_global->__pyx_n_u_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 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_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 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(4, 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(4, 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(4, 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(4, 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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
    if (__pyx_t_6) {
      __Pyx_ErrRestore(0,0,0);

      /* "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;
      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_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":83
 * # --------------------------------------------------------------------
 * 
 * cdef inline PetscDMStagStencilType asStagStencil(object stencil) \             # <<<<<<<<<<<<<<
 *     except <PetscDMStagStencilType>(-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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  DMStagStencilType __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("asStagStencil", 0);

  /* "petsc4py/PETSc/petscdmstag.pxi":85
 * cdef inline PetscDMStagStencilType asStagStencil(object stencil) \
 *     except <PetscDMStagStencilType>(-1):
 *     if isinstance(stencil, str):             # <<<<<<<<<<<<<<
 *         if   stencil == "star":  return DMSTAG_STENCIL_STAR
 *         elif stencil == "box":   return DMSTAG_STENCIL_BOX
*/
  __pyx_t_1 = PyUnicode_Check(__pyx_v_stencil); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscdmstag.pxi":86
 *     except <PetscDMStagStencilType>(-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_PyUnicode_Equals(__pyx_v_stencil, __pyx_mstate_global->__pyx_n_u_star, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 86, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_STENCIL_STAR;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":87
 *     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_PyUnicode_Equals(__pyx_v_stencil, __pyx_mstate_global->__pyx_n_u_box, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 87, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_STENCIL_BOX;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":88
 *         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_PyUnicode_Equals(__pyx_v_stencil, __pyx_mstate_global->__pyx_n_u_none, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 88, __pyx_L1_error)
    if (likely(__pyx_t_1)) {
      __pyx_r = DMSTAG_STENCIL_NONE;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":89
 *         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_3 = NULL;
      __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_unknown_stencil_type_s, __pyx_v_stencil); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 89, __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(26, 89, __pyx_L1_error)
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":85
 * cdef inline PetscDMStagStencilType asStagStencil(object stencil) \
 *     except <PetscDMStagStencilType>(-1):
 *     if isinstance(stencil, str):             # <<<<<<<<<<<<<<
 *         if   stencil == "star":  return DMSTAG_STENCIL_STAR
 *         elif stencil == "box":   return DMSTAG_STENCIL_BOX
*/
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":90
 *         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_6 = ((DMStagStencilType)__Pyx_PyLong_As_DMStagStencilType(__pyx_v_stencil)); if (unlikely(PyErr_Occurred())) __PYX_ERR(26, 90, __pyx_L1_error)
  __pyx_r = __pyx_t_6;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscdmstag.pxi":83
 * # --------------------------------------------------------------------
 * 
 * cdef inline PetscDMStagStencilType asStagStencil(object stencil) \             # <<<<<<<<<<<<<<
 *     except <PetscDMStagStencilType>(-1):
 *     if isinstance(stencil, str):
*/

  /* 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.asStagStencil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = ((DMStagStencilType)-1L);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/petscdmstag.pxi":92
 *     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", 0);

  /* "petsc4py/PETSc/petscdmstag.pxi":93
 * 
 * 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_mstate_global->__pyx_n_u_star);
    __pyx_r = __pyx_mstate_global->__pyx_n_u_star;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":94
 * 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_mstate_global->__pyx_n_u_box);
    __pyx_r = __pyx_mstate_global->__pyx_n_u_box;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":95
 *     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_mstate_global->__pyx_n_u_none);
    __pyx_r = __pyx_mstate_global->__pyx_n_u_none;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":92
 *     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":97
 *     elif stype == DMSTAG_STENCIL_NONE:  return "none"
 * 
 * cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \             # <<<<<<<<<<<<<<
 *     except <PetscDMStagStencilLocation>(-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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  DMStagStencilLocation __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("asStagStencilLocation", 0);

  /* "petsc4py/PETSc/petscdmstag.pxi":99
 * cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \
 *     except <PetscDMStagStencilLocation>(-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 = PyUnicode_Check(__pyx_v_stencil_location); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/petscdmstag.pxi":100
 *     except <PetscDMStagStencilLocation>(-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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_null, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 100, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_NULL_LOCATION;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":101
 *     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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_back_down_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 101, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_BACK_DOWN_LEFT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":102
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_back_down, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 102, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_BACK_DOWN;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":103
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_back_down_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 103, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_BACK_DOWN_RIGHT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":104
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_back_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 104, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_BACK_LEFT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":105
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_back, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 105, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_BACK;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":106
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_back_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 106, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_BACK_RIGHT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":107
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_back_up_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 107, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_BACK_UP_LEFT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":108
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_back_up, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 108, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_BACK_UP;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":109
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_back_up_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 109, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_BACK_UP_RIGHT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":110
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_down_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 110, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_DOWN_LEFT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":111
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_down, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 111, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_DOWN;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":112
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_down_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 112, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_DOWN_RIGHT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":113
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 113, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_LEFT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":114
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_element, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 114, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_ELEMENT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":115
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 115, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_RIGHT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":116
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_up_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 116, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_UP_LEFT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":117
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_up, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 117, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_UP;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":118
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_up_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 118, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_UP_RIGHT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":119
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_front_down_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 119, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_FRONT_DOWN_LEFT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":120
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_front_down, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 120, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_FRONT_DOWN;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":121
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_front_down_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 121, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_FRONT_DOWN_RIGHT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":122
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_front_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 122, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_FRONT_LEFT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":123
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_front, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 123, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_FRONT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":124
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_front_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 124, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_FRONT_RIGHT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":125
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_front_up_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 125, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_FRONT_UP_LEFT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":126
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_front_up, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 126, __pyx_L1_error)
    if (__pyx_t_1) {
      __pyx_r = DMSTAG_FRONT_UP;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":127
 *         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_PyUnicode_Equals(__pyx_v_stencil_location, __pyx_mstate_global->__pyx_n_u_front_up_right, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(26, 127, __pyx_L1_error)
    if (likely(__pyx_t_1)) {
      __pyx_r = DMSTAG_FRONT_UP_RIGHT;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":128
 *         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_3 = NULL;
      __pyx_t_4 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_unknown_stencil_location_type_s, __pyx_v_stencil_location); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 128, __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(26, 128, __pyx_L1_error)
    }

    /* "petsc4py/PETSc/petscdmstag.pxi":99
 * cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \
 *     except <PetscDMStagStencilLocation>(-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":129
 *         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_6 = ((DMStagStencilLocation)__Pyx_PyLong_As_DMStagStencilLocation(__pyx_v_stencil_location)); if (unlikely(PyErr_Occurred())) __PYX_ERR(26, 129, __pyx_L1_error)
  __pyx_r = __pyx_t_6;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscdmstag.pxi":97
 *     elif stype == DMSTAG_STENCIL_NONE:  return "none"
 * 
 * cdef inline PetscDMStagStencilLocation asStagStencilLocation(object stencil_location) \             # <<<<<<<<<<<<<<
 *     except <PetscDMStagStencilLocation>(-1):
 *     if isinstance(stencil_location, str):
*/

  /* 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.asStagStencilLocation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = ((DMStagStencilLocation)-1L);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/petscdmstag.pxi":132
 * 
 * 
 * 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":136
 *                                 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":137
 *                                 PetscInt *_P) except? -1:
 *     cdef PetscInt dim = PETSC_DECIDE
 *     cdef object M=None, N=None, P=None             # <<<<<<<<<<<<<<
 *     dims = tuple(dims)
 *     dim = <PetscInt>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":138
 *     cdef PetscInt dim = PETSC_DECIDE
 *     cdef object M=None, N=None, P=None
 *     dims = tuple(dims)             # <<<<<<<<<<<<<<
 *     dim = <PetscInt>len(dims)
 *     if   dim == 0: pass
*/
  __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_dims); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 138, __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":139
 *     cdef object M=None, N=None, P=None
 *     dims = tuple(dims)
 *     dim = <PetscInt>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(26, 139, __pyx_L1_error)
  __pyx_v_dim = ((PetscInt)__pyx_t_2);

  /* "petsc4py/PETSc/petscdmstag.pxi":140
 *     dims = tuple(dims)
 *     dim = <PetscInt>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":141
 *     dim = <PetscInt>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(26, 141, __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_INCREF(__pyx_t_1);
      } else {
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 141, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
      }
      #else
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 141, __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(26, 141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(26, 141, __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(26, 141, __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":142
 *     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(26, 142, __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_INCREF(__pyx_t_1);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 142, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 142, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 142, __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(26, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(26, 142, __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(26, 142, __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":143
 *     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(26, 143, __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_INCREF(__pyx_t_4);
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_6);
      } else {
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 143, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 143, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 143, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
      }
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 143, __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(26, 143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(26, 143, __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(26, 143, __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":144
 *     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(26, 144, __pyx_L1_error)
    (__pyx_v__M[0]) = __pyx_t_8;
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":145
 *     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(26, 145, __pyx_L1_error)
    (__pyx_v__N[0]) = __pyx_t_8;
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":146
 *     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(26, 146, __pyx_L1_error)
    (__pyx_v__P[0]) = __pyx_t_8;
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":147
 *     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":132
 * 
 * 
 * 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":149
 *     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", 0);

  /* "petsc4py/PETSc/petscdmstag.pxi":153
 *                              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_mstate_global->__pyx_empty_tuple);
    __pyx_r = __pyx_mstate_global->__pyx_empty_tuple;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":154
 *                              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(26, 154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 154, __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) != (0)) __PYX_ERR(26, 154, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":155
 *     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(26, 155, __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(26, 155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 155, __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) != (0)) __PYX_ERR(26, 155, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(26, 155, __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":156
 *     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(26, 156, __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(26, 156, __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(26, 156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 156, __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) != (0)) __PYX_ERR(26, 156, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2) != (0)) __PYX_ERR(26, 156, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3) != (0)) __PYX_ERR(26, 156, __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":149
 *     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":158
 *     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":163
 *                             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":164
 *                             PetscInt *_dof3) except? -1:
 *     cdef PetscInt ndofs = PETSC_DECIDE
 *     cdef object dof0=None, dof1=None, dof2=None, dof3=None             # <<<<<<<<<<<<<<
 *     dofs = tuple(dofs)
 *     ndofs = <PetscInt>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":165
 *     cdef PetscInt ndofs = PETSC_DECIDE
 *     cdef object dof0=None, dof1=None, dof2=None, dof3=None
 *     dofs = tuple(dofs)             # <<<<<<<<<<<<<<
 *     ndofs = <PetscInt>len(dofs)
 *     if ndofs == 2:   dof0, dof1 = dofs
*/
  __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_dofs); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 165, __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":166
 *     cdef object dof0=None, dof1=None, dof2=None, dof3=None
 *     dofs = tuple(dofs)
 *     ndofs = <PetscInt>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(26, 166, __pyx_L1_error)
  __pyx_v_ndofs = ((PetscInt)__pyx_t_2);

  /* "petsc4py/PETSc/petscdmstag.pxi":167
 *     dofs = tuple(dofs)
 *     ndofs = <PetscInt>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(26, 167, __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_INCREF(__pyx_t_1);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 167, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 167, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 167, __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(26, 167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(26, 167, __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(26, 167, __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":168
 *     ndofs = <PetscInt>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(26, 168, __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_INCREF(__pyx_t_4);
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_5);
      } else {
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 168, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 168, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 168, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
      }
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 168, __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(26, 168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(26, 168, __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(26, 168, __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":169
 *     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(26, 169, __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_INCREF(__pyx_t_5);
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3);
        __Pyx_INCREF(__pyx_t_7);
      } else {
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 169, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 169, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 169, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 169, __pyx_L1_error)
        __Pyx_XGOTREF(__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 = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(26, 169, __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(26, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(26, 169, __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(26, 169, __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":170
 *     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(26, 170, __pyx_L1_error)
    (__pyx_v__dof0[0]) = __pyx_t_9;
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":171
 *     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(26, 171, __pyx_L1_error)
    (__pyx_v__dof1[0]) = __pyx_t_9;
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":172
 *     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(26, 172, __pyx_L1_error)
    (__pyx_v__dof2[0]) = __pyx_t_9;
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":173
 *     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(26, 173, __pyx_L1_error)
    (__pyx_v__dof3[0]) = __pyx_t_9;
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":174
 *     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":158
 *     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":176
 *     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", 0);

  /* "petsc4py/PETSc/petscdmstag.pxi":181
 *                          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(26, 181, __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(26, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 181, __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) != (0)) __PYX_ERR(26, 181, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(26, 181, __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":182
 *                          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(26, 182, __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(26, 182, __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(26, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 182, __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) != (0)) __PYX_ERR(26, 182, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(26, 182, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2) != (0)) __PYX_ERR(26, 182, __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":183
 *     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(26, 183, __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(26, 183, __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(26, 183, __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(26, 183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 183, __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) != (0)) __PYX_ERR(26, 183, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2) != (0)) __PYX_ERR(26, 183, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3) != (0)) __PYX_ERR(26, 183, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4) != (0)) __PYX_ERR(26, 183, __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":176
 *     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":185
 *     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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8[4];
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("asStagOwnershipRanges", 0);

  /* "petsc4py/PETSc/petscdmstag.pxi":191
 *                                         PetscInt **_y,
 *                                         PetscInt **_z):
 *     cdef object ranges = list(ownership_ranges)             # <<<<<<<<<<<<<<
 *     cdef PetscInt rdim = <PetscInt>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(26, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ranges = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscdmstag.pxi":192
 *                                         PetscInt **_z):
 *     cdef object ranges = list(ownership_ranges)
 *     cdef PetscInt rdim = <PetscInt>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(26, 192, __pyx_L1_error)
  __pyx_v_rdim = ((PetscInt)__pyx_t_2);

  /* "petsc4py/PETSc/petscdmstag.pxi":193
 *     cdef object ranges = list(ownership_ranges)
 *     cdef PetscInt rdim = <PetscInt>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":194
 *     cdef PetscInt rdim = <PetscInt>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":195
 *     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)) {
    __pyx_t_4 = NULL;

    /* "petsc4py/PETSc/petscdmstag.pxi":197
 *     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_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_dim); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_rdim); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_number_of_dimensions;
    __pyx_t_8[1] = __pyx_t_6;
    __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_and_number_ownership_ranges;
    __pyx_t_8[3] = __pyx_t_7;

    /* "petsc4py/PETSc/petscdmstag.pxi":196
 *     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_5 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7));
    if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 195, __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(26, 195, __pyx_L1_error)

    /* "petsc4py/PETSc/petscdmstag.pxi":195
 *     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_L3:;

  /* "petsc4py/PETSc/petscdmstag.pxi":198
 *         "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":199
 *         (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_1 = __Pyx_GetItemInt(__pyx_v_ranges, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_1, (&__pyx_v_nlx), __pyx_v__x)); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely((__Pyx_SetItemInt(__pyx_v_ranges, 0, __pyx_t_5, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(26, 199, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "petsc4py/PETSc/petscdmstag.pxi":200
 *     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":201
 *         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)) {
      __pyx_t_1 = NULL;

      /* "petsc4py/PETSc/petscdmstag.pxi":203
 *         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(26, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_4), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_4), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_ownership_range_size;
      __pyx_t_8[1] = __pyx_t_7;
      __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_and_number_or_processors;
      __pyx_t_8[3] = __pyx_t_6;

      /* "petsc4py/PETSc/petscdmstag.pxi":202
 *         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_4 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 26 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
      if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 202, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_4};
        __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 201, __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(26, 201, __pyx_L1_error)

      /* "petsc4py/PETSc/petscdmstag.pxi":201
 *         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_L5:;

    /* "petsc4py/PETSc/petscdmstag.pxi":198
 *         "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":204
 *             "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":205
 *             (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_5 = __Pyx_GetItemInt(__pyx_v_ranges, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_t_5, (&__pyx_v_nly), __pyx_v__y)); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely((__Pyx_SetItemInt(__pyx_v_ranges, 1, __pyx_t_4, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(26, 205, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "petsc4py/PETSc/petscdmstag.pxi":206
 *     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":207
 *         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)) {
      __pyx_t_5 = NULL;

      /* "petsc4py/PETSc/petscdmstag.pxi":209
 *         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_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nly); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 209, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 209, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_n[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 209, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 209, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_ownership_range_size;
      __pyx_t_8[1] = __pyx_t_6;
      __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_and_number_or_processors;
      __pyx_t_8[3] = __pyx_t_7;

      /* "petsc4py/PETSc/petscdmstag.pxi":208
 *         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_PyUnicode_Join(__pyx_t_8, 4, 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 26 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7));
      if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 208, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_1};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 207, __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(26, 207, __pyx_L1_error)

      /* "petsc4py/PETSc/petscdmstag.pxi":207
 *         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_L7:;

    /* "petsc4py/PETSc/petscdmstag.pxi":204
 *             "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":210
 *             "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":211
 *             (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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 211, __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(26, 211, __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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(26, 211, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "petsc4py/PETSc/petscdmstag.pxi":212
 *     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":213
 *         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)) {
      __pyx_t_4 = NULL;

      /* "petsc4py/PETSc/petscdmstag.pxi":215
 *         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_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nlz); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(26, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_p[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(26, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_ownership_range_size;
      __pyx_t_8[1] = __pyx_t_7;
      __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_and_number_or_processors;
      __pyx_t_8[3] = __pyx_t_6;

      /* "petsc4py/PETSc/petscdmstag.pxi":214
 *         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_5 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 26 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
      if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 213, __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(26, 213, __pyx_L1_error)

      /* "petsc4py/PETSc/petscdmstag.pxi":213
 *         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_L9:;

    /* "petsc4py/PETSc/petscdmstag.pxi":210
 *             "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":216
 *             "ownership range size %d and number or processors %d" %
 *             (toInt(nlz), toInt(p[0])))
 *     return tuple(ranges)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_ranges); if (unlikely(!__pyx_t_1)) __PYX_ERR(26, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscdmstag.pxi":185
 *     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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __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":219
 * 
 * 
 * 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", 0);

  /* "petsc4py/PETSc/petscdmstag.pxi":225
 *                                         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(26, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(26, 225, __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) != (0)) __PYX_ERR(26, 225, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_v_ranges = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscdmstag.pxi":226
 *     # 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":227
 *     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(26, 227, __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(26, 227, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscdmstag.pxi":226
 *     # 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":228
 *     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":229
 *         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(26, 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(26, 229, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/petscdmstag.pxi":228
 *     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":230
 *     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(26, 230, __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":219
 * 
 * 
 * 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":232
 *     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", 0);

  /* "petsc4py/PETSc/petscdmstag.pxi":233
 * 
 * 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_mstate_global->__pyx_n_u_none);
    __pyx_r = __pyx_mstate_global->__pyx_n_u_none;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":234
 * 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_mstate_global->__pyx_n_u_periodic);
    __pyx_r = __pyx_mstate_global->__pyx_n_u_periodic;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":235
 *     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_mstate_global->__pyx_n_u_ghosted);
    __pyx_r = __pyx_mstate_global->__pyx_n_u_ghosted;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":232
 *     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":237
 *     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", 0);

  /* "petsc4py/PETSc/petscdmstag.pxi":238
 * 
 * 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(26, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 238, __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) != (0)) __PYX_ERR(26, 238, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_r = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/petscdmstag.pxi":239
 * 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(26, 239, __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(26, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 239, __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) != (0)) __PYX_ERR(26, 239, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(26, 239, __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":240
 *     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(26, 240, __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(26, 240, __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(26, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(26, 240, __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) != (0)) __PYX_ERR(26, 240, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2) != (0)) __PYX_ERR(26, 240, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3) != (0)) __PYX_ERR(26, 240, __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":237
 *     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(<PetscObject*>&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_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,&__pyx_mstate_global->__pyx_n_u_gvec,&__pyx_mstate_global->__pyx_n_u_locs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(27, 27, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(27, 27, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(27, 27, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(27, 27, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(27, 27, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, i); __PYX_ERR(27, 27, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(27, 27, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(27, 27, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(27, 27, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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(27, 27, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(27, 27, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gvec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(27, 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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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(<PetscObject*>&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(<PetscObject*>&self.dm))             # <<<<<<<<<<<<<<
 *         self.gvec = gvec.vec
 *         CHKERR(PetscINCREF(<PetscObject*>&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(27, 29, __pyx_L1_error)

  /* "petsc4py/PETSc/petscdmcomposite.pxi":30
 *         self.dm = dm.dm
 *         CHKERR(PetscINCREF(<PetscObject*>&self.dm))
 *         self.gvec = gvec.vec             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(<PetscObject*>&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(<PetscObject*>&self.dm))
 *         self.gvec = gvec.vec
 *         CHKERR(PetscINCREF(<PetscObject*>&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(27, 31, __pyx_L1_error)

  /* "petsc4py/PETSc/petscdmcomposite.pxi":32
 *         self.gvec = gvec.vec
 *         CHKERR(PetscINCREF(<PetscObject*>&self.gvec))
 *         if locs is None:             # <<<<<<<<<<<<<<
 *             CHKERR(DMCompositeGetNumberDM(self.dm, &self.nlocs))
 *             locs = arange(0, <long>self.nlocs, 1)
*/
  __pyx_t_4 = (__pyx_v_locs == Py_None);
  if (__pyx_t_4) {

    /* "petsc4py/PETSc/petscdmcomposite.pxi":33
 *         CHKERR(PetscINCREF(<PetscObject*>&self.gvec))
 *         if locs is None:
 *             CHKERR(DMCompositeGetNumberDM(self.dm, &self.nlocs))             # <<<<<<<<<<<<<<
 *             locs = arange(0, <long>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(27, 33, __pyx_L1_error)

    /* "petsc4py/PETSc/petscdmcomposite.pxi":34
 *         if locs is None:
 *             CHKERR(DMCompositeGetNumberDM(self.dm, &self.nlocs))
 *             locs = arange(0, <long>self.nlocs, 1)             # <<<<<<<<<<<<<<
 *         self.locs_mem = iarray_i(locs, &self.nlocs, &self.locs)
 *         self.vecs_mem = oarray_p(empty_p(self.nlocs), NULL, <void**>&self.vecs)
*/
    __pyx_t_5 = __Pyx_PyLong_From_long(((long)__pyx_v_self->nlocs)); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 34, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_mstate_global->__pyx_int_0, __pyx_t_5, __pyx_mstate_global->__pyx_int_1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(27, 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(<PetscObject*>&self.gvec))
 *         if locs is None:             # <<<<<<<<<<<<<<
 *             CHKERR(DMCompositeGetNumberDM(self.dm, &self.nlocs))
 *             locs = arange(0, <long>self.nlocs, 1)
*/
  }

  /* "petsc4py/PETSc/petscdmcomposite.pxi":35
 *             CHKERR(DMCompositeGetNumberDM(self.dm, &self.nlocs))
 *             locs = arange(0, <long>self.nlocs, 1)
 *         self.locs_mem = iarray_i(locs, &self.nlocs, &self.locs)             # <<<<<<<<<<<<<<
 *         self.vecs_mem = oarray_p(empty_p(self.nlocs), NULL, <void**>&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(27, 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, <long>self.nlocs, 1)
 *         self.locs_mem = iarray_i(locs, &self.nlocs, &self.locs)
 *         self.vecs_mem = oarray_p(empty_p(self.nlocs), NULL, <void**>&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(27, 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(27, 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, <void**>&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(<PetscObject*>&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(27, 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(27, 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 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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_19_DMComposite_access_5__enter__ = {"__enter__", (PyCFunction)(void(*)(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__};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__enter__", __pyx_kwds); 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;
  long __pyx_8genexpr1__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__", 0);

  /* "petsc4py/PETSc/petscdmcomposite.pxi":44
 * 
 *     def __enter__(self):
 *         cdef Py_ssize_t 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 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(27, 45, __pyx_L1_error)

  /* "petsc4py/PETSc/petscdmcomposite.pxi":46
 *         cdef Py_ssize_t 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(27, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_v_n;
    for (__pyx_8genexpr1__pyx_v_i = 0; __pyx_8genexpr1__pyx_v_i < __pyx_t_4; __pyx_8genexpr1__pyx_v_i++) {
      __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec((__pyx_v_self->vecs[__pyx_8genexpr1__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(27, 46, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(27, 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(27, 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 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: (<Vec>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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_19_DMComposite_access_7__exit__ = {"__exit__", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_7__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_19_DMComposite_access_6__exit__};
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_SIZE
  __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);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__exit__", __pyx_kwds); 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__", 0);

  /* "petsc4py/PETSc/petscdmcomposite.pxi":50
 * 
 *     def __exit__(self, *exc):
 *         cdef Py_ssize_t i, n = self.nlocs             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < n: (<Vec>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: (<Vec>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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_SharedReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(27, 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: (<Vec>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(27, 52, __pyx_L1_error)

  /* "petsc4py/PETSc/petscdmcomposite.pxi":53
 *         for i from 0 <= i < n: (<Vec>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: (<Vec>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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  Vec __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 77, __pyx_L1_error)
  __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_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_global_vector__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 82, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 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(28, 83, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 83, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 83, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 83, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 83, __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(28, 83, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_create_gvec = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_args = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_kargs = __pyx_t_2;
  __pyx_t_2 = 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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_Dm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_Dm)) != (0)) __PYX_ERR(28, 84, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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(28, 84, __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(28, 84, __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(28, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_create_gvec, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(28, 84, __pyx_L1_error)
  __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2);
  __pyx_t_2 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_10 = __pyx_v_vec->vec;
  (__pyx_v_v[0]) = __pyx_t_10;

  /* "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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetDM((__pyx_v_v[0]), (&__pyx_v_odm))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_6 = (__pyx_v_odm == NULL);
  if (__pyx_t_6) {

    /* "petsc4py/PETSc/petscdmshell.pxi":90
 *     CHKERR(VecGetDM(v[0], &odm))
 *     if odm == NULL:
 *         CHKERR(VecSetDM(v[0], dm))             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetDM((__pyx_v_v[0]), __pyx_v_dm)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  Vec __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 96, __pyx_L1_error)
  __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_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_local_vector__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 101, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 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(28, 102, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 102, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 102, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 102, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 102, __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(28, 102, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_create_lvec = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_args = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_kargs = __pyx_t_2;
  __pyx_t_2 = 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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_Dm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_Dm)) != (0)) __PYX_ERR(28, 103, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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(28, 103, __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(28, 103, __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(28, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_create_lvec, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(28, 103, __pyx_L1_error)
  __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_2);
  __pyx_t_2 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_10 = __pyx_v_vec->vec;
  (__pyx_v_v[0]) = __pyx_t_10;

  /* "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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetDM((__pyx_v_v[0]), (&__pyx_v_odm))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_6 = (__pyx_v_odm == NULL);
  if (__pyx_t_6) {

    /* "petsc4py/PETSc/petscdmshell.pxi":109
 *     CHKERR(VecGetDM(v[0], &odm))
 *     if odm == NULL:
 *         CHKERR(VecSetDM(v[0], dm))             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecSetDM((__pyx_v_v[0]), __pyx_v_dm)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 117, __pyx_L1_error)
  __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 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_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 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_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_1 = ((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_1)) __PYX_ERR(28, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 123, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 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(28, 124, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 124, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 124, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 124, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 124, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 124, __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(28, 124, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_begin = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_args = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_kargs = __pyx_t_2;
  __pyx_t_2 = 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_2 = __Pyx_PyLong_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_Dm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_Dm)) != (0)) __PYX_ERR(28, 125, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_gvec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_gvec);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_gvec)) != (0)) __PYX_ERR(28, 125, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(28, 125, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_lvec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_lvec);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_lvec)) != (0)) __PYX_ERR(28, 125, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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(28, 125, __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(28, 125, __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(28, 125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_begin, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 125, __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/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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 133, __pyx_L1_error)
  __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 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_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 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_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_1 = ((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_1)) __PYX_ERR(28, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 139, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 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(28, 140, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 140, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 140, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 140, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 140, __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(28, 140, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_end = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_args = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_kargs = __pyx_t_2;
  __pyx_t_2 = 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_2 = __Pyx_PyLong_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_Dm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_Dm)) != (0)) __PYX_ERR(28, 141, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_gvec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_gvec);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_gvec)) != (0)) __PYX_ERR(28, 141, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(28, 141, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_lvec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_lvec);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_lvec)) != (0)) __PYX_ERR(28, 141, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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(28, 141, __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(28, 141, __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(28, 141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_end, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 141, __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/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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 149, __pyx_L1_error)
  __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 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_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 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_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_1 = ((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_1)) __PYX_ERR(28, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 155, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 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(28, 156, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 156, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 156, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 156, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 156, __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(28, 156, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_begin = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_args = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_kargs = __pyx_t_2;
  __pyx_t_2 = 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_2 = __Pyx_PyLong_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_Dm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_Dm)) != (0)) __PYX_ERR(28, 157, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_gvec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_gvec);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_gvec)) != (0)) __PYX_ERR(28, 157, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(28, 157, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_lvec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_lvec);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_lvec)) != (0)) __PYX_ERR(28, 157, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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(28, 157, __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(28, 157, __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(28, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_begin, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 157, __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/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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 165, __pyx_L1_error)
  __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 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_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 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_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_1 = ((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_1)) __PYX_ERR(28, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 171, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 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(28, 172, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 172, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 172, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 172, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 172, __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(28, 172, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_end = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_args = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_kargs = __pyx_t_2;
  __pyx_t_2 = 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_2 = __Pyx_PyLong_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_Dm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_Dm)) != (0)) __PYX_ERR(28, 173, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_gvec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_gvec);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_gvec)) != (0)) __PYX_ERR(28, 173, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(28, 173, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_lvec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_lvec);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_lvec)) != (0)) __PYX_ERR(28, 173, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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(28, 173, __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(28, 173, __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(28, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_end, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 173, __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/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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 181, __pyx_L1_error)
  __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 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_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 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_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_1 = ((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_1)) __PYX_ERR(28, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 187, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 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(28, 188, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 188, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 188, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 188, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 188, __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(28, 188, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_begin = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_args = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_kargs = __pyx_t_2;
  __pyx_t_2 = 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_2 = __Pyx_PyLong_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_Dm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_Dm)) != (0)) __PYX_ERR(28, 189, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_gvec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_gvec);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_gvec)) != (0)) __PYX_ERR(28, 189, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(28, 189, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_lvec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_lvec);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_lvec)) != (0)) __PYX_ERR(28, 189, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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(28, 189, __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(28, 189, __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(28, 189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_begin, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 189, __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/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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 197, __pyx_L1_error)
  __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 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_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_g)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_gvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 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_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec(__pyx_v_l)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_1 = ((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_1)) __PYX_ERR(28, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 203, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 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(28, 204, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 204, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 204, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 204, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 204, __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(28, 204, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_end = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_args = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_kargs = __pyx_t_2;
  __pyx_t_2 = 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_2 = __Pyx_PyLong_From_InsertMode(__pyx_v_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_Dm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_Dm)) != (0)) __PYX_ERR(28, 205, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_gvec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_gvec);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_gvec)) != (0)) __PYX_ERR(28, 205, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2) != (0)) __PYX_ERR(28, 205, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_lvec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_lvec);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_lvec)) != (0)) __PYX_ERR(28, 205, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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(28, 205, __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(28, 205, __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(28, 205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_end, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 205, __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/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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  Mat __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 211, __pyx_L1_error)
  __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_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_matrix__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 216, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 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(28, 217, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 217, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 217, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 217, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 217, __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(28, 217, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_matrix = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_args = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_kargs = __pyx_t_2;
  __pyx_t_2 = 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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_Dm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_Dm)) != (0)) __PYX_ERR(28, 218, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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(28, 218, __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(28, 218, __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(28, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_matrix, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(28, 218, __pyx_L1_error)
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2);
  __pyx_t_2 = 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_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(28, 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_10 = __pyx_v_mat->mat;
  (__pyx_v_cmat[0]) = __pyx_t_10;

  /* "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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetDM((__pyx_v_cmat[0]), (&__pyx_v_odm))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_6 = (__pyx_v_odm == NULL);
  if (__pyx_t_6) {

    /* "petsc4py/PETSc/petscdmshell.pxi":224
 *     CHKERR(MatGetDM(cmat[0], &odm))
 *     if odm == NULL:
 *         CHKERR(MatSetDM(cmat[0], dm))             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetDM((__pyx_v_cmat[0]), __pyx_v_dm)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  DM __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 231, __pyx_L1_error)
  __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 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_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_new_Comm(__pyx_v_comm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Comm = ((struct PyPetscCommObject *)__pyx_t_1);
  __pyx_t_1 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_1 = ((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_1)) __PYX_ERR(28, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 237, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 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(28, 238, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 238, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 238, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 238, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 238, __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(28, 238, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_coarsen = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_args = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_kargs = __pyx_t_2;
  __pyx_t_2 = 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_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_Dm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_Dm)) != (0)) __PYX_ERR(28, 239, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_Comm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Comm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_Comm)) != (0)) __PYX_ERR(28, 239, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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(28, 239, __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(28, 239, __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(28, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_coarsen, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 239, __pyx_L1_error)
  __pyx_v_Dmc = ((struct PyPetscDMObject *)__pyx_t_2);
  __pyx_t_2 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmc->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_10 = __pyx_v_Dmc->dm;
  (__pyx_v_dmc[0]) = __pyx_t_10;

  /* "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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  DM __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 248, __pyx_L1_error)
  __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 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_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_new_Comm(__pyx_v_comm)); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_Comm = ((struct PyPetscCommObject *)__pyx_t_1);
  __pyx_t_1 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_1 = ((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_1)) __PYX_ERR(28, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 254, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 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(28, 255, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 255, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 255, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 255, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 255, __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(28, 255, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_refine = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_args = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_kargs = __pyx_t_2;
  __pyx_t_2 = 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_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_Dm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_Dm)) != (0)) __PYX_ERR(28, 256, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_Comm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Comm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_Comm)) != (0)) __PYX_ERR(28, 256, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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(28, 256, __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(28, 256, __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(28, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_refine, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 256, __pyx_L1_error)
  __pyx_v_Dmf = ((struct PyPetscDMObject *)__pyx_t_2);
  __pyx_t_2 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmf->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_10 = __pyx_v_Dmf->dm;
  (__pyx_v_dmf[0]) = __pyx_t_10;

  /* "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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  Mat __pyx_t_10;
  Vec __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmc)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 266, __pyx_L1_error)
  __pyx_v_Dmc = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 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_3 = NULL;
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmc->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmf->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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(28, 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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 275, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 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(28, 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_INCREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_3);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 276, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 276, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 276, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 2; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 276, __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(28, 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_3;
  __pyx_t_3 = 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_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_Dmc);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dmc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_Dmc)) != (0)) __PYX_ERR(28, 277, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_Dmf);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dmf);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_Dmf)) != (0)) __PYX_ERR(28, 277, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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(28, 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(28, 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(28, 277, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_interpolation, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 277, __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;
  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(28, 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_INCREF(__pyx_t_2);
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_1);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 277, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 277, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 277, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 277, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 277, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < (0)) __PYX_ERR(28, 277, __pyx_L1_error)
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(28, 277, __pyx_L1_error)
    __pyx_L8_unpacking_done:;
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(28, 277, __pyx_L1_error)
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(28, 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_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(28, 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_10 = __pyx_v_mat->mat;
  (__pyx_v_cmat[0]) = __pyx_t_10;

  /* "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_6 = (__pyx_v_cvec == NULL);
  if (__pyx_t_6) {

    /* "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_6 = (((PyObject *)__pyx_v_vec) == Py_None);
  if (__pyx_t_6) {

    /* "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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 285, __pyx_L1_error)

    /* "petsc4py/PETSc/petscdmshell.pxi":286
 *     else:
 *         CHKERR(PetscINCREF(vec.obj))
 *         cvec[0] = vec.vec             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
    __pyx_t_11 = __pyx_v_vec->vec;
    (__pyx_v_cvec[0]) = __pyx_t_11;
  }
  __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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  Mat __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmc)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 293, __pyx_L1_error)
  __pyx_v_Dmc = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 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_3 = NULL;
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmc->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmf->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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(28, 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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 301, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 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(28, 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_INCREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_3);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 302, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 302, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 302, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 2; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 302, __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(28, 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_3;
  __pyx_t_3 = 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_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_Dmc);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dmc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_Dmc)) != (0)) __PYX_ERR(28, 303, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_Dmf);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dmf);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_Dmf)) != (0)) __PYX_ERR(28, 303, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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(28, 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(28, 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(28, 303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_injection, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 303, __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;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(28, 303, __pyx_L1_error)
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_3);
  __pyx_t_3 = 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_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(28, 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_10 = __pyx_v_mat->mat;
  (__pyx_v_cmat[0]) = __pyx_t_10;

  /* "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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  Mat __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmf)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 312, __pyx_L1_error)
  __pyx_v_Dmf = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 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_3 = NULL;
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dmc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmf->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dmc->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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(28, 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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 320, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 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(28, 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_INCREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_3);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 321, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 321, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 321, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 2; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 321, __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(28, 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_3;
  __pyx_t_3 = 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_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_Dmf);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dmf);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_Dmf)) != (0)) __PYX_ERR(28, 322, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_Dmc);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dmc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_Dmc)) != (0)) __PYX_ERR(28, 322, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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(28, 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(28, 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(28, 322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_restriction, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 322, __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;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(28, 322, __pyx_L1_error)
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_3);
  __pyx_t_3 = 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_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(28, 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_10 = __pyx_v_mat->mat;
  (__pyx_v_cmat[0]) = __pyx_t_10;

  /* "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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 333, __pyx_L1_error)
  __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_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_field_decomp__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 339, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 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(28, 340, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 340, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 340, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 340, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 340, __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(28, 340, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_decomp = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_args = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_kargs = __pyx_t_2;
  __pyx_t_2 = 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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_Dm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_Dm)) != (0)) __PYX_ERR(28, 341, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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(28, 341, __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(28, 341, __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(28, 341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_decomp, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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(28, 341, __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_INCREF(__pyx_t_3);
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_8);
    } else {
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 341, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 341, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 341, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_8);
    }
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(28, 341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
    index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_9(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 2; __pyx_t_8 = __pyx_t_9(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_10), 3) < (0)) __PYX_ERR(28, 341, __pyx_L1_error)
    __pyx_t_9 = 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_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(28, 341, __pyx_L1_error)
    __pyx_L8_unpacking_done:;
  }
  __pyx_v_names = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_ises = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_dms = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "petsc4py/PETSc/petscdmshell.pxi":343
 *     names, ises, dms = decomp(Dm, *args, **kargs)
 * 
 *     if clen != NULL:             # <<<<<<<<<<<<<<
 *         if names is not None:
 *             clen[0] = <PetscInt>len(names)
*/
  __pyx_t_6 = (__pyx_v_clen != NULL);
  if (__pyx_t_6) {

    /* "petsc4py/PETSc/petscdmshell.pxi":344
 * 
 *     if clen != NULL:
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             clen[0] = <PetscInt>len(names)
 *         elif ises is not None:
*/
    __pyx_t_6 = (__pyx_v_names != Py_None);
    if (__pyx_t_6) {

      /* "petsc4py/PETSc/petscdmshell.pxi":345
 *     if clen != NULL:
 *         if names is not None:
 *             clen[0] = <PetscInt>len(names)             # <<<<<<<<<<<<<<
 *         elif ises is not None:
 *             clen[0] = <PetscInt>len(ises)
*/
      __pyx_t_11 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(28, 345, __pyx_L1_error)
      (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_11);

      /* "petsc4py/PETSc/petscdmshell.pxi":344
 * 
 *     if clen != NULL:
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             clen[0] = <PetscInt>len(names)
 *         elif ises is not None:
*/
      goto __pyx_L10;
    }

    /* "petsc4py/PETSc/petscdmshell.pxi":346
 *         if names is not None:
 *             clen[0] = <PetscInt>len(names)
 *         elif ises is not None:             # <<<<<<<<<<<<<<
 *             clen[0] = <PetscInt>len(ises)
 *         elif dms is not None:
*/
    __pyx_t_6 = (__pyx_v_ises != Py_None);
    if (__pyx_t_6) {

      /* "petsc4py/PETSc/petscdmshell.pxi":347
 *             clen[0] = <PetscInt>len(names)
 *         elif ises is not None:
 *             clen[0] = <PetscInt>len(ises)             # <<<<<<<<<<<<<<
 *         elif dms is not None:
 *             clen[0] = <PetscInt>len(dms)
*/
      __pyx_t_11 = PyObject_Length(__pyx_v_ises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(28, 347, __pyx_L1_error)
      (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_11);

      /* "petsc4py/PETSc/petscdmshell.pxi":346
 *         if names is not None:
 *             clen[0] = <PetscInt>len(names)
 *         elif ises is not None:             # <<<<<<<<<<<<<<
 *             clen[0] = <PetscInt>len(ises)
 *         elif dms is not None:
*/
      goto __pyx_L10;
    }

    /* "petsc4py/PETSc/petscdmshell.pxi":348
 *         elif ises is not None:
 *             clen[0] = <PetscInt>len(ises)
 *         elif dms is not None:             # <<<<<<<<<<<<<<
 *             clen[0] = <PetscInt>len(dms)
 *         else:
*/
    __pyx_t_6 = (__pyx_v_dms != Py_None);
    if (__pyx_t_6) {

      /* "petsc4py/PETSc/petscdmshell.pxi":349
 *             clen[0] = <PetscInt>len(ises)
 *         elif dms is not None:
 *             clen[0] = <PetscInt>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(28, 349, __pyx_L1_error)
      (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_11);

      /* "petsc4py/PETSc/petscdmshell.pxi":348
 *         elif ises is not None:
 *             clen[0] = <PetscInt>len(ises)
 *         elif dms is not None:             # <<<<<<<<<<<<<<
 *             clen[0] = <PetscInt>len(dms)
 *         else:
*/
      goto __pyx_L10;
    }

    /* "petsc4py/PETSc/petscdmshell.pxi":351
 *             clen[0] = <PetscInt>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] = <PetscInt>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_7 = (__pyx_v_namelist != NULL);
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_names != Py_None);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L12_bool_binop_done:;
  if (__pyx_t_6) {

    /* "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_11 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(28, 354, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_11 * (sizeof(char **))), __pyx_v_namelist)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_11 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(28, 355, __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":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_2 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 356, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_2, (&__pyx_v_cname)); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 356, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely((__Pyx_SetItemInt(__pyx_v_names, __pyx_v_i, __pyx_t_8, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(28, 356, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscStrallocpy(__pyx_v_cname, (&((__pyx_v_namelist[0])[__pyx_v_i])))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_7 = (__pyx_v_islist != NULL);
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L17_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_ises != Py_None);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L17_bool_binop_done:;
  if (__pyx_t_6) {

    /* "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] = (<IS?>ises[i]).iset
*/
    __pyx_t_11 = PyObject_Length(__pyx_v_ises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(28, 360, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_11 * (sizeof(IS))), __pyx_v_islist)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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] = (<IS?>ises[i]).iset
 *             CHKERR(PetscINCREF((<IS?>ises[i]).obj))
*/
    __pyx_t_11 = PyObject_Length(__pyx_v_ises); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(28, 361, __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":362
 *         CHKERR(PetscMalloc(len(ises)*sizeof(PetscIS), islist))
 *         for i in range(len(ises)):
 *             islist[0][i] = (<IS?>ises[i]).iset             # <<<<<<<<<<<<<<
 *             CHKERR(PetscINCREF((<IS?>ises[i]).obj))
 * 
*/
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_ises, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 362, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(28, 362, __pyx_L1_error)
      __pyx_t_14 = ((struct PyPetscISObject *)__pyx_t_8)->iset;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      ((__pyx_v_islist[0])[__pyx_v_i]) = __pyx_t_14;

      /* "petsc4py/PETSc/petscdmshell.pxi":363
 *         for i in range(len(ises)):
 *             islist[0][i] = (<IS?>ises[i]).iset
 *             CHKERR(PetscINCREF((<IS?>ises[i]).obj))             # <<<<<<<<<<<<<<
 * 
 *     if dmlist != NULL and dms is not None:
*/
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_ises, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 363, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(28, 363, __pyx_L1_error)
      __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscISObject *)__pyx_t_8)->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 363, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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((<IS?>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_7 = (__pyx_v_dmlist != NULL);
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L22_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_dms != Py_None);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L22_bool_binop_done:;
  if (__pyx_t_6) {

    /* "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] = (<DM?>dms[i]).dm
*/
    __pyx_t_11 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(28, 366, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_11 * (sizeof(DM))), __pyx_v_dmlist)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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] = (<DM?>dms[i]).dm
 *             CHKERR(PetscINCREF((<DM?>dms[i]).obj))
*/
    __pyx_t_11 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(28, 367, __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":368
 *         CHKERR(PetscMalloc(len(dms)*sizeof(PetscDM), dmlist))
 *         for i in range(len(dms)):
 *             dmlist[0][i] = (<DM?>dms[i]).dm             # <<<<<<<<<<<<<<
 *             CHKERR(PetscINCREF((<DM?>dms[i]).obj))
 *     return PETSC_SUCCESS
*/
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 368, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(28, 368, __pyx_L1_error)
      __pyx_t_15 = ((struct PyPetscDMObject *)__pyx_t_8)->dm;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      ((__pyx_v_dmlist[0])[__pyx_v_i]) = __pyx_t_15;

      /* "petsc4py/PETSc/petscdmshell.pxi":369
 *         for i in range(len(dms)):
 *             dmlist[0][i] = (<DM?>dms[i]).dm
 *             CHKERR(PetscINCREF((<DM?>dms[i]).obj))             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
      __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 369, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (!(likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(28, 369, __pyx_L1_error)
      __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscDMObject *)__pyx_t_8)->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 369, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }

    /* "petsc4py/PETSc/petscdmshell.pxi":365
 *             CHKERR(PetscINCREF((<IS?>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] = (<DM?>dms[i]).dm
 *             CHKERR(PetscINCREF((<DM?>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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  IS __pyx_t_15;
  DM __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 379, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 379, __pyx_L1_error)
  __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_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__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 385, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 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(28, 386, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 386, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 386, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 386, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 386, __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(28, 386, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_decomp = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_args = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_kargs = __pyx_t_2;
  __pyx_t_2 = 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_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_Dm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_Dm)) != (0)) __PYX_ERR(28, 387, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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(28, 387, __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(28, 387, __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(28, 387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_decomp, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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(28, 387, __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_INCREF(__pyx_t_3);
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 3);
      __Pyx_INCREF(__pyx_t_10);
    } else {
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 387, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 387, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 387, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_8);
      __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_10)) __PYX_ERR(28, 387, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_10);
    }
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_1,&__pyx_t_8,&__pyx_t_10};
      for (i=0; i < 4; i++) {
        PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(28, 387, __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_3,&__pyx_t_1,&__pyx_t_8,&__pyx_t_10};
    __pyx_t_11 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(28, 387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_11);
    for (index=0; index < 4; index++) {
      PyObject* item = __pyx_t_9(__pyx_t_11); if (unlikely(!item)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_11), 4) < (0)) __PYX_ERR(28, 387, __pyx_L1_error)
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(28, 387, __pyx_L1_error)
    __pyx_L8_unpacking_done:;
  }
  __pyx_v_names = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_innerises = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_outerises = __pyx_t_8;
  __pyx_t_8 = 0;
  __pyx_v_dms = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "petsc4py/PETSc/petscdmshell.pxi":389
 *     names, innerises, outerises, dms = decomp(Dm, *args, **kargs)
 * 
 *     if clen != NULL:             # <<<<<<<<<<<<<<
 *         if names is not None:
 *             clen[0] = <PetscInt>len(names)
*/
  __pyx_t_6 = (__pyx_v_clen != NULL);
  if (__pyx_t_6) {

    /* "petsc4py/PETSc/petscdmshell.pxi":390
 * 
 *     if clen != NULL:
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             clen[0] = <PetscInt>len(names)
 *         elif innerises is not None:
*/
    __pyx_t_6 = (__pyx_v_names != Py_None);
    if (__pyx_t_6) {

      /* "petsc4py/PETSc/petscdmshell.pxi":391
 *     if clen != NULL:
 *         if names is not None:
 *             clen[0] = <PetscInt>len(names)             # <<<<<<<<<<<<<<
 *         elif innerises is not None:
 *             clen[0] = <PetscInt>len(innerises)
*/
      __pyx_t_12 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(28, 391, __pyx_L1_error)
      (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_12);

      /* "petsc4py/PETSc/petscdmshell.pxi":390
 * 
 *     if clen != NULL:
 *         if names is not None:             # <<<<<<<<<<<<<<
 *             clen[0] = <PetscInt>len(names)
 *         elif innerises is not None:
*/
      goto __pyx_L10;
    }

    /* "petsc4py/PETSc/petscdmshell.pxi":392
 *         if names is not None:
 *             clen[0] = <PetscInt>len(names)
 *         elif innerises is not None:             # <<<<<<<<<<<<<<
 *             clen[0] = <PetscInt>len(innerises)
 *         elif outerises is not None:
*/
    __pyx_t_6 = (__pyx_v_innerises != Py_None);
    if (__pyx_t_6) {

      /* "petsc4py/PETSc/petscdmshell.pxi":393
 *             clen[0] = <PetscInt>len(names)
 *         elif innerises is not None:
 *             clen[0] = <PetscInt>len(innerises)             # <<<<<<<<<<<<<<
 *         elif outerises is not None:
 *             clen[0] = <PetscInt>len(outerises)
*/
      __pyx_t_12 = PyObject_Length(__pyx_v_innerises); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(28, 393, __pyx_L1_error)
      (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_12);

      /* "petsc4py/PETSc/petscdmshell.pxi":392
 *         if names is not None:
 *             clen[0] = <PetscInt>len(names)
 *         elif innerises is not None:             # <<<<<<<<<<<<<<
 *             clen[0] = <PetscInt>len(innerises)
 *         elif outerises is not None:
*/
      goto __pyx_L10;
    }

    /* "petsc4py/PETSc/petscdmshell.pxi":394
 *         elif innerises is not None:
 *             clen[0] = <PetscInt>len(innerises)
 *         elif outerises is not None:             # <<<<<<<<<<<<<<
 *             clen[0] = <PetscInt>len(outerises)
 *         elif dms is not None:
*/
    __pyx_t_6 = (__pyx_v_outerises != Py_None);
    if (__pyx_t_6) {

      /* "petsc4py/PETSc/petscdmshell.pxi":395
 *             clen[0] = <PetscInt>len(innerises)
 *         elif outerises is not None:
 *             clen[0] = <PetscInt>len(outerises)             # <<<<<<<<<<<<<<
 *         elif dms is not None:
 *             clen[0] = <PetscInt>len(dms)
*/
      __pyx_t_12 = PyObject_Length(__pyx_v_outerises); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(28, 395, __pyx_L1_error)
      (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_12);

      /* "petsc4py/PETSc/petscdmshell.pxi":394
 *         elif innerises is not None:
 *             clen[0] = <PetscInt>len(innerises)
 *         elif outerises is not None:             # <<<<<<<<<<<<<<
 *             clen[0] = <PetscInt>len(outerises)
 *         elif dms is not None:
*/
      goto __pyx_L10;
    }

    /* "petsc4py/PETSc/petscdmshell.pxi":396
 *         elif outerises is not None:
 *             clen[0] = <PetscInt>len(outerises)
 *         elif dms is not None:             # <<<<<<<<<<<<<<
 *             clen[0] = <PetscInt>len(dms)
 *         else:
*/
    __pyx_t_6 = (__pyx_v_dms != Py_None);
    if (__pyx_t_6) {

      /* "petsc4py/PETSc/petscdmshell.pxi":397
 *             clen[0] = <PetscInt>len(outerises)
 *         elif dms is not None:
 *             clen[0] = <PetscInt>len(dms)             # <<<<<<<<<<<<<<
 *         else:
 *             clen[0] = 0
*/
      __pyx_t_12 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(28, 397, __pyx_L1_error)
      (__pyx_v_clen[0]) = ((PetscInt)__pyx_t_12);

      /* "petsc4py/PETSc/petscdmshell.pxi":396
 *         elif outerises is not None:
 *             clen[0] = <PetscInt>len(outerises)
 *         elif dms is not None:             # <<<<<<<<<<<<<<
 *             clen[0] = <PetscInt>len(dms)
 *         else:
*/
      goto __pyx_L10;
    }

    /* "petsc4py/PETSc/petscdmshell.pxi":399
 *             clen[0] = <PetscInt>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] = <PetscInt>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_7 = (__pyx_v_namelist != NULL);
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_names != Py_None);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L12_bool_binop_done:;
  if (__pyx_t_6) {

    /* "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_12 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(28, 402, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_12 * (sizeof(char **))), __pyx_v_namelist)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_12 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(28, 403, __pyx_L1_error)
    __pyx_t_13 = __pyx_t_12;
    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":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_2 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 404, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_2, (&__pyx_v_cname)); if (unlikely(!__pyx_t_10)) __PYX_ERR(28, 404, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely((__Pyx_SetItemInt(__pyx_v_names, __pyx_v_i, __pyx_t_10, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(28, 404, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscStrallocpy(__pyx_v_cname, (&((__pyx_v_namelist[0])[__pyx_v_i])))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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_7 = (__pyx_v_innerislist != NULL);
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L17_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_innerises != Py_None);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L17_bool_binop_done:;
  if (__pyx_t_6) {

    /* "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] = (<IS?>innerises[i]).iset
*/
    __pyx_t_12 = PyObject_Length(__pyx_v_innerises); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(28, 408, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_12 * (sizeof(IS))), __pyx_v_innerislist)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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] = (<IS?>innerises[i]).iset
 *             CHKERR(PetscINCREF((<IS?>innerises[i]).obj))
*/
    __pyx_t_12 = PyObject_Length(__pyx_v_innerises); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(28, 409, __pyx_L1_error)
    __pyx_t_13 = __pyx_t_12;
    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":410
 *         CHKERR(PetscMalloc(len(innerises)*sizeof(PetscIS), innerislist))
 *         for i in range(len(innerises)):
 *             innerislist[0][i] = (<IS?>innerises[i]).iset             # <<<<<<<<<<<<<<
 *             CHKERR(PetscINCREF((<IS?>innerises[i]).obj))
 * 
*/
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_innerises, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(28, 410, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (!(likely(__Pyx_TypeTest(__pyx_t_10, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(28, 410, __pyx_L1_error)
      __pyx_t_15 = ((struct PyPetscISObject *)__pyx_t_10)->iset;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      ((__pyx_v_innerislist[0])[__pyx_v_i]) = __pyx_t_15;

      /* "petsc4py/PETSc/petscdmshell.pxi":411
 *         for i in range(len(innerises)):
 *             innerislist[0][i] = (<IS?>innerises[i]).iset
 *             CHKERR(PetscINCREF((<IS?>innerises[i]).obj))             # <<<<<<<<<<<<<<
 * 
 *     if outerislist != NULL and outerises is not None:
*/
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_innerises, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(28, 411, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (!(likely(__Pyx_TypeTest(__pyx_t_10, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(28, 411, __pyx_L1_error)
      __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscISObject *)__pyx_t_10)->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 411, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 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((<IS?>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_7 = (__pyx_v_outerislist != NULL);
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L22_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_outerises != Py_None);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L22_bool_binop_done:;
  if (__pyx_t_6) {

    /* "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] = (<IS?>outerises[i]).iset
*/
    __pyx_t_12 = PyObject_Length(__pyx_v_outerises); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(28, 414, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_12 * (sizeof(IS))), __pyx_v_outerislist)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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] = (<IS?>outerises[i]).iset
 *             CHKERR(PetscINCREF((<IS?>outerises[i]).obj))
*/
    __pyx_t_12 = PyObject_Length(__pyx_v_outerises); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(28, 415, __pyx_L1_error)
    __pyx_t_13 = __pyx_t_12;
    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":416
 *         CHKERR(PetscMalloc(len(outerises)*sizeof(PetscIS), outerislist))
 *         for i in range(len(outerises)):
 *             outerislist[0][i] = (<IS?>outerises[i]).iset             # <<<<<<<<<<<<<<
 *             CHKERR(PetscINCREF((<IS?>outerises[i]).obj))
 * 
*/
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_outerises, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(28, 416, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (!(likely(__Pyx_TypeTest(__pyx_t_10, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(28, 416, __pyx_L1_error)
      __pyx_t_15 = ((struct PyPetscISObject *)__pyx_t_10)->iset;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      ((__pyx_v_outerislist[0])[__pyx_v_i]) = __pyx_t_15;

      /* "petsc4py/PETSc/petscdmshell.pxi":417
 *         for i in range(len(outerises)):
 *             outerislist[0][i] = (<IS?>outerises[i]).iset
 *             CHKERR(PetscINCREF((<IS?>outerises[i]).obj))             # <<<<<<<<<<<<<<
 * 
 *     if dmlist != NULL and dms is not None:
*/
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_outerises, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(28, 417, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (!(likely(__Pyx_TypeTest(__pyx_t_10, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(28, 417, __pyx_L1_error)
      __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscISObject *)__pyx_t_10)->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 417, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }

    /* "petsc4py/PETSc/petscdmshell.pxi":413
 *             CHKERR(PetscINCREF((<IS?>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((<IS?>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_7 = (__pyx_v_dmlist != NULL);
  if (__pyx_t_7) {
  } else {
    __pyx_t_6 = __pyx_t_7;
    goto __pyx_L27_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_dms != Py_None);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L27_bool_binop_done:;
  if (__pyx_t_6) {

    /* "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] = (<DM?>dms[i]).dm
*/
    __pyx_t_12 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(28, 420, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_t_12 * (sizeof(DM))), __pyx_v_dmlist)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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] = (<DM?>dms[i]).dm
 *             CHKERR(PetscINCREF((<DM?>dms[i]).obj))
*/
    __pyx_t_12 = PyObject_Length(__pyx_v_dms); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(28, 421, __pyx_L1_error)
    __pyx_t_13 = __pyx_t_12;
    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":422
 *         CHKERR(PetscMalloc(len(dms)*sizeof(PetscDM), dmlist))
 *         for i in range(len(dms)):
 *             dmlist[0][i] = (<DM?>dms[i]).dm             # <<<<<<<<<<<<<<
 *             CHKERR(PetscINCREF((<DM?>dms[i]).obj))
 *     return PETSC_SUCCESS
*/
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(28, 422, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (!(likely(__Pyx_TypeTest(__pyx_t_10, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(28, 422, __pyx_L1_error)
      __pyx_t_16 = ((struct PyPetscDMObject *)__pyx_t_10)->dm;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      ((__pyx_v_dmlist[0])[__pyx_v_i]) = __pyx_t_16;

      /* "petsc4py/PETSc/petscdmshell.pxi":423
 *         for i in range(len(dms)):
 *             dmlist[0][i] = (<DM?>dms[i]).dm
 *             CHKERR(PetscINCREF((<DM?>dms[i]).obj))             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_10)) __PYX_ERR(28, 423, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (!(likely(__Pyx_TypeTest(__pyx_t_10, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(28, 423, __pyx_L1_error)
      __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscDMObject *)__pyx_t_10)->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 423, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }

    /* "petsc4py/PETSc/petscdmshell.pxi":419
 *             CHKERR(PetscINCREF((<IS?>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] = (<DM?>dms[i]).dm
 *             CHKERR(PetscINCREF((<DM?>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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  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;
  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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  PetscInt __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  PetscInt __pyx_t_14;
  int __pyx_t_15;
  VecScatter __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __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 DM subdm = None
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_dm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 434, __pyx_L1_error)
  __pyx_v_Dm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscdmshell.pxi":436
 *     cdef DM Dm = subtype_DM(dm)()
 *     cdef int i
 *     cdef DM subdm = None             # <<<<<<<<<<<<<<
 * 
 *     Dm.dm = dm
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_subdm = ((struct PyPetscDMObject *)Py_None);

  /* "petsc4py/PETSc/petscdmshell.pxi":438
 *     cdef DM subdm = None
 * 
 *     Dm.dm = dm             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(Dm.obj))
 * 
*/
  __pyx_v_Dm->dm = __pyx_v_dm;

  /* "petsc4py/PETSc/petscdmshell.pxi":439
 * 
 *     Dm.dm = dm
 *     CHKERR(PetscINCREF(Dm.obj))             # <<<<<<<<<<<<<<
 * 
 *     psubdms = []
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Dm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 439, __pyx_L1_error)

  /* "petsc4py/PETSc/petscdmshell.pxi":441
 *     CHKERR(PetscINCREF(Dm.obj))
 * 
 *     psubdms = []             # <<<<<<<<<<<<<<
 *     for i from 0 <= i < clen:
 *         subdm = subtype_DM(subdms[i])()
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_psubdms = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscdmshell.pxi":442
 * 
 *     psubdms = []
 *     for i from 0 <= i < clen:             # <<<<<<<<<<<<<<
 *         subdm = subtype_DM(subdms[i])()
 *         subdm.dm = subdms[i]
*/
  __pyx_t_6 = __pyx_v_clen;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {

    /* "petsc4py/PETSc/petscdmshell.pxi":443
 *     psubdms = []
 *     for i from 0 <= i < clen:
 *         subdm = subtype_DM(subdms[i])()             # <<<<<<<<<<<<<<
 *         subdm.dm = subdms[i]
 *         CHKERR(PetscINCREF(subdm.obj))
*/
    __pyx_t_3 = NULL;
    __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM((__pyx_v_subdms[__pyx_v_i]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 443, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_subdm, ((struct PyPetscDMObject *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "petsc4py/PETSc/petscdmshell.pxi":444
 *     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":445
 *         subdm = subtype_DM(subdms[i])()
 *         subdm.dm = subdms[i]
 *         CHKERR(PetscINCREF(subdm.obj))             # <<<<<<<<<<<<<<
 *         psubdms.append(subdm)
 * 
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_subdm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 445, __pyx_L1_error)

    /* "petsc4py/PETSc/petscdmshell.pxi":446
 *         subdm.dm = subdms[i]
 *         CHKERR(PetscINCREF(subdm.obj))
 *         psubdms.append(subdm)             # <<<<<<<<<<<<<<
 * 
 *     context = Dm.get_attr('__create_domain_decomp_scatters__')
*/
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_psubdms, ((PyObject *)__pyx_v_subdm)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(28, 446, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/petscdmshell.pxi":448
 *         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(28, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscdmshell.pxi":449
 * 
 *     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_9 = (__pyx_v_context != Py_None);
    if (__pyx_t_9) {
    } else {
      __pyx_t_8 = __pyx_t_9;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_9 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_8 = __pyx_t_9;
    __pyx_L5_bool_binop_done:;
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 449, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 449, __pyx_L1_error)
  #endif

  /* "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)
 * 
*/
  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(28, 450, __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_INCREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_3);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 450, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 450, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 450, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_10 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_10)) __PYX_ERR(28, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
    index = 0; __pyx_t_1 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 2; __pyx_t_3 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < (0)) __PYX_ERR(28, 450, __pyx_L1_error)
    __pyx_t_11 = 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_11 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(28, 450, __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_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/petscdmshell.pxi":451
 *     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_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_Dm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Dm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_Dm)) != (0)) __PYX_ERR(28, 451, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_psubdms);
  __Pyx_GIVEREF(__pyx_v_psubdms);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_psubdms) != (0)) __PYX_ERR(28, 451, __pyx_L1_error);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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(28, 451, __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(28, 451, __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(28, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_scatters, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 451, __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;
  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(28, 451, __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_INCREF(__pyx_t_2);
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_10);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 451, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 451, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_10)) __PYX_ERR(28, 451, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_10);
    }
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) __PYX_ERR(28, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(28, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_12);
    index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_12); if (unlikely(!__pyx_t_2)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_1 = __pyx_t_11(__pyx_t_12); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 2; __pyx_t_10 = __pyx_t_11(__pyx_t_12); if (unlikely(!__pyx_t_10)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_10);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_12), 3) < (0)) __PYX_ERR(28, 451, __pyx_L1_error)
    __pyx_t_11 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L10_unpacking_done;
    __pyx_L9_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_11 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(28, 451, __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_10;
  __pyx_t_10 = 0;

  /* "petsc4py/PETSc/petscdmshell.pxi":453
 *     (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_13 = PyObject_Length(__pyx_v_iscatter); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(28, 453, __pyx_L1_error)
    __pyx_t_8 = (__pyx_t_13 == __pyx_v_clen);
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 453, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 453, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscdmshell.pxi":454
 * 
 *     assert len(iscatter) == clen
 *     assert len(oscatter) == clen             # <<<<<<<<<<<<<<
 *     assert len(gscatter) == clen
 * 
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_13 = PyObject_Length(__pyx_v_oscatter); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(28, 454, __pyx_L1_error)
    __pyx_t_8 = (__pyx_t_13 == __pyx_v_clen);
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 454, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 454, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscdmshell.pxi":455
 *     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_13 = PyObject_Length(__pyx_v_gscatter); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(28, 455, __pyx_L1_error)
    __pyx_t_8 = (__pyx_t_13 == __pyx_v_clen);
    if (unlikely(!__pyx_t_8)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 455, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 455, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscdmshell.pxi":457
 *     assert len(gscatter) == clen
 * 
 *     CHKERR (PetscMalloc(clen*sizeof(PetscScatter), iscat))             # <<<<<<<<<<<<<<
 *     CHKERR (PetscMalloc(clen*sizeof(PetscScatter), oscat))
 *     CHKERR (PetscMalloc(clen*sizeof(PetscScatter), gscat))
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_v_clen * (sizeof(VecScatter))), __pyx_v_iscat)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 457, __pyx_L1_error)

  /* "petsc4py/PETSc/petscdmshell.pxi":458
 * 
 *     CHKERR (PetscMalloc(clen*sizeof(PetscScatter), iscat))
 *     CHKERR (PetscMalloc(clen*sizeof(PetscScatter), oscat))             # <<<<<<<<<<<<<<
 *     CHKERR (PetscMalloc(clen*sizeof(PetscScatter), gscat))
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_v_clen * (sizeof(VecScatter))), __pyx_v_oscat)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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))             # <<<<<<<<<<<<<<
 * 
 *     for i in range(clen):
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((__pyx_v_clen * (sizeof(VecScatter))), __pyx_v_gscat)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 459, __pyx_L1_error)

  /* "petsc4py/PETSc/petscdmshell.pxi":461
 *     CHKERR (PetscMalloc(clen*sizeof(PetscScatter), gscat))
 * 
 *     for i in range(clen):             # <<<<<<<<<<<<<<
 *         iscat[0][i] = (<Scatter?>iscatter[i]).sct
 *         CHKERR(PetscINCREF((<Scatter?>iscatter[i]).obj))
*/
  __pyx_t_6 = __pyx_v_clen;
  __pyx_t_14 = __pyx_t_6;
  for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
    __pyx_v_i = __pyx_t_15;

    /* "petsc4py/PETSc/petscdmshell.pxi":462
 * 
 *     for i in range(clen):
 *         iscat[0][i] = (<Scatter?>iscatter[i]).sct             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF((<Scatter?>iscatter[i]).obj))
 * 
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_iscatter, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(28, 462, __pyx_L1_error)
    __pyx_t_16 = ((struct PyPetscScatterObject *)__pyx_t_3)->sct;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((__pyx_v_iscat[0])[__pyx_v_i]) = __pyx_t_16;

    /* "petsc4py/PETSc/petscdmshell.pxi":463
 *     for i in range(clen):
 *         iscat[0][i] = (<Scatter?>iscatter[i]).sct
 *         CHKERR(PetscINCREF((<Scatter?>iscatter[i]).obj))             # <<<<<<<<<<<<<<
 * 
 *         oscat[0][i] = (<Scatter?>oscatter[i]).sct
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_iscatter, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(28, 463, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscScatterObject *)__pyx_t_3)->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 463, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/petscdmshell.pxi":465
 *         CHKERR(PetscINCREF((<Scatter?>iscatter[i]).obj))
 * 
 *         oscat[0][i] = (<Scatter?>oscatter[i]).sct             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF((<Scatter?>oscatter[i]).obj))
 * 
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_oscatter, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(28, 465, __pyx_L1_error)
    __pyx_t_16 = ((struct PyPetscScatterObject *)__pyx_t_3)->sct;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((__pyx_v_oscat[0])[__pyx_v_i]) = __pyx_t_16;

    /* "petsc4py/PETSc/petscdmshell.pxi":466
 * 
 *         oscat[0][i] = (<Scatter?>oscatter[i]).sct
 *         CHKERR(PetscINCREF((<Scatter?>oscatter[i]).obj))             # <<<<<<<<<<<<<<
 * 
 *         gscat[0][i] = (<Scatter?>gscatter[i]).sct
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_oscatter, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(28, 466, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscScatterObject *)__pyx_t_3)->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 466, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/petscdmshell.pxi":468
 *         CHKERR(PetscINCREF((<Scatter?>oscatter[i]).obj))
 * 
 *         gscat[0][i] = (<Scatter?>gscatter[i]).sct             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF((<Scatter?>gscatter[i]).obj))
 * 
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_gscatter, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(28, 468, __pyx_L1_error)
    __pyx_t_16 = ((struct PyPetscScatterObject *)__pyx_t_3)->sct;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((__pyx_v_gscat[0])[__pyx_v_i]) = __pyx_t_16;

    /* "petsc4py/PETSc/petscdmshell.pxi":469
 * 
 *         gscat[0][i] = (<Scatter?>gscatter[i]).sct
 *         CHKERR(PetscINCREF((<Scatter?>gscatter[i]).obj))             # <<<<<<<<<<<<<<
 * 
 *     return PETSC_SUCCESS
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_gscatter, __pyx_v_i, int, 1, __Pyx_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(28, 469, __pyx_L1_error)
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(((struct PyPetscScatterObject *)__pyx_t_3)->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 469, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "petsc4py/PETSc/petscdmshell.pxi":471
 *         CHKERR(PetscINCREF((<Scatter?>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_3);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscdmshell.pxi":473
 *     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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  IS __pyx_t_10;
  DM __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("DMSHELL_CreateSubDM", 0);

  /* "petsc4py/PETSc/petscdmshell.pxi":479
 *     PetscIS *ciset,
 *     PetscDM *csubdm) except PETSC_ERR_PYTHON with gil:
 *     cdef DM dm = subtype_DM(cdm)()             # <<<<<<<<<<<<<<
 *     cdef IS iset
 *     cdef DM subdm
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_cdm)); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 479, __pyx_L1_error)
  __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscdmshell.pxi":482
 *     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":483
 *     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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 483, __pyx_L1_error)

  /* "petsc4py/PETSc/petscdmshell.pxi":484
 *     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_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_subdm__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscdmshell.pxi":485
 *     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_7 = (__pyx_v_context != Py_None);
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_6)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(28, 485, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(28, 485, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/petscdmshell.pxi":486
 *     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(28, 486, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 486, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 486, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 486, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_8 = PyObject_GetIter(__pyx_v_context); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < (0)) __PYX_ERR(28, 486, __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(28, 486, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }
  __pyx_v_create_subdm = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_args = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_kargs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscdmshell.pxi":488
 *     (create_subdm, args, kargs) = context
 * 
 *     fields = array_i(numFields, cfields)             # <<<<<<<<<<<<<<
 * 
 *     iset, subdm = create_subdm(dm, fields, *args, **kargs)
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_numFields, __pyx_v_cfields)); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_fields = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/petscdmshell.pxi":490
 *     fields = array_i(numFields, cfields)
 * 
 *     iset, subdm = create_subdm(dm, fields, *args, **kargs)             # <<<<<<<<<<<<<<
 * 
 *     CHKERR(PetscINCREF(iset.obj))
*/
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF((PyObject *)__pyx_v_dm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_dm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_dm)) != (0)) __PYX_ERR(28, 490, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_fields);
  __Pyx_GIVEREF((PyObject *)__pyx_v_fields);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_fields)) != (0)) __PYX_ERR(28, 490, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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(28, 490, __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(28, 490, __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(28, 490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_create_subdm, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(28, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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(28, 490, __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_INCREF(__pyx_t_3);
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_1);
    } else {
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 490, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 490, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
    }
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(28, 490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(28, 490, __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_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(28, 490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
    index = 0; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < (0)) __PYX_ERR(28, 490, __pyx_L1_error)
    __pyx_t_9 = NULL;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L8_unpacking_done;
    __pyx_L7_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(28, 490, __pyx_L1_error)
    __pyx_L8_unpacking_done:;
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS))))) __PYX_ERR(28, 490, __pyx_L1_error)
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(28, 490, __pyx_L1_error)
  __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_v_subdm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/petscdmshell.pxi":492
 *     iset, subdm = create_subdm(dm, fields, *args, **kargs)
 * 
 *     CHKERR(PetscINCREF(iset.obj))             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(subdm.obj))
 *     ciset[0] = iset.iset
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_iset->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 492, __pyx_L1_error)

  /* "petsc4py/PETSc/petscdmshell.pxi":493
 * 
 *     CHKERR(PetscINCREF(iset.obj))
 *     CHKERR(PetscINCREF(subdm.obj))             # <<<<<<<<<<<<<<
 *     ciset[0] = iset.iset
 *     csubdm[0] = subdm.dm
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_subdm->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(28, 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
 *     return PETSC_SUCCESS
*/
  __pyx_t_10 = __pyx_v_iset->iset;
  (__pyx_v_ciset[0]) = __pyx_t_10;

  /* "petsc4py/PETSc/petscdmshell.pxi":495
 *     CHKERR(PetscINCREF(subdm.obj))
 *     ciset[0] = iset.iset
 *     csubdm[0] = subdm.dm             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
*/
  __pyx_t_11 = __pyx_v_subdm->dm;
  (__pyx_v_csubdm[0]) = __pyx_t_11;

  /* "petsc4py/PETSc/petscdmshell.pxi":496
 *     ciset[0] = iset.iset
 *     csubdm[0] = subdm.dm
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/petscdmshell.pxi":473
 *     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_3);
  __Pyx_XDECREF(__pyx_t_8);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/petscpyappctx.pxi":3
 * cdef set appctx_registry = set()
 * 
 * cdef inline object registerAppCtx(void *appctx):             # <<<<<<<<<<<<<<
 *     cdef object key = <Py_uintptr_t> 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", 0);

  /* "petsc4py/PETSc/petscpyappctx.pxi":4
 * 
 * cdef inline object registerAppCtx(void *appctx):
 *     cdef object key = <Py_uintptr_t> appctx             # <<<<<<<<<<<<<<
 *     appctx_registry.add(key)
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_FromSize_t(((Py_uintptr_t)__pyx_v_appctx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 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 = <Py_uintptr_t> 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(29, 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(29, 5, __pyx_L1_error)

  /* "petsc4py/PETSc/petscpyappctx.pxi":3
 * cdef set appctx_registry = set()
 * 
 * cdef inline object registerAppCtx(void *appctx):             # <<<<<<<<<<<<<<
 *     cdef object key = <Py_uintptr_t> 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 = <Py_uintptr_t> 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", 0);

  /* "petsc4py/PETSc/petscpyappctx.pxi":8
 * 
 * cdef inline object toAppCtx(void *appctx):
 *     cdef object key = <Py_uintptr_t> appctx             # <<<<<<<<<<<<<<
 *     if key in appctx_registry:
 *         return <object> appctx
*/
  __pyx_t_1 = __Pyx_PyLong_FromSize_t(((Py_uintptr_t)__pyx_v_appctx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(29, 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 = <Py_uintptr_t> appctx
 *     if key in appctx_registry:             # <<<<<<<<<<<<<<
 *         return <object> appctx
 *     else:
*/
  if (unlikely(__pyx_v_8petsc4py_5PETSc_appctx_registry == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(29, 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(29, 9, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/petscpyappctx.pxi":10
 *     cdef object key = <Py_uintptr_t> appctx
 *     if key in appctx_registry:
 *         return <object> 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 = <Py_uintptr_t> appctx
 *     if key in appctx_registry:             # <<<<<<<<<<<<<<
 *         return <object> appctx
 *     else:
*/
  }

  /* "petsc4py/PETSc/petscpyappctx.pxi":12
 *         return <object> 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(29, 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 <object> 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 = <Py_uintptr_t> 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":13
 *     """
 * 
 *     def __init__(self, int ierr=0):             # <<<<<<<<<<<<<<
 *         self.ierr = ierr
 *         self._traceback = []
*/

/* 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:13");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Error_1__init__ = {"__init__", (PyCFunction)(void(*)(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_ierr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(30, 13, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(30, 13, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(30, 13, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(30, 13, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(30, 13, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(30, 13, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(30, 13, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    if (values[1]) {
      __pyx_v_ierr = __Pyx_PyLong_As_int(values[1]); if (unlikely((__pyx_v_ierr == (int)-1) && PyErr_Occurred())) __PYX_ERR(30, 13, __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(30, 13, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "petsc4py/PETSc/Error.pyx":14
 * 
 *     def __init__(self, int ierr=0):
 *         self.ierr = ierr             # <<<<<<<<<<<<<<
 *         self._traceback = []
 *         RuntimeError.__init__(self, self.ierr)
*/
  __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_ierr); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_ierr, __pyx_t_1) < (0)) __PYX_ERR(30, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Error.pyx":15
 *     def __init__(self, int ierr=0):
 *         self.ierr = ierr
 *         self._traceback = []             # <<<<<<<<<<<<<<
 *         RuntimeError.__init__(self, self.ierr)
 * 
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_traceback, __pyx_t_1) < (0)) __PYX_ERR(30, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Error.pyx":16
 *         self.ierr = ierr
 *         self._traceback = []
 *         RuntimeError.__init__(self, self.ierr)             # <<<<<<<<<<<<<<
 * 
 *     def __bool__(self):
*/
  __pyx_t_2 = ((PyObject *)(((PyTypeObject*)PyExc_RuntimeError)));
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_ierr); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 16, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Error.pyx":13
 *     """
 * 
 *     def __init__(self, int ierr=0):             # <<<<<<<<<<<<<<
 *         self.ierr = ierr
 *         self._traceback = []
*/

  /* 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.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":18
 *         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:18");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Error_3__bool__ = {"__bool__", (PyCFunction)(void(*)(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(30, 18, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(30, 18, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__bool__", 0) < (0)) __PYX_ERR(30, 18, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__bool__", 1, 1, 1, i); __PYX_ERR(30, 18, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(30, 18, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__bool__", 1, 1, 1, __pyx_nargs); __PYX_ERR(30, 18, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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__", 0);

  /* "petsc4py/PETSc/Error.pyx":19
 * 
 *     def __bool__(self):
 *         cdef int ierr = self.ierr             # <<<<<<<<<<<<<<
 *         return ierr != 0
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_ierr); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(30, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ierr = __pyx_t_2;

  /* "petsc4py/PETSc/Error.pyx":20
 *     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(30, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Error.pyx":18
 *         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":22
 *         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:22");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Error_5__repr__ = {"__repr__", (PyCFunction)(void(*)(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(30, 22, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(30, 22, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__repr__", 0) < (0)) __PYX_ERR(30, 22, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, i); __PYX_ERR(30, 22, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(30, 22, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(30, 22, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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__", 0);

  /* "petsc4py/PETSc/Error.pyx":23
 * 
 *     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_mstate_global->__pyx_n_u_ierr); if (unlikely(!__pyx_t_1)) __PYX_ERR(30, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_PETSc_Error_d, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 23, __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":22
 *         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":25
 *         return 'PETSc.Error(%d)' % self.ierr
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         cdef int csize=1, crank=0
 *         if not (<int>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:25");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Error_7__str__ = {"__str__", (PyCFunction)(void(*)(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(30, 25, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(30, 25, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__str__", 0) < (0)) __PYX_ERR(30, 25, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, i); __PYX_ERR(30, 25, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(30, 25, __pyx_L3_error)
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(30, 25, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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__", 0);

  /* "petsc4py/PETSc/Error.pyx":26
 * 
 *     def __str__(self):
 *         cdef int csize=1, crank=0             # <<<<<<<<<<<<<<
 *         if not (<int>PetscFinalizeCalled):
 *             MPI_Comm_size(PETSC_COMM_WORLD, &csize)
*/
  __pyx_v_csize = 1;
  __pyx_v_crank = 0;

  /* "petsc4py/PETSc/Error.pyx":27
 *     def __str__(self):
 *         cdef int csize=1, crank=0
 *         if not (<int>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":28
 *         cdef int csize=1, crank=0
 *         if not (<int>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":29
 *         if not (<int>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":27
 *     def __str__(self):
 *         cdef int csize=1, crank=0
 *         if not (<int>PetscFinalizeCalled):             # <<<<<<<<<<<<<<
 *             MPI_Comm_size(PETSC_COMM_WORLD, &csize)
 *             MPI_Comm_rank(PETSC_COMM_WORLD, &crank)
*/
  }

  /* "petsc4py/PETSc/Error.pyx":30
 *             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_PyLong_From_long((__pyx_v_csize - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(30, 30, __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":31
 *             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_mstate_global->__pyx_n_u_ierr); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_error_code_d, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 31, __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(30, 31, __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) != (0)) __PYX_ERR(30, 31, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_v_tblist = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Error.pyx":32
 *         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_mstate_global->__pyx_n_u_traceback); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 32, __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(30, 32, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(30, 32, __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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(30, 32, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_4;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(30, 32, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4));
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4);
        #endif
        ++__pyx_t_4;
      }
      if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 32, __pyx_L1_error)
    } else {
      __pyx_t_3 = __pyx_t_6(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(30, 32, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/Error.pyx":33
 *         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 = PyLong_FromSsize_t(__pyx_v_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(30, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyLong_From_int(__pyx_v_rank); if (unlikely(!__pyx_t_7)) __PYX_ERR(30, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(30, 33, __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) != (0)) __PYX_ERR(30, 33, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_7);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7) != (0)) __PYX_ERR(30, 33, __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) != (0)) __PYX_ERR(30, 33, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_d_s, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(30, 33, __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":34
 *         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(30, 34, __pyx_L1_error)

    /* "petsc4py/PETSc/Error.pyx":32
 *         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":35
 *             tbline = '[%*d] %s' % (width, rank, entry)
 *             tblist.append(tbline)
 *         return '\n'.join(tblist)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__15, __pyx_v_tblist); if (unlikely(!__pyx_t_2)) __PYX_ERR(30, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Error.pyx":25
 *         return 'PETSc.Error(%d)' % self.ierr
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         cdef int csize=1, crank=0
 *         if not (<int>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":47
 *     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_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 47, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 47, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(31, 47, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 47, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(31, 47, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":48
 * 
 *     def __init__(self, prefix = None):
 *         self.opt = NULL             # <<<<<<<<<<<<<<
 *         self.prefix = prefix
 * 
*/
  __pyx_v_self->opt = NULL;

  /* "petsc4py/PETSc/Options.pyx":49
 *     def __init__(self, prefix = None):
 *         self.opt = NULL
 *         self.prefix = prefix             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
*/
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_prefix, __pyx_v_prefix) < (0)) __PYX_ERR(31, 49, __pyx_L1_error)

  /* "petsc4py/PETSc/Options.pyx":47
 *     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":51
 *         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":52
 * 
 *     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":53
 *     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, 53, __pyx_L1_error)

  /* "petsc4py/PETSc/Options.pyx":51
 *         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":55
 *         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;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__contains__", 0);

  /* "petsc4py/PETSc/Options.pyx":56
 * 
 *     def __contains__(self, item):
 *         return self.hasName(item)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, item):
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_item};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hasName, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(31, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Options.pyx":55
 *         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_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":58
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "petsc4py/PETSc/Options.pyx":59
 * 
 *     def __getitem__(self, item):
 *         return self.getString(item)             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, item, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_item};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getString, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 59, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Options.pyx":58
 *         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_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":61
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "petsc4py/PETSc/Options.pyx":62
 * 
 *     def __setitem__(self, item, value):
 *         self.setValue(item, value)             # <<<<<<<<<<<<<<
 * 
 *     def __delitem__(self, item):
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_item, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setValue, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Options.pyx":61
 *         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_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":64
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__delitem__", 0);

  /* "petsc4py/PETSc/Options.pyx":65
 * 
 *     def __delitem__(self, item):
 *         self.delValue(item)             # <<<<<<<<<<<<<<
 * 
 *     property prefix:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_item};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_delValue, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 65, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Options.pyx":64
 *         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_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":69
 *     property prefix:
 *         """Prefix for options."""
 *         def __get__(self) -> str:             # <<<<<<<<<<<<<<
 *             return 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__", 0);

  /* "petsc4py/PETSc/Options.pyx":70
 *         """Prefix for options."""
 *         def __get__(self) -> str:
 *             return self._prefix             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, prefix):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_prefix);
  __pyx_r = __pyx_v_self->_prefix;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Options.pyx":69
 *     property prefix:
 *         """Prefix for options."""
 *         def __get__(self) -> str:             # <<<<<<<<<<<<<<
 *             return self._prefix
 * 
*/

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Options.pyx":72
 *             return self._prefix
 * 
 *         def __set__(self, prefix):             # <<<<<<<<<<<<<<
 *             self._prefix = getprefix(prefix)
 * 
*/

/* 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__", 0);

  /* "petsc4py/PETSc/Options.pyx":73
 * 
 *         def __set__(self, prefix):
 *             self._prefix = getprefix(prefix)             # <<<<<<<<<<<<<<
 * 
 *         def __del__(self):
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_getprefix(__pyx_v_prefix, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 73, __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":72
 *             return self._prefix
 * 
 *         def __set__(self, prefix):             # <<<<<<<<<<<<<<
 *             self._prefix = getprefix(prefix)
 * 
*/

  /* 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":75
 *             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__", 0);

  /* "petsc4py/PETSc/Options.pyx":76
 * 
 *         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":75
 *             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":79
 *     #
 * 
 *     def create(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an options database."""
 *         if self.opt != NULL: return
*/

/* 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) -> Self\nCreate an options database.\nSource code at petsc4py/PETSc/Options.pyx:79");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_13create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_13create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_12create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("create", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Options.pyx":81
 *     def create(self) -> Self:
 *         """Create an options database."""
 *         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":82
 *         """Create an options database."""
 *         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, 82, __pyx_L1_error)

  /* "petsc4py/PETSc/Options.pyx":83
 *         if self.opt != NULL: return
 *         CHKERR(PetscOptionsCreate(&self.opt))
 *         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/Options.pyx":79
 *     #
 * 
 *     def create(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an options database."""
 *         if self.opt != NULL: return
*/

  /* 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":85
 *         return self
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy an options database."""
 *         if self.opt == NULL: return
*/

/* 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) -> Self\nDestroy an options database.\nSource code at petsc4py/PETSc/Options.pyx:85");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_15destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_15destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_14destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Options.pyx":87
 *     def destroy(self) -> Self:
 *         """Destroy an options database."""
 *         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":88
 *         """Destroy an options database."""
 *         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, 88, __pyx_L1_error)

  /* "petsc4py/PETSc/Options.pyx":89
 *         if self.opt == NULL: return
 *         CHKERR(PetscOptionsDestroy(&self.opt))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def clear(self) -> Self:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Options.pyx":85
 *         return self
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy an options database."""
 *         if self.opt == NULL: return
*/

  /* 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":91
 *         return self
 * 
 *     def clear(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Clear an options database."""
 *         if self.opt == NULL: return
*/

/* 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) -> Self\nClear an options database.\nSource code at petsc4py/PETSc/Options.pyx:91");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_17clear = {"clear", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_17clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_16clear};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("clear", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Options.pyx":93
 *     def clear(self) -> Self:
 *         """Clear an options database."""
 *         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":94
 *         """Clear an options database."""
 *         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, 94, __pyx_L1_error)

  /* "petsc4py/PETSc/Options.pyx":95
 *         if self.opt == NULL: return
 *         CHKERR(PetscOptionsClear(self.opt))
 *         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/Options.pyx":91
 *         return self
 * 
 *     def clear(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Clear an options database."""
 *         if self.opt == NULL: return
*/

  /* 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":97
 *         return self
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the options database.
 * 
*/

/* 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) -> None\nView the options database.\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.PetscOptionsView\n\n        \nSource code at petsc4py/PETSc/Options.pyx:97");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_19view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_19view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_18view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 97, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 97, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(31, 97, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 97, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 97, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(31, 97, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Options.pyx":112
 * 
 *         """
 *         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":113
 *         """
 *         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":114
 *         cdef PetscViewer vwr = NULL
 *         if viewer is not None: vwr = viewer.vwr
 *         CHKERR(PetscOptionsView(self.opt, vwr))             # <<<<<<<<<<<<<<
 * 
 *     def prefixPush(self, prefix: str | Options | Object | None) -> None:
*/
  __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, 114, __pyx_L1_error)

  /* "petsc4py/PETSc/Options.pyx":97
 *         return self
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the options database.
 * 
*/

  /* 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":116
 *         CHKERR(PetscOptionsView(self.opt, vwr))
 * 
 *     def prefixPush(self, prefix: str | Options | Object | None) -> None:             # <<<<<<<<<<<<<<
 *         """Push a prefix for the options database.
 * 
*/

/* 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: str | Options | Object | None) -> None\nPush a prefix for the options database.\n\n        Logically collective.\n\n        See Also\n        --------\n        prefixPop, petsc.PetscOptionsPrefixPush\n\n        \nSource code at petsc4py/PETSc/Options.pyx:116");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_21prefixPush = {"prefixPush", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_21prefixPush, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_20prefixPush};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 116, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 116, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "prefixPush", 0) < (0)) __PYX_ERR(31, 116, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("prefixPush", 1, 1, 1, i); __PYX_ERR(31, 116, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 116, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("prefixPush", 1, 1, 1, __pyx_nargs); __PYX_ERR(31, 116, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":126
 * 
 *         """
 *         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, 126, __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":127
 *         """
 *         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":128
 *         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, 128, __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":129
 *         cdef const char *cprefix = NULL
 *         prefix = str2bytes(prefix, &cprefix)
 *         CHKERR(PetscOptionsPrefixPush(self.opt, cprefix))             # <<<<<<<<<<<<<<
 * 
 *     def prefixPop(self) -> None:
*/
  __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, 129, __pyx_L1_error)

  /* "petsc4py/PETSc/Options.pyx":116
 *         CHKERR(PetscOptionsView(self.opt, vwr))
 * 
 *     def prefixPush(self, prefix: str | Options | Object | None) -> None:             # <<<<<<<<<<<<<<
 *         """Push a prefix for 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.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":131
 *         CHKERR(PetscOptionsPrefixPush(self.opt, cprefix))
 * 
 *     def prefixPop(self) -> None:             # <<<<<<<<<<<<<<
 *         """Pop a prefix for the options database.
 * 
*/

/* 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) -> None\nPop a prefix for the options database.\n\n        Logically collective.\n\n        See Also\n        --------\n        prefixPush, petsc.PetscOptionsPrefixPop\n\n        \nSource code at petsc4py/PETSc/Options.pyx:131");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_23prefixPop = {"prefixPop", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_23prefixPop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_22prefixPop};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("prefixPop", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Options.pyx":141
 * 
 *         """
 *         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, 141, __pyx_L1_error)

  /* "petsc4py/PETSc/Options.pyx":131
 *         CHKERR(PetscOptionsPrefixPush(self.opt, cprefix))
 * 
 *     def prefixPop(self) -> None:             # <<<<<<<<<<<<<<
 *         """Pop a prefix for the options database.
 * 
*/

  /* 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":144
 *     #
 * 
 *     def hasName(self, name: str) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the boolean indicating if the option is in the database."""
 *         cdef const char *pr = 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: str) -> bool\nReturn the boolean indicating if the option is in the database.\nSource code at petsc4py/PETSc/Options.pyx:144");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_25hasName = {"hasName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_25hasName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_24hasName};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 144, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 144, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "hasName", 0) < (0)) __PYX_ERR(31, 144, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("hasName", 1, 1, 1, i); __PYX_ERR(31, 144, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 144, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("hasName", 1, 1, 1, __pyx_nargs); __PYX_ERR(31, 144, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_unused = 0;
  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", 0);

  /* "petsc4py/PETSc/Options.pyx":146
 *     def hasName(self, name: str) -> bool:
 *         """Return the boolean indicating if the option is in the database."""
 *         cdef const char *pr = NULL             # <<<<<<<<<<<<<<
 *         cdef const char *nm = NULL
 *         cdef object unused = getpair(self.prefix, name, &pr, &nm)
*/
  __pyx_v_pr = NULL;

  /* "petsc4py/PETSc/Options.pyx":147
 *         """Return the boolean indicating if the option is in the database."""
 *         cdef const char *pr = NULL
 *         cdef const char *nm = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = getpair(self.prefix, name, &pr, &nm)
 *         cdef PetscBool flag = PETSC_FALSE
*/
  __pyx_v_nm = NULL;

  /* "petsc4py/PETSc/Options.pyx":148
 *         cdef const char *pr = NULL
 *         cdef const char *nm = NULL
 *         cdef object unused = 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_mstate_global->__pyx_n_u_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 148, __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, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_unused = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Options.pyx":149
 *         cdef const char *nm = NULL
 *         cdef object unused = 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":150
 *         cdef object unused = 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, 150, __pyx_L1_error)

  /* "petsc4py/PETSc/Options.pyx":151
 *         cdef PetscBool flag = PETSC_FALSE
 *         CHKERR(PetscOptionsHasName(self.opt, pr, nm, &flag))
 *         return toBool(flag)             # <<<<<<<<<<<<<<
 * 
 *     def used(self, name: str) -> bool:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Options.pyx":144
 *     #
 * 
 *     def hasName(self, name: str) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the boolean indicating if the option is in the database."""
 *         cdef const char *pr = 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_unused);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Options.pyx":153
 *         return toBool(flag)
 * 
 *     def used(self, name: str) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the boolean indicating if the option was queried from the database."""
 *         cdef const char *key = NULL
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_27used(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_26used, "Options.used(self, name: str) -> bool\nReturn the boolean indicating if the option was queried from the database.\nSource code at petsc4py/PETSc/Options.pyx:153");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_27used = {"used", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_27used, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_26used};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_27used(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("used (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 153, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 153, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "used", 0) < (0)) __PYX_ERR(31, 153, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("used", 1, 1, 1, i); __PYX_ERR(31, 153, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 153, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("used", 1, 1, 1, __pyx_nargs); __PYX_ERR(31, 153, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Options.used", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_26used(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_26used(struct __pyx_obj_8petsc4py_5PETSc_Options *__pyx_v_self, PyObject *__pyx_v_name) {
  char const *__pyx_v_key;
  PetscBool __pyx_v_flag;
  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("used", 0);
  __Pyx_INCREF(__pyx_v_name);

  /* "petsc4py/PETSc/Options.pyx":155
 *     def used(self, name: str) -> bool:
 *         """Return the boolean indicating if the option was queried from the database."""
 *         cdef const char *key = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscBool flag = PETSC_FALSE
 *         name = str2bytes(name, &key)
*/
  __pyx_v_key = NULL;

  /* "petsc4py/PETSc/Options.pyx":156
 *         """Return the boolean indicating if the option was queried from the database."""
 *         cdef const char *key = NULL
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         name = str2bytes(name, &key)
 *         CHKERR(PetscOptionsUsed(self.opt, key, &flag))
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/Options.pyx":157
 *         cdef const char *key = NULL
 *         cdef PetscBool flag = PETSC_FALSE
 *         name = str2bytes(name, &key)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscOptionsUsed(self.opt, key, &flag))
 *         return toBool(flag)
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_key)); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Options.pyx":158
 *         cdef PetscBool flag = PETSC_FALSE
 *         name = str2bytes(name, &key)
 *         CHKERR(PetscOptionsUsed(self.opt, key, &flag))             # <<<<<<<<<<<<<<
 *         return toBool(flag)
 * 
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsUsed(__pyx_v_self->opt, __pyx_v_key, (&__pyx_v_flag))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 158, __pyx_L1_error)

  /* "petsc4py/PETSc/Options.pyx":159
 *         name = str2bytes(name, &key)
 *         CHKERR(PetscOptionsUsed(self.opt, key, &flag))
 *         return toBool(flag)             # <<<<<<<<<<<<<<
 * 
 *     def setValue(self, name: str,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Options.pyx":153
 *         return toBool(flag)
 * 
 *     def used(self, name: str) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the boolean indicating if the option was queried from the database."""
 *         cdef const char *key = NULL
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("petsc4py.PETSc.Options.used", __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/Options.pyx":161
 *         return toBool(flag)
 * 
 *     def setValue(self, name: str,             # <<<<<<<<<<<<<<
 *                  value: bool | int | float | Scalar | Sequence[bool] | Sequence[int] | Sequence[float] | Sequence[Scalar] | str) -> None:
 *         """Set a value for an option.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_29setValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_28setValue, "Options.setValue(self, name: str, value: bool | int | float | Scalar | Sequence[bool] | Sequence[int] | Sequence[float] | Sequence[Scalar] | str) -> None\nSet a value for an option.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        name\n            The string identifying the option.\n        value\n            The option value.\n\n        See Also\n        --------\n        delValue, petsc.PetscOptionsSetValue\n\n        \nSource code at petsc4py/PETSc/Options.pyx:161");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_29setValue = {"setValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_29setValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_28setValue};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_29setValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 161, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 161, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 161, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValue", 0) < (0)) __PYX_ERR(31, 161, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValue", 1, 2, 2, i); __PYX_ERR(31, 161, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 161, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 161, __pyx_L3_error)
    }
    __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, 161, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_28setValue(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_value);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_28setValue(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_unused = 0;
  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;
  PyObject *__pyx_t_5[3];
  size_t __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("setValue", 0);
  __Pyx_INCREF(__pyx_v_value);

  /* "petsc4py/PETSc/Options.pyx":179
 * 
 *         """
 *         cdef const char *pr = NULL             # <<<<<<<<<<<<<<
 *         cdef const char *nm = NULL
 *         cdef object unused = getpair(self.prefix, name, &pr, &nm)
*/
  __pyx_v_pr = NULL;

  /* "petsc4py/PETSc/Options.pyx":180
 *         """
 *         cdef const char *pr = NULL
 *         cdef const char *nm = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = getpair(self.prefix, name, &pr, &nm)
 *         if pr == NULL:
*/
  __pyx_v_nm = NULL;

  /* "petsc4py/PETSc/Options.pyx":181
 *         cdef const char *pr = NULL
 *         cdef const char *nm = NULL
 *         cdef object unused = getpair(self.prefix, name, &pr, &nm)             # <<<<<<<<<<<<<<
 *         if pr == NULL:
 *             option = bytes2str(nm)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 181, __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, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_unused = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Options.pyx":182
 *         cdef const char *nm = NULL
 *         cdef object unused = 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":183
 *         cdef object unused = 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, 183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_option = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Options.pyx":182
 *         cdef const char *nm = NULL
 *         cdef object unused = getpair(self.prefix, name, &pr, &nm)
 *         if pr == NULL:             # <<<<<<<<<<<<<<
 *             option = bytes2str(nm)
 *         else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Options.pyx":185
 *             option = bytes2str(nm)
 *         else:
 *             option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1]))             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(value, ndarray):
*/
  /*else*/ {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_pr); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str((&(__pyx_v_nm[1]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u__13;
    __pyx_t_5[1] = __pyx_t_1;
    __pyx_t_5[2] = __pyx_t_4;
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
    if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_option = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Options.pyx":187
 *             option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1]))
 * 
 *         if isinstance(value, ndarray):             # <<<<<<<<<<<<<<
 *             value = value.tolist()
 *         if isinstance(value, (tuple, list)):
*/
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_value, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray); 
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/Options.pyx":188
 * 
 *         if isinstance(value, ndarray):
 *             value = value.tolist()             # <<<<<<<<<<<<<<
 *         if isinstance(value, (tuple, list)):
 *             value = str(value).replace(' ', '').\
*/
    __pyx_t_4 = __pyx_v_value;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_tolist, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Options.pyx":187
 *             option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1]))
 * 
 *         if isinstance(value, ndarray):             # <<<<<<<<<<<<<<
 *             value = value.tolist()
 *         if isinstance(value, (tuple, list)):
*/
  }

  /* "petsc4py/PETSc/Options.pyx":189
 *         if isinstance(value, ndarray):
 *             value = value.tolist()
 *         if isinstance(value, (tuple, list)):             # <<<<<<<<<<<<<<
 *             value = str(value).replace(' ', '').\
 *                     replace('(', '').replace(')', '').\
*/
  __pyx_t_7 = PyTuple_Check(__pyx_v_value); 
  if (!__pyx_t_7) {
  } else {
    __pyx_t_3 = __pyx_t_7;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_7 = PyList_Check(__pyx_v_value); 
  __pyx_t_3 = __pyx_t_7;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/Options.pyx":190
 *             value = value.tolist()
 *         if isinstance(value, (tuple, list)):
 *             value = str(value).replace(' ', '').\             # <<<<<<<<<<<<<<
 *                     replace('(', '').replace(')', '').\
 *                     replace('[', '').replace(']', '')
*/
    __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyUnicode_Replace(((PyObject*)__pyx_t_2), __pyx_mstate_global->__pyx_kp_u__12, __pyx_mstate_global->__pyx_kp_u__7, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Options.pyx":191
 *         if isinstance(value, (tuple, list)):
 *             value = str(value).replace(' ', '').\
 *                     replace('(', '').replace(')', '').\             # <<<<<<<<<<<<<<
 *                     replace('[', '').replace(']', '')
 *         elif isinstance(value, bool):
*/
    __pyx_t_2 = PyUnicode_Replace(((PyObject*)__pyx_t_4), __pyx_mstate_global->__pyx_kp_u__10, __pyx_mstate_global->__pyx_kp_u__7, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyUnicode_Replace(((PyObject*)__pyx_t_2), __pyx_mstate_global->__pyx_kp_u__5, __pyx_mstate_global->__pyx_kp_u__7, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Options.pyx":192
 *             value = str(value).replace(' ', '').\
 *                     replace('(', '').replace(')', '').\
 *                     replace('[', '').replace(']', '')             # <<<<<<<<<<<<<<
 *         elif isinstance(value, bool):
 *             value = str(value).lower()
*/
    __pyx_t_2 = PyUnicode_Replace(((PyObject*)__pyx_t_4), __pyx_mstate_global->__pyx_kp_u__16, __pyx_mstate_global->__pyx_kp_u__7, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyUnicode_Replace(((PyObject*)__pyx_t_2), __pyx_mstate_global->__pyx_kp_u__17, __pyx_mstate_global->__pyx_kp_u__7, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "petsc4py/PETSc/Options.pyx":189
 *         if isinstance(value, ndarray):
 *             value = value.tolist()
 *         if isinstance(value, (tuple, list)):             # <<<<<<<<<<<<<<
 *             value = str(value).replace(' ', '').\
 *                     replace('(', '').replace(')', '').\
*/
    goto __pyx_L5;
  }

  /* "petsc4py/PETSc/Options.pyx":193
 *                     replace('(', '').replace(')', '').\
 *                     replace('[', '').replace(']', '')
 *         elif isinstance(value, bool):             # <<<<<<<<<<<<<<
 *             value = str(value).lower()
 *         elif value is not None:
*/
  __pyx_t_3 = PyBool_Check(__pyx_v_value); 
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/Options.pyx":194
 *                     replace('[', '').replace(']', '')
 *         elif isinstance(value, bool):
 *             value = str(value).lower()             # <<<<<<<<<<<<<<
 *         elif value is not None:
 *             value = str(value)
*/
    __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_t_1;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_lower, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "petsc4py/PETSc/Options.pyx":193
 *                     replace('(', '').replace(')', '').\
 *                     replace('[', '').replace(']', '')
 *         elif isinstance(value, bool):             # <<<<<<<<<<<<<<
 *             value = str(value).lower()
 *         elif value is not None:
*/
    goto __pyx_L5;
  }

  /* "petsc4py/PETSc/Options.pyx":195
 *         elif isinstance(value, 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":196
 *             value = str(value).lower()
 *         elif value is not None:
 *             value = str(value)             # <<<<<<<<<<<<<<
 *         cdef const char *key = NULL
 *         cdef const char *val = NULL
*/
    __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "petsc4py/PETSc/Options.pyx":195
 *         elif isinstance(value, bool):
 *             value = str(value).lower()
 *         elif value is not None:             # <<<<<<<<<<<<<<
 *             value = str(value)
 *         cdef const char *key = NULL
*/
  }
  __pyx_L5:;

  /* "petsc4py/PETSc/Options.pyx":197
 *         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":198
 *             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":199
 *         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_4 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_option, (&__pyx_v_key)); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF_SET(__pyx_v_option, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Options.pyx":200
 *         cdef const char *val = NULL
 *         option = str2bytes(option, &key)
 *         value  = str2bytes(value,  &val)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscOptionsSetValue(self.opt, key, val))
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_value, (&__pyx_v_val)); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Options.pyx":201
 *         option = str2bytes(option, &key)
 *         value  = str2bytes(value,  &val)
 *         CHKERR(PetscOptionsSetValue(self.opt, key, val))             # <<<<<<<<<<<<<<
 * 
 *     def delValue(self, name: str) -> None:
*/
  __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsSetValue(__pyx_v_self->opt, __pyx_v_key, __pyx_v_val)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 201, __pyx_L1_error)

  /* "petsc4py/PETSc/Options.pyx":161
 *         return toBool(flag)
 * 
 *     def setValue(self, name: str,             # <<<<<<<<<<<<<<
 *                  value: bool | int | float | Scalar | Sequence[bool] | Sequence[int] | Sequence[float] | Sequence[Scalar] | str) -> None:
 *         """Set a value for an option.
*/

  /* 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_unused);
  __Pyx_XDECREF(__pyx_v_option);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Options.pyx":203
 *         CHKERR(PetscOptionsSetValue(self.opt, key, val))
 * 
 *     def delValue(self, name: str) -> None:             # <<<<<<<<<<<<<<
 *         """Delete an option from the database.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_31delValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_30delValue, "Options.delValue(self, name: str) -> None\nDelete an option from the database.\n\n        Logically collective.\n\n        See Also\n        --------\n        setValue, petsc.PetscOptionsClearValue\n\n        \nSource code at petsc4py/PETSc/Options.pyx:203");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_31delValue = {"delValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_31delValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_30delValue};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_31delValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 203, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 203, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "delValue", 0) < (0)) __PYX_ERR(31, 203, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("delValue", 1, 1, 1, i); __PYX_ERR(31, 203, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 203, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delValue", 1, 1, 1, __pyx_nargs); __PYX_ERR(31, 203, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_30delValue(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_30delValue(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_unused = 0;
  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;
  PyObject *__pyx_t_5[3];
  PetscErrorCode __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delValue", 0);

  /* "petsc4py/PETSc/Options.pyx":213
 * 
 *         """
 *         cdef const char *pr = NULL             # <<<<<<<<<<<<<<
 *         cdef const char *nm = NULL
 *         cdef object unused = getpair(self.prefix, name, &pr, &nm)
*/
  __pyx_v_pr = NULL;

  /* "petsc4py/PETSc/Options.pyx":214
 *         """
 *         cdef const char *pr = NULL
 *         cdef const char *nm = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = getpair(self.prefix, name, &pr, &nm)
 *         if pr == NULL:
*/
  __pyx_v_nm = NULL;

  /* "petsc4py/PETSc/Options.pyx":215
 *         cdef const char *pr = NULL
 *         cdef const char *nm = NULL
 *         cdef object unused = getpair(self.prefix, name, &pr, &nm)             # <<<<<<<<<<<<<<
 *         if pr == NULL:
 *             option = bytes2str(nm)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 215, __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, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_unused = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Options.pyx":216
 *         cdef const char *nm = NULL
 *         cdef object unused = 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":217
 *         cdef object unused = 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, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_option = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Options.pyx":216
 *         cdef const char *nm = NULL
 *         cdef object unused = getpair(self.prefix, name, &pr, &nm)
 *         if pr == NULL:             # <<<<<<<<<<<<<<
 *             option = bytes2str(nm)
 *         else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Options.pyx":219
 *             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, 219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str((&(__pyx_v_nm[1]))); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(31, 219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u__13;
    __pyx_t_5[1] = __pyx_t_1;
    __pyx_t_5[2] = __pyx_t_4;
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
    if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_option = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Options.pyx":220
 *         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":221
 *             option = '-%s%s' % (bytes2str(pr), bytes2str(&nm[1]))
 *         cdef const char *key = NULL
 *         option = str2bytes(option, &key)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscOptionsClearValue(self.opt, key))
 * 
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_option, (&__pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_option, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Options.pyx":222
 *         cdef const char *key = NULL
 *         option = str2bytes(option, &key)
 *         CHKERR(PetscOptionsClearValue(self.opt, key))             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsClearValue(__pyx_v_self->opt, __pyx_v_key)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(31, 222, __pyx_L1_error)

  /* "petsc4py/PETSc/Options.pyx":203
 *         CHKERR(PetscOptionsSetValue(self.opt, key, val))
 * 
 *     def delValue(self, name: str) -> None:             # <<<<<<<<<<<<<<
 *         """Delete an option from 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_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_unused);
  __Pyx_XDECREF(__pyx_v_option);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Options.pyx":226
 *     #
 * 
 *     def getBool(self, name: str, default=None) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the boolean value associated with the option.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_33getBool(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_32getBool, "Options.getBool(self, name: str, default=None) -> bool\nReturn the boolean value associated with the option.\n\n        Not collective.\n\n        Parameters\n        ----------\n        name\n            The option name.\n        default\n            The default value.\n            If `None`, it raises a `KeyError` if the option is not found.\n\n        See Also\n        --------\n        getBoolArray, petsc.PetscOptionsGetBool\n\n        \nSource code at petsc4py/PETSc/Options.pyx:226");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_33getBool = {"getBool", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_33getBool, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_32getBool};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_33getBool(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_default,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 226, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getBool", 0) < (0)) __PYX_ERR(31, 226, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getBool", 0, 1, 2, i); __PYX_ERR(31, 226, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 226, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 226, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_32getBool(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_32getBool(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", 0);

  /* "petsc4py/PETSc/Options.pyx":244
 * 
 *         """
 *         return getopt(self.opt, OPT_BOOL, self.prefix, name, default)             # <<<<<<<<<<<<<<
 * 
 *     def getBoolArray(self, name: str, default=None) -> ArrayBool:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 244, __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, 244, __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":226
 *     #
 * 
 *     def getBool(self, name: str, default=None) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the boolean value associated with the option.
 * 
*/

  /* 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":246
 *         return getopt(self.opt, OPT_BOOL, self.prefix, name, default)
 * 
 *     def getBoolArray(self, name: str, default=None) -> ArrayBool:             # <<<<<<<<<<<<<<
 *         """Return the boolean values associated with the option.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_35getBoolArray(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_34getBoolArray, "Options.getBoolArray(self, name: str, default=None) -> ArrayBool\nReturn the boolean values associated with the option.\n\n        Not collective.\n\n        Parameters\n        ----------\n        name\n            The option name.\n        default\n            The default value.\n            If `None`, it raises a `KeyError` if the option is not found.\n\n        See Also\n        --------\n        getBool, petsc.PetscOptionsGetBoolArray\n\n        \nSource code at petsc4py/PETSc/Options.pyx:246");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_35getBoolArray = {"getBoolArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_35getBoolArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_34getBoolArray};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_35getBoolArray(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("getBoolArray (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_default,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 246, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 246, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 246, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getBoolArray", 0) < (0)) __PYX_ERR(31, 246, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getBoolArray", 0, 1, 2, i); __PYX_ERR(31, 246, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 246, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 246, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_name = values[0];
    __pyx_v_default = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getBoolArray", 0, 1, 2, __pyx_nargs); __PYX_ERR(31, 246, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Options.getBoolArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_34getBoolArray(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_34getBoolArray(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("getBoolArray", 0);

  /* "petsc4py/PETSc/Options.pyx":264
 * 
 *         """
 *         return getopt(self.opt, OPT_BOOLARRAY, self.prefix, name, default)             # <<<<<<<<<<<<<<
 * 
 *     def getInt(self, name: str, default=None) -> int:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 264, __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_BOOLARRAY, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 264, __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":246
 *         return getopt(self.opt, OPT_BOOL, self.prefix, name, default)
 * 
 *     def getBoolArray(self, name: str, default=None) -> ArrayBool:             # <<<<<<<<<<<<<<
 *         """Return the boolean values associated with the option.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Options.getBoolArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Options.pyx":266
 *         return getopt(self.opt, OPT_BOOLARRAY, self.prefix, name, default)
 * 
 *     def getInt(self, name: str, default=None) -> int:             # <<<<<<<<<<<<<<
 *         """Return the integer value associated with the option.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_37getInt(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_36getInt, "Options.getInt(self, name: str, default=None) -> int\nReturn the integer value associated with the option.\n\n        Not collective.\n\n        Parameters\n        ----------\n        name\n            The option name.\n        default\n            The default value.\n            If `None`, it raises a `KeyError` if the option is not found.\n\n        See Also\n        --------\n        getIntArray, petsc.PetscOptionsGetInt\n\n        \nSource code at petsc4py/PETSc/Options.pyx:266");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_37getInt = {"getInt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_37getInt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_36getInt};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_37getInt(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_default,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 266, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 266, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 266, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getInt", 0) < (0)) __PYX_ERR(31, 266, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getInt", 0, 1, 2, i); __PYX_ERR(31, 266, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 266, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 266, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 266, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_36getInt(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_36getInt(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", 0);

  /* "petsc4py/PETSc/Options.pyx":284
 * 
 *         """
 *         return getopt(self.opt, OPT_INT, self.prefix, name, default)             # <<<<<<<<<<<<<<
 * 
 *     def getIntArray(self, name: str, default=None) -> ArrayInt:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 284, __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, 284, __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":266
 *         return getopt(self.opt, OPT_BOOLARRAY, self.prefix, name, default)
 * 
 *     def getInt(self, name: str, default=None) -> int:             # <<<<<<<<<<<<<<
 *         """Return the integer value associated with the option.
 * 
*/

  /* 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":286
 *         return getopt(self.opt, OPT_INT, self.prefix, name, default)
 * 
 *     def getIntArray(self, name: str, default=None) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the integer array associated with the option.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_39getIntArray(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_38getIntArray, "Options.getIntArray(self, name: str, default=None) -> ArrayInt\nReturn the integer array associated with the option.\n\n        Not collective.\n\n        Parameters\n        ----------\n        name\n            The option name.\n        default\n            The default value.\n            If `None`, it raises a `KeyError` if the option is not found.\n\n        See Also\n        --------\n        getInt, petsc.PetscOptionsGetIntArray\n\n        \nSource code at petsc4py/PETSc/Options.pyx:286");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_39getIntArray = {"getIntArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_39getIntArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_38getIntArray};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_39getIntArray(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("getIntArray (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_default,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 286, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getIntArray", 0) < (0)) __PYX_ERR(31, 286, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getIntArray", 0, 1, 2, i); __PYX_ERR(31, 286, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 286, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_name = values[0];
    __pyx_v_default = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getIntArray", 0, 1, 2, __pyx_nargs); __PYX_ERR(31, 286, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Options.getIntArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_38getIntArray(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_38getIntArray(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("getIntArray", 0);

  /* "petsc4py/PETSc/Options.pyx":304
 * 
 *         """
 *         return getopt(self.opt, OPT_INTARRAY, self.prefix, name, default)             # <<<<<<<<<<<<<<
 * 
 *     def getReal(self, name: str, default=None) -> float:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 304, __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_INTARRAY, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 304, __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":286
 *         return getopt(self.opt, OPT_INT, self.prefix, name, default)
 * 
 *     def getIntArray(self, name: str, default=None) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the integer array associated with the option.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Options.getIntArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Options.pyx":306
 *         return getopt(self.opt, OPT_INTARRAY, self.prefix, name, default)
 * 
 *     def getReal(self, name: str, default=None) -> float:             # <<<<<<<<<<<<<<
 *         """Return the real value associated with the option.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_41getReal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_40getReal, "Options.getReal(self, name: str, default=None) -> float\nReturn the real value associated with the option.\n\n        Not collective.\n\n        Parameters\n        ----------\n        name\n            The option name.\n        default\n            The default value.\n            If `None`, it raises a `KeyError` if the option is not found.\n\n        See Also\n        --------\n        getRealArray, petsc.PetscOptionsGetReal\n\n        \nSource code at petsc4py/PETSc/Options.pyx:306");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_41getReal = {"getReal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_41getReal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_40getReal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_41getReal(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_default,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 306, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 306, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 306, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getReal", 0) < (0)) __PYX_ERR(31, 306, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getReal", 0, 1, 2, i); __PYX_ERR(31, 306, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 306, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 306, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 306, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_40getReal(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_40getReal(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", 0);

  /* "petsc4py/PETSc/Options.pyx":324
 * 
 *         """
 *         return getopt(self.opt, OPT_REAL, self.prefix, name, default)             # <<<<<<<<<<<<<<
 * 
 *     def getRealArray(self, name: str, default=None) -> ArrayReal:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 324, __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, 324, __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":306
 *         return getopt(self.opt, OPT_INTARRAY, self.prefix, name, default)
 * 
 *     def getReal(self, name: str, default=None) -> float:             # <<<<<<<<<<<<<<
 *         """Return the real value associated with the option.
 * 
*/

  /* 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":326
 *         return getopt(self.opt, OPT_REAL, self.prefix, name, default)
 * 
 *     def getRealArray(self, name: str, default=None) -> ArrayReal:             # <<<<<<<<<<<<<<
 *         """Return the real array associated with the option.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_43getRealArray(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_42getRealArray, "Options.getRealArray(self, name: str, default=None) -> ArrayReal\nReturn the real array associated with the option.\n\n        Not collective.\n\n        Parameters\n        ----------\n        name\n            The option name.\n        default\n            The default value.\n            If `None`, it raises a `KeyError` if the option is not found.\n\n        See Also\n        --------\n        getReal, petsc.PetscOptionsGetRealArray\n\n        \nSource code at petsc4py/PETSc/Options.pyx:326");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_43getRealArray = {"getRealArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_43getRealArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_42getRealArray};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_43getRealArray(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("getRealArray (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_default,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 326, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 326, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 326, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getRealArray", 0) < (0)) __PYX_ERR(31, 326, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getRealArray", 0, 1, 2, i); __PYX_ERR(31, 326, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 326, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 326, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_name = values[0];
    __pyx_v_default = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getRealArray", 0, 1, 2, __pyx_nargs); __PYX_ERR(31, 326, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Options.getRealArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_42getRealArray(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_42getRealArray(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("getRealArray", 0);

  /* "petsc4py/PETSc/Options.pyx":344
 * 
 *         """
 *         return getopt(self.opt, OPT_REALARRAY, self.prefix, name, default)             # <<<<<<<<<<<<<<
 * 
 *     def getScalar(self, name: str, default=None) -> Scalar:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 344, __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_REALARRAY, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 344, __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":326
 *         return getopt(self.opt, OPT_REAL, self.prefix, name, default)
 * 
 *     def getRealArray(self, name: str, default=None) -> ArrayReal:             # <<<<<<<<<<<<<<
 *         """Return the real array associated with the option.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Options.getRealArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Options.pyx":346
 *         return getopt(self.opt, OPT_REALARRAY, self.prefix, name, default)
 * 
 *     def getScalar(self, name: str, default=None) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Return the scalar value associated with the option.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_45getScalar(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_44getScalar, "Options.getScalar(self, name: str, default=None) -> Scalar\nReturn the scalar value associated with the option.\n\n        Not collective.\n\n        Parameters\n        ----------\n        name\n            The option name.\n        default\n            The default value.\n            If `None`, it raises a `KeyError` if the option is not found.\n\n        See Also\n        --------\n        getScalarArray, petsc.PetscOptionsGetScalar\n\n        \nSource code at petsc4py/PETSc/Options.pyx:346");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_45getScalar = {"getScalar", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_45getScalar, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_44getScalar};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_45getScalar(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_default,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 346, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 346, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 346, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getScalar", 0) < (0)) __PYX_ERR(31, 346, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getScalar", 0, 1, 2, i); __PYX_ERR(31, 346, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 346, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 346, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 346, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_44getScalar(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_44getScalar(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", 0);

  /* "petsc4py/PETSc/Options.pyx":364
 * 
 *         """
 *         return getopt(self.opt, OPT_SCALAR, self.prefix, name, default)             # <<<<<<<<<<<<<<
 * 
 *     def getScalarArray(self, name: str, default=None) -> ArrayScalar:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 364, __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, 364, __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":346
 *         return getopt(self.opt, OPT_REALARRAY, self.prefix, name, default)
 * 
 *     def getScalar(self, name: str, default=None) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Return the scalar value associated with the option.
 * 
*/

  /* 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":366
 *         return getopt(self.opt, OPT_SCALAR, self.prefix, name, default)
 * 
 *     def getScalarArray(self, name: str, default=None) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Return the scalar array associated with the option.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_47getScalarArray(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_46getScalarArray, "Options.getScalarArray(self, name: str, default=None) -> ArrayScalar\nReturn the scalar array associated with the option.\n\n        Not collective.\n\n        Parameters\n        ----------\n        name\n            The option name.\n        default\n            The default value.\n            If `None`, it raises a `KeyError` if the option is not found.\n\n        See Also\n        --------\n        getScalar, petsc.PetscOptionsGetScalarArray\n\n        \nSource code at petsc4py/PETSc/Options.pyx:366");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_47getScalarArray = {"getScalarArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_47getScalarArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_46getScalarArray};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_47getScalarArray(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("getScalarArray (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_default,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 366, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 366, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 366, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getScalarArray", 0) < (0)) __PYX_ERR(31, 366, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getScalarArray", 0, 1, 2, i); __PYX_ERR(31, 366, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 366, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 366, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_name = values[0];
    __pyx_v_default = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getScalarArray", 0, 1, 2, __pyx_nargs); __PYX_ERR(31, 366, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Options.getScalarArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_46getScalarArray(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_46getScalarArray(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("getScalarArray", 0);

  /* "petsc4py/PETSc/Options.pyx":384
 * 
 *         """
 *         return getopt(self.opt, OPT_SCALARARRAY, self.prefix, name, default)             # <<<<<<<<<<<<<<
 * 
 *     def getString(self, name: str, default=None) -> str:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 384, __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_SCALARARRAY, __pyx_t_1, __pyx_v_name, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 384, __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":366
 *         return getopt(self.opt, OPT_SCALAR, self.prefix, name, default)
 * 
 *     def getScalarArray(self, name: str, default=None) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Return the scalar array associated with the option.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Options.getScalarArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Options.pyx":386
 *         return getopt(self.opt, OPT_SCALARARRAY, self.prefix, name, default)
 * 
 *     def getString(self, name: str, default=None) -> str:             # <<<<<<<<<<<<<<
 *         """Return the string associated with the option.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_49getString(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_48getString, "Options.getString(self, name: str, default=None) -> str\nReturn the string associated with the option.\n\n        Not collective.\n\n        Parameters\n        ----------\n        name\n            The option name.\n        default\n            The default value.\n            If `None`, it raises a `KeyError` if the option is not found.\n\n        See Also\n        --------\n        petsc.PetscOptionsGetString\n\n        \nSource code at petsc4py/PETSc/Options.pyx:386");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_49getString = {"getString", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_49getString, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_48getString};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_49getString(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_default,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 386, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 386, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 386, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getString", 0) < (0)) __PYX_ERR(31, 386, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getString", 0, 1, 2, i); __PYX_ERR(31, 386, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(31, 386, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 386, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 386, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_48getString(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_name, __pyx_v_default);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_48getString(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", 0);

  /* "petsc4py/PETSc/Options.pyx":404
 * 
 *         """
 *         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_mstate_global->__pyx_n_u_prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(31, 404, __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, 404, __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":386
 *         return getopt(self.opt, OPT_SCALARARRAY, self.prefix, name, default)
 * 
 *     def getString(self, name: str, default=None) -> str:             # <<<<<<<<<<<<<<
 *         """Return the string associated with the option.
 * 
*/

  /* 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":408
 *     #
 * 
 *     def insertString(self, string: str) -> None:             # <<<<<<<<<<<<<<
 *         """Insert a string in the options database.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_51insertString(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_50insertString, "Options.insertString(self, string: str) -> None\nInsert a string in the options database.\n\n        Logically collective.\n\n        See Also\n        --------\n        petsc.PetscOptionsInsertString\n\n        \nSource code at petsc4py/PETSc/Options.pyx:408");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_51insertString = {"insertString", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_51insertString, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_50insertString};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_51insertString(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_string,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(31, 408, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 408, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "insertString", 0) < (0)) __PYX_ERR(31, 408, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("insertString", 1, 1, 1, i); __PYX_ERR(31, 408, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(31, 408, __pyx_L3_error)
    }
    __pyx_v_string = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insertString", 1, 1, 1, __pyx_nargs); __PYX_ERR(31, 408, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_50insertString(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self), __pyx_v_string);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_50insertString(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":418
 * 
 *         """
 *         cdef const char *cstring = NULL             # <<<<<<<<<<<<<<
 *         string = str2bytes(string, &cstring)
 *         CHKERR(PetscOptionsInsertString(self.opt, cstring))
*/
  __pyx_v_cstring = NULL;

  /* "petsc4py/PETSc/Options.pyx":419
 *         """
 *         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, 419, __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":420
 *         cdef const char *cstring = NULL
 *         string = str2bytes(string, &cstring)
 *         CHKERR(PetscOptionsInsertString(self.opt, cstring))             # <<<<<<<<<<<<<<
 * 
 *     def getAll(self) -> dict[str, str]:
*/
  __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, 420, __pyx_L1_error)

  /* "petsc4py/PETSc/Options.pyx":408
 *     #
 * 
 *     def insertString(self, string: str) -> None:             # <<<<<<<<<<<<<<
 *         """Insert a string 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.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":422
 *         CHKERR(PetscOptionsInsertString(self.opt, cstring))
 * 
 *     def getAll(self) -> dict[str, str]:             # <<<<<<<<<<<<<<
 *         """Return all the options and their values.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_53getAll(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_52getAll, "Options.getAll(self) -> dict[str, str]\nReturn all the options and their values.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PetscOptionsGetAll\n\n        \nSource code at petsc4py/PETSc/Options.pyx:422");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Options_53getAll = {"getAll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_53getAll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_52getAll};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Options_53getAll(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getAll", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Options_52getAll(((struct __pyx_obj_8petsc4py_5PETSc_Options *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Options_52getAll(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", 0);

  /* "petsc4py/PETSc/Options.pyx":432
 * 
 *         """
 *         cdef char *allopts = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscOptionsGetAll(self.opt, &allopts))
 *         options = bytes2str(allopts)
*/
  __pyx_v_allopts = NULL;

  /* "petsc4py/PETSc/Options.pyx":433
 *         """
 *         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, 433, __pyx_L1_error)

  /* "petsc4py/PETSc/Options.pyx":434
 *         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, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_options = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Options.pyx":435
 *         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, 435, __pyx_L1_error)

  /* "petsc4py/PETSc/Options.pyx":436
 *         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_mstate_global->__pyx_n_u_prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(31, 436, __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, 436, __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":422
 *         CHKERR(PetscOptionsInsertString(self.opt, cstring))
 * 
 *     def getAll(self) -> dict[str, str]:             # <<<<<<<<<<<<<<
 *         """Return all the options and their values.
 * 
*/

  /* 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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_1getVersion = {"getVersion", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_1getVersion, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_getVersion};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_devel,&__pyx_mstate_global->__pyx_n_u_date,&__pyx_mstate_global->__pyx_n_u_author,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 7, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getVersion", 0) < (0)) __PYX_ERR(32, 7, __pyx_L3_error)

      /* "petsc4py/PETSc/Sys.pyx":10
 *     def getVersion(
 *         cls,
 *         devel: bool = False,             # <<<<<<<<<<<<<<
 *         date: bool = False,
 *         author: bool = False) -> tuple[int, int, int]:
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "petsc4py/PETSc/Sys.pyx":11
 *         cls,
 *         devel: bool = False,
 *         date: bool = False,             # <<<<<<<<<<<<<<
 *         author: bool = False) -> tuple[int, int, int]:
 *         """Return PETSc version information.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 7, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Sys.pyx":10
 *     def getVersion(
 *         cls,
 *         devel: bool = False,             # <<<<<<<<<<<<<<
 *         date: bool = False,
 *         author: bool = False) -> tuple[int, int, int]:
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "petsc4py/PETSc/Sys.pyx":11
 *         cls,
 *         devel: bool = False,
 *         date: bool = False,             # <<<<<<<<<<<<<<
 *         author: bool = False) -> tuple[int, int, int]:
 *         """Return PETSc version information.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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[256];
  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_8genexpr2__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;
  size_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  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":41
 *         """
 *         cdef char cversion[256]
 *         cdef PetscInt major=0, minor=0, micro=0, release=0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscGetVersion(cversion, sizeof(cversion)))
 *         CHKERR(PetscGetVersionNumber(&major, &minor, &micro, &release))
*/
  __pyx_v_major = 0;
  __pyx_v_minor = 0;
  __pyx_v_micro = 0;
  __pyx_v_release = 0;

  /* "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, &micro, &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, 42, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":43
 *         cdef PetscInt major=0, minor=0, micro=0, release=0
 *         CHKERR(PetscGetVersion(cversion, sizeof(cversion)))
 *         CHKERR(PetscGetVersionNumber(&major, &minor, &micro, &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, 43, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":44
 *         CHKERR(PetscGetVersion(cversion, sizeof(cversion)))
 *         CHKERR(PetscGetVersionNumber(&major, &minor, &micro, &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, 44, __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, 44, __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, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 44, __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) != (0)) __PYX_ERR(32, 44, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(32, 44, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4) != (0)) __PYX_ERR(32, 44, __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":45
 *         CHKERR(PetscGetVersionNumber(&major, &minor, &micro, &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, 45, __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, 45, __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, 45, __pyx_L1_error)
  __pyx_t_6 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_6) {

    /* "petsc4py/PETSc/Sys.pyx":46
 *         out = version = (toInt(major), toInt(minor), toInt(micro))
 *         if devel or date or author:
 *             out = [version]             # <<<<<<<<<<<<<<
 *             if devel:
 *                 out.append(not <bint>release)
*/
    __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 46, __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) != (0)) __PYX_ERR(32, 46, __pyx_L1_error);
    __Pyx_DECREF_SET(__pyx_v_out, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "petsc4py/PETSc/Sys.pyx":47
 *         if devel or date or author:
 *             out = [version]
 *             if devel:             # <<<<<<<<<<<<<<
 *                 out.append(not <bint>release)
 *             if date:
*/
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_devel); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(32, 47, __pyx_L1_error)
    if (__pyx_t_6) {

      /* "petsc4py/PETSc/Sys.pyx":48
 *             out = [version]
 *             if devel:
 *                 out.append(not <bint>release)             # <<<<<<<<<<<<<<
 *             if date:
 *                 vstr = bytes2str(cversion)
*/
      __pyx_t_5 = __Pyx_PyBool_FromLong((!(__pyx_v_release != 0))); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 48, __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, 48, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "petsc4py/PETSc/Sys.pyx":47
 *         if devel or date or author:
 *             out = [version]
 *             if devel:             # <<<<<<<<<<<<<<
 *                 out.append(not <bint>release)
 *             if date:
*/
    }

    /* "petsc4py/PETSc/Sys.pyx":49
 *             if devel:
 *                 out.append(not <bint>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, 49, __pyx_L1_error)
    if (__pyx_t_6) {

      /* "petsc4py/PETSc/Sys.pyx":50
 *                 out.append(not <bint>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, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_v_vstr = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "petsc4py/PETSc/Sys.pyx":51
 *             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":52
 *                 vstr = bytes2str(cversion)
 *                 if release != 0:
 *                     date = vstr.split(",", 1)[-1].strip()             # <<<<<<<<<<<<<<
 *                 else:
 *                     date = vstr.split("Git Date:")[-1].strip()
*/
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vstr, __pyx_mstate_global->__pyx_n_u_split); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 52, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_mstate_global->__pyx_tuple[1], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 52, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 52, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_4 = __pyx_t_3;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_9 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
          __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 52, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_DECREF_SET(__pyx_v_date, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "petsc4py/PETSc/Sys.pyx":51
 *             if date:
 *                 vstr = bytes2str(cversion)
 *                 if release != 0:             # <<<<<<<<<<<<<<
 *                     date = vstr.split(",", 1)[-1].strip()
 *                 else:
*/
        goto __pyx_L9;
      }

      /* "petsc4py/PETSc/Sys.pyx":54
 *                     date = vstr.split(",", 1)[-1].strip()
 *                 else:
 *                     date = vstr.split("Git Date:")[-1].strip()             # <<<<<<<<<<<<<<
 *                 out.append(date)
 *             if author:
*/
      /*else*/ {
        __pyx_t_2 = __pyx_v_vstr;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_9 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Git_Date};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 54, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 54, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_3 = __pyx_t_2;
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_9 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 54, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_DECREF_SET(__pyx_v_date, __pyx_t_5);
        __pyx_t_5 = 0;
      }
      __pyx_L9:;

      /* "petsc4py/PETSc/Sys.pyx":55
 *                 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, 55, __pyx_L1_error)

      /* "petsc4py/PETSc/Sys.pyx":49
 *             if devel:
 *                 out.append(not <bint>release)
 *             if date:             # <<<<<<<<<<<<<<
 *                 vstr = bytes2str(cversion)
 *                 if release != 0:
*/
    }

    /* "petsc4py/PETSc/Sys.pyx":56
 *                     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, 56, __pyx_L1_error)
    if (__pyx_t_6) {

      /* "petsc4py/PETSc/Sys.pyx":57
 *                 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, 57, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __pyx_t_3;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_9 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u__15};
        __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 57, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_DECREF_SET(__pyx_v_author, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "petsc4py/PETSc/Sys.pyx":58
 *             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, 58, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (likely(PyList_CheckExact(__pyx_v_author)) || PyTuple_CheckExact(__pyx_v_author)) {
          __pyx_t_3 = __pyx_v_author; __Pyx_INCREF(__pyx_t_3);
          __pyx_t_10 = 0;
          __pyx_t_11 = NULL;
        } else {
          __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_author); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 58, __pyx_L13_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 58, __pyx_L13_error)
        }
        for (;;) {
          if (likely(!__pyx_t_11)) {
            if (likely(PyList_CheckExact(__pyx_t_3))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(32, 58, __pyx_L13_error)
                #endif
                if (__pyx_t_10 >= __pyx_temp) break;
              }
              __pyx_t_2 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_10, __Pyx_ReferenceSharing_OwnStrongReference);
              ++__pyx_t_10;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(32, 58, __pyx_L13_error)
                #endif
                if (__pyx_t_10 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10));
              #else
              __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10);
              #endif
              ++__pyx_t_10;
            }
            if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 58, __pyx_L13_error)
          } else {
            __pyx_t_2 = __pyx_t_11(__pyx_t_3);
            if (unlikely(!__pyx_t_2)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(32, 58, __pyx_L13_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_s, __pyx_t_2);
          __pyx_t_2 = 0;
          __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_8genexpr2__pyx_v_s); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(32, 58, __pyx_L13_error)
          if (__pyx_t_6) {
            __pyx_t_4 = __pyx_8genexpr2__pyx_v_s;
            __Pyx_INCREF(__pyx_t_4);
            __pyx_t_9 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
              __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_strip, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 58, __pyx_L13_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_2))) __PYX_ERR(32, 58, __pyx_L13_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_s); __pyx_8genexpr2__pyx_v_s = 0;
        goto __pyx_L18_exit_scope;
        __pyx_L13_error:;
        __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_s); __pyx_8genexpr2__pyx_v_s = 0;
        goto __pyx_L1_error;
        __pyx_L18_exit_scope:;
      } /* exit inner scope */
      __pyx_t_3 = PyList_AsTuple(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 58, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_author, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "petsc4py/PETSc/Sys.pyx":59
 *                 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, 59, __pyx_L1_error)

      /* "petsc4py/PETSc/Sys.pyx":56
 *                     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":45
 *         CHKERR(PetscGetVersionNumber(&major, &minor, &micro, &release))
 *         out = version = (toInt(major), toInt(minor), toInt(micro))
 *         if devel or date or author:             # <<<<<<<<<<<<<<
 *             out = [version]
 *             if devel:
*/
  }

  /* "petsc4py/PETSc/Sys.pyx":60
 *                 author = tuple([s.strip() for s in author if s])
 *                 out.append(author)
 *         return tuple(out)             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_out); if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 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_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_8genexpr2__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":62
 *         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:62");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_3getVersionInfo = {"getVersionInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_3getVersionInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_2getVersionInfo};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getVersionInfo", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Sys.pyx":78
 * 
 *         """
 *         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_mstate_global->__pyx_n_u_getVersion); if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[2], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 78, __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, 78, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3);
      __Pyx_INCREF(__pyx_t_5);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 78, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 78, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 78, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 78, __pyx_L1_error)
      __Pyx_XGOTREF(__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 = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(32, 78, __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, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 78, __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, 78, __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":79
 *         """
 *         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, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_version, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_major, __pyx_t_5) < (0)) __PYX_ERR(32, 79, __pyx_L1_error)
  __Pyx_DECREF(__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],
 *                     release    = not dev,
*/
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_version, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_minor, __pyx_t_5) < (0)) __PYX_ERR(32, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Sys.pyx":81
 *         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_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_subminor, __pyx_t_5) < (0)) __PYX_ERR(32, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Sys.pyx":82
 *                     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, 82, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyBool_FromLong((!__pyx_t_8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_release, __pyx_t_5) < (0)) __PYX_ERR(32, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Sys.pyx":83
 *                     subminor   = version[2],
 *                     release    = not dev,
 *                     date       = date,             # <<<<<<<<<<<<<<
 *                     authorinfo = author)
 * 
*/
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_date, __pyx_v_date) < (0)) __PYX_ERR(32, 79, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":84
 *                     release    = not dev,
 *                     date       = date,
 *                     authorinfo = author)             # <<<<<<<<<<<<<<
 * 
 *     # --- xxx ---
*/
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_authorinfo, __pyx_v_author) < (0)) __PYX_ERR(32, 79, __pyx_L1_error)
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Sys.pyx":62
 *         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":88
 *     # --- 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:88");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_5isInitialized = {"isInitialized", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_5isInitialized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_4isInitialized};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isInitialized", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Sys.pyx":99
 * 
 *         """
 *         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, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Sys.pyx":88
 *     # --- 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":101
 *         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:101");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_7isFinalized = {"isFinalized", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_7isFinalized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_6isFinalized};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isFinalized", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Sys.pyx":112
 * 
 *         """
 *         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, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Sys.pyx":101
 *         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":116
 *     # --- 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:116");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_9getDefaultComm = {"getDefaultComm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_9getDefaultComm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_8getDefaultComm};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDefaultComm", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDefaultComm", 0);

  /* "petsc4py/PETSc/Sys.pyx":127
 * 
 *         """
 *         cdef Comm comm = Comm()             # <<<<<<<<<<<<<<
 *         comm.comm = PETSC_COMM_DEFAULT
 *         return comm
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(32, 127, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_comm = ((struct PyPetscCommObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Sys.pyx":128
 *         """
 *         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":129
 *         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":116
 *     # --- 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_XDECREF(__pyx_t_2);
  __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":131
 *         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:131");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_11setDefaultComm = {"setDefaultComm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_11setDefaultComm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_10setDefaultComm};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 131, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 131, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDefaultComm", 0) < (0)) __PYX_ERR(32, 131, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDefaultComm", 1, 1, 1, i); __PYX_ERR(32, 131, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 131, __pyx_L3_error)
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setDefaultComm", 1, 1, 1, __pyx_nargs); __PYX_ERR(32, 131, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setDefaultComm", 0);

  /* "petsc4py/PETSc/Sys.pyx":147
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(32, 147, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_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")
 *         global PETSC_COMM_DEFAULT
*/
  __pyx_t_2 = (__pyx_v_ccomm == MPI_COMM_NULL);
  if (unlikely(__pyx_t_2)) {

    /* "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
 *         PETSC_COMM_DEFAULT = ccomm
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_null_communicator};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 149, __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, 149, __pyx_L1_error)

    /* "petsc4py/PETSc/Sys.pyx":148
 *         """
 *         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":151
 *             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":131
 *         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_XDECREF(__pyx_t_4);
  __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":155
 *     # --- 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:155");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_13Print = {"Print", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_13Print, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_12Print};
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_SIZE
  __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_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sep,&__pyx_mstate_global->__pyx_n_u_end,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 155, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        default:
        case  0: break;
      }
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values, 0, __pyx_kwds_len, "Print", 1) < (0)) __PYX_ERR(32, 155, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__12));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__15));

      /* "petsc4py/PETSc/Sys.pyx":161
 *         sep: str = ' ',
 *         end: str = '\n',
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *         **kwargs: Any) -> None: # noqa: E129
 *         """Print output from the first processor of a communicator.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    } else if (unlikely(__pyx_nargs < 0)) {
      goto __pyx_L5_argtuple_error;
    } else {
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__12));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__15));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 155, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_XDECREF(__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":155
 *     # --- xxx ---
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def Print(
 *         cls,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __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":185
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(32, 185, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Sys.pyx":186
 *         """
 *         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, 186, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 == 0);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/Sys.pyx":187
 *         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
*/
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_v_args);
      if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(32, 187, __pyx_L1_error)
      __pyx_t_3 = (__pyx_temp != 0);
    }

    __pyx_t_4 = (!__pyx_t_3);
    if (__pyx_t_4) {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[3]);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_tuple[3]);
    }

    /* "petsc4py/PETSc/Sys.pyx":188
 *         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, 188, __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, 188, __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_mstate_global->__pyx_kp_u_s);
        __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_s);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_6, __pyx_temp * 2, __pyx_mstate_global->__pyx_kp_u_s) != (0)) __PYX_ERR(32, 188, __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) != (0)) __PYX_ERR(32, 188, __pyx_L1_error);
      }
    }
    __pyx_v_format = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "petsc4py/PETSc/Sys.pyx":189
 *             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_PyLong_From_long, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(32, 189, __pyx_L1_error)

    /* "petsc4py/PETSc/Sys.pyx":190
 *             format = ['%s', sep] * len(args)
 *             format[-1] = end
 *             message = ''.join(format) % args             # <<<<<<<<<<<<<<
 *         else:
 *             message = ''
*/
    __pyx_t_6 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__7, __pyx_v_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(32, 190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyUnicode_Format(__pyx_t_6, __pyx_v_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(32, 190, __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":186
 *         """
 *         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":192
 *             message = ''.join(format) % args
 *         else:
 *             message = ''             # <<<<<<<<<<<<<<
 *         cdef const char *m = NULL
 *         message = str2bytes(message, &m)
*/
  /*else*/ {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__7);
    __pyx_v_message = __pyx_mstate_global->__pyx_kp_u__7;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Sys.pyx":193
 *         else:
 *             message = ''
 *         cdef const char *m = NULL             # <<<<<<<<<<<<<<
 *         message = str2bytes(message, &m)
 *         CHKERR(PetscPrintf(ccomm, '%s', m))
*/
  __pyx_v_m = NULL;

  /* "petsc4py/PETSc/Sys.pyx":194
 *             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, 194, __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":195
 *         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, 195, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":155
 *     # --- 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":197
 *         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:197");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_15syncPrint = {"syncPrint", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_15syncPrint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_14syncPrint};
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_SIZE
  __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_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sep,&__pyx_mstate_global->__pyx_n_u_end,&__pyx_mstate_global->__pyx_n_u_flush,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 197, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        default:
        case  0: break;
      }
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values, 0, __pyx_kwds_len, "syncPrint", 1) < (0)) __PYX_ERR(32, 197, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__12));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__15));

      /* "petsc4py/PETSc/Sys.pyx":203
 *         sep: str = ' ',
 *         end: str = '\n',
 *         flush: bool = False,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *         **kwargs: Any) -> None: # noqa: E129
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "petsc4py/PETSc/Sys.pyx":204
 *         end: str = '\n',
 *         flush: bool = False,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *         **kwargs: Any) -> None: # noqa: E129
 *         """Print synchronized output from several processors of a communicator.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    } else if (unlikely(__pyx_nargs < 0)) {
      goto __pyx_L5_argtuple_error;
    } else {
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__12));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__15));

      /* "petsc4py/PETSc/Sys.pyx":203
 *         sep: str = ' ',
 *         end: str = '\n',
 *         flush: bool = False,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *         **kwargs: Any) -> None: # noqa: E129
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "petsc4py/PETSc/Sys.pyx":204
 *         end: str = '\n',
 *         flush: bool = False,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *         **kwargs: Any) -> None: # noqa: E129
 *         """Print synchronized output from several processors of a communicator.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 197, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_XDECREF(__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":197
 *         CHKERR(PetscPrintf(ccomm, '%s', m))
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def syncPrint(
 *         cls,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __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":230
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(32, 230, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Sys.pyx":231
 *         """
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
 *         if not args: args = ('',)             # <<<<<<<<<<<<<<
 *         format = ['%s', sep] * len(args)
 *         format[-1] = end
*/
  {
    Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_v_args);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(32, 231, __pyx_L1_error)
    __pyx_t_2 = (__pyx_temp != 0);
  }

  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_tuple[3]);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_tuple[3]);
  }

  /* "petsc4py/PETSc/Sys.pyx":232
 *         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, 232, __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, 232, __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_mstate_global->__pyx_kp_u_s);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_s);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_5, __pyx_temp * 2, __pyx_mstate_global->__pyx_kp_u_s) != (0)) __PYX_ERR(32, 232, __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) != (0)) __PYX_ERR(32, 232, __pyx_L1_error);
    }
  }
  __pyx_v_format = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Sys.pyx":233
 *         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_PyLong_From_long, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(32, 233, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":234
 *         format = ['%s', sep] * len(args)
 *         format[-1] = end
 *         message = ''.join(format) % args             # <<<<<<<<<<<<<<
 *         cdef const char *m = NULL
 *         message = str2bytes(message, &m)
*/
  __pyx_t_5 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__7, __pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyUnicode_Format(__pyx_t_5, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(32, 234, __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":235
 *         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":236
 *         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, 236, __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":237
 *         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, 237, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":238
 *         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, 238, __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, 238, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Sys.pyx":197
 *         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":240
 *         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:240");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_17syncFlush = {"syncFlush", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_17syncFlush, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_16syncFlush};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 240, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 240, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "syncFlush", 0) < (0)) __PYX_ERR(32, 240, __pyx_L3_error)

      /* "petsc4py/PETSc/Sys.pyx":241
 * 
 *     @classmethod
 *     def syncFlush(cls, comm: Comm | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Flush output from previous `syncPrint` calls.
 * 
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 240, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("syncFlush", 0, 0, 1, __pyx_nargs); __PYX_ERR(32, 240, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":240
 *         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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Sys.pyx":256
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(32, 256, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Sys.pyx":257
 *         """
 *         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, 257, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":240
 *         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":261
 *     # --- 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:261");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_19splitOwnership = {"splitOwnership", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_19splitOwnership, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_18splitOwnership};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 261, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "splitOwnership", 0) < (0)) __PYX_ERR(32, 261, __pyx_L3_error)

      /* "petsc4py/PETSc/Sys.pyx":265
 *         cls,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Sys.pyx":266
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("splitOwnership", 0, 1, 3, i); __PYX_ERR(32, 261, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 261, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Sys.pyx":265
 *         cls,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Sys.pyx":266
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 261, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":261
 *     # --- xxx ---
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def splitOwnership(
 *         cls,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Sys.pyx":299
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(32, 299, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Sys.pyx":300
 *         """
 *         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":301
 *         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, 301, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":302
 *         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":303
 *         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":304
 *         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":305
 *         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, 305, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":306
 *         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":307
 *         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":308
 *         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, 308, __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, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(32, 308, __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) != (0)) __PYX_ERR(32, 308, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5) != (0)) __PYX_ERR(32, 308, __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":261
 *     # --- 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":310
 *         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:310");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_21sleep = {"sleep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_21sleep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_20sleep};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_seconds,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 310, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 310, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sleep", 0) < (0)) __PYX_ERR(32, 310, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 310, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
    }
    __pyx_v_seconds = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sleep", 0, 0, 1, __pyx_nargs); __PYX_ERR(32, 310, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Sys.pyx":326
 * 
 *         """
 *         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, 326, __pyx_L1_error)
  __pyx_v_s = __pyx_t_1;

  /* "petsc4py/PETSc/Sys.pyx":327
 *         """
 *         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, 327, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":310
 *         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":331
 *     # --- 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:331");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_23pushErrorHandler = {"pushErrorHandler", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_23pushErrorHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_22pushErrorHandler};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_errhandler,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 331, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "pushErrorHandler", 0) < (0)) __PYX_ERR(32, 331, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("pushErrorHandler", 1, 1, 1, i); __PYX_ERR(32, 331, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 331, __pyx_L3_error)
    }
    __pyx_v_errhandler = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pushErrorHandler", 1, 1, 1, __pyx_nargs); __PYX_ERR(32, 331, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PetscErrorCode __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pushErrorHandler", 0);

  /* "petsc4py/PETSc/Sys.pyx":347
 * 
 *         """
 *         cdef PetscErrorHandlerFunction handler = NULL             # <<<<<<<<<<<<<<
 *         if errhandler == "python":
 *             handler = <PetscErrorHandlerFunction> PetscPythonErrorHandler
*/
  __pyx_v_handler = NULL;

  /* "petsc4py/PETSc/Sys.pyx":348
 *         """
 *         cdef PetscErrorHandlerFunction handler = NULL
 *         if errhandler == "python":             # <<<<<<<<<<<<<<
 *             handler = <PetscErrorHandlerFunction> PetscPythonErrorHandler
 *         elif errhandler == "debugger":
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_errhandler, __pyx_mstate_global->__pyx_n_u_python, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(32, 348, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Sys.pyx":349
 *         cdef PetscErrorHandlerFunction handler = NULL
 *         if errhandler == "python":
 *             handler = <PetscErrorHandlerFunction> PetscPythonErrorHandler             # <<<<<<<<<<<<<<
 *         elif errhandler == "debugger":
 *             handler = PetscAttachDebuggerErrorHandler
*/
    __pyx_v_handler = ((PetscErrorHandlerFunction)__pyx_f_8petsc4py_5PETSc_PetscPythonErrorHandler);

    /* "petsc4py/PETSc/Sys.pyx":348
 *         """
 *         cdef PetscErrorHandlerFunction handler = NULL
 *         if errhandler == "python":             # <<<<<<<<<<<<<<
 *             handler = <PetscErrorHandlerFunction> PetscPythonErrorHandler
 *         elif errhandler == "debugger":
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Sys.pyx":350
 *         if errhandler == "python":
 *             handler = <PetscErrorHandlerFunction> PetscPythonErrorHandler
 *         elif errhandler == "debugger":             # <<<<<<<<<<<<<<
 *             handler = PetscAttachDebuggerErrorHandler
 *         elif errhandler == "emacs":
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_errhandler, __pyx_mstate_global->__pyx_n_u_debugger, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(32, 350, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Sys.pyx":351
 *             handler = <PetscErrorHandlerFunction> PetscPythonErrorHandler
 *         elif errhandler == "debugger":
 *             handler = PetscAttachDebuggerErrorHandler             # <<<<<<<<<<<<<<
 *         elif errhandler == "emacs":
 *             handler = PetscEmacsClientErrorHandler
*/
    __pyx_v_handler = PetscAttachDebuggerErrorHandler;

    /* "petsc4py/PETSc/Sys.pyx":350
 *         if errhandler == "python":
 *             handler = <PetscErrorHandlerFunction> PetscPythonErrorHandler
 *         elif errhandler == "debugger":             # <<<<<<<<<<<<<<
 *             handler = PetscAttachDebuggerErrorHandler
 *         elif errhandler == "emacs":
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Sys.pyx":352
 *         elif errhandler == "debugger":
 *             handler = PetscAttachDebuggerErrorHandler
 *         elif errhandler == "emacs":             # <<<<<<<<<<<<<<
 *             handler = PetscEmacsClientErrorHandler
 *         elif errhandler == "traceback":
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_errhandler, __pyx_mstate_global->__pyx_n_u_emacs, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(32, 352, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Sys.pyx":353
 *             handler = PetscAttachDebuggerErrorHandler
 *         elif errhandler == "emacs":
 *             handler = PetscEmacsClientErrorHandler             # <<<<<<<<<<<<<<
 *         elif errhandler == "traceback":
 *             handler = PetscTraceBackErrorHandler
*/
    __pyx_v_handler = PetscEmacsClientErrorHandler;

    /* "petsc4py/PETSc/Sys.pyx":352
 *         elif errhandler == "debugger":
 *             handler = PetscAttachDebuggerErrorHandler
 *         elif errhandler == "emacs":             # <<<<<<<<<<<<<<
 *             handler = PetscEmacsClientErrorHandler
 *         elif errhandler == "traceback":
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Sys.pyx":354
 *         elif errhandler == "emacs":
 *             handler = PetscEmacsClientErrorHandler
 *         elif errhandler == "traceback":             # <<<<<<<<<<<<<<
 *             handler = PetscTraceBackErrorHandler
 *         elif errhandler == "return":
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_errhandler, __pyx_mstate_global->__pyx_n_u_traceback_2, 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 = PetscEmacsClientErrorHandler
 *         elif errhandler == "traceback":
 *             handler = PetscTraceBackErrorHandler             # <<<<<<<<<<<<<<
 *         elif errhandler == "return":
 *             handler = PetscReturnErrorHandler
*/
    __pyx_v_handler = PetscTraceBackErrorHandler;

    /* "petsc4py/PETSc/Sys.pyx":354
 *         elif errhandler == "emacs":
 *             handler = PetscEmacsClientErrorHandler
 *         elif errhandler == "traceback":             # <<<<<<<<<<<<<<
 *             handler = PetscTraceBackErrorHandler
 *         elif errhandler == "return":
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Sys.pyx":356
 *         elif errhandler == "traceback":
 *             handler = PetscTraceBackErrorHandler
 *         elif errhandler == "return":             # <<<<<<<<<<<<<<
 *             handler = PetscReturnErrorHandler
 *         elif errhandler == "mpiabort":
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_errhandler, __pyx_mstate_global->__pyx_n_u_return, 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 = PetscTraceBackErrorHandler
 *         elif errhandler == "return":
 *             handler = PetscReturnErrorHandler             # <<<<<<<<<<<<<<
 *         elif errhandler == "mpiabort":
 *             handler = PetscMPIAbortErrorHandler
*/
    __pyx_v_handler = PetscReturnErrorHandler;

    /* "petsc4py/PETSc/Sys.pyx":356
 *         elif errhandler == "traceback":
 *             handler = PetscTraceBackErrorHandler
 *         elif errhandler == "return":             # <<<<<<<<<<<<<<
 *             handler = PetscReturnErrorHandler
 *         elif errhandler == "mpiabort":
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Sys.pyx":358
 *         elif errhandler == "return":
 *             handler = PetscReturnErrorHandler
 *         elif errhandler == "mpiabort":             # <<<<<<<<<<<<<<
 *             handler = PetscMPIAbortErrorHandler
 *         elif errhandler == "abort":
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_errhandler, __pyx_mstate_global->__pyx_n_u_mpiabort, 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 = PetscReturnErrorHandler
 *         elif errhandler == "mpiabort":
 *             handler = PetscMPIAbortErrorHandler             # <<<<<<<<<<<<<<
 *         elif errhandler == "abort":
 *             handler = PetscAbortErrorHandler
*/
    __pyx_v_handler = PetscMPIAbortErrorHandler;

    /* "petsc4py/PETSc/Sys.pyx":358
 *         elif errhandler == "return":
 *             handler = PetscReturnErrorHandler
 *         elif errhandler == "mpiabort":             # <<<<<<<<<<<<<<
 *             handler = PetscMPIAbortErrorHandler
 *         elif errhandler == "abort":
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Sys.pyx":360
 *         elif errhandler == "mpiabort":
 *             handler = PetscMPIAbortErrorHandler
 *         elif errhandler == "abort":             # <<<<<<<<<<<<<<
 *             handler = PetscAbortErrorHandler
 *         else:
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_errhandler, __pyx_mstate_global->__pyx_n_u_abort, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(32, 360, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "petsc4py/PETSc/Sys.pyx":361
 *             handler = PetscMPIAbortErrorHandler
 *         elif errhandler == "abort":
 *             handler = PetscAbortErrorHandler             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError(f"unknown error handler: {errhandler!r}")
*/
    __pyx_v_handler = PetscAbortErrorHandler;

    /* "petsc4py/PETSc/Sys.pyx":360
 *         elif errhandler == "mpiabort":
 *             handler = PetscMPIAbortErrorHandler
 *         elif errhandler == "abort":             # <<<<<<<<<<<<<<
 *             handler = PetscAbortErrorHandler
 *         else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Sys.pyx":363
 *             handler = PetscAbortErrorHandler
 *         else:
 *             raise ValueError(f"unknown error handler: {errhandler!r}")             # <<<<<<<<<<<<<<
 *         CHKERR(PetscPushErrorHandler(handler, NULL))
 * 
*/
  /*else*/ {
    __pyx_t_3 = NULL;
    __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_errhandler), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(32, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_unknown_error_handler, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(32, 363, __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(32, 363, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Sys.pyx":364
 *         else:
 *             raise ValueError(f"unknown error handler: {errhandler!r}")
 *         CHKERR(PetscPushErrorHandler(handler, NULL))             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPushErrorHandler(__pyx_v_handler, NULL)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 364, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":331
 *     # --- 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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":366
 *         CHKERR(PetscPushErrorHandler(handler, NULL))
 * 
 *     @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:366");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_25popErrorHandler = {"popErrorHandler", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_25popErrorHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_24popErrorHandler};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("popErrorHandler", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Sys.pyx":377
 * 
 *         """
 *         CHKERR(PetscPopErrorHandler())             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPopErrorHandler()); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 377, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":366
 *         CHKERR(PetscPushErrorHandler(handler, NULL))
 * 
 *     @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":379
 *         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:379");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_27popSignalHandler = {"popSignalHandler", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_27popSignalHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_26popSignalHandler};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("popSignalHandler", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Sys.pyx":390
 * 
 *         """
 *         CHKERR(PetscPopSignalHandler())             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPopSignalHandler()); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 390, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":379
 *         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":392
 *         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:392");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_29infoAllow = {"infoAllow", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_29infoAllow, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_28infoAllow};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,&__pyx_mstate_global->__pyx_n_u_filename,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 392, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 392, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 392, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 392, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "infoAllow", 0) < (0)) __PYX_ERR(32, 392, __pyx_L3_error)

      /* "petsc4py/PETSc/Sys.pyx":396
 *         cls,
 *         flag: bool,
 *         filename: str | None = None,             # <<<<<<<<<<<<<<
 *         mode: str = "w") -> None:
 *         """Enables or disables PETSc info messages.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_w));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("infoAllow", 0, 1, 3, i); __PYX_ERR(32, 392, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(32, 392, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(32, 392, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 392, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_w));
    }
    __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, 392, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":392
 *         CHKERR(PetscPopSignalHandler())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def infoAllow(
 *         cls,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":416
 * 
 *         """
 *         cdef PetscBool tval = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         cdef const char *cfilename = NULL
 *         cdef const char *cmode = NULL
*/
  __pyx_v_tval = PETSC_FALSE;

  /* "petsc4py/PETSc/Sys.pyx":417
 *         """
 *         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":418
 *         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":419
 *         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, 419, __pyx_L1_error)
  if (__pyx_t_1) {
    __pyx_v_tval = PETSC_TRUE;
  }

  /* "petsc4py/PETSc/Sys.pyx":420
 *         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, 420, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":421
 *         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":422
 *         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, 422, __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":423
 *         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, 423, __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":424
 *             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, 424, __pyx_L1_error)

    /* "petsc4py/PETSc/Sys.pyx":421
 *         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":392
 *         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":426
 *             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:426");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_31registerCitation = {"registerCitation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_31registerCitation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_30registerCitation};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_citation,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 426, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 426, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "registerCitation", 0) < (0)) __PYX_ERR(32, 426, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("registerCitation", 1, 1, 1, i); __PYX_ERR(32, 426, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 426, __pyx_L3_error)
    }
    __pyx_v_citation = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("registerCitation", 1, 1, 1, __pyx_nargs); __PYX_ERR(32, 426, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscBool __pyx_t_6;
  PetscErrorCode __pyx_t_7;
  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":442
 * 
 *         """
 *         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, 442, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_empty_citation};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(32, 442, __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, 442, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Sys.pyx":443
 *         """
 *         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":444
 *         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, 444, __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":445
 *         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_6 = __pyx_f_8petsc4py_5PETSc_get_citation(__pyx_v_citation); if (unlikely(__pyx_t_6 == ((PetscBool)-1) && PyErr_Occurred())) __PYX_ERR(32, 445, __pyx_L1_error)
  __pyx_v_flag = __pyx_t_6;

  /* "petsc4py/PETSc/Sys.pyx":446
 *         citation = str2bytes(citation, &cit)
 *         cdef PetscBool flag = get_citation(citation)
 *         CHKERR(PetscCitationsRegister(cit, &flag))             # <<<<<<<<<<<<<<
 *         set_citation(citation, toBool(flag))
 * 
*/
  __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscCitationsRegister(__pyx_v_cit, (&__pyx_v_flag))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(32, 446, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":447
 *         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, 447, __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, 447, __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, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Sys.pyx":426
 *             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_XDECREF(__pyx_t_4);
  __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":449
 *         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:449");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Sys_33hasExternalPackage = {"hasExternalPackage", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_33hasExternalPackage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_32hasExternalPackage};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_package,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(32, 449, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 449, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "hasExternalPackage", 0) < (0)) __PYX_ERR(32, 449, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("hasExternalPackage", 1, 1, 1, i); __PYX_ERR(32, 449, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(32, 449, __pyx_L3_error)
    }
    __pyx_v_package = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("hasExternalPackage", 1, 1, 1, __pyx_nargs); __PYX_ERR(32, 449, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":465
 * 
 *         """
 *         cdef const char *cpackage = NULL             # <<<<<<<<<<<<<<
 *         package = str2bytes(package, &cpackage)
 *         cdef PetscBool has = PETSC_FALSE
*/
  __pyx_v_cpackage = NULL;

  /* "petsc4py/PETSc/Sys.pyx":466
 *         """
 *         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, 466, __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":467
 *         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":468
 *         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, 468, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":469
 *         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, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Sys.pyx":449
 *         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":474
 * 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", 0);

  /* "petsc4py/PETSc/Sys.pyx":475
 * 
 * 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, 475, __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, 475, __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, 475, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_is_set = __pyx_t_2;

  /* "petsc4py/PETSc/Sys.pyx":476
 * 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":474
 * 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 = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Sys.pyx":478
 *     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", 0);

  /* "petsc4py/PETSc/Sys.pyx":479
 * 
 * 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, 479, __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, 479, __pyx_L1_error)
  }
  if (unlikely((PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_citations_registry, __pyx_v_citation, __pyx_t_1) < 0))) __PYX_ERR(32, 479, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Sys.pyx":478
 *     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: str) -> LogStage:
 *         """Create a log stage.
*/

/* 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: str) -> LogStage\nCreate a log stage.\n\n        Not collective.\n\n        Parameters\n        ----------\n        name\n            Stage name.\n\n        Returns\n        -------\n        stage : LogStage\n            The log stage. If a stage already exists with name ``name`` then\n            it is reused.\n\n        See Also\n        --------\n        petsc.PetscLogStageRegister\n\n        \nSource code at petsc4py/PETSc/Log.pyx:11");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_1Stage = {"Stage", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_1Stage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_Stage};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 11, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 11, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Stage", 0) < (0)) __PYX_ERR(33, 11, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Stage", 1, 1, 1, i); __PYX_ERR(33, 11, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 11, __pyx_L3_error)
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  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":33
 * 
 *         """
 *         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, 33, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_empty_name};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 33, __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, 33, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Log.pyx":34
 *         """
 *         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":35
 *         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, 35, __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":36
 *         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":37
 *         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, 37, __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":38
 *         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":39
 *         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_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageFindId(__pyx_v_cname, (&__pyx_v_stageid))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 39, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":40
 *         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":41
 *         CHKERR(PetscLogStageFindId(cname, &stageid))
 *         if stageid == -1:
 *             CHKERR(PetscLogStageRegister(cname, &stageid))             # <<<<<<<<<<<<<<
 *         stage = reg_LogStage(name, stageid)
 *         return stage
*/
    __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogStageRegister(__pyx_v_cname, (&__pyx_v_stageid))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 41, __pyx_L1_error)

    /* "petsc4py/PETSc/Log.pyx":40
 *         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":42
 *         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, 42, __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":43
 *             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: str) -> LogStage:
 *         """Create a log stage.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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":45
 *         return stage
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def Class(cls, name: str) -> LogClass:
 *         """Create a log class.
*/

/* 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: str) -> LogClass\nCreate a log class.\n\n        Not collective.\n\n        Parameters\n        ----------\n        name\n            Class name.\n\n        Returns\n        -------\n        klass : LogClass\n            The log class. If a class already exists with name ``name`` then\n            it is reused.\n\n        See Also\n        --------\n        petsc.PetscClassIdRegister\n\n        \nSource code at petsc4py/PETSc/Log.pyx:45");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_3Class = {"Class", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_3Class, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_2Class};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 45, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 45, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Class", 0) < (0)) __PYX_ERR(33, 45, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Class", 1, 1, 1, i); __PYX_ERR(33, 45, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 45, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Class", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 45, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  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":67
 * 
 *         """
 *         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, 67, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_empty_name};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 67, __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, 67, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Log.pyx":68
 *         """
 *         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":69
 *         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, 69, __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":70
 *         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":71
 *         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, 71, __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":72
 *         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":73
 *         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_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogClassFindId(__pyx_v_cname, (&__pyx_v_classid))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 73, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":74
 *         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":75
 *         CHKERR(PetscLogClassFindId(cname, &classid))
 *         if classid == -1:
 *             CHKERR(PetscLogClassRegister(cname, &classid))             # <<<<<<<<<<<<<<
 *         klass = reg_LogClass(name, classid)
 *         return klass
*/
    __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscClassIdRegister(__pyx_v_cname, (&__pyx_v_classid))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 75, __pyx_L1_error)

    /* "petsc4py/PETSc/Log.pyx":74
 *         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":76
 *         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, 76, __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":77
 *             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":45
 *         return stage
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def Class(cls, name: str) -> LogClass:
 *         """Create a log class.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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":79
 *         return klass
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def Event(cls, name: str, klass: LogClass | None = None) -> LogEvent:
 *         """Create a log event.
*/

/* 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: str, klass: LogClass | None = None) -> LogEvent\nCreate a log event.\n\n        Not collective.\n\n        Parameters\n        ----------\n        name\n            Event name.\n        klass\n            Log class. If `None`, defaults to ``PETSC_OBJECT_CLASSID``.\n\n        Returns\n        -------\n        event : LogEvent\n            The log event. If an event already exists with name ``name`` then\n            it is reused.\n\n        See Also\n        --------\n        petsc.PetscLogEventRegister\n\n        \nSource code at petsc4py/PETSc/Log.pyx:79");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_5Event = {"Event", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_5Event, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_4Event};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_klass,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 79, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(33, 79, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 79, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Event", 0) < (0)) __PYX_ERR(33, 79, __pyx_L3_error)

      /* "petsc4py/PETSc/Log.pyx":80
 * 
 *     @classmethod
 *     def Event(cls, name: str, klass: LogClass | None = None) -> LogEvent:             # <<<<<<<<<<<<<<
 *         """Create a log event.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Event", 0, 1, 2, i); __PYX_ERR(33, 79, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(33, 79, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 79, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 79, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":79
 *         return klass
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def Event(cls, name: str, klass: LogClass | None = None) -> LogEvent:
 *         """Create a log event.
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscClassId __pyx_t_6;
  PetscErrorCode __pyx_t_7;
  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":103
 * 
 *         """
 *         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, 103, __pyx_L1_error)
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_empty_name};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 103, __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, 103, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Log.pyx":104
 *         """
 *         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":105
 *         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, 105, __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":106
 *         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":107
 *         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":108
 *         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_6 = __Pyx_PyLong_As_PetscClassId(__pyx_v_klass); if (unlikely((__pyx_t_6 == ((PetscClassId)-1)) && PyErr_Occurred())) __PYX_ERR(33, 108, __pyx_L1_error)
    __pyx_v_classid = __pyx_t_6;
  }

  /* "petsc4py/PETSc/Log.pyx":109
 *         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, 109, __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":110
 *         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":111
 *         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_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventFindId(__pyx_v_cname, (&__pyx_v_eventid))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 111, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":112
 *         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":113
 *         CHKERR(PetscLogEventFindId(cname, &eventid))
 *         if eventid == -1:
 *             CHKERR(PetscLogEventRegister(cname, classid, &eventid))             # <<<<<<<<<<<<<<
 *         event = reg_LogEvent(name, eventid)
 *         return event
*/
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventRegister(__pyx_v_cname, __pyx_v_classid, (&__pyx_v_eventid))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 113, __pyx_L1_error)

    /* "petsc4py/PETSc/Log.pyx":112
 *         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":114
 *         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, 114, __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":115
 *             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":79
 *         return klass
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def Event(cls, name: str, klass: LogClass | None = None) -> LogEvent:
 *         """Create a log event.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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":117
 *         return event
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def begin(cls) -> None:
 *         """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) -> None\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:117");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_7begin = {"begin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_7begin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_6begin};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("begin", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":128
 * 
 *         """
 *         CHKERR(PetscLogDefaultBegin())             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogDefaultBegin()); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 128, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":117
 *         return event
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def begin(cls) -> None:
 *         """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":130
 *         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:130");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_9view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_9view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_8view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 130, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 130, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(33, 130, __pyx_L3_error)

      /* "petsc4py/PETSc/Log.pyx":131
 * 
 *     @classmethod
 *     def view(cls, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """Print the log.
 * 
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 130, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 130, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(33, 131, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Log_8view(((PyTypeObject*)__pyx_v_cls), __pyx_v_viewer);

  /* "petsc4py/PETSc/Log.pyx":130
 *         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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Log.pyx":146
 * 
 *         """
 *         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":147
 *         """
 *         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":148
 *         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":149
 *         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, 149, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":130
 *         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":151
 *         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:151");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_11logFlops = {"logFlops", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_11logFlops, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_10logFlops};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flops,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 151, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 151, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "logFlops", 0) < (0)) __PYX_ERR(33, 151, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("logFlops", 1, 1, 1, i); __PYX_ERR(33, 151, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 151, __pyx_L3_error)
    }
    __pyx_v_flops = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("logFlops", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 151, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Log.pyx":167
 * 
 *         """
 *         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, 167, __pyx_L1_error)
  __pyx_v_cflops = __pyx_t_1;

  /* "petsc4py/PETSc/Log.pyx":168
 *         """
 *         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, 168, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":151
 *         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":170
 *         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:170");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_13addFlops = {"addFlops", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_13addFlops, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_12addFlops};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flops,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 170, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addFlops", 0) < (0)) __PYX_ERR(33, 170, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addFlops", 1, 1, 1, i); __PYX_ERR(33, 170, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 170, __pyx_L3_error)
    }
    __pyx_v_flops = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("addFlops", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 170, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Log.pyx":190
 * 
 *         """
 *         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, 190, __pyx_L1_error)
  __pyx_v_cflops = __pyx_t_1;

  /* "petsc4py/PETSc/Log.pyx":191
 *         """
 *         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, 191, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":170
 *         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":193
 *         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:193");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_15getFlops = {"getFlops", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_15getFlops, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_14getFlops};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFlops", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":209
 * 
 *         """
 *         cdef PetscLogDouble cflops=0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscGetFlops(&cflops))
 *         return cflops
*/
  __pyx_v_cflops = 0.0;

  /* "petsc4py/PETSc/Log.pyx":210
 *         """
 *         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, 210, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":211
 *         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, 211, __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
 *         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":213
 *         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:213");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_17getTime = {"getTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_17getTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_16getTime};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTime", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":229
 * 
 *         """
 *         cdef PetscLogDouble wctime=0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscTime(&wctime))
 *         return wctime
*/
  __pyx_v_wctime = 0.0;

  /* "petsc4py/PETSc/Log.pyx":230
 *         """
 *         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, 230, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":231
 *         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, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":213
 *         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":233
 *         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:233");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_19getCPUTime = {"getCPUTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_19getCPUTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_18getCPUTime};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCPUTime", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":236
 *     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":237
 *         """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, 237, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":238
 *         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, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":233
 *         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":240
 *         return cputime
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def EventDecorator(cls, name=None, klass=None) -> Any:
 *         """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) -> Any\nDecorate a function with a `PETSc` event.\nSource code at petsc4py/PETSc/Log.pyx:240");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_21EventDecorator = {"EventDecorator", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_21EventDecorator, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_20EventDecorator};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_klass,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 240, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(33, 240, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 240, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "EventDecorator", 0) < (0)) __PYX_ERR(33, 240, __pyx_L3_error)

      /* "petsc4py/PETSc/Log.pyx":241
 * 
 *     @classmethod
 *     def EventDecorator(cls, name=None, klass=None) -> Any:             # <<<<<<<<<<<<<<
 *         """Decorate a function with a `PETSc` event."""
 *         def decorator(func):
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(33, 240, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 240, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 240, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":240
 *         return cputime
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def EventDecorator(cls, name=None, klass=None) -> Any:
 *         """Decorate a function with a `PETSc` event."""
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Log.pyx":243
 *     def EventDecorator(cls, name=None, klass=None) -> Any:
 *         """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(*)(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_func,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 243, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 243, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "decorator", 0) < (0)) __PYX_ERR(33, 243, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("decorator", 1, 1, 1, i); __PYX_ERR(33, 243, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 243, __pyx_L3_error)
    }
    __pyx_v_func = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decorator", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 243, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Log.pyx":244
 *         """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(*)(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_SIZE
  __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);
  const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (__pyx_kwds_len > 0) {
    if (unlikely(__Pyx_CheckKeywordStrings("wrapped_func", __pyx_kwds) == -1)) return NULL;
    __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;
  size_t __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", 0);
  __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":246
 *             @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, 246, __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, 246, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Log.pyx":247
 *             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, 247, __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":246
 *             @functools.wraps(func)
 *             def wrapped_func(*args, **kwargs):
 *                 if name:             # <<<<<<<<<<<<<<
 *                     name_ = name
 *                 else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Log.pyx":249
 *                     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, 249, __pyx_L1_error) }
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_mstate_global->__pyx_n_u_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); __PYX_ERR(33, 249, __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, 249, __pyx_L1_error) }
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_GetAttr3(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_qualname, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 249, __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, 249, __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) != (0)) __PYX_ERR(33, 249, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_5) != (0)) __PYX_ERR(33, 249, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyUnicode_Join(__pyx_mstate_global->__pyx_kp_u__2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 249, __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":250
 *                 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, 250, __pyx_L1_error) }
    __pyx_t_4 = ((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_cls);
    __Pyx_INCREF(__pyx_t_4);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_klass)) { __Pyx_RaiseClosureNameError("klass"); __PYX_ERR(33, 250, __pyx_L1_error) }
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_name_, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_klass};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_Event, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(33, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = NULL;
    __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 250, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 250, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __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":251
 *                     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, 251, __pyx_L8_error) }
          __pyx_t_5 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(33, 251, __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, 251, __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":250
 *                 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_3) < 0) __PYX_ERR(33, 250, __pyx_L10_except_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_3);
          __pyx_t_2 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(33, 250, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 250, __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, 250, __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_3);
            __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_5, __pyx_t_3);
            __pyx_t_4 = 0;  __pyx_t_5 = 0;  __pyx_t_3 = 0; 
            __PYX_ERR(33, 250, __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_3); __pyx_t_3 = 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_mstate_global->__pyx_tuple[4], NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 250, __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_mstate_global->__pyx_tuple[4], NULL);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(33, 250, __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":244
 *         """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":243
 *     def EventDecorator(cls, name=None, klass=None) -> Any:
 *         """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;
  size_t __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator, __pyx_mstate_global->__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, 243, __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":244
 *         """Decorate a function with a `PETSc` event."""
 *         def decorator(func):
 *             @functools.wraps(func)             # <<<<<<<<<<<<<<
 *             def wrapped_func(*args, **kwargs):
 *                 if name:
*/
  __pyx_t_2 = NULL;
  __pyx_t_4 = __pyx_v_8petsc4py_5PETSc_functools;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_func};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_wraps, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(33, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_14EventDecorator_9decorator_1wrapped_func, 0, __pyx_mstate_global->__pyx_n_u_EventDecorator_locals_decorator, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(33, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_wrapped_func = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Log.pyx":252
 *                 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":243
 *     def EventDecorator(cls, name=None, klass=None) -> Any:
 *         """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":240
 *         return cputime
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def EventDecorator(cls, name=None, klass=None) -> Any:
 *         """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_mstate_global->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator, __pyx_mstate_global->__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, 240, __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":243
 *     def EventDecorator(cls, name=None, klass=None) -> Any:
 *         """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_mstate_global->__pyx_n_u_EventDecorator_locals_decorator_2, ((PyObject*)__pyx_cur_scope), __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_decorator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Log.pyx":253
 *                     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":240
 *         return cputime
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def EventDecorator(cls, name=None, klass=None) -> Any:
 *         """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":255
 *         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:255");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Log_23isActive = {"isActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_23isActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_22isActive};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isActive", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":266
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(PetscLogIsActive(&flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/Log.pyx":267
 *         """
 *         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, 267, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":268
 *         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, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":255
 *         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":279
 *     property id:
 *         """The log stage identifier."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.id
 * 
*/

/* 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__", 0);

  /* "petsc4py/PETSc/Log.pyx":280
 *         """The log stage identifier."""
 *         def __get__(self) -> int:
 *             return self.id             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_PetscLogStage(__pyx_v_self->id); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":279
 *     property id:
 *         """The log stage identifier."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.id
 * 
*/

  /* 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":282
 *             return self.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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":283
 * 
 *     def __cinit__(self):
 *         self.id = 0             # <<<<<<<<<<<<<<
 * 
 *     def __int__(self):
*/
  __pyx_v_self->id = 0;

  /* "petsc4py/PETSc/Log.pyx":282
 *             return self.id
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.id = 0
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/Log.pyx":285
 *         self.id = 0
 * 
 *     def __int__(self):             # <<<<<<<<<<<<<<
 *         return <int> 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__", 0);

  /* "petsc4py/PETSc/Log.pyx":286
 * 
 *     def __int__(self):
 *         return <int> self.id             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(((int)__pyx_v_self->id)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":285
 *         self.id = 0
 * 
 *     def __int__(self):             # <<<<<<<<<<<<<<
 *         return <int> 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":288
 *         return <int> 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:288");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogStage_5__enter__ = {"__enter__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_5__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_4__enter__};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__enter__", __pyx_kwds); 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "petsc4py/PETSc/Log.pyx":289
 * 
 *     def __enter__(self):
 *         self.push()             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_push, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Log.pyx":290
 *     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":288
 *         return <int> 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_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":292
 *         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:292");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogStage_7__exit__ = {"__exit__", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_7__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_6__exit__};
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_SIZE
  __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);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__exit__", __pyx_kwds); 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__", 0);

  /* "petsc4py/PETSc/Log.pyx":293
 * 
 *     def __exit__(self, *exc):
 *         self.pop()             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __pyx_t_1 = __Pyx_PyObject_Pop(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Log.pyx":292
 *         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":297
 *     #
 * 
 *     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:297");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogStage_9push = {"push", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_9push, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_8push};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("push", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":307
 * 
 *         """
 *         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, 307, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":297
 *     #
 * 
 *     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":309
 *         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:309");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogStage_11pop = {"pop", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_11pop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_10pop};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("pop", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":319
 * 
 *         """
 *         <void>self # unused             # <<<<<<<<<<<<<<
 *         CHKERR(PetscLogStagePop())
 * 
*/
  ((void)__pyx_v_self);

  /* "petsc4py/PETSc/Log.pyx":320
 *         """
 *         <void>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, 320, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":309
 *         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":324
 *     #
 * 
 *     def getName(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the current stage name."""
 *         cdef const char *cval = NULL
*/

/* 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) -> str\nReturn the current stage name.\nSource code at petsc4py/PETSc/Log.pyx:324");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogStage_13getName = {"getName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_13getName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_12getName};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getName", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":326
 *     def getName(self) -> str:
 *         """Return the current stage name."""
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscLogStageFindName(self.id, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Log.pyx":327
 *         """Return the current stage name."""
 *         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, 327, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":328
 *         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, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":324
 *     #
 * 
 *     def getName(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the current stage name."""
 *         cdef const char *cval = NULL
*/

  /* 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":332
 *     property name:
 *         """The current stage name."""
 *         def __get__(self) -> str:             # <<<<<<<<<<<<<<
 *             return self.getName()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Log.pyx":333
 *         """The current stage name."""
 *         def __get__(self) -> str:
 *             return self.getName()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getName, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":332
 *     property name:
 *         """The current stage name."""
 *         def __get__(self) -> str:             # <<<<<<<<<<<<<<
 *             return self.getName()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":335
 *             return self.getName()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             <void>self; <void>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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Log.pyx":336
 * 
 *         def __set__(self, value):
 *             <void>self; <void>value # unused             # <<<<<<<<<<<<<<
 *             raise TypeError("readonly attribute")
 * 
*/
  ((void)__pyx_v_self);
  ((void)__pyx_v_value);

  /* "petsc4py/PETSc/Log.pyx":337
 *         def __set__(self, value):
 *             <void>self; <void>value # unused
 *             raise TypeError("readonly attribute")             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_readonly_attribute};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 337, __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, 337, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":335
 *             return self.getName()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             <void>self; <void>value # unused
 *             raise TypeError("readonly attribute")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":341
 *     #
 * 
 *     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:341");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogStage_15activate = {"activate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_15activate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_14activate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("activate", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":351
 * 
 *         """
 *         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, 351, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":341
 *     #
 * 
 *     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":353
 *         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:353");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogStage_17deactivate = {"deactivate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_17deactivate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_16deactivate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("deactivate", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":363
 * 
 *         """
 *         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, 363, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":353
 *         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":365
 *         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:365");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogStage_19getActive = {"getActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_19getActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_18getActive};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getActive", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":375
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(PetscLogStageGetActive(self.id, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/Log.pyx":376
 *         """
 *         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, 376, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":377
 *         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, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":365
 *         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":379
 *         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:379");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogStage_21setActive = {"setActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_21setActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_20setActive};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 379, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 379, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setActive", 0) < (0)) __PYX_ERR(33, 379, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setActive", 1, 1, 1, i); __PYX_ERR(33, 379, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 379, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setActive", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 379, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Log.pyx":389
 * 
 *         """
 *         cdef PetscBool tval = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         if flag: tval = PETSC_TRUE
 *         CHKERR(PetscLogStageSetActive(self.id, tval))
*/
  __pyx_v_tval = PETSC_FALSE;

  /* "petsc4py/PETSc/Log.pyx":390
 *         """
 *         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, 390, __pyx_L1_error)
  if (__pyx_t_1) {
    __pyx_v_tval = PETSC_TRUE;
  }

  /* "petsc4py/PETSc/Log.pyx":391
 *         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, 391, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":379
 *         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":395
 *     property active:
 *         """Whether the stage is activate."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getActive()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Log.pyx":396
 *         """Whether the stage is activate."""
 *         def __get__(self) -> bool:
 *             return self.getActive()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getActive, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":395
 *     property active:
 *         """Whether the stage is activate."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getActive()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":398
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Log.pyx":399
 * 
 *         def __set__(self, value):
 *             self.setActive(value)             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setActive, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Log.pyx":398
 *             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_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":403
 *     #
 * 
 *     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:403");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogStage_23getVisible = {"getVisible", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_23getVisible, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_22getVisible};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getVisible", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":413
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(PetscLogStageGetVisible(self.id, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/Log.pyx":414
 *         """
 *         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, 414, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":415
 *         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, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":403
 *     #
 * 
 *     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":417
 *         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:417");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogStage_25setVisible = {"setVisible", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_25setVisible, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_24setVisible};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 417, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 417, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setVisible", 0) < (0)) __PYX_ERR(33, 417, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setVisible", 1, 1, 1, i); __PYX_ERR(33, 417, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 417, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setVisible", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 417, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Log.pyx":432
 * 
 *         """
 *         cdef PetscBool tval = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         if flag: tval = PETSC_TRUE
 *         CHKERR(PetscLogStageSetVisible(self.id, tval))
*/
  __pyx_v_tval = PETSC_FALSE;

  /* "petsc4py/PETSc/Log.pyx":433
 *         """
 *         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, 433, __pyx_L1_error)
  if (__pyx_t_1) {
    __pyx_v_tval = PETSC_TRUE;
  }

  /* "petsc4py/PETSc/Log.pyx":434
 *         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, 434, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":417
 *         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":438
 *     property visible:
 *         """Whether the stage is visible."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getVisible()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Log.pyx":439
 *         """Whether the stage is visible."""
 *         def __get__(self) -> bool:
 *             return self.getVisible()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getVisible, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":438
 *     property visible:
 *         """Whether the stage is visible."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getVisible()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":441
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Log.pyx":442
 * 
 *         def __set__(self, value):
 *             self.setVisible(value)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setVisible, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Log.pyx":441
 *             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_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":447
 * 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", 0);

  /* "petsc4py/PETSc/Log.pyx":448
 * 
 * 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, 448, __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, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogStage))))) __PYX_ERR(33, 448, __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":447
 * 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":450
 *     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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reg_LogStage", 0);

  /* "petsc4py/PETSc/Log.pyx":451
 * 
 * cdef LogStage reg_LogStage(object name, PetscLogStage stageid):
 *     cdef LogStage stage = LogStage()             # <<<<<<<<<<<<<<
 *     stage.id = stageid
 *     stage_registry[name] = stage
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogStage, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 451, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_stage = ((struct __pyx_obj_8petsc4py_5PETSc_LogStage *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Log.pyx":452
 * 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":453
 *     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, 453, __pyx_L1_error)
  }
  if (unlikely((PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_stage_registry, __pyx_v_name, ((PyObject *)__pyx_v_stage)) < 0))) __PYX_ERR(33, 453, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":454
 *     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":450
 *     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_XDECREF(__pyx_t_2);
  __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":465
 *     property id:
 *         """The log class identifier."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.id
 * 
*/

/* 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__", 0);

  /* "petsc4py/PETSc/Log.pyx":466
 *         """The log class identifier."""
 *         def __get__(self) -> int:
 *             return self.id             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_PetscClassId(__pyx_v_self->id); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":465
 *     property id:
 *         """The log class identifier."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.id
 * 
*/

  /* 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":468
 *             return self.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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":469
 * 
 *     def __cinit__(self):
 *         self.id = PETSC_OBJECT_CLASSID             # <<<<<<<<<<<<<<
 * 
 *     def __int__(self):
*/
  __pyx_v_self->id = PETSC_OBJECT_CLASSID;

  /* "petsc4py/PETSc/Log.pyx":468
 *             return self.id
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.id = PETSC_OBJECT_CLASSID
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/Log.pyx":471
 *         self.id = PETSC_OBJECT_CLASSID
 * 
 *     def __int__(self):             # <<<<<<<<<<<<<<
 *         return <int> 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__", 0);

  /* "petsc4py/PETSc/Log.pyx":472
 * 
 *     def __int__(self):
 *         return <int> self.id             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(((int)__pyx_v_self->id)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":471
 *         self.id = PETSC_OBJECT_CLASSID
 * 
 *     def __int__(self):             # <<<<<<<<<<<<<<
 *         return <int> 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":476
 *     #
 * 
 *     def getName(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the log class name."""
 *         cdef const char *cval = NULL
*/

/* 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) -> str\nReturn the log class name.\nSource code at petsc4py/PETSc/Log.pyx:476");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogClass_5getName = {"getName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_5getName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_4getName};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getName", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":478
 *     def getName(self) -> str:
 *         """Return the log class name."""
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscLogClassFindName(self.id, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Log.pyx":479
 *         """Return the log class name."""
 *         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, 479, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":480
 *         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, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":476
 *     #
 * 
 *     def getName(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the log class name."""
 *         cdef const char *cval = NULL
*/

  /* 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":484
 *     property name:
 *         """The log class name."""
 *         def __get__(self) -> str:             # <<<<<<<<<<<<<<
 *             return self.getName()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Log.pyx":485
 *         """The log class name."""
 *         def __get__(self) -> str:
 *             return self.getName()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getName, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":484
 *     property name:
 *         """The log class name."""
 *         def __get__(self) -> str:             # <<<<<<<<<<<<<<
 *             return self.getName()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":487
 *             return self.getName()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             <void>self; <void>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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Log.pyx":488
 * 
 *         def __set__(self, value):
 *             <void>self; <void>value # unused             # <<<<<<<<<<<<<<
 *             raise TypeError("readonly attribute")
 * 
*/
  ((void)__pyx_v_self);
  ((void)__pyx_v_value);

  /* "petsc4py/PETSc/Log.pyx":489
 *         def __set__(self, value):
 *             <void>self; <void>value # unused
 *             raise TypeError("readonly attribute")             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_readonly_attribute};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 489, __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, 489, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":487
 *             return self.getName()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             <void>self; <void>value # unused
 *             raise TypeError("readonly attribute")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":493
 *     #
 * 
 *     def activate(self) -> None:             # <<<<<<<<<<<<<<
 *         """Activate the log class."""
 *         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) -> None\nActivate the log class.\nSource code at petsc4py/PETSc/Log.pyx:493");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogClass_7activate = {"activate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_7activate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_6activate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("activate", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":495
 *     def activate(self) -> None:
 *         """Activate the log class."""
 *         CHKERR(PetscLogClassActivate(self.id))             # <<<<<<<<<<<<<<
 * 
 *     def deactivate(self) -> None:
*/
  __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, 495, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":493
 *     #
 * 
 *     def activate(self) -> None:             # <<<<<<<<<<<<<<
 *         """Activate the log class."""
 *         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":497
 *         CHKERR(PetscLogClassActivate(self.id))
 * 
 *     def deactivate(self) -> None:             # <<<<<<<<<<<<<<
 *         """Deactivate the log class."""
 *         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) -> None\nDeactivate the log class.\nSource code at petsc4py/PETSc/Log.pyx:497");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogClass_9deactivate = {"deactivate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_9deactivate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_8deactivate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("deactivate", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":499
 *     def deactivate(self) -> None:
 *         """Deactivate the log class."""
 *         CHKERR(PetscLogClassDeactivate(self.id))             # <<<<<<<<<<<<<<
 * 
 *     def getActive(self) -> bool:
*/
  __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, 499, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":497
 *         CHKERR(PetscLogClassActivate(self.id))
 * 
 *     def deactivate(self) -> None:             # <<<<<<<<<<<<<<
 *         """Deactivate the log class."""
 *         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":501
 *         CHKERR(PetscLogClassDeactivate(self.id))
 * 
 *     def getActive(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         <void>self # unused
*/

/* 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) -> bool\nNot implemented.\nSource code at petsc4py/PETSc/Log.pyx:501");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogClass_11getActive = {"getActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_11getActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_10getActive};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getActive", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":503
 *     def getActive(self) -> bool:
 *         """Not implemented."""
 *         <void>self # unused             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
*/
  ((void)__pyx_v_self);

  /* "petsc4py/PETSc/Log.pyx":504
 *         """Not implemented."""
 *         <void>self # unused
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def setActive(self, flag: bool) -> None:
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(33, 504, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":501
 *         CHKERR(PetscLogClassDeactivate(self.id))
 * 
 *     def getActive(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         <void>self # unused
*/

  /* 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":506
 *         raise NotImplementedError
 * 
 *     def setActive(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Activate or deactivate the log class."""
 *         if flag:
*/

/* 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: bool) -> None\nActivate or deactivate the log class.\nSource code at petsc4py/PETSc/Log.pyx:506");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogClass_13setActive = {"setActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_13setActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_12setActive};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 506, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setActive", 0) < (0)) __PYX_ERR(33, 506, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setActive", 1, 1, 1, i); __PYX_ERR(33, 506, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 506, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setActive", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 506, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Log.pyx":508
 *     def setActive(self, flag: bool) -> None:
 *         """Activate or deactivate the log class."""
 *         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, 508, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Log.pyx":509
 *         """Activate or deactivate the log class."""
 *         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, 509, __pyx_L1_error)

    /* "petsc4py/PETSc/Log.pyx":508
 *     def setActive(self, flag: bool) -> None:
 *         """Activate or deactivate the log class."""
 *         if flag:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscLogClassActivate(self.id))
 *         else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Log.pyx":511
 *             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, 511, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Log.pyx":506
 *         raise NotImplementedError
 * 
 *     def setActive(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Activate or deactivate the log class."""
 *         if flag:
*/

  /* 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":515
 *     property active:
 *         """Log class activation."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getActive()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Log.pyx":516
 *         """Log class activation."""
 *         def __get__(self) -> bool:
 *             return self.getActive()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getActive, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":515
 *     property active:
 *         """Log class activation."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getActive()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":518
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Log.pyx":519
 * 
 *         def __set__(self, value):
 *             self.setActive(value)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setActive, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Log.pyx":518
 *             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_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":524
 * 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", 0);

  /* "petsc4py/PETSc/Log.pyx":525
 * 
 * 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, 525, __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, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogClass))))) __PYX_ERR(33, 525, __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":524
 * 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":527
 *     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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reg_LogClass", 0);

  /* "petsc4py/PETSc/Log.pyx":528
 * 
 * cdef LogClass reg_LogClass(object name, PetscLogClass classid):
 *     cdef LogClass klass = LogClass()             # <<<<<<<<<<<<<<
 *     klass.id = classid
 *     class_registry[name] = klass
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogClass, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 528, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_klass = ((struct __pyx_obj_8petsc4py_5PETSc_LogClass *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Log.pyx":529
 * 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":530
 *     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, 530, __pyx_L1_error)
  }
  if (unlikely((PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_class_registry, __pyx_v_name, ((PyObject *)__pyx_v_klass)) < 0))) __PYX_ERR(33, 530, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":531
 *     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":527
 *     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_XDECREF(__pyx_t_2);
  __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":542
 *     property id:
 *         """The log event identifier."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.id
 * 
*/

/* 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__", 0);

  /* "petsc4py/PETSc/Log.pyx":543
 *         """The log event identifier."""
 *         def __get__(self) -> int:
 *             return self.id             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_PetscLogEvent(__pyx_v_self->id); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":542
 *     property id:
 *         """The log event identifier."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.id
 * 
*/

  /* 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":545
 *             return self.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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":546
 * 
 *     def __cinit__(self):
 *         self.id = 0             # <<<<<<<<<<<<<<
 * 
 *     def __int__(self):
*/
  __pyx_v_self->id = 0;

  /* "petsc4py/PETSc/Log.pyx":545
 *             return self.id
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.id = 0
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/Log.pyx":548
 *         self.id = 0
 * 
 *     def __int__(self):             # <<<<<<<<<<<<<<
 *         return <int> 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__", 0);

  /* "petsc4py/PETSc/Log.pyx":549
 * 
 *     def __int__(self):
 *         return <int> self.id             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_From_int(((int)__pyx_v_self->id)); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":548
 *         self.id = 0
 * 
 *     def __int__(self):             # <<<<<<<<<<<<<<
 *         return <int> 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":551
 *         return <int> 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:551");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogEvent_5__enter__ = {"__enter__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_5__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_4__enter__};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__enter__", __pyx_kwds); 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "petsc4py/PETSc/Log.pyx":552
 * 
 *     def __enter__(self):
 *         self.begin()             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_begin, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 552, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Log.pyx":553
 *     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":551
 *         return <int> 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_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":555
 *         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:555");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogEvent_7__exit__ = {"__exit__", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_7__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_6__exit__};
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_SIZE
  __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);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__exit__", __pyx_kwds); 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "petsc4py/PETSc/Log.pyx":556
 * 
 *     def __exit__(self, *exc):
 *         self.end()             # <<<<<<<<<<<<<<
 * 
 *     def begin(self, *objs) -> None:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_end, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Log.pyx":555
 *         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_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":558
 *         self.end()
 * 
 *     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:558");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogEvent_9begin = {"begin", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_9begin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_8begin};
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_SIZE
  __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);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("begin", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":574
 *         """
 *         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, 574, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":575
 *         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, 575, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":558
 *         self.end()
 * 
 *     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":577
 *         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:577");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogEvent_11end = {"end", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_11end, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_10end};
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_SIZE
  __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);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("end", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":593
 *         """
 *         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, 593, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":594
 *         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, 594, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":577
 *         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":597
 * 
 *     #
 *     def getName(self) -> str:             # <<<<<<<<<<<<<<
 *         """The current event name."""
 *         cdef const char *cval = NULL
*/

/* 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) -> str\nThe current event name.\nSource code at petsc4py/PETSc/Log.pyx:597");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogEvent_13getName = {"getName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_13getName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_12getName};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getName", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":599
 *     def getName(self) -> str:
 *         """The current event name."""
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscLogEventFindName(self.id, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Log.pyx":600
 *         """The current event name."""
 *         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, 600, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":601
 *         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, 601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":597
 * 
 *     #
 *     def getName(self) -> str:             # <<<<<<<<<<<<<<
 *         """The current event name."""
 *         cdef const char *cval = NULL
*/

  /* 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":605
 *     property name:
 *         """The current event name."""
 *         def __get__(self) ->str:             # <<<<<<<<<<<<<<
 *             return self.getName()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Log.pyx":606
 *         """The current event name."""
 *         def __get__(self) ->str:
 *             return self.getName()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getName, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":605
 *     property name:
 *         """The current event name."""
 *         def __get__(self) ->str:             # <<<<<<<<<<<<<<
 *             return self.getName()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":608
 *             return self.getName()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             <void>self; <void>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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Log.pyx":609
 * 
 *         def __set__(self, value):
 *             <void>self; <void>value # unused             # <<<<<<<<<<<<<<
 *             raise TypeError("readonly attribute")
 * 
*/
  ((void)__pyx_v_self);
  ((void)__pyx_v_value);

  /* "petsc4py/PETSc/Log.pyx":610
 *         def __set__(self, value):
 *             <void>self; <void>value # unused
 *             raise TypeError("readonly attribute")             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_readonly_attribute};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 610, __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, 610, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":608
 *             return self.getName()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             <void>self; <void>value # unused
 *             raise TypeError("readonly attribute")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":614
 *     #
 * 
 *     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:614");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogEvent_15activate = {"activate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_15activate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_14activate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("activate", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":624
 * 
 *         """
 *         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, 624, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":614
 *     #
 * 
 *     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":626
 *         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:626");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogEvent_17deactivate = {"deactivate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_17deactivate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_16deactivate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("deactivate", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":636
 * 
 *         """
 *         CHKERR(PetscLogEventDeactivate(self.id))             # <<<<<<<<<<<<<<
 * 
 *     def getActive(self) -> bool:
*/
  __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, 636, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":626
 *         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":638
 *         CHKERR(PetscLogEventDeactivate(self.id))
 * 
 *     def getActive(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         <void>self # unused
*/

/* 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) -> bool\nNot implemented.\nSource code at petsc4py/PETSc/Log.pyx:638");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogEvent_19getActive = {"getActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_19getActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_18getActive};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getActive", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":640
 *     def getActive(self) -> bool:
 *         """Not implemented."""
 *         <void>self # unused             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
*/
  ((void)__pyx_v_self);

  /* "petsc4py/PETSc/Log.pyx":641
 *         """Not implemented."""
 *         <void>self # unused
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def setActive(self, flag: bool) -> None:
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(33, 641, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":638
 *         CHKERR(PetscLogEventDeactivate(self.id))
 * 
 *     def getActive(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         <void>self # unused
*/

  /* 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":643
 *         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:643");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogEvent_21setActive = {"setActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_21setActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_20setActive};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 643, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 643, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setActive", 0) < (0)) __PYX_ERR(33, 643, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setActive", 1, 1, 1, i); __PYX_ERR(33, 643, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 643, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setActive", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 643, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Log.pyx":658
 * 
 *         """
 *         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, 658, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Log.pyx":659
 *         """
 *         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, 659, __pyx_L1_error)

    /* "petsc4py/PETSc/Log.pyx":658
 * 
 *         """
 *         if flag:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscLogEventActivate(self.id))
 *         else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Log.pyx":661
 *             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, 661, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Log.pyx":643
 *         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":665
 *     property active:
 *         """Event activation."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getActive()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Log.pyx":666
 *         """Event activation."""
 *         def __get__(self) -> bool:
 *             return self.getActive()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getActive, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":665
 *     property active:
 *         """Event activation."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getActive()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":668
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Log.pyx":669
 * 
 *         def __set__(self, value):
 *             self.setActive(value)             # <<<<<<<<<<<<<<
 * 
 *     def getActiveAll(self) -> bool:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setActive, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Log.pyx":668
 *             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_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":671
 *             self.setActive(value)
 * 
 *     def getActiveAll(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         <void>self # unused
*/

/* 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) -> bool\nNot implemented.\nSource code at petsc4py/PETSc/Log.pyx:671");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogEvent_23getActiveAll = {"getActiveAll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_23getActiveAll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_22getActiveAll};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getActiveAll", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Log.pyx":673
 *     def getActiveAll(self) -> bool:
 *         """Not implemented."""
 *         <void>self # unused             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
*/
  ((void)__pyx_v_self);

  /* "petsc4py/PETSc/Log.pyx":674
 *         """Not implemented."""
 *         <void>self # unused
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def setActiveAll(self, flag: bool) -> None:
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(33, 674, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":671
 *             self.setActive(value)
 * 
 *     def getActiveAll(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         <void>self # unused
*/

  /* 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":676
 *         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:676");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogEvent_25setActiveAll = {"setActiveAll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_25setActiveAll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_24setActiveAll};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 676, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 676, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setActiveAll", 0) < (0)) __PYX_ERR(33, 676, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setActiveAll", 1, 1, 1, i); __PYX_ERR(33, 676, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 676, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setActiveAll", 1, 1, 1, __pyx_nargs); __PYX_ERR(33, 676, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Log.pyx":691
 * 
 *         """
 *         cdef PetscBool tval = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         if flag: tval = PETSC_TRUE
 *         CHKERR(PetscLogEventSetActiveAll(self.id, tval))
*/
  __pyx_v_tval = PETSC_FALSE;

  /* "petsc4py/PETSc/Log.pyx":692
 *         """
 *         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, 692, __pyx_L1_error)
  if (__pyx_t_1) {
    __pyx_v_tval = PETSC_TRUE;
  }

  /* "petsc4py/PETSc/Log.pyx":693
 *         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, 693, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":676
 *         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":697
 *     property active_all:
 *         """All events activation."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             self.getActiveAll()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Log.pyx":698
 *         """All events activation."""
 *         def __get__(self) -> bool:
 *             self.getActiveAll()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getActiveAll, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Log.pyx":697
 *     property active_all:
 *         """All events activation."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             self.getActiveAll()
 * 
*/

  /* 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.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":700
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Log.pyx":701
 * 
 *         def __set__(self, value):
 *             self.setActiveAll(value)             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setActiveAll, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Log.pyx":700
 *             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_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":705
 *     #
 * 
 *     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:705");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_8LogEvent_27getPerfInfo = {"getPerfInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_27getPerfInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_26getPerfInfo};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_stage,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(33, 705, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getPerfInfo", 0) < (0)) __PYX_ERR(33, 705, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(33, 705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_stage = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getPerfInfo", 0, 0, 1, __pyx_nargs); __PYX_ERR(33, 705, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Log.pyx":726
 *         """
 *         cdef PetscEventPerfInfo info
 *         cdef PetscInt cstage = PETSC_DETERMINE             # <<<<<<<<<<<<<<
 *         if stage is not None: cstage = asInt(stage)
 *         CHKERR(PetscLogEventGetPerfInfo(<int>cstage, self.id, &info))
*/
  __pyx_v_cstage = PETSC_DETERMINE;

  /* "petsc4py/PETSc/Log.pyx":727
 *         cdef PetscEventPerfInfo info
 *         cdef PetscInt cstage = PETSC_DETERMINE
 *         if stage is not None: cstage = asInt(stage)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscLogEventGetPerfInfo(<int>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, 727, __pyx_L1_error)
    __pyx_v_cstage = __pyx_t_2;
  }

  /* "petsc4py/PETSc/Log.pyx":728
 *         cdef PetscInt cstage = PETSC_DETERMINE
 *         if stage is not None: cstage = asInt(stage)
 *         CHKERR(PetscLogEventGetPerfInfo(<int>cstage, self.id, &info))             # <<<<<<<<<<<<<<
 *         return info
 * 
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscLogEventGetPerfInfo(((int)__pyx_v_cstage), __pyx_v_self->id, (&__pyx_v_info))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(33, 728, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":729
 *         if stage is not None: cstage = asInt(stage)
 *         CHKERR(PetscLogEventGetPerfInfo(<int>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, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Log.pyx":705
 *     #
 * 
 *     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":733
 * 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", 0);

  /* "petsc4py/PETSc/Log.pyx":734
 * 
 * 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, 734, __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, 734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogEvent))))) __PYX_ERR(33, 734, __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":733
 * 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":736
 *     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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reg_LogEvent", 0);

  /* "petsc4py/PETSc/Log.pyx":737
 * 
 * cdef LogEvent reg_LogEvent(object name, PetscLogEvent eventid):
 *     cdef LogEvent event = LogEvent()             # <<<<<<<<<<<<<<
 *     event.id = eventid
 *     event_registry[name] = event
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogEvent, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 737, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_event = ((struct __pyx_obj_8petsc4py_5PETSc_LogEvent *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Log.pyx":738
 * 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":739
 *     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, 739, __pyx_L1_error)
  }
  if (unlikely((PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_event_registry, __pyx_v_name, ((PyObject *)__pyx_v_event)) < 0))) __PYX_ERR(33, 739, __pyx_L1_error)

  /* "petsc4py/PETSc/Log.pyx":740
 *     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":736
 *     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_XDECREF(__pyx_t_2);
  __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_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(34, 23, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(34, 23, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(34, 23, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(34, 23, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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__", 0);

  /* "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 const )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__", 0);

  /* "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;
  PyObject *__pyx_t_4 = NULL;
  size_t __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("__richcmp__", 0);

  /* "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_mstate_global->__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_mstate_global->__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_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_only_and};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      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
*/
  __pyx_t_3 = __pyx_v_other;
  __Pyx_INCREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm))))) __PYX_ERR(34, 43, __pyx_L1_error)
  __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_6 = __pyx_v_s->comm;
  __pyx_v_comm1 = __pyx_t_6;

  /* "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_6 = __pyx_v_o->comm;
  __pyx_v_comm2 = __pyx_t_6;

  /* "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(<PetscErrorCode>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(<PetscErrorCode>MPI_Comm_compare(comm1, comm2, &flag))
 *             if eq: return (flag==<int>MPI_IDENT or  flag==<int>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(<PetscErrorCode>MPI_Comm_compare(comm1, comm2, &flag))             # <<<<<<<<<<<<<<
 *             if eq: return (flag==<int>MPI_IDENT or  flag==<int>MPI_CONGRUENT)
 *             else:  return (flag!=<int>MPI_IDENT and flag!=<int>MPI_CONGRUENT)
*/
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(((PetscErrorCode)MPI_Comm_compare(__pyx_v_comm1, __pyx_v_comm2, (&__pyx_v_flag)))); if (unlikely(__pyx_t_7 == ((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(<PetscErrorCode>MPI_Comm_compare(comm1, comm2, &flag))
 *             if eq: return (flag==<int>MPI_IDENT or  flag==<int>MPI_CONGRUENT)             # <<<<<<<<<<<<<<
 *             else:  return (flag!=<int>MPI_IDENT and flag!=<int>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_4 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 50, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L12_bool_binop_done;
      }
      __pyx_t_1 = (__pyx_v_flag == ((int)MPI_CONGRUENT));
      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __pyx_t_4 = 0;
      __pyx_L12_bool_binop_done:;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/Comm.pyx":51
 *             CHKERR(<PetscErrorCode>MPI_Comm_compare(comm1, comm2, &flag))
 *             if eq: return (flag==<int>MPI_IDENT or  flag==<int>MPI_CONGRUENT)
 *             else:  return (flag!=<int>MPI_IDENT and flag!=<int>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_4 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 51, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __pyx_t_4;
        __pyx_t_4 = 0;
        goto __pyx_L14_bool_binop_done;
      }
      __pyx_t_1 = (__pyx_v_flag != ((int)MPI_CONGRUENT));
      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(34, 51, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __pyx_t_4 = 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(<PetscErrorCode>MPI_Comm_compare(comm1, comm2, &flag))
 *             if eq: return (flag==<int>MPI_IDENT or  flag==<int>MPI_CONGRUENT)
*/
  }

  /* "petsc4py/PETSc/Comm.pyx":53
 *             else:  return (flag!=<int>MPI_IDENT and flag!=<int>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_4);
  __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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4Comm_9destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_9destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_8destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroy", 0);

  /* "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_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_communicator_not_owned};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscCommDestroy((&__pyx_v_self->comm))); if (unlikely(__pyx_t_5 == ((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_XDECREF(__pyx_t_3);
  __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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4Comm_11duplicate = {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_11duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_10duplicate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("duplicate", __pyx_kwds); 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;
  PyObject *__pyx_t_3 = NULL;
  size_t __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("duplicate", 0);

  /* "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_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_null_communicator};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscCommDuplicate(__pyx_v_self->comm, (&__pyx_v_newcomm), NULL)); if (unlikely(__pyx_t_5 == ((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_t_3 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_6 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(34, 93, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__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_3);
  __Pyx_XDECREF(__pyx_t_6);
  __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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4Comm_13getSize = {"getSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_13getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_12getSize};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSize", __pyx_kwds); 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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getSize", 0);

  /* "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_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_null_communicator};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      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_5 = __pyx_f_8petsc4py_5PETSc_CHKERRMPI(MPI_Comm_size(__pyx_v_self->comm, (&__pyx_v_size))); if (unlikely(__pyx_t_5 == ((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_PyLong_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_XDECREF(__pyx_t_3);
  __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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4Comm_15getRank = {"getRank", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_15getRank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_14getRank};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getRank", __pyx_kwds); 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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getRank", 0);

  /* "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_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_null_communicator};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      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_5 = __pyx_f_8petsc4py_5PETSc_CHKERRMPI(MPI_Comm_rank(__pyx_v_self->comm, (&__pyx_v_rank))); if (unlikely(__pyx_t_5 == ((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_PyLong_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_XDECREF(__pyx_t_3);
  __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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4Comm_17barrier = {"barrier", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_17barrier, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_16barrier};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("barrier", __pyx_kwds); 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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("barrier", 0);

  /* "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_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_null_communicator};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      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_5 = __pyx_f_8petsc4py_5PETSc_CHKERRMPI(MPI_Barrier(__pyx_v_self->comm)); if (unlikely(__pyx_t_5 == ((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_XDECREF(__pyx_t_3);
  __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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Comm.pyx":138
 *         """Communicator size."""
 *         def __get__(self) -> int:
 *             return self.getSize()             # <<<<<<<<<<<<<<
 * 
 *     property rank:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSize, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __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_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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Comm.pyx":143
 *         """Communicator rank."""
 *         def __get__(self) -> int:
 *             return self.getRank()             # <<<<<<<<<<<<<<
 * 
 *     # --- Fortran support ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getRank, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(34, 143, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __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_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__", 0);

  /* "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_PyLong_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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4Comm_19tompi4py = {"tompi4py", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_19tompi4py, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_18tompi4py};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("tompi4py", __pyx_kwds); 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", 0);

  /* "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 const )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":13
 *     # --- 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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":14
 * 
 *     def __cinit__(self):
 *         self.oval = NULL             # <<<<<<<<<<<<<<
 *         self.obj = &self.oval
 * 
*/
  __pyx_v_self->oval = NULL;

  /* "petsc4py/PETSc/Object.pyx":15
 *     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":13
 *     # --- 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":17
 *         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":18
 * 
 *     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, 18, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":19
 *     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":17
 *         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":21
 *         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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__richcmp__", 0);

  /* "petsc4py/PETSc/Object.pyx":22
 * 
 *     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_mstate_global->__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":23
 *     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_mstate_global->__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":24
 *         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;
  __pyx_t_3 = __pyx_v_other;
  __Pyx_INCREF(__pyx_t_3);
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(35, 24, __pyx_L1_error)
  __pyx_v_o = ((struct PyPetscObjectObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Object.pyx":25
 *         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, 25, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/Object.pyx":26
 *         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, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/Object.pyx":27
 *         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_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_only_and};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 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(35, 27, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Object.pyx":21
 *         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_XDECREF(__pyx_t_4);
  __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":29
 *         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":30
 * 
 *     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":29
 *         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":32
 *         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:32");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_9__copy__ = {"__copy__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_9__copy__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_8__copy__};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__copy__", __pyx_kwds); 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;
  size_t __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__", 0);

  /* "petsc4py/PETSc/Object.pyx":33
 * 
 *     def __copy__(self):
 *         cdef Object obj = type(self)()             # <<<<<<<<<<<<<<
 *         cdef PetscObject o = self.obj[0]
 *         if o != NULL:
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(35, 33, __pyx_L1_error)
  __pyx_v_obj = ((struct PyPetscObjectObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Object.pyx":34
 *     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":35
 *         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":36
 *         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, 36, __pyx_L1_error)

    /* "petsc4py/PETSc/Object.pyx":35
 *         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":37
 *         if o != NULL:
 *             CHKERR(PetscObjectReference(o))
 *         obj.obj[0] = o             # <<<<<<<<<<<<<<
 *         return obj
 * 
*/
  (__pyx_v_obj->obj[0]) = __pyx_v_o;

  /* "petsc4py/PETSc/Object.pyx":38
 *             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":32
 *         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":40
 *         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:40");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_11__deepcopy__ = {"__deepcopy__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_11__deepcopy__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_10__deepcopy__};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_memo,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 40, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 40, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__deepcopy__", 0) < (0)) __PYX_ERR(35, 40, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__deepcopy__", 1, 1, 1, i); __PYX_ERR(35, 40, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 40, __pyx_L3_error)
    }
    __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, 40, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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, 40, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__deepcopy__", 0);

  /* "petsc4py/PETSc/Object.pyx":41
 * 
 *     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":42
 *     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":43
 *         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_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(35, 43, __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":42
 *     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":44
 *         try:
 *             obj_copy = self.copy
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError
 *         <void>memo # unused
*/
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_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, 44, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "petsc4py/PETSc/Object.pyx":45
 *             obj_copy = self.copy
 *         except AttributeError:
 *             raise NotImplementedError             # <<<<<<<<<<<<<<
 *         <void>memo # unused
 *         return obj_copy()
*/
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
      __PYX_ERR(35, 45, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "petsc4py/PETSc/Object.pyx":42
 *     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":46
 *         except AttributeError:
 *             raise NotImplementedError
 *         <void>memo # unused             # <<<<<<<<<<<<<<
 *         return obj_copy()
 * 
*/
  ((void)__pyx_v_memo);

  /* "petsc4py/PETSc/Object.pyx":47
 *             raise NotImplementedError
 *         <void>memo # unused
 *         return obj_copy()             # <<<<<<<<<<<<<<
 * 
 *     # --- attribute management ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = NULL;
  __Pyx_INCREF(__pyx_v_obj_copy);
  __pyx_t_4 = __pyx_v_obj_copy; 
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_6);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_6);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(35, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":40
 *         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":51
 *     # --- 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", 0);

  /* "petsc4py/PETSc/Object.pyx":52
 * 
 *     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, 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
 *     # --- 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":54
 *         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", 0);

  /* "petsc4py/PETSc/Object.pyx":55
 * 
 *     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, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":54
 *         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":57
 *         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", 0);

  /* "petsc4py/PETSc/Object.pyx":58
 * 
 *     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, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":57
 *         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":62
 *     #
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """Display the object.
 * 
*/

/* 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) -> None\nDisplay the 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.PetscObjectView\n\n        \nSource code at petsc4py/PETSc/Object.pyx:62");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_13view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_13view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_12view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 62, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 62, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(35, 62, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 62, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 62, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(35, 62, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Object.pyx":77
 * 
 *         """
 *         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":78
 *         """
 *         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":79
 *         cdef PetscViewer vwr = NULL
 *         if viewer is not None: vwr = viewer.vwr
 *         CHKERR(PetscObjectView(self.obj[0], vwr))             # <<<<<<<<<<<<<<
 * 
 *     def destroy(self) -> 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, 79, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":62
 *     #
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """Display the object.
 * 
*/

  /* 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":81
 *         CHKERR(PetscObjectView(self.obj[0], vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the object.
 * 
*/

/* 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) -> Self\nDestroy the object.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.PetscObjectDestroy\n\n        \nSource code at petsc4py/PETSc/Object.pyx:81");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_15destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_15destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_14destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Object.pyx":91
 * 
 *         """
 *         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, 91, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":92
 *         """
 *         CHKERR(PetscObjectDestroy(&self.obj[0]))
 *         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/Object.pyx":81
 *         CHKERR(PetscObjectView(self.obj[0], vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the object.
 * 
*/

  /* 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":94
 *         return self
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the object type name.
 * 
*/

/* 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) -> str\nReturn the object type name.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PetscObjectGetType\n\n        \nSource code at petsc4py/PETSc/Object.pyx:94");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_17getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_17getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_16getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Object.pyx":104
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetType(self.obj[0], &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Object.pyx":105
 *         """
 *         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, 105, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":106
 *         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, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":94
 *         return self
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the object type name.
 * 
*/

  /* 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":110
 *     #
 * 
 *     def setOptionsPrefix(self, prefix : str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the prefix used for searching for options in the database.
 * 
*/

/* 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: str | None) -> 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.PetscObjectSetOptionsPrefix\n\n        \nSource code at petsc4py/PETSc/Object.pyx:110");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_19setOptionsPrefix = {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_19setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_18setOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 110, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 110, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOptionsPrefix", 0) < (0)) __PYX_ERR(35, 110, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, i); __PYX_ERR(35, 110, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 110, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(35, 110, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":120
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(PetscObjectSetOptionsPrefix(self.obj[0], cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Object.pyx":121
 *         """
 *         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, 121, __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":122
 *         cdef const char *cval = NULL
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(PetscObjectSetOptionsPrefix(self.obj[0], cval))             # <<<<<<<<<<<<<<
 * 
 *     def getOptionsPrefix(self) -> str:
*/
  __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, 122, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":110
 *     #
 * 
 *     def setOptionsPrefix(self, prefix : str | None) -> 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.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":124
 *         CHKERR(PetscObjectSetOptionsPrefix(self.obj[0], cval))
 * 
 *     def getOptionsPrefix(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the prefix used for searching for options in the database.
 * 
*/

/* 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) -> 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.PetscObjectGetOptionsPrefix\n\n        \nSource code at petsc4py/PETSc/Object.pyx:124");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_21getOptionsPrefix = {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_21getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_20getOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOptionsPrefix", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Object.pyx":134
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetOptionsPrefix(self.obj[0], &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Object.pyx":135
 *         """
 *         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, 135, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":136
 *         cdef const char *cval = NULL
 *         CHKERR(PetscObjectGetOptionsPrefix(self.obj[0], &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":124
 *         CHKERR(PetscObjectSetOptionsPrefix(self.obj[0], 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.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":138
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Append to the prefix used for searching for options in the database.
 * 
*/

/* 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: str | None) -> 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.PetscObjectAppendOptionsPrefix\n\n        \nSource code at petsc4py/PETSc/Object.pyx:138");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_23appendOptionsPrefix = {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_23appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_22appendOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 138, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 138, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "appendOptionsPrefix", 0) < (0)) __PYX_ERR(35, 138, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, i); __PYX_ERR(35, 138, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 138, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(35, 138, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":148
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(PetscObjectAppendOptionsPrefix(self.obj[0], cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Object.pyx":149
 *         """
 *         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, 149, __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":150
 *         cdef const char *cval = NULL
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(PetscObjectAppendOptionsPrefix(self.obj[0], cval))             # <<<<<<<<<<<<<<
 * 
 *     def setFromOptions(self) -> None:
*/
  __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, 150, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":138
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> 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.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":152
 *         CHKERR(PetscObjectAppendOptionsPrefix(self.obj[0], cval))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the object from the options database.
 * 
*/

/* 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) -> None\nConfigure the object from the options database.\n\n        Collective.\n\n        Classes that do not implement ``setFromOptions`` use this method\n        that, in turn, calls `petsc.PetscObjectSetFromOptions`.\n\n        See Also\n        --------\n        petsc_options, petsc.PetscObjectSetFromOptions\n\n        \nSource code at petsc4py/PETSc/Object.pyx:152");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_25setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_25setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_24setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Object.pyx":165
 * 
 *         """
 *         CHKERR(PetscObjectSetFromOptions(self.obj[0]))             # <<<<<<<<<<<<<<
 * 
 *     def viewFromOptions(self, name : str, Object objpre=None) -> 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, 165, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":152
 *         CHKERR(PetscObjectAppendOptionsPrefix(self.obj[0], 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.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":167
 *         CHKERR(PetscObjectSetFromOptions(self.obj[0]))
 * 
 *     def viewFromOptions(self, name : str, Object objpre=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the object via command line options.
 * 
*/

/* 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: str, objpre: Object | None = None) -> None\nView the object via command line options.\n\n        Collective.\n\n        Parameters\n        ----------\n        name\n            The command line option.\n        objpre\n            Optional object that provides prefix.\n\n        See Also\n        --------\n        petsc_options, petsc.PetscObjectViewFromOptions\n\n        \nSource code at petsc4py/PETSc/Object.pyx:167");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_27viewFromOptions = {"viewFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_27viewFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_26viewFromOptions};
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_objpre = 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_objpre,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 167, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(35, 167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "viewFromOptions", 0) < (0)) __PYX_ERR(35, 167, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscObjectObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("viewFromOptions", 0, 1, 2, i); __PYX_ERR(35, 167, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(35, 167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 167, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscObjectObject *)Py_None));
    }
    __pyx_v_name = values[0];
    __pyx_v_objpre = ((struct PyPetscObjectObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("viewFromOptions", 0, 1, 2, __pyx_nargs); __PYX_ERR(35, 167, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_objpre), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, 1, "objpre", 0))) __PYX_ERR(35, 167, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_26viewFromOptions(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name, __pyx_v_objpre);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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_objpre) {
  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":184
 * 
 *         """
 *         cdef PetscObject pobj = NULL             # <<<<<<<<<<<<<<
 *         cdef const char *cval = NULL
 *         pobj = objpre.obj[0] if objpre is not None else NULL
*/
  __pyx_v_pobj = NULL;

  /* "petsc4py/PETSc/Object.pyx":185
 *         """
 *         cdef PetscObject pobj = NULL
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         pobj = objpre.obj[0] if objpre is not None else NULL
 *         name = str2bytes(name, &cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Object.pyx":186
 *         cdef PetscObject pobj = NULL
 *         cdef const char *cval = NULL
 *         pobj = objpre.obj[0] if objpre is not None else NULL             # <<<<<<<<<<<<<<
 *         name = str2bytes(name, &cval)
 *         CHKERR(PetscObjectViewFromOptions(self.obj[0], pobj, cval))
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_objpre) != Py_None);
  if (__pyx_t_2) {
    __pyx_t_1 = (__pyx_v_objpre->obj[0]);
  } else {
    __pyx_t_1 = NULL;
  }
  __pyx_v_pobj = __pyx_t_1;

  /* "petsc4py/PETSc/Object.pyx":187
 *         cdef const char *cval = NULL
 *         pobj = objpre.obj[0] if objpre 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, 187, __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":188
 *         pobj = objpre.obj[0] if objpre is not None else NULL
 *         name = str2bytes(name, &cval)
 *         CHKERR(PetscObjectViewFromOptions(self.obj[0], pobj, cval))             # <<<<<<<<<<<<<<
 * 
 *     def setOptionsHandler(self, handler: PetscOptionsHandlerFunction | None) -> None:
*/
  __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, 188, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":167
 *         CHKERR(PetscObjectSetFromOptions(self.obj[0]))
 * 
 *     def viewFromOptions(self, name : str, Object objpre=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the object via command line options.
 * 
*/

  /* 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":190
 *         CHKERR(PetscObjectViewFromOptions(self.obj[0], pobj, cval))
 * 
 *     def setOptionsHandler(self, handler: PetscOptionsHandlerFunction | None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback for processing extra options.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_29setOptionsHandler(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_28setOptionsHandler, "Object.setOptionsHandler(self, handler: PetscOptionsHandlerFunction | None) -> None\nSet the callback for processing extra options.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        handler\n            The callback function, called at the end of a ``setFromOptions`` invocation\n            for the given class.\n\n        See Also\n        --------\n        petsc_options, Mat.setFromOptions, KSP.setFromOptions\n        petsc.PetscObjectAddOptionsHandler\n\n        \nSource code at petsc4py/PETSc/Object.pyx:190");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_29setOptionsHandler = {"setOptionsHandler", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_29setOptionsHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_28setOptionsHandler};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_29setOptionsHandler(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_handler = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setOptionsHandler (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handler,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 190, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 190, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOptionsHandler", 0) < (0)) __PYX_ERR(35, 190, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setOptionsHandler", 1, 1, 1, i); __PYX_ERR(35, 190, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 190, __pyx_L3_error)
    }
    __pyx_v_handler = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setOptionsHandler", 1, 1, 1, __pyx_nargs); __PYX_ERR(35, 190, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Object.setOptionsHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_28setOptionsHandler(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_handler);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_28setOptionsHandler(struct PyPetscObjectObject *__pyx_v_self, PyObject *__pyx_v_handler) {
  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("setOptionsHandler", 0);

  /* "petsc4py/PETSc/Object.pyx":207
 * 
 *         """
 *         if handler is not None:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscObjectAddOptionsHandler(self.obj[0], PetscObjectOptionsHandler_PYTHON, NULL, NULL))
 *             self.set_attr('__optshandler__', handler)
*/
  __pyx_t_1 = (__pyx_v_handler != Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Object.pyx":208
 *         """
 *         if handler is not None:
 *             CHKERR(PetscObjectAddOptionsHandler(self.obj[0], PetscObjectOptionsHandler_PYTHON, NULL, NULL))             # <<<<<<<<<<<<<<
 *             self.set_attr('__optshandler__', handler)
 *         else:
*/
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectAddOptionsHandler((__pyx_v_self->obj[0]), __pyx_f_8petsc4py_5PETSc_PetscObjectOptionsHandler_PYTHON, NULL, NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 208, __pyx_L1_error)

    /* "petsc4py/PETSc/Object.pyx":209
 *         if handler is not None:
 *             CHKERR(PetscObjectAddOptionsHandler(self.obj[0], PetscObjectOptionsHandler_PYTHON, NULL, NULL))
 *             self.set_attr('__optshandler__', handler)             # <<<<<<<<<<<<<<
 *         else:
 *             self.set_attr('__optshandler__', None)
*/
    __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *)__pyx_v_self->__pyx_vtab)->set_attr(__pyx_v_self, ((char *)"__optshandler__"), __pyx_v_handler); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/Object.pyx":207
 * 
 *         """
 *         if handler is not None:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscObjectAddOptionsHandler(self.obj[0], PetscObjectOptionsHandler_PYTHON, NULL, NULL))
 *             self.set_attr('__optshandler__', handler)
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Object.pyx":211
 *             self.set_attr('__optshandler__', handler)
 *         else:
 *             self.set_attr('__optshandler__', None)             # <<<<<<<<<<<<<<
 * 
 *     def destroyOptionsHandlers(self) -> None:
*/
  /*else*/ {
    __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *)__pyx_v_self->__pyx_vtab)->set_attr(__pyx_v_self, ((char *)"__optshandler__"), Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Object.pyx":190
 *         CHKERR(PetscObjectViewFromOptions(self.obj[0], pobj, cval))
 * 
 *     def setOptionsHandler(self, handler: PetscOptionsHandlerFunction | None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback for processing extra options.
 * 
*/

  /* 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.setOptionsHandler", __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
 *             self.set_attr('__optshandler__', None)
 * 
 *     def destroyOptionsHandlers(self) -> None:             # <<<<<<<<<<<<<<
 *         """Clear all the option handlers.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_31destroyOptionsHandlers(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_30destroyOptionsHandlers, "Object.destroyOptionsHandlers(self) -> None\nClear all the option handlers.\n\n        Collective.\n\n        See Also\n        --------\n        petsc_options, setOptionsHandler, petsc.PetscObjectDestroyOptionsHandlers\n\n        \nSource code at petsc4py/PETSc/Object.pyx:213");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_31destroyOptionsHandlers = {"destroyOptionsHandlers", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_31destroyOptionsHandlers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_30destroyOptionsHandlers};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_31destroyOptionsHandlers(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyOptionsHandlers (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("destroyOptionsHandlers", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroyOptionsHandlers", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_30destroyOptionsHandlers(((struct PyPetscObjectObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_30destroyOptionsHandlers(struct PyPetscObjectObject *__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("destroyOptionsHandlers", 0);

  /* "petsc4py/PETSc/Object.pyx":223
 * 
 *         """
 *         self.set_attr('__optshandler__', None)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectDestroyOptionsHandlers(self.obj[0]))
 * 
*/
  __pyx_t_1 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Object *)__pyx_v_self->__pyx_vtab)->set_attr(__pyx_v_self, ((char *)"__optshandler__"), Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Object.pyx":224
 *         """
 *         self.set_attr('__optshandler__', None)
 *         CHKERR(PetscObjectDestroyOptionsHandlers(self.obj[0]))             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectDestroyOptionsHandlers((__pyx_v_self->obj[0]))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 224, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":213
 *             self.set_attr('__optshandler__', None)
 * 
 *     def destroyOptionsHandlers(self) -> None:             # <<<<<<<<<<<<<<
 *         """Clear all the option handlers.
 * 
*/

  /* 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.destroyOptionsHandlers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Object.pyx":228
 *     #
 * 
 *     def getComm(self) -> Comm:             # <<<<<<<<<<<<<<
 *         """Return the communicator of the object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_33getComm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_32getComm, "Object.getComm(self) -> Comm\nReturn the communicator of the object.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PetscObjectGetComm\n\n        \nSource code at petsc4py/PETSc/Object.pyx:228");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_33getComm = {"getComm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_33getComm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_32getComm};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_33getComm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getComm", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_32getComm(((struct PyPetscObjectObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_32getComm(struct PyPetscObjectObject *__pyx_v_self) {
  struct PyPetscCommObject *__pyx_v_comm = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getComm", 0);

  /* "petsc4py/PETSc/Object.pyx":238
 * 
 *         """
 *         cdef Comm comm = Comm()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetComm(self.obj[0], &comm.comm))
 *         return comm
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 238, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_comm = ((struct PyPetscCommObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Object.pyx":239
 *         """
 *         cdef Comm comm = Comm()
 *         CHKERR(PetscObjectGetComm(self.obj[0], &comm.comm))             # <<<<<<<<<<<<<<
 *         return comm
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm((__pyx_v_self->obj[0]), (&__pyx_v_comm->comm))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 239, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":240
 *         cdef Comm comm = Comm()
 *         CHKERR(PetscObjectGetComm(self.obj[0], &comm.comm))
 *         return comm             # <<<<<<<<<<<<<<
 * 
 *     def getName(self) -> str:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_comm);
  __pyx_r = ((PyObject *)__pyx_v_comm);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":228
 *     #
 * 
 *     def getComm(self) -> Comm:             # <<<<<<<<<<<<<<
 *         """Return the communicator of the object.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":242
 *         return comm
 * 
 *     def getName(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the name of the object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_35getName(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_34getName, "Object.getName(self) -> str\nReturn the name of the object.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PetscObjectGetName\n\n        \nSource code at petsc4py/PETSc/Object.pyx:242");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_35getName = {"getName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_35getName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_34getName};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_35getName(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getName", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_34getName(((struct PyPetscObjectObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_34getName(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", 0);

  /* "petsc4py/PETSc/Object.pyx":252
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetName(self.obj[0], &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Object.pyx":253
 *         """
 *         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, 253, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":254
 *         cdef const char *cval = NULL
 *         CHKERR(PetscObjectGetName(self.obj[0], &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     def setName(self, name : str | None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":242
 *         return comm
 * 
 *     def getName(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the name of the object.
 * 
*/

  /* 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":256
 *         return bytes2str(cval)
 * 
 *     def setName(self, name : str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Associate a name to the object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_37setName(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_36setName, "Object.setName(self, name: str | None) -> None\nAssociate a name to the object.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PetscObjectSetName\n\n        \nSource code at petsc4py/PETSc/Object.pyx:256");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_37setName = {"setName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_37setName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_36setName};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_37setName(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 256, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 256, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setName", 0) < (0)) __PYX_ERR(35, 256, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setName", 1, 1, 1, i); __PYX_ERR(35, 256, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 256, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setName", 1, 1, 1, __pyx_nargs); __PYX_ERR(35, 256, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_36setName(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_36setName(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":266
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         name = str2bytes(name, &cval)
 *         CHKERR(PetscObjectSetName(self.obj[0], cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Object.pyx":267
 *         """
 *         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, 267, __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":268
 *         cdef const char *cval = NULL
 *         name = str2bytes(name, &cval)
 *         CHKERR(PetscObjectSetName(self.obj[0], cval))             # <<<<<<<<<<<<<<
 * 
 *     def getClassId(self) -> int:
*/
  __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, 268, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":256
 *         return bytes2str(cval)
 * 
 *     def setName(self, name : str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Associate a name to the 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.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":270
 *         CHKERR(PetscObjectSetName(self.obj[0], cval))
 * 
 *     def getClassId(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the class identifier of the object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_39getClassId(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_38getClassId, "Object.getClassId(self) -> int\nReturn the class identifier of the object.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PetscObjectGetClassId\n\n        \nSource code at petsc4py/PETSc/Object.pyx:270");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_39getClassId = {"getClassId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_39getClassId, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_38getClassId};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_39getClassId(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getClassId", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_38getClassId(((struct PyPetscObjectObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_38getClassId(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", 0);

  /* "petsc4py/PETSc/Object.pyx":280
 * 
 *         """
 *         cdef PetscClassId classid = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetClassId(self.obj[0], &classid))
 *         return <long>classid
*/
  __pyx_v_classid = 0;

  /* "petsc4py/PETSc/Object.pyx":281
 *         """
 *         cdef PetscClassId classid = 0
 *         CHKERR(PetscObjectGetClassId(self.obj[0], &classid))             # <<<<<<<<<<<<<<
 *         return <long>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, 281, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":282
 *         cdef PetscClassId classid = 0
 *         CHKERR(PetscObjectGetClassId(self.obj[0], &classid))
 *         return <long>classid             # <<<<<<<<<<<<<<
 * 
 *     def getClassName(self) -> str:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_long(((long)__pyx_v_classid)); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":270
 *         CHKERR(PetscObjectSetName(self.obj[0], cval))
 * 
 *     def getClassId(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the class identifier of the object.
 * 
*/

  /* 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":284
 *         return <long>classid
 * 
 *     def getClassName(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the class name of the object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_41getClassName(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_40getClassName, "Object.getClassName(self) -> str\nReturn the class name of the object.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PetscObjectGetClassName\n\n        \nSource code at petsc4py/PETSc/Object.pyx:284");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_41getClassName = {"getClassName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_41getClassName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_40getClassName};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_41getClassName(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getClassName", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_40getClassName(((struct PyPetscObjectObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_40getClassName(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", 0);

  /* "petsc4py/PETSc/Object.pyx":294
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetClassName(self.obj[0], &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Object.pyx":295
 *         """
 *         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, 295, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":296
 *         cdef const char *cval = NULL
 *         CHKERR(PetscObjectGetClassName(self.obj[0], &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     def getRefCount(self) -> int:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":284
 *         return <long>classid
 * 
 *     def getClassName(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the class name of the object.
 * 
*/

  /* 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":298
 *         return bytes2str(cval)
 * 
 *     def getRefCount(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the reference count of the object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_43getRefCount(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_42getRefCount, "Object.getRefCount(self) -> int\nReturn the reference count of the object.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PetscObjectGetReference\n\n        \nSource code at petsc4py/PETSc/Object.pyx:298");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_43getRefCount = {"getRefCount", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_43getRefCount, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_42getRefCount};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_43getRefCount(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getRefCount", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_42getRefCount(((struct PyPetscObjectObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_42getRefCount(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", 0);

  /* "petsc4py/PETSc/Object.pyx":308
 * 
 *         """
 *         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_mstate_global->__pyx_int_0);
    __pyx_r = __pyx_mstate_global->__pyx_int_0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/Object.pyx":309
 *         """
 *         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":310
 *         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, 310, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":311
 *         cdef PetscInt refcnt = 0
 *         CHKERR(PetscObjectGetReference(self.obj[0], &refcnt))
 *         return toInt(refcnt)             # <<<<<<<<<<<<<<
 * 
 *     def getId(self) -> int:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_refcnt); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":298
 *         return bytes2str(cval)
 * 
 *     def getRefCount(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the reference count of the object.
 * 
*/

  /* 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":313
 *         return toInt(refcnt)
 * 
 *     def getId(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the unique identifier of the object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_45getId(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_44getId, "Object.getId(self) -> int\nReturn the unique identifier of the object.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PetscObjectGetId\n\n        \nSource code at petsc4py/PETSc/Object.pyx:313");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_45getId = {"getId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_45getId, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_44getId};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_45getId(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getId (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getId", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getId", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_44getId(((struct PyPetscObjectObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_44getId(struct PyPetscObjectObject *__pyx_v_self) {
  PetscObjectId __pyx_v_cid;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscErrorCode __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getId", 0);

  /* "petsc4py/PETSc/Object.pyx":323
 * 
 *         """
 *         cdef PetscObjectId cid = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetId(self.obj[0], &cid))
 *         return <long>cid
*/
  __pyx_v_cid = 0;

  /* "petsc4py/PETSc/Object.pyx":324
 *         """
 *         cdef PetscObjectId cid = 0
 *         CHKERR(PetscObjectGetId(self.obj[0], &cid))             # <<<<<<<<<<<<<<
 *         return <long>cid
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetId((__pyx_v_self->obj[0]), (&__pyx_v_cid))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(35, 324, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":325
 *         cdef PetscObjectId cid = 0
 *         CHKERR(PetscObjectGetId(self.obj[0], &cid))
 *         return <long>cid             # <<<<<<<<<<<<<<
 * 
 *     # --- general support ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_long(((long)__pyx_v_cid)); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":313
 *         return toInt(refcnt)
 * 
 *     def getId(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the unique identifier of the object.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Object.getId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Object.pyx":329
 *     # --- general support ---
 * 
 *     def compose(self, name : str | None, Object obj or None) -> None:             # <<<<<<<<<<<<<<
 *         """Associate a PETSc object using a key string.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_47compose(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_46compose, "Object.compose(self, name: str | None, obj: Object) -> None\nAssociate a PETSc object using a key string.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        name\n            The string identifying the object to be composed.\n        obj\n            The object to be composed.\n\n        See Also\n        --------\n        query, petsc.PetscObjectCompose\n\n        \nSource code at petsc4py/PETSc/Object.pyx:329");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_47compose = {"compose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_47compose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_46compose};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_47compose(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_obj,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 329, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(35, 329, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 329, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "compose", 0) < (0)) __PYX_ERR(35, 329, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("compose", 1, 2, 2, i); __PYX_ERR(35, 329, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 329, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(35, 329, __pyx_L3_error)
    }
    __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, 329, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, 1, "obj", 0))) __PYX_ERR(35, 329, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_46compose(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name, __pyx_v_obj);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_46compose(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":346
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscObject cobj = NULL
 *         name = str2bytes(name, &cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Object.pyx":347
 *         """
 *         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":348
 *         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, 348, __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":349
 *         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":350
 *         name = str2bytes(name, &cval)
 *         if obj is not None: cobj = obj.obj[0]
 *         CHKERR(PetscObjectCompose(self.obj[0], cval, cobj))             # <<<<<<<<<<<<<<
 * 
 *     def query(self, name: str) -> Object:
*/
  __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, 350, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":329
 *     # --- general support ---
 * 
 *     def compose(self, name : str | None, Object obj or None) -> None:             # <<<<<<<<<<<<<<
 *         """Associate a PETSc object using a key string.
 * 
*/

  /* 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":352
 *         CHKERR(PetscObjectCompose(self.obj[0], cval, cobj))
 * 
 *     def query(self, name: str) -> Object:             # <<<<<<<<<<<<<<
 *         """Query for the PETSc object associated with a key string.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_49query(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_48query, "Object.query(self, name: str) -> Object\nQuery for the PETSc object associated with a key string.\n\n        Not collective.\n\n        See Also\n        --------\n        compose, petsc.PetscObjectQuery\n\n        \nSource code at petsc4py/PETSc/Object.pyx:352");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_49query = {"query", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_49query, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_48query};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_49query(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 352, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 352, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "query", 0) < (0)) __PYX_ERR(35, 352, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("query", 1, 1, 1, i); __PYX_ERR(35, 352, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 352, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("query", 1, 1, 1, __pyx_nargs); __PYX_ERR(35, 352, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_48query(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_48query(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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  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":362
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscObject cobj = NULL
 *         name = str2bytes(name, &cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Object.pyx":363
 *         """
 *         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":364
 *         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, 364, __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":365
 *         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, 365, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":366
 *         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":367
 *         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_4 = NULL;
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_Object(__pyx_v_cobj)); if (unlikely(!__pyx_t_5)) __PYX_ERR(35, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(35, 367, __pyx_L1_error)
  __pyx_v_obj = ((struct PyPetscObjectObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Object.pyx":368
 *         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":369
 *         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, 369, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":370
 *         obj.obj[0] = cobj
 *         CHKERR(PetscINCREF(obj.obj))
 *         return obj             # <<<<<<<<<<<<<<
 * 
 *     def incRef(self) -> int:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_obj);
  __pyx_r = ((PyObject *)__pyx_v_obj);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":352
 *         CHKERR(PetscObjectCompose(self.obj[0], cval, cobj))
 * 
 *     def query(self, name: str) -> Object:             # <<<<<<<<<<<<<<
 *         """Query for the PETSc object associated with a key string.
 * 
*/

  /* 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.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":372
 *         return obj
 * 
 *     def incRef(self) -> int:             # <<<<<<<<<<<<<<
 *         """Increment the object reference count.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_51incRef(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_50incRef, "Object.incRef(self) -> int\nIncrement the object reference count.\n\n        Logically collective.\n\n        See Also\n        --------\n        getRefCount, petsc.PetscObjectReference\n\n        \nSource code at petsc4py/PETSc/Object.pyx:372");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_51incRef = {"incRef", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_51incRef, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_50incRef};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_51incRef(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("incRef", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_50incRef(((struct PyPetscObjectObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_50incRef(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", 0);

  /* "petsc4py/PETSc/Object.pyx":382
 * 
 *         """
 *         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":383
 *         """
 *         cdef PetscObject obj = self.obj[0]
 *         cdef PetscInt refct = 0             # <<<<<<<<<<<<<<
 *         if obj != NULL:
 *             CHKERR(PetscObjectReference(obj))
*/
  __pyx_v_refct = 0;

  /* "petsc4py/PETSc/Object.pyx":384
 *         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":385
 *         cdef PetscInt refct = 0
 *         if obj != NULL:
 *             CHKERR(PetscObjectReference(obj))             # <<<<<<<<<<<<<<
 *             CHKERR(PetscObjectGetReference(obj, &refct))
 *         return toInt(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, 385, __pyx_L1_error)

    /* "petsc4py/PETSc/Object.pyx":386
 *         if obj != NULL:
 *             CHKERR(PetscObjectReference(obj))
 *             CHKERR(PetscObjectGetReference(obj, &refct))             # <<<<<<<<<<<<<<
 *         return toInt(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, 386, __pyx_L1_error)

    /* "petsc4py/PETSc/Object.pyx":384
 *         cdef PetscObject obj = self.obj[0]
 *         cdef PetscInt refct = 0
 *         if obj != NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscObjectReference(obj))
 *             CHKERR(PetscObjectGetReference(obj, &refct))
*/
  }

  /* "petsc4py/PETSc/Object.pyx":387
 *             CHKERR(PetscObjectReference(obj))
 *             CHKERR(PetscObjectGetReference(obj, &refct))
 *         return toInt(refct)             # <<<<<<<<<<<<<<
 * 
 *     def decRef(self) -> int:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_refct); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":372
 *         return obj
 * 
 *     def incRef(self) -> int:             # <<<<<<<<<<<<<<
 *         """Increment the object reference count.
 * 
*/

  /* 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":389
 *         return toInt(refct)
 * 
 *     def decRef(self) -> int:             # <<<<<<<<<<<<<<
 *         """Decrement the object reference count.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_53decRef(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_52decRef, "Object.decRef(self) -> int\nDecrement the object reference count.\n\n        Logically collective.\n\n        See Also\n        --------\n        getRefCount, petsc.PetscObjectDereference\n\n        \nSource code at petsc4py/PETSc/Object.pyx:389");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_53decRef = {"decRef", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_53decRef, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_52decRef};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_53decRef(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("decRef", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_52decRef(((struct PyPetscObjectObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_52decRef(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", 0);

  /* "petsc4py/PETSc/Object.pyx":399
 * 
 *         """
 *         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":400
 *         """
 *         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":401
 *         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":402
 *         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, 402, __pyx_L1_error)

    /* "petsc4py/PETSc/Object.pyx":403
 *         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, 403, __pyx_L1_error)

    /* "petsc4py/PETSc/Object.pyx":404
 *             CHKERR(PetscObjectGetReference(obj, &refct))
 *             CHKERR(PetscObjectDereference(obj))
 *             if refct == 1: self.obj[0] = NULL             # <<<<<<<<<<<<<<
 *             refct -= 1
 *         return toInt(refct)
*/
    __pyx_t_1 = (__pyx_v_refct == 1);
    if (__pyx_t_1) {
      (__pyx_v_self->obj[0]) = NULL;
    }

    /* "petsc4py/PETSc/Object.pyx":405
 *             CHKERR(PetscObjectDereference(obj))
 *             if refct == 1: self.obj[0] = NULL
 *             refct -= 1             # <<<<<<<<<<<<<<
 *         return toInt(refct)
 * 
*/
    __pyx_v_refct = (__pyx_v_refct - 1);

    /* "petsc4py/PETSc/Object.pyx":401
 *         cdef PetscObject obj = self.obj[0]
 *         cdef PetscInt refct = 0
 *         if obj != NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscObjectGetReference(obj, &refct))
 *             CHKERR(PetscObjectDereference(obj))
*/
  }

  /* "petsc4py/PETSc/Object.pyx":406
 *             if refct == 1: self.obj[0] = NULL
 *             refct -= 1
 *         return toInt(refct)             # <<<<<<<<<<<<<<
 * 
 *     def getAttr(self, name : str) -> object:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_refct); if (unlikely(!__pyx_t_3)) __PYX_ERR(35, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":389
 *         return toInt(refct)
 * 
 *     def decRef(self) -> int:             # <<<<<<<<<<<<<<
 *         """Decrement the object reference count.
 * 
*/

  /* 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":408
 *         return toInt(refct)
 * 
 *     def getAttr(self, name : str) -> object:             # <<<<<<<<<<<<<<
 *         """Return the attribute associated with a given name.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_55getAttr(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_54getAttr, "Object.getAttr(self, name: str) -> object\nReturn the attribute associated with a given name.\n\n        Not collective.\n\n        See Also\n        --------\n        setAttr, getDict\n\n        \nSource code at petsc4py/PETSc/Object.pyx:408");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_55getAttr = {"getAttr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_55getAttr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_54getAttr};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_55getAttr(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 408, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 408, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getAttr", 0) < (0)) __PYX_ERR(35, 408, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getAttr", 1, 1, 1, i); __PYX_ERR(35, 408, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 408, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getAttr", 1, 1, 1, __pyx_nargs); __PYX_ERR(35, 408, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_54getAttr(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_54getAttr(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":418
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         name = str2bytes(name, &cval)
 *         return self.get_attr(<char*>cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Object.pyx":419
 *         """
 *         cdef const char *cval = NULL
 *         name = str2bytes(name, &cval)             # <<<<<<<<<<<<<<
 *         return self.get_attr(<char*>cval)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 419, __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":420
 *         cdef const char *cval = NULL
 *         name = str2bytes(name, &cval)
 *         return self.get_attr(<char*>cval)             # <<<<<<<<<<<<<<
 * 
 *     def setAttr(self, name : str, attr : object) -> None:
*/
  __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, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":408
 *         return toInt(refct)
 * 
 *     def getAttr(self, name : str) -> object:             # <<<<<<<<<<<<<<
 *         """Return the attribute associated with a given name.
 * 
*/

  /* 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":422
 *         return self.get_attr(<char*>cval)
 * 
 *     def setAttr(self, name : str, attr : object) -> None:             # <<<<<<<<<<<<<<
 *         """Set an the attribute associated with a given name.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_57setAttr(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_56setAttr, "Object.setAttr(self, name: str, attr: object) -> None\nSet an the attribute associated with a given name.\n\n        Not collective.\n\n        See Also\n        --------\n        getAttr, getDict\n\n        \nSource code at petsc4py/PETSc/Object.pyx:422");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_57setAttr = {"setAttr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_57setAttr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_56setAttr};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_57setAttr(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_attr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 422, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(35, 422, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 422, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setAttr", 0) < (0)) __PYX_ERR(35, 422, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setAttr", 1, 2, 2, i); __PYX_ERR(35, 422, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 422, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(35, 422, __pyx_L3_error)
    }
    __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, 422, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_56setAttr(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_name, __pyx_v_attr);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_56setAttr(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":432
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         name = str2bytes(name, &cval)
 *         self.set_attr(<char*>cval, attr)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Object.pyx":433
 *         """
 *         cdef const char *cval = NULL
 *         name = str2bytes(name, &cval)             # <<<<<<<<<<<<<<
 *         self.set_attr(<char*>cval, attr)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 433, __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":434
 *         cdef const char *cval = NULL
 *         name = str2bytes(name, &cval)
 *         self.set_attr(<char*>cval, attr)             # <<<<<<<<<<<<<<
 * 
 *     def getDict(self) -> dict:
*/
  __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, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Object.pyx":422
 *         return self.get_attr(<char*>cval)
 * 
 *     def setAttr(self, name : str, attr : object) -> None:             # <<<<<<<<<<<<<<
 *         """Set an the attribute associated with a given 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.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":436
 *         self.set_attr(<char*>cval, attr)
 * 
 *     def getDict(self) -> dict:             # <<<<<<<<<<<<<<
 *         """Return the dictionary of attributes.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_59getDict(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_58getDict, "Object.getDict(self) -> dict\nReturn the dictionary of attributes.\n\n        Not collective.\n\n        See Also\n        --------\n        setAttr, getAttr\n\n        \nSource code at petsc4py/PETSc/Object.pyx:436");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_59getDict = {"getDict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_59getDict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_58getDict};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_59getDict(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDict", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_58getDict(((struct PyPetscObjectObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_58getDict(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", 0);

  /* "petsc4py/PETSc/Object.pyx":446
 * 
 *         """
 *         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, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":436
 *         self.set_attr(<char*>cval, attr)
 * 
 *     def getDict(self) -> dict:             # <<<<<<<<<<<<<<
 *         """Return the dictionary of attributes.
 * 
*/

  /* 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":450
 *     # --- state manipulation ---
 * 
 *     def stateIncrease(self) -> None:             # <<<<<<<<<<<<<<
 *         """Increment the PETSc object state.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_61stateIncrease(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_60stateIncrease, "Object.stateIncrease(self) -> None\nIncrement the PETSc object state.\n\n        Logically collective.\n\n        See Also\n        --------\n        stateGet, stateSet, petsc.PetscObjectStateIncrease\n\n        \nSource code at petsc4py/PETSc/Object.pyx:450");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_61stateIncrease = {"stateIncrease", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_61stateIncrease, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_60stateIncrease};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_61stateIncrease(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("stateIncrease", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_60stateIncrease(((struct PyPetscObjectObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_60stateIncrease(struct PyPetscObjectObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stateIncrease", 0);

  /* "petsc4py/PETSc/Object.pyx":460
 * 
 *         """
 *         PetscINCSTATE(self.obj)             # <<<<<<<<<<<<<<
 * 
 *     def stateGet(self) -> int:
*/
  (void)(__pyx_f_8petsc4py_5PETSc_PetscINCSTATE(__pyx_v_self->obj));

  /* "petsc4py/PETSc/Object.pyx":450
 *     # --- state manipulation ---
 * 
 *     def stateIncrease(self) -> None:             # <<<<<<<<<<<<<<
 *         """Increment the PETSc object state.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Object.pyx":462
 *         PetscINCSTATE(self.obj)
 * 
 *     def stateGet(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the PETSc object state.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_63stateGet(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_62stateGet, "Object.stateGet(self) -> int\nReturn the PETSc object state.\n\n        Not collective.\n\n        See Also\n        --------\n        stateSet, stateIncrease, petsc.PetscObjectStateGet\n\n        \nSource code at petsc4py/PETSc/Object.pyx:462");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_63stateGet = {"stateGet", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_63stateGet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_62stateGet};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_63stateGet(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("stateGet", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_62stateGet(((struct PyPetscObjectObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_62stateGet(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", 0);

  /* "petsc4py/PETSc/Object.pyx":472
 * 
 *         """
 *         cdef PetscObjectState state = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectStateGet(self.obj[0], &state))
 *         return <long>state
*/
  __pyx_v_state = 0;

  /* "petsc4py/PETSc/Object.pyx":473
 *         """
 *         cdef PetscObjectState state = 0
 *         CHKERR(PetscObjectStateGet(self.obj[0], &state))             # <<<<<<<<<<<<<<
 *         return <long>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, 473, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":474
 *         cdef PetscObjectState state = 0
 *         CHKERR(PetscObjectStateGet(self.obj[0], &state))
 *         return <long>state             # <<<<<<<<<<<<<<
 * 
 *     def stateSet(self, state : int) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_long(((long)__pyx_v_state)); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":462
 *         PetscINCSTATE(self.obj)
 * 
 *     def stateGet(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the PETSc object 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":476
 *         return <long>state
 * 
 *     def stateSet(self, state : int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the PETSc object state.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_65stateSet(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_64stateSet, "Object.stateSet(self, state: int) -> None\nSet the PETSc object state.\n\n        Logically collective.\n\n        See Also\n        --------\n        stateIncrease, stateGet, petsc.PetscObjectStateSet\n\n        \nSource code at petsc4py/PETSc/Object.pyx:476");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_65stateSet = {"stateSet", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_65stateSet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_64stateSet};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_65stateSet(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 476, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 476, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "stateSet", 0) < (0)) __PYX_ERR(35, 476, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("stateSet", 1, 1, 1, i); __PYX_ERR(35, 476, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 476, __pyx_L3_error)
    }
    __pyx_v_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("stateSet", 1, 1, 1, __pyx_nargs); __PYX_ERR(35, 476, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_64stateSet(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_64stateSet(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", 0);

  /* "petsc4py/PETSc/Object.pyx":486
 * 
 *         """
 *         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, 486, __pyx_L1_error)
  __pyx_v_cstate = __pyx_t_1;

  /* "petsc4py/PETSc/Object.pyx":487
 *         """
 *         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, 487, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":476
 *         return <long>state
 * 
 *     def stateSet(self, state : int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the PETSc object state.
 * 
*/

  /* 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":491
 *     # --- tab level ---
 * 
 *     def incrementTabLevel(self, tab : int, Object parent=None) -> None:             # <<<<<<<<<<<<<<
 *         """Increment the PETSc object tab level.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_67incrementTabLevel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_66incrementTabLevel, "Object.incrementTabLevel(self, tab: int, parent: Object | None = None) -> None\nIncrement the PETSc object tab level.\n\n        Logically collective.\n\n        See Also\n        --------\n        setTabLevel, getTabLevel, petsc.PetscObjectIncrementTabLevel\n\n        \nSource code at petsc4py/PETSc/Object.pyx:491");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_67incrementTabLevel = {"incrementTabLevel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_67incrementTabLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_66incrementTabLevel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_67incrementTabLevel(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tab,&__pyx_mstate_global->__pyx_n_u_parent,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 491, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(35, 491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "incrementTabLevel", 0) < (0)) __PYX_ERR(35, 491, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscObjectObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("incrementTabLevel", 0, 1, 2, i); __PYX_ERR(35, 491, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(35, 491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 491, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscObjectObject *)Py_None));
    }
    __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, 491, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, 1, "parent", 0))) __PYX_ERR(35, 491, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_66incrementTabLevel(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_tab, __pyx_v_parent);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_66incrementTabLevel(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", 0);

  /* "petsc4py/PETSc/Object.pyx":501
 * 
 *         """
 *         cdef PetscInt ctab = asInt(tab)             # <<<<<<<<<<<<<<
 *         cdef PetscObject cobj = <PetscObject> 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, 501, __pyx_L1_error)
  __pyx_v_ctab = __pyx_t_1;

  /* "petsc4py/PETSc/Object.pyx":502
 *         """
 *         cdef PetscInt ctab = asInt(tab)
 *         cdef PetscObject cobj = <PetscObject> 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":503
 *         cdef PetscInt ctab = asInt(tab)
 *         cdef PetscObject cobj = <PetscObject> NULL if parent is None else parent.obj[0]
 *         CHKERR(PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab))             # <<<<<<<<<<<<<<
 * 
 *     def setTabLevel(self, level : int) -> None:
*/
  __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, 503, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":491
 *     # --- tab level ---
 * 
 *     def incrementTabLevel(self, tab : int, Object parent=None) -> None:             # <<<<<<<<<<<<<<
 *         """Increment the PETSc object tab level.
 * 
*/

  /* 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":505
 *         CHKERR(PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab))
 * 
 *     def setTabLevel(self, level : int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the PETSc object tab level.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_69setTabLevel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_68setTabLevel, "Object.setTabLevel(self, level: int) -> None\nSet the PETSc object tab level.\n\n        Logically collective.\n\n        See Also\n        --------\n        incrementTabLevel, getTabLevel, petsc.PetscObjectSetTabLevel\n\n        \nSource code at petsc4py/PETSc/Object.pyx:505");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_69setTabLevel = {"setTabLevel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_69setTabLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_68setTabLevel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_69setTabLevel(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(35, 505, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 505, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTabLevel", 0) < (0)) __PYX_ERR(35, 505, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setTabLevel", 1, 1, 1, i); __PYX_ERR(35, 505, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(35, 505, __pyx_L3_error)
    }
    __pyx_v_level = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setTabLevel", 1, 1, 1, __pyx_nargs); __PYX_ERR(35, 505, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_68setTabLevel(((struct PyPetscObjectObject *)__pyx_v_self), __pyx_v_level);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_68setTabLevel(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", 0);

  /* "petsc4py/PETSc/Object.pyx":515
 * 
 *         """
 *         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, 515, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/Object.pyx":516
 *         """
 *         cdef PetscInt clevel = asInt(level)
 *         CHKERR(PetscObjectSetTabLevel(self.obj[0], clevel))             # <<<<<<<<<<<<<<
 * 
 *     def getTabLevel(self) -> None:
*/
  __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, 516, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":505
 *         CHKERR(PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab))
 * 
 *     def setTabLevel(self, level : int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the PETSc object tab level.
 * 
*/

  /* 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":518
 *         CHKERR(PetscObjectSetTabLevel(self.obj[0], clevel))
 * 
 *     def getTabLevel(self) -> None:             # <<<<<<<<<<<<<<
 *         """Return the PETSc object tab level.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_71getTabLevel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_70getTabLevel, "Object.getTabLevel(self) -> None\nReturn the PETSc object tab level.\n\n        Not collective.\n\n        See Also\n        --------\n        setTabLevel, incrementTabLevel, petsc.PetscObjectGetTabLevel\n\n        \nSource code at petsc4py/PETSc/Object.pyx:518");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Object_71getTabLevel = {"getTabLevel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_71getTabLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_70getTabLevel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_71getTabLevel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTabLevel", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Object_70getTabLevel(((struct PyPetscObjectObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_70getTabLevel(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", 0);

  /* "petsc4py/PETSc/Object.pyx":528
 * 
 *         """
 *         cdef PetscInt clevel = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetTabLevel(self.obj[0], &clevel))
 *         return toInt(clevel)
*/
  __pyx_v_clevel = 0;

  /* "petsc4py/PETSc/Object.pyx":529
 *         """
 *         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, 529, __pyx_L1_error)

  /* "petsc4py/PETSc/Object.pyx":530
 *         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, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":518
 *         CHKERR(PetscObjectSetTabLevel(self.obj[0], clevel))
 * 
 *     def getTabLevel(self) -> None:             # <<<<<<<<<<<<<<
 *         """Return the PETSc object tab level.
 * 
*/

  /* 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":536
 *     property type:
 *         """Object type."""
 *         def __get__(self) -> str:             # <<<<<<<<<<<<<<
 *             return self.getType()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Object.pyx":537
 *         """Object type."""
 *         def __get__(self) -> str:
 *             return self.getType()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getType, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":536
 *     property type:
 *         """Object type."""
 *         def __get__(self) -> str:             # <<<<<<<<<<<<<<
 *             return self.getType()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":539
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Object.pyx":540
 * 
 *         def __set__(self, value):
 *             self.setType(value)             # <<<<<<<<<<<<<<
 * 
 *     property prefix:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setType, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Object.pyx":539
 *             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_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":544
 *     property prefix:
 *         """Options prefix."""
 *         def __get__(self) -> str:             # <<<<<<<<<<<<<<
 *             return self.getOptionsPrefix()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Object.pyx":545
 *         """Options prefix."""
 *         def __get__(self) -> str:
 *             return self.getOptionsPrefix()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getOptionsPrefix, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":544
 *     property prefix:
 *         """Options prefix."""
 *         def __get__(self) -> str:             # <<<<<<<<<<<<<<
 *             return self.getOptionsPrefix()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":547
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Object.pyx":548
 * 
 *         def __set__(self, value):
 *             self.setOptionsPrefix(value)             # <<<<<<<<<<<<<<
 * 
 *     property comm:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setOptionsPrefix, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Object.pyx":547
 *             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_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":552
 *     property comm:
 *         """The object communicator."""
 *         def __get__(self) -> Comm:             # <<<<<<<<<<<<<<
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Object.pyx":553
 *         """The object communicator."""
 *         def __get__(self) -> Comm:
 *             return self.getComm()             # <<<<<<<<<<<<<<
 * 
 *     property name:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getComm, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":552
 *     property comm:
 *         """The object communicator."""
 *         def __get__(self) -> Comm:             # <<<<<<<<<<<<<<
 *             return self.getComm()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":557
 *     property name:
 *         """The object name."""
 *         def __get__(self) -> str:             # <<<<<<<<<<<<<<
 *             return self.getName()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Object.pyx":558
 *         """The object name."""
 *         def __get__(self) -> str:
 *             return self.getName()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getName, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":557
 *     property name:
 *         """The object name."""
 *         def __get__(self) -> str:             # <<<<<<<<<<<<<<
 *             return self.getName()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":560
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Object.pyx":561
 * 
 *         def __set__(self, value):
 *             self.setName(value)             # <<<<<<<<<<<<<<
 * 
 *     property classid:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setName, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Object.pyx":560
 *             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_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":565
 *     property classid:
 *         """The class identifier."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Object.pyx":566
 *         """The class identifier."""
 *         def __get__(self) -> int:
 *             return self.getClassId()             # <<<<<<<<<<<<<<
 * 
 *     property id:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getClassId, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":565
 *     property classid:
 *         """The class identifier."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getClassId()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":570
 *     property id:
 *         """The object identifier."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getId()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_2id_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Object_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_6Object_2id___get__(((struct PyPetscObjectObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Object_2id___get__(struct PyPetscObjectObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Object.pyx":571
 *         """The object identifier."""
 *         def __get__(self) -> int:
 *             return self.getId()             # <<<<<<<<<<<<<<
 * 
 *     property klass:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getId, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 571, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":570
 *     property id:
 *         """The object identifier."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getId()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Object.id.__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":575
 *     property klass:
 *         """The class name."""
 *         def __get__(self) -> str:             # <<<<<<<<<<<<<<
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Object.pyx":576
 *         """The class name."""
 *         def __get__(self) -> str:
 *             return self.getClassName()             # <<<<<<<<<<<<<<
 * 
 *     property refcount:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getClassName, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":575
 *     property klass:
 *         """The class name."""
 *         def __get__(self) -> str:             # <<<<<<<<<<<<<<
 *             return self.getClassName()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":580
 *     property refcount:
 *         """Reference count."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Object.pyx":581
 *         """Reference count."""
 *         def __get__(self) -> int:
 *             return self.getRefCount()             # <<<<<<<<<<<<<<
 * 
 *     # --- ctypes support  ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getRefCount, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 581, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":580
 *     property refcount:
 *         """Reference count."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getRefCount()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":587
 *     property handle:
 *         """Handle for ctypes support."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             cdef PetscObject obj = self.obj[0]
 *             return PyLong_FromVoidPtr(<void*>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__", 0);

  /* "petsc4py/PETSc/Object.pyx":588
 *         """Handle for ctypes support."""
 *         def __get__(self) -> int:
 *             cdef PetscObject obj = self.obj[0]             # <<<<<<<<<<<<<<
 *             return PyLong_FromVoidPtr(<void*>obj)
 * 
*/
  __pyx_v_obj = (__pyx_v_self->obj[0]);

  /* "petsc4py/PETSc/Object.pyx":589
 *         def __get__(self) -> int:
 *             cdef PetscObject obj = self.obj[0]
 *             return PyLong_FromVoidPtr(<void*>obj)             # <<<<<<<<<<<<<<
 * 
 *     # --- Fortran support  ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyLong_FromVoidPtr(((void *)__pyx_v_obj)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":587
 *     property handle:
 *         """Handle for ctypes support."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             cdef PetscObject obj = self.obj[0]
 *             return PyLong_FromVoidPtr(<void*>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":595
 *     property fortran:
 *         """Fortran handle."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             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__", 0);

  /* "petsc4py/PETSc/Object.pyx":596
 *         """Fortran handle."""
 *         def __get__(self) -> int:
 *             cdef PetscObject obj = self.obj[0]             # <<<<<<<<<<<<<<
 *             return Object_toFortran(obj)
 * 
*/
  __pyx_v_obj = (__pyx_v_self->obj[0]);

  /* "petsc4py/PETSc/Object.pyx":597
 *         def __get__(self) -> int:
 *             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)-1L) && PyErr_Occurred())) __PYX_ERR(35, 597, __pyx_L1_error)
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(35, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Object.pyx":595
 *     property fortran:
 *         """Fortran handle."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             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":35
 *     PetscErrorCode PetscGarbageView(MPI_Comm, PetscViewer)
 * 
 * cdef int tp_traverse(PyObject *o, visitproc _visit, void *_arg) noexcept:             # <<<<<<<<<<<<<<
 *     cdef visitproc visit "visit" = _visit
 *     cdef void *arg "arg" = _arg
*/

static int __pyx_f_8petsc4py_5PETSc_tp_traverse(PyObject *__pyx_v_o, visitproc __pyx_v__visit, void *__pyx_v__arg) {
  visitproc visit;
  void *arg;
  PetscObject __pyx_v_p;
  PyObject *__pyx_v_d;
  int __pyx_r;
  int __pyx_t_1;

  /* "petsc4py/PETSc/cyclicgc.pxi":36
 * 
 * cdef int tp_traverse(PyObject *o, visitproc _visit, void *_arg) noexcept:
 *     cdef visitproc visit "visit" = _visit             # <<<<<<<<<<<<<<
 *     cdef void *arg "arg" = _arg
 *     <void> visit
*/
  visit = __pyx_v__visit;

  /* "petsc4py/PETSc/cyclicgc.pxi":37
 * cdef int tp_traverse(PyObject *o, visitproc _visit, void *_arg) noexcept:
 *     cdef visitproc visit "visit" = _visit
 *     cdef void *arg "arg" = _arg             # <<<<<<<<<<<<<<
 *     <void> visit
 *     <void> arg
*/
  arg = __pyx_v__arg;

  /* "petsc4py/PETSc/cyclicgc.pxi":38
 *     cdef visitproc visit "visit" = _visit
 *     cdef void *arg "arg" = _arg
 *     <void> visit             # <<<<<<<<<<<<<<
 *     <void> arg
 *     if Py_Version >= 0x03090000:
*/
  ((void)visit);

  /* "petsc4py/PETSc/cyclicgc.pxi":39
 *     cdef void *arg "arg" = _arg
 *     <void> visit
 *     <void> arg             # <<<<<<<<<<<<<<
 *     if Py_Version >= 0x03090000:
 *         if not (PyType_GetFlags(Py_TYPE(o)) & Py_TPFLAGS_HEAPTYPE):
*/
  ((void)arg);

  /* "petsc4py/PETSc/cyclicgc.pxi":40
 *     <void> visit
 *     <void> arg
 *     if Py_Version >= 0x03090000:             # <<<<<<<<<<<<<<
 *         if not (PyType_GetFlags(Py_TYPE(o)) & Py_TPFLAGS_HEAPTYPE):
 *             Py_VISIT(Py_TYPE(o))
*/
  __pyx_t_1 = (Py_Version >= 0x03090000);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/cyclicgc.pxi":41
 *     <void> arg
 *     if Py_Version >= 0x03090000:
 *         if not (PyType_GetFlags(Py_TYPE(o)) & Py_TPFLAGS_HEAPTYPE):             # <<<<<<<<<<<<<<
 *             Py_VISIT(Py_TYPE(o))
 *     cdef PetscObject p = (<Object>o).obj[0]
*/
    __pyx_t_1 = (!((PyType_GetFlags(Py_TYPE(__pyx_v_o)) & Py_TPFLAGS_HEAPTYPE) != 0));
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/cyclicgc.pxi":42
 *     if Py_Version >= 0x03090000:
 *         if not (PyType_GetFlags(Py_TYPE(o)) & Py_TPFLAGS_HEAPTYPE):
 *             Py_VISIT(Py_TYPE(o))             # <<<<<<<<<<<<<<
 *     cdef PetscObject p = (<Object>o).obj[0]
 *     if p == NULL: return 0
*/
      Py_VISIT(Py_TYPE(__pyx_v_o));

      /* "petsc4py/PETSc/cyclicgc.pxi":41
 *     <void> arg
 *     if Py_Version >= 0x03090000:
 *         if not (PyType_GetFlags(Py_TYPE(o)) & Py_TPFLAGS_HEAPTYPE):             # <<<<<<<<<<<<<<
 *             Py_VISIT(Py_TYPE(o))
 *     cdef PetscObject p = (<Object>o).obj[0]
*/
    }

    /* "petsc4py/PETSc/cyclicgc.pxi":40
 *     <void> visit
 *     <void> arg
 *     if Py_Version >= 0x03090000:             # <<<<<<<<<<<<<<
 *         if not (PyType_GetFlags(Py_TYPE(o)) & Py_TPFLAGS_HEAPTYPE):
 *             Py_VISIT(Py_TYPE(o))
*/
  }

  /* "petsc4py/PETSc/cyclicgc.pxi":43
 *         if not (PyType_GetFlags(Py_TYPE(o)) & Py_TPFLAGS_HEAPTYPE):
 *             Py_VISIT(Py_TYPE(o))
 *     cdef PetscObject p = (<Object>o).obj[0]             # <<<<<<<<<<<<<<
 *     if p == NULL: return 0
 *     cdef PyObject *d = <PyObject*>p.python_context
*/
  __pyx_v_p = (((struct PyPetscObjectObject *)__pyx_v_o)->obj[0]);

  /* "petsc4py/PETSc/cyclicgc.pxi":44
 *             Py_VISIT(Py_TYPE(o))
 *     cdef PetscObject p = (<Object>o).obj[0]
 *     if p == NULL: return 0             # <<<<<<<<<<<<<<
 *     cdef PyObject *d = <PyObject*>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":45
 *     cdef PetscObject p = (<Object>o).obj[0]
 *     if p == NULL: return 0
 *     cdef PyObject *d = <PyObject*>p.python_context             # <<<<<<<<<<<<<<
 *     if d == NULL: return 0
 *     Py_VISIT(d)
*/
  __pyx_v_d = ((PyObject *)__pyx_v_p->python_context);

  /* "petsc4py/PETSc/cyclicgc.pxi":46
 *     if p == NULL: return 0
 *     cdef PyObject *d = <PyObject*>p.python_context
 *     if d == NULL: return 0             # <<<<<<<<<<<<<<
 *     Py_VISIT(d)
 *     return 0
*/
  __pyx_t_1 = (__pyx_v_d == NULL);
  if (__pyx_t_1) {
    __pyx_r = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/cyclicgc.pxi":47
 *     cdef PyObject *d = <PyObject*>p.python_context
 *     if d == NULL: return 0
 *     Py_VISIT(d)             # <<<<<<<<<<<<<<
 *     return 0
 * 
*/
  Py_VISIT(__pyx_v_d);

  /* "petsc4py/PETSc/cyclicgc.pxi":48
 *     if d == NULL: return 0
 *     Py_VISIT(d)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * cdef int tp_clear(PyObject *o) noexcept:
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/cyclicgc.pxi":35
 *     PetscErrorCode PetscGarbageView(MPI_Comm, PetscViewer)
 * 
 * cdef int tp_traverse(PyObject *o, visitproc _visit, void *_arg) noexcept:             # <<<<<<<<<<<<<<
 *     cdef visitproc visit "visit" = _visit
 *     cdef void *arg "arg" = _arg
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/cyclicgc.pxi":50
 *     return 0
 * 
 * cdef int tp_clear(PyObject *o) noexcept:             # <<<<<<<<<<<<<<
 *     cdef PetscObject *p = (<Object>o).obj
 *     PetscDEALLOC(p)
*/

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":51
 * 
 * cdef int tp_clear(PyObject *o) noexcept:
 *     cdef PetscObject *p = (<Object>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":52
 * cdef int tp_clear(PyObject *o) noexcept:
 *     cdef PetscObject *p = (<Object>o).obj
 *     PetscDEALLOC(p)             # <<<<<<<<<<<<<<
 *     return 0
 * 
*/
  (void)(__pyx_f_8petsc4py_5PETSc_PetscDEALLOC(__pyx_v_p));

  /* "petsc4py/PETSc/cyclicgc.pxi":53
 *     cdef PetscObject *p = (<Object>o).obj
 *     PetscDEALLOC(p)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * cdef inline void TypeEnableGC(PyTypeObject *t) noexcept:
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/cyclicgc.pxi":50
 *     return 0
 * 
 * cdef int tp_clear(PyObject *o) noexcept:             # <<<<<<<<<<<<<<
 *     cdef PetscObject *p = (<Object>o).obj
 *     PetscDEALLOC(p)
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/cyclicgc.pxi":55
 *     return 0
 * 
 * cdef inline void TypeEnableGC(PyTypeObject *t) noexcept:             # <<<<<<<<<<<<<<
 *     _pytype_enable_gc(t, tp_traverse, tp_clear)
 * 
*/

static CYTHON_INLINE void __pyx_f_8petsc4py_5PETSc_TypeEnableGC(PyTypeObject *__pyx_v_t) {

  /* "petsc4py/PETSc/cyclicgc.pxi":56
 * 
 * cdef inline void TypeEnableGC(PyTypeObject *t) noexcept:
 *     _pytype_enable_gc(t, tp_traverse, tp_clear)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  _pytype_enable_gc(__pyx_v_t, __pyx_f_8petsc4py_5PETSc_tp_traverse, __pyx_f_8petsc4py_5PETSc_tp_clear);

  /* "petsc4py/PETSc/cyclicgc.pxi":55
 *     return 0
 * 
 * cdef inline void TypeEnableGC(PyTypeObject *t) noexcept:             # <<<<<<<<<<<<<<
 *     _pytype_enable_gc(t, tp_traverse, tp_clear)
 * 
*/

  /* function exit code */
}

/* "petsc4py/PETSc/cyclicgc.pxi":59
 * 
 * 
 * def garbage_cleanup(comm: Comm | None = None) -> 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: Comm | None = None) -> 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:59");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_1garbage_cleanup = {"garbage_cleanup", (PyCFunction)(void(*)(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(36, 59, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(36, 59, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "garbage_cleanup", 0) < (0)) __PYX_ERR(36, 59, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(36, 59, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 59, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("garbage_cleanup", 0);

  /* "petsc4py/PETSc/cyclicgc.pxi":70
 * 
 *     """
 *     if not (<int>PetscInitializeCalled): return             # <<<<<<<<<<<<<<
 *     if (<int>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":71
 *     """
 *     if not (<int>PetscInitializeCalled): return
 *     if (<int>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":72
 *     if not (<int>PetscInitializeCalled): return
 *     if (<int>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":73
 *     if (<int>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":74
 *     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_mstate_global->__pyx_n_u_COMM_WORLD); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 74, __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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(36, 74, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_ccomm = __pyx_t_3;

    /* "petsc4py/PETSc/cyclicgc.pxi":75
 *     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, 75, __pyx_L1_error)

    /* "petsc4py/PETSc/cyclicgc.pxi":73
 *     if (<int>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":77
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(36, 77, __pyx_L1_error)
    __pyx_v_ccomm = __pyx_t_3;

    /* "petsc4py/PETSc/cyclicgc.pxi":78
 *     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":79
 *         ccomm = GetComm(comm, MPI_COMM_NULL)
 *         if ccomm == MPI_COMM_NULL:
 *             raise ValueError("null communicator")             # <<<<<<<<<<<<<<
 *         CHKERR(PetscGarbageCleanup(ccomm))
 * 
*/
      __pyx_t_5 = NULL;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_null_communicator};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 79, __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, 79, __pyx_L1_error)

      /* "petsc4py/PETSc/cyclicgc.pxi":78
 *     else:
 *         ccomm = GetComm(comm, MPI_COMM_NULL)
 *         if ccomm == MPI_COMM_NULL:             # <<<<<<<<<<<<<<
 *             raise ValueError("null communicator")
 *         CHKERR(PetscGarbageCleanup(ccomm))
*/
    }

    /* "petsc4py/PETSc/cyclicgc.pxi":80
 *         if ccomm == MPI_COMM_NULL:
 *             raise ValueError("null communicator")
 *         CHKERR(PetscGarbageCleanup(ccomm))             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGarbageCleanup(__pyx_v_ccomm)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 80, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "petsc4py/PETSc/cyclicgc.pxi":59
 * 
 * 
 * def garbage_cleanup(comm: Comm | None = None) -> 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_XDECREF(__pyx_t_5);
  __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":83
 * 
 * 
 * def garbage_view(comm: Comm | None = None) -> 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: Comm | None = None) -> 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:83");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3garbage_view = {"garbage_view", (PyCFunction)(void(*)(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(36, 83, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(36, 83, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "garbage_view", 0) < (0)) __PYX_ERR(36, 83, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(36, 83, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 83, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  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":94
 * 
 *     """
 *     if not (<int>PetscInitializeCalled): return             # <<<<<<<<<<<<<<
 *     if (<int>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":95
 *     """
 *     if not (<int>PetscInitializeCalled): return
 *     if (<int>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":96
 *     if not (<int>PetscInitializeCalled): return
 *     if (<int>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":97
 *     if (<int>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":98
 *     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_mstate_global->__pyx_n_u_COMM_WORLD); if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 98, __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":97
 *     if (<int>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":99
 *     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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(36, 99, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_3;

  /* "petsc4py/PETSc/cyclicgc.pxi":100
 *         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":101
 *     ccomm = GetComm(comm, MPI_COMM_NULL)
 *     if ccomm == MPI_COMM_NULL:
 *         raise ValueError("null communicator")             # <<<<<<<<<<<<<<
 *     CHKERR(PetscGarbageView(ccomm, NULL))
 * 
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_null_communicator};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(36, 101, __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, 101, __pyx_L1_error)

    /* "petsc4py/PETSc/cyclicgc.pxi":100
 *         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":102
 *     if ccomm == MPI_COMM_NULL:
 *         raise ValueError("null communicator")
 *     CHKERR(PetscGarbageView(ccomm, NULL))             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscGarbageView(__pyx_v_ccomm, NULL)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(36, 102, __pyx_L1_error)

  /* "petsc4py/PETSc/cyclicgc.pxi":83
 * 
 * 
 * def garbage_view(comm: Comm | None = None) -> 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_XDECREF(__pyx_t_4);
  __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":606
 * __type_registry__ = type_registry
 * 
 * cdef int PyPetscType_Register(int classid, type cls) except -1:             # <<<<<<<<<<<<<<
 *     global type_registry
 *     cdef object key = <long>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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7[6];
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscType_Register", 0);

  /* "petsc4py/PETSc/Object.pyx":608
 * cdef int PyPetscType_Register(int classid, type cls) except -1:
 *     global type_registry
 *     cdef object key = <long>classid             # <<<<<<<<<<<<<<
 *     cdef object value = cls
 *     cdef const char *dummy = NULL
*/
  __pyx_t_1 = __Pyx_PyLong_From_long(((long)__pyx_v_classid)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_key = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Object.pyx":609
 *     global type_registry
 *     cdef object key = <long>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":610
 *     cdef object key = <long>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":611
 *     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, 611, __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, 611, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/Object.pyx":612
 *     cdef const char *dummy = NULL
 *     if key not in type_registry:
 *         type_registry[key] = cls             # <<<<<<<<<<<<<<
 *         reg_LogClass(str2bytes(cls.__name__, &dummy),
 *                      <PetscLogClass>classid)
*/
    if (unlikely(__pyx_v_8petsc4py_5PETSc_type_registry == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(35, 612, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_type_registry, __pyx_v_key, ((PyObject *)__pyx_v_cls)) < 0))) __PYX_ERR(35, 612, __pyx_L1_error)

    /* "petsc4py/PETSc/Object.pyx":613
 *     if key not in type_registry:
 *         type_registry[key] = cls
 *         reg_LogClass(str2bytes(cls.__name__, &dummy),             # <<<<<<<<<<<<<<
 *                      <PetscLogClass>classid)
 *         TypeEnableGC(<PyTypeObject*>cls)
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 613, __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, 613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "petsc4py/PETSc/Object.pyx":614
 *         type_registry[key] = cls
 *         reg_LogClass(str2bytes(cls.__name__, &dummy),
 *                      <PetscLogClass>classid)             # <<<<<<<<<<<<<<
 *         TypeEnableGC(<PyTypeObject*>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, 613, __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":615
 *         reg_LogClass(str2bytes(cls.__name__, &dummy),
 *                      <PetscLogClass>classid)
 *         TypeEnableGC(<PyTypeObject*>cls)             # <<<<<<<<<<<<<<
 *     else:
 *         value = type_registry[key]
*/
    __pyx_f_8petsc4py_5PETSc_TypeEnableGC(((PyTypeObject *)__pyx_v_cls));

    /* "petsc4py/PETSc/Object.pyx":611
 *     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":617
 *         TypeEnableGC(<PyTypeObject*>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, 617, __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, 617, __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":618
 *     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":619
 *         value = type_registry[key]
 *         if cls is not value:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 "key: %d, cannot register: %s, "
 *                 "already registered: %s" % (key, cls, value))
*/
      __pyx_t_3 = NULL;

      /* "petsc4py/PETSc/Object.pyx":621
 *             raise ValueError(
 *                 "key: %d, cannot register: %s, "
 *                 "already registered: %s" % (key, cls, value))             # <<<<<<<<<<<<<<
 *     return 0
 * 
*/
      __pyx_t_4 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_v_key), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(35, 621, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(((PyObject *)__pyx_v_cls)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(35, 621, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_value), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(35, 621, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_key;
      __pyx_t_7[1] = __pyx_t_4;
      __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_cannot_register;
      __pyx_t_7[3] = __pyx_t_5;
      __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_already_registered;
      __pyx_t_7[5] = __pyx_t_6;

      /* "petsc4py/PETSc/Object.pyx":620
 *         if cls is not value:
 *             raise ValueError(
 *                 "key: %d, cannot register: %s, "             # <<<<<<<<<<<<<<
 *                 "already registered: %s" % (key, cls, value))
 *     return 0
*/
      __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 6, 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 19 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 22 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
      if (unlikely(!__pyx_t_8)) __PYX_ERR(35, 620, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __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;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8};
        __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 619, __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(35, 619, __pyx_L1_error)

      /* "petsc4py/PETSc/Object.pyx":618
 *     else:
 *         value = type_registry[key]
 *         if cls is not value:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 "key: %d, cannot register: %s, "
*/
    }
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Object.pyx":622
 *                 "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":606
 * __type_registry__ = type_registry
 * 
 * cdef int PyPetscType_Register(int classid, type cls) except -1:             # <<<<<<<<<<<<<<
 *     global type_registry
 *     cdef object key = <long>classid
*/

  /* 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_XDECREF(__pyx_t_8);
  __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":624
 *     return 0
 * 
 * cdef type PyPetscType_Lookup(int classid):             # <<<<<<<<<<<<<<
 *     global type_registry
 *     cdef object key = <long>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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscType_Lookup", 0);

  /* "petsc4py/PETSc/Object.pyx":626
 * cdef type PyPetscType_Lookup(int classid):
 *     global type_registry
 *     cdef object key = <long>classid             # <<<<<<<<<<<<<<
 *     cdef type cls = Object
 *     try:
*/
  __pyx_t_1 = __Pyx_PyLong_From_long(((long)__pyx_v_classid)); if (unlikely(!__pyx_t_1)) __PYX_ERR(35, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_key = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Object.pyx":627
 *     global type_registry
 *     cdef object key = <long>classid
 *     cdef type cls = Object             # <<<<<<<<<<<<<<
 *     try:
 *         cls = type_registry[key]
*/
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object);
  __pyx_v_cls = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;

  /* "petsc4py/PETSc/Object.pyx":628
 *     cdef object key = <long>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":629
 *     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, 629, __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, 629, __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, 629, __pyx_L3_error)
      __Pyx_DECREF_SET(__pyx_v_cls, ((PyTypeObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "petsc4py/PETSc/Object.pyx":628
 *     cdef object key = <long>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":630
 *     try:
 *         cls = type_registry[key]
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         cls = Object
 *     return cls
*/
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_KeyError))));
    if (__pyx_t_5) {
      __Pyx_ErrRestore(0,0,0);

      /* "petsc4py/PETSc/Object.pyx":631
 *         cls = type_registry[key]
 *     except KeyError:
 *         cls = Object             # <<<<<<<<<<<<<<
 *     return cls
 * 
*/
      __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object);
      __Pyx_DECREF_SET(__pyx_v_cls, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "petsc4py/PETSc/Object.pyx":628
 *     cdef object key = <long>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":632
 *     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":624
 *     return 0
 * 
 * cdef type PyPetscType_Lookup(int classid):             # <<<<<<<<<<<<<<
 *     global type_registry
 *     cdef object key = <long>classid
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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":127
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":128
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.vwr             # <<<<<<<<<<<<<<
 *         self.vwr = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->vwr));

  /* "petsc4py/PETSc/Viewer.pyx":129
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.vwr
 *         self.vwr = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self, Object obj) -> None:
*/
  __pyx_v_self->vwr = NULL;

  /* "petsc4py/PETSc/Viewer.pyx":127
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.vwr
 *         self.vwr = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/Viewer.pyx":131
 *         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_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_obj,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 131, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 131, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(37, 131, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, i); __PYX_ERR(37, 131, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 131, __pyx_L3_error)
    }
    __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, 131, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, 0, "obj", 0))) __PYX_ERR(37, 131, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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__", 0);

  /* "petsc4py/PETSc/Viewer.pyx":133
 *     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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(37, 133, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(37, 133, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/Viewer.pyx":134
 *         """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, 134, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":131
 *         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":138
 *     #
 * 
 *     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:138");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_5view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_4view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_obj,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 138, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 138, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(37, 138, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 138, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_obj = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("view", 0, 0, 1, __pyx_nargs); __PYX_ERR(37, 138, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":158
 * 
 *         """
 *         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":159
 *         """
 *         if obj is None:
 *             CHKERR(PetscViewerView(self.vwr, NULL))             # <<<<<<<<<<<<<<
 *         elif isinstance(obj, Viewer):
 *             CHKERR(PetscViewerView(self.vwr, (<Viewer?>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, 159, __pyx_L1_error)

    /* "petsc4py/PETSc/Viewer.pyx":158
 * 
 *         """
 *         if obj is None:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscViewerView(self.vwr, NULL))
 *         elif isinstance(obj, Viewer):
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Viewer.pyx":160
 *         if obj is None:
 *             CHKERR(PetscViewerView(self.vwr, NULL))
 *         elif isinstance(obj, Viewer):             # <<<<<<<<<<<<<<
 *             CHKERR(PetscViewerView(self.vwr, (<Viewer?>obj).vwr))
 *         else:
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Viewer.pyx":161
 *             CHKERR(PetscViewerView(self.vwr, NULL))
 *         elif isinstance(obj, Viewer):
 *             CHKERR(PetscViewerView(self.vwr, (<Viewer?>obj).vwr))             # <<<<<<<<<<<<<<
 *         else:
 *             assert (<Object?>obj).obj != NULL
*/
    if (!(likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer)))) __PYX_ERR(37, 161, __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, 161, __pyx_L1_error)

    /* "petsc4py/PETSc/Viewer.pyx":160
 *         if obj is None:
 *             CHKERR(PetscViewerView(self.vwr, NULL))
 *         elif isinstance(obj, Viewer):             # <<<<<<<<<<<<<<
 *             CHKERR(PetscViewerView(self.vwr, (<Viewer?>obj).vwr))
 *         else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Viewer.pyx":163
 *             CHKERR(PetscViewerView(self.vwr, (<Viewer?>obj).vwr))
 *         else:
 *             assert (<Object?>obj).obj != NULL             # <<<<<<<<<<<<<<
 *             CHKERR(PetscObjectView((<Object?>obj).obj[0], self.vwr))
 * 
*/
  /*else*/ {
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      if (!(likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object)))) __PYX_ERR(37, 163, __pyx_L1_error)
      __pyx_t_1 = (((struct PyPetscObjectObject *)__pyx_v_obj)->obj != NULL);
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(37, 163, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(37, 163, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/Viewer.pyx":164
 *         else:
 *             assert (<Object?>obj).obj != NULL
 *             CHKERR(PetscObjectView((<Object?>obj).obj[0], self.vwr))             # <<<<<<<<<<<<<<
 * 
 *     def destroy(self) -> Self:
*/
    if (!(likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object)))) __PYX_ERR(37, 164, __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, 164, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Viewer.pyx":138
 *     #
 * 
 *     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":166
 *             CHKERR(PetscObjectView((<Object?>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:166");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_7destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_6destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":176
 * 
 *         """
 *         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, 176, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":177
 *         """
 *         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":166
 *             CHKERR(PetscObjectView((<Object?>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":179
 *         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:179");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_9create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_8create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 179, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(37, 179, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(37, 179, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":194
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 194, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":195
 *         """
 *         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":196
 *         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, 196, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":197
 *         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, 197, __pyx_L1_error)
  __pyx_v_self->vwr = __pyx_v_newvwr;

  /* "petsc4py/PETSc/Viewer.pyx":198
 *         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":179
 *         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":200
 *         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:200");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_11createASCII = {"createASCII", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_11createASCII, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_10createASCII};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 200, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(37, 200, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 200, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 200, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createASCII", 0) < (0)) __PYX_ERR(37, 200, __pyx_L3_error)

      /* "petsc4py/PETSc/Viewer.pyx":203
 *         self,
 *         name: str,
 *         mode: FileMode | str | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *        ) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":204
 *         name: str,
 *         mode: FileMode | str | None = None,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *        ) -> Self:
 *         """Create a viewer of type `Type.ASCII`.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createASCII", 0, 1, 3, i); __PYX_ERR(37, 200, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(37, 200, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 200, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 200, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Viewer.pyx":203
 *         self,
 *         name: str,
 *         mode: FileMode | str | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *        ) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":204
 *         name: str,
 *         mode: FileMode | str | None = None,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *        ) -> Self:
 *         """Create a viewer of type `Type.ASCII`.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 200, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":200
 *         return self
 * 
 *     def createASCII(             # <<<<<<<<<<<<<<
 *         self,
 *         name: str,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":225
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 225, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":226
 *         """
 *         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":227
 *         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, 227, __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":228
 *         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":229
 *         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, 229, __pyx_L1_error)
    __pyx_v_cmode = __pyx_t_4;
  }

  /* "petsc4py/PETSc/Viewer.pyx":230
 *         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":231
 *         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, 231, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":232
 *         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, 232, __pyx_L1_error)
  __pyx_v_self->vwr = __pyx_v_newvwr;

  /* "petsc4py/PETSc/Viewer.pyx":233
 *         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, 233, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":234
 *         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, 234, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":235
 *         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, 235, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":236
 *         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":200
 *         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":238
 *         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:238");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_13createBinary = {"createBinary", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_13createBinary, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_12createBinary};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 238, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(37, 238, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 238, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 238, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createBinary", 0) < (0)) __PYX_ERR(37, 238, __pyx_L3_error)

      /* "petsc4py/PETSc/Viewer.pyx":241
 *         self,
 *         name: str,
 *         mode: FileMode | str | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *        ) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":242
 *         name: str,
 *         mode: FileMode | str | None = None,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *        ) -> Self:
 *         """Create a viewer of type `Type.BINARY`.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createBinary", 0, 1, 3, i); __PYX_ERR(37, 238, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(37, 238, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 238, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 238, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Viewer.pyx":241
 *         self,
 *         name: str,
 *         mode: FileMode | str | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *        ) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":242
 *         name: str,
 *         mode: FileMode | str | None = None,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *        ) -> Self:
 *         """Create a viewer of type `Type.BINARY`.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 238, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":238
 *         return self
 * 
 *     def createBinary(             # <<<<<<<<<<<<<<
 *         self,
 *         name: str,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":262
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 262, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":263
 *         """
 *         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":264
 *         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, 264, __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":265
 *         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, 265, __pyx_L1_error)
  __pyx_v_cmode = __pyx_t_3;

  /* "petsc4py/PETSc/Viewer.pyx":266
 *         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":267
 *         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, 267, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":268
 *         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, 268, __pyx_L1_error)
  __pyx_v_self->vwr = __pyx_v_newvwr;

  /* "petsc4py/PETSc/Viewer.pyx":269
 *         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":238
 *         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":271
 *         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:271");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_15createMPIIO = {"createMPIIO", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_15createMPIIO, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_14createMPIIO};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 271, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(37, 271, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 271, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 271, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createMPIIO", 0) < (0)) __PYX_ERR(37, 271, __pyx_L3_error)

      /* "petsc4py/PETSc/Viewer.pyx":274
 *         self,
 *         name: str,
 *         mode: FileMode | str | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *        ) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":275
 *         name: str,
 *         mode: FileMode | str | None = None,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *        ) -> Self:
 *         """Create a viewer of type `Type.BINARY` supporting MPI-IO.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createMPIIO", 0, 1, 3, i); __PYX_ERR(37, 271, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(37, 271, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 271, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 271, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Viewer.pyx":274
 *         self,
 *         name: str,
 *         mode: FileMode | str | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *        ) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":275
 *         name: str,
 *         mode: FileMode | str | None = None,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *        ) -> Self:
 *         """Create a viewer of type `Type.BINARY` supporting MPI-IO.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 271, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":271
 *         return self
 * 
 *     def createMPIIO(             # <<<<<<<<<<<<<<
 *         self,
 *         name: str,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":295
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 295, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":296
 *         """
 *         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":297
 *         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, 297, __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":298
 *         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, 298, __pyx_L1_error)
  __pyx_v_cmode = __pyx_t_3;

  /* "petsc4py/PETSc/Viewer.pyx":299
 *         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":300
 *         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, 300, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":301
 *         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, 301, __pyx_L1_error)
  __pyx_v_self->vwr = __pyx_v_newvwr;

  /* "petsc4py/PETSc/Viewer.pyx":302
 *         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, 302, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":303
 *         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, 303, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":304
 *         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, 304, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":305
 *         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, 305, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":306
 *         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":271
 *         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":308
 *         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:308");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_17createVTK = {"createVTK", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_17createVTK, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_16createVTK};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 308, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(37, 308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createVTK", 0) < (0)) __PYX_ERR(37, 308, __pyx_L3_error)

      /* "petsc4py/PETSc/Viewer.pyx":311
 *         self,
 *         name: str,
 *         mode: FileMode | str | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *        ) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":312
 *         name: str,
 *         mode: FileMode | str | None = None,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *        ) -> Self:
 *         """Create a viewer of type `Type.VTK`.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createVTK", 0, 1, 3, i); __PYX_ERR(37, 308, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(37, 308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 308, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Viewer.pyx":311
 *         self,
 *         name: str,
 *         mode: FileMode | str | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *        ) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":312
 *         name: str,
 *         mode: FileMode | str | None = None,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *        ) -> Self:
 *         """Create a viewer of type `Type.VTK`.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 308, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":308
 *         return self
 * 
 *     def createVTK(             # <<<<<<<<<<<<<<
 *         self,
 *         name: str,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":332
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 332, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":333
 *         """
 *         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":334
 *         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, 334, __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":335
 *         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, 335, __pyx_L1_error)
  __pyx_v_cmode = __pyx_t_3;

  /* "petsc4py/PETSc/Viewer.pyx":336
 *         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":337
 *         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, 337, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":338
 *         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, 338, __pyx_L1_error)
  __pyx_v_self->vwr = __pyx_v_newvwr;

  /* "petsc4py/PETSc/Viewer.pyx":339
 *         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, 339, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":340
 *         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, 340, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":341
 *         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, 341, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":342
 *         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":308
 *         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":344
 *         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:344");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_19createHDF5 = {"createHDF5", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_19createHDF5, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_18createHDF5};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 344, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(37, 344, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 344, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 344, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createHDF5", 0) < (0)) __PYX_ERR(37, 344, __pyx_L3_error)

      /* "petsc4py/PETSc/Viewer.pyx":347
 *         self,
 *         name: str,
 *         mode: FileMode | str | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *        ) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":348
 *         name: str,
 *         mode: FileMode | str | None = None,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *        ) -> Self:
 *         """Create a viewer of type `Type.HDF5`.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createHDF5", 0, 1, 3, i); __PYX_ERR(37, 344, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(37, 344, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 344, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 344, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Viewer.pyx":347
 *         self,
 *         name: str,
 *         mode: FileMode | str | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *        ) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":348
 *         name: str,
 *         mode: FileMode | str | None = None,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *        ) -> Self:
 *         """Create a viewer of type `Type.HDF5`.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 344, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":344
 *         return self
 * 
 *     def createHDF5(             # <<<<<<<<<<<<<<
 *         self,
 *         name: str,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":368
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 368, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":369
 *         """
 *         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":370
 *         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, 370, __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":371
 *         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, 371, __pyx_L1_error)
  __pyx_v_cmode = __pyx_t_3;

  /* "petsc4py/PETSc/Viewer.pyx":372
 *         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":373
 *         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, 373, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":374
 *         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, 374, __pyx_L1_error)
  __pyx_v_self->vwr = __pyx_v_newvwr;

  /* "petsc4py/PETSc/Viewer.pyx":375
 *         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, 375, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":376
 *         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, 376, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":377
 *         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, 377, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":378
 *         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":344
 *         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":380
 *         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:380");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_21createDraw = {"createDraw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_21createDraw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_20createDraw};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_display,&__pyx_mstate_global->__pyx_n_u_title,&__pyx_mstate_global->__pyx_n_u_position,&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 380, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(37, 380, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(37, 380, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(37, 380, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 380, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 380, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createDraw", 0) < (0)) __PYX_ERR(37, 380, __pyx_L3_error)

      /* "petsc4py/PETSc/Viewer.pyx":382
 *     def createDraw(
 *         self,
 *         display: str | None = None,             # <<<<<<<<<<<<<<
 *         title: str | None = None,
 *         position: tuple[int, int] | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":383
 *         self,
 *         display: str | None = None,
 *         title: str | None = None,             # <<<<<<<<<<<<<<
 *         position: tuple[int, int] | None = None,
 *         size: tuple[int, int] | int | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":384
 *         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,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":385
 *         title: str | None = None,
 *         position: tuple[int, int] | None = None,
 *         size: tuple[int, int] | int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *        ) -> Self:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":386
 *         position: tuple[int, int] | None = None,
 *         size: tuple[int, int] | int | None = None,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *        ) -> Self:
 *         """Create a `Type.DRAW` viewer.
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(37, 380, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(37, 380, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(37, 380, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 380, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 380, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Viewer.pyx":382
 *     def createDraw(
 *         self,
 *         display: str | None = None,             # <<<<<<<<<<<<<<
 *         title: str | None = None,
 *         position: tuple[int, int] | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":383
 *         self,
 *         display: str | None = None,
 *         title: str | None = None,             # <<<<<<<<<<<<<<
 *         position: tuple[int, int] | None = None,
 *         size: tuple[int, int] | int | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":384
 *         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,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":385
 *         title: str | None = None,
 *         position: tuple[int, int] | None = None,
 *         size: tuple[int, int] | int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *        ) -> Self:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":386
 *         position: tuple[int, int] | None = None,
 *         size: tuple[int, int] | int | None = None,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *        ) -> Self:
 *         """Create a `Type.DRAW` viewer.
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 380, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":380
 *         return self
 * 
 *     def createDraw(             # <<<<<<<<<<<<<<
 *         self,
 *         display: str | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":410
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 410, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":411
 *         """
 *         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":412
 *         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":413
 *         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, 413, __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":414
 *         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, 414, __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":416
 *         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":417
 *         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, 417, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(37, 417, __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_PyLong_From___pyx_anon_enum(PETSC_DECIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 417, __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, 417, __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, 417, __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":418
 *         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, 418, __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_INCREF(__pyx_t_2);
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_6);
      } else {
        __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 418, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(37, 418, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
      }
      #else
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 418, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(37, 418, __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, 418, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 418, __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, 418, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 418, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 418, __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":417
 *         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":419
 *         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, 419, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(37, 419, __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_PyLong_From___pyx_anon_enum(PETSC_DECIDE); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 419, __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, 419, __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, 419, __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":420
 *             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":421
 *         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, 421, __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_INCREF(__pyx_t_6);
            __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_4);
          } else {
            __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
            if (unlikely(!__pyx_t_6)) __PYX_ERR(37, 421, __pyx_L11_error)
            __Pyx_XGOTREF(__pyx_t_6);
            __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
            if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 421, __pyx_L11_error)
            __Pyx_XGOTREF(__pyx_t_4);
          }
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(37, 421, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 421, __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, 421, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 421, __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, 421, __pyx_L11_error)
          __pyx_L18_unpacking_done:;
        }
        __pyx_t_9 = __Pyx_PyLong_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 421, __pyx_L11_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 421, __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":420
 *             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":422
 *             try:
 *                 w, h = size
 *             except TypeError:             # <<<<<<<<<<<<<<
 *                 w = h = size
 *         cdef PetscViewer newvwr = NULL
*/
      __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_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, 422, __pyx_L13_except_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_2);

        /* "petsc4py/PETSc/Viewer.pyx":423
 *                 w, h = size
 *             except TypeError:
 *                 w = h = size             # <<<<<<<<<<<<<<
 *         cdef PetscViewer newvwr = NULL
 *         CHKERR(PetscViewerDrawOpen(ccomm, cdisplay, ctitle,
*/
        __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_v_size); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 423, __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":420
 *             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":419
 *         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":424
 *             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":425
 *                 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, 425, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":427
 *         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, 427, __pyx_L1_error)
  __pyx_v_self->vwr = __pyx_v_newvwr;

  /* "petsc4py/PETSc/Viewer.pyx":428
 *                                    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":380
 *         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":430
 *         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:430");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_23setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_23setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_22setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vwr_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 430, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 430, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(37, 430, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(37, 430, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 430, __pyx_L3_error)
    }
    __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, 430, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":445
 * 
 *         """
 *         cdef PetscViewerType cval = NULL             # <<<<<<<<<<<<<<
 *         vwr_type = str2bytes(vwr_type, &cval)
 *         CHKERR(PetscViewerSetType(self.vwr, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Viewer.pyx":446
 *         """
 *         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, 446, __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":447
 *         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, 447, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":430
 *         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":449
 *         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:449");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_25getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_25getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_24getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":459
 * 
 *         """
 *         cdef PetscViewerType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerGetType(self.vwr, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Viewer.pyx":460
 *         """
 *         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, 460, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":461
 *         cdef PetscViewerType cval = NULL
 *         CHKERR(PetscViewerGetType(self.vwr, &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(37, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Viewer.pyx":449
 *         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":463
 *         return bytes2str(cval)
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the object from the options database.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_27setFromOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_26setFromOptions, "Viewer.setFromOptions(self) -> None\nConfigure the object from the options database.\n\n        Collective.\n\n        See Also\n        --------\n        petsc_options, petsc.PetscViewerSetFromOptions\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:463");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_27setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_27setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_26setFromOptions};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_27setFromOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_26setFromOptions(((struct PyPetscViewerObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_26setFromOptions(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("setFromOptions", 0);

  /* "petsc4py/PETSc/Viewer.pyx":473
 * 
 *         """
 *         CHKERR(PetscViewerSetFromOptions(self.vwr))             # <<<<<<<<<<<<<<
 * 
 *     def setUp(self) -> Self:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetFromOptions(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 473, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":463
 *         return bytes2str(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.Viewer.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Viewer.pyx":475
 *         CHKERR(PetscViewerSetFromOptions(self.vwr))
 * 
 *     def setUp(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the viewer.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_29setUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_28setUp, "Viewer.setUp(self) -> Self\nSet up the internal data structures for using the viewer.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.PetscViewerSetUp\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:475");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_29setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_29setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_28setUp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_29setUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_28setUp(((struct PyPetscViewerObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_28setUp(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("setUp", 0);

  /* "petsc4py/PETSc/Viewer.pyx":485
 * 
 *         """
 *         CHKERR(PetscViewerSetUp(self.vwr))             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetUp(__pyx_v_self->vwr)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 485, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":486
 *         """
 *         CHKERR(PetscViewerSetUp(self.vwr))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def getFormat(self) -> Format:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Viewer.pyx":475
 *         CHKERR(PetscViewerSetFromOptions(self.vwr))
 * 
 *     def setUp(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the viewer.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Viewer.pyx":488
 *         return self
 * 
 *     def getFormat(self) -> Format:             # <<<<<<<<<<<<<<
 *         """Return the format of the viewer.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_31getFormat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_30getFormat, "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:488");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_31getFormat = {"getFormat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_31getFormat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_30getFormat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_31getFormat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFormat", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_30getFormat(((struct PyPetscViewerObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_30getFormat(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":498
 * 
 *         """
 *         cdef PetscViewerFormat format = PETSC_VIEWER_DEFAULT             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerGetFormat(self.vwr, &format))
 *         return format
*/
  __pyx_v_format = PETSC_VIEWER_DEFAULT;

  /* "petsc4py/PETSc/Viewer.pyx":499
 *         """
 *         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, 499, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":500
 *         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_PyLong_From_PetscViewerFormat(__pyx_v_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Viewer.pyx":488
 *         return self
 * 
 *     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":502
 *         return format
 * 
 *     def pushFormat(self, format: Format) -> None:             # <<<<<<<<<<<<<<
 *         """Push format to the viewer.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_33pushFormat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_32pushFormat, "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:502");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_33pushFormat = {"pushFormat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_33pushFormat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_32pushFormat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_33pushFormat(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_format,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 502, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 502, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "pushFormat", 0) < (0)) __PYX_ERR(37, 502, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("pushFormat", 1, 1, 1, i); __PYX_ERR(37, 502, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 502, __pyx_L3_error)
    }
    __pyx_v_format = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pushFormat", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 502, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_32pushFormat(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_format);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_32pushFormat(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":512
 * 
 *         """
 *         CHKERR(PetscViewerPushFormat(self.vwr, format))             # <<<<<<<<<<<<<<
 * 
 *     def popFormat(self) -> None:
*/
  __pyx_t_1 = ((PetscViewerFormat)__Pyx_PyLong_As_PetscViewerFormat(__pyx_v_format)); if (unlikely(PyErr_Occurred())) __PYX_ERR(37, 512, __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, 512, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":502
 *         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":514
 *         CHKERR(PetscViewerPushFormat(self.vwr, format))
 * 
 *     def popFormat(self) -> None:             # <<<<<<<<<<<<<<
 *         """Pop format from the viewer.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_35popFormat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_34popFormat, "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:514");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_35popFormat = {"popFormat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_35popFormat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_34popFormat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_35popFormat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("popFormat", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_34popFormat(((struct PyPetscViewerObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_34popFormat(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":524
 * 
 *         """
 *         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, 524, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":514
 *         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":526
 *         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_37getSubViewer(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_36getSubViewer, "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:526");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_37getSubViewer = {"getSubViewer", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_37getSubViewer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_36getSubViewer};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_37getSubViewer(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 526, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 526, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSubViewer", 0) < (0)) __PYX_ERR(37, 526, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 526, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getSubViewer", 0, 0, 1, __pyx_nargs); __PYX_ERR(37, 526, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_36getSubViewer(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_comm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_36getSubViewer(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getSubViewer", 0);

  /* "petsc4py/PETSc/Viewer.pyx":545
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 545, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":546
 *         """
 *         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 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 546, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_sub = ((struct PyPetscViewerObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":547
 *         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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerGetSubViewer(__pyx_v_self->vwr, __pyx_v_ccomm, (&__pyx_v_sub->vwr))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 547, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":548
 *         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":526
 *         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_XDECREF(__pyx_t_3);
  __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":550
 *         return sub
 * 
 *     def restoreSubViewer(self, Viewer sub) -> None:             # <<<<<<<<<<<<<<
 *         """Restore a viewer defined on a subcommunicator.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_39restoreSubViewer(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_38restoreSubViewer, "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:550");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_39restoreSubViewer = {"restoreSubViewer", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_39restoreSubViewer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_38restoreSubViewer};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_39restoreSubViewer(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sub,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 550, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 550, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "restoreSubViewer", 0) < (0)) __PYX_ERR(37, 550, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("restoreSubViewer", 1, 1, 1, i); __PYX_ERR(37, 550, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 550, __pyx_L3_error)
    }
    __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, 550, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "sub", 0))) __PYX_ERR(37, 550, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_38restoreSubViewer(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_sub);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_38restoreSubViewer(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;
  size_t __pyx_t_3;
  MPI_Comm __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("restoreSubViewer", 0);

  /* "petsc4py/PETSc/Viewer.pyx":565
 * 
 *         """
 *         cdef MPI_Comm ccomm = def_Comm(sub.getComm(), PETSC_COMM_SELF)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerRestoreSubViewer(self.vwr, ccomm, &sub.vwr))
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_sub);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getComm, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_t_1, PETSC_COMM_SELF); if (unlikely(__pyx_t_4 == ((MPI_Comm const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 565, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ccomm = __pyx_t_4;

  /* "petsc4py/PETSc/Viewer.pyx":566
 *         """
 *         cdef MPI_Comm ccomm = def_Comm(sub.getComm(), PETSC_COMM_SELF)
 *         CHKERR(PetscViewerRestoreSubViewer(self.vwr, ccomm, &sub.vwr))             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerRestoreSubViewer(__pyx_v_self->vwr, __pyx_v_ccomm, (&__pyx_v_sub->vwr))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 566, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":550
 *         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_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":568
 *         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_41STDOUT(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_40STDOUT, "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:568");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_41STDOUT = {"STDOUT", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_41STDOUT, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_40STDOUT};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_41STDOUT(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 568, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 568, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "STDOUT", 0) < (0)) __PYX_ERR(37, 568, __pyx_L3_error)

      /* "petsc4py/PETSc/Viewer.pyx":569
 * 
 *     @classmethod
 *     def STDOUT(cls, comm: Comm | None = None) -> Viewer:             # <<<<<<<<<<<<<<
 *         """Return the standard output viewer associated with the communicator.
 * 
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 568, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("STDOUT", 0, 0, 1, __pyx_nargs); __PYX_ERR(37, 568, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_40STDOUT(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm);

  /* "petsc4py/PETSc/Viewer.pyx":568
 *         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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_40STDOUT(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscViewer __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("STDOUT", 0);

  /* "petsc4py/PETSc/Viewer.pyx":580
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 580, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":581
 *         """
 *         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_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 581, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":582
 *         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_5 = PETSC_VIEWER_STDOUT_(__pyx_v_ccomm); if (unlikely(__pyx_t_5 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(37, 582, __pyx_L1_error)
  __pyx_v_viewer->vwr = __pyx_t_5;

  /* "petsc4py/PETSc/Viewer.pyx":583
 *         cdef Viewer viewer = Viewer()
 *         viewer.vwr = PETSC_VIEWER_STDOUT_(ccomm)
 *         CHKERR(PetscINCREF(viewer.obj))             # <<<<<<<<<<<<<<
 *         return viewer
 * 
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_viewer->__pyx_base.obj)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 583, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":584
 *         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":568
 *         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_XDECREF(__pyx_t_3);
  __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":586
 *         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_43STDERR(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_42STDERR, "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:586");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_43STDERR = {"STDERR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_43STDERR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_42STDERR};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_43STDERR(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 586, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 586, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "STDERR", 0) < (0)) __PYX_ERR(37, 586, __pyx_L3_error)

      /* "petsc4py/PETSc/Viewer.pyx":587
 * 
 *     @classmethod
 *     def STDERR(cls, comm: Comm | None = None) -> Viewer:             # <<<<<<<<<<<<<<
 *         """Return the standard error viewer associated with the communicator.
 * 
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 586, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("STDERR", 0, 0, 1, __pyx_nargs); __PYX_ERR(37, 586, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_42STDERR(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm);

  /* "petsc4py/PETSc/Viewer.pyx":586
 *         return viewer
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def STDERR(cls, comm: Comm | None = None) -> Viewer:
 *         """Return the standard error viewer associated with the communicator.
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_42STDERR(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscViewer __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("STDERR", 0);

  /* "petsc4py/PETSc/Viewer.pyx":598
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 598, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":599
 *         """
 *         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_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 599, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":600
 *         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_5 = PETSC_VIEWER_STDERR_(__pyx_v_ccomm); if (unlikely(__pyx_t_5 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(37, 600, __pyx_L1_error)
  __pyx_v_viewer->vwr = __pyx_t_5;

  /* "petsc4py/PETSc/Viewer.pyx":601
 *         cdef Viewer viewer = Viewer()
 *         viewer.vwr = PETSC_VIEWER_STDERR_(ccomm)
 *         CHKERR(PetscINCREF(viewer.obj))             # <<<<<<<<<<<<<<
 *         return viewer
 * 
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_viewer->__pyx_base.obj)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 601, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":602
 *         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":586
 *         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_XDECREF(__pyx_t_3);
  __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":604
 *         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_45ASCII(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_44ASCII, "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:604");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_45ASCII = {"ASCII", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_45ASCII, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_44ASCII};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_45ASCII(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 604, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 604, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 604, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ASCII", 0) < (0)) __PYX_ERR(37, 604, __pyx_L3_error)

      /* "petsc4py/PETSc/Viewer.pyx":605
 * 
 *     @classmethod
 *     def ASCII(cls, name : str, comm: Comm | None = None) -> Viewer:             # <<<<<<<<<<<<<<
 *         """Return an ASCII viewer associated with the communicator.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ASCII", 0, 1, 2, i); __PYX_ERR(37, 604, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 604, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 604, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 604, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_44ASCII(((PyTypeObject*)__pyx_v_cls), __pyx_v_name, __pyx_v_comm);

  /* "petsc4py/PETSc/Viewer.pyx":604
 *         return viewer
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def ASCII(cls, name : str, comm: Comm | None = None) -> Viewer:
 *         """Return an ASCII viewer associated with the communicator.
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_44ASCII(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  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":618
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 618, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":619
 *         """
 *         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":620
 *         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, 620, __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":621
 *         cdef const char *cname = NULL
 *         name = str2bytes(name, &cname)
 *         cdef Viewer viewer = Viewer()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerASCIIOpen(ccomm, cname, &viewer.vwr))
 *         return viewer
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 621, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":622
 *         name = str2bytes(name, &cname)
 *         cdef Viewer viewer = Viewer()
 *         CHKERR(PetscViewerASCIIOpen(ccomm, cname, &viewer.vwr))             # <<<<<<<<<<<<<<
 *         return viewer
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerASCIIOpen(__pyx_v_ccomm, __pyx_v_cname, (&__pyx_v_viewer->vwr))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 622, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":623
 *         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":604
 *         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_XDECREF(__pyx_t_3);
  __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":625
 *         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_47BINARY(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_46BINARY, "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:625");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_47BINARY = {"BINARY", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_47BINARY, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_46BINARY};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_47BINARY(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 625, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 625, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "BINARY", 0) < (0)) __PYX_ERR(37, 625, __pyx_L3_error)

      /* "petsc4py/PETSc/Viewer.pyx":626
 * 
 *     @classmethod
 *     def BINARY(cls, comm: Comm | None = None) -> Viewer:             # <<<<<<<<<<<<<<
 *         """Return the default `Type.BINARY` viewer associated with the communicator.
 * 
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 625, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("BINARY", 0, 0, 1, __pyx_nargs); __PYX_ERR(37, 625, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_46BINARY(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm);

  /* "petsc4py/PETSc/Viewer.pyx":625
 *         return viewer
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def BINARY(cls, comm: Comm | None = None) -> Viewer:
 *         """Return the default `Type.BINARY` viewer associated with the communicator.
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_46BINARY(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscViewer __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("BINARY", 0);

  /* "petsc4py/PETSc/Viewer.pyx":637
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 637, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":638
 *         """
 *         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_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 638, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":639
 *         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_5 = PETSC_VIEWER_BINARY_(__pyx_v_ccomm); if (unlikely(__pyx_t_5 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(37, 639, __pyx_L1_error)
  __pyx_v_viewer->vwr = __pyx_t_5;

  /* "petsc4py/PETSc/Viewer.pyx":640
 *         cdef Viewer viewer = Viewer()
 *         viewer.vwr = PETSC_VIEWER_BINARY_(ccomm)
 *         CHKERR(PetscINCREF(viewer.obj))             # <<<<<<<<<<<<<<
 *         return viewer
 * 
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_viewer->__pyx_base.obj)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 640, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":641
 *         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":625
 *         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_XDECREF(__pyx_t_3);
  __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":643
 *         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_49DRAW(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_48DRAW, "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:643");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_49DRAW = {"DRAW", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_49DRAW, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_48DRAW};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_49DRAW(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 643, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 643, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "DRAW", 0) < (0)) __PYX_ERR(37, 643, __pyx_L3_error)

      /* "petsc4py/PETSc/Viewer.pyx":644
 * 
 *     @classmethod
 *     def DRAW(cls, comm: Comm | None = None) -> Viewer:             # <<<<<<<<<<<<<<
 *         """Return the default `Type.DRAW` viewer associated with the communicator.
 * 
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 643, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("DRAW", 0, 0, 1, __pyx_nargs); __PYX_ERR(37, 643, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_48DRAW(((PyTypeObject*)__pyx_v_cls), __pyx_v_comm);

  /* "petsc4py/PETSc/Viewer.pyx":643
 *         return viewer
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def DRAW(cls, comm: Comm | None = None) -> Viewer:
 *         """Return the default `Type.DRAW` viewer associated with the communicator.
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_48DRAW(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscViewer __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("DRAW", 0);

  /* "petsc4py/PETSc/Viewer.pyx":655
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 655, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":656
 *         """
 *         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_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 656, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_viewer = ((struct PyPetscViewerObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":657
 *         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_5 = PETSC_VIEWER_DRAW_(__pyx_v_ccomm); if (unlikely(__pyx_t_5 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(37, 657, __pyx_L1_error)
  __pyx_v_viewer->vwr = __pyx_t_5;

  /* "petsc4py/PETSc/Viewer.pyx":658
 *         cdef Viewer viewer = Viewer()
 *         viewer.vwr = PETSC_VIEWER_DRAW_(ccomm)
 *         CHKERR(PetscINCREF(viewer.obj))             # <<<<<<<<<<<<<<
 *         return viewer
 * 
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_viewer->__pyx_base.obj)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 658, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":659
 *         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":643
 *         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_XDECREF(__pyx_t_3);
  __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":663
 *     # --- ASCII viewers ---
 * 
 *     def setASCIITab(self, tabs : int) -> None:             # <<<<<<<<<<<<<<
 *         """Set ASCII tab level.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_51setASCIITab(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_50setASCIITab, "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:663");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_51setASCIITab = {"setASCIITab", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_51setASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_50setASCIITab};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_51setASCIITab(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tabs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 663, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 663, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setASCIITab", 0) < (0)) __PYX_ERR(37, 663, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setASCIITab", 1, 1, 1, i); __PYX_ERR(37, 663, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 663, __pyx_L3_error)
    }
    __pyx_v_tabs = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setASCIITab", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 663, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_50setASCIITab(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_tabs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_50setASCIITab(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":673
 * 
 *         """
 *         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, 673, __pyx_L1_error)
  __pyx_v_ctabs = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":674
 *         """
 *         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, 674, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":663
 *     # --- 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":676
 *         CHKERR(PetscViewerASCIISetTab(self.vwr, ctabs))
 * 
 *     def getASCIITab(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the ASCII tab level.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_53getASCIITab(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_52getASCIITab, "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:676");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_53getASCIITab = {"getASCIITab", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_53getASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_52getASCIITab};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_53getASCIITab(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getASCIITab", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_52getASCIITab(((struct PyPetscViewerObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_52getASCIITab(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":686
 * 
 *         """
 *         cdef PetscInt tabs = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerASCIIGetTab(self.vwr, &tabs))
 *         return toInt(tabs)
*/
  __pyx_v_tabs = 0;

  /* "petsc4py/PETSc/Viewer.pyx":687
 *         """
 *         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, 687, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":688
 *         cdef PetscInt tabs = 0
 *         CHKERR(PetscViewerASCIIGetTab(self.vwr, &tabs))
 *         return toInt(tabs)             # <<<<<<<<<<<<<<
 * 
 *     def addASCIITab(self, tabs: int) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_tabs); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Viewer.pyx":676
 *         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":690
 *         return toInt(tabs)
 * 
 *     def addASCIITab(self, tabs: int) -> None:             # <<<<<<<<<<<<<<
 *         """Increment the ASCII tab level.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_55addASCIITab(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_54addASCIITab, "Viewer.addASCIITab(self, tabs: int) -> None\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:690");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_55addASCIITab = {"addASCIITab", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_55addASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_54addASCIITab};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_55addASCIITab(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tabs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 690, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 690, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addASCIITab", 0) < (0)) __PYX_ERR(37, 690, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addASCIITab", 1, 1, 1, i); __PYX_ERR(37, 690, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 690, __pyx_L3_error)
    }
    __pyx_v_tabs = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("addASCIITab", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 690, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_54addASCIITab(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_tabs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_54addASCIITab(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":700
 * 
 *         """
 *         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, 700, __pyx_L1_error)
  __pyx_v_ctabs = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":701
 *         """
 *         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, 701, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":690
 *         return toInt(tabs)
 * 
 *     def addASCIITab(self, tabs: int) -> None:             # <<<<<<<<<<<<<<
 *         """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":703
 *         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_57subtractASCIITab(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_56subtractASCIITab, "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:703");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_57subtractASCIITab = {"subtractASCIITab", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_57subtractASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_56subtractASCIITab};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_57subtractASCIITab(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tabs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 703, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 703, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "subtractASCIITab", 0) < (0)) __PYX_ERR(37, 703, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("subtractASCIITab", 1, 1, 1, i); __PYX_ERR(37, 703, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 703, __pyx_L3_error)
    }
    __pyx_v_tabs = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("subtractASCIITab", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 703, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_56subtractASCIITab(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_tabs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_56subtractASCIITab(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":713
 * 
 *         """
 *         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, 713, __pyx_L1_error)
  __pyx_v_ctabs = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":714
 *         """
 *         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, 714, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":703
 *         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":716
 *         CHKERR(PetscViewerASCIISubtractTab(self.vwr, ctabs))
 * 
 *     def pushASCIISynchronized(self) -> None:             # <<<<<<<<<<<<<<
 *         """Allow ASCII synchronized calls.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_59pushASCIISynchronized(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_58pushASCIISynchronized, "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:716");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_59pushASCIISynchronized = {"pushASCIISynchronized", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_59pushASCIISynchronized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_58pushASCIISynchronized};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_59pushASCIISynchronized(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("pushASCIISynchronized", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_58pushASCIISynchronized(((struct PyPetscViewerObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_58pushASCIISynchronized(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":727
 * 
 *         """
 *         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, 727, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":716
 *         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":729
 *         CHKERR(PetscViewerASCIIPushSynchronized(self.vwr))
 * 
 *     def popASCIISynchronized(self) -> None:             # <<<<<<<<<<<<<<
 *         """Disallow ASCII synchronized calls.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_61popASCIISynchronized(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_60popASCIISynchronized, "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:729");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_61popASCIISynchronized = {"popASCIISynchronized", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_61popASCIISynchronized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_60popASCIISynchronized};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_61popASCIISynchronized(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("popASCIISynchronized", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_60popASCIISynchronized(((struct PyPetscViewerObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_60popASCIISynchronized(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":740
 * 
 *         """
 *         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, 740, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":729
 *         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":742
 *         CHKERR(PetscViewerASCIIPopSynchronized(self.vwr))
 * 
 *     def pushASCIITab(self) -> None:             # <<<<<<<<<<<<<<
 *         """Push an additional tab level.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_63pushASCIITab(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_62pushASCIITab, "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:742");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_63pushASCIITab = {"pushASCIITab", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_63pushASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_62pushASCIITab};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_63pushASCIITab(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("pushASCIITab", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_62pushASCIITab(((struct PyPetscViewerObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_62pushASCIITab(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":752
 * 
 *         """
 *         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, 752, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":742
 *         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":754
 *         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_65popASCIITab(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_64popASCIITab, "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:754");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_65popASCIITab = {"popASCIITab", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_65popASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_64popASCIITab};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_65popASCIITab(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("popASCIITab", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_64popASCIITab(((struct PyPetscViewerObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_64popASCIITab(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":764
 * 
 *         """
 *         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, 764, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":754
 *         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":766
 *         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_67useASCIITabs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_66useASCIITabs, "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:766");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_67useASCIITabs = {"useASCIITabs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_67useASCIITabs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_66useASCIITabs};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_67useASCIITabs(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 766, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 766, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "useASCIITabs", 0) < (0)) __PYX_ERR(37, 766, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("useASCIITabs", 1, 1, 1, i); __PYX_ERR(37, 766, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 766, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("useASCIITabs", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 766, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_66useASCIITabs(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_66useASCIITabs(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":776
 * 
 *         """
 *         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, 776, __pyx_L1_error)
  __pyx_v_flg = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":777
 *         """
 *         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, 777, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":766
 *         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":779
 *         CHKERR(PetscViewerASCIIUseTabs(self.vwr, flg))
 * 
 *     def printfASCII(self, msg: str) -> None:             # <<<<<<<<<<<<<<
 *         """Print a message.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_69printfASCII(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_68printfASCII, "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:779");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_69printfASCII = {"printfASCII", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_69printfASCII, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_68printfASCII};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_69printfASCII(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_msg,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 779, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 779, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "printfASCII", 0) < (0)) __PYX_ERR(37, 779, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("printfASCII", 1, 1, 1, i); __PYX_ERR(37, 779, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 779, __pyx_L3_error)
    }
    __pyx_v_msg = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("printfASCII", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 779, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_68printfASCII(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_msg);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_68printfASCII(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":789
 * 
 *         """
 *         cdef const char *cmsg = NULL             # <<<<<<<<<<<<<<
 *         msg = str2bytes(msg, &cmsg)
 *         CHKERR(PetscViewerASCIIPrintf(self.vwr, '%s', cmsg))
*/
  __pyx_v_cmsg = NULL;

  /* "petsc4py/PETSc/Viewer.pyx":790
 *         """
 *         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, 790, __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":791
 *         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, 791, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":779
 *         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":793
 *         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_71printfASCIISynchronized(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_70printfASCIISynchronized, "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:793");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_71printfASCIISynchronized = {"printfASCIISynchronized", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_71printfASCIISynchronized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_70printfASCIISynchronized};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_71printfASCIISynchronized(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_msg,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 793, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 793, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "printfASCIISynchronized", 0) < (0)) __PYX_ERR(37, 793, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("printfASCIISynchronized", 1, 1, 1, i); __PYX_ERR(37, 793, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 793, __pyx_L3_error)
    }
    __pyx_v_msg = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("printfASCIISynchronized", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 793, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_70printfASCIISynchronized(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_msg);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_70printfASCIISynchronized(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":803
 * 
 *         """
 *         cdef const char *cmsg = NULL             # <<<<<<<<<<<<<<
 *         msg = str2bytes(msg, &cmsg)
 *         CHKERR(PetscViewerASCIISynchronizedPrintf(self.vwr, '%s', cmsg))
*/
  __pyx_v_cmsg = NULL;

  /* "petsc4py/PETSc/Viewer.pyx":804
 *         """
 *         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, 804, __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":805
 *         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, 805, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":793
 *         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":809
 *     # --- methods specific to file viewers ---
 * 
 *     def flush(self) -> None:             # <<<<<<<<<<<<<<
 *         """Flush the viewer.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_73flush(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_72flush, "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:809");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_73flush = {"flush", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_73flush, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_72flush};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_73flush(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("flush", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_72flush(((struct PyPetscViewerObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_72flush(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":819
 * 
 *         """
 *         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, 819, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":809
 *     # --- 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":821
 *         CHKERR(PetscViewerFlush(self.vwr))
 * 
 *     def setFileMode(self, mode: FileMode | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set file mode.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_75setFileMode(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_74setFileMode, "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:821");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_75setFileMode = {"setFileMode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_75setFileMode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_74setFileMode};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_75setFileMode(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 821, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 821, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFileMode", 0) < (0)) __PYX_ERR(37, 821, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFileMode", 1, 1, 1, i); __PYX_ERR(37, 821, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 821, __pyx_L3_error)
    }
    __pyx_v_mode = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setFileMode", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 821, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_74setFileMode(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_mode);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_74setFileMode(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":831
 * 
 *         """
 *         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, 831, __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, 831, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":821
 *         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":833
 *         CHKERR(PetscViewerFileSetMode(self.vwr, filemode(mode)))
 * 
 *     def getFileMode(self) -> FileMode:             # <<<<<<<<<<<<<<
 *         """Return the file mode.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_77getFileMode(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_76getFileMode, "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:833");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_77getFileMode = {"getFileMode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_77getFileMode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_76getFileMode};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_77getFileMode(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFileMode", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_76getFileMode(((struct PyPetscViewerObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_76getFileMode(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":843
 * 
 *         """
 *         cdef PetscFileMode mode = PETSC_FILE_MODE_READ             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerFileGetMode(self.vwr, &mode))
 *         return mode
*/
  __pyx_v_mode = FILE_MODE_READ;

  /* "petsc4py/PETSc/Viewer.pyx":844
 *         """
 *         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, 844, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":845
 *         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_PyLong_From_PetscFileMode(__pyx_v_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Viewer.pyx":833
 *         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":847
 *         return mode
 * 
 *     def setFileName(self, name: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set file name.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_79setFileName(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_78setFileName, "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:847");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_79setFileName = {"setFileName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_79setFileName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_78setFileName};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_79setFileName(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 847, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 847, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFileName", 0) < (0)) __PYX_ERR(37, 847, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFileName", 1, 1, 1, i); __PYX_ERR(37, 847, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 847, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setFileName", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 847, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_78setFileName(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_78setFileName(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":857
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         name = str2bytes(name, &cval)
 *         CHKERR(PetscViewerFileSetName(self.vwr, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Viewer.pyx":858
 *         """
 *         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, 858, __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":859
 *         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, 859, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":847
 *         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":861
 *         CHKERR(PetscViewerFileSetName(self.vwr, cval))
 * 
 *     def getFileName(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return file name.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_81getFileName(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_80getFileName, "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:861");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_81getFileName = {"getFileName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_81getFileName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_80getFileName};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_81getFileName(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFileName", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_80getFileName(((struct PyPetscViewerObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_80getFileName(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":871
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerFileGetName(self.vwr, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Viewer.pyx":872
 *         """
 *         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, 872, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":873
 *         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, 873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Viewer.pyx":861
 *         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":877
 *     # --- methods specific to draw viewers ---
 * 
 *     def setDrawInfo(             # <<<<<<<<<<<<<<
 *         self,
 *         display: str | None = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_83setDrawInfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_82setDrawInfo, "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:877");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_83setDrawInfo = {"setDrawInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_83setDrawInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_82setDrawInfo};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_83setDrawInfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_display,&__pyx_mstate_global->__pyx_n_u_title,&__pyx_mstate_global->__pyx_n_u_position,&__pyx_mstate_global->__pyx_n_u_size,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 877, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(37, 877, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(37, 877, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 877, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 877, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDrawInfo", 0) < (0)) __PYX_ERR(37, 877, __pyx_L3_error)

      /* "petsc4py/PETSc/Viewer.pyx":879
 *     def setDrawInfo(
 *         self,
 *         display: str | None = None,             # <<<<<<<<<<<<<<
 *         title: str | None = None,
 *         position: tuple[int, int] | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":880
 *         self,
 *         display: str | None = None,
 *         title: str | None = None,             # <<<<<<<<<<<<<<
 *         position: tuple[int, int] | None = None,
 *         size: tuple[int, int] | int | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":881
 *         display: str | None = None,
 *         title: str | None = None,
 *         position: tuple[int, int] | None = None,             # <<<<<<<<<<<<<<
 *         size: tuple[int, int] | int | None = None,
 *        ) -> None:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":882
 *         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.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(37, 877, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(37, 877, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 877, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 877, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Viewer.pyx":879
 *     def setDrawInfo(
 *         self,
 *         display: str | None = None,             # <<<<<<<<<<<<<<
 *         title: str | None = None,
 *         position: tuple[int, int] | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":880
 *         self,
 *         display: str | None = None,
 *         title: str | None = None,             # <<<<<<<<<<<<<<
 *         position: tuple[int, int] | None = None,
 *         size: tuple[int, int] | int | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":881
 *         display: str | None = None,
 *         title: str | None = None,
 *         position: tuple[int, int] | None = None,             # <<<<<<<<<<<<<<
 *         size: tuple[int, int] | int | None = None,
 *        ) -> None:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":882
 *         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.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 877, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_82setDrawInfo(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_display, __pyx_v_title, __pyx_v_position, __pyx_v_size);

  /* "petsc4py/PETSc/Viewer.pyx":877
 *     # --- methods specific to draw viewers ---
 * 
 *     def setDrawInfo(             # <<<<<<<<<<<<<<
 *         self,
 *         display: str | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_82setDrawInfo(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":904
 *         # --------
 *         # petsc.PetscViewerDrawSetInfo
 *         cdef const char *cdisplay = NULL             # <<<<<<<<<<<<<<
 *         cdef const char *ctitle = NULL
 *         display = str2bytes(display, &cdisplay)
*/
  __pyx_v_cdisplay = NULL;

  /* "petsc4py/PETSc/Viewer.pyx":905
 *         # 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":906
 *         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, 906, __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":907
 *         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, 907, __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":909
 *         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":910
 *         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, 910, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(37, 910, __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_PyLong_From___pyx_anon_enum(PETSC_DECIDE); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 910, __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, 910, __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, 910, __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":911
 *         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, 911, __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_INCREF(__pyx_t_1);
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_5);
      } else {
        __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 911, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(37, 911, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
      }
      #else
      __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 911, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(37, 911, __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, 911, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 911, __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, 911, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 911, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_5); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 911, __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":910
 *         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":912
 *         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, 912, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(37, 912, __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_PyLong_From___pyx_anon_enum(PETSC_DECIDE); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 912, __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, 912, __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, 912, __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":913
 *             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":914
 *         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, 914, __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_INCREF(__pyx_t_5);
            __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
            __Pyx_INCREF(__pyx_t_3);
          } else {
            __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
            if (unlikely(!__pyx_t_5)) __PYX_ERR(37, 914, __pyx_L11_error)
            __Pyx_XGOTREF(__pyx_t_5);
            __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
            if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 914, __pyx_L11_error)
            __Pyx_XGOTREF(__pyx_t_3);
          }
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(37, 914, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(37, 914, __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, 914, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 914, __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, 914, __pyx_L11_error)
          __pyx_L18_unpacking_done:;
        }
        __pyx_t_8 = __Pyx_PyLong_As_int(__pyx_t_5); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 914, __pyx_L11_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 914, __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":913
 *             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":915
 *             try:
 *                 w, h = size
 *             except TypeError:             # <<<<<<<<<<<<<<
 *                 w = h = size
 *         CHKERR(PetscViewerDrawSetInfo(self.vwr,
*/
      __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_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, 915, __pyx_L13_except_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_1);

        /* "petsc4py/PETSc/Viewer.pyx":916
 *                 w, h = size
 *             except TypeError:
 *                 w = h = size             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerDrawSetInfo(self.vwr,
 *                                       cdisplay, ctitle,
*/
        __pyx_t_7 = __Pyx_PyLong_As_int(__pyx_v_size); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(37, 916, __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":913
 *             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":912
 *         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":917
 *             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, 917, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":877
 *     # --- 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":921
 *                                       x, y, w, h))
 * 
 *     def clearDraw(self) -> None:             # <<<<<<<<<<<<<<
 *         """Reset graphics.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_85clearDraw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_84clearDraw, "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:921");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_85clearDraw = {"clearDraw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_85clearDraw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_84clearDraw};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_85clearDraw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("clearDraw", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_84clearDraw(((struct PyPetscViewerObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_84clearDraw(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":931
 * 
 *         """
 *         CHKERR(PetscViewerDrawClear(self.vwr))             # <<<<<<<<<<<<<<
 * 
 *     def createPython(self, context: Any = None, comm: Comm | None = None) -> Self:
*/
  __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, 931, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":921
 *                                       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":933
 *         CHKERR(PetscViewerDrawClear(self.vwr))
 * 
 *     def createPython(self, context: Any = None, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.PYTHON` viewer.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_87createPython(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_86createPython, "Viewer.createPython(self, context: Any = None, comm: Comm | None = None) -> Self\nCreate a `Type.PYTHON` viewer.\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_viewer, setType, setPythonContext, Type.PYTHON\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:933");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_87createPython = {"createPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_87createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_86createPython};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_87createPython(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_context,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 933, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 933, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 933, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createPython", 0) < (0)) __PYX_ERR(37, 933, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 933, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 933, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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(37, 933, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_86createPython(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_context, __pyx_v_comm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_86createPython(struct PyPetscViewerObject *__pyx_v_self, PyObject *__pyx_v_context, 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;
  PetscErrorCode __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createPython", 0);

  /* "petsc4py/PETSc/Viewer.pyx":951
 *         """
 *         # communicator and sizes
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 951, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":952
 *         # communicator and sizes
 *         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":953
 *         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
 *         CHKERR(PetscViewerSetType(self.vwr, PETSCVIEWERPYTHON))
*/
  __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, 953, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":954
 *         cdef PetscViewer newvwr = NULL
 *         CHKERR(PetscViewerCreate(ccomm, &newvwr))
 *         CHKERR(PetscCLEAR(self.obj)); self.vwr = newvwr             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerSetType(self.vwr, PETSCVIEWERPYTHON))
 *         CHKERR(PetscViewerPythonSetContext(self.vwr, <void*>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(37, 954, __pyx_L1_error)
  __pyx_v_self->vwr = __pyx_v_newvwr;

  /* "petsc4py/PETSc/Viewer.pyx":955
 *         CHKERR(PetscViewerCreate(ccomm, &newvwr))
 *         CHKERR(PetscCLEAR(self.obj)); self.vwr = newvwr
 *         CHKERR(PetscViewerSetType(self.vwr, PETSCVIEWERPYTHON))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerPythonSetContext(self.vwr, <void*>context))
 *         if context:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetType(__pyx_v_self->vwr, PETSCVIEWERPYTHON)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 955, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":956
 *         CHKERR(PetscCLEAR(self.obj)); self.vwr = newvwr
 *         CHKERR(PetscViewerSetType(self.vwr, PETSCVIEWERPYTHON))
 *         CHKERR(PetscViewerPythonSetContext(self.vwr, <void*>context))             # <<<<<<<<<<<<<<
 *         if context:
 *             CHKERR(PetscViewerSetUp(self.vwr))
*/
  __pyx_t_2 = PetscViewerPythonSetContext(__pyx_v_self->vwr, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 956, __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(37, 956, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":957
 *         CHKERR(PetscViewerSetType(self.vwr, PETSCVIEWERPYTHON))
 *         CHKERR(PetscViewerPythonSetContext(self.vwr, <void*>context))
 *         if context:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscViewerSetUp(self.vwr))
 *         return self
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_context); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(37, 957, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "petsc4py/PETSc/Viewer.pyx":958
 *         CHKERR(PetscViewerPythonSetContext(self.vwr, <void*>context))
 *         if context:
 *             CHKERR(PetscViewerSetUp(self.vwr))             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerSetUp(__pyx_v_self->vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 958, __pyx_L1_error)

    /* "petsc4py/PETSc/Viewer.pyx":957
 *         CHKERR(PetscViewerSetType(self.vwr, PETSCVIEWERPYTHON))
 *         CHKERR(PetscViewerPythonSetContext(self.vwr, <void*>context))
 *         if context:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscViewerSetUp(self.vwr))
 *         return self
*/
  }

  /* "petsc4py/PETSc/Viewer.pyx":959
 *         if context:
 *             CHKERR(PetscViewerSetUp(self.vwr))
 *         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/Viewer.pyx":933
 *         CHKERR(PetscViewerDrawClear(self.vwr))
 * 
 *     def createPython(self, context: Any = None, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.PYTHON` viewer.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Viewer.createPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Viewer.pyx":961
 *         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_6Viewer_89setPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_88setPythonContext, "Viewer.setPythonContext(self, context: Any) -> None\nSet the instance of the class implementing the required Python methods.\n\n        Logically collective.\n\n        See Also\n        --------\n        petsc_python_viewer, getPythonContext, setPythonType\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:961");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_89setPythonContext = {"setPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_89setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_88setPythonContext};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_89setPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_context,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 961, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 961, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPythonContext", 0) < (0)) __PYX_ERR(37, 961, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, i); __PYX_ERR(37, 961, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 961, __pyx_L3_error)
    }
    __pyx_v_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 961, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_88setPythonContext(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_context);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_88setPythonContext(struct PyPetscViewerObject *__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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":971
 * 
 *         """
 *         CHKERR(PetscViewerPythonSetContext(self.vwr, <void*>context))             # <<<<<<<<<<<<<<
 * 
 *     def getPythonContext(self) -> Any:
*/
  __pyx_t_1 = PetscViewerPythonSetContext(__pyx_v_self->vwr, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 971, __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(37, 971, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":961
 *         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.Viewer.setPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Viewer.pyx":973
 *         CHKERR(PetscViewerPythonSetContext(self.vwr, <void*>context))
 * 
 *     def getPythonContext(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return the instance of the class implementing the required Python methods.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_91getPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_90getPythonContext, "Viewer.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_viewer, setPythonContext\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:973");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_91getPythonContext = {"getPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_91getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_90getPythonContext};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_91getPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPythonContext", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_90getPythonContext(((struct PyPetscViewerObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_90getPythonContext(struct PyPetscViewerObject *__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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":983
 * 
 *         """
 *         cdef void *context = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerPythonGetContext(self.vwr, &context))
 *         if context == NULL: return None
*/
  __pyx_v_context = NULL;

  /* "petsc4py/PETSc/Viewer.pyx":984
 *         """
 *         cdef void *context = NULL
 *         CHKERR(PetscViewerPythonGetContext(self.vwr, &context))             # <<<<<<<<<<<<<<
 *         if context == NULL: return None
 *         else: return <object> context
*/
  __pyx_t_1 = PetscViewerPythonGetContext(__pyx_v_self->vwr, (&__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 984, __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(37, 984, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":985
 *         cdef void *context = NULL
 *         CHKERR(PetscViewerPythonGetContext(self.vwr, &context))
 *         if context == NULL: return None             # <<<<<<<<<<<<<<
 *         else: return <object> 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/Viewer.pyx":986
 *         CHKERR(PetscViewerPythonGetContext(self.vwr, &context))
 *         if context == NULL: return None
 *         else: return <object> 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/Viewer.pyx":973
 *         CHKERR(PetscViewerPythonSetContext(self.vwr, <void*>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.Viewer.getPythonContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Viewer.pyx":988
 *         else: return <object> 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_6Viewer_93setPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_92setPythonType, "Viewer.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_viewer, setPythonContext, getPythonType\n        petsc.PetscViewerPythonSetType\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:988");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_93setPythonType = {"setPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_93setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_92setPythonType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_93setPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_py_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 988, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 988, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPythonType", 0) < (0)) __PYX_ERR(37, 988, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, i); __PYX_ERR(37, 988, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 988, __pyx_L3_error)
    }
    __pyx_v_py_type = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 988, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Viewer.setPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_92setPythonType(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_py_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_92setPythonType(struct PyPetscViewerObject *__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/Viewer.pyx":999
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         py_type = str2bytes(py_type, &cval)
 *         CHKERR(PetscViewerPythonSetType(self.vwr, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Viewer.pyx":1000
 *         """
 *         cdef const char *cval = NULL
 *         py_type = str2bytes(py_type, &cval)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerPythonSetType(self.vwr, cval))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_py_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_py_type, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":1001
 *         cdef const char *cval = NULL
 *         py_type = str2bytes(py_type, &cval)
 *         CHKERR(PetscViewerPythonSetType(self.vwr, cval))             # <<<<<<<<<<<<<<
 * 
 *     def getPythonType(self) -> str:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerPythonSetType(__pyx_v_self->vwr, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 1001, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":988
 *         else: return <object> 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.Viewer.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/Viewer.pyx":1003
 *         CHKERR(PetscViewerPythonSetType(self.vwr, cval))
 * 
 *     def getPythonType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the fully qualified Python name of the class used by the viewer.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_95getPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_94getPythonType, "Viewer.getPythonType(self) -> str\nReturn the fully qualified Python name of the class used by the viewer.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc_python_viewer, setPythonContext, setPythonType\n        petsc.PetscViewerPythonGetType\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:1003");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_95getPythonType = {"getPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_95getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_94getPythonType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_95getPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPythonType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_94getPythonType(((struct PyPetscViewerObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_94getPythonType(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("getPythonType", 0);

  /* "petsc4py/PETSc/Viewer.pyx":1014
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerPythonGetType(self.vwr, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Viewer.pyx":1015
 *         """
 *         cdef const char *cval = NULL
 *         CHKERR(PetscViewerPythonGetType(self.vwr, &cval))             # <<<<<<<<<<<<<<
 *         return bytes2str(cval)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerPythonGetType(__pyx_v_self->vwr, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 1015, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1016
 *         cdef const char *cval = NULL
 *         CHKERR(PetscViewerPythonGetType(self.vwr, &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     def viewObjectPython(self, Object obj) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Viewer.pyx":1003
 *         CHKERR(PetscViewerPythonSetType(self.vwr, cval))
 * 
 *     def getPythonType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the fully qualified Python name of the class used by the viewer.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Viewer.getPythonType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Viewer.pyx":1018
 *         return bytes2str(cval)
 * 
 *     def viewObjectPython(self, Object obj) -> None:             # <<<<<<<<<<<<<<
 *         """View a generic `Object`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_97viewObjectPython(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_96viewObjectPython, "Viewer.viewObjectPython(self, obj: Object) -> None\nView a generic `Object`.\n\n        Collective.\n\n        See Also\n        --------\n        petsc_python_viewer, setPythonContext, setPythonType\n        petsc.PetscViewerPythonViewObject\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:1018");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Viewer_97viewObjectPython = {"viewObjectPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_97viewObjectPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_96viewObjectPython};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6Viewer_97viewObjectPython(PyObject *__pyx_v_self, 
#if 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_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("viewObjectPython (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_obj,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 1018, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 1018, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "viewObjectPython", 0) < (0)) __PYX_ERR(37, 1018, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("viewObjectPython", 1, 1, 1, i); __PYX_ERR(37, 1018, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 1018, __pyx_L3_error)
    }
    __pyx_v_obj = ((struct PyPetscObjectObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("viewObjectPython", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 1018, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Viewer.viewObjectPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_obj), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, 0, "obj", 0))) __PYX_ERR(37, 1018, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6Viewer_96viewObjectPython(((struct PyPetscViewerObject *)__pyx_v_self), __pyx_v_obj);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6Viewer_96viewObjectPython(struct PyPetscViewerObject *__pyx_v_self, struct PyPetscObjectObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscErrorCode __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("viewObjectPython", 0);

  /* "petsc4py/PETSc/Viewer.pyx":1029
 * 
 *         """
 *         CHKERR(PetscViewerPythonViewObject(self.vwr, obj.obj[0]))             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerPythonViewObject(__pyx_v_self->vwr, (__pyx_v_obj->obj[0]))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(37, 1029, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1018
 *         return bytes2str(cval)
 * 
 *     def viewObjectPython(self, Object obj) -> None:             # <<<<<<<<<<<<<<
 *         """View a generic `Object`.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Viewer.viewObjectPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Viewer.pyx":1044
 *     """
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         name: str,
*/

/* 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: str, mode: Viewer.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        Viewer.createHDF5\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:1044");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_1create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 1044, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(37, 1044, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 1044, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 1044, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(37, 1044, __pyx_L3_error)

      /* "petsc4py/PETSc/Viewer.pyx":1047
 *         self,
 *         name: str,
 *         mode: Viewer.FileMode | str | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *        ) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":1048
 *         name: str,
 *         mode: Viewer.FileMode | str | None = None,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *        ) -> Self:
 *         """Create a viewer of type `Type.HDF5`.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, i); __PYX_ERR(37, 1044, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(37, 1044, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(37, 1044, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 1044, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Viewer.pyx":1047
 *         self,
 *         name: str,
 *         mode: Viewer.FileMode | str | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *        ) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Viewer.pyx":1048
 *         name: str,
 *         mode: Viewer.FileMode | str | None = None,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *        ) -> Self:
 *         """Create a viewer of type `Type.HDF5`.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1044, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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);

  /* "petsc4py/PETSc/Viewer.pyx":1044
 *     """
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         name: str,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":1068
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(37, 1068, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Viewer.pyx":1069
 *         """
 *         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":1070
 *         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, 1070, __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":1071
 *         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, 1071, __pyx_L1_error)
  __pyx_v_cmode = __pyx_t_3;

  /* "petsc4py/PETSc/Viewer.pyx":1072
 *         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":1073
 *         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, 1073, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1074
 *         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, 1074, __pyx_L1_error)
  __pyx_v_self->__pyx_base.vwr = __pyx_v_newvwr;

  /* "petsc4py/PETSc/Viewer.pyx":1075
 *         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, 1075, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1076
 *         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, 1076, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1077
 *         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, 1077, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1078
 *         CHKERR(PetscViewerFileSetMode(self.vwr, cmode))
 *         CHKERR(PetscViewerFileSetName(self.vwr, cname))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def pushTimestepping(self) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Viewer.pyx":1044
 *     """
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         name: str,
*/

  /* 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":1080
 *         return self
 * 
 *     def pushTimestepping(self) -> None:             # <<<<<<<<<<<<<<
 *         """Activate the timestepping mode.
 * 
*/

/* 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) -> None\nActivate the timestepping mode.\n\n        Logically collective.\n\n        See Also\n        --------\n        popTimestepping, petsc.PetscViewerHDF5PushTimestepping\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:1080");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_3pushTimestepping = {"pushTimestepping", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_3pushTimestepping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_2pushTimestepping};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("pushTimestepping", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":1090
 * 
 *         """
 *         CHKERR(PetscViewerHDF5PushTimestepping(self.vwr))             # <<<<<<<<<<<<<<
 * 
 *     def popTimestepping(self) -> None:
*/
  __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, 1090, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1080
 *         return self
 * 
 *     def pushTimestepping(self) -> None:             # <<<<<<<<<<<<<<
 *         """Activate the timestepping mode.
 * 
*/

  /* 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":1092
 *         CHKERR(PetscViewerHDF5PushTimestepping(self.vwr))
 * 
 *     def popTimestepping(self) -> None:             # <<<<<<<<<<<<<<
 *         """Deactivate the timestepping mode.
 * 
*/

/* 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) -> None\nDeactivate the timestepping mode.\n\n        Logically collective.\n\n        See Also\n        --------\n        pushTimestepping, petsc.PetscViewerHDF5PopTimestepping\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:1092");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_5popTimestepping = {"popTimestepping", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_5popTimestepping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_4popTimestepping};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("popTimestepping", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":1102
 * 
 *         """
 *         CHKERR(PetscViewerHDF5PopTimestepping(self.vwr))             # <<<<<<<<<<<<<<
 * 
 *     def getTimestep(self) -> int:
*/
  __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, 1102, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1092
 *         CHKERR(PetscViewerHDF5PushTimestepping(self.vwr))
 * 
 *     def popTimestepping(self) -> None:             # <<<<<<<<<<<<<<
 *         """Deactivate the timestepping mode.
 * 
*/

  /* 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":1104
 *         CHKERR(PetscViewerHDF5PopTimestepping(self.vwr))
 * 
 *     def getTimestep(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the current time step.
 * 
*/

/* 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) -> int\nReturn the current time step.\n\n        Not collective.\n\n        See Also\n        --------\n        pushTimestepping, setTimestep, incrementTimestep\n        petsc.PetscViewerHDF5GetTimestep\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:1104");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_7getTimestep = {"getTimestep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_7getTimestep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_6getTimestep};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTimestep", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":1115
 * 
 *         """
 *         cdef PetscInt ctimestep = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerHDF5GetTimestep(self.vwr, &ctimestep))
 *         return toInt(ctimestep)
*/
  __pyx_v_ctimestep = 0;

  /* "petsc4py/PETSc/Viewer.pyx":1116
 *         """
 *         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, 1116, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1117
 *         cdef PetscInt ctimestep = 0
 *         CHKERR(PetscViewerHDF5GetTimestep(self.vwr, &ctimestep))
 *         return toInt(ctimestep)             # <<<<<<<<<<<<<<
 * 
 *     def setTimestep(self, timestep: int) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ctimestep); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Viewer.pyx":1104
 *         CHKERR(PetscViewerHDF5PopTimestepping(self.vwr))
 * 
 *     def getTimestep(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the current time step.
 * 
*/

  /* 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":1119
 *         return toInt(ctimestep)
 * 
 *     def setTimestep(self, timestep: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the current time step.
 * 
*/

/* 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: int) -> None\nSet the current time step.\n\n        Logically collective.\n\n        See Also\n        --------\n        pushTimestepping, getTimestep, incrementTimestep\n        petsc.PetscViewerHDF5SetTimestep\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:1119");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_9setTimestep = {"setTimestep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_9setTimestep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_8setTimestep};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_timestep,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 1119, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 1119, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTimestep", 0) < (0)) __PYX_ERR(37, 1119, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setTimestep", 1, 1, 1, i); __PYX_ERR(37, 1119, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 1119, __pyx_L3_error)
    }
    __pyx_v_timestep = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setTimestep", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 1119, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":1130
 * 
 *         """
 *         CHKERR(PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)))             # <<<<<<<<<<<<<<
 * 
 *     def incrementTimestep(self) -> None:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_timestep); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(37, 1130, __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, 1130, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1119
 *         return toInt(ctimestep)
 * 
 *     def setTimestep(self, timestep: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the current time step.
 * 
*/

  /* 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":1132
 *         CHKERR(PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)))
 * 
 *     def incrementTimestep(self) -> None:             # <<<<<<<<<<<<<<
 *         """Increment the time step.
 * 
*/

/* 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) -> None\nIncrement the time step.\n\n        Logically collective.\n\n        See Also\n        --------\n        pushTimestepping, setTimestep, getTimestep\n        petsc.PetscViewerHDF5IncrementTimestep\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:1132");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_11incrementTimestep = {"incrementTimestep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_11incrementTimestep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_10incrementTimestep};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("incrementTimestep", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":1143
 * 
 *         """
 *         CHKERR(PetscViewerHDF5IncrementTimestep(self.vwr))             # <<<<<<<<<<<<<<
 * 
 *     def pushGroup(self, group: str) -> None:
*/
  __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, 1143, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1132
 *         CHKERR(PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)))
 * 
 *     def incrementTimestep(self) -> None:             # <<<<<<<<<<<<<<
 *         """Increment the time step.
 * 
*/

  /* 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":1145
 *         CHKERR(PetscViewerHDF5IncrementTimestep(self.vwr))
 * 
 *     def pushGroup(self, group: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the current group.
 * 
*/

/* 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: str) -> None\nSet the current group.\n\n        Logically collective.\n\n        See Also\n        --------\n        popGroup, getGroup, petsc.PetscViewerHDF5PushGroup\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:1145");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_13pushGroup = {"pushGroup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_13pushGroup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_12pushGroup};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_group,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(37, 1145, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 1145, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "pushGroup", 0) < (0)) __PYX_ERR(37, 1145, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("pushGroup", 1, 1, 1, i); __PYX_ERR(37, 1145, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(37, 1145, __pyx_L3_error)
    }
    __pyx_v_group = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pushGroup", 1, 1, 1, __pyx_nargs); __PYX_ERR(37, 1145, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":1155
 * 
 *         """
 *         cdef const char *cgroup = NULL             # <<<<<<<<<<<<<<
 *         group = str2bytes(group, &cgroup)
 *         CHKERR(PetscViewerHDF5PushGroup(self.vwr, cgroup))
*/
  __pyx_v_cgroup = NULL;

  /* "petsc4py/PETSc/Viewer.pyx":1156
 *         """
 *         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, 1156, __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":1157
 *         cdef const char *cgroup = NULL
 *         group = str2bytes(group, &cgroup)
 *         CHKERR(PetscViewerHDF5PushGroup(self.vwr, cgroup))             # <<<<<<<<<<<<<<
 * 
 *     def popGroup(self) -> None:
*/
  __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, 1157, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1145
 *         CHKERR(PetscViewerHDF5IncrementTimestep(self.vwr))
 * 
 *     def pushGroup(self, group: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the current group.
 * 
*/

  /* 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":1159
 *         CHKERR(PetscViewerHDF5PushGroup(self.vwr, cgroup))
 * 
 *     def popGroup(self) -> None:             # <<<<<<<<<<<<<<
 *         """Pop the current group from the stack.
 * 
*/

/* 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) -> None\nPop the current group from the stack.\n\n        Logically collective.\n\n        See Also\n        --------\n        pushGroup, getGroup, petsc.PetscViewerHDF5PopGroup\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:1159");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_15popGroup = {"popGroup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_15popGroup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_14popGroup};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("popGroup", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":1169
 * 
 *         """
 *         CHKERR(PetscViewerHDF5PopGroup(self.vwr))             # <<<<<<<<<<<<<<
 * 
 *     def getGroup(self) -> str:
*/
  __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, 1169, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1159
 *         CHKERR(PetscViewerHDF5PushGroup(self.vwr, cgroup))
 * 
 *     def popGroup(self) -> None:             # <<<<<<<<<<<<<<
 *         """Pop the current group from the stack.
 * 
*/

  /* 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":1171
 *         CHKERR(PetscViewerHDF5PopGroup(self.vwr))
 * 
 *     def getGroup(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the current group.
 * 
*/

/* 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) -> str\nReturn the current group.\n\n        Not collective.\n\n        See Also\n        --------\n        pushGroup, popGroup, petsc.PetscViewerHDF5GetGroup\n\n        \nSource code at petsc4py/PETSc/Viewer.pyx:1171");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_17getGroup = {"getGroup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_17getGroup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_16getGroup};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getGroup", __pyx_kwds); 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 const *__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", 0);

  /* "petsc4py/PETSc/Viewer.pyx":1181
 * 
 *         """
 *         cdef const char *cgroup = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerHDF5GetGroup(self.vwr, NULL, &cgroup))
 *         group = bytes2str(cgroup)
*/
  __pyx_v_cgroup = NULL;

  /* "petsc4py/PETSc/Viewer.pyx":1182
 *         """
 *         cdef const 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, 1182, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1183
 *         cdef const 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, 1183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_group = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":1184
 *         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, 1184, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1185
 *         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":1171
 *         CHKERR(PetscViewerHDF5PopGroup(self.vwr))
 * 
 *     def getGroup(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the current group.
 * 
*/

  /* 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":25
 *     Type = RandomType
 * 
 *     def __cinit__(self) -> None:             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":26
 * 
 *     def __cinit__(self) -> None:
 *         self.obj = <PetscObject*> &self.rnd             # <<<<<<<<<<<<<<
 *         self.rnd = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->rnd));

  /* "petsc4py/PETSc/Random.pyx":27
 *     def __cinit__(self) -> None:
 *         self.obj = <PetscObject*> &self.rnd
 *         self.rnd = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self) -> Scalar:
*/
  __pyx_v_self->rnd = NULL;

  /* "petsc4py/PETSc/Random.pyx":25
 *     Type = RandomType
 * 
 *     def __cinit__(self) -> None:             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.rnd
 *         self.rnd = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/Random.pyx":29
 *         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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__call__", __pyx_kwds); 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "petsc4py/PETSc/Random.pyx":39
 * 
 *         """
 *         return self.getValue()             # <<<<<<<<<<<<<<
 * 
 *     def view(self, Viewer viewer=None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getValue, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Random.pyx":29
 *         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_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":41
 *         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:41");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Random_5view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_4view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(38, 41, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(38, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(38, 41, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(38, 41, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 41, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(38, 41, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Random.pyx":56
 * 
 *         """
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(38, 56, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(38, 56, __pyx_L1_error)
  #endif

  /* "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_v_vwr = NULL;

  /* "petsc4py/PETSc/Random.pyx":58
 *         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":59
 *         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, 59, __pyx_L1_error)

  /* "petsc4py/PETSc/Random.pyx":41
 *         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":61
 *         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:61");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Random_7destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_6destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Random.pyx":71
 * 
 *         """
 *         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, 71, __pyx_L1_error)

  /* "petsc4py/PETSc/Random.pyx":72
 *         """
 *         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":61
 *         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":74
 *         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:74");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Random_9create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_8create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(38, 74, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(38, 74, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(38, 74, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(38, 74, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(38, 74, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Random.pyx":89
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(38, 89, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Random.pyx":90
 *         """
 *         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, 90, __pyx_L1_error)

  /* "petsc4py/PETSc/Random.pyx":91
 *         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":74
 *         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":93
 *         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:93");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Random_11setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_10setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rnd_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(38, 93, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(38, 93, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(38, 93, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(38, 93, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(38, 93, __pyx_L3_error)
    }
    __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, 93, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":108
 * 
 *         """
 *         cdef PetscRandomType cval = NULL             # <<<<<<<<<<<<<<
 *         rnd_type = str2bytes(rnd_type, &cval)
 *         CHKERR(PetscRandomSetType(self.rnd, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Random.pyx":109
 *         """
 *         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, 109, __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":110
 *         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, 110, __pyx_L1_error)

  /* "petsc4py/PETSc/Random.pyx":93
 *         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":112
 *         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:112");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Random_13getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_12getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Random.pyx":122
 * 
 *         """
 *         cdef PetscRandomType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscRandomGetType(self.rnd, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Random.pyx":123
 *         """
 *         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, 123, __pyx_L1_error)

  /* "petsc4py/PETSc/Random.pyx":124
 *         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, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Random.pyx":112
 *         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":126
 *         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:126");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Random_15setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_15setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_14setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Random.pyx":136
 * 
 *         """
 *         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, 136, __pyx_L1_error)

  /* "petsc4py/PETSc/Random.pyx":126
 *         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":138
 *         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:138");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Random_17getValue = {"getValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_17getValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_16getValue};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getValue", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Random.pyx":148
 * 
 *         """
 *         cdef PetscScalar sval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscRandomGetValue(self.rnd, &sval))
 *         return toScalar(sval)
*/
  __pyx_v_sval = 0.0;

  /* "petsc4py/PETSc/Random.pyx":149
 *         """
 *         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, 149, __pyx_L1_error)

  /* "petsc4py/PETSc/Random.pyx":150
 *         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, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Random.pyx":138
 *         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":152
 *         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:152");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Random_19getValueReal = {"getValueReal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_19getValueReal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_18getValueReal};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getValueReal", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Random.pyx":162
 * 
 *         """
 *         cdef PetscReal rval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscRandomGetValueReal(self.rnd, &rval))
 *         return toReal(rval)
*/
  __pyx_v_rval = 0.0;

  /* "petsc4py/PETSc/Random.pyx":163
 *         """
 *         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, 163, __pyx_L1_error)

  /* "petsc4py/PETSc/Random.pyx":164
 *         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, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Random.pyx":152
 *         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":166
 *         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:166");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Random_21getSeed = {"getSeed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_21getSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_20getSeed};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSeed", __pyx_kwds); 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) {
  PetscInt64 __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", 0);

  /* "petsc4py/PETSc/Random.pyx":176
 * 
 *         """
 *         cdef PetscInt64 seed = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscRandomGetSeed(self.rnd, &seed))
 *         return seed
*/
  __pyx_v_seed = 0;

  /* "petsc4py/PETSc/Random.pyx":177
 *         """
 *         cdef PetscInt64 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, 177, __pyx_L1_error)

  /* "petsc4py/PETSc/Random.pyx":178
 *         cdef PetscInt64 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_PyLong_From_PetscInt64(__pyx_v_seed); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Random.pyx":166
 *         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":180
 *         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:180");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Random_23setSeed = {"setSeed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_23setSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_22setSeed};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_seed,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(38, 180, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(38, 180, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSeed", 0) < (0)) __PYX_ERR(38, 180, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(38, 180, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_seed = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setSeed", 0, 0, 1, __pyx_nargs); __PYX_ERR(38, 180, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PetscInt64 __pyx_t_2;
  PetscErrorCode __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setSeed", 0);

  /* "petsc4py/PETSc/Random.pyx":195
 * 
 *         """
 *         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":196
 *         """
 *         if seed is not None:
 *             CHKERR(PetscRandomSetSeed(self.rnd, seed))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscRandomSeed(self.rnd))
 * 
*/
    __pyx_t_2 = __Pyx_PyLong_As_PetscInt64(__pyx_v_seed); if (unlikely((__pyx_t_2 == ((PetscInt64)-1)) && PyErr_Occurred())) __PYX_ERR(38, 196, __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, 196, __pyx_L1_error)

    /* "petsc4py/PETSc/Random.pyx":195
 * 
 *         """
 *         if seed is not None:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscRandomSetSeed(self.rnd, seed))
 *         CHKERR(PetscRandomSeed(self.rnd))
*/
  }

  /* "petsc4py/PETSc/Random.pyx":197
 *         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, 197, __pyx_L1_error)

  /* "petsc4py/PETSc/Random.pyx":180
 *         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":199
 *         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:199");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Random_25getInterval = {"getInterval", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_25getInterval, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_24getInterval};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getInterval", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Random.pyx":209
 * 
 *         """
 *         cdef PetscScalar sval1 = 0             # <<<<<<<<<<<<<<
 *         cdef PetscScalar sval2 = 1
 *         CHKERR(PetscRandomGetInterval(self.rnd, &sval1, &sval2))
*/
  __pyx_v_sval1 = 0.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_v_sval2 = 1.0;

  /* "petsc4py/PETSc/Random.pyx":211
 *         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, 211, __pyx_L1_error)

  /* "petsc4py/PETSc/Random.pyx":212
 *         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, 212, __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, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(38, 212, __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) != (0)) __PYX_ERR(38, 212, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(38, 212, __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":199
 *         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":214
 *         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:214");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Random_27setInterval = {"setInterval", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_27setInterval, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_26setInterval};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_interval,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(38, 214, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(38, 214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setInterval", 0) < (0)) __PYX_ERR(38, 214, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setInterval", 1, 1, 1, i); __PYX_ERR(38, 214, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(38, 214, __pyx_L3_error)
    }
    __pyx_v_interval = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setInterval", 1, 1, 1, __pyx_nargs); __PYX_ERR(38, 214, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Random.pyx":224
 * 
 *         """
 *         cdef PetscScalar sval1 = 0             # <<<<<<<<<<<<<<
 *         cdef PetscScalar sval2 = 1
 *         low, high = interval
*/
  __pyx_v_sval1 = 0.0;

  /* "petsc4py/PETSc/Random.pyx":225
 *         """
 *         cdef PetscScalar sval1 = 0
 *         cdef PetscScalar sval2 = 1             # <<<<<<<<<<<<<<
 *         low, high = interval
 *         sval1 = asScalar(low)
*/
  __pyx_v_sval2 = 1.0;

  /* "petsc4py/PETSc/Random.pyx":226
 *         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, 226, __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_INCREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 226, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 226, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(38, 226, __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, 226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 226, __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, 226, __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":227
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_5, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(38, 227, __pyx_L1_error)
  __pyx_v_sval1 = __pyx_t_5;

  /* "petsc4py/PETSc/Random.pyx":228
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_5, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(38, 228, __pyx_L1_error)
  __pyx_v_sval2 = __pyx_t_5;

  /* "petsc4py/PETSc/Random.pyx":229
 *         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, 229, __pyx_L1_error)

  /* "petsc4py/PETSc/Random.pyx":214
 *         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":235
 *     property seed:
 *         """The seed of the random number generator."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getSeed()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Random.pyx":236
 *         """The seed of the random number generator."""
 *         def __get__(self) -> int:
 *             return self.getSeed()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value: int | None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSeed, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Random.pyx":235
 *     property seed:
 *         """The seed of the random number generator."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getSeed()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":238
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Random.pyx":239
 * 
 *         def __set__(self, value: int | None) -> None:
 *             self.setSeed(value)             # <<<<<<<<<<<<<<
 * 
 *     property interval:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setSeed, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Random.pyx":238
 *             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_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":243
 *     property interval:
 *         """The interval of the generated random numbers."""
 *         def __get__(self) -> tuple[Scalar, Scalar]:             # <<<<<<<<<<<<<<
 *             return self.getInterval()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Random.pyx":244
 *         """The interval of the generated random numbers."""
 *         def __get__(self) -> tuple[Scalar, Scalar]:
 *             return self.getInterval()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value: tuple[Scalar, Scalar]):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getInterval, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Random.pyx":243
 *     property interval:
 *         """The interval of the generated random numbers."""
 *         def __get__(self) -> tuple[Scalar, Scalar]:             # <<<<<<<<<<<<<<
 *             return self.getInterval()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":246
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Random.pyx":247
 * 
 *         def __set__(self, value: tuple[Scalar, Scalar]):
 *             self.setInterval(value)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setInterval, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Random.pyx":246
 *             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_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(*)(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        default:
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      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 (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, __pyx_kwds_len, "__get__", 1) < (0)) __PYX_ERR(2, 4, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__get__", 0, 1, 1, i); __PYX_ERR(2, 4, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs < 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 4, __pyx_L3_error)
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_args);
  __Pyx_DECREF(__pyx_v_kwargs);
  __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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Device.pyx":5
 * class staticproperty(property):
 *     def __get__(self, *args, **kwargs):
 *         return self.fget.__get__(*args, **kwargs)()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_fget); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get); 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_t_3 = PyDict_Copy(__pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_v_args, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __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_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __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_XDECREF(__pyx_t_5);
  __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":8
 * 
 * 
 * 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 *);
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_enum_class", 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    = {}
 * 
*/
  __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_enum2str = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Device.pyx":10
 * 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, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_attrs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Device.pyx":12
 *     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, 12, __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_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 12, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
    #endif
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 12, __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(2, 12, __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_INCREF(__pyx_t_4);
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_5);
      } else {
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 12, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
      }
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 12, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 12, __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, 12, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 12, __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, 12, __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":13
 * 
 *     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, 13, __pyx_L1_error)

    /* "petsc4py/PETSc/Device.pyx":14
 *     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, 14, __pyx_L1_error)

    /* "petsc4py/PETSc/Device.pyx":12
 *     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":16
 *         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_mstate_global->__pyx_n_u_enum2str, __pyx_v_enum2str) < 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)
 * 
*/
  if (unlikely((PyDict_SetItem(__pyx_v_attrs, __pyx_mstate_global->__pyx_n_u_doc, __pyx_v_class_docstring) < 0))) __PYX_ERR(2, 17, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":18
 *     attrs['__enum2str'] = enum2str
 *     attrs['__doc__']    = class_docstring
 *     return type(class_name, (object,), attrs)             # <<<<<<<<<<<<<<
 * 
 * DeviceType = make_enum_class(
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = NULL;
  __pyx_t_8 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_class_name, __pyx_mstate_global->__pyx_tuple[5], __pyx_v_attrs};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(&PyType_Type), __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 18, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Device.pyx":8
 * 
 * 
 * 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":88
 *     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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":89
 * 
 *     def __cinit__(self):
 *         self.device = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
*/
  __pyx_v_self->device = NULL;

  /* "petsc4py/PETSc/Device.pyx":88
 *     Type = DeviceType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.device = NULL
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/Device.pyx":91
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "petsc4py/PETSc/Device.pyx":92
 * 
 *     def __dealloc__(self):
 *         self.destroy()             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_destroy, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Device.pyx":91
 *         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_WriteUnraisable("petsc4py.PETSc.Device.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "petsc4py/PETSc/Device.pyx":94
 *         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:94");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Device_5create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_4create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dtype,&__pyx_mstate_global->__pyx_n_u_device_id,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 94, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 94, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 94, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(2, 94, __pyx_L3_error)

      /* "petsc4py/PETSc/Device.pyx":95
 * 
 *     @classmethod
 *     def create(cls, dtype: Type | None = None, device_id: int = DECIDE) -> Device:             # <<<<<<<<<<<<<<
 *         """Create a device object.
 * 
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__18);
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 94, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 94, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__18);
    }
    __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, 94, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":94
 *         self.destroy()
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create(cls, dtype: Type | None = None, device_id: int = DECIDE) -> Device:
 *         """Create a device object.
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  size_t __pyx_t_7;
  PetscErrorCode __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 0);

  /* "petsc4py/PETSc/Device.pyx":113
 * 
 *         """
 *         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, 113, __pyx_L1_error)
  __pyx_v_cdevice_id = __pyx_t_1;

  /* "petsc4py/PETSc/Device.pyx":114
 *         """
 *         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_mstate_global->__pyx_n_u_Type); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DEFAULT); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 114, __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, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cdevice_type = __pyx_t_6;

  /* "petsc4py/PETSc/Device.pyx":115
 *         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_5 = NULL;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_v_cls, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device))))) __PYX_ERR(2, 115, __pyx_L1_error)
  __pyx_v_device = ((struct PyPetscDeviceObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Device.pyx":117
 *         cdef Device          device       = cls()
 * 
 *         CHKERR(PetscDeviceCreate(cdevice_type, cdevice_id, &device.device))             # <<<<<<<<<<<<<<
 *         return device
 * 
*/
  __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceCreate(__pyx_v_cdevice_type, __pyx_v_cdevice_id, (&__pyx_v_device->device))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 117, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":118
 * 
 *         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":94
 *         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":120
 *         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:120");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Device_7destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_6destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Device.pyx":130
 * 
 *         """
 *         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, 130, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":120
 *         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":132
 *         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:132");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Device_9configure = {"configure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_9configure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_8configure};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("configure", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Device.pyx":142
 * 
 *         """
 *         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, 142, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":132
 *         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":144
 *         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:144");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Device_11view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_11view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_10view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 144, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 144, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(2, 144, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 144, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 144, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(2, 144, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Device.pyx":159
 * 
 *         """
 *         cdef PetscViewer vwr = NULL             # <<<<<<<<<<<<<<
 * 
 *         if viewer is not None:
*/
  __pyx_v_vwr = NULL;

  /* "petsc4py/PETSc/Device.pyx":161
 *         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":162
 * 
 *         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":161
 *         cdef PetscViewer vwr = NULL
 * 
 *         if viewer is not None:             # <<<<<<<<<<<<<<
 *             vwr = viewer.vwr
 *         CHKERR(PetscDeviceView(self.device, vwr))
*/
  }

  /* "petsc4py/PETSc/Device.pyx":163
 *         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, 163, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":144
 *         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":165
 *         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:165");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Device_13getDeviceType = {"getDeviceType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_13getDeviceType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_12getDeviceType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDeviceType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Device.pyx":175
 * 
 *         """
 *         cdef PetscDeviceType cdtype = PETSC_DEVICE_HOST             # <<<<<<<<<<<<<<
 * 
 *         CHKERR(PetscDeviceGetType(self.device, &cdtype))
*/
  __pyx_v_cdtype = PETSC_DEVICE_HOST;

  /* "petsc4py/PETSc/Device.pyx":177
 *         cdef PetscDeviceType cdtype = PETSC_DEVICE_HOST
 * 
 *         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, 177, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":178
 * 
 *         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, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Device.pyx":165
 *         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":180
 *         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:180");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Device_15getDeviceId = {"getDeviceId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_15getDeviceId, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_14getDeviceId};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDeviceId", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Device.pyx":190
 * 
 *         """
 *         cdef PetscInt cdevice_id = 0             # <<<<<<<<<<<<<<
 * 
 *         CHKERR(PetscDeviceGetDeviceId(self.device, &cdevice_id))
*/
  __pyx_v_cdevice_id = 0;

  /* "petsc4py/PETSc/Device.pyx":192
 *         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, 192, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":193
 * 
 *         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, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Device.pyx":180
 *         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":195
 *         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:195");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6Device_17setDefaultType = {"setDefaultType", (PyCFunction)(void(*)(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_device_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 195, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 195, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDefaultType", 0) < (0)) __PYX_ERR(2, 195, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDefaultType", 1, 1, 1, i); __PYX_ERR(2, 195, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 195, __pyx_L3_error)
    }
    __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, 195, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Device.pyx":206
 * 
 *         """
 *         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, 206, __pyx_L1_error)
  __pyx_v_cdevice_type = __pyx_t_1;

  /* "petsc4py/PETSc/Device.pyx":208
 *         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, 208, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":195
 *         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":212
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Device.pyx":213
 *         """The device type."""
 *         def __get__(self) -> str:
 *             return self.getDeviceType()             # <<<<<<<<<<<<<<
 * 
 *     property device_id:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getDeviceType, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Device.pyx":212
 *     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_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":217
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Device.pyx":218
 *         """The device id."""
 *         def __get__(self) -> int:
 *             return self.getDeviceId()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getDeviceId, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Device.pyx":217
 *     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_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":236
 *     StreamType = StreamType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj  = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":237
 * 
 *     def __cinit__(self):
 *         self.obj  = <PetscObject*> &self.dctx             # <<<<<<<<<<<<<<
 *         self.dctx = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->dctx));

  /* "petsc4py/PETSc/Device.pyx":238
 *     def __cinit__(self):
 *         self.obj  = <PetscObject*> &self.dctx
 *         self.dctx = NULL             # <<<<<<<<<<<<<<
 * 
 *     def create(self) -> Self:
*/
  __pyx_v_self->dctx = NULL;

  /* "petsc4py/PETSc/Device.pyx":236
 *     StreamType = StreamType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj  = <PetscObject*> &self.dctx
 *         self.dctx = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/Device.pyx":240
 *         self.dctx = NULL
 * 
 *     def create(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an empty DeviceContext.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_3create(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_2create, "DeviceContext.create(self) -> Self\nCreate an empty DeviceContext.\n\n        Not collective.\n\n        See Also\n        --------\n        destroy, Device, petsc.PetscDeviceContextCreate\n\n        \nSource code at petsc4py/PETSc/Device.pyx:240");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_3create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_3create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_2create};
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_3create(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("create", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_2create(((struct PyPetscDeviceContextObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_2create(struct PyPetscDeviceContextObject *__pyx_v_self) {
  PetscDeviceContext __pyx_v_dctx;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscErrorCode __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 0);

  /* "petsc4py/PETSc/Device.pyx":250
 * 
 *         """
 *         cdef PetscDeviceContext dctx = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDeviceContextCreate(&dctx))
 *         CHKERR(PetscCLEAR(self.obj)); self.dctx = dctx
*/
  __pyx_v_dctx = NULL;

  /* "petsc4py/PETSc/Device.pyx":251
 *         """
 *         cdef PetscDeviceContext dctx = NULL
 *         CHKERR(PetscDeviceContextCreate(&dctx))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscCLEAR(self.obj)); self.dctx = dctx
 *         return self
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextCreate((&__pyx_v_dctx))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 251, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":252
 *         cdef PetscDeviceContext dctx = NULL
 *         CHKERR(PetscDeviceContextCreate(&dctx))
 *         CHKERR(PetscCLEAR(self.obj)); self.dctx = dctx             # <<<<<<<<<<<<<<
 *         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(2, 252, __pyx_L1_error)
  __pyx_v_self->dctx = __pyx_v_dctx;

  /* "petsc4py/PETSc/Device.pyx":253
 *         CHKERR(PetscDeviceContextCreate(&dctx))
 *         CHKERR(PetscCLEAR(self.obj)); self.dctx = dctx
 *         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/Device.pyx":240
 *         self.dctx = NULL
 * 
 *     def create(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an empty DeviceContext.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Device.pyx":255
 *         return self
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy a device context.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_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_13DeviceContext_4destroy, "DeviceContext.destroy(self) -> Self\nDestroy a device context.\n\n        Not collective.\n\n        See Also\n        --------\n        create, petsc.PetscDeviceContextDestroy\n\n        \nSource code at petsc4py/PETSc/Device.pyx:255");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_5destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_4destroy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_13DeviceContext_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_13DeviceContext_4destroy(((struct PyPetscDeviceContextObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_13DeviceContext_4destroy(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("destroy", 0);

  /* "petsc4py/PETSc/Device.pyx":265
 * 
 *         """
 *         CHKERR(PetscDeviceContextDestroy(&self.dctx))             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextDestroy((&__pyx_v_self->dctx))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 265, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":266
 *         """
 *         CHKERR(PetscDeviceContextDestroy(&self.dctx))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def getStreamType(self) -> str:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Device.pyx":255
 *         return self
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy a device context.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.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":268
 *         return self
 * 
 *     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:268");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_7getStreamType = {"getStreamType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_7getStreamType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_6getStreamType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getStreamType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Device.pyx":278
 * 
 *         """
 *         cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT             # <<<<<<<<<<<<<<
 * 
 *         CHKERR(PetscDeviceContextGetStreamType(self.dctx, &cstream_type))
*/
  __pyx_v_cstream_type = PETSC_STREAM_DEFAULT;

  /* "petsc4py/PETSc/Device.pyx":280
 *         cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT
 * 
 *         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, 280, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":281
 * 
 *         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, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Device.pyx":268
 *         return self
 * 
 *     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":283
 *         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:283");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_9setStreamType = {"setStreamType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_9setStreamType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_8setStreamType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_stream_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 283, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setStreamType", 0) < (0)) __PYX_ERR(2, 283, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setStreamType", 1, 1, 1, i); __PYX_ERR(2, 283, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 283, __pyx_L3_error)
    }
    __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, 283, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Device.pyx":298
 * 
 *         """
 *         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, 298, __pyx_L1_error)
  __pyx_v_cstream_type = __pyx_t_1;

  /* "petsc4py/PETSc/Device.pyx":300
 *         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, 300, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":283
 *         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":302
 *         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:302");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_11getDevice = {"getDevice", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_11getDevice, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_10getDevice};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDevice", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Device.pyx":312
 * 
 *         """
 *         cdef PetscDevice device = NULL             # <<<<<<<<<<<<<<
 * 
 *         CHKERR(PetscDeviceContextGetDevice(self.dctx, &device))
*/
  __pyx_v_device = NULL;

  /* "petsc4py/PETSc/Device.pyx":314
 *         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, 314, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":315
 * 
 *         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, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Device.pyx":302
 *         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":317
 *         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:317");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_13setDevice = {"setDevice", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_13setDevice, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_12setDevice};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_device,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 317, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 317, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDevice", 0) < (0)) __PYX_ERR(2, 317, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDevice", 1, 1, 1, i); __PYX_ERR(2, 317, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 317, __pyx_L3_error)
    }
    __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, 317, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device, 0, "device", 0))) __PYX_ERR(2, 317, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Device.pyx":332
 * 
 *         """
 *         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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(2, 332, __pyx_L1_error)
  __pyx_v_cdevice = __pyx_t_1;

  /* "petsc4py/PETSc/Device.pyx":334
 *         cdef PetscDevice cdevice = PyPetscDevice_Get(device)
 * 
 *         CHKERR(PetscDeviceContextSetDevice(self.dctx, cdevice))             # <<<<<<<<<<<<<<
 * 
 *     def setUp(self) -> None:
*/
  __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, 334, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":317
 *         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":336
 *         CHKERR(PetscDeviceContextSetDevice(self.dctx, cdevice))
 * 
 *     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:336");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_15setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_15setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_14setUp};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Device.pyx":346
 * 
 *         """
 *         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, 346, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":336
 *         CHKERR(PetscDeviceContextSetDevice(self.dctx, cdevice))
 * 
 *     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":348
 *         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:348");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_17duplicate = {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_17duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_16duplicate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("duplicate", __pyx_kwds); 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) {
  struct PyPetscDeviceContextObject *__pyx_v_octx = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("duplicate", 0);

  /* "petsc4py/PETSc/Device.pyx":358
 * 
 *         """
 *         cdef DeviceContext octx = type(self)()             # <<<<<<<<<<<<<<
 * 
 *         CHKERR(PetscDeviceContextDuplicate(self.dctx, &octx.dctx))
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext))))) __PYX_ERR(2, 358, __pyx_L1_error)
  __pyx_v_octx = ((struct PyPetscDeviceContextObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Device.pyx":360
 *         cdef DeviceContext octx = type(self)()
 * 
 *         CHKERR(PetscDeviceContextDuplicate(self.dctx, &octx.dctx))             # <<<<<<<<<<<<<<
 *         return octx
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextDuplicate(__pyx_v_self->dctx, (&__pyx_v_octx->dctx))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 360, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":361
 * 
 *         CHKERR(PetscDeviceContextDuplicate(self.dctx, &octx.dctx))
 *         return octx             # <<<<<<<<<<<<<<
 * 
 *     def idle(self) -> bool:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_octx);
  __pyx_r = ((PyObject *)__pyx_v_octx);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Device.pyx":348
 *         CHKERR(PetscDeviceContextSetUp(self.dctx))
 * 
 *     def duplicate(self) -> DeviceContext:             # <<<<<<<<<<<<<<
 *         """Duplicate a the device context.
 * 
*/

  /* 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.duplicate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_octx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Device.pyx":363
 *         return 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:363");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_19idle = {"idle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_19idle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_18idle};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("idle", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Device.pyx":373
 * 
 *         """
 *         cdef PetscBool is_idle = PETSC_FALSE             # <<<<<<<<<<<<<<
 * 
 *         CHKERR(PetscDeviceContextQueryIdle(self.dctx, &is_idle))
*/
  __pyx_v_is_idle = PETSC_FALSE;

  /* "petsc4py/PETSc/Device.pyx":375
 *         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, 375, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":376
 * 
 *         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, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Device.pyx":363
 *         return 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":378
 *         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:378");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_21waitFor = {"waitFor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_21waitFor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_20waitFor};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 378, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "waitFor", 0) < (0)) __PYX_ERR(2, 378, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("waitFor", 1, 1, 1, i); __PYX_ERR(2, 378, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 378, __pyx_L3_error)
    }
    __pyx_v_other = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("waitFor", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 378, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Device.pyx":393
 * 
 *         """
 *         cdef PetscDeviceContext cother = NULL             # <<<<<<<<<<<<<<
 * 
 *         if other is not None:
*/
  __pyx_v_cother = NULL;

  /* "petsc4py/PETSc/Device.pyx":395
 *         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":396
 * 
 *         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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(2, 396, __pyx_L1_error)
    __pyx_v_cother = __pyx_t_2;

    /* "petsc4py/PETSc/Device.pyx":395
 *         cdef PetscDeviceContext cother = NULL
 * 
 *         if other is not None:             # <<<<<<<<<<<<<<
 *             cother = PyPetscDeviceContext_Get(other)
 *         CHKERR(PetscDeviceContextWaitForContext(self.dctx, cother))
*/
  }

  /* "petsc4py/PETSc/Device.pyx":397
 *         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, 397, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":378
 *         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":399
 *         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        Examples\n        --------\n        The device contexts created must be destroyed using `join`.\n\n        >>> dctx = PETSc.DeviceContext().getCurrent()\n        >>> dctxs = dctx.fork(4)\n        >>> ... # perform computations\n        >>> # we can mix various join modes\n        >>> dctx.join(PETSc.DeviceContext.JoinMode.SYNC, dctxs[0:2])\n        >>> dctx.join(PETSc.DeviceContext.JoinMode.SYNC, dctxs[2:])\n        >>> ... # some more computations and joins\n        >>> # dctxs must be all destroyed with joinMode.DESTROY\n        >>> dctx.join(PETSc.DeviceContext.JoinMode.DESTROY, dctxs)\n\n        See Also\n        --------\n        join, waitFor, petsc.PetscDeviceContextFork\n\n        \nSource code at petsc4py/PETSc/Device.pyx:399");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_23fork = {"fork", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_23fork, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_22fork};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,&__pyx_mstate_global->__pyx_n_u_stream_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 399, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 399, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 399, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "fork", 0) < (0)) __PYX_ERR(2, 399, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("fork", 0, 1, 2, i); __PYX_ERR(2, 399, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 399, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 399, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 399, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_csubctxs;
  PetscStreamType __pyx_v_cstream_type;
  PetscInt __pyx_v_cn;
  PyObject *__pyx_v_subctxs = 0;
  long __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscInt __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  PetscStreamType __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fork", 0);

  /* "petsc4py/PETSc/Device.pyx":430
 * 
 *         """
 *         cdef PetscDeviceContext *csubctxs = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT
 *         cdef PetscInt cn = asInt(n)
*/
  __pyx_v_csubctxs = NULL;

  /* "petsc4py/PETSc/Device.pyx":431
 *         """
 *         cdef PetscDeviceContext *csubctxs = NULL
 *         cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT             # <<<<<<<<<<<<<<
 *         cdef PetscInt cn = asInt(n)
 *         cdef list subctxs = []
*/
  __pyx_v_cstream_type = PETSC_STREAM_DEFAULT;

  /* "petsc4py/PETSc/Device.pyx":432
 *         cdef PetscDeviceContext *csubctxs = NULL
 *         cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT
 *         cdef PetscInt cn = asInt(n)             # <<<<<<<<<<<<<<
 *         cdef list subctxs = []
 *         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, 432, __pyx_L1_error)
  __pyx_v_cn = __pyx_t_1;

  /* "petsc4py/PETSc/Device.pyx":433
 *         cdef PetscStreamType cstream_type = PETSC_STREAM_DEFAULT
 *         cdef PetscInt cn = asInt(n)
 *         cdef list subctxs = []             # <<<<<<<<<<<<<<
 *         if stream_type is None:
 *             CHKERR(PetscDeviceContextFork(self.dctx, cn, &csubctxs))
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_subctxs = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Device.pyx":434
 *         cdef PetscInt cn = asInt(n)
 *         cdef list subctxs = []
 *         if stream_type is None:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscDeviceContextFork(self.dctx, cn, &csubctxs))
 *         else:
*/
  __pyx_t_3 = (__pyx_v_stream_type == Py_None);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/Device.pyx":435
 *         cdef list subctxs = []
 *         if stream_type is None:
 *             CHKERR(PetscDeviceContextFork(self.dctx, cn, &csubctxs))             # <<<<<<<<<<<<<<
 *         else:
 *             cstream_type = asStreamType(stream_type)
*/
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextFork(__pyx_v_self->dctx, __pyx_v_cn, (&__pyx_v_csubctxs))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 435, __pyx_L1_error)

    /* "petsc4py/PETSc/Device.pyx":434
 *         cdef PetscInt cn = asInt(n)
 *         cdef list subctxs = []
 *         if stream_type is None:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscDeviceContextFork(self.dctx, cn, &csubctxs))
 *         else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Device.pyx":437
 *             CHKERR(PetscDeviceContextFork(self.dctx, cn, &csubctxs))
 *         else:
 *             cstream_type = asStreamType(stream_type)             # <<<<<<<<<<<<<<
 *             CHKERR(PetscDeviceContextForkWithStreamType(self.dctx, cstream_type, cn, &csubctxs))
 *         # FIXME: without CXX compiler, csubctxs is NULL
*/
  /*else*/ {
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asStreamType(__pyx_v_stream_type); if (unlikely(__pyx_t_5 == ((PetscStreamType)((PetscStreamType)-1L)))) __PYX_ERR(2, 437, __pyx_L1_error)
    __pyx_v_cstream_type = __pyx_t_5;

    /* "petsc4py/PETSc/Device.pyx":438
 *         else:
 *             cstream_type = asStreamType(stream_type)
 *             CHKERR(PetscDeviceContextForkWithStreamType(self.dctx, cstream_type, cn, &csubctxs))             # <<<<<<<<<<<<<<
 *         # FIXME: without CXX compiler, csubctxs is NULL
 *         if csubctxs:
*/
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextForkWithStreamType(__pyx_v_self->dctx, __pyx_v_cstream_type, __pyx_v_cn, (&__pyx_v_csubctxs))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 438, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Device.pyx":440
 *             CHKERR(PetscDeviceContextForkWithStreamType(self.dctx, cstream_type, cn, &csubctxs))
 *         # FIXME: without CXX compiler, csubctxs is NULL
 *         if csubctxs:             # <<<<<<<<<<<<<<
 *             subctxs = [None] * cn
 *             for i from 0 <= i < cn:
*/
  __pyx_t_3 = (__pyx_v_csubctxs != 0);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/Device.pyx":441
 *         # FIXME: without CXX compiler, csubctxs is NULL
 *         if csubctxs:
 *             subctxs = [None] * cn             # <<<<<<<<<<<<<<
 *             for i from 0 <= i < cn:
 *                 subctxs[i] = DeviceContext()
*/
    __pyx_t_2 = PyList_New(1 * ((__pyx_v_cn<0) ? 0:__pyx_v_cn)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    { Py_ssize_t __pyx_temp;
      for (__pyx_temp=0; __pyx_temp < __pyx_v_cn; __pyx_temp++) {
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        if (__Pyx_PyList_SET_ITEM(__pyx_t_2, __pyx_temp, Py_None) != (0)) __PYX_ERR(2, 441, __pyx_L1_error);
      }
    }
    __Pyx_DECREF_SET(__pyx_v_subctxs, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Device.pyx":442
 *         if csubctxs:
 *             subctxs = [None] * cn
 *             for i from 0 <= i < cn:             # <<<<<<<<<<<<<<
 *                 subctxs[i] = DeviceContext()
 *                 (<DeviceContext?>subctxs[i]).dctx = csubctxs[i]
*/
    __pyx_t_1 = __pyx_v_cn;
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {

      /* "petsc4py/PETSc/Device.pyx":443
 *             subctxs = [None] * cn
 *             for i from 0 <= i < cn:
 *                 subctxs[i] = DeviceContext()             # <<<<<<<<<<<<<<
 *                 (<DeviceContext?>subctxs[i]).dctx = csubctxs[i]
 *             CHKERR(PetscFree(csubctxs))
*/
      __pyx_t_6 = NULL;
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 443, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_2);
      }
      if (unlikely((__Pyx_SetItemInt(__pyx_v_subctxs, __pyx_v_i, ((PyObject *)__pyx_t_2), long, 1, __Pyx_PyLong_From_long, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference) < 0))) __PYX_ERR(2, 443, __pyx_L1_error)
      __Pyx_DECREF((PyObject *)__pyx_t_2); __pyx_t_2 = 0;

      /* "petsc4py/PETSc/Device.pyx":444
 *             for i from 0 <= i < cn:
 *                 subctxs[i] = DeviceContext()
 *                 (<DeviceContext?>subctxs[i]).dctx = csubctxs[i]             # <<<<<<<<<<<<<<
 *             CHKERR(PetscFree(csubctxs))
 *         return subctxs
*/
      __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_subctxs, __pyx_v_i, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 444, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext)))) __PYX_ERR(2, 444, __pyx_L1_error)
      ((struct PyPetscDeviceContextObject *)__pyx_t_2)->dctx = (__pyx_v_csubctxs[__pyx_v_i]);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }

    /* "petsc4py/PETSc/Device.pyx":445
 *                 subctxs[i] = DeviceContext()
 *                 (<DeviceContext?>subctxs[i]).dctx = csubctxs[i]
 *             CHKERR(PetscFree(csubctxs))             # <<<<<<<<<<<<<<
 *         return subctxs
 * 
*/
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_csubctxs)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 445, __pyx_L1_error)

    /* "petsc4py/PETSc/Device.pyx":440
 *             CHKERR(PetscDeviceContextForkWithStreamType(self.dctx, cstream_type, cn, &csubctxs))
 *         # FIXME: without CXX compiler, csubctxs is NULL
 *         if csubctxs:             # <<<<<<<<<<<<<<
 *             subctxs = [None] * cn
 *             for i from 0 <= i < cn:
*/
  }

  /* "petsc4py/PETSc/Device.pyx":446
 *                 (<DeviceContext?>subctxs[i]).dctx = csubctxs[i]
 *             CHKERR(PetscFree(csubctxs))
 *         return subctxs             # <<<<<<<<<<<<<<
 * 
 *     def join(self, join_mode: JoinMode | str, py_sub_ctxs: list[DeviceContext]) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_subctxs);
  __pyx_r = __pyx_v_subctxs;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Device.pyx":399
 *         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_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.fork", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_subctxs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Device.pyx":448
 *         return subctxs
 * 
 *     def join(self, join_mode: JoinMode | 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: JoinMode | 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:448");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_25join = {"join", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_25join, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_24join};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_join_mode,&__pyx_mstate_global->__pyx_n_u_py_sub_ctxs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 448, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 448, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 448, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "join", 0) < (0)) __PYX_ERR(2, 448, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("join", 1, 2, 2, i); __PYX_ERR(2, 448, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 448, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(2, 448, __pyx_L3_error)
    }
    __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, 448, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PetscDeviceContextJoinMode __pyx_v_cjoin_mode;
  Py_ssize_t __pyx_v_nctxs;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_dctx = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscDeviceContextJoinMode __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PetscErrorCode __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PetscDeviceContext __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("join", 0);

  /* "petsc4py/PETSc/Device.pyx":465
 * 
 *         """
 *         cdef PetscDeviceContext *np_subctx = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscDeviceContextJoinMode cjoin_mode = asJoinMode(join_mode)
 *         cdef Py_ssize_t nctxs = len(py_sub_ctxs)
*/
  __pyx_v_np_subctx = NULL;

  /* "petsc4py/PETSc/Device.pyx":466
 *         """
 *         cdef PetscDeviceContext *np_subctx = NULL
 *         cdef PetscDeviceContextJoinMode cjoin_mode = asJoinMode(join_mode)             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t nctxs = len(py_sub_ctxs)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asJoinMode(__pyx_v_join_mode); if (unlikely(__pyx_t_1 == ((PetscDeviceContextJoinMode)((PetscDeviceContextJoinMode)-1L)))) __PYX_ERR(2, 466, __pyx_L1_error)
  __pyx_v_cjoin_mode = __pyx_t_1;

  /* "petsc4py/PETSc/Device.pyx":467
 *         cdef PetscDeviceContext *np_subctx = NULL
 *         cdef PetscDeviceContextJoinMode cjoin_mode = asJoinMode(join_mode)
 *         cdef Py_ssize_t nctxs = len(py_sub_ctxs)             # <<<<<<<<<<<<<<
 * 
 *         CHKERR(PetscMalloc(<size_t>(nctxs) * sizeof(PetscDeviceContext *), &np_subctx))
*/
  __pyx_t_2 = PyObject_Length(__pyx_v_py_sub_ctxs); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(2, 467, __pyx_L1_error)
  __pyx_v_nctxs = __pyx_t_2;

  /* "petsc4py/PETSc/Device.pyx":469
 *         cdef Py_ssize_t nctxs = len(py_sub_ctxs)
 * 
 *         CHKERR(PetscMalloc(<size_t>(nctxs) * sizeof(PetscDeviceContext *), &np_subctx))             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nctxs:
 *             dctx = py_sub_ctxs[i]
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_nctxs) * (sizeof(PetscDeviceContext *))), (&__pyx_v_np_subctx))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 469, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":470
 * 
 *         CHKERR(PetscMalloc(<size_t>(nctxs) * sizeof(PetscDeviceContext *), &np_subctx))
 *         for i from 0 <= i < nctxs:             # <<<<<<<<<<<<<<
 *             dctx = py_sub_ctxs[i]
 *             np_subctx[i] = (<DeviceContext?>dctx).dctx if dctx is not None else NULL
*/
  __pyx_t_2 = __pyx_v_nctxs;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "petsc4py/PETSc/Device.pyx":471
 *         CHKERR(PetscMalloc(<size_t>(nctxs) * sizeof(PetscDeviceContext *), &np_subctx))
 *         for i from 0 <= i < nctxs:
 *             dctx = py_sub_ctxs[i]             # <<<<<<<<<<<<<<
 *             np_subctx[i] = (<DeviceContext?>dctx).dctx if dctx is not None else NULL
 *         CHKERR(PetscDeviceContextJoin(self.dctx, <PetscInt>nctxs, cjoin_mode, &np_subctx))
*/
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_py_sub_ctxs, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_dctx, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "petsc4py/PETSc/Device.pyx":472
 *         for i from 0 <= i < nctxs:
 *             dctx = py_sub_ctxs[i]
 *             np_subctx[i] = (<DeviceContext?>dctx).dctx if dctx is not None else NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDeviceContextJoin(self.dctx, <PetscInt>nctxs, cjoin_mode, &np_subctx))
 * 
*/
    __pyx_t_6 = (__pyx_v_dctx != Py_None);
    if (__pyx_t_6) {
      if (!(likely(__Pyx_TypeTest(__pyx_v_dctx, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext)))) __PYX_ERR(2, 472, __pyx_L1_error)
      __pyx_t_5 = ((struct PyPetscDeviceContextObject *)__pyx_v_dctx)->dctx;
    } else {
      __pyx_t_5 = NULL;
    }
    (__pyx_v_np_subctx[__pyx_v_i]) = __pyx_t_5;
  }

  /* "petsc4py/PETSc/Device.pyx":473
 *             dctx = py_sub_ctxs[i]
 *             np_subctx[i] = (<DeviceContext?>dctx).dctx if dctx is not None else NULL
 *         CHKERR(PetscDeviceContextJoin(self.dctx, <PetscInt>nctxs, cjoin_mode, &np_subctx))             # <<<<<<<<<<<<<<
 * 
 *         if cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY:
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceContextJoin(__pyx_v_self->dctx, ((PetscInt)__pyx_v_nctxs), __pyx_v_cjoin_mode, (&__pyx_v_np_subctx))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 473, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":475
 *         CHKERR(PetscDeviceContextJoin(self.dctx, <PetscInt>nctxs, cjoin_mode, &np_subctx))
 * 
 *         if cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY:             # <<<<<<<<<<<<<<
 *             # in this case, PETSc destroys the contexts and frees the array
 *             for i in range(nctxs):
*/
  __pyx_t_6 = (__pyx_v_cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY);
  if (__pyx_t_6) {

    /* "petsc4py/PETSc/Device.pyx":477
 *         if cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY:
 *             # in this case, PETSc destroys the contexts and frees the array
 *             for i in range(nctxs):             # <<<<<<<<<<<<<<
 *                 (<DeviceContext?>py_sub_ctxs[i]).dctx = NULL
 *         else:
*/
    __pyx_t_2 = __pyx_v_nctxs;
    __pyx_t_7 = __pyx_t_2;
    for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
      __pyx_v_i = __pyx_t_8;

      /* "petsc4py/PETSc/Device.pyx":478
 *             # in this case, PETSc destroys the contexts and frees the array
 *             for i in range(nctxs):
 *                 (<DeviceContext?>py_sub_ctxs[i]).dctx = NULL             # <<<<<<<<<<<<<<
 *         else:
 *             # we need to free the temporary array
*/
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_py_sub_ctxs, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 478, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext)))) __PYX_ERR(2, 478, __pyx_L1_error)
      ((struct PyPetscDeviceContextObject *)__pyx_t_4)->dctx = NULL;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }

    /* "petsc4py/PETSc/Device.pyx":475
 *         CHKERR(PetscDeviceContextJoin(self.dctx, <PetscInt>nctxs, cjoin_mode, &np_subctx))
 * 
 *         if cjoin_mode == PETSC_DEVICE_CONTEXT_JOIN_DESTROY:             # <<<<<<<<<<<<<<
 *             # in this case, PETSc destroys the contexts and frees the array
 *             for i in range(nctxs):
*/
    goto __pyx_L5;
  }

  /* "petsc4py/PETSc/Device.pyx":481
 *         else:
 *             # we need to free the temporary array
 *             CHKERR(PetscFree(np_subctx))             # <<<<<<<<<<<<<<
 * 
 *     def synchronize(self) -> None:
*/
  /*else*/ {
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_np_subctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(2, 481, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "petsc4py/PETSc/Device.pyx":448
 *         return subctxs
 * 
 *     def join(self, join_mode: JoinMode | 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_4);
  __Pyx_AddTraceback("petsc4py.PETSc.DeviceContext.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dctx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Device.pyx":483
 *             CHKERR(PetscFree(np_subctx))
 * 
 *     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:483");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_27synchronize = {"synchronize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_27synchronize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_26synchronize};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("synchronize", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Device.pyx":498
 * 
 *         """
 *         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, 498, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":483
 *             CHKERR(PetscFree(np_subctx))
 * 
 *     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":500
 *         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:500");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_29setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_29setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_28setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 500, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 500, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFromOptions", 0) < (0)) __PYX_ERR(2, 500, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 500, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setFromOptions", 0, 0, 1, __pyx_nargs); __PYX_ERR(2, 500, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Device.pyx":515
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(2, 515, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Device.pyx":517
 *         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, 517, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":500
 *         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":519
 *         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:519");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_31getCurrent = {"getCurrent", (PyCFunction)(void(*)(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCurrent", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Device.pyx":530
 * 
 *         """
 *         cdef PetscDeviceContext dctx = NULL             # <<<<<<<<<<<<<<
 * 
 *         CHKERR(PetscDeviceContextGetCurrentContext(&dctx))
*/
  __pyx_v_dctx = NULL;

  /* "petsc4py/PETSc/Device.pyx":532
 *         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, 532, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":533
 * 
 *         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, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Device.pyx":519
 *         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":535
 *         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:535");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13DeviceContext_33setCurrent = {"setCurrent", (PyCFunction)(void(*)(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dctx,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(2, 535, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCurrent", 0) < (0)) __PYX_ERR(2, 535, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCurrent", 1, 1, 1, i); __PYX_ERR(2, 535, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(2, 535, __pyx_L3_error)
    }
    __pyx_v_dctx = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setCurrent", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 535, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Device.pyx":552
 * 
 *         """
 *         cdef PetscDeviceContext cdctx = NULL             # <<<<<<<<<<<<<<
 * 
 *         if dctx is not None:
*/
  __pyx_v_cdctx = NULL;

  /* "petsc4py/PETSc/Device.pyx":554
 *         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":555
 * 
 *         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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(2, 555, __pyx_L1_error)
    __pyx_v_cdctx = __pyx_t_2;

    /* "petsc4py/PETSc/Device.pyx":554
 *         cdef PetscDeviceContext cdctx = NULL
 * 
 *         if dctx is not None:             # <<<<<<<<<<<<<<
 *             cdctx = PyPetscDeviceContext_Get(dctx)
 *         CHKERR(PetscDeviceContextSetCurrentContext(cdctx))
*/
  }

  /* "petsc4py/PETSc/Device.pyx":556
 *         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, 556, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":535
 *         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":560
 *     property stream_type:
 *         """The stream type."""
 *         def __get__(self) -> str:             # <<<<<<<<<<<<<<
 *             return self.getStreamType()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Device.pyx":561
 *         """The stream type."""
 *         def __get__(self) -> str:
 *             return self.getStreamType()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, stype: StreamType | str) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getStreamType, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Device.pyx":560
 *     property stream_type:
 *         """The stream type."""
 *         def __get__(self) -> str:             # <<<<<<<<<<<<<<
 *             return self.getStreamType()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":563
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Device.pyx":564
 * 
 *         def __set__(self, stype: StreamType | str) -> None:
 *             self.setStreamType(stype)             # <<<<<<<<<<<<<<
 * 
 *     property device:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_stype};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setStreamType, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Device.pyx":563
 *             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_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":568
 *     property device:
 *         """The device associated to the device context."""
 *         def __get__(self) -> Device:             # <<<<<<<<<<<<<<
 *             return self.getDevice()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Device.pyx":569
 *         """The device associated to the device context."""
 *         def __get__(self) -> Device:
 *             return self.getDevice()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, Device device) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getDevice, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Device.pyx":568
 *     property device:
 *         """The device associated to the device context."""
 *         def __get__(self) -> Device:             # <<<<<<<<<<<<<<
 *             return self.getDevice()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":571
 *             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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device, 0, "device", 0))) __PYX_ERR(2, 571, __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;
  goto __pyx_L5_cleaned_up;
  __pyx_L0:;
  __pyx_L5_cleaned_up:;
  __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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Device.pyx":572
 * 
 *         def __set__(self, Device device) -> None:
 *             self.setDevice(device)             # <<<<<<<<<<<<<<
 * 
 *     property current:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_device)};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setDevice, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Device.pyx":571
 *             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_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":576
 *     property current:
 *         """The current global device context."""
 *         def __get__(self) -> DeviceContext:             # <<<<<<<<<<<<<<
 *             return self.getCurrent()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Device.pyx":577
 *         """The current global device context."""
 *         def __get__(self) -> DeviceContext:
 *             return self.getCurrent()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, dctx: DeviceContext | None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getCurrent, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Device.pyx":576
 *     property current:
 *         """The current global device context."""
 *         def __get__(self) -> DeviceContext:             # <<<<<<<<<<<<<<
 *             return self.getCurrent()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":579
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Device.pyx":580
 * 
 *         def __set__(self, dctx: DeviceContext | None) -> None:
 *             self.setCurrent(dctx)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_dctx};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setCurrent, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Device.pyx":579
 *             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_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":28
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":29
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.iset             # <<<<<<<<<<<<<<
 *         self.iset = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->iset));

  /* "petsc4py/PETSc/IS.pyx":30
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.iset
 *         self.iset = NULL             # <<<<<<<<<<<<<<
 * 
 *     # buffer interface (PEP 3118)
*/
  __pyx_v_self->iset = NULL;

  /* "petsc4py/PETSc/IS.pyx":28
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.iset
 *         self.iset = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/IS.pyx":34
 *     # 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  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":35
 * 
 *     def __getbuffer__(self, Py_buffer *view, int flags):
 *         cdef _IS_buffer buf = _IS_buffer(self)             # <<<<<<<<<<<<<<
 *         buf.acquirebuffer(view, flags)
 * 
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__IS_buffer, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 35, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":36
 *     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_4 = ((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_4 == ((int)-1))) __PYX_ERR(39, 36, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":34
 *     # 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_XDECREF(__pyx_t_2);
  __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":38
 *         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__", 0);

  /* "petsc4py/PETSc/IS.pyx":39
 * 
 *     def __releasebuffer__(self, Py_buffer *view):
 *         cdef _IS_buffer buf = <_IS_buffer>(view.obj)             # <<<<<<<<<<<<<<
 *         buf.releasebuffer(view)
 *         <void>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":40
 *     def __releasebuffer__(self, Py_buffer *view):
 *         cdef _IS_buffer buf = <_IS_buffer>(view.obj)
 *         buf.releasebuffer(view)             # <<<<<<<<<<<<<<
 *         <void>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, 40, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":41
 *         cdef _IS_buffer buf = <_IS_buffer>(view.obj)
 *         buf.releasebuffer(view)
 *         <void>self # unused             # <<<<<<<<<<<<<<
 * 
 *     # 'with' statement (PEP 343)
*/
  ((void)__pyx_v_self);

  /* "petsc4py/PETSc/IS.pyx":38
 *         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":45
 *     # '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:45");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_7__enter__ = {"__enter__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_7__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_6__enter__};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__enter__", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__enter__", 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_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__IS_buffer, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 46, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":47
 *     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, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":48
 *         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, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":45
 *     # '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_XDECREF(__pyx_t_2);
  __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":50
 *         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:50");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_9__exit__ = {"__exit__", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_9__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_8__exit__};
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_SIZE
  __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);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__exit__", __pyx_kwds); 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__", 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.get_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__buffer__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__IS_buffer))))) __PYX_ERR(39, 51, __pyx_L1_error)
  __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":52
 *     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, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":53
 *         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, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":50
 *         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":56
 *     #
 * 
 *     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:56");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_11view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_11view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_10view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 56, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 56, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(39, 56, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 56, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 56, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(39, 56, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/IS.pyx":71
 * 
 *         """
 *         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":72
 *         """
 *         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":73
 *         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, 73, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":56
 *     #
 * 
 *     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":75
 *         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:75");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_13destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_13destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_12destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/IS.pyx":85
 * 
 *         """
 *         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, 85, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":86
 *         """
 *         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":75
 *         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":88
 *         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:88");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_15create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_15create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_14create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 88, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 88, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(39, 88, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 88, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(39, 88, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/IS.pyx":103
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(39, 103, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "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
*/
  __pyx_v_newiset = NULL;

  /* "petsc4py/PETSc/IS.pyx":105
 *         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, 105, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":106
 *         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, 106, __pyx_L1_error)
  __pyx_v_self->iset = __pyx_v_newiset;

  /* "petsc4py/PETSc/IS.pyx":107
 *         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":88
 *         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":109
 *         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:109");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_17setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_17setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_16setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_is_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 109, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 109, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(39, 109, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(39, 109, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 109, __pyx_L3_error)
    }
    __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, 109, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":124
 * 
 *         """
 *         cdef PetscISType cval = NULL             # <<<<<<<<<<<<<<
 *         is_type = str2bytes(is_type, &cval)
 *         CHKERR(ISSetType(self.iset, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/IS.pyx":125
 *         """
 *         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, 125, __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":126
 *         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, 126, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":109
 *         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":128
 *         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:128");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_19getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_19getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_18getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/IS.pyx":138
 * 
 *         """
 *         cdef PetscISType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(ISGetType(self.iset, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/IS.pyx":139
 *         """
 *         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, 139, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":140
 *         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, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":128
 *         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":142
 *         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:142");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_21createGeneral = {"createGeneral", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_21createGeneral, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_20createGeneral};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 142, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 142, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 142, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createGeneral", 0) < (0)) __PYX_ERR(39, 142, __pyx_L3_error)

      /* "petsc4py/PETSc/IS.pyx":145
 *         self,
 *         indices: Sequence[int],
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an IS with indices.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createGeneral", 0, 1, 2, i); __PYX_ERR(39, 142, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 142, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 142, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 142, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":142
 *         return bytes2str(cval)
 * 
 *     def createGeneral(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 const )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":142
 *         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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_23createBlock = {"createBlock", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_23createBlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_22createBlock};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 171, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(39, 171, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 171, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 171, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createBlock", 0) < (0)) __PYX_ERR(39, 171, __pyx_L3_error)

      /* "petsc4py/PETSc/IS.pyx":175
 *         bsize: int,
 *         indices: Sequence[int],
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a blocked index set.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createBlock", 0, 2, 3, i); __PYX_ERR(39, 171, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(39, 171, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 171, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 171, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":194
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(39, 194, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "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
 *         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, 195, __pyx_L1_error)
  __pyx_v_bs = __pyx_t_2;

  /* "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
 *         cdef PetscIS newiset = NULL
*/
  __pyx_v_nidx = 0;
  __pyx_v_idx = NULL;

  /* "petsc4py/PETSc/IS.pyx":197
 *         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":198
 *         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":199
 *         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, 199, __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":200
 *         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, 200, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":201
 *         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, 201, __pyx_L1_error)
  __pyx_v_self->iset = __pyx_v_newiset;

  /* "petsc4py/PETSc/IS.pyx":202
 *         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":204
 *         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 = 1, 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:204");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_25createStride = {"createStride", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_25createStride, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_24createStride};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_first,&__pyx_mstate_global->__pyx_n_u_step,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 204, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(39, 204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(39, 204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createStride", 0) < (0)) __PYX_ERR(39, 204, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));

      /* "petsc4py/PETSc/IS.pyx":209
 *         first: int = 0,
 *         step: int = 1,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an index set consisting of evenly spaced values.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createStride", 0, 1, 4, i); __PYX_ERR(39, 204, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(39, 204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(39, 204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 204, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 204, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 204, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":204
 *         return self
 * 
 *     def createStride(             # <<<<<<<<<<<<<<
 *         self,
 *         size: int,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/IS.pyx":230
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(39, 230, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/IS.pyx":231
 *         """
 *         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, 231, __pyx_L1_error)
  __pyx_v_csize = __pyx_t_2;

  /* "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)             # <<<<<<<<<<<<<<
 *         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, 232, __pyx_L1_error)
  __pyx_v_cfirst = __pyx_t_2;

  /* "petsc4py/PETSc/IS.pyx":233
 *         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, 233, __pyx_L1_error)
  __pyx_v_cstep = __pyx_t_2;

  /* "petsc4py/PETSc/IS.pyx":234
 *         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":235
 *         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, 235, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":236
 *         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, 236, __pyx_L1_error)
  __pyx_v_self->iset = __pyx_v_newiset;

  /* "petsc4py/PETSc/IS.pyx":237
 *         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":204
 *         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":239
 *         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:239");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_27duplicate = {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_27duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_26duplicate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("duplicate", __pyx_kwds); 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;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("duplicate", 0);

  /* "petsc4py/PETSc/IS.pyx":249
 * 
 *         """
 *         cdef IS iset = type(self)()             # <<<<<<<<<<<<<<
 *         CHKERR(ISDuplicate(self.iset, &iset.iset))
 *         return iset
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS))))) __PYX_ERR(39, 249, __pyx_L1_error)
  __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":250
 *         """
 *         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, 250, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":251
 *         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":239
 *         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":253
 *         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:253");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_29copy = {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_29copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_28copy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_result,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 253, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 253, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "copy", 0) < (0)) __PYX_ERR(39, 253, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 253, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
    }
    __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, 253, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 1, "result", 0))) __PYX_ERR(39, 253, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  size_t __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":274
 * 
 *         """
 *         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":275
 *         """
 *         if result is None:
 *             result = type(self)()             # <<<<<<<<<<<<<<
 *         if result.iset == NULL:
 *             CHKERR(ISDuplicate(self.iset, &result.iset))
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 275, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS))))) __PYX_ERR(39, 275, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscISObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/IS.pyx":274
 * 
 *         """
 *         if result is None:             # <<<<<<<<<<<<<<
 *             result = type(self)()
 *         if result.iset == NULL:
*/
  }

  /* "petsc4py/PETSc/IS.pyx":276
 *         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":277
 *             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, 277, __pyx_L1_error)

    /* "petsc4py/PETSc/IS.pyx":276
 *         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":278
 *         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, 278, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":279
 *             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":253
 *         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":281
 *         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:281");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_31load = {"load", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_31load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_30load};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 281, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 281, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "load", 0) < (0)) __PYX_ERR(39, 281, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, i); __PYX_ERR(39, 281, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 281, __pyx_L3_error)
    }
    __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, 281, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(39, 281, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/IS.pyx":296
 * 
 *         """
 *         cdef MPI_Comm comm = MPI_COMM_NULL             # <<<<<<<<<<<<<<
 *         cdef PetscObject obj = <PetscObject>(viewer.vwr)
 *         if self.iset == NULL:
*/
  __pyx_v_comm = MPI_COMM_NULL;

  /* "petsc4py/PETSc/IS.pyx":297
 *         """
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         cdef PetscObject obj = <PetscObject>(viewer.vwr)             # <<<<<<<<<<<<<<
 *         if self.iset == NULL:
 *             CHKERR(PetscObjectGetComm(obj, &comm))
*/
  __pyx_v_obj = ((PetscObject)__pyx_v_viewer->vwr);

  /* "petsc4py/PETSc/IS.pyx":298
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         cdef PetscObject obj = <PetscObject>(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":299
 *         cdef PetscObject obj = <PetscObject>(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, 299, __pyx_L1_error)

    /* "petsc4py/PETSc/IS.pyx":300
 *         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, 300, __pyx_L1_error)

    /* "petsc4py/PETSc/IS.pyx":298
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         cdef PetscObject obj = <PetscObject>(viewer.vwr)
 *         if self.iset == NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscObjectGetComm(obj, &comm))
 *             CHKERR(ISCreate(comm, &self.iset))
*/
  }

  /* "petsc4py/PETSc/IS.pyx":301
 *             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, 301, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":302
 *             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":281
 *         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":304
 *         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:304");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_33allGather = {"allGather", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_33allGather, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_32allGather};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("allGather", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("allGather", 0);

  /* "petsc4py/PETSc/IS.pyx":316
 * 
 *         """
 *         cdef IS iset = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(ISAllGather(self.iset, &iset.iset))
 *         return iset
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 316, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":317
 *         """
 *         cdef IS iset = IS()
 *         CHKERR(ISAllGather(self.iset, &iset.iset))             # <<<<<<<<<<<<<<
 *         return iset
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISAllGather(__pyx_v_self->iset, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 317, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":318
 *         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":304
 *         return self
 * 
 *     def allGather(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Concatenate index sets stored across processors.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":320
 *         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:320");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_35toGeneral = {"toGeneral", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_35toGeneral, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_34toGeneral};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("toGeneral", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/IS.pyx":330
 * 
 *         """
 *         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, 330, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":331
 *         """
 *         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":320
 *         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":333
 *         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:333");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_37buildTwoSided = {"buildTwoSided", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_37buildTwoSided, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_36buildTwoSided};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_toindx,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 333, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 333, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "buildTwoSided", 0) < (0)) __PYX_ERR(39, 333, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 333, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
    }
    __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, 333, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 1, "toindx", 0))) __PYX_ERR(39, 333, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("buildTwoSided", 0);

  /* "petsc4py/PETSc/IS.pyx":357
 * 
 *         """
 *         cdef PetscIS ctoindx = NULL             # <<<<<<<<<<<<<<
 *         if toindx is not None: ctoindx = toindx.iset
 *         cdef IS result = IS()
*/
  __pyx_v_ctoindx = NULL;

  /* "petsc4py/PETSc/IS.pyx":358
 *         """
 *         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":359
 *         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_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 359, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_3);
  }
  __pyx_v_result = ((struct PyPetscISObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/IS.pyx":360
 *         if toindx is not None: ctoindx = toindx.iset
 *         cdef IS result = IS()
 *         CHKERR(ISBuildTwoSided(self.iset, ctoindx, &result.iset))             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISBuildTwoSided(__pyx_v_self->iset, __pyx_v_ctoindx, (&__pyx_v_result->iset))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 360, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":361
 *         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":333
 *         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_XDECREF(__pyx_t_4);
  __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":363
 *         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:363");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_39invertPermutation = {"invertPermutation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_39invertPermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_38invertPermutation};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nlocal,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 363, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 363, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "invertPermutation", 0) < (0)) __PYX_ERR(39, 363, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 363, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_nlocal = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("invertPermutation", 0, 0, 1, __pyx_nargs); __PYX_ERR(39, 363, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("invertPermutation", 0);

  /* "petsc4py/PETSc/IS.pyx":381
 * 
 *         """
 *         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":382
 *         """
 *         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, 382, __pyx_L1_error)
    __pyx_v_cnlocal = __pyx_t_2;
  }

  /* "petsc4py/PETSc/IS.pyx":383
 *         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_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 383, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_3);
  }
  __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/IS.pyx":384
 *         if nlocal is not None: cnlocal = asInt(nlocal)
 *         cdef IS iset = IS()
 *         CHKERR(ISInvertPermutation(self.iset, cnlocal, &iset.iset))             # <<<<<<<<<<<<<<
 *         return iset
 * 
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISInvertPermutation(__pyx_v_self->iset, __pyx_v_cnlocal, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 384, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":385
 *         cdef IS iset = IS()
 *         CHKERR(ISInvertPermutation(self.iset, cnlocal, &iset.iset))
 *         return iset             # <<<<<<<<<<<<<<
 * 
 *     def partitioningToNumbering(self) -> IS:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_iset);
  __pyx_r = ((PyObject *)__pyx_v_iset);
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":363
 *         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_XDECREF(__pyx_t_4);
  __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":387
 *         return iset
 * 
 *     def partitioningToNumbering(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the new global numbering after a partitioning.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_41partitioningToNumbering(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_40partitioningToNumbering, "IS.partitioningToNumbering(self) -> IS\nReturn the new global numbering after a partitioning.\n\n        Collective.\n\n        Assuming that the index set represents a partitioning, generate another\n        index set with the new global node number in the new ordering.\n\n        See Also\n        --------\n        petsc.ISPartitioningToNumbering\n\n        \nSource code at petsc4py/PETSc/IS.pyx:387");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_41partitioningToNumbering = {"partitioningToNumbering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_41partitioningToNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_40partitioningToNumbering};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_41partitioningToNumbering(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("partitioningToNumbering (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("partitioningToNumbering", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("partitioningToNumbering", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_40partitioningToNumbering(((struct PyPetscISObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_40partitioningToNumbering(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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("partitioningToNumbering", 0);

  /* "petsc4py/PETSc/IS.pyx":400
 * 
 *         """
 *         cdef IS iset = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(ISPartitioningToNumbering(self.iset, &iset.iset))
 *         return iset
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 400, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":401
 *         """
 *         cdef IS iset = IS()
 *         CHKERR(ISPartitioningToNumbering(self.iset, &iset.iset))             # <<<<<<<<<<<<<<
 *         return iset
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISPartitioningToNumbering(__pyx_v_self->iset, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 401, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":402
 *         cdef IS iset = IS()
 *         CHKERR(ISPartitioningToNumbering(self.iset, &iset.iset))
 *         return iset             # <<<<<<<<<<<<<<
 * 
 *     def partitioningCount(self, npart: int | None = None) -> ArrayInt:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_iset);
  __pyx_r = ((PyObject *)__pyx_v_iset);
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":387
 *         return iset
 * 
 *     def partitioningToNumbering(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the new global numbering after a partitioning.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.IS.partitioningToNumbering", __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":404
 *         return iset
 * 
 *     def partitioningCount(self, npart: int | None = None) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the number of elements per process after a partitioning.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_43partitioningCount(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_42partitioningCount, "IS.partitioningCount(self, npart: int | None = None) -> ArrayInt\nReturn the number of elements per process after a partitioning.\n\n        Collective.\n\n        Assuming that the index set represents a partitioning, determine the\n        number of elements on each (partition) rank.\n\n        Parameters\n        ----------\n        npart\n            The number of partitions,\n            defaults to the size of the communicator.\n\n        See Also\n        --------\n        petsc.ISPartitioningCount\n\n        \nSource code at petsc4py/PETSc/IS.pyx:404");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_43partitioningCount = {"partitioningCount", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_43partitioningCount, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_42partitioningCount};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_43partitioningCount(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_npart = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("partitioningCount (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_npart,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 404, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 404, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "partitioningCount", 0) < (0)) __PYX_ERR(39, 404, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 404, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_npart = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("partitioningCount", 0, 0, 1, __pyx_nargs); __PYX_ERR(39, 404, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.IS.partitioningCount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_42partitioningCount(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_npart);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_42partitioningCount(struct PyPetscISObject *__pyx_v_self, PyObject *__pyx_v_npart) {
  PetscInt __pyx_v_size;
  PetscInt *__pyx_v_counts;
  PyObject *__pyx_v_ocounts = 0;
  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_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("partitioningCount", 0);

  /* "petsc4py/PETSc/IS.pyx":424
 *         """
 *         cdef PetscInt size
 *         if npart is None: size = getCommSize(self.iset)             # <<<<<<<<<<<<<<
 *         else: size = asInt(npart)
 *         cdef PetscInt *counts = NULL
*/
  __pyx_t_1 = (__pyx_v_npart == Py_None);
  if (__pyx_t_1) {
    __pyx_v_size = __pyx_f_8petsc4py_5PETSc_getCommSize(__pyx_v_self->iset);
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/IS.pyx":425
 *         cdef PetscInt size
 *         if npart is None: size = getCommSize(self.iset)
 *         else: size = asInt(npart)             # <<<<<<<<<<<<<<
 *         cdef PetscInt *counts = NULL
 *         CHKERR(PetscMalloc(<size_t>size*sizeof(PetscInt), &counts))
*/
  /*else*/ {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_npart); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(39, 425, __pyx_L1_error)
    __pyx_v_size = __pyx_t_2;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/IS.pyx":426
 *         if npart is None: size = getCommSize(self.iset)
 *         else: size = asInt(npart)
 *         cdef PetscInt *counts = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscMalloc(<size_t>size*sizeof(PetscInt), &counts))
 *         CHKERR(ISPartitioningCount(self.iset, size, counts))
*/
  __pyx_v_counts = NULL;

  /* "petsc4py/PETSc/IS.pyx":427
 *         else: size = asInt(npart)
 *         cdef PetscInt *counts = NULL
 *         CHKERR(PetscMalloc(<size_t>size*sizeof(PetscInt), &counts))             # <<<<<<<<<<<<<<
 *         CHKERR(ISPartitioningCount(self.iset, size, counts))
 *         cdef object ocounts = None
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)__pyx_v_size) * (sizeof(PetscInt))), (&__pyx_v_counts))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 427, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":428
 *         cdef PetscInt *counts = NULL
 *         CHKERR(PetscMalloc(<size_t>size*sizeof(PetscInt), &counts))
 *         CHKERR(ISPartitioningCount(self.iset, size, counts))             # <<<<<<<<<<<<<<
 *         cdef object ocounts = None
 *         try:
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISPartitioningCount(__pyx_v_self->iset, __pyx_v_size, __pyx_v_counts)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 428, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":429
 *         CHKERR(PetscMalloc(<size_t>size*sizeof(PetscInt), &counts))
 *         CHKERR(ISPartitioningCount(self.iset, size, counts))
 *         cdef object ocounts = None             # <<<<<<<<<<<<<<
 *         try:
 *             ocounts = array_i(size, counts)
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_ocounts = Py_None;

  /* "petsc4py/PETSc/IS.pyx":430
 *         CHKERR(ISPartitioningCount(self.iset, size, counts))
 *         cdef object ocounts = None
 *         try:             # <<<<<<<<<<<<<<
 *             ocounts = array_i(size, counts)
 *         finally:
*/
  /*try:*/ {

    /* "petsc4py/PETSc/IS.pyx":431
 *         cdef object ocounts = None
 *         try:
 *             ocounts = array_i(size, counts)             # <<<<<<<<<<<<<<
 *         finally:
 *             CHKERR(PetscFree(counts))
*/
    __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_i(__pyx_v_size, __pyx_v_counts)); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 431, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_ocounts, __pyx_t_4);
    __pyx_t_4 = 0;
  }

  /* "petsc4py/PETSc/IS.pyx":433
 *             ocounts = array_i(size, counts)
 *         finally:
 *             CHKERR(PetscFree(counts))             # <<<<<<<<<<<<<<
 *         return ocounts
 * 
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_counts)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 433, __pyx_L1_error)
      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_4); __pyx_t_4 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if ( 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_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_counts)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 433, __pyx_L8_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);
      __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_L8_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);
      __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_L6:;
  }

  /* "petsc4py/PETSc/IS.pyx":434
 *         finally:
 *             CHKERR(PetscFree(counts))
 *         return ocounts             # <<<<<<<<<<<<<<
 * 
 *     def getSize(self) -> int:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_ocounts);
  __pyx_r = __pyx_v_ocounts;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":404
 *         return iset
 * 
 *     def partitioningCount(self, npart: int | None = None) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the number of elements per process after a partitioning.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("petsc4py.PETSc.IS.partitioningCount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ocounts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/IS.pyx":436
 *         return ocounts
 * 
 *     def getSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the global length of an index set.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_45getSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_44getSize, "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:436");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_45getSize = {"getSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_45getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_44getSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_45getSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_44getSize(((struct PyPetscISObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_44getSize(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", 0);

  /* "petsc4py/PETSc/IS.pyx":446
 * 
 *         """
 *         cdef PetscInt N = 0             # <<<<<<<<<<<<<<
 *         CHKERR(ISGetSize(self.iset, &N))
 *         return toInt(N)
*/
  __pyx_v_N = 0;

  /* "petsc4py/PETSc/IS.pyx":447
 *         """
 *         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, 447, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":448
 *         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, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":436
 *         return ocounts
 * 
 *     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":450
 *         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_47getLocalSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_46getLocalSize, "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:450");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_47getLocalSize = {"getLocalSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_47getLocalSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_46getLocalSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_47getLocalSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLocalSize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_46getLocalSize(((struct PyPetscISObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_46getLocalSize(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", 0);

  /* "petsc4py/PETSc/IS.pyx":460
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         CHKERR(ISGetLocalSize(self.iset, &n))
 *         return toInt(n)
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/IS.pyx":461
 *         """
 *         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, 461, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":462
 *         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, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":450
 *         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":464
 *         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_49getSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_48getSizes, "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:464");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_49getSizes = {"getSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_49getSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_48getSizes};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_49getSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSizes", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_48getSizes(((struct PyPetscISObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_48getSizes(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", 0);

  /* "petsc4py/PETSc/IS.pyx":481
 * 
 *         """
 *         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":482
 *         """
 *         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, 482, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":483
 *         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, 483, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":484
 *         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, 484, __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, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 484, __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) != (0)) __PYX_ERR(39, 484, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(39, 484, __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":464
 *         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":486
 *         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_51getBlockSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_50getBlockSize, "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:486");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_51getBlockSize = {"getBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_51getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_50getBlockSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_51getBlockSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBlockSize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_50getBlockSize(((struct PyPetscISObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_50getBlockSize(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", 0);

  /* "petsc4py/PETSc/IS.pyx":496
 * 
 *         """
 *         cdef PetscInt bs = 1             # <<<<<<<<<<<<<<
 *         CHKERR(ISGetBlockSize(self.iset, &bs))
 *         return toInt(bs)
*/
  __pyx_v_bs = 1;

  /* "petsc4py/PETSc/IS.pyx":497
 *         """
 *         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, 497, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":498
 *         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, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":486
 *         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":500
 *         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_53setBlockSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_52setBlockSize, "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:500");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_53setBlockSize = {"setBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_53setBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_52setBlockSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_53setBlockSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bs_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 500, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 500, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBlockSize", 0) < (0)) __PYX_ERR(39, 500, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBlockSize", 1, 1, 1, i); __PYX_ERR(39, 500, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 500, __pyx_L3_error)
    }
    __pyx_v_bs = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setBlockSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(39, 500, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_52setBlockSize(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_bs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_52setBlockSize(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", 0);

  /* "petsc4py/PETSc/IS.pyx":515
 * 
 *         """
 *         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, 515, __pyx_L1_error)
  __pyx_v_cbs = __pyx_t_1;

  /* "petsc4py/PETSc/IS.pyx":516
 *         """
 *         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, 516, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":500
 *         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":518
 *         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_55sort(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_54sort, "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:518");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_55sort = {"sort", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_55sort, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_54sort};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_55sort(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("sort", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_54sort(((struct PyPetscISObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_54sort(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", 0);

  /* "petsc4py/PETSc/IS.pyx":528
 * 
 *         """
 *         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, 528, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":529
 *         """
 *         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":518
 *         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":531
 *         return self
 * 
 *     def isSorted(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the indices have been sorted.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_57isSorted(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_56isSorted, "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:531");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_57isSorted = {"isSorted", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_57isSorted, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_56isSorted};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_57isSorted(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isSorted", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_56isSorted(((struct PyPetscISObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_56isSorted(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", 0);

  /* "petsc4py/PETSc/IS.pyx":541
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(ISSorted(self.iset, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/IS.pyx":542
 *         """
 *         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, 542, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":543
 *         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, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":531
 *         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":545
 *         return toBool(flag)
 * 
 *     def setPermutation(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Mark the index set as being a permutation.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_59setPermutation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_58setPermutation, "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:545");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_59setPermutation = {"setPermutation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_59setPermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_58setPermutation};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_59setPermutation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setPermutation", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_58setPermutation(((struct PyPetscISObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_58setPermutation(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", 0);

  /* "petsc4py/PETSc/IS.pyx":555
 * 
 *         """
 *         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, 555, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":556
 *         """
 *         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":545
 *         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":558
 *         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_61isPermutation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_60isPermutation, "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:558");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_61isPermutation = {"isPermutation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_61isPermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_60isPermutation};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_61isPermutation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isPermutation", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_60isPermutation(((struct PyPetscISObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_60isPermutation(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", 0);

  /* "petsc4py/PETSc/IS.pyx":568
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(ISPermutation(self.iset, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/IS.pyx":569
 *         """
 *         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, 569, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":570
 *         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, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":558
 *         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":572
 *         return toBool(flag)
 * 
 *     def setIdentity(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Mark the index set as being an identity.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_63setIdentity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_62setIdentity, "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:572");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_63setIdentity = {"setIdentity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_63setIdentity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_62setIdentity};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_63setIdentity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setIdentity", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_62setIdentity(((struct PyPetscISObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_62setIdentity(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", 0);

  /* "petsc4py/PETSc/IS.pyx":582
 * 
 *         """
 *         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, 582, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":583
 *         """
 *         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":572
 *         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":585
 *         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_65isIdentity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_64isIdentity, "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:585");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_65isIdentity = {"isIdentity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_65isIdentity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_64isIdentity};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_65isIdentity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isIdentity", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_64isIdentity(((struct PyPetscISObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_64isIdentity(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", 0);

  /* "petsc4py/PETSc/IS.pyx":595
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(ISIdentity(self.iset, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/IS.pyx":596
 *         """
 *         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, 596, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":597
 *         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, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":585
 *         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":599
 *         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_67equal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_66equal, "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:599");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_67equal = {"equal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_67equal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_66equal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_67equal(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_iset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 599, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 599, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "equal", 0) < (0)) __PYX_ERR(39, 599, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("equal", 1, 1, 1, i); __PYX_ERR(39, 599, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 599, __pyx_L3_error)
    }
    __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, 599, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 599, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_66equal(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_66equal(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", 0);

  /* "petsc4py/PETSc/IS.pyx":614
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(ISEqual(self.iset, iset.iset, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/IS.pyx":615
 *         """
 *         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, 615, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":616
 *         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, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":599
 *         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":618
 *         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_69sum(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_68sum, "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:618");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_69sum = {"sum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_69sum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_68sum};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_69sum(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_iset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 618, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 618, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sum", 0) < (0)) __PYX_ERR(39, 618, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sum", 1, 1, 1, i); __PYX_ERR(39, 618, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 618, __pyx_L3_error)
    }
    __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, 618, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 618, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_68sum(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_68sum(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sum", 0);

  /* "petsc4py/PETSc/IS.pyx":633
 * 
 *         """
 *         cdef IS out = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(ISSum(self.iset, iset.iset, &out.iset))
 *         return out
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 633, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":634
 *         """
 *         cdef IS out = IS()
 *         CHKERR(ISSum(self.iset, iset.iset, &out.iset))             # <<<<<<<<<<<<<<
 *         return out
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISSum(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 634, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":635
 *         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":618
 *         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_XDECREF(__pyx_t_2);
  __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":637
 *         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_71expand(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_70expand, "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:637");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_71expand = {"expand", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_71expand, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_70expand};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_71expand(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_iset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 637, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 637, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "expand", 0) < (0)) __PYX_ERR(39, 637, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("expand", 1, 1, 1, i); __PYX_ERR(39, 637, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 637, __pyx_L3_error)
    }
    __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, 637, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 637, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_70expand(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_70expand(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("expand", 0);

  /* "petsc4py/PETSc/IS.pyx":660
 * 
 *         """
 *         cdef IS out = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(ISExpand(self.iset, iset.iset, &out.iset))
 *         return out
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 660, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":661
 *         """
 *         cdef IS out = IS()
 *         CHKERR(ISExpand(self.iset, iset.iset, &out.iset))             # <<<<<<<<<<<<<<
 *         return out
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISExpand(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 661, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":662
 *         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":637
 *         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_XDECREF(__pyx_t_2);
  __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":664
 *         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_73union(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_72union, "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:664");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_73union = {"union", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_73union, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_72union};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_73union(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_iset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 664, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 664, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "union", 0) < (0)) __PYX_ERR(39, 664, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("union", 1, 1, 1, i); __PYX_ERR(39, 664, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 664, __pyx_L3_error)
    }
    __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, 664, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 664, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_72union(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_72union(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("union", 0);

  /* "petsc4py/PETSc/IS.pyx":689
 * 
 *         """
 *         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":690
 *         """
 *         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, 690, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":691
 *         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, 691, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":692
 *         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_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 692, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/IS.pyx":693
 *         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_6 = (__pyx_v_flag1 == PETSC_TRUE);
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (__pyx_v_flag2 == PETSC_TRUE);
  __pyx_t_5 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_5) {

    /* "petsc4py/PETSc/IS.pyx":694
 *         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, 694, __pyx_L1_error)

    /* "petsc4py/PETSc/IS.pyx":693
 *         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":696
 *             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, 696, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/IS.pyx":697
 *         else:
 *             CHKERR(ISExpand(self.iset, iset.iset, &out.iset))
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def intersect(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":664
 *         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_XDECREF(__pyx_t_3);
  __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":699
 *         return out
 * 
 *     def intersect(self, IS iset: IS) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the intersection of two index sets.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_75intersect(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_74intersect, "IS.intersect(self, iset: IS) -> IS\nReturn the intersection of two index sets.\n\n        Collective.\n\n        Parameters\n        ----------\n        iset\n            Index set to compute the intersection with.\n\n        Returns\n        -------\n        IS\n            Index set representing the intersection of ``self`` and ``iset``.\n\n        See Also\n        --------\n        petsc.ISIntersect\n\n        \nSource code at petsc4py/PETSc/IS.pyx:699");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_75intersect = {"intersect", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_75intersect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_74intersect};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_75intersect(PyObject *__pyx_v_self, 
#if 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("intersect (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_iset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 699, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 699, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "intersect", 0) < (0)) __PYX_ERR(39, 699, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("intersect", 1, 1, 1, i); __PYX_ERR(39, 699, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 699, __pyx_L3_error)
    }
    __pyx_v_iset = ((struct PyPetscISObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("intersect", 1, 1, 1, __pyx_nargs); __PYX_ERR(39, 699, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.IS.intersect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iset), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 699, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_74intersect(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_74intersect(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("intersect", 0);

  /* "petsc4py/PETSc/IS.pyx":719
 * 
 *         """
 *         cdef IS out = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(ISIntersect(self.iset, iset.iset, &out.iset))
 *         return out
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 719, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":720
 *         """
 *         cdef IS out = IS()
 *         CHKERR(ISIntersect(self.iset, iset.iset, &out.iset))             # <<<<<<<<<<<<<<
 *         return out
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISIntersect(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 720, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":721
 *         cdef IS out = IS()
 *         CHKERR(ISIntersect(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":699
 *         return out
 * 
 *     def intersect(self, IS iset: IS) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the intersection of two index sets.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.IS.intersect", __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":723
 *         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_77difference(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_76difference, "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:723");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_77difference = {"difference", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_77difference, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_76difference};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_77difference(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_iset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 723, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 723, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "difference", 0) < (0)) __PYX_ERR(39, 723, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("difference", 1, 1, 1, i); __PYX_ERR(39, 723, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 723, __pyx_L3_error)
    }
    __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, 723, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 723, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_76difference(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_76difference(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("difference", 0);

  /* "petsc4py/PETSc/IS.pyx":743
 * 
 *         """
 *         cdef IS out = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(ISDifference(self.iset, iset.iset, &out.iset))
 *         return out
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 743, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":744
 *         """
 *         cdef IS out = IS()
 *         CHKERR(ISDifference(self.iset, iset.iset, &out.iset))             # <<<<<<<<<<<<<<
 *         return out
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISDifference(__pyx_v_self->iset, __pyx_v_iset->iset, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 744, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":745
 *         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":723
 *         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_XDECREF(__pyx_t_2);
  __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":747
 *         return out
 * 
 *     def complement(self, nmin: int, nmax: int) -> IS:             # <<<<<<<<<<<<<<
 *         """Create a complement index set.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_79complement(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_78complement, "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:747");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_79complement = {"complement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_79complement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_78complement};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_79complement(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nmin,&__pyx_mstate_global->__pyx_n_u_nmax,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 747, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 747, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 747, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "complement", 0) < (0)) __PYX_ERR(39, 747, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("complement", 1, 2, 2, i); __PYX_ERR(39, 747, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 747, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 747, __pyx_L3_error)
    }
    __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, 747, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_78complement(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_nmin, __pyx_v_nmax);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_78complement(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("complement", 0);

  /* "petsc4py/PETSc/IS.pyx":777
 * 
 *         """
 *         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, 777, __pyx_L1_error)
  __pyx_v_cnmin = __pyx_t_1;

  /* "petsc4py/PETSc/IS.pyx":778
 *         """
 *         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, 778, __pyx_L1_error)
  __pyx_v_cnmax = __pyx_t_1;

  /* "petsc4py/PETSc/IS.pyx":779
 *         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_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 779, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/IS.pyx":780
 *         cdef PetscInt cnmax = asInt(nmax)
 *         cdef IS out = IS()
 *         CHKERR(ISComplement(self.iset, cnmin, cnmax, &out.iset))             # <<<<<<<<<<<<<<
 *         return out
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISComplement(__pyx_v_self->iset, __pyx_v_cnmin, __pyx_v_cnmax, (&__pyx_v_out->iset))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 780, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":781
 *         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":747
 *         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_XDECREF(__pyx_t_3);
  __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":783
 *         return out
 * 
 *     def embed(self, IS iset, drop: bool) -> IS:             # <<<<<<<<<<<<<<
 *         """Embed ``self`` into ``iset``.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_81embed(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_80embed, "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:783");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_81embed = {"embed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_81embed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_80embed};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_81embed(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_iset,&__pyx_mstate_global->__pyx_n_u_drop,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 783, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 783, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 783, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "embed", 0) < (0)) __PYX_ERR(39, 783, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("embed", 1, 2, 2, i); __PYX_ERR(39, 783, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 783, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 783, __pyx_L3_error)
    }
    __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, 783, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 783, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_80embed(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_drop);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_80embed(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("embed", 0);

  /* "petsc4py/PETSc/IS.pyx":809
 * 
 *         """
 *         cdef PetscBool bval = drop             # <<<<<<<<<<<<<<
 *         cdef IS out = IS()
 *         CHKERR(ISEmbed(self.iset, iset.iset, bval, &out.iset))
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_drop); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(39, 809, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/IS.pyx":810
 *         """
 *         cdef PetscBool bval = drop
 *         cdef IS out = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(ISEmbed(self.iset, iset.iset, bval, &out.iset))
 *         return out
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(39, 810, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/IS.pyx":811
 *         cdef PetscBool bval = drop
 *         cdef IS out = IS()
 *         CHKERR(ISEmbed(self.iset, iset.iset, bval, &out.iset))             # <<<<<<<<<<<<<<
 *         return out
 * 
*/
  __pyx_t_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 811, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":812
 *         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":783
 *         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_XDECREF(__pyx_t_3);
  __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":814
 *         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_83renumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_82renumber, "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:814");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_83renumber = {"renumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_83renumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_82renumber};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_83renumber(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mult,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 814, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 814, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "renumber", 0) < (0)) __PYX_ERR(39, 814, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 814, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
    }
    __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, 814, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 1, "mult", 0))) __PYX_ERR(39, 814, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_82renumber(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_mult);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_82renumber(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("renumber", 0);

  /* "petsc4py/PETSc/IS.pyx":837
 * 
 *         """
 *         cdef PetscIS mlt = NULL             # <<<<<<<<<<<<<<
 *         if mult is not None: mlt = mult.iset
 *         cdef IS out = IS()
*/
  __pyx_v_mlt = NULL;

  /* "petsc4py/PETSc/IS.pyx":838
 *         """
 *         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":839
 *         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_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(39, 839, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_3);
  }
  __pyx_v_out = ((struct PyPetscISObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/IS.pyx":840
 *         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":841
 *         cdef IS out = IS()
 *         cdef PetscInt n = 0
 *         CHKERR(ISRenumber(self.iset, mlt, &n, &out.iset))             # <<<<<<<<<<<<<<
 *         return (toInt(n), out)
 *     #
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISRenumber(__pyx_v_self->iset, __pyx_v_mlt, (&__pyx_v_n), (&__pyx_v_out->iset))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 841, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":842
 *         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, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 842, __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) != (0)) __PYX_ERR(39, 842, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_out);
  __Pyx_GIVEREF((PyObject *)__pyx_v_out);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_out)) != (0)) __PYX_ERR(39, 842, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":814
 *         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_4);
  __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":845
 *     #
 * 
 *     def setIndices(self, indices: Sequence[int]) -> None:             # <<<<<<<<<<<<<<
 *         """Set the indices of an index set.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_85setIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_84setIndices, "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:845");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_85setIndices = {"setIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_85setIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_84setIndices};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_85setIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 845, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 845, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setIndices", 0) < (0)) __PYX_ERR(39, 845, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setIndices", 1, 1, 1, i); __PYX_ERR(39, 845, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 845, __pyx_L3_error)
    }
    __pyx_v_indices = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setIndices", 1, 1, 1, __pyx_nargs); __PYX_ERR(39, 845, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_84setIndices(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_indices);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_84setIndices(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":857
 * 
 *         """
 *         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":858
 *         """
 *         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":859
 *         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, 859, __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":860
 *         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, 860, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":845
 *     #
 * 
 *     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":862
 *         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_87getIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_86getIndices, "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:862");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_87getIndices = {"getIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_87getIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_86getIndices};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_87getIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getIndices", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_86getIndices(((struct PyPetscISObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_86getIndices(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", 0);

  /* "petsc4py/PETSc/IS.pyx":872
 * 
 *         """
 *         cdef PetscInt size = 0             # <<<<<<<<<<<<<<
 *         cdef const PetscInt *indices = NULL
 *         CHKERR(ISGetLocalSize(self.iset, &size))
*/
  __pyx_v_size = 0;

  /* "petsc4py/PETSc/IS.pyx":873
 *         """
 *         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":874
 *         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, 874, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":875
 *         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, 875, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":876
 *         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":877
 *         CHKERR(ISGetIndices(self.iset, &indices))
 *         cdef object oindices = None
 *         try:             # <<<<<<<<<<<<<<
 *             oindices = array_i(size, indices)
 *         finally:
*/
  /*try:*/ {

    /* "petsc4py/PETSc/IS.pyx":878
 *         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, 878, __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":880
 *             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, 880, __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;
       __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if ( 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, 880, __pyx_L7_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);
      __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:;
      __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":881
 *         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":862
 *         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":883
 *         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_89setBlockIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_88setBlockIndices, "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:883");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_89setBlockIndices = {"setBlockIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_89setBlockIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_88setBlockIndices};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_89setBlockIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_indices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 883, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 883, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 883, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBlockIndices", 0) < (0)) __PYX_ERR(39, 883, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBlockIndices", 1, 2, 2, i); __PYX_ERR(39, 883, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 883, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 883, __pyx_L3_error)
    }
    __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, 883, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_88setBlockIndices(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_bsize, __pyx_v_indices);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_88setBlockIndices(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":900
 * 
 *         """
 *         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, 900, __pyx_L1_error)
  __pyx_v_bs = __pyx_t_1;

  /* "petsc4py/PETSc/IS.pyx":901
 *         """
 *         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":902
 *         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":903
 *         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, 903, __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":904
 *         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, 904, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":883
 *         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":906
 *         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_91getBlockIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_90getBlockIndices, "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:906");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_91getBlockIndices = {"getBlockIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_91getBlockIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_90getBlockIndices};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_91getBlockIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBlockIndices", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_90getBlockIndices(((struct PyPetscISObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_90getBlockIndices(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", 0);

  /* "petsc4py/PETSc/IS.pyx":916
 * 
 *         """
 *         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":917
 *         """
 *         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":918
 *         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, 918, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":919
 *         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, 919, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":920
 *         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, 920, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":921
 *         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":922
 *         CHKERR(ISBlockGetIndices(self.iset, &indices))
 *         cdef object oindices = None
 *         try:             # <<<<<<<<<<<<<<
 *             oindices = array_i(size//bs, indices)
 *         finally:
*/
  /*try:*/ {

    /* "petsc4py/PETSc/IS.pyx":923
 *         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, 923, __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":925
 *             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, 925, __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;
       __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if ( 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, 925, __pyx_L7_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);
      __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:;
      __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":926
 *         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":906
 *         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":928
 *         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_93setStride(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_92setStride, "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:928");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_93setStride = {"setStride", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_93setStride, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_92setStride};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_93setStride(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_first,&__pyx_mstate_global->__pyx_n_u_step,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 928, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(39, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setStride", 0) < (0)) __PYX_ERR(39, 928, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setStride", 0, 1, 3, i); __PYX_ERR(39, 928, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(39, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 928, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
    }
    __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, 928, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_92setStride(((struct PyPetscISObject *)__pyx_v_self), __pyx_v_size, __pyx_v_first, __pyx_v_step);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_92setStride(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", 0);

  /* "petsc4py/PETSc/IS.pyx":947
 * 
 *         """
 *         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, 947, __pyx_L1_error)
  __pyx_v_csize = __pyx_t_1;

  /* "petsc4py/PETSc/IS.pyx":948
 *         """
 *         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, 948, __pyx_L1_error)
  __pyx_v_cfirst = __pyx_t_1;

  /* "petsc4py/PETSc/IS.pyx":949
 *         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, 949, __pyx_L1_error)
  __pyx_v_cstep = __pyx_t_1;

  /* "petsc4py/PETSc/IS.pyx":950
 *         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, 950, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":928
 *         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":952
 *         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_95getStride(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_94getStride, "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:952");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_95getStride = {"getStride", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_95getStride, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_94getStride};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_95getStride(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getStride", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_94getStride(((struct PyPetscISObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_94getStride(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", 0);

  /* "petsc4py/PETSc/IS.pyx":971
 * 
 *         """
 *         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":972
 *         """
 *         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, 972, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":973
 *         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, 973, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":974
 *         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, 974, __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, 974, __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, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 974, __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) != (0)) __PYX_ERR(39, 974, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(39, 974, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4) != (0)) __PYX_ERR(39, 974, __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":952
 *         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":976
 *         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_97getInfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_96getInfo, "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:976");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2IS_97getInfo = {"getInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_97getInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_96getInfo};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2IS_97getInfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getInfo", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2IS_96getInfo(((struct PyPetscISObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2IS_96getInfo(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", 0);

  /* "petsc4py/PETSc/IS.pyx":993
 * 
 *         """
 *         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":994
 *         """
 *         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, 994, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":995
 *         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, 995, __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, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 995, __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) != (0)) __PYX_ERR(39, 995, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(39, 995, __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":976
 *         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":1009
 * 
 *         """
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/IS.pyx":1010
 *         """
 *         def __get__(self) -> bool:
 *             return self.isPermutation()             # <<<<<<<<<<<<<<
 * 
 *     property identity:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isPermutation, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1009
 * 
 *         """
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.isPermutation()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":1022
 * 
 *         """
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/IS.pyx":1023
 *         """
 *         def __get__(self) -> bool:
 *             return self.isIdentity()             # <<<<<<<<<<<<<<
 * 
 *     property sorted:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isIdentity, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1023, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1022
 * 
 *         """
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.isIdentity()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":1035
 * 
 *         """
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/IS.pyx":1036
 *         """
 *         def __get__(self) -> bool:
 *             return self.isSorted()             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isSorted, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1035
 * 
 *         """
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.isSorted()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":1050
 * 
 *         """
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/IS.pyx":1051
 *         """
 *         def __get__(self) -> tuple[int, int]:
 *             return self.getSizes()             # <<<<<<<<<<<<<<
 * 
 *     property size:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSizes, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1050
 * 
 *         """
 *         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_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":1063
 * 
 *         """
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/IS.pyx":1064
 *         """
 *         def __get__(self) -> int:
 *             return self.getSize()             # <<<<<<<<<<<<<<
 * 
 *     property local_size:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSize, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1063
 * 
 *         """
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getSize()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":1076
 * 
 *         """
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/IS.pyx":1077
 *         """
 *         def __get__(self) -> int:
 *             return self.getLocalSize()             # <<<<<<<<<<<<<<
 * 
 *     property block_size:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getLocalSize, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1076
 * 
 *         """
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getLocalSize()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":1089
 * 
 *         """
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/IS.pyx":1090
 *         """
 *         def __get__(self) -> int:
 *             return self.getBlockSize()             # <<<<<<<<<<<<<<
 * 
 *     property indices:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getBlockSize, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1090, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1089
 * 
 *         """
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getBlockSize()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":1102
 * 
 *         """
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/IS.pyx":1103
 *         """
 *         def __get__(self) -> ArrayInt:
 *             return self.getIndices()             # <<<<<<<<<<<<<<
 * 
 *     property array:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getIndices, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1102
 * 
 *         """
 *         def __get__(self) -> ArrayInt:             # <<<<<<<<<<<<<<
 *             return self.getIndices()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":1111
 * 
 *         """
 *         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__", 0);

  /* "petsc4py/PETSc/IS.pyx":1112
 *         """
 *         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, 1112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1111
 * 
 *         """
 *         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":1117
 * 
 *     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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/IS.pyx":1118
 *     property __array_interface__:
 *         def __get__(self):
 *             cdef _IS_buffer buf = _IS_buffer(self)             # <<<<<<<<<<<<<<
 *             return buf.__array_interface__
 * 
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__IS_buffer, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1118, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__IS_buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":1119
 *         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_mstate_global->__pyx_n_u_array_interface); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1117
 * 
 *     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_XDECREF(__pyx_t_2);
  __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":1163
 *     #
 * 
 *     def __cinit__(self) -> None:             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":1164
 * 
 *     def __cinit__(self) -> None:
 *         self.obj = <PetscObject*> &self.lgm             # <<<<<<<<<<<<<<
 *         self.lgm = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->lgm));

  /* "petsc4py/PETSc/IS.pyx":1165
 *     def __cinit__(self) -> None:
 *         self.obj = <PetscObject*> &self.lgm
 *         self.lgm = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __call__(
*/
  __pyx_v_self->lgm = NULL;

  /* "petsc4py/PETSc/IS.pyx":1163
 *     #
 * 
 *     def __cinit__(self) -> None:             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.lgm
 *         self.lgm = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/IS.pyx":1167
 *         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_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_result,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 1167, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 1167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(39, 1167, __pyx_L3_error)

      /* "petsc4py/PETSc/IS.pyx":1170
 *         self,
 *         indices: Sequence[int],
 *         result: ArrayInt | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Convert a locally numbered list of integers to a global numbering.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, i); __PYX_ERR(39, 1167, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 1167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1167, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1167, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":1167
 *         self.lgm = NULL
 * 
 *     def __call__(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "petsc4py/PETSc/IS.pyx":1188
 * 
 *         """
 *         self.apply(indices, result)             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_indices, __pyx_v_result};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_apply, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":1167
 *         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_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":1192
 *     #
 * 
 *     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:1192");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_5setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_5setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_4setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_lgmap_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 1192, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(39, 1192, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(39, 1192, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1192, __pyx_L3_error)
    }
    __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, 1192, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":1212
 * 
 *         """
 *         cdef PetscISLocalToGlobalMappingType cval = NULL             # <<<<<<<<<<<<<<
 *         lgmap_type = str2bytes(lgmap_type, &cval)
 *         CHKERR(ISLocalToGlobalMappingSetType(self.lgm, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/IS.pyx":1213
 *         """
 *         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, 1213, __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":1214
 *         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, 1214, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1192
 *     #
 * 
 *     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":1216
 *         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:1216");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_7setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_7setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_6setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/IS.pyx":1226
 * 
 *         """
 *         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, 1226, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1216
 *         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":1228
 *         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        load, petsc.ISLocalToGlobalMappingView\n\n        \nSource code at petsc4py/PETSc/IS.pyx:1228");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_9view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_9view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_8view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 1228, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(39, 1228, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 1228, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(39, 1228, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/IS.pyx":1243
 * 
 *         """
 *         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":1244
 *         """
 *         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":1245
 *         cdef PetscViewer cviewer = NULL
 *         if viewer is not None: cviewer = viewer.vwr
 *         CHKERR(ISLocalToGlobalMappingView(self.lgm, cviewer))             # <<<<<<<<<<<<<<
 * 
 *     def load(self, Viewer viewer) -> 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, 1245, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1228
 *         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":1247
 *         CHKERR(ISLocalToGlobalMappingView(self.lgm, cviewer))
 * 
 *     def load(self, Viewer viewer) -> Self:             # <<<<<<<<<<<<<<
 *         """Load a local-to-global mapping.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_11load(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_10load, "LGMap.load(self, viewer: Viewer) -> Self\nLoad a local-to-global mapping.\n\n        Collective.\n\n        See Also\n        --------\n        view, petsc.ISLocalToGlobalMappingLoad\n\n        \nSource code at petsc4py/PETSc/IS.pyx:1247");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_11load = {"load", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_11load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_10load};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_11load(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 1247, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1247, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "load", 0) < (0)) __PYX_ERR(39, 1247, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, i); __PYX_ERR(39, 1247, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1247, __pyx_L3_error)
    }
    __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, 1247, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.LGMap.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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(39, 1247, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_10load(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_viewer);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_10load(struct PyPetscLGMapObject *__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", 0);

  /* "petsc4py/PETSc/IS.pyx":1257
 * 
 *         """
 *         cdef MPI_Comm comm = MPI_COMM_NULL             # <<<<<<<<<<<<<<
 *         cdef PetscObject obj = <PetscObject>(viewer.vwr)
 *         if self.lgm == NULL:
*/
  __pyx_v_comm = MPI_COMM_NULL;

  /* "petsc4py/PETSc/IS.pyx":1258
 *         """
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         cdef PetscObject obj = <PetscObject>(viewer.vwr)             # <<<<<<<<<<<<<<
 *         if self.lgm == NULL:
 *             CHKERR(PetscObjectGetComm(obj, &comm))
*/
  __pyx_v_obj = ((PetscObject)__pyx_v_viewer->vwr);

  /* "petsc4py/PETSc/IS.pyx":1259
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         cdef PetscObject obj = <PetscObject>(viewer.vwr)
 *         if self.lgm == NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscObjectGetComm(obj, &comm))
 *             CHKERR(ISLocalToGlobalMappingCreate(comm, 1, 0, NULL, PETSC_USE_POINTER, &self.lgm))
*/
  __pyx_t_1 = (__pyx_v_self->lgm == NULL);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/IS.pyx":1260
 *         cdef PetscObject obj = <PetscObject>(viewer.vwr)
 *         if self.lgm == NULL:
 *             CHKERR(PetscObjectGetComm(obj, &comm))             # <<<<<<<<<<<<<<
 *             CHKERR(ISLocalToGlobalMappingCreate(comm, 1, 0, NULL, PETSC_USE_POINTER, &self.lgm))
 *         CHKERR(ISLocalToGlobalMappingLoad(self.lgm, 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, 1260, __pyx_L1_error)

    /* "petsc4py/PETSc/IS.pyx":1261
 *         if self.lgm == NULL:
 *             CHKERR(PetscObjectGetComm(obj, &comm))
 *             CHKERR(ISLocalToGlobalMappingCreate(comm, 1, 0, NULL, PETSC_USE_POINTER, &self.lgm))             # <<<<<<<<<<<<<<
 *         CHKERR(ISLocalToGlobalMappingLoad(self.lgm, viewer.vwr))
 *         return self
*/
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingCreate(__pyx_v_comm, 1, 0, NULL, PETSC_USE_POINTER, (&__pyx_v_self->lgm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1261, __pyx_L1_error)

    /* "petsc4py/PETSc/IS.pyx":1259
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         cdef PetscObject obj = <PetscObject>(viewer.vwr)
 *         if self.lgm == NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscObjectGetComm(obj, &comm))
 *             CHKERR(ISLocalToGlobalMappingCreate(comm, 1, 0, NULL, PETSC_USE_POINTER, &self.lgm))
*/
  }

  /* "petsc4py/PETSc/IS.pyx":1262
 *             CHKERR(PetscObjectGetComm(obj, &comm))
 *             CHKERR(ISLocalToGlobalMappingCreate(comm, 1, 0, NULL, PETSC_USE_POINTER, &self.lgm))
 *         CHKERR(ISLocalToGlobalMappingLoad(self.lgm, viewer.vwr))             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingLoad(__pyx_v_self->lgm, __pyx_v_viewer->vwr)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1262, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1263
 *             CHKERR(ISLocalToGlobalMappingCreate(comm, 1, 0, NULL, PETSC_USE_POINTER, &self.lgm))
 *         CHKERR(ISLocalToGlobalMappingLoad(self.lgm, 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/IS.pyx":1247
 *         CHKERR(ISLocalToGlobalMappingView(self.lgm, cviewer))
 * 
 *     def load(self, Viewer viewer) -> Self:             # <<<<<<<<<<<<<<
 *         """Load a local-to-global mapping.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.LGMap.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":1265
 *         return self
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the local-to-global mapping.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_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_5LGMap_12destroy, "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:1265");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_13destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_13destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_12destroy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_12destroy(((struct PyPetscLGMapObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_12destroy(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", 0);

  /* "petsc4py/PETSc/IS.pyx":1275
 * 
 *         """
 *         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, 1275, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1276
 *         """
 *         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":1265
 *         return self
 * 
 *     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":1278
 *         return self
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_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_5LGMap_14create, "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:1278");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_15create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_15create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_14create};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_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_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 1278, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(39, 1278, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 1278, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1278, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(39, 1278, __pyx_L3_error)

      /* "petsc4py/PETSc/IS.pyx":1281
 *         self,
 *         indices: Sequence[int],
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a local-to-global mapping.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/IS.pyx":1282
 *         indices: Sequence[int],
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a local-to-global mapping.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, i); __PYX_ERR(39, 1278, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(39, 1278, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 1278, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1278, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/IS.pyx":1281
 *         self,
 *         indices: Sequence[int],
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a local-to-global mapping.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/IS.pyx":1282
 *         indices: Sequence[int],
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a local-to-global mapping.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1278, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_14create(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_bsize, __pyx_v_comm);

  /* "petsc4py/PETSc/IS.pyx":1278
 *         return self
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_14create(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":1301
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(39, 1301, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/IS.pyx":1302
 *         """
 *         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":1303
 *         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":1304
 *         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":1305
 *         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, 1305, __pyx_L1_error)
    __pyx_v_bs = __pyx_t_3;
  }

  /* "petsc4py/PETSc/IS.pyx":1306
 *         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":1307
 *         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, 1307, __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":1308
 *         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, 1308, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1310
 *         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, 1310, __pyx_L1_error)
  __pyx_v_self->lgm = __pyx_v_newlgm;

  /* "petsc4py/PETSc/IS.pyx":1311
 *                 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":1278
 *         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":1313
 *         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_17createIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_16createIS, "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:1313");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_17createIS = {"createIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_17createIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_16createIS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_17createIS(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_iset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 1313, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1313, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createIS", 0) < (0)) __PYX_ERR(39, 1313, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createIS", 1, 1, 1, i); __PYX_ERR(39, 1313, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1313, __pyx_L3_error)
    }
    __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, 1313, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 1313, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_16createIS(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_iset);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_16createIS(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", 0);

  /* "petsc4py/PETSc/IS.pyx":1328
 * 
 *         """
 *         cdef PetscLGMap newlgm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(ISLocalToGlobalMappingCreateIS(
 *             iset.iset, &newlgm))
*/
  __pyx_v_newlgm = NULL;

  /* "petsc4py/PETSc/IS.pyx":1329
 *         """
 *         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, 1329, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1331
 *         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, 1331, __pyx_L1_error)
  __pyx_v_self->lgm = __pyx_v_newlgm;

  /* "petsc4py/PETSc/IS.pyx":1332
 *             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":1313
 *         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":1334
 *         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_19createSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_18createSF, "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:1334");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_19createSF = {"createSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_19createSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_18createSF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_19createSF(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sf,&__pyx_mstate_global->__pyx_n_u_start,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 1334, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 1334, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1334, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createSF", 0) < (0)) __PYX_ERR(39, 1334, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createSF", 1, 2, 2, i); __PYX_ERR(39, 1334, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1334, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 1334, __pyx_L3_error)
    }
    __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, 1334, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(39, 1334, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_18createSF(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_sf, __pyx_v_start);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_18createSF(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", 0);

  /* "petsc4py/PETSc/IS.pyx":1351
 * 
 *         """
 *         cdef PetscLGMap newlgm = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt cstart = asInt(start)
 *         CHKERR(ISLocalToGlobalMappingCreateSF(sf.sf, cstart, &newlgm))
*/
  __pyx_v_newlgm = NULL;

  /* "petsc4py/PETSc/IS.pyx":1352
 *         """
 *         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, 1352, __pyx_L1_error)
  __pyx_v_cstart = __pyx_t_1;

  /* "petsc4py/PETSc/IS.pyx":1353
 *         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, 1353, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1354
 *         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, 1354, __pyx_L1_error)
  __pyx_v_self->lgm = __pyx_v_newlgm;

  /* "petsc4py/PETSc/IS.pyx":1355
 *         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":1334
 *         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":1357
 *         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_21getSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_20getSize, "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:1357");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_21getSize = {"getSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_21getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_20getSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_21getSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_20getSize(((struct PyPetscLGMapObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_20getSize(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", 0);

  /* "petsc4py/PETSc/IS.pyx":1367
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         CHKERR(ISLocalToGlobalMappingGetSize(self.lgm, &n))
 *         return toInt(n)
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/IS.pyx":1368
 *         """
 *         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, 1368, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1369
 *         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, 1369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1357
 *         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":1371
 *         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_23getBlockSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_22getBlockSize, "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:1371");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_23getBlockSize = {"getBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_23getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_22getBlockSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_23getBlockSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBlockSize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_22getBlockSize(((struct PyPetscLGMapObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_22getBlockSize(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", 0);

  /* "petsc4py/PETSc/IS.pyx":1381
 * 
 *         """
 *         cdef PetscInt bs = 1             # <<<<<<<<<<<<<<
 *         CHKERR(ISLocalToGlobalMappingGetBlockSize(self.lgm, &bs))
 *         return toInt(bs)
*/
  __pyx_v_bs = 1;

  /* "petsc4py/PETSc/IS.pyx":1382
 *         """
 *         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, 1382, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1383
 *         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, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1371
 *         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":1385
 *         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_25getIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_24getIndices, "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:1385");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_25getIndices = {"getIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_25getIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_24getIndices};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_25getIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getIndices", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_24getIndices(((struct PyPetscLGMapObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_24getIndices(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", 0);

  /* "petsc4py/PETSc/IS.pyx":1395
 * 
 *         """
 *         cdef PetscInt size = 0             # <<<<<<<<<<<<<<
 *         cdef const PetscInt *indices = NULL
 *         CHKERR(ISLocalToGlobalMappingGetSize(
*/
  __pyx_v_size = 0;

  /* "petsc4py/PETSc/IS.pyx":1396
 *         """
 *         cdef PetscInt size = 0
 *         cdef const PetscInt *indices = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(ISLocalToGlobalMappingGetSize(
 *                 self.lgm, &size))
*/
  __pyx_v_indices = NULL;

  /* "petsc4py/PETSc/IS.pyx":1397
 *         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, 1397, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1399
 *         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, 1399, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1401
 *         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":1402
 *                 self.lgm, &indices))
 *         cdef object oindices = None
 *         try:             # <<<<<<<<<<<<<<
 *             oindices = array_i(size, indices)
 *         finally:
*/
  /*try:*/ {

    /* "petsc4py/PETSc/IS.pyx":1403
 *         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, 1403, __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":1405
 *             oindices = array_i(size, indices)
 *         finally:
 *             CHKERR(ISLocalToGlobalMappingRestoreIndices(             # <<<<<<<<<<<<<<
 *                     self.lgm, &indices))
 *         return oindices
*/
  /*finally:*/ {
    /*normal exit:*/{

      /* "petsc4py/PETSc/IS.pyx":1406
 *         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, 1405, __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;
       __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if ( 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":1405
 *             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, 1405, __pyx_L7_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);
      __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:;
      __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":1407
 *             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":1385
 *         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":1409
 *         return oindices
 * 
 *     def getBlockIndices(self) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the global indices for each local block.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_27getBlockIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_26getBlockIndices, "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:1409");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_27getBlockIndices = {"getBlockIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_27getBlockIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_26getBlockIndices};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_27getBlockIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBlockIndices", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_26getBlockIndices(((struct PyPetscLGMapObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_26getBlockIndices(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", 0);

  /* "petsc4py/PETSc/IS.pyx":1419
 * 
 *         """
 *         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":1420
 *         """
 *         cdef PetscInt size = 0, bs = 1
 *         cdef const PetscInt *indices = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(ISLocalToGlobalMappingGetSize(
 *                 self.lgm, &size))
*/
  __pyx_v_indices = NULL;

  /* "petsc4py/PETSc/IS.pyx":1421
 *         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, 1421, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1423
 *         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, 1423, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1425
 *         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, 1425, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1427
 *         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":1428
 *                 self.lgm, &indices))
 *         cdef object oindices = None
 *         try:             # <<<<<<<<<<<<<<
 *             oindices = array_i(size//bs, indices)
 *         finally:
*/
  /*try:*/ {

    /* "petsc4py/PETSc/IS.pyx":1429
 *         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, 1429, __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":1431
 *             oindices = array_i(size//bs, indices)
 *         finally:
 *             CHKERR(ISLocalToGlobalMappingRestoreBlockIndices(             # <<<<<<<<<<<<<<
 *                     self.lgm, &indices))
 *         return oindices
*/
  /*finally:*/ {
    /*normal exit:*/{

      /* "petsc4py/PETSc/IS.pyx":1432
 *         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, 1431, __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;
       __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if ( 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":1431
 *             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, 1431, __pyx_L7_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);
      __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:;
      __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":1433
 *             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":1409
 *         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":1435
 *         return oindices
 * 
 *     def getInfo(self) -> dict[int, ArrayInt]:             # <<<<<<<<<<<<<<
 *         """Determine the indices shared with neighboring processes.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_29getInfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_28getInfo, "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:1435");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_29getInfo = {"getInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_29getInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_28getInfo};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_29getInfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getInfo", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_28getInfo(((struct PyPetscLGMapObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_28getInfo(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", 0);

  /* "petsc4py/PETSc/IS.pyx":1451
 * 
 *         """
 *         cdef PetscInt i, nproc = 0, *procs = NULL,             # <<<<<<<<<<<<<<
 *         cdef PetscInt *numprocs = NULL, **indices = NULL
 *         cdef dict neighs = {}
*/
  __pyx_v_nproc = 0;
  __pyx_v_procs = NULL;

  /* "petsc4py/PETSc/IS.pyx":1452
 *         """
 *         cdef PetscInt i, nproc = 0, *procs = NULL,
 *         cdef PetscInt *numprocs = NULL, **indices = NULL             # <<<<<<<<<<<<<<
 *         cdef dict neighs = {}
 *         CHKERR(ISLocalToGlobalMappingGetInfo(
*/
  __pyx_v_numprocs = NULL;
  __pyx_v_indices = NULL;

  /* "petsc4py/PETSc/IS.pyx":1453
 *         cdef PetscInt i, nproc = 0, *procs = NULL,
 *         cdef PetscInt *numprocs = NULL, **indices = NULL
 *         cdef dict neighs = {}             # <<<<<<<<<<<<<<
 *         CHKERR(ISLocalToGlobalMappingGetInfo(
 *                 self.lgm, &nproc, &procs, &numprocs, &indices))
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_neighs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":1454
 *         cdef PetscInt *numprocs = NULL, **indices = NULL
 *         cdef dict 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, 1454, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1456
 *         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":1457
 *                 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":1458
 *         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, 1458, __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, 1458, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely((PyDict_SetItem(__pyx_v_neighs, __pyx_t_4, __pyx_t_1) < 0))) __PYX_ERR(39, 1458, __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":1460
 *                 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":1461
 *         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;
       __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if ( 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":1460
 *                 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)));
      }
      __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":1462
 *             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":1435
 *         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":1464
 *         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_31getBlockInfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_30getBlockInfo, "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:1464");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_31getBlockInfo = {"getBlockInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_31getBlockInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_30getBlockInfo};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_31getBlockInfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBlockInfo", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_30getBlockInfo(((struct PyPetscLGMapObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_30getBlockInfo(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", 0);

  /* "petsc4py/PETSc/IS.pyx":1480
 * 
 *         """
 *         cdef PetscInt i, nproc = 0, *procs = NULL,             # <<<<<<<<<<<<<<
 *         cdef PetscInt *numprocs = NULL, **indices = NULL
 *         cdef dict neighs = {}
*/
  __pyx_v_nproc = 0;
  __pyx_v_procs = NULL;

  /* "petsc4py/PETSc/IS.pyx":1481
 *         """
 *         cdef PetscInt i, nproc = 0, *procs = NULL,
 *         cdef PetscInt *numprocs = NULL, **indices = NULL             # <<<<<<<<<<<<<<
 *         cdef dict neighs = {}
 *         CHKERR(ISLocalToGlobalMappingGetBlockInfo(
*/
  __pyx_v_numprocs = NULL;
  __pyx_v_indices = NULL;

  /* "petsc4py/PETSc/IS.pyx":1482
 *         cdef PetscInt i, nproc = 0, *procs = NULL,
 *         cdef PetscInt *numprocs = NULL, **indices = NULL
 *         cdef dict neighs = {}             # <<<<<<<<<<<<<<
 *         CHKERR(ISLocalToGlobalMappingGetBlockInfo(
 *                 self.lgm, &nproc, &procs, &numprocs, &indices))
*/
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_neighs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":1483
 *         cdef PetscInt *numprocs = NULL, **indices = NULL
 *         cdef dict 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, 1483, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1485
 *         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":1486
 *                 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":1487
 *         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, 1487, __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, 1487, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely((PyDict_SetItem(__pyx_v_neighs, __pyx_t_4, __pyx_t_1) < 0))) __PYX_ERR(39, 1487, __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":1489
 *                 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":1490
 *         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;
       __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if ( 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":1489
 *                 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)));
      }
      __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":1491
 *             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":1464
 *         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":1495
 *     #
 * 
 *     def apply(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_33apply(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_32apply, "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:1495");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_33apply = {"apply", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_33apply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_32apply};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_33apply(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_result,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 1495, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 1495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "apply", 0) < (0)) __PYX_ERR(39, 1495, __pyx_L3_error)

      /* "petsc4py/PETSc/IS.pyx":1498
 *         self,
 *         indices: Sequence[int],
 *         result: ArrayInt | None = None) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Convert a locally numbered list of integers to a global numbering.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("apply", 0, 1, 2, i); __PYX_ERR(39, 1495, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 1495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1495, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1495, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_32apply(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_result);

  /* "petsc4py/PETSc/IS.pyx":1495
 *     #
 * 
 *     def apply(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_32apply(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":1522
 * 
 *         """
 *         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":1523
 *         """
 *         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":1524
 *         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, 1524, __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":1525
 *         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, 1525, __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":1526
 *         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, 1526, __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":1527
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_incompatible_array_sizes, 0, 0);
      __PYX_ERR(39, 1527, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(39, 1527, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/IS.pyx":1528
 *         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, 1528, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1530
 *         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":1495
 *     #
 * 
 *     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":1532
 *         return result
 * 
 *     def applyBlock(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_35applyBlock(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_34applyBlock, "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:1532");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_35applyBlock = {"applyBlock", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_35applyBlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_34applyBlock};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_35applyBlock(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_result,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 1532, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 1532, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1532, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "applyBlock", 0) < (0)) __PYX_ERR(39, 1532, __pyx_L3_error)

      /* "petsc4py/PETSc/IS.pyx":1535
 *         self,
 *         indices: Sequence[int],
 *         result: ArrayInt | None = None) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Convert a local block numbering to a global block numbering.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("applyBlock", 0, 1, 2, i); __PYX_ERR(39, 1532, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 1532, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1532, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1532, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_34applyBlock(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_result);

  /* "petsc4py/PETSc/IS.pyx":1532
 *         return result
 * 
 *     def applyBlock(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_34applyBlock(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":1559
 * 
 *         """
 *         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":1560
 *         """
 *         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":1561
 *         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, 1561, __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":1562
 *         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, 1562, __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":1563
 *         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, 1563, __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":1564
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_incompatible_array_sizes, 0, 0);
      __PYX_ERR(39, 1564, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(39, 1564, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/IS.pyx":1565
 *         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, 1565, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1567
 *         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":1532
 *         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":1569
 *         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_37applyIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_36applyIS, "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:1569");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_37applyIS = {"applyIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_37applyIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_36applyIS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_37applyIS(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_iset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 1569, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1569, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "applyIS", 0) < (0)) __PYX_ERR(39, 1569, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("applyIS", 1, 1, 1, i); __PYX_ERR(39, 1569, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1569, __pyx_L3_error)
    }
    __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, 1569, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(39, 1569, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_5LGMap_36applyIS(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_iset);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_36applyIS(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("applyIS", 0);

  /* "petsc4py/PETSc/IS.pyx":1589
 * 
 *         """
 *         cdef IS result = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(ISLocalToGlobalMappingApplyIS(
 *             self.lgm, iset.iset, &result.iset))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1589, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_result = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/IS.pyx":1590
 *         """
 *         cdef IS result = IS()
 *         CHKERR(ISLocalToGlobalMappingApplyIS(             # <<<<<<<<<<<<<<
 *             self.lgm, iset.iset, &result.iset))
 *         return result
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISLocalToGlobalMappingApplyIS(__pyx_v_self->lgm, __pyx_v_iset->iset, (&__pyx_v_result->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(39, 1590, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1592
 *         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":1569
 *         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_XDECREF(__pyx_t_2);
  __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":1594
 *         return result
 * 
 *     def applyInverse(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_39applyInverse(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_38applyInverse, "LGMap.applyInverse(self, indices: Sequence[int], mode: LGMap.MapMode | 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:1594");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_39applyInverse = {"applyInverse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_39applyInverse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_38applyInverse};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_39applyInverse(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 1594, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 1594, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1594, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "applyInverse", 0) < (0)) __PYX_ERR(39, 1594, __pyx_L3_error)

      /* "petsc4py/PETSc/IS.pyx":1597
 *         self,
 *         indices: Sequence[int],
 *         mode: LGMap.MapMode | str | None = None) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Compute local numbering from global numbering.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("applyInverse", 0, 1, 2, i); __PYX_ERR(39, 1594, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 1594, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1594, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1594, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_38applyInverse(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_mode);

  /* "petsc4py/PETSc/IS.pyx":1594
 *         return result
 * 
 *     def applyInverse(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_38applyInverse(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":1620
 * 
 *         """
 *         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":1621
 *         """
 *         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_PyLong_As_ISGlobalToLocalMappingMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1621, __pyx_L1_error)
    __pyx_v_cmode = __pyx_t_2;
  }

  /* "petsc4py/PETSc/IS.pyx":1622
 *         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":1623
 *         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, 1623, __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":1624
 *         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":1625
 *         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":1626
 *         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, 1626, __pyx_L1_error)

    /* "petsc4py/PETSc/IS.pyx":1625
 *         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":1628
 *             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, 1628, __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, 1628, __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":1629
 *                     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, 1629, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1631
 *         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":1594
 *         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":1633
 *         return result
 * 
 *     def applyBlockInverse(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_41applyBlockInverse(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_40applyBlockInverse, "LGMap.applyBlockInverse(self, indices: Sequence[int], mode: LGMap.MapMode | 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:1633");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5LGMap_41applyBlockInverse = {"applyBlockInverse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_41applyBlockInverse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_40applyBlockInverse};
static PyObject *__pyx_pw_8petsc4py_5PETSc_5LGMap_41applyBlockInverse(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(39, 1633, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 1633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "applyBlockInverse", 0) < (0)) __PYX_ERR(39, 1633, __pyx_L3_error)

      /* "petsc4py/PETSc/IS.pyx":1636
 *         self,
 *         indices: Sequence[int],
 *         mode: LGMap.MapMode | str | None = None) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Compute blocked local numbering from blocked global numbering.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("applyBlockInverse", 0, 1, 2, i); __PYX_ERR(39, 1633, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(39, 1633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(39, 1633, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1633, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_40applyBlockInverse(((struct PyPetscLGMapObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_mode);

  /* "petsc4py/PETSc/IS.pyx":1633
 *         return result
 * 
 *     def applyBlockInverse(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_5LGMap_40applyBlockInverse(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":1659
 * 
 *         """
 *         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":1660
 *         """
 *         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_PyLong_As_ISGlobalToLocalMappingMode(__pyx_v_mode)); if (unlikely(PyErr_Occurred())) __PYX_ERR(39, 1660, __pyx_L1_error)
    __pyx_v_cmode = __pyx_t_2;
  }

  /* "petsc4py/PETSc/IS.pyx":1661
 *         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":1662
 *         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, 1662, __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":1663
 *         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":1664
 *         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":1665
 *         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, 1665, __pyx_L1_error)

    /* "petsc4py/PETSc/IS.pyx":1664
 *         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":1667
 *             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, 1667, __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, 1667, __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":1668
 *                     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, 1668, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1670
 *         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":1633
 *         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":1683
 * 
 *         """
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/IS.pyx":1684
 *         """
 *         def __get__(self) -> int:
 *             return self.getSize()             # <<<<<<<<<<<<<<
 * 
 *     property block_size:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSize, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1683
 * 
 *         """
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getSize()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":1696
 * 
 *         """
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/IS.pyx":1697
 *         """
 *         def __get__(self) -> int:
 *             return self.getBlockSize()             # <<<<<<<<<<<<<<
 * 
 *     property indices:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getBlockSize, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1696
 * 
 *         """
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getBlockSize()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":1709
 * 
 *         """
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/IS.pyx":1710
 *         """
 *         def __get__(self) -> ArrayInt:
 *             return self.getIndices()             # <<<<<<<<<<<<<<
 * 
 *     property block_indices:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getIndices, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1709
 * 
 *         """
 *         def __get__(self) -> ArrayInt:             # <<<<<<<<<<<<<<
 *             return self.getIndices()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":1722
 * 
 *         """
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/IS.pyx":1723
 *         """
 *         def __get__(self) -> ArrayInt:
 *             return self.getBlockIndices()             # <<<<<<<<<<<<<<
 * 
 *     property info:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getBlockIndices, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1722
 * 
 *         """
 *         def __get__(self) -> ArrayInt:             # <<<<<<<<<<<<<<
 *             return self.getBlockIndices()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":1735
 * 
 *         """
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/IS.pyx":1736
 *         """
 *         def __get__(self) -> dict[int, ArrayInt]:
 *             return self.getInfo()             # <<<<<<<<<<<<<<
 * 
 *     property block_info:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getInfo, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1735
 * 
 *         """
 *         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_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":1748
 * 
 *         """
 *         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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/IS.pyx":1749
 *         """
 *         def __get__(self) -> dict[int, ArrayInt]:
 *             return self.getBlockInfo()             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getBlockInfo, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/IS.pyx":1748
 * 
 *         """
 *         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_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":27
 *     Type = SFType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":28
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.sf             # <<<<<<<<<<<<<<
 *         self.sf  = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->sf));

  /* "petsc4py/PETSc/SF.pyx":29
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.sf
 *         self.sf  = NULL             # <<<<<<<<<<<<<<
 * 
 *     def view(self, Viewer viewer=None) -> None:
*/
  __pyx_v_self->sf = NULL;

  /* "petsc4py/PETSc/SF.pyx":27
 *     Type = SFType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.sf
 *         self.sf  = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/SF.pyx":31
 *         self.sf  = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View a star forest.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_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_2SF_2view, "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:31");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_3view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_2view};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 31, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 31, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(40, 31, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 31, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 31, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(40, 31, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_2view(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_viewer);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_2view(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", 0);

  /* "petsc4py/PETSc/SF.pyx":46
 * 
 *         """
 *         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":47
 *         """
 *         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":48
 *         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, 48, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":31
 *         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":50
 *         CHKERR(PetscSFView(self.sf, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the star forest.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_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_2SF_4destroy, "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:50");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_5destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_4destroy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_4destroy(((struct PyPetscSFObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_4destroy(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", 0);

  /* "petsc4py/PETSc/SF.pyx":60
 * 
 *         """
 *         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, 60, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":61
 *         """
 *         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":50
 *         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":63
 *         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_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_2SF_6create, "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:63");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_7create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_6create};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 63, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 63, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(40, 63, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 63, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(40, 63, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_6create(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_comm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_6create(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", 0);

  /* "petsc4py/PETSc/SF.pyx":78
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(40, 78, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/SF.pyx":79
 *         """
 *         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":80
 *         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, 80, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":81
 *         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, 81, __pyx_L1_error)
  __pyx_v_self->sf = __pyx_v_newsf;

  /* "petsc4py/PETSc/SF.pyx":82
 *         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":63
 *         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":84
 *         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_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_2SF_8setType, "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:84");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_9setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_8setType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_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_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sf_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 84, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 84, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(40, 84, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(40, 84, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 84, __pyx_L3_error)
    }
    __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, 84, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_8setType(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_sf_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_8setType(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":99
 * 
 *         """
 *         cdef PetscSFType cval = NULL             # <<<<<<<<<<<<<<
 *         sf_type = str2bytes(sf_type, &cval)
 *         CHKERR(PetscSFSetType(self.sf, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/SF.pyx":100
 *         """
 *         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, 100, __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":101
 *         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, 101, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":84
 *         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":103
 *         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_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_2SF_10getType, "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:103");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_11getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_10getType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_10getType(((struct PyPetscSFObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_10getType(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", 0);

  /* "petsc4py/PETSc/SF.pyx":113
 * 
 *         """
 *         cdef PetscSFType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFGetType(self.sf, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/SF.pyx":114
 *         """
 *         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, 114, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":115
 *         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, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SF.pyx":103
 *         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":117
 *         return bytes2str(cval)
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set options using the options database.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_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_2SF_12setFromOptions, "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:117");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_13setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_13setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_12setFromOptions};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_12setFromOptions(((struct PyPetscSFObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_12setFromOptions(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", 0);

  /* "petsc4py/PETSc/SF.pyx":127
 * 
 *         """
 *         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, 127, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":117
 *         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":129
 *         CHKERR(PetscSFSetFromOptions(self.sf))
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up communication structures.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_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_2SF_14setUp, "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:129");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_15setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_15setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_14setUp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_14setUp(((struct PyPetscSFObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_14setUp(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", 0);

  /* "petsc4py/PETSc/SF.pyx":139
 * 
 *         """
 *         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, 139, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":129
 *         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":141
 *         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_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_2SF_16reset, "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:141");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_17reset = {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_17reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_16reset};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("reset", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_16reset(((struct PyPetscSFObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_16reset(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", 0);

  /* "petsc4py/PETSc/SF.pyx":151
 * 
 *         """
 *         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, 151, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":141
 *         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":155
 *     #
 * 
 *     def getGraph(self) -> tuple[int, ArrayInt, ArrayInt]:             # <<<<<<<<<<<<<<
 *         """Return star forest graph.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_19getGraph(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_18getGraph, "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:155");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_19getGraph = {"getGraph", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_19getGraph, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_18getGraph};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_19getGraph(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getGraph", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_18getGraph(((struct PyPetscSFObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_18getGraph(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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getGraph", 0);

  /* "petsc4py/PETSc/SF.pyx":178
 * 
 *         """
 *         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":179
 *         """
 *         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":180
 *         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":181
 *         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, 181, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":182
 *         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":183
 *         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_PyLong_From_PetscInt(__pyx_v_nleaves); if (unlikely(!__pyx_t_3)) __PYX_ERR(40, 183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_arange(__pyx_mstate_global->__pyx_int_0, __pyx_t_3, __pyx_mstate_global->__pyx_int_1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 183, __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":182
 *         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":185
 *             local = arange(0, nleaves, 1)
 *         else:
 *             local = array_i(nleaves, ilocal)             # <<<<<<<<<<<<<<
 *         remote = array_i(nleaves*2, <const PetscInt*>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, 185, __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":186
 *         else:
 *             local = array_i(nleaves, ilocal)
 *         remote = array_i(nleaves*2, <const PetscInt*>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, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_remote = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SF.pyx":187
 *             local = array_i(nleaves, ilocal)
 *         remote = array_i(nleaves*2, <const PetscInt*>iremote)
 *         remote = remote.reshape(nleaves, 2)             # <<<<<<<<<<<<<<
 *         return toInt(nroots), local, remote
 * 
*/
  __pyx_t_3 = __pyx_v_remote;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyLong_From_PetscInt(__pyx_v_nleaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_5, __pyx_mstate_global->__pyx_int_2};
    __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __Pyx_DECREF_SET(__pyx_v_remote, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SF.pyx":188
 *         remote = array_i(nleaves*2, <const PetscInt*>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, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 188, __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) != (0)) __PYX_ERR(40, 188, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_local);
  __Pyx_GIVEREF((PyObject *)__pyx_v_local);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_local)) != (0)) __PYX_ERR(40, 188, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_remote);
  __Pyx_GIVEREF(__pyx_v_remote);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_remote) != (0)) __PYX_ERR(40, 188, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SF.pyx":155
 *     #
 * 
 *     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_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":190
 *         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_21setGraph(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_20setGraph, "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:190");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_21setGraph = {"setGraph", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_21setGraph, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_20setGraph};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_21setGraph(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nroots,&__pyx_mstate_global->__pyx_n_u_local,&__pyx_mstate_global->__pyx_n_u_remote,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 190, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 190, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 190, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 190, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setGraph", 0) < (0)) __PYX_ERR(40, 190, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setGraph", 1, 3, 3, i); __PYX_ERR(40, 190, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 190, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 190, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 190, __pyx_L3_error)
    }
    __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, 190, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_20setGraph(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_nroots, __pyx_v_local, __pyx_v_remote);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_20setGraph(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":215
 * 
 *         """
 *         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, 215, __pyx_L1_error)
  __pyx_v_cnroots = __pyx_t_1;

  /* "petsc4py/PETSc/SF.pyx":216
 *         """
 *         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":217
 *         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":218
 *         cdef PetscInt nleaves = 0
 *         cdef PetscInt nremote = 0
 *         cdef PetscInt *ilocal = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscSFNode* iremote = NULL
 *         remote = iarray_i(remote, &nremote, <PetscInt**>&iremote)
*/
  __pyx_v_ilocal = NULL;

  /* "petsc4py/PETSc/SF.pyx":219
 *         cdef PetscInt nremote = 0
 *         cdef PetscInt *ilocal = NULL
 *         cdef PetscSFNode* iremote = NULL             # <<<<<<<<<<<<<<
 *         remote = iarray_i(remote, &nremote, <PetscInt**>&iremote)
 *         if local is not None:
*/
  __pyx_v_iremote = NULL;

  /* "petsc4py/PETSc/SF.pyx":220
 *         cdef PetscInt *ilocal = NULL
 *         cdef PetscSFNode* iremote = NULL
 *         remote = iarray_i(remote, &nremote, <PetscInt**>&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, 220, __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":221
 *         cdef PetscSFNode* iremote = NULL
 *         remote = iarray_i(remote, &nremote, <PetscInt**>&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":222
 *         remote = iarray_i(remote, &nremote, <PetscInt**>&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, 222, __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":223
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(40, 223, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(40, 223, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/SF.pyx":221
 *         cdef PetscSFNode* iremote = NULL
 *         remote = iarray_i(remote, &nremote, <PetscInt**>&iremote)
 *         if local is not None:             # <<<<<<<<<<<<<<
 *             local = iarray_i(local, &nleaves, &ilocal)
 *             assert 2*nleaves == nremote
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/SF.pyx":225
 *             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(((PyObject *)(((PyTypeObject*)PyExc_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":226
 *         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":227
 *             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, 227, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":190
 *         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":229
 *         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_23setRankOrder(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_22setRankOrder, "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:229");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_23setRankOrder = {"setRankOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_23setRankOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_22setRankOrder};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_23setRankOrder(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 229, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 229, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRankOrder", 0) < (0)) __PYX_ERR(40, 229, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setRankOrder", 1, 1, 1, i); __PYX_ERR(40, 229, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 229, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setRankOrder", 1, 1, 1, __pyx_nargs); __PYX_ERR(40, 229, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_22setRankOrder(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_22setRankOrder(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", 0);

  /* "petsc4py/PETSc/SF.pyx":244
 * 
 *         """
 *         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, 244, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/SF.pyx":245
 *         """
 *         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, 245, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":229
 *         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":247
 *         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_25getMulti(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_24getMulti, "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:247");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_25getMulti = {"getMulti", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_25getMulti, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_24getMulti};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_25getMulti(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMulti", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_24getMulti(((struct PyPetscSFObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_24getMulti(struct PyPetscSFObject *__pyx_v_self) {
  struct PyPetscSFObject *__pyx_v_sf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getMulti", 0);

  /* "petsc4py/PETSc/SF.pyx":257
 * 
 *         """
 *         cdef SF sf = SF()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFGetMultiSF(self.sf, &sf.sf))
 *         CHKERR(PetscINCREF(sf.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 257, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SF.pyx":258
 *         """
 *         cdef SF sf = SF()
 *         CHKERR(PetscSFGetMultiSF(self.sf, &sf.sf))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(sf.obj))
 *         return sf
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFGetMultiSF(__pyx_v_self->sf, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 258, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":259
 *         cdef SF sf = SF()
 *         CHKERR(PetscSFGetMultiSF(self.sf, &sf.sf))
 *         CHKERR(PetscINCREF(sf.obj))             # <<<<<<<<<<<<<<
 *         return sf
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sf->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 259, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":260
 *         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":247
 *         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_XDECREF(__pyx_t_2);
  __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":262
 *         return sf
 * 
 *     def createInverse(self) -> SF:             # <<<<<<<<<<<<<<
 *         """Create the inverse map.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_27createInverse(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_26createInverse, "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:262");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_27createInverse = {"createInverse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_27createInverse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_26createInverse};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_27createInverse(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("createInverse", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_26createInverse(((struct PyPetscSFObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_26createInverse(struct PyPetscSFObject *__pyx_v_self) {
  struct PyPetscSFObject *__pyx_v_sf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createInverse", 0);

  /* "petsc4py/PETSc/SF.pyx":275
 * 
 *         """
 *         cdef SF sf = SF()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFCreateInverseSF(self.sf, &sf.sf))
 *         return sf
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 275, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SF.pyx":276
 *         """
 *         cdef SF sf = SF()
 *         CHKERR(PetscSFCreateInverseSF(self.sf, &sf.sf))             # <<<<<<<<<<<<<<
 *         return sf
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCreateInverseSF(__pyx_v_self->sf, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 276, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":277
 *         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":262
 *         return sf
 * 
 *     def createInverse(self) -> SF:             # <<<<<<<<<<<<<<
 *         """Create the inverse map.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":279
 *         return sf
 * 
 *     def computeDegree(self) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Compute and return the degree of each root vertex.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_29computeDegree(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_28computeDegree, "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:279");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_29computeDegree = {"computeDegree", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_29computeDegree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_28computeDegree};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_29computeDegree(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("computeDegree", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_28computeDegree(((struct PyPetscSFObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_28computeDegree(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", 0);

  /* "petsc4py/PETSc/SF.pyx":289
 * 
 *         """
 *         cdef const PetscInt *cdegree = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt nroots = 0
 *         CHKERR(PetscSFComputeDegreeBegin(self.sf, &cdegree))
*/
  __pyx_v_cdegree = NULL;

  /* "petsc4py/PETSc/SF.pyx":290
 *         """
 *         cdef const PetscInt *cdegree = NULL
 *         cdef PetscInt nroots = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFComputeDegreeBegin(self.sf, &cdegree))
 *         CHKERR(PetscSFComputeDegreeEnd(self.sf, &cdegree))
*/
  __pyx_v_nroots = 0;

  /* "petsc4py/PETSc/SF.pyx":291
 *         cdef const PetscInt *cdegree = NULL
 *         cdef PetscInt nroots = 0
 *         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, 291, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":292
 *         cdef PetscInt nroots = 0
 *         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, 292, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":293
 *         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, 293, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":294
 *         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, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_degree = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SF.pyx":295
 *         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":279
 *         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":297
 *         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_31createEmbeddedRootSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_30createEmbeddedRootSF, "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:297");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_31createEmbeddedRootSF = {"createEmbeddedRootSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_31createEmbeddedRootSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_30createEmbeddedRootSF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_31createEmbeddedRootSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_selected,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 297, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 297, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createEmbeddedRootSF", 0) < (0)) __PYX_ERR(40, 297, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createEmbeddedRootSF", 1, 1, 1, i); __PYX_ERR(40, 297, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 297, __pyx_L3_error)
    }
    __pyx_v_selected = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createEmbeddedRootSF", 1, 1, 1, __pyx_nargs); __PYX_ERR(40, 297, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_30createEmbeddedRootSF(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_selected);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_30createEmbeddedRootSF(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  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":314
 * 
 *         """
 *         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, 314, __pyx_L1_error)
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 314, __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, 314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_nroots = __pyx_t_3;

  /* "petsc4py/PETSc/SF.pyx":315
 *         """
 *         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":316
 *         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, 316, __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":317
 *         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_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 317, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SF.pyx":318
 *         selected = iarray_i(selected, &nroots, &cselected)
 *         cdef SF sf = SF()
 *         CHKERR(PetscSFCreateEmbeddedRootSF(self.sf, nroots, cselected, &sf.sf))             # <<<<<<<<<<<<<<
 *         return sf
 * 
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCreateEmbeddedRootSF(__pyx_v_self->sf, __pyx_v_nroots, __pyx_v_cselected, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 318, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":319
 *         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":297
 *         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_XDECREF(__pyx_t_4);
  __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":321
 *         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_33createEmbeddedLeafSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_32createEmbeddedLeafSF, "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:321");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_33createEmbeddedLeafSF = {"createEmbeddedLeafSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_33createEmbeddedLeafSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_32createEmbeddedLeafSF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_33createEmbeddedLeafSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_selected,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 321, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 321, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createEmbeddedLeafSF", 0) < (0)) __PYX_ERR(40, 321, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createEmbeddedLeafSF", 1, 1, 1, i); __PYX_ERR(40, 321, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 321, __pyx_L3_error)
    }
    __pyx_v_selected = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createEmbeddedLeafSF", 1, 1, 1, __pyx_nargs); __PYX_ERR(40, 321, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_32createEmbeddedLeafSF(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_selected);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_32createEmbeddedLeafSF(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  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":338
 * 
 *         """
 *         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, 338, __pyx_L1_error)
  __pyx_t_2 = PyLong_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 338, __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, 338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_nleaves = __pyx_t_3;

  /* "petsc4py/PETSc/SF.pyx":339
 *         """
 *         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":340
 *         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, 340, __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":341
 *         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_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(40, 341, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SF.pyx":342
 *         selected = iarray_i(selected, &nleaves, &cselected)
 *         cdef SF sf = SF()
 *         CHKERR(PetscSFCreateEmbeddedLeafSF(self.sf, nleaves, cselected, &sf.sf))             # <<<<<<<<<<<<<<
 *         return sf
 * 
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCreateEmbeddedLeafSF(__pyx_v_self->sf, __pyx_v_nleaves, __pyx_v_cselected, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 342, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":343
 *         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":321
 *         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_XDECREF(__pyx_t_4);
  __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":345
 *         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_35createSectionSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_34createSectionSF, "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:345");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_35createSectionSF = {"createSectionSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_35createSectionSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_34createSectionSF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_35createSectionSF(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rootSection,&__pyx_mstate_global->__pyx_n_u_remoteOffsets,&__pyx_mstate_global->__pyx_n_u_leafSection,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 345, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 345, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 345, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 345, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createSectionSF", 0) < (0)) __PYX_ERR(40, 345, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createSectionSF", 1, 3, 3, i); __PYX_ERR(40, 345, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 345, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 345, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 345, __pyx_L3_error)
    }
    __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, 345, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 0, "rootSection", 0))) __PYX_ERR(40, 345, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafSection), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 0, "leafSection", 0))) __PYX_ERR(40, 345, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_34createSectionSF(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_34createSectionSF(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __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("createSectionSF", 0);
  __Pyx_INCREF(__pyx_v_remoteOffsets);

  /* "petsc4py/PETSc/SF.pyx":369
 * 
 *         """
 *         cdef SF sectionSF = SF()             # <<<<<<<<<<<<<<
 *         cdef PetscInt noffsets = 0
 *         cdef PetscInt *cremoteOffsets = NULL
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 369, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_sectionSF = ((struct PyPetscSFObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SF.pyx":370
 *         """
 *         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":371
 *         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":372
 *         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_4 = (__pyx_v_remoteOffsets != Py_None);
  if (__pyx_t_4) {

    /* "petsc4py/PETSc/SF.pyx":373
 *         cdef PetscInt *cremoteOffsets = NULL
 *         if remoteOffsets is not None:
 *             remoteOffsets = iarray_i(remoteOffsets, &noffsets, &cremoteOffsets)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFCreateSectionSF(self.sf, rootSection.sec, cremoteOffsets,
 *                                       leafSection.sec, &sectionSF.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, 373, __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":372
 *         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":374
 *         if remoteOffsets is not None:
 *             remoteOffsets = iarray_i(remoteOffsets, &noffsets, &cremoteOffsets)
 *         CHKERR(PetscSFCreateSectionSF(self.sf, rootSection.sec, cremoteOffsets,             # <<<<<<<<<<<<<<
 *                                       leafSection.sec, &sectionSF.sf))
 *         return sectionSF
*/
  __pyx_t_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 374, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":376
 *         CHKERR(PetscSFCreateSectionSF(self.sf, rootSection.sec, cremoteOffsets,
 *                                       leafSection.sec, &sectionSF.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":345
 *         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_XDECREF(__pyx_t_2);
  __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":378
 *         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_37distributeSection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_36distributeSection, "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:378");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_37distributeSection = {"distributeSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_37distributeSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_36distributeSection};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_37distributeSection(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rootSection,&__pyx_mstate_global->__pyx_n_u_leafSection,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 378, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "distributeSection", 0) < (0)) __PYX_ERR(40, 378, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscSectionObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("distributeSection", 0, 1, 2, i); __PYX_ERR(40, 378, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 378, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscSectionObject *)Py_None));
    }
    __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, 378, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 0, "rootSection", 0))) __PYX_ERR(40, 378, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafSection), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 1, "leafSection", 0))) __PYX_ERR(40, 378, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_36distributeSection(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_rootSection, __pyx_v_leafSection);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_36distributeSection(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  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":397
 * 
 *         """
 *         cdef PetscInt lpStart = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt lpEnd = 0
 *         cdef PetscInt *cremoteOffsets = NULL
*/
  __pyx_v_lpStart = 0;

  /* "petsc4py/PETSc/SF.pyx":398
 *         """
 *         cdef PetscInt lpStart = 0
 *         cdef PetscInt lpEnd = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt *cremoteOffsets = NULL
 *         cdef ndarray remoteOffsets
*/
  __pyx_v_lpEnd = 0;

  /* "petsc4py/PETSc/SF.pyx":399
 *         cdef PetscInt lpStart = 0
 *         cdef PetscInt lpEnd = 0
 *         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":401
 *         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_mstate_global->__pyx_n_u_comm); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 401, __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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(40, 401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_ccomm = __pyx_t_2;

  /* "petsc4py/PETSc/SF.pyx":402
 *         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":403
 *         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_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 403, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_1);
    }
    __Pyx_DECREF_SET(__pyx_v_leafSection, ((struct PyPetscSectionObject *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "petsc4py/PETSc/SF.pyx":402
 *         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":404
 *         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":405
 *             leafSection = Section()
 *         if leafSection.sec == NULL:
 *             CHKERR(PetscSectionCreate(ccomm, &leafSection.sec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFDistributeSection(self.sf, rootSection.sec,
 *                                         &cremoteOffsets, leafSection.sec))
*/
    __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionCreate(__pyx_v_ccomm, (&__pyx_v_leafSection->sec))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 405, __pyx_L1_error)

    /* "petsc4py/PETSc/SF.pyx":404
 *         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":406
 *         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_6 = __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_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 406, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":408
 *         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_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetChart(__pyx_v_leafSection->sec, (&__pyx_v_lpStart), (&__pyx_v_lpEnd))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 408, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":409
 *                                         &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, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_remoteOffsets = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SF.pyx":410
 *         CHKERR(PetscSectionGetChart(leafSection.sec, &lpStart, &lpEnd))
 *         remoteOffsets = array_i(lpEnd-lpStart, cremoteOffsets)
 *         CHKERR(PetscFree(cremoteOffsets))             # <<<<<<<<<<<<<<
 *         return (remoteOffsets, leafSection)
 * 
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cremoteOffsets)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 410, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":411
 *         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, 411, __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)) != (0)) __PYX_ERR(40, 411, __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)) != (0)) __PYX_ERR(40, 411, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SF.pyx":378
 *         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_XDECREF(__pyx_t_4);
  __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":413
 *         return (remoteOffsets, leafSection)
 * 
 *     def compose(self, SF sf) -> SF:             # <<<<<<<<<<<<<<
 *         """Compose a new `SF`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_39compose(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_38compose, "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:413");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_39compose = {"compose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_39compose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_38compose};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_39compose(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 413, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 413, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "compose", 0) < (0)) __PYX_ERR(40, 413, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("compose", 1, 1, 1, i); __PYX_ERR(40, 413, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 413, __pyx_L3_error)
    }
    __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, 413, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(40, 413, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_38compose(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_sf);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_38compose(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compose", 0);

  /* "petsc4py/PETSc/SF.pyx":430
 * 
 *         """
 *         cdef SF csf = SF()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFCompose(self.sf, sf.sf, &csf.sf))
 *         return csf
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 430, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_csf = ((struct PyPetscSFObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SF.pyx":431
 *         """
 *         cdef SF csf = SF()
 *         CHKERR(PetscSFCompose(self.sf, sf.sf, &csf.sf))             # <<<<<<<<<<<<<<
 *         return csf
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSFCompose(__pyx_v_self->sf, __pyx_v_sf->sf, (&__pyx_v_csf->sf))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(40, 431, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":432
 *         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":413
 *         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_XDECREF(__pyx_t_2);
  __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":434
 *         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_41bcastBegin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_40bcastBegin, "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:434");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_41bcastBegin = {"bcastBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_41bcastBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_40bcastBegin};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_41bcastBegin(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_unit,&__pyx_mstate_global->__pyx_n_u_rootdata,&__pyx_mstate_global->__pyx_n_u_leafdata,&__pyx_mstate_global->__pyx_n_u_op,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 434, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(40, 434, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 434, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 434, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 434, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "bcastBegin", 0) < (0)) __PYX_ERR(40, 434, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("bcastBegin", 1, 4, 4, i); __PYX_ERR(40, 434, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 434, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 434, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 434, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(40, 434, __pyx_L3_error)
    }
    __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, 434, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "rootdata", 0))) __PYX_ERR(40, 434, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(40, 434, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_40bcastBegin(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_40bcastBegin(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", 0);

  /* "petsc4py/PETSc/SF.pyx":458
 * 
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)             # <<<<<<<<<<<<<<
 *         cdef MPI_Op cop = mpi4py_Op_Get(op)
 *         CHKERR(PetscSFBcastBegin(self.sf, dtype, <const void*>PyArray_DATA(rootdata),
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype const )MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 458, __pyx_L1_error)
  __pyx_v_dtype = __pyx_t_1;

  /* "petsc4py/PETSc/SF.pyx":459
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
 *         cdef MPI_Op cop = mpi4py_Op_Get(op)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFBcastBegin(self.sf, dtype, <const void*>PyArray_DATA(rootdata),
 *                                  <void*>PyArray_DATA(leafdata), cop))
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(__pyx_t_2 == ((MPI_Op const )MPI_OP_NULL) && PyErr_Occurred())) __PYX_ERR(40, 459, __pyx_L1_error)
  __pyx_v_cop = __pyx_t_2;

  /* "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, <const void*>PyArray_DATA(rootdata),             # <<<<<<<<<<<<<<
 *                                  <void*>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, 460, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":434
 *         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":463
 *                                  <void*>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_43bcastEnd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_42bcastEnd, "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:463");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_43bcastEnd = {"bcastEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_43bcastEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_42bcastEnd};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_43bcastEnd(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_unit,&__pyx_mstate_global->__pyx_n_u_rootdata,&__pyx_mstate_global->__pyx_n_u_leafdata,&__pyx_mstate_global->__pyx_n_u_op,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 463, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(40, 463, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 463, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 463, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 463, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "bcastEnd", 0) < (0)) __PYX_ERR(40, 463, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("bcastEnd", 1, 4, 4, i); __PYX_ERR(40, 463, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 463, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 463, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 463, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(40, 463, __pyx_L3_error)
    }
    __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, 463, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "rootdata", 0))) __PYX_ERR(40, 463, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(40, 463, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_42bcastEnd(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_42bcastEnd(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", 0);

  /* "petsc4py/PETSc/SF.pyx":484
 * 
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)             # <<<<<<<<<<<<<<
 *         cdef MPI_Op cop = mpi4py_Op_Get(op)
 *         CHKERR(PetscSFBcastEnd(self.sf, dtype, <const void*>PyArray_DATA(rootdata),
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype const )MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 484, __pyx_L1_error)
  __pyx_v_dtype = __pyx_t_1;

  /* "petsc4py/PETSc/SF.pyx":485
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
 *         cdef MPI_Op cop = mpi4py_Op_Get(op)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFBcastEnd(self.sf, dtype, <const void*>PyArray_DATA(rootdata),
 *                                <void*>PyArray_DATA(leafdata), cop))
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(__pyx_t_2 == ((MPI_Op const )MPI_OP_NULL) && PyErr_Occurred())) __PYX_ERR(40, 485, __pyx_L1_error)
  __pyx_v_cop = __pyx_t_2;

  /* "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, <const void*>PyArray_DATA(rootdata),             # <<<<<<<<<<<<<<
 *                                <void*>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, 486, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":463
 *                                  <void*>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":489
 *                                <void*>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_45reduceBegin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_44reduceBegin, "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:489");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_45reduceBegin = {"reduceBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_45reduceBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_44reduceBegin};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_45reduceBegin(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_unit,&__pyx_mstate_global->__pyx_n_u_leafdata,&__pyx_mstate_global->__pyx_n_u_rootdata,&__pyx_mstate_global->__pyx_n_u_op,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 489, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(40, 489, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 489, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 489, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 489, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "reduceBegin", 0) < (0)) __PYX_ERR(40, 489, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("reduceBegin", 1, 4, 4, i); __PYX_ERR(40, 489, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 489, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 489, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 489, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(40, 489, __pyx_L3_error)
    }
    __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, 489, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(40, 489, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootdata), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "rootdata", 0))) __PYX_ERR(40, 489, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_44reduceBegin(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_44reduceBegin(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", 0);

  /* "petsc4py/PETSc/SF.pyx":512
 * 
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)             # <<<<<<<<<<<<<<
 *         cdef MPI_Op cop = mpi4py_Op_Get(op)
 *         CHKERR(PetscSFReduceBegin(self.sf, dtype, <const void*>PyArray_DATA(leafdata),
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype const )MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 512, __pyx_L1_error)
  __pyx_v_dtype = __pyx_t_1;

  /* "petsc4py/PETSc/SF.pyx":513
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
 *         cdef MPI_Op cop = mpi4py_Op_Get(op)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFReduceBegin(self.sf, dtype, <const void*>PyArray_DATA(leafdata),
 *                                   <void*>PyArray_DATA(rootdata), cop))
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(__pyx_t_2 == ((MPI_Op const )MPI_OP_NULL) && PyErr_Occurred())) __PYX_ERR(40, 513, __pyx_L1_error)
  __pyx_v_cop = __pyx_t_2;

  /* "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, <const void*>PyArray_DATA(leafdata),             # <<<<<<<<<<<<<<
 *                                   <void*>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, 514, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":489
 *                                <void*>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":517
 *                                   <void*>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_47reduceEnd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_46reduceEnd, "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:517");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_47reduceEnd = {"reduceEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_47reduceEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_46reduceEnd};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_47reduceEnd(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_unit,&__pyx_mstate_global->__pyx_n_u_leafdata,&__pyx_mstate_global->__pyx_n_u_rootdata,&__pyx_mstate_global->__pyx_n_u_op,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 517, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(40, 517, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 517, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 517, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 517, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "reduceEnd", 0) < (0)) __PYX_ERR(40, 517, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("reduceEnd", 1, 4, 4, i); __PYX_ERR(40, 517, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 517, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 517, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 517, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(40, 517, __pyx_L3_error)
    }
    __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, 517, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(40, 517, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rootdata), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "rootdata", 0))) __PYX_ERR(40, 517, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_46reduceEnd(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_46reduceEnd(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", 0);

  /* "petsc4py/PETSc/SF.pyx":538
 * 
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)             # <<<<<<<<<<<<<<
 *         cdef MPI_Op cop = mpi4py_Op_Get(op)
 *         CHKERR(PetscSFReduceEnd(self.sf, dtype, <const void*>PyArray_DATA(leafdata),
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype const )MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 538, __pyx_L1_error)
  __pyx_v_dtype = __pyx_t_1;

  /* "petsc4py/PETSc/SF.pyx":539
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
 *         cdef MPI_Op cop = mpi4py_Op_Get(op)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFReduceEnd(self.sf, dtype, <const void*>PyArray_DATA(leafdata),
 *                                 <void*>PyArray_DATA(rootdata), cop))
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(__pyx_t_2 == ((MPI_Op const )MPI_OP_NULL) && PyErr_Occurred())) __PYX_ERR(40, 539, __pyx_L1_error)
  __pyx_v_cop = __pyx_t_2;

  /* "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, <const void*>PyArray_DATA(leafdata),             # <<<<<<<<<<<<<<
 *                                 <void*>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, 540, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":517
 *                                   <void*>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":543
 *                                 <void*>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_49scatterBegin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_48scatterBegin, "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:543");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_49scatterBegin = {"scatterBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_49scatterBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_48scatterBegin};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_49scatterBegin(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_unit,&__pyx_mstate_global->__pyx_n_u_multirootdata,&__pyx_mstate_global->__pyx_n_u_leafdata,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 543, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 543, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 543, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 543, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scatterBegin", 0) < (0)) __PYX_ERR(40, 543, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scatterBegin", 1, 3, 3, i); __PYX_ERR(40, 543, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 543, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 543, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 543, __pyx_L3_error)
    }
    __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, 543, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "multirootdata", 0))) __PYX_ERR(40, 543, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(40, 543, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_48scatterBegin(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_48scatterBegin(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", 0);

  /* "petsc4py/PETSc/SF.pyx":565
 * 
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFScatterBegin(self.sf, dtype, <const void*>PyArray_DATA(multirootdata),
 *                                    <void*>PyArray_DATA(leafdata)))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype const )MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 565, __pyx_L1_error)
  __pyx_v_dtype = __pyx_t_1;

  /* "petsc4py/PETSc/SF.pyx":566
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
 *         CHKERR(PetscSFScatterBegin(self.sf, dtype, <const void*>PyArray_DATA(multirootdata),             # <<<<<<<<<<<<<<
 *                                    <void*>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, 566, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":543
 *                                 <void*>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":569
 *                                    <void*>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_51scatterEnd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_50scatterEnd, "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:569");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_51scatterEnd = {"scatterEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_51scatterEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_50scatterEnd};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_51scatterEnd(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_unit,&__pyx_mstate_global->__pyx_n_u_multirootdata,&__pyx_mstate_global->__pyx_n_u_leafdata,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 569, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 569, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 569, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 569, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scatterEnd", 0) < (0)) __PYX_ERR(40, 569, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scatterEnd", 1, 3, 3, i); __PYX_ERR(40, 569, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 569, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 569, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 569, __pyx_L3_error)
    }
    __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, 569, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "multirootdata", 0))) __PYX_ERR(40, 569, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_leafdata), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(40, 569, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_50scatterEnd(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_50scatterEnd(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", 0);

  /* "petsc4py/PETSc/SF.pyx":588
 * 
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFScatterEnd(self.sf, dtype, <const void*>PyArray_DATA(multirootdata),
 *                                  <void*>PyArray_DATA(leafdata)))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype const )MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 588, __pyx_L1_error)
  __pyx_v_dtype = __pyx_t_1;

  /* "petsc4py/PETSc/SF.pyx":589
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
 *         CHKERR(PetscSFScatterEnd(self.sf, dtype, <const void*>PyArray_DATA(multirootdata),             # <<<<<<<<<<<<<<
 *                                  <void*>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, 589, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":569
 *                                    <void*>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":592
 *                                  <void*>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_53gatherBegin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_52gatherBegin, "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:592");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_53gatherBegin = {"gatherBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_53gatherBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_52gatherBegin};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_53gatherBegin(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_unit,&__pyx_mstate_global->__pyx_n_u_leafdata,&__pyx_mstate_global->__pyx_n_u_multirootdata,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 592, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 592, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 592, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 592, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "gatherBegin", 0) < (0)) __PYX_ERR(40, 592, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("gatherBegin", 1, 3, 3, i); __PYX_ERR(40, 592, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 592, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 592, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 592, __pyx_L3_error)
    }
    __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, 592, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(40, 592, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_multirootdata), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "multirootdata", 0))) __PYX_ERR(40, 592, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_52gatherBegin(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_52gatherBegin(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", 0);

  /* "petsc4py/PETSc/SF.pyx":614
 * 
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFGatherBegin(self.sf, dtype, <const void*>PyArray_DATA(leafdata),
 *                                   <void*>PyArray_DATA(multirootdata)))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype const )MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 614, __pyx_L1_error)
  __pyx_v_dtype = __pyx_t_1;

  /* "petsc4py/PETSc/SF.pyx":615
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
 *         CHKERR(PetscSFGatherBegin(self.sf, dtype, <const void*>PyArray_DATA(leafdata),             # <<<<<<<<<<<<<<
 *                                   <void*>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, 615, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":592
 *                                  <void*>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":618
 *                                   <void*>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_55gatherEnd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_54gatherEnd, "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:618");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_55gatherEnd = {"gatherEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_55gatherEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_54gatherEnd};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_55gatherEnd(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_unit,&__pyx_mstate_global->__pyx_n_u_leafdata,&__pyx_mstate_global->__pyx_n_u_multirootdata,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 618, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 618, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 618, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 618, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "gatherEnd", 0) < (0)) __PYX_ERR(40, 618, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("gatherEnd", 1, 3, 3, i); __PYX_ERR(40, 618, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 618, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 618, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 618, __pyx_L3_error)
    }
    __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, 618, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "leafdata", 0))) __PYX_ERR(40, 618, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_multirootdata), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray, 0, "multirootdata", 0))) __PYX_ERR(40, 618, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2SF_54gatherEnd(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_54gatherEnd(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", 0);

  /* "petsc4py/PETSc/SF.pyx":638
 * 
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFGatherEnd(self.sf, dtype, <const void*>PyArray_DATA(leafdata),
 *                                 <void*>PyArray_DATA(multirootdata)))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype const )MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 638, __pyx_L1_error)
  __pyx_v_dtype = __pyx_t_1;

  /* "petsc4py/PETSc/SF.pyx":639
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
 *         CHKERR(PetscSFGatherEnd(self.sf, dtype, <const void*>PyArray_DATA(leafdata),             # <<<<<<<<<<<<<<
 *                                 <void*>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, 639, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":618
 *                                   <void*>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":642
 *                                 <void*>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_57fetchAndOpBegin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_56fetchAndOpBegin, "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:642");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_57fetchAndOpBegin = {"fetchAndOpBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_57fetchAndOpBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_56fetchAndOpBegin};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_57fetchAndOpBegin(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_unit,&__pyx_mstate_global->__pyx_n_u_rootdata,&__pyx_mstate_global->__pyx_n_u_leafdata,&__pyx_mstate_global->__pyx_n_u_leafupdate,&__pyx_mstate_global->__pyx_n_u_op,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 642, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(40, 642, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(40, 642, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 642, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 642, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 642, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "fetchAndOpBegin", 0) < (0)) __PYX_ERR(40, 642, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("fetchAndOpBegin", 1, 5, 5, i); __PYX_ERR(40, 642, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 642, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 642, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 642, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(40, 642, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(40, 642, __pyx_L3_error)
    }
    __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, 642, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_56fetchAndOpBegin(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_rootdata, __pyx_v_leafdata, __pyx_v_leafupdate, __pyx_v_op);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_56fetchAndOpBegin(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", 0);

  /* "petsc4py/PETSc/SF.pyx":672
 * 
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)             # <<<<<<<<<<<<<<
 *         cdef MPI_Op cop = mpi4py_Op_Get(op)
 *         CHKERR(PetscSFFetchAndOpBegin(self.sf, dtype, <void*>PyArray_DATA(rootdata),
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype const )MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 672, __pyx_L1_error)
  __pyx_v_dtype = __pyx_t_1;

  /* "petsc4py/PETSc/SF.pyx":673
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
 *         cdef MPI_Op cop = mpi4py_Op_Get(op)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFFetchAndOpBegin(self.sf, dtype, <void*>PyArray_DATA(rootdata),
 *                                       <const void*>PyArray_DATA(leafdata),
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(__pyx_t_2 == ((MPI_Op const )MPI_OP_NULL) && PyErr_Occurred())) __PYX_ERR(40, 673, __pyx_L1_error)
  __pyx_v_cop = __pyx_t_2;

  /* "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, <void*>PyArray_DATA(rootdata),             # <<<<<<<<<<<<<<
 *                                       <const void*>PyArray_DATA(leafdata),
 *                                       <void*>PyArray_DATA(leafupdate), cop))
*/
  if (!(likely(((__pyx_v_rootdata) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rootdata, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(40, 674, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":675
 *         cdef MPI_Op cop = mpi4py_Op_Get(op)
 *         CHKERR(PetscSFFetchAndOpBegin(self.sf, dtype, <void*>PyArray_DATA(rootdata),
 *                                       <const void*>PyArray_DATA(leafdata),             # <<<<<<<<<<<<<<
 *                                       <void*>PyArray_DATA(leafupdate), cop))
 * 
*/
  if (!(likely(((__pyx_v_leafdata) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_leafdata, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(40, 675, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":676
 *         CHKERR(PetscSFFetchAndOpBegin(self.sf, dtype, <void*>PyArray_DATA(rootdata),
 *                                       <const void*>PyArray_DATA(leafdata),
 *                                       <void*>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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(40, 676, __pyx_L1_error)

  /* "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, <void*>PyArray_DATA(rootdata),             # <<<<<<<<<<<<<<
 *                                       <const void*>PyArray_DATA(leafdata),
 *                                       <void*>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, 674, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":642
 *                                 <void*>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":678
 *                                       <void*>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_59fetchAndOpEnd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_58fetchAndOpEnd, "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:678");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2SF_59fetchAndOpEnd = {"fetchAndOpEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_59fetchAndOpEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_58fetchAndOpEnd};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2SF_59fetchAndOpEnd(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_unit,&__pyx_mstate_global->__pyx_n_u_rootdata,&__pyx_mstate_global->__pyx_n_u_leafdata,&__pyx_mstate_global->__pyx_n_u_leafupdate,&__pyx_mstate_global->__pyx_n_u_op,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(40, 678, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(40, 678, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(40, 678, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 678, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 678, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 678, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "fetchAndOpEnd", 0) < (0)) __PYX_ERR(40, 678, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("fetchAndOpEnd", 1, 5, 5, i); __PYX_ERR(40, 678, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(40, 678, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(40, 678, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(40, 678, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(40, 678, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(40, 678, __pyx_L3_error)
    }
    __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, 678, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_58fetchAndOpEnd(((struct PyPetscSFObject *)__pyx_v_self), __pyx_v_unit, __pyx_v_rootdata, __pyx_v_leafdata, __pyx_v_leafupdate, __pyx_v_op);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2SF_58fetchAndOpEnd(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", 0);

  /* "petsc4py/PETSc/SF.pyx":703
 * 
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)             # <<<<<<<<<<<<<<
 *         cdef MPI_Op cop = mpi4py_Op_Get(op)
 *         CHKERR(PetscSFFetchAndOpEnd(self.sf, dtype, <void*>PyArray_DATA(rootdata),
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_mpi4py_Datatype_Get(__pyx_v_unit); if (unlikely(__pyx_t_1 == ((MPI_Datatype const )MPI_DATATYPE_NULL) && PyErr_Occurred())) __PYX_ERR(40, 703, __pyx_L1_error)
  __pyx_v_dtype = __pyx_t_1;

  /* "petsc4py/PETSc/SF.pyx":704
 *         """
 *         cdef MPI_Datatype dtype = mpi4py_Datatype_Get(unit)
 *         cdef MPI_Op cop = mpi4py_Op_Get(op)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSFFetchAndOpEnd(self.sf, dtype, <void*>PyArray_DATA(rootdata),
 *                                     <const void*>PyArray_DATA(leafdata),
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_mpi4py_Op_Get(__pyx_v_op); if (unlikely(__pyx_t_2 == ((MPI_Op const )MPI_OP_NULL) && PyErr_Occurred())) __PYX_ERR(40, 704, __pyx_L1_error)
  __pyx_v_cop = __pyx_t_2;

  /* "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, <void*>PyArray_DATA(rootdata),             # <<<<<<<<<<<<<<
 *                                     <const void*>PyArray_DATA(leafdata),
 *                                     <void*>PyArray_DATA(leafupdate), cop))
*/
  if (!(likely(((__pyx_v_rootdata) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rootdata, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(40, 705, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":706
 *         cdef MPI_Op cop = mpi4py_Op_Get(op)
 *         CHKERR(PetscSFFetchAndOpEnd(self.sf, dtype, <void*>PyArray_DATA(rootdata),
 *                                     <const void*>PyArray_DATA(leafdata),             # <<<<<<<<<<<<<<
 *                                     <void*>PyArray_DATA(leafupdate), cop))
 * 
*/
  if (!(likely(((__pyx_v_leafdata) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_leafdata, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(40, 706, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":707
 *         CHKERR(PetscSFFetchAndOpEnd(self.sf, dtype, <void*>PyArray_DATA(rootdata),
 *                                     <const void*>PyArray_DATA(leafdata),
 *                                     <void*>PyArray_DATA(leafupdate), cop))             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (!(likely(((__pyx_v_leafupdate) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_leafupdate, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(40, 707, __pyx_L1_error)

  /* "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, <void*>PyArray_DATA(rootdata),             # <<<<<<<<<<<<<<
 *                                     <const void*>PyArray_DATA(leafdata),
 *                                     <void*>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, 705, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":678
 *                                       <void*>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":46
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":47
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.vec             # <<<<<<<<<<<<<<
 *         self.vec = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->vec));

  /* "petsc4py/PETSc/Vec.pyx":48
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.vec
 *         self.vec = NULL             # <<<<<<<<<<<<<<
 * 
 *     # unary operations
*/
  __pyx_v_self->vec = NULL;

  /* "petsc4py/PETSc/Vec.pyx":46
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.vec
 *         self.vec = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/Vec.pyx":52
 *     # 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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":53
 * 
 *     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, 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
 *     # 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":55
 *         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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":56
 * 
 *     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, 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_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":58
 *         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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":59
 * 
 *     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, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":58
 *         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":63
 *     # 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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":64
 * 
 *     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, 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
 *     # 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":66
 *         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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":67
 * 
 *     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, 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_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":69
 *         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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":70
 * 
 *     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, 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_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":72
 *         return vec_imul(self, other)
 * 
 *     def __idiv__(self, other):             # <<<<<<<<<<<<<<
 *         return vec_idiv(self, other)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_15__idiv__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_14__idiv__, "Vec.__idiv__(self, other)\nSource code at petsc4py/PETSc/Vec.pyx:72");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_15__idiv__ = {"__idiv__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_15__idiv__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_14__idiv__};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_15__idiv__(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("__idiv__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 72, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 72, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__idiv__", 0) < (0)) __PYX_ERR(41, 72, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__idiv__", 1, 1, 1, i); __PYX_ERR(41, 72, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 72, __pyx_L3_error)
    }
    __pyx_v_other = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__idiv__", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 72, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Vec.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_14__idiv__(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_other);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":73
 * 
 *     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, 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_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;
}

/* "petsc4py/PETSc/Vec.pyx":75
 *         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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":76
 * 
 *     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, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":75
 *         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":80
 *     # 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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":81
 * 
 *     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, 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
 *     # 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":83
 *         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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":84
 * 
 *     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, 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_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":86
 *         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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":87
 * 
 *     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, 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_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":89
 *         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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":90
 * 
 *     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, 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_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":92
 *         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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":93
 * 
 *     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, 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_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":95
 *         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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":96
 * 
 *     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, 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_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":98
 *         return vec_rmul(self, other)
 * 
 *     def __div__(self, other):             # <<<<<<<<<<<<<<
 *         return vec_div(self, other)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_31__div__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_30__div__, "Vec.__div__(self, other)\nSource code at petsc4py/PETSc/Vec.pyx:98");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_31__div__ = {"__div__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_31__div__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_30__div__};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_31__div__(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("__div__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 98, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 98, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__div__", 0) < (0)) __PYX_ERR(41, 98, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__div__", 1, 1, 1, i); __PYX_ERR(41, 98, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 98, __pyx_L3_error)
    }
    __pyx_v_other = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__div__", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 98, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Vec.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_30__div__(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_other);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":99
 * 
 *     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, 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_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;
}

/* "petsc4py/PETSc/Vec.pyx":101
 *         return vec_div(self, other)
 * 
 *     def __rdiv__(self, other):             # <<<<<<<<<<<<<<
 *         return vec_rdiv(self, other)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_33__rdiv__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_32__rdiv__, "Vec.__rdiv__(self, other)\nSource code at petsc4py/PETSc/Vec.pyx:101");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_33__rdiv__ = {"__rdiv__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_33__rdiv__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_32__rdiv__};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_33__rdiv__(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("__rdiv__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 101, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__rdiv__", 0) < (0)) __PYX_ERR(41, 101, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__rdiv__", 1, 1, 1, i); __PYX_ERR(41, 101, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 101, __pyx_L3_error)
    }
    __pyx_v_other = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__rdiv__", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 101, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Vec.__rdiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_32__rdiv__(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_other);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":102
 * 
 *     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, 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_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;
}

/* "petsc4py/PETSc/Vec.pyx":104
 *         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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":105
 * 
 *     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, 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_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":107
 *         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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":108
 * 
 *     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, 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_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":110
 *         return vec_rdiv(self, other)
 * 
 *     def __matmul__(self, other):             # <<<<<<<<<<<<<<
 *         return vec_matmul(self, other)
 * 
*/

/* Python wrapper */
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;
}

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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":111
 * 
 *     def __matmul__(self, other):
 *         return vec_matmul(self, other)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, i):
*/
  __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, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":110
 *         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;
}

/* "petsc4py/PETSc/Vec.pyx":113
 *         return vec_matmul(self, other)
 * 
 *     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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":114
 * 
 *     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, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":113
 *         return vec_matmul(self, other)
 * 
 *     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":116
 *         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":117
 * 
 *     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, 117, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":116
 *         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":121
 *     # 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  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":122
 * 
 *     def __getbuffer__(self, Py_buffer *view, int flags):
 *         cdef _Vec_buffer buf = _Vec_buffer(self)             # <<<<<<<<<<<<<<
 *         buf.acquirebuffer(view, flags)
 * 
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 122, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Vec.pyx":123
 *     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_4 = ((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_4 == ((int)-1))) __PYX_ERR(41, 123, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":121
 *     # 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_XDECREF(__pyx_t_2);
  __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":125
 *         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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":126
 * 
 *     def __releasebuffer__(self, Py_buffer *view):
 *         cdef _Vec_buffer buf = <_Vec_buffer>(view.obj)             # <<<<<<<<<<<<<<
 *         buf.releasebuffer(view)
 *         <void>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":127
 *     def __releasebuffer__(self, Py_buffer *view):
 *         cdef _Vec_buffer buf = <_Vec_buffer>(view.obj)
 *         buf.releasebuffer(view)             # <<<<<<<<<<<<<<
 *         <void>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, 127, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":128
 *         cdef _Vec_buffer buf = <_Vec_buffer>(view.obj)
 *         buf.releasebuffer(view)
 *         <void>self # unused             # <<<<<<<<<<<<<<
 * 
 *     # 'with' statement (PEP 343)
*/
  ((void)__pyx_v_self);

  /* "petsc4py/PETSc/Vec.pyx":125
 *         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":132
 *     # '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:132");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_49__enter__ = {"__enter__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_49__enter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_48__enter__};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__enter__", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "petsc4py/PETSc/Vec.pyx":133
 * 
 *     def __enter__(self):
 *         cdef _Vec_buffer buf = _Vec_buffer(self)             # <<<<<<<<<<<<<<
 *         self.set_attr('__buffer__', buf)
 *         return buf.enter()
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 133, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Vec.pyx":134
 *     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, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Vec.pyx":135
 *         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, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":132
 *     # '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_XDECREF(__pyx_t_2);
  __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":137
 *         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:137");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_51__exit__ = {"__exit__", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_51__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_50__exit__};
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_SIZE
  __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);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__exit__", __pyx_kwds); 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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":138
 * 
 *     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, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer))))) __PYX_ERR(41, 138, __pyx_L1_error)
  __pyx_v_buf = ((struct __pyx_obj_8petsc4py_5PETSc__Vec_buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Vec.pyx":139
 *     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, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Vec.pyx":140
 *         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, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":137
 *         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":144
 *     #
 * 
 *     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:144");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_53view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_53view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_52view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 144, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 144, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(41, 144, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 144, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 144, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(41, 144, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Vec.pyx":159
 * 
 *         """
 *         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":160
 *         """
 *         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":161
 *         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, 161, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":144
 *     #
 * 
 *     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":163
 *         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:163");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_55destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_55destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_54destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":173
 * 
 *         """
 *         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, 173, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":174
 *         """
 *         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":163
 *         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":176
 *         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:176");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_57create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_57create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_56create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 176, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 176, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(41, 176, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 176, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 176, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":193
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 193, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":194
 *         """
 *         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":195
 *         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, 195, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":196
 *         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, 196, __pyx_L1_error)
  __pyx_v_self->vec = __pyx_v_newvec;

  /* "petsc4py/PETSc/Vec.pyx":197
 *         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":176
 *         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":199
 *         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:199");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_59setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_59setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_58setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 199, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 199, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(41, 199, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(41, 199, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 199, __pyx_L3_error)
    }
    __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, 199, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":214
 * 
 *         """
 *         cdef PetscVecType cval = NULL             # <<<<<<<<<<<<<<
 *         vec_type = str2bytes(vec_type, &cval)
 *         CHKERR(VecSetType(self.vec, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Vec.pyx":215
 *         """
 *         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, 215, __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":216
 *         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, 216, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":199
 *         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":218
 *         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:218");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_61setSizes = {"setSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_61setSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_60setSizes};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 218, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 218, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 218, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSizes", 0) < (0)) __PYX_ERR(41, 218, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":221
 *         self,
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the local and global sizes of the vector.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSizes", 0, 1, 2, i); __PYX_ERR(41, 218, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 218, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 218, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 218, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":218
 *         CHKERR(VecSetType(self.vec, cval))
 * 
 *     def setSizes(             # <<<<<<<<<<<<<<
 *         self,
 *         size: LayoutSizeSpec,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":238
 * 
 *         """
 *         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":239
 *         """
 *         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, 239, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":240
 *         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, 240, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":241
 *         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":242
 *         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, 242, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":241
 *         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":218
 *         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":247
 * 
 *     # 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:247");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_63createSeq = {"createSeq", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_63createSeq, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_62createSeq};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 247, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 247, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 247, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 247, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createSeq", 0) < (0)) __PYX_ERR(41, 247, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":250
 *         self,
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a sequential `Type.SEQ` vector.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":251
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a sequential `Type.SEQ` vector.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createSeq", 0, 1, 3, i); __PYX_ERR(41, 247, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 247, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 247, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 247, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Vec.pyx":250
 *         self,
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a sequential `Type.SEQ` vector.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":251
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a sequential `Type.SEQ` vector.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 247, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":247
 * 
 *     # FIXME the comm argument is hideous.
 *     def createSeq(             # <<<<<<<<<<<<<<
 *         self,
 *         size: LayoutSizeSpec,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":270
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 270, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":271
 *         """
 *         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":272
 *         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, 272, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":273
 *         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, 273, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":274
 *         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":275
 *         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":276
 *         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, 276, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":277
 *         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, 277, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":278
 *         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, 278, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":279
 *         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, 279, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":280
 *         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, 280, __pyx_L1_error)
  __pyx_v_self->vec = __pyx_v_newvec;

  /* "petsc4py/PETSc/Vec.pyx":281
 *         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":247
 * 
 *     # 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":283
 *         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:283");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_65createMPI = {"createMPI", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_65createMPI, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_64createMPI};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 283, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createMPI", 0) < (0)) __PYX_ERR(41, 283, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":286
 *         self,
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a parallel `Type.MPI` vector.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":287
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a parallel `Type.MPI` vector.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createMPI", 0, 1, 3, i); __PYX_ERR(41, 283, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 283, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Vec.pyx":286
 *         self,
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a parallel `Type.MPI` vector.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":287
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a parallel `Type.MPI` vector.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 283, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":283
 *         return self
 * 
 *     def createMPI(             # <<<<<<<<<<<<<<
 *         self,
 *         size: LayoutSizeSpec,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":306
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 306, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":307
 *         """
 *         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":308
 *         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, 308, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":309
 *         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, 309, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":310
 *         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":311
 *         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":312
 *         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, 312, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":313
 *         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, 313, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":314
 *         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, 314, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":315
 *         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, 315, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":316
 *         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, 316, __pyx_L1_error)
  __pyx_v_self->vec = __pyx_v_newvec;

  /* "petsc4py/PETSc/Vec.pyx":317
 *         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":283
 *         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":319
 *         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:319");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_67createWithArray = {"createWithArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_67createWithArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_66createWithArray};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_array,&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 319, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(41, 319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createWithArray", 0) < (0)) __PYX_ERR(41, 319, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":322
 *         self,
 *         array: Sequence[Scalar],
 *         size: LayoutSizeSpec | None = None,             # <<<<<<<<<<<<<<
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":323
 *         array: Sequence[Scalar],
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a vector using a provided array.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":324
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a vector using a provided array.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createWithArray", 0, 1, 4, i); __PYX_ERR(41, 319, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(41, 319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 319, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Vec.pyx":322
 *         self,
 *         array: Sequence[Scalar],
 *         size: LayoutSizeSpec | None = None,             # <<<<<<<<<<<<<<
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":323
 *         array: Sequence[Scalar],
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a vector using a provided array.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":324
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a vector using a provided array.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 319, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":319
 *         return self
 * 
 *     def createWithArray(             # <<<<<<<<<<<<<<
 *         self,
 *         array: Sequence[Scalar],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11[6];
  size_t __pyx_t_12;
  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":349
 * 
 *         """
 *         cdef PetscInt na=0             # <<<<<<<<<<<<<<
 *         cdef PetscScalar *sa=NULL
 *         array = iarray_s(array, &na, &sa)
*/
  __pyx_v_na = 0;

  /* "petsc4py/PETSc/Vec.pyx":350
 *         """
 *         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":351
 *         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, 351, __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":352
 *         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, 352, __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, 352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 352, __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) != (0)) __PYX_ERR(41, 352, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(41, 352, __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":353
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 353, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_5;

  /* "petsc4py/PETSc/Vec.pyx":354
 *         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":355
 *         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, 355, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":356
 *         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, 356, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":357
 *         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":358
 *         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)) {
    __pyx_t_3 = NULL;

    /* "petsc4py/PETSc/Vec.pyx":360
 *         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_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_10 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_10)) __PYX_ERR(41, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_11[0] = __pyx_mstate_global->__pyx_kp_u_array_size;
    __pyx_t_11[1] = __pyx_t_8;
    __pyx_t_11[2] = __pyx_mstate_global->__pyx_kp_u_and_vector_local_size;
    __pyx_t_11[3] = __pyx_t_9;
    __pyx_t_11[4] = __pyx_mstate_global->__pyx_kp_u_block_size;
    __pyx_t_11[5] = __pyx_t_10;

    /* "petsc4py/PETSc/Vec.pyx":359
 *         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_PyUnicode_Join(__pyx_t_11, 6, 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 23 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10));
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_12 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_1};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 358, __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(41, 358, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":358
 *         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)))
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":361
 *             "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":362
 *             (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, 362, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_6 == 1);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/Vec.pyx":363
 *         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, 363, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":362
 *             (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":365
 *             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, 365, __pyx_L1_error)
  }
  __pyx_L6:;

  /* "petsc4py/PETSc/Vec.pyx":366
 *         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, 366, __pyx_L1_error)
  __pyx_v_self->vec = __pyx_v_newvec;

  /* "petsc4py/PETSc/Vec.pyx":367
 *             CHKERR(VecCreateMPIWithArray(ccomm, bs, n, N, sa, &newvec))
 *         CHKERR(PetscCLEAR(self.obj)); self.vec = newvec
 *         self.set_attr('__array__', array)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __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 *)"__array__"), __pyx_v_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":368
 *         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":319
 *         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_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __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":370
 *         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:370");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_69createCUDAWithArrays = {"createCUDAWithArrays", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_69createCUDAWithArrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_68createCUDAWithArrays};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cpuarray,&__pyx_mstate_global->__pyx_n_u_cudahandle,&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 370, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(41, 370, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(41, 370, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 370, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 370, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 370, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createCUDAWithArrays", 0) < (0)) __PYX_ERR(41, 370, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":372
 *     def createCUDAWithArrays(
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,             # <<<<<<<<<<<<<<
 *         cudahandle: Any | None = None,  # FIXME What type is appropriate here?
 *         size: LayoutSizeSpec | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":373
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,
 *         cudahandle: Any | None = None,  # FIXME What type is appropriate here?             # <<<<<<<<<<<<<<
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":374
 *         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) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":375
 *         cudahandle: Any | None = None,  # FIXME What type is appropriate here?
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.CUDA` vector with optional arrays.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":376
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.CUDA` vector with optional arrays.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(41, 370, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(41, 370, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 370, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 370, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 370, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Vec.pyx":372
 *     def createCUDAWithArrays(
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,             # <<<<<<<<<<<<<<
 *         cudahandle: Any | None = None,  # FIXME What type is appropriate here?
 *         size: LayoutSizeSpec | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":373
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,
 *         cudahandle: Any | None = None,  # FIXME What type is appropriate here?             # <<<<<<<<<<<<<<
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":374
 *         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) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":375
 *         cudahandle: Any | None = None,  # FIXME What type is appropriate here?
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.CUDA` vector with optional arrays.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":376
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.CUDA` vector with optional arrays.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 370, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":370
 *         return self
 * 
 *     def createCUDAWithArrays(             # <<<<<<<<<<<<<<
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12[6];
  size_t __pyx_t_13;
  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":400
 * 
 *         """
 *         cdef PetscInt na=0             # <<<<<<<<<<<<<<
 *         cdef PetscScalar *sa=NULL
 *         cdef PetscScalar *gpuarray = NULL
*/
  __pyx_v_na = 0;

  /* "petsc4py/PETSc/Vec.pyx":401
 *         """
 *         cdef PetscInt na=0
 *         cdef PetscScalar *sa=NULL             # <<<<<<<<<<<<<<
 *         cdef PetscScalar *gpuarray = NULL
 *         if cudahandle:
*/
  __pyx_v_sa = NULL;

  /* "petsc4py/PETSc/Vec.pyx":402
 *         cdef PetscInt na=0
 *         cdef PetscScalar *sa=NULL
 *         cdef PetscScalar *gpuarray = NULL             # <<<<<<<<<<<<<<
 *         if cudahandle:
 *             gpuarray = <PetscScalar*>(<Py_uintptr_t>cudahandle)
*/
  __pyx_v_gpuarray = NULL;

  /* "petsc4py/PETSc/Vec.pyx":403
 *         cdef PetscScalar *sa=NULL
 *         cdef PetscScalar *gpuarray = NULL
 *         if cudahandle:             # <<<<<<<<<<<<<<
 *             gpuarray = <PetscScalar*>(<Py_uintptr_t>cudahandle)
 *         if cpuarray is not None:
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_cudahandle); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(41, 403, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Vec.pyx":404
 *         cdef PetscScalar *gpuarray = NULL
 *         if cudahandle:
 *             gpuarray = <PetscScalar*>(<Py_uintptr_t>cudahandle)             # <<<<<<<<<<<<<<
 *         if cpuarray is not None:
 *             cpuarray = iarray_s(cpuarray, &na, &sa)
*/
    __pyx_t_2 = __Pyx_PyLong_As_size_t(__pyx_v_cudahandle); if (unlikely((__pyx_t_2 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(41, 404, __pyx_L1_error)
    __pyx_v_gpuarray = ((PetscScalar *)((Py_uintptr_t)__pyx_t_2));

    /* "petsc4py/PETSc/Vec.pyx":403
 *         cdef PetscScalar *sa=NULL
 *         cdef PetscScalar *gpuarray = NULL
 *         if cudahandle:             # <<<<<<<<<<<<<<
 *             gpuarray = <PetscScalar*>(<Py_uintptr_t>cudahandle)
 *         if cpuarray is not None:
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":405
 *         if cudahandle:
 *             gpuarray = <PetscScalar*>(<Py_uintptr_t>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":406
 *             gpuarray = <PetscScalar*>(<Py_uintptr_t>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, 406, __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":405
 *         if cudahandle:
 *             gpuarray = <PetscScalar*>(<Py_uintptr_t>cudahandle)
 *         if cpuarray is not None:             # <<<<<<<<<<<<<<
 *             cpuarray = iarray_s(cpuarray, &na, &sa)
 * 
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":408
 *             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, 408, __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, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 408, __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) != (0)) __PYX_ERR(41, 408, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(41, 408, __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":409
 * 
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 409, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_6;

  /* "petsc4py/PETSc/Vec.pyx":410
 *         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":411
 *         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, 411, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":412
 *         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, 412, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":413
 *         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":414
 *         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)) {
    __pyx_t_4 = NULL;

    /* "petsc4py/PETSc/Vec.pyx":416
 *         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_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_9 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_3), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_3), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_10)) __PYX_ERR(41, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_3), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_array_size;
    __pyx_t_12[1] = __pyx_t_9;
    __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_and_vector_local_size;
    __pyx_t_12[3] = __pyx_t_10;
    __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_block_size;
    __pyx_t_12[5] = __pyx_t_11;

    /* "petsc4py/PETSc/Vec.pyx":415
 *         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_PyUnicode_Join(__pyx_t_12, 6, 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 23 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11));
    if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __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_t_13 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 414, __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(41, 414, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":414
 *         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)))
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":417
 *             "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":418
 *             (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, 418, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_7 == 1);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Vec.pyx":419
 *         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, 419, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":418
 *             (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":421
 *             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, 421, __pyx_L1_error)
  }
  __pyx_L8:;

  /* "petsc4py/PETSc/Vec.pyx":422
 *         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, 422, __pyx_L1_error)
  __pyx_v_self->vec = __pyx_v_newvec;

  /* "petsc4py/PETSc/Vec.pyx":424
 *         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":425
 * 
 *         if cpuarray is not None:
 *             self.set_attr('__array__', cpuarray)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
    __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 *)"__array__"), __pyx_v_cpuarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "petsc4py/PETSc/Vec.pyx":424
 *         CHKERR(PetscCLEAR(self.obj)); self.vec = newvec
 * 
 *         if cpuarray is not None:             # <<<<<<<<<<<<<<
 *             self.set_attr('__array__', cpuarray)
 *         return self
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":426
 *         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":370
 *         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_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __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":428
 *         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:428");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_71createHIPWithArrays = {"createHIPWithArrays", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_71createHIPWithArrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_70createHIPWithArrays};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cpuarray,&__pyx_mstate_global->__pyx_n_u_hiphandle,&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 428, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(41, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(41, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createHIPWithArrays", 0) < (0)) __PYX_ERR(41, 428, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":430
 *     def createHIPWithArrays(
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,             # <<<<<<<<<<<<<<
 *         hiphandle: Any | None = None,  # FIXME What type is appropriate here?
 *         size: LayoutSizeSpec | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":431
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,
 *         hiphandle: Any | None = None,  # FIXME What type is appropriate here?             # <<<<<<<<<<<<<<
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":432
 *         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) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":433
 *         hiphandle: Any | None = None,  # FIXME What type is appropriate here?
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.HIP` vector with optional arrays.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":434
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.HIP` vector with optional arrays.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(41, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(41, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Vec.pyx":430
 *     def createHIPWithArrays(
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,             # <<<<<<<<<<<<<<
 *         hiphandle: Any | None = None,  # FIXME What type is appropriate here?
 *         size: LayoutSizeSpec | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":431
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,
 *         hiphandle: Any | None = None,  # FIXME What type is appropriate here?             # <<<<<<<<<<<<<<
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":432
 *         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) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":433
 *         hiphandle: Any | None = None,  # FIXME What type is appropriate here?
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.HIP` vector with optional arrays.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":434
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.HIP` vector with optional arrays.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 428, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":428
 *         return self
 * 
 *     def createHIPWithArrays(             # <<<<<<<<<<<<<<
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12[6];
  size_t __pyx_t_13;
  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":458
 * 
 *         """
 *         cdef PetscInt na=0             # <<<<<<<<<<<<<<
 *         cdef PetscScalar *sa=NULL
 *         cdef PetscScalar *gpuarray = NULL
*/
  __pyx_v_na = 0;

  /* "petsc4py/PETSc/Vec.pyx":459
 *         """
 *         cdef PetscInt na=0
 *         cdef PetscScalar *sa=NULL             # <<<<<<<<<<<<<<
 *         cdef PetscScalar *gpuarray = NULL
 *         if hiphandle:
*/
  __pyx_v_sa = NULL;

  /* "petsc4py/PETSc/Vec.pyx":460
 *         cdef PetscInt na=0
 *         cdef PetscScalar *sa=NULL
 *         cdef PetscScalar *gpuarray = NULL             # <<<<<<<<<<<<<<
 *         if hiphandle:
 *             gpuarray = <PetscScalar*>(<Py_uintptr_t>hiphandle)
*/
  __pyx_v_gpuarray = NULL;

  /* "petsc4py/PETSc/Vec.pyx":461
 *         cdef PetscScalar *sa=NULL
 *         cdef PetscScalar *gpuarray = NULL
 *         if hiphandle:             # <<<<<<<<<<<<<<
 *             gpuarray = <PetscScalar*>(<Py_uintptr_t>hiphandle)
 *         if cpuarray is not None:
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_hiphandle); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(41, 461, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Vec.pyx":462
 *         cdef PetscScalar *gpuarray = NULL
 *         if hiphandle:
 *             gpuarray = <PetscScalar*>(<Py_uintptr_t>hiphandle)             # <<<<<<<<<<<<<<
 *         if cpuarray is not None:
 *             cpuarray = iarray_s(cpuarray, &na, &sa)
*/
    __pyx_t_2 = __Pyx_PyLong_As_size_t(__pyx_v_hiphandle); if (unlikely((__pyx_t_2 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(41, 462, __pyx_L1_error)
    __pyx_v_gpuarray = ((PetscScalar *)((Py_uintptr_t)__pyx_t_2));

    /* "petsc4py/PETSc/Vec.pyx":461
 *         cdef PetscScalar *sa=NULL
 *         cdef PetscScalar *gpuarray = NULL
 *         if hiphandle:             # <<<<<<<<<<<<<<
 *             gpuarray = <PetscScalar*>(<Py_uintptr_t>hiphandle)
 *         if cpuarray is not None:
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":463
 *         if hiphandle:
 *             gpuarray = <PetscScalar*>(<Py_uintptr_t>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":464
 *             gpuarray = <PetscScalar*>(<Py_uintptr_t>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, 464, __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":463
 *         if hiphandle:
 *             gpuarray = <PetscScalar*>(<Py_uintptr_t>hiphandle)
 *         if cpuarray is not None:             # <<<<<<<<<<<<<<
 *             cpuarray = iarray_s(cpuarray, &na, &sa)
 * 
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":466
 *             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, 466, __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, 466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 466, __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) != (0)) __PYX_ERR(41, 466, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(41, 466, __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":467
 * 
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 467, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_6;

  /* "petsc4py/PETSc/Vec.pyx":468
 *         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":469
 *         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, 469, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":470
 *         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, 470, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":471
 *         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":472
 *         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)) {
    __pyx_t_4 = NULL;

    /* "petsc4py/PETSc/Vec.pyx":474
 *         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_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_3), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_3), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_10)) __PYX_ERR(41, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_3), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_array_size;
    __pyx_t_12[1] = __pyx_t_9;
    __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_and_vector_local_size;
    __pyx_t_12[3] = __pyx_t_10;
    __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_block_size;
    __pyx_t_12[5] = __pyx_t_11;

    /* "petsc4py/PETSc/Vec.pyx":473
 *         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_PyUnicode_Join(__pyx_t_12, 6, 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 23 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11));
    if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __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_t_13 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 472, __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(41, 472, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":472
 *         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)))
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":475
 *             "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":476
 *             (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, 476, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_7 == 1);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Vec.pyx":477
 *         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, 477, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":476
 *             (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":479
 *             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, 479, __pyx_L1_error)
  }
  __pyx_L8:;

  /* "petsc4py/PETSc/Vec.pyx":480
 *         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, 480, __pyx_L1_error)
  __pyx_v_self->vec = __pyx_v_newvec;

  /* "petsc4py/PETSc/Vec.pyx":482
 *         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":483
 * 
 *         if cpuarray is not None:
 *             self.set_attr('__array__', cpuarray)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
    __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 *)"__array__"), __pyx_v_cpuarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "petsc4py/PETSc/Vec.pyx":482
 *         CHKERR(PetscCLEAR(self.obj)); self.vec = newvec
 * 
 *         if cpuarray is not None:             # <<<<<<<<<<<<<<
 *             self.set_attr('__array__', cpuarray)
 *         return self
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":484
 *         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":428
 *         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_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __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":486
 *         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:486");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_73createViennaCLWithArrays = {"createViennaCLWithArrays", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_73createViennaCLWithArrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_72createViennaCLWithArrays};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cpuarray,&__pyx_mstate_global->__pyx_n_u_viennaclvechandle,&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 486, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(41, 486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(41, 486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createViennaCLWithArrays", 0) < (0)) __PYX_ERR(41, 486, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":488
 *     def createViennaCLWithArrays(
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,             # <<<<<<<<<<<<<<
 *         viennaclvechandle: Any | None = None,  # FIXME What type is appropriate here?
 *         size: LayoutSizeSpec | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":489
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,
 *         viennaclvechandle: Any | None = None,  # FIXME What type is appropriate here?             # <<<<<<<<<<<<<<
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":490
 *         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) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":491
 *         viennaclvechandle: Any | None = None,  # FIXME What type is appropriate here?
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.VIENNACL` vector with optional arrays.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":492
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.VIENNACL` vector with optional arrays.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(41, 486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(41, 486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Vec.pyx":488
 *     def createViennaCLWithArrays(
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,             # <<<<<<<<<<<<<<
 *         viennaclvechandle: Any | None = None,  # FIXME What type is appropriate here?
 *         size: LayoutSizeSpec | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":489
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,
 *         viennaclvechandle: Any | None = None,  # FIXME What type is appropriate here?             # <<<<<<<<<<<<<<
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":490
 *         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) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":491
 *         viennaclvechandle: Any | None = None,  # FIXME What type is appropriate here?
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.VIENNACL` vector with optional arrays.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":492
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.VIENNACL` vector with optional arrays.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 486, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":486
 *         return self
 * 
 *     def createViennaCLWithArrays(             # <<<<<<<<<<<<<<
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12[6];
  size_t __pyx_t_13;
  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":517
 * 
 *         """
 *         cdef PetscInt na=0             # <<<<<<<<<<<<<<
 *         cdef PetscScalar *sa=NULL
 *         cdef PetscScalar *vclvec = NULL
*/
  __pyx_v_na = 0;

  /* "petsc4py/PETSc/Vec.pyx":518
 *         """
 *         cdef PetscInt na=0
 *         cdef PetscScalar *sa=NULL             # <<<<<<<<<<<<<<
 *         cdef PetscScalar *vclvec = NULL
 *         if viennaclvechandle:
*/
  __pyx_v_sa = NULL;

  /* "petsc4py/PETSc/Vec.pyx":519
 *         cdef PetscInt na=0
 *         cdef PetscScalar *sa=NULL
 *         cdef PetscScalar *vclvec = NULL             # <<<<<<<<<<<<<<
 *         if viennaclvechandle:
 *             vclvec = <PetscScalar*>(<Py_uintptr_t>viennaclvechandle)
*/
  __pyx_v_vclvec = NULL;

  /* "petsc4py/PETSc/Vec.pyx":520
 *         cdef PetscScalar *sa=NULL
 *         cdef PetscScalar *vclvec = NULL
 *         if viennaclvechandle:             # <<<<<<<<<<<<<<
 *             vclvec = <PetscScalar*>(<Py_uintptr_t>viennaclvechandle)
 *         if cpuarray is not None:
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_viennaclvechandle); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(41, 520, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Vec.pyx":521
 *         cdef PetscScalar *vclvec = NULL
 *         if viennaclvechandle:
 *             vclvec = <PetscScalar*>(<Py_uintptr_t>viennaclvechandle)             # <<<<<<<<<<<<<<
 *         if cpuarray is not None:
 *             cpuarray = iarray_s(cpuarray, &na, &sa)
*/
    __pyx_t_2 = __Pyx_PyLong_As_size_t(__pyx_v_viennaclvechandle); if (unlikely((__pyx_t_2 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(41, 521, __pyx_L1_error)
    __pyx_v_vclvec = ((PetscScalar *)((Py_uintptr_t)__pyx_t_2));

    /* "petsc4py/PETSc/Vec.pyx":520
 *         cdef PetscScalar *sa=NULL
 *         cdef PetscScalar *vclvec = NULL
 *         if viennaclvechandle:             # <<<<<<<<<<<<<<
 *             vclvec = <PetscScalar*>(<Py_uintptr_t>viennaclvechandle)
 *         if cpuarray is not None:
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":522
 *         if viennaclvechandle:
 *             vclvec = <PetscScalar*>(<Py_uintptr_t>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":523
 *             vclvec = <PetscScalar*>(<Py_uintptr_t>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, 523, __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":522
 *         if viennaclvechandle:
 *             vclvec = <PetscScalar*>(<Py_uintptr_t>viennaclvechandle)
 *         if cpuarray is not None:             # <<<<<<<<<<<<<<
 *             cpuarray = iarray_s(cpuarray, &na, &sa)
 * 
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":525
 *             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, 525, __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, 525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 525, __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) != (0)) __PYX_ERR(41, 525, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(41, 525, __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":526
 * 
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 526, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_6;

  /* "petsc4py/PETSc/Vec.pyx":527
 *         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":528
 *         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, 528, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":529
 *         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, 529, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":530
 *         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":531
 *         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":532
 *         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_4 = NULL;
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_3), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_3), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_10)) __PYX_ERR(41, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_3), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12[0] = __pyx_mstate_global->__pyx_kp_u_array_size;
    __pyx_t_12[1] = __pyx_t_9;
    __pyx_t_12[2] = __pyx_mstate_global->__pyx_kp_u_and_vector_local_size;
    __pyx_t_12[3] = __pyx_t_10;
    __pyx_t_12[4] = __pyx_mstate_global->__pyx_kp_u_block_size;
    __pyx_t_12[5] = __pyx_t_11;
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_12, 6, 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 23 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11));
    if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __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_t_13 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
      __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 532, __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(41, 532, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":531
 *         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":533
 *         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":534
 *             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, 534, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_7 == 1);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Vec.pyx":535
 *         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, 535, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":534
 *             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":537
 *             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, 537, __pyx_L1_error)
  }
  __pyx_L8:;

  /* "petsc4py/PETSc/Vec.pyx":538
 *         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, 538, __pyx_L1_error)
  __pyx_v_self->vec = __pyx_v_newvec;

  /* "petsc4py/PETSc/Vec.pyx":540
 *         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":541
 * 
 *         if cpuarray is not None:
 *             self.set_attr('__array__', cpuarray)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
    __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 *)"__array__"), __pyx_v_cpuarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "petsc4py/PETSc/Vec.pyx":540
 *         CHKERR(PetscCLEAR(self.obj)); self.vec = newvec
 * 
 *         if cpuarray is not None:             # <<<<<<<<<<<<<<
 *             self.set_attr('__array__', cpuarray)
 *         return self
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":542
 *         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":486
 *         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_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __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":545
 * 
 *     # 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:545");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_75createWithDLPack = {"createWithDLPack", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_75createWithDLPack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_74createWithDLPack};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dltensor,&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 545, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(41, 545, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 545, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 545, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 545, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createWithDLPack", 0) < (0)) __PYX_ERR(41, 545, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":548
 *         self,
 *         object dltensor,
 *         size: LayoutSizeSpec | None = None,             # <<<<<<<<<<<<<<
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":549
 *         object dltensor,
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a vector wrapping a DLPack object, sharing the same memory.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":550
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a vector wrapping a DLPack object, sharing the same memory.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createWithDLPack", 0, 1, 4, i); __PYX_ERR(41, 545, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(41, 545, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 545, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 545, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 545, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Vec.pyx":548
 *         self,
 *         object dltensor,
 *         size: LayoutSizeSpec | None = None,             # <<<<<<<<<<<<<<
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":549
 *         object dltensor,
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a vector wrapping a DLPack object, sharing the same memory.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":550
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a vector wrapping a DLPack object, sharing the same memory.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 545, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":545
 * 
 *     # FIXME: object? Do we need to specify it? Can't we just use Any?
 *     def createWithDLPack(             # <<<<<<<<<<<<<<
 *         self,
 *         object dltensor,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  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;
  size_t __pyx_t_5;
  void *__pyx_t_6;
  uint8_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int64_t *__pyx_t_12;
  int64_t *__pyx_t_13;
  int64_t *__pyx_t_14;
  PetscInt __pyx_t_15;
  PetscErrorCode __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18[6];
  enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType __pyx_t_19;
  int __pyx_t_20;
  int64_t __pyx_t_21;
  int64_t __pyx_t_22;
  int64_t __pyx_t_23;
  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":577
 * 
 *         """
 *         cdef DLManagedTensor* ptr = NULL             # <<<<<<<<<<<<<<
 *         cdef int bits = 0
 *         cdef PetscInt nz = 1
*/
  __pyx_v_ptr = NULL;

  /* "petsc4py/PETSc/Vec.pyx":578
 *         """
 *         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":579
 *         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":580
 *         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":581
 *         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":582
 *         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":583
 *         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_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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 583, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":584
 *         cdef int64_t* strides = NULL
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
 *         cdef PetscInt bs = 0, n = 0, N = 0             # <<<<<<<<<<<<<<
 * 
 *         if not PyCapsule_CheckExact(dltensor):
*/
  __pyx_v_bs = 0;
  __pyx_v_n = 0;
  __pyx_v_N = 0;

  /* "petsc4py/PETSc/Vec.pyx":586
 *         cdef PetscInt bs = 0, n = 0, N = 0
 * 
 *         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":587
 * 
 *         if not PyCapsule_CheckExact(dltensor):
 *             dltensor = dltensor.__dlpack__()             # <<<<<<<<<<<<<<
 * 
 *         if PyCapsule_IsValid(dltensor, 'dltensor'):
*/
    __pyx_t_4 = __pyx_v_dltensor;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dlpack, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 587, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF_SET(__pyx_v_dltensor, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/Vec.pyx":586
 *         cdef PetscInt bs = 0, n = 0, N = 0
 * 
 *         if not PyCapsule_CheckExact(dltensor):             # <<<<<<<<<<<<<<
 *             dltensor = dltensor.__dlpack__()
 * 
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":589
 *             dltensor = dltensor.__dlpack__()
 * 
 *         if PyCapsule_IsValid(dltensor, 'dltensor'):             # <<<<<<<<<<<<<<
 *             ptr = <DLManagedTensor*>PyCapsule_GetPointer(dltensor, 'dltensor')
 *             bits = ptr.dl_tensor.dtype.bits
*/
  __pyx_t_2 = PyCapsule_IsValid(__pyx_v_dltensor, __pyx_k_dltensor);
  if (likely(__pyx_t_2)) {

    /* "petsc4py/PETSc/Vec.pyx":590
 * 
 *         if PyCapsule_IsValid(dltensor, 'dltensor'):
 *             ptr = <DLManagedTensor*>PyCapsule_GetPointer(dltensor, 'dltensor')             # <<<<<<<<<<<<<<
 *             bits = ptr.dl_tensor.dtype.bits
 *             if bits != 8*sizeof(PetscScalar):
*/
    __pyx_t_6 = PyCapsule_GetPointer(__pyx_v_dltensor, __pyx_k_dltensor); if (unlikely(__pyx_t_6 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(41, 590, __pyx_L1_error)
    __pyx_v_ptr = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_6);

    /* "petsc4py/PETSc/Vec.pyx":591
 *         if PyCapsule_IsValid(dltensor, 'dltensor'):
 *             ptr = <DLManagedTensor*>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_7 = __pyx_v_ptr->dl_tensor.dtype.bits;
    __pyx_v_bits = __pyx_t_7;

    /* "petsc4py/PETSc/Vec.pyx":592
 *             ptr = <DLManagedTensor*>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":593
 *             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 = NULL;
      __pyx_t_9 = __pyx_mstate_global->__pyx_kp_u_Tensor_dtype_does_not_match_PETS;
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_10 = __pyx_convert__to_py_struct____pyx_t_8petsc4py_5PETSc_DLDataType(__pyx_v_ptr->dl_tensor.dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(41, 593, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10};
        __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 593, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 593, __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, 593, __pyx_L1_error)

      /* "petsc4py/PETSc/Vec.pyx":592
 *             ptr = <DLManagedTensor*>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":594
 *             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_11 = __pyx_v_ptr->dl_tensor.ndim;
    __pyx_v_ndim = __pyx_t_11;

    /* "petsc4py/PETSc/Vec.pyx":595
 *                 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_12 = __pyx_v_ptr->dl_tensor.shape;
    __pyx_v_shape = __pyx_t_12;

    /* "petsc4py/PETSc/Vec.pyx":596
 *             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_13 = (__pyx_v_shape + __pyx_v_ndim);
    for (__pyx_t_14 = __pyx_v_shape; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
      __pyx_t_12 = __pyx_t_14;
      __pyx_t_3 = __Pyx_PyLong_From_int64_t((__pyx_t_12[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 596, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "petsc4py/PETSc/Vec.pyx":597
 *             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_3 = __Pyx_PyLong_From_PetscInt(__pyx_v_nz); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 597, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = PyNumber_Multiply(__pyx_t_3, __pyx_v_s); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 597, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_15 = __Pyx_PyLong_As_PetscInt(__pyx_t_8); if (unlikely((__pyx_t_15 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(41, 597, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_nz = __pyx_t_15;
    }

    /* "petsc4py/PETSc/Vec.pyx":598
 *             for s in shape[:ndim]:
 *                 nz = nz*s
 *             strides = ptr.dl_tensor.strides             # <<<<<<<<<<<<<<
 *             PyCapsule_SetName(dltensor, 'used_dltensor')
 *         else:
*/
    __pyx_t_12 = __pyx_v_ptr->dl_tensor.strides;
    __pyx_v_strides = __pyx_t_12;

    /* "petsc4py/PETSc/Vec.pyx":599
 *                 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_11 = PyCapsule_SetName(__pyx_v_dltensor, __pyx_k_used_dltensor); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(41, 599, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":589
 *             dltensor = dltensor.__dlpack__()
 * 
 *         if PyCapsule_IsValid(dltensor, 'dltensor'):             # <<<<<<<<<<<<<<
 *             ptr = <DLManagedTensor*>PyCapsule_GetPointer(dltensor, 'dltensor')
 *             bits = ptr.dl_tensor.dtype.bits
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/Vec.pyx":601
 *             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 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Expect_a_dltensor_field_pycapsul};
      __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 601, __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, 601, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/Vec.pyx":602
 *         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_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nz); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(PETSC_DECIDE); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8) != (0)) __PYX_ERR(41, 602, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(41, 602, __pyx_L1_error);
    __pyx_t_8 = 0;
    __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_size, __pyx_t_4);
    __pyx_t_4 = 0;
  }

  /* "petsc4py/PETSc/Vec.pyx":603
 *             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_11 = __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_11 == ((int)-1))) __PYX_ERR(41, 603, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":604
 *         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_16 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_bs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_16 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 604, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":605
 *         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":606
 *         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)) {
    __pyx_t_3 = NULL;

    /* "petsc4py/PETSc/Vec.pyx":608
 *         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_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nz); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_8), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_10)) __PYX_ERR(41, 608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_8), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_17 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_8), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_17)) __PYX_ERR(41, 608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_18[0] = __pyx_mstate_global->__pyx_kp_u_array_size;
    __pyx_t_18[1] = __pyx_t_10;
    __pyx_t_18[2] = __pyx_mstate_global->__pyx_kp_u_and_vector_local_size;
    __pyx_t_18[3] = __pyx_t_9;
    __pyx_t_18[4] = __pyx_mstate_global->__pyx_kp_u_block_size;
    __pyx_t_18[5] = __pyx_t_17;

    /* "petsc4py/PETSc/Vec.pyx":607
 *         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_8 = __Pyx_PyUnicode_Join(__pyx_t_18, 6, 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 23 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_17), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_17));
    if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 606, __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(41, 606, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":606
 *         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)))
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":609
 *             "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":610
 *             (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_19 = __pyx_v_ptr->dl_tensor.ctx.device_type;
  __pyx_v_dltype = __pyx_t_19;

  /* "petsc4py/PETSc/Vec.pyx":611
 *         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, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
*/
  __pyx_t_19 = __pyx_v_dltype;
  __pyx_t_20 = (__pyx_t_19 == __pyx_e_8petsc4py_5PETSc_kDLCUDA);
  if (!__pyx_t_20) {
  } else {
    __pyx_t_2 = __pyx_t_20;
    goto __pyx_L12_bool_binop_done;
  }
  __pyx_t_20 = (__pyx_t_19 == __pyx_e_8petsc4py_5PETSc_kDLCUDAManaged);
  __pyx_t_2 = __pyx_t_20;
  __pyx_L12_bool_binop_done:;
  __pyx_t_20 = __pyx_t_2;
  if (__pyx_t_20) {

    /* "petsc4py/PETSc/Vec.pyx":612
 *         cdef PetscDLDeviceType dltype = ptr.dl_tensor.ctx.device_type
 *         if dltype in [kDLCUDA, kDLCUDAManaged]:
 *             if comm_size(ccomm) == 1:             # <<<<<<<<<<<<<<
 *                 CHKERR(VecCreateSeqCUDAWithArray(ccomm, bs, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *             else:
*/
    __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_11 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(41, 612, __pyx_L1_error)
    __pyx_t_20 = (__pyx_t_11 == 1);
    if (__pyx_t_20) {

      /* "petsc4py/PETSc/Vec.pyx":613
 *         if dltype in [kDLCUDA, kDLCUDAManaged]:
 *             if comm_size(ccomm) == 1:
 *                 CHKERR(VecCreateSeqCUDAWithArray(ccomm, bs, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))             # <<<<<<<<<<<<<<
 *             else:
 *                 CHKERR(VecCreateMPICUDAWithArray(ccomm, bs, n, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
*/
      __pyx_t_16 = __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_16 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 613, __pyx_L1_error)

      /* "petsc4py/PETSc/Vec.pyx":612
 *         cdef PetscDLDeviceType dltype = ptr.dl_tensor.ctx.device_type
 *         if dltype in [kDLCUDA, kDLCUDAManaged]:
 *             if comm_size(ccomm) == 1:             # <<<<<<<<<<<<<<
 *                 CHKERR(VecCreateSeqCUDAWithArray(ccomm, bs, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *             else:
*/
      goto __pyx_L14;
    }

    /* "petsc4py/PETSc/Vec.pyx":615
 *                 CHKERR(VecCreateSeqCUDAWithArray(ccomm, bs, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *             else:
 *                 CHKERR(VecCreateMPICUDAWithArray(ccomm, bs, n, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))             # <<<<<<<<<<<<<<
 *         elif dltype in [kDLCPU, kDLCUDAHost, kDLROCMHost]:
 *             if comm_size(ccomm) == 1:
*/
    /*else*/ {
      __pyx_t_16 = __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_16 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 615, __pyx_L1_error)
    }
    __pyx_L14:;

    /* "petsc4py/PETSc/Vec.pyx":611
 *         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, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
*/
    goto __pyx_L11;
  }

  /* "petsc4py/PETSc/Vec.pyx":616
 *             else:
 *                 CHKERR(VecCreateMPICUDAWithArray(ccomm, bs, n, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *         elif dltype in [kDLCPU, kDLCUDAHost, kDLROCMHost]:             # <<<<<<<<<<<<<<
 *             if comm_size(ccomm) == 1:
 *                 CHKERR(VecCreateSeqWithArray(ccomm, bs, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
*/
  __pyx_t_19 = __pyx_v_dltype;
  __pyx_t_2 = (__pyx_t_19 == __pyx_e_8petsc4py_5PETSc_kDLCPU);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_20 = __pyx_t_2;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_t_19 == __pyx_e_8petsc4py_5PETSc_kDLCUDAHost);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_20 = __pyx_t_2;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_t_19 == __pyx_e_8petsc4py_5PETSc_kDLROCMHost);
  __pyx_t_20 = __pyx_t_2;
  __pyx_L15_bool_binop_done:;
  __pyx_t_2 = __pyx_t_20;
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/Vec.pyx":617
 *                 CHKERR(VecCreateMPICUDAWithArray(ccomm, bs, n, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *         elif dltype in [kDLCPU, kDLCUDAHost, kDLROCMHost]:
 *             if comm_size(ccomm) == 1:             # <<<<<<<<<<<<<<
 *                 CHKERR(VecCreateSeqWithArray(ccomm, bs, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *             else:
*/
    __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_11 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(41, 617, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_11 == 1);
    if (__pyx_t_2) {

      /* "petsc4py/PETSc/Vec.pyx":618
 *         elif dltype in [kDLCPU, kDLCUDAHost, kDLROCMHost]:
 *             if comm_size(ccomm) == 1:
 *                 CHKERR(VecCreateSeqWithArray(ccomm, bs, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))             # <<<<<<<<<<<<<<
 *             else:
 *                 CHKERR(VecCreateMPIWithArray(ccomm, bs, n, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
*/
      __pyx_t_16 = __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_16 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 618, __pyx_L1_error)

      /* "petsc4py/PETSc/Vec.pyx":617
 *                 CHKERR(VecCreateMPICUDAWithArray(ccomm, bs, n, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *         elif dltype in [kDLCPU, kDLCUDAHost, kDLROCMHost]:
 *             if comm_size(ccomm) == 1:             # <<<<<<<<<<<<<<
 *                 CHKERR(VecCreateSeqWithArray(ccomm, bs, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *             else:
*/
      goto __pyx_L18;
    }

    /* "petsc4py/PETSc/Vec.pyx":620
 *                 CHKERR(VecCreateSeqWithArray(ccomm, bs, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *             else:
 *                 CHKERR(VecCreateMPIWithArray(ccomm, bs, n, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))             # <<<<<<<<<<<<<<
 *         elif dltype == kDLROCM:
 *             if comm_size(ccomm) == 1:
*/
    /*else*/ {
      __pyx_t_16 = __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_16 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 620, __pyx_L1_error)
    }
    __pyx_L18:;

    /* "petsc4py/PETSc/Vec.pyx":616
 *             else:
 *                 CHKERR(VecCreateMPICUDAWithArray(ccomm, bs, n, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *         elif dltype in [kDLCPU, kDLCUDAHost, kDLROCMHost]:             # <<<<<<<<<<<<<<
 *             if comm_size(ccomm) == 1:
 *                 CHKERR(VecCreateSeqWithArray(ccomm, bs, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
*/
    goto __pyx_L11;
  }

  /* "petsc4py/PETSc/Vec.pyx":621
 *             else:
 *                 CHKERR(VecCreateMPIWithArray(ccomm, bs, n, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *         elif dltype == kDLROCM:             # <<<<<<<<<<<<<<
 *             if comm_size(ccomm) == 1:
 *                 CHKERR(VecCreateSeqHIPWithArray(ccomm, bs, N, <PetscScalar*>(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":622
 *                 CHKERR(VecCreateMPIWithArray(ccomm, bs, n, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *         elif dltype == kDLROCM:
 *             if comm_size(ccomm) == 1:             # <<<<<<<<<<<<<<
 *                 CHKERR(VecCreateSeqHIPWithArray(ccomm, bs, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *             else:
*/
    __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_comm_size(__pyx_v_ccomm); if (unlikely(__pyx_t_11 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(41, 622, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_11 == 1);
    if (__pyx_t_2) {

      /* "petsc4py/PETSc/Vec.pyx":623
 *         elif dltype == kDLROCM:
 *             if comm_size(ccomm) == 1:
 *                 CHKERR(VecCreateSeqHIPWithArray(ccomm, bs, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))             # <<<<<<<<<<<<<<
 *             else:
 *                 CHKERR(VecCreateMPIHIPWithArray(ccomm, bs, n, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
*/
      __pyx_t_16 = __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_16 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 623, __pyx_L1_error)

      /* "petsc4py/PETSc/Vec.pyx":622
 *                 CHKERR(VecCreateMPIWithArray(ccomm, bs, n, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *         elif dltype == kDLROCM:
 *             if comm_size(ccomm) == 1:             # <<<<<<<<<<<<<<
 *                 CHKERR(VecCreateSeqHIPWithArray(ccomm, bs, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *             else:
*/
      goto __pyx_L19;
    }

    /* "petsc4py/PETSc/Vec.pyx":625
 *                 CHKERR(VecCreateSeqHIPWithArray(ccomm, bs, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *             else:
 *                 CHKERR(VecCreateMPIHIPWithArray(ccomm, bs, n, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError("Device type {} not supported".format(dltype))
*/
    /*else*/ {
      __pyx_t_16 = __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_16 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 625, __pyx_L1_error)
    }
    __pyx_L19:;

    /* "petsc4py/PETSc/Vec.pyx":621
 *             else:
 *                 CHKERR(VecCreateMPIWithArray(ccomm, bs, n, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *         elif dltype == kDLROCM:             # <<<<<<<<<<<<<<
 *             if comm_size(ccomm) == 1:
 *                 CHKERR(VecCreateSeqHIPWithArray(ccomm, bs, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
*/
    goto __pyx_L11;
  }

  /* "petsc4py/PETSc/Vec.pyx":627
 *                 CHKERR(VecCreateMPIHIPWithArray(ccomm, bs, n, N, <PetscScalar*>(ptr.dl_tensor.data), &newvec))
 *         else:
 *             raise TypeError("Device type {} not supported".format(dltype))             # <<<<<<<<<<<<<<
 * 
 *         CHKERR(PetscCLEAR(self.obj)); self.vec = newvec
*/
  /*else*/ {
    __pyx_t_8 = NULL;
    __pyx_t_17 = __pyx_mstate_global->__pyx_kp_u_Device_type_not_supported;
    __Pyx_INCREF(__pyx_t_17);
    __pyx_t_9 = __Pyx_PyLong_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_v_dltype); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_t_9};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 627, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_3};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 627, __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(41, 627, __pyx_L1_error)
  }
  __pyx_L11:;

  /* "petsc4py/PETSc/Vec.pyx":629
 *             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_16 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_16 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 629, __pyx_L1_error)
  __pyx_v_self->vec = __pyx_v_newvec;

  /* "petsc4py/PETSc/Vec.pyx":630
 * 
 *         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_4 = ((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_4)) __PYX_ERR(41, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":631
 *         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(<PetscInt>ndim), NULL, <void**>&shape_arr)
*/
  __pyx_v_shape_arr = NULL;

  /* "petsc4py/PETSc/Vec.pyx":632
 *         self.set_attr('__array__', dltensor)
 *         cdef int64_t* shape_arr = NULL
 *         cdef int64_t* strides_arr = NULL             # <<<<<<<<<<<<<<
 *         cdef object s1 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&shape_arr)
 *         cdef object s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&strides_arr)
*/
  __pyx_v_strides_arr = NULL;

  /* "petsc4py/PETSc/Vec.pyx":633
 *         cdef int64_t* shape_arr = NULL
 *         cdef int64_t* strides_arr = NULL
 *         cdef object s1 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&shape_arr)             # <<<<<<<<<<<<<<
 *         cdef object s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&strides_arr)
 *         for i in range(ndim):
*/
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_ndim))); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 633, __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_shape_arr)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_s1 = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Vec.pyx":634
 *         cdef int64_t* strides_arr = NULL
 *         cdef object s1 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&shape_arr)
 *         cdef object s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&strides_arr)             # <<<<<<<<<<<<<<
 *         for i in range(ndim):
 *             shape_arr[i] = shape[i]
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_ndim))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 634, __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_strides_arr)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_s2 = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":635
 *         cdef object s1 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&shape_arr)
 *         cdef object s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&strides_arr)
 *         for i in range(ndim):             # <<<<<<<<<<<<<<
 *             shape_arr[i] = shape[i]
 *             strides_arr[i] = strides[i]
*/
  __pyx_t_21 = __pyx_v_ndim;
  __pyx_t_22 = __pyx_t_21;
  for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_22; __pyx_t_23+=1) {
    __pyx_v_i = __pyx_t_23;

    /* "petsc4py/PETSc/Vec.pyx":636
 *         cdef object s2 = oarray_p(empty_p(<PetscInt>ndim), NULL, <void**>&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":637
 *         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":638
 *             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_4 = __Pyx_PyLong_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_v_ptr->dl_tensor.ctx.device_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_ptr->dl_tensor.ctx.device_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = __Pyx_PyLong_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyTuple_New(5); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4) != (0)) __PYX_ERR(41, 638, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3) != (0)) __PYX_ERR(41, 638, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8) != (0)) __PYX_ERR(41, 638, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_s1);
  __Pyx_GIVEREF(__pyx_v_s1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_v_s1) != (0)) __PYX_ERR(41, 638, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_s2);
  __Pyx_GIVEREF(__pyx_v_s2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_v_s2) != (0)) __PYX_ERR(41, 638, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_8 = 0;
  __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 *)"__dltensor_ctx__"), __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 638, __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/Vec.pyx":639
 *             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":640
 *         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":639
 *             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":641
 *         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":545
 * 
 *     # 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_17);
  __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":643
 *         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:643");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_77attachDLPackInfo = {"attachDLPackInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_77attachDLPackInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_76attachDLPackInfo};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,&__pyx_mstate_global->__pyx_n_u_dltensor,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 643, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 643, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 643, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "attachDLPackInfo", 0) < (0)) __PYX_ERR(41, 643, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":645
 *     def attachDLPackInfo(
 *         self,
 *         Vec vec=None,             # <<<<<<<<<<<<<<
 *         object dltensor=None) -> Self:
 *         """Attach tensor information from another vector or DLPack tensor.
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":646
 *         self,
 *         Vec vec=None,
 *         object dltensor=None) -> Self:             # <<<<<<<<<<<<<<
 *         """Attach tensor information from another vector or DLPack tensor.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 643, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 643, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Vec.pyx":645
 *     def attachDLPackInfo(
 *         self,
 *         Vec vec=None,             # <<<<<<<<<<<<<<
 *         object dltensor=None) -> Self:
 *         """Attach tensor information from another vector or DLPack tensor.
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":646
 *         self,
 *         Vec vec=None,
 *         object dltensor=None) -> Self:             # <<<<<<<<<<<<<<
 *         """Attach tensor information from another vector or DLPack tensor.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 643, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "vec", 0))) __PYX_ERR(41, 645, __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":643
 *         return self
 * 
 *     def attachDLPackInfo(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec vec=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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) {
  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
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  void *__pyx_t_6;
  uint8_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int64_t *__pyx_t_12;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("attachDLPackInfo", 0);

  /* "petsc4py/PETSc/Vec.pyx":671
 * 
 *         """
 *         cdef object ctx = None             # <<<<<<<<<<<<<<
 *         cdef DLManagedTensor* ptr = NULL
 *         cdef int64_t* shape_arr = NULL
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_ctx = Py_None;

  /* "petsc4py/PETSc/Vec.pyx":672
 *         """
 *         cdef object 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":673
 *         cdef object 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":674
 *         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":675
 *         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":677
 *         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_2 = (((PyObject *)__pyx_v_vec) == Py_None);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_dltensor == Py_None);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "petsc4py/PETSc/Vec.pyx":678
 * 
 *         if vec is None and dltensor is None:
 *             raise ValueError('Missing input parameters')             # <<<<<<<<<<<<<<
 *         if vec is not None:
 *             ctx = (<Object>vec).get_attr('__dltensor_ctx__')
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Missing_input_parameters};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 678, __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, 678, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":677
 *         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":679
 *         if vec is None and dltensor is None:
 *             raise ValueError('Missing input parameters')
 *         if vec is not None:             # <<<<<<<<<<<<<<
 *             ctx = (<Object>vec).get_attr('__dltensor_ctx__')
 *             if ctx is None:
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_vec) != Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Vec.pyx":680
 *             raise ValueError('Missing input parameters')
 *         if vec is not None:
 *             ctx = (<Object>vec).get_attr('__dltensor_ctx__')             # <<<<<<<<<<<<<<
 *             if ctx is None:
 *                 raise ValueError('Input vector has no tensor information')
*/
    __pyx_t_3 = ((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_3)) __PYX_ERR(41, 680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_ctx, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/Vec.pyx":681
 *         if vec is not None:
 *             ctx = (<Object>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_1 = (__pyx_v_ctx == Py_None);
    if (unlikely(__pyx_t_1)) {

      /* "petsc4py/PETSc/Vec.pyx":682
 *             ctx = (<Object>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_4 = NULL;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Input_vector_has_no_tensor_infor};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 682, __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, 682, __pyx_L1_error)

      /* "petsc4py/PETSc/Vec.pyx":681
 *         if vec is not None:
 *             ctx = (<Object>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":683
 *             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_3 = ((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_3)) __PYX_ERR(41, 683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/Vec.pyx":679
 *         if vec is None and dltensor is None:
 *             raise ValueError('Missing input parameters')
 *         if vec is not None:             # <<<<<<<<<<<<<<
 *             ctx = (<Object>vec).get_attr('__dltensor_ctx__')
 *             if ctx is None:
*/
    goto __pyx_L6;
  }

  /* "petsc4py/PETSc/Vec.pyx":685
 *             self.set_attr('__dltensor_ctx__', ctx)
 *         else:
 *             if PyCapsule_IsValid(dltensor, 'dltensor'):             # <<<<<<<<<<<<<<
 *                 ptr = <DLManagedTensor*>PyCapsule_GetPointer(dltensor, 'dltensor')
 *             elif PyCapsule_IsValid(dltensor, 'used_dltensor'):
*/
  /*else*/ {
    __pyx_t_1 = PyCapsule_IsValid(__pyx_v_dltensor, __pyx_k_dltensor);
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/Vec.pyx":686
 *         else:
 *             if PyCapsule_IsValid(dltensor, 'dltensor'):
 *                 ptr = <DLManagedTensor*>PyCapsule_GetPointer(dltensor, 'dltensor')             # <<<<<<<<<<<<<<
 *             elif PyCapsule_IsValid(dltensor, 'used_dltensor'):
 *                 ptr = <DLManagedTensor*>PyCapsule_GetPointer(dltensor, 'used_dltensor')
*/
      __pyx_t_6 = PyCapsule_GetPointer(__pyx_v_dltensor, __pyx_k_dltensor); if (unlikely(__pyx_t_6 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(41, 686, __pyx_L1_error)
      __pyx_v_ptr = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_6);

      /* "petsc4py/PETSc/Vec.pyx":685
 *             self.set_attr('__dltensor_ctx__', ctx)
 *         else:
 *             if PyCapsule_IsValid(dltensor, 'dltensor'):             # <<<<<<<<<<<<<<
 *                 ptr = <DLManagedTensor*>PyCapsule_GetPointer(dltensor, 'dltensor')
 *             elif PyCapsule_IsValid(dltensor, 'used_dltensor'):
*/
      goto __pyx_L8;
    }

    /* "petsc4py/PETSc/Vec.pyx":687
 *             if PyCapsule_IsValid(dltensor, 'dltensor'):
 *                 ptr = <DLManagedTensor*>PyCapsule_GetPointer(dltensor, 'dltensor')
 *             elif PyCapsule_IsValid(dltensor, 'used_dltensor'):             # <<<<<<<<<<<<<<
 *                 ptr = <DLManagedTensor*>PyCapsule_GetPointer(dltensor, 'used_dltensor')
 *             else:
*/
    __pyx_t_1 = PyCapsule_IsValid(__pyx_v_dltensor, __pyx_k_used_dltensor);
    if (likely(__pyx_t_1)) {

      /* "petsc4py/PETSc/Vec.pyx":688
 *                 ptr = <DLManagedTensor*>PyCapsule_GetPointer(dltensor, 'dltensor')
 *             elif PyCapsule_IsValid(dltensor, 'used_dltensor'):
 *                 ptr = <DLManagedTensor*>PyCapsule_GetPointer(dltensor, 'used_dltensor')             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError("Expect a dltensor or used_dltensor field")
*/
      __pyx_t_6 = PyCapsule_GetPointer(__pyx_v_dltensor, __pyx_k_used_dltensor); if (unlikely(__pyx_t_6 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(41, 688, __pyx_L1_error)
      __pyx_v_ptr = ((struct __pyx_t_8petsc4py_5PETSc_DLManagedTensor *)__pyx_t_6);

      /* "petsc4py/PETSc/Vec.pyx":687
 *             if PyCapsule_IsValid(dltensor, 'dltensor'):
 *                 ptr = <DLManagedTensor*>PyCapsule_GetPointer(dltensor, 'dltensor')
 *             elif PyCapsule_IsValid(dltensor, 'used_dltensor'):             # <<<<<<<<<<<<<<
 *                 ptr = <DLManagedTensor*>PyCapsule_GetPointer(dltensor, 'used_dltensor')
 *             else:
*/
      goto __pyx_L8;
    }

    /* "petsc4py/PETSc/Vec.pyx":690
 *                 ptr = <DLManagedTensor*>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_4 = NULL;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Expect_a_dltensor_or_used_dltens};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 690, __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, 690, __pyx_L1_error)
    }
    __pyx_L8:;

    /* "petsc4py/PETSc/Vec.pyx":691
 *             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_7 = __pyx_v_ptr->dl_tensor.dtype.bits;
    __pyx_v_bits = __pyx_t_7;

    /* "petsc4py/PETSc/Vec.pyx":692
 *                 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_1 = (__pyx_v_bits != (8 * (sizeof(PetscScalar))));
    if (unlikely(__pyx_t_1)) {

      /* "petsc4py/PETSc/Vec.pyx":693
 *             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 = NULL;
      __pyx_t_9 = __pyx_mstate_global->__pyx_kp_u_Tensor_dtype_does_not_match_PETS;
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_10 = __pyx_convert__to_py_struct____pyx_t_8petsc4py_5PETSc_DLDataType(__pyx_v_ptr->dl_tensor.dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(41, 693, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_5 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_10};
        __pyx_t_8 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_format, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 693, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
      }
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 693, __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, 693, __pyx_L1_error)

      /* "petsc4py/PETSc/Vec.pyx":692
 *                 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":694
 *             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_11 = __pyx_v_ptr->dl_tensor.ndim;
    __pyx_v_ndim = __pyx_t_11;

    /* "petsc4py/PETSc/Vec.pyx":695
 *                 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, <void**>&shape_arr)
*/
    __pyx_t_12 = __pyx_v_ptr->dl_tensor.shape;
    __pyx_v_shape = __pyx_t_12;

    /* "petsc4py/PETSc/Vec.pyx":696
 *             ndim = ptr.dl_tensor.ndim
 *             shape = ptr.dl_tensor.shape
 *             strides = ptr.dl_tensor.strides             # <<<<<<<<<<<<<<
 *             s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
 *             s2 = oarray_p(empty_p(ndim), NULL, <void**>&strides_arr)
*/
    __pyx_t_12 = __pyx_v_ptr->dl_tensor.strides;
    __pyx_v_strides = __pyx_t_12;

    /* "petsc4py/PETSc/Vec.pyx":697
 *             shape = ptr.dl_tensor.shape
 *             strides = ptr.dl_tensor.strides
 *             s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)             # <<<<<<<<<<<<<<
 *             s2 = oarray_p(empty_p(ndim), NULL, <void**>&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, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_3, NULL, ((void **)(&__pyx_v_shape_arr)))); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_s1, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "petsc4py/PETSc/Vec.pyx":698
 *             strides = ptr.dl_tensor.strides
 *             s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
 *             s2 = oarray_p(empty_p(ndim), NULL, <void**>&strides_arr)             # <<<<<<<<<<<<<<
 *             for i in range(ndim):
 *                 shape_arr[i] = shape[i]
*/
    __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_ndim)); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_p(__pyx_t_8, NULL, ((void **)(&__pyx_v_strides_arr)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF_SET(__pyx_v_s2, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/Vec.pyx":699
 *             s1 = oarray_p(empty_p(ndim), NULL, <void**>&shape_arr)
 *             s2 = oarray_p(empty_p(ndim), NULL, <void**>&strides_arr)
 *             for i in range(ndim):             # <<<<<<<<<<<<<<
 *                 shape_arr[i] = shape[i]
 *                 strides_arr[i] = strides[i]
*/
    __pyx_t_11 = __pyx_v_ndim;
    __pyx_t_13 = __pyx_t_11;
    for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
      __pyx_v_i = __pyx_t_14;

      /* "petsc4py/PETSc/Vec.pyx":700
 *             s2 = oarray_p(empty_p(ndim), NULL, <void**>&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":701
 *             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":702
 *                 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_3 = __Pyx_PyLong_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_v_ptr->dl_tensor.ctx.device_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_ptr->dl_tensor.ctx.device_id); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = PyTuple_New(5); if (unlikely(!__pyx_t_10)) __PYX_ERR(41, 702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3) != (0)) __PYX_ERR(41, 702, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8) != (0)) __PYX_ERR(41, 702, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_4) != (0)) __PYX_ERR(41, 702, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_s1);
    __Pyx_GIVEREF(__pyx_v_s1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_v_s1) != (0)) __PYX_ERR(41, 702, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_s2);
    __Pyx_GIVEREF(__pyx_v_s2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_v_s2) != (0)) __PYX_ERR(41, 702, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_8 = 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_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L6:;

  /* "petsc4py/PETSc/Vec.pyx":703
 *                 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":643
 *         return self
 * 
 *     def attachDLPackInfo(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec vec=None,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("petsc4py.PETSc.Vec.attachDLPackInfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __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":705
 *         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:705");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_79clearDLPackInfo = {"clearDLPackInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_79clearDLPackInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_78clearDLPackInfo};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("clearDLPackInfo", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":715
 * 
 *         """
 *         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, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Vec.pyx":716
 *         """
 *         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":705
 *         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":719
 * 
 *     # 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:719");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_81__dlpack__ = {"__dlpack__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_81__dlpack__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_80__dlpack__};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_stream,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 719, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 719, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__dlpack__", 0) < (0)) __PYX_ERR(41, 719, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_neg_1));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 719, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_neg_1));
    }
    __pyx_v_stream = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__dlpack__", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 719, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dlpack__", 0);

  /* "petsc4py/PETSc/Vec.pyx":720
 *     # TODO Stream
 *     def __dlpack__(self, stream=-1):
 *         return self.toDLPack('rw')             # <<<<<<<<<<<<<<
 * 
 *     def __dlpack_device__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_rw};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_toDLPack, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":719
 * 
 *     # 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_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":722
 *         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:722");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_83__dlpack_device__ = {"__dlpack_device__", (PyCFunction)(void(*)(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__};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__dlpack_device__", __pyx_kwds); 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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":723
 * 
 *     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, 723, __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, 723, __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_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4);
      __Pyx_INCREF(__pyx_t_6);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 723, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 723, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 723, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 723, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 4, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 723, __pyx_L1_error)
      __Pyx_XGOTREF(__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 = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(41, 723, __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, 723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 723, __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, 723, __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":724
 *     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, 724, __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) != (0)) __PYX_ERR(41, 724, __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) != (0)) __PYX_ERR(41, 724, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":722
 *         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":726
 *         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:726");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_85toDLPack = {"toDLPack", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_85toDLPack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_84toDLPack};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 726, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 726, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "toDLPack", 0) < (0)) __PYX_ERR(41, 726, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 726, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
    }
    __pyx_v_mode = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("toDLPack", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 726, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  size_t __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)(PyObject *);
  int64_t __pyx_t_12;
  PetscErrorCode __pyx_t_13;
  enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType __pyx_t_14;
  int __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":751
 * 
 *         """
 *         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_mstate_global->__pyx_n_u_rw);
    __Pyx_DECREF_SET(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_rw);
  }

  /* "petsc4py/PETSc/Vec.pyx":752
 *         """
 *         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_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_rw, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(41, 752, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_r, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(41, 752, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_w, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(41, 752, __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":753
 *         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_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_rw_r_or_w};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 753, __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, 753, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":752
 *         """
 *         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":755
 *             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":756
 * 
 *         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, 756, __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, 756, __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_INCREF(__pyx_t_4);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 4);
      __Pyx_INCREF(__pyx_t_9);
    } else {
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 756, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 756, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 756, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 756, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 4, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 756, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_9);
    }
    #else
    {
      Py_ssize_t i;
      PyObject** temps[5] = {&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
      for (i=0; i < 5; i++) {
        PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(41, 756, __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_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
    __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(41, 756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
    for (index=0; index < 5; index++) {
      PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L8_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 5) < (0)) __PYX_ERR(41, 756, __pyx_L1_error)
    __pyx_t_11 = NULL;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L9_unpacking_done;
    __pyx_L8_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(41, 756, __pyx_L1_error)
    __pyx_L9_unpacking_done:;
  }
  __pyx_t_12 = __Pyx_PyLong_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(41, 756, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_device_type = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_device_id = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_ndim = __pyx_t_12;
  __pyx_v_shape = __pyx_t_8;
  __pyx_t_8 = 0;
  __pyx_v_strides = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "petsc4py/PETSc/Vec.pyx":757
 *         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 = <DLManagedTensor*>malloc(sizeof(DLManagedTensor))
*/
  __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyObject_RichCompare(__pyx_v_device_type, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 757, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_hostmem = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "petsc4py/PETSc/Vec.pyx":759
 *         hostmem = (device_type == kDLCPU)
 * 
 *         cdef DLManagedTensor* dlm_tensor = <DLManagedTensor*>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":760
 * 
 *         cdef DLManagedTensor* dlm_tensor = <DLManagedTensor*>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":761
 *         cdef DLManagedTensor* dlm_tensor = <DLManagedTensor*>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":762
 *         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":763
 *         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":769
 *         # 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, <PetscScalar**>&a))
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_w, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(41, 769, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/Vec.pyx":770
 *         # By restoring now, we guarantee the sanity of the ObjectState
 *         if mode == 'w':
 *             if hostmem:             # <<<<<<<<<<<<<<
 *                 CHKERR(VecGetArrayWrite(self.vec, <PetscScalar**>&a))
 *                 CHKERR(VecRestoreArrayWrite(self.vec, NULL))
*/
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_hostmem); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(41, 770, __pyx_L1_error)
    if (__pyx_t_3) {

      /* "petsc4py/PETSc/Vec.pyx":771
 *         if mode == 'w':
 *             if hostmem:
 *                 CHKERR(VecGetArrayWrite(self.vec, <PetscScalar**>&a))             # <<<<<<<<<<<<<<
 *                 CHKERR(VecRestoreArrayWrite(self.vec, NULL))
 *             else:
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayWrite(__pyx_v_self->vec, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 771, __pyx_L1_error)

      /* "petsc4py/PETSc/Vec.pyx":772
 *             if hostmem:
 *                 CHKERR(VecGetArrayWrite(self.vec, <PetscScalar**>&a))
 *                 CHKERR(VecRestoreArrayWrite(self.vec, NULL))             # <<<<<<<<<<<<<<
 *             else:
 *                 CHKERR(VecGetArrayWriteAndMemType(self.vec, <PetscScalar**>&a, NULL))
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayWrite(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 772, __pyx_L1_error)

      /* "petsc4py/PETSc/Vec.pyx":770
 *         # By restoring now, we guarantee the sanity of the ObjectState
 *         if mode == 'w':
 *             if hostmem:             # <<<<<<<<<<<<<<
 *                 CHKERR(VecGetArrayWrite(self.vec, <PetscScalar**>&a))
 *                 CHKERR(VecRestoreArrayWrite(self.vec, NULL))
*/
      goto __pyx_L11;
    }

    /* "petsc4py/PETSc/Vec.pyx":774
 *                 CHKERR(VecRestoreArrayWrite(self.vec, NULL))
 *             else:
 *                 CHKERR(VecGetArrayWriteAndMemType(self.vec, <PetscScalar**>&a, NULL))             # <<<<<<<<<<<<<<
 *                 CHKERR(VecRestoreArrayWriteAndMemType(self.vec, NULL))
 *         elif mode == 'r':
*/
    /*else*/ {
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayWriteAndMemType(__pyx_v_self->vec, ((PetscScalar **)(&__pyx_v_a)), NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 774, __pyx_L1_error)

      /* "petsc4py/PETSc/Vec.pyx":775
 *             else:
 *                 CHKERR(VecGetArrayWriteAndMemType(self.vec, <PetscScalar**>&a, NULL))
 *                 CHKERR(VecRestoreArrayWriteAndMemType(self.vec, NULL))             # <<<<<<<<<<<<<<
 *         elif mode == 'r':
 *             if hostmem:
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayWriteAndMemType(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 775, __pyx_L1_error)
    }
    __pyx_L11:;

    /* "petsc4py/PETSc/Vec.pyx":769
 *         # 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, <PetscScalar**>&a))
*/
    goto __pyx_L10;
  }

  /* "petsc4py/PETSc/Vec.pyx":776
 *                 CHKERR(VecGetArrayWriteAndMemType(self.vec, <PetscScalar**>&a, NULL))
 *                 CHKERR(VecRestoreArrayWriteAndMemType(self.vec, NULL))
 *         elif mode == 'r':             # <<<<<<<<<<<<<<
 *             if hostmem:
 *                 CHKERR(VecGetArrayRead(self.vec, <const PetscScalar**>&a))
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_r, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(41, 776, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/Vec.pyx":777
 *                 CHKERR(VecRestoreArrayWriteAndMemType(self.vec, NULL))
 *         elif mode == 'r':
 *             if hostmem:             # <<<<<<<<<<<<<<
 *                 CHKERR(VecGetArrayRead(self.vec, <const PetscScalar**>&a))
 *                 CHKERR(VecRestoreArrayRead(self.vec, NULL))
*/
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_hostmem); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(41, 777, __pyx_L1_error)
    if (__pyx_t_3) {

      /* "petsc4py/PETSc/Vec.pyx":778
 *         elif mode == 'r':
 *             if hostmem:
 *                 CHKERR(VecGetArrayRead(self.vec, <const PetscScalar**>&a))             # <<<<<<<<<<<<<<
 *                 CHKERR(VecRestoreArrayRead(self.vec, NULL))
 *             else:
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayRead(__pyx_v_self->vec, ((PetscScalar const **)(&__pyx_v_a)))); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 778, __pyx_L1_error)

      /* "petsc4py/PETSc/Vec.pyx":779
 *             if hostmem:
 *                 CHKERR(VecGetArrayRead(self.vec, <const PetscScalar**>&a))
 *                 CHKERR(VecRestoreArrayRead(self.vec, NULL))             # <<<<<<<<<<<<<<
 *             else:
 *                 CHKERR(VecGetArrayReadAndMemType(self.vec, <const PetscScalar**>&a, NULL))
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayRead(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 779, __pyx_L1_error)

      /* "petsc4py/PETSc/Vec.pyx":777
 *                 CHKERR(VecRestoreArrayWriteAndMemType(self.vec, NULL))
 *         elif mode == 'r':
 *             if hostmem:             # <<<<<<<<<<<<<<
 *                 CHKERR(VecGetArrayRead(self.vec, <const PetscScalar**>&a))
 *                 CHKERR(VecRestoreArrayRead(self.vec, NULL))
*/
      goto __pyx_L12;
    }

    /* "petsc4py/PETSc/Vec.pyx":781
 *                 CHKERR(VecRestoreArrayRead(self.vec, NULL))
 *             else:
 *                 CHKERR(VecGetArrayReadAndMemType(self.vec, <const PetscScalar**>&a, NULL))             # <<<<<<<<<<<<<<
 *                 CHKERR(VecRestoreArrayReadAndMemType(self.vec, NULL))
 *         else:
*/
    /*else*/ {
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayReadAndMemType(__pyx_v_self->vec, ((PetscScalar const **)(&__pyx_v_a)), NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 781, __pyx_L1_error)

      /* "petsc4py/PETSc/Vec.pyx":782
 *             else:
 *                 CHKERR(VecGetArrayReadAndMemType(self.vec, <const PetscScalar**>&a, NULL))
 *                 CHKERR(VecRestoreArrayReadAndMemType(self.vec, NULL))             # <<<<<<<<<<<<<<
 *         else:
 *             if hostmem:
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayReadAndMemType(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 782, __pyx_L1_error)
    }
    __pyx_L12:;

    /* "petsc4py/PETSc/Vec.pyx":776
 *                 CHKERR(VecGetArrayWriteAndMemType(self.vec, <PetscScalar**>&a, NULL))
 *                 CHKERR(VecRestoreArrayWriteAndMemType(self.vec, NULL))
 *         elif mode == 'r':             # <<<<<<<<<<<<<<
 *             if hostmem:
 *                 CHKERR(VecGetArrayRead(self.vec, <const PetscScalar**>&a))
*/
    goto __pyx_L10;
  }

  /* "petsc4py/PETSc/Vec.pyx":784
 *                 CHKERR(VecRestoreArrayReadAndMemType(self.vec, NULL))
 *         else:
 *             if hostmem:             # <<<<<<<<<<<<<<
 *                 CHKERR(VecGetArray(self.vec, <PetscScalar**>&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, 784, __pyx_L1_error)
    if (__pyx_t_3) {

      /* "petsc4py/PETSc/Vec.pyx":785
 *         else:
 *             if hostmem:
 *                 CHKERR(VecGetArray(self.vec, <PetscScalar**>&a))             # <<<<<<<<<<<<<<
 *                 CHKERR(VecRestoreArray(self.vec, NULL))
 *             else:
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArray(__pyx_v_self->vec, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 785, __pyx_L1_error)

      /* "petsc4py/PETSc/Vec.pyx":786
 *             if hostmem:
 *                 CHKERR(VecGetArray(self.vec, <PetscScalar**>&a))
 *                 CHKERR(VecRestoreArray(self.vec, NULL))             # <<<<<<<<<<<<<<
 *             else:
 *                 CHKERR(VecGetArrayAndMemType(self.vec, <PetscScalar**>&a, NULL))
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArray(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 786, __pyx_L1_error)

      /* "petsc4py/PETSc/Vec.pyx":784
 *                 CHKERR(VecRestoreArrayReadAndMemType(self.vec, NULL))
 *         else:
 *             if hostmem:             # <<<<<<<<<<<<<<
 *                 CHKERR(VecGetArray(self.vec, <PetscScalar**>&a))
 *                 CHKERR(VecRestoreArray(self.vec, NULL))
*/
      goto __pyx_L13;
    }

    /* "petsc4py/PETSc/Vec.pyx":788
 *                 CHKERR(VecRestoreArray(self.vec, NULL))
 *             else:
 *                 CHKERR(VecGetArrayAndMemType(self.vec, <PetscScalar**>&a, NULL))             # <<<<<<<<<<<<<<
 *                 CHKERR(VecRestoreArrayAndMemType(self.vec, NULL))
 *         dl_tensor.data = <void *>a
*/
    /*else*/ {
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetArrayAndMemType(__pyx_v_self->vec, ((PetscScalar **)(&__pyx_v_a)), NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 788, __pyx_L1_error)

      /* "petsc4py/PETSc/Vec.pyx":789
 *             else:
 *                 CHKERR(VecGetArrayAndMemType(self.vec, <PetscScalar**>&a, NULL))
 *                 CHKERR(VecRestoreArrayAndMemType(self.vec, NULL))             # <<<<<<<<<<<<<<
 *         dl_tensor.data = <void *>a
 * 
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecRestoreArrayAndMemType(__pyx_v_self->vec, NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 789, __pyx_L1_error)
    }
    __pyx_L13:;
  }
  __pyx_L10:;

  /* "petsc4py/PETSc/Vec.pyx":790
 *                 CHKERR(VecGetArrayAndMemType(self.vec, <PetscScalar**>&a, NULL))
 *                 CHKERR(VecRestoreArrayAndMemType(self.vec, NULL))
 *         dl_tensor.data = <void *>a             # <<<<<<<<<<<<<<
 * 
 *         cdef DLContext* ctx = &dl_tensor.ctx
*/
  __pyx_v_dl_tensor->data = ((void *)__pyx_v_a);

  /* "petsc4py/PETSc/Vec.pyx":792
 *         dl_tensor.data = <void *>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":793
 * 
 *         cdef DLContext* ctx = &dl_tensor.ctx
 *         ctx.device_type = device_type             # <<<<<<<<<<<<<<
 *         ctx.device_id = device_id
 *         shape_strides = <int64_t*>malloc(sizeof(int64_t)*2*ndim)
*/
  __pyx_t_14 = ((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)__Pyx_PyLong_As_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_v_device_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 793, __pyx_L1_error)
  __pyx_v_ctx->device_type = __pyx_t_14;

  /* "petsc4py/PETSc/Vec.pyx":794
 *         cdef DLContext* ctx = &dl_tensor.ctx
 *         ctx.device_type = device_type
 *         ctx.device_id = device_id             # <<<<<<<<<<<<<<
 *         shape_strides = <int64_t*>malloc(sizeof(int64_t)*2*ndim)
 *         for i in range(ndim):
*/
  __pyx_t_15 = __Pyx_PyLong_As_int(__pyx_v_device_id); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(41, 794, __pyx_L1_error)
  __pyx_v_ctx->device_id = __pyx_t_15;

  /* "petsc4py/PETSc/Vec.pyx":795
 *         ctx.device_type = device_type
 *         ctx.device_id = device_id
 *         shape_strides = <int64_t*>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":796
 *         ctx.device_id = device_id
 *         shape_strides = <int64_t*>malloc(sizeof(int64_t)*2*ndim)
 *         for i in range(ndim):             # <<<<<<<<<<<<<<
 *             shape_strides[i] = shape[i]
 *         for i in range(ndim):
*/
  __pyx_t_2 = NULL;
  __pyx_t_8 = __Pyx_PyLong_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 796, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_8};
    __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 796, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
  }
  __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 796, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(41, 796, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  for (;;) {
    {
      __pyx_t_9 = __pyx_t_16(__pyx_t_8);
      if (unlikely(!__pyx_t_9)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(41, 796, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "petsc4py/PETSc/Vec.pyx":797
 *         shape_strides = <int64_t*>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_9 = __Pyx_PyObject_GetItem(__pyx_v_shape, __pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 797, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_12 = __Pyx_PyLong_As_int64_t(__pyx_t_9); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(41, 797, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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, 797, __pyx_L1_error)
    (__pyx_v_shape_strides[__pyx_t_17]) = __pyx_t_12;

    /* "petsc4py/PETSc/Vec.pyx":796
 *         ctx.device_id = device_id
 *         shape_strides = <int64_t*>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":798
 *         for i in range(ndim):
 *             shape_strides[i] = shape[i]
 *         for i in range(ndim):             # <<<<<<<<<<<<<<
 *             shape_strides[i+ndim] = strides[i]
 *         dl_tensor.ndim = <int>ndim
*/
  __pyx_t_9 = NULL;
  __pyx_t_2 = __Pyx_PyLong_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_2};
    __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 798, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(41, 798, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  for (;;) {
    {
      __pyx_t_8 = __pyx_t_16(__pyx_t_2);
      if (unlikely(!__pyx_t_8)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(41, 798, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "petsc4py/PETSc/Vec.pyx":799
 *             shape_strides[i] = shape[i]
 *         for i in range(ndim):
 *             shape_strides[i+ndim] = strides[i]             # <<<<<<<<<<<<<<
 *         dl_tensor.ndim = <int>ndim
 *         dl_tensor.shape = shape_strides
*/
    __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_strides, __pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_12 = __Pyx_PyLong_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(41, 799, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyLong_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PyNumber_Add(__pyx_v_i, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(41, 799, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    (__pyx_v_shape_strides[__pyx_t_17]) = __pyx_t_12;

    /* "petsc4py/PETSc/Vec.pyx":798
 *         for i in range(ndim):
 *             shape_strides[i] = shape[i]
 *         for i in range(ndim):             # <<<<<<<<<<<<<<
 *             shape_strides[i+ndim] = strides[i]
 *         dl_tensor.ndim = <int>ndim
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Vec.pyx":800
 *         for i in range(ndim):
 *             shape_strides[i+ndim] = strides[i]
 *         dl_tensor.ndim = <int>ndim             # <<<<<<<<<<<<<<
 *         dl_tensor.shape = shape_strides
 *         dl_tensor.strides = shape_strides + ndim
*/
  __pyx_v_dl_tensor->ndim = ((int)__pyx_v_ndim);

  /* "petsc4py/PETSc/Vec.pyx":801
 *             shape_strides[i+ndim] = strides[i]
 *         dl_tensor.ndim = <int>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":802
 *         dl_tensor.ndim = <int>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":804
 *         dl_tensor.strides = shape_strides + ndim
 * 
 *         cdef DLDataType* dtype = &dl_tensor.dtype             # <<<<<<<<<<<<<<
 *         dtype.code = <uint8_t>DLDataTypeCode.kDLFloat
 *         if sizeof(PetscScalar) == 8:
*/
  __pyx_v_dtype = (&__pyx_v_dl_tensor->dtype);

  /* "petsc4py/PETSc/Vec.pyx":805
 * 
 *         cdef DLDataType* dtype = &dl_tensor.dtype
 *         dtype.code = <uint8_t>DLDataTypeCode.kDLFloat             # <<<<<<<<<<<<<<
 *         if sizeof(PetscScalar) == 8:
 *             dtype.bits = <uint8_t>64
*/
  __pyx_v_dtype->code = ((uint8_t)__pyx_e_8petsc4py_5PETSc_kDLFloat);

  /* "petsc4py/PETSc/Vec.pyx":806
 *         cdef DLDataType* dtype = &dl_tensor.dtype
 *         dtype.code = <uint8_t>DLDataTypeCode.kDLFloat
 *         if sizeof(PetscScalar) == 8:             # <<<<<<<<<<<<<<
 *             dtype.bits = <uint8_t>64
 *         elif sizeof(PetscScalar) == 4:
*/
  __pyx_t_3 = ((sizeof(PetscScalar)) == 8);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/Vec.pyx":807
 *         dtype.code = <uint8_t>DLDataTypeCode.kDLFloat
 *         if sizeof(PetscScalar) == 8:
 *             dtype.bits = <uint8_t>64             # <<<<<<<<<<<<<<
 *         elif sizeof(PetscScalar) == 4:
 *             dtype.bits = <uint8_t>32
*/
    __pyx_v_dtype->bits = ((uint8_t)64);

    /* "petsc4py/PETSc/Vec.pyx":806
 *         cdef DLDataType* dtype = &dl_tensor.dtype
 *         dtype.code = <uint8_t>DLDataTypeCode.kDLFloat
 *         if sizeof(PetscScalar) == 8:             # <<<<<<<<<<<<<<
 *             dtype.bits = <uint8_t>64
 *         elif sizeof(PetscScalar) == 4:
*/
    goto __pyx_L20;
  }

  /* "petsc4py/PETSc/Vec.pyx":808
 *         if sizeof(PetscScalar) == 8:
 *             dtype.bits = <uint8_t>64
 *         elif sizeof(PetscScalar) == 4:             # <<<<<<<<<<<<<<
 *             dtype.bits = <uint8_t>32
 *         else:
*/
  __pyx_t_3 = ((sizeof(PetscScalar)) == 4);
  if (likely(__pyx_t_3)) {

    /* "petsc4py/PETSc/Vec.pyx":809
 *             dtype.bits = <uint8_t>64
 *         elif sizeof(PetscScalar) == 4:
 *             dtype.bits = <uint8_t>32             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('Unsupported PetscScalar type')
*/
    __pyx_v_dtype->bits = ((uint8_t)32);

    /* "petsc4py/PETSc/Vec.pyx":808
 *         if sizeof(PetscScalar) == 8:
 *             dtype.bits = <uint8_t>64
 *         elif sizeof(PetscScalar) == 4:             # <<<<<<<<<<<<<<
 *             dtype.bits = <uint8_t>32
 *         else:
*/
    goto __pyx_L20;
  }

  /* "petsc4py/PETSc/Vec.pyx":811
 *             dtype.bits = <uint8_t>32
 *         else:
 *             raise ValueError('Unsupported PetscScalar type')             # <<<<<<<<<<<<<<
 *         dtype.lanes = <uint16_t>1
 *         dlm_tensor.manager_ctx = <void *>self.vec
*/
  /*else*/ {
    __pyx_t_9 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_Unsupported_PetscScalar_type};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 811, __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, 811, __pyx_L1_error)
  }
  __pyx_L20:;

  /* "petsc4py/PETSc/Vec.pyx":812
 *         else:
 *             raise ValueError('Unsupported PetscScalar type')
 *         dtype.lanes = <uint16_t>1             # <<<<<<<<<<<<<<
 *         dlm_tensor.manager_ctx = <void *>self.vec
 *         CHKERR(PetscObjectReference(<PetscObject>self.vec))
*/
  __pyx_v_dtype->lanes = ((uint16_t)1);

  /* "petsc4py/PETSc/Vec.pyx":813
 *             raise ValueError('Unsupported PetscScalar type')
 *         dtype.lanes = <uint16_t>1
 *         dlm_tensor.manager_ctx = <void *>self.vec             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectReference(<PetscObject>self.vec))
 *         dlm_tensor.manager_deleter = manager_deleter
*/
  __pyx_v_dlm_tensor->manager_ctx = ((void *)__pyx_v_self->vec);

  /* "petsc4py/PETSc/Vec.pyx":814
 *         dtype.lanes = <uint16_t>1
 *         dlm_tensor.manager_ctx = <void *>self.vec
 *         CHKERR(PetscObjectReference(<PetscObject>self.vec))             # <<<<<<<<<<<<<<
 *         dlm_tensor.manager_deleter = manager_deleter
 *         dlm_tensor.del_obj = <dlpack_manager_del_obj>PetscDEALLOC
*/
  __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectReference(((PetscObject)__pyx_v_self->vec))); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 814, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":815
 *         dlm_tensor.manager_ctx = <void *>self.vec
 *         CHKERR(PetscObjectReference(<PetscObject>self.vec))
 *         dlm_tensor.manager_deleter = manager_deleter             # <<<<<<<<<<<<<<
 *         dlm_tensor.del_obj = <dlpack_manager_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":816
 *         CHKERR(PetscObjectReference(<PetscObject>self.vec))
 *         dlm_tensor.manager_deleter = manager_deleter
 *         dlm_tensor.del_obj = <dlpack_manager_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":817
 *         dlm_tensor.manager_deleter = manager_deleter
 *         dlm_tensor.del_obj = <dlpack_manager_del_obj>PetscDEALLOC
 *         return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter)             # <<<<<<<<<<<<<<
 * 
 *     def createGhost(
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyCapsule_New(__pyx_v_dlm_tensor, __pyx_k_dltensor, __pyx_f_8petsc4py_5PETSc_pycapsule_deleter); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":726
 *         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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __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":819
 *         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:819");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_87createGhost = {"createGhost", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_87createGhost, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_86createGhost};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ghosts,&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 819, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(41, 819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createGhost", 0) < (0)) __PYX_ERR(41, 819, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":823
 *         ghosts: Sequence[int],
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a parallel vector with ghost padding on each processor.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":824
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a parallel vector with ghost padding on each processor.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createGhost", 0, 2, 4, i); __PYX_ERR(41, 819, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(41, 819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 819, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 819, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Vec.pyx":823
 *         ghosts: Sequence[int],
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a parallel vector with ghost padding on each processor.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":824
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a parallel vector with ghost padding on each processor.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 819, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":819
 *         return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter)
 * 
 *     def createGhost(             # <<<<<<<<<<<<<<
 *         self,
 *         ghosts: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":845
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 845, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":846
 *         """
 *         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":847
 *         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, 847, __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":848
 *         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":849
 *         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, 849, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":850
 *         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, 850, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":851
 *         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":852
 *         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":853
 *         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, 853, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":852
 *         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":856
 *                     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":857
 *         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, 856, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Vec.pyx":858
 *             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, 858, __pyx_L1_error)
  __pyx_v_self->vec = __pyx_v_newvec;

  /* "petsc4py/PETSc/Vec.pyx":859
 *                     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":819
 *         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":861
 *         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:861");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_89createGhostWithArray = {"createGhostWithArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_89createGhostWithArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_88createGhostWithArray};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ghosts,&__pyx_mstate_global->__pyx_n_u_array,&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 861, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(41, 861, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(41, 861, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 861, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 861, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 861, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createGhostWithArray", 0) < (0)) __PYX_ERR(41, 861, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":865
 *         ghosts: Sequence[int],
 *         array: Sequence[Scalar],
 *         size: LayoutSizeSpec | None = None,             # <<<<<<<<<<<<<<
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":866
 *         array: Sequence[Scalar],
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a parallel vector with ghost padding and provided arrays.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":867
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a parallel vector with ghost padding and provided arrays.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createGhostWithArray", 0, 2, 5, i); __PYX_ERR(41, 861, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(41, 861, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(41, 861, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 861, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 861, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 861, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Vec.pyx":865
 *         ghosts: Sequence[int],
 *         array: Sequence[Scalar],
 *         size: LayoutSizeSpec | None = None,             # <<<<<<<<<<<<<<
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":866
 *         array: Sequence[Scalar],
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a parallel vector with ghost padding and provided arrays.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":867
 *         size: LayoutSizeSpec | None = None,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a parallel vector with ghost padding and provided arrays.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 861, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":861
 *         return self
 * 
 *     def createGhostWithArray(             # <<<<<<<<<<<<<<
 *         self,
 *         ghosts: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14[8];
  size_t __pyx_t_15;
  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":892
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 892, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":893
 *         """
 *         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":894
 *         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, 894, __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":895
 *         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":896
 *         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":897
 *         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, 897, __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":898
 *         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, 898, __pyx_L1_error)
    __pyx_t_3 = __pyx_t_5;
  }
  __pyx_v_b = __pyx_t_3;

  /* "petsc4py/PETSc/Vec.pyx":899
 *         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, 899, __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, 899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 899, __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) != (0)) __PYX_ERR(41, 899, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(41, 899, __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":900
 *         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":901
 *         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, 901, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":902
 *         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, 902, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":903
 *         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)) {
    __pyx_t_6 = NULL;

    /* "petsc4py/PETSc/Vec.pyx":906
 *             "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_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ng); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_2), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_10)) __PYX_ERR(41, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_11 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_2), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_11)) __PYX_ERR(41, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_12 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_2), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_12)) __PYX_ERR(41, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_13 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_2), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_14[0] = __pyx_mstate_global->__pyx_kp_u_ghosts_size;
    __pyx_t_14[1] = __pyx_t_10;
    __pyx_t_14[2] = __pyx_mstate_global->__pyx_kp_u_array_size_2;
    __pyx_t_14[3] = __pyx_t_11;
    __pyx_t_14[4] = __pyx_mstate_global->__pyx_kp_u_and_vector_local_size_2;
    __pyx_t_14[5] = __pyx_t_12;
    __pyx_t_14[6] = __pyx_mstate_global->__pyx_kp_u_block_size;
    __pyx_t_14[7] = __pyx_t_13;

    /* "petsc4py/PETSc/Vec.pyx":904
 *         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" %
 *             (toInt(ng), toInt(na), toInt(n), toInt(b)))
*/
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_14, 8, 12 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10) + 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 24 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13));
    if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 904, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __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;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_15 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_2};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_15, (2-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 903, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(41, 903, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":903
 *         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" %
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":907
 *             "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":908
 *             (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":909
 *         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, 909, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":908
 *             (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":912
 *                     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":913
 *         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, 912, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "petsc4py/PETSc/Vec.pyx":914
 *             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, 914, __pyx_L1_error)
  __pyx_v_self->vec = __pyx_v_newvec;

  /* "petsc4py/PETSc/Vec.pyx":915
 *                     ccomm, bs, n, N, ng, ig, sa, &newvec))
 *         CHKERR(PetscCLEAR(self.obj)); self.vec = newvec
 *         self.set_attr('__array__', array)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __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 *)"__array__"), __pyx_v_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "petsc4py/PETSc/Vec.pyx":916
 *         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":861
 *         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_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __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":918
 *         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:918");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_91createShared = {"createShared", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_91createShared, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_90createShared};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 918, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createShared", 0) < (0)) __PYX_ERR(41, 918, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":921
 *         self,
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.SHARED` vector that uses shared memory.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":922
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.SHARED` vector that uses shared memory.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createShared", 0, 1, 3, i); __PYX_ERR(41, 918, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 918, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Vec.pyx":921
 *         self,
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.SHARED` vector that uses shared memory.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":922
 *         size: LayoutSizeSpec,
 *         bsize: int | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.SHARED` vector that uses shared memory.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 918, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":918
 *         return self
 * 
 *     def createShared(             # <<<<<<<<<<<<<<
 *         self,
 *         size: LayoutSizeSpec,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":941
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 941, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":942
 *         """
 *         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":943
 *         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, 943, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":944
 *         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, 944, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":945
 *         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":946
 *         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, 946, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":947
 *         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, 947, __pyx_L1_error)
  __pyx_v_self->vec = __pyx_v_newvec;

  /* "petsc4py/PETSc/Vec.pyx":948
 *         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":949
 *         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, 949, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":948
 *         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":950
 *         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":918
 *         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":952
 *         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 = 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:952");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_93createNest = {"createNest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_93createNest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_92createNest};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vecs,&__pyx_mstate_global->__pyx_n_u_isets,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 952, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 952, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 952, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 952, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createNest", 0) < (0)) __PYX_ERR(41, 952, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":955
 *         self,
 *         vecs: Sequence[Vec],
 *         isets: Sequence[IS] | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.NEST` vector containing multiple nested subvectors.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":956
 *         vecs: Sequence[Vec],
 *         isets: Sequence[IS] | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.NEST` vector containing multiple nested subvectors.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createNest", 0, 1, 3, i); __PYX_ERR(41, 952, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 952, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 952, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 952, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Vec.pyx":955
 *         self,
 *         vecs: Sequence[Vec],
 *         isets: Sequence[IS] | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.NEST` vector containing multiple nested subvectors.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":956
 *         vecs: Sequence[Vec],
 *         isets: Sequence[IS] | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.NEST` vector containing multiple nested subvectors.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 952, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":952
 *         return self
 * 
 *     def createNest(             # <<<<<<<<<<<<<<
 *         self,
 *         vecs: Sequence[Vec],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_unused1 = 0;
  CYTHON_UNUSED PyObject *__pyx_v_unused2 = 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":976
 * 
 *         """
 *         vecs = list(vecs)             # <<<<<<<<<<<<<<
 *         if isets:
 *             isets = list(isets)
*/
  __pyx_t_1 = PySequence_List(__pyx_v_vecs); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 976, __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":977
 *         """
 *         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, 977, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/Vec.pyx":978
 *         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, 978, __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":979
 *         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, 979, __pyx_L1_error)
      __pyx_t_4 = PyObject_Length(__pyx_v_vecs); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(41, 979, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 == __pyx_t_4);
      if (unlikely(!__pyx_t_2)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(41, 979, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(41, 979, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/Vec.pyx":977
 *         """
 *         vecs = list(vecs)
 *         if isets:             # <<<<<<<<<<<<<<
 *             isets = list(isets)
 *             assert len(isets) == len(vecs)
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Vec.pyx":981
 *             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":982
 *         else:
 *             isets = None
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i, m = len(vecs)
 *         cdef PetscInt n = <PetscInt>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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(41, 982, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_5;

  /* "petsc4py/PETSc/Vec.pyx":983
 *             isets = None
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
 *         cdef Py_ssize_t i, m = len(vecs)             # <<<<<<<<<<<<<<
 *         cdef PetscInt n = <PetscInt>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, 983, __pyx_L1_error)
  __pyx_v_m = __pyx_t_4;

  /* "petsc4py/PETSc/Vec.pyx":984
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
 *         cdef Py_ssize_t i, m = len(vecs)
 *         cdef PetscInt n = <PetscInt>m             # <<<<<<<<<<<<<<
 *         cdef PetscVec *cvecs  = NULL
 *         cdef PetscIS  *cisets = NULL
*/
  __pyx_v_n = ((PetscInt)__pyx_v_m);

  /* "petsc4py/PETSc/Vec.pyx":985
 *         cdef Py_ssize_t i, m = len(vecs)
 *         cdef PetscInt n = <PetscInt>m
 *         cdef PetscVec *cvecs  = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscIS  *cisets = NULL
 *         cdef object unused1, unused2
*/
  __pyx_v_cvecs = NULL;

  /* "petsc4py/PETSc/Vec.pyx":986
 *         cdef PetscInt n = <PetscInt>m
 *         cdef PetscVec *cvecs  = NULL
 *         cdef PetscIS  *cisets = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused1, unused2
 *         unused1 = oarray_p(empty_p(n), NULL, <void**>&cvecs)
*/
  __pyx_v_cisets = NULL;

  /* "petsc4py/PETSc/Vec.pyx":988
 *         cdef PetscIS  *cisets = NULL
 *         cdef object unused1, unused2
 *         unused1 = oarray_p(empty_p(n), NULL, <void**>&cvecs)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < m: cvecs[i] = (<Vec?>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, 988, __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, 988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_unused1 = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "petsc4py/PETSc/Vec.pyx":989
 *         cdef object unused1, unused2
 *         unused1 = oarray_p(empty_p(n), NULL, <void**>&cvecs)
 *         for i from 0 <= i < m: cvecs[i] = (<Vec?>vecs[i]).vec             # <<<<<<<<<<<<<<
 *         if isets is not None:
 *             unused2 = oarray_p(empty_p(n), NULL, <void**>&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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 989, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (!(likely(__Pyx_TypeTest(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(41, 989, __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":990
 *         unused1 = oarray_p(empty_p(n), NULL, <void**>&cvecs)
 *         for i from 0 <= i < m: cvecs[i] = (<Vec?>vecs[i]).vec
 *         if isets is not None:             # <<<<<<<<<<<<<<
 *             unused2 = oarray_p(empty_p(n), NULL, <void**>&cisets)
 *             for i from 0 <= i < m: cisets[i] = (<IS?>isets[i]).iset
*/
  __pyx_t_2 = (__pyx_v_isets != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/Vec.pyx":991
 *         for i from 0 <= i < m: cvecs[i] = (<Vec?>vecs[i]).vec
 *         if isets is not None:
 *             unused2 = oarray_p(empty_p(n), NULL, <void**>&cisets)             # <<<<<<<<<<<<<<
 *             for i from 0 <= i < m: cisets[i] = (<IS?>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, 991, __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, 991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_unused2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "petsc4py/PETSc/Vec.pyx":992
 *         if isets is not None:
 *             unused2 = oarray_p(empty_p(n), NULL, <void**>&cisets)
 *             for i from 0 <= i < m: cisets[i] = (<IS?>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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 992, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(41, 992, __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":990
 *         unused1 = oarray_p(empty_p(n), NULL, <void**>&cvecs)
 *         for i from 0 <= i < m: cvecs[i] = (<Vec?>vecs[i]).vec
 *         if isets is not None:             # <<<<<<<<<<<<<<
 *             unused2 = oarray_p(empty_p(n), NULL, <void**>&cisets)
 *             for i from 0 <= i < m: cisets[i] = (<IS?>isets[i]).iset
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":993
 *             unused2 = oarray_p(empty_p(n), NULL, <void**>&cisets)
 *             for i from 0 <= i < m: cisets[i] = (<IS?>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":994
 *             for i from 0 <= i < m: cisets[i] = (<IS?>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, 994, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":995
 *         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, 995, __pyx_L1_error)
  __pyx_v_self->vec = __pyx_v_newvec;

  /* "petsc4py/PETSc/Vec.pyx":996
 *         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":952
 *         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_unused1);
  __Pyx_XDECREF(__pyx_v_unused2);
  __Pyx_XDECREF(__pyx_v_vecs);
  __Pyx_XDECREF(__pyx_v_isets);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Vec.pyx":1000
 *     #
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> 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) -> 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:1000");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_95setOptionsPrefix = {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_95setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_94setOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1000, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1000, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOptionsPrefix", 0) < (0)) __PYX_ERR(41, 1000, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, i); __PYX_ERR(41, 1000, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1000, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1000, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":1010
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(VecSetOptionsPrefix(self.vec, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Vec.pyx":1011
 *         """
 *         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, 1011, __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":1012
 *         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, 1012, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1000
 *     #
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> 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":1014
 *         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:1014");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_97getOptionsPrefix = {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_97getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_96getOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOptionsPrefix", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1024
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(VecGetOptionsPrefix(self.vec, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Vec.pyx":1025
 *         """
 *         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, 1025, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1026
 *         cdef const char *cval = NULL
 *         CHKERR(VecGetOptionsPrefix(self.vec, &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1014
 *         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":1028
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> 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) -> 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:1028");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_99appendOptionsPrefix = {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_99appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_98appendOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1028, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1028, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "appendOptionsPrefix", 0) < (0)) __PYX_ERR(41, 1028, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, i); __PYX_ERR(41, 1028, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1028, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1028, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":1038
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(VecAppendOptionsPrefix(self.vec, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Vec.pyx":1039
 *         """
 *         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, 1039, __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":1040
 *         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, 1040, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1028
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> 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":1042
 *         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:1042");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_101setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_101setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_100setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1052
 * 
 *         """
 *         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, 1052, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1042
 *         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":1054
 *         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:1054");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_103setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_103setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_102setUp};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1064
 * 
 *         """
 *         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, 1064, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1065
 *         """
 *         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":1054
 *         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":1067
 *         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:1067");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_105setOption = {"setOption", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_105setOption, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_104setOption};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_option,&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1067, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1067, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1067, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOption", 0) < (0)) __PYX_ERR(41, 1067, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setOption", 1, 2, 2, i); __PYX_ERR(41, 1067, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1067, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1067, __pyx_L3_error)
    }
    __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, 1067, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1077
 * 
 *         """
 *         CHKERR(VecSetOption(self.vec, option, flag))             # <<<<<<<<<<<<<<
 * 
 *     def getType(self) -> str:
*/
  __pyx_t_1 = ((VecOption)__Pyx_PyLong_As_VecOption(__pyx_v_option)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 1077, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(41, 1077, __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, 1077, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1067
 *         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":1079
 *         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:1079");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_107getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_107getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_106getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1089
 * 
 *         """
 *         cdef PetscVecType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(VecGetType(self.vec, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Vec.pyx":1090
 *         """
 *         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, 1090, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1091
 *         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, 1091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1079
 *         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":1093
 *         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:1093");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_109getSize = {"getSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_109getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_108getSize};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSize", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1103
 * 
 *         """
 *         cdef PetscInt N = 0             # <<<<<<<<<<<<<<
 *         CHKERR(VecGetSize(self.vec, &N))
 *         return toInt(N)
*/
  __pyx_v_N = 0;

  /* "petsc4py/PETSc/Vec.pyx":1104
 *         """
 *         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, 1104, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1105
 *         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, 1105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1093
 *         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":1107
 *         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:1107");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_111getLocalSize = {"getLocalSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_111getLocalSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_110getLocalSize};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLocalSize", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1117
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         CHKERR(VecGetLocalSize(self.vec, &n))
 *         return toInt(n)
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/Vec.pyx":1118
 *         """
 *         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, 1118, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1119
 *         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, 1119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1107
 *         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":1121
 *         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:1121");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_113getSizes = {"getSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_113getSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_112getSizes};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSizes", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1131
 * 
 *         """
 *         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":1132
 *         """
 *         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, 1132, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1133
 *         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, 1133, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1134
 *         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, 1134, __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, 1134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 1134, __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) != (0)) __PYX_ERR(41, 1134, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(41, 1134, __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":1121
 *         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":1136
 *         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:1136");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_115setBlockSize = {"setBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_115setBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_114setBlockSize};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bsize,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1136, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1136, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBlockSize", 0) < (0)) __PYX_ERR(41, 1136, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBlockSize", 1, 1, 1, i); __PYX_ERR(41, 1136, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1136, __pyx_L3_error)
    }
    __pyx_v_bsize = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setBlockSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1136, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1146
 * 
 *         """
 *         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, 1146, __pyx_L1_error)
  __pyx_v_bs = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":1147
 *         """
 *         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, 1147, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1136
 *         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":1149
 *         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:1149");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_117getBlockSize = {"getBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_117getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_116getBlockSize};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBlockSize", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1159
 * 
 *         """
 *         cdef PetscInt bs=0             # <<<<<<<<<<<<<<
 *         CHKERR(VecGetBlockSize(self.vec, &bs))
 *         return toInt(bs)
*/
  __pyx_v_bs = 0;

  /* "petsc4py/PETSc/Vec.pyx":1160
 *         """
 *         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, 1160, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1161
 *         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, 1161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1149
 *         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":1163
 *         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:1163");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_119getOwnershipRange = {"getOwnershipRange", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_119getOwnershipRange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_118getOwnershipRange};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOwnershipRange", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1180
 * 
 *         """
 *         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":1181
 *         """
 *         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, 1181, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1182
 *         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, 1182, __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, 1182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 1182, __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) != (0)) __PYX_ERR(41, 1182, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(41, 1182, __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":1163
 *         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":1184
 *         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:1184");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_121getOwnershipRanges = {"getOwnershipRanges", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_121getOwnershipRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_120getOwnershipRanges};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOwnershipRanges", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1196
 * 
 *         """
 *         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":1197
 *         """
 *         cdef const PetscInt *rng = NULL
 *         CHKERR(VecGetOwnershipRanges(self.vec, &rng))             # <<<<<<<<<<<<<<
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         CHKERR(PetscObjectGetComm(<PetscObject>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, 1197, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1198
 *         cdef const PetscInt *rng = NULL
 *         CHKERR(VecGetOwnershipRanges(self.vec, &rng))
 *         cdef MPI_Comm comm = MPI_COMM_NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.vec, &comm))
 *         cdef int size = -1
*/
  __pyx_v_comm = MPI_COMM_NULL;

  /* "petsc4py/PETSc/Vec.pyx":1199
 *         CHKERR(VecGetOwnershipRanges(self.vec, &rng))
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.vec, &comm))             # <<<<<<<<<<<<<<
 *         cdef int size = -1
 *         CHKERR(<PetscErrorCode>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, 1199, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1200
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.vec, &comm))
 *         cdef int size = -1             # <<<<<<<<<<<<<<
 *         CHKERR(<PetscErrorCode>MPI_Comm_size(comm, &size))
 *         return array_i(size+1, rng)
*/
  __pyx_v_size = -1;

  /* "petsc4py/PETSc/Vec.pyx":1201
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.vec, &comm))
 *         cdef int size = -1
 *         CHKERR(<PetscErrorCode>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, 1201, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1202
 *         cdef int size = -1
 *         CHKERR(<PetscErrorCode>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, 1202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1184
 *         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":1204
 *         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:1204");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_123createLocalVector = {"createLocalVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_123createLocalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_122createLocalVector};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("createLocalVector", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createLocalVector", 0);

  /* "petsc4py/PETSc/Vec.pyx":1219
 * 
 *         """
 *         lvec = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(VecCreateLocalVector(self.vec, &lvec.vec))
 *         return lvec
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1219, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_lvec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1220
 *         """
 *         lvec = Vec()
 *         CHKERR(VecCreateLocalVector(self.vec, &lvec.vec))             # <<<<<<<<<<<<<<
 *         return lvec
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreateLocalVector(__pyx_v_self->vec, (&__pyx_v_lvec->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1220, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1221
 *         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":1204
 *         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_XDECREF(__pyx_t_2);
  __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":1223
 *         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:1223");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_125getLocalVector = {"getLocalVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_125getLocalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_124getLocalVector};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_lvec,&__pyx_mstate_global->__pyx_n_u_readonly,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1223, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1223, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1223, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getLocalVector", 0) < (0)) __PYX_ERR(41, 1223, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getLocalVector", 0, 1, 2, i); __PYX_ERR(41, 1223, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1223, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1223, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __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, 1223, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "lvec", 0))) __PYX_ERR(41, 1223, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1241
 * 
 *         """
 *         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, 1241, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Vec.pyx":1242
 *         """
 *         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, 1242, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1241
 * 
 *         """
 *         if readonly:             # <<<<<<<<<<<<<<
 *             CHKERR(VecGetLocalVectorRead(self.vec, lvec.vec))
 *         else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Vec.pyx":1244
 *             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, 1244, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Vec.pyx":1223
 *         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":1246
 *             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:1246");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_127restoreLocalVector = {"restoreLocalVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_127restoreLocalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_126restoreLocalVector};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_lvec,&__pyx_mstate_global->__pyx_n_u_readonly,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1246, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1246, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1246, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "restoreLocalVector", 0) < (0)) __PYX_ERR(41, 1246, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("restoreLocalVector", 0, 1, 2, i); __PYX_ERR(41, 1246, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1246, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1246, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __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, 1246, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "lvec", 0))) __PYX_ERR(41, 1246, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1264
 * 
 *         """
 *         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, 1264, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Vec.pyx":1265
 *         """
 *         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, 1265, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1264
 * 
 *         """
 *         if readonly:             # <<<<<<<<<<<<<<
 *             CHKERR(VecRestoreLocalVectorRead(self.vec, lvec.vec))
 *         else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Vec.pyx":1267
 *             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, 1267, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Vec.pyx":1246
 *             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":1270
 * 
 *     # 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 <python:c-api/buffer>` 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:1270");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_129getBuffer = {"getBuffer", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_129getBuffer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_128getBuffer};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_readonly,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1270, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1270, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getBuffer", 0) < (0)) __PYX_ERR(41, 1270, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1270, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_readonly = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getBuffer", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1270, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1308
 * 
 *         """
 *         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, 1308, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Vec.pyx":1309
 *         """
 *         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, 1309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "petsc4py/PETSc/Vec.pyx":1308
 * 
 *         """
 *         if readonly:             # <<<<<<<<<<<<<<
 *             return vec_getbuffer_r(self)
 *         else:
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":1311
 *             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, 1311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/Vec.pyx":1270
 * 
 *     # 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":1313
 *             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:1313");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_131getArray = {"getArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_131getArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_130getArray};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_readonly,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1313, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1313, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getArray", 0) < (0)) __PYX_ERR(41, 1313, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1313, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_readonly = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getArray", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1313, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1328
 * 
 *         """
 *         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, 1328, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Vec.pyx":1329
 *         """
 *         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, 1329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "petsc4py/PETSc/Vec.pyx":1328
 * 
 *         """
 *         if readonly:             # <<<<<<<<<<<<<<
 *             return vec_getarray_r(self)
 *         else:
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":1331
 *             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, 1331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/Vec.pyx":1313
 *             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":1333
 *             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:1333");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_133setArray = {"setArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_133setArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_132setArray};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_array,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1333, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1333, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setArray", 0) < (0)) __PYX_ERR(41, 1333, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setArray", 1, 1, 1, i); __PYX_ERR(41, 1333, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1333, __pyx_L3_error)
    }
    __pyx_v_array = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setArray", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1333, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1343
 * 
 *         """
 *         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, 1343, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1333
 *             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":1345
 *         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:1345");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_135placeArray = {"placeArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_135placeArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_134placeArray};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_array,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1345, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1345, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "placeArray", 0) < (0)) __PYX_ERR(41, 1345, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("placeArray", 1, 1, 1, i); __PYX_ERR(41, 1345, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1345, __pyx_L3_error)
    }
    __pyx_v_array = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("placeArray", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1345, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8[4];
  size_t __pyx_t_9;
  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":1355
 * 
 *         """
 *         cdef PetscInt nv=0             # <<<<<<<<<<<<<<
 *         cdef PetscInt na=0
 *         cdef PetscScalar *a = NULL
*/
  __pyx_v_nv = 0;

  /* "petsc4py/PETSc/Vec.pyx":1356
 *         """
 *         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":1357
 *         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":1358
 *         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, 1358, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1359
 *         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, 1359, __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":1360
 *         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)) {
    __pyx_t_4 = NULL;

    /* "petsc4py/PETSc/Vec.pyx":1362
 *         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_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_na); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 1362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 1362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 1362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 1362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_cannot_place_input_array_size;
    __pyx_t_8[1] = __pyx_t_6;
    __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_vector_size;
    __pyx_t_8[3] = __pyx_t_7;

    /* "petsc4py/PETSc/Vec.pyx":1361
 *         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_5 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 30 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7));
    if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 1361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1360, __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, 1360, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1360
 *         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)))
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":1363
 *             "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, 1363, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1364
 *             (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_2 = ((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_2)) __PYX_ERR(41, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1345
 *         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_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __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":1366
 *         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:1366");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_137resetArray = {"resetArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_137resetArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_136resetArray};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_force,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1366, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1366, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "resetArray", 0) < (0)) __PYX_ERR(41, 1366, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1366, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_force = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("resetArray", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1366, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1389
 * 
 *         """
 *         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":1390
 *         """
 *         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, 1390, __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":1391
 *         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, 1391, __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":1392
 *         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, 1392, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1393
 *         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, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1394
 *         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":1366
 *         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":1396
 *         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:1396");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_139bindToCPU = {"bindToCPU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_139bindToCPU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_138bindToCPU};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flg,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1396, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1396, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "bindToCPU", 0) < (0)) __PYX_ERR(41, 1396, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("bindToCPU", 1, 1, 1, i); __PYX_ERR(41, 1396, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1396, __pyx_L3_error)
    }
    __pyx_v_flg = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bindToCPU", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1396, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1406
 * 
 *         """
 *         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, 1406, __pyx_L1_error)
  __pyx_v_bindFlg = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":1407
 *         """
 *         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, 1407, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1396
 *         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":1409
 *         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:1409");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_141boundToCPU = {"boundToCPU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_141boundToCPU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_140boundToCPU};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("boundToCPU", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1419
 * 
 *         """
 *         cdef PetscBool flg = PETSC_TRUE             # <<<<<<<<<<<<<<
 *         CHKERR(VecBoundToCPU(self.vec, &flg))
 *         return toBool(flg)
*/
  __pyx_v_flg = PETSC_TRUE;

  /* "petsc4py/PETSc/Vec.pyx":1420
 *         """
 *         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, 1420, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1421
 *         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, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1409
 *         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":1423
 *         return toBool(flg)
 * 
 *     def getCUDAHandle(             # <<<<<<<<<<<<<<
 *         self,
 *         mode: AccessModeSpec = 'rw') -> Any:  # FIXME What is the right return type?
*/

/* 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:1423");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_143getCUDAHandle = {"getCUDAHandle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_143getCUDAHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_142getCUDAHandle};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1423, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1423, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getCUDAHandle", 0) < (0)) __PYX_ERR(41, 1423, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1423, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
    }
    __pyx_v_mode = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getCUDAHandle", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1423, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  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":1449
 * 
 *         """
 *         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":1450
 *         """
 *         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":1451
 *         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, 1451, __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":1452
 *         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":1453
 *         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, <const PetscScalar**>&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, 1453, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1452
 *         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":1454
 *         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, <const PetscScalar**>&hdl))
 *         elif m[0] == c'w':
*/
  __pyx_t_1 = ((__pyx_v_m[0]) == 'r');
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Vec.pyx":1455
 *             CHKERR(VecCUDAGetArray(self.vec, &hdl))
 *         elif m[0] == c'r':
 *             CHKERR(VecCUDAGetArrayRead(self.vec, <const PetscScalar**>&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, 1455, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1454
 *         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, <const PetscScalar**>&hdl))
 *         elif m[0] == c'w':
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/Vec.pyx":1456
 *         elif m[0] == c'r':
 *             CHKERR(VecCUDAGetArrayRead(self.vec, <const PetscScalar**>&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":1457
 *             CHKERR(VecCUDAGetArrayRead(self.vec, <const PetscScalar**>&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, 1457, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1456
 *         elif m[0] == c'r':
 *             CHKERR(VecCUDAGetArrayRead(self.vec, <const PetscScalar**>&hdl))
 *         elif m[0] == c'w':             # <<<<<<<<<<<<<<
 *             CHKERR(VecCUDAGetArrayWrite(self.vec, &hdl))
 *         else:
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/Vec.pyx":1459
 *             CHKERR(VecCUDAGetArrayWrite(self.vec, &hdl))
 *         else:
 *             raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")             # <<<<<<<<<<<<<<
 *         return <Py_uintptr_t>hdl
 * 
*/
  /*else*/ {
    __pyx_t_5 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_rw_r_or_w};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1459, __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, 1459, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/Vec.pyx":1460
 *         else:
 *             raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")
 *         return <Py_uintptr_t>hdl             # <<<<<<<<<<<<<<
 * 
 *     def restoreCUDAHandle(
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(((Py_uintptr_t)__pyx_v_hdl)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1423
 *         return toBool(flg)
 * 
 *     def getCUDAHandle(             # <<<<<<<<<<<<<<
 *         self,
 *         mode: AccessModeSpec = 'rw') -> Any:  # FIXME What is the right return type?
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __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":1462
 *         return <Py_uintptr_t>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:1462");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_145restoreCUDAHandle = {"restoreCUDAHandle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_145restoreCUDAHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_144restoreCUDAHandle};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1462, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1462, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1462, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "restoreCUDAHandle", 0) < (0)) __PYX_ERR(41, 1462, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("restoreCUDAHandle", 0, 1, 2, i); __PYX_ERR(41, 1462, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1462, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1462, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
    }
    __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, 1462, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  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":1483
 * 
 *         """
 *         cdef PetscScalar *hdl = <PetscScalar*>(<Py_uintptr_t>handle)             # <<<<<<<<<<<<<<
 *         cdef const char *m = NULL
 *         if mode is not None: mode = str2bytes(mode, &m)
*/
  __pyx_t_1 = __Pyx_PyLong_As_size_t(__pyx_v_handle); if (unlikely((__pyx_t_1 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(41, 1483, __pyx_L1_error)
  __pyx_v_hdl = ((PetscScalar *)((Py_uintptr_t)__pyx_t_1));

  /* "petsc4py/PETSc/Vec.pyx":1484
 *         """
 *         cdef PetscScalar *hdl = <PetscScalar*>(<Py_uintptr_t>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":1485
 *         cdef PetscScalar *hdl = <PetscScalar*>(<Py_uintptr_t>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, 1485, __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":1486
 *         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":1487
 *         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, <const PetscScalar**>&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, 1487, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1486
 *         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":1488
 *         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, <const PetscScalar**>&hdl))
 *         elif m[0] == c'w':
*/
  __pyx_t_2 = ((__pyx_v_m[0]) == 'r');
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/Vec.pyx":1489
 *             CHKERR(VecCUDARestoreArray(self.vec, &hdl))
 *         elif m[0] == c'r':
 *             CHKERR(VecCUDARestoreArrayRead(self.vec, <const PetscScalar**>&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, 1489, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1488
 *         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, <const PetscScalar**>&hdl))
 *         elif m[0] == c'w':
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/Vec.pyx":1490
 *         elif m[0] == c'r':
 *             CHKERR(VecCUDARestoreArrayRead(self.vec, <const PetscScalar**>&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":1491
 *             CHKERR(VecCUDARestoreArrayRead(self.vec, <const PetscScalar**>&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, 1491, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1490
 *         elif m[0] == c'r':
 *             CHKERR(VecCUDARestoreArrayRead(self.vec, <const PetscScalar**>&hdl))
 *         elif m[0] == c'w':             # <<<<<<<<<<<<<<
 *             CHKERR(VecCUDARestoreArrayWrite(self.vec, &hdl))
 *         else:
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/Vec.pyx":1493
 *             CHKERR(VecCUDARestoreArrayWrite(self.vec, &hdl))
 *         else:
 *             raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")             # <<<<<<<<<<<<<<
 * 
 *     def getHIPHandle(
*/
  /*else*/ {
    __pyx_t_6 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_rw_r_or_w};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1493, __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, 1493, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/Vec.pyx":1462
 *         return <Py_uintptr_t>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_XDECREF(__pyx_t_6);
  __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":1495
 *             raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")
 * 
 *     def getHIPHandle(             # <<<<<<<<<<<<<<
 *         self,
 *         mode: AccessModeSpec = 'rw') -> Any:  # FIXME What is the right return type?
*/

/* 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:1495");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_147getHIPHandle = {"getHIPHandle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_147getHIPHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_146getHIPHandle};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1495, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getHIPHandle", 0) < (0)) __PYX_ERR(41, 1495, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
    }
    __pyx_v_mode = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getHIPHandle", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1495, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  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":1521
 * 
 *         """
 *         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":1522
 *         """
 *         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":1523
 *         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, 1523, __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":1524
 *         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":1525
 *         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, <const PetscScalar**>&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, 1525, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1524
 *         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":1526
 *         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, <const PetscScalar**>&hdl))
 *         elif m[0] == c'w':
*/
  __pyx_t_1 = ((__pyx_v_m[0]) == 'r');
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Vec.pyx":1527
 *             CHKERR(VecHIPGetArray(self.vec, &hdl))
 *         elif m[0] == c'r':
 *             CHKERR(VecHIPGetArrayRead(self.vec, <const PetscScalar**>&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, 1527, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1526
 *         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, <const PetscScalar**>&hdl))
 *         elif m[0] == c'w':
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/Vec.pyx":1528
 *         elif m[0] == c'r':
 *             CHKERR(VecHIPGetArrayRead(self.vec, <const PetscScalar**>&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":1529
 *             CHKERR(VecHIPGetArrayRead(self.vec, <const PetscScalar**>&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, 1529, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1528
 *         elif m[0] == c'r':
 *             CHKERR(VecHIPGetArrayRead(self.vec, <const PetscScalar**>&hdl))
 *         elif m[0] == c'w':             # <<<<<<<<<<<<<<
 *             CHKERR(VecHIPGetArrayWrite(self.vec, &hdl))
 *         else:
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/Vec.pyx":1531
 *             CHKERR(VecHIPGetArrayWrite(self.vec, &hdl))
 *         else:
 *             raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")             # <<<<<<<<<<<<<<
 *         return <Py_uintptr_t>hdl
 * 
*/
  /*else*/ {
    __pyx_t_5 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_rw_r_or_w};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1531, __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, 1531, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/Vec.pyx":1532
 *         else:
 *             raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")
 *         return <Py_uintptr_t>hdl             # <<<<<<<<<<<<<<
 * 
 *     def restoreHIPHandle(
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(((Py_uintptr_t)__pyx_v_hdl)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1495
 *             raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")
 * 
 *     def getHIPHandle(             # <<<<<<<<<<<<<<
 *         self,
 *         mode: AccessModeSpec = 'rw') -> Any:  # FIXME What is the right return type?
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __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":1534
 *         return <Py_uintptr_t>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:1534");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_149restoreHIPHandle = {"restoreHIPHandle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_149restoreHIPHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_148restoreHIPHandle};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_handle,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1534, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1534, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1534, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "restoreHIPHandle", 0) < (0)) __PYX_ERR(41, 1534, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("restoreHIPHandle", 0, 1, 2, i); __PYX_ERR(41, 1534, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1534, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1534, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
    }
    __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, 1534, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  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":1555
 * 
 *         """
 *         cdef PetscScalar *hdl = <PetscScalar*>(<Py_uintptr_t>handle)             # <<<<<<<<<<<<<<
 *         cdef const char *m = NULL
 *         if mode is not None: mode = str2bytes(mode, &m)
*/
  __pyx_t_1 = __Pyx_PyLong_As_size_t(__pyx_v_handle); if (unlikely((__pyx_t_1 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(41, 1555, __pyx_L1_error)
  __pyx_v_hdl = ((PetscScalar *)((Py_uintptr_t)__pyx_t_1));

  /* "petsc4py/PETSc/Vec.pyx":1556
 *         """
 *         cdef PetscScalar *hdl = <PetscScalar*>(<Py_uintptr_t>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":1557
 *         cdef PetscScalar *hdl = <PetscScalar*>(<Py_uintptr_t>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, 1557, __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":1558
 *         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":1559
 *         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, <const PetscScalar**>&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, 1559, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1558
 *         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":1560
 *         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, <const PetscScalar**>&hdl))
 *         elif m[0] == c'w':
*/
  __pyx_t_2 = ((__pyx_v_m[0]) == 'r');
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/Vec.pyx":1561
 *             CHKERR(VecHIPRestoreArray(self.vec, &hdl))
 *         elif m[0] == c'r':
 *             CHKERR(VecHIPRestoreArrayRead(self.vec, <const PetscScalar**>&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, 1561, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1560
 *         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, <const PetscScalar**>&hdl))
 *         elif m[0] == c'w':
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/Vec.pyx":1562
 *         elif m[0] == c'r':
 *             CHKERR(VecHIPRestoreArrayRead(self.vec, <const PetscScalar**>&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":1563
 *             CHKERR(VecHIPRestoreArrayRead(self.vec, <const PetscScalar**>&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, 1563, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1562
 *         elif m[0] == c'r':
 *             CHKERR(VecHIPRestoreArrayRead(self.vec, <const PetscScalar**>&hdl))
 *         elif m[0] == c'w':             # <<<<<<<<<<<<<<
 *             CHKERR(VecHIPRestoreArrayWrite(self.vec, &hdl))
 *         else:
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/Vec.pyx":1565
 *             CHKERR(VecHIPRestoreArrayWrite(self.vec, &hdl))
 *         else:
 *             raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")             # <<<<<<<<<<<<<<
 * 
 *     def getOffloadMask(self) -> int:
*/
  /*else*/ {
    __pyx_t_6 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_rw_r_or_w};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1565, __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, 1565, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/Vec.pyx":1534
 *         return <Py_uintptr_t>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_XDECREF(__pyx_t_6);
  __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":1567
 *             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:1567");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_151getOffloadMask = {"getOffloadMask", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_151getOffloadMask, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_150getOffloadMask};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOffloadMask", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1589
 * 
 *         """
 *         cdef PetscOffloadMask mask = PETSC_OFFLOAD_UNALLOCATED             # <<<<<<<<<<<<<<
 *         CHKERR(VecGetOffloadMask(self.vec, &mask))
 *         return mask
*/
  __pyx_v_mask = PETSC_OFFLOAD_UNALLOCATED;

  /* "petsc4py/PETSc/Vec.pyx":1590
 *         """
 *         cdef PetscOffloadMask mask = PETSC_OFFLOAD_UNALLOCATED
 *         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, 1590, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1591
 *         cdef PetscOffloadMask mask = PETSC_OFFLOAD_UNALLOCATED
 *         CHKERR(VecGetOffloadMask(self.vec, &mask))
 *         return mask             # <<<<<<<<<<<<<<
 * 
 *     def getCLContextHandle(self) -> int:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_PetscOffloadMask(__pyx_v_mask); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1567
 *             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":1593
 *         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:1593");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_153getCLContextHandle = {"getCLContextHandle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_153getCLContextHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_152getCLContextHandle};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCLContextHandle", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1609
 * 
 *         """
 *         cdef Py_uintptr_t ctxhdl = 0             # <<<<<<<<<<<<<<
 *         CHKERR(VecViennaCLGetCLContext(self.vec, &ctxhdl))
 *         return ctxhdl
*/
  __pyx_v_ctxhdl = 0;

  /* "petsc4py/PETSc/Vec.pyx":1610
 *         """
 *         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, 1610, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1611
 *         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_PyLong_FromSize_t(__pyx_v_ctxhdl); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1593
 *         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":1613
 *         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:1613");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_155getCLQueueHandle = {"getCLQueueHandle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_155getCLQueueHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_154getCLQueueHandle};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCLQueueHandle", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1629
 * 
 *         """
 *         cdef Py_uintptr_t queuehdl = 0             # <<<<<<<<<<<<<<
 *         CHKERR(VecViennaCLGetCLQueue(self.vec, &queuehdl))
 *         return queuehdl
*/
  __pyx_v_queuehdl = 0;

  /* "petsc4py/PETSc/Vec.pyx":1630
 *         """
 *         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, 1630, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1631
 *         cdef Py_uintptr_t queuehdl = 0
 *         CHKERR(VecViennaCLGetCLQueue(self.vec, &queuehdl))
 *         return queuehdl             # <<<<<<<<<<<<<<
 * 
 *     def getCLMemHandle(
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_v_queuehdl); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1613
 *         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":1633
 *         return queuehdl
 * 
 *     def getCLMemHandle(             # <<<<<<<<<<<<<<
 *         self,
 *         mode: AccessModeSpec = 'rw') -> int:
*/

/* 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:1633");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_157getCLMemHandle = {"getCLMemHandle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_157getCLMemHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_156getCLMemHandle};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1633, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getCLMemHandle", 0) < (0)) __PYX_ERR(41, 1633, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
    }
    __pyx_v_mode = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getCLMemHandle", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1633, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  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":1657
 * 
 *         """
 *         cdef Py_uintptr_t memhdl = 0             # <<<<<<<<<<<<<<
 *         cdef const char *m = NULL
 *         mode = str2bytes(mode, &m)
*/
  __pyx_v_memhdl = 0;

  /* "petsc4py/PETSc/Vec.pyx":1658
 *         """
 *         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":1659
 *         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, 1659, __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":1660
 *         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":1661
 *         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, 1661, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1660
 *         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":1662
 *         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":1663
 *             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, 1663, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1662
 *         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":1664
 *         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":1665
 *             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, 1665, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1664
 *         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":1667
 *             CHKERR(VecViennaCLGetCLMemWrite(self.vec, &memhdl))
 *         else:
 *             raise ValueError("Invalid mode: expected 'r', 'w' or 'rw'")             # <<<<<<<<<<<<<<
 *         return memhdl
 * 
*/
  /*else*/ {
    __pyx_t_5 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_r_w_or_rw};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1667, __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, 1667, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Vec.pyx":1668
 *         else:
 *             raise ValueError("Invalid mode: expected 'r', 'w' or 'rw'")
 *         return memhdl             # <<<<<<<<<<<<<<
 * 
 *     def restoreCLMemHandle(self) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyLong_FromSize_t(__pyx_v_memhdl); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1633
 *         return queuehdl
 * 
 *     def getCLMemHandle(             # <<<<<<<<<<<<<<
 *         self,
 *         mode: AccessModeSpec = 'rw') -> int:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __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":1670
 *         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:1670");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_159restoreCLMemHandle = {"restoreCLMemHandle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_159restoreCLMemHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_158restoreCLMemHandle};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("restoreCLMemHandle", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1680
 * 
 *         """
 *         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, 1680, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1670
 *         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":1682
 *         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:1682");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_161duplicate = {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_161duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_160duplicate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_array,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1682, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1682, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "duplicate", 0) < (0)) __PYX_ERR(41, 1682, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1682, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_array = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("duplicate", 0, 0, 1, __pyx_nargs); __PYX_ERR(41, 1682, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("duplicate", 0);

  /* "petsc4py/PETSc/Vec.pyx":1697
 * 
 *         """
 *         cdef Vec vec = type(self)()             # <<<<<<<<<<<<<<
 *         CHKERR(VecDuplicate(self.vec, &vec.vec))
 *         # duplicate tensor context
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 1697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(41, 1697, __pyx_L1_error)
  __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1698
 *         """
 *         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, 1698, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1700
 *         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, 1700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ctx0 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1701
 *         # 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":1702
 *         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, 1702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "petsc4py/PETSc/Vec.pyx":1701
 *         # 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":1703
 *         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":1704
 *             vec.set_attr('__dltensor_ctx__', ctx0)
 *         if array is not None:
 *             vec_setarray(vec, array)             # <<<<<<<<<<<<<<
 *         return vec
 * 
*/
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_vec_setarray(__pyx_v_vec, __pyx_v_array); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(41, 1704, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1703
 *         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":1705
 *         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":1682
 *         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":1707
 *         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:1707");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_163copy = {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_163copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_162copy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_result,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1707, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1707, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "copy", 0) < (0)) __PYX_ERR(41, 1707, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1707, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 1707, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "result", 0))) __PYX_ERR(41, 1707, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  size_t __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":1725
 * 
 *         """
 *         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":1726
 *         """
 *         if result is None:
 *             result = type(self)()             # <<<<<<<<<<<<<<
 *         if result.vec == NULL:
 *             CHKERR(VecDuplicate(self.vec, &result.vec))
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1726, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(41, 1726, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscVecObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Vec.pyx":1725
 * 
 *         """
 *         if result is None:             # <<<<<<<<<<<<<<
 *             result = type(self)()
 *         if result.vec == NULL:
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":1727
 *         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":1728
 *             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, 1728, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1727
 *         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":1729
 *         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, 1729, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1730
 *             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":1707
 *         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":1732
 *         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:1732");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_165chop = {"chop", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_165chop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_164chop};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1732, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1732, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "chop", 0) < (0)) __PYX_ERR(41, 1732, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("chop", 1, 1, 1, i); __PYX_ERR(41, 1732, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1732, __pyx_L3_error)
    }
    __pyx_v_tol = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chop", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 1732, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1747
 * 
 *         """
 *         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, 1747, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":1748
 *         """
 *         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, 1748, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1732
 *         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":1750
 *         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:1750");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_167load = {"load", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_167load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_166load};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1750, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1750, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "load", 0) < (0)) __PYX_ERR(41, 1750, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, i); __PYX_ERR(41, 1750, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1750, __pyx_L3_error)
    }
    __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, 1750, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(41, 1750, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1760
 * 
 *         """
 *         cdef MPI_Comm comm = MPI_COMM_NULL             # <<<<<<<<<<<<<<
 *         cdef PetscObject obj = <PetscObject>(viewer.vwr)
 *         if self.vec == NULL:
*/
  __pyx_v_comm = MPI_COMM_NULL;

  /* "petsc4py/PETSc/Vec.pyx":1761
 *         """
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         cdef PetscObject obj = <PetscObject>(viewer.vwr)             # <<<<<<<<<<<<<<
 *         if self.vec == NULL:
 *             CHKERR(PetscObjectGetComm(obj, &comm))
*/
  __pyx_v_obj = ((PetscObject)__pyx_v_viewer->vwr);

  /* "petsc4py/PETSc/Vec.pyx":1762
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         cdef PetscObject obj = <PetscObject>(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":1763
 *         cdef PetscObject obj = <PetscObject>(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, 1763, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1764
 *         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, 1764, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1762
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         cdef PetscObject obj = <PetscObject>(viewer.vwr)
 *         if self.vec == NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscObjectGetComm(obj, &comm))
 *             CHKERR(VecCreate(comm, &self.vec))
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":1765
 *             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, 1765, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1766
 *             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":1750
 *         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":1768
 *         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:1768");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_169equal = {"equal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_169equal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_168equal};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1768, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1768, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "equal", 0) < (0)) __PYX_ERR(41, 1768, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("equal", 1, 1, 1, i); __PYX_ERR(41, 1768, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1768, __pyx_L3_error)
    }
    __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, 1768, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 1768, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1783
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(VecEqual(self.vec, vec.vec, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/Vec.pyx":1784
 *         """
 *         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, 1784, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1785
 *         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, 1785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1768
 *         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":1787
 *         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:1787");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_171dot = {"dot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_171dot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_170dot};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1787, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1787, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dot", 0) < (0)) __PYX_ERR(41, 1787, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dot", 1, 1, 1, i); __PYX_ERR(41, 1787, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1787, __pyx_L3_error)
    }
    __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, 1787, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 1787, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1808
 * 
 *         """
 *         cdef PetscScalar sval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(VecDot(self.vec, vec.vec, &sval))
 *         return toScalar(sval)
*/
  __pyx_v_sval = 0.0;

  /* "petsc4py/PETSc/Vec.pyx":1809
 *         """
 *         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, 1809, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1810
 *         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, 1810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1787
 *         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":1812
 *         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:1812");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_173dotBegin = {"dotBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_173dotBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_172dotBegin};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1812, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1812, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dotBegin", 0) < (0)) __PYX_ERR(41, 1812, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dotBegin", 1, 1, 1, i); __PYX_ERR(41, 1812, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1812, __pyx_L3_error)
    }
    __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, 1812, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 1812, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1829
 * 
 *         """
 *         cdef PetscScalar sval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(VecDotBegin(self.vec, vec.vec, &sval))
 * 
*/
  __pyx_v_sval = 0.0;

  /* "petsc4py/PETSc/Vec.pyx":1830
 *         """
 *         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, 1830, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1812
 *         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":1832
 *         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:1832");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_175dotEnd = {"dotEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_175dotEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_174dotEnd};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1832, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dotEnd", 0) < (0)) __PYX_ERR(41, 1832, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dotEnd", 1, 1, 1, i); __PYX_ERR(41, 1832, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1832, __pyx_L3_error)
    }
    __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, 1832, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 1832, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1842
 * 
 *         """
 *         cdef PetscScalar sval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(VecDotEnd(self.vec, vec.vec, &sval))
 *         return toScalar(sval)
*/
  __pyx_v_sval = 0.0;

  /* "petsc4py/PETSc/Vec.pyx":1843
 *         """
 *         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, 1843, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1844
 *         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, 1844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1832
 *         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":1846
 *         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:1846");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_177tDot = {"tDot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_177tDot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_176tDot};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1846, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1846, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tDot", 0) < (0)) __PYX_ERR(41, 1846, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tDot", 1, 1, 1, i); __PYX_ERR(41, 1846, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1846, __pyx_L3_error)
    }
    __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, 1846, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 1846, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1864
 * 
 *         """
 *         cdef PetscScalar sval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(VecTDot(self.vec, vec.vec, &sval))
 *         return toScalar(sval)
*/
  __pyx_v_sval = 0.0;

  /* "petsc4py/PETSc/Vec.pyx":1865
 *         """
 *         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, 1865, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1866
 *         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, 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":1846
 *         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":1868
 *         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:1868");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_179tDotBegin = {"tDotBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_179tDotBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_178tDotBegin};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1868, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1868, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tDotBegin", 0) < (0)) __PYX_ERR(41, 1868, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tDotBegin", 1, 1, 1, i); __PYX_ERR(41, 1868, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1868, __pyx_L3_error)
    }
    __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, 1868, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 1868, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1885
 * 
 *         """
 *         cdef PetscScalar sval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(VecTDotBegin(self.vec, vec.vec, &sval))
 * 
*/
  __pyx_v_sval = 0.0;

  /* "petsc4py/PETSc/Vec.pyx":1886
 *         """
 *         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, 1886, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1868
 *         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":1888
 *         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:1888");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_181tDotEnd = {"tDotEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_181tDotEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_180tDotEnd};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1888, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1888, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "tDotEnd", 0) < (0)) __PYX_ERR(41, 1888, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("tDotEnd", 1, 1, 1, i); __PYX_ERR(41, 1888, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1888, __pyx_L3_error)
    }
    __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, 1888, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 1888, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Vec.pyx":1898
 * 
 *         """
 *         cdef PetscScalar sval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(VecTDotEnd(self.vec, vec.vec, &sval))
 *         return toScalar(sval)
*/
  __pyx_v_sval = 0.0;

  /* "petsc4py/PETSc/Vec.pyx":1899
 *         """
 *         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, 1899, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1900
 *         cdef PetscScalar sval = 0
 *         CHKERR(VecTDotEnd(self.vec, vec.vec, &sval))
 *         return toScalar(sval)             # <<<<<<<<<<<<<<
 * 
 *     def mDot(self, vecs: Sequence[Vec], out: ArrayScalar | None = None) -> ArrayScalar:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_sval); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1888
 *         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":1902
 *         return toScalar(sval)
 * 
 *     def mDot(self, vecs: Sequence[Vec], out: ArrayScalar | None = None) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Compute Xy with X an array of vectors.
 * 
*/

/* 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: Sequence[Vec], out: ArrayScalar | None = None) -> ArrayScalar\nCompute X\341\264\264\302\267y with X an array of vectors.\n\n        Collective.\n\n        Parameters\n        ----------\n        vecs\n            Array of vectors.\n        out\n            Optional placeholder for the result.\n\n        See Also\n        --------\n        dot, tDot, mDotBegin, mDotEnd, petsc.VecMDot\n\n        \nSource code at petsc4py/PETSc/Vec.pyx:1902");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_183mDot = {"mDot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_183mDot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_182mDot};
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
) {
  PyObject *__pyx_v_vecs = 0;
  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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vecs,&__pyx_mstate_global->__pyx_n_u_out,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1902, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1902, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1902, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "mDot", 0) < (0)) __PYX_ERR(41, 1902, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("mDot", 0, 1, 2, i); __PYX_ERR(41, 1902, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1902, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1902, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1902, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_182mDot(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) {
  PetscInt __pyx_v_nv;
  PetscInt __pyx_v_no;
  Vec *__pyx_v_v;
  PetscScalar *__pyx_v_val;
  Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED PyObject *__pyx_v_unused = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PetscInt __pyx_t_4;
  Vec __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10[4];
  size_t __pyx_t_11;
  PetscErrorCode __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mDot", 0);
  __Pyx_INCREF(__pyx_v_out);

  /* "petsc4py/PETSc/Vec.pyx":1919
 * 
 *         """
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0             # <<<<<<<<<<<<<<
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_vecs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(41, 1919, __pyx_L1_error)
  __pyx_v_nv = ((PetscInt)__pyx_t_1);
  __pyx_v_no = 0;

  /* "petsc4py/PETSc/Vec.pyx":1920
 *         """
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0
 *         cdef PetscVec *v=NULL             # <<<<<<<<<<<<<<
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0
*/
  __pyx_v_v = NULL;

  /* "petsc4py/PETSc/Vec.pyx":1921
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
*/
  __pyx_v_val = NULL;

  /* "petsc4py/PETSc/Vec.pyx":1922
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:
*/
  __pyx_v_i = 0;

  /* "petsc4py/PETSc/Vec.pyx":1923
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nv)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1923, __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_v)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1924
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:             # <<<<<<<<<<<<<<
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         if out is None:
*/
  __pyx_t_4 = __pyx_v_nv;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "petsc4py/PETSc/Vec.pyx":1925
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec             # <<<<<<<<<<<<<<
 *         if out is None:
 *             out = empty_s(nv)
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vecs, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(41, 1925, __pyx_L1_error)
    __pyx_t_5 = ((struct PyPetscVecObject *)__pyx_t_3)->vec;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_v[__pyx_v_i]) = __pyx_t_5;
  }

  /* "petsc4py/PETSc/Vec.pyx":1926
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         if out is None:             # <<<<<<<<<<<<<<
 *             out = empty_s(nv)
 *         out = oarray_s(out, &no, &val)
*/
  __pyx_t_6 = (__pyx_v_out == Py_None);
  if (__pyx_t_6) {

    /* "petsc4py/PETSc/Vec.pyx":1927
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         if out is None:
 *             out = empty_s(nv)             # <<<<<<<<<<<<<<
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(
*/
    __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_s(__pyx_v_nv)); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1927, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_out, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/Vec.pyx":1926
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         if out is None:             # <<<<<<<<<<<<<<
 *             out = empty_s(nv)
 *         out = oarray_s(out, &no, &val)
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":1928
 *         if out is None:
 *             out = empty_s(nv)
 *         out = oarray_s(out, &no, &val)             # <<<<<<<<<<<<<<
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_v_out, (&__pyx_v_no), (&__pyx_v_val))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_out, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1929
 *             out = empty_s(nv)
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(             # <<<<<<<<<<<<<<
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
*/
  __pyx_t_6 = (__pyx_v_nv != __pyx_v_no);
  if (unlikely(__pyx_t_6)) {
    __pyx_t_2 = NULL;

    /* "petsc4py/PETSc/Vec.pyx":1931
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))             # <<<<<<<<<<<<<<
 *         CHKERR(VecMDot(self.vec, nv, v, val))
 *         return out
*/
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 1931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_7), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 1931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_no); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 1931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_7), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 1931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_incompatible_array_sizes_nv;
    __pyx_t_10[1] = __pyx_t_8;
    __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_no;
    __pyx_t_10[3] = __pyx_t_9;

    /* "petsc4py/PETSc/Vec.pyx":1930
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "             # <<<<<<<<<<<<<<
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
 *         CHKERR(VecMDot(self.vec, nv, v, val))
*/
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9));
    if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 1930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_11 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1929, __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, 1929, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1929
 *             out = empty_s(nv)
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(             # <<<<<<<<<<<<<<
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":1932
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
 *         CHKERR(VecMDot(self.vec, nv, v, val))             # <<<<<<<<<<<<<<
 *         return out
 * 
*/
  __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMDot(__pyx_v_self->vec, __pyx_v_nv, __pyx_v_v, __pyx_v_val)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1932, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1933
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
 *         CHKERR(VecMDot(self.vec, nv, v, val))
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def mDotBegin(self, vecs: Sequence[Vec], out: ArrayScalar) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1902
 *         return toScalar(sval)
 * 
 *     def mDot(self, vecs: Sequence[Vec], out: ArrayScalar | None = None) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Compute Xy with X an array of vectors.
 * 
*/

  /* 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_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("petsc4py.PETSc.Vec.mDot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Vec.pyx":1935
 *         return out
 * 
 *     def mDotBegin(self, vecs: Sequence[Vec], out: ArrayScalar) -> None:             # <<<<<<<<<<<<<<
 *         """Starts a split phase multiple dot product computation.
 * 
*/

/* 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: Sequence[Vec], out: ArrayScalar) -> None\nStarts a split phase multiple dot product computation.\n\n        Collective.\n\n        Parameters\n        ----------\n        vecs\n            Array of vectors.\n        out\n            Placeholder for the result.\n\n        See Also\n        --------\n        mDot, mDotEnd, petsc.VecMDotBegin\n\n        \nSource code at petsc4py/PETSc/Vec.pyx:1935");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_185mDotBegin = {"mDotBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_185mDotBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_184mDotBegin};
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
) {
  PyObject *__pyx_v_vecs = 0;
  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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vecs,&__pyx_mstate_global->__pyx_n_u_out,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1935, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1935, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1935, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "mDotBegin", 0) < (0)) __PYX_ERR(41, 1935, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("mDotBegin", 1, 2, 2, i); __PYX_ERR(41, 1935, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1935, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1935, __pyx_L3_error)
    }
    __pyx_v_vecs = values[0];
    __pyx_v_out = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mDotBegin", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 1935, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_184mDotBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) {
  PetscInt __pyx_v_nv;
  PetscInt __pyx_v_no;
  Vec *__pyx_v_v;
  PetscScalar *__pyx_v_val;
  Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED PyObject *__pyx_v_unused = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PetscInt __pyx_t_4;
  Vec __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10[4];
  size_t __pyx_t_11;
  PetscErrorCode __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mDotBegin", 0);
  __Pyx_INCREF(__pyx_v_out);

  /* "petsc4py/PETSc/Vec.pyx":1952
 * 
 *         """
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0             # <<<<<<<<<<<<<<
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_vecs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(41, 1952, __pyx_L1_error)
  __pyx_v_nv = ((PetscInt)__pyx_t_1);
  __pyx_v_no = 0;

  /* "petsc4py/PETSc/Vec.pyx":1953
 *         """
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0
 *         cdef PetscVec *v=NULL             # <<<<<<<<<<<<<<
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0
*/
  __pyx_v_v = NULL;

  /* "petsc4py/PETSc/Vec.pyx":1954
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
*/
  __pyx_v_val = NULL;

  /* "petsc4py/PETSc/Vec.pyx":1955
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:
*/
  __pyx_v_i = 0;

  /* "petsc4py/PETSc/Vec.pyx":1956
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nv)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1956, __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_v)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1957
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:             # <<<<<<<<<<<<<<
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         out = oarray_s(out, &no, &val)
*/
  __pyx_t_4 = __pyx_v_nv;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "petsc4py/PETSc/Vec.pyx":1958
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec             # <<<<<<<<<<<<<<
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vecs, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1958, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(41, 1958, __pyx_L1_error)
    __pyx_t_5 = ((struct PyPetscVecObject *)__pyx_t_3)->vec;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_v[__pyx_v_i]) = __pyx_t_5;
  }

  /* "petsc4py/PETSc/Vec.pyx":1959
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         out = oarray_s(out, &no, &val)             # <<<<<<<<<<<<<<
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_v_out, (&__pyx_v_no), (&__pyx_v_val))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_out, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1960
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(             # <<<<<<<<<<<<<<
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
*/
  __pyx_t_6 = (__pyx_v_nv != __pyx_v_no);
  if (unlikely(__pyx_t_6)) {
    __pyx_t_2 = NULL;

    /* "petsc4py/PETSc/Vec.pyx":1962
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))             # <<<<<<<<<<<<<<
 *         CHKERR(VecMDotBegin(self.vec, nv, v, val))
 * 
*/
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 1962, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_7), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 1962, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_no); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 1962, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_7), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 1962, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_incompatible_array_sizes_nv;
    __pyx_t_10[1] = __pyx_t_8;
    __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_no;
    __pyx_t_10[3] = __pyx_t_9;

    /* "petsc4py/PETSc/Vec.pyx":1961
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "             # <<<<<<<<<<<<<<
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
 *         CHKERR(VecMDotBegin(self.vec, nv, v, val))
*/
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9));
    if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 1961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_11 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1960, __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, 1960, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1960
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(             # <<<<<<<<<<<<<<
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":1963
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
 *         CHKERR(VecMDotBegin(self.vec, nv, v, val))             # <<<<<<<<<<<<<<
 * 
 *     def mDotEnd(self, vecs: Sequence[Vec], out: ArrayScalar) -> ArrayScalar:
*/
  __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMDotBegin(__pyx_v_self->vec, __pyx_v_nv, __pyx_v_v, __pyx_v_val)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1963, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1935
 *         return out
 * 
 *     def mDotBegin(self, vecs: Sequence[Vec], out: ArrayScalar) -> None:             # <<<<<<<<<<<<<<
 *         """Starts a split phase multiple dot product computation.
 * 
*/

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("petsc4py.PETSc.Vec.mDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Vec.pyx":1965
 *         CHKERR(VecMDotBegin(self.vec, nv, v, val))
 * 
 *     def mDotEnd(self, vecs: Sequence[Vec], out: ArrayScalar) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Ends a split phase multiple dot product computation.
 * 
*/

/* 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: Sequence[Vec], out: ArrayScalar) -> ArrayScalar\nEnds a split phase multiple dot product computation.\n\n        Collective.\n\n        Parameters\n        ----------\n        vecs\n            Array of vectors.\n        out\n            Placeholder for the result.\n\n        See Also\n        --------\n        mDot, mDotBegin, petsc.VecMDotEnd\n\n        \nSource code at petsc4py/PETSc/Vec.pyx:1965");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_187mDotEnd = {"mDotEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_187mDotEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_186mDotEnd};
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
) {
  PyObject *__pyx_v_vecs = 0;
  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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vecs,&__pyx_mstate_global->__pyx_n_u_out,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1965, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1965, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1965, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "mDotEnd", 0) < (0)) __PYX_ERR(41, 1965, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("mDotEnd", 1, 2, 2, i); __PYX_ERR(41, 1965, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1965, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1965, __pyx_L3_error)
    }
    __pyx_v_vecs = values[0];
    __pyx_v_out = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mDotEnd", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 1965, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_186mDotEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) {
  PetscInt __pyx_v_nv;
  PetscInt __pyx_v_no;
  Vec *__pyx_v_v;
  PetscScalar *__pyx_v_val;
  Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED PyObject *__pyx_v_unused = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PetscInt __pyx_t_4;
  Vec __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10[4];
  size_t __pyx_t_11;
  PetscErrorCode __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mDotEnd", 0);
  __Pyx_INCREF(__pyx_v_out);

  /* "petsc4py/PETSc/Vec.pyx":1982
 * 
 *         """
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0             # <<<<<<<<<<<<<<
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_vecs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(41, 1982, __pyx_L1_error)
  __pyx_v_nv = ((PetscInt)__pyx_t_1);
  __pyx_v_no = 0;

  /* "petsc4py/PETSc/Vec.pyx":1983
 *         """
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0
 *         cdef PetscVec *v=NULL             # <<<<<<<<<<<<<<
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0
*/
  __pyx_v_v = NULL;

  /* "petsc4py/PETSc/Vec.pyx":1984
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
*/
  __pyx_v_val = NULL;

  /* "petsc4py/PETSc/Vec.pyx":1985
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:
*/
  __pyx_v_i = 0;

  /* "petsc4py/PETSc/Vec.pyx":1986
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nv)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 1986, __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_v)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1987
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:             # <<<<<<<<<<<<<<
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         out = oarray_s(out, &no, &val)
*/
  __pyx_t_4 = __pyx_v_nv;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "petsc4py/PETSc/Vec.pyx":1988
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec             # <<<<<<<<<<<<<<
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vecs, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1988, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(41, 1988, __pyx_L1_error)
    __pyx_t_5 = ((struct PyPetscVecObject *)__pyx_t_3)->vec;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_v[__pyx_v_i]) = __pyx_t_5;
  }

  /* "petsc4py/PETSc/Vec.pyx":1989
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         out = oarray_s(out, &no, &val)             # <<<<<<<<<<<<<<
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_v_out, (&__pyx_v_no), (&__pyx_v_val))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_out, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1990
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(             # <<<<<<<<<<<<<<
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
*/
  __pyx_t_6 = (__pyx_v_nv != __pyx_v_no);
  if (unlikely(__pyx_t_6)) {
    __pyx_t_2 = NULL;

    /* "petsc4py/PETSc/Vec.pyx":1992
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))             # <<<<<<<<<<<<<<
 *         CHKERR(VecMDotEnd(self.vec, nv, v, val))
 *         return out
*/
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 1992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_7), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 1992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_no); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 1992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_7), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 1992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_incompatible_array_sizes_nv;
    __pyx_t_10[1] = __pyx_t_8;
    __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_no;
    __pyx_t_10[3] = __pyx_t_9;

    /* "petsc4py/PETSc/Vec.pyx":1991
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "             # <<<<<<<<<<<<<<
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
 *         CHKERR(VecMDotEnd(self.vec, nv, v, val))
*/
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9));
    if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 1991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_11 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 1990, __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, 1990, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":1990
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(             # <<<<<<<<<<<<<<
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":1993
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
 *         CHKERR(VecMDotEnd(self.vec, nv, v, val))             # <<<<<<<<<<<<<<
 *         return out
 * 
*/
  __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMDotEnd(__pyx_v_self->vec, __pyx_v_nv, __pyx_v_v, __pyx_v_val)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 1993, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":1994
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
 *         CHKERR(VecMDotEnd(self.vec, nv, v, val))
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def mtDot(self, vecs: Sequence[Vec], out: ArrayScalar | None = None) -> ArrayScalar:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1965
 *         CHKERR(VecMDotBegin(self.vec, nv, v, val))
 * 
 *     def mDotEnd(self, vecs: Sequence[Vec], out: ArrayScalar) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Ends a split phase multiple dot product computation.
 * 
*/

  /* 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_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("petsc4py.PETSc.Vec.mDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Vec.pyx":1996
 *         return out
 * 
 *     def mtDot(self, vecs: Sequence[Vec], out: ArrayScalar | None = None) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Compute Xy with X an array of vectors.
 * 
*/

/* 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: Sequence[Vec], out: ArrayScalar | None = None) -> ArrayScalar\nCompute X\341\265\200\302\267y with X an array of vectors.\n\n        Collective.\n\n        Parameters\n        ----------\n        vecs\n            Array of vectors.\n        out\n            Optional placeholder for the result.\n\n        See Also\n        --------\n        tDot, mDot, mtDotBegin, mtDotEnd, petsc.VecMTDot\n\n        \nSource code at petsc4py/PETSc/Vec.pyx:1996");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_189mtDot = {"mtDot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_189mtDot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_188mtDot};
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
) {
  PyObject *__pyx_v_vecs = 0;
  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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vecs,&__pyx_mstate_global->__pyx_n_u_out,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 1996, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1996, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1996, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "mtDot", 0) < (0)) __PYX_ERR(41, 1996, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("mtDot", 0, 1, 2, i); __PYX_ERR(41, 1996, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 1996, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 1996, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1996, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_188mtDot(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) {
  PetscInt __pyx_v_nv;
  PetscInt __pyx_v_no;
  Vec *__pyx_v_v;
  PetscScalar *__pyx_v_val;
  Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED PyObject *__pyx_v_unused = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PetscInt __pyx_t_4;
  Vec __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10[4];
  size_t __pyx_t_11;
  PetscErrorCode __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mtDot", 0);
  __Pyx_INCREF(__pyx_v_out);

  /* "petsc4py/PETSc/Vec.pyx":2013
 * 
 *         """
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0             # <<<<<<<<<<<<<<
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_vecs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(41, 2013, __pyx_L1_error)
  __pyx_v_nv = ((PetscInt)__pyx_t_1);
  __pyx_v_no = 0;

  /* "petsc4py/PETSc/Vec.pyx":2014
 *         """
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0
 *         cdef PetscVec *v=NULL             # <<<<<<<<<<<<<<
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0
*/
  __pyx_v_v = NULL;

  /* "petsc4py/PETSc/Vec.pyx":2015
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
*/
  __pyx_v_val = NULL;

  /* "petsc4py/PETSc/Vec.pyx":2016
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:
*/
  __pyx_v_i = 0;

  /* "petsc4py/PETSc/Vec.pyx":2017
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nv)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 2017, __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_v)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2018
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:             # <<<<<<<<<<<<<<
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         if out is None:
*/
  __pyx_t_4 = __pyx_v_nv;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "petsc4py/PETSc/Vec.pyx":2019
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec             # <<<<<<<<<<<<<<
 *         if out is None:
 *             out = empty_s(nv)
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vecs, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(41, 2019, __pyx_L1_error)
    __pyx_t_5 = ((struct PyPetscVecObject *)__pyx_t_3)->vec;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_v[__pyx_v_i]) = __pyx_t_5;
  }

  /* "petsc4py/PETSc/Vec.pyx":2020
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         if out is None:             # <<<<<<<<<<<<<<
 *             out = empty_s(nv)
 *         out = oarray_s(out, &no, &val)
*/
  __pyx_t_6 = (__pyx_v_out == Py_None);
  if (__pyx_t_6) {

    /* "petsc4py/PETSc/Vec.pyx":2021
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         if out is None:
 *             out = empty_s(nv)             # <<<<<<<<<<<<<<
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(
*/
    __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_s(__pyx_v_nv)); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_out, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/Vec.pyx":2020
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         if out is None:             # <<<<<<<<<<<<<<
 *             out = empty_s(nv)
 *         out = oarray_s(out, &no, &val)
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":2022
 *         if out is None:
 *             out = empty_s(nv)
 *         out = oarray_s(out, &no, &val)             # <<<<<<<<<<<<<<
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_v_out, (&__pyx_v_no), (&__pyx_v_val))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_out, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2023
 *             out = empty_s(nv)
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(             # <<<<<<<<<<<<<<
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
*/
  __pyx_t_6 = (__pyx_v_nv != __pyx_v_no);
  if (unlikely(__pyx_t_6)) {
    __pyx_t_2 = NULL;

    /* "petsc4py/PETSc/Vec.pyx":2025
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))             # <<<<<<<<<<<<<<
 *         CHKERR(VecMTDot(self.vec, nv, v, val))
 *         return out
*/
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 2025, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_7), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 2025, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_no); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 2025, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_7), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 2025, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_incompatible_array_sizes_nv;
    __pyx_t_10[1] = __pyx_t_8;
    __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_no;
    __pyx_t_10[3] = __pyx_t_9;

    /* "petsc4py/PETSc/Vec.pyx":2024
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "             # <<<<<<<<<<<<<<
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
 *         CHKERR(VecMTDot(self.vec, nv, v, val))
*/
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9));
    if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 2024, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_11 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2023, __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, 2023, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":2023
 *             out = empty_s(nv)
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(             # <<<<<<<<<<<<<<
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":2026
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
 *         CHKERR(VecMTDot(self.vec, nv, v, val))             # <<<<<<<<<<<<<<
 *         return out
 * 
*/
  __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMTDot(__pyx_v_self->vec, __pyx_v_nv, __pyx_v_v, __pyx_v_val)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2026, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2027
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
 *         CHKERR(VecMTDot(self.vec, nv, v, val))
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def mtDotBegin(self, vecs: Sequence[Vec], out: ArrayScalar) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":1996
 *         return out
 * 
 *     def mtDot(self, vecs: Sequence[Vec], out: ArrayScalar | None = None) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Compute Xy with X an array of vectors.
 * 
*/

  /* 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_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDot", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Vec.pyx":2029
 *         return out
 * 
 *     def mtDotBegin(self, vecs: Sequence[Vec], out: ArrayScalar) -> None:             # <<<<<<<<<<<<<<
 *         """Starts a split phase transpose multiple dot product computation.
 * 
*/

/* 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: Sequence[Vec], out: ArrayScalar) -> None\nStarts a split phase transpose multiple dot product computation.\n\n        Collective.\n\n        Parameters\n        ----------\n        vecs\n            Array of vectors.\n        out\n            Placeholder for the result.\n\n        See Also\n        --------\n        mtDot, mtDotEnd, petsc.VecMTDotBegin\n\n        \nSource code at petsc4py/PETSc/Vec.pyx:2029");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_191mtDotBegin = {"mtDotBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_191mtDotBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_190mtDotBegin};
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
) {
  PyObject *__pyx_v_vecs = 0;
  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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vecs,&__pyx_mstate_global->__pyx_n_u_out,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2029, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2029, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2029, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "mtDotBegin", 0) < (0)) __PYX_ERR(41, 2029, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("mtDotBegin", 1, 2, 2, i); __PYX_ERR(41, 2029, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2029, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2029, __pyx_L3_error)
    }
    __pyx_v_vecs = values[0];
    __pyx_v_out = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mtDotBegin", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 2029, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_190mtDotBegin(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) {
  PetscInt __pyx_v_nv;
  PetscInt __pyx_v_no;
  Vec *__pyx_v_v;
  PetscScalar *__pyx_v_val;
  Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED PyObject *__pyx_v_unused = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PetscInt __pyx_t_4;
  Vec __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10[4];
  size_t __pyx_t_11;
  PetscErrorCode __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mtDotBegin", 0);
  __Pyx_INCREF(__pyx_v_out);

  /* "petsc4py/PETSc/Vec.pyx":2046
 * 
 *         """
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0             # <<<<<<<<<<<<<<
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_vecs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(41, 2046, __pyx_L1_error)
  __pyx_v_nv = ((PetscInt)__pyx_t_1);
  __pyx_v_no = 0;

  /* "petsc4py/PETSc/Vec.pyx":2047
 *         """
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0
 *         cdef PetscVec *v=NULL             # <<<<<<<<<<<<<<
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0
*/
  __pyx_v_v = NULL;

  /* "petsc4py/PETSc/Vec.pyx":2048
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
*/
  __pyx_v_val = NULL;

  /* "petsc4py/PETSc/Vec.pyx":2049
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:
*/
  __pyx_v_i = 0;

  /* "petsc4py/PETSc/Vec.pyx":2050
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nv)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 2050, __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_v)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2051
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:             # <<<<<<<<<<<<<<
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         out = oarray_s(out, &no, &val)
*/
  __pyx_t_4 = __pyx_v_nv;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "petsc4py/PETSc/Vec.pyx":2052
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec             # <<<<<<<<<<<<<<
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vecs, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2052, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(41, 2052, __pyx_L1_error)
    __pyx_t_5 = ((struct PyPetscVecObject *)__pyx_t_3)->vec;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_v[__pyx_v_i]) = __pyx_t_5;
  }

  /* "petsc4py/PETSc/Vec.pyx":2053
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         out = oarray_s(out, &no, &val)             # <<<<<<<<<<<<<<
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_v_out, (&__pyx_v_no), (&__pyx_v_val))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_out, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2054
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(             # <<<<<<<<<<<<<<
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
*/
  __pyx_t_6 = (__pyx_v_nv != __pyx_v_no);
  if (unlikely(__pyx_t_6)) {
    __pyx_t_2 = NULL;

    /* "petsc4py/PETSc/Vec.pyx":2056
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))             # <<<<<<<<<<<<<<
 *         CHKERR(VecMTDotBegin(self.vec, nv, v, val))
 * 
*/
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 2056, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_7), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 2056, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_no); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 2056, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_7), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 2056, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_incompatible_array_sizes_nv;
    __pyx_t_10[1] = __pyx_t_8;
    __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_no;
    __pyx_t_10[3] = __pyx_t_9;

    /* "petsc4py/PETSc/Vec.pyx":2055
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "             # <<<<<<<<<<<<<<
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
 *         CHKERR(VecMTDotBegin(self.vec, nv, v, val))
*/
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9));
    if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 2055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_11 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2054, __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, 2054, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":2054
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(             # <<<<<<<<<<<<<<
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":2057
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
 *         CHKERR(VecMTDotBegin(self.vec, nv, v, val))             # <<<<<<<<<<<<<<
 * 
 *     def mtDotEnd(self, vecs: Sequence[Vec], out: ArrayScalar) -> ArrayScalar:
*/
  __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMTDotBegin(__pyx_v_self->vec, __pyx_v_nv, __pyx_v_v, __pyx_v_val)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2057, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2029
 *         return out
 * 
 *     def mtDotBegin(self, vecs: Sequence[Vec], out: ArrayScalar) -> None:             # <<<<<<<<<<<<<<
 *         """Starts a split phase transpose multiple dot product computation.
 * 
*/

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDotBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Vec.pyx":2059
 *         CHKERR(VecMTDotBegin(self.vec, nv, v, val))
 * 
 *     def mtDotEnd(self, vecs: Sequence[Vec], out: ArrayScalar) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Ends a split phase transpose multiple dot product computation.
 * 
*/

/* 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: Sequence[Vec], out: ArrayScalar) -> ArrayScalar\nEnds a split phase transpose multiple dot product computation.\n\n        Collective.\n\n        Parameters\n        ----------\n        vecs\n            Array of vectors.\n        out\n            Placeholder for the result.\n\n        See Also\n        --------\n        mtDot, mtDotBegin, petsc.VecMTDotEnd\n\n        \nSource code at petsc4py/PETSc/Vec.pyx:2059");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_193mtDotEnd = {"mtDotEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_193mtDotEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_192mtDotEnd};
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
) {
  PyObject *__pyx_v_vecs = 0;
  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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vecs,&__pyx_mstate_global->__pyx_n_u_out,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2059, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2059, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2059, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "mtDotEnd", 0) < (0)) __PYX_ERR(41, 2059, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("mtDotEnd", 1, 2, 2, i); __PYX_ERR(41, 2059, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2059, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2059, __pyx_L3_error)
    }
    __pyx_v_vecs = values[0];
    __pyx_v_out = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mtDotEnd", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 2059, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_192mtDotEnd(struct PyPetscVecObject *__pyx_v_self, PyObject *__pyx_v_vecs, PyObject *__pyx_v_out) {
  PetscInt __pyx_v_nv;
  PetscInt __pyx_v_no;
  Vec *__pyx_v_v;
  PetscScalar *__pyx_v_val;
  Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED PyObject *__pyx_v_unused = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PetscInt __pyx_t_4;
  Vec __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10[4];
  size_t __pyx_t_11;
  PetscErrorCode __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mtDotEnd", 0);
  __Pyx_INCREF(__pyx_v_out);

  /* "petsc4py/PETSc/Vec.pyx":2076
 * 
 *         """
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0             # <<<<<<<<<<<<<<
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_vecs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(41, 2076, __pyx_L1_error)
  __pyx_v_nv = ((PetscInt)__pyx_t_1);
  __pyx_v_no = 0;

  /* "petsc4py/PETSc/Vec.pyx":2077
 *         """
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0
 *         cdef PetscVec *v=NULL             # <<<<<<<<<<<<<<
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0
*/
  __pyx_v_v = NULL;

  /* "petsc4py/PETSc/Vec.pyx":2078
 *         cdef PetscInt nv=<PetscInt>len(vecs), no=0
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
*/
  __pyx_v_val = NULL;

  /* "petsc4py/PETSc/Vec.pyx":2079
 *         cdef PetscVec *v=NULL
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:
*/
  __pyx_v_i = 0;

  /* "petsc4py/PETSc/Vec.pyx":2080
 *         cdef PetscScalar *val=NULL
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nv)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 2080, __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_v)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2081
 *         cdef Py_ssize_t i=0
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:             # <<<<<<<<<<<<<<
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         out = oarray_s(out, &no, &val)
*/
  __pyx_t_4 = __pyx_v_nv;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "petsc4py/PETSc/Vec.pyx":2082
 *         cdef object unused = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec             # <<<<<<<<<<<<<<
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vecs, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2082, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(41, 2082, __pyx_L1_error)
    __pyx_t_5 = ((struct PyPetscVecObject *)__pyx_t_3)->vec;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_v[__pyx_v_i]) = __pyx_t_5;
  }

  /* "petsc4py/PETSc/Vec.pyx":2083
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         out = oarray_s(out, &no, &val)             # <<<<<<<<<<<<<<
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_s(__pyx_v_out, (&__pyx_v_no), (&__pyx_v_val))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_out, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2084
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(             # <<<<<<<<<<<<<<
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
*/
  __pyx_t_6 = (__pyx_v_nv != __pyx_v_no);
  if (unlikely(__pyx_t_6)) {
    __pyx_t_2 = NULL;

    /* "petsc4py/PETSc/Vec.pyx":2086
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))             # <<<<<<<<<<<<<<
 *         CHKERR(VecMTDotEnd(self.vec, nv, v, val))
 *         return out
*/
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 2086, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_7), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 2086, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_no); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 2086, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_7), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 2086, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_incompatible_array_sizes_nv;
    __pyx_t_10[1] = __pyx_t_8;
    __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_no;
    __pyx_t_10[3] = __pyx_t_9;

    /* "petsc4py/PETSc/Vec.pyx":2085
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(
 *             ("incompatible array sizes: "             # <<<<<<<<<<<<<<
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
 *         CHKERR(VecMTDotEnd(self.vec, nv, v, val))
*/
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_10, 4, 29 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 5 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9));
    if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 2085, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_11 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 2084, __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, 2084, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":2084
 *             v[i] = (<Vec?>(vecs[i])).vec
 *         out = oarray_s(out, &no, &val)
 *         if (nv != no): raise ValueError(             # <<<<<<<<<<<<<<
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
*/
  }

  /* "petsc4py/PETSc/Vec.pyx":2087
 *             ("incompatible array sizes: "
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
 *         CHKERR(VecMTDotEnd(self.vec, nv, v, val))             # <<<<<<<<<<<<<<
 *         return out
 * 
*/
  __pyx_t_12 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMTDotEnd(__pyx_v_self->vec, __pyx_v_nv, __pyx_v_v, __pyx_v_val)); if (unlikely(__pyx_t_12 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2087, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2088
 *              "nv=%d, no=%d") % (toInt(nv), toInt(no)))
 *         CHKERR(VecMTDotEnd(self.vec, nv, v, val))
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def norm(
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":2059
 *         CHKERR(VecMTDotBegin(self.vec, nv, v, val))
 * 
 *     def mtDotEnd(self, vecs: Sequence[Vec], out: ArrayScalar) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Ends a split phase transpose multiple dot product computation.
 * 
*/

  /* 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_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("petsc4py.PETSc.Vec.mtDotEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Vec.pyx":2090
 *         return out
 * 
 *     def norm(             # <<<<<<<<<<<<<<
 *         self,
 *         norm_type: NormTypeSpec = None) -> float | tuple[float, float]:
*/

/* 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:2090");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_195norm = {"norm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_195norm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_194norm};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_norm_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2090, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2090, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "norm", 0) < (0)) __PYX_ERR(41, 2090, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":2092
 *     def norm(
 *         self,
 *         norm_type: NormTypeSpec = None) -> float | tuple[float, float]:             # <<<<<<<<<<<<<<
 *         """Compute the vector norm.
 * 
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2090, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2090, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":2090
 *         return out
 * 
 *     def norm(             # <<<<<<<<<<<<<<
 *         self,
 *         norm_type: NormTypeSpec = None) -> float | tuple[float, float]:
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2104
 * 
 *         """
 *         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":2105
 *         """
 *         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":2106
 *         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_PyLong_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2106, __pyx_L1_error)
    __pyx_v_ntype = __pyx_t_2;
  }

  /* "petsc4py/PETSc/Vec.pyx":2108
 *         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, 2108, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2109
 *         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, 2109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/Vec.pyx":2110
 *         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, 2110, __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, 2110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 2110, __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) != (0)) __PYX_ERR(41, 2110, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5) != (0)) __PYX_ERR(41, 2110, __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":2090
 *         return out
 * 
 *     def norm(             # <<<<<<<<<<<<<<
 *         self,
 *         norm_type: NormTypeSpec = None) -> float | tuple[float, float]:
*/

  /* 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":2112
 *         else: return (toReal(rval[0]), toReal(rval[1]))
 * 
 *     def normBegin(             # <<<<<<<<<<<<<<
 *         self,
 *         norm_type: NormTypeSpec = None) -> 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:2112");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_197normBegin = {"normBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_197normBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_196normBegin};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_norm_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2112, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2112, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "normBegin", 0) < (0)) __PYX_ERR(41, 2112, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":2114
 *     def normBegin(
 *         self,
 *         norm_type: NormTypeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Begin computing the vector norm.
 * 
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2112, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2112, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":2112
 *         else: return (toReal(rval[0]), toReal(rval[1]))
 * 
 *     def normBegin(             # <<<<<<<<<<<<<<
 *         self,
 *         norm_type: NormTypeSpec = None) -> None:
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2126
 * 
 *         """
 *         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":2127
 *         """
 *         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_PyLong_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2127, __pyx_L1_error)
    __pyx_v_ntype = __pyx_t_2;
  }

  /* "petsc4py/PETSc/Vec.pyx":2129
 *         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, 2129, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2112
 *         else: return (toReal(rval[0]), toReal(rval[1]))
 * 
 *     def normBegin(             # <<<<<<<<<<<<<<
 *         self,
 *         norm_type: NormTypeSpec = None) -> 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":2131
 *         CHKERR(VecNormBegin(self.vec, ntype, dummy))
 * 
 *     def normEnd(             # <<<<<<<<<<<<<<
 *         self,
 *         norm_type: NormTypeSpec = None) -> float | tuple[float, float]:
*/

/* 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:2131");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_199normEnd = {"normEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_199normEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_198normEnd};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_norm_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2131, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2131, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "normEnd", 0) < (0)) __PYX_ERR(41, 2131, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":2133
 *     def normEnd(
 *         self,
 *         norm_type: NormTypeSpec = None) -> float | tuple[float, float]:             # <<<<<<<<<<<<<<
 *         """Finish computations initiated with `normBegin`.
 * 
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2131, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2131, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":2131
 *         CHKERR(VecNormBegin(self.vec, ntype, dummy))
 * 
 *     def normEnd(             # <<<<<<<<<<<<<<
 *         self,
 *         norm_type: NormTypeSpec = None) -> float | tuple[float, float]:
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2143
 * 
 *         """
 *         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":2144
 *         """
 *         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":2145
 *         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_PyLong_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 2145, __pyx_L1_error)
    __pyx_v_ntype = __pyx_t_2;
  }

  /* "petsc4py/PETSc/Vec.pyx":2147
 *         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, 2147, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2148
 *         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, 2148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/Vec.pyx":2149
 *         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, 2149, __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, 2149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(41, 2149, __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) != (0)) __PYX_ERR(41, 2149, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5) != (0)) __PYX_ERR(41, 2149, __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":2131
 *         CHKERR(VecNormBegin(self.vec, ntype, dummy))
 * 
 *     def normEnd(             # <<<<<<<<<<<<<<
 *         self,
 *         norm_type: NormTypeSpec = None) -> float | tuple[float, float]:
*/

  /* 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":2151
 *         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:2151");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_201dotNorm2 = {"dotNorm2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_201dotNorm2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_200dotNorm2};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2151, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2151, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "dotNorm2", 0) < (0)) __PYX_ERR(41, 2151, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("dotNorm2", 1, 1, 1, i); __PYX_ERR(41, 2151, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2151, __pyx_L3_error)
    }
    __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, 2151, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 2151, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2161
 * 
 *         """
 *         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":2162
 *         """
 *         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":2163
 *         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, 2163, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2164
 *         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, 2164, __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, 2164, __pyx_L1_error)
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 2164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 2164, __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) != (0)) __PYX_ERR(41, 2164, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(41, 2164, __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":2151
 *         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":2166
 *         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:2166");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_203sum = {"sum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_203sum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_202sum};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("sum", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2176
 * 
 *         """
 *         cdef PetscScalar sval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(VecSum(self.vec, &sval))
 *         return toScalar(sval)
*/
  __pyx_v_sval = 0.0;

  /* "petsc4py/PETSc/Vec.pyx":2177
 *         """
 *         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, 2177, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2178
 *         cdef PetscScalar sval = 0
 *         CHKERR(VecSum(self.vec, &sval))
 *         return toScalar(sval)             # <<<<<<<<<<<<<<
 * 
 *     def mean(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, 2178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":2166
 *         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":2180
 *         return toScalar(sval)
 * 
 *     def mean(self) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Return the arithmetic mean of all the entries of the vector.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_205mean(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_204mean, "Vec.mean(self) -> Scalar\nReturn the arithmetic mean of all the entries of the vector.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.VecMean\n\n        \nSource code at petsc4py/PETSc/Vec.pyx:2180");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_205mean = {"mean", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_205mean, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_204mean};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_205mean(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mean (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("mean", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("mean", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_204mean(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_204mean(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("mean", 0);

  /* "petsc4py/PETSc/Vec.pyx":2190
 * 
 *         """
 *         cdef PetscScalar sval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(VecMean(self.vec, &sval))
 *         return toScalar(sval)
*/
  __pyx_v_sval = 0.0;

  /* "petsc4py/PETSc/Vec.pyx":2191
 *         """
 *         cdef PetscScalar sval = 0
 *         CHKERR(VecMean(self.vec, &sval))             # <<<<<<<<<<<<<<
 *         return toScalar(sval)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecMean(__pyx_v_self->vec, (&__pyx_v_sval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2191, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2192
 *         cdef PetscScalar sval = 0
 *         CHKERR(VecMean(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, 2192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":2180
 *         return toScalar(sval)
 * 
 *     def mean(self) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Return the arithmetic mean of all the entries of the vector.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Vec.mean", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Vec.pyx":2194
 *         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_207min(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_206min, "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:2194");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_207min = {"min", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_207min, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_206min};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_207min(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("min", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_206min(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_206min(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2212
 * 
 *         """
 *         cdef PetscInt  ival = 0             # <<<<<<<<<<<<<<
 *         cdef PetscReal rval = 0
 *         CHKERR(VecMin(self.vec, &ival, &rval))
*/
  __pyx_v_ival = 0;

  /* "petsc4py/PETSc/Vec.pyx":2213
 *         """
 *         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":2214
 *         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, 2214, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2215
 *         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, 2215, __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, 2215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 2215, __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) != (0)) __PYX_ERR(41, 2215, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(41, 2215, __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":2194
 *         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":2217
 *         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_209max(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_208max, "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:2217");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_209max = {"max", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_209max, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_208max};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_209max(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("max", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_208max(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_208max(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2235
 * 
 *         """
 *         cdef PetscInt  ival = 0             # <<<<<<<<<<<<<<
 *         cdef PetscReal rval = 0
 *         CHKERR(VecMax(self.vec, &ival, &rval))
*/
  __pyx_v_ival = 0;

  /* "petsc4py/PETSc/Vec.pyx":2236
 *         """
 *         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":2237
 *         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, 2237, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2238
 *         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, 2238, __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, 2238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 2238, __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) != (0)) __PYX_ERR(41, 2238, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(41, 2238, __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":2217
 *         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":2240
 *         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_211normalize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_210normalize, "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:2240");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_211normalize = {"normalize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_211normalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_210normalize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_211normalize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("normalize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_210normalize(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_210normalize(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2255
 * 
 *         """
 *         cdef PetscReal rval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(VecNormalize(self.vec, &rval))
 *         return toReal(rval)
*/
  __pyx_v_rval = 0.0;

  /* "petsc4py/PETSc/Vec.pyx":2256
 *         """
 *         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, 2256, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2257
 *         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, 2257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":2240
 *         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":2259
 *         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_213reciprocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_212reciprocal, "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:2259");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_213reciprocal = {"reciprocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_213reciprocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_212reciprocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_213reciprocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("reciprocal", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_212reciprocal(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_212reciprocal(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2269
 * 
 *         """
 *         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, 2269, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2259
 *         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":2271
 *         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_215exp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_214exp, "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:2271");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_215exp = {"exp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_215exp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_214exp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_215exp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("exp", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_214exp(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_214exp(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2281
 * 
 *         """
 *         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, 2281, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2271
 *         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":2283
 *         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_217log(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_216log, "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:2283");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_217log = {"log", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_217log, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_216log};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_217log(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("log", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_216log(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_216log(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2293
 * 
 *         """
 *         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, 2293, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2283
 *         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":2295
 *         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_219sqrtabs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_218sqrtabs, "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:2295");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_219sqrtabs = {"sqrtabs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_219sqrtabs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_218sqrtabs};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_219sqrtabs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("sqrtabs", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_218sqrtabs(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_218sqrtabs(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2305
 * 
 *         """
 *         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, 2305, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2295
 *         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":2307
 *         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_221abs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_220abs, "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:2307");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_221abs = {"abs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_221abs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_220abs};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_221abs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("abs", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_220abs(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_220abs(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2317
 * 
 *         """
 *         CHKERR(VecAbs(self.vec))             # <<<<<<<<<<<<<<
 * 
 *     def conjugate(self) -> None:
*/
  __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, 2317, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2307
 *         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":2319
 *         CHKERR(VecAbs(self.vec))
 * 
 *     def conjugate(self) -> None:             # <<<<<<<<<<<<<<
 *         """Conjugate the vector.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_223conjugate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_222conjugate, "Vec.conjugate(self) -> None\nConjugate the vector.\n\n        Logically collective.\n\n        See Also\n        --------\n        petsc.VecConjugate\n\n        \nSource code at petsc4py/PETSc/Vec.pyx:2319");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_223conjugate = {"conjugate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_223conjugate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_222conjugate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_223conjugate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("conjugate", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_222conjugate(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_222conjugate(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2329
 * 
 *         """
 *         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, 2329, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2319
 *         CHKERR(VecAbs(self.vec))
 * 
 *     def conjugate(self) -> None:             # <<<<<<<<<<<<<<
 *         """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":2331
 *         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_225setRandom(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_224setRandom, "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:2331");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_225setRandom = {"setRandom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_225setRandom, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_224setRandom};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_225setRandom(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_random,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2331, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRandom", 0) < (0)) __PYX_ERR(41, 2331, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscRandomObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2331, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscRandomObject *)Py_None));
    }
    __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, 2331, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random, 1, "random", 0))) __PYX_ERR(41, 2331, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_224setRandom(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_random);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_224setRandom(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2347
 * 
 *         """
 *         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":2348
 *         """
 *         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":2349
 *         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, 2349, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2331
 *         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":2351
 *         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_227permute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_226permute, "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:2351");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_227permute = {"permute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_227permute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_226permute};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_227permute(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_order,&__pyx_mstate_global->__pyx_n_u_invert,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2351, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2351, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2351, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "permute", 0) < (0)) __PYX_ERR(41, 2351, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("permute", 0, 1, 2, i); __PYX_ERR(41, 2351, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2351, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2351, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __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, 2351, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "order", 0))) __PYX_ERR(41, 2351, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_226permute(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_order, __pyx_v_invert);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_226permute(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2368
 * 
 *         """
 *         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":2369
 *         """
 *         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, 2369, __pyx_L1_error)
  if (__pyx_t_1) {
    __pyx_v_cinvert = PETSC_TRUE;
  }

  /* "petsc4py/PETSc/Vec.pyx":2370
 *         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, 2370, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2351
 *         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":2372
 *         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_229zeroEntries(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_228zeroEntries, "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:2372");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_229zeroEntries = {"zeroEntries", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_229zeroEntries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_228zeroEntries};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_229zeroEntries(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("zeroEntries", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_228zeroEntries(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_228zeroEntries(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2382
 * 
 *         """
 *         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, 2382, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2372
 *         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":2384
 *         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_231set(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_230set, "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:2384");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_231set = {"set", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_231set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_230set};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_231set(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_alpha,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2384, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2384, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set", 0) < (0)) __PYX_ERR(41, 2384, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set", 1, 1, 1, i); __PYX_ERR(41, 2384, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2384, __pyx_L3_error)
    }
    __pyx_v_alpha = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 2384, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_230set(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_230set(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2394
 * 
 *         """
 *         cdef PetscScalar sval = asScalar(alpha)             # <<<<<<<<<<<<<<
 *         CHKERR(VecSet(self.vec, sval))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(41, 2394, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":2395
 *         """
 *         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, 2395, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2384
 *         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":2397
 *         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_233isset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_232isset, "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:2397");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_233isset = {"isset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_233isset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_232isset};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_233isset(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_idx,&__pyx_mstate_global->__pyx_n_u_alpha,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2397, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2397, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2397, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "isset", 0) < (0)) __PYX_ERR(41, 2397, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("isset", 1, 2, 2, i); __PYX_ERR(41, 2397, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2397, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2397, __pyx_L3_error)
    }
    __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, 2397, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "idx", 0))) __PYX_ERR(41, 2397, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_232isset(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_idx, __pyx_v_alpha);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_232isset(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2414
 * 
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(41, 2414, __pyx_L1_error)
  __pyx_v_aval = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":2415
 *         """
 *         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, 2415, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2397
 *         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":2417
 *         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_235scale(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_234scale, "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:2417");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_235scale = {"scale", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_235scale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_234scale};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_235scale(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_alpha,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2417, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2417, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scale", 0) < (0)) __PYX_ERR(41, 2417, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scale", 1, 1, 1, i); __PYX_ERR(41, 2417, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2417, __pyx_L3_error)
    }
    __pyx_v_alpha = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scale", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 2417, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_234scale(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_234scale(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2434
 * 
 *         """
 *         cdef PetscScalar sval = asScalar(alpha)             # <<<<<<<<<<<<<<
 *         CHKERR(VecScale(self.vec, sval))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(41, 2434, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":2435
 *         """
 *         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, 2435, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2417
 *         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":2437
 *         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_237shift(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_236shift, "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:2437");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_237shift = {"shift", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_237shift, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_236shift};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_237shift(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_alpha,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2437, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2437, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "shift", 0) < (0)) __PYX_ERR(41, 2437, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("shift", 1, 1, 1, i); __PYX_ERR(41, 2437, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2437, __pyx_L3_error)
    }
    __pyx_v_alpha = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("shift", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 2437, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_236shift(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_236shift(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2454
 * 
 *         """
 *         cdef PetscScalar sval = asScalar(alpha)             # <<<<<<<<<<<<<<
 *         CHKERR(VecShift(self.vec, sval))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(41, 2454, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":2455
 *         """
 *         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, 2455, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2437
 *         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":2457
 *         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_239swap(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_238swap, "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:2457");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_239swap = {"swap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_239swap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_238swap};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_239swap(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2457, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "swap", 0) < (0)) __PYX_ERR(41, 2457, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("swap", 1, 1, 1, i); __PYX_ERR(41, 2457, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2457, __pyx_L3_error)
    }
    __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, 2457, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 2457, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_238swap(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_238swap(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2472
 * 
 *         """
 *         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, 2472, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2457
 *         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":2474
 *         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_241axpy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_240axpy, "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:2474");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_241axpy = {"axpy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_241axpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_240axpy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_241axpy(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2474, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2474, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2474, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "axpy", 0) < (0)) __PYX_ERR(41, 2474, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("axpy", 1, 2, 2, i); __PYX_ERR(41, 2474, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2474, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2474, __pyx_L3_error)
    }
    __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, 2474, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2474, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_240axpy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_x);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_240axpy(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2491
 * 
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(41, 2491, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":2492
 *         """
 *         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, 2492, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2474
 *         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":2494
 *         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_243isaxpy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_242isaxpy, "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:2494");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_243isaxpy = {"isaxpy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_243isaxpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_242isaxpy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_243isaxpy(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_idx,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2494, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2494, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2494, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2494, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "isaxpy", 0) < (0)) __PYX_ERR(41, 2494, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("isaxpy", 1, 3, 3, i); __PYX_ERR(41, 2494, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2494, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2494, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2494, __pyx_L3_error)
    }
    __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, 2494, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "idx", 0))) __PYX_ERR(41, 2494, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2494, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_242isaxpy(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_242isaxpy(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2515
 * 
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(41, 2515, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":2516
 *         """
 *         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, 2516, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2494
 *         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":2518
 *         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_245aypx(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_244aypx, "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:2518");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_245aypx = {"aypx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_245aypx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_244aypx};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_245aypx(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2518, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2518, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2518, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "aypx", 0) < (0)) __PYX_ERR(41, 2518, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("aypx", 1, 2, 2, i); __PYX_ERR(41, 2518, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2518, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2518, __pyx_L3_error)
    }
    __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, 2518, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2518, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_244aypx(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alpha, __pyx_v_x);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_244aypx(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2535
 * 
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(41, 2535, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":2536
 *         """
 *         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, 2536, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2518
 *         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":2538
 *         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_247axpby(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_246axpby, "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:2538");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_247axpby = {"axpby", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_247axpby, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_246axpby};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_247axpby(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_beta,&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2538, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2538, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2538, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2538, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "axpby", 0) < (0)) __PYX_ERR(41, 2538, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("axpby", 1, 3, 3, i); __PYX_ERR(41, 2538, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2538, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2538, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2538, __pyx_L3_error)
    }
    __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, 2538, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2538, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_246axpby(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_246axpby(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2557
 * 
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(41, 2557, __pyx_L1_error)
  __pyx_v_sval1 = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":2558
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(41, 2558, __pyx_L1_error)
  __pyx_v_sval2 = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":2559
 *         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, 2559, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2538
 *         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":2561
 *         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_249waxpy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_248waxpy, "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:2561");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_249waxpy = {"waxpy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_249waxpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_248waxpy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_249waxpy(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2561, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "waxpy", 0) < (0)) __PYX_ERR(41, 2561, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("waxpy", 1, 3, 3, i); __PYX_ERR(41, 2561, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2561, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2561, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2561, __pyx_L3_error)
    }
    __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, 2561, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2561, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(41, 2561, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_248waxpy(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_248waxpy(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2580
 * 
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(41, 2580, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":2581
 *         """
 *         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, 2581, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2561
 *         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":2583
 *         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_251maxpy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_250maxpy, "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:2583");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_251maxpy = {"maxpy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_251maxpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_250maxpy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_251maxpy(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_alphas,&__pyx_mstate_global->__pyx_n_u_vecs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2583, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2583, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2583, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "maxpy", 0) < (0)) __PYX_ERR(41, 2583, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("maxpy", 1, 2, 2, i); __PYX_ERR(41, 2583, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2583, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2583, __pyx_L3_error)
    }
    __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, 2583, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_250maxpy(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_alphas, __pyx_v_vecs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_250maxpy(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_unused1 = 0;
  CYTHON_UNUSED PyObject *__pyx_v_unused2 = 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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2602
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         cdef PetscScalar *a = NULL
 *         cdef PetscVec *v = NULL
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/Vec.pyx":2603
 *         """
 *         cdef PetscInt n = 0
 *         cdef PetscScalar *a = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscVec *v = NULL
 *         cdef object unused1 = iarray_s(alphas, &n, &a)
*/
  __pyx_v_a = NULL;

  /* "petsc4py/PETSc/Vec.pyx":2604
 *         cdef PetscInt n = 0
 *         cdef PetscScalar *a = NULL
 *         cdef PetscVec *v = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused1 = iarray_s(alphas, &n, &a)
 *         cdef object unused2 = oarray_p(empty_p(n), NULL, <void**>&v)
*/
  __pyx_v_v = NULL;

  /* "petsc4py/PETSc/Vec.pyx":2605
 *         cdef PetscScalar *a = NULL
 *         cdef PetscVec *v = NULL
 *         cdef object unused1 = iarray_s(alphas, &n, &a)             # <<<<<<<<<<<<<<
 *         cdef object unused2 = oarray_p(empty_p(n), NULL, <void**>&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, 2605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_unused1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2606
 *         cdef PetscVec *v = NULL
 *         cdef object unused1 = iarray_s(alphas, &n, &a)
 *         cdef object unused2 = oarray_p(empty_p(n), NULL, <void**>&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, 2606, __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, 2606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_unused2 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2607
 *         cdef object unused1 = iarray_s(alphas, &n, &a)
 *         cdef object unused2 = oarray_p(empty_p(n), NULL, <void**>&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, 2607, __pyx_L1_error)
    __pyx_t_4 = (__pyx_v_n == __pyx_t_3);
    if (unlikely(!__pyx_t_4)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(41, 2607, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(41, 2607, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/Vec.pyx":2608
 *         cdef object unused2 = oarray_p(empty_p(n), NULL, <void**>&v)
 *         assert n == len(vecs)
 *         cdef Py_ssize_t i=0             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < n:
 *             v[i] = (<Vec?>(vecs[i])).vec
*/
  __pyx_v_i = 0;

  /* "petsc4py/PETSc/Vec.pyx":2609
 *         assert n == len(vecs)
 *         cdef Py_ssize_t i=0
 *         for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *             v[i] = (<Vec?>(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":2610
 *         cdef Py_ssize_t i=0
 *         for i from 0 <= i < n:
 *             v[i] = (<Vec?>(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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 2610, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(41, 2610, __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":2611
 *         for i from 0 <= i < n:
 *             v[i] = (<Vec?>(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, 2611, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2583
 *         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_unused1);
  __Pyx_XDECREF(__pyx_v_unused2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Vec.pyx":2613
 *         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_253pointwiseMult(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_252pointwiseMult, "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:2613");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_253pointwiseMult = {"pointwiseMult", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_253pointwiseMult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_252pointwiseMult};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_253pointwiseMult(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2613, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2613, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2613, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "pointwiseMult", 0) < (0)) __PYX_ERR(41, 2613, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("pointwiseMult", 1, 2, 2, i); __PYX_ERR(41, 2613, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2613, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2613, __pyx_L3_error)
    }
    __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, 2613, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2613, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(41, 2613, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_252pointwiseMult(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_252pointwiseMult(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2630
 * 
 *         """
 *         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, 2630, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2613
 *         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":2632
 *         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_255pointwiseDivide(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_254pointwiseDivide, "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:2632");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_255pointwiseDivide = {"pointwiseDivide", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_255pointwiseDivide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_254pointwiseDivide};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_255pointwiseDivide(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2632, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2632, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2632, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "pointwiseDivide", 0) < (0)) __PYX_ERR(41, 2632, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("pointwiseDivide", 1, 2, 2, i); __PYX_ERR(41, 2632, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2632, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2632, __pyx_L3_error)
    }
    __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, 2632, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2632, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(41, 2632, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_254pointwiseDivide(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_254pointwiseDivide(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2651
 * 
 *         """
 *         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, 2651, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2632
 *         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":2653
 *         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_257pointwiseMin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_256pointwiseMin, "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:2653");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_257pointwiseMin = {"pointwiseMin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_257pointwiseMin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_256pointwiseMin};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_257pointwiseMin(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2653, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2653, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2653, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "pointwiseMin", 0) < (0)) __PYX_ERR(41, 2653, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("pointwiseMin", 1, 2, 2, i); __PYX_ERR(41, 2653, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2653, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2653, __pyx_L3_error)
    }
    __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, 2653, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2653, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(41, 2653, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_256pointwiseMin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_256pointwiseMin(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2670
 * 
 *         """
 *         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, 2670, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2653
 *         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":2672
 *         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_259pointwiseMax(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_258pointwiseMax, "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:2672");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_259pointwiseMax = {"pointwiseMax", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_259pointwiseMax, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_258pointwiseMax};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_259pointwiseMax(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2672, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2672, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2672, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "pointwiseMax", 0) < (0)) __PYX_ERR(41, 2672, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("pointwiseMax", 1, 2, 2, i); __PYX_ERR(41, 2672, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2672, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2672, __pyx_L3_error)
    }
    __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, 2672, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2672, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(41, 2672, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_258pointwiseMax(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_258pointwiseMax(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2689
 * 
 *         """
 *         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, 2689, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2672
 *         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":2691
 *         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_261pointwiseMaxAbs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_260pointwiseMaxAbs, "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:2691");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_261pointwiseMaxAbs = {"pointwiseMaxAbs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_261pointwiseMaxAbs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_260pointwiseMaxAbs};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_261pointwiseMaxAbs(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2691, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2691, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2691, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "pointwiseMaxAbs", 0) < (0)) __PYX_ERR(41, 2691, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("pointwiseMaxAbs", 1, 2, 2, i); __PYX_ERR(41, 2691, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2691, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2691, __pyx_L3_error)
    }
    __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, 2691, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(41, 2691, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(41, 2691, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_260pointwiseMaxAbs(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_260pointwiseMaxAbs(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2708
 * 
 *         """
 *         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, 2708, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2691
 *         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":2710
 *         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_263maxPointwiseDivide(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_262maxPointwiseDivide, "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:2710");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_263maxPointwiseDivide = {"maxPointwiseDivide", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_263maxPointwiseDivide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_262maxPointwiseDivide};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_263maxPointwiseDivide(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2710, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2710, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "maxPointwiseDivide", 0) < (0)) __PYX_ERR(41, 2710, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("maxPointwiseDivide", 1, 1, 1, i); __PYX_ERR(41, 2710, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2710, __pyx_L3_error)
    }
    __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, 2710, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 2710, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_262maxPointwiseDivide(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_vec);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_262maxPointwiseDivide(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2730
 * 
 *         """
 *         cdef PetscReal rval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(VecMaxPointwiseDivide(self.vec, vec.vec, &rval))
 *         return toReal(rval)
*/
  __pyx_v_rval = 0.0;

  /* "petsc4py/PETSc/Vec.pyx":2731
 *         """
 *         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, 2731, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2732
 *         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, 2732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":2710
 *         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":2734
 *         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_265getValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_264getValue, "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:2734");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_265getValue = {"getValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_265getValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_264getValue};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_265getValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_index,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2734, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2734, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getValue", 0) < (0)) __PYX_ERR(41, 2734, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getValue", 1, 1, 1, i); __PYX_ERR(41, 2734, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2734, __pyx_L3_error)
    }
    __pyx_v_index = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getValue", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 2734, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_264getValue(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_index);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_264getValue(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2751
 * 
 *         """
 *         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, 2751, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":2752
 *         """
 *         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":2753
 *         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, 2753, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2754
 *         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, 2754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":2734
 *         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":2756
 *         return toScalar(sval)
 * 
 *     def getValues(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_267getValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_266getValues, "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:2756");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_267getValues = {"getValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_267getValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_266getValues};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_267getValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_values,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2756, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2756, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2756, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getValues", 0) < (0)) __PYX_ERR(41, 2756, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":2759
 *         self,
 *         indices: Sequence[int],
 *         values: Sequence[Scalar] | None = None) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Return values from certain locations in the vector.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getValues", 0, 1, 2, i); __PYX_ERR(41, 2756, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2756, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2756, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2756, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_266getValues(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values);

  /* "petsc4py/PETSc/Vec.pyx":2756
 *         return toScalar(sval)
 * 
 *     def getValues(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_266getValues(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2779
 * 
 *         """
 *         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, 2779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":2756
 *         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":2781
 *         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_269getValuesStagStencil(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_268getValuesStagStencil, "Vec.getValuesStagStencil(self, indices, values=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Vec.pyx:2781");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_269getValuesStagStencil = {"getValuesStagStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_269getValuesStagStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_268getValuesStagStencil};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_269getValuesStagStencil(PyObject *__pyx_v_self, 
#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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_values,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2781, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2781, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2781, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getValuesStagStencil", 0) < (0)) __PYX_ERR(41, 2781, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getValuesStagStencil", 0, 1, 2, i); __PYX_ERR(41, 2781, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2781, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2781, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2781, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_268getValuesStagStencil(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_268getValuesStagStencil(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2783
 *     def getValuesStagStencil(self, indices, values=None) -> None:
 *         """Not implemented."""
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def setValue(
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(41, 2783, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2781
 *         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":2785
 *         raise NotImplementedError
 * 
 *     def setValue(             # <<<<<<<<<<<<<<
 *         self,
 *         index: int,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_271setValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_270setValue, "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:2785");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_271setValue = {"setValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_271setValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_270setValue};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_271setValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_index,&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2785, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2785, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2785, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2785, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValue", 0) < (0)) __PYX_ERR(41, 2785, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":2789
 *         index: int,
 *         value: Scalar,
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Insert or add a single value in the vector.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValue", 0, 2, 3, i); __PYX_ERR(41, 2785, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2785, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2785, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2785, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2785, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_270setValue(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_index, __pyx_v_value, __pyx_v_addv);

  /* "petsc4py/PETSc/Vec.pyx":2785
 *         raise NotImplementedError
 * 
 *     def setValue(             # <<<<<<<<<<<<<<
 *         self,
 *         index: int,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_270setValue(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2817
 * 
 *         """
 *         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, 2817, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":2818
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_2, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(41, 2818, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_2;

  /* "petsc4py/PETSc/Vec.pyx":2819
 *         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, 2819, __pyx_L1_error)
  __pyx_v_caddv = __pyx_t_3;

  /* "petsc4py/PETSc/Vec.pyx":2820
 *         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, 2820, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2785
 *         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":2822
 *         CHKERR(VecSetValues(self.vec, 1, &ival, &sval, caddv))
 * 
 *     def setValues(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_273setValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_272setValues, "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:2822");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_273setValues = {"setValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_273setValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_272setValues};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_273setValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2822, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2822, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2822, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2822, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValues", 0) < (0)) __PYX_ERR(41, 2822, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":2826
 *         indices: Sequence[int],
 *         values: Sequence[Scalar],
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Insert or add multiple values in the vector.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValues", 0, 2, 3, i); __PYX_ERR(41, 2822, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2822, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2822, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2822, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2822, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_272setValues(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv);

  /* "petsc4py/PETSc/Vec.pyx":2822
 *         CHKERR(VecSetValues(self.vec, 1, &ival, &sval, caddv))
 * 
 *     def setValues(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_272setValues(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2854
 * 
 *         """
 *         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, 2854, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2822
 *         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":2856
 *         vecsetvalues(self.vec, indices, values, addv, 0, 0)
 * 
 *     def setValuesBlocked(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_275setValuesBlocked(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_274setValuesBlocked, "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:2856");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_275setValuesBlocked = {"setValuesBlocked", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_275setValuesBlocked, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_274setValuesBlocked};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_275setValuesBlocked(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2856, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2856, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2856, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2856, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesBlocked", 0) < (0)) __PYX_ERR(41, 2856, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":2860
 *         indices: Sequence[int],
 *         values: Sequence[Scalar],
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Insert or add blocks of values in the vector.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 2, 3, i); __PYX_ERR(41, 2856, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2856, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2856, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2856, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2856, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_274setValuesBlocked(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv);

  /* "petsc4py/PETSc/Vec.pyx":2856
 *         vecsetvalues(self.vec, indices, values, addv, 0, 0)
 * 
 *     def setValuesBlocked(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_274setValuesBlocked(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2892
 * 
 *         """
 *         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, 2892, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2856
 *         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":2894
 *         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_277setValuesStagStencil(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_276setValuesStagStencil, "Vec.setValuesStagStencil(self, indices, values, addv=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Vec.pyx:2894");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_277setValuesStagStencil = {"setValuesStagStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_277setValuesStagStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_276setValuesStagStencil};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_277setValuesStagStencil(PyObject *__pyx_v_self, 
#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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2894, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2894, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2894, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2894, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesStagStencil", 0) < (0)) __PYX_ERR(41, 2894, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesStagStencil", 0, 2, 3, i); __PYX_ERR(41, 2894, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2894, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2894, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2894, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2894, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_276setValuesStagStencil(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_276setValuesStagStencil(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2896
 *     def setValuesStagStencil(self, indices, values, addv=None) -> None:
 *         """Not implemented."""
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def setLGMap(self, LGMap lgmap) -> None:
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(41, 2896, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2894
 *         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":2898
 *         raise NotImplementedError
 * 
 *     def setLGMap(self, LGMap lgmap) -> None:             # <<<<<<<<<<<<<<
 *         """Set the local-to-global mapping.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_279setLGMap(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_278setLGMap, "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:2898");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_279setLGMap = {"setLGMap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_279setLGMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_278setLGMap};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_279setLGMap(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_lgmap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2898, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2898, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLGMap", 0) < (0)) __PYX_ERR(41, 2898, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLGMap", 1, 1, 1, i); __PYX_ERR(41, 2898, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2898, __pyx_L3_error)
    }
    __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, 2898, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, 0, "lgmap", 0))) __PYX_ERR(41, 2898, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_278setLGMap(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_lgmap);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_278setLGMap(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2911
 * 
 *         """
 *         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, 2911, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2898
 *         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":2913
 *         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_281getLGMap(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_280getLGMap, "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:2913");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_281getLGMap = {"getLGMap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_281getLGMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_280getLGMap};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_281getLGMap(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLGMap", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_280getLGMap(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_280getLGMap(struct PyPetscVecObject *__pyx_v_self) {
  struct PyPetscLGMapObject *__pyx_v_cmap = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLGMap", 0);

  /* "petsc4py/PETSc/Vec.pyx":2923
 * 
 *         """
 *         cdef LGMap cmap = LGMap()             # <<<<<<<<<<<<<<
 *         CHKERR(VecGetLocalToGlobalMapping(self.vec, &cmap.lgm))
 *         CHKERR(PetscINCREF(cmap.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 2923, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_cmap = ((struct PyPetscLGMapObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2924
 *         """
 *         cdef LGMap cmap = LGMap()
 *         CHKERR(VecGetLocalToGlobalMapping(self.vec, &cmap.lgm))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(cmap.obj))
 *         return cmap
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetLocalToGlobalMapping(__pyx_v_self->vec, (&__pyx_v_cmap->lgm))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2924, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2925
 *         cdef LGMap cmap = LGMap()
 *         CHKERR(VecGetLocalToGlobalMapping(self.vec, &cmap.lgm))
 *         CHKERR(PetscINCREF(cmap.obj))             # <<<<<<<<<<<<<<
 *         return cmap
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_cmap->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 2925, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2926
 *         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":2913
 *         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_XDECREF(__pyx_t_2);
  __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":2928
 *         return cmap
 * 
 *     def setValueLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         index: int,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_283setValueLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_282setValueLocal, "Vec.setValueLocal(self, index: int, value: Scalar, addv: InsertModeSpec = None) -> 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:2928");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_283setValueLocal = {"setValueLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_283setValueLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_282setValueLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_283setValueLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_index,&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2928, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValueLocal", 0) < (0)) __PYX_ERR(41, 2928, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":2932
 *         index: int,
 *         value: Scalar,
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Insert or add a single value in the vector using a local numbering.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 2, 3, i); __PYX_ERR(41, 2928, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2928, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2928, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2928, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_282setValueLocal(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_index, __pyx_v_value, __pyx_v_addv);

  /* "petsc4py/PETSc/Vec.pyx":2928
 *         return cmap
 * 
 *     def setValueLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         index: int,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_282setValueLocal(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2960
 * 
 *         """
 *         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, 2960, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":2961
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_2, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(41, 2961, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_2;

  /* "petsc4py/PETSc/Vec.pyx":2962
 *         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, 2962, __pyx_L1_error)
  __pyx_v_caddv = __pyx_t_3;

  /* "petsc4py/PETSc/Vec.pyx":2963
 *         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, 2963, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2928
 *         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":2965
 *         CHKERR(VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv))
 * 
 *     def setValuesLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_285setValuesLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_284setValuesLocal, "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:2965");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_285setValuesLocal = {"setValuesLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_285setValuesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_284setValuesLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_285setValuesLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2965, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2965, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2965, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2965, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesLocal", 0) < (0)) __PYX_ERR(41, 2965, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":2969
 *         indices: Sequence[int],
 *         values: Sequence[Scalar],
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Insert or add multiple values in the vector with a local numbering.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 2, 3, i); __PYX_ERR(41, 2965, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2965, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2965, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2965, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2965, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_284setValuesLocal(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv);

  /* "petsc4py/PETSc/Vec.pyx":2965
 *         CHKERR(VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv))
 * 
 *     def setValuesLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_284setValuesLocal(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":2997
 * 
 *         """
 *         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, 2997, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2965
 *         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":2999
 *         vecsetvalues(self.vec, indices, values, addv, 0, 1)
 * 
 *     def setValuesBlockedLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_287setValuesBlockedLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_286setValuesBlockedLocal, "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:2999");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_287setValuesBlockedLocal = {"setValuesBlockedLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_287setValuesBlockedLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_286setValuesBlockedLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_287setValuesBlockedLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 2999, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2999, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2999, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2999, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesBlockedLocal", 0) < (0)) __PYX_ERR(41, 2999, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":3003
 *         indices: Sequence[int],
 *         values: Sequence[Scalar],
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Insert or add blocks of values in the vector with a local numbering.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 2, 3, i); __PYX_ERR(41, 2999, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 2999, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 2999, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 2999, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2999, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_286setValuesBlockedLocal(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_indices, __pyx_v_values, __pyx_v_addv);

  /* "petsc4py/PETSc/Vec.pyx":2999
 *         vecsetvalues(self.vec, indices, values, addv, 0, 1)
 * 
 *     def setValuesBlockedLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_286setValuesBlockedLocal(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":3035
 * 
 *         """
 *         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, 3035, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":2999
 *         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":3037
 *         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_289assemblyBegin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_288assemblyBegin, "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:3037");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_289assemblyBegin = {"assemblyBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_289assemblyBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_288assemblyBegin};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_289assemblyBegin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("assemblyBegin", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_288assemblyBegin(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_288assemblyBegin(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":3047
 * 
 *         """
 *         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, 3047, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3037
 *         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":3049
 *         CHKERR(VecAssemblyBegin(self.vec))
 * 
 *     def assemblyEnd(self) -> None:             # <<<<<<<<<<<<<<
 *         """Finish the assembling stage initiated with `assemblyBegin`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_291assemblyEnd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_290assemblyEnd, "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:3049");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_291assemblyEnd = {"assemblyEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_291assemblyEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_290assemblyEnd};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_291assemblyEnd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("assemblyEnd", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_290assemblyEnd(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_290assemblyEnd(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":3059
 * 
 *         """
 *         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, 3059, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3049
 *         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":3061
 *         CHKERR(VecAssemblyEnd(self.vec))
 * 
 *     def assemble(self) -> None:             # <<<<<<<<<<<<<<
 *         """Assemble the vector.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_293assemble(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_292assemble, "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:3061");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_293assemble = {"assemble", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_293assemble, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_292assemble};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_293assemble(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("assemble", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_292assemble(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_292assemble(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":3071
 * 
 *         """
 *         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, 3071, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3072
 *         """
 *         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, 3072, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3061
 *         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":3076
 *     # --- 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_295strideScale(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_294strideScale, "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:3076");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_295strideScale = {"strideScale", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_295strideScale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_294strideScale};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_295strideScale(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_alpha,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 3076, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3076, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "strideScale", 0) < (0)) __PYX_ERR(41, 3076, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("strideScale", 1, 2, 2, i); __PYX_ERR(41, 3076, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3076, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3076, __pyx_L3_error)
    }
    __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, 3076, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_294strideScale(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field, __pyx_v_alpha);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_294strideScale(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":3093
 * 
 *         """
 *         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, 3093, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":3094
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_2, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(41, 3094, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_2;

  /* "petsc4py/PETSc/Vec.pyx":3095
 *         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, 3095, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3076
 *     # --- 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":3097
 *         CHKERR(VecStrideScale(self.vec, ival, sval))
 * 
 *     def strideSum(self, field: int) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Sum subvector entries.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_297strideSum(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_296strideSum, "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:3097");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_297strideSum = {"strideSum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_297strideSum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_296strideSum};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_297strideSum(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 3097, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3097, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "strideSum", 0) < (0)) __PYX_ERR(41, 3097, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("strideSum", 1, 1, 1, i); __PYX_ERR(41, 3097, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3097, __pyx_L3_error)
    }
    __pyx_v_field = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("strideSum", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 3097, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_296strideSum(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_296strideSum(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":3115
 * 
 *         """
 *         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, 3115, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":3116
 *         """
 *         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":3117
 *         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, 3117, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3118
 *         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, 3118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3097
 *         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":3120
 *         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_299strideMin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_298strideMin, "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:3120");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_299strideMin = {"strideMin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_299strideMin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_298strideMin};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_299strideMin(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 3120, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3120, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "strideMin", 0) < (0)) __PYX_ERR(41, 3120, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("strideMin", 1, 1, 1, i); __PYX_ERR(41, 3120, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3120, __pyx_L3_error)
    }
    __pyx_v_field = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("strideMin", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 3120, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_298strideMin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_298strideMin(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":3145
 * 
 *         """
 *         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, 3145, __pyx_L1_error)
  __pyx_v_ival1 = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":3146
 *         """
 *         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":3147
 *         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":3148
 *         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, 3148, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3149
 *         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, 3149, __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, 3149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 3149, __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) != (0)) __PYX_ERR(41, 3149, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(41, 3149, __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":3120
 *         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":3151
 *         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_301strideMax(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_300strideMax, "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:3151");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_301strideMax = {"strideMax", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_301strideMax, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_300strideMax};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_301strideMax(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 3151, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3151, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "strideMax", 0) < (0)) __PYX_ERR(41, 3151, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("strideMax", 1, 1, 1, i); __PYX_ERR(41, 3151, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3151, __pyx_L3_error)
    }
    __pyx_v_field = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("strideMax", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 3151, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_300strideMax(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_300strideMax(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":3176
 * 
 *         """
 *         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, 3176, __pyx_L1_error)
  __pyx_v_ival1 = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":3177
 *         """
 *         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":3178
 *         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":3179
 *         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, 3179, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3180
 *         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, 3180, __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, 3180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 3180, __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) != (0)) __PYX_ERR(41, 3180, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(41, 3180, __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":3151
 *         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":3182
 *         return (toInt(ival2), toReal(rval))
 * 
 *     def strideNorm(             # <<<<<<<<<<<<<<
 *         self,
 *         field: int,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_303strideNorm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_302strideNorm, "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:3182");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_303strideNorm = {"strideNorm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_303strideNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_302strideNorm};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_303strideNorm(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_norm_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 3182, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3182, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3182, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "strideNorm", 0) < (0)) __PYX_ERR(41, 3182, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":3185
 *         self,
 *         field: int,
 *         norm_type: NormTypeSpec = None) -> float | tuple[float, float]:             # <<<<<<<<<<<<<<
 *         """Return the norm of entries in a subvector.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("strideNorm", 0, 1, 2, i); __PYX_ERR(41, 3182, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3182, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3182, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3182, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_302strideNorm(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field, __pyx_v_norm_type);

  /* "petsc4py/PETSc/Vec.pyx":3182
 *         return (toInt(ival2), toReal(rval))
 * 
 *     def strideNorm(             # <<<<<<<<<<<<<<
 *         self,
 *         field: int,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_302strideNorm(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":3205
 * 
 *         """
 *         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, 3205, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":3206
 *         """
 *         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":3207
 *         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":3208
 *         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_PyLong_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(41, 3208, __pyx_L1_error)
    __pyx_v_ntype = __pyx_t_3;
  }

  /* "petsc4py/PETSc/Vec.pyx":3210
 *         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, 3210, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3211
 *         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, 3211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/Vec.pyx":3212
 *         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, 3212, __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, 3212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(41, 3212, __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) != (0)) __PYX_ERR(41, 3212, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6) != (0)) __PYX_ERR(41, 3212, __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":3182
 *         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":3214
 *         else: return (toReal(rval[0]), toReal(rval[1]))
 * 
 *     def strideScatter(             # <<<<<<<<<<<<<<
 *         self,
 *         field: int,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_305strideScatter(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_304strideScatter, "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:3214");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_305strideScatter = {"strideScatter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_305strideScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_304strideScatter};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_305strideScatter(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_vec,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 3214, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 3214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "strideScatter", 0) < (0)) __PYX_ERR(41, 3214, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":3218
 *         field: int,
 *         Vec vec,
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Scatter entries into a component of another vector.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("strideScatter", 0, 2, 3, i); __PYX_ERR(41, 3214, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 3214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3214, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3214, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3214, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 3217, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_304strideScatter(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field, __pyx_v_vec, __pyx_v_addv);

  /* "petsc4py/PETSc/Vec.pyx":3214
 *         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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_304strideScatter(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":3241
 * 
 *         """
 *         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, 3241, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":3242
 *         """
 *         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, 3242, __pyx_L1_error)
  __pyx_v_caddv = __pyx_t_2;

  /* "petsc4py/PETSc/Vec.pyx":3243
 *         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, 3243, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3214
 *         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":3245
 *         CHKERR(VecStrideScatter(self.vec, ival, vec.vec, caddv))
 * 
 *     def strideGather(             # <<<<<<<<<<<<<<
 *         self,
 *         field: int,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_307strideGather(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_306strideGather, "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:3245");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_307strideGather = {"strideGather", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_307strideGather, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_306strideGather};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_307strideGather(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_vec,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 3245, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 3245, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3245, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3245, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "strideGather", 0) < (0)) __PYX_ERR(41, 3245, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":3249
 *         field: int,
 *         Vec vec,
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Insert component values into a single-component vector.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("strideGather", 0, 2, 3, i); __PYX_ERR(41, 3245, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(41, 3245, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3245, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3245, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3245, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(41, 3248, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_306strideGather(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_field, __pyx_v_vec, __pyx_v_addv);

  /* "petsc4py/PETSc/Vec.pyx":3245
 *         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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_306strideGather(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":3272
 * 
 *         """
 *         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, 3272, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":3273
 *         """
 *         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, 3273, __pyx_L1_error)
  __pyx_v_caddv = __pyx_t_2;

  /* "petsc4py/PETSc/Vec.pyx":3274
 *         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, 3274, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3245
 *         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":3278
 *     # --- 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_309localForm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_308localForm, "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:3278");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_309localForm = {"localForm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_309localForm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_308localForm};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_309localForm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("localForm", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_308localForm(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_308localForm(struct PyPetscVecObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("localForm", 0);

  /* "petsc4py/PETSc/Vec.pyx":3309
 * 
 *         """
 *         return _Vec_LocalForm(self)             # <<<<<<<<<<<<<<
 * 
 *     def ghostUpdateBegin(
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3309, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3278
 *     # --- 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_XDECREF(__pyx_t_2);
  __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":3311
 *         return _Vec_LocalForm(self)
 * 
 *     def ghostUpdateBegin(             # <<<<<<<<<<<<<<
 *         self,
 *         addv: InsertModeSpec = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_311ghostUpdateBegin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_310ghostUpdateBegin, "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:3311");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_311ghostUpdateBegin = {"ghostUpdateBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_311ghostUpdateBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_310ghostUpdateBegin};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_311ghostUpdateBegin(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_addv,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 3311, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3311, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3311, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ghostUpdateBegin", 0) < (0)) __PYX_ERR(41, 3311, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":3313
 *     def ghostUpdateBegin(
 *         self,
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         mode: ScatterModeSpec = None) -> None:
 *         """Begin updating ghosted vector entries.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":3314
 *         self,
 *         addv: InsertModeSpec = None,
 *         mode: ScatterModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Begin updating ghosted vector entries.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3311, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3311, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Vec.pyx":3313
 *     def ghostUpdateBegin(
 *         self,
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         mode: ScatterModeSpec = None) -> None:
 *         """Begin updating ghosted vector entries.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":3314
 *         self,
 *         addv: InsertModeSpec = None,
 *         mode: ScatterModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Begin updating ghosted vector entries.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3311, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_310ghostUpdateBegin(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_addv, __pyx_v_mode);

  /* "petsc4py/PETSc/Vec.pyx":3311
 *         return _Vec_LocalForm(self)
 * 
 *     def ghostUpdateBegin(             # <<<<<<<<<<<<<<
 *         self,
 *         addv: InsertModeSpec = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_310ghostUpdateBegin(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":3324
 * 
 *         """
 *         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, 3324, __pyx_L1_error)
  __pyx_v_caddv = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":3325
 *         """
 *         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, 3325, __pyx_L1_error)
  __pyx_v_csctm = __pyx_t_2;

  /* "petsc4py/PETSc/Vec.pyx":3326
 *         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, 3326, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3311
 *         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":3328
 *         CHKERR(VecGhostUpdateBegin(self.vec, caddv, csctm))
 * 
 *     def ghostUpdateEnd(             # <<<<<<<<<<<<<<
 *         self,
 *         addv: InsertModeSpec = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_313ghostUpdateEnd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_312ghostUpdateEnd, "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:3328");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_313ghostUpdateEnd = {"ghostUpdateEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_313ghostUpdateEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_312ghostUpdateEnd};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_313ghostUpdateEnd(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_addv,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 3328, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3328, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3328, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ghostUpdateEnd", 0) < (0)) __PYX_ERR(41, 3328, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":3330
 *     def ghostUpdateEnd(
 *         self,
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         mode: ScatterModeSpec = None) -> None:
 *         """Finish updating ghosted vector entries initiated with `ghostUpdateBegin`.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":3331
 *         self,
 *         addv: InsertModeSpec = None,
 *         mode: ScatterModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Finish updating ghosted vector entries initiated with `ghostUpdateBegin`.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3328, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3328, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Vec.pyx":3330
 *     def ghostUpdateEnd(
 *         self,
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         mode: ScatterModeSpec = None) -> None:
 *         """Finish updating ghosted vector entries initiated with `ghostUpdateBegin`.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":3331
 *         self,
 *         addv: InsertModeSpec = None,
 *         mode: ScatterModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Finish updating ghosted vector entries initiated with `ghostUpdateBegin`.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3328, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_312ghostUpdateEnd(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_addv, __pyx_v_mode);

  /* "petsc4py/PETSc/Vec.pyx":3328
 *         CHKERR(VecGhostUpdateBegin(self.vec, caddv, csctm))
 * 
 *     def ghostUpdateEnd(             # <<<<<<<<<<<<<<
 *         self,
 *         addv: InsertModeSpec = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_312ghostUpdateEnd(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":3341
 * 
 *         """
 *         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, 3341, __pyx_L1_error)
  __pyx_v_caddv = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":3342
 *         """
 *         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, 3342, __pyx_L1_error)
  __pyx_v_csctm = __pyx_t_2;

  /* "petsc4py/PETSc/Vec.pyx":3343
 *         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, 3343, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3328
 *         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":3345
 *         CHKERR(VecGhostUpdateEnd(self.vec, caddv, csctm))
 * 
 *     def ghostUpdate(             # <<<<<<<<<<<<<<
 *         self,
 *         addv: InsertModeSpec = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_315ghostUpdate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_314ghostUpdate, "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:3345");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_315ghostUpdate = {"ghostUpdate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_315ghostUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_314ghostUpdate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_315ghostUpdate(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_addv,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 3345, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3345, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3345, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ghostUpdate", 0) < (0)) __PYX_ERR(41, 3345, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":3347
 *     def ghostUpdate(
 *         self,
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         mode: ScatterModeSpec = None) -> None:
 *         """Update ghosted vector entries.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":3348
 *         self,
 *         addv: InsertModeSpec = None,
 *         mode: ScatterModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Update ghosted vector entries.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3345, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3345, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Vec.pyx":3347
 *     def ghostUpdate(
 *         self,
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         mode: ScatterModeSpec = None) -> None:
 *         """Update ghosted vector entries.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Vec.pyx":3348
 *         self,
 *         addv: InsertModeSpec = None,
 *         mode: ScatterModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Update ghosted vector entries.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3345, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_314ghostUpdate(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_addv, __pyx_v_mode);

  /* "petsc4py/PETSc/Vec.pyx":3345
 *         CHKERR(VecGhostUpdateEnd(self.vec, caddv, csctm))
 * 
 *     def ghostUpdate(             # <<<<<<<<<<<<<<
 *         self,
 *         addv: InsertModeSpec = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_314ghostUpdate(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":3375
 * 
 *         """
 *         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, 3375, __pyx_L1_error)
  __pyx_v_caddv = __pyx_t_1;

  /* "petsc4py/PETSc/Vec.pyx":3376
 *         """
 *         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, 3376, __pyx_L1_error)
  __pyx_v_csctm = __pyx_t_2;

  /* "petsc4py/PETSc/Vec.pyx":3377
 *         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, 3377, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3378
 *         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, 3378, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3345
 *         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":3380
 *         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_317setMPIGhost(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_316setMPIGhost, "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:3380");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_317setMPIGhost = {"setMPIGhost", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_317setMPIGhost, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_316setMPIGhost};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_317setMPIGhost(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ghosts,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 3380, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3380, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMPIGhost", 0) < (0)) __PYX_ERR(41, 3380, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMPIGhost", 1, 1, 1, i); __PYX_ERR(41, 3380, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3380, __pyx_L3_error)
    }
    __pyx_v_ghosts = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setMPIGhost", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 3380, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_316setMPIGhost(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_ghosts);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_316setMPIGhost(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":3395
 * 
 *         """
 *         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":3396
 *         """
 *         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, 3396, __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":3397
 *         cdef PetscInt ng=0, *ig=NULL
 *         ghosts = iarray_i(ghosts, &ng, &ig)
 *         CHKERR(VecMPISetGhost(self.vec, ng, ig))             # <<<<<<<<<<<<<<
 * 
 *     def getGhostIS(self) -> IS:
*/
  __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, 3397, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3380
 *         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":3399
 *         CHKERR(VecMPISetGhost(self.vec, ng, ig))
 * 
 *     def getGhostIS(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return ghosting indices of a ghost vector.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_319getGhostIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_318getGhostIS, "Vec.getGhostIS(self) -> IS\nReturn ghosting indices of a ghost vector.\n\n        Collective.\n\n        Returns\n        -------\n        IS\n            Indices of ghosts.\n\n        See Also\n        --------\n        petsc.VecGhostGetGhostIS\n\n        \nSource code at petsc4py/PETSc/Vec.pyx:3399");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_319getGhostIS = {"getGhostIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_319getGhostIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_318getGhostIS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_319getGhostIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getGhostIS (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getGhostIS", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getGhostIS", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_318getGhostIS(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_318getGhostIS(struct PyPetscVecObject *__pyx_v_self) {
  IS __pyx_v_indices;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscErrorCode __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getGhostIS", 0);

  /* "petsc4py/PETSc/Vec.pyx":3414
 * 
 *         """
 *         cdef PetscIS indices = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(VecGhostGetGhostIS(self.vec, &indices))
 *         return ref_IS(indices)
*/
  __pyx_v_indices = NULL;

  /* "petsc4py/PETSc/Vec.pyx":3415
 *         """
 *         cdef PetscIS indices = NULL
 *         CHKERR(VecGhostGetGhostIS(self.vec, &indices))             # <<<<<<<<<<<<<<
 *         return ref_IS(indices)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGhostGetGhostIS(__pyx_v_self->vec, (&__pyx_v_indices))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3415, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3416
 *         cdef PetscIS indices = NULL
 *         CHKERR(VecGhostGetGhostIS(self.vec, &indices))
 *         return ref_IS(indices)             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3399
 *         CHKERR(VecMPISetGhost(self.vec, ng, ig))
 * 
 *     def getGhostIS(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return ghosting indices of a ghost vector.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Vec.getGhostIS", __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
 *     #
 * 
 *     def getSubVector(self, IS iset, Vec subvec=None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a subvector from given indices.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_321getSubVector(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_320getSubVector, "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:3420");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_321getSubVector = {"getSubVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_321getSubVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_320getSubVector};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_321getSubVector(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_iset,&__pyx_mstate_global->__pyx_n_u_subvec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 3420, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSubVector", 0) < (0)) __PYX_ERR(41, 3420, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSubVector", 0, 1, 2, i); __PYX_ERR(41, 3420, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3420, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 3420, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(41, 3420, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subvec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "subvec", 0))) __PYX_ERR(41, 3420, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_320getSubVector(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_subvec);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_320getSubVector(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  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":3441
 * 
 *         """
 *         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_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3441, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__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":3442
 *         """
 *         if subvec is None: subvec = Vec()
 *         else: CHKERR(VecDestroy(&subvec.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(VecGetSubVector(self.vec, iset.iset, &subvec.vec))
 *         return subvec
*/
  /*else*/ {
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDestroy((&__pyx_v_subvec->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3442, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Vec.pyx":3443
 *         if subvec is None: subvec = Vec()
 *         else: CHKERR(VecDestroy(&subvec.vec))
 *         CHKERR(VecGetSubVector(self.vec, iset.iset, &subvec.vec))             # <<<<<<<<<<<<<<
 *         return subvec
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetSubVector(__pyx_v_self->vec, __pyx_v_iset->iset, (&__pyx_v_subvec->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3443, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3444
 *         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":3420
 *     #
 * 
 *     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_XDECREF(__pyx_t_3);
  __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":3446
 *         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_323restoreSubVector(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_322restoreSubVector, "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:3446");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_323restoreSubVector = {"restoreSubVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_323restoreSubVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_322restoreSubVector};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_323restoreSubVector(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_iset,&__pyx_mstate_global->__pyx_n_u_subvec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 3446, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3446, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3446, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "restoreSubVector", 0) < (0)) __PYX_ERR(41, 3446, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("restoreSubVector", 1, 2, 2, i); __PYX_ERR(41, 3446, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3446, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3446, __pyx_L3_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("restoreSubVector", 1, 2, 2, __pyx_nargs); __PYX_ERR(41, 3446, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(41, 3446, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subvec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "subvec", 0))) __PYX_ERR(41, 3446, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_322restoreSubVector(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_subvec);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_322restoreSubVector(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":3463
 * 
 *         """
 *         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, 3463, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3446
 *         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":3465
 *         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_325getNestSubVecs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_324getNestSubVecs, "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:3465");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_325getNestSubVecs = {"getNestSubVecs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_325getNestSubVecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_324getNestSubVecs};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_325getNestSubVecs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNestSubVecs", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_324getNestSubVecs(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_324getNestSubVecs(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;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getNestSubVecs", 0);

  /* "petsc4py/PETSc/Vec.pyx":3475
 * 
 *         """
 *         cdef PetscInt N=0             # <<<<<<<<<<<<<<
 *         cdef PetscVec* sx=NULL
 *         CHKERR(VecNestGetSubVecs(self.vec, &N, &sx))
*/
  __pyx_v_N = 0;

  /* "petsc4py/PETSc/Vec.pyx":3476
 *         """
 *         cdef PetscInt N=0
 *         cdef PetscVec* sx=NULL             # <<<<<<<<<<<<<<
 *         CHKERR(VecNestGetSubVecs(self.vec, &N, &sx))
 *         output = []
*/
  __pyx_v_sx = NULL;

  /* "petsc4py/PETSc/Vec.pyx":3477
 *         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, 3477, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3478
 *         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, 3478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_output = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3479
 *         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":3480
 *         output = []
 *         for i in range(N):
 *             pyvec = Vec()             # <<<<<<<<<<<<<<
 *             pyvec.vec = sx[i]
 *             CHKERR(PetscObjectReference(<PetscObject> pyvec.vec))
*/
    __pyx_t_6 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3480, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_pyvec, ((struct PyPetscVecObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Vec.pyx":3481
 *         for i in range(N):
 *             pyvec = Vec()
 *             pyvec.vec = sx[i]             # <<<<<<<<<<<<<<
 *             CHKERR(PetscObjectReference(<PetscObject> pyvec.vec))
 *             output.append(pyvec)
*/
    __pyx_v_pyvec->vec = (__pyx_v_sx[__pyx_v_i]);

    /* "petsc4py/PETSc/Vec.pyx":3482
 *             pyvec = Vec()
 *             pyvec.vec = sx[i]
 *             CHKERR(PetscObjectReference(<PetscObject> 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, 3482, __pyx_L1_error)

    /* "petsc4py/PETSc/Vec.pyx":3483
 *             pyvec.vec = sx[i]
 *             CHKERR(PetscObjectReference(<PetscObject> pyvec.vec))
 *             output.append(pyvec)             # <<<<<<<<<<<<<<
 * 
 *         return output
*/
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_output, ((PyObject *)__pyx_v_pyvec)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(41, 3483, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Vec.pyx":3485
 *             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":3465
 *         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_XDECREF(__pyx_t_6);
  __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":3487
 *         return output
 * 
 *     def setNestSubVecs(             # <<<<<<<<<<<<<<
 *         self,
 *         sx: Sequence[Vec],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_327setNestSubVecs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_326setNestSubVecs, "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:3487");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_327setNestSubVecs = {"setNestSubVecs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_327setNestSubVecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_326setNestSubVecs};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_327setNestSubVecs(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sx,&__pyx_mstate_global->__pyx_n_u_idxm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 3487, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3487, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3487, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNestSubVecs", 0) < (0)) __PYX_ERR(41, 3487, __pyx_L3_error)

      /* "petsc4py/PETSc/Vec.pyx":3490
 *         self,
 *         sx: Sequence[Vec],
 *         idxm: Sequence[int] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the component vectors at specified indices in the nested vector.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNestSubVecs", 0, 1, 2, i); __PYX_ERR(41, 3487, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(41, 3487, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3487, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3487, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_326setNestSubVecs(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_sx, __pyx_v_idxm);

  /* "petsc4py/PETSc/Vec.pyx":3487
 *         return output
 * 
 *     def setNestSubVecs(             # <<<<<<<<<<<<<<
 *         self,
 *         sx: Sequence[Vec],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_326setNestSubVecs(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 PyObject *__pyx_v_unused = 0;
  long __pyx_v_i;
  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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PetscInt __pyx_t_8;
  Vec __pyx_t_9;
  PetscErrorCode __pyx_t_10;
  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":3507
 * 
 *         """
 *         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_3 = NULL;
    __pyx_t_4 = PyObject_Length(__pyx_v_sx); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(41, 3507, __pyx_L1_error)
    __pyx_t_5 = PyLong_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 3507, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3507, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_idxm, __pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Vec.pyx":3508
 *         """
 *         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_4 = PyObject_Length(__pyx_v_idxm); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(41, 3508, __pyx_L1_error)
      __pyx_t_7 = PyObject_Length(__pyx_v_sx); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(41, 3508, __pyx_L1_error)
      __pyx_t_1 = (__pyx_t_4 == __pyx_t_7);
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(41, 3508, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(41, 3508, __pyx_L1_error)
    #endif
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Vec.pyx":3509
 *         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":3510
 *         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":3511
 *         cdef PetscInt N = 0
 *         cdef PetscInt* cidxm = NULL
 *         idxm = iarray_i(idxm, &N, &cidxm)             # <<<<<<<<<<<<<<
 * 
 *         cdef PetscVec* csx = NULL
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_idxm, (&__pyx_v_N), (&__pyx_v_cidxm))); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_idxm, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3513
 *         idxm = iarray_i(idxm, &N, &cidxm)
 * 
 *         cdef PetscVec* csx = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(N), NULL, <void**>&csx)
 *         for i from 0 <= i < N: csx[i] = (<Vec?>sx[i]).vec
*/
  __pyx_v_csx = NULL;

  /* "petsc4py/PETSc/Vec.pyx":3514
 * 
 *         cdef PetscVec* csx = NULL
 *         cdef object unused = oarray_p(empty_p(N), NULL, <void**>&csx)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < N: csx[i] = (<Vec?>sx[i]).vec
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_N)); if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3514, __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_csx)))); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 3514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3515
 *         cdef PetscVec* csx = NULL
 *         cdef object unused = oarray_p(empty_p(N), NULL, <void**>&csx)
 *         for i from 0 <= i < N: csx[i] = (<Vec?>sx[i]).vec             # <<<<<<<<<<<<<<
 * 
 *         CHKERR(VecNestSetSubVecs(self.vec, N, cidxm, csx))
*/
  __pyx_t_8 = __pyx_v_N;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_8; __pyx_v_i++) {
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_sx, __pyx_v_i, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 3515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(41, 3515, __pyx_L1_error)
    __pyx_t_9 = ((struct PyPetscVecObject *)__pyx_t_5)->vec;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    (__pyx_v_csx[__pyx_v_i]) = __pyx_t_9;
  }

  /* "petsc4py/PETSc/Vec.pyx":3517
 *         for i from 0 <= i < N: csx[i] = (<Vec?>sx[i]).vec
 * 
 *         CHKERR(VecNestSetSubVecs(self.vec, N, cidxm, csx))             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNestSetSubVecs(__pyx_v_self->vec, __pyx_v_N, __pyx_v_cidxm, __pyx_v_csx)); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3517, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3487
 *         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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("petsc4py.PETSc.Vec.setNestSubVecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF(__pyx_v_idxm);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Vec.pyx":3521
 *     #
 * 
 *     def setDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Associate a `DM` to the vector.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_329setDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_328setDM, "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:3521");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_329setDM = {"setDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_329setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_328setDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_329setDM(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 3521, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3521, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDM", 0) < (0)) __PYX_ERR(41, 3521, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, i); __PYX_ERR(41, 3521, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3521, __pyx_L3_error)
    }
    __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, 3521, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(41, 3521, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_328setDM(((struct PyPetscVecObject *)__pyx_v_self), __pyx_v_dm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_328setDM(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", 0);

  /* "petsc4py/PETSc/Vec.pyx":3531
 * 
 *         """
 *         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, 3531, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3521
 *     #
 * 
 *     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":3533
 *         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_331getDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_330getDM, "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:3533");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_331getDM = {"getDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_331getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_330getDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_331getDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDM", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_330getDM(((struct PyPetscVecObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_330getDM(struct PyPetscVecObject *__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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDM", 0);

  /* "petsc4py/PETSc/Vec.pyx":3543
 * 
 *         """
 *         cdef PetscDM newdm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(VecGetDM(self.vec, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()
*/
  __pyx_v_newdm = NULL;

  /* "petsc4py/PETSc/Vec.pyx":3544
 *         """
 *         cdef PetscDM newdm = NULL
 *         CHKERR(VecGetDM(self.vec, &newdm))             # <<<<<<<<<<<<<<
 *         cdef DM dm = subtype_DM(newdm)()
 *         dm.dm = newdm
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecGetDM(__pyx_v_self->vec, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3544, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3545
 *         cdef PetscDM newdm = NULL
 *         CHKERR(VecGetDM(self.vec, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()             # <<<<<<<<<<<<<<
 *         dm.dm = newdm
 *         CHKERR(PetscINCREF(dm.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 3545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(41, 3545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(41, 3545, __pyx_L1_error)
  __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3546
 *         CHKERR(VecGetDM(self.vec, &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/Vec.pyx":3547
 *         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(41, 3547, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3548
 *         dm.dm = newdm
 *         CHKERR(PetscINCREF(dm.obj))
 *         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":3533
 *         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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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":3552
 *     #
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def concatenate(cls, vecs: Sequence[Vec]) -> tuple[Vec, list[IS]]:
 *         """Concatenate vectors into a single vector.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_333concatenate(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_3Vec_332concatenate, "Vec.concatenate(cls, vecs: Sequence[Vec]) -> tuple[Vec, list[IS]]\nConcatenate vectors into a single vector.\n\n        Collective.\n\n        Parameters\n        ----------\n        vecs\n            The vectors to be concatenated.\n\n        Returns\n        -------\n        vector_out : Vec\n            The concatenated vector.\n        indices_list : list of IS\n            A list of index sets corresponding to the concatenated components.\n\n        See Also\n        --------\n        petsc.VecConcatenate\n\n        \nSource code at petsc4py/PETSc/Vec.pyx:3552");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Vec_333concatenate = {"concatenate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_333concatenate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_332concatenate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Vec_333concatenate(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_vecs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("concatenate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vecs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(41, 3552, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3552, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "concatenate", 0) < (0)) __PYX_ERR(41, 3552, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("concatenate", 1, 1, 1, i); __PYX_ERR(41, 3552, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(41, 3552, __pyx_L3_error)
    }
    __pyx_v_vecs = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("concatenate", 1, 1, 1, __pyx_nargs); __PYX_ERR(41, 3552, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Vec.concatenate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Vec_332concatenate(((PyTypeObject*)__pyx_v_cls), __pyx_v_vecs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Vec_332concatenate(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_vecs) {
  Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_m;
  PetscInt __pyx_v_n;
  Vec __pyx_v_newvec;
  Vec *__pyx_v_cvecs;
  IS *__pyx_v_cisets;
  CYTHON_UNUSED PyObject *__pyx_v_unused1 = 0;
  PyObject *__pyx_v_vec_index_ises = 0;
  struct PyPetscVecObject *__pyx_v_self = 0;
  struct PyPetscISObject *__pyx_v_temp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Vec __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("concatenate", 0);
  __Pyx_INCREF(__pyx_v_vecs);

  /* "petsc4py/PETSc/Vec.pyx":3575
 * 
 *         """
 *         vecs = list(vecs)             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t i, m = len(vecs)
 *         cdef PetscInt n = <PetscInt>m
*/
  __pyx_t_1 = PySequence_List(__pyx_v_vecs); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3575, __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":3576
 *         """
 *         vecs = list(vecs)
 *         cdef Py_ssize_t i, m = len(vecs)             # <<<<<<<<<<<<<<
 *         cdef PetscInt n = <PetscInt>m
 *         cdef PetscVec newvec = NULL
*/
  __pyx_t_2 = PyObject_Length(__pyx_v_vecs); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(41, 3576, __pyx_L1_error)
  __pyx_v_m = __pyx_t_2;

  /* "petsc4py/PETSc/Vec.pyx":3577
 *         vecs = list(vecs)
 *         cdef Py_ssize_t i, m = len(vecs)
 *         cdef PetscInt n = <PetscInt>m             # <<<<<<<<<<<<<<
 *         cdef PetscVec newvec = NULL
 *         cdef PetscVec *cvecs  = NULL
*/
  __pyx_v_n = ((PetscInt)__pyx_v_m);

  /* "petsc4py/PETSc/Vec.pyx":3578
 *         cdef Py_ssize_t i, m = len(vecs)
 *         cdef PetscInt n = <PetscInt>m
 *         cdef PetscVec newvec = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscVec *cvecs  = NULL
 *         cdef PetscIS  *cisets = NULL
*/
  __pyx_v_newvec = NULL;

  /* "petsc4py/PETSc/Vec.pyx":3579
 *         cdef PetscInt n = <PetscInt>m
 *         cdef PetscVec newvec = NULL
 *         cdef PetscVec *cvecs  = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscIS  *cisets = NULL
 *         cdef object unused1
*/
  __pyx_v_cvecs = NULL;

  /* "petsc4py/PETSc/Vec.pyx":3580
 *         cdef PetscVec newvec = NULL
 *         cdef PetscVec *cvecs  = NULL
 *         cdef PetscIS  *cisets = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused1
 *         cdef object vec_index_ises = []
*/
  __pyx_v_cisets = NULL;

  /* "petsc4py/PETSc/Vec.pyx":3582
 *         cdef PetscIS  *cisets = NULL
 *         cdef object unused1
 *         cdef object vec_index_ises = []             # <<<<<<<<<<<<<<
 *         unused1 = oarray_p(empty_p(n), NULL, <void**>&cvecs)
 *         for i from 0 <= i < m:
*/
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_vec_index_ises = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3583
 *         cdef object unused1
 *         cdef object vec_index_ises = []
 *         unused1 = oarray_p(empty_p(n), NULL, <void**>&cvecs)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < m:
 *             cvecs[i] = (<Vec?>vecs[i]).vec
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_n)); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3583, __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_cvecs)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 3583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_unused1 = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3584
 *         cdef object vec_index_ises = []
 *         unused1 = oarray_p(empty_p(n), NULL, <void**>&cvecs)
 *         for i from 0 <= i < m:             # <<<<<<<<<<<<<<
 *             cvecs[i] = (<Vec?>vecs[i]).vec
 *         CHKERR(VecConcatenate(n, cvecs, &newvec, &cisets))
*/
  __pyx_t_2 = __pyx_v_m;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "petsc4py/PETSc/Vec.pyx":3585
 *         unused1 = oarray_p(empty_p(n), NULL, <void**>&cvecs)
 *         for i from 0 <= i < m:
 *             cvecs[i] = (<Vec?>vecs[i]).vec             # <<<<<<<<<<<<<<
 *         CHKERR(VecConcatenate(n, cvecs, &newvec, &cisets))
 *         cdef Vec self = cls()
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vecs, __pyx_v_i, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 3585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(41, 3585, __pyx_L1_error)
    __pyx_t_4 = ((struct PyPetscVecObject *)__pyx_t_3)->vec;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_cvecs[__pyx_v_i]) = __pyx_t_4;
  }

  /* "petsc4py/PETSc/Vec.pyx":3586
 *         for i from 0 <= i < m:
 *             cvecs[i] = (<Vec?>vecs[i]).vec
 *         CHKERR(VecConcatenate(n, cvecs, &newvec, &cisets))             # <<<<<<<<<<<<<<
 *         cdef Vec self = cls()
 *         self.vec = newvec
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecConcatenate(__pyx_v_n, __pyx_v_cvecs, (&__pyx_v_newvec), (&__pyx_v_cisets))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3586, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3587
 *             cvecs[i] = (<Vec?>vecs[i]).vec
 *         CHKERR(VecConcatenate(n, cvecs, &newvec, &cisets))
 *         cdef Vec self = cls()             # <<<<<<<<<<<<<<
 *         self.vec = newvec
 *         for i from 0 <= i < m:
*/
  __pyx_t_1 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_v_cls, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 3587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(41, 3587, __pyx_L1_error)
  __pyx_v_self = ((struct PyPetscVecObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3588
 *         CHKERR(VecConcatenate(n, cvecs, &newvec, &cisets))
 *         cdef Vec self = cls()
 *         self.vec = newvec             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < m:
 *             temp = IS()
*/
  __pyx_v_self->vec = __pyx_v_newvec;

  /* "petsc4py/PETSc/Vec.pyx":3589
 *         cdef Vec self = cls()
 *         self.vec = newvec
 *         for i from 0 <= i < m:             # <<<<<<<<<<<<<<
 *             temp = IS()
 *             temp.iset = cisets[i]
*/
  __pyx_t_2 = __pyx_v_m;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {

    /* "petsc4py/PETSc/Vec.pyx":3590
 *         self.vec = newvec
 *         for i from 0 <= i < m:
 *             temp = IS()             # <<<<<<<<<<<<<<
 *             temp.iset = cisets[i]
 *             vec_index_ises.append(temp)
*/
    __pyx_t_1 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 3590, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_temp, ((struct PyPetscISObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/Vec.pyx":3591
 *         for i from 0 <= i < m:
 *             temp = IS()
 *             temp.iset = cisets[i]             # <<<<<<<<<<<<<<
 *             vec_index_ises.append(temp)
 *         CHKERR(PetscFree(cisets))
*/
    __pyx_v_temp->iset = (__pyx_v_cisets[__pyx_v_i]);

    /* "petsc4py/PETSc/Vec.pyx":3592
 *             temp = IS()
 *             temp.iset = cisets[i]
 *             vec_index_ises.append(temp)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscFree(cisets))
 *         return self, vec_index_ises
*/
    __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_vec_index_ises, ((PyObject *)__pyx_v_temp)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(41, 3592, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Vec.pyx":3593
 *             temp.iset = cisets[i]
 *             vec_index_ises.append(temp)
 *         CHKERR(PetscFree(cisets))             # <<<<<<<<<<<<<<
 *         return self, vec_index_ises
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cisets)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(41, 3593, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3594
 *             vec_index_ises.append(temp)
 *         CHKERR(PetscFree(cisets))
 *         return self, vec_index_ises             # <<<<<<<<<<<<<<
 * 
 *     property sizes:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(41, 3594, __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)) != (0)) __PYX_ERR(41, 3594, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_vec_index_ises);
  __Pyx_GIVEREF(__pyx_v_vec_index_ises);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vec_index_ises) != (0)) __PYX_ERR(41, 3594, __pyx_L1_error);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3552
 *     #
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def concatenate(cls, vecs: Sequence[Vec]) -> tuple[Vec, list[IS]]:
 *         """Concatenate vectors into a single vector.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("petsc4py.PETSc.Vec.concatenate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused1);
  __Pyx_XDECREF(__pyx_v_vec_index_ises);
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
  __Pyx_XDECREF((PyObject *)__pyx_v_temp);
  __Pyx_XDECREF(__pyx_v_vecs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Vec.pyx":3598
 *     property sizes:
 *         """The local and global vector sizes."""
 *         def __get__(self) -> LayoutSizeSpec:             # <<<<<<<<<<<<<<
 *             return self.getSizes()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Vec.pyx":3599
 *         """The local and global vector sizes."""
 *         def __get__(self) -> LayoutSizeSpec:
 *             return self.getSizes()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSizes, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3598
 *     property sizes:
 *         """The local and global vector sizes."""
 *         def __get__(self) -> LayoutSizeSpec:             # <<<<<<<<<<<<<<
 *             return self.getSizes()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3601
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Vec.pyx":3602
 * 
 *         def __set__(self, value):
 *             self.setSizes(value)             # <<<<<<<<<<<<<<
 * 
 *     property size:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setSizes, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3601
 *             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_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":3606
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Vec.pyx":3607
 *         """The global vector size."""
 *         def __get__(self) -> int:
 *             return self.getSize()             # <<<<<<<<<<<<<<
 * 
 *     property local_size:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSize, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3606
 *     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_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":3611
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Vec.pyx":3612
 *         """The local vector size."""
 *         def __get__(self) -> int:
 *             return self.getLocalSize()             # <<<<<<<<<<<<<<
 * 
 *     property block_size:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getLocalSize, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3611
 *     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_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":3616
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Vec.pyx":3617
 *         """The block size."""
 *         def __get__(self) -> int:
 *             return self.getBlockSize()             # <<<<<<<<<<<<<<
 * 
 *     property owner_range:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getBlockSize, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3616
 *     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_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":3621
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Vec.pyx":3622
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getOwnershipRange, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3622, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3621
 *     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_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":3626
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Vec.pyx":3627
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getOwnershipRanges, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3626
 *     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_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":3631
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Vec.pyx":3632
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getBuffer, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3631
 *     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_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":3636
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Vec.pyx":3637
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, Py_True};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getBuffer, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3637, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3636
 *     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_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":3641
 *     property array_w:
 *         """Writeable `ndarray` containing the local portion of the vector."""
 *         def __get__(self) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *             return self.getArray()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Vec.pyx":3642
 *         """Writeable `ndarray` containing the local portion of the vector."""
 *         def __get__(self) -> ArrayScalar:
 *             return self.getArray()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getArray, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3641
 *     property array_w:
 *         """Writeable `ndarray` containing the local portion of the vector."""
 *         def __get__(self) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *             return self.getArray()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3644
 *             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;
  size_t __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;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Vec.pyx":3645
 * 
 *         def __set__(self, value):
 *             cdef buf = self.getBuffer()             # <<<<<<<<<<<<<<
 *             with buf as array: array[:] = value
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getBuffer, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_buf = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3646
 *         def __set__(self, value):
 *             cdef buf = self.getBuffer()
 *             with buf as array: array[:] = value             # <<<<<<<<<<<<<<
 * 
 *     property array_r:
*/
  /*with:*/ {
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_v_buf, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 3646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = NULL;
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_v_buf, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 3646, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_3 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3646, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __pyx_t_5 = __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_5;
          __pyx_t_5 = 0;
          if (__Pyx_PyObject_SetSlice(__pyx_v_array, __pyx_v_value, 0, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 0, 0, 1) < (0)) __PYX_ERR(41, 3646, __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_5); __pyx_t_5 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("petsc4py.PETSc.Vec.array_w.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(41, 3646, __pyx_L9_except_error)
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_2);
          __pyx_t_9 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(41, 3646, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(41, 3646, __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, 3646, __pyx_L9_except_error)
          __pyx_t_12 = (!__pyx_t_11);
          if (unlikely(__pyx_t_12)) {
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_XGIVEREF(__pyx_t_2);
            __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_1, __pyx_t_2);
            __pyx_t_5 = 0;  __pyx_t_1 = 0;  __pyx_t_2 = 0; 
            __PYX_ERR(41, 3646, __pyx_L9_except_error)
          }
          __Pyx_XDECREF(__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;
          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_4) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4], NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(41, 3646, __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_4); __pyx_t_4 = 0;
    goto __pyx_L1_error;
    __pyx_L16:;
  }

  /* "petsc4py/PETSc/Vec.pyx":3644
 *             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_5);
  __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":3650
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Vec.pyx":3651
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, Py_True};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getArray, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3650
 *     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_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":3655
 *     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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":3656
 *         """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_mstate_global->__pyx_n_u_buffer_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3655
 *     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":3660
 *     property array:
 *         """Alias for `array_w`."""
 *         def __get__(self) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *             return self.array_w
 * 
*/

/* 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__", 0);

  /* "petsc4py/PETSc/Vec.pyx":3661
 *         """Alias for `array_w`."""
 *         def __get__(self) -> ArrayScalar:
 *             return self.array_w             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_array_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3660
 *     property array:
 *         """Alias for `array_w`."""
 *         def __get__(self) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *             return self.array_w
 * 
*/

  /* 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":3663
 *             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":3664
 * 
 *         def __set__(self, value):
 *             self.array_w = value             # <<<<<<<<<<<<<<
 * 
 *     # --- NumPy array interface (legacy) ---
*/
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_array_w, __pyx_v_value) < (0)) __PYX_ERR(41, 3664, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3663
 *             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":3669
 * 
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Vec.pyx":3670
 *     property __array_interface__:
 *         def __get__(self):
 *             cdef buf = self.getBuffer()             # <<<<<<<<<<<<<<
 *             return buf.__array_interface__
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getBuffer, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_buf = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3671
 *         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_mstate_global->__pyx_n_u_array_interface); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 3671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Vec.pyx":3669
 * 
 *     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_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 = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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 = <PetscObject*> &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 = <PetscObject*> &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 = <PetscObject*> &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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4Quad_3view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_2view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(42, 9, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(42, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(42, 9, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(42, 9, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4Quad_5create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_4create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(42, 28, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(42, 28, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(42, 28, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(42, 28, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "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 const )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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4Quad_7duplicate = {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_7duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_6duplicate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("duplicate", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("duplicate", 0);

  /* "petsc4py/PETSc/DT.pyx":59
 * 
 *         """
 *         cdef Quad newquad = Quad()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscQuadratureDuplicate(self.quad, &newquad.quad))
 *         return newquad
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 59, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscQuadratureDuplicate(__pyx_v_self->quad, (&__pyx_v_newquad->quad))); if (unlikely(__pyx_t_4 == ((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_XDECREF(__pyx_t_2);
  __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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4Quad_9destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_9destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_8destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4Quad_11getData = {"getData", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_11getData, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_10getData};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getData", __pyx_kwds); 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", 0);

  /* "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) != (0)) __PYX_ERR(42, 99, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4Quad_13getNumComponents = {"getNumComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_13getNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_12getNumComponents};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNumComponents", __pyx_kwds); 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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4Quad_15setNumComponents = {"setNumComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_15setNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_14setNumComponents};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(42, 118, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(42, 118, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNumComponents", 0) < (0)) __PYX_ERR(42, 118, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNumComponents", 1, 1, 1, i); __PYX_ERR(42, 118, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(42, 118, __pyx_L3_error)
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4Quad_17getOrder = {"getOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_17getOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_16getOrder};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOrder", __pyx_kwds); 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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4Quad_19setOrder = {"setOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_19setOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_18setOrder};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_order,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(42, 150, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(42, 150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOrder", 0) < (0)) __PYX_ERR(42, 150, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setOrder", 1, 1, 1, i); __PYX_ERR(42, 150, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(42, 150, __pyx_L3_error)
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "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":17
 *     Type = FEType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":18
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.fe             # <<<<<<<<<<<<<<
 *         self.fe = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->fe));

  /* "petsc4py/PETSc/FE.pyx":19
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.fe
 *         self.fe = NULL             # <<<<<<<<<<<<<<
 * 
 *     def view(self, Viewer viewer=None) -> None:
*/
  __pyx_v_self->fe = NULL;

  /* "petsc4py/PETSc/FE.pyx":17
 *     Type = FEType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.fe
 *         self.fe = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/FE.pyx":21
 *         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:21");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_3view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_2view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(43, 21, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 21, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(43, 21, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 21, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 21, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(43, 21, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/FE.pyx":36
 * 
 *         """
 *         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":37
 *         """
 *         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":38
 *         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, 38, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":21
 *         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":40
 *         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:40");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_5destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_4destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/FE.pyx":50
 * 
 *         """
 *         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, 50, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":51
 *         """
 *         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":40
 *         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":53
 *         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:53");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_7create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_6create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(43, 53, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 53, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(43, 53, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 53, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(43, 53, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/FE.pyx":70
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(43, 70, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/FE.pyx":71
 *         """
 *         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":72
 *         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, 72, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":73
 *         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, 73, __pyx_L1_error)
  __pyx_v_self->fe = __pyx_v_newfe;

  /* "petsc4py/PETSc/FE.pyx":74
 *         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":53
 *         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":76
 *         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 = 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:76");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_9createDefault = {"createDefault", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_9createDefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_8createDefault};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dim,&__pyx_mstate_global->__pyx_n_u_nc,&__pyx_mstate_global->__pyx_n_u_isSimplex,&__pyx_mstate_global->__pyx_n_u_qorder,&__pyx_mstate_global->__pyx_n_u_prefix,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(43, 76, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(43, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(43, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(43, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(43, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(43, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createDefault", 0) < (0)) __PYX_ERR(43, 76, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__19);

      /* "petsc4py/PETSc/FE.pyx":82
 *         isSimplex: bool,
 *         qorder: int = DETERMINE,
 *         prefix: str | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `FE` for basic FEM computation.
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/FE.pyx":83
 *         qorder: int = DETERMINE,
 *         prefix: str | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `FE` for basic FEM computation.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createDefault", 0, 3, 6, i); __PYX_ERR(43, 76, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(43, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(43, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(43, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(43, 76, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(43, 76, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 76, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__19);

      /* "petsc4py/PETSc/FE.pyx":82
 *         isSimplex: bool,
 *         qorder: int = DETERMINE,
 *         prefix: str | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `FE` for basic FEM computation.
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/FE.pyx":83
 *         qorder: int = DETERMINE,
 *         prefix: str | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `FE` for basic FEM computation.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 76, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":76
 *         return self
 * 
 *     def createDefault(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":109
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(43, 109, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "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)
*/
  __pyx_v_newfe = NULL;

  /* "petsc4py/PETSc/FE.pyx":111
 *         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, 111, __pyx_L1_error)
  __pyx_v_cdim = __pyx_t_2;

  /* "petsc4py/PETSc/FE.pyx":112
 *         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, 112, __pyx_L1_error)
  __pyx_v_cnc = __pyx_t_2;

  /* "petsc4py/PETSc/FE.pyx":113
 *         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, 113, __pyx_L1_error)
  __pyx_v_cqorder = __pyx_t_2;

  /* "petsc4py/PETSc/FE.pyx":114
 *         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, 114, __pyx_L1_error)
  __pyx_v_cisSimplex = __pyx_t_3;

  /* "petsc4py/PETSc/FE.pyx":115
 *         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":116
 *         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, 116, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "petsc4py/PETSc/FE.pyx":117
 *         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, 117, __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":116
 *         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":118
 *         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, 118, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":119
 *             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, 119, __pyx_L1_error)
  __pyx_v_self->fe = __pyx_v_newfe;

  /* "petsc4py/PETSc/FE.pyx":120
 *         CHKERR(PetscFECreateDefault(ccomm, cdim, cnc, cisSimplex, cprefix, cqorder, &newfe))
 *         CHKERR(PetscCLEAR(self.obj)); self.fe = newfe
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def createByCell(
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/FE.pyx":76
 *         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":122
 *         return self
 * 
 *     def createByCell(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_11createByCell(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_10createByCell, "FE.createByCell(self, dim: int, nc: int, ctype: DM.PolytopeType, qorder: int = DETERMINE, prefix: str | None = 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        ctype\n            The cell type.\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.PetscFECreateByCell\n\n        \nSource code at petsc4py/PETSc/FE.pyx:122");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_11createByCell = {"createByCell", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_11createByCell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_10createByCell};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_11createByCell(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_ctype = 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("createByCell (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dim,&__pyx_mstate_global->__pyx_n_u_nc,&__pyx_mstate_global->__pyx_n_u_ctype,&__pyx_mstate_global->__pyx_n_u_qorder,&__pyx_mstate_global->__pyx_n_u_prefix,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(43, 122, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(43, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(43, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(43, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(43, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(43, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createByCell", 0) < (0)) __PYX_ERR(43, 122, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__20);

      /* "petsc4py/PETSc/FE.pyx":128
 *         ctype: DM.PolytopeType,
 *         qorder: int = DETERMINE,
 *         prefix: str | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `FE` for basic FEM computation.
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/FE.pyx":129
 *         qorder: int = DETERMINE,
 *         prefix: str | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `FE` for basic FEM computation.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createByCell", 0, 3, 6, i); __PYX_ERR(43, 122, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(43, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(43, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(43, 122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(43, 122, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(43, 122, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 122, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__20);

      /* "petsc4py/PETSc/FE.pyx":128
 *         ctype: DM.PolytopeType,
 *         qorder: int = DETERMINE,
 *         prefix: str | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `FE` for basic FEM computation.
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/FE.pyx":129
 *         qorder: int = DETERMINE,
 *         prefix: str | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `FE` for basic FEM computation.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_dim = values[0];
    __pyx_v_nc = values[1];
    __pyx_v_ctype = 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("createByCell", 0, 3, 6, __pyx_nargs); __PYX_ERR(43, 122, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.FE.createByCell", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_10createByCell(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_dim, __pyx_v_nc, __pyx_v_ctype, __pyx_v_qorder, __pyx_v_prefix, __pyx_v_comm);

  /* "petsc4py/PETSc/FE.pyx":122
 *         return self
 * 
 *     def createByCell(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_10createByCell(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_dim, PyObject *__pyx_v_nc, PyObject *__pyx_v_ctype, 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;
  DMPolytopeType __pyx_v_cCellType;
  char const *__pyx_v_cprefix;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  MPI_Comm __pyx_t_1;
  PetscInt __pyx_t_2;
  DMPolytopeType __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("createByCell", 0);
  __Pyx_INCREF(__pyx_v_prefix);

  /* "petsc4py/PETSc/FE.pyx":155
 * 
 *         """
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_SELF)             # <<<<<<<<<<<<<<
 *         cdef PetscFE newfe = NULL
 *         cdef PetscInt cdim = asInt(dim)
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, PETSC_COMM_SELF); if (unlikely(__pyx_t_1 == ((MPI_Comm const )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_SELF)
 *         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_SELF)
 *         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, 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 cqorder = asInt(qorder)
 *         cdef PetscDMPolytopeType cCellType = ctype
*/
  __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 cqorder = asInt(qorder)             # <<<<<<<<<<<<<<
 *         cdef PetscDMPolytopeType cCellType = ctype
 *         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, 159, __pyx_L1_error)
  __pyx_v_cqorder = __pyx_t_2;

  /* "petsc4py/PETSc/FE.pyx":160
 *         cdef PetscInt cnc = asInt(nc)
 *         cdef PetscInt cqorder = asInt(qorder)
 *         cdef PetscDMPolytopeType cCellType = ctype             # <<<<<<<<<<<<<<
 *         cdef const char *cprefix = NULL
 *         if prefix:
*/
  __pyx_t_3 = ((DMPolytopeType)__Pyx_PyLong_As_DMPolytopeType(__pyx_v_ctype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(43, 160, __pyx_L1_error)
  __pyx_v_cCellType = __pyx_t_3;

  /* "petsc4py/PETSc/FE.pyx":161
 *         cdef PetscInt cqorder = asInt(qorder)
 *         cdef PetscDMPolytopeType cCellType = ctype
 *         cdef const char *cprefix = NULL             # <<<<<<<<<<<<<<
 *         if prefix:
 *             prefix = str2bytes(prefix, &cprefix)
*/
  __pyx_v_cprefix = NULL;

  /* "petsc4py/PETSc/FE.pyx":162
 *         cdef PetscDMPolytopeType cCellType = ctype
 *         cdef const char *cprefix = NULL
 *         if prefix:             # <<<<<<<<<<<<<<
 *             prefix = str2bytes(prefix, &cprefix)
 *         CHKERR(PetscFECreateDefault(ccomm, cdim, cnc, cCellType, cprefix, cqorder, &newfe))
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(43, 162, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "petsc4py/PETSc/FE.pyx":163
 *         cdef const char *cprefix = NULL
 *         if prefix:
 *             prefix = str2bytes(prefix, &cprefix)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscFECreateDefault(ccomm, cdim, cnc, cCellType, 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, 163, __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":162
 *         cdef PetscDMPolytopeType cCellType = ctype
 *         cdef const char *cprefix = NULL
 *         if prefix:             # <<<<<<<<<<<<<<
 *             prefix = str2bytes(prefix, &cprefix)
 *         CHKERR(PetscFECreateDefault(ccomm, cdim, cnc, cCellType, cprefix, cqorder, &newfe))
*/
  }

  /* "petsc4py/PETSc/FE.pyx":164
 *         if prefix:
 *             prefix = str2bytes(prefix, &cprefix)
 *         CHKERR(PetscFECreateDefault(ccomm, cdim, cnc, cCellType, 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_cCellType, __pyx_v_cprefix, __pyx_v_cqorder, (&__pyx_v_newfe))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 164, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":165
 *             prefix = str2bytes(prefix, &cprefix)
 *         CHKERR(PetscFECreateDefault(ccomm, cdim, cnc, cCellType, 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, 165, __pyx_L1_error)
  __pyx_v_self->fe = __pyx_v_newfe;

  /* "petsc4py/PETSc/FE.pyx":166
 *         CHKERR(PetscFECreateDefault(ccomm, cdim, cnc, cCellType, 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":122
 *         return self
 * 
 *     def createByCell(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("petsc4py.PETSc.FE.createByCell", __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":168
 *         return self
 * 
 *     def createLagrange(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_13createLagrange(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_12createLagrange, "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:168");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_13createLagrange = {"createLagrange", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_13createLagrange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_12createLagrange};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_13createLagrange(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dim,&__pyx_mstate_global->__pyx_n_u_nc,&__pyx_mstate_global->__pyx_n_u_isSimplex,&__pyx_mstate_global->__pyx_n_u_k,&__pyx_mstate_global->__pyx_n_u_qorder,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(43, 168, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(43, 168, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(43, 168, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(43, 168, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(43, 168, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(43, 168, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 168, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createLagrange", 0) < (0)) __PYX_ERR(43, 168, __pyx_L3_error)
      if (!values[4]) values[4] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__21);

      /* "petsc4py/PETSc/FE.pyx":175
 *         k: int,
 *         qorder: int = DETERMINE,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `FE` for the basic Lagrange space of degree k.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createLagrange", 0, 4, 6, i); __PYX_ERR(43, 168, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(43, 168, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(43, 168, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(43, 168, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(43, 168, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(43, 168, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 168, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[4]) values[4] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__21);
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 168, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_12createLagrange(((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":168
 *         return self
 * 
 *     def createLagrange(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_12createLagrange(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", 0);

  /* "petsc4py/PETSc/FE.pyx":201
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(43, 201, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/FE.pyx":202
 *         """
 *         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":203
 *         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, 203, __pyx_L1_error)
  __pyx_v_cdim = __pyx_t_2;

  /* "petsc4py/PETSc/FE.pyx":204
 *         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, 204, __pyx_L1_error)
  __pyx_v_cnc = __pyx_t_2;

  /* "petsc4py/PETSc/FE.pyx":205
 *         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, 205, __pyx_L1_error)
  __pyx_v_ck = __pyx_t_2;

  /* "petsc4py/PETSc/FE.pyx":206
 *         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, 206, __pyx_L1_error)
  __pyx_v_cqorder = __pyx_t_2;

  /* "petsc4py/PETSc/FE.pyx":207
 *         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, 207, __pyx_L1_error)
  __pyx_v_cisSimplex = __pyx_t_3;

  /* "petsc4py/PETSc/FE.pyx":208
 *         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, 208, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":209
 *         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, 209, __pyx_L1_error)
  __pyx_v_self->fe = __pyx_v_newfe;

  /* "petsc4py/PETSc/FE.pyx":210
 *         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":168
 *         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":212
 *         return self
 * 
 *     def getQuadrature(self) -> Quad:             # <<<<<<<<<<<<<<
 *         """Return the `Quad` used to calculate inner products.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_15getQuadrature(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_14getQuadrature, "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:212");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_15getQuadrature = {"getQuadrature", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_15getQuadrature, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_14getQuadrature};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_15getQuadrature(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getQuadrature", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_14getQuadrature(((struct PyPetscFEObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_14getQuadrature(struct PyPetscFEObject *__pyx_v_self) {
  struct PyPetscQuadObject *__pyx_v_quad = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getQuadrature", 0);

  /* "petsc4py/PETSc/FE.pyx":222
 * 
 *         """
 *         cdef Quad quad = Quad()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscFEGetQuadrature(self.fe, &quad.quad))
 *         CHKERR(PetscINCREF(quad.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 222, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_quad = ((struct PyPetscQuadObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/FE.pyx":223
 *         """
 *         cdef Quad quad = Quad()
 *         CHKERR(PetscFEGetQuadrature(self.fe, &quad.quad))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(quad.obj))
 *         return quad
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetQuadrature(__pyx_v_self->fe, (&__pyx_v_quad->quad))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 223, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":224
 *         cdef Quad quad = Quad()
 *         CHKERR(PetscFEGetQuadrature(self.fe, &quad.quad))
 *         CHKERR(PetscINCREF(quad.obj))             # <<<<<<<<<<<<<<
 *         return quad
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_quad->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 224, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":225
 *         CHKERR(PetscFEGetQuadrature(self.fe, &quad.quad))
 *         CHKERR(PetscINCREF(quad.obj))
 *         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":212
 *         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_XDECREF(__pyx_t_2);
  __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":227
 *         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_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_2FE_16getDimension, "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:227");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_17getDimension = {"getDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_17getDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_16getDimension};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDimension", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_16getDimension(((struct PyPetscFEObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_16getDimension(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", 0);

  /* "petsc4py/PETSc/FE.pyx":237
 * 
 *         """
 *         cdef PetscInt cdim = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscFEGetDimension(self.fe, &cdim))
 *         return toInt(cdim)
*/
  __pyx_v_cdim = 0;

  /* "petsc4py/PETSc/FE.pyx":238
 *         """
 *         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, 238, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":239
 *         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, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/FE.pyx":227
 *         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":241
 *         return toInt(cdim)
 * 
 *     def getSpatialDimension(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the spatial dimension of the element.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_19getSpatialDimension(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_18getSpatialDimension, "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:241");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_19getSpatialDimension = {"getSpatialDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_19getSpatialDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_18getSpatialDimension};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_19getSpatialDimension(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSpatialDimension", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_18getSpatialDimension(((struct PyPetscFEObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_18getSpatialDimension(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", 0);

  /* "petsc4py/PETSc/FE.pyx":251
 * 
 *         """
 *         cdef PetscInt csdim = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscFEGetSpatialDimension(self.fe, &csdim))
 *         return toInt(csdim)
*/
  __pyx_v_csdim = 0;

  /* "petsc4py/PETSc/FE.pyx":252
 *         """
 *         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, 252, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":253
 *         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, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/FE.pyx":241
 *         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":255
 *         return toInt(csdim)
 * 
 *     def getNumComponents(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of components in the element.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_21getNumComponents(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_20getNumComponents, "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:255");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_21getNumComponents = {"getNumComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_21getNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_20getNumComponents};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_21getNumComponents(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNumComponents", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_20getNumComponents(((struct PyPetscFEObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_20getNumComponents(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", 0);

  /* "petsc4py/PETSc/FE.pyx":265
 * 
 *         """
 *         cdef PetscInt comp = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscFEGetNumComponents(self.fe, &comp))
 *         return toInt(comp)
*/
  __pyx_v_comp = 0;

  /* "petsc4py/PETSc/FE.pyx":266
 *         """
 *         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, 266, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":267
 *         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, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/FE.pyx":255
 *         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":269
 *         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_23setNumComponents(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_22setNumComponents, "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:269");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_23setNumComponents = {"setNumComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_23setNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_22setNumComponents};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_23setNumComponents(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(43, 269, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 269, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNumComponents", 0) < (0)) __PYX_ERR(43, 269, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNumComponents", 1, 1, 1, i); __PYX_ERR(43, 269, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 269, __pyx_L3_error)
    }
    __pyx_v_comp = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setNumComponents", 1, 1, 1, __pyx_nargs); __PYX_ERR(43, 269, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_22setNumComponents(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_comp);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_22setNumComponents(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_comp) {
  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", 0);

  /* "petsc4py/PETSc/FE.pyx":284
 * 
 *         """
 *         cdef PetscInt ccomp = asInt(comp)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscFESetNumComponents(self.fe, ccomp))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_comp); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(43, 284, __pyx_L1_error)
  __pyx_v_ccomp = __pyx_t_1;

  /* "petsc4py/PETSc/FE.pyx":285
 *         """
 *         cdef PetscInt ccomp = asInt(comp)
 *         CHKERR(PetscFESetNumComponents(self.fe, ccomp))             # <<<<<<<<<<<<<<
 * 
 *     def getNumDof(self) -> ndarray:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetNumComponents(__pyx_v_self->fe, __pyx_v_ccomp)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 285, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":269
 *         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":287
 *         CHKERR(PetscFESetNumComponents(self.fe, ccomp))
 * 
 *     def getNumDof(self) -> ndarray:             # <<<<<<<<<<<<<<
 *         """Return the number of DOFs.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_25getNumDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_24getNumDof, "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:287");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_25getNumDof = {"getNumDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_25getNumDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_24getNumDof};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_25getNumDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNumDof", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_24getNumDof(((struct PyPetscFEObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_24getNumDof(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", 0);

  /* "petsc4py/PETSc/FE.pyx":300
 * 
 *         """
 *         cdef const PetscInt *numDof = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt cdim = 0
 *         CHKERR(PetscFEGetDimension(self.fe, &cdim))
*/
  __pyx_v_numDof = NULL;

  /* "petsc4py/PETSc/FE.pyx":301
 *         """
 *         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":302
 *         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, 302, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":303
 *         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, 303, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":304
 *         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, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/FE.pyx":287
 *         CHKERR(PetscFESetNumComponents(self.fe, ccomp))
 * 
 *     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":306
 *         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_27getTileSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_26getTileSizes, "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:306");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_27getTileSizes = {"getTileSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_27getTileSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_26getTileSizes};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_27getTileSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTileSizes", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_26getTileSizes(((struct PyPetscFEObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_26getTileSizes(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", 0);

  /* "petsc4py/PETSc/FE.pyx":327
 * 
 *         """
 *         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":328
 *         """
 *         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":329
 *         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, 329, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":330
 *         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, 330, __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, 330, __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, 330, __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, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(43, 330, __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) != (0)) __PYX_ERR(43, 330, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3) != (0)) __PYX_ERR(43, 330, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4) != (0)) __PYX_ERR(43, 330, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5) != (0)) __PYX_ERR(43, 330, __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":306
 *         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":332
 *         return toInt(blockSize), toInt(numBlocks), toInt(batchSize), toInt(numBatches)
 * 
 *     def setTileSizes(             # <<<<<<<<<<<<<<
 *         self,
 *         blockSize: int,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_29setTileSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_28setTileSizes, "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:332");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_29setTileSizes = {"setTileSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_29setTileSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_28setTileSizes};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_29setTileSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_blockSize,&__pyx_mstate_global->__pyx_n_u_numBlocks,&__pyx_mstate_global->__pyx_n_u_batchSize,&__pyx_mstate_global->__pyx_n_u_numBatches,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(43, 332, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(43, 332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(43, 332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(43, 332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTileSizes", 0) < (0)) __PYX_ERR(43, 332, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setTileSizes", 1, 4, 4, i); __PYX_ERR(43, 332, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 332, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(43, 332, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(43, 332, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(43, 332, __pyx_L3_error)
    }
    __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, 332, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_28setTileSizes(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_blockSize, __pyx_v_numBlocks, __pyx_v_batchSize, __pyx_v_numBatches);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_28setTileSizes(struct PyPetscFEObject *__pyx_v_self, PyObject *__pyx_v_blockSize, PyObject *__pyx_v_numBlocks, PyObject *__pyx_v_batchSize, PyObject *__pyx_v_numBatches) {
  PetscInt __pyx_v_cblockSize;
  PetscInt __pyx_v_cnumBlocks;
  PetscInt __pyx_v_cbatchSize;
  PetscInt __pyx_v_cnumBatches;
  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("setTileSizes", 0);

  /* "petsc4py/PETSc/FE.pyx":358
 * 
 *         """
 *         cdef PetscInt cblockSize = asInt(blockSize), cnumBlocks = asInt(numBlocks)             # <<<<<<<<<<<<<<
 *         cdef PetscInt cbatchSize = asInt(batchSize), cnumBatches = asInt(numBatches)
 *         CHKERR(PetscFESetTileSizes(self.fe, cblockSize, cnumBlocks, cbatchSize, cnumBatches))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_blockSize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(43, 358, __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, 358, __pyx_L1_error)
  __pyx_v_cnumBlocks = __pyx_t_1;

  /* "petsc4py/PETSc/FE.pyx":359
 *         """
 *         cdef PetscInt cblockSize = asInt(blockSize), cnumBlocks = asInt(numBlocks)
 *         cdef PetscInt cbatchSize = asInt(batchSize), cnumBatches = asInt(numBatches)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscFESetTileSizes(self.fe, cblockSize, cnumBlocks, cbatchSize, cnumBatches))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_batchSize); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(43, 359, __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, 359, __pyx_L1_error)
  __pyx_v_cnumBatches = __pyx_t_1;

  /* "petsc4py/PETSc/FE.pyx":360
 *         cdef PetscInt cblockSize = asInt(blockSize), cnumBlocks = asInt(numBlocks)
 *         cdef PetscInt cbatchSize = asInt(batchSize), cnumBatches = asInt(numBatches)
 *         CHKERR(PetscFESetTileSizes(self.fe, cblockSize, cnumBlocks, cbatchSize, cnumBatches))             # <<<<<<<<<<<<<<
 * 
 *     def getFaceQuadrature(self) -> Quad:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFESetTileSizes(__pyx_v_self->fe, __pyx_v_cblockSize, __pyx_v_cnumBlocks, __pyx_v_cbatchSize, __pyx_v_cnumBatches)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 360, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":332
 *         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":362
 *         CHKERR(PetscFESetTileSizes(self.fe, cblockSize, cnumBlocks, cbatchSize, cnumBatches))
 * 
 *     def getFaceQuadrature(self) -> Quad:             # <<<<<<<<<<<<<<
 *         """Return the `Quad` used to calculate inner products on faces.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_31getFaceQuadrature(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_30getFaceQuadrature, "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:362");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_31getFaceQuadrature = {"getFaceQuadrature", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_31getFaceQuadrature, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_30getFaceQuadrature};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_31getFaceQuadrature(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFaceQuadrature", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_30getFaceQuadrature(((struct PyPetscFEObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_30getFaceQuadrature(struct PyPetscFEObject *__pyx_v_self) {
  struct PyPetscQuadObject *__pyx_v_quad = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getFaceQuadrature", 0);

  /* "petsc4py/PETSc/FE.pyx":372
 * 
 *         """
 *         cdef Quad quad = Quad()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscFEGetFaceQuadrature(self.fe, &quad.quad))
 *         CHKERR(PetscINCREF(quad.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 372, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_quad = ((struct PyPetscQuadObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/FE.pyx":373
 *         """
 *         cdef Quad quad = Quad()
 *         CHKERR(PetscFEGetFaceQuadrature(self.fe, &quad.quad))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(quad.obj))
 *         return quad
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetFaceQuadrature(__pyx_v_self->fe, (&__pyx_v_quad->quad))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 373, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":374
 *         cdef Quad quad = Quad()
 *         CHKERR(PetscFEGetFaceQuadrature(self.fe, &quad.quad))
 *         CHKERR(PetscINCREF(quad.obj))             # <<<<<<<<<<<<<<
 *         return quad
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_quad->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 374, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":375
 *         CHKERR(PetscFEGetFaceQuadrature(self.fe, &quad.quad))
 *         CHKERR(PetscINCREF(quad.obj))
 *         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":362
 *         CHKERR(PetscFESetTileSizes(self.fe, cblockSize, cnumBlocks, cbatchSize, cnumBatches))
 * 
 *     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_XDECREF(__pyx_t_2);
  __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":377
 *         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_33setQuadrature(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_32setQuadrature, "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:377");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_33setQuadrature = {"setQuadrature", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_33setQuadrature, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_32setQuadrature};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_33setQuadrature(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_quad,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(43, 377, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 377, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setQuadrature", 0) < (0)) __PYX_ERR(43, 377, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setQuadrature", 1, 1, 1, i); __PYX_ERR(43, 377, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 377, __pyx_L3_error)
    }
    __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, 377, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, 0, "quad", 0))) __PYX_ERR(43, 377, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_32setQuadrature(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_quad);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_32setQuadrature(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", 0);

  /* "petsc4py/PETSc/FE.pyx":392
 * 
 *         """
 *         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, 392, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":393
 *         """
 *         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":377
 *         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":395
 *         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_35setFaceQuadrature(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_34setFaceQuadrature, "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:395");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_35setFaceQuadrature = {"setFaceQuadrature", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_35setFaceQuadrature, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_34setFaceQuadrature};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_35setFaceQuadrature(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_quad,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(43, 395, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 395, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFaceQuadrature", 0) < (0)) __PYX_ERR(43, 395, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFaceQuadrature", 1, 1, 1, i); __PYX_ERR(43, 395, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 395, __pyx_L3_error)
    }
    __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, 395, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, 0, "quad", 0))) __PYX_ERR(43, 395, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_34setFaceQuadrature(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_quad);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_34setFaceQuadrature(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", 0);

  /* "petsc4py/PETSc/FE.pyx":410
 * 
 *         """
 *         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, 410, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":411
 *         """
 *         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":395
 *         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":413
 *         return self
 * 
 *     def setType(self, fe_type: Type | str) -> Self:             # <<<<<<<<<<<<<<
 *         """Build a particular `FE`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_37setType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_36setType, "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:413");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_37setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_37setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_36setType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_37setType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fe_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(43, 413, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 413, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(43, 413, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(43, 413, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 413, __pyx_L3_error)
    }
    __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, 413, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_36setType(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_fe_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_36setType(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":428
 * 
 *         """
 *         cdef PetscFEType cval = NULL             # <<<<<<<<<<<<<<
 *         fe_type = str2bytes(fe_type, &cval)
 *         CHKERR(PetscFESetType(self.fe, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/FE.pyx":429
 *         """
 *         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, 429, __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":430
 *         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, 430, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":431
 *         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":413
 *         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":433
 *         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_39getBasisSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_38getBasisSpace, "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:433");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_39getBasisSpace = {"getBasisSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_39getBasisSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_38getBasisSpace};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_39getBasisSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBasisSpace", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_38getBasisSpace(((struct PyPetscFEObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_38getBasisSpace(struct PyPetscFEObject *__pyx_v_self) {
  struct PyPetscSpaceObject *__pyx_v_sp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getBasisSpace", 0);

  /* "petsc4py/PETSc/FE.pyx":443
 * 
 *         """
 *         cdef Space sp = Space()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscFEGetBasisSpace(self.fe, &sp.space))
 *         CHKERR(PetscINCREF(sp.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 443, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_sp = ((struct PyPetscSpaceObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/FE.pyx":444
 *         """
 *         cdef Space sp = Space()
 *         CHKERR(PetscFEGetBasisSpace(self.fe, &sp.space))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(sp.obj))
 *         return sp
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetBasisSpace(__pyx_v_self->fe, (&__pyx_v_sp->space))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 444, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":445
 *         cdef Space sp = Space()
 *         CHKERR(PetscFEGetBasisSpace(self.fe, &sp.space))
 *         CHKERR(PetscINCREF(sp.obj))             # <<<<<<<<<<<<<<
 *         return sp
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sp->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 445, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":446
 *         CHKERR(PetscFEGetBasisSpace(self.fe, &sp.space))
 *         CHKERR(PetscINCREF(sp.obj))
 *         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":433
 *         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_XDECREF(__pyx_t_2);
  __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":448
 *         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_41setBasisSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_40setBasisSpace, "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:448");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_41setBasisSpace = {"setBasisSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_41setBasisSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_40setBasisSpace};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_41setBasisSpace(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(43, 448, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 448, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBasisSpace", 0) < (0)) __PYX_ERR(43, 448, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBasisSpace", 1, 1, 1, i); __PYX_ERR(43, 448, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 448, __pyx_L3_error)
    }
    __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, 448, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, 0, "sp", 0))) __PYX_ERR(43, 448, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_40setBasisSpace(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_sp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_40setBasisSpace(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", 0);

  /* "petsc4py/PETSc/FE.pyx":463
 * 
 *         """
 *         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, 463, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":448
 *         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":465
 *         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_43setFromOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_42setFromOptions, "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:465");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_43setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_43setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_42setFromOptions};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_43setFromOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_42setFromOptions(((struct PyPetscFEObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_42setFromOptions(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", 0);

  /* "petsc4py/PETSc/FE.pyx":475
 * 
 *         """
 *         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, 475, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":465
 *         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":477
 *         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_45setUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_44setUp, "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:477");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_45setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_45setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_44setUp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_45setUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_44setUp(((struct PyPetscFEObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_44setUp(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", 0);

  /* "petsc4py/PETSc/FE.pyx":487
 * 
 *         """
 *         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, 487, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":477
 *         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":489
 *         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_47getDualSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_46getDualSpace, "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:489");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_47getDualSpace = {"getDualSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_47getDualSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_46getDualSpace};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_47getDualSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDualSpace", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_46getDualSpace(((struct PyPetscFEObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_46getDualSpace(struct PyPetscFEObject *__pyx_v_self) {
  struct PyPetscDualSpaceObject *__pyx_v_dspace = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDualSpace", 0);

  /* "petsc4py/PETSc/FE.pyx":499
 * 
 *         """
 *         cdef DualSpace dspace = DualSpace()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscFEGetDualSpace(self.fe, &dspace.dualspace))
 *         CHKERR(PetscINCREF(dspace.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 499, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_dspace = ((struct PyPetscDualSpaceObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/FE.pyx":500
 *         """
 *         cdef DualSpace dspace = DualSpace()
 *         CHKERR(PetscFEGetDualSpace(self.fe, &dspace.dualspace))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(dspace.obj))
 *         return dspace
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFEGetDualSpace(__pyx_v_self->fe, (&__pyx_v_dspace->dualspace))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 500, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":501
 *         cdef DualSpace dspace = DualSpace()
 *         CHKERR(PetscFEGetDualSpace(self.fe, &dspace.dualspace))
 *         CHKERR(PetscINCREF(dspace.obj))             # <<<<<<<<<<<<<<
 *         return dspace
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dspace->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(43, 501, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":502
 *         CHKERR(PetscFEGetDualSpace(self.fe, &dspace.dualspace))
 *         CHKERR(PetscINCREF(dspace.obj))
 *         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":489
 *         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_XDECREF(__pyx_t_2);
  __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":504
 *         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_49setDualSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_48setDualSpace, "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:504");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2FE_49setDualSpace = {"setDualSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_49setDualSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_48setDualSpace};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2FE_49setDualSpace(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dspace,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(43, 504, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 504, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDualSpace", 0) < (0)) __PYX_ERR(43, 504, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDualSpace", 1, 1, 1, i); __PYX_ERR(43, 504, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(43, 504, __pyx_L3_error)
    }
    __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, 504, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, 0, "dspace", 0))) __PYX_ERR(43, 504, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2FE_48setDualSpace(((struct PyPetscFEObject *)__pyx_v_self), __pyx_v_dspace);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2FE_48setDualSpace(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", 0);

  /* "petsc4py/PETSc/FE.pyx":519
 * 
 *         """
 *         CHKERR(PetscFESetDualSpace(self.fe, dspace.dualspace))             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __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, 519, __pyx_L1_error)

  /* "petsc4py/PETSc/FE.pyx":504
 *         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/Scatter.pyx":40
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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 = <PetscObject*> &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 = <PetscObject*> &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 = <PetscObject*> &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_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_addv,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(44, 44, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(44, 44, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(44, 44, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(44, 44, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 44, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(44, 44, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 2, 4, i); __PYX_ERR(44, 44, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(44, 44, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(44, 44, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(44, 44, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 44, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "petsc4py/PETSc/Scatter.pyx":54
 * 
 *         """
 *         self.scatter(x, y, addv, mode)             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_x, __pyx_v_y, __pyx_v_addv, __pyx_v_mode};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_scatter, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 54, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __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_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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Scatter_5view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_4view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(44, 58, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 58, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(44, 58, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 58, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Scatter_7destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_6destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Scatter_9create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_8create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec_from,&__pyx_mstate_global->__pyx_n_u_is_from,&__pyx_mstate_global->__pyx_n_u_vec_to,&__pyx_mstate_global->__pyx_n_u_is_to,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(44, 90, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(44, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(44, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(44, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(44, 90, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("create", 1, 4, 4, i); __PYX_ERR(44, 90, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 90, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(44, 90, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(44, 90, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(44, 90, __pyx_L3_error)
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__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_mstate_global->__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_mstate_global->__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_mstate_global->__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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Scatter.pyx":137
 * 
 *         """
 *         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":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
 *         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":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
 *         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":140
 *         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":141
 *         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, 141, __pyx_L1_error)

  /* "petsc4py/PETSc/Scatter.pyx":143
 *         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, 143, __pyx_L1_error)
  __pyx_v_self->sct = __pyx_v_newsct;

  /* "petsc4py/PETSc/Scatter.pyx":144
 *                 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":146
 *         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:146");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Scatter_11setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_10setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_scatter_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(44, 146, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 146, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(44, 146, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(44, 146, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 146, __pyx_L3_error)
    }
    __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, 146, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  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_scatter_type);

  /* "petsc4py/PETSc/Scatter.pyx":156
 * 
 *         """
 *         cdef PetscScatterType cval = NULL             # <<<<<<<<<<<<<<
 *         scatter_type = str2bytes(scatter_type, &cval)
 *         CHKERR(VecScatterSetType(self.sct, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Scatter.pyx":157
 *         """
 *         cdef PetscScatterType cval = NULL
 *         scatter_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, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_scatter_type, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":158
 *         cdef PetscScatterType cval = NULL
 *         scatter_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, 158, __pyx_L1_error)

  /* "petsc4py/PETSc/Scatter.pyx":146
 *         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_scatter_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Scatter.pyx":160
 *         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:160");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Scatter_13getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_12getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Scatter.pyx":170
 * 
 *         """
 *         cdef PetscScatterType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(VecScatterGetType(self.sct, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Scatter.pyx":171
 *         """
 *         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, 171, __pyx_L1_error)

  /* "petsc4py/PETSc/Scatter.pyx":172
 *         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, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Scatter.pyx":160
 *         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":174
 *         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:174");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Scatter_15setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_15setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_14setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Scatter.pyx":184
 * 
 *         """
 *         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, 184, __pyx_L1_error)

  /* "petsc4py/PETSc/Scatter.pyx":174
 *         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":186
 *         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:186");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Scatter_17setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_17setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_16setUp};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Scatter.pyx":196
 * 
 *         """
 *         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, 196, __pyx_L1_error)

  /* "petsc4py/PETSc/Scatter.pyx":197
 *         """
 *         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":186
 *         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":199
 *         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:199");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Scatter_19copy = {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_19copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_18copy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);

  /* "petsc4py/PETSc/Scatter.pyx":201
 *     def copy(self) -> Scatter:
 *         """Return a copy of the scatter."""
 *         cdef Scatter scatter = Scatter()             # <<<<<<<<<<<<<<
 *         CHKERR(VecScatterCopy(self.sct, &scatter.sct))
 *         return scatter
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 201, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_scatter = ((struct PyPetscScatterObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":202
 *         """Return a copy of the scatter."""
 *         cdef Scatter scatter = Scatter()
 *         CHKERR(VecScatterCopy(self.sct, &scatter.sct))             # <<<<<<<<<<<<<<
 *         return scatter
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterCopy(__pyx_v_self->sct, (&__pyx_v_scatter->sct))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 202, __pyx_L1_error)

  /* "petsc4py/PETSc/Scatter.pyx":203
 *         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":199
 *         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_XDECREF(__pyx_t_2);
  __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":205
 *         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:205");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Scatter_21toAll = {"toAll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_21toAll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_20toAll};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(44, 205, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "toAll", 0) < (0)) __PYX_ERR(44, 205, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("toAll", 1, 1, 1, i); __PYX_ERR(44, 205, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 205, __pyx_L3_error)
    }
    __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, 205, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(44, 206, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("toAll", 0);

  /* "petsc4py/PETSc/Scatter.pyx":227
 * 
 *         """
 *         cdef Scatter scatter = Scatter()             # <<<<<<<<<<<<<<
 *         cdef Vec ovec = Vec()
 *         CHKERR(VecScatterCreateToAll(
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 227, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_scatter = ((struct PyPetscScatterObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":228
 *         """
 *         cdef Scatter scatter = Scatter()
 *         cdef Vec ovec = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(VecScatterCreateToAll(
 *             vec.vec, &scatter.sct, &ovec.vec))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 228, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_ovec = ((struct PyPetscVecObject *)__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))
 *         return (scatter, ovec)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterCreateToAll(__pyx_v_vec->vec, (&__pyx_v_scatter->sct), (&__pyx_v_ovec->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 229, __pyx_L1_error)

  /* "petsc4py/PETSc/Scatter.pyx":231
 *         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, 231, __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)) != (0)) __PYX_ERR(44, 231, __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)) != (0)) __PYX_ERR(44, 231, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Scatter.pyx":205
 *         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_XDECREF(__pyx_t_2);
  __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":233
 *         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:233");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Scatter_23toZero = {"toZero", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_23toZero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_22toZero};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(44, 233, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 233, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "toZero", 0) < (0)) __PYX_ERR(44, 233, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("toZero", 1, 1, 1, i); __PYX_ERR(44, 233, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 233, __pyx_L3_error)
    }
    __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, 233, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(44, 234, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("toZero", 0);

  /* "petsc4py/PETSc/Scatter.pyx":255
 * 
 *         """
 *         cdef Scatter scatter = Scatter()             # <<<<<<<<<<<<<<
 *         cdef Vec ovec = Vec()
 *         CHKERR(VecScatterCreateToZero(
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 255, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_scatter = ((struct PyPetscScatterObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":256
 *         """
 *         cdef Scatter scatter = Scatter()
 *         cdef Vec ovec = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(VecScatterCreateToZero(
 *             vec.vec, &scatter.sct, &ovec.vec))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 256, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_ovec = ((struct PyPetscVecObject *)__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))
 *         return (scatter, ovec)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecScatterCreateToZero(__pyx_v_vec->vec, (&__pyx_v_scatter->sct), (&__pyx_v_ovec->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(44, 257, __pyx_L1_error)

  /* "petsc4py/PETSc/Scatter.pyx":259
 *         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, 259, __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)) != (0)) __PYX_ERR(44, 259, __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)) != (0)) __PYX_ERR(44, 259, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Scatter.pyx":233
 *         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_XDECREF(__pyx_t_2);
  __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":262
 *     #
 * 
 *     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:262");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Scatter_25begin = {"begin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_25begin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_24begin};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec_from,&__pyx_mstate_global->__pyx_n_u_vec_to,&__pyx_mstate_global->__pyx_n_u_addv,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(44, 262, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(44, 262, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(44, 262, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(44, 262, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 262, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "begin", 0) < (0)) __PYX_ERR(44, 262, __pyx_L3_error)

      /* "petsc4py/PETSc/Scatter.pyx":266
 *         Vec vec_from,
 *         Vec vec_to,
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         mode: ScatterModeSpec = None) -> None:
 *         """Begin a generalized scatter from one vector into another.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Scatter.pyx":267
 *         Vec vec_to,
 *         addv: InsertModeSpec = None,
 *         mode: ScatterModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Begin a generalized scatter from one vector into another.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("begin", 0, 2, 4, i); __PYX_ERR(44, 262, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(44, 262, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(44, 262, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(44, 262, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 262, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Scatter.pyx":266
 *         Vec vec_from,
 *         Vec vec_to,
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         mode: ScatterModeSpec = None) -> None:
 *         """Begin a generalized scatter from one vector into another.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Scatter.pyx":267
 *         Vec vec_to,
 *         addv: InsertModeSpec = None,
 *         mode: ScatterModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Begin a generalized scatter from one vector into another.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 262, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(44, 264, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(44, 265, __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":262
 *     #
 * 
 *     def begin(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec vec_from,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Scatter.pyx":280
 * 
 *         """
 *         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, 280, __pyx_L1_error)
  __pyx_v_caddv = __pyx_t_1;

  /* "petsc4py/PETSc/Scatter.pyx":281
 *         """
 *         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, 281, __pyx_L1_error)
  __pyx_v_csctm = __pyx_t_2;

  /* "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,             # <<<<<<<<<<<<<<
 *                                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, 282, __pyx_L1_error)

  /* "petsc4py/PETSc/Scatter.pyx":262
 *     #
 * 
 *     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":285
 *                                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:285");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Scatter_27end = {"end", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_27end, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_26end};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec_from,&__pyx_mstate_global->__pyx_n_u_vec_to,&__pyx_mstate_global->__pyx_n_u_addv,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(44, 285, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(44, 285, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(44, 285, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(44, 285, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 285, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "end", 0) < (0)) __PYX_ERR(44, 285, __pyx_L3_error)

      /* "petsc4py/PETSc/Scatter.pyx":289
 *         Vec vec_from,
 *         Vec vec_to,
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         mode: ScatterModeSpec = None) -> None:
 *         """Complete a generalized scatter from one vector into another.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Scatter.pyx":290
 *         Vec vec_to,
 *         addv: InsertModeSpec = None,
 *         mode: ScatterModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Complete a generalized scatter from one vector into another.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("end", 0, 2, 4, i); __PYX_ERR(44, 285, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(44, 285, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(44, 285, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(44, 285, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 285, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Scatter.pyx":289
 *         Vec vec_from,
 *         Vec vec_to,
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         mode: ScatterModeSpec = None) -> None:
 *         """Complete a generalized scatter from one vector into another.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Scatter.pyx":290
 *         Vec vec_to,
 *         addv: InsertModeSpec = None,
 *         mode: ScatterModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Complete a generalized scatter from one vector into another.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 285, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(44, 287, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(44, 288, __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":285
 *                                caddv, csctm))
 * 
 *     def end(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec vec_from,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Scatter.pyx":303
 * 
 *         """
 *         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, 303, __pyx_L1_error)
  __pyx_v_caddv = __pyx_t_1;

  /* "petsc4py/PETSc/Scatter.pyx":304
 *         """
 *         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, 304, __pyx_L1_error)
  __pyx_v_csctm = __pyx_t_2;

  /* "petsc4py/PETSc/Scatter.pyx":305
 *         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, 305, __pyx_L1_error)

  /* "petsc4py/PETSc/Scatter.pyx":285
 *                                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":308
 *                              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:308");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Scatter_29scatter = {"scatter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_29scatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_28scatter};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec_from,&__pyx_mstate_global->__pyx_n_u_vec_to,&__pyx_mstate_global->__pyx_n_u_addv,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(44, 308, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(44, 308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(44, 308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(44, 308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scatter", 0) < (0)) __PYX_ERR(44, 308, __pyx_L3_error)

      /* "petsc4py/PETSc/Scatter.pyx":312
 *         Vec vec_from,
 *         Vec vec_to,
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         mode: ScatterModeSpec = None) -> None:
 *         """Perform a generalized scatter from one vector into another.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Scatter.pyx":313
 *         Vec vec_to,
 *         addv: InsertModeSpec = None,
 *         mode: ScatterModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Perform a generalized scatter from one vector into another.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scatter", 0, 2, 4, i); __PYX_ERR(44, 308, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(44, 308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(44, 308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(44, 308, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(44, 308, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Scatter.pyx":312
 *         Vec vec_from,
 *         Vec vec_to,
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         mode: ScatterModeSpec = None) -> None:
 *         """Perform a generalized scatter from one vector into another.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Scatter.pyx":313
 *         Vec vec_to,
 *         addv: InsertModeSpec = None,
 *         mode: ScatterModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Perform a generalized scatter from one vector into another.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 308, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_from", 0))) __PYX_ERR(44, 310, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec_to), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec_to", 0))) __PYX_ERR(44, 311, __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":308
 *                              caddv, csctm))
 * 
 *     def scatter(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec vec_from,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Scatter.pyx":334
 * 
 *         """
 *         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, 334, __pyx_L1_error)
  __pyx_v_caddv = __pyx_t_1;

  /* "petsc4py/PETSc/Scatter.pyx":335
 *         """
 *         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, 335, __pyx_L1_error)
  __pyx_v_csctm = __pyx_t_2;

  /* "petsc4py/PETSc/Scatter.pyx":336
 *         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, 336, __pyx_L1_error)

  /* "petsc4py/PETSc/Scatter.pyx":338
 *         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, 338, __pyx_L1_error)

  /* "petsc4py/PETSc/Scatter.pyx":308
 *                              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 = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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 = <PetscObject*> &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 = <PetscObject*> &self.sec
 *         self.sec  = NULL             # <<<<<<<<<<<<<<
 * 
 *     def view(self, Viewer viewer=None) -> None:
*/
  __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 = <PetscObject*> &self.sec
 *         self.sec  = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/Section.pyx":10
 *         self.sec  = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the section.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_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_7Section_2view, "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:10");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_3view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_2view};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 10, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 10, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(45, 10, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 10, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 10, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(45, 10, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_2view(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_viewer);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_2view(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", 0);

  /* "petsc4py/PETSc/Section.pyx":25
 * 
 *         """
 *         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":26
 *         """
 *         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":27
 *         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, 27, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":10
 *         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":29
 *         CHKERR(PetscSectionView(self.sec, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy a section.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_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_7Section_4destroy, "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:29");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_5destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_4destroy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_4destroy(((struct PyPetscSectionObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_4destroy(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", 0);

  /* "petsc4py/PETSc/Section.pyx":39
 * 
 *         """
 *         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, 39, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":40
 *         """
 *         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":29
 *         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":42
 *         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_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_7Section_6create, "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:42");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_7create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_6create};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 42, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 42, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(45, 42, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 42, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(45, 42, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_6create(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_comm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_6create(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", 0);

  /* "petsc4py/PETSc/Section.pyx":74
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(45, 74, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":75
 *         """
 *         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":76
 *         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, 76, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":77
 *         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, 77, __pyx_L1_error)
  __pyx_v_self->sec = __pyx_v_newsec;

  /* "petsc4py/PETSc/Section.pyx":78
 *         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":42
 *         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":80
 *         return self
 * 
 *     def clone(self) -> Section:             # <<<<<<<<<<<<<<
 *         """Return a copy of the section.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_9clone(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_8clone, "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:80");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_9clone = {"clone", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_9clone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_8clone};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_9clone(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("clone", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_8clone(((struct PyPetscSectionObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_8clone(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;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clone", 0);

  /* "petsc4py/PETSc/Section.pyx":92
 * 
 *         """
 *         cdef Section sec = <Section>type(self)()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSectionClone(self.sec, &sec.sec))
 *         return sec
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_3 = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Section.pyx":93
 *         """
 *         cdef Section sec = <Section>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, 93, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":94
 *         cdef Section sec = <Section>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":80
 *         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":96
 *         return sec
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Calculate offsets.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_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_7Section_10setUp, "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:96");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_11setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_11setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_10setUp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_10setUp(((struct PyPetscSectionObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_10setUp(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", 0);

  /* "petsc4py/PETSc/Section.pyx":108
 * 
 *         """
 *         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, 108, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":96
 *         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":110
 *         CHKERR(PetscSectionSetUp(self.sec))
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         """Free all section data.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_13reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_12reset, "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:110");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_13reset = {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_13reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_12reset};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_13reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("reset", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_12reset(((struct PyPetscSectionObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_12reset(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", 0);

  /* "petsc4py/PETSc/Section.pyx":120
 * 
 *         """
 *         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, 120, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":110
 *         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":122
 *         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_15getNumFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_14getNumFields, "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:122");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_15getNumFields = {"getNumFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_15getNumFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_14getNumFields};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_15getNumFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNumFields", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_14getNumFields(((struct PyPetscSectionObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_14getNumFields(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", 0);

  /* "petsc4py/PETSc/Section.pyx":134
 * 
 *         """
 *         cdef PetscInt numFields = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSectionGetNumFields(self.sec, &numFields))
 *         return toInt(numFields)
*/
  __pyx_v_numFields = 0;

  /* "petsc4py/PETSc/Section.pyx":135
 *         """
 *         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, 135, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":136
 *         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, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Section.pyx":122
 *         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":138
 *         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_17setNumFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_16setNumFields, "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:138");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_17setNumFields = {"setNumFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_17setNumFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_16setNumFields};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_17setNumFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_numFields,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 138, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 138, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNumFields", 0) < (0)) __PYX_ERR(45, 138, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNumFields", 1, 1, 1, i); __PYX_ERR(45, 138, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 138, __pyx_L3_error)
    }
    __pyx_v_numFields = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setNumFields", 1, 1, 1, __pyx_nargs); __PYX_ERR(45, 138, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_16setNumFields(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_numFields);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_16setNumFields(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", 0);

  /* "petsc4py/PETSc/Section.pyx":153
 * 
 *         """
 *         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, 153, __pyx_L1_error)
  __pyx_v_cnumFields = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":154
 *         """
 *         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, 154, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":138
 *         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":156
 *         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_19getFieldName(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_18getFieldName, "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:156");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_19getFieldName = {"getFieldName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_19getFieldName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_18getFieldName};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_19getFieldName(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 156, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 156, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFieldName", 0) < (0)) __PYX_ERR(45, 156, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFieldName", 1, 1, 1, i); __PYX_ERR(45, 156, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 156, __pyx_L3_error)
    }
    __pyx_v_field = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getFieldName", 1, 1, 1, __pyx_nargs); __PYX_ERR(45, 156, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_18getFieldName(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_field);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_18getFieldName(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", 0);

  /* "petsc4py/PETSc/Section.pyx":171
 * 
 *         """
 *         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, 171, __pyx_L1_error)
  __pyx_v_cfield = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":172
 *         """
 *         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":173
 *         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, 173, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":174
 *         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, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Section.pyx":156
 *         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":176
 *         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_21setFieldName(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_20setFieldName, "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:176");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_21setFieldName = {"setFieldName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_21setFieldName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_20setFieldName};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_21setFieldName(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_fieldName,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 176, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 176, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 176, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFieldName", 0) < (0)) __PYX_ERR(45, 176, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFieldName", 1, 2, 2, i); __PYX_ERR(45, 176, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 176, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 176, __pyx_L3_error)
    }
    __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, 176, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_20setFieldName(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_field, __pyx_v_fieldName);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_20setFieldName(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":193
 * 
 *         """
 *         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, 193, __pyx_L1_error)
  __pyx_v_cfield = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":194
 *         """
 *         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":195
 *         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, 195, __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":196
 *         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, 196, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":176
 *         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":198
 *         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_23getFieldComponents(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_22getFieldComponents, "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:198");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_23getFieldComponents = {"getFieldComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_23getFieldComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_22getFieldComponents};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_23getFieldComponents(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 198, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 198, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFieldComponents", 0) < (0)) __PYX_ERR(45, 198, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFieldComponents", 1, 1, 1, i); __PYX_ERR(45, 198, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 198, __pyx_L3_error)
    }
    __pyx_v_field = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getFieldComponents", 1, 1, 1, __pyx_nargs); __PYX_ERR(45, 198, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_22getFieldComponents(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_field);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_22getFieldComponents(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", 0);

  /* "petsc4py/PETSc/Section.pyx":213
 * 
 *         """
 *         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, 213, __pyx_L1_error)
  __pyx_v_cfield = __pyx_t_1;
  __pyx_v_cnumComp = 0;

  /* "petsc4py/PETSc/Section.pyx":214
 *         """
 *         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, 214, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":215
 *         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, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Section.pyx":198
 *         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":217
 *         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_25setFieldComponents(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_24setFieldComponents, "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:217");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_25setFieldComponents = {"setFieldComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_25setFieldComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_24setFieldComponents};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_25setFieldComponents(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_numComp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 217, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 217, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 217, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFieldComponents", 0) < (0)) __PYX_ERR(45, 217, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFieldComponents", 1, 2, 2, i); __PYX_ERR(45, 217, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 217, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 217, __pyx_L3_error)
    }
    __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, 217, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_24setFieldComponents(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_field, __pyx_v_numComp);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_24setFieldComponents(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", 0);

  /* "petsc4py/PETSc/Section.pyx":234
 * 
 *         """
 *         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, 234, __pyx_L1_error)
  __pyx_v_cfield = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":235
 *         """
 *         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, 235, __pyx_L1_error)
  __pyx_v_cnumComp = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":236
 *         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, 236, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":217
 *         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":238
 *         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_27getChart(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_26getChart, "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:238");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_27getChart = {"getChart", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_27getChart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_26getChart};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_27getChart(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getChart", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_26getChart(((struct PyPetscSectionObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_26getChart(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", 0);

  /* "petsc4py/PETSc/Section.pyx":251
 * 
 *         """
 *         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":252
 *         """
 *         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, 252, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":253
 *         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, 253, __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, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 253, __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) != (0)) __PYX_ERR(45, 253, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(45, 253, __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":238
 *         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":255
 *         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_29setChart(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_28setChart, "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:255");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_29setChart = {"setChart", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_29setChart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_28setChart};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_29setChart(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pStart,&__pyx_mstate_global->__pyx_n_u_pEnd,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 255, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 255, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 255, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setChart", 0) < (0)) __PYX_ERR(45, 255, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setChart", 1, 2, 2, i); __PYX_ERR(45, 255, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 255, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 255, __pyx_L3_error)
    }
    __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, 255, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_28setChart(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_pStart, __pyx_v_pEnd);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_28setChart(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", 0);

  /* "petsc4py/PETSc/Section.pyx":275
 * 
 *         """
 *         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, 275, __pyx_L1_error)
  __pyx_v_cStart = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":276
 *         """
 *         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, 276, __pyx_L1_error)
  __pyx_v_cEnd = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":277
 *         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, 277, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":255
 *         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":279
 *         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_31getPermutation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_30getPermutation, "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:279");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_31getPermutation = {"getPermutation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_31getPermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_30getPermutation};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_31getPermutation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPermutation", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_30getPermutation(((struct PyPetscSectionObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_30getPermutation(struct PyPetscSectionObject *__pyx_v_self) {
  struct PyPetscISObject *__pyx_v_perm = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getPermutation", 0);

  /* "petsc4py/PETSc/Section.pyx":289
 * 
 *         """
 *         cdef IS perm = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSectionGetPermutation(self.sec, &perm.iset))
 *         CHKERR(PetscINCREF(perm.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 289, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_perm = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Section.pyx":290
 *         """
 *         cdef IS perm = IS()
 *         CHKERR(PetscSectionGetPermutation(self.sec, &perm.iset))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(perm.obj))
 *         return perm
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionGetPermutation(__pyx_v_self->sec, (&__pyx_v_perm->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 290, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":291
 *         cdef IS perm = IS()
 *         CHKERR(PetscSectionGetPermutation(self.sec, &perm.iset))
 *         CHKERR(PetscINCREF(perm.obj))             # <<<<<<<<<<<<<<
 *         return perm
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_perm->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 291, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":292
 *         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":279
 *         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_XDECREF(__pyx_t_2);
  __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":294
 *         return perm
 * 
 *     def setPermutation(self, IS perm) -> None:             # <<<<<<<<<<<<<<
 *         """Set the permutation for [0, pEnd - pStart).
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_33setPermutation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_32setPermutation, "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:294");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_33setPermutation = {"setPermutation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_33setPermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_32setPermutation};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_33setPermutation(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_perm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 294, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 294, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPermutation", 0) < (0)) __PYX_ERR(45, 294, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPermutation", 1, 1, 1, i); __PYX_ERR(45, 294, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 294, __pyx_L3_error)
    }
    __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, 294, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "perm", 0))) __PYX_ERR(45, 294, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_32setPermutation(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_perm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_32setPermutation(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", 0);

  /* "petsc4py/PETSc/Section.pyx":309
 * 
 *         """
 *         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, 309, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":294
 *         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":311
 *         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_35getDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_34getDof, "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:311");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_35getDof = {"getDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_35getDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_34getDof};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_35getDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 311, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 311, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getDof", 0) < (0)) __PYX_ERR(45, 311, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getDof", 1, 1, 1, i); __PYX_ERR(45, 311, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 311, __pyx_L3_error)
    }
    __pyx_v_point = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getDof", 1, 1, 1, __pyx_nargs); __PYX_ERR(45, 311, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_34getDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_34getDof(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", 0);

  /* "petsc4py/PETSc/Section.pyx":329
 * 
 *         """
 *         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, 329, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;
  __pyx_v_cnumDof = 0;

  /* "petsc4py/PETSc/Section.pyx":330
 *         """
 *         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, 330, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":331
 *         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, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Section.pyx":311
 *         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":333
 *         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_37setDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_36setDof, "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:333");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_37setDof = {"setDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_37setDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_36setDof};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_37setDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_numDof,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 333, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 333, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 333, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDof", 0) < (0)) __PYX_ERR(45, 333, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDof", 1, 2, 2, i); __PYX_ERR(45, 333, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 333, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 333, __pyx_L3_error)
    }
    __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, 333, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_36setDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_numDof);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_36setDof(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", 0);

  /* "petsc4py/PETSc/Section.pyx":350
 * 
 *         """
 *         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, 350, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":351
 *         """
 *         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, 351, __pyx_L1_error)
  __pyx_v_cnumDof = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":352
 *         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, 352, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":333
 *         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":354
 *         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_39addDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_38addDof, "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:354");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_39addDof = {"addDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_39addDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_38addDof};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_39addDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_numDof,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 354, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 354, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 354, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addDof", 0) < (0)) __PYX_ERR(45, 354, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addDof", 1, 2, 2, i); __PYX_ERR(45, 354, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 354, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 354, __pyx_L3_error)
    }
    __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, 354, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_38addDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_numDof);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_38addDof(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", 0);

  /* "petsc4py/PETSc/Section.pyx":371
 * 
 *         """
 *         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, 371, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":372
 *         """
 *         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, 372, __pyx_L1_error)
  __pyx_v_cnumDof = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":373
 *         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, 373, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":354
 *         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":375
 *         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_41getFieldDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_40getFieldDof, "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:375");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_41getFieldDof = {"getFieldDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_41getFieldDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_40getFieldDof};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_41getFieldDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 375, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFieldDof", 0) < (0)) __PYX_ERR(45, 375, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFieldDof", 1, 2, 2, i); __PYX_ERR(45, 375, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 375, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 375, __pyx_L3_error)
    }
    __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, 375, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_40getFieldDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_40getFieldDof(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", 0);

  /* "petsc4py/PETSc/Section.pyx":392
 * 
 *         """
 *         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, 392, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;
  __pyx_v_cnumDof = 0;

  /* "petsc4py/PETSc/Section.pyx":393
 *         """
 *         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, 393, __pyx_L1_error)
  __pyx_v_cfield = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":394
 *         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, 394, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":395
 *         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, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Section.pyx":375
 *         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":397
 *         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_43setFieldDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_42setFieldDof, "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:397");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_43setFieldDof = {"setFieldDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_43setFieldDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_42setFieldDof};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_43setFieldDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_numDof,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 397, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(45, 397, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 397, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 397, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFieldDof", 0) < (0)) __PYX_ERR(45, 397, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFieldDof", 1, 3, 3, i); __PYX_ERR(45, 397, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 397, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 397, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(45, 397, __pyx_L3_error)
    }
    __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, 397, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_42setFieldDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_numDof);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_42setFieldDof(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", 0);

  /* "petsc4py/PETSc/Section.pyx":416
 * 
 *         """
 *         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, 416, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":417
 *         """
 *         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, 417, __pyx_L1_error)
  __pyx_v_cfield = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":418
 *         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, 418, __pyx_L1_error)
  __pyx_v_cnumDof = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":419
 *         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, 419, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":397
 *         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":421
 *         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_45addFieldDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_44addFieldDof, "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:421");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_45addFieldDof = {"addFieldDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_45addFieldDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_44addFieldDof};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_45addFieldDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_numDof,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 421, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(45, 421, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 421, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 421, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addFieldDof", 0) < (0)) __PYX_ERR(45, 421, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addFieldDof", 1, 3, 3, i); __PYX_ERR(45, 421, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 421, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 421, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(45, 421, __pyx_L3_error)
    }
    __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, 421, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_44addFieldDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_numDof);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_44addFieldDof(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", 0);

  /* "petsc4py/PETSc/Section.pyx":440
 * 
 *         """
 *         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, 440, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":441
 *         """
 *         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, 441, __pyx_L1_error)
  __pyx_v_cfield = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":442
 *         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, 442, __pyx_L1_error)
  __pyx_v_cnumDof = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":443
 *         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, 443, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":421
 *         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":445
 *         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_47getConstraintDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_46getConstraintDof, "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:445");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_47getConstraintDof = {"getConstraintDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_47getConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_46getConstraintDof};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_47getConstraintDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 445, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 445, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getConstraintDof", 0) < (0)) __PYX_ERR(45, 445, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getConstraintDof", 1, 1, 1, i); __PYX_ERR(45, 445, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 445, __pyx_L3_error)
    }
    __pyx_v_point = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getConstraintDof", 1, 1, 1, __pyx_nargs); __PYX_ERR(45, 445, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_46getConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_46getConstraintDof(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", 0);

  /* "petsc4py/PETSc/Section.pyx":460
 * 
 *         """
 *         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, 460, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;
  __pyx_v_cnumDof = 0;

  /* "petsc4py/PETSc/Section.pyx":461
 *         """
 *         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, 461, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":462
 *         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, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Section.pyx":445
 *         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":464
 *         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_49setConstraintDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_48setConstraintDof, "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:464");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_49setConstraintDof = {"setConstraintDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_49setConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_48setConstraintDof};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_49setConstraintDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_numDof,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 464, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 464, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 464, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setConstraintDof", 0) < (0)) __PYX_ERR(45, 464, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setConstraintDof", 1, 2, 2, i); __PYX_ERR(45, 464, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 464, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 464, __pyx_L3_error)
    }
    __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, 464, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_48setConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_numDof);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_48setConstraintDof(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", 0);

  /* "petsc4py/PETSc/Section.pyx":481
 * 
 *         """
 *         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, 481, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":482
 *         """
 *         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, 482, __pyx_L1_error)
  __pyx_v_cnumDof = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":483
 *         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, 483, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":464
 *         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":485
 *         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_51addConstraintDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_50addConstraintDof, "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:485");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_51addConstraintDof = {"addConstraintDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_51addConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_50addConstraintDof};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_51addConstraintDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_numDof,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 485, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 485, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 485, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addConstraintDof", 0) < (0)) __PYX_ERR(45, 485, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addConstraintDof", 1, 2, 2, i); __PYX_ERR(45, 485, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 485, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 485, __pyx_L3_error)
    }
    __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, 485, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_50addConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_numDof);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_50addConstraintDof(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", 0);

  /* "petsc4py/PETSc/Section.pyx":502
 * 
 *         """
 *         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, 502, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":503
 *         """
 *         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, 503, __pyx_L1_error)
  __pyx_v_cnumDof = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":504
 *         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, 504, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":485
 *         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":506
 *         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_53getFieldConstraintDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_52getFieldConstraintDof, "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:506");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_53getFieldConstraintDof = {"getFieldConstraintDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_53getFieldConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_52getFieldConstraintDof};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_53getFieldConstraintDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 506, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFieldConstraintDof", 0) < (0)) __PYX_ERR(45, 506, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFieldConstraintDof", 1, 2, 2, i); __PYX_ERR(45, 506, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 506, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 506, __pyx_L3_error)
    }
    __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, 506, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_52getFieldConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_52getFieldConstraintDof(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", 0);

  /* "petsc4py/PETSc/Section.pyx":523
 * 
 *         """
 *         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, 523, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;
  __pyx_v_cnumDof = 0;

  /* "petsc4py/PETSc/Section.pyx":524
 *         """
 *         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, 524, __pyx_L1_error)
  __pyx_v_cfield = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":525
 *         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, 525, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":526
 *         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, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Section.pyx":506
 *         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":528
 *         return toInt(cnumDof)
 * 
 *     def setFieldConstraintDof(             # <<<<<<<<<<<<<<
 *         self,
 *         point: int,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_55setFieldConstraintDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_54setFieldConstraintDof, "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:528");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_55setFieldConstraintDof = {"setFieldConstraintDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_55setFieldConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_54setFieldConstraintDof};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_55setFieldConstraintDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_numDof,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 528, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(45, 528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFieldConstraintDof", 0) < (0)) __PYX_ERR(45, 528, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFieldConstraintDof", 1, 3, 3, i); __PYX_ERR(45, 528, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 528, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 528, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(45, 528, __pyx_L3_error)
    }
    __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, 528, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_54setFieldConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_numDof);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_54setFieldConstraintDof(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", 0);

  /* "petsc4py/PETSc/Section.pyx":552
 * 
 *         """
 *         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, 552, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":553
 *         """
 *         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, 553, __pyx_L1_error)
  __pyx_v_cfield = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":554
 *         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, 554, __pyx_L1_error)
  __pyx_v_cnumDof = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":555
 *         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, 555, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":528
 *         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":557
 *         CHKERR(PetscSectionSetFieldConstraintDof(self.sec, cpoint, cfield, cnumDof))
 * 
 *     def addFieldConstraintDof(             # <<<<<<<<<<<<<<
 *         self,
 *         point: int,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_57addFieldConstraintDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_56addFieldConstraintDof, "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:557");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_57addFieldConstraintDof = {"addFieldConstraintDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_57addFieldConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_56addFieldConstraintDof};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_57addFieldConstraintDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_numDof,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 557, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(45, 557, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 557, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 557, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addFieldConstraintDof", 0) < (0)) __PYX_ERR(45, 557, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addFieldConstraintDof", 1, 3, 3, i); __PYX_ERR(45, 557, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 557, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 557, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(45, 557, __pyx_L3_error)
    }
    __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, 557, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_56addFieldConstraintDof(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_numDof);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_56addFieldConstraintDof(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", 0);

  /* "petsc4py/PETSc/Section.pyx":581
 * 
 *         """
 *         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, 581, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":582
 *         """
 *         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, 582, __pyx_L1_error)
  __pyx_v_cfield = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":583
 *         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, 583, __pyx_L1_error)
  __pyx_v_cnumDof = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":584
 *         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, 584, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":557
 *         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":586
 *         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_59getConstraintIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_58getConstraintIndices, "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:586");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_59getConstraintIndices = {"getConstraintIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_59getConstraintIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_58getConstraintIndices};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_59getConstraintIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 586, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 586, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getConstraintIndices", 0) < (0)) __PYX_ERR(45, 586, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getConstraintIndices", 1, 1, 1, i); __PYX_ERR(45, 586, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 586, __pyx_L3_error)
    }
    __pyx_v_point = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getConstraintIndices", 1, 1, 1, __pyx_nargs); __PYX_ERR(45, 586, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_58getConstraintIndices(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_58getConstraintIndices(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", 0);

  /* "petsc4py/PETSc/Section.pyx":603
 * 
 *         """
 *         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, 603, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":604
 *         """
 *         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":605
 *         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":606
 *         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, 606, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":607
 *         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, 607, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":608
 *         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, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Section.pyx":586
 *         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":610
 *         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_61setConstraintIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_60setConstraintIndices, "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:610");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_61setConstraintIndices = {"setConstraintIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_61setConstraintIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_60setConstraintIndices};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_61setConstraintIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_indices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 610, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 610, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 610, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setConstraintIndices", 0) < (0)) __PYX_ERR(45, 610, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setConstraintIndices", 1, 2, 2, i); __PYX_ERR(45, 610, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 610, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 610, __pyx_L3_error)
    }
    __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, 610, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_60setConstraintIndices(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_indices);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_60setConstraintIndices(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":627
 * 
 *         """
 *         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, 627, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":628
 *         """
 *         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":629
 *         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":630
 *         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, 630, __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":631
 *         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, 631, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":632
 *         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, 632, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":610
 *         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":634
 *         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_63getFieldConstraintIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_62getFieldConstraintIndices, "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:634");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_63getFieldConstraintIndices = {"getFieldConstraintIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_63getFieldConstraintIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_62getFieldConstraintIndices};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_63getFieldConstraintIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 634, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 634, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 634, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFieldConstraintIndices", 0) < (0)) __PYX_ERR(45, 634, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFieldConstraintIndices", 1, 2, 2, i); __PYX_ERR(45, 634, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 634, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 634, __pyx_L3_error)
    }
    __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, 634, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_62getFieldConstraintIndices(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_62getFieldConstraintIndices(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", 0);

  /* "petsc4py/PETSc/Section.pyx":653
 * 
 *         """
 *         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, 653, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":654
 *         """
 *         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, 654, __pyx_L1_error)
  __pyx_v_cfield = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":655
 *         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":656
 *         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":657
 *         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, 657, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":658
 *         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, 658, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":659
 *         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, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Section.pyx":634
 *         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":661
 *         return array_i(nindex, indices)
 * 
 *     def setFieldConstraintIndices(             # <<<<<<<<<<<<<<
 *         self,
 *         point: int,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_65setFieldConstraintIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_64setFieldConstraintIndices, "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:661");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_65setFieldConstraintIndices = {"setFieldConstraintIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_65setFieldConstraintIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_64setFieldConstraintIndices};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_65setFieldConstraintIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_indices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 661, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(45, 661, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 661, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 661, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFieldConstraintIndices", 0) < (0)) __PYX_ERR(45, 661, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFieldConstraintIndices", 1, 3, 3, i); __PYX_ERR(45, 661, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 661, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 661, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(45, 661, __pyx_L3_error)
    }
    __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, 661, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_64setFieldConstraintIndices(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_indices);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_64setFieldConstraintIndices(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":684
 * 
 *         """
 *         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, 684, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":685
 *         """
 *         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, 685, __pyx_L1_error)
  __pyx_v_cfield = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":686
 *         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":687
 *         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":688
 *         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, 688, __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":689
 *         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, 689, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":690
 *         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, 690, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":661
 *         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":692
 *         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_67getMaxDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_66getMaxDof, "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:692");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_67getMaxDof = {"getMaxDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_67getMaxDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_66getMaxDof};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_67getMaxDof(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMaxDof", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_66getMaxDof(((struct PyPetscSectionObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_66getMaxDof(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", 0);

  /* "petsc4py/PETSc/Section.pyx":702
 * 
 *         """
 *         cdef PetscInt maxDof = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSectionGetMaxDof(self.sec, &maxDof))
 *         return toInt(maxDof)
*/
  __pyx_v_maxDof = 0;

  /* "petsc4py/PETSc/Section.pyx":703
 *         """
 *         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, 703, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":704
 *         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, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Section.pyx":692
 *         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":706
 *         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_69getStorageSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_68getStorageSize, "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:706");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_69getStorageSize = {"getStorageSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_69getStorageSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_68getStorageSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_69getStorageSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getStorageSize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_68getStorageSize(((struct PyPetscSectionObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_68getStorageSize(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", 0);

  /* "petsc4py/PETSc/Section.pyx":716
 * 
 *         """
 *         cdef PetscInt size = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSectionGetStorageSize(self.sec, &size))
 *         return toInt(size)
*/
  __pyx_v_size = 0;

  /* "petsc4py/PETSc/Section.pyx":717
 *         """
 *         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, 717, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":718
 *         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, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Section.pyx":706
 *         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":720
 *         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_71getConstrainedStorageSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_70getConstrainedStorageSize, "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:720");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_71getConstrainedStorageSize = {"getConstrainedStorageSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_71getConstrainedStorageSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_70getConstrainedStorageSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_71getConstrainedStorageSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getConstrainedStorageSize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_70getConstrainedStorageSize(((struct PyPetscSectionObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_70getConstrainedStorageSize(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", 0);

  /* "petsc4py/PETSc/Section.pyx":730
 * 
 *         """
 *         cdef PetscInt size = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSectionGetConstrainedStorageSize(self.sec, &size))
 *         return toInt(size)
*/
  __pyx_v_size = 0;

  /* "petsc4py/PETSc/Section.pyx":731
 *         """
 *         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, 731, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":732
 *         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, 732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Section.pyx":720
 *         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":734
 *         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_73getOffset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_72getOffset, "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:734");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_73getOffset = {"getOffset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_73getOffset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_72getOffset};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_73getOffset(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 734, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 734, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getOffset", 0) < (0)) __PYX_ERR(45, 734, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getOffset", 1, 1, 1, i); __PYX_ERR(45, 734, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 734, __pyx_L3_error)
    }
    __pyx_v_point = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getOffset", 1, 1, 1, __pyx_nargs); __PYX_ERR(45, 734, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_72getOffset(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_72getOffset(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", 0);

  /* "petsc4py/PETSc/Section.pyx":752
 * 
 *         """
 *         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, 752, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;
  __pyx_v_offset = 0;

  /* "petsc4py/PETSc/Section.pyx":753
 *         """
 *         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, 753, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":754
 *         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, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Section.pyx":734
 *         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":756
 *         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_75setOffset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_74setOffset, "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:756");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_75setOffset = {"setOffset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_75setOffset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_74setOffset};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_75setOffset(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_offset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 756, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 756, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 756, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOffset", 0) < (0)) __PYX_ERR(45, 756, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setOffset", 1, 2, 2, i); __PYX_ERR(45, 756, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 756, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 756, __pyx_L3_error)
    }
    __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, 756, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_74setOffset(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_offset);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_74setOffset(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", 0);

  /* "petsc4py/PETSc/Section.pyx":775
 * 
 *         """
 *         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, 775, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":776
 *         """
 *         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, 776, __pyx_L1_error)
  __pyx_v_coffset = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":777
 *         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, 777, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":756
 *         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":779
 *         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_77getFieldOffset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_76getFieldOffset, "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:779");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_77getFieldOffset = {"getFieldOffset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_77getFieldOffset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_76getFieldOffset};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_77getFieldOffset(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 779, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 779, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 779, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFieldOffset", 0) < (0)) __PYX_ERR(45, 779, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFieldOffset", 1, 2, 2, i); __PYX_ERR(45, 779, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 779, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 779, __pyx_L3_error)
    }
    __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, 779, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_76getFieldOffset(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_76getFieldOffset(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", 0);

  /* "petsc4py/PETSc/Section.pyx":799
 * 
 *         """
 *         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, 799, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":800
 *         """
 *         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, 800, __pyx_L1_error)
  __pyx_v_cfield = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":801
 *         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":802
 *         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, 802, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":803
 *         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, 803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Section.pyx":779
 *         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":805
 *         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_79setFieldOffset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_78setFieldOffset, "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:805");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_79setFieldOffset = {"setFieldOffset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_79setFieldOffset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_78setFieldOffset};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_79setFieldOffset(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_offset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 805, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(45, 805, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 805, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 805, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFieldOffset", 0) < (0)) __PYX_ERR(45, 805, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFieldOffset", 1, 3, 3, i); __PYX_ERR(45, 805, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 805, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(45, 805, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(45, 805, __pyx_L3_error)
    }
    __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, 805, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_78setFieldOffset(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_point, __pyx_v_field, __pyx_v_offset);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_78setFieldOffset(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", 0);

  /* "petsc4py/PETSc/Section.pyx":826
 * 
 *         """
 *         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, 826, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":827
 *         """
 *         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, 827, __pyx_L1_error)
  __pyx_v_cfield = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":828
 *         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, 828, __pyx_L1_error)
  __pyx_v_coffset = __pyx_t_1;

  /* "petsc4py/PETSc/Section.pyx":829
 *         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, 829, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":805
 *         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":831
 *         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_81getOffsetRange(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_80getOffsetRange, "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:831");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_81getOffsetRange = {"getOffsetRange", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_81getOffsetRange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_80getOffsetRange};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_81getOffsetRange(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOffsetRange", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_80getOffsetRange(((struct PyPetscSectionObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_80getOffsetRange(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", 0);

  /* "petsc4py/PETSc/Section.pyx":841
 * 
 *         """
 *         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":842
 *         """
 *         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, 842, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":843
 *         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, 843, __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, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(45, 843, __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) != (0)) __PYX_ERR(45, 843, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(45, 843, __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":831
 *         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":846
 * 
 *     # 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_83createGlobalSection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_82createGlobalSection, "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:846");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7Section_83createGlobalSection = {"createGlobalSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_83createGlobalSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_82createGlobalSection};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7Section_83createGlobalSection(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(45, 846, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 846, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createGlobalSection", 0) < (0)) __PYX_ERR(45, 846, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createGlobalSection", 1, 1, 1, i); __PYX_ERR(45, 846, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(45, 846, __pyx_L3_error)
    }
    __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, 846, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(45, 846, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7Section_82createGlobalSection(((struct PyPetscSectionObject *)__pyx_v_self), __pyx_v_sf);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7Section_82createGlobalSection(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createGlobalSection", 0);

  /* "petsc4py/PETSc/Section.pyx":876
 * 
 *         """
 *         cdef Section gsec = Section()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSectionCreateGlobalSection(self.sec, sf.sf, PETSC_TRUE, PETSC_FALSE, PETSC_FALSE, &gsec.sec))
 *         return gsec
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 876, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_gsec = ((struct PyPetscSectionObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Section.pyx":877
 *         """
 *         cdef Section gsec = Section()
 *         CHKERR(PetscSectionCreateGlobalSection(self.sec, sf.sf, PETSC_TRUE, PETSC_FALSE, PETSC_FALSE, &gsec.sec))             # <<<<<<<<<<<<<<
 *         return gsec
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionCreateGlobalSection(__pyx_v_self->sec, __pyx_v_sf->sf, PETSC_TRUE, PETSC_FALSE, PETSC_FALSE, (&__pyx_v_gsec->sec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(45, 877, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":878
 *         cdef Section gsec = Section()
 *         CHKERR(PetscSectionCreateGlobalSection(self.sec, sf.sf, PETSC_TRUE, 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":846
 * 
 *     # 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_XDECREF(__pyx_t_2);
  __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":299
 *     property i:
 *         "First logical grid coordinate."
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return toInt(self.stencil.i)
 * 
*/

/* 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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":300
 *         "First logical grid coordinate."
 *         def __get__(self) -> int:
 *             return toInt(self.stencil.i)             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value: int) -> None:
*/
  __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, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":299
 *     property i:
 *         "First logical grid coordinate."
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return toInt(self.stencil.i)
 * 
*/

  /* 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":302
 *             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":303
 * 
 *         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, 303, __pyx_L1_error)
  __pyx_v_self->stencil.i = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":302
 *             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":307
 *     property j:
 *         "Second logical grid coordinate."
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return toInt(self.stencil.j)
 * 
*/

/* 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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":308
 *         "Second logical grid coordinate."
 *         def __get__(self) -> int:
 *             return toInt(self.stencil.j)             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value: int) -> None:
*/
  __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, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":307
 *     property j:
 *         "Second logical grid coordinate."
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return toInt(self.stencil.j)
 * 
*/

  /* 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":310
 *             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":311
 * 
 *         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, 311, __pyx_L1_error)
  __pyx_v_self->stencil.j = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":310
 *             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":315
 *     property k:
 *         "Third logical grid coordinate."
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return toInt(self.stencil.k)
 * 
*/

/* 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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":316
 *         "Third logical grid coordinate."
 *         def __get__(self) -> int:
 *             return toInt(self.stencil.k)             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value: int) -> None:
*/
  __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, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":315
 *     property k:
 *         "Third logical grid coordinate."
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return toInt(self.stencil.k)
 * 
*/

  /* 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":318
 *             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":319
 * 
 *         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, 319, __pyx_L1_error)
  __pyx_v_self->stencil.k = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":318
 *             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":323
 *     property c:
 *         "Field component."
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return toInt(self.stencil.c)
 * 
*/

/* 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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":324
 *         "Field component."
 *         def __get__(self) -> int:
 *             return toInt(self.stencil.c)             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value: int) -> None:
*/
  __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, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":323
 *     property c:
 *         "Field component."
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return toInt(self.stencil.c)
 * 
*/

  /* 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":326
 *             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":327
 * 
 *         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, 327, __pyx_L1_error)
  __pyx_v_self->stencil.c = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":326
 *             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":331
 *     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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":332
 *         "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)
 * 
*/
  __pyx_v_s = (&__pyx_v_self->stencil);

  /* "petsc4py/PETSc/Mat.pyx":333
 *         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_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_s->i); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 333, __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, 333, __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, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 333, __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) != (0)) __PYX_ERR(46, 333, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(46, 333, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3) != (0)) __PYX_ERR(46, 333, __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":331
 *     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":335
 *             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":336
 * 
 *         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":337
 *         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":338
 *             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, 338, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":335
 *             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":342
 *     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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":343
 *         "Field component."
 *         def __get__(self) -> int:
 *             cdef PetscMatStencil *s = &self.stencil             # <<<<<<<<<<<<<<
 *             return toInt(s.c)
 * 
*/
  __pyx_v_s = (&__pyx_v_self->stencil);

  /* "petsc4py/PETSc/Mat.pyx":344
 *         def __get__(self) -> int:
 *             cdef PetscMatStencil *s = &self.stencil
 *             return toInt(s.c)             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value: int) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_s->c); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":342
 *     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":346
 *             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":347
 * 
 *         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":348
 *         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, 348, __pyx_L1_error)
  __pyx_v_s->c = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":346
 *             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
 * # --------------------------------------------------------------------
 * 
 * cdef PetscErrorCode MatHtoolKernelPython(             # <<<<<<<<<<<<<<
 *     PetscInt sdim,
 *     PetscInt M,
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatHtoolKernelPython(PetscInt __pyx_v_sdim, PetscInt __pyx_v_M, PetscInt __pyx_v_N, PetscInt const *__pyx_v_rows, PetscInt const *__pyx_v_cols, PetscScalar *__pyx_v_ptr, void *__pyx_v_ctx) {
  PyObject *__pyx_v_context = NULL;
  PyObject *__pyx_v_kernel = NULL;
  PyObject *__pyx_v_kernelctx = NULL;
  npy_intp __pyx_v_M_sz;
  npy_intp __pyx_v_N_sz;
  npy_intp __pyx_v_sz;
  PyArrayObject *__pyx_v_rows_arr = 0;
  PyArrayObject *__pyx_v_cols_arr = 0;
  PyArrayObject *__pyx_v_flat = 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 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatHtoolKernelPython", 0);

  /* "petsc4py/PETSc/Mat.pyx":362
 * ) except PETSC_ERR_PYTHON with gil:
 *     """Wrapper that calls a Python kernel for MatHtool matrices."""
 *     context = <object>ctx             # <<<<<<<<<<<<<<
 *     kernel = context[0]
 *     kernelctx = context[1]
*/
  __pyx_t_1 = ((PyObject *)__pyx_v_ctx);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_context = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":363
 *     """Wrapper that calls a Python kernel for MatHtool matrices."""
 *     context = <object>ctx
 *     kernel = context[0]             # <<<<<<<<<<<<<<
 *     kernelctx = context[1]
 *     cdef npy_intp M_sz = <npy_intp>M
*/
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_context, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_kernel = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":364
 *     context = <object>ctx
 *     kernel = context[0]
 *     kernelctx = context[1]             # <<<<<<<<<<<<<<
 *     cdef npy_intp M_sz = <npy_intp>M
 *     cdef npy_intp N_sz = <npy_intp>N
*/
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_context, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_kernelctx = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":365
 *     kernel = context[0]
 *     kernelctx = context[1]
 *     cdef npy_intp M_sz = <npy_intp>M             # <<<<<<<<<<<<<<
 *     cdef npy_intp N_sz = <npy_intp>N
 *     cdef npy_intp sz = M_sz * N_sz
*/
  __pyx_v_M_sz = ((npy_intp)__pyx_v_M);

  /* "petsc4py/PETSc/Mat.pyx":366
 *     kernelctx = context[1]
 *     cdef npy_intp M_sz = <npy_intp>M
 *     cdef npy_intp N_sz = <npy_intp>N             # <<<<<<<<<<<<<<
 *     cdef npy_intp sz = M_sz * N_sz
 *     cdef ndarray rows_arr = PyArray_SimpleNewFromData(1, &M_sz, NPY_PETSC_INT, <void*>rows)
*/
  __pyx_v_N_sz = ((npy_intp)__pyx_v_N);

  /* "petsc4py/PETSc/Mat.pyx":367
 *     cdef npy_intp M_sz = <npy_intp>M
 *     cdef npy_intp N_sz = <npy_intp>N
 *     cdef npy_intp sz = M_sz * N_sz             # <<<<<<<<<<<<<<
 *     cdef ndarray rows_arr = PyArray_SimpleNewFromData(1, &M_sz, NPY_PETSC_INT, <void*>rows)
 *     cdef ndarray cols_arr = PyArray_SimpleNewFromData(1, &N_sz, NPY_PETSC_INT, <void*>cols)
*/
  __pyx_v_sz = (__pyx_v_M_sz * __pyx_v_N_sz);

  /* "petsc4py/PETSc/Mat.pyx":368
 *     cdef npy_intp N_sz = <npy_intp>N
 *     cdef npy_intp sz = M_sz * N_sz
 *     cdef ndarray rows_arr = PyArray_SimpleNewFromData(1, &M_sz, NPY_PETSC_INT, <void*>rows)             # <<<<<<<<<<<<<<
 *     cdef ndarray cols_arr = PyArray_SimpleNewFromData(1, &N_sz, NPY_PETSC_INT, <void*>cols)
 *     cdef ndarray flat = PyArray_SimpleNewFromData(1, &sz, NPY_PETSC_SCALAR, <void*>ptr)
*/
  __pyx_t_1 = ((PyObject *)PyArray_SimpleNewFromData(1, (&__pyx_v_M_sz), NPY_PETSC_INT, ((void *)__pyx_v_rows))); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rows_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":369
 *     cdef npy_intp sz = M_sz * N_sz
 *     cdef ndarray rows_arr = PyArray_SimpleNewFromData(1, &M_sz, NPY_PETSC_INT, <void*>rows)
 *     cdef ndarray cols_arr = PyArray_SimpleNewFromData(1, &N_sz, NPY_PETSC_INT, <void*>cols)             # <<<<<<<<<<<<<<
 *     cdef ndarray flat = PyArray_SimpleNewFromData(1, &sz, NPY_PETSC_SCALAR, <void*>ptr)
 *     kernel(sdim, M, N, rows_arr, cols_arr, flat.reshape(M, N, order='F'), kernelctx)
*/
  __pyx_t_1 = ((PyObject *)PyArray_SimpleNewFromData(1, (&__pyx_v_N_sz), NPY_PETSC_INT, ((void *)__pyx_v_cols))); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cols_arr = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":370
 *     cdef ndarray rows_arr = PyArray_SimpleNewFromData(1, &M_sz, NPY_PETSC_INT, <void*>rows)
 *     cdef ndarray cols_arr = PyArray_SimpleNewFromData(1, &N_sz, NPY_PETSC_INT, <void*>cols)
 *     cdef ndarray flat = PyArray_SimpleNewFromData(1, &sz, NPY_PETSC_SCALAR, <void*>ptr)             # <<<<<<<<<<<<<<
 *     kernel(sdim, M, N, rows_arr, cols_arr, flat.reshape(M, N, order='F'), kernelctx)
 *     return PETSC_SUCCESS
*/
  __pyx_t_1 = ((PyObject *)PyArray_SimpleNewFromData(1, (&__pyx_v_sz), NPY_PETSC_SCALAR, ((void *)__pyx_v_ptr))); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_flat = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":371
 *     cdef ndarray cols_arr = PyArray_SimpleNewFromData(1, &N_sz, NPY_PETSC_INT, <void*>cols)
 *     cdef ndarray flat = PyArray_SimpleNewFromData(1, &sz, NPY_PETSC_SCALAR, <void*>ptr)
 *     kernel(sdim, M, N, rows_arr, cols_arr, flat.reshape(M, N, order='F'), kernelctx)             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_v_kernel);
  __pyx_t_3 = __pyx_v_kernel; 
  __pyx_t_4 = __Pyx_PyLong_From_PetscInt(__pyx_v_sdim); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_PetscInt(__pyx_v_M); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyLong_From_PetscInt(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(46, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = ((PyObject *)__pyx_v_flat);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyLong_From_PetscInt(__pyx_v_M); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyLong_From_PetscInt(__pyx_v_N); if (unlikely(!__pyx_t_10)) __PYX_ERR(46, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = 0;
  {
    PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_8, __pyx_t_9, __pyx_t_10};
    __pyx_t_12 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_order, __pyx_mstate_global->__pyx_n_u_F, __pyx_t_12, __pyx_callargs+3, 0) < (0)) __PYX_ERR(46, 371, __pyx_L1_error)
    __pyx_t_7 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_reshape, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_12);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
  }
  __pyx_t_11 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_11 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[8] = {__pyx_t_2, __pyx_t_4, __pyx_t_5, __pyx_t_6, ((PyObject *)__pyx_v_rows_arr), ((PyObject *)__pyx_v_cols_arr), __pyx_t_7, __pyx_v_kernelctx};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_11, (8-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":372
 *     cdef ndarray flat = PyArray_SimpleNewFromData(1, &sz, NPY_PETSC_SCALAR, <void*>ptr)
 *     kernel(sdim, M, N, rows_arr, cols_arr, flat.reshape(M, N, order='F'), kernelctx)
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":352
 * # --------------------------------------------------------------------
 * 
 * cdef PetscErrorCode MatHtoolKernelPython(             # <<<<<<<<<<<<<<
 *     PetscInt sdim,
 *     PetscInt M,
*/

  /* 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_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("petsc4py.PETSc.MatHtoolKernelPython", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_context);
  __Pyx_XDECREF(__pyx_v_kernel);
  __Pyx_XDECREF(__pyx_v_kernelctx);
  __Pyx_XDECREF((PyObject *)__pyx_v_rows_arr);
  __Pyx_XDECREF((PyObject *)__pyx_v_cols_arr);
  __Pyx_XDECREF((PyObject *)__pyx_v_flat);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":399
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":400
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.mat             # <<<<<<<<<<<<<<
 *         self.mat = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->mat));

  /* "petsc4py/PETSc/Mat.pyx":401
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.mat
 *         self.mat = NULL             # <<<<<<<<<<<<<<
 * 
 *     # unary operations
*/
  __pyx_v_self->mat = NULL;

  /* "petsc4py/PETSc/Mat.pyx":399
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.mat
 *         self.mat = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":405
 *     # 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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":406
 * 
 *     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, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":405
 *     # 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":408
 *         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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":409
 * 
 *     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, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":408
 *         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":413
 *     # 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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":414
 * 
 *     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, 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
 *     # 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":416
 *         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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":417
 * 
 *     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, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":416
 *         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":419
 *         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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":420
 * 
 *     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, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":419
 *         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":422
 *         return mat_imul(self, other)
 * 
 *     def __idiv__(self, other):             # <<<<<<<<<<<<<<
 *         return mat_idiv(self, other)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_13__idiv__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_12__idiv__, "Mat.__idiv__(self, other)\nSource code at petsc4py/PETSc/Mat.pyx:422");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_13__idiv__ = {"__idiv__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_13__idiv__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_12__idiv__};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_13__idiv__(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("__idiv__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 422, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 422, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__idiv__", 0) < (0)) __PYX_ERR(46, 422, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__idiv__", 1, 1, 1, i); __PYX_ERR(46, 422, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 422, __pyx_L3_error)
    }
    __pyx_v_other = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__idiv__", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 422, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.__idiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_12__idiv__(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_other);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":423
 * 
 *     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, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":422
 *         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;
}

/* "petsc4py/PETSc/Mat.pyx":425
 *         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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":426
 * 
 *     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, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":425
 *         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":430
 *     # 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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":431
 * 
 *     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, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":430
 *     # 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":433
 *         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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":434
 * 
 *     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, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":433
 *         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":436
 *         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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":437
 * 
 *     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, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":436
 *         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":439
 *         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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":440
 * 
 *     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, 440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":439
 *         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":442
 *         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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":443
 * 
 *     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, 443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":442
 *         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":445
 *         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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":446
 * 
 *     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, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":445
 *         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":448
 *         return mat_rmul(self, other)
 * 
 *     def __div__(self, other):             # <<<<<<<<<<<<<<
 *         return mat_div(self, other)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_29__div__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_28__div__, "Mat.__div__(self, other)\nSource code at petsc4py/PETSc/Mat.pyx:448");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_29__div__ = {"__div__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_29__div__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_28__div__};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_29__div__(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("__div__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 448, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 448, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__div__", 0) < (0)) __PYX_ERR(46, 448, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__div__", 1, 1, 1, i); __PYX_ERR(46, 448, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 448, __pyx_L3_error)
    }
    __pyx_v_other = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__div__", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 448, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_28__div__(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_other);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":449
 * 
 *     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, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":448
 *         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;
}

/* "petsc4py/PETSc/Mat.pyx":451
 *         return mat_div(self, other)
 * 
 *     def __rdiv__(self, other):             # <<<<<<<<<<<<<<
 *         return mat_rdiv(self, other)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_31__rdiv__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_30__rdiv__, "Mat.__rdiv__(self, other)\nSource code at petsc4py/PETSc/Mat.pyx:451");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_31__rdiv__ = {"__rdiv__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_31__rdiv__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_30__rdiv__};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_31__rdiv__(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("__rdiv__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_other,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 451, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 451, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__rdiv__", 0) < (0)) __PYX_ERR(46, 451, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__rdiv__", 1, 1, 1, i); __PYX_ERR(46, 451, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 451, __pyx_L3_error)
    }
    __pyx_v_other = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__rdiv__", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 451, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.__rdiv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_30__rdiv__(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_other);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":452
 * 
 *     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, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":451
 *         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;
}

/* "petsc4py/PETSc/Mat.pyx":454
 *         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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":455
 * 
 *     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, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":454
 *         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":457
 *         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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":458
 * 
 *     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, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":457
 *         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":460
 *         return mat_rdiv(self, other)
 * 
 *     def __matmul__(self, other):             # <<<<<<<<<<<<<<
 *         return mat_matmul(self, other)
 * 
*/

/* Python wrapper */
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;
}

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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":461
 * 
 *     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, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":460
 *         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;
}

/* "petsc4py/PETSc/Mat.pyx":465
 *     #
 * 
 *     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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":466
 * 
 *     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, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":465
 *     #
 * 
 *     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":468
 *         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":469
 * 
 *     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, 469, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":468
 *         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":471
 *         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_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 471, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 471, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 471, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(46, 471, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, i); __PYX_ERR(46, 471, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 471, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 471, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 471, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  size_t __pyx_t_4;
  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":472
 * 
 *     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":473
 *     def __call__(self, x, y=None):
 *         if y is None:
 *             y = self.createVecLeft()             # <<<<<<<<<<<<<<
 *         self.mult(x, y)
 *         return y
*/
    __pyx_t_3 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_createVecLeft, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 473, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Mat.pyx":472
 * 
 *     def __call__(self, x, y=None):
 *         if y is None:             # <<<<<<<<<<<<<<
 *             y = self.createVecLeft()
 *         self.mult(x, y)
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":474
 *         if y is None:
 *             y = self.createVecLeft()
 *         self.mult(x, y)             # <<<<<<<<<<<<<<
 *         return y
 *     #
*/
  __pyx_t_3 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_x, __pyx_v_y};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_mult, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":475
 *             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":471
 *         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_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":478
 *     #
 * 
 *     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:478");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_45view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_45view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_44view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 478, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 478, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(46, 478, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 478, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 478, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(46, 478, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Mat.pyx":499
 * 
 *         """
 *         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":500
 *         """
 *         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":501
 *         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, 501, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":478
 *     #
 * 
 *     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":503
 *         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:503");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_47destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_47destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_46destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Mat.pyx":513
 * 
 *         """
 *         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, 513, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":514
 *         """
 *         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":503
 *         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":516
 *         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:516");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_49create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_49create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_48create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 516, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 516, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(46, 516, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 516, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 516, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":536
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 536, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":537
 *         """
 *         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":538
 *         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, 538, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":539
 *         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, 539, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":540
 *         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":516
 *         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":542
 *         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:542");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_51setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_51setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_50setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 542, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 542, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(46, 542, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(46, 542, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 542, __pyx_L3_error)
    }
    __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, 542, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":557
 * 
 *         """
 *         cdef PetscMatType cval = NULL             # <<<<<<<<<<<<<<
 *         mat_type = str2bytes(mat_type, &cval)
 *         CHKERR(MatSetType(self.mat, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Mat.pyx":558
 *         """
 *         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, 558, __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":559
 *         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, 559, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":542
 *         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":561
 *         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:561");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_53setSizes = {"setSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_53setSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_52setSizes};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 561, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSizes", 0) < (0)) __PYX_ERR(46, 561, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":564
 *         self,
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the local, global and block sizes.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSizes", 0, 1, 2, i); __PYX_ERR(46, 561, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 561, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 561, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":561
 *         CHKERR(MatSetType(self.mat, cval))
 * 
 *     def setSizes(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":605
 * 
 *         """
 *         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":606
 *         """
 *         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, 606, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":607
 *         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, 607, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":608
 *         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":609
 *         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":610
 *         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, 610, __pyx_L1_error)

      /* "petsc4py/PETSc/Mat.pyx":609
 *         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":612
 *                 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, 612, __pyx_L1_error)
    }
    __pyx_L4:;

    /* "petsc4py/PETSc/Mat.pyx":608
 *         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":561
 *         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":614
 *                 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:614");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_55setBlockSize = {"setBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_55setBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_54setBlockSize};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bsize,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 614, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 614, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBlockSize", 0) < (0)) __PYX_ERR(46, 614, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBlockSize", 1, 1, 1, i); __PYX_ERR(46, 614, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 614, __pyx_L3_error)
    }
    __pyx_v_bsize = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setBlockSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 614, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":629
 * 
 *         """
 *         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, 629, __pyx_L1_error)
  __pyx_v_bs = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":630
 *         """
 *         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, 630, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":614
 *                 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":632
 *         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:632");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_57setBlockSizes = {"setBlockSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_57setBlockSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_56setBlockSizes};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_row_bsize,&__pyx_mstate_global->__pyx_n_u_col_bsize,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 632, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 632, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 632, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBlockSizes", 0) < (0)) __PYX_ERR(46, 632, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBlockSizes", 1, 2, 2, i); __PYX_ERR(46, 632, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 632, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 632, __pyx_L3_error)
    }
    __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, 632, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":649
 * 
 *         """
 *         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, 649, __pyx_L1_error)
  __pyx_v_rbs = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":650
 *         """
 *         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, 650, __pyx_L1_error)
  __pyx_v_cbs = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":651
 *         cdef PetscInt rbs = asInt(row_bsize)
 *         cdef PetscInt cbs = asInt(col_bsize)
 *         CHKERR(MatSetBlockSizes(self.mat, rbs, cbs))             # <<<<<<<<<<<<<<
 * 
 *     def setVariableBlockSizes(self, blocks: Sequence[int]) -> 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, 651, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":632
 *         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":653
 *         CHKERR(MatSetBlockSizes(self.mat, rbs, cbs))
 * 
 *     def setVariableBlockSizes(self, blocks: Sequence[int]) -> None:             # <<<<<<<<<<<<<<
 *         """Set diagonal point-blocks of the matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_59setVariableBlockSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_58setVariableBlockSizes, "Mat.setVariableBlockSizes(self, blocks: Sequence[int]) -> None\nSet diagonal point-blocks of the matrix.\n\n        Not collective.\n\n        See Also\n        --------\n        setBlockSize, petsc.MatSetVariableBlockSizes\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:653");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_59setVariableBlockSizes = {"setVariableBlockSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_59setVariableBlockSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_58setVariableBlockSizes};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_59setVariableBlockSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_blocks = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setVariableBlockSizes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_blocks,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 653, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 653, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setVariableBlockSizes", 0) < (0)) __PYX_ERR(46, 653, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setVariableBlockSizes", 1, 1, 1, i); __PYX_ERR(46, 653, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 653, __pyx_L3_error)
    }
    __pyx_v_blocks = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setVariableBlockSizes", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 653, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.setVariableBlockSizes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_58setVariableBlockSizes(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_blocks);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_58setVariableBlockSizes(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_blocks) {
  PetscInt __pyx_v_nb;
  PetscInt *__pyx_v_b;
  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("setVariableBlockSizes", 0);

  /* "petsc4py/PETSc/Mat.pyx":663
 * 
 *         """
 *         cdef PetscInt nb=0, *b=NULL             # <<<<<<<<<<<<<<
 *         iarray_i(blocks, &nb, &b)
 *         CHKERR(MatSetVariableBlockSizes(self.mat, nb, b))
*/
  __pyx_v_nb = 0;
  __pyx_v_b = NULL;

  /* "petsc4py/PETSc/Mat.pyx":664
 *         """
 *         cdef PetscInt nb=0, *b=NULL
 *         iarray_i(blocks, &nb, &b)             # <<<<<<<<<<<<<<
 *         CHKERR(MatSetVariableBlockSizes(self.mat, nb, b))
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_blocks, (&__pyx_v_nb), (&__pyx_v_b))); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":665
 *         cdef PetscInt nb=0, *b=NULL
 *         iarray_i(blocks, &nb, &b)
 *         CHKERR(MatSetVariableBlockSizes(self.mat, nb, b))             # <<<<<<<<<<<<<<
 * 
 *     def setVecType(self, vec_type: Vec.Type | str) -> None:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetVariableBlockSizes(__pyx_v_self->mat, __pyx_v_nb, __pyx_v_b)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 665, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":653
 *         CHKERR(MatSetBlockSizes(self.mat, rbs, cbs))
 * 
 *     def setVariableBlockSizes(self, blocks: Sequence[int]) -> None:             # <<<<<<<<<<<<<<
 *         """Set diagonal point-blocks of the 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.setVariableBlockSizes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":667
 *         CHKERR(MatSetVariableBlockSizes(self.mat, nb, b))
 * 
 *     def setVecType(self, vec_type: Vec.Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the vector type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_61setVecType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_60setVecType, "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:667");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_61setVecType = {"setVecType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_61setVecType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_60setVecType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_61setVecType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 667, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 667, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setVecType", 0) < (0)) __PYX_ERR(46, 667, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setVecType", 1, 1, 1, i); __PYX_ERR(46, 667, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 667, __pyx_L3_error)
    }
    __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, 667, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_60setVecType(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_vec_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_60setVecType(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":682
 * 
 *         """
 *         cdef PetscVecType cval = NULL             # <<<<<<<<<<<<<<
 *         vec_type = str2bytes(vec_type, &cval)
 *         CHKERR(MatSetVecType(self.mat, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Mat.pyx":683
 *         """
 *         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, 683, __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":684
 *         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, 684, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":667
 *         CHKERR(MatSetVariableBlockSizes(self.mat, nb, b))
 * 
 *     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":686
 *         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_63getVecType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_62getVecType, "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:686");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_63getVecType = {"getVecType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_63getVecType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_62getVecType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_63getVecType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getVecType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_62getVecType(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_62getVecType(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":696
 * 
 *         """
 *         cdef PetscVecType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetVecType(self.mat, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Mat.pyx":697
 *         """
 *         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, 697, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":698
 *         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, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":686
 *         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":700
 *         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_65setNestVecType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_64setNestVecType, "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:700");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_65setNestVecType = {"setNestVecType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_65setNestVecType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_64setNestVecType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_65setNestVecType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 700, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 700, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNestVecType", 0) < (0)) __PYX_ERR(46, 700, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNestVecType", 1, 1, 1, i); __PYX_ERR(46, 700, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 700, __pyx_L3_error)
    }
    __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, 700, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_64setNestVecType(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_vec_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_64setNestVecType(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":715
 * 
 *         """
 *         cdef PetscVecType cval = NULL             # <<<<<<<<<<<<<<
 *         vec_type = str2bytes(vec_type, &cval)
 *         CHKERR(MatNestSetVecType(self.mat, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Mat.pyx":716
 *         """
 *         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, 716, __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":717
 *         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, 717, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":700
 *         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":721
 *     #
 * 
 *     def createAIJ(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_67createAIJ(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_66createAIJ, "Mat.createAIJ(self, size: MatSizeSpec, bsize: MatBlockSizeSpec | None = None, nnz: NNZSpec | None = None, csr: CSRSpec | 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 <petsc:sec_matsparse>` 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:721");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_67createAIJ = {"createAIJ", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_67createAIJ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_66createAIJ};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_67createAIJ(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_csr,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 721, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createAIJ", 0) < (0)) __PYX_ERR(46, 721, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":724
 *         self,
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,             # <<<<<<<<<<<<<<
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":725
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,
 *         nnz: NNZSpec | None = None,             # <<<<<<<<<<<<<<
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":726
 *         bsize: MatBlockSizeSpec | None = None,
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a sparse `Type.AIJ` matrix, optionally preallocating.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":727
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a sparse `Type.AIJ` matrix, optionally preallocating.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createAIJ", 0, 1, 5, i); __PYX_ERR(46, 721, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 721, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":724
 *         self,
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,             # <<<<<<<<<<<<<<
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":725
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,
 *         nnz: NNZSpec | None = None,             # <<<<<<<<<<<<<<
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":726
 *         bsize: MatBlockSizeSpec | None = None,
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a sparse `Type.AIJ` matrix, optionally preallocating.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":727
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a sparse `Type.AIJ` matrix, optionally preallocating.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 721, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_66createAIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_nnz, __pyx_v_csr, __pyx_v_comm);

  /* "petsc4py/PETSc/Mat.pyx":721
 *     #
 * 
 *     def createAIJ(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_66createAIJ(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":759
 *         """
 *         # 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":760
 *         # 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, 760, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":761
 *         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, 761, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":763
 *         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, 763, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":764
 *         # 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":721
 *     #
 * 
 *     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":766
 *         return self
 * 
 *     def createBAIJ(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_69createBAIJ(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_68createBAIJ, "Mat.createBAIJ(self, size: MatSizeSpec, bsize: MatBlockSizeSpec, nnz: NNZSpec | None = None, csr: CSRSpec | 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 <petsc:sec_matsparse>` 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:766");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_69createBAIJ = {"createBAIJ", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_69createBAIJ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_68createBAIJ};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_69createBAIJ(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_csr,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 766, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 766, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 766, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 766, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 766, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 766, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createBAIJ", 0) < (0)) __PYX_ERR(46, 766, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":770
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec,
 *         nnz: NNZSpec | None = None,             # <<<<<<<<<<<<<<
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":771
 *         bsize: MatBlockSizeSpec,
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a sparse blocked `Type.BAIJ` matrix, optionally preallocating.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":772
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a sparse blocked `Type.BAIJ` matrix, optionally preallocating.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createBAIJ", 0, 2, 5, i); __PYX_ERR(46, 766, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 766, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 766, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 766, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 766, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 766, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":770
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec,
 *         nnz: NNZSpec | None = None,             # <<<<<<<<<<<<<<
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":771
 *         bsize: MatBlockSizeSpec,
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a sparse blocked `Type.BAIJ` matrix, optionally preallocating.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":772
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a sparse blocked `Type.BAIJ` matrix, optionally preallocating.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 766, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_68createBAIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_nnz, __pyx_v_csr, __pyx_v_comm);

  /* "petsc4py/PETSc/Mat.pyx":766
 *         return self
 * 
 *     def createBAIJ(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_68createBAIJ(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":803
 *         """
 *         # 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":804
 *         # 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, 804, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":805
 *         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, 805, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":807
 *         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, 807, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":808
 *         # 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":766
 *         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":810
 *         return self
 * 
 *     def createSBAIJ(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_71createSBAIJ(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_70createSBAIJ, "Mat.createSBAIJ(self, size: MatSizeSpec, bsize: MatBlockSizeSpec, nnz: NNZSpec | None = None, csr: CSRSpec | 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 <petsc:sec_matsparse>` 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:810");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_71createSBAIJ = {"createSBAIJ", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_71createSBAIJ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_70createSBAIJ};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_71createSBAIJ(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_csr,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 810, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 810, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 810, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 810, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 810, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 810, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createSBAIJ", 0) < (0)) __PYX_ERR(46, 810, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":814
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec,
 *         nnz: NNZSpec | None = None,             # <<<<<<<<<<<<<<
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":815
 *         bsize: MatBlockSizeSpec,
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a sparse `Type.SBAIJ` matrix in symmetric block format.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":816
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a sparse `Type.SBAIJ` matrix in symmetric block format.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createSBAIJ", 0, 2, 5, i); __PYX_ERR(46, 810, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 810, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 810, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 810, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 810, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 810, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":814
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec,
 *         nnz: NNZSpec | None = None,             # <<<<<<<<<<<<<<
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":815
 *         bsize: MatBlockSizeSpec,
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a sparse `Type.SBAIJ` matrix in symmetric block format.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":816
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a sparse `Type.SBAIJ` matrix in symmetric block format.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 810, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_70createSBAIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_nnz, __pyx_v_csr, __pyx_v_comm);

  /* "petsc4py/PETSc/Mat.pyx":810
 *         return self
 * 
 *     def createSBAIJ(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_70createSBAIJ(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":847
 *         """
 *         # 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":848
 *         # 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, 848, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":849
 *         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, 849, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":851
 *         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, 851, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":852
 *         # 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":810
 *         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":854
 *         return self
 * 
 *     def createAIJCRL(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_73createAIJCRL(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_72createAIJCRL, "Mat.createAIJCRL(self, size: MatSizeSpec, bsize: MatBlockSizeSpec | None = None, nnz: NNZSpec | None = None, csr: CSRSpec | 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 <petsc:sec_matsparse>` 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:854");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_73createAIJCRL = {"createAIJCRL", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_73createAIJCRL, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_72createAIJCRL};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_73createAIJCRL(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_csr,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 854, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createAIJCRL", 0) < (0)) __PYX_ERR(46, 854, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":857
 *         self,
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,             # <<<<<<<<<<<<<<
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":858
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,
 *         nnz: NNZSpec | None = None,             # <<<<<<<<<<<<<<
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":859
 *         bsize: MatBlockSizeSpec | None = None,
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a sparse `Type.AIJCRL` matrix.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":860
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a sparse `Type.AIJCRL` matrix.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createAIJCRL", 0, 1, 5, i); __PYX_ERR(46, 854, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 854, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":857
 *         self,
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,             # <<<<<<<<<<<<<<
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":858
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,
 *         nnz: NNZSpec | None = None,             # <<<<<<<<<<<<<<
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":859
 *         bsize: MatBlockSizeSpec | None = None,
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a sparse `Type.AIJCRL` matrix.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":860
 *         nnz: NNZSpec | None = None,
 *         csr: CSRSpec | CSRIndicesSpec | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a sparse `Type.AIJCRL` matrix.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 854, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_72createAIJCRL(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_nnz, __pyx_v_csr, __pyx_v_comm);

  /* "petsc4py/PETSc/Mat.pyx":854
 *         return self
 * 
 *     def createAIJCRL(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_72createAIJCRL(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":894
 *         """
 *         # 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":895
 *         # 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, 895, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":896
 *         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, 896, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":898
 *         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, 898, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":899
 *         # 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":854
 *         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":901
 *         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_75setPreallocationNNZ(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_74setPreallocationNNZ, "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:901");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_75setPreallocationNNZ = {"setPreallocationNNZ", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_75setPreallocationNNZ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_74setPreallocationNNZ};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_75setPreallocationNNZ(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nnz,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 901, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 901, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPreallocationNNZ", 0) < (0)) __PYX_ERR(46, 901, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPreallocationNNZ", 1, 1, 1, i); __PYX_ERR(46, 901, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 901, __pyx_L3_error)
    }
    __pyx_v_nnz = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPreallocationNNZ", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 901, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_74setPreallocationNNZ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nnz);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_74setPreallocationNNZ(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":921
 * 
 *         """
 *         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":922
 *         """
 *         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, 922, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":924
 *         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, 924, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":925
 *         # if done: raise Error(PETSC_ERR_ORDER)
 *         Mat_AllocAIJ_NNZ(self.mat, nnz)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def setPreallocationCOO(self, coo_i: Sequence[int], coo_j: Sequence[int]) -> Self:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":901
 *         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":927
 *         return self
 * 
 *     def setPreallocationCOO(self, coo_i: Sequence[int], coo_j: Sequence[int]) -> Self:             # <<<<<<<<<<<<<<
 *         """Set preallocation using coordinate format with global indices.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_77setPreallocationCOO(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_76setPreallocationCOO, "Mat.setPreallocationCOO(self, coo_i: Sequence[int], coo_j: Sequence[int]) -> Self\nSet preallocation using coordinate format with global indices.\n\n        Collective.\n\n        Parameters\n        ----------\n        coo_i\n            Row indices in COO format.\n        coo_j\n            Column indices in COO format.\n\n        See Also\n        --------\n        setValuesCOO, setPreallocationNNZ, setPreallocationCSR\n        petsc.MatSetPreallocationCOO\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:927");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_77setPreallocationCOO = {"setPreallocationCOO", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_77setPreallocationCOO, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_76setPreallocationCOO};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_77setPreallocationCOO(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_coo_i = 0;
  PyObject *__pyx_v_coo_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("setPreallocationCOO (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_coo_i,&__pyx_mstate_global->__pyx_n_u_coo_j,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 927, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 927, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 927, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPreallocationCOO", 0) < (0)) __PYX_ERR(46, 927, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPreallocationCOO", 1, 2, 2, i); __PYX_ERR(46, 927, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 927, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 927, __pyx_L3_error)
    }
    __pyx_v_coo_i = values[0];
    __pyx_v_coo_j = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPreallocationCOO", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 927, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPreallocationCOO", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_76setPreallocationCOO(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_coo_i, __pyx_v_coo_j);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_76setPreallocationCOO(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_coo_i, PyObject *__pyx_v_coo_j) {
  PetscInt __pyx_v_ncoo_i;
  PetscInt __pyx_v_ncoo_j;
  PetscInt *__pyx_v_ccoo_i;
  PetscInt *__pyx_v_ccoo_j;
  PetscCount __pyx_v_ncoo;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setPreallocationCOO", 0);
  __Pyx_INCREF(__pyx_v_coo_i);
  __Pyx_INCREF(__pyx_v_coo_j);

  /* "petsc4py/PETSc/Mat.pyx":945
 * 
 *         """
 *         cdef PetscInt ncoo_i = 0, ncoo_j = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt *ccoo_i = NULL, *ccoo_j = NULL
 *         cdef PetscCount ncoo = 0
*/
  __pyx_v_ncoo_i = 0;
  __pyx_v_ncoo_j = 0;

  /* "petsc4py/PETSc/Mat.pyx":946
 *         """
 *         cdef PetscInt ncoo_i = 0, ncoo_j = 0
 *         cdef PetscInt *ccoo_i = NULL, *ccoo_j = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscCount ncoo = 0
 * 
*/
  __pyx_v_ccoo_i = NULL;
  __pyx_v_ccoo_j = NULL;

  /* "petsc4py/PETSc/Mat.pyx":947
 *         cdef PetscInt ncoo_i = 0, ncoo_j = 0
 *         cdef PetscInt *ccoo_i = NULL, *ccoo_j = NULL
 *         cdef PetscCount ncoo = 0             # <<<<<<<<<<<<<<
 * 
 *         coo_i = iarray_i(coo_i, &ncoo_i, &ccoo_i)
*/
  __pyx_v_ncoo = 0;

  /* "petsc4py/PETSc/Mat.pyx":949
 *         cdef PetscCount ncoo = 0
 * 
 *         coo_i = iarray_i(coo_i, &ncoo_i, &ccoo_i)             # <<<<<<<<<<<<<<
 *         coo_j = iarray_i(coo_j, &ncoo_j, &ccoo_j)
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_coo_i, (&__pyx_v_ncoo_i), (&__pyx_v_ccoo_i))); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_coo_i, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":950
 * 
 *         coo_i = iarray_i(coo_i, &ncoo_i, &ccoo_i)
 *         coo_j = iarray_i(coo_j, &ncoo_j, &ccoo_j)             # <<<<<<<<<<<<<<
 * 
 *         if ncoo_i != ncoo_j:
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_coo_j, (&__pyx_v_ncoo_j), (&__pyx_v_ccoo_j))); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_coo_j, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":952
 *         coo_j = iarray_i(coo_j, &ncoo_j, &ccoo_j)
 * 
 *         if ncoo_i != ncoo_j:             # <<<<<<<<<<<<<<
 *             raise ValueError("coo_i and coo_j must have the same length")
 * 
*/
  __pyx_t_2 = (__pyx_v_ncoo_i != __pyx_v_ncoo_j);
  if (unlikely(__pyx_t_2)) {

    /* "petsc4py/PETSc/Mat.pyx":953
 * 
 *         if ncoo_i != ncoo_j:
 *             raise ValueError("coo_i and coo_j must have the same length")             # <<<<<<<<<<<<<<
 * 
 *         ncoo = <PetscCount> ncoo_i
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_coo_i_and_coo_j_must_have_the_sa};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 953, __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(46, 953, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":952
 *         coo_j = iarray_i(coo_j, &ncoo_j, &ccoo_j)
 * 
 *         if ncoo_i != ncoo_j:             # <<<<<<<<<<<<<<
 *             raise ValueError("coo_i and coo_j must have the same length")
 * 
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":955
 *             raise ValueError("coo_i and coo_j must have the same length")
 * 
 *         ncoo = <PetscCount> ncoo_i             # <<<<<<<<<<<<<<
 *         CHKERR(MatSetPreallocationCOO(self.mat, ncoo, ccoo_i, ccoo_j))
 *         return self
*/
  __pyx_v_ncoo = ((PetscCount)__pyx_v_ncoo_i);

  /* "petsc4py/PETSc/Mat.pyx":956
 * 
 *         ncoo = <PetscCount> ncoo_i
 *         CHKERR(MatSetPreallocationCOO(self.mat, ncoo, ccoo_i, ccoo_j))             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetPreallocationCOO(__pyx_v_self->mat, __pyx_v_ncoo, __pyx_v_ccoo_i, __pyx_v_ccoo_j)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 956, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":957
 *         ncoo = <PetscCount> ncoo_i
 *         CHKERR(MatSetPreallocationCOO(self.mat, ncoo, ccoo_i, ccoo_j))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def setPreallocationCOOLocal(self, coo_i: Sequence[int], coo_j: Sequence[int]) -> Self:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":927
 *         return self
 * 
 *     def setPreallocationCOO(self, coo_i: Sequence[int], coo_j: Sequence[int]) -> Self:             # <<<<<<<<<<<<<<
 *         """Set preallocation using coordinate format with global indices.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPreallocationCOO", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_coo_i);
  __Pyx_XDECREF(__pyx_v_coo_j);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":959
 *         return self
 * 
 *     def setPreallocationCOOLocal(self, coo_i: Sequence[int], coo_j: Sequence[int]) -> Self:             # <<<<<<<<<<<<<<
 *         """Set preallocation using coordinate format with local indices.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_79setPreallocationCOOLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_78setPreallocationCOOLocal, "Mat.setPreallocationCOOLocal(self, coo_i: Sequence[int], coo_j: Sequence[int]) -> Self\nSet preallocation using coordinate format with local indices.\n\n        Collective.\n\n        Parameters\n        ----------\n        coo_i\n            Row indices in COO format.\n        coo_j\n            Column indices in COO format.\n\n        See Also\n        --------\n        setPreallocationCOO, setValuesCOO, setLGMap\n        petsc.MatSetPreallocationCOOLocal, petsc.MatSetPreallocationCOOLocal\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:959");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_79setPreallocationCOOLocal = {"setPreallocationCOOLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_79setPreallocationCOOLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_78setPreallocationCOOLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_79setPreallocationCOOLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_coo_i = 0;
  PyObject *__pyx_v_coo_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("setPreallocationCOOLocal (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_coo_i,&__pyx_mstate_global->__pyx_n_u_coo_j,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 959, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 959, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 959, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPreallocationCOOLocal", 0) < (0)) __PYX_ERR(46, 959, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPreallocationCOOLocal", 1, 2, 2, i); __PYX_ERR(46, 959, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 959, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 959, __pyx_L3_error)
    }
    __pyx_v_coo_i = values[0];
    __pyx_v_coo_j = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPreallocationCOOLocal", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 959, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPreallocationCOOLocal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_78setPreallocationCOOLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_coo_i, __pyx_v_coo_j);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_78setPreallocationCOOLocal(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_coo_i, PyObject *__pyx_v_coo_j) {
  PetscInt __pyx_v_ncoo_i;
  PetscInt __pyx_v_ncoo_j;
  PetscInt *__pyx_v_ccoo_i;
  PetscInt *__pyx_v_ccoo_j;
  PetscCount __pyx_v_ncoo;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setPreallocationCOOLocal", 0);
  __Pyx_INCREF(__pyx_v_coo_i);
  __Pyx_INCREF(__pyx_v_coo_j);

  /* "petsc4py/PETSc/Mat.pyx":977
 * 
 *         """
 *         cdef PetscInt ncoo_i = 0, ncoo_j = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt *ccoo_i = NULL, *ccoo_j = NULL
 *         cdef PetscCount ncoo = 0
*/
  __pyx_v_ncoo_i = 0;
  __pyx_v_ncoo_j = 0;

  /* "petsc4py/PETSc/Mat.pyx":978
 *         """
 *         cdef PetscInt ncoo_i = 0, ncoo_j = 0
 *         cdef PetscInt *ccoo_i = NULL, *ccoo_j = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscCount ncoo = 0
 * 
*/
  __pyx_v_ccoo_i = NULL;
  __pyx_v_ccoo_j = NULL;

  /* "petsc4py/PETSc/Mat.pyx":979
 *         cdef PetscInt ncoo_i = 0, ncoo_j = 0
 *         cdef PetscInt *ccoo_i = NULL, *ccoo_j = NULL
 *         cdef PetscCount ncoo = 0             # <<<<<<<<<<<<<<
 * 
 *         coo_i = iarray_i(coo_i, &ncoo_i, &ccoo_i)
*/
  __pyx_v_ncoo = 0;

  /* "petsc4py/PETSc/Mat.pyx":981
 *         cdef PetscCount ncoo = 0
 * 
 *         coo_i = iarray_i(coo_i, &ncoo_i, &ccoo_i)             # <<<<<<<<<<<<<<
 *         coo_j = iarray_i(coo_j, &ncoo_j, &ccoo_j)
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_coo_i, (&__pyx_v_ncoo_i), (&__pyx_v_ccoo_i))); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_coo_i, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":982
 * 
 *         coo_i = iarray_i(coo_i, &ncoo_i, &ccoo_i)
 *         coo_j = iarray_i(coo_j, &ncoo_j, &ccoo_j)             # <<<<<<<<<<<<<<
 * 
 *         if ncoo_i != ncoo_j:
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_coo_j, (&__pyx_v_ncoo_j), (&__pyx_v_ccoo_j))); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_coo_j, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":984
 *         coo_j = iarray_i(coo_j, &ncoo_j, &ccoo_j)
 * 
 *         if ncoo_i != ncoo_j:             # <<<<<<<<<<<<<<
 *             raise ValueError("coo_i and coo_j must have the same length")
 * 
*/
  __pyx_t_2 = (__pyx_v_ncoo_i != __pyx_v_ncoo_j);
  if (unlikely(__pyx_t_2)) {

    /* "petsc4py/PETSc/Mat.pyx":985
 * 
 *         if ncoo_i != ncoo_j:
 *             raise ValueError("coo_i and coo_j must have the same length")             # <<<<<<<<<<<<<<
 * 
 *         ncoo = <PetscCount> ncoo_i
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_coo_i_and_coo_j_must_have_the_sa};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 985, __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(46, 985, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":984
 *         coo_j = iarray_i(coo_j, &ncoo_j, &ccoo_j)
 * 
 *         if ncoo_i != ncoo_j:             # <<<<<<<<<<<<<<
 *             raise ValueError("coo_i and coo_j must have the same length")
 * 
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":987
 *             raise ValueError("coo_i and coo_j must have the same length")
 * 
 *         ncoo = <PetscCount> ncoo_i             # <<<<<<<<<<<<<<
 *         CHKERR(MatSetPreallocationCOOLocal(self.mat, ncoo, ccoo_i, ccoo_j))
 *         return self
*/
  __pyx_v_ncoo = ((PetscCount)__pyx_v_ncoo_i);

  /* "petsc4py/PETSc/Mat.pyx":988
 * 
 *         ncoo = <PetscCount> ncoo_i
 *         CHKERR(MatSetPreallocationCOOLocal(self.mat, ncoo, ccoo_i, ccoo_j))             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetPreallocationCOOLocal(__pyx_v_self->mat, __pyx_v_ncoo, __pyx_v_ccoo_i, __pyx_v_ccoo_j)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 988, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":989
 *         ncoo = <PetscCount> ncoo_i
 *         CHKERR(MatSetPreallocationCOOLocal(self.mat, ncoo, ccoo_i, ccoo_j))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def setPreallocationCSR(self, csr: CSRSpec | 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":959
 *         return self
 * 
 *     def setPreallocationCOOLocal(self, coo_i: Sequence[int], coo_j: Sequence[int]) -> Self:             # <<<<<<<<<<<<<<
 *         """Set preallocation using coordinate format with local indices.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.setPreallocationCOOLocal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_coo_i);
  __Pyx_XDECREF(__pyx_v_coo_j);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":991
 *         return self
 * 
 *     def setPreallocationCSR(self, csr: CSRSpec | CSRIndicesSpec) -> Self:             # <<<<<<<<<<<<<<
 *         """Preallocate memory for the matrix with a CSR layout.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_81setPreallocationCSR(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_80setPreallocationCSR, "Mat.setPreallocationCSR(self, csr: CSRSpec | 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:991");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_81setPreallocationCSR = {"setPreallocationCSR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_81setPreallocationCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_80setPreallocationCSR};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_81setPreallocationCSR(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_csr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 991, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 991, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPreallocationCSR", 0) < (0)) __PYX_ERR(46, 991, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPreallocationCSR", 1, 1, 1, i); __PYX_ERR(46, 991, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 991, __pyx_L3_error)
    }
    __pyx_v_csr = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPreallocationCSR", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 991, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_80setPreallocationCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_csr);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_80setPreallocationCSR(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":1019
 * 
 *         """
 *         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":1020
 *         """
 *         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, 1020, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1022
 *         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, 1022, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1023
 *         # if done: raise Error(PETSC_ERR_ORDER)
 *         Mat_AllocAIJ_CSR(self.mat, csr)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def preallocatorPreallocate(self, Mat A, fill: bool = True) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":991
 *         return self
 * 
 *     def setPreallocationCSR(self, csr: CSRSpec | 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":1025
 *         return self
 * 
 *     def preallocatorPreallocate(self, Mat A, fill: bool = True) -> None:             # <<<<<<<<<<<<<<
 *         """Preallocate memory for a matrix using a preallocator matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_83preallocatorPreallocate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_82preallocatorPreallocate, "Mat.preallocatorPreallocate(self, A: Mat, fill: bool = True) -> None\nPreallocate memory for a matrix using a preallocator matrix.\n\n        Collective.\n\n        The current matrix (``self``) must be of type `Type.PREALLOCATOR`.\n\n        Parameters\n        ----------\n        A\n            The matrix to be preallocated.\n        fill\n            Flag indicating whether or not to insert zeros into\n            the newly allocated matrix, defaults to `True`.\n\n        See Also\n        --------\n        petsc.MatPreallocatorPreallocate\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:1025");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_83preallocatorPreallocate = {"preallocatorPreallocate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_83preallocatorPreallocate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_82preallocatorPreallocate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_83preallocatorPreallocate(PyObject *__pyx_v_self, 
#if 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_fill = 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("preallocatorPreallocate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_fill,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1025, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1025, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1025, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "preallocatorPreallocate", 0) < (0)) __PYX_ERR(46, 1025, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("preallocatorPreallocate", 0, 1, 2, i); __PYX_ERR(46, 1025, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1025, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1025, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_A = ((struct PyPetscMatObject *)values[0]);
    __pyx_v_fill = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("preallocatorPreallocate", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 1025, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.preallocatorPreallocate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "A", 0))) __PYX_ERR(46, 1025, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_82preallocatorPreallocate(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_A, __pyx_v_fill);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_82preallocatorPreallocate(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A, PyObject *__pyx_v_fill) {
  PetscBool __pyx_v_cfill;
  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("preallocatorPreallocate", 0);

  /* "petsc4py/PETSc/Mat.pyx":1045
 * 
 *         """
 *         cdef PetscBool cfill = asBool(fill)             # <<<<<<<<<<<<<<
 *         CHKERR(MatPreallocatorPreallocate(self.mat, cfill, A.mat))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_fill); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(46, 1045, __pyx_L1_error)
  __pyx_v_cfill = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":1046
 *         """
 *         cdef PetscBool cfill = asBool(fill)
 *         CHKERR(MatPreallocatorPreallocate(self.mat, cfill, A.mat))             # <<<<<<<<<<<<<<
 * 
 *     def createAIJWithArrays(
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatPreallocatorPreallocate(__pyx_v_self->mat, __pyx_v_cfill, __pyx_v_A->mat)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1046, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1025
 *         return self
 * 
 *     def preallocatorPreallocate(self, Mat A, fill: bool = True) -> None:             # <<<<<<<<<<<<<<
 *         """Preallocate memory for a matrix using a preallocator matrix.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.preallocatorPreallocate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":1048
 *         CHKERR(MatPreallocatorPreallocate(self.mat, cfill, A.mat))
 * 
 *     def createAIJWithArrays(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_85createAIJWithArrays(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_84createAIJWithArrays, "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:1048");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_85createAIJWithArrays = {"createAIJWithArrays", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_85createAIJWithArrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_84createAIJWithArrays};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_85createAIJWithArrays(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_csr,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1048, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 1048, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1048, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1048, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1048, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createAIJWithArrays", 0) < (0)) __PYX_ERR(46, 1048, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":1052
 *         size: MatSizeSpec,
 *         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.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1053
 *         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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createAIJWithArrays", 0, 2, 4, i); __PYX_ERR(46, 1048, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 1048, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1048, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1048, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1048, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":1052
 *         size: MatSizeSpec,
 *         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.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1053
 *         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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1048, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_84createAIJWithArrays(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_csr, __pyx_v_bsize, __pyx_v_comm);

  /* "petsc4py/PETSc/Mat.pyx":1048
 *         CHKERR(MatPreallocatorPreallocate(self.mat, cfill, A.mat))
 * 
 *     def createAIJWithArrays(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_84createAIJWithArrays(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;
  PyObject *__pyx_t_16[7];
  size_t __pyx_t_17;
  int __pyx_t_18;
  PyObject *__pyx_t_19[5];
  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":1082
 *         """
 *         # 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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 1082, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":1084
 *         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":1085
 *         # 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, 1085, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1086
 *         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":1087
 *         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":1088
 *         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, 1088, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1089
 *         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, 1089, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1092
 *         # 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":1093
 *         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, 1093, __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_INCREF(__pyx_t_7);
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_8);
        } else {
          __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 1093, __pyx_L5_error)
          __Pyx_XGOTREF(__pyx_t_7);
          __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 1093, __pyx_L5_error)
          __Pyx_XGOTREF(__pyx_t_8);
        }
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 1093, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 1093, __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, 1093, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 1093, __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, 1093, __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, 1093, __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_INCREF(__pyx_t_9);
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_11);
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2);
          __Pyx_INCREF(__pyx_t_12);
        } else {
          __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 1093, __pyx_L5_error)
          __Pyx_XGOTREF(__pyx_t_9);
          __pyx_t_11 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 1093, __pyx_L5_error)
          __Pyx_XGOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 1093, __pyx_L5_error)
          __Pyx_XGOTREF(__pyx_t_12);
        }
        #else
        __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 1093, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 1093, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 1093, __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, 1093, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 1093, __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, 1093, __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, 1093, __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_INCREF(__pyx_t_12);
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_11);
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
          __Pyx_INCREF(__pyx_t_9);
        } else {
          __pyx_t_12 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 1093, __pyx_L5_error)
          __Pyx_XGOTREF(__pyx_t_12);
          __pyx_t_11 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 1093, __pyx_L5_error)
          __Pyx_XGOTREF(__pyx_t_11);
          __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 1093, __pyx_L5_error)
          __Pyx_XGOTREF(__pyx_t_9);
        }
        #else
        __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 1093, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 1093, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_9 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 1093, __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, 1093, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 1093, __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, 1093, __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":1092
 *         # 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":1094
 *         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(((PyObject *)(((PyTypeObject*)PyExc_TypeError))), ((PyObject *)(((PyTypeObject*)PyExc_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, 1094, __pyx_L7_except_error)
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_9);

      /* "petsc4py/PETSc/Mat.pyx":1095
 *             (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, 1095, __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_INCREF(__pyx_t_11);
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_12);
          __pyx_t_13 = PyTuple_GET_ITEM(sequence, 2);
          __Pyx_INCREF(__pyx_t_13);
        } else {
          __pyx_t_11 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 1095, __pyx_L7_except_error)
          __Pyx_XGOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 1095, __pyx_L7_except_error)
          __Pyx_XGOTREF(__pyx_t_12);
          __pyx_t_13 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
          if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1095, __pyx_L7_except_error)
          __Pyx_XGOTREF(__pyx_t_13);
        }
        #else
        __pyx_t_11 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 1095, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 1095, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1095, __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, 1095, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 1095, __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, 1095, __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":1096
 *         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":1092
 *         # 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":1098
 *             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":1099
 *         # 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":1100
 *         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, 1100, __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":1101
 *         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, 1101, __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":1102
 *         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)) {
    __pyx_t_7 = NULL;

    /* "petsc4py/PETSc/Mat.pyx":1104
 *         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_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 1104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_13 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_8), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_m + 1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 1104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_12 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_8), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 1104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ni); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 1104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_11 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_8), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 1104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_16[0] = __pyx_mstate_global->__pyx_kp_u_A_matrix_with;
    __pyx_t_16[1] = __pyx_t_13;
    __pyx_t_16[2] = __pyx_mstate_global->__pyx_kp_u_rows_requires_a_row_pointer_of;
    __pyx_t_16[3] = __pyx_t_12;
    __pyx_t_16[4] = __pyx_mstate_global->__pyx_kp_u_given;
    __pyx_t_16[5] = __pyx_t_11;
    __pyx_t_16[6] = __pyx_mstate_global->__pyx_kp_u__5;

    /* "petsc4py/PETSc/Mat.pyx":1103
 *         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_PyUnicode_Join(__pyx_t_16, 7, 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13) + 39 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12) + 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11));
    if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 1103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_17 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8};
      __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_17, (2-__pyx_t_17) | (__pyx_t_17*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 1102, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __PYX_ERR(46, 1102, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1102
 *         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)))
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":1105
 *             "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_18 = (__pyx_v_poi != Py_None);
  if (__pyx_t_18) {
  } else {
    __pyx_t_3 = __pyx_t_18;
    goto __pyx_L23_bool_binop_done;
  }
  __pyx_t_18 = (__pyx_v_poj != Py_None);
  __pyx_t_3 = __pyx_t_18;
  __pyx_L23_bool_binop_done:;
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/Mat.pyx":1106
 *             (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_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_poi, (&__pyx_v_noi), (&__pyx_v_oi))); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 1106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF_SET(__pyx_v_poi, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "petsc4py/PETSc/Mat.pyx":1107
 *         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_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_poj, (&__pyx_v_noj), (&__pyx_v_oj))); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 1107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF_SET(__pyx_v_poj, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "petsc4py/PETSc/Mat.pyx":1105
 *             "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":1108
 *             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":1109
 *             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":1110
 *         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_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_pv, (&__pyx_v_nv), (&__pyx_v_v))); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 1110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF_SET(__pyx_v_pv, __pyx_t_9);
  __pyx_t_9 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1111
 *         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)) {
    __pyx_t_8 = NULL;

    /* "petsc4py/PETSc/Mat.pyx":1113
 *         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_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 1113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_11 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_7), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_11)) __PYX_ERR(46, 1113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nv); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 1113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_12 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_7), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_12)) __PYX_ERR(46, 1113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_19[0] = __pyx_mstate_global->__pyx_kp_u_Given;
    __pyx_t_19[1] = __pyx_t_11;
    __pyx_t_19[2] = __pyx_mstate_global->__pyx_kp_u_column_indices_but;
    __pyx_t_19[3] = __pyx_t_12;
    __pyx_t_19[4] = __pyx_mstate_global->__pyx_kp_u_non_zero_values;

    /* "petsc4py/PETSc/Mat.pyx":1112
 *         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_7 = __Pyx_PyUnicode_Join(__pyx_t_19, 5, 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11) + 20 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_12) + 16, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_12));
    if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 1112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_17 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
      __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_17, (2-__pyx_t_17) | (__pyx_t_17*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 1111, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    __Pyx_Raise(__pyx_t_9, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __PYX_ERR(46, 1111, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1111
 *         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)))
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":1114
 *             "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":1115
 *             (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_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_s(__pyx_v_pov, (&__pyx_v_nov), (&__pyx_v_ov))); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 1115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF_SET(__pyx_v_pov, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "petsc4py/PETSc/Mat.pyx":1114
 *             "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":1117
 *             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":1118
 *         # 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, 1118, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_14 == 1);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/Mat.pyx":1119
 *         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, 1119, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1121
 *             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_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 1121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_INCREF(__pyx_v_pi);
    __Pyx_GIVEREF(__pyx_v_pi);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_pi) != (0)) __PYX_ERR(46, 1121, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_pj);
    __Pyx_GIVEREF(__pyx_v_pj);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_pj) != (0)) __PYX_ERR(46, 1121, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_pv);
    __Pyx_GIVEREF(__pyx_v_pv);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_pv) != (0)) __PYX_ERR(46, 1121, __pyx_L1_error);
    __Pyx_DECREF_SET(__pyx_v_csr, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "petsc4py/PETSc/Mat.pyx":1118
 *         # 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":1125
 *             # 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_18 = (__pyx_v_oi != NULL);
    if (__pyx_t_18) {
    } else {
      __pyx_t_3 = __pyx_t_18;
      goto __pyx_L29_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_oj != NULL);
    if (__pyx_t_18) {
    } else {
      __pyx_t_3 = __pyx_t_18;
      goto __pyx_L29_bool_binop_done;
    }
    __pyx_t_18 = (__pyx_v_ov != NULL);
    __pyx_t_3 = __pyx_t_18;
    __pyx_L29_bool_binop_done:;
    if (__pyx_t_3) {

      /* "petsc4py/PETSc/Mat.pyx":1126
 *             # 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, 1126, __pyx_L1_error)

      /* "petsc4py/PETSc/Mat.pyx":1128
 *                 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_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 1128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_INCREF(__pyx_v_pi);
      __Pyx_GIVEREF(__pyx_v_pi);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_pi) != (0)) __PYX_ERR(46, 1128, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_pj);
      __Pyx_GIVEREF(__pyx_v_pj);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_pj) != (0)) __PYX_ERR(46, 1128, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_pv);
      __Pyx_GIVEREF(__pyx_v_pv);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_pv) != (0)) __PYX_ERR(46, 1128, __pyx_L1_error);
      __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 1128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_poi);
      __Pyx_GIVEREF(__pyx_v_poi);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_poi) != (0)) __PYX_ERR(46, 1128, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_poj);
      __Pyx_GIVEREF(__pyx_v_poj);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_poj) != (0)) __PYX_ERR(46, 1128, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_pov);
      __Pyx_GIVEREF(__pyx_v_pov);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_pov) != (0)) __PYX_ERR(46, 1128, __pyx_L1_error);
      __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 1128, __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) != (0)) __PYX_ERR(46, 1128, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_7);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7) != (0)) __PYX_ERR(46, 1128, __pyx_L1_error);
      __pyx_t_9 = 0;
      __pyx_t_7 = 0;
      __Pyx_DECREF_SET(__pyx_v_csr, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "petsc4py/PETSc/Mat.pyx":1125
 *             # 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":1130
 *                 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":1131
 *             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, 1130, __pyx_L1_error)

      /* "petsc4py/PETSc/Mat.pyx":1132
 *                 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":1133
 *                     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, 1133, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1134
 *                 csr = None
 *         CHKERR(PetscCLEAR(self.obj)); self.mat = newmat
 *         self.set_attr('__csr__', csr)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_8 = ((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_8)) __PYX_ERR(46, 1134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1135
 *         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":1048
 *         CHKERR(MatPreallocatorPreallocate(self.mat, cfill, A.mat))
 * 
 *     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":1139
 *     #
 * 
 *     def createDense(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_87createDense(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_86createDense, "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:1139");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_87createDense = {"createDense", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_87createDense, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_86createDense};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_87createDense(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_array,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1139, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 1139, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1139, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1139, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1139, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createDense", 0) < (0)) __PYX_ERR(46, 1139, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":1142
 *         self,
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,             # <<<<<<<<<<<<<<
 *         array: Sequence[Scalar] | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1143
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,
 *         array: Sequence[Scalar] | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.DENSE` matrix.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1144
 *         bsize: MatBlockSizeSpec | None = None,
 *         array: Sequence[Scalar] | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.DENSE` matrix.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createDense", 0, 1, 4, i); __PYX_ERR(46, 1139, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 1139, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1139, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1139, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1139, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":1142
 *         self,
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,             # <<<<<<<<<<<<<<
 *         array: Sequence[Scalar] | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1143
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,
 *         array: Sequence[Scalar] | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.DENSE` matrix.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1144
 *         bsize: MatBlockSizeSpec | None = None,
 *         array: Sequence[Scalar] | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.DENSE` matrix.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1139, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_86createDense(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_array, __pyx_v_comm);

  /* "petsc4py/PETSc/Mat.pyx":1139
 *     #
 * 
 *     def createDense(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_86createDense(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":1166
 *         """
 *         # 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":1167
 *         # 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, 1167, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1168
 *         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, 1168, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1170
 *         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":1171
 *         # 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, 1171, __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":1172
 *         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, 1172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/Mat.pyx":1170
 *         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":1173
 *             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":1139
 *     #
 * 
 *     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":1175
 *         return self
 * 
 *     def createDenseCUDA(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_89createDenseCUDA(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_88createDenseCUDA, "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:1175");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_89createDenseCUDA = {"createDenseCUDA", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_89createDenseCUDA, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_88createDenseCUDA};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_89createDenseCUDA(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_array,&__pyx_mstate_global->__pyx_n_u_cudahandle,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1175, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 1175, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 1175, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1175, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1175, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1175, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createDenseCUDA", 0) < (0)) __PYX_ERR(46, 1175, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":1178
 *         self,
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,             # <<<<<<<<<<<<<<
 *         array: Sequence[Scalar] | None = None,
 *         cudahandle: int | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1179
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,
 *         array: Sequence[Scalar] | None = None,             # <<<<<<<<<<<<<<
 *         cudahandle: int | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1180
 *         bsize: MatBlockSizeSpec | None = None,
 *         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.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1181
 *         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.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createDenseCUDA", 0, 1, 5, i); __PYX_ERR(46, 1175, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 1175, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 1175, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1175, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1175, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1175, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":1178
 *         self,
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,             # <<<<<<<<<<<<<<
 *         array: Sequence[Scalar] | None = None,
 *         cudahandle: int | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1179
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,
 *         array: Sequence[Scalar] | None = None,             # <<<<<<<<<<<<<<
 *         cudahandle: int | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1180
 *         bsize: MatBlockSizeSpec | None = None,
 *         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.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1181
 *         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.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1175, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_88createDenseCUDA(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_array, __pyx_v_cudahandle, __pyx_v_comm);

  /* "petsc4py/PETSc/Mat.pyx":1175
 *         return self
 * 
 *     def createDenseCUDA(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_88createDenseCUDA(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":1207
 *         """
 *         # 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":1209
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 1209, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":1211
 *         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":1214
 * 
 *         # 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":1215
 *         # 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, 1215, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1216
 *         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":1217
 *             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":1218
 *             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, 1218, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1219
 *             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, <PetscScalar*>(<Py_uintptr_t>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, 1219, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1221
 *             Sys_Layout(ccomm, cbs, &n, &N)
 *             # create matrix and set sizes
 *             CHKERR(MatCreateDenseCUDA(ccomm, m, n, M, N, <PetscScalar*>(<Py_uintptr_t>cudahandle), &newmat))             # <<<<<<<<<<<<<<
 *             # Does block size make sense for MATDENSE?
 *             CHKERR(MatSetBlockSizes(newmat, rbs, cbs))
*/
    __pyx_t_4 = __Pyx_PyLong_As_size_t(__pyx_v_cudahandle); if (unlikely((__pyx_t_4 == ((Py_uintptr_t)-1)) && PyErr_Occurred())) __PYX_ERR(46, 1221, __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, 1221, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1223
 *             CHKERR(MatCreateDenseCUDA(ccomm, m, n, M, N, <PetscScalar*>(<Py_uintptr_t>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, 1223, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1214
 * 
 *         # 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":1225
 *             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, 1225, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1226
 *         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":1227
 *             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, 1227, __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":1228
 *             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, 1228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "petsc4py/PETSc/Mat.pyx":1226
 *         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":1229
 *                 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, 1229, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1230
 *                 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":1175
 *         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":1232
 *         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_91setPreallocationDense(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_90setPreallocationDense, "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:1232");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_91setPreallocationDense = {"setPreallocationDense", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_91setPreallocationDense, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_90setPreallocationDense};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_91setPreallocationDense(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_array,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1232, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1232, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPreallocationDense", 0) < (0)) __PYX_ERR(46, 1232, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPreallocationDense", 1, 1, 1, i); __PYX_ERR(46, 1232, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1232, __pyx_L3_error)
    }
    __pyx_v_array = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPreallocationDense", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 1232, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_90setPreallocationDense(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_array);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_90setPreallocationDense(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":1247
 * 
 *         """
 *         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":1248
 *         """
 *         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, 1248, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1250
 *         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, 1250, __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":1251
 *         # 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, 1251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1252
 *         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":1232
 *         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":1256
 *     #
 * 
 *     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_93createScatter(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_92createScatter, "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:1256");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_93createScatter = {"createScatter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_93createScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_92createScatter};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_93createScatter(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_scatter,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1256, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1256, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1256, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createScatter", 0) < (0)) __PYX_ERR(46, 1256, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createScatter", 0, 1, 2, i); __PYX_ERR(46, 1256, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1256, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1256, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1256, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, 0, "scatter", 0))) __PYX_ERR(46, 1256, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_92createScatter(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_scatter, __pyx_v_comm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_92createScatter(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;
  size_t __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("createScatter", 0);
  __Pyx_INCREF(__pyx_v_comm);

  /* "petsc4py/PETSc/Mat.pyx":1273
 * 
 *         """
 *         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 = ((PyObject *)__pyx_v_scatter);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getComm, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_comm, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "petsc4py/PETSc/Mat.pyx":1274
 *         """
 *         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_5 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_8petsc4py_5PETSc_PETSC_COMM_DEFAULT); if (unlikely(__pyx_t_5 == ((MPI_Comm const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 1274, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_5;

  /* "petsc4py/PETSc/Mat.pyx":1275
 *         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":1276
 *         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_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateScatter(__pyx_v_ccomm, __pyx_v_scatter->sct, (&__pyx_v_newmat))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1276, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1277
 *         cdef PetscMat newmat = NULL
 *         CHKERR(MatCreateScatter(ccomm, scatter.sct, &newmat))
 *         CHKERR(PetscCLEAR(self.obj)); self.mat = newmat             # <<<<<<<<<<<<<<
 *         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(46, 1277, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1278
 *         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":1256
 *     #
 * 
 *     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_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":1280
 *         return self
 * 
 *     def createNormal(self, Mat mat) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.NORMAL` matrix representing AA.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_95createNormal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_94createNormal, "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:1280");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_95createNormal = {"createNormal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_95createNormal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_94createNormal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_95createNormal(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1280, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1280, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createNormal", 0) < (0)) __PYX_ERR(46, 1280, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createNormal", 1, 1, 1, i); __PYX_ERR(46, 1280, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1280, __pyx_L3_error)
    }
    __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, 1280, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 1280, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_94createNormal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_94createNormal(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":1300
 * 
 *         """
 *         cdef PetscMat newmat = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(MatCreateNormal(mat.mat, &newmat))
 *         CHKERR(PetscCLEAR(self.obj)); self.mat = newmat
*/
  __pyx_v_newmat = NULL;

  /* "petsc4py/PETSc/Mat.pyx":1301
 *         """
 *         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, 1301, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1302
 *         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, 1302, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1303
 *         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":1280
 *         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":1305
 *         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_97createTranspose(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_96createTranspose, "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:1305");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_97createTranspose = {"createTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_97createTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_96createTranspose};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_97createTranspose(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1305, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1305, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createTranspose", 0) < (0)) __PYX_ERR(46, 1305, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createTranspose", 1, 1, 1, i); __PYX_ERR(46, 1305, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1305, __pyx_L3_error)
    }
    __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, 1305, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 1305, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_96createTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_96createTranspose(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":1325
 * 
 *         """
 *         cdef PetscMat newmat = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(MatCreateTranspose(mat.mat, &newmat))
 *         CHKERR(PetscCLEAR(self.obj)); self.mat = newmat
*/
  __pyx_v_newmat = NULL;

  /* "petsc4py/PETSc/Mat.pyx":1326
 *         """
 *         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, 1326, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1327
 *         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, 1327, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1328
 *         CHKERR(MatCreateTranspose(mat.mat, &newmat))
 *         CHKERR(PetscCLEAR(self.obj)); self.mat = newmat
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def getTransposeMat(self) -> Mat:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":1305
 *         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":1330
 *         return self
 * 
 *     def getTransposeMat(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the internal matrix of a `Type.TRANSPOSE` matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_99getTransposeMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_98getTransposeMat, "Mat.getTransposeMat(self) -> Mat\nReturn the internal matrix of a `Type.TRANSPOSE` matrix.\n\n        Not collective.\n\n        Parameters\n        ----------\n        mat\n            Matrix A of type `Type.TRANSPOSE`.\n\n        See Also\n        --------\n        petsc.MatTransposeGetMat\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:1330");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_99getTransposeMat = {"getTransposeMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_99getTransposeMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_98getTransposeMat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_99getTransposeMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getTransposeMat (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTransposeMat", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTransposeMat", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_98getTransposeMat(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_98getTransposeMat(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;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getTransposeMat", 0);

  /* "petsc4py/PETSc/Mat.pyx":1345
 * 
 *         """
 *         cdef Mat mat = type(self)()             # <<<<<<<<<<<<<<
 *         CHKERR(MatTransposeGetMat(self.mat, &mat.mat))
 *         CHKERR(PetscINCREF(mat.obj))
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(46, 1345, __pyx_L1_error)
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1346
 *         """
 *         cdef Mat mat = type(self)()
 *         CHKERR(MatTransposeGetMat(self.mat, &mat.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(mat.obj))
 *         return mat
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatTransposeGetMat(__pyx_v_self->mat, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1346, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1347
 *         cdef Mat mat = type(self)()
 *         CHKERR(MatTransposeGetMat(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, 1347, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1348
 *         CHKERR(MatTransposeGetMat(self.mat, &mat.mat))
 *         CHKERR(PetscINCREF(mat.obj))
 *         return mat             # <<<<<<<<<<<<<<
 * 
 *     def createNormalHermitian(self, Mat mat) -> Self:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_mat);
  __pyx_r = ((PyObject *)__pyx_v_mat);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":1330
 *         return self
 * 
 *     def getTransposeMat(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the internal matrix of a `Type.TRANSPOSE` 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.getTransposeMat", __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":1350
 *         return mat
 * 
 *     def createNormalHermitian(self, Mat mat) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.NORMALHERMITIAN` matrix representing (A*)A.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_101createNormalHermitian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_100createNormalHermitian, "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:1350");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_101createNormalHermitian = {"createNormalHermitian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_101createNormalHermitian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_100createNormalHermitian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_101createNormalHermitian(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1350, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1350, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createNormalHermitian", 0) < (0)) __PYX_ERR(46, 1350, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createNormalHermitian", 1, 1, 1, i); __PYX_ERR(46, 1350, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1350, __pyx_L3_error)
    }
    __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, 1350, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 1350, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_100createNormalHermitian(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_100createNormalHermitian(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":1370
 * 
 *         """
 *         cdef PetscMat newmat = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(MatCreateNormalHermitian(mat.mat, &newmat))
 *         CHKERR(PetscCLEAR(self.obj)); self.mat = newmat
*/
  __pyx_v_newmat = NULL;

  /* "petsc4py/PETSc/Mat.pyx":1371
 *         """
 *         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, 1371, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1372
 *         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, 1372, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1373
 *         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":1350
 *         return mat
 * 
 *     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":1375
 *         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_103createHermitianTranspose(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_102createHermitianTranspose, "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:1375");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_103createHermitianTranspose = {"createHermitianTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_103createHermitianTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_102createHermitianTranspose};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_103createHermitianTranspose(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1375, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1375, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createHermitianTranspose", 0) < (0)) __PYX_ERR(46, 1375, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createHermitianTranspose", 1, 1, 1, i); __PYX_ERR(46, 1375, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1375, __pyx_L3_error)
    }
    __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, 1375, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 1375, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_102createHermitianTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_102createHermitianTranspose(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":1395
 * 
 *         """
 *         cdef PetscMat newmat = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(MatCreateHermitianTranspose(mat.mat, &newmat))
 *         CHKERR(PetscCLEAR(self.obj)); self.mat = newmat
*/
  __pyx_v_newmat = NULL;

  /* "petsc4py/PETSc/Mat.pyx":1396
 *         """
 *         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, 1396, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1397
 *         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, 1397, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1398
 *         CHKERR(MatCreateHermitianTranspose(mat.mat, &newmat))
 *         CHKERR(PetscCLEAR(self.obj)); self.mat = newmat
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def createLRC(
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":1375
 *         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":1400
 *         return self
 * 
 *     def createLRC(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat A or None: Mat | None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_105createLRC(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_104createLRC, "Mat.createLRC(self, A: Mat | None, U: Mat, c: Vec | None, V: Mat | None) -> 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\n            Dense rectangular matrix.\n        c\n            Vector containing the diagonal of ``C``, can be `None`.\n        V\n            Dense rectangular matrix, can be set to ``U`` or '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:1400");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_105createLRC = {"createLRC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_105createLRC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_104createLRC};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_105createLRC(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_U,&__pyx_mstate_global->__pyx_n_u_c,&__pyx_mstate_global->__pyx_n_u_V,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1400, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 1400, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1400, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1400, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1400, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createLRC", 0) < (0)) __PYX_ERR(46, 1400, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createLRC", 1, 4, 4, i); __PYX_ERR(46, 1400, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1400, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1400, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1400, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 1400, __pyx_L3_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("createLRC", 1, 4, 4, __pyx_nargs); __PYX_ERR(46, 1400, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(46, 1402, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_U), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "U", 0))) __PYX_ERR(46, 1403, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "c", 0))) __PYX_ERR(46, 1404, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_V), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "V", 0))) __PYX_ERR(46, 1405, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_104createLRC(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_104createLRC(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":1442
 * 
 *         """
 *         cdef PetscMat Amat = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscMat Umat = U.mat
 *         cdef PetscVec cvec = NULL
*/
  __pyx_v_Amat = NULL;

  /* "petsc4py/PETSc/Mat.pyx":1443
 *         """
 *         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":1444
 *         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":1445
 *         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":1446
 *         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":1447
 *         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":1448
 *         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":1449
 *         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":1450
 *         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, 1450, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1451
 *         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, 1451, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1452
 *         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":1400
 *         return self
 * 
 *     def createLRC(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat A or None: Mat | None,
*/

  /* 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":1454
 *         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_107createSubMatrixVirtual(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_106createSubMatrixVirtual, "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:1454");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_107createSubMatrixVirtual = {"createSubMatrixVirtual", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_107createSubMatrixVirtual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_106createSubMatrixVirtual};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_107createSubMatrixVirtual(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_isrow,&__pyx_mstate_global->__pyx_n_u_iscol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1454, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1454, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1454, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1454, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createSubMatrixVirtual", 0) < (0)) __PYX_ERR(46, 1454, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createSubMatrixVirtual", 0, 2, 3, i); __PYX_ERR(46, 1454, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1454, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1454, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1454, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
    }
    __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, 1454, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "A", 0))) __PYX_ERR(46, 1454, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 1454, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 1, "iscol", 0))) __PYX_ERR(46, 1454, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_106createSubMatrixVirtual(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_106createSubMatrixVirtual(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":1473
 * 
 *         """
 *         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":1474
 *         """
 *         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":1475
 *         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, 1475, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1476
 *         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, 1476, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1477
 *         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":1454
 *         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":1479
 *         return self
 * 
 *     def createNest(             # <<<<<<<<<<<<<<
 *         self,
 *         mats: Sequence[Sequence[Mat]],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_109createNest(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_108createNest, "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:1479");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_109createNest = {"createNest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_109createNest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_108createNest};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_109createNest(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mats,&__pyx_mstate_global->__pyx_n_u_isrows,&__pyx_mstate_global->__pyx_n_u_iscols,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1479, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 1479, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1479, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1479, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1479, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createNest", 0) < (0)) __PYX_ERR(46, 1479, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":1482
 *         self,
 *         mats: Sequence[Sequence[Mat]],
 *         isrows: Sequence[IS] | None = None,             # <<<<<<<<<<<<<<
 *         iscols: Sequence[IS] | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1483
 *         mats: Sequence[Sequence[Mat]],
 *         isrows: Sequence[IS] | None = None,
 *         iscols: Sequence[IS] | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.NEST` matrix containing multiple submatrices.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1484
 *         isrows: Sequence[IS] | None = None,
 *         iscols: Sequence[IS] | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.NEST` matrix containing multiple submatrices.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createNest", 0, 1, 4, i); __PYX_ERR(46, 1479, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 1479, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1479, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1479, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1479, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":1482
 *         self,
 *         mats: Sequence[Sequence[Mat]],
 *         isrows: Sequence[IS] | None = None,             # <<<<<<<<<<<<<<
 *         iscols: Sequence[IS] | None = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1483
 *         mats: Sequence[Sequence[Mat]],
 *         isrows: Sequence[IS] | None = None,
 *         iscols: Sequence[IS] | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.NEST` matrix containing multiple submatrices.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1484
 *         isrows: Sequence[IS] | None = None,
 *         iscols: Sequence[IS] | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.NEST` matrix containing multiple submatrices.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1479, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_108createNest(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mats, __pyx_v_isrows, __pyx_v_iscols, __pyx_v_comm);

  /* "petsc4py/PETSc/Mat.pyx":1479
 *         return self
 * 
 *     def createNest(             # <<<<<<<<<<<<<<
 *         self,
 *         mats: Sequence[Sequence[Mat]],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_108createNest(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_unused1 = 0;
  CYTHON_UNUSED PyObject *__pyx_v_unused2 = 0;
  CYTHON_UNUSED PyObject *__pyx_v_unused3 = 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":1510
 *         """
 *         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, 1510, __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, 1510, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1510, __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_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(46, 1510, __pyx_L5_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_2, __pyx_t_3, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_3;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(46, 1510, __pyx_L5_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
          #endif
          ++__pyx_t_3;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1510, __pyx_L5_error)
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(46, 1510, __pyx_L5_error)
            PyErr_Clear();
          }
          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, 1510, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(46, 1510, __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":1511
 *         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, 1511, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "petsc4py/PETSc/Mat.pyx":1512
 *         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, 1512, __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":1513
 *         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, 1513, __pyx_L1_error)
      __pyx_t_7 = PyObject_Length(__pyx_v_mats); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(46, 1513, __pyx_L1_error)
      __pyx_t_6 = (__pyx_t_3 == __pyx_t_7);
      if (unlikely(!__pyx_t_6)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(46, 1513, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(46, 1513, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/Mat.pyx":1511
 *         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":1515
 *             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":1516
 *         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, 1516, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "petsc4py/PETSc/Mat.pyx":1517
 *             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, 1517, __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":1518
 *         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, 1518, __pyx_L1_error)
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_mats, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1518, __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, 1518, __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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(46, 1518, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(46, 1518, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/Mat.pyx":1516
 *         else:
 *             isrows = None
 *         if iscols:             # <<<<<<<<<<<<<<
 *             iscols = list(iscols)
 *             assert len(iscols) == len(mats[0])
*/
    goto __pyx_L11;
  }

  /* "petsc4py/PETSc/Mat.pyx":1520
 *             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":1521
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 1521, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_8;

  /* "petsc4py/PETSc/Mat.pyx":1522
 *             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 = <PetscInt>mr
*/
  __pyx_t_3 = PyObject_Length(__pyx_v_mats); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(46, 1522, __pyx_L1_error)
  __pyx_v_mr = __pyx_t_3;

  /* "petsc4py/PETSc/Mat.pyx":1523
 *         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 = <PetscInt>mr
 *         cdef PetscInt nc = <PetscInt>mc
*/
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_mats, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1523, __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, 1523, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_mc = __pyx_t_3;

  /* "petsc4py/PETSc/Mat.pyx":1524
 *         cdef Py_ssize_t i, mr = len(mats)
 *         cdef Py_ssize_t j, mc = len(mats[0])
 *         cdef PetscInt nr = <PetscInt>mr             # <<<<<<<<<<<<<<
 *         cdef PetscInt nc = <PetscInt>mc
 *         cdef PetscMat *cmats   = NULL
*/
  __pyx_v_nr = ((PetscInt)__pyx_v_mr);

  /* "petsc4py/PETSc/Mat.pyx":1525
 *         cdef Py_ssize_t j, mc = len(mats[0])
 *         cdef PetscInt nr = <PetscInt>mr
 *         cdef PetscInt nc = <PetscInt>mc             # <<<<<<<<<<<<<<
 *         cdef PetscMat *cmats   = NULL
 *         cdef PetscIS  *cisrows = NULL
*/
  __pyx_v_nc = ((PetscInt)__pyx_v_mc);

  /* "petsc4py/PETSc/Mat.pyx":1526
 *         cdef PetscInt nr = <PetscInt>mr
 *         cdef PetscInt nc = <PetscInt>mc
 *         cdef PetscMat *cmats   = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscIS  *cisrows = NULL
 *         cdef PetscIS  *ciscols = NULL
*/
  __pyx_v_cmats = NULL;

  /* "petsc4py/PETSc/Mat.pyx":1527
 *         cdef PetscInt nc = <PetscInt>mc
 *         cdef PetscMat *cmats   = NULL
 *         cdef PetscIS  *cisrows = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscIS  *ciscols = NULL
 *         cdef object unused1, unused2, unused3
*/
  __pyx_v_cisrows = NULL;

  /* "petsc4py/PETSc/Mat.pyx":1528
 *         cdef PetscMat *cmats   = NULL
 *         cdef PetscIS  *cisrows = NULL
 *         cdef PetscIS  *ciscols = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused1, unused2, unused3
 *         unused1 = oarray_p(empty_p(nr*nc), NULL, <void**>&cmats)
*/
  __pyx_v_ciscols = NULL;

  /* "petsc4py/PETSc/Mat.pyx":1530
 *         cdef PetscIS  *ciscols = NULL
 *         cdef object unused1, unused2, unused3
 *         unused1 = oarray_p(empty_p(nr*nc), NULL, <void**>&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, 1530, __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, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_unused1 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1531
 *         cdef object unused1, unused2, unused3
 *         unused1 = oarray_p(empty_p(nr*nc), NULL, <void**>&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":1532
 *         unused1 = oarray_p(empty_p(nr*nc), NULL, <void**>&cmats)
 *         for i from 0 <= i < mr:
 *             for j from 0 <= j < mc:             # <<<<<<<<<<<<<<
 *                 mat = mats[i][j]
 *                 cmats[i*mc+j] = (<Mat?>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":1533
 *         for i from 0 <= i < mr:
 *             for j from 0 <= j < mc:
 *                 mat = mats[i][j]             # <<<<<<<<<<<<<<
 *                 cmats[i*mc+j] = (<Mat?>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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_j, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1533, __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":1534
 *             for j from 0 <= j < mc:
 *                 mat = mats[i][j]
 *                 cmats[i*mc+j] = (<Mat?>mat).mat if mat is not None else NULL             # <<<<<<<<<<<<<<
 *         if isrows is not None:
 *             unused2 = oarray_p(empty_p(nr), NULL, <void**>&cisrows)
*/
      __pyx_t_6 = (__pyx_v_mat != Py_None);
      if (__pyx_t_6) {
        if (!(likely(__Pyx_TypeTest(__pyx_v_mat, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(46, 1534, __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":1535
 *                 mat = mats[i][j]
 *                 cmats[i*mc+j] = (<Mat?>mat).mat if mat is not None else NULL
 *         if isrows is not None:             # <<<<<<<<<<<<<<
 *             unused2 = oarray_p(empty_p(nr), NULL, <void**>&cisrows)
 *             for i from 0 <= i < mr: cisrows[i] = (<IS?>isrows[i]).iset
*/
  __pyx_t_6 = (__pyx_v_isrows != Py_None);
  if (__pyx_t_6) {

    /* "petsc4py/PETSc/Mat.pyx":1536
 *                 cmats[i*mc+j] = (<Mat?>mat).mat if mat is not None else NULL
 *         if isrows is not None:
 *             unused2 = oarray_p(empty_p(nr), NULL, <void**>&cisrows)             # <<<<<<<<<<<<<<
 *             for i from 0 <= i < mr: cisrows[i] = (<IS?>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, 1536, __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, 1536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_unused2 = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Mat.pyx":1537
 *         if isrows is not None:
 *             unused2 = oarray_p(empty_p(nr), NULL, <void**>&cisrows)
 *             for i from 0 <= i < mr: cisrows[i] = (<IS?>isrows[i]).iset             # <<<<<<<<<<<<<<
 *         if iscols is not None:
 *             unused3 = oarray_p(empty_p(nc), NULL, <void**>&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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1537, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(46, 1537, __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":1535
 *                 mat = mats[i][j]
 *                 cmats[i*mc+j] = (<Mat?>mat).mat if mat is not None else NULL
 *         if isrows is not None:             # <<<<<<<<<<<<<<
 *             unused2 = oarray_p(empty_p(nr), NULL, <void**>&cisrows)
 *             for i from 0 <= i < mr: cisrows[i] = (<IS?>isrows[i]).iset
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":1538
 *             unused2 = oarray_p(empty_p(nr), NULL, <void**>&cisrows)
 *             for i from 0 <= i < mr: cisrows[i] = (<IS?>isrows[i]).iset
 *         if iscols is not None:             # <<<<<<<<<<<<<<
 *             unused3 = oarray_p(empty_p(nc), NULL, <void**>&ciscols)
 *             for j from 0 <= j < mc: ciscols[j] = (<IS?>iscols[j]).iset
*/
  __pyx_t_6 = (__pyx_v_iscols != Py_None);
  if (__pyx_t_6) {

    /* "petsc4py/PETSc/Mat.pyx":1539
 *             for i from 0 <= i < mr: cisrows[i] = (<IS?>isrows[i]).iset
 *         if iscols is not None:
 *             unused3 = oarray_p(empty_p(nc), NULL, <void**>&ciscols)             # <<<<<<<<<<<<<<
 *             for j from 0 <= j < mc: ciscols[j] = (<IS?>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, 1539, __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, 1539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_unused3 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "petsc4py/PETSc/Mat.pyx":1540
 *         if iscols is not None:
 *             unused3 = oarray_p(empty_p(nc), NULL, <void**>&ciscols)
 *             for j from 0 <= j < mc: ciscols[j] = (<IS?>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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 1540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(46, 1540, __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":1538
 *             unused2 = oarray_p(empty_p(nr), NULL, <void**>&cisrows)
 *             for i from 0 <= i < mr: cisrows[i] = (<IS?>isrows[i]).iset
 *         if iscols is not None:             # <<<<<<<<<<<<<<
 *             unused3 = oarray_p(empty_p(nc), NULL, <void**>&ciscols)
 *             for j from 0 <= j < mc: ciscols[j] = (<IS?>iscols[j]).iset
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":1541
 *             unused3 = oarray_p(empty_p(nc), NULL, <void**>&ciscols)
 *             for j from 0 <= j < mc: ciscols[j] = (<IS?>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":1542
 *             for j from 0 <= j < mc: ciscols[j] = (<IS?>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, 1542, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1543
 *         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, 1543, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1544
 *         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":1479
 *         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_unused1);
  __Pyx_XDECREF(__pyx_v_unused2);
  __Pyx_XDECREF(__pyx_v_unused3);
  __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":1546
 *         return self
 * 
 *     def createH2OpusFromMat(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat A,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_111createH2OpusFromMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_110createH2OpusFromMat, "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        Collective.\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:1546");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_111createH2OpusFromMat = {"createH2OpusFromMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_111createH2OpusFromMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_110createH2OpusFromMat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_111createH2OpusFromMat(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_coordinates,&__pyx_mstate_global->__pyx_n_u_dist,&__pyx_mstate_global->__pyx_n_u_eta,&__pyx_mstate_global->__pyx_n_u_leafsize,&__pyx_mstate_global->__pyx_n_u_maxrank,&__pyx_mstate_global->__pyx_n_u_bs_2,&__pyx_mstate_global->__pyx_n_u_rtol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1546, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(46, 1546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(46, 1546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(46, 1546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 1546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 1546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createH2OpusFromMat", 0) < (0)) __PYX_ERR(46, 1546, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":1549
 *         self,
 *         Mat A,
 *         coordinates: Sequence[Scalar] | None = None,             # <<<<<<<<<<<<<<
 *         dist: bool | None = None,
 *         eta: float | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1550
 *         Mat A,
 *         coordinates: Sequence[Scalar] | None = None,
 *         dist: bool | None = None,             # <<<<<<<<<<<<<<
 *         eta: float | None = None,
 *         leafsize: int | None = None,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1551
 *         coordinates: Sequence[Scalar] | None = None,
 *         dist: bool | None = None,
 *         eta: float | None = None,             # <<<<<<<<<<<<<<
 *         leafsize: int | None = None,
 *         maxrank: int | None = None,
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1552
 *         dist: bool | None = None,
 *         eta: float | None = None,
 *         leafsize: int | None = None,             # <<<<<<<<<<<<<<
 *         maxrank: int | None = None,
 *         bs: int | None = None,
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1553
 *         eta: float | None = None,
 *         leafsize: int | None = None,
 *         maxrank: int | None = None,             # <<<<<<<<<<<<<<
 *         bs: int | None = None,
 *         rtol: float | None = None) -> Self:
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1554
 *         leafsize: int | None = None,
 *         maxrank: int | None = None,
 *         bs: int | None = None,             # <<<<<<<<<<<<<<
 *         rtol: float | None = None) -> Self:
 *         """Create a hierarchical `Type.H2OPUS` matrix sampling from a provided operator.
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1555
 *         maxrank: int | None = None,
 *         bs: int | None = None,
 *         rtol: float | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a hierarchical `Type.H2OPUS` matrix sampling from a provided operator.
 * 
*/
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createH2OpusFromMat", 0, 1, 8, i); __PYX_ERR(46, 1546, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(46, 1546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(46, 1546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(46, 1546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 1546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 1546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1546, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1546, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":1549
 *         self,
 *         Mat A,
 *         coordinates: Sequence[Scalar] | None = None,             # <<<<<<<<<<<<<<
 *         dist: bool | None = None,
 *         eta: float | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1550
 *         Mat A,
 *         coordinates: Sequence[Scalar] | None = None,
 *         dist: bool | None = None,             # <<<<<<<<<<<<<<
 *         eta: float | None = None,
 *         leafsize: int | None = None,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1551
 *         coordinates: Sequence[Scalar] | None = None,
 *         dist: bool | None = None,
 *         eta: float | None = None,             # <<<<<<<<<<<<<<
 *         leafsize: int | None = None,
 *         maxrank: int | None = None,
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1552
 *         dist: bool | None = None,
 *         eta: float | None = None,
 *         leafsize: int | None = None,             # <<<<<<<<<<<<<<
 *         maxrank: int | None = None,
 *         bs: int | None = None,
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1553
 *         eta: float | None = None,
 *         leafsize: int | None = None,
 *         maxrank: int | None = None,             # <<<<<<<<<<<<<<
 *         bs: int | None = None,
 *         rtol: float | None = None) -> Self:
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1554
 *         leafsize: int | None = None,
 *         maxrank: int | None = None,
 *         bs: int | None = None,             # <<<<<<<<<<<<<<
 *         rtol: float | None = None) -> Self:
 *         """Create a hierarchical `Type.H2OPUS` matrix sampling from a provided operator.
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1555
 *         maxrank: int | None = None,
 *         bs: int | None = None,
 *         rtol: float | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a hierarchical `Type.H2OPUS` matrix sampling from a provided operator.
 * 
*/
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1546, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "A", 0))) __PYX_ERR(46, 1548, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_110createH2OpusFromMat(((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":1546
 *         return self
 * 
 *     def createH2OpusFromMat(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat A,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_110createH2OpusFromMat(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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  PetscErrorCode __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createH2OpusFromMat", 0);

  /* "petsc4py/PETSc/Mat.pyx":1590
 * 
 *         """
 *         cdef PetscInt cdim = 1             # <<<<<<<<<<<<<<
 *         cdef PetscReal *coords = NULL
 *         cdef PetscBool cdist = PETSC_FALSE
*/
  __pyx_v_cdim = 1;

  /* "petsc4py/PETSc/Mat.pyx":1591
 *         """
 *         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":1592
 *         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":1593
 *         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":1594
 *         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":1595
 *         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":1596
 *         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":1597
 *         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":1600
 *         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":1601
 *         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, 1601, __pyx_L1_error)
    __pyx_v_cdist = __pyx_t_2;
  }

  /* "petsc4py/PETSc/Mat.pyx":1602
 *         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, 1602, __pyx_L1_error)
    __pyx_v_peta = __pyx_t_3;
  }

  /* "petsc4py/PETSc/Mat.pyx":1603
 *         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, 1603, __pyx_L1_error)
    __pyx_v_lsize = __pyx_t_4;
  }

  /* "petsc4py/PETSc/Mat.pyx":1604
 *         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, 1604, __pyx_L1_error)
    __pyx_v_maxr = __pyx_t_4;
  }

  /* "petsc4py/PETSc/Mat.pyx":1605
 *         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, 1605, __pyx_L1_error)
    __pyx_v_pbs = __pyx_t_4;
  }

  /* "petsc4py/PETSc/Mat.pyx":1606
 *         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, 1606, __pyx_L1_error)
    __pyx_v_tol = __pyx_t_3;
  }

  /* "petsc4py/PETSc/Mat.pyx":1608
 *         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":1609
 * 
 *         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, 1609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_xyz = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "petsc4py/PETSc/Mat.pyx":1610
 *         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, 1610, __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":1611
 *             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)) {
      __pyx_t_6 = NULL;

      /* "petsc4py/PETSc/Mat.pyx":1613
 *             if PyArray_NDIM(xyz) != 2: raise ValueError(
 *                 ("coordinates must have two dimensions: "
 *                  "coordinates.ndim=%d") % (PyArray_NDIM(xyz)))             # <<<<<<<<<<<<<<
 *             nvtx = <PetscInt> PyArray_DIM(xyz, 0)
 *             CHKERR(MatGetLocalSize(A.mat, &rl, &cl))
*/
      __pyx_t_7 = __Pyx_PyLong_From_int(PyArray_NDIM(__pyx_v_xyz)); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 1613, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_coordinates_must_have_two_dimens, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 1613, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8};
        __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1611, __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, 1611, __pyx_L1_error)

      /* "petsc4py/PETSc/Mat.pyx":1611
 *             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)))
*/
    }

    /* "petsc4py/PETSc/Mat.pyx":1614
 *                 ("coordinates must have two dimensions: "
 *                  "coordinates.ndim=%d") % (PyArray_NDIM(xyz)))
 *             nvtx = <PetscInt> 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":1615
 *                  "coordinates.ndim=%d") % (PyArray_NDIM(xyz)))
 *             nvtx = <PetscInt> 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_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalSize(__pyx_v_A->mat, (&__pyx_v_rl), (&__pyx_v_cl))); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1615, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1616
 *             nvtx = <PetscInt> 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_8 = NULL;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_mstate_global->__pyx_kp_u_Not_for_rectangular_matrices};
        __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1616, __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, 1616, __pyx_L1_error)
    }

    /* "petsc4py/PETSc/Mat.pyx":1617
 *             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 = <PetscInt> PyArray_DIM(xyz, 1)
*/
    __pyx_t_1 = (__pyx_v_nvtx < __pyx_v_rl);
    if (unlikely(__pyx_t_1)) {
      __pyx_t_8 = NULL;

      /* "petsc4py/PETSc/Mat.pyx":1618
 *             if cl != rl: raise ValueError("Not for rectangular matrices")
 *             if nvtx < rl: raise ValueError(
 *                 ("coordinates size must be at least %d" % rl))             # <<<<<<<<<<<<<<
 *             cdim = <PetscInt> PyArray_DIM(xyz, 1)
 *             coords = <PetscReal*> PyArray_DATA(xyz)
*/
      __pyx_t_6 = __Pyx_PyLong_From_PetscInt(__pyx_v_rl); if (unlikely(!__pyx_t_6)) __PYX_ERR(46, 1618, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_coordinates_size_must_be_at_leas, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 1618, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
        __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 1617, __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, 1617, __pyx_L1_error)

      /* "petsc4py/PETSc/Mat.pyx":1617
 *             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 = <PetscInt> PyArray_DIM(xyz, 1)
*/
    }

    /* "petsc4py/PETSc/Mat.pyx":1619
 *             if nvtx < rl: raise ValueError(
 *                 ("coordinates size must be at least %d" % rl))
 *             cdim = <PetscInt> PyArray_DIM(xyz, 1)             # <<<<<<<<<<<<<<
 *             coords = <PetscReal*> PyArray_DATA(xyz)
 * 
*/
    __pyx_v_cdim = ((PetscInt)PyArray_DIM(__pyx_v_xyz, 1));

    /* "petsc4py/PETSc/Mat.pyx":1620
 *                 ("coordinates size must be at least %d" % rl))
 *             cdim = <PetscInt> PyArray_DIM(xyz, 1)
 *             coords = <PetscReal*> PyArray_DATA(xyz)             # <<<<<<<<<<<<<<
 * 
 *         cdef PetscMat newmat = NULL
*/
    __pyx_v_coords = ((PetscReal *)PyArray_DATA(__pyx_v_xyz));

    /* "petsc4py/PETSc/Mat.pyx":1608
 *         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":1622
 *             coords = <PetscReal*> 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":1623
 * 
 *         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_10 = __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_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1623, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1624
 *         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_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj)); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1624, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1625
 *         CHKERR(MatCreateH2OpusFromMat(A.mat, cdim, coords, cdist, peta, lsize, maxr, pbs, tol, &newmat))
 *         CHKERR(PetscCLEAR(self.obj)); self.mat = newmat
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def createHtoolFromKernel(
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":1546
 *         return self
 * 
 *     def createH2OpusFromMat(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat A,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __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":1627
 *         return self
 * 
 *     def createHtoolFromKernel(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_113createHtoolFromKernel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_112createHtoolFromKernel, "Mat.createHtoolFromKernel(self, size: MatSizeSpec, spacedim: int, coords_target: Sequence[Scalar], coords_source: Sequence[Scalar], kernel: MatHtoolKernelFunction, kernelctx: Any = None, comm: Comm | None = None) -> Self\nCreate a `Type.HTOOL` matrix using a kernel function defined in Python.\n\n        Collective.\n\n        Parameters\n        ----------\n        size\n            Matrix size.\n        spacedim\n            Dimension of the coordinate space.\n        coords_target\n            Local target (row) coordinates, shape ``(m, spacedim)``.\n        coords_source\n            Local source (column) coordinates, shape ``(n, spacedim)``.\n        kernel\n            Python callable with signature\n            ``kernel(sdim, M, N, rows, cols, v, ctx)`` that fills the\n            submatrix ``v[i, j]`` for target index ``rows[i]`` and source\n            index ``cols[j]``. ``v`` has shape ``(M, N)`` in column-major order.\n        kernelctx\n            Optional context passed as the last argument to ``kernel``.\n        comm\n            MPI communicator, defaults to `Sys.getDefaultComm`.\n\n        Notes\n        -----\n        This function is called while the Python Global Interpreter Lock\n        (GIL) is held. As a result, pure Python implementations will not\n        scale with multithreading. For better performance, users should\n        delegate heavy computations to compiled code that releases the\n        GIL. This allows parallel execution inside threaded regions.\n        For maximum performance, consider implementing the generator\n        directly in C or C++ instead of using the Python interface.\n        See `petsc.MatCreateHtoolFromKernel` for the appropriate\n        database options.\n\n        See Also\n        --------\n        petsc_options, petsc.MatCreateHtoolFromKernel, HtoolGetPermutationSource,\n        HtoolGetPermutationTarget, HtoolUsePermutation, HtoolUseRecompression\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:1627");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_113createHtoolFromKernel = {"createHtoolFromKernel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_113createHtoolFromKernel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_112createHtoolFromKernel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_113createHtoolFromKernel(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_spacedim = 0;
  PyObject *__pyx_v_coords_target = 0;
  PyObject *__pyx_v_coords_source = 0;
  PyObject *__pyx_v_kernel = 0;
  PyObject *__pyx_v_kernelctx = 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("createHtoolFromKernel (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_spacedim,&__pyx_mstate_global->__pyx_n_u_coords_target,&__pyx_mstate_global->__pyx_n_u_coords_source,&__pyx_mstate_global->__pyx_n_u_kernel,&__pyx_mstate_global->__pyx_n_u_kernelctx,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1627, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(46, 1627, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(46, 1627, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 1627, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 1627, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1627, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1627, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1627, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createHtoolFromKernel", 0) < (0)) __PYX_ERR(46, 1627, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":1634
 *         coords_source: Sequence[Scalar],
 *         kernel: MatHtoolKernelFunction,
 *         kernelctx: Any = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.HTOOL` matrix using a kernel function defined in Python.
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1635
 *         kernel: MatHtoolKernelFunction,
 *         kernelctx: Any = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.HTOOL` matrix using a kernel function defined in Python.
 * 
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createHtoolFromKernel", 0, 5, 7, i); __PYX_ERR(46, 1627, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(46, 1627, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(46, 1627, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 1627, __pyx_L3_error)
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 1627, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1627, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1627, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1627, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":1634
 *         coords_source: Sequence[Scalar],
 *         kernel: MatHtoolKernelFunction,
 *         kernelctx: Any = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.HTOOL` matrix using a kernel function defined in Python.
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1635
 *         kernel: MatHtoolKernelFunction,
 *         kernelctx: Any = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.HTOOL` matrix using a kernel function defined in Python.
 * 
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_size = values[0];
    __pyx_v_spacedim = values[1];
    __pyx_v_coords_target = values[2];
    __pyx_v_coords_source = values[3];
    __pyx_v_kernel = values[4];
    __pyx_v_kernelctx = values[5];
    __pyx_v_comm = values[6];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createHtoolFromKernel", 0, 5, 7, __pyx_nargs); __PYX_ERR(46, 1627, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.createHtoolFromKernel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_112createHtoolFromKernel(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_spacedim, __pyx_v_coords_target, __pyx_v_coords_source, __pyx_v_kernel, __pyx_v_kernelctx, __pyx_v_comm);

  /* "petsc4py/PETSc/Mat.pyx":1627
 *         return self
 * 
 *     def createHtoolFromKernel(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_112createHtoolFromKernel(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_spacedim, PyObject *__pyx_v_coords_target, PyObject *__pyx_v_coords_source, PyObject *__pyx_v_kernel, PyObject *__pyx_v_kernelctx, 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;
  PetscInt __pyx_v_sdim;
  PyArrayObject *__pyx_v_xt = 0;
  PetscInt __pyx_v_nxt;
  PyArrayObject *__pyx_v_xs = 0;
  PetscInt __pyx_v_nxs;
  PyObject *__pyx_v_py_ctx = 0;
  Mat __pyx_v_newmat;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  MPI_Comm __pyx_t_1;
  PetscErrorCode __pyx_t_2;
  PetscInt __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createHtoolFromKernel", 0);

  /* "petsc4py/PETSc/Mat.pyx":1678
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 1678, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":1679
 *         """
 *         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, 1, &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":1680
 *         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, 1, &m, &M)
 *         Sys_Layout(ccomm, 1, &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, 1680, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1681
 *         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, 1, &m, &M)             # <<<<<<<<<<<<<<
 *         Sys_Layout(ccomm, 1, &n, &N)
 *         cdef PetscInt sdim = asInt(spacedim)
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, 1, (&__pyx_v_m), (&__pyx_v_M)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1681, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1682
 *         Mat_Sizes(size, None, &rbs, &cbs, &m, &n, &M, &N)
 *         Sys_Layout(ccomm, 1, &m, &M)
 *         Sys_Layout(ccomm, 1, &n, &N)             # <<<<<<<<<<<<<<
 *         cdef PetscInt sdim = asInt(spacedim)
 *         cdef ndarray xt = iarray(coords_target, NPY_PETSC_REAL)
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, 1, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1682, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1683
 *         Sys_Layout(ccomm, 1, &m, &M)
 *         Sys_Layout(ccomm, 1, &n, &N)
 *         cdef PetscInt sdim = asInt(spacedim)             # <<<<<<<<<<<<<<
 *         cdef ndarray xt = iarray(coords_target, NPY_PETSC_REAL)
 *         if PyArray_ISFORTRAN(xt): xt = PyArray_Copy(xt)
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_spacedim); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 1683, __pyx_L1_error)
  __pyx_v_sdim = __pyx_t_3;

  /* "petsc4py/PETSc/Mat.pyx":1684
 *         Sys_Layout(ccomm, 1, &n, &N)
 *         cdef PetscInt sdim = asInt(spacedim)
 *         cdef ndarray xt = iarray(coords_target, NPY_PETSC_REAL)             # <<<<<<<<<<<<<<
 *         if PyArray_ISFORTRAN(xt): xt = PyArray_Copy(xt)
 *         if PyArray_NDIM(xt) != 2: raise ValueError(
*/
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_coords_target, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_xt = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1685
 *         cdef PetscInt sdim = asInt(spacedim)
 *         cdef ndarray xt = iarray(coords_target, NPY_PETSC_REAL)
 *         if PyArray_ISFORTRAN(xt): xt = PyArray_Copy(xt)             # <<<<<<<<<<<<<<
 *         if PyArray_NDIM(xt) != 2: raise ValueError(
 *             ("coords_target must have two dimensions: "
*/
  __pyx_t_5 = PyArray_ISFORTRAN(__pyx_v_xt);
  if (__pyx_t_5) {
    __pyx_t_4 = ((PyObject *)PyArray_Copy(__pyx_v_xt)); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1685, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_xt, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;
  }

  /* "petsc4py/PETSc/Mat.pyx":1686
 *         cdef ndarray xt = iarray(coords_target, NPY_PETSC_REAL)
 *         if PyArray_ISFORTRAN(xt): xt = PyArray_Copy(xt)
 *         if PyArray_NDIM(xt) != 2: raise ValueError(             # <<<<<<<<<<<<<<
 *             ("coords_target must have two dimensions: "
 *              "coords_target.ndim=%d") % (PyArray_NDIM(xt)))
*/
  __pyx_t_5 = (PyArray_NDIM(__pyx_v_xt) != 2);
  if (unlikely(__pyx_t_5)) {
    __pyx_t_6 = NULL;

    /* "petsc4py/PETSc/Mat.pyx":1688
 *         if PyArray_NDIM(xt) != 2: raise ValueError(
 *             ("coords_target must have two dimensions: "
 *              "coords_target.ndim=%d") % (PyArray_NDIM(xt)))             # <<<<<<<<<<<<<<
 *         cdef PetscInt nxt = <PetscInt> PyArray_DIM(xt, 0)
 *         if nxt < m: raise ValueError(
*/
    __pyx_t_7 = __Pyx_PyLong_From_int(PyArray_NDIM(__pyx_v_xt)); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 1688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_coords_target_must_have_two_dime, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 1688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1686, __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(46, 1686, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1686
 *         cdef ndarray xt = iarray(coords_target, NPY_PETSC_REAL)
 *         if PyArray_ISFORTRAN(xt): xt = PyArray_Copy(xt)
 *         if PyArray_NDIM(xt) != 2: raise ValueError(             # <<<<<<<<<<<<<<
 *             ("coords_target must have two dimensions: "
 *              "coords_target.ndim=%d") % (PyArray_NDIM(xt)))
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":1689
 *             ("coords_target must have two dimensions: "
 *              "coords_target.ndim=%d") % (PyArray_NDIM(xt)))
 *         cdef PetscInt nxt = <PetscInt> PyArray_DIM(xt, 0)             # <<<<<<<<<<<<<<
 *         if nxt < m: raise ValueError(
 *             ("coords_target size must be at least %d" % m))
*/
  __pyx_v_nxt = ((PetscInt)PyArray_DIM(__pyx_v_xt, 0));

  /* "petsc4py/PETSc/Mat.pyx":1690
 *              "coords_target.ndim=%d") % (PyArray_NDIM(xt)))
 *         cdef PetscInt nxt = <PetscInt> PyArray_DIM(xt, 0)
 *         if nxt < m: raise ValueError(             # <<<<<<<<<<<<<<
 *             ("coords_target size must be at least %d" % m))
 *         if <PetscInt> PyArray_DIM(xt, 1) != sdim: raise ValueError(
*/
  __pyx_t_5 = (__pyx_v_nxt < __pyx_v_m);
  if (unlikely(__pyx_t_5)) {
    __pyx_t_8 = NULL;

    /* "petsc4py/PETSc/Mat.pyx":1691
 *         cdef PetscInt nxt = <PetscInt> PyArray_DIM(xt, 0)
 *         if nxt < m: raise ValueError(
 *             ("coords_target size must be at least %d" % m))             # <<<<<<<<<<<<<<
 *         if <PetscInt> PyArray_DIM(xt, 1) != sdim: raise ValueError(
 *             ("coords_target must have %d columns" % sdim))
*/
    __pyx_t_6 = __Pyx_PyLong_From_PetscInt(__pyx_v_m); if (unlikely(!__pyx_t_6)) __PYX_ERR(46, 1691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_coords_target_size_must_be_at_le, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 1691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1690, __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(46, 1690, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1690
 *              "coords_target.ndim=%d") % (PyArray_NDIM(xt)))
 *         cdef PetscInt nxt = <PetscInt> PyArray_DIM(xt, 0)
 *         if nxt < m: raise ValueError(             # <<<<<<<<<<<<<<
 *             ("coords_target size must be at least %d" % m))
 *         if <PetscInt> PyArray_DIM(xt, 1) != sdim: raise ValueError(
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":1692
 *         if nxt < m: raise ValueError(
 *             ("coords_target size must be at least %d" % m))
 *         if <PetscInt> PyArray_DIM(xt, 1) != sdim: raise ValueError(             # <<<<<<<<<<<<<<
 *             ("coords_target must have %d columns" % sdim))
 *         cdef ndarray xs = iarray(coords_source, NPY_PETSC_REAL)
*/
  __pyx_t_5 = (((PetscInt)PyArray_DIM(__pyx_v_xt, 1)) != __pyx_v_sdim);
  if (unlikely(__pyx_t_5)) {
    __pyx_t_7 = NULL;

    /* "petsc4py/PETSc/Mat.pyx":1693
 *             ("coords_target size must be at least %d" % m))
 *         if <PetscInt> PyArray_DIM(xt, 1) != sdim: raise ValueError(
 *             ("coords_target must have %d columns" % sdim))             # <<<<<<<<<<<<<<
 *         cdef ndarray xs = iarray(coords_source, NPY_PETSC_REAL)
 *         if PyArray_ISFORTRAN(xs): xs = PyArray_Copy(xs)
*/
    __pyx_t_8 = __Pyx_PyLong_From_PetscInt(__pyx_v_sdim); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 1693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_coords_target_must_have_d_column, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(46, 1693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(46, 1692, __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(46, 1692, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1692
 *         if nxt < m: raise ValueError(
 *             ("coords_target size must be at least %d" % m))
 *         if <PetscInt> PyArray_DIM(xt, 1) != sdim: raise ValueError(             # <<<<<<<<<<<<<<
 *             ("coords_target must have %d columns" % sdim))
 *         cdef ndarray xs = iarray(coords_source, NPY_PETSC_REAL)
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":1694
 *         if <PetscInt> PyArray_DIM(xt, 1) != sdim: raise ValueError(
 *             ("coords_target must have %d columns" % sdim))
 *         cdef ndarray xs = iarray(coords_source, NPY_PETSC_REAL)             # <<<<<<<<<<<<<<
 *         if PyArray_ISFORTRAN(xs): xs = PyArray_Copy(xs)
 *         if PyArray_NDIM(xs) != 2: raise ValueError(
*/
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray(__pyx_v_coords_source, NPY_PETSC_REAL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_xs = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1695
 *             ("coords_target must have %d columns" % sdim))
 *         cdef ndarray xs = iarray(coords_source, NPY_PETSC_REAL)
 *         if PyArray_ISFORTRAN(xs): xs = PyArray_Copy(xs)             # <<<<<<<<<<<<<<
 *         if PyArray_NDIM(xs) != 2: raise ValueError(
 *             ("coords_source must have two dimensions: "
*/
  __pyx_t_5 = PyArray_ISFORTRAN(__pyx_v_xs);
  if (__pyx_t_5) {
    __pyx_t_4 = ((PyObject *)PyArray_Copy(__pyx_v_xs)); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_xs, ((PyArrayObject *)__pyx_t_4));
    __pyx_t_4 = 0;
  }

  /* "petsc4py/PETSc/Mat.pyx":1696
 *         cdef ndarray xs = iarray(coords_source, NPY_PETSC_REAL)
 *         if PyArray_ISFORTRAN(xs): xs = PyArray_Copy(xs)
 *         if PyArray_NDIM(xs) != 2: raise ValueError(             # <<<<<<<<<<<<<<
 *             ("coords_source must have two dimensions: "
 *              "coords_source.ndim=%d") % (PyArray_NDIM(xs)))
*/
  __pyx_t_5 = (PyArray_NDIM(__pyx_v_xs) != 2);
  if (unlikely(__pyx_t_5)) {
    __pyx_t_6 = NULL;

    /* "petsc4py/PETSc/Mat.pyx":1698
 *         if PyArray_NDIM(xs) != 2: raise ValueError(
 *             ("coords_source must have two dimensions: "
 *              "coords_source.ndim=%d") % (PyArray_NDIM(xs)))             # <<<<<<<<<<<<<<
 *         cdef PetscInt nxs = <PetscInt> PyArray_DIM(xs, 0)
 *         if nxs < n: raise ValueError(
*/
    __pyx_t_7 = __Pyx_PyLong_From_int(PyArray_NDIM(__pyx_v_xs)); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 1698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_coords_source_must_have_two_dime, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 1698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1696, __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(46, 1696, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1696
 *         cdef ndarray xs = iarray(coords_source, NPY_PETSC_REAL)
 *         if PyArray_ISFORTRAN(xs): xs = PyArray_Copy(xs)
 *         if PyArray_NDIM(xs) != 2: raise ValueError(             # <<<<<<<<<<<<<<
 *             ("coords_source must have two dimensions: "
 *              "coords_source.ndim=%d") % (PyArray_NDIM(xs)))
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":1699
 *             ("coords_source must have two dimensions: "
 *              "coords_source.ndim=%d") % (PyArray_NDIM(xs)))
 *         cdef PetscInt nxs = <PetscInt> PyArray_DIM(xs, 0)             # <<<<<<<<<<<<<<
 *         if nxs < n: raise ValueError(
 *             ("coords_source size must be at least %d" % n))
*/
  __pyx_v_nxs = ((PetscInt)PyArray_DIM(__pyx_v_xs, 0));

  /* "petsc4py/PETSc/Mat.pyx":1700
 *              "coords_source.ndim=%d") % (PyArray_NDIM(xs)))
 *         cdef PetscInt nxs = <PetscInt> PyArray_DIM(xs, 0)
 *         if nxs < n: raise ValueError(             # <<<<<<<<<<<<<<
 *             ("coords_source size must be at least %d" % n))
 *         if <PetscInt> PyArray_DIM(xs, 1) != sdim: raise ValueError(
*/
  __pyx_t_5 = (__pyx_v_nxs < __pyx_v_n);
  if (unlikely(__pyx_t_5)) {
    __pyx_t_8 = NULL;

    /* "petsc4py/PETSc/Mat.pyx":1701
 *         cdef PetscInt nxs = <PetscInt> PyArray_DIM(xs, 0)
 *         if nxs < n: raise ValueError(
 *             ("coords_source size must be at least %d" % n))             # <<<<<<<<<<<<<<
 *         if <PetscInt> PyArray_DIM(xs, 1) != sdim: raise ValueError(
 *             ("coords_source must have %d columns" % sdim))
*/
    __pyx_t_6 = __Pyx_PyLong_From_PetscInt(__pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(46, 1701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_coords_source_size_must_be_at_le, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 1701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1700, __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(46, 1700, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1700
 *              "coords_source.ndim=%d") % (PyArray_NDIM(xs)))
 *         cdef PetscInt nxs = <PetscInt> PyArray_DIM(xs, 0)
 *         if nxs < n: raise ValueError(             # <<<<<<<<<<<<<<
 *             ("coords_source size must be at least %d" % n))
 *         if <PetscInt> PyArray_DIM(xs, 1) != sdim: raise ValueError(
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":1702
 *         if nxs < n: raise ValueError(
 *             ("coords_source size must be at least %d" % n))
 *         if <PetscInt> PyArray_DIM(xs, 1) != sdim: raise ValueError(             # <<<<<<<<<<<<<<
 *             ("coords_source must have %d columns" % sdim))
 *         # Store the Python kernel context to prevent garbage collection
*/
  __pyx_t_5 = (((PetscInt)PyArray_DIM(__pyx_v_xs, 1)) != __pyx_v_sdim);
  if (unlikely(__pyx_t_5)) {
    __pyx_t_7 = NULL;

    /* "petsc4py/PETSc/Mat.pyx":1703
 *             ("coords_source size must be at least %d" % n))
 *         if <PetscInt> PyArray_DIM(xs, 1) != sdim: raise ValueError(
 *             ("coords_source must have %d columns" % sdim))             # <<<<<<<<<<<<<<
 *         # Store the Python kernel context to prevent garbage collection
 *         cdef object py_ctx = [kernel, kernelctx]
*/
    __pyx_t_8 = __Pyx_PyLong_From_PetscInt(__pyx_v_sdim); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_coords_source_must_have_d_column, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(46, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(46, 1702, __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(46, 1702, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1702
 *         if nxs < n: raise ValueError(
 *             ("coords_source size must be at least %d" % n))
 *         if <PetscInt> PyArray_DIM(xs, 1) != sdim: raise ValueError(             # <<<<<<<<<<<<<<
 *             ("coords_source must have %d columns" % sdim))
 *         # Store the Python kernel context to prevent garbage collection
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":1705
 *             ("coords_source must have %d columns" % sdim))
 *         # Store the Python kernel context to prevent garbage collection
 *         cdef object py_ctx = [kernel, kernelctx]             # <<<<<<<<<<<<<<
 *         cdef PetscMat newmat = NULL
 *         CHKERR(MatCreateHtoolFromKernel(
*/
  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_kernel);
  __Pyx_GIVEREF(__pyx_v_kernel);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_kernel) != (0)) __PYX_ERR(46, 1705, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_kernelctx);
  __Pyx_GIVEREF(__pyx_v_kernelctx);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_kernelctx) != (0)) __PYX_ERR(46, 1705, __pyx_L1_error);
  __pyx_v_py_ctx = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1706
 *         # Store the Python kernel context to prevent garbage collection
 *         cdef object py_ctx = [kernel, kernelctx]
 *         cdef PetscMat newmat = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(MatCreateHtoolFromKernel(
 *             ccomm, m, n, M, N, sdim,
*/
  __pyx_v_newmat = NULL;

  /* "petsc4py/PETSc/Mat.pyx":1707
 *         cdef object py_ctx = [kernel, kernelctx]
 *         cdef PetscMat newmat = NULL
 *         CHKERR(MatCreateHtoolFromKernel(             # <<<<<<<<<<<<<<
 *             ccomm, m, n, M, N, sdim,
 *             <PetscReal*>PyArray_DATA(xt),
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateHtoolFromKernel(__pyx_v_ccomm, __pyx_v_m, __pyx_v_n, __pyx_v_M, __pyx_v_N, __pyx_v_sdim, ((PetscReal *)PyArray_DATA(__pyx_v_xt)), ((PetscReal *)PyArray_DATA(__pyx_v_xs)), __pyx_f_8petsc4py_5PETSc_MatHtoolKernelPython, ((void *)__pyx_v_py_ctx), (&__pyx_v_newmat))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1707, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1713
 *             MatHtoolKernelPython, <void*>py_ctx,
 *             &newmat))
 *         CHKERR(PetscCLEAR(self.obj)); self.mat = newmat             # <<<<<<<<<<<<<<
 *         self.set_attr('__htool_kernel_ctx__', py_ctx)
 *         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, 1713, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1714
 *             &newmat))
 *         CHKERR(PetscCLEAR(self.obj)); self.mat = newmat
 *         self.set_attr('__htool_kernel_ctx__', py_ctx)             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc_Mat *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_attr(((struct PyPetscObjectObject *)__pyx_v_self), ((char *)"__htool_kernel_ctx__"), __pyx_v_py_ctx); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 1714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1715
 *         CHKERR(PetscCLEAR(self.obj)); self.mat = newmat
 *         self.set_attr('__htool_kernel_ctx__', py_ctx)
 *         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":1627
 *         return self
 * 
 *     def createHtoolFromKernel(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.createHtoolFromKernel", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_xt);
  __Pyx_XDECREF((PyObject *)__pyx_v_xs);
  __Pyx_XDECREF(__pyx_v_py_ctx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":1717
 *         return self
 * 
 *     def createIS(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_115createIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_114createIS, "Mat.createIS(self, size: MatSizeSpec, bsize: MatBlockSizeSpec | None = None, 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        bsize\n            Matrix block size. If `None`, a block size of ``1`` is set.\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:1717");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_115createIS = {"createIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_115createIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_114createIS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_115createIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_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;
  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[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("createIS (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_bsize,&__pyx_mstate_global->__pyx_n_u_lgmapr,&__pyx_mstate_global->__pyx_n_u_lgmapc,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1717, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createIS", 0) < (0)) __PYX_ERR(46, 1717, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":1720
 *         self,
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,             # <<<<<<<<<<<<<<
 *         LGMap lgmapr = None,
 *         LGMap lgmapc = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1721
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,
 *         LGMap lgmapr = None,             # <<<<<<<<<<<<<<
 *         LGMap lgmapc = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscLGMapObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1722
 *         bsize: MatBlockSizeSpec | None = None,
 *         LGMap lgmapr = None,
 *         LGMap lgmapc = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.IS` matrix representing globally unassembled operators.
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscLGMapObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1723
 *         LGMap lgmapr = None,
 *         LGMap lgmapc = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.IS` matrix representing globally unassembled operators.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createIS", 0, 1, 5, i); __PYX_ERR(46, 1717, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1717, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":1720
 *         self,
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,             # <<<<<<<<<<<<<<
 *         LGMap lgmapr = None,
 *         LGMap lgmapc = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1721
 *         size: MatSizeSpec,
 *         bsize: MatBlockSizeSpec | None = None,
 *         LGMap lgmapr = None,             # <<<<<<<<<<<<<<
 *         LGMap lgmapc = None,
 *         comm: Comm | None = None) -> Self:
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscLGMapObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1722
 *         bsize: MatBlockSizeSpec | None = None,
 *         LGMap lgmapr = None,
 *         LGMap lgmapc = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `Type.IS` matrix representing globally unassembled operators.
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscLGMapObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":1723
 *         LGMap lgmapr = None,
 *         LGMap lgmapc = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.IS` matrix representing globally unassembled operators.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_size = values[0];
    __pyx_v_bsize = values[1];
    __pyx_v_lgmapr = ((struct PyPetscLGMapObject *)values[2]);
    __pyx_v_lgmapc = ((struct PyPetscLGMapObject *)values[3]);
    __pyx_v_comm = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createIS", 0, 1, 5, __pyx_nargs); __PYX_ERR(46, 1717, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, 1, "lgmapr", 0))) __PYX_ERR(46, 1721, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lgmapc), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, 1, "lgmapc", 0))) __PYX_ERR(46, 1722, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_114createIS(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_bsize, __pyx_v_lgmapr, __pyx_v_lgmapc, __pyx_v_comm);

  /* "petsc4py/PETSc/Mat.pyx":1717
 *         return self
 * 
 *     def createIS(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_114createIS(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_size, PyObject *__pyx_v_bsize, 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;
  size_t __pyx_t_5;
  MPI_Comm __pyx_t_6;
  PetscErrorCode __pyx_t_7;
  ISLocalToGlobalMapping __pyx_t_8;
  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":1749
 *         """
 *         # 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 = ((PyObject *)__pyx_v_lgmapr);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getComm, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF_SET(__pyx_v_comm, __pyx_t_3);
    __pyx_t_3 = 0;
  }

  /* "petsc4py/PETSc/Mat.pyx":1750
 *         # 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 = ((PyObject *)__pyx_v_lgmapc);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getComm, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 1750, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF_SET(__pyx_v_comm, __pyx_t_3);
    __pyx_t_3 = 0;
  }

  /* "petsc4py/PETSc/Mat.pyx":1751
 *         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":1752
 *         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":1753
 *         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, bsize, &rbs, &cbs, &m, &n, &M, &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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 1753, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_6;

  /* "petsc4py/PETSc/Mat.pyx":1754
 *         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, bsize, &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":1755
 *         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, bsize, &rbs, &cbs, &m, &n, &M, &N)             # <<<<<<<<<<<<<<
 *         Sys_Layout(ccomm, rbs, &m, &M)
 *         Sys_Layout(ccomm, cbs, &n, &N)
*/
  __pyx_t_7 = __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_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1755, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1756
 *         cdef PetscInt rbs = 0, cbs = 0, m = 0, n = 0, M = 0, N = 0
 *         Mat_Sizes(size, bsize, &rbs, &cbs, &m, &n, &M, &N)
 *         Sys_Layout(ccomm, rbs, &m, &M)             # <<<<<<<<<<<<<<
 *         Sys_Layout(ccomm, cbs, &n, &N)
 *         # create matrix
*/
  __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_rbs, (&__pyx_v_m), (&__pyx_v_M)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1756, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1757
 *         Mat_Sizes(size, bsize, &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_7 = __pyx_f_8petsc4py_5PETSc_Sys_Layout(__pyx_v_ccomm, __pyx_v_cbs, (&__pyx_v_n), (&__pyx_v_N)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1757, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1759
 *         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":1760
 *         # 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":1761
 *         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":1762
 *         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":1763
 *         if rbs == cbs: bs = rbs
 *         if lgmapr is not None:
 *             lgmr = lgmapr.lgm             # <<<<<<<<<<<<<<
 *         if lgmapc is not None:
 *             lgmc = lgmapc.lgm
*/
    __pyx_t_8 = __pyx_v_lgmapr->lgm;
    __pyx_v_lgmr = __pyx_t_8;

    /* "petsc4py/PETSc/Mat.pyx":1762
 *         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":1764
 *         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":1765
 *             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_8 = __pyx_v_lgmapc->lgm;
    __pyx_v_lgmc = __pyx_t_8;

    /* "petsc4py/PETSc/Mat.pyx":1764
 *         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":1766
 *         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_7 = __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_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1766, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1767
 *             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_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, 1767, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1768
 *         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":1717
 *         return self
 * 
 *     def createIS(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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":1770
 *         return self
 * 
 *     def createConstantDiagonal(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_117createConstantDiagonal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_116createConstantDiagonal, "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:1770");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_117createConstantDiagonal = {"createConstantDiagonal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_117createConstantDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_116createConstantDiagonal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_117createConstantDiagonal(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_diag,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1770, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1770, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1770, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1770, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createConstantDiagonal", 0) < (0)) __PYX_ERR(46, 1770, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":1774
 *         size: MatSizeSpec,
 *         diag: float,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a diagonal matrix of type `Type.CONSTANTDIAGONAL`.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createConstantDiagonal", 0, 2, 3, i); __PYX_ERR(46, 1770, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1770, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1770, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1770, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1770, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_116createConstantDiagonal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_diag, __pyx_v_comm);

  /* "petsc4py/PETSc/Mat.pyx":1770
 *         return self
 * 
 *     def createConstantDiagonal(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_116createConstantDiagonal(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":1793
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 1793, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":1794
 *         """
 *         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":1795
 *         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, 1795, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1796
 *         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, 1796, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1797
 *         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, 1797, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1798
 *         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":1799
 *         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, 1799, __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, 1799, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1800
 *         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, 1800, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1801
 *         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":1770
 *         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":1803
 *         return self
 * 
 *     def createDiagonal(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec diag) -> Self:
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_119createDiagonal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_118createDiagonal, "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:1803");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_119createDiagonal = {"createDiagonal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_119createDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_118createDiagonal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_119createDiagonal(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_diag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1803, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1803, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createDiagonal", 0) < (0)) __PYX_ERR(46, 1803, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createDiagonal", 1, 1, 1, i); __PYX_ERR(46, 1803, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1803, __pyx_L3_error)
    }
    __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, 1803, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "diag", 0))) __PYX_ERR(46, 1805, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_118createDiagonal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_diag);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_118createDiagonal(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":1820
 * 
 *         """
 *         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":1821
 *         """
 *         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":1822
 *         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, 1822, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1823
 *         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, 1823, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1824
 *         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":1803
 *         return self
 * 
 *     def createDiagonal(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec diag) -> Self:
*/

  /* 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":1826
 *         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_121createPython(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_120createPython, "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:1826");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_121createPython = {"createPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_121createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_120createPython};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_121createPython(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,&__pyx_mstate_global->__pyx_n_u_context,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1826, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1826, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1826, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1826, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createPython", 0) < (0)) __PYX_ERR(46, 1826, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createPython", 0, 1, 3, i); __PYX_ERR(46, 1826, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 1826, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1826, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1826, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1826, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_120createPython(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_size, __pyx_v_context, __pyx_v_comm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_120createPython(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_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createPython", 0);

  /* "petsc4py/PETSc/Mat.pyx":1846
 *         """
 *         # 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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 1846, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":1847
 *         # 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":1848
 *         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, 1848, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1849
 *         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, 1849, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1850
 *         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, 1850, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1853
 *         # 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":1854
 *         # 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, 1854, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1855
 *         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, 1855, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":1856
 *         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, <void*>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, 1856, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1857
 *         CHKERR(PetscCLEAR(self.obj)); self.mat = newmat
 *         CHKERR(MatSetSizes(self.mat, m, n, M, N))
 *         CHKERR(MatSetType(self.mat, MATPYTHON))             # <<<<<<<<<<<<<<
 *         CHKERR(MatPythonSetContext(self.mat, <void*>context))
 *         if context:
*/
  __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, 1857, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1858
 *         CHKERR(MatSetSizes(self.mat, m, n, M, N))
 *         CHKERR(MatSetType(self.mat, MATPYTHON))
 *         CHKERR(MatPythonSetContext(self.mat, <void*>context))             # <<<<<<<<<<<<<<
 *         if context:
 *             CHKERR(MatSetUp(self.mat))
*/
  __pyx_t_2 = MatPythonSetContext(__pyx_v_self->mat, ((void *)__pyx_v_context)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1858, __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, 1858, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1859
 *         CHKERR(MatSetType(self.mat, MATPYTHON))
 *         CHKERR(MatPythonSetContext(self.mat, <void*>context))
 *         if context:             # <<<<<<<<<<<<<<
 *             CHKERR(MatSetUp(self.mat))
 *         return self
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_context); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(46, 1859, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "petsc4py/PETSc/Mat.pyx":1860
 *         CHKERR(MatPythonSetContext(self.mat, <void*>context))
 *         if context:
 *             CHKERR(MatSetUp(self.mat))             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSetUp(__pyx_v_self->mat)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1860, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":1859
 *         CHKERR(MatSetType(self.mat, MATPYTHON))
 *         CHKERR(MatPythonSetContext(self.mat, <void*>context))
 *         if context:             # <<<<<<<<<<<<<<
 *             CHKERR(MatSetUp(self.mat))
 *         return self
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":1861
 *         if context:
 *             CHKERR(MatSetUp(self.mat))
 *         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":1826
 *         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":1863
 *         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_123setPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_122setPythonContext, "Mat.setPythonContext(self, context: Any) -> None\nSet the instance of the class implementing the required Python methods.\n\n        Logically collective.\n\n        Notes\n        -----\n        In order to use the matrix, `Mat.setUp` must be called after having set\n        the context. Pass `None` to reset the matrix to its initial state.\n\n        See Also\n        --------\n        petsc_python_mat, getPythonContext, setPythonType\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:1863");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_123setPythonContext = {"setPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_123setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_122setPythonContext};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_123setPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_context,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1863, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1863, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPythonContext", 0) < (0)) __PYX_ERR(46, 1863, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, i); __PYX_ERR(46, 1863, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1863, __pyx_L3_error)
    }
    __pyx_v_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 1863, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_122setPythonContext(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_context);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_122setPythonContext(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":1878
 * 
 *         """
 *         CHKERR(MatPythonSetContext(self.mat, <void*>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, 1878, __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, 1878, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1863
 *         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":1880
 *         CHKERR(MatPythonSetContext(self.mat, <void*>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_125getPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_124getPythonContext, "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:1880");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_125getPythonContext = {"getPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_125getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_124getPythonContext};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_125getPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPythonContext", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_124getPythonContext(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_124getPythonContext(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":1890
 * 
 *         """
 *         cdef void *context = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(MatPythonGetContext(self.mat, &context))
 *         if context == NULL: return None
*/
  __pyx_v_context = NULL;

  /* "petsc4py/PETSc/Mat.pyx":1891
 *         """
 *         cdef void *context = NULL
 *         CHKERR(MatPythonGetContext(self.mat, &context))             # <<<<<<<<<<<<<<
 *         if context == NULL: return None
 *         else: return <object> context
*/
  __pyx_t_1 = MatPythonGetContext(__pyx_v_self->mat, (&__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 1891, __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, 1891, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1892
 *         cdef void *context = NULL
 *         CHKERR(MatPythonGetContext(self.mat, &context))
 *         if context == NULL: return None             # <<<<<<<<<<<<<<
 *         else: return <object> 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":1893
 *         CHKERR(MatPythonGetContext(self.mat, &context))
 *         if context == NULL: return None
 *         else: return <object> 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":1880
 *         CHKERR(MatPythonSetContext(self.mat, <void*>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":1895
 *         else: return <object> 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_127setPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_126setPythonType, "Mat.setPythonType(self, py_type: str) -> None\nSet the fully qualified Python name of the class to be used.\n\n        Collective.\n\n        Notes\n        -----\n        In order to use the matrix, `Mat.setUp` must be called after having set\n        the type.\n\n        See Also\n        --------\n        petsc_python_mat, setPythonContext, getPythonType\n        petsc.MatPythonSetType\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:1895");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_127setPythonType = {"setPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_127setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_126setPythonType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_127setPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_py_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1895, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1895, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPythonType", 0) < (0)) __PYX_ERR(46, 1895, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, i); __PYX_ERR(46, 1895, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1895, __pyx_L3_error)
    }
    __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, 1895, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_126setPythonType(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_py_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_126setPythonType(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":1911
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         py_type = str2bytes(py_type, &cval)
 *         CHKERR(MatPythonSetType(self.mat, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Mat.pyx":1912
 *         """
 *         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, 1912, __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":1913
 *         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, 1913, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1895
 *         else: return <object> 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":1915
 *         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_129getPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_128getPythonType, "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:1915");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_129getPythonType = {"getPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_129getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_128getPythonType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_129getPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPythonType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_128getPythonType(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_128getPythonType(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":1926
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(MatPythonGetType(self.mat, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Mat.pyx":1927
 *         """
 *         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, 1927, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1928
 *         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, 1928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":1915
 *         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":1932
 *     #
 * 
 *     def setOptionsPrefix(self, prefix: str | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the prefix used for searching for options in the database.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_131setOptionsPrefix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_130setOptionsPrefix, "Mat.setOptionsPrefix(self, prefix: str | None = None) -> 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:1932");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_131setOptionsPrefix = {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_131setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_130setOptionsPrefix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_131setOptionsPrefix(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1932, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOptionsPrefix", 0) < (0)) __PYX_ERR(46, 1932, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 1932, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_130setOptionsPrefix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_prefix);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_130setOptionsPrefix(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":1942
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(MatSetOptionsPrefix(self.mat, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Mat.pyx":1943
 *         """
 *         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, 1943, __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":1944
 *         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, 1944, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1932
 *     #
 * 
 *     def setOptionsPrefix(self, prefix: str | None = None) -> 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":1946
 *         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_133getOptionsPrefix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_132getOptionsPrefix, "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:1946");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_133getOptionsPrefix = {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_133getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_132getOptionsPrefix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_133getOptionsPrefix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOptionsPrefix", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_132getOptionsPrefix(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_132getOptionsPrefix(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":1956
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetOptionsPrefix(self.mat, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Mat.pyx":1957
 *         """
 *         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, 1957, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1958
 *         cdef const char *cval = NULL
 *         CHKERR(MatGetOptionsPrefix(self.mat, &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     def appendOptionsPrefix(self, prefix: str | None = None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 1958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":1946
 *         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":1960
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Append to the prefix used for searching for options in the database.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_135appendOptionsPrefix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_134appendOptionsPrefix, "Mat.appendOptionsPrefix(self, prefix: str | None = None) -> 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:1960");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_135appendOptionsPrefix = {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_135appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_134appendOptionsPrefix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_135appendOptionsPrefix(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1960, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1960, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "appendOptionsPrefix", 0) < (0)) __PYX_ERR(46, 1960, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1960, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 1960, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_134appendOptionsPrefix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_prefix);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_134appendOptionsPrefix(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":1970
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(MatAppendOptionsPrefix(self.mat, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Mat.pyx":1971
 *         """
 *         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, 1971, __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":1972
 *         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, 1972, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1960
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None = None) -> 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":1974
 *         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_137setFromOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_136setFromOptions, "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:1974");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_137setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_137setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_136setFromOptions};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_137setFromOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_136setFromOptions(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_136setFromOptions(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":1984
 * 
 *         """
 *         CHKERR(MatSetFromOptions(self.mat))             # <<<<<<<<<<<<<<
 * 
 *     def setUp(self) -> Self:
*/
  __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, 1984, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1974
 *         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":1986
 *         CHKERR(MatSetFromOptions(self.mat))
 * 
 *     def setUp(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_139setUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_138setUp, "Mat.setUp(self) -> Self\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:1986");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_139setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_139setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_138setUp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_139setUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_138setUp(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_138setUp(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":1996
 * 
 *         """
 *         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, 1996, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1997
 *         """
 *         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":1986
 *         CHKERR(MatSetFromOptions(self.mat))
 * 
 *     def setUp(self) -> Self:             # <<<<<<<<<<<<<<
 *         """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":1999
 *         return self
 * 
 *     def setOption(self, option: Option, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set option.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_141setOption(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_140setOption, "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:1999");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_141setOption = {"setOption", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_141setOption, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_140setOption};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_141setOption(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_option,&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 1999, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1999, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1999, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOption", 0) < (0)) __PYX_ERR(46, 1999, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setOption", 1, 2, 2, i); __PYX_ERR(46, 1999, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 1999, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 1999, __pyx_L3_error)
    }
    __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, 1999, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_140setOption(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_option, __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_140setOption(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2009
 * 
 *         """
 *         CHKERR(MatSetOption(self.mat, option, flag))             # <<<<<<<<<<<<<<
 * 
 *     def getOption(self, option: Option) -> bool:
*/
  __pyx_t_1 = ((MatOption)__Pyx_PyLong_As_MatOption(__pyx_v_option)); if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2009, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(46, 2009, __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, 2009, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":1999
 *         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":2011
 *         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_143getOption(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_142getOption, "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:2011");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_143getOption = {"getOption", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_143getOption, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_142getOption};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_143getOption(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_option,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2011, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getOption", 0) < (0)) __PYX_ERR(46, 2011, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getOption", 1, 1, 1, i); __PYX_ERR(46, 2011, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2011, __pyx_L3_error)
    }
    __pyx_v_option = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getOption", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 2011, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_142getOption(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_option);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_142getOption(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2021
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetOption(self.mat, option, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/Mat.pyx":2022
 *         """
 *         cdef PetscBool flag = PETSC_FALSE
 *         CHKERR(MatGetOption(self.mat, option, &flag))             # <<<<<<<<<<<<<<
 *         return toBool(flag)
 * 
*/
  __pyx_t_1 = ((MatOption)__Pyx_PyLong_As_MatOption(__pyx_v_option)); if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 2022, __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, 2022, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2023
 *         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, 2023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2011
 *         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":2025
 *         return toBool(flag)
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_145getType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_144getType, "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:2025");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_145getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_145getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_144getType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_145getType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_144getType(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_144getType(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2035
 * 
 *         """
 *         cdef PetscMatType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetType(self.mat, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Mat.pyx":2036
 *         """
 *         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, 2036, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2037
 *         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, 2037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2025
 *         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":2039
 *         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_147getSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_146getSize, "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:2039");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_147getSize = {"getSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_147getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_146getSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_147getSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_146getSize(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_146getSize(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2049
 * 
 *         """
 *         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":2050
 *         """
 *         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, 2050, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2051
 *         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, 2051, __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, 2051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2051, __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) != (0)) __PYX_ERR(46, 2051, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(46, 2051, __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":2039
 *         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":2053
 *         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_149getLocalSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_148getLocalSize, "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:2053");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_149getLocalSize = {"getLocalSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_149getLocalSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_148getLocalSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_149getLocalSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLocalSize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_148getLocalSize(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_148getLocalSize(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2063
 * 
 *         """
 *         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":2064
 *         """
 *         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, 2064, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2065
 *         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, 2065, __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, 2065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2065, __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) != (0)) __PYX_ERR(46, 2065, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(46, 2065, __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":2053
 *         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":2067
 *         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_151getSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_150getSizes, "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:2067");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_151getSizes = {"getSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_151getSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_150getSizes};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_151getSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSizes", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_150getSizes(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_150getSizes(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2077
 * 
 *         """
 *         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":2078
 *         """
 *         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":2079
 *         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, 2079, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2080
 *         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, 2080, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2081
 *         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, 2081, __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, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2081, __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) != (0)) __PYX_ERR(46, 2081, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(46, 2081, __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, 2081, __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, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 2081, __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) != (0)) __PYX_ERR(46, 2081, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2) != (0)) __PYX_ERR(46, 2081, __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, 2081, __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) != (0)) __PYX_ERR(46, 2081, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5) != (0)) __PYX_ERR(46, 2081, __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":2067
 *         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":2083
 *         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_153getBlockSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_152getBlockSize, "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:2083");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_153getBlockSize = {"getBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_153getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_152getBlockSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_153getBlockSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBlockSize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_152getBlockSize(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_152getBlockSize(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2093
 * 
 *         """
 *         cdef PetscInt bs = 0             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetBlockSize(self.mat, &bs))
 *         return toInt(bs)
*/
  __pyx_v_bs = 0;

  /* "petsc4py/PETSc/Mat.pyx":2094
 *         """
 *         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, 2094, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2095
 *         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, 2095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2083
 *         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":2097
 *         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_155getBlockSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_154getBlockSizes, "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:2097");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_155getBlockSizes = {"getBlockSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_155getBlockSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_154getBlockSizes};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_155getBlockSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBlockSizes", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_154getBlockSizes(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_154getBlockSizes(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2107
 * 
 *         """
 *         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":2108
 *         """
 *         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, 2108, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2109
 *         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, 2109, __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, 2109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2109, __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) != (0)) __PYX_ERR(46, 2109, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(46, 2109, __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":2097
 *         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":2111
 *         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_157getOwnershipRange(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_156getOwnershipRange, "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:2111");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_157getOwnershipRange = {"getOwnershipRange", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_157getOwnershipRange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_156getOwnershipRange};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_157getOwnershipRange(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOwnershipRange", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_156getOwnershipRange(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_156getOwnershipRange(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2121
 * 
 *         """
 *         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":2122
 *         """
 *         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, 2122, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2123
 *         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, 2123, __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, 2123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2123, __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) != (0)) __PYX_ERR(46, 2123, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(46, 2123, __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":2111
 *         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":2125
 *         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_159getOwnershipRanges(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_158getOwnershipRanges, "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:2125");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_159getOwnershipRanges = {"getOwnershipRanges", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_159getOwnershipRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_158getOwnershipRanges};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_159getOwnershipRanges(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOwnershipRanges", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_158getOwnershipRanges(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_158getOwnershipRanges(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2137
 * 
 *         """
 *         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":2138
 *         """
 *         cdef const PetscInt *rowrng = NULL
 *         CHKERR(MatGetOwnershipRanges(self.mat, &rowrng))             # <<<<<<<<<<<<<<
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         CHKERR(PetscObjectGetComm(<PetscObject>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, 2138, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2139
 *         cdef const PetscInt *rowrng = NULL
 *         CHKERR(MatGetOwnershipRanges(self.mat, &rowrng))
 *         cdef MPI_Comm comm = MPI_COMM_NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.mat, &comm))
 *         cdef int size = -1
*/
  __pyx_v_comm = MPI_COMM_NULL;

  /* "petsc4py/PETSc/Mat.pyx":2140
 *         CHKERR(MatGetOwnershipRanges(self.mat, &rowrng))
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.mat, &comm))             # <<<<<<<<<<<<<<
 *         cdef int size = -1
 *         CHKERR(<PetscErrorCode>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, 2140, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2141
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.mat, &comm))
 *         cdef int size = -1             # <<<<<<<<<<<<<<
 *         CHKERR(<PetscErrorCode>MPI_Comm_size(comm, &size))
 *         return array_i(size+1, rowrng)
*/
  __pyx_v_size = -1;

  /* "petsc4py/PETSc/Mat.pyx":2142
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.mat, &comm))
 *         cdef int size = -1
 *         CHKERR(<PetscErrorCode>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, 2142, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2143
 *         cdef int size = -1
 *         CHKERR(<PetscErrorCode>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, 2143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2125
 *         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":2145
 *         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_161getOwnershipRangeColumn(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_160getOwnershipRangeColumn, "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:2145");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_161getOwnershipRangeColumn = {"getOwnershipRangeColumn", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_161getOwnershipRangeColumn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_160getOwnershipRangeColumn};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_161getOwnershipRangeColumn(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOwnershipRangeColumn", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_160getOwnershipRangeColumn(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_160getOwnershipRangeColumn(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2156
 * 
 *         """
 *         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":2157
 *         """
 *         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, 2157, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2158
 *         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, 2158, __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, 2158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2158, __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) != (0)) __PYX_ERR(46, 2158, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(46, 2158, __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":2145
 *         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":2160
 *         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_163getOwnershipRangesColumn(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_162getOwnershipRangesColumn, "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:2160");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_163getOwnershipRangesColumn = {"getOwnershipRangesColumn", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_163getOwnershipRangesColumn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_162getOwnershipRangesColumn};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_163getOwnershipRangesColumn(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOwnershipRangesColumn", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_162getOwnershipRangesColumn(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_162getOwnershipRangesColumn(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2170
 * 
 *         """
 *         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":2171
 *         """
 *         cdef const PetscInt *colrng = NULL
 *         CHKERR(MatGetOwnershipRangesColumn(self.mat, &colrng))             # <<<<<<<<<<<<<<
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         CHKERR(PetscObjectGetComm(<PetscObject>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, 2171, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2172
 *         cdef const PetscInt *colrng = NULL
 *         CHKERR(MatGetOwnershipRangesColumn(self.mat, &colrng))
 *         cdef MPI_Comm comm = MPI_COMM_NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.mat, &comm))
 *         cdef int size = -1
*/
  __pyx_v_comm = MPI_COMM_NULL;

  /* "petsc4py/PETSc/Mat.pyx":2173
 *         CHKERR(MatGetOwnershipRangesColumn(self.mat, &colrng))
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.mat, &comm))             # <<<<<<<<<<<<<<
 *         cdef int size = -1
 *         CHKERR(<PetscErrorCode>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, 2173, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2174
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.mat, &comm))
 *         cdef int size = -1             # <<<<<<<<<<<<<<
 *         CHKERR(<PetscErrorCode>MPI_Comm_size(comm, &size))
 *         return array_i(size+1, colrng)
*/
  __pyx_v_size = -1;

  /* "petsc4py/PETSc/Mat.pyx":2175
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.mat, &comm))
 *         cdef int size = -1
 *         CHKERR(<PetscErrorCode>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, 2175, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2176
 *         cdef int size = -1
 *         CHKERR(<PetscErrorCode>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, 2176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2160
 *         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":2178
 *         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_165getOwnershipIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_164getOwnershipIS, "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:2178");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_165getOwnershipIS = {"getOwnershipIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_165getOwnershipIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_164getOwnershipIS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_165getOwnershipIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOwnershipIS", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_164getOwnershipIS(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_164getOwnershipIS(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getOwnershipIS", 0);

  /* "petsc4py/PETSc/Mat.pyx":2188
 * 
 *         """
 *         cdef IS rows = IS()             # <<<<<<<<<<<<<<
 *         cdef IS cols = IS()
 *         CHKERR(MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 2188, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_rows = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2189
 *         """
 *         cdef IS rows = IS()
 *         cdef IS cols = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset))
 *         return (rows, cols)
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 2189, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_cols = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2190
 *         cdef IS rows = IS()
 *         cdef IS cols = IS()
 *         CHKERR(MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset))             # <<<<<<<<<<<<<<
 *         return (rows, cols)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetOwnershipIS(__pyx_v_self->mat, (&__pyx_v_rows->iset), (&__pyx_v_cols->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2190, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2191
 *         cdef IS cols = IS()
 *         CHKERR(MatGetOwnershipIS(self.mat, &rows.iset, &cols.iset))
 *         return (rows, cols)             # <<<<<<<<<<<<<<
 * 
 *     def getInfo(self, info: InfoType | None = None) -> dict[str, float]:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 2191, __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)) != (0)) __PYX_ERR(46, 2191, __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)) != (0)) __PYX_ERR(46, 2191, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2178
 *         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_XDECREF(__pyx_t_2);
  __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":2193
 *         return (rows, cols)
 * 
 *     def getInfo(self, info: InfoType | None = None) -> dict[str, float]:             # <<<<<<<<<<<<<<
 *         """Return summary information.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_167getInfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_166getInfo, "Mat.getInfo(self, info: InfoType | None = 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:2193");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_167getInfo = {"getInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_167getInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_166getInfo};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_167getInfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_info,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2193, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getInfo", 0) < (0)) __PYX_ERR(46, 2193, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_info = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getInfo", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 2193, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_166getInfo(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_info);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_166getInfo(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2208
 * 
 *         """
 *         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, 2208, __pyx_L1_error)
  __pyx_v_itype = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":2210
 *         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, 2210, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2211
 *         cdef PetscMatInfo cinfo
 *         CHKERR(MatGetInfo(self.mat, itype, &cinfo))
 *         return cinfo             # <<<<<<<<<<<<<<
 * 
 *     def duplicate(self, copy: DuplicateOption | 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, 2211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2193
 *         return (rows, cols)
 * 
 *     def getInfo(self, info: InfoType | None = 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":2213
 *         return cinfo
 * 
 *     def duplicate(self, copy: DuplicateOption | bool = False) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return a clone of the matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_169duplicate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_168duplicate, "Mat.duplicate(self, copy: DuplicateOption | 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:2213");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_169duplicate = {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_169duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_168duplicate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_169duplicate(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_copy,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2213, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2213, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "duplicate", 0) < (0)) __PYX_ERR(46, 2213, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2213, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_copy = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("duplicate", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 2213, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_168duplicate(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_copy);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_168duplicate(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
  MatDuplicateOption __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("duplicate", 0);

  /* "petsc4py/PETSc/Mat.pyx":2228
 * 
 *         """
 *         cdef PetscMatDuplicateOption flag = matduplicateoption(copy)             # <<<<<<<<<<<<<<
 *         cdef Mat mat = type(self)()
 *         CHKERR(MatDuplicate(self.mat, flag, &mat.mat))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matduplicateoption(__pyx_v_copy); if (unlikely(__pyx_t_1 == ((MatDuplicateOption)((MatDuplicateOption)-1L)))) __PYX_ERR(46, 2228, __pyx_L1_error)
  __pyx_v_flag = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":2229
 *         """
 *         cdef PetscMatDuplicateOption flag = matduplicateoption(copy)
 *         cdef Mat mat = type(self)()             # <<<<<<<<<<<<<<
 *         CHKERR(MatDuplicate(self.mat, flag, &mat.mat))
 *         return mat
*/
  __pyx_t_3 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 2229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(46, 2229, __pyx_L1_error)
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2230
 *         cdef PetscMatDuplicateOption flag = matduplicateoption(copy)
 *         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, 2230, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2231
 *         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":2213
 *         return cinfo
 * 
 *     def duplicate(self, copy: DuplicateOption | 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":2233
 *         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_171copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_170copy, "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:2233");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_171copy = {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_171copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_170copy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_171copy(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_result,&__pyx_mstate_global->__pyx_n_u_structure,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2233, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2233, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2233, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "copy", 0) < (0)) __PYX_ERR(46, 2233, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2233, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2233, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2233, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(46, 2233, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_170copy(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_result, __pyx_v_structure);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_170copy(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;
  size_t __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":2250
 * 
 *         """
 *         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":2251
 *         """
 *         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, 2251, __pyx_L1_error)
  __pyx_v_mstr = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":2252
 *         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":2253
 *         cdef PetscMatStructure mstr = matstructure(structure)
 *         if result is None:
 *             result = type(self)()             # <<<<<<<<<<<<<<
 *         if result.mat == NULL:
 *             CHKERR(MatDuplicate(self.mat, copy, &result.mat))
*/
    __pyx_t_4 = NULL;
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __pyx_t_5 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 2253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(46, 2253, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/Mat.pyx":2252
 *         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":2254
 *         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":2255
 *             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, 2255, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":2254
 *         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":2257
 *             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, 2257, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/Mat.pyx":2258
 *         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":2233
 *         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":2260
 *         return result
 * 
 *     def load(self, Viewer viewer) -> Self:             # <<<<<<<<<<<<<<
 *         """Load a matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_173load(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_172load, "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:2260");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_173load = {"load", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_173load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_172load};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_173load(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2260, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "load", 0) < (0)) __PYX_ERR(46, 2260, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, i); __PYX_ERR(46, 2260, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2260, __pyx_L3_error)
    }
    __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, 2260, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(46, 2260, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_172load(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_viewer);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_172load(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2270
 * 
 *         """
 *         cdef MPI_Comm comm = MPI_COMM_NULL             # <<<<<<<<<<<<<<
 *         cdef PetscObject obj = <PetscObject>(viewer.vwr)
 *         if self.mat == NULL:
*/
  __pyx_v_comm = MPI_COMM_NULL;

  /* "petsc4py/PETSc/Mat.pyx":2271
 *         """
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         cdef PetscObject obj = <PetscObject>(viewer.vwr)             # <<<<<<<<<<<<<<
 *         if self.mat == NULL:
 *             CHKERR(PetscObjectGetComm(obj, &comm))
*/
  __pyx_v_obj = ((PetscObject)__pyx_v_viewer->vwr);

  /* "petsc4py/PETSc/Mat.pyx":2272
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         cdef PetscObject obj = <PetscObject>(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":2273
 *         cdef PetscObject obj = <PetscObject>(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, 2273, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":2274
 *         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, 2274, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":2272
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         cdef PetscObject obj = <PetscObject>(viewer.vwr)
 *         if self.mat == NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscObjectGetComm(obj, &comm))
 *             CHKERR(MatCreate(comm, &self.mat))
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":2275
 *             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, 2275, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2276
 *             CHKERR(MatCreate(comm, &self.mat))
 *         CHKERR(MatLoad(self.mat, viewer.vwr))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def convert(self, mat_type: Type | str | None = 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":2260
 *         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":2278
 *         return self
 * 
 *     def convert(self, mat_type: Type | str | None = None, Mat out=None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Convert the matrix type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_175convert(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_174convert, "Mat.convert(self, mat_type: Type | str | None = 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:2278");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_175convert = {"convert", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_175convert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_174convert};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_175convert(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat_type,&__pyx_mstate_global->__pyx_n_u_out,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2278, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2278, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2278, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "convert", 0) < (0)) __PYX_ERR(46, 2278, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2278, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2278, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 2278, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(46, 2278, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_174convert(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat_type, __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_174convert(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":2296
 * 
 *         """
 *         cdef PetscMatType mtype = MATSAME             # <<<<<<<<<<<<<<
 *         cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
 *         mat_type = str2bytes(mat_type, &mtype)
*/
  __pyx_v_mtype = MATSAME;

  /* "petsc4py/PETSc/Mat.pyx":2297
 *         """
 *         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":2298
 *         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, 2298, __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":2299
 *         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":2300
 *         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":2301
 *         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":2302
 *         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":2301
 *         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":2303
 *         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":2304
 *             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":2303
 *         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":2306
 *             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":2307
 *         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, 2307, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2308
 *             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":2278
 *         return self
 * 
 *     def convert(self, mat_type: Type | str | None = 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":2310
 *         return out
 * 
 *     def transpose(self, Mat out=None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the transposed matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_177transpose(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_176transpose, "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:2310");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_177transpose = {"transpose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_177transpose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_176transpose};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_177transpose(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_out,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2310, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2310, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "transpose", 0) < (0)) __PYX_ERR(46, 2310, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2310, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 2310, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(46, 2310, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_176transpose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_176transpose(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":2326
 * 
 *         """
 *         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":2327
 *         """
 *         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":2328
 *         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":2329
 *         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":2328
 *         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":2330
 *         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":2331
 *             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":2330
 *         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":2333
 *             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":2334
 *         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, 2334, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2335
 *             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":2310
 *         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":2337
 *         return out
 * 
 *     def setTransposePrecursor(self, Mat out) -> None:             # <<<<<<<<<<<<<<
 *         """Set transpose precursor.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_179setTransposePrecursor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_178setTransposePrecursor, "Mat.setTransposePrecursor(self, out: Mat) -> None\nSet transpose precursor.\n\n        Logically collective.\n\n        See Also\n        --------\n        petsc.MatTransposeSetPrecursor\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:2337");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_179setTransposePrecursor = {"setTransposePrecursor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_179setTransposePrecursor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_178setTransposePrecursor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_179setTransposePrecursor(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_out,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2337, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2337, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTransposePrecursor", 0) < (0)) __PYX_ERR(46, 2337, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setTransposePrecursor", 1, 1, 1, i); __PYX_ERR(46, 2337, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2337, __pyx_L3_error)
    }
    __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, 2337, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "out", 0))) __PYX_ERR(46, 2337, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_178setTransposePrecursor(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_178setTransposePrecursor(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2347
 * 
 *         """
 *         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, 2347, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2337
 *         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":2349
 *         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_181hermitianTranspose(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_180hermitianTranspose, "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:2349");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_181hermitianTranspose = {"hermitianTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_181hermitianTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_180hermitianTranspose};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_181hermitianTranspose(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_out,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2349, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2349, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "hermitianTranspose", 0) < (0)) __PYX_ERR(46, 2349, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2349, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 2349, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(46, 2349, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_180hermitianTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_180hermitianTranspose(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":2365
 * 
 *         """
 *         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":2366
 *         """
 *         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":2367
 *         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":2368
 *         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":2367
 *         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":2369
 *         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":2370
 *             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":2369
 *         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":2372
 *             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":2373
 *         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, 2373, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2374
 *             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":2349
 *         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":2376
 *         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_183realPart(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_182realPart, "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:2376");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_183realPart = {"realPart", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_183realPart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_182realPart};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_183realPart(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_out,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2376, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2376, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "realPart", 0) < (0)) __PYX_ERR(46, 2376, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2376, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 2376, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(46, 2376, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_182realPart(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_182realPart(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":2392
 * 
 *         """
 *         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":2393
 *         """
 *         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":2392
 * 
 *         """
 *         if out is None:             # <<<<<<<<<<<<<<
 *             out = self
 *         elif out.mat == NULL:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Mat.pyx":2394
 *         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":2395
 *             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, 2395, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":2394
 *         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":2396
 *         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, 2396, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2397
 *             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":2376
 *         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":2399
 *         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_185imagPart(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_184imagPart, "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:2399");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_185imagPart = {"imagPart", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_185imagPart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_184imagPart};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_185imagPart(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_out,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2399, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2399, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "imagPart", 0) < (0)) __PYX_ERR(46, 2399, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2399, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 2399, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(46, 2399, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_184imagPart(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_184imagPart(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":2415
 * 
 *         """
 *         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":2416
 *         """
 *         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":2415
 * 
 *         """
 *         if out is None:             # <<<<<<<<<<<<<<
 *             out = self
 *         elif out.mat == NULL:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Mat.pyx":2417
 *         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":2418
 *             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, 2418, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":2417
 *         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":2419
 *         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, 2419, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2420
 *             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":2399
 *         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":2422
 *         return out
 * 
 *     def conjugate(self, Mat out=None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the conjugate matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_187conjugate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_186conjugate, "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:2422");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_187conjugate = {"conjugate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_187conjugate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_186conjugate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_187conjugate(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_out,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2422, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2422, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "conjugate", 0) < (0)) __PYX_ERR(46, 2422, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2422, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 2422, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(46, 2422, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_186conjugate(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_out);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_186conjugate(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":2438
 * 
 *         """
 *         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":2439
 *         """
 *         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":2438
 * 
 *         """
 *         if out is None:             # <<<<<<<<<<<<<<
 *             out = self
 *         elif out.mat == NULL:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Mat.pyx":2440
 *         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":2441
 *             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, 2441, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":2440
 *         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":2442
 *         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, 2442, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2443
 *             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":2422
 *         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":2445
 *         return out
 * 
 *     def permute(self, IS row, IS col) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the permuted matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_189permute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_188permute, "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:2445");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_189permute = {"permute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_189permute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_188permute};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_189permute(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_row,&__pyx_mstate_global->__pyx_n_u_col,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2445, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2445, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2445, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "permute", 0) < (0)) __PYX_ERR(46, 2445, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("permute", 1, 2, 2, i); __PYX_ERR(46, 2445, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2445, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2445, __pyx_L3_error)
    }
    __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, 2445, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "row", 0))) __PYX_ERR(46, 2445, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_col), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "col", 0))) __PYX_ERR(46, 2445, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_188permute(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_188permute(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("permute", 0);

  /* "petsc4py/PETSc/Mat.pyx":2462
 * 
 *         """
 *         cdef Mat mat = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(MatPermute(self.mat, row.iset, col.iset, &mat.mat))
 *         return mat
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 2462, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2463
 *         """
 *         cdef Mat mat = Mat()
 *         CHKERR(MatPermute(self.mat, row.iset, col.iset, &mat.mat))             # <<<<<<<<<<<<<<
 *         return mat
 * 
*/
  __pyx_t_4 = __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_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2463, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2464
 *         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":2445
 *         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_XDECREF(__pyx_t_2);
  __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":2466
 *         return mat
 * 
 *     def equal(self, Mat mat) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the result of matrix comparison.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_191equal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_190equal, "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:2466");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_191equal = {"equal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_191equal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_190equal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_191equal(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2466, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2466, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "equal", 0) < (0)) __PYX_ERR(46, 2466, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("equal", 1, 1, 1, i); __PYX_ERR(46, 2466, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2466, __pyx_L3_error)
    }
    __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, 2466, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 2466, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_190equal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_190equal(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2476
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(MatEqual(self.mat, mat.mat, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/Mat.pyx":2477
 *         """
 *         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, 2477, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2478
 *         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, 2478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2466
 *         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":2480
 *         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_193isTranspose(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_192isTranspose, "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:2480");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_193isTranspose = {"isTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_193isTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_192isTranspose};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_193isTranspose(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,&__pyx_mstate_global->__pyx_n_u_tol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2480, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2480, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2480, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "isTranspose", 0) < (0)) __PYX_ERR(46, 2480, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2480, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2480, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __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, 2480, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "mat", 0))) __PYX_ERR(46, 2480, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_192isTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_tol);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_192isTranspose(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":2497
 * 
 *         """
 *         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":2498
 *         """
 *         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, 2498, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_2;

  /* "petsc4py/PETSc/Mat.pyx":2499
 *         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":2500
 *         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, 2500, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2501
 *         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, 2501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2480
 *         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":2503
 *         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_195isSymmetric(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_194isSymmetric, "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:2503");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_195isSymmetric = {"isSymmetric", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_195isSymmetric, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_194isSymmetric};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_195isSymmetric(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2503, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2503, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "isSymmetric", 0) < (0)) __PYX_ERR(46, 2503, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2503, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __pyx_v_tol = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("isSymmetric", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 2503, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_194isSymmetric(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_tol);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_194isSymmetric(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2518
 * 
 *         """
 *         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, 2518, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":2519
 *         """
 *         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":2520
 *         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, 2520, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2521
 *         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, 2521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2503
 *         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":2523
 *         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_197isSymmetricKnown(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_196isSymmetricKnown, "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:2523");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_197isSymmetricKnown = {"isSymmetricKnown", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_197isSymmetricKnown, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_196isSymmetricKnown};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_197isSymmetricKnown(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isSymmetricKnown", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_196isSymmetricKnown(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_196isSymmetricKnown(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2533
 * 
 *         """
 *         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":2534
 *         """
 *         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":2535
 *         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, 2535, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2536
 *         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, 2536, __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, 2536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2536, __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) != (0)) __PYX_ERR(46, 2536, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(46, 2536, __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":2523
 *         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":2538
 *         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_199isHermitian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_198isHermitian, "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:2538");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_199isHermitian = {"isHermitian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_199isHermitian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_198isHermitian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_199isHermitian(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2538, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2538, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "isHermitian", 0) < (0)) __PYX_ERR(46, 2538, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2538, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __pyx_v_tol = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("isHermitian", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 2538, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_198isHermitian(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_tol);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_198isHermitian(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2553
 * 
 *         """
 *         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, 2553, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":2554
 *         """
 *         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":2555
 *         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, 2555, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2556
 *         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, 2556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2538
 *         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":2558
 *         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_201isHermitianKnown(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_200isHermitianKnown, "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:2558");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_201isHermitianKnown = {"isHermitianKnown", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_201isHermitianKnown, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_200isHermitianKnown};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_201isHermitianKnown(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isHermitianKnown", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_200isHermitianKnown(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_200isHermitianKnown(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2568
 * 
 *         """
 *         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":2569
 *         """
 *         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":2570
 *         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, 2570, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2571
 *         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, 2571, __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, 2571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 2571, __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) != (0)) __PYX_ERR(46, 2571, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(46, 2571, __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":2558
 *         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":2573
 *         return (toBool(flag1), toBool(flag2))
 * 
 *     def isStructurallySymmetric(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the boolean indicating if the matrix is structurally symmetric.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_203isStructurallySymmetric(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_202isStructurallySymmetric, "Mat.isStructurallySymmetric(self) -> bool\nReturn the boolean indicating if the matrix is structurally symmetric.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.MatIsStructurallySymmetric\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:2573");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_203isStructurallySymmetric = {"isStructurallySymmetric", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_203isStructurallySymmetric, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_202isStructurallySymmetric};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_203isStructurallySymmetric(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isStructurallySymmetric", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_202isStructurallySymmetric(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_202isStructurallySymmetric(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2583
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(MatIsStructurallySymmetric(self.mat, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/Mat.pyx":2584
 *         """
 *         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, 2584, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2585
 *         cdef PetscBool flag = PETSC_FALSE
 *         CHKERR(MatIsStructurallySymmetric(self.mat, &flag))
 *         return toBool(flag)             # <<<<<<<<<<<<<<
 * 
 *     def isLinear(self, n: int = 1) -> bool:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 2585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2573
 *         return (toBool(flag1), toBool(flag2))
 * 
 *     def isStructurallySymmetric(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the boolean indicating if the matrix is structurally symmetric.
 * 
*/

  /* 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":2587
 *         return toBool(flag)
 * 
 *     def isLinear(self, n: int = 1) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the Mat is a linear operator.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_205isLinear(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_204isLinear, "Mat.isLinear(self, n: int = 1) -> bool\nReturn whether the Mat is a linear operator.\n\n        Collective.\n\n        Parameters\n        ----------\n        n\n            Number of random vectors to be tested.\n\n        See Also\n        --------\n        petsc.MatIsLinear\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:2587");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_205isLinear = {"isLinear", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_205isLinear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_204isLinear};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_205isLinear(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("isLinear (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2587, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2587, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "isLinear", 0) < (0)) __PYX_ERR(46, 2587, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2587, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
    }
    __pyx_v_n = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("isLinear", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 2587, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.isLinear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_204isLinear(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_n);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_204isLinear(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_n) {
  PetscBool __pyx_v_flag;
  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("isLinear", 0);

  /* "petsc4py/PETSc/Mat.pyx":2602
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(MatIsLinear(self.mat, n, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/Mat.pyx":2603
 *         """
 *         cdef PetscBool flag = PETSC_FALSE
 *         CHKERR(MatIsLinear(self.mat, n, &flag))             # <<<<<<<<<<<<<<
 *         return toBool(flag)
 * 
*/
  __pyx_t_1 = __Pyx_PyLong_As_PetscInt(__pyx_v_n); if (unlikely((__pyx_t_1 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(46, 2603, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatIsLinear(__pyx_v_self->mat, __pyx_t_1, (&__pyx_v_flag))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2603, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2604
 *         cdef PetscBool flag = PETSC_FALSE
 *         CHKERR(MatIsLinear(self.mat, n, &flag))
 *         return toBool(flag)             # <<<<<<<<<<<<<<
 * 
 *     def zeroEntries(self) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 2604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2587
 *         return toBool(flag)
 * 
 *     def isLinear(self, n: int = 1) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the Mat is a linear operator.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.isLinear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":2606
 *         return toBool(flag)
 * 
 *     def zeroEntries(self) -> None:             # <<<<<<<<<<<<<<
 *         """Zero the entries of the matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_207zeroEntries(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_206zeroEntries, "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:2606");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_207zeroEntries = {"zeroEntries", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_207zeroEntries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_206zeroEntries};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_207zeroEntries(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("zeroEntries", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_206zeroEntries(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_206zeroEntries(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2616
 * 
 *         """
 *         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, 2616, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2606
 *         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":2618
 *         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_209getValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_208getValue, "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:2618");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_209getValue = {"getValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_209getValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_208getValue};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_209getValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_row,&__pyx_mstate_global->__pyx_n_u_col,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2618, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2618, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2618, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getValue", 0) < (0)) __PYX_ERR(46, 2618, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getValue", 1, 2, 2, i); __PYX_ERR(46, 2618, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2618, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2618, __pyx_L3_error)
    }
    __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, 2618, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_208getValue(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_208getValue(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2628
 * 
 *         """
 *         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, 2628, __pyx_L1_error)
  __pyx_v_ival1 = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":2629
 *         """
 *         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, 2629, __pyx_L1_error)
  __pyx_v_ival2 = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":2630
 *         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":2631
 *         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, 2631, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2632
 *         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 = 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, 2632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2618
 *         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":2634
 *         return toScalar(sval)
 * 
 *     def getValues(self, rows: Sequence[int], cols: Sequence[int], values: ArrayScalar | None = None) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Return the values in the ``zip(rows, cols)`` positions.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_211getValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_210getValues, "Mat.getValues(self, rows: Sequence[int], cols: Sequence[int], values: ArrayScalar | None = 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:2634");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_211getValues = {"getValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_211getValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_210getValues};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_211getValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_cols,&__pyx_mstate_global->__pyx_n_u_values,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2634, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2634, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2634, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2634, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getValues", 0) < (0)) __PYX_ERR(46, 2634, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getValues", 0, 2, 3, i); __PYX_ERR(46, 2634, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2634, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2634, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2634, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2634, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_210getValues(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_210getValues(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2653
 * 
 *         """
 *         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, 2653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2634
 *         return toScalar(sval)
 * 
 *     def getValues(self, rows: Sequence[int], cols: Sequence[int], values: ArrayScalar | None = 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":2655
 *         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_213getValuesCSR(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_212getValuesCSR, "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:2655");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_213getValuesCSR = {"getValuesCSR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_213getValuesCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_212getValuesCSR};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_213getValuesCSR(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getValuesCSR", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_212getValuesCSR(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_212getValuesCSR(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2666
 *         """
 *         # 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":2667
 *         # 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, 2667, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2668
 *         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":2670
 *         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":2671
 *         # 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, 2671, __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, 2671, __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":2672
 *         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":2673
 *         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":2674
 *         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":2675
 *         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, 2675, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":2676
 *         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":2677
 *             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, 2677, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Mat.pyx":2679
 *             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":2680
 *         # 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, 2680, __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, 2680, __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":2681
 *         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":2682
 *         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, 2682, __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, 2682, __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":2683
 *         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":2684
 *         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":2685
 *         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, <size_t>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":2686
 *         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, <size_t>ncols*sizeof(PetscInt)))
 *             CHKERR(PetscMemcpy(AV+AI[irow], vals, <size_t>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, 2686, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":2687
 *         for irow from 0 <= irow < nrows:
 *             CHKERR(MatGetRow(self.mat, irow+rstart, &ncols, &cols, &vals))
 *             CHKERR(PetscMemcpy(AJ+AI[irow], cols, <size_t>ncols*sizeof(PetscInt)))             # <<<<<<<<<<<<<<
 *             CHKERR(PetscMemcpy(AV+AI[irow], vals, <size_t>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, 2687, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":2688
 *             CHKERR(MatGetRow(self.mat, irow+rstart, &ncols, &cols, &vals))
 *             CHKERR(PetscMemcpy(AJ+AI[irow], cols, <size_t>ncols*sizeof(PetscInt)))
 *             CHKERR(PetscMemcpy(AV+AI[irow], vals, <size_t>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, 2688, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":2689
 *             CHKERR(PetscMemcpy(AJ+AI[irow], cols, <size_t>ncols*sizeof(PetscInt)))
 *             CHKERR(PetscMemcpy(AV+AI[irow], vals, <size_t>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, 2689, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Mat.pyx":2691
 *             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, 2691, __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)) != (0)) __PYX_ERR(46, 2691, __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)) != (0)) __PYX_ERR(46, 2691, __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)) != (0)) __PYX_ERR(46, 2691, __pyx_L1_error);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2655
 *         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":2693
 *         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_215getRow(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_214getRow, "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:2693");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_215getRow = {"getRow", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_215getRow, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_214getRow};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_215getRow(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_row,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2693, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2693, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getRow", 0) < (0)) __PYX_ERR(46, 2693, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getRow", 1, 1, 1, i); __PYX_ERR(46, 2693, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2693, __pyx_L3_error)
    }
    __pyx_v_row = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getRow", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 2693, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_214getRow(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_214getRow(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2703
 * 
 *         """
 *         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, 2703, __pyx_L1_error)
  __pyx_v_irow = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":2704
 *         """
 *         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":2705
 *         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":2706
 *         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":2707
 *         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, 2707, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2708
 *         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, 2708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_cols = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2709
 *         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, 2709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_vals = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2710
 *         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, 2710, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2711
 *         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, 2711, __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) != (0)) __PYX_ERR(46, 2711, __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) != (0)) __PYX_ERR(46, 2711, __pyx_L1_error);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2693
 *         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":2713
 *         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_217getRowIJ(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_216getRowIJ, "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:2713");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_217getRowIJ = {"getRowIJ", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_217getRowIJ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_216getRowIJ};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_217getRowIJ(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_symmetric,&__pyx_mstate_global->__pyx_n_u_compressed,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2713, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2713, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2713, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getRowIJ", 0) < (0)) __PYX_ERR(46, 2713, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2713, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2713, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __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, 2713, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_216getRowIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_symmetric, __pyx_v_compressed);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_216getRowIJ(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2730
 * 
 *         """
 *         cdef PetscInt shift=0             # <<<<<<<<<<<<<<
 *         cdef PetscBool symm=symmetric
 *         cdef PetscBool bcmp=compressed
*/
  __pyx_v_shift = 0;

  /* "petsc4py/PETSc/Mat.pyx":2731
 *         """
 *         cdef PetscInt shift=0
 *         cdef PetscBool symm=symmetric             # <<<<<<<<<<<<<<
 *         cdef PetscBool bcmp=compressed
 *         cdef PetscInt n=0
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_symmetric); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(46, 2731, __pyx_L1_error)
  __pyx_v_symm = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":2732
 *         cdef PetscInt shift=0
 *         cdef PetscBool symm=symmetric
 *         cdef PetscBool bcmp=compressed             # <<<<<<<<<<<<<<
 *         cdef PetscInt n=0
 *         cdef const PetscInt *ia=NULL
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_compressed); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(46, 2732, __pyx_L1_error)
  __pyx_v_bcmp = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":2733
 *         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":2734
 *         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":2735
 *         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":2736
 *         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":2737
 *         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, 2737, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2738
 *         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":2739
 *         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, 2739, __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":2740
 *         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, 2740, __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":2741
 *         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, 2741, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2742
 *         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, 2742, __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) != (0)) __PYX_ERR(46, 2742, __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) != (0)) __PYX_ERR(46, 2742, __pyx_L1_error);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2713
 *         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":2744
 *         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_219getColumnIJ(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_218getColumnIJ, "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:2744");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_219getColumnIJ = {"getColumnIJ", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_219getColumnIJ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_218getColumnIJ};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_219getColumnIJ(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_symmetric,&__pyx_mstate_global->__pyx_n_u_compressed,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2744, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getColumnIJ", 0) < (0)) __PYX_ERR(46, 2744, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __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, 2744, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_218getColumnIJ(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_symmetric, __pyx_v_compressed);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_218getColumnIJ(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2761
 * 
 *         """
 *         cdef PetscInt shift=0             # <<<<<<<<<<<<<<
 *         cdef PetscBool symm=symmetric, bcmp=compressed
 *         cdef PetscInt n=0
*/
  __pyx_v_shift = 0;

  /* "petsc4py/PETSc/Mat.pyx":2762
 *         """
 *         cdef PetscInt shift=0
 *         cdef PetscBool symm=symmetric, bcmp=compressed             # <<<<<<<<<<<<<<
 *         cdef PetscInt n=0
 *         cdef const PetscInt *ia=NULL
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_symmetric); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(46, 2762, __pyx_L1_error)
  __pyx_v_symm = __pyx_t_1;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_compressed); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(46, 2762, __pyx_L1_error)
  __pyx_v_bcmp = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":2763
 *         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":2764
 *         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":2765
 *         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":2766
 *         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":2767
 *         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, 2767, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2768
 *         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":2769
 *         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, 2769, __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":2770
 *         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, 2770, __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":2771
 *         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, 2771, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2772
 *         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, 2772, __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) != (0)) __PYX_ERR(46, 2772, __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) != (0)) __PYX_ERR(46, 2772, __pyx_L1_error);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":2744
 *         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":2774
 *         return (ai, aj)
 * 
 *     def setValue(             # <<<<<<<<<<<<<<
 *         self,
 *         row: int,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_221setValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_220setValue, "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:2774");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_221setValue = {"setValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_221setValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_220setValue};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_221setValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_row,&__pyx_mstate_global->__pyx_n_u_col,&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2774, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2774, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2774, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2774, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2774, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValue", 0) < (0)) __PYX_ERR(46, 2774, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":2779
 *         col: int,
 *         value: Scalar,
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set a value to the ``(row, col)`` entry of the matrix.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValue", 0, 3, 4, i); __PYX_ERR(46, 2774, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2774, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2774, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2774, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2774, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2774, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_220setValue(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv);

  /* "petsc4py/PETSc/Mat.pyx":2774
 *         return (ai, aj)
 * 
 *     def setValue(             # <<<<<<<<<<<<<<
 *         self,
 *         row: int,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_220setValue(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2800
 * 
 *         """
 *         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, 2800, __pyx_L1_error)
  __pyx_v_ival1 = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":2801
 *         """
 *         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, 2801, __pyx_L1_error)
  __pyx_v_ival2 = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":2802
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_2, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(46, 2802, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_2;

  /* "petsc4py/PETSc/Mat.pyx":2803
 *         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, 2803, __pyx_L1_error)
  __pyx_v_caddv = __pyx_t_3;

  /* "petsc4py/PETSc/Mat.pyx":2804
 *         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, 2804, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2774
 *         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":2806
 *         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_223setValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_222setValues, "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:2806");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_223setValues = {"setValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_223setValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_222setValues};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_223setValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_cols,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2806, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValues", 0) < (0)) __PYX_ERR(46, 2806, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":2811
 *         cols: Sequence[int],
 *         values: Sequence[Scalar],
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set values to the rows  cols entries of the matrix.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValues", 0, 3, 4, i); __PYX_ERR(46, 2806, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2806, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2806, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2806, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2806, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_222setValues(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv);

  /* "petsc4py/PETSc/Mat.pyx":2806
 *         CHKERR(MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv))
 * 
 *     def setValues(             # <<<<<<<<<<<<<<
 *         self,
 *         rows: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_222setValues(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2832
 * 
 *         """
 *         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, 2832, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2806
 *         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":2834
 *         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_225setValuesRCV(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_224setValuesRCV, "Mat.setValuesRCV(self, R, C, V, addv=None) -> None\nUndocumented.\nSource code at petsc4py/PETSc/Mat.pyx:2834");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_225setValuesRCV = {"setValuesRCV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_225setValuesRCV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_224setValuesRCV};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_225setValuesRCV(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_C,&__pyx_mstate_global->__pyx_n_u_V,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2834, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2834, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2834, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2834, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2834, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesRCV", 0) < (0)) __PYX_ERR(46, 2834, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesRCV", 0, 3, 4, i); __PYX_ERR(46, 2834, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2834, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2834, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2834, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2834, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2834, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_224setValuesRCV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_224setValuesRCV(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2836
 *     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, 2836, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2834
 *         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":2838
 *         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_227setValuesIJV(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_226setValuesIJV, "Mat.setValuesIJV(self, I: Sequence[int], J: Sequence[int], V: Sequence[Scalar], addv: InsertModeSpec = None, rowmap: Sequence[int] | None = 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:2838");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_227setValuesIJV = {"setValuesIJV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_227setValuesIJV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_226setValuesIJV};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_227setValuesIJV(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_I,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_V,&__pyx_mstate_global->__pyx_n_u_addv,&__pyx_mstate_global->__pyx_n_u_rowmap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2838, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 2838, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2838, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2838, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2838, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2838, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesIJV", 0) < (0)) __PYX_ERR(46, 2838, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":2843
 *         J: Sequence[int],
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         rowmap: Sequence[int] | None = None) -> None:
 *         """Set a subset of values stored in CSR format.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":2844
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None,
 *         rowmap: Sequence[int] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set a subset of values stored in CSR format.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesIJV", 0, 3, 5, i); __PYX_ERR(46, 2838, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 2838, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2838, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2838, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2838, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2838, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":2843
 *         J: Sequence[int],
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         rowmap: Sequence[int] | None = None) -> None:
 *         """Set a subset of values stored in CSR format.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":2844
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None,
 *         rowmap: Sequence[int] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set a subset of values stored in CSR format.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2838, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_226setValuesIJV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap);

  /* "petsc4py/PETSc/Mat.pyx":2838
 *         matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0)
 * 
 *     def setValuesIJV(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_226setValuesIJV(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2867
 * 
 *         """
 *         matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0)             # <<<<<<<<<<<<<<
 * 
 *     def setValuesCOO(
*/
  __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, 2867, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2838
 *         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":2869
 *         matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0)
 * 
 *     def setValuesCOO(             # <<<<<<<<<<<<<<
 *         self,
 *         coo_v: Sequence[Scalar],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_229setValuesCOO(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_228setValuesCOO, "Mat.setValuesCOO(self, coo_v: Sequence[Scalar], addv: InsertModeSpec = None) -> None\nSet values after preallocation with coordinate format.\n\n        Collective.\n\n        Parameters\n        ----------\n        coo_v\n            The matrix values.\n        addv\n            Insertion mode.\n\n        See Also\n        --------\n        setPreallocationCOO, petsc.MatSetValuesCOO\n        \nSource code at petsc4py/PETSc/Mat.pyx:2869");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_229setValuesCOO = {"setValuesCOO", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_229setValuesCOO, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_228setValuesCOO};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_229setValuesCOO(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_coo_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[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setValuesCOO (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_coo_v,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2869, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2869, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2869, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesCOO", 0) < (0)) __PYX_ERR(46, 2869, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":2872
 *         self,
 *         coo_v: Sequence[Scalar],
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set values after preallocation with coordinate format.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesCOO", 0, 1, 2, i); __PYX_ERR(46, 2869, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2869, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2869, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_coo_v = values[0];
    __pyx_v_addv = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setValuesCOO", 0, 1, 2, __pyx_nargs); __PYX_ERR(46, 2869, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesCOO", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_228setValuesCOO(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_coo_v, __pyx_v_addv);

  /* "petsc4py/PETSc/Mat.pyx":2869
 *         matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0)
 * 
 *     def setValuesCOO(             # <<<<<<<<<<<<<<
 *         self,
 *         coo_v: Sequence[Scalar],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_228setValuesCOO(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_coo_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("setValuesCOO", 0);

  /* "petsc4py/PETSc/Mat.pyx":2888
 *         setPreallocationCOO, petsc.MatSetValuesCOO
 *         """
 *         matsetvalues_coo(self.mat, coo_v, addv)             # <<<<<<<<<<<<<<
 * 
 *     def setValuesCSR(
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_matsetvalues_coo(__pyx_v_self->mat, __pyx_v_coo_v, __pyx_v_addv); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 2888, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2869
 *         matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0)
 * 
 *     def setValuesCOO(             # <<<<<<<<<<<<<<
 *         self,
 *         coo_v: Sequence[Scalar],
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.setValuesCOO", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":2890
 *         matsetvalues_coo(self.mat, coo_v, addv)
 * 
 *     def setValuesCSR(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_231setValuesCSR(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_230setValuesCSR, "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:2890");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_231setValuesCSR = {"setValuesCSR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_231setValuesCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_230setValuesCSR};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_231setValuesCSR(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_I,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_V,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2890, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesCSR", 0) < (0)) __PYX_ERR(46, 2890, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":2895
 *         J: Sequence[int],
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set values stored in CSR format.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesCSR", 0, 3, 4, i); __PYX_ERR(46, 2890, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2890, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2890, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2890, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2890, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_230setValuesCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv);

  /* "petsc4py/PETSc/Mat.pyx":2890
 *         matsetvalues_coo(self.mat, coo_v, addv)
 * 
 *     def setValuesCSR(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_230setValuesCSR(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2916
 * 
 *         """
 *         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, 2916, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2890
 *         matsetvalues_coo(self.mat, coo_v, addv)
 * 
 *     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":2918
 *         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_233setValuesBlocked(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_232setValuesBlocked, "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:2918");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_233setValuesBlocked = {"setValuesBlocked", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_233setValuesBlocked, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_232setValuesBlocked};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_233setValuesBlocked(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_cols,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2918, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesBlocked", 0) < (0)) __PYX_ERR(46, 2918, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":2923
 *         cols: Sequence[int],
 *         values: Sequence[Scalar],
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set values to the rows  col block entries of the matrix.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesBlocked", 0, 3, 4, i); __PYX_ERR(46, 2918, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2918, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2918, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2918, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2918, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2918, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_232setValuesBlocked(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv);

  /* "petsc4py/PETSc/Mat.pyx":2918
 *         matsetvalues_csr(self.mat, I, J, V, addv, 0, 0)
 * 
 *     def setValuesBlocked(             # <<<<<<<<<<<<<<
 *         self,
 *         rows: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_232setValuesBlocked(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2946
 * 
 *         """
 *         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, 2946, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2918
 *         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":2948
 *         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_235setValuesBlockedRCV(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_234setValuesBlockedRCV, "Mat.setValuesBlockedRCV(self, R, C, V, addv=None) -> None\nUndocumented.\nSource code at petsc4py/PETSc/Mat.pyx:2948");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_235setValuesBlockedRCV = {"setValuesBlockedRCV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_235setValuesBlockedRCV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_234setValuesBlockedRCV};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_235setValuesBlockedRCV(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_C,&__pyx_mstate_global->__pyx_n_u_V,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2948, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2948, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2948, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2948, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2948, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesBlockedRCV", 0) < (0)) __PYX_ERR(46, 2948, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesBlockedRCV", 0, 3, 4, i); __PYX_ERR(46, 2948, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2948, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2948, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2948, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2948, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2948, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_234setValuesBlockedRCV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_234setValuesBlockedRCV(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2950
 *     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, 2950, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2948
 *         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":2952
 *         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_237setValuesBlockedIJV(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_236setValuesBlockedIJV, "Mat.setValuesBlockedIJV(self, I: Sequence[int], J: Sequence[int], V: Sequence[Scalar], addv: InsertModeSpec = None, rowmap: Sequence[int] | None = 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:2952");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_237setValuesBlockedIJV = {"setValuesBlockedIJV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_237setValuesBlockedIJV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_236setValuesBlockedIJV};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_237setValuesBlockedIJV(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_I,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_V,&__pyx_mstate_global->__pyx_n_u_addv,&__pyx_mstate_global->__pyx_n_u_rowmap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2952, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 2952, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2952, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2952, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2952, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2952, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesBlockedIJV", 0) < (0)) __PYX_ERR(46, 2952, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":2957
 *         J: Sequence[int],
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         rowmap: Sequence[int] | None = None) -> None:
 *         """Set a subset of values stored in block CSR format.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":2958
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None,
 *         rowmap: Sequence[int] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set a subset of values stored in block CSR format.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesBlockedIJV", 0, 3, 5, i); __PYX_ERR(46, 2952, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 2952, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2952, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2952, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2952, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2952, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":2957
 *         J: Sequence[int],
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         rowmap: Sequence[int] | None = None) -> None:
 *         """Set a subset of values stored in block CSR format.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":2958
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None,
 *         rowmap: Sequence[int] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set a subset of values stored in block CSR format.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2952, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_236setValuesBlockedIJV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap);

  /* "petsc4py/PETSc/Mat.pyx":2952
 *         matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0)
 * 
 *     def setValuesBlockedIJV(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_236setValuesBlockedIJV(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":2981
 * 
 *         """
 *         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, 2981, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2952
 *         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":2983
 *         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_239setValuesBlockedCSR(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_238setValuesBlockedCSR, "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:2983");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_239setValuesBlockedCSR = {"setValuesBlockedCSR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_239setValuesBlockedCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_238setValuesBlockedCSR};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_239setValuesBlockedCSR(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_I,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_V,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 2983, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2983, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2983, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2983, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2983, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesBlockedCSR", 0) < (0)) __PYX_ERR(46, 2983, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":2988
 *         J: Sequence[int],
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set values stored in block CSR format.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesBlockedCSR", 0, 3, 4, i); __PYX_ERR(46, 2983, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 2983, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 2983, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 2983, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 2983, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2983, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_238setValuesBlockedCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv);

  /* "petsc4py/PETSc/Mat.pyx":2983
 *         matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0)
 * 
 *     def setValuesBlockedCSR(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_238setValuesBlockedCSR(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3009
 * 
 *         """
 *         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, 3009, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":2983
 *         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":3011
 *         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_241setLGMap(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_240setLGMap, "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:3011");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_241setLGMap = {"setLGMap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_241setLGMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_240setLGMap};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_241setLGMap(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rmap,&__pyx_mstate_global->__pyx_n_u_cmap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3011, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLGMap", 0) < (0)) __PYX_ERR(46, 3011, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscLGMapObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLGMap", 0, 1, 2, i); __PYX_ERR(46, 3011, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3011, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3011, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscLGMapObject *)Py_None));
    }
    __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, 3011, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, 0, "rmap", 0))) __PYX_ERR(46, 3011, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cmap), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, 1, "cmap", 0))) __PYX_ERR(46, 3011, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_240setLGMap(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rmap, __pyx_v_cmap);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_240setLGMap(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":3028
 * 
 *         """
 *         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":3029
 *         """
 *         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, 3029, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3011
 *         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":3031
 *         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_243getLGMap(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_242getLGMap, "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:3031");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_243getLGMap = {"getLGMap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_243getLGMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_242getLGMap};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_243getLGMap(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLGMap", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_242getLGMap(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_242getLGMap(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLGMap", 0);

  /* "petsc4py/PETSc/Mat.pyx":3041
 * 
 *         """
 *         cdef LGMap cmap = LGMap()             # <<<<<<<<<<<<<<
 *         cdef LGMap rmap = LGMap()
 *         CHKERR(MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3041, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_cmap = ((struct PyPetscLGMapObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3042
 *         """
 *         cdef LGMap cmap = LGMap()
 *         cdef LGMap rmap = LGMap()             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm))
 *         CHKERR(PetscINCREF(cmap.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3042, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_rmap = ((struct PyPetscLGMapObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3043
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetLocalToGlobalMapping(__pyx_v_self->mat, (&__pyx_v_rmap->lgm), (&__pyx_v_cmap->lgm))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3043, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3044
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_cmap->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3044, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3045
 *         CHKERR(MatGetLocalToGlobalMapping(self.mat, &rmap.lgm, &cmap.lgm))
 *         CHKERR(PetscINCREF(cmap.obj))
 *         CHKERR(PetscINCREF(rmap.obj))             # <<<<<<<<<<<<<<
 *         return (rmap, cmap)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_rmap->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3045, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3046
 *         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, 3046, __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)) != (0)) __PYX_ERR(46, 3046, __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)) != (0)) __PYX_ERR(46, 3046, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":3031
 *         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_XDECREF(__pyx_t_2);
  __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":3048
 *         return (rmap, cmap)
 * 
 *     def setValueLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         row: int,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_245setValueLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_244setValueLocal, "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:3048");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_245setValueLocal = {"setValueLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_245setValueLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_244setValueLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_245setValueLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_row,&__pyx_mstate_global->__pyx_n_u_col,&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3048, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3048, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3048, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3048, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3048, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValueLocal", 0) < (0)) __PYX_ERR(46, 3048, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":3053
 *         col: int,
 *         value: Scalar,
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set a value to the ``(row, col)`` entry of the matrix in local ordering.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValueLocal", 0, 3, 4, i); __PYX_ERR(46, 3048, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3048, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3048, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3048, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3048, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3048, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_244setValueLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv);

  /* "petsc4py/PETSc/Mat.pyx":3048
 *         return (rmap, cmap)
 * 
 *     def setValueLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         row: int,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_244setValueLocal(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3074
 * 
 *         """
 *         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, 3074, __pyx_L1_error)
  __pyx_v_ival1 = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":3075
 *         """
 *         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, 3075, __pyx_L1_error)
  __pyx_v_ival2 = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":3076
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_2, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(46, 3076, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_2;

  /* "petsc4py/PETSc/Mat.pyx":3077
 *         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, 3077, __pyx_L1_error)
  __pyx_v_caddv = __pyx_t_3;

  /* "petsc4py/PETSc/Mat.pyx":3078
 *         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, 3078, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3048
 *         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":3081
 *                 self.mat, 1, &ival1, 1, &ival2, &sval, caddv))
 * 
 *     def setValuesLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         rows: Sequence[int],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_247setValuesLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_246setValuesLocal, "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:3081");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_247setValuesLocal = {"setValuesLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_247setValuesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_246setValuesLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_247setValuesLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_cols,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3081, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3081, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3081, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3081, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3081, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesLocal", 0) < (0)) __PYX_ERR(46, 3081, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":3086
 *         cols: Sequence[int],
 *         values: Sequence[Scalar],
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set values to the rows  col entries of the matrix in local ordering.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesLocal", 0, 3, 4, i); __PYX_ERR(46, 3081, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3081, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3081, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3081, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3081, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3081, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_246setValuesLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv);

  /* "petsc4py/PETSc/Mat.pyx":3081
 *                 self.mat, 1, &ival1, 1, &ival2, &sval, caddv))
 * 
 *     def setValuesLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         rows: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_246setValuesLocal(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3107
 * 
 *         """
 *         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, 3107, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3081
 *                 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":3109
 *         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_249setValuesLocalRCV(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_248setValuesLocalRCV, "Mat.setValuesLocalRCV(self, R, C, V, addv=None) -> None\nUndocumented.\nSource code at petsc4py/PETSc/Mat.pyx:3109");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_249setValuesLocalRCV = {"setValuesLocalRCV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_249setValuesLocalRCV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_248setValuesLocalRCV};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_249setValuesLocalRCV(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_C,&__pyx_mstate_global->__pyx_n_u_V,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3109, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3109, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3109, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3109, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3109, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesLocalRCV", 0) < (0)) __PYX_ERR(46, 3109, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesLocalRCV", 0, 3, 4, i); __PYX_ERR(46, 3109, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3109, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3109, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3109, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3109, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3109, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_248setValuesLocalRCV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_248setValuesLocalRCV(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3111
 *     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, 3111, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3109
 *         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":3113
 *         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_251setValuesLocalIJV(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_250setValuesLocalIJV, "Mat.setValuesLocalIJV(self, I: Sequence[int], J: Sequence[int], V: Sequence[Scalar], addv: InsertModeSpec = None, rowmap: Sequence[int] | None = 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:3113");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_251setValuesLocalIJV = {"setValuesLocalIJV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_251setValuesLocalIJV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_250setValuesLocalIJV};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_251setValuesLocalIJV(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_I,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_V,&__pyx_mstate_global->__pyx_n_u_addv,&__pyx_mstate_global->__pyx_n_u_rowmap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3113, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesLocalIJV", 0) < (0)) __PYX_ERR(46, 3113, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":3118
 *         J: Sequence[int],
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         rowmap: Sequence[int] | None = None) -> None:
 *         """Set a subset of values stored in CSR format.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":3119
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None,
 *         rowmap: Sequence[int] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set a subset of values stored in CSR format.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesLocalIJV", 0, 3, 5, i); __PYX_ERR(46, 3113, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3113, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3113, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3113, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":3118
 *         J: Sequence[int],
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         rowmap: Sequence[int] | None = None) -> None:
 *         """Set a subset of values stored in CSR format.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":3119
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None,
 *         rowmap: Sequence[int] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set a subset of values stored in CSR format.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3113, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_250setValuesLocalIJV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap);

  /* "petsc4py/PETSc/Mat.pyx":3113
 *         matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1)
 * 
 *     def setValuesLocalIJV(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_250setValuesLocalIJV(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3142
 * 
 *         """
 *         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, 3142, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3113
 *         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":3144
 *         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_253setValuesLocalCSR(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_252setValuesLocalCSR, "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:3144");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_253setValuesLocalCSR = {"setValuesLocalCSR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_253setValuesLocalCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_252setValuesLocalCSR};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_253setValuesLocalCSR(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_I,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_V,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3144, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3144, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3144, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3144, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3144, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesLocalCSR", 0) < (0)) __PYX_ERR(46, 3144, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":3149
 *         J: Sequence[int],
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set values stored in CSR format.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesLocalCSR", 0, 3, 4, i); __PYX_ERR(46, 3144, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3144, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3144, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3144, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3144, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3144, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_252setValuesLocalCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv);

  /* "petsc4py/PETSc/Mat.pyx":3144
 *         matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1)
 * 
 *     def setValuesLocalCSR(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_252setValuesLocalCSR(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3170
 * 
 *         """
 *         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, 3170, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3144
 *         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":3172
 *         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_255setValuesBlockedLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_254setValuesBlockedLocal, "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:3172");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_255setValuesBlockedLocal = {"setValuesBlockedLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_255setValuesBlockedLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_254setValuesBlockedLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_255setValuesBlockedLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_cols,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3172, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesBlockedLocal", 0) < (0)) __PYX_ERR(46, 3172, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":3177
 *         cols: Sequence[int],
 *         values: Sequence[Scalar],
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set values to the rows  col block entries of the matrix in local ordering.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocal", 0, 3, 4, i); __PYX_ERR(46, 3172, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3172, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3172, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3172, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3172, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_254setValuesBlockedLocal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rows, __pyx_v_cols, __pyx_v_values, __pyx_v_addv);

  /* "petsc4py/PETSc/Mat.pyx":3172
 *         matsetvalues_csr(self.mat, I, J, V, addv, 0, 1)
 * 
 *     def setValuesBlockedLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         rows: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_254setValuesBlockedLocal(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3200
 * 
 *         """
 *         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, 3200, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3172
 *         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":3202
 *         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_257setValuesBlockedLocalRCV(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_256setValuesBlockedLocalRCV, "Mat.setValuesBlockedLocalRCV(self, R, C, V, addv=None) -> None\nUndocumented.\nSource code at petsc4py/PETSc/Mat.pyx:3202");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_257setValuesBlockedLocalRCV = {"setValuesBlockedLocalRCV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_257setValuesBlockedLocalRCV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_256setValuesBlockedLocalRCV};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_257setValuesBlockedLocalRCV(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_C,&__pyx_mstate_global->__pyx_n_u_V,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3202, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3202, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3202, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3202, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3202, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesBlockedLocalRCV", 0) < (0)) __PYX_ERR(46, 3202, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalRCV", 0, 3, 4, i); __PYX_ERR(46, 3202, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3202, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3202, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3202, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3202, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3202, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_256setValuesBlockedLocalRCV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_C, __pyx_v_V, __pyx_v_addv);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_256setValuesBlockedLocalRCV(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3204
 *     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, 3204, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3202
 *         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":3206
 *         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_259setValuesBlockedLocalIJV(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_258setValuesBlockedLocalIJV, "Mat.setValuesBlockedLocalIJV(self, I: Sequence[int], J: Sequence[int], V: Sequence[Scalar], addv: InsertModeSpec = None, rowmap: Sequence[int] | None = 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:3206");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_259setValuesBlockedLocalIJV = {"setValuesBlockedLocalIJV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_259setValuesBlockedLocalIJV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_258setValuesBlockedLocalIJV};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_259setValuesBlockedLocalIJV(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_I,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_V,&__pyx_mstate_global->__pyx_n_u_addv,&__pyx_mstate_global->__pyx_n_u_rowmap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3206, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 3206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesBlockedLocalIJV", 0) < (0)) __PYX_ERR(46, 3206, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":3211
 *         J: Sequence[int],
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         rowmap: Sequence[int] | None = None) -> None:
 *         """Set a subset of values stored in block CSR format.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":3212
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None,
 *         rowmap: Sequence[int] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set a subset of values stored in block CSR format.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalIJV", 0, 3, 5, i); __PYX_ERR(46, 3206, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 3206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3206, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3206, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3206, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":3211
 *         J: Sequence[int],
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None,             # <<<<<<<<<<<<<<
 *         rowmap: Sequence[int] | None = None) -> None:
 *         """Set a subset of values stored in block CSR format.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":3212
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None,
 *         rowmap: Sequence[int] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set a subset of values stored in block CSR format.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3206, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_258setValuesBlockedLocalIJV(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv, __pyx_v_rowmap);

  /* "petsc4py/PETSc/Mat.pyx":3206
 *         matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1)
 * 
 *     def setValuesBlockedLocalIJV(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_258setValuesBlockedLocalIJV(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3235
 * 
 *         """
 *         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, 3235, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3206
 *         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":3237
 *         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_261setValuesBlockedLocalCSR(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_260setValuesBlockedLocalCSR, "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:3237");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_261setValuesBlockedLocalCSR = {"setValuesBlockedLocalCSR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_261setValuesBlockedLocalCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_260setValuesBlockedLocalCSR};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_261setValuesBlockedLocalCSR(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_I,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_V,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3237, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3237, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3237, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3237, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3237, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValuesBlockedLocalCSR", 0) < (0)) __PYX_ERR(46, 3237, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":3242
 *         J: Sequence[int],
 *         V: Sequence[Scalar],
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set values stored in block CSR format.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValuesBlockedLocalCSR", 0, 3, 4, i); __PYX_ERR(46, 3237, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3237, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3237, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3237, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3237, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3237, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_260setValuesBlockedLocalCSR(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_I, __pyx_v_J, __pyx_v_V, __pyx_v_addv);

  /* "petsc4py/PETSc/Mat.pyx":3237
 *         matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1)
 * 
 *     def setValuesBlockedLocalCSR(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_260setValuesBlockedLocalCSR(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3263
 * 
 *         """
 *         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, 3263, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3237
 *         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":3269
 *     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_263setStencil(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_262setStencil, "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:3269");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_263setStencil = {"setStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_263setStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_262setStencil};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_263setStencil(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dims,&__pyx_mstate_global->__pyx_n_u_starts,&__pyx_mstate_global->__pyx_n_u_dof,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3269, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3269, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3269, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3269, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setStencil", 0) < (0)) __PYX_ERR(46, 3269, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setStencil", 0, 1, 3, i); __PYX_ERR(46, 3269, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3269, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3269, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3269, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
    }
    __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, 3269, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_262setStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_dims, __pyx_v_starts, __pyx_v_dof);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_262setStencil(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3281
 *         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":3282
 *         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":3283
 *         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, 3283, __pyx_L1_error)
  __pyx_v_ndim = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":3284
 *         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, 3284, __pyx_L1_error)
  __pyx_v_ndof = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":3285
 *         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":3286
 *         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, 3286, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":3285
 *         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":3287
 *         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, 3287, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3269
 *     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":3289
 *         CHKERR(MatSetStencil(self.mat, ndim, cdims, cstarts, ndof))
 * 
 *     def setValueStencil(             # <<<<<<<<<<<<<<
 *         self,
 *         MatStencil row: Stencil,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_265setValueStencil(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_264setValueStencil, "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:3289");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_265setValueStencil = {"setValueStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_265setValueStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_264setValueStencil};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_265setValueStencil(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_row,&__pyx_mstate_global->__pyx_n_u_col,&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3289, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValueStencil", 0) < (0)) __PYX_ERR(46, 3289, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":3294
 *         MatStencil col: Stencil,
 *         value: Sequence[Scalar],
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set a value to row and col stencil.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValueStencil", 0, 3, 4, i); __PYX_ERR(46, 3289, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3289, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3289, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3289, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3289, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatStencil, 0, "row", 0))) __PYX_ERR(46, 3291, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_col), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatStencil, 0, "col", 0))) __PYX_ERR(46, 3292, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_264setValueStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv);

  /* "petsc4py/PETSc/Mat.pyx":3289
 *         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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_264setValueStencil(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3315
 * 
 *         """
 *         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":3316
 *         """
 *         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, 3316, __pyx_L1_error)
  __pyx_v_im = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":3317
 *         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, 3317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3289
 *         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":3319
 *         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_267setValueStagStencil(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_266setValueStagStencil, "Mat.setValueStagStencil(self, row, col, value, addv=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Mat.pyx:3319");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_267setValueStagStencil = {"setValueStagStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_267setValueStagStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_266setValueStagStencil};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_267setValueStagStencil(PyObject *__pyx_v_self, 
#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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_row,&__pyx_mstate_global->__pyx_n_u_col,&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3319, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValueStagStencil", 0) < (0)) __PYX_ERR(46, 3319, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValueStagStencil", 0, 3, 4, i); __PYX_ERR(46, 3319, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3319, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3319, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3319, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3319, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_266setValueStagStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_266setValueStagStencil(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3321
 *     def setValueStagStencil(self, row, col, value, addv=None) -> None:
 *         """Not implemented."""
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def setValueBlockedStencil(
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(46, 3321, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3319
 *         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":3323
 *         raise NotImplementedError
 * 
 *     def setValueBlockedStencil(             # <<<<<<<<<<<<<<
 *         self,
 *         row: Stencil,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_269setValueBlockedStencil(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_268setValueBlockedStencil, "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:3323");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_269setValueBlockedStencil = {"setValueBlockedStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_269setValueBlockedStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_268setValueBlockedStencil};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_269setValueBlockedStencil(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_row,&__pyx_mstate_global->__pyx_n_u_col,&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3323, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3323, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3323, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3323, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3323, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValueBlockedStencil", 0) < (0)) __PYX_ERR(46, 3323, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":3328
 *         col: Stencil,
 *         value: Sequence[Scalar],
 *         addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set a block of values to row and col stencil.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValueBlockedStencil", 0, 3, 4, i); __PYX_ERR(46, 3323, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3323, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3323, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3323, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3323, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3323, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_268setValueBlockedStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv);

  /* "petsc4py/PETSc/Mat.pyx":3323
 *         raise NotImplementedError
 * 
 *     def setValueBlockedStencil(             # <<<<<<<<<<<<<<
 *         self,
 *         row: Stencil,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_268setValueBlockedStencil(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3349
 * 
 *         """
 *         cdef MatStencil r = row, c = col             # <<<<<<<<<<<<<<
 *         cdef PetscInsertMode im = insertmode(addv)
 *         matsetvaluestencil(self.mat, r, c, value, im, 1)
*/
  __pyx_t_1 = __pyx_v_row;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatStencil))))) __PYX_ERR(46, 3349, __pyx_L1_error)
  __pyx_v_r = ((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_v_col;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatStencil))))) __PYX_ERR(46, 3349, __pyx_L1_error)
  __pyx_v_c = ((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3350
 *         """
 *         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, 3350, __pyx_L1_error)
  __pyx_v_im = __pyx_t_2;

  /* "petsc4py/PETSc/Mat.pyx":3351
 *         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, 3351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3323
 *         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":3353
 *         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_271setValueBlockedStagStencil(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_270setValueBlockedStagStencil, "Mat.setValueBlockedStagStencil(self, row, col, value, addv=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Mat.pyx:3353");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_271setValueBlockedStagStencil = {"setValueBlockedStagStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_271setValueBlockedStagStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_270setValueBlockedStagStencil};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_271setValueBlockedStagStencil(PyObject *__pyx_v_self, 
#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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_row,&__pyx_mstate_global->__pyx_n_u_col,&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3353, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3353, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3353, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3353, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3353, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValueBlockedStagStencil", 0) < (0)) __PYX_ERR(46, 3353, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValueBlockedStagStencil", 0, 3, 4, i); __PYX_ERR(46, 3353, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3353, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3353, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3353, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3353, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3353, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_270setValueBlockedStagStencil(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_row, __pyx_v_col, __pyx_v_value, __pyx_v_addv);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_270setValueBlockedStagStencil(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3355
 *     def setValueBlockedStagStencil(self, row, col, value, addv=None) -> None:
 *         """Not implemented."""
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def zeroRows(self, rows: IS | Sequence[int], diag: Scalar = 1.0, Vec x=None, Vec b=None) -> None:
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(46, 3355, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3353
 *         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":3357
 *         raise NotImplementedError
 * 
 *     def zeroRows(self, rows: IS | Sequence[int], diag: Scalar = 1.0, Vec x=None, Vec b=None) -> None:             # <<<<<<<<<<<<<<
 *         """Zero selected rows of the matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_273zeroRows(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_272zeroRows, "Mat.zeroRows(self, rows: IS | Sequence[int], diag: Scalar = 1.0, 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:3357");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_273zeroRows = {"zeroRows", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_273zeroRows, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_272zeroRows};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_273zeroRows(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_diag,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_b,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3357, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3357, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3357, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3357, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3357, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zeroRows", 0) < (0)) __PYX_ERR(46, 3357, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zeroRows", 0, 1, 4, i); __PYX_ERR(46, 3357, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3357, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3357, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3357, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3357, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 3357, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(46, 3357, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(46, 3357, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_272zeroRows(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_272zeroRows(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":3379
 * 
 *         """
 *         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":3380
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(46, 3380, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":3381
 *         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":3382
 *         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":3383
 *         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, (<IS>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":3384
 *         if x is not None: xvec = x.vec
 *         if b is not None: bvec = b.vec
 *         if isinstance(rows, IS):             # <<<<<<<<<<<<<<
 *             CHKERR(MatZeroRowsIS(self.mat, (<IS>rows).iset, sval, xvec, bvec))
 *         else:
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_rows, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS); 
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/Mat.pyx":3385
 *         if b is not None: bvec = b.vec
 *         if isinstance(rows, IS):
 *             CHKERR(MatZeroRowsIS(self.mat, (<IS>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, 3385, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":3384
 *         if x is not None: xvec = x.vec
 *         if b is not None: bvec = b.vec
 *         if isinstance(rows, IS):             # <<<<<<<<<<<<<<
 *             CHKERR(MatZeroRowsIS(self.mat, (<IS>rows).iset, sval, xvec, bvec))
 *         else:
*/
    goto __pyx_L5;
  }

  /* "petsc4py/PETSc/Mat.pyx":3387
 *             CHKERR(MatZeroRowsIS(self.mat, (<IS>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, 3387, __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":3388
 *         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.0, 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, 3388, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "petsc4py/PETSc/Mat.pyx":3357
 *         raise NotImplementedError
 * 
 *     def zeroRows(self, rows: IS | Sequence[int], diag: Scalar = 1.0, 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":3390
 *             CHKERR(MatZeroRows(self.mat, ni, i, sval, xvec, bvec))
 * 
 *     def zeroRowsLocal(self, rows: IS | Sequence[int], diag: Scalar = 1.0, 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_275zeroRowsLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_274zeroRowsLocal, "Mat.zeroRowsLocal(self, rows: IS | Sequence[int], diag: Scalar = 1.0, 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:3390");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_275zeroRowsLocal = {"zeroRowsLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_275zeroRowsLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_274zeroRowsLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_275zeroRowsLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_diag,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_b,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3390, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3390, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3390, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3390, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3390, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zeroRowsLocal", 0) < (0)) __PYX_ERR(46, 3390, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zeroRowsLocal", 0, 1, 4, i); __PYX_ERR(46, 3390, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3390, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3390, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3390, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3390, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 3390, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(46, 3390, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(46, 3390, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_274zeroRowsLocal(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_274zeroRowsLocal(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":3412
 * 
 *         """
 *         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":3413
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(46, 3413, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":3414
 *         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":3415
 *         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":3416
 *         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, (<IS>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":3417
 *         if x is not None: xvec = x.vec
 *         if b is not None: bvec = b.vec
 *         if isinstance(rows, IS):             # <<<<<<<<<<<<<<
 *             CHKERR(MatZeroRowsLocalIS(self.mat, (<IS>rows).iset, sval, xvec, bvec))
 *         else:
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_rows, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS); 
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/Mat.pyx":3418
 *         if b is not None: bvec = b.vec
 *         if isinstance(rows, IS):
 *             CHKERR(MatZeroRowsLocalIS(self.mat, (<IS>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, 3418, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":3417
 *         if x is not None: xvec = x.vec
 *         if b is not None: bvec = b.vec
 *         if isinstance(rows, IS):             # <<<<<<<<<<<<<<
 *             CHKERR(MatZeroRowsLocalIS(self.mat, (<IS>rows).iset, sval, xvec, bvec))
 *         else:
*/
    goto __pyx_L5;
  }

  /* "petsc4py/PETSc/Mat.pyx":3420
 *             CHKERR(MatZeroRowsLocalIS(self.mat, (<IS>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, 3420, __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":3421
 *         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.0, 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, 3421, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "petsc4py/PETSc/Mat.pyx":3390
 *             CHKERR(MatZeroRows(self.mat, ni, i, sval, xvec, bvec))
 * 
 *     def zeroRowsLocal(self, rows: IS | Sequence[int], diag: Scalar = 1.0, 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":3423
 *             CHKERR(MatZeroRowsLocal(self.mat, ni, i, sval, xvec, bvec))
 * 
 *     def zeroRowsColumns(self, rows: IS | Sequence[int], diag: Scalar = 1.0, Vec x=None, Vec b=None) -> None:             # <<<<<<<<<<<<<<
 *         """Zero selected rows and columns of the matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_277zeroRowsColumns(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_276zeroRowsColumns, "Mat.zeroRowsColumns(self, rows: IS | Sequence[int], diag: Scalar = 1.0, 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:3423");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_277zeroRowsColumns = {"zeroRowsColumns", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_277zeroRowsColumns, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_276zeroRowsColumns};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_277zeroRowsColumns(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_diag,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_b,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3423, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3423, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3423, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3423, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3423, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zeroRowsColumns", 0) < (0)) __PYX_ERR(46, 3423, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zeroRowsColumns", 0, 1, 4, i); __PYX_ERR(46, 3423, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3423, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3423, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3423, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3423, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 3423, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(46, 3423, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(46, 3423, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_276zeroRowsColumns(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_276zeroRowsColumns(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":3446
 * 
 *         """
 *         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":3447
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(46, 3447, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":3448
 *         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":3449
 *         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":3450
 *         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, (<IS>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":3451
 *         if x is not None: xvec = x.vec
 *         if b is not None: bvec = b.vec
 *         if isinstance(rows, IS):             # <<<<<<<<<<<<<<
 *             CHKERR(MatZeroRowsColumnsIS(self.mat, (<IS>rows).iset, sval, xvec, bvec))
 *         else:
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_rows, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS); 
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/Mat.pyx":3452
 *         if b is not None: bvec = b.vec
 *         if isinstance(rows, IS):
 *             CHKERR(MatZeroRowsColumnsIS(self.mat, (<IS>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, 3452, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":3451
 *         if x is not None: xvec = x.vec
 *         if b is not None: bvec = b.vec
 *         if isinstance(rows, IS):             # <<<<<<<<<<<<<<
 *             CHKERR(MatZeroRowsColumnsIS(self.mat, (<IS>rows).iset, sval, xvec, bvec))
 *         else:
*/
    goto __pyx_L5;
  }

  /* "petsc4py/PETSc/Mat.pyx":3454
 *             CHKERR(MatZeroRowsColumnsIS(self.mat, (<IS>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, 3454, __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":3455
 *         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.0, 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, 3455, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "petsc4py/PETSc/Mat.pyx":3423
 *             CHKERR(MatZeroRowsLocal(self.mat, ni, i, sval, xvec, bvec))
 * 
 *     def zeroRowsColumns(self, rows: IS | Sequence[int], diag: Scalar = 1.0, 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":3457
 *             CHKERR(MatZeroRowsColumns(self.mat, ni, i, sval, xvec, bvec))
 * 
 *     def zeroRowsColumnsLocal(self, rows: IS | Sequence[int], diag: Scalar = 1.0, 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_279zeroRowsColumnsLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_278zeroRowsColumnsLocal, "Mat.zeroRowsColumnsLocal(self, rows: IS | Sequence[int], diag: Scalar = 1.0, 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:3457");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_279zeroRowsColumnsLocal = {"zeroRowsColumnsLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_279zeroRowsColumnsLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_278zeroRowsColumnsLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_279zeroRowsColumnsLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_diag,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_b,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3457, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zeroRowsColumnsLocal", 0) < (0)) __PYX_ERR(46, 3457, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zeroRowsColumnsLocal", 0, 1, 4, i); __PYX_ERR(46, 3457, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3457, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3457, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 3457, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(46, 3457, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(46, 3457, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_278zeroRowsColumnsLocal(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_278zeroRowsColumnsLocal(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":3480
 * 
 *         """
 *         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":3481
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(46, 3481, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":3482
 *         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":3483
 *         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":3484
 *         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, (<IS>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":3485
 *         if x is not None: xvec = x.vec
 *         if b is not None: bvec = b.vec
 *         if isinstance(rows, IS):             # <<<<<<<<<<<<<<
 *             CHKERR(MatZeroRowsColumnsLocalIS(self.mat, (<IS>rows).iset, sval, xvec, bvec))
 *         else:
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_rows, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS); 
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/Mat.pyx":3486
 *         if b is not None: bvec = b.vec
 *         if isinstance(rows, IS):
 *             CHKERR(MatZeroRowsColumnsLocalIS(self.mat, (<IS>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, 3486, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":3485
 *         if x is not None: xvec = x.vec
 *         if b is not None: bvec = b.vec
 *         if isinstance(rows, IS):             # <<<<<<<<<<<<<<
 *             CHKERR(MatZeroRowsColumnsLocalIS(self.mat, (<IS>rows).iset, sval, xvec, bvec))
 *         else:
*/
    goto __pyx_L5;
  }

  /* "petsc4py/PETSc/Mat.pyx":3488
 *             CHKERR(MatZeroRowsColumnsLocalIS(self.mat, (<IS>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, 3488, __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":3489
 *         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.0, 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, 3489, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "petsc4py/PETSc/Mat.pyx":3457
 *             CHKERR(MatZeroRowsColumns(self.mat, ni, i, sval, xvec, bvec))
 * 
 *     def zeroRowsColumnsLocal(self, rows: IS | Sequence[int], diag: Scalar = 1.0, 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":3491
 *             CHKERR(MatZeroRowsColumnsLocal(self.mat, ni, i, sval, xvec, bvec))
 * 
 *     def zeroRowsColumnsStencil(self, rows: Sequence[Stencil], diag: Scalar = 1.0, Vec x=None, Vec b=None) -> None:             # <<<<<<<<<<<<<<
 *         """Zero selected rows and columns of the matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_281zeroRowsColumnsStencil(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_280zeroRowsColumnsStencil, "Mat.zeroRowsColumnsStencil(self, rows: Sequence[Stencil], diag: Scalar = 1.0, 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:3491");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_281zeroRowsColumnsStencil = {"zeroRowsColumnsStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_281zeroRowsColumnsStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_280zeroRowsColumnsStencil};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_281zeroRowsColumnsStencil(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rows,&__pyx_mstate_global->__pyx_n_u_diag,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_b,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3491, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zeroRowsColumnsStencil", 0) < (0)) __PYX_ERR(46, 3491, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zeroRowsColumnsStencil", 0, 1, 4, i); __PYX_ERR(46, 3491, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 3491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3491, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 3491, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(46, 3491, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(46, 3491, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_280zeroRowsColumnsStencil(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_280zeroRowsColumnsStencil(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;
  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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3513
 * 
 *         """
 *         cdef PetscScalar sval = asScalar(diag)             # <<<<<<<<<<<<<<
 *         cdef PetscInt nrows = asInt(len(rows))
 *         cdef PetscMatStencil *crows = NULL
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_diag); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(46, 3513, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":3514
 *         """
 *         cdef PetscScalar sval = asScalar(diag)
 *         cdef PetscInt nrows = asInt(len(rows))             # <<<<<<<<<<<<<<
 *         cdef PetscMatStencil *crows = NULL
 *         CHKERR(PetscMalloc(<size_t>(nrows+1)*sizeof(PetscMatStencil), &crows))
*/
  __pyx_t_2 = PyObject_Length(__pyx_v_rows); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(46, 3514, __pyx_L1_error)
  __pyx_t_3 = PyLong_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 3514, __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, 3514, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_nrows = __pyx_t_4;

  /* "petsc4py/PETSc/Mat.pyx":3515
 *         cdef PetscScalar sval = asScalar(diag)
 *         cdef PetscInt nrows = asInt(len(rows))
 *         cdef PetscMatStencil *crows = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscMalloc(<size_t>(nrows+1)*sizeof(PetscMatStencil), &crows))
 *         for i in range(nrows):
*/
  __pyx_v_crows = NULL;

  /* "petsc4py/PETSc/Mat.pyx":3516
 *         cdef PetscInt nrows = asInt(len(rows))
 *         cdef PetscMatStencil *crows = NULL
 *         CHKERR(PetscMalloc(<size_t>(nrows+1)*sizeof(PetscMatStencil), &crows))             # <<<<<<<<<<<<<<
 *         for i in range(nrows):
 *             crows[i] = (<MatStencil?>rows[i]).stencil
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc((((size_t)(__pyx_v_nrows + 1)) * (sizeof(MatStencil))), (&__pyx_v_crows))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3516, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3517
 *         cdef PetscMatStencil *crows = NULL
 *         CHKERR(PetscMalloc(<size_t>(nrows+1)*sizeof(PetscMatStencil), &crows))
 *         for i in range(nrows):             # <<<<<<<<<<<<<<
 *             crows[i] = (<MatStencil?>rows[i]).stencil
 *         cdef PetscVec xvec = NULL, bvec = NULL
*/
  __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":3518
 *         CHKERR(PetscMalloc(<size_t>(nrows+1)*sizeof(PetscMatStencil), &crows))
 *         for i in range(nrows):
 *             crows[i] = (<MatStencil?>rows[i]).stencil             # <<<<<<<<<<<<<<
 *         cdef PetscVec xvec = NULL, bvec = NULL
 *         if x is not None: xvec = x.vec
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_rows, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 3518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatStencil)))) __PYX_ERR(46, 3518, __pyx_L1_error)
    __pyx_t_8 = ((struct __pyx_obj_8petsc4py_5PETSc_MatStencil *)__pyx_t_3)->stencil;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    (__pyx_v_crows[__pyx_v_i]) = __pyx_t_8;
  }

  /* "petsc4py/PETSc/Mat.pyx":3519
 *         for i in range(nrows):
 *             crows[i] = (<MatStencil?>rows[i]).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":3520
 *             crows[i] = (<MatStencil?>rows[i]).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":3521
 *         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":3522
 *         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, 3522, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3523
 *         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, 3523, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3491
 *             CHKERR(MatZeroRowsColumnsLocal(self.mat, ni, i, sval, xvec, bvec))
 * 
 *     def zeroRowsColumnsStencil(self, rows: Sequence[Stencil], diag: Scalar = 1.0, 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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":3525
 *         CHKERR(PetscFree(crows))
 * 
 *     def storeValues(self) -> None:             # <<<<<<<<<<<<<<
 *         """Stash a copy of the matrix values.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_283storeValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_282storeValues, "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:3525");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_283storeValues = {"storeValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_283storeValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_282storeValues};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_283storeValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("storeValues", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_282storeValues(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_282storeValues(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3535
 * 
 *         """
 *         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, 3535, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3525
 *         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":3537
 *         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_285retrieveValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_284retrieveValues, "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:3537");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_285retrieveValues = {"retrieveValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_285retrieveValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_284retrieveValues};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_285retrieveValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("retrieveValues", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_284retrieveValues(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_284retrieveValues(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3547
 * 
 *         """
 *         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, 3547, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3537
 *         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":3549
 *         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_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_3Mat_286assemblyBegin, "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:3549");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_287assemblyBegin = {"assemblyBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_287assemblyBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_286assemblyBegin};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_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
) {
  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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_assembly,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3549, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3549, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "assemblyBegin", 0) < (0)) __PYX_ERR(46, 3549, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3549, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_assembly = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("assemblyBegin", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 3549, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_286assemblyBegin(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_assembly);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_286assemblyBegin(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3564
 * 
 *         """
 *         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, 3564, __pyx_L1_error)
  __pyx_v_flag = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":3565
 *         """
 *         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, 3565, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3549
 *         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":3567
 *         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_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_3Mat_288assemblyEnd, "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:3567");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_289assemblyEnd = {"assemblyEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_289assemblyEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_288assemblyEnd};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_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
) {
  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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_assembly,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3567, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "assemblyEnd", 0) < (0)) __PYX_ERR(46, 3567, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_assembly = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("assemblyEnd", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 3567, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_288assemblyEnd(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_assembly);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_288assemblyEnd(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3582
 * 
 *         """
 *         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, 3582, __pyx_L1_error)
  __pyx_v_flag = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":3583
 *         """
 *         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, 3583, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3567
 *         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":3585
 *         CHKERR(MatAssemblyEnd(self.mat, flag))
 * 
 *     def assemble(self, assembly: MatAssemblySpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Assemble the matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_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_3Mat_290assemble, "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:3585");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_291assemble = {"assemble", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_291assemble, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_290assemble};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_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
) {
  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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_assembly,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3585, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3585, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "assemble", 0) < (0)) __PYX_ERR(46, 3585, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3585, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_assembly = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("assemble", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 3585, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_290assemble(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_assembly);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_290assemble(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3600
 * 
 *         """
 *         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, 3600, __pyx_L1_error)
  __pyx_v_flag = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":3601
 *         """
 *         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, 3601, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3602
 *         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, 3602, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3585
 *         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":3604
 *         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_293isAssembled(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_292isAssembled, "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:3604");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_293isAssembled = {"isAssembled", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_293isAssembled, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_292isAssembled};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_293isAssembled(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isAssembled", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_292isAssembled(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_292isAssembled(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3614
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(MatAssembled(self.mat, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/Mat.pyx":3615
 *         """
 *         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, 3615, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3616
 *         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, 3616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":3604
 *         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":3618
 *         return toBool(flag)
 * 
 *     def findZeroRows(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the index set of empty rows.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_295findZeroRows(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_294findZeroRows, "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:3618");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_295findZeroRows = {"findZeroRows", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_295findZeroRows, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_294findZeroRows};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_295findZeroRows(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("findZeroRows", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_294findZeroRows(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_294findZeroRows(struct PyPetscMatObject *__pyx_v_self) {
  struct PyPetscISObject *__pyx_v_zerorows = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("findZeroRows", 0);

  /* "petsc4py/PETSc/Mat.pyx":3628
 * 
 *         """
 *         cdef IS zerorows = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(MatFindZeroRows(self.mat, &zerorows.iset))
 *         return zerorows
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3628, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_zerorows = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3629
 *         """
 *         cdef IS zerorows = IS()
 *         CHKERR(MatFindZeroRows(self.mat, &zerorows.iset))             # <<<<<<<<<<<<<<
 *         return zerorows
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatFindZeroRows(__pyx_v_self->mat, (&__pyx_v_zerorows->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3629, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3630
 *         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":3618
 *         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_XDECREF(__pyx_t_2);
  __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":3632
 *         return zerorows
 * 
 *     def createVecs(             # <<<<<<<<<<<<<<
 *         self,
 *         side: Literal['r', 'R', 'right', 'Right', 'RIGHT', 'l', 'L', 'left', 'Left', 'LEFT'] | None = None) -> Vec | tuple[Vec, Vec]:
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_297createVecs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_296createVecs, "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 returns a left or right vector.\n\n        Notes\n        -----\n        ``right`` is a vector that the matrix can be multiplied against.\n        ``left`` is a vector that the matrix-vector product can be stored in.\n\n        See Also\n        --------\n        createVecLeft, createVecRight, petsc.MatCreateVecs\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:3632");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_297createVecs = {"createVecs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_297createVecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_296createVecs};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_297createVecs(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_side,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3632, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3632, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createVecs", 0) < (0)) __PYX_ERR(46, 3632, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":3634
 *     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.
 * 
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3632, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_side = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createVecs", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 3632, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_296createVecs(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_side);

  /* "petsc4py/PETSc/Mat.pyx":3632
 *         return zerorows
 * 
 *     def createVecs(             # <<<<<<<<<<<<<<
 *         self,
 *         side: Literal['r', 'R', 'right', 'Right', 'RIGHT', 'l', 'L', 'left', 'Left', 'LEFT'] | None = None) -> Vec | tuple[Vec, Vec]:
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_296createVecs(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createVecs", 0);

  /* "petsc4py/PETSc/Mat.pyx":3656
 *         """
 *         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":3657
 *         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_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3657, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __pyx_v_vecr = ((struct PyPetscVecObject *)__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3657, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __pyx_v_vecl = ((struct PyPetscVecObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Mat.pyx":3658
 *         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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, (&__pyx_v_vecr->vec), (&__pyx_v_vecl->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3658, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":3659
 *             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, 3659, __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)) != (0)) __PYX_ERR(46, 3659, __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)) != (0)) __PYX_ERR(46, 3659, __pyx_L1_error);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "petsc4py/PETSc/Mat.pyx":3656
 *         """
 *         cdef Vec vecr, vecl
 *         if side is None:             # <<<<<<<<<<<<<<
 *             vecr = Vec(); vecl = Vec()
 *             CHKERR(MatCreateVecs(self.mat, &vecr.vec, &vecl.vec))
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":3660
 *             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_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_r, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(46, 3660, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_R, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(46, 3660, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_right, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(46, 3660, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Right, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(46, 3660, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_1 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_RIGHT, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(46, 3660, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __pyx_t_1;
  if (__pyx_t_6) {

    /* "petsc4py/PETSc/Mat.pyx":3661
 *             return (vecr, vecl)
 *         elif side in ('r', 'R', 'right', 'Right', 'RIGHT'):
 *             vecr = Vec()             # <<<<<<<<<<<<<<
 *             CHKERR(MatCreateVecs(self.mat, &vecr.vec, NULL))
 *             return vecr
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3661, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __pyx_v_vecr = ((struct PyPetscVecObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Mat.pyx":3662
 *         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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, (&__pyx_v_vecr->vec), NULL)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3662, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":3663
 *             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":3660
 *             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":3664
 *             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_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_l, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(46, 3664, __pyx_L1_error)
  if (!__pyx_t_1) {
  } else {
    __pyx_t_6 = __pyx_t_1;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_L, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(46, 3664, __pyx_L1_error)
  if (!__pyx_t_1) {
  } else {
    __pyx_t_6 = __pyx_t_1;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(46, 3664, __pyx_L1_error)
  if (!__pyx_t_1) {
  } else {
    __pyx_t_6 = __pyx_t_1;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Left, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(46, 3664, __pyx_L1_error)
  if (!__pyx_t_1) {
  } else {
    __pyx_t_6 = __pyx_t_1;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_LEFT, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(46, 3664, __pyx_L1_error)
  __pyx_t_6 = __pyx_t_1;
  __pyx_L9_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_6;
  if (likely(__pyx_t_1)) {

    /* "petsc4py/PETSc/Mat.pyx":3665
 *             return vecr
 *         elif side in ('l', 'L', 'left',  'Left', 'LEFT'):
 *             vecl = Vec()             # <<<<<<<<<<<<<<
 *             CHKERR(MatCreateVecs(self.mat, NULL, &vecl.vec))
 *             return vecl
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3665, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __pyx_v_vecl = ((struct PyPetscVecObject *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Mat.pyx":3666
 *         elif side in ('l', 'L', 'left',  'Left', 'LEFT'):
 *             vecl = Vec()
 *             CHKERR(MatCreateVecs(self.mat, NULL, &vecl.vec))             # <<<<<<<<<<<<<<
 *             return vecl
 *         else:
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_vecl->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3666, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":3667
 *             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":3664
 *             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":3669
 *             return vecl
 *         else:
 *             raise ValueError("side '%r' not understood" % side)             # <<<<<<<<<<<<<<
 * 
 *     def createVecRight(self) -> Vec:
*/
  /*else*/ {
    __pyx_t_3 = NULL;
    __pyx_t_7 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_side_r_not_understood, __pyx_v_side); if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 3669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3669, __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, 3669, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Mat.pyx":3632
 *         return zerorows
 * 
 *     def createVecs(             # <<<<<<<<<<<<<<
 *         self,
 *         side: Literal['r', 'R', 'right', 'Right', 'RIGHT', 'l', 'L', 'left', 'Left', 'LEFT'] | None = None) -> Vec | tuple[Vec, Vec]:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __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":3671
 *             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_299createVecRight(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_298createVecRight, "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:3671");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_299createVecRight = {"createVecRight", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_299createVecRight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_298createVecRight};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_299createVecRight(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("createVecRight", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_298createVecRight(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_298createVecRight(struct PyPetscMatObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_vecr = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createVecRight", 0);

  /* "petsc4py/PETSc/Mat.pyx":3681
 * 
 *         """
 *         cdef Vec vecr = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(MatCreateVecs(self.mat, &vecr.vec, NULL))
 *         return vecr
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3681, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vecr = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3682
 *         """
 *         cdef Vec vecr = Vec()
 *         CHKERR(MatCreateVecs(self.mat, &vecr.vec, NULL))             # <<<<<<<<<<<<<<
 *         return vecr
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, (&__pyx_v_vecr->vec), NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3682, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3683
 *         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":3671
 *             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_XDECREF(__pyx_t_2);
  __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":3685
 *         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_301createVecLeft(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_300createVecLeft, "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:3685");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_301createVecLeft = {"createVecLeft", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_301createVecLeft, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_300createVecLeft};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_301createVecLeft(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("createVecLeft", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_300createVecLeft(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_300createVecLeft(struct PyPetscMatObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_vecl = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createVecLeft", 0);

  /* "petsc4py/PETSc/Mat.pyx":3695
 * 
 *         """
 *         cdef Vec vecl = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(MatCreateVecs(self.mat, NULL, &vecl.vec))
 *         return vecl
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3695, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vecl = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3696
 *         """
 *         cdef Vec vecl = Vec()
 *         CHKERR(MatCreateVecs(self.mat, NULL, &vecl.vec))             # <<<<<<<<<<<<<<
 *         return vecl
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_vecl->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3696, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3697
 *         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":3685
 *         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_XDECREF(__pyx_t_2);
  __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":3705
 *     #
 * 
 *     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_303getColumnVector(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_302getColumnVector, "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:3705");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_303getColumnVector = {"getColumnVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_303getColumnVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_302getColumnVector};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_303getColumnVector(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_column,&__pyx_mstate_global->__pyx_n_u_result,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3705, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getColumnVector", 0) < (0)) __PYX_ERR(46, 3705, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getColumnVector", 0, 1, 2, i); __PYX_ERR(46, 3705, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3705, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 3705, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "result", 0))) __PYX_ERR(46, 3705, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_302getColumnVector(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_column, __pyx_v_result);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_302getColumnVector(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  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":3722
 * 
 *         """
 *         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, 3722, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":3723
 *         """
 *         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":3724
 *         cdef PetscInt ival = asInt(column)
 *         if result is None:
 *             result = Vec()             # <<<<<<<<<<<<<<
 *         if result.vec == NULL:
 *             CHKERR(MatCreateVecs(self.mat, NULL, &result.vec))
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 3724, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_3);
    }
    __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscVecObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/Mat.pyx":3723
 *         """
 *         cdef PetscInt ival = asInt(column)
 *         if result is None:             # <<<<<<<<<<<<<<
 *             result = Vec()
 *         if result.vec == NULL:
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":3725
 *         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":3726
 *             result = Vec()
 *         if result.vec == NULL:
 *             CHKERR(MatCreateVecs(self.mat, NULL, &result.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetColumnVector(self.mat, result.vec, ival))
 *         return result
*/
    __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_result->vec))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3726, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":3725
 *         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":3727
 *         if result.vec == NULL:
 *             CHKERR(MatCreateVecs(self.mat, NULL, &result.vec))
 *         CHKERR(MatGetColumnVector(self.mat, result.vec, ival))             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetColumnVector(__pyx_v_self->mat, __pyx_v_result->vec, __pyx_v_ival)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3727, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3728
 *             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":3705
 *     #
 * 
 *     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_XDECREF(__pyx_t_4);
  __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":3730
 *         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_305getRedundantMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_304getRedundantMatrix, "Mat.getRedundantMatrix(self, nsubcomm: int, subcomm: Comm | None = None, out: Mat | None = None) -> Mat\nReturn redundant matrices on subcommunicators.\n\n        Collective.\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:3730");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_305getRedundantMatrix = {"getRedundantMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_305getRedundantMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_304getRedundantMatrix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_305getRedundantMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nsubcomm,&__pyx_mstate_global->__pyx_n_u_subcomm,&__pyx_mstate_global->__pyx_n_u_out,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3730, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getRedundantMatrix", 0) < (0)) __PYX_ERR(46, 3730, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getRedundantMatrix", 0, 1, 3, i); __PYX_ERR(46, 3730, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3730, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3730, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 3730, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "out", 0))) __PYX_ERR(46, 3730, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_304getRedundantMatrix(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_304getRedundantMatrix(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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PetscErrorCode __pyx_t_7;
  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":3751
 * 
 *         """
 *         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, 3751, __pyx_L1_error)
  __pyx_v__nsubcomm = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":3752
 *         """
 *         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":3753
 *         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, 3753, __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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 3753, __pyx_L1_error)
    __pyx_v__subcomm = __pyx_t_3;
  }

  /* "petsc4py/PETSc/Mat.pyx":3754
 *         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":3755
 *         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_5 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 3755, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_4);
    }
    __Pyx_DECREF_SET(__pyx_v_out, ((struct PyPetscMatObject *)__pyx_t_4));
    __pyx_t_4 = 0;
  }

  /* "petsc4py/PETSc/Mat.pyx":3756
 *         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":3757
 *         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_7 = __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_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3757, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3758
 *         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":3730
 *         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_XDECREF(__pyx_t_5);
  __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":3760
 *         return out
 * 
 *     def getDiagonal(self, Vec result=None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the diagonal of the matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_307getDiagonal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_306getDiagonal, "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:3760");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_307getDiagonal = {"getDiagonal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_307getDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_306getDiagonal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_307getDiagonal(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_result,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3760, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getDiagonal", 0) < (0)) __PYX_ERR(46, 3760, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 3760, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "result", 0))) __PYX_ERR(46, 3760, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_306getDiagonal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_result);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_306getDiagonal(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  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":3775
 * 
 *         """
 *         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":3776
 *         """
 *         if result is None:
 *             result = Vec()             # <<<<<<<<<<<<<<
 *         if result.vec == NULL:
 *             CHKERR(MatCreateVecs(self.mat, NULL, &result.vec))
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3776, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscVecObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Mat.pyx":3775
 * 
 *         """
 *         if result is None:             # <<<<<<<<<<<<<<
 *             result = Vec()
 *         if result.vec == NULL:
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":3777
 *         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":3778
 *             result = Vec()
 *         if result.vec == NULL:
 *             CHKERR(MatCreateVecs(self.mat, NULL, &result.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetDiagonal(self.mat, result.vec))
 *         return result
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_result->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3778, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":3777
 *         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":3779
 *         if result.vec == NULL:
 *             CHKERR(MatCreateVecs(self.mat, NULL, &result.vec))
 *         CHKERR(MatGetDiagonal(self.mat, result.vec))             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetDiagonal(__pyx_v_self->mat, __pyx_v_result->vec)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3779, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3780
 *             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":3760
 *         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_XDECREF(__pyx_t_3);
  __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":3782
 *         return result
 * 
 *     def getRowSum(self, Vec result=None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the row-sum vector.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_309getRowSum(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_308getRowSum, "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:3782");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_309getRowSum = {"getRowSum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_309getRowSum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_308getRowSum};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_309getRowSum(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_result,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3782, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3782, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getRowSum", 0) < (0)) __PYX_ERR(46, 3782, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3782, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 3782, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "result", 0))) __PYX_ERR(46, 3782, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_308getRowSum(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_result);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_308getRowSum(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  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":3797
 * 
 *         """
 *         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":3798
 *         """
 *         if result is None:
 *             result = Vec()             # <<<<<<<<<<<<<<
 *         if result.vec == NULL:
 *             CHKERR(MatCreateVecs(self.mat, NULL, &result.vec))
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 3798, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscVecObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Mat.pyx":3797
 * 
 *         """
 *         if result is None:             # <<<<<<<<<<<<<<
 *             result = Vec()
 *         if result.vec == NULL:
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":3799
 *         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":3800
 *             result = Vec()
 *         if result.vec == NULL:
 *             CHKERR(MatCreateVecs(self.mat, NULL, &result.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetRowSum(self.mat, result.vec))
 *         return result
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateVecs(__pyx_v_self->mat, NULL, (&__pyx_v_result->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3800, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":3799
 *         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":3801
 *         if result.vec == NULL:
 *             CHKERR(MatCreateVecs(self.mat, NULL, &result.vec))
 *         CHKERR(MatGetRowSum(self.mat, result.vec))             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetRowSum(__pyx_v_self->mat, __pyx_v_result->vec)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3801, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3802
 *             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":3782
 *         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_XDECREF(__pyx_t_3);
  __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":3804
 *         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_311setDiagonal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_310setDiagonal, "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:3804");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_311setDiagonal = {"setDiagonal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_311setDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_310setDiagonal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_311setDiagonal(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_diag,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3804, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3804, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3804, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDiagonal", 0) < (0)) __PYX_ERR(46, 3804, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDiagonal", 0, 1, 2, i); __PYX_ERR(46, 3804, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3804, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3804, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3804, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "diag", 0))) __PYX_ERR(46, 3804, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_310setDiagonal(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_diag, __pyx_v_addv);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_310setDiagonal(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3821
 * 
 *         """
 *         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, 3821, __pyx_L1_error)
  __pyx_v_caddv = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":3822
 *         """
 *         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, 3822, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3804
 *         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":3824
 *         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_313diagonalScale(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_312diagonalScale, "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:3824");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_313diagonalScale = {"diagonalScale", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_313diagonalScale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_312diagonalScale};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_313diagonalScale(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_L,&__pyx_mstate_global->__pyx_n_u_R,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3824, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3824, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3824, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "diagonalScale", 0) < (0)) __PYX_ERR(46, 3824, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3824, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3824, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 3824, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "L", 0))) __PYX_ERR(46, 3824, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_R), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "R", 0))) __PYX_ERR(46, 3824, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_312diagonalScale(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_L, __pyx_v_R);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_312diagonalScale(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3841
 * 
 *         """
 *         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":3842
 *         """
 *         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":3843
 *         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":3844
 *         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, 3844, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3824
 *         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":3846
 *         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_315invertBlockDiagonal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_314invertBlockDiagonal, "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:3846");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_315invertBlockDiagonal = {"invertBlockDiagonal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_315invertBlockDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_314invertBlockDiagonal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_315invertBlockDiagonal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("invertBlockDiagonal", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_314invertBlockDiagonal(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_314invertBlockDiagonal(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3856
 * 
 *         """
 *         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":3857
 *         """
 *         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":3858
 *         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, 3858, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3859
 *         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, 3859, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3860
 *         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, 3860, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3861
 *         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, 3861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ibdiag = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3862
 *         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, 3862, __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, 3862, __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, 3862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 3862, __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) != (0)) __PYX_ERR(46, 3862, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(46, 3862, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4) != (0)) __PYX_ERR(46, 3862, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_ibdiag), __pyx_mstate_global->__pyx_n_u_shape, __pyx_t_5) < (0)) __PYX_ERR(46, 3862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3863
 *         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_mstate_global->__pyx_n_u_transpose); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 3863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[6], NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 3863, __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":3846
 *         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":3867
 *     # null space
 * 
 *     def setNullSpace(self, NullSpace nsp) -> None:             # <<<<<<<<<<<<<<
 *         """Set the nullspace.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_317setNullSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_316setNullSpace, "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:3867");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_317setNullSpace = {"setNullSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_317setNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_316setNullSpace};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_317setNullSpace(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nsp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3867, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3867, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNullSpace", 0) < (0)) __PYX_ERR(46, 3867, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNullSpace", 1, 1, 1, i); __PYX_ERR(46, 3867, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3867, __pyx_L3_error)
    }
    __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, 3867, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, 0, "nsp", 0))) __PYX_ERR(46, 3867, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_316setNullSpace(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nsp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_316setNullSpace(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3877
 * 
 *         """
 *         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, 3877, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3867
 *     # 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":3879
 *         CHKERR(MatSetNullSpace(self.mat, nsp.nsp))
 * 
 *     def getNullSpace(self) -> NullSpace:             # <<<<<<<<<<<<<<
 *         """Return the nullspace.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_319getNullSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_318getNullSpace, "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:3879");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_319getNullSpace = {"getNullSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_319getNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_318getNullSpace};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_319getNullSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNullSpace", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_318getNullSpace(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_318getNullSpace(struct PyPetscMatObject *__pyx_v_self) {
  struct PyPetscNullSpaceObject *__pyx_v_nsp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getNullSpace", 0);

  /* "petsc4py/PETSc/Mat.pyx":3889
 * 
 *         """
 *         cdef NullSpace nsp = NullSpace()             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetNullSpace(self.mat, &nsp.nsp))
 *         CHKERR(PetscINCREF(nsp.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3889, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3890
 *         """
 *         cdef NullSpace nsp = NullSpace()
 *         CHKERR(MatGetNullSpace(self.mat, &nsp.nsp))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(nsp.obj))
 *         return nsp
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetNullSpace(__pyx_v_self->mat, (&__pyx_v_nsp->nsp))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3890, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3891
 *         cdef NullSpace nsp = NullSpace()
 *         CHKERR(MatGetNullSpace(self.mat, &nsp.nsp))
 *         CHKERR(PetscINCREF(nsp.obj))             # <<<<<<<<<<<<<<
 *         return nsp
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_nsp->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3891, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3892
 *         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":3879
 *         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_XDECREF(__pyx_t_2);
  __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":3894
 *         return nsp
 * 
 *     def setTransposeNullSpace(self, NullSpace nsp) -> None:             # <<<<<<<<<<<<<<
 *         """Set the transpose nullspace.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_321setTransposeNullSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_320setTransposeNullSpace, "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:3894");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_321setTransposeNullSpace = {"setTransposeNullSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_321setTransposeNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_320setTransposeNullSpace};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_321setTransposeNullSpace(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nsp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3894, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3894, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTransposeNullSpace", 0) < (0)) __PYX_ERR(46, 3894, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setTransposeNullSpace", 1, 1, 1, i); __PYX_ERR(46, 3894, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3894, __pyx_L3_error)
    }
    __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, 3894, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, 0, "nsp", 0))) __PYX_ERR(46, 3894, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_320setTransposeNullSpace(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nsp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_320setTransposeNullSpace(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3904
 * 
 *         """
 *         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, 3904, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3894
 *         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":3906
 *         CHKERR(MatSetTransposeNullSpace(self.mat, nsp.nsp))
 * 
 *     def getTransposeNullSpace(self) -> NullSpace:             # <<<<<<<<<<<<<<
 *         """Return the transpose nullspace.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_323getTransposeNullSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_322getTransposeNullSpace, "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:3906");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_323getTransposeNullSpace = {"getTransposeNullSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_323getTransposeNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_322getTransposeNullSpace};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_323getTransposeNullSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTransposeNullSpace", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_322getTransposeNullSpace(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_322getTransposeNullSpace(struct PyPetscMatObject *__pyx_v_self) {
  struct PyPetscNullSpaceObject *__pyx_v_nsp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getTransposeNullSpace", 0);

  /* "petsc4py/PETSc/Mat.pyx":3916
 * 
 *         """
 *         cdef NullSpace nsp = NullSpace()             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetTransposeNullSpace(self.mat, &nsp.nsp))
 *         CHKERR(PetscINCREF(nsp.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3916, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3917
 *         """
 *         cdef NullSpace nsp = NullSpace()
 *         CHKERR(MatGetTransposeNullSpace(self.mat, &nsp.nsp))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(nsp.obj))
 *         return nsp
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetTransposeNullSpace(__pyx_v_self->mat, (&__pyx_v_nsp->nsp))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3917, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3918
 *         cdef NullSpace nsp = NullSpace()
 *         CHKERR(MatGetTransposeNullSpace(self.mat, &nsp.nsp))
 *         CHKERR(PetscINCREF(nsp.obj))             # <<<<<<<<<<<<<<
 *         return nsp
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_nsp->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3918, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3919
 *         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":3906
 *         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_XDECREF(__pyx_t_2);
  __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":3921
 *         return nsp
 * 
 *     def setNearNullSpace(self, NullSpace nsp) -> None:             # <<<<<<<<<<<<<<
 *         """Set the near-nullspace.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_325setNearNullSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_324setNearNullSpace, "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:3921");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_325setNearNullSpace = {"setNearNullSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_325setNearNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_324setNearNullSpace};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_325setNearNullSpace(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nsp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3921, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3921, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNearNullSpace", 0) < (0)) __PYX_ERR(46, 3921, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNearNullSpace", 1, 1, 1, i); __PYX_ERR(46, 3921, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3921, __pyx_L3_error)
    }
    __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, 3921, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, 0, "nsp", 0))) __PYX_ERR(46, 3921, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_324setNearNullSpace(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nsp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_324setNearNullSpace(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3931
 * 
 *         """
 *         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, 3931, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3921
 *         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":3933
 *         CHKERR(MatSetNearNullSpace(self.mat, nsp.nsp))
 * 
 *     def getNearNullSpace(self) -> NullSpace:             # <<<<<<<<<<<<<<
 *         """Return the near-nullspace.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_327getNearNullSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_326getNearNullSpace, "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:3933");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_327getNearNullSpace = {"getNearNullSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_327getNearNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_326getNearNullSpace};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_327getNearNullSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNearNullSpace", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_326getNearNullSpace(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_326getNearNullSpace(struct PyPetscMatObject *__pyx_v_self) {
  struct PyPetscNullSpaceObject *__pyx_v_nsp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getNearNullSpace", 0);

  /* "petsc4py/PETSc/Mat.pyx":3943
 * 
 *         """
 *         cdef NullSpace nsp = NullSpace()             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetNearNullSpace(self.mat, &nsp.nsp))
 *         CHKERR(PetscINCREF(nsp.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 3943, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_nsp = ((struct PyPetscNullSpaceObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3944
 *         """
 *         cdef NullSpace nsp = NullSpace()
 *         CHKERR(MatGetNearNullSpace(self.mat, &nsp.nsp))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(nsp.obj))
 *         return nsp
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetNearNullSpace(__pyx_v_self->mat, (&__pyx_v_nsp->nsp))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3944, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3945
 *         cdef NullSpace nsp = NullSpace()
 *         CHKERR(MatGetNearNullSpace(self.mat, &nsp.nsp))
 *         CHKERR(PetscINCREF(nsp.obj))             # <<<<<<<<<<<<<<
 *         return nsp
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_nsp->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 3945, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3946
 *         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":3933
 *         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_XDECREF(__pyx_t_2);
  __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":3950
 *     # 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_329mult(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_328mult, "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:3950");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_329mult = {"mult", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_329mult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_328mult};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_329mult(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3950, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3950, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3950, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "mult", 0) < (0)) __PYX_ERR(46, 3950, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("mult", 1, 2, 2, i); __PYX_ERR(46, 3950, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3950, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3950, __pyx_L3_error)
    }
    __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, 3950, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 3950, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(46, 3950, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_328mult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_328mult(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3967
 * 
 *         """
 *         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, 3967, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3950
 *     # 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":3969
 *         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_331multAdd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_330multAdd, "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:3969");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_331multAdd = {"multAdd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_331multAdd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_330multAdd};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_331multAdd(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_v,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3969, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3969, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3969, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3969, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "multAdd", 0) < (0)) __PYX_ERR(46, 3969, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("multAdd", 1, 3, 3, i); __PYX_ERR(46, 3969, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3969, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3969, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 3969, __pyx_L3_error)
    }
    __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, 3969, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 3969, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "v", 0))) __PYX_ERR(46, 3969, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(46, 3969, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_330multAdd(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_330multAdd(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":3988
 * 
 *         """
 *         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, 3988, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3969
 *         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":3990
 *         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_333multTranspose(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_332multTranspose, "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:3990");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_333multTranspose = {"multTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_333multTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_332multTranspose};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_333multTranspose(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 3990, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3990, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3990, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "multTranspose", 0) < (0)) __PYX_ERR(46, 3990, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("multTranspose", 1, 2, 2, i); __PYX_ERR(46, 3990, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 3990, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 3990, __pyx_L3_error)
    }
    __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, 3990, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 3990, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(46, 3990, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_332multTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_332multTranspose(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4007
 * 
 *         """
 *         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, 4007, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3990
 *         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":4009
 *         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_335multTransposeAdd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_334multTransposeAdd, "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:4009");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_335multTransposeAdd = {"multTransposeAdd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_335multTransposeAdd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_334multTransposeAdd};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_335multTransposeAdd(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_v,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4009, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4009, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4009, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4009, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "multTransposeAdd", 0) < (0)) __PYX_ERR(46, 4009, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("multTransposeAdd", 1, 3, 3, i); __PYX_ERR(46, 4009, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4009, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4009, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4009, __pyx_L3_error)
    }
    __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, 4009, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 4009, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "v", 0))) __PYX_ERR(46, 4009, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(46, 4009, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_334multTransposeAdd(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_334multTransposeAdd(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4028
 * 
 *         """
 *         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, 4028, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4009
 *         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":4030
 *         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_337multHermitian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_336multHermitian, "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:4030");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_337multHermitian = {"multHermitian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_337multHermitian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_336multHermitian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_337multHermitian(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4030, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4030, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4030, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "multHermitian", 0) < (0)) __PYX_ERR(46, 4030, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("multHermitian", 1, 2, 2, i); __PYX_ERR(46, 4030, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4030, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4030, __pyx_L3_error)
    }
    __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, 4030, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 4030, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(46, 4030, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_336multHermitian(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_336multHermitian(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4047
 * 
 *         """
 *         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, 4047, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4030
 *         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":4049
 *         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_339multHermitianAdd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_338multHermitianAdd, "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:4049");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_339multHermitianAdd = {"multHermitianAdd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_339multHermitianAdd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_338multHermitianAdd};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_339multHermitianAdd(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_v,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4049, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4049, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "multHermitianAdd", 0) < (0)) __PYX_ERR(46, 4049, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("multHermitianAdd", 1, 3, 3, i); __PYX_ERR(46, 4049, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4049, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4049, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4049, __pyx_L3_error)
    }
    __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, 4049, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 4049, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "v", 0))) __PYX_ERR(46, 4049, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(46, 4049, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_338multHermitianAdd(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_338multHermitianAdd(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4068
 * 
 *         """
 *         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, 4068, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4049
 *         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":4072
 *     # SOR
 * 
 *     def SOR(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec b,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_341SOR(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_340SOR, "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:4072");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_341SOR = {"SOR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_341SOR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_340SOR};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_341SOR(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_b,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_omega,&__pyx_mstate_global->__pyx_n_u_sortype,&__pyx_mstate_global->__pyx_n_u_shift,&__pyx_mstate_global->__pyx_n_u_its,&__pyx_mstate_global->__pyx_n_u_lits,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4072, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(46, 4072, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(46, 4072, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 4072, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 4072, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4072, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4072, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4072, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "SOR", 0) < (0)) __PYX_ERR(46, 4072, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));

      /* "petsc4py/PETSc/Mat.pyx":4077
 *         Vec x,
 *         omega: float = 1.0,
 *         sortype: SORType | None = None,             # <<<<<<<<<<<<<<
 *         shift: float = 0.0,
 *         its: int = 1,
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_0));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("SOR", 0, 2, 7, i); __PYX_ERR(46, 4072, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(46, 4072, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(46, 4072, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 4072, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 4072, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4072, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4072, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4072, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_0_0));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
    }
    __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, 4072, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(46, 4074, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 4075, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_340SOR(((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":4072
 *     # SOR
 * 
 *     def SOR(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec b,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_340SOR(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4090
 * 
 *         """
 *         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, 4090, __pyx_L1_error)
  __pyx_v_comega = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":4091
 *         """
 *         cdef PetscReal comega = asReal(omega)
 *         cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP             # <<<<<<<<<<<<<<
 *         if sortype is not None:
 *             csortype = <PetscMatSORType> asInt(sortype)
*/
  __pyx_v_csortype = SOR_LOCAL_SYMMETRIC_SWEEP;

  /* "petsc4py/PETSc/Mat.pyx":4092
 *         cdef PetscReal comega = asReal(omega)
 *         cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP
 *         if sortype is not None:             # <<<<<<<<<<<<<<
 *             csortype = <PetscMatSORType> asInt(sortype)
 *         cdef PetscReal cshift = asReal(shift)
*/
  __pyx_t_2 = (__pyx_v_sortype != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/Mat.pyx":4093
 *         cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP
 *         if sortype is not None:
 *             csortype = <PetscMatSORType> 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, 4093, __pyx_L1_error)
    __pyx_v_csortype = ((MatSORType)__pyx_t_3);

    /* "petsc4py/PETSc/Mat.pyx":4092
 *         cdef PetscReal comega = asReal(omega)
 *         cdef PetscMatSORType csortype = SOR_LOCAL_SYMMETRIC_SWEEP
 *         if sortype is not None:             # <<<<<<<<<<<<<<
 *             csortype = <PetscMatSORType> asInt(sortype)
 *         cdef PetscReal cshift = asReal(shift)
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":4094
 *         if sortype is not None:
 *             csortype = <PetscMatSORType> 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, 4094, __pyx_L1_error)
  __pyx_v_cshift = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":4095
 *             csortype = <PetscMatSORType> 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, 4095, __pyx_L1_error)
  __pyx_v_cits = __pyx_t_3;

  /* "petsc4py/PETSc/Mat.pyx":4096
 *         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, 4096, __pyx_L1_error)
  __pyx_v_clits = __pyx_t_3;

  /* "petsc4py/PETSc/Mat.pyx":4097
 *         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, 4097, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4072
 *     # 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":4101
 *     #
 * 
 *     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_343getDiagonalBlock(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_342getDiagonalBlock, "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:4101");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_343getDiagonalBlock = {"getDiagonalBlock", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_343getDiagonalBlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_342getDiagonalBlock};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_343getDiagonalBlock(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDiagonalBlock", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_342getDiagonalBlock(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_342getDiagonalBlock(struct PyPetscMatObject *__pyx_v_self) {
  struct PyPetscMatObject *__pyx_v_submat = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDiagonalBlock", 0);

  /* "petsc4py/PETSc/Mat.pyx":4111
 * 
 *         """
 *         cdef Mat submat = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetDiagonalBlock(self.mat, &submat.mat))
 *         CHKERR(PetscINCREF(submat.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4111, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_submat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4112
 *         """
 *         cdef Mat submat = Mat()
 *         CHKERR(MatGetDiagonalBlock(self.mat, &submat.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(submat.obj))
 *         return submat
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatGetDiagonalBlock(__pyx_v_self->mat, (&__pyx_v_submat->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4112, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4113
 *         cdef Mat submat = Mat()
 *         CHKERR(MatGetDiagonalBlock(self.mat, &submat.mat))
 *         CHKERR(PetscINCREF(submat.obj))             # <<<<<<<<<<<<<<
 *         return submat
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_submat->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4113, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4114
 *         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":4101
 *     #
 * 
 *     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_XDECREF(__pyx_t_2);
  __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":4116
 *         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_345increaseOverlap(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_344increaseOverlap, "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:4116");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_345increaseOverlap = {"increaseOverlap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_345increaseOverlap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_344increaseOverlap};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_345increaseOverlap(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_iset,&__pyx_mstate_global->__pyx_n_u_overlap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4116, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4116, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4116, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "increaseOverlap", 0) < (0)) __PYX_ERR(46, 4116, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("increaseOverlap", 0, 1, 2, i); __PYX_ERR(46, 4116, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4116, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4116, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
    }
    __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, 4116, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(46, 4116, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_344increaseOverlap(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_iset, __pyx_v_overlap);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_344increaseOverlap(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4126
 * 
 *         """
 *         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, 4126, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":4127
 *         """
 *         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, 4127, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4116
 *         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":4129
 *         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_347createSubMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_346createSubMatrix, "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:4129");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_347createSubMatrix = {"createSubMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_347createSubMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_346createSubMatrix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_347createSubMatrix(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isrow,&__pyx_mstate_global->__pyx_n_u_iscol,&__pyx_mstate_global->__pyx_n_u_submat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4129, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4129, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4129, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4129, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createSubMatrix", 0) < (0)) __PYX_ERR(46, 4129, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createSubMatrix", 0, 1, 3, i); __PYX_ERR(46, 4129, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4129, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4129, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4129, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 4129, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 4129, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 1, "iscol", 0))) __PYX_ERR(46, 4129, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_submat), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "submat", 0))) __PYX_ERR(46, 4129, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_346createSubMatrix(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_346createSubMatrix(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  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":4150
 * 
 *         """
 *         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":4151
 *         """
 *         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":4152
 *         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":4153
 *         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_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 4153, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_3);
    }
    __Pyx_DECREF_SET(__pyx_v_submat, ((struct PyPetscMatObject *)__pyx_t_3));
    __pyx_t_3 = 0;
  }

  /* "petsc4py/PETSc/Mat.pyx":4154
 *         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":4155
 *         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_6 = __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_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4155, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4157
 *         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":4129
 *         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_XDECREF(__pyx_t_4);
  __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":4159
 *         return submat
 * 
 *     def createSubMatrices(             # <<<<<<<<<<<<<<
 *         self,
 *         isrows: IS | Sequence[IS],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_349createSubMatrices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_348createSubMatrices, "Mat.createSubMatrices(self, isrows: IS | Sequence[IS], iscols: IS | Sequence[IS] | None = None, submats: Mat | Sequence[Mat] | None = 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:4159");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_349createSubMatrices = {"createSubMatrices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_349createSubMatrices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_348createSubMatrices};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_349createSubMatrices(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isrows,&__pyx_mstate_global->__pyx_n_u_iscols,&__pyx_mstate_global->__pyx_n_u_submats,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4159, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4159, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4159, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4159, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createSubMatrices", 0) < (0)) __PYX_ERR(46, 4159, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":4162
 *         self,
 *         isrows: IS | Sequence[IS],
 *         iscols: IS | Sequence[IS] | None = None,             # <<<<<<<<<<<<<<
 *         submats: Mat | Sequence[Mat] | None = None) -> Sequence[Mat]:
 *         """Return several sequential submatrices.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":4163
 *         isrows: IS | Sequence[IS],
 *         iscols: IS | Sequence[IS] | None = None,
 *         submats: Mat | Sequence[Mat] | None = None) -> Sequence[Mat]:             # <<<<<<<<<<<<<<
 *         """Return several sequential submatrices.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createSubMatrices", 0, 1, 3, i); __PYX_ERR(46, 4159, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4159, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4159, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4159, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":4162
 *         self,
 *         isrows: IS | Sequence[IS],
 *         iscols: IS | Sequence[IS] | None = None,             # <<<<<<<<<<<<<<
 *         submats: Mat | Sequence[Mat] | None = None) -> Sequence[Mat]:
 *         """Return several sequential submatrices.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":4163
 *         isrows: IS | Sequence[IS],
 *         iscols: IS | Sequence[IS] | None = None,
 *         submats: Mat | Sequence[Mat] | None = None) -> Sequence[Mat]:             # <<<<<<<<<<<<<<
 *         """Return several sequential submatrices.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4159, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_348createSubMatrices(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrows, __pyx_v_iscols, __pyx_v_submats);

  /* "petsc4py/PETSc/Mat.pyx":4159
 *         return submat
 * 
 *     def createSubMatrices(             # <<<<<<<<<<<<<<
 *         self,
 *         isrows: IS | Sequence[IS],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_348createSubMatrices(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;
  struct PyPetscMatObject *__pyx_v_mat = 0;
  CYTHON_UNUSED PyObject *__pyx_v_unused1 = 0;
  CYTHON_UNUSED PyObject *__pyx_v_unused2 = 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;
  size_t __pyx_t_9;
  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":4184
 * 
 *         """
 *         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":4185
 *         """
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS); 
  if (__pyx_t_1) {
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 4185, __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) != (0)) __PYX_ERR(46, 4185, __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, 4185, __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":4186
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS); 
  if (__pyx_t_1) {
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 4186, __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) != (0)) __PYX_ERR(46, 4186, __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, 4186, __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":4187
 *         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, 4187, __pyx_L1_error)
    __pyx_t_5 = PyObject_Length(__pyx_v_iscols); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(46, 4187, __pyx_L1_error)
    __pyx_t_1 = (__pyx_t_4 == __pyx_t_5);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(46, 4187, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(46, 4187, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/Mat.pyx":4188
 *         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, 4188, __pyx_L1_error)
  __pyx_v_n = __pyx_t_5;

  /* "petsc4py/PETSc/Mat.pyx":4189
 *         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":4190
 *         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":4191
 *         cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
 *         cdef PetscIS  *cisrows = NULL
 *         cdef PetscIS  *ciscols = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscMat *cmats   = NULL
 *         cdef Mat mat
*/
  __pyx_v_ciscols = NULL;

  /* "petsc4py/PETSc/Mat.pyx":4192
 *         cdef PetscIS  *cisrows = NULL
 *         cdef PetscIS  *ciscols = NULL
 *         cdef PetscMat *cmats   = NULL             # <<<<<<<<<<<<<<
 *         cdef Mat mat
 *         cdef object unused1 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&cisrows)
*/
  __pyx_v_cmats = NULL;

  /* "petsc4py/PETSc/Mat.pyx":4194
 *         cdef PetscMat *cmats   = NULL
 *         cdef Mat mat
 *         cdef object unused1 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&cisrows)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < n: cisrows[i] = (<IS?>isrows[i]).iset
 *         cdef object unused2 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&ciscols)
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_n))); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4194, __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, 4194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused1 = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4195
 *         cdef Mat mat
 *         cdef object unused1 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&cisrows)
 *         for i from 0 <= i < n: cisrows[i] = (<IS?>isrows[i]).iset             # <<<<<<<<<<<<<<
 *         cdef object unused2 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&ciscols)
 *         for i from 0 <= i < n: ciscols[i] = (<IS?>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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 4195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(46, 4195, __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":4196
 *         cdef object unused1 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&cisrows)
 *         for i from 0 <= i < n: cisrows[i] = (<IS?>isrows[i]).iset
 *         cdef object unused2 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&ciscols)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < n: ciscols[i] = (<IS?>iscols[i]).iset
 *         if submats is not None:
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_n))); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 4196, __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, 4196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_unused2 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4197
 *         for i from 0 <= i < n: cisrows[i] = (<IS?>isrows[i]).iset
 *         cdef object unused2 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&ciscols)
 *         for i from 0 <= i < n: ciscols[i] = (<IS?>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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(46, 4197, __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":4198
 *         cdef object unused2 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&ciscols)
 *         for i from 0 <= i < n: ciscols[i] = (<IS?>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":4199
 *         for i from 0 <= i < n: ciscols[i] = (<IS?>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":4200
 *         if submats is not None:
 *             reuse = MAT_REUSE_MATRIX
 *             submats = list(submats)             # <<<<<<<<<<<<<<
 *             assert len(submats) == len(isrows)
 *             CHKERR(PetscMalloc(<size_t>(n+1)*sizeof(PetscMat), &cmats))
*/
    __pyx_t_2 = PySequence_List(__pyx_v_submats); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4200, __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":4201
 *             reuse = MAT_REUSE_MATRIX
 *             submats = list(submats)
 *             assert len(submats) == len(isrows)             # <<<<<<<<<<<<<<
 *             CHKERR(PetscMalloc(<size_t>(n+1)*sizeof(PetscMat), &cmats))
 *             for i from 0 <= i < n: cmats[i] = (<Mat?>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, 4201, __pyx_L1_error)
      __pyx_t_4 = PyObject_Length(__pyx_v_isrows); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(46, 4201, __pyx_L1_error)
      __pyx_t_1 = (__pyx_t_5 == __pyx_t_4);
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(46, 4201, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(46, 4201, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/Mat.pyx":4202
 *             submats = list(submats)
 *             assert len(submats) == len(isrows)
 *             CHKERR(PetscMalloc(<size_t>(n+1)*sizeof(PetscMat), &cmats))             # <<<<<<<<<<<<<<
 *             for i from 0 <= i < n: cmats[i] = (<Mat?>submats[i]).mat
 *         CHKERR(MatCreateSubMatrices(self.mat, <PetscInt>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, 4202, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":4203
 *             assert len(submats) == len(isrows)
 *             CHKERR(PetscMalloc(<size_t>(n+1)*sizeof(PetscMat), &cmats))
 *             for i from 0 <= i < n: cmats[i] = (<Mat?>submats[i]).mat             # <<<<<<<<<<<<<<
 *         CHKERR(MatCreateSubMatrices(self.mat, <PetscInt>n, cisrows, ciscols, reuse, &cmats))
 *         for i from 0 <= i < n: CHKERR(PetscINCREF(<PetscObject*>&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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(46, 4203, __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":4198
 *         cdef object unused2 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&ciscols)
 *         for i from 0 <= i < n: ciscols[i] = (<IS?>iscols[i]).iset
 *         if submats is not None:             # <<<<<<<<<<<<<<
 *             reuse = MAT_REUSE_MATRIX
 *             submats = list(submats)
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":4204
 *             CHKERR(PetscMalloc(<size_t>(n+1)*sizeof(PetscMat), &cmats))
 *             for i from 0 <= i < n: cmats[i] = (<Mat?>submats[i]).mat
 *         CHKERR(MatCreateSubMatrices(self.mat, <PetscInt>n, cisrows, ciscols, reuse, &cmats))             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < n: CHKERR(PetscINCREF(<PetscObject*>&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, 4204, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4205
 *             for i from 0 <= i < n: cmats[i] = (<Mat?>submats[i]).mat
 *         CHKERR(MatCreateSubMatrices(self.mat, <PetscInt>n, cisrows, ciscols, reuse, &cmats))
 *         for i from 0 <= i < n: CHKERR(PetscINCREF(<PetscObject*>&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, 4205, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Mat.pyx":4206
 *         CHKERR(MatCreateSubMatrices(self.mat, <PetscInt>n, cisrows, ciscols, reuse, &cmats))
 *         for i from 0 <= i < n: CHKERR(PetscINCREF(<PetscObject*>&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":4207
 *         for i from 0 <= i < n: CHKERR(PetscINCREF(<PetscObject*>&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, 4207, __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) != (0)) __PYX_ERR(46, 4207, __pyx_L1_error);
      }
    }
    __Pyx_DECREF_SET(__pyx_v_submats, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Mat.pyx":4208
 *         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":4209
 *             submats = [None] * n
 *             for i from 0 <= i < n:
 *                 submats[i] = mat = Mat()             # <<<<<<<<<<<<<<
 *                 mat.mat = cmats[i]
 *         CHKERR(MatDestroyMatrices(<PetscInt>n, &cmats))
*/
      __pyx_t_3 = NULL;
      __pyx_t_9 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4209, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_2);
      }
      if (unlikely((__Pyx_SetItemInt(__pyx_v_submats, __pyx_v_i, __pyx_t_2, Py_ssize_t, 1, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument) < 0))) __PYX_ERR(46, 4209, __pyx_L1_error)
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_mat, ((struct PyPetscMatObject *)__pyx_t_2));
      __Pyx_DECREF((PyObject *)__pyx_t_2); __pyx_t_2 = 0;

      /* "petsc4py/PETSc/Mat.pyx":4210
 *             for i from 0 <= i < n:
 *                 submats[i] = mat = Mat()
 *                 mat.mat = cmats[i]             # <<<<<<<<<<<<<<
 *         CHKERR(MatDestroyMatrices(<PetscInt>n, &cmats))
 *         return submats
*/
      __pyx_v_mat->mat = (__pyx_v_cmats[__pyx_v_i]);
    }

    /* "petsc4py/PETSc/Mat.pyx":4206
 *         CHKERR(MatCreateSubMatrices(self.mat, <PetscInt>n, cisrows, ciscols, reuse, &cmats))
 *         for i from 0 <= i < n: CHKERR(PetscINCREF(<PetscObject*>&cmats[i]))
 *         if reuse == MAT_INITIAL_MATRIX:             # <<<<<<<<<<<<<<
 *             submats = [None] * n
 *             for i from 0 <= i < n:
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":4211
 *                 submats[i] = mat = Mat()
 *                 mat.mat = cmats[i]
 *         CHKERR(MatDestroyMatrices(<PetscInt>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, 4211, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4212
 *                 mat.mat = cmats[i]
 *         CHKERR(MatDestroyMatrices(<PetscInt>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":4159
 *         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((PyObject *)__pyx_v_mat);
  __Pyx_XDECREF(__pyx_v_unused1);
  __Pyx_XDECREF(__pyx_v_unused2);
  __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":4216
 *     #
 * 
 *     def createSchurComplement(self, Mat A00, Mat Ap00, Mat A01, Mat A10, Mat A11=None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.SCHURCOMPLEMENT` matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_351createSchurComplement(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_350createSchurComplement, "Mat.createSchurComplement(self, A00: Mat, Ap00: Mat, A01: Mat, A10: Mat, A11: Mat | None = None) -> Self\nCreate a `Type.SCHURCOMPLEMENT` matrix.\n\n        Collective.\n\n        Parameters\n        ----------\n        A00\n            the upper-left block of the original matrix A = [A00 A01; A10 A11].\n        Ap00\n            used to construct the preconditioner used in ksp(A00,Ap00) to\n            approximate the action of A00^{-1}.\n        A01\n            the upper-right block of the original matrix A = [A00 A01; A10 A11].\n        A10\n            the lower-left block of the original matrix A = [A00 A01; A10 A11].\n        A11\n            Optional lower-right block of the original matrix\n            A = [A00 A01; A10 A11].\n\n        See Also\n        --------\n        petsc.MatCreateSchurComplement\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:4216");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_351createSchurComplement = {"createSchurComplement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_351createSchurComplement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_350createSchurComplement};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_351createSchurComplement(PyObject *__pyx_v_self, 
#if 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_A00 = 0;
  struct PyPetscMatObject *__pyx_v_Ap00 = 0;
  struct PyPetscMatObject *__pyx_v_A01 = 0;
  struct PyPetscMatObject *__pyx_v_A10 = 0;
  struct PyPetscMatObject *__pyx_v_A11 = 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("createSchurComplement (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A00,&__pyx_mstate_global->__pyx_n_u_Ap00,&__pyx_mstate_global->__pyx_n_u_A01,&__pyx_mstate_global->__pyx_n_u_A10,&__pyx_mstate_global->__pyx_n_u_A11,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4216, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 4216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 4216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createSchurComplement", 0) < (0)) __PYX_ERR(46, 4216, __pyx_L3_error)
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createSchurComplement", 0, 4, 5, i); __PYX_ERR(46, 4216, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(46, 4216, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 4216, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4216, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4216, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4216, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __pyx_v_A00 = ((struct PyPetscMatObject *)values[0]);
    __pyx_v_Ap00 = ((struct PyPetscMatObject *)values[1]);
    __pyx_v_A01 = ((struct PyPetscMatObject *)values[2]);
    __pyx_v_A10 = ((struct PyPetscMatObject *)values[3]);
    __pyx_v_A11 = ((struct PyPetscMatObject *)values[4]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createSchurComplement", 0, 4, 5, __pyx_nargs); __PYX_ERR(46, 4216, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSchurComplement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A00), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "A00", 0))) __PYX_ERR(46, 4216, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Ap00), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "Ap00", 0))) __PYX_ERR(46, 4216, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A01), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "A01", 0))) __PYX_ERR(46, 4216, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A10), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "A10", 0))) __PYX_ERR(46, 4216, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A11), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A11", 0))) __PYX_ERR(46, 4216, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_350createSchurComplement(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_A00, __pyx_v_Ap00, __pyx_v_A01, __pyx_v_A10, __pyx_v_A11);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_350createSchurComplement(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_A00, struct PyPetscMatObject *__pyx_v_Ap00, struct PyPetscMatObject *__pyx_v_A01, struct PyPetscMatObject *__pyx_v_A10, struct PyPetscMatObject *__pyx_v_A11) {
  Mat __pyx_v_newmat;
  Mat __pyx_v_A11_mat;
  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("createSchurComplement", 0);

  /* "petsc4py/PETSc/Mat.pyx":4241
 * 
 *         """
 *         cdef PetscMat newmat = NULL, A11_mat = NULL             # <<<<<<<<<<<<<<
 *         if A11 is not None:
 *             A11_mat = A11.mat
*/
  __pyx_v_newmat = NULL;
  __pyx_v_A11_mat = NULL;

  /* "petsc4py/PETSc/Mat.pyx":4242
 *         """
 *         cdef PetscMat newmat = NULL, A11_mat = NULL
 *         if A11 is not None:             # <<<<<<<<<<<<<<
 *             A11_mat = A11.mat
 *         CHKERR(MatCreateSchurComplement(A00.mat, Ap00.mat, A01.mat, A10.mat, A11_mat, &newmat))
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_A11) != Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Mat.pyx":4243
 *         cdef PetscMat newmat = NULL, A11_mat = NULL
 *         if A11 is not None:
 *             A11_mat = A11.mat             # <<<<<<<<<<<<<<
 *         CHKERR(MatCreateSchurComplement(A00.mat, Ap00.mat, A01.mat, A10.mat, A11_mat, &newmat))
 *         CHKERR(PetscCLEAR(self.obj)); self.mat = newmat
*/
    __pyx_t_2 = __pyx_v_A11->mat;
    __pyx_v_A11_mat = __pyx_t_2;

    /* "petsc4py/PETSc/Mat.pyx":4242
 *         """
 *         cdef PetscMat newmat = NULL, A11_mat = NULL
 *         if A11 is not None:             # <<<<<<<<<<<<<<
 *             A11_mat = A11.mat
 *         CHKERR(MatCreateSchurComplement(A00.mat, Ap00.mat, A01.mat, A10.mat, A11_mat, &newmat))
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":4244
 *         if A11 is not None:
 *             A11_mat = A11.mat
 *         CHKERR(MatCreateSchurComplement(A00.mat, Ap00.mat, A01.mat, A10.mat, A11_mat, &newmat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscCLEAR(self.obj)); self.mat = newmat
 *         return self
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatCreateSchurComplement(__pyx_v_A00->mat, __pyx_v_Ap00->mat, __pyx_v_A01->mat, __pyx_v_A10->mat, __pyx_v_A11_mat, (&__pyx_v_newmat))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4244, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4245
 *             A11_mat = A11.mat
 *         CHKERR(MatCreateSchurComplement(A00.mat, Ap00.mat, A01.mat, A10.mat, A11_mat, &newmat))
 *         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, 4245, __pyx_L1_error)
  __pyx_v_self->mat = __pyx_v_newmat;

  /* "petsc4py/PETSc/Mat.pyx":4246
 *         CHKERR(MatCreateSchurComplement(A00.mat, Ap00.mat, A01.mat, A10.mat, A11_mat, &newmat))
 *         CHKERR(PetscCLEAR(self.obj)); self.mat = newmat
 *         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":4216
 *     #
 * 
 *     def createSchurComplement(self, Mat A00, Mat Ap00, Mat A01, Mat A10, Mat A11=None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.SCHURCOMPLEMENT` matrix.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.createSchurComplement", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":4250
 *     #
 * 
 *     def getSchurComplementSubMatrices(self) -> tuple[Mat, Mat, Mat, Mat, Mat]:             # <<<<<<<<<<<<<<
 *         """Return Schur complement sub-matrices.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_353getSchurComplementSubMatrices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_352getSchurComplementSubMatrices, "Mat.getSchurComplementSubMatrices(self) -> tuple[Mat, Mat, Mat, Mat, Mat]\nReturn Schur complement sub-matrices.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.MatSchurComplementGetSubMatrices\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:4250");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_353getSchurComplementSubMatrices = {"getSchurComplementSubMatrices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_353getSchurComplementSubMatrices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_352getSchurComplementSubMatrices};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_353getSchurComplementSubMatrices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getSchurComplementSubMatrices (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSchurComplementSubMatrices", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSchurComplementSubMatrices", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_352getSchurComplementSubMatrices(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_352getSchurComplementSubMatrices(struct PyPetscMatObject *__pyx_v_self) {
  struct PyPetscMatObject *__pyx_v_A00 = 0;
  struct PyPetscMatObject *__pyx_v_Ap00 = 0;
  struct PyPetscMatObject *__pyx_v_A01 = 0;
  struct PyPetscMatObject *__pyx_v_A10 = 0;
  struct PyPetscMatObject *__pyx_v_A11 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getSchurComplementSubMatrices", 0);

  /* "petsc4py/PETSc/Mat.pyx":4260
 * 
 *         """
 *         cdef Mat A00 = Mat(), Ap00 = Mat(), A01 = Mat(), A10 = Mat(), A11 = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(MatSchurComplementGetSubMatrices(self.mat, &A00.mat, &Ap00.mat, &A01.mat, &A10.mat, &A11.mat))
 *         CHKERR(PetscINCREF(A00.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4260, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_A00 = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4260, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_Ap00 = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4260, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_A01 = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4260, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_A10 = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4260, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_A11 = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4261
 *         """
 *         cdef Mat A00 = Mat(), Ap00 = Mat(), A01 = Mat(), A10 = Mat(), A11 = Mat()
 *         CHKERR(MatSchurComplementGetSubMatrices(self.mat, &A00.mat, &Ap00.mat, &A01.mat, &A10.mat, &A11.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(A00.obj))
 *         CHKERR(PetscINCREF(Ap00.obj))
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatSchurComplementGetSubMatrices(__pyx_v_self->mat, (&__pyx_v_A00->mat), (&__pyx_v_Ap00->mat), (&__pyx_v_A01->mat), (&__pyx_v_A10->mat), (&__pyx_v_A11->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4261, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4262
 *         cdef Mat A00 = Mat(), Ap00 = Mat(), A01 = Mat(), A10 = Mat(), A11 = Mat()
 *         CHKERR(MatSchurComplementGetSubMatrices(self.mat, &A00.mat, &Ap00.mat, &A01.mat, &A10.mat, &A11.mat))
 *         CHKERR(PetscINCREF(A00.obj))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(Ap00.obj))
 *         CHKERR(PetscINCREF(A01.obj))
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_A00->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4262, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4263
 *         CHKERR(MatSchurComplementGetSubMatrices(self.mat, &A00.mat, &Ap00.mat, &A01.mat, &A10.mat, &A11.mat))
 *         CHKERR(PetscINCREF(A00.obj))
 *         CHKERR(PetscINCREF(Ap00.obj))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(A01.obj))
 *         CHKERR(PetscINCREF(A10.obj))
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Ap00->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4263, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4264
 *         CHKERR(PetscINCREF(A00.obj))
 *         CHKERR(PetscINCREF(Ap00.obj))
 *         CHKERR(PetscINCREF(A01.obj))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(A10.obj))
 *         CHKERR(PetscINCREF(A11.obj))
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_A01->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4264, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4265
 *         CHKERR(PetscINCREF(Ap00.obj))
 *         CHKERR(PetscINCREF(A01.obj))
 *         CHKERR(PetscINCREF(A10.obj))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(A11.obj))
 *         return A00, Ap00, A01, A10, A11
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_A10->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4265, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4266
 *         CHKERR(PetscINCREF(A01.obj))
 *         CHKERR(PetscINCREF(A10.obj))
 *         CHKERR(PetscINCREF(A11.obj))             # <<<<<<<<<<<<<<
 *         return A00, Ap00, A01, A10, A11
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_A11->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4266, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4267
 *         CHKERR(PetscINCREF(A10.obj))
 *         CHKERR(PetscINCREF(A11.obj))
 *         return A00, Ap00, A01, A10, A11             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_A00);
  __Pyx_GIVEREF((PyObject *)__pyx_v_A00);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_A00)) != (0)) __PYX_ERR(46, 4267, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_Ap00);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Ap00);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_Ap00)) != (0)) __PYX_ERR(46, 4267, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_A01);
  __Pyx_GIVEREF((PyObject *)__pyx_v_A01);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_A01)) != (0)) __PYX_ERR(46, 4267, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_A10);
  __Pyx_GIVEREF((PyObject *)__pyx_v_A10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_A10)) != (0)) __PYX_ERR(46, 4267, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_A11);
  __Pyx_GIVEREF((PyObject *)__pyx_v_A11);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_A11)) != (0)) __PYX_ERR(46, 4267, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":4250
 *     #
 * 
 *     def getSchurComplementSubMatrices(self) -> tuple[Mat, Mat, Mat, Mat, Mat]:             # <<<<<<<<<<<<<<
 *         """Return Schur complement sub-matrices.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.getSchurComplementSubMatrices", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_A00);
  __Pyx_XDECREF((PyObject *)__pyx_v_Ap00);
  __Pyx_XDECREF((PyObject *)__pyx_v_A01);
  __Pyx_XDECREF((PyObject *)__pyx_v_A10);
  __Pyx_XDECREF((PyObject *)__pyx_v_A11);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":4271
 *     #
 * 
 *     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_355getLocalSubMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_354getLocalSubMatrix, "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:4271");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_355getLocalSubMatrix = {"getLocalSubMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_355getLocalSubMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_354getLocalSubMatrix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_355getLocalSubMatrix(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isrow,&__pyx_mstate_global->__pyx_n_u_iscol,&__pyx_mstate_global->__pyx_n_u_submat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4271, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4271, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4271, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4271, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getLocalSubMatrix", 0) < (0)) __PYX_ERR(46, 4271, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getLocalSubMatrix", 0, 2, 3, i); __PYX_ERR(46, 4271, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4271, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4271, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4271, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 4271, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 4271, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(46, 4271, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_submat), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "submat", 0))) __PYX_ERR(46, 4271, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_354getLocalSubMatrix(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_354getLocalSubMatrix(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  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":4292
 * 
 *         """
 *         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_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4292, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__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":4293
 *         """
 *         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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDestroy((&__pyx_v_submat->mat))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4293, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Mat.pyx":4294
 *         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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4294, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4295
 *         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) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_submat);
  __pyx_r = ((PyObject *)__pyx_v_submat);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":4271
 *     #
 * 
 *     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_XDECREF(__pyx_t_3);
  __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":4297
 *         return submat
 * 
 *     def restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat) -> None:             # <<<<<<<<<<<<<<
 *         """Restore a reference to a submatrix obtained with `getLocalSubMatrix`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_357restoreLocalSubMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_356restoreLocalSubMatrix, "Mat.restoreLocalSubMatrix(self, isrow: IS, iscol: IS, submat: Mat) -> None\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:4297");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_357restoreLocalSubMatrix = {"restoreLocalSubMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_357restoreLocalSubMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_356restoreLocalSubMatrix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_357restoreLocalSubMatrix(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isrow,&__pyx_mstate_global->__pyx_n_u_iscol,&__pyx_mstate_global->__pyx_n_u_submat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4297, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4297, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4297, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4297, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "restoreLocalSubMatrix", 0) < (0)) __PYX_ERR(46, 4297, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("restoreLocalSubMatrix", 1, 3, 3, i); __PYX_ERR(46, 4297, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4297, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4297, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4297, __pyx_L3_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("restoreLocalSubMatrix", 1, 3, 3, __pyx_nargs); __PYX_ERR(46, 4297, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 4297, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(46, 4297, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_submat), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "submat", 0))) __PYX_ERR(46, 4297, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_356restoreLocalSubMatrix(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_356restoreLocalSubMatrix(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4316
 * 
 *         """
 *         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, 4316, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4297
 *         return submat
 * 
 *     def restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat) -> None:             # <<<<<<<<<<<<<<
 *         """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":4320
 *     #
 * 
 *     def norm(             # <<<<<<<<<<<<<<
 *         self,
 *         norm_type: NormTypeSpec = None) -> float | tuple[float, float]:
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_359norm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_358norm, "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:4320");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_359norm = {"norm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_359norm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_358norm};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_359norm(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_norm_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4320, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4320, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "norm", 0) < (0)) __PYX_ERR(46, 4320, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":4322
 *     def norm(
 *         self,
 *         norm_type: NormTypeSpec = None) -> float | tuple[float, float]:             # <<<<<<<<<<<<<<
 *         """Compute the requested matrix norm.
 * 
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4320, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4320, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_358norm(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_norm_type);

  /* "petsc4py/PETSc/Mat.pyx":4320
 *     #
 * 
 *     def norm(             # <<<<<<<<<<<<<<
 *         self,
 *         norm_type: NormTypeSpec = None) -> float | tuple[float, float]:
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_358norm(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4334
 * 
 *         """
 *         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":4335
 *         """
 *         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":4336
 *         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_PyLong_As_NormType(__pyx_v_norm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 4336, __pyx_L1_error)
    __pyx_v_ntype = __pyx_t_2;
  }

  /* "petsc4py/PETSc/Mat.pyx":4338
 *         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, 4338, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4339
 *         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, 4339, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/Mat.pyx":4340
 *         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, 4340, __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, 4340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(46, 4340, __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) != (0)) __PYX_ERR(46, 4340, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5) != (0)) __PYX_ERR(46, 4340, __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":4320
 *     #
 * 
 *     def norm(             # <<<<<<<<<<<<<<
 *         self,
 *         norm_type: NormTypeSpec = None) -> float | tuple[float, float]:
*/

  /* 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":4342
 *         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_361scale(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_360scale, "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:4342");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_361scale = {"scale", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_361scale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_360scale};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_361scale(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_alpha,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4342, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scale", 0) < (0)) __PYX_ERR(46, 4342, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scale", 1, 1, 1, i); __PYX_ERR(46, 4342, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4342, __pyx_L3_error)
    }
    __pyx_v_alpha = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scale", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 4342, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_360scale(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_alpha);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_360scale(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4352
 * 
 *         """
 *         cdef PetscScalar sval = asScalar(alpha)             # <<<<<<<<<<<<<<
 *         CHKERR(MatScale(self.mat, sval))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(46, 4352, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":4353
 *         """
 *         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, 4353, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4342
 *         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":4355
 *         CHKERR(MatScale(self.mat, sval))
 * 
 *     def shift(self, alpha: Scalar) -> None:             # <<<<<<<<<<<<<<
 *         """Shift the matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_363shift(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_362shift, "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:4355");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_363shift = {"shift", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_363shift, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_362shift};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_363shift(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_alpha,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4355, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4355, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "shift", 0) < (0)) __PYX_ERR(46, 4355, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("shift", 1, 1, 1, i); __PYX_ERR(46, 4355, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4355, __pyx_L3_error)
    }
    __pyx_v_alpha = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("shift", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 4355, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_362shift(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_alpha);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_362shift(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4365
 * 
 *         """
 *         cdef PetscScalar sval = asScalar(alpha)             # <<<<<<<<<<<<<<
 *         CHKERR(MatShift(self.mat, sval))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_alpha); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(46, 4365, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":4366
 *         """
 *         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, 4366, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4355
 *         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":4368
 *         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_365chop(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_364chop, "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:4368");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_365chop = {"chop", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_365chop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_364chop};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_365chop(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4368, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "chop", 0) < (0)) __PYX_ERR(46, 4368, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("chop", 1, 1, 1, i); __PYX_ERR(46, 4368, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4368, __pyx_L3_error)
    }
    __pyx_v_tol = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("chop", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 4368, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_364chop(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_tol);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_364chop(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4378
 * 
 *         """
 *         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, 4378, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":4379
 *         """
 *         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, 4379, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4368
 *         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":4381
 *         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_367setRandom(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_366setRandom, "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:4381");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_367setRandom = {"setRandom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_367setRandom, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_366setRandom};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_367setRandom(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_random,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4381, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRandom", 0) < (0)) __PYX_ERR(46, 4381, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscRandomObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4381, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscRandomObject *)Py_None));
    }
    __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, 4381, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random, 1, "random", 0))) __PYX_ERR(46, 4381, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_366setRandom(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_random);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_366setRandom(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4396
 * 
 *         """
 *         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":4397
 *         """
 *         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":4398
 *         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) -> 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, 4398, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4381
 *         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":4400
 *         CHKERR(MatSetRandom(self.mat, rnd))
 * 
 *     def axpy(self, alpha: Scalar, Mat X, structure: Structure | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Perform the matrix summation ``self`` + = X.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_369axpy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_368axpy, "Mat.axpy(self, alpha: Scalar, X: Mat, structure: Structure | None = 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:4400");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_369axpy = {"axpy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_369axpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_368axpy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_369axpy(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_X,&__pyx_mstate_global->__pyx_n_u_structure,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4400, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4400, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4400, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4400, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "axpy", 0) < (0)) __PYX_ERR(46, 4400, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("axpy", 0, 2, 3, i); __PYX_ERR(46, 4400, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4400, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4400, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4400, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4400, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(46, 4400, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_368axpy(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_368axpy(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4419
 * 
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(46, 4419, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":4420
 *         """
 *         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, 4420, __pyx_L1_error)
  __pyx_v_flag = __pyx_t_2;

  /* "petsc4py/PETSc/Mat.pyx":4421
 *         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) -> 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, 4421, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4400
 *         CHKERR(MatSetRandom(self.mat, rnd))
 * 
 *     def axpy(self, alpha: Scalar, Mat X, structure: Structure | None = 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":4423
 *         CHKERR(MatAXPY(self.mat, sval, X.mat, flag))
 * 
 *     def aypx(self, alpha: Scalar, Mat X, structure: Structure | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Perform the matrix summation ``self`` = ``self`` + X.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_371aypx(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_370aypx, "Mat.aypx(self, alpha: Scalar, X: Mat, structure: Structure | None = 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:4423");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_371aypx = {"aypx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_371aypx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_370aypx};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_371aypx(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_X,&__pyx_mstate_global->__pyx_n_u_structure,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4423, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4423, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4423, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4423, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "aypx", 0) < (0)) __PYX_ERR(46, 4423, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("aypx", 0, 2, 3, i); __PYX_ERR(46, 4423, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4423, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4423, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4423, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4423, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(46, 4423, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_370aypx(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_370aypx(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4442
 * 
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(46, 4442, __pyx_L1_error)
  __pyx_v_sval = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":4443
 *         """
 *         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, 4443, __pyx_L1_error)
  __pyx_v_flag = __pyx_t_2;

  /* "petsc4py/PETSc/Mat.pyx":4444
 *         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, 4444, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4423
 *         CHKERR(MatAXPY(self.mat, sval, X.mat, flag))
 * 
 *     def aypx(self, alpha: Scalar, Mat X, structure: Structure | None = 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":4448
 *     # matrix-matrix product
 * 
 *     def matMult(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat mat,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_373matMult(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_372matMult, "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:4448");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_373matMult = {"matMult", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_373matMult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_372matMult};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_373matMult(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,&__pyx_mstate_global->__pyx_n_u_result,&__pyx_mstate_global->__pyx_n_u_fill,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4448, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4448, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4448, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4448, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "matMult", 0) < (0)) __PYX_ERR(46, 4448, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":4451
 *         self,
 *         Mat mat,
 *         Mat result=None,             # <<<<<<<<<<<<<<
 *         fill: float | None = None) -> Mat:
 *         """Perform matrix-matrix multiplication C=AB.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":4452
 *         Mat mat,
 *         Mat result=None,
 *         fill: float | None = None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Perform matrix-matrix multiplication C=AB.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("matMult", 0, 1, 3, i); __PYX_ERR(46, 4448, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4448, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4448, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4448, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":4451
 *         self,
 *         Mat mat,
 *         Mat result=None,             # <<<<<<<<<<<<<<
 *         fill: float | None = None) -> Mat:
 *         """Perform matrix-matrix multiplication C=AB.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":4452
 *         Mat mat,
 *         Mat result=None,
 *         fill: float | None = None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Perform matrix-matrix multiplication C=AB.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4448, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 4450, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(46, 4451, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_372matMult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_result, __pyx_v_fill);

  /* "petsc4py/PETSc/Mat.pyx":4448
 *     # matrix-matrix product
 * 
 *     def matMult(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat mat,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_372matMult(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscReal __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  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":4485
 * 
 *         """
 *         cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX             # <<<<<<<<<<<<<<
 *         cdef PetscReal rval = 2
 *         if result is None:
*/
  __pyx_v_reuse = MAT_INITIAL_MATRIX;

  /* "petsc4py/PETSc/Mat.pyx":4486
 *         """
 *         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":4487
 *         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":4488
 *         cdef PetscReal rval = 2
 *         if result is None:
 *             result = Mat()             # <<<<<<<<<<<<<<
 *         elif result.mat != NULL:
 *             reuse = MAT_REUSE_MATRIX
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4488, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Mat.pyx":4487
 *         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":4489
 *         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":4490
 *             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":4489
 *         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":4491
 *         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_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 4491, __pyx_L1_error)
    __pyx_v_rval = __pyx_t_5;
  }

  /* "petsc4py/PETSc/Mat.pyx":4492
 *             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_6 = __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_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4492, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4493
 *         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":4448
 *     # matrix-matrix product
 * 
 *     def matMult(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat mat,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __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":4495
 *         return result
 * 
 *     def matTransposeMult(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat mat,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_375matTransposeMult(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_374matTransposeMult, "Mat.matTransposeMult(self, mat: Mat, result: Mat | None = None, fill: float | None = None) -> Mat\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:4495");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_375matTransposeMult = {"matTransposeMult", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_375matTransposeMult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_374matTransposeMult};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_375matTransposeMult(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,&__pyx_mstate_global->__pyx_n_u_result,&__pyx_mstate_global->__pyx_n_u_fill,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4495, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "matTransposeMult", 0) < (0)) __PYX_ERR(46, 4495, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":4498
 *         self,
 *         Mat mat,
 *         Mat result=None,             # <<<<<<<<<<<<<<
 *         fill: float | None = None) -> Mat:
 *         """Perform matrix-matrix multiplication C=AB.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":4499
 *         Mat mat,
 *         Mat result=None,
 *         fill: float | None = None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Perform matrix-matrix multiplication C=AB.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("matTransposeMult", 0, 1, 3, i); __PYX_ERR(46, 4495, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4495, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":4498
 *         self,
 *         Mat mat,
 *         Mat result=None,             # <<<<<<<<<<<<<<
 *         fill: float | None = None) -> Mat:
 *         """Perform matrix-matrix multiplication C=AB.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":4499
 *         Mat mat,
 *         Mat result=None,
 *         fill: float | None = None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Perform matrix-matrix multiplication C=AB.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4495, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 4497, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(46, 4498, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_374matTransposeMult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_result, __pyx_v_fill);

  /* "petsc4py/PETSc/Mat.pyx":4495
 *         return result
 * 
 *     def matTransposeMult(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat mat,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_374matTransposeMult(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscReal __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  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":4532
 * 
 *         """
 *         cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX             # <<<<<<<<<<<<<<
 *         cdef PetscReal rval = 2
 *         if result is None:
*/
  __pyx_v_reuse = MAT_INITIAL_MATRIX;

  /* "petsc4py/PETSc/Mat.pyx":4533
 *         """
 *         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":4534
 *         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":4535
 *         cdef PetscReal rval = 2
 *         if result is None:
 *             result = Mat()             # <<<<<<<<<<<<<<
 *         elif result.mat != NULL:
 *             reuse = MAT_REUSE_MATRIX
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4535, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Mat.pyx":4534
 *         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":4536
 *         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":4537
 *             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":4536
 *         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":4538
 *         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_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 4538, __pyx_L1_error)
    __pyx_v_rval = __pyx_t_5;
  }

  /* "petsc4py/PETSc/Mat.pyx":4539
 *             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_6 = __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_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4539, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4540
 *         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":4495
 *         return result
 * 
 *     def matTransposeMult(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat mat,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __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":4542
 *         return result
 * 
 *     def transposeMatMult(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat mat,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_377transposeMatMult(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_376transposeMatMult, "Mat.transposeMatMult(self, mat: Mat, result: Mat | None = None, fill: float | None = None) -> Mat\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:4542");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_377transposeMatMult = {"transposeMatMult", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_377transposeMatMult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_376transposeMatMult};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_377transposeMatMult(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,&__pyx_mstate_global->__pyx_n_u_result,&__pyx_mstate_global->__pyx_n_u_fill,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4542, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4542, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4542, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4542, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "transposeMatMult", 0) < (0)) __PYX_ERR(46, 4542, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":4545
 *         self,
 *         Mat mat,
 *         Mat result=None,             # <<<<<<<<<<<<<<
 *         fill: float | None = None) -> Mat:
 *         """Perform matrix-matrix multiplication C=AB.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":4546
 *         Mat mat,
 *         Mat result=None,
 *         fill: float | None = None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Perform matrix-matrix multiplication C=AB.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("transposeMatMult", 0, 1, 3, i); __PYX_ERR(46, 4542, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4542, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4542, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4542, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":4545
 *         self,
 *         Mat mat,
 *         Mat result=None,             # <<<<<<<<<<<<<<
 *         fill: float | None = None) -> Mat:
 *         """Perform matrix-matrix multiplication C=AB.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":4546
 *         Mat mat,
 *         Mat result=None,
 *         fill: float | None = None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Perform matrix-matrix multiplication C=AB.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4542, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 4544, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(46, 4545, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_376transposeMatMult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_result, __pyx_v_fill);

  /* "petsc4py/PETSc/Mat.pyx":4542
 *         return result
 * 
 *     def transposeMatMult(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat mat,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_376transposeMatMult(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscReal __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  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":4579
 * 
 *         """
 *         cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX             # <<<<<<<<<<<<<<
 *         cdef PetscReal rval = 2
 *         if result is None:
*/
  __pyx_v_reuse = MAT_INITIAL_MATRIX;

  /* "petsc4py/PETSc/Mat.pyx":4580
 *         """
 *         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":4581
 *         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":4582
 *         cdef PetscReal rval = 2
 *         if result is None:
 *             result = Mat()             # <<<<<<<<<<<<<<
 *         elif result.mat != NULL:
 *             reuse = MAT_REUSE_MATRIX
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4582, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Mat.pyx":4581
 *         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":4583
 *         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":4584
 *             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":4583
 *         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":4585
 *         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_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 4585, __pyx_L1_error)
    __pyx_v_rval = __pyx_t_5;
  }

  /* "petsc4py/PETSc/Mat.pyx":4586
 *             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_6 = __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_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4586, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4587
 *         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":4542
 *         return result
 * 
 *     def transposeMatMult(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat mat,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __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":4589
 *         return result
 * 
 *     def ptap(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat P,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_379ptap(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_378ptap, "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:4589");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_379ptap = {"ptap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_379ptap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_378ptap};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_379ptap(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_result,&__pyx_mstate_global->__pyx_n_u_fill,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4589, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4589, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4589, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4589, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "ptap", 0) < (0)) __PYX_ERR(46, 4589, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":4592
 *         self,
 *         Mat P,
 *         Mat result=None,             # <<<<<<<<<<<<<<
 *         fill: float | None = None) -> Mat:
 *         """Creates the matrix product C = PAP.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":4593
 *         Mat P,
 *         Mat result=None,
 *         fill: float | None = None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Creates the matrix product C = PAP.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("ptap", 0, 1, 3, i); __PYX_ERR(46, 4589, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4589, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4589, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4589, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":4592
 *         self,
 *         Mat P,
 *         Mat result=None,             # <<<<<<<<<<<<<<
 *         fill: float | None = None) -> Mat:
 *         """Creates the matrix product C = PAP.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":4593
 *         Mat P,
 *         Mat result=None,
 *         fill: float | None = None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Creates the matrix product C = PAP.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4589, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "P", 0))) __PYX_ERR(46, 4591, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(46, 4592, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_378ptap(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_P, __pyx_v_result, __pyx_v_fill);

  /* "petsc4py/PETSc/Mat.pyx":4589
 *         return result
 * 
 *     def ptap(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat P,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_378ptap(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscReal __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  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":4630
 * 
 *         """
 *         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":4631
 *         """
 *         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":4632
 *         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":4633
 *         cdef PetscReal cfill = PETSC_DEFAULT
 *         if result is None:
 *             result = Mat()             # <<<<<<<<<<<<<<
 *         elif result.mat != NULL:
 *             reuse = MAT_REUSE_MATRIX
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4633, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Mat.pyx":4632
 *         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":4634
 *         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":4635
 *             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":4634
 *         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":4636
 *         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_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 4636, __pyx_L1_error)
    __pyx_v_cfill = __pyx_t_5;
  }

  /* "petsc4py/PETSc/Mat.pyx":4637
 *             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_6 = __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_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4637, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4638
 *         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":4589
 *         return result
 * 
 *     def ptap(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat P,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __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":4640
 *         return result
 * 
 *     def rart(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat R,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_381rart(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_380rart, "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:4640");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_381rart = {"rart", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_381rart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_380rart};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_381rart(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_result,&__pyx_mstate_global->__pyx_n_u_fill,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4640, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4640, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4640, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4640, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "rart", 0) < (0)) __PYX_ERR(46, 4640, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":4643
 *         self,
 *         Mat R,
 *         Mat result=None,             # <<<<<<<<<<<<<<
 *         fill: float | None = None) -> Mat:
 *         """Create the matrix product C = RAR.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":4644
 *         Mat R,
 *         Mat result=None,
 *         fill: float | None = None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Create the matrix product C = RAR.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("rart", 0, 1, 3, i); __PYX_ERR(46, 4640, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4640, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4640, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4640, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":4643
 *         self,
 *         Mat R,
 *         Mat result=None,             # <<<<<<<<<<<<<<
 *         fill: float | None = None) -> Mat:
 *         """Create the matrix product C = RAR.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":4644
 *         Mat R,
 *         Mat result=None,
 *         fill: float | None = None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Create the matrix product C = RAR.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4640, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "R", 0))) __PYX_ERR(46, 4642, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(46, 4643, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_380rart(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_R, __pyx_v_result, __pyx_v_fill);

  /* "petsc4py/PETSc/Mat.pyx":4640
 *         return result
 * 
 *     def rart(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat R,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_380rart(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscReal __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  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":4677
 * 
 *         """
 *         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":4678
 *         """
 *         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":4679
 *         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":4680
 *         cdef PetscReal cfill = PETSC_DEFAULT
 *         if result is None:
 *             result = Mat()             # <<<<<<<<<<<<<<
 *         elif result.mat != NULL:
 *             reuse = MAT_REUSE_MATRIX
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4680, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Mat.pyx":4679
 *         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":4681
 *         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":4682
 *             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":4681
 *         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":4683
 *         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_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 4683, __pyx_L1_error)
    __pyx_v_cfill = __pyx_t_5;
  }

  /* "petsc4py/PETSc/Mat.pyx":4684
 *             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_6 = __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_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4684, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4685
 *         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":4640
 *         return result
 * 
 *     def rart(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat R,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __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":4687
 *         return result
 * 
 *     def matMatMult(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat B,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_383matMatMult(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_382matMatMult, "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:4687");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_383matMatMult = {"matMatMult", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_383matMatMult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_382matMatMult};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_383matMatMult(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_C,&__pyx_mstate_global->__pyx_n_u_result,&__pyx_mstate_global->__pyx_n_u_fill,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4687, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 4687, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4687, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4687, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4687, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "matMatMult", 0) < (0)) __PYX_ERR(46, 4687, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":4691
 *         Mat B,
 *         Mat C,
 *         Mat result=None,             # <<<<<<<<<<<<<<
 *         fill: float | None = None) -> Mat:
 *         """Perform matrix-matrix-matrix multiplication D=ABC.
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":4692
 *         Mat C,
 *         Mat result=None,
 *         fill: float | None = None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Perform matrix-matrix-matrix multiplication D=ABC.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("matMatMult", 0, 2, 4, i); __PYX_ERR(46, 4687, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 4687, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4687, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4687, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4687, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":4691
 *         Mat B,
 *         Mat C,
 *         Mat result=None,             # <<<<<<<<<<<<<<
 *         fill: float | None = None) -> Mat:
 *         """Perform matrix-matrix-matrix multiplication D=ABC.
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":4692
 *         Mat C,
 *         Mat result=None,
 *         fill: float | None = None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Perform matrix-matrix-matrix multiplication D=ABC.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4687, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "B", 0))) __PYX_ERR(46, 4689, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_C), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "C", 0))) __PYX_ERR(46, 4690, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(46, 4691, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_382matMatMult(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_B, __pyx_v_C, __pyx_v_result, __pyx_v_fill);

  /* "petsc4py/PETSc/Mat.pyx":4687
 *         return result
 * 
 *     def matMatMult(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat B,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_382matMatMult(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscReal __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  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":4722
 * 
 *         """
 *         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":4723
 *         """
 *         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":4724
 *         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":4725
 *         cdef PetscReal cfill = PETSC_DEFAULT
 *         if result is None:
 *             result = Mat()             # <<<<<<<<<<<<<<
 *         elif result.mat != NULL:
 *             reuse = MAT_REUSE_MATRIX
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4725, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Mat.pyx":4724
 *         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":4726
 *         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":4727
 *             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":4726
 *         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":4728
 *         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_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_fill); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(46, 4728, __pyx_L1_error)
    __pyx_v_cfill = __pyx_t_5;
  }

  /* "petsc4py/PETSc/Mat.pyx":4729
 *             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_6 = __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_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4729, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4730
 *         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":4687
 *         return result
 * 
 *     def matMatMult(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat B,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __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":4732
 *         return result
 * 
 *     def kron(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat mat,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_385kron(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_384kron, "Mat.kron(self, mat: Mat, result: Mat | None = None) -> Mat\nCompute C, the Kronecker product of A and B.\n\n        Collective.\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:4732");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_385kron = {"kron", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_385kron, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_384kron};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_385kron(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,&__pyx_mstate_global->__pyx_n_u_result,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4732, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4732, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4732, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "kron", 0) < (0)) __PYX_ERR(46, 4732, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":4735
 *         self,
 *         Mat mat,
 *         Mat result=None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Compute C, the Kronecker product of A and B.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("kron", 0, 1, 2, i); __PYX_ERR(46, 4732, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4732, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4732, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 4732, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 4734, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "result", 0))) __PYX_ERR(46, 4735, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_384kron(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_result);

  /* "petsc4py/PETSc/Mat.pyx":4732
 *         return result
 * 
 *     def kron(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat mat,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_384kron(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  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":4759
 * 
 *         """
 *         cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX             # <<<<<<<<<<<<<<
 *         if result is None:
 *             result = Mat()
*/
  __pyx_v_reuse = MAT_INITIAL_MATRIX;

  /* "petsc4py/PETSc/Mat.pyx":4760
 *         """
 *         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":4761
 *         cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
 *         if result is None:
 *             result = Mat()             # <<<<<<<<<<<<<<
 *         elif result.mat != NULL:
 *             reuse = MAT_REUSE_MATRIX
*/
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 4761, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_result, ((struct PyPetscMatObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Mat.pyx":4760
 *         """
 *         cdef PetscMatReuse reuse = MAT_INITIAL_MATRIX
 *         if result is None:             # <<<<<<<<<<<<<<
 *             result = Mat()
 *         elif result.mat != NULL:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Mat.pyx":4762
 *         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":4763
 *             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":4762
 *         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":4764
 *         elif result.mat != NULL:
 *             reuse = MAT_REUSE_MATRIX
 *         CHKERR(MatSeqAIJKron(self.mat, mat.mat, reuse, &result.mat))             # <<<<<<<<<<<<<<
 *         return result
 * 
*/
  __pyx_t_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4764, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4765
 *             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":4732
 *         return result
 * 
 *     def kron(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat mat,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __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":4767
 *         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_387bindToCPU(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_386bindToCPU, "Mat.bindToCPU(self, flg: bool) -> None\nMark a matrix to temporarily stay on the CPU.\n\n        Collective.\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:4767");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_387bindToCPU = {"bindToCPU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_387bindToCPU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_386bindToCPU};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_387bindToCPU(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flg,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4767, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4767, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "bindToCPU", 0) < (0)) __PYX_ERR(46, 4767, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("bindToCPU", 1, 1, 1, i); __PYX_ERR(46, 4767, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4767, __pyx_L3_error)
    }
    __pyx_v_flg = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("bindToCPU", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 4767, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_386bindToCPU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_flg);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_386bindToCPU(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4784
 * 
 *         """
 *         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, 4784, __pyx_L1_error)
  __pyx_v_bindFlg = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":4785
 *         """
 *         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, 4785, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4767
 *         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":4787
 *         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_389boundToCPU(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_388boundToCPU, "Mat.boundToCPU(self) -> bool\nQuery if a matrix is bound to the CPU.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.MatBoundToCPU\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:4787");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_389boundToCPU = {"boundToCPU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_389boundToCPU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_388boundToCPU};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_389boundToCPU(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("boundToCPU", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_388boundToCPU(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_388boundToCPU(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4797
 * 
 *         """
 *         cdef PetscBool flg = PETSC_TRUE             # <<<<<<<<<<<<<<
 *         CHKERR(MatBoundToCPU(self.mat, &flg))
 *         return toBool(flg)
*/
  __pyx_v_flg = PETSC_TRUE;

  /* "petsc4py/PETSc/Mat.pyx":4798
 *         """
 *         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, 4798, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4799
 *         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, 4799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":4787
 *         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":4803
 *     # 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_391getOrdering(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_390getOrdering, "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:4803");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_391getOrdering = {"getOrdering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_391getOrdering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_390getOrdering};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_391getOrdering(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ord_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4803, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4803, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getOrdering", 0) < (0)) __PYX_ERR(46, 4803, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getOrdering", 1, 1, 1, i); __PYX_ERR(46, 4803, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4803, __pyx_L3_error)
    }
    __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, 4803, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_390getOrdering(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_ord_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_390getOrdering(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  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":4825
 * 
 *         """
 *         cdef PetscMatOrderingType cval = NULL             # <<<<<<<<<<<<<<
 *         ord_type = str2bytes(ord_type, &cval)
 *         cdef IS rp = IS(), cp = IS()
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Mat.pyx":4826
 *         """
 *         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, 4826, __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":4827
 *         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_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4827, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_rp = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 4827, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_cp = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4828
 *         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_4 = __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_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 4828, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4829
 *         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, 4829, __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)) != (0)) __PYX_ERR(46, 4829, __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)) != (0)) __PYX_ERR(46, 4829, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":4803
 *     # 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_XDECREF(__pyx_t_2);
  __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":4831
 *         return (rp, cp)
 * 
 *     def reorderForNonzeroDiagonal(             # <<<<<<<<<<<<<<
 *         self,
 *         IS isrow,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_393reorderForNonzeroDiagonal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_392reorderForNonzeroDiagonal, "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:4831");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_393reorderForNonzeroDiagonal = {"reorderForNonzeroDiagonal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_393reorderForNonzeroDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_392reorderForNonzeroDiagonal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_393reorderForNonzeroDiagonal(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isrow,&__pyx_mstate_global->__pyx_n_u_iscol,&__pyx_mstate_global->__pyx_n_u_atol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4831, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4831, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4831, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4831, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "reorderForNonzeroDiagonal", 0) < (0)) __PYX_ERR(46, 4831, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("reorderForNonzeroDiagonal", 0, 2, 3, i); __PYX_ERR(46, 4831, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4831, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4831, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4831, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __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, 4831, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 4833, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(46, 4834, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_392reorderForNonzeroDiagonal(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_392reorderForNonzeroDiagonal(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4855
 * 
 *         """
 *         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, 4855, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":4856
 *         """
 *         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":4857
 *         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, 4857, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4831
 *         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":4859
 *         CHKERR(MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp))
 * 
 *     def factorLU(             # <<<<<<<<<<<<<<
 *         self,
 *         IS isrow,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_395factorLU(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_394factorLU, "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:4859");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_395factorLU = {"factorLU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_395factorLU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_394factorLU};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_395factorLU(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isrow,&__pyx_mstate_global->__pyx_n_u_iscol,&__pyx_mstate_global->__pyx_n_u_options,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4859, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4859, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4859, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4859, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "factorLU", 0) < (0)) __PYX_ERR(46, 4859, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":4863
 *         IS isrow,
 *         IS iscol,
 *         options: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Perform an in-place LU factorization.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("factorLU", 0, 2, 3, i); __PYX_ERR(46, 4859, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4859, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4859, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4859, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4859, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 4861, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(46, 4862, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_394factorLU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_options);

  /* "petsc4py/PETSc/Mat.pyx":4859
 *         CHKERR(MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp))
 * 
 *     def factorLU(             # <<<<<<<<<<<<<<
 *         self,
 *         IS isrow,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_394factorLU(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4886
 *         """
 *         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, 4886, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4887
 *         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, 4887, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4859
 *         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":4889
 *         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_397factorSymbolicLU(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_396factorSymbolicLU, "Mat.factorSymbolicLU(self, mat: Mat, isrow: IS, iscol: IS, options=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Mat.pyx:4889");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_397factorSymbolicLU = {"factorSymbolicLU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_397factorSymbolicLU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_396factorSymbolicLU};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_397factorSymbolicLU(PyObject *__pyx_v_self, 
#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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,&__pyx_mstate_global->__pyx_n_u_isrow,&__pyx_mstate_global->__pyx_n_u_iscol,&__pyx_mstate_global->__pyx_n_u_options,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4889, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 4889, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4889, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4889, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4889, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "factorSymbolicLU", 0) < (0)) __PYX_ERR(46, 4889, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("factorSymbolicLU", 0, 3, 4, i); __PYX_ERR(46, 4889, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 4889, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4889, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4889, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4889, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4889, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 4889, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isrow), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 4889, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(46, 4889, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_396factorSymbolicLU(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_396factorSymbolicLU(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4891
 *     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(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(46, 4891, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4889
 *         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":4893
 *         raise NotImplementedError
 * 
 *     def factorNumericLU(self, Mat mat, options=None) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         raise NotImplementedError
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_399factorNumericLU(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_398factorNumericLU, "Mat.factorNumericLU(self, mat: Mat, options=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Mat.pyx:4893");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_399factorNumericLU = {"factorNumericLU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_399factorNumericLU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_398factorNumericLU};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_399factorNumericLU(PyObject *__pyx_v_self, 
#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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,&__pyx_mstate_global->__pyx_n_u_options,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4893, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4893, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4893, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "factorNumericLU", 0) < (0)) __PYX_ERR(46, 4893, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("factorNumericLU", 0, 1, 2, i); __PYX_ERR(46, 4893, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4893, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4893, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4893, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 4893, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_398factorNumericLU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_options);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_398factorNumericLU(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4895
 *     def factorNumericLU(self, Mat mat, options=None) -> None:
 *         """Not implemented."""
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def factorILU(
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(46, 4895, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4893
 *         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":4897
 *         raise NotImplementedError
 * 
 *     def factorILU(             # <<<<<<<<<<<<<<
 *         self,
 *         IS isrow,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_401factorILU(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_400factorILU, "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:4897");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_401factorILU = {"factorILU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_401factorILU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_400factorILU};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_401factorILU(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isrow,&__pyx_mstate_global->__pyx_n_u_iscol,&__pyx_mstate_global->__pyx_n_u_options,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4897, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4897, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4897, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4897, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "factorILU", 0) < (0)) __PYX_ERR(46, 4897, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":4901
 *         IS isrow,
 *         IS iscol,
 *         options: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Perform an in-place ILU factorization.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("factorILU", 0, 2, 3, i); __PYX_ERR(46, 4897, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4897, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4897, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4897, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4897, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 4899, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(46, 4900, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_400factorILU(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isrow, __pyx_v_iscol, __pyx_v_options);

  /* "petsc4py/PETSc/Mat.pyx":4897
 *         raise NotImplementedError
 * 
 *     def factorILU(             # <<<<<<<<<<<<<<
 *         self,
 *         IS isrow,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_400factorILU(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4924
 *         """
 *         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, 4924, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4925
 *         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, 4925, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4897
 *         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":4927
 *         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_403factorSymbolicILU(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_402factorSymbolicILU, "Mat.factorSymbolicILU(self, isrow: IS, iscol: IS, options=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Mat.pyx:4927");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_403factorSymbolicILU = {"factorSymbolicILU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_403factorSymbolicILU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_402factorSymbolicILU};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_403factorSymbolicILU(PyObject *__pyx_v_self, 
#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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isrow,&__pyx_mstate_global->__pyx_n_u_iscol,&__pyx_mstate_global->__pyx_n_u_options,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4927, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4927, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4927, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4927, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "factorSymbolicILU", 0) < (0)) __PYX_ERR(46, 4927, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("factorSymbolicILU", 0, 2, 3, i); __PYX_ERR(46, 4927, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 4927, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4927, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4927, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4927, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "isrow", 0))) __PYX_ERR(46, 4927, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iscol), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iscol", 0))) __PYX_ERR(46, 4927, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_402factorSymbolicILU(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_402factorSymbolicILU(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4929
 *     def factorSymbolicILU(self, IS isrow, IS iscol, options=None) -> None:
 *         """Not implemented."""
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def factorCholesky(
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(46, 4929, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4927
 *         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":4931
 *         raise NotImplementedError
 * 
 *     def factorCholesky(             # <<<<<<<<<<<<<<
 *         self,
 *         IS isperm,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_405factorCholesky(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_404factorCholesky, "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:4931");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_405factorCholesky = {"factorCholesky", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_405factorCholesky, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_404factorCholesky};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_405factorCholesky(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isperm,&__pyx_mstate_global->__pyx_n_u_options,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4931, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4931, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4931, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "factorCholesky", 0) < (0)) __PYX_ERR(46, 4931, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":4934
 *         self,
 *         IS isperm,
 *         options: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Perform an in-place Cholesky factorization.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("factorCholesky", 0, 1, 2, i); __PYX_ERR(46, 4931, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4931, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4931, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4931, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "isperm", 0))) __PYX_ERR(46, 4933, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_404factorCholesky(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isperm, __pyx_v_options);

  /* "petsc4py/PETSc/Mat.pyx":4931
 *         raise NotImplementedError
 * 
 *     def factorCholesky(             # <<<<<<<<<<<<<<
 *         self,
 *         IS isperm,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_404factorCholesky(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4953
 *         """
 *         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, 4953, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4954
 *         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, 4954, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4931
 *         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":4956
 *         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_407factorSymbolicCholesky(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_406factorSymbolicCholesky, "Mat.factorSymbolicCholesky(self, isperm: IS, options=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Mat.pyx:4956");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_407factorSymbolicCholesky = {"factorSymbolicCholesky", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_407factorSymbolicCholesky, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_406factorSymbolicCholesky};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_407factorSymbolicCholesky(PyObject *__pyx_v_self, 
#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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isperm,&__pyx_mstate_global->__pyx_n_u_options,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4956, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4956, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4956, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "factorSymbolicCholesky", 0) < (0)) __PYX_ERR(46, 4956, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("factorSymbolicCholesky", 0, 1, 2, i); __PYX_ERR(46, 4956, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4956, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4956, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4956, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "isperm", 0))) __PYX_ERR(46, 4956, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_406factorSymbolicCholesky(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isperm, __pyx_v_options);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_406factorSymbolicCholesky(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4958
 *     def factorSymbolicCholesky(self, IS isperm, options=None) -> None:
 *         """Not implemented."""
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def factorNumericCholesky(self, Mat mat, options=None) -> None:
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(46, 4958, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4956
 *         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":4960
 *         raise NotImplementedError
 * 
 *     def factorNumericCholesky(self, Mat mat, options=None) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         raise NotImplementedError
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_409factorNumericCholesky(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_408factorNumericCholesky, "Mat.factorNumericCholesky(self, mat: Mat, options=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Mat.pyx:4960");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_409factorNumericCholesky = {"factorNumericCholesky", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_409factorNumericCholesky, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_408factorNumericCholesky};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_409factorNumericCholesky(PyObject *__pyx_v_self, 
#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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,&__pyx_mstate_global->__pyx_n_u_options,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4960, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4960, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4960, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "factorNumericCholesky", 0) < (0)) __PYX_ERR(46, 4960, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("factorNumericCholesky", 0, 1, 2, i); __PYX_ERR(46, 4960, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4960, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4960, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4960, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 4960, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_408factorNumericCholesky(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat, __pyx_v_options);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_408factorNumericCholesky(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4962
 *     def factorNumericCholesky(self, Mat mat, options=None) -> None:
 *         """Not implemented."""
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def factorICC(
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(46, 4962, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4960
 *         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":4964
 *         raise NotImplementedError
 * 
 *     def factorICC(             # <<<<<<<<<<<<<<
 *         self,
 *         IS isperm,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_411factorICC(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_410factorICC, "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:4964");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_411factorICC = {"factorICC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_411factorICC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_410factorICC};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_411factorICC(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isperm,&__pyx_mstate_global->__pyx_n_u_options,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4964, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4964, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4964, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "factorICC", 0) < (0)) __PYX_ERR(46, 4964, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":4967
 *         self,
 *         IS isperm,
 *         options: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Perform an in-place an incomplete Cholesky factorization.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("factorICC", 0, 1, 2, i); __PYX_ERR(46, 4964, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4964, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4964, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4964, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "isperm", 0))) __PYX_ERR(46, 4966, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_410factorICC(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isperm, __pyx_v_options);

  /* "petsc4py/PETSc/Mat.pyx":4964
 *         raise NotImplementedError
 * 
 *     def factorICC(             # <<<<<<<<<<<<<<
 *         self,
 *         IS isperm,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_410factorICC(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4986
 *         """
 *         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, 4986, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4987
 *         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, 4987, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4964
 *         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":4989
 *         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_413factorSymbolicICC(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_412factorSymbolicICC, "Mat.factorSymbolicICC(self, isperm: IS, options=None) -> None\nNot implemented.\nSource code at petsc4py/PETSc/Mat.pyx:4989");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_413factorSymbolicICC = {"factorSymbolicICC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_413factorSymbolicICC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_412factorSymbolicICC};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_413factorSymbolicICC(PyObject *__pyx_v_self, 
#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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isperm,&__pyx_mstate_global->__pyx_n_u_options,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 4989, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4989, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4989, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "factorSymbolicICC", 0) < (0)) __PYX_ERR(46, 4989, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("factorSymbolicICC", 0, 1, 2, i); __PYX_ERR(46, 4989, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 4989, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 4989, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4989, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "isperm", 0))) __PYX_ERR(46, 4989, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_412factorSymbolicICC(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_isperm, __pyx_v_options);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_412factorSymbolicICC(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":4991
 *     def factorSymbolicICC(self, IS isperm, options=None) -> None:
 *         """Not implemented."""
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def getInertia(self) -> tuple[int, int, int]:
*/
  __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_NotImplementedError))), 0, 0, 0);
  __PYX_ERR(46, 4991, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":4989
 *         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":4993
 *         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_415getInertia(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_414getInertia, "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:4993");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_415getInertia = {"getInertia", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_415getInertia, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_414getInertia};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_415getInertia(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getInertia", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_414getInertia(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_414getInertia(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5014
 * 
 *         """
 *         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":5015
 *         """
 *         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, 5015, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5016
 *         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, 5016, __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, 5016, __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, 5016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 5016, __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) != (0)) __PYX_ERR(46, 5016, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(46, 5016, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4) != (0)) __PYX_ERR(46, 5016, __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":4993
 *         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":5018
 *         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_417setUnfactored(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_416setUnfactored, "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:5018");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_417setUnfactored = {"setUnfactored", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_417setUnfactored, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_416setUnfactored};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_417setUnfactored(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUnfactored", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_416setUnfactored(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_416setUnfactored(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5028
 * 
 *         """
 *         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, 5028, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5018
 *         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":5032
 *     # IS
 * 
 *     def setISAllowRepeated(self, allow: bool = True) -> None:             # <<<<<<<<<<<<<<
 *         """Allow repeated entries in the local to global map.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_419setISAllowRepeated(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_418setISAllowRepeated, "Mat.setISAllowRepeated(self, allow: bool = True) -> None\nAllow repeated entries in the local to global map.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        allow\n            When `True`, local dofs are allowed to map to the same global dof.\n\n        See Also\n        --------\n        getISAllowRepeated, petsc.MatISSetAllowRepeated\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:5032");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_419setISAllowRepeated = {"setISAllowRepeated", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_419setISAllowRepeated, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_418setISAllowRepeated};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_419setISAllowRepeated(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_allow = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setISAllowRepeated (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_allow,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5032, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5032, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setISAllowRepeated", 0) < (0)) __PYX_ERR(46, 5032, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5032, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_allow = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setISAllowRepeated", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 5032, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.setISAllowRepeated", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_418setISAllowRepeated(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_allow);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_418setISAllowRepeated(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_allow) {
  PetscBool __pyx_v_callow;
  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("setISAllowRepeated", 0);

  /* "petsc4py/PETSc/Mat.pyx":5047
 * 
 *         """
 *         cdef PetscBool callow = asBool(allow)             # <<<<<<<<<<<<<<
 *         CHKERR(MatISSetAllowRepeated(self.mat, callow))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_allow); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(46, 5047, __pyx_L1_error)
  __pyx_v_callow = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5048
 *         """
 *         cdef PetscBool callow = asBool(allow)
 *         CHKERR(MatISSetAllowRepeated(self.mat, callow))             # <<<<<<<<<<<<<<
 * 
 *     def getISAllowRepeated(self) -> bool:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISSetAllowRepeated(__pyx_v_self->mat, __pyx_v_callow)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5048, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5032
 *     # IS
 * 
 *     def setISAllowRepeated(self, allow: bool = True) -> None:             # <<<<<<<<<<<<<<
 *         """Allow repeated entries in the local to global map.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.setISAllowRepeated", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":5050
 *         CHKERR(MatISSetAllowRepeated(self.mat, callow))
 * 
 *     def getISAllowRepeated(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Get the flag for repeated entries in the local to global map.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_421getISAllowRepeated(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_420getISAllowRepeated, "Mat.getISAllowRepeated(self) -> bool\nGet the flag for repeated entries in the local to global map.\n\n        Not collective.\n\n        See Also\n        --------\n        setISAllowRepeated, petsc.MatISGetAllowRepeated\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:5050");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_421getISAllowRepeated = {"getISAllowRepeated", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_421getISAllowRepeated, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_420getISAllowRepeated};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_421getISAllowRepeated(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getISAllowRepeated (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getISAllowRepeated", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getISAllowRepeated", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_420getISAllowRepeated(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_420getISAllowRepeated(struct PyPetscMatObject *__pyx_v_self) {
  PetscBool __pyx_v_callow;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscErrorCode __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PetscBool __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getISAllowRepeated", 0);

  /* "petsc4py/PETSc/Mat.pyx":5060
 * 
 *         """
 *         cdef PetscBool callow = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(MatISGetAllowRepeated(self.mat, &callow))
 *         return asBool(callow)
*/
  __pyx_v_callow = PETSC_FALSE;

  /* "petsc4py/PETSc/Mat.pyx":5061
 *         """
 *         cdef PetscBool callow = PETSC_FALSE
 *         CHKERR(MatISGetAllowRepeated(self.mat, &callow))             # <<<<<<<<<<<<<<
 *         return asBool(callow)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISGetAllowRepeated(__pyx_v_self->mat, (&__pyx_v_callow))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5061, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5062
 *         cdef PetscBool callow = PETSC_FALSE
 *         CHKERR(MatISGetAllowRepeated(self.mat, &callow))
 *         return asBool(callow)             # <<<<<<<<<<<<<<
 * 
 *     def fixISLocalEmpty(self, fix: bool = True) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_callow); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_t_2); if (unlikely(__pyx_t_3 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(46, 5062, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5050
 *         CHKERR(MatISSetAllowRepeated(self.mat, callow))
 * 
 *     def getISAllowRepeated(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Get the flag for repeated entries in the local to global map.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.getISAllowRepeated", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":5064
 *         return asBool(callow)
 * 
 *     def fixISLocalEmpty(self, fix: bool = True) -> None:             # <<<<<<<<<<<<<<
 *         """Compress out zero local rows from the local matrices.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_423fixISLocalEmpty(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_422fixISLocalEmpty, "Mat.fixISLocalEmpty(self, fix: bool = True) -> 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:5064");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_423fixISLocalEmpty = {"fixISLocalEmpty", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_423fixISLocalEmpty, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_422fixISLocalEmpty};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_423fixISLocalEmpty(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5064, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5064, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "fixISLocalEmpty", 0) < (0)) __PYX_ERR(46, 5064, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5064, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_fix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fixISLocalEmpty", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 5064, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_422fixISLocalEmpty(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_fix);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_422fixISLocalEmpty(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5080
 * 
 *         """
 *         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, 5080, __pyx_L1_error)
  __pyx_v_cfix = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5081
 *         """
 *         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, 5081, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5064
 *         return asBool(callow)
 * 
 *     def fixISLocalEmpty(self, fix: bool = True) -> 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":5083
 *         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_425getISLocalMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_424getISLocalMat, "Mat.getISLocalMat(self) -> Mat\nReturn the local matrix stored inside a `Type.IS` matrix.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.MatISGetLocalMat\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:5083");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_425getISLocalMat = {"getISLocalMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_425getISLocalMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_424getISLocalMat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_425getISLocalMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getISLocalMat", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_424getISLocalMat(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_424getISLocalMat(struct PyPetscMatObject *__pyx_v_self) {
  struct PyPetscMatObject *__pyx_v_local = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getISLocalMat", 0);

  /* "petsc4py/PETSc/Mat.pyx":5093
 * 
 *         """
 *         cdef Mat local = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(MatISGetLocalMat(self.mat, &local.mat))
 *         CHKERR(PetscINCREF(local.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5093, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_local = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5094
 *         """
 *         cdef Mat local = Mat()
 *         CHKERR(MatISGetLocalMat(self.mat, &local.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(local.obj))
 *         return local
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatISGetLocalMat(__pyx_v_self->mat, (&__pyx_v_local->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5094, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5095
 *         cdef Mat local = Mat()
 *         CHKERR(MatISGetLocalMat(self.mat, &local.mat))
 *         CHKERR(PetscINCREF(local.obj))             # <<<<<<<<<<<<<<
 *         return local
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_local->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5095, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5096
 *         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":5083
 *         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_XDECREF(__pyx_t_2);
  __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":5098
 *         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_427restoreISLocalMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_426restoreISLocalMat, "Mat.restoreISLocalMat(self, local: Mat) -> None\nRestore the local matrix obtained with `getISLocalMat`.\n\n        Not collective.\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:5098");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_427restoreISLocalMat = {"restoreISLocalMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_427restoreISLocalMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_426restoreISLocalMat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_427restoreISLocalMat(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_local,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5098, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5098, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "restoreISLocalMat", 0) < (0)) __PYX_ERR(46, 5098, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("restoreISLocalMat", 1, 1, 1, i); __PYX_ERR(46, 5098, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5098, __pyx_L3_error)
    }
    __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, 5098, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "local", 0))) __PYX_ERR(46, 5098, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_426restoreISLocalMat(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_local);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_426restoreISLocalMat(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5113
 * 
 *         """
 *         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, 5113, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5098
 *         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":5115
 *         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_429setISLocalMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_428setISLocalMat, "Mat.setISLocalMat(self, local: Mat) -> None\nSet the local matrix stored inside a `Type.IS`.\n\n        Not collective.\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:5115");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_429setISLocalMat = {"setISLocalMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_429setISLocalMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_428setISLocalMat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_429setISLocalMat(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_local,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5115, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5115, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setISLocalMat", 0) < (0)) __PYX_ERR(46, 5115, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setISLocalMat", 1, 1, 1, i); __PYX_ERR(46, 5115, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5115, __pyx_L3_error)
    }
    __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, 5115, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "local", 0))) __PYX_ERR(46, 5115, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_428setISLocalMat(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_local);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_428setISLocalMat(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5130
 * 
 *         """
 *         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, 5130, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5115
 *         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":5132
 *         CHKERR(MatISSetLocalMat(self.mat, local.mat))
 * 
 *     def setISPreallocation(             # <<<<<<<<<<<<<<
 *         self,
 *         nnz: Sequence[int],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_431setISPreallocation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_430setISPreallocation, "Mat.setISPreallocation(self, nnz: Sequence[int], onnz: Sequence[int]) -> Self\nPreallocate memory for a `Type.IS` parallel matrix.\n\n        Collective.\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:5132");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_431setISPreallocation = {"setISPreallocation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_431setISPreallocation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_430setISPreallocation};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_431setISPreallocation(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nnz,&__pyx_mstate_global->__pyx_n_u_onnz,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5132, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5132, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5132, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setISPreallocation", 0) < (0)) __PYX_ERR(46, 5132, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setISPreallocation", 1, 2, 2, i); __PYX_ERR(46, 5132, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5132, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5132, __pyx_L3_error)
    }
    __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, 5132, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_430setISPreallocation(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_nnz, __pyx_v_onnz);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_430setISPreallocation(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":5156
 * 
 *         """
 *         cdef PetscInt *cnnz = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt *connz = NULL
 *         nnz = iarray_i(nnz, NULL, &cnnz)
*/
  __pyx_v_cnnz = NULL;

  /* "petsc4py/PETSc/Mat.pyx":5157
 *         """
 *         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":5158
 *         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, 5158, __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":5159
 *         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, 5159, __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":5160
 *         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, 5160, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5161
 *         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":5132
 *         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":5165
 *     # 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_433getLRCMats(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_432getLRCMats, "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:5165");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_433getLRCMats = {"getLRCMats", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_433getLRCMats, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_432getLRCMats};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_433getLRCMats(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLRCMats", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_432getLRCMats(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_432getLRCMats(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLRCMats", 0);

  /* "petsc4py/PETSc/Mat.pyx":5186
 * 
 *         """
 *         cdef Mat A = Mat()             # <<<<<<<<<<<<<<
 *         cdef Mat U = Mat()
 *         cdef Vec c = Vec()
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5186, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_A = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5187
 *         """
 *         cdef Mat A = Mat()
 *         cdef Mat U = Mat()             # <<<<<<<<<<<<<<
 *         cdef Vec c = Vec()
 *         cdef Mat V = Mat()
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5187, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_U = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5188
 *         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_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5188, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5189
 *         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_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5189, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_V = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5190
 *         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_4 = __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_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5190, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5191
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_A->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5191, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5192
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_U->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5192, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5193
 *         CHKERR(PetscINCREF(A.obj))
 *         CHKERR(PetscINCREF(U.obj))
 *         CHKERR(PetscINCREF(c.obj))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(V.obj))
 *         return (A, U, c, V)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_c->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5193, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5194
 *         CHKERR(PetscINCREF(U.obj))
 *         CHKERR(PetscINCREF(c.obj))
 *         CHKERR(PetscINCREF(V.obj))             # <<<<<<<<<<<<<<
 *         return (A, U, c, V)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_V->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5194, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5195
 *         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) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5195, __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)) != (0)) __PYX_ERR(46, 5195, __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)) != (0)) __PYX_ERR(46, 5195, __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)) != (0)) __PYX_ERR(46, 5195, __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)) != (0)) __PYX_ERR(46, 5195, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5165
 *     # 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_XDECREF(__pyx_t_2);
  __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":5197
 *         return (A, U, c, V)
 * 
 *     def setLRCMats(self, Mat A, Mat U, Vec c=None, Mat V=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the constituents of a `Type.LRC` matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_435setLRCMats(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_434setLRCMats, "Mat.setLRCMats(self, A: Mat, U: Mat, c: Vec | None = None, V: Mat | None = 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:5197");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_435setLRCMats = {"setLRCMats", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_435setLRCMats, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_434setLRCMats};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_435setLRCMats(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_U,&__pyx_mstate_global->__pyx_n_u_c,&__pyx_mstate_global->__pyx_n_u_V,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5197, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 5197, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 5197, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5197, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5197, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLRCMats", 0) < (0)) __PYX_ERR(46, 5197, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLRCMats", 0, 2, 4, i); __PYX_ERR(46, 5197, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 5197, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 5197, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5197, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5197, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 5197, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "A", 0))) __PYX_ERR(46, 5197, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_U), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "U", 0))) __PYX_ERR(46, 5197, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "c", 0))) __PYX_ERR(46, 5197, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_V), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "V", 0))) __PYX_ERR(46, 5197, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_434setLRCMats(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_434setLRCMats(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5219
 * 
 *         """
 *         cdef PetscMat Amat = A.mat if A is not None else <PetscMat>NULL             # <<<<<<<<<<<<<<
 *         cdef PetscVec cvec = c.vec if c is not None else <PetscVec>NULL
 *         cdef PetscMat Vmat = V.mat if V is not None else <PetscMat>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":5220
 *         """
 *         cdef PetscMat Amat = A.mat if A is not None else <PetscMat>NULL
 *         cdef PetscVec cvec = c.vec if c is not None else <PetscVec>NULL             # <<<<<<<<<<<<<<
 *         cdef PetscMat Vmat = V.mat if V is not None else <PetscMat>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":5221
 *         cdef PetscMat Amat = A.mat if A is not None else <PetscMat>NULL
 *         cdef PetscVec cvec = c.vec if c is not None else <PetscVec>NULL
 *         cdef PetscMat Vmat = V.mat if V is not None else <PetscMat>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":5222
 *         cdef PetscVec cvec = c.vec if c is not None else <PetscVec>NULL
 *         cdef PetscMat Vmat = V.mat if V is not None else <PetscMat>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, 5222, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5197
 *         return (A, U, c, V)
 * 
 *     def setLRCMats(self, Mat A, Mat U, Vec c=None, Mat V=None) -> 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":5226
 *     # H2Opus
 * 
 *     def H2OpusOrthogonalize(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Orthogonalize the basis tree of a hierarchical matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_437H2OpusOrthogonalize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_436H2OpusOrthogonalize, "Mat.H2OpusOrthogonalize(self) -> Self\nOrthogonalize the basis tree of a hierarchical matrix.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.MatH2OpusOrthogonalize\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:5226");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_437H2OpusOrthogonalize = {"H2OpusOrthogonalize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_437H2OpusOrthogonalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_436H2OpusOrthogonalize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_437H2OpusOrthogonalize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("H2OpusOrthogonalize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_436H2OpusOrthogonalize(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_436H2OpusOrthogonalize(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5236
 * 
 *         """
 *         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, 5236, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5237
 *         """
 *         CHKERR(MatH2OpusOrthogonalize(self.mat))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def H2OpusCompress(self, tol: float) -> Self:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5226
 *     # 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":5239
 *         return self
 * 
 *     def H2OpusCompress(self, tol: float) -> Self:             # <<<<<<<<<<<<<<
 *         """Compress a hierarchical matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_439H2OpusCompress(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_438H2OpusCompress, "Mat.H2OpusCompress(self, tol: float) -> Self\nCompress a hierarchical matrix.\n\n        Collective.\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:5239");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_439H2OpusCompress = {"H2OpusCompress", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_439H2OpusCompress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_438H2OpusCompress};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_439H2OpusCompress(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5239, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5239, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "H2OpusCompress", 0) < (0)) __PYX_ERR(46, 5239, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("H2OpusCompress", 1, 1, 1, i); __PYX_ERR(46, 5239, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5239, __pyx_L3_error)
    }
    __pyx_v_tol = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("H2OpusCompress", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5239, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_438H2OpusCompress(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_tol);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_438H2OpusCompress(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5254
 * 
 *         """
 *         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, 5254, __pyx_L1_error)
  __pyx_v__tol = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5255
 *         """
 *         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, 5255, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5256
 *         cdef PetscReal _tol = asReal(tol)
 *         CHKERR(MatH2OpusCompress(self.mat, _tol))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def H2OpusLowRankUpdate(self, Mat U, Mat V=None, s: float = 1.0) -> Self:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5239
 *         return self
 * 
 *     def H2OpusCompress(self, tol: float) -> Self:             # <<<<<<<<<<<<<<
 *         """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":5258
 *         return self
 * 
 *     def H2OpusLowRankUpdate(self, Mat U, Mat V=None, s: float = 1.0) -> Self:             # <<<<<<<<<<<<<<
 *         """Perform a low-rank update of the form ``self`` += sUV.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_441H2OpusLowRankUpdate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_440H2OpusLowRankUpdate, "Mat.H2OpusLowRankUpdate(self, U: Mat, V: Mat | None = None, s: float = 1.0) -> Self\nPerform a low-rank update of the form ``self`` += sUV\341\265\200.\n\n        Collective.\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:5258");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_441H2OpusLowRankUpdate = {"H2OpusLowRankUpdate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_441H2OpusLowRankUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_440H2OpusLowRankUpdate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_441H2OpusLowRankUpdate(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_U,&__pyx_mstate_global->__pyx_n_u_V,&__pyx_mstate_global->__pyx_n_u_s_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5258, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 5258, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5258, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5258, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "H2OpusLowRankUpdate", 0) < (0)) __PYX_ERR(46, 5258, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("H2OpusLowRankUpdate", 0, 1, 3, i); __PYX_ERR(46, 5258, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 5258, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5258, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5258, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_float_1_0));
    }
    __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, 5258, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "U", 0))) __PYX_ERR(46, 5258, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_V), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "V", 0))) __PYX_ERR(46, 5258, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_440H2OpusLowRankUpdate(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_440H2OpusLowRankUpdate(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5277
 * 
 *         """
 *         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_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(46, 5277, __pyx_L1_error)
  __pyx_v__s = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5278
 *         """
 *         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":5279
 *         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":5280
 *         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":5279
 *         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":5281
 *         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, 5281, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5282
 *             vmat = V.mat
 *         CHKERR(MatH2OpusLowRankUpdate(self.mat, U.mat, vmat, _s))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     # Htool
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5258
 *         return self
 * 
 *     def H2OpusLowRankUpdate(self, Mat U, Mat V=None, s: float = 1.0) -> Self:             # <<<<<<<<<<<<<<
 *         """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":5286
 *     # Htool
 * 
 *     def HtoolGetPermutationSource(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Get the permutation of source (column) indices computed by Htool.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_443HtoolGetPermutationSource(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_442HtoolGetPermutationSource, "Mat.HtoolGetPermutationSource(self) -> IS\nGet the permutation of source (column) indices computed by Htool.\n\n        Not collective.\n\n        Returns\n        -------\n        IS\n            The permutation index set for source indices.\n\n        See Also\n        --------\n        HtoolGetPermutationTarget, petsc.MatHtoolGetPermutationSource\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:5286");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_443HtoolGetPermutationSource = {"HtoolGetPermutationSource", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_443HtoolGetPermutationSource, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_442HtoolGetPermutationSource};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_443HtoolGetPermutationSource(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("HtoolGetPermutationSource (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("HtoolGetPermutationSource", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("HtoolGetPermutationSource", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_442HtoolGetPermutationSource(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_442HtoolGetPermutationSource(struct PyPetscMatObject *__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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("HtoolGetPermutationSource", 0);

  /* "petsc4py/PETSc/Mat.pyx":5301
 * 
 *         """
 *         cdef IS iset = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(MatHtoolGetPermutationSource(self.mat, &iset.iset))
 *         return iset
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5301, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5302
 *         """
 *         cdef IS iset = IS()
 *         CHKERR(MatHtoolGetPermutationSource(self.mat, &iset.iset))             # <<<<<<<<<<<<<<
 *         return iset
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatHtoolGetPermutationSource(__pyx_v_self->mat, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5302, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5303
 *         cdef IS iset = IS()
 *         CHKERR(MatHtoolGetPermutationSource(self.mat, &iset.iset))
 *         return iset             # <<<<<<<<<<<<<<
 * 
 *     def HtoolGetPermutationTarget(self) -> IS:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_iset);
  __pyx_r = ((PyObject *)__pyx_v_iset);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5286
 *     # Htool
 * 
 *     def HtoolGetPermutationSource(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Get the permutation of source (column) indices computed by Htool.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.HtoolGetPermutationSource", __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/Mat.pyx":5305
 *         return iset
 * 
 *     def HtoolGetPermutationTarget(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Get the permutation of target (row) indices computed by Htool.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_445HtoolGetPermutationTarget(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_444HtoolGetPermutationTarget, "Mat.HtoolGetPermutationTarget(self) -> IS\nGet the permutation of target (row) indices computed by Htool.\n\n        Not collective.\n\n        Returns\n        -------\n        IS\n            The permutation index set for target indices.\n\n        See Also\n        --------\n        HtoolGetPermutationSource, petsc.MatHtoolGetPermutationTarget\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:5305");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_445HtoolGetPermutationTarget = {"HtoolGetPermutationTarget", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_445HtoolGetPermutationTarget, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_444HtoolGetPermutationTarget};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_445HtoolGetPermutationTarget(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("HtoolGetPermutationTarget (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("HtoolGetPermutationTarget", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("HtoolGetPermutationTarget", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_444HtoolGetPermutationTarget(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_444HtoolGetPermutationTarget(struct PyPetscMatObject *__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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("HtoolGetPermutationTarget", 0);

  /* "petsc4py/PETSc/Mat.pyx":5320
 * 
 *         """
 *         cdef IS iset = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(MatHtoolGetPermutationTarget(self.mat, &iset.iset))
 *         return iset
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5320, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5321
 *         """
 *         cdef IS iset = IS()
 *         CHKERR(MatHtoolGetPermutationTarget(self.mat, &iset.iset))             # <<<<<<<<<<<<<<
 *         return iset
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatHtoolGetPermutationTarget(__pyx_v_self->mat, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5321, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5322
 *         cdef IS iset = IS()
 *         CHKERR(MatHtoolGetPermutationTarget(self.mat, &iset.iset))
 *         return iset             # <<<<<<<<<<<<<<
 * 
 *     def HtoolUsePermutation(self, use: bool) -> Self:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_iset);
  __pyx_r = ((PyObject *)__pyx_v_iset);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5305
 *         return iset
 * 
 *     def HtoolGetPermutationTarget(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Get the permutation of target (row) indices computed by Htool.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.HtoolGetPermutationTarget", __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/Mat.pyx":5324
 *         return iset
 * 
 *     def HtoolUsePermutation(self, use: bool) -> Self:             # <<<<<<<<<<<<<<
 *         """Set whether to use the permutation computed by Htool.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_447HtoolUsePermutation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_446HtoolUsePermutation, "Mat.HtoolUsePermutation(self, use: bool) -> Self\nSet whether to use the permutation computed by Htool.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        use\n            Whether to use the permutation.\n\n        See Also\n        --------\n        petsc.MatHtoolUsePermutation\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:5324");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_447HtoolUsePermutation = {"HtoolUsePermutation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_447HtoolUsePermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_446HtoolUsePermutation};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_447HtoolUsePermutation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_use = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("HtoolUsePermutation (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_use,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5324, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5324, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "HtoolUsePermutation", 0) < (0)) __PYX_ERR(46, 5324, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("HtoolUsePermutation", 1, 1, 1, i); __PYX_ERR(46, 5324, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5324, __pyx_L3_error)
    }
    __pyx_v_use = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("HtoolUsePermutation", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5324, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.HtoolUsePermutation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_446HtoolUsePermutation(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_use);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_446HtoolUsePermutation(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_use) {
  PetscBool __pyx_v__use;
  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("HtoolUsePermutation", 0);

  /* "petsc4py/PETSc/Mat.pyx":5339
 * 
 *         """
 *         cdef PetscBool _use = asBool(use)             # <<<<<<<<<<<<<<
 *         CHKERR(MatHtoolUsePermutation(self.mat, _use))
 *         return self
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_use); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(46, 5339, __pyx_L1_error)
  __pyx_v__use = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5340
 *         """
 *         cdef PetscBool _use = asBool(use)
 *         CHKERR(MatHtoolUsePermutation(self.mat, _use))             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatHtoolUsePermutation(__pyx_v_self->mat, __pyx_v__use)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5340, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5341
 *         cdef PetscBool _use = asBool(use)
 *         CHKERR(MatHtoolUsePermutation(self.mat, _use))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def HtoolUseRecompression(self, use: bool) -> Self:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5324
 *         return iset
 * 
 *     def HtoolUsePermutation(self, use: bool) -> Self:             # <<<<<<<<<<<<<<
 *         """Set whether to use the permutation computed by Htool.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.HtoolUsePermutation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":5343
 *         return self
 * 
 *     def HtoolUseRecompression(self, use: bool) -> Self:             # <<<<<<<<<<<<<<
 *         """Set whether to recompress the matrix after assembly.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_449HtoolUseRecompression(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_448HtoolUseRecompression, "Mat.HtoolUseRecompression(self, use: bool) -> Self\nSet whether to recompress the matrix after assembly.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        use\n            Whether to use recompression.\n\n        See Also\n        --------\n        petsc.MatHtoolUseRecompression\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:5343");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_449HtoolUseRecompression = {"HtoolUseRecompression", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_449HtoolUseRecompression, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_448HtoolUseRecompression};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_449HtoolUseRecompression(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_use = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("HtoolUseRecompression (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_use,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5343, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5343, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "HtoolUseRecompression", 0) < (0)) __PYX_ERR(46, 5343, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("HtoolUseRecompression", 1, 1, 1, i); __PYX_ERR(46, 5343, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5343, __pyx_L3_error)
    }
    __pyx_v_use = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("HtoolUseRecompression", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5343, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.HtoolUseRecompression", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_448HtoolUseRecompression(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_use);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_448HtoolUseRecompression(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_use) {
  PetscBool __pyx_v__use;
  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("HtoolUseRecompression", 0);

  /* "petsc4py/PETSc/Mat.pyx":5358
 * 
 *         """
 *         cdef PetscBool _use = asBool(use)             # <<<<<<<<<<<<<<
 *         CHKERR(MatHtoolUseRecompression(self.mat, _use))
 *         return self
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_use); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(46, 5358, __pyx_L1_error)
  __pyx_v__use = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5359
 *         """
 *         cdef PetscBool _use = asBool(use)
 *         CHKERR(MatHtoolUseRecompression(self.mat, _use))             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatHtoolUseRecompression(__pyx_v_self->mat, __pyx_v__use)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5359, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5360
 *         cdef PetscBool _use = asBool(use)
 *         CHKERR(MatHtoolUseRecompression(self.mat, _use))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     # LMVM
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5343
 *         return self
 * 
 *     def HtoolUseRecompression(self, use: bool) -> Self:             # <<<<<<<<<<<<<<
 *         """Set whether to recompress the matrix after assembly.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.HtoolUseRecompression", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":5364
 *     # LMVM
 * 
 *     def getLMVMJ0(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Get the initial Jacobian of the LMVM matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_451getLMVMJ0(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_450getLMVMJ0, "Mat.getLMVMJ0(self) -> Mat\nGet the initial Jacobian of the LMVM matrix.\n\n        Not collective.\n\n        See Also\n        --------\n        setLMVMJ0, petsc.MatLMVMGetJ0\n        \nSource code at petsc4py/PETSc/Mat.pyx:5364");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_451getLMVMJ0 = {"getLMVMJ0", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_451getLMVMJ0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_450getLMVMJ0};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_451getLMVMJ0(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getLMVMJ0 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLMVMJ0", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLMVMJ0", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_450getLMVMJ0(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_450getLMVMJ0(struct PyPetscMatObject *__pyx_v_self) {
  struct PyPetscMatObject *__pyx_v_M = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLMVMJ0", 0);

  /* "petsc4py/PETSc/Mat.pyx":5373
 *         setLMVMJ0, petsc.MatLMVMGetJ0
 *         """
 *         cdef Mat M = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(MatLMVMGetJ0(self.mat, &M.mat))
 *         CHKERR(PetscINCREF(M.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5373, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_M = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5374
 *         """
 *         cdef Mat M = Mat()
 *         CHKERR(MatLMVMGetJ0(self.mat, &M.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(M.obj))
 *         return M
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatLMVMGetJ0(__pyx_v_self->mat, (&__pyx_v_M->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5374, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5375
 *         cdef Mat M = Mat()
 *         CHKERR(MatLMVMGetJ0(self.mat, &M.mat))
 *         CHKERR(PetscINCREF(M.obj))             # <<<<<<<<<<<<<<
 *         return M
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_M->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5375, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5376
 *         CHKERR(MatLMVMGetJ0(self.mat, &M.mat))
 *         CHKERR(PetscINCREF(M.obj))
 *         return M             # <<<<<<<<<<<<<<
 * 
 *     def setLMVMJ0(self, Mat J0) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_M);
  __pyx_r = ((PyObject *)__pyx_v_M);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5364
 *     # LMVM
 * 
 *     def getLMVMJ0(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Get the initial Jacobian of the LMVM matrix.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.getLMVMJ0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_M);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":5378
 *         return M
 * 
 *     def setLMVMJ0(self, Mat J0) -> None:             # <<<<<<<<<<<<<<
 *         """Set the initial Jacobian of the LMVM matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_453setLMVMJ0(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_452setLMVMJ0, "Mat.setLMVMJ0(self, J0: Mat) -> None\nSet the initial Jacobian of the LMVM matrix.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        J0:\n            The initial Jacobian matrix.\n\n        See Also\n        --------\n        getLMVMJ0, petsc.MatLMVMSetJ0\n        \nSource code at petsc4py/PETSc/Mat.pyx:5378");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_453setLMVMJ0 = {"setLMVMJ0", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_453setLMVMJ0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_452setLMVMJ0};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_453setLMVMJ0(PyObject *__pyx_v_self, 
#if 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_J0 = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setLMVMJ0 (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_J0,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5378, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5378, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLMVMJ0", 0) < (0)) __PYX_ERR(46, 5378, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLMVMJ0", 1, 1, 1, i); __PYX_ERR(46, 5378, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5378, __pyx_L3_error)
    }
    __pyx_v_J0 = ((struct PyPetscMatObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setLMVMJ0", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5378, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.setLMVMJ0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J0), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J0", 0))) __PYX_ERR(46, 5378, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_452setLMVMJ0(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_J0);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_452setLMVMJ0(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_J0) {
  Mat __pyx_v_ctype;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Mat __pyx_t_1;
  PetscErrorCode __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setLMVMJ0", 0);

  /* "petsc4py/PETSc/Mat.pyx":5392
 *         getLMVMJ0, petsc.MatLMVMSetJ0
 *         """
 *         cdef PetscMat ctype = J0.mat             # <<<<<<<<<<<<<<
 *         CHKERR(MatLMVMSetJ0(self.mat, ctype))
 * 
*/
  __pyx_t_1 = __pyx_v_J0->mat;
  __pyx_v_ctype = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5393
 *         """
 *         cdef PetscMat ctype = J0.mat
 *         CHKERR(MatLMVMSetJ0(self.mat, ctype))             # <<<<<<<<<<<<<<
 * 
 *     def getLMVMJ0KSP(self) -> Mat:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatLMVMSetJ0(__pyx_v_self->mat, __pyx_v_ctype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5393, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5378
 *         return M
 * 
 *     def setLMVMJ0(self, Mat J0) -> None:             # <<<<<<<<<<<<<<
 *         """Set the initial Jacobian of the LMVM matrix.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.setLMVMJ0", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":5395
 *         CHKERR(MatLMVMSetJ0(self.mat, ctype))
 * 
 *     def getLMVMJ0KSP(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Get the KSP of the LMVM matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_455getLMVMJ0KSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_454getLMVMJ0KSP, "Mat.getLMVMJ0KSP(self) -> Mat\nGet the KSP of the LMVM matrix.\n\n        Not collective.\n\n        See Also\n        --------\n        setLMVMJ0KSP, petsc.MatLMVMGetJ0KSP\n        \nSource code at petsc4py/PETSc/Mat.pyx:5395");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_455getLMVMJ0KSP = {"getLMVMJ0KSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_455getLMVMJ0KSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_454getLMVMJ0KSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_455getLMVMJ0KSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getLMVMJ0KSP (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLMVMJ0KSP", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLMVMJ0KSP", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_454getLMVMJ0KSP(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_454getLMVMJ0KSP(struct PyPetscMatObject *__pyx_v_self) {
  struct PyPetscKSPObject *__pyx_v_ksp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLMVMJ0KSP", 0);

  /* "petsc4py/PETSc/Mat.pyx":5404
 *         setLMVMJ0KSP, petsc.MatLMVMGetJ0KSP
 *         """
 *         cdef KSP ksp = KSP()             # <<<<<<<<<<<<<<
 *         CHKERR(MatLMVMGetJ0KSP(self.mat, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5404, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5405
 *         """
 *         cdef KSP ksp = KSP()
 *         CHKERR(MatLMVMGetJ0KSP(self.mat, &ksp.ksp))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(ksp.obj))
 *         return ksp
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatLMVMGetJ0KSP(__pyx_v_self->mat, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5405, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5406
 *         cdef KSP ksp = KSP()
 *         CHKERR(MatLMVMGetJ0KSP(self.mat, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))             # <<<<<<<<<<<<<<
 *         return ksp
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5406, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5407
 *         CHKERR(MatLMVMGetJ0KSP(self.mat, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))
 *         return ksp             # <<<<<<<<<<<<<<
 * 
 *     def setLMVMJ0KSP(self, KSP ksp) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_ksp);
  __pyx_r = ((PyObject *)__pyx_v_ksp);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5395
 *         CHKERR(MatLMVMSetJ0(self.mat, ctype))
 * 
 *     def getLMVMJ0KSP(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Get the KSP of the LMVM matrix.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.getLMVMJ0KSP", __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/Mat.pyx":5409
 *         return ksp
 * 
 *     def setLMVMJ0KSP(self, KSP ksp) -> None:             # <<<<<<<<<<<<<<
 *         """Set the KSP of the LMVM matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_457setLMVMJ0KSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_456setLMVMJ0KSP, "Mat.setLMVMJ0KSP(self, ksp: KSP) -> None\nSet the KSP of the LMVM matrix.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        ksp:\n            The KSP.\n\n        See Also\n        --------\n        getLMVMJ0KSP, petsc.MatLMVMSetJ0KSP\n        \nSource code at petsc4py/PETSc/Mat.pyx:5409");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_457setLMVMJ0KSP = {"setLMVMJ0KSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_457setLMVMJ0KSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_456setLMVMJ0KSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_457setLMVMJ0KSP(PyObject *__pyx_v_self, 
#if 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("setLMVMJ0KSP (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ksp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5409, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLMVMJ0KSP", 0) < (0)) __PYX_ERR(46, 5409, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLMVMJ0KSP", 1, 1, 1, i); __PYX_ERR(46, 5409, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5409, __pyx_L3_error)
    }
    __pyx_v_ksp = ((struct PyPetscKSPObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setLMVMJ0KSP", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5409, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.setLMVMJ0KSP", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ksp), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, 0, "ksp", 0))) __PYX_ERR(46, 5409, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_456setLMVMJ0KSP(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_ksp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_456setLMVMJ0KSP(struct PyPetscMatObject *__pyx_v_self, struct PyPetscKSPObject *__pyx_v_ksp) {
  KSP __pyx_v_ctype;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  KSP __pyx_t_1;
  PetscErrorCode __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setLMVMJ0KSP", 0);

  /* "petsc4py/PETSc/Mat.pyx":5423
 *         getLMVMJ0KSP, petsc.MatLMVMSetJ0KSP
 *         """
 *         cdef PetscKSP ctype = ksp.ksp             # <<<<<<<<<<<<<<
 *         CHKERR(MatLMVMSetJ0KSP(self.mat, ctype))
 * 
*/
  __pyx_t_1 = __pyx_v_ksp->ksp;
  __pyx_v_ctype = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5424
 *         """
 *         cdef PetscKSP ctype = ksp.ksp
 *         CHKERR(MatLMVMSetJ0KSP(self.mat, ctype))             # <<<<<<<<<<<<<<
 * 
 *     def allocateLMVM(self, Vec x, Vec f) -> None:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatLMVMSetJ0KSP(__pyx_v_self->mat, __pyx_v_ctype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5424, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5409
 *         return ksp
 * 
 *     def setLMVMJ0KSP(self, KSP ksp) -> None:             # <<<<<<<<<<<<<<
 *         """Set the KSP of the LMVM matrix.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.setLMVMJ0KSP", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":5426
 *         CHKERR(MatLMVMSetJ0KSP(self.mat, ctype))
 * 
 *     def allocateLMVM(self, Vec x, Vec f) -> None:             # <<<<<<<<<<<<<<
 *         """Allocate all necessary common memory LMVM matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_459allocateLMVM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_458allocateLMVM, "Mat.allocateLMVM(self, x: Vec, f: Vec) -> None\nAllocate all necessary common memory LMVM matrix.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        x:\n            Solution vector.\n        f:\n            Function vector.\n\n        See Also\n        --------\n        petsc.MatLMVMAllocate\n        \nSource code at petsc4py/PETSc/Mat.pyx:5426");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_459allocateLMVM = {"allocateLMVM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_459allocateLMVM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_458allocateLMVM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_459allocateLMVM(PyObject *__pyx_v_self, 
#if 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("allocateLMVM (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_f,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5426, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5426, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5426, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "allocateLMVM", 0) < (0)) __PYX_ERR(46, 5426, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("allocateLMVM", 1, 2, 2, i); __PYX_ERR(46, 5426, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5426, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5426, __pyx_L3_error)
    }
    __pyx_v_x = ((struct PyPetscVecObject *)values[0]);
    __pyx_v_f = ((struct PyPetscVecObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("allocateLMVM", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 5426, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.allocateLMVM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 5426, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(46, 5426, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_458allocateLMVM(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_f);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_458allocateLMVM(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f) {
  Vec __pyx_v_xvec;
  Vec __pyx_v_fvec;
  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("allocateLMVM", 0);

  /* "petsc4py/PETSc/Mat.pyx":5442
 *         petsc.MatLMVMAllocate
 *         """
 *         cdef PetscVec xvec = x.vec             # <<<<<<<<<<<<<<
 *         cdef PetscVec fvec = f.vec
 *         CHKERR(MatLMVMAllocate(self.mat, xvec, fvec))
*/
  __pyx_t_1 = __pyx_v_x->vec;
  __pyx_v_xvec = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5443
 *         """
 *         cdef PetscVec xvec = x.vec
 *         cdef PetscVec fvec = f.vec             # <<<<<<<<<<<<<<
 *         CHKERR(MatLMVMAllocate(self.mat, xvec, fvec))
 * 
*/
  __pyx_t_1 = __pyx_v_f->vec;
  __pyx_v_fvec = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5444
 *         cdef PetscVec xvec = x.vec
 *         cdef PetscVec fvec = f.vec
 *         CHKERR(MatLMVMAllocate(self.mat, xvec, fvec))             # <<<<<<<<<<<<<<
 * 
 *     def updateLMVM(self, Vec x, Vec f) -> None:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatLMVMAllocate(__pyx_v_self->mat, __pyx_v_xvec, __pyx_v_fvec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5444, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5426
 *         CHKERR(MatLMVMSetJ0KSP(self.mat, ctype))
 * 
 *     def allocateLMVM(self, Vec x, Vec f) -> None:             # <<<<<<<<<<<<<<
 *         """Allocate all necessary common memory LMVM matrix.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.allocateLMVM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":5446
 *         CHKERR(MatLMVMAllocate(self.mat, xvec, fvec))
 * 
 *     def updateLMVM(self, Vec x, Vec f) -> None:             # <<<<<<<<<<<<<<
 *         """Adds (X-Xprev) and (F-Fprev) updates to LMVM matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_461updateLMVM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_460updateLMVM, "Mat.updateLMVM(self, x: Vec, f: Vec) -> None\nAdds (X-Xprev) and (F-Fprev) updates to LMVM matrix.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        x:\n            Solution vector.\n        f:\n            Function vector.\n\n        See Also\n        --------\n        petsc.MatLMVMUpdate\n        \nSource code at petsc4py/PETSc/Mat.pyx:5446");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_461updateLMVM = {"updateLMVM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_461updateLMVM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_460updateLMVM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_461updateLMVM(PyObject *__pyx_v_self, 
#if 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("updateLMVM (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_f,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5446, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5446, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5446, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "updateLMVM", 0) < (0)) __PYX_ERR(46, 5446, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("updateLMVM", 1, 2, 2, i); __PYX_ERR(46, 5446, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5446, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5446, __pyx_L3_error)
    }
    __pyx_v_x = ((struct PyPetscVecObject *)values[0]);
    __pyx_v_f = ((struct PyPetscVecObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("updateLMVM", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 5446, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.updateLMVM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 5446, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(46, 5446, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_460updateLMVM(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_x, __pyx_v_f);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_460updateLMVM(struct PyPetscMatObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_x, struct PyPetscVecObject *__pyx_v_f) {
  Vec __pyx_v_xvec;
  Vec __pyx_v_fvec;
  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("updateLMVM", 0);

  /* "petsc4py/PETSc/Mat.pyx":5462
 *         petsc.MatLMVMUpdate
 *         """
 *         cdef PetscVec xvec = x.vec             # <<<<<<<<<<<<<<
 *         cdef PetscVec fvec = f.vec
 *         CHKERR(MatLMVMUpdate(self.mat, xvec, fvec))
*/
  __pyx_t_1 = __pyx_v_x->vec;
  __pyx_v_xvec = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5463
 *         """
 *         cdef PetscVec xvec = x.vec
 *         cdef PetscVec fvec = f.vec             # <<<<<<<<<<<<<<
 *         CHKERR(MatLMVMUpdate(self.mat, xvec, fvec))
 * 
*/
  __pyx_t_1 = __pyx_v_f->vec;
  __pyx_v_fvec = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5464
 *         cdef PetscVec xvec = x.vec
 *         cdef PetscVec fvec = f.vec
 *         CHKERR(MatLMVMUpdate(self.mat, xvec, fvec))             # <<<<<<<<<<<<<<
 * 
 *     def resetLMVM(self, destructive: bool = False) -> None:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatLMVMUpdate(__pyx_v_self->mat, __pyx_v_xvec, __pyx_v_fvec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5464, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5446
 *         CHKERR(MatLMVMAllocate(self.mat, xvec, fvec))
 * 
 *     def updateLMVM(self, Vec x, Vec f) -> None:             # <<<<<<<<<<<<<<
 *         """Adds (X-Xprev) and (F-Fprev) updates to LMVM matrix.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.updateLMVM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":5466
 *         CHKERR(MatLMVMUpdate(self.mat, xvec, fvec))
 * 
 *     def resetLMVM(self, destructive: bool = False) -> None:             # <<<<<<<<<<<<<<
 *         """Flushes all of the accumulated updates out of the LMVM matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_463resetLMVM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_462resetLMVM, "Mat.resetLMVM(self, destructive: bool = False) -> None\nFlushes all of the accumulated updates out of the LMVM matrix.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        destructive:\n            Flag for enabling destruction of data structures.\n\n        See Also\n        --------\n        petsc.MatLMVMReset\n        \nSource code at petsc4py/PETSc/Mat.pyx:5466");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_463resetLMVM = {"resetLMVM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_463resetLMVM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_462resetLMVM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_463resetLMVM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_destructive = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("resetLMVM (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_destructive,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5466, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5466, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "resetLMVM", 0) < (0)) __PYX_ERR(46, 5466, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5466, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_destructive = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("resetLMVM", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 5466, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.resetLMVM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_462resetLMVM(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_destructive);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_462resetLMVM(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_destructive) {
  PetscBool __pyx_v_cdestructive;
  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("resetLMVM", 0);

  /* "petsc4py/PETSc/Mat.pyx":5480
 *         petsc.MatLMVMReset
 *         """
 *         cdef PetscBool cdestructive = asBool(destructive)             # <<<<<<<<<<<<<<
 *         CHKERR(MatLMVMReset(self.mat, cdestructive))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_destructive); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(46, 5480, __pyx_L1_error)
  __pyx_v_cdestructive = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5481
 *         """
 *         cdef PetscBool cdestructive = asBool(destructive)
 *         CHKERR(MatLMVMReset(self.mat, cdestructive))             # <<<<<<<<<<<<<<
 * 
 *     # MUMPS
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatLMVMReset(__pyx_v_self->mat, __pyx_v_cdestructive)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5481, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5466
 *         CHKERR(MatLMVMUpdate(self.mat, xvec, fvec))
 * 
 *     def resetLMVM(self, destructive: bool = False) -> None:             # <<<<<<<<<<<<<<
 *         """Flushes all of the accumulated updates out of the LMVM matrix.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.resetLMVM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":5485
 *     # 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_465setMumpsIcntl(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_464setMumpsIcntl, "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:5485");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_465setMumpsIcntl = {"setMumpsIcntl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_465setMumpsIcntl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_464setMumpsIcntl};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_465setMumpsIcntl(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_icntl,&__pyx_mstate_global->__pyx_n_u_ival,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5485, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5485, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5485, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMumpsIcntl", 0) < (0)) __PYX_ERR(46, 5485, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMumpsIcntl", 1, 2, 2, i); __PYX_ERR(46, 5485, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5485, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5485, __pyx_L3_error)
    }
    __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, 5485, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_464setMumpsIcntl(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl, __pyx_v_ival);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_464setMumpsIcntl(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5502
 * 
 *         """
 *         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, 5502, __pyx_L1_error)
  __pyx_v__icntl = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5503
 *         """
 *         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, 5503, __pyx_L1_error)
  __pyx_v__ival = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5504
 *         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, 5504, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5485
 *     # 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":5506
 *         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_467getMumpsIcntl(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_466getMumpsIcntl, "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:5506");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_467getMumpsIcntl = {"getMumpsIcntl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_467getMumpsIcntl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_466getMumpsIcntl};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_467getMumpsIcntl(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_icntl,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5506, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getMumpsIcntl", 0) < (0)) __PYX_ERR(46, 5506, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getMumpsIcntl", 1, 1, 1, i); __PYX_ERR(46, 5506, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5506, __pyx_L3_error)
    }
    __pyx_v_icntl = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getMumpsIcntl", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5506, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_466getMumpsIcntl(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_466getMumpsIcntl(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5516
 * 
 *         """
 *         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, 5516, __pyx_L1_error)
  __pyx_v__icntl = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5517
 *         """
 *         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":5518
 *         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, 5518, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5519
 *         cdef PetscInt ival = 0
 *         CHKERR(MatMumpsGetIcntl(self.mat, _icntl, &ival))
 *         return toInt(ival)             # <<<<<<<<<<<<<<
 * 
 *     def setMumpsCntl(self, icntl: int, val: float) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_ival); if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 5519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5506
 *         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":5521
 *         return toInt(ival)
 * 
 *     def setMumpsCntl(self, icntl: int, val: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set a MUMPS parameter, ``CNTL[icntl] = val``.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_469setMumpsCntl(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_468setMumpsCntl, "Mat.setMumpsCntl(self, icntl: int, val: float) -> None\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:5521");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_469setMumpsCntl = {"setMumpsCntl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_469setMumpsCntl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_468setMumpsCntl};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_469setMumpsCntl(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_icntl,&__pyx_mstate_global->__pyx_n_u_val,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5521, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5521, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5521, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMumpsCntl", 0) < (0)) __PYX_ERR(46, 5521, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMumpsCntl", 1, 2, 2, i); __PYX_ERR(46, 5521, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5521, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5521, __pyx_L3_error)
    }
    __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, 5521, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_468setMumpsCntl(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl, __pyx_v_val);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_468setMumpsCntl(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5538
 * 
 *         """
 *         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, 5538, __pyx_L1_error)
  __pyx_v__icntl = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5539
 *         """
 *         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, 5539, __pyx_L1_error)
  __pyx_v__val = __pyx_t_2;

  /* "petsc4py/PETSc/Mat.pyx":5540
 *         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, 5540, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5521
 *         return toInt(ival)
 * 
 *     def setMumpsCntl(self, icntl: int, val: float) -> None:             # <<<<<<<<<<<<<<
 *         """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":5542
 *         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_471getMumpsCntl(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_470getMumpsCntl, "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:5542");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_471getMumpsCntl = {"getMumpsCntl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_471getMumpsCntl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_470getMumpsCntl};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_471getMumpsCntl(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_icntl,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5542, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5542, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getMumpsCntl", 0) < (0)) __PYX_ERR(46, 5542, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getMumpsCntl", 1, 1, 1, i); __PYX_ERR(46, 5542, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5542, __pyx_L3_error)
    }
    __pyx_v_icntl = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getMumpsCntl", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5542, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_470getMumpsCntl(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_470getMumpsCntl(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5552
 * 
 *         """
 *         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, 5552, __pyx_L1_error)
  __pyx_v__icntl = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5553
 *         """
 *         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":5554
 *         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, 5554, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5555
 *         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, 5555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5542
 *         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":5557
 *         return toReal(val)
 * 
 *     def getMumpsInfo(self, icntl: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the MUMPS parameter, ``INFO[icntl]``.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_473getMumpsInfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_472getMumpsInfo, "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:5557");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_473getMumpsInfo = {"getMumpsInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_473getMumpsInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_472getMumpsInfo};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_473getMumpsInfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_icntl,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5557, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5557, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getMumpsInfo", 0) < (0)) __PYX_ERR(46, 5557, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getMumpsInfo", 1, 1, 1, i); __PYX_ERR(46, 5557, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5557, __pyx_L3_error)
    }
    __pyx_v_icntl = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getMumpsInfo", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5557, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_472getMumpsInfo(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_472getMumpsInfo(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5572
 * 
 *         """
 *         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, 5572, __pyx_L1_error)
  __pyx_v__icntl = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5573
 *         """
 *         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":5574
 *         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, 5574, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5575
 *         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, 5575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5557
 *         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":5577
 *         return toInt(ival)
 * 
 *     def getMumpsInfog(self, icntl: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the MUMPS parameter, ``INFOG[icntl]``.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_475getMumpsInfog(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_474getMumpsInfog, "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:5577");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_475getMumpsInfog = {"getMumpsInfog", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_475getMumpsInfog, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_474getMumpsInfog};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_475getMumpsInfog(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_icntl,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5577, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getMumpsInfog", 0) < (0)) __PYX_ERR(46, 5577, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getMumpsInfog", 1, 1, 1, i); __PYX_ERR(46, 5577, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5577, __pyx_L3_error)
    }
    __pyx_v_icntl = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getMumpsInfog", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5577, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_474getMumpsInfog(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_474getMumpsInfog(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5592
 * 
 *         """
 *         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, 5592, __pyx_L1_error)
  __pyx_v__icntl = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5593
 *         """
 *         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":5594
 *         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, 5594, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5595
 *         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, 5595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5577
 *         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":5597
 *         return toInt(ival)
 * 
 *     def getMumpsRinfo(self, icntl: int) -> float:             # <<<<<<<<<<<<<<
 *         """Return the MUMPS parameter, ``RINFO[icntl]``.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_477getMumpsRinfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_476getMumpsRinfo, "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:5597");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_477getMumpsRinfo = {"getMumpsRinfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_477getMumpsRinfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_476getMumpsRinfo};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_477getMumpsRinfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_icntl,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5597, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getMumpsRinfo", 0) < (0)) __PYX_ERR(46, 5597, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getMumpsRinfo", 1, 1, 1, i); __PYX_ERR(46, 5597, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5597, __pyx_L3_error)
    }
    __pyx_v_icntl = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getMumpsRinfo", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5597, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_476getMumpsRinfo(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_476getMumpsRinfo(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5612
 * 
 *         """
 *         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, 5612, __pyx_L1_error)
  __pyx_v__icntl = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5613
 *         """
 *         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":5614
 *         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, 5614, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5615
 *         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, 5615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5597
 *         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":5617
 *         return toReal(val)
 * 
 *     def getMumpsRinfog(self, icntl: int) -> float:             # <<<<<<<<<<<<<<
 *         """Return the MUMPS parameter, ``RINFOG[icntl]``.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_479getMumpsRinfog(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_478getMumpsRinfog, "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:5617");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_479getMumpsRinfog = {"getMumpsRinfog", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_479getMumpsRinfog, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_478getMumpsRinfog};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_479getMumpsRinfog(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_icntl,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5617, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5617, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getMumpsRinfog", 0) < (0)) __PYX_ERR(46, 5617, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getMumpsRinfog", 1, 1, 1, i); __PYX_ERR(46, 5617, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5617, __pyx_L3_error)
    }
    __pyx_v_icntl = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getMumpsRinfog", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5617, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_478getMumpsRinfog(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_icntl);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_478getMumpsRinfog(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5632
 * 
 *         """
 *         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, 5632, __pyx_L1_error)
  __pyx_v__icntl = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5633
 *         """
 *         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":5634
 *         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, 5634, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5635
 *         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, 5635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5617
 *         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":5639
 *     # 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_481solveForward(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_480solveForward, "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:5639");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_481solveForward = {"solveForward", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_481solveForward, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_480solveForward};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_481solveForward(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_b,&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5639, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5639, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5639, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "solveForward", 0) < (0)) __PYX_ERR(46, 5639, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("solveForward", 1, 2, 2, i); __PYX_ERR(46, 5639, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5639, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5639, __pyx_L3_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("solveForward", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 5639, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(46, 5639, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 5639, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_480solveForward(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_480solveForward(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5656
 * 
 *         """
 *         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, 5656, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5639
 *     # 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":5658
 *         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_483solveBackward(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_482solveBackward, "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:5658");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_483solveBackward = {"solveBackward", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_483solveBackward, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_482solveBackward};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_483solveBackward(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_b,&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5658, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5658, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5658, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "solveBackward", 0) < (0)) __PYX_ERR(46, 5658, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("solveBackward", 1, 2, 2, i); __PYX_ERR(46, 5658, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5658, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5658, __pyx_L3_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("solveBackward", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 5658, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(46, 5658, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 5658, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_482solveBackward(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_482solveBackward(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5675
 * 
 *         """
 *         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, 5675, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5658
 *         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":5677
 *         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_485solve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_484solve, "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:5677");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_485solve = {"solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_485solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_484solve};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_485solve(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_b,&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5677, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5677, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5677, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "solve", 0) < (0)) __PYX_ERR(46, 5677, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("solve", 1, 2, 2, i); __PYX_ERR(46, 5677, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5677, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5677, __pyx_L3_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", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 5677, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(46, 5677, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 5677, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_484solve(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_484solve(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5698
 * 
 *         """
 *         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, 5698, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5677
 *         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":5700
 *         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_487solveTranspose(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_486solveTranspose, "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:5700");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_487solveTranspose = {"solveTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_487solveTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_486solveTranspose};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_487solveTranspose(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_b,&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5700, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5700, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5700, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "solveTranspose", 0) < (0)) __PYX_ERR(46, 5700, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("solveTranspose", 1, 2, 2, i); __PYX_ERR(46, 5700, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5700, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5700, __pyx_L3_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("solveTranspose", 1, 2, 2, __pyx_nargs); __PYX_ERR(46, 5700, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(46, 5700, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 5700, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_486solveTranspose(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_486solveTranspose(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5719
 * 
 *         """
 *         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, 5719, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5700
 *         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":5721
 *         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_489solveAdd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_488solveAdd, "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:5721");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_489solveAdd = {"solveAdd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_489solveAdd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_488solveAdd};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_489solveAdd(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_b,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5721, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 5721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "solveAdd", 0) < (0)) __PYX_ERR(46, 5721, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("solveAdd", 1, 3, 3, i); __PYX_ERR(46, 5721, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5721, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5721, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 5721, __pyx_L3_error)
    }
    __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, 5721, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(46, 5721, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(46, 5721, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 5721, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_488solveAdd(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_488solveAdd(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5742
 * 
 *         """
 *         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, 5742, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5721
 *         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":5744
 *         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_491solveTransposeAdd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_490solveTransposeAdd, "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:5744");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_491solveTransposeAdd = {"solveTransposeAdd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_491solveTransposeAdd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_490solveTransposeAdd};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_491solveTransposeAdd(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_b,&__pyx_mstate_global->__pyx_n_u_y,&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5744, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 5744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "solveTransposeAdd", 0) < (0)) __PYX_ERR(46, 5744, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("solveTransposeAdd", 1, 3, 3, i); __PYX_ERR(46, 5744, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5744, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5744, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 5744, __pyx_L3_error)
    }
    __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, 5744, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(46, 5744, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(46, 5744, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(46, 5744, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_490solveTransposeAdd(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_490solveTransposeAdd(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5765
 * 
 *         """
 *         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, 5765, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5744
 *         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":5767
 *         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_493matSolve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_492matSolve, "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:5767");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_493matSolve = {"matSolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_493matSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_492matSolve};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_493matSolve(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_X,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5767, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5767, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5767, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "matSolve", 0) < (0)) __PYX_ERR(46, 5767, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("matSolve", 1, 2, 2, i); __PYX_ERR(46, 5767, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5767, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5767, __pyx_L3_error)
    }
    __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, 5767, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "B", 0))) __PYX_ERR(46, 5767, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(46, 5767, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_492matSolve(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_B, __pyx_v_X);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_492matSolve(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5785
 * 
 *         """
 *         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, 5785, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5767
 *         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":5789
 *     # 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_495setDenseLDA(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_494setDenseLDA, "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:5789");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_495setDenseLDA = {"setDenseLDA", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_495setDenseLDA, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_494setDenseLDA};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_495setDenseLDA(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_lda,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5789, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5789, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDenseLDA", 0) < (0)) __PYX_ERR(46, 5789, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDenseLDA", 1, 1, 1, i); __PYX_ERR(46, 5789, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5789, __pyx_L3_error)
    }
    __pyx_v_lda = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setDenseLDA", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5789, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_494setDenseLDA(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_lda);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_494setDenseLDA(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5804
 * 
 *         """
 *         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, 5804, __pyx_L1_error)
  __pyx_v__ilda = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5805
 *         """
 *         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, 5805, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5789
 *     # 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":5807
 *         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_497getDenseLDA(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_496getDenseLDA, "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:5807");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_497getDenseLDA = {"getDenseLDA", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_497getDenseLDA, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_496getDenseLDA};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_497getDenseLDA(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDenseLDA", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_496getDenseLDA(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_496getDenseLDA(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":5817
 * 
 *         """
 *         cdef PetscInt lda=0             # <<<<<<<<<<<<<<
 *         CHKERR(MatDenseGetLDA(self.mat, &lda))
 *         return toInt(lda)
*/
  __pyx_v_lda = 0;

  /* "petsc4py/PETSc/Mat.pyx":5818
 *         """
 *         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, 5818, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5819
 *         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, 5819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5807
 *         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":5821
 *         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_499getDenseArray(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_498getDenseArray, "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:5821");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_499getDenseArray = {"getDenseArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_499getDenseArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_498getDenseArray};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_499getDenseArray(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_readonly,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5821, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5821, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getDenseArray", 0) < (0)) __PYX_ERR(46, 5821, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5821, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_readonly = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getDenseArray", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 5821, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_498getDenseArray(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_readonly);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_498getDenseArray(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];
  PyArrayObject *__pyx_v_array = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscErrorCode __pyx_t_1;
  int __pyx_t_2;
  int __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("getDenseArray", 0);

  /* "petsc4py/PETSc/Mat.pyx":5836
 * 
 *         """
 *         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":5837
 *         """
 *         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":5838
 *         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, 5838, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5839
 *         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, 5839, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5840
 *         CHKERR(MatGetLocalSize(self.mat, &m, NULL))
 *         CHKERR(MatGetSize(self.mat, NULL, &N))
 *         CHKERR(MatDenseGetLDA(self.mat, &lda))             # <<<<<<<<<<<<<<
 *         if readonly:
 *             CHKERR(MatDenseGetArrayRead(self.mat, <const PetscScalar**>&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, 5840, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5841
 *         CHKERR(MatGetSize(self.mat, NULL, &N))
 *         CHKERR(MatDenseGetLDA(self.mat, &lda))
 *         if readonly:             # <<<<<<<<<<<<<<
 *             CHKERR(MatDenseGetArrayRead(self.mat, <const PetscScalar**>&data))
 *         else:
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_readonly); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(46, 5841, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/Mat.pyx":5842
 *         CHKERR(MatDenseGetLDA(self.mat, &lda))
 *         if readonly:
 *             CHKERR(MatDenseGetArrayRead(self.mat, <const PetscScalar**>&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, 5842, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":5841
 *         CHKERR(MatGetSize(self.mat, NULL, &N))
 *         CHKERR(MatDenseGetLDA(self.mat, &lda))
 *         if readonly:             # <<<<<<<<<<<<<<
 *             CHKERR(MatDenseGetArrayRead(self.mat, <const PetscScalar**>&data))
 *         else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Mat.pyx":5844
 *             CHKERR(MatDenseGetArrayRead(self.mat, <const PetscScalar**>&data))
 *         else:
 *             CHKERR(MatDenseGetArray(self.mat, &data))             # <<<<<<<<<<<<<<
 *         cdef int typenum = NPY_PETSC_SCALAR
 *         cdef int itemsize = <int>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, 5844, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Mat.pyx":5845
 *         else:
 *             CHKERR(MatDenseGetArray(self.mat, &data))
 *         cdef int typenum = NPY_PETSC_SCALAR             # <<<<<<<<<<<<<<
 *         cdef int itemsize = <int>sizeof(PetscScalar)
 *         cdef int flags = NPY_ARRAY_FARRAY_RO if readonly else NPY_ARRAY_FARRAY
*/
  __pyx_v_typenum = NPY_PETSC_SCALAR;

  /* "petsc4py/PETSc/Mat.pyx":5846
 *             CHKERR(MatDenseGetArray(self.mat, &data))
 *         cdef int typenum = NPY_PETSC_SCALAR
 *         cdef int itemsize = <int>sizeof(PetscScalar)             # <<<<<<<<<<<<<<
 *         cdef int flags = NPY_ARRAY_FARRAY_RO if readonly else NPY_ARRAY_FARRAY
 *         cdef npy_intp dims[2], strides[2]
*/
  __pyx_v_itemsize = ((int)(sizeof(PetscScalar)));

  /* "petsc4py/PETSc/Mat.pyx":5847
 *         cdef int typenum = NPY_PETSC_SCALAR
 *         cdef int itemsize = <int>sizeof(PetscScalar)
 *         cdef int flags = NPY_ARRAY_FARRAY_RO if readonly else NPY_ARRAY_FARRAY             # <<<<<<<<<<<<<<
 *         cdef npy_intp dims[2], strides[2]
 *         dims[0] = <npy_intp>m; strides[0] = <npy_intp>sizeof(PetscScalar)
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_readonly); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(46, 5847, __pyx_L1_error)
  if (__pyx_t_2) {
    __pyx_t_3 = NPY_ARRAY_FARRAY_RO;
  } else {
    __pyx_t_3 = NPY_ARRAY_FARRAY;
  }
  __pyx_v_flags = __pyx_t_3;

  /* "petsc4py/PETSc/Mat.pyx":5849
 *         cdef int flags = NPY_ARRAY_FARRAY_RO if readonly else NPY_ARRAY_FARRAY
 *         cdef npy_intp dims[2], strides[2]
 *         dims[0] = <npy_intp>m; strides[0] = <npy_intp>sizeof(PetscScalar)             # <<<<<<<<<<<<<<
 *         dims[1] = <npy_intp>N; strides[1] = <npy_intp>(lda*sizeof(PetscScalar))
 *         cdef ndarray array = PyArray_New(<PyTypeObject*>ndarray, 2,
*/
  (__pyx_v_dims[0]) = ((npy_intp)__pyx_v_m);
  (__pyx_v_strides[0]) = ((npy_intp)(sizeof(PetscScalar)));

  /* "petsc4py/PETSc/Mat.pyx":5850
 *         cdef npy_intp dims[2], strides[2]
 *         dims[0] = <npy_intp>m; strides[0] = <npy_intp>sizeof(PetscScalar)
 *         dims[1] = <npy_intp>N; strides[1] = <npy_intp>(lda*sizeof(PetscScalar))             # <<<<<<<<<<<<<<
 *         cdef ndarray array = PyArray_New(<PyTypeObject*>ndarray, 2,
 *                                          dims, typenum, strides,
*/
  (__pyx_v_dims[1]) = ((npy_intp)__pyx_v_N);
  (__pyx_v_strides[1]) = ((npy_intp)(__pyx_v_lda * (sizeof(PetscScalar))));

  /* "petsc4py/PETSc/Mat.pyx":5851
 *         dims[0] = <npy_intp>m; strides[0] = <npy_intp>sizeof(PetscScalar)
 *         dims[1] = <npy_intp>N; strides[1] = <npy_intp>(lda*sizeof(PetscScalar))
 *         cdef ndarray array = PyArray_New(<PyTypeObject*>ndarray, 2,             # <<<<<<<<<<<<<<
 *                                          dims, typenum, strides,
 *                                          data, itemsize, flags, NULL)
*/
  __pyx_t_4 = ((PyObject *)PyArray_New(((PyTypeObject *)__pyx_mstate_global->__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_4)) __PYX_ERR(46, 5851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_array = ((PyArrayObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5854
 *                                          dims, typenum, strides,
 *                                          data, itemsize, flags, NULL)
 *         Py_INCREF(<PyObject*>self)             # <<<<<<<<<<<<<<
 *         PyArray_SetBaseObject(array, self)
 *         if readonly:
*/
  Py_INCREF(((PyObject *)__pyx_v_self));

  /* "petsc4py/PETSc/Mat.pyx":5855
 *                                          data, itemsize, flags, NULL)
 *         Py_INCREF(<PyObject*>self)
 *         PyArray_SetBaseObject(array, self)             # <<<<<<<<<<<<<<
 *         if readonly:
 *             CHKERR(MatDenseRestoreArrayRead(self.mat, <const PetscScalar**>&data))
*/
  __pyx_t_5 = PyArray_SetBaseObject(__pyx_v_array, ((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(46, 5855, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5856
 *         Py_INCREF(<PyObject*>self)
 *         PyArray_SetBaseObject(array, self)
 *         if readonly:             # <<<<<<<<<<<<<<
 *             CHKERR(MatDenseRestoreArrayRead(self.mat, <const PetscScalar**>&data))
 *         else:
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_readonly); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(46, 5856, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/Mat.pyx":5857
 *         PyArray_SetBaseObject(array, self)
 *         if readonly:
 *             CHKERR(MatDenseRestoreArrayRead(self.mat, <const PetscScalar**>&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, 5857, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":5856
 *         Py_INCREF(<PyObject*>self)
 *         PyArray_SetBaseObject(array, self)
 *         if readonly:             # <<<<<<<<<<<<<<
 *             CHKERR(MatDenseRestoreArrayRead(self.mat, <const PetscScalar**>&data))
 *         else:
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/Mat.pyx":5859
 *             CHKERR(MatDenseRestoreArrayRead(self.mat, <const PetscScalar**>&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, 5859, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/Mat.pyx":5860
 *         else:
 *             CHKERR(MatDenseRestoreArray(self.mat, &data))
 *         return array             # <<<<<<<<<<<<<<
 * 
 *     def getDenseLocalMatrix(self) -> Mat:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_array);
  __pyx_r = ((PyObject *)__pyx_v_array);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5821
 *         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_4);
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDenseArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_array);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":5862
 *         return array
 * 
 *     def getDenseLocalMatrix(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the local part of the dense matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_501getDenseLocalMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_500getDenseLocalMatrix, "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:5862");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_501getDenseLocalMatrix = {"getDenseLocalMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_501getDenseLocalMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_500getDenseLocalMatrix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_501getDenseLocalMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDenseLocalMatrix", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_500getDenseLocalMatrix(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_500getDenseLocalMatrix(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;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDenseLocalMatrix", 0);

  /* "petsc4py/PETSc/Mat.pyx":5872
 * 
 *         """
 *         cdef Mat mat = type(self)()             # <<<<<<<<<<<<<<
 *         CHKERR(MatDenseGetLocalMatrix(self.mat, &mat.mat))
 *         CHKERR(PetscINCREF(mat.obj))
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(46, 5872, __pyx_L1_error)
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5873
 *         """
 *         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, 5873, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5874
 *         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, 5874, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5875
 *         CHKERR(MatDenseGetLocalMatrix(self.mat, &mat.mat))
 *         CHKERR(PetscINCREF(mat.obj))
 *         return mat             # <<<<<<<<<<<<<<
 * 
 *     def getDenseSubMatrix(self,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_mat);
  __pyx_r = ((PyObject *)__pyx_v_mat);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5862
 *         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":5877
 *         return mat
 * 
 *     def getDenseSubMatrix(self,             # <<<<<<<<<<<<<<
 *                           rbegin: int = DECIDE,
 *                           rend: int = DECIDE,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_503getDenseSubMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_502getDenseSubMatrix, "Mat.getDenseSubMatrix(self, rbegin: int = DECIDE, rend: int = DECIDE, cbegin: int = DECIDE, cend: int = DECIDE) -> Mat\nGet access to a submatrix of a `Type.DENSE` matrix.\n\n        Collective.\n\n        Parameters\n        ----------\n        rbegin\n            the first global row index.\n        rend\n            the global row index past the last one.\n        cbegin\n            the first global column index.\n        cend\n            the global column index past the last one.\n\n        See Also\n        --------\n        restoreDenseSubMatrix, petsc.MatDenseGetSubMatrix\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:5877");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_503getDenseSubMatrix = {"getDenseSubMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_503getDenseSubMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_502getDenseSubMatrix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_503getDenseSubMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_rbegin = 0;
  PyObject *__pyx_v_rend = 0;
  PyObject *__pyx_v_cbegin = 0;
  PyObject *__pyx_v_cend = 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("getDenseSubMatrix (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rbegin,&__pyx_mstate_global->__pyx_n_u_rend,&__pyx_mstate_global->__pyx_n_u_cbegin,&__pyx_mstate_global->__pyx_n_u_cend,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5877, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 5877, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 5877, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5877, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5877, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getDenseSubMatrix", 0) < (0)) __PYX_ERR(46, 5877, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__22);
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__23);
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__24);
      if (!values[3]) values[3] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__25);
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(46, 5877, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 5877, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5877, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5877, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__22);
      if (!values[1]) values[1] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__23);
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__24);
      if (!values[3]) values[3] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__25);
    }
    __pyx_v_rbegin = values[0];
    __pyx_v_rend = values[1];
    __pyx_v_cbegin = values[2];
    __pyx_v_cend = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getDenseSubMatrix", 0, 0, 4, __pyx_nargs); __PYX_ERR(46, 5877, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.getDenseSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_502getDenseSubMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_rbegin, __pyx_v_rend, __pyx_v_cbegin, __pyx_v_cend);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_502getDenseSubMatrix(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_rbegin, PyObject *__pyx_v_rend, PyObject *__pyx_v_cbegin, PyObject *__pyx_v_cend) {
  struct PyPetscMatObject *__pyx_v_mat = 0;
  PetscInt __pyx_v_crbegin;
  PetscInt __pyx_v_crend;
  PetscInt __pyx_v_ccbegin;
  PetscInt __pyx_v_ccend;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __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("getDenseSubMatrix", 0);

  /* "petsc4py/PETSc/Mat.pyx":5902
 * 
 *         """
 *         cdef Mat mat = type(self)()             # <<<<<<<<<<<<<<
 *         cdef PetscInt crbegin = asInt(rbegin)
 *         cdef PetscInt crend = asInt(rend)
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 5902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(46, 5902, __pyx_L1_error)
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5903
 *         """
 *         cdef Mat mat = type(self)()
 *         cdef PetscInt crbegin = asInt(rbegin)             # <<<<<<<<<<<<<<
 *         cdef PetscInt crend = asInt(rend)
 *         cdef PetscInt ccbegin = asInt(cbegin)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_rbegin); if (unlikely(__pyx_t_5 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 5903, __pyx_L1_error)
  __pyx_v_crbegin = __pyx_t_5;

  /* "petsc4py/PETSc/Mat.pyx":5904
 *         cdef Mat mat = type(self)()
 *         cdef PetscInt crbegin = asInt(rbegin)
 *         cdef PetscInt crend = asInt(rend)             # <<<<<<<<<<<<<<
 *         cdef PetscInt ccbegin = asInt(cbegin)
 *         cdef PetscInt ccend = asInt(cend)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_rend); if (unlikely(__pyx_t_5 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 5904, __pyx_L1_error)
  __pyx_v_crend = __pyx_t_5;

  /* "petsc4py/PETSc/Mat.pyx":5905
 *         cdef PetscInt crbegin = asInt(rbegin)
 *         cdef PetscInt crend = asInt(rend)
 *         cdef PetscInt ccbegin = asInt(cbegin)             # <<<<<<<<<<<<<<
 *         cdef PetscInt ccend = asInt(cend)
 *         CHKERR(MatDenseGetSubMatrix(self.mat, crbegin, crend, ccbegin, ccend, &mat.mat))
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_cbegin); if (unlikely(__pyx_t_5 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 5905, __pyx_L1_error)
  __pyx_v_ccbegin = __pyx_t_5;

  /* "petsc4py/PETSc/Mat.pyx":5906
 *         cdef PetscInt crend = asInt(rend)
 *         cdef PetscInt ccbegin = asInt(cbegin)
 *         cdef PetscInt ccend = asInt(cend)             # <<<<<<<<<<<<<<
 *         CHKERR(MatDenseGetSubMatrix(self.mat, crbegin, crend, ccbegin, ccend, &mat.mat))
 *         CHKERR(PetscINCREF(mat.obj))
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_cend); if (unlikely(__pyx_t_5 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 5906, __pyx_L1_error)
  __pyx_v_ccend = __pyx_t_5;

  /* "petsc4py/PETSc/Mat.pyx":5907
 *         cdef PetscInt ccbegin = asInt(cbegin)
 *         cdef PetscInt ccend = asInt(cend)
 *         CHKERR(MatDenseGetSubMatrix(self.mat, crbegin, crend, ccbegin, ccend, &mat.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(mat.obj))
 *         return mat
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetSubMatrix(__pyx_v_self->mat, __pyx_v_crbegin, __pyx_v_crend, __pyx_v_ccbegin, __pyx_v_ccend, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5907, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5908
 *         cdef PetscInt ccend = asInt(cend)
 *         CHKERR(MatDenseGetSubMatrix(self.mat, crbegin, crend, ccbegin, ccend, &mat.mat))
 *         CHKERR(PetscINCREF(mat.obj))             # <<<<<<<<<<<<<<
 *         return mat
 * 
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5908, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5909
 *         CHKERR(MatDenseGetSubMatrix(self.mat, crbegin, crend, ccbegin, ccend, &mat.mat))
 *         CHKERR(PetscINCREF(mat.obj))
 *         return mat             # <<<<<<<<<<<<<<
 * 
 *     def restoreDenseSubMatrix(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/Mat.pyx":5877
 *         return mat
 * 
 *     def getDenseSubMatrix(self,             # <<<<<<<<<<<<<<
 *                           rbegin: int = DECIDE,
 *                           rend: int = DECIDE,
*/

  /* 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.getDenseSubMatrix", __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":5911
 *         return mat
 * 
 *     def restoreDenseSubMatrix(self, Mat mat) -> None:             # <<<<<<<<<<<<<<
 *         """Restore access to a submatrix of a `Type.DENSE` matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_505restoreDenseSubMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_504restoreDenseSubMatrix, "Mat.restoreDenseSubMatrix(self, mat: Mat) -> None\nRestore access to a submatrix of a `Type.DENSE` matrix.\n\n        Collective.\n\n        Parameters\n        ----------\n        mat\n            the matrix obtained from `getDenseSubMatrix`.\n\n        See Also\n        --------\n        getDenseSubMatrix, petsc.MatDenseRestoreSubMatrix\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:5911");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_505restoreDenseSubMatrix = {"restoreDenseSubMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_505restoreDenseSubMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_504restoreDenseSubMatrix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_505restoreDenseSubMatrix(PyObject *__pyx_v_self, 
#if 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("restoreDenseSubMatrix (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5911, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5911, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "restoreDenseSubMatrix", 0) < (0)) __PYX_ERR(46, 5911, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("restoreDenseSubMatrix", 1, 1, 1, i); __PYX_ERR(46, 5911, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5911, __pyx_L3_error)
    }
    __pyx_v_mat = ((struct PyPetscMatObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("restoreDenseSubMatrix", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 5911, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.restoreDenseSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 5911, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_504restoreDenseSubMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_504restoreDenseSubMatrix(struct PyPetscMatObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_mat) {
  Mat __pyx_v_v;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Mat __pyx_t_1;
  PetscErrorCode __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("restoreDenseSubMatrix", 0);

  /* "petsc4py/PETSc/Mat.pyx":5926
 * 
 *         """
 *         cdef PetscMat v = mat.mat             # <<<<<<<<<<<<<<
 *         CHKERR(MatDenseRestoreSubMatrix(self.mat, &v))
 *         CHKERR(PetscCLEAR(mat.obj))
*/
  __pyx_t_1 = __pyx_v_mat->mat;
  __pyx_v_v = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":5927
 *         """
 *         cdef PetscMat v = mat.mat
 *         CHKERR(MatDenseRestoreSubMatrix(self.mat, &v))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscCLEAR(mat.obj))
 * 
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreSubMatrix(__pyx_v_self->mat, (&__pyx_v_v))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5927, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5928
 *         cdef PetscMat v = mat.mat
 *         CHKERR(MatDenseRestoreSubMatrix(self.mat, &v))
 *         CHKERR(PetscCLEAR(mat.obj))             # <<<<<<<<<<<<<<
 * 
 *     def getDenseColumnVec(self, i: int, mode: AccessModeSpec = 'rw') -> Vec:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_mat->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5928, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5911
 *         return mat
 * 
 *     def restoreDenseSubMatrix(self, Mat mat) -> None:             # <<<<<<<<<<<<<<
 *         """Restore access to a submatrix of a `Type.DENSE` matrix.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.restoreDenseSubMatrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":5930
 *         CHKERR(PetscCLEAR(mat.obj))
 * 
 *     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_507getDenseColumnVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_506getDenseColumnVec, "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 vector to be returned.\n\n        See Also\n        --------\n        restoreDenseColumnVec, petsc.MatDenseGetColumnVec\n        petsc.MatDenseGetColumnVecRead, petsc.MatDenseGetColumnVecWrite\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:5930");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_507getDenseColumnVec = {"getDenseColumnVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_507getDenseColumnVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_506getDenseColumnVec};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_507getDenseColumnVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_i,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5930, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5930, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5930, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getDenseColumnVec", 0) < (0)) __PYX_ERR(46, 5930, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getDenseColumnVec", 0, 1, 2, i); __PYX_ERR(46, 5930, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5930, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5930, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
    }
    __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, 5930, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_506getDenseColumnVec(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_i, __pyx_v_mode);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_506getDenseColumnVec(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscInt __pyx_t_6;
  PetscErrorCode __pyx_t_7;
  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":5948
 * 
 *         """
 *         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_mstate_global->__pyx_n_u_rw);
    __Pyx_DECREF_SET(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_rw);
  }

  /* "petsc4py/PETSc/Mat.pyx":5949
 *         """
 *         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_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_rw, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5949, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_r, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5949, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_w, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5949, __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":5950
 *         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_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_rw_r_or_w};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5950, __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, 5950, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":5949
 *         """
 *         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":5951
 *         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_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 5951, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_v = ((struct PyPetscVecObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5952
 *             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_6 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_i); if (unlikely(__pyx_t_6 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 5952, __pyx_L1_error)
  __pyx_v__i = __pyx_t_6;

  /* "petsc4py/PETSc/Mat.pyx":5953
 *         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_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_rw, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5953, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/Mat.pyx":5954
 *         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_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetColumnVec(__pyx_v_self->mat, __pyx_v__i, (&__pyx_v_v->vec))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5954, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":5953
 *         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":5955
 *         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_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_r, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 5955, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/Mat.pyx":5956
 *             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_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetColumnVecRead(__pyx_v_self->mat, __pyx_v__i, (&__pyx_v_v->vec))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5956, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":5955
 *         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":5958
 *             CHKERR(MatDenseGetColumnVecRead(self.mat, _i, &v.vec))
 *         else:
 *             CHKERR(MatDenseGetColumnVecWrite(self.mat, _i, &v.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(v.obj))
 *         return v
*/
  /*else*/ {
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetColumnVecWrite(__pyx_v_self->mat, __pyx_v__i, (&__pyx_v_v->vec))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5958, __pyx_L1_error)
  }
  __pyx_L8:;

  /* "petsc4py/PETSc/Mat.pyx":5959
 *         else:
 *             CHKERR(MatDenseGetColumnVecWrite(self.mat, _i, &v.vec))
 *         CHKERR(PetscINCREF(v.obj))             # <<<<<<<<<<<<<<
 *         return v
 * 
*/
  __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_v->__pyx_base.obj)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5959, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":5960
 *             CHKERR(MatDenseGetColumnVecWrite(self.mat, _i, &v.vec))
 *         CHKERR(PetscINCREF(v.obj))
 *         return v             # <<<<<<<<<<<<<<
 * 
 *     def restoreDenseColumnVec(self, i: int, mode: AccessModeSpec = 'rw', Vec V=None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_v);
  __pyx_r = ((PyObject *)__pyx_v_v);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":5930
 *         CHKERR(PetscCLEAR(mat.obj))
 * 
 *     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_XDECREF(__pyx_t_4);
  __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":5962
 *         return v
 * 
 *     def restoreDenseColumnVec(self, i: int, mode: AccessModeSpec = 'rw', Vec V=None) -> None:             # <<<<<<<<<<<<<<
 *         """Restore the i column vector of the dense matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_509restoreDenseColumnVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_508restoreDenseColumnVec, "Mat.restoreDenseColumnVec(self, i: int, mode: AccessModeSpec = 'rw', V: Vec | None = None) -> 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 vector to be restored.\n        V\n            The vector obtained from calling `getDenseColumnVec`.\n\n        See Also\n        --------\n        getDenseColumnVec, petsc.MatDenseRestoreColumnVec\n        petsc.MatDenseRestoreColumnVecRead, petsc.MatDenseRestoreColumnVecWrite\n\n        \nSource code at petsc4py/PETSc/Mat.pyx:5962");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_509restoreDenseColumnVec = {"restoreDenseColumnVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_509restoreDenseColumnVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_508restoreDenseColumnVec};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_509restoreDenseColumnVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_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;
  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("restoreDenseColumnVec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_i,&__pyx_mstate_global->__pyx_n_u_mode,&__pyx_mstate_global->__pyx_n_u_V,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 5962, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 5962, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5962, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5962, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "restoreDenseColumnVec", 0) < (0)) __PYX_ERR(46, 5962, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("restoreDenseColumnVec", 0, 1, 3, i); __PYX_ERR(46, 5962, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 5962, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 5962, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 5962, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __pyx_v_i = values[0];
    __pyx_v_mode = values[1];
    __pyx_v_V = ((struct PyPetscVecObject *)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("restoreDenseColumnVec", 0, 1, 3, __pyx_nargs); __PYX_ERR(46, 5962, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Mat.restoreDenseColumnVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_V), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "V", 0))) __PYX_ERR(46, 5962, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_508restoreDenseColumnVec(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_i, __pyx_v_mode, __pyx_v_V);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_508restoreDenseColumnVec(struct PyPetscMatObject *__pyx_v_self, PyObject *__pyx_v_i, PyObject *__pyx_v_mode, struct PyPetscVecObject *__pyx_v_V) {
  Vec __pyx_v_v;
  PetscInt __pyx_v__i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Vec __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("restoreDenseColumnVec", 0);

  /* "petsc4py/PETSc/Mat.pyx":5982
 * 
 *         """
 *         cdef PetscVec v = NULL             # <<<<<<<<<<<<<<
 *         if V is not None:
 *             v = V.vec
*/
  __pyx_v_v = NULL;

  /* "petsc4py/PETSc/Mat.pyx":5983
 *         """
 *         cdef PetscVec v = NULL
 *         if V is not None:             # <<<<<<<<<<<<<<
 *             v = V.vec
 *         cdef PetscInt _i = asInt(i)
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_V) != Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Mat.pyx":5984
 *         cdef PetscVec v = NULL
 *         if V is not None:
 *             v = V.vec             # <<<<<<<<<<<<<<
 *         cdef PetscInt _i = asInt(i)
 *         if mode == 'rw':
*/
    __pyx_t_2 = __pyx_v_V->vec;
    __pyx_v_v = __pyx_t_2;

    /* "petsc4py/PETSc/Mat.pyx":5983
 *         """
 *         cdef PetscVec v = NULL
 *         if V is not None:             # <<<<<<<<<<<<<<
 *             v = V.vec
 *         cdef PetscInt _i = asInt(i)
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":5985
 *         if V is not None:
 *             v = V.vec
 *         cdef PetscInt _i = asInt(i)             # <<<<<<<<<<<<<<
 *         if mode == 'rw':
 *             CHKERR(MatDenseRestoreColumnVec(self.mat, _i, &v))
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_i); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 5985, __pyx_L1_error)
  __pyx_v__i = __pyx_t_3;

  /* "petsc4py/PETSc/Mat.pyx":5986
 *             v = V.vec
 *         cdef PetscInt _i = asInt(i)
 *         if mode == 'rw':             # <<<<<<<<<<<<<<
 *             CHKERR(MatDenseRestoreColumnVec(self.mat, _i, &v))
 *         elif mode == 'r':
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_rw, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(46, 5986, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Mat.pyx":5987
 *         cdef PetscInt _i = asInt(i)
 *         if mode == 'rw':
 *             CHKERR(MatDenseRestoreColumnVec(self.mat, _i, &v))             # <<<<<<<<<<<<<<
 *         elif mode == 'r':
 *             CHKERR(MatDenseRestoreColumnVecRead(self.mat, _i, &v))
*/
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreColumnVec(__pyx_v_self->mat, __pyx_v__i, (&__pyx_v_v))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5987, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":5986
 *             v = V.vec
 *         cdef PetscInt _i = asInt(i)
 *         if mode == 'rw':             # <<<<<<<<<<<<<<
 *             CHKERR(MatDenseRestoreColumnVec(self.mat, _i, &v))
 *         elif mode == 'r':
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/Mat.pyx":5988
 *         if mode == 'rw':
 *             CHKERR(MatDenseRestoreColumnVec(self.mat, _i, &v))
 *         elif mode == 'r':             # <<<<<<<<<<<<<<
 *             CHKERR(MatDenseRestoreColumnVecRead(self.mat, _i, &v))
 *         else:
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_r, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(46, 5988, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Mat.pyx":5989
 *             CHKERR(MatDenseRestoreColumnVec(self.mat, _i, &v))
 *         elif mode == 'r':
 *             CHKERR(MatDenseRestoreColumnVecRead(self.mat, _i, &v))             # <<<<<<<<<<<<<<
 *         else:
 *             CHKERR(MatDenseRestoreColumnVecWrite(self.mat, _i, &v))
*/
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreColumnVecRead(__pyx_v_self->mat, __pyx_v__i, (&__pyx_v_v))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5989, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":5988
 *         if mode == 'rw':
 *             CHKERR(MatDenseRestoreColumnVec(self.mat, _i, &v))
 *         elif mode == 'r':             # <<<<<<<<<<<<<<
 *             CHKERR(MatDenseRestoreColumnVecRead(self.mat, _i, &v))
 *         else:
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/Mat.pyx":5991
 *             CHKERR(MatDenseRestoreColumnVecRead(self.mat, _i, &v))
 *         else:
 *             CHKERR(MatDenseRestoreColumnVecWrite(self.mat, _i, &v))             # <<<<<<<<<<<<<<
 *         if V is not None:
 *             CHKERR(PetscCLEAR(V.obj))
*/
  /*else*/ {
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreColumnVecWrite(__pyx_v_self->mat, __pyx_v__i, (&__pyx_v_v))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5991, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/Mat.pyx":5992
 *         else:
 *             CHKERR(MatDenseRestoreColumnVecWrite(self.mat, _i, &v))
 *         if V is not None:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscCLEAR(V.obj))
 * 
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_V) != Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/Mat.pyx":5993
 *             CHKERR(MatDenseRestoreColumnVecWrite(self.mat, _i, &v))
 *         if V is not None:
 *             CHKERR(PetscCLEAR(V.obj))             # <<<<<<<<<<<<<<
 * 
 *     # Nest
*/
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_V->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 5993, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":5992
 *         else:
 *             CHKERR(MatDenseRestoreColumnVecWrite(self.mat, _i, &v))
 *         if V is not None:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscCLEAR(V.obj))
 * 
*/
  }

  /* "petsc4py/PETSc/Mat.pyx":5962
 *         return v
 * 
 *     def restoreDenseColumnVec(self, i: int, mode: AccessModeSpec = 'rw', Vec V=None) -> 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":5997
 *     # 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_511getNestSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_510getNestSize, "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:5997");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_511getNestSize = {"getNestSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_511getNestSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_510getNestSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_511getNestSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNestSize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_510getNestSize(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_510getNestSize(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":6007
 * 
 *         """
 *         cdef PetscInt nrows = 0, ncols = 0             # <<<<<<<<<<<<<<
 *         CHKERR(MatNestGetSize(self.mat, &nrows, &ncols))
 *         return toInt(nrows), toInt(ncols)
*/
  __pyx_v_nrows = 0;
  __pyx_v_ncols = 0;

  /* "petsc4py/PETSc/Mat.pyx":6008
 *         """
 *         cdef PetscInt nrows = 0, ncols = 0
 *         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, 6008, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6009
 *         cdef PetscInt nrows = 0, ncols = 0
 *         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, 6009, __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, 6009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6009, __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) != (0)) __PYX_ERR(46, 6009, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(46, 6009, __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":5997
 *     # 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":6011
 *         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_513getNestISs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_512getNestISs, "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:6011");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_513getNestISs = {"getNestISs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_513getNestISs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_512getNestISs};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_513getNestISs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNestISs", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_512getNestISs(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_512getNestISs(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_unusedr = 0;
  CYTHON_UNUSED PyObject *__pyx_v_unusedc = 0;
  PyObject *__pyx_v_isetsrows = NULL;
  PyObject *__pyx_v_isetscols = NULL;
  long __pyx_8genexpr4__pyx_v_i;
  long __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", 0);

  /* "petsc4py/PETSc/Mat.pyx":6021
 * 
 *         """
 *         cdef PetscInt nrows = 0, ncols = 0             # <<<<<<<<<<<<<<
 *         cdef PetscIS *cisrows = NULL
 *         cdef PetscIS *ciscols = NULL
*/
  __pyx_v_nrows = 0;
  __pyx_v_ncols = 0;

  /* "petsc4py/PETSc/Mat.pyx":6022
 *         """
 *         cdef PetscInt 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":6023
 *         cdef PetscInt nrows = 0, ncols = 0
 *         cdef PetscIS *cisrows = NULL
 *         cdef PetscIS *ciscols = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(MatNestGetSize(self.mat, &nrows, &ncols))
 *         cdef object unusedr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)
*/
  __pyx_v_ciscols = NULL;

  /* "petsc4py/PETSc/Mat.pyx":6024
 *         cdef PetscIS *cisrows = NULL
 *         cdef PetscIS *ciscols = NULL
 *         CHKERR(MatNestGetSize(self.mat, &nrows, &ncols))             # <<<<<<<<<<<<<<
 *         cdef object unusedr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)
 *         cdef object unusedc = oarray_p(empty_p(ncols), NULL, <void**>&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, 6024, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6025
 *         cdef PetscIS *ciscols = NULL
 *         CHKERR(MatNestGetSize(self.mat, &nrows, &ncols))
 *         cdef object unusedr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)             # <<<<<<<<<<<<<<
 *         cdef object unusedc = oarray_p(empty_p(ncols), NULL, <void**>&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, 6025, __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, 6025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unusedr = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6026
 *         CHKERR(MatNestGetSize(self.mat, &nrows, &ncols))
 *         cdef object unusedr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)
 *         cdef object unusedc = oarray_p(empty_p(ncols), NULL, <void**>&ciscols)             # <<<<<<<<<<<<<<
 *         CHKERR(MatNestGetISs(self.mat, cisrows, ciscols))
 *         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, 6026, __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, 6026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_unusedc = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6027
 *         cdef object unusedr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)
 *         cdef object unusedc = oarray_p(empty_p(ncols), NULL, <void**>&ciscols)
 *         CHKERR(MatNestGetISs(self.mat, cisrows, ciscols))             # <<<<<<<<<<<<<<
 *         isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows]
 *         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, 6027, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6028
 *         cdef object unusedc = oarray_p(empty_p(ncols), NULL, <void**>&ciscols)
 *         CHKERR(MatNestGetISs(self.mat, cisrows, ciscols))
 *         isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows]             # <<<<<<<<<<<<<<
 *         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, 6028, __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, 6028, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(46, 6028, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
  } /* exit inner scope */
  __pyx_v_isetsrows = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6029
 *         CHKERR(MatNestGetISs(self.mat, cisrows, ciscols))
 *         isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows]
 *         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, 6029, __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, 6029, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(46, 6029, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
  } /* exit inner scope */
  __pyx_v_isetscols = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6030
 *         isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows]
 *         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, 6030, __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) != (0)) __PYX_ERR(46, 6030, __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) != (0)) __PYX_ERR(46, 6030, __pyx_L1_error);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6011
 *         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_unusedr);
  __Pyx_XDECREF(__pyx_v_unusedc);
  __Pyx_XDECREF(__pyx_v_isetsrows);
  __Pyx_XDECREF(__pyx_v_isetscols);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":6032
 *         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_515getNestLocalISs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_514getNestLocalISs, "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:6032");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_515getNestLocalISs = {"getNestLocalISs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_515getNestLocalISs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_514getNestLocalISs};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_515getNestLocalISs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNestLocalISs", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_514getNestLocalISs(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_514getNestLocalISs(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_unusedr = 0;
  CYTHON_UNUSED PyObject *__pyx_v_unusedc = 0;
  PyObject *__pyx_v_isetsrows = NULL;
  PyObject *__pyx_v_isetscols = NULL;
  long __pyx_8genexpr6__pyx_v_i;
  long __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", 0);

  /* "petsc4py/PETSc/Mat.pyx":6042
 * 
 *         """
 *         cdef PetscInt nrows = 0, ncols = 0             # <<<<<<<<<<<<<<
 *         cdef PetscIS *cisrows = NULL
 *         cdef PetscIS *ciscols = NULL
*/
  __pyx_v_nrows = 0;
  __pyx_v_ncols = 0;

  /* "petsc4py/PETSc/Mat.pyx":6043
 *         """
 *         cdef PetscInt 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":6044
 *         cdef PetscInt nrows = 0, ncols = 0
 *         cdef PetscIS *cisrows = NULL
 *         cdef PetscIS *ciscols = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(MatNestGetSize(self.mat, &nrows, &ncols))
 *         cdef object unusedr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)
*/
  __pyx_v_ciscols = NULL;

  /* "petsc4py/PETSc/Mat.pyx":6045
 *         cdef PetscIS *cisrows = NULL
 *         cdef PetscIS *ciscols = NULL
 *         CHKERR(MatNestGetSize(self.mat, &nrows, &ncols))             # <<<<<<<<<<<<<<
 *         cdef object unusedr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)
 *         cdef object unusedc = oarray_p(empty_p(ncols), NULL, <void**>&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, 6045, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6046
 *         cdef PetscIS *ciscols = NULL
 *         CHKERR(MatNestGetSize(self.mat, &nrows, &ncols))
 *         cdef object unusedr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)             # <<<<<<<<<<<<<<
 *         cdef object unusedc = oarray_p(empty_p(ncols), NULL, <void**>&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, 6046, __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, 6046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unusedr = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6047
 *         CHKERR(MatNestGetSize(self.mat, &nrows, &ncols))
 *         cdef object unusedr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)
 *         cdef object unusedc = oarray_p(empty_p(ncols), NULL, <void**>&ciscols)             # <<<<<<<<<<<<<<
 *         CHKERR(MatNestGetLocalISs(self.mat, cisrows, ciscols))
 *         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, 6047, __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, 6047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_unusedc = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6048
 *         cdef object unusedr = oarray_p(empty_p(nrows), NULL, <void**>&cisrows)
 *         cdef object unusedc = oarray_p(empty_p(ncols), NULL, <void**>&ciscols)
 *         CHKERR(MatNestGetLocalISs(self.mat, cisrows, ciscols))             # <<<<<<<<<<<<<<
 *         isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows]
 *         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, 6048, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6049
 *         cdef object unusedc = oarray_p(empty_p(ncols), NULL, <void**>&ciscols)
 *         CHKERR(MatNestGetLocalISs(self.mat, cisrows, ciscols))
 *         isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows]             # <<<<<<<<<<<<<<
 *         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, 6049, __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, 6049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(46, 6049, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
  } /* exit inner scope */
  __pyx_v_isetsrows = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6050
 *         CHKERR(MatNestGetLocalISs(self.mat, cisrows, ciscols))
 *         isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows]
 *         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, 6050, __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, 6050, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(46, 6050, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
  } /* exit inner scope */
  __pyx_v_isetscols = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6051
 *         isetsrows = [ref_IS(cisrows[i]) for i from 0 <= i < nrows]
 *         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, 6051, __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) != (0)) __PYX_ERR(46, 6051, __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) != (0)) __PYX_ERR(46, 6051, __pyx_L1_error);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6032
 *         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_unusedr);
  __Pyx_XDECREF(__pyx_v_unusedc);
  __Pyx_XDECREF(__pyx_v_isetsrows);
  __Pyx_XDECREF(__pyx_v_isetscols);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":6053
 *         return isetsrows, isetscols
 * 
 *     def getNestSubMatrix(self, i: int, j: int) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return a single submatrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_517getNestSubMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_516getNestSubMatrix, "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:6053");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_517getNestSubMatrix = {"getNestSubMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_517getNestSubMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_516getNestSubMatrix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_517getNestSubMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_i,&__pyx_mstate_global->__pyx_n_u_j,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 6053, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 6053, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6053, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getNestSubMatrix", 0) < (0)) __PYX_ERR(46, 6053, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getNestSubMatrix", 1, 2, 2, i); __PYX_ERR(46, 6053, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6053, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 6053, __pyx_L3_error)
    }
    __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, 6053, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_516getNestSubMatrix(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_i, __pyx_v_j);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_516getNestSubMatrix(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __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("getNestSubMatrix", 0);

  /* "petsc4py/PETSc/Mat.pyx":6070
 * 
 *         """
 *         cdef Mat submat = Mat()             # <<<<<<<<<<<<<<
 *         cdef PetscInt idxm = asInt(i)
 *         cdef PetscInt jdxm = asInt(j)
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 6070, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_submat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6071
 *         """
 *         cdef Mat submat = Mat()
 *         cdef PetscInt idxm = asInt(i)             # <<<<<<<<<<<<<<
 *         cdef PetscInt jdxm = asInt(j)
 *         CHKERR(MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat))
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_i); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 6071, __pyx_L1_error)
  __pyx_v_idxm = __pyx_t_4;

  /* "petsc4py/PETSc/Mat.pyx":6072
 *         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_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_j); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(46, 6072, __pyx_L1_error)
  __pyx_v_jdxm = __pyx_t_4;

  /* "petsc4py/PETSc/Mat.pyx":6073
 *         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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatNestGetSubMat(__pyx_v_self->mat, __pyx_v_idxm, __pyx_v_jdxm, (&__pyx_v_submat->mat))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 6073, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6074
 *         cdef PetscInt jdxm = asInt(j)
 *         CHKERR(MatNestGetSubMat(self.mat, idxm, jdxm, &submat.mat))
 *         CHKERR(PetscINCREF(submat.obj))             # <<<<<<<<<<<<<<
 *         return submat
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_submat->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 6074, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6075
 *         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":6053
 *         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_XDECREF(__pyx_t_2);
  __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":6079
 *     # DM
 * 
 *     def getDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the DM defining the data layout of the matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_519getDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_518getDM, "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:6079");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_519getDM = {"getDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_519getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_518getDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_519getDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDM", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_518getDM(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_518getDM(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDM", 0);

  /* "petsc4py/PETSc/Mat.pyx":6089
 * 
 *         """
 *         cdef PetscDM newdm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(MatGetDM(self.mat, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()
*/
  __pyx_v_newdm = NULL;

  /* "petsc4py/PETSc/Mat.pyx":6090
 *         """
 *         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, 6090, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6091
 *         cdef PetscDM newdm = NULL
 *         CHKERR(MatGetDM(self.mat, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()             # <<<<<<<<<<<<<<
 *         dm.dm = newdm
 *         CHKERR(PetscINCREF(dm.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 6091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(46, 6091, __pyx_L1_error)
  __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6092
 *         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":6093
 *         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, 6093, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6094
 *         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":6079
 *     # 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_XDECREF(__pyx_t_4);
  __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":6096
 *         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_521setDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_520setDM, "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:6096");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_521setDM = {"setDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_521setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_520setDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_521setDM(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 6096, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDM", 0) < (0)) __PYX_ERR(46, 6096, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, i); __PYX_ERR(46, 6096, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6096, __pyx_L3_error)
    }
    __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, 6096, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(46, 6096, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_520setDM(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_dm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_520setDM(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", 0);

  /* "petsc4py/PETSc/Mat.pyx":6111
 * 
 *         """
 *         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, 6111, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6096
 *         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":6121
 *     property sizes:
 *         """Matrix local and global sizes."""
 *         def __get__(self) -> tuple[tuple[int, int], tuple[int, int]]:             # <<<<<<<<<<<<<<
 *             return self.getSizes()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Mat.pyx":6122
 *         """Matrix local and global sizes."""
 *         def __get__(self) -> tuple[tuple[int, int], tuple[int, int]]:
 *             return self.getSizes()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSizes, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 6122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6121
 *     property sizes:
 *         """Matrix local and global sizes."""
 *         def __get__(self) -> tuple[tuple[int, int], tuple[int, int]]:             # <<<<<<<<<<<<<<
 *             return self.getSizes()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":6124
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/Mat.pyx":6125
 * 
 *         def __set__(self, value):
 *             self.setSizes(value)             # <<<<<<<<<<<<<<
 * 
 *     property size:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setSizes, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 6125, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6124
 *             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_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":6129
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Mat.pyx":6130
 *         """Matrix global size."""
 *         def __get__(self) -> tuple[int, int]:
 *             return self.getSize()             # <<<<<<<<<<<<<<
 * 
 *     property local_size:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSize, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 6130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6129
 *     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_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":6134
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Mat.pyx":6135
 *         """Matrix local size."""
 *         def __get__(self) -> int:
 *             return self.getLocalSize()             # <<<<<<<<<<<<<<
 * 
 *     property block_size:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getLocalSize, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 6135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6134
 *     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_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":6139
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Mat.pyx":6140
 *         """Matrix block size."""
 *         def __get__(self) -> int:
 *             return self.getBlockSize()             # <<<<<<<<<<<<<<
 * 
 *     property block_sizes:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getBlockSize, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 6140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6139
 *     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_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":6144
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Mat.pyx":6145
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getBlockSizes, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 6145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6144
 *     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_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":6149
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Mat.pyx":6150
 *         """Matrix local row range."""
 *         def __get__(self) -> tuple[int, int]:
 *             return self.getOwnershipRange()             # <<<<<<<<<<<<<<
 * 
 *     property owner_ranges:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getOwnershipRange, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 6150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6149
 *     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_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":6154
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Mat.pyx":6155
 *         """Matrix row ranges."""
 *         def __get__(self) -> ArrayInt:
 *             return self.getOwnershipRanges()             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getOwnershipRanges, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 6155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6154
 *     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_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":6161
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Mat.pyx":6162
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isAssembled, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 6162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6161
 *     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_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":6165
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Mat.pyx":6166
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isSymmetric, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 6166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6165
 *     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_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":6169
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Mat.pyx":6170
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isHermitian, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 6170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6169
 *     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_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":6173
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/Mat.pyx":6174
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_isStructurallySymmetric, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 6174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6173
 *     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_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":6177
 * 
 *     # TODO Stream
 *     def __dlpack__(self, stream=-1):             # <<<<<<<<<<<<<<
 *         return self.toDLPack('rw')
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_523__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_522__dlpack__, "Mat.__dlpack__(self, stream=-1)\nSource code at petsc4py/PETSc/Mat.pyx:6177");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_523__dlpack__ = {"__dlpack__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_523__dlpack__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_522__dlpack__};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_523__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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_stream,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 6177, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6177, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__dlpack__", 0) < (0)) __PYX_ERR(46, 6177, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_neg_1));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6177, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_neg_1));
    }
    __pyx_v_stream = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__dlpack__", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 6177, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_522__dlpack__(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_stream);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_522__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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dlpack__", 0);

  /* "petsc4py/PETSc/Mat.pyx":6178
 *     # TODO Stream
 *     def __dlpack__(self, stream=-1):
 *         return self.toDLPack('rw')             # <<<<<<<<<<<<<<
 * 
 *     def __dlpack_device__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_rw};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_toDLPack, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 6178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6177
 * 
 *     # 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_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":6180
 *         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_525__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_524__dlpack_device__, "Mat.__dlpack_device__(self)\nSource code at petsc4py/PETSc/Mat.pyx:6180");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_525__dlpack_device__ = {"__dlpack_device__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_525__dlpack_device__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_524__dlpack_device__};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_525__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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__dlpack_device__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3Mat_524__dlpack_device__(((struct PyPetscMatObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_524__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__", 0);

  /* "petsc4py/PETSc/Mat.pyx":6181
 * 
 *     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, 6181, __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, 6181, __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_INCREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 3);
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 4);
      __Pyx_INCREF(__pyx_t_6);
    } else {
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 6181, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(46, 6181, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6181, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6181, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 4, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(46, 6181, __pyx_L1_error)
      __Pyx_XGOTREF(__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 = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(46, 6181, __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, 6181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 6181, __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, 6181, __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":6182
 *     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, 6182, __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) != (0)) __PYX_ERR(46, 6182, __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) != (0)) __PYX_ERR(46, 6182, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6180
 *         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":6184
 *         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_527toDLPack(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_526toDLPack, "Mat.toDLPack(self, mode: AccessModeSpec = 'rw') -> Any\nReturn a DLPack `PyCapsule` wrapping the vector data.\nSource code at petsc4py/PETSc/Mat.pyx:6184");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3Mat_527toDLPack = {"toDLPack", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_527toDLPack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_526toDLPack};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3Mat_527toDLPack(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 6184, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6184, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "toDLPack", 0) < (0)) __PYX_ERR(46, 6184, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6184, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_rw));
    }
    __pyx_v_mode = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("toDLPack", 0, 0, 1, __pyx_nargs); __PYX_ERR(46, 6184, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_526toDLPack(((struct PyPetscMatObject *)__pyx_v_self), __pyx_v_mode);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3Mat_526toDLPack(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;
  size_t __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)(PyObject *);
  int64_t __pyx_t_12;
  PetscErrorCode __pyx_t_13;
  enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType __pyx_t_14;
  int __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":6186
 *     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_mstate_global->__pyx_n_u_rw);
    __Pyx_DECREF_SET(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_rw);
  }

  /* "petsc4py/PETSc/Mat.pyx":6187
 *         """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_mstate_global->__pyx_n_u_rw);
    __Pyx_DECREF_SET(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_rw);
  }

  /* "petsc4py/PETSc/Mat.pyx":6188
 *         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_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_rw, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 6188, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_r, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 6188, __pyx_L1_error)
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_w, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 6188, __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":6189
 *         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_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_rw_r_or_w};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 6189, __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, 6189, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":6188
 *         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":6191
 *             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":6192
 * 
 *         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, 6192, __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, 6192, __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_INCREF(__pyx_t_4);
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_6);
      __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3);
      __Pyx_INCREF(__pyx_t_8);
      __pyx_t_9 = PyTuple_GET_ITEM(sequence, 4);
      __Pyx_INCREF(__pyx_t_9);
    } else {
      __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6192, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_6)) __PYX_ERR(46, 6192, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 2, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_7)) __PYX_ERR(46, 6192, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 3, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 6192, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyList_GetItemRefFast(sequence, 4, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 6192, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_9);
    }
    #else
    {
      Py_ssize_t i;
      PyObject** temps[5] = {&__pyx_t_4,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
      for (i=0; i < 5; i++) {
        PyObject* item = __Pyx_PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(46, 6192, __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_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
    __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(46, 6192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
    for (index=0; index < 5; index++) {
      PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 5) < (0)) __PYX_ERR(46, 6192, __pyx_L1_error)
    __pyx_t_11 = NULL;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    goto __pyx_L10_unpacking_done;
    __pyx_L9_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(46, 6192, __pyx_L1_error)
    __pyx_L10_unpacking_done:;
  }
  __pyx_t_12 = __Pyx_PyLong_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(46, 6192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_device_type = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_device_id = __pyx_t_6;
  __pyx_t_6 = 0;
  __pyx_v_ndim = __pyx_t_12;
  __pyx_v_shape = __pyx_t_8;
  __pyx_t_8 = 0;
  __pyx_v_strides = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6193
 *         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 = <DLManagedTensor*>malloc(sizeof(DLManagedTensor))
*/
  __pyx_t_2 = __Pyx_PyLong_From_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_e_8petsc4py_5PETSc_kDLCPU); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 6193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyObject_RichCompare(__pyx_v_device_type, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 6193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_hostmem = __pyx_t_9;
  __pyx_t_9 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6195
 *         hostmem = (device_type == kDLCPU)
 * 
 *         cdef DLManagedTensor* dlm_tensor = <DLManagedTensor*>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":6196
 * 
 *         cdef DLManagedTensor* dlm_tensor = <DLManagedTensor*>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":6197
 *         cdef DLManagedTensor* dlm_tensor = <DLManagedTensor*>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":6198
 *         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":6199
 *         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":6205
 *         # 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, <PetscScalar**>&a))
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_w, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 6205, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/Mat.pyx":6206
 *         # By restoring now, we guarantee the sanity of the ObjectState
 *         if mode == 'w':
 *             if hostmem:             # <<<<<<<<<<<<<<
 *                 CHKERR(MatDenseGetArrayWrite(self.mat, <PetscScalar**>&a))
 *                 CHKERR(MatDenseRestoreArrayWrite(self.mat, NULL))
*/
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_hostmem); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 6206, __pyx_L1_error)
    if (__pyx_t_3) {

      /* "petsc4py/PETSc/Mat.pyx":6207
 *         if mode == 'w':
 *             if hostmem:
 *                 CHKERR(MatDenseGetArrayWrite(self.mat, <PetscScalar**>&a))             # <<<<<<<<<<<<<<
 *                 CHKERR(MatDenseRestoreArrayWrite(self.mat, NULL))
 *             else:
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetArrayWrite(__pyx_v_self->mat, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 6207, __pyx_L1_error)

      /* "petsc4py/PETSc/Mat.pyx":6208
 *             if hostmem:
 *                 CHKERR(MatDenseGetArrayWrite(self.mat, <PetscScalar**>&a))
 *                 CHKERR(MatDenseRestoreArrayWrite(self.mat, NULL))             # <<<<<<<<<<<<<<
 *             else:
 *                 CHKERR(MatDenseGetArrayWriteAndMemType(self.mat, <PetscScalar**>&a, NULL))
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreArrayWrite(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 6208, __pyx_L1_error)

      /* "petsc4py/PETSc/Mat.pyx":6206
 *         # By restoring now, we guarantee the sanity of the ObjectState
 *         if mode == 'w':
 *             if hostmem:             # <<<<<<<<<<<<<<
 *                 CHKERR(MatDenseGetArrayWrite(self.mat, <PetscScalar**>&a))
 *                 CHKERR(MatDenseRestoreArrayWrite(self.mat, NULL))
*/
      goto __pyx_L12;
    }

    /* "petsc4py/PETSc/Mat.pyx":6210
 *                 CHKERR(MatDenseRestoreArrayWrite(self.mat, NULL))
 *             else:
 *                 CHKERR(MatDenseGetArrayWriteAndMemType(self.mat, <PetscScalar**>&a, NULL))             # <<<<<<<<<<<<<<
 *                 CHKERR(MatDenseRestoreArrayWriteAndMemType(self.mat, NULL))
 *         elif mode == 'r':
*/
    /*else*/ {
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetArrayWriteAndMemType(__pyx_v_self->mat, ((PetscScalar **)(&__pyx_v_a)), NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 6210, __pyx_L1_error)

      /* "petsc4py/PETSc/Mat.pyx":6211
 *             else:
 *                 CHKERR(MatDenseGetArrayWriteAndMemType(self.mat, <PetscScalar**>&a, NULL))
 *                 CHKERR(MatDenseRestoreArrayWriteAndMemType(self.mat, NULL))             # <<<<<<<<<<<<<<
 *         elif mode == 'r':
 *             if hostmem:
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreArrayWriteAndMemType(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 6211, __pyx_L1_error)
    }
    __pyx_L12:;

    /* "petsc4py/PETSc/Mat.pyx":6205
 *         # 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, <PetscScalar**>&a))
*/
    goto __pyx_L11;
  }

  /* "petsc4py/PETSc/Mat.pyx":6212
 *                 CHKERR(MatDenseGetArrayWriteAndMemType(self.mat, <PetscScalar**>&a, NULL))
 *                 CHKERR(MatDenseRestoreArrayWriteAndMemType(self.mat, NULL))
 *         elif mode == 'r':             # <<<<<<<<<<<<<<
 *             if hostmem:
 *                 CHKERR(MatDenseGetArrayRead(self.mat, <const PetscScalar**>&a))
*/
  __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_v_mode, __pyx_mstate_global->__pyx_n_u_r, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 6212, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/Mat.pyx":6213
 *                 CHKERR(MatDenseRestoreArrayWriteAndMemType(self.mat, NULL))
 *         elif mode == 'r':
 *             if hostmem:             # <<<<<<<<<<<<<<
 *                 CHKERR(MatDenseGetArrayRead(self.mat, <const PetscScalar**>&a))
 *                 CHKERR(MatDenseRestoreArrayRead(self.mat, NULL))
*/
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_hostmem); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(46, 6213, __pyx_L1_error)
    if (__pyx_t_3) {

      /* "petsc4py/PETSc/Mat.pyx":6214
 *         elif mode == 'r':
 *             if hostmem:
 *                 CHKERR(MatDenseGetArrayRead(self.mat, <const PetscScalar**>&a))             # <<<<<<<<<<<<<<
 *                 CHKERR(MatDenseRestoreArrayRead(self.mat, NULL))
 *             else:
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetArrayRead(__pyx_v_self->mat, ((PetscScalar const **)(&__pyx_v_a)))); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 6214, __pyx_L1_error)

      /* "petsc4py/PETSc/Mat.pyx":6215
 *             if hostmem:
 *                 CHKERR(MatDenseGetArrayRead(self.mat, <const PetscScalar**>&a))
 *                 CHKERR(MatDenseRestoreArrayRead(self.mat, NULL))             # <<<<<<<<<<<<<<
 *             else:
 *                 CHKERR(MatDenseGetArrayReadAndMemType(self.mat, <const PetscScalar**>&a, NULL))
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreArrayRead(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 6215, __pyx_L1_error)

      /* "petsc4py/PETSc/Mat.pyx":6213
 *                 CHKERR(MatDenseRestoreArrayWriteAndMemType(self.mat, NULL))
 *         elif mode == 'r':
 *             if hostmem:             # <<<<<<<<<<<<<<
 *                 CHKERR(MatDenseGetArrayRead(self.mat, <const PetscScalar**>&a))
 *                 CHKERR(MatDenseRestoreArrayRead(self.mat, NULL))
*/
      goto __pyx_L13;
    }

    /* "petsc4py/PETSc/Mat.pyx":6217
 *                 CHKERR(MatDenseRestoreArrayRead(self.mat, NULL))
 *             else:
 *                 CHKERR(MatDenseGetArrayReadAndMemType(self.mat, <const PetscScalar**>&a, NULL))             # <<<<<<<<<<<<<<
 *                 CHKERR(MatDenseRestoreArrayReadAndMemType(self.mat, NULL))
 *         else:
*/
    /*else*/ {
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetArrayReadAndMemType(__pyx_v_self->mat, ((PetscScalar const **)(&__pyx_v_a)), NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 6217, __pyx_L1_error)

      /* "petsc4py/PETSc/Mat.pyx":6218
 *             else:
 *                 CHKERR(MatDenseGetArrayReadAndMemType(self.mat, <const PetscScalar**>&a, NULL))
 *                 CHKERR(MatDenseRestoreArrayReadAndMemType(self.mat, NULL))             # <<<<<<<<<<<<<<
 *         else:
 *             if hostmem:
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreArrayReadAndMemType(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 6218, __pyx_L1_error)
    }
    __pyx_L13:;

    /* "petsc4py/PETSc/Mat.pyx":6212
 *                 CHKERR(MatDenseGetArrayWriteAndMemType(self.mat, <PetscScalar**>&a, NULL))
 *                 CHKERR(MatDenseRestoreArrayWriteAndMemType(self.mat, NULL))
 *         elif mode == 'r':             # <<<<<<<<<<<<<<
 *             if hostmem:
 *                 CHKERR(MatDenseGetArrayRead(self.mat, <const PetscScalar**>&a))
*/
    goto __pyx_L11;
  }

  /* "petsc4py/PETSc/Mat.pyx":6220
 *                 CHKERR(MatDenseRestoreArrayReadAndMemType(self.mat, NULL))
 *         else:
 *             if hostmem:             # <<<<<<<<<<<<<<
 *                 CHKERR(MatDenseGetArray(self.mat, <PetscScalar**>&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, 6220, __pyx_L1_error)
    if (__pyx_t_3) {

      /* "petsc4py/PETSc/Mat.pyx":6221
 *         else:
 *             if hostmem:
 *                 CHKERR(MatDenseGetArray(self.mat, <PetscScalar**>&a))             # <<<<<<<<<<<<<<
 *                 CHKERR(MatDenseRestoreArray(self.mat, NULL))
 *             else:
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetArray(__pyx_v_self->mat, ((PetscScalar **)(&__pyx_v_a)))); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 6221, __pyx_L1_error)

      /* "petsc4py/PETSc/Mat.pyx":6222
 *             if hostmem:
 *                 CHKERR(MatDenseGetArray(self.mat, <PetscScalar**>&a))
 *                 CHKERR(MatDenseRestoreArray(self.mat, NULL))             # <<<<<<<<<<<<<<
 *             else:
 *                 CHKERR(MatDenseGetArrayAndMemType(self.mat, <PetscScalar**>&a, NULL))
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreArray(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 6222, __pyx_L1_error)

      /* "petsc4py/PETSc/Mat.pyx":6220
 *                 CHKERR(MatDenseRestoreArrayReadAndMemType(self.mat, NULL))
 *         else:
 *             if hostmem:             # <<<<<<<<<<<<<<
 *                 CHKERR(MatDenseGetArray(self.mat, <PetscScalar**>&a))
 *                 CHKERR(MatDenseRestoreArray(self.mat, NULL))
*/
      goto __pyx_L14;
    }

    /* "petsc4py/PETSc/Mat.pyx":6224
 *                 CHKERR(MatDenseRestoreArray(self.mat, NULL))
 *             else:
 *                 CHKERR(MatDenseGetArrayAndMemType(self.mat, <PetscScalar**>&a, NULL))             # <<<<<<<<<<<<<<
 *                 CHKERR(MatDenseRestoreArrayAndMemType(self.mat, NULL))
 *         dl_tensor.data = <void *>a
*/
    /*else*/ {
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseGetArrayAndMemType(__pyx_v_self->mat, ((PetscScalar **)(&__pyx_v_a)), NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 6224, __pyx_L1_error)

      /* "petsc4py/PETSc/Mat.pyx":6225
 *             else:
 *                 CHKERR(MatDenseGetArrayAndMemType(self.mat, <PetscScalar**>&a, NULL))
 *                 CHKERR(MatDenseRestoreArrayAndMemType(self.mat, NULL))             # <<<<<<<<<<<<<<
 *         dl_tensor.data = <void *>a
 * 
*/
      __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(MatDenseRestoreArrayAndMemType(__pyx_v_self->mat, NULL)); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 6225, __pyx_L1_error)
    }
    __pyx_L14:;
  }
  __pyx_L11:;

  /* "petsc4py/PETSc/Mat.pyx":6226
 *                 CHKERR(MatDenseGetArrayAndMemType(self.mat, <PetscScalar**>&a, NULL))
 *                 CHKERR(MatDenseRestoreArrayAndMemType(self.mat, NULL))
 *         dl_tensor.data = <void *>a             # <<<<<<<<<<<<<<
 * 
 *         cdef DLContext* ctx = &dl_tensor.ctx
*/
  __pyx_v_dl_tensor->data = ((void *)__pyx_v_a);

  /* "petsc4py/PETSc/Mat.pyx":6228
 *         dl_tensor.data = <void *>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":6229
 * 
 *         cdef DLContext* ctx = &dl_tensor.ctx
 *         ctx.device_type = device_type             # <<<<<<<<<<<<<<
 *         ctx.device_id = device_id
 *         shape_strides = <int64_t*>malloc(sizeof(int64_t)*2*ndim)
*/
  __pyx_t_14 = ((enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType)__Pyx_PyLong_As_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(__pyx_v_device_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(46, 6229, __pyx_L1_error)
  __pyx_v_ctx->device_type = __pyx_t_14;

  /* "petsc4py/PETSc/Mat.pyx":6230
 *         cdef DLContext* ctx = &dl_tensor.ctx
 *         ctx.device_type = device_type
 *         ctx.device_id = device_id             # <<<<<<<<<<<<<<
 *         shape_strides = <int64_t*>malloc(sizeof(int64_t)*2*ndim)
 *         for i in range(ndim):
*/
  __pyx_t_15 = __Pyx_PyLong_As_int(__pyx_v_device_id); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(46, 6230, __pyx_L1_error)
  __pyx_v_ctx->device_id = __pyx_t_15;

  /* "petsc4py/PETSc/Mat.pyx":6231
 *         ctx.device_type = device_type
 *         ctx.device_id = device_id
 *         shape_strides = <int64_t*>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":6232
 *         ctx.device_id = device_id
 *         shape_strides = <int64_t*>malloc(sizeof(int64_t)*2*ndim)
 *         for i in range(ndim):             # <<<<<<<<<<<<<<
 *             shape_strides[i] = shape[i]
 *         for i in range(ndim):
*/
  __pyx_t_2 = NULL;
  __pyx_t_8 = __Pyx_PyLong_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 6232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_8};
    __pyx_t_9 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 6232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
  }
  __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 6232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(46, 6232, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  for (;;) {
    {
      __pyx_t_9 = __pyx_t_16(__pyx_t_8);
      if (unlikely(!__pyx_t_9)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(46, 6232, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "petsc4py/PETSc/Mat.pyx":6233
 *         shape_strides = <int64_t*>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_9 = __Pyx_PyObject_GetItem(__pyx_v_shape, __pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 6233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_12 = __Pyx_PyLong_As_int64_t(__pyx_t_9); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(46, 6233, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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, 6233, __pyx_L1_error)
    (__pyx_v_shape_strides[__pyx_t_17]) = __pyx_t_12;

    /* "petsc4py/PETSc/Mat.pyx":6232
 *         ctx.device_id = device_id
 *         shape_strides = <int64_t*>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":6234
 *         for i in range(ndim):
 *             shape_strides[i] = shape[i]
 *         for i in range(ndim):             # <<<<<<<<<<<<<<
 *             shape_strides[i+ndim] = strides[i]
 *         dl_tensor.ndim = <int>ndim
*/
  __pyx_t_9 = NULL;
  __pyx_t_2 = __Pyx_PyLong_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 6234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_2};
    __pyx_t_8 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 6234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
  }
  __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 6234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_16 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(46, 6234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  for (;;) {
    {
      __pyx_t_8 = __pyx_t_16(__pyx_t_2);
      if (unlikely(!__pyx_t_8)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(46, 6234, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "petsc4py/PETSc/Mat.pyx":6235
 *             shape_strides[i] = shape[i]
 *         for i in range(ndim):
 *             shape_strides[i+ndim] = strides[i]             # <<<<<<<<<<<<<<
 *         dl_tensor.ndim = <int>ndim
 *         dl_tensor.shape = shape_strides
*/
    __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_strides, __pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 6235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_12 = __Pyx_PyLong_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(46, 6235, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyLong_From_int64_t(__pyx_v_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(46, 6235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PyNumber_Add(__pyx_v_i, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(46, 6235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(46, 6235, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    (__pyx_v_shape_strides[__pyx_t_17]) = __pyx_t_12;

    /* "petsc4py/PETSc/Mat.pyx":6234
 *         for i in range(ndim):
 *             shape_strides[i] = shape[i]
 *         for i in range(ndim):             # <<<<<<<<<<<<<<
 *             shape_strides[i+ndim] = strides[i]
 *         dl_tensor.ndim = <int>ndim
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6236
 *         for i in range(ndim):
 *             shape_strides[i+ndim] = strides[i]
 *         dl_tensor.ndim = <int>ndim             # <<<<<<<<<<<<<<
 *         dl_tensor.shape = shape_strides
 *         dl_tensor.strides = shape_strides + ndim
*/
  __pyx_v_dl_tensor->ndim = ((int)__pyx_v_ndim);

  /* "petsc4py/PETSc/Mat.pyx":6237
 *             shape_strides[i+ndim] = strides[i]
 *         dl_tensor.ndim = <int>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":6238
 *         dl_tensor.ndim = <int>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":6240
 *         dl_tensor.strides = shape_strides + ndim
 * 
 *         cdef DLDataType* dtype = &dl_tensor.dtype             # <<<<<<<<<<<<<<
 *         dtype.code = <uint8_t>DLDataTypeCode.kDLFloat
 *         if sizeof(PetscScalar) == 8:
*/
  __pyx_v_dtype = (&__pyx_v_dl_tensor->dtype);

  /* "petsc4py/PETSc/Mat.pyx":6241
 * 
 *         cdef DLDataType* dtype = &dl_tensor.dtype
 *         dtype.code = <uint8_t>DLDataTypeCode.kDLFloat             # <<<<<<<<<<<<<<
 *         if sizeof(PetscScalar) == 8:
 *             dtype.bits = <uint8_t>64
*/
  __pyx_v_dtype->code = ((uint8_t)__pyx_e_8petsc4py_5PETSc_kDLFloat);

  /* "petsc4py/PETSc/Mat.pyx":6242
 *         cdef DLDataType* dtype = &dl_tensor.dtype
 *         dtype.code = <uint8_t>DLDataTypeCode.kDLFloat
 *         if sizeof(PetscScalar) == 8:             # <<<<<<<<<<<<<<
 *             dtype.bits = <uint8_t>64
 *         elif sizeof(PetscScalar) == 4:
*/
  __pyx_t_3 = ((sizeof(PetscScalar)) == 8);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/Mat.pyx":6243
 *         dtype.code = <uint8_t>DLDataTypeCode.kDLFloat
 *         if sizeof(PetscScalar) == 8:
 *             dtype.bits = <uint8_t>64             # <<<<<<<<<<<<<<
 *         elif sizeof(PetscScalar) == 4:
 *             dtype.bits = <uint8_t>32
*/
    __pyx_v_dtype->bits = ((uint8_t)64);

    /* "petsc4py/PETSc/Mat.pyx":6242
 *         cdef DLDataType* dtype = &dl_tensor.dtype
 *         dtype.code = <uint8_t>DLDataTypeCode.kDLFloat
 *         if sizeof(PetscScalar) == 8:             # <<<<<<<<<<<<<<
 *             dtype.bits = <uint8_t>64
 *         elif sizeof(PetscScalar) == 4:
*/
    goto __pyx_L21;
  }

  /* "petsc4py/PETSc/Mat.pyx":6244
 *         if sizeof(PetscScalar) == 8:
 *             dtype.bits = <uint8_t>64
 *         elif sizeof(PetscScalar) == 4:             # <<<<<<<<<<<<<<
 *             dtype.bits = <uint8_t>32
 *         else:
*/
  __pyx_t_3 = ((sizeof(PetscScalar)) == 4);
  if (likely(__pyx_t_3)) {

    /* "petsc4py/PETSc/Mat.pyx":6245
 *             dtype.bits = <uint8_t>64
 *         elif sizeof(PetscScalar) == 4:
 *             dtype.bits = <uint8_t>32             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('Unsupported PetscScalar type')
*/
    __pyx_v_dtype->bits = ((uint8_t)32);

    /* "petsc4py/PETSc/Mat.pyx":6244
 *         if sizeof(PetscScalar) == 8:
 *             dtype.bits = <uint8_t>64
 *         elif sizeof(PetscScalar) == 4:             # <<<<<<<<<<<<<<
 *             dtype.bits = <uint8_t>32
 *         else:
*/
    goto __pyx_L21;
  }

  /* "petsc4py/PETSc/Mat.pyx":6247
 *             dtype.bits = <uint8_t>32
 *         else:
 *             raise ValueError('Unsupported PetscScalar type')             # <<<<<<<<<<<<<<
 *         dtype.lanes = <uint16_t>1
 *         dlm_tensor.manager_ctx = <void *>self.mat
*/
  /*else*/ {
    __pyx_t_9 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_mstate_global->__pyx_kp_u_Unsupported_PetscScalar_type};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 6247, __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, 6247, __pyx_L1_error)
  }
  __pyx_L21:;

  /* "petsc4py/PETSc/Mat.pyx":6248
 *         else:
 *             raise ValueError('Unsupported PetscScalar type')
 *         dtype.lanes = <uint16_t>1             # <<<<<<<<<<<<<<
 *         dlm_tensor.manager_ctx = <void *>self.mat
 *         CHKERR(PetscObjectReference(<PetscObject>self.mat))
*/
  __pyx_v_dtype->lanes = ((uint16_t)1);

  /* "petsc4py/PETSc/Mat.pyx":6249
 *             raise ValueError('Unsupported PetscScalar type')
 *         dtype.lanes = <uint16_t>1
 *         dlm_tensor.manager_ctx = <void *>self.mat             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectReference(<PetscObject>self.mat))
 *         dlm_tensor.manager_deleter = manager_deleter
*/
  __pyx_v_dlm_tensor->manager_ctx = ((void *)__pyx_v_self->mat);

  /* "petsc4py/PETSc/Mat.pyx":6250
 *         dtype.lanes = <uint16_t>1
 *         dlm_tensor.manager_ctx = <void *>self.mat
 *         CHKERR(PetscObjectReference(<PetscObject>self.mat))             # <<<<<<<<<<<<<<
 *         dlm_tensor.manager_deleter = manager_deleter
 *         dlm_tensor.del_obj = <dlpack_manager_del_obj>PetscDEALLOC
*/
  __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectReference(((PetscObject)__pyx_v_self->mat))); if (unlikely(__pyx_t_13 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(46, 6250, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6251
 *         dlm_tensor.manager_ctx = <void *>self.mat
 *         CHKERR(PetscObjectReference(<PetscObject>self.mat))
 *         dlm_tensor.manager_deleter = manager_deleter             # <<<<<<<<<<<<<<
 *         dlm_tensor.del_obj = <dlpack_manager_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":6252
 *         CHKERR(PetscObjectReference(<PetscObject>self.mat))
 *         dlm_tensor.manager_deleter = manager_deleter
 *         dlm_tensor.del_obj = <dlpack_manager_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":6253
 *         dlm_tensor.manager_deleter = manager_deleter
 *         dlm_tensor.del_obj = <dlpack_manager_del_obj>PetscDEALLOC
 *         return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyCapsule_New(__pyx_v_dlm_tensor, __pyx_k_dltensor, __pyx_f_8petsc4py_5PETSc_pycapsule_deleter); if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 6253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6184
 *         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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __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":6267
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj  = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":6268
 * 
 *     def __cinit__(self):
 *         self.obj  = <PetscObject*> &self.nsp             # <<<<<<<<<<<<<<
 *         self.nsp = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->nsp));

  /* "petsc4py/PETSc/Mat.pyx":6269
 *     def __cinit__(self):
 *         self.obj  = <PetscObject*> &self.nsp
 *         self.nsp = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self, vec):
*/
  __pyx_v_self->nsp = NULL;

  /* "petsc4py/PETSc/Mat.pyx":6267
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj  = <PetscObject*> &self.nsp
 *         self.nsp = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":6271
 *         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_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 6271, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6271, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(46, 6271, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, i); __PYX_ERR(46, 6271, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6271, __pyx_L3_error)
    }
    __pyx_v_vec = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, __pyx_nargs); __PYX_ERR(46, 6271, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "petsc4py/PETSc/Mat.pyx":6272
 * 
 *     def __call__(self, vec):
 *         self.remove(vec)             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_vec};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 6272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6271
 *         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_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":6276
 *     #
 * 
 *     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:6276");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9NullSpace_5view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_4view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 6276, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6276, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(46, 6276, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6276, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 6276, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(46, 6276, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Mat.pyx":6291
 * 
 *         """
 *         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":6292
 *         """
 *         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":6293
 *         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, 6293, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6276
 *     #
 * 
 *     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":6295
 *         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:6295");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9NullSpace_7destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_6destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Mat.pyx":6305
 * 
 *         """
 *         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, 6305, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6306
 *         """
 *         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":6295
 *         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":6308
 *         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:6308");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9NullSpace_9create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_8create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_constant,&__pyx_mstate_global->__pyx_n_u_vectors,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 6308, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 6308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 6308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(46, 6308, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":6310
 *     def create(
 *         self,
 *         constant: bool = False,             # <<<<<<<<<<<<<<
 *         vectors: Sequence[Vec] = (),
 *         comm=None) -> Self:
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "petsc4py/PETSc/Mat.pyx":6311
 *         self,
 *         constant: bool = False,
 *         vectors: Sequence[Vec] = (),             # <<<<<<<<<<<<<<
 *         comm=None) -> Self:
 *         """Create the null space.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_empty_tuple));

      /* "petsc4py/PETSc/Mat.pyx":6312
 *         constant: bool = False,
 *         vectors: Sequence[Vec] = (),
 *         comm=None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create the null space.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 6308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 6308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":6310
 *     def create(
 *         self,
 *         constant: bool = False,             # <<<<<<<<<<<<<<
 *         vectors: Sequence[Vec] = (),
 *         comm=None) -> Self:
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "petsc4py/PETSc/Mat.pyx":6311
 *         self,
 *         constant: bool = False,
 *         vectors: Sequence[Vec] = (),             # <<<<<<<<<<<<<<
 *         comm=None) -> Self:
 *         """Create the null space.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_empty_tuple));

      /* "petsc4py/PETSc/Mat.pyx":6312
 *         constant: bool = False,
 *         vectors: Sequence[Vec] = (),
 *         comm=None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create the null space.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 6308, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":6308
 *         return self
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         constant: bool = False,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_unused2 = 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", 0);

  /* "petsc4py/PETSc/Mat.pyx":6331
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(46, 6331, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Mat.pyx":6332
 *         """
 *         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 = <PetscInt>len(vectors)
*/
  __pyx_v_has_const = PETSC_FALSE;

  /* "petsc4py/PETSc/Mat.pyx":6333
 *         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 = <PetscInt>len(vectors)
 *         cdef PetscVec *v = NULL
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_constant); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(46, 6333, __pyx_L1_error)
  if (__pyx_t_2) {
    __pyx_v_has_const = PETSC_TRUE;
  }

  /* "petsc4py/PETSc/Mat.pyx":6334
 *         cdef PetscBool has_const = PETSC_FALSE
 *         if constant: has_const = PETSC_TRUE
 *         cdef PetscInt i = 0, nv = <PetscInt>len(vectors)             # <<<<<<<<<<<<<<
 *         cdef PetscVec *v = NULL
 *         cdef object unused2 = oarray_p(empty_p(nv), NULL, <void**>&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, 6334, __pyx_L1_error)
  __pyx_v_nv = ((PetscInt)__pyx_t_3);

  /* "petsc4py/PETSc/Mat.pyx":6335
 *         if constant: has_const = PETSC_TRUE
 *         cdef PetscInt i = 0, nv = <PetscInt>len(vectors)
 *         cdef PetscVec *v = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused2 = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:
*/
  __pyx_v_v = NULL;

  /* "petsc4py/PETSc/Mat.pyx":6336
 *         cdef PetscInt i = 0, nv = <PetscInt>len(vectors)
 *         cdef PetscVec *v = NULL
 *         cdef object unused2 = oarray_p(empty_p(nv), NULL, <void**>&v)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vectors[<Py_ssize_t>i])).vec
*/
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nv)); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6336, __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, 6336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_unused2 = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6337
 *         cdef PetscVec *v = NULL
 *         cdef object unused2 = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:             # <<<<<<<<<<<<<<
 *             v[i] = (<Vec?>(vectors[<Py_ssize_t>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":6338
 *         cdef object unused2 = oarray_p(empty_p(nv), NULL, <void**>&v)
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vectors[<Py_ssize_t>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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(46, 6338, __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":6339
 *         for i from 0 <= i < nv:
 *             v[i] = (<Vec?>(vectors[<Py_ssize_t>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":6340
 *             v[i] = (<Vec?>(vectors[<Py_ssize_t>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, 6340, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6341
 *         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, 6341, __pyx_L1_error)
  __pyx_v_self->nsp = __pyx_v_newnsp;

  /* "petsc4py/PETSc/Mat.pyx":6342
 *         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":6308
 *         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_unused2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Mat.pyx":6344
 *         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:6344");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9NullSpace_11createRigidBody = {"createRigidBody", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_11createRigidBody, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_10createRigidBody};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_coords,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 6344, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6344, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createRigidBody", 0) < (0)) __PYX_ERR(46, 6344, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createRigidBody", 1, 1, 1, i); __PYX_ERR(46, 6344, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6344, __pyx_L3_error)
    }
    __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, 6344, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "coords", 0))) __PYX_ERR(46, 6344, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Mat.pyx":6360
 * 
 *         """
 *         cdef PetscNullSpace newnsp = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(MatNullSpaceCreateRigidBody(coords.vec, &newnsp))
 *         CHKERR(PetscCLEAR(self.obj)); self.nsp = newnsp
*/
  __pyx_v_newnsp = NULL;

  /* "petsc4py/PETSc/Mat.pyx":6361
 *         """
 *         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, 6361, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6362
 *         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, 6362, __pyx_L1_error)
  __pyx_v_self->nsp = __pyx_v_newnsp;

  /* "petsc4py/PETSc/Mat.pyx":6363
 *         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":6344
 *         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":6365
 *         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:6365");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9NullSpace_13setFunction = {"setFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_13setFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_12setFunction};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_function,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 6365, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 6365, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 6365, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6365, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFunction", 0) < (0)) __PYX_ERR(46, 6365, __pyx_L3_error)

      /* "petsc4py/PETSc/Mat.pyx":6368
 *         self,
 *         function: MatNullFunction,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback to remove the nullspace.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":6369
 *         function: MatNullFunction,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback to remove the nullspace.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFunction", 0, 1, 3, i); __PYX_ERR(46, 6365, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(46, 6365, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(46, 6365, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6365, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Mat.pyx":6368
 *         self,
 *         function: MatNullFunction,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback to remove the nullspace.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Mat.pyx":6369
 *         function: MatNullFunction,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback to remove the nullspace.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 6365, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":6365
 *         return self
 * 
 *     def setFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         function: MatNullFunction,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":6388
 * 
 *         """
 *         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":6389
 *         """
 *         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, 6389, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":6391
 *             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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/Mat.pyx":6392
 *                     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, 6392, __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":6393
 *             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, 6393, __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) != (0)) __PYX_ERR(46, 6393, __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) != (0)) __PYX_ERR(46, 6393, __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) != (0)) __PYX_ERR(46, 6393, __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, 6393, __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":6388
 * 
 *         """
 *         if function is not None:             # <<<<<<<<<<<<<<
 *             CHKERR(MatNullSpaceSetFunction(
 *                     self.nsp, NullSpace_Function, NULL))
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/Mat.pyx":6395
 *             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, 6395, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":6396
 *         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, 6396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/Mat.pyx":6365
 *         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":6399
 *     #
 * 
 *     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:6399");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9NullSpace_15hasConstant = {"hasConstant", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_15hasConstant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_14hasConstant};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("hasConstant", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Mat.pyx":6409
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(MatNullSpaceGetVecs(self.nsp, &flag, NULL, NULL))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/Mat.pyx":6410
 *         """
 *         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, 6410, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6411
 *         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, 6411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6399
 *     #
 * 
 *     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":6413
 *         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:6413");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9NullSpace_17getVecs = {"getVecs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_17getVecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_16getVecs};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getVecs", __pyx_kwds); 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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getVecs", 0);

  /* "petsc4py/PETSc/Mat.pyx":6423
 * 
 *         """
 *         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":6424
 *         """
 *         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":6425
 *         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, 6425, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6426
 *         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":6427
 *         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, 6427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_vectors = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6428
 *         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":6429
 *         cdef list vectors = []
 *         for i from 0 <= i < nv:
 *             vec = Vec()             # <<<<<<<<<<<<<<
 *             vec.vec = v[i]
 *             CHKERR(PetscINCREF(vec.obj))
*/
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(46, 6429, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_vec, ((struct PyPetscVecObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/Mat.pyx":6430
 *         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":6431
 *             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, 6431, __pyx_L1_error)

    /* "petsc4py/PETSc/Mat.pyx":6432
 *             vec.vec = v[i]
 *             CHKERR(PetscINCREF(vec.obj))
 *             vectors.append(vec)             # <<<<<<<<<<<<<<
 *         return vectors
 * 
*/
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_vectors, ((PyObject *)__pyx_v_vec)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(46, 6432, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Mat.pyx":6433
 *             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":6413
 *         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_XDECREF(__pyx_t_4);
  __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":6435
 *         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:6435");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9NullSpace_19getFunction = {"getFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_19getFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_18getFunction};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFunction", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Mat.pyx":6445
 * 
 *         """
 *         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, 6445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6435
 *         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":6449
 *     #
 * 
 *     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:6449");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9NullSpace_21remove = {"remove", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_21remove, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_20remove};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 6449, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6449, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "remove", 0) < (0)) __PYX_ERR(46, 6449, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("remove", 1, 1, 1, i); __PYX_ERR(46, 6449, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6449, __pyx_L3_error)
    }
    __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, 6449, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(46, 6449, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Mat.pyx":6464
 * 
 *         """
 *         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, 6464, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6449
 *     #
 * 
 *     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":6466
 *         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:6466");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9NullSpace_23test = {"test", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_23test, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_22test};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(46, 6466, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6466, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "test", 0) < (0)) __PYX_ERR(46, 6466, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("test", 1, 1, 1, i); __PYX_ERR(46, 6466, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(46, 6466, __pyx_L3_error)
    }
    __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, 6466, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(46, 6466, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Mat.pyx":6481
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(MatNullSpaceTest(self.nsp, mat.mat, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/Mat.pyx":6482
 *         """
 *         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, 6482, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6483
 *         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, 6483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Mat.pyx":6466
 *         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":22
 *     Type = MatPartitioningType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":23
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.part             # <<<<<<<<<<<<<<
 *         self.part = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->part));

  /* "petsc4py/PETSc/MatPartitioning.pyx":24
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.part
 *         self.part = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self):
*/
  __pyx_v_self->part = NULL;

  /* "petsc4py/PETSc/MatPartitioning.pyx":22
 *     Type = MatPartitioningType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.part
 *         self.part = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/MatPartitioning.pyx":26
 *         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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__call__", __pyx_kwds); 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "petsc4py/PETSc/MatPartitioning.pyx":27
 * 
 *     def __call__(self):
 *         return self.getValue()             # <<<<<<<<<<<<<<
 * 
 *     def view(self, Viewer viewer=None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getValue, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 27, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":26
 *         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_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":29
 *         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:29");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15MatPartitioning_5view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_4view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(47, 29, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(47, 29, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(47, 29, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(47, 29, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 29, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(47, 29, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/MatPartitioning.pyx":44
 * 
 *         """
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(47, 44, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(47, 44, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/MatPartitioning.pyx":45
 *         """
 *         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":46
 *         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":47
 *         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, 47, __pyx_L1_error)

  /* "petsc4py/PETSc/MatPartitioning.pyx":29
 *         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":49
 *         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:49");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15MatPartitioning_7destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_6destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/MatPartitioning.pyx":59
 * 
 *         """
 *         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, 59, __pyx_L1_error)

  /* "petsc4py/PETSc/MatPartitioning.pyx":60
 *         """
 *         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":49
 *         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":62
 *         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:62");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15MatPartitioning_9create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_8create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(47, 62, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(47, 62, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(47, 62, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(47, 62, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(47, 62, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/MatPartitioning.pyx":77
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(47, 77, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/MatPartitioning.pyx":78
 *         """
 *         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, 78, __pyx_L1_error)

  /* "petsc4py/PETSc/MatPartitioning.pyx":79
 *         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":62
 *         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":81
 *         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:81");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15MatPartitioning_11setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_10setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_matpartitioning_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(47, 81, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(47, 81, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(47, 81, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(47, 81, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(47, 81, __pyx_L3_error)
    }
    __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, 81, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":96
 * 
 *         """
 *         cdef PetscMatPartitioningType cval = NULL             # <<<<<<<<<<<<<<
 *         matpartitioning_type = str2bytes(matpartitioning_type, &cval)
 *         CHKERR(MatPartitioningSetType(self.part, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/MatPartitioning.pyx":97
 *         """
 *         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, 97, __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":98
 *         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, 98, __pyx_L1_error)

  /* "petsc4py/PETSc/MatPartitioning.pyx":81
 *         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":100
 *         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:100");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15MatPartitioning_13getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_12getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/MatPartitioning.pyx":110
 * 
 *         """
 *         cdef PetscMatPartitioningType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(MatPartitioningGetType(self.part, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/MatPartitioning.pyx":111
 *         """
 *         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, 111, __pyx_L1_error)

  /* "petsc4py/PETSc/MatPartitioning.pyx":112
 *         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, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":100
 *         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":114
 *         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:114");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15MatPartitioning_15setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_15setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_14setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/MatPartitioning.pyx":124
 * 
 *         """
 *         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, 124, __pyx_L1_error)

  /* "petsc4py/PETSc/MatPartitioning.pyx":114
 *         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":126
 *         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:126");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15MatPartitioning_17setAdjacency = {"setAdjacency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_17setAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_16setAdjacency};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_adj,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(47, 126, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(47, 126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setAdjacency", 0) < (0)) __PYX_ERR(47, 126, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setAdjacency", 1, 1, 1, i); __PYX_ERR(47, 126, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(47, 126, __pyx_L3_error)
    }
    __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, 126, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "adj", 0))) __PYX_ERR(47, 126, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/MatPartitioning.pyx":142
 * 
 *         """
 *         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, 142, __pyx_L1_error)

  /* "petsc4py/PETSc/MatPartitioning.pyx":126
 *         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":144
 *         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:144");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15MatPartitioning_19apply = {"apply", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_19apply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_18apply};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_partitioning,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(47, 144, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(47, 144, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "apply", 0) < (0)) __PYX_ERR(47, 144, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("apply", 1, 1, 1, i); __PYX_ERR(47, 144, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(47, 144, __pyx_L3_error)
    }
    __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, 144, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "partitioning", 0))) __PYX_ERR(47, 144, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/MatPartitioning.pyx":157
 * 
 *         """
 *         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, 157, __pyx_L1_error)

  /* "petsc4py/PETSc/MatPartitioning.pyx":144
 *         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":218
 *     # --- xxx ---
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":219
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.pc             # <<<<<<<<<<<<<<
 *         self.pc = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->pc));

  /* "petsc4py/PETSc/PC.pyx":220
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.pc
 *         self.pc = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self, x, y=None):
*/
  __pyx_v_self->pc = NULL;

  /* "petsc4py/PETSc/PC.pyx":218
 *     # --- xxx ---
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.pc
 *         self.pc = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/PC.pyx":222
 *         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_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 222, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 222, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 222, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(48, 222, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, i); __PYX_ERR(48, 222, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 222, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 222, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 222, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  size_t __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":223
 * 
 *     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":224
 *     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_5 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getOperators, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_createVecLeft, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/PC.pyx":223
 * 
 *     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":225
 *         if y is None: # XXX do this better
 *             y = self.getOperators()[0].createVecLeft()
 *         self.apply(x, y)             # <<<<<<<<<<<<<<
 *         return y
 * 
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_x, __pyx_v_y};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_apply, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":226
 *             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":222
 *         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":230
 *     # --- 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:230");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_5view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_4view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 230, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 230, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(48, 230, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 230, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 230, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(48, 230, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/PC.pyx":245
 * 
 *         """
 *         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":246
 *         """
 *         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":247
 *         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, 247, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":230
 *     # --- 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":249
 *         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:249");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_7destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_6destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/PC.pyx":259
 * 
 *         """
 *         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, 259, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":260
 *         """
 *         CHKERR(PCDestroy(&self.pc))
 *         self.pc = NULL             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_v_self->pc = NULL;

  /* "petsc4py/PETSc/PC.pyx":261
 *         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":249
 *         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":263
 *         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:263");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_9create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_8create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 263, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(48, 263, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 263, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(48, 263, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/PC.pyx":282
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(48, 282, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":283
 *         """
 *         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":284
 *         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, 284, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":285
 *         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, 285, __pyx_L1_error)
  __pyx_v_self->pc = __pyx_v_newpc;

  /* "petsc4py/PETSc/PC.pyx":286
 *         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":263
 *         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":288
 *         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:288");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_11setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_10setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pc_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 288, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 288, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(48, 288, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(48, 288, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 288, __pyx_L3_error)
    }
    __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, 288, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":303
 * 
 *         """
 *         cdef PetscPCType cval = NULL             # <<<<<<<<<<<<<<
 *         pc_type = str2bytes(pc_type, &cval)
 *         CHKERR(PCSetType(self.pc, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/PC.pyx":304
 *         """
 *         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, 304, __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":305
 *         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, 305, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":288
 *         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":307
 *         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:307");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_13getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_12getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/PC.pyx":317
 * 
 *         """
 *         cdef PetscPCType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PCGetType(self.pc, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/PC.pyx":318
 *         """
 *         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, 318, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":319
 *         cdef PetscPCType cval = NULL
 *         CHKERR(PCGetType(self.pc, &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PC.pyx":307
 *         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":321
 *         return bytes2str(cval)
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> 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) -> 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:321");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_15setOptionsPrefix = {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_15setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_14setOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 321, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 321, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOptionsPrefix", 0) < (0)) __PYX_ERR(48, 321, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, i); __PYX_ERR(48, 321, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 321, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 321, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":336
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(PCSetOptionsPrefix(self.pc, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/PC.pyx":337
 *         """
 *         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, 337, __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":338
 *         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, 338, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":321
 *         return bytes2str(cval)
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> 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":340
 *         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:340");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_17getOptionsPrefix = {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_17getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_16getOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOptionsPrefix", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/PC.pyx":350
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PCGetOptionsPrefix(self.pc, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/PC.pyx":351
 *         """
 *         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, 351, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":352
 *         cdef const char *cval = NULL
 *         CHKERR(PCGetOptionsPrefix(self.pc, &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PC.pyx":340
 *         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":354
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> 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) -> 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:354");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_19appendOptionsPrefix = {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_19appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_18appendOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 354, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 354, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "appendOptionsPrefix", 0) < (0)) __PYX_ERR(48, 354, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, i); __PYX_ERR(48, 354, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 354, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 354, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":369
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(PCAppendOptionsPrefix(self.pc, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/PC.pyx":370
 *         """
 *         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, 370, __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":371
 *         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, 371, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":354
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> 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":373
 *         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:373");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_21setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_21setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_20setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/PC.pyx":383
 * 
 *         """
 *         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, 383, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":373
 *         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":385
 *         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        Notes\n        -----\n        Using this directly is rarely needed, the preferred, and equivalent, usage\n        is to call `KSP.setOperators`.\n\n        See Also\n        --------\n        petsc.PCSetOperators\n\n        \nSource code at petsc4py/PETSc/PC.pyx:385");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_23setOperators = {"setOperators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_23setOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_22setOperators};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_P,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 385, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 385, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 385, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOperators", 0) < (0)) __PYX_ERR(48, 385, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 385, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 385, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 385, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(48, 385, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(48, 385, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/PC.pyx":414
 * 
 *         """
 *         cdef PetscMat amat=NULL             # <<<<<<<<<<<<<<
 *         if A is not None: amat = A.mat
 *         cdef PetscMat pmat=amat
*/
  __pyx_v_amat = NULL;

  /* "petsc4py/PETSc/PC.pyx":415
 *         """
 *         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":416
 *         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":417
 *         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":418
 *         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, 418, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":385
 *         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":420
 *         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:420");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_25getOperators = {"getOperators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_25getOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_24getOperators};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOperators", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getOperators", 0);

  /* "petsc4py/PETSc/PC.pyx":430
 * 
 *         """
 *         cdef Mat A = Mat(), P = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(PCGetOperators(self.pc, &A.mat, &P.mat))
 *         CHKERR(PetscINCREF(A.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 430, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_A = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 430, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/PC.pyx":431
 *         """
 *         cdef Mat A = Mat(), P = Mat()
 *         CHKERR(PCGetOperators(self.pc, &A.mat, &P.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(A.obj))
 *         CHKERR(PetscINCREF(P.obj))
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCGetOperators(__pyx_v_self->pc, (&__pyx_v_A->mat), (&__pyx_v_P->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 431, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":432
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_A->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 432, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":433
 *         CHKERR(PCGetOperators(self.pc, &A.mat, &P.mat))
 *         CHKERR(PetscINCREF(A.obj))
 *         CHKERR(PetscINCREF(P.obj))             # <<<<<<<<<<<<<<
 *         return (A, P)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 433, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":434
 *         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, 434, __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)) != (0)) __PYX_ERR(48, 434, __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)) != (0)) __PYX_ERR(48, 434, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PC.pyx":420
 *         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_XDECREF(__pyx_t_2);
  __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":436
 *         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:436");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_27setUseAmat = {"setUseAmat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_27setUseAmat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_26setUseAmat};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 436, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 436, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setUseAmat", 0) < (0)) __PYX_ERR(48, 436, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setUseAmat", 1, 1, 1, i); __PYX_ERR(48, 436, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 436, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setUseAmat", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 436, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/PC.pyx":457
 * 
 *         """
 *         cdef PetscBool cflag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         if flag:
 *             cflag = PETSC_TRUE
*/
  __pyx_v_cflag = PETSC_FALSE;

  /* "petsc4py/PETSc/PC.pyx":458
 *         """
 *         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, 458, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/PC.pyx":459
 *         cdef PetscBool cflag = PETSC_FALSE
 *         if flag:
 *             cflag = PETSC_TRUE             # <<<<<<<<<<<<<<
 *         CHKERR(PCSetUseAmat(self.pc, cflag))
 * 
*/
    __pyx_v_cflag = PETSC_TRUE;

    /* "petsc4py/PETSc/PC.pyx":458
 *         """
 *         cdef PetscBool cflag = PETSC_FALSE
 *         if flag:             # <<<<<<<<<<<<<<
 *             cflag = PETSC_TRUE
 *         CHKERR(PCSetUseAmat(self.pc, cflag))
*/
  }

  /* "petsc4py/PETSc/PC.pyx":460
 *         if flag:
 *             cflag = PETSC_TRUE
 *         CHKERR(PCSetUseAmat(self.pc, cflag))             # <<<<<<<<<<<<<<
 * 
 *     def getUseAmat(self) -> bool:
*/
  __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, 460, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":436
 *         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":462
 *         CHKERR(PCSetUseAmat(self.pc, cflag))
 * 
 *     def getUseAmat(self) -> bool:             # <<<<<<<<<<<<<<
 *         """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) -> bool\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:462");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_29getUseAmat = {"getUseAmat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_29getUseAmat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_28getUseAmat};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getUseAmat", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/PC.pyx":477
 * 
 *         """
 *         cdef PetscBool cflag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(PCGetUseAmat(self.pc, &cflag))
 *         return toBool(cflag)
*/
  __pyx_v_cflag = PETSC_FALSE;

  /* "petsc4py/PETSc/PC.pyx":478
 *         """
 *         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, 478, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":479
 *         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, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PC.pyx":462
 *         CHKERR(PCSetUseAmat(self.pc, cflag))
 * 
 *     def getUseAmat(self) -> bool:             # <<<<<<<<<<<<<<
 *         """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":481
 *         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:481");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_31setReusePreconditioner = {"setReusePreconditioner", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_31setReusePreconditioner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_30setReusePreconditioner};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 481, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 481, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setReusePreconditioner", 0) < (0)) __PYX_ERR(48, 481, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setReusePreconditioner", 1, 1, 1, i); __PYX_ERR(48, 481, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 481, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setReusePreconditioner", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 481, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/PC.pyx":501
 * 
 *         """
 *         cdef PetscBool cflag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         if flag:
 *             cflag = PETSC_TRUE
*/
  __pyx_v_cflag = PETSC_FALSE;

  /* "petsc4py/PETSc/PC.pyx":502
 *         """
 *         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, 502, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/PC.pyx":503
 *         cdef PetscBool cflag = PETSC_FALSE
 *         if flag:
 *             cflag = PETSC_TRUE             # <<<<<<<<<<<<<<
 *         CHKERR(PCSetReusePreconditioner(self.pc, cflag))
 * 
*/
    __pyx_v_cflag = PETSC_TRUE;

    /* "petsc4py/PETSc/PC.pyx":502
 *         """
 *         cdef PetscBool cflag = PETSC_FALSE
 *         if flag:             # <<<<<<<<<<<<<<
 *             cflag = PETSC_TRUE
 *         CHKERR(PCSetReusePreconditioner(self.pc, cflag))
*/
  }

  /* "petsc4py/PETSc/PC.pyx":504
 *         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, 504, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":481
 *         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":506
 *         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:506");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_33setFailedReason = {"setFailedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_33setFailedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_32setFailedReason};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_reason,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 506, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFailedReason", 0) < (0)) __PYX_ERR(48, 506, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFailedReason", 1, 1, 1, i); __PYX_ERR(48, 506, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 506, __pyx_L3_error)
    }
    __pyx_v_reason = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setFailedReason", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 506, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/PC.pyx":521
 * 
 *         """
 *         cdef PetscPCFailedReason val = reason             # <<<<<<<<<<<<<<
 *         CHKERR(PCSetFailedReason(self.pc, val))
 * 
*/
  __pyx_t_1 = ((PCFailedReason)__Pyx_PyLong_As_PCFailedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 521, __pyx_L1_error)
  __pyx_v_val = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":522
 *         """
 *         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, 522, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":506
 *         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":524
 *         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        Not collective.\n\n        After a call to KSPCheckDot() or\n        KSPCheckNorm() inside a KSPSolve(), or after\n        a call to PCReduceFailedReason() this is the maximum\n        reason over all ranks in the\n        PC communicator and hence logically collective.\n        Otherwise it is the local value.\n\n        See Also\n        --------\n        petsc.PCGetFailedReason\n\n        \nSource code at petsc4py/PETSc/PC.pyx:524");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_35getFailedReason = {"getFailedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_35getFailedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_34getFailedReason};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFailedReason", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/PC.pyx":541
 * 
 *         """
 *         cdef PetscPCFailedReason reason = PC_NOERROR             # <<<<<<<<<<<<<<
 *         CHKERR(PCGetFailedReason(self.pc, &reason))
 *         return reason
*/
  __pyx_v_reason = PC_NOERROR;

  /* "petsc4py/PETSc/PC.pyx":542
 *         """
 *         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, 542, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":543
 *         cdef PetscPCFailedReason reason = PC_NOERROR
 *         CHKERR(PCGetFailedReason(self.pc, &reason))
 *         return reason             # <<<<<<<<<<<<<<
 * 
 *     def setUp(self) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_PCFailedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PC.pyx":524
 *         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":545
 *         return reason
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for the `PC`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_37setUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_36setUp, "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:545");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_37setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_37setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_36setUp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_37setUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_36setUp(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_36setUp(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", 0);

  /* "petsc4py/PETSc/PC.pyx":555
 * 
 *         """
 *         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, 555, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":545
 *         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":557
 *         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_39reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_38reset, "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:557");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_39reset = {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_39reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_38reset};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_39reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("reset", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_38reset(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_38reset(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", 0);

  /* "petsc4py/PETSc/PC.pyx":567
 * 
 *         """
 *         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, 567, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":557
 *         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":569
 *         CHKERR(PCReset(self.pc))
 * 
 *     def setUpOnBlocks(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the `PC` for each block.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_41setUpOnBlocks(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_40setUpOnBlocks, "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:569");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_41setUpOnBlocks = {"setUpOnBlocks", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_41setUpOnBlocks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_40setUpOnBlocks};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_41setUpOnBlocks(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUpOnBlocks", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_40setUpOnBlocks(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_40setUpOnBlocks(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", 0);

  /* "petsc4py/PETSc/PC.pyx":583
 * 
 *         """
 *         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, 583, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":569
 *         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":585
 *         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_43apply(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_42apply, "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:585");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_43apply = {"apply", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_43apply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_42apply};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_43apply(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 585, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 585, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 585, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "apply", 0) < (0)) __PYX_ERR(48, 585, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("apply", 1, 2, 2, i); __PYX_ERR(48, 585, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 585, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 585, __pyx_L3_error)
    }
    __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, 585, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(48, 585, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(48, 585, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_42apply(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_42apply(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", 0);

  /* "petsc4py/PETSc/PC.pyx":602
 * 
 *         """
 *         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, 602, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":585
 *         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":604
 *         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_45matApply(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_44matApply, "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:604");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_45matApply = {"matApply", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_45matApply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_44matApply};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_45matApply(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 604, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 604, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 604, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "matApply", 0) < (0)) __PYX_ERR(48, 604, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("matApply", 1, 2, 2, i); __PYX_ERR(48, 604, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 604, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 604, __pyx_L3_error)
    }
    __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, 604, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "x", 0))) __PYX_ERR(48, 604, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "y", 0))) __PYX_ERR(48, 604, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_44matApply(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_44matApply(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", 0);

  /* "petsc4py/PETSc/PC.pyx":621
 * 
 *         """
 *         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, 621, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":604
 *         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":623
 *         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_47applyTranspose(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_46applyTranspose, "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:623");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_47applyTranspose = {"applyTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_47applyTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_46applyTranspose};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_47applyTranspose(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 623, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 623, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 623, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "applyTranspose", 0) < (0)) __PYX_ERR(48, 623, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("applyTranspose", 1, 2, 2, i); __PYX_ERR(48, 623, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 623, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 623, __pyx_L3_error)
    }
    __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, 623, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(48, 623, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(48, 623, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_46applyTranspose(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_46applyTranspose(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", 0);

  /* "petsc4py/PETSc/PC.pyx":643
 * 
 *         """
 *         CHKERR(PCApplyTranspose(self.pc, x.vec, y.vec))             # <<<<<<<<<<<<<<
 * 
 *     def matApplyTranspose(self, Mat x, Mat 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, 643, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":623
 *         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":645
 *         CHKERR(PCApplyTranspose(self.pc, x.vec, y.vec))
 * 
 *     def matApplyTranspose(self, Mat x, Mat y) -> None:             # <<<<<<<<<<<<<<
 *         """Apply the transpose of the `PC` to many vectors stored as `Mat.Type.DENSE`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_49matApplyTranspose(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_48matApplyTranspose, "PC.matApplyTranspose(self, x: Mat, y: Mat) -> None\nApply the transpose of 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.PCMatApplyTranspose\n\n        \nSource code at petsc4py/PETSc/PC.pyx:645");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_49matApplyTranspose = {"matApplyTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_49matApplyTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_48matApplyTranspose};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_49matApplyTranspose(PyObject *__pyx_v_self, 
#if 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("matApplyTranspose (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 645, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 645, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "matApplyTranspose", 0) < (0)) __PYX_ERR(48, 645, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("matApplyTranspose", 1, 2, 2, i); __PYX_ERR(48, 645, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 645, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 645, __pyx_L3_error)
    }
    __pyx_v_x = ((struct PyPetscMatObject *)values[0]);
    __pyx_v_y = ((struct PyPetscMatObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("matApplyTranspose", 1, 2, 2, __pyx_nargs); __PYX_ERR(48, 645, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.PC.matApplyTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "x", 0))) __PYX_ERR(48, 645, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "y", 0))) __PYX_ERR(48, 645, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_48matApplyTranspose(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_48matApplyTranspose(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("matApplyTranspose", 0);

  /* "petsc4py/PETSc/PC.pyx":662
 * 
 *         """
 *         CHKERR(PCMatApplyTranspose(self.pc, x.mat, y.mat))             # <<<<<<<<<<<<<<
 * 
 *     def applySymmetricLeft(self, Vec x, Vec y) -> None:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMatApplyTranspose(__pyx_v_self->pc, __pyx_v_x->mat, __pyx_v_y->mat)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 662, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":645
 *         CHKERR(PCApplyTranspose(self.pc, x.vec, y.vec))
 * 
 *     def matApplyTranspose(self, Mat x, Mat y) -> None:             # <<<<<<<<<<<<<<
 *         """Apply the transpose of 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.matApplyTranspose", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/PC.pyx":664
 *         CHKERR(PCMatApplyTranspose(self.pc, x.mat, y.mat))
 * 
 *     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:664");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_51applySymmetricLeft = {"applySymmetricLeft", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_51applySymmetricLeft, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_50applySymmetricLeft};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 664, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 664, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 664, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "applySymmetricLeft", 0) < (0)) __PYX_ERR(48, 664, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("applySymmetricLeft", 1, 2, 2, i); __PYX_ERR(48, 664, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 664, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 664, __pyx_L3_error)
    }
    __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, 664, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(48, 664, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(48, 664, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/PC.pyx":681
 * 
 *         """
 *         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, 681, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":664
 *         CHKERR(PCMatApplyTranspose(self.pc, x.mat, y.mat))
 * 
 *     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":683
 *         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:683");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_53applySymmetricRight = {"applySymmetricRight", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_53applySymmetricRight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_52applySymmetricRight};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 683, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 683, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 683, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "applySymmetricRight", 0) < (0)) __PYX_ERR(48, 683, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("applySymmetricRight", 1, 2, 2, i); __PYX_ERR(48, 683, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 683, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 683, __pyx_L3_error)
    }
    __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, 683, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(48, 683, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(48, 683, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/PC.pyx":700
 * 
 *         """
 *         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, 700, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":683
 *         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":704
 *     # --- 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:704");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_55getDM = {"getDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_55getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_54getDM};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDM", __pyx_kwds); 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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDM", 0);

  /* "petsc4py/PETSc/PC.pyx":714
 * 
 *         """
 *         cdef PetscDM newdm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PCGetDM(self.pc, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()
*/
  __pyx_v_newdm = NULL;

  /* "petsc4py/PETSc/PC.pyx":715
 *         """
 *         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, 715, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":716
 *         cdef PetscDM newdm = NULL
 *         CHKERR(PCGetDM(self.pc, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()             # <<<<<<<<<<<<<<
 *         dm.dm = newdm
 *         CHKERR(PetscINCREF(dm.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(48, 716, __pyx_L1_error)
  __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":717
 *         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":718
 *         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, 718, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":719
 *         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":704
 *     # --- 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_XDECREF(__pyx_t_4);
  __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":721
 *         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:721");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_57setDM = {"setDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_57setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_56setDM};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 721, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDM", 0) < (0)) __PYX_ERR(48, 721, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, i); __PYX_ERR(48, 721, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 721, __pyx_L3_error)
    }
    __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, 721, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(48, 721, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/PC.pyx":736
 * 
 *         """
 *         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, 736, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":721
 *         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":738
 *         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:738");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_59setCoordinates = {"setCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_59setCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_58setCoordinates};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_coordinates,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 738, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCoordinates", 0) < (0)) __PYX_ERR(48, 738, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCoordinates", 1, 1, 1, i); __PYX_ERR(48, 738, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 738, __pyx_L3_error)
    }
    __pyx_v_coordinates = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setCoordinates", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 738, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PetscErrorCode __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setCoordinates", 0);

  /* "petsc4py/PETSc/PC.pyx":753
 * 
 *         """
 *         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, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_xyz = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/PC.pyx":754
 *         """
 *         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, 754, __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":755
 *         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)) {
    __pyx_t_3 = NULL;

    /* "petsc4py/PETSc/PC.pyx":757
 *         if PyArray_NDIM(xyz) != 2: raise ValueError(
 *             ("coordinates must have two dimensions: "
 *              "coordinates.ndim=%d") % (PyArray_NDIM(xyz)))             # <<<<<<<<<<<<<<
 *         cdef PetscInt nvtx = <PetscInt> PyArray_DIM(xyz, 0)
 *         cdef PetscInt ndim = <PetscInt> PyArray_DIM(xyz, 1)
*/
    __pyx_t_4 = __Pyx_PyLong_From_int(PyArray_NDIM(__pyx_v_xyz)); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_coordinates_must_have_two_dimens, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 755, __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(48, 755, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":755
 *         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)))
*/
  }

  /* "petsc4py/PETSc/PC.pyx":758
 *             ("coordinates must have two dimensions: "
 *              "coordinates.ndim=%d") % (PyArray_NDIM(xyz)))
 *         cdef PetscInt nvtx = <PetscInt> PyArray_DIM(xyz, 0)             # <<<<<<<<<<<<<<
 *         cdef PetscInt ndim = <PetscInt> PyArray_DIM(xyz, 1)
 *         cdef PetscReal *coords = <PetscReal*> PyArray_DATA(xyz)
*/
  __pyx_v_nvtx = ((PetscInt)PyArray_DIM(__pyx_v_xyz, 0));

  /* "petsc4py/PETSc/PC.pyx":759
 *              "coordinates.ndim=%d") % (PyArray_NDIM(xyz)))
 *         cdef PetscInt nvtx = <PetscInt> PyArray_DIM(xyz, 0)
 *         cdef PetscInt ndim = <PetscInt> PyArray_DIM(xyz, 1)             # <<<<<<<<<<<<<<
 *         cdef PetscReal *coords = <PetscReal*> PyArray_DATA(xyz)
 *         CHKERR(PCSetCoordinates(self.pc, ndim, nvtx, coords))
*/
  __pyx_v_ndim = ((PetscInt)PyArray_DIM(__pyx_v_xyz, 1));

  /* "petsc4py/PETSc/PC.pyx":760
 *         cdef PetscInt nvtx = <PetscInt> PyArray_DIM(xyz, 0)
 *         cdef PetscInt ndim = <PetscInt> PyArray_DIM(xyz, 1)
 *         cdef PetscReal *coords = <PetscReal*> PyArray_DATA(xyz)             # <<<<<<<<<<<<<<
 *         CHKERR(PCSetCoordinates(self.pc, ndim, nvtx, coords))
 * 
*/
  __pyx_v_coords = ((PetscReal *)PyArray_DATA(__pyx_v_xyz));

  /* "petsc4py/PETSc/PC.pyx":761
 *         cdef PetscInt ndim = <PetscInt> PyArray_DIM(xyz, 1)
 *         cdef PetscReal *coords = <PetscReal*> PyArray_DATA(xyz)
 *         CHKERR(PCSetCoordinates(self.pc, ndim, nvtx, coords))             # <<<<<<<<<<<<<<
 * 
 *     # --- Python ---
*/
  __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCSetCoordinates(__pyx_v_self->pc, __pyx_v_ndim, __pyx_v_nvtx, __pyx_v_coords)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 761, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":738
 *         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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":765
 *     # --- 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:765");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_61createPython = {"createPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_61createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_60createPython};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_context,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 765, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 765, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 765, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createPython", 0) < (0)) __PYX_ERR(48, 765, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 765, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 765, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 765, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/PC.pyx":782
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(48, 782, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":783
 *         """
 *         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":784
 *         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, 784, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":785
 *         cdef PetscPC newpc = NULL
 *         CHKERR(PCCreate(ccomm, &newpc))
 *         CHKERR(PetscCLEAR(self.obj)); self.pc = newpc             # <<<<<<<<<<<<<<
 *         CHKERR(PCSetType(self.pc, PCPYTHON))
 *         CHKERR(PCPythonSetContext(self.pc, <void*>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, 785, __pyx_L1_error)
  __pyx_v_self->pc = __pyx_v_newpc;

  /* "petsc4py/PETSc/PC.pyx":786
 *         CHKERR(PCCreate(ccomm, &newpc))
 *         CHKERR(PetscCLEAR(self.obj)); self.pc = newpc
 *         CHKERR(PCSetType(self.pc, PCPYTHON))             # <<<<<<<<<<<<<<
 *         CHKERR(PCPythonSetContext(self.pc, <void*>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, 786, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":787
 *         CHKERR(PetscCLEAR(self.obj)); self.pc = newpc
 *         CHKERR(PCSetType(self.pc, PCPYTHON))
 *         CHKERR(PCPythonSetContext(self.pc, <void*>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, 787, __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, 787, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":788
 *         CHKERR(PCSetType(self.pc, PCPYTHON))
 *         CHKERR(PCPythonSetContext(self.pc, <void*>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":765
 *     # --- 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":790
 *         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:790");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_63setPythonContext = {"setPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_63setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_62setPythonContext};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_context,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 790, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 790, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPythonContext", 0) < (0)) __PYX_ERR(48, 790, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, i); __PYX_ERR(48, 790, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 790, __pyx_L3_error)
    }
    __pyx_v_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 790, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/PC.pyx":800
 * 
 *         """
 *         CHKERR(PCPythonSetContext(self.pc, <void*>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, 800, __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, 800, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":790
 *         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":802
 *         CHKERR(PCPythonSetContext(self.pc, <void*>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:802");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_65getPythonContext = {"getPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_65getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_64getPythonContext};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPythonContext", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/PC.pyx":812
 * 
 *         """
 *         cdef void *context = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PCPythonGetContext(self.pc, &context))
 *         if context == NULL: return None
*/
  __pyx_v_context = NULL;

  /* "petsc4py/PETSc/PC.pyx":813
 *         """
 *         cdef void *context = NULL
 *         CHKERR(PCPythonGetContext(self.pc, &context))             # <<<<<<<<<<<<<<
 *         if context == NULL: return None
 *         else: return <object> context
*/
  __pyx_t_1 = PCPythonGetContext(__pyx_v_self->pc, (&__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 813, __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, 813, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":814
 *         cdef void *context = NULL
 *         CHKERR(PCPythonGetContext(self.pc, &context))
 *         if context == NULL: return None             # <<<<<<<<<<<<<<
 *         else: return <object> 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":815
 *         CHKERR(PCPythonGetContext(self.pc, &context))
 *         if context == NULL: return None
 *         else: return <object> 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":802
 *         CHKERR(PCPythonSetContext(self.pc, <void*>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":817
 *         else: return <object> 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:817");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_67setPythonType = {"setPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_67setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_66setPythonType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_py_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 817, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 817, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPythonType", 0) < (0)) __PYX_ERR(48, 817, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, i); __PYX_ERR(48, 817, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 817, __pyx_L3_error)
    }
    __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, 817, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":827
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         py_type = str2bytes(py_type, &cval)
 *         CHKERR(PCPythonSetType(self.pc, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/PC.pyx":828
 *         """
 *         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, 828, __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":829
 *         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, 829, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":817
 *         else: return <object> 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":831
 *         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:831");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_69getPythonType = {"getPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_69getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_68getPythonType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPythonType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/PC.pyx":841
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PCPythonGetType(self.pc, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/PC.pyx":842
 *         """
 *         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, 842, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":843
 *         cdef const char *cval = NULL
 *         CHKERR(PCPythonGetType(self.pc, &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     # --- Block Jacobi ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PC.pyx":831
 *         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":847
 *     # --- Block Jacobi ---
 * 
 *     def getBJacobiSubKSP(self) -> list[KSP]:             # <<<<<<<<<<<<<<
 *         """Return the local `KSP` object for all blocks on this process.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_71getBJacobiSubKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_70getBJacobiSubKSP, "PC.getBJacobiSubKSP(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.PCBJacobiGetSubKSP\n\n        \nSource code at petsc4py/PETSc/PC.pyx:847");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_71getBJacobiSubKSP = {"getBJacobiSubKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_71getBJacobiSubKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_70getBJacobiSubKSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_71getBJacobiSubKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getBJacobiSubKSP (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getBJacobiSubKSP", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBJacobiSubKSP", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_70getBJacobiSubKSP(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_70getBJacobiSubKSP(struct PyPetscPCObject *__pyx_v_self) {
  PetscInt __pyx_v_n;
  KSP *__pyx_v_p;
  long __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("getBJacobiSubKSP", 0);

  /* "petsc4py/PETSc/PC.pyx":857
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         cdef PetscKSP *p = NULL
 *         CHKERR(PCBJacobiGetSubKSP(self.pc, &n, NULL, &p))
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/PC.pyx":858
 *         """
 *         cdef PetscInt n = 0
 *         cdef PetscKSP *p = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PCBJacobiGetSubKSP(self.pc, &n, NULL, &p))
 *         return [ref_KSP(p[i]) for i from 0 <= i <n]
*/
  __pyx_v_p = NULL;

  /* "petsc4py/PETSc/PC.pyx":859
 *         cdef PetscInt n = 0
 *         cdef PetscKSP *p = NULL
 *         CHKERR(PCBJacobiGetSubKSP(self.pc, &n, NULL, &p))             # <<<<<<<<<<<<<<
 *         return [ref_KSP(p[i]) for i from 0 <= i <n]
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBJacobiGetSubKSP(__pyx_v_self->pc, (&__pyx_v_n), NULL, (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 859, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":860
 *         cdef PetscKSP *p = NULL
 *         CHKERR(PCBJacobiGetSubKSP(self.pc, &n, NULL, &p))
 *         return [ref_KSP(p[i]) for i from 0 <= i <n]             # <<<<<<<<<<<<<<
 * 
 *     # --- ASM ---
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 860, __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, 860, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(48, 860, __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":847
 *     # --- Block Jacobi ---
 * 
 *     def getBJacobiSubKSP(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.getBJacobiSubKSP", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/PC.pyx":864
 *     # --- ASM ---
 * 
 *     def setASMType(self, asmtype: ASMType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of restriction and interpolation.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_73setASMType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_72setASMType, "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:864");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_73setASMType = {"setASMType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_73setASMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_72setASMType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_73setASMType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_asmtype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 864, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 864, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setASMType", 0) < (0)) __PYX_ERR(48, 864, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setASMType", 1, 1, 1, i); __PYX_ERR(48, 864, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 864, __pyx_L3_error)
    }
    __pyx_v_asmtype = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setASMType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 864, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_72setASMType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_asmtype);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_72setASMType(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", 0);

  /* "petsc4py/PETSc/PC.pyx":879
 * 
 *         """
 *         cdef PetscPCASMType cval = asmtype             # <<<<<<<<<<<<<<
 *         CHKERR(PCASMSetType(self.pc, cval))
 * 
*/
  __pyx_t_1 = ((PCASMType)__Pyx_PyLong_As_PCASMType(__pyx_v_asmtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 879, __pyx_L1_error)
  __pyx_v_cval = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":880
 *         """
 *         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, 880, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":864
 *     # --- 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":882
 *         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_75setASMOverlap(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_74setASMOverlap, "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:882");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_75setASMOverlap = {"setASMOverlap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_75setASMOverlap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_74setASMOverlap};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_75setASMOverlap(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_overlap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 882, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 882, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setASMOverlap", 0) < (0)) __PYX_ERR(48, 882, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setASMOverlap", 1, 1, 1, i); __PYX_ERR(48, 882, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 882, __pyx_L3_error)
    }
    __pyx_v_overlap = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setASMOverlap", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 882, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_74setASMOverlap(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_overlap);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_74setASMOverlap(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", 0);

  /* "petsc4py/PETSc/PC.pyx":897
 * 
 *         """
 *         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, 897, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":898
 *         """
 *         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, 898, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":882
 *         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":900
 *         CHKERR(PCASMSetOverlap(self.pc, ival))
 * 
 *     def setASMLocalSubdomains(             # <<<<<<<<<<<<<<
 *         self,
 *         nsd: int,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_77setASMLocalSubdomains(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_76setASMLocalSubdomains, "PC.setASMLocalSubdomains(self, nsd: int, is_sub: 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_sub\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:900");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_77setASMLocalSubdomains = {"setASMLocalSubdomains", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_77setASMLocalSubdomains, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_76setASMLocalSubdomains};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_77setASMLocalSubdomains(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_sub = 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nsd,&__pyx_mstate_global->__pyx_n_u_is_sub,&__pyx_mstate_global->__pyx_n_u_is_local,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 900, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setASMLocalSubdomains", 0) < (0)) __PYX_ERR(48, 900, __pyx_L3_error)

      /* "petsc4py/PETSc/PC.pyx":903
 *         self,
 *         nsd: int,
 *         is_sub: Sequence[IS] | None = None,             # <<<<<<<<<<<<<<
 *         is_local: Sequence[IS] | None = None) -> None:
 *         """Set the local subdomains.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/PC.pyx":904
 *         nsd: int,
 *         is_sub: Sequence[IS] | None = None,
 *         is_local: Sequence[IS] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the local subdomains.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setASMLocalSubdomains", 0, 1, 3, i); __PYX_ERR(48, 900, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 900, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 900, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/PC.pyx":903
 *         self,
 *         nsd: int,
 *         is_sub: Sequence[IS] | None = None,             # <<<<<<<<<<<<<<
 *         is_local: Sequence[IS] | None = None) -> None:
 *         """Set the local subdomains.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/PC.pyx":904
 *         nsd: int,
 *         is_sub: Sequence[IS] | None = None,
 *         is_local: Sequence[IS] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the local subdomains.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_nsd = values[0];
    __pyx_v_is_sub = 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, 900, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_76setASMLocalSubdomains(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_nsd, __pyx_v_is_sub, __pyx_v_is_local);

  /* "petsc4py/PETSc/PC.pyx":900
 *         CHKERR(PCASMSetOverlap(self.pc, ival))
 * 
 *     def setASMLocalSubdomains(             # <<<<<<<<<<<<<<
 *         self,
 *         nsd: int,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_76setASMLocalSubdomains(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nsd, PyObject *__pyx_v_is_sub, 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", 0);

  /* "petsc4py/PETSc/PC.pyx":925
 * 
 *         """
 *         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, 925, __pyx_L1_error)
  __pyx_v_n = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":926
 *         """
 *         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":927
 *         cdef PetscInt n = asInt(nsd)
 *         cdef PetscInt i = 0
 *         cdef PetscIS *isets = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscIS *isets_local = NULL
 *         if is_sub is not None:
*/
  __pyx_v_isets = NULL;

  /* "petsc4py/PETSc/PC.pyx":928
 *         cdef PetscInt i = 0
 *         cdef PetscIS *isets = NULL
 *         cdef PetscIS *isets_local = NULL             # <<<<<<<<<<<<<<
 *         if is_sub is not None:
 *             assert len(is_sub) == nsd
*/
  __pyx_v_isets_local = NULL;

  /* "petsc4py/PETSc/PC.pyx":929
 *         cdef PetscIS *isets = NULL
 *         cdef PetscIS *isets_local = NULL
 *         if is_sub is not None:             # <<<<<<<<<<<<<<
 *             assert len(is_sub) == nsd
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets))
*/
  __pyx_t_2 = (__pyx_v_is_sub != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/PC.pyx":930
 *         cdef PetscIS *isets_local = NULL
 *         if is_sub is not None:
 *             assert len(is_sub) == nsd             # <<<<<<<<<<<<<<
 *             CHKERR(PetscMalloc(<size_t>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_sub); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(48, 930, __pyx_L1_error)
      __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 930, __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, 930, __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, 930, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(48, 930, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(48, 930, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/PC.pyx":931
 *         if is_sub is not None:
 *             assert len(is_sub) == nsd
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets))             # <<<<<<<<<<<<<<
 *             for i in range(n):
 *                 isets[i] = (<IS?>is_sub[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, 931, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":932
 *             assert len(is_sub) == nsd
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets))
 *             for i in range(n):             # <<<<<<<<<<<<<<
 *                 isets[i] = (<IS?>is_sub[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":933
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets))
 *             for i in range(n):
 *                 isets[i] = (<IS?>is_sub[i]).iset             # <<<<<<<<<<<<<<
 *         if is_local is not None:
 *             assert len(is_local) == nsd
*/
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_is_sub, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 933, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(48, 933, __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":929
 *         cdef PetscIS *isets = NULL
 *         cdef PetscIS *isets_local = NULL
 *         if is_sub is not None:             # <<<<<<<<<<<<<<
 *             assert len(is_sub) == nsd
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets))
*/
  }

  /* "petsc4py/PETSc/PC.pyx":934
 *             for i in range(n):
 *                 isets[i] = (<IS?>is_sub[i]).iset
 *         if is_local is not None:             # <<<<<<<<<<<<<<
 *             assert len(is_local) == nsd
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets_local))
*/
  __pyx_t_2 = (__pyx_v_is_local != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/PC.pyx":935
 *                 isets[i] = (<IS?>is_sub[i]).iset
 *         if is_local is not None:
 *             assert len(is_local) == nsd             # <<<<<<<<<<<<<<
 *             CHKERR(PetscMalloc(<size_t>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, 935, __pyx_L1_error)
      __pyx_t_5 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 935, __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, 935, __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, 935, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(48, 935, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(48, 935, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/PC.pyx":936
 *         if is_local is not None:
 *             assert len(is_local) == nsd
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets_local))             # <<<<<<<<<<<<<<
 *             for i in range(n):
 *                 isets_local[i] = (<IS?>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, 936, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":937
 *             assert len(is_local) == nsd
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets_local))
 *             for i in range(n):             # <<<<<<<<<<<<<<
 *                 isets_local[i] = (<IS?>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":938
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets_local))
 *             for i in range(n):
 *                 isets_local[i] = (<IS?>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_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 938, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(48, 938, __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":934
 *             for i in range(n):
 *                 isets[i] = (<IS?>is_sub[i]).iset
 *         if is_local is not None:             # <<<<<<<<<<<<<<
 *             assert len(is_local) == nsd
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets_local))
*/
  }

  /* "petsc4py/PETSc/PC.pyx":939
 *             for i in range(n):
 *                 isets_local[i] = (<IS?>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, 939, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":940
 *                 isets_local[i] = (<IS?>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, 940, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":941
 *         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, 941, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":900
 *         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":943
 *         CHKERR(PetscFree(isets_local))
 * 
 *     def setASMTotalSubdomains(             # <<<<<<<<<<<<<<
 *         self,
 *         nsd: int,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_79setASMTotalSubdomains(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_78setASMTotalSubdomains, "PC.setASMTotalSubdomains(self, nsd: int, is_sub: 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_sub\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:943");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_79setASMTotalSubdomains = {"setASMTotalSubdomains", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_79setASMTotalSubdomains, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_78setASMTotalSubdomains};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_79setASMTotalSubdomains(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_sub = 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nsd,&__pyx_mstate_global->__pyx_n_u_is_sub,&__pyx_mstate_global->__pyx_n_u_is_local,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 943, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 943, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 943, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 943, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setASMTotalSubdomains", 0) < (0)) __PYX_ERR(48, 943, __pyx_L3_error)

      /* "petsc4py/PETSc/PC.pyx":946
 *         self,
 *         nsd: int,
 *         is_sub: Sequence[IS] | None = None,             # <<<<<<<<<<<<<<
 *         is_local: Sequence[IS] | None = None) -> None:
 *         """Set the subdomains for all processes.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/PC.pyx":947
 *         nsd: int,
 *         is_sub: Sequence[IS] | None = None,
 *         is_local: Sequence[IS] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the subdomains for all processes.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setASMTotalSubdomains", 0, 1, 3, i); __PYX_ERR(48, 943, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 943, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 943, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 943, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/PC.pyx":946
 *         self,
 *         nsd: int,
 *         is_sub: Sequence[IS] | None = None,             # <<<<<<<<<<<<<<
 *         is_local: Sequence[IS] | None = None) -> None:
 *         """Set the subdomains for all processes.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/PC.pyx":947
 *         nsd: int,
 *         is_sub: Sequence[IS] | None = None,
 *         is_local: Sequence[IS] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the subdomains for all processes.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_nsd = values[0];
    __pyx_v_is_sub = 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, 943, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_78setASMTotalSubdomains(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_nsd, __pyx_v_is_sub, __pyx_v_is_local);

  /* "petsc4py/PETSc/PC.pyx":943
 *         CHKERR(PetscFree(isets_local))
 * 
 *     def setASMTotalSubdomains(             # <<<<<<<<<<<<<<
 *         self,
 *         nsd: int,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_78setASMTotalSubdomains(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_nsd, PyObject *__pyx_v_is_sub, 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", 0);

  /* "petsc4py/PETSc/PC.pyx":968
 * 
 *         """
 *         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, 968, __pyx_L1_error)
  __pyx_v_n = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":969
 *         """
 *         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":970
 *         cdef PetscInt n = asInt(nsd)
 *         cdef PetscInt i = 0
 *         cdef PetscIS *isets = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscIS *isets_local = NULL
 *         if is_sub is not None:
*/
  __pyx_v_isets = NULL;

  /* "petsc4py/PETSc/PC.pyx":971
 *         cdef PetscInt i = 0
 *         cdef PetscIS *isets = NULL
 *         cdef PetscIS *isets_local = NULL             # <<<<<<<<<<<<<<
 *         if is_sub is not None:
 *             assert len(is_sub) == nsd
*/
  __pyx_v_isets_local = NULL;

  /* "petsc4py/PETSc/PC.pyx":972
 *         cdef PetscIS *isets = NULL
 *         cdef PetscIS *isets_local = NULL
 *         if is_sub is not None:             # <<<<<<<<<<<<<<
 *             assert len(is_sub) == nsd
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets))
*/
  __pyx_t_2 = (__pyx_v_is_sub != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/PC.pyx":973
 *         cdef PetscIS *isets_local = NULL
 *         if is_sub is not None:
 *             assert len(is_sub) == nsd             # <<<<<<<<<<<<<<
 *             CHKERR(PetscMalloc(<size_t>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_sub); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(48, 973, __pyx_L1_error)
      __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 973, __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, 973, __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, 973, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(48, 973, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(48, 973, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/PC.pyx":974
 *         if is_sub is not None:
 *             assert len(is_sub) == nsd
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets))             # <<<<<<<<<<<<<<
 *             for i in range(n):
 *                 isets[i] = (<IS?>is_sub[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, 974, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":975
 *             assert len(is_sub) == nsd
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets))
 *             for i in range(n):             # <<<<<<<<<<<<<<
 *                 isets[i] = (<IS?>is_sub[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":976
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets))
 *             for i in range(n):
 *                 isets[i] = (<IS?>is_sub[i]).iset             # <<<<<<<<<<<<<<
 *         if is_local is not None:
 *             assert len(is_local) == nsd
*/
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_is_sub, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 976, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(48, 976, __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":972
 *         cdef PetscIS *isets = NULL
 *         cdef PetscIS *isets_local = NULL
 *         if is_sub is not None:             # <<<<<<<<<<<<<<
 *             assert len(is_sub) == nsd
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets))
*/
  }

  /* "petsc4py/PETSc/PC.pyx":977
 *             for i in range(n):
 *                 isets[i] = (<IS?>is_sub[i]).iset
 *         if is_local is not None:             # <<<<<<<<<<<<<<
 *             assert len(is_local) == nsd
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets_local))
*/
  __pyx_t_2 = (__pyx_v_is_local != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/PC.pyx":978
 *                 isets[i] = (<IS?>is_sub[i]).iset
 *         if is_local is not None:
 *             assert len(is_local) == nsd             # <<<<<<<<<<<<<<
 *             CHKERR(PetscMalloc(<size_t>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, 978, __pyx_L1_error)
      __pyx_t_5 = PyLong_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 978, __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, 978, __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, 978, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(48, 978, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(48, 978, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/PC.pyx":979
 *         if is_local is not None:
 *             assert len(is_local) == nsd
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets_local))             # <<<<<<<<<<<<<<
 *             for i in range(n):
 *                 isets_local[i] = (<IS?>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, 979, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":980
 *             assert len(is_local) == nsd
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets_local))
 *             for i in range(n):             # <<<<<<<<<<<<<<
 *                 isets_local[i] = (<IS?>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":981
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets_local))
 *             for i in range(n):
 *                 isets_local[i] = (<IS?>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_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 981, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(48, 981, __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":977
 *             for i in range(n):
 *                 isets[i] = (<IS?>is_sub[i]).iset
 *         if is_local is not None:             # <<<<<<<<<<<<<<
 *             assert len(is_local) == nsd
 *             CHKERR(PetscMalloc(<size_t>n*sizeof(PetscIS), &isets_local))
*/
  }

  /* "petsc4py/PETSc/PC.pyx":982
 *             for i in range(n):
 *                 isets_local[i] = (<IS?>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, 982, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":983
 *                 isets_local[i] = (<IS?>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, 983, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":984
 *         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, 984, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":943
 *         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":986
 *         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_81getASMSubKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_80getASMSubKSP, "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:986");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_81getASMSubKSP = {"getASMSubKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_81getASMSubKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_80getASMSubKSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_81getASMSubKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getASMSubKSP", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_80getASMSubKSP(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_80getASMSubKSP(struct PyPetscPCObject *__pyx_v_self) {
  PetscInt __pyx_v_n;
  KSP *__pyx_v_p;
  long __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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getASMSubKSP", 0);

  /* "petsc4py/PETSc/PC.pyx":996
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         cdef PetscKSP *p = NULL
 *         CHKERR(PCASMGetSubKSP(self.pc, &n, NULL, &p))
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/PC.pyx":997
 *         """
 *         cdef PetscInt n = 0
 *         cdef PetscKSP *p = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PCASMGetSubKSP(self.pc, &n, NULL, &p))
 *         return [ref_KSP(p[i]) for i from 0 <= i <n]
*/
  __pyx_v_p = NULL;

  /* "petsc4py/PETSc/PC.pyx":998
 *         cdef PetscInt n = 0
 *         cdef PetscKSP *p = NULL
 *         CHKERR(PCASMGetSubKSP(self.pc, &n, NULL, &p))             # <<<<<<<<<<<<<<
 *         return [ref_KSP(p[i]) for i from 0 <= i <n]
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCASMGetSubKSP(__pyx_v_self->pc, (&__pyx_v_n), NULL, (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 998, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":999
 *         cdef PetscKSP *p = NULL
 *         CHKERR(PCASMGetSubKSP(self.pc, &n, NULL, &p))
 *         return [ref_KSP(p[i]) for i from 0 <= i <n]             # <<<<<<<<<<<<<<
 * 
 *     def setASMSortIndices(self, dosort: bool) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_v_n;
    for (__pyx_8genexpr9__pyx_v_i = 0; __pyx_8genexpr9__pyx_v_i < __pyx_t_3; __pyx_8genexpr9__pyx_v_i++) {
      __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP((__pyx_v_p[__pyx_8genexpr9__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 999, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(48, 999, __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":986
 *         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":1001
 *         return [ref_KSP(p[i]) for i from 0 <= i <n]
 * 
 *     def setASMSortIndices(self, dosort: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set to sort subdomain indices.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_83setASMSortIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_82setASMSortIndices, "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:1001");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_83setASMSortIndices = {"setASMSortIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_83setASMSortIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_82setASMSortIndices};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_83setASMSortIndices(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dosort,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1001, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1001, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setASMSortIndices", 0) < (0)) __PYX_ERR(48, 1001, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setASMSortIndices", 1, 1, 1, i); __PYX_ERR(48, 1001, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1001, __pyx_L3_error)
    }
    __pyx_v_dosort = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setASMSortIndices", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1001, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_82setASMSortIndices(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_dosort);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_82setASMSortIndices(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1016
 * 
 *         """
 *         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, 1016, __pyx_L1_error)
  __pyx_v_cdosort = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1017
 *         """
 *         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, 1017, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1001
 *         return [ref_KSP(p[i]) for i from 0 <= i <n]
 * 
 *     def setASMSortIndices(self, dosort: bool) -> 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":1021
 *     # --- GASM ---
 * 
 *     def setGASMType(self, gasmtype: GASMType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of restriction and interpolation.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_85setGASMType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_84setGASMType, "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:1021");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_85setGASMType = {"setGASMType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_85setGASMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_84setGASMType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_85setGASMType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gasmtype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1021, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setGASMType", 0) < (0)) __PYX_ERR(48, 1021, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setGASMType", 1, 1, 1, i); __PYX_ERR(48, 1021, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1021, __pyx_L3_error)
    }
    __pyx_v_gasmtype = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setGASMType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1021, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_84setGASMType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_gasmtype);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_84setGASMType(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1036
 * 
 *         """
 *         cdef PetscPCGASMType cval = gasmtype             # <<<<<<<<<<<<<<
 *         CHKERR(PCGASMSetType(self.pc, cval))
 * 
*/
  __pyx_t_1 = ((PCGASMType)__Pyx_PyLong_As_PCGASMType(__pyx_v_gasmtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1036, __pyx_L1_error)
  __pyx_v_cval = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1037
 *         """
 *         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, 1037, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1021
 *     # --- 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":1039
 *         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_87setGASMOverlap(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_86setGASMOverlap, "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:1039");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_87setGASMOverlap = {"setGASMOverlap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_87setGASMOverlap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_86setGASMOverlap};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_87setGASMOverlap(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_overlap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1039, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1039, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setGASMOverlap", 0) < (0)) __PYX_ERR(48, 1039, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setGASMOverlap", 1, 1, 1, i); __PYX_ERR(48, 1039, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1039, __pyx_L3_error)
    }
    __pyx_v_overlap = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setGASMOverlap", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1039, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_86setGASMOverlap(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_overlap);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_86setGASMOverlap(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1054
 * 
 *         """
 *         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, 1054, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1055
 *         """
 *         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, 1055, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1039
 *         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":1059
 *     # --- GAMG ---
 * 
 *     def setGAMGType(self, gamgtype: GAMGType | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of algorithm.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_89setGAMGType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_88setGAMGType, "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:1059");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_89setGAMGType = {"setGAMGType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_89setGAMGType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_88setGAMGType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_89setGAMGType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gamgtype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1059, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1059, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setGAMGType", 0) < (0)) __PYX_ERR(48, 1059, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setGAMGType", 1, 1, 1, i); __PYX_ERR(48, 1059, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1059, __pyx_L3_error)
    }
    __pyx_v_gamgtype = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setGAMGType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1059, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_88setGAMGType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_gamgtype);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_88setGAMGType(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":1074
 * 
 *         """
 *         cdef PetscPCGAMGType cval = NULL             # <<<<<<<<<<<<<<
 *         gamgtype = str2bytes(gamgtype, &cval)
 *         CHKERR(PCGAMGSetType(self.pc, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/PC.pyx":1075
 *         """
 *         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, 1075, __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":1076
 *         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, 1076, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1059
 *     # --- 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":1078
 *         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_91setGAMGLevels(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_90setGAMGLevels, "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:1078");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_91setGAMGLevels = {"setGAMGLevels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_91setGAMGLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_90setGAMGLevels};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_91setGAMGLevels(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_levels,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1078, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1078, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setGAMGLevels", 0) < (0)) __PYX_ERR(48, 1078, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setGAMGLevels", 1, 1, 1, i); __PYX_ERR(48, 1078, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1078, __pyx_L3_error)
    }
    __pyx_v_levels = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setGAMGLevels", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1078, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_90setGAMGLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_90setGAMGLevels(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1093
 * 
 *         """
 *         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, 1093, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1094
 *         """
 *         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, 1094, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1078
 *         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":1096
 *         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_93setGAMGSmooths(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_92setGAMGSmooths, "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:1096");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_93setGAMGSmooths = {"setGAMGSmooths", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_93setGAMGSmooths, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_92setGAMGSmooths};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_93setGAMGSmooths(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_smooths,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1096, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setGAMGSmooths", 0) < (0)) __PYX_ERR(48, 1096, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setGAMGSmooths", 1, 1, 1, i); __PYX_ERR(48, 1096, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1096, __pyx_L3_error)
    }
    __pyx_v_smooths = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setGAMGSmooths", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1096, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_92setGAMGSmooths(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_smooths);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_92setGAMGSmooths(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1111
 * 
 *         """
 *         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, 1111, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1112
 *         """
 *         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, 1112, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1096
 *         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":1116
 *     # --- Hypre ---
 * 
 *     def getHYPREType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the `Type.HYPRE` type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_95getHYPREType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_94getHYPREType, "PC.getHYPREType(self) -> str\nReturn the `Type.HYPRE` type.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PCHYPREGetType\n\n        \nSource code at petsc4py/PETSc/PC.pyx:1116");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_95getHYPREType = {"getHYPREType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_95getHYPREType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_94getHYPREType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_95getHYPREType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getHYPREType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_94getHYPREType(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_94getHYPREType(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1126
 * 
 *         """
 *         cdef PetscPCHYPREType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PCHYPREGetType(self.pc, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/PC.pyx":1127
 *         """
 *         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, 1127, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1128
 *         cdef PetscPCHYPREType cval = NULL
 *         CHKERR(PCHYPREGetType(self.pc, &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     def setHYPREType(self, hypretype: 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, 1128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PC.pyx":1116
 *     # --- 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":1130
 *         return bytes2str(cval)
 * 
 *     def setHYPREType(self, hypretype: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `Type.HYPRE` type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_97setHYPREType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_96setHYPREType, "PC.setHYPREType(self, hypretype: str) -> None\nSet the `Type.HYPRE` type.\n\n        Collective.\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:1130");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_97setHYPREType = {"setHYPREType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_97setHYPREType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_96setHYPREType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_97setHYPREType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_hypretype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1130, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1130, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setHYPREType", 0) < (0)) __PYX_ERR(48, 1130, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setHYPREType", 1, 1, 1, i); __PYX_ERR(48, 1130, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1130, __pyx_L3_error)
    }
    __pyx_v_hypretype = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setHYPREType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1130, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_96setHYPREType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_hypretype);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_96setHYPREType(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":1146
 * 
 *         """
 *         cdef PetscPCHYPREType cval = NULL             # <<<<<<<<<<<<<<
 *         hypretype = str2bytes(hypretype, &cval)
 *         CHKERR(PCHYPRESetType(self.pc, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/PC.pyx":1147
 *         """
 *         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, 1147, __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":1148
 *         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, 1148, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1130
 *         return bytes2str(cval)
 * 
 *     def setHYPREType(self, hypretype: str) -> None:             # <<<<<<<<<<<<<<
 *         """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":1150
 *         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_99setHYPREDiscreteCurl(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_98setHYPREDiscreteCurl, "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:1150");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_99setHYPREDiscreteCurl = {"setHYPREDiscreteCurl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_99setHYPREDiscreteCurl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_98setHYPREDiscreteCurl};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_99setHYPREDiscreteCurl(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1150, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setHYPREDiscreteCurl", 0) < (0)) __PYX_ERR(48, 1150, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setHYPREDiscreteCurl", 1, 1, 1, i); __PYX_ERR(48, 1150, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1150, __pyx_L3_error)
    }
    __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, 1150, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(48, 1150, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_98setHYPREDiscreteCurl(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_98setHYPREDiscreteCurl(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1165
 * 
 *         """
 *         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, 1165, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1150
 *         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":1167
 *         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_101setHYPREDiscreteGradient(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_100setHYPREDiscreteGradient, "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:1167");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_101setHYPREDiscreteGradient = {"setHYPREDiscreteGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_101setHYPREDiscreteGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_100setHYPREDiscreteGradient};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_101setHYPREDiscreteGradient(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1167, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setHYPREDiscreteGradient", 0) < (0)) __PYX_ERR(48, 1167, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setHYPREDiscreteGradient", 1, 1, 1, i); __PYX_ERR(48, 1167, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1167, __pyx_L3_error)
    }
    __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, 1167, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(48, 1167, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_100setHYPREDiscreteGradient(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_100setHYPREDiscreteGradient(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1182
 * 
 *         """
 *         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, 1182, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1167
 *         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":1184
 *         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_103setHYPRESetAlphaPoissonMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_102setHYPRESetAlphaPoissonMatrix, "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:1184");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_103setHYPRESetAlphaPoissonMatrix = {"setHYPRESetAlphaPoissonMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_103setHYPRESetAlphaPoissonMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_102setHYPRESetAlphaPoissonMatrix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_103setHYPRESetAlphaPoissonMatrix(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1184, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1184, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setHYPRESetAlphaPoissonMatrix", 0) < (0)) __PYX_ERR(48, 1184, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setHYPRESetAlphaPoissonMatrix", 1, 1, 1, i); __PYX_ERR(48, 1184, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1184, __pyx_L3_error)
    }
    __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, 1184, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(48, 1184, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_102setHYPRESetAlphaPoissonMatrix(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_102setHYPRESetAlphaPoissonMatrix(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1199
 * 
 *         """
 *         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, 1199, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1184
 *         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":1201
 *         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_105setHYPRESetBetaPoissonMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_104setHYPRESetBetaPoissonMatrix, "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:1201");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_105setHYPRESetBetaPoissonMatrix = {"setHYPRESetBetaPoissonMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_105setHYPRESetBetaPoissonMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_104setHYPRESetBetaPoissonMatrix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_105setHYPRESetBetaPoissonMatrix(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1201, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1201, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setHYPRESetBetaPoissonMatrix", 0) < (0)) __PYX_ERR(48, 1201, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1201, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 1201, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "mat", 0))) __PYX_ERR(48, 1201, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_104setHYPRESetBetaPoissonMatrix(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_104setHYPRESetBetaPoissonMatrix(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1216
 * 
 *         """
 *         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":1217
 *         """
 *         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":1218
 *         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, 1218, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1201
 *         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":1220
 *         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_107setHYPRESetInterpolations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_106setHYPRESetInterpolations, "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:1220");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_107setHYPRESetInterpolations = {"setHYPRESetInterpolations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_107setHYPRESetInterpolations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_106setHYPRESetInterpolations};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_107setHYPRESetInterpolations(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dim,&__pyx_mstate_global->__pyx_n_u_RT_Pi_Full,&__pyx_mstate_global->__pyx_n_u_RT_Pi,&__pyx_mstate_global->__pyx_n_u_ND_Pi_Full,&__pyx_mstate_global->__pyx_n_u_ND_Pi,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1220, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(48, 1220, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(48, 1220, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 1220, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1220, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1220, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setHYPRESetInterpolations", 0) < (0)) __PYX_ERR(48, 1220, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/PC.pyx":1221
 * 
 *     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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setHYPRESetInterpolations", 0, 1, 5, i); __PYX_ERR(48, 1220, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(48, 1220, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(48, 1220, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 1220, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1220, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1220, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/PC.pyx":1220
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/PC.pyx":1221
 * 
 *     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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1220, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "RT_Pi_Full", 0))) __PYX_ERR(48, 1220, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ND_Pi_Full), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "ND_Pi_Full", 0))) __PYX_ERR(48, 1221, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_106setHYPRESetInterpolations(((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":1220
 *         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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_106setHYPRESetInterpolations(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 *);
  PetscErrorCode __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setHYPRESetInterpolations", 0);

  /* "petsc4py/PETSc/PC.pyx":1246
 * 
 *         """
 *         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":1247
 *         """
 *         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":1248
 *         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":1249
 *         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":1250
 *         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, 1250, __pyx_L1_error)
  __pyx_v_idim = __pyx_t_3;

  /* "petsc4py/PETSc/PC.pyx":1251
 *         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(<size_t>dim*sizeof(PetscMat), &RT_Pi_mat)
*/
  __pyx_v_RT_Pi_mat = NULL;

  /* "petsc4py/PETSc/PC.pyx":1252
 *         cdef PetscInt idim = asInt(dim)
 *         cdef PetscMat *RT_Pi_mat = NULL
 *         if RT_Pi is not None:             # <<<<<<<<<<<<<<
 *             PetscMalloc(<size_t>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":1253
 *         cdef PetscMat *RT_Pi_mat = NULL
 *         if RT_Pi is not None:
 *             PetscMalloc(<size_t>dim*sizeof(PetscMat), &RT_Pi_mat)             # <<<<<<<<<<<<<<
 *             assert len(RT_Pi) == dim
 *             for i in range(dim):
*/
    __pyx_t_4 = __Pyx_PyLong_As_size_t(__pyx_v_dim); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(48, 1253, __pyx_L1_error)
    (void)(PetscMalloc((((size_t)__pyx_t_4) * (sizeof(Mat))), (&__pyx_v_RT_Pi_mat)));

    /* "petsc4py/PETSc/PC.pyx":1254
 *         if RT_Pi is not None:
 *             PetscMalloc(<size_t>dim*sizeof(PetscMat), &RT_Pi_mat)
 *             assert len(RT_Pi) == dim             # <<<<<<<<<<<<<<
 *             for i in range(dim):
 *                 RT_Pi_mat[i] = (<Mat?>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, 1254, __pyx_L1_error)
      __pyx_t_6 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 1254, __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, 1254, __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, 1254, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(48, 1254, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(48, 1254, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/PC.pyx":1255
 *             PetscMalloc(<size_t>dim*sizeof(PetscMat), &RT_Pi_mat)
 *             assert len(RT_Pi) == dim
 *             for i in range(dim):             # <<<<<<<<<<<<<<
 *                 RT_Pi_mat[i] = (<Mat?>RT_Pi[i]).mat
 *         cdef PetscMat *ND_Pi_mat = NULL
*/
    __pyx_t_6 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dim};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 1255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 1255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(48, 1255, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    for (;;) {
      {
        __pyx_t_7 = __pyx_t_8(__pyx_t_6);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(48, 1255, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "petsc4py/PETSc/PC.pyx":1256
 *             assert len(RT_Pi) == dim
 *             for i in range(dim):
 *                 RT_Pi_mat[i] = (<Mat?>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, 1256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (!(likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(48, 1256, __pyx_L1_error)
      __pyx_t_2 = ((struct PyPetscMatObject *)__pyx_t_7)->mat;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(48, 1256, __pyx_L1_error)
      (__pyx_v_RT_Pi_mat[__pyx_t_5]) = __pyx_t_2;

      /* "petsc4py/PETSc/PC.pyx":1255
 *             PetscMalloc(<size_t>dim*sizeof(PetscMat), &RT_Pi_mat)
 *             assert len(RT_Pi) == dim
 *             for i in range(dim):             # <<<<<<<<<<<<<<
 *                 RT_Pi_mat[i] = (<Mat?>RT_Pi[i]).mat
 *         cdef PetscMat *ND_Pi_mat = NULL
*/
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "petsc4py/PETSc/PC.pyx":1252
 *         cdef PetscInt idim = asInt(dim)
 *         cdef PetscMat *RT_Pi_mat = NULL
 *         if RT_Pi is not None:             # <<<<<<<<<<<<<<
 *             PetscMalloc(<size_t>dim*sizeof(PetscMat), &RT_Pi_mat)
 *             assert len(RT_Pi) == dim
*/
  }

  /* "petsc4py/PETSc/PC.pyx":1257
 *             for i in range(dim):
 *                 RT_Pi_mat[i] = (<Mat?>RT_Pi[i]).mat
 *         cdef PetscMat *ND_Pi_mat = NULL             # <<<<<<<<<<<<<<
 *         if ND_Pi is not None:
 *             PetscMalloc(<size_t>dim*sizeof(PetscMat), &ND_Pi_mat)
*/
  __pyx_v_ND_Pi_mat = NULL;

  /* "petsc4py/PETSc/PC.pyx":1258
 *                 RT_Pi_mat[i] = (<Mat?>RT_Pi[i]).mat
 *         cdef PetscMat *ND_Pi_mat = NULL
 *         if ND_Pi is not None:             # <<<<<<<<<<<<<<
 *             PetscMalloc(<size_t>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":1259
 *         cdef PetscMat *ND_Pi_mat = NULL
 *         if ND_Pi is not None:
 *             PetscMalloc(<size_t>dim*sizeof(PetscMat), &ND_Pi_mat)             # <<<<<<<<<<<<<<
 *             assert len(ND_Pi) == dim
 *             for i in range(dim):
*/
    __pyx_t_4 = __Pyx_PyLong_As_size_t(__pyx_v_dim); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(48, 1259, __pyx_L1_error)
    (void)(PetscMalloc((((size_t)__pyx_t_4) * (sizeof(Mat))), (&__pyx_v_ND_Pi_mat)));

    /* "petsc4py/PETSc/PC.pyx":1260
 *         if ND_Pi is not None:
 *             PetscMalloc(<size_t>dim*sizeof(PetscMat), &ND_Pi_mat)
 *             assert len(ND_Pi) == dim             # <<<<<<<<<<<<<<
 *             for i in range(dim):
 *                 ND_Pi_mat[dim] = (<Mat?>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, 1260, __pyx_L1_error)
      __pyx_t_6 = PyLong_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 1260, __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, 1260, __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, 1260, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(48, 1260, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(48, 1260, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/PC.pyx":1261
 *             PetscMalloc(<size_t>dim*sizeof(PetscMat), &ND_Pi_mat)
 *             assert len(ND_Pi) == dim
 *             for i in range(dim):             # <<<<<<<<<<<<<<
 *                 ND_Pi_mat[dim] = (<Mat?>ND_Pi[i]).mat
 *         CHKERR (PCHYPRESetInterpolations(self.pc, idim, RT_full_mat, RT_Pi_mat,
*/
    __pyx_t_6 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_dim};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(&PyRange_Type), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 1261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 1261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(48, 1261, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    for (;;) {
      {
        __pyx_t_7 = __pyx_t_8(__pyx_t_6);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(48, 1261, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "petsc4py/PETSc/PC.pyx":1262
 *             assert len(ND_Pi) == dim
 *             for i in range(dim):
 *                 ND_Pi_mat[dim] = (<Mat?>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, 1262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (!(likely(__Pyx_TypeTest(__pyx_t_7, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(48, 1262, __pyx_L1_error)
      __pyx_t_2 = ((struct PyPetscMatObject *)__pyx_t_7)->mat;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(48, 1262, __pyx_L1_error)
      (__pyx_v_ND_Pi_mat[__pyx_t_5]) = __pyx_t_2;

      /* "petsc4py/PETSc/PC.pyx":1261
 *             PetscMalloc(<size_t>dim*sizeof(PetscMat), &ND_Pi_mat)
 *             assert len(ND_Pi) == dim
 *             for i in range(dim):             # <<<<<<<<<<<<<<
 *                 ND_Pi_mat[dim] = (<Mat?>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":1258
 *                 RT_Pi_mat[i] = (<Mat?>RT_Pi[i]).mat
 *         cdef PetscMat *ND_Pi_mat = NULL
 *         if ND_Pi is not None:             # <<<<<<<<<<<<<<
 *             PetscMalloc(<size_t>dim*sizeof(PetscMat), &ND_Pi_mat)
 *             assert len(ND_Pi) == dim
*/
  }

  /* "petsc4py/PETSc/PC.pyx":1263
 *             for i in range(dim):
 *                 ND_Pi_mat[dim] = (<Mat?>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_9 = __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_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1263, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1265
 *         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_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_RT_Pi_mat)); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1265, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1266
 *                                          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_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ND_Pi_mat)); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1266, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1220
 *         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":1268
 *         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_109setHYPRESetEdgeConstantVectors(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_108setHYPRESetEdgeConstantVectors, "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:1268");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_109setHYPRESetEdgeConstantVectors = {"setHYPRESetEdgeConstantVectors", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_109setHYPRESetEdgeConstantVectors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_108setHYPRESetEdgeConstantVectors};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_109setHYPRESetEdgeConstantVectors(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ozz,&__pyx_mstate_global->__pyx_n_u_zoz,&__pyx_mstate_global->__pyx_n_u_zzo,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1268, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 1268, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1268, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1268, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setHYPRESetEdgeConstantVectors", 0) < (0)) __PYX_ERR(48, 1268, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setHYPRESetEdgeConstantVectors", 0, 2, 3, i); __PYX_ERR(48, 1268, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 1268, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1268, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1268, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 1268, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "ozz", 0))) __PYX_ERR(48, 1268, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_zoz), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "zoz", 0))) __PYX_ERR(48, 1268, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_zzo), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "zzo", 0))) __PYX_ERR(48, 1268, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_108setHYPRESetEdgeConstantVectors(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_108setHYPRESetEdgeConstantVectors(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1287
 * 
 *         """
 *         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":1288
 *         """
 *         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":1289
 *         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, 1289, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1268
 *         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":1292
 *                                              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_111setHYPREAMSSetInteriorNodes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_110setHYPREAMSSetInteriorNodes, "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:1292");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_111setHYPREAMSSetInteriorNodes = {"setHYPREAMSSetInteriorNodes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_111setHYPREAMSSetInteriorNodes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_110setHYPREAMSSetInteriorNodes};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_111setHYPREAMSSetInteriorNodes(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_interior,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1292, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1292, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setHYPREAMSSetInteriorNodes", 0) < (0)) __PYX_ERR(48, 1292, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setHYPREAMSSetInteriorNodes", 1, 1, 1, i); __PYX_ERR(48, 1292, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1292, __pyx_L3_error)
    }
    __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, 1292, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "interior", 0))) __PYX_ERR(48, 1292, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_110setHYPREAMSSetInteriorNodes(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_interior);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_110setHYPREAMSSetInteriorNodes(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1307
 * 
 *         """
 *         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, 1307, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1292
 *                                              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":1311
 *     # --- 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_113setFactorSolverType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_112setFactorSolverType, "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:1311");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_113setFactorSolverType = {"setFactorSolverType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_113setFactorSolverType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_112setFactorSolverType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_113setFactorSolverType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_solver,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1311, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1311, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFactorSolverType", 0) < (0)) __PYX_ERR(48, 1311, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFactorSolverType", 1, 1, 1, i); __PYX_ERR(48, 1311, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1311, __pyx_L3_error)
    }
    __pyx_v_solver = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setFactorSolverType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1311, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_112setFactorSolverType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_solver);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_112setFactorSolverType(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":1326
 * 
 *         """
 *         cdef PetscMatSolverType cval = NULL             # <<<<<<<<<<<<<<
 *         solver = str2bytes(solver, &cval)
 *         CHKERR(PCFactorSetMatSolverType(self.pc, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/PC.pyx":1327
 *         """
 *         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, 1327, __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":1328
 *         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, 1328, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1311
 *     # --- 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":1330
 *         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_115getFactorSolverType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_114getFactorSolverType, "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:1330");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_115getFactorSolverType = {"getFactorSolverType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_115getFactorSolverType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_114getFactorSolverType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_115getFactorSolverType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFactorSolverType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_114getFactorSolverType(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_114getFactorSolverType(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1340
 * 
 *         """
 *         cdef PetscMatSolverType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PCFactorGetMatSolverType(self.pc, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/PC.pyx":1341
 *         """
 *         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, 1341, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1342
 *         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, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PC.pyx":1330
 *         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":1344
 *         return bytes2str(cval)
 * 
 *     def setFactorSetUpSolverType(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the factorization solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_117setFactorSetUpSolverType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_116setFactorSetUpSolverType, "PC.setFactorSetUpSolverType(self) -> None\nSet up the factorization solver.\n\n        Collective.\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:1344");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_117setFactorSetUpSolverType = {"setFactorSetUpSolverType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_117setFactorSetUpSolverType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_116setFactorSetUpSolverType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_117setFactorSetUpSolverType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFactorSetUpSolverType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_116setFactorSetUpSolverType(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_116setFactorSetUpSolverType(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1358
 * 
 *         """
 *         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, 1358, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1344
 *         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":1360
 *         CHKERR(PCFactorSetUpMatSolverType(self.pc))
 * 
 *     def setFactorOrdering(             # <<<<<<<<<<<<<<
 *         self,
 *         ord_type: str | None = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_119setFactorOrdering(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_118setFactorOrdering, "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:1360");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_119setFactorOrdering = {"setFactorOrdering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_119setFactorOrdering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_118setFactorOrdering};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_119setFactorOrdering(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ord_type,&__pyx_mstate_global->__pyx_n_u_nzdiag,&__pyx_mstate_global->__pyx_n_u_reuse,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1360, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 1360, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1360, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1360, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFactorOrdering", 0) < (0)) __PYX_ERR(48, 1360, __pyx_L3_error)

      /* "petsc4py/PETSc/PC.pyx":1362
 *     def setFactorOrdering(
 *         self,
 *         ord_type: str | None = None,             # <<<<<<<<<<<<<<
 *         nzdiag: float | None = None,
 *         reuse: bool | None = None) -> None:
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/PC.pyx":1363
 *         self,
 *         ord_type: str | None = None,
 *         nzdiag: float | None = None,             # <<<<<<<<<<<<<<
 *         reuse: bool | None = None) -> None:
 *         """Set options for the matrix factorization reordering.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/PC.pyx":1364
 *         ord_type: str | None = None,
 *         nzdiag: float | None = None,
 *         reuse: bool | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set options for the matrix factorization reordering.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 1360, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1360, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1360, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/PC.pyx":1362
 *     def setFactorOrdering(
 *         self,
 *         ord_type: str | None = None,             # <<<<<<<<<<<<<<
 *         nzdiag: float | None = None,
 *         reuse: bool | None = None) -> None:
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/PC.pyx":1363
 *         self,
 *         ord_type: str | None = None,
 *         nzdiag: float | None = None,             # <<<<<<<<<<<<<<
 *         reuse: bool | None = None) -> None:
 *         """Set options for the matrix factorization reordering.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/PC.pyx":1364
 *         ord_type: str | None = None,
 *         nzdiag: float | None = None,
 *         reuse: bool | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set options for the matrix factorization reordering.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1360, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_118setFactorOrdering(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ord_type, __pyx_v_nzdiag, __pyx_v_reuse);

  /* "petsc4py/PETSc/PC.pyx":1360
 *         CHKERR(PCFactorSetUpMatSolverType(self.pc))
 * 
 *     def setFactorOrdering(             # <<<<<<<<<<<<<<
 *         self,
 *         ord_type: str | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_118setFactorOrdering(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":1384
 * 
 *         """
 *         cdef PetscMatOrderingType cval = NULL             # <<<<<<<<<<<<<<
 *         if ord_type is not None:
 *             ord_type = str2bytes(ord_type, &cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/PC.pyx":1385
 *         """
 *         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":1386
 *         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, 1386, __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":1387
 *         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, 1387, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":1385
 *         """
 *         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":1388
 *             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":1389
 *             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":1390
 *         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, 1390, __pyx_L1_error)
    __pyx_v_rval = __pyx_t_4;

    /* "petsc4py/PETSc/PC.pyx":1391
 *         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, 1391, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":1389
 *             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":1392
 *             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":1393
 *             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":1394
 *         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, 1394, __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":1395
 *         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, 1395, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":1393
 *             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":1360
 *         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":1397
 *             CHKERR(PCFactorSetReuseOrdering(self.pc, bval))
 * 
 *     def setFactorPivot(             # <<<<<<<<<<<<<<
 *         self,
 *         zeropivot: float | None = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_121setFactorPivot(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_120setFactorPivot, "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:1397");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_121setFactorPivot = {"setFactorPivot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_121setFactorPivot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_120setFactorPivot};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_121setFactorPivot(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_zeropivot,&__pyx_mstate_global->__pyx_n_u_inblocks,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1397, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1397, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1397, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFactorPivot", 0) < (0)) __PYX_ERR(48, 1397, __pyx_L3_error)

      /* "petsc4py/PETSc/PC.pyx":1399
 *     def setFactorPivot(
 *         self,
 *         zeropivot: float | None = None,             # <<<<<<<<<<<<<<
 *         inblocks: bool | None = None) -> None:
 *         """Set options for matrix factorization pivoting.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/PC.pyx":1400
 *         self,
 *         zeropivot: float | None = None,
 *         inblocks: bool | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set options for matrix factorization pivoting.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1397, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1397, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/PC.pyx":1399
 *     def setFactorPivot(
 *         self,
 *         zeropivot: float | None = None,             # <<<<<<<<<<<<<<
 *         inblocks: bool | None = None) -> None:
 *         """Set options for matrix factorization pivoting.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/PC.pyx":1400
 *         self,
 *         zeropivot: float | None = None,
 *         inblocks: bool | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set options for matrix factorization pivoting.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1397, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_120setFactorPivot(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_zeropivot, __pyx_v_inblocks);

  /* "petsc4py/PETSc/PC.pyx":1397
 *             CHKERR(PCFactorSetReuseOrdering(self.pc, bval))
 * 
 *     def setFactorPivot(             # <<<<<<<<<<<<<<
 *         self,
 *         zeropivot: float | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_120setFactorPivot(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1417
 * 
 *         """
 *         cdef PetscReal rval = 0             # <<<<<<<<<<<<<<
 *         if zeropivot is not None:
 *             rval = asReal(zeropivot)
*/
  __pyx_v_rval = 0.0;

  /* "petsc4py/PETSc/PC.pyx":1418
 *         """
 *         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":1419
 *         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, 1419, __pyx_L1_error)
    __pyx_v_rval = __pyx_t_2;

    /* "petsc4py/PETSc/PC.pyx":1420
 *         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, 1420, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":1418
 *         """
 *         cdef PetscReal rval = 0
 *         if zeropivot is not None:             # <<<<<<<<<<<<<<
 *             rval = asReal(zeropivot)
 *             CHKERR(PCFactorSetZeroPivot(self.pc, rval))
*/
  }

  /* "petsc4py/PETSc/PC.pyx":1421
 *             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":1422
 *             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":1423
 *         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, 1423, __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":1424
 *         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, 1424, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":1422
 *             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":1397
 *             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":1426
 *             CHKERR(PCFactorSetPivotInBlocks(self.pc, bval))
 * 
 *     def setFactorShift(             # <<<<<<<<<<<<<<
 *         self,
 *         shift_type: Mat.FactorShiftType | None = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_123setFactorShift(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_122setFactorShift, "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        Logically collective.\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:1426");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_123setFactorShift = {"setFactorShift", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_123setFactorShift, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_122setFactorShift};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_123setFactorShift(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_shift_type,&__pyx_mstate_global->__pyx_n_u_amount,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1426, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1426, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1426, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFactorShift", 0) < (0)) __PYX_ERR(48, 1426, __pyx_L3_error)

      /* "petsc4py/PETSc/PC.pyx":1428
 *     def setFactorShift(
 *         self,
 *         shift_type: Mat.FactorShiftType | None = None,             # <<<<<<<<<<<<<<
 *         amount: float | None = None) -> None:
 *         """Set options for shifting diagonal entries of a matrix.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/PC.pyx":1429
 *         self,
 *         shift_type: Mat.FactorShiftType | None = None,
 *         amount: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set options for shifting diagonal entries of a matrix.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1426, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1426, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/PC.pyx":1428
 *     def setFactorShift(
 *         self,
 *         shift_type: Mat.FactorShiftType | None = None,             # <<<<<<<<<<<<<<
 *         amount: float | None = None) -> None:
 *         """Set options for shifting diagonal entries of a matrix.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/PC.pyx":1429
 *         self,
 *         shift_type: Mat.FactorShiftType | None = None,
 *         amount: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set options for shifting diagonal entries of a matrix.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1426, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_122setFactorShift(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_shift_type, __pyx_v_amount);

  /* "petsc4py/PETSc/PC.pyx":1426
 *             CHKERR(PCFactorSetPivotInBlocks(self.pc, bval))
 * 
 *     def setFactorShift(             # <<<<<<<<<<<<<<
 *         self,
 *         shift_type: Mat.FactorShiftType | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_122setFactorShift(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1447
 * 
 *         """
 *         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":1448
 *         """
 *         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":1449
 *         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, 1449, __pyx_L1_error)
    __pyx_v_cval = __pyx_t_2;

    /* "petsc4py/PETSc/PC.pyx":1450
 *         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, 1450, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":1448
 *         """
 *         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":1451
 *             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":1452
 *             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":1453
 *         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, 1453, __pyx_L1_error)
    __pyx_v_rval = __pyx_t_4;

    /* "petsc4py/PETSc/PC.pyx":1454
 *         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, 1454, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":1452
 *             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":1426
 *             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":1456
 *             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_125setFactorLevels(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_124setFactorLevels, "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:1456");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_125setFactorLevels = {"setFactorLevels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_125setFactorLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_124setFactorLevels};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_125setFactorLevels(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_levels,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1456, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1456, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFactorLevels", 0) < (0)) __PYX_ERR(48, 1456, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFactorLevels", 1, 1, 1, i); __PYX_ERR(48, 1456, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1456, __pyx_L3_error)
    }
    __pyx_v_levels = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setFactorLevels", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1456, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_124setFactorLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_124setFactorLevels(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1471
 * 
 *         """
 *         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, 1471, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1472
 *         """
 *         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, 1472, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1456
 *             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":1474
 *         CHKERR(PCFactorSetLevels(self.pc, ival))
 * 
 *     def getFactorMatrix(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the factored matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_127getFactorMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_126getFactorMatrix, "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:1474");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_127getFactorMatrix = {"getFactorMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_127getFactorMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_126getFactorMatrix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_127getFactorMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFactorMatrix", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_126getFactorMatrix(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_126getFactorMatrix(struct PyPetscPCObject *__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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getFactorMatrix", 0);

  /* "petsc4py/PETSc/PC.pyx":1484
 * 
 *         """
 *         cdef Mat mat = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(PCFactorGetMatrix(self.pc, &mat.mat))
 *         CHKERR(PetscINCREF(mat.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 1484, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/PC.pyx":1485
 *         """
 *         cdef Mat mat = Mat()
 *         CHKERR(PCFactorGetMatrix(self.pc, &mat.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(mat.obj))
 *         return mat
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFactorGetMatrix(__pyx_v_self->pc, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1485, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1486
 *         cdef Mat mat = Mat()
 *         CHKERR(PCFactorGetMatrix(self.pc, &mat.mat))
 *         CHKERR(PetscINCREF(mat.obj))             # <<<<<<<<<<<<<<
 *         return mat
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1486, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1487
 *         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":1474
 *         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_XDECREF(__pyx_t_2);
  __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":1491
 *     # --- 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_129setFieldSplitType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_128setFieldSplitType, "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:1491");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_129setFieldSplitType = {"setFieldSplitType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_129setFieldSplitType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_128setFieldSplitType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_129setFieldSplitType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ctype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1491, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFieldSplitType", 0) < (0)) __PYX_ERR(48, 1491, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFieldSplitType", 1, 1, 1, i); __PYX_ERR(48, 1491, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1491, __pyx_L3_error)
    }
    __pyx_v_ctype = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setFieldSplitType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1491, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_128setFieldSplitType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ctype);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_128setFieldSplitType(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1506
 * 
 *         """
 *         cdef PetscPCCompositeType cval = ctype             # <<<<<<<<<<<<<<
 *         CHKERR(PCFieldSplitSetType(self.pc, cval))
 * 
*/
  __pyx_t_1 = ((PCCompositeType)__Pyx_PyLong_As_PCCompositeType(__pyx_v_ctype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1506, __pyx_L1_error)
  __pyx_v_cval = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1507
 *         """
 *         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, 1507, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1491
 *     # --- 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":1509
 *         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_131setFieldSplitIS(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_2PC_130setFieldSplitIS, "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:1509");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_131setFieldSplitIS = {"setFieldSplitIS", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_131setFieldSplitIS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_130setFieldSplitIS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_131setFieldSplitIS(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_SIZE
  __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);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFieldSplitIS", __pyx_kwds); return NULL;}
  __Pyx_INCREF(__pyx_args);
  __pyx_v_fields = __pyx_args;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_130setFieldSplitIS(((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_130setFieldSplitIS(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1528
 * 
 *         """
 *         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":1529
 *         """
 *         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":1530
 *         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":1531
 *         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_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(48, 1531, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
    #endif
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 1531, __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(48, 1531, __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_INCREF(__pyx_t_4);
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_5);
      } else {
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1531, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1531, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
      }
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1531, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1531, __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, 1531, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 1531, __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, 1531, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS))))) __PYX_ERR(48, 1531, __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":1532
 *         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, 1532, __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":1533
 *         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, 1533, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":1531
 *         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":1509
 *         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":1535
 *             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_133setFieldSplitFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_132setFieldSplitFields, "PC.setFieldSplitFields(self, bsize: int, *fields: tuple[str, Sequence[int]]) -> None\nSets the elements for the field split.\n\n        Collective.\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:1535");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_133setFieldSplitFields = {"setFieldSplitFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_133setFieldSplitFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_132setFieldSplitFields};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_133setFieldSplitFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bsize,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1535, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        default:
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      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 (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, used_pos_args, __pyx_kwds_len, "setFieldSplitFields", 0) < (0)) __PYX_ERR(48, 1535, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFieldSplitFields", 0, 1, 1, i); __PYX_ERR(48, 1535, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs < 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1535, __pyx_L3_error)
    }
    __pyx_v_bsize = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setFieldSplitFields", 0, 1, 1, __pyx_nargs); __PYX_ERR(48, 1535, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_132setFieldSplitFields(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bsize, __pyx_v_fields);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_fields);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_132setFieldSplitFields(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1553
 * 
 *         """
 *         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, 1553, __pyx_L1_error)
  __pyx_v_bs = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1554
 *         """
 *         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, 1554, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1555
 *         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":1556
 *         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":1557
 *         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":1558
 *         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":1559
 *         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_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(48, 1559, __pyx_L1_error)
      #endif
      if (__pyx_t_4 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4));
    #else
    __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4);
    #endif
    ++__pyx_t_4;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1559, __pyx_L1_error)
    __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 != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(48, 1559, __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_INCREF(__pyx_t_6);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_7);
      } else {
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 1559, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 1559, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
      }
      #else
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 1559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 1559, __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, 1559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 1559, __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, 1559, __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":1560
 *         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, 1560, __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":1561
 *         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, 1561, __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":1562
 *             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, 1562, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":1559
 *         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":1535
 *             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":1565
 *                                          nfields, ifields, ifields))
 * 
 *     def getFieldSplitSubKSP(self) -> list[KSP]:             # <<<<<<<<<<<<<<
 *         """Return the `KSP` for all splits.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_135getFieldSplitSubKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_134getFieldSplitSubKSP, "PC.getFieldSplitSubKSP(self) -> list[KSP]\nReturn the `KSP` for all splits.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PCFieldSplitGetSubKSP\n\n        \nSource code at petsc4py/PETSc/PC.pyx:1565");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_135getFieldSplitSubKSP = {"getFieldSplitSubKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_135getFieldSplitSubKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_134getFieldSplitSubKSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_135getFieldSplitSubKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFieldSplitSubKSP", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_134getFieldSplitSubKSP(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_134getFieldSplitSubKSP(struct PyPetscPCObject *__pyx_v_self) {
  PetscInt __pyx_v_n;
  KSP *__pyx_v_p;
  PyObject *__pyx_v_subksp = 0;
  long __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("getFieldSplitSubKSP", 0);

  /* "petsc4py/PETSc/PC.pyx":1575
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         cdef PetscKSP *p = NULL
 *         cdef object subksp = None
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/PC.pyx":1576
 *         """
 *         cdef PetscInt n = 0
 *         cdef PetscKSP *p = NULL             # <<<<<<<<<<<<<<
 *         cdef object subksp = None
 *         try:
*/
  __pyx_v_p = NULL;

  /* "petsc4py/PETSc/PC.pyx":1577
 *         cdef PetscInt 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":1578
 *         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 <n]
*/
  /*try:*/ {

    /* "petsc4py/PETSc/PC.pyx":1579
 *         cdef object subksp = None
 *         try:
 *             CHKERR(PCFieldSplitGetSubKSP(self.pc, &n, &p))             # <<<<<<<<<<<<<<
 *             subksp = [ref_KSP(p[i]) for i from 0 <= i <n]
 *         finally:
*/
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFieldSplitGetSubKSP(__pyx_v_self->pc, (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1579, __pyx_L4_error)

    /* "petsc4py/PETSc/PC.pyx":1580
 *         try:
 *             CHKERR(PCFieldSplitGetSubKSP(self.pc, &n, &p))
 *             subksp = [ref_KSP(p[i]) for i from 0 <= i <n]             # <<<<<<<<<<<<<<
 *         finally:
 *             CHKERR(PetscFree(p))
*/
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1580, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __pyx_v_n;
      for (__pyx_9genexpr10__pyx_v_i = 0; __pyx_9genexpr10__pyx_v_i < __pyx_t_3; __pyx_9genexpr10__pyx_v_i++) {
        __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP((__pyx_v_p[__pyx_9genexpr10__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1580, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(48, 1580, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
    } /* exit inner scope */
    __Pyx_DECREF_SET(__pyx_v_subksp, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "petsc4py/PETSc/PC.pyx":1582
 *             subksp = [ref_KSP(p[i]) for i from 0 <= i <n]
 *         finally:
 *             CHKERR(PetscFree(p))             # <<<<<<<<<<<<<<
 *         return subksp
 * 
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_p)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1582, __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_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if ( 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, 1582, __pyx_L9_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);
      __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:;
      __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":1583
 *         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":1565
 *                                          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":1585
 *         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_137getFieldSplitSchurGetSubKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_136getFieldSplitSchurGetSubKSP, "PC.getFieldSplitSchurGetSubKSP(self) -> list[KSP]\nReturn the `KSP` for the Schur complement based splits.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PCFieldSplitSchurGetSubKSP, petsc.PCFieldSplitGetSubKSP\n\n        \nSource code at petsc4py/PETSc/PC.pyx:1585");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_137getFieldSplitSchurGetSubKSP = {"getFieldSplitSchurGetSubKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_137getFieldSplitSchurGetSubKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_136getFieldSplitSchurGetSubKSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_137getFieldSplitSchurGetSubKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFieldSplitSchurGetSubKSP", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_136getFieldSplitSchurGetSubKSP(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_136getFieldSplitSchurGetSubKSP(struct PyPetscPCObject *__pyx_v_self) {
  PetscInt __pyx_v_n;
  KSP *__pyx_v_p;
  PyObject *__pyx_v_subksp = 0;
  long __pyx_9genexpr11__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", 0);

  /* "petsc4py/PETSc/PC.pyx":1595
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         cdef PetscKSP *p = NULL
 *         cdef object subksp = None
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/PC.pyx":1596
 *         """
 *         cdef PetscInt n = 0
 *         cdef PetscKSP *p = NULL             # <<<<<<<<<<<<<<
 *         cdef object subksp = None
 *         try:
*/
  __pyx_v_p = NULL;

  /* "petsc4py/PETSc/PC.pyx":1597
 *         cdef PetscInt 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":1598
 *         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 <n]
*/
  /*try:*/ {

    /* "petsc4py/PETSc/PC.pyx":1599
 *         cdef object subksp = None
 *         try:
 *             CHKERR(PCFieldSplitSchurGetSubKSP(self.pc, &n, &p))             # <<<<<<<<<<<<<<
 *             subksp = [ref_KSP(p[i]) for i from 0 <= i <n]
 *         finally:
*/
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFieldSplitSchurGetSubKSP(__pyx_v_self->pc, (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1599, __pyx_L4_error)

    /* "petsc4py/PETSc/PC.pyx":1600
 *         try:
 *             CHKERR(PCFieldSplitSchurGetSubKSP(self.pc, &n, &p))
 *             subksp = [ref_KSP(p[i]) for i from 0 <= i <n]             # <<<<<<<<<<<<<<
 *         finally:
 *             CHKERR(PetscFree(p))
*/
    { /* enter inner scope */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1600, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __pyx_v_n;
      for (__pyx_9genexpr11__pyx_v_i = 0; __pyx_9genexpr11__pyx_v_i < __pyx_t_3; __pyx_9genexpr11__pyx_v_i++) {
        __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP((__pyx_v_p[__pyx_9genexpr11__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1600, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(48, 1600, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
    } /* exit inner scope */
    __Pyx_DECREF_SET(__pyx_v_subksp, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "petsc4py/PETSc/PC.pyx":1602
 *             subksp = [ref_KSP(p[i]) for i from 0 <= i <n]
 *         finally:
 *             CHKERR(PetscFree(p))             # <<<<<<<<<<<<<<
 *         return subksp
 * 
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_p)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1602, __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_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if ( 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, 1602, __pyx_L9_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);
      __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:;
      __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":1603
 *         finally:
 *             CHKERR(PetscFree(p))
 *         return subksp             # <<<<<<<<<<<<<<
 * 
 *     def getFieldSplitSubIS(self, splitname: str) -> IS:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_subksp);
  __pyx_r = __pyx_v_subksp;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PC.pyx":1585
 *         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":1605
 *         return subksp
 * 
 *     def getFieldSplitSubIS(self, splitname: str) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the `IS` associated with a given name.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_139getFieldSplitSubIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_138getFieldSplitSubIS, "PC.getFieldSplitSubIS(self, splitname: str) -> IS\nReturn the `IS` associated with a given name.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PCFieldSplitGetIS\n\n        \nSource code at petsc4py/PETSc/PC.pyx:1605");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_139getFieldSplitSubIS = {"getFieldSplitSubIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_139getFieldSplitSubIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_138getFieldSplitSubIS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_139getFieldSplitSubIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_splitname = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getFieldSplitSubIS (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_splitname,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1605, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1605, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFieldSplitSubIS", 0) < (0)) __PYX_ERR(48, 1605, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFieldSplitSubIS", 1, 1, 1, i); __PYX_ERR(48, 1605, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1605, __pyx_L3_error)
    }
    __pyx_v_splitname = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getFieldSplitSubIS", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1605, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.PC.getFieldSplitSubIS", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_138getFieldSplitSubIS(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_splitname);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_138getFieldSplitSubIS(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_splitname) {
  IS __pyx_v_field;
  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("getFieldSplitSubIS", 0);
  __Pyx_INCREF(__pyx_v_splitname);

  /* "petsc4py/PETSc/PC.pyx":1615
 * 
 *         """
 *         cdef PetscIS field = NULL             # <<<<<<<<<<<<<<
 *         cdef const char *cname = NULL
 *         splitname = str2bytes(splitname, &cname)
*/
  __pyx_v_field = NULL;

  /* "petsc4py/PETSc/PC.pyx":1616
 *         """
 *         cdef PetscIS field = NULL
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         splitname = str2bytes(splitname, &cname)
 *         CHKERR(PCFieldSplitGetIS(self.pc, cname, &field))
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/PC.pyx":1617
 *         cdef PetscIS field = NULL
 *         cdef const char *cname = NULL
 *         splitname = str2bytes(splitname, &cname)             # <<<<<<<<<<<<<<
 *         CHKERR(PCFieldSplitGetIS(self.pc, cname, &field))
 *         return ref_IS(field)
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_splitname, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_splitname, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/PC.pyx":1618
 *         cdef const char *cname = NULL
 *         splitname = str2bytes(splitname, &cname)
 *         CHKERR(PCFieldSplitGetIS(self.pc, cname, &field))             # <<<<<<<<<<<<<<
 *         return ref_IS(field)
 * 
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCFieldSplitGetIS(__pyx_v_self->pc, __pyx_v_cname, (&__pyx_v_field))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1618, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1619
 *         splitname = str2bytes(splitname, &cname)
 *         CHKERR(PCFieldSplitGetIS(self.pc, cname, &field))
 *         return ref_IS(field)             # <<<<<<<<<<<<<<
 * 
 *     def setFieldSplitSchurFactType(self, ctype: FieldSplitSchurFactType) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS(__pyx_v_field)); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PC.pyx":1605
 *         return subksp
 * 
 *     def getFieldSplitSubIS(self, splitname: str) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the `IS` associated with a given name.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("petsc4py.PETSc.PC.getFieldSplitSubIS", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_splitname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/PC.pyx":1621
 *         return ref_IS(field)
 * 
 *     def setFieldSplitSchurFactType(self, ctype: FieldSplitSchurFactType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of approximate block factorization.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_141setFieldSplitSchurFactType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_140setFieldSplitSchurFactType, "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:1621");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_141setFieldSplitSchurFactType = {"setFieldSplitSchurFactType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_141setFieldSplitSchurFactType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_140setFieldSplitSchurFactType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_141setFieldSplitSchurFactType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ctype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1621, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1621, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFieldSplitSchurFactType", 0) < (0)) __PYX_ERR(48, 1621, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFieldSplitSchurFactType", 1, 1, 1, i); __PYX_ERR(48, 1621, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1621, __pyx_L3_error)
    }
    __pyx_v_ctype = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setFieldSplitSchurFactType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1621, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_140setFieldSplitSchurFactType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ctype);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_140setFieldSplitSchurFactType(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1636
 * 
 *         """
 *         cdef PetscPCFieldSplitSchurFactType cval = ctype             # <<<<<<<<<<<<<<
 *         CHKERR(PCFieldSplitSetSchurFactType(self.pc, cval))
 * 
*/
  __pyx_t_1 = ((PCFieldSplitSchurFactType)__Pyx_PyLong_As_PCFieldSplitSchurFactType(__pyx_v_ctype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1636, __pyx_L1_error)
  __pyx_v_cval = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1637
 *         """
 *         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, 1637, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1621
 *         return ref_IS(field)
 * 
 *     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":1639
 *         CHKERR(PCFieldSplitSetSchurFactType(self.pc, cval))
 * 
 *     def setFieldSplitSchurPreType(             # <<<<<<<<<<<<<<
 *         self,
 *         ptype: FieldSplitSchurPreType,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_143setFieldSplitSchurPreType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_142setFieldSplitSchurPreType, "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:1639");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_143setFieldSplitSchurPreType = {"setFieldSplitSchurPreType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_143setFieldSplitSchurPreType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_142setFieldSplitSchurPreType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_143setFieldSplitSchurPreType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ptype,&__pyx_mstate_global->__pyx_n_u_pre,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1639, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1639, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1639, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFieldSplitSchurPreType", 0) < (0)) __PYX_ERR(48, 1639, __pyx_L3_error)

      /* "petsc4py/PETSc/PC.pyx":1642
 *         self,
 *         ptype: FieldSplitSchurPreType,
 *         Mat pre=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set from what operator the `PC` is constructed.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFieldSplitSchurPreType", 0, 1, 2, i); __PYX_ERR(48, 1639, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1639, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1639, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 1639, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "pre", 0))) __PYX_ERR(48, 1642, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_142setFieldSplitSchurPreType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ptype, __pyx_v_pre);

  /* "petsc4py/PETSc/PC.pyx":1639
 *         CHKERR(PCFieldSplitSetSchurFactType(self.pc, cval))
 * 
 *     def setFieldSplitSchurPreType(             # <<<<<<<<<<<<<<
 *         self,
 *         ptype: FieldSplitSchurPreType,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_142setFieldSplitSchurPreType(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1659
 * 
 *         """
 *         cdef PetscPCFieldSplitSchurPreType pval = ptype             # <<<<<<<<<<<<<<
 *         cdef PetscMat pmat = NULL
 *         if pre is not None: pmat = pre.mat
*/
  __pyx_t_1 = ((PCFieldSplitSchurPreType)__Pyx_PyLong_As_PCFieldSplitSchurPreType(__pyx_v_ptype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1659, __pyx_L1_error)
  __pyx_v_pval = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1660
 *         """
 *         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":1661
 *         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":1662
 *         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, 1662, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1639
 *         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":1666
 *     # --- COMPOSITE ---
 * 
 *     def setCompositeType(self, ctype: CompositeType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of composite preconditioner.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_145setCompositeType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_144setCompositeType, "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:1666");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_145setCompositeType = {"setCompositeType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_145setCompositeType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_144setCompositeType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_145setCompositeType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ctype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1666, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1666, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCompositeType", 0) < (0)) __PYX_ERR(48, 1666, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCompositeType", 1, 1, 1, i); __PYX_ERR(48, 1666, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1666, __pyx_L3_error)
    }
    __pyx_v_ctype = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setCompositeType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1666, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_144setCompositeType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_ctype);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_144setCompositeType(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1681
 * 
 *         """
 *         cdef PetscPCCompositeType cval = ctype             # <<<<<<<<<<<<<<
 *         CHKERR(PCCompositeSetType(self.pc, cval))
 * 
*/
  __pyx_t_1 = ((PCCompositeType)__Pyx_PyLong_As_PCCompositeType(__pyx_v_ctype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1681, __pyx_L1_error)
  __pyx_v_cval = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1682
 *         """
 *         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, 1682, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1666
 *     # --- 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":1684
 *         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_147getCompositePC(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_146getCompositePC, "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:1684");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_147getCompositePC = {"getCompositePC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_147getCompositePC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_146getCompositePC};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_147getCompositePC(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1684, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1684, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getCompositePC", 0) < (0)) __PYX_ERR(48, 1684, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getCompositePC", 1, 1, 1, i); __PYX_ERR(48, 1684, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1684, __pyx_L3_error)
    }
    __pyx_v_n = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getCompositePC", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1684, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_146getCompositePC(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_n);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_146getCompositePC(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __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("getCompositePC", 0);

  /* "petsc4py/PETSc/PC.pyx":1699
 * 
 *         """
 *         cdef PC pc = PC()             # <<<<<<<<<<<<<<
 *         cdef cn = asInt(n)
 *         CHKERR(PCCompositeGetPC(self.pc, cn, &pc.pc))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 1699, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_pc = ((struct PyPetscPCObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/PC.pyx":1700
 *         """
 *         cdef PC pc = PC()
 *         cdef cn = asInt(n)             # <<<<<<<<<<<<<<
 *         CHKERR(PCCompositeGetPC(self.pc, cn, &pc.pc))
 *         CHKERR(PetscINCREF(pc.obj))
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_n); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 1700, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyLong_From_PetscInt(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 1700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/PC.pyx":1701
 *         cdef PC pc = PC()
 *         cdef cn = asInt(n)
 *         CHKERR(PCCompositeGetPC(self.pc, cn, &pc.pc))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(pc.obj))
 *         return pc
*/
  __pyx_t_4 = __Pyx_PyLong_As_PetscInt(__pyx_v_cn); if (unlikely((__pyx_t_4 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(48, 1701, __pyx_L1_error)
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCCompositeGetPC(__pyx_v_self->pc, __pyx_t_4, (&__pyx_v_pc->pc))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1701, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1702
 *         cdef cn = asInt(n)
 *         CHKERR(PCCompositeGetPC(self.pc, cn, &pc.pc))
 *         CHKERR(PetscINCREF(pc.obj))             # <<<<<<<<<<<<<<
 *         return pc
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_pc->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1702, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1703
 *         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":1684
 *         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_XDECREF(__pyx_t_2);
  __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":1705
 *         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_149addCompositePCType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_148addCompositePCType, "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:1705");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_149addCompositePCType = {"addCompositePCType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_149addCompositePCType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_148addCompositePCType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_149addCompositePCType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pc_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1705, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1705, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addCompositePCType", 0) < (0)) __PYX_ERR(48, 1705, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addCompositePCType", 1, 1, 1, i); __PYX_ERR(48, 1705, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1705, __pyx_L3_error)
    }
    __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, 1705, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_148addCompositePCType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_pc_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_148addCompositePCType(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":1720
 * 
 *         """
 *         cdef PetscPCType cval = NULL             # <<<<<<<<<<<<<<
 *         pc_type = str2bytes(pc_type, &cval)
 *         CHKERR(PCCompositeAddPCType(self.pc, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/PC.pyx":1721
 *         """
 *         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, 1721, __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":1722
 *         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, 1722, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1705
 *         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":1726
 *     # --- KSP ---
 * 
 *     def getKSP(self) -> KSP:             # <<<<<<<<<<<<<<
 *         """Return the `KSP` if the `PC` is `Type.KSP`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_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_2PC_150getKSP, "PC.getKSP(self) -> KSP\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:1726");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_151getKSP = {"getKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_151getKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_150getKSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getKSP", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_150getKSP(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_150getKSP(struct PyPetscPCObject *__pyx_v_self) {
  struct PyPetscKSPObject *__pyx_v_ksp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getKSP", 0);

  /* "petsc4py/PETSc/PC.pyx":1736
 * 
 *         """
 *         cdef KSP ksp = KSP()             # <<<<<<<<<<<<<<
 *         CHKERR(PCKSPGetKSP(self.pc, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 1736, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__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(PCKSPGetKSP(self.pc, &ksp.ksp))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(ksp.obj))
 *         return ksp
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCKSPGetKSP(__pyx_v_self->pc, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1737, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1738
 *         cdef KSP ksp = KSP()
 *         CHKERR(PCKSPGetKSP(self.pc, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))             # <<<<<<<<<<<<<<
 *         return ksp
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1738, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1739
 *         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":1726
 *     # --- KSP ---
 * 
 *     def getKSP(self) -> KSP:             # <<<<<<<<<<<<<<
 *         """Return the `KSP` if the `PC` is `Type.KSP`.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":1743
 *     # --- MG ---
 * 
 *     def getMGType(self) -> MGType:             # <<<<<<<<<<<<<<
 *         """Return the form of multigrid.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_153getMGType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_152getMGType, "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:1743");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_153getMGType = {"getMGType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_153getMGType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_152getMGType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_153getMGType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMGType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_152getMGType(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_152getMGType(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1753
 * 
 *         """
 *         cdef PetscPCMGType cval = PC_MG_ADDITIVE             # <<<<<<<<<<<<<<
 *         CHKERR(PCMGGetType(self.pc, &cval))
 *         return cval
*/
  __pyx_v_cval = PC_MG_ADDITIVE;

  /* "petsc4py/PETSc/PC.pyx":1754
 *         """
 *         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, 1754, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1755
 *         cdef PetscPCMGType cval = PC_MG_ADDITIVE
 *         CHKERR(PCMGGetType(self.pc, &cval))
 *         return cval             # <<<<<<<<<<<<<<
 * 
 *     def setMGType(self, mgtype: MGType) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_PCMGType(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PC.pyx":1743
 *     # --- 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":1757
 *         return cval
 * 
 *     def setMGType(self, mgtype: MGType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the form of multigrid.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_155setMGType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_154setMGType, "PC.setMGType(self, mgtype: MGType) -> None\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:1757");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_155setMGType = {"setMGType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_155setMGType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_154setMGType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_155setMGType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mgtype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1757, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1757, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMGType", 0) < (0)) __PYX_ERR(48, 1757, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMGType", 1, 1, 1, i); __PYX_ERR(48, 1757, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1757, __pyx_L3_error)
    }
    __pyx_v_mgtype = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setMGType", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1757, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_154setMGType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mgtype);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_154setMGType(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1767
 * 
 *         """
 *         cdef PetscPCMGType cval = mgtype             # <<<<<<<<<<<<<<
 *         CHKERR(PCMGSetType(self.pc, cval))
 * 
*/
  __pyx_t_1 = ((PCMGType)__Pyx_PyLong_As_PCMGType(__pyx_v_mgtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 1767, __pyx_L1_error)
  __pyx_v_cval = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1768
 *         """
 *         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, 1768, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1757
 *         return cval
 * 
 *     def setMGType(self, mgtype: MGType) -> None:             # <<<<<<<<<<<<<<
 *         """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":1770
 *         CHKERR(PCMGSetType(self.pc, cval))
 * 
 *     def getMGLevels(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of `MG` levels.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_157getMGLevels(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_156getMGLevels, "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:1770");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_157getMGLevels = {"getMGLevels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_157getMGLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_156getMGLevels};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_157getMGLevels(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMGLevels", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_156getMGLevels(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_156getMGLevels(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1780
 * 
 *         """
 *         cdef PetscInt levels = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PCMGGetLevels(self.pc, &levels))
 *         return toInt(levels)
*/
  __pyx_v_levels = 0;

  /* "petsc4py/PETSc/PC.pyx":1781
 *         """
 *         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, 1781, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1782
 *         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, 1782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PC.pyx":1770
 *         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":1784
 *         return toInt(levels)
 * 
 *     def setMGLevels(self, levels: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of `MG` levels.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_159setMGLevels(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_158setMGLevels, "PC.setMGLevels(self, levels: int) -> None\nSet the number of `MG` levels.\n\n        Logically collective.\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:1784");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_159setMGLevels = {"setMGLevels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_159setMGLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_158setMGLevels};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_159setMGLevels(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_levels,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1784, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1784, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMGLevels", 0) < (0)) __PYX_ERR(48, 1784, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMGLevels", 1, 1, 1, i); __PYX_ERR(48, 1784, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1784, __pyx_L3_error)
    }
    __pyx_v_levels = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setMGLevels", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1784, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_158setMGLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_158setMGLevels(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1799
 * 
 *         """
 *         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, 1799, __pyx_L1_error)
  __pyx_v_clevels = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1800
 *         """
 *         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, 1800, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1784
 *         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":1802
 *         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_161getMGCoarseSolve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_160getMGCoarseSolve, "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:1802");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_161getMGCoarseSolve = {"getMGCoarseSolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_161getMGCoarseSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_160getMGCoarseSolve};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_161getMGCoarseSolve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMGCoarseSolve", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_160getMGCoarseSolve(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_160getMGCoarseSolve(struct PyPetscPCObject *__pyx_v_self) {
  struct PyPetscKSPObject *__pyx_v_ksp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getMGCoarseSolve", 0);

  /* "petsc4py/PETSc/PC.pyx":1812
 * 
 *         """
 *         cdef KSP ksp = KSP()             # <<<<<<<<<<<<<<
 *         CHKERR(PCMGGetCoarseSolve(self.pc, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 1812, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/PC.pyx":1813
 *         """
 *         cdef KSP ksp = KSP()
 *         CHKERR(PCMGGetCoarseSolve(self.pc, &ksp.ksp))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(ksp.obj))
 *         return ksp
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetCoarseSolve(__pyx_v_self->pc, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1813, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1814
 *         cdef KSP ksp = KSP()
 *         CHKERR(PCMGGetCoarseSolve(self.pc, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))             # <<<<<<<<<<<<<<
 *         return ksp
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1814, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1815
 *         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":1802
 *         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_XDECREF(__pyx_t_2);
  __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":1817
 *         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_163setMGInterpolation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_162setMGInterpolation, "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:1817");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_163setMGInterpolation = {"setMGInterpolation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_163setMGInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_162setMGInterpolation};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_163setMGInterpolation(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1817, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1817, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1817, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMGInterpolation", 0) < (0)) __PYX_ERR(48, 1817, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMGInterpolation", 1, 2, 2, i); __PYX_ERR(48, 1817, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1817, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1817, __pyx_L3_error)
    }
    __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, 1817, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(48, 1817, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_162setMGInterpolation(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_162setMGInterpolation(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1834
 * 
 *         """
 *         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, 1834, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1835
 *         """
 *         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, 1835, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1817
 *         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":1837
 *         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_165getMGInterpolation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_164getMGInterpolation, "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:1837");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_165getMGInterpolation = {"getMGInterpolation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_165getMGInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_164getMGInterpolation};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_165getMGInterpolation(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1837, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1837, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getMGInterpolation", 0) < (0)) __PYX_ERR(48, 1837, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getMGInterpolation", 1, 1, 1, i); __PYX_ERR(48, 1837, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1837, __pyx_L3_error)
    }
    __pyx_v_level = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getMGInterpolation", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1837, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_164getMGInterpolation(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_164getMGInterpolation(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getMGInterpolation", 0);

  /* "petsc4py/PETSc/PC.pyx":1852
 * 
 *         """
 *         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, 1852, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1853
 *         """
 *         cdef PetscInt clevel = asInt(level)
 *         cdef Mat interpolation = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(PCMGGetInterpolation(self.pc, clevel, &interpolation.mat))
 *         CHKERR(PetscINCREF(interpolation.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1853, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_interpolation = ((struct PyPetscMatObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":1854
 *         cdef PetscInt clevel = asInt(level)
 *         cdef Mat interpolation = Mat()
 *         CHKERR(PCMGGetInterpolation(self.pc, clevel, &interpolation.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(interpolation.obj))
 *         return interpolation
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetInterpolation(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_interpolation->mat))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1854, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1855
 *         cdef Mat interpolation = Mat()
 *         CHKERR(PCMGGetInterpolation(self.pc, clevel, &interpolation.mat))
 *         CHKERR(PetscINCREF(interpolation.obj))             # <<<<<<<<<<<<<<
 *         return interpolation
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_interpolation->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1855, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1856
 *         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":1837
 *         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_XDECREF(__pyx_t_3);
  __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":1858
 *         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_167setMGRestriction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_166setMGRestriction, "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:1858");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_167setMGRestriction = {"setMGRestriction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_167setMGRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_166setMGRestriction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_167setMGRestriction(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1858, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1858, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1858, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMGRestriction", 0) < (0)) __PYX_ERR(48, 1858, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMGRestriction", 1, 2, 2, i); __PYX_ERR(48, 1858, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1858, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1858, __pyx_L3_error)
    }
    __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, 1858, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(48, 1858, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_166setMGRestriction(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_166setMGRestriction(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1875
 * 
 *         """
 *         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, 1875, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1876
 *         """
 *         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, 1876, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1858
 *         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":1878
 *         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_169getMGRestriction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_168getMGRestriction, "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:1878");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_169getMGRestriction = {"getMGRestriction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_169getMGRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_168getMGRestriction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_169getMGRestriction(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1878, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getMGRestriction", 0) < (0)) __PYX_ERR(48, 1878, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getMGRestriction", 1, 1, 1, i); __PYX_ERR(48, 1878, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1878, __pyx_L3_error)
    }
    __pyx_v_level = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getMGRestriction", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1878, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_168getMGRestriction(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_168getMGRestriction(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getMGRestriction", 0);

  /* "petsc4py/PETSc/PC.pyx":1893
 * 
 *         """
 *         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, 1893, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1894
 *         """
 *         cdef PetscInt clevel = asInt(level)
 *         cdef Mat restriction = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(PCMGGetRestriction(self.pc, clevel, &restriction.mat))
 *         CHKERR(PetscINCREF(restriction.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1894, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_restriction = ((struct PyPetscMatObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":1895
 *         cdef PetscInt clevel = asInt(level)
 *         cdef Mat restriction = Mat()
 *         CHKERR(PCMGGetRestriction(self.pc, clevel, &restriction.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(restriction.obj))
 *         return restriction
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetRestriction(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_restriction->mat))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1895, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1896
 *         cdef Mat restriction = Mat()
 *         CHKERR(PCMGGetRestriction(self.pc, clevel, &restriction.mat))
 *         CHKERR(PetscINCREF(restriction.obj))             # <<<<<<<<<<<<<<
 *         return restriction
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_restriction->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1896, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1897
 *         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":1878
 *         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_XDECREF(__pyx_t_3);
  __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":1899
 *         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_171setMGRScale(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_170setMGRScale, "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:1899");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_171setMGRScale = {"setMGRScale", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_171setMGRScale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_170setMGRScale};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_171setMGRScale(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,&__pyx_mstate_global->__pyx_n_u_rscale,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1899, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1899, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1899, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMGRScale", 0) < (0)) __PYX_ERR(48, 1899, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMGRScale", 1, 2, 2, i); __PYX_ERR(48, 1899, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1899, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 1899, __pyx_L3_error)
    }
    __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, 1899, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "rscale", 0))) __PYX_ERR(48, 1899, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_170setMGRScale(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_rscale);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_170setMGRScale(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", 0);

  /* "petsc4py/PETSc/PC.pyx":1916
 * 
 *         """
 *         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, 1916, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1917
 *         """
 *         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, 1917, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1899
 *         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":1919
 *         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_173getMGRScale(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_172getMGRScale, "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:1919");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_173getMGRScale = {"getMGRScale", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_173getMGRScale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_172getMGRScale};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_173getMGRScale(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1919, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1919, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getMGRScale", 0) < (0)) __PYX_ERR(48, 1919, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getMGRScale", 1, 1, 1, i); __PYX_ERR(48, 1919, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1919, __pyx_L3_error)
    }
    __pyx_v_level = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getMGRScale", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1919, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_172getMGRScale(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_172getMGRScale(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getMGRScale", 0);

  /* "petsc4py/PETSc/PC.pyx":1934
 * 
 *         """
 *         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, 1934, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1935
 *         """
 *         cdef PetscInt clevel = asInt(level)
 *         cdef Vec rscale = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(PCMGGetRScale(self.pc, clevel, &rscale.vec))
 *         CHKERR(PetscINCREF(rscale.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1935, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_rscale = ((struct PyPetscVecObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":1936
 *         cdef PetscInt clevel = asInt(level)
 *         cdef Vec rscale = Vec()
 *         CHKERR(PCMGGetRScale(self.pc, clevel, &rscale.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(rscale.obj))
 *         return rscale
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetRScale(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_rscale->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1936, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1937
 *         cdef Vec rscale = Vec()
 *         CHKERR(PCMGGetRScale(self.pc, clevel, &rscale.vec))
 *         CHKERR(PetscINCREF(rscale.obj))             # <<<<<<<<<<<<<<
 *         return rscale
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_rscale->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1937, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1938
 *         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":1919
 *         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_XDECREF(__pyx_t_3);
  __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":1940
 *         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_175getMGSmoother(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_174getMGSmoother, "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:1940");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_175getMGSmoother = {"getMGSmoother", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_175getMGSmoother, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_174getMGSmoother};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_175getMGSmoother(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1940, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getMGSmoother", 0) < (0)) __PYX_ERR(48, 1940, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getMGSmoother", 1, 1, 1, i); __PYX_ERR(48, 1940, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1940, __pyx_L3_error)
    }
    __pyx_v_level = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getMGSmoother", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1940, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_174getMGSmoother(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_174getMGSmoother(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getMGSmoother", 0);

  /* "petsc4py/PETSc/PC.pyx":1955
 * 
 *         """
 *         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, 1955, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1956
 *         """
 *         cdef PetscInt clevel = asInt(level)
 *         cdef KSP ksp = KSP()             # <<<<<<<<<<<<<<
 *         CHKERR(PCMGGetSmoother(self.pc, clevel, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1956, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":1957
 *         cdef PetscInt clevel = asInt(level)
 *         cdef KSP ksp = KSP()
 *         CHKERR(PCMGGetSmoother(self.pc, clevel, &ksp.ksp))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(ksp.obj))
 *         return ksp
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetSmoother(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1957, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1958
 *         cdef KSP ksp = KSP()
 *         CHKERR(PCMGGetSmoother(self.pc, clevel, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))             # <<<<<<<<<<<<<<
 *         return ksp
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1958, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1959
 *         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":1940
 *         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_XDECREF(__pyx_t_3);
  __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":1961
 *         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_177getMGSmootherDown(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_176getMGSmootherDown, "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:1961");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_177getMGSmootherDown = {"getMGSmootherDown", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_177getMGSmootherDown, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_176getMGSmootherDown};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_177getMGSmootherDown(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1961, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1961, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getMGSmootherDown", 0) < (0)) __PYX_ERR(48, 1961, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getMGSmootherDown", 1, 1, 1, i); __PYX_ERR(48, 1961, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1961, __pyx_L3_error)
    }
    __pyx_v_level = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getMGSmootherDown", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1961, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_176getMGSmootherDown(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_176getMGSmootherDown(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getMGSmootherDown", 0);

  /* "petsc4py/PETSc/PC.pyx":1976
 * 
 *         """
 *         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, 1976, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1977
 *         """
 *         cdef PetscInt clevel = asInt(level)
 *         cdef KSP ksp = KSP()             # <<<<<<<<<<<<<<
 *         CHKERR(PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1977, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":1978
 *         cdef PetscInt clevel = asInt(level)
 *         cdef KSP ksp = KSP()
 *         CHKERR(PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(ksp.obj))
 *         return ksp
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetSmootherDown(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1978, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1979
 *         cdef KSP ksp = KSP()
 *         CHKERR(PCMGGetSmootherDown(self.pc, clevel, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))             # <<<<<<<<<<<<<<
 *         return ksp
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1979, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":1980
 *         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":1961
 *         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_XDECREF(__pyx_t_3);
  __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":1982
 *         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_179getMGSmootherUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_178getMGSmootherUp, "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:1982");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_179getMGSmootherUp = {"getMGSmootherUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_179getMGSmootherUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_178getMGSmootherUp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_179getMGSmootherUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 1982, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1982, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getMGSmootherUp", 0) < (0)) __PYX_ERR(48, 1982, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getMGSmootherUp", 1, 1, 1, i); __PYX_ERR(48, 1982, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 1982, __pyx_L3_error)
    }
    __pyx_v_level = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getMGSmootherUp", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 1982, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_178getMGSmootherUp(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_178getMGSmootherUp(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getMGSmootherUp", 0);

  /* "petsc4py/PETSc/PC.pyx":1997
 * 
 *         """
 *         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, 1997, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":1998
 *         """
 *         cdef PetscInt clevel = asInt(level)
 *         cdef KSP ksp = KSP()             # <<<<<<<<<<<<<<
 *         CHKERR(PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 1998, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":1999
 *         cdef PetscInt clevel = asInt(level)
 *         cdef KSP ksp = KSP()
 *         CHKERR(PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(ksp.obj))
 *         return ksp
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMGGetSmootherUp(__pyx_v_self->pc, __pyx_v_clevel, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 1999, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2000
 *         cdef KSP ksp = KSP()
 *         CHKERR(PCMGGetSmootherUp(self.pc, clevel, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))             # <<<<<<<<<<<<<<
 *         return ksp
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2000, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2001
 *         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":1982
 *         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_XDECREF(__pyx_t_3);
  __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":2003
 *         return ksp
 * 
 *     def setMGCycleType(self, cycle_type: MGCycleType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of cycles.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_181setMGCycleType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_180setMGCycleType, "PC.setMGCycleType(self, cycle_type: MGCycleType) -> None\nSet the type of cycles.\n\n        Logically collective.\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:2003");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_181setMGCycleType = {"setMGCycleType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_181setMGCycleType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_180setMGCycleType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_181setMGCycleType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cycle_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2003, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2003, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMGCycleType", 0) < (0)) __PYX_ERR(48, 2003, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMGCycleType", 1, 1, 1, i); __PYX_ERR(48, 2003, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2003, __pyx_L3_error)
    }
    __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, 2003, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_180setMGCycleType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_cycle_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_180setMGCycleType(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2018
 * 
 *         """
 *         cdef PetscPCMGCycleType ctype = cycle_type             # <<<<<<<<<<<<<<
 *         CHKERR(PCMGSetCycleType(self.pc, ctype))
 * 
*/
  __pyx_t_1 = ((PCMGCycleType)__Pyx_PyLong_As_PCMGCycleType(__pyx_v_cycle_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2018, __pyx_L1_error)
  __pyx_v_ctype = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2019
 *         """
 *         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, 2019, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2003
 *         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":2021
 *         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_183setMGCycleTypeOnLevel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_182setMGCycleTypeOnLevel, "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:2021");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_183setMGCycleTypeOnLevel = {"setMGCycleTypeOnLevel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_183setMGCycleTypeOnLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_182setMGCycleTypeOnLevel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_183setMGCycleTypeOnLevel(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,&__pyx_mstate_global->__pyx_n_u_cycle_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2021, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2021, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMGCycleTypeOnLevel", 0) < (0)) __PYX_ERR(48, 2021, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMGCycleTypeOnLevel", 1, 2, 2, i); __PYX_ERR(48, 2021, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2021, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2021, __pyx_L3_error)
    }
    __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, 2021, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_182setMGCycleTypeOnLevel(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_cycle_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_182setMGCycleTypeOnLevel(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2038
 * 
 *         """
 *         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, 2038, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2039
 *         """
 *         cdef PetscInt clevel = asInt(level)
 *         cdef PetscPCMGCycleType ctype = cycle_type             # <<<<<<<<<<<<<<
 *         CHKERR(PCMGSetCycleTypeOnLevel(self.pc, clevel, ctype))
 * 
*/
  __pyx_t_2 = ((PCMGCycleType)__Pyx_PyLong_As_PCMGCycleType(__pyx_v_cycle_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2039, __pyx_L1_error)
  __pyx_v_ctype = __pyx_t_2;

  /* "petsc4py/PETSc/PC.pyx":2040
 *         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, 2040, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2021
 *         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":2042
 *         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_185setMGRhs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_184setMGRhs, "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:2042");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_185setMGRhs = {"setMGRhs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_185setMGRhs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_184setMGRhs};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_185setMGRhs(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,&__pyx_mstate_global->__pyx_n_u_rhs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2042, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2042, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2042, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMGRhs", 0) < (0)) __PYX_ERR(48, 2042, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMGRhs", 1, 2, 2, i); __PYX_ERR(48, 2042, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2042, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2042, __pyx_L3_error)
    }
    __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, 2042, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "rhs", 0))) __PYX_ERR(48, 2042, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_184setMGRhs(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_rhs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_184setMGRhs(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2062
 * 
 *         """
 *         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, 2062, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2063
 *         """
 *         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, 2063, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2042
 *         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":2065
 *         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_187setMGX(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_186setMGX, "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:2065");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_187setMGX = {"setMGX", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_187setMGX, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_186setMGX};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_187setMGX(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2065, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2065, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2065, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMGX", 0) < (0)) __PYX_ERR(48, 2065, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMGX", 1, 2, 2, i); __PYX_ERR(48, 2065, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2065, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2065, __pyx_L3_error)
    }
    __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, 2065, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(48, 2065, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_186setMGX(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_x);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_186setMGX(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2085
 * 
 *         """
 *         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, 2085, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2086
 *         """
 *         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, 2086, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2065
 *         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":2088
 *         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_189setMGR(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_188setMGR, "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:2088");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_189setMGR = {"setMGR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_189setMGR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_188setMGR};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_189setMGR(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,&__pyx_mstate_global->__pyx_n_u_r,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2088, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2088, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2088, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMGR", 0) < (0)) __PYX_ERR(48, 2088, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMGR", 1, 2, 2, i); __PYX_ERR(48, 2088, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2088, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2088, __pyx_L3_error)
    }
    __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, 2088, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "r", 0))) __PYX_ERR(48, 2088, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_188setMGR(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level, __pyx_v_r);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_188setMGR(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2108
 * 
 *         """
 *         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, 2108, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2109
 *         """
 *         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, 2109, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2088
 *         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":2113
 *     # --- BDDC ---
 * 
 *     def setBDDCLocalAdjacency(self, csr: CSRIndicesSpec) -> None:             # <<<<<<<<<<<<<<
 *         """Provide a custom connectivity graph for local dofs.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_191setBDDCLocalAdjacency(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_190setBDDCLocalAdjacency, "PC.setBDDCLocalAdjacency(self, csr: CSRIndicesSpec) -> None\nProvide a custom connectivity graph for local dofs.\n\n        Not collective.\n\n        Parameters\n        ----------\n        csr\n            Compressed sparse row layout information.\n\n        See Also\n        --------\n        petsc.PCBDDCSetLocalAdjacencyGraph\n\n        \nSource code at petsc4py/PETSc/PC.pyx:2113");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_191setBDDCLocalAdjacency = {"setBDDCLocalAdjacency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_191setBDDCLocalAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_190setBDDCLocalAdjacency};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_191setBDDCLocalAdjacency(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("setBDDCLocalAdjacency (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_csr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2113, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2113, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBDDCLocalAdjacency", 0) < (0)) __PYX_ERR(48, 2113, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBDDCLocalAdjacency", 1, 1, 1, i); __PYX_ERR(48, 2113, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2113, __pyx_L3_error)
    }
    __pyx_v_csr = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setBDDCLocalAdjacency", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2113, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCLocalAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_190setBDDCLocalAdjacency(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_csr);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_190setBDDCLocalAdjacency(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_csr) {
  PyObject *__pyx_v_oi = 0;
  PyObject *__pyx_v_oj = 0;
  PetscInt __pyx_v_ni;
  PetscInt *__pyx_v_i;
  PetscInt __pyx_v_nj;
  PetscInt *__pyx_v_j;
  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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8[4];
  size_t __pyx_t_9;
  PetscErrorCode __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setBDDCLocalAdjacency", 0);

  /* "petsc4py/PETSc/PC.pyx":2129
 *         """
 *         cdef object oi, oj
 *         cdef PetscInt ni=0, *i=NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt nj=0, *j=NULL
 *         oi, oj = csr
*/
  __pyx_v_ni = 0;
  __pyx_v_i = NULL;

  /* "petsc4py/PETSc/PC.pyx":2130
 *         cdef object oi, oj
 *         cdef PetscInt ni=0, *i=NULL
 *         cdef PetscInt nj=0, *j=NULL             # <<<<<<<<<<<<<<
 *         oi, oj = csr
 *         oi = iarray_i(oi, &ni, &i)
*/
  __pyx_v_nj = 0;
  __pyx_v_j = NULL;

  /* "petsc4py/PETSc/PC.pyx":2131
 *         cdef PetscInt ni=0, *i=NULL
 *         cdef PetscInt nj=0, *j=NULL
 *         oi, oj = csr             # <<<<<<<<<<<<<<
 *         oi = iarray_i(oi, &ni, &i)
 *         oj = iarray_i(oj, &nj, &j)
*/
  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(48, 2131, __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_INCREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2131, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2131, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_2);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_v_csr); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(48, 2131, __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(48, 2131, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_oi = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_oj = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":2132
 *         cdef PetscInt nj=0, *j=NULL
 *         oi, oj = csr
 *         oi = iarray_i(oi, &ni, &i)             # <<<<<<<<<<<<<<
 *         oj = iarray_i(oj, &nj, &j)
 *         if (i[0] != 0):
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oi, (&__pyx_v_ni), (&__pyx_v_i))); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_oi, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":2133
 *         oi, oj = csr
 *         oi = iarray_i(oi, &ni, &i)
 *         oj = iarray_i(oj, &nj, &j)             # <<<<<<<<<<<<<<
 *         if (i[0] != 0):
 *             raise ValueError("I[0] is %d, expected %d" %
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_oj, (&__pyx_v_nj), (&__pyx_v_j))); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_oj, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":2134
 *         oi = iarray_i(oi, &ni, &i)
 *         oj = iarray_i(oj, &nj, &j)
 *         if (i[0] != 0):             # <<<<<<<<<<<<<<
 *             raise ValueError("I[0] is %d, expected %d" %
 *                              (toInt(i[0]), toInt(0)))
*/
  __pyx_t_5 = ((__pyx_v_i[0]) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "petsc4py/PETSc/PC.pyx":2135
 *         oj = iarray_i(oj, &nj, &j)
 *         if (i[0] != 0):
 *             raise ValueError("I[0] is %d, expected %d" %             # <<<<<<<<<<<<<<
 *                              (toInt(i[0]), toInt(0)))
 *         if (i[ni-1] != nj):
*/
    __pyx_t_1 = NULL;

    /* "petsc4py/PETSc/PC.pyx":2136
 *         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_3 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_3), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 2136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_3), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 2136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_I_0_is;
    __pyx_t_8[1] = __pyx_t_6;
    __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_expected;
    __pyx_t_8[3] = __pyx_t_7;

    /* "petsc4py/PETSc/PC.pyx":2135
 *         oj = iarray_i(oj, &nj, &j)
 *         if (i[0] != 0):
 *             raise ValueError("I[0] is %d, expected %d" %             # <<<<<<<<<<<<<<
 *                              (toInt(i[0]), toInt(0)))
 *         if (i[ni-1] != nj):
*/
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 8 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7));
    if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __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(48, 2135, __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, 2135, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":2134
 *         oi = iarray_i(oi, &ni, &i)
 *         oj = iarray_i(oj, &nj, &j)
 *         if (i[0] != 0):             # <<<<<<<<<<<<<<
 *             raise ValueError("I[0] is %d, expected %d" %
 *                              (toInt(i[0]), toInt(0)))
*/
  }

  /* "petsc4py/PETSc/PC.pyx":2137
 *             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_5 = ((__pyx_v_i[(__pyx_v_ni - 1)]) != __pyx_v_nj);
  if (unlikely(__pyx_t_5)) {

    /* "petsc4py/PETSc/PC.pyx":2138
 *                              (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_3 = NULL;

    /* "petsc4py/PETSc/PC.pyx":2139
 *         if (i[ni-1] != nj):
 *             raise ValueError("size(J) is %d, expected %d" %
 *                              (toInt(nj), toInt(i[ni-1])))             # <<<<<<<<<<<<<<
 * 
 *         CHKERR(PCBDDCSetLocalAdjacencyGraph(self.pc, ni - 1, i, j, PETSC_COPY_VALUES))
*/
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nj); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 2139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_i[(__pyx_v_ni - 1)])); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_1), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_6)) __PYX_ERR(48, 2139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_size_J_is;
    __pyx_t_8[1] = __pyx_t_7;
    __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_expected;
    __pyx_t_8[3] = __pyx_t_6;

    /* "petsc4py/PETSc/PC.pyx":2138
 *                              (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_1 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 11 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
    if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_1};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2138, __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, 2138, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":2137
 *             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/PC.pyx":2141
 *                              (toInt(nj), toInt(i[ni-1])))
 * 
 *         CHKERR(PCBDDCSetLocalAdjacencyGraph(self.pc, ni - 1, i, j, PETSC_COPY_VALUES))             # <<<<<<<<<<<<<<
 * 
 *     def setBDDCDivergenceMat(self, Mat div, trans: bool = False, IS l2l=None) -> None:
*/
  __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCBDDCSetLocalAdjacencyGraph(__pyx_v_self->pc, (__pyx_v_ni - 1), __pyx_v_i, __pyx_v_j, PETSC_COPY_VALUES)); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2141, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2113
 *     # --- BDDC ---
 * 
 *     def setBDDCLocalAdjacency(self, csr: CSRIndicesSpec) -> None:             # <<<<<<<<<<<<<<
 *         """Provide a custom connectivity graph for local dofs.
 * 
*/

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("petsc4py.PETSc.PC.setBDDCLocalAdjacency", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_oi);
  __Pyx_XDECREF(__pyx_v_oj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/PC.pyx":2143
 *         CHKERR(PCBDDCSetLocalAdjacencyGraph(self.pc, ni - 1, i, j, PETSC_COPY_VALUES))
 * 
 *     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_193setBDDCDivergenceMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_192setBDDCDivergenceMat, "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:2143");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_193setBDDCDivergenceMat = {"setBDDCDivergenceMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_193setBDDCDivergenceMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_192setBDDCDivergenceMat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_193setBDDCDivergenceMat(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_div,&__pyx_mstate_global->__pyx_n_u_trans,&__pyx_mstate_global->__pyx_n_u_l2l,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2143, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 2143, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2143, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2143, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBDDCDivergenceMat", 0) < (0)) __PYX_ERR(48, 2143, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBDDCDivergenceMat", 0, 1, 3, i); __PYX_ERR(48, 2143, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 2143, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2143, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2143, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
    }
    __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, 2143, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "div", 0))) __PYX_ERR(48, 2143, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2l), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 1, "l2l", 0))) __PYX_ERR(48, 2143, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_192setBDDCDivergenceMat(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_192setBDDCDivergenceMat(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2164
 * 
 *         """
 *         cdef PetscBool ptrans = trans             # <<<<<<<<<<<<<<
 *         cdef PetscIS pl2l = NULL
 *         if l2l is not None: pl2l = l2l.iset
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_trans); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(48, 2164, __pyx_L1_error)
  __pyx_v_ptrans = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2165
 *         """
 *         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":2166
 *         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":2167
 *         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, 2167, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2143
 *         CHKERR(PCBDDCSetLocalAdjacencyGraph(self.pc, ni - 1, i, j, PETSC_COPY_VALUES))
 * 
 *     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":2169
 *         CHKERR(PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l))
 * 
 *     def setBDDCDiscreteGradient(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat G,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_195setBDDCDiscreteGradient(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_194setBDDCDiscreteGradient, "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:2169");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_195setBDDCDiscreteGradient = {"setBDDCDiscreteGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_195setBDDCDiscreteGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_194setBDDCDiscreteGradient};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_195setBDDCDiscreteGradient(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_G,&__pyx_mstate_global->__pyx_n_u_order,&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_gord,&__pyx_mstate_global->__pyx_n_u_conforming,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2169, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(48, 2169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(48, 2169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 2169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBDDCDiscreteGradient", 0) < (0)) __PYX_ERR(48, 2169, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));

      /* "petsc4py/PETSc/PC.pyx":2174
 *         order: int = 1,
 *         field: int = 1,
 *         gord: bool = True,             # <<<<<<<<<<<<<<
 *         conforming: bool = True) -> None:
 *         """Set the discrete gradient.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "petsc4py/PETSc/PC.pyx":2175
 *         field: int = 1,
 *         gord: bool = True,
 *         conforming: bool = True) -> None:             # <<<<<<<<<<<<<<
 *         """Set the discrete gradient.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBDDCDiscreteGradient", 0, 1, 5, i); __PYX_ERR(48, 2169, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(48, 2169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(48, 2169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 2169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2169, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));

      /* "petsc4py/PETSc/PC.pyx":2174
 *         order: int = 1,
 *         field: int = 1,
 *         gord: bool = True,             # <<<<<<<<<<<<<<
 *         conforming: bool = True) -> None:
 *         """Set the discrete gradient.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));

      /* "petsc4py/PETSc/PC.pyx":2175
 *         field: int = 1,
 *         gord: bool = True,
 *         conforming: bool = True) -> None:             # <<<<<<<<<<<<<<
 *         """Set the discrete gradient.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __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, 2169, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "G", 0))) __PYX_ERR(48, 2171, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_194setBDDCDiscreteGradient(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_G, __pyx_v_order, __pyx_v_field, __pyx_v_gord, __pyx_v_conforming);

  /* "petsc4py/PETSc/PC.pyx":2169
 *         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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_194setBDDCDiscreteGradient(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2199
 * 
 *         """
 *         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, 2199, __pyx_L1_error)
  __pyx_v_porder = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2200
 *         """
 *         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, 2200, __pyx_L1_error)
  __pyx_v_pfield = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2201
 *         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 = __Pyx_PyObject_IsTrue(__pyx_v_gord); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(48, 2201, __pyx_L1_error)
  __pyx_v_pgord = __pyx_t_2;

  /* "petsc4py/PETSc/PC.pyx":2202
 *         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 = __Pyx_PyObject_IsTrue(__pyx_v_conforming); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(48, 2202, __pyx_L1_error)
  __pyx_v_pconforming = __pyx_t_2;

  /* "petsc4py/PETSc/PC.pyx":2203
 *         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, 2203, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2169
 *         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":2205
 *         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_197setBDDCChangeOfBasisMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_196setBDDCChangeOfBasisMat, "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:2205");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_197setBDDCChangeOfBasisMat = {"setBDDCChangeOfBasisMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_197setBDDCChangeOfBasisMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_196setBDDCChangeOfBasisMat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_197setBDDCChangeOfBasisMat(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_T_2,&__pyx_mstate_global->__pyx_n_u_interior,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2205, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBDDCChangeOfBasisMat", 0) < (0)) __PYX_ERR(48, 2205, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBDDCChangeOfBasisMat", 0, 1, 2, i); __PYX_ERR(48, 2205, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2205, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __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, 2205, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "T", 0))) __PYX_ERR(48, 2205, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_196setBDDCChangeOfBasisMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_T, __pyx_v_interior);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_196setBDDCChangeOfBasisMat(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2223
 * 
 *         """
 *         cdef PetscBool pinterior = interior             # <<<<<<<<<<<<<<
 *         CHKERR(PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_interior); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(48, 2223, __pyx_L1_error)
  __pyx_v_pinterior = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2224
 *         """
 *         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, 2224, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2205
 *         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":2226
 *         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_199setBDDCPrimalVerticesIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_198setBDDCPrimalVerticesIS, "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:2226");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_199setBDDCPrimalVerticesIS = {"setBDDCPrimalVerticesIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_199setBDDCPrimalVerticesIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_198setBDDCPrimalVerticesIS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_199setBDDCPrimalVerticesIS(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_primv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2226, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBDDCPrimalVerticesIS", 0) < (0)) __PYX_ERR(48, 2226, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBDDCPrimalVerticesIS", 1, 1, 1, i); __PYX_ERR(48, 2226, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2226, __pyx_L3_error)
    }
    __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, 2226, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "primv", 0))) __PYX_ERR(48, 2226, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_198setBDDCPrimalVerticesIS(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_primv);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_198setBDDCPrimalVerticesIS(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2241
 * 
 *         """
 *         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, 2241, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2226
 *         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":2243
 *         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_201setBDDCPrimalVerticesLocalIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_200setBDDCPrimalVerticesLocalIS, "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:2243");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_201setBDDCPrimalVerticesLocalIS = {"setBDDCPrimalVerticesLocalIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_201setBDDCPrimalVerticesLocalIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_200setBDDCPrimalVerticesLocalIS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_201setBDDCPrimalVerticesLocalIS(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_primv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2243, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2243, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBDDCPrimalVerticesLocalIS", 0) < (0)) __PYX_ERR(48, 2243, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBDDCPrimalVerticesLocalIS", 1, 1, 1, i); __PYX_ERR(48, 2243, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2243, __pyx_L3_error)
    }
    __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, 2243, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "primv", 0))) __PYX_ERR(48, 2243, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_200setBDDCPrimalVerticesLocalIS(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_primv);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_200setBDDCPrimalVerticesLocalIS(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2258
 * 
 *         """
 *         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, 2258, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2243
 *         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":2260
 *         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_203setBDDCCoarseningRatio(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_202setBDDCCoarseningRatio, "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:2260");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_203setBDDCCoarseningRatio = {"setBDDCCoarseningRatio", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_203setBDDCCoarseningRatio, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_202setBDDCCoarseningRatio};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_203setBDDCCoarseningRatio(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cratio,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2260, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBDDCCoarseningRatio", 0) < (0)) __PYX_ERR(48, 2260, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBDDCCoarseningRatio", 1, 1, 1, i); __PYX_ERR(48, 2260, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2260, __pyx_L3_error)
    }
    __pyx_v_cratio = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setBDDCCoarseningRatio", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2260, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_202setBDDCCoarseningRatio(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_cratio);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_202setBDDCCoarseningRatio(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2275
 * 
 *         """
 *         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, 2275, __pyx_L1_error)
  __pyx_v_pcratio = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2276
 *         """
 *         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, 2276, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2260
 *         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":2278
 *         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_205setBDDCLevels(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_204setBDDCLevels, "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:2278");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_205setBDDCLevels = {"setBDDCLevels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_205setBDDCLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_204setBDDCLevels};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_205setBDDCLevels(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_levels,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2278, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2278, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBDDCLevels", 0) < (0)) __PYX_ERR(48, 2278, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBDDCLevels", 1, 1, 1, i); __PYX_ERR(48, 2278, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2278, __pyx_L3_error)
    }
    __pyx_v_levels = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setBDDCLevels", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2278, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_204setBDDCLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_204setBDDCLevels(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2293
 * 
 *         """
 *         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, 2293, __pyx_L1_error)
  __pyx_v_plevels = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2294
 *         """
 *         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, 2294, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2278
 *         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":2296
 *         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_207setBDDCDirichletBoundaries(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_206setBDDCDirichletBoundaries, "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:2296");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_207setBDDCDirichletBoundaries = {"setBDDCDirichletBoundaries", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_207setBDDCDirichletBoundaries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_206setBDDCDirichletBoundaries};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_207setBDDCDirichletBoundaries(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bndr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2296, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2296, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBDDCDirichletBoundaries", 0) < (0)) __PYX_ERR(48, 2296, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBDDCDirichletBoundaries", 1, 1, 1, i); __PYX_ERR(48, 2296, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2296, __pyx_L3_error)
    }
    __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, 2296, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "bndr", 0))) __PYX_ERR(48, 2296, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_206setBDDCDirichletBoundaries(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bndr);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_206setBDDCDirichletBoundaries(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2311
 * 
 *         """
 *         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, 2311, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2296
 *         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":2313
 *         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_209setBDDCDirichletBoundariesLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_208setBDDCDirichletBoundariesLocal, "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:2313");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_209setBDDCDirichletBoundariesLocal = {"setBDDCDirichletBoundariesLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_209setBDDCDirichletBoundariesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_208setBDDCDirichletBoundariesLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_209setBDDCDirichletBoundariesLocal(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bndr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2313, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2313, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBDDCDirichletBoundariesLocal", 0) < (0)) __PYX_ERR(48, 2313, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBDDCDirichletBoundariesLocal", 1, 1, 1, i); __PYX_ERR(48, 2313, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2313, __pyx_L3_error)
    }
    __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, 2313, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "bndr", 0))) __PYX_ERR(48, 2313, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_208setBDDCDirichletBoundariesLocal(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bndr);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_208setBDDCDirichletBoundariesLocal(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2328
 * 
 *         """
 *         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, 2328, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2313
 *         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":2330
 *         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_211setBDDCNeumannBoundaries(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_210setBDDCNeumannBoundaries, "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:2330");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_211setBDDCNeumannBoundaries = {"setBDDCNeumannBoundaries", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_211setBDDCNeumannBoundaries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_210setBDDCNeumannBoundaries};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_211setBDDCNeumannBoundaries(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bndr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2330, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2330, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBDDCNeumannBoundaries", 0) < (0)) __PYX_ERR(48, 2330, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBDDCNeumannBoundaries", 1, 1, 1, i); __PYX_ERR(48, 2330, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2330, __pyx_L3_error)
    }
    __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, 2330, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "bndr", 0))) __PYX_ERR(48, 2330, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_210setBDDCNeumannBoundaries(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bndr);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_210setBDDCNeumannBoundaries(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2345
 * 
 *         """
 *         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, 2345, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2330
 *         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":2347
 *         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_213setBDDCNeumannBoundariesLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_212setBDDCNeumannBoundariesLocal, "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:2347");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_213setBDDCNeumannBoundariesLocal = {"setBDDCNeumannBoundariesLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_213setBDDCNeumannBoundariesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_212setBDDCNeumannBoundariesLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_213setBDDCNeumannBoundariesLocal(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_bndr,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2347, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2347, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBDDCNeumannBoundariesLocal", 0) < (0)) __PYX_ERR(48, 2347, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBDDCNeumannBoundariesLocal", 1, 1, 1, i); __PYX_ERR(48, 2347, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2347, __pyx_L3_error)
    }
    __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, 2347, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "bndr", 0))) __PYX_ERR(48, 2347, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_212setBDDCNeumannBoundariesLocal(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_bndr);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_212setBDDCNeumannBoundariesLocal(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2362
 * 
 *         """
 *         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, 2362, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2347
 *         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":2364
 *         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_215setBDDCDofsSplitting(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_214setBDDCDofsSplitting, "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:2364");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_215setBDDCDofsSplitting = {"setBDDCDofsSplitting", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_215setBDDCDofsSplitting, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_214setBDDCDofsSplitting};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_215setBDDCDofsSplitting(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isfields,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2364, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2364, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBDDCDofsSplitting", 0) < (0)) __PYX_ERR(48, 2364, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBDDCDofsSplitting", 1, 1, 1, i); __PYX_ERR(48, 2364, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2364, __pyx_L3_error)
    }
    __pyx_v_isfields = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setBDDCDofsSplitting", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2364, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_214setBDDCDofsSplitting(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_isfields);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_214setBDDCDofsSplitting(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_unused = 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":2379
 * 
 *         """
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS); 
  if (__pyx_t_2) {
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2379, __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) != (0)) __PYX_ERR(48, 2379, __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, 2379, __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":2380
 *         """
 *         isfields = [isfields] if isinstance(isfields, IS) else list(isfields)
 *         cdef Py_ssize_t i, n = len(isfields)             # <<<<<<<<<<<<<<
 *         cdef PetscIS  *cisfields = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&cisfields)
*/
  __pyx_t_4 = PyObject_Length(__pyx_v_isfields); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(48, 2380, __pyx_L1_error)
  __pyx_v_n = __pyx_t_4;

  /* "petsc4py/PETSc/PC.pyx":2381
 *         isfields = [isfields] if isinstance(isfields, IS) else list(isfields)
 *         cdef Py_ssize_t i, n = len(isfields)
 *         cdef PetscIS  *cisfields = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&cisfields)
 *         for i from 0 <= i < n: cisfields[i] = (<IS?>isfields[i]).iset
*/
  __pyx_v_cisfields = NULL;

  /* "petsc4py/PETSc/PC.pyx":2382
 *         cdef Py_ssize_t i, n = len(isfields)
 *         cdef PetscIS  *cisfields = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&cisfields)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < n: cisfields[i] = (<IS?>isfields[i]).iset
 *         CHKERR(PCBDDCSetDofsSplitting(self.pc, <PetscInt>n, cisfields))
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_n))); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2382, __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, 2382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/PC.pyx":2383
 *         cdef PetscIS  *cisfields = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&cisfields)
 *         for i from 0 <= i < n: cisfields[i] = (<IS?>isfields[i]).iset             # <<<<<<<<<<<<<<
 *         CHKERR(PCBDDCSetDofsSplitting(self.pc, <PetscInt>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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(48, 2383, __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":2384
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&cisfields)
 *         for i from 0 <= i < n: cisfields[i] = (<IS?>isfields[i]).iset
 *         CHKERR(PCBDDCSetDofsSplitting(self.pc, <PetscInt>n, cisfields))             # <<<<<<<<<<<<<<
 * 
 *     def setBDDCDofsSplittingLocal(self, isfields: IS | Sequence[IS]) -> None:
*/
  __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, 2384, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2364
 *         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_unused);
  __Pyx_XDECREF(__pyx_v_isfields);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/PC.pyx":2386
 *         CHKERR(PCBDDCSetDofsSplitting(self.pc, <PetscInt>n, cisfields))
 * 
 *     def setBDDCDofsSplittingLocal(self, isfields: IS | Sequence[IS]) -> None:             # <<<<<<<<<<<<<<
 *         """Set the index set(s) defining fields of the local subdomain matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_217setBDDCDofsSplittingLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_216setBDDCDofsSplittingLocal, "PC.setBDDCDofsSplittingLocal(self, isfields: IS | Sequence[IS]) -> None\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:2386");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_217setBDDCDofsSplittingLocal = {"setBDDCDofsSplittingLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_217setBDDCDofsSplittingLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_216setBDDCDofsSplittingLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_217setBDDCDofsSplittingLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isfields,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2386, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2386, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBDDCDofsSplittingLocal", 0) < (0)) __PYX_ERR(48, 2386, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBDDCDofsSplittingLocal", 1, 1, 1, i); __PYX_ERR(48, 2386, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2386, __pyx_L3_error)
    }
    __pyx_v_isfields = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setBDDCDofsSplittingLocal", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2386, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_216setBDDCDofsSplittingLocal(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_isfields);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_216setBDDCDofsSplittingLocal(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_unused = 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":2404
 * 
 *         """
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS); 
  if (__pyx_t_2) {
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2404, __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) != (0)) __PYX_ERR(48, 2404, __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, 2404, __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":2405
 *         """
 *         isfields = [isfields] if isinstance(isfields, IS) else list(isfields)
 *         cdef Py_ssize_t i, n = len(isfields)             # <<<<<<<<<<<<<<
 *         cdef PetscIS  *cisfields = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&cisfields)
*/
  __pyx_t_4 = PyObject_Length(__pyx_v_isfields); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(48, 2405, __pyx_L1_error)
  __pyx_v_n = __pyx_t_4;

  /* "petsc4py/PETSc/PC.pyx":2406
 *         isfields = [isfields] if isinstance(isfields, IS) else list(isfields)
 *         cdef Py_ssize_t i, n = len(isfields)
 *         cdef PetscIS  *cisfields = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&cisfields)
 *         for i from 0 <= i < n: cisfields[i] = (<IS?>isfields[i]).iset
*/
  __pyx_v_cisfields = NULL;

  /* "petsc4py/PETSc/PC.pyx":2407
 *         cdef Py_ssize_t i, n = len(isfields)
 *         cdef PetscIS  *cisfields = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&cisfields)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < n: cisfields[i] = (<IS?>isfields[i]).iset
 *         CHKERR(PCBDDCSetDofsSplittingLocal(self.pc, <PetscInt>n, cisfields))
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_n))); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2407, __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, 2407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/PC.pyx":2408
 *         cdef PetscIS  *cisfields = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&cisfields)
 *         for i from 0 <= i < n: cisfields[i] = (<IS?>isfields[i]).iset             # <<<<<<<<<<<<<<
 *         CHKERR(PCBDDCSetDofsSplittingLocal(self.pc, <PetscInt>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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(48, 2408, __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":2409
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&cisfields)
 *         for i from 0 <= i < n: cisfields[i] = (<IS?>isfields[i]).iset
 *         CHKERR(PCBDDCSetDofsSplittingLocal(self.pc, <PetscInt>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, 2409, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2386
 *         CHKERR(PCBDDCSetDofsSplitting(self.pc, <PetscInt>n, cisfields))
 * 
 *     def setBDDCDofsSplittingLocal(self, isfields: IS | Sequence[IS]) -> None:             # <<<<<<<<<<<<<<
 *         """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_unused);
  __Pyx_XDECREF(__pyx_v_isfields);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/PC.pyx":2412
 * 
 *     # --- Patch ---
 *     def getPatchSubKSP(self) -> list[KSP]:             # <<<<<<<<<<<<<<
 *         """Return the local `KSP` object for all blocks on this process.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_219getPatchSubKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_218getPatchSubKSP, "PC.getPatchSubKSP(self) -> list[KSP]\nReturn the local `KSP` object for all blocks on this process.\n\n        Not collective.\n\n        \nSource code at petsc4py/PETSc/PC.pyx:2412");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_219getPatchSubKSP = {"getPatchSubKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_219getPatchSubKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_218getPatchSubKSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_219getPatchSubKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getPatchSubKSP (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPatchSubKSP", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPatchSubKSP", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_218getPatchSubKSP(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_218getPatchSubKSP(struct PyPetscPCObject *__pyx_v_self) {
  PetscInt __pyx_v_n;
  KSP *__pyx_v_p;
  long __pyx_9genexpr12__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("getPatchSubKSP", 0);

  /* "petsc4py/PETSc/PC.pyx":2418
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         cdef PetscKSP *p = NULL
 *         CHKERR(PCPatchGetSubKSP(self.pc, &n, &p))
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/PC.pyx":2419
 *         """
 *         cdef PetscInt n = 0
 *         cdef PetscKSP *p = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PCPatchGetSubKSP(self.pc, &n, &p))
 *         return [ref_KSP(p[i]) for i from 0 <= i <n]
*/
  __pyx_v_p = NULL;

  /* "petsc4py/PETSc/PC.pyx":2420
 *         cdef PetscInt n = 0
 *         cdef PetscKSP *p = NULL
 *         CHKERR(PCPatchGetSubKSP(self.pc, &n, &p))             # <<<<<<<<<<<<<<
 *         return [ref_KSP(p[i]) for i from 0 <= i <n]
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchGetSubKSP(__pyx_v_self->pc, (&__pyx_v_n), (&__pyx_v_p))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2420, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2421
 *         cdef PetscKSP *p = NULL
 *         CHKERR(PCPatchGetSubKSP(self.pc, &n, &p))
 *         return [ref_KSP(p[i]) for i from 0 <= i <n]             # <<<<<<<<<<<<<<
 * 
 *     def setPatchCellNumbering(self, Section sec) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_v_n;
    for (__pyx_9genexpr12__pyx_v_i = 0; __pyx_9genexpr12__pyx_v_i < __pyx_t_3; __pyx_9genexpr12__pyx_v_i++) {
      __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_KSP((__pyx_v_p[__pyx_9genexpr12__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2421, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(48, 2421, __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":2412
 * 
 *     # --- Patch ---
 *     def getPatchSubKSP(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.getPatchSubKSP", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/PC.pyx":2423
 *         return [ref_KSP(p[i]) for i from 0 <= i <n]
 * 
 *     def setPatchCellNumbering(self, Section sec) -> None:             # <<<<<<<<<<<<<<
 *         """Set the cell numbering."""
 *         CHKERR(PCPatchSetCellNumbering(self.pc, sec.sec))
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_221setPatchCellNumbering(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_220setPatchCellNumbering, "PC.setPatchCellNumbering(self, sec: Section) -> None\nSet the cell numbering.\nSource code at petsc4py/PETSc/PC.pyx:2423");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_221setPatchCellNumbering = {"setPatchCellNumbering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_221setPatchCellNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_220setPatchCellNumbering};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_221setPatchCellNumbering(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2423, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2423, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPatchCellNumbering", 0) < (0)) __PYX_ERR(48, 2423, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPatchCellNumbering", 1, 1, 1, i); __PYX_ERR(48, 2423, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2423, __pyx_L3_error)
    }
    __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, 2423, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(48, 2423, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_220setPatchCellNumbering(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_sec);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_220setPatchCellNumbering(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2425
 *     def setPatchCellNumbering(self, Section sec) -> None:
 *         """Set the cell numbering."""
 *         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, 2425, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2423
 *         return [ref_KSP(p[i]) for i from 0 <= i <n]
 * 
 *     def setPatchCellNumbering(self, Section sec) -> None:             # <<<<<<<<<<<<<<
 *         """Set the cell numbering."""
 *         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":2427
 *         CHKERR(PCPatchSetCellNumbering(self.pc, sec.sec))
 * 
 *     def setPatchDiscretisationInfo(self, dms, bs,             # <<<<<<<<<<<<<<
 *                                    cellNodeMaps,
 *                                    subspaceOffsets,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_223setPatchDiscretisationInfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_222setPatchDiscretisationInfo, "PC.setPatchDiscretisationInfo(self, dms, bs, cellNodeMaps, subspaceOffsets, ghostBcNodes, globalBcNodes) -> None\nSet discretisation info.\nSource code at petsc4py/PETSc/PC.pyx:2427");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_223setPatchDiscretisationInfo = {"setPatchDiscretisationInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_223setPatchDiscretisationInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_222setPatchDiscretisationInfo};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_223setPatchDiscretisationInfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dms,&__pyx_mstate_global->__pyx_n_u_bs_2,&__pyx_mstate_global->__pyx_n_u_cellNodeMaps,&__pyx_mstate_global->__pyx_n_u_subspaceOffsets,&__pyx_mstate_global->__pyx_n_u_ghostBcNodes,&__pyx_mstate_global->__pyx_n_u_globalBcNodes,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2427, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(48, 2427, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(48, 2427, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(48, 2427, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 2427, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2427, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2427, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPatchDiscretisationInfo", 0) < (0)) __PYX_ERR(48, 2427, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, i); __PYX_ERR(48, 2427, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2427, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2427, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 2427, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(48, 2427, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(48, 2427, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(48, 2427, __pyx_L3_error)
    }
    __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, 2427, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_222setPatchDiscretisationInfo(((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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_222setPatchDiscretisationInfo(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":2433
 *                                    globalBcNodes) -> None:
 *         """Set discretisation info."""
 *         cdef PetscInt numSubSpaces = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt numGhostBcs = 0, numGlobalBcs = 0
 *         cdef PetscInt *nodesPerCell = NULL
*/
  __pyx_v_numSubSpaces = 0;

  /* "petsc4py/PETSc/PC.pyx":2434
 *         """Set discretisation info."""
 *         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":2435
 *         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":2436
 *         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":2437
 *         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":2438
 *         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":2439
 *         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":2440
 *         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":2441
 *         cdef PetscInt *csubspaceOffsets = NULL
 *         cdef PetscInt *cghostBcNodes = NULL
 *         cdef PetscInt *cglobalBcNodes = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt i = 0
 * 
*/
  __pyx_v_cglobalBcNodes = NULL;

  /* "petsc4py/PETSc/PC.pyx":2442
 *         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":2444
 *         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, 2444, __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":2445
 * 
 *         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, 2445, __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":2446
 *         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, 2446, __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":2447
 *         ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes)
 *         globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes)
 *         subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets)             # <<<<<<<<<<<<<<
 * 
 *         CHKERR(PetscMalloc(<size_t>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, 2447, __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":2449
 *         subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets)
 * 
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscInt), &nodesPerCell))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscDM), &cdms))
 *         CHKERR(PetscMalloc(<size_t>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, 2449, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2450
 * 
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscInt), &nodesPerCell))
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscDM), &cdms))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscMalloc(<size_t>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, 2450, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2451
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscInt), &nodesPerCell))
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscDM), &cdms))
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps))             # <<<<<<<<<<<<<<
 *         for i in range(numSubSpaces):
 *             cdms[i] = (<DM?>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, 2451, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2452
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscDM), &cdms))
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps))
 *         for i in range(numSubSpaces):             # <<<<<<<<<<<<<<
 *             cdms[i] = (<DM?>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":2453
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps))
 *         for i in range(numSubSpaces):
 *             cdms[i] = (<DM?>dms[i]).dm             # <<<<<<<<<<<<<<
 *             _, nodes = asarray(cellNodeMaps[i]).shape
 *             cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, <PetscInt**>&ccellNodeMaps[i])
*/
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(48, 2453, __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":2454
 *         for i in range(numSubSpaces):
 *             cdms[i] = (<DM?>dms[i]).dm
 *             _, nodes = asarray(cellNodeMaps[i]).shape             # <<<<<<<<<<<<<<
 *             cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, <PetscInt**>&ccellNodeMaps[i])
 *             nodesPerCell[i] = asInt(nodes)
*/
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2454, __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, 2454, __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_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2454, __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, 2454, __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_INCREF(__pyx_t_7);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_8);
      } else {
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 2454, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(48, 2454, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
      }
      #else
      __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(48, 2454, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(48, 2454, __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, 2454, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 2454, __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, 2454, __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":2455
 *             cdms[i] = (<DM?>dms[i]).dm
 *             _, nodes = asarray(cellNodeMaps[i]).shape
 *             cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, <PetscInt**>&ccellNodeMaps[i])             # <<<<<<<<<<<<<<
 *             nodesPerCell[i] = asInt(nodes)
 * 
*/
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2455, __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, 2455, __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_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument) < 0))) __PYX_ERR(48, 2455, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "petsc4py/PETSc/PC.pyx":2456
 *             _, nodes = asarray(cellNodeMaps[i]).shape
 *             cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, <PetscInt**>&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, 2456, __pyx_L1_error)
    (__pyx_v_nodesPerCell[__pyx_v_i]) = __pyx_t_11;
  }

  /* "petsc4py/PETSc/PC.pyx":2459
 * 
 *         # 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, 2459, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2464
 *                                             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, 2464, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2465
 *                                             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, 2465, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2466
 *         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(48, 2466, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2427
 *         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":2468
 *         CHKERR(PetscFree(ccellNodeMaps))
 * 
 *     def setPatchComputeOperator(self, operator, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set compute operator callbacks."""
 *         if args is  None: args  = ()
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_225setPatchComputeOperator(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_224setPatchComputeOperator, "PC.setPatchComputeOperator(self, operator, args=None, kargs=None) -> None\nSet compute operator callbacks.\nSource code at petsc4py/PETSc/PC.pyx:2468");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_225setPatchComputeOperator = {"setPatchComputeOperator", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_225setPatchComputeOperator, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_224setPatchComputeOperator};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_225setPatchComputeOperator(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_operator,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2468, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 2468, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2468, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2468, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPatchComputeOperator", 0) < (0)) __PYX_ERR(48, 2468, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPatchComputeOperator", 0, 1, 3, i); __PYX_ERR(48, 2468, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 2468, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2468, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2468, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2468, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_224setPatchComputeOperator(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_operator, __pyx_v_args, __pyx_v_kargs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_224setPatchComputeOperator(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":2470
 *     def setPatchComputeOperator(self, operator, args=None, kargs=None) -> None:
 *         """Set compute operator callbacks."""
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/PC.pyx":2471
 *         """Set compute operator callbacks."""
 *         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, 2471, __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":2472
 *         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, <void*>context))
*/
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2472, __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) != (0)) __PYX_ERR(48, 2472, __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) != (0)) __PYX_ERR(48, 2472, __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) != (0)) __PYX_ERR(48, 2472, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":2473
 *         if kargs is None: kargs = {}
 *         context = (operator, args, kargs)
 *         self.set_attr("__patch_compute_operator__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, <void*>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, 2473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":2474
 *         context = (operator, args, kargs)
 *         self.set_attr("__patch_compute_operator__", context)
 *         CHKERR(PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, <void*>context))             # <<<<<<<<<<<<<<
 * 
 *     def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None) -> 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, 2474, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2468
 *         CHKERR(PetscFree(ccellNodeMaps))
 * 
 *     def setPatchComputeOperator(self, operator, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set compute operator callbacks."""
 *         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.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":2476
 *         CHKERR(PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, <void*>context))
 * 
 *     def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set compute operator callbacks."""
 *         if args is  None: args  = ()
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_227setPatchComputeOperatorInteriorFacets(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_226setPatchComputeOperatorInteriorFacets, "PC.setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None) -> None\nSet compute operator callbacks.\nSource code at petsc4py/PETSc/PC.pyx:2476");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_227setPatchComputeOperatorInteriorFacets = {"setPatchComputeOperatorInteriorFacets", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_227setPatchComputeOperatorInteriorFacets, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_226setPatchComputeOperatorInteriorFacets};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_227setPatchComputeOperatorInteriorFacets(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_operator,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2476, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 2476, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2476, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2476, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPatchComputeOperatorInteriorFacets", 0) < (0)) __PYX_ERR(48, 2476, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPatchComputeOperatorInteriorFacets", 0, 1, 3, i); __PYX_ERR(48, 2476, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 2476, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2476, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2476, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2476, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_226setPatchComputeOperatorInteriorFacets(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_operator, __pyx_v_args, __pyx_v_kargs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_226setPatchComputeOperatorInteriorFacets(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":2478
 *     def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None) -> None:
 *         """Set compute operator callbacks."""
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/PC.pyx":2479
 *         """Set compute operator callbacks."""
 *         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, 2479, __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":2480
 *         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, <void*>context))
*/
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2480, __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) != (0)) __PYX_ERR(48, 2480, __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) != (0)) __PYX_ERR(48, 2480, __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) != (0)) __PYX_ERR(48, 2480, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":2481
 *         if kargs is None: kargs = {}
 *         context = (operator, args, kargs)
 *         self.set_attr("__patch_compute_operator_interior_facets__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, <void*>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, 2481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":2482
 *         context = (operator, args, kargs)
 *         self.set_attr("__patch_compute_operator_interior_facets__", context)
 *         CHKERR(PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, <void*>context))             # <<<<<<<<<<<<<<
 * 
 *     def setPatchComputeFunction(self, function, args=None, kargs=None) -> 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, 2482, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2476
 *         CHKERR(PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, <void*>context))
 * 
 *     def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set compute operator callbacks."""
 *         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.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":2484
 *         CHKERR(PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, <void*>context))
 * 
 *     def setPatchComputeFunction(self, function, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set compute operator callbacks."""
 *         if args is  None: args  = ()
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_229setPatchComputeFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_228setPatchComputeFunction, "PC.setPatchComputeFunction(self, function, args=None, kargs=None) -> None\nSet compute operator callbacks.\nSource code at petsc4py/PETSc/PC.pyx:2484");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_229setPatchComputeFunction = {"setPatchComputeFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_229setPatchComputeFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_228setPatchComputeFunction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_229setPatchComputeFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_function,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2484, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 2484, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2484, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2484, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPatchComputeFunction", 0) < (0)) __PYX_ERR(48, 2484, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPatchComputeFunction", 0, 1, 3, i); __PYX_ERR(48, 2484, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 2484, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2484, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2484, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2484, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_228setPatchComputeFunction(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_228setPatchComputeFunction(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":2486
 *     def setPatchComputeFunction(self, function, args=None, kargs=None) -> None:
 *         """Set compute operator callbacks."""
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/PC.pyx":2487
 *         """Set compute operator callbacks."""
 *         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, 2487, __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":2488
 *         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, <void*>context))
*/
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2488, __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) != (0)) __PYX_ERR(48, 2488, __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) != (0)) __PYX_ERR(48, 2488, __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) != (0)) __PYX_ERR(48, 2488, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":2489
 *         if kargs is None: kargs = {}
 *         context = (function, args, kargs)
 *         self.set_attr("__patch_compute_function__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, <void*>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, 2489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":2490
 *         context = (function, args, kargs)
 *         self.set_attr("__patch_compute_function__", context)
 *         CHKERR(PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, <void*>context))             # <<<<<<<<<<<<<<
 * 
 *     def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None) -> 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, 2490, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2484
 *         CHKERR(PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, <void*>context))
 * 
 *     def setPatchComputeFunction(self, function, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set compute operator callbacks."""
 *         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.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":2492
 *         CHKERR(PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, <void*>context))
 * 
 *     def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set compute operator callbacks."""
 *         if args is  None: args  = ()
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_231setPatchComputeFunctionInteriorFacets(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_230setPatchComputeFunctionInteriorFacets, "PC.setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None) -> None\nSet compute operator callbacks.\nSource code at petsc4py/PETSc/PC.pyx:2492");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_231setPatchComputeFunctionInteriorFacets = {"setPatchComputeFunctionInteriorFacets", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_231setPatchComputeFunctionInteriorFacets, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_230setPatchComputeFunctionInteriorFacets};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_231setPatchComputeFunctionInteriorFacets(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_function,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2492, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 2492, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2492, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2492, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPatchComputeFunctionInteriorFacets", 0) < (0)) __PYX_ERR(48, 2492, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPatchComputeFunctionInteriorFacets", 0, 1, 3, i); __PYX_ERR(48, 2492, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 2492, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2492, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2492, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2492, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_230setPatchComputeFunctionInteriorFacets(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_230setPatchComputeFunctionInteriorFacets(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":2494
 *     def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None) -> None:
 *         """Set compute operator callbacks."""
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/PC.pyx":2495
 *         """Set compute operator callbacks."""
 *         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, 2495, __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":2496
 *         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, <void*>context))
*/
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2496, __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) != (0)) __PYX_ERR(48, 2496, __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) != (0)) __PYX_ERR(48, 2496, __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) != (0)) __PYX_ERR(48, 2496, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":2497
 *         if kargs is None: kargs = {}
 *         context = (function, args, kargs)
 *         self.set_attr("__patch_compute_function_interior_facets__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, <void*>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, 2497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":2498
 *         context = (function, args, kargs)
 *         self.set_attr("__patch_compute_function_interior_facets__", context)
 *         CHKERR(PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, <void*>context))             # <<<<<<<<<<<<<<
 * 
 *     def setPatchConstructType(self, typ, operator=None, args=None, kargs=None) -> 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, 2498, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2492
 *         CHKERR(PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, <void*>context))
 * 
 *     def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set compute operator callbacks."""
 *         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.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":2500
 *         CHKERR(PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, <void*>context))
 * 
 *     def setPatchConstructType(self, typ, operator=None, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set compute operator callbacks."""
 *         if args is  None: args  = ()
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_233setPatchConstructType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_232setPatchConstructType, "PC.setPatchConstructType(self, typ, operator=None, args=None, kargs=None) -> None\nSet compute operator callbacks.\nSource code at petsc4py/PETSc/PC.pyx:2500");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_233setPatchConstructType = {"setPatchConstructType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_233setPatchConstructType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_232setPatchConstructType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_233setPatchConstructType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_typ,&__pyx_mstate_global->__pyx_n_u_operator,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2500, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(48, 2500, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 2500, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2500, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2500, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPatchConstructType", 0) < (0)) __PYX_ERR(48, 2500, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPatchConstructType", 0, 1, 4, i); __PYX_ERR(48, 2500, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(48, 2500, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(48, 2500, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2500, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2500, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2500, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_232setPatchConstructType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_typ, __pyx_v_operator, __pyx_v_args, __pyx_v_kargs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_232setPatchConstructType(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;
  size_t __pyx_t_7;
  PCPatchConstructType __pyx_t_8;
  PetscErrorCode __pyx_t_9;
  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":2502
 *     def setPatchConstructType(self, typ, operator=None, args=None, kargs=None) -> None:
 *         """Set compute operator callbacks."""
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/PC.pyx":2503
 *         """Set compute operator callbacks."""
 *         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, 2503, __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":2505
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_mstate_global->__pyx_n_u_PatchConstructType); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PYTHON); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2505, __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, 2505, __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, 2505, __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_mstate_global->__pyx_n_u_PatchConstructType); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_USER); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2505, __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, 2505, __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, 2505, __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":2506
 * 
 *         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_4 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Must_provide_operator_for_USER_o};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2506, __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, 2506, __pyx_L1_error)

    /* "petsc4py/PETSc/PC.pyx":2505
 *         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":2507
 *         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":2508
 *             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, 2508, __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) != (0)) __PYX_ERR(48, 2508, __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) != (0)) __PYX_ERR(48, 2508, __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) != (0)) __PYX_ERR(48, 2508, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/PC.pyx":2507
 *         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":2510
 *             context = (operator, args, kargs)
 *         else:
 *             context = None             # <<<<<<<<<<<<<<
 *         self.set_attr("__patch_construction_operator__", context)
 *         CHKERR(PCPatchSetConstructType(self.pc, typ, PCPatch_UserConstructOperator, <void*>context))
*/
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_context = ((PyObject*)Py_None);
  }
  __pyx_L10:;

  /* "petsc4py/PETSc/PC.pyx":2511
 *         else:
 *             context = None
 *         self.set_attr("__patch_construction_operator__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(PCPatchSetConstructType(self.pc, typ, PCPatch_UserConstructOperator, <void*>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, 2511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/PC.pyx":2512
 *             context = None
 *         self.set_attr("__patch_construction_operator__", context)
 *         CHKERR(PCPatchSetConstructType(self.pc, typ, PCPatch_UserConstructOperator, <void*>context))             # <<<<<<<<<<<<<<
 * 
 *     # --- HPDDM ---
*/
  __pyx_t_8 = ((PCPatchConstructType)__Pyx_PyLong_As_PCPatchConstructType(__pyx_v_typ)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2512, __pyx_L1_error)
  __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCPatchSetConstructType(__pyx_v_self->pc, __pyx_t_8, __pyx_f_8petsc4py_5PETSc_PCPatch_UserConstructOperator, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2512, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2500
 *         CHKERR(PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, <void*>context))
 * 
 *     def setPatchConstructType(self, typ, operator=None, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set compute operator callbacks."""
 *         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.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":2516
 *     # --- 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_235setHPDDMAuxiliaryMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_234setHPDDMAuxiliaryMat, "PC.setHPDDMAuxiliaryMat(self, uis: IS, uaux: Mat) -> None\nSet the auxiliary matrix used by the preconditioner.\n\n        Logically collective.\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:2516");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_235setHPDDMAuxiliaryMat = {"setHPDDMAuxiliaryMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_235setHPDDMAuxiliaryMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_234setHPDDMAuxiliaryMat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_235setHPDDMAuxiliaryMat(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_uis,&__pyx_mstate_global->__pyx_n_u_uaux,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2516, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2516, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2516, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setHPDDMAuxiliaryMat", 0) < (0)) __PYX_ERR(48, 2516, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setHPDDMAuxiliaryMat", 1, 2, 2, i); __PYX_ERR(48, 2516, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2516, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2516, __pyx_L3_error)
    }
    __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, 2516, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "uis", 0))) __PYX_ERR(48, 2516, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_uaux), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "uaux", 0))) __PYX_ERR(48, 2516, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_234setHPDDMAuxiliaryMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_uis, __pyx_v_uaux);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_234setHPDDMAuxiliaryMat(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2533
 * 
 *         """
 *         CHKERR(PCHPDDMSetAuxiliaryMat(self.pc, uis.iset, uaux.mat, NULL, <void*>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, 2533, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2516
 *     # --- 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":2535
 *         CHKERR(PCHPDDMSetAuxiliaryMat(self.pc, uis.iset, uaux.mat, NULL, <void*>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_237setHPDDMRHSMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_236setHPDDMRHSMat, "PC.setHPDDMRHSMat(self, B: Mat) -> None\nSet the right-hand side matrix of the preconditioner.\n\n        Logically collective.\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:2535");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_237setHPDDMRHSMat = {"setHPDDMRHSMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_237setHPDDMRHSMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_236setHPDDMRHSMat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_237setHPDDMRHSMat(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_B,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2535, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2535, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setHPDDMRHSMat", 0) < (0)) __PYX_ERR(48, 2535, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setHPDDMRHSMat", 1, 1, 1, i); __PYX_ERR(48, 2535, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2535, __pyx_L3_error)
    }
    __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, 2535, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "B", 0))) __PYX_ERR(48, 2535, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_236setHPDDMRHSMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_B);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_236setHPDDMRHSMat(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2550
 * 
 *         """
 *         CHKERR(PCHPDDMSetRHSMat(self.pc, B.mat))             # <<<<<<<<<<<<<<
 * 
 *     def getHPDDMComplexities(self) -> tuple[float, float]:
*/
  __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, 2550, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2535
 *         CHKERR(PCHPDDMSetAuxiliaryMat(self.pc, uis.iset, uaux.mat, NULL, <void*>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":2552
 *         CHKERR(PCHPDDMSetRHSMat(self.pc, B.mat))
 * 
 *     def getHPDDMComplexities(self) -> tuple[float, float]:             # <<<<<<<<<<<<<<
 *         """Compute the grid and operator complexities.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_239getHPDDMComplexities(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_238getHPDDMComplexities, "PC.getHPDDMComplexities(self) -> tuple[float, float]\nCompute the grid and operator complexities.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.PCHPDDMGetComplexities\n\n        \nSource code at petsc4py/PETSc/PC.pyx:2552");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_239getHPDDMComplexities = {"getHPDDMComplexities", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_239getHPDDMComplexities, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_238getHPDDMComplexities};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_239getHPDDMComplexities(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getHPDDMComplexities (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getHPDDMComplexities", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getHPDDMComplexities", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_238getHPDDMComplexities(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_238getHPDDMComplexities(struct PyPetscPCObject *__pyx_v_self) {
  PetscReal __pyx_v_gc;
  PetscReal __pyx_v_oc;
  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("getHPDDMComplexities", 0);

  /* "petsc4py/PETSc/PC.pyx":2562
 * 
 *         """
 *         cdef PetscReal gc = 0.0, oc = 0.0             # <<<<<<<<<<<<<<
 *         CHKERR(PCHPDDMGetComplexities(self.pc, &gc, &oc))
 *         return (toReal(gc), toReal(oc))
*/
  __pyx_v_gc = 0.0;
  __pyx_v_oc = 0.0;

  /* "petsc4py/PETSc/PC.pyx":2563
 *         """
 *         cdef PetscReal gc = 0.0, oc = 0.0
 *         CHKERR(PCHPDDMGetComplexities(self.pc, &gc, &oc))             # <<<<<<<<<<<<<<
 *         return (toReal(gc), toReal(oc))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCHPDDMGetComplexities(__pyx_v_self->pc, (&__pyx_v_gc), (&__pyx_v_oc))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2563, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2564
 *         cdef PetscReal gc = 0.0, oc = 0.0
 *         CHKERR(PCHPDDMGetComplexities(self.pc, &gc, &oc))
 *         return (toReal(gc), toReal(oc))             # <<<<<<<<<<<<<<
 * 
 *     def setHPDDMHasNeumannMat(self, has: bool) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_gc); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_oc); if (unlikely(!__pyx_t_3)) __PYX_ERR(48, 2564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2564, __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) != (0)) __PYX_ERR(48, 2564, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(48, 2564, __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/PC.pyx":2552
 *         CHKERR(PCHPDDMSetRHSMat(self.pc, B.mat))
 * 
 *     def getHPDDMComplexities(self) -> tuple[float, float]:             # <<<<<<<<<<<<<<
 *         """Compute the grid and operator complexities.
 * 
*/

  /* 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.PC.getHPDDMComplexities", __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
 *         return (toReal(gc), toReal(oc))
 * 
 *     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_241setHPDDMHasNeumannMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_240setHPDDMHasNeumannMat, "PC.setHPDDMHasNeumannMat(self, has: bool) -> None\nSet to indicate that the `Mat` passed to the `PC` is the local Neumann matrix.\n\n        Logically collective.\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:2566");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_241setHPDDMHasNeumannMat = {"setHPDDMHasNeumannMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_241setHPDDMHasNeumannMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_240setHPDDMHasNeumannMat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_241setHPDDMHasNeumannMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_has,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2566, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2566, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setHPDDMHasNeumannMat", 0) < (0)) __PYX_ERR(48, 2566, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setHPDDMHasNeumannMat", 1, 1, 1, i); __PYX_ERR(48, 2566, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2566, __pyx_L3_error)
    }
    __pyx_v_has = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setHPDDMHasNeumannMat", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2566, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_240setHPDDMHasNeumannMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_has);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_240setHPDDMHasNeumannMat(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2581
 * 
 *         """
 *         cdef PetscBool phas = has             # <<<<<<<<<<<<<<
 *         CHKERR(PCHPDDMHasNeumannMat(self.pc, phas))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_has); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(48, 2581, __pyx_L1_error)
  __pyx_v_phas = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2582
 *         """
 *         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, 2582, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2566
 *         return (toReal(gc), toReal(oc))
 * 
 *     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":2584
 *         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_243setHPDDMCoarseCorrectionType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_242setHPDDMCoarseCorrectionType, "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:2584");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_243setHPDDMCoarseCorrectionType = {"setHPDDMCoarseCorrectionType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_243setHPDDMCoarseCorrectionType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_242setHPDDMCoarseCorrectionType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_243setHPDDMCoarseCorrectionType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_correction_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2584, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2584, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setHPDDMCoarseCorrectionType", 0) < (0)) __PYX_ERR(48, 2584, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setHPDDMCoarseCorrectionType", 1, 1, 1, i); __PYX_ERR(48, 2584, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2584, __pyx_L3_error)
    }
    __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, 2584, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_242setHPDDMCoarseCorrectionType(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_correction_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_242setHPDDMCoarseCorrectionType(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2599
 * 
 *         """
 *         cdef PetscPCHPDDMCoarseCorrectionType ctype = correction_type             # <<<<<<<<<<<<<<
 *         CHKERR(PCHPDDMSetCoarseCorrectionType(self.pc, ctype))
 * 
*/
  __pyx_t_1 = ((PCHPDDMCoarseCorrectionType)__Pyx_PyLong_As_PCHPDDMCoarseCorrectionType(__pyx_v_correction_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2599, __pyx_L1_error)
  __pyx_v_ctype = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2600
 *         """
 *         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, 2600, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2584
 *         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":2602
 *         CHKERR(PCHPDDMSetCoarseCorrectionType(self.pc, ctype))
 * 
 *     def getHPDDMCoarseCorrectionType(self) -> HPDDMCoarseCorrectionType:             # <<<<<<<<<<<<<<
 *         """Return the coarse correction type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_245getHPDDMCoarseCorrectionType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_244getHPDDMCoarseCorrectionType, "PC.getHPDDMCoarseCorrectionType(self) -> HPDDMCoarseCorrectionType\nReturn the coarse correction type.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PCHPDDMGetCoarseCorrectionType\n\n        \nSource code at petsc4py/PETSc/PC.pyx:2602");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_245getHPDDMCoarseCorrectionType = {"getHPDDMCoarseCorrectionType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_245getHPDDMCoarseCorrectionType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_244getHPDDMCoarseCorrectionType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_245getHPDDMCoarseCorrectionType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getHPDDMCoarseCorrectionType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_244getHPDDMCoarseCorrectionType(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_244getHPDDMCoarseCorrectionType(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2612
 * 
 *         """
 *         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":2613
 *         """
 *         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, 2613, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2614
 *         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_PyLong_From_PCHPDDMCoarseCorrectionType(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PC.pyx":2602
 *         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":2616
 *         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_247getHPDDMSTShareSubKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_246getHPDDMSTShareSubKSP, "PC.getHPDDMSTShareSubKSP(self) -> bool\nReturn true if the `KSP` in SLEPc ``ST`` and the subdomain solver is shared.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PCHPDDMGetSTShareSubKSP\n\n        \nSource code at petsc4py/PETSc/PC.pyx:2616");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_247getHPDDMSTShareSubKSP = {"getHPDDMSTShareSubKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_247getHPDDMSTShareSubKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_246getHPDDMSTShareSubKSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_247getHPDDMSTShareSubKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getHPDDMSTShareSubKSP", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_246getHPDDMSTShareSubKSP(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_246getHPDDMSTShareSubKSP(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2626
 * 
 *         """
 *         cdef PetscBool cval = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(PCHPDDMGetSTShareSubKSP(self.pc, &cval))
 *         return toBool(cval)
*/
  __pyx_v_cval = PETSC_FALSE;

  /* "petsc4py/PETSc/PC.pyx":2627
 *         """
 *         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, 2627, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2628
 *         cdef PetscBool cval = PETSC_FALSE
 *         CHKERR(PCHPDDMGetSTShareSubKSP(self.pc, &cval))
 *         return toBool(cval)             # <<<<<<<<<<<<<<
 * 
 *     def setHPDDMDeflationMat(self, IS uis, Mat U) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(48, 2628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PC.pyx":2616
 *         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":2630
 *         return toBool(cval)
 * 
 *     def setHPDDMDeflationMat(self, IS uis, Mat U) -> None:             # <<<<<<<<<<<<<<
 *         """Set the deflation space used to assemble a coarse operator.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_249setHPDDMDeflationMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_248setHPDDMDeflationMat, "PC.setHPDDMDeflationMat(self, uis: IS, U: Mat) -> None\nSet the deflation space used to assemble a coarse operator.\n\n        Logically collective.\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:2630");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_249setHPDDMDeflationMat = {"setHPDDMDeflationMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_249setHPDDMDeflationMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_248setHPDDMDeflationMat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_249setHPDDMDeflationMat(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_uis,&__pyx_mstate_global->__pyx_n_u_U,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2630, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2630, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2630, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setHPDDMDeflationMat", 0) < (0)) __PYX_ERR(48, 2630, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setHPDDMDeflationMat", 1, 2, 2, i); __PYX_ERR(48, 2630, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2630, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2630, __pyx_L3_error)
    }
    __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, 2630, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "uis", 0))) __PYX_ERR(48, 2630, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_U), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "U", 0))) __PYX_ERR(48, 2630, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_248setHPDDMDeflationMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_uis, __pyx_v_U);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_248setHPDDMDeflationMat(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2647
 * 
 *         """
 *         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, 2647, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2630
 *         return toBool(cval)
 * 
 *     def setHPDDMDeflationMat(self, IS uis, Mat U) -> None:             # <<<<<<<<<<<<<<
 *         """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":2651
 *     # --- SPAI ---
 * 
 *     def setSPAIEpsilon(self, val: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the tolerance for the preconditioner.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_251setSPAIEpsilon(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_250setSPAIEpsilon, "PC.setSPAIEpsilon(self, val: float) -> None\nSet the tolerance for the preconditioner.\n\n        Logically collective.\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:2651");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_251setSPAIEpsilon = {"setSPAIEpsilon", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_251setSPAIEpsilon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_250setSPAIEpsilon};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_251setSPAIEpsilon(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_val,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2651, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2651, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSPAIEpsilon", 0) < (0)) __PYX_ERR(48, 2651, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSPAIEpsilon", 1, 1, 1, i); __PYX_ERR(48, 2651, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2651, __pyx_L3_error)
    }
    __pyx_v_val = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setSPAIEpsilon", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2651, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_250setSPAIEpsilon(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_val);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_250setSPAIEpsilon(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2666
 * 
 *         """
 *         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, 2666, __pyx_L1_error)
  __pyx_v_cval = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2667
 *         """
 *         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, 2667, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2651
 *     # --- 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":2669
 *         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_253setSPAINBSteps(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_252setSPAINBSteps, "PC.setSPAINBSteps(self, nbsteps: int) -> None\nSet the maximum number of improvement steps per row.\n\n        Logically collective.\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:2669");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_253setSPAINBSteps = {"setSPAINBSteps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_253setSPAINBSteps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_252setSPAINBSteps};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_253setSPAINBSteps(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nbsteps,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2669, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2669, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSPAINBSteps", 0) < (0)) __PYX_ERR(48, 2669, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSPAINBSteps", 1, 1, 1, i); __PYX_ERR(48, 2669, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2669, __pyx_L3_error)
    }
    __pyx_v_nbsteps = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setSPAINBSteps", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2669, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_252setSPAINBSteps(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_nbsteps);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_252setSPAINBSteps(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2684
 * 
 *         """
 *         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, 2684, __pyx_L1_error)
  __pyx_v_cval = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2685
 *         """
 *         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, 2685, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2669
 *         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":2687
 *         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_255setSPAIMax(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_254setSPAIMax, "PC.setSPAIMax(self, maxval: int) -> None\nSet the size of working buffers in the preconditioner.\n\n        Logically collective.\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:2687");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_255setSPAIMax = {"setSPAIMax", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_255setSPAIMax, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_254setSPAIMax};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_255setSPAIMax(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_maxval,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2687, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2687, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSPAIMax", 0) < (0)) __PYX_ERR(48, 2687, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSPAIMax", 1, 1, 1, i); __PYX_ERR(48, 2687, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2687, __pyx_L3_error)
    }
    __pyx_v_maxval = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setSPAIMax", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2687, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_254setSPAIMax(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_maxval);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_254setSPAIMax(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2703
 * 
 *         """
 *         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, 2703, __pyx_L1_error)
  __pyx_v_cval = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2704
 *         """
 *         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, 2704, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2687
 *         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":2706
 *         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_257setSPAIMaxNew(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_256setSPAIMaxNew, "PC.setSPAIMaxNew(self, maxval: int) -> None\nSet the maximum number of new non-zero candidates per step.\n\n        Logically collective.\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:2706");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_257setSPAIMaxNew = {"setSPAIMaxNew", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_257setSPAIMaxNew, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_256setSPAIMaxNew};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_257setSPAIMaxNew(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_maxval,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2706, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2706, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSPAIMaxNew", 0) < (0)) __PYX_ERR(48, 2706, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSPAIMaxNew", 1, 1, 1, i); __PYX_ERR(48, 2706, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2706, __pyx_L3_error)
    }
    __pyx_v_maxval = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setSPAIMaxNew", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2706, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_256setSPAIMaxNew(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_maxval);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_256setSPAIMaxNew(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2721
 * 
 *         """
 *         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, 2721, __pyx_L1_error)
  __pyx_v_cval = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2722
 *         """
 *         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, 2722, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2706
 *         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":2724
 *         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_259setSPAIBlockSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_258setSPAIBlockSize, "PC.setSPAIBlockSize(self, n: int) -> None\nSet the block size of the preconditioner.\n\n        Logically collective.\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:2724");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_259setSPAIBlockSize = {"setSPAIBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_259setSPAIBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_258setSPAIBlockSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_259setSPAIBlockSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2724, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2724, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSPAIBlockSize", 0) < (0)) __PYX_ERR(48, 2724, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSPAIBlockSize", 1, 1, 1, i); __PYX_ERR(48, 2724, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2724, __pyx_L3_error)
    }
    __pyx_v_n = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setSPAIBlockSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2724, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_258setSPAIBlockSize(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_n);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_258setSPAIBlockSize(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2739
 * 
 *         """
 *         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, 2739, __pyx_L1_error)
  __pyx_v_cval = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2740
 *         """
 *         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, 2740, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2724
 *         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":2742
 *         CHKERR(PCSPAISetBlockSize(self.pc, cval))
 * 
 *     def setSPAICacheSize(self, size: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the cache size.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_261setSPAICacheSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_260setSPAICacheSize, "PC.setSPAICacheSize(self, size: int) -> None\nSet the cache size.\n\n        Logically collective.\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:2742");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_261setSPAICacheSize = {"setSPAICacheSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_261setSPAICacheSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_260setSPAICacheSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_261setSPAICacheSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_size,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2742, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSPAICacheSize", 0) < (0)) __PYX_ERR(48, 2742, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSPAICacheSize", 1, 1, 1, i); __PYX_ERR(48, 2742, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2742, __pyx_L3_error)
    }
    __pyx_v_size = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setSPAICacheSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2742, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_260setSPAICacheSize(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_size);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_260setSPAICacheSize(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2757
 * 
 *         """
 *         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, 2757, __pyx_L1_error)
  __pyx_v_cval = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2758
 *         """
 *         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, 2758, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2742
 *         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":2760
 *         CHKERR(PCSPAISetCacheSize(self.pc, cval))
 * 
 *     def setSPAIVerbose(self, level: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the verbosity level.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_263setSPAIVerbose(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_262setSPAIVerbose, "PC.setSPAIVerbose(self, level: int) -> None\nSet the verbosity level.\n\n        Logically collective.\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:2760");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_263setSPAIVerbose = {"setSPAIVerbose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_263setSPAIVerbose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_262setSPAIVerbose};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_263setSPAIVerbose(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2760, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSPAIVerbose", 0) < (0)) __PYX_ERR(48, 2760, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSPAIVerbose", 1, 1, 1, i); __PYX_ERR(48, 2760, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2760, __pyx_L3_error)
    }
    __pyx_v_level = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setSPAIVerbose", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2760, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_262setSPAIVerbose(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_level);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_262setSPAIVerbose(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2775
 * 
 *         """
 *         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, 2775, __pyx_L1_error)
  __pyx_v_cval = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2776
 *         """
 *         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, 2776, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2760
 *         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":2778
 *         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_265setSPAISp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_264setSPAISp, "PC.setSPAISp(self, sym: int) -> None\nSet to specify a symmetric sparsity pattern.\n\n        Logically collective.\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:2778");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_265setSPAISp = {"setSPAISp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_265setSPAISp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_264setSPAISp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_265setSPAISp(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sym,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2778, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2778, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSPAISp", 0) < (0)) __PYX_ERR(48, 2778, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSPAISp", 1, 1, 1, i); __PYX_ERR(48, 2778, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2778, __pyx_L3_error)
    }
    __pyx_v_sym = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setSPAISp", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2778, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_264setSPAISp(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_sym);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_264setSPAISp(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2793
 * 
 *         """
 *         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, 2793, __pyx_L1_error)
  __pyx_v_cval = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2794
 *         """
 *         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, 2794, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2778
 *         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":2798
 *     # --- DEFLATION ---
 * 
 *     def setDeflationInitOnly(self, flg: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set to only perform the initialization.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_267setDeflationInitOnly(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_266setDeflationInitOnly, "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:2798");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_267setDeflationInitOnly = {"setDeflationInitOnly", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_267setDeflationInitOnly, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_266setDeflationInitOnly};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_267setDeflationInitOnly(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flg,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2798, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2798, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDeflationInitOnly", 0) < (0)) __PYX_ERR(48, 2798, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDeflationInitOnly", 1, 1, 1, i); __PYX_ERR(48, 2798, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2798, __pyx_L3_error)
    }
    __pyx_v_flg = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setDeflationInitOnly", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2798, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_266setDeflationInitOnly(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_flg);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_266setDeflationInitOnly(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2817
 * 
 *         """
 *         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, 2817, __pyx_L1_error)
  __pyx_v_cflg = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2818
 *         """
 *         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, 2818, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2798
 *     # --- 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":2820
 *         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_269setDeflationLevels(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_268setDeflationLevels, "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:2820");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_269setDeflationLevels = {"setDeflationLevels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_269setDeflationLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_268setDeflationLevels};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_269setDeflationLevels(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_levels,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2820, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2820, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDeflationLevels", 0) < (0)) __PYX_ERR(48, 2820, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDeflationLevels", 1, 1, 1, i); __PYX_ERR(48, 2820, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2820, __pyx_L3_error)
    }
    __pyx_v_levels = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setDeflationLevels", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2820, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_268setDeflationLevels(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_levels);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_268setDeflationLevels(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2835
 * 
 *         """
 *         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, 2835, __pyx_L1_error)
  __pyx_v_clevels = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2836
 *         """
 *         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, 2836, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2820
 *         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":2838
 *         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_271setDeflationReductionFactor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_270setDeflationReductionFactor, "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:2838");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_271setDeflationReductionFactor = {"setDeflationReductionFactor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_271setDeflationReductionFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_270setDeflationReductionFactor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_271setDeflationReductionFactor(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_red,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2838, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2838, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDeflationReductionFactor", 0) < (0)) __PYX_ERR(48, 2838, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDeflationReductionFactor", 1, 1, 1, i); __PYX_ERR(48, 2838, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2838, __pyx_L3_error)
    }
    __pyx_v_red = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setDeflationReductionFactor", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2838, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_270setDeflationReductionFactor(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_red);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_270setDeflationReductionFactor(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2853
 * 
 *         """
 *         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, 2853, __pyx_L1_error)
  __pyx_v_cred = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2854
 *         """
 *         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, 2854, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2838
 *         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":2856
 *         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_273setDeflationCorrectionFactor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_272setDeflationCorrectionFactor, "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:2856");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_273setDeflationCorrectionFactor = {"setDeflationCorrectionFactor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_273setDeflationCorrectionFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_272setDeflationCorrectionFactor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_273setDeflationCorrectionFactor(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fact,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2856, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2856, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDeflationCorrectionFactor", 0) < (0)) __PYX_ERR(48, 2856, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDeflationCorrectionFactor", 1, 1, 1, i); __PYX_ERR(48, 2856, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2856, __pyx_L3_error)
    }
    __pyx_v_fact = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setDeflationCorrectionFactor", 1, 1, 1, __pyx_nargs); __PYX_ERR(48, 2856, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_272setDeflationCorrectionFactor(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_fact);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_272setDeflationCorrectionFactor(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_fact) {
  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", 0);

  /* "petsc4py/PETSc/PC.pyx":2871
 * 
 *         """
 *         cdef PetscScalar cfact = asScalar(fact)             # <<<<<<<<<<<<<<
 *         CHKERR(PCDeflationSetCorrectionFactor(self.pc, cfact))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asScalar(__pyx_v_fact); if (unlikely(__PYX_CHECK_FLOAT_EXCEPTION(__pyx_t_1, ((PetscScalar)((PetscScalar)(-1.0)))) && PyErr_Occurred())) __PYX_ERR(48, 2871, __pyx_L1_error)
  __pyx_v_cfact = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2872
 *         """
 *         cdef PetscScalar cfact = asScalar(fact)
 *         CHKERR(PCDeflationSetCorrectionFactor(self.pc, cfact))             # <<<<<<<<<<<<<<
 * 
 *     def setDeflationSpaceToCompute(self, space_type: DeflationSpaceType, size: int) -> None:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationSetCorrectionFactor(__pyx_v_self->pc, __pyx_v_cfact)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2872, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2856
 *         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":2874
 *         CHKERR(PCDeflationSetCorrectionFactor(self.pc, cfact))
 * 
 *     def setDeflationSpaceToCompute(self, space_type: DeflationSpaceType, size: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the deflation space type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_275setDeflationSpaceToCompute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_274setDeflationSpaceToCompute, "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:2874");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_275setDeflationSpaceToCompute = {"setDeflationSpaceToCompute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_275setDeflationSpaceToCompute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_274setDeflationSpaceToCompute};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_275setDeflationSpaceToCompute(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_space_type,&__pyx_mstate_global->__pyx_n_u_size,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2874, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2874, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2874, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDeflationSpaceToCompute", 0) < (0)) __PYX_ERR(48, 2874, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDeflationSpaceToCompute", 1, 2, 2, i); __PYX_ERR(48, 2874, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2874, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2874, __pyx_L3_error)
    }
    __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, 2874, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_274setDeflationSpaceToCompute(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_space_type, __pyx_v_size);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_274setDeflationSpaceToCompute(struct PyPetscPCObject *__pyx_v_self, PyObject *__pyx_v_space_type, PyObject *__pyx_v_size) {
  PetscInt __pyx_v_csize;
  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", 0);

  /* "petsc4py/PETSc/PC.pyx":2891
 * 
 *         """
 *         cdef PetscInt csize = asInt(size)             # <<<<<<<<<<<<<<
 *         cdef PetscPCDeflationSpaceType ctype = space_type
 *         CHKERR(PCDeflationSetSpaceToCompute(self.pc, ctype, csize))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_size); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(48, 2891, __pyx_L1_error)
  __pyx_v_csize = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2892
 *         """
 *         cdef PetscInt csize = asInt(size)
 *         cdef PetscPCDeflationSpaceType ctype = space_type             # <<<<<<<<<<<<<<
 *         CHKERR(PCDeflationSetSpaceToCompute(self.pc, ctype, csize))
 * 
*/
  __pyx_t_2 = ((PCDeflationSpaceType)__Pyx_PyLong_As_PCDeflationSpaceType(__pyx_v_space_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(48, 2892, __pyx_L1_error)
  __pyx_v_ctype = __pyx_t_2;

  /* "petsc4py/PETSc/PC.pyx":2893
 *         cdef PetscInt csize = asInt(size)
 *         cdef PetscPCDeflationSpaceType ctype = space_type
 *         CHKERR(PCDeflationSetSpaceToCompute(self.pc, ctype, csize))             # <<<<<<<<<<<<<<
 * 
 *     def setDeflationSpace(self, Mat W, transpose: bool) -> None:
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationSetSpaceToCompute(__pyx_v_self->pc, __pyx_v_ctype, __pyx_v_csize)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2893, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2874
 *         CHKERR(PCDeflationSetCorrectionFactor(self.pc, cfact))
 * 
 *     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":2895
 *         CHKERR(PCDeflationSetSpaceToCompute(self.pc, ctype, 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_277setDeflationSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_276setDeflationSpace, "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:2895");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_277setDeflationSpace = {"setDeflationSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_277setDeflationSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_276setDeflationSpace};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_277setDeflationSpace(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_W,&__pyx_mstate_global->__pyx_n_u_transpose,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2895, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2895, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2895, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDeflationSpace", 0) < (0)) __PYX_ERR(48, 2895, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDeflationSpace", 1, 2, 2, i); __PYX_ERR(48, 2895, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2895, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(48, 2895, __pyx_L3_error)
    }
    __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, 2895, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "W", 0))) __PYX_ERR(48, 2895, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_276setDeflationSpace(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_W, __pyx_v_transpose);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_276setDeflationSpace(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2913
 * 
 *         """
 *         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, 2913, __pyx_L1_error)
  __pyx_v_ctranspose = __pyx_t_1;

  /* "petsc4py/PETSc/PC.pyx":2914
 *         """
 *         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, 2914, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2895
 *         CHKERR(PCDeflationSetSpaceToCompute(self.pc, ctype, 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":2916
 *         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_279setDeflationProjectionNullSpaceMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_278setDeflationProjectionNullSpaceMat, "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:2916");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_279setDeflationProjectionNullSpaceMat = {"setDeflationProjectionNullSpaceMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_279setDeflationProjectionNullSpaceMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_278setDeflationProjectionNullSpaceMat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_279setDeflationProjectionNullSpaceMat(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2916, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2916, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDeflationProjectionNullSpaceMat", 0) < (0)) __PYX_ERR(48, 2916, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDeflationProjectionNullSpaceMat", 1, 1, 1, i); __PYX_ERR(48, 2916, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2916, __pyx_L3_error)
    }
    __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, 2916, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(48, 2916, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_278setDeflationProjectionNullSpaceMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_278setDeflationProjectionNullSpaceMat(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2931
 * 
 *         """
 *         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, 2931, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2916
 *         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":2933
 *         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_281setDeflationCoarseMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_280setDeflationCoarseMat, "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:2933");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_281setDeflationCoarseMat = {"setDeflationCoarseMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_281setDeflationCoarseMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_280setDeflationCoarseMat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_281setDeflationCoarseMat(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(48, 2933, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2933, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDeflationCoarseMat", 0) < (0)) __PYX_ERR(48, 2933, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDeflationCoarseMat", 1, 1, 1, i); __PYX_ERR(48, 2933, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(48, 2933, __pyx_L3_error)
    }
    __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, 2933, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(48, 2933, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_280setDeflationCoarseMat(((struct PyPetscPCObject *)__pyx_v_self), __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_280setDeflationCoarseMat(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", 0);

  /* "petsc4py/PETSc/PC.pyx":2948
 * 
 *         """
 *         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, 2948, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2933
 *         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":2950
 *         CHKERR(PCDeflationSetCoarseMat(self.pc, mat.mat))
 * 
 *     def getDeflationCoarseKSP(self) -> KSP:             # <<<<<<<<<<<<<<
 *         """Return the coarse problem `KSP`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_283getDeflationCoarseKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_282getDeflationCoarseKSP, "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:2950");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_283getDeflationCoarseKSP = {"getDeflationCoarseKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_283getDeflationCoarseKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_282getDeflationCoarseKSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_283getDeflationCoarseKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDeflationCoarseKSP", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_282getDeflationCoarseKSP(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_282getDeflationCoarseKSP(struct PyPetscPCObject *__pyx_v_self) {
  struct PyPetscKSPObject *__pyx_v_ksp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDeflationCoarseKSP", 0);

  /* "petsc4py/PETSc/PC.pyx":2960
 * 
 *         """
 *         cdef KSP ksp = KSP()             # <<<<<<<<<<<<<<
 *         CHKERR(PCDeflationGetCoarseKSP(self.pc, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2960, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/PC.pyx":2961
 *         """
 *         cdef KSP ksp = KSP()
 *         CHKERR(PCDeflationGetCoarseKSP(self.pc, &ksp.ksp))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(ksp.obj))
 *         return ksp
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationGetCoarseKSP(__pyx_v_self->pc, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2961, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2962
 *         cdef KSP ksp = KSP()
 *         CHKERR(PCDeflationGetCoarseKSP(self.pc, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))             # <<<<<<<<<<<<<<
 *         return ksp
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2962, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2963
 *         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":2950
 *         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_XDECREF(__pyx_t_2);
  __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":2965
 *         return ksp
 * 
 *     def getDeflationPC(self) -> PC:             # <<<<<<<<<<<<<<
 *         """Return the additional preconditioner.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_285getDeflationPC(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_284getDeflationPC, "PC.getDeflationPC(self) -> PC\nReturn the additional preconditioner.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PCDeflationGetPC\n\n        \nSource code at petsc4py/PETSc/PC.pyx:2965");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2PC_285getDeflationPC = {"getDeflationPC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_285getDeflationPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_284getDeflationPC};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2PC_285getDeflationPC(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDeflationPC", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2PC_284getDeflationPC(((struct PyPetscPCObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2PC_284getDeflationPC(struct PyPetscPCObject *__pyx_v_self) {
  struct PyPetscPCObject *__pyx_v_apc = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDeflationPC", 0);

  /* "petsc4py/PETSc/PC.pyx":2975
 * 
 *         """
 *         cdef PC apc = PC()             # <<<<<<<<<<<<<<
 *         CHKERR(PCDeflationGetPC(self.pc, &apc.pc))
 *         CHKERR(PetscINCREF(apc.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 2975, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_apc = ((struct PyPetscPCObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/PC.pyx":2976
 *         """
 *         cdef PC apc = PC()
 *         CHKERR(PCDeflationGetPC(self.pc, &apc.pc))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(apc.obj))
 *         return apc
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCDeflationGetPC(__pyx_v_self->pc, (&__pyx_v_apc->pc))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2976, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2977
 *         cdef PC apc = PC()
 *         CHKERR(PCDeflationGetPC(self.pc, &apc.pc))
 *         CHKERR(PetscINCREF(apc.obj))             # <<<<<<<<<<<<<<
 *         return apc
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_apc->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(48, 2977, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2978
 *         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":2965
 *         return ksp
 * 
 *     def getDeflationPC(self) -> PC:             # <<<<<<<<<<<<<<
 *         """Return the additional preconditioner.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":403
 *     # --- xxx ---
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":404
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.ksp             # <<<<<<<<<<<<<<
 *         self.ksp = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->ksp));

  /* "petsc4py/PETSc/KSP.pyx":405
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.ksp
 *         self.ksp = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self, Vec b, Vec x = None) -> Vec:
*/
  __pyx_v_self->ksp = NULL;

  /* "petsc4py/PETSc/KSP.pyx":403
 *     # --- xxx ---
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.ksp
 *         self.ksp = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/KSP.pyx":407
 *         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_SIZE
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_b,&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 407, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < (0)) __PYX_ERR(49, 407, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 0, 1, 2, i); __PYX_ERR(49, 407, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 407, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 407, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(49, 407, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(49, 407, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  size_t __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":428
 * 
 *         """
 *         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":429
 *         """
 *         if x is None: # XXX do this better
 *             x = self.getOperators()[0].createVecLeft()             # <<<<<<<<<<<<<<
 *         self.solve(b, x)
 *         return x
*/
    __pyx_t_5 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getOperators, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 429, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_createVecLeft, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 429, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(49, 429, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_x, ((struct PyPetscVecObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/KSP.pyx":428
 * 
 *         """
 *         if x is None: # XXX do this better             # <<<<<<<<<<<<<<
 *             x = self.getOperators()[0].createVecLeft()
 *         self.solve(b, x)
*/
  }

  /* "petsc4py/PETSc/KSP.pyx":430
 *         if x is None: # XXX do this better
 *             x = self.getOperators()[0].createVecLeft()
 *         self.solve(b, x)             # <<<<<<<<<<<<<<
 *         return x
 * 
*/
  __pyx_t_5 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = 0;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_5, ((PyObject *)__pyx_v_b), ((PyObject *)__pyx_v_x)};
    __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_solve, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/KSP.pyx":431
 *             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":407
 *         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":435
 *     # --- 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:435");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_5view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_4view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 435, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 435, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(49, 435, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 435, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 435, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(49, 435, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/KSP.pyx":450
 * 
 *         """
 *         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":451
 *         """
 *         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":452
 *         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, 452, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":435
 *     # --- 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":454
 *         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:454");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_7destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_6destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/KSP.pyx":464
 * 
 *         """
 *         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, 464, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":465
 *         """
 *         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":454
 *         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":467
 *         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:467");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_9create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_8create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 467, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 467, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(49, 467, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 467, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(49, 467, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":477
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(49, 477, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":478
 *         """
 *         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":479
 *         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, 479, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":480
 *         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, 480, __pyx_L1_error)
  __pyx_v_self->ksp = __pyx_v_newksp;

  /* "petsc4py/PETSc/KSP.pyx":481
 *         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":467
 *         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":483
 *         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:483");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_11setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_10setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ksp_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 483, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 483, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(49, 483, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(49, 483, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 483, __pyx_L3_error)
    }
    __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, 483, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":515
 * 
 *         """
 *         cdef PetscKSPType cval = NULL             # <<<<<<<<<<<<<<
 *         ksp_type = str2bytes(ksp_type, &cval)
 *         CHKERR(KSPSetType(self.ksp, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/KSP.pyx":516
 *         """
 *         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, 516, __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":517
 *         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, 517, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":483
 *         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":519
 *         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:519");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_13getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_12getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/KSP.pyx":529
 * 
 *         """
 *         cdef PetscKSPType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(KSPGetType(self.ksp, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/KSP.pyx":530
 *         """
 *         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, 530, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":531
 *         cdef PetscKSPType cval = NULL
 *         CHKERR(KSPGetType(self.ksp, &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":519
 *         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":533
 *         return bytes2str(cval)
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> 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) -> 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:533");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_15setOptionsPrefix = {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_15setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_14setOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 533, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 533, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOptionsPrefix", 0) < (0)) __PYX_ERR(49, 533, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, i); __PYX_ERR(49, 533, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 533, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 533, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":567
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(KSPSetOptionsPrefix(self.ksp, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/KSP.pyx":568
 *         """
 *         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, 568, __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":569
 *         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, 569, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":533
 *         return bytes2str(cval)
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> 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":571
 *         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:571");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_17getOptionsPrefix = {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_17getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_16getOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOptionsPrefix", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/KSP.pyx":581
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(KSPGetOptionsPrefix(self.ksp, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/KSP.pyx":582
 *         """
 *         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, 582, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":583
 *         cdef const char *cval = NULL
 *         CHKERR(KSPGetOptionsPrefix(self.ksp, &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":571
 *         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":585
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> 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) -> 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:585");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_19appendOptionsPrefix = {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_19appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_18appendOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 585, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 585, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "appendOptionsPrefix", 0) < (0)) __PYX_ERR(49, 585, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, i); __PYX_ERR(49, 585, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 585, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 585, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":606
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(KSPAppendOptionsPrefix(self.ksp, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/KSP.pyx":607
 *         """
 *         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, 607, __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":608
 *         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, 608, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":585
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> 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":610
 *         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:610");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_21setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_21setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_20setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/KSP.pyx":623
 * 
 *         """
 *         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, 623, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":610
 *         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":627
 *     # --- 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:627");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_23setAppCtx = {"setAppCtx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_23setAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_22setAppCtx};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_appctx,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 627, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 627, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setAppCtx", 0) < (0)) __PYX_ERR(49, 627, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, i); __PYX_ERR(49, 627, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 627, __pyx_L3_error)
    }
    __pyx_v_appctx = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 627, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":648
 * 
 *         """
 *         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, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":627
 *     # --- 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":650
 *         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:650");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_25getAppCtx = {"getAppCtx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_25getAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_24getAppCtx};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getAppCtx", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/KSP.pyx":660
 * 
 *         """
 *         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, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":650
 *         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":664
 *     # --- 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:664");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_27getDM = {"getDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_27getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_26getDM};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDM", __pyx_kwds); 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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDM", 0);

  /* "petsc4py/PETSc/KSP.pyx":674
 * 
 *         """
 *         cdef PetscDM newdm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(KSPGetDM(self.ksp, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()
*/
  __pyx_v_newdm = NULL;

  /* "petsc4py/PETSc/KSP.pyx":675
 *         """
 *         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, 675, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":676
 *         cdef PetscDM newdm = NULL
 *         CHKERR(KSPGetDM(self.ksp, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()             # <<<<<<<<<<<<<<
 *         dm.dm = newdm
 *         CHKERR(PetscINCREF(dm.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(49, 676, __pyx_L1_error)
  __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/KSP.pyx":677
 *         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":678
 *         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, 678, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":679
 *         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":664
 *     # --- 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_XDECREF(__pyx_t_4);
  __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":681
 *         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\n        ``setDMActive(KSP.DMActive.OPERATOR, 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:681");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_29setDM = {"setDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_29setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_28setDM};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 681, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 681, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDM", 0) < (0)) __PYX_ERR(49, 681, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, i); __PYX_ERR(49, 681, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 681, __pyx_L3_error)
    }
    __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, 681, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(49, 681, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/KSP.pyx":713
 * 
 *         """
 *         CHKERR(KSPSetDM(self.ksp, dm.dm))             # <<<<<<<<<<<<<<
 * 
 *     def setDMActive(self, dmactive: DMActive, 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, 713, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":681
 *         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":715
 *         CHKERR(KSPSetDM(self.ksp, dm.dm))
 * 
 *     def setDMActive(self, dmactive: DMActive, 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, dmactive: DMActive, 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(KSP.DMactive.ALL, 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:715");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_31setDMActive = {"setDMActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_31setDMActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_30setDMActive};
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_dmactive = 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("setDMActive (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dmactive,&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 715, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 715, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 715, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDMActive", 0) < (0)) __PYX_ERR(49, 715, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDMActive", 1, 2, 2, i); __PYX_ERR(49, 715, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 715, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 715, __pyx_L3_error)
    }
    __pyx_v_dmactive = values[0];
    __pyx_v_flag = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setDMActive", 1, 2, 2, __pyx_nargs); __PYX_ERR(49, 715, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_dmactive, __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_30setDMActive(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_dmactive, PyObject *__pyx_v_flag) {
  PetscBool __pyx_v_cflag;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscBool __pyx_t_1;
  KSPDMActive __pyx_t_2;
  PetscErrorCode __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setDMActive", 0);

  /* "petsc4py/PETSc/KSP.pyx":736
 * 
 *         """
 *         cdef PetscBool cflag = asBool(flag)             # <<<<<<<<<<<<<<
 *         CHKERR(KSPSetDMActive(self.ksp, dmactive, 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, 736, __pyx_L1_error)
  __pyx_v_cflag = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":737
 *         """
 *         cdef PetscBool cflag = asBool(flag)
 *         CHKERR(KSPSetDMActive(self.ksp, dmactive, cflag))             # <<<<<<<<<<<<<<
 * 
 *     # --- operators and preconditioner ---
*/
  __pyx_t_2 = ((KSPDMActive)__Pyx_PyLong_As_KSPDMActive(__pyx_v_dmactive)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 737, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetDMActive(__pyx_v_self->ksp, __pyx_t_2, __pyx_v_cflag)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 737, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":715
 *         CHKERR(KSPSetDM(self.ksp, dm.dm))
 * 
 *     def setDMActive(self, dmactive: DMActive, 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":741
 *     # --- 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:741");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_33setComputeRHS = {"setComputeRHS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_33setComputeRHS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_32setComputeRHS};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rhs,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 741, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(49, 741, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 741, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 741, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setComputeRHS", 0) < (0)) __PYX_ERR(49, 741, __pyx_L3_error)

      /* "petsc4py/PETSc/KSP.pyx":744
 *         self,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":745
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setComputeRHS", 0, 1, 3, i); __PYX_ERR(49, 741, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(49, 741, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 741, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 741, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/KSP.pyx":744
 *         self,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":745
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 741, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":741
 *     # --- operators and preconditioner ---
 * 
 *     def setComputeRHS(             # <<<<<<<<<<<<<<
 *         self,
 *         rhs: KSPRHSFunction,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":769
 * 
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/KSP.pyx":770
 *         """
 *         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, 770, __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":771
 *         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, <void*>context))
*/
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 771, __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) != (0)) __PYX_ERR(49, 771, __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) != (0)) __PYX_ERR(49, 771, __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) != (0)) __PYX_ERR(49, 771, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/KSP.pyx":772
 *         if kargs is None: kargs = {}
 *         context = (rhs, args, kargs)
 *         self.set_attr('__rhs__', context)             # <<<<<<<<<<<<<<
 *         CHKERR(KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, <void*>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, 772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/KSP.pyx":773
 *         context = (rhs, args, kargs)
 *         self.set_attr('__rhs__', context)
 *         CHKERR(KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, <void*>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, 773, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":741
 *     # --- 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":775
 *         CHKERR(KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, <void*>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:775");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_35setComputeOperators = {"setComputeOperators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_35setComputeOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_34setComputeOperators};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_operators,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 775, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(49, 775, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 775, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 775, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setComputeOperators", 0) < (0)) __PYX_ERR(49, 775, __pyx_L3_error)

      /* "petsc4py/PETSc/KSP.pyx":778
 *         self,
 *         operators: KSPOperatorsFunction,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 *         """Set routine to compute the linear operators.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":779
 *         operators: KSPOperatorsFunction,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set routine to compute the linear operators.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setComputeOperators", 0, 1, 3, i); __PYX_ERR(49, 775, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(49, 775, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 775, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 775, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/KSP.pyx":778
 *         self,
 *         operators: KSPOperatorsFunction,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 *         """Set routine to compute the linear operators.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":779
 *         operators: KSPOperatorsFunction,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set routine to compute the linear operators.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 775, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":775
 *         CHKERR(KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, <void*>context))
 * 
 *     def setComputeOperators(             # <<<<<<<<<<<<<<
 *         self,
 *         operators: KSPOperatorsFunction,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":814
 * 
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/KSP.pyx":815
 *         """
 *         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, 815, __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":816
 *         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, <void*>context))
*/
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 816, __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) != (0)) __PYX_ERR(49, 816, __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) != (0)) __PYX_ERR(49, 816, __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) != (0)) __PYX_ERR(49, 816, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/KSP.pyx":817
 *         if kargs is None: kargs = {}
 *         context = (operators, args, kargs)
 *         self.set_attr('__operators__', context)             # <<<<<<<<<<<<<<
 *         CHKERR(KSPSetComputeOperators(self.ksp, KSP_ComputeOps, <void*>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, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/KSP.pyx":818
 *         context = (operators, args, kargs)
 *         self.set_attr('__operators__', context)
 *         CHKERR(KSPSetComputeOperators(self.ksp, KSP_ComputeOps, <void*>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, 818, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":775
 *         CHKERR(KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, <void*>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":820
 *         CHKERR(KSPSetComputeOperators(self.ksp, KSP_ComputeOps, <void*>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        This is equivalent to ``pc = ksp.getPC(); pc.setOperators(A, P)``\n        but is the preferred approach.\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:820");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_37setOperators = {"setOperators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_37setOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_36setOperators};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_P,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 820, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 820, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 820, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOperators", 0) < (0)) __PYX_ERR(49, 820, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 820, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 820, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 820, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(49, 820, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(49, 820, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/KSP.pyx":858
 * 
 *         """
 *         cdef PetscMat amat=NULL             # <<<<<<<<<<<<<<
 *         if A is not None: amat = A.mat
 *         cdef PetscMat pmat=amat
*/
  __pyx_v_amat = NULL;

  /* "petsc4py/PETSc/KSP.pyx":859
 *         """
 *         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":860
 *         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":861
 *         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":862
 *         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, 862, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":820
 *         CHKERR(KSPSetComputeOperators(self.ksp, KSP_ComputeOps, <void*>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":864
 *         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:864");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_39getOperators = {"getOperators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_39getOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_38getOperators};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOperators", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getOperators", 0);

  /* "petsc4py/PETSc/KSP.pyx":885
 * 
 *         """
 *         cdef Mat A = Mat(), P = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(KSPGetOperators(self.ksp, &A.mat, &P.mat))
 *         CHKERR(PetscINCREF(A.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 885, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_A = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 885, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":886
 *         """
 *         cdef Mat A = Mat(), P = Mat()
 *         CHKERR(KSPGetOperators(self.ksp, &A.mat, &P.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(A.obj))
 *         CHKERR(PetscINCREF(P.obj))
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetOperators(__pyx_v_self->ksp, (&__pyx_v_A->mat), (&__pyx_v_P->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 886, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":887
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_A->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 887, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":888
 *         CHKERR(KSPGetOperators(self.ksp, &A.mat, &P.mat))
 *         CHKERR(PetscINCREF(A.obj))
 *         CHKERR(PetscINCREF(P.obj))             # <<<<<<<<<<<<<<
 *         return (A, P)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 888, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":889
 *         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, 889, __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)) != (0)) __PYX_ERR(49, 889, __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)) != (0)) __PYX_ERR(49, 889, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":864
 *         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_XDECREF(__pyx_t_2);
  __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":891
 *         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:891");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_41setPC = {"setPC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_41setPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_40setPC};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 891, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 891, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPC", 0) < (0)) __PYX_ERR(49, 891, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPC", 1, 1, 1, i); __PYX_ERR(49, 891, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 891, __pyx_L3_error)
    }
    __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, 891, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, 0, "pc", 0))) __PYX_ERR(49, 891, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/KSP.pyx":909
 * 
 *         """
 *         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, 909, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":891
 *         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":911
 *         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:911");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_43getPC = {"getPC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_43getPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_42getPC};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPC", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getPC", 0);

  /* "petsc4py/PETSc/KSP.pyx":921
 * 
 *         """
 *         cdef PC pc = PC()             # <<<<<<<<<<<<<<
 *         CHKERR(KSPGetPC(self.ksp, &pc.pc))
 *         CHKERR(PetscINCREF(pc.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 921, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_pc = ((struct PyPetscPCObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":922
 *         """
 *         cdef PC pc = PC()
 *         CHKERR(KSPGetPC(self.ksp, &pc.pc))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(pc.obj))
 *         return pc
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetPC(__pyx_v_self->ksp, (&__pyx_v_pc->pc))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 922, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":923
 *         cdef PC pc = PC()
 *         CHKERR(KSPGetPC(self.ksp, &pc.pc))
 *         CHKERR(PetscINCREF(pc.obj))             # <<<<<<<<<<<<<<
 *         return pc
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_pc->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 923, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":924
 *         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":911
 *         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_XDECREF(__pyx_t_2);
  __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":928
 *     # --- 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            Or `DETERMINE` to use the value when\n            the object's type was set.\n        atol\n            The absolute convergence tolerance absolute size of the\n            (possibly preconditioned) residual norm.\n            Or `DETERMINE` to use the value when\n            the object's type was set.\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            Or `DETERMINE` to use the value when\n            the object's type was set.\n        max_it\n            Maximum number of iterations to use.\n            Or `DETERMINE` to use the value when\n            the object's type was set.\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:928");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_45setTolerances = {"setTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_45setTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_44setTolerances};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rtol,&__pyx_mstate_global->__pyx_n_u_atol,&__pyx_mstate_global->__pyx_n_u_divtol,&__pyx_mstate_global->__pyx_n_u_max_it,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 928, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(49, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(49, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTolerances", 0) < (0)) __PYX_ERR(49, 928, __pyx_L3_error)

      /* "petsc4py/PETSc/KSP.pyx":930
 *     def setTolerances(
 *         self,
 *         rtol: float | None = None,             # <<<<<<<<<<<<<<
 *         atol: float | None = None,
 *         divtol: float | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":931
 *         self,
 *         rtol: float | None = None,
 *         atol: float | None = None,             # <<<<<<<<<<<<<<
 *         divtol: float | None = None,
 *         max_it: int | None = None) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":932
 *         rtol: float | None = None,
 *         atol: float | None = None,
 *         divtol: float | None = None,             # <<<<<<<<<<<<<<
 *         max_it: int | None = None) -> None:
 *         """Set various tolerances used by the KSP convergence testers.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":933
 *         atol: float | None = None,
 *         divtol: float | None = None,
 *         max_it: int | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set various tolerances used by the KSP convergence testers.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(49, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(49, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/KSP.pyx":930
 *     def setTolerances(
 *         self,
 *         rtol: float | None = None,             # <<<<<<<<<<<<<<
 *         atol: float | None = None,
 *         divtol: float | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":931
 *         self,
 *         rtol: float | None = None,
 *         atol: float | None = None,             # <<<<<<<<<<<<<<
 *         divtol: float | None = None,
 *         max_it: int | None = None) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":932
 *         rtol: float | None = None,
 *         atol: float | None = None,
 *         divtol: float | None = None,             # <<<<<<<<<<<<<<
 *         max_it: int | None = None) -> None:
 *         """Set various tolerances used by the KSP convergence testers.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":933
 *         atol: float | None = None,
 *         divtol: float | None = None,
 *         max_it: int | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set various tolerances used by the KSP convergence testers.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 928, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":928
 *     # --- tolerances and convergence ---
 * 
 *     def setTolerances(             # <<<<<<<<<<<<<<
 *         self,
 *         rtol: float | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":977
 *         """
 *         cdef PetscReal crtol, catol, cdivtol
 *         crtol = catol = cdivtol = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         if rtol   is not None: crtol   = asReal(rtol)
 *         if atol   is not None: catol   = asReal(atol)
*/
  __pyx_v_crtol = PETSC_CURRENT;
  __pyx_v_catol = PETSC_CURRENT;
  __pyx_v_cdivtol = PETSC_CURRENT;

  /* "petsc4py/PETSc/KSP.pyx":978
 *         cdef PetscReal crtol, catol, cdivtol
 *         crtol = catol = cdivtol = PETSC_CURRENT
 *         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, 978, __pyx_L1_error)
    __pyx_v_crtol = __pyx_t_2;
  }

  /* "petsc4py/PETSc/KSP.pyx":979
 *         crtol = catol = cdivtol = PETSC_CURRENT
 *         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_CURRENT
*/
  __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, 979, __pyx_L1_error)
    __pyx_v_catol = __pyx_t_2;
  }

  /* "petsc4py/PETSc/KSP.pyx":980
 *         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_CURRENT
 *         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, 980, __pyx_L1_error)
    __pyx_v_cdivtol = __pyx_t_2;
  }

  /* "petsc4py/PETSc/KSP.pyx":981
 *         if atol   is not None: catol   = asReal(atol)
 *         if divtol is not None: cdivtol = asReal(divtol)
 *         cdef PetscInt cmaxits = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         if max_it is not None: cmaxits = asInt(max_it)
 *         CHKERR(KSPSetTolerances(self.ksp, crtol, catol, cdivtol, cmaxits))
*/
  __pyx_v_cmaxits = PETSC_CURRENT;

  /* "petsc4py/PETSc/KSP.pyx":982
 *         if divtol is not None: cdivtol = asReal(divtol)
 *         cdef PetscInt cmaxits = PETSC_CURRENT
 *         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, 982, __pyx_L1_error)
    __pyx_v_cmaxits = __pyx_t_3;
  }

  /* "petsc4py/PETSc/KSP.pyx":983
 *         cdef PetscInt cmaxits = PETSC_CURRENT
 *         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, 983, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":928
 *     # --- 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":985
 *         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:985");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_47getTolerances = {"getTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_47getTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_46getTolerances};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTolerances", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1009
 * 
 *         """
 *         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":1010
 *         """
 *         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":1011
 *         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, 1011, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1012
 *         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, 1012, __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, 1012, __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, 1012, __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, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(49, 1012, __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) != (0)) __PYX_ERR(49, 1012, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3) != (0)) __PYX_ERR(49, 1012, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4) != (0)) __PYX_ERR(49, 1012, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5) != (0)) __PYX_ERR(49, 1012, __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":985
 *         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":1014
 *         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 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        See Also\n        --------\n        addConvergenceTest, ConvergedReason, setTolerances,\n        getConvergenceTest, buildResidual,\n        petsc.KSPSetConvergenceTest, petsc.KSPConvergedDefault\n\n        \nSource code at petsc4py/PETSc/KSP.pyx:1014");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_49setConvergenceTest = {"setConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_49setConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_48setConvergenceTest};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_converged,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1014, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(49, 1014, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1014, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1014, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setConvergenceTest", 0) < (0)) __PYX_ERR(49, 1014, __pyx_L3_error)

      /* "petsc4py/PETSc/KSP.pyx":1017
 *         self,
 *         converged: KSPConvergenceTestFunction,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 *         """Set the function to be used to determine convergence.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":1018
 *         converged: KSPConvergenceTestFunction,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function to be used to determine convergence.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setConvergenceTest", 0, 1, 3, i); __PYX_ERR(49, 1014, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(49, 1014, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1014, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1014, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/KSP.pyx":1017
 *         self,
 *         converged: KSPConvergenceTestFunction,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 *         """Set the function to be used to determine convergence.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":1018
 *         converged: KSPConvergenceTestFunction,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function to be used to determine convergence.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1014, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":1014
 *         return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits))
 * 
 *     def setConvergenceTest(             # <<<<<<<<<<<<<<
 *         self,
 *         converged: KSPConvergenceTestFunction,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PetscBool __pyx_v_islsqr;
  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":1049
 * 
 *         """
 *         cdef PetscKSPNormType normtype = KSP_NORM_NONE             # <<<<<<<<<<<<<<
 *         cdef void* cctx = NULL
 *         cdef PetscBool islsqr = PETSC_FALSE
*/
  __pyx_v_normtype = KSP_NORM_NONE;

  /* "petsc4py/PETSc/KSP.pyx":1050
 *         """
 *         cdef PetscKSPNormType normtype = KSP_NORM_NONE
 *         cdef void* cctx = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscBool islsqr = PETSC_FALSE
 *         if converged is not None:
*/
  __pyx_v_cctx = NULL;

  /* "petsc4py/PETSc/KSP.pyx":1051
 *         cdef PetscKSPNormType normtype = KSP_NORM_NONE
 *         cdef void* cctx = NULL
 *         cdef PetscBool islsqr = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         if converged is not None:
 *             CHKERR(KSPSetConvergenceTest(
*/
  __pyx_v_islsqr = PETSC_FALSE;

  /* "petsc4py/PETSc/KSP.pyx":1052
 *         cdef void* cctx = NULL
 *         cdef PetscBool islsqr = PETSC_FALSE
 *         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":1053
 *         cdef PetscBool islsqr = PETSC_FALSE
 *         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, 1053, __pyx_L1_error)

    /* "petsc4py/PETSc/KSP.pyx":1055
 *             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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/KSP.pyx":1056
 *                     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, 1056, __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":1057
 *             if args is None: args = ()
 *             if kargs is None: kargs = {}
 *             self.set_attr('__converged__', (converged, args, kargs))             # <<<<<<<<<<<<<<
 *         else:
 *             # this is wrong in general, since different KSP may use
*/
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(49, 1057, __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) != (0)) __PYX_ERR(49, 1057, __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) != (0)) __PYX_ERR(49, 1057, __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) != (0)) __PYX_ERR(49, 1057, __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, 1057, __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":1052
 *         cdef void* cctx = NULL
 *         cdef PetscBool islsqr = PETSC_FALSE
 *         if converged is not None:             # <<<<<<<<<<<<<<
 *             CHKERR(KSPSetConvergenceTest(
 *                     self.ksp, KSP_Converged, NULL, NULL))
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/KSP.pyx":1063
 *             # Now we handle LSQR explicitly, but a proper mechanism,
 *             # say KSPGetDefaultConverged would be more appropriate
 *             CHKERR(KSPGetNormType(self.ksp, &normtype))             # <<<<<<<<<<<<<<
 *             if normtype != KSP_NORM_NONE:
 *                 CHKERR(PetscObjectTypeCompare(<PetscObject>self.ksp,
*/
  /*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, 1063, __pyx_L1_error)

    /* "petsc4py/PETSc/KSP.pyx":1064
 *             # say KSPGetDefaultConverged would be more appropriate
 *             CHKERR(KSPGetNormType(self.ksp, &normtype))
 *             if normtype != KSP_NORM_NONE:             # <<<<<<<<<<<<<<
 *                 CHKERR(PetscObjectTypeCompare(<PetscObject>self.ksp,
 *                                               KSPLSQR,  &islsqr))
*/
    __pyx_t_1 = (__pyx_v_normtype != KSP_NORM_NONE);
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/KSP.pyx":1065
 *             CHKERR(KSPGetNormType(self.ksp, &normtype))
 *             if normtype != KSP_NORM_NONE:
 *                 CHKERR(PetscObjectTypeCompare(<PetscObject>self.ksp,             # <<<<<<<<<<<<<<
 *                                               KSPLSQR,  &islsqr))
 *                 CHKERR(KSPConvergedDefaultCreate(&cctx))
*/
      __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectTypeCompare(((PetscObject)__pyx_v_self->ksp), KSPLSQR, (&__pyx_v_islsqr))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1065, __pyx_L1_error)

      /* "petsc4py/PETSc/KSP.pyx":1067
 *                 CHKERR(PetscObjectTypeCompare(<PetscObject>self.ksp,
 *                                               KSPLSQR,  &islsqr))
 *                 CHKERR(KSPConvergedDefaultCreate(&cctx))             # <<<<<<<<<<<<<<
 *                 if not islsqr:
 *                     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, 1067, __pyx_L1_error)

      /* "petsc4py/PETSc/KSP.pyx":1068
 *                                               KSPLSQR,  &islsqr))
 *                 CHKERR(KSPConvergedDefaultCreate(&cctx))
 *                 if not islsqr:             # <<<<<<<<<<<<<<
 *                     CHKERR(KSPSetConvergenceTest(self.ksp, KSPConvergedDefault,
 *                                                  cctx, KSPConvergedDefaultDestroy))
*/
      __pyx_t_1 = (!(__pyx_v_islsqr != 0));
      if (__pyx_t_1) {

        /* "petsc4py/PETSc/KSP.pyx":1069
 *                 CHKERR(KSPConvergedDefaultCreate(&cctx))
 *                 if not islsqr:
 *                     CHKERR(KSPSetConvergenceTest(self.ksp, KSPConvergedDefault,             # <<<<<<<<<<<<<<
 *                                                  cctx, KSPConvergedDefaultDestroy))
 *                 else:
*/
        __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, 1069, __pyx_L1_error)

        /* "petsc4py/PETSc/KSP.pyx":1068
 *                                               KSPLSQR,  &islsqr))
 *                 CHKERR(KSPConvergedDefaultCreate(&cctx))
 *                 if not islsqr:             # <<<<<<<<<<<<<<
 *                     CHKERR(KSPSetConvergenceTest(self.ksp, KSPConvergedDefault,
 *                                                  cctx, KSPConvergedDefaultDestroy))
*/
        goto __pyx_L7;
      }

      /* "petsc4py/PETSc/KSP.pyx":1072
 *                                                  cctx, KSPConvergedDefaultDestroy))
 *                 else:
 *                     CHKERR(KSPSetConvergenceTest(self.ksp, KSPLSQRConvergedDefault,             # <<<<<<<<<<<<<<
 *                                                  cctx, KSPConvergedDefaultDestroy))
 *             else:
*/
      /*else*/ {

        /* "petsc4py/PETSc/KSP.pyx":1073
 *                 else:
 *                     CHKERR(KSPSetConvergenceTest(self.ksp, KSPLSQRConvergedDefault,
 *                                                  cctx, KSPConvergedDefaultDestroy))             # <<<<<<<<<<<<<<
 *             else:
 *                 CHKERR(KSPSetConvergenceTest(self.ksp, KSPConvergedSkip,
*/
        __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetConvergenceTest(__pyx_v_self->ksp, KSPLSQRConvergedDefault, __pyx_v_cctx, KSPConvergedDefaultDestroy)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1072, __pyx_L1_error)
      }
      __pyx_L7:;

      /* "petsc4py/PETSc/KSP.pyx":1064
 *             # say KSPGetDefaultConverged would be more appropriate
 *             CHKERR(KSPGetNormType(self.ksp, &normtype))
 *             if normtype != KSP_NORM_NONE:             # <<<<<<<<<<<<<<
 *                 CHKERR(PetscObjectTypeCompare(<PetscObject>self.ksp,
 *                                               KSPLSQR,  &islsqr))
*/
      goto __pyx_L6;
    }

    /* "petsc4py/PETSc/KSP.pyx":1075
 *                                                  cctx, KSPConvergedDefaultDestroy))
 *             else:
 *                 CHKERR(KSPSetConvergenceTest(self.ksp, KSPConvergedSkip,             # <<<<<<<<<<<<<<
 *                                              NULL, NULL))
 *             self.set_attr('__converged__', None)
*/
    /*else*/ {

      /* "petsc4py/PETSc/KSP.pyx":1076
 *             else:
 *                 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, 1075, __pyx_L1_error)
    }
    __pyx_L6:;

    /* "petsc4py/PETSc/KSP.pyx":1077
 *                 CHKERR(KSPSetConvergenceTest(self.ksp, KSPConvergedSkip,
 *                                              NULL, NULL))
 *             self.set_attr('__converged__', None)             # <<<<<<<<<<<<<<
 * 
 *     def addConvergenceTest(
*/
    __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, 1077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/KSP.pyx":1014
 *         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":1079
 *             self.set_attr('__converged__', None)
 * 
 *     def addConvergenceTest(             # <<<<<<<<<<<<<<
 *         self,
 *         converged: KSPConvergenceTestFunction,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_51addConvergenceTest(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_50addConvergenceTest, "KSP.addConvergenceTest(self, converged: KSPConvergenceTestFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None, prepend: bool = False) -> None\nAdd 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        prepend\n            Whether to prepend this call before the default\n            convergence test or call it after.\n\n        Notes\n        -----\n        Cannot be mixed with a call to `setConvergenceTest`.\n        It can only be called once. If called multiple times, it will\n        generate an error.\n\n        See Also\n        --------\n        setTolerances, getConvergenceTest, setConvergenceTest,\n        petsc.KSPSetConvergenceTest, petsc.KSPConvergedDefault\n\n        \nSource code at petsc4py/PETSc/KSP.pyx:1079");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_51addConvergenceTest = {"addConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_51addConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_50addConvergenceTest};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_51addConvergenceTest(PyObject *__pyx_v_self, 
#if CYTHON_METH_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;
  PyObject *__pyx_v_prepend = 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("addConvergenceTest (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_converged,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,&__pyx_mstate_global->__pyx_n_u_prepend,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1079, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(49, 1079, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(49, 1079, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1079, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1079, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addConvergenceTest", 0) < (0)) __PYX_ERR(49, 1079, __pyx_L3_error)

      /* "petsc4py/PETSc/KSP.pyx":1082
 *         self,
 *         converged: KSPConvergenceTestFunction,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None,
 *         prepend: bool = False) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":1083
 *         converged: KSPConvergenceTestFunction,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None,             # <<<<<<<<<<<<<<
 *         prepend: bool = False) -> None:
 *         """Add the function to be used to determine convergence.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":1084
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None,
 *         prepend: bool = False) -> None:             # <<<<<<<<<<<<<<
 *         """Add the function to be used to determine convergence.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addConvergenceTest", 0, 1, 4, i); __PYX_ERR(49, 1079, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(49, 1079, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(49, 1079, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1079, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1079, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/KSP.pyx":1082
 *         self,
 *         converged: KSPConvergenceTestFunction,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None,
 *         prepend: bool = False) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":1083
 *         converged: KSPConvergenceTestFunction,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None,             # <<<<<<<<<<<<<<
 *         prepend: bool = False) -> None:
 *         """Add the function to be used to determine convergence.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":1084
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None,
 *         prepend: bool = False) -> None:             # <<<<<<<<<<<<<<
 *         """Add the function to be used to determine convergence.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_converged = values[0];
    __pyx_v_args = values[1];
    __pyx_v_kargs = values[2];
    __pyx_v_prepend = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("addConvergenceTest", 0, 1, 4, __pyx_nargs); __PYX_ERR(49, 1079, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.KSP.addConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_50addConvergenceTest(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_converged, __pyx_v_args, __pyx_v_kargs, __pyx_v_prepend);

  /* "petsc4py/PETSc/KSP.pyx":1079
 *             self.set_attr('__converged__', None)
 * 
 *     def addConvergenceTest(             # <<<<<<<<<<<<<<
 *         self,
 *         converged: KSPConvergenceTestFunction,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_50addConvergenceTest(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_converged, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs, PyObject *__pyx_v_prepend) {
  PyObject *__pyx_v_oconverged = 0;
  PetscBool __pyx_v_pre;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PetscBool __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("addConvergenceTest", 0);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_INCREF(__pyx_v_kargs);

  /* "petsc4py/PETSc/KSP.pyx":1113
 * 
 *         """
 *         cdef object oconverged = self.get_attr("__converged__")             # <<<<<<<<<<<<<<
 *         cdef PetscBool pre = asBool(prepend)
 *         if converged is None: return
*/
  __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, 1113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_oconverged = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1114
 *         """
 *         cdef object oconverged = self.get_attr("__converged__")
 *         cdef PetscBool pre = asBool(prepend)             # <<<<<<<<<<<<<<
 *         if converged is None: return
 *         if oconverged is not None: raise NotImplementedError("converged callback already set or added")
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_prepend); if (unlikely(__pyx_t_2 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(49, 1114, __pyx_L1_error)
  __pyx_v_pre = __pyx_t_2;

  /* "petsc4py/PETSc/KSP.pyx":1115
 *         cdef object oconverged = self.get_attr("__converged__")
 *         cdef PetscBool pre = asBool(prepend)
 *         if converged is None: return             # <<<<<<<<<<<<<<
 *         if oconverged is not None: raise NotImplementedError("converged callback already set or added")
 *         CHKERR(KSPAddConvergenceTest(self.ksp, KSP_Converged, pre))
*/
  __pyx_t_3 = (__pyx_v_converged == Py_None);
  if (__pyx_t_3) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/KSP.pyx":1116
 *         cdef PetscBool pre = asBool(prepend)
 *         if converged is None: return
 *         if oconverged is not None: raise NotImplementedError("converged callback already set or added")             # <<<<<<<<<<<<<<
 *         CHKERR(KSPAddConvergenceTest(self.ksp, KSP_Converged, pre))
 *         if args is None: args = ()
*/
  __pyx_t_3 = (__pyx_v_oconverged != Py_None);
  if (unlikely(__pyx_t_3)) {
    __pyx_t_4 = NULL;
    __pyx_t_5 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_converged_callback_already_set_o};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1116, __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(49, 1116, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/KSP.pyx":1117
 *         if converged is None: return
 *         if oconverged is not None: raise NotImplementedError("converged callback already set or added")
 *         CHKERR(KSPAddConvergenceTest(self.ksp, KSP_Converged, pre))             # <<<<<<<<<<<<<<
 *         if args is None: args = ()
 *         if kargs is None: kargs = {}
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPAddConvergenceTest(__pyx_v_self->ksp, __pyx_f_8petsc4py_5PETSc_KSP_Converged, __pyx_v_pre)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1117, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1118
 *         if oconverged is not None: raise NotImplementedError("converged callback already set or added")
 *         CHKERR(KSPAddConvergenceTest(self.ksp, KSP_Converged, pre))
 *         if args is None: args = ()             # <<<<<<<<<<<<<<
 *         if kargs is None: kargs = {}
 *         self.set_attr('__converged__', (converged, args, kargs))
*/
  __pyx_t_3 = (__pyx_v_args == Py_None);
  if (__pyx_t_3) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/KSP.pyx":1119
 *         CHKERR(KSPAddConvergenceTest(self.ksp, KSP_Converged, pre))
 *         if args is None: args = ()
 *         if kargs is None: kargs = {}             # <<<<<<<<<<<<<<
 *         self.set_attr('__converged__', (converged, args, kargs))
 * 
*/
  __pyx_t_3 = (__pyx_v_kargs == Py_None);
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_kargs, __pyx_t_1);
    __pyx_t_1 = 0;
  }

  /* "petsc4py/PETSc/KSP.pyx":1120
 *         if args is None: args = ()
 *         if kargs is None: kargs = {}
 *         self.set_attr('__converged__', (converged, args, kargs))             # <<<<<<<<<<<<<<
 * 
 *     def getConvergenceTest(self) -> KSPConvergenceTestFunction:
*/
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_converged);
  __Pyx_GIVEREF(__pyx_v_converged);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_converged) != (0)) __PYX_ERR(49, 1120, __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) != (0)) __PYX_ERR(49, 1120, __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) != (0)) __PYX_ERR(49, 1120, __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_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1079
 *             self.set_attr('__converged__', None)
 * 
 *     def addConvergenceTest(             # <<<<<<<<<<<<<<
 *         self,
 *         converged: KSPConvergenceTestFunction,
*/

  /* 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_AddTraceback("petsc4py.PETSc.KSP.addConvergenceTest", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_oconverged);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kargs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/KSP.pyx":1122
 *         self.set_attr('__converged__', (converged, args, kargs))
 * 
 *     def getConvergenceTest(self) -> KSPConvergenceTestFunction:             # <<<<<<<<<<<<<<
 *         """Return the function to be used to determine convergence.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_53getConvergenceTest(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_52getConvergenceTest, "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:1122");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_53getConvergenceTest = {"getConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_53getConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_52getConvergenceTest};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_53getConvergenceTest(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getConvergenceTest", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_52getConvergenceTest(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_52getConvergenceTest(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1133
 * 
 *         """
 *         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, 1133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":1122
 *         self.set_attr('__converged__', (converged, args, kargs))
 * 
 *     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":1135
 *         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_55callConvergenceTest(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_54callConvergenceTest, "KSP.callConvergenceTest(self, its: int, rnorm: float) -> None\nCall the convergence test callback.\n\n        Collective.\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:1135");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_55callConvergenceTest = {"callConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_55callConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_54callConvergenceTest};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_55callConvergenceTest(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_its,&__pyx_mstate_global->__pyx_n_u_rnorm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1135, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "callConvergenceTest", 0) < (0)) __PYX_ERR(49, 1135, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 2, 2, i); __PYX_ERR(49, 1135, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1135, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1135, __pyx_L3_error)
    }
    __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, 1135, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_54callConvergenceTest(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_its, __pyx_v_rnorm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_54callConvergenceTest(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1152
 * 
 *         """
 *         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, 1152, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":1153
 *         """
 *         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, 1153, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_2;

  /* "petsc4py/PETSc/KSP.pyx":1154
 *         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":1155
 *         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, 1155, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1156
 *         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_PyLong_From_KSPConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":1135
 *         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":1158
 *         return reason
 * 
 *     def setConvergenceHistory(             # <<<<<<<<<<<<<<
 *         self,
 *         length: int | None = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_57setConvergenceHistory(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_56setConvergenceHistory, "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:1158");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_57setConvergenceHistory = {"setConvergenceHistory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_57setConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_56setConvergenceHistory};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_57setConvergenceHistory(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_length,&__pyx_mstate_global->__pyx_n_u_reset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1158, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1158, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1158, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setConvergenceHistory", 0) < (0)) __PYX_ERR(49, 1158, __pyx_L3_error)

      /* "petsc4py/PETSc/KSP.pyx":1160
 *     def setConvergenceHistory(
 *         self,
 *         length: int | None = None,             # <<<<<<<<<<<<<<
 *         reset: bool = False) -> None:
 *         """Set the array used to hold the residual history.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":1161
 *         self,
 *         length: int | None = None,
 *         reset: bool = False) -> None:             # <<<<<<<<<<<<<<
 *         """Set the array used to hold the residual history.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1158, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1158, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/KSP.pyx":1160
 *     def setConvergenceHistory(
 *         self,
 *         length: int | None = None,             # <<<<<<<<<<<<<<
 *         reset: bool = False) -> None:
 *         """Set the array used to hold the residual history.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":1161
 *         self,
 *         length: int | None = None,
 *         reset: bool = False) -> None:             # <<<<<<<<<<<<<<
 *         """Set the array used to hold the residual history.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __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, 1158, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_56setConvergenceHistory(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_length, __pyx_v_reset);

  /* "petsc4py/PETSc/KSP.pyx":1158
 *         return reason
 * 
 *     def setConvergenceHistory(             # <<<<<<<<<<<<<<
 *         self,
 *         length: int | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_56setConvergenceHistory(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1191
 * 
 *         """
 *         cdef PetscReal *data = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt   size = 10000
 *         cdef PetscBool flag = PETSC_FALSE
*/
  __pyx_v_data = NULL;

  /* "petsc4py/PETSc/KSP.pyx":1192
 *         """
 *         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":1193
 *         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":1194
 *         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":1195
 *         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, 1195, __pyx_L1_error)
    __pyx_v_size = __pyx_t_2;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/KSP.pyx":1196
 *         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":1197
 *         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, 1197, __pyx_L1_error)
  if (__pyx_t_1) {
    __pyx_v_flag = PETSC_TRUE;
  }

  /* "petsc4py/PETSc/KSP.pyx":1198
 *         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, 1198, __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, 1198, __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":1199
 *         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, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1200
 *         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, 1200, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1158
 *         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":1202
 *         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_59getConvergenceHistory(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_58getConvergenceHistory, "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:1202");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_59getConvergenceHistory = {"getConvergenceHistory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_59getConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_58getConvergenceHistory};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_59getConvergenceHistory(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getConvergenceHistory", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_58getConvergenceHistory(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_58getConvergenceHistory(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1212
 * 
 *         """
 *         cdef const PetscReal *data = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt   size = 0
 *         CHKERR(KSPGetResidualHistory(self.ksp, &data, &size))
*/
  __pyx_v_data = NULL;

  /* "petsc4py/PETSc/KSP.pyx":1213
 *         """
 *         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":1214
 *         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, 1214, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1215
 *         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, 1215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":1202
 *         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":1217
 *         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_61logConvergenceHistory(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_60logConvergenceHistory, "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:1217");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_61logConvergenceHistory = {"logConvergenceHistory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_61logConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_60logConvergenceHistory};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_61logConvergenceHistory(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rnorm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1217, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1217, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "logConvergenceHistory", 0) < (0)) __PYX_ERR(49, 1217, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("logConvergenceHistory", 1, 1, 1, i); __PYX_ERR(49, 1217, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1217, __pyx_L3_error)
    }
    __pyx_v_rnorm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("logConvergenceHistory", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1217, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_60logConvergenceHistory(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_rnorm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_60logConvergenceHistory(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1228
 * 
 *         """
 *         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, 1228, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":1229
 *         """
 *         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, 1229, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1217
 *         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":1233
 *     # --- monitoring ---
 * 
 *     def setMonitor(self,             # <<<<<<<<<<<<<<
 *                    monitor: KSPMonitorFunction,
 *                    args: tuple[Any, ...] | None = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_63setMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_62setMonitor, "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:1233");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_63setMonitor = {"setMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_63setMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_62setMonitor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_63setMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_monitor,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1233, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(49, 1233, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1233, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1233, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMonitor", 0) < (0)) __PYX_ERR(49, 1233, __pyx_L3_error)

      /* "petsc4py/PETSc/KSP.pyx":1235
 *     def setMonitor(self,
 *                    monitor: KSPMonitorFunction,
 *                    args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                    kargs: dict[str, Any] | None = None) -> None:
 *         """Set additional function to monitor the residual.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":1236
 *                    monitor: KSPMonitorFunction,
 *                    args: tuple[Any, ...] | None = None,
 *                    kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set additional function to monitor the residual.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMonitor", 0, 1, 3, i); __PYX_ERR(49, 1233, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(49, 1233, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1233, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1233, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/KSP.pyx":1235
 *     def setMonitor(self,
 *                    monitor: KSPMonitorFunction,
 *                    args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                    kargs: dict[str, Any] | None = None) -> None:
 *         """Set additional function to monitor the residual.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":1236
 *                    monitor: KSPMonitorFunction,
 *                    args: tuple[Any, ...] | None = None,
 *                    kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set additional function to monitor the residual.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1233, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_62setMonitor(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_monitor, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/KSP.pyx":1233
 *     # --- monitoring ---
 * 
 *     def setMonitor(self,             # <<<<<<<<<<<<<<
 *                    monitor: KSPMonitorFunction,
 *                    args: tuple[Any, ...] | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_62setMonitor(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":1270
 * 
 *         """
 *         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":1271
 *         """
 *         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, 1271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_monitorlist = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1272
 *         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":1273
 *         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, 1273, __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":1274
 *         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, 1274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/KSP.pyx":1275
 *             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, 1275, __pyx_L1_error)

    /* "petsc4py/PETSc/KSP.pyx":1272
 *         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":1276
 *             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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/KSP.pyx":1277
 *             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, 1277, __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":1278
 *         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, 1278, __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) != (0)) __PYX_ERR(49, 1278, __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) != (0)) __PYX_ERR(49, 1278, __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) != (0)) __PYX_ERR(49, 1278, __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, 1278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1233
 *     # --- 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":1280
 *         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_65getMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_64getMonitor, "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:1280");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_65getMonitor = {"getMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_65getMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_64getMonitor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_65getMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMonitor", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_64getMonitor(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_64getMonitor(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1291
 * 
 *         """
 *         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, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":1280
 *         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":1293
 *         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_67monitorCancel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_66monitorCancel, "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:1293");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_67monitorCancel = {"monitorCancel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_67monitorCancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_66monitorCancel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_67monitorCancel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("monitorCancel", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_66monitorCancel(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_66monitorCancel(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1303
 * 
 *         """
 *         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, 1303, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1304
 *         """
 *         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, 1304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1293
 *         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":1308
 *     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_69monitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_68monitor, "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:1308");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_69monitor = {"monitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_69monitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_68monitor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_69monitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_its,&__pyx_mstate_global->__pyx_n_u_rnorm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1308, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1308, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "monitor", 0) < (0)) __PYX_ERR(49, 1308, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("monitor", 1, 2, 2, i); __PYX_ERR(49, 1308, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1308, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1308, __pyx_L3_error)
    }
    __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, 1308, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_68monitor(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_its, __pyx_v_rnorm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_68monitor(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1323
 * 
 *         """
 *         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, 1323, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":1324
 *         """
 *         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, 1324, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_2;

  /* "petsc4py/PETSc/KSP.pyx":1325
 *         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, 1325, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1308
 *     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":1329
 *     # --- customization ---
 * 
 *     def setPCSide(self, side: PC.Side) -> None:             # <<<<<<<<<<<<<<
 *         """Set the preconditioning side.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_71setPCSide(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_70setPCSide, "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:1329");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_71setPCSide = {"setPCSide", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_71setPCSide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_70setPCSide};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_71setPCSide(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_side,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1329, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1329, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPCSide", 0) < (0)) __PYX_ERR(49, 1329, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPCSide", 1, 1, 1, i); __PYX_ERR(49, 1329, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1329, __pyx_L3_error)
    }
    __pyx_v_side = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPCSide", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1329, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_70setPCSide(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_side);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_70setPCSide(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1361
 * 
 *         """
 *         CHKERR(KSPSetPCSide(self.ksp, side))             # <<<<<<<<<<<<<<
 * 
 *     def getPCSide(self) -> PC.Side:
*/
  __pyx_t_1 = ((PCSide)__Pyx_PyLong_As_PCSide(__pyx_v_side)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1361, __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, 1361, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1329
 *     # --- 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":1363
 *         CHKERR(KSPSetPCSide(self.ksp, side))
 * 
 *     def getPCSide(self) -> PC.Side:             # <<<<<<<<<<<<<<
 *         """Return the preconditioning side.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_73getPCSide(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_72getPCSide, "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:1363");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_73getPCSide = {"getPCSide", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_73getPCSide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_72getPCSide};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_73getPCSide(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPCSide", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_72getPCSide(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_72getPCSide(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1373
 * 
 *         """
 *         cdef PetscPCSide side = PC_LEFT             # <<<<<<<<<<<<<<
 *         CHKERR(KSPGetPCSide(self.ksp, &side))
 *         return side
*/
  __pyx_v_side = PC_LEFT;

  /* "petsc4py/PETSc/KSP.pyx":1374
 *         """
 *         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, 1374, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1375
 *         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_PyLong_From_PCSide(__pyx_v_side); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":1363
 *         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":1377
 *         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_75setNormType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_74setNormType, "KSP.setNormType(self, normtype: NormType) -> None\nSet the norm that is used for convergence testing.\n\n        Logically collective.\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:1377");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_75setNormType = {"setNormType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_75setNormType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_74setNormType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_75setNormType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_normtype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1377, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1377, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNormType", 0) < (0)) __PYX_ERR(49, 1377, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNormType", 1, 1, 1, i); __PYX_ERR(49, 1377, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1377, __pyx_L3_error)
    }
    __pyx_v_normtype = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setNormType", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1377, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_74setNormType(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_normtype);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_74setNormType(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1402
 * 
 *         """
 *         CHKERR(KSPSetNormType(self.ksp, normtype))             # <<<<<<<<<<<<<<
 * 
 *     def getNormType(self) -> NormType:
*/
  __pyx_t_1 = ((KSPNormType)__Pyx_PyLong_As_KSPNormType(__pyx_v_normtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1402, __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, 1402, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1377
 *         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":1404
 *         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_77getNormType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_76getNormType, "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:1404");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_77getNormType = {"getNormType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_77getNormType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_76getNormType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_77getNormType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNormType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_76getNormType(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_76getNormType(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1414
 * 
 *         """
 *         cdef PetscKSPNormType normtype = KSP_NORM_NONE             # <<<<<<<<<<<<<<
 *         CHKERR(KSPGetNormType(self.ksp, &normtype))
 *         return normtype
*/
  __pyx_v_normtype = KSP_NORM_NONE;

  /* "petsc4py/PETSc/KSP.pyx":1415
 *         """
 *         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, 1415, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1416
 *         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_PyLong_From_KSPNormType(__pyx_v_normtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":1404
 *         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":1418
 *         return normtype
 * 
 *     def setComputeEigenvalues(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set a flag to compute eigenvalues.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_79setComputeEigenvalues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_78setComputeEigenvalues, "KSP.setComputeEigenvalues(self, flag: bool) -> None\nSet a flag to compute eigenvalues.\n\n        Logically collective.\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:1418");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_79setComputeEigenvalues = {"setComputeEigenvalues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_79setComputeEigenvalues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_78setComputeEigenvalues};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_79setComputeEigenvalues(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1418, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1418, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setComputeEigenvalues", 0) < (0)) __PYX_ERR(49, 1418, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setComputeEigenvalues", 1, 1, 1, i); __PYX_ERR(49, 1418, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1418, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setComputeEigenvalues", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1418, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_78setComputeEigenvalues(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_78setComputeEigenvalues(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1441
 * 
 *         """
 *         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, 1441, __pyx_L1_error)
  __pyx_v_compute = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":1442
 *         """
 *         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, 1442, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1418
 *         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":1444
 *         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_81getComputeEigenvalues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_80getComputeEigenvalues, "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:1444");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_81getComputeEigenvalues = {"getComputeEigenvalues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_81getComputeEigenvalues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_80getComputeEigenvalues};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_81getComputeEigenvalues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getComputeEigenvalues", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_80getComputeEigenvalues(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_80getComputeEigenvalues(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1458
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(KSPGetComputeEigenvalues(self.ksp, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/KSP.pyx":1459
 *         """
 *         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, 1459, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1460
 *         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, 1460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":1444
 *         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":1462
 *         return toBool(flag)
 * 
 *     def setComputeSingularValues(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set flag to calculate singular values.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_83setComputeSingularValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_82setComputeSingularValues, "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:1462");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_83setComputeSingularValues = {"setComputeSingularValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_83setComputeSingularValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_82setComputeSingularValues};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_83setComputeSingularValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1462, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1462, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setComputeSingularValues", 0) < (0)) __PYX_ERR(49, 1462, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setComputeSingularValues", 1, 1, 1, i); __PYX_ERR(49, 1462, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1462, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setComputeSingularValues", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1462, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_82setComputeSingularValues(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_82setComputeSingularValues(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1485
 * 
 *         """
 *         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, 1485, __pyx_L1_error)
  __pyx_v_compute = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":1486
 *         """
 *         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, 1486, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1462
 *         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":1488
 *         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_85getComputeSingularValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_84getComputeSingularValues, "KSP.getComputeSingularValues(self) -> bool\nReturn flag indicating whether singular values will be calculated.\n\n        Not collective.\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:1488");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_85getComputeSingularValues = {"getComputeSingularValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_85getComputeSingularValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_84getComputeSingularValues};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_85getComputeSingularValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getComputeSingularValues", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_84getComputeSingularValues(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_84getComputeSingularValues(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1502
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(KSPGetComputeSingularValues(self.ksp, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/KSP.pyx":1503
 *         """
 *         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, 1503, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1504
 *         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, 1504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":1488
 *         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":1508
 *     # --- 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_87setInitialGuessNonzero(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_86setInitialGuessNonzero, "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:1508");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_87setInitialGuessNonzero = {"setInitialGuessNonzero", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_87setInitialGuessNonzero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_86setInitialGuessNonzero};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_87setInitialGuessNonzero(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1508, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setInitialGuessNonzero", 0) < (0)) __PYX_ERR(49, 1508, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setInitialGuessNonzero", 1, 1, 1, i); __PYX_ERR(49, 1508, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1508, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setInitialGuessNonzero", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1508, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_86setInitialGuessNonzero(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_86setInitialGuessNonzero(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1527
 * 
 *         """
 *         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, 1527, __pyx_L1_error)
  __pyx_v_guess_nonzero = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":1528
 *         """
 *         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, 1528, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1508
 *     # --- 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":1530
 *         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_89getInitialGuessNonzero(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_88getInitialGuessNonzero, "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:1530");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_89getInitialGuessNonzero = {"getInitialGuessNonzero", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_89getInitialGuessNonzero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_88getInitialGuessNonzero};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_89getInitialGuessNonzero(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getInitialGuessNonzero", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_88getInitialGuessNonzero(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_88getInitialGuessNonzero(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1540
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(KSPGetInitialGuessNonzero(self.ksp, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/KSP.pyx":1541
 *         """
 *         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, 1541, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1542
 *         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, 1542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":1530
 *         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":1544
 *         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_91setInitialGuessKnoll(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_90setInitialGuessKnoll, "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:1544");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_91setInitialGuessKnoll = {"setInitialGuessKnoll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_91setInitialGuessKnoll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_90setInitialGuessKnoll};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_91setInitialGuessKnoll(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1544, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1544, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setInitialGuessKnoll", 0) < (0)) __PYX_ERR(49, 1544, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setInitialGuessKnoll", 1, 1, 1, i); __PYX_ERR(49, 1544, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1544, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setInitialGuessKnoll", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1544, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_90setInitialGuessKnoll(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_90setInitialGuessKnoll(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1561
 * 
 *         """
 *         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, 1561, __pyx_L1_error)
  __pyx_v_guess_knoll = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":1562
 *         """
 *         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, 1562, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1544
 *         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":1564
 *         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_93getInitialGuessKnoll(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_92getInitialGuessKnoll, "KSP.getInitialGuessKnoll(self) -> bool\nDetermine whether the KSP solver is using the Knoll trick.\n\n        Not collective.\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:1564");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_93getInitialGuessKnoll = {"getInitialGuessKnoll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_93getInitialGuessKnoll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_92getInitialGuessKnoll};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_93getInitialGuessKnoll(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getInitialGuessKnoll", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_92getInitialGuessKnoll(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_92getInitialGuessKnoll(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1577
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(KSPGetInitialGuessKnoll(self.ksp, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/KSP.pyx":1578
 *         """
 *         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, 1578, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1579
 *         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, 1579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":1564
 *         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":1581
 *         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_95setUseFischerGuess(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_94setUseFischerGuess, "KSP.setUseFischerGuess(self, model: int, size: int) -> None\nUse the Paul Fischer algorithm to compute initial guesses.\n\n        Logically collective.\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:1581");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_95setUseFischerGuess = {"setUseFischerGuess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_95setUseFischerGuess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_94setUseFischerGuess};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_95setUseFischerGuess(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_model,&__pyx_mstate_global->__pyx_n_u_size,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1581, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1581, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1581, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setUseFischerGuess", 0) < (0)) __PYX_ERR(49, 1581, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setUseFischerGuess", 1, 2, 2, i); __PYX_ERR(49, 1581, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1581, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1581, __pyx_L3_error)
    }
    __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, 1581, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_94setUseFischerGuess(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_model, __pyx_v_size);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_94setUseFischerGuess(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1603
 * 
 *         """
 *         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, 1603, __pyx_L1_error)
  __pyx_v_ival1 = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":1604
 *         """
 *         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, 1604, __pyx_L1_error)
  __pyx_v_ival2 = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":1605
 *         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, 1605, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1581
 *         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":1609
 *     # --- solving ---
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up internal data structures for an iterative solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_97setUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_96setUp, "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:1609");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_97setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_97setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_96setUp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_97setUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_96setUp(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_96setUp(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1619
 * 
 *         """
 *         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, 1619, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1609
 *     # --- 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":1621
 *         CHKERR(KSPSetUp(self.ksp))
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         """Resets a KSP context.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_99reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_98reset, "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:1621");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_99reset = {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_99reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_98reset};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_99reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("reset", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_98reset(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_98reset(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1634
 * 
 *         """
 *         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, 1634, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1621
 *         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":1636
 *         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_101setUpOnBlocks(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_100setUpOnBlocks, "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:1636");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_101setUpOnBlocks = {"setUpOnBlocks", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_101setUpOnBlocks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_100setUpOnBlocks};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_101setUpOnBlocks(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUpOnBlocks", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_100setUpOnBlocks(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_100setUpOnBlocks(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1649
 * 
 *         """
 *         CHKERR(KSPSetUpOnBlocks(self.ksp))             # <<<<<<<<<<<<<<
 * 
 *     def setPreSolve(
*/
  __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, 1649, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1636
 *         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":1651
 *         CHKERR(KSPSetUpOnBlocks(self.ksp))
 * 
 *     def setPreSolve(             # <<<<<<<<<<<<<<
 *         self,
 *         presolve: KSPPreSolveFunction | None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_103setPreSolve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_102setPreSolve, "KSP.setPreSolve(self, presolve: KSPPreSolveFunction | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the function that is called at the beginning of each `KSP.solve`.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        presolve\n            The callback function.\n        args\n            Positional arguments for the callback function.\n        kargs\n            Keyword arguments for the callback function.\n\n        See Also\n        --------\n        solve, petsc.KSPSetPreSolve, petsc.KSPSetPostSolve\n\n        \nSource code at petsc4py/PETSc/KSP.pyx:1651");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_103setPreSolve = {"setPreSolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_103setPreSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_102setPreSolve};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_103setPreSolve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_presolve = 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("setPreSolve (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_presolve,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1651, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(49, 1651, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1651, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1651, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPreSolve", 0) < (0)) __PYX_ERR(49, 1651, __pyx_L3_error)

      /* "petsc4py/PETSc/KSP.pyx":1654
 *         self,
 *         presolve: KSPPreSolveFunction | None,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 *         """Set the function that is called at the beginning of each `KSP.solve`.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":1655
 *         presolve: KSPPreSolveFunction | None,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function that is called at the beginning of each `KSP.solve`.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPreSolve", 0, 1, 3, i); __PYX_ERR(49, 1651, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(49, 1651, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1651, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1651, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/KSP.pyx":1654
 *         self,
 *         presolve: KSPPreSolveFunction | None,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 *         """Set the function that is called at the beginning of each `KSP.solve`.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":1655
 *         presolve: KSPPreSolveFunction | None,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function that is called at the beginning of each `KSP.solve`.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_presolve = values[0];
    __pyx_v_args = values[1];
    __pyx_v_kargs = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPreSolve", 0, 1, 3, __pyx_nargs); __PYX_ERR(49, 1651, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPreSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_102setPreSolve(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_presolve, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/KSP.pyx":1651
 *         CHKERR(KSPSetUpOnBlocks(self.ksp))
 * 
 *     def setPreSolve(             # <<<<<<<<<<<<<<
 *         self,
 *         presolve: KSPPreSolveFunction | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_102setPreSolve(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_presolve, 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("setPreSolve", 0);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_INCREF(__pyx_v_kargs);

  /* "petsc4py/PETSc/KSP.pyx":1674
 * 
 *         """
 *         if presolve is not None:             # <<<<<<<<<<<<<<
 *             if args is None: args = ()
 *             if kargs is None: kargs = {}
*/
  __pyx_t_1 = (__pyx_v_presolve != Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/KSP.pyx":1675
 *         """
 *         if presolve is not None:
 *             if args is None: args = ()             # <<<<<<<<<<<<<<
 *             if kargs is None: kargs = {}
 *             context = (presolve, args, kargs)
*/
    __pyx_t_1 = (__pyx_v_args == Py_None);
    if (__pyx_t_1) {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/KSP.pyx":1676
 *         if presolve is not None:
 *             if args is None: args = ()
 *             if kargs is None: kargs = {}             # <<<<<<<<<<<<<<
 *             context = (presolve, args, kargs)
 *             self.set_attr('__presolve__', 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, 1676, __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":1677
 *             if args is None: args = ()
 *             if kargs is None: kargs = {}
 *             context = (presolve, args, kargs)             # <<<<<<<<<<<<<<
 *             self.set_attr('__presolve__', context)
 *             CHKERR(KSPSetPreSolve(self.ksp, KSP_PreSolve, <void*>context))
*/
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_presolve);
    __Pyx_GIVEREF(__pyx_v_presolve);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_presolve) != (0)) __PYX_ERR(49, 1677, __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) != (0)) __PYX_ERR(49, 1677, __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) != (0)) __PYX_ERR(49, 1677, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/KSP.pyx":1678
 *             if kargs is None: kargs = {}
 *             context = (presolve, args, kargs)
 *             self.set_attr('__presolve__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(KSPSetPreSolve(self.ksp, KSP_PreSolve, <void*>context))
 *         else:
*/
    __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 *)"__presolve__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/KSP.pyx":1679
 *             context = (presolve, args, kargs)
 *             self.set_attr('__presolve__', context)
 *             CHKERR(KSPSetPreSolve(self.ksp, KSP_PreSolve, <void*>context))             # <<<<<<<<<<<<<<
 *         else:
 *             self.set_attr('__presolve__', None)
*/
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetPreSolve(__pyx_v_self->ksp, __pyx_f_8petsc4py_5PETSc_KSP_PreSolve, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1679, __pyx_L1_error)

    /* "petsc4py/PETSc/KSP.pyx":1674
 * 
 *         """
 *         if presolve is not None:             # <<<<<<<<<<<<<<
 *             if args is None: args = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/KSP.pyx":1681
 *             CHKERR(KSPSetPreSolve(self.ksp, KSP_PreSolve, <void*>context))
 *         else:
 *             self.set_attr('__presolve__', None)             # <<<<<<<<<<<<<<
 *             CHKERR(KSPSetPreSolve(self.ksp, NULL, NULL))
 * 
*/
  /*else*/ {
    __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 *)"__presolve__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/KSP.pyx":1682
 *         else:
 *             self.set_attr('__presolve__', None)
 *             CHKERR(KSPSetPreSolve(self.ksp, NULL, NULL))             # <<<<<<<<<<<<<<
 * 
 *     def setPostSolve(
*/
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetPreSolve(__pyx_v_self->ksp, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1682, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/KSP.pyx":1651
 *         CHKERR(KSPSetUpOnBlocks(self.ksp))
 * 
 *     def setPreSolve(             # <<<<<<<<<<<<<<
 *         self,
 *         presolve: KSPPreSolveFunction | 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.setPreSolve", __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":1684
 *             CHKERR(KSPSetPreSolve(self.ksp, NULL, NULL))
 * 
 *     def setPostSolve(             # <<<<<<<<<<<<<<
 *         self,
 *         postsolve: KSPPostSolveFunction | None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_105setPostSolve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_104setPostSolve, "KSP.setPostSolve(self, postsolve: KSPPostSolveFunction | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the function that is called at the end of each `KSP.solve`.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        postsolve\n            The callback function.\n        args\n            Positional arguments for the callback function.\n        kargs\n            Keyword arguments for the callback function.\n\n        See Also\n        --------\n        solve, petsc.KSPSetPreSolve, petsc.KSPSetPostSolve\n\n        \nSource code at petsc4py/PETSc/KSP.pyx:1684");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_105setPostSolve = {"setPostSolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_105setPostSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_104setPostSolve};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_105setPostSolve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_postsolve = 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("setPostSolve (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_postsolve,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1684, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(49, 1684, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1684, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1684, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPostSolve", 0) < (0)) __PYX_ERR(49, 1684, __pyx_L3_error)

      /* "petsc4py/PETSc/KSP.pyx":1687
 *         self,
 *         postsolve: KSPPostSolveFunction | None,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 *         """Set the function that is called at the end of each `KSP.solve`.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":1688
 *         postsolve: KSPPostSolveFunction | None,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function that is called at the end of each `KSP.solve`.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPostSolve", 0, 1, 3, i); __PYX_ERR(49, 1684, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(49, 1684, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1684, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1684, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/KSP.pyx":1687
 *         self,
 *         postsolve: KSPPostSolveFunction | None,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 *         """Set the function that is called at the end of each `KSP.solve`.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":1688
 *         postsolve: KSPPostSolveFunction | None,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function that is called at the end of each `KSP.solve`.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_postsolve = values[0];
    __pyx_v_args = values[1];
    __pyx_v_kargs = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPostSolve", 0, 1, 3, __pyx_nargs); __PYX_ERR(49, 1684, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.KSP.setPostSolve", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_104setPostSolve(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_postsolve, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/KSP.pyx":1684
 *             CHKERR(KSPSetPreSolve(self.ksp, NULL, NULL))
 * 
 *     def setPostSolve(             # <<<<<<<<<<<<<<
 *         self,
 *         postsolve: KSPPostSolveFunction | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_104setPostSolve(struct PyPetscKSPObject *__pyx_v_self, PyObject *__pyx_v_postsolve, 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("setPostSolve", 0);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_INCREF(__pyx_v_kargs);

  /* "petsc4py/PETSc/KSP.pyx":1707
 * 
 *         """
 *         if postsolve is not None:             # <<<<<<<<<<<<<<
 *             if args is None: args = ()
 *             if kargs is None: kargs = {}
*/
  __pyx_t_1 = (__pyx_v_postsolve != Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/KSP.pyx":1708
 *         """
 *         if postsolve is not None:
 *             if args is None: args = ()             # <<<<<<<<<<<<<<
 *             if kargs is None: kargs = {}
 *             context = (postsolve, args, kargs)
*/
    __pyx_t_1 = (__pyx_v_args == Py_None);
    if (__pyx_t_1) {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/KSP.pyx":1709
 *         if postsolve is not None:
 *             if args is None: args = ()
 *             if kargs is None: kargs = {}             # <<<<<<<<<<<<<<
 *             context = (postsolve, args, kargs)
 *             self.set_attr('__postsolve__', 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, 1709, __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":1710
 *             if args is None: args = ()
 *             if kargs is None: kargs = {}
 *             context = (postsolve, args, kargs)             # <<<<<<<<<<<<<<
 *             self.set_attr('__postsolve__', context)
 *             CHKERR(KSPSetPostSolve(self.ksp, KSP_PostSolve, <void*>context))
*/
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_postsolve);
    __Pyx_GIVEREF(__pyx_v_postsolve);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_postsolve) != (0)) __PYX_ERR(49, 1710, __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) != (0)) __PYX_ERR(49, 1710, __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) != (0)) __PYX_ERR(49, 1710, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/KSP.pyx":1711
 *             if kargs is None: kargs = {}
 *             context = (postsolve, args, kargs)
 *             self.set_attr('__postsolve__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(KSPSetPostSolve(self.ksp, KSP_PostSolve, <void*>context))
 *         else:
*/
    __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 *)"__postsolve__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/KSP.pyx":1712
 *             context = (postsolve, args, kargs)
 *             self.set_attr('__postsolve__', context)
 *             CHKERR(KSPSetPostSolve(self.ksp, KSP_PostSolve, <void*>context))             # <<<<<<<<<<<<<<
 *         else:
 *             self.set_attr('__postsolve__', None)
*/
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetPostSolve(__pyx_v_self->ksp, __pyx_f_8petsc4py_5PETSc_KSP_PostSolve, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1712, __pyx_L1_error)

    /* "petsc4py/PETSc/KSP.pyx":1707
 * 
 *         """
 *         if postsolve is not None:             # <<<<<<<<<<<<<<
 *             if args is None: args = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/KSP.pyx":1714
 *             CHKERR(KSPSetPostSolve(self.ksp, KSP_PostSolve, <void*>context))
 *         else:
 *             self.set_attr('__postsolve__', None)             # <<<<<<<<<<<<<<
 *             CHKERR(KSPSetPostSolve(self.ksp, NULL, NULL))
 * 
*/
  /*else*/ {
    __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 *)"__postsolve__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1714, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/KSP.pyx":1715
 *         else:
 *             self.set_attr('__postsolve__', None)
 *             CHKERR(KSPSetPostSolve(self.ksp, NULL, NULL))             # <<<<<<<<<<<<<<
 * 
 *     def solve(self, Vec b, Vec x) -> None:
*/
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPSetPostSolve(__pyx_v_self->ksp, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1715, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/KSP.pyx":1684
 *             CHKERR(KSPSetPreSolve(self.ksp, NULL, NULL))
 * 
 *     def setPostSolve(             # <<<<<<<<<<<<<<
 *         self,
 *         postsolve: KSPPostSolveFunction | 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.setPostSolve", __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":1717
 *             CHKERR(KSPSetPostSolve(self.ksp, NULL, NULL))
 * 
 *     def solve(self, Vec b, Vec x) -> None:             # <<<<<<<<<<<<<<
 *         """Solve the linear system.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_107solve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_106solve, "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:1717");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_107solve = {"solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_107solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_106solve};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_107solve(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_b,&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1717, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1717, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "solve", 0) < (0)) __PYX_ERR(49, 1717, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("solve", 1, 2, 2, i); __PYX_ERR(49, 1717, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1717, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1717, __pyx_L3_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", 1, 2, 2, __pyx_nargs); __PYX_ERR(49, 1717, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(49, 1717, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(49, 1717, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_106solve(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_106solve(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1792
 * 
 *         """
 *         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":1793
 *         """
 *         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":1794
 *         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":1795
 *         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":1796
 *         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, 1796, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1717
 *             CHKERR(KSPSetPostSolve(self.ksp, NULL, NULL))
 * 
 *     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":1798
 *         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_109solveTranspose(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_108solveTranspose, "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:1798");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_109solveTranspose = {"solveTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_109solveTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_108solveTranspose};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_109solveTranspose(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_b,&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1798, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1798, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1798, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "solveTranspose", 0) < (0)) __PYX_ERR(49, 1798, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("solveTranspose", 1, 2, 2, i); __PYX_ERR(49, 1798, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1798, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1798, __pyx_L3_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("solveTranspose", 1, 2, 2, __pyx_nargs); __PYX_ERR(49, 1798, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "b", 0))) __PYX_ERR(49, 1798, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(49, 1798, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_108solveTranspose(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_108solveTranspose(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1820
 * 
 *         """
 *         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, 1820, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1798
 *         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":1822
 *         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_111matSolve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_110matSolve, "KSP.matSolve(self, B: Mat, X: Mat) -> None\nSolve a linear system with multiple right-hand sides.\n\n        Collective.\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:1822");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_111matSolve = {"matSolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_111matSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_110matSolve};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_111matSolve(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_X,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1822, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1822, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1822, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "matSolve", 0) < (0)) __PYX_ERR(49, 1822, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("matSolve", 1, 2, 2, i); __PYX_ERR(49, 1822, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1822, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1822, __pyx_L3_error)
    }
    __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, 1822, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "B", 0))) __PYX_ERR(49, 1822, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(49, 1822, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_110matSolve(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_B, __pyx_v_X);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_110matSolve(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1842
 * 
 *         """
 *         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, 1842, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1822
 *         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":1844
 *         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_113matSolveTranspose(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_112matSolveTranspose, "KSP.matSolveTranspose(self, B: Mat, X: Mat) -> None\nSolve the transpose of a linear system with multiple RHS.\n\n        Collective.\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:1844");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_113matSolveTranspose = {"matSolveTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_113matSolveTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_112matSolveTranspose};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_113matSolveTranspose(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_B,&__pyx_mstate_global->__pyx_n_u_X,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1844, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1844, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1844, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "matSolveTranspose", 0) < (0)) __PYX_ERR(49, 1844, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("matSolveTranspose", 1, 2, 2, i); __PYX_ERR(49, 1844, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1844, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 1844, __pyx_L3_error)
    }
    __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, 1844, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "B", 0))) __PYX_ERR(49, 1844, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(49, 1844, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_112matSolveTranspose(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_B, __pyx_v_X);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_112matSolveTranspose(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1861
 * 
 *         """
 *         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, 1861, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1844
 *         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":1863
 *         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_115setIterationNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_114setIterationNumber, "KSP.setIterationNumber(self, its: int) -> None\nUse `its` property.\nSource code at petsc4py/PETSc/KSP.pyx:1863");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_115setIterationNumber = {"setIterationNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_115setIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_114setIterationNumber};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_115setIterationNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_its,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1863, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1863, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setIterationNumber", 0) < (0)) __PYX_ERR(49, 1863, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setIterationNumber", 1, 1, 1, i); __PYX_ERR(49, 1863, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1863, __pyx_L3_error)
    }
    __pyx_v_its = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setIterationNumber", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1863, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_114setIterationNumber(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_its);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_114setIterationNumber(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1865
 *     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, 1865, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":1866
 *         """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, 1866, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1863
 *         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":1868
 *         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_117getIterationNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_116getIterationNumber, "KSP.getIterationNumber(self) -> int\nUse `its` property.\nSource code at petsc4py/PETSc/KSP.pyx:1868");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_117getIterationNumber = {"getIterationNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_117getIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_116getIterationNumber};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_117getIterationNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getIterationNumber", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_116getIterationNumber(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_116getIterationNumber(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1870
 *     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":1871
 *         """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, 1871, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1872
 *         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, 1872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":1868
 *         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":1874
 *         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_119setResidualNorm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_118setResidualNorm, "KSP.setResidualNorm(self, rnorm: float) -> None\nUse `norm` property.\nSource code at petsc4py/PETSc/KSP.pyx:1874");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_119setResidualNorm = {"setResidualNorm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_119setResidualNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_118setResidualNorm};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_119setResidualNorm(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rnorm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1874, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1874, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setResidualNorm", 0) < (0)) __PYX_ERR(49, 1874, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setResidualNorm", 1, 1, 1, i); __PYX_ERR(49, 1874, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1874, __pyx_L3_error)
    }
    __pyx_v_rnorm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setResidualNorm", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1874, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_118setResidualNorm(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_rnorm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_118setResidualNorm(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1876
 *     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, 1876, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":1877
 *         """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, 1877, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1874
 *         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":1879
 *         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_121getResidualNorm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_120getResidualNorm, "KSP.getResidualNorm(self) -> float\nUse `norm` property.\nSource code at petsc4py/PETSc/KSP.pyx:1879");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_121getResidualNorm = {"getResidualNorm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_121getResidualNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_120getResidualNorm};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_121getResidualNorm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getResidualNorm", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_120getResidualNorm(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_120getResidualNorm(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1881
 *     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":1882
 *         """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, 1882, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1883
 *         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, 1883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":1879
 *         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":1885
 *         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_123setConvergedReason(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_122setConvergedReason, "KSP.setConvergedReason(self, reason: KSP.ConvergedReason) -> None\nUse `reason` property.\nSource code at petsc4py/PETSc/KSP.pyx:1885");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_123setConvergedReason = {"setConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_123setConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_122setConvergedReason};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_123setConvergedReason(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_reason,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1885, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1885, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setConvergedReason", 0) < (0)) __PYX_ERR(49, 1885, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, i); __PYX_ERR(49, 1885, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1885, __pyx_L3_error)
    }
    __pyx_v_reason = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1885, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_122setConvergedReason(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_reason);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_122setConvergedReason(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1887
 *     def setConvergedReason(self, reason: KSP.ConvergedReason) -> None:
 *         """Use `reason` property."""
 *         cdef PetscKSPConvergedReason val = reason             # <<<<<<<<<<<<<<
 *         CHKERR(KSPSetConvergedReason(self.ksp, val))
 * 
*/
  __pyx_t_1 = ((KSPConvergedReason)__Pyx_PyLong_As_KSPConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1887, __pyx_L1_error)
  __pyx_v_val = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":1888
 *         """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, 1888, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1885
 *         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":1890
 *         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_125getConvergedReason(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_124getConvergedReason, "KSP.getConvergedReason(self) -> KSP.ConvergedReason\nUse `reason` property.\nSource code at petsc4py/PETSc/KSP.pyx:1890");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_125getConvergedReason = {"getConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_125getConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_124getConvergedReason};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_125getConvergedReason(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getConvergedReason", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_124getConvergedReason(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_124getConvergedReason(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1892
 *     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":1893
 *         """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, 1893, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1894
 *         cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING
 *         CHKERR(KSPGetConvergedReason(self.ksp, &reason))
 *         return reason             # <<<<<<<<<<<<<<
 * 
 *     def getCGObjectiveValue(self) -> float:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_KSPConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":1890
 *         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":1896
 *         return reason
 * 
 *     def getCGObjectiveValue(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the CG objective function value.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_127getCGObjectiveValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_126getCGObjectiveValue, "KSP.getCGObjectiveValue(self) -> float\nReturn the CG objective function value.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.KSPCGGetObjFcn\n\n        \nSource code at petsc4py/PETSc/KSP.pyx:1896");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_127getCGObjectiveValue = {"getCGObjectiveValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_127getCGObjectiveValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_126getCGObjectiveValue};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_127getCGObjectiveValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getCGObjectiveValue (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCGObjectiveValue", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCGObjectiveValue", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_126getCGObjectiveValue(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_126getCGObjectiveValue(struct PyPetscKSPObject *__pyx_v_self) {
  PetscReal __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("getCGObjectiveValue", 0);

  /* "petsc4py/PETSc/KSP.pyx":1906
 * 
 *         """
 *         cdef PetscReal cval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(KSPCGGetObjFcn(self.ksp, &cval))
 *         return cval
*/
  __pyx_v_cval = 0.0;

  /* "petsc4py/PETSc/KSP.pyx":1907
 *         """
 *         cdef PetscReal cval = 0
 *         CHKERR(KSPCGGetObjFcn(self.ksp, &cval))             # <<<<<<<<<<<<<<
 *         return cval
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPCGGetObjFcn(__pyx_v_self->ksp, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1907, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1908
 *         cdef PetscReal cval = 0
 *         CHKERR(KSPCGGetObjFcn(self.ksp, &cval))
 *         return cval             # <<<<<<<<<<<<<<
 * 
 *     def setHPDDMType(self, hpddm_type: HPDDMType) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":1896
 *         return reason
 * 
 *     def getCGObjectiveValue(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the CG objective function value.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.KSP.getCGObjectiveValue", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/KSP.pyx":1910
 *         return cval
 * 
 *     def setHPDDMType(self, hpddm_type: HPDDMType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the Krylov solver type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_129setHPDDMType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_128setHPDDMType, "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:1910");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_129setHPDDMType = {"setHPDDMType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_129setHPDDMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_128setHPDDMType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_129setHPDDMType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_hpddm_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1910, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setHPDDMType", 0) < (0)) __PYX_ERR(49, 1910, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setHPDDMType", 1, 1, 1, i); __PYX_ERR(49, 1910, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1910, __pyx_L3_error)
    }
    __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, 1910, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_128setHPDDMType(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_hpddm_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_128setHPDDMType(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1925
 * 
 *         """
 *         cdef PetscKSPHPDDMType ctype = hpddm_type             # <<<<<<<<<<<<<<
 *         CHKERR(KSPHPDDMSetType(self.ksp, ctype))
 * 
*/
  __pyx_t_1 = ((KSPHPDDMType)__Pyx_PyLong_As_KSPHPDDMType(__pyx_v_hpddm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(49, 1925, __pyx_L1_error)
  __pyx_v_ctype = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":1926
 *         """
 *         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, 1926, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1910
 *         return cval
 * 
 *     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":1928
 *         CHKERR(KSPHPDDMSetType(self.ksp, ctype))
 * 
 *     def getHPDDMType(self) -> HPDDMType:             # <<<<<<<<<<<<<<
 *         """Return the Krylov solver type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_131getHPDDMType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_130getHPDDMType, "KSP.getHPDDMType(self) -> HPDDMType\nReturn the Krylov solver type.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.KSPHPDDMGetType\n\n        \nSource code at petsc4py/PETSc/KSP.pyx:1928");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_131getHPDDMType = {"getHPDDMType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_131getHPDDMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_130getHPDDMType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_131getHPDDMType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getHPDDMType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_130getHPDDMType(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_130getHPDDMType(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1938
 * 
 *         """
 *         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":1939
 *         """
 *         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, 1939, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1940
 *         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_PyLong_From_KSPHPDDMType(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":1928
 *         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":1942
 *         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_133setErrorIfNotConverged(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_132setErrorIfNotConverged, "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:1942");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_133setErrorIfNotConverged = {"setErrorIfNotConverged", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_133setErrorIfNotConverged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_132setErrorIfNotConverged};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_133setErrorIfNotConverged(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 1942, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1942, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setErrorIfNotConverged", 0) < (0)) __PYX_ERR(49, 1942, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setErrorIfNotConverged", 1, 1, 1, i); __PYX_ERR(49, 1942, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 1942, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setErrorIfNotConverged", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 1942, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_132setErrorIfNotConverged(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_132setErrorIfNotConverged(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1957
 * 
 *         """
 *         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, 1957, __pyx_L1_error)
  __pyx_v_ernc = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":1958
 *         """
 *         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, 1958, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1942
 *         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":1960
 *         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_135getErrorIfNotConverged(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_134getErrorIfNotConverged, "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:1960");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_135getErrorIfNotConverged = {"getErrorIfNotConverged", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_135getErrorIfNotConverged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_134getErrorIfNotConverged};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_135getErrorIfNotConverged(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getErrorIfNotConverged", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_134getErrorIfNotConverged(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_134getErrorIfNotConverged(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":1970
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(KSPGetErrorIfNotConverged(self.ksp, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/KSP.pyx":1971
 *         """
 *         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, 1971, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1972
 *         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, 1972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":1960
 *         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":1974
 *         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_137getRhs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_136getRhs, "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:1974");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_137getRhs = {"getRhs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_137getRhs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_136getRhs};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_137getRhs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getRhs", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_136getRhs(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_136getRhs(struct PyPetscKSPObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_vec = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getRhs", 0);

  /* "petsc4py/PETSc/KSP.pyx":1984
 * 
 *         """
 *         cdef Vec vec = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(KSPGetRhs(self.ksp, &vec.vec))
 *         CHKERR(PetscINCREF(vec.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 1984, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1985
 *         """
 *         cdef Vec vec = Vec()
 *         CHKERR(KSPGetRhs(self.ksp, &vec.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(vec.obj))
 *         return vec
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetRhs(__pyx_v_self->ksp, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1985, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1986
 *         cdef Vec vec = Vec()
 *         CHKERR(KSPGetRhs(self.ksp, &vec.vec))
 *         CHKERR(PetscINCREF(vec.obj))             # <<<<<<<<<<<<<<
 *         return vec
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 1986, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":1987
 *         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":1974
 *         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_XDECREF(__pyx_t_2);
  __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":1989
 *         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_139getSolution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_138getSolution, "KSP.getSolution(self) -> Vec\nReturn the solution for the linear system to be solved.\n\n        Not collective.\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:1989");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_139getSolution = {"getSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_139getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_138getSolution};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_139getSolution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSolution", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_138getSolution(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_138getSolution(struct PyPetscKSPObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_vec = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getSolution", 0);

  /* "petsc4py/PETSc/KSP.pyx":2002
 * 
 *         """
 *         cdef Vec vec = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(KSPGetSolution(self.ksp, &vec.vec))
 *         CHKERR(PetscINCREF(vec.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2002, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2003
 *         """
 *         cdef Vec vec = Vec()
 *         CHKERR(KSPGetSolution(self.ksp, &vec.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(vec.obj))
 *         return vec
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetSolution(__pyx_v_self->ksp, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2003, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2004
 *         cdef Vec vec = Vec()
 *         CHKERR(KSPGetSolution(self.ksp, &vec.vec))
 *         CHKERR(PetscINCREF(vec.obj))             # <<<<<<<<<<<<<<
 *         return vec
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2004, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2005
 *         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":1989
 *         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_XDECREF(__pyx_t_2);
  __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":2007
 *         return vec
 * 
 *     def getWorkVecs(             # <<<<<<<<<<<<<<
 *         self,
 *         right: int | None = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_141getWorkVecs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_140getWorkVecs, "KSP.getWorkVecs(self, right: int | None = None, left: int | None = None) -> tuple[list[Vec], list[Vec]] | list[Vec] | None\nCreate working vectors.\n\n        Collective.\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:2007");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_141getWorkVecs = {"getWorkVecs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_141getWorkVecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_140getWorkVecs};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_141getWorkVecs(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_right,&__pyx_mstate_global->__pyx_n_u_left,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 2007, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 2007, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 2007, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getWorkVecs", 0) < (0)) __PYX_ERR(49, 2007, __pyx_L3_error)

      /* "petsc4py/PETSc/KSP.pyx":2009
 *     def getWorkVecs(
 *         self,
 *         right: int | None = None,             # <<<<<<<<<<<<<<
 *         left: int | None = None) -> tuple[list[Vec], list[Vec]] | list[Vec] | None:
 *         """Create working vectors.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":2010
 *         self,
 *         right: int | None = None,
 *         left: int | None = None) -> tuple[list[Vec], list[Vec]] | list[Vec] | None:             # <<<<<<<<<<<<<<
 *         """Create working vectors.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 2007, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 2007, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/KSP.pyx":2009
 *     def getWorkVecs(
 *         self,
 *         right: int | None = None,             # <<<<<<<<<<<<<<
 *         left: int | None = None) -> tuple[list[Vec], list[Vec]] | list[Vec] | None:
 *         """Create working vectors.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":2010
 *         self,
 *         right: int | None = None,
 *         left: int | None = None) -> tuple[list[Vec], list[Vec]] | list[Vec] | None:             # <<<<<<<<<<<<<<
 *         """Create working vectors.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2007, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_140getWorkVecs(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_right, __pyx_v_left);

  /* "petsc4py/PETSc/KSP.pyx":2007
 *         return vec
 * 
 *     def getWorkVecs(             # <<<<<<<<<<<<<<
 *         self,
 *         right: int | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_140getWorkVecs(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":2030
 * 
 *         """
 *         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":2031
 *         """
 *         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":2032
 *         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":2033
 *         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":2034
 *         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, 2034, __pyx_L1_error)
    __pyx_v_nr = __pyx_t_2;
  }

  /* "petsc4py/PETSc/KSP.pyx":2035
 *         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, 2035, __pyx_L1_error)
    __pyx_v_nl = __pyx_t_2;
  }

  /* "petsc4py/PETSc/KSP.pyx":2036
 *         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, 2036, __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":2037
 *         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, 2037, __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":2038
 *         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, 2038, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2039
 *         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":2040
 *         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":2041
 *         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, 2041, __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, 2041, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }

    /* "petsc4py/PETSc/KSP.pyx":2042
 *             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":2043
 *                 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, 2043, __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, 2043, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
  }

  /* "petsc4py/PETSc/KSP.pyx":2045
 *                 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":2046
 *         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":2045
 *                 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":2047
 *             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":2048
 *                 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":2047
 *             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;
       __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
      if ( 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":2045
 *                 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":2046
 *         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":2045
 *                 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":2047
 *             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":2048
 *                 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":2047
 *             if nr > 0 and vr != NULL:
 *                 VecDestroyVecs(nr, &vr) # XXX errors?
 *             if nl > 0 and vl !=NULL:             # <<<<<<<<<<<<<<
 *                 VecDestroyVecs(nl, &vl) # XXX errors?
 *         #
*/
        }
      }
      __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":2050
 *                 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, 2050, __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) != (0)) __PYX_ERR(49, 2050, __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) != (0)) __PYX_ERR(49, 2050, __pyx_L1_error);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/KSP.pyx":2051
 *         #
 *         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":2052
 *         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":2053
 *         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":2007
 *         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":2055
 *         else:       return None
 * 
 *     def buildSolution(self, Vec x=None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the solution vector.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_143buildSolution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_142buildSolution, "KSP.buildSolution(self, x: Vec | None = None) -> Vec\nReturn the solution vector.\n\n        Collective.\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:2055");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_143buildSolution = {"buildSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_143buildSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_142buildSolution};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_143buildSolution(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 2055, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 2055, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "buildSolution", 0) < (0)) __PYX_ERR(49, 2055, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 2055, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 2055, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(49, 2055, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_142buildSolution(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_x);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_142buildSolution(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  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":2070
 * 
 *         """
 *         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_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2070, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_x, ((struct PyPetscVecObject *)__pyx_t_2));
    __pyx_t_2 = 0;
  }

  /* "petsc4py/PETSc/KSP.pyx":2071
 *         """
 *         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":2072
 *         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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetSolution(__pyx_v_self->ksp, (&__pyx_v_x->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2072, __pyx_L1_error)

    /* "petsc4py/PETSc/KSP.pyx":2073
 *         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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_x->vec, (&__pyx_v_x->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2073, __pyx_L1_error)

    /* "petsc4py/PETSc/KSP.pyx":2071
 *         """
 *         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":2074
 *             CHKERR(KSPGetSolution(self.ksp, &x.vec))
 *             CHKERR(VecDuplicate(x.vec, &x.vec))
 *         CHKERR(KSPBuildSolution(self.ksp, x.vec, NULL))             # <<<<<<<<<<<<<<
 *         return x
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPBuildSolution(__pyx_v_self->ksp, __pyx_v_x->vec, NULL)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2074, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2075
 *             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":2055
 *         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_XDECREF(__pyx_t_3);
  __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":2077
 *         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_145buildResidual(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_144buildResidual, "KSP.buildResidual(self, r: Vec | None = None) -> Vec\nReturn the residual of the linear system.\n\n        Collective.\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:2077");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_145buildResidual = {"buildResidual", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_145buildResidual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_144buildResidual};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_145buildResidual(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_r,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 2077, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 2077, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "buildResidual", 0) < (0)) __PYX_ERR(49, 2077, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 2077, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 2077, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "r", 0))) __PYX_ERR(49, 2077, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_144buildResidual(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_r);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_144buildResidual(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  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":2092
 * 
 *         """
 *         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_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2092, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_r, ((struct PyPetscVecObject *)__pyx_t_2));
    __pyx_t_2 = 0;
  }

  /* "petsc4py/PETSc/KSP.pyx":2093
 *         """
 *         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":2094
 *         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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPGetRhs(__pyx_v_self->ksp, (&__pyx_v_r->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2094, __pyx_L1_error)

    /* "petsc4py/PETSc/KSP.pyx":2095
 *         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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecDuplicate(__pyx_v_r->vec, (&__pyx_v_r->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2095, __pyx_L1_error)

    /* "petsc4py/PETSc/KSP.pyx":2093
 *         """
 *         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":2096
 *             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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(KSPBuildResidual(__pyx_v_self->ksp, NULL, __pyx_v_r->vec, (&__pyx_v_r->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2096, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2097
 *             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":2077
 *         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_XDECREF(__pyx_t_3);
  __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":2099
 *         return r
 * 
 *     def computeEigenvalues(self) -> ArrayComplex:             # <<<<<<<<<<<<<<
 *         """Compute the extreme eigenvalues for the preconditioned operator.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_147computeEigenvalues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_146computeEigenvalues, "KSP.computeEigenvalues(self) -> ArrayComplex\nCompute the extreme eigenvalues for the preconditioned operator.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.KSPComputeEigenvalues\n\n        \nSource code at petsc4py/PETSc/KSP.pyx:2099");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_147computeEigenvalues = {"computeEigenvalues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_147computeEigenvalues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_146computeEigenvalues};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_147computeEigenvalues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("computeEigenvalues", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_146computeEigenvalues(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_146computeEigenvalues(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":2109
 * 
 *         """
 *         cdef PetscInt its = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt neig = 0
 *         cdef PetscReal *rdata = NULL
*/
  __pyx_v_its = 0;

  /* "petsc4py/PETSc/KSP.pyx":2110
 *         """
 *         cdef PetscInt its = 0
 *         cdef PetscInt neig = 0             # <<<<<<<<<<<<<<
 *         cdef PetscReal *rdata = NULL
 *         cdef PetscReal *idata = NULL
*/
  __pyx_v_neig = 0;

  /* "petsc4py/PETSc/KSP.pyx":2111
 *         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":2112
 *         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":2113
 *         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, 2113, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2114
 *         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, 2114, __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, 2114, __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":2115
 *         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, 2115, __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, 2115, __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":2116
 *         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, 2116, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2117
 *         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, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_eigen = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2118
 *         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, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_eigen), __pyx_mstate_global->__pyx_n_u_real, __pyx_t_2) < (0)) __PYX_ERR(49, 2118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2119
 *         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, 2119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_eigen), __pyx_mstate_global->__pyx_n_u_imag, __pyx_t_2) < (0)) __PYX_ERR(49, 2119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2120
 *         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":2099
 *         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":2122
 *         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_149computeExtremeSingularValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_148computeExtremeSingularValues, "KSP.computeExtremeSingularValues(self) -> tuple[float, float]\nCompute the extreme singular values for the preconditioned operator.\n\n        Collective.\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:2122");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_149computeExtremeSingularValues = {"computeExtremeSingularValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_149computeExtremeSingularValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_148computeExtremeSingularValues};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_149computeExtremeSingularValues(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("computeExtremeSingularValues", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_148computeExtremeSingularValues(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_148computeExtremeSingularValues(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":2139
 * 
 *         """
 *         cdef PetscReal smax = 0             # <<<<<<<<<<<<<<
 *         cdef PetscReal smin = 0
 *         CHKERR(KSPComputeExtremeSingularValues(self.ksp, &smax, &smin))
*/
  __pyx_v_smax = 0.0;

  /* "petsc4py/PETSc/KSP.pyx":2140
 *         """
 *         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":2141
 *         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, 2141, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2142
 *         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, 2142, __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, 2142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 2142, __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) != (0)) __PYX_ERR(49, 2142, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(49, 2142, __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":2122
 *         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":2146
 *     # --- GMRES ---
 * 
 *     def setGMRESRestart(self, restart: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set number of iterations at which KSP restarts.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_151setGMRESRestart(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_150setGMRESRestart, "KSP.setGMRESRestart(self, restart: int) -> None\nSet number of iterations at which KSP restarts.\n\n        Logically collective.\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:2146");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_151setGMRESRestart = {"setGMRESRestart", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_151setGMRESRestart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_150setGMRESRestart};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_151setGMRESRestart(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_restart,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 2146, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 2146, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setGMRESRestart", 0) < (0)) __PYX_ERR(49, 2146, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setGMRESRestart", 1, 1, 1, i); __PYX_ERR(49, 2146, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 2146, __pyx_L3_error)
    }
    __pyx_v_restart = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setGMRESRestart", 1, 1, 1, __pyx_nargs); __PYX_ERR(49, 2146, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_150setGMRESRestart(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_restart);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_150setGMRESRestart(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":2163
 * 
 *         """
 *         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, 2163, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":2164
 *         """
 *         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, 2164, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2146
 *     # --- 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":2168
 *     # --- Python ---
 * 
 *     def createPython(             # <<<<<<<<<<<<<<
 *         self,
 *         context: Any = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_153createPython(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_152createPython, "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:2168");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_153createPython = {"createPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_153createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_152createPython};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_153createPython(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_context,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 2168, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 2168, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 2168, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createPython", 0) < (0)) __PYX_ERR(49, 2168, __pyx_L3_error)

      /* "petsc4py/PETSc/KSP.pyx":2170
 *     def createPython(
 *         self,
 *         context: Any = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a linear solver of Python type.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":2171
 *         self,
 *         context: Any = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a linear solver of Python type.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(49, 2168, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 2168, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/KSP.pyx":2170
 *     def createPython(
 *         self,
 *         context: Any = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a linear solver of Python type.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/KSP.pyx":2171
 *         self,
 *         context: Any = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a linear solver of Python type.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2168, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_152createPython(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_context, __pyx_v_comm);

  /* "petsc4py/PETSc/KSP.pyx":2168
 *     # --- Python ---
 * 
 *     def createPython(             # <<<<<<<<<<<<<<
 *         self,
 *         context: Any = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_152createPython(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":2189
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(49, 2189, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/KSP.pyx":2190
 *         """
 *         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":2191
 *         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, 2191, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2192
 *         cdef PetscKSP newksp = NULL
 *         CHKERR(KSPCreate(ccomm, &newksp))
 *         CHKERR(PetscCLEAR(self.obj)); self.ksp = newksp             # <<<<<<<<<<<<<<
 *         CHKERR(KSPSetType(self.ksp, KSPPYTHON))
 *         CHKERR(KSPPythonSetContext(self.ksp, <void*>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, 2192, __pyx_L1_error)
  __pyx_v_self->ksp = __pyx_v_newksp;

  /* "petsc4py/PETSc/KSP.pyx":2193
 *         CHKERR(KSPCreate(ccomm, &newksp))
 *         CHKERR(PetscCLEAR(self.obj)); self.ksp = newksp
 *         CHKERR(KSPSetType(self.ksp, KSPPYTHON))             # <<<<<<<<<<<<<<
 *         CHKERR(KSPPythonSetContext(self.ksp, <void*>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, 2193, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2194
 *         CHKERR(PetscCLEAR(self.obj)); self.ksp = newksp
 *         CHKERR(KSPSetType(self.ksp, KSPPYTHON))
 *         CHKERR(KSPPythonSetContext(self.ksp, <void*>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, 2194, __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, 2194, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2195
 *         CHKERR(KSPSetType(self.ksp, KSPPYTHON))
 *         CHKERR(KSPPythonSetContext(self.ksp, <void*>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":2168
 *     # --- 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":2197
 *         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_155setPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_154setPythonContext, "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:2197");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_155setPythonContext = {"setPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_155setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_154setPythonContext};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_155setPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_context,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 2197, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 2197, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPythonContext", 0) < (0)) __PYX_ERR(49, 2197, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 2197, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPythonContext", 0, 0, 1, __pyx_nargs); __PYX_ERR(49, 2197, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_154setPythonContext(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_context);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_154setPythonContext(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":2207
 * 
 *         """
 *         CHKERR(KSPPythonSetContext(self.ksp, <void*>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, 2207, __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, 2207, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2197
 *         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":2209
 *         CHKERR(KSPPythonSetContext(self.ksp, <void*>context))
 * 
 *     def getPythonContext(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return the instance of the class implementing Python methods.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_157getPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_156getPythonContext, "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:2209");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_157getPythonContext = {"getPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_157getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_156getPythonContext};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_157getPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPythonContext", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_156getPythonContext(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_156getPythonContext(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":2219
 * 
 *         """
 *         cdef void *context = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(KSPPythonGetContext(self.ksp, &context))
 *         if context == NULL: return None
*/
  __pyx_v_context = NULL;

  /* "petsc4py/PETSc/KSP.pyx":2220
 *         """
 *         cdef void *context = NULL
 *         CHKERR(KSPPythonGetContext(self.ksp, &context))             # <<<<<<<<<<<<<<
 *         if context == NULL: return None
 *         else: return <object> context
*/
  __pyx_t_1 = KSPPythonGetContext(__pyx_v_self->ksp, (&__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(49, 2220, __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, 2220, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2221
 *         cdef void *context = NULL
 *         CHKERR(KSPPythonGetContext(self.ksp, &context))
 *         if context == NULL: return None             # <<<<<<<<<<<<<<
 *         else: return <object> 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":2222
 *         CHKERR(KSPPythonGetContext(self.ksp, &context))
 *         if context == NULL: return None
 *         else: return <object> 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":2209
 *         CHKERR(KSPPythonSetContext(self.ksp, <void*>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":2224
 *         else: return <object> 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_159setPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_158setPythonType, "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:2224");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_159setPythonType = {"setPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_159setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_158setPythonType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_159setPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_py_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(49, 2224, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 2224, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPythonType", 0) < (0)) __PYX_ERR(49, 2224, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, i); __PYX_ERR(49, 2224, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(49, 2224, __pyx_L3_error)
    }
    __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, 2224, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_158setPythonType(((struct PyPetscKSPObject *)__pyx_v_self), __pyx_v_py_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_158setPythonType(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":2235
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         py_type = str2bytes(py_type, &cval)
 *         CHKERR(KSPPythonSetType(self.ksp, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/KSP.pyx":2236
 *         """
 *         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, 2236, __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":2237
 *         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, 2237, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2224
 *         else: return <object> 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":2239
 *         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_161getPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_160getPythonType, "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:2239");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3KSP_161getPythonType = {"getPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_161getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_160getPythonType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3KSP_161getPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPythonType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3KSP_160getPythonType(((struct PyPetscKSPObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3KSP_160getPythonType(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", 0);

  /* "petsc4py/PETSc/KSP.pyx":2250
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(KSPPythonGetType(self.ksp, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/KSP.pyx":2251
 *         """
 *         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, 2251, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2252
 *         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, 2252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":2239
 *         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":2258
 *     property appctx:
 *         """The solver application context."""
 *         def __get__(self) -> Any:             # <<<<<<<<<<<<<<
 *             return self.getAppCtx()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2259
 *         """The solver application context."""
 *         def __get__(self) -> Any:
 *             return self.getAppCtx()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getAppCtx, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":2258
 *     property appctx:
 *         """The solver application context."""
 *         def __get__(self) -> Any:             # <<<<<<<<<<<<<<
 *             return self.getAppCtx()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2261
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2262
 * 
 *         def __set__(self, value):
 *             self.setAppCtx(value)             # <<<<<<<<<<<<<<
 * 
 *     # --- discretization space ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setAppCtx, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2261
 *             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_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":2268
 *     property dm:
 *         """The solver `DM`."""
 *         def __get__(self) -> DM:             # <<<<<<<<<<<<<<
 *             return self.getDM()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2269
 *         """The solver `DM`."""
 *         def __get__(self) -> DM:
 *             return self.getDM()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getDM, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":2268
 *     property dm:
 *         """The solver `DM`."""
 *         def __get__(self) -> DM:             # <<<<<<<<<<<<<<
 *             return self.getDM()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2271
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2272
 * 
 *         def __set__(self, value):
 *             self.setDM(value)             # <<<<<<<<<<<<<<
 * 
 *     # --- vectors ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setDM, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2271
 *             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_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":2278
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2279
 *         """The solution vector."""
 *         def __get__(self) -> Vec:
 *             return self.getSolution()             # <<<<<<<<<<<<<<
 * 
 *     property vec_rhs:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolution, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":2278
 *     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_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":2283
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2284
 *         """The right-hand side vector."""
 *         def __get__(self) -> Vec:
 *             return self.getRhs()             # <<<<<<<<<<<<<<
 * 
 *     # --- operators ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getRhs, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":2283
 *     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_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":2290
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2291
 *         """The system matrix operator."""
 *         def __get__(self) -> Mat:
 *             return self.getOperators()[0]             # <<<<<<<<<<<<<<
 * 
 *     property mat_pc:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getOperators, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2291, __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":2290
 *     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_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":2295
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2296
 *         """The preconditioner operator."""
 *         def __get__(self) -> Mat:
 *             return self.getOperators()[1]             # <<<<<<<<<<<<<<
 * 
 *     # --- initial guess ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getOperators, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2296, __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":2295
 *     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_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":2302
 *     property guess_nonzero:
 *         """Whether guess is non-zero."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getInitialGuessNonzero()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2303
 *         """Whether guess is non-zero."""
 *         def __get__(self) -> bool:
 *             return self.getInitialGuessNonzero()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getInitialGuessNonzero, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2303, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":2302
 *     property guess_nonzero:
 *         """Whether guess is non-zero."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getInitialGuessNonzero()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2305
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2306
 * 
 *         def __set__(self, value):
 *             self.setInitialGuessNonzero(value)             # <<<<<<<<<<<<<<
 * 
 *     property guess_knoll:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setInitialGuessNonzero, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2305
 *             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_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":2310
 *     property guess_knoll:
 *         """Whether solver uses Knoll trick."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getInitialGuessKnoll()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2311
 *         """Whether solver uses Knoll trick."""
 *         def __get__(self) -> bool:
 *             return self.getInitialGuessKnoll()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getInitialGuessKnoll, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":2310
 *     property guess_knoll:
 *         """Whether solver uses Knoll trick."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getInitialGuessKnoll()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2313
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2314
 * 
 *         def __set__(self, value):
 *             self.setInitialGuessKnoll(value)             # <<<<<<<<<<<<<<
 * 
 *     # --- preconditioner ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setInitialGuessKnoll, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2313
 *             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_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":2320
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2321
 *         """The `PC` of the solver."""
 *         def __get__(self) -> PC:
 *             return self.getPC()             # <<<<<<<<<<<<<<
 * 
 *     property pc_side:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getPC, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":2320
 *     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_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":2325
 *     property pc_side:
 *         """The side on which preconditioning is performed."""
 *         def __get__(self) -> PC.Side:             # <<<<<<<<<<<<<<
 *             return self.getPCSide()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2326
 *         """The side on which preconditioning is performed."""
 *         def __get__(self) -> PC.Side:
 *             return self.getPCSide()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getPCSide, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":2325
 *     property pc_side:
 *         """The side on which preconditioning is performed."""
 *         def __get__(self) -> PC.Side:             # <<<<<<<<<<<<<<
 *             return self.getPCSide()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2328
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2329
 * 
 *         def __set__(self, value):
 *             self.setPCSide(value)             # <<<<<<<<<<<<<<
 * 
 *     property norm_type:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setPCSide, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2328
 *             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_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":2333
 *     property norm_type:
 *         """The norm used by the solver."""
 *         def __get__(self) -> NormType:             # <<<<<<<<<<<<<<
 *             return self.getNormType()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2334
 *         """The norm used by the solver."""
 *         def __get__(self) -> NormType:
 *             return self.getNormType()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getNormType, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":2333
 *     property norm_type:
 *         """The norm used by the solver."""
 *         def __get__(self) -> NormType:             # <<<<<<<<<<<<<<
 *             return self.getNormType()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2336
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2337
 * 
 *         def __set__(self, value):
 *             self.setNormType(value)             # <<<<<<<<<<<<<<
 * 
 *     # --- tolerances ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setNormType, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2336
 *             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_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":2343
 *     property rtol:
 *         """The relative tolerance of the solver."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[0]
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2344
 *         """The relative tolerance of the solver."""
 *         def __get__(self) -> float:
 *             return self.getTolerances()[0]             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2344, __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":2343
 *     property rtol:
 *         """The relative tolerance of the solver."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[0]
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2346
 *             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;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2347
 * 
 *         def __set__(self, value):
 *             self.setTolerances(rtol=value)             # <<<<<<<<<<<<<<
 * 
 *     property atol:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 2347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_rtol, __pyx_v_value, __pyx_t_4, __pyx_callargs+1, 0) < (0)) __PYX_ERR(49, 2347, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_setTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2346
 *             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_4);
  __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":2351
 *     property atol:
 *         """The absolute tolerance of the solver."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[1]
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2352
 *         """The absolute tolerance of the solver."""
 *         def __get__(self) -> float:
 *             return self.getTolerances()[1]             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2352, __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":2351
 *     property atol:
 *         """The absolute tolerance of the solver."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[1]
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2354
 *             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;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2355
 * 
 *         def __set__(self, value):
 *             self.setTolerances(atol=value)             # <<<<<<<<<<<<<<
 * 
 *     property divtol:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 2355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_atol, __pyx_v_value, __pyx_t_4, __pyx_callargs+1, 0) < (0)) __PYX_ERR(49, 2355, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_setTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2354
 *             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_4);
  __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":2359
 *     property divtol:
 *         """The divergence tolerance of the solver."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[2]
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2360
 *         """The divergence tolerance of the solver."""
 *         def __get__(self) -> float:
 *             return self.getTolerances()[2]             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2360, __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":2359
 *     property divtol:
 *         """The divergence tolerance of the solver."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[2]
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2362
 *             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;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2363
 * 
 *         def __set__(self, value):
 *             self.setTolerances(divtol=value)             # <<<<<<<<<<<<<<
 * 
 *     property max_it:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 2363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_divtol, __pyx_v_value, __pyx_t_4, __pyx_callargs+1, 0) < (0)) __PYX_ERR(49, 2363, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_setTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2362
 *             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_4);
  __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":2367
 *     property max_it:
 *         """The maximum number of iteration the solver may take."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[3]
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2368
 *         """The maximum number of iteration the solver may take."""
 *         def __get__(self) -> int:
 *             return self.getTolerances()[3]             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2368, __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":2367
 *     property max_it:
 *         """The maximum number of iteration the solver may take."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[3]
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2370
 *             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;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2371
 * 
 *         def __set__(self, value):
 *             self.setTolerances(max_it=value)             # <<<<<<<<<<<<<<
 * 
 *     # --- iteration ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 2371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_max_it, __pyx_v_value, __pyx_t_4, __pyx_callargs+1, 0) < (0)) __PYX_ERR(49, 2371, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_setTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2370
 *             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_4);
  __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":2377
 *     property its:
 *         """The current number of iterations the solver has taken."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getIterationNumber()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2378
 *         """The current number of iterations the solver has taken."""
 *         def __get__(self) -> int:
 *             return self.getIterationNumber()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getIterationNumber, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":2377
 *     property its:
 *         """The current number of iterations the solver has taken."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getIterationNumber()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2380
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2381
 * 
 *         def __set__(self, value):
 *             self.setIterationNumber(value)             # <<<<<<<<<<<<<<
 * 
 *     property norm:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setIterationNumber, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2380
 *             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_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":2385
 *     property norm:
 *         """The norm of the residual at the current iteration."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getResidualNorm()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2386
 *         """The norm of the residual at the current iteration."""
 *         def __get__(self) -> float:
 *             return self.getResidualNorm()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getResidualNorm, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2386, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":2385
 *     property norm:
 *         """The norm of the residual at the current iteration."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getResidualNorm()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2388
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2389
 * 
 *         def __set__(self, value):
 *             self.setResidualNorm(value)             # <<<<<<<<<<<<<<
 * 
 *     property history:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setResidualNorm, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2388
 *             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_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":2393
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2394
 *         """The convergence history of the solver."""
 *         def __get__(self) -> ndarray:
 *             return self.getConvergenceHistory()             # <<<<<<<<<<<<<<
 * 
 *     # --- convergence ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getConvergenceHistory, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":2393
 *     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_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":2400
 *     property reason:
 *         """The converged reason."""
 *         def __get__(self) -> KSP.ConvergedReason:             # <<<<<<<<<<<<<<
 *             return self.getConvergedReason()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2401
 *         """The converged reason."""
 *         def __get__(self) -> KSP.ConvergedReason:
 *             return self.getConvergedReason()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getConvergedReason, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/KSP.pyx":2400
 *     property reason:
 *         """The converged reason."""
 *         def __get__(self) -> KSP.ConvergedReason:             # <<<<<<<<<<<<<<
 *             return self.getConvergedReason()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2403
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2404
 * 
 *         def __set__(self, value):
 *             self.setConvergedReason(value)             # <<<<<<<<<<<<<<
 * 
 *     property is_iterating:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setConvergedReason, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2403
 *             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_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":2408
 *     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__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2409
 *         """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_mstate_global->__pyx_n_u_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_EqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2409, __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":2408
 *     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":2413
 *     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__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2414
 *         """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_mstate_global->__pyx_n_u_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2414, __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":2413
 *     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":2418
 *     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__", 0);

  /* "petsc4py/PETSc/KSP.pyx":2419
 *         """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_mstate_global->__pyx_n_u_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 2419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(49, 2419, __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":2418
 *     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":123
 *     # --- xxx ---
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj  = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":124
 * 
 *     def __cinit__(self):
 *         self.obj  = <PetscObject*> &self.snes             # <<<<<<<<<<<<<<
 *         self.snes = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->snes));

  /* "petsc4py/PETSc/SNES.pyx":125
 *     def __cinit__(self):
 *         self.obj  = <PetscObject*> &self.snes
 *         self.snes = NULL             # <<<<<<<<<<<<<<
 * 
 *     # --- xxx ---
*/
  __pyx_v_self->snes = NULL;

  /* "petsc4py/PETSc/SNES.pyx":123
 *     # --- xxx ---
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj  = <PetscObject*> &self.snes
 *         self.snes = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":129
 *     # --- 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:129");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_3view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_2view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 129, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 129, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(50, 129, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 129, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 129, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(50, 129, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/SNES.pyx":144
 * 
 *         """
 *         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":145
 *         """
 *         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":146
 *         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, 146, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":129
 *     # --- 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":148
 *         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:148");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_5destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_4destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/SNES.pyx":158
 * 
 *         """
 *         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, 158, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":159
 *         """
 *         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":148
 *         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":161
 *         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:161");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_7create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_6create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 161, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 161, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(50, 161, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 161, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(50, 161, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":176
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(50, 176, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":177
 *         """
 *         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":178
 *         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, 178, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":179
 *         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, 179, __pyx_L1_error)
  __pyx_v_self->snes = __pyx_v_newsnes;

  /* "petsc4py/PETSc/SNES.pyx":180
 *         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":161
 *         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":182
 *         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:182");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_9setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_8setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_snes_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 182, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 182, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(50, 182, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(50, 182, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 182, __pyx_L3_error)
    }
    __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, 182, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":197
 * 
 *         """
 *         cdef PetscSNESType cval = NULL             # <<<<<<<<<<<<<<
 *         snes_type = str2bytes(snes_type, &cval)
 *         CHKERR(SNESSetType(self.snes, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/SNES.pyx":198
 *         """
 *         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, 198, __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":199
 *         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, 199, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":182
 *         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":201
 *         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:201");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_11getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_10getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/SNES.pyx":211
 * 
 *         """
 *         cdef PetscSNESType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetType(self.snes, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/SNES.pyx":212
 *         """
 *         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, 212, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":213
 *         cdef PetscSNESType cval = NULL
 *         CHKERR(SNESGetType(self.snes, &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":201
 *         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":215
 *         return bytes2str(cval)
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> 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) -> 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:215");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_13setOptionsPrefix = {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_13setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_12setOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 215, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 215, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOptionsPrefix", 0) < (0)) __PYX_ERR(50, 215, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, i); __PYX_ERR(50, 215, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 215, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 215, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":225
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(SNESSetOptionsPrefix(self.snes, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/SNES.pyx":226
 *         """
 *         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, 226, __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":227
 *         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, 227, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":215
 *         return bytes2str(cval)
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> 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":229
 *         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:229");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_15getOptionsPrefix = {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_15getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_14getOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOptionsPrefix", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/SNES.pyx":239
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetOptionsPrefix(self.snes, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/SNES.pyx":240
 *         """
 *         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, 240, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":241
 *         cdef const char *cval = NULL
 *         CHKERR(SNESGetOptionsPrefix(self.snes, &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":229
 *         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":243
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> 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) -> 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:243");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_17appendOptionsPrefix = {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_17appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_16appendOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 243, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 243, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "appendOptionsPrefix", 0) < (0)) __PYX_ERR(50, 243, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, i); __PYX_ERR(50, 243, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 243, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 243, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":253
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(SNESAppendOptionsPrefix(self.snes, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/SNES.pyx":254
 *         """
 *         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, 254, __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":255
 *         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, 255, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":243
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> 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":257
 *         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:257");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_19setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_19setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_18setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/SNES.pyx":267
 * 
 *         """
 *         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, 267, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":257
 *         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":271
 *     # --- 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:271");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_21setApplicationContext = {"setApplicationContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_21setApplicationContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_20setApplicationContext};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_appctx,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 271, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 271, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setApplicationContext", 0) < (0)) __PYX_ERR(50, 271, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setApplicationContext", 1, 1, 1, i); __PYX_ERR(50, 271, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 271, __pyx_L3_error)
    }
    __pyx_v_appctx = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setApplicationContext", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 271, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":273
 *     def setApplicationContext(self, appctx: Any) -> None:
 *         """Set the application context."""
 *         self.set_attr('__appctx__', appctx)             # <<<<<<<<<<<<<<
 *         if appctx is not None:
 *             registerAppCtx(<void*>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, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":274
 *         """Set the application context."""
 *         self.set_attr('__appctx__', appctx)
 *         if appctx is not None:             # <<<<<<<<<<<<<<
 *             registerAppCtx(<void*>appctx)
 *             CHKERR(SNESSetApplicationContext(self.snes, <void*>appctx))
*/
  __pyx_t_2 = (__pyx_v_appctx != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/SNES.pyx":275
 *         self.set_attr('__appctx__', appctx)
 *         if appctx is not None:
 *             registerAppCtx(<void*>appctx)             # <<<<<<<<<<<<<<
 *             CHKERR(SNESSetApplicationContext(self.snes, <void*>appctx))
 *         else:
*/
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_registerAppCtx(((void *)__pyx_v_appctx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "petsc4py/PETSc/SNES.pyx":276
 *         if appctx is not None:
 *             registerAppCtx(<void*>appctx)
 *             CHKERR(SNESSetApplicationContext(self.snes, <void*>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, 276, __pyx_L1_error)

    /* "petsc4py/PETSc/SNES.pyx":274
 *         """Set the application context."""
 *         self.set_attr('__appctx__', appctx)
 *         if appctx is not None:             # <<<<<<<<<<<<<<
 *             registerAppCtx(<void*>appctx)
 *             CHKERR(SNESSetApplicationContext(self.snes, <void*>appctx))
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/SNES.pyx":278
 *             CHKERR(SNESSetApplicationContext(self.snes, <void*>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, 278, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/SNES.pyx":271
 *     # --- 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":280
 *             CHKERR(SNESSetApplicationContext(self.snes, NULL))
 * 
 *     def getApplicationContext(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return the application context."""
 *         cdef void *ctx = NULL
*/

/* 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:280");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_23getApplicationContext = {"getApplicationContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_23getApplicationContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_22getApplicationContext};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getApplicationContext", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/SNES.pyx":282
 *     def getApplicationContext(self) -> Any:
 *         """Return the application context."""
 *         cdef void *ctx = NULL             # <<<<<<<<<<<<<<
 *         appctx = self.get_attr('__appctx__')
 *         if appctx is None:
*/
  __pyx_v_ctx = NULL;

  /* "petsc4py/PETSc/SNES.pyx":283
 *         """Return the application context."""
 *         cdef void *ctx = NULL
 *         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, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_appctx = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":284
 *         cdef void *ctx = NULL
 *         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":285
 *         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, 285, __pyx_L1_error)

    /* "petsc4py/PETSc/SNES.pyx":286
 *         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, 286, __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":284
 *         cdef void *ctx = NULL
 *         appctx = self.get_attr('__appctx__')
 *         if appctx is None:             # <<<<<<<<<<<<<<
 *             CHKERR(SNESGetApplicationContext(self.snes, &ctx))
 *             appctx = toAppCtx(ctx)
*/
  }

  /* "petsc4py/PETSc/SNES.pyx":287
 *             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":280
 *             CHKERR(SNESSetApplicationContext(self.snes, NULL))
 * 
 *     def getApplicationContext(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return the application context."""
 *         cdef void *ctx = NULL
*/

  /* 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":295
 *     # --- 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:295");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_25getDM = {"getDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_25getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_24getDM};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDM", __pyx_kwds); 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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDM", 0);

  /* "petsc4py/PETSc/SNES.pyx":305
 * 
 *         """
 *         cdef PetscDM newdm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetDM(self.snes, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()
*/
  __pyx_v_newdm = NULL;

  /* "petsc4py/PETSc/SNES.pyx":306
 *         """
 *         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, 306, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":307
 *         cdef PetscDM newdm = NULL
 *         CHKERR(SNESGetDM(self.snes, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()             # <<<<<<<<<<<<<<
 *         dm.dm = newdm
 *         CHKERR(PetscINCREF(dm.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(50, 307, __pyx_L1_error)
  __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":308
 *         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":309
 *         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, 309, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":310
 *         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":295
 *     # --- 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_XDECREF(__pyx_t_4);
  __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":312
 *         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:312");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_27setDM = {"setDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_27setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_26setDM};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 312, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDM", 0) < (0)) __PYX_ERR(50, 312, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, i); __PYX_ERR(50, 312, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 312, __pyx_L3_error)
    }
    __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, 312, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(50, 312, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/SNES.pyx":322
 * 
 *         """
 *         CHKERR(SNESSetDM(self.snes, dm.dm))             # <<<<<<<<<<<<<<
 * 
 *     # --- TR ---
*/
  __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, 322, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":312
 *         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":326
 *     # --- TR ---
 * 
 *     def setTRTolerances(self, delta_min: float | None = None, delta_max: float | None = None, delta_0: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the tolerance parameters used for the trust region.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_29setTRTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_28setTRTolerances, "SNES.setTRTolerances(self, delta_min: float | None = None, delta_max: float | None = None, delta_0: float | None = None) -> None\nSet the tolerance parameters used for the trust region.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        delta_min\n            The minimum allowed trust region size. Defaults to `CURRENT`.\n        delta_max\n            The maximum allowed trust region size. Defaults to `CURRENT`.\n        delta_0\n            The initial trust region size. Defaults to `CURRENT`.\n\n        See Also\n        --------\n        getTRTolerances, setTRUpdateParameters\n        petsc.SNESNewtonTRSetTolerances\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:326");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_29setTRTolerances = {"setTRTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_29setTRTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_28setTRTolerances};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_29setTRTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_delta_min = 0;
  PyObject *__pyx_v_delta_max = 0;
  PyObject *__pyx_v_delta_0 = 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("setTRTolerances (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_delta_min,&__pyx_mstate_global->__pyx_n_u_delta_max,&__pyx_mstate_global->__pyx_n_u_delta_0,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 326, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 326, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 326, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 326, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTRTolerances", 0) < (0)) __PYX_ERR(50, 326, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 326, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 326, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 326, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_delta_min = values[0];
    __pyx_v_delta_max = values[1];
    __pyx_v_delta_0 = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setTRTolerances", 0, 0, 3, __pyx_nargs); __PYX_ERR(50, 326, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.setTRTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_28setTRTolerances(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_delta_min, __pyx_v_delta_max, __pyx_v_delta_0);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_28setTRTolerances(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_delta_min, PyObject *__pyx_v_delta_max, PyObject *__pyx_v_delta_0) {
  PetscReal __pyx_v_cdmin;
  PetscReal __pyx_v_cdmax;
  PetscReal __pyx_v_cd0;
  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("setTRTolerances", 0);

  /* "petsc4py/PETSc/SNES.pyx":347
 *         """
 *         cdef PetscReal cdmin, cdmax, cd0
 *         cdmin = cdmax = cd0 = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         if delta_min is not None: cdmin  = asReal(delta_min)
 *         if delta_max is not None: cdmax  = asReal(delta_max)
*/
  __pyx_v_cdmin = PETSC_CURRENT;
  __pyx_v_cdmax = PETSC_CURRENT;
  __pyx_v_cd0 = PETSC_CURRENT;

  /* "petsc4py/PETSc/SNES.pyx":348
 *         cdef PetscReal cdmin, cdmax, cd0
 *         cdmin = cdmax = cd0 = PETSC_CURRENT
 *         if delta_min is not None: cdmin  = asReal(delta_min)             # <<<<<<<<<<<<<<
 *         if delta_max is not None: cdmax  = asReal(delta_max)
 *         if delta_0   is not None: cd0    = asReal(delta_0)
*/
  __pyx_t_1 = (__pyx_v_delta_min != Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_delta_min); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 348, __pyx_L1_error)
    __pyx_v_cdmin = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":349
 *         cdmin = cdmax = cd0 = PETSC_CURRENT
 *         if delta_min is not None: cdmin  = asReal(delta_min)
 *         if delta_max is not None: cdmax  = asReal(delta_max)             # <<<<<<<<<<<<<<
 *         if delta_0   is not None: cd0    = asReal(delta_0)
 *         CHKERR(SNESNewtonTRSetTolerances(self.snes, cdmin, cdmax, cd0))
*/
  __pyx_t_1 = (__pyx_v_delta_max != Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_delta_max); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 349, __pyx_L1_error)
    __pyx_v_cdmax = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":350
 *         if delta_min is not None: cdmin  = asReal(delta_min)
 *         if delta_max is not None: cdmax  = asReal(delta_max)
 *         if delta_0   is not None: cd0    = asReal(delta_0)             # <<<<<<<<<<<<<<
 *         CHKERR(SNESNewtonTRSetTolerances(self.snes, cdmin, cdmax, cd0))
 * 
*/
  __pyx_t_1 = (__pyx_v_delta_0 != Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_delta_0); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 350, __pyx_L1_error)
    __pyx_v_cd0 = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":351
 *         if delta_max is not None: cdmax  = asReal(delta_max)
 *         if delta_0   is not None: cd0    = asReal(delta_0)
 *         CHKERR(SNESNewtonTRSetTolerances(self.snes, cdmin, cdmax, cd0))             # <<<<<<<<<<<<<<
 * 
 *     def getTRTolerances(self) -> tuple[float, float, float]:
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESNewtonTRSetTolerances(__pyx_v_self->snes, __pyx_v_cdmin, __pyx_v_cdmax, __pyx_v_cd0)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 351, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":326
 *     # --- TR ---
 * 
 *     def setTRTolerances(self, delta_min: float | None = None, delta_max: float | None = None, delta_0: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the tolerance parameters used for the trust region.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.setTRTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":353
 *         CHKERR(SNESNewtonTRSetTolerances(self.snes, cdmin, cdmax, cd0))
 * 
 *     def getTRTolerances(self) -> tuple[float, float, float]:             # <<<<<<<<<<<<<<
 *         """Return the tolerance parameters used for the trust region.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_31getTRTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_30getTRTolerances, "SNES.getTRTolerances(self) -> tuple[float, float, float]\nReturn the tolerance parameters used for the trust region.\n\n        Not collective.\n\n        Returns\n        -------\n        delta_min : float\n            The minimum allowed trust region size.\n        delta_max : float\n            The maximum allowed trust region size.\n        delta_0 : float\n            The initial trust region size.\n\n        See Also\n        --------\n        setTRTolerances, getTRUpdateParameters\n        petsc.SNESNewtonTRGetTolerances\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:353");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_31getTRTolerances = {"getTRTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_31getTRTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_30getTRTolerances};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_31getTRTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getTRTolerances (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTRTolerances", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTRTolerances", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_30getTRTolerances(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_30getTRTolerances(struct PyPetscSNESObject *__pyx_v_self) {
  PetscReal __pyx_v_cdmin;
  PetscReal __pyx_v_cdmax;
  PetscReal __pyx_v_cd0;
  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("getTRTolerances", 0);

  /* "petsc4py/PETSc/SNES.pyx":373
 * 
 *         """
 *         cdef PetscReal cdmin = 0, cdmax = 0, cd0 = 0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESNewtonTRGetTolerances(self.snes, &cdmin, &cdmax, &cd0))
 *         return (toReal(cdmin), toReal(cdmax), toReal(cd0))
*/
  __pyx_v_cdmin = 0.0;
  __pyx_v_cdmax = 0.0;
  __pyx_v_cd0 = 0.0;

  /* "petsc4py/PETSc/SNES.pyx":374
 *         """
 *         cdef PetscReal cdmin = 0, cdmax = 0, cd0 = 0
 *         CHKERR(SNESNewtonTRGetTolerances(self.snes, &cdmin, &cdmax, &cd0))             # <<<<<<<<<<<<<<
 *         return (toReal(cdmin), toReal(cdmax), toReal(cd0))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESNewtonTRGetTolerances(__pyx_v_self->snes, (&__pyx_v_cdmin), (&__pyx_v_cdmax), (&__pyx_v_cd0))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 374, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":375
 *         cdef PetscReal cdmin = 0, cdmax = 0, cd0 = 0
 *         CHKERR(SNESNewtonTRGetTolerances(self.snes, &cdmin, &cdmax, &cd0))
 *         return (toReal(cdmin), toReal(cdmax), toReal(cd0))             # <<<<<<<<<<<<<<
 * 
 *     def setTRUpdateParameters(self,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_cdmin); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_cdmax); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_cd0); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 375, __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) != (0)) __PYX_ERR(50, 375, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(50, 375, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4) != (0)) __PYX_ERR(50, 375, __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/SNES.pyx":353
 *         CHKERR(SNESNewtonTRSetTolerances(self.snes, cdmin, cdmax, cd0))
 * 
 *     def getTRTolerances(self) -> tuple[float, float, float]:             # <<<<<<<<<<<<<<
 *         """Return the tolerance parameters used for the trust 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_AddTraceback("petsc4py.PETSc.SNES.getTRTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":377
 *         return (toReal(cdmin), toReal(cdmax), toReal(cd0))
 * 
 *     def setTRUpdateParameters(self,             # <<<<<<<<<<<<<<
 *                               eta1: float | None = None, eta2: float | None = None, eta3: float | None = None,
 *                               t1: float | None = None, t2: float | None = None) -> None:
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_33setTRUpdateParameters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_32setTRUpdateParameters, "SNES.setTRUpdateParameters(self, eta1: float | None = None, eta2: float | None = None, eta3: float | None = None, t1: float | None = None, t2: float | None = None) -> None\nSet the update parameters used for the trust region.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        eta1\n            The step acceptance tolerance. Defaults to `CURRENT`.\n        eta2\n            The shrinking tolerance. Defaults to `CURRENT`.\n        eta3\n            The enlarging tolerance. Defaults to `CURRENT`.\n        t1\n            The shrinking factor. Defaults to `CURRENT`.\n        t2\n            The enlarging factor. Defaults to `CURRENT`.\n\n        See Also\n        --------\n        setTRTolerances, getTRUpdateParameters\n        petsc.SNESNewtonTRSetUpdateParameters\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:377");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_33setTRUpdateParameters = {"setTRUpdateParameters", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_33setTRUpdateParameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_32setTRUpdateParameters};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_33setTRUpdateParameters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_eta1 = 0;
  PyObject *__pyx_v_eta2 = 0;
  PyObject *__pyx_v_eta3 = 0;
  PyObject *__pyx_v_t1 = 0;
  PyObject *__pyx_v_t2 = 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("setTRUpdateParameters (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_eta1,&__pyx_mstate_global->__pyx_n_u_eta2,&__pyx_mstate_global->__pyx_n_u_eta3,&__pyx_mstate_global->__pyx_n_u_t1,&__pyx_mstate_global->__pyx_n_u_t2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 377, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(50, 377, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 377, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 377, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 377, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 377, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTRUpdateParameters", 0) < (0)) __PYX_ERR(50, 377, __pyx_L3_error)

      /* "petsc4py/PETSc/SNES.pyx":378
 * 
 *     def setTRUpdateParameters(self,
 *                               eta1: float | None = None, eta2: float | None = None, eta3: float | None = None,             # <<<<<<<<<<<<<<
 *                               t1: float | None = None, t2: float | None = None) -> None:
 *         """Set the update parameters used for the trust region.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":379
 *     def setTRUpdateParameters(self,
 *                               eta1: float | None = None, eta2: float | None = None, eta3: float | None = None,
 *                               t1: float | None = None, t2: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the update parameters used for the trust region.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(50, 377, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 377, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 377, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 377, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 377, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/SNES.pyx":378
 * 
 *     def setTRUpdateParameters(self,
 *                               eta1: float | None = None, eta2: float | None = None, eta3: float | None = None,             # <<<<<<<<<<<<<<
 *                               t1: float | None = None, t2: float | None = None) -> None:
 *         """Set the update parameters used for the trust region.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":379
 *     def setTRUpdateParameters(self,
 *                               eta1: float | None = None, eta2: float | None = None, eta3: float | None = None,
 *                               t1: float | None = None, t2: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the update parameters used for the trust region.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_eta1 = values[0];
    __pyx_v_eta2 = values[1];
    __pyx_v_eta3 = values[2];
    __pyx_v_t1 = values[3];
    __pyx_v_t2 = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setTRUpdateParameters", 0, 0, 5, __pyx_nargs); __PYX_ERR(50, 377, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.setTRUpdateParameters", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_32setTRUpdateParameters(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_eta1, __pyx_v_eta2, __pyx_v_eta3, __pyx_v_t1, __pyx_v_t2);

  /* "petsc4py/PETSc/SNES.pyx":377
 *         return (toReal(cdmin), toReal(cdmax), toReal(cd0))
 * 
 *     def setTRUpdateParameters(self,             # <<<<<<<<<<<<<<
 *                               eta1: float | None = None, eta2: float | None = None, eta3: float | None = None,
 *                               t1: float | None = None, t2: float | None = None) -> None:
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_32setTRUpdateParameters(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_eta1, PyObject *__pyx_v_eta2, PyObject *__pyx_v_eta3, PyObject *__pyx_v_t1, PyObject *__pyx_v_t2) {
  PetscReal __pyx_v_ceta1;
  PetscReal __pyx_v_ceta2;
  PetscReal __pyx_v_ceta3;
  PetscReal __pyx_v_ct1;
  PetscReal __pyx_v_ct2;
  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("setTRUpdateParameters", 0);

  /* "petsc4py/PETSc/SNES.pyx":404
 *         """
 *         cdef PetscReal ceta1, ceta2, ceta3, ct1, ct2
 *         ceta1 = ceta2 = ceta3 = ct1 = ct2 = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         if eta1 is not None: ceta1 = asReal(eta1)
 *         if eta2 is not None: ceta2 = asReal(eta2)
*/
  __pyx_v_ceta1 = PETSC_CURRENT;
  __pyx_v_ceta2 = PETSC_CURRENT;
  __pyx_v_ceta3 = PETSC_CURRENT;
  __pyx_v_ct1 = PETSC_CURRENT;
  __pyx_v_ct2 = PETSC_CURRENT;

  /* "petsc4py/PETSc/SNES.pyx":405
 *         cdef PetscReal ceta1, ceta2, ceta3, ct1, ct2
 *         ceta1 = ceta2 = ceta3 = ct1 = ct2 = PETSC_CURRENT
 *         if eta1 is not None: ceta1 = asReal(eta1)             # <<<<<<<<<<<<<<
 *         if eta2 is not None: ceta2 = asReal(eta2)
 *         if eta3 is not None: ceta3 = asReal(eta3)
*/
  __pyx_t_1 = (__pyx_v_eta1 != Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_eta1); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 405, __pyx_L1_error)
    __pyx_v_ceta1 = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":406
 *         ceta1 = ceta2 = ceta3 = ct1 = ct2 = PETSC_CURRENT
 *         if eta1 is not None: ceta1 = asReal(eta1)
 *         if eta2 is not None: ceta2 = asReal(eta2)             # <<<<<<<<<<<<<<
 *         if eta3 is not None: ceta3 = asReal(eta3)
 *         if t1 is not None: ct1 = asReal(t1)
*/
  __pyx_t_1 = (__pyx_v_eta2 != Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_eta2); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 406, __pyx_L1_error)
    __pyx_v_ceta2 = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":407
 *         if eta1 is not None: ceta1 = asReal(eta1)
 *         if eta2 is not None: ceta2 = asReal(eta2)
 *         if eta3 is not None: ceta3 = asReal(eta3)             # <<<<<<<<<<<<<<
 *         if t1 is not None: ct1 = asReal(t1)
 *         if t2 is not None: ct2 = asReal(t2)
*/
  __pyx_t_1 = (__pyx_v_eta3 != Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_eta3); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 407, __pyx_L1_error)
    __pyx_v_ceta3 = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":408
 *         if eta2 is not None: ceta2 = asReal(eta2)
 *         if eta3 is not None: ceta3 = asReal(eta3)
 *         if t1 is not None: ct1 = asReal(t1)             # <<<<<<<<<<<<<<
 *         if t2 is not None: ct2 = asReal(t2)
 *         CHKERR(SNESNewtonTRSetUpdateParameters(self.snes, ceta1, ceta2, ceta3, ct1, ct2))
*/
  __pyx_t_1 = (__pyx_v_t1 != Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t1); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 408, __pyx_L1_error)
    __pyx_v_ct1 = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":409
 *         if eta3 is not None: ceta3 = asReal(eta3)
 *         if t1 is not None: ct1 = asReal(t1)
 *         if t2 is not None: ct2 = asReal(t2)             # <<<<<<<<<<<<<<
 *         CHKERR(SNESNewtonTRSetUpdateParameters(self.snes, ceta1, ceta2, ceta3, ct1, ct2))
 * 
*/
  __pyx_t_1 = (__pyx_v_t2 != Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_t2); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 409, __pyx_L1_error)
    __pyx_v_ct2 = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":410
 *         if t1 is not None: ct1 = asReal(t1)
 *         if t2 is not None: ct2 = asReal(t2)
 *         CHKERR(SNESNewtonTRSetUpdateParameters(self.snes, ceta1, ceta2, ceta3, ct1, ct2))             # <<<<<<<<<<<<<<
 * 
 *     def getTRUpdateParameters(self) -> tuple[float, float, float, float, float]:
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESNewtonTRSetUpdateParameters(__pyx_v_self->snes, __pyx_v_ceta1, __pyx_v_ceta2, __pyx_v_ceta3, __pyx_v_ct1, __pyx_v_ct2)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 410, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":377
 *         return (toReal(cdmin), toReal(cdmax), toReal(cd0))
 * 
 *     def setTRUpdateParameters(self,             # <<<<<<<<<<<<<<
 *                               eta1: float | None = None, eta2: float | None = None, eta3: float | None = None,
 *                               t1: float | None = None, t2: float | None = None) -> None:
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.setTRUpdateParameters", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":412
 *         CHKERR(SNESNewtonTRSetUpdateParameters(self.snes, ceta1, ceta2, ceta3, ct1, ct2))
 * 
 *     def getTRUpdateParameters(self) -> tuple[float, float, float, float, float]:             # <<<<<<<<<<<<<<
 *         """Return the update parameters used for the trust region.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_35getTRUpdateParameters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_34getTRUpdateParameters, "SNES.getTRUpdateParameters(self) -> tuple[float, float, float, float, float]\nReturn the update parameters used for the trust region.\n\n        Not collective.\n\n        Returns\n        -------\n        eta1 : float\n            The step acceptance tolerance.\n        eta2 : float\n            The shrinking tolerance.\n        eta3 : float\n            The enlarging tolerance.\n        t1 : float\n            The shrinking factor.\n        t2 : float\n            The enlarging factor.\n\n        See Also\n        --------\n        setTRUpdateParameters, getTRTolerances\n        petsc.SNESNewtonTRGetUpdateParameters\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:412");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_35getTRUpdateParameters = {"getTRUpdateParameters", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_35getTRUpdateParameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_34getTRUpdateParameters};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_35getTRUpdateParameters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getTRUpdateParameters (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTRUpdateParameters", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTRUpdateParameters", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_34getTRUpdateParameters(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_34getTRUpdateParameters(struct PyPetscSNESObject *__pyx_v_self) {
  PetscReal __pyx_v_ceta1;
  PetscReal __pyx_v_ceta2;
  PetscReal __pyx_v_ceta3;
  PetscReal __pyx_v_ct1;
  PetscReal __pyx_v_ct2;
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getTRUpdateParameters", 0);

  /* "petsc4py/PETSc/SNES.pyx":436
 * 
 *         """
 *         cdef PetscReal ceta1 = 0, ceta2 = 0, ceta3 = 0, ct1 = 0, ct2 = 0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESNewtonTRGetUpdateParameters(self.snes, &ceta1, &ceta2, &ceta3, &ct1, &ct2))
 *         return (toReal(ceta1), toReal(ceta2), toReal(ceta3), toReal(ct1), toReal(ct2))
*/
  __pyx_v_ceta1 = 0.0;
  __pyx_v_ceta2 = 0.0;
  __pyx_v_ceta3 = 0.0;
  __pyx_v_ct1 = 0.0;
  __pyx_v_ct2 = 0.0;

  /* "petsc4py/PETSc/SNES.pyx":437
 *         """
 *         cdef PetscReal ceta1 = 0, ceta2 = 0, ceta3 = 0, ct1 = 0, ct2 = 0
 *         CHKERR(SNESNewtonTRGetUpdateParameters(self.snes, &ceta1, &ceta2, &ceta3, &ct1, &ct2))             # <<<<<<<<<<<<<<
 *         return (toReal(ceta1), toReal(ceta2), toReal(ceta3), toReal(ct1), toReal(ct2))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESNewtonTRGetUpdateParameters(__pyx_v_self->snes, (&__pyx_v_ceta1), (&__pyx_v_ceta2), (&__pyx_v_ceta3), (&__pyx_v_ct1), (&__pyx_v_ct2))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 437, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":438
 *         cdef PetscReal ceta1 = 0, ceta2 = 0, ceta3 = 0, ct1 = 0, ct2 = 0
 *         CHKERR(SNESNewtonTRGetUpdateParameters(self.snes, &ceta1, &ceta2, &ceta3, &ct1, &ct2))
 *         return (toReal(ceta1), toReal(ceta2), toReal(ceta3), toReal(ct1), toReal(ct2))             # <<<<<<<<<<<<<<
 * 
 *     # --- FAS ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_ceta1); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_ceta2); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_ceta3); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_ct1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_ct2); if (unlikely(!__pyx_t_6)) __PYX_ERR(50, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(50, 438, __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) != (0)) __PYX_ERR(50, 438, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3) != (0)) __PYX_ERR(50, 438, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4) != (0)) __PYX_ERR(50, 438, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_5) != (0)) __PYX_ERR(50, 438, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_6) != (0)) __PYX_ERR(50, 438, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":412
 *         CHKERR(SNESNewtonTRSetUpdateParameters(self.snes, ceta1, ceta2, ceta3, ct1, ct2))
 * 
 *     def getTRUpdateParameters(self) -> tuple[float, float, float, float, float]:             # <<<<<<<<<<<<<<
 *         """Return the update parameters used for the trust 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_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.getTRUpdateParameters", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":442
 *     # --- 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_37setFASInterpolation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_36setFASInterpolation, "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:442");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_37setFASInterpolation = {"setFASInterpolation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_37setFASInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_36setFASInterpolation};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_37setFASInterpolation(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 442, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 442, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 442, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFASInterpolation", 0) < (0)) __PYX_ERR(50, 442, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFASInterpolation", 1, 2, 2, i); __PYX_ERR(50, 442, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 442, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 442, __pyx_L3_error)
    }
    __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, 442, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(50, 442, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_36setFASInterpolation(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_36setFASInterpolation(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":453
 * 
 *         """
 *         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, 453, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":454
 *         """
 *         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, 454, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":442
 *     # --- 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":456
 *         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_39getFASInterpolation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_38getFASInterpolation, "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:456");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_39getFASInterpolation = {"getFASInterpolation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_39getFASInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_38getFASInterpolation};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_39getFASInterpolation(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 456, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 456, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFASInterpolation", 0) < (0)) __PYX_ERR(50, 456, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFASInterpolation", 1, 1, 1, i); __PYX_ERR(50, 456, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 456, __pyx_L3_error)
    }
    __pyx_v_level = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getFASInterpolation", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 456, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_38getFASInterpolation(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_38getFASInterpolation(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getFASInterpolation", 0);

  /* "petsc4py/PETSc/SNES.pyx":466
 * 
 *         """
 *         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, 466, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":467
 *         """
 *         cdef PetscInt clevel = asInt(level)
 *         cdef Mat mat = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESFASGetInterpolation(self.snes, clevel, &mat.mat))
 *         CHKERR(PetscINCREF(mat.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 467, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":468
 *         cdef PetscInt clevel = asInt(level)
 *         cdef Mat mat = Mat()
 *         CHKERR(SNESFASGetInterpolation(self.snes, clevel, &mat.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(mat.obj))
 *         return mat
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetInterpolation(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 468, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":469
 *         cdef Mat mat = Mat()
 *         CHKERR(SNESFASGetInterpolation(self.snes, clevel, &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(50, 469, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":470
 *         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":456
 *         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_XDECREF(__pyx_t_3);
  __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":472
 *         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_41setFASRestriction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_40setFASRestriction, "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:472");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_41setFASRestriction = {"setFASRestriction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_41setFASRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_40setFASRestriction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_41setFASRestriction(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 472, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFASRestriction", 0) < (0)) __PYX_ERR(50, 472, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFASRestriction", 1, 2, 2, i); __PYX_ERR(50, 472, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 472, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 472, __pyx_L3_error)
    }
    __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, 472, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(50, 472, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_40setFASRestriction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_40setFASRestriction(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":483
 * 
 *         """
 *         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, 483, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":484
 *         """
 *         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, 484, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":472
 *         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":486
 *         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_43getFASRestriction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_42getFASRestriction, "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:486");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_43getFASRestriction = {"getFASRestriction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_43getFASRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_42getFASRestriction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_43getFASRestriction(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 486, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 486, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFASRestriction", 0) < (0)) __PYX_ERR(50, 486, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFASRestriction", 1, 1, 1, i); __PYX_ERR(50, 486, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 486, __pyx_L3_error)
    }
    __pyx_v_level = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getFASRestriction", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 486, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_42getFASRestriction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_42getFASRestriction(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getFASRestriction", 0);

  /* "petsc4py/PETSc/SNES.pyx":496
 * 
 *         """
 *         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, 496, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":497
 *         """
 *         cdef PetscInt clevel = asInt(level)
 *         cdef Mat mat = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESFASGetRestriction(self.snes, clevel, &mat.mat))
 *         CHKERR(PetscINCREF(mat.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 497, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":498
 *         cdef PetscInt clevel = asInt(level)
 *         cdef Mat mat = Mat()
 *         CHKERR(SNESFASGetRestriction(self.snes, clevel, &mat.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(mat.obj))
 *         return mat
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetRestriction(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 498, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":499
 *         cdef Mat mat = Mat()
 *         CHKERR(SNESFASGetRestriction(self.snes, clevel, &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(50, 499, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":500
 *         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":486
 *         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_XDECREF(__pyx_t_3);
  __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":502
 *         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_45setFASInjection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_44setFASInjection, "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:502");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_45setFASInjection = {"setFASInjection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_45setFASInjection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_44setFASInjection};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_45setFASInjection(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 502, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 502, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 502, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFASInjection", 0) < (0)) __PYX_ERR(50, 502, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFASInjection", 1, 2, 2, i); __PYX_ERR(50, 502, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 502, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 502, __pyx_L3_error)
    }
    __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, 502, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(50, 502, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_44setFASInjection(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level, __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_44setFASInjection(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":513
 * 
 *         """
 *         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, 513, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":514
 *         """
 *         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, 514, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":502
 *         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":516
 *         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_47getFASInjection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_46getFASInjection, "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:516");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_47getFASInjection = {"getFASInjection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_47getFASInjection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_46getFASInjection};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_47getFASInjection(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 516, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 516, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFASInjection", 0) < (0)) __PYX_ERR(50, 516, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFASInjection", 1, 1, 1, i); __PYX_ERR(50, 516, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 516, __pyx_L3_error)
    }
    __pyx_v_level = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getFASInjection", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 516, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_46getFASInjection(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_46getFASInjection(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getFASInjection", 0);

  /* "petsc4py/PETSc/SNES.pyx":526
 * 
 *         """
 *         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, 526, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":527
 *         """
 *         cdef PetscInt clevel = asInt(level)
 *         cdef Mat mat = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESFASGetInjection(self.snes, clevel, &mat.mat))
 *         CHKERR(PetscINCREF(mat.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 527, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":528
 *         cdef PetscInt clevel = asInt(level)
 *         cdef Mat mat = Mat()
 *         CHKERR(SNESFASGetInjection(self.snes, clevel, &mat.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(mat.obj))
 *         return mat
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetInjection(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 528, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":529
 *         cdef Mat mat = Mat()
 *         CHKERR(SNESFASGetInjection(self.snes, clevel, &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(50, 529, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":530
 *         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":516
 *         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_XDECREF(__pyx_t_3);
  __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":532
 *         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_49setFASRScale(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_48setFASRScale, "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:532");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_49setFASRScale = {"setFASRScale", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_49setFASRScale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_48setFASRScale};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_49setFASRScale(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 532, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 532, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 532, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFASRScale", 0) < (0)) __PYX_ERR(50, 532, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFASRScale", 1, 2, 2, i); __PYX_ERR(50, 532, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 532, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 532, __pyx_L3_error)
    }
    __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, 532, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(50, 532, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_48setFASRScale(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level, __pyx_v_vec);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_48setFASRScale(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":542
 * 
 *         """
 *         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, 542, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":543
 *         """
 *         cdef PetscInt clevel = asInt(level)
 *         CHKERR(SNESFASSetRScale(self.snes, clevel, vec.vec))             # <<<<<<<<<<<<<<
 * 
 *     def setFASLevels(self, levels: int, comms: Sequence[Comm] | None = 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, 543, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":532
 *         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":545
 *         CHKERR(SNESFASSetRScale(self.snes, clevel, vec.vec))
 * 
 *     def setFASLevels(self, levels: int, comms: Sequence[Comm] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of levels to use with FAS.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_51setFASLevels(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_50setFASLevels, "SNES.setFASLevels(self, levels: int, comms: Sequence[Comm] | None = 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:545");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_51setFASLevels = {"setFASLevels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_51setFASLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_50setFASLevels};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_51setFASLevels(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_levels,&__pyx_mstate_global->__pyx_n_u_comms,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 545, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 545, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 545, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFASLevels", 0) < (0)) __PYX_ERR(50, 545, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFASLevels", 0, 1, 2, i); __PYX_ERR(50, 545, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 545, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 545, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 545, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_50setFASLevels(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_levels, __pyx_v_comms);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_50setFASLevels(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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PetscErrorCode __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  MPI_Comm __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  char const *__pyx_t_13;
  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;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setFASLevels", 0);

  /* "petsc4py/PETSc/SNES.pyx":563
 * 
 *         """
 *         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, 563, __pyx_L1_error)
  __pyx_v_clevels = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":564
 *         """
 *         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":565
 *         cdef PetscInt clevels = asInt(levels)
 *         cdef MPI_Comm *ccomms = NULL
 *         cdef Py_ssize_t i = 0             # <<<<<<<<<<<<<<
 *         if comms is not None:
 *             if clevels != <PetscInt>len(comms):
*/
  __pyx_v_i = 0;

  /* "petsc4py/PETSc/SNES.pyx":566
 *         cdef MPI_Comm *ccomms = NULL
 *         cdef Py_ssize_t i = 0
 *         if comms is not None:             # <<<<<<<<<<<<<<
 *             if clevels != <PetscInt>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":567
 *         cdef Py_ssize_t i = 0
 *         if comms is not None:
 *             if clevels != <PetscInt>len(comms):             # <<<<<<<<<<<<<<
 *                 raise ValueError("Must provide as many communicators as levels")
 *             CHKERR(PetscMalloc(sizeof(MPI_Comm)*<size_t>clevels, &ccomms))
*/
    __pyx_t_3 = PyObject_Length(__pyx_v_comms); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(50, 567, __pyx_L1_error)
    __pyx_t_2 = (__pyx_v_clevels != ((PetscInt)__pyx_t_3));
    if (unlikely(__pyx_t_2)) {

      /* "petsc4py/PETSc/SNES.pyx":568
 *         if comms is not None:
 *             if clevels != <PetscInt>len(comms):
 *                 raise ValueError("Must provide as many communicators as levels")             # <<<<<<<<<<<<<<
 *             CHKERR(PetscMalloc(sizeof(MPI_Comm)*<size_t>clevels, &ccomms))
 *             try:
*/
      __pyx_t_5 = NULL;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Must_provide_as_many_communicato};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 568, __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, 568, __pyx_L1_error)

      /* "petsc4py/PETSc/SNES.pyx":567
 *         cdef Py_ssize_t i = 0
 *         if comms is not None:
 *             if clevels != <PetscInt>len(comms):             # <<<<<<<<<<<<<<
 *                 raise ValueError("Must provide as many communicators as levels")
 *             CHKERR(PetscMalloc(sizeof(MPI_Comm)*<size_t>clevels, &ccomms))
*/
    }

    /* "petsc4py/PETSc/SNES.pyx":569
 *             if clevels != <PetscInt>len(comms):
 *                 raise ValueError("Must provide as many communicators as levels")
 *             CHKERR(PetscMalloc(sizeof(MPI_Comm)*<size_t>clevels, &ccomms))             # <<<<<<<<<<<<<<
 *             try:
 *                 for i, comm in enumerate(comms):
*/
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMalloc(((sizeof(MPI_Comm)) * ((size_t)__pyx_v_clevels)), (&__pyx_v_ccomms))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 569, __pyx_L1_error)

    /* "petsc4py/PETSc/SNES.pyx":570
 *                 raise ValueError("Must provide as many communicators as levels")
 *             CHKERR(PetscMalloc(sizeof(MPI_Comm)*<size_t>clevels, &ccomms))
 *             try:             # <<<<<<<<<<<<<<
 *                 for i, comm in enumerate(comms):
 *                     ccomms[i] = def_Comm(comm, MPI_COMM_NULL)
*/
    /*try:*/ {

      /* "petsc4py/PETSc/SNES.pyx":571
 *             CHKERR(PetscMalloc(sizeof(MPI_Comm)*<size_t>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_8 = 0;
        __pyx_t_9 = NULL;
      } else {
        __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_comms); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 571, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(50, 571, __pyx_L6_error)
      }
      for (;;) {
        if (likely(!__pyx_t_9)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(50, 571, __pyx_L6_error)
              #endif
              if (__pyx_t_8 >= __pyx_temp) break;
            }
            __pyx_t_5 = __Pyx_PyList_GetItemRefFast(__pyx_t_4, __pyx_t_8, __Pyx_ReferenceSharing_OwnStrongReference);
            ++__pyx_t_8;
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
              #if !CYTHON_ASSUME_SAFE_SIZE
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(50, 571, __pyx_L6_error)
              #endif
              if (__pyx_t_8 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8));
            #else
            __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_8);
            #endif
            ++__pyx_t_8;
          }
          if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 571, __pyx_L6_error)
        } else {
          __pyx_t_5 = __pyx_t_9(__pyx_t_4);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(50, 571, __pyx_L6_error)
              PyErr_Clear();
            }
            break;
          }
        }
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_XDECREF_SET(__pyx_v_comm, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_v_i = __pyx_t_3;
        __pyx_t_3 = (__pyx_t_3 + 1);

        /* "petsc4py/PETSc/SNES.pyx":572
 *             try:
 *                 for i, comm in enumerate(comms):
 *                     ccomms[i] = def_Comm(comm, MPI_COMM_NULL)             # <<<<<<<<<<<<<<
 *                 CHKERR(SNESFASSetLevels(self.snes, clevels, ccomms))
 *             finally:
*/
        __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, MPI_COMM_NULL); if (unlikely(__pyx_t_10 == ((MPI_Comm const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(50, 572, __pyx_L6_error)
        (__pyx_v_ccomms[__pyx_v_i]) = __pyx_t_10;

        /* "petsc4py/PETSc/SNES.pyx":571
 *             CHKERR(PetscMalloc(sizeof(MPI_Comm)*<size_t>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":573
 *                 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_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASSetLevels(__pyx_v_self->snes, __pyx_v_clevels, __pyx_v_ccomms)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 573, __pyx_L6_error)
    }

    /* "petsc4py/PETSc/SNES.pyx":575
 *                 CHKERR(SNESFASSetLevels(self.snes, clevels, ccomms))
 *             finally:
 *                 CHKERR(PetscFree(ccomms))             # <<<<<<<<<<<<<<
 *         else:
 *             CHKERR(SNESFASSetLevels(self.snes, clevels, ccomms))
*/
    /*finally:*/ {
      /*normal exit:*/{
        __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ccomms)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 575, __pyx_L1_error)
        goto __pyx_L7;
      }
      __pyx_L6_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
         __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
        if ( unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
        __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_XGOTREF(__pyx_t_19);
        __pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
        {
          __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_ccomms)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 575, __pyx_L12_error)
        }
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
        __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
        __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
        goto __pyx_L1_error;
        __pyx_L12_error:;
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
        goto __pyx_L1_error;
      }
      __pyx_L7:;
    }

    /* "petsc4py/PETSc/SNES.pyx":566
 *         cdef MPI_Comm *ccomms = NULL
 *         cdef Py_ssize_t i = 0
 *         if comms is not None:             # <<<<<<<<<<<<<<
 *             if clevels != <PetscInt>len(comms):
 *                 raise ValueError("Must provide as many communicators as levels")
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/SNES.pyx":577
 *                 CHKERR(PetscFree(ccomms))
 *         else:
 *             CHKERR(SNESFASSetLevels(self.snes, clevels, ccomms))             # <<<<<<<<<<<<<<
 * 
 *     def getFASLevels(self) -> int:
*/
  /*else*/ {
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASSetLevels(__pyx_v_self->snes, __pyx_v_clevels, __pyx_v_ccomms)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 577, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/SNES.pyx":545
 *         CHKERR(SNESFASSetRScale(self.snes, clevel, vec.vec))
 * 
 *     def setFASLevels(self, levels: int, comms: Sequence[Comm] | None = 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_5);
  __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":579
 *             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_53getFASLevels(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_52getFASLevels, "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:579");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_53getFASLevels = {"getFASLevels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_53getFASLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_52getFASLevels};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_53getFASLevels(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFASLevels", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_52getFASLevels(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_52getFASLevels(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":589
 * 
 *         """
 *         cdef PetscInt levels = 0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESFASGetLevels(self.snes, &levels))
 *         return toInt(levels)
*/
  __pyx_v_levels = 0;

  /* "petsc4py/PETSc/SNES.pyx":590
 *         """
 *         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, 590, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":591
 *         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, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":579
 *             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":593
 *         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_55getFASCycleSNES(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_54getFASCycleSNES, "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:593");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_55getFASCycleSNES = {"getFASCycleSNES", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_55getFASCycleSNES, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_54getFASCycleSNES};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_55getFASCycleSNES(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 593, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 593, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFASCycleSNES", 0) < (0)) __PYX_ERR(50, 593, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFASCycleSNES", 1, 1, 1, i); __PYX_ERR(50, 593, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 593, __pyx_L3_error)
    }
    __pyx_v_level = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getFASCycleSNES", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 593, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_54getFASCycleSNES(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_54getFASCycleSNES(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getFASCycleSNES", 0);

  /* "petsc4py/PETSc/SNES.pyx":604
 * 
 *         """
 *         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, 604, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":605
 *         """
 *         cdef PetscInt clevel = asInt(level)
 *         cdef SNES lsnes = SNES()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes))
 *         CHKERR(PetscINCREF(lsnes.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 605, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_lsnes = ((struct PyPetscSNESObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":606
 *         cdef PetscInt clevel = asInt(level)
 *         cdef SNES lsnes = SNES()
 *         CHKERR(SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(lsnes.obj))
 *         return lsnes
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetCycleSNES(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_lsnes->snes))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 606, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":607
 *         cdef SNES lsnes = SNES()
 *         CHKERR(SNESFASGetCycleSNES(self.snes, clevel, &lsnes.snes))
 *         CHKERR(PetscINCREF(lsnes.obj))             # <<<<<<<<<<<<<<
 *         return lsnes
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_lsnes->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 607, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":608
 *         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":593
 *         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_XDECREF(__pyx_t_3);
  __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":610
 *         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_57getFASCoarseSolve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_56getFASCoarseSolve, "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:610");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_57getFASCoarseSolve = {"getFASCoarseSolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_57getFASCoarseSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_56getFASCoarseSolve};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_57getFASCoarseSolve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFASCoarseSolve", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_56getFASCoarseSolve(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_56getFASCoarseSolve(struct PyPetscSNESObject *__pyx_v_self) {
  struct PyPetscSNESObject *__pyx_v_smooth = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getFASCoarseSolve", 0);

  /* "petsc4py/PETSc/SNES.pyx":620
 * 
 *         """
 *         cdef SNES smooth = SNES()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESFASGetCoarseSolve(self.snes, &smooth.snes))
 *         CHKERR(PetscINCREF(smooth.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 620, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_smooth = ((struct PyPetscSNESObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":621
 *         """
 *         cdef SNES smooth = SNES()
 *         CHKERR(SNESFASGetCoarseSolve(self.snes, &smooth.snes))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(smooth.obj))
 *         return smooth
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetCoarseSolve(__pyx_v_self->snes, (&__pyx_v_smooth->snes))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 621, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":622
 *         cdef SNES smooth = SNES()
 *         CHKERR(SNESFASGetCoarseSolve(self.snes, &smooth.snes))
 *         CHKERR(PetscINCREF(smooth.obj))             # <<<<<<<<<<<<<<
 *         return smooth
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_smooth->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 622, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":623
 *         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":610
 *         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_XDECREF(__pyx_t_2);
  __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":625
 *         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_59getFASSmoother(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_58getFASSmoother, "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:625");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_59getFASSmoother = {"getFASSmoother", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_59getFASSmoother, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_58getFASSmoother};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_59getFASSmoother(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 625, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 625, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFASSmoother", 0) < (0)) __PYX_ERR(50, 625, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFASSmoother", 1, 1, 1, i); __PYX_ERR(50, 625, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 625, __pyx_L3_error)
    }
    __pyx_v_level = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getFASSmoother", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 625, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_58getFASSmoother(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_58getFASSmoother(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getFASSmoother", 0);

  /* "petsc4py/PETSc/SNES.pyx":636
 * 
 *         """
 *         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, 636, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":637
 *         """
 *         cdef PetscInt clevel = asInt(level)
 *         cdef SNES smooth = SNES()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESFASGetSmoother(self.snes, clevel, &smooth.snes))
 *         CHKERR(PetscINCREF(smooth.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 637, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_smooth = ((struct PyPetscSNESObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":638
 *         cdef PetscInt clevel = asInt(level)
 *         cdef SNES smooth = SNES()
 *         CHKERR(SNESFASGetSmoother(self.snes, clevel, &smooth.snes))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(smooth.obj))
 *         return smooth
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetSmoother(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_smooth->snes))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 638, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":639
 *         cdef SNES smooth = SNES()
 *         CHKERR(SNESFASGetSmoother(self.snes, clevel, &smooth.snes))
 *         CHKERR(PetscINCREF(smooth.obj))             # <<<<<<<<<<<<<<
 *         return smooth
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_smooth->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 639, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":640
 *         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":625
 *         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_XDECREF(__pyx_t_3);
  __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":642
 *         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_61getFASSmootherDown(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_60getFASSmootherDown, "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:642");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_61getFASSmootherDown = {"getFASSmootherDown", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_61getFASSmootherDown, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_60getFASSmootherDown};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_61getFASSmootherDown(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 642, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 642, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFASSmootherDown", 0) < (0)) __PYX_ERR(50, 642, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFASSmootherDown", 1, 1, 1, i); __PYX_ERR(50, 642, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 642, __pyx_L3_error)
    }
    __pyx_v_level = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getFASSmootherDown", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 642, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_60getFASSmootherDown(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_60getFASSmootherDown(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getFASSmootherDown", 0);

  /* "petsc4py/PETSc/SNES.pyx":653
 * 
 *         """
 *         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, 653, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":654
 *         """
 *         cdef PetscInt clevel = asInt(level)
 *         cdef SNES smooth = SNES()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes))
 *         CHKERR(PetscINCREF(smooth.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 654, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_smooth = ((struct PyPetscSNESObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":655
 *         cdef PetscInt clevel = asInt(level)
 *         cdef SNES smooth = SNES()
 *         CHKERR(SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(smooth.obj))
 *         return smooth
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetSmootherDown(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_smooth->snes))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 655, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":656
 *         cdef SNES smooth = SNES()
 *         CHKERR(SNESFASGetSmootherDown(self.snes, clevel, &smooth.snes))
 *         CHKERR(PetscINCREF(smooth.obj))             # <<<<<<<<<<<<<<
 *         return smooth
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_smooth->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 656, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":657
 *         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":642
 *         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_XDECREF(__pyx_t_3);
  __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":659
 *         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_63getFASSmootherUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_62getFASSmootherUp, "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:659");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_63getFASSmootherUp = {"getFASSmootherUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_63getFASSmootherUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_62getFASSmootherUp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_63getFASSmootherUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 659, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 659, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFASSmootherUp", 0) < (0)) __PYX_ERR(50, 659, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFASSmootherUp", 1, 1, 1, i); __PYX_ERR(50, 659, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 659, __pyx_L3_error)
    }
    __pyx_v_level = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getFASSmootherUp", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 659, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_62getFASSmootherUp(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_level);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_62getFASSmootherUp(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getFASSmootherUp", 0);

  /* "petsc4py/PETSc/SNES.pyx":670
 * 
 *         """
 *         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, 670, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":671
 *         """
 *         cdef PetscInt clevel = asInt(level)
 *         cdef SNES smooth = SNES()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes))
 *         CHKERR(PetscINCREF(smooth.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 671, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_smooth = ((struct PyPetscSNESObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":672
 *         cdef PetscInt clevel = asInt(level)
 *         cdef SNES smooth = SNES()
 *         CHKERR(SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(smooth.obj))
 *         return smooth
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESFASGetSmootherUp(__pyx_v_self->snes, __pyx_v_clevel, (&__pyx_v_smooth->snes))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 672, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":673
 *         cdef SNES smooth = SNES()
 *         CHKERR(SNESFASGetSmootherUp(self.snes, clevel, &smooth.snes))
 *         CHKERR(PetscINCREF(smooth.obj))             # <<<<<<<<<<<<<<
 *         return smooth
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_smooth->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 673, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":674
 *         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":659
 *         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_XDECREF(__pyx_t_3);
  __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":678
 *     # --- nonlinear preconditioner ---
 * 
 *     def getNPC(self) -> SNES:             # <<<<<<<<<<<<<<
 *         """Return the nonlinear preconditioner associated with the solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_65getNPC(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_64getNPC, "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:678");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_65getNPC = {"getNPC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_65getNPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_64getNPC};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_65getNPC(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNPC", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_64getNPC(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_64getNPC(struct PyPetscSNESObject *__pyx_v_self) {
  struct PyPetscSNESObject *__pyx_v_snes = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getNPC", 0);

  /* "petsc4py/PETSc/SNES.pyx":688
 * 
 *         """
 *         cdef SNES snes = SNES()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetNPC(self.snes, &snes.snes))
 *         CHKERR(PetscINCREF(snes.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 688, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_snes = ((struct PyPetscSNESObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":689
 *         """
 *         cdef SNES snes = SNES()
 *         CHKERR(SNESGetNPC(self.snes, &snes.snes))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(snes.obj))
 *         return snes
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetNPC(__pyx_v_self->snes, (&__pyx_v_snes->snes))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 689, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":690
 *         cdef SNES snes = SNES()
 *         CHKERR(SNESGetNPC(self.snes, &snes.snes))
 *         CHKERR(PetscINCREF(snes.obj))             # <<<<<<<<<<<<<<
 *         return snes
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_snes->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 690, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":691
 *         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":678
 *     # --- 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_XDECREF(__pyx_t_2);
  __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":693
 *         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_67hasNPC(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_66hasNPC, "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:693");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_67hasNPC = {"hasNPC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_67hasNPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_66hasNPC};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_67hasNPC(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("hasNPC", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_66hasNPC(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_66hasNPC(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":703
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(SNESHasNPC(self.snes, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/SNES.pyx":704
 *         """
 *         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, 704, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":705
 *         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, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":693
 *         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":707
 *         return toBool(flag)
 * 
 *     def setNPC(self, SNES snes) -> None:             # <<<<<<<<<<<<<<
 *         """Set the nonlinear preconditioner.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_69setNPC(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_68setNPC, "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:707");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_69setNPC = {"setNPC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_69setNPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_68setNPC};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_69setNPC(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_snes,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 707, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 707, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNPC", 0) < (0)) __PYX_ERR(50, 707, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNPC", 1, 1, 1, i); __PYX_ERR(50, 707, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 707, __pyx_L3_error)
    }
    __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, 707, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, 0, "snes", 0))) __PYX_ERR(50, 707, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_68setNPC(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_snes);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_68setNPC(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":717
 * 
 *         """
 *         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, 717, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":707
 *         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":719
 *         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_71setNPCSide(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_70setNPCSide, "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:719");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_71setNPCSide = {"setNPCSide", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_71setNPCSide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_70setNPCSide};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_71setNPCSide(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_side,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 719, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 719, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNPCSide", 0) < (0)) __PYX_ERR(50, 719, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNPCSide", 1, 1, 1, i); __PYX_ERR(50, 719, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 719, __pyx_L3_error)
    }
    __pyx_v_side = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setNPCSide", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 719, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_70setNPCSide(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_side);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_70setNPCSide(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":729
 * 
 *         """
 *         CHKERR(SNESSetNPCSide(self.snes, side))             # <<<<<<<<<<<<<<
 * 
 *     def getNPCSide(self) -> PC.Side:
*/
  __pyx_t_1 = ((PCSide)__Pyx_PyLong_As_PCSide(__pyx_v_side)); if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 729, __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, 729, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":719
 *         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":731
 *         CHKERR(SNESSetNPCSide(self.snes, side))
 * 
 *     def getNPCSide(self) -> PC.Side:             # <<<<<<<<<<<<<<
 *         """Return the nonlinear preconditioning side.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_73getNPCSide(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_72getNPCSide, "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:731");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_73getNPCSide = {"getNPCSide", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_73getNPCSide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_72getNPCSide};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_73getNPCSide(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNPCSide", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_72getNPCSide(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_72getNPCSide(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":741
 * 
 *         """
 *         cdef PetscPCSide side = PC_RIGHT             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetNPCSide(self.snes, &side))
 *         return side
*/
  __pyx_v_side = PC_RIGHT;

  /* "petsc4py/PETSc/SNES.pyx":742
 *         """
 *         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, 742, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":743
 *         cdef PetscPCSide side = PC_RIGHT
 *         CHKERR(SNESGetNPCSide(self.snes, &side))
 *         return side             # <<<<<<<<<<<<<<
 * 
 *     # --- user Function/Jacobian routines ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_PCSide(__pyx_v_side); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":731
 *         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":747
 *     # --- user Function/Jacobian routines ---
 * 
 *     def setLineSearchPreCheck(self, precheck: SNESLSPreFunction | None,             # <<<<<<<<<<<<<<
 *                               args: tuple[Any, ...] | None = None,
 *                               kargs: dict[str, Any] | None = None) -> None:
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_75setLineSearchPreCheck(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_74setLineSearchPreCheck, "SNES.setLineSearchPreCheck(self, precheck: SNESLSPreFunction | None, 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:747");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_75setLineSearchPreCheck = {"setLineSearchPreCheck", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_75setLineSearchPreCheck, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_74setLineSearchPreCheck};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_75setLineSearchPreCheck(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_precheck,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 747, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 747, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 747, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 747, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLineSearchPreCheck", 0) < (0)) __PYX_ERR(50, 747, __pyx_L3_error)

      /* "petsc4py/PETSc/SNES.pyx":748
 * 
 *     def setLineSearchPreCheck(self, precheck: SNESLSPreFunction | None,
 *                               args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                               kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback that will be called before applying the linesearch.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":749
 *     def setLineSearchPreCheck(self, precheck: SNESLSPreFunction | None,
 *                               args: tuple[Any, ...] | None = None,
 *                               kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback that will be called before applying the linesearch.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLineSearchPreCheck", 0, 1, 3, i); __PYX_ERR(50, 747, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 747, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 747, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 747, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/SNES.pyx":748
 * 
 *     def setLineSearchPreCheck(self, precheck: SNESLSPreFunction | None,
 *                               args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                               kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback that will be called before applying the linesearch.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":749
 *     def setLineSearchPreCheck(self, precheck: SNESLSPreFunction | None,
 *                               args: tuple[Any, ...] | None = None,
 *                               kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback that will be called before applying the linesearch.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 747, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_74setLineSearchPreCheck(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_precheck, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/SNES.pyx":747
 *     # --- user Function/Jacobian routines ---
 * 
 *     def setLineSearchPreCheck(self, precheck: SNESLSPreFunction | None,             # <<<<<<<<<<<<<<
 *                               args: tuple[Any, ...] | None = None,
 *                               kargs: dict[str, Any] | None = None) -> None:
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_74setLineSearchPreCheck(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":768
 * 
 *         """
 *         cdef PetscSNESLineSearch snesls = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetLineSearch(self.snes, &snesls))
 *         if precheck is not None:
*/
  __pyx_v_snesls = NULL;

  /* "petsc4py/PETSc/SNES.pyx":769
 *         """
 *         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, 769, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":770
 *         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":771
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/SNES.pyx":772
 *         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, 772, __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":773
 *             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, 773, __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) != (0)) __PYX_ERR(50, 773, __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) != (0)) __PYX_ERR(50, 773, __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) != (0)) __PYX_ERR(50, 773, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/SNES.pyx":774
 *             if kargs is None: kargs = {}
 *             context = (precheck, args, kargs)
 *             self.set_attr('__precheck__', context)             # <<<<<<<<<<<<<<
 *             # FIXME callback
 *             CHKERR(SNESLineSearchSetPreCheck(snesls, SNES_PreCheck, <void*> 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, 774, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/SNES.pyx":776
 *             self.set_attr('__precheck__', context)
 *             # FIXME callback
 *             CHKERR(SNESLineSearchSetPreCheck(snesls, SNES_PreCheck, <void*> 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, 776, __pyx_L1_error)

    /* "petsc4py/PETSc/SNES.pyx":770
 *         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":778
 *             CHKERR(SNESLineSearchSetPreCheck(snesls, SNES_PreCheck, <void*> 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, 778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/SNES.pyx":779
 *         else:
 *             self.set_attr('__precheck__', None)
 *             CHKERR(SNESLineSearchSetPreCheck(snesls, NULL, NULL))             # <<<<<<<<<<<<<<
 * 
 *     def setInitialGuess(self, initialguess: SNESGuessFunction | None,
*/
    __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, 779, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/SNES.pyx":747
 *     # --- user Function/Jacobian routines ---
 * 
 *     def setLineSearchPreCheck(self, precheck: SNESLSPreFunction | 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.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":781
 *             CHKERR(SNESLineSearchSetPreCheck(snesls, NULL, NULL))
 * 
 *     def setInitialGuess(self, initialguess: SNESGuessFunction | None,             # <<<<<<<<<<<<<<
 *                         args: tuple[Any, ...] | None = None,
 *                         kargs: dict[str, Any] | None = None) -> None:
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_77setInitialGuess(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_76setInitialGuess, "SNES.setInitialGuess(self, initialguess: SNESGuessFunction | None, 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:781");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_77setInitialGuess = {"setInitialGuess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_77setInitialGuess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_76setInitialGuess};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_77setInitialGuess(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_initialguess,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 781, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 781, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 781, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 781, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setInitialGuess", 0) < (0)) __PYX_ERR(50, 781, __pyx_L3_error)

      /* "petsc4py/PETSc/SNES.pyx":782
 * 
 *     def setInitialGuess(self, initialguess: SNESGuessFunction | None,
 *                         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                         kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback to compute the initial guess.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":783
 *     def setInitialGuess(self, initialguess: SNESGuessFunction | None,
 *                         args: tuple[Any, ...] | None = None,
 *                         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback to compute the initial guess.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setInitialGuess", 0, 1, 3, i); __PYX_ERR(50, 781, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 781, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 781, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 781, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/SNES.pyx":782
 * 
 *     def setInitialGuess(self, initialguess: SNESGuessFunction | None,
 *                         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                         kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback to compute the initial guess.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":783
 *     def setInitialGuess(self, initialguess: SNESGuessFunction | None,
 *                         args: tuple[Any, ...] | None = None,
 *                         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback to compute the initial guess.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 781, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_76setInitialGuess(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_initialguess, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/SNES.pyx":781
 *             CHKERR(SNESLineSearchSetPreCheck(snesls, NULL, NULL))
 * 
 *     def setInitialGuess(self, initialguess: SNESGuessFunction | None,             # <<<<<<<<<<<<<<
 *                         args: tuple[Any, ...] | None = None,
 *                         kargs: dict[str, Any] | None = None) -> None:
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_76setInitialGuess(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":802
 * 
 *         """
 *         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":803
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/SNES.pyx":804
 *         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, 804, __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":805
 *             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, <void*>context))
*/
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 805, __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) != (0)) __PYX_ERR(50, 805, __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) != (0)) __PYX_ERR(50, 805, __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) != (0)) __PYX_ERR(50, 805, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":806
 *             if kargs is None: kargs = {}
 *             context = (initialguess, args, kargs)
 *             self.set_attr('__initialguess__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(SNESSetComputeInitialGuess(self.snes, SNES_InitialGuess, <void*>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, 806, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":807
 *             context = (initialguess, args, kargs)
 *             self.set_attr('__initialguess__', context)
 *             CHKERR(SNESSetComputeInitialGuess(self.snes, SNES_InitialGuess, <void*>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, 807, __pyx_L1_error)

    /* "petsc4py/PETSc/SNES.pyx":802
 * 
 *         """
 *         if initialguess is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/SNES.pyx":809
 *             CHKERR(SNESSetComputeInitialGuess(self.snes, SNES_InitialGuess, <void*>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, 809, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":810
 *         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, 810, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/SNES.pyx":781
 *             CHKERR(SNESLineSearchSetPreCheck(snesls, NULL, NULL))
 * 
 *     def setInitialGuess(self, initialguess: SNESGuessFunction | 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_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":812
 *             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_79getInitialGuess(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_78getInitialGuess, "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:812");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_79getInitialGuess = {"getInitialGuess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_79getInitialGuess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_78getInitialGuess};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_79getInitialGuess(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getInitialGuess", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_78getInitialGuess(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_78getInitialGuess(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":822
 * 
 *         """
 *         return self.get_attr('__initialguess__')             # <<<<<<<<<<<<<<
 * 
 *     def setFunction(self, function: SNESFunction | 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, 822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":812
 *             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":824
 *         return self.get_attr('__initialguess__')
 * 
 *     def setFunction(self, function: SNESFunction | None,             # <<<<<<<<<<<<<<
 *                     Vec f=None,
 *                     args: tuple[Any, ...] | None = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_81setFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_80setFunction, "SNES.setFunction(self, function: SNESFunction | None, 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:824");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_81setFunction = {"setFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_81setFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_80setFunction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_81setFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_function,&__pyx_mstate_global->__pyx_n_u_f,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 824, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 824, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 824, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 824, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 824, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFunction", 0) < (0)) __PYX_ERR(50, 824, __pyx_L3_error)

      /* "petsc4py/PETSc/SNES.pyx":825
 * 
 *     def setFunction(self, function: SNESFunction | None,
 *                     Vec f=None,             # <<<<<<<<<<<<<<
 *                     args: tuple[Any, ...] | None = None,
 *                     kargs: dict[str, Any] | None = None) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":826
 *     def setFunction(self, function: SNESFunction | None,
 *                     Vec f=None,
 *                     args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                     kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback to compute the nonlinear function.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":827
 *                     Vec f=None,
 *                     args: tuple[Any, ...] | None = None,
 *                     kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback to compute the nonlinear function.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFunction", 0, 1, 4, i); __PYX_ERR(50, 824, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 824, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 824, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 824, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 824, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/SNES.pyx":825
 * 
 *     def setFunction(self, function: SNESFunction | None,
 *                     Vec f=None,             # <<<<<<<<<<<<<<
 *                     args: tuple[Any, ...] | None = None,
 *                     kargs: dict[str, Any] | None = None) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":826
 *     def setFunction(self, function: SNESFunction | None,
 *                     Vec f=None,
 *                     args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                     kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback to compute the nonlinear function.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":827
 *                     Vec f=None,
 *                     args: tuple[Any, ...] | None = None,
 *                     kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback to compute the nonlinear function.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 824, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "f", 0))) __PYX_ERR(50, 825, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_80setFunction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_function, __pyx_v_f, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/SNES.pyx":824
 *         return self.get_attr('__initialguess__')
 * 
 *     def setFunction(self, function: SNESFunction | None,             # <<<<<<<<<<<<<<
 *                     Vec f=None,
 *                     args: tuple[Any, ...] | None = None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_80setFunction(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":848
 * 
 *         """
 *         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":849
 *         """
 *         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":850
 *         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":851
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/SNES.pyx":852
 *         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, 852, __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":853
 *             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, <void*>context))
*/
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 853, __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) != (0)) __PYX_ERR(50, 853, __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) != (0)) __PYX_ERR(50, 853, __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) != (0)) __PYX_ERR(50, 853, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/SNES.pyx":854
 *             if kargs is None: kargs = {}
 *             context = (function, args, kargs)
 *             self.set_attr('__function__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(SNESSetFunction(self.snes, fvec, SNES_Function, <void*>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, 854, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/SNES.pyx":855
 *             context = (function, args, kargs)
 *             self.set_attr('__function__', context)
 *             CHKERR(SNESSetFunction(self.snes, fvec, SNES_Function, <void*>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, 855, __pyx_L1_error)

    /* "petsc4py/PETSc/SNES.pyx":850
 *         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":857
 *             CHKERR(SNESSetFunction(self.snes, fvec, SNES_Function, <void*>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, 857, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/SNES.pyx":824
 *         return self.get_attr('__initialguess__')
 * 
 *     def setFunction(self, function: SNESFunction | None,             # <<<<<<<<<<<<<<
 *                     Vec f=None,
 *                     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_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":859
 *             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_83getFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_82getFunction, "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:859");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_83getFunction = {"getFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_83getFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_82getFunction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_83getFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFunction", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_82getFunction(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_82getFunction(struct PyPetscSNESObject *__pyx_v_self) {
  PetscErrorCode (*__pyx_v_fun)(SNES, Vec, Vec, void *);
  struct PyPetscVecObject *__pyx_v_f = 0;
  void *__pyx_v_ctx;
  PyObject *__pyx_v_function = 0;
  PyObject *__pyx_v_context = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getFunction", 0);

  /* "petsc4py/PETSc/SNES.pyx":870
 *         """
 *         cdef PetscErrorCode(*fun)(PetscSNES, PetscVec, PetscVec, void*) except PETSC_ERR_PYTHON nogil
 *         cdef Vec f = Vec()             # <<<<<<<<<<<<<<
 *         cdef void* ctx = NULL
 *         fun = SNES_Function
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 870, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_f = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":871
 *         cdef PetscErrorCode(*fun)(PetscSNES, PetscVec, PetscVec, void*) except PETSC_ERR_PYTHON nogil
 *         cdef Vec f = Vec()
 *         cdef void* ctx = NULL             # <<<<<<<<<<<<<<
 *         fun = SNES_Function
 *         CHKERR(SNESGetFunction(self.snes, &f.vec, &fun, &ctx))
*/
  __pyx_v_ctx = NULL;

  /* "petsc4py/PETSc/SNES.pyx":872
 *         cdef Vec f = Vec()
 *         cdef void* ctx = NULL
 *         fun = SNES_Function             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetFunction(self.snes, &f.vec, &fun, &ctx))
 *         CHKERR(PetscINCREF(f.obj))
*/
  __pyx_v_fun = __pyx_f_8petsc4py_5PETSc_SNES_Function;

  /* "petsc4py/PETSc/SNES.pyx":873
 *         cdef void* ctx = NULL
 *         fun = SNES_Function
 *         CHKERR(SNESGetFunction(self.snes, &f.vec, &fun, &ctx))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(f.obj))
 *         cdef object function = self.get_attr('__function__')
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetFunction(__pyx_v_self->snes, (&__pyx_v_f->vec), (&__pyx_v_fun), (&__pyx_v_ctx))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 873, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":874
 *         fun = SNES_Function
 *         CHKERR(SNESGetFunction(self.snes, &f.vec, &fun, &ctx))
 *         CHKERR(PetscINCREF(f.obj))             # <<<<<<<<<<<<<<
 *         cdef object function = self.get_attr('__function__')
 *         cdef object context
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_f->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 874, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":875
 *         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, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_function = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":878
 *         cdef object context
 * 
 *         if function is not None:             # <<<<<<<<<<<<<<
 *             return (f, function)
 * 
*/
  __pyx_t_5 = (__pyx_v_function != Py_None);
  if (__pyx_t_5) {

    /* "petsc4py/PETSc/SNES.pyx":879
 * 
 *         if function is not None:
 *             return (f, function)             # <<<<<<<<<<<<<<
 * 
 *         if ctx != NULL and <void*>SNES_Function == <void*>fun:
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 879, __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)) != (0)) __PYX_ERR(50, 879, __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) != (0)) __PYX_ERR(50, 879, __pyx_L1_error);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "petsc4py/PETSc/SNES.pyx":878
 *         cdef object context
 * 
 *         if function is not None:             # <<<<<<<<<<<<<<
 *             return (f, function)
 * 
*/
  }

  /* "petsc4py/PETSc/SNES.pyx":881
 *             return (f, function)
 * 
 *         if ctx != NULL and <void*>SNES_Function == <void*>fun:             # <<<<<<<<<<<<<<
 *             context = <object>ctx
 *             if context is not None:
*/
  __pyx_t_6 = (__pyx_v_ctx != NULL);
  if (__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_6 = (((void *)__pyx_f_8petsc4py_5PETSc_SNES_Function) == ((void *)__pyx_v_fun));
  __pyx_t_5 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_5) {

    /* "petsc4py/PETSc/SNES.pyx":882
 * 
 *         if ctx != NULL and <void*>SNES_Function == <void*>fun:
 *             context = <object>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":883
 *         if ctx != NULL and <void*>SNES_Function == <void*>fun:
 *             context = <object>ctx
 *             if context is not None:             # <<<<<<<<<<<<<<
 *                 assert type(context) is tuple
 *                 return (f, context)
*/
    __pyx_t_5 = (__pyx_v_context != Py_None);
    if (__pyx_t_5) {

      /* "petsc4py/PETSc/SNES.pyx":884
 *             context = <object>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_5 = (((PyObject *)Py_TYPE(__pyx_v_context)) == ((PyObject *)(&PyTuple_Type)));
        if (unlikely(!__pyx_t_5)) {
          __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
          __PYX_ERR(50, 884, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(50, 884, __pyx_L1_error)
      #endif

      /* "petsc4py/PETSc/SNES.pyx":885
 *             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, 885, __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)) != (0)) __PYX_ERR(50, 885, __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) != (0)) __PYX_ERR(50, 885, __pyx_L1_error);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "petsc4py/PETSc/SNES.pyx":883
 *         if ctx != NULL and <void*>SNES_Function == <void*>fun:
 *             context = <object>ctx
 *             if context is not None:             # <<<<<<<<<<<<<<
 *                 assert type(context) is tuple
 *                 return (f, context)
*/
    }

    /* "petsc4py/PETSc/SNES.pyx":881
 *             return (f, function)
 * 
 *         if ctx != NULL and <void*>SNES_Function == <void*>fun:             # <<<<<<<<<<<<<<
 *             context = <object>ctx
 *             if context is not None:
*/
  }

  /* "petsc4py/PETSc/SNES.pyx":887
 *                 return (f, context)
 * 
 *         return (f, None)             # <<<<<<<<<<<<<<
 * 
 *     def setUpdate(self, update: SNESUpdateFunction | None,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 887, __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)) != (0)) __PYX_ERR(50, 887, __pyx_L1_error);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None) != (0)) __PYX_ERR(50, 887, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":859
 *             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_XDECREF(__pyx_t_2);
  __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":889
 *         return (f, None)
 * 
 *     def setUpdate(self, update: SNESUpdateFunction | None,             # <<<<<<<<<<<<<<
 *                   args: tuple[Any, ...] | None = None,
 *                   kargs: dict[str, Any] | None = None) -> None:
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_85setUpdate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_84setUpdate, "SNES.setUpdate(self, update: SNESUpdateFunction | None, 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:889");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_85setUpdate = {"setUpdate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_85setUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_84setUpdate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_85setUpdate(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_update,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 889, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 889, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 889, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 889, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setUpdate", 0) < (0)) __PYX_ERR(50, 889, __pyx_L3_error)

      /* "petsc4py/PETSc/SNES.pyx":890
 * 
 *     def setUpdate(self, update: SNESUpdateFunction | None,
 *                   args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                   kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback to compute update at the beginning of each step.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":891
 *     def setUpdate(self, update: SNESUpdateFunction | None,
 *                   args: tuple[Any, ...] | None = None,
 *                   kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback to compute update at the beginning of each step.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setUpdate", 0, 1, 3, i); __PYX_ERR(50, 889, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 889, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 889, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 889, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/SNES.pyx":890
 * 
 *     def setUpdate(self, update: SNESUpdateFunction | None,
 *                   args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                   kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback to compute update at the beginning of each step.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":891
 *     def setUpdate(self, update: SNESUpdateFunction | None,
 *                   args: tuple[Any, ...] | None = None,
 *                   kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback to compute update at the beginning of each step.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 889, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_84setUpdate(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_update, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/SNES.pyx":889
 *         return (f, None)
 * 
 *     def setUpdate(self, update: SNESUpdateFunction | None,             # <<<<<<<<<<<<<<
 *                   args: tuple[Any, ...] | None = None,
 *                   kargs: dict[str, Any] | None = None) -> None:
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_84setUpdate(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":910
 * 
 *         """
 *         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":911
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/SNES.pyx":912
 *         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, 912, __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":913
 *             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, 913, __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) != (0)) __PYX_ERR(50, 913, __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) != (0)) __PYX_ERR(50, 913, __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) != (0)) __PYX_ERR(50, 913, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":914
 *             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, 914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":915
 *             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, 915, __pyx_L1_error)

    /* "petsc4py/PETSc/SNES.pyx":910
 * 
 *         """
 *         if update is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/SNES.pyx":917
 *             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, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":918
 *         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, 918, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/SNES.pyx":889
 *         return (f, None)
 * 
 *     def setUpdate(self, update: SNESUpdateFunction | 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_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":920
 *             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_87getUpdate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_86getUpdate, "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:920");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_87getUpdate = {"getUpdate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_87getUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_86getUpdate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_87getUpdate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getUpdate", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_86getUpdate(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_86getUpdate(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":930
 * 
 *         """
 *         return self.get_attr('__update__')             # <<<<<<<<<<<<<<
 * 
 *     def setJacobian(self,
*/
  __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, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":920
 *             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":932
 *         return self.get_attr('__update__')
 * 
 *     def setJacobian(self,             # <<<<<<<<<<<<<<
 *                     jacobian: SNESJacobianFunction | None,
 *                     Mat J=None, Mat P=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_89setJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_88setJacobian, "SNES.setJacobian(self, jacobian: SNESJacobianFunction | None, 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:932");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_89setJacobian = {"setJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_89setJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_88setJacobian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_89setJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_jacobian,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 932, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(50, 932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setJacobian", 0) < (0)) __PYX_ERR(50, 932, __pyx_L3_error)

      /* "petsc4py/PETSc/SNES.pyx":934
 *     def setJacobian(self,
 *                     jacobian: SNESJacobianFunction | None,
 *                     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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":935
 *                     jacobian: SNESJacobianFunction | None,
 *                     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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setJacobian", 0, 1, 5, i); __PYX_ERR(50, 932, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(50, 932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 932, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/SNES.pyx":934
 *     def setJacobian(self,
 *                     jacobian: SNESJacobianFunction | None,
 *                     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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":935
 *                     jacobian: SNESJacobianFunction | None,
 *                     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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 932, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(50, 934, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(50, 934, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_88setJacobian(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/SNES.pyx":932
 *         return self.get_attr('__update__')
 * 
 *     def setJacobian(self,             # <<<<<<<<<<<<<<
 *                     jacobian: SNESJacobianFunction | None,
 *                     Mat J=None, Mat P=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_88setJacobian(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":958
 * 
 *         """
 *         cdef PetscMat Jmat=NULL             # <<<<<<<<<<<<<<
 *         if J is not None: Jmat = J.mat
 *         cdef PetscMat Pmat=Jmat
*/
  __pyx_v_Jmat = NULL;

  /* "petsc4py/PETSc/SNES.pyx":959
 *         """
 *         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":960
 *         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":961
 *         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":962
 *         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":963
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/SNES.pyx":964
 *         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, 964, __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":965
 *             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, <void*>context))
*/
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 965, __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) != (0)) __PYX_ERR(50, 965, __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) != (0)) __PYX_ERR(50, 965, __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) != (0)) __PYX_ERR(50, 965, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/SNES.pyx":966
 *             if kargs is None: kargs = {}
 *             context = (jacobian, args, kargs)
 *             self.set_attr('__jacobian__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(SNESSetJacobian(self.snes, Jmat, Pmat, SNES_Jacobian, <void*>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, 966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/SNES.pyx":967
 *             context = (jacobian, args, kargs)
 *             self.set_attr('__jacobian__', context)
 *             CHKERR(SNESSetJacobian(self.snes, Jmat, Pmat, SNES_Jacobian, <void*>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, 967, __pyx_L1_error)

    /* "petsc4py/PETSc/SNES.pyx":962
 *         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":969
 *             CHKERR(SNESSetJacobian(self.snes, Jmat, Pmat, SNES_Jacobian, <void*>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, 969, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "petsc4py/PETSc/SNES.pyx":932
 *         return self.get_attr('__update__')
 * 
 *     def setJacobian(self,             # <<<<<<<<<<<<<<
 *                     jacobian: SNESJacobianFunction | None,
 *                     Mat J=None, Mat P=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.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":971
 *             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_91getJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_90getJacobian, "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:971");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_91getJacobian = {"getJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_91getJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_90getJacobian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_91getJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getJacobian", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_90getJacobian(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_90getJacobian(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getJacobian", 0);

  /* "petsc4py/PETSc/SNES.pyx":990
 * 
 *         """
 *         cdef Mat J = Mat()             # <<<<<<<<<<<<<<
 *         cdef Mat P = Mat()
 *         CHKERR(SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 990, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":991
 *         """
 *         cdef Mat J = Mat()
 *         cdef Mat P = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetJacobian(self.snes, &J.mat, &P.mat, NULL, NULL))
 *         CHKERR(PetscINCREF(J.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 991, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":992
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetJacobian(__pyx_v_self->snes, (&__pyx_v_J->mat), (&__pyx_v_P->mat), NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 992, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":993
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 993, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":994
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 994, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":995
 *         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, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_jacobian = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":996
 *         CHKERR(PetscINCREF(P.obj))
 *         cdef object jacobian = self.get_attr('__jacobian__')
 *         return (J, P, jacobian)             # <<<<<<<<<<<<<<
 * 
 *     def setObjective(self,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 996, __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)) != (0)) __PYX_ERR(50, 996, __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)) != (0)) __PYX_ERR(50, 996, __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) != (0)) __PYX_ERR(50, 996, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":971
 *             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_XDECREF(__pyx_t_2);
  __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":998
 *         return (J, P, jacobian)
 * 
 *     def setObjective(self,             # <<<<<<<<<<<<<<
 *                      objective: SNESObjFunction | None,
 *                      args: tuple[Any, ...] | None = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_93setObjective(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_92setObjective, "SNES.setObjective(self, objective: SNESObjFunction | None, 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:998");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_93setObjective = {"setObjective", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_93setObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_92setObjective};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_93setObjective(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_objective,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 998, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 998, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 998, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 998, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setObjective", 0) < (0)) __PYX_ERR(50, 998, __pyx_L3_error)

      /* "petsc4py/PETSc/SNES.pyx":1000
 *     def setObjective(self,
 *                      objective: SNESObjFunction | None,
 *                      args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                      kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback to compute the objective function.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":1001
 *                      objective: SNESObjFunction | None,
 *                      args: tuple[Any, ...] | None = None,
 *                      kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback to compute the objective function.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setObjective", 0, 1, 3, i); __PYX_ERR(50, 998, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 998, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 998, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 998, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/SNES.pyx":1000
 *     def setObjective(self,
 *                      objective: SNESObjFunction | None,
 *                      args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                      kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback to compute the objective function.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":1001
 *                      objective: SNESObjFunction | None,
 *                      args: tuple[Any, ...] | None = None,
 *                      kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback to compute the objective function.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 998, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_92setObjective(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_objective, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/SNES.pyx":998
 *         return (J, P, jacobian)
 * 
 *     def setObjective(self,             # <<<<<<<<<<<<<<
 *                      objective: SNESObjFunction | None,
 *                      args: tuple[Any, ...] | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_92setObjective(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":1020
 * 
 *         """
 *         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":1021
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/SNES.pyx":1022
 *         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, 1022, __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":1023
 *             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, <void*>context))
*/
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1023, __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) != (0)) __PYX_ERR(50, 1023, __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) != (0)) __PYX_ERR(50, 1023, __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) != (0)) __PYX_ERR(50, 1023, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":1024
 *             if kargs is None: kargs = {}
 *             context = (objective, args, kargs)
 *             self.set_attr('__objective__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(SNESSetObjective(self.snes, SNES_Objective, <void*>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, 1024, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":1025
 *             context = (objective, args, kargs)
 *             self.set_attr('__objective__', context)
 *             CHKERR(SNESSetObjective(self.snes, SNES_Objective, <void*>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, 1025, __pyx_L1_error)

    /* "petsc4py/PETSc/SNES.pyx":1020
 * 
 *         """
 *         if objective is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/SNES.pyx":1027
 *             CHKERR(SNESSetObjective(self.snes, SNES_Objective, <void*>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, 1027, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/SNES.pyx":998
 *         return (J, P, jacobian)
 * 
 *     def setObjective(self,             # <<<<<<<<<<<<<<
 *                      objective: SNESObjFunction | None,
 *                      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.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":1029
 *             CHKERR(SNESSetObjective(self.snes, NULL, NULL))
 * 
 *     def getObjective(self) -> SNESObjFunction:             # <<<<<<<<<<<<<<
 *         """Return the objective callback tuple.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_95getObjective(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_94getObjective, "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:1029");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_95getObjective = {"getObjective", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_95getObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_94getObjective};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_95getObjective(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getObjective", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_94getObjective(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_94getObjective(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1039
 * 
 *         """
 *         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, 1039, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1040
 *         """
 *         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, 1040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_objective = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1041
 *         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":1029
 *             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":1043
 *         return objective
 * 
 *     def computeFunction(self, Vec x, Vec f) -> None:             # <<<<<<<<<<<<<<
 *         """Compute the function.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_97computeFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_96computeFunction, "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:1043");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_97computeFunction = {"computeFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_97computeFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_96computeFunction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_97computeFunction(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_f,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1043, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1043, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1043, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeFunction", 0) < (0)) __PYX_ERR(50, 1043, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeFunction", 1, 2, 2, i); __PYX_ERR(50, 1043, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1043, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1043, __pyx_L3_error)
    }
    __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, 1043, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(50, 1043, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(50, 1043, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_96computeFunction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_x, __pyx_v_f);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_96computeFunction(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1060
 * 
 *         """
 *         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, 1060, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1043
 *         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":1062
 *         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_99computeJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_98computeJacobian, "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:1062");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_99computeJacobian = {"computeJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_99computeJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_98computeJacobian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_99computeJacobian(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_P,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1062, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 1062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeJacobian", 0) < (0)) __PYX_ERR(50, 1062, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeJacobian", 0, 2, 3, i); __PYX_ERR(50, 1062, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 1062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1062, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1062, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 1062, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(50, 1062, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(50, 1062, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(50, 1062, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_98computeJacobian(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_98computeJacobian(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1081
 * 
 *         """
 *         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":1082
 *         """
 *         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":1083
 *         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, 1083, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1062
 *         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":1085
 *         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_101computeObjective(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_100computeObjective, "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:1085");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_101computeObjective = {"computeObjective", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_101computeObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_100computeObjective};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_101computeObjective(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1085, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1085, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeObjective", 0) < (0)) __PYX_ERR(50, 1085, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeObjective", 1, 1, 1, i); __PYX_ERR(50, 1085, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1085, __pyx_L3_error)
    }
    __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, 1085, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(50, 1085, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_100computeObjective(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_x);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_100computeObjective(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1100
 * 
 *         """
 *         cdef PetscReal o = 0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESComputeObjective(self.snes, x.vec, &o))
 *         return toReal(o)
*/
  __pyx_v_o = 0.0;

  /* "petsc4py/PETSc/SNES.pyx":1101
 *         """
 *         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, 1101, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1102
 *         cdef PetscReal o = 0
 *         CHKERR(SNESComputeObjective(self.snes, x.vec, &o))
 *         return toReal(o)             # <<<<<<<<<<<<<<
 * 
 *     def setNGS(self,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_o); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1085
 *         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":1104
 *         return toReal(o)
 * 
 *     def setNGS(self,             # <<<<<<<<<<<<<<
 *                ngs: SNESNGSFunction | None,
 *                args: tuple[Any, ...] | None = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_103setNGS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_102setNGS, "SNES.setNGS(self, ngs: SNESNGSFunction | None, 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:1104");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_103setNGS = {"setNGS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_103setNGS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_102setNGS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_103setNGS(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ngs,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1104, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 1104, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1104, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1104, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNGS", 0) < (0)) __PYX_ERR(50, 1104, __pyx_L3_error)

      /* "petsc4py/PETSc/SNES.pyx":1106
 *     def setNGS(self,
 *                ngs: SNESNGSFunction | None,
 *                args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback to compute nonlinear Gauss-Seidel.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":1107
 *                ngs: SNESNGSFunction | None,
 *                args: tuple[Any, ...] | None = None,
 *                kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback to compute nonlinear Gauss-Seidel.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNGS", 0, 1, 3, i); __PYX_ERR(50, 1104, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 1104, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1104, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1104, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/SNES.pyx":1106
 *     def setNGS(self,
 *                ngs: SNESNGSFunction | None,
 *                args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback to compute nonlinear Gauss-Seidel.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":1107
 *                ngs: SNESNGSFunction | None,
 *                args: tuple[Any, ...] | None = None,
 *                kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback to compute nonlinear Gauss-Seidel.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1104, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_102setNGS(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_ngs, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/SNES.pyx":1104
 *         return toReal(o)
 * 
 *     def setNGS(self,             # <<<<<<<<<<<<<<
 *                ngs: SNESNGSFunction | None,
 *                args: tuple[Any, ...] | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_102setNGS(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":1126
 * 
 *         """
 *         if ngs is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
  __pyx_t_1 = (__pyx_v_ngs != Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/SNES.pyx":1127
 *         """
 *         if ngs is not None:
 *             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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/SNES.pyx":1128
 *         if ngs is not None:
 *             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, 1128, __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":1129
 *             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, <void*>context))
*/
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1129, __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) != (0)) __PYX_ERR(50, 1129, __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) != (0)) __PYX_ERR(50, 1129, __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) != (0)) __PYX_ERR(50, 1129, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":1130
 *             if kargs is None: kargs = {}
 *             context = (ngs, args, kargs)
 *             self.set_attr('__ngs__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(SNESSetNGS(self.snes, SNES_NGS, <void*>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 *)"__ngs__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":1131
 *             context = (ngs, args, kargs)
 *             self.set_attr('__ngs__', context)
 *             CHKERR(SNESSetNGS(self.snes, SNES_NGS, <void*>context))             # <<<<<<<<<<<<<<
 *         else:
 *             CHKERR(SNESSetNGS(self.snes, NULL, NULL))
*/
    __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, 1131, __pyx_L1_error)

    /* "petsc4py/PETSc/SNES.pyx":1126
 * 
 *         """
 *         if ngs is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/SNES.pyx":1133
 *             CHKERR(SNESSetNGS(self.snes, SNES_NGS, <void*>context))
 *         else:
 *             CHKERR(SNESSetNGS(self.snes, NULL, NULL))             # <<<<<<<<<<<<<<
 * 
 *     def getNGS(self) -> SNESNGSFunction:
*/
  /*else*/ {
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetNGS(__pyx_v_self->snes, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1133, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/SNES.pyx":1104
 *         return toReal(o)
 * 
 *     def setNGS(self,             # <<<<<<<<<<<<<<
 *                ngs: SNESNGSFunction | None,
 *                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.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":1135
 *             CHKERR(SNESSetNGS(self.snes, NULL, NULL))
 * 
 *     def getNGS(self) -> SNESNGSFunction:             # <<<<<<<<<<<<<<
 *         """Return the nonlinear Gauss-Seidel callback tuple.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_105getNGS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_104getNGS, "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:1135");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_105getNGS = {"getNGS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_105getNGS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_104getNGS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_105getNGS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNGS", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_104getNGS(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_104getNGS(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1145
 * 
 *         """
 *         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, 1145, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1146
 *         """
 *         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, 1146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ngs = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1147
 *         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":1135
 *             CHKERR(SNESSetNGS(self.snes, NULL, NULL))
 * 
 *     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":1149
 *         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_107computeNGS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_106computeNGS, "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:1149");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_107computeNGS = {"computeNGS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_107computeNGS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_106computeNGS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_107computeNGS(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_b,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1149, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeNGS", 0) < (0)) __PYX_ERR(50, 1149, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeNGS", 0, 1, 2, i); __PYX_ERR(50, 1149, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1149, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 1149, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(50, 1149, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(50, 1149, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_106computeNGS(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_x, __pyx_v_b);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_106computeNGS(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1166
 * 
 *         """
 *         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":1167
 *         """
 *         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":1168
 *         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, 1168, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1149
 *         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":1172
 *     # --- tolerances and convergence ---
 * 
 *     def setTolerances(self, rtol: float | None = None, atol: float | None = None, stol: float | None = None, max_it: int | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the tolerance parameters used in the solver convergence tests.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_109setTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_108setTolerances, "SNES.setTolerances(self, rtol: float | None = None, atol: float | None = None, stol: float | None = None, max_it: int | None = None) -> None\nSet the tolerance parameters used in the solver convergence tests.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        rtol\n            The relative norm of the residual, or `DETERMINE` to\n            use the value when the object's type was set. Defaults to\n            `CURRENT`.\n        atol\n            The absolute norm of the residual, or `DETERMINE` to\n            use the value when the object's type was set. Defaults to\n            `CURRENT`.\n        stol\n            The absolute norm of the step, or `DETERMINE` to use\n            the value when the object's type was set. Defaults to\n            `CURRENT`.\n        max_it\n            The maximum allowed number of iterations, or `DETERMINE`\n            to use the value when the object's type was set. Defaults\n            to `CURRENT`. Use `UNLIMITED` to have no maximum.\n\n        See Also\n        --------\n        getTolerances, petsc.SNESSetTolerances\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:1172");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_109setTolerances = {"setTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_109setTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_108setTolerances};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_109setTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rtol,&__pyx_mstate_global->__pyx_n_u_atol,&__pyx_mstate_global->__pyx_n_u_stol,&__pyx_mstate_global->__pyx_n_u_max_it,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1172, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 1172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 1172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTolerances", 0) < (0)) __PYX_ERR(50, 1172, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 1172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 1172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1172, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_108setTolerances(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_rtol, __pyx_v_atol, __pyx_v_stol, __pyx_v_max_it);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_108setTolerances(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1202
 *         """
 *         cdef PetscReal crtol, catol, cstol
 *         crtol = catol = cstol = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         cdef PetscInt cmaxit = PETSC_CURRENT
 *         if rtol   is not None: crtol  = asReal(rtol)
*/
  __pyx_v_crtol = PETSC_CURRENT;
  __pyx_v_catol = PETSC_CURRENT;
  __pyx_v_cstol = PETSC_CURRENT;

  /* "petsc4py/PETSc/SNES.pyx":1203
 *         cdef PetscReal crtol, catol, cstol
 *         crtol = catol = cstol = PETSC_CURRENT
 *         cdef PetscInt cmaxit = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         if rtol   is not None: crtol  = asReal(rtol)
 *         if atol   is not None: catol  = asReal(atol)
*/
  __pyx_v_cmaxit = PETSC_CURRENT;

  /* "petsc4py/PETSc/SNES.pyx":1204
 *         crtol = catol = cstol = PETSC_CURRENT
 *         cdef PetscInt cmaxit = PETSC_CURRENT
 *         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, 1204, __pyx_L1_error)
    __pyx_v_crtol = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":1205
 *         cdef PetscInt cmaxit = PETSC_CURRENT
 *         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, 1205, __pyx_L1_error)
    __pyx_v_catol = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":1206
 *         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, 1206, __pyx_L1_error)
    __pyx_v_cstol = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":1207
 *         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_CURRENT))
*/
  __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, 1207, __pyx_L1_error)
    __pyx_v_cmaxit = __pyx_t_3;
  }

  /* "petsc4py/PETSc/SNES.pyx":1208
 *         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_CURRENT))
 * 
*/
  __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_CURRENT)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1208, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1172
 *     # --- tolerances and convergence ---
 * 
 *     def setTolerances(self, rtol: float | None = None, atol: float | None = None, stol: float | None = None, max_it: int | None = 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":1211
 *                                  cmaxit, PETSC_CURRENT))
 * 
 *     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_111getTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_110getTolerances, "SNES.getTolerances(self) -> tuple[float, float, float, int]\nReturn the tolerance parameters used in the solver convergence tests.\n\n        Not 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:1211");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_111getTolerances = {"getTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_111getTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_110getTolerances};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_111getTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTolerances", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_110getTolerances(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_110getTolerances(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1232
 * 
 *         """
 *         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":1233
 *         """
 *         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":1234
 *         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, 1234, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1236
 *         CHKERR(SNESGetTolerances(self.snes, &catol, &crtol, &cstol,
 *                                  &cmaxit, NULL))
 *         return (toReal(crtol), toReal(catol), toReal(cstol), toInt(cmaxit))             # <<<<<<<<<<<<<<
 * 
 *     def setDivergenceTolerance(self, dtol: float) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_crtol); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1236, __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, 1236, __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, 1236, __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, 1236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(50, 1236, __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) != (0)) __PYX_ERR(50, 1236, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3) != (0)) __PYX_ERR(50, 1236, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4) != (0)) __PYX_ERR(50, 1236, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5) != (0)) __PYX_ERR(50, 1236, __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":1211
 *                                  cmaxit, PETSC_CURRENT))
 * 
 *     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":1238
 *         return (toReal(crtol), toReal(catol), toReal(cstol), toInt(cmaxit))
 * 
 *     def setDivergenceTolerance(self, dtol: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the divergence tolerance parameter used in the convergence tests.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_113setDivergenceTolerance(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_112setDivergenceTolerance, "SNES.setDivergenceTolerance(self, dtol: float) -> None\nSet the divergence tolerance parameter used in the convergence tests.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        dtol\n            The divergence tolerance.\n\n        See Also\n        --------\n        getDivergenceTolerance, setTolerances, petsc.SNESSetDivergenceTolerance\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:1238");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_113setDivergenceTolerance = {"setDivergenceTolerance", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_113setDivergenceTolerance, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_112setDivergenceTolerance};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_113setDivergenceTolerance(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_dtol = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setDivergenceTolerance (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dtol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1238, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1238, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDivergenceTolerance", 0) < (0)) __PYX_ERR(50, 1238, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDivergenceTolerance", 1, 1, 1, i); __PYX_ERR(50, 1238, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1238, __pyx_L3_error)
    }
    __pyx_v_dtol = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setDivergenceTolerance", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1238, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.setDivergenceTolerance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_112setDivergenceTolerance(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_dtol);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_112setDivergenceTolerance(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_dtol) {
  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("setDivergenceTolerance", 0);

  /* "petsc4py/PETSc/SNES.pyx":1253
 * 
 *         """
 *         CHKERR(SNESSetDivergenceTolerance(self.snes, asReal(dtol)))             # <<<<<<<<<<<<<<
 * 
 *     def getDivergenceTolerance(self) -> float:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_dtol); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 1253, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetDivergenceTolerance(__pyx_v_self->snes, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1253, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1238
 *         return (toReal(crtol), toReal(catol), toReal(cstol), toInt(cmaxit))
 * 
 *     def setDivergenceTolerance(self, dtol: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the divergence tolerance parameter used in the convergence tests.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.setDivergenceTolerance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":1255
 *         CHKERR(SNESSetDivergenceTolerance(self.snes, asReal(dtol)))
 * 
 *     def getDivergenceTolerance(self) -> float:             # <<<<<<<<<<<<<<
 *         """Get the divergence tolerance parameter used in the convergence tests.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_115getDivergenceTolerance(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_114getDivergenceTolerance, "SNES.getDivergenceTolerance(self) -> float\nGet the divergence tolerance parameter used in the convergence tests.\n\n        Not collective.\n\n        See Also\n        --------\n        setDivergenceTolerance, getTolerances, petsc.SNESGetDivergenceTolerance\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:1255");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_115getDivergenceTolerance = {"getDivergenceTolerance", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_115getDivergenceTolerance, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_114getDivergenceTolerance};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_115getDivergenceTolerance(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getDivergenceTolerance (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getDivergenceTolerance", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDivergenceTolerance", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_114getDivergenceTolerance(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_114getDivergenceTolerance(struct PyPetscSNESObject *__pyx_v_self) {
  PetscReal __pyx_v_cdtol;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscErrorCode __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDivergenceTolerance", 0);

  /* "petsc4py/PETSc/SNES.pyx":1265
 * 
 *         """
 *         cdef PetscReal cdtol=0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetDivergenceTolerance(self.snes, &cdtol))
 *         return toReal(cdtol)
*/
  __pyx_v_cdtol = 0.0;

  /* "petsc4py/PETSc/SNES.pyx":1266
 *         """
 *         cdef PetscReal cdtol=0
 *         CHKERR(SNESGetDivergenceTolerance(self.snes, &cdtol))             # <<<<<<<<<<<<<<
 *         return toReal(cdtol)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetDivergenceTolerance(__pyx_v_self->snes, (&__pyx_v_cdtol))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1266, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1267
 *         cdef PetscReal cdtol=0
 *         CHKERR(SNESGetDivergenceTolerance(self.snes, &cdtol))
 *         return toReal(cdtol)             # <<<<<<<<<<<<<<
 * 
 *     def setNormSchedule(self, normsched: NormSchedule) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_cdtol); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1255
 *         CHKERR(SNESSetDivergenceTolerance(self.snes, asReal(dtol)))
 * 
 *     def getDivergenceTolerance(self) -> float:             # <<<<<<<<<<<<<<
 *         """Get the divergence tolerance parameter used in the convergence tests.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.getDivergenceTolerance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":1269
 *         return toReal(cdtol)
 * 
 *     def setNormSchedule(self, normsched: NormSchedule) -> None:             # <<<<<<<<<<<<<<
 *         """Set the norm schedule.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_117setNormSchedule(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_116setNormSchedule, "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:1269");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_117setNormSchedule = {"setNormSchedule", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_117setNormSchedule, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_116setNormSchedule};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_117setNormSchedule(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_normsched,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1269, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1269, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNormSchedule", 0) < (0)) __PYX_ERR(50, 1269, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNormSchedule", 1, 1, 1, i); __PYX_ERR(50, 1269, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1269, __pyx_L3_error)
    }
    __pyx_v_normsched = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setNormSchedule", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1269, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_116setNormSchedule(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_normsched);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_116setNormSchedule(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1279
 * 
 *         """
 *         CHKERR(SNESSetNormSchedule(self.snes, normsched))             # <<<<<<<<<<<<<<
 * 
 *     def getNormSchedule(self) -> NormSchedule:
*/
  __pyx_t_1 = ((SNESNormSchedule)__Pyx_PyLong_As_SNESNormSchedule(__pyx_v_normsched)); if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1279, __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, 1279, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1269
 *         return toReal(cdtol)
 * 
 *     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":1281
 *         CHKERR(SNESSetNormSchedule(self.snes, normsched))
 * 
 *     def getNormSchedule(self) -> NormSchedule:             # <<<<<<<<<<<<<<
 *         """Return the norm schedule.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_119getNormSchedule(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_118getNormSchedule, "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:1281");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_119getNormSchedule = {"getNormSchedule", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_119getNormSchedule, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_118getNormSchedule};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_119getNormSchedule(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNormSchedule", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_118getNormSchedule(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_118getNormSchedule(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1291
 * 
 *         """
 *         cdef PetscSNESNormSchedule normsched = SNES_NORM_NONE             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetNormSchedule(self.snes, &normsched))
 *         return normsched
*/
  __pyx_v_normsched = SNES_NORM_NONE;

  /* "petsc4py/PETSc/SNES.pyx":1292
 *         """
 *         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, 1292, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1293
 *         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_PyLong_From_SNESNormSchedule(__pyx_v_normsched); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1281
 *         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":1295
 *         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_121setConvergenceTest(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_120setConvergenceTest, "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:1295");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_121setConvergenceTest = {"setConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_121setConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_120setConvergenceTest};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_121setConvergenceTest(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_converged,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1295, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 1295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setConvergenceTest", 0) < (0)) __PYX_ERR(50, 1295, __pyx_L3_error)

      /* "petsc4py/PETSc/SNES.pyx":1296
 * 
 *     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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":1297
 *     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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setConvergenceTest", 0, 1, 3, i); __PYX_ERR(50, 1295, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 1295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1295, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1295, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/SNES.pyx":1296
 * 
 *     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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":1297
 *     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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1295, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_120setConvergenceTest(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_converged, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/SNES.pyx":1295
 *         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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_120setConvergenceTest(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":1316
 * 
 *         """
 *         if converged == "skip":             # <<<<<<<<<<<<<<
 *             self.set_attr('__converged__', None)
 *             CHKERR(SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL))
*/
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_converged, __pyx_mstate_global->__pyx_n_u_skip, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(50, 1316, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/SNES.pyx":1317
 *         """
 *         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, 1317, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":1318
 *         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, 1318, __pyx_L1_error)

    /* "petsc4py/PETSc/SNES.pyx":1316
 * 
 *         """
 *         if converged == "skip":             # <<<<<<<<<<<<<<
 *             self.set_attr('__converged__', None)
 *             CHKERR(SNESSetConvergenceTest(self.snes, SNESConvergedSkip, NULL, NULL))
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/SNES.pyx":1319
 *             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_PyUnicode_Equals(__pyx_v_converged, __pyx_mstate_global->__pyx_n_u_default, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(50, 1319, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/SNES.pyx":1320
 *             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, 1320, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":1321
 *         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, 1321, __pyx_L1_error)

    /* "petsc4py/PETSc/SNES.pyx":1319
 *             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":1323
 *             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, 1323, __pyx_L1_error)
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(50, 1323, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(50, 1323, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/SNES.pyx":1324
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/SNES.pyx":1325
 *             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, 1325, __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":1326
 *             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, <void*>context, NULL))
*/
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1326, __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) != (0)) __PYX_ERR(50, 1326, __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) != (0)) __PYX_ERR(50, 1326, __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) != (0)) __PYX_ERR(50, 1326, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":1327
 *             if kargs is None: kargs = {}
 *             context = (converged, args, kargs)
 *             self.set_attr('__converged__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(SNESSetConvergenceTest(self.snes, SNES_Converged, <void*>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, 1327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":1328
 *             context = (converged, args, kargs)
 *             self.set_attr('__converged__', context)
 *             CHKERR(SNESSetConvergenceTest(self.snes, SNES_Converged, <void*>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, 1328, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/SNES.pyx":1295
 *         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":1330
 *             CHKERR(SNESSetConvergenceTest(self.snes, SNES_Converged, <void*>context, NULL))
 * 
 *     def getConvergenceTest(self) -> SNESConvergedFunction:             # <<<<<<<<<<<<<<
 *         """Return the callback to used as convergence test.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_123getConvergenceTest(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_122getConvergenceTest, "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:1330");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_123getConvergenceTest = {"getConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_123getConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_122getConvergenceTest};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_123getConvergenceTest(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getConvergenceTest", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_122getConvergenceTest(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_122getConvergenceTest(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1340
 * 
 *         """
 *         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, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1330
 *             CHKERR(SNESSetConvergenceTest(self.snes, SNES_Converged, <void*>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":1342
 *         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_125callConvergenceTest(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_124callConvergenceTest, "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:1342");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_125callConvergenceTest = {"callConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_125callConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_124callConvergenceTest};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_125callConvergenceTest(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_its,&__pyx_mstate_global->__pyx_n_u_xnorm,&__pyx_mstate_global->__pyx_n_u_ynorm,&__pyx_mstate_global->__pyx_n_u_fnorm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1342, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 1342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 1342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "callConvergenceTest", 0) < (0)) __PYX_ERR(50, 1342, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("callConvergenceTest", 1, 4, 4, i); __PYX_ERR(50, 1342, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1342, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1342, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 1342, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 1342, __pyx_L3_error)
    }
    __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, 1342, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_124callConvergenceTest(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_its, __pyx_v_xnorm, __pyx_v_ynorm, __pyx_v_fnorm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_124callConvergenceTest(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1363
 * 
 *         """
 *         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, 1363, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":1364
 *         """
 *         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, 1364, __pyx_L1_error)
  __pyx_v_rval1 = __pyx_t_2;

  /* "petsc4py/PETSc/SNES.pyx":1365
 *         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, 1365, __pyx_L1_error)
  __pyx_v_rval2 = __pyx_t_2;

  /* "petsc4py/PETSc/SNES.pyx":1366
 *         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, 1366, __pyx_L1_error)
  __pyx_v_rval3 = __pyx_t_2;

  /* "petsc4py/PETSc/SNES.pyx":1367
 *         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":1368
 *         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, 1368, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1370
 *         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_PyLong_From_SNESConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1342
 *         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":1372
 *         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_127converged(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_126converged, "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:1372");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_127converged = {"converged", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_127converged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_126converged};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_127converged(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_its,&__pyx_mstate_global->__pyx_n_u_xnorm,&__pyx_mstate_global->__pyx_n_u_ynorm,&__pyx_mstate_global->__pyx_n_u_fnorm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1372, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 1372, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 1372, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1372, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1372, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "converged", 0) < (0)) __PYX_ERR(50, 1372, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("converged", 1, 4, 4, i); __PYX_ERR(50, 1372, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1372, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1372, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 1372, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 1372, __pyx_L3_error)
    }
    __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, 1372, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_126converged(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_its, __pyx_v_xnorm, __pyx_v_ynorm, __pyx_v_fnorm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_126converged(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1393
 * 
 *         """
 *         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, 1393, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":1394
 *         """
 *         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, 1394, __pyx_L1_error)
  __pyx_v_rval1 = __pyx_t_2;

  /* "petsc4py/PETSc/SNES.pyx":1395
 *         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, 1395, __pyx_L1_error)
  __pyx_v_rval2 = __pyx_t_2;

  /* "petsc4py/PETSc/SNES.pyx":1396
 *         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, 1396, __pyx_L1_error)
  __pyx_v_rval3 = __pyx_t_2;

  /* "petsc4py/PETSc/SNES.pyx":1397
 *         cdef PetscReal rval2 = asReal(ynorm)
 *         cdef PetscReal rval3 = asReal(fnorm)
 *         CHKERR(SNESConverged(self.snes, ival, rval1, rval2, rval3))             # <<<<<<<<<<<<<<
 * 
 *     def setConvergenceHistory(self, length=None, reset=False) -> None:
*/
  __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, 1397, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1372
 *         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":1399
 *         CHKERR(SNESConverged(self.snes, ival, rval1, rval2, rval3))
 * 
 *     def setConvergenceHistory(self, length=None, reset=False) -> None:             # <<<<<<<<<<<<<<
 *         """Set the convergence history.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_129setConvergenceHistory(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_128setConvergenceHistory, "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:1399");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_129setConvergenceHistory = {"setConvergenceHistory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_129setConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_128setConvergenceHistory};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_129setConvergenceHistory(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_length,&__pyx_mstate_global->__pyx_n_u_reset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1399, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1399, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1399, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setConvergenceHistory", 0) < (0)) __PYX_ERR(50, 1399, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1399, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1399, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __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, 1399, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_128setConvergenceHistory(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_length, __pyx_v_reset);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_128setConvergenceHistory(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1409
 * 
 *         """
 *         cdef PetscReal *rdata = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt  *idata = NULL
 *         cdef PetscInt   size = 1000
*/
  __pyx_v_rdata = NULL;

  /* "petsc4py/PETSc/SNES.pyx":1410
 *         """
 *         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":1411
 *         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":1412
 *         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":1414
 *         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":1415
 *         # 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, 1415, __pyx_L1_error)
    __pyx_v_size = __pyx_t_2;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/SNES.pyx":1416
 *         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":1417
 *         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, 1417, __pyx_L1_error)
  if (__pyx_t_1) {
    __pyx_v_flag = PETSC_TRUE;
  }

  /* "petsc4py/PETSc/SNES.pyx":1418
 *         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, 1418, __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, 1418, __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":1419
 *         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, 1419, __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, 1419, __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":1420
 *         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, 1420, __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) != (0)) __PYX_ERR(50, 1420, __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) != (0)) __PYX_ERR(50, 1420, __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, 1420, __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":1421
 *         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, 1421, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1399
 *         CHKERR(SNESConverged(self.snes, ival, rval1, rval2, rval3))
 * 
 *     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":1423
 *         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_131getConvergenceHistory(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_130getConvergenceHistory, "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:1423");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_131getConvergenceHistory = {"getConvergenceHistory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_131getConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_130getConvergenceHistory};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_131getConvergenceHistory(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getConvergenceHistory", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_130getConvergenceHistory(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_130getConvergenceHistory(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1433
 * 
 *         """
 *         cdef PetscReal *rdata = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt  *idata = NULL
 *         cdef PetscInt   size = 0
*/
  __pyx_v_rdata = NULL;

  /* "petsc4py/PETSc/SNES.pyx":1434
 *         """
 *         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":1435
 *         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":1436
 *         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, 1436, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1437
 *         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, 1437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_rhist = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1438
 *         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, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ihist = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1439
 *         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, 1439, __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) != (0)) __PYX_ERR(50, 1439, __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) != (0)) __PYX_ERR(50, 1439, __pyx_L1_error);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1423
 *         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":1441
 *         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_133logConvergenceHistory(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_132logConvergenceHistory, "SNES.logConvergenceHistory(self, norm: float, linear_its: int = 0) -> None\nLog residual norm and linear iterations.\nSource code at petsc4py/PETSc/SNES.pyx:1441");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_133logConvergenceHistory = {"logConvergenceHistory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_133logConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_132logConvergenceHistory};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_133logConvergenceHistory(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_norm,&__pyx_mstate_global->__pyx_n_u_linear_its,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1441, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1441, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1441, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "logConvergenceHistory", 0) < (0)) __PYX_ERR(50, 1441, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("logConvergenceHistory", 0, 1, 2, i); __PYX_ERR(50, 1441, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1441, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1441, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __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, 1441, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_132logConvergenceHistory(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_norm, __pyx_v_linear_its);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_132logConvergenceHistory(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1443
 *     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, 1443, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":1444
 *         """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, 1444, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_2;

  /* "petsc4py/PETSc/SNES.pyx":1445
 *         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, 1445, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1441
 *         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":1447
 *         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_135setResetCounters(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_134setResetCounters, "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:1447");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_135setResetCounters = {"setResetCounters", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_135setResetCounters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_134setResetCounters};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_135setResetCounters(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_reset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1447, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setResetCounters", 0) < (0)) __PYX_ERR(50, 1447, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_reset = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setResetCounters", 0, 0, 1, __pyx_nargs); __PYX_ERR(50, 1447, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_134setResetCounters(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_reset);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_134setResetCounters(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1457
 * 
 *         """
 *         cdef PetscBool flag = reset             # <<<<<<<<<<<<<<
 *         CHKERR(SNESSetCountersReset(self.snes, flag))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_reset); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(50, 1457, __pyx_L1_error)
  __pyx_v_flag = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":1458
 *         """
 *         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, 1458, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1447
 *         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":1462
 *     # --- monitoring ---
 * 
 *     def setMonitor(self,             # <<<<<<<<<<<<<<
 *                    monitor: SNESMonitorFunction | None,
 *                    args: tuple[Any, ...] | None = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_137setMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_136setMonitor, "SNES.setMonitor(self, monitor: SNESMonitorFunction | None, 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:1462");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_137setMonitor = {"setMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_137setMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_136setMonitor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_137setMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_monitor,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1462, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 1462, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1462, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1462, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMonitor", 0) < (0)) __PYX_ERR(50, 1462, __pyx_L3_error)

      /* "petsc4py/PETSc/SNES.pyx":1464
 *     def setMonitor(self,
 *                    monitor: SNESMonitorFunction | None,
 *                    args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                    kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback used to monitor solver convergence.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":1465
 *                    monitor: SNESMonitorFunction | None,
 *                    args: tuple[Any, ...] | None = None,
 *                    kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback used to monitor solver convergence.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMonitor", 0, 1, 3, i); __PYX_ERR(50, 1462, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 1462, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1462, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1462, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/SNES.pyx":1464
 *     def setMonitor(self,
 *                    monitor: SNESMonitorFunction | None,
 *                    args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                    kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback used to monitor solver convergence.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":1465
 *                    monitor: SNESMonitorFunction | None,
 *                    args: tuple[Any, ...] | None = None,
 *                    kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback used to monitor solver convergence.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1462, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_136setMonitor(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_monitor, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/SNES.pyx":1462
 *     # --- monitoring ---
 * 
 *     def setMonitor(self,             # <<<<<<<<<<<<<<
 *                    monitor: SNESMonitorFunction | None,
 *                    args: tuple[Any, ...] | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_136setMonitor(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":1484
 * 
 *         """
 *         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":1485
 *         """
 *         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, 1485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_monitorlist = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1486
 *         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":1487
 *         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, 1487, __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":1488
 *         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, 1488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":1489
 *             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, 1489, __pyx_L1_error)

    /* "petsc4py/PETSc/SNES.pyx":1486
 *         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":1490
 *             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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/SNES.pyx":1491
 *             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, 1491, __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":1492
 *         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, 1492, __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) != (0)) __PYX_ERR(50, 1492, __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) != (0)) __PYX_ERR(50, 1492, __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) != (0)) __PYX_ERR(50, 1492, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1493
 *         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, 1493, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1462
 *     # --- monitoring ---
 * 
 *     def setMonitor(self,             # <<<<<<<<<<<<<<
 *                    monitor: SNESMonitorFunction | None,
 *                    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.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":1495
 *         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_139getMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_138getMonitor, "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:1495");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_139getMonitor = {"getMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_139getMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_138getMonitor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_139getMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMonitor", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_138getMonitor(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_138getMonitor(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1505
 * 
 *         """
 *         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, 1505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1495
 *         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":1507
 *         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_141monitorCancel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_140monitorCancel, "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:1507");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_141monitorCancel = {"monitorCancel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_141monitorCancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_140monitorCancel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_141monitorCancel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("monitorCancel", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_140monitorCancel(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_140monitorCancel(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1517
 * 
 *         """
 *         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, 1517, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1518
 *         """
 *         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, 1518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1507
 *         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":1522
 *     cancelMonitor = monitorCancel
 * 
 *     def monitor(self, its, rnorm) -> None:             # <<<<<<<<<<<<<<
 *         """Monitor the solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_143monitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_142monitor, "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:1522");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_143monitor = {"monitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_143monitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_142monitor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_143monitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_its,&__pyx_mstate_global->__pyx_n_u_rnorm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1522, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1522, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1522, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "monitor", 0) < (0)) __PYX_ERR(50, 1522, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("monitor", 1, 2, 2, i); __PYX_ERR(50, 1522, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1522, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1522, __pyx_L3_error)
    }
    __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, 1522, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_142monitor(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_its, __pyx_v_rnorm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_142monitor(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1539
 * 
 *         """
 *         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, 1539, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":1540
 *         """
 *         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, 1540, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_2;

  /* "petsc4py/PETSc/SNES.pyx":1541
 *         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, 1541, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1522
 *     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":1545
 *     # --- 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_145setMaxFunctionEvaluations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_144setMaxFunctionEvaluations, "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:1545");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_145setMaxFunctionEvaluations = {"setMaxFunctionEvaluations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_145setMaxFunctionEvaluations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_144setMaxFunctionEvaluations};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_145setMaxFunctionEvaluations(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_max_funcs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1545, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1545, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMaxFunctionEvaluations", 0) < (0)) __PYX_ERR(50, 1545, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMaxFunctionEvaluations", 1, 1, 1, i); __PYX_ERR(50, 1545, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1545, __pyx_L3_error)
    }
    __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, 1545, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_144setMaxFunctionEvaluations(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_max_funcs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_144setMaxFunctionEvaluations(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1555
 * 
 *         """
 *         cdef PetscReal r = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         cdef PetscInt  i = PETSC_CURRENT
 *         cdef PetscInt ival = asInt(max_funcs)
*/
  __pyx_v_r = PETSC_CURRENT;

  /* "petsc4py/PETSc/SNES.pyx":1556
 *         """
 *         cdef PetscReal r = PETSC_CURRENT
 *         cdef PetscInt  i = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         cdef PetscInt ival = asInt(max_funcs)
 *         CHKERR(SNESSetTolerances(self.snes, r, r, r, i, ival))
*/
  __pyx_v_i = PETSC_CURRENT;

  /* "petsc4py/PETSc/SNES.pyx":1557
 *         cdef PetscReal r = PETSC_CURRENT
 *         cdef PetscInt  i = PETSC_CURRENT
 *         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, 1557, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":1558
 *         cdef PetscInt  i = PETSC_CURRENT
 *         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, 1558, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1545
 *     # --- 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":1560
 *         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_147getMaxFunctionEvaluations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_146getMaxFunctionEvaluations, "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:1560");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_147getMaxFunctionEvaluations = {"getMaxFunctionEvaluations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_147getMaxFunctionEvaluations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_146getMaxFunctionEvaluations};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_147getMaxFunctionEvaluations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMaxFunctionEvaluations", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_146getMaxFunctionEvaluations(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_146getMaxFunctionEvaluations(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1570
 * 
 *         """
 *         cdef PetscReal *r = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt  *i = NULL
 *         cdef PetscInt ival = 0
*/
  __pyx_v_r = NULL;

  /* "petsc4py/PETSc/SNES.pyx":1571
 *         """
 *         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":1572
 *         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":1573
 *         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, 1573, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1574
 *         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, 1574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1560
 *         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":1576
 *         return toInt(ival)
 * 
 *     def getFunctionEvaluations(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the current number of function evaluations.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_149getFunctionEvaluations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_148getFunctionEvaluations, "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:1576");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_149getFunctionEvaluations = {"getFunctionEvaluations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_149getFunctionEvaluations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_148getFunctionEvaluations};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_149getFunctionEvaluations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFunctionEvaluations", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_148getFunctionEvaluations(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_148getFunctionEvaluations(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1586
 * 
 *         """
 *         cdef PetscInt ival = 0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetNumberFunctionEvals(self.snes, &ival))
 *         return toInt(ival)
*/
  __pyx_v_ival = 0;

  /* "petsc4py/PETSc/SNES.pyx":1587
 *         """
 *         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, 1587, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1588
 *         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, 1588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1576
 *         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":1590
 *         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_151setMaxStepFailures(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_150setMaxStepFailures, "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:1590");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_151setMaxStepFailures = {"setMaxStepFailures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_151setMaxStepFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_150setMaxStepFailures};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_151setMaxStepFailures(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_max_fails,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1590, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1590, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMaxStepFailures", 0) < (0)) __PYX_ERR(50, 1590, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMaxStepFailures", 1, 1, 1, i); __PYX_ERR(50, 1590, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1590, __pyx_L3_error)
    }
    __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, 1590, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_150setMaxStepFailures(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_max_fails);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_150setMaxStepFailures(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1600
 * 
 *         """
 *         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, 1600, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":1601
 *         """
 *         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, 1601, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1590
 *         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":1603
 *         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_153getMaxStepFailures(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_152getMaxStepFailures, "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:1603");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_153getMaxStepFailures = {"getMaxStepFailures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_153getMaxStepFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_152getMaxStepFailures};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_153getMaxStepFailures(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMaxStepFailures", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_152getMaxStepFailures(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_152getMaxStepFailures(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1613
 * 
 *         """
 *         cdef PetscInt ival = 0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetMaxNonlinearStepFailures(self.snes, &ival))
 *         return toInt(ival)
*/
  __pyx_v_ival = 0;

  /* "petsc4py/PETSc/SNES.pyx":1614
 *         """
 *         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, 1614, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1615
 *         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, 1615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1603
 *         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":1617
 *         return toInt(ival)
 * 
 *     def getStepFailures(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the current number of step failures.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_155getStepFailures(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_154getStepFailures, "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:1617");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_155getStepFailures = {"getStepFailures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_155getStepFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_154getStepFailures};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_155getStepFailures(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getStepFailures", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_154getStepFailures(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_154getStepFailures(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1627
 * 
 *         """
 *         cdef PetscInt ival = 0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetNonlinearStepFailures(self.snes, &ival))
 *         return toInt(ival)
*/
  __pyx_v_ival = 0;

  /* "petsc4py/PETSc/SNES.pyx":1628
 *         """
 *         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, 1628, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1629
 *         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, 1629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1617
 *         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":1631
 *         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_157setMaxKSPFailures(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_156setMaxKSPFailures, "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:1631");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_157setMaxKSPFailures = {"setMaxKSPFailures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_157setMaxKSPFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_156setMaxKSPFailures};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_157setMaxKSPFailures(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_max_fails,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1631, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1631, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMaxKSPFailures", 0) < (0)) __PYX_ERR(50, 1631, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMaxKSPFailures", 1, 1, 1, i); __PYX_ERR(50, 1631, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1631, __pyx_L3_error)
    }
    __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, 1631, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_156setMaxKSPFailures(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_max_fails);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_156setMaxKSPFailures(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1641
 * 
 *         """
 *         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, 1641, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":1642
 *         """
 *         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, 1642, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1631
 *         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":1644
 *         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_159getMaxKSPFailures(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_158getMaxKSPFailures, "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:1644");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_159getMaxKSPFailures = {"getMaxKSPFailures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_159getMaxKSPFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_158getMaxKSPFailures};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_159getMaxKSPFailures(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMaxKSPFailures", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_158getMaxKSPFailures(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_158getMaxKSPFailures(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1654
 * 
 *         """
 *         cdef PetscInt ival = 0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetMaxLinearSolveFailures(self.snes, &ival))
 *         return toInt(ival)
*/
  __pyx_v_ival = 0;

  /* "petsc4py/PETSc/SNES.pyx":1655
 *         """
 *         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, 1655, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1656
 *         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, 1656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1644
 *         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":1658
 *         return toInt(ival)
 * 
 *     def getKSPFailures(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the current number of linear solve failures.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_161getKSPFailures(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_160getKSPFailures, "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:1658");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_161getKSPFailures = {"getKSPFailures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_161getKSPFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_160getKSPFailures};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_161getKSPFailures(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getKSPFailures", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_160getKSPFailures(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_160getKSPFailures(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1668
 * 
 *         """
 *         cdef PetscInt ival = 0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetLinearSolveFailures(self.snes, &ival))
 *         return toInt(ival)
*/
  __pyx_v_ival = 0;

  /* "petsc4py/PETSc/SNES.pyx":1669
 *         """
 *         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, 1669, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1670
 *         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, 1670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1658
 *         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":1681
 *     # --- solving ---
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_163setUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_162setUp, "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:1681");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_163setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_163setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_162setUp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_163setUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_162setUp(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_162setUp(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1691
 * 
 *         """
 *         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, 1691, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1681
 *     # --- 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":1693
 *         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_165setUpMatrices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_164setUpMatrices, "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:1693");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_165setUpMatrices = {"setUpMatrices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_165setUpMatrices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_164setUpMatrices};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_165setUpMatrices(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUpMatrices", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_164setUpMatrices(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_164setUpMatrices(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1705
 * 
 *         """
 *         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, 1705, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1693
 *         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":1707
 *         CHKERR(SNESSetUpMatrices(self.snes))
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         """Reset the solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_167reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_166reset, "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:1707");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_167reset = {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_167reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_166reset};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_167reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("reset", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_166reset(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_166reset(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1717
 * 
 *         """
 *         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, 1717, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1707
 *         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":1719
 *         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_169solve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_168solve, "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:1719");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_169solve = {"solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_169solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_168solve};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_169solve(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_b,&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1719, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1719, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1719, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "solve", 0) < (0)) __PYX_ERR(50, 1719, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 1719, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1719, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 1719, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "b", 0))) __PYX_ERR(50, 1719, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(50, 1719, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_168solve(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_b, __pyx_v_x);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_168solve(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1736
 * 
 *         """
 *         cdef PetscVec rhs = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscVec sol = NULL
 *         if b is not None: rhs = b.vec
*/
  __pyx_v_rhs = NULL;

  /* "petsc4py/PETSc/SNES.pyx":1737
 *         """
 *         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":1738
 *         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":1739
 *         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":1740
 *         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, 1740, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1719
 *         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":1742
 *         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_171setConvergedReason(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_170setConvergedReason, "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:1742");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_171setConvergedReason = {"setConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_171setConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_170setConvergedReason};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_171setConvergedReason(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_reason,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1742, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1742, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setConvergedReason", 0) < (0)) __PYX_ERR(50, 1742, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, i); __PYX_ERR(50, 1742, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1742, __pyx_L3_error)
    }
    __pyx_v_reason = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1742, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_170setConvergedReason(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_reason);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_170setConvergedReason(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1752
 * 
 *         """
 *         cdef PetscSNESConvergedReason eval = reason             # <<<<<<<<<<<<<<
 *         CHKERR(SNESSetConvergedReason(self.snes, eval))
 * 
*/
  __pyx_t_1 = ((SNESConvergedReason)__Pyx_PyLong_As_SNESConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 1752, __pyx_L1_error)
  __pyx_v_eval = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":1753
 *         """
 *         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, 1753, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1742
 *         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":1755
 *         CHKERR(SNESSetConvergedReason(self.snes, eval))
 * 
 *     def getConvergedReason(self) -> ConvergedReason:             # <<<<<<<<<<<<<<
 *         """Return the termination flag.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_173getConvergedReason(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_172getConvergedReason, "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:1755");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_173getConvergedReason = {"getConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_173getConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_172getConvergedReason};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_173getConvergedReason(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getConvergedReason", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_172getConvergedReason(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_172getConvergedReason(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1765
 * 
 *         """
 *         cdef PetscSNESConvergedReason reason = SNES_CONVERGED_ITERATING             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetConvergedReason(self.snes, &reason))
 *         return reason
*/
  __pyx_v_reason = SNES_CONVERGED_ITERATING;

  /* "petsc4py/PETSc/SNES.pyx":1766
 *         """
 *         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, 1766, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1767
 *         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_PyLong_From_SNESConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 1767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1755
 *         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":1769
 *         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_175setErrorIfNotConverged(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_174setErrorIfNotConverged, "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:1769");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_175setErrorIfNotConverged = {"setErrorIfNotConverged", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_175setErrorIfNotConverged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_174setErrorIfNotConverged};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_175setErrorIfNotConverged(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1769, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1769, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setErrorIfNotConverged", 0) < (0)) __PYX_ERR(50, 1769, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setErrorIfNotConverged", 1, 1, 1, i); __PYX_ERR(50, 1769, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1769, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setErrorIfNotConverged", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1769, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_174setErrorIfNotConverged(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_174setErrorIfNotConverged(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1779
 * 
 *         """
 *         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, 1779, __pyx_L1_error)
  __pyx_v_ernc = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":1780
 *         """
 *         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, 1780, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1769
 *         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":1782
 *         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_177getErrorIfNotConverged(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_176getErrorIfNotConverged, "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:1782");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_177getErrorIfNotConverged = {"getErrorIfNotConverged", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_177getErrorIfNotConverged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_176getErrorIfNotConverged};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_177getErrorIfNotConverged(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getErrorIfNotConverged", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_176getErrorIfNotConverged(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_176getErrorIfNotConverged(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1792
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetErrorIfNotConverged(self.snes, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/SNES.pyx":1793
 *         """
 *         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, 1793, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1794
 *         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, 1794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1782
 *         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":1796
 *         return toBool(flag)
 * 
 *     def setIterationNumber(self, its: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the current iteration number.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_179setIterationNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_178setIterationNumber, "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:1796");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_179setIterationNumber = {"setIterationNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_179setIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_178setIterationNumber};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_179setIterationNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_its,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1796, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1796, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setIterationNumber", 0) < (0)) __PYX_ERR(50, 1796, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setIterationNumber", 1, 1, 1, i); __PYX_ERR(50, 1796, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1796, __pyx_L3_error)
    }
    __pyx_v_its = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setIterationNumber", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1796, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_178setIterationNumber(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_its);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_178setIterationNumber(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1808
 * 
 *         """
 *         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, 1808, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":1809
 *         """
 *         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, 1809, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1796
 *         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":1811
 *         CHKERR(SNESSetIterationNumber(self.snes, ival))
 * 
 *     def getIterationNumber(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the current iteration number.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_181getIterationNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_180getIterationNumber, "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:1811");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_181getIterationNumber = {"getIterationNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_181getIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_180getIterationNumber};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_181getIterationNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getIterationNumber", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_180getIterationNumber(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_180getIterationNumber(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1821
 * 
 *         """
 *         cdef PetscInt ival = 0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetIterationNumber(self.snes, &ival))
 *         return toInt(ival)
*/
  __pyx_v_ival = 0;

  /* "petsc4py/PETSc/SNES.pyx":1822
 *         """
 *         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, 1822, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1823
 *         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, 1823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1811
 *         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":1825
 *         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_183setForceIteration(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_182setForceIteration, "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:1825");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_183setForceIteration = {"setForceIteration", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_183setForceIteration, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_182setForceIteration};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_183setForceIteration(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_force,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1825, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1825, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setForceIteration", 0) < (0)) __PYX_ERR(50, 1825, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setForceIteration", 1, 1, 1, i); __PYX_ERR(50, 1825, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1825, __pyx_L3_error)
    }
    __pyx_v_force = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setForceIteration", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1825, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_182setForceIteration(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_force);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_182setForceIteration(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1835
 * 
 *         """
 *         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, 1835, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":1836
 *         """
 *         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, 1836, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1825
 *         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":1838
 *         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_185setFunctionNorm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_184setFunctionNorm, "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:1838");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_185setFunctionNorm = {"setFunctionNorm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_185setFunctionNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_184setFunctionNorm};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_185setFunctionNorm(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_norm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1838, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1838, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFunctionNorm", 0) < (0)) __PYX_ERR(50, 1838, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFunctionNorm", 1, 1, 1, i); __PYX_ERR(50, 1838, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1838, __pyx_L3_error)
    }
    __pyx_v_norm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setFunctionNorm", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 1838, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_184setFunctionNorm(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_norm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_184setFunctionNorm(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1850
 * 
 *         """
 *         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, 1850, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":1851
 *         """
 *         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, 1851, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1838
 *         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":1853
 *         CHKERR(SNESSetFunctionNorm(self.snes, rval))
 * 
 *     def getFunctionNorm(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the function norm.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_187getFunctionNorm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_186getFunctionNorm, "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:1853");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_187getFunctionNorm = {"getFunctionNorm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_187getFunctionNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_186getFunctionNorm};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_187getFunctionNorm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFunctionNorm", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_186getFunctionNorm(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_186getFunctionNorm(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1863
 * 
 *         """
 *         cdef PetscReal rval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetFunctionNorm(self.snes, &rval))
 *         return toReal(rval)
*/
  __pyx_v_rval = 0.0;

  /* "petsc4py/PETSc/SNES.pyx":1864
 *         """
 *         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, 1864, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1865
 *         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, 1865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1853
 *         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":1867
 *         return toReal(rval)
 * 
 *     def getLinearSolveIterations(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the total number of linear iterations.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_189getLinearSolveIterations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_188getLinearSolveIterations, "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:1867");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_189getLinearSolveIterations = {"getLinearSolveIterations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_189getLinearSolveIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_188getLinearSolveIterations};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_189getLinearSolveIterations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLinearSolveIterations", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_188getLinearSolveIterations(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_188getLinearSolveIterations(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1877
 * 
 *         """
 *         cdef PetscInt ival = 0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetLinearSolveIterations(self.snes, &ival))
 *         return toInt(ival)
*/
  __pyx_v_ival = 0;

  /* "petsc4py/PETSc/SNES.pyx":1878
 *         """
 *         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, 1878, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1879
 *         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, 1879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1867
 *         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":1881
 *         return toInt(ival)
 * 
 *     def getRhs(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the vector holding the right-hand side.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_191getRhs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_190getRhs, "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:1881");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_191getRhs = {"getRhs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_191getRhs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_190getRhs};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_191getRhs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getRhs", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_190getRhs(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_190getRhs(struct PyPetscSNESObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_vec = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getRhs", 0);

  /* "petsc4py/PETSc/SNES.pyx":1891
 * 
 *         """
 *         cdef Vec vec = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetRhs(self.snes, &vec.vec))
 *         CHKERR(PetscINCREF(vec.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 1891, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1892
 *         """
 *         cdef Vec vec = Vec()
 *         CHKERR(SNESGetRhs(self.snes, &vec.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(vec.obj))
 *         return vec
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetRhs(__pyx_v_self->snes, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1892, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1893
 *         cdef Vec vec = Vec()
 *         CHKERR(SNESGetRhs(self.snes, &vec.vec))
 *         CHKERR(PetscINCREF(vec.obj))             # <<<<<<<<<<<<<<
 *         return vec
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1893, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1894
 *         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":1881
 *         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_XDECREF(__pyx_t_2);
  __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":1896
 *         return vec
 * 
 *     def getSolution(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the vector holding the solution.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_193getSolution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_192getSolution, "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:1896");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_193getSolution = {"getSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_193getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_192getSolution};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_193getSolution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSolution", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_192getSolution(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_192getSolution(struct PyPetscSNESObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_vec = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getSolution", 0);

  /* "petsc4py/PETSc/SNES.pyx":1906
 * 
 *         """
 *         cdef Vec vec = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetSolution(self.snes, &vec.vec))
 *         CHKERR(PetscINCREF(vec.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 1906, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1907
 *         """
 *         cdef Vec vec = Vec()
 *         CHKERR(SNESGetSolution(self.snes, &vec.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(vec.obj))
 *         return vec
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetSolution(__pyx_v_self->snes, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1907, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1908
 *         cdef Vec vec = Vec()
 *         CHKERR(SNESGetSolution(self.snes, &vec.vec))
 *         CHKERR(PetscINCREF(vec.obj))             # <<<<<<<<<<<<<<
 *         return vec
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1908, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1909
 *         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":1896
 *         return vec
 * 
 *     def getSolution(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the vector holding the solution.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":1911
 *         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_195setSolution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_194setSolution, "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:1911");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_195setSolution = {"setSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_195setSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_194setSolution};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_195setSolution(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1911, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1911, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSolution", 0) < (0)) __PYX_ERR(50, 1911, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSolution", 1, 1, 1, i); __PYX_ERR(50, 1911, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1911, __pyx_L3_error)
    }
    __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, 1911, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(50, 1911, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_194setSolution(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_vec);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_194setSolution(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1921
 * 
 *         """
 *         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, 1921, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1911
 *         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":1923
 *         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_197getSolutionUpdate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_196getSolutionUpdate, "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:1923");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_197getSolutionUpdate = {"getSolutionUpdate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_197getSolutionUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_196getSolutionUpdate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_197getSolutionUpdate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSolutionUpdate", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_196getSolutionUpdate(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_196getSolutionUpdate(struct PyPetscSNESObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_vec = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getSolutionUpdate", 0);

  /* "petsc4py/PETSc/SNES.pyx":1933
 * 
 *         """
 *         cdef Vec vec = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetSolutionUpdate(self.snes, &vec.vec))
 *         CHKERR(PetscINCREF(vec.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 1933, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1934
 *         """
 *         cdef Vec vec = Vec()
 *         CHKERR(SNESGetSolutionUpdate(self.snes, &vec.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(vec.obj))
 *         return vec
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetSolutionUpdate(__pyx_v_self->snes, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1934, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1935
 *         cdef Vec vec = Vec()
 *         CHKERR(SNESGetSolutionUpdate(self.snes, &vec.vec))
 *         CHKERR(PetscINCREF(vec.obj))             # <<<<<<<<<<<<<<
 *         return vec
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1935, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1936
 *         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":1923
 *         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_XDECREF(__pyx_t_2);
  __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":1940
 *     # --- 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_199setKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_198setKSP, "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:1940");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_199setKSP = {"setKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_199setKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_198setKSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_199setKSP(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ksp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1940, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1940, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setKSP", 0) < (0)) __PYX_ERR(50, 1940, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setKSP", 1, 1, 1, i); __PYX_ERR(50, 1940, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1940, __pyx_L3_error)
    }
    __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, 1940, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, 0, "ksp", 0))) __PYX_ERR(50, 1940, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_198setKSP(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_ksp);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_198setKSP(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1950
 * 
 *         """
 *         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, 1950, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1940
 *     # --- 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":1952
 *         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_201getKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_200getKSP, "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:1952");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_201getKSP = {"getKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_201getKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_200getKSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_201getKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getKSP", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_200getKSP(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_200getKSP(struct PyPetscSNESObject *__pyx_v_self) {
  struct PyPetscKSPObject *__pyx_v_ksp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getKSP", 0);

  /* "petsc4py/PETSc/SNES.pyx":1962
 * 
 *         """
 *         cdef KSP ksp = KSP()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetKSP(self.snes, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 1962, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1963
 *         """
 *         cdef KSP ksp = KSP()
 *         CHKERR(SNESGetKSP(self.snes, &ksp.ksp))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(ksp.obj))
 *         return ksp
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetKSP(__pyx_v_self->snes, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1963, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1964
 *         cdef KSP ksp = KSP()
 *         CHKERR(SNESGetKSP(self.snes, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))             # <<<<<<<<<<<<<<
 *         return ksp
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 1964, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1965
 *         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":1952
 *         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_XDECREF(__pyx_t_2);
  __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":1967
 *         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_203setUseEW(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_202setUseEW, "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:1967");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_203setUseEW = {"setUseEW", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_203setUseEW, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_202setUseEW};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_203setUseEW(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 1967, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        default:
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1967, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      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 (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kargs, values, used_pos_args, __pyx_kwds_len, "setUseEW", 1) < (0)) __PYX_ERR(50, 1967, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        default:
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 1967, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_202setUseEW(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_flag, __pyx_v_targs, __pyx_v_kargs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_DECREF(__pyx_v_targs);
  __Pyx_DECREF(__pyx_v_kargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_202setUseEW(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":1986
 * 
 *         """
 *         cdef PetscBool bval = flag             # <<<<<<<<<<<<<<
 *         CHKERR(SNESKSPSetUseEW(self.snes, bval))
 *         if targs or kargs: self.setParamsEW(*targs, **kargs)
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(50, 1986, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":1987
 *         """
 *         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, 1987, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":1988
 *         cdef PetscBool bval = flag
 *         CHKERR(SNESKSPSetUseEW(self.snes, bval))
 *         if targs or kargs: self.setParamsEW(*targs, **kargs)             # <<<<<<<<<<<<<<
 * 
 *     def getUseEW(self) -> bool:
*/
  {
    Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_v_targs);
    if (unlikely(((!CYTHON_ASSUME_SAFE_SIZE) && __pyx_temp < 0))) __PYX_ERR(50, 1988, __pyx_L1_error)
    __pyx_t_4 = (__pyx_temp != 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, 1988, __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_mstate_global->__pyx_n_u_setParamsEW); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1988, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyDict_Copy(__pyx_v_kargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(50, 1988, __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, 1988, __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":1967
 *         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":1990
 *         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_205getUseEW(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_204getUseEW, "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:1990");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_205getUseEW = {"getUseEW", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_205getUseEW, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_204getUseEW};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_205getUseEW(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getUseEW", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_204getUseEW(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_204getUseEW(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2000
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(SNESKSPGetUseEW(self.snes, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/SNES.pyx":2001
 *         """
 *         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, 2001, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2002
 *         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, 2002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":1990
 *         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":2004
 *         return toBool(flag)
 * 
 *     def setParamsEW(self,             # <<<<<<<<<<<<<<
 *                     version: int | None = None,
 *                     rtol_0: float | None = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_207setParamsEW(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_206setParamsEW, "SNES.setParamsEW(self, version: int | None = None, rtol_0: float | None = None, rtol_max: float | None = None, gamma: float | None = None, alpha: float | None = None, alpha2: float | None = None, threshold: float | None = 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 `CURRENT`.\n        rtol_0\n            The initial relative residual norm. Defaults to `CURRENT`.\n        rtol_max\n            The maximum relative residual norm. Defaults to `CURRENT`.\n        gamma\n            Parameter. Defaults to `CURRENT`.\n        alpha\n            Parameter. Defaults to `CURRENT`.\n        alpha2\n            Parameter. Defaults to `CURRENT`.\n        threshold\n            Parameter. Defaults to `CURRENT`.\n\n        See Also\n        --------\n        setUseEW, getParamsEW, petsc.SNESKSPSetParametersEW\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2004");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_207setParamsEW = {"setParamsEW", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_207setParamsEW, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_206setParamsEW};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_207setParamsEW(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_version,&__pyx_mstate_global->__pyx_n_u_rtol_0,&__pyx_mstate_global->__pyx_n_u_rtol_max,&__pyx_mstate_global->__pyx_n_u_gamma,&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_alpha2,&__pyx_mstate_global->__pyx_n_u_threshold,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2004, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(50, 2004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(50, 2004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(50, 2004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 2004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 2004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setParamsEW", 0) < (0)) __PYX_ERR(50, 2004, __pyx_L3_error)

      /* "petsc4py/PETSc/SNES.pyx":2005
 * 
 *     def setParamsEW(self,
 *                     version: int | None = None,             # <<<<<<<<<<<<<<
 *                     rtol_0: float | None = None,
 *                     rtol_max: float | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":2006
 *     def setParamsEW(self,
 *                     version: int | None = None,
 *                     rtol_0: float | None = None,             # <<<<<<<<<<<<<<
 *                     rtol_max: float | None = None,
 *                     gamma: float | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":2007
 *                     version: int | None = None,
 *                     rtol_0: float | None = None,
 *                     rtol_max: float | None = None,             # <<<<<<<<<<<<<<
 *                     gamma: float | None = None,
 *                     alpha: float | None = None,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":2008
 *                     rtol_0: float | None = None,
 *                     rtol_max: float | None = None,
 *                     gamma: float | None = None,             # <<<<<<<<<<<<<<
 *                     alpha: float | None = None,
 *                     alpha2: float | None = None,
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":2009
 *                     rtol_max: float | None = None,
 *                     gamma: float | None = None,
 *                     alpha: float | None = None,             # <<<<<<<<<<<<<<
 *                     alpha2: float | None = None,
 *                     threshold: float | None = None) -> None:
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":2010
 *                     gamma: float | None = None,
 *                     alpha: float | None = None,
 *                     alpha2: float | None = None,             # <<<<<<<<<<<<<<
 *                     threshold: float | None = None) -> None:
 *         """Set the parameters for the Eisenstat and Walker trick.
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":2011
 *                     alpha: float | None = None,
 *                     alpha2: float | None = None,
 *                     threshold: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the parameters for the Eisenstat and Walker trick.
 * 
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(50, 2004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(50, 2004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(50, 2004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 2004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 2004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/SNES.pyx":2005
 * 
 *     def setParamsEW(self,
 *                     version: int | None = None,             # <<<<<<<<<<<<<<
 *                     rtol_0: float | None = None,
 *                     rtol_max: float | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":2006
 *     def setParamsEW(self,
 *                     version: int | None = None,
 *                     rtol_0: float | None = None,             # <<<<<<<<<<<<<<
 *                     rtol_max: float | None = None,
 *                     gamma: float | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":2007
 *                     version: int | None = None,
 *                     rtol_0: float | None = None,
 *                     rtol_max: float | None = None,             # <<<<<<<<<<<<<<
 *                     gamma: float | None = None,
 *                     alpha: float | None = None,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":2008
 *                     rtol_0: float | None = None,
 *                     rtol_max: float | None = None,
 *                     gamma: float | None = None,             # <<<<<<<<<<<<<<
 *                     alpha: float | None = None,
 *                     alpha2: float | None = None,
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":2009
 *                     rtol_max: float | None = None,
 *                     gamma: float | None = None,
 *                     alpha: float | None = None,             # <<<<<<<<<<<<<<
 *                     alpha2: float | None = None,
 *                     threshold: float | None = None) -> None:
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":2010
 *                     gamma: float | None = None,
 *                     alpha: float | None = None,
 *                     alpha2: float | None = None,             # <<<<<<<<<<<<<<
 *                     threshold: float | None = None) -> None:
 *         """Set the parameters for the Eisenstat and Walker trick.
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":2011
 *                     alpha: float | None = None,
 *                     alpha2: float | None = None,
 *                     threshold: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the parameters for the Eisenstat and Walker trick.
 * 
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2004, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_206setParamsEW(((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":2004
 *         return toBool(flag)
 * 
 *     def setParamsEW(self,             # <<<<<<<<<<<<<<
 *                     version: int | None = None,
 *                     rtol_0: float | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_206setParamsEW(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2038
 * 
 *         """
 *         cdef PetscInt  cversion   = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         cdef PetscReal crtol_0    = PETSC_CURRENT
 *         cdef PetscReal crtol_max  = PETSC_CURRENT
*/
  __pyx_v_cversion = PETSC_CURRENT;

  /* "petsc4py/PETSc/SNES.pyx":2039
 *         """
 *         cdef PetscInt  cversion   = PETSC_CURRENT
 *         cdef PetscReal crtol_0    = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         cdef PetscReal crtol_max  = PETSC_CURRENT
 *         cdef PetscReal cgamma     = PETSC_CURRENT
*/
  __pyx_v_crtol_0 = PETSC_CURRENT;

  /* "petsc4py/PETSc/SNES.pyx":2040
 *         cdef PetscInt  cversion   = PETSC_CURRENT
 *         cdef PetscReal crtol_0    = PETSC_CURRENT
 *         cdef PetscReal crtol_max  = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         cdef PetscReal cgamma     = PETSC_CURRENT
 *         cdef PetscReal calpha     = PETSC_CURRENT
*/
  __pyx_v_crtol_max = PETSC_CURRENT;

  /* "petsc4py/PETSc/SNES.pyx":2041
 *         cdef PetscReal crtol_0    = PETSC_CURRENT
 *         cdef PetscReal crtol_max  = PETSC_CURRENT
 *         cdef PetscReal cgamma     = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         cdef PetscReal calpha     = PETSC_CURRENT
 *         cdef PetscReal calpha2    = PETSC_CURRENT
*/
  __pyx_v_cgamma = PETSC_CURRENT;

  /* "petsc4py/PETSc/SNES.pyx":2042
 *         cdef PetscReal crtol_max  = PETSC_CURRENT
 *         cdef PetscReal cgamma     = PETSC_CURRENT
 *         cdef PetscReal calpha     = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         cdef PetscReal calpha2    = PETSC_CURRENT
 *         cdef PetscReal cthreshold = PETSC_CURRENT
*/
  __pyx_v_calpha = PETSC_CURRENT;

  /* "petsc4py/PETSc/SNES.pyx":2043
 *         cdef PetscReal cgamma     = PETSC_CURRENT
 *         cdef PetscReal calpha     = PETSC_CURRENT
 *         cdef PetscReal calpha2    = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         cdef PetscReal cthreshold = PETSC_CURRENT
 *         if version   is not None: cversion   = asInt(version)
*/
  __pyx_v_calpha2 = PETSC_CURRENT;

  /* "petsc4py/PETSc/SNES.pyx":2044
 *         cdef PetscReal calpha     = PETSC_CURRENT
 *         cdef PetscReal calpha2    = PETSC_CURRENT
 *         cdef PetscReal cthreshold = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         if version   is not None: cversion   = asInt(version)
 *         if rtol_0    is not None: crtol_0    = asReal(rtol_0)
*/
  __pyx_v_cthreshold = PETSC_CURRENT;

  /* "petsc4py/PETSc/SNES.pyx":2045
 *         cdef PetscReal calpha2    = PETSC_CURRENT
 *         cdef PetscReal cthreshold = PETSC_CURRENT
 *         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, 2045, __pyx_L1_error)
    __pyx_v_cversion = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":2046
 *         cdef PetscReal cthreshold = PETSC_CURRENT
 *         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, 2046, __pyx_L1_error)
    __pyx_v_crtol_0 = __pyx_t_3;
  }

  /* "petsc4py/PETSc/SNES.pyx":2047
 *         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, 2047, __pyx_L1_error)
    __pyx_v_crtol_max = __pyx_t_3;
  }

  /* "petsc4py/PETSc/SNES.pyx":2048
 *         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, 2048, __pyx_L1_error)
    __pyx_v_cgamma = __pyx_t_3;
  }

  /* "petsc4py/PETSc/SNES.pyx":2049
 *         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, 2049, __pyx_L1_error)
    __pyx_v_calpha = __pyx_t_3;
  }

  /* "petsc4py/PETSc/SNES.pyx":2050
 *         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, 2050, __pyx_L1_error)
    __pyx_v_calpha2 = __pyx_t_3;
  }

  /* "petsc4py/PETSc/SNES.pyx":2051
 *         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, 2051, __pyx_L1_error)
    __pyx_v_cthreshold = __pyx_t_3;
  }

  /* "petsc4py/PETSc/SNES.pyx":2052
 *         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, 2052, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2004
 *         return toBool(flag)
 * 
 *     def setParamsEW(self,             # <<<<<<<<<<<<<<
 *                     version: int | None = None,
 *                     rtol_0: float | None = 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":2056
 *             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_209getParamsEW(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_208getParamsEW, "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:2056");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_209getParamsEW = {"getParamsEW", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_209getParamsEW, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_208getParamsEW};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_209getParamsEW(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getParamsEW", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_208getParamsEW(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_208getParamsEW(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2066
 * 
 *         """
 *         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":2067
 *         """
 *         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":2068
 *         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":2069
 *         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":2070
 *         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, 2070, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2073
 *             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, 2073, __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, 2073, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_version, __pyx_t_3) < (0)) __PYX_ERR(50, 2073, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2074
 *             &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, 2074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_rtol_0, __pyx_t_3) < (0)) __PYX_ERR(50, 2073, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2075
 *         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, 2075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_rtol_max, __pyx_t_3) < (0)) __PYX_ERR(50, 2073, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2076
 *                 '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, 2076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_gamma, __pyx_t_3) < (0)) __PYX_ERR(50, 2073, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2077
 *                 '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, 2077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_t_3) < (0)) __PYX_ERR(50, 2073, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2078
 *                 '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, 2078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_alpha2, __pyx_t_3) < (0)) __PYX_ERR(50, 2073, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2079
 *                 'alpha'     : toReal(alpha),
 *                 'alpha2'    : toReal(alpha2),
 *                 'threshold' : toReal(threshold), }             # <<<<<<<<<<<<<<
 * 
 *     def setUseKSP(self, flag=True) -> None:
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_threshold); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 2079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_threshold, __pyx_t_3) < (0)) __PYX_ERR(50, 2073, __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":2056
 *             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":2081
 *                 'threshold' : toReal(threshold), }
 * 
 *     def setUseKSP(self, flag=True) -> None:             # <<<<<<<<<<<<<<
 *         """Set the boolean flag indicating to use a linear solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_211setUseKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_210setUseKSP, "SNES.setUseKSP(self, flag=True) -> None\nSet the boolean flag indicating to use a linear solver.\n\n        Logically collective.\n\n        See Also\n        --------\n        getUseKSP\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2081");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_211setUseKSP = {"setUseKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_211setUseKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_210setUseKSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_211setUseKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("setUseKSP (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2081, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2081, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setUseKSP", 0) < (0)) __PYX_ERR(50, 2081, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2081, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setUseKSP", 0, 0, 1, __pyx_nargs); __PYX_ERR(50, 2081, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUseKSP", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_210setUseKSP(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_210setUseKSP(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("setUseKSP", 0);

  /* "petsc4py/PETSc/SNES.pyx":2091
 * 
 *         """
 *         cdef PetscBool bval = flag             # <<<<<<<<<<<<<<
 *         CHKERR(SNESSetUseKSP(self.snes, bval))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(50, 2091, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":2092
 *         """
 *         cdef PetscBool bval = flag
 *         CHKERR(SNESSetUseKSP(self.snes, bval))             # <<<<<<<<<<<<<<
 * 
 *     def getUseKSP(self) -> bool:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetUseKSP(__pyx_v_self->snes, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2092, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2081
 *                 'threshold' : toReal(threshold), }
 * 
 *     def setUseKSP(self, flag=True) -> None:             # <<<<<<<<<<<<<<
 *         """Set the boolean flag indicating to use a linear solver.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.setUseKSP", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":2094
 *         CHKERR(SNESSetUseKSP(self.snes, bval))
 * 
 *     def getUseKSP(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag indicating if the solver uses a linear solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_213getUseKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_212getUseKSP, "SNES.getUseKSP(self) -> bool\nReturn the flag indicating if the solver uses a linear solver.\n\n        Not collective.\n\n        See Also\n        --------\n        setUseKSP\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2094");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_213getUseKSP = {"getUseKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_213getUseKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_212getUseKSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_213getUseKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getUseKSP (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getUseKSP", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getUseKSP", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_212getUseKSP(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_212getUseKSP(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("getUseKSP", 0);

  /* "petsc4py/PETSc/SNES.pyx":2104
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetUseKSP(self.snes, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/SNES.pyx":2105
 *         """
 *         cdef PetscBool flag = PETSC_FALSE
 *         CHKERR(SNESGetUseKSP(self.snes, &flag))             # <<<<<<<<<<<<<<
 *         return toBool(flag)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetUseKSP(__pyx_v_self->snes, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2105, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2106
 *         cdef PetscBool flag = PETSC_FALSE
 *         CHKERR(SNESGetUseKSP(self.snes, &flag))
 *         return toBool(flag)             # <<<<<<<<<<<<<<
 * 
 *     # --- matrix-free / finite differences ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2094
 *         CHKERR(SNESSetUseKSP(self.snes, bval))
 * 
 *     def getUseKSP(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag indicating if the solver uses a linear solver.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.getUseKSP", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":2110
 *     # --- 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_215setUseMF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_214setUseMF, "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:2110");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_215setUseMF = {"setUseMF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_215setUseMF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_214setUseMF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_215setUseMF(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2110, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2110, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setUseMF", 0) < (0)) __PYX_ERR(50, 2110, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2110, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setUseMF", 0, 0, 1, __pyx_nargs); __PYX_ERR(50, 2110, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_214setUseMF(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_214setUseMF(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2120
 * 
 *         """
 *         cdef PetscBool bval = flag             # <<<<<<<<<<<<<<
 *         CHKERR(SNESSetUseMFFD(self.snes, bval))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(50, 2120, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":2121
 *         """
 *         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, 2121, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2110
 *     # --- 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":2123
 *         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_217getUseMF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_216getUseMF, "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:2123");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_217getUseMF = {"getUseMF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_217getUseMF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_216getUseMF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_217getUseMF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getUseMF", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_216getUseMF(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_216getUseMF(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2133
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetUseMFFD(self.snes, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/SNES.pyx":2134
 *         """
 *         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, 2134, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2135
 *         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, 2135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2123
 *         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":2137
 *         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_219setUseFD(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_218setUseFD, "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:2137");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_219setUseFD = {"setUseFD", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_219setUseFD, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_218setUseFD};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_219setUseFD(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2137, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setUseFD", 0) < (0)) __PYX_ERR(50, 2137, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setUseFD", 0, 0, 1, __pyx_nargs); __PYX_ERR(50, 2137, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_218setUseFD(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_218setUseFD(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2147
 * 
 *         """
 *         cdef PetscBool bval = flag             # <<<<<<<<<<<<<<
 *         CHKERR(SNESSetUseFDColoring(self.snes, bval))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(50, 2147, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":2148
 *         """
 *         cdef PetscBool bval = flag
 *         CHKERR(SNESSetUseFDColoring(self.snes, bval))             # <<<<<<<<<<<<<<
 * 
 *     def getUseFD(self) -> bool:
*/
  __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, 2148, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2137
 *         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":2150
 *         CHKERR(SNESSetUseFDColoring(self.snes, bval))
 * 
 *     def getUseFD(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return ``true`` if the solver uses color finite-differencing for the Jacobian.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_221getUseFD(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_220getUseFD, "SNES.getUseFD(self) -> bool\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:2150");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_221getUseFD = {"getUseFD", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_221getUseFD, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_220getUseFD};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_221getUseFD(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getUseFD", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_220getUseFD(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_220getUseFD(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2160
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetUseFDColoring(self.snes, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/SNES.pyx":2161
 *         """
 *         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, 2161, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2162
 *         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, 2162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2150
 *         CHKERR(SNESSetUseFDColoring(self.snes, bval))
 * 
 *     def getUseFD(self) -> bool:             # <<<<<<<<<<<<<<
 *         """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":2166
 *     # --- 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_223setVariableBounds(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_222setVariableBounds, "SNES.setVariableBounds(self, xl: Vec, xu: Vec) -> None\nSet the vector for the variable bounds.\n\n        Collective.\n\n        See Also\n        --------\n        getVariableBounds, petsc.SNESVISetVariableBounds\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2166");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_223setVariableBounds = {"setVariableBounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_223setVariableBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_222setVariableBounds};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_223setVariableBounds(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_xl,&__pyx_mstate_global->__pyx_n_u_xu,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2166, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2166, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setVariableBounds", 0) < (0)) __PYX_ERR(50, 2166, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setVariableBounds", 1, 2, 2, i); __PYX_ERR(50, 2166, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2166, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2166, __pyx_L3_error)
    }
    __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, 2166, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xl", 0))) __PYX_ERR(50, 2166, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xu), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xu", 0))) __PYX_ERR(50, 2166, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_222setVariableBounds(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_xl, __pyx_v_xu);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_222setVariableBounds(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2176
 * 
 *         """
 *         CHKERR(SNESVISetVariableBounds(self.snes, xl.vec, xu.vec))             # <<<<<<<<<<<<<<
 * 
 *     def getVariableBounds(self) -> tuple[Vec, Vec]:
*/
  __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, 2176, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2166
 *     # --- 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":2178
 *         CHKERR(SNESVISetVariableBounds(self.snes, xl.vec, xu.vec))
 * 
 *     def getVariableBounds(self) -> tuple[Vec, Vec]:             # <<<<<<<<<<<<<<
 *         """Get the vectors for the variable bounds.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_225getVariableBounds(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_224getVariableBounds, "SNES.getVariableBounds(self) -> tuple[Vec, Vec]\nGet the vectors for the variable bounds.\n\n        Collective.\n\n        See Also\n        --------\n        setVariableBounds, petsc.SNESVIGetVariableBounds\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2178");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_225getVariableBounds = {"getVariableBounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_225getVariableBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_224getVariableBounds};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_225getVariableBounds(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getVariableBounds", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_224getVariableBounds(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_224getVariableBounds(struct PyPetscSNESObject *__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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getVariableBounds", 0);

  /* "petsc4py/PETSc/SNES.pyx":2188
 * 
 *         """
 *         cdef Vec xl = Vec(), xu = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESVIGetVariableBounds(self.snes, &xl.vec, &xu.vec))
 *         CHKERR(PetscINCREF(xl.obj)); CHKERR(PetscINCREF(xu.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2188, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_xl = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2188, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_xu = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2189
 *         """
 *         cdef Vec xl = Vec(), xu = Vec()
 *         CHKERR(SNESVIGetVariableBounds(self.snes, &xl.vec, &xu.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(xl.obj)); CHKERR(PetscINCREF(xu.obj))
 *         return (xl, xu)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESVIGetVariableBounds(__pyx_v_self->snes, (&__pyx_v_xl->vec), (&__pyx_v_xu->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2189, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2190
 *         cdef Vec xl = Vec(), xu = Vec()
 *         CHKERR(SNESVIGetVariableBounds(self.snes, &xl.vec, &xu.vec))
 *         CHKERR(PetscINCREF(xl.obj)); CHKERR(PetscINCREF(xu.obj))             # <<<<<<<<<<<<<<
 *         return (xl, xu)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_xl->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2190, __pyx_L1_error)
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_xu->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2190, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2191
 *         CHKERR(SNESVIGetVariableBounds(self.snes, &xl.vec, &xu.vec))
 *         CHKERR(PetscINCREF(xl.obj)); CHKERR(PetscINCREF(xu.obj))
 *         return (xl, xu)             # <<<<<<<<<<<<<<
 * 
 *     def getVIInactiveSet(self) -> IS:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2191, __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)) != (0)) __PYX_ERR(50, 2191, __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)) != (0)) __PYX_ERR(50, 2191, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2178
 *         CHKERR(SNESVISetVariableBounds(self.snes, xl.vec, xu.vec))
 * 
 *     def getVariableBounds(self) -> tuple[Vec, Vec]:             # <<<<<<<<<<<<<<
 *         """Get the vectors for the variable bounds.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.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/SNES.pyx":2193
 *         return (xl, xu)
 * 
 *     def getVIInactiveSet(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the index set for the inactive set.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_227getVIInactiveSet(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_226getVIInactiveSet, "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:2193");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_227getVIInactiveSet = {"getVIInactiveSet", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_227getVIInactiveSet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_226getVIInactiveSet};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_227getVIInactiveSet(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getVIInactiveSet", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_226getVIInactiveSet(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_226getVIInactiveSet(struct PyPetscSNESObject *__pyx_v_self) {
  struct PyPetscISObject *__pyx_v_inact = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getVIInactiveSet", 0);

  /* "petsc4py/PETSc/SNES.pyx":2203
 * 
 *         """
 *         cdef IS inact = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESVIGetInactiveSet(self.snes, &inact.iset))
 *         CHKERR(PetscINCREF(inact.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2203, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_inact = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2204
 *         """
 *         cdef IS inact = IS()
 *         CHKERR(SNESVIGetInactiveSet(self.snes, &inact.iset))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(inact.obj))
 *         return inact
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESVIGetInactiveSet(__pyx_v_self->snes, (&__pyx_v_inact->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2204, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2205
 *         cdef IS inact = IS()
 *         CHKERR(SNESVIGetInactiveSet(self.snes, &inact.iset))
 *         CHKERR(PetscINCREF(inact.obj))             # <<<<<<<<<<<<<<
 *         return inact
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_inact->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2205, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2206
 *         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":2193
 *         return (xl, xu)
 * 
 *     def getVIInactiveSet(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the index set for the inactive set.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2210
 *     # --- 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_229createPython(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_228createPython, "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:2210");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_229createPython = {"createPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_229createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_228createPython};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_229createPython(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_context,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2210, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2210, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2210, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createPython", 0) < (0)) __PYX_ERR(50, 2210, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2210, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2210, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2210, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_228createPython(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_context, __pyx_v_comm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_228createPython(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2227
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(50, 2227, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":2228
 *         """
 *         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":2229
 *         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, 2229, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2230
 *         cdef PetscSNES newsnes = NULL
 *         CHKERR(SNESCreate(ccomm, &newsnes))
 *         CHKERR(PetscCLEAR(self.obj)); self.snes = newsnes             # <<<<<<<<<<<<<<
 *         CHKERR(SNESSetType(self.snes, SNESPYTHON))
 *         CHKERR(SNESPythonSetContext(self.snes, <void*>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, 2230, __pyx_L1_error)
  __pyx_v_self->snes = __pyx_v_newsnes;

  /* "petsc4py/PETSc/SNES.pyx":2231
 *         CHKERR(SNESCreate(ccomm, &newsnes))
 *         CHKERR(PetscCLEAR(self.obj)); self.snes = newsnes
 *         CHKERR(SNESSetType(self.snes, SNESPYTHON))             # <<<<<<<<<<<<<<
 *         CHKERR(SNESPythonSetContext(self.snes, <void*>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, 2231, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2232
 *         CHKERR(PetscCLEAR(self.obj)); self.snes = newsnes
 *         CHKERR(SNESSetType(self.snes, SNESPYTHON))
 *         CHKERR(SNESPythonSetContext(self.snes, <void*>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, 2232, __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, 2232, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2233
 *         CHKERR(SNESSetType(self.snes, SNESPYTHON))
 *         CHKERR(SNESPythonSetContext(self.snes, <void*>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":2210
 *     # --- 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":2235
 *         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_231setPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_230setPythonContext, "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:2235");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_231setPythonContext = {"setPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_231setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_230setPythonContext};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_231setPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_context,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2235, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPythonContext", 0) < (0)) __PYX_ERR(50, 2235, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, i); __PYX_ERR(50, 2235, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2235, __pyx_L3_error)
    }
    __pyx_v_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 2235, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_230setPythonContext(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_context);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_230setPythonContext(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2245
 * 
 *         """
 *         CHKERR(SNESPythonSetContext(self.snes, <void*>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, 2245, __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, 2245, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2235
 *         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":2247
 *         CHKERR(SNESPythonSetContext(self.snes, <void*>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_233getPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_232getPythonContext, "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:2247");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_233getPythonContext = {"getPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_233getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_232getPythonContext};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_233getPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPythonContext", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_232getPythonContext(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_232getPythonContext(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2257
 * 
 *         """
 *         cdef void *context = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(SNESPythonGetContext(self.snes, &context))
 *         if context == NULL: return None
*/
  __pyx_v_context = NULL;

  /* "petsc4py/PETSc/SNES.pyx":2258
 *         """
 *         cdef void *context = NULL
 *         CHKERR(SNESPythonGetContext(self.snes, &context))             # <<<<<<<<<<<<<<
 *         if context == NULL: return None
 *         else: return <object> context
*/
  __pyx_t_1 = SNESPythonGetContext(__pyx_v_self->snes, (&__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2258, __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, 2258, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2259
 *         cdef void *context = NULL
 *         CHKERR(SNESPythonGetContext(self.snes, &context))
 *         if context == NULL: return None             # <<<<<<<<<<<<<<
 *         else: return <object> 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":2260
 *         CHKERR(SNESPythonGetContext(self.snes, &context))
 *         if context == NULL: return None
 *         else: return <object> 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":2247
 *         CHKERR(SNESPythonSetContext(self.snes, <void*>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":2262
 *         else: return <object> 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_235setPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_234setPythonType, "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:2262");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_235setPythonType = {"setPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_235setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_234setPythonType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_235setPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_py_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2262, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2262, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPythonType", 0) < (0)) __PYX_ERR(50, 2262, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, i); __PYX_ERR(50, 2262, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2262, __pyx_L3_error)
    }
    __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, 2262, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_234setPythonType(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_py_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_234setPythonType(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":2273
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         py_type = str2bytes(py_type, &cval)
 *         CHKERR(SNESPythonSetType(self.snes, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/SNES.pyx":2274
 *         """
 *         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, 2274, __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":2275
 *         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, 2275, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2262
 *         else: return <object> 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":2277
 *         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_237getPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_236getPythonType, "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:2277");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_237getPythonType = {"getPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_237getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_236getPythonType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_237getPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPythonType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_236getPythonType(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_236getPythonType(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2288
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(SNESPythonGetType(self.snes, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/SNES.pyx":2289
 *         """
 *         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, 2289, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2290
 *         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, 2290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2277
 *         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":2294
 *     # --- Composite ---
 * 
 *     def getCompositeSNES(self, int n) -> SNES:             # <<<<<<<<<<<<<<
 *         """Return the n-th solver in the composite.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_239getCompositeSNES(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_238getCompositeSNES, "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:2294");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_239getCompositeSNES = {"getCompositeSNES", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_239getCompositeSNES, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_238getCompositeSNES};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_239getCompositeSNES(PyObject *__pyx_v_self, 
#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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2294, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2294, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getCompositeSNES", 0) < (0)) __PYX_ERR(50, 2294, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getCompositeSNES", 1, 1, 1, i); __PYX_ERR(50, 2294, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2294, __pyx_L3_error)
    }
    __pyx_v_n = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(50, 2294, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getCompositeSNES", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 2294, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_238getCompositeSNES(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_n);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_238getCompositeSNES(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __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("getCompositeSNES", 0);

  /* "petsc4py/PETSc/SNES.pyx":2305
 *         """
 *         cdef PetscInt cn
 *         cdef SNES snes = SNES()             # <<<<<<<<<<<<<<
 *         cn = asInt(n)
 *         CHKERR(SNESCompositeGetSNES(self.snes, cn, &snes.snes))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2305, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_snes = ((struct PyPetscSNESObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2306
 *         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_PyLong_From_int(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_1); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 2306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cn = __pyx_t_4;

  /* "petsc4py/PETSc/SNES.pyx":2307
 *         cdef SNES snes = SNES()
 *         cn = asInt(n)
 *         CHKERR(SNESCompositeGetSNES(self.snes, cn, &snes.snes))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(snes.obj))
 *         return snes
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESCompositeGetSNES(__pyx_v_self->snes, __pyx_v_cn, (&__pyx_v_snes->snes))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2307, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2308
 *         cn = asInt(n)
 *         CHKERR(SNESCompositeGetSNES(self.snes, cn, &snes.snes))
 *         CHKERR(PetscINCREF(snes.obj))             # <<<<<<<<<<<<<<
 *         return snes
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_snes->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2308, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2309
 *         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":2294
 *     # --- 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_XDECREF(__pyx_t_2);
  __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":2311
 *         return snes
 * 
 *     def getCompositeNumber(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of solvers in the composite.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_241getCompositeNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_240getCompositeNumber, "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:2311");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_241getCompositeNumber = {"getCompositeNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_241getCompositeNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_240getCompositeNumber};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_241getCompositeNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCompositeNumber", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_240getCompositeNumber(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_240getCompositeNumber(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2321
 * 
 *         """
 *         cdef PetscInt cn = 0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESCompositeGetNumber(self.snes, &cn))
 *         return toInt(cn)
*/
  __pyx_v_cn = 0;

  /* "petsc4py/PETSc/SNES.pyx":2322
 *         """
 *         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, 2322, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2323
 *         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, 2323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2311
 *         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":2327
 *     # --- NASM ---
 * 
 *     def getNASMSNES(self, n: int) -> SNES:             # <<<<<<<<<<<<<<
 *         """Return the n-th solver in NASM.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_243getNASMSNES(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_242getNASMSNES, "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:2327");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_243getNASMSNES = {"getNASMSNES", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_243getNASMSNES, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_242getNASMSNES};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_243getNASMSNES(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2327, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2327, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getNASMSNES", 0) < (0)) __PYX_ERR(50, 2327, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getNASMSNES", 1, 1, 1, i); __PYX_ERR(50, 2327, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2327, __pyx_L3_error)
    }
    __pyx_v_n = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getNASMSNES", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 2327, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_242getNASMSNES(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_n);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_242getNASMSNES(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getNASMSNES", 0);

  /* "petsc4py/PETSc/SNES.pyx":2337
 * 
 *         """
 *         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, 2337, __pyx_L1_error)
  __pyx_v_cn = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":2338
 *         """
 *         cdef PetscInt cn = asInt(n)
 *         cdef SNES snes = SNES()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESNASMGetSNES(self.snes, cn, &snes.snes))
 *         CHKERR(PetscINCREF(snes.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2338, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_snes = ((struct PyPetscSNESObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2339
 *         cdef PetscInt cn = asInt(n)
 *         cdef SNES snes = SNES()
 *         CHKERR(SNESNASMGetSNES(self.snes, cn, &snes.snes))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(snes.obj))
 *         return snes
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESNASMGetSNES(__pyx_v_self->snes, __pyx_v_cn, (&__pyx_v_snes->snes))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2339, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2340
 *         cdef SNES snes = SNES()
 *         CHKERR(SNESNASMGetSNES(self.snes, cn, &snes.snes))
 *         CHKERR(PetscINCREF(snes.obj))             # <<<<<<<<<<<<<<
 *         return snes
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_snes->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2340, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2341
 *         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":2327
 *     # --- 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_XDECREF(__pyx_t_3);
  __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":2343
 *         return snes
 * 
 *     def getNASMNumber(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of solvers in NASM.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_245getNASMNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_244getNASMNumber, "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:2343");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_245getNASMNumber = {"getNASMNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_245getNASMNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_244getNASMNumber};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_245getNASMNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNASMNumber", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_244getNASMNumber(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_244getNASMNumber(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2353
 * 
 *         """
 *         cdef PetscInt cn = 0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESNASMGetNumber(self.snes, &cn))
 *         return toInt(cn)
*/
  __pyx_v_cn = 0;

  /* "petsc4py/PETSc/SNES.pyx":2354
 *         """
 *         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, 2354, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2355
 *         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, 2355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2343
 *         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":2359
 *     # --- 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_247setPatchCellNumbering(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_246setPatchCellNumbering, "SNES.setPatchCellNumbering(self, sec: Section) -> None\nSet cell patch numbering.\nSource code at petsc4py/PETSc/SNES.pyx:2359");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_247setPatchCellNumbering = {"setPatchCellNumbering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_247setPatchCellNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_246setPatchCellNumbering};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_247setPatchCellNumbering(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2359, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2359, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPatchCellNumbering", 0) < (0)) __PYX_ERR(50, 2359, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPatchCellNumbering", 1, 1, 1, i); __PYX_ERR(50, 2359, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2359, __pyx_L3_error)
    }
    __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, 2359, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(50, 2359, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_246setPatchCellNumbering(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_sec);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_246setPatchCellNumbering(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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2361
 *     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, 2361, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2359
 *     # --- 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":2363
 *         CHKERR(SNESPatchSetCellNumbering(self.snes, sec.sec))
 * 
 *     def setPatchDiscretisationInfo(self, dms, bs,             # <<<<<<<<<<<<<<
 *                                    cellNodeMaps,
 *                                    subspaceOffsets,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_249setPatchDiscretisationInfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_248setPatchDiscretisationInfo, "SNES.setPatchDiscretisationInfo(self, dms, bs, cellNodeMaps, subspaceOffsets, ghostBcNodes, globalBcNodes) -> None\nSet patch discretisation information.\nSource code at petsc4py/PETSc/SNES.pyx:2363");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_249setPatchDiscretisationInfo = {"setPatchDiscretisationInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_249setPatchDiscretisationInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_248setPatchDiscretisationInfo};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_249setPatchDiscretisationInfo(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dms,&__pyx_mstate_global->__pyx_n_u_bs_2,&__pyx_mstate_global->__pyx_n_u_cellNodeMaps,&__pyx_mstate_global->__pyx_n_u_subspaceOffsets,&__pyx_mstate_global->__pyx_n_u_ghostBcNodes,&__pyx_mstate_global->__pyx_n_u_globalBcNodes,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2363, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(50, 2363, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(50, 2363, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 2363, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 2363, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2363, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2363, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPatchDiscretisationInfo", 0) < (0)) __PYX_ERR(50, 2363, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPatchDiscretisationInfo", 1, 6, 6, i); __PYX_ERR(50, 2363, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2363, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2363, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 2363, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 2363, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(50, 2363, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(50, 2363, __pyx_L3_error)
    }
    __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, 2363, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_248setPatchDiscretisationInfo(((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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_248setPatchDiscretisationInfo(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":2369
 *                                    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":2370
 *         """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":2371
 *         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":2372
 *         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":2373
 *         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":2374
 *         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":2375
 *         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":2376
 *         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":2377
 *         cdef PetscInt *csubspaceOffsets = NULL
 *         cdef PetscInt *cghostBcNodes = NULL
 *         cdef PetscInt *cglobalBcNodes = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt i = 0
 * 
*/
  __pyx_v_cglobalBcNodes = NULL;

  /* "petsc4py/PETSc/SNES.pyx":2378
 *         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":2380
 *         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, 2380, __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":2381
 * 
 *         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, 2381, __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":2382
 *         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, 2382, __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":2383
 *         ghostBcNodes = iarray_i(ghostBcNodes, &numGhostBcs, &cghostBcNodes)
 *         globalBcNodes = iarray_i(globalBcNodes, &numGlobalBcs, &cglobalBcNodes)
 *         subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets)             # <<<<<<<<<<<<<<
 * 
 *         CHKERR(PetscMalloc(<size_t>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, 2383, __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":2385
 *         subspaceOffsets = iarray_i(subspaceOffsets, NULL, &csubspaceOffsets)
 * 
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscInt), &nodesPerCell))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscDM), &cdms))
 *         CHKERR(PetscMalloc(<size_t>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, 2385, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2386
 * 
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscInt), &nodesPerCell))
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscDM), &cdms))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscMalloc(<size_t>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, 2386, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2387
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscInt), &nodesPerCell))
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscDM), &cdms))
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps))             # <<<<<<<<<<<<<<
 *         for i in range(numSubSpaces):
 *             cdms[i] = (<DM?>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, 2387, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2388
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscDM), &cdms))
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps))
 *         for i in range(numSubSpaces):             # <<<<<<<<<<<<<<
 *             cdms[i] = (<DM?>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":2389
 *         CHKERR(PetscMalloc(<size_t>numSubSpaces*sizeof(PetscInt*), &ccellNodeMaps))
 *         for i in range(numSubSpaces):
 *             cdms[i] = (<DM?>dms[i]).dm             # <<<<<<<<<<<<<<
 *             _, nodes = asarray(cellNodeMaps[i]).shape
 *             cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, <PetscInt**>&ccellNodeMaps[i])
*/
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_dms, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(50, 2389, __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":2390
 *         for i in range(numSubSpaces):
 *             cdms[i] = (<DM?>dms[i]).dm
 *             _, nodes = asarray(cellNodeMaps[i]).shape             # <<<<<<<<<<<<<<
 *             cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, <PetscInt**>&ccellNodeMaps[i])
 *             nodesPerCell[i] = asInt(nodes)
*/
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2390, __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, 2390, __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_mstate_global->__pyx_n_u_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2390, __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, 2390, __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_INCREF(__pyx_t_7);
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_8);
      } else {
        __pyx_t_7 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_7)) __PYX_ERR(50, 2390, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_8)) __PYX_ERR(50, 2390, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_8);
      }
      #else
      __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(50, 2390, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(50, 2390, __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, 2390, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 2390, __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, 2390, __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":2391
 *             cdms[i] = (<DM?>dms[i]).dm
 *             _, nodes = asarray(cellNodeMaps[i]).shape
 *             cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, <PetscInt**>&ccellNodeMaps[i])             # <<<<<<<<<<<<<<
 *             nodesPerCell[i] = asInt(nodes)
 * 
*/
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cellNodeMaps, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2391, __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, 2391, __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_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument) < 0))) __PYX_ERR(50, 2391, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "petsc4py/PETSc/SNES.pyx":2392
 *             _, nodes = asarray(cellNodeMaps[i]).shape
 *             cellNodeMaps[i] = iarray_i(cellNodeMaps[i], NULL, <PetscInt**>&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, 2392, __pyx_L1_error)
    (__pyx_v_nodesPerCell[__pyx_v_i]) = __pyx_t_11;
  }

  /* "petsc4py/PETSc/SNES.pyx":2395
 * 
 *         # 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, 2395, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2400
 *                                               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, 2400, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2401
 *                                               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, 2401, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2402
 *         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, 2402, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2363
 *         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":2404
 *         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_251setPatchComputeOperator(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_250setPatchComputeOperator, "SNES.setPatchComputeOperator(self, operator, args=None, kargs=None) -> None\nSet patch compute operator.\nSource code at petsc4py/PETSc/SNES.pyx:2404");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_251setPatchComputeOperator = {"setPatchComputeOperator", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_251setPatchComputeOperator, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_250setPatchComputeOperator};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_251setPatchComputeOperator(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_operator,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2404, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 2404, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2404, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2404, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPatchComputeOperator", 0) < (0)) __PYX_ERR(50, 2404, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPatchComputeOperator", 0, 1, 3, i); __PYX_ERR(50, 2404, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 2404, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2404, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2404, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2404, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_250setPatchComputeOperator(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_operator, __pyx_v_args, __pyx_v_kargs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_250setPatchComputeOperator(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":2406
 *     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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/SNES.pyx":2407
 *         """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, 2407, __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":2408
 *         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, <void*>context))
*/
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2408, __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) != (0)) __PYX_ERR(50, 2408, __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) != (0)) __PYX_ERR(50, 2408, __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) != (0)) __PYX_ERR(50, 2408, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2409
 *         if kargs is None: kargs = {}
 *         context = (operator, args, kargs)
 *         self.set_attr("__patch_compute_operator__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, <void*>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, 2409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2410
 *         context = (operator, args, kargs)
 *         self.set_attr("__patch_compute_operator__", context)
 *         CHKERR(SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, <void*>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, 2410, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2404
 *         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":2412
 *         CHKERR(SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, <void*>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_253setPatchComputeFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_252setPatchComputeFunction, "SNES.setPatchComputeFunction(self, function, args=None, kargs=None) -> None\nSet patch compute function.\nSource code at petsc4py/PETSc/SNES.pyx:2412");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_253setPatchComputeFunction = {"setPatchComputeFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_253setPatchComputeFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_252setPatchComputeFunction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_253setPatchComputeFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_function,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2412, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 2412, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2412, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2412, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPatchComputeFunction", 0) < (0)) __PYX_ERR(50, 2412, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPatchComputeFunction", 0, 1, 3, i); __PYX_ERR(50, 2412, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 2412, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2412, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2412, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2412, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_252setPatchComputeFunction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_252setPatchComputeFunction(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":2414
 *     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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/SNES.pyx":2415
 *         """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, 2415, __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":2416
 *         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, <void*>context))
*/
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2416, __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) != (0)) __PYX_ERR(50, 2416, __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) != (0)) __PYX_ERR(50, 2416, __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) != (0)) __PYX_ERR(50, 2416, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2417
 *         if kargs is None: kargs = {}
 *         context = (function, args, kargs)
 *         self.set_attr("__patch_compute_function__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, <void*>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, 2417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2418
 *         context = (function, args, kargs)
 *         self.set_attr("__patch_compute_function__", context)
 *         CHKERR(SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, <void*>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, 2418, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2412
 *         CHKERR(SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, <void*>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":2420
 *         CHKERR(SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, <void*>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_255setPatchConstructType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_254setPatchConstructType, "SNES.setPatchConstructType(self, typ, operator=None, args=None, kargs=None) -> None\nSet patch construct type.\nSource code at petsc4py/PETSc/SNES.pyx:2420");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_255setPatchConstructType = {"setPatchConstructType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_255setPatchConstructType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_254setPatchConstructType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_255setPatchConstructType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_typ,&__pyx_mstate_global->__pyx_n_u_operator,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2420, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 2420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 2420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPatchConstructType", 0) < (0)) __PYX_ERR(50, 2420, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPatchConstructType", 0, 1, 4, i); __PYX_ERR(50, 2420, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 2420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 2420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2420, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2420, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_254setPatchConstructType(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_typ, __pyx_v_operator, __pyx_v_args, __pyx_v_kargs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_254setPatchConstructType(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;
  size_t __pyx_t_7;
  PCPatchConstructType __pyx_t_8;
  PetscErrorCode __pyx_t_9;
  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":2422
 *     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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/SNES.pyx":2423
 *         """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, 2423, __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":2425
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_mstate_global->__pyx_n_u_PatchConstructType); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PYTHON); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2425, __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, 2425, __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, 2425, __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_mstate_global->__pyx_n_u_PatchConstructType); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_USER); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2425, __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, 2425, __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, 2425, __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":2426
 * 
 *         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_4 = NULL;
    __pyx_t_7 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Must_provide_operator_for_USER_o};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2426, __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, 2426, __pyx_L1_error)

    /* "petsc4py/PETSc/SNES.pyx":2425
 *         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":2427
 *         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":2428
 *             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, 2428, __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) != (0)) __PYX_ERR(50, 2428, __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) != (0)) __PYX_ERR(50, 2428, __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) != (0)) __PYX_ERR(50, 2428, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":2427
 *         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":2430
 *             context = (operator, args, kargs)
 *         else:
 *             context = None             # <<<<<<<<<<<<<<
 *         self.set_attr("__patch_construction_operator__", context)
 *         CHKERR(SNESPatchSetConstructType(self.snes, typ, PCPatch_UserConstructOperator, <void*>context))
*/
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __pyx_v_context = ((PyObject*)Py_None);
  }
  __pyx_L10:;

  /* "petsc4py/PETSc/SNES.pyx":2431
 *         else:
 *             context = None
 *         self.set_attr("__patch_construction_operator__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(SNESPatchSetConstructType(self.snes, typ, PCPatch_UserConstructOperator, <void*>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, 2431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2432
 *             context = None
 *         self.set_attr("__patch_construction_operator__", context)
 *         CHKERR(SNESPatchSetConstructType(self.snes, typ, PCPatch_UserConstructOperator, <void*>context))             # <<<<<<<<<<<<<<
 * 
 *     # --- application context ---
*/
  __pyx_t_8 = ((PCPatchConstructType)__Pyx_PyLong_As_PCPatchConstructType(__pyx_v_typ)); if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2432, __pyx_L1_error)
  __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESPatchSetConstructType(__pyx_v_self->snes, __pyx_t_8, __pyx_f_8petsc4py_5PETSc_PCPatch_UserConstructOperator, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2432, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2420
 *         CHKERR(SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, <void*>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":2438
 *     property appctx:
 *         """Application context."""
 *         def __get__(self) -> Any:             # <<<<<<<<<<<<<<
 *             return self.getAppCtx()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2439
 *         """Application context."""
 *         def __get__(self) -> Any:
 *             return self.getAppCtx()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getAppCtx, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2438
 *     property appctx:
 *         """Application context."""
 *         def __get__(self) -> Any:             # <<<<<<<<<<<<<<
 *             return self.getAppCtx()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2441
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2442
 * 
 *         def __set__(self, value):
 *             self.setAppCtx(value)             # <<<<<<<<<<<<<<
 * 
 *     # --- discretization space ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setAppCtx, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2441
 *             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_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":2448
 *     property dm:
 *         """`DM`."""
 *         def __get__(self) -> DM:             # <<<<<<<<<<<<<<
 *             return self.getDM()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2449
 *         """`DM`."""
 *         def __get__(self) -> DM:
 *             return self.getDM()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getDM, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2448
 *     property dm:
 *         """`DM`."""
 *         def __get__(self) -> DM:             # <<<<<<<<<<<<<<
 *             return self.getDM()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2451
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2452
 * 
 *         def __set__(self, value):
 *             self.setDM(value)             # <<<<<<<<<<<<<<
 * 
 *     # --- nonlinear preconditioner ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setDM, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2451
 *             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_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":2458
 *     property npc:
 *         """Nonlinear preconditioner."""
 *         def __get__(self) -> SNES:             # <<<<<<<<<<<<<<
 *             return self.getNPC()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2459
 *         """Nonlinear preconditioner."""
 *         def __get__(self) -> SNES:
 *             return self.getNPC()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getNPC, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2458
 *     property npc:
 *         """Nonlinear preconditioner."""
 *         def __get__(self) -> SNES:             # <<<<<<<<<<<<<<
 *             return self.getNPC()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2461
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2462
 * 
 *         def __set__(self, value):
 *             self.setNPC(value)             # <<<<<<<<<<<<<<
 * 
 *     # --- vectors ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setNPC, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2461
 *             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_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":2468
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2469
 *         """Solution vector."""
 *         def __get__(self) -> Vec:
 *             return self.getSolution()             # <<<<<<<<<<<<<<
 * 
 *     property vec_upd:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolution, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2468
 *     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_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":2473
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2474
 *         """Update vector."""
 *         def __get__(self) -> Vec:
 *             return self.getSolutionUpdate()             # <<<<<<<<<<<<<<
 * 
 *     property vec_rhs:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolutionUpdate, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2473
 *     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_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":2478
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2479
 *         """Right-hand side vector."""
 *         def __get__(self) -> Vec:
 *             return self.getRhs()             # <<<<<<<<<<<<<<
 * 
 *     # --- linear solver ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getRhs, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2479, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2478
 *     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_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":2485
 *     property ksp:
 *         """Linear solver."""
 *         def __get__(self) -> KSP:             # <<<<<<<<<<<<<<
 *             return self.getKSP()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2486
 *         """Linear solver."""
 *         def __get__(self) -> KSP:
 *             return self.getKSP()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getKSP, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2485
 *     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_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":2488
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2489
 * 
 *         def __set__(self, value):
 *             self.setKSP(value)             # <<<<<<<<<<<<<<
 * 
 *     property use_ksp:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setKSP, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2488
 *             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_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":2493
 *     property use_ksp:
 *         """Boolean indicating if the solver uses a linear solver."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getUseKSP()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7use_ksp_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_7use_ksp_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_7use_ksp___get__(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_7use_ksp___get__(struct PyPetscSNESObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2494
 *         """Boolean indicating if the solver uses a linear solver."""
 *         def __get__(self) -> bool:
 *             return self.getUseKSP()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getUseKSP, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2494, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2493
 *     property use_ksp:
 *         """Boolean indicating if the solver uses a linear solver."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getUseKSP()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.use_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":2496
 *             return self.getUseKSP()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.setUseKSP(value)
 * 
*/

/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_4SNES_7use_ksp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_4SNES_7use_ksp_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_7use_ksp_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_7use_ksp_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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2497
 * 
 *         def __set__(self, value):
 *             self.setUseKSP(value)             # <<<<<<<<<<<<<<
 * 
 *     property use_ew:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setUseKSP, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2496
 *             return self.getUseKSP()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.setUseKSP(value)
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.use_ksp.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":2501
 *     property use_ew:
 *         """Use the Eisenstat-Walker trick."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getUseEW()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2502
 *         """Use the Eisenstat-Walker trick."""
 *         def __get__(self) -> bool:
 *             return self.getUseEW()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getUseEW, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2501
 *     property use_ew:
 *         """Use the Eisenstat-Walker trick."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getUseEW()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2504
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2505
 * 
 *         def __set__(self, value):
 *             self.setUseEW(value)             # <<<<<<<<<<<<<<
 * 
 *     # --- tolerances ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setUseEW, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2504
 *             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_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":2511
 *     property rtol:
 *         """Relative residual tolerance."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[0]
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2512
 *         """Relative residual tolerance."""
 *         def __get__(self) -> float:
 *             return self.getTolerances()[0]             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2512, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2512, __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":2511
 *     property rtol:
 *         """Relative residual tolerance."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[0]
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2514
 *             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;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2515
 * 
 *         def __set__(self, value):
 *             self.setTolerances(rtol=value)             # <<<<<<<<<<<<<<
 * 
 *     property atol:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_rtol, __pyx_v_value, __pyx_t_4, __pyx_callargs+1, 0) < (0)) __PYX_ERR(50, 2515, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_setTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2514
 *             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_4);
  __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":2519
 *     property atol:
 *         """Absolute residual tolerance."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[1]
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2520
 *         """Absolute residual tolerance."""
 *         def __get__(self) -> float:
 *             return self.getTolerances()[1]             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2520, __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":2519
 *     property atol:
 *         """Absolute residual tolerance."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[1]
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2522
 *             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;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2523
 * 
 *         def __set__(self, value):
 *             self.setTolerances(atol=value)             # <<<<<<<<<<<<<<
 * 
 *     property stol:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_atol, __pyx_v_value, __pyx_t_4, __pyx_callargs+1, 0) < (0)) __PYX_ERR(50, 2523, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_setTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2522
 *             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_4);
  __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":2527
 *     property stol:
 *         """Solution update tolerance."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[2]
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2528
 *         """Solution update tolerance."""
 *         def __get__(self) -> float:
 *             return self.getTolerances()[2]             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2528, __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":2527
 *     property stol:
 *         """Solution update tolerance."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[2]
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2530
 *             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;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2531
 * 
 *         def __set__(self, value):
 *             self.setTolerances(stol=value)             # <<<<<<<<<<<<<<
 * 
 *     property max_it:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_stol, __pyx_v_value, __pyx_t_4, __pyx_callargs+1, 0) < (0)) __PYX_ERR(50, 2531, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_setTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2530
 *             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_4);
  __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":2535
 *     property max_it:
 *         """Maximum number of iterations."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[3]
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2536
 *         """Maximum number of iterations."""
 *         def __get__(self) -> int:
 *             return self.getTolerances()[3]             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2536, __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":2535
 *     property max_it:
 *         """Maximum number of iterations."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[3]
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2538
 *             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;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2539
 * 
 *         def __set__(self, value):
 *             self.setTolerances(max_it=value)             # <<<<<<<<<<<<<<
 * 
 *     # --- more tolerances ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_max_it, __pyx_v_value, __pyx_t_4, __pyx_callargs+1, 0) < (0)) __PYX_ERR(50, 2539, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_setTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2538
 *             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_4);
  __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":2545
 *     property max_funcs:
 *         """Maximum number of function evaluations."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getMaxFunctionEvaluations()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2546
 *         """Maximum number of function evaluations."""
 *         def __get__(self) -> int:
 *             return self.getMaxFunctionEvaluations()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getMaxFunctionEvaluations, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2545
 *     property max_funcs:
 *         """Maximum number of function evaluations."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getMaxFunctionEvaluations()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2548
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2549
 * 
 *         def __set__(self, value):
 *             self.setMaxFunctionEvaluations(value)             # <<<<<<<<<<<<<<
 * 
 *     # --- iteration ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setMaxFunctionEvaluations, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2548
 *             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_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":2555
 *     property its:
 *         """Number of iterations."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getIterationNumber()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2556
 *         """Number of iterations."""
 *         def __get__(self) -> int:
 *             return self.getIterationNumber()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getIterationNumber, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2556, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2555
 *     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_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":2558
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2559
 * 
 *         def __set__(self, value):
 *             self.setIterationNumber(value)             # <<<<<<<<<<<<<<
 * 
 *     property norm:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setIterationNumber, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2558
 *             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_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":2563
 *     property norm:
 *         """Function norm."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getFunctionNorm()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2564
 *         """Function norm."""
 *         def __get__(self) -> float:
 *             return self.getFunctionNorm()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getFunctionNorm, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2563
 *     property norm:
 *         """Function norm."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getFunctionNorm()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2566
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2567
 * 
 *         def __set__(self, value):
 *             self.setFunctionNorm(value)             # <<<<<<<<<<<<<<
 * 
 *     property history:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setFunctionNorm, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2566
 *             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_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":2571
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2572
 *         """Convergence history."""
 *         def __get__(self) -> tuple[ArrayReal, ArrayInt]:
 *             return self.getConvergenceHistory()             # <<<<<<<<<<<<<<
 * 
 *     # --- convergence ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getConvergenceHistory, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2571
 *     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_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":2578
 *     property reason:
 *         """Converged reason."""
 *         def __get__(self) -> ConvergedReason:             # <<<<<<<<<<<<<<
 *             return self.getConvergedReason()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2579
 *         """Converged reason."""
 *         def __get__(self) -> ConvergedReason:
 *             return self.getConvergedReason()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getConvergedReason, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2578
 *     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_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":2581
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2582
 * 
 *         def __set__(self, value):
 *             self.setConvergedReason(value)             # <<<<<<<<<<<<<<
 * 
 *     property is_iterating:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setConvergedReason, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2581
 *             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_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":2586
 *     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__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2587
 *         """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_mstate_global->__pyx_n_u_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_EqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2587, __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":2586
 *     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":2591
 *     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__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2592
 *         """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_mstate_global->__pyx_n_u_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2592, __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":2591
 *     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":2596
 *     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__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2597
 *         """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_mstate_global->__pyx_n_u_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2597, __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":2596
 *     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":2603
 *     property use_mf:
 *         """Boolean indicating if the solver uses matrix-free finite-differencing."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getUseMF()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2604
 *         """Boolean indicating if the solver uses matrix-free finite-differencing."""
 *         def __get__(self) -> bool:
 *             return self.getUseMF()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getUseMF, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2603
 *     property use_mf:
 *         """Boolean indicating if the solver uses matrix-free finite-differencing."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getUseMF()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2606
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2607
 * 
 *         def __set__(self, value):
 *             self.setUseMF(value)             # <<<<<<<<<<<<<<
 * 
 *     property use_fd:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setUseMF, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2606
 *             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_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":2611
 *     property use_fd:
 *         """Boolean indicating if the solver uses coloring finite-differencing."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getUseFD()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2612
 *         """Boolean indicating if the solver uses coloring finite-differencing."""
 *         def __get__(self) -> bool:
 *             return self.getUseFD()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getUseFD, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2611
 *     property use_fd:
 *         """Boolean indicating if the solver uses coloring finite-differencing."""
 *         def __get__(self) -> bool:             # <<<<<<<<<<<<<<
 *             return self.getUseFD()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2614
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2615
 * 
 *         def __set__(self, value):
 *             self.setUseFD(value)             # <<<<<<<<<<<<<<
 * 
 *     # --- linesearch ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setUseFD, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2614
 *             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_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/SNES.pyx":2619
 *     # --- linesearch ---
 * 
 *     def getLineSearch(self) -> SNESLineSearch:             # <<<<<<<<<<<<<<
 *         """Return the linesearch object associated with this SNES.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_257getLineSearch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_256getLineSearch, "SNES.getLineSearch(self) -> SNESLineSearch\nReturn the linesearch object associated with this SNES.\n\n        Not collective.\n\n        See Also\n        --------\n        setLineSearch, linesearch, petsc.SNESGetLineSearch\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2619");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_257getLineSearch = {"getLineSearch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_257getLineSearch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_256getLineSearch};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_257getLineSearch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLineSearch", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_256getLineSearch(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_256getLineSearch(struct PyPetscSNESObject *__pyx_v_self) {
  struct PyPetscSNESLineSearchObject *__pyx_v_linesearch = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLineSearch", 0);

  /* "petsc4py/PETSc/SNES.pyx":2629
 * 
 *         """
 *         cdef SNESLineSearch linesearch = SNESLineSearch()             # <<<<<<<<<<<<<<
 *         CHKERR(SNESGetLineSearch(self.snes, &linesearch.snesls))
 *         CHKERR(PetscINCREF(linesearch.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2629, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_linesearch = ((struct PyPetscSNESLineSearchObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2630
 *         """
 *         cdef SNESLineSearch linesearch = SNESLineSearch()
 *         CHKERR(SNESGetLineSearch(self.snes, &linesearch.snesls))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(linesearch.obj))
 *         return linesearch
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESGetLineSearch(__pyx_v_self->snes, (&__pyx_v_linesearch->snesls))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2630, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2631
 *         cdef SNESLineSearch linesearch = SNESLineSearch()
 *         CHKERR(SNESGetLineSearch(self.snes, &linesearch.snesls))
 *         CHKERR(PetscINCREF(linesearch.obj))             # <<<<<<<<<<<<<<
 *         return linesearch
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_linesearch->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2631, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2632
 *         CHKERR(SNESGetLineSearch(self.snes, &linesearch.snesls))
 *         CHKERR(PetscINCREF(linesearch.obj))
 *         return linesearch             # <<<<<<<<<<<<<<
 * 
 *     def setLineSearch(self, SNESLineSearch linesearch) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_linesearch);
  __pyx_r = ((PyObject *)__pyx_v_linesearch);
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2619
 *     # --- linesearch ---
 * 
 *     def getLineSearch(self) -> SNESLineSearch:             # <<<<<<<<<<<<<<
 *         """Return the linesearch object associated with this SNES.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.getLineSearch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_linesearch);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":2634
 *         return linesearch
 * 
 *     def setLineSearch(self, SNESLineSearch linesearch) -> None:             # <<<<<<<<<<<<<<
 *         """Set the linesearch object to be used by this SNES.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_259setLineSearch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_258setLineSearch, "SNES.setLineSearch(self, linesearch: SNESLineSearch) -> None\nSet the linesearch object to be used by this SNES.\n\n        Logically collective.\n\n        See Also\n        --------\n        getLineSearch, linesearch, petsc.SNESSetLineSearch\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2634");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_259setLineSearch = {"setLineSearch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_259setLineSearch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_258setLineSearch};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_259setLineSearch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct PyPetscSNESLineSearchObject *__pyx_v_linesearch = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setLineSearch (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_linesearch,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2634, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2634, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLineSearch", 0) < (0)) __PYX_ERR(50, 2634, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLineSearch", 1, 1, 1, i); __PYX_ERR(50, 2634, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2634, __pyx_L3_error)
    }
    __pyx_v_linesearch = ((struct PyPetscSNESLineSearchObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setLineSearch", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 2634, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.setLineSearch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_linesearch), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch, 0, "linesearch", 0))) __PYX_ERR(50, 2634, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_258setLineSearch(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_linesearch);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_258setLineSearch(struct PyPetscSNESObject *__pyx_v_self, struct PyPetscSNESLineSearchObject *__pyx_v_linesearch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscErrorCode __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setLineSearch", 0);

  /* "petsc4py/PETSc/SNES.pyx":2644
 * 
 *         """
 *         CHKERR(SNESSetLineSearch(self.snes, linesearch.snesls))             # <<<<<<<<<<<<<<
 * 
 *     property linesearch:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESSetLineSearch(__pyx_v_self->snes, __pyx_v_linesearch->snesls)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2644, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2634
 *         return linesearch
 * 
 *     def setLineSearch(self, SNESLineSearch linesearch) -> None:             # <<<<<<<<<<<<<<
 *         """Set the linesearch object to be used by this SNES.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.setLineSearch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":2648
 *     property linesearch:
 *         """The linesearch object associated with this SNES."""
 *         def __get__(self) -> SNESLineSearch:             # <<<<<<<<<<<<<<
 *             return self.getLineSearch()
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_10linesearch_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_10linesearch_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_10linesearch___get__(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_10linesearch___get__(struct PyPetscSNESObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2649
 *         """The linesearch object associated with this SNES."""
 *         def __get__(self) -> SNESLineSearch:
 *             return self.getLineSearch()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getLineSearch, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2648
 *     property linesearch:
 *         """The linesearch object associated with this SNES."""
 *         def __get__(self) -> SNESLineSearch:             # <<<<<<<<<<<<<<
 *             return self.getLineSearch()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.linesearch.__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":2651
 *             return self.getLineSearch()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.setLineSearch(value)
 * 
*/

/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_4SNES_10linesearch_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_4SNES_10linesearch_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_10linesearch_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_10linesearch_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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/SNES.pyx":2652
 * 
 *         def __set__(self, value):
 *             self.setLineSearch(value)             # <<<<<<<<<<<<<<
 * 
 *     # --- NewtonAL methods ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setLineSearch, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2652, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2651
 *             return self.getLineSearch()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.setLineSearch(value)
 * 
*/

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.linesearch.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":2656
 *     # --- NewtonAL methods ---
 * 
 *     def setNewtonALFunction(self, function: SNESFunction | None,             # <<<<<<<<<<<<<<
 *                             args: tuple[Any, ...] | None = None,
 *                             kargs: dict[str, Any] | None = None) -> None:
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_261setNewtonALFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_260setNewtonALFunction, "SNES.setNewtonALFunction(self, function: SNESFunction | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the callback to compute the tangent load vector for SNESNEWTONAL.\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        getNewtonALLoadParameter, petsc.SNESNewtonALSetFunction\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2656");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_261setNewtonALFunction = {"setNewtonALFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_261setNewtonALFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_260setNewtonALFunction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_261setNewtonALFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("setNewtonALFunction (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_function,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2656, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 2656, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2656, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2656, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNewtonALFunction", 0) < (0)) __PYX_ERR(50, 2656, __pyx_L3_error)

      /* "petsc4py/PETSc/SNES.pyx":2657
 * 
 *     def setNewtonALFunction(self, function: SNESFunction | None,
 *                             args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                             kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback to compute the tangent load vector for SNESNEWTONAL.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":2658
 *     def setNewtonALFunction(self, function: SNESFunction | None,
 *                             args: tuple[Any, ...] | None = None,
 *                             kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback to compute the tangent load vector for SNESNEWTONAL.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNewtonALFunction", 0, 1, 3, i); __PYX_ERR(50, 2656, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 2656, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2656, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2656, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/SNES.pyx":2657
 * 
 *     def setNewtonALFunction(self, function: SNESFunction | None,
 *                             args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *                             kargs: dict[str, Any] | None = None) -> None:
 *         """Set the callback to compute the tangent load vector for SNESNEWTONAL.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/SNES.pyx":2658
 *     def setNewtonALFunction(self, function: SNESFunction | None,
 *                             args: tuple[Any, ...] | None = None,
 *                             kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback to compute the tangent load vector for SNESNEWTONAL.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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("setNewtonALFunction", 0, 1, 3, __pyx_nargs); __PYX_ERR(50, 2656, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNewtonALFunction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_260setNewtonALFunction(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/SNES.pyx":2656
 *     # --- NewtonAL methods ---
 * 
 *     def setNewtonALFunction(self, function: SNESFunction | None,             # <<<<<<<<<<<<<<
 *                             args: tuple[Any, ...] | None = None,
 *                             kargs: dict[str, Any] | None = None) -> None:
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_260setNewtonALFunction(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("setNewtonALFunction", 0);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_INCREF(__pyx_v_kargs);

  /* "petsc4py/PETSc/SNES.pyx":2677
 * 
 *         """
 *         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":2678
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/SNES.pyx":2679
 *         if function is not None:
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}             # <<<<<<<<<<<<<<
 *             context = (function, args, kargs)
 *             self.set_attr('__newtonal_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, 2679, __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":2680
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
 *             context = (function, args, kargs)             # <<<<<<<<<<<<<<
 *             self.set_attr('__newtonal_function__', context)
 *             CHKERR(SNESNewtonALSetFunction(self.snes, SNES_NewtonALFunction, <void*>context))
*/
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2680, __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) != (0)) __PYX_ERR(50, 2680, __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) != (0)) __PYX_ERR(50, 2680, __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) != (0)) __PYX_ERR(50, 2680, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":2681
 *             if kargs is None: kargs = {}
 *             context = (function, args, kargs)
 *             self.set_attr('__newtonal_function__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(SNESNewtonALSetFunction(self.snes, SNES_NewtonALFunction, <void*>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 *)"__newtonal_function__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":2682
 *             context = (function, args, kargs)
 *             self.set_attr('__newtonal_function__', context)
 *             CHKERR(SNESNewtonALSetFunction(self.snes, SNES_NewtonALFunction, <void*>context))             # <<<<<<<<<<<<<<
 *         else:
 *             self.set_attr('__newtonal_function__', None)
*/
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESNewtonALSetFunction(__pyx_v_self->snes, __pyx_f_8petsc4py_5PETSc_SNES_NewtonALFunction, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2682, __pyx_L1_error)

    /* "petsc4py/PETSc/SNES.pyx":2677
 * 
 *         """
 *         if function is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/SNES.pyx":2684
 *             CHKERR(SNESNewtonALSetFunction(self.snes, SNES_NewtonALFunction, <void*>context))
 *         else:
 *             self.set_attr('__newtonal_function__', None)             # <<<<<<<<<<<<<<
 *             CHKERR(SNESNewtonALSetFunction(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 *)"__newtonal_function__"), Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/SNES.pyx":2685
 *         else:
 *             self.set_attr('__newtonal_function__', None)
 *             CHKERR(SNESNewtonALSetFunction(self.snes, NULL, NULL))             # <<<<<<<<<<<<<<
 * 
 *     def getNewtonALLoadParameter(self) -> float:
*/
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESNewtonALSetFunction(__pyx_v_self->snes, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2685, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/SNES.pyx":2656
 *     # --- NewtonAL methods ---
 * 
 *     def setNewtonALFunction(self, function: SNESFunction | 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_2);
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNewtonALFunction", __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":2687
 *             CHKERR(SNESNewtonALSetFunction(self.snes, NULL, NULL))
 * 
 *     def getNewtonALLoadParameter(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the load parameter for SNESNEWTONAL.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_263getNewtonALLoadParameter(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_262getNewtonALLoadParameter, "SNES.getNewtonALLoadParameter(self) -> float\nReturn the load parameter for SNESNEWTONAL.\n\n        Not collective.\n\n        See Also\n        --------\n        setNewtonALFunction, setNewtonALCorrectionType\n        petsc.SNESNewtonALGetLoadParameter\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2687");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_263getNewtonALLoadParameter = {"getNewtonALLoadParameter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_263getNewtonALLoadParameter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_262getNewtonALLoadParameter};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_263getNewtonALLoadParameter(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getNewtonALLoadParameter (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getNewtonALLoadParameter", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNewtonALLoadParameter", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_262getNewtonALLoadParameter(((struct PyPetscSNESObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_262getNewtonALLoadParameter(struct PyPetscSNESObject *__pyx_v_self) {
  PetscReal __pyx_v_load;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscErrorCode __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getNewtonALLoadParameter", 0);

  /* "petsc4py/PETSc/SNES.pyx":2698
 * 
 *         """
 *         cdef PetscReal load = 0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESNewtonALGetLoadParameter(self.snes, &load))
 *         return toReal(load)
*/
  __pyx_v_load = 0.0;

  /* "petsc4py/PETSc/SNES.pyx":2699
 *         """
 *         cdef PetscReal load = 0
 *         CHKERR(SNESNewtonALGetLoadParameter(self.snes, &load))             # <<<<<<<<<<<<<<
 *         return toReal(load)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESNewtonALGetLoadParameter(__pyx_v_self->snes, (&__pyx_v_load))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2699, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2700
 *         cdef PetscReal load = 0
 *         CHKERR(SNESNewtonALGetLoadParameter(self.snes, &load))
 *         return toReal(load)             # <<<<<<<<<<<<<<
 * 
 *     def setNewtonALCorrectionType(self, corrtype: NewtonALCorrectionType) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_load); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2687
 *             CHKERR(SNESNewtonALSetFunction(self.snes, NULL, NULL))
 * 
 *     def getNewtonALLoadParameter(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the load parameter for SNESNEWTONAL.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.getNewtonALLoadParameter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":2702
 *         return toReal(load)
 * 
 *     def setNewtonALCorrectionType(self, corrtype: NewtonALCorrectionType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the correction type for SNESNEWTONAL.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_265setNewtonALCorrectionType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_264setNewtonALCorrectionType, "SNES.setNewtonALCorrectionType(self, corrtype: NewtonALCorrectionType) -> None\nSet the correction type for SNESNEWTONAL.\n\n        Logically collective.\n\n        See Also\n        --------\n        getNewtonALLoadParameter, petsc.SNESNewtonALSetCorrectionType\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2702");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4SNES_265setNewtonALCorrectionType = {"setNewtonALCorrectionType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_265setNewtonALCorrectionType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_264setNewtonALCorrectionType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_4SNES_265setNewtonALCorrectionType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_corrtype = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setNewtonALCorrectionType (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_corrtype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2702, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2702, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNewtonALCorrectionType", 0) < (0)) __PYX_ERR(50, 2702, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNewtonALCorrectionType", 1, 1, 1, i); __PYX_ERR(50, 2702, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2702, __pyx_L3_error)
    }
    __pyx_v_corrtype = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setNewtonALCorrectionType", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 2702, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNewtonALCorrectionType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4SNES_264setNewtonALCorrectionType(((struct PyPetscSNESObject *)__pyx_v_self), __pyx_v_corrtype);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_4SNES_264setNewtonALCorrectionType(struct PyPetscSNESObject *__pyx_v_self, PyObject *__pyx_v_corrtype) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  SNESNewtonALCorrectionType __pyx_t_1;
  PetscErrorCode __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setNewtonALCorrectionType", 0);

  /* "petsc4py/PETSc/SNES.pyx":2712
 * 
 *         """
 *         CHKERR(SNESNewtonALSetCorrectionType(self.snes, corrtype))             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_1 = ((SNESNewtonALCorrectionType)__Pyx_PyLong_As_SNESNewtonALCorrectionType(__pyx_v_corrtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(50, 2712, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESNewtonALSetCorrectionType(__pyx_v_self->snes, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2712, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2702
 *         return toReal(load)
 * 
 *     def setNewtonALCorrectionType(self, corrtype: NewtonALCorrectionType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the correction type for SNESNEWTONAL.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.SNES.setNewtonALCorrectionType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":2747
 *     Type = SNESLineSearchType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj  = <PetscObject*> &self.snesls
 *         self.snesls = NULL
*/

/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_14SNESLineSearch___cinit__(((struct PyPetscSNESLineSearchObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8petsc4py_5PETSc_14SNESLineSearch___cinit__(struct PyPetscSNESLineSearchObject *__pyx_v_self) {
  int __pyx_r;

  /* "petsc4py/PETSc/SNES.pyx":2748
 * 
 *     def __cinit__(self):
 *         self.obj  = <PetscObject*> &self.snesls             # <<<<<<<<<<<<<<
 *         self.snesls = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->snesls));

  /* "petsc4py/PETSc/SNES.pyx":2749
 *     def __cinit__(self):
 *         self.obj  = <PetscObject*> &self.snesls
 *         self.snesls = NULL             # <<<<<<<<<<<<<<
 * 
 *     def create(self, comm: Comm | None = None) -> Self:
*/
  __pyx_v_self->snesls = NULL;

  /* "petsc4py/PETSc/SNES.pyx":2747
 *     Type = SNESLineSearchType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj  = <PetscObject*> &self.snesls
 *         self.snesls = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":2751
 *         self.snesls = NULL
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a new linesearch object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_3create(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_2create, "SNESLineSearch.create(self, comm: Comm | None = None) -> Self\nCreate a new linesearch object.\n\n        Collective.\n\n        Parameters\n        ----------\n        comm : Comm, optional\n            MPI communicator, defaults to `Sys.getDefaultComm`.\n\n        See Also\n        --------\n        destroy, petsc.SNESLineSearchCreate\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2751");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_3create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_3create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_2create};
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_3create(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2751, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2751, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(50, 2751, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2751, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(50, 2751, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.SNESLineSearch.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_2create(((struct PyPetscSNESLineSearchObject *)__pyx_v_self), __pyx_v_comm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_2create(struct PyPetscSNESLineSearchObject *__pyx_v_self, PyObject *__pyx_v_comm) {
  MPI_Comm __pyx_v_ccomm;
  SNESLineSearch __pyx_v_newls;
  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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2766
 * 
 *         """
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)             # <<<<<<<<<<<<<<
 *         cdef PetscSNESLineSearch newls = NULL
 *         CHKERR(SNESLineSearchCreate(ccomm, &newls))
*/
  __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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(50, 2766, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":2767
 *         """
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
 *         cdef PetscSNESLineSearch newls = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(SNESLineSearchCreate(ccomm, &newls))
 *         CHKERR(PetscCLEAR(self.obj)); self.snesls = newls
*/
  __pyx_v_newls = NULL;

  /* "petsc4py/PETSc/SNES.pyx":2768
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
 *         cdef PetscSNESLineSearch newls = NULL
 *         CHKERR(SNESLineSearchCreate(ccomm, &newls))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscCLEAR(self.obj)); self.snesls = newls
 *         return self
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchCreate(__pyx_v_ccomm, (&__pyx_v_newls))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2768, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2769
 *         cdef PetscSNESLineSearch newls = NULL
 *         CHKERR(SNESLineSearchCreate(ccomm, &newls))
 *         CHKERR(PetscCLEAR(self.obj)); self.snesls = newls             # <<<<<<<<<<<<<<
 *         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, 2769, __pyx_L1_error)
  __pyx_v_self->snesls = __pyx_v_newls;

  /* "petsc4py/PETSc/SNES.pyx":2770
 *         CHKERR(SNESLineSearchCreate(ccomm, &newls))
 *         CHKERR(PetscCLEAR(self.obj)); self.snesls = newls
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def setFromOptions(self) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2751
 *         self.snesls = NULL
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a new linesearch object.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.SNESLineSearch.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":2772
 *         return self
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the linesearch from the options database.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_5setFromOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_4setFromOptions, "SNESLineSearch.setFromOptions(self) -> None\nConfigure the linesearch from the options database.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.SNESLineSearchSetFromOptions\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2772");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_5setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_5setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_4setFromOptions};
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_5setFromOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_4setFromOptions(((struct PyPetscSNESLineSearchObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_4setFromOptions(struct PyPetscSNESLineSearchObject *__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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2782
 * 
 *         """
 *         CHKERR(SNESLineSearchSetFromOptions(self.snesls))             # <<<<<<<<<<<<<<
 * 
 *     def view(self, Viewer viewer = None) -> None:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchSetFromOptions(__pyx_v_self->snesls)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2782, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2772
 *         return self
 * 
 *     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.SNESLineSearch.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":2784
 *         CHKERR(SNESLineSearchSetFromOptions(self.snesls))
 * 
 *     def view(self, Viewer viewer = None) -> None:             # <<<<<<<<<<<<<<
 *         """View the linesearch object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_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_14SNESLineSearch_6view, "SNESLineSearch.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.SNESLineSearchView\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2784");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_7view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_7view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_6view};
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2784, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2784, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(50, 2784, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2784, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 2784, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.SNESLineSearch.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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(50, 2784, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_6view(((struct PyPetscSNESLineSearchObject *)__pyx_v_self), __pyx_v_viewer);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_6view(struct PyPetscSNESLineSearchObject *__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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2799
 * 
 *         """
 *         cdef PetscViewer cviewer = NULL             # <<<<<<<<<<<<<<
 *         if viewer is not None: cviewer = viewer.vwr
 *         CHKERR(SNESLineSearchView(self.snesls, cviewer))
*/
  __pyx_v_cviewer = NULL;

  /* "petsc4py/PETSc/SNES.pyx":2800
 *         """
 *         cdef PetscViewer cviewer = NULL
 *         if viewer is not None: cviewer = viewer.vwr             # <<<<<<<<<<<<<<
 *         CHKERR(SNESLineSearchView(self.snesls, 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":2801
 *         cdef PetscViewer cviewer = NULL
 *         if viewer is not None: cviewer = viewer.vwr
 *         CHKERR(SNESLineSearchView(self.snesls, cviewer))             # <<<<<<<<<<<<<<
 * 
 *     def getType(self) -> str:
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchView(__pyx_v_self->snesls, __pyx_v_cviewer)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2801, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2784
 *         CHKERR(SNESLineSearchSetFromOptions(self.snesls))
 * 
 *     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.SNESLineSearch.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":2803
 *         CHKERR(SNESLineSearchView(self.snesls, cviewer))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the linesearch.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_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_14SNESLineSearch_8getType, "SNESLineSearch.getType(self) -> str\nReturn the type of the linesearch.\n\n        Not collective.\n\n        See Also\n        --------\n        setType, petsc.SNESLineSearchGetType\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2803");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_9getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_9getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_8getType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_8getType(((struct PyPetscSNESLineSearchObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_8getType(struct PyPetscSNESLineSearchObject *__pyx_v_self) {
  char const *__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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2813
 * 
 *         """
 *         cdef const char *ctype = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(SNESLineSearchGetType(self.snesls, &ctype))
 *         return bytes2str(ctype)
*/
  __pyx_v_ctype = NULL;

  /* "petsc4py/PETSc/SNES.pyx":2814
 *         """
 *         cdef const char *ctype = NULL
 *         CHKERR(SNESLineSearchGetType(self.snesls, &ctype))             # <<<<<<<<<<<<<<
 *         return bytes2str(ctype)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchGetType(__pyx_v_self->snesls, (&__pyx_v_ctype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2814, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2815
 *         cdef const char *ctype = NULL
 *         CHKERR(SNESLineSearchGetType(self.snesls, &ctype))
 *         return bytes2str(ctype)             # <<<<<<<<<<<<<<
 * 
 *     def setType(self, ls_type: Type | str) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_ctype); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2803
 *         CHKERR(SNESLineSearchView(self.snesls, cviewer))
 * 
 *     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.SNESLineSearch.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":2817
 *         return bytes2str(ctype)
 * 
 *     def setType(self, ls_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the linesearch.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_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_14SNESLineSearch_10setType, "SNESLineSearch.setType(self, ls_type: Type | str) -> None\nSet the type of the linesearch.\n\n        Logically collective.\n\n        See Also\n        --------\n        getType, petsc.SNESLineSearchSetType\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2817");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_11setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_10setType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_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_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ls_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2817, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2817, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(50, 2817, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(50, 2817, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2817, __pyx_L3_error)
    }
    __pyx_v_ls_type = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 2817, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.SNESLineSearch.setType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_10setType(((struct PyPetscSNESLineSearchObject *)__pyx_v_self), __pyx_v_ls_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_10setType(struct PyPetscSNESLineSearchObject *__pyx_v_self, PyObject *__pyx_v_ls_type) {
  char const *__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/SNES.pyx":2827
 * 
 *         """
 *         cdef const char *ctype = NULL             # <<<<<<<<<<<<<<
 *         ls_type = str2bytes(ls_type, &ctype)
 *         CHKERR(SNESLineSearchSetType(self.snesls, ctype))
*/
  __pyx_v_ctype = NULL;

  /* "petsc4py/PETSc/SNES.pyx":2828
 *         """
 *         cdef const char *ctype = NULL
 *         ls_type = str2bytes(ls_type, &ctype)             # <<<<<<<<<<<<<<
 *         CHKERR(SNESLineSearchSetType(self.snesls, ctype))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_ls_type, (&__pyx_v_ctype)); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_ls_type, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2829
 *         cdef const char *ctype = NULL
 *         ls_type = str2bytes(ls_type, &ctype)
 *         CHKERR(SNESLineSearchSetType(self.snesls, ctype))             # <<<<<<<<<<<<<<
 * 
 *     def getTolerances(self) -> tuple[float, float, float, float, float, int]:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchSetType(__pyx_v_self->snesls, __pyx_v_ctype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2829, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2817
 *         return bytes2str(ctype)
 * 
 *     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.SNESLineSearch.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/SNES.pyx":2831
 *         CHKERR(SNESLineSearchSetType(self.snesls, ctype))
 * 
 *     def getTolerances(self) -> tuple[float, float, float, float, float, int]:             # <<<<<<<<<<<<<<
 *         """Return the tolerance parameters used in the linesearch.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_13getTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_12getTolerances, "SNESLineSearch.getTolerances(self) -> tuple[float, float, float, float, float, int]\nReturn the tolerance parameters used in the linesearch.\n\n        Not collective.\n\n        Returns\n        -------\n        minstep : float\n            Minimum step length.\n        maxstep : float, optional\n            Maximum step length.\n        rtol : float\n            Relative tolerance.\n        atol : float\n            Absolute tolerance.\n        ltol : float\n            Lambda tolerance.\n        max_its : int\n            Maximum number of iterations for the linesearch.\n\n        See Also\n        --------\n        setTolerances, petsc.SNESLineSearchGetTolerances\n        \nSource code at petsc4py/PETSc/SNES.pyx:2831");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_13getTolerances = {"getTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_13getTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_12getTolerances};
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_13getTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTolerances", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_12getTolerances(((struct PyPetscSNESLineSearchObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_12getTolerances(struct PyPetscSNESLineSearchObject *__pyx_v_self) {
  PetscReal __pyx_v_rtol;
  PetscReal __pyx_v_atol;
  PetscReal __pyx_v_minstep;
  PetscReal __pyx_v_ltol;
  PetscReal __pyx_v_maxstep;
  PetscInt __pyx_v_max_its;
  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("getTolerances", 0);

  /* "petsc4py/PETSc/SNES.pyx":2855
 *         setTolerances, petsc.SNESLineSearchGetTolerances
 *         """
 *         cdef PetscReal rtol=0, atol=0, minstep=0, ltol=0, maxstep=0             # <<<<<<<<<<<<<<
 *         cdef PetscInt max_its=0
 *         CHKERR(SNESLineSearchGetTolerances(self.snesls, &minstep, &maxstep, &rtol, &atol, &ltol, &max_its))
*/
  __pyx_v_rtol = 0.0;
  __pyx_v_atol = 0.0;
  __pyx_v_minstep = 0.0;
  __pyx_v_ltol = 0.0;
  __pyx_v_maxstep = 0.0;

  /* "petsc4py/PETSc/SNES.pyx":2856
 *         """
 *         cdef PetscReal rtol=0, atol=0, minstep=0, ltol=0, maxstep=0
 *         cdef PetscInt max_its=0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESLineSearchGetTolerances(self.snesls, &minstep, &maxstep, &rtol, &atol, &ltol, &max_its))
 *         return (toReal(minstep), toReal(maxstep), toReal(rtol), toReal(atol), toReal(ltol), toInt(max_its))
*/
  __pyx_v_max_its = 0;

  /* "petsc4py/PETSc/SNES.pyx":2857
 *         cdef PetscReal rtol=0, atol=0, minstep=0, ltol=0, maxstep=0
 *         cdef PetscInt max_its=0
 *         CHKERR(SNESLineSearchGetTolerances(self.snesls, &minstep, &maxstep, &rtol, &atol, &ltol, &max_its))             # <<<<<<<<<<<<<<
 *         return (toReal(minstep), toReal(maxstep), toReal(rtol), toReal(atol), toReal(ltol), toInt(max_its))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchGetTolerances(__pyx_v_self->snesls, (&__pyx_v_minstep), (&__pyx_v_maxstep), (&__pyx_v_rtol), (&__pyx_v_atol), (&__pyx_v_ltol), (&__pyx_v_max_its))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2857, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2858
 *         cdef PetscInt max_its=0
 *         CHKERR(SNESLineSearchGetTolerances(self.snesls, &minstep, &maxstep, &rtol, &atol, &ltol, &max_its))
 *         return (toReal(minstep), toReal(maxstep), toReal(rtol), toReal(atol), toReal(ltol), toInt(max_its))             # <<<<<<<<<<<<<<
 * 
 *     def setTolerances(self, minstep: float | None = None, maxstep: float | None = None, rtol: float | None = None, atol: float | None = None, ltol: float | None = None, max_its: int | None = None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_minstep); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_maxstep); if (unlikely(!__pyx_t_3)) __PYX_ERR(50, 2858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_rtol); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_atol); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_ltol); if (unlikely(!__pyx_t_6)) __PYX_ERR(50, 2858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_max_its); if (unlikely(!__pyx_t_7)) __PYX_ERR(50, 2858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) __PYX_ERR(50, 2858, __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) != (0)) __PYX_ERR(50, 2858, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(50, 2858, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_4) != (0)) __PYX_ERR(50, 2858, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_5) != (0)) __PYX_ERR(50, 2858, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_6) != (0)) __PYX_ERR(50, 2858, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_7) != (0)) __PYX_ERR(50, 2858, __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/SNES.pyx":2831
 *         CHKERR(SNESLineSearchSetType(self.snesls, ctype))
 * 
 *     def getTolerances(self) -> tuple[float, float, float, float, float, int]:             # <<<<<<<<<<<<<<
 *         """Return the tolerance parameters used in the linesearch.
 * 
*/

  /* 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.SNESLineSearch.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":2860
 *         return (toReal(minstep), toReal(maxstep), toReal(rtol), toReal(atol), toReal(ltol), toInt(max_its))
 * 
 *     def setTolerances(self, minstep: float | None = None, maxstep: float | None = None, rtol: float | None = None, atol: float | None = None, ltol: float | None = None, max_its: int | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the tolerance parameters used in the linesearch.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_15setTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_14setTolerances, "SNESLineSearch.setTolerances(self, minstep: float | None = None, maxstep: float | None = None, rtol: float | None = None, atol: float | None = None, ltol: float | None = None, max_its: int | None = None) -> None\nSet the tolerance parameters used in the linesearch.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        minstep : float\n            Minimum step length.\n        maxstep : float, optional\n            Maximum step length.\n        rtol : float, optional\n            Relative tolerance.\n        atol : float, optional\n            Absolute tolerance.\n        ltol : float, optional\n            Lambda tolerance.\n        max_its : int, optional\n            Maximum number of iterations for the linesearch.\n\n        See Also\n        --------\n        getTolerances, petsc.SNESLineSearchSetTolerances\n        \nSource code at petsc4py/PETSc/SNES.pyx:2860");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_15setTolerances = {"setTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_15setTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_14setTolerances};
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_15setTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_minstep = 0;
  PyObject *__pyx_v_maxstep = 0;
  PyObject *__pyx_v_rtol = 0;
  PyObject *__pyx_v_atol = 0;
  PyObject *__pyx_v_ltol = 0;
  PyObject *__pyx_v_max_its = 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("setTolerances (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_minstep,&__pyx_mstate_global->__pyx_n_u_maxstep,&__pyx_mstate_global->__pyx_n_u_rtol,&__pyx_mstate_global->__pyx_n_u_atol,&__pyx_mstate_global->__pyx_n_u_ltol,&__pyx_mstate_global->__pyx_n_u_max_its,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2860, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(50, 2860, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(50, 2860, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 2860, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 2860, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2860, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2860, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTolerances", 0) < (0)) __PYX_ERR(50, 2860, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(50, 2860, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(50, 2860, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(50, 2860, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(50, 2860, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(50, 2860, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2860, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_minstep = values[0];
    __pyx_v_maxstep = values[1];
    __pyx_v_rtol = values[2];
    __pyx_v_atol = values[3];
    __pyx_v_ltol = values[4];
    __pyx_v_max_its = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setTolerances", 0, 0, 6, __pyx_nargs); __PYX_ERR(50, 2860, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.SNESLineSearch.setTolerances", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_14setTolerances(((struct PyPetscSNESLineSearchObject *)__pyx_v_self), __pyx_v_minstep, __pyx_v_maxstep, __pyx_v_rtol, __pyx_v_atol, __pyx_v_ltol, __pyx_v_max_its);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_14setTolerances(struct PyPetscSNESLineSearchObject *__pyx_v_self, PyObject *__pyx_v_minstep, PyObject *__pyx_v_maxstep, PyObject *__pyx_v_rtol, PyObject *__pyx_v_atol, PyObject *__pyx_v_ltol, PyObject *__pyx_v_max_its) {
  PetscReal __pyx_v_cminstep;
  PetscReal __pyx_v_cmaxstep;
  PetscReal __pyx_v_crtol;
  PetscReal __pyx_v_catol;
  PetscReal __pyx_v_cltol;
  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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2884
 *         getTolerances, petsc.SNESLineSearchSetTolerances
 *         """
 *         cdef PetscReal cminstep = PETSC_DEFAULT             # <<<<<<<<<<<<<<
 *         cdef PetscReal cmaxstep = PETSC_DEFAULT
 *         cdef PetscReal crtol = PETSC_DEFAULT
*/
  __pyx_v_cminstep = PETSC_DEFAULT;

  /* "petsc4py/PETSc/SNES.pyx":2885
 *         """
 *         cdef PetscReal cminstep = PETSC_DEFAULT
 *         cdef PetscReal cmaxstep = PETSC_DEFAULT             # <<<<<<<<<<<<<<
 *         cdef PetscReal crtol = PETSC_DEFAULT
 *         cdef PetscReal catol = PETSC_DEFAULT
*/
  __pyx_v_cmaxstep = PETSC_DEFAULT;

  /* "petsc4py/PETSc/SNES.pyx":2886
 *         cdef PetscReal cminstep = PETSC_DEFAULT
 *         cdef PetscReal cmaxstep = PETSC_DEFAULT
 *         cdef PetscReal crtol = PETSC_DEFAULT             # <<<<<<<<<<<<<<
 *         cdef PetscReal catol = PETSC_DEFAULT
 *         cdef PetscReal cltol = PETSC_DEFAULT
*/
  __pyx_v_crtol = PETSC_DEFAULT;

  /* "petsc4py/PETSc/SNES.pyx":2887
 *         cdef PetscReal cmaxstep = PETSC_DEFAULT
 *         cdef PetscReal crtol = PETSC_DEFAULT
 *         cdef PetscReal catol = PETSC_DEFAULT             # <<<<<<<<<<<<<<
 *         cdef PetscReal cltol = PETSC_DEFAULT
 *         cdef PetscInt cmaxits = PETSC_DEFAULT
*/
  __pyx_v_catol = PETSC_DEFAULT;

  /* "petsc4py/PETSc/SNES.pyx":2888
 *         cdef PetscReal crtol = PETSC_DEFAULT
 *         cdef PetscReal catol = PETSC_DEFAULT
 *         cdef PetscReal cltol = PETSC_DEFAULT             # <<<<<<<<<<<<<<
 *         cdef PetscInt cmaxits = PETSC_DEFAULT
 *         if minstep is not None: cminstep = asReal(minstep)
*/
  __pyx_v_cltol = PETSC_DEFAULT;

  /* "petsc4py/PETSc/SNES.pyx":2889
 *         cdef PetscReal catol = PETSC_DEFAULT
 *         cdef PetscReal cltol = PETSC_DEFAULT
 *         cdef PetscInt cmaxits = PETSC_DEFAULT             # <<<<<<<<<<<<<<
 *         if minstep is not None: cminstep = asReal(minstep)
 *         if maxstep is not None: cmaxstep = asReal(maxstep)
*/
  __pyx_v_cmaxits = PETSC_DEFAULT;

  /* "petsc4py/PETSc/SNES.pyx":2890
 *         cdef PetscReal cltol = PETSC_DEFAULT
 *         cdef PetscInt cmaxits = PETSC_DEFAULT
 *         if minstep is not None: cminstep = asReal(minstep)             # <<<<<<<<<<<<<<
 *         if maxstep is not None: cmaxstep = asReal(maxstep)
 *         if rtol is not None: crtol = asReal(rtol)
*/
  __pyx_t_1 = (__pyx_v_minstep != Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_minstep); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 2890, __pyx_L1_error)
    __pyx_v_cminstep = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":2891
 *         cdef PetscInt cmaxits = PETSC_DEFAULT
 *         if minstep is not None: cminstep = asReal(minstep)
 *         if maxstep is not None: cmaxstep = asReal(maxstep)             # <<<<<<<<<<<<<<
 *         if rtol is not None: crtol = asReal(rtol)
 *         if atol is not None: catol = asReal(atol)
*/
  __pyx_t_1 = (__pyx_v_maxstep != Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_maxstep); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 2891, __pyx_L1_error)
    __pyx_v_cmaxstep = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":2892
 *         if minstep is not None: cminstep = asReal(minstep)
 *         if maxstep is not None: cmaxstep = asReal(maxstep)
 *         if rtol is not None: crtol = asReal(rtol)             # <<<<<<<<<<<<<<
 *         if atol is not None: catol = asReal(atol)
 *         if ltol is not None: cltol = asReal(ltol)
*/
  __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, 2892, __pyx_L1_error)
    __pyx_v_crtol = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":2893
 *         if maxstep is not None: cmaxstep = asReal(maxstep)
 *         if rtol is not None: crtol = asReal(rtol)
 *         if atol is not None: catol = asReal(atol)             # <<<<<<<<<<<<<<
 *         if ltol is not None: cltol = asReal(ltol)
 *         if max_its is not None: cmaxits = asInt(max_its)
*/
  __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, 2893, __pyx_L1_error)
    __pyx_v_catol = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":2894
 *         if rtol is not None: crtol = asReal(rtol)
 *         if atol is not None: catol = asReal(atol)
 *         if ltol is not None: cltol = asReal(ltol)             # <<<<<<<<<<<<<<
 *         if max_its is not None: cmaxits = asInt(max_its)
 *         CHKERR(SNESLineSearchSetTolerances(self.snesls, cminstep, cmaxstep, crtol, catol, cltol, cmaxits))
*/
  __pyx_t_1 = (__pyx_v_ltol != Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_ltol); if (unlikely(__pyx_t_2 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(50, 2894, __pyx_L1_error)
    __pyx_v_cltol = __pyx_t_2;
  }

  /* "petsc4py/PETSc/SNES.pyx":2895
 *         if atol is not None: catol = asReal(atol)
 *         if ltol is not None: cltol = asReal(ltol)
 *         if max_its is not None: cmaxits = asInt(max_its)             # <<<<<<<<<<<<<<
 *         CHKERR(SNESLineSearchSetTolerances(self.snesls, cminstep, cmaxstep, crtol, catol, cltol, cmaxits))
 * 
*/
  __pyx_t_1 = (__pyx_v_max_its != Py_None);
  if (__pyx_t_1) {
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_max_its); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 2895, __pyx_L1_error)
    __pyx_v_cmaxits = __pyx_t_3;
  }

  /* "petsc4py/PETSc/SNES.pyx":2896
 *         if ltol is not None: cltol = asReal(ltol)
 *         if max_its is not None: cmaxits = asInt(max_its)
 *         CHKERR(SNESLineSearchSetTolerances(self.snesls, cminstep, cmaxstep, crtol, catol, cltol, cmaxits))             # <<<<<<<<<<<<<<
 * 
 *     def getOrder(self) -> int:
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchSetTolerances(__pyx_v_self->snesls, __pyx_v_cminstep, __pyx_v_cmaxstep, __pyx_v_crtol, __pyx_v_catol, __pyx_v_cltol, __pyx_v_cmaxits)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2896, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2860
 *         return (toReal(minstep), toReal(maxstep), toReal(rtol), toReal(atol), toReal(ltol), toInt(max_its))
 * 
 *     def setTolerances(self, minstep: float | None = None, maxstep: float | None = None, rtol: float | None = None, atol: float | None = None, ltol: float | None = None, max_its: int | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the tolerance parameters used in the linesearch.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.SNESLineSearch.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":2898
 *         CHKERR(SNESLineSearchSetTolerances(self.snesls, cminstep, cmaxstep, crtol, catol, cltol, cmaxits))
 * 
 *     def getOrder(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the order of the linesearch.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_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_14SNESLineSearch_16getOrder, "SNESLineSearch.getOrder(self) -> int\nReturn the order of the linesearch.\n\n        Not collective.\n\n        See Also\n        --------\n        setOrder, petsc.SNESLineSearchGetOrder\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2898");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_17getOrder = {"getOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_17getOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_16getOrder};
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOrder", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_16getOrder(((struct PyPetscSNESLineSearchObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_16getOrder(struct PyPetscSNESLineSearchObject *__pyx_v_self) {
  PetscInt __pyx_v_order;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2908
 * 
 *         """
 *         cdef PetscInt order = 0             # <<<<<<<<<<<<<<
 *         CHKERR(SNESLineSearchGetOrder(self.snesls, &order))
 *         return toInt(order)
*/
  __pyx_v_order = 0;

  /* "petsc4py/PETSc/SNES.pyx":2909
 *         """
 *         cdef PetscInt order = 0
 *         CHKERR(SNESLineSearchGetOrder(self.snesls, &order))             # <<<<<<<<<<<<<<
 *         return toInt(order)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchGetOrder(__pyx_v_self->snesls, (&__pyx_v_order))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2909, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2910
 *         cdef PetscInt order = 0
 *         CHKERR(SNESLineSearchGetOrder(self.snesls, &order))
 *         return toInt(order)             # <<<<<<<<<<<<<<
 * 
 *     def setOrder(self, order: int) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_order); if (unlikely(!__pyx_t_2)) __PYX_ERR(50, 2910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2898
 *         CHKERR(SNESLineSearchSetTolerances(self.snesls, cminstep, cmaxstep, crtol, catol, cltol, cmaxits))
 * 
 *     def getOrder(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the order of the linesearch.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.SNESLineSearch.getOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":2912
 *         return toInt(order)
 * 
 *     def setOrder(self, order: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the order of the linesearch.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_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_14SNESLineSearch_18setOrder, "SNESLineSearch.setOrder(self, order: int) -> None\nSet the order of the linesearch.\n\n        Logically collective.\n\n        See Also\n        --------\n        getOrder, petsc.SNESLineSearchSetOrder\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2912");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_19setOrder = {"setOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_19setOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_18setOrder};
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_order,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(50, 2912, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2912, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOrder", 0) < (0)) __PYX_ERR(50, 2912, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setOrder", 1, 1, 1, i); __PYX_ERR(50, 2912, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(50, 2912, __pyx_L3_error)
    }
    __pyx_v_order = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setOrder", 1, 1, 1, __pyx_nargs); __PYX_ERR(50, 2912, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.SNESLineSearch.setOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_18setOrder(((struct PyPetscSNESLineSearchObject *)__pyx_v_self), __pyx_v_order);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_18setOrder(struct PyPetscSNESLineSearchObject *__pyx_v_self, PyObject *__pyx_v_order) {
  PetscInt __pyx_v_iorder;
  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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2922
 * 
 *         """
 *         cdef PetscInt iorder = asInt(order)             # <<<<<<<<<<<<<<
 *         CHKERR(SNESLineSearchSetOrder(self.snesls, iorder))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_order); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(50, 2922, __pyx_L1_error)
  __pyx_v_iorder = __pyx_t_1;

  /* "petsc4py/PETSc/SNES.pyx":2923
 *         """
 *         cdef PetscInt iorder = asInt(order)
 *         CHKERR(SNESLineSearchSetOrder(self.snesls, iorder))             # <<<<<<<<<<<<<<
 * 
 *     def destroy(self) -> Self:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchSetOrder(__pyx_v_self->snesls, __pyx_v_iorder)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2923, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2912
 *         return toInt(order)
 * 
 *     def setOrder(self, order: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the order of the linesearch.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.SNESLineSearch.setOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/SNES.pyx":2925
 *         CHKERR(SNESLineSearchSetOrder(self.snesls, iorder))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the linesearch object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_21destroy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_20destroy, "SNESLineSearch.destroy(self) -> Self\nDestroy the linesearch object.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.SNESLineSearchDestroy\n\n        \nSource code at petsc4py/PETSc/SNES.pyx:2925");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_21destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_21destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_20destroy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_21destroy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_20destroy(((struct PyPetscSNESLineSearchObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_14SNESLineSearch_20destroy(struct PyPetscSNESLineSearchObject *__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", 0);

  /* "petsc4py/PETSc/SNES.pyx":2935
 * 
 *         """
 *         CHKERR(SNESLineSearchDestroy(&self.snesls))             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchDestroy((&__pyx_v_self->snesls))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(50, 2935, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2936
 *         """
 *         CHKERR(SNESLineSearchDestroy(&self.snesls))
 *         return self             # <<<<<<<<<<<<<<
 * 
 * del SNESType
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/SNES.pyx":2925
 *         CHKERR(SNESLineSearchSetOrder(self.snesls, iorder))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the linesearch object.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.SNESLineSearch.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":161
 *     # --- xxx ---
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":162
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.ts             # <<<<<<<<<<<<<<
 *         self.ts = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->ts));

  /* "petsc4py/PETSc/TS.pyx":163
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.ts
 *         self.ts = NULL             # <<<<<<<<<<<<<<
 * 
 *     # --- xxx ---
*/
  __pyx_v_self->ts = NULL;

  /* "petsc4py/PETSc/TS.pyx":161
 *     # --- xxx ---
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.ts
 *         self.ts = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/TS.pyx":167
 *     # --- 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:167");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_3view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_2view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 167, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(51, 167, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 167, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(51, 167, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/TS.pyx":186
 * 
 *         """
 *         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":187
 *         """
 *         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":188
 *         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, 188, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":167
 *     # --- 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":190
 *         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        Collective.\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:190");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_5load = {"load", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_5load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_4load};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 190, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 190, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "load", 0) < (0)) __PYX_ERR(51, 190, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, i); __PYX_ERR(51, 190, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 190, __pyx_L3_error)
    }
    __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, 190, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(51, 190, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/TS.pyx":205
 * 
 *         """
 *         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, 205, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":190
 *         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":207
 *         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        Collective.\n\n        See Also\n        --------\n        petsc.TSDestroy\n\n        \nSource code at petsc4py/PETSc/TS.pyx:207");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_7destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_6destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/TS.pyx":217
 * 
 *         """
 *         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, 217, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":218
 *         """
 *         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":207
 *         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":220
 *         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        Collective.\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:220");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_9create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_8create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 220, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 220, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(51, 220, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 220, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(51, 220, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/TS.pyx":238
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(51, 238, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":239
 *         """
 *         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":240
 *         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, 240, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":241
 *         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, 241, __pyx_L1_error)
  __pyx_v_self->ts = __pyx_v_newts;

  /* "petsc4py/PETSc/TS.pyx":242
 *         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":220
 *         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":244
 *         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:244");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_11clone = {"clone", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_11clone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_10clone};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("clone", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clone", 0);

  /* "petsc4py/PETSc/TS.pyx":254
 * 
 *         """
 *         cdef TS ts = TS()             # <<<<<<<<<<<<<<
 *         CHKERR(TSClone(self.ts, &ts.ts))
 *         return ts
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 254, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_ts = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":255
 *         """
 *         cdef TS ts = TS()
 *         CHKERR(TSClone(self.ts, &ts.ts))             # <<<<<<<<<<<<<<
 *         return ts
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSClone(__pyx_v_self->ts, (&__pyx_v_ts->ts))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 255, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":256
 *         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":244
 *         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_XDECREF(__pyx_t_2);
  __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":258
 *         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        Collective.\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:258");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_13setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_13setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_12setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ts_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 258, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 258, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(51, 258, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(51, 258, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 258, __pyx_L3_error)
    }
    __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, 258, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":277
 * 
 *         """
 *         cdef PetscTSType cval = NULL             # <<<<<<<<<<<<<<
 *         ts_type = str2bytes(ts_type, &cval)
 *         CHKERR(TSSetType(self.ts, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/TS.pyx":278
 *         """
 *         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, 278, __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":279
 *         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, 279, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":258
 *         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":281
 *         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        Logically collective.\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:281");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_15setRKType = {"setRKType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_15setRKType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_14setRKType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ts_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 281, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 281, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRKType", 0) < (0)) __PYX_ERR(51, 281, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setRKType", 1, 1, 1, i); __PYX_ERR(51, 281, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 281, __pyx_L3_error)
    }
    __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, 281, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":300
 * 
 *         """
 *         cdef PetscTSRKType cval = NULL             # <<<<<<<<<<<<<<
 *         ts_type = str2bytes(ts_type, &cval)
 *         CHKERR(TSRKSetType(self.ts, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/TS.pyx":301
 *         """
 *         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, 301, __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":302
 *         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, 302, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":281
 *         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":304
 *         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        Logically collective.\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:304");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_17setARKIMEXType = {"setARKIMEXType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_17setARKIMEXType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_16setARKIMEXType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ts_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 304, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 304, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setARKIMEXType", 0) < (0)) __PYX_ERR(51, 304, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setARKIMEXType", 1, 1, 1, i); __PYX_ERR(51, 304, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 304, __pyx_L3_error)
    }
    __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, 304, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":323
 * 
 *         """
 *         cdef PetscTSARKIMEXType cval = NULL             # <<<<<<<<<<<<<<
 *         ts_type = str2bytes(ts_type, &cval)
 *         CHKERR(TSARKIMEXSetType(self.ts, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/TS.pyx":324
 *         """
 *         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, 324, __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":325
 *         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, 325, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":304
 *         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":327
 *         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        Logically collective.\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:327");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_19setARKIMEXFullyImplicit = {"setARKIMEXFullyImplicit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_19setARKIMEXFullyImplicit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_18setARKIMEXFullyImplicit};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 327, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 327, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setARKIMEXFullyImplicit", 0) < (0)) __PYX_ERR(51, 327, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setARKIMEXFullyImplicit", 1, 1, 1, i); __PYX_ERR(51, 327, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 327, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setARKIMEXFullyImplicit", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 327, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/TS.pyx":342
 * 
 *         """
 *         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, 342, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":343
 *         """
 *         cdef PetscBool bval = asBool(flag)
 *         CHKERR(TSARKIMEXSetFullyImplicit(self.ts, bval))             # <<<<<<<<<<<<<<
 * 
 *     def setARKIMEXFastSlowSplit(self, flag: bool) -> None:
*/
  __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, 343, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":327
 *         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":345
 *         CHKERR(TSARKIMEXSetFullyImplicit(self.ts, bval))
 * 
 *     def setARKIMEXFastSlowSplit(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Use ARKIMEX for solving a fast-slow system.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_21setARKIMEXFastSlowSplit(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_20setARKIMEXFastSlowSplit, "TS.setARKIMEXFastSlowSplit(self, flag: bool) -> None\nUse ARKIMEX for solving a fast-slow system.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        flag\n            Set to True for fast-slow partitioned systems.\n\n        See Also\n        --------\n        petsc.TSARKIMEXSetType\n        \nSource code at petsc4py/PETSc/TS.pyx:345");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_21setARKIMEXFastSlowSplit = {"setARKIMEXFastSlowSplit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_21setARKIMEXFastSlowSplit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_20setARKIMEXFastSlowSplit};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_21setARKIMEXFastSlowSplit(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("setARKIMEXFastSlowSplit (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 345, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 345, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setARKIMEXFastSlowSplit", 0) < (0)) __PYX_ERR(51, 345, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setARKIMEXFastSlowSplit", 1, 1, 1, i); __PYX_ERR(51, 345, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 345, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setARKIMEXFastSlowSplit", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 345, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TS.setARKIMEXFastSlowSplit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_20setARKIMEXFastSlowSplit(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_20setARKIMEXFastSlowSplit(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("setARKIMEXFastSlowSplit", 0);

  /* "petsc4py/PETSc/TS.pyx":359
 *         petsc.TSARKIMEXSetType
 *         """
 *         cdef PetscBool bval = asBool(flag)             # <<<<<<<<<<<<<<
 *         CHKERR(TSARKIMEXSetFastSlowSplit(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, 359, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":360
 *         """
 *         cdef PetscBool bval = asBool(flag)
 *         CHKERR(TSARKIMEXSetFastSlowSplit(self.ts, bval))             # <<<<<<<<<<<<<<
 * 
 *     def getType(self) -> str:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSARKIMEXSetFastSlowSplit(__pyx_v_self->ts, __pyx_v_bval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 360, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":345
 *         CHKERR(TSARKIMEXSetFullyImplicit(self.ts, bval))
 * 
 *     def setARKIMEXFastSlowSplit(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Use ARKIMEX for solving a fast-slow system.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.TS.setARKIMEXFastSlowSplit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TS.pyx":362
 *         CHKERR(TSARKIMEXSetFastSlowSplit(self.ts, bval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the `TS` type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_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_2TS_22getType, "TS.getType(self) -> str\nReturn the `TS` type.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.TSGetType\n\n        \nSource code at petsc4py/PETSc/TS.pyx:362");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_23getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_23getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_22getType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_22getType(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_22getType(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", 0);

  /* "petsc4py/PETSc/TS.pyx":372
 * 
 *         """
 *         cdef PetscTSType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetType(self.ts, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/TS.pyx":373
 *         """
 *         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, 373, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":374
 *         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, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":362
 *         CHKERR(TSARKIMEXSetFastSlowSplit(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":376
 *         return bytes2str(cval)
 * 
 *     def getRKType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the `Type.RK` scheme.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_25getRKType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_24getRKType, "TS.getRKType(self) -> str\nReturn the `Type.RK` scheme.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.TSRKGetType\n\n        \nSource code at petsc4py/PETSc/TS.pyx:376");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_25getRKType = {"getRKType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_25getRKType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_24getRKType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_25getRKType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getRKType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_24getRKType(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_24getRKType(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", 0);

  /* "petsc4py/PETSc/TS.pyx":386
 * 
 *         """
 *         cdef PetscTSRKType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TSRKGetType(self.ts, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/TS.pyx":387
 *         """
 *         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, 387, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":388
 *         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, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":376
 *         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":390
 *         return bytes2str(cval)
 * 
 *     def getARKIMEXType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the `Type.ARKIMEX` scheme.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_27getARKIMEXType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_26getARKIMEXType, "TS.getARKIMEXType(self) -> str\nReturn the `Type.ARKIMEX` scheme.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.TSARKIMEXGetType\n\n        \nSource code at petsc4py/PETSc/TS.pyx:390");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_27getARKIMEXType = {"getARKIMEXType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_27getARKIMEXType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_26getARKIMEXType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_27getARKIMEXType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getARKIMEXType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_26getARKIMEXType(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_26getARKIMEXType(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", 0);

  /* "petsc4py/PETSc/TS.pyx":400
 * 
 *         """
 *         cdef PetscTSARKIMEXType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TSARKIMEXGetType(self.ts, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/TS.pyx":401
 *         """
 *         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, 401, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":402
 *         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, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":390
 *         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":404
 *         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_29setDIRKType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_28setDIRKType, "TS.setDIRKType(self, ts_type: DIRKType | str) -> None\nSet the type of `Type.DIRK` scheme.\n\n        Logically collective.\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:404");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_29setDIRKType = {"setDIRKType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_29setDIRKType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_28setDIRKType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_29setDIRKType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ts_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 404, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 404, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDIRKType", 0) < (0)) __PYX_ERR(51, 404, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDIRKType", 1, 1, 1, i); __PYX_ERR(51, 404, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 404, __pyx_L3_error)
    }
    __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, 404, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_28setDIRKType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_ts_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_28setDIRKType(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":423
 * 
 *         """
 *         cdef PetscTSDIRKType cval = NULL             # <<<<<<<<<<<<<<
 *         ts_type = str2bytes(ts_type, &cval)
 *         CHKERR(TSDIRKSetType(self.ts, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/TS.pyx":424
 *         """
 *         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, 424, __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":425
 *         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, 425, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":404
 *         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":427
 *         CHKERR(TSDIRKSetType(self.ts, cval))
 * 
 *     def getDIRKType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the `Type.DIRK` scheme.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_31getDIRKType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_30getDIRKType, "TS.getDIRKType(self) -> str\nReturn the `Type.DIRK` scheme.\n\n        Not collective.\n\n        See Also\n        --------\n        setDIRKType, petsc.TSDIRKGetType\n\n        \nSource code at petsc4py/PETSc/TS.pyx:427");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_31getDIRKType = {"getDIRKType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_31getDIRKType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_30getDIRKType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_31getDIRKType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDIRKType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_30getDIRKType(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_30getDIRKType(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", 0);

  /* "petsc4py/PETSc/TS.pyx":437
 * 
 *         """
 *         cdef PetscTSDIRKType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TSDIRKGetType(self.ts, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/TS.pyx":438
 *         """
 *         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, 438, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":439
 *         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, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":427
 *         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":441
 *         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_33setProblemType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_32setProblemType, "TS.setProblemType(self, ptype: ProblemType) -> None\nSet the type of problem to be solved.\n\n        Logically collective.\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:441");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_33setProblemType = {"setProblemType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_33setProblemType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_32setProblemType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_33setProblemType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ptype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 441, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 441, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setProblemType", 0) < (0)) __PYX_ERR(51, 441, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setProblemType", 1, 1, 1, i); __PYX_ERR(51, 441, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 441, __pyx_L3_error)
    }
    __pyx_v_ptype = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setProblemType", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 441, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_32setProblemType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_ptype);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_32setProblemType(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", 0);

  /* "petsc4py/PETSc/TS.pyx":456
 * 
 *         """
 *         CHKERR(TSSetProblemType(self.ts, ptype))             # <<<<<<<<<<<<<<
 * 
 *     def getProblemType(self) -> ProblemType:
*/
  __pyx_t_1 = ((TSProblemType)__Pyx_PyLong_As_TSProblemType(__pyx_v_ptype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 456, __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, 456, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":441
 *         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":458
 *         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_35getProblemType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_34getProblemType, "TS.getProblemType(self) -> ProblemType\nReturn the type of problem to be solved.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.TSGetProblemType\n\n        \nSource code at petsc4py/PETSc/TS.pyx:458");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_35getProblemType = {"getProblemType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_35getProblemType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_34getProblemType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_35getProblemType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getProblemType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_34getProblemType(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_34getProblemType(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", 0);

  /* "petsc4py/PETSc/TS.pyx":468
 * 
 *         """
 *         cdef PetscTSProblemType ptype = TS_NONLINEAR             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetProblemType(self.ts, &ptype))
 *         return ptype
*/
  __pyx_v_ptype = TS_NONLINEAR;

  /* "petsc4py/PETSc/TS.pyx":469
 *         """
 *         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, 469, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":470
 *         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_PyLong_From_TSProblemType(__pyx_v_ptype); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":458
 *         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":472
 *         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_37setEquationType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_36setEquationType, "TS.setEquationType(self, eqtype: EquationType) -> None\nSet the type of the equation that `TS` is solving.\n\n        Logically 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:472");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_37setEquationType = {"setEquationType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_37setEquationType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_36setEquationType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_37setEquationType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_eqtype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 472, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setEquationType", 0) < (0)) __PYX_ERR(51, 472, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setEquationType", 1, 1, 1, i); __PYX_ERR(51, 472, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 472, __pyx_L3_error)
    }
    __pyx_v_eqtype = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setEquationType", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 472, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_36setEquationType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_eqtype);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_36setEquationType(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", 0);

  /* "petsc4py/PETSc/TS.pyx":487
 * 
 *         """
 *         CHKERR(TSSetEquationType(self.ts, eqtype))             # <<<<<<<<<<<<<<
 * 
 *     def getEquationType(self) -> EquationType:
*/
  __pyx_t_1 = ((TSEquationType)__Pyx_PyLong_As_TSEquationType(__pyx_v_eqtype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 487, __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, 487, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":472
 *         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":489
 *         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_39getEquationType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_38getEquationType, "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:489");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_39getEquationType = {"getEquationType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_39getEquationType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_38getEquationType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_39getEquationType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getEquationType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_38getEquationType(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_38getEquationType(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", 0);

  /* "petsc4py/PETSc/TS.pyx":499
 * 
 *         """
 *         cdef PetscTSEquationType eqtype = TS_EQ_UNSPECIFIED             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetEquationType(self.ts, &eqtype))
 *         return eqtype
*/
  __pyx_v_eqtype = TS_EQ_UNSPECIFIED;

  /* "petsc4py/PETSc/TS.pyx":500
 *         """
 *         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, 500, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":501
 *         cdef PetscTSEquationType eqtype = TS_EQ_UNSPECIFIED
 *         CHKERR(TSGetEquationType(self.ts, &eqtype))
 *         return eqtype             # <<<<<<<<<<<<<<
 * 
 *     def setOptionsPrefix(self, prefix : str | None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_TSEquationType(__pyx_v_eqtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":489
 *         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":503
 *         return eqtype
 * 
 *     def setOptionsPrefix(self, prefix : str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the prefix used for all the `TS` options.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_41setOptionsPrefix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_40setOptionsPrefix, "TS.setOptionsPrefix(self, prefix: str | None) -> 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:503");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_41setOptionsPrefix = {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_41setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_40setOptionsPrefix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_41setOptionsPrefix(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 503, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 503, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOptionsPrefix", 0) < (0)) __PYX_ERR(51, 503, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, i); __PYX_ERR(51, 503, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 503, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 503, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_40setOptionsPrefix(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_prefix);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_40setOptionsPrefix(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":522
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(TSSetOptionsPrefix(self.ts, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/TS.pyx":523
 *         """
 *         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, 523, __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":524
 *         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, 524, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":503
 *         return eqtype
 * 
 *     def setOptionsPrefix(self, prefix : str | None) -> 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":526
 *         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_43getOptionsPrefix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_42getOptionsPrefix, "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:526");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_43getOptionsPrefix = {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_43getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_42getOptionsPrefix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_43getOptionsPrefix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOptionsPrefix", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_42getOptionsPrefix(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_42getOptionsPrefix(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", 0);

  /* "petsc4py/PETSc/TS.pyx":536
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetOptionsPrefix(self.ts, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/TS.pyx":537
 *         """
 *         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, 537, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":538
 *         cdef const char *cval = NULL
 *         CHKERR(TSGetOptionsPrefix(self.ts, &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":526
 *         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":540
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Append to the prefix used for all the `TS` options.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_45appendOptionsPrefix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_44appendOptionsPrefix, "TS.appendOptionsPrefix(self, prefix: str | None) -> 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:540");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_45appendOptionsPrefix = {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_45appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_44appendOptionsPrefix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_45appendOptionsPrefix(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 540, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "appendOptionsPrefix", 0) < (0)) __PYX_ERR(51, 540, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, i); __PYX_ERR(51, 540, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 540, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 540, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_44appendOptionsPrefix(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_prefix);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_44appendOptionsPrefix(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":559
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(TSAppendOptionsPrefix(self.ts, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/TS.pyx":560
 *         """
 *         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, 560, __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":561
 *         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, 561, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":540
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> 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":563
 *         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_47setFromOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_46setFromOptions, "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:563");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_47setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_47setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_46setFromOptions};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_47setFromOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_46setFromOptions(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_46setFromOptions(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", 0);

  /* "petsc4py/PETSc/TS.pyx":573
 * 
 *         """
 *         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, 573, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":563
 *         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":577
 *     # --- application context ---
 * 
 *     def setAppCtx(self, appctx: Any) -> None:             # <<<<<<<<<<<<<<
 *         """Set the application context.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_49setAppCtx(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_48setAppCtx, "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:577");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_49setAppCtx = {"setAppCtx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_49setAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_48setAppCtx};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_49setAppCtx(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_appctx,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 577, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 577, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setAppCtx", 0) < (0)) __PYX_ERR(51, 577, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, i); __PYX_ERR(51, 577, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 577, __pyx_L3_error)
    }
    __pyx_v_appctx = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 577, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_48setAppCtx(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_appctx);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_48setAppCtx(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", 0);

  /* "petsc4py/PETSc/TS.pyx":588
 * 
 *         """
 *         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, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":577
 *     # --- 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":590
 *         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_51getAppCtx(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_50getAppCtx, "TS.getAppCtx(self) -> Any\nReturn the application context.\nSource code at petsc4py/PETSc/TS.pyx:590");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_51getAppCtx = {"getAppCtx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_51getAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_50getAppCtx};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_51getAppCtx(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getAppCtx", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_50getAppCtx(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_50getAppCtx(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", 0);

  /* "petsc4py/PETSc/TS.pyx":592
 *     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, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":590
 *         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":596
 *     # --- user RHS Function/Jacobian routines ---
 * 
 *     def setRHSFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         function: TSRHSFunction | None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_53setRHSFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_52setRHSFunction, "TS.setRHSFunction(self, function: TSRHSFunction | None, 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        Logically collective.\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:596");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_53setRHSFunction = {"setRHSFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_53setRHSFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_52setRHSFunction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_53setRHSFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_function,&__pyx_mstate_global->__pyx_n_u_f,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 596, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 596, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 596, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 596, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 596, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRHSFunction", 0) < (0)) __PYX_ERR(51, 596, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":599
 *         self,
 *         function: TSRHSFunction | None,
 *         Vec f=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":600
 *         function: TSRHSFunction | None,
 *         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)``.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":601
 *         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)``.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setRHSFunction", 0, 1, 4, i); __PYX_ERR(51, 596, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 596, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 596, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 596, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 596, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":599
 *         self,
 *         function: TSRHSFunction | None,
 *         Vec f=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":600
 *         function: TSRHSFunction | None,
 *         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)``.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":601
 *         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)``.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 596, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "f", 0))) __PYX_ERR(51, 599, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_52setRHSFunction(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_function, __pyx_v_f, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":596
 *     # --- user RHS Function/Jacobian routines ---
 * 
 *     def setRHSFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         function: TSRHSFunction | None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_52setRHSFunction(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":622
 * 
 *         """
 *         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":623
 *         """
 *         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":624
 *         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":625
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TS.pyx":626
 *         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, 626, __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":627
 *             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, <void*>context))
*/
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 627, __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) != (0)) __PYX_ERR(51, 627, __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) != (0)) __PYX_ERR(51, 627, __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) != (0)) __PYX_ERR(51, 627, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":628
 *             if kargs is None: kargs = {}
 *             context = (function, args, kargs)
 *             self.set_attr('__rhsfunction__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(TSSetRHSFunction(self.ts, fvec, TS_RHSFunction, <void*>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, 628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":629
 *             context = (function, args, kargs)
 *             self.set_attr('__rhsfunction__', context)
 *             CHKERR(TSSetRHSFunction(self.ts, fvec, TS_RHSFunction, <void*>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, 629, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":624
 *         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":631
 *             CHKERR(TSSetRHSFunction(self.ts, fvec, TS_RHSFunction, <void*>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, 631, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/TS.pyx":596
 *     # --- user RHS Function/Jacobian routines ---
 * 
 *     def setRHSFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         function: TSRHSFunction | 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.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":633
 *             CHKERR(TSSetRHSFunction(self.ts, fvec, NULL, NULL))
 * 
 *     def setRHSJacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobian: TSRHSJacobian | None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_55setRHSJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_54setRHSJacobian, "TS.setRHSJacobian(self, jacobian: TSRHSJacobian | None, 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:633");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_55setRHSJacobian = {"setRHSJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_55setRHSJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_54setRHSJacobian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_55setRHSJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_jacobian,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 633, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRHSJacobian", 0) < (0)) __PYX_ERR(51, 633, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":636
 *         self,
 *         jacobian: TSRHSJacobian | None,
 *         Mat J=None,             # <<<<<<<<<<<<<<
 *         Mat P=None,
 *         args : tuple[Any, ...] | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":637
 *         jacobian: TSRHSJacobian | None,
 *         Mat J=None,
 *         Mat P=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":638
 *         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)``.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":639
 *         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)``.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setRHSJacobian", 0, 1, 5, i); __PYX_ERR(51, 633, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 633, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":636
 *         self,
 *         jacobian: TSRHSJacobian | None,
 *         Mat J=None,             # <<<<<<<<<<<<<<
 *         Mat P=None,
 *         args : tuple[Any, ...] | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":637
 *         jacobian: TSRHSJacobian | None,
 *         Mat J=None,
 *         Mat P=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":638
 *         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)``.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":639
 *         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)``.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 633, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(51, 636, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(51, 637, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_54setRHSJacobian(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":633
 *             CHKERR(TSSetRHSFunction(self.ts, fvec, NULL, NULL))
 * 
 *     def setRHSJacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobian: TSRHSJacobian | None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_54setRHSJacobian(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":662
 * 
 *         """
 *         cdef PetscMat Jmat=NULL             # <<<<<<<<<<<<<<
 *         if J is not None: Jmat = J.mat
 *         cdef PetscMat Pmat=Jmat
*/
  __pyx_v_Jmat = NULL;

  /* "petsc4py/PETSc/TS.pyx":663
 *         """
 *         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":664
 *         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":665
 *         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":666
 *         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":667
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TS.pyx":668
 *         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, 668, __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":669
 *             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, <void*>context))
*/
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 669, __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) != (0)) __PYX_ERR(51, 669, __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) != (0)) __PYX_ERR(51, 669, __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) != (0)) __PYX_ERR(51, 669, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":670
 *             if kargs is None: kargs = {}
 *             context = (jacobian, args, kargs)
 *             self.set_attr('__rhsjacobian__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(TSSetRHSJacobian(self.ts, Jmat, Pmat, TS_RHSJacobian, <void*>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, 670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":671
 *             context = (jacobian, args, kargs)
 *             self.set_attr('__rhsjacobian__', context)
 *             CHKERR(TSSetRHSJacobian(self.ts, Jmat, Pmat, TS_RHSJacobian, <void*>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, 671, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":666
 *         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":673
 *             CHKERR(TSSetRHSJacobian(self.ts, Jmat, Pmat, TS_RHSJacobian, <void*>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, 673, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "petsc4py/PETSc/TS.pyx":633
 *             CHKERR(TSSetRHSFunction(self.ts, fvec, NULL, NULL))
 * 
 *     def setRHSJacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobian: TSRHSJacobian | 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.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":675
 *             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_57computeRHSFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_56computeRHSFunction, "TS.computeRHSFunction(self, t: float, x: Vec, f: Vec) -> None\nEvaluate the right-hand side function.\n\n        Collective.\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:675");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_57computeRHSFunction = {"computeRHSFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_57computeRHSFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_56computeRHSFunction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_57computeRHSFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_f,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 675, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 675, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 675, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 675, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeRHSFunction", 0) < (0)) __PYX_ERR(51, 675, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeRHSFunction", 1, 3, 3, i); __PYX_ERR(51, 675, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 675, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 675, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 675, __pyx_L3_error)
    }
    __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, 675, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 675, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(51, 675, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_56computeRHSFunction(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_56computeRHSFunction(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", 0);

  /* "petsc4py/PETSc/TS.pyx":694
 * 
 *         """
 *         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, 694, __pyx_L1_error)
  __pyx_v_time = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":695
 *         """
 *         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, 695, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":675
 *             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":697
 *         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_59computeRHSFunctionLinear(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_58computeRHSFunctionLinear, "TS.computeRHSFunctionLinear(self, t: float, x: Vec, f: Vec) -> None\nEvaluate the right-hand side via the user-provided Jacobian.\n\n        Collective.\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:697");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_59computeRHSFunctionLinear = {"computeRHSFunctionLinear", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_59computeRHSFunctionLinear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_58computeRHSFunctionLinear};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_59computeRHSFunctionLinear(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_f,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 697, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 697, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 697, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 697, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeRHSFunctionLinear", 0) < (0)) __PYX_ERR(51, 697, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeRHSFunctionLinear", 1, 3, 3, i); __PYX_ERR(51, 697, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 697, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 697, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 697, __pyx_L3_error)
    }
    __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, 697, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 697, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(51, 697, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_58computeRHSFunctionLinear(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_58computeRHSFunctionLinear(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", 0);

  /* "petsc4py/PETSc/TS.pyx":716
 * 
 *         """
 *         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, 716, __pyx_L1_error)
  __pyx_v_time = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":717
 *         """
 *         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, 717, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":697
 *         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":719
 *         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_61computeRHSJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_60computeRHSJacobian, "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.\n\n        See Also\n        --------\n        petsc.TSComputeRHSJacobian\n\n        \nSource code at petsc4py/PETSc/TS.pyx:719");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_61computeRHSJacobian = {"computeRHSJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_61computeRHSJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_60computeRHSJacobian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_61computeRHSJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_P,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 719, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 719, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 719, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 719, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 719, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeRHSJacobian", 0) < (0)) __PYX_ERR(51, 719, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeRHSJacobian", 0, 3, 4, i); __PYX_ERR(51, 719, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 719, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 719, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 719, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 719, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 719, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 719, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(51, 719, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(51, 719, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_60computeRHSJacobian(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_60computeRHSJacobian(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", 0);

  /* "petsc4py/PETSc/TS.pyx":740
 * 
 *         """
 *         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, 740, __pyx_L1_error)
  __pyx_v_time = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":741
 *         """
 *         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":742
 *         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":743
 *         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, 743, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":719
 *         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":745
 *         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_63computeRHSJacobianConstant(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_62computeRHSJacobianConstant, "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 matrix used to construct the preconditioner.\n\n        See Also\n        --------\n        petsc.TSComputeRHSJacobianConstant\n\n        \nSource code at petsc4py/PETSc/TS.pyx:745");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_63computeRHSJacobianConstant = {"computeRHSJacobianConstant", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_63computeRHSJacobianConstant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_62computeRHSJacobianConstant};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_63computeRHSJacobianConstant(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_P,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 745, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 745, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 745, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 745, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 745, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeRHSJacobianConstant", 0) < (0)) __PYX_ERR(51, 745, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeRHSJacobianConstant", 0, 3, 4, i); __PYX_ERR(51, 745, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 745, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 745, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 745, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 745, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 745, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 745, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(51, 745, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(51, 745, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_62computeRHSJacobianConstant(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_62computeRHSJacobianConstant(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", 0);

  /* "petsc4py/PETSc/TS.pyx":766
 * 
 *         """
 *         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, 766, __pyx_L1_error)
  __pyx_v_time = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":767
 *         """
 *         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":768
 *         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":769
 *         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, 769, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":745
 *         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":771
 *         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_65getRHSFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_64getRHSFunction, "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:771");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_65getRHSFunction = {"getRHSFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_65getRHSFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_64getRHSFunction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_65getRHSFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getRHSFunction", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_64getRHSFunction(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_64getRHSFunction(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getRHSFunction", 0);

  /* "petsc4py/PETSc/TS.pyx":781
 * 
 *         """
 *         cdef Vec f = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetRHSFunction(self.ts, &f.vec, NULL, NULL))
 *         CHKERR(PetscINCREF(f.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 781, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_f = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":782
 *         """
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetRHSFunction(__pyx_v_self->ts, (&__pyx_v_f->vec), NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 782, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":783
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_f->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 783, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":784
 *         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, 784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_function = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":785
 *         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, 785, __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)) != (0)) __PYX_ERR(51, 785, __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) != (0)) __PYX_ERR(51, 785, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":771
 *         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_XDECREF(__pyx_t_2);
  __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":787
 *         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_67getRHSJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_66getRHSJacobian, "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:787");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_67getRHSJacobian = {"getRHSJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_67getRHSJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_66getRHSJacobian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_67getRHSJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getRHSJacobian", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_66getRHSJacobian(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_66getRHSJacobian(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getRHSJacobian", 0);

  /* "petsc4py/PETSc/TS.pyx":797
 * 
 *         """
 *         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_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 797, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 797, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":798
 *         """
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetRHSJacobian(__pyx_v_self->ts, (&__pyx_v_J->mat), (&__pyx_v_P->mat), NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 798, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":799
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 799, __pyx_L1_error)
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 799, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":800
 *         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, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_jacobian = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":801
 *         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, 801, __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)) != (0)) __PYX_ERR(51, 801, __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)) != (0)) __PYX_ERR(51, 801, __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) != (0)) __PYX_ERR(51, 801, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":787
 *         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_XDECREF(__pyx_t_2);
  __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":805
 *     # --- user Implicit Function/Jacobian routines ---
 * 
 *     def setIFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         function: TSIFunction | None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_69setIFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_68setIFunction, "TS.setIFunction(self, function: TSIFunction | None, 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:805");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_69setIFunction = {"setIFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_69setIFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_68setIFunction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_69setIFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_function,&__pyx_mstate_global->__pyx_n_u_f,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 805, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 805, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 805, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 805, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 805, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setIFunction", 0) < (0)) __PYX_ERR(51, 805, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":808
 *         self,
 *         function: TSIFunction | None,
 *         Vec f=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":809
 *         function: TSIFunction | None,
 *         Vec f=None,
 *         args : tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs : dict[str, Any] | None = None) -> None:
 *         """Set the function representing the DAE to be solved.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":810
 *         Vec f=None,
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function representing the DAE to be solved.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setIFunction", 0, 1, 4, i); __PYX_ERR(51, 805, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 805, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 805, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 805, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 805, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":808
 *         self,
 *         function: TSIFunction | None,
 *         Vec f=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":809
 *         function: TSIFunction | None,
 *         Vec f=None,
 *         args : tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs : dict[str, Any] | None = None) -> None:
 *         """Set the function representing the DAE to be solved.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":810
 *         Vec f=None,
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function representing the DAE to be solved.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 805, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "f", 0))) __PYX_ERR(51, 808, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_68setIFunction(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_function, __pyx_v_f, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":805
 *     # --- user Implicit Function/Jacobian routines ---
 * 
 *     def setIFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         function: TSIFunction | None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_68setIFunction(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":831
 * 
 *         """
 *         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":832
 *         """
 *         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":833
 *         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":834
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TS.pyx":835
 *         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, 835, __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":836
 *             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, <void*>context))
*/
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 836, __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) != (0)) __PYX_ERR(51, 836, __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) != (0)) __PYX_ERR(51, 836, __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) != (0)) __PYX_ERR(51, 836, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":837
 *             if kargs is None: kargs = {}
 *             context = (function, args, kargs)
 *             self.set_attr('__ifunction__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(TSSetIFunction(self.ts, fvec, TS_IFunction, <void*>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, 837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":838
 *             context = (function, args, kargs)
 *             self.set_attr('__ifunction__', context)
 *             CHKERR(TSSetIFunction(self.ts, fvec, TS_IFunction, <void*>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, 838, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":833
 *         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":840
 *             CHKERR(TSSetIFunction(self.ts, fvec, TS_IFunction, <void*>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, 840, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/TS.pyx":805
 *     # --- user Implicit Function/Jacobian routines ---
 * 
 *     def setIFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         function: TSIFunction | 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.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":842
 *             CHKERR(TSSetIFunction(self.ts, fvec, NULL, NULL))
 * 
 *     def setIJacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobian: TSIJacobian | None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_71setIJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_70setIJacobian, "TS.setIJacobian(self, jacobian: TSIJacobian | None, 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:842");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_71setIJacobian = {"setIJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_71setIJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_70setIJacobian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_71setIJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_jacobian,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 842, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setIJacobian", 0) < (0)) __PYX_ERR(51, 842, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":845
 *         self,
 *         jacobian: TSIJacobian | None,
 *         Mat J=None,             # <<<<<<<<<<<<<<
 *         Mat P=None,
 *         args : tuple[Any, ...] | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":846
 *         jacobian: TSIJacobian | None,
 *         Mat J=None,
 *         Mat P=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":847
 *         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.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":848
 *         Mat P=None,
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function to compute the Jacobian.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setIJacobian", 0, 1, 5, i); __PYX_ERR(51, 842, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 842, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":845
 *         self,
 *         jacobian: TSIJacobian | None,
 *         Mat J=None,             # <<<<<<<<<<<<<<
 *         Mat P=None,
 *         args : tuple[Any, ...] | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":846
 *         jacobian: TSIJacobian | None,
 *         Mat J=None,
 *         Mat P=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":847
 *         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.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":848
 *         Mat P=None,
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function to compute the Jacobian.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 842, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(51, 845, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(51, 846, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_70setIJacobian(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":842
 *             CHKERR(TSSetIFunction(self.ts, fvec, NULL, NULL))
 * 
 *     def setIJacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobian: TSIJacobian | None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_70setIJacobian(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":874
 * 
 *         """
 *         cdef PetscMat Jmat=NULL             # <<<<<<<<<<<<<<
 *         if J is not None: Jmat = J.mat
 *         cdef PetscMat Pmat=Jmat
*/
  __pyx_v_Jmat = NULL;

  /* "petsc4py/PETSc/TS.pyx":875
 *         """
 *         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":876
 *         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":877
 *         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":878
 *         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":879
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TS.pyx":880
 *         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, 880, __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":881
 *             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, <void*>context))
*/
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 881, __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) != (0)) __PYX_ERR(51, 881, __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) != (0)) __PYX_ERR(51, 881, __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) != (0)) __PYX_ERR(51, 881, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":882
 *             if kargs is None: kargs = {}
 *             context = (jacobian, args, kargs)
 *             self.set_attr('__ijacobian__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(TSSetIJacobian(self.ts, Jmat, Pmat, TS_IJacobian, <void*>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, 882, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":883
 *             context = (jacobian, args, kargs)
 *             self.set_attr('__ijacobian__', context)
 *             CHKERR(TSSetIJacobian(self.ts, Jmat, Pmat, TS_IJacobian, <void*>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, 883, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":878
 *         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":885
 *             CHKERR(TSSetIJacobian(self.ts, Jmat, Pmat, TS_IJacobian, <void*>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, 885, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "petsc4py/PETSc/TS.pyx":842
 *             CHKERR(TSSetIFunction(self.ts, fvec, NULL, NULL))
 * 
 *     def setIJacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobian: TSIJacobian | 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.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":887
 *             CHKERR(TSSetIJacobian(self.ts, Jmat, Pmat, NULL, NULL))
 * 
 *     def setIJacobianP(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobian,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_73setIJacobianP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_72setIJacobianP, "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:887");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_73setIJacobianP = {"setIJacobianP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_73setIJacobianP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_72setIJacobianP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_73setIJacobianP(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_jacobian,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 887, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 887, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 887, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 887, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 887, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setIJacobianP", 0) < (0)) __PYX_ERR(51, 887, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":890
 *         self,
 *         jacobian,
 *         Mat J=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":891
 *         jacobian,
 *         Mat J=None,
 *         args : tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs : dict[str, Any] | None = None) -> None:
 *         """Set the function that computes the Jacobian.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":892
 *         Mat J=None,
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function that computes the Jacobian.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setIJacobianP", 0, 1, 4, i); __PYX_ERR(51, 887, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 887, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 887, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 887, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 887, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":890
 *         self,
 *         jacobian,
 *         Mat J=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":891
 *         jacobian,
 *         Mat J=None,
 *         args : tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs : dict[str, Any] | None = None) -> None:
 *         """Set the function that computes the Jacobian.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":892
 *         Mat J=None,
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function that computes the Jacobian.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 887, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(51, 890, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_72setIJacobianP(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":887
 *             CHKERR(TSSetIJacobian(self.ts, Jmat, Pmat, NULL, NULL))
 * 
 *     def setIJacobianP(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobian,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_72setIJacobianP(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":917
 * 
 *         """
 *         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":918
 *         """
 *         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":919
 *         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":920
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TS.pyx":921
 *         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, 921, __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":922
 *             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, <void*>context))
*/
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 922, __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) != (0)) __PYX_ERR(51, 922, __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) != (0)) __PYX_ERR(51, 922, __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) != (0)) __PYX_ERR(51, 922, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":923
 *             if kargs is None: kargs = {}
 *             context = (jacobian, args, kargs)
 *             self.set_attr('__ijacobianp__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(TSSetIJacobianP(self.ts, Jmat, TS_IJacobianP, <void*>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, 923, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":924
 *             context = (jacobian, args, kargs)
 *             self.set_attr('__ijacobianp__', context)
 *             CHKERR(TSSetIJacobianP(self.ts, Jmat, TS_IJacobianP, <void*>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, 924, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":919
 *         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":926
 *             CHKERR(TSSetIJacobianP(self.ts, Jmat, TS_IJacobianP, <void*>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, 926, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/TS.pyx":887
 *             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":928
 *             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_75computeIFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_74computeIFunction, "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:928");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_75computeIFunction = {"computeIFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_75computeIFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_74computeIFunction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_75computeIFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_xdot,&__pyx_mstate_global->__pyx_n_u_f,&__pyx_mstate_global->__pyx_n_u_imex,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 928, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeIFunction", 0) < (0)) __PYX_ERR(51, 928, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":930
 *     def computeIFunction(self,
 *                          t: float, Vec x, Vec xdot,
 *                          Vec f, imex: bool = False) -> None:             # <<<<<<<<<<<<<<
 *         """Evaluate the DAE residual written in implicit form.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeIFunction", 0, 4, 5, i); __PYX_ERR(51, 928, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 928, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 928, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 928, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 928, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 928, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __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, 928, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 929, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdot), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdot", 0))) __PYX_ERR(51, 929, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(51, 930, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_74computeIFunction(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_x, __pyx_v_xdot, __pyx_v_f, __pyx_v_imex);

  /* "petsc4py/PETSc/TS.pyx":928
 *             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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_74computeIFunction(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", 0);

  /* "petsc4py/PETSc/TS.pyx":953
 * 
 *         """
 *         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, 953, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":954
 *         """
 *         cdef PetscReal rval = asReal(t)
 *         cdef PetscBool bval = imex             # <<<<<<<<<<<<<<
 *         CHKERR(TSComputeIFunction(self.ts, rval, x.vec, xdot.vec,
 *                                   f.vec, bval))
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_imex); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(51, 954, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_2;

  /* "petsc4py/PETSc/TS.pyx":955
 *         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, 955, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":928
 *             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":958
 *                                   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_77computeIJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_76computeIJacobian, "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.\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:958");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_77computeIJacobian = {"computeIJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_77computeIJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_76computeIJacobian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_77computeIJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_xdot,&__pyx_mstate_global->__pyx_n_u_a,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_imex,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 958, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(51, 958, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(51, 958, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 958, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 958, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 958, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 958, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 958, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeIJacobian", 0) < (0)) __PYX_ERR(51, 958, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":960
 *     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.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeIJacobian", 0, 5, 7, i); __PYX_ERR(51, 958, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(51, 958, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(51, 958, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 958, __pyx_L3_error)
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 958, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 958, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 958, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 958, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[5]) values[5] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __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, 958, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 959, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdot), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdot", 0))) __PYX_ERR(51, 959, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(51, 960, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(51, 960, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_76computeIJacobian(((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":958
 *                                   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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_76computeIJacobian(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", 0);

  /* "petsc4py/PETSc/TS.pyx":990
 * 
 *         """
 *         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, 990, __pyx_L1_error)
  __pyx_v_rval1 = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":991
 *         """
 *         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, 991, __pyx_L1_error)
  __pyx_v_rval2 = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":992
 *         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 = __Pyx_PyObject_IsTrue(__pyx_v_imex); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(51, 992, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_2;

  /* "petsc4py/PETSc/TS.pyx":993
 *         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":994
 *         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":995
 *         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, 995, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":958
 *                                   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":998
 *                                   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_79computeIJacobianP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_78computeIJacobianP, "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:998");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_79computeIJacobianP = {"computeIJacobianP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_79computeIJacobianP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_78computeIJacobianP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_79computeIJacobianP(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_xdot,&__pyx_mstate_global->__pyx_n_u_a,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_imex,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 998, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(51, 998, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 998, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 998, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 998, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 998, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 998, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeIJacobianP", 0) < (0)) __PYX_ERR(51, 998, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":1000
 *     def computeIJacobianP(self,
 *                           t: float, Vec x, Vec xdot, a: float,
 *                           Mat J, imex: bool = False) -> None:             # <<<<<<<<<<<<<<
 *         """Evaluate the Jacobian with respect to parameters.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeIJacobianP", 0, 5, 6, i); __PYX_ERR(51, 998, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(51, 998, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 998, __pyx_L3_error)
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 998, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 998, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 998, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 998, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __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, 998, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 999, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdot), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdot", 0))) __PYX_ERR(51, 999, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(51, 1000, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_78computeIJacobianP(((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":998
 *                                   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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_78computeIJacobianP(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1025
 * 
 *         """
 *         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, 1025, __pyx_L1_error)
  __pyx_v_rval1 = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":1026
 *         """
 *         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, 1026, __pyx_L1_error)
  __pyx_v_rval2 = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":1027
 *         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, 1027, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_2;

  /* "petsc4py/PETSc/TS.pyx":1028
 *         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":1029
 *         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, 1029, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":998
 *                                   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":1032
 *                                    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_81getIFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_80getIFunction, "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:1032");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_81getIFunction = {"getIFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_81getIFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_80getIFunction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_81getIFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getIFunction", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_80getIFunction(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_80getIFunction(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getIFunction", 0);

  /* "petsc4py/PETSc/TS.pyx":1042
 * 
 *         """
 *         cdef Vec f = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetIFunction(self.ts, &f.vec, NULL, NULL))
 *         CHKERR(PetscINCREF(f.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1042, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_f = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1043
 *         """
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetIFunction(__pyx_v_self->ts, (&__pyx_v_f->vec), NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1043, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1044
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_f->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1044, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1045
 *         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, 1045, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_function = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1046
 *         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, 1046, __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)) != (0)) __PYX_ERR(51, 1046, __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) != (0)) __PYX_ERR(51, 1046, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1032
 *                                    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_XDECREF(__pyx_t_2);
  __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":1048
 *         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_83getIJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_82getIJacobian, "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:1048");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_83getIJacobian = {"getIJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_83getIJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_82getIJacobian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_83getIJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getIJacobian", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_82getIJacobian(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_82getIJacobian(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getIJacobian", 0);

  /* "petsc4py/PETSc/TS.pyx":1058
 * 
 *         """
 *         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_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1058, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1058, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1059
 *         """
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetIJacobian(__pyx_v_self->ts, (&__pyx_v_J->mat), (&__pyx_v_P->mat), NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1059, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1060
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1060, __pyx_L1_error)
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1060, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1061
 *         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, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_jacobian = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1062
 *         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, 1062, __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)) != (0)) __PYX_ERR(51, 1062, __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)) != (0)) __PYX_ERR(51, 1062, __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) != (0)) __PYX_ERR(51, 1062, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1048
 *         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_XDECREF(__pyx_t_2);
  __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":1064
 *         return (J, P, jacobian)
 * 
 *     def setI2Function(             # <<<<<<<<<<<<<<
 *         self,
 *         function: TSI2Function | None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_85setI2Function(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_84setI2Function, "TS.setI2Function(self, function: TSI2Function | None, 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:1064");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_85setI2Function = {"setI2Function", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_85setI2Function, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_84setI2Function};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_85setI2Function(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_function,&__pyx_mstate_global->__pyx_n_u_f,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1064, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 1064, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 1064, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1064, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1064, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setI2Function", 0) < (0)) __PYX_ERR(51, 1064, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":1067
 *         self,
 *         function: TSI2Function | None,
 *         Vec f=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1068
 *         function: TSI2Function | None,
 *         Vec f=None,
 *         args : tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs : dict[str, Any] | None = None) -> None:
 *         """Set the function to compute the 2nd order DAE.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1069
 *         Vec f=None,
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function to compute the 2nd order DAE.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setI2Function", 0, 1, 4, i); __PYX_ERR(51, 1064, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 1064, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 1064, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1064, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1064, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":1067
 *         self,
 *         function: TSI2Function | None,
 *         Vec f=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1068
 *         function: TSI2Function | None,
 *         Vec f=None,
 *         args : tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs : dict[str, Any] | None = None) -> None:
 *         """Set the function to compute the 2nd order DAE.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1069
 *         Vec f=None,
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function to compute the 2nd order DAE.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1064, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "f", 0))) __PYX_ERR(51, 1067, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_84setI2Function(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_function, __pyx_v_f, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":1064
 *         return (J, P, jacobian)
 * 
 *     def setI2Function(             # <<<<<<<<<<<<<<
 *         self,
 *         function: TSI2Function | None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_84setI2Function(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":1090
 * 
 *         """
 *         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":1091
 *         """
 *         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":1092
 *         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":1093
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TS.pyx":1094
 *         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, 1094, __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":1095
 *             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, <void*>context))
*/
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1095, __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) != (0)) __PYX_ERR(51, 1095, __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) != (0)) __PYX_ERR(51, 1095, __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) != (0)) __PYX_ERR(51, 1095, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":1096
 *             if kargs is None: kargs = {}
 *             context = (function, args, kargs)
 *             self.set_attr('__i2function__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(TSSetI2Function(self.ts, fvec, TS_I2Function, <void*>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, 1096, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":1097
 *             context = (function, args, kargs)
 *             self.set_attr('__i2function__', context)
 *             CHKERR(TSSetI2Function(self.ts, fvec, TS_I2Function, <void*>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, 1097, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":1092
 *         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":1099
 *             CHKERR(TSSetI2Function(self.ts, fvec, TS_I2Function, <void*>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, 1099, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/TS.pyx":1064
 *         return (J, P, jacobian)
 * 
 *     def setI2Function(             # <<<<<<<<<<<<<<
 *         self,
 *         function: TSI2Function | 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.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":1101
 *             CHKERR(TSSetI2Function(self.ts, fvec, NULL, NULL))
 * 
 *     def setI2Jacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobian: TSI2Jacobian | None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_87setI2Jacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_86setI2Jacobian, "TS.setI2Jacobian(self, jacobian: TSI2Jacobian | None, 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.\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:1101");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_87setI2Jacobian = {"setI2Jacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_87setI2Jacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_86setI2Jacobian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_87setI2Jacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_jacobian,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1101, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 1101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 1101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 1101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setI2Jacobian", 0) < (0)) __PYX_ERR(51, 1101, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":1104
 *         self,
 *         jacobian: TSI2Jacobian | None,
 *         Mat J=None,             # <<<<<<<<<<<<<<
 *         Mat P=None,
 *         args=None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1105
 *         jacobian: TSI2Jacobian | None,
 *         Mat J=None,
 *         Mat P=None,             # <<<<<<<<<<<<<<
 *         args=None,
 *         kargs=None) -> None:
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1106
 *         Mat J=None,
 *         Mat P=None,
 *         args=None,             # <<<<<<<<<<<<<<
 *         kargs=None) -> None:
 *         """Set the function to compute the Jacobian of the 2nd order DAE.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1107
 *         Mat P=None,
 *         args=None,
 *         kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function to compute the Jacobian of the 2nd order DAE.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setI2Jacobian", 0, 1, 5, i); __PYX_ERR(51, 1101, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 1101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 1101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 1101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1101, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":1104
 *         self,
 *         jacobian: TSI2Jacobian | None,
 *         Mat J=None,             # <<<<<<<<<<<<<<
 *         Mat P=None,
 *         args=None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1105
 *         jacobian: TSI2Jacobian | None,
 *         Mat J=None,
 *         Mat P=None,             # <<<<<<<<<<<<<<
 *         args=None,
 *         kargs=None) -> None:
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1106
 *         Mat J=None,
 *         Mat P=None,
 *         args=None,             # <<<<<<<<<<<<<<
 *         kargs=None) -> None:
 *         """Set the function to compute the Jacobian of the 2nd order DAE.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1107
 *         Mat P=None,
 *         args=None,
 *         kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function to compute the Jacobian of the 2nd order DAE.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1101, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(51, 1104, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(51, 1105, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_86setI2Jacobian(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":1101
 *             CHKERR(TSSetI2Function(self.ts, fvec, NULL, NULL))
 * 
 *     def setI2Jacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobian: TSI2Jacobian | None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_86setI2Jacobian(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":1130
 * 
 *         """
 *         cdef PetscMat Jmat=NULL             # <<<<<<<<<<<<<<
 *         if J is not None: Jmat = J.mat
 *         cdef PetscMat Pmat=Jmat
*/
  __pyx_v_Jmat = NULL;

  /* "petsc4py/PETSc/TS.pyx":1131
 *         """
 *         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":1132
 *         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":1133
 *         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":1134
 *         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":1135
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TS.pyx":1136
 *         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, 1136, __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":1137
 *             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, <void*>context))
*/
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1137, __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) != (0)) __PYX_ERR(51, 1137, __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) != (0)) __PYX_ERR(51, 1137, __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) != (0)) __PYX_ERR(51, 1137, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":1138
 *             if kargs is None: kargs = {}
 *             context = (jacobian, args, kargs)
 *             self.set_attr('__i2jacobian__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(TSSetI2Jacobian(self.ts, Jmat, Pmat, TS_I2Jacobian, <void*>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, 1138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":1139
 *             context = (jacobian, args, kargs)
 *             self.set_attr('__i2jacobian__', context)
 *             CHKERR(TSSetI2Jacobian(self.ts, Jmat, Pmat, TS_I2Jacobian, <void*>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, 1139, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":1134
 *         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":1141
 *             CHKERR(TSSetI2Jacobian(self.ts, Jmat, Pmat, TS_I2Jacobian, <void*>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, 1141, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "petsc4py/PETSc/TS.pyx":1101
 *             CHKERR(TSSetI2Function(self.ts, fvec, NULL, NULL))
 * 
 *     def setI2Jacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobian: TSI2Jacobian | 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.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":1143
 *             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_89computeI2Function(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_88computeI2Function, "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:1143");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_89computeI2Function = {"computeI2Function", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_89computeI2Function, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_88computeI2Function};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_89computeI2Function(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_xdot,&__pyx_mstate_global->__pyx_n_u_xdotdot,&__pyx_mstate_global->__pyx_n_u_f,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1143, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 1143, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 1143, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 1143, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1143, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1143, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeI2Function", 0) < (0)) __PYX_ERR(51, 1143, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeI2Function", 1, 5, 5, i); __PYX_ERR(51, 1143, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1143, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1143, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 1143, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 1143, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 1143, __pyx_L3_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_f = ((struct PyPetscVecObject *)values[4]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("computeI2Function", 1, 5, 5, __pyx_nargs); __PYX_ERR(51, 1143, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 1143, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdot), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdot", 0))) __PYX_ERR(51, 1143, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdotdot), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdotdot", 0))) __PYX_ERR(51, 1143, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(51, 1143, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_88computeI2Function(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_88computeI2Function(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1166
 * 
 *         """
 *         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, 1166, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":1167
 *         """
 *         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, 1167, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1143
 *             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":1170
 *                                    f.vec))
 * 
 *     def computeI2Jacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         t: float,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_91computeI2Jacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_90computeI2Jacobian, "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.\n\n        See Also\n        --------\n        petsc.TSComputeI2Jacobian\n\n        \nSource code at petsc4py/PETSc/TS.pyx:1170");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_91computeI2Jacobian = {"computeI2Jacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_91computeI2Jacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_90computeI2Jacobian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_91computeI2Jacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_xdot,&__pyx_mstate_global->__pyx_n_u_xdotdot,&__pyx_mstate_global->__pyx_n_u_v,&__pyx_mstate_global->__pyx_n_u_a,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_P,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1170, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(51, 1170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(51, 1170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(51, 1170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 1170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 1170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 1170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeI2Jacobian", 0) < (0)) __PYX_ERR(51, 1170, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":1179
 *         a: float,
 *         Mat J,
 *         Mat P=None) -> None:             # <<<<<<<<<<<<<<
 *         """Evaluate the Jacobian of the DAE.
 * 
*/
      if (!values[7]) values[7] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 7; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeI2Jacobian", 0, 7, 8, i); __PYX_ERR(51, 1170, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(51, 1170, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(51, 1170, __pyx_L3_error)
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(51, 1170, __pyx_L3_error)
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 1170, __pyx_L3_error)
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 1170, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 1170, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1170, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1170, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[7]) values[7] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 1170, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 1173, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdot), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdot", 0))) __PYX_ERR(51, 1174, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xdotdot), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xdotdot", 0))) __PYX_ERR(51, 1175, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(51, 1178, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(51, 1179, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_90computeI2Jacobian(((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":1170
 *                                    f.vec))
 * 
 *     def computeI2Jacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         t: float,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_90computeI2Jacobian(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1211
 * 
 *         """
 *         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, 1211, __pyx_L1_error)
  __pyx_v_rval1 = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":1212
 *         """
 *         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, 1212, __pyx_L1_error)
  __pyx_v_rval2 = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":1213
 *         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, 1213, __pyx_L1_error)
  __pyx_v_rval3 = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":1214
 *         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":1215
 *         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":1216
 *         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, 1216, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1170
 *                                    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":1219
 *                                    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_93getI2Function(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_92getI2Function, "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:1219");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_93getI2Function = {"getI2Function", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_93getI2Function, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_92getI2Function};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_93getI2Function(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getI2Function", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_92getI2Function(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_92getI2Function(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getI2Function", 0);

  /* "petsc4py/PETSc/TS.pyx":1229
 * 
 *         """
 *         cdef Vec f = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetI2Function(self.ts, &f.vec, NULL, NULL))
 *         CHKERR(PetscINCREF(f.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1229, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_f = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1230
 *         """
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetI2Function(__pyx_v_self->ts, (&__pyx_v_f->vec), NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1230, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1231
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_f->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1231, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1232
 *         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, 1232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_function = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1233
 *         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, 1233, __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)) != (0)) __PYX_ERR(51, 1233, __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) != (0)) __PYX_ERR(51, 1233, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1219
 *                                    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_XDECREF(__pyx_t_2);
  __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":1235
 *         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_95getI2Jacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_94getI2Jacobian, "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:1235");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_95getI2Jacobian = {"getI2Jacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_95getI2Jacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_94getI2Jacobian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_95getI2Jacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getI2Jacobian", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_94getI2Jacobian(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_94getI2Jacobian(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getI2Jacobian", 0);

  /* "petsc4py/PETSc/TS.pyx":1245
 * 
 *         """
 *         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_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1245, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1245, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1246
 *         """
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetI2Jacobian(__pyx_v_self->ts, (&__pyx_v_J->mat), (&__pyx_v_P->mat), NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1246, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1247
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1247, __pyx_L1_error)
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1247, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1248
 *         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, 1248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_jacobian = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1249
 *         CHKERR(PetscINCREF(J.obj)); CHKERR(PetscINCREF(P.obj))
 *         cdef object jacobian = self.get_attr('__i2jacobian__')
 *         return (J, P, jacobian)             # <<<<<<<<<<<<<<
 * 
 *     # --- TSRHSSplit routines to support multirate and IMEX solvers ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1249, __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)) != (0)) __PYX_ERR(51, 1249, __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)) != (0)) __PYX_ERR(51, 1249, __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) != (0)) __PYX_ERR(51, 1249, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1235
 *         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_XDECREF(__pyx_t_2);
  __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":1252
 * 
 *     # --- TSRHSSplit routines to support multirate and IMEX solvers ---
 *     def setRHSSplitIS(self, splitname: str, IS iss) -> None:             # <<<<<<<<<<<<<<
 *         """Set the index set for the specified split.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_97setRHSSplitIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_96setRHSSplitIS, "TS.setRHSSplitIS(self, splitname: str, iss: IS) -> None\nSet the index set for the specified split.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        splitname\n            Name of this split, if `None` the number of the split is used.\n        iss\n            The index set for part of the solution vector.\n\n        See Also\n        --------\n        petsc.TSRHSSplitSetIS\n\n        \nSource code at petsc4py/PETSc/TS.pyx:1252");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_97setRHSSplitIS = {"setRHSSplitIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_97setRHSSplitIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_96setRHSSplitIS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_97setRHSSplitIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_splitname = 0;
  struct PyPetscISObject *__pyx_v_iss = 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("setRHSSplitIS (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_splitname,&__pyx_mstate_global->__pyx_n_u_iss,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1252, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1252, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1252, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRHSSplitIS", 0) < (0)) __PYX_ERR(51, 1252, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setRHSSplitIS", 1, 2, 2, i); __PYX_ERR(51, 1252, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1252, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1252, __pyx_L3_error)
    }
    __pyx_v_splitname = values[0];
    __pyx_v_iss = ((struct PyPetscISObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setRHSSplitIS", 1, 2, 2, __pyx_nargs); __PYX_ERR(51, 1252, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSSplitIS", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_iss), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iss", 0))) __PYX_ERR(51, 1252, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_96setRHSSplitIS(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_splitname, __pyx_v_iss);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_96setRHSSplitIS(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_splitname, struct PyPetscISObject *__pyx_v_iss) {
  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("setRHSSplitIS", 0);
  __Pyx_INCREF(__pyx_v_splitname);

  /* "petsc4py/PETSc/TS.pyx":1269
 * 
 *         """
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         splitname = str2bytes(splitname, &cname)
 *         CHKERR(TSRHSSplitSetIS(self.ts, cname, iss.iset))
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/TS.pyx":1270
 *         """
 *         cdef const char *cname = NULL
 *         splitname = str2bytes(splitname, &cname)             # <<<<<<<<<<<<<<
 *         CHKERR(TSRHSSplitSetIS(self.ts, cname, iss.iset))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_splitname, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_splitname, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1271
 *         cdef const char *cname = NULL
 *         splitname = str2bytes(splitname, &cname)
 *         CHKERR(TSRHSSplitSetIS(self.ts, cname, iss.iset))             # <<<<<<<<<<<<<<
 * 
 *     def setRHSSplitRHSFunction(
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRHSSplitSetIS(__pyx_v_self->ts, __pyx_v_cname, __pyx_v_iss->iset)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1271, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1252
 * 
 *     # --- TSRHSSplit routines to support multirate and IMEX solvers ---
 *     def setRHSSplitIS(self, splitname: str, IS iss) -> None:             # <<<<<<<<<<<<<<
 *         """Set the index set for the specified split.
 * 
*/

  /* 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.setRHSSplitIS", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_splitname);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TS.pyx":1273
 *         CHKERR(TSRHSSplitSetIS(self.ts, cname, iss.iset))
 * 
 *     def setRHSSplitRHSFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         splitname: str,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_99setRHSSplitRHSFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_98setRHSSplitRHSFunction, "TS.setRHSSplitRHSFunction(self, splitname: str, function: TSRHSFunction, r: Vec | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the split right-hand-side functions.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        splitname\n            Name of the split.\n        function\n            The RHS function evaluation routine.\n        r\n            Vector to hold the residual.\n        args\n            Additional positional arguments for ``function``.\n        kargs\n            Additional keyword arguments for ``function``.\n\n        See Also\n        -------\n        petsc.TSRHSSplitSetRHSFunction\n\n        \nSource code at petsc4py/PETSc/TS.pyx:1273");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_99setRHSSplitRHSFunction = {"setRHSSplitRHSFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_99setRHSSplitRHSFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_98setRHSSplitRHSFunction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_99setRHSSplitRHSFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_splitname = 0;
  PyObject *__pyx_v_function = 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[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("setRHSSplitRHSFunction (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_splitname,&__pyx_mstate_global->__pyx_n_u_function,&__pyx_mstate_global->__pyx_n_u_r,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1273, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 1273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 1273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 1273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRHSSplitRHSFunction", 0) < (0)) __PYX_ERR(51, 1273, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":1277
 *         splitname: str,
 *         function: TSRHSFunction,
 *         Vec r=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1278
 *         function: TSRHSFunction,
 *         Vec r=None,
 *         args : tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs : dict[str, Any] | None = None) -> None:
 *         """Set the split right-hand-side functions.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1279
 *         Vec r=None,
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the split right-hand-side functions.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setRHSSplitRHSFunction", 0, 2, 5, i); __PYX_ERR(51, 1273, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 1273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 1273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 1273, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1273, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1273, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":1277
 *         splitname: str,
 *         function: TSRHSFunction,
 *         Vec r=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1278
 *         function: TSRHSFunction,
 *         Vec r=None,
 *         args : tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs : dict[str, Any] | None = None) -> None:
 *         """Set the split right-hand-side functions.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1279
 *         Vec r=None,
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the split right-hand-side functions.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_splitname = values[0];
    __pyx_v_function = values[1];
    __pyx_v_r = ((struct PyPetscVecObject *)values[2]);
    __pyx_v_args = values[3];
    __pyx_v_kargs = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setRHSSplitRHSFunction", 0, 2, 5, __pyx_nargs); __PYX_ERR(51, 1273, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSSplitRHSFunction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_r), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "r", 0))) __PYX_ERR(51, 1277, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_98setRHSSplitRHSFunction(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_splitname, __pyx_v_function, __pyx_v_r, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":1273
 *         CHKERR(TSRHSSplitSetIS(self.ts, cname, iss.iset))
 * 
 *     def setRHSSplitRHSFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         splitname: str,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_98setRHSSplitRHSFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_splitname, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_r, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
  char const *__pyx_v_cname;
  char *__pyx_v_aname;
  Vec __pyx_v_rvec;
  PyObject *__pyx_v_context = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Vec __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("setRHSSplitRHSFunction", 0);
  __Pyx_INCREF(__pyx_v_splitname);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_INCREF(__pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":1302
 * 
 *         """
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         cdef char *aname = NULL
 *         splitname = str2bytes(splitname, <const char**>&cname)
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/TS.pyx":1303
 *         """
 *         cdef const char *cname = NULL
 *         cdef char *aname = NULL             # <<<<<<<<<<<<<<
 *         splitname = str2bytes(splitname, <const char**>&cname)
 *         cdef PetscVec rvec=NULL
*/
  __pyx_v_aname = NULL;

  /* "petsc4py/PETSc/TS.pyx":1304
 *         cdef const char *cname = NULL
 *         cdef char *aname = NULL
 *         splitname = str2bytes(splitname, <const char**>&cname)             # <<<<<<<<<<<<<<
 *         cdef PetscVec rvec=NULL
 *         if r is not None: rvec = r.vec
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_splitname, ((char const **)(&__pyx_v_cname))); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_splitname, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1305
 *         cdef char *aname = NULL
 *         splitname = str2bytes(splitname, <const char**>&cname)
 *         cdef PetscVec rvec=NULL             # <<<<<<<<<<<<<<
 *         if r is not None: rvec = r.vec
 *         if function is not None:
*/
  __pyx_v_rvec = NULL;

  /* "petsc4py/PETSc/TS.pyx":1306
 *         splitname = str2bytes(splitname, <const char**>&cname)
 *         cdef PetscVec rvec=NULL
 *         if r is not None: rvec = r.vec             # <<<<<<<<<<<<<<
 *         if function is not None:
 *             if args  is None: args  = ()
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_r) != Py_None);
  if (__pyx_t_2) {
    __pyx_t_3 = __pyx_v_r->vec;
    __pyx_v_rvec = __pyx_t_3;
  }

  /* "petsc4py/PETSc/TS.pyx":1307
 *         cdef PetscVec rvec=NULL
 *         if r is not None: rvec = r.vec
 *         if function is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
  __pyx_t_2 = (__pyx_v_function != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/TS.pyx":1308
 *         if r is not None: rvec = r.vec
 *         if function is not None:
 *             if args  is None: args  = ()             # <<<<<<<<<<<<<<
 *             if kargs is None: kargs = {}
 *             context = (function, args, kargs)
*/
    __pyx_t_2 = (__pyx_v_args == Py_None);
    if (__pyx_t_2) {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TS.pyx":1309
 *         if function is not None:
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}             # <<<<<<<<<<<<<<
 *             context = (function, args, kargs)
 *             str2bytes(function.__name__, <const char**>&aname)
*/
    __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, 1309, __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":1310
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
 *             context = (function, args, kargs)             # <<<<<<<<<<<<<<
 *             str2bytes(function.__name__, <const char**>&aname)
 *             self.set_attr(aname, context) # to avoid being GCed
*/
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_function);
    __Pyx_GIVEREF(__pyx_v_function);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_function) != (0)) __PYX_ERR(51, 1310, __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) != (0)) __PYX_ERR(51, 1310, __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) != (0)) __PYX_ERR(51, 1310, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "petsc4py/PETSc/TS.pyx":1311
 *             if kargs is None: kargs = {}
 *             context = (function, args, kargs)
 *             str2bytes(function.__name__, <const char**>&aname)             # <<<<<<<<<<<<<<
 *             self.set_attr(aname, context) # to avoid being GCed
 *             CHKERR(TSRHSSplitSetRHSFunction(self.ts, cname, rvec, TS_RHSFunction, <void*>context))
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_function, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_1, ((char const **)(&__pyx_v_aname))); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "petsc4py/PETSc/TS.pyx":1312
 *             context = (function, args, kargs)
 *             str2bytes(function.__name__, <const char**>&aname)
 *             self.set_attr(aname, context) # to avoid being GCed             # <<<<<<<<<<<<<<
 *             CHKERR(TSRHSSplitSetRHSFunction(self.ts, cname, rvec, TS_RHSFunction, <void*>context))
 *         else:
*/
    __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), __pyx_v_aname, __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "petsc4py/PETSc/TS.pyx":1313
 *             str2bytes(function.__name__, <const char**>&aname)
 *             self.set_attr(aname, context) # to avoid being GCed
 *             CHKERR(TSRHSSplitSetRHSFunction(self.ts, cname, rvec, TS_RHSFunction, <void*>context))             # <<<<<<<<<<<<<<
 *         else:
 *             CHKERR(TSRHSSplitSetRHSFunction(self.ts, cname, rvec, NULL, NULL))
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRHSSplitSetRHSFunction(__pyx_v_self->ts, __pyx_v_cname, __pyx_v_rvec, __pyx_f_8petsc4py_5PETSc_TS_RHSFunction, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1313, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":1307
 *         cdef PetscVec rvec=NULL
 *         if r is not None: rvec = r.vec
 *         if function is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/TS.pyx":1315
 *             CHKERR(TSRHSSplitSetRHSFunction(self.ts, cname, rvec, TS_RHSFunction, <void*>context))
 *         else:
 *             CHKERR(TSRHSSplitSetRHSFunction(self.ts, cname, rvec, NULL, NULL))             # <<<<<<<<<<<<<<
 * 
 *     def setRHSSplitIFunction(
*/
  /*else*/ {
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRHSSplitSetRHSFunction(__pyx_v_self->ts, __pyx_v_cname, __pyx_v_rvec, NULL, NULL)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1315, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/TS.pyx":1273
 *         CHKERR(TSRHSSplitSetIS(self.ts, cname, iss.iset))
 * 
 *     def setRHSSplitRHSFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         splitname: str,
*/

  /* 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_AddTraceback("petsc4py.PETSc.TS.setRHSSplitRHSFunction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_context);
  __Pyx_XDECREF(__pyx_v_splitname);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kargs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TS.pyx":1317
 *             CHKERR(TSRHSSplitSetRHSFunction(self.ts, cname, rvec, NULL, NULL))
 * 
 *     def setRHSSplitIFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         splitname: str,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_101setRHSSplitIFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_100setRHSSplitIFunction, "TS.setRHSSplitIFunction(self, splitname: str, function: TSIFunction, r: Vec | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the split implicit functions.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        splitname\n            Name of the split.\n        function\n            The implicit function evaluation routine.\n        r\n            Vector to hold the residual.\n        args\n            Additional positional arguments for ``function``.\n        kargs\n            Additional keyword arguments for ``function``.\n\n        See Also\n        -------\n        petsc.TSRHSSplitSetIFunction\n\n        \nSource code at petsc4py/PETSc/TS.pyx:1317");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_101setRHSSplitIFunction = {"setRHSSplitIFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_101setRHSSplitIFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_100setRHSSplitIFunction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_101setRHSSplitIFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_splitname = 0;
  PyObject *__pyx_v_function = 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[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("setRHSSplitIFunction (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_splitname,&__pyx_mstate_global->__pyx_n_u_function,&__pyx_mstate_global->__pyx_n_u_r,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1317, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 1317, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 1317, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 1317, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1317, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1317, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRHSSplitIFunction", 0) < (0)) __PYX_ERR(51, 1317, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":1321
 *         splitname: str,
 *         function: TSIFunction,
 *         Vec r=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1322
 *         function: TSIFunction,
 *         Vec r=None,
 *         args : tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs : dict[str, Any] | None = None) -> None:
 *         """Set the split implicit functions.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1323
 *         Vec r=None,
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the split implicit functions.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setRHSSplitIFunction", 0, 2, 5, i); __PYX_ERR(51, 1317, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 1317, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 1317, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 1317, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1317, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1317, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":1321
 *         splitname: str,
 *         function: TSIFunction,
 *         Vec r=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1322
 *         function: TSIFunction,
 *         Vec r=None,
 *         args : tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs : dict[str, Any] | None = None) -> None:
 *         """Set the split implicit functions.
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1323
 *         Vec r=None,
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the split implicit functions.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_splitname = values[0];
    __pyx_v_function = values[1];
    __pyx_v_r = ((struct PyPetscVecObject *)values[2]);
    __pyx_v_args = values[3];
    __pyx_v_kargs = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setRHSSplitIFunction", 0, 2, 5, __pyx_nargs); __PYX_ERR(51, 1317, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSSplitIFunction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_r), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "r", 0))) __PYX_ERR(51, 1321, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_100setRHSSplitIFunction(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_splitname, __pyx_v_function, __pyx_v_r, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":1317
 *             CHKERR(TSRHSSplitSetRHSFunction(self.ts, cname, rvec, NULL, NULL))
 * 
 *     def setRHSSplitIFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         splitname: str,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_100setRHSSplitIFunction(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_splitname, PyObject *__pyx_v_function, struct PyPetscVecObject *__pyx_v_r, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
  char const *__pyx_v_cname;
  char *__pyx_v_aname;
  Vec __pyx_v_rvec;
  PyObject *__pyx_v_context = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Vec __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("setRHSSplitIFunction", 0);
  __Pyx_INCREF(__pyx_v_splitname);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_INCREF(__pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":1346
 * 
 *         """
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         cdef char *aname = NULL
 *         splitname = str2bytes(splitname, &cname)
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/TS.pyx":1347
 *         """
 *         cdef const char *cname = NULL
 *         cdef char *aname = NULL             # <<<<<<<<<<<<<<
 *         splitname = str2bytes(splitname, &cname)
 *         cdef PetscVec rvec=NULL
*/
  __pyx_v_aname = NULL;

  /* "petsc4py/PETSc/TS.pyx":1348
 *         cdef const char *cname = NULL
 *         cdef char *aname = NULL
 *         splitname = str2bytes(splitname, &cname)             # <<<<<<<<<<<<<<
 *         cdef PetscVec rvec=NULL
 *         if r is not None: rvec = r.vec
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_splitname, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_splitname, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1349
 *         cdef char *aname = NULL
 *         splitname = str2bytes(splitname, &cname)
 *         cdef PetscVec rvec=NULL             # <<<<<<<<<<<<<<
 *         if r is not None: rvec = r.vec
 *         if function is not None:
*/
  __pyx_v_rvec = NULL;

  /* "petsc4py/PETSc/TS.pyx":1350
 *         splitname = str2bytes(splitname, &cname)
 *         cdef PetscVec rvec=NULL
 *         if r is not None: rvec = r.vec             # <<<<<<<<<<<<<<
 *         if function is not None:
 *             if args  is None: args  = ()
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_r) != Py_None);
  if (__pyx_t_2) {
    __pyx_t_3 = __pyx_v_r->vec;
    __pyx_v_rvec = __pyx_t_3;
  }

  /* "petsc4py/PETSc/TS.pyx":1351
 *         cdef PetscVec rvec=NULL
 *         if r is not None: rvec = r.vec
 *         if function is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
  __pyx_t_2 = (__pyx_v_function != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/TS.pyx":1352
 *         if r is not None: rvec = r.vec
 *         if function is not None:
 *             if args  is None: args  = ()             # <<<<<<<<<<<<<<
 *             if kargs is None: kargs = {}
 *             context = (function, args, kargs)
*/
    __pyx_t_2 = (__pyx_v_args == Py_None);
    if (__pyx_t_2) {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TS.pyx":1353
 *         if function is not None:
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}             # <<<<<<<<<<<<<<
 *             context = (function, args, kargs)
 *             str2bytes(function.__name__, <const char**>&aname)
*/
    __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, 1353, __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":1354
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
 *             context = (function, args, kargs)             # <<<<<<<<<<<<<<
 *             str2bytes(function.__name__, <const char**>&aname)
 *             self.set_attr(aname, context) # to avoid being GCed
*/
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_function);
    __Pyx_GIVEREF(__pyx_v_function);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_function) != (0)) __PYX_ERR(51, 1354, __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) != (0)) __PYX_ERR(51, 1354, __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) != (0)) __PYX_ERR(51, 1354, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "petsc4py/PETSc/TS.pyx":1355
 *             if kargs is None: kargs = {}
 *             context = (function, args, kargs)
 *             str2bytes(function.__name__, <const char**>&aname)             # <<<<<<<<<<<<<<
 *             self.set_attr(aname, context) # to avoid being GCed
 *             CHKERR(TSRHSSplitSetIFunction(self.ts, cname, rvec, TS_IFunction, <void*>context))
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_function, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_1, ((char const **)(&__pyx_v_aname))); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "petsc4py/PETSc/TS.pyx":1356
 *             context = (function, args, kargs)
 *             str2bytes(function.__name__, <const char**>&aname)
 *             self.set_attr(aname, context) # to avoid being GCed             # <<<<<<<<<<<<<<
 *             CHKERR(TSRHSSplitSetIFunction(self.ts, cname, rvec, TS_IFunction, <void*>context))
 *         else:
*/
    __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), __pyx_v_aname, __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "petsc4py/PETSc/TS.pyx":1357
 *             str2bytes(function.__name__, <const char**>&aname)
 *             self.set_attr(aname, context) # to avoid being GCed
 *             CHKERR(TSRHSSplitSetIFunction(self.ts, cname, rvec, TS_IFunction, <void*>context))             # <<<<<<<<<<<<<<
 *         else:
 *             CHKERR(TSRHSSplitSetIFunction(self.ts, cname, rvec, NULL, NULL))
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRHSSplitSetIFunction(__pyx_v_self->ts, __pyx_v_cname, __pyx_v_rvec, __pyx_f_8petsc4py_5PETSc_TS_IFunction, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1357, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":1351
 *         cdef PetscVec rvec=NULL
 *         if r is not None: rvec = r.vec
 *         if function is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/TS.pyx":1359
 *             CHKERR(TSRHSSplitSetIFunction(self.ts, cname, rvec, TS_IFunction, <void*>context))
 *         else:
 *             CHKERR(TSRHSSplitSetIFunction(self.ts, cname, rvec, NULL, NULL))             # <<<<<<<<<<<<<<
 * 
 *     def setRHSSplitIJacobian(
*/
  /*else*/ {
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRHSSplitSetIFunction(__pyx_v_self->ts, __pyx_v_cname, __pyx_v_rvec, NULL, NULL)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1359, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/TS.pyx":1317
 *             CHKERR(TSRHSSplitSetRHSFunction(self.ts, cname, rvec, NULL, NULL))
 * 
 *     def setRHSSplitIFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         splitname: str,
*/

  /* 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_AddTraceback("petsc4py.PETSc.TS.setRHSSplitIFunction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_context);
  __Pyx_XDECREF(__pyx_v_splitname);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kargs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TS.pyx":1361
 *             CHKERR(TSRHSSplitSetIFunction(self.ts, cname, rvec, NULL, NULL))
 * 
 *     def setRHSSplitIJacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         splitname: str,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_103setRHSSplitIJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_102setRHSSplitIJacobian, "TS.setRHSSplitIJacobian(self, splitname: str, jacobian: TSRHSJacobian, J: Mat | None = None, P: Mat | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the Jacobian for the split implicit function.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        splitname\n            Name of the split.\n        jacobian\n            The Jacobian evaluation routine.\n        J\n            Matrix to store Jacobian entries computed by ``jacobian``.\n        P\n            Matrix used to compute preconditioner (usually the same as ``J``).\n        args\n            Additional positional arguments for ``jacobian``.\n        kargs\n            Additional keyword arguments for ``jacobian``.\n\n        See Also\n        -------\n        petsc.TSRHSSplitSetIJacobian\n\n        \nSource code at petsc4py/PETSc/TS.pyx:1361");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_103setRHSSplitIJacobian = {"setRHSSplitIJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_103setRHSSplitIJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_102setRHSSplitIJacobian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_103setRHSSplitIJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_splitname = 0;
  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[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("setRHSSplitIJacobian (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_splitname,&__pyx_mstate_global->__pyx_n_u_jacobian,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1361, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(51, 1361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 1361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 1361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 1361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRHSSplitIJacobian", 0) < (0)) __PYX_ERR(51, 1361, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":1365
 *         splitname: str,
 *         jacobian: TSRHSJacobian,
 *         Mat J=None,             # <<<<<<<<<<<<<<
 *         Mat P=None,
 *         args : tuple[Any, ...] | None = None,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1366
 *         jacobian: TSRHSJacobian,
 *         Mat J=None,
 *         Mat P=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1367
 *         Mat J=None,
 *         Mat P=None,
 *         args : tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs : dict[str, Any] | None = None) -> None:
 *         """Set the Jacobian for the split implicit function.
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1368
 *         Mat P=None,
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the Jacobian for the split implicit function.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setRHSSplitIJacobian", 0, 2, 6, i); __PYX_ERR(51, 1361, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(51, 1361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 1361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 1361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 1361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1361, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1361, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":1365
 *         splitname: str,
 *         jacobian: TSRHSJacobian,
 *         Mat J=None,             # <<<<<<<<<<<<<<
 *         Mat P=None,
 *         args : tuple[Any, ...] | None = None,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1366
 *         jacobian: TSRHSJacobian,
 *         Mat J=None,
 *         Mat P=None,             # <<<<<<<<<<<<<<
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1367
 *         Mat J=None,
 *         Mat P=None,
 *         args : tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs : dict[str, Any] | None = None) -> None:
 *         """Set the Jacobian for the split implicit function.
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":1368
 *         Mat P=None,
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the Jacobian for the split implicit function.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_splitname = values[0];
    __pyx_v_jacobian = values[1];
    __pyx_v_J = ((struct PyPetscMatObject *)values[2]);
    __pyx_v_P = ((struct PyPetscMatObject *)values[3]);
    __pyx_v_args = values[4];
    __pyx_v_kargs = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setRHSSplitIJacobian", 0, 2, 6, __pyx_nargs); __PYX_ERR(51, 1361, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TS.setRHSSplitIJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(51, 1365, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(51, 1366, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_102setRHSSplitIJacobian(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_splitname, __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":1361
 *             CHKERR(TSRHSSplitSetIFunction(self.ts, cname, rvec, NULL, NULL))
 * 
 *     def setRHSSplitIJacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         splitname: str,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_102setRHSSplitIJacobian(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_splitname, PyObject *__pyx_v_jacobian, struct PyPetscMatObject *__pyx_v_J, struct PyPetscMatObject *__pyx_v_P, PyObject *__pyx_v_args, PyObject *__pyx_v_kargs) {
  char const *__pyx_v_cname;
  char *__pyx_v_aname;
  Mat __pyx_v_Jmat;
  Mat __pyx_v_Pmat;
  PyObject *__pyx_v_context = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Mat __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("setRHSSplitIJacobian", 0);
  __Pyx_INCREF(__pyx_v_splitname);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_INCREF(__pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":1393
 * 
 *         """
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         cdef char *aname = NULL
 *         splitname = str2bytes(splitname, &cname)
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/TS.pyx":1394
 *         """
 *         cdef const char *cname = NULL
 *         cdef char *aname = NULL             # <<<<<<<<<<<<<<
 *         splitname = str2bytes(splitname, &cname)
 *         cdef PetscMat Jmat=NULL
*/
  __pyx_v_aname = NULL;

  /* "petsc4py/PETSc/TS.pyx":1395
 *         cdef const char *cname = NULL
 *         cdef char *aname = NULL
 *         splitname = str2bytes(splitname, &cname)             # <<<<<<<<<<<<<<
 *         cdef PetscMat Jmat=NULL
 *         if J is not None: Jmat = J.mat
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_splitname, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_splitname, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1396
 *         cdef char *aname = NULL
 *         splitname = str2bytes(splitname, &cname)
 *         cdef PetscMat Jmat=NULL             # <<<<<<<<<<<<<<
 *         if J is not None: Jmat = J.mat
 *         cdef PetscMat Pmat=Jmat
*/
  __pyx_v_Jmat = NULL;

  /* "petsc4py/PETSc/TS.pyx":1397
 *         splitname = str2bytes(splitname, &cname)
 *         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_2 = (((PyObject *)__pyx_v_J) != Py_None);
  if (__pyx_t_2) {
    __pyx_t_3 = __pyx_v_J->mat;
    __pyx_v_Jmat = __pyx_t_3;
  }

  /* "petsc4py/PETSc/TS.pyx":1398
 *         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":1399
 *         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_2 = (((PyObject *)__pyx_v_P) != Py_None);
  if (__pyx_t_2) {
    __pyx_t_3 = __pyx_v_P->mat;
    __pyx_v_Pmat = __pyx_t_3;
  }

  /* "petsc4py/PETSc/TS.pyx":1400
 *         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_2 = (__pyx_v_jacobian != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/TS.pyx":1401
 *         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_2 = (__pyx_v_args == Py_None);
    if (__pyx_t_2) {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TS.pyx":1402
 *         if jacobian is not None:
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}             # <<<<<<<<<<<<<<
 *             context = (jacobian, args, kargs)
 *             str2bytes(jacobian.__name__, <const char**>&aname)
*/
    __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, 1402, __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":1403
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
 *             context = (jacobian, args, kargs)             # <<<<<<<<<<<<<<
 *             str2bytes(jacobian.__name__, <const char**>&aname)
 *             self.set_attr(aname, context) # to avoid being GCed
*/
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_jacobian);
    __Pyx_GIVEREF(__pyx_v_jacobian);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_jacobian) != (0)) __PYX_ERR(51, 1403, __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) != (0)) __PYX_ERR(51, 1403, __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) != (0)) __PYX_ERR(51, 1403, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "petsc4py/PETSc/TS.pyx":1404
 *             if kargs is None: kargs = {}
 *             context = (jacobian, args, kargs)
 *             str2bytes(jacobian.__name__, <const char**>&aname)             # <<<<<<<<<<<<<<
 *             self.set_attr(aname, context) # to avoid being GCed
 *             CHKERR(TSRHSSplitSetIJacobian(self.ts, cname, Jmat, Pmat, TS_IJacobian, <void*>context))
*/
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_jacobian, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_1, ((char const **)(&__pyx_v_aname))); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "petsc4py/PETSc/TS.pyx":1405
 *             context = (jacobian, args, kargs)
 *             str2bytes(jacobian.__name__, <const char**>&aname)
 *             self.set_attr(aname, context) # to avoid being GCed             # <<<<<<<<<<<<<<
 *             CHKERR(TSRHSSplitSetIJacobian(self.ts, cname, Jmat, Pmat, TS_IJacobian, <void*>context))
 *         else:
*/
    __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), __pyx_v_aname, __pyx_v_context); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "petsc4py/PETSc/TS.pyx":1406
 *             str2bytes(jacobian.__name__, <const char**>&aname)
 *             self.set_attr(aname, context) # to avoid being GCed
 *             CHKERR(TSRHSSplitSetIJacobian(self.ts, cname, Jmat, Pmat, TS_IJacobian, <void*>context))             # <<<<<<<<<<<<<<
 *         else:
 *             CHKERR(TSRHSSplitSetIJacobian(self.ts, cname, Jmat, Pmat, NULL, NULL))
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRHSSplitSetIJacobian(__pyx_v_self->ts, __pyx_v_cname, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_TS_IJacobian, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1406, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":1400
 *         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":1408
 *             CHKERR(TSRHSSplitSetIJacobian(self.ts, cname, Jmat, Pmat, TS_IJacobian, <void*>context))
 *         else:
 *             CHKERR(TSRHSSplitSetIJacobian(self.ts, cname, Jmat, Pmat, NULL, NULL))             # <<<<<<<<<<<<<<
 * 
 *     # --- solution vector ---
*/
  /*else*/ {
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSRHSSplitSetIJacobian(__pyx_v_self->ts, __pyx_v_cname, __pyx_v_Jmat, __pyx_v_Pmat, NULL, NULL)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1408, __pyx_L1_error)
  }
  __pyx_L5:;

  /* "petsc4py/PETSc/TS.pyx":1361
 *             CHKERR(TSRHSSplitSetIFunction(self.ts, cname, rvec, NULL, NULL))
 * 
 *     def setRHSSplitIJacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         splitname: str,
*/

  /* 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_AddTraceback("petsc4py.PETSc.TS.setRHSSplitIJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_context);
  __Pyx_XDECREF(__pyx_v_splitname);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kargs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TS.pyx":1412
 *     # --- solution vector ---
 * 
 *     def setSolution(self, Vec u) -> None:             # <<<<<<<<<<<<<<
 *         """Set the initial solution vector.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_105setSolution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_104setSolution, "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:1412");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_105setSolution = {"setSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_105setSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_104setSolution};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_105setSolution(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_u,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1412, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1412, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSolution", 0) < (0)) __PYX_ERR(51, 1412, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSolution", 1, 1, 1, i); __PYX_ERR(51, 1412, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1412, __pyx_L3_error)
    }
    __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, 1412, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "u", 0))) __PYX_ERR(51, 1412, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_104setSolution(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_u);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_104setSolution(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1427
 * 
 *         """
 *         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, 1427, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1412
 *     # --- 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":1429
 *         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_107getSolution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_106getSolution, "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:1429");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_107getSolution = {"getSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_107getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_106getSolution};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_107getSolution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSolution", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_106getSolution(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_106getSolution(struct PyPetscTSObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_u = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getSolution", 0);

  /* "petsc4py/PETSc/TS.pyx":1443
 * 
 *         """
 *         cdef Vec u = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetSolution(self.ts, &u.vec))
 *         CHKERR(PetscINCREF(u.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1443, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_u = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1444
 *         """
 *         cdef Vec u = Vec()
 *         CHKERR(TSGetSolution(self.ts, &u.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(u.obj))
 *         return u
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetSolution(__pyx_v_self->ts, (&__pyx_v_u->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1444, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1445
 *         cdef Vec u = Vec()
 *         CHKERR(TSGetSolution(self.ts, &u.vec))
 *         CHKERR(PetscINCREF(u.obj))             # <<<<<<<<<<<<<<
 *         return u
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_u->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1445, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1446
 *         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":1429
 *         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_XDECREF(__pyx_t_2);
  __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":1448
 *         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_109setSolution2(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_108setSolution2, "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:1448");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_109setSolution2 = {"setSolution2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_109setSolution2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_108setSolution2};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_109setSolution2(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_u,&__pyx_mstate_global->__pyx_n_u_v,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1448, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1448, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1448, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSolution2", 0) < (0)) __PYX_ERR(51, 1448, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSolution2", 1, 2, 2, i); __PYX_ERR(51, 1448, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1448, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 1448, __pyx_L3_error)
    }
    __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, 1448, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "u", 0))) __PYX_ERR(51, 1448, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "v", 0))) __PYX_ERR(51, 1448, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_108setSolution2(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_u, __pyx_v_v);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_108setSolution2(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1465
 * 
 *         """
 *         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, 1465, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1448
 *         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":1467
 *         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_111getSolution2(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_110getSolution2, "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:1467");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_111getSolution2 = {"getSolution2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_111getSolution2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_110getSolution2};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_111getSolution2(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSolution2", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_110getSolution2(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_110getSolution2(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getSolution2", 0);

  /* "petsc4py/PETSc/TS.pyx":1481
 * 
 *         """
 *         cdef Vec u = Vec()             # <<<<<<<<<<<<<<
 *         cdef Vec v = Vec()
 *         CHKERR(TS2GetSolution(self.ts, &u.vec, &v.vec))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1481, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_u = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1482
 *         """
 *         cdef Vec u = Vec()
 *         cdef Vec v = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(TS2GetSolution(self.ts, &u.vec, &v.vec))
 *         CHKERR(PetscINCREF(u.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1482, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_v = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1483
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TS2GetSolution(__pyx_v_self->ts, (&__pyx_v_u->vec), (&__pyx_v_v->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1483, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1484
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_u->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1484, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1485
 *         CHKERR(TS2GetSolution(self.ts, &u.vec, &v.vec))
 *         CHKERR(PetscINCREF(u.obj))
 *         CHKERR(PetscINCREF(v.obj))             # <<<<<<<<<<<<<<
 *         return (u, v)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_v->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1485, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1486
 *         CHKERR(PetscINCREF(u.obj))
 *         CHKERR(PetscINCREF(v.obj))
 *         return (u, v)             # <<<<<<<<<<<<<<
 * 
 *     # --- evaluation times ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1486, __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)) != (0)) __PYX_ERR(51, 1486, __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)) != (0)) __PYX_ERR(51, 1486, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1467
 *         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_XDECREF(__pyx_t_2);
  __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":1490
 *     # --- evaluation times ---
 * 
 *     def setEvaluationTimes(self, tspan: Sequence[float]) -> None:             # <<<<<<<<<<<<<<
 *         """Sets evaluation points where solution will be computed and stored.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_113setEvaluationTimes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_112setEvaluationTimes, "TS.setEvaluationTimes(self, tspan: Sequence[float]) -> None\nSets evaluation points where solution will be computed and stored.\n\n        Collective.\n\n        The solution will be computed and stored for each time\n        requested. 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 `getEvaluationSolutions`.\n\n        Parameters\n        ----------\n        tspan\n            The sequence of time points. The first element and the last element\n            are the initial time and the final time respectively.\n\n        Notes\n        -----\n        ``-ts_eval_times <t0, ..., tn>`` sets the time span from the commandline\n\n        See Also\n        --------\n        getEvaluationTimes, petsc.TSGetEvaluationTimes\n\n        \nSource code at petsc4py/PETSc/TS.pyx:1490");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_113setEvaluationTimes = {"setEvaluationTimes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_113setEvaluationTimes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_112setEvaluationTimes};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_113setEvaluationTimes(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("setEvaluationTimes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tspan,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1490, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setEvaluationTimes", 0) < (0)) __PYX_ERR(51, 1490, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setEvaluationTimes", 1, 1, 1, i); __PYX_ERR(51, 1490, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1490, __pyx_L3_error)
    }
    __pyx_v_tspan = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setEvaluationTimes", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1490, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TS.setEvaluationTimes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_112setEvaluationTimes(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_tspan);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_112setEvaluationTimes(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_tspan) {
  PetscInt __pyx_v_nt;
  PetscReal *__pyx_v_rtspan;
  CYTHON_UNUSED PyObject *__pyx_v_unused = 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("setEvaluationTimes", 0);

  /* "petsc4py/PETSc/TS.pyx":1518
 * 
 *         """
 *         cdef PetscInt  nt = 0             # <<<<<<<<<<<<<<
 *         cdef PetscReal *rtspan = NULL
 *         cdef unused = oarray_r(tspan, &nt, &rtspan)
*/
  __pyx_v_nt = 0;

  /* "petsc4py/PETSc/TS.pyx":1519
 *         """
 *         cdef PetscInt  nt = 0
 *         cdef PetscReal *rtspan = NULL             # <<<<<<<<<<<<<<
 *         cdef unused = oarray_r(tspan, &nt, &rtspan)
 *         CHKERR(TSSetEvaluationTimes(self.ts, nt, rtspan))
*/
  __pyx_v_rtspan = NULL;

  /* "petsc4py/PETSc/TS.pyx":1520
 *         cdef PetscInt  nt = 0
 *         cdef PetscReal *rtspan = NULL
 *         cdef unused = oarray_r(tspan, &nt, &rtspan)             # <<<<<<<<<<<<<<
 *         CHKERR(TSSetEvaluationTimes(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, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_unused = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1521
 *         cdef PetscReal *rtspan = NULL
 *         cdef unused = oarray_r(tspan, &nt, &rtspan)
 *         CHKERR(TSSetEvaluationTimes(self.ts, nt, rtspan))             # <<<<<<<<<<<<<<
 * 
 *     def getEvaluationTimes(self) -> ArrayReal:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSetEvaluationTimes(__pyx_v_self->ts, __pyx_v_nt, __pyx_v_rtspan)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1521, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1490
 *     # --- evaluation times ---
 * 
 *     def setEvaluationTimes(self, tspan: Sequence[float]) -> None:             # <<<<<<<<<<<<<<
 *         """Sets evaluation points where solution will be computed and stored.
 * 
*/

  /* 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.setEvaluationTimes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TS.pyx":1523
 *         CHKERR(TSSetEvaluationTimes(self.ts, nt, rtspan))
 * 
 *     def getEvaluationTimes(self) -> ArrayReal:             # <<<<<<<<<<<<<<
 *         """Return the evaluation points.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_115getEvaluationTimes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_114getEvaluationTimes, "TS.getEvaluationTimes(self) -> ArrayReal\nReturn the evaluation points.\n\n        Not collective.\n\n        See Also\n        --------\n        setEvaluationTimes\n\n        \nSource code at petsc4py/PETSc/TS.pyx:1523");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_115getEvaluationTimes = {"getEvaluationTimes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_115getEvaluationTimes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_114getEvaluationTimes};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_115getEvaluationTimes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getEvaluationTimes (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getEvaluationTimes", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getEvaluationTimes", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_114getEvaluationTimes(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_114getEvaluationTimes(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("getEvaluationTimes", 0);

  /* "petsc4py/PETSc/TS.pyx":1533
 * 
 *         """
 *         cdef const PetscReal *rtspan = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt   nt = 0
 *         CHKERR(TSGetEvaluationTimes(self.ts, &nt, &rtspan))
*/
  __pyx_v_rtspan = NULL;

  /* "petsc4py/PETSc/TS.pyx":1534
 *         """
 *         cdef const PetscReal *rtspan = NULL
 *         cdef PetscInt   nt = 0             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetEvaluationTimes(self.ts, &nt, &rtspan))
 *         cdef object tspan = array_r(nt, rtspan)
*/
  __pyx_v_nt = 0;

  /* "petsc4py/PETSc/TS.pyx":1535
 *         cdef const PetscReal *rtspan = NULL
 *         cdef PetscInt   nt = 0
 *         CHKERR(TSGetEvaluationTimes(self.ts, &nt, &rtspan))             # <<<<<<<<<<<<<<
 *         cdef object tspan = array_r(nt, rtspan)
 *         return tspan
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetEvaluationTimes(__pyx_v_self->ts, (&__pyx_v_nt), (&__pyx_v_rtspan))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1535, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1536
 *         cdef PetscInt   nt = 0
 *         CHKERR(TSGetEvaluationTimes(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, 1536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_tspan = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/TS.pyx":1537
 *         CHKERR(TSGetEvaluationTimes(self.ts, &nt, &rtspan))
 *         cdef object tspan = array_r(nt, rtspan)
 *         return tspan             # <<<<<<<<<<<<<<
 * 
 *     def getEvaluationSolutions(self) -> tuple[ArrayReal, list[Vec]]:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_tspan);
  __pyx_r = __pyx_v_tspan;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1523
 *         CHKERR(TSSetEvaluationTimes(self.ts, nt, rtspan))
 * 
 *     def getEvaluationTimes(self) -> ArrayReal:             # <<<<<<<<<<<<<<
 *         """Return the evaluation points.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.TS.getEvaluationTimes", __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":1539
 *         return tspan
 * 
 *     def getEvaluationSolutions(self) -> tuple[ArrayReal, list[Vec]]:             # <<<<<<<<<<<<<<
 *         """Return the solutions and the times they were recorded at.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_117getEvaluationSolutions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_116getEvaluationSolutions, "TS.getEvaluationSolutions(self) -> tuple[ArrayReal, list[Vec]]\nReturn the solutions and the times they were recorded at.\n\n        Not collective.\n\n        See Also\n        --------\n        setEvaluationTimes\n\n        \nSource code at petsc4py/PETSc/TS.pyx:1539");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_117getEvaluationSolutions = {"getEvaluationSolutions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_117getEvaluationSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_116getEvaluationSolutions};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_117getEvaluationSolutions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getEvaluationSolutions (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getEvaluationSolutions", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getEvaluationSolutions", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_116getEvaluationSolutions(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_116getEvaluationSolutions(struct PyPetscTSObject *__pyx_v_self) {
  PetscInt __pyx_v_nt;
  Vec *__pyx_v_sols;
  PetscReal const *__pyx_v_rtspan;
  PyObject *__pyx_v_sollist = 0;
  PyObject *__pyx_v_tspan = 0;
  long __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("getEvaluationSolutions", 0);

  /* "petsc4py/PETSc/TS.pyx":1549
 * 
 *         """
 *         cdef PetscInt nt = 0             # <<<<<<<<<<<<<<
 *         cdef PetscVec *sols = NULL
 *         cdef const PetscReal *rtspan = NULL
*/
  __pyx_v_nt = 0;

  /* "petsc4py/PETSc/TS.pyx":1550
 *         """
 *         cdef PetscInt nt = 0
 *         cdef PetscVec *sols = NULL             # <<<<<<<<<<<<<<
 *         cdef const PetscReal *rtspan = NULL
 *         CHKERR(TSGetEvaluationSolutions(self.ts, &nt, &rtspan, &sols))
*/
  __pyx_v_sols = NULL;

  /* "petsc4py/PETSc/TS.pyx":1551
 *         cdef PetscInt nt = 0
 *         cdef PetscVec *sols = NULL
 *         cdef const PetscReal *rtspan = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetEvaluationSolutions(self.ts, &nt, &rtspan, &sols))
 *         cdef object sollist = None
*/
  __pyx_v_rtspan = NULL;

  /* "petsc4py/PETSc/TS.pyx":1552
 *         cdef PetscVec *sols = NULL
 *         cdef const PetscReal *rtspan = NULL
 *         CHKERR(TSGetEvaluationSolutions(self.ts, &nt, &rtspan, &sols))             # <<<<<<<<<<<<<<
 *         cdef object sollist = None
 *         if sols != NULL:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetEvaluationSolutions(__pyx_v_self->ts, (&__pyx_v_nt), (&__pyx_v_rtspan), (&__pyx_v_sols))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1552, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1553
 *         cdef const PetscReal *rtspan = NULL
 *         CHKERR(TSGetEvaluationSolutions(self.ts, &nt, &rtspan, &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":1554
 *         CHKERR(TSGetEvaluationSolutions(self.ts, &nt, &rtspan, &sols))
 *         cdef object sollist = None
 *         if sols != NULL:             # <<<<<<<<<<<<<<
 *             sollist = [ref_Vec(sols[i]) for i from 0 <= i < nt]
 *         cdef object tspan = array_r(nt, rtspan)
*/
  __pyx_t_2 = (__pyx_v_sols != NULL);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/TS.pyx":1555
 *         cdef object sollist = None
 *         if sols != NULL:
 *             sollist = [ref_Vec(sols[i]) for i from 0 <= i < nt]             # <<<<<<<<<<<<<<
 *         cdef object tspan = array_r(nt, rtspan)
 *         return tspan, sollist
*/
    { /* enter inner scope */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_v_nt;
      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_sols[__pyx_9genexpr13__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1555, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(51, 1555, __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":1554
 *         CHKERR(TSGetEvaluationSolutions(self.ts, &nt, &rtspan, &sols))
 *         cdef object sollist = None
 *         if sols != NULL:             # <<<<<<<<<<<<<<
 *             sollist = [ref_Vec(sols[i]) for i from 0 <= i < nt]
 *         cdef object tspan = array_r(nt, rtspan)
*/
  }

  /* "petsc4py/PETSc/TS.pyx":1556
 *         if sols != NULL:
 *             sollist = [ref_Vec(sols[i]) for i from 0 <= i < nt]
 *         cdef object tspan = array_r(nt, rtspan)             # <<<<<<<<<<<<<<
 *         return tspan, sollist
 * 
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_array_r(__pyx_v_nt, __pyx_v_rtspan)); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_tspan = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TS.pyx":1557
 *             sollist = [ref_Vec(sols[i]) for i from 0 <= i < nt]
 *         cdef object tspan = array_r(nt, rtspan)
 *         return tspan, sollist             # <<<<<<<<<<<<<<
 * 
 *     # --- time span ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 1557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_tspan);
  __Pyx_GIVEREF(__pyx_v_tspan);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tspan) != (0)) __PYX_ERR(51, 1557, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_sollist);
  __Pyx_GIVEREF(__pyx_v_sollist);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_sollist) != (0)) __PYX_ERR(51, 1557, __pyx_L1_error);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1539
 *         return tspan
 * 
 *     def getEvaluationSolutions(self) -> tuple[ArrayReal, list[Vec]]:             # <<<<<<<<<<<<<<
 *         """Return the solutions and the times they were recorded at.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("petsc4py.PETSc.TS.getEvaluationSolutions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sollist);
  __Pyx_XDECREF(__pyx_v_tspan);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TS.pyx":1561
 *     # --- time span ---
 * 
 *     def setTimeSpan(self, tspan: Sequence[float]) -> None:             # <<<<<<<<<<<<<<
 *         """Set the time span and time points to evaluate solution at.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_119setTimeSpan(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_118setTimeSpan, "TS.setTimeSpan(self, tspan: Sequence[float]) -> None\nSet the time span and time points to evaluate solution at.\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 `getEvaluationSolutions`.\n\n        Parameters\n        ----------\n        tspan\n            The sequence of time points. The first element and the last element\n            are the initial time and the final time respectively.\n\n        Notes\n        -----\n        ``-ts_time_span <t0, ..., tf>`` sets the time span from the commandline\n\n        See Also\n        --------\n        setEvaluationTimes, petsc.TSSetTimeSpan\n\n        \nSource code at petsc4py/PETSc/TS.pyx:1561");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_119setTimeSpan = {"setTimeSpan", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_119setTimeSpan, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_118setTimeSpan};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_119setTimeSpan(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tspan,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1561, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTimeSpan", 0) < (0)) __PYX_ERR(51, 1561, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setTimeSpan", 1, 1, 1, i); __PYX_ERR(51, 1561, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1561, __pyx_L3_error)
    }
    __pyx_v_tspan = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setTimeSpan", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1561, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_118setTimeSpan(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_tspan);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_118setTimeSpan(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_tspan) {
  PetscInt __pyx_v_nt;
  PetscReal *__pyx_v_rtspan;
  CYTHON_UNUSED PyObject *__pyx_v_unused = 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", 0);

  /* "petsc4py/PETSc/TS.pyx":1589
 * 
 *         """
 *         cdef PetscInt  nt = 0             # <<<<<<<<<<<<<<
 *         cdef PetscReal *rtspan = NULL
 *         cdef unused = oarray_r(tspan, &nt, &rtspan)
*/
  __pyx_v_nt = 0;

  /* "petsc4py/PETSc/TS.pyx":1590
 *         """
 *         cdef PetscInt  nt = 0
 *         cdef PetscReal *rtspan = NULL             # <<<<<<<<<<<<<<
 *         cdef unused = oarray_r(tspan, &nt, &rtspan)
 *         CHKERR(TSSetTimeSpan(self.ts, nt, rtspan))
*/
  __pyx_v_rtspan = NULL;

  /* "petsc4py/PETSc/TS.pyx":1591
 *         cdef PetscInt  nt = 0
 *         cdef PetscReal *rtspan = NULL
 *         cdef unused = 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, 1591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_unused = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1592
 *         cdef PetscReal *rtspan = NULL
 *         cdef unused = oarray_r(tspan, &nt, &rtspan)
 *         CHKERR(TSSetTimeSpan(self.ts, nt, rtspan))             # <<<<<<<<<<<<<<
 * 
 *     getTimeSpan = getEvaluationTimes
*/
  __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, 1592, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1561
 *     # --- time span ---
 * 
 *     def setTimeSpan(self, tspan: Sequence[float]) -> None:             # <<<<<<<<<<<<<<
 *         """Set the time span and time points to evaluate solution at.
 * 
*/

  /* 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_unused);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TS.pyx":1596
 *     getTimeSpan = getEvaluationTimes
 * 
 *     def getTimeSpanSolutions(self) -> list[Vec]:             # <<<<<<<<<<<<<<
 *         """Return the solutions at the times in the time span. Deprecated.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_121getTimeSpanSolutions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_120getTimeSpanSolutions, "TS.getTimeSpanSolutions(self) -> list[Vec]\nReturn the solutions at the times in the time span. Deprecated.\n\n        Not collective.\n\n        See Also\n        --------\n        setTimeSpan, setEvaluationTimes, getEvaluationSolutions\n\n        \nSource code at petsc4py/PETSc/TS.pyx:1596");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_121getTimeSpanSolutions = {"getTimeSpanSolutions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_121getTimeSpanSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_120getTimeSpanSolutions};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_121getTimeSpanSolutions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTimeSpanSolutions", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_120getTimeSpanSolutions(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_120getTimeSpanSolutions(struct PyPetscTSObject *__pyx_v_self) {
  PetscInt __pyx_v_nt;
  Vec *__pyx_v_sols;
  PyObject *__pyx_v_sollist = 0;
  long __pyx_9genexpr14__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", 0);

  /* "petsc4py/PETSc/TS.pyx":1606
 * 
 *         """
 *         cdef PetscInt nt = 0             # <<<<<<<<<<<<<<
 *         cdef PetscVec *sols = NULL
 *         CHKERR(TSGetEvaluationSolutions(self.ts, &nt, NULL, &sols))
*/
  __pyx_v_nt = 0;

  /* "petsc4py/PETSc/TS.pyx":1607
 *         """
 *         cdef PetscInt nt = 0
 *         cdef PetscVec *sols = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetEvaluationSolutions(self.ts, &nt, NULL, &sols))
 *         cdef object sollist = None
*/
  __pyx_v_sols = NULL;

  /* "petsc4py/PETSc/TS.pyx":1608
 *         cdef PetscInt nt = 0
 *         cdef PetscVec *sols = NULL
 *         CHKERR(TSGetEvaluationSolutions(self.ts, &nt, NULL, &sols))             # <<<<<<<<<<<<<<
 *         cdef object sollist = None
 *         if sols != NULL:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetEvaluationSolutions(__pyx_v_self->ts, (&__pyx_v_nt), NULL, (&__pyx_v_sols))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1608, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1609
 *         cdef PetscVec *sols = NULL
 *         CHKERR(TSGetEvaluationSolutions(self.ts, &nt, NULL, &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":1610
 *         CHKERR(TSGetEvaluationSolutions(self.ts, &nt, NULL, &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":1611
 *         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, 1611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_v_nt;
      for (__pyx_9genexpr14__pyx_v_i = 0; __pyx_9genexpr14__pyx_v_i < __pyx_t_4; __pyx_9genexpr14__pyx_v_i++) {
        __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec((__pyx_v_sols[__pyx_9genexpr14__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(51, 1611, __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":1610
 *         CHKERR(TSGetEvaluationSolutions(self.ts, &nt, NULL, &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":1612
 *         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":1596
 *     getTimeSpan = getEvaluationTimes
 * 
 *     def getTimeSpanSolutions(self) -> list[Vec]:             # <<<<<<<<<<<<<<
 *         """Return the solutions at the times in the time span. Deprecated.
 * 
*/

  /* 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":1616
 *     # --- inner solver ---
 * 
 *     def getSNES(self) -> SNES:             # <<<<<<<<<<<<<<
 *         """Return the `SNES` associated with the `TS`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_123getSNES(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_122getSNES, "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:1616");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_123getSNES = {"getSNES", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_123getSNES, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_122getSNES};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_123getSNES(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSNES", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_122getSNES(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_122getSNES(struct PyPetscTSObject *__pyx_v_self) {
  struct PyPetscSNESObject *__pyx_v_snes = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getSNES", 0);

  /* "petsc4py/PETSc/TS.pyx":1626
 * 
 *         """
 *         cdef SNES snes = SNES()             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetSNES(self.ts, &snes.snes))
 *         CHKERR(PetscINCREF(snes.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1626, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_snes = ((struct PyPetscSNESObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1627
 *         """
 *         cdef SNES snes = SNES()
 *         CHKERR(TSGetSNES(self.ts, &snes.snes))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(snes.obj))
 *         return snes
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetSNES(__pyx_v_self->ts, (&__pyx_v_snes->snes))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1627, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1628
 *         cdef SNES snes = SNES()
 *         CHKERR(TSGetSNES(self.ts, &snes.snes))
 *         CHKERR(PetscINCREF(snes.obj))             # <<<<<<<<<<<<<<
 *         return snes
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_snes->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1628, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1629
 *         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":1616
 *     # --- 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_XDECREF(__pyx_t_2);
  __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":1631
 *         return snes
 * 
 *     def getKSP(self) -> KSP:             # <<<<<<<<<<<<<<
 *         """Return the `KSP` associated with the `TS`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_125getKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_124getKSP, "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:1631");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_125getKSP = {"getKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_125getKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_124getKSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_125getKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getKSP", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_124getKSP(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_124getKSP(struct PyPetscTSObject *__pyx_v_self) {
  struct PyPetscKSPObject *__pyx_v_ksp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getKSP", 0);

  /* "petsc4py/PETSc/TS.pyx":1641
 * 
 *         """
 *         cdef KSP ksp = KSP()             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetKSP(self.ts, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 1641, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":1642
 *         """
 *         cdef KSP ksp = KSP()
 *         CHKERR(TSGetKSP(self.ts, &ksp.ksp))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(ksp.obj))
 *         return ksp
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetKSP(__pyx_v_self->ts, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1642, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1643
 *         cdef KSP ksp = KSP()
 *         CHKERR(TSGetKSP(self.ts, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))             # <<<<<<<<<<<<<<
 *         return ksp
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 1643, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1644
 *         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":1631
 *         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_XDECREF(__pyx_t_2);
  __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":1648
 *     # --- discretization space ---
 * 
 *     def getDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the `DM` associated with the `TS`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_127getDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_126getDM, "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:1648");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_127getDM = {"getDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_127getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_126getDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_127getDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDM", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_126getDM(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_126getDM(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDM", 0);

  /* "petsc4py/PETSc/TS.pyx":1661
 * 
 *         """
 *         cdef PetscDM newdm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetDM(self.ts, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()
*/
  __pyx_v_newdm = NULL;

  /* "petsc4py/PETSc/TS.pyx":1662
 *         """
 *         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, 1662, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1663
 *         cdef PetscDM newdm = NULL
 *         CHKERR(TSGetDM(self.ts, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()             # <<<<<<<<<<<<<<
 *         dm.dm = newdm
 *         CHKERR(PetscINCREF(dm.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 1663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(51, 1663, __pyx_L1_error)
  __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/TS.pyx":1664
 *         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":1665
 *         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, 1665, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1666
 *         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":1648
 *     # --- 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_XDECREF(__pyx_t_4);
  __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":1668
 *         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_129setDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_128setDM, "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:1668");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_129setDM = {"setDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_129setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_128setDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_129setDM(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1668, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1668, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDM", 0) < (0)) __PYX_ERR(51, 1668, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, i); __PYX_ERR(51, 1668, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1668, __pyx_L3_error)
    }
    __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, 1668, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(51, 1668, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_128setDM(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_dm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_128setDM(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1683
 * 
 *         """
 *         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, 1683, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1668
 *         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":1687
 *     # --- customization ---
 * 
 *     def setTime(self, t: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the time.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_131setTime(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_130setTime, "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:1687");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_131setTime = {"setTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_131setTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_130setTime};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_131setTime(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1687, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1687, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTime", 0) < (0)) __PYX_ERR(51, 1687, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setTime", 1, 1, 1, i); __PYX_ERR(51, 1687, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1687, __pyx_L3_error)
    }
    __pyx_v_t = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setTime", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1687, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_130setTime(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_130setTime(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1702
 * 
 *         """
 *         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, 1702, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":1703
 *         """
 *         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, 1703, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1687
 *     # --- 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":1705
 *         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_133getTime(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_132getTime, "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:1705");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_133getTime = {"getTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_133getTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_132getTime};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_133getTime(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTime", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_132getTime(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_132getTime(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1719
 * 
 *         """
 *         cdef PetscReal rval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetTime(self.ts, &rval))
 *         return toReal(rval)
*/
  __pyx_v_rval = 0.0;

  /* "petsc4py/PETSc/TS.pyx":1720
 *         """
 *         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, 1720, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1721
 *         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, 1721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1705
 *         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":1723
 *         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_135getPrevTime(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_134getPrevTime, "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:1723");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_135getPrevTime = {"getPrevTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_135getPrevTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_134getPrevTime};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_135getPrevTime(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPrevTime", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_134getPrevTime(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_134getPrevTime(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1733
 * 
 *         """
 *         cdef PetscReal rval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetPrevTime(self.ts, &rval))
 *         return toReal(rval)
*/
  __pyx_v_rval = 0.0;

  /* "petsc4py/PETSc/TS.pyx":1734
 *         """
 *         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, 1734, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1735
 *         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, 1735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1723
 *         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":1737
 *         return toReal(rval)
 * 
 *     def getSolveTime(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the time after a call to `solve`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_137getSolveTime(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_136getSolveTime, "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:1737");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_137getSolveTime = {"getSolveTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_137getSolveTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_136getSolveTime};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_137getSolveTime(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSolveTime", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_136getSolveTime(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_136getSolveTime(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1750
 * 
 *         """
 *         cdef PetscReal rval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetSolveTime(self.ts, &rval))
 *         return toReal(rval)
*/
  __pyx_v_rval = 0.0;

  /* "petsc4py/PETSc/TS.pyx":1751
 *         """
 *         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, 1751, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1752
 *         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, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1737
 *         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":1754
 *         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_139setTimeStep(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_138setTimeStep, "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:1754");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_139setTimeStep = {"setTimeStep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_139setTimeStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_138setTimeStep};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_139setTimeStep(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_time_step,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1754, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1754, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTimeStep", 0) < (0)) __PYX_ERR(51, 1754, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setTimeStep", 1, 1, 1, i); __PYX_ERR(51, 1754, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1754, __pyx_L3_error)
    }
    __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, 1754, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_138setTimeStep(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_time_step);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_138setTimeStep(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1769
 * 
 *         """
 *         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, 1769, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":1770
 *         """
 *         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, 1770, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1754
 *         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":1772
 *         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_141getTimeStep(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_140getTimeStep, "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:1772");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_141getTimeStep = {"getTimeStep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_141getTimeStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_140getTimeStep};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_141getTimeStep(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTimeStep", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_140getTimeStep(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_140getTimeStep(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1782
 * 
 *         """
 *         cdef PetscReal tstep = 0             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetTimeStep(self.ts, &tstep))
 *         return toReal(tstep)
*/
  __pyx_v_tstep = 0.0;

  /* "petsc4py/PETSc/TS.pyx":1783
 *         """
 *         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, 1783, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1784
 *         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, 1784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1772
 *         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":1786
 *         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_143setStepNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_142setStepNumber, "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:1786");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_143setStepNumber = {"setStepNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_143setStepNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_142setStepNumber};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_143setStepNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_step_number,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1786, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1786, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setStepNumber", 0) < (0)) __PYX_ERR(51, 1786, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setStepNumber", 1, 1, 1, i); __PYX_ERR(51, 1786, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1786, __pyx_L3_error)
    }
    __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, 1786, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_142setStepNumber(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_step_number);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_142setStepNumber(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1810
 * 
 *         """
 *         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, 1810, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":1811
 *         """
 *         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, 1811, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1786
 *         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":1813
 *         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_145getStepNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_144getStepNumber, "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:1813");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_145getStepNumber = {"getStepNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_145getStepNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_144getStepNumber};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_145getStepNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getStepNumber", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_144getStepNumber(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_144getStepNumber(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1823
 * 
 *         """
 *         cdef PetscInt ival = 0             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetStepNumber(self.ts, &ival))
 *         return toInt(ival)
*/
  __pyx_v_ival = 0;

  /* "petsc4py/PETSc/TS.pyx":1824
 *         """
 *         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, 1824, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1825
 *         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, 1825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1813
 *         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":1827
 *         return toInt(ival)
 * 
 *     def setMaxTime(self, max_time: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum (final) time.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_147setMaxTime(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_146setMaxTime, "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:1827");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_147setMaxTime = {"setMaxTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_147setMaxTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_146setMaxTime};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_147setMaxTime(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_max_time,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1827, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1827, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMaxTime", 0) < (0)) __PYX_ERR(51, 1827, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMaxTime", 1, 1, 1, i); __PYX_ERR(51, 1827, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1827, __pyx_L3_error)
    }
    __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, 1827, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_146setMaxTime(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_max_time);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_146setMaxTime(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1846
 * 
 *         """
 *         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, 1846, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":1847
 *         """
 *         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, 1847, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1827
 *         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":1849
 *         CHKERR(TSSetMaxTime(self.ts, rval))
 * 
 *     def getMaxTime(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the maximum (final) time.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_149getMaxTime(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_148getMaxTime, "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:1849");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_149getMaxTime = {"getMaxTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_149getMaxTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_148getMaxTime};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_149getMaxTime(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMaxTime", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_148getMaxTime(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_148getMaxTime(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1861
 * 
 *         """
 *         cdef PetscReal rval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetMaxTime(self.ts, &rval))
 *         return toReal(rval)
*/
  __pyx_v_rval = 0.0;

  /* "petsc4py/PETSc/TS.pyx":1862
 *         """
 *         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, 1862, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1863
 *         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, 1863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1849
 *         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":1865
 *         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_151setMaxSteps(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_150setMaxSteps, "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:1865");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_151setMaxSteps = {"setMaxSteps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_151setMaxSteps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_150setMaxSteps};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_151setMaxSteps(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_max_steps,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1865, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1865, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMaxSteps", 0) < (0)) __PYX_ERR(51, 1865, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMaxSteps", 1, 1, 1, i); __PYX_ERR(51, 1865, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1865, __pyx_L3_error)
    }
    __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, 1865, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_150setMaxSteps(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_max_steps);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_150setMaxSteps(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1882
 * 
 *         """
 *         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, 1882, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":1883
 *         """
 *         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, 1883, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1865
 *         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":1885
 *         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_153getMaxSteps(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_152getMaxSteps, "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:1885");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_153getMaxSteps = {"getMaxSteps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_153getMaxSteps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_152getMaxSteps};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_153getMaxSteps(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMaxSteps", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_152getMaxSteps(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_152getMaxSteps(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1895
 * 
 *         """
 *         cdef PetscInt ival = 0             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetMaxSteps(self.ts, &ival))
 *         return toInt(ival)
*/
  __pyx_v_ival = 0;

  /* "petsc4py/PETSc/TS.pyx":1896
 *         """
 *         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, 1896, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1897
 *         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, 1897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1885
 *         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":1899
 *         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_155getSNESIterations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_154getSNESIterations, "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:1899");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_155getSNESIterations = {"getSNESIterations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_155getSNESIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_154getSNESIterations};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_155getSNESIterations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSNESIterations", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_154getSNESIterations(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_154getSNESIterations(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1912
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetSNESIterations(self.ts, &n))
 *         return toInt(n)
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/TS.pyx":1913
 *         """
 *         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, 1913, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1914
 *         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, 1914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1899
 *         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":1916
 *         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_157getKSPIterations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_156getKSPIterations, "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:1916");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_157getKSPIterations = {"getKSPIterations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_157getKSPIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_156getKSPIterations};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_157getKSPIterations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getKSPIterations", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_156getKSPIterations(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_156getKSPIterations(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1929
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetKSPIterations(self.ts, &n))
 *         return toInt(n)
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/TS.pyx":1930
 *         """
 *         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, 1930, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1931
 *         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, 1931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1916
 *         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":1933
 *         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_159setMaxStepRejections(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_158setMaxStepRejections, "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_step_rejections`` 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:1933");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_159setMaxStepRejections = {"setMaxStepRejections", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_159setMaxStepRejections, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_158setMaxStepRejections};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_159setMaxStepRejections(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1933, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1933, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMaxStepRejections", 0) < (0)) __PYX_ERR(51, 1933, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMaxStepRejections", 1, 1, 1, i); __PYX_ERR(51, 1933, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1933, __pyx_L3_error)
    }
    __pyx_v_n = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setMaxStepRejections", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1933, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_158setMaxStepRejections(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_n);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_158setMaxStepRejections(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1952
 * 
 *         """
 *         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, 1952, __pyx_L1_error)
  __pyx_v_rej = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":1953
 *         """
 *         cdef PetscInt rej = asInt(n)
 *         CHKERR(TSSetMaxStepRejections(self.ts, rej))             # <<<<<<<<<<<<<<
 * 
 *     def getStepRejections(self) -> int:
*/
  __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, 1953, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1933
 *         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":1955
 *         CHKERR(TSSetMaxStepRejections(self.ts, rej))
 * 
 *     def getStepRejections(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the total number of rejected steps.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_161getStepRejections(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_160getStepRejections, "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:1955");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_161getStepRejections = {"getStepRejections", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_161getStepRejections, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_160getStepRejections};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_161getStepRejections(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getStepRejections", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_160getStepRejections(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_160getStepRejections(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1968
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetStepRejections(self.ts, &n))
 *         return toInt(n)
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/TS.pyx":1969
 *         """
 *         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, 1969, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1970
 *         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, 1970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1955
 *         CHKERR(TSSetMaxStepRejections(self.ts, rej))
 * 
 *     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":1972
 *         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_163setMaxSNESFailures(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_162setMaxSNESFailures, "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:1972");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_163setMaxSNESFailures = {"setMaxSNESFailures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_163setMaxSNESFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_162setMaxSNESFailures};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_163setMaxSNESFailures(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 1972, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1972, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMaxSNESFailures", 0) < (0)) __PYX_ERR(51, 1972, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMaxSNESFailures", 1, 1, 1, i); __PYX_ERR(51, 1972, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 1972, __pyx_L3_error)
    }
    __pyx_v_n = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setMaxSNESFailures", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 1972, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_162setMaxSNESFailures(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_n);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_162setMaxSNESFailures(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", 0);

  /* "petsc4py/PETSc/TS.pyx":1987
 * 
 *         """
 *         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, 1987, __pyx_L1_error)
  __pyx_v_fails = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":1988
 *         """
 *         cdef PetscInt fails = asInt(n)
 *         CHKERR(TSSetMaxSNESFailures(self.ts, fails))             # <<<<<<<<<<<<<<
 * 
 *     def getSNESFailures(self) -> int:
*/
  __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, 1988, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":1972
 *         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":1990
 *         CHKERR(TSSetMaxSNESFailures(self.ts, fails))
 * 
 *     def getSNESFailures(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the total number of failed `SNES` solves in the `TS`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_165getSNESFailures(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_164getSNESFailures, "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:1990");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_165getSNESFailures = {"getSNESFailures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_165getSNESFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_164getSNESFailures};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_165getSNESFailures(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSNESFailures", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_164getSNESFailures(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_164getSNESFailures(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2003
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetSNESFailures(self.ts, &n))
 *         return toInt(n)
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/TS.pyx":2004
 *         """
 *         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, 2004, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2005
 *         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, 2005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":1990
 *         CHKERR(TSSetMaxSNESFailures(self.ts, fails))
 * 
 *     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":2007
 *         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_167setErrorIfStepFails(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_166setErrorIfStepFails, "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:2007");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_167setErrorIfStepFails = {"setErrorIfStepFails", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_167setErrorIfStepFails, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_166setErrorIfStepFails};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_167setErrorIfStepFails(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2007, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2007, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setErrorIfStepFails", 0) < (0)) __PYX_ERR(51, 2007, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2007, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setErrorIfStepFails", 0, 0, 1, __pyx_nargs); __PYX_ERR(51, 2007, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_166setErrorIfStepFails(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_166setErrorIfStepFails(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2026
 * 
 *         """
 *         cdef PetscBool bval = flag             # <<<<<<<<<<<<<<
 *         CHKERR(TSSetErrorIfStepFails(self.ts, bval))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(51, 2026, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":2027
 *         """
 *         cdef PetscBool bval = flag
 *         CHKERR(TSSetErrorIfStepFails(self.ts, bval))             # <<<<<<<<<<<<<<
 * 
 *     def setTolerances(self, rtol: float | None = None, atol: float | None = 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, 2027, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2007
 *         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":2029
 *         CHKERR(TSSetErrorIfStepFails(self.ts, bval))
 * 
 *     def setTolerances(self, rtol: float | None = None, atol: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set tolerances for local truncation error when using an adaptive controller.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_169setTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_168setTolerances, "TS.setTolerances(self, rtol: float | None = None, atol: float | None = 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, `DETERMINE` to use the value\n            when the object's type was set, or `None` to leave the\n            current value.\n        atol\n            The absolute tolerance, `DETERMINE` to use the\n            value when the object's type was set, or `None` to\n            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:2029");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_169setTolerances = {"setTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_169setTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_168setTolerances};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_169setTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rtol,&__pyx_mstate_global->__pyx_n_u_atol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2029, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2029, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2029, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTolerances", 0) < (0)) __PYX_ERR(51, 2029, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2029, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2029, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2029, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_168setTolerances(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_rtol, __pyx_v_atol);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_168setTolerances(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2054
 * 
 *         """
 *         cdef PetscReal rrtol = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         cdef PetscReal ratol = PETSC_CURRENT
 *         cdef PetscVec  vrtol = NULL
*/
  __pyx_v_rrtol = PETSC_CURRENT;

  /* "petsc4py/PETSc/TS.pyx":2055
 *         """
 *         cdef PetscReal rrtol = PETSC_CURRENT
 *         cdef PetscReal ratol = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         cdef PetscVec  vrtol = NULL
 *         cdef PetscVec  vatol = NULL
*/
  __pyx_v_ratol = PETSC_CURRENT;

  /* "petsc4py/PETSc/TS.pyx":2056
 *         cdef PetscReal rrtol = PETSC_CURRENT
 *         cdef PetscReal ratol = PETSC_CURRENT
 *         cdef PetscVec  vrtol = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscVec  vatol = NULL
 *         if rtol is None:
*/
  __pyx_v_vrtol = NULL;

  /* "petsc4py/PETSc/TS.pyx":2057
 *         cdef PetscReal ratol = PETSC_CURRENT
 *         cdef PetscVec  vrtol = NULL
 *         cdef PetscVec  vatol = NULL             # <<<<<<<<<<<<<<
 *         if rtol is None:
 *             pass
*/
  __pyx_v_vatol = NULL;

  /* "petsc4py/PETSc/TS.pyx":2058
 *         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":2060
 *         if rtol is None:
 *             pass
 *         elif isinstance(rtol, Vec):             # <<<<<<<<<<<<<<
 *             vrtol = (<Vec>rtol).vec
 *         else:
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_rtol, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/TS.pyx":2061
 *             pass
 *         elif isinstance(rtol, Vec):
 *             vrtol = (<Vec>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":2060
 *         if rtol is None:
 *             pass
 *         elif isinstance(rtol, Vec):             # <<<<<<<<<<<<<<
 *             vrtol = (<Vec>rtol).vec
 *         else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/TS.pyx":2063
 *             vrtol = (<Vec>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, 2063, __pyx_L1_error)
    __pyx_v_rrtol = __pyx_t_3;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/TS.pyx":2064
 *         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":2066
 *         if atol is None:
 *             pass
 *         elif isinstance(atol, Vec):             # <<<<<<<<<<<<<<
 *             vatol = (<Vec>atol).vec
 *         else:
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_atol, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/TS.pyx":2067
 *             pass
 *         elif isinstance(atol, Vec):
 *             vatol = (<Vec>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":2066
 *         if atol is None:
 *             pass
 *         elif isinstance(atol, Vec):             # <<<<<<<<<<<<<<
 *             vatol = (<Vec>atol).vec
 *         else:
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/TS.pyx":2069
 *             vatol = (<Vec>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, 2069, __pyx_L1_error)
    __pyx_v_ratol = __pyx_t_3;
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/TS.pyx":2070
 *         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, 2070, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2029
 *         CHKERR(TSSetErrorIfStepFails(self.ts, bval))
 * 
 *     def setTolerances(self, rtol: float | None = None, atol: float | None = 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":2072
 *         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_171getTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_170getTolerances, "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:2072");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_171getTolerances = {"getTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_171getTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_170getTolerances};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_171getTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTolerances", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_170getTolerances(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_170getTolerances(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2089
 * 
 *         """
 *         cdef PetscReal rrtol = PETSC_DETERMINE             # <<<<<<<<<<<<<<
 *         cdef PetscReal ratol = PETSC_DETERMINE
 *         cdef PetscVec  vrtol = NULL
*/
  __pyx_v_rrtol = PETSC_DETERMINE;

  /* "petsc4py/PETSc/TS.pyx":2090
 *         """
 *         cdef PetscReal rrtol = PETSC_DETERMINE
 *         cdef PetscReal ratol = PETSC_DETERMINE             # <<<<<<<<<<<<<<
 *         cdef PetscVec  vrtol = NULL
 *         cdef PetscVec  vatol = NULL
*/
  __pyx_v_ratol = PETSC_DETERMINE;

  /* "petsc4py/PETSc/TS.pyx":2091
 *         cdef PetscReal rrtol = PETSC_DETERMINE
 *         cdef PetscReal ratol = PETSC_DETERMINE
 *         cdef PetscVec  vrtol = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscVec  vatol = NULL
 *         CHKERR(TSGetTolerances(self.ts, &ratol, &vatol, &rrtol, &vrtol))
*/
  __pyx_v_vrtol = NULL;

  /* "petsc4py/PETSc/TS.pyx":2092
 *         cdef PetscReal ratol = PETSC_DETERMINE
 *         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":2093
 *         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, 2093, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2094
 *         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":2095
 *         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":2096
 *         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, 2096, __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":2095
 *         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":2098
 *             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, 2098, __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":2099
 *         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":2100
 *             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":2101
 *         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, 2101, __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":2100
 *             rtol = toReal(rrtol)
 *         cdef object atol = None
 *         if vatol != NULL:             # <<<<<<<<<<<<<<
 *             atol = ref_Vec(vatol)
 *         else:
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/TS.pyx":2103
 *             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, 2103, __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":2104
 *         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, 2104, __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) != (0)) __PYX_ERR(51, 2104, __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) != (0)) __PYX_ERR(51, 2104, __pyx_L1_error);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":2072
 *         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":2106
 *         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_173setExactFinalTime(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_172setExactFinalTime, "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:2106");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_173setExactFinalTime = {"setExactFinalTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_173setExactFinalTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_172setExactFinalTime};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_173setExactFinalTime(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_option,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2106, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setExactFinalTime", 0) < (0)) __PYX_ERR(51, 2106, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setExactFinalTime", 1, 1, 1, i); __PYX_ERR(51, 2106, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2106, __pyx_L3_error)
    }
    __pyx_v_option = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setExactFinalTime", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 2106, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_172setExactFinalTime(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_option);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_172setExactFinalTime(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2125
 * 
 *         """
 *         cdef PetscTSExactFinalTimeOption oval = option             # <<<<<<<<<<<<<<
 *         CHKERR(TSSetExactFinalTime(self.ts, oval))
 * 
*/
  __pyx_t_1 = ((TSExactFinalTimeOption)__Pyx_PyLong_As_TSExactFinalTimeOption(__pyx_v_option)); if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2125, __pyx_L1_error)
  __pyx_v_oval = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":2126
 *         """
 *         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, 2126, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2106
 *         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":2128
 *         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_175setConvergedReason(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_174setConvergedReason, "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:2128");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_175setConvergedReason = {"setConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_175setConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_174setConvergedReason};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_175setConvergedReason(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_reason,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2128, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2128, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setConvergedReason", 0) < (0)) __PYX_ERR(51, 2128, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, i); __PYX_ERR(51, 2128, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2128, __pyx_L3_error)
    }
    __pyx_v_reason = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 2128, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_174setConvergedReason(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_reason);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_174setConvergedReason(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2146
 * 
 *         """
 *         cdef PetscTSConvergedReason cval = reason             # <<<<<<<<<<<<<<
 *         CHKERR(TSSetConvergedReason(self.ts, cval))
 * 
*/
  __pyx_t_1 = ((TSConvergedReason)__Pyx_PyLong_As_TSConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(51, 2146, __pyx_L1_error)
  __pyx_v_cval = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":2147
 *         """
 *         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, 2147, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2128
 *         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":2149
 *         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_177getConvergedReason(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_176getConvergedReason, "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:2149");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_177getConvergedReason = {"getConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_177getConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_176getConvergedReason};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_177getConvergedReason(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getConvergedReason", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_176getConvergedReason(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_176getConvergedReason(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2161
 * 
 *         """
 *         cdef PetscTSConvergedReason reason = TS_CONVERGED_ITERATING             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetConvergedReason(self.ts, &reason))
 *         return reason
*/
  __pyx_v_reason = TS_CONVERGED_ITERATING;

  /* "petsc4py/PETSc/TS.pyx":2162
 *         """
 *         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, 2162, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2163
 *         cdef PetscTSConvergedReason reason = TS_CONVERGED_ITERATING
 *         CHKERR(TSGetConvergedReason(self.ts, &reason))
 *         return reason             # <<<<<<<<<<<<<<
 * 
 *     # --- monitoring ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_TSConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":2149
 *         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":2167
 *     # --- monitoring ---
 * 
 *     def setMonitor(             # <<<<<<<<<<<<<<
 *         self,
 *         monitor: TSMonitorFunction | None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_179setMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_178setMonitor, "TS.setMonitor(self, monitor: TSMonitorFunction | None, 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:2167");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_179setMonitor = {"setMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_179setMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_178setMonitor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_179setMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_monitor,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2167, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 2167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMonitor", 0) < (0)) __PYX_ERR(51, 2167, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":2170
 *         self,
 *         monitor: TSMonitorFunction | None,
 *         args : tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs : dict[str, Any] | None = None) -> None:
 *         """Set an additional monitor to the `TS`.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2171
 *         monitor: TSMonitorFunction | None,
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set an additional monitor to the `TS`.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMonitor", 0, 1, 3, i); __PYX_ERR(51, 2167, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 2167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2167, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2167, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":2170
 *         self,
 *         monitor: TSMonitorFunction | None,
 *         args : tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs : dict[str, Any] | None = None) -> None:
 *         """Set an additional monitor to the `TS`.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2171
 *         monitor: TSMonitorFunction | None,
 *         args : tuple[Any, ...] | None = None,
 *         kargs : dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set an additional monitor to the `TS`.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2167, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_178setMonitor(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_monitor, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":2167
 *     # --- monitoring ---
 * 
 *     def setMonitor(             # <<<<<<<<<<<<<<
 *         self,
 *         monitor: TSMonitorFunction | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_178setMonitor(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":2190
 * 
 *         """
 *         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":2191
 *         """
 *         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, 2191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_monitorlist = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/TS.pyx":2192
 *         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":2193
 *         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, 2193, __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":2194
 *         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, 2194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/TS.pyx":2195
 *             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, 2195, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":2192
 *         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":2196
 *             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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TS.pyx":2197
 *             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, 2197, __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":2198
 *         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, 2198, __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) != (0)) __PYX_ERR(51, 2198, __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) != (0)) __PYX_ERR(51, 2198, __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) != (0)) __PYX_ERR(51, 2198, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/TS.pyx":2199
 *         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, 2199, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2167
 *     # --- monitoring ---
 * 
 *     def setMonitor(             # <<<<<<<<<<<<<<
 *         self,
 *         monitor: TSMonitorFunction | 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.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":2201
 *         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_181getMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_180getMonitor, "TS.getMonitor(self) -> list[tuple[TSMonitorFunction, tuple[Any, ...], dict[str, Any]]]\nReturn the monitor.\n\n        Not collective.\n\n        See Also\n        --------\n        setMonitor\n\n        \nSource code at petsc4py/PETSc/TS.pyx:2201");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_181getMonitor = {"getMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_181getMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_180getMonitor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_181getMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMonitor", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_180getMonitor(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_180getMonitor(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2211
 * 
 *         """
 *         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, 2211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":2201
 *         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":2213
 *         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_183monitorCancel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_182monitorCancel, "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:2213");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_183monitorCancel = {"monitorCancel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_183monitorCancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_182monitorCancel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_183monitorCancel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("monitorCancel", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_182monitorCancel(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_182monitorCancel(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2223
 * 
 *         """
 *         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, 2223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":2224
 *         """
 *         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, 2224, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2213
 *         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":2228
 *     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_185monitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_184monitor, "TS.monitor(self, step: int, time: float, u: Vec | None = None) -> None\nMonitor the solve.\n\n        Collective.\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:2228");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_185monitor = {"monitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_185monitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_184monitor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_185monitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_step,&__pyx_mstate_global->__pyx_n_u_time,&__pyx_mstate_global->__pyx_n_u_u,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2228, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 2228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "monitor", 0) < (0)) __PYX_ERR(51, 2228, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("monitor", 0, 2, 3, i); __PYX_ERR(51, 2228, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 2228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2228, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2228, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 2228, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "u", 0))) __PYX_ERR(51, 2228, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_184monitor(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_184monitor(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2247
 * 
 *         """
 *         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, 2247, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":2248
 *         """
 *         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, 2248, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_2;

  /* "petsc4py/PETSc/TS.pyx":2249
 *         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":2250
 *         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":2251
 *         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":2252
 *         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, 2252, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":2251
 *         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":2253
 *         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, 2253, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2228
 *     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":2257
 *     # --- event handling ---
 * 
 *     def setEventHandler(             # <<<<<<<<<<<<<<
 *         self,
 *         direction: Sequence[int],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_187setEventHandler(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_186setEventHandler, "TS.setEventHandler(self, direction: Sequence[int], terminate: Sequence[bool], indicator: TSIndicatorFunction | None, postevent: TSPostEventFunction | None = 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        indicator\n            Function for defining the indicator-functions marking the events\n        postevent\n            Function to execute after the event\n        args\n            Additional positional arguments for ``indicator``.\n        kargs\n            Additional keyword arguments for ``indicator``.\n\n        See Also\n        --------\n        petsc.TSSetEventHandler\n\n        \nSource code at petsc4py/PETSc/TS.pyx:2257");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_187setEventHandler = {"setEventHandler", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_187setEventHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_186setEventHandler};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_187setEventHandler(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_indicator = 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_direction,&__pyx_mstate_global->__pyx_n_u_terminate,&__pyx_mstate_global->__pyx_n_u_indicator,&__pyx_mstate_global->__pyx_n_u_postevent,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2257, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(51, 2257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 2257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 2257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 2257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setEventHandler", 0) < (0)) __PYX_ERR(51, 2257, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":2262
 *         terminate: Sequence[bool],
 *         indicator: TSIndicatorFunction | None,
 *         postevent: TSPostEventFunction | None = None,             # <<<<<<<<<<<<<<
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2263
 *         indicator: TSIndicatorFunction | None,
 *         postevent: TSPostEventFunction | None = None,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 *         """Set a function used for detecting events.
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2264
 *         postevent: TSPostEventFunction | None = None,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set a function used for detecting events.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setEventHandler", 0, 3, 6, i); __PYX_ERR(51, 2257, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(51, 2257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(51, 2257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 2257, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 2257, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2257, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2257, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":2262
 *         terminate: Sequence[bool],
 *         indicator: TSIndicatorFunction | None,
 *         postevent: TSPostEventFunction | None = None,             # <<<<<<<<<<<<<<
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2263
 *         indicator: TSIndicatorFunction | None,
 *         postevent: TSPostEventFunction | None = None,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 *         """Set a function used for detecting events.
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2264
 *         postevent: TSPostEventFunction | None = None,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set a function used for detecting events.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_direction = values[0];
    __pyx_v_terminate = values[1];
    __pyx_v_indicator = 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, 2257, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_186setEventHandler(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_direction, __pyx_v_terminate, __pyx_v_indicator, __pyx_v_postevent, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":2257
 *     # --- event handling ---
 * 
 *     def setEventHandler(             # <<<<<<<<<<<<<<
 *         self,
 *         direction: Sequence[int],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_186setEventHandler(struct PyPetscTSObject *__pyx_v_self, PyObject *__pyx_v_direction, PyObject *__pyx_v_terminate, PyObject *__pyx_v_indicator, 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":2289
 * 
 *         """
 *         cdef PetscInt  ndirs = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt *idirs = NULL
 *         direction = iarray_i(direction, &ndirs, &idirs)
*/
  __pyx_v_ndirs = 0;

  /* "petsc4py/PETSc/TS.pyx":2290
 *         """
 *         cdef PetscInt  ndirs = 0
 *         cdef PetscInt *idirs = NULL             # <<<<<<<<<<<<<<
 *         direction = iarray_i(direction, &ndirs, &idirs)
 * 
*/
  __pyx_v_idirs = NULL;

  /* "petsc4py/PETSc/TS.pyx":2291
 *         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, 2291, __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":2293
 *         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":2294
 * 
 *         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":2295
 *         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, 2295, __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":2296
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(51, 2296, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(51, 2296, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/TS.pyx":2298
 *         assert nterm == ndirs
 * 
 *         cdef PetscInt nevents = ndirs             # <<<<<<<<<<<<<<
 *         if indicator is not None:
 *             if args  is None: args  = ()
*/
  __pyx_v_nevents = __pyx_v_ndirs;

  /* "petsc4py/PETSc/TS.pyx":2299
 * 
 *         cdef PetscInt nevents = ndirs
 *         if indicator is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
  __pyx_t_2 = (__pyx_v_indicator != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/TS.pyx":2300
 *         cdef PetscInt nevents = ndirs
 *         if indicator is not None:
 *             if args  is None: args  = ()             # <<<<<<<<<<<<<<
 *             if kargs is None: kargs = {}
 *             self.set_attr('__indicator__', (indicator, args, kargs))
*/
    __pyx_t_2 = (__pyx_v_args == Py_None);
    if (__pyx_t_2) {
      __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TS.pyx":2301
 *         if indicator is not None:
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}             # <<<<<<<<<<<<<<
 *             self.set_attr('__indicator__', (indicator, 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, 2301, __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":2302
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
 *             self.set_attr('__indicator__', (indicator, 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, 2302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_indicator);
    __Pyx_GIVEREF(__pyx_v_indicator);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_indicator) != (0)) __PYX_ERR(51, 2302, __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) != (0)) __PYX_ERR(51, 2302, __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) != (0)) __PYX_ERR(51, 2302, __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 *)"__indicator__"), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2302, __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":2303
 *             if kargs is None: kargs = {}
 *             self.set_attr('__indicator__', (indicator, args, kargs))
 *             if postevent is not None:             # <<<<<<<<<<<<<<
 *                 self.set_attr('__postevent__', (postevent, args, kargs))
 *                 CHKERR(TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_Indicator, TS_PostEvent, <void*>NULL))
*/
    __pyx_t_2 = (__pyx_v_postevent != Py_None);
    if (__pyx_t_2) {

      /* "petsc4py/PETSc/TS.pyx":2304
 *             self.set_attr('__indicator__', (indicator, args, kargs))
 *             if postevent is not None:
 *                 self.set_attr('__postevent__', (postevent, args, kargs))             # <<<<<<<<<<<<<<
 *                 CHKERR(TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_Indicator, TS_PostEvent, <void*>NULL))
 *             else:
*/
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2304, __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) != (0)) __PYX_ERR(51, 2304, __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) != (0)) __PYX_ERR(51, 2304, __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) != (0)) __PYX_ERR(51, 2304, __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, 2304, __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":2305
 *             if postevent is not None:
 *                 self.set_attr('__postevent__', (postevent, args, kargs))
 *                 CHKERR(TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_Indicator, TS_PostEvent, <void*>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_Indicator, __pyx_f_8petsc4py_5PETSc_TS_PostEvent, ((void *)NULL))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2305, __pyx_L1_error)

      /* "petsc4py/PETSc/TS.pyx":2303
 *             if kargs is None: kargs = {}
 *             self.set_attr('__indicator__', (indicator, args, kargs))
 *             if postevent is not None:             # <<<<<<<<<<<<<<
 *                 self.set_attr('__postevent__', (postevent, args, kargs))
 *                 CHKERR(TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_Indicator, TS_PostEvent, <void*>NULL))
*/
      goto __pyx_L6;
    }

    /* "petsc4py/PETSc/TS.pyx":2307
 *                 CHKERR(TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_Indicator, TS_PostEvent, <void*>NULL))
 *             else:
 *                 self.set_attr('__postevent__', None)             # <<<<<<<<<<<<<<
 *                 CHKERR(TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_Indicator, NULL, <void*>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, 2307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "petsc4py/PETSc/TS.pyx":2308
 *             else:
 *                 self.set_attr('__postevent__', None)
 *                 CHKERR(TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_Indicator, NULL, <void*>NULL))             # <<<<<<<<<<<<<<
 *         else:
 *             CHKERR(TSSetEventHandler(self.ts, nevents, idirs, iterm, NULL, NULL, <void*>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_Indicator, NULL, ((void *)NULL))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2308, __pyx_L1_error)
    }
    __pyx_L6:;

    /* "petsc4py/PETSc/TS.pyx":2299
 * 
 *         cdef PetscInt nevents = ndirs
 *         if indicator is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/TS.pyx":2310
 *                 CHKERR(TSSetEventHandler(self.ts, nevents, idirs, iterm, TS_Indicator, NULL, <void*>NULL))
 *         else:
 *             CHKERR(TSSetEventHandler(self.ts, nevents, idirs, iterm, NULL, NULL, <void*>NULL))             # <<<<<<<<<<<<<<
 * 
 *     def setEventTolerances(self, tol: float | None = None, vtol: Sequence[float] | None = 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, 2310, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/TS.pyx":2257
 *     # --- 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":2312
 *             CHKERR(TSSetEventHandler(self.ts, nevents, idirs, iterm, NULL, NULL, <void*>NULL))
 * 
 *     def setEventTolerances(self, tol: float | None = None, vtol: Sequence[float] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set tolerances for event zero crossings when using event handler.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_189setEventTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_188setEventTolerances, "TS.setEventTolerances(self, tol: float | None = None, vtol: Sequence[float] | None = 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:2312");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_189setEventTolerances = {"setEventTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_189setEventTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_188setEventTolerances};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_189setEventTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tol,&__pyx_mstate_global->__pyx_n_u_vtol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2312, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setEventTolerances", 0) < (0)) __PYX_ERR(51, 2312, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2312, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_188setEventTolerances(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_tol, __pyx_v_vtol);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_188setEventTolerances(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":2336
 * 
 *         """
 *         cdef PetscInt  nevents = 0             # <<<<<<<<<<<<<<
 *         cdef PetscReal tolr = PETSC_CURRENT
 *         cdef PetscInt  ntolr = 0
*/
  __pyx_v_nevents = 0;

  /* "petsc4py/PETSc/TS.pyx":2337
 *         """
 *         cdef PetscInt  nevents = 0
 *         cdef PetscReal tolr = PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         cdef PetscInt  ntolr = 0
 *         cdef PetscReal *vtolr = NULL
*/
  __pyx_v_tolr = PETSC_CURRENT;

  /* "petsc4py/PETSc/TS.pyx":2338
 *         cdef PetscInt  nevents = 0
 *         cdef PetscReal tolr = PETSC_CURRENT
 *         cdef PetscInt  ntolr = 0             # <<<<<<<<<<<<<<
 *         cdef PetscReal *vtolr = NULL
 *         if tol is not None:
*/
  __pyx_v_ntolr = 0;

  /* "petsc4py/PETSc/TS.pyx":2339
 *         cdef PetscReal tolr = PETSC_CURRENT
 *         cdef PetscInt  ntolr = 0
 *         cdef PetscReal *vtolr = NULL             # <<<<<<<<<<<<<<
 *         if tol is not None:
 *             tolr = asReal(tol)
*/
  __pyx_v_vtolr = NULL;

  /* "petsc4py/PETSc/TS.pyx":2340
 *         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":2341
 *         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, 2341, __pyx_L1_error)
    __pyx_v_tolr = __pyx_t_2;

    /* "petsc4py/PETSc/TS.pyx":2340
 *         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":2342
 *         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":2343
 *             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, 2343, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":2344
 *         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, 2344, __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":2345
 *             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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(51, 2345, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(51, 2345, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/TS.pyx":2342
 *         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":2346
 *             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, 2346, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2312
 *             CHKERR(TSSetEventHandler(self.ts, nevents, idirs, iterm, NULL, NULL, <void*>NULL))
 * 
 *     def setEventTolerances(self, tol: float | None = None, vtol: Sequence[float] | None = 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":2348
 *         CHKERR(TSSetEventTolerances(self.ts, tolr, vtolr))
 * 
 *     def getNumEvents(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of events.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_191getNumEvents(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_190getNumEvents, "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:2348");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_191getNumEvents = {"getNumEvents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_191getNumEvents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_190getNumEvents};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_191getNumEvents(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNumEvents", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_190getNumEvents(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_190getNumEvents(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2358
 * 
 *         """
 *         cdef PetscInt nevents = 0             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetNumEvents(self.ts, &nevents))
 *         return toInt(nevents)
*/
  __pyx_v_nevents = 0;

  /* "petsc4py/PETSc/TS.pyx":2359
 *         """
 *         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, 2359, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2360
 *         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, 2360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":2348
 *         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":2364
 *     # --- solving ---
 * 
 *     def setPreStep(             # <<<<<<<<<<<<<<
 *         self,
 *         prestep: TSPreStepFunction | None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_193setPreStep(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_192setPreStep, "TS.setPreStep(self, prestep: TSPreStepFunction | None, 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:2364");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_193setPreStep = {"setPreStep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_193setPreStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_192setPreStep};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_193setPreStep(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prestep,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2364, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 2364, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2364, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2364, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPreStep", 0) < (0)) __PYX_ERR(51, 2364, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":2367
 *         self,
 *         prestep: TSPreStepFunction | None,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2368
 *         prestep: TSPreStepFunction | None,
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPreStep", 0, 1, 3, i); __PYX_ERR(51, 2364, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 2364, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2364, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2364, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":2367
 *         self,
 *         prestep: TSPreStepFunction | None,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2368
 *         prestep: TSPreStepFunction | None,
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2364, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_192setPreStep(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_prestep, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":2364
 *     # --- solving ---
 * 
 *     def setPreStep(             # <<<<<<<<<<<<<<
 *         self,
 *         prestep: TSPreStepFunction | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_192setPreStep(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":2387
 * 
 *         """
 *         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":2388
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TS.pyx":2389
 *         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, 2389, __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":2390
 *             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, 2390, __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) != (0)) __PYX_ERR(51, 2390, __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) != (0)) __PYX_ERR(51, 2390, __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) != (0)) __PYX_ERR(51, 2390, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/TS.pyx":2391
 *             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, 2391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/TS.pyx":2392
 *             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, 2392, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":2387
 * 
 *         """
 *         if prestep is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/TS.pyx":2394
 *             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, 2394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/TS.pyx":2395
 *         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, 2395, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/TS.pyx":2364
 *     # --- solving ---
 * 
 *     def setPreStep(             # <<<<<<<<<<<<<<
 *         self,
 *         prestep: TSPreStepFunction | 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.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":2397
 *             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_195getPreStep(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_194getPreStep, "TS.getPreStep(self) -> tuple[TSPreStepFunction, tuple[Any, ...] | None, dict[str, Any] | None]\nReturn the prestep function.\n\n        Not collective.\n\n        See Also\n        --------\n        setPreStep\n\n        \nSource code at petsc4py/PETSc/TS.pyx:2397");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_195getPreStep = {"getPreStep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_195getPreStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_194getPreStep};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_195getPreStep(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPreStep", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_194getPreStep(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_194getPreStep(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2407
 * 
 *         """
 *         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, 2407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":2397
 *             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":2409
 *         return self.get_attr('__prestep__')
 * 
 *     def setPostStep(self,             # <<<<<<<<<<<<<<
 *                     poststep: TSPostStepFunction | None,
 *                     args: tuple[Any, ...] | None = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_197setPostStep(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_196setPostStep, "TS.setPostStep(self, poststep: TSPostStepFunction | None, 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:2409");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_197setPostStep = {"setPostStep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_197setPostStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_196setPostStep};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_197setPostStep(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_poststep,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2409, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 2409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPostStep", 0) < (0)) __PYX_ERR(51, 2409, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":2411
 *     def setPostStep(self,
 *                     poststep: TSPostStepFunction | None,
 *                     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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2412
 *                     poststep: TSPostStepFunction | None,
 *                     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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPostStep", 0, 1, 3, i); __PYX_ERR(51, 2409, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 2409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2409, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2409, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":2411
 *     def setPostStep(self,
 *                     poststep: TSPostStepFunction | None,
 *                     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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2412
 *                     poststep: TSPostStepFunction | None,
 *                     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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2409, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_196setPostStep(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_poststep, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":2409
 *         return self.get_attr('__prestep__')
 * 
 *     def setPostStep(self,             # <<<<<<<<<<<<<<
 *                     poststep: TSPostStepFunction | None,
 *                     args: tuple[Any, ...] | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_196setPostStep(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":2431
 * 
 *         """
 *         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":2432
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TS.pyx":2433
 *         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, 2433, __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":2434
 *             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, 2434, __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) != (0)) __PYX_ERR(51, 2434, __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) != (0)) __PYX_ERR(51, 2434, __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) != (0)) __PYX_ERR(51, 2434, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/TS.pyx":2435
 *             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, 2435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/TS.pyx":2436
 *             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, 2436, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":2431
 * 
 *         """
 *         if poststep is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/TS.pyx":2438
 *             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, 2438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/TS.pyx":2439
 *         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, 2439, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/TS.pyx":2409
 *         return self.get_attr('__prestep__')
 * 
 *     def setPostStep(self,             # <<<<<<<<<<<<<<
 *                     poststep: TSPostStepFunction | None,
 *                     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":2441
 *             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_199getPostStep(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_198getPostStep, "TS.getPostStep(self) -> tuple[TSPostStepFunction, tuple[Any, ...] | None, dict[str, Any] | None]\nReturn the poststep function.\nSource code at petsc4py/PETSc/TS.pyx:2441");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_199getPostStep = {"getPostStep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_199getPostStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_198getPostStep};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_199getPostStep(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPostStep", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_198getPostStep(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_198getPostStep(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2443
 *     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, 2443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":2441
 *             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":2445
 *         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_201setUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_200setUp, "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:2445");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_201setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_201setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_200setUp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_201setUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_200setUp(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_200setUp(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2455
 * 
 *         """
 *         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, 2455, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2445
 *         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":2457
 *         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_203reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_202reset, "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:2457");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_203reset = {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_203reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_202reset};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_203reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("reset", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_202reset(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_202reset(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2467
 * 
 *         """
 *         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, 2467, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2457
 *         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":2469
 *         CHKERR(TSReset(self.ts))
 * 
 *     def step(self) -> None:             # <<<<<<<<<<<<<<
 *         """Take one step.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_205step(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_204step, "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:2469");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_205step = {"step", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_205step, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_204step};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_205step(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("step", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_204step(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_204step(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2483
 * 
 *         """
 *         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, 2483, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2469
 *         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":2485
 *         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_207restartStep(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_206restartStep, "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:2485");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_207restartStep = {"restartStep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_207restartStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_206restartStep};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_207restartStep(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("restartStep", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_206restartStep(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_206restartStep(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2506
 * 
 *         """
 *         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, 2506, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2485
 *         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":2508
 *         CHKERR(TSRestartStep(self.ts))
 * 
 *     def rollBack(self) -> None:             # <<<<<<<<<<<<<<
 *         """Roll back one time step.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_209rollBack(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_208rollBack, "TS.rollBack(self) -> None\nRoll back one time step.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.TSRollBack\n\n        \nSource code at petsc4py/PETSc/TS.pyx:2508");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_209rollBack = {"rollBack", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_209rollBack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_208rollBack};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_209rollBack(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("rollBack", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_208rollBack(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_208rollBack(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2518
 * 
 *         """
 *         CHKERR(TSRollBack(self.ts))             # <<<<<<<<<<<<<<
 * 
 *     def solve(self, Vec u=None) -> 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, 2518, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2508
 *         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":2520
 *         CHKERR(TSRollBack(self.ts))
 * 
 *     def solve(self, Vec u=None) -> None:             # <<<<<<<<<<<<<<
 *         """Step the requested number of timesteps.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_211solve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_210solve, "TS.solve(self, u: Vec | None = None) -> None\nStep the requested number of timesteps.\n\n        Collective.\n\n        Parameters\n        ----------\n        u\n            The solution vector. Can be `None`.\n\n        See Also\n        --------\n        petsc.TSSolve\n\n        \nSource code at petsc4py/PETSc/TS.pyx:2520");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_211solve = {"solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_211solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_210solve};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_211solve(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_u,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2520, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2520, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "solve", 0) < (0)) __PYX_ERR(51, 2520, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2520, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __pyx_v_u = ((struct PyPetscVecObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("solve", 0, 0, 1, __pyx_nargs); __PYX_ERR(51, 2520, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "u", 0))) __PYX_ERR(51, 2520, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_210solve(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_u);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_210solve(struct PyPetscTSObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_u) {
  Vec __pyx_v_uvec;
  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", 0);

  /* "petsc4py/PETSc/TS.pyx":2535
 * 
 *         """
 *         cdef PetscVec uvec=NULL             # <<<<<<<<<<<<<<
 *         if u is not None: uvec = u.vec
 *         CHKERR(TSSolve(self.ts, uvec))
*/
  __pyx_v_uvec = NULL;

  /* "petsc4py/PETSc/TS.pyx":2536
 *         """
 *         cdef PetscVec uvec=NULL
 *         if u is not None: uvec = u.vec             # <<<<<<<<<<<<<<
 *         CHKERR(TSSolve(self.ts, uvec))
 * 
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_u) != Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_v_u->vec;
    __pyx_v_uvec = __pyx_t_2;
  }

  /* "petsc4py/PETSc/TS.pyx":2537
 *         cdef PetscVec uvec=NULL
 *         if u is not None: uvec = u.vec
 *         CHKERR(TSSolve(self.ts, uvec))             # <<<<<<<<<<<<<<
 * 
 *     def interpolate(self, t: float, Vec u) -> None:
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSSolve(__pyx_v_self->ts, __pyx_v_uvec)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2537, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2520
 *         CHKERR(TSRollBack(self.ts))
 * 
 *     def solve(self, Vec u=None) -> 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":2539
 *         CHKERR(TSSolve(self.ts, uvec))
 * 
 *     def interpolate(self, t: float, Vec u) -> None:             # <<<<<<<<<<<<<<
 *         """Interpolate the solution to a given time.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_213interpolate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_212interpolate, "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:2539");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_213interpolate = {"interpolate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_213interpolate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_212interpolate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_213interpolate(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_u,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2539, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2539, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2539, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "interpolate", 0) < (0)) __PYX_ERR(51, 2539, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("interpolate", 1, 2, 2, i); __PYX_ERR(51, 2539, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2539, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2539, __pyx_L3_error)
    }
    __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, 2539, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "u", 0))) __PYX_ERR(51, 2539, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_212interpolate(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_t, __pyx_v_u);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_212interpolate(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2556
 * 
 *         """
 *         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, 2556, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":2557
 *         """
 *         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, 2557, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2539
 *         CHKERR(TSSolve(self.ts, uvec))
 * 
 *     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":2559
 *         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_215setStepLimits(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_214setStepLimits, "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:2559");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_215setStepLimits = {"setStepLimits", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_215setStepLimits, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_214setStepLimits};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_215setStepLimits(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_hmin,&__pyx_mstate_global->__pyx_n_u_hmax,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2559, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2559, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2559, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setStepLimits", 0) < (0)) __PYX_ERR(51, 2559, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setStepLimits", 1, 2, 2, i); __PYX_ERR(51, 2559, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2559, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2559, __pyx_L3_error)
    }
    __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, 2559, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_214setStepLimits(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_hmin, __pyx_v_hmax);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_214setStepLimits(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2576
 * 
 *         """
 *         cdef PetscTSAdapt tsadapt = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscReal hminr = toReal(hmin)
 *         cdef PetscReal hmaxr = toReal(hmax)
*/
  __pyx_v_tsadapt = NULL;

  /* "petsc4py/PETSc/TS.pyx":2577
 *         """
 *         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, 2577, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2577, __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, 2577, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_hminr = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":2578
 *         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, 2578, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2578, __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, 2578, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_hmaxr = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":2579
 *         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":2580
 *         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, 2580, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2559
 *         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":2582
 *         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_217getStepLimits(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_216getStepLimits, "TS.getStepLimits(self) -> tuple[float, float]\nReturn the minimum and maximum allowed time step sizes.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.TSAdaptGetStepLimits\n\n        \nSource code at petsc4py/PETSc/TS.pyx:2582");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_217getStepLimits = {"getStepLimits", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_217getStepLimits, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_216getStepLimits};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_217getStepLimits(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getStepLimits", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_216getStepLimits(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_216getStepLimits(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2592
 * 
 *         """
 *         cdef PetscTSAdapt tsadapt = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscReal hminr = 0.
 *         cdef PetscReal hmaxr = 0.
*/
  __pyx_v_tsadapt = NULL;

  /* "petsc4py/PETSc/TS.pyx":2593
 *         """
 *         cdef PetscTSAdapt tsadapt = NULL
 *         cdef PetscReal hminr = 0.             # <<<<<<<<<<<<<<
 *         cdef PetscReal hmaxr = 0.
 *         TSGetAdapt(self.ts, &tsadapt)
*/
  __pyx_v_hminr = 0.;

  /* "petsc4py/PETSc/TS.pyx":2594
 *         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":2595
 *         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":2596
 *         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, 2596, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2597
 *         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, 2597, __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, 2597, __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, 2597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_hmaxr); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2597, __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, 2597, __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, 2597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2597, __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) != (0)) __PYX_ERR(51, 2597, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(51, 2597, __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":2582
 *         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":2601
 *     # --- Adjoint methods ---
 * 
 *     def setSaveTrajectory(self) -> None:             # <<<<<<<<<<<<<<
 *         """Enable to save solutions as an internal `TS` trajectory.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_219setSaveTrajectory(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_218setSaveTrajectory, "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:2601");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_219setSaveTrajectory = {"setSaveTrajectory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_219setSaveTrajectory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_218setSaveTrajectory};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_219setSaveTrajectory(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setSaveTrajectory", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_218setSaveTrajectory(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_218setSaveTrajectory(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2618
 * 
 *         """
 *         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, 2618, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2601
 *     # --- 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":2620
 *         CHKERR(TSSetSaveTrajectory(self.ts))
 * 
 *     def removeTrajectory(self) -> None:             # <<<<<<<<<<<<<<
 *         """Remove the internal `TS` trajectory object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_221removeTrajectory(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_220removeTrajectory, "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:2620");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_221removeTrajectory = {"removeTrajectory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_221removeTrajectory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_220removeTrajectory};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_221removeTrajectory(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("removeTrajectory", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_220removeTrajectory(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_220removeTrajectory(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2630
 * 
 *         """
 *         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, 2630, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2620
 *         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":2632
 *         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_223getCostIntegral(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_222getCostIntegral, "TS.getCostIntegral(self) -> Vec\nReturn a vector of values of the integral term in the cost functions.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.TSGetCostIntegral\n\n        \nSource code at petsc4py/PETSc/TS.pyx:2632");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_223getCostIntegral = {"getCostIntegral", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_223getCostIntegral, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_222getCostIntegral};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_223getCostIntegral(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCostIntegral", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_222getCostIntegral(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_222getCostIntegral(struct PyPetscTSObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_cost = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCostIntegral", 0);

  /* "petsc4py/PETSc/TS.pyx":2642
 * 
 *         """
 *         cdef Vec cost = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(TSGetCostIntegral(self.ts, &cost.vec))
 *         CHKERR(PetscINCREF(cost.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2642, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_cost = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":2643
 *         """
 *         cdef Vec cost = Vec()
 *         CHKERR(TSGetCostIntegral(self.ts, &cost.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(cost.obj))
 *         return cost
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetCostIntegral(__pyx_v_self->ts, (&__pyx_v_cost->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2643, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2644
 *         cdef Vec cost = Vec()
 *         CHKERR(TSGetCostIntegral(self.ts, &cost.vec))
 *         CHKERR(PetscINCREF(cost.obj))             # <<<<<<<<<<<<<<
 *         return cost
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_cost->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2644, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2645
 *         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":2632
 *         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_XDECREF(__pyx_t_2);
  __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":2647
 *         return cost
 * 
 *     def setCostGradients(             # <<<<<<<<<<<<<<
 *         self,
 *         vl: Vec | Sequence[Vec] | None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_225setCostGradients(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_224setCostGradients, "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:2647");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_225setCostGradients = {"setCostGradients", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_225setCostGradients, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_224setCostGradients};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_225setCostGradients(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vl,&__pyx_mstate_global->__pyx_n_u_vm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2647, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCostGradients", 0) < (0)) __PYX_ERR(51, 2647, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":2650
 *         self,
 *         vl: Vec | Sequence[Vec] | None,
 *         vm: Vec | Sequence[Vec] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the cost gradients.
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCostGradients", 0, 1, 2, i); __PYX_ERR(51, 2647, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2647, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2647, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2647, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_224setCostGradients(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_vl, __pyx_v_vm);

  /* "petsc4py/PETSc/TS.pyx":2647
 *         return cost
 * 
 *     def setCostGradients(             # <<<<<<<<<<<<<<
 *         self,
 *         vl: Vec | Sequence[Vec] | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_224setCostGradients(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":2670
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         cdef PetscVec *vecl = NULL
 *         cdef PetscVec *vecm = NULL
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/TS.pyx":2671
 *         """
 *         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":2672
 *         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":2673
 *         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":2674
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); 
  if (__pyx_t_1) {
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2674, __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) != (0)) __PYX_ERR(51, 2674, __pyx_L1_error);
    __Pyx_DECREF_SET(__pyx_v_vl, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "petsc4py/PETSc/TS.pyx":2675
 *         cdef mem1 = None, mem2 = None
 *         if isinstance(vl, Vec): vl = [vl]
 *         if isinstance(vm, Vec): vm = [vm]             # <<<<<<<<<<<<<<
 *         if vl is not None:
 *             n = <PetscInt>len(vl)
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_vm, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); 
  if (__pyx_t_1) {
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2675, __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) != (0)) __PYX_ERR(51, 2675, __pyx_L1_error);
    __Pyx_DECREF_SET(__pyx_v_vm, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "petsc4py/PETSc/TS.pyx":2676
 *         if isinstance(vl, Vec): vl = [vl]
 *         if isinstance(vm, Vec): vm = [vm]
 *         if vl is not None:             # <<<<<<<<<<<<<<
 *             n = <PetscInt>len(vl)
 *         elif vm is not None:
*/
  __pyx_t_1 = (__pyx_v_vl != Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/TS.pyx":2677
 *         if isinstance(vm, Vec): vm = [vm]
 *         if vl is not None:
 *             n = <PetscInt>len(vl)             # <<<<<<<<<<<<<<
 *         elif vm is not None:
 *             n = <PetscInt>len(vm)
*/
    __pyx_t_3 = PyObject_Length(__pyx_v_vl); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(51, 2677, __pyx_L1_error)
    __pyx_v_n = ((PetscInt)__pyx_t_3);

    /* "petsc4py/PETSc/TS.pyx":2676
 *         if isinstance(vl, Vec): vl = [vl]
 *         if isinstance(vm, Vec): vm = [vm]
 *         if vl is not None:             # <<<<<<<<<<<<<<
 *             n = <PetscInt>len(vl)
 *         elif vm is not None:
*/
    goto __pyx_L5;
  }

  /* "petsc4py/PETSc/TS.pyx":2678
 *         if vl is not None:
 *             n = <PetscInt>len(vl)
 *         elif vm is not None:             # <<<<<<<<<<<<<<
 *             n = <PetscInt>len(vm)
 *         if vl is not None:
*/
  __pyx_t_1 = (__pyx_v_vm != Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/TS.pyx":2679
 *             n = <PetscInt>len(vl)
 *         elif vm is not None:
 *             n = <PetscInt>len(vm)             # <<<<<<<<<<<<<<
 *         if vl is not None:
 *             assert len(vl) == <Py_ssize_t>n
*/
    __pyx_t_3 = PyObject_Length(__pyx_v_vm); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(51, 2679, __pyx_L1_error)
    __pyx_v_n = ((PetscInt)__pyx_t_3);

    /* "petsc4py/PETSc/TS.pyx":2678
 *         if vl is not None:
 *             n = <PetscInt>len(vl)
 *         elif vm is not None:             # <<<<<<<<<<<<<<
 *             n = <PetscInt>len(vm)
 *         if vl is not None:
*/
  }
  __pyx_L5:;

  /* "petsc4py/PETSc/TS.pyx":2680
 *         elif vm is not None:
 *             n = <PetscInt>len(vm)
 *         if vl is not None:             # <<<<<<<<<<<<<<
 *             assert len(vl) == <Py_ssize_t>n
 *             mem1 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&vecl)
*/
  __pyx_t_1 = (__pyx_v_vl != Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/TS.pyx":2681
 *             n = <PetscInt>len(vm)
 *         if vl is not None:
 *             assert len(vl) == <Py_ssize_t>n             # <<<<<<<<<<<<<<
 *             mem1 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&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, 2681, __pyx_L1_error)
      __pyx_t_1 = (__pyx_t_3 == ((Py_ssize_t)__pyx_v_n));
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(51, 2681, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(51, 2681, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/TS.pyx":2682
 *         if vl is not None:
 *             assert len(vl) == <Py_ssize_t>n
 *             mem1 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&vecl)             # <<<<<<<<<<<<<<
 *             for i from 0 <= i < n:
 *                 vecl[i] = (<Vec?>vl[i]).vec
*/
    __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_n))); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2682, __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, 2682, __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":2683
 *             assert len(vl) == <Py_ssize_t>n
 *             mem1 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&vecl)
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 vecl[i] = (<Vec?>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":2684
 *             mem1 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&vecl)
 *             for i from 0 <= i < n:
 *                 vecl[i] = (<Vec?>vl[i]).vec             # <<<<<<<<<<<<<<
 *         if vm is not None:
 *             assert len(vm) == <Py_ssize_t>n
*/
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_vl, __pyx_v_i, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2684, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(51, 2684, __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":2680
 *         elif vm is not None:
 *             n = <PetscInt>len(vm)
 *         if vl is not None:             # <<<<<<<<<<<<<<
 *             assert len(vl) == <Py_ssize_t>n
 *             mem1 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&vecl)
*/
  }

  /* "petsc4py/PETSc/TS.pyx":2685
 *             for i from 0 <= i < n:
 *                 vecl[i] = (<Vec?>vl[i]).vec
 *         if vm is not None:             # <<<<<<<<<<<<<<
 *             assert len(vm) == <Py_ssize_t>n
 *             mem2 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&vecm)
*/
  __pyx_t_1 = (__pyx_v_vm != Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/TS.pyx":2686
 *                 vecl[i] = (<Vec?>vl[i]).vec
 *         if vm is not None:
 *             assert len(vm) == <Py_ssize_t>n             # <<<<<<<<<<<<<<
 *             mem2 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&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, 2686, __pyx_L1_error)
      __pyx_t_1 = (__pyx_t_3 == ((Py_ssize_t)__pyx_v_n));
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(51, 2686, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(51, 2686, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/TS.pyx":2687
 *         if vm is not None:
 *             assert len(vm) == <Py_ssize_t>n
 *             mem2 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&vecm)             # <<<<<<<<<<<<<<
 *             for i from 0 <= i < n:
 *                 vecm[i] = (<Vec?>vm[i]).vec
*/
    __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_n))); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2687, __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, 2687, __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":2688
 *             assert len(vm) == <Py_ssize_t>n
 *             mem2 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&vecm)
 *             for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *                 vecm[i] = (<Vec?>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":2689
 *             mem2 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&vecm)
 *             for i from 0 <= i < n:
 *                 vecm[i] = (<Vec?>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_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2689, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(51, 2689, __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":2685
 *             for i from 0 <= i < n:
 *                 vecl[i] = (<Vec?>vl[i]).vec
 *         if vm is not None:             # <<<<<<<<<<<<<<
 *             assert len(vm) == <Py_ssize_t>n
 *             mem2 = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&vecm)
*/
  }

  /* "petsc4py/PETSc/TS.pyx":2690
 *             for i from 0 <= i < n:
 *                 vecm[i] = (<Vec?>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, 2690, __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) != (0)) __PYX_ERR(51, 2690, __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) != (0)) __PYX_ERR(51, 2690, __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, 2690, __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":2691
 *                 vecm[i] = (<Vec?>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, 2691, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2647
 *         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":2693
 *         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_227getCostGradients(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_226getCostGradients, "TS.getCostGradients(self) -> tuple[list[Vec], list[Vec]]\nReturn the cost gradients.\n\n        Not collective.\n\n        See Also\n        --------\n        setCostGradients, petsc.TSGetCostGradients\n\n        \nSource code at petsc4py/PETSc/TS.pyx:2693");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_227getCostGradients = {"getCostGradients", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_227getCostGradients, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_226getCostGradients};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_227getCostGradients(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCostGradients", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_226getCostGradients(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_226getCostGradients(struct PyPetscTSObject *__pyx_v_self) {
  PetscInt __pyx_v_n;
  Vec *__pyx_v_vecl;
  Vec *__pyx_v_vecm;
  PyObject *__pyx_v_vl = 0;
  PyObject *__pyx_v_vm = 0;
  long __pyx_9genexpr15__pyx_v_i;
  long __pyx_9genexpr16__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", 0);

  /* "petsc4py/PETSc/TS.pyx":2703
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         cdef PetscVec *vecl = NULL
 *         cdef PetscVec *vecm = NULL
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/TS.pyx":2704
 *         """
 *         cdef PetscInt 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":2705
 *         cdef PetscInt 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":2706
 *         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, 2706, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2707
 *         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":2708
 *         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":2709
 *         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, 2709, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_v_n;
      for (__pyx_9genexpr15__pyx_v_i = 0; __pyx_9genexpr15__pyx_v_i < __pyx_t_4; __pyx_9genexpr15__pyx_v_i++) {
        __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec((__pyx_v_vecl[__pyx_9genexpr15__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2709, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(51, 2709, __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":2708
 *         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":2710
 *         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":2711
 *             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, 2711, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_v_n;
      for (__pyx_9genexpr16__pyx_v_i = 0; __pyx_9genexpr16__pyx_v_i < __pyx_t_4; __pyx_9genexpr16__pyx_v_i++) {
        __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_Vec((__pyx_v_vecm[__pyx_9genexpr16__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2711, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(51, 2711, __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":2710
 *         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":2712
 *         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, 2712, __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) != (0)) __PYX_ERR(51, 2712, __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) != (0)) __PYX_ERR(51, 2712, __pyx_L1_error);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":2693
 *         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":2714
 *         return (vl, vm)
 * 
 *     def setRHSJacobianP(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobianp: TSRHSJacobianP | None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_229setRHSJacobianP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_228setRHSJacobianP, "TS.setRHSJacobianP(self, jacobianp: TSRHSJacobianP | None, 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:2714");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_229setRHSJacobianP = {"setRHSJacobianP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_229setRHSJacobianP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_228setRHSJacobianP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_229setRHSJacobianP(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_jacobianp,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2714, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 2714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 2714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRHSJacobianP", 0) < (0)) __PYX_ERR(51, 2714, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":2717
 *         self,
 *         jacobianp: TSRHSJacobianP | None,
 *         Mat A=None,             # <<<<<<<<<<<<<<
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2718
 *         jacobianp: TSRHSJacobianP | None,
 *         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.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2719
 *         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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setRHSJacobianP", 0, 1, 4, i); __PYX_ERR(51, 2714, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 2714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 2714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2714, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":2717
 *         self,
 *         jacobianp: TSRHSJacobianP | None,
 *         Mat A=None,             # <<<<<<<<<<<<<<
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2718
 *         jacobianp: TSRHSJacobianP | None,
 *         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.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2719
 *         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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2714, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(51, 2717, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_228setRHSJacobianP(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_jacobianp, __pyx_v_A, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":2714
 *         return (vl, vm)
 * 
 *     def setRHSJacobianP(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobianp: TSRHSJacobianP | None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_228setRHSJacobianP(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":2740
 * 
 *         """
 *         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":2741
 *         """
 *         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":2742
 *         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":2743
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TS.pyx":2744
 *         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, 2744, __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":2745
 *             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, <void*>context))
*/
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2745, __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) != (0)) __PYX_ERR(51, 2745, __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) != (0)) __PYX_ERR(51, 2745, __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) != (0)) __PYX_ERR(51, 2745, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":2746
 *             if kargs is None: kargs = {}
 *             context = (jacobianp, args, kargs)
 *             self.set_attr('__rhsjacobianp__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, <void*>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, 2746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":2747
 *             context = (jacobianp, args, kargs)
 *             self.set_attr('__rhsjacobianp__', context)
 *             CHKERR(TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, <void*>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, 2747, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":2742
 *         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":2749
 *             CHKERR(TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, <void*>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, 2749, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/TS.pyx":2714
 *         return (vl, vm)
 * 
 *     def setRHSJacobianP(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobianp: TSRHSJacobianP | 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.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":2751
 *             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_231createQuadratureTS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_230createQuadratureTS, "TS.createQuadratureTS(self, forward: bool = True) -> TS\nCreate a sub `TS` that evaluates integrals over time.\n\n        Collective.\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:2751");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_231createQuadratureTS = {"createQuadratureTS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_231createQuadratureTS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_230createQuadratureTS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_231createQuadratureTS(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_forward,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2751, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2751, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createQuadratureTS", 0) < (0)) __PYX_ERR(51, 2751, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2751, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_forward = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createQuadratureTS", 0, 0, 1, __pyx_nargs); __PYX_ERR(51, 2751, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_230createQuadratureTS(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_forward);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_230createQuadratureTS(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscBool __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createQuadratureTS", 0);

  /* "petsc4py/PETSc/TS.pyx":2766
 * 
 *         """
 *         cdef TS qts = TS()             # <<<<<<<<<<<<<<
 *         cdef PetscBool fwd = forward
 *         CHKERR(TSCreateQuadratureTS(self.ts, fwd, &qts.ts))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2766, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_qts = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":2767
 *         """
 *         cdef TS qts = TS()
 *         cdef PetscBool fwd = forward             # <<<<<<<<<<<<<<
 *         CHKERR(TSCreateQuadratureTS(self.ts, fwd, &qts.ts))
 *         CHKERR(PetscINCREF(qts.obj))
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_forward); if (unlikely((__pyx_t_4 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(51, 2767, __pyx_L1_error)
  __pyx_v_fwd = __pyx_t_4;

  /* "petsc4py/PETSc/TS.pyx":2768
 *         cdef TS qts = TS()
 *         cdef PetscBool fwd = forward
 *         CHKERR(TSCreateQuadratureTS(self.ts, fwd, &qts.ts))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(qts.obj))
 *         return qts
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSCreateQuadratureTS(__pyx_v_self->ts, __pyx_v_fwd, (&__pyx_v_qts->ts))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2768, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2769
 *         cdef PetscBool fwd = forward
 *         CHKERR(TSCreateQuadratureTS(self.ts, fwd, &qts.ts))
 *         CHKERR(PetscINCREF(qts.obj))             # <<<<<<<<<<<<<<
 *         return qts
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_qts->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2769, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2770
 *         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":2751
 *             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_XDECREF(__pyx_t_2);
  __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":2772
 *         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_233getQuadratureTS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_232getQuadratureTS, "TS.getQuadratureTS(self) -> tuple[bool, TS]\nReturn the sub `TS` that evaluates integrals over time.\n\n        Not collective.\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:2772");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_233getQuadratureTS = {"getQuadratureTS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_233getQuadratureTS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_232getQuadratureTS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_233getQuadratureTS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getQuadratureTS", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_232getQuadratureTS(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_232getQuadratureTS(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getQuadratureTS", 0);

  /* "petsc4py/PETSc/TS.pyx":2789
 * 
 *         """
 *         cdef TS qts = TS()             # <<<<<<<<<<<<<<
 *         cdef PetscBool fwd = PETSC_FALSE
 *         CHKERR(TSGetQuadratureTS(self.ts, &fwd, &qts.ts))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 2789, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_qts = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":2790
 *         """
 *         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":2791
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TSGetQuadratureTS(__pyx_v_self->ts, (&__pyx_v_fwd), (&__pyx_v_qts->ts))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2791, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2792
 *         cdef PetscBool fwd = PETSC_FALSE
 *         CHKERR(TSGetQuadratureTS(self.ts, &fwd, &qts.ts))
 *         CHKERR(PetscINCREF(qts.obj))             # <<<<<<<<<<<<<<
 *         return (toBool(fwd), qts)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_qts->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2792, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2793
 *         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, 2793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 2793, __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) != (0)) __PYX_ERR(51, 2793, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_qts);
  __Pyx_GIVEREF((PyObject *)__pyx_v_qts);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_qts)) != (0)) __PYX_ERR(51, 2793, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":2772
 *         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_2);
  __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":2795
 *         return (toBool(fwd), qts)
 * 
 *     def setRHSJacobianP(             # <<<<<<<<<<<<<<
 *         self,
 *         rhsjacobianp: TSRHSJacobianP | None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_235setRHSJacobianP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_234setRHSJacobianP, "TS.setRHSJacobianP(self, rhsjacobianp: TSRHSJacobianP | None, 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        Collective.\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:2795");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_235setRHSJacobianP = {"setRHSJacobianP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_235setRHSJacobianP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_234setRHSJacobianP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_235setRHSJacobianP(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_rhsjacobianp,&__pyx_mstate_global->__pyx_n_u_A,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2795, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 2795, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 2795, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2795, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2795, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRHSJacobianP", 0) < (0)) __PYX_ERR(51, 2795, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":2798
 *         self,
 *         rhsjacobianp: TSRHSJacobianP | None,
 *         Mat A=None,             # <<<<<<<<<<<<<<
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2799
 *         rhsjacobianp: TSRHSJacobianP | None,
 *         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.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2800
 *         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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setRHSJacobianP", 0, 1, 4, i); __PYX_ERR(51, 2795, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(51, 2795, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 2795, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2795, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2795, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":2798
 *         self,
 *         rhsjacobianp: TSRHSJacobianP | None,
 *         Mat A=None,             # <<<<<<<<<<<<<<
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2799
 *         rhsjacobianp: TSRHSJacobianP | None,
 *         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.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":2800
 *         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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2795, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "A", 0))) __PYX_ERR(51, 2798, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_234setRHSJacobianP(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_rhsjacobianp, __pyx_v_A, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TS.pyx":2795
 *         return (toBool(fwd), qts)
 * 
 *     def setRHSJacobianP(             # <<<<<<<<<<<<<<
 *         self,
 *         rhsjacobianp: TSRHSJacobianP | None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_234setRHSJacobianP(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":2821
 * 
 *         """
 *         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":2822
 *         """
 *         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":2823
 *         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":2824
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TS.pyx":2825
 *         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, 2825, __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":2826
 *             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, <void*>context))
*/
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(51, 2826, __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) != (0)) __PYX_ERR(51, 2826, __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) != (0)) __PYX_ERR(51, 2826, __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) != (0)) __PYX_ERR(51, 2826, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":2827
 *             if kargs is None: kargs = {}
 *             context = (rhsjacobianp, args, kargs)
 *             self.set_attr('__rhsjacobianp__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, <void*>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, 2827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TS.pyx":2828
 *             context = (rhsjacobianp, args, kargs)
 *             self.set_attr('__rhsjacobianp__', context)
 *             CHKERR(TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, <void*>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, 2828, __pyx_L1_error)

    /* "petsc4py/PETSc/TS.pyx":2823
 *         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":2830
 *             CHKERR(TSSetRHSJacobianP(self.ts, Amat, TS_RHSJacobianP, <void*>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, 2830, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/TS.pyx":2795
 *         return (toBool(fwd), qts)
 * 
 *     def setRHSJacobianP(             # <<<<<<<<<<<<<<
 *         self,
 *         rhsjacobianp: TSRHSJacobianP | 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.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":2832
 *             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_237computeRHSJacobianP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_236computeRHSJacobianP, "TS.computeRHSJacobianP(self, t: float, x: Vec, J: Mat) -> None\nRun the user-defined JacobianP function.\n\n        Collective.\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 matrix.\n\n        See Also\n        --------\n        petsc.TSComputeRHSJacobianP\n\n        \nSource code at petsc4py/PETSc/TS.pyx:2832");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_237computeRHSJacobianP = {"computeRHSJacobianP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_237computeRHSJacobianP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_236computeRHSJacobianP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_237computeRHSJacobianP(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_t,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_J,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2832, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 2832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2832, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeRHSJacobianP", 0) < (0)) __PYX_ERR(51, 2832, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeRHSJacobianP", 1, 3, 3, i); __PYX_ERR(51, 2832, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2832, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2832, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 2832, __pyx_L3_error)
    }
    __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, 2832, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(51, 2832, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(51, 2832, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_236computeRHSJacobianP(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_236computeRHSJacobianP(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2851
 * 
 *         """
 *         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, 2851, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":2852
 *         """
 *         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, 2852, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2832
 *             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":2854
 *         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_239adjointSetSteps(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_238adjointSetSteps, "TS.adjointSetSteps(self, adjoint_steps: int) -> None\nSet the number of steps the adjoint solver should take backward in time.\n\n        Logically collective.\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:2854");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_239adjointSetSteps = {"adjointSetSteps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_239adjointSetSteps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_238adjointSetSteps};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_239adjointSetSteps(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_adjoint_steps,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2854, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2854, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "adjointSetSteps", 0) < (0)) __PYX_ERR(51, 2854, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("adjointSetSteps", 1, 1, 1, i); __PYX_ERR(51, 2854, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2854, __pyx_L3_error)
    }
    __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, 2854, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_238adjointSetSteps(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_adjoint_steps);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_238adjointSetSteps(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2869
 * 
 *         """
 *         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, 2869, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":2870
 *         """
 *         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, 2870, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2854
 *         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":2872
 *         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_241adjointSetUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_240adjointSetUp, "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:2872");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_241adjointSetUp = {"adjointSetUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_241adjointSetUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_240adjointSetUp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_241adjointSetUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("adjointSetUp", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_240adjointSetUp(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_240adjointSetUp(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2882
 * 
 *         """
 *         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, 2882, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2872
 *         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":2884
 *         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_243adjointSolve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_242adjointSolve, "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:2884");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_243adjointSolve = {"adjointSolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_243adjointSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_242adjointSolve};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_243adjointSolve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("adjointSolve", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_242adjointSolve(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_242adjointSolve(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2894
 * 
 *         """
 *         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, 2894, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2884
 *         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":2896
 *         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_245adjointStep(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_244adjointStep, "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:2896");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_245adjointStep = {"adjointStep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_245adjointStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_244adjointStep};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_245adjointStep(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("adjointStep", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_244adjointStep(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_244adjointStep(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2906
 * 
 *         """
 *         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, 2906, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2896
 *         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":2908
 *         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_247adjointReset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_246adjointReset, "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:2908");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_247adjointReset = {"adjointReset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_247adjointReset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_246adjointReset};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_247adjointReset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("adjointReset", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_246adjointReset(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_246adjointReset(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2918
 * 
 *         """
 *         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, 2918, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2908
 *         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":2922
 *     # --- 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_249createPython(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_248createPython, "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:2922");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_249createPython = {"createPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_249createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_248createPython};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_249createPython(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_context,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2922, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2922, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2922, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createPython", 0) < (0)) __PYX_ERR(51, 2922, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 2922, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2922, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2922, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_248createPython(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_context, __pyx_v_comm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_248createPython(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2939
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(51, 2939, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":2940
 *         """
 *         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":2941
 *         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, 2941, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2942
 *         cdef PetscTS newts = NULL
 *         CHKERR(TSCreate(ccomm, &newts))
 *         CHKERR(PetscCLEAR(self.obj)); self.ts = newts             # <<<<<<<<<<<<<<
 *         CHKERR(TSSetType(self.ts, TSPYTHON))
 *         CHKERR(TSPythonSetContext(self.ts, <void*>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, 2942, __pyx_L1_error)
  __pyx_v_self->ts = __pyx_v_newts;

  /* "petsc4py/PETSc/TS.pyx":2943
 *         CHKERR(TSCreate(ccomm, &newts))
 *         CHKERR(PetscCLEAR(self.obj)); self.ts = newts
 *         CHKERR(TSSetType(self.ts, TSPYTHON))             # <<<<<<<<<<<<<<
 *         CHKERR(TSPythonSetContext(self.ts, <void*>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, 2943, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2944
 *         CHKERR(PetscCLEAR(self.obj)); self.ts = newts
 *         CHKERR(TSSetType(self.ts, TSPYTHON))
 *         CHKERR(TSPythonSetContext(self.ts, <void*>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, 2944, __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, 2944, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2945
 *         CHKERR(TSSetType(self.ts, TSPYTHON))
 *         CHKERR(TSPythonSetContext(self.ts, <void*>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":2922
 *     # --- 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":2947
 *         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_251setPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_250setPythonContext, "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:2947");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_251setPythonContext = {"setPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_251setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_250setPythonContext};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_251setPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_context,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2947, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2947, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPythonContext", 0) < (0)) __PYX_ERR(51, 2947, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, i); __PYX_ERR(51, 2947, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2947, __pyx_L3_error)
    }
    __pyx_v_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 2947, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_250setPythonContext(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_context);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_250setPythonContext(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2957
 * 
 *         """
 *         CHKERR(TSPythonSetContext(self.ts, <void*>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, 2957, __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, 2957, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2947
 *         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":2959
 *         CHKERR(TSPythonSetContext(self.ts, <void*>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_253getPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_252getPythonContext, "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:2959");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_253getPythonContext = {"getPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_253getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_252getPythonContext};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_253getPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPythonContext", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_252getPythonContext(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_252getPythonContext(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2969
 * 
 *         """
 *         cdef void *context = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TSPythonGetContext(self.ts, &context))
 *         if context == NULL: return None
*/
  __pyx_v_context = NULL;

  /* "petsc4py/PETSc/TS.pyx":2970
 *         """
 *         cdef void *context = NULL
 *         CHKERR(TSPythonGetContext(self.ts, &context))             # <<<<<<<<<<<<<<
 *         if context == NULL: return None
 *         else: return <object> context
*/
  __pyx_t_1 = TSPythonGetContext(__pyx_v_self->ts, (&__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(51, 2970, __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, 2970, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2971
 *         cdef void *context = NULL
 *         CHKERR(TSPythonGetContext(self.ts, &context))
 *         if context == NULL: return None             # <<<<<<<<<<<<<<
 *         else: return <object> 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":2972
 *         CHKERR(TSPythonGetContext(self.ts, &context))
 *         if context == NULL: return None
 *         else: return <object> 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":2959
 *         CHKERR(TSPythonSetContext(self.ts, <void*>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":2974
 *         else: return <object> 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_255setPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_254setPythonType, "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:2974");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_255setPythonType = {"setPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_255setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_254setPythonType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_255setPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_py_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 2974, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2974, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPythonType", 0) < (0)) __PYX_ERR(51, 2974, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, i); __PYX_ERR(51, 2974, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 2974, __pyx_L3_error)
    }
    __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, 2974, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_254setPythonType(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_py_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_254setPythonType(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":2984
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         py_type = str2bytes(py_type, &cval)
 *         CHKERR(TSPythonSetType(self.ts, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/TS.pyx":2985
 *         """
 *         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, 2985, __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":2986
 *         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, 2986, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":2974
 *         else: return <object> 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":2988
 *         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_257getPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_256getPythonType, "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:2988");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_257getPythonType = {"getPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_257getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_256getPythonType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_257getPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPythonType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_256getPythonType(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_256getPythonType(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", 0);

  /* "petsc4py/PETSc/TS.pyx":2998
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TSPythonGetType(self.ts, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/TS.pyx":2999
 *         """
 *         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, 2999, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":3000
 *         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, 3000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":2988
 *         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":3004
 *     # --- 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_259setTheta(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_258setTheta, "TS.setTheta(self, theta: float) -> None\nSet the abscissa of the stage in ``(0, 1]`` for `Type.THETA`.\n\n        Logically collective.\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:3004");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_259setTheta = {"setTheta", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_259setTheta, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_258setTheta};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_259setTheta(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_theta,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 3004, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 3004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTheta", 0) < (0)) __PYX_ERR(51, 3004, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setTheta", 1, 1, 1, i); __PYX_ERR(51, 3004, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 3004, __pyx_L3_error)
    }
    __pyx_v_theta = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setTheta", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 3004, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_258setTheta(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_theta);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_258setTheta(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", 0);

  /* "petsc4py/PETSc/TS.pyx":3023
 * 
 *         """
 *         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, 3023, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":3024
 *         """
 *         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, 3024, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":3004
 *     # --- 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":3026
 *         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_261getTheta(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_260getTheta, "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:3026");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_261getTheta = {"getTheta", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_261getTheta, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_260getTheta};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_261getTheta(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTheta", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_260getTheta(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_260getTheta(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", 0);

  /* "petsc4py/PETSc/TS.pyx":3036
 * 
 *         """
 *         cdef PetscReal rval = 0             # <<<<<<<<<<<<<<
 *         CHKERR(TSThetaGetTheta(self.ts, &rval))
 *         return toReal(rval)
*/
  __pyx_v_rval = 0.0;

  /* "petsc4py/PETSc/TS.pyx":3037
 *         """
 *         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, 3037, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":3038
 *         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, 3038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":3026
 *         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":3040
 *         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_263setThetaEndpoint(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_262setThetaEndpoint, "TS.setThetaEndpoint(self, flag=True) -> None\nSet to use the endpoint variant of `Type.THETA`.\n\n        Logically collective.\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:3040");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_263setThetaEndpoint = {"setThetaEndpoint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_263setThetaEndpoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_262setThetaEndpoint};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_263setThetaEndpoint(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 3040, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 3040, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setThetaEndpoint", 0) < (0)) __PYX_ERR(51, 3040, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 3040, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setThetaEndpoint", 0, 0, 1, __pyx_nargs); __PYX_ERR(51, 3040, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_262setThetaEndpoint(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_262setThetaEndpoint(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", 0);

  /* "petsc4py/PETSc/TS.pyx":3055
 * 
 *         """
 *         cdef PetscBool bval = flag             # <<<<<<<<<<<<<<
 *         CHKERR(TSThetaSetEndpoint(self.ts, bval))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(51, 3055, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":3056
 *         """
 *         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, 3056, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":3040
 *         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":3058
 *         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_265getThetaEndpoint(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_264getThetaEndpoint, "TS.getThetaEndpoint(self) -> bool\nReturn whether the endpoint variable of `Type.THETA` is used.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.TSThetaGetEndpoint\n\n        \nSource code at petsc4py/PETSc/TS.pyx:3058");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_265getThetaEndpoint = {"getThetaEndpoint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_265getThetaEndpoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_264getThetaEndpoint};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_265getThetaEndpoint(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getThetaEndpoint", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_264getThetaEndpoint(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_264getThetaEndpoint(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", 0);

  /* "petsc4py/PETSc/TS.pyx":3068
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(TSThetaGetEndpoint(self.ts, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/TS.pyx":3069
 *         """
 *         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, 3069, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":3070
 *         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, 3070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":3058
 *         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":3074
 *     # --- Alpha ---
 * 
 *     def setAlphaRadius(self, radius: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the spectral radius for `Type.ALPHA`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_267setAlphaRadius(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_266setAlphaRadius, "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:3074");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_267setAlphaRadius = {"setAlphaRadius", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_267setAlphaRadius, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_266setAlphaRadius};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_267setAlphaRadius(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_radius,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 3074, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 3074, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setAlphaRadius", 0) < (0)) __PYX_ERR(51, 3074, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setAlphaRadius", 1, 1, 1, i); __PYX_ERR(51, 3074, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 3074, __pyx_L3_error)
    }
    __pyx_v_radius = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setAlphaRadius", 1, 1, 1, __pyx_nargs); __PYX_ERR(51, 3074, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_266setAlphaRadius(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_radius);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_266setAlphaRadius(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", 0);

  /* "petsc4py/PETSc/TS.pyx":3093
 * 
 *         """
 *         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, 3093, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/TS.pyx":3094
 *         """
 *         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, 3094, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":3074
 *     # --- 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":3096
 *         CHKERR(TSAlphaSetRadius(self.ts, rval))
 * 
 *     def setAlphaParams(             # <<<<<<<<<<<<<<
 *         self,
 *         alpha_m: float | None = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_269setAlphaParams(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_268setAlphaParams, "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:3096");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_269setAlphaParams = {"setAlphaParams", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_269setAlphaParams, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_268setAlphaParams};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_269setAlphaParams(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_alpha_m,&__pyx_mstate_global->__pyx_n_u_alpha_f,&__pyx_mstate_global->__pyx_n_u_gamma,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(51, 3096, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setAlphaParams", 0) < (0)) __PYX_ERR(51, 3096, __pyx_L3_error)

      /* "petsc4py/PETSc/TS.pyx":3098
 *     def setAlphaParams(
 *         self,
 *         alpha_m: float | None = None,             # <<<<<<<<<<<<<<
 *         alpha_f: float | None = None,
 *         gamma: float | None = None) -> None:
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":3099
 *         self,
 *         alpha_m: float | None = None,
 *         alpha_f: float | None = None,             # <<<<<<<<<<<<<<
 *         gamma: float | None = None) -> None:
 *         """Set the algorithmic parameters for `Type.ALPHA`.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":3100
 *         alpha_m: float | None = None,
 *         alpha_f: float | None = None,
 *         gamma: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the algorithmic parameters for `Type.ALPHA`.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(51, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(51, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(51, 3096, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TS.pyx":3098
 *     def setAlphaParams(
 *         self,
 *         alpha_m: float | None = None,             # <<<<<<<<<<<<<<
 *         alpha_f: float | None = None,
 *         gamma: float | None = None) -> None:
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":3099
 *         self,
 *         alpha_m: float | None = None,
 *         alpha_f: float | None = None,             # <<<<<<<<<<<<<<
 *         gamma: float | None = None) -> None:
 *         """Set the algorithmic parameters for `Type.ALPHA`.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/TS.pyx":3100
 *         alpha_m: float | None = None,
 *         alpha_f: float | None = None,
 *         gamma: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the algorithmic parameters for `Type.ALPHA`.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3096, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_268setAlphaParams(((struct PyPetscTSObject *)__pyx_v_self), __pyx_v_alpha_m, __pyx_v_alpha_f, __pyx_v_gamma);

  /* "petsc4py/PETSc/TS.pyx":3096
 *         CHKERR(TSAlphaSetRadius(self.ts, rval))
 * 
 *     def setAlphaParams(             # <<<<<<<<<<<<<<
 *         self,
 *         alpha_m: float | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_268setAlphaParams(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", 0);

  /* "petsc4py/PETSc/TS.pyx":3121
 * 
 *         """
 *         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":3122
 *         """
 *         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, 3122, __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":3123
 *         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":3122
 *         """
 *         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":3124
 *         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, 3124, __pyx_L1_error)
    __pyx_v_rval1 = __pyx_t_7;
  }

  /* "petsc4py/PETSc/TS.pyx":3125
 *         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, 3125, __pyx_L1_error)
    __pyx_v_rval2 = __pyx_t_7;
  }

  /* "petsc4py/PETSc/TS.pyx":3126
 *         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, 3126, __pyx_L1_error)
    __pyx_v_rval3 = __pyx_t_7;
  }

  /* "petsc4py/PETSc/TS.pyx":3127
 *         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, 3127, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":3096
 *         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":3129
 *         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_271getAlphaParams(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_270getAlphaParams, "TS.getAlphaParams(self) -> tuple[float, float, float]\nReturn the algorithmic parameters for `Type.ALPHA`.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.TSAlphaGetParams\n\n        \nSource code at petsc4py/PETSc/TS.pyx:3129");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2TS_271getAlphaParams = {"getAlphaParams", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_271getAlphaParams, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_270getAlphaParams};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2TS_271getAlphaParams(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getAlphaParams", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2TS_270getAlphaParams(((struct PyPetscTSObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2TS_270getAlphaParams(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", 0);

  /* "petsc4py/PETSc/TS.pyx":3139
 * 
 *         """
 *         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":3140
 *         """
 *         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, 3140, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":3141
 *         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, 3141, __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, 3141, __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, 3141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 3141, __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) != (0)) __PYX_ERR(51, 3141, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(51, 3141, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4) != (0)) __PYX_ERR(51, 3141, __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":3129
 *         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":3147
 *     property appctx:
 *         """Application context."""
 *         def __get__(self) -> Any:             # <<<<<<<<<<<<<<
 *             return self.getAppCtx()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TS.pyx":3148
 *         """Application context."""
 *         def __get__(self) -> Any:
 *             return self.getAppCtx()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getAppCtx, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":3147
 *     property appctx:
 *         """Application context."""
 *         def __get__(self) -> Any:             # <<<<<<<<<<<<<<
 *             return self.getAppCtx()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3150
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/TS.pyx":3151
 * 
 *         def __set__(self, value) -> None:
 *             self.setAppCtx(value)             # <<<<<<<<<<<<<<
 * 
 *     # --- discretization space ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setAppCtx, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":3150
 *             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_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":3157
 *     property dm:
 *         """The `DM`."""
 *         def __get__(self) -> DM:             # <<<<<<<<<<<<<<
 *             return self.getDM()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TS.pyx":3158
 *         """The `DM`."""
 *         def __get__(self) -> DM:
 *             return self.getDM()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getDM, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":3157
 *     property dm:
 *         """The `DM`."""
 *         def __get__(self) -> DM:             # <<<<<<<<<<<<<<
 *             return self.getDM()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3160
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/TS.pyx":3161
 * 
 *         def __set__(self, value) -> None:
 *             self.setDM(value)             # <<<<<<<<<<<<<<
 * 
 *     # --- xxx ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setDM, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":3160
 *             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_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":3167
 *     property problem_type:
 *         """The problem type."""
 *         def __get__(self) -> ProblemType:             # <<<<<<<<<<<<<<
 *             return self.getProblemType()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TS.pyx":3168
 *         """The problem type."""
 *         def __get__(self) -> ProblemType:
 *             return self.getProblemType()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getProblemType, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":3167
 *     property problem_type:
 *         """The problem type."""
 *         def __get__(self) -> ProblemType:             # <<<<<<<<<<<<<<
 *             return self.getProblemType()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3170
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/TS.pyx":3171
 * 
 *         def __set__(self, value) -> None:
 *             self.setProblemType(value)             # <<<<<<<<<<<<<<
 * 
 *     property equation_type:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setProblemType, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":3170
 *             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_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":3175
 *     property equation_type:
 *         """The equation type."""
 *         def __get__(self) -> EquationType:             # <<<<<<<<<<<<<<
 *             return self.getEquationType()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TS.pyx":3176
 *         """The equation type."""
 *         def __get__(self) -> EquationType:
 *             return self.getEquationType()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getEquationType, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":3175
 *     property equation_type:
 *         """The equation type."""
 *         def __get__(self) -> EquationType:             # <<<<<<<<<<<<<<
 *             return self.getEquationType()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3178
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/TS.pyx":3179
 * 
 *         def __set__(self, value) -> None:
 *             self.setEquationType(value)             # <<<<<<<<<<<<<<
 * 
 *     property snes:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setEquationType, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":3178
 *             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_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":3183
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TS.pyx":3184
 *         """The `SNES`."""
 *         def __get__(self) -> SNES:
 *             return self.getSNES()             # <<<<<<<<<<<<<<
 * 
 *     property ksp:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSNES, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":3183
 *     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_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":3188
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TS.pyx":3189
 *         """The `KSP`."""
 *         def __get__(self) -> KSP:
 *             return self.getKSP()             # <<<<<<<<<<<<<<
 * 
 *     property vec_sol:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getKSP, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":3188
 *     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_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":3193
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TS.pyx":3194
 *         """The solution vector."""
 *         def __get__(self) -> Vec:
 *             return self.getSolution()             # <<<<<<<<<<<<<<
 * 
 *     # --- xxx ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolution, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":3193
 *     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_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":3200
 *     property time:
 *         """The current time."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTime()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TS.pyx":3201
 *         """The current time."""
 *         def __get__(self) -> float:
 *             return self.getTime()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getTime, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":3200
 *     property time:
 *         """The current time."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTime()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3203
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/TS.pyx":3204
 * 
 *         def __set__(self, value) -> None:
 *             self.setTime(value)             # <<<<<<<<<<<<<<
 * 
 *     property time_step:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setTime, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":3203
 *             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_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":3208
 *     property time_step:
 *         """The current time step size."""
 *         def __get__(self) -> None:             # <<<<<<<<<<<<<<
 *             return self.getTimeStep()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TS.pyx":3209
 *         """The current time step size."""
 *         def __get__(self) -> None:
 *             return self.getTimeStep()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getTimeStep, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":3208
 *     property time_step:
 *         """The current time step size."""
 *         def __get__(self) -> None:             # <<<<<<<<<<<<<<
 *             return self.getTimeStep()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3211
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/TS.pyx":3212
 * 
 *         def __set__(self, value):
 *             self.setTimeStep(value)             # <<<<<<<<<<<<<<
 * 
 *     property step_number:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setTimeStep, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":3211
 *             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_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":3216
 *     property step_number:
 *         """The current step number."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getStepNumber()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TS.pyx":3217
 *         """The current step number."""
 *         def __get__(self) -> int:
 *             return self.getStepNumber()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getStepNumber, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":3216
 *     property step_number:
 *         """The current step number."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getStepNumber()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3219
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/TS.pyx":3220
 * 
 *         def __set__(self, value) -> None:
 *             self.setStepNumber(value)             # <<<<<<<<<<<<<<
 * 
 *     property max_time:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setStepNumber, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":3219
 *             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_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":3224
 *     property max_time:
 *         """The maximum time."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getMaxTime()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TS.pyx":3225
 *         """The maximum time."""
 *         def __get__(self) -> float:
 *             return self.getMaxTime()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getMaxTime, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":3224
 *     property max_time:
 *         """The maximum time."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getMaxTime()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3227
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/TS.pyx":3228
 * 
 *         def __set__(self, value) -> None:
 *             self.setMaxTime(value)             # <<<<<<<<<<<<<<
 * 
 *     property max_steps:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setMaxTime, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":3227
 *             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_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":3232
 *     property max_steps:
 *         """The maximum number of steps."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getMaxSteps()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TS.pyx":3233
 *         """The maximum number of steps."""
 *         def __get__(self) -> int:
 *             return self.getMaxSteps()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getMaxSteps, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":3232
 *     property max_steps:
 *         """The maximum number of steps."""
 *         def __get__(self) -> int:             # <<<<<<<<<<<<<<
 *             return self.getMaxSteps()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3235
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/TS.pyx":3236
 * 
 *         def __set__(self, value) -> None:
 *             self.setMaxSteps(value)             # <<<<<<<<<<<<<<
 * 
 *     # --- convergence ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setMaxSteps, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":3235
 *             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_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":3242
 *     property rtol:
 *         """The relative tolerance."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[0]
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TS.pyx":3243
 *         """The relative tolerance."""
 *         def __get__(self) -> float:
 *             return self.getTolerances()[0]             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 3243, __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":3242
 *     property rtol:
 *         """The relative tolerance."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[0]
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3245
 *             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;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/TS.pyx":3246
 * 
 *         def __set__(self, value) -> None:
 *             self.setTolerances(rtol=value)             # <<<<<<<<<<<<<<
 * 
 *     property atol:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 3246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_rtol, __pyx_v_value, __pyx_t_4, __pyx_callargs+1, 0) < (0)) __PYX_ERR(51, 3246, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_setTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":3245
 *             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_4);
  __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":3250
 *     property atol:
 *         """The absolute tolerance."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[1]
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TS.pyx":3251
 *         """The absolute tolerance."""
 *         def __get__(self) -> float:
 *             return self.getTolerances()[1]             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 3251, __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":3250
 *     property atol:
 *         """The absolute tolerance."""
 *         def __get__(self) -> float:             # <<<<<<<<<<<<<<
 *             return self.getTolerances()[1]
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3253
 *             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;
  size_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/TS.pyx":3254
 * 
 *         def __set__(self, value) -> None:
 *             self.setTolerances(atol=value)             # <<<<<<<<<<<<<<
 * 
 *     property reason:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL};
    __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 3254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_atol, __pyx_v_value, __pyx_t_4, __pyx_callargs+1, 0) < (0)) __PYX_ERR(51, 3254, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_setTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":3253
 *             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_4);
  __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":3258
 *     property reason:
 *         """The converged reason."""
 *         def __get__(self) -> ConvergedReason:             # <<<<<<<<<<<<<<
 *             return self.getConvergedReason()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TS.pyx":3259
 *         """The converged reason."""
 *         def __get__(self) -> ConvergedReason:
 *             return self.getConvergedReason()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getConvergedReason, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TS.pyx":3258
 *     property reason:
 *         """The 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_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":3261
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/TS.pyx":3262
 * 
 *         def __set__(self, value) -> None:
 *             self.setConvergedReason(value)             # <<<<<<<<<<<<<<
 * 
 *     property iterating:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setConvergedReason, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TS.pyx":3261
 *             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_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":3266
 *     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__", 0);

  /* "petsc4py/PETSc/TS.pyx":3267
 *         """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_mstate_global->__pyx_n_u_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_EqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 3267, __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":3266
 *     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":3271
 *     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__", 0);

  /* "petsc4py/PETSc/TS.pyx":3272
 *         """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_mstate_global->__pyx_n_u_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 3272, __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":3271
 *     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":3276
 *     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__", 0);

  /* "petsc4py/PETSc/TS.pyx":3277
 *         """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_mstate_global->__pyx_n_u_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 3277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(51, 3277, __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":3276
 *     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":116
 *     Reason = TAOConvergedReason
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":117
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.tao             # <<<<<<<<<<<<<<
 *         self.tao = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->tao));

  /* "petsc4py/PETSc/TAO.pyx":118
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.tao
 *         self.tao = NULL             # <<<<<<<<<<<<<<
 * 
 *     def view(self, Viewer viewer=None) -> None:
*/
  __pyx_v_self->tao = NULL;

  /* "petsc4py/PETSc/TAO.pyx":116
 *     Reason = TAOConvergedReason
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.tao
 *         self.tao = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/TAO.pyx":120
 *         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:120");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_3view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_2view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 120, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 120, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(52, 120, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 120, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 120, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(52, 120, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/TAO.pyx":135
 * 
 *         """
 *         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":136
 *         """
 *         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":137
 *         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, 137, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":120
 *         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":139
 *         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:139");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_5destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_4destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/TAO.pyx":149
 * 
 *         """
 *         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, 149, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":150
 *         """
 *         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":139
 *         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":152
 *         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:152");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_7create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_6create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 152, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 152, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(52, 152, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 152, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(52, 152, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":167
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(52, 167, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/TAO.pyx":168
 *         """
 *         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":169
 *         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, 169, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":170
 *         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, 170, __pyx_L1_error)
  __pyx_v_self->tao = __pyx_v_newtao;

  /* "petsc4py/PETSc/TAO.pyx":171
 *         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":152
 *         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":173
 *         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:173");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_9setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_8setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tao_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 173, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 173, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(52, 173, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(52, 173, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 173, __pyx_L3_error)
    }
    __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, 173, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":188
 * 
 *         """
 *         cdef PetscTAOType ctype = NULL             # <<<<<<<<<<<<<<
 *         tao_type = str2bytes(tao_type, &ctype)
 *         CHKERR(TaoSetType(self.tao, ctype))
*/
  __pyx_v_ctype = NULL;

  /* "petsc4py/PETSc/TAO.pyx":189
 *         """
 *         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, 189, __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":190
 *         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, 190, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":173
 *         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":192
 *         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:192");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_11getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_10getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/TAO.pyx":202
 * 
 *         """
 *         cdef PetscTAOType ctype = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetType(self.tao, &ctype))
 *         return bytes2str(ctype)
*/
  __pyx_v_ctype = NULL;

  /* "petsc4py/PETSc/TAO.pyx":203
 *         """
 *         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, 203, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":204
 *         cdef PetscTAOType ctype = NULL
 *         CHKERR(TaoGetType(self.tao, &ctype))
 *         return bytes2str(ctype)             # <<<<<<<<<<<<<<
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_ctype); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":192
 *         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":206
 *         return bytes2str(ctype)
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> 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) -> 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:206");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_13setOptionsPrefix = {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_13setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_12setOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 206, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOptionsPrefix", 0) < (0)) __PYX_ERR(52, 206, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, i); __PYX_ERR(52, 206, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 206, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 206, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":216
 * 
 *         """
 *         cdef const char *cprefix = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cprefix)
 *         CHKERR(TaoSetOptionsPrefix(self.tao, cprefix))
*/
  __pyx_v_cprefix = NULL;

  /* "petsc4py/PETSc/TAO.pyx":217
 *         """
 *         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, 217, __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":218
 *         cdef const char *cprefix = NULL
 *         prefix = str2bytes(prefix, &cprefix)
 *         CHKERR(TaoSetOptionsPrefix(self.tao, cprefix))             # <<<<<<<<<<<<<<
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> 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, 218, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":206
 *         return bytes2str(ctype)
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> 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":220
 *         CHKERR(TaoSetOptionsPrefix(self.tao, cprefix))
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> 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) -> 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:220");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_15appendOptionsPrefix = {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_15appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_14appendOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 220, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 220, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "appendOptionsPrefix", 0) < (0)) __PYX_ERR(52, 220, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, i); __PYX_ERR(52, 220, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 220, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 220, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":230
 * 
 *         """
 *         cdef const char *cprefix = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cprefix)
 *         CHKERR(TaoAppendOptionsPrefix(self.tao, cprefix))
*/
  __pyx_v_cprefix = NULL;

  /* "petsc4py/PETSc/TAO.pyx":231
 *         """
 *         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, 231, __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":232
 *         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, 232, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":220
 *         CHKERR(TaoSetOptionsPrefix(self.tao, cprefix))
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> 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":234
 *         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:234");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_17getOptionsPrefix = {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_17getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_16getOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOptionsPrefix", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/TAO.pyx":244
 * 
 *         """
 *         cdef const char *prefix = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetOptionsPrefix(self.tao, &prefix))
 *         return bytes2str(prefix)
*/
  __pyx_v_prefix = NULL;

  /* "petsc4py/PETSc/TAO.pyx":245
 *         """
 *         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, 245, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":246
 *         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, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":234
 *         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":248
 *         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:248");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_19setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_19setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_18setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/TAO.pyx":258
 * 
 *         """
 *         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, 258, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":248
 *         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":260
 *         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:260");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_21setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_21setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_20setUp};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/TAO.pyx":270
 * 
 *         """
 *         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, 270, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":260
 *         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":274
 *     #
 * 
 *     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:274");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_23setInitialTrustRegionRadius = {"setInitialTrustRegionRadius", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_23setInitialTrustRegionRadius, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_22setInitialTrustRegionRadius};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_radius,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 274, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 274, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setInitialTrustRegionRadius", 0) < (0)) __PYX_ERR(52, 274, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setInitialTrustRegionRadius", 1, 1, 1, i); __PYX_ERR(52, 274, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 274, __pyx_L3_error)
    }
    __pyx_v_radius = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setInitialTrustRegionRadius", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 274, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":284
 * 
 *         """
 *         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, 284, __pyx_L1_error)
  __pyx_v_cradius = __pyx_t_1;

  /* "petsc4py/PETSc/TAO.pyx":285
 *         """
 *         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, 285, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":274
 *     #
 * 
 *     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":289
 *     # --------------
 * 
 *     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:289");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_25setAppCtx = {"setAppCtx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_25setAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_24setAppCtx};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_appctx,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 289, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 289, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setAppCtx", 0) < (0)) __PYX_ERR(52, 289, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, i); __PYX_ERR(52, 289, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 289, __pyx_L3_error)
    }
    __pyx_v_appctx = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 289, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":291
 *     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, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":289
 *     # --------------
 * 
 *     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":293
 *         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:293");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_27getAppCtx = {"getAppCtx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_27getAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_26getAppCtx};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getAppCtx", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/TAO.pyx":295
 *     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, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":293
 *         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":297
 *         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:297");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_29setSolution = {"setSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_29setSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_28setSolution};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 297, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 297, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSolution", 0) < (0)) __PYX_ERR(52, 297, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSolution", 1, 1, 1, i); __PYX_ERR(52, 297, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 297, __pyx_L3_error)
    }
    __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, 297, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 297, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/TAO.pyx":307
 * 
 *         """
 *         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, 307, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":297
 *         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":309
 *         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:309");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_31setObjective = {"setObjective", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_31setObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_30setObjective};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_objective,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 309, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 309, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 309, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 309, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setObjective", 0) < (0)) __PYX_ERR(52, 309, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setObjective", 0, 1, 3, i); __PYX_ERR(52, 309, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 309, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 309, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 309, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 309, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":328
 * 
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":329
 *         """
 *         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, 329, __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":330
 *         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, <void*>context))
*/
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 330, __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) != (0)) __PYX_ERR(52, 330, __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) != (0)) __PYX_ERR(52, 330, __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) != (0)) __PYX_ERR(52, 330, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/TAO.pyx":331
 *         if kargs is None: kargs = {}
 *         context = (objective, args, kargs)
 *         self.set_attr("__objective__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetObjective(self.tao, TAO_Objective, <void*>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, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/TAO.pyx":332
 *         context = (objective, args, kargs)
 *         self.set_attr("__objective__", context)
 *         CHKERR(TaoSetObjective(self.tao, TAO_Objective, <void*>context))             # <<<<<<<<<<<<<<
 * 
 *     def setResidual(self, residual: TAOResidualFunction, Vec R, 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, 332, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":309
 *         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":334
 *         CHKERR(TaoSetObjective(self.tao, TAO_Objective, <void*>context))
 * 
 *     def setResidual(self, residual: TAOResidualFunction, Vec R, 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, 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:334");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_33setResidual = {"setResidual", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_33setResidual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_32setResidual};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_residual,&__pyx_mstate_global->__pyx_n_u_R,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 334, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 334, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 334, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 334, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 334, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setResidual", 0) < (0)) __PYX_ERR(52, 334, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setResidual", 0, 2, 4, i); __PYX_ERR(52, 334, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 334, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 334, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 334, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 334, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2, 4, __pyx_nargs); __PYX_ERR(52, 334, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "R", 0))) __PYX_ERR(52, 334, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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) {
  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("setResidual", 0);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_INCREF(__pyx_v_kargs);

  /* "petsc4py/PETSc/TAO.pyx":355
 * 
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":356
 *         """
 *         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_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 356, __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":357
 *         if args is None: args = ()
 *         if kargs is None: kargs = {}
 *         context = (residual, args, kargs)             # <<<<<<<<<<<<<<
 *         self.set_attr("__residual__", context)
 *         CHKERR(TaoSetResidualRoutine(self.tao, R.vec, TAO_Residual, <void*>context))
*/
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_residual);
  __Pyx_GIVEREF(__pyx_v_residual);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_residual) != (0)) __PYX_ERR(52, 357, __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) != (0)) __PYX_ERR(52, 357, __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) != (0)) __PYX_ERR(52, 357, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/TAO.pyx":358
 *         if kargs is None: kargs = {}
 *         context = (residual, args, kargs)
 *         self.set_attr("__residual__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetResidualRoutine(self.tao, R.vec, TAO_Residual, <void*>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 *)"__residual__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/TAO.pyx":359
 *         context = (residual, args, kargs)
 *         self.set_attr("__residual__", context)
 *         CHKERR(TaoSetResidualRoutine(self.tao, R.vec, TAO_Residual, <void*>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_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetResidualRoutine(__pyx_v_self->tao, __pyx_v_R->vec, __pyx_f_8petsc4py_5PETSc_TAO_Residual, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 359, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":334
 *         CHKERR(TaoSetObjective(self.tao, TAO_Objective, <void*>context))
 * 
 *     def setResidual(self, residual: TAOResidualFunction, Vec R, 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_2);
  __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":361
 *         CHKERR(TaoSetResidualRoutine(self.tao, R.vec, TAO_Residual, <void*>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:361");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_35setJacobianResidual = {"setJacobianResidual", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_35setJacobianResidual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_34setJacobianResidual};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_jacobian,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 361, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(52, 361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setJacobianResidual", 0) < (0)) __PYX_ERR(52, 361, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setJacobianResidual", 0, 1, 5, i); __PYX_ERR(52, 361, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(52, 361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 361, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 361, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 361, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(52, 361, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(52, 361, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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":384
 * 
 *         """
 *         cdef PetscMat Jmat = NULL             # <<<<<<<<<<<<<<
 *         if J is not None: Jmat = J.mat
 *         cdef PetscMat Pmat = Jmat
*/
  __pyx_v_Jmat = NULL;

  /* "petsc4py/PETSc/TAO.pyx":385
 *         """
 *         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":386
 *         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":387
 *         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":388
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":389
 *         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, 389, __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":390
 *         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, <void*>context))
*/
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 390, __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) != (0)) __PYX_ERR(52, 390, __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) != (0)) __PYX_ERR(52, 390, __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) != (0)) __PYX_ERR(52, 390, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":391
 *         if kargs is None: kargs = {}
 *         context = (jacobian, args, kargs)
 *         self.set_attr("__jacobian_residual__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetJacobianResidualRoutine(self.tao, Jmat, Pmat, TAO_JacobianResidual, <void*>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, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":392
 *         context = (jacobian, args, kargs)
 *         self.set_attr("__jacobian_residual__", context)
 *         CHKERR(TaoSetJacobianResidualRoutine(self.tao, Jmat, Pmat, TAO_JacobianResidual, <void*>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, 392, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":361
 *         CHKERR(TaoSetResidualRoutine(self.tao, R.vec, TAO_Residual, <void*>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":394
 *         CHKERR(TaoSetJacobianResidualRoutine(self.tao, Jmat, Pmat, TAO_JacobianResidual, <void*>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:394");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_37setGradient = {"setGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_37setGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_36setGradient};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gradient,&__pyx_mstate_global->__pyx_n_u_g,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 394, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 394, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 394, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 394, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 394, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setGradient", 0) < (0)) __PYX_ERR(52, 394, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setGradient", 0, 1, 4, i); __PYX_ERR(52, 394, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 394, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 394, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 394, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 394, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 394, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "g", 0))) __PYX_ERR(52, 394, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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":415
 * 
 *         """
 *         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":416
 *         """
 *         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":417
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":418
 *         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, 418, __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":419
 *         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, <void*>context))
*/
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 419, __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) != (0)) __PYX_ERR(52, 419, __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) != (0)) __PYX_ERR(52, 419, __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) != (0)) __PYX_ERR(52, 419, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":420
 *         if kargs is None: kargs = {}
 *         context = (gradient, args, kargs)
 *         self.set_attr("__gradient__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetGradient(self.tao, gvec, TAO_Gradient, <void*>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, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":421
 *         context = (gradient, args, kargs)
 *         self.set_attr("__gradient__", context)
 *         CHKERR(TaoSetGradient(self.tao, gvec, TAO_Gradient, <void*>context))             # <<<<<<<<<<<<<<
 * 
 *     def getObjective(self) -> TAOObjectiveFunction:
*/
  __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, 421, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":394
 *         CHKERR(TaoSetJacobianResidualRoutine(self.tao, Jmat, Pmat, TAO_JacobianResidual, <void*>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":423
 *         CHKERR(TaoSetGradient(self.tao, gvec, TAO_Gradient, <void*>context))
 * 
 *     def getObjective(self) -> TAOObjectiveFunction:             # <<<<<<<<<<<<<<
 *         """Return the objective evaluation callback.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_39getObjective(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_38getObjective, "TAO.getObjective(self) -> TAOObjectiveFunction\nReturn the objective evaluation callback.\n\n        Not collective.\n\n        See Also\n        --------\n        setObjective, petsc.TaoGetObjective\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:423");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_39getObjective = {"getObjective", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_39getObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_38getObjective};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_39getObjective(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getObjective", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_38getObjective(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_38getObjective(struct PyPetscTAOObject *__pyx_v_self) {
  PyObject *__pyx_v_objective = 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("getObjective", 0);

  /* "petsc4py/PETSc/TAO.pyx":433
 * 
 *         """
 *         cdef object objective = self.get_attr("__objective__")             # <<<<<<<<<<<<<<
 *         return objective
 * 
*/
  __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 *)"__objective__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_objective = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":434
 *         """
 *         cdef object objective = self.get_attr("__objective__")
 *         return objective             # <<<<<<<<<<<<<<
 * 
 *     def getGradient(self) -> tuple[Vec, TAOGradientFunction]:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_objective);
  __pyx_r = __pyx_v_objective;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":423
 *         CHKERR(TaoSetGradient(self.tao, gvec, TAO_Gradient, <void*>context))
 * 
 *     def getObjective(self) -> TAOObjectiveFunction:             # <<<<<<<<<<<<<<
 *         """Return the objective evaluation callback.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.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/TAO.pyx":436
 *         return objective
 * 
 *     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_41getGradient(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_40getGradient, "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:436");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_41getGradient = {"getGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_41getGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_40getGradient};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_41getGradient(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getGradient", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_40getGradient(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_40getGradient(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getGradient", 0);

  /* "petsc4py/PETSc/TAO.pyx":446
 * 
 *         """
 *         cdef Vec vec = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetGradient(self.tao, &vec.vec, NULL, NULL))
 *         CHKERR(PetscINCREF(vec.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 446, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":447
 *         """
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetGradient(__pyx_v_self->tao, (&__pyx_v_vec->vec), NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 447, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":448
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 448, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":449
 *         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, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_gradient = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":450
 *         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, 450, __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)) != (0)) __PYX_ERR(52, 450, __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) != (0)) __PYX_ERR(52, 450, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":436
 *         return objective
 * 
 *     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_XDECREF(__pyx_t_2);
  __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":452
 *         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_43setObjectiveGradient(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_42setObjectiveGradient, "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:452");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_43setObjectiveGradient = {"setObjectiveGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_43setObjectiveGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_42setObjectiveGradient};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_43setObjectiveGradient(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_objgrad,&__pyx_mstate_global->__pyx_n_u_g,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 452, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 452, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 452, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 452, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 452, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setObjectiveGradient", 0) < (0)) __PYX_ERR(52, 452, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setObjectiveGradient", 0, 1, 4, i); __PYX_ERR(52, 452, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 452, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 452, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 452, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 452, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 452, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "g", 0))) __PYX_ERR(52, 452, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_42setObjectiveGradient(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_42setObjectiveGradient(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":474
 * 
 *         """
 *         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":475
 *         """
 *         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":476
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":477
 *         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, 477, __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":478
 *         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, <void*>context))
*/
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 478, __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) != (0)) __PYX_ERR(52, 478, __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) != (0)) __PYX_ERR(52, 478, __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) != (0)) __PYX_ERR(52, 478, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":479
 *         if kargs is None: kargs = {}
 *         context = (objgrad, args, kargs)
 *         self.set_attr("__objgrad__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetObjectiveAndGradient(self.tao, gvec, TAO_ObjGrad, <void*>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, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":480
 *         context = (objgrad, args, kargs)
 *         self.set_attr("__objgrad__", context)
 *         CHKERR(TaoSetObjectiveAndGradient(self.tao, gvec, TAO_ObjGrad, <void*>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, 480, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":452
 *         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":482
 *         CHKERR(TaoSetObjectiveAndGradient(self.tao, gvec, TAO_ObjGrad, <void*>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_45getObjectiveAndGradient(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_44getObjectiveAndGradient, "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:482");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_45getObjectiveAndGradient = {"getObjectiveAndGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_45getObjectiveAndGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_44getObjectiveAndGradient};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_45getObjectiveAndGradient(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getObjectiveAndGradient", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_44getObjectiveAndGradient(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_44getObjectiveAndGradient(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getObjectiveAndGradient", 0);

  /* "petsc4py/PETSc/TAO.pyx":492
 * 
 *         """
 *         cdef Vec vec = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetObjectiveAndGradient(self.tao, &vec.vec, NULL, NULL))
 *         CHKERR(PetscINCREF(vec.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 492, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":493
 *         """
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetObjectiveAndGradient(__pyx_v_self->tao, (&__pyx_v_vec->vec), NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 493, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":494
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 494, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":495
 *         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, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_objgrad = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":496
 *         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, 496, __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)) != (0)) __PYX_ERR(52, 496, __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) != (0)) __PYX_ERR(52, 496, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":482
 *         CHKERR(TaoSetObjectiveAndGradient(self.tao, gvec, TAO_ObjGrad, <void*>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_XDECREF(__pyx_t_2);
  __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":498
 *         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 lower and upper bounds for the optimization problem.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_47setVariableBounds(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_46setVariableBounds, "TAO.setVariableBounds(self, varbounds: tuple[Vec, Vec] | TAOVariableBoundsFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet the lower and upper 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:498");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_47setVariableBounds = {"setVariableBounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_47setVariableBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_46setVariableBounds};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_47setVariableBounds(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_varbounds,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 498, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 498, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 498, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 498, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setVariableBounds", 0) < (0)) __PYX_ERR(52, 498, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setVariableBounds", 0, 1, 3, i); __PYX_ERR(52, 498, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 498, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 498, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 498, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 498, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_46setVariableBounds(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_varbounds, __pyx_v_args, __pyx_v_kargs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_46setVariableBounds(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":517
 * 
 *         """
 *         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":518
 *         """
 *         cdef Vec xl = None, xu = None
 *         if (isinstance(varbounds, list) or isinstance(varbounds, tuple)):             # <<<<<<<<<<<<<<
 *             ol, ou = varbounds
 *             xl = <Vec?> ol; xu = <Vec?> 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":519
 *         cdef Vec xl = None, xu = None
 *         if (isinstance(varbounds, list) or isinstance(varbounds, tuple)):
 *             ol, ou = varbounds             # <<<<<<<<<<<<<<
 *             xl = <Vec?> ol; xu = <Vec?> 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, 519, __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_INCREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 519, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 519, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 519, __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, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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, 519, __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, 519, __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":520
 *         if (isinstance(varbounds, list) or isinstance(varbounds, tuple)):
 *             ol, ou = varbounds
 *             xl = <Vec?> ol; xu = <Vec?> ou             # <<<<<<<<<<<<<<
 *             CHKERR(TaoSetVariableBounds(self.tao, xl.vec, xu.vec))
 *             return
*/
    if (!(likely(__Pyx_TypeTest(__pyx_v_ol, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(52, 520, __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(52, 520, __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":521
 *             ol, ou = varbounds
 *             xl = <Vec?> ol; xu = <Vec?> 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, 521, __pyx_L1_error)

    /* "petsc4py/PETSc/TAO.pyx":522
 *             xl = <Vec?> ol; xu = <Vec?> 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":518
 *         """
 *         cdef Vec xl = None, xu = None
 *         if (isinstance(varbounds, list) or isinstance(varbounds, tuple)):             # <<<<<<<<<<<<<<
 *             ol, ou = varbounds
 *             xl = <Vec?> ol; xu = <Vec?> ou
*/
  }

  /* "petsc4py/PETSc/TAO.pyx":523
 *             CHKERR(TaoSetVariableBounds(self.tao, xl.vec, xu.vec))
 *             return
 *         if isinstance(varbounds, Vec): # FIXME             # <<<<<<<<<<<<<<
 *             ol = varbounds; ou = args
 *             xl = <Vec?> ol; xu = <Vec?> ou
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_varbounds, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/TAO.pyx":524
 *             return
 *         if isinstance(varbounds, Vec): # FIXME
 *             ol = varbounds; ou = args             # <<<<<<<<<<<<<<
 *             xl = <Vec?> ol; xu = <Vec?> 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":525
 *         if isinstance(varbounds, Vec): # FIXME
 *             ol = varbounds; ou = args
 *             xl = <Vec?> ol; xu = <Vec?> ou             # <<<<<<<<<<<<<<
 *             CHKERR(TaoSetVariableBounds(self.tao, xl.vec, xu.vec))
 *             return
*/
    if (!(likely(__Pyx_TypeTest(__pyx_v_ol, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(52, 525, __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(52, 525, __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":526
 *             ol = varbounds; ou = args
 *             xl = <Vec?> ol; xu = <Vec?> 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, 526, __pyx_L1_error)

    /* "petsc4py/PETSc/TAO.pyx":527
 *             xl = <Vec?> ol; xu = <Vec?> 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":523
 *             CHKERR(TaoSetVariableBounds(self.tao, xl.vec, xu.vec))
 *             return
 *         if isinstance(varbounds, Vec): # FIXME             # <<<<<<<<<<<<<<
 *             ol = varbounds; ou = args
 *             xl = <Vec?> ol; xu = <Vec?> ou
*/
  }

  /* "petsc4py/PETSc/TAO.pyx":528
 *             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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":529
 *             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, 529, __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":530
 *         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, <void*>context))
*/
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 530, __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) != (0)) __PYX_ERR(52, 530, __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) != (0)) __PYX_ERR(52, 530, __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) != (0)) __PYX_ERR(52, 530, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":531
 *         if kargs is None: kargs = {}
 *         context = (varbounds, args, kargs)
 *         self.set_attr("__varbounds__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetVariableBoundsRoutine(self.tao, TAO_VarBounds, <void*>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, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":532
 *         context = (varbounds, args, kargs)
 *         self.set_attr("__varbounds__", context)
 *         CHKERR(TaoSetVariableBoundsRoutine(self.tao, TAO_VarBounds, <void*>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, 532, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":498
 *         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 lower and upper 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":534
 *         CHKERR(TaoSetVariableBoundsRoutine(self.tao, TAO_VarBounds, <void*>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_49setConstraints(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_48setConstraints, "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:534");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_49setConstraints = {"setConstraints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_49setConstraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_48setConstraints};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_49setConstraints(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_constraints,&__pyx_mstate_global->__pyx_n_u_C,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 534, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 534, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 534, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 534, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 534, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setConstraints", 0) < (0)) __PYX_ERR(52, 534, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setConstraints", 0, 1, 4, i); __PYX_ERR(52, 534, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 534, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 534, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 534, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 534, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 534, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "C", 0))) __PYX_ERR(52, 534, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_48setConstraints(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_48setConstraints(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":555
 * 
 *         """
 *         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":556
 *         """
 *         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":557
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":558
 *         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, 558, __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":559
 *         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, <void*>context))
*/
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 559, __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) != (0)) __PYX_ERR(52, 559, __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) != (0)) __PYX_ERR(52, 559, __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) != (0)) __PYX_ERR(52, 559, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":560
 *         if kargs is None: kargs = {}
 *         context = (constraints, args, kargs)
 *         self.set_attr("__constraints__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, <void*>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, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":561
 *         context = (constraints, args, kargs)
 *         self.set_attr("__constraints__", context)
 *         CHKERR(TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, <void*>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, 561, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":534
 *         CHKERR(TaoSetVariableBoundsRoutine(self.tao, TAO_VarBounds, <void*>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":563
 *         CHKERR(TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, <void*>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_51setHessian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_50setHessian, "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:563");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_51setHessian = {"setHessian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_51setHessian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_50setHessian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_51setHessian(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_hessian,&__pyx_mstate_global->__pyx_n_u_H,&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 563, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(52, 563, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 563, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 563, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 563, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 563, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setHessian", 0) < (0)) __PYX_ERR(52, 563, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TAO.pyx":564
 * 
 *     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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setHessian", 0, 1, 5, i); __PYX_ERR(52, 563, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(52, 563, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 563, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 563, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 563, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 563, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TAO.pyx":563
 *         CHKERR(TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, <void*>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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TAO.pyx":564
 * 
 *     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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 563, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "H", 0))) __PYX_ERR(52, 563, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(52, 563, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_50setHessian(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_hessian, __pyx_v_H, __pyx_v_P, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TAO.pyx":563
 *         CHKERR(TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, <void*>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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_50setHessian(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":588
 * 
 *         """
 *         cdef PetscMat Hmat = NULL             # <<<<<<<<<<<<<<
 *         if H is not None: Hmat = H.mat
 *         cdef PetscMat Pmat = Hmat
*/
  __pyx_v_Hmat = NULL;

  /* "petsc4py/PETSc/TAO.pyx":589
 *         """
 *         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":590
 *         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":591
 *         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":592
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":593
 *         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, 593, __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":594
 *         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, <void*>context))
*/
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 594, __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) != (0)) __PYX_ERR(52, 594, __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) != (0)) __PYX_ERR(52, 594, __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) != (0)) __PYX_ERR(52, 594, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":595
 *         if kargs is None: kargs = {}
 *         context = (hessian, args, kargs)
 *         self.set_attr("__hessian__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetHessian(self.tao, Hmat, Pmat, TAO_Hessian, <void*>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, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":596
 *         context = (hessian, args, kargs)
 *         self.set_attr("__hessian__", context)
 *         CHKERR(TaoSetHessian(self.tao, Hmat, Pmat, TAO_Hessian, <void*>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, 596, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":563
 *         CHKERR(TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, <void*>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":598
 *         CHKERR(TaoSetHessian(self.tao, Hmat, Pmat, TAO_Hessian, <void*>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_53getHessian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_52getHessian, "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:598");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_53getHessian = {"getHessian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_53getHessian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_52getHessian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_53getHessian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getHessian", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_52getHessian(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_52getHessian(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getHessian", 0);

  /* "petsc4py/PETSc/TAO.pyx":608
 * 
 *         """
 *         cdef Mat J = Mat()             # <<<<<<<<<<<<<<
 *         cdef Mat P = Mat()
 *         CHKERR(TaoGetHessian(self.tao, &J.mat, &P.mat, NULL, NULL))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 608, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":609
 *         """
 *         cdef Mat J = Mat()
 *         cdef Mat P = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetHessian(self.tao, &J.mat, &P.mat, NULL, NULL))
 *         CHKERR(PetscINCREF(J.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 609, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_P = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":610
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetHessian(__pyx_v_self->tao, (&__pyx_v_J->mat), (&__pyx_v_P->mat), NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 610, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":611
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 611, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":612
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_P->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 612, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":613
 *         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, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_hessian = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":614
 *         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, 614, __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)) != (0)) __PYX_ERR(52, 614, __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)) != (0)) __PYX_ERR(52, 614, __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) != (0)) __PYX_ERR(52, 614, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":598
 *         CHKERR(TaoSetHessian(self.tao, Hmat, Pmat, TAO_Hessian, <void*>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_XDECREF(__pyx_t_2);
  __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":616
 *         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_55setJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_54setJacobian, "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:616");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_55setJacobian = {"setJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_55setJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_54setJacobian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_55setJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_jacobian,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 616, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(52, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setJacobian", 0) < (0)) __PYX_ERR(52, 616, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TAO.pyx":617
 * 
 *     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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setJacobian", 0, 1, 5, i); __PYX_ERR(52, 616, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(52, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 616, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 616, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TAO.pyx":616
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TAO.pyx":617
 * 
 *     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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 616, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(52, 616, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(52, 616, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_54setJacobian(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TAO.pyx":616
 *         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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_54setJacobian(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":640
 * 
 *         """
 *         cdef PetscMat Jmat = NULL             # <<<<<<<<<<<<<<
 *         if J is not None: Jmat = J.mat
 *         cdef PetscMat Pmat = Jmat
*/
  __pyx_v_Jmat = NULL;

  /* "petsc4py/PETSc/TAO.pyx":641
 *         """
 *         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":642
 *         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":643
 *         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":644
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":645
 *         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, 645, __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":646
 *         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, <void*>context))
*/
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 646, __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) != (0)) __PYX_ERR(52, 646, __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) != (0)) __PYX_ERR(52, 646, __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) != (0)) __PYX_ERR(52, 646, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":647
 *         if kargs is None: kargs = {}
 *         context = (jacobian, args, kargs)
 *         self.set_attr("__jacobian__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetJacobianRoutine(self.tao, Jmat, Pmat, TAO_Jacobian, <void*>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, 647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":648
 *         context = (jacobian, args, kargs)
 *         self.set_attr("__jacobian__", context)
 *         CHKERR(TaoSetJacobianRoutine(self.tao, Jmat, Pmat, TAO_Jacobian, <void*>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, 648, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":616
 *         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":650
 *         CHKERR(TaoSetJacobianRoutine(self.tao, Jmat, Pmat, TAO_Jacobian, <void*>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_57setStateDesignIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_56setStateDesignIS, "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:650");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_57setStateDesignIS = {"setStateDesignIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_57setStateDesignIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_56setStateDesignIS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_57setStateDesignIS(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_design,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 650, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 650, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 650, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setStateDesignIS", 0) < (0)) __PYX_ERR(52, 650, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 650, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 650, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
    }
    __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, 650, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 1, "state", 0))) __PYX_ERR(52, 650, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_design), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 1, "design", 0))) __PYX_ERR(52, 650, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_56setStateDesignIS(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_state, __pyx_v_design);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_56setStateDesignIS(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":660
 * 
 *         """
 *         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":661
 *         """
 *         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":662
 *         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":663
 *         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, 663, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":650
 *         CHKERR(TaoSetJacobianRoutine(self.tao, Jmat, Pmat, TAO_Jacobian, <void*>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":665
 *         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_59setJacobianState(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_58setJacobianState, "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:665");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_59setJacobianState = {"setJacobianState", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_59setJacobianState, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_58setJacobianState};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_59setJacobianState(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_jacobian_state,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_I,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 665, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(52, 665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(52, 665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setJacobianState", 0) < (0)) __PYX_ERR(52, 665, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TAO.pyx":666
 * 
 *     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.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setJacobianState", 0, 1, 6, i); __PYX_ERR(52, 665, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(52, 665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(52, 665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 665, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 665, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TAO.pyx":665
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TAO.pyx":666
 * 
 *     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.
 * 
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 665, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(52, 665, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(52, 665, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_I), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "I", 0))) __PYX_ERR(52, 665, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_58setJacobianState(((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":665
 *         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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_58setJacobianState(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":676
 * 
 *         """
 *         cdef PetscMat Jmat = NULL             # <<<<<<<<<<<<<<
 *         if J is not None: Jmat = J.mat
 *         cdef PetscMat Pmat = Jmat
*/
  __pyx_v_Jmat = NULL;

  /* "petsc4py/PETSc/TAO.pyx":677
 *         """
 *         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":678
 *         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":679
 *         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":680
 *         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":681
 *         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":682
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":683
 *         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, 683, __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":684
 *         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, 684, __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) != (0)) __PYX_ERR(52, 684, __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) != (0)) __PYX_ERR(52, 684, __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) != (0)) __PYX_ERR(52, 684, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":685
 *         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, <void*>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, 685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":686
 *         context = (jacobian_state, args, kargs)
 *         self.set_attr("__jacobian_state__", context)
 *         CHKERR(TaoSetJacobianStateRoutine(self.tao, Jmat, Pmat, Imat,             # <<<<<<<<<<<<<<
 *                                           TAO_JacobianState, <void*>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, 686, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":665
 *         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":689
 *                                           TAO_JacobianState, <void*>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_61setJacobianDesign(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_60setJacobianDesign, "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:689");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_61setJacobianDesign = {"setJacobianDesign", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_61setJacobianDesign, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_60setJacobianDesign};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_61setJacobianDesign(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_jacobian_design,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 689, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 689, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 689, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 689, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 689, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setJacobianDesign", 0) < (0)) __PYX_ERR(52, 689, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TAO.pyx":690
 * 
 *     def setJacobianDesign(self, jacobian_design, Mat J=None,
 *                           args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set Jacobian design callback.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setJacobianDesign", 0, 1, 4, i); __PYX_ERR(52, 689, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 689, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 689, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 689, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 689, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TAO.pyx":689
 *                                           TAO_JacobianState, <void*>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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TAO.pyx":690
 * 
 *     def setJacobianDesign(self, jacobian_design, Mat J=None,
 *                           args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set Jacobian design callback.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 689, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(52, 689, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_60setJacobianDesign(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_jacobian_design, __pyx_v_J, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TAO.pyx":689
 *                                           TAO_JacobianState, <void*>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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_60setJacobianDesign(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":700
 * 
 *         """
 *         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":701
 *         """
 *         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":702
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":703
 *         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, 703, __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":704
 *         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, 704, __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) != (0)) __PYX_ERR(52, 704, __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) != (0)) __PYX_ERR(52, 704, __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) != (0)) __PYX_ERR(52, 704, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":705
 *         if kargs is None: kargs = {}
 *         context = (jacobian_design, args, kargs)
 *         self.set_attr("__jacobian_design__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetJacobianDesignRoutine(self.tao, Jmat,
 *                                            TAO_JacobianDesign, <void*>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, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":706
 *         context = (jacobian_design, args, kargs)
 *         self.set_attr("__jacobian_design__", context)
 *         CHKERR(TaoSetJacobianDesignRoutine(self.tao, Jmat,             # <<<<<<<<<<<<<<
 *                                            TAO_JacobianDesign, <void*>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, 706, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":689
 *                                           TAO_JacobianState, <void*>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":709
 *                                            TAO_JacobianDesign, <void*>context))
 * 
 *     def getLMVMMat(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Get the LMVM matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_63getLMVMMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_62getLMVMMat, "TAO.getLMVMMat(self) -> Mat\nGet the LMVM matrix.\n\n        Not collective.\n\n        See Also\n        --------\n        setLMVMMat, petsc.TaoGetLMVMMatrix\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:709");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_63getLMVMMat = {"getLMVMMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_63getLMVMMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_62getLMVMMat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_63getLMVMMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getLMVMMat (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLMVMMat", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLMVMMat", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_62getLMVMMat(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_62getLMVMMat(struct PyPetscTAOObject *__pyx_v_self) {
  struct PyPetscMatObject *__pyx_v_M = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLMVMMat", 0);

  /* "petsc4py/PETSc/TAO.pyx":719
 * 
 *         """
 *         cdef Mat M = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetLMVMMatrix(self.tao, &M.mat))
 *         CHKERR(PetscINCREF(M.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 719, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_M = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":720
 *         """
 *         cdef Mat M = Mat()
 *         CHKERR(TaoGetLMVMMatrix(self.tao, &M.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(M.obj))
 *         return M
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetLMVMMatrix(__pyx_v_self->tao, (&__pyx_v_M->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 720, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":721
 *         cdef Mat M = Mat()
 *         CHKERR(TaoGetLMVMMatrix(self.tao, &M.mat))
 *         CHKERR(PetscINCREF(M.obj))             # <<<<<<<<<<<<<<
 *         return M
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_M->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 721, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":722
 *         CHKERR(TaoGetLMVMMatrix(self.tao, &M.mat))
 *         CHKERR(PetscINCREF(M.obj))
 *         return M             # <<<<<<<<<<<<<<
 * 
 *     def setLMVMMat(self, Mat M) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_M);
  __pyx_r = ((PyObject *)__pyx_v_M);
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":709
 *                                            TAO_JacobianDesign, <void*>context))
 * 
 *     def getLMVMMat(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Get the LMVM matrix.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.getLMVMMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_M);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TAO.pyx":724
 *         return M
 * 
 *     def setLMVMMat(self, Mat M) -> None:             # <<<<<<<<<<<<<<
 *         """Set the LMVM matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_65setLMVMMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_64setLMVMMat, "TAO.setLMVMMat(self, M: Mat) -> None\nSet the LMVM matrix.\n\n        Logically collective.\n\n        See Also\n        --------\n        getLMVMMat, petsc.TaoSetLMVMMatrix\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:724");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_65setLMVMMat = {"setLMVMMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_65setLMVMMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_64setLMVMMat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_65setLMVMMat(PyObject *__pyx_v_self, 
#if 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_M = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setLMVMMat (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_M,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 724, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 724, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLMVMMat", 0) < (0)) __PYX_ERR(52, 724, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLMVMMat", 1, 1, 1, i); __PYX_ERR(52, 724, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 724, __pyx_L3_error)
    }
    __pyx_v_M = ((struct PyPetscMatObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setLMVMMat", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 724, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.setLMVMMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_M), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "M", 0))) __PYX_ERR(52, 724, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_64setLMVMMat(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_M);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_64setLMVMMat(struct PyPetscTAOObject *__pyx_v_self, struct PyPetscMatObject *__pyx_v_M) {
  Mat __pyx_v_ctype;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Mat __pyx_t_1;
  PetscErrorCode __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setLMVMMat", 0);

  /* "petsc4py/PETSc/TAO.pyx":734
 * 
 *         """
 *         cdef PetscMat ctype = M.mat             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetLMVMMatrix(self.tao, ctype))
 * 
*/
  __pyx_t_1 = __pyx_v_M->mat;
  __pyx_v_ctype = __pyx_t_1;

  /* "petsc4py/PETSc/TAO.pyx":735
 *         """
 *         cdef PetscMat ctype = M.mat
 *         CHKERR(TaoSetLMVMMatrix(self.tao, ctype))             # <<<<<<<<<<<<<<
 * 
 *     def setEqualityConstraints(self, equality_constraints, Vec c,
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetLMVMMatrix(__pyx_v_self->tao, __pyx_v_ctype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 735, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":724
 *         return M
 * 
 *     def setLMVMMat(self, Mat M) -> None:             # <<<<<<<<<<<<<<
 *         """Set the LMVM matrix.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.setLMVMMat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TAO.pyx":737
 *         CHKERR(TaoSetLMVMMatrix(self.tao, ctype))
 * 
 *     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_67setEqualityConstraints(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_66setEqualityConstraints, "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:737");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_67setEqualityConstraints = {"setEqualityConstraints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_67setEqualityConstraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_66setEqualityConstraints};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_67setEqualityConstraints(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_equality_constraints,&__pyx_mstate_global->__pyx_n_u_c,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 737, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 737, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 737, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 737, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 737, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setEqualityConstraints", 0) < (0)) __PYX_ERR(52, 737, __pyx_L3_error)

      /* "petsc4py/PETSc/TAO.pyx":738
 * 
 *     def setEqualityConstraints(self, equality_constraints, Vec c,
 *                                args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set equality constraints callback.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setEqualityConstraints", 0, 2, 4, i); __PYX_ERR(52, 737, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 737, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 737, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 737, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 737, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 737, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "c", 0))) __PYX_ERR(52, 737, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_66setEqualityConstraints(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_equality_constraints, __pyx_v_c, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TAO.pyx":737
 *         CHKERR(TaoSetLMVMMatrix(self.tao, ctype))
 * 
 *     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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_66setEqualityConstraints(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":748
 * 
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":749
 *         """
 *         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, 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 = (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, 750, __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) != (0)) __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) != (0)) __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) != (0)) __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 = (equality_constraints, args, kargs)
 *         self.set_attr("__equality_constraints__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetEqualityConstraintsRoutine(self.tao, c.vec,
 *                                                 TAO_EqualityConstraints, <void*>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, 751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/TAO.pyx":752
 *         context = (equality_constraints, args, kargs)
 *         self.set_attr("__equality_constraints__", context)
 *         CHKERR(TaoSetEqualityConstraintsRoutine(self.tao, c.vec,             # <<<<<<<<<<<<<<
 *                                                 TAO_EqualityConstraints, <void*>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, 752, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":737
 *         CHKERR(TaoSetLMVMMatrix(self.tao, ctype))
 * 
 *     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":755
 *                                                 TAO_EqualityConstraints, <void*>context))
 * 
 *     def getEqualityConstraints(self) -> tuple[Vec, tuple[TAOConstraintsFunction, tuple[Any, ...] | None, dict[str, Any] | None]]:             # <<<<<<<<<<<<<<
 *         """Return tuple holding vector and callback of equality constraints.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_69getEqualityConstraints(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_68getEqualityConstraints, "TAO.getEqualityConstraints(self) -> tuple[Vec, tuple[TAOConstraintsFunction, tuple[Any, ...] | None, dict[str, Any] | None]]\nReturn tuple holding vector and callback of equality constraints.\n\n        Not collective.\n\n        See Also\n        --------\n        setEqualityConstraints, petsc.TaoGetEqualityConstraintsRoutine\n        \nSource code at petsc4py/PETSc/TAO.pyx:755");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_69getEqualityConstraints = {"getEqualityConstraints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_69getEqualityConstraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_68getEqualityConstraints};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_69getEqualityConstraints(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getEqualityConstraints (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getEqualityConstraints", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getEqualityConstraints", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_68getEqualityConstraints(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_68getEqualityConstraints(struct PyPetscTAOObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_c = 0;
  PyObject *__pyx_v_equality_constraints = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getEqualityConstraints", 0);

  /* "petsc4py/PETSc/TAO.pyx":764
 *         setEqualityConstraints, petsc.TaoGetEqualityConstraintsRoutine
 *         """
 *         cdef Vec c = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetEqualityConstraintsRoutine(self.tao, &c.vec, NULL, NULL))
 *         CHKERR(PetscINCREF(c.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 764, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":765
 *         """
 *         cdef Vec c = Vec()
 *         CHKERR(TaoGetEqualityConstraintsRoutine(self.tao, &c.vec, NULL, NULL))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(c.obj))
 *         cdef object equality_constraints = self.get_attr("__equality_constraints__")
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetEqualityConstraintsRoutine(__pyx_v_self->tao, (&__pyx_v_c->vec), NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 765, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":766
 *         cdef Vec c = Vec()
 *         CHKERR(TaoGetEqualityConstraintsRoutine(self.tao, &c.vec, NULL, NULL))
 *         CHKERR(PetscINCREF(c.obj))             # <<<<<<<<<<<<<<
 *         cdef object equality_constraints = self.get_attr("__equality_constraints__")
 *         return (c, equality_constraints)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_c->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 766, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":767
 *         CHKERR(TaoGetEqualityConstraintsRoutine(self.tao, &c.vec, NULL, NULL))
 *         CHKERR(PetscINCREF(c.obj))
 *         cdef object equality_constraints = self.get_attr("__equality_constraints__")             # <<<<<<<<<<<<<<
 *         return (c, equality_constraints)
 * 
*/
  __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 *)"__equality_constraints__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_equality_constraints = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":768
 *         CHKERR(PetscINCREF(c.obj))
 *         cdef object equality_constraints = self.get_attr("__equality_constraints__")
 *         return (c, equality_constraints)             # <<<<<<<<<<<<<<
 * 
 *     def setJacobianEquality(self, jacobian_equality, Mat J=None, Mat P=None,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_c);
  __Pyx_GIVEREF((PyObject *)__pyx_v_c);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_c)) != (0)) __PYX_ERR(52, 768, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_equality_constraints);
  __Pyx_GIVEREF(__pyx_v_equality_constraints);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_equality_constraints) != (0)) __PYX_ERR(52, 768, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":755
 *                                                 TAO_EqualityConstraints, <void*>context))
 * 
 *     def getEqualityConstraints(self) -> tuple[Vec, tuple[TAOConstraintsFunction, tuple[Any, ...] | None, dict[str, Any] | None]]:             # <<<<<<<<<<<<<<
 *         """Return tuple holding vector and callback of equality constraints.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.getEqualityConstraints", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_equality_constraints);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TAO.pyx":770
 *         return (c, equality_constraints)
 * 
 *     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_71setJacobianEquality(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_70setJacobianEquality, "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:770");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_71setJacobianEquality = {"setJacobianEquality", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_71setJacobianEquality, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_70setJacobianEquality};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_71setJacobianEquality(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_jacobian_equality,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 770, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(52, 770, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 770, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 770, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 770, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 770, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setJacobianEquality", 0) < (0)) __PYX_ERR(52, 770, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TAO.pyx":771
 * 
 *     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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setJacobianEquality", 0, 1, 5, i); __PYX_ERR(52, 770, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(52, 770, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 770, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 770, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 770, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 770, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TAO.pyx":770
 *         return (c, equality_constraints)
 * 
 *     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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TAO.pyx":771
 * 
 *     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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 770, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(52, 770, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(52, 770, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_70setJacobianEquality(((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":770
 *         return (c, equality_constraints)
 * 
 *     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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_70setJacobianEquality(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":781
 * 
 *         """
 *         cdef PetscMat Jmat = NULL             # <<<<<<<<<<<<<<
 *         if J is not None: Jmat = J.mat
 *         cdef PetscMat Pmat = Jmat
*/
  __pyx_v_Jmat = NULL;

  /* "petsc4py/PETSc/TAO.pyx":782
 *         """
 *         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":783
 *         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":784
 *         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":785
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":786
 *         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, 786, __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":787
 *         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, 787, __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) != (0)) __PYX_ERR(52, 787, __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) != (0)) __PYX_ERR(52, 787, __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) != (0)) __PYX_ERR(52, 787, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":788
 *         if kargs is None: kargs = {}
 *         context = (jacobian_equality, args, kargs)
 *         self.set_attr("__jacobian_equality__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetJacobianEqualityRoutine(self.tao, Jmat, Pmat,
 *                                              TAO_JacobianEquality, <void*>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, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":789
 *         context = (jacobian_equality, args, kargs)
 *         self.set_attr("__jacobian_equality__", context)
 *         CHKERR(TaoSetJacobianEqualityRoutine(self.tao, Jmat, Pmat,             # <<<<<<<<<<<<<<
 *                                              TAO_JacobianEquality, <void*>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, 789, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":770
 *         return (c, equality_constraints)
 * 
 *     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":792
 *                                              TAO_JacobianEquality, <void*>context))
 * 
 *     def getJacobianEquality(self) -> tuple[Mat, Mat, tuple[TAOConstraintsJacobianFunction, tuple[Any, ...] | None,             # <<<<<<<<<<<<<<
 *                                            dict[str, Any] | None]]:
 *         """Return matrix, precon matrix and callback of equality constraints Jacobian.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_73getJacobianEquality(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_72getJacobianEquality, "TAO.getJacobianEquality(self) -> tuple[Mat, Mat, tuple[TAOConstraintsJacobianFunction, tuple[Any, ...] | None, dict[str, Any] | None]]\nReturn matrix, precon matrix and callback of equality constraints Jacobian.\n\n        Not collective.\n\n        See Also\n        --------\n        setJacobianEquality, petsc.TaoGetJacobianEqualityRoutine\n        \nSource code at petsc4py/PETSc/TAO.pyx:792");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_73getJacobianEquality = {"getJacobianEquality", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_73getJacobianEquality, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_72getJacobianEquality};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_73getJacobianEquality(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getJacobianEquality (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getJacobianEquality", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getJacobianEquality", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_72getJacobianEquality(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_72getJacobianEquality(struct PyPetscTAOObject *__pyx_v_self) {
  struct PyPetscMatObject *__pyx_v_J = 0;
  struct PyPetscMatObject *__pyx_v_Jpre = 0;
  PyObject *__pyx_v_jacobian_equality = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getJacobianEquality", 0);

  /* "petsc4py/PETSc/TAO.pyx":802
 *         setJacobianEquality, petsc.TaoGetJacobianEqualityRoutine
 *         """
 *         cdef Mat J = Mat()             # <<<<<<<<<<<<<<
 *         cdef Mat Jpre = Mat()
 *         CHKERR(TaoGetJacobianEqualityRoutine(self.tao, &J.mat, &Jpre.mat, NULL, NULL))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 802, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":803
 *         """
 *         cdef Mat J = Mat()
 *         cdef Mat Jpre = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetJacobianEqualityRoutine(self.tao, &J.mat, &Jpre.mat, NULL, NULL))
 *         CHKERR(PetscINCREF(J.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 803, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_Jpre = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":804
 *         cdef Mat J = Mat()
 *         cdef Mat Jpre = Mat()
 *         CHKERR(TaoGetJacobianEqualityRoutine(self.tao, &J.mat, &Jpre.mat, NULL, NULL))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(J.obj))
 *         CHKERR(PetscINCREF(Jpre.obj))
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetJacobianEqualityRoutine(__pyx_v_self->tao, (&__pyx_v_J->mat), (&__pyx_v_Jpre->mat), NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 804, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":805
 *         cdef Mat Jpre = Mat()
 *         CHKERR(TaoGetJacobianEqualityRoutine(self.tao, &J.mat, &Jpre.mat, NULL, NULL))
 *         CHKERR(PetscINCREF(J.obj))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(Jpre.obj))
 *         cdef object jacobian_equality = self.get_attr("__jacobian_equality__")
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 805, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":806
 *         CHKERR(TaoGetJacobianEqualityRoutine(self.tao, &J.mat, &Jpre.mat, NULL, NULL))
 *         CHKERR(PetscINCREF(J.obj))
 *         CHKERR(PetscINCREF(Jpre.obj))             # <<<<<<<<<<<<<<
 *         cdef object jacobian_equality = self.get_attr("__jacobian_equality__")
 *         return (J, Jpre, jacobian_equality)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Jpre->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 806, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":807
 *         CHKERR(PetscINCREF(J.obj))
 *         CHKERR(PetscINCREF(Jpre.obj))
 *         cdef object jacobian_equality = self.get_attr("__jacobian_equality__")             # <<<<<<<<<<<<<<
 *         return (J, Jpre, jacobian_equality)
 * 
*/
  __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 *)"__jacobian_equality__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_jacobian_equality = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":808
 *         CHKERR(PetscINCREF(Jpre.obj))
 *         cdef object jacobian_equality = self.get_attr("__jacobian_equality__")
 *         return (J, Jpre, jacobian_equality)             # <<<<<<<<<<<<<<
 * 
 *     def setInequalityConstraints(self, inequality_constraints, Vec c,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 808, __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)) != (0)) __PYX_ERR(52, 808, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_Jpre);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Jpre);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_Jpre)) != (0)) __PYX_ERR(52, 808, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_jacobian_equality);
  __Pyx_GIVEREF(__pyx_v_jacobian_equality);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_jacobian_equality) != (0)) __PYX_ERR(52, 808, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":792
 *                                              TAO_JacobianEquality, <void*>context))
 * 
 *     def getJacobianEquality(self) -> tuple[Mat, Mat, tuple[TAOConstraintsJacobianFunction, tuple[Any, ...] | None,             # <<<<<<<<<<<<<<
 *                                            dict[str, Any] | None]]:
 *         """Return matrix, precon matrix and callback of equality constraints Jacobian.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.getJacobianEquality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_J);
  __Pyx_XDECREF((PyObject *)__pyx_v_Jpre);
  __Pyx_XDECREF(__pyx_v_jacobian_equality);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TAO.pyx":810
 *         return (J, Jpre, jacobian_equality)
 * 
 *     def setInequalityConstraints(self, inequality_constraints, Vec c,             # <<<<<<<<<<<<<<
 *                                  args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:
 *         """Set inequality constraints callback.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_75setInequalityConstraints(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_74setInequalityConstraints, "TAO.setInequalityConstraints(self, inequality_constraints, c: Vec, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet inequality constraints callback.\n\n        Logically collective.\n\n        See Also\n        --------\n        petsc.TaoSetInequalityConstraintsRoutine\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:810");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_75setInequalityConstraints = {"setInequalityConstraints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_75setInequalityConstraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_74setInequalityConstraints};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_75setInequalityConstraints(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_inequality_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("setInequalityConstraints (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_inequality_constraints,&__pyx_mstate_global->__pyx_n_u_c,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 810, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 810, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 810, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 810, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 810, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setInequalityConstraints", 0) < (0)) __PYX_ERR(52, 810, __pyx_L3_error)

      /* "petsc4py/PETSc/TAO.pyx":811
 * 
 *     def setInequalityConstraints(self, inequality_constraints, Vec c,
 *                                  args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set inequality constraints callback.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setInequalityConstraints", 0, 2, 4, i); __PYX_ERR(52, 810, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 810, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 810, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 810, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 810, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_inequality_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("setInequalityConstraints", 0, 2, 4, __pyx_nargs); __PYX_ERR(52, 810, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.setInequalityConstraints", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "c", 0))) __PYX_ERR(52, 810, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_74setInequalityConstraints(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_inequality_constraints, __pyx_v_c, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TAO.pyx":810
 *         return (J, Jpre, jacobian_equality)
 * 
 *     def setInequalityConstraints(self, inequality_constraints, Vec c,             # <<<<<<<<<<<<<<
 *                                  args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:
 *         """Set inequality constraints callback.
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_74setInequalityConstraints(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_inequality_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("setInequalityConstraints", 0);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_INCREF(__pyx_v_kargs);

  /* "petsc4py/PETSc/TAO.pyx":821
 * 
 *         """
 *         if args is None: args = ()             # <<<<<<<<<<<<<<
 *         if kargs is None: kargs = {}
 *         context = (inequality_constraints, args, kargs)
*/
  __pyx_t_1 = (__pyx_v_args == Py_None);
  if (__pyx_t_1) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":822
 *         """
 *         if args is None: args = ()
 *         if kargs is None: kargs = {}             # <<<<<<<<<<<<<<
 *         context = (inequality_constraints, args, kargs)
 *         self.set_attr("__inequality_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, 822, __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":823
 *         if args is None: args = ()
 *         if kargs is None: kargs = {}
 *         context = (inequality_constraints, args, kargs)             # <<<<<<<<<<<<<<
 *         self.set_attr("__inequality_constraints__", context)
 *         CHKERR(TaoSetInequalityConstraintsRoutine(self.tao, c.vec,
*/
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_inequality_constraints);
  __Pyx_GIVEREF(__pyx_v_inequality_constraints);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_inequality_constraints) != (0)) __PYX_ERR(52, 823, __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) != (0)) __PYX_ERR(52, 823, __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) != (0)) __PYX_ERR(52, 823, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/TAO.pyx":824
 *         if kargs is None: kargs = {}
 *         context = (inequality_constraints, args, kargs)
 *         self.set_attr("__inequality_constraints__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetInequalityConstraintsRoutine(self.tao, c.vec,
 *                                                   TAO_InequalityConstraints, <void*>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 *)"__inequality_constraints__"), __pyx_v_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/TAO.pyx":825
 *         context = (inequality_constraints, args, kargs)
 *         self.set_attr("__inequality_constraints__", context)
 *         CHKERR(TaoSetInequalityConstraintsRoutine(self.tao, c.vec,             # <<<<<<<<<<<<<<
 *                                                   TAO_InequalityConstraints, <void*>context))
 * 
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetInequalityConstraintsRoutine(__pyx_v_self->tao, __pyx_v_c->vec, __pyx_f_8petsc4py_5PETSc_TAO_InequalityConstraints, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 825, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":810
 *         return (J, Jpre, jacobian_equality)
 * 
 *     def setInequalityConstraints(self, inequality_constraints, Vec c,             # <<<<<<<<<<<<<<
 *                                  args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:
 *         """Set inequality 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.setInequalityConstraints", __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":828
 *                                                   TAO_InequalityConstraints, <void*>context))
 * 
 *     def getInequalityConstraints(self) -> tuple[Vec, tuple[TAOConstraintsFunction, tuple[Any, ...] | None, dict[str, Any] | None]]:             # <<<<<<<<<<<<<<
 *         """Return tuple holding vector and callback of inequality constraints.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_77getInequalityConstraints(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_76getInequalityConstraints, "TAO.getInequalityConstraints(self) -> tuple[Vec, tuple[TAOConstraintsFunction, tuple[Any, ...] | None, dict[str, Any] | None]]\nReturn tuple holding vector and callback of inequality constraints.\n\n        Not collective.\n\n        See Also\n        --------\n        setInequalityConstraints, petsc.TaoGetInequalityConstraintsRoutine\n        \nSource code at petsc4py/PETSc/TAO.pyx:828");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_77getInequalityConstraints = {"getInequalityConstraints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_77getInequalityConstraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_76getInequalityConstraints};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_77getInequalityConstraints(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getInequalityConstraints (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getInequalityConstraints", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getInequalityConstraints", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_76getInequalityConstraints(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_76getInequalityConstraints(struct PyPetscTAOObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_c = 0;
  PyObject *__pyx_v_inequality_constraints = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getInequalityConstraints", 0);

  /* "petsc4py/PETSc/TAO.pyx":837
 *         setInequalityConstraints, petsc.TaoGetInequalityConstraintsRoutine
 *         """
 *         cdef Vec c = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetInequalityConstraintsRoutine(self.tao, &c.vec, NULL, NULL))
 *         CHKERR(PetscINCREF(c.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 837, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":838
 *         """
 *         cdef Vec c = Vec()
 *         CHKERR(TaoGetInequalityConstraintsRoutine(self.tao, &c.vec, NULL, NULL))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(c.obj))
 *         cdef object inequality_constraints = self.get_attr("__inequality_constraints__")
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetInequalityConstraintsRoutine(__pyx_v_self->tao, (&__pyx_v_c->vec), NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 838, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":839
 *         cdef Vec c = Vec()
 *         CHKERR(TaoGetInequalityConstraintsRoutine(self.tao, &c.vec, NULL, NULL))
 *         CHKERR(PetscINCREF(c.obj))             # <<<<<<<<<<<<<<
 *         cdef object inequality_constraints = self.get_attr("__inequality_constraints__")
 *         return (c, inequality_constraints)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_c->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 839, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":840
 *         CHKERR(TaoGetInequalityConstraintsRoutine(self.tao, &c.vec, NULL, NULL))
 *         CHKERR(PetscINCREF(c.obj))
 *         cdef object inequality_constraints = self.get_attr("__inequality_constraints__")             # <<<<<<<<<<<<<<
 *         return (c, inequality_constraints)
 * 
*/
  __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 *)"__inequality_constraints__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_inequality_constraints = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":841
 *         CHKERR(PetscINCREF(c.obj))
 *         cdef object inequality_constraints = self.get_attr("__inequality_constraints__")
 *         return (c, inequality_constraints)             # <<<<<<<<<<<<<<
 * 
 *     def setJacobianInequality(self, jacobian_inequality, Mat J=None, Mat P=None,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_c);
  __Pyx_GIVEREF((PyObject *)__pyx_v_c);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_c)) != (0)) __PYX_ERR(52, 841, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_inequality_constraints);
  __Pyx_GIVEREF(__pyx_v_inequality_constraints);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_inequality_constraints) != (0)) __PYX_ERR(52, 841, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":828
 *                                                   TAO_InequalityConstraints, <void*>context))
 * 
 *     def getInequalityConstraints(self) -> tuple[Vec, tuple[TAOConstraintsFunction, tuple[Any, ...] | None, dict[str, Any] | None]]:             # <<<<<<<<<<<<<<
 *         """Return tuple holding vector and callback of inequality constraints.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.getInequalityConstraints", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_inequality_constraints);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TAO.pyx":843
 *         return (c, inequality_constraints)
 * 
 *     def setJacobianInequality(self, jacobian_inequality, Mat J=None, Mat P=None,             # <<<<<<<<<<<<<<
 *                               args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:
 *         """Set Jacobian inequality constraints callback.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_79setJacobianInequality(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_78setJacobianInequality, "TAO.setJacobianInequality(self, jacobian_inequality, J: Mat | None = None, P: Mat | None = None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None\nSet Jacobian inequality constraints callback.\n\n        Logically collective.\n\n        See Also\n        --------\n        petsc.TaoSetJacobianInequalityRoutine\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:843");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_79setJacobianInequality = {"setJacobianInequality", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_79setJacobianInequality, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_78setJacobianInequality};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_79setJacobianInequality(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_inequality = 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("setJacobianInequality (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_jacobian_inequality,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_P,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 843, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(52, 843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setJacobianInequality", 0) < (0)) __PYX_ERR(52, 843, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TAO.pyx":844
 * 
 *     def setJacobianInequality(self, jacobian_inequality, Mat J=None, Mat P=None,
 *                               args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set Jacobian inequality constraints callback.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setJacobianInequality", 0, 1, 5, i); __PYX_ERR(52, 843, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(52, 843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 843, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/TAO.pyx":843
 *         return (c, inequality_constraints)
 * 
 *     def setJacobianInequality(self, jacobian_inequality, Mat J=None, Mat P=None,             # <<<<<<<<<<<<<<
 *                               args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:
 *         """Set Jacobian inequality constraints callback.
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));

      /* "petsc4py/PETSc/TAO.pyx":844
 * 
 *     def setJacobianInequality(self, jacobian_inequality, Mat J=None, Mat P=None,
 *                               args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set Jacobian inequality constraints callback.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_jacobian_inequality = 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("setJacobianInequality", 0, 1, 5, __pyx_nargs); __PYX_ERR(52, 843, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.setJacobianInequality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "J", 0))) __PYX_ERR(52, 843, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(52, 843, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_78setJacobianInequality(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_jacobian_inequality, __pyx_v_J, __pyx_v_P, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/TAO.pyx":843
 *         return (c, inequality_constraints)
 * 
 *     def setJacobianInequality(self, jacobian_inequality, Mat J=None, Mat P=None,             # <<<<<<<<<<<<<<
 *                               args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:
 *         """Set Jacobian inequality constraints callback.
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_78setJacobianInequality(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_jacobian_inequality, 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("setJacobianInequality", 0);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_INCREF(__pyx_v_kargs);

  /* "petsc4py/PETSc/TAO.pyx":854
 * 
 *         """
 *         cdef PetscMat Jmat = NULL             # <<<<<<<<<<<<<<
 *         if J is not None: Jmat = J.mat
 *         cdef PetscMat Pmat = Jmat
*/
  __pyx_v_Jmat = NULL;

  /* "petsc4py/PETSc/TAO.pyx":855
 *         """
 *         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":856
 *         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":857
 *         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":858
 *         cdef PetscMat Pmat = Jmat
 *         if P is not None: Pmat = P.mat
 *         if args is None: args = ()             # <<<<<<<<<<<<<<
 *         if kargs is None: kargs = {}
 *         context = (jacobian_inequality, args, kargs)
*/
  __pyx_t_1 = (__pyx_v_args == Py_None);
  if (__pyx_t_1) {
    __Pyx_INCREF(__pyx_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":859
 *         if P is not None: Pmat = P.mat
 *         if args is None: args = ()
 *         if kargs is None: kargs = {}             # <<<<<<<<<<<<<<
 *         context = (jacobian_inequality, args, kargs)
 *         self.set_attr("__jacobian_inequality__", 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, 859, __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":860
 *         if args is None: args = ()
 *         if kargs is None: kargs = {}
 *         context = (jacobian_inequality, args, kargs)             # <<<<<<<<<<<<<<
 *         self.set_attr("__jacobian_inequality__", context)
 *         CHKERR(TaoSetJacobianInequalityRoutine(self.tao, Jmat, Pmat,
*/
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_jacobian_inequality);
  __Pyx_GIVEREF(__pyx_v_jacobian_inequality);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_jacobian_inequality) != (0)) __PYX_ERR(52, 860, __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) != (0)) __PYX_ERR(52, 860, __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) != (0)) __PYX_ERR(52, 860, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":861
 *         if kargs is None: kargs = {}
 *         context = (jacobian_inequality, args, kargs)
 *         self.set_attr("__jacobian_inequality__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetJacobianInequalityRoutine(self.tao, Jmat, Pmat,
 *                                                TAO_JacobianInequality, <void*>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_inequality__"), __pyx_v_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":862
 *         context = (jacobian_inequality, args, kargs)
 *         self.set_attr("__jacobian_inequality__", context)
 *         CHKERR(TaoSetJacobianInequalityRoutine(self.tao, Jmat, Pmat,             # <<<<<<<<<<<<<<
 *                                                TAO_JacobianInequality, <void*>context))
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoSetJacobianInequalityRoutine(__pyx_v_self->tao, __pyx_v_Jmat, __pyx_v_Pmat, __pyx_f_8petsc4py_5PETSc_TAO_JacobianInequality, ((void *)__pyx_v_context))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 862, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":843
 *         return (c, inequality_constraints)
 * 
 *     def setJacobianInequality(self, jacobian_inequality, Mat J=None, Mat P=None,             # <<<<<<<<<<<<<<
 *                               args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:
 *         """Set Jacobian inequality 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.setJacobianInequality", __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":865
 *                                                TAO_JacobianInequality, <void*>context))
 * 
 *     def getJacobianInequality(self) -> tuple[Mat, Mat, tuple[TAOConstraintsJacobianFunction, tuple[Any, ...] | None, dict[str, Any] | None]]:             # <<<<<<<<<<<<<<
 *         """Return matrix, precon matrix and callback of ineq. constraints Jacobian.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_81getJacobianInequality(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_80getJacobianInequality, "TAO.getJacobianInequality(self) -> tuple[Mat, Mat, tuple[TAOConstraintsJacobianFunction, tuple[Any, ...] | None, dict[str, Any] | None]]\nReturn matrix, precon matrix and callback of ineq. constraints Jacobian.\n\n        Not collective.\n\n        See Also\n        --------\n        setJacobianInequality, petsc.TaoGetJacobianInequalityRoutine\n        \nSource code at petsc4py/PETSc/TAO.pyx:865");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_81getJacobianInequality = {"getJacobianInequality", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_81getJacobianInequality, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_80getJacobianInequality};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_81getJacobianInequality(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getJacobianInequality (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getJacobianInequality", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getJacobianInequality", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_80getJacobianInequality(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_80getJacobianInequality(struct PyPetscTAOObject *__pyx_v_self) {
  struct PyPetscMatObject *__pyx_v_J = 0;
  struct PyPetscMatObject *__pyx_v_Jpre = 0;
  PyObject *__pyx_v_jacobian_inequality = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getJacobianInequality", 0);

  /* "petsc4py/PETSc/TAO.pyx":874
 *         setJacobianInequality, petsc.TaoGetJacobianInequalityRoutine
 *         """
 *         cdef Mat J = Mat()             # <<<<<<<<<<<<<<
 *         cdef Mat Jpre = Mat()
 *         CHKERR(TaoGetJacobianInequalityRoutine(self.tao, &J.mat, &Jpre.mat, NULL, NULL))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 874, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_J = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":875
 *         """
 *         cdef Mat J = Mat()
 *         cdef Mat Jpre = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetJacobianInequalityRoutine(self.tao, &J.mat, &Jpre.mat, NULL, NULL))
 *         CHKERR(PetscINCREF(J.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 875, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_Jpre = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":876
 *         cdef Mat J = Mat()
 *         cdef Mat Jpre = Mat()
 *         CHKERR(TaoGetJacobianInequalityRoutine(self.tao, &J.mat, &Jpre.mat, NULL, NULL))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(J.obj))
 *         CHKERR(PetscINCREF(Jpre.obj))
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetJacobianInequalityRoutine(__pyx_v_self->tao, (&__pyx_v_J->mat), (&__pyx_v_Jpre->mat), NULL, NULL)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 876, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":877
 *         cdef Mat Jpre = Mat()
 *         CHKERR(TaoGetJacobianInequalityRoutine(self.tao, &J.mat, &Jpre.mat, NULL, NULL))
 *         CHKERR(PetscINCREF(J.obj))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(Jpre.obj))
 *         cdef object jacobian_inequality = self.get_attr("__jacobian_inequality__")
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_J->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 877, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":878
 *         CHKERR(TaoGetJacobianInequalityRoutine(self.tao, &J.mat, &Jpre.mat, NULL, NULL))
 *         CHKERR(PetscINCREF(J.obj))
 *         CHKERR(PetscINCREF(Jpre.obj))             # <<<<<<<<<<<<<<
 *         cdef object jacobian_inequality = self.get_attr("__jacobian_inequality__")
 *         return (J, Jpre, jacobian_inequality)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_Jpre->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 878, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":879
 *         CHKERR(PetscINCREF(J.obj))
 *         CHKERR(PetscINCREF(Jpre.obj))
 *         cdef object jacobian_inequality = self.get_attr("__jacobian_inequality__")             # <<<<<<<<<<<<<<
 *         return (J, Jpre, jacobian_inequality)
 * 
*/
  __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 *)"__jacobian_inequality__")); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_jacobian_inequality = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":880
 *         CHKERR(PetscINCREF(Jpre.obj))
 *         cdef object jacobian_inequality = self.get_attr("__jacobian_inequality__")
 *         return (J, Jpre, jacobian_inequality)             # <<<<<<<<<<<<<<
 * 
 *     def setUpdate(self, update: TAOUpdateFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 880, __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)) != (0)) __PYX_ERR(52, 880, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_Jpre);
  __Pyx_GIVEREF((PyObject *)__pyx_v_Jpre);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_Jpre)) != (0)) __PYX_ERR(52, 880, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_jacobian_inequality);
  __Pyx_GIVEREF(__pyx_v_jacobian_inequality);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_jacobian_inequality) != (0)) __PYX_ERR(52, 880, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":865
 *                                                TAO_JacobianInequality, <void*>context))
 * 
 *     def getJacobianInequality(self) -> tuple[Mat, Mat, tuple[TAOConstraintsJacobianFunction, tuple[Any, ...] | None, dict[str, Any] | None]]:             # <<<<<<<<<<<<<<
 *         """Return matrix, precon matrix and callback of ineq. constraints Jacobian.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.getJacobianInequality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_J);
  __Pyx_XDECREF((PyObject *)__pyx_v_Jpre);
  __Pyx_XDECREF(__pyx_v_jacobian_inequality);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TAO.pyx":882
 *         return (J, Jpre, jacobian_inequality)
 * 
 *     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_83setUpdate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_82setUpdate, "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:882");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_83setUpdate = {"setUpdate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_83setUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_82setUpdate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_83setUpdate(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_update,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 882, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 882, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 882, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 882, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setUpdate", 0) < (0)) __PYX_ERR(52, 882, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setUpdate", 0, 1, 3, i); __PYX_ERR(52, 882, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 882, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 882, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 882, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 882, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_82setUpdate(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_update, __pyx_v_args, __pyx_v_kargs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_82setUpdate(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":901
 * 
 *         """
 *         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":902
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TAO.pyx":903
 *         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, 903, __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":904
 *             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, <void*>context))
*/
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 904, __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) != (0)) __PYX_ERR(52, 904, __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) != (0)) __PYX_ERR(52, 904, __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) != (0)) __PYX_ERR(52, 904, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/TAO.pyx":905
 *             if kargs is None: kargs = {}
 *             context = (update, args, kargs)
 *             self.set_attr('__update__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(TaoSetUpdate(self.tao, TAO_Update, <void*>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, 905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/TAO.pyx":906
 *             context = (update, args, kargs)
 *             self.set_attr('__update__', context)
 *             CHKERR(TaoSetUpdate(self.tao, TAO_Update, <void*>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, 906, __pyx_L1_error)

    /* "petsc4py/PETSc/TAO.pyx":901
 * 
 *         """
 *         if update is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/TAO.pyx":908
 *             CHKERR(TaoSetUpdate(self.tao, TAO_Update, <void*>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, 908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/TAO.pyx":909
 *         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, 909, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/TAO.pyx":882
 *         return (J, Jpre, jacobian_inequality)
 * 
 *     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":911
 *             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_85getUpdate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_84getUpdate, "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:911");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_85getUpdate = {"getUpdate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_85getUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_84getUpdate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_85getUpdate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getUpdate", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_84getUpdate(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_84getUpdate(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":921
 * 
 *         """
 *         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, 921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":911
 *             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":925
 *     # --------------
 * 
 *     def computeObjective(self, Vec x) -> float:             # <<<<<<<<<<<<<<
 *         """Compute the value of the objective function.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_87computeObjective(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_86computeObjective, "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:925");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_87computeObjective = {"computeObjective", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_87computeObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_86computeObjective};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_87computeObjective(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 925, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeObjective", 0) < (0)) __PYX_ERR(52, 925, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeObjective", 1, 1, 1, i); __PYX_ERR(52, 925, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 925, __pyx_L3_error)
    }
    __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, 925, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 925, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_86computeObjective(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_86computeObjective(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":940
 * 
 *         """
 *         cdef PetscReal f = 0             # <<<<<<<<<<<<<<
 *         CHKERR(TaoComputeObjective(self.tao, x.vec, &f))
 *         return toReal(f)
*/
  __pyx_v_f = 0.0;

  /* "petsc4py/PETSc/TAO.pyx":941
 *         """
 *         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, 941, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":942
 *         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, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":925
 *     # --------------
 * 
 *     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":944
 *         return toReal(f)
 * 
 *     def computeResidual(self, Vec x, Vec f) -> None:             # <<<<<<<<<<<<<<
 *         """Compute the residual.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_89computeResidual(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_88computeResidual, "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:944");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_89computeResidual = {"computeResidual", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_89computeResidual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_88computeResidual};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_89computeResidual(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_f,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 944, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 944, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 944, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeResidual", 0) < (0)) __PYX_ERR(52, 944, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeResidual", 1, 2, 2, i); __PYX_ERR(52, 944, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 944, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 944, __pyx_L3_error)
    }
    __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, 944, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 944, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "f", 0))) __PYX_ERR(52, 944, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_88computeResidual(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x, __pyx_v_f);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_88computeResidual(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":961
 * 
 *         """
 *         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, 961, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":944
 *         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":963
 *         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_91computeGradient(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_90computeGradient, "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:963");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_91computeGradient = {"computeGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_91computeGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_90computeGradient};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_91computeGradient(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_g,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 963, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 963, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 963, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeGradient", 0) < (0)) __PYX_ERR(52, 963, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeGradient", 1, 2, 2, i); __PYX_ERR(52, 963, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 963, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 963, __pyx_L3_error)
    }
    __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, 963, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 963, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "g", 0))) __PYX_ERR(52, 963, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_90computeGradient(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x, __pyx_v_g);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_90computeGradient(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":980
 * 
 *         """
 *         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, 980, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":963
 *         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":982
 *         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_93computeObjectiveGradient(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_92computeObjectiveGradient, "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:982");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_93computeObjectiveGradient = {"computeObjectiveGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_93computeObjectiveGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_92computeObjectiveGradient};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_93computeObjectiveGradient(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_g,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 982, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 982, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 982, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeObjectiveGradient", 0) < (0)) __PYX_ERR(52, 982, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeObjectiveGradient", 1, 2, 2, i); __PYX_ERR(52, 982, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 982, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 982, __pyx_L3_error)
    }
    __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, 982, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 982, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "g", 0))) __PYX_ERR(52, 982, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_92computeObjectiveGradient(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x, __pyx_v_g);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_92computeObjectiveGradient(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1000
 * 
 *         """
 *         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":1001
 *         """
 *         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, 1001, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1002
 *         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, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":982
 *         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":1004
 *         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_95computeDualVariables(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_94computeDualVariables, "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:1004");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_95computeDualVariables = {"computeDualVariables", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_95computeDualVariables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_94computeDualVariables};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_95computeDualVariables(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_xl,&__pyx_mstate_global->__pyx_n_u_xu,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1004, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1004, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeDualVariables", 0) < (0)) __PYX_ERR(52, 1004, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeDualVariables", 1, 2, 2, i); __PYX_ERR(52, 1004, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1004, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1004, __pyx_L3_error)
    }
    __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, 1004, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xl", 0))) __PYX_ERR(52, 1004, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xu), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xu", 0))) __PYX_ERR(52, 1004, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_94computeDualVariables(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_xl, __pyx_v_xu);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_94computeDualVariables(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1014
 * 
 *         """
 *         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, 1014, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1004
 *         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":1016
 *         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_97computeVariableBounds(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_96computeVariableBounds, "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:1016");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_97computeVariableBounds = {"computeVariableBounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_97computeVariableBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_96computeVariableBounds};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_97computeVariableBounds(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_xl,&__pyx_mstate_global->__pyx_n_u_xu,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1016, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1016, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1016, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeVariableBounds", 0) < (0)) __PYX_ERR(52, 1016, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeVariableBounds", 1, 2, 2, i); __PYX_ERR(52, 1016, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1016, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1016, __pyx_L3_error)
    }
    __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, 1016, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xl", 0))) __PYX_ERR(52, 1016, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_xu), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "xu", 0))) __PYX_ERR(52, 1016, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_96computeVariableBounds(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_xl, __pyx_v_xu);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_96computeVariableBounds(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1026
 * 
 *         """
 *         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, 1026, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1027
 *         """
 *         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":1028
 *         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, 1028, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1029
 *         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":1030
 *         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":1031
 *         if xl.vec != NULL:
 *             if Lvec != NULL:
 *                 CHKERR(VecCopy(Lvec, xl.vec))             # <<<<<<<<<<<<<<
 *             else:
 *                 CHKERR(VecSet(xl.vec, <PetscScalar>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, 1031, __pyx_L1_error)

      /* "petsc4py/PETSc/TAO.pyx":1030
 *         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":1033
 *                 CHKERR(VecCopy(Lvec, xl.vec))
 *             else:
 *                 CHKERR(VecSet(xl.vec, <PetscScalar>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, 1033, __pyx_L1_error)
    }
    __pyx_L4:;

    /* "petsc4py/PETSc/TAO.pyx":1029
 *         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":1034
 *             else:
 *                 CHKERR(VecSet(xl.vec, <PetscScalar>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":1035
 *                 CHKERR(VecSet(xl.vec, <PetscScalar>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":1036
 *         if xu.vec != NULL:
 *             if Uvec != NULL:
 *                 CHKERR(VecCopy(Uvec, xu.vec))             # <<<<<<<<<<<<<<
 *             else:
 *                 CHKERR(VecSet(xu.vec, <PetscScalar>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, 1036, __pyx_L1_error)

      /* "petsc4py/PETSc/TAO.pyx":1035
 *                 CHKERR(VecSet(xl.vec, <PetscScalar>PETSC_NINFINITY))
 *         if xu.vec != NULL:
 *             if Uvec != NULL:             # <<<<<<<<<<<<<<
 *                 CHKERR(VecCopy(Uvec, xu.vec))
 *             else:
*/
      goto __pyx_L6;
    }

    /* "petsc4py/PETSc/TAO.pyx":1038
 *                 CHKERR(VecCopy(Uvec, xu.vec))
 *             else:
 *                 CHKERR(VecSet(xu.vec, <PetscScalar>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, 1038, __pyx_L1_error)
    }
    __pyx_L6:;

    /* "petsc4py/PETSc/TAO.pyx":1034
 *             else:
 *                 CHKERR(VecSet(xl.vec, <PetscScalar>PETSC_NINFINITY))
 *         if xu.vec != NULL:             # <<<<<<<<<<<<<<
 *             if Uvec != NULL:
 *                 CHKERR(VecCopy(Uvec, xu.vec))
*/
  }

  /* "petsc4py/PETSc/TAO.pyx":1016
 *         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":1040
 *                 CHKERR(VecSet(xu.vec, <PetscScalar>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_99computeConstraints(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_98computeConstraints, "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:1040");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_99computeConstraints = {"computeConstraints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_99computeConstraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_98computeConstraints};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_99computeConstraints(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_c,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1040, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1040, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1040, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeConstraints", 0) < (0)) __PYX_ERR(52, 1040, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeConstraints", 1, 2, 2, i); __PYX_ERR(52, 1040, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1040, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1040, __pyx_L3_error)
    }
    __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, 1040, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 1040, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "c", 0))) __PYX_ERR(52, 1040, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_98computeConstraints(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x, __pyx_v_c);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_98computeConstraints(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1057
 * 
 *         """
 *         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, 1057, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1040
 *                 CHKERR(VecSet(xu.vec, <PetscScalar>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":1059
 *         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_101computeHessian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_100computeHessian, "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:1059");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_101computeHessian = {"computeHessian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_101computeHessian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_100computeHessian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_101computeHessian(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_H,&__pyx_mstate_global->__pyx_n_u_P,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1059, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1059, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1059, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1059, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeHessian", 0) < (0)) __PYX_ERR(52, 1059, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeHessian", 0, 2, 3, i); __PYX_ERR(52, 1059, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1059, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1059, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1059, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 1059, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 1059, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_H), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "H", 0))) __PYX_ERR(52, 1059, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(52, 1059, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_100computeHessian(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_100computeHessian(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1078
 * 
 *         """
 *         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":1079
 *         """
 *         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":1080
 *         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, 1080, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1059
 *         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":1082
 *         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_103computeJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_102computeJacobian, "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:1082");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_103computeJacobian = {"computeJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_103computeJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_102computeJacobian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_103computeJacobian(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_J,&__pyx_mstate_global->__pyx_n_u_P,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1082, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1082, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1082, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1082, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeJacobian", 0) < (0)) __PYX_ERR(52, 1082, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeJacobian", 0, 2, 3, i); __PYX_ERR(52, 1082, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1082, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1082, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1082, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __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, 1082, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 1082, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_J), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "J", 0))) __PYX_ERR(52, 1082, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "P", 0))) __PYX_ERR(52, 1082, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_102computeJacobian(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_102computeJacobian(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1101
 * 
 *         """
 *         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":1102
 *         """
 *         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":1103
 *         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, 1103, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1082
 *         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":1107
 *     # --------------
 * 
 *     def setTolerances(self, gatol: float | None = None, grtol: float | None = None, gttol: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the tolerance parameters used in the solver convergence tests.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_105setTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_104setTolerances, "TAO.setTolerances(self, gatol: float | None = None, grtol: float | None = None, gttol: float | None = 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, or `DETERMINE`\n            to use the value when the object's type was set.\n            Defaults to `CURRENT`.\n        grtol\n            The relative norm of the gradient with respect to the\n            initial norm of the objective, or `DETERMINE` to\n            use the value when the object's type was set. Defaults\n            to `CURRENT`.\n        gttol\n            The relative norm of the gradient with respect to the\n            initial norm of the gradient, or `DETERMINE` to\n            use the value when the object's type was set. Defaults\n            to `CURRENT`.\n\n        See Also\n        --------\n        getTolerances, petsc.TaoSetTolerances\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:1107");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_105setTolerances = {"setTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_105setTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_104setTolerances};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_105setTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gatol,&__pyx_mstate_global->__pyx_n_u_grtol,&__pyx_mstate_global->__pyx_n_u_gttol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1107, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1107, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1107, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1107, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTolerances", 0) < (0)) __PYX_ERR(52, 1107, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1107, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1107, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1107, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1107, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_104setTolerances(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_gatol, __pyx_v_grtol, __pyx_v_gttol);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_104setTolerances(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1134
 * 
 *         """
 *         cdef PetscReal _gatol=PETSC_CURRENT, _grtol=PETSC_CURRENT, _gttol=PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         if gatol is not None: _gatol = asReal(gatol)
 *         if grtol is not None: _grtol = asReal(grtol)
*/
  __pyx_v__gatol = PETSC_CURRENT;
  __pyx_v__grtol = PETSC_CURRENT;
  __pyx_v__gttol = PETSC_CURRENT;

  /* "petsc4py/PETSc/TAO.pyx":1135
 *         """
 *         cdef PetscReal _gatol=PETSC_CURRENT, _grtol=PETSC_CURRENT, _gttol=PETSC_CURRENT
 *         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, 1135, __pyx_L1_error)
    __pyx_v__gatol = __pyx_t_2;
  }

  /* "petsc4py/PETSc/TAO.pyx":1136
 *         cdef PetscReal _gatol=PETSC_CURRENT, _grtol=PETSC_CURRENT, _gttol=PETSC_CURRENT
 *         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, 1136, __pyx_L1_error)
    __pyx_v__grtol = __pyx_t_2;
  }

  /* "petsc4py/PETSc/TAO.pyx":1137
 *         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, 1137, __pyx_L1_error)
    __pyx_v__gttol = __pyx_t_2;
  }

  /* "petsc4py/PETSc/TAO.pyx":1138
 *         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, 1138, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1107
 *     # --------------
 * 
 *     def setTolerances(self, gatol: float | None = None, grtol: float | None = None, gttol: float | None = 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":1140
 *         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_107getTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_106getTolerances, "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.\n        gttol : float\n            The relative norm of the gradient with respect to the\n            initial norm of the gradient.\n\n        See Also\n        --------\n        setTolerances, petsc.TaoGetTolerances\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:1140");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_107getTolerances = {"getTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_107getTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_106getTolerances};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_107getTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTolerances", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_106getTolerances(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_106getTolerances(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1160
 * 
 *         """
 *         cdef PetscReal _gatol=PETSC_CURRENT, _grtol=PETSC_CURRENT, _gttol=PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetTolerances(self.tao, &_gatol, &_grtol, &_gttol))
 *         return (toReal(_gatol), toReal(_grtol), toReal(_gttol))
*/
  __pyx_v__gatol = PETSC_CURRENT;
  __pyx_v__grtol = PETSC_CURRENT;
  __pyx_v__gttol = PETSC_CURRENT;

  /* "petsc4py/PETSc/TAO.pyx":1161
 *         """
 *         cdef PetscReal _gatol=PETSC_CURRENT, _grtol=PETSC_CURRENT, _gttol=PETSC_CURRENT
 *         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, 1161, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1162
 *         cdef PetscReal _gatol=PETSC_CURRENT, _grtol=PETSC_CURRENT, _gttol=PETSC_CURRENT
 *         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, 1162, __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, 1162, __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, 1162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1162, __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) != (0)) __PYX_ERR(52, 1162, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(52, 1162, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4) != (0)) __PYX_ERR(52, 1162, __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":1140
 *         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":1164
 *         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_109setMaximumIterations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_108setMaximumIterations, "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:1164");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_109setMaximumIterations = {"setMaximumIterations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_109setMaximumIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_108setMaximumIterations};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_109setMaximumIterations(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mit,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1164, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1164, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMaximumIterations", 0) < (0)) __PYX_ERR(52, 1164, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMaximumIterations", 1, 1, 1, i); __PYX_ERR(52, 1164, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1164, __pyx_L3_error)
    }
    __pyx_v_mit = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setMaximumIterations", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1164, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_108setMaximumIterations(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_mit);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_108setMaximumIterations(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1174
 * 
 *         """
 *         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, 1174, __pyx_L1_error)
  __pyx_v__mit = __pyx_t_1;

  /* "petsc4py/PETSc/TAO.pyx":1175
 *         """
 *         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, 1175, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1164
 *         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":1177
 *         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_111getMaximumIterations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_110getMaximumIterations, "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:1177");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_111getMaximumIterations = {"getMaximumIterations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_111getMaximumIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_110getMaximumIterations};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_111getMaximumIterations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMaximumIterations", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_110getMaximumIterations(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_110getMaximumIterations(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1187
 * 
 *         """
 *         cdef PetscInt _mit = PETSC_DEFAULT             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetMaximumIterations(self.tao, &_mit))
 *         return toInt(_mit)
*/
  __pyx_v__mit = PETSC_DEFAULT;

  /* "petsc4py/PETSc/TAO.pyx":1188
 *         """
 *         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, 1188, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1189
 *         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, 1189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":1177
 *         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":1191
 *         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_113setMaximumFunctionEvaluations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_112setMaximumFunctionEvaluations, "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:1191");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_113setMaximumFunctionEvaluations = {"setMaximumFunctionEvaluations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_113setMaximumFunctionEvaluations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_112setMaximumFunctionEvaluations};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_113setMaximumFunctionEvaluations(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mit,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1191, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1191, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMaximumFunctionEvaluations", 0) < (0)) __PYX_ERR(52, 1191, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMaximumFunctionEvaluations", 1, 1, 1, i); __PYX_ERR(52, 1191, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1191, __pyx_L3_error)
    }
    __pyx_v_mit = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setMaximumFunctionEvaluations", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1191, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_112setMaximumFunctionEvaluations(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_mit);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_112setMaximumFunctionEvaluations(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1201
 * 
 *         """
 *         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, 1201, __pyx_L1_error)
  __pyx_v__mit = __pyx_t_1;

  /* "petsc4py/PETSc/TAO.pyx":1202
 *         """
 *         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, 1202, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1191
 *         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":1204
 *         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_115getMaximumFunctionEvaluations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_114getMaximumFunctionEvaluations, "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:1204");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_115getMaximumFunctionEvaluations = {"getMaximumFunctionEvaluations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_115getMaximumFunctionEvaluations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_114getMaximumFunctionEvaluations};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_115getMaximumFunctionEvaluations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMaximumFunctionEvaluations", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_114getMaximumFunctionEvaluations(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_114getMaximumFunctionEvaluations(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1214
 * 
 *         """
 *         cdef PetscInt _mit = PETSC_DEFAULT             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetMaximumFunctionEvaluations(self.tao, &_mit))
 *         return toInt(_mit)
*/
  __pyx_v__mit = PETSC_DEFAULT;

  /* "petsc4py/PETSc/TAO.pyx":1215
 *         """
 *         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, 1215, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1216
 *         cdef PetscInt _mit = PETSC_DEFAULT
 *         CHKERR(TaoGetMaximumFunctionEvaluations(self.tao, &_mit))
 *         return toInt(_mit)             # <<<<<<<<<<<<<<
 * 
 *     def setConstraintTolerances(self, catol: float | None = None, crtol: float | None = 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, 1216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":1204
 *         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":1218
 *         return toInt(_mit)
 * 
 *     def setConstraintTolerances(self, catol: float | None = None, crtol: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the constraints tolerance parameters used in the solver convergence tests.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_117setConstraintTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_116setConstraintTolerances, "TAO.setConstraintTolerances(self, catol: float | None = None, crtol: float | None = 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, or `DETERMINE`\n            to use the value when the object's type was set. Defaults\n            to `CURRENT`.\n        crtol\n            The relative norm of the constraints, or `DETERMINE`\n            to use the value when the object's type was set. Defaults\n            to `CURRENT`.\n\n        See Also\n        --------\n        getConstraintTolerances, petsc.TaoSetConstraintTolerances\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:1218");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_117setConstraintTolerances = {"setConstraintTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_117setConstraintTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_116setConstraintTolerances};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_117setConstraintTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_catol,&__pyx_mstate_global->__pyx_n_u_crtol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1218, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1218, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1218, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setConstraintTolerances", 0) < (0)) __PYX_ERR(52, 1218, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1218, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1218, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1218, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_116setConstraintTolerances(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_catol, __pyx_v_crtol);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_116setConstraintTolerances(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1239
 * 
 *         """
 *         cdef PetscReal _catol=PETSC_CURRENT, _crtol=PETSC_CURRENT             # <<<<<<<<<<<<<<
 *         if catol is not None: _catol = asReal(catol)
 *         if crtol is not None: _crtol = asReal(crtol)
*/
  __pyx_v__catol = PETSC_CURRENT;
  __pyx_v__crtol = PETSC_CURRENT;

  /* "petsc4py/PETSc/TAO.pyx":1240
 *         """
 *         cdef PetscReal _catol=PETSC_CURRENT, _crtol=PETSC_CURRENT
 *         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, 1240, __pyx_L1_error)
    __pyx_v__catol = __pyx_t_2;
  }

  /* "petsc4py/PETSc/TAO.pyx":1241
 *         cdef PetscReal _catol=PETSC_CURRENT, _crtol=PETSC_CURRENT
 *         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, 1241, __pyx_L1_error)
    __pyx_v__crtol = __pyx_t_2;
  }

  /* "petsc4py/PETSc/TAO.pyx":1242
 *         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, 1242, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1218
 *         return toInt(_mit)
 * 
 *     def setConstraintTolerances(self, catol: float | None = None, crtol: float | None = 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":1244
 *         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_119getConstraintTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_118getConstraintTolerances, "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:1244");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_119getConstraintTolerances = {"getConstraintTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_119getConstraintTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_118getConstraintTolerances};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_119getConstraintTolerances(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getConstraintTolerances", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_118getConstraintTolerances(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_118getConstraintTolerances(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1261
 * 
 *         """
 *         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":1262
 *         """
 *         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, 1262, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1263
 *         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, 1263, __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, 1263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1263, __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) != (0)) __PYX_ERR(52, 1263, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(52, 1263, __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":1244
 *         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":1265
 *         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_121setConvergenceTest(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_120setConvergenceTest, "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:1265");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_121setConvergenceTest = {"setConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_121setConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_120setConvergenceTest};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_121setConvergenceTest(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_converged,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1265, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1265, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1265, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1265, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setConvergenceTest", 0) < (0)) __PYX_ERR(52, 1265, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setConvergenceTest", 0, 1, 3, i); __PYX_ERR(52, 1265, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1265, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1265, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1265, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1265, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_120setConvergenceTest(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_converged, __pyx_v_args, __pyx_v_kargs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_120setConvergenceTest(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":1284
 * 
 *         """
 *         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":1285
 *         """
 *         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, 1285, __pyx_L1_error)

    /* "petsc4py/PETSc/TAO.pyx":1286
 *         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, 1286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/TAO.pyx":1284
 * 
 *         """
 *         if converged is None:             # <<<<<<<<<<<<<<
 *             CHKERR(TaoSetConvergenceTest(self.tao, TaoDefaultConvergenceTest, NULL))
 *             self.set_attr('__converged__', None)
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/TAO.pyx":1288
 *             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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/TAO.pyx":1289
 *         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, 1289, __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":1290
 *             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, 1290, __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) != (0)) __PYX_ERR(52, 1290, __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) != (0)) __PYX_ERR(52, 1290, __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) != (0)) __PYX_ERR(52, 1290, __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, 1290, __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":1291
 *             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, 1291, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/TAO.pyx":1265
 *         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":1293
 *             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_123getConvergenceTest(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_122getConvergenceTest, "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:1293");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_123getConvergenceTest = {"getConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_123getConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_122getConvergenceTest};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_123getConvergenceTest(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getConvergenceTest", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_122getConvergenceTest(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_122getConvergenceTest(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1303
 * 
 *         """
 *         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, 1303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":1293
 *             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":1305
 *         return self.get_attr('__converged__')
 * 
 *     def setConvergedReason(self, reason: ConvergedReason) -> None:             # <<<<<<<<<<<<<<
 *         """Set the termination flag.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_125setConvergedReason(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_124setConvergedReason, "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:1305");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_125setConvergedReason = {"setConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_125setConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_124setConvergedReason};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_125setConvergedReason(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_reason,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1305, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1305, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setConvergedReason", 0) < (0)) __PYX_ERR(52, 1305, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, i); __PYX_ERR(52, 1305, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1305, __pyx_L3_error)
    }
    __pyx_v_reason = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setConvergedReason", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1305, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_124setConvergedReason(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_reason);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_124setConvergedReason(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1315
 * 
 *         """
 *         cdef PetscTAOConvergedReason creason = reason             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetConvergedReason(self.tao, creason))
 * 
*/
  __pyx_t_1 = ((TaoConvergedReason)__Pyx_PyLong_As_TaoConvergedReason(__pyx_v_reason)); if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1315, __pyx_L1_error)
  __pyx_v_creason = __pyx_t_1;

  /* "petsc4py/PETSc/TAO.pyx":1316
 *         """
 *         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, 1316, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1305
 *         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":1318
 *         CHKERR(TaoSetConvergedReason(self.tao, creason))
 * 
 *     def getConvergedReason(self) -> ConvergedReason:             # <<<<<<<<<<<<<<
 *         """Return the termination flag.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_127getConvergedReason(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_126getConvergedReason, "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:1318");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_127getConvergedReason = {"getConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_127getConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_126getConvergedReason};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_127getConvergedReason(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getConvergedReason", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_126getConvergedReason(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_126getConvergedReason(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1328
 * 
 *         """
 *         cdef PetscTAOConvergedReason creason = TAO_CONTINUE_ITERATING             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetConvergedReason(self.tao, &creason))
 *         return creason
*/
  __pyx_v_creason = TAO_CONTINUE_ITERATING;

  /* "petsc4py/PETSc/TAO.pyx":1329
 *         """
 *         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, 1329, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1330
 *         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_PyLong_From_TaoConvergedReason(__pyx_v_creason); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":1318
 *         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":1332
 *         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_129setMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_128setMonitor, "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.TaoMonitorSet\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:1332");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_129setMonitor = {"setMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_129setMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_128setMonitor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_129setMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_monitor,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1332, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMonitor", 0) < (0)) __PYX_ERR(52, 1332, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMonitor", 0, 1, 3, i); __PYX_ERR(52, 1332, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1332, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1332, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_128setMonitor(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_monitor, __pyx_v_args, __pyx_v_kargs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_128setMonitor(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":1351
 * 
 *         """
 *         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":1352
 *         """
 *         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, 1352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_monitorlist = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1353
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":1354
 *         cdef object monitorlist = self.get_attr('__monitor__')
 *         if args  is None: args  = ()
 *         if kargs is None: kargs = {}             # <<<<<<<<<<<<<<
 *         if monitorlist is None:
 *             CHKERR(TaoMonitorSet(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, 1354, __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":1355
 *         if args  is None: args  = ()
 *         if kargs is None: kargs = {}
 *         if monitorlist is None:             # <<<<<<<<<<<<<<
 *             CHKERR(TaoMonitorSet(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":1356
 *         if kargs is None: kargs = {}
 *         if monitorlist is None:
 *             CHKERR(TaoMonitorSet(self.tao, TAO_Monitor, NULL, NULL))             # <<<<<<<<<<<<<<
 *             self.set_attr('__monitor__',  [(monitor, args, kargs)])
 *         else:
*/
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoMonitorSet(__pyx_v_self->tao, __pyx_f_8petsc4py_5PETSc_TAO_Monitor, NULL, NULL)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1356, __pyx_L1_error)

    /* "petsc4py/PETSc/TAO.pyx":1357
 *         if monitorlist is None:
 *             CHKERR(TaoMonitorSet(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, 1357, __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) != (0)) __PYX_ERR(52, 1357, __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) != (0)) __PYX_ERR(52, 1357, __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) != (0)) __PYX_ERR(52, 1357, __pyx_L1_error);
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1357, __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) != (0)) __PYX_ERR(52, 1357, __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, 1357, __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":1355
 *         if args  is None: args  = ()
 *         if kargs is None: kargs = {}
 *         if monitorlist is None:             # <<<<<<<<<<<<<<
 *             CHKERR(TaoMonitorSet(self.tao, TAO_Monitor, NULL, NULL))
 *             self.set_attr('__monitor__',  [(monitor, args, kargs)])
*/
    goto __pyx_L6;
  }

  /* "petsc4py/PETSc/TAO.pyx":1359
 *             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, 1359, __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) != (0)) __PYX_ERR(52, 1359, __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) != (0)) __PYX_ERR(52, 1359, __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) != (0)) __PYX_ERR(52, 1359, __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, 1359, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L6:;

  /* "petsc4py/PETSc/TAO.pyx":1332
 *         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":1361
 *             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_131getMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_130getMonitor, "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:1361");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_131getMonitor = {"getMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_131getMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_130getMonitor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_131getMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMonitor", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_130getMonitor(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_130getMonitor(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1371
 * 
 *         """
 *         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, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":1361
 *             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":1373
 *         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_133cancelMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_132cancelMonitor, "TAO.cancelMonitor(self) -> None\nCancel all the monitors of the solver.\n\n        Logically collective.\n\n        See Also\n        --------\n        setMonitor, petsc.TaoMonitorCancel\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:1373");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_133cancelMonitor = {"cancelMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_133cancelMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_132cancelMonitor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_133cancelMonitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("cancelMonitor", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_132cancelMonitor(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_132cancelMonitor(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1383
 * 
 *         """
 *         CHKERR(TaoMonitorCancel(self.tao))             # <<<<<<<<<<<<<<
 *         self.set_attr('__monitor__',  None)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoMonitorCancel(__pyx_v_self->tao)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1383, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1384
 *         """
 *         CHKERR(TaoMonitorCancel(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, 1384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1373
 *         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":1387
 * 
 *     # Tao overwrites these statistics. Copy user defined only if present
 *     def monitor(self, its: int | None = None, f: float | None = None, res: float | None = None, cnorm: float | None = None, step: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Monitor the solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_135monitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_134monitor, "TAO.monitor(self, its: int | None = None, f: float | None = None, res: float | None = None, cnorm: float | None = None, step: float | None = 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:1387");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_135monitor = {"monitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_135monitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_134monitor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_135monitor(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_its,&__pyx_mstate_global->__pyx_n_u_f,&__pyx_mstate_global->__pyx_n_u_res,&__pyx_mstate_global->__pyx_n_u_cnorm,&__pyx_mstate_global->__pyx_n_u_step,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1387, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(52, 1387, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 1387, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1387, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1387, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1387, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "monitor", 0) < (0)) __PYX_ERR(52, 1387, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(52, 1387, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 1387, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1387, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1387, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1387, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1387, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_134monitor(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_its, __pyx_v_f, __pyx_v_res, __pyx_v_cnorm, __pyx_v_step);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_134monitor(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1418
 * 
 *         """
 *         cdef PetscInt cits = 0             # <<<<<<<<<<<<<<
 *         cdef PetscReal cf = 0.0
 *         cdef PetscReal cres = 0.0
*/
  __pyx_v_cits = 0;

  /* "petsc4py/PETSc/TAO.pyx":1419
 *         """
 *         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":1420
 *         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":1421
 *         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":1422
 *         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":1423
 *         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, 1423, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1424
 *         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":1425
 *         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, 1425, __pyx_L1_error)
    __pyx_v_cits = __pyx_t_3;

    /* "petsc4py/PETSc/TAO.pyx":1424
 *         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":1426
 *         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":1427
 *             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, 1427, __pyx_L1_error)
    __pyx_v_cf = __pyx_t_4;

    /* "petsc4py/PETSc/TAO.pyx":1426
 *         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":1428
 *         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":1429
 *             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, 1429, __pyx_L1_error)
    __pyx_v_cres = __pyx_t_4;

    /* "petsc4py/PETSc/TAO.pyx":1428
 *         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":1430
 *         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":1431
 *             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, 1431, __pyx_L1_error)
    __pyx_v_ccnorm = __pyx_t_4;

    /* "petsc4py/PETSc/TAO.pyx":1430
 *         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":1432
 *         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":1433
 *             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, 1433, __pyx_L1_error)
    __pyx_v_cstep = __pyx_t_4;

    /* "petsc4py/PETSc/TAO.pyx":1432
 *         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":1434
 *         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, 1434, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1387
 * 
 *     # Tao overwrites these statistics. Copy user defined only if present
 *     def monitor(self, its: int | None = None, f: float | None = None, res: float | None = None, cnorm: float | None = None, step: float | None = 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":1438
 *     #
 * 
 *     def solve(self, Vec x=None) -> None:             # <<<<<<<<<<<<<<
 *         """Solve the optimization problem.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_137solve(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_136solve, "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:1438");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_137solve = {"solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_137solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_136solve};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_137solve(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1438, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1438, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "solve", 0) < (0)) __PYX_ERR(52, 1438, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1438, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 1438, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "x", 0))) __PYX_ERR(52, 1438, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_136solve(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_x);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_136solve(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1453
 * 
 *         """
 *         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":1454
 *         """
 *         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, 1454, __pyx_L1_error)

    /* "petsc4py/PETSc/TAO.pyx":1453
 * 
 *         """
 *         if x is not None:             # <<<<<<<<<<<<<<
 *             CHKERR(TaoSetSolution(self.tao, x.vec))
 *         CHKERR(TaoSolve(self.tao))
*/
  }

  /* "petsc4py/PETSc/TAO.pyx":1455
 *         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, 1455, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1438
 *     #
 * 
 *     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":1457
 *         CHKERR(TaoSolve(self.tao))
 * 
 *     def getSolution(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the vector holding the solution.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_139getSolution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_138getSolution, "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:1457");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_139getSolution = {"getSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_139getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_138getSolution};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_139getSolution(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSolution", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_138getSolution(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_138getSolution(struct PyPetscTAOObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_vec = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getSolution", 0);

  /* "petsc4py/PETSc/TAO.pyx":1467
 * 
 *         """
 *         cdef Vec vec = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetSolution(self.tao, &vec.vec))
 *         CHKERR(PetscINCREF(vec.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1467, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1468
 *         """
 *         cdef Vec vec = Vec()
 *         CHKERR(TaoGetSolution(self.tao, &vec.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(vec.obj))
 *         return vec
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetSolution(__pyx_v_self->tao, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1468, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1469
 *         cdef Vec vec = Vec()
 *         CHKERR(TaoGetSolution(self.tao, &vec.vec))
 *         CHKERR(PetscINCREF(vec.obj))             # <<<<<<<<<<<<<<
 *         return vec
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vec->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1469, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1470
 *         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":1457
 *         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_XDECREF(__pyx_t_2);
  __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":1472
 *         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_141setGradientNorm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_140setGradientNorm, "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:1472");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_141setGradientNorm = {"setGradientNorm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_141setGradientNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_140setGradientNorm};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_141setGradientNorm(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1472, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1472, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setGradientNorm", 0) < (0)) __PYX_ERR(52, 1472, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setGradientNorm", 1, 1, 1, i); __PYX_ERR(52, 1472, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1472, __pyx_L3_error)
    }
    __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, 1472, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(52, 1472, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_140setGradientNorm(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_140setGradientNorm(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1482
 * 
 *         """
 *         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, 1482, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1472
 *         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":1484
 *         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_143getGradientNorm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_142getGradientNorm, "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:1484");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_143getGradientNorm = {"getGradientNorm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_143getGradientNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_142getGradientNorm};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_143getGradientNorm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getGradientNorm", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_142getGradientNorm(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_142getGradientNorm(struct PyPetscTAOObject *__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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getGradientNorm", 0);

  /* "petsc4py/PETSc/TAO.pyx":1494
 * 
 *         """
 *         cdef Mat mat = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetGradientNorm(self.tao, &mat.mat))
 *         CHKERR(PetscINCREF(mat.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1494, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1495
 *         """
 *         cdef Mat mat = Mat()
 *         CHKERR(TaoGetGradientNorm(self.tao, &mat.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(mat.obj))
 *         return mat
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetGradientNorm(__pyx_v_self->tao, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1495, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1496
 *         cdef Mat mat = Mat()
 *         CHKERR(TaoGetGradientNorm(self.tao, &mat.mat))
 *         CHKERR(PetscINCREF(mat.obj))             # <<<<<<<<<<<<<<
 *         return mat
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1496, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1497
 *         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":1484
 *         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_XDECREF(__pyx_t_2);
  __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":1499
 *         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_145setLMVMH0(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_144setLMVMH0, "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:1499");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_145setLMVMH0 = {"setLMVMH0", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_145setLMVMH0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_144setLMVMH0};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_145setLMVMH0(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1499, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1499, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLMVMH0", 0) < (0)) __PYX_ERR(52, 1499, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLMVMH0", 1, 1, 1, i); __PYX_ERR(52, 1499, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1499, __pyx_L3_error)
    }
    __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, 1499, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(52, 1499, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_144setLMVMH0(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_mat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_144setLMVMH0(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1509
 * 
 *         """
 *         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, 1509, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1499
 *         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":1511
 *         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_147getLMVMH0(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_146getLMVMH0, "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:1511");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_147getLMVMH0 = {"getLMVMH0", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_147getLMVMH0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_146getLMVMH0};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_147getLMVMH0(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLMVMH0", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_146getLMVMH0(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_146getLMVMH0(struct PyPetscTAOObject *__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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLMVMH0", 0);

  /* "petsc4py/PETSc/TAO.pyx":1521
 * 
 *         """
 *         cdef Mat mat = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoLMVMGetH0(self.tao, &mat.mat))
 *         CHKERR(PetscINCREF(mat.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1521, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1522
 *         """
 *         cdef Mat mat = Mat()
 *         CHKERR(TaoLMVMGetH0(self.tao, &mat.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(mat.obj))
 *         return mat
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLMVMGetH0(__pyx_v_self->tao, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1522, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1523
 *         cdef Mat mat = Mat()
 *         CHKERR(TaoLMVMGetH0(self.tao, &mat.mat))
 *         CHKERR(PetscINCREF(mat.obj))             # <<<<<<<<<<<<<<
 *         return mat
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mat->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1523, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1524
 *         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":1511
 *         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_XDECREF(__pyx_t_2);
  __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":1526
 *         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_149getLMVMH0KSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_148getLMVMH0KSP, "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:1526");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_149getLMVMH0KSP = {"getLMVMH0KSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_149getLMVMH0KSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_148getLMVMH0KSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_149getLMVMH0KSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLMVMH0KSP", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_148getLMVMH0KSP(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_148getLMVMH0KSP(struct PyPetscTAOObject *__pyx_v_self) {
  struct PyPetscKSPObject *__pyx_v_ksp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLMVMH0KSP", 0);

  /* "petsc4py/PETSc/TAO.pyx":1536
 * 
 *         """
 *         cdef KSP ksp = KSP()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoLMVMGetH0KSP(self.tao, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1536, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1537
 *         """
 *         cdef KSP ksp = KSP()
 *         CHKERR(TaoLMVMGetH0KSP(self.tao, &ksp.ksp))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(ksp.obj))
 *         return ksp
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLMVMGetH0KSP(__pyx_v_self->tao, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1537, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1538
 *         cdef KSP ksp = KSP()
 *         CHKERR(TaoLMVMGetH0KSP(self.tao, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))             # <<<<<<<<<<<<<<
 *         return ksp
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1538, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1539
 *         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":1526
 *         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_XDECREF(__pyx_t_2);
  __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":1541
 *         return ksp
 * 
 *     def getVariableBounds(self) -> tuple[Vec, Vec]:             # <<<<<<<<<<<<<<
 *         """Return the lower and upper bounds vectors.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_151getVariableBounds(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_150getVariableBounds, "TAO.getVariableBounds(self) -> tuple[Vec, Vec]\nReturn the lower and upper bounds vectors.\n\n        Not collective.\n\n        See Also\n        --------\n        setVariableBounds, petsc.TaoGetVariableBounds\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:1541");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_151getVariableBounds = {"getVariableBounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_151getVariableBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_150getVariableBounds};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_151getVariableBounds(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getVariableBounds", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_150getVariableBounds(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_150getVariableBounds(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getVariableBounds", 0);

  /* "petsc4py/PETSc/TAO.pyx":1551
 * 
 *         """
 *         cdef Vec xl = Vec(), xu = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetVariableBounds(self.tao, &xl.vec, &xu.vec))
 *         CHKERR(PetscINCREF(xl.obj)); CHKERR(PetscINCREF(xu.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1551, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_xl = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1551, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_xu = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1552
 *         """
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetVariableBounds(__pyx_v_self->tao, (&__pyx_v_xl->vec), (&__pyx_v_xu->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1552, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1553
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_xl->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1553, __pyx_L1_error)
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_xu->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1553, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1554
 *         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, 1554, __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)) != (0)) __PYX_ERR(52, 1554, __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)) != (0)) __PYX_ERR(52, 1554, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":1541
 *         return ksp
 * 
 *     def getVariableBounds(self) -> tuple[Vec, Vec]:             # <<<<<<<<<<<<<<
 *         """Return the lower and upper bounds vectors.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":1556
 *         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_153setBNCGType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_152setBNCGType, "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:1556");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_153setBNCGType = {"setBNCGType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_153setBNCGType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_152setBNCGType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_153setBNCGType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cg_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1556, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1556, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBNCGType", 0) < (0)) __PYX_ERR(52, 1556, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBNCGType", 1, 1, 1, i); __PYX_ERR(52, 1556, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1556, __pyx_L3_error)
    }
    __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, 1556, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_152setBNCGType(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_cg_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_152setBNCGType(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1566
 * 
 *         """
 *         cdef PetscTAOBNCGType ctype = cg_type             # <<<<<<<<<<<<<<
 *         CHKERR(TaoBNCGSetType(self.tao, ctype))
 * 
*/
  __pyx_t_1 = ((TaoBNCGType)__Pyx_PyLong_As_TaoBNCGType(__pyx_v_cg_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1566, __pyx_L1_error)
  __pyx_v_ctype = __pyx_t_1;

  /* "petsc4py/PETSc/TAO.pyx":1567
 *         """
 *         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, 1567, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1556
 *         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":1569
 *         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_155getBNCGType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_154getBNCGType, "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:1569");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_155getBNCGType = {"getBNCGType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_155getBNCGType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_154getBNCGType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_155getBNCGType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBNCGType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_154getBNCGType(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_154getBNCGType(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1579
 * 
 *         """
 *         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":1580
 *         """
 *         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, 1580, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1581
 *         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_PyLong_From_TaoBNCGType(__pyx_v_cg_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":1569
 *         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":1583
 *         return cg_type
 * 
 *     def setIterationNumber(self, its: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the current iteration number.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_157setIterationNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_156setIterationNumber, "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:1583");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_157setIterationNumber = {"setIterationNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_157setIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_156setIterationNumber};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_157setIterationNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_its,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1583, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1583, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setIterationNumber", 0) < (0)) __PYX_ERR(52, 1583, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setIterationNumber", 1, 1, 1, i); __PYX_ERR(52, 1583, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1583, __pyx_L3_error)
    }
    __pyx_v_its = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setIterationNumber", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1583, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_156setIterationNumber(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_its);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_156setIterationNumber(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1593
 * 
 *         """
 *         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, 1593, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/TAO.pyx":1594
 *         """
 *         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, 1594, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1583
 *         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":1596
 *         CHKERR(TaoSetIterationNumber(self.tao, ival))
 * 
 *     def getIterationNumber(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the current iteration number.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_159getIterationNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_158getIterationNumber, "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:1596");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_159getIterationNumber = {"getIterationNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_159getIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_158getIterationNumber};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_159getIterationNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getIterationNumber", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_158getIterationNumber(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_158getIterationNumber(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1606
 * 
 *         """
 *         cdef PetscInt its=0             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetIterationNumber(self.tao, &its))
 *         return toInt(its)
*/
  __pyx_v_its = 0;

  /* "petsc4py/PETSc/TAO.pyx":1607
 *         """
 *         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, 1607, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1608
 *         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, 1608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":1596
 *         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":1610
 *         return toInt(its)
 * 
 *     def getObjectiveValue(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the current value of the objective function.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_161getObjectiveValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_160getObjectiveValue, "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:1610");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_161getObjectiveValue = {"getObjectiveValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_161getObjectiveValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_160getObjectiveValue};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_161getObjectiveValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getObjectiveValue", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_160getObjectiveValue(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_160getObjectiveValue(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1620
 * 
 *         """
 *         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":1621
 *         """
 *         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, 1621, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1622
 *         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, 1622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":1610
 *         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":1626
 *     getFunctionValue = getObjectiveValue
 * 
 *     def getConvergedReason(self) -> ConvergedReason:             # <<<<<<<<<<<<<<
 *         """Return the reason for the solver convergence.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_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_3TAO_162getConvergedReason, "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:1626");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_163getConvergedReason = {"getConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_163getConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_162getConvergedReason};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getConvergedReason", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_162getConvergedReason(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_162getConvergedReason(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1636
 * 
 *         """
 *         cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetConvergedReason(self.tao, &reason))
 *         return reason
*/
  __pyx_v_reason = TAO_CONTINUE_ITERATING;

  /* "petsc4py/PETSc/TAO.pyx":1637
 *         """
 *         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, 1637, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1638
 *         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_PyLong_From_TaoConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":1626
 *     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":1640
 *         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_165getSolutionNorm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_164getSolutionNorm, "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:1640");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_165getSolutionNorm = {"getSolutionNorm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_165getSolutionNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_164getSolutionNorm};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_165getSolutionNorm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSolutionNorm", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_164getSolutionNorm(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_164getSolutionNorm(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1659
 * 
 *         """
 *         cdef PetscReal gnorm=0             # <<<<<<<<<<<<<<
 *         cdef PetscReal cnorm=0
 *         cdef PetscReal fval=0
*/
  __pyx_v_gnorm = 0.0;

  /* "petsc4py/PETSc/TAO.pyx":1660
 *         """
 *         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":1661
 *         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":1662
 *         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, 1662, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1663
 *         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, 1663, __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, 1663, __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, 1663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1663, __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) != (0)) __PYX_ERR(52, 1663, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(52, 1663, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4) != (0)) __PYX_ERR(52, 1663, __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":1640
 *         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":1665
 *         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_167getSolutionStatus(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_166getSolutionStatus, "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:1665");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_167getSolutionStatus = {"getSolutionStatus", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_167getSolutionStatus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_166getSolutionStatus};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_167getSolutionStatus(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSolutionStatus", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_166getSolutionStatus(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_166getSolutionStatus(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1690
 * 
 *         """
 *         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":1691
 *         """
 *         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":1692
 *         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":1693
 *         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, 1693, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1696
 *                                     &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, 1696, __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, 1696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "petsc4py/PETSc/TAO.pyx":1697
 *                                     &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, 1697, __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, 1697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "petsc4py/PETSc/TAO.pyx":1698
 *         return (toInt(its), toReal(fval),
 *                 toReal(gnorm), toReal(cnorm),
 *                 toReal(xdiff), reason)             # <<<<<<<<<<<<<<
 * 
 *     def checkConverged(self) -> ConvergedReason:
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_xdiff); if (unlikely(!__pyx_t_6)) __PYX_ERR(52, 1698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyLong_From_TaoConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_7)) __PYX_ERR(52, 1698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "petsc4py/PETSc/TAO.pyx":1696
 *                                     &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, 1696, __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) != (0)) __PYX_ERR(52, 1696, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3) != (0)) __PYX_ERR(52, 1696, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_4) != (0)) __PYX_ERR(52, 1696, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_5) != (0)) __PYX_ERR(52, 1696, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_6) != (0)) __PYX_ERR(52, 1696, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_7) != (0)) __PYX_ERR(52, 1696, __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":1665
 *         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":1700
 *                 toReal(xdiff), reason)
 * 
 *     def checkConverged(self) -> ConvergedReason:             # <<<<<<<<<<<<<<
 *         """Run convergence test and return converged reason.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_169checkConverged(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_168checkConverged, "TAO.checkConverged(self) -> ConvergedReason\nRun convergence test and return converged reason.\n\n        Collective.\n\n        See Also\n        --------\n        converged\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:1700");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_169checkConverged = {"checkConverged", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_169checkConverged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_168checkConverged};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_169checkConverged(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("checkConverged (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("checkConverged", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("checkConverged", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_168checkConverged(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_168checkConverged(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("checkConverged", 0);

  /* "petsc4py/PETSc/TAO.pyx":1710
 * 
 *         """
 *         cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING             # <<<<<<<<<<<<<<
 *         CHKERR(TaoConverged(self.tao, &reason))
 *         return reason
*/
  __pyx_v_reason = TAO_CONTINUE_ITERATING;

  /* "petsc4py/PETSc/TAO.pyx":1711
 *         """
 *         cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING
 *         CHKERR(TaoConverged(self.tao, &reason))             # <<<<<<<<<<<<<<
 *         return reason
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoConverged(__pyx_v_self->tao, (&__pyx_v_reason))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1711, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1712
 *         cdef PetscTAOConvergedReason reason = TAO_CONTINUE_ITERATING
 *         CHKERR(TaoConverged(self.tao, &reason))
 *         return reason             # <<<<<<<<<<<<<<
 * 
 *     def getKSP(self) -> KSP:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_TaoConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":1700
 *                 toReal(xdiff), reason)
 * 
 *     def checkConverged(self) -> ConvergedReason:             # <<<<<<<<<<<<<<
 *         """Run convergence test and return converged reason.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.checkConverged", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TAO.pyx":1714
 *         return reason
 * 
 *     def getKSP(self) -> KSP:             # <<<<<<<<<<<<<<
 *         """Return the linear solver used by the nonlinear solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_171getKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_170getKSP, "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:1714");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_171getKSP = {"getKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_171getKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_170getKSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_171getKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getKSP", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_170getKSP(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_170getKSP(struct PyPetscTAOObject *__pyx_v_self) {
  struct PyPetscKSPObject *__pyx_v_ksp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getKSP", 0);

  /* "petsc4py/PETSc/TAO.pyx":1724
 * 
 *         """
 *         cdef KSP ksp = KSP()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetKSP(self.tao, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1724, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1725
 *         """
 *         cdef KSP ksp = KSP()
 *         CHKERR(TaoGetKSP(self.tao, &ksp.ksp))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(ksp.obj))
 *         return ksp
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetKSP(__pyx_v_self->tao, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1725, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1726
 *         cdef KSP ksp = KSP()
 *         CHKERR(TaoGetKSP(self.tao, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))             # <<<<<<<<<<<<<<
 *         return ksp
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1726, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1727
 *         CHKERR(TaoGetKSP(self.tao, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))
 *         return ksp             # <<<<<<<<<<<<<<
 * 
 *     # TaoTerm related routines
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_ksp);
  __pyx_r = ((PyObject *)__pyx_v_ksp);
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":1714
 *         return 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_XDECREF(__pyx_t_2);
  __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":1731
 *     # TaoTerm related routines
 * 
 *     def getTerm(self) -> tuple[float, TAOTerm, Vec, Mat]:             # <<<<<<<<<<<<<<
 *         """Return the entire objective term of the solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_173getTerm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_172getTerm, "TAO.getTerm(self) -> tuple[float, TAOTerm, Vec, Mat]\nReturn the entire objective term of the solver.\n\n        Not collective.\n\n        Returns\n        -------\n        scale : float\n            The scale of the term.\n        term : TAOTerm\n            The term of the whole objective.\n        params : Vec\n            The parameters vector.\n        mapmat : Mat\n            The mapping matrix of the term.\n\n        See Also\n        --------\n        petsc.TaoGetTerm\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:1731");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_173getTerm = {"getTerm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_173getTerm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_172getTerm};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_173getTerm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getTerm (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTerm", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTerm", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_172getTerm(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_172getTerm(struct PyPetscTAOObject *__pyx_v_self) {
  struct PyPetscTAOTermObject *__pyx_v_term = 0;
  struct PyPetscVecObject *__pyx_v_params = 0;
  struct PyPetscMatObject *__pyx_v_mapmat = 0;
  PetscReal __pyx_v__scale;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __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("getTerm", 0);

  /* "petsc4py/PETSc/TAO.pyx":1752
 * 
 *         """
 *         cdef TAOTerm term = TAOTerm()             # <<<<<<<<<<<<<<
 *         cdef Vec params = Vec()
 *         cdef Mat mapmat = Mat()
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOTerm, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1752, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_term = ((struct PyPetscTAOTermObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1753
 *         """
 *         cdef TAOTerm term = TAOTerm()
 *         cdef Vec params = Vec()             # <<<<<<<<<<<<<<
 *         cdef Mat mapmat = Mat()
 *         cdef PetscReal _scale=1
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1753, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_params = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1754
 *         cdef TAOTerm term = TAOTerm()
 *         cdef Vec params = Vec()
 *         cdef Mat mapmat = Mat()             # <<<<<<<<<<<<<<
 *         cdef PetscReal _scale=1
 *         CHKERR(TaoGetTerm(self.tao, &_scale, &term.taoterm, &params.vec, &mapmat.mat))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1754, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_mapmat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1755
 *         cdef Vec params = Vec()
 *         cdef Mat mapmat = Mat()
 *         cdef PetscReal _scale=1             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetTerm(self.tao, &_scale, &term.taoterm, &params.vec, &mapmat.mat))
 *         CHKERR(PetscINCREF(term.obj))
*/
  __pyx_v__scale = 1.0;

  /* "petsc4py/PETSc/TAO.pyx":1756
 *         cdef Mat mapmat = Mat()
 *         cdef PetscReal _scale=1
 *         CHKERR(TaoGetTerm(self.tao, &_scale, &term.taoterm, &params.vec, &mapmat.mat))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(term.obj))
 *         if params.vec != NULL: CHKERR(PetscINCREF(params.obj))
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetTerm(__pyx_v_self->tao, (&__pyx_v__scale), (&__pyx_v_term->taoterm), (&__pyx_v_params->vec), (&__pyx_v_mapmat->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1756, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1757
 *         cdef PetscReal _scale=1
 *         CHKERR(TaoGetTerm(self.tao, &_scale, &term.taoterm, &params.vec, &mapmat.mat))
 *         CHKERR(PetscINCREF(term.obj))             # <<<<<<<<<<<<<<
 *         if params.vec != NULL: CHKERR(PetscINCREF(params.obj))
 *         if mapmat.mat != NULL: CHKERR(PetscINCREF(mapmat.obj))
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_term->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1757, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1758
 *         CHKERR(TaoGetTerm(self.tao, &_scale, &term.taoterm, &params.vec, &mapmat.mat))
 *         CHKERR(PetscINCREF(term.obj))
 *         if params.vec != NULL: CHKERR(PetscINCREF(params.obj))             # <<<<<<<<<<<<<<
 *         if mapmat.mat != NULL: CHKERR(PetscINCREF(mapmat.obj))
 *         return (toReal(_scale), term, params, mapmat)
*/
  __pyx_t_5 = (__pyx_v_params->vec != NULL);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_params->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1758, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/TAO.pyx":1759
 *         CHKERR(PetscINCREF(term.obj))
 *         if params.vec != NULL: CHKERR(PetscINCREF(params.obj))
 *         if mapmat.mat != NULL: CHKERR(PetscINCREF(mapmat.obj))             # <<<<<<<<<<<<<<
 *         return (toReal(_scale), term, params, mapmat)
 * 
*/
  __pyx_t_5 = (__pyx_v_mapmat->mat != NULL);
  if (__pyx_t_5) {
    __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_mapmat->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1759, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/TAO.pyx":1760
 *         if params.vec != NULL: CHKERR(PetscINCREF(params.obj))
 *         if mapmat.mat != NULL: CHKERR(PetscINCREF(mapmat.obj))
 *         return (toReal(_scale), term, params, mapmat)             # <<<<<<<<<<<<<<
 * 
 *     def addTerm(self, prefix: str | None, scale: float, term: TAOTerm, Vec params=None, Mat mapmat=None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v__scale); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1760, __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) != (0)) __PYX_ERR(52, 1760, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_term);
  __Pyx_GIVEREF((PyObject *)__pyx_v_term);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_term)) != (0)) __PYX_ERR(52, 1760, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_params);
  __Pyx_GIVEREF((PyObject *)__pyx_v_params);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_v_params)) != (0)) __PYX_ERR(52, 1760, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_mapmat);
  __Pyx_GIVEREF((PyObject *)__pyx_v_mapmat);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_v_mapmat)) != (0)) __PYX_ERR(52, 1760, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":1731
 *     # TaoTerm related routines
 * 
 *     def getTerm(self) -> tuple[float, TAOTerm, Vec, Mat]:             # <<<<<<<<<<<<<<
 *         """Return the entire objective term of the solver.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.getTerm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_term);
  __Pyx_XDECREF((PyObject *)__pyx_v_params);
  __Pyx_XDECREF((PyObject *)__pyx_v_mapmat);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TAO.pyx":1762
 *         return (toReal(_scale), term, params, mapmat)
 * 
 *     def addTerm(self, prefix: str | None, scale: float, term: TAOTerm, Vec params=None, Mat mapmat=None) -> None:             # <<<<<<<<<<<<<<
 *         """Add an objective term to the solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_175addTerm(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_174addTerm, "TAO.addTerm(self, prefix: str | None, scale: float, term: TAOTerm, params: Vec | None = None, mapmat: Mat | None = None) -> None\nAdd an objective term to the solver.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        prefix\n            The prefix used for configuring the new term.\n        scale\n            The scale of the term.\n        term\n            The objective term to be added to the solver.\n        params\n            The parameter vector.\n        mapmat\n            The mapping matrix.\n\n        See Also\n        --------\n        petsc.TaoAddTerm\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:1762");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_175addTerm = {"addTerm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_175addTerm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_174addTerm};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_175addTerm(PyObject *__pyx_v_self, 
#if CYTHON_METH_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;
  PyObject *__pyx_v_scale = 0;
  PyObject *__pyx_v_term = 0;
  struct PyPetscVecObject *__pyx_v_params = 0;
  struct PyPetscMatObject *__pyx_v_mapmat = 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("addTerm (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,&__pyx_mstate_global->__pyx_n_u_scale,&__pyx_mstate_global->__pyx_n_u_term,&__pyx_mstate_global->__pyx_n_u_params,&__pyx_mstate_global->__pyx_n_u_mapmat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1762, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(52, 1762, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 1762, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1762, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1762, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1762, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addTerm", 0) < (0)) __PYX_ERR(52, 1762, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addTerm", 0, 3, 5, i); __PYX_ERR(52, 1762, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(52, 1762, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 1762, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1762, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1762, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1762, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
    }
    __pyx_v_prefix = values[0];
    __pyx_v_scale = values[1];
    __pyx_v_term = values[2];
    __pyx_v_params = ((struct PyPetscVecObject *)values[3]);
    __pyx_v_mapmat = ((struct PyPetscMatObject *)values[4]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("addTerm", 0, 3, 5, __pyx_nargs); __PYX_ERR(52, 1762, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.addTerm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_params), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "params", 0))) __PYX_ERR(52, 1762, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapmat), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "mapmat", 0))) __PYX_ERR(52, 1762, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_174addTerm(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_prefix, __pyx_v_scale, __pyx_v_term, __pyx_v_params, __pyx_v_mapmat);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_174addTerm(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_prefix, PyObject *__pyx_v_scale, PyObject *__pyx_v_term, struct PyPetscVecObject *__pyx_v_params, struct PyPetscMatObject *__pyx_v_mapmat) {
  char const *__pyx_v_cprefix;
  struct PyPetscTAOTermObject *__pyx_v_ctype = 0;
  Vec __pyx_v_p;
  Mat __pyx_v_m;
  PetscReal __pyx_v_cscale;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Vec __pyx_t_3;
  Mat __pyx_t_4;
  PetscReal __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("addTerm", 0);
  __Pyx_INCREF(__pyx_v_prefix);

  /* "petsc4py/PETSc/TAO.pyx":1785
 * 
 *         """
 *         cdef const char *cprefix = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cprefix)
 *         cdef TAOTerm ctype = term
*/
  __pyx_v_cprefix = NULL;

  /* "petsc4py/PETSc/TAO.pyx":1786
 *         """
 *         cdef const char *cprefix = NULL
 *         prefix = str2bytes(prefix, &cprefix)             # <<<<<<<<<<<<<<
 *         cdef TAOTerm ctype = term
 *         cdef PetscVec p = NULL
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_prefix, (&__pyx_v_cprefix)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1786, __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":1787
 *         cdef const char *cprefix = NULL
 *         prefix = str2bytes(prefix, &cprefix)
 *         cdef TAOTerm ctype = term             # <<<<<<<<<<<<<<
 *         cdef PetscVec p = NULL
 *         if params is not None: p = params.vec
*/
  __pyx_t_1 = __pyx_v_term;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOTerm))))) __PYX_ERR(52, 1787, __pyx_L1_error)
  __pyx_v_ctype = ((struct PyPetscTAOTermObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1788
 *         prefix = str2bytes(prefix, &cprefix)
 *         cdef TAOTerm ctype = term
 *         cdef PetscVec p = NULL             # <<<<<<<<<<<<<<
 *         if params is not None: p = params.vec
 *         cdef PetscMat m = NULL
*/
  __pyx_v_p = NULL;

  /* "petsc4py/PETSc/TAO.pyx":1789
 *         cdef TAOTerm ctype = term
 *         cdef PetscVec p = NULL
 *         if params is not None: p = params.vec             # <<<<<<<<<<<<<<
 *         cdef PetscMat m = NULL
 *         if mapmat is not None: m = mapmat.mat
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_params) != Py_None);
  if (__pyx_t_2) {
    __pyx_t_3 = __pyx_v_params->vec;
    __pyx_v_p = __pyx_t_3;
  }

  /* "petsc4py/PETSc/TAO.pyx":1790
 *         cdef PetscVec p = NULL
 *         if params is not None: p = params.vec
 *         cdef PetscMat m = NULL             # <<<<<<<<<<<<<<
 *         if mapmat is not None: m = mapmat.mat
 *         cdef PetscReal cscale = asReal(scale)
*/
  __pyx_v_m = NULL;

  /* "petsc4py/PETSc/TAO.pyx":1791
 *         if params is not None: p = params.vec
 *         cdef PetscMat m = NULL
 *         if mapmat is not None: m = mapmat.mat             # <<<<<<<<<<<<<<
 *         cdef PetscReal cscale = asReal(scale)
 *         CHKERR(TaoAddTerm(self.tao, cprefix, cscale, ctype.taoterm, p, m))
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_mapmat) != Py_None);
  if (__pyx_t_2) {
    __pyx_t_4 = __pyx_v_mapmat->mat;
    __pyx_v_m = __pyx_t_4;
  }

  /* "petsc4py/PETSc/TAO.pyx":1792
 *         cdef PetscMat m = NULL
 *         if mapmat is not None: m = mapmat.mat
 *         cdef PetscReal cscale = asReal(scale)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoAddTerm(self.tao, cprefix, cscale, ctype.taoterm, p, m))
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_scale); if (unlikely(__pyx_t_5 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(52, 1792, __pyx_L1_error)
  __pyx_v_cscale = __pyx_t_5;

  /* "petsc4py/PETSc/TAO.pyx":1793
 *         if mapmat is not None: m = mapmat.mat
 *         cdef PetscReal cscale = asReal(scale)
 *         CHKERR(TaoAddTerm(self.tao, cprefix, cscale, ctype.taoterm, p, m))             # <<<<<<<<<<<<<<
 * 
 *     # ALMM routines
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoAddTerm(__pyx_v_self->tao, __pyx_v_cprefix, __pyx_v_cscale, __pyx_v_ctype->taoterm, __pyx_v_p, __pyx_v_m)); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1793, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1762
 *         return (toReal(_scale), term, params, mapmat)
 * 
 *     def addTerm(self, prefix: str | None, scale: float, term: TAOTerm, Vec params=None, Mat mapmat=None) -> None:             # <<<<<<<<<<<<<<
 *         """Add an objective term to 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.addTerm", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ctype);
  __Pyx_XDECREF(__pyx_v_prefix);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TAO.pyx":1797
 *     # ALMM routines
 * 
 *     def getALMMSubsolver(self) -> TAO:             # <<<<<<<<<<<<<<
 *         """Return the subsolver inside the ALMM solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_177getALMMSubsolver(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_176getALMMSubsolver, "TAO.getALMMSubsolver(self) -> TAO\nReturn the subsolver inside the ALMM solver.\n\n        Not collective.\n\n        See Also\n        --------\n        setALMMSubsolver, petsc.TaoALMMGetSubsolver\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:1797");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_177getALMMSubsolver = {"getALMMSubsolver", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_177getALMMSubsolver, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_176getALMMSubsolver};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_177getALMMSubsolver(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getALMMSubsolver (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getALMMSubsolver", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getALMMSubsolver", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_176getALMMSubsolver(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_176getALMMSubsolver(struct PyPetscTAOObject *__pyx_v_self) {
  struct PyPetscTAOObject *__pyx_v_subsolver = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getALMMSubsolver", 0);

  /* "petsc4py/PETSc/TAO.pyx":1807
 * 
 *         """
 *         cdef TAO subsolver = TAO()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoALMMGetSubsolver(self.tao, &subsolver.tao))
 *         CHKERR(PetscINCREF(subsolver.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1807, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_subsolver = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1808
 *         """
 *         cdef TAO subsolver = TAO()
 *         CHKERR(TaoALMMGetSubsolver(self.tao, &subsolver.tao))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(subsolver.obj))
 *         return subsolver
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoALMMGetSubsolver(__pyx_v_self->tao, (&__pyx_v_subsolver->tao))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1808, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1809
 *         cdef TAO subsolver = TAO()
 *         CHKERR(TaoALMMGetSubsolver(self.tao, &subsolver.tao))
 *         CHKERR(PetscINCREF(subsolver.obj))             # <<<<<<<<<<<<<<
 *         return subsolver
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_subsolver->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1809, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1810
 *         CHKERR(TaoALMMGetSubsolver(self.tao, &subsolver.tao))
 *         CHKERR(PetscINCREF(subsolver.obj))
 *         return subsolver             # <<<<<<<<<<<<<<
 * 
 *     def getALMMType(self) -> ALMMType:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_subsolver);
  __pyx_r = ((PyObject *)__pyx_v_subsolver);
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":1797
 *     # ALMM routines
 * 
 *     def getALMMSubsolver(self) -> TAO:             # <<<<<<<<<<<<<<
 *         """Return the subsolver inside the ALMM solver.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.getALMMSubsolver", __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":1812
 *         return subsolver
 * 
 *     def getALMMType(self) -> ALMMType:             # <<<<<<<<<<<<<<
 *         """Return the type of the ALMM solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_179getALMMType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_178getALMMType, "TAO.getALMMType(self) -> ALMMType\nReturn the type of the ALMM solver.\n\n        Not collective.\n\n        See Also\n        --------\n        setALMMType, petsc.TaoALMMGetType\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:1812");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_179getALMMType = {"getALMMType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_179getALMMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_178getALMMType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_179getALMMType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getALMMType (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getALMMType", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getALMMType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_178getALMMType(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_178getALMMType(struct PyPetscTAOObject *__pyx_v_self) {
  TaoALMMType __pyx_v_almm_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("getALMMType", 0);

  /* "petsc4py/PETSc/TAO.pyx":1822
 * 
 *         """
 *         cdef PetscTAOALMMType almm_type = TAO_ALMM_PHR             # <<<<<<<<<<<<<<
 *         CHKERR(TaoALMMGetType(self.tao, &almm_type))
 *         return almm_type
*/
  __pyx_v_almm_type = TAO_ALMM_PHR;

  /* "petsc4py/PETSc/TAO.pyx":1823
 *         """
 *         cdef PetscTAOALMMType almm_type = TAO_ALMM_PHR
 *         CHKERR(TaoALMMGetType(self.tao, &almm_type))             # <<<<<<<<<<<<<<
 *         return almm_type
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoALMMGetType(__pyx_v_self->tao, (&__pyx_v_almm_type))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1823, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1824
 *         cdef PetscTAOALMMType almm_type = TAO_ALMM_PHR
 *         CHKERR(TaoALMMGetType(self.tao, &almm_type))
 *         return almm_type             # <<<<<<<<<<<<<<
 * 
 *     def setALMMSubsolver(self, subsolver: TAO) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_TaoALMMType(__pyx_v_almm_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":1812
 *         return subsolver
 * 
 *     def getALMMType(self) -> ALMMType:             # <<<<<<<<<<<<<<
 *         """Return the type of the ALMM solver.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.getALMMType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TAO.pyx":1826
 *         return almm_type
 * 
 *     def setALMMSubsolver(self, subsolver: TAO) -> None:             # <<<<<<<<<<<<<<
 *         """Set the subsolver inside the ALMM solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_181setALMMSubsolver(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_180setALMMSubsolver, "TAO.setALMMSubsolver(self, subsolver: TAO) -> None\nSet the subsolver inside the ALMM solver.\n\n        Logically collective.\n\n        See Also\n        --------\n        getALMMSubsolver, petsc.TaoALMMSetSubsolver\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:1826");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_181setALMMSubsolver = {"setALMMSubsolver", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_181setALMMSubsolver, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_180setALMMSubsolver};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_181setALMMSubsolver(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_subsolver = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setALMMSubsolver (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_subsolver,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1826, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1826, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setALMMSubsolver", 0) < (0)) __PYX_ERR(52, 1826, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setALMMSubsolver", 1, 1, 1, i); __PYX_ERR(52, 1826, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1826, __pyx_L3_error)
    }
    __pyx_v_subsolver = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setALMMSubsolver", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1826, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.setALMMSubsolver", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_180setALMMSubsolver(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_subsolver);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_180setALMMSubsolver(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_subsolver) {
  struct PyPetscTAOObject *__pyx_v_ctype = 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("setALMMSubsolver", 0);

  /* "petsc4py/PETSc/TAO.pyx":1836
 * 
 *         """
 *         cdef TAO ctype = subsolver             # <<<<<<<<<<<<<<
 *         CHKERR(TaoALMMSetSubsolver(self.tao, ctype.tao))
 * 
*/
  __pyx_t_1 = __pyx_v_subsolver;
  __Pyx_INCREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO))))) __PYX_ERR(52, 1836, __pyx_L1_error)
  __pyx_v_ctype = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1837
 *         """
 *         cdef TAO ctype = subsolver
 *         CHKERR(TaoALMMSetSubsolver(self.tao, ctype.tao))             # <<<<<<<<<<<<<<
 * 
 *     def setALMMType(self, tao_almm_type: ALMMType) -> None:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoALMMSetSubsolver(__pyx_v_self->tao, __pyx_v_ctype->tao)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1837, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1826
 *         return almm_type
 * 
 *     def setALMMSubsolver(self, subsolver: TAO) -> None:             # <<<<<<<<<<<<<<
 *         """Set the subsolver inside the ALMM 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.setALMMSubsolver", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ctype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TAO.pyx":1839
 *         CHKERR(TaoALMMSetSubsolver(self.tao, ctype.tao))
 * 
 *     def setALMMType(self, tao_almm_type: ALMMType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the ALMM type of the solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_183setALMMType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_182setALMMType, "TAO.setALMMType(self, tao_almm_type: ALMMType) -> None\nSet the ALMM type of the solver.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        tao_almm_type\n            The type of the solver.\n\n        See Also\n        --------\n        getALMMType, petsc.TaoALMMSetType\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:1839");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_183setALMMType = {"setALMMType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_183setALMMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_182setALMMType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_183setALMMType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_almm_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("setALMMType (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tao_almm_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1839, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1839, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setALMMType", 0) < (0)) __PYX_ERR(52, 1839, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setALMMType", 1, 1, 1, i); __PYX_ERR(52, 1839, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1839, __pyx_L3_error)
    }
    __pyx_v_tao_almm_type = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setALMMType", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1839, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.setALMMType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_182setALMMType(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_tao_almm_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_182setALMMType(struct PyPetscTAOObject *__pyx_v_self, PyObject *__pyx_v_tao_almm_type) {
  TaoALMMType __pyx_v_ctype;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  TaoALMMType __pyx_t_1;
  PetscErrorCode __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setALMMType", 0);

  /* "petsc4py/PETSc/TAO.pyx":1854
 * 
 *         """
 *         cdef PetscTAOALMMType ctype = tao_almm_type             # <<<<<<<<<<<<<<
 *         CHKERR(TaoALMMSetType(self.tao, ctype))
 * 
*/
  __pyx_t_1 = ((TaoALMMType)__Pyx_PyLong_As_TaoALMMType(__pyx_v_tao_almm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(52, 1854, __pyx_L1_error)
  __pyx_v_ctype = __pyx_t_1;

  /* "petsc4py/PETSc/TAO.pyx":1855
 *         """
 *         cdef PetscTAOALMMType ctype = tao_almm_type
 *         CHKERR(TaoALMMSetType(self.tao, ctype))             # <<<<<<<<<<<<<<
 * 
 *     # BRGN routines
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoALMMSetType(__pyx_v_self->tao, __pyx_v_ctype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1855, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1839
 *         CHKERR(TaoALMMSetSubsolver(self.tao, ctype.tao))
 * 
 *     def setALMMType(self, tao_almm_type: ALMMType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the ALMM type of the solver.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.TAO.setALMMType", __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
 *     # BRGN routines
 * 
 *     def getBRGNSubsolver(self) -> TAO:             # <<<<<<<<<<<<<<
 *         """Return the subsolver inside the BRGN solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_185getBRGNSubsolver(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_184getBRGNSubsolver, "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:1859");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_185getBRGNSubsolver = {"getBRGNSubsolver", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_185getBRGNSubsolver, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_184getBRGNSubsolver};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_185getBRGNSubsolver(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBRGNSubsolver", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_184getBRGNSubsolver(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_184getBRGNSubsolver(struct PyPetscTAOObject *__pyx_v_self) {
  struct PyPetscTAOObject *__pyx_v_subsolver = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getBRGNSubsolver", 0);

  /* "petsc4py/PETSc/TAO.pyx":1869
 * 
 *         """
 *         cdef TAO subsolver = TAO()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoBRGNGetSubsolver(self.tao, &subsolver.tao))
 *         CHKERR(PetscINCREF(subsolver.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1869, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_subsolver = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1870
 *         """
 *         cdef TAO subsolver = TAO()
 *         CHKERR(TaoBRGNGetSubsolver(self.tao, &subsolver.tao))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(subsolver.obj))
 *         return subsolver
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBRGNGetSubsolver(__pyx_v_self->tao, (&__pyx_v_subsolver->tao))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1870, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1871
 *         cdef TAO subsolver = TAO()
 *         CHKERR(TaoBRGNGetSubsolver(self.tao, &subsolver.tao))
 *         CHKERR(PetscINCREF(subsolver.obj))             # <<<<<<<<<<<<<<
 *         return subsolver
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_subsolver->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1871, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1872
 *         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":1859
 *     # 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_XDECREF(__pyx_t_2);
  __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":1874
 *         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_187setBRGNRegularizerObjectiveGradient(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_186setBRGNRegularizerObjectiveGradient, "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:1874");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_187setBRGNRegularizerObjectiveGradient = {"setBRGNRegularizerObjectiveGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_187setBRGNRegularizerObjectiveGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_186setBRGNRegularizerObjectiveGradient};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_187setBRGNRegularizerObjectiveGradient(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_objgrad,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1874, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1874, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1874, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1874, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBRGNRegularizerObjectiveGradient", 0) < (0)) __PYX_ERR(52, 1874, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBRGNRegularizerObjectiveGradient", 0, 1, 3, i); __PYX_ERR(52, 1874, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1874, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1874, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1874, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1874, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_186setBRGNRegularizerObjectiveGradient(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_objgrad, __pyx_v_args, __pyx_v_kargs);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_186setBRGNRegularizerObjectiveGradient(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":1884
 * 
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":1885
 *         """
 *         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, 1885, __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":1886
 *         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, <void*>context))
*/
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 1886, __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) != (0)) __PYX_ERR(52, 1886, __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) != (0)) __PYX_ERR(52, 1886, __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) != (0)) __PYX_ERR(52, 1886, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1887
 *         if kargs is None: kargs = {}
 *         context = (objgrad, args, kargs)
 *         self.set_attr("__brgnregobjgrad__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoBRGNSetRegularizerObjectiveAndGradientRoutine(self.tao, TAO_BRGNRegObjGrad, <void*>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, 1887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1888
 *         context = (objgrad, args, kargs)
 *         self.set_attr("__brgnregobjgrad__", context)
 *         CHKERR(TaoBRGNSetRegularizerObjectiveAndGradientRoutine(self.tao, TAO_BRGNRegObjGrad, <void*>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, 1888, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1874
 *         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":1890
 *         CHKERR(TaoBRGNSetRegularizerObjectiveAndGradientRoutine(self.tao, TAO_BRGNRegObjGrad, <void*>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_189setBRGNRegularizerHessian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_188setBRGNRegularizerHessian, "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:1890");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_189setBRGNRegularizerHessian = {"setBRGNRegularizerHessian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_189setBRGNRegularizerHessian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_188setBRGNRegularizerHessian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_189setBRGNRegularizerHessian(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_hessian,&__pyx_mstate_global->__pyx_n_u_H,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1890, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 1890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBRGNRegularizerHessian", 0) < (0)) __PYX_ERR(52, 1890, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBRGNRegularizerHessian", 0, 1, 4, i); __PYX_ERR(52, 1890, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(52, 1890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 1890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1890, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct PyPetscMatObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1890, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 1, "H", 0))) __PYX_ERR(52, 1890, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_188setBRGNRegularizerHessian(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_188setBRGNRegularizerHessian(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":1900
 * 
 *         """
 *         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":1901
 *         """
 *         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":1902
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":1903
 *         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, 1903, __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":1904
 *         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, <void*>context))
*/
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 1904, __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) != (0)) __PYX_ERR(52, 1904, __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) != (0)) __PYX_ERR(52, 1904, __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) != (0)) __PYX_ERR(52, 1904, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1905
 *         if kargs is None: kargs = {}
 *         context = (hessian, args, kargs)
 *         self.set_attr("__brgnreghessian__", context)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoBRGNSetRegularizerHessianRoutine(self.tao, Hmat, TAO_BRGNRegHessian, <void*>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, 1905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1906
 *         context = (hessian, args, kargs)
 *         self.set_attr("__brgnreghessian__", context)
 *         CHKERR(TaoBRGNSetRegularizerHessianRoutine(self.tao, Hmat, TAO_BRGNRegHessian, <void*>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, 1906, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1890
 *         CHKERR(TaoBRGNSetRegularizerObjectiveAndGradientRoutine(self.tao, TAO_BRGNRegObjGrad, <void*>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":1908
 *         CHKERR(TaoBRGNSetRegularizerHessianRoutine(self.tao, Hmat, TAO_BRGNRegHessian, <void*>context))
 * 
 *     def setBRGNRegularizerWeight(self, weight: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the regularizer weight.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_191setBRGNRegularizerWeight(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_190setBRGNRegularizerWeight, "TAO.setBRGNRegularizerWeight(self, weight: float) -> None\nSet the regularizer weight.\n\n        Collective.\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:1908");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_191setBRGNRegularizerWeight = {"setBRGNRegularizerWeight", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_191setBRGNRegularizerWeight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_190setBRGNRegularizerWeight};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_191setBRGNRegularizerWeight(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_weight,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1908, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1908, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBRGNRegularizerWeight", 0) < (0)) __PYX_ERR(52, 1908, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBRGNRegularizerWeight", 1, 1, 1, i); __PYX_ERR(52, 1908, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1908, __pyx_L3_error)
    }
    __pyx_v_weight = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setBRGNRegularizerWeight", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1908, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_190setBRGNRegularizerWeight(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_weight);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_190setBRGNRegularizerWeight(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1914
 * 
 *         """
 *         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, 1914, __pyx_L1_error)
  __pyx_v_cweight = __pyx_t_1;

  /* "petsc4py/PETSc/TAO.pyx":1915
 *         """
 *         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, 1915, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1908
 *         CHKERR(TaoBRGNSetRegularizerHessianRoutine(self.tao, Hmat, TAO_BRGNRegHessian, <void*>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":1917
 *         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_193setBRGNSmoothL1Epsilon(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_192setBRGNSmoothL1Epsilon, "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:1917");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_193setBRGNSmoothL1Epsilon = {"setBRGNSmoothL1Epsilon", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_193setBRGNSmoothL1Epsilon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_192setBRGNSmoothL1Epsilon};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_193setBRGNSmoothL1Epsilon(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_epsilon,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1917, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1917, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBRGNSmoothL1Epsilon", 0) < (0)) __PYX_ERR(52, 1917, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBRGNSmoothL1Epsilon", 1, 1, 1, i); __PYX_ERR(52, 1917, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1917, __pyx_L3_error)
    }
    __pyx_v_epsilon = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setBRGNSmoothL1Epsilon", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1917, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_192setBRGNSmoothL1Epsilon(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_epsilon);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_192setBRGNSmoothL1Epsilon(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1927
 * 
 *         """
 *         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, 1927, __pyx_L1_error)
  __pyx_v_ceps = __pyx_t_1;

  /* "petsc4py/PETSc/TAO.pyx":1928
 *         """
 *         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, 1928, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1917
 *         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":1930
 *         CHKERR(TaoBRGNSetL1SmoothEpsilon(self.tao, ceps))
 * 
 *     def setBRGNDictionaryMatrix(self, Mat D) -> None:             # <<<<<<<<<<<<<<
 *         """Set the dictionary matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_195setBRGNDictionaryMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_194setBRGNDictionaryMatrix, "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:1930");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_195setBRGNDictionaryMatrix = {"setBRGNDictionaryMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_195setBRGNDictionaryMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_194setBRGNDictionaryMatrix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_195setBRGNDictionaryMatrix(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_D,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1930, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1930, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBRGNDictionaryMatrix", 0) < (0)) __PYX_ERR(52, 1930, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBRGNDictionaryMatrix", 1, 1, 1, i); __PYX_ERR(52, 1930, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1930, __pyx_L3_error)
    }
    __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, 1930, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "D", 0))) __PYX_ERR(52, 1930, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_194setBRGNDictionaryMatrix(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_D);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_194setBRGNDictionaryMatrix(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1940
 * 
 *         """
 *         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, 1940, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1930
 *         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":1942
 *         CHKERR(TaoBRGNSetDictionaryMatrix(self.tao, D.mat))
 * 
 *     def getBRGNDampingVector(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the damping vector.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_197getBRGNDampingVector(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_196getBRGNDampingVector, "TAO.getBRGNDampingVector(self) -> Vec\nReturn the damping vector.\n\n        Not collective.\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:1942");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_197getBRGNDampingVector = {"getBRGNDampingVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_197getBRGNDampingVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_196getBRGNDampingVector};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_197getBRGNDampingVector(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBRGNDampingVector", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_196getBRGNDampingVector(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_196getBRGNDampingVector(struct PyPetscTAOObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_damp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getBRGNDampingVector", 0);

  /* "petsc4py/PETSc/TAO.pyx":1952
 *         # --------
 *         # petsc.TaoBRGNGetDampingVector
 *         cdef Vec damp = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoBRGNGetDampingVector(self.tao, &damp.vec))
 *         CHKERR(PetscINCREF(damp.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 1952, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_damp = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1953
 *         # petsc.TaoBRGNGetDampingVector
 *         cdef Vec damp = Vec()
 *         CHKERR(TaoBRGNGetDampingVector(self.tao, &damp.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(damp.obj))
 *         return damp
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoBRGNGetDampingVector(__pyx_v_self->tao, (&__pyx_v_damp->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1953, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1954
 *         cdef Vec damp = Vec()
 *         CHKERR(TaoBRGNGetDampingVector(self.tao, &damp.vec))
 *         CHKERR(PetscINCREF(damp.obj))             # <<<<<<<<<<<<<<
 *         return damp
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_damp->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 1954, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1955
 *         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":1942
 *         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_XDECREF(__pyx_t_2);
  __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":1957
 *         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_199createPython(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_198createPython, "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:1957");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_199createPython = {"createPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_199createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_198createPython};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_199createPython(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_context,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1957, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1957, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1957, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createPython", 0) < (0)) __PYX_ERR(52, 1957, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 1957, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1957, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1957, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_198createPython(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_context, __pyx_v_comm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_198createPython(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1974
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(52, 1974, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/TAO.pyx":1975
 *         """
 *         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":1976
 *         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, 1976, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1977
 *         cdef PetscTAO tao = NULL
 *         CHKERR(TaoCreate(ccomm, &tao))
 *         CHKERR(PetscCLEAR(self.obj)); self.tao = tao             # <<<<<<<<<<<<<<
 *         CHKERR(TaoSetType(self.tao, TAOPYTHON))
 *         CHKERR(TaoPythonSetContext(self.tao, <void*>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, 1977, __pyx_L1_error)
  __pyx_v_self->tao = __pyx_v_tao;

  /* "petsc4py/PETSc/TAO.pyx":1978
 *         CHKERR(TaoCreate(ccomm, &tao))
 *         CHKERR(PetscCLEAR(self.obj)); self.tao = tao
 *         CHKERR(TaoSetType(self.tao, TAOPYTHON))             # <<<<<<<<<<<<<<
 *         CHKERR(TaoPythonSetContext(self.tao, <void*>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, 1978, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1979
 *         CHKERR(PetscCLEAR(self.obj)); self.tao = tao
 *         CHKERR(TaoSetType(self.tao, TAOPYTHON))
 *         CHKERR(TaoPythonSetContext(self.tao, <void*>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, 1979, __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, 1979, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1980
 *         CHKERR(TaoSetType(self.tao, TAOPYTHON))
 *         CHKERR(TaoPythonSetContext(self.tao, <void*>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":1957
 *         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":1982
 *         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_201setPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_200setPythonContext, "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:1982");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_201setPythonContext = {"setPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_201setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_200setPythonContext};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_201setPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_context,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 1982, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1982, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPythonContext", 0) < (0)) __PYX_ERR(52, 1982, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, i); __PYX_ERR(52, 1982, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 1982, __pyx_L3_error)
    }
    __pyx_v_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPythonContext", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 1982, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_200setPythonContext(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_context);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_200setPythonContext(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":1992
 * 
 *         """
 *         CHKERR(TaoPythonSetContext(self.tao, <void*>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, 1992, __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, 1992, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":1982
 *         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":1994
 *         CHKERR(TaoPythonSetContext(self.tao, <void*>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_203getPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_202getPythonContext, "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:1994");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_203getPythonContext = {"getPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_203getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_202getPythonContext};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_203getPythonContext(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPythonContext", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_202getPythonContext(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_202getPythonContext(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2004
 * 
 *         """
 *         cdef void *context = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TaoPythonGetContext(self.tao, &context))
 *         if context == NULL: return None
*/
  __pyx_v_context = NULL;

  /* "petsc4py/PETSc/TAO.pyx":2005
 *         """
 *         cdef void *context = NULL
 *         CHKERR(TaoPythonGetContext(self.tao, &context))             # <<<<<<<<<<<<<<
 *         if context == NULL: return None
 *         else: return <object> context
*/
  __pyx_t_1 = TaoPythonGetContext(__pyx_v_self->tao, (&__pyx_v_context)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2005, __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, 2005, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2006
 *         cdef void *context = NULL
 *         CHKERR(TaoPythonGetContext(self.tao, &context))
 *         if context == NULL: return None             # <<<<<<<<<<<<<<
 *         else: return <object> 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":2007
 *         CHKERR(TaoPythonGetContext(self.tao, &context))
 *         if context == NULL: return None
 *         else: return <object> 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":1994
 *         CHKERR(TaoPythonSetContext(self.tao, <void*>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":2009
 *         else: return <object> 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_205setPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_204setPythonType, "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:2009");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_205setPythonType = {"setPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_205setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_204setPythonType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_205setPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_py_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 2009, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2009, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPythonType", 0) < (0)) __PYX_ERR(52, 2009, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPythonType", 1, 1, 1, i); __PYX_ERR(52, 2009, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2009, __pyx_L3_error)
    }
    __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, 2009, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_204setPythonType(((struct PyPetscTAOObject *)__pyx_v_self), __pyx_v_py_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_204setPythonType(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":2020
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         py_type = str2bytes(py_type, &cval)
 *         CHKERR(TaoPythonSetType(self.tao, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/TAO.pyx":2021
 *         """
 *         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, 2021, __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":2022
 *         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, 2022, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2009
 *         else: return <object> 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":2024
 *         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_207getPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_206getPythonType, "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:2024");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_207getPythonType = {"getPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_207getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_206getPythonType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_207getPythonType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPythonType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_206getPythonType(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_206getPythonType(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2035
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TaoPythonGetType(self.tao, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/TAO.pyx":2036
 *         """
 *         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, 2036, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2037
 *         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, 2037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":2024
 *         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":2039
 *         return bytes2str(cval)
 * 
 *     def getLineSearch(self) -> TAOLineSearch:             # <<<<<<<<<<<<<<
 *         """Return the TAO Line Search object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_209getLineSearch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_208getLineSearch, "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:2039");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_3TAO_209getLineSearch = {"getLineSearch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_209getLineSearch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_208getLineSearch};
static PyObject *__pyx_pw_8petsc4py_5PETSc_3TAO_209getLineSearch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLineSearch", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_3TAO_208getLineSearch(((struct PyPetscTAOObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_3TAO_208getLineSearch(struct PyPetscTAOObject *__pyx_v_self) {
  struct PyPetscTAOLineSearchObject *__pyx_v_ls = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLineSearch", 0);

  /* "petsc4py/PETSc/TAO.pyx":2049
 * 
 *         """
 *         cdef TAOLineSearch ls = TAOLineSearch()             # <<<<<<<<<<<<<<
 *         CHKERR(TaoGetLineSearch(self.tao, &ls.taols))
 *         CHKERR(PetscINCREF(ls.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2049, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_ls = ((struct PyPetscTAOLineSearchObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2050
 *         """
 *         cdef TAOLineSearch ls = TAOLineSearch()
 *         CHKERR(TaoGetLineSearch(self.tao, &ls.taols))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(ls.obj))
 *         return ls
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoGetLineSearch(__pyx_v_self->tao, (&__pyx_v_ls->taols))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2050, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2051
 *         cdef TAOLineSearch ls = TAOLineSearch()
 *         CHKERR(TaoGetLineSearch(self.tao, &ls.taols))
 *         CHKERR(PetscINCREF(ls.obj))             # <<<<<<<<<<<<<<
 *         return ls
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ls->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2051, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2052
 *         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":2039
 *         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_XDECREF(__pyx_t_2);
  __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":2062
 *     property appctx:
 *         """Application context."""
 *         def __get__(self) -> Any:             # <<<<<<<<<<<<<<
 *             return self.getAppCtx()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2063
 *         """Application context."""
 *         def __get__(self) -> Any:
 *             return self.getAppCtx()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value: Any):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getAppCtx, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2063, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":2062
 *     property appctx:
 *         """Application context."""
 *         def __get__(self) -> Any:             # <<<<<<<<<<<<<<
 *             return self.getAppCtx()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2065
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2066
 * 
 *         def __set__(self, value: Any):
 *             self.setAppCtx(value)             # <<<<<<<<<<<<<<
 * 
 *     # --- linear solver ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setAppCtx, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2066, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2065
 *             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_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":2072
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2073
 *         """Linear solver."""
 *         def __get__(self) -> KSP:
 *             return self.getKSP()             # <<<<<<<<<<<<<<
 * 
 *     # --- tolerances ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getKSP, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":2072
 *     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_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":2080
 *     property ftol:
 *         """Broken."""
 *         def __get__(self) -> Any:             # <<<<<<<<<<<<<<
 *             return self.getFunctionTolerances()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2081
 *         """Broken."""
 *         def __get__(self) -> Any:
 *             return self.getFunctionTolerances()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getFunctionTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":2080
 *     property ftol:
 *         """Broken."""
 *         def __get__(self) -> Any:             # <<<<<<<<<<<<<<
 *             return self.getFunctionTolerances()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2083
 *             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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2084
 * 
 *         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":2085
 *         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_mstate_global->__pyx_n_u_setFunctionTolerances); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 2085, __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, 2085, __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, 2085, __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":2084
 * 
 *         def __set__(self, value):
 *             if isinstance(value, (tuple, list)):             # <<<<<<<<<<<<<<
 *                 self.setFunctionTolerances(*value)
 *             elif isinstance(value, dict):
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/TAO.pyx":2086
 *             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":2087
 *                 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_mstate_global->__pyx_n_u_setFunctionTolerances); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2087, __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, 2087, __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, 2087, __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, 2087, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 2087, __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":2086
 *             if isinstance(value, (tuple, list)):
 *                 self.setFunctionTolerances(*value)
 *             elif isinstance(value, dict):             # <<<<<<<<<<<<<<
 *                 self.setFunctionTolerances(**value)
 *             else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/TAO.pyx":2089
 *                 self.setFunctionTolerances(**value)
 *             else:
 *                 raise TypeError("expecting tuple/list or dict")             # <<<<<<<<<<<<<<
 * 
 *     property gtol:
*/
  /*else*/ {
    __pyx_t_4 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_expecting_tuple_list_or_dict};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 2089, __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, 2089, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/TAO.pyx":2083
 *             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":2093
 *     property gtol:
 *         """Broken."""
 *         def __get__(self) -> Any:             # <<<<<<<<<<<<<<
 *             return self.getGradientTolerances()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2094
 *         """Broken."""
 *         def __get__(self) -> Any:
 *             return self.getGradientTolerances()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getGradientTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":2093
 *     property gtol:
 *         """Broken."""
 *         def __get__(self) -> Any:             # <<<<<<<<<<<<<<
 *             return self.getGradientTolerances()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2096
 *             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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2097
 * 
 *         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":2098
 *         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_mstate_global->__pyx_n_u_getGradientTolerances); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 2098, __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, 2098, __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, 2098, __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":2097
 * 
 *         def __set__(self, value):
 *             if isinstance(value, (tuple, list)):             # <<<<<<<<<<<<<<
 *                 self.getGradientTolerances(*value)
 *             elif isinstance(value, dict):
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/TAO.pyx":2099
 *             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":2100
 *                 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_mstate_global->__pyx_n_u_getGradientTolerances); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2100, __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, 2100, __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, 2100, __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, 2100, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 2100, __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":2099
 *             if isinstance(value, (tuple, list)):
 *                 self.getGradientTolerances(*value)
 *             elif isinstance(value, dict):             # <<<<<<<<<<<<<<
 *                 self.getGradientTolerances(**value)
 *             else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/TAO.pyx":2102
 *                 self.getGradientTolerances(**value)
 *             else:
 *                 raise TypeError("expecting tuple/list or dict")             # <<<<<<<<<<<<<<
 * 
 *     property ctol:
*/
  /*else*/ {
    __pyx_t_4 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_expecting_tuple_list_or_dict};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 2102, __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, 2102, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/TAO.pyx":2096
 *             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":2106
 *     property ctol:
 *         """Broken."""
 *         def __get__(self) -> Any:             # <<<<<<<<<<<<<<
 *             return self.getConstraintTolerances()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2107
 *         """Broken."""
 *         def __get__(self) -> Any:
 *             return self.getConstraintTolerances()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getConstraintTolerances, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":2106
 *     property ctol:
 *         """Broken."""
 *         def __get__(self) -> Any:             # <<<<<<<<<<<<<<
 *             return self.getConstraintTolerances()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2109
 *             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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2110
 * 
 *         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":2111
 *         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_mstate_global->__pyx_n_u_getConstraintTolerances); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 2111, __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, 2111, __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, 2111, __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":2110
 * 
 *         def __set__(self, value):
 *             if isinstance(value, (tuple, list)):             # <<<<<<<<<<<<<<
 *                 self.getConstraintTolerances(*value)
 *             elif isinstance(value, dict):
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/TAO.pyx":2112
 *             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":2113
 *                 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_mstate_global->__pyx_n_u_getConstraintTolerances); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2113, __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, 2113, __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, 2113, __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, 2113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 2113, __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":2112
 *             if isinstance(value, (tuple, list)):
 *                 self.getConstraintTolerances(*value)
 *             elif isinstance(value, dict):             # <<<<<<<<<<<<<<
 *                 self.getConstraintTolerances(**value)
 *             else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/TAO.pyx":2115
 *                 self.getConstraintTolerances(**value)
 *             else:
 *                 raise TypeError("expecting tuple/list or dict")             # <<<<<<<<<<<<<<
 * 
 *     # --- iteration ---
*/
  /*else*/ {
    __pyx_t_4 = NULL;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_expecting_tuple_list_or_dict};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(52, 2115, __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, 2115, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/TAO.pyx":2109
 *             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":2121
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2122
 *         """Number of iterations."""
 *         def __get__(self) -> int:
 *             return self.getIterationNumber()             # <<<<<<<<<<<<<<
 * 
 *     property gnorm:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getIterationNumber, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":2121
 *     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_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":2126
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2127
 *         """Gradient norm."""
 *         def __get__(self) -> float:
 *             return self.getSolutionNorm()[1]             # <<<<<<<<<<<<<<
 * 
 *     property cnorm:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolutionNorm, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 2127, __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":2126
 *     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_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":2131
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2132
 *         """Constraints norm."""
 *         def __get__(self) -> float:
 *             return self.getSolutionNorm()[2]             # <<<<<<<<<<<<<<
 * 
 *     property solution:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolutionNorm, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 2132, __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":2131
 *     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_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":2136
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2137
 *         """Solution vector."""
 *         def __get__(self) -> Vec:
 *             return self.getSolution()             # <<<<<<<<<<<<<<
 * 
 *     property objective:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSolution, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":2136
 *     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_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":2141
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2142
 *         """Objective value."""
 *         def __get__(self) -> float:
 *             return self.getObjectiveValue()             # <<<<<<<<<<<<<<
 * 
 *     property function:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getObjectiveValue, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":2141
 *     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_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":2146
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2147
 *         """Objective value."""
 *         def __get__(self) -> float:
 *             return self.getFunctionValue()             # <<<<<<<<<<<<<<
 * 
 *     property gradient:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getFunctionValue, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":2146
 *     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_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":2151
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2152
 *         """Gradient vector."""
 *         def __get__(self) -> Vec:
 *             return self.getGradient()[0]             # <<<<<<<<<<<<<<
 * 
 *     # --- convergence ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getGradient, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 2152, __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":2151
 *     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_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":2158
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2159
 *         """Converged reason."""
 *         def __get__(self) -> ConvergedReason:
 *             return self.getConvergedReason()             # <<<<<<<<<<<<<<
 * 
 *     property iterating:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getConvergedReason, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":2158
 *     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_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":2163
 *     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__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2164
 *         """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_mstate_global->__pyx_n_u_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_EqObjC(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 2164, __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":2163
 *     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":2168
 *     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__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2169
 *         """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_mstate_global->__pyx_n_u_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 2169, __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":2168
 *     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":2173
 *     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__", 0);

  /* "petsc4py/PETSc/TAO.pyx":2174
 *         """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_mstate_global->__pyx_n_u_reason); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 2174, __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":2173
 *     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":2226
 *     Reason = TAOLineSearchConvergedReason
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":2227
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.taols             # <<<<<<<<<<<<<<
 *         self.taols = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->taols));

  /* "petsc4py/PETSc/TAO.pyx":2228
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.taols
 *         self.taols = NULL             # <<<<<<<<<<<<<<
 * 
 *     def view(self, Viewer viewer=None) -> None:
*/
  __pyx_v_self->taols = NULL;

  /* "petsc4py/PETSc/TAO.pyx":2226
 *     Reason = TAOLineSearchConvergedReason
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.taols
 *         self.taols = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/TAO.pyx":2230
 *         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:2230");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_3view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_2view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 2230, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2230, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(52, 2230, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2230, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 2230, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(52, 2230, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2245
 * 
 *         """
 *         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":2246
 *         """
 *         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":2247
 *         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, 2247, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2230
 *         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":2249
 *         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:2249");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_5destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_4destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2259
 * 
 *         """
 *         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, 2259, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2260
 *         """
 *         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":2249
 *         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":2262
 *         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:2262");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_7create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_6create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 2262, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2262, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(52, 2262, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2262, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(52, 2262, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2277
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(52, 2277, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/TAO.pyx":2278
 *         """
 *         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":2279
 *         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, 2279, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2280
 *         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, 2280, __pyx_L1_error)
  __pyx_v_self->taols = __pyx_v_newtaols;

  /* "petsc4py/PETSc/TAO.pyx":2281
 *         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":2262
 *         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":2283
 *         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:2283");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_9setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_8setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ls_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 2283, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(52, 2283, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(52, 2283, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2283, __pyx_L3_error)
    }
    __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, 2283, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":2298
 * 
 *         """
 *         cdef PetscTAOLineSearchType ctype = NULL             # <<<<<<<<<<<<<<
 *         ls_type = str2bytes(ls_type, &ctype)
 *         CHKERR(TaoLineSearchSetType(self.taols, ctype))
*/
  __pyx_v_ctype = NULL;

  /* "petsc4py/PETSc/TAO.pyx":2299
 *         """
 *         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, 2299, __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":2300
 *         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, 2300, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2283
 *         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":2302
 *         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:2302");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_11getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_10getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2312
 * 
 *         """
 *         cdef PetscTAOLineSearchType ctype = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TaoLineSearchGetType(self.taols, &ctype))
 *         return bytes2str(ctype)
*/
  __pyx_v_ctype = NULL;

  /* "petsc4py/PETSc/TAO.pyx":2313
 *         """
 *         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, 2313, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2314
 *         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, 2314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":2302
 *         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":2316
 *         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:2316");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_13setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_13setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_12setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2326
 * 
 *         """
 *         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, 2326, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2316
 *         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":2328
 *         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:2328");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_15setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_15setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_14setUp};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2338
 * 
 *         """
 *         CHKERR(TaoLineSearchSetUp(self.taols))             # <<<<<<<<<<<<<<
 * 
 *     def setOptionsPrefix(self, prefix: str | None = None) -> 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, 2338, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2328
 *         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":2340
 *         CHKERR(TaoLineSearchSetUp(self.taols))
 * 
 *     def setOptionsPrefix(self, prefix: str | None = None) -> 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: str | None = None) -> 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:2340");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_17setOptionsPrefix = {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_17setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_16setOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 2340, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2340, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOptionsPrefix", 0) < (0)) __PYX_ERR(52, 2340, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2340, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 0, 0, 1, __pyx_nargs); __PYX_ERR(52, 2340, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":2350
 * 
 *         """
 *         cdef const char *cprefix = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cprefix)
 *         CHKERR(TaoLineSearchSetOptionsPrefix(self.taols, cprefix))
*/
  __pyx_v_cprefix = NULL;

  /* "petsc4py/PETSc/TAO.pyx":2351
 *         """
 *         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, 2351, __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":2352
 *         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, 2352, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2340
 *         CHKERR(TaoLineSearchSetUp(self.taols))
 * 
 *     def setOptionsPrefix(self, prefix: str | None = None) -> 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":2354
 *         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:2354");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_19getOptionsPrefix = {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_19getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_18getOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOptionsPrefix", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2364
 * 
 *         """
 *         cdef const char *prefix = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TaoLineSearchGetOptionsPrefix(self.taols, &prefix))
 *         return bytes2str(prefix)
*/
  __pyx_v_prefix = NULL;

  /* "petsc4py/PETSc/TAO.pyx":2365
 *         """
 *         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, 2365, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2366
 *         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, 2366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":2354
 *         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":2368
 *         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:2368");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_21setObjective = {"setObjective", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_21setObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_20setObjective};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_objective,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 2368, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 2368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 2368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setObjective", 0) < (0)) __PYX_ERR(52, 2368, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setObjective", 0, 1, 3, i); __PYX_ERR(52, 2368, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 2368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 2368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2368, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2368, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":2388
 * 
 *         """
 *         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, 2388, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2389
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":2390
 *         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, 2390, __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":2391
 *         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, 2391, __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) != (0)) __PYX_ERR(52, 2391, __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) != (0)) __PYX_ERR(52, 2391, __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) != (0)) __PYX_ERR(52, 2391, __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, 2391, __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":2368
 *         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":2393
 *         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:2393");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_23setGradient = {"setGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_23setGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_22setGradient};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gradient,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 2393, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 2393, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 2393, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2393, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setGradient", 0) < (0)) __PYX_ERR(52, 2393, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setGradient", 0, 1, 3, i); __PYX_ERR(52, 2393, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 2393, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 2393, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2393, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2393, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":2415
 * 
 *         """
 *         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, 2415, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2416
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":2417
 *         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, 2417, __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":2418
 *         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, 2418, __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) != (0)) __PYX_ERR(52, 2418, __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) != (0)) __PYX_ERR(52, 2418, __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) != (0)) __PYX_ERR(52, 2418, __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, 2418, __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":2393
 *         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":2420
 *         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:2420");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_25setObjectiveGradient = {"setObjectiveGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_25setObjectiveGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_24setObjectiveGradient};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_objgrad,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 2420, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 2420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 2420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setObjectiveGradient", 0) < (0)) __PYX_ERR(52, 2420, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setObjectiveGradient", 0, 1, 3, i); __PYX_ERR(52, 2420, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 2420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 2420, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2420, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2420, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":2442
 * 
 *         """
 *         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, 2442, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2443
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/TAO.pyx":2444
 *         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, 2444, __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":2445
 *         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, 2445, __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) != (0)) __PYX_ERR(52, 2445, __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) != (0)) __PYX_ERR(52, 2445, __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) != (0)) __PYX_ERR(52, 2445, __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, 2445, __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":2420
 *         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":2447
 *         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:2447");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_27useTAORoutine = {"useTAORoutine", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_27useTAORoutine, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_26useTAORoutine};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tao,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 2447, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "useTAORoutine", 0) < (0)) __PYX_ERR(52, 2447, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("useTAORoutine", 1, 1, 1, i); __PYX_ERR(52, 2447, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2447, __pyx_L3_error)
    }
    __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, 2447, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, 0, "tao", 0))) __PYX_ERR(52, 2447, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2457
 * 
 *         """
 *         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, 2457, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2447
 *         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":2459
 *         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:2459");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_29apply = {"apply", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_29apply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_28apply};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_g,&__pyx_mstate_global->__pyx_n_u_s_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 2459, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 2459, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 2459, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2459, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "apply", 0) < (0)) __PYX_ERR(52, 2459, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("apply", 1, 3, 3, i); __PYX_ERR(52, 2459, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2459, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(52, 2459, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(52, 2459, __pyx_L3_error)
    }
    __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, 2459, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 2459, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_g), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "g", 0))) __PYX_ERR(52, 2459, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "s", 0))) __PYX_ERR(52, 2459, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2469
 * 
 *         """
 *         cdef PetscReal f = 0             # <<<<<<<<<<<<<<
 *         cdef PetscReal steplen = 0
 *         cdef PetscTAOLineSearchConvergedReason reason = TAOLINESEARCH_CONTINUE_ITERATING
*/
  __pyx_v_f = 0.0;

  /* "petsc4py/PETSc/TAO.pyx":2470
 *         """
 *         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":2471
 *         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":2472
 *         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, 2472, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2473
 *         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)             # <<<<<<<<<<<<<<
 * 
 *     def setInitialStepLength(self, s: float) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_f); if (unlikely(!__pyx_t_2)) __PYX_ERR(52, 2473, __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, 2473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_TaoLineSearchConvergedReason(__pyx_v_reason); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2473, __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) != (0)) __PYX_ERR(52, 2473, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(52, 2473, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4) != (0)) __PYX_ERR(52, 2473, __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":2459
 *         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/TAO.pyx":2475
 *         return (toReal(f), toReal(steplen), reason)
 * 
 *     def setInitialStepLength(self, s: float) -> None:             # <<<<<<<<<<<<<<
 *         """Sets the initial step length of a line search.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_31setInitialStepLength(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_30setInitialStepLength, "TAOLineSearch.setInitialStepLength(self, s: float) -> None\nSets the initial step length of a line search.\n\n        Logically collective.\n\n        See Also\n        --------\n        petsc.TaoLineSearchSetInitialStepLength\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:2475");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_31setInitialStepLength = {"setInitialStepLength", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_31setInitialStepLength, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_30setInitialStepLength};
static PyObject *__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_31setInitialStepLength(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("setInitialStepLength (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_s_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 2475, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2475, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setInitialStepLength", 0) < (0)) __PYX_ERR(52, 2475, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setInitialStepLength", 1, 1, 1, i); __PYX_ERR(52, 2475, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2475, __pyx_L3_error)
    }
    __pyx_v_s = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setInitialStepLength", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 2475, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.setInitialStepLength", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_30setInitialStepLength(((struct PyPetscTAOLineSearchObject *)__pyx_v_self), __pyx_v_s);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_13TAOLineSearch_30setInitialStepLength(struct PyPetscTAOLineSearchObject *__pyx_v_self, PyObject *__pyx_v_s) {
  PetscReal __pyx_v_cs;
  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("setInitialStepLength", 0);

  /* "petsc4py/PETSc/TAO.pyx":2485
 * 
 *         """
 *         cdef PetscReal cs = asReal(s)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoLineSearchSetInitialStepLength(self.taols, cs))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_s); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(52, 2485, __pyx_L1_error)
  __pyx_v_cs = __pyx_t_1;

  /* "petsc4py/PETSc/TAO.pyx":2486
 *         """
 *         cdef PetscReal cs = asReal(s)
 *         CHKERR(TaoLineSearchSetInitialStepLength(self.taols, cs))             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoLineSearchSetInitialStepLength(__pyx_v_self->taols, __pyx_v_cs)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2486, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2475
 *         return (toReal(f), toReal(steplen), reason)
 * 
 *     def setInitialStepLength(self, s: float) -> None:             # <<<<<<<<<<<<<<
 *         """Sets the initial step length of a line search.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.TAOLineSearch.setInitialStepLength", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TAO.pyx":2514
 *     Type   = TAOTermType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.taoterm
 *         self.taoterm = NULL
*/

/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_7TAOTerm_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_7TAOTerm_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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7TAOTerm___cinit__(((struct PyPetscTAOTermObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8petsc4py_5PETSc_7TAOTerm___cinit__(struct PyPetscTAOTermObject *__pyx_v_self) {
  int __pyx_r;

  /* "petsc4py/PETSc/TAO.pyx":2515
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.taoterm             # <<<<<<<<<<<<<<
 *         self.taoterm = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->taoterm));

  /* "petsc4py/PETSc/TAO.pyx":2516
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.taoterm
 *         self.taoterm = NULL             # <<<<<<<<<<<<<<
 * 
 *     def view(self, Viewer viewer=None) -> None:
*/
  __pyx_v_self->taoterm = NULL;

  /* "petsc4py/PETSc/TAO.pyx":2514
 *     Type   = TAOTermType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.taoterm
 *         self.taoterm = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/TAO.pyx":2518
 *         self.taoterm = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the term object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7TAOTerm_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_7TAOTerm_2view, "TAOTerm.view(self, viewer: Viewer | None = None) -> None\nView the term 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.TaoTermView\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:2518");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7TAOTerm_3view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7TAOTerm_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7TAOTerm_2view};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7TAOTerm_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 2518, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2518, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(52, 2518, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2518, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 2518, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TAOTerm.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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(52, 2518, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7TAOTerm_2view(((struct PyPetscTAOTermObject *)__pyx_v_self), __pyx_v_viewer);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7TAOTerm_2view(struct PyPetscTAOTermObject *__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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2533
 * 
 *         """
 *         cdef PetscViewer vwr = NULL             # <<<<<<<<<<<<<<
 *         if viewer is not None: vwr = viewer.vwr
 *         CHKERR(TaoTermView(self.taoterm, vwr))
*/
  __pyx_v_vwr = NULL;

  /* "petsc4py/PETSc/TAO.pyx":2534
 *         """
 *         cdef PetscViewer vwr = NULL
 *         if viewer is not None: vwr = viewer.vwr             # <<<<<<<<<<<<<<
 *         CHKERR(TaoTermView(self.taoterm, 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":2535
 *         cdef PetscViewer vwr = NULL
 *         if viewer is not None: vwr = viewer.vwr
 *         CHKERR(TaoTermView(self.taoterm, vwr))             # <<<<<<<<<<<<<<
 * 
 *     def destroy(self) -> Self:
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoTermView(__pyx_v_self->taoterm, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2535, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2518
 *         self.taoterm = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the term object.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.TAOTerm.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":2537
 *         CHKERR(TaoTermView(self.taoterm, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the term object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7TAOTerm_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_7TAOTerm_4destroy, "TAOTerm.destroy(self) -> Self\nDestroy the term object.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.TaoTermDestroy\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:2537");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7TAOTerm_5destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7TAOTerm_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7TAOTerm_4destroy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7TAOTerm_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7TAOTerm_4destroy(((struct PyPetscTAOTermObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7TAOTerm_4destroy(struct PyPetscTAOTermObject *__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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2547
 * 
 *         """
 *         CHKERR(TaoTermDestroy(&self.taoterm))             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoTermDestroy((&__pyx_v_self->taoterm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2547, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2548
 *         """
 *         CHKERR(TaoTermDestroy(&self.taoterm))
 *         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":2537
 *         CHKERR(TaoTermView(self.taoterm, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the term object.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.TAOTerm.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":2550
 *         return self
 * 
 *     def create(self, comm=None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a TAO Term.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7TAOTerm_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_7TAOTerm_6create, "TAOTerm.create(self, comm=None) -> Self\nCreate a TAO Term.\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.TaoTermCreate\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:2550");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7TAOTerm_7create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7TAOTerm_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7TAOTerm_6create};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7TAOTerm_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 2550, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2550, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(52, 2550, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2550, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(52, 2550, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TAOTerm.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7TAOTerm_6create(((struct PyPetscTAOTermObject *)__pyx_v_self), __pyx_v_comm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7TAOTerm_6create(struct PyPetscTAOTermObject *__pyx_v_self, PyObject *__pyx_v_comm) {
  MPI_Comm __pyx_v_ccomm;
  TaoTerm __pyx_v_newtaoterm;
  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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2565
 * 
 *         """
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)             # <<<<<<<<<<<<<<
 *         cdef PetscTAOTerm newtaoterm = NULL
 *         CHKERR(TaoTermCreate(ccomm, &newtaoterm))
*/
  __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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(52, 2565, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/TAO.pyx":2566
 *         """
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
 *         cdef PetscTAOTerm newtaoterm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TaoTermCreate(ccomm, &newtaoterm))
 *         CHKERR(PetscCLEAR(self.obj)); self.taoterm = newtaoterm
*/
  __pyx_v_newtaoterm = NULL;

  /* "petsc4py/PETSc/TAO.pyx":2567
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
 *         cdef PetscTAOTerm newtaoterm = NULL
 *         CHKERR(TaoTermCreate(ccomm, &newtaoterm))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscCLEAR(self.obj)); self.taoterm = newtaoterm
 *         return self
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoTermCreate(__pyx_v_ccomm, (&__pyx_v_newtaoterm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2567, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2568
 *         cdef PetscTAOTerm newtaoterm = NULL
 *         CHKERR(TaoTermCreate(ccomm, &newtaoterm))
 *         CHKERR(PetscCLEAR(self.obj)); self.taoterm = newtaoterm             # <<<<<<<<<<<<<<
 *         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, 2568, __pyx_L1_error)
  __pyx_v_self->taoterm = __pyx_v_newtaoterm;

  /* "petsc4py/PETSc/TAO.pyx":2569
 *         CHKERR(TaoTermCreate(ccomm, &newtaoterm))
 *         CHKERR(PetscCLEAR(self.obj)); self.taoterm = newtaoterm
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def setType(self, term_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":2550
 *         return self
 * 
 *     def create(self, comm=None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a TAO Term.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.TAOTerm.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":2571
 *         return self
 * 
 *     def setType(self, term_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the term.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7TAOTerm_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_7TAOTerm_8setType, "TAOTerm.setType(self, term_type: Type | str) -> None\nSet the type of the term.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        term_type\n            The type of the term.\n\n        See Also\n        --------\n        getType, petsc.TaoTermSetType\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:2571");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7TAOTerm_9setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7TAOTerm_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7TAOTerm_8setType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7TAOTerm_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_term_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_term_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 2571, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2571, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(52, 2571, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(52, 2571, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2571, __pyx_L3_error)
    }
    __pyx_v_term_type = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 2571, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TAOTerm.setType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7TAOTerm_8setType(((struct PyPetscTAOTermObject *)__pyx_v_self), __pyx_v_term_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7TAOTerm_8setType(struct PyPetscTAOTermObject *__pyx_v_self, PyObject *__pyx_v_term_type) {
  TaoTermType __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_term_type);

  /* "petsc4py/PETSc/TAO.pyx":2586
 * 
 *         """
 *         cdef PetscTAOTermType ctype = NULL             # <<<<<<<<<<<<<<
 *         term_type = str2bytes(term_type, &ctype)
 *         CHKERR(TaoTermSetType(self.taoterm, ctype))
*/
  __pyx_v_ctype = NULL;

  /* "petsc4py/PETSc/TAO.pyx":2587
 *         """
 *         cdef PetscTAOTermType ctype = NULL
 *         term_type = str2bytes(term_type, &ctype)             # <<<<<<<<<<<<<<
 *         CHKERR(TaoTermSetType(self.taoterm, ctype))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_term_type, (&__pyx_v_ctype)); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_term_type, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2588
 *         cdef PetscTAOTermType ctype = NULL
 *         term_type = str2bytes(term_type, &ctype)
 *         CHKERR(TaoTermSetType(self.taoterm, ctype))             # <<<<<<<<<<<<<<
 * 
 *     def getType(self) -> str:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoTermSetType(__pyx_v_self->taoterm, __pyx_v_ctype)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2588, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2571
 *         return self
 * 
 *     def setType(self, term_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the term.
 * 
*/

  /* 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.TAOTerm.setType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_term_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/TAO.pyx":2590
 *         CHKERR(TaoTermSetType(self.taoterm, ctype))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the term.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7TAOTerm_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_7TAOTerm_10getType, "TAOTerm.getType(self) -> str\nReturn the type of the term.\n\n        Not collective.\n\n        See Also\n        --------\n        setType, petsc.TaoTermGetType\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:2590");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7TAOTerm_11getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7TAOTerm_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7TAOTerm_10getType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7TAOTerm_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7TAOTerm_10getType(((struct PyPetscTAOTermObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7TAOTerm_10getType(struct PyPetscTAOTermObject *__pyx_v_self) {
  TaoTermType __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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2600
 * 
 *         """
 *         cdef PetscTAOTermType ctype = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(TaoTermGetType(self.taoterm, &ctype))
 *         return bytes2str(ctype)
*/
  __pyx_v_ctype = NULL;

  /* "petsc4py/PETSc/TAO.pyx":2601
 *         """
 *         cdef PetscTAOTermType ctype = NULL
 *         CHKERR(TaoTermGetType(self.taoterm, &ctype))             # <<<<<<<<<<<<<<
 *         return bytes2str(ctype)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoTermGetType(__pyx_v_self->taoterm, (&__pyx_v_ctype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2601, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2602
 *         cdef PetscTAOTermType ctype = NULL
 *         CHKERR(TaoTermGetType(self.taoterm, &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, 2602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/TAO.pyx":2590
 *         CHKERR(TaoTermSetType(self.taoterm, ctype))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the term.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.TAOTerm.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":2604
 *         return bytes2str(ctype)
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the term from the options database.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7TAOTerm_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_7TAOTerm_12setFromOptions, "TAOTerm.setFromOptions(self) -> None\nConfigure the term from the options database.\n\n        Collective.\n\n        See Also\n        --------\n        petsc_options, petsc.TaoTermSetFromOptions\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:2604");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7TAOTerm_13setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7TAOTerm_13setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7TAOTerm_12setFromOptions};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7TAOTerm_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7TAOTerm_12setFromOptions(((struct PyPetscTAOTermObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7TAOTerm_12setFromOptions(struct PyPetscTAOTermObject *__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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2614
 * 
 *         """
 *         CHKERR(TaoTermSetFromOptions(self.taoterm))             # <<<<<<<<<<<<<<
 * 
 *     def setUp(self) -> None:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoTermSetFromOptions(__pyx_v_self->taoterm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2614, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2604
 *         return bytes2str(ctype)
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the term 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.TAOTerm.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":2616
 *         CHKERR(TaoTermSetFromOptions(self.taoterm))
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the term.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7TAOTerm_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_7TAOTerm_14setUp, "TAOTerm.setUp(self) -> None\nSet up the internal data structures for using the term.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.TaoTermSetUp\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:2616");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7TAOTerm_15setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7TAOTerm_15setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7TAOTerm_14setUp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7TAOTerm_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7TAOTerm_14setUp(((struct PyPetscTAOTermObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7TAOTerm_14setUp(struct PyPetscTAOTermObject *__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", 0);

  /* "petsc4py/PETSc/TAO.pyx":2626
 * 
 *         """
 *         CHKERR(TaoTermSetUp(self.taoterm))             # <<<<<<<<<<<<<<
 * 
 *     def setSolutionTemplate(self, Vec x) -> None:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoTermSetUp(__pyx_v_self->taoterm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2626, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2616
 *         CHKERR(TaoTermSetFromOptions(self.taoterm))
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the term.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.TAOTerm.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":2628
 *         CHKERR(TaoTermSetUp(self.taoterm))
 * 
 *     def setSolutionTemplate(self, Vec x) -> None:             # <<<<<<<<<<<<<<
 *         """Set the solution vector template.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7TAOTerm_17setSolutionTemplate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_7TAOTerm_16setSolutionTemplate, "TAOTerm.setSolutionTemplate(self, x: Vec) -> None\nSet the solution vector template.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.TaoTermSetSolutionTemplate\n\n        \nSource code at petsc4py/PETSc/TAO.pyx:2628");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7TAOTerm_17setSolutionTemplate = {"setSolutionTemplate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7TAOTerm_17setSolutionTemplate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7TAOTerm_16setSolutionTemplate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7TAOTerm_17setSolutionTemplate(PyObject *__pyx_v_self, 
#if 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("setSolutionTemplate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_x,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(52, 2628, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2628, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSolutionTemplate", 0) < (0)) __PYX_ERR(52, 2628, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSolutionTemplate", 1, 1, 1, i); __PYX_ERR(52, 2628, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(52, 2628, __pyx_L3_error)
    }
    __pyx_v_x = ((struct PyPetscVecObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setSolutionTemplate", 1, 1, 1, __pyx_nargs); __PYX_ERR(52, 2628, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.TAOTerm.setSolutionTemplate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(52, 2628, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7TAOTerm_16setSolutionTemplate(((struct PyPetscTAOTermObject *)__pyx_v_self), __pyx_v_x);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7TAOTerm_16setSolutionTemplate(struct PyPetscTAOTermObject *__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("setSolutionTemplate", 0);

  /* "petsc4py/PETSc/TAO.pyx":2638
 * 
 *         """
 *         CHKERR(TaoTermSetSolutionTemplate(self.taoterm, x.vec))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoTermSetSolutionTemplate(__pyx_v_self->taoterm, __pyx_v_x->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(52, 2638, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2628
 *         CHKERR(TaoTermSetUp(self.taoterm))
 * 
 *     def setSolutionTemplate(self, Vec x) -> None:             # <<<<<<<<<<<<<<
 *         """Set the solution vector template.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.TAOTerm.setSolutionTemplate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/AO.pyx":17
 *     Type = AOType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":18
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.ao             # <<<<<<<<<<<<<<
 *         self.ao = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->ao));

  /* "petsc4py/PETSc/AO.pyx":19
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.ao
 *         self.ao = NULL             # <<<<<<<<<<<<<<
 * 
 *     def view(self, Viewer viewer=None) -> None:
*/
  __pyx_v_self->ao = NULL;

  /* "petsc4py/PETSc/AO.pyx":17
 *     Type = AOType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.ao
 *         self.ao = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/AO.pyx":21
 *         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:21");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2AO_3view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_2view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(53, 21, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(53, 21, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(53, 21, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(53, 21, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 21, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(53, 21, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/AO.pyx":36
 * 
 *         """
 *         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":37
 *         """
 *         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":38
 *         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, 38, __pyx_L1_error)

  /* "petsc4py/PETSc/AO.pyx":21
 *         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":40
 *         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:40");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2AO_5destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_4destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/AO.pyx":50
 * 
 *         """
 *         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, 50, __pyx_L1_error)

  /* "petsc4py/PETSc/AO.pyx":51
 *         """
 *         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":40
 *         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":53
 *         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:53");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2AO_7createBasic = {"createBasic", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_7createBasic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_6createBasic};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_app,&__pyx_mstate_global->__pyx_n_u_petsc,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(53, 53, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(53, 53, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(53, 53, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(53, 53, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createBasic", 0) < (0)) __PYX_ERR(53, 53, __pyx_L3_error)

      /* "petsc4py/PETSc/AO.pyx":56
 *         self,
 *         app: Sequence[int] | IS,
 *         petsc: Sequence[int] | IS | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Return a basic application ordering using two orderings.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/AO.pyx":57
 *         app: Sequence[int] | IS,
 *         petsc: Sequence[int] | IS | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Return a basic application ordering using two orderings.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createBasic", 0, 1, 3, i); __PYX_ERR(53, 53, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(53, 53, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(53, 53, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(53, 53, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/AO.pyx":56
 *         self,
 *         app: Sequence[int] | IS,
 *         petsc: Sequence[int] | IS | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Return a basic application ordering using two orderings.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/AO.pyx":57
 *         app: Sequence[int] | IS,
 *         petsc: Sequence[int] | IS | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Return a basic application ordering using two orderings.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 53, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":53
 *         return self
 * 
 *     def createBasic(             # <<<<<<<<<<<<<<
 *         self,
 *         app: Sequence[int] | IS,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":83
 * 
 *         """
 *         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":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)
*/
  __pyx_v_napp = 0;
  __pyx_v_idxapp = NULL;

  /* "petsc4py/PETSc/AO.pyx":85
 *         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":86
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(53, 86, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/AO.pyx":87
 *         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 = (<IS>app).iset
*/
  __pyx_v_newao = NULL;

  /* "petsc4py/PETSc/AO.pyx":88
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
 *         cdef PetscAO newao = NULL
 *         if isinstance(app, IS):             # <<<<<<<<<<<<<<
 *             isapp = (<IS>app).iset
 *             if petsc is not None:
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_app, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS); 
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/AO.pyx":89
 *         cdef PetscAO newao = NULL
 *         if isinstance(app, IS):
 *             isapp = (<IS>app).iset             # <<<<<<<<<<<<<<
 *             if petsc is not None:
 *                 ispetsc = (<IS?>petsc).iset
*/
    __pyx_t_3 = ((struct PyPetscISObject *)__pyx_v_app)->iset;
    __pyx_v_isapp = __pyx_t_3;

    /* "petsc4py/PETSc/AO.pyx":90
 *         if isinstance(app, IS):
 *             isapp = (<IS>app).iset
 *             if petsc is not None:             # <<<<<<<<<<<<<<
 *                 ispetsc = (<IS?>petsc).iset
 *             CHKERR(AOCreateBasicIS(isapp, ispetsc, &newao))
*/
    __pyx_t_2 = (__pyx_v_petsc != Py_None);
    if (__pyx_t_2) {

      /* "petsc4py/PETSc/AO.pyx":91
 *             isapp = (<IS>app).iset
 *             if petsc is not None:
 *                 ispetsc = (<IS?>petsc).iset             # <<<<<<<<<<<<<<
 *             CHKERR(AOCreateBasicIS(isapp, ispetsc, &newao))
 *         else:
*/
      if (!(likely(__Pyx_TypeTest(__pyx_v_petsc, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(53, 91, __pyx_L1_error)
      __pyx_t_3 = ((struct PyPetscISObject *)__pyx_v_petsc)->iset;
      __pyx_v_ispetsc = __pyx_t_3;

      /* "petsc4py/PETSc/AO.pyx":90
 *         if isinstance(app, IS):
 *             isapp = (<IS>app).iset
 *             if petsc is not None:             # <<<<<<<<<<<<<<
 *                 ispetsc = (<IS?>petsc).iset
 *             CHKERR(AOCreateBasicIS(isapp, ispetsc, &newao))
*/
    }

    /* "petsc4py/PETSc/AO.pyx":92
 *             if petsc is not None:
 *                 ispetsc = (<IS?>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, 92, __pyx_L1_error)

    /* "petsc4py/PETSc/AO.pyx":88
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
 *         cdef PetscAO newao = NULL
 *         if isinstance(app, IS):             # <<<<<<<<<<<<<<
 *             isapp = (<IS>app).iset
 *             if petsc is not None:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/AO.pyx":94
 *             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, 94, __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":95
 *         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":96
 *             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, 96, __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":97
 *             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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_incompatible_array_sizes, 0, 0);
          __PYX_ERR(53, 97, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(53, 97, __pyx_L1_error)
      #endif

      /* "petsc4py/PETSc/AO.pyx":95
 *         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":98
 *                 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, 98, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/AO.pyx":99
 *                 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, 99, __pyx_L1_error)
  __pyx_v_self->ao = __pyx_v_newao;

  /* "petsc4py/PETSc/AO.pyx":100
 *             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":53
 *         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":102
 *         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:102");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2AO_9createMemoryScalable = {"createMemoryScalable", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_9createMemoryScalable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_8createMemoryScalable};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_app,&__pyx_mstate_global->__pyx_n_u_petsc,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(53, 102, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(53, 102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(53, 102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(53, 102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createMemoryScalable", 0) < (0)) __PYX_ERR(53, 102, __pyx_L3_error)

      /* "petsc4py/PETSc/AO.pyx":105
 *         self,
 *         app: Sequence[int] | IS,
 *         petsc: Sequence[int] | IS | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Return a memory scalable application ordering using two orderings.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/AO.pyx":106
 *         app: Sequence[int] | IS,
 *         petsc: Sequence[int] | IS | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Return a memory scalable application ordering using two orderings.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createMemoryScalable", 0, 1, 3, i); __PYX_ERR(53, 102, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(53, 102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(53, 102, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(53, 102, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/AO.pyx":105
 *         self,
 *         app: Sequence[int] | IS,
 *         petsc: Sequence[int] | IS | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Return a memory scalable application ordering using two orderings.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/AO.pyx":106
 *         app: Sequence[int] | IS,
 *         petsc: Sequence[int] | IS | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Return a memory scalable application ordering using two orderings.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 102, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":102
 *         return self
 * 
 *     def createMemoryScalable(             # <<<<<<<<<<<<<<
 *         self,
 *         app: Sequence[int] | IS,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 const )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 = (<IS>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 = (<IS>app).iset
 *             if petsc is not None:
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_app, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS); 
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/AO.pyx":141
 *         cdef PetscAO newao = NULL
 *         if isinstance(app, IS):
 *             isapp = (<IS>app).iset             # <<<<<<<<<<<<<<
 *             if petsc is not None:
 *                 ispetsc = (<IS?>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 = (<IS>app).iset
 *             if petsc is not None:             # <<<<<<<<<<<<<<
 *                 ispetsc = (<IS?>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 = (<IS>app).iset
 *             if petsc is not None:
 *                 ispetsc = (<IS?>petsc).iset             # <<<<<<<<<<<<<<
 *             CHKERR(AOCreateMemoryScalableIS(isapp, ispetsc, &newao))
 *         else:
*/
      if (!(likely(__Pyx_TypeTest(__pyx_v_petsc, __pyx_mstate_global->__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 = (<IS>app).iset
 *             if petsc is not None:             # <<<<<<<<<<<<<<
 *                 ispetsc = (<IS?>petsc).iset
 *             CHKERR(AOCreateMemoryScalableIS(isapp, ispetsc, &newao))
*/
    }

    /* "petsc4py/PETSc/AO.pyx":144
 *             if petsc is not None:
 *                 ispetsc = (<IS?>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 = (<IS>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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_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":102
 *         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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2AO_11createMapping = {"createMapping", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_11createMapping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_10createMapping};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_app,&__pyx_mstate_global->__pyx_n_u_petsc,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(53, 154, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(53, 154, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(53, 154, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(53, 154, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createMapping", 0) < (0)) __PYX_ERR(53, 154, __pyx_L3_error)

      /* "petsc4py/PETSc/AO.pyx":157
 *         self,
 *         app: Sequence[int] | IS,
 *         petsc: Sequence[int] | IS | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Return an application mapping using two orderings.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createMapping", 0, 1, 3, i); __PYX_ERR(53, 154, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(53, 154, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(53, 154, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(53, 154, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/AO.pyx":157
 *         self,
 *         app: Sequence[int] | IS,
 *         petsc: Sequence[int] | IS | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Return an application mapping using two orderings.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":181
 * 
 *         """
 *         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":182
 *         """
 *         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":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)
 *         cdef PetscAO newao = NULL
*/
  __pyx_v_npetsc = 0;
  __pyx_v_idxpetsc = NULL;

  /* "petsc4py/PETSc/AO.pyx":184
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(53, 184, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/AO.pyx":185
 *         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 = (<IS>app).iset
*/
  __pyx_v_newao = NULL;

  /* "petsc4py/PETSc/AO.pyx":186
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
 *         cdef PetscAO newao = NULL
 *         if isinstance(app, IS):             # <<<<<<<<<<<<<<
 *             isapp = (<IS>app).iset
 *             if petsc is not None:
*/
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_app, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS); 
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/AO.pyx":187
 *         cdef PetscAO newao = NULL
 *         if isinstance(app, IS):
 *             isapp = (<IS>app).iset             # <<<<<<<<<<<<<<
 *             if petsc is not None:
 *                 ispetsc = (<IS?>petsc).iset
*/
    __pyx_t_3 = ((struct PyPetscISObject *)__pyx_v_app)->iset;
    __pyx_v_isapp = __pyx_t_3;

    /* "petsc4py/PETSc/AO.pyx":188
 *         if isinstance(app, IS):
 *             isapp = (<IS>app).iset
 *             if petsc is not None:             # <<<<<<<<<<<<<<
 *                 ispetsc = (<IS?>petsc).iset
 *             CHKERR(AOCreateMappingIS(isapp, ispetsc, &newao))
*/
    __pyx_t_2 = (__pyx_v_petsc != Py_None);
    if (__pyx_t_2) {

      /* "petsc4py/PETSc/AO.pyx":189
 *             isapp = (<IS>app).iset
 *             if petsc is not None:
 *                 ispetsc = (<IS?>petsc).iset             # <<<<<<<<<<<<<<
 *             CHKERR(AOCreateMappingIS(isapp, ispetsc, &newao))
 *         else:
*/
      if (!(likely(__Pyx_TypeTest(__pyx_v_petsc, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(53, 189, __pyx_L1_error)
      __pyx_t_3 = ((struct PyPetscISObject *)__pyx_v_petsc)->iset;
      __pyx_v_ispetsc = __pyx_t_3;

      /* "petsc4py/PETSc/AO.pyx":188
 *         if isinstance(app, IS):
 *             isapp = (<IS>app).iset
 *             if petsc is not None:             # <<<<<<<<<<<<<<
 *                 ispetsc = (<IS?>petsc).iset
 *             CHKERR(AOCreateMappingIS(isapp, ispetsc, &newao))
*/
    }

    /* "petsc4py/PETSc/AO.pyx":190
 *             if petsc is not None:
 *                 ispetsc = (<IS?>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, 190, __pyx_L1_error)

    /* "petsc4py/PETSc/AO.pyx":186
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
 *         cdef PetscAO newao = NULL
 *         if isinstance(app, IS):             # <<<<<<<<<<<<<<
 *             isapp = (<IS>app).iset
 *             if petsc is not None:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/AO.pyx":192
 *             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, 192, __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":193
 *         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":194
 *             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, 194, __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":195
 *             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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), __pyx_mstate_global->__pyx_kp_u_incompatible_array_sizes, 0, 0);
          __PYX_ERR(53, 195, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(53, 195, __pyx_L1_error)
      #endif

      /* "petsc4py/PETSc/AO.pyx":193
 *         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":196
 *                 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, 196, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/AO.pyx":197
 *                 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, 197, __pyx_L1_error)
  __pyx_v_self->ao = __pyx_v_newao;

  /* "petsc4py/PETSc/AO.pyx":198
 *             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":200
 *         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:200");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2AO_13getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_12getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/AO.pyx":210
 * 
 *         """
 *         cdef PetscAOType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(AOGetType(self.ao, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/AO.pyx":211
 *         """
 *         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, 211, __pyx_L1_error)

  /* "petsc4py/PETSc/AO.pyx":212
 *         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, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/AO.pyx":200
 *         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":214
 *         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:214");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2AO_15app2petsc = {"app2petsc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_15app2petsc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_14app2petsc};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(53, 214, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(53, 214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "app2petsc", 0) < (0)) __PYX_ERR(53, 214, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("app2petsc", 1, 1, 1, i); __PYX_ERR(53, 214, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(53, 214, __pyx_L3_error)
    }
    __pyx_v_indices = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("app2petsc", 1, 1, 1, __pyx_nargs); __PYX_ERR(53, 214, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":238
 * 
 *         """
 *         cdef PetscIS iset = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt nidx = 0, *idx = NULL
 *         if isinstance(indices, IS):
*/
  __pyx_v_iset = NULL;

  /* "petsc4py/PETSc/AO.pyx":239
 *         """
 *         cdef PetscIS iset = NULL
 *         cdef PetscInt nidx = 0, *idx = NULL             # <<<<<<<<<<<<<<
 *         if isinstance(indices, IS):
 *             iset = (<IS>indices).iset
*/
  __pyx_v_nidx = 0;
  __pyx_v_idx = NULL;

  /* "petsc4py/PETSc/AO.pyx":240
 *         cdef PetscIS iset = NULL
 *         cdef PetscInt nidx = 0, *idx = NULL
 *         if isinstance(indices, IS):             # <<<<<<<<<<<<<<
 *             iset = (<IS>indices).iset
 *             CHKERR(AOApplicationToPetscIS(self.ao, iset))
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_indices, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/AO.pyx":241
 *         cdef PetscInt nidx = 0, *idx = NULL
 *         if isinstance(indices, IS):
 *             iset = (<IS>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":242
 *         if isinstance(indices, IS):
 *             iset = (<IS>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, 242, __pyx_L1_error)

    /* "petsc4py/PETSc/AO.pyx":240
 *         cdef PetscIS iset = NULL
 *         cdef PetscInt nidx = 0, *idx = NULL
 *         if isinstance(indices, IS):             # <<<<<<<<<<<<<<
 *             iset = (<IS>indices).iset
 *             CHKERR(AOApplicationToPetscIS(self.ao, iset))
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/AO.pyx":244
 *             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, 244, __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":245
 *         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, 245, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/AO.pyx":246
 *             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":214
 *         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":248
 *         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:248");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2AO_17petsc2app = {"petsc2app", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_17petsc2app, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_16petsc2app};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indices,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(53, 248, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(53, 248, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "petsc2app", 0) < (0)) __PYX_ERR(53, 248, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("petsc2app", 1, 1, 1, i); __PYX_ERR(53, 248, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(53, 248, __pyx_L3_error)
    }
    __pyx_v_indices = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("petsc2app", 1, 1, 1, __pyx_nargs); __PYX_ERR(53, 248, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":272
 * 
 *         """
 *         cdef PetscIS iset = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt nidx = 0, *idx = NULL
 *         if isinstance(indices, IS):
*/
  __pyx_v_iset = NULL;

  /* "petsc4py/PETSc/AO.pyx":273
 *         """
 *         cdef PetscIS iset = NULL
 *         cdef PetscInt nidx = 0, *idx = NULL             # <<<<<<<<<<<<<<
 *         if isinstance(indices, IS):
 *             iset = (<IS>indices).iset
*/
  __pyx_v_nidx = 0;
  __pyx_v_idx = NULL;

  /* "petsc4py/PETSc/AO.pyx":274
 *         cdef PetscIS iset = NULL
 *         cdef PetscInt nidx = 0, *idx = NULL
 *         if isinstance(indices, IS):             # <<<<<<<<<<<<<<
 *             iset = (<IS>indices).iset
 *             CHKERR(AOPetscToApplicationIS(self.ao, iset))
*/
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_indices, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS); 
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/AO.pyx":275
 *         cdef PetscInt nidx = 0, *idx = NULL
 *         if isinstance(indices, IS):
 *             iset = (<IS>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":276
 *         if isinstance(indices, IS):
 *             iset = (<IS>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, 276, __pyx_L1_error)

    /* "petsc4py/PETSc/AO.pyx":274
 *         cdef PetscIS iset = NULL
 *         cdef PetscInt nidx = 0, *idx = NULL
 *         if isinstance(indices, IS):             # <<<<<<<<<<<<<<
 *             iset = (<IS>indices).iset
 *             CHKERR(AOPetscToApplicationIS(self.ao, iset))
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/AO.pyx":278
 *             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, 278, __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":279
 *         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, 279, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/AO.pyx":280
 *             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":248
 *         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":72
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":73
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.dm             # <<<<<<<<<<<<<<
 *         self.dm  = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->dm));

  /* "petsc4py/PETSc/DM.pyx":74
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.dm
 *         self.dm  = NULL             # <<<<<<<<<<<<<<
 * 
 *     def view(self, Viewer viewer=None) -> None:
*/
  __pyx_v_self->dm = NULL;

  /* "petsc4py/PETSc/DM.pyx":72
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.dm
 *         self.dm  = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/DM.pyx":76
 *         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:76");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_3view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_2view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 76, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(54, 76, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 76, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(54, 76, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/DM.pyx":91
 * 
 *         """
 *         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":92
 *         """
 *         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":93
 *         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, 93, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":76
 *         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":95
 *         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:95");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_5load = {"load", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_5load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_4load};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 95, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 95, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "load", 0) < (0)) __PYX_ERR(54, 95, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, i); __PYX_ERR(54, 95, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 95, __pyx_L3_error)
    }
    __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, 95, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(54, 95, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/DM.pyx":118
 * 
 *         """
 *         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, 118, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":119
 *         """
 *         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":95
 *         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":121
 *         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:121");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_7destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_6destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DM.pyx":131
 * 
 *         """
 *         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, 131, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":132
 *         """
 *         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":121
 *         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":134
 *         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:134");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_9create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_8create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 134, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 134, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(54, 134, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 134, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(54, 134, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DM.pyx":149
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(54, 149, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":150
 *         """
 *         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":151
 *         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, 151, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":152
 *         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, 152, __pyx_L1_error)
  __pyx_v_self->dm = __pyx_v_newdm;

  /* "petsc4py/PETSc/DM.pyx":153
 *         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":134
 *         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":155
 *         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:155");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_11clone = {"clone", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_11clone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_10clone};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("clone", __pyx_kwds); 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;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clone", 0);

  /* "petsc4py/PETSc/DM.pyx":165
 * 
 *         """
 *         cdef DM dm = type(self)()             # <<<<<<<<<<<<<<
 *         CHKERR(DMClone(self.dm, &dm.dm))
 *         return dm
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 165, __pyx_L1_error)
  __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":166
 *         """
 *         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, 166, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":167
 *         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":155
 *         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":169
 *         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:169");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_13setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_13setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_12setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 169, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 169, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(54, 169, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(54, 169, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 169, __pyx_L3_error)
    }
    __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, 169, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":188
 * 
 *         """
 *         cdef PetscDMType cval = NULL             # <<<<<<<<<<<<<<
 *         dm_type = str2bytes(dm_type, &cval)
 *         CHKERR(DMSetType(self.dm, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DM.pyx":189
 *         """
 *         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, 189, __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":190
 *         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, 190, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":169
 *         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":192
 *         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:192");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_15getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_15getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_14getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DM.pyx":202
 * 
 *         """
 *         cdef PetscDMType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetType(self.dm, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DM.pyx":203
 *         """
 *         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, 203, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":204
 *         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, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":192
 *         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":206
 *         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:206");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_17getDimension = {"getDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_17getDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_16getDimension};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDimension", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DM.pyx":216
 * 
 *         """
 *         cdef PetscInt dim = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetDimension(self.dm, &dim))
 *         return toInt(dim)
*/
  __pyx_v_dim = 0;

  /* "petsc4py/PETSc/DM.pyx":217
 *         """
 *         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, 217, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":218
 *         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, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":206
 *         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":220
 *         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:220");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_19setDimension = {"setDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_19setDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_18setDimension};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dim,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 220, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 220, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDimension", 0) < (0)) __PYX_ERR(54, 220, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDimension", 1, 1, 1, i); __PYX_ERR(54, 220, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 220, __pyx_L3_error)
    }
    __pyx_v_dim = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setDimension", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 220, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DM.pyx":235
 * 
 *         """
 *         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, 235, __pyx_L1_error)
  __pyx_v_cdim = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":236
 *         """
 *         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, 236, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":220
 *         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":238
 *         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:238");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_21getCoordinateDim = {"getCoordinateDim", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_21getCoordinateDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_20getCoordinateDim};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCoordinateDim", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DM.pyx":248
 * 
 *         """
 *         cdef PetscInt dim = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetCoordinateDim(self.dm, &dim))
 *         return toInt(dim)
*/
  __pyx_v_dim = 0;

  /* "petsc4py/PETSc/DM.pyx":249
 *         """
 *         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, 249, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":250
 *         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, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":238
 *         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":252
 *         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:252");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_23setCoordinateDim = {"setCoordinateDim", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_23setCoordinateDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_22setCoordinateDim};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dim,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 252, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 252, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCoordinateDim", 0) < (0)) __PYX_ERR(54, 252, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCoordinateDim", 1, 1, 1, i); __PYX_ERR(54, 252, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 252, __pyx_L3_error)
    }
    __pyx_v_dim = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setCoordinateDim", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 252, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DM.pyx":267
 * 
 *         """
 *         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, 267, __pyx_L1_error)
  __pyx_v_cdim = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":268
 *         """
 *         cdef PetscInt cdim = asInt(dim)
 *         CHKERR(DMSetCoordinateDim(self.dm, cdim))             # <<<<<<<<<<<<<<
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> 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, 268, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":252
 *         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":270
 *         CHKERR(DMSetCoordinateDim(self.dm, cdim))
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> 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) -> 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:270");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_25setOptionsPrefix = {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_25setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_24setOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 270, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 270, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOptionsPrefix", 0) < (0)) __PYX_ERR(54, 270, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, i); __PYX_ERR(54, 270, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 270, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 270, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":280
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(DMSetOptionsPrefix(self.dm, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DM.pyx":281
 *         """
 *         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, 281, __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":282
 *         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, 282, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":270
 *         CHKERR(DMSetCoordinateDim(self.dm, cdim))
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> 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":284
 *         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:284");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_27getOptionsPrefix = {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_27getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_26getOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOptionsPrefix", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DM.pyx":294
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetOptionsPrefix(self.dm, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DM.pyx":295
 *         """
 *         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, 295, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":296
 *         cdef const char *cval = NULL
 *         CHKERR(DMGetOptionsPrefix(self.dm, &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":284
 *         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":298
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> 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) -> 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:298");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_29appendOptionsPrefix = {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_29appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_28appendOptionsPrefix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_prefix,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 298, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 298, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "appendOptionsPrefix", 0) < (0)) __PYX_ERR(54, 298, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, i); __PYX_ERR(54, 298, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 298, __pyx_L3_error)
    }
    __pyx_v_prefix = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("appendOptionsPrefix", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 298, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":308
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         prefix = str2bytes(prefix, &cval)
 *         CHKERR(DMAppendOptionsPrefix(self.dm, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DM.pyx":309
 *         """
 *         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, 309, __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":310
 *         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, 310, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":298
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> 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":312
 *         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:312");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_31setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_31setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_30setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DM.pyx":322
 * 
 *         """
 *         CHKERR(DMSetFromOptions(self.dm))             # <<<<<<<<<<<<<<
 * 
 *     def setUp(self) -> Self:
*/
  __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, 322, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":312
 *         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":324
 *         CHKERR(DMSetFromOptions(self.dm))
 * 
 *     def setUp(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Return the data structure.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_33setUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_32setUp, "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:324");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_33setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_33setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_32setUp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_33setUp(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_32setUp(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_32setUp(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", 0);

  /* "petsc4py/PETSc/DM.pyx":334
 * 
 *         """
 *         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, 334, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":335
 *         """
 *         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":324
 *         CHKERR(DMSetFromOptions(self.dm))
 * 
 *     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":339
 *     # --- application context ---
 * 
 *     def setAppCtx(self, appctx: Any) -> None:             # <<<<<<<<<<<<<<
 *         """Set the application context."""
 *         self.set_attr('__appctx__', appctx)
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_35setAppCtx(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_34setAppCtx, "DM.setAppCtx(self, appctx: Any) -> None\nSet the application context.\nSource code at petsc4py/PETSc/DM.pyx:339");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_35setAppCtx = {"setAppCtx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_35setAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_34setAppCtx};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_35setAppCtx(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_appctx,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 339, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 339, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setAppCtx", 0) < (0)) __PYX_ERR(54, 339, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, i); __PYX_ERR(54, 339, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 339, __pyx_L3_error)
    }
    __pyx_v_appctx = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setAppCtx", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 339, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_34setAppCtx(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_appctx);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_34setAppCtx(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", 0);

  /* "petsc4py/PETSc/DM.pyx":341
 *     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_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, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":339
 *     # --- application context ---
 * 
 *     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.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":343
 *         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_2DM_37getAppCtx(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_36getAppCtx, "DM.getAppCtx(self) -> Any\nReturn the application context.\nSource code at petsc4py/PETSc/DM.pyx:343");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_37getAppCtx = {"getAppCtx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_37getAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_36getAppCtx};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_37getAppCtx(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getAppCtx", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_36getAppCtx(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_36getAppCtx(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", 0);

  /* "petsc4py/PETSc/DM.pyx":345
 *     def getAppCtx(self) -> Any:
 *         """Return the application context."""
 *         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, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":343
 *         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.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":349
 *     #
 * 
 *     def getUseNatural(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Get the flag for constructing a global-to-natural map.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_39getUseNatural(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_38getUseNatural, "DM.getUseNatural(self) -> bool\nGet the flag for constructing a global-to-natural map.\n\n        Not collective.\n\n        Returns\n        -------\n        useNatural : bool\n            Whether a global-to-natural map is created.\n\n        See Also\n        --------\n        petsc.DMGetUseNatural\n\n        \nSource code at petsc4py/PETSc/DM.pyx:349");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_39getUseNatural = {"getUseNatural", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_39getUseNatural, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_38getUseNatural};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_39getUseNatural(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getUseNatural (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getUseNatural", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getUseNatural", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_38getUseNatural(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_38getUseNatural(struct PyPetscDMObject *__pyx_v_self) {
  PetscBool __pyx_v_uN;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscErrorCode __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getUseNatural", 0);

  /* "petsc4py/PETSc/DM.pyx":364
 * 
 *         """
 *         cdef PetscBool uN  = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetUseNatural(self.dm, &uN))
 *         return toBool(uN)
*/
  __pyx_v_uN = PETSC_FALSE;

  /* "petsc4py/PETSc/DM.pyx":365
 *         """
 *         cdef PetscBool uN  = PETSC_FALSE
 *         CHKERR(DMGetUseNatural(self.dm, &uN))             # <<<<<<<<<<<<<<
 *         return toBool(uN)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetUseNatural(__pyx_v_self->dm, (&__pyx_v_uN))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 365, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":366
 *         cdef PetscBool uN  = PETSC_FALSE
 *         CHKERR(DMGetUseNatural(self.dm, &uN))
 *         return toBool(uN)             # <<<<<<<<<<<<<<
 * 
 *     def setUseNatural(self, useNatural : bool) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_uN); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":349
 *     #
 * 
 *     def getUseNatural(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Get the flag for constructing a global-to-natural map.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.DM.getUseNatural", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DM.pyx":368
 *         return toBool(uN)
 * 
 *     def setUseNatural(self, useNatural : bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set the flag for constructing a global-to-natural map.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_41setUseNatural(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_40setUseNatural, "DM.setUseNatural(self, useNatural: bool) -> None\nSet the flag for constructing a global-to-natural map.\n\n        Not collective.\n\n        Parameters\n        ----------\n        useNatural : bool\n            Whether a global-to-natural map is created.\n\n        See Also\n        --------\n        petsc.DMSetUseNatural\n\n        \nSource code at petsc4py/PETSc/DM.pyx:368");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_41setUseNatural = {"setUseNatural", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_41setUseNatural, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_40setUseNatural};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_41setUseNatural(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_useNatural = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setUseNatural (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_useNatural,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 368, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setUseNatural", 0) < (0)) __PYX_ERR(54, 368, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setUseNatural", 1, 1, 1, i); __PYX_ERR(54, 368, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 368, __pyx_L3_error)
    }
    __pyx_v_useNatural = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setUseNatural", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 368, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DM.setUseNatural", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_40setUseNatural(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_useNatural);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_40setUseNatural(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_useNatural) {
  PetscBool __pyx_v_uN;
  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("setUseNatural", 0);

  /* "petsc4py/PETSc/DM.pyx":383
 * 
 *         """
 *         cdef PetscBool uN  = useNatural             # <<<<<<<<<<<<<<
 *         CHKERR(DMSetUseNatural(self.dm, uN))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_useNatural); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(54, 383, __pyx_L1_error)
  __pyx_v_uN = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":384
 *         """
 *         cdef PetscBool uN  = useNatural
 *         CHKERR(DMSetUseNatural(self.dm, uN))             # <<<<<<<<<<<<<<
 * 
 *     def setBasicAdjacency(self, useCone: bool, useClosure: bool) -> None:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetUseNatural(__pyx_v_self->dm, __pyx_v_uN)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 384, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":368
 *         return toBool(uN)
 * 
 *     def setUseNatural(self, useNatural : bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set the flag for constructing a global-to-natural map.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.DM.setUseNatural", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DM.pyx":386
 *         CHKERR(DMSetUseNatural(self.dm, uN))
 * 
 *     def setBasicAdjacency(self, useCone: bool, useClosure: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set the flags for determining variable influence.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_43setBasicAdjacency(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_42setBasicAdjacency, "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:386");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_43setBasicAdjacency = {"setBasicAdjacency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_43setBasicAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_42setBasicAdjacency};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_43setBasicAdjacency(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_useCone,&__pyx_mstate_global->__pyx_n_u_useClosure,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 386, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 386, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 386, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBasicAdjacency", 0) < (0)) __PYX_ERR(54, 386, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBasicAdjacency", 1, 2, 2, i); __PYX_ERR(54, 386, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 386, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 386, __pyx_L3_error)
    }
    __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, 386, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_42setBasicAdjacency(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_useCone, __pyx_v_useClosure);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_42setBasicAdjacency(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", 0);

  /* "petsc4py/PETSc/DM.pyx":403
 * 
 *         """
 *         cdef PetscBool uC  = useCone             # <<<<<<<<<<<<<<
 *         cdef PetscBool uCl = useClosure
 *         CHKERR(DMSetBasicAdjacency(self.dm, uC, uCl))
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_useCone); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(54, 403, __pyx_L1_error)
  __pyx_v_uC = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":404
 *         """
 *         cdef PetscBool uC  = useCone
 *         cdef PetscBool uCl = useClosure             # <<<<<<<<<<<<<<
 *         CHKERR(DMSetBasicAdjacency(self.dm, uC, uCl))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_useClosure); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(54, 404, __pyx_L1_error)
  __pyx_v_uCl = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":405
 *         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, 405, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":386
 *         CHKERR(DMSetUseNatural(self.dm, uN))
 * 
 *     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":407
 *         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_45getBasicAdjacency(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_44getBasicAdjacency, "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:407");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_45getBasicAdjacency = {"getBasicAdjacency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_45getBasicAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_44getBasicAdjacency};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_45getBasicAdjacency(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBasicAdjacency", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_44getBasicAdjacency(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_44getBasicAdjacency(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", 0);

  /* "petsc4py/PETSc/DM.pyx":424
 * 
 *         """
 *         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":425
 *         """
 *         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":426
 *         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, 426, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":427
 *         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, 427, __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, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 427, __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) != (0)) __PYX_ERR(54, 427, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(54, 427, __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":407
 *         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":429
 *         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_47setFieldAdjacency(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_46setFieldAdjacency, "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:429");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_47setFieldAdjacency = {"setFieldAdjacency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_47setFieldAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_46setFieldAdjacency};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_47setFieldAdjacency(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_useCone,&__pyx_mstate_global->__pyx_n_u_useClosure,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 429, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 429, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 429, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 429, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFieldAdjacency", 0) < (0)) __PYX_ERR(54, 429, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFieldAdjacency", 1, 3, 3, i); __PYX_ERR(54, 429, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 429, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 429, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 429, __pyx_L3_error)
    }
    __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, 429, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_46setFieldAdjacency(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_field, __pyx_v_useCone, __pyx_v_useClosure);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_46setFieldAdjacency(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", 0);

  /* "petsc4py/PETSc/DM.pyx":448
 * 
 *         """
 *         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, 448, __pyx_L1_error)
  __pyx_v_f = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":449
 *         """
 *         cdef PetscInt  f   = asInt(field)
 *         cdef PetscBool uC  = useCone             # <<<<<<<<<<<<<<
 *         cdef PetscBool uCl = useClosure
 *         CHKERR(DMSetAdjacency(self.dm, f, uC, uCl))
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_useCone); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(54, 449, __pyx_L1_error)
  __pyx_v_uC = __pyx_t_2;

  /* "petsc4py/PETSc/DM.pyx":450
 *         cdef PetscInt  f   = asInt(field)
 *         cdef PetscBool uC  = useCone
 *         cdef PetscBool uCl = useClosure             # <<<<<<<<<<<<<<
 *         CHKERR(DMSetAdjacency(self.dm, f, uC, uCl))
 * 
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_useClosure); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(54, 450, __pyx_L1_error)
  __pyx_v_uCl = __pyx_t_2;

  /* "petsc4py/PETSc/DM.pyx":451
 *         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, 451, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":429
 *         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":453
 *         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_49getFieldAdjacency(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_48getFieldAdjacency, "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:453");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_49getFieldAdjacency = {"getFieldAdjacency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_49getFieldAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_48getFieldAdjacency};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_49getFieldAdjacency(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 453, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFieldAdjacency", 0) < (0)) __PYX_ERR(54, 453, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFieldAdjacency", 1, 1, 1, i); __PYX_ERR(54, 453, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 453, __pyx_L3_error)
    }
    __pyx_v_field = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getFieldAdjacency", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 453, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_48getFieldAdjacency(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_field);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_48getFieldAdjacency(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", 0);

  /* "petsc4py/PETSc/DM.pyx":475
 * 
 *         """
 *         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, 475, __pyx_L1_error)
  __pyx_v_f = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":476
 *         """
 *         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":477
 *         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":478
 *         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, 478, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":479
 *         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, 479, __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, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 479, __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) != (0)) __PYX_ERR(54, 479, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(54, 479, __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":453
 *         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":483
 *     #
 * 
 *     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_51createSubDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_50createSubDM, "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:483");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_51createSubDM = {"createSubDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_51createSubDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_50createSubDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_51createSubDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fields,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 483, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 483, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createSubDM", 0) < (0)) __PYX_ERR(54, 483, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createSubDM", 1, 1, 1, i); __PYX_ERR(54, 483, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 483, __pyx_L3_error)
    }
    __pyx_v_fields = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createSubDM", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 483, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_50createSubDM(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_fields);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_50createSubDM(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  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":500
 * 
 *         """
 *         cdef IS iset = IS()             # <<<<<<<<<<<<<<
 *         cdef DM subdm = DM()
 *         cdef PetscInt *ifields = NULL
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 500, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":501
 *         """
 *         cdef IS iset = IS()
 *         cdef DM subdm = DM()             # <<<<<<<<<<<<<<
 *         cdef PetscInt *ifields = NULL
 *         cdef PetscInt numFields = 0
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 501, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_subdm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":502
 *         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":503
 *         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":504
 *         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, 504, __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":505
 *         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_4 = __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_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 505, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":506
 *         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, 506, __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)) != (0)) __PYX_ERR(54, 506, __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)) != (0)) __PYX_ERR(54, 506, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":483
 *     #
 * 
 *     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_XDECREF(__pyx_t_2);
  __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":510
 *     #
 * 
 *     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_53setAuxiliaryVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_52setAuxiliaryVec, "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:510");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_53setAuxiliaryVec = {"setAuxiliaryVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_53setAuxiliaryVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_52setAuxiliaryVec};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_53setAuxiliaryVec(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_aux,&__pyx_mstate_global->__pyx_n_u_label,&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_part,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 510, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(54, 510, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 510, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 510, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 510, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setAuxiliaryVec", 0) < (0)) __PYX_ERR(54, 510, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setAuxiliaryVec", 0, 2, 4, i); __PYX_ERR(54, 510, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(54, 510, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 510, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 510, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 510, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __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, 510, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "aux", 0))) __PYX_ERR(54, 510, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_52setAuxiliaryVec(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_52setAuxiliaryVec(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":531
 * 
 *         """
 *         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, 531, __pyx_L1_error)
  __pyx_v_cvalue = __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
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_part); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 532, __pyx_L1_error)
  __pyx_v_cpart = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":533
 *         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":534
 *         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":535
 *         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, 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 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 = __pyx_k__7;
  }

  /* "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(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, 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(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, 538, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":510
 *     #
 * 
 *     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":540
 *         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_55getAuxiliaryVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_54getAuxiliaryVec, "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:540");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_55getAuxiliaryVec = {"getAuxiliaryVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_55getAuxiliaryVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_54getAuxiliaryVec};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_55getAuxiliaryVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_label,&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_part,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 540, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getAuxiliaryVec", 0) < (0)) __PYX_ERR(54, 540, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 540, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __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, 540, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_54getAuxiliaryVec(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_label, __pyx_v_value, __pyx_v_part);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_54getAuxiliaryVec(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __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("getAuxiliaryVec", 0);
  __Pyx_INCREF(__pyx_v_label);

  /* "petsc4py/PETSc/DM.pyx":559
 * 
 *         """
 *         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, 559, __pyx_L1_error)
  __pyx_v_cvalue = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":560
 *         """
 *         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, 560, __pyx_L1_error)
  __pyx_v_cpart = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":561
 *         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":562
 *         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":563
 *         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_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 563, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_aux = ((struct PyPetscVecObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DM.pyx":564
 *         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, 564, __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":565
 *         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_5 = (__pyx_v_cval == NULL);
  if (__pyx_t_5) {
    __pyx_v_cval = __pyx_k__7;
  }

  /* "petsc4py/PETSc/DM.pyx":566
 *         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_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabel(__pyx_v_self->dm, __pyx_v_cval, (&__pyx_v_clbl))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 566, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":567
 *         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_6 = __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_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 567, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":568
 *         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":540
 *         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_XDECREF(__pyx_t_3);
  __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":570
 *         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_57setNumFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_56setNumFields, "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:570");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_57setNumFields = {"setNumFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_57setNumFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_56setNumFields};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_57setNumFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_numFields,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 570, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 570, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNumFields", 0) < (0)) __PYX_ERR(54, 570, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNumFields", 1, 1, 1, i); __PYX_ERR(54, 570, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 570, __pyx_L3_error)
    }
    __pyx_v_numFields = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setNumFields", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 570, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_56setNumFields(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_numFields);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_56setNumFields(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", 0);

  /* "petsc4py/PETSc/DM.pyx":580
 * 
 *         """
 *         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, 580, __pyx_L1_error)
  __pyx_v_cnum = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":581
 *         """
 *         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, 581, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":570
 *         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":583
 *         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_59getNumFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_58getNumFields, "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:583");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_59getNumFields = {"getNumFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_59getNumFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_58getNumFields};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_59getNumFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNumFields", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_58getNumFields(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_58getNumFields(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", 0);

  /* "petsc4py/PETSc/DM.pyx":593
 * 
 *         """
 *         cdef PetscInt cnum = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetNumFields(self.dm, &cnum))
 *         return toInt(cnum)
*/
  __pyx_v_cnum = 0;

  /* "petsc4py/PETSc/DM.pyx":594
 *         """
 *         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, 594, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":595
 *         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, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":583
 *         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":597
 *         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_61setField(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_60setField, "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:597");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_61setField = {"setField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_61setField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_60setField};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_61setField(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_index,&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_label,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 597, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setField", 0) < (0)) __PYX_ERR(54, 597, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setField", 0, 2, 3, i); __PYX_ERR(54, 597, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 597, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 597, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 597, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 597, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, 0, "field", 0))) __PYX_ERR(54, 597, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_60setField(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_60setField(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", 0);

  /* "petsc4py/PETSc/DM.pyx":617
 * 
 *         """
 *         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, 617, __pyx_L1_error)
  __pyx_v_cidx = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":618
 *         """
 *         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":619
 *         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":620
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(54, 620, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(54, 620, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DM.pyx":621
 *         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, 621, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":597
 *         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":623
 *         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_63getField(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_62getField, "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:623");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_63getField = {"getField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_63getField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_62getField};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_63getField(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_index,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 623, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 623, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getField", 0) < (0)) __PYX_ERR(54, 623, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getField", 1, 1, 1, i); __PYX_ERR(54, 623, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 623, __pyx_L3_error)
    }
    __pyx_v_index = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getField", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 623, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_62getField(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_index);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_62getField(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;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getField", 0);

  /* "petsc4py/PETSc/DM.pyx":638
 * 
 *         """
 *         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, 638, __pyx_L1_error)
  __pyx_v_cidx = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":639
 *         """
 *         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":640
 *         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":641
 *         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, 641, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":642
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(54, 642, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(54, 642, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DM.pyx":643
 *         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_5 = NULL;
  __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_Object(__pyx_v_cobj)); if (unlikely(!__pyx_t_6)) __PYX_ERR(54, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(54, 643, __pyx_L1_error)
  __pyx_v_field = ((struct PyPetscObjectObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":644
 *         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":645
 *         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, 645, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":646
 *         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_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF((PyObject *)__pyx_v_field);
  __Pyx_GIVEREF((PyObject *)__pyx_v_field);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_field)) != (0)) __PYX_ERR(54, 646, __pyx_L1_error);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, Py_None) != (0)) __PYX_ERR(54, 646, __pyx_L1_error);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":623
 *         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_XDECREF(__pyx_t_6);
  __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":648
 *         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_65addField(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_64addField, "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:648");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_65addField = {"addField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_65addField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_64addField};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_65addField(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_label,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 648, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 648, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 648, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addField", 0) < (0)) __PYX_ERR(54, 648, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addField", 0, 1, 2, i); __PYX_ERR(54, 648, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 648, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 648, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 648, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, 0, "field", 0))) __PYX_ERR(54, 648, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_64addField(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_field, __pyx_v_label);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_64addField(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", 0);

  /* "petsc4py/PETSc/DM.pyx":666
 * 
 *         """
 *         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":667
 *         """
 *         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":668
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(54, 668, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(54, 668, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DM.pyx":669
 *         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, 669, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":648
 *         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":671
 *         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_67clearFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_66clearFields, "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:671");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_67clearFields = {"clearFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_67clearFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_66clearFields};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_67clearFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("clearFields", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_66clearFields(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_66clearFields(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", 0);

  /* "petsc4py/PETSc/DM.pyx":681
 * 
 *         """
 *         CHKERR(DMClearFields(self.dm))             # <<<<<<<<<<<<<<
 * 
 *     def copyFields(self, DM dm, minDegree = None, maxDegree = None) -> 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, 681, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":671
 *         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":683
 *         CHKERR(DMClearFields(self.dm))
 * 
 *     def copyFields(self, DM dm, minDegree = None, maxDegree = None) -> None:             # <<<<<<<<<<<<<<
 *         """Copy the discretizations of this `DM` into another `DM`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_69copyFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_68copyFields, "DM.copyFields(self, dm: DM, minDegree=None, maxDegree=None) -> 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        minDegree\n            The minimum polynommial degree for the discretization,\n            or `None` for no limit\n        maxDegree\n            The maximum polynommial degree for the discretization,\n            or `None` for no limit\n\n        See Also\n        --------\n        petsc.DMCopyFields\n\n        \nSource code at petsc4py/PETSc/DM.pyx:683");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_69copyFields = {"copyFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_69copyFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_68copyFields};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_69copyFields(PyObject *__pyx_v_self, 
#if 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_minDegree = 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[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("copyFields (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,&__pyx_mstate_global->__pyx_n_u_minDegree,&__pyx_mstate_global->__pyx_n_u_maxDegree,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 683, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 683, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 683, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 683, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "copyFields", 0) < (0)) __PYX_ERR(54, 683, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("copyFields", 0, 1, 3, i); __PYX_ERR(54, 683, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 683, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 683, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 683, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_dm = ((struct PyPetscDMObject *)values[0]);
    __pyx_v_minDegree = values[1];
    __pyx_v_maxDegree = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copyFields", 0, 1, 3, __pyx_nargs); __PYX_ERR(54, 683, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(54, 683, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_68copyFields(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm, __pyx_v_minDegree, __pyx_v_maxDegree);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_68copyFields(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, PyObject *__pyx_v_minDegree, PyObject *__pyx_v_maxDegree) {
  PetscInt __pyx_v_mindeg;
  PetscInt __pyx_v_maxdeg;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __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("copyFields", 0);

  /* "petsc4py/PETSc/DM.pyx":704
 * 
 *         """
 *         cdef PetscInt mindeg = PETSC_DETERMINE             # <<<<<<<<<<<<<<
 *         if minDegree is None:
 *             pass
*/
  __pyx_v_mindeg = PETSC_DETERMINE;

  /* "petsc4py/PETSc/DM.pyx":705
 *         """
 *         cdef PetscInt mindeg = PETSC_DETERMINE
 *         if minDegree is None:             # <<<<<<<<<<<<<<
 *             pass
 *         else:
*/
  __pyx_t_1 = (__pyx_v_minDegree == Py_None);
  if (__pyx_t_1) {
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DM.pyx":708
 *             pass
 *         else:
 *             mindeg = asInt(minDegree)             # <<<<<<<<<<<<<<
 *         cdef PetscInt maxdeg = PETSC_DETERMINE
 *         if maxDegree is None:
*/
  /*else*/ {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_minDegree); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 708, __pyx_L1_error)
    __pyx_v_mindeg = __pyx_t_2;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DM.pyx":709
 *         else:
 *             mindeg = asInt(minDegree)
 *         cdef PetscInt maxdeg = PETSC_DETERMINE             # <<<<<<<<<<<<<<
 *         if maxDegree is None:
 *             pass
*/
  __pyx_v_maxdeg = PETSC_DETERMINE;

  /* "petsc4py/PETSc/DM.pyx":710
 *             mindeg = asInt(minDegree)
 *         cdef PetscInt maxdeg = PETSC_DETERMINE
 *         if maxDegree is None:             # <<<<<<<<<<<<<<
 *             pass
 *         else:
*/
  __pyx_t_1 = (__pyx_v_maxDegree == Py_None);
  if (__pyx_t_1) {
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/DM.pyx":713
 *             pass
 *         else:
 *             maxdeg = asInt(maxDegree)             # <<<<<<<<<<<<<<
 *         CHKERR(DMCopyFields(self.dm, mindeg, maxdeg, dm.dm))
 * 
*/
  /*else*/ {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_maxDegree); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 713, __pyx_L1_error)
    __pyx_v_maxdeg = __pyx_t_2;
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/DM.pyx":714
 *         else:
 *             maxdeg = asInt(maxDegree)
 *         CHKERR(DMCopyFields(self.dm, mindeg, maxdeg, dm.dm))             # <<<<<<<<<<<<<<
 * 
 *     def createDS(self) -> None:
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCopyFields(__pyx_v_self->dm, __pyx_v_mindeg, __pyx_v_maxdeg, __pyx_v_dm->dm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 714, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":683
 *         CHKERR(DMClearFields(self.dm))
 * 
 *     def copyFields(self, DM dm, minDegree = None, maxDegree = None) -> 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":716
 *         CHKERR(DMCopyFields(self.dm, mindeg, maxdeg, dm.dm))
 * 
 *     def createDS(self) -> None:             # <<<<<<<<<<<<<<
 *         """Create discrete systems.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_71createDS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_70createDS, "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:716");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_71createDS = {"createDS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_71createDS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_70createDS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_71createDS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("createDS", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_70createDS(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_70createDS(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", 0);

  /* "petsc4py/PETSc/DM.pyx":726
 * 
 *         """
 *         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, 726, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":716
 *         CHKERR(DMCopyFields(self.dm, mindeg, maxdeg, 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":728
 *         CHKERR(DMCreateDS(self.dm))
 * 
 *     def clearDS(self) -> None:             # <<<<<<<<<<<<<<
 *         """Remove all discrete systems from the `DM`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_73clearDS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_72clearDS, "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:728");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_73clearDS = {"clearDS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_73clearDS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_72clearDS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_73clearDS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("clearDS", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_72clearDS(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_72clearDS(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", 0);

  /* "petsc4py/PETSc/DM.pyx":738
 * 
 *         """
 *         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, 738, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":728
 *         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":740
 *         CHKERR(DMClearDS(self.dm))
 * 
 *     def getDS(self) -> DS:             # <<<<<<<<<<<<<<
 *         """Return default `DS`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_75getDS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_74getDS, "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:740");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_75getDS = {"getDS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_75getDS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_74getDS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_75getDS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDS", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_74getDS(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_74getDS(struct PyPetscDMObject *__pyx_v_self) {
  struct PyPetscDSObject *__pyx_v_ds = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDS", 0);

  /* "petsc4py/PETSc/DM.pyx":750
 * 
 *         """
 *         cdef DS ds = DS()             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetDS(self.dm, &ds.ds))
 *         CHKERR(PetscINCREF(ds.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 750, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_ds = ((struct PyPetscDSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":751
 *         """
 *         cdef DS ds = DS()
 *         CHKERR(DMGetDS(self.dm, &ds.ds))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(ds.obj))
 *         return ds
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetDS(__pyx_v_self->dm, (&__pyx_v_ds->ds))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 751, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":752
 *         cdef DS ds = DS()
 *         CHKERR(DMGetDS(self.dm, &ds.ds))
 *         CHKERR(PetscINCREF(ds.obj))             # <<<<<<<<<<<<<<
 *         return ds
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ds->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 752, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":753
 *         CHKERR(DMGetDS(self.dm, &ds.ds))
 *         CHKERR(PetscINCREF(ds.obj))
 *         return ds             # <<<<<<<<<<<<<<
 * 
 *     def copyDS(self, DM dm, minDegree = None, maxDegree = None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_ds);
  __pyx_r = ((PyObject *)__pyx_v_ds);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":740
 *         CHKERR(DMClearDS(self.dm))
 * 
 *     def getDS(self) -> DS:             # <<<<<<<<<<<<<<
 *         """Return default `DS`.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":755
 *         return ds
 * 
 *     def copyDS(self, DM dm, minDegree = None, maxDegree = None) -> None:             # <<<<<<<<<<<<<<
 *         """Copy the discrete systems for this `DM` into another `DM`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_77copyDS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_76copyDS, "DM.copyDS(self, dm: DM, minDegree=None, maxDegree=None) -> 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        minDegree\n            The minimum polynommial degree for the discretization,\n            or `None` for no limit\n        maxDegree\n            The maximum polynommial degree for the discretization,\n            or `None` for no limit\n\n        See Also\n        --------\n        petsc.DMCopyDS\n\n        \nSource code at petsc4py/PETSc/DM.pyx:755");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_77copyDS = {"copyDS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_77copyDS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_76copyDS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_77copyDS(PyObject *__pyx_v_self, 
#if 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_minDegree = 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[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("copyDS (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,&__pyx_mstate_global->__pyx_n_u_minDegree,&__pyx_mstate_global->__pyx_n_u_maxDegree,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 755, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 755, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 755, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 755, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "copyDS", 0) < (0)) __PYX_ERR(54, 755, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("copyDS", 0, 1, 3, i); __PYX_ERR(54, 755, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 755, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 755, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 755, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_dm = ((struct PyPetscDMObject *)values[0]);
    __pyx_v_minDegree = values[1];
    __pyx_v_maxDegree = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copyDS", 0, 1, 3, __pyx_nargs); __PYX_ERR(54, 755, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(54, 755, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_76copyDS(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm, __pyx_v_minDegree, __pyx_v_maxDegree);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_76copyDS(struct PyPetscDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, PyObject *__pyx_v_minDegree, PyObject *__pyx_v_maxDegree) {
  PetscInt __pyx_v_mindeg;
  PetscInt __pyx_v_maxdeg;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __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("copyDS", 0);

  /* "petsc4py/PETSc/DM.pyx":776
 * 
 *         """
 *         cdef PetscInt mindeg = PETSC_DETERMINE             # <<<<<<<<<<<<<<
 *         if minDegree is None:
 *             pass
*/
  __pyx_v_mindeg = PETSC_DETERMINE;

  /* "petsc4py/PETSc/DM.pyx":777
 *         """
 *         cdef PetscInt mindeg = PETSC_DETERMINE
 *         if minDegree is None:             # <<<<<<<<<<<<<<
 *             pass
 *         else:
*/
  __pyx_t_1 = (__pyx_v_minDegree == Py_None);
  if (__pyx_t_1) {
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DM.pyx":780
 *             pass
 *         else:
 *             mindeg = asInt(minDegree)             # <<<<<<<<<<<<<<
 *         cdef PetscInt maxdeg = PETSC_DETERMINE
 *         if maxDegree is None:
*/
  /*else*/ {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_minDegree); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 780, __pyx_L1_error)
    __pyx_v_mindeg = __pyx_t_2;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DM.pyx":781
 *         else:
 *             mindeg = asInt(minDegree)
 *         cdef PetscInt maxdeg = PETSC_DETERMINE             # <<<<<<<<<<<<<<
 *         if maxDegree is None:
 *             pass
*/
  __pyx_v_maxdeg = PETSC_DETERMINE;

  /* "petsc4py/PETSc/DM.pyx":782
 *             mindeg = asInt(minDegree)
 *         cdef PetscInt maxdeg = PETSC_DETERMINE
 *         if maxDegree is None:             # <<<<<<<<<<<<<<
 *             pass
 *         else:
*/
  __pyx_t_1 = (__pyx_v_maxDegree == Py_None);
  if (__pyx_t_1) {
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/DM.pyx":785
 *             pass
 *         else:
 *             maxdeg = asInt(maxDegree)             # <<<<<<<<<<<<<<
 *         CHKERR(DMCopyDS(self.dm, mindeg, maxdeg, dm.dm))
 * 
*/
  /*else*/ {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_maxDegree); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 785, __pyx_L1_error)
    __pyx_v_maxdeg = __pyx_t_2;
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/DM.pyx":786
 *         else:
 *             maxdeg = asInt(maxDegree)
 *         CHKERR(DMCopyDS(self.dm, mindeg, maxdeg, dm.dm))             # <<<<<<<<<<<<<<
 * 
 *     def copyDisc(self, DM dm) -> None:
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCopyDS(__pyx_v_self->dm, __pyx_v_mindeg, __pyx_v_maxdeg, __pyx_v_dm->dm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 786, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":755
 *         return ds
 * 
 *     def copyDS(self, DM dm, minDegree = None, maxDegree = None) -> 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":788
 *         CHKERR(DMCopyDS(self.dm, mindeg, maxdeg, 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_79copyDisc(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_78copyDisc, "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:788");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_79copyDisc = {"copyDisc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_79copyDisc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_78copyDisc};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_79copyDisc(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 788, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 788, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "copyDisc", 0) < (0)) __PYX_ERR(54, 788, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("copyDisc", 1, 1, 1, i); __PYX_ERR(54, 788, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 788, __pyx_L3_error)
    }
    __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, 788, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(54, 788, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_78copyDisc(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_78copyDisc(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", 0);

  /* "petsc4py/PETSc/DM.pyx":803
 * 
 *         """
 *         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, 803, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":788
 *         CHKERR(DMCopyDS(self.dm, mindeg, maxdeg, 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":807
 *     #
 * 
 *     def getBlockSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the inherent block size associated with a `DM`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_81getBlockSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_80getBlockSize, "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:807");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_81getBlockSize = {"getBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_81getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_80getBlockSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_81getBlockSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBlockSize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_80getBlockSize(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_80getBlockSize(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", 0);

  /* "petsc4py/PETSc/DM.pyx":817
 * 
 *         """
 *         cdef PetscInt bs = 1             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetBlockSize(self.dm, &bs))
 *         return toInt(bs)
*/
  __pyx_v_bs = 1;

  /* "petsc4py/PETSc/DM.pyx":818
 *         """
 *         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, 818, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":819
 *         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, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":807
 *     #
 * 
 *     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":821
 *         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_83setVecType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_82setVecType, "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:821");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_83setVecType = {"setVecType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_83setVecType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_82setVecType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_83setVecType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 821, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 821, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setVecType", 0) < (0)) __PYX_ERR(54, 821, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setVecType", 1, 1, 1, i); __PYX_ERR(54, 821, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 821, __pyx_L3_error)
    }
    __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, 821, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_82setVecType(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_vec_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_82setVecType(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":831
 * 
 *         """
 *         cdef PetscVecType vtype = NULL             # <<<<<<<<<<<<<<
 *         vec_type = str2bytes(vec_type, &vtype)
 *         CHKERR(DMSetVecType(self.dm, vtype))
*/
  __pyx_v_vtype = NULL;

  /* "petsc4py/PETSc/DM.pyx":832
 *         """
 *         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, 832, __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":833
 *         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, 833, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":821
 *         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":835
 *         CHKERR(DMSetVecType(self.dm, vtype))
 * 
 *     def createGlobalVec(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a global vector.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_85createGlobalVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_84createGlobalVec, "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:835");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_85createGlobalVec = {"createGlobalVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_85createGlobalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_84createGlobalVec};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_85createGlobalVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("createGlobalVec", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_84createGlobalVec(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_84createGlobalVec(struct PyPetscDMObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_vg = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createGlobalVec", 0);

  /* "petsc4py/PETSc/DM.pyx":845
 * 
 *         """
 *         cdef Vec vg = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(DMCreateGlobalVector(self.dm, &vg.vec))
 *         return vg
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 845, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vg = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":846
 *         """
 *         cdef Vec vg = Vec()
 *         CHKERR(DMCreateGlobalVector(self.dm, &vg.vec))             # <<<<<<<<<<<<<<
 *         return vg
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateGlobalVector(__pyx_v_self->dm, (&__pyx_v_vg->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 846, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":847
 *         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":835
 *         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_XDECREF(__pyx_t_2);
  __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":849
 *         return vg
 * 
 *     def createLocalVec(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a local vector.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_87createLocalVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_86createLocalVec, "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:849");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_87createLocalVec = {"createLocalVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_87createLocalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_86createLocalVec};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_87createLocalVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("createLocalVec", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_86createLocalVec(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_86createLocalVec(struct PyPetscDMObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_vl = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createLocalVec", 0);

  /* "petsc4py/PETSc/DM.pyx":859
 * 
 *         """
 *         cdef Vec vl = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(DMCreateLocalVector(self.dm, &vl.vec))
 *         return vl
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 859, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vl = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":860
 *         """
 *         cdef Vec vl = Vec()
 *         CHKERR(DMCreateLocalVector(self.dm, &vl.vec))             # <<<<<<<<<<<<<<
 *         return vl
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateLocalVector(__pyx_v_self->dm, (&__pyx_v_vl->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 860, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":861
 *         cdef Vec vl = Vec()
 *         CHKERR(DMCreateLocalVector(self.dm, &vl.vec))
 *         return vl             # <<<<<<<<<<<<<<
 * 
 *     def getGlobalVec(self, name : str | None = None) -> Vec:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_vl);
  __pyx_r = ((PyObject *)__pyx_v_vl);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":849
 *         return vg
 * 
 *     def createLocalVec(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a local vector.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":863
 *         return vl
 * 
 *     def getGlobalVec(self, name : str | None = None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a global vector.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_89getGlobalVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_88getGlobalVec, "DM.getGlobalVec(self, name: str | None = None) -> Vec\nReturn a global vector.\n\n        Collective.\n\n        Parameters\n        ----------\n        name\n            The optional name to retrieve a persistent vector.\n\n        Notes\n        -----\n        When done with the vector, it must be restored using `restoreGlobalVec`.\n\n        See Also\n        --------\n        restoreGlobalVec, petsc.DMGetGlobalVector, petsc.DMGetNamedGlobalVector\n\n        \nSource code at petsc4py/PETSc/DM.pyx:863");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_89getGlobalVec = {"getGlobalVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_89getGlobalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_88getGlobalVec};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_89getGlobalVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("getGlobalVec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 863, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 863, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getGlobalVec", 0) < (0)) __PYX_ERR(54, 863, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 863, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getGlobalVec", 0, 0, 1, __pyx_nargs); __PYX_ERR(54, 863, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DM.getGlobalVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_88getGlobalVec(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_88getGlobalVec(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name) {
  struct PyPetscVecObject *__pyx_v_vg = 0;
  char const *__pyx_v_cname;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __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("getGlobalVec", 0);

  /* "petsc4py/PETSc/DM.pyx":882
 * 
 *         """
 *         cdef Vec vg = Vec()             # <<<<<<<<<<<<<<
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 882, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vg = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":883
 *         """
 *         cdef Vec vg = Vec()
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         str2bytes(name, &cname)
 *         if cname != NULL:
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/DM.pyx":884
 *         cdef Vec vg = Vec()
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)             # <<<<<<<<<<<<<<
 *         if cname != NULL:
 *             CHKERR(DMGetNamedGlobalVector(self.dm, cname, &vg.vec))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":885
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)
 *         if cname != NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(DMGetNamedGlobalVector(self.dm, cname, &vg.vec))
 *         else:
*/
  __pyx_t_4 = (__pyx_v_cname != NULL);
  if (__pyx_t_4) {

    /* "petsc4py/PETSc/DM.pyx":886
 *         str2bytes(name, &cname)
 *         if cname != NULL:
 *             CHKERR(DMGetNamedGlobalVector(self.dm, cname, &vg.vec))             # <<<<<<<<<<<<<<
 *         else:
 *             CHKERR(DMGetGlobalVector(self.dm, &vg.vec))
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetNamedGlobalVector(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_vg->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 886, __pyx_L1_error)

    /* "petsc4py/PETSc/DM.pyx":885
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)
 *         if cname != NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(DMGetNamedGlobalVector(self.dm, cname, &vg.vec))
 *         else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DM.pyx":888
 *             CHKERR(DMGetNamedGlobalVector(self.dm, cname, &vg.vec))
 *         else:
 *             CHKERR(DMGetGlobalVector(self.dm, &vg.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(vg.obj))
 *         return vg
*/
  /*else*/ {
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetGlobalVector(__pyx_v_self->dm, (&__pyx_v_vg->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 888, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DM.pyx":889
 *         else:
 *             CHKERR(DMGetGlobalVector(self.dm, &vg.vec))
 *         CHKERR(PetscINCREF(vg.obj))             # <<<<<<<<<<<<<<
 *         return vg
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vg->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 889, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":890
 *             CHKERR(DMGetGlobalVector(self.dm, &vg.vec))
 *         CHKERR(PetscINCREF(vg.obj))
 *         return vg             # <<<<<<<<<<<<<<
 * 
 *     def restoreGlobalVec(self, Vec vg, name : str | None = None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_vg);
  __pyx_r = ((PyObject *)__pyx_v_vg);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":863
 *         return vl
 * 
 *     def getGlobalVec(self, name : str | None = None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a global vector.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":892
 *         return vg
 * 
 *     def restoreGlobalVec(self, Vec vg, name : str | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Restore a global vector obtained with `getGlobalVec`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_91restoreGlobalVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_90restoreGlobalVec, "DM.restoreGlobalVec(self, vg: Vec, name: str | None = None) -> None\nRestore a global vector obtained with `getGlobalVec`.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        vg\n            The global vector.\n        name\n            The name used to retrieve the persistent vector, if any.\n\n        See Also\n        --------\n        getGlobalVec, petsc.DMRestoreGlobalVector, petsc.DMRestoreNamedGlobalVector\n\n        \nSource code at petsc4py/PETSc/DM.pyx:892");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_91restoreGlobalVec = {"restoreGlobalVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_91restoreGlobalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_90restoreGlobalVec};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_91restoreGlobalVec(PyObject *__pyx_v_self, 
#if 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;
  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("restoreGlobalVec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vg,&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 892, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 892, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 892, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "restoreGlobalVec", 0) < (0)) __PYX_ERR(54, 892, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("restoreGlobalVec", 0, 1, 2, i); __PYX_ERR(54, 892, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 892, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 892, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_vg = ((struct PyPetscVecObject *)values[0]);
    __pyx_v_name = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("restoreGlobalVec", 0, 1, 2, __pyx_nargs); __PYX_ERR(54, 892, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vg", 0))) __PYX_ERR(54, 892, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_90restoreGlobalVec(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_vg, __pyx_v_name);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_90restoreGlobalVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vg, 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_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("restoreGlobalVec", 0);

  /* "petsc4py/PETSc/DM.pyx":909
 * 
 *         """
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         str2bytes(name, &cname)
 *         CHKERR(PetscDECREF(vg.obj))
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/DM.pyx":910
 *         """
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDECREF(vg.obj))
 *         if cname != NULL:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":911
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)
 *         CHKERR(PetscDECREF(vg.obj))             # <<<<<<<<<<<<<<
 *         if cname != NULL:
 *             CHKERR(DMRestoreNamedGlobalVector(self.dm, cname, &vg.vec))
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscDECREF(__pyx_v_vg->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 911, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":912
 *         str2bytes(name, &cname)
 *         CHKERR(PetscDECREF(vg.obj))
 *         if cname != NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(DMRestoreNamedGlobalVector(self.dm, cname, &vg.vec))
 *         else:
*/
  __pyx_t_3 = (__pyx_v_cname != NULL);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/DM.pyx":913
 *         CHKERR(PetscDECREF(vg.obj))
 *         if cname != NULL:
 *             CHKERR(DMRestoreNamedGlobalVector(self.dm, cname, &vg.vec))             # <<<<<<<<<<<<<<
 *         else:
 *             CHKERR(DMRestoreGlobalVector(self.dm, &vg.vec))
*/
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMRestoreNamedGlobalVector(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_vg->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 913, __pyx_L1_error)

    /* "petsc4py/PETSc/DM.pyx":912
 *         str2bytes(name, &cname)
 *         CHKERR(PetscDECREF(vg.obj))
 *         if cname != NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(DMRestoreNamedGlobalVector(self.dm, cname, &vg.vec))
 *         else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DM.pyx":915
 *             CHKERR(DMRestoreNamedGlobalVector(self.dm, cname, &vg.vec))
 *         else:
 *             CHKERR(DMRestoreGlobalVector(self.dm, &vg.vec))             # <<<<<<<<<<<<<<
 * 
 *     def getLocalVec(self, name : str | None = None) -> Vec:
*/
  /*else*/ {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMRestoreGlobalVector(__pyx_v_self->dm, (&__pyx_v_vg->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 915, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DM.pyx":892
 *         return vg
 * 
 *     def restoreGlobalVec(self, Vec vg, name : str | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Restore a global vector obtained with `getGlobalVec`.
 * 
*/

  /* 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.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":917
 *             CHKERR(DMRestoreGlobalVector(self.dm, &vg.vec))
 * 
 *     def getLocalVec(self, name : str | None = None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a local vector.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_93getLocalVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_92getLocalVec, "DM.getLocalVec(self, name: str | None = None) -> Vec\nReturn a local vector.\n\n        Not collective.\n\n        Parameters\n        ----------\n        name\n            The optional name to retrieve a persistent vector.\n\n        Notes\n        -----\n        When done with the vector, it must be restored using `restoreLocalVec`.\n\n        See Also\n        --------\n        restoreLocalVec, petsc.DMGetLocalVector, petsc.DMGetNamedLocalVector\n\n        \nSource code at petsc4py/PETSc/DM.pyx:917");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_93getLocalVec = {"getLocalVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_93getLocalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_92getLocalVec};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_93getLocalVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("getLocalVec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 917, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 917, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getLocalVec", 0) < (0)) __PYX_ERR(54, 917, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 917, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getLocalVec", 0, 0, 1, __pyx_nargs); __PYX_ERR(54, 917, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DM.getLocalVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_92getLocalVec(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_92getLocalVec(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_name) {
  struct PyPetscVecObject *__pyx_v_vl = 0;
  char const *__pyx_v_cname;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __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("getLocalVec", 0);

  /* "petsc4py/PETSc/DM.pyx":936
 * 
 *         """
 *         cdef Vec vl = Vec()             # <<<<<<<<<<<<<<
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 936, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vl = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":937
 *         """
 *         cdef Vec vl = Vec()
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         str2bytes(name, &cname)
 *         if cname != NULL:
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/DM.pyx":938
 *         cdef Vec vl = Vec()
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)             # <<<<<<<<<<<<<<
 *         if cname != NULL:
 *             CHKERR(DMGetNamedLocalVector(self.dm, cname, &vl.vec))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":939
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)
 *         if cname != NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(DMGetNamedLocalVector(self.dm, cname, &vl.vec))
 *         else:
*/
  __pyx_t_4 = (__pyx_v_cname != NULL);
  if (__pyx_t_4) {

    /* "petsc4py/PETSc/DM.pyx":940
 *         str2bytes(name, &cname)
 *         if cname != NULL:
 *             CHKERR(DMGetNamedLocalVector(self.dm, cname, &vl.vec))             # <<<<<<<<<<<<<<
 *         else:
 *             CHKERR(DMGetLocalVector(self.dm, &vl.vec))
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetNamedLocalVector(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_vl->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 940, __pyx_L1_error)

    /* "petsc4py/PETSc/DM.pyx":939
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)
 *         if cname != NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(DMGetNamedLocalVector(self.dm, cname, &vl.vec))
 *         else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DM.pyx":942
 *             CHKERR(DMGetNamedLocalVector(self.dm, cname, &vl.vec))
 *         else:
 *             CHKERR(DMGetLocalVector(self.dm, &vl.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(vl.obj))
 *         return vl
*/
  /*else*/ {
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLocalVector(__pyx_v_self->dm, (&__pyx_v_vl->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 942, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DM.pyx":943
 *         else:
 *             CHKERR(DMGetLocalVector(self.dm, &vl.vec))
 *         CHKERR(PetscINCREF(vl.obj))             # <<<<<<<<<<<<<<
 *         return vl
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_vl->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 943, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":944
 *             CHKERR(DMGetLocalVector(self.dm, &vl.vec))
 *         CHKERR(PetscINCREF(vl.obj))
 *         return vl             # <<<<<<<<<<<<<<
 * 
 *     def restoreLocalVec(self, Vec vl, name : str | None = None) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_vl);
  __pyx_r = ((PyObject *)__pyx_v_vl);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":917
 *             CHKERR(DMRestoreGlobalVector(self.dm, &vg.vec))
 * 
 *     def getLocalVec(self, name : str | None = None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a local vector.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":946
 *         return vl
 * 
 *     def restoreLocalVec(self, Vec vl, name : str | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Restore a local vector obtained with `getLocalVec`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_95restoreLocalVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_94restoreLocalVec, "DM.restoreLocalVec(self, vl: Vec, name: str | None = None) -> None\nRestore a local vector obtained with `getLocalVec`.\n\n        Not collective.\n\n        Parameters\n        ----------\n        vl\n            The local vector.\n        name\n            The name used to retrieve the persistent vector, if any.\n\n        See Also\n        --------\n        getLocalVec, petsc.DMRestoreLocalVector, petsc.DMRestoreNamedLocalVector\n\n        \nSource code at petsc4py/PETSc/DM.pyx:946");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_95restoreLocalVec = {"restoreLocalVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_95restoreLocalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_94restoreLocalVec};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_95restoreLocalVec(PyObject *__pyx_v_self, 
#if 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;
  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("restoreLocalVec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vl,&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 946, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 946, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 946, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "restoreLocalVec", 0) < (0)) __PYX_ERR(54, 946, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("restoreLocalVec", 0, 1, 2, i); __PYX_ERR(54, 946, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 946, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 946, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_vl = ((struct PyPetscVecObject *)values[0]);
    __pyx_v_name = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("restoreLocalVec", 0, 1, 2, __pyx_nargs); __PYX_ERR(54, 946, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vl", 0))) __PYX_ERR(54, 946, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_94restoreLocalVec(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_vl, __pyx_v_name);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_94restoreLocalVec(struct PyPetscDMObject *__pyx_v_self, struct PyPetscVecObject *__pyx_v_vl, 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_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("restoreLocalVec", 0);

  /* "petsc4py/PETSc/DM.pyx":963
 * 
 *         """
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         str2bytes(name, &cname)
 *         CHKERR(PetscDECREF(vl.obj))
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/DM.pyx":964
 *         """
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDECREF(vl.obj))
 *         if cname != NULL:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":965
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)
 *         CHKERR(PetscDECREF(vl.obj))             # <<<<<<<<<<<<<<
 *         if cname != NULL:
 *             CHKERR(DMRestoreNamedLocalVector(self.dm, cname, &vl.vec))
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscDECREF(__pyx_v_vl->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 965, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":966
 *         str2bytes(name, &cname)
 *         CHKERR(PetscDECREF(vl.obj))
 *         if cname != NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(DMRestoreNamedLocalVector(self.dm, cname, &vl.vec))
 *         else:
*/
  __pyx_t_3 = (__pyx_v_cname != NULL);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/DM.pyx":967
 *         CHKERR(PetscDECREF(vl.obj))
 *         if cname != NULL:
 *             CHKERR(DMRestoreNamedLocalVector(self.dm, cname, &vl.vec))             # <<<<<<<<<<<<<<
 *         else:
 *             CHKERR(DMRestoreLocalVector(self.dm, &vl.vec))
*/
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMRestoreNamedLocalVector(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_vl->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 967, __pyx_L1_error)

    /* "petsc4py/PETSc/DM.pyx":966
 *         str2bytes(name, &cname)
 *         CHKERR(PetscDECREF(vl.obj))
 *         if cname != NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(DMRestoreNamedLocalVector(self.dm, cname, &vl.vec))
 *         else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DM.pyx":969
 *             CHKERR(DMRestoreNamedLocalVector(self.dm, cname, &vl.vec))
 *         else:
 *             CHKERR(DMRestoreLocalVector(self.dm, &vl.vec))             # <<<<<<<<<<<<<<
 * 
 *     def globalToLocal(self, Vec vg, Vec vl, addv: InsertModeSpec | None = None) -> None:
*/
  /*else*/ {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMRestoreLocalVector(__pyx_v_self->dm, (&__pyx_v_vl->vec))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 969, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DM.pyx":946
 *         return vl
 * 
 *     def restoreLocalVec(self, Vec vl, name : str | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Restore a local vector obtained with `getLocalVec`.
 * 
*/

  /* 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.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":971
 *             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_97globalToLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_96globalToLocal, "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:971");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_97globalToLocal = {"globalToLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_97globalToLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_96globalToLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_97globalToLocal(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vg,&__pyx_mstate_global->__pyx_n_u_vl,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 971, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "globalToLocal", 0) < (0)) __PYX_ERR(54, 971, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("globalToLocal", 0, 2, 3, i); __PYX_ERR(54, 971, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 971, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 971, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 971, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vg", 0))) __PYX_ERR(54, 971, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vl), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vl", 0))) __PYX_ERR(54, 971, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_96globalToLocal(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_96globalToLocal(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", 0);

  /* "petsc4py/PETSc/DM.pyx":990
 * 
 *         """
 *         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, 990, __pyx_L1_error)
  __pyx_v_im = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":991
 *         """
 *         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, 991, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":992
 *         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, 992, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":971
 *             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":994
 *         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_99localToGlobal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_98localToGlobal, "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:994");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_99localToGlobal = {"localToGlobal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_99localToGlobal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_98localToGlobal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_99localToGlobal(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vl,&__pyx_mstate_global->__pyx_n_u_vg,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 994, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 994, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 994, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 994, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "localToGlobal", 0) < (0)) __PYX_ERR(54, 994, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("localToGlobal", 0, 2, 3, i); __PYX_ERR(54, 994, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 994, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 994, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 994, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 994, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vl", 0))) __PYX_ERR(54, 994, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vg", 0))) __PYX_ERR(54, 994, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_98localToGlobal(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_98localToGlobal(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", 0);

  /* "petsc4py/PETSc/DM.pyx":1013
 * 
 *         """
 *         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, 1013, __pyx_L1_error)
  __pyx_v_im = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":1014
 *         """
 *         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, 1014, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1015
 *         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, 1015, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":994
 *         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":1017
 *         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_101localToLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_100localToLocal, "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:1017");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_101localToLocal = {"localToLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_101localToLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_100localToLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_101localToLocal(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vl,&__pyx_mstate_global->__pyx_n_u_vlg,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1017, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 1017, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 1017, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1017, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "localToLocal", 0) < (0)) __PYX_ERR(54, 1017, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("localToLocal", 0, 2, 3, i); __PYX_ERR(54, 1017, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 1017, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 1017, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1017, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1017, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vl", 0))) __PYX_ERR(54, 1017, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vlg), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vlg", 0))) __PYX_ERR(54, 1017, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_100localToLocal(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_100localToLocal(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", 0);

  /* "petsc4py/PETSc/DM.pyx":1036
 * 
 *         """
 *         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, 1036, __pyx_L1_error)
  __pyx_v_im = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":1037
 *         """
 *         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, 1037, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1038
 *         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, 1038, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1017
 *         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":1040
 *         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_103getLGMap(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_102getLGMap, "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:1040");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_103getLGMap = {"getLGMap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_103getLGMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_102getLGMap};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_103getLGMap(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLGMap", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_102getLGMap(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_102getLGMap(struct PyPetscDMObject *__pyx_v_self) {
  struct PyPetscLGMapObject *__pyx_v_lgm = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLGMap", 0);

  /* "petsc4py/PETSc/DM.pyx":1050
 * 
 *         """
 *         cdef LGMap lgm = LGMap()             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetLocalToGlobalMapping(self.dm, &lgm.lgm))
 *         CHKERR(PetscINCREF(lgm.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1050, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_lgm = ((struct PyPetscLGMapObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1051
 *         """
 *         cdef LGMap lgm = LGMap()
 *         CHKERR(DMGetLocalToGlobalMapping(self.dm, &lgm.lgm))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(lgm.obj))
 *         return lgm
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLocalToGlobalMapping(__pyx_v_self->dm, (&__pyx_v_lgm->lgm))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1051, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1052
 *         cdef LGMap lgm = LGMap()
 *         CHKERR(DMGetLocalToGlobalMapping(self.dm, &lgm.lgm))
 *         CHKERR(PetscINCREF(lgm.obj))             # <<<<<<<<<<<<<<
 *         return lgm
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_lgm->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1052, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1053
 *         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":1040
 *         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_XDECREF(__pyx_t_2);
  __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":1057
 *     #
 * 
 *     def getCoarseDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the coarse `DM`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_105getCoarseDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_104getCoarseDM, "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:1057");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_105getCoarseDM = {"getCoarseDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_105getCoarseDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_104getCoarseDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_105getCoarseDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCoarseDM", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_104getCoarseDM(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_104getCoarseDM(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;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCoarseDM", 0);

  /* "petsc4py/PETSc/DM.pyx":1067
 * 
 *         """
 *         cdef DM cdm = type(self)()             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetCoarseDM(self.dm, &cdm.dm))
 *         CHKERR(PetscINCREF(cdm.obj))
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1067, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 1067, __pyx_L1_error)
  __pyx_v_cdm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1068
 *         """
 *         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, 1068, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1069
 *         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, 1069, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1070
 *         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":1057
 *     #
 * 
 *     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":1072
 *         return cdm
 * 
 *     def setCoarseDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Set the coarse `DM`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_107setCoarseDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_106setCoarseDM, "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:1072");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_107setCoarseDM = {"setCoarseDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_107setCoarseDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_106setCoarseDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_107setCoarseDM(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1072, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1072, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCoarseDM", 0) < (0)) __PYX_ERR(54, 1072, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCoarseDM", 1, 1, 1, i); __PYX_ERR(54, 1072, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1072, __pyx_L3_error)
    }
    __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, 1072, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(54, 1072, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_106setCoarseDM(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_106setCoarseDM(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", 0);

  /* "petsc4py/PETSc/DM.pyx":1082
 * 
 *         """
 *         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, 1082, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1083
 *         """
 *         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":1072
 *         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":1085
 *         return
 * 
 *     def getCoordinateDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the coordinate `DM`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_109getCoordinateDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_108getCoordinateDM, "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:1085");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_109getCoordinateDM = {"getCoordinateDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_109getCoordinateDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_108getCoordinateDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_109getCoordinateDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCoordinateDM", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_108getCoordinateDM(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_108getCoordinateDM(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;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCoordinateDM", 0);

  /* "petsc4py/PETSc/DM.pyx":1095
 * 
 *         """
 *         cdef DM cdm = type(self)()             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetCoordinateDM(self.dm, &cdm.dm))
 *         CHKERR(PetscINCREF(cdm.obj))
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1095, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 1095, __pyx_L1_error)
  __pyx_v_cdm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1096
 *         """
 *         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, 1096, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1097
 *         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, 1097, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1098
 *         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":1085
 *         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":1100
 *         return cdm
 * 
 *     def getCoordinateSection(self) -> Section:             # <<<<<<<<<<<<<<
 *         """Return coordinate values layout over the mesh.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_111getCoordinateSection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_110getCoordinateSection, "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:1100");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_111getCoordinateSection = {"getCoordinateSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_111getCoordinateSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_110getCoordinateSection};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_111getCoordinateSection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCoordinateSection", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_110getCoordinateSection(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_110getCoordinateSection(struct PyPetscDMObject *__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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCoordinateSection", 0);

  /* "petsc4py/PETSc/DM.pyx":1110
 * 
 *         """
 *         cdef Section sec = Section()             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetCoordinateSection(self.dm, &sec.sec))
 *         CHKERR(PetscINCREF(sec.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1110, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1111
 *         """
 *         cdef Section sec = Section()
 *         CHKERR(DMGetCoordinateSection(self.dm, &sec.sec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(sec.obj))
 *         return sec
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinateSection(__pyx_v_self->dm, (&__pyx_v_sec->sec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1111, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1112
 *         cdef Section sec = Section()
 *         CHKERR(DMGetCoordinateSection(self.dm, &sec.sec))
 *         CHKERR(PetscINCREF(sec.obj))             # <<<<<<<<<<<<<<
 *         return sec
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sec->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1112, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1113
 *         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":1100
 *         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_XDECREF(__pyx_t_2);
  __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":1115
 *         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_113setCoordinates(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_112setCoordinates, "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:1115");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_113setCoordinates = {"setCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_113setCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_112setCoordinates};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_113setCoordinates(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_c,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1115, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1115, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCoordinates", 0) < (0)) __PYX_ERR(54, 1115, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCoordinates", 1, 1, 1, i); __PYX_ERR(54, 1115, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1115, __pyx_L3_error)
    }
    __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, 1115, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "c", 0))) __PYX_ERR(54, 1115, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_112setCoordinates(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_c);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_112setCoordinates(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", 0);

  /* "petsc4py/PETSc/DM.pyx":1130
 * 
 *         """
 *         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, 1130, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1115
 *         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":1132
 *         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_115getCoordinates(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_114getCoordinates, "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:1132");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_115getCoordinates = {"getCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_115getCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_114getCoordinates};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_115getCoordinates(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCoordinates", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_114getCoordinates(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_114getCoordinates(struct PyPetscDMObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_c = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCoordinates", 0);

  /* "petsc4py/PETSc/DM.pyx":1142
 * 
 *         """
 *         cdef Vec c = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetCoordinates(self.dm, &c.vec))
 *         CHKERR(PetscINCREF(c.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1142, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1143
 *         """
 *         cdef Vec c = Vec()
 *         CHKERR(DMGetCoordinates(self.dm, &c.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(c.obj))
 *         return c
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinates(__pyx_v_self->dm, (&__pyx_v_c->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1143, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1144
 *         cdef Vec c = Vec()
 *         CHKERR(DMGetCoordinates(self.dm, &c.vec))
 *         CHKERR(PetscINCREF(c.obj))             # <<<<<<<<<<<<<<
 *         return c
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_c->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1144, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1145
 *         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":1132
 *         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_XDECREF(__pyx_t_2);
  __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":1147
 *         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_117setCoordinatesLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_116setCoordinatesLocal, "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:1147");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_117setCoordinatesLocal = {"setCoordinatesLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_117setCoordinatesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_116setCoordinatesLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_117setCoordinatesLocal(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_c,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1147, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1147, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCoordinatesLocal", 0) < (0)) __PYX_ERR(54, 1147, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCoordinatesLocal", 1, 1, 1, i); __PYX_ERR(54, 1147, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1147, __pyx_L3_error)
    }
    __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, 1147, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "c", 0))) __PYX_ERR(54, 1147, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_116setCoordinatesLocal(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_c);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_116setCoordinatesLocal(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", 0);

  /* "petsc4py/PETSc/DM.pyx":1162
 * 
 *         """
 *         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, 1162, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1147
 *         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":1164
 *         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_119getCoordinatesLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_118getCoordinatesLocal, "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:1164");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_119getCoordinatesLocal = {"getCoordinatesLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_119getCoordinatesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_118getCoordinatesLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_119getCoordinatesLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCoordinatesLocal", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_118getCoordinatesLocal(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_118getCoordinatesLocal(struct PyPetscDMObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_c = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCoordinatesLocal", 0);

  /* "petsc4py/PETSc/DM.pyx":1174
 * 
 *         """
 *         cdef Vec c = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetCoordinatesLocal(self.dm, &c.vec))
 *         CHKERR(PetscINCREF(c.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1174, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1175
 *         """
 *         cdef Vec c = Vec()
 *         CHKERR(DMGetCoordinatesLocal(self.dm, &c.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(c.obj))
 *         return c
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinatesLocal(__pyx_v_self->dm, (&__pyx_v_c->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1175, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1176
 *         cdef Vec c = Vec()
 *         CHKERR(DMGetCoordinatesLocal(self.dm, &c.vec))
 *         CHKERR(PetscINCREF(c.obj))             # <<<<<<<<<<<<<<
 *         return c
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_c->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1176, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1177
 *         CHKERR(DMGetCoordinatesLocal(self.dm, &c.vec))
 *         CHKERR(PetscINCREF(c.obj))
 *         return c             # <<<<<<<<<<<<<<
 * 
 *     def setCellCoordinateDM(self, DM dm) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_c);
  __pyx_r = ((PyObject *)__pyx_v_c);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":1164
 *         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_XDECREF(__pyx_t_2);
  __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":1179
 *         return c
 * 
 *     def setCellCoordinateDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Set the cell coordinate `DM`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_121setCellCoordinateDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_120setCellCoordinateDM, "DM.setCellCoordinateDM(self, dm: DM) -> None\nSet the cell coordinate `DM`.\n\n        Collective.\n\n        Parameters\n        ----------\n        dm\n            The cell coordinate `DM`.\n\n        See Also\n        --------\n        petsc.DMSetCellCoordinateDM\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1179");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_121setCellCoordinateDM = {"setCellCoordinateDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_121setCellCoordinateDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_120setCellCoordinateDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_121setCellCoordinateDM(PyObject *__pyx_v_self, 
#if 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("setCellCoordinateDM (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1179, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1179, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCellCoordinateDM", 0) < (0)) __PYX_ERR(54, 1179, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCellCoordinateDM", 1, 1, 1, i); __PYX_ERR(54, 1179, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1179, __pyx_L3_error)
    }
    __pyx_v_dm = ((struct PyPetscDMObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setCellCoordinateDM", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1179, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DM.setCellCoordinateDM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(54, 1179, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_120setCellCoordinateDM(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_120setCellCoordinateDM(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("setCellCoordinateDM", 0);

  /* "petsc4py/PETSc/DM.pyx":1194
 * 
 *         """
 *         CHKERR(DMSetCellCoordinateDM(self.dm, dm.dm))             # <<<<<<<<<<<<<<
 * 
 *     def getCellCoordinateDM(self) -> DM:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetCellCoordinateDM(__pyx_v_self->dm, __pyx_v_dm->dm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1194, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1179
 *         return c
 * 
 *     def setCellCoordinateDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Set the cell coordinate `DM`.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.DM.setCellCoordinateDM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DM.pyx":1196
 *         CHKERR(DMSetCellCoordinateDM(self.dm, dm.dm))
 * 
 *     def getCellCoordinateDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the cell coordinate `DM`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_123getCellCoordinateDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_122getCellCoordinateDM, "DM.getCellCoordinateDM(self) -> DM\nReturn the cell coordinate `DM`.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMGetCellCoordinateDM\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1196");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_123getCellCoordinateDM = {"getCellCoordinateDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_123getCellCoordinateDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_122getCellCoordinateDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_123getCellCoordinateDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getCellCoordinateDM (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCellCoordinateDM", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCellCoordinateDM", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_122getCellCoordinateDM(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_122getCellCoordinateDM(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;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCellCoordinateDM", 0);

  /* "petsc4py/PETSc/DM.pyx":1206
 * 
 *         """
 *         cdef DM cdm = type(self)()             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetCellCoordinateDM(self.dm, &cdm.dm))
 *         CHKERR(PetscINCREF(cdm.obj))
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 1206, __pyx_L1_error)
  __pyx_v_cdm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1207
 *         """
 *         cdef DM cdm = type(self)()
 *         CHKERR(DMGetCellCoordinateDM(self.dm, &cdm.dm))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(cdm.obj))
 *         return cdm
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCellCoordinateDM(__pyx_v_self->dm, (&__pyx_v_cdm->dm))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1207, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1208
 *         cdef DM cdm = type(self)()
 *         CHKERR(DMGetCellCoordinateDM(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, 1208, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1209
 *         CHKERR(DMGetCellCoordinateDM(self.dm, &cdm.dm))
 *         CHKERR(PetscINCREF(cdm.obj))
 *         return cdm             # <<<<<<<<<<<<<<
 * 
 *     def setCellCoordinateSection(self, dim: int, Section sec) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_cdm);
  __pyx_r = ((PyObject *)__pyx_v_cdm);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":1196
 *         CHKERR(DMSetCellCoordinateDM(self.dm, dm.dm))
 * 
 *     def getCellCoordinateDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the cell 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.getCellCoordinateDM", __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":1211
 *         return cdm
 * 
 *     def setCellCoordinateSection(self, dim: int, Section sec) -> None:             # <<<<<<<<<<<<<<
 *         """Set the cell coordinate layout over the `DM`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_125setCellCoordinateSection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_124setCellCoordinateSection, "DM.setCellCoordinateSection(self, dim: int, sec: Section) -> None\nSet the cell coordinate layout over the `DM`.\n\n        Collective.\n\n        Parameters\n        ----------\n        dim\n            The embedding dimension, or `DETERMINE`.\n        sec\n            The cell coordinate `Section`.\n\n        See Also\n        --------\n        petsc.DMSetCellCoordinateSection\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1211");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_125setCellCoordinateSection = {"setCellCoordinateSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_125setCellCoordinateSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_124setCellCoordinateSection};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_125setCellCoordinateSection(PyObject *__pyx_v_self, 
#if CYTHON_METH_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 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[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setCellCoordinateSection (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dim,&__pyx_mstate_global->__pyx_n_u_sec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1211, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 1211, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1211, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCellCoordinateSection", 0) < (0)) __PYX_ERR(54, 1211, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCellCoordinateSection", 1, 2, 2, i); __PYX_ERR(54, 1211, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1211, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 1211, __pyx_L3_error)
    }
    __pyx_v_dim = values[0];
    __pyx_v_sec = ((struct PyPetscSectionObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setCellCoordinateSection", 1, 2, 2, __pyx_nargs); __PYX_ERR(54, 1211, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DM.setCellCoordinateSection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(54, 1211, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_124setCellCoordinateSection(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dim, __pyx_v_sec);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_124setCellCoordinateSection(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_dim, struct PyPetscSectionObject *__pyx_v_sec) {
  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("setCellCoordinateSection", 0);

  /* "petsc4py/PETSc/DM.pyx":1228
 * 
 *         """
 *         cdef PetscInt cdim = asInt(dim)             # <<<<<<<<<<<<<<
 *         CHKERR(DMSetCellCoordinateSection(self.dm, cdim, sec.sec))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_dim); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 1228, __pyx_L1_error)
  __pyx_v_cdim = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":1229
 *         """
 *         cdef PetscInt cdim = asInt(dim)
 *         CHKERR(DMSetCellCoordinateSection(self.dm, cdim, sec.sec))             # <<<<<<<<<<<<<<
 * 
 *     def getCellCoordinateSection(self) -> Section:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetCellCoordinateSection(__pyx_v_self->dm, __pyx_v_cdim, __pyx_v_sec->sec)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1229, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1211
 *         return cdm
 * 
 *     def setCellCoordinateSection(self, dim: int, Section sec) -> None:             # <<<<<<<<<<<<<<
 *         """Set the cell coordinate layout over the `DM`.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.DM.setCellCoordinateSection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DM.pyx":1231
 *         CHKERR(DMSetCellCoordinateSection(self.dm, cdim, sec.sec))
 * 
 *     def getCellCoordinateSection(self) -> Section:             # <<<<<<<<<<<<<<
 *         """Return the cell coordinate layout over the `DM`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_127getCellCoordinateSection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_126getCellCoordinateSection, "DM.getCellCoordinateSection(self) -> Section\nReturn the cell coordinate layout over the `DM`.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMGetCellCoordinateSection\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1231");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_127getCellCoordinateSection = {"getCellCoordinateSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_127getCellCoordinateSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_126getCellCoordinateSection};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_127getCellCoordinateSection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getCellCoordinateSection (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCellCoordinateSection", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCellCoordinateSection", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_126getCellCoordinateSection(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_126getCellCoordinateSection(struct PyPetscDMObject *__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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCellCoordinateSection", 0);

  /* "petsc4py/PETSc/DM.pyx":1241
 * 
 *         """
 *         cdef Section sec = Section()             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetCellCoordinateSection(self.dm, &sec.sec))
 *         CHKERR(PetscINCREF(sec.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1241, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1242
 *         """
 *         cdef Section sec = Section()
 *         CHKERR(DMGetCellCoordinateSection(self.dm, &sec.sec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(sec.obj))
 *         return sec
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCellCoordinateSection(__pyx_v_self->dm, (&__pyx_v_sec->sec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1242, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1243
 *         cdef Section sec = Section()
 *         CHKERR(DMGetCellCoordinateSection(self.dm, &sec.sec))
 *         CHKERR(PetscINCREF(sec.obj))             # <<<<<<<<<<<<<<
 *         return sec
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sec->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1243, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1244
 *         CHKERR(DMGetCellCoordinateSection(self.dm, &sec.sec))
 *         CHKERR(PetscINCREF(sec.obj))
 *         return sec             # <<<<<<<<<<<<<<
 * 
 *     def setCellCoordinates(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":1231
 *         CHKERR(DMSetCellCoordinateSection(self.dm, cdim, sec.sec))
 * 
 *     def getCellCoordinateSection(self) -> Section:             # <<<<<<<<<<<<<<
 *         """Return the cell coordinate layout over the `DM`.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.DM.getCellCoordinateSection", __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":1246
 *         return sec
 * 
 *     def setCellCoordinates(self, Vec c) -> None:             # <<<<<<<<<<<<<<
 *         """Set a global vector with the cellwise coordinates.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_129setCellCoordinates(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_128setCellCoordinates, "DM.setCellCoordinates(self, c: Vec) -> None\nSet a global vector with the cellwise coordinates.\n\n        Collective.\n\n        Parameters\n        ----------\n        c\n            The global cell coordinate vector.\n\n        See Also\n        --------\n        petsc.DMSetCellCoordinates\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1246");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_129setCellCoordinates = {"setCellCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_129setCellCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_128setCellCoordinates};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_129setCellCoordinates(PyObject *__pyx_v_self, 
#if 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("setCellCoordinates (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_c,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1246, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1246, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCellCoordinates", 0) < (0)) __PYX_ERR(54, 1246, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCellCoordinates", 1, 1, 1, i); __PYX_ERR(54, 1246, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1246, __pyx_L3_error)
    }
    __pyx_v_c = ((struct PyPetscVecObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setCellCoordinates", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1246, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DM.setCellCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "c", 0))) __PYX_ERR(54, 1246, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_128setCellCoordinates(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_c);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_128setCellCoordinates(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("setCellCoordinates", 0);

  /* "petsc4py/PETSc/DM.pyx":1261
 * 
 *         """
 *         CHKERR(DMSetCellCoordinates(self.dm, c.vec))             # <<<<<<<<<<<<<<
 * 
 *     def getCellCoordinates(self) -> Vec:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetCellCoordinates(__pyx_v_self->dm, __pyx_v_c->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1261, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1246
 *         return sec
 * 
 *     def setCellCoordinates(self, Vec c) -> None:             # <<<<<<<<<<<<<<
 *         """Set a global vector with the cellwise coordinates.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.DM.setCellCoordinates", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DM.pyx":1263
 *         CHKERR(DMSetCellCoordinates(self.dm, c.vec))
 * 
 *     def getCellCoordinates(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a global vector with the cellwise coordinates.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_131getCellCoordinates(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_130getCellCoordinates, "DM.getCellCoordinates(self) -> Vec\nReturn a global vector with the cellwise coordinates.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMGetCellCoordinates\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1263");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_131getCellCoordinates = {"getCellCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_131getCellCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_130getCellCoordinates};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_131getCellCoordinates(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getCellCoordinates (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCellCoordinates", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCellCoordinates", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_130getCellCoordinates(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_130getCellCoordinates(struct PyPetscDMObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_c = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCellCoordinates", 0);

  /* "petsc4py/PETSc/DM.pyx":1273
 * 
 *         """
 *         cdef Vec c = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetCellCoordinates(self.dm, &c.vec))
 *         CHKERR(PetscINCREF(c.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1273, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1274
 *         """
 *         cdef Vec c = Vec()
 *         CHKERR(DMGetCellCoordinates(self.dm, &c.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(c.obj))
 *         return c
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCellCoordinates(__pyx_v_self->dm, (&__pyx_v_c->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1274, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1275
 *         cdef Vec c = Vec()
 *         CHKERR(DMGetCellCoordinates(self.dm, &c.vec))
 *         CHKERR(PetscINCREF(c.obj))             # <<<<<<<<<<<<<<
 *         return c
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_c->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1275, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1276
 *         CHKERR(DMGetCellCoordinates(self.dm, &c.vec))
 *         CHKERR(PetscINCREF(c.obj))
 *         return c             # <<<<<<<<<<<<<<
 * 
 *     def setCellCoordinatesLocal(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":1263
 *         CHKERR(DMSetCellCoordinates(self.dm, c.vec))
 * 
 *     def getCellCoordinates(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a global vector with the cellwise coordinates.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.DM.getCellCoordinates", __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":1278
 *         return c
 * 
 *     def setCellCoordinatesLocal(self, Vec c) -> None:             # <<<<<<<<<<<<<<
 *         """Set a local vector with the cellwise coordinates.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_133setCellCoordinatesLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_132setCellCoordinatesLocal, "DM.setCellCoordinatesLocal(self, c: Vec) -> None\nSet a local vector with the cellwise coordinates.\n\n        Not collective.\n\n        Parameters\n        ----------\n        c\n            The local cell coordinate vector.\n\n        See Also\n        --------\n        petsc.DMSetCellCoordinatesLocal\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1278");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_133setCellCoordinatesLocal = {"setCellCoordinatesLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_133setCellCoordinatesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_132setCellCoordinatesLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_133setCellCoordinatesLocal(PyObject *__pyx_v_self, 
#if 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("setCellCoordinatesLocal (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_c,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1278, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1278, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCellCoordinatesLocal", 0) < (0)) __PYX_ERR(54, 1278, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCellCoordinatesLocal", 1, 1, 1, i); __PYX_ERR(54, 1278, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1278, __pyx_L3_error)
    }
    __pyx_v_c = ((struct PyPetscVecObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setCellCoordinatesLocal", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1278, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DM.setCellCoordinatesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_c), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "c", 0))) __PYX_ERR(54, 1278, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_132setCellCoordinatesLocal(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_c);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_132setCellCoordinatesLocal(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("setCellCoordinatesLocal", 0);

  /* "petsc4py/PETSc/DM.pyx":1293
 * 
 *         """
 *         CHKERR(DMSetCellCoordinatesLocal(self.dm, c.vec))             # <<<<<<<<<<<<<<
 * 
 *     def getCellCoordinatesLocal(self) -> Vec:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetCellCoordinatesLocal(__pyx_v_self->dm, __pyx_v_c->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1293, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1278
 *         return c
 * 
 *     def setCellCoordinatesLocal(self, Vec c) -> None:             # <<<<<<<<<<<<<<
 *         """Set a local vector with the cellwise coordinates.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.DM.setCellCoordinatesLocal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DM.pyx":1295
 *         CHKERR(DMSetCellCoordinatesLocal(self.dm, c.vec))
 * 
 *     def getCellCoordinatesLocal(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a local vector with the cellwise coordinates.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_135getCellCoordinatesLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_134getCellCoordinatesLocal, "DM.getCellCoordinatesLocal(self) -> Vec\nReturn a local vector with the cellwise coordinates.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMGetCellCoordinatesLocal\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1295");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_135getCellCoordinatesLocal = {"getCellCoordinatesLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_135getCellCoordinatesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_134getCellCoordinatesLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_135getCellCoordinatesLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getCellCoordinatesLocal (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCellCoordinatesLocal", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCellCoordinatesLocal", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_134getCellCoordinatesLocal(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_134getCellCoordinatesLocal(struct PyPetscDMObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_c = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCellCoordinatesLocal", 0);

  /* "petsc4py/PETSc/DM.pyx":1305
 * 
 *         """
 *         cdef Vec c = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetCellCoordinatesLocal(self.dm, &c.vec))
 *         CHKERR(PetscINCREF(c.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1305, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_c = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1306
 *         """
 *         cdef Vec c = Vec()
 *         CHKERR(DMGetCellCoordinatesLocal(self.dm, &c.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(c.obj))
 *         return c
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCellCoordinatesLocal(__pyx_v_self->dm, (&__pyx_v_c->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1306, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1307
 *         cdef Vec c = Vec()
 *         CHKERR(DMGetCellCoordinatesLocal(self.dm, &c.vec))
 *         CHKERR(PetscINCREF(c.obj))             # <<<<<<<<<<<<<<
 *         return c
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_c->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1307, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1308
 *         CHKERR(DMGetCellCoordinatesLocal(self.dm, &c.vec))
 *         CHKERR(PetscINCREF(c.obj))
 *         return c             # <<<<<<<<<<<<<<
 * 
 *     def setCoordinateDisc(self, FE disc, localized: bool, project: bool) -> Self:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_c);
  __pyx_r = ((PyObject *)__pyx_v_c);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":1295
 *         CHKERR(DMSetCellCoordinatesLocal(self.dm, c.vec))
 * 
 *     def getCellCoordinatesLocal(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a local vector with the cellwise coordinates.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.DM.getCellCoordinatesLocal", __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":1310
 *         return c
 * 
 *     def setCoordinateDisc(self, FE disc, localized: bool, project: bool) -> Self:             # <<<<<<<<<<<<<<
 *         """Project coordinates to a different space.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_137setCoordinateDisc(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_136setCoordinateDisc, "DM.setCoordinateDisc(self, disc: FE, localized: bool, project: bool) -> Self\nProject coordinates to a different space.\n\n        Collective.\n\n        Parameters\n        ----------\n        disc\n            The new coordinates discretization.\n        localized\n            Set a localized (DG) coordinate space\n        project\n            Project coordinates to new discretization\n\n        See Also\n        --------\n        petsc.DMSetCoordinateDisc\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1310");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_137setCoordinateDisc = {"setCoordinateDisc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_137setCoordinateDisc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_136setCoordinateDisc};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_137setCoordinateDisc(PyObject *__pyx_v_self, 
#if 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;
  PyObject *__pyx_v_localized = 0;
  PyObject *__pyx_v_project = 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("setCoordinateDisc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_disc,&__pyx_mstate_global->__pyx_n_u_localized,&__pyx_mstate_global->__pyx_n_u_project,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1310, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 1310, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 1310, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1310, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCoordinateDisc", 0) < (0)) __PYX_ERR(54, 1310, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCoordinateDisc", 1, 3, 3, i); __PYX_ERR(54, 1310, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1310, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 1310, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 1310, __pyx_L3_error)
    }
    __pyx_v_disc = ((struct PyPetscFEObject *)values[0]);
    __pyx_v_localized = values[1];
    __pyx_v_project = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setCoordinateDisc", 1, 3, 3, __pyx_nargs); __PYX_ERR(54, 1310, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DM.setCoordinateDisc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_disc), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, 0, "disc", 0))) __PYX_ERR(54, 1310, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_136setCoordinateDisc(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_disc, __pyx_v_localized, __pyx_v_project);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_136setCoordinateDisc(struct PyPetscDMObject *__pyx_v_self, struct PyPetscFEObject *__pyx_v_disc, PyObject *__pyx_v_localized, PyObject *__pyx_v_project) {
  PetscBool __pyx_v_clocalized;
  PetscBool __pyx_v_pr;
  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("setCoordinateDisc", 0);

  /* "petsc4py/PETSc/DM.pyx":1329
 * 
 *         """
 *         cdef PetscBool clocalized = localized             # <<<<<<<<<<<<<<
 *         cdef PetscBool pr = project
 *         CHKERR(DMSetCoordinateDisc(self.dm, disc.fe, clocalized, pr))
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_localized); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(54, 1329, __pyx_L1_error)
  __pyx_v_clocalized = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":1330
 *         """
 *         cdef PetscBool clocalized = localized
 *         cdef PetscBool pr = project             # <<<<<<<<<<<<<<
 *         CHKERR(DMSetCoordinateDisc(self.dm, disc.fe, clocalized, pr))
 *         return self
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_project); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(54, 1330, __pyx_L1_error)
  __pyx_v_pr = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":1331
 *         cdef PetscBool clocalized = localized
 *         cdef PetscBool pr = project
 *         CHKERR(DMSetCoordinateDisc(self.dm, disc.fe, clocalized, pr))             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetCoordinateDisc(__pyx_v_self->dm, __pyx_v_disc->fe, __pyx_v_clocalized, __pyx_v_pr)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1331, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1332
 *         cdef PetscBool pr = project
 *         CHKERR(DMSetCoordinateDisc(self.dm, disc.fe, clocalized, pr))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def getCoordinatesLocalized(self) -> bool:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":1310
 *         return c
 * 
 *     def setCoordinateDisc(self, FE disc, localized: bool, project: bool) -> Self:             # <<<<<<<<<<<<<<
 *         """Project coordinates to a different space.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.DM.setCoordinateDisc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DM.pyx":1334
 *         return self
 * 
 *     def getCoordinatesLocalized(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Check if the coordinates have been localized for cells.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_139getCoordinatesLocalized(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_138getCoordinatesLocalized, "DM.getCoordinatesLocalized(self) -> bool\nCheck if the coordinates have been localized for cells.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.DMGetCoordinatesLocalized\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1334");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_139getCoordinatesLocalized = {"getCoordinatesLocalized", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_139getCoordinatesLocalized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_138getCoordinatesLocalized};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_139getCoordinatesLocalized(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getCoordinatesLocalized (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCoordinatesLocalized", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCoordinatesLocalized", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_138getCoordinatesLocalized(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_138getCoordinatesLocalized(struct PyPetscDMObject *__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("getCoordinatesLocalized", 0);

  /* "petsc4py/PETSc/DM.pyx":1344
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetCoordinatesLocalized(self.dm, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/DM.pyx":1345
 *         """
 *         cdef PetscBool flag = PETSC_FALSE
 *         CHKERR(DMGetCoordinatesLocalized(self.dm, &flag))             # <<<<<<<<<<<<<<
 *         return toBool(flag)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetCoordinatesLocalized(__pyx_v_self->dm, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1345, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1346
 *         cdef PetscBool flag = PETSC_FALSE
 *         CHKERR(DMGetCoordinatesLocalized(self.dm, &flag))
 *         return toBool(flag)             # <<<<<<<<<<<<<<
 * 
 *     def getSparseLocalize(self) -> bool:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":1334
 *         return self
 * 
 *     def getCoordinatesLocalized(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Check if the coordinates have been localized for cells.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.DM.getCoordinatesLocalized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DM.pyx":1348
 *         return toBool(flag)
 * 
 *     def getSparseLocalize(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return if coordinates should only be localized at the boundary.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_141getSparseLocalize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_140getSparseLocalize, "DM.getSparseLocalize(self) -> bool\nReturn if coordinates should only be localized at the boundary.\n\n        Not collective.\n\n        See Also\n        --------\n        DM.setSparseLocalize, petsc.DMGetSparseLocalize\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1348");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_141getSparseLocalize = {"getSparseLocalize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_141getSparseLocalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_140getSparseLocalize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_141getSparseLocalize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getSparseLocalize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSparseLocalize", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSparseLocalize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_140getSparseLocalize(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_140getSparseLocalize(struct PyPetscDMObject *__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("getSparseLocalize", 0);

  /* "petsc4py/PETSc/DM.pyx":1358
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetSparseLocalize(self.dm, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/DM.pyx":1359
 *         """
 *         cdef PetscBool flag = PETSC_FALSE
 *         CHKERR(DMGetSparseLocalize(self.dm, &flag))             # <<<<<<<<<<<<<<
 *         return toBool(flag)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetSparseLocalize(__pyx_v_self->dm, (&__pyx_v_flag))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1359, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1360
 *         cdef PetscBool flag = PETSC_FALSE
 *         CHKERR(DMGetSparseLocalize(self.dm, &flag))
 *         return toBool(flag)             # <<<<<<<<<<<<<<
 * 
 *     def setSparseLocalize(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(54, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":1348
 *         return toBool(flag)
 * 
 *     def getSparseLocalize(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return if coordinates should only be localized at the boundary.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.DM.getSparseLocalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DM.pyx":1362
 *         return toBool(flag)
 * 
 *     def setSparseLocalize(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set if coordinates should be only localized at the boundary.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_143setSparseLocalize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_142setSparseLocalize, "DM.setSparseLocalize(self, flag: bool) -> None\nSet if coordinates should be only localized at the boundary.\n\n        Collective.\n\n        Parameters\n        ----------\n        flag\n            Whether the coordinates should only be localized at the boundary.\n\n        See Also\n        --------\n        DM.getSparseLocalize, petsc.DMSetSparseLocalize\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1362");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_143setSparseLocalize = {"setSparseLocalize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_143setSparseLocalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_142setSparseLocalize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_143setSparseLocalize(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("setSparseLocalize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1362, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1362, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSparseLocalize", 0) < (0)) __PYX_ERR(54, 1362, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSparseLocalize", 1, 1, 1, i); __PYX_ERR(54, 1362, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1362, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setSparseLocalize", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1362, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DM.setSparseLocalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_142setSparseLocalize(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_142setSparseLocalize(struct PyPetscDMObject *__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("setSparseLocalize", 0);

  /* "petsc4py/PETSc/DM.pyx":1377
 * 
 *         """
 *         cdef PetscBool cflag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         if flag: cflag = PETSC_TRUE
 *         CHKERR(DMSetSparseLocalize(self.dm, cflag))
*/
  __pyx_v_cflag = PETSC_FALSE;

  /* "petsc4py/PETSc/DM.pyx":1378
 *         """
 *         cdef PetscBool cflag = PETSC_FALSE
 *         if flag: cflag = PETSC_TRUE             # <<<<<<<<<<<<<<
 *         CHKERR(DMSetSparseLocalize(self.dm, cflag))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(54, 1378, __pyx_L1_error)
  if (__pyx_t_1) {
    __pyx_v_cflag = PETSC_TRUE;
  }

  /* "petsc4py/PETSc/DM.pyx":1379
 *         cdef PetscBool cflag = PETSC_FALSE
 *         if flag: cflag = PETSC_TRUE
 *         CHKERR(DMSetSparseLocalize(self.dm, cflag))             # <<<<<<<<<<<<<<
 * 
 *     def getBoundingBox(self) -> tuple[tuple[float, float], ...]:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetSparseLocalize(__pyx_v_self->dm, __pyx_v_cflag)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1379, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1362
 *         return toBool(flag)
 * 
 *     def setSparseLocalize(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set if coordinates should be only localized at the boundary.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.DM.setSparseLocalize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DM.pyx":1381
 *         CHKERR(DMSetSparseLocalize(self.dm, cflag))
 * 
 *     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_145getBoundingBox(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_144getBoundingBox, "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:1381");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_145getBoundingBox = {"getBoundingBox", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_145getBoundingBox, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_144getBoundingBox};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_145getBoundingBox(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBoundingBox", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_144getBoundingBox(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_144getBoundingBox(struct PyPetscDMObject *__pyx_v_self) {
  PetscInt __pyx_v_dim;
  PetscReal __pyx_v_gmin[3];
  PetscReal __pyx_v_gmax[3];
  long __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;
  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", 0);

  /* "petsc4py/PETSc/DM.pyx":1391
 * 
 *         """
 *         cdef PetscInt dim=0             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetCoordinateDim(self.dm, &dim))
 *         cdef PetscReal gmin[3], gmax[3]
*/
  __pyx_v_dim = 0;

  /* "petsc4py/PETSc/DM.pyx":1392
 *         """
 *         cdef PetscInt 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, 1392, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1394
 *         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, 1394, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1395
 *         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, 1395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "petsc4py/PETSc/DM.pyx":1396
 *         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_9genexpr17__pyx_v_i = 0; __pyx_9genexpr17__pyx_v_i < __pyx_t_3; __pyx_9genexpr17__pyx_v_i++) {

      /* "petsc4py/PETSc/DM.pyx":1395
 *         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_9genexpr17__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1395, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_gmax[__pyx_9genexpr17__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1395, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(54, 1395, __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) != (0)) __PYX_ERR(54, 1395, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5) != (0)) __PYX_ERR(54, 1395, __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, 1395, __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, 1395, __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":1381
 *         CHKERR(DMSetSparseLocalize(self.dm, cflag))
 * 
 *     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":1398
 *                       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_147getLocalBoundingBox(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_146getLocalBoundingBox, "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:1398");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_147getLocalBoundingBox = {"getLocalBoundingBox", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_147getLocalBoundingBox, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_146getLocalBoundingBox};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_147getLocalBoundingBox(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLocalBoundingBox", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_146getLocalBoundingBox(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_146getLocalBoundingBox(struct PyPetscDMObject *__pyx_v_self) {
  PetscInt __pyx_v_dim;
  PetscReal __pyx_v_lmin[3];
  PetscReal __pyx_v_lmax[3];
  long __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;
  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", 0);

  /* "petsc4py/PETSc/DM.pyx":1408
 * 
 *         """
 *         cdef PetscInt dim=0             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetCoordinateDim(self.dm, &dim))
 *         cdef PetscReal lmin[3], lmax[3]
*/
  __pyx_v_dim = 0;

  /* "petsc4py/PETSc/DM.pyx":1409
 *         """
 *         cdef PetscInt 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, 1409, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1411
 *         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, 1411, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1412
 *         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, 1412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "petsc4py/PETSc/DM.pyx":1413
 *         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_9genexpr18__pyx_v_i = 0; __pyx_9genexpr18__pyx_v_i < __pyx_t_3; __pyx_9genexpr18__pyx_v_i++) {

      /* "petsc4py/PETSc/DM.pyx":1412
 *         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_9genexpr18__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1412, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal((__pyx_v_lmax[__pyx_9genexpr18__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1412, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(54, 1412, __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) != (0)) __PYX_ERR(54, 1412, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_5);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5) != (0)) __PYX_ERR(54, 1412, __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, 1412, __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, 1412, __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":1398
 *                       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":1415
 *                       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_149localizeCoordinates(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_148localizeCoordinates, "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:1415");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_149localizeCoordinates = {"localizeCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_149localizeCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_148localizeCoordinates};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_149localizeCoordinates(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("localizeCoordinates", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_148localizeCoordinates(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_148localizeCoordinates(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", 0);

  /* "petsc4py/PETSc/DM.pyx":1429
 * 
 *         """
 *         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, 1429, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1415
 *                       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":1432
 *     #
 * 
 *     def getPeriodicity(self) -> tuple[ArrayReal, ArrayReal, ArrayReal]:             # <<<<<<<<<<<<<<
 *         """Set the description of mesh periodicity.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_151getPeriodicity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_150getPeriodicity, "DM.getPeriodicity(self) -> tuple[ArrayReal, ArrayReal, ArrayReal]\nSet the description of mesh periodicity.\n\n        Not collective.\n\n        Parameters\n        ----------\n        maxCell\n            The longest allowable cell dimension in each direction.\n        Lstart\n            The start of each coordinate direction, usually [0, 0, 0]\n        L\n            The periodic length of each coordinate direction, or -1 for non-periodic\n\n        See Also\n        --------\n        petsc.DMSetPeriodicity\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1432");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_151getPeriodicity = {"getPeriodicity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_151getPeriodicity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_150getPeriodicity};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_151getPeriodicity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getPeriodicity (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getPeriodicity", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPeriodicity", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_150getPeriodicity(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_150getPeriodicity(struct PyPetscDMObject *__pyx_v_self) {
  PetscInt __pyx_v_dim;
  PetscReal *__pyx_v_MAXCELL;
  PyArrayObject *__pyx_v_mcell = 0;
  PetscReal *__pyx_v_LSTART;
  PyArrayObject *__pyx_v_lstart = 0;
  PetscReal *__pyx_v_LPY;
  PyArrayObject *__pyx_v_lpy = 0;
  PetscReal const *__pyx_v_maxCell;
  PetscReal const *__pyx_v_Lstart;
  PetscReal const *__pyx_v_L;
  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("getPeriodicity", 0);

  /* "petsc4py/PETSc/DM.pyx":1451
 * 
 *         """
 *         cdef PetscInt dim = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetDimension(self.dm, &dim))
 *         cdef PetscReal *MAXCELL = NULL
*/
  __pyx_v_dim = 0;

  /* "petsc4py/PETSc/DM.pyx":1452
 *         """
 *         cdef PetscInt dim = 0
 *         CHKERR(DMGetDimension(self.dm, &dim))             # <<<<<<<<<<<<<<
 *         cdef PetscReal *MAXCELL = NULL
 *         cdef ndarray mcell = oarray_r(empty_r(dim), NULL, &MAXCELL)
*/
  __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, 1452, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1453
 *         cdef PetscInt dim = 0
 *         CHKERR(DMGetDimension(self.dm, &dim))
 *         cdef PetscReal *MAXCELL = NULL             # <<<<<<<<<<<<<<
 *         cdef ndarray mcell = oarray_r(empty_r(dim), NULL, &MAXCELL)
 *         cdef PetscReal *LSTART = NULL
*/
  __pyx_v_MAXCELL = NULL;

  /* "petsc4py/PETSc/DM.pyx":1454
 *         CHKERR(DMGetDimension(self.dm, &dim))
 *         cdef PetscReal *MAXCELL = NULL
 *         cdef ndarray mcell = oarray_r(empty_r(dim), NULL, &MAXCELL)             # <<<<<<<<<<<<<<
 *         cdef PetscReal *LSTART = NULL
 *         cdef ndarray lstart = oarray_r(empty_r(dim), NULL, &LSTART)
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_r(__pyx_v_dim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_t_2, NULL, (&__pyx_v_MAXCELL))); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_mcell = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DM.pyx":1455
 *         cdef PetscReal *MAXCELL = NULL
 *         cdef ndarray mcell = oarray_r(empty_r(dim), NULL, &MAXCELL)
 *         cdef PetscReal *LSTART = NULL             # <<<<<<<<<<<<<<
 *         cdef ndarray lstart = oarray_r(empty_r(dim), NULL, &LSTART)
 *         cdef PetscReal *LPY = NULL
*/
  __pyx_v_LSTART = NULL;

  /* "petsc4py/PETSc/DM.pyx":1456
 *         cdef ndarray mcell = oarray_r(empty_r(dim), NULL, &MAXCELL)
 *         cdef PetscReal *LSTART = NULL
 *         cdef ndarray lstart = oarray_r(empty_r(dim), NULL, &LSTART)             # <<<<<<<<<<<<<<
 *         cdef PetscReal *LPY = NULL
 *         cdef ndarray lpy = oarray_r(empty_r(dim), NULL, &LPY)
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_r(__pyx_v_dim)); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_t_3, NULL, (&__pyx_v_LSTART))); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_lstart = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DM.pyx":1457
 *         cdef PetscReal *LSTART = NULL
 *         cdef ndarray lstart = oarray_r(empty_r(dim), NULL, &LSTART)
 *         cdef PetscReal *LPY = NULL             # <<<<<<<<<<<<<<
 *         cdef ndarray lpy = oarray_r(empty_r(dim), NULL, &LPY)
 *         cdef const PetscReal *maxCell = NULL
*/
  __pyx_v_LPY = NULL;

  /* "petsc4py/PETSc/DM.pyx":1458
 *         cdef ndarray lstart = oarray_r(empty_r(dim), NULL, &LSTART)
 *         cdef PetscReal *LPY = NULL
 *         cdef ndarray lpy = oarray_r(empty_r(dim), NULL, &LPY)             # <<<<<<<<<<<<<<
 *         cdef const PetscReal *maxCell = NULL
 *         cdef const PetscReal *Lstart = NULL
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_r(__pyx_v_dim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_t_2, NULL, (&__pyx_v_LPY))); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_lpy = ((PyArrayObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DM.pyx":1459
 *         cdef PetscReal *LPY = NULL
 *         cdef ndarray lpy = oarray_r(empty_r(dim), NULL, &LPY)
 *         cdef const PetscReal *maxCell = NULL             # <<<<<<<<<<<<<<
 *         cdef const PetscReal *Lstart = NULL
 *         cdef const PetscReal *L = NULL
*/
  __pyx_v_maxCell = NULL;

  /* "petsc4py/PETSc/DM.pyx":1460
 *         cdef ndarray lpy = oarray_r(empty_r(dim), NULL, &LPY)
 *         cdef const PetscReal *maxCell = NULL
 *         cdef const PetscReal *Lstart = NULL             # <<<<<<<<<<<<<<
 *         cdef const PetscReal *L = NULL
 *         CHKERR(DMGetPeriodicity(self.dm, &maxCell, &Lstart, &L))
*/
  __pyx_v_Lstart = NULL;

  /* "petsc4py/PETSc/DM.pyx":1461
 *         cdef const PetscReal *maxCell = NULL
 *         cdef const PetscReal *Lstart = NULL
 *         cdef const PetscReal *L = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetPeriodicity(self.dm, &maxCell, &Lstart, &L))
 *         CHKERR(PetscMemcpy(MAXCELL, maxCell, <size_t>dim*sizeof(PetscReal)))
*/
  __pyx_v_L = NULL;

  /* "petsc4py/PETSc/DM.pyx":1462
 *         cdef const PetscReal *Lstart = NULL
 *         cdef const PetscReal *L = NULL
 *         CHKERR(DMGetPeriodicity(self.dm, &maxCell, &Lstart, &L))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscMemcpy(MAXCELL, maxCell, <size_t>dim*sizeof(PetscReal)))
 *         CHKERR(PetscMemcpy(LSTART, Lstart, <size_t>dim*sizeof(PetscReal)))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetPeriodicity(__pyx_v_self->dm, (&__pyx_v_maxCell), (&__pyx_v_Lstart), (&__pyx_v_L))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1462, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1463
 *         cdef const PetscReal *L = NULL
 *         CHKERR(DMGetPeriodicity(self.dm, &maxCell, &Lstart, &L))
 *         CHKERR(PetscMemcpy(MAXCELL, maxCell, <size_t>dim*sizeof(PetscReal)))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscMemcpy(LSTART, Lstart, <size_t>dim*sizeof(PetscReal)))
 *         CHKERR(PetscMemcpy(LPY, L, <size_t>dim*sizeof(PetscReal)))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMemcpy(__pyx_v_MAXCELL, __pyx_v_maxCell, (((size_t)__pyx_v_dim) * (sizeof(PetscReal))))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1463, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1464
 *         CHKERR(DMGetPeriodicity(self.dm, &maxCell, &Lstart, &L))
 *         CHKERR(PetscMemcpy(MAXCELL, maxCell, <size_t>dim*sizeof(PetscReal)))
 *         CHKERR(PetscMemcpy(LSTART, Lstart, <size_t>dim*sizeof(PetscReal)))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscMemcpy(LPY, L, <size_t>dim*sizeof(PetscReal)))
 *         return (mcell, lstart, lpy)
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMemcpy(__pyx_v_LSTART, __pyx_v_Lstart, (((size_t)__pyx_v_dim) * (sizeof(PetscReal))))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1464, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1465
 *         CHKERR(PetscMemcpy(MAXCELL, maxCell, <size_t>dim*sizeof(PetscReal)))
 *         CHKERR(PetscMemcpy(LSTART, Lstart, <size_t>dim*sizeof(PetscReal)))
 *         CHKERR(PetscMemcpy(LPY, L, <size_t>dim*sizeof(PetscReal)))             # <<<<<<<<<<<<<<
 *         return (mcell, lstart, lpy)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscMemcpy(__pyx_v_LPY, __pyx_v_L, (((size_t)__pyx_v_dim) * (sizeof(PetscReal))))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1465, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1466
 *         CHKERR(PetscMemcpy(LSTART, Lstart, <size_t>dim*sizeof(PetscReal)))
 *         CHKERR(PetscMemcpy(LPY, L, <size_t>dim*sizeof(PetscReal)))
 *         return (mcell, lstart, lpy)             # <<<<<<<<<<<<<<
 * 
 *     def setPeriodicity(self, maxCell: Sequence[float], Lstart: Sequence[float], L: Sequence[float]) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_mcell);
  __Pyx_GIVEREF((PyObject *)__pyx_v_mcell);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_mcell)) != (0)) __PYX_ERR(54, 1466, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_lstart);
  __Pyx_GIVEREF((PyObject *)__pyx_v_lstart);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_lstart)) != (0)) __PYX_ERR(54, 1466, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_lpy);
  __Pyx_GIVEREF((PyObject *)__pyx_v_lpy);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_lpy)) != (0)) __PYX_ERR(54, 1466, __pyx_L1_error);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":1432
 *     #
 * 
 *     def getPeriodicity(self) -> tuple[ArrayReal, ArrayReal, ArrayReal]:             # <<<<<<<<<<<<<<
 *         """Set the description of mesh periodicity.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("petsc4py.PETSc.DM.getPeriodicity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_mcell);
  __Pyx_XDECREF((PyObject *)__pyx_v_lstart);
  __Pyx_XDECREF((PyObject *)__pyx_v_lpy);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DM.pyx":1468
 *         return (mcell, lstart, lpy)
 * 
 *     def setPeriodicity(self, maxCell: Sequence[float], Lstart: Sequence[float], L: Sequence[float]) -> None:             # <<<<<<<<<<<<<<
 *         """Set the description of mesh periodicity.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_153setPeriodicity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_152setPeriodicity, "DM.setPeriodicity(self, maxCell: Sequence[float], Lstart: Sequence[float], L: Sequence[float]) -> None\nSet the description of mesh periodicity.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        maxCell\n            The longest allowable cell dimension in each direction.\n        Lstart\n            The start of each coordinate direction, usually [0, 0, 0]\n        L\n            The periodic length of each coordinate direction, or -1 for non-periodic\n\n        See Also\n        --------\n        petsc.DMSetPeriodicity\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1468");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_153setPeriodicity = {"setPeriodicity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_153setPeriodicity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_152setPeriodicity};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_153setPeriodicity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_maxCell = 0;
  PyObject *__pyx_v_Lstart = 0;
  PyObject *__pyx_v_L = 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("setPeriodicity (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_maxCell,&__pyx_mstate_global->__pyx_n_u_Lstart,&__pyx_mstate_global->__pyx_n_u_L,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1468, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 1468, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 1468, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1468, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPeriodicity", 0) < (0)) __PYX_ERR(54, 1468, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPeriodicity", 1, 3, 3, i); __PYX_ERR(54, 1468, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1468, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 1468, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 1468, __pyx_L3_error)
    }
    __pyx_v_maxCell = values[0];
    __pyx_v_Lstart = values[1];
    __pyx_v_L = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPeriodicity", 1, 3, 3, __pyx_nargs); __PYX_ERR(54, 1468, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DM.setPeriodicity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_152setPeriodicity(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_maxCell, __pyx_v_Lstart, __pyx_v_L);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_152setPeriodicity(struct PyPetscDMObject *__pyx_v_self, PyObject *__pyx_v_maxCell, PyObject *__pyx_v_Lstart, PyObject *__pyx_v_L) {
  PetscReal *__pyx_v_MAXCELL;
  CYTHON_UNUSED PyArrayObject *__pyx_v_unuseda = 0;
  PetscReal *__pyx_v_LSTART;
  CYTHON_UNUSED PyArrayObject *__pyx_v_unusedb = 0;
  PetscReal *__pyx_v_LPY;
  CYTHON_UNUSED PyArrayObject *__pyx_v_unusedc = 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("setPeriodicity", 0);

  /* "petsc4py/PETSc/DM.pyx":1487
 * 
 *         """
 *         cdef PetscReal *MAXCELL = NULL             # <<<<<<<<<<<<<<
 *         cdef ndarray unuseda = oarray_r(maxCell, NULL, &MAXCELL)
 *         cdef PetscReal *LSTART = NULL
*/
  __pyx_v_MAXCELL = NULL;

  /* "petsc4py/PETSc/DM.pyx":1488
 *         """
 *         cdef PetscReal *MAXCELL = NULL
 *         cdef ndarray unuseda = oarray_r(maxCell, NULL, &MAXCELL)             # <<<<<<<<<<<<<<
 *         cdef PetscReal *LSTART = NULL
 *         cdef ndarray unusedb = oarray_r(Lstart, NULL, &LSTART)
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_v_maxCell, NULL, (&__pyx_v_MAXCELL))); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_unuseda = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1489
 *         cdef PetscReal *MAXCELL = NULL
 *         cdef ndarray unuseda = oarray_r(maxCell, NULL, &MAXCELL)
 *         cdef PetscReal *LSTART = NULL             # <<<<<<<<<<<<<<
 *         cdef ndarray unusedb = oarray_r(Lstart, NULL, &LSTART)
 *         cdef PetscReal *LPY = NULL
*/
  __pyx_v_LSTART = NULL;

  /* "petsc4py/PETSc/DM.pyx":1490
 *         cdef ndarray unuseda = oarray_r(maxCell, NULL, &MAXCELL)
 *         cdef PetscReal *LSTART = NULL
 *         cdef ndarray unusedb = oarray_r(Lstart, NULL, &LSTART)             # <<<<<<<<<<<<<<
 *         cdef PetscReal *LPY = NULL
 *         cdef ndarray unusedc = oarray_r(L, NULL, &LPY)
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_v_Lstart, NULL, (&__pyx_v_LSTART))); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_unusedb = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1491
 *         cdef PetscReal *LSTART = NULL
 *         cdef ndarray unusedb = oarray_r(Lstart, NULL, &LSTART)
 *         cdef PetscReal *LPY = NULL             # <<<<<<<<<<<<<<
 *         cdef ndarray unusedc = oarray_r(L, NULL, &LPY)
 *         CHKERR(DMSetPeriodicity(self.dm, MAXCELL, LSTART, LPY))
*/
  __pyx_v_LPY = NULL;

  /* "petsc4py/PETSc/DM.pyx":1492
 *         cdef ndarray unusedb = oarray_r(Lstart, NULL, &LSTART)
 *         cdef PetscReal *LPY = NULL
 *         cdef ndarray unusedc = oarray_r(L, NULL, &LPY)             # <<<<<<<<<<<<<<
 *         CHKERR(DMSetPeriodicity(self.dm, MAXCELL, LSTART, LPY))
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_v_L, NULL, (&__pyx_v_LPY))); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_unusedc = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1493
 *         cdef PetscReal *LPY = NULL
 *         cdef ndarray unusedc = oarray_r(L, NULL, &LPY)
 *         CHKERR(DMSetPeriodicity(self.dm, MAXCELL, LSTART, LPY))             # <<<<<<<<<<<<<<
 * 
 *     def setMatType(self, mat_type: Mat.Type | str) -> None:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSetPeriodicity(__pyx_v_self->dm, __pyx_v_MAXCELL, __pyx_v_LSTART, __pyx_v_LPY)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1493, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1468
 *         return (mcell, lstart, lpy)
 * 
 *     def setPeriodicity(self, maxCell: Sequence[float], Lstart: Sequence[float], L: Sequence[float]) -> None:             # <<<<<<<<<<<<<<
 *         """Set the description of mesh periodicity.
 * 
*/

  /* 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.setPeriodicity", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_unuseda);
  __Pyx_XDECREF((PyObject *)__pyx_v_unusedb);
  __Pyx_XDECREF((PyObject *)__pyx_v_unusedc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DM.pyx":1495
 *         CHKERR(DMSetPeriodicity(self.dm, MAXCELL, LSTART, LPY))
 * 
 *     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_155setMatType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_154setMatType, "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:1495");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_155setMatType = {"setMatType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_155setMatType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_154setMatType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_155setMatType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1495, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1495, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMatType", 0) < (0)) __PYX_ERR(54, 1495, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMatType", 1, 1, 1, i); __PYX_ERR(54, 1495, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1495, __pyx_L3_error)
    }
    __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, 1495, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_154setMatType(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_mat_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_154setMatType(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":1514
 * 
 *         """
 *         cdef PetscMatType mtype = NULL             # <<<<<<<<<<<<<<
 *         mat_type = str2bytes(mat_type, &mtype)
 *         CHKERR(DMSetMatType(self.dm, mtype))
*/
  __pyx_v_mtype = NULL;

  /* "petsc4py/PETSc/DM.pyx":1515
 *         """
 *         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, 1515, __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":1516
 *         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, 1516, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1495
 *         CHKERR(DMSetPeriodicity(self.dm, MAXCELL, LSTART, LPY))
 * 
 *     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":1518
 *         CHKERR(DMSetMatType(self.dm, mtype))
 * 
 *     def createMat(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return an empty matrix.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_157createMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_156createMat, "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:1518");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_157createMat = {"createMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_157createMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_156createMat};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_157createMat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("createMat", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_156createMat(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_156createMat(struct PyPetscDMObject *__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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createMat", 0);

  /* "petsc4py/PETSc/DM.pyx":1528
 * 
 *         """
 *         cdef Mat mat = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(DMCreateMatrix(self.dm, &mat.mat))
 *         return mat
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1528, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1529
 *         """
 *         cdef Mat mat = Mat()
 *         CHKERR(DMCreateMatrix(self.dm, &mat.mat))             # <<<<<<<<<<<<<<
 *         return mat
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateMatrix(__pyx_v_self->dm, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1529, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1530
 *         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":1518
 *         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_XDECREF(__pyx_t_2);
  __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":1532
 *         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_159createMassMatrix(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_158createMassMatrix, "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:1532");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_159createMassMatrix = {"createMassMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_159createMassMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_158createMassMatrix};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_159createMassMatrix(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dmf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1532, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1532, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createMassMatrix", 0) < (0)) __PYX_ERR(54, 1532, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createMassMatrix", 1, 1, 1, i); __PYX_ERR(54, 1532, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1532, __pyx_L3_error)
    }
    __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, 1532, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dmf", 0))) __PYX_ERR(54, 1532, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_158createMassMatrix(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dmf);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_158createMassMatrix(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createMassMatrix", 0);

  /* "petsc4py/PETSc/DM.pyx":1547
 * 
 *         """
 *         cdef Mat mat = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(DMCreateMassMatrix(self.dm, dmf.dm, &mat.mat))
 *         return mat
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1547, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1548
 *         """
 *         cdef Mat mat = Mat()
 *         CHKERR(DMCreateMassMatrix(self.dm, dmf.dm, &mat.mat))             # <<<<<<<<<<<<<<
 *         return mat
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateMassMatrix(__pyx_v_self->dm, __pyx_v_dmf->dm, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1548, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1549
 *         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":1532
 *         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_XDECREF(__pyx_t_2);
  __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":1551
 *         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_161createInterpolation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_160createInterpolation, "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:1551");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_161createInterpolation = {"createInterpolation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_161createInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_160createInterpolation};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_161createInterpolation(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1551, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1551, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createInterpolation", 0) < (0)) __PYX_ERR(54, 1551, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createInterpolation", 1, 1, 1, i); __PYX_ERR(54, 1551, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1551, __pyx_L3_error)
    }
    __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, 1551, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(54, 1551, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_160createInterpolation(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_160createInterpolation(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createInterpolation", 0);

  /* "petsc4py/PETSc/DM.pyx":1566
 * 
 *         """
 *         cdef Mat A = Mat()             # <<<<<<<<<<<<<<
 *         cdef Vec scale = Vec()
 *         CHKERR(DMCreateInterpolation(self.dm, dm.dm,
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1566, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_A = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1567
 *         """
 *         cdef Mat A = Mat()
 *         cdef Vec scale = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(DMCreateInterpolation(self.dm, dm.dm,
 *                                      &A.mat, &scale.vec))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1567, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_scale = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1568
 *         cdef Mat A = Mat()
 *         cdef Vec scale = Vec()
 *         CHKERR(DMCreateInterpolation(self.dm, dm.dm,             # <<<<<<<<<<<<<<
 *                                      &A.mat, &scale.vec))
 *         return (A, scale)
*/
  __pyx_t_4 = __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_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1568, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1570
 *         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, 1570, __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)) != (0)) __PYX_ERR(54, 1570, __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)) != (0)) __PYX_ERR(54, 1570, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":1551
 *         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_XDECREF(__pyx_t_2);
  __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":1572
 *         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_163createInjection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_162createInjection, "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:1572");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_163createInjection = {"createInjection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_163createInjection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_162createInjection};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_163createInjection(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1572, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1572, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createInjection", 0) < (0)) __PYX_ERR(54, 1572, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createInjection", 1, 1, 1, i); __PYX_ERR(54, 1572, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1572, __pyx_L3_error)
    }
    __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, 1572, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(54, 1572, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_162createInjection(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_162createInjection(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createInjection", 0);

  /* "petsc4py/PETSc/DM.pyx":1587
 * 
 *         """
 *         cdef Mat inject = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(DMCreateInjection(self.dm, dm.dm, &inject.mat))
 *         return inject
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1587, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_inject = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1588
 *         """
 *         cdef Mat inject = Mat()
 *         CHKERR(DMCreateInjection(self.dm, dm.dm, &inject.mat))             # <<<<<<<<<<<<<<
 *         return inject
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateInjection(__pyx_v_self->dm, __pyx_v_dm->dm, (&__pyx_v_inject->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1588, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1589
 *         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":1572
 *         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_XDECREF(__pyx_t_2);
  __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":1591
 *         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_165createRestriction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_164createRestriction, "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:1591");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_165createRestriction = {"createRestriction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_165createRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_164createRestriction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_165createRestriction(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1591, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1591, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createRestriction", 0) < (0)) __PYX_ERR(54, 1591, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createRestriction", 1, 1, 1, i); __PYX_ERR(54, 1591, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1591, __pyx_L3_error)
    }
    __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, 1591, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(54, 1591, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_164createRestriction(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_164createRestriction(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createRestriction", 0);

  /* "petsc4py/PETSc/DM.pyx":1606
 * 
 *         """
 *         cdef Mat mat = Mat()             # <<<<<<<<<<<<<<
 *         CHKERR(DMCreateRestriction(self.dm, dm.dm, &mat.mat))
 *         return mat
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1606, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_mat = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1607
 *         """
 *         cdef Mat mat = Mat()
 *         CHKERR(DMCreateRestriction(self.dm, dm.dm, &mat.mat))             # <<<<<<<<<<<<<<
 *         return mat
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMCreateRestriction(__pyx_v_self->dm, __pyx_v_dm->dm, (&__pyx_v_mat->mat))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1607, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1608
 *         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":1591
 *         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_XDECREF(__pyx_t_2);
  __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":1610
 *         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_167convert(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_166convert, "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:1610");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_167convert = {"convert", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_167convert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_166convert};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_167convert(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1610, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1610, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "convert", 0) < (0)) __PYX_ERR(54, 1610, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("convert", 1, 1, 1, i); __PYX_ERR(54, 1610, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1610, __pyx_L3_error)
    }
    __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, 1610, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_166convert(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_dm_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_166convert(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  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":1625
 * 
 *         """
 *         cdef PetscDMType cval = NULL             # <<<<<<<<<<<<<<
 *         dm_type = str2bytes(dm_type, &cval)
 *         cdef PetscDM newdm = NULL
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DM.pyx":1626
 *         """
 *         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, 1626, __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":1627
 *         cdef PetscDMType cval = NULL
 *         dm_type = str2bytes(dm_type, &cval)
 *         cdef PetscDM newdm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMConvert(self.dm, cval, &newdm))
 *         cdef DM dm = <DM>subtype_DM(newdm)()
*/
  __pyx_v_newdm = NULL;

  /* "petsc4py/PETSc/DM.pyx":1628
 *         dm_type = str2bytes(dm_type, &cval)
 *         cdef PetscDM newdm = NULL
 *         CHKERR(DMConvert(self.dm, cval, &newdm))             # <<<<<<<<<<<<<<
 *         cdef DM 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, 1628, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1629
 *         cdef PetscDM newdm = NULL
 *         CHKERR(DMConvert(self.dm, cval, &newdm))
 *         cdef DM dm = <DM>subtype_DM(newdm)()             # <<<<<<<<<<<<<<
 *         dm.dm = newdm
 *         return dm
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_4 = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1630
 *         CHKERR(DMConvert(self.dm, cval, &newdm))
 *         cdef DM dm = <DM>subtype_DM(newdm)()
 *         dm.dm = newdm             # <<<<<<<<<<<<<<
 *         return dm
 * 
*/
  __pyx_v_dm->dm = __pyx_v_newdm;

  /* "petsc4py/PETSc/DM.pyx":1631
 *         cdef DM 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":1610
 *         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_XDECREF(__pyx_t_4);
  __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":1633
 *         return dm
 * 
 *     def refine(self, comm: Comm | None = None) -> DM:             # <<<<<<<<<<<<<<
 *         """Return a refined `DM` object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_169refine(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_168refine, "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:1633");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_169refine = {"refine", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_169refine, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_168refine};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_169refine(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1633, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "refine", 0) < (0)) __PYX_ERR(54, 1633, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1633, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("refine", 0, 0, 1, __pyx_nargs); __PYX_ERR(54, 1633, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_168refine(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_comm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_168refine(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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("refine", 0);

  /* "petsc4py/PETSc/DM.pyx":1648
 * 
 *         """
 *         cdef MPI_Comm dmcomm = MPI_COMM_NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.dm, &dmcomm))
 *         dmcomm = def_Comm(comm, dmcomm)
*/
  __pyx_v_dmcomm = MPI_COMM_NULL;

  /* "petsc4py/PETSc/DM.pyx":1649
 *         """
 *         cdef MPI_Comm dmcomm = MPI_COMM_NULL
 *         CHKERR(PetscObjectGetComm(<PetscObject>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, 1649, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1650
 *         cdef MPI_Comm dmcomm = MPI_COMM_NULL
 *         CHKERR(PetscObjectGetComm(<PetscObject>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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(54, 1650, __pyx_L1_error)
  __pyx_v_dmcomm = __pyx_t_2;

  /* "petsc4py/PETSc/DM.pyx":1651
 *         CHKERR(PetscObjectGetComm(<PetscObject>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":1652
 *         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, 1652, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1653
 *         cdef PetscDM newdm = NULL
 *         CHKERR(DMRefine(self.dm, dmcomm, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()             # <<<<<<<<<<<<<<
 *         dm.dm = newdm
 *         return dm
*/
  __pyx_t_4 = NULL;
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1653, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 1653, __pyx_L1_error)
  __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DM.pyx":1654
 *         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":1655
 *         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":1633
 *         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_XDECREF(__pyx_t_5);
  __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":1657
 *         return dm
 * 
 *     def coarsen(self, comm: Comm | None = None) -> DM:             # <<<<<<<<<<<<<<
 *         """Return a coarsened `DM` object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_171coarsen(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_170coarsen, "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:1657");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_171coarsen = {"coarsen", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_171coarsen, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_170coarsen};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_171coarsen(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1657, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1657, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "coarsen", 0) < (0)) __PYX_ERR(54, 1657, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1657, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("coarsen", 0, 0, 1, __pyx_nargs); __PYX_ERR(54, 1657, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_170coarsen(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_comm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_170coarsen(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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coarsen", 0);

  /* "petsc4py/PETSc/DM.pyx":1672
 * 
 *         """
 *         cdef MPI_Comm dmcomm = MPI_COMM_NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.dm, &dmcomm))
 *         dmcomm = def_Comm(comm, dmcomm)
*/
  __pyx_v_dmcomm = MPI_COMM_NULL;

  /* "petsc4py/PETSc/DM.pyx":1673
 *         """
 *         cdef MPI_Comm dmcomm = MPI_COMM_NULL
 *         CHKERR(PetscObjectGetComm(<PetscObject>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, 1673, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1674
 *         cdef MPI_Comm dmcomm = MPI_COMM_NULL
 *         CHKERR(PetscObjectGetComm(<PetscObject>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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(54, 1674, __pyx_L1_error)
  __pyx_v_dmcomm = __pyx_t_2;

  /* "petsc4py/PETSc/DM.pyx":1675
 *         CHKERR(PetscObjectGetComm(<PetscObject>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":1676
 *         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, 1676, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1677
 *         cdef PetscDM newdm = NULL
 *         CHKERR(DMCoarsen(self.dm, dmcomm, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()             # <<<<<<<<<<<<<<
 *         dm.dm = newdm
 *         return dm
*/
  __pyx_t_4 = NULL;
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 1677, __pyx_L1_error)
  __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DM.pyx":1678
 *         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":1679
 *         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":1657
 *         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_XDECREF(__pyx_t_5);
  __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":1681
 *         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_173refineHierarchy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_172refineHierarchy, "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:1681");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_173refineHierarchy = {"refineHierarchy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_173refineHierarchy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_172refineHierarchy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_173refineHierarchy(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nlevels,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1681, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1681, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "refineHierarchy", 0) < (0)) __PYX_ERR(54, 1681, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("refineHierarchy", 1, 1, 1, i); __PYX_ERR(54, 1681, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1681, __pyx_L3_error)
    }
    __pyx_v_nlevels = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("refineHierarchy", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1681, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_172refineHierarchy(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_nlevels);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_172refineHierarchy(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_unused = 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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("refineHierarchy", 0);

  /* "petsc4py/PETSc/DM.pyx":1696
 * 
 *         """
 *         cdef PetscInt i, n = asInt(nlevels)             # <<<<<<<<<<<<<<
 *         cdef PetscDM *newdmf = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&newdmf)
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nlevels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 1696, __pyx_L1_error)
  __pyx_v_n = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":1697
 *         """
 *         cdef PetscInt i, n = asInt(nlevels)
 *         cdef PetscDM *newdmf = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&newdmf)
 *         CHKERR(DMRefineHierarchy(self.dm, n, newdmf))
*/
  __pyx_v_newdmf = NULL;

  /* "petsc4py/PETSc/DM.pyx":1698
 *         cdef PetscInt i, n = asInt(nlevels)
 *         cdef PetscDM *newdmf = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&newdmf)             # <<<<<<<<<<<<<<
 *         CHKERR(DMRefineHierarchy(self.dm, n, newdmf))
 *         cdef DM dmf = None
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_n))); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1698, __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, 1698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DM.pyx":1699
 *         cdef PetscDM *newdmf = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&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, 1699, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1700
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&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":1701
 *         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, 1701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_hierarchy = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DM.pyx":1702
 *         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":1703
 *         cdef list hierarchy = []
 *         for i from 0 <= i < n:
 *             dmf = subtype_DM(newdmf[i])()             # <<<<<<<<<<<<<<
 *             dmf.dm = newdmf[i]
 *             hierarchy.append(dmf)
*/
    __pyx_t_2 = NULL;
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM((__pyx_v_newdmf[__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 1703, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_dmf, ((struct PyPetscDMObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/DM.pyx":1704
 *         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":1705
 *             dmf = subtype_DM(newdmf[i])()
 *             dmf.dm = newdmf[i]
 *             hierarchy.append(dmf)             # <<<<<<<<<<<<<<
 *         return hierarchy
 * 
*/
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_hierarchy, ((PyObject *)__pyx_v_dmf)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(54, 1705, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DM.pyx":1706
 *             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":1681
 *         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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("petsc4py.PETSc.DM.refineHierarchy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF((PyObject *)__pyx_v_dmf);
  __Pyx_XDECREF(__pyx_v_hierarchy);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DM.pyx":1708
 *         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_175coarsenHierarchy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_174coarsenHierarchy, "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:1708");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_175coarsenHierarchy = {"coarsenHierarchy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_175coarsenHierarchy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_174coarsenHierarchy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_175coarsenHierarchy(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nlevels,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1708, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1708, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "coarsenHierarchy", 0) < (0)) __PYX_ERR(54, 1708, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("coarsenHierarchy", 1, 1, 1, i); __PYX_ERR(54, 1708, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1708, __pyx_L3_error)
    }
    __pyx_v_nlevels = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("coarsenHierarchy", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1708, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_174coarsenHierarchy(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_nlevels);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_174coarsenHierarchy(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_unused = 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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("coarsenHierarchy", 0);

  /* "petsc4py/PETSc/DM.pyx":1723
 * 
 *         """
 *         cdef PetscInt i, n = asInt(nlevels)             # <<<<<<<<<<<<<<
 *         cdef PetscDM *newdmc = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&newdmc)
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_nlevels); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(54, 1723, __pyx_L1_error)
  __pyx_v_n = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":1724
 *         """
 *         cdef PetscInt i, n = asInt(nlevels)
 *         cdef PetscDM *newdmc = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&newdmc)
 *         CHKERR(DMCoarsenHierarchy(self.dm, n, newdmc))
*/
  __pyx_v_newdmc = NULL;

  /* "petsc4py/PETSc/DM.pyx":1725
 *         cdef PetscInt i, n = asInt(nlevels)
 *         cdef PetscDM *newdmc = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&newdmc)             # <<<<<<<<<<<<<<
 *         CHKERR(DMCoarsenHierarchy(self.dm, n, newdmc))
 *         cdef DM dmc = None
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_n))); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 1725, __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, 1725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DM.pyx":1726
 *         cdef PetscDM *newdmc = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&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, 1726, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1727
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&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":1728
 *         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, 1728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_hierarchy = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DM.pyx":1729
 *         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":1730
 *         cdef list hierarchy = []
 *         for i from 0 <= i < n:
 *             dmc = subtype_DM(newdmc[i])()             # <<<<<<<<<<<<<<
 *             dmc.dm = newdmc[i]
 *             hierarchy.append(dmc)
*/
    __pyx_t_2 = NULL;
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM((__pyx_v_newdmc[__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(54, 1730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 1730, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_dmc, ((struct PyPetscDMObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/DM.pyx":1731
 *         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":1732
 *             dmc = subtype_DM(newdmc[i])()
 *             dmc.dm = newdmc[i]
 *             hierarchy.append(dmc)             # <<<<<<<<<<<<<<
 *         return hierarchy
 * 
*/
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_hierarchy, ((PyObject *)__pyx_v_dmc)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(54, 1732, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DM.pyx":1733
 *             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":1708
 *         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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("petsc4py.PETSc.DM.coarsenHierarchy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF((PyObject *)__pyx_v_dmc);
  __Pyx_XDECREF(__pyx_v_hierarchy);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DM.pyx":1735
 *         return hierarchy
 * 
 *     def getRefineLevel(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the refinement level.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_177getRefineLevel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_176getRefineLevel, "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:1735");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_177getRefineLevel = {"getRefineLevel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_177getRefineLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_176getRefineLevel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_177getRefineLevel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getRefineLevel", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_176getRefineLevel(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_176getRefineLevel(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", 0);

  /* "petsc4py/PETSc/DM.pyx":1745
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetRefineLevel(self.dm, &n))
 *         return toInt(n)
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/DM.pyx":1746
 *         """
 *         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, 1746, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1747
 *         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, 1747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":1735
 *         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":1749
 *         return toInt(n)
 * 
 *     def setRefineLevel(self, level: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of refinements.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_179setRefineLevel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_178setRefineLevel, "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:1749");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_179setRefineLevel = {"setRefineLevel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_179setRefineLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_178setRefineLevel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_179setRefineLevel(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_level,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1749, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1749, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRefineLevel", 0) < (0)) __PYX_ERR(54, 1749, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setRefineLevel", 1, 1, 1, i); __PYX_ERR(54, 1749, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1749, __pyx_L3_error)
    }
    __pyx_v_level = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setRefineLevel", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1749, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_178setRefineLevel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_level);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_178setRefineLevel(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", 0);

  /* "petsc4py/PETSc/DM.pyx":1764
 * 
 *         """
 *         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, 1764, __pyx_L1_error)
  __pyx_v_clevel = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":1765
 *         """
 *         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, 1765, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1749
 *         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":1767
 *         CHKERR(DMSetRefineLevel(self.dm, clevel))
 * 
 *     def getCoarsenLevel(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of coarsenings.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_181getCoarsenLevel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_180getCoarsenLevel, "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:1767");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_181getCoarsenLevel = {"getCoarsenLevel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_181getCoarsenLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_180getCoarsenLevel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_181getCoarsenLevel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCoarsenLevel", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_180getCoarsenLevel(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_180getCoarsenLevel(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", 0);

  /* "petsc4py/PETSc/DM.pyx":1777
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetCoarsenLevel(self.dm, &n))
 *         return toInt(n)
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/DM.pyx":1778
 *         """
 *         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, 1778, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1779
 *         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, 1779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":1767
 *         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":1783
 *     #
 * 
 *     def adaptLabel(self, label: str) -> DM:             # <<<<<<<<<<<<<<
 *         """Adapt a `DM` based on a `DMLabel`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_183adaptLabel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_182adaptLabel, "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:1783");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_183adaptLabel = {"adaptLabel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_183adaptLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_182adaptLabel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_183adaptLabel(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_label,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1783, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1783, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "adaptLabel", 0) < (0)) __PYX_ERR(54, 1783, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("adaptLabel", 1, 1, 1, i); __PYX_ERR(54, 1783, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1783, __pyx_L3_error)
    }
    __pyx_v_label = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("adaptLabel", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1783, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_182adaptLabel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_label);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_182adaptLabel(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  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":1798
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscDMLabel clbl = NULL
 *         label = str2bytes(label, &cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DM.pyx":1799
 *         """
 *         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":1800
 *         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, 1800, __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":1801
 *         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, 1801, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1802
 *         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_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1802, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_newdm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1803
 *         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, 1803, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1804
 *         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":1783
 *     #
 * 
 *     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_XDECREF(__pyx_t_3);
  __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":1806
 *         return newdm
 * 
 *     def adaptMetric(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec metric,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_185adaptMetric(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_184adaptMetric, "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        Collective.\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:1806");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_185adaptMetric = {"adaptMetric", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_185adaptMetric, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_184adaptMetric};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_185adaptMetric(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_metric,&__pyx_mstate_global->__pyx_n_u_bdLabel,&__pyx_mstate_global->__pyx_n_u_rgLabel,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1806, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 1806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 1806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "adaptMetric", 0) < (0)) __PYX_ERR(54, 1806, __pyx_L3_error)

      /* "petsc4py/PETSc/DM.pyx":1809
 *         self,
 *         Vec metric,
 *         bdLabel: str | None = None,             # <<<<<<<<<<<<<<
 *         rgLabel: str | None = None) -> DM:
 *         """Return a mesh adapted to the specified metric field.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DM.pyx":1810
 *         Vec metric,
 *         bdLabel: str | None = None,
 *         rgLabel: str | None = None) -> DM:             # <<<<<<<<<<<<<<
 *         """Return a mesh adapted to the specified metric field.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("adaptMetric", 0, 1, 3, i); __PYX_ERR(54, 1806, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 1806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 1806, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1806, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DM.pyx":1809
 *         self,
 *         Vec metric,
 *         bdLabel: str | None = None,             # <<<<<<<<<<<<<<
 *         rgLabel: str | None = None) -> DM:
 *         """Return a mesh adapted to the specified metric field.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DM.pyx":1810
 *         Vec metric,
 *         bdLabel: str | None = None,
 *         rgLabel: str | None = None) -> DM:             # <<<<<<<<<<<<<<
 *         """Return a mesh adapted to the specified metric field.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1806, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric", 0))) __PYX_ERR(54, 1808, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_184adaptMetric(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_metric, __pyx_v_bdLabel, __pyx_v_rgLabel);

  /* "petsc4py/PETSc/DM.pyx":1806
 *         return newdm
 * 
 *     def adaptMetric(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec metric,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_184adaptMetric(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  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":1829
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscDMLabel cbdlbl = NULL
 *         cdef PetscDMLabel crglbl = NULL
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DM.pyx":1830
 *         """
 *         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":1831
 *         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":1832
 *         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, 1832, __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":1833
 *         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 = __pyx_k__7;
  }

  /* "petsc4py/PETSc/DM.pyx":1834
 *         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, 1834, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1835
 *         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, 1835, __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":1836
 *         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 = __pyx_k__7;
  }

  /* "petsc4py/PETSc/DM.pyx":1837
 *         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, 1837, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1838
 *         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_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1838, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_newdm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1839
 *         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, 1839, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1840
 *         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":1806
 *         return newdm
 * 
 *     def adaptMetric(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec metric,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __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":1842
 *         return newdm
 * 
 *     def getLabel(self, name: str) -> DMLabel:             # <<<<<<<<<<<<<<
 *         """Return the label of a given name.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_187getLabel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_186getLabel, "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:1842");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_187getLabel = {"getLabel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_187getLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_186getLabel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_187getLabel(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1842, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1842, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getLabel", 0) < (0)) __PYX_ERR(54, 1842, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getLabel", 1, 1, 1, i); __PYX_ERR(54, 1842, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1842, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getLabel", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 1842, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_186getLabel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_186getLabel(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  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":1852
 * 
 *         """
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         cdef DMLabel dmlabel = DMLabel()
 *         name = str2bytes(name, &cname)
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/DM.pyx":1853
 *         """
 *         cdef const char *cname = NULL
 *         cdef DMLabel dmlabel = DMLabel()             # <<<<<<<<<<<<<<
 *         name = str2bytes(name, &cname)
 *         CHKERR(DMGetLabel(self.dm, cname, &dmlabel.dmlabel))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1853, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_dmlabel = ((struct PyPetscDMLabelObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1854
 *         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, 1854, __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":1855
 *         cdef DMLabel dmlabel = DMLabel()
 *         name = str2bytes(name, &cname)
 *         CHKERR(DMGetLabel(self.dm, cname, &dmlabel.dmlabel))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(dmlabel.obj))
 *         return dmlabel
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabel(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_dmlabel->dmlabel))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1855, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1856
 *         name = str2bytes(name, &cname)
 *         CHKERR(DMGetLabel(self.dm, cname, &dmlabel.dmlabel))
 *         CHKERR(PetscINCREF(dmlabel.obj))             # <<<<<<<<<<<<<<
 *         return dmlabel
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_dmlabel->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1856, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1857
 *         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":1842
 *         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_XDECREF(__pyx_t_2);
  __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":1861
 *     #
 * 
 *     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_189setLocalSection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_188setLocalSection, "DM.setLocalSection(self, sec: Section) -> None\nSet the `Section` encoding the local data layout for the `DM`.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMSetLocalSection\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1861");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_189setLocalSection = {"setLocalSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_189setLocalSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_188setLocalSection};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_189setLocalSection(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1861, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1861, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLocalSection", 0) < (0)) __PYX_ERR(54, 1861, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLocalSection", 1, 1, 1, i); __PYX_ERR(54, 1861, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1861, __pyx_L3_error)
    }
    __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, 1861, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(54, 1861, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_188setLocalSection(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_sec);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_188setLocalSection(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", 0);

  /* "petsc4py/PETSc/DM.pyx":1871
 * 
 *         """
 *         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, 1871, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1861
 *     #
 * 
 *     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":1873
 *         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_191getLocalSection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_190getLocalSection, "DM.getLocalSection(self) -> Section\nReturn the `Section` encoding the local data layout for the `DM`.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.DMGetGlobalSection\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1873");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_191getLocalSection = {"getLocalSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_191getLocalSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_190getLocalSection};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_191getLocalSection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLocalSection", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_190getLocalSection(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_190getLocalSection(struct PyPetscDMObject *__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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLocalSection", 0);

  /* "petsc4py/PETSc/DM.pyx":1883
 * 
 *         """
 *         cdef Section sec = Section()             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetLocalSection(self.dm, &sec.sec))
 *         CHKERR(PetscINCREF(sec.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1883, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1884
 *         """
 *         cdef Section sec = Section()
 *         CHKERR(DMGetLocalSection(self.dm, &sec.sec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(sec.obj))
 *         return sec
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLocalSection(__pyx_v_self->dm, (&__pyx_v_sec->sec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1884, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1885
 *         cdef Section sec = Section()
 *         CHKERR(DMGetLocalSection(self.dm, &sec.sec))
 *         CHKERR(PetscINCREF(sec.obj))             # <<<<<<<<<<<<<<
 *         return sec
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sec->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1885, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1886
 *         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":1873
 *         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_XDECREF(__pyx_t_2);
  __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":1888
 *         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_193setGlobalSection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_192setGlobalSection, "DM.setGlobalSection(self, sec: Section) -> None\nSet the `Section` encoding the global data layout for the `DM`.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMSetGlobalSection\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1888");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_193setGlobalSection = {"setGlobalSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_193setGlobalSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_192setGlobalSection};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_193setGlobalSection(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1888, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1888, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setGlobalSection", 0) < (0)) __PYX_ERR(54, 1888, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setGlobalSection", 1, 1, 1, i); __PYX_ERR(54, 1888, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1888, __pyx_L3_error)
    }
    __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, 1888, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(54, 1888, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_192setGlobalSection(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_sec);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_192setGlobalSection(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", 0);

  /* "petsc4py/PETSc/DM.pyx":1898
 * 
 *         """
 *         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, 1898, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1888
 *         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":1900
 *         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_195getGlobalSection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_194getGlobalSection, "DM.getGlobalSection(self) -> Section\nReturn the `Section` encoding the global data layout for the `DM`.\n\n        Collective the first time it is called.\n\n        See Also\n        --------\n        petsc.DMGetGlobalSection\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1900");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_195getGlobalSection = {"getGlobalSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_195getGlobalSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_194getGlobalSection};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_195getGlobalSection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getGlobalSection", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_194getGlobalSection(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_194getGlobalSection(struct PyPetscDMObject *__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;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getGlobalSection", 0);

  /* "petsc4py/PETSc/DM.pyx":1910
 * 
 *         """
 *         cdef Section sec = Section()             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetGlobalSection(self.dm, &sec.sec))
 *         CHKERR(PetscINCREF(sec.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1910, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1911
 *         """
 *         cdef Section sec = Section()
 *         CHKERR(DMGetGlobalSection(self.dm, &sec.sec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(sec.obj))
 *         return sec
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetGlobalSection(__pyx_v_self->dm, (&__pyx_v_sec->sec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1911, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1912
 *         cdef Section sec = Section()
 *         CHKERR(DMGetGlobalSection(self.dm, &sec.sec))
 *         CHKERR(PetscINCREF(sec.obj))             # <<<<<<<<<<<<<<
 *         return sec
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sec->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1912, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1913
 *         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":1900
 *         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_XDECREF(__pyx_t_2);
  __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":1924
 *     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_197createSectionSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_196createSectionSF, "DM.createSectionSF(self, localsec: Section, globalsec: Section) -> None\nCreate the `SF` encoding the parallel DOF overlap for the `DM`.\n\n        Collective.\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:1924");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_197createSectionSF = {"createSectionSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_197createSectionSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_196createSectionSF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_197createSectionSF(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_localsec,&__pyx_mstate_global->__pyx_n_u_globalsec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1924, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 1924, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1924, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createSectionSF", 0) < (0)) __PYX_ERR(54, 1924, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createSectionSF", 1, 2, 2, i); __PYX_ERR(54, 1924, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1924, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 1924, __pyx_L3_error)
    }
    __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, 1924, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 0, "localsec", 0))) __PYX_ERR(54, 1924, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_globalsec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 0, "globalsec", 0))) __PYX_ERR(54, 1924, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_196createSectionSF(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_localsec, __pyx_v_globalsec);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_196createSectionSF(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", 0);

  /* "petsc4py/PETSc/DM.pyx":1945
 * 
 *         """
 *         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, 1945, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1924
 *     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":1947
 *         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_199getSectionSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_198getSectionSF, "DM.getSectionSF(self) -> SF\nReturn the `Section` encoding the parallel DOF overlap.\n\n        Collective the first time it is called.\n\n        See Also\n        --------\n        petsc.DMGetSectionSF\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1947");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_199getSectionSF = {"getSectionSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_199getSectionSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_198getSectionSF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_199getSectionSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSectionSF", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_198getSectionSF(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_198getSectionSF(struct PyPetscDMObject *__pyx_v_self) {
  struct PyPetscSFObject *__pyx_v_sf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getSectionSF", 0);

  /* "petsc4py/PETSc/DM.pyx":1957
 * 
 *         """
 *         cdef SF sf = SF()             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetSectionSF(self.dm, &sf.sf))
 *         CHKERR(PetscINCREF(sf.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1957, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1958
 *         """
 *         cdef SF sf = SF()
 *         CHKERR(DMGetSectionSF(self.dm, &sf.sf))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(sf.obj))
 *         return sf
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetSectionSF(__pyx_v_self->dm, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1958, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1959
 *         cdef SF sf = SF()
 *         CHKERR(DMGetSectionSF(self.dm, &sf.sf))
 *         CHKERR(PetscINCREF(sf.obj))             # <<<<<<<<<<<<<<
 *         return sf
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sf->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1959, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1960
 *         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":1947
 *         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_XDECREF(__pyx_t_2);
  __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":1962
 *         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_201setSectionSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_200setSectionSF, "DM.setSectionSF(self, sf: SF) -> None\nSet the `Section` encoding the parallel DOF overlap for the `DM`.\n\n        Logically collective.\n\n        See Also\n        --------\n        petsc.DMSetSectionSF\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1962");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_201setSectionSF = {"setSectionSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_201setSectionSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_200setSectionSF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_201setSectionSF(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1962, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1962, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSectionSF", 0) < (0)) __PYX_ERR(54, 1962, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSectionSF", 1, 1, 1, i); __PYX_ERR(54, 1962, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1962, __pyx_L3_error)
    }
    __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, 1962, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(54, 1962, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_200setSectionSF(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_sf);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_200setSectionSF(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", 0);

  /* "petsc4py/PETSc/DM.pyx":1972
 * 
 *         """
 *         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, 1972, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1962
 *         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":1978
 *     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_203getPointSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_202getPointSF, "DM.getPointSF(self) -> SF\nReturn the `SF` encoding the parallel DOF overlap for the `DM`.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.DMGetPointSF\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1978");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_203getPointSF = {"getPointSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_203getPointSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_202getPointSF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_203getPointSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPointSF", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_202getPointSF(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_202getPointSF(struct PyPetscDMObject *__pyx_v_self) {
  struct PyPetscSFObject *__pyx_v_sf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getPointSF", 0);

  /* "petsc4py/PETSc/DM.pyx":1988
 * 
 *         """
 *         cdef SF sf = SF()             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetPointSF(self.dm, &sf.sf))
 *         CHKERR(PetscINCREF(sf.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 1988, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":1989
 *         """
 *         cdef SF sf = SF()
 *         CHKERR(DMGetPointSF(self.dm, &sf.sf))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(sf.obj))
 *         return sf
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetPointSF(__pyx_v_self->dm, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1989, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1990
 *         cdef SF sf = SF()
 *         CHKERR(DMGetPointSF(self.dm, &sf.sf))
 *         CHKERR(PetscINCREF(sf.obj))             # <<<<<<<<<<<<<<
 *         return sf
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sf->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 1990, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1991
 *         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":1978
 *     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_XDECREF(__pyx_t_2);
  __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":1993
 *         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_205setPointSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_204setPointSF, "DM.setPointSF(self, sf: SF) -> None\nSet the `SF` encoding the parallel DOF overlap for the `DM`.\n\n        Logically collective.\n\n        See Also\n        --------\n        petsc.DMSetPointSF\n\n        \nSource code at petsc4py/PETSc/DM.pyx:1993");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_205setPointSF = {"setPointSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_205setPointSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_204setPointSF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_205setPointSF(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 1993, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1993, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPointSF", 0) < (0)) __PYX_ERR(54, 1993, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPointSF", 1, 1, 1, i); __PYX_ERR(54, 1993, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 1993, __pyx_L3_error)
    }
    __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, 1993, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(54, 1993, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_204setPointSF(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_sf);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_204setPointSF(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", 0);

  /* "petsc4py/PETSc/DM.pyx":2003
 * 
 *         """
 *         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, 2003, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":1993
 *         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":2005
 *         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_207getNumLabels(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_206getNumLabels, "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:2005");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_207getNumLabels = {"getNumLabels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_207getNumLabels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_206getNumLabels};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_207getNumLabels(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNumLabels", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_206getNumLabels(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_206getNumLabels(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", 0);

  /* "petsc4py/PETSc/DM.pyx":2015
 * 
 *         """
 *         cdef PetscInt nLabels = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetNumLabels(self.dm, &nLabels))
 *         return toInt(nLabels)
*/
  __pyx_v_nLabels = 0;

  /* "petsc4py/PETSc/DM.pyx":2016
 *         """
 *         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, 2016, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2017
 *         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, 2017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":2005
 *         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":2019
 *         return toInt(nLabels)
 * 
 *     def getLabelName(self, index: int) -> str:             # <<<<<<<<<<<<<<
 *         """Return the name of nth label.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_209getLabelName(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_208getLabelName, "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:2019");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_209getLabelName = {"getLabelName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_209getLabelName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_208getLabelName};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_209getLabelName(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_index,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2019, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2019, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getLabelName", 0) < (0)) __PYX_ERR(54, 2019, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getLabelName", 1, 1, 1, i); __PYX_ERR(54, 2019, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2019, __pyx_L3_error)
    }
    __pyx_v_index = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getLabelName", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 2019, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_208getLabelName(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_index);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_208getLabelName(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", 0);

  /* "petsc4py/PETSc/DM.pyx":2034
 * 
 *         """
 *         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, 2034, __pyx_L1_error)
  __pyx_v_cindex = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":2035
 *         """
 *         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":2036
 *         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, 2036, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2037
 *         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, 2037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":2019
 *         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":2039
 *         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_211hasLabel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_210hasLabel, "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:2039");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_211hasLabel = {"hasLabel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_211hasLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_210hasLabel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_211hasLabel(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2039, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2039, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "hasLabel", 0) < (0)) __PYX_ERR(54, 2039, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("hasLabel", 1, 1, 1, i); __PYX_ERR(54, 2039, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2039, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("hasLabel", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 2039, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_210hasLabel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_210hasLabel(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":2054
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         cdef const char *cname = NULL
 *         name = str2bytes(name, &cname)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/DM.pyx":2055
 *         """
 *         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":2056
 *         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, 2056, __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":2057
 *         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, 2057, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2058
 *         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, 2058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":2039
 *         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":2060
 *         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_213createLabel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_212createLabel, "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:2060");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_213createLabel = {"createLabel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_213createLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_212createLabel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_213createLabel(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2060, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2060, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createLabel", 0) < (0)) __PYX_ERR(54, 2060, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createLabel", 1, 1, 1, i); __PYX_ERR(54, 2060, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2060, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createLabel", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 2060, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_212createLabel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_212createLabel(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":2075
 * 
 *         """
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         name = str2bytes(name, &cname)
 *         CHKERR(DMCreateLabel(self.dm, cname))
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/DM.pyx":2076
 *         """
 *         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, 2076, __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":2077
 *         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, 2077, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2060
 *         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":2079
 *         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_215removeLabel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_214removeLabel, "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:2079");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_215removeLabel = {"removeLabel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_215removeLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_214removeLabel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_215removeLabel(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2079, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2079, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "removeLabel", 0) < (0)) __PYX_ERR(54, 2079, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("removeLabel", 1, 1, 1, i); __PYX_ERR(54, 2079, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2079, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("removeLabel", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 2079, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_214removeLabel(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_214removeLabel(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":2094
 * 
 *         """
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscDMLabel clbl = NULL
 *         name = str2bytes(name, &cname)
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/DM.pyx":2095
 *         """
 *         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":2096
 *         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, 2096, __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":2097
 *         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, 2097, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2099
 *         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, 2099, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2079
 *         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":2101
 *         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_217getLabelValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_216getLabelValue, "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:2101");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_217getLabelValue = {"getLabelValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_217getLabelValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_216getLabelValue};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_217getLabelValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_point,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2101, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2101, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getLabelValue", 0) < (0)) __PYX_ERR(54, 2101, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getLabelValue", 1, 2, 2, i); __PYX_ERR(54, 2101, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2101, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2101, __pyx_L3_error)
    }
    __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, 2101, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_216getLabelValue(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_point);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_216getLabelValue(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":2118
 * 
 *         """
 *         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, 2118, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;
  __pyx_v_value = 0;

  /* "petsc4py/PETSc/DM.pyx":2119
 *         """
 *         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":2120
 *         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, 2120, __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":2121
 *         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, 2121, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2122
 *         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, 2122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":2101
 *         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":2124
 *         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_219setLabelValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_218setLabelValue, "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:2124");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_219setLabelValue = {"setLabelValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_219setLabelValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_218setLabelValue};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_219setLabelValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2124, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 2124, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2124, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2124, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLabelValue", 0) < (0)) __PYX_ERR(54, 2124, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLabelValue", 1, 3, 3, i); __PYX_ERR(54, 2124, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2124, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2124, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 2124, __pyx_L3_error)
    }
    __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, 2124, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_218setLabelValue(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_point, __pyx_v_value);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_218setLabelValue(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":2143
 * 
 *         """
 *         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, 2143, __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, 2143, __pyx_L1_error)
  __pyx_v_cvalue = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":2144
 *         """
 *         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":2145
 *         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, 2145, __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":2146
 *         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, 2146, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2124
 *         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":2148
 *         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_221clearLabelValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_220clearLabelValue, "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:2148");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_221clearLabelValue = {"clearLabelValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_221clearLabelValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_220clearLabelValue};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_221clearLabelValue(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2148, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 2148, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2148, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2148, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "clearLabelValue", 0) < (0)) __PYX_ERR(54, 2148, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("clearLabelValue", 1, 3, 3, i); __PYX_ERR(54, 2148, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2148, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2148, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 2148, __pyx_L3_error)
    }
    __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, 2148, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_220clearLabelValue(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_point, __pyx_v_value);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_220clearLabelValue(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":2167
 * 
 *         """
 *         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, 2167, __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, 2167, __pyx_L1_error)
  __pyx_v_cvalue = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":2168
 *         """
 *         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":2169
 *         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, 2169, __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":2170
 *         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, 2170, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2148
 *         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":2172
 *         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_223getLabelSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_222getLabelSize, "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:2172");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_223getLabelSize = {"getLabelSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_223getLabelSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_222getLabelSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_223getLabelSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2172, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2172, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getLabelSize", 0) < (0)) __PYX_ERR(54, 2172, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getLabelSize", 1, 1, 1, i); __PYX_ERR(54, 2172, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2172, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getLabelSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 2172, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_222getLabelSize(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_222getLabelSize(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":2187
 * 
 *         """
 *         cdef PetscInt size = 0             # <<<<<<<<<<<<<<
 *         cdef const char *cname = NULL
 *         name = str2bytes(name, &cname)
*/
  __pyx_v_size = 0;

  /* "petsc4py/PETSc/DM.pyx":2188
 *         """
 *         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":2189
 *         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, 2189, __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":2190
 *         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, 2190, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2191
 *         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, 2191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":2172
 *         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":2193
 *         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_225getLabelIdIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_224getLabelIdIS, "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:2193");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_225getLabelIdIS = {"getLabelIdIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_225getLabelIdIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_224getLabelIdIS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_225getLabelIdIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2193, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getLabelIdIS", 0) < (0)) __PYX_ERR(54, 2193, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getLabelIdIS", 1, 1, 1, i); __PYX_ERR(54, 2193, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2193, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getLabelIdIS", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 2193, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_224getLabelIdIS(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_224getLabelIdIS(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  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":2208
 * 
 *         """
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         name = str2bytes(name, &cname)
 *         cdef IS lis = IS()
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/DM.pyx":2209
 *         """
 *         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, 2209, __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":2210
 *         cdef const char *cname = NULL
 *         name = str2bytes(name, &cname)
 *         cdef IS lis = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetLabelIdIS(self.dm, cname, &lis.iset))
 *         return lis
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 2210, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_lis = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":2211
 *         name = str2bytes(name, &cname)
 *         cdef IS lis = IS()
 *         CHKERR(DMGetLabelIdIS(self.dm, cname, &lis.iset))             # <<<<<<<<<<<<<<
 *         return lis
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabelIdIS(__pyx_v_self->dm, __pyx_v_cname, (&__pyx_v_lis->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2211, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2212
 *         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":2193
 *         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_XDECREF(__pyx_t_2);
  __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":2214
 *         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_227getStratumSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_226getStratumSize, "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:2214");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_227getStratumSize = {"getStratumSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_227getStratumSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_226getStratumSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_227getStratumSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2214, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2214, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getStratumSize", 0) < (0)) __PYX_ERR(54, 2214, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getStratumSize", 1, 2, 2, i); __PYX_ERR(54, 2214, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2214, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2214, __pyx_L3_error)
    }
    __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, 2214, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_226getStratumSize(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_226getStratumSize(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":2231
 * 
 *         """
 *         cdef PetscInt size = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt cvalue = asInt(value)
 *         cdef const char *cname = NULL
*/
  __pyx_v_size = 0;

  /* "petsc4py/PETSc/DM.pyx":2232
 *         """
 *         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, 2232, __pyx_L1_error)
  __pyx_v_cvalue = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":2233
 *         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":2234
 *         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, 2234, __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":2235
 *         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, 2235, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2236
 *         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, 2236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":2214
 *         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":2238
 *         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_229getStratumIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_228getStratumIS, "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:2238");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_229getStratumIS = {"getStratumIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_229getStratumIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_228getStratumIS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_229getStratumIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2238, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2238, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2238, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getStratumIS", 0) < (0)) __PYX_ERR(54, 2238, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getStratumIS", 1, 2, 2, i); __PYX_ERR(54, 2238, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2238, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2238, __pyx_L3_error)
    }
    __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, 2238, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_228getStratumIS(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_228getStratumIS(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  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":2255
 * 
 *         """
 *         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, 2255, __pyx_L1_error)
  __pyx_v_cvalue = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":2256
 *         """
 *         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":2257
 *         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, 2257, __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":2258
 *         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_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2258, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_sis = ((struct PyPetscISObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DM.pyx":2259
 *         name = str2bytes(name, &cname)
 *         cdef IS sis = IS()
 *         CHKERR(DMGetStratumIS(self.dm, cname, cvalue, &sis.iset))             # <<<<<<<<<<<<<<
 *         return sis
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetStratumIS(__pyx_v_self->dm, __pyx_v_cname, __pyx_v_cvalue, (&__pyx_v_sis->iset))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2259, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2260
 *         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":2238
 *         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_XDECREF(__pyx_t_3);
  __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":2262
 *         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_231clearLabelStratum(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_230clearLabelStratum, "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:2262");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_231clearLabelStratum = {"clearLabelStratum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_231clearLabelStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_230clearLabelStratum};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_231clearLabelStratum(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2262, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2262, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2262, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "clearLabelStratum", 0) < (0)) __PYX_ERR(54, 2262, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("clearLabelStratum", 1, 2, 2, i); __PYX_ERR(54, 2262, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2262, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2262, __pyx_L3_error)
    }
    __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, 2262, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_230clearLabelStratum(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_value);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_230clearLabelStratum(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":2279
 * 
 *         """
 *         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, 2279, __pyx_L1_error)
  __pyx_v_cvalue = __pyx_t_1;

  /* "petsc4py/PETSc/DM.pyx":2280
 *         """
 *         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":2281
 *         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, 2281, __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":2282
 *         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, 2282, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2262
 *         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":2284
 *         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_233setLabelOutput(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_232setLabelOutput, "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:2284");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_233setLabelOutput = {"setLabelOutput", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_233setLabelOutput, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_232setLabelOutput};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_233setLabelOutput(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_output,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2284, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2284, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2284, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLabelOutput", 0) < (0)) __PYX_ERR(54, 2284, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLabelOutput", 1, 2, 2, i); __PYX_ERR(54, 2284, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2284, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2284, __pyx_L3_error)
    }
    __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, 2284, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_232setLabelOutput(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name, __pyx_v_output);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_232setLabelOutput(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":2301
 * 
 *         """
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         name = str2bytes(name, &cname)
 *         cdef PetscBool coutput = output
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/DM.pyx":2302
 *         """
 *         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, 2302, __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":2303
 *         cdef const char *cname = NULL
 *         name = str2bytes(name, &cname)
 *         cdef PetscBool coutput = output             # <<<<<<<<<<<<<<
 *         CHKERR(DMSetLabelOutput(self.dm, cname, coutput))
 * 
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_output); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(54, 2303, __pyx_L1_error)
  __pyx_v_coutput = __pyx_t_2;

  /* "petsc4py/PETSc/DM.pyx":2304
 *         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, 2304, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2284
 *         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":2306
 *         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_235getLabelOutput(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_234getLabelOutput, "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:2306");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_235getLabelOutput = {"getLabelOutput", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_235getLabelOutput, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_234getLabelOutput};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_235getLabelOutput(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2306, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2306, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getLabelOutput", 0) < (0)) __PYX_ERR(54, 2306, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getLabelOutput", 1, 1, 1, i); __PYX_ERR(54, 2306, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2306, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getLabelOutput", 1, 1, 1, __pyx_nargs); __PYX_ERR(54, 2306, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_234getLabelOutput(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_234getLabelOutput(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":2321
 * 
 *         """
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         name = str2bytes(name, &cname)
 *         cdef PetscBool coutput = PETSC_FALSE
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/DM.pyx":2322
 *         """
 *         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, 2322, __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":2323
 *         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":2324
 *         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, 2324, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2325
 *         cdef PetscBool coutput = PETSC_FALSE
 *         CHKERR(DMGetLabelOutput(self.dm, cname, &coutput))
 *         return coutput             # <<<<<<<<<<<<<<
 * 
 *     # backward compatibility
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_coutput); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 2325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":2306
 *         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":2332
 *     getMatrix = createMatrix = createMat
 * 
 *     def setKSPComputeOperators(             # <<<<<<<<<<<<<<
 *         self, operators,
 *         args: tuple[Any, ...] | None = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_237setKSPComputeOperators(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_236setKSPComputeOperators, "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:2332");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_237setKSPComputeOperators = {"setKSPComputeOperators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_237setKSPComputeOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_236setKSPComputeOperators};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_237setKSPComputeOperators(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_operators,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2332, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 2332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setKSPComputeOperators", 0) < (0)) __PYX_ERR(54, 2332, __pyx_L3_error)

      /* "petsc4py/PETSc/DM.pyx":2334
 *     def setKSPComputeOperators(
 *         self, operators,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 *         """Matrix associated with the linear system.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DM.pyx":2335
 *         self, operators,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Matrix associated with the linear system.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setKSPComputeOperators", 0, 1, 3, i); __PYX_ERR(54, 2332, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 2332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2332, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2332, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DM.pyx":2334
 *     def setKSPComputeOperators(
 *         self, operators,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 *         """Matrix associated with the linear system.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DM.pyx":2335
 *         self, operators,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Matrix associated with the linear system.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2332, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_236setKSPComputeOperators(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_operators, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/DM.pyx":2332
 *     getMatrix = createMatrix = createMat
 * 
 *     def setKSPComputeOperators(             # <<<<<<<<<<<<<<
 *         self, operators,
 *         args: tuple[Any, ...] | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_236setKSPComputeOperators(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":2354
 * 
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/DM.pyx":2355
 *         """
 *         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, 2355, __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":2356
 *         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, <void*>context))
*/
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2356, __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) != (0)) __PYX_ERR(54, 2356, __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) != (0)) __PYX_ERR(54, 2356, __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) != (0)) __PYX_ERR(54, 2356, __pyx_L1_error);
  __pyx_v_context = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DM.pyx":2357
 *         if kargs is None: kargs = {}
 *         context = (operators, args, kargs)
 *         self.set_attr('__operators__', context)             # <<<<<<<<<<<<<<
 *         CHKERR(DMKSPSetComputeOperators(self.dm, KSP_ComputeOps, <void*>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, 2357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DM.pyx":2358
 *         context = (operators, args, kargs)
 *         self.set_attr('__operators__', context)
 *         CHKERR(DMKSPSetComputeOperators(self.dm, KSP_ComputeOps, <void*>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, 2358, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2332
 *     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":2360
 *         CHKERR(DMKSPSetComputeOperators(self.dm, KSP_ComputeOps, <void*>context))
 * 
 *     def createFieldDecomposition(self) -> tuple[list, list, list]:             # <<<<<<<<<<<<<<
 *         """Return field splitting information.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_239createFieldDecomposition(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_238createFieldDecomposition, "DM.createFieldDecomposition(self) -> tuple[list, list, list]\nReturn field splitting information.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMCreateFieldDecomposition\n\n        \nSource code at petsc4py/PETSc/DM.pyx:2360");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_239createFieldDecomposition = {"createFieldDecomposition", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_239createFieldDecomposition, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_238createFieldDecomposition};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_239createFieldDecomposition(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("createFieldDecomposition", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_2DM_238createFieldDecomposition(((struct PyPetscDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_238createFieldDecomposition(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_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_t_5;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createFieldDecomposition", 0);

  /* "petsc4py/PETSc/DM.pyx":2370
 * 
 *         """
 *         cdef PetscInt clen = 0             # <<<<<<<<<<<<<<
 *         cdef PetscIS *cis = NULL
 *         cdef PetscDM *cdm = NULL
*/
  __pyx_v_clen = 0;

  /* "petsc4py/PETSc/DM.pyx":2371
 *         """
 *         cdef PetscInt clen = 0
 *         cdef PetscIS *cis = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscDM *cdm = NULL
 *         cdef char** cnamelist = NULL
*/
  __pyx_v_cis = NULL;

  /* "petsc4py/PETSc/DM.pyx":2372
 *         cdef PetscInt clen = 0
 *         cdef PetscIS *cis = NULL
 *         cdef PetscDM *cdm = NULL             # <<<<<<<<<<<<<<
 *         cdef char** cnamelist = NULL
 * 
*/
  __pyx_v_cdm = NULL;

  /* "petsc4py/PETSc/DM.pyx":2373
 *         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":2375
 *         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, 2375, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2377
 *         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, 2377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_v_clen;
    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(54, 2377, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(54, 2377, __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":2378
 * 
 *         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, 2378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_dms = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DM.pyx":2379
 *         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, 2379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_names = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DM.pyx":2380
 *         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":2382
 *         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":2383
 * 
 *         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":2384
 *         for i from 0 <= i < clen:
 *             if cdm != NULL:
 *                 dm = subtype_DM(cdm[i])()             # <<<<<<<<<<<<<<
 *                 dm.dm = cdm[i]
 *                 CHKERR(PetscINCREF(dm.obj))
*/
      __pyx_t_4 = NULL;
      __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM((__pyx_v_cdm[__pyx_v_i]))); if (unlikely(!__pyx_t_6)) __PYX_ERR(54, 2384, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2384, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(54, 2384, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_dm, ((struct PyPetscDMObject *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "petsc4py/PETSc/DM.pyx":2385
 *             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":2386
 *                 dm = subtype_DM(cdm[i])()
 *                 dm.dm = cdm[i]
 *                 CHKERR(PetscINCREF(dm.obj))             # <<<<<<<<<<<<<<
 *                 dms.append(dm)
 *                 CHKERR(DMDestroy(&cdm[i]))
*/
      __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, 2386, __pyx_L1_error)

      /* "petsc4py/PETSc/DM.pyx":2387
 *                 dm.dm = cdm[i]
 *                 CHKERR(PetscINCREF(dm.obj))
 *                 dms.append(dm)             # <<<<<<<<<<<<<<
 *                 CHKERR(DMDestroy(&cdm[i]))
 *             else:
*/
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dms, ((PyObject *)__pyx_v_dm)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(54, 2387, __pyx_L1_error)

      /* "petsc4py/PETSc/DM.pyx":2388
 *                 CHKERR(PetscINCREF(dm.obj))
 *                 dms.append(dm)
 *                 CHKERR(DMDestroy(&cdm[i]))             # <<<<<<<<<<<<<<
 *             else:
 *                 dms.append(None)
*/
      __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, 2388, __pyx_L1_error)

      /* "petsc4py/PETSc/DM.pyx":2383
 * 
 *         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":2390
 *                 CHKERR(DMDestroy(&cdm[i]))
 *             else:
 *                 dms.append(None)             # <<<<<<<<<<<<<<
 * 
 *             if cnamelist != NULL:
*/
    /*else*/ {
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_dms, Py_None); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(54, 2390, __pyx_L1_error)
    }
    __pyx_L7:;

    /* "petsc4py/PETSc/DM.pyx":2392
 *                 dms.append(None)
 * 
 *             if cnamelist != NULL:             # <<<<<<<<<<<<<<
 *                 name = bytes2str(cnamelist[i])
 *                 names.append(name)
*/
    __pyx_t_5 = (__pyx_v_cnamelist != NULL);
    if (__pyx_t_5) {

      /* "petsc4py/PETSc/DM.pyx":2393
 * 
 *             if cnamelist != NULL:
 *                 name = bytes2str(cnamelist[i])             # <<<<<<<<<<<<<<
 *                 names.append(name)
 *                 CHKERR(PetscFree(cnamelist[i]))
*/
      __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str((__pyx_v_cnamelist[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2393, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "petsc4py/PETSc/DM.pyx":2394
 *             if cnamelist != NULL:
 *                 name = bytes2str(cnamelist[i])
 *                 names.append(name)             # <<<<<<<<<<<<<<
 *                 CHKERR(PetscFree(cnamelist[i]))
 *             else:
*/
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_names, __pyx_v_name); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(54, 2394, __pyx_L1_error)

      /* "petsc4py/PETSc/DM.pyx":2395
 *                 name = bytes2str(cnamelist[i])
 *                 names.append(name)
 *                 CHKERR(PetscFree(cnamelist[i]))             # <<<<<<<<<<<<<<
 *             else:
 *                 names.append(None)
*/
      __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, 2395, __pyx_L1_error)

      /* "petsc4py/PETSc/DM.pyx":2392
 *                 dms.append(None)
 * 
 *             if cnamelist != NULL:             # <<<<<<<<<<<<<<
 *                 name = bytes2str(cnamelist[i])
 *                 names.append(name)
*/
      goto __pyx_L8;
    }

    /* "petsc4py/PETSc/DM.pyx":2397
 *                 CHKERR(PetscFree(cnamelist[i]))
 *             else:
 *                 names.append(None)             # <<<<<<<<<<<<<<
 * 
 *             CHKERR(ISDestroy(&cis[i]))
*/
    /*else*/ {
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_names, Py_None); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(54, 2397, __pyx_L1_error)
    }
    __pyx_L8:;

    /* "petsc4py/PETSc/DM.pyx":2399
 *                 names.append(None)
 * 
 *             CHKERR(ISDestroy(&cis[i]))             # <<<<<<<<<<<<<<
 * 
 *         CHKERR(PetscFree(cis))
*/
    __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, 2399, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DM.pyx":2401
 *             CHKERR(ISDestroy(&cis[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, 2401, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2402
 * 
 *         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, 2402, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2403
 *         CHKERR(PetscFree(cis))
 *         CHKERR(PetscFree(cdm))
 *         CHKERR(PetscFree(cnamelist))             # <<<<<<<<<<<<<<
 * 
 *         return (names, isets, dms)
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscFree(__pyx_v_cnamelist)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(54, 2403, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2405
 *         CHKERR(PetscFree(cnamelist))
 * 
 *         return (names, isets, dms)             # <<<<<<<<<<<<<<
 * 
 *     def setSNESFunction(
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_names);
  __Pyx_GIVEREF(__pyx_v_names);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_names) != (0)) __PYX_ERR(54, 2405, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_isets);
  __Pyx_GIVEREF(__pyx_v_isets);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_isets) != (0)) __PYX_ERR(54, 2405, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_dms);
  __Pyx_GIVEREF(__pyx_v_dms);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_dms) != (0)) __PYX_ERR(54, 2405, __pyx_L1_error);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":2360
 *         CHKERR(DMKSPSetComputeOperators(self.dm, KSP_ComputeOps, <void*>context))
 * 
 *     def createFieldDecomposition(self) -> tuple[list, list, list]:             # <<<<<<<<<<<<<<
 *         """Return field splitting information.
 * 
*/

  /* 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.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":2407
 *         return (names, isets, dms)
 * 
 *     def setSNESFunction(             # <<<<<<<<<<<<<<
 *         self, function: SNESFunction,
 *         args: tuple[Any, ...] | None = None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_241setSNESFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_240setSNESFunction, "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:2407");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_241setSNESFunction = {"setSNESFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_241setSNESFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_240setSNESFunction};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_241setSNESFunction(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_function,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2407, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 2407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSNESFunction", 0) < (0)) __PYX_ERR(54, 2407, __pyx_L3_error)

      /* "petsc4py/PETSc/DM.pyx":2409
 *     def setSNESFunction(
 *         self, function: SNESFunction,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DM.pyx":2410
 *         self, function: SNESFunction,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 * 
 *         """Set `SNES` residual evaluation function.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSNESFunction", 0, 1, 3, i); __PYX_ERR(54, 2407, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 2407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2407, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DM.pyx":2409
 *     def setSNESFunction(
 *         self, function: SNESFunction,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 * 
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DM.pyx":2410
 *         self, function: SNESFunction,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 * 
 *         """Set `SNES` residual evaluation function.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2407, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_240setSNESFunction(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_function, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/DM.pyx":2407
 *         return (names, isets, dms)
 * 
 *     def setSNESFunction(             # <<<<<<<<<<<<<<
 *         self, function: SNESFunction,
 *         args: tuple[Any, ...] | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_240setSNESFunction(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":2430
 * 
 *         """
 *         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":2431
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DM.pyx":2432
 *         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, 2432, __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":2433
 *             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, <void*>context))
*/
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2433, __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) != (0)) __PYX_ERR(54, 2433, __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) != (0)) __PYX_ERR(54, 2433, __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) != (0)) __PYX_ERR(54, 2433, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DM.pyx":2434
 *             if kargs is None: kargs = {}
 *             context = (function, args, kargs)
 *             self.set_attr('__function__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(DMSNESSetFunction(self.dm, SNES_Function, <void*>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, 2434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DM.pyx":2435
 *             context = (function, args, kargs)
 *             self.set_attr('__function__', context)
 *             CHKERR(DMSNESSetFunction(self.dm, SNES_Function, <void*>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, 2435, __pyx_L1_error)

    /* "petsc4py/PETSc/DM.pyx":2430
 * 
 *         """
 *         if function is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DM.pyx":2437
 *             CHKERR(DMSNESSetFunction(self.dm, SNES_Function, <void*>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, 2437, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DM.pyx":2407
 *         return (names, isets, dms)
 * 
 *     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":2439
 *             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_243setSNESJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_242setSNESJacobian, "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:2439");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_243setSNESJacobian = {"setSNESJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_243setSNESJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_242setSNESJacobian};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_243setSNESJacobian(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_jacobian,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2439, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 2439, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2439, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2439, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSNESJacobian", 0) < (0)) __PYX_ERR(54, 2439, __pyx_L3_error)

      /* "petsc4py/PETSc/DM.pyx":2441
 *     def setSNESJacobian(
 *         self, jacobian: SNESJacobianFunction,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 *         """Set the `SNES` Jacobian evaluation function.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DM.pyx":2442
 *         self, jacobian: SNESJacobianFunction,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `SNES` Jacobian evaluation function.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSNESJacobian", 0, 1, 3, i); __PYX_ERR(54, 2439, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 2439, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2439, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2439, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DM.pyx":2441
 *     def setSNESJacobian(
 *         self, jacobian: SNESJacobianFunction,
 *         args: tuple[Any, ...] | None = None,             # <<<<<<<<<<<<<<
 *         kargs: dict[str, Any] | None = None) -> None:
 *         """Set the `SNES` Jacobian evaluation function.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DM.pyx":2442
 *         self, jacobian: SNESJacobianFunction,
 *         args: tuple[Any, ...] | None = None,
 *         kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `SNES` Jacobian evaluation function.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2439, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_242setSNESJacobian(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_jacobian, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/DM.pyx":2439
 *             CHKERR(DMSNESSetFunction(self.dm, NULL, NULL))
 * 
 *     def setSNESJacobian(             # <<<<<<<<<<<<<<
 *         self, jacobian: SNESJacobianFunction,
 *         args: tuple[Any, ...] | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_242setSNESJacobian(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":2461
 * 
 *         """
 *         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":2462
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DM.pyx":2463
 *         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, 2463, __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":2464
 *             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, <void*>context))
*/
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2464, __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) != (0)) __PYX_ERR(54, 2464, __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) != (0)) __PYX_ERR(54, 2464, __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) != (0)) __PYX_ERR(54, 2464, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DM.pyx":2465
 *             if kargs is None: kargs = {}
 *             context = (jacobian, args, kargs)
 *             self.set_attr('__jacobian__', context)             # <<<<<<<<<<<<<<
 *             CHKERR(DMSNESSetJacobian(self.dm, SNES_Jacobian, <void*>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, 2465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DM.pyx":2466
 *             context = (jacobian, args, kargs)
 *             self.set_attr('__jacobian__', context)
 *             CHKERR(DMSNESSetJacobian(self.dm, SNES_Jacobian, <void*>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, 2466, __pyx_L1_error)

    /* "petsc4py/PETSc/DM.pyx":2461
 * 
 *         """
 *         if jacobian is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DM.pyx":2468
 *             CHKERR(DMSNESSetJacobian(self.dm, SNES_Jacobian, <void*>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, 2468, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DM.pyx":2439
 *             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":2470
 *             CHKERR(DMSNESSetJacobian(self.dm, NULL, NULL))
 * 
 *     def addCoarsenHook(             # <<<<<<<<<<<<<<
 *         self,
 *         coarsenhook: DMCoarsenHookFunction,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_245addCoarsenHook(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_244addCoarsenHook, "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:2470");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DM_245addCoarsenHook = {"addCoarsenHook", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_245addCoarsenHook, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_244addCoarsenHook};
static PyObject *__pyx_pw_8petsc4py_5PETSc_2DM_245addCoarsenHook(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_coarsenhook,&__pyx_mstate_global->__pyx_n_u_restricthook,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(54, 2470, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(54, 2470, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 2470, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2470, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2470, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addCoarsenHook", 0) < (0)) __PYX_ERR(54, 2470, __pyx_L3_error)

      /* "petsc4py/PETSc/DM.pyx":2474
 *         coarsenhook: DMCoarsenHookFunction,
 *         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.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DM.pyx":2475
 *         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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addCoarsenHook", 0, 2, 4, i); __PYX_ERR(54, 2470, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(54, 2470, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(54, 2470, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(54, 2470, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(54, 2470, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DM.pyx":2474
 *         coarsenhook: DMCoarsenHookFunction,
 *         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.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DM.pyx":2475
 *         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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2470, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_244addCoarsenHook(((struct PyPetscDMObject *)__pyx_v_self), __pyx_v_coarsenhook, __pyx_v_restricthook, __pyx_v_args, __pyx_v_kargs);

  /* "petsc4py/PETSc/DM.pyx":2470
 *             CHKERR(DMSNESSetJacobian(self.dm, NULL, NULL))
 * 
 *     def addCoarsenHook(             # <<<<<<<<<<<<<<
 *         self,
 *         coarsenhook: DMCoarsenHookFunction,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_2DM_244addCoarsenHook(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":2496
 * 
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
    __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
  }

  /* "petsc4py/PETSc/DM.pyx":2497
 *         """
 *         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, 2497, __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":2499
 *         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":2500
 * 
 *         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, 2500, __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) != (0)) __PYX_ERR(54, 2500, __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) != (0)) __PYX_ERR(54, 2500, __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) != (0)) __PYX_ERR(54, 2500, __pyx_L1_error);
    __pyx_v_coarsencontext = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DM.pyx":2502
 *             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, 2502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_coarsenhooks = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DM.pyx":2503
 * 
 *             coarsenhooks = self.get_attr('__coarsenhooks__')
 *             if coarsenhooks is None:             # <<<<<<<<<<<<<<
 *                 coarsenhooks = [coarsencontext]
 *                 CHKERR(DMCoarsenHookAdd(self.dm, DM_PyCoarsenHook, NULL, <void*>NULL))
*/
    __pyx_t_1 = (__pyx_v_coarsenhooks == Py_None);
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/DM.pyx":2504
 *             coarsenhooks = self.get_attr('__coarsenhooks__')
 *             if coarsenhooks is None:
 *                 coarsenhooks = [coarsencontext]             # <<<<<<<<<<<<<<
 *                 CHKERR(DMCoarsenHookAdd(self.dm, DM_PyCoarsenHook, NULL, <void*>NULL))
 *             else:
*/
      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2504, __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) != (0)) __PYX_ERR(54, 2504, __pyx_L1_error);
      __Pyx_DECREF_SET(__pyx_v_coarsenhooks, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "petsc4py/PETSc/DM.pyx":2505
 *             if coarsenhooks is None:
 *                 coarsenhooks = [coarsencontext]
 *                 CHKERR(DMCoarsenHookAdd(self.dm, DM_PyCoarsenHook, NULL, <void*>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, 2505, __pyx_L1_error)

      /* "petsc4py/PETSc/DM.pyx":2503
 * 
 *             coarsenhooks = self.get_attr('__coarsenhooks__')
 *             if coarsenhooks is None:             # <<<<<<<<<<<<<<
 *                 coarsenhooks = [coarsencontext]
 *                 CHKERR(DMCoarsenHookAdd(self.dm, DM_PyCoarsenHook, NULL, <void*>NULL))
*/
      goto __pyx_L6;
    }

    /* "petsc4py/PETSc/DM.pyx":2507
 *                 CHKERR(DMCoarsenHookAdd(self.dm, DM_PyCoarsenHook, NULL, <void*>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, 2507, __pyx_L1_error)
    }
    __pyx_L6:;

    /* "petsc4py/PETSc/DM.pyx":2508
 *             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, 2508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DM.pyx":2499
 *         if kargs is None: kargs = {}
 * 
 *         if coarsenhook is not None:             # <<<<<<<<<<<<<<
 *             coarsencontext = (coarsenhook, args, kargs)
 * 
*/
  }

  /* "petsc4py/PETSc/DM.pyx":2510
 *             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":2511
 * 
 *         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, 2511, __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) != (0)) __PYX_ERR(54, 2511, __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) != (0)) __PYX_ERR(54, 2511, __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) != (0)) __PYX_ERR(54, 2511, __pyx_L1_error);
    __pyx_v_restrictcontext = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DM.pyx":2513
 *             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, 2513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_restricthooks = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DM.pyx":2514
 * 
 *             restricthooks = self.get_attr('__restricthooks__')
 *             if restricthooks is None:             # <<<<<<<<<<<<<<
 *                 restricthooks = [restrictcontext]
 *                 CHKERR(DMCoarsenHookAdd(self.dm, NULL, DM_PyRestrictHook, <void*>NULL))
*/
    __pyx_t_1 = (__pyx_v_restricthooks == Py_None);
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/DM.pyx":2515
 *             restricthooks = self.get_attr('__restricthooks__')
 *             if restricthooks is None:
 *                 restricthooks = [restrictcontext]             # <<<<<<<<<<<<<<
 *                 CHKERR(DMCoarsenHookAdd(self.dm, NULL, DM_PyRestrictHook, <void*>NULL))
 *             else:
*/
      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(54, 2515, __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) != (0)) __PYX_ERR(54, 2515, __pyx_L1_error);
      __Pyx_DECREF_SET(__pyx_v_restricthooks, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "petsc4py/PETSc/DM.pyx":2516
 *             if restricthooks is None:
 *                 restricthooks = [restrictcontext]
 *                 CHKERR(DMCoarsenHookAdd(self.dm, NULL, DM_PyRestrictHook, <void*>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, 2516, __pyx_L1_error)

      /* "petsc4py/PETSc/DM.pyx":2514
 * 
 *             restricthooks = self.get_attr('__restricthooks__')
 *             if restricthooks is None:             # <<<<<<<<<<<<<<
 *                 restricthooks = [restrictcontext]
 *                 CHKERR(DMCoarsenHookAdd(self.dm, NULL, DM_PyRestrictHook, <void*>NULL))
*/
      goto __pyx_L8;
    }

    /* "petsc4py/PETSc/DM.pyx":2518
 *                 CHKERR(DMCoarsenHookAdd(self.dm, NULL, DM_PyRestrictHook, <void*>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, 2518, __pyx_L1_error)
    }
    __pyx_L8:;

    /* "petsc4py/PETSc/DM.pyx":2519
 *             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, 2519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DM.pyx":2510
 *             self.set_attr('__coarsenhooks__', coarsenhooks)
 * 
 *         if restricthook is not None:             # <<<<<<<<<<<<<<
 *             restrictcontext = (restricthook, args, kargs)
 * 
*/
  }

  /* "petsc4py/PETSc/DM.pyx":2470
 *             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":2525
 *     property appctx:
 *         """Application context."""
 *         def __get__(self) -> object:             # <<<<<<<<<<<<<<
 *             return self.getAppCtx()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DM.pyx":2526
 *         """Application context."""
 *         def __get__(self) -> object:
 *             return self.getAppCtx()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getAppCtx, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 2526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":2525
 *     property appctx:
 *         """Application context."""
 *         def __get__(self) -> object:             # <<<<<<<<<<<<<<
 *             return self.getAppCtx()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2528
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/DM.pyx":2529
 * 
 *         def __set__(self, value):
 *             self.setAppCtx(value)             # <<<<<<<<<<<<<<
 * 
 *     # --- discretization space ---
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setAppCtx, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 2529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":2528
 *             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_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":2535
 *     property ds:
 *         """Discrete space."""
 *         def __get__(self) -> DS:             # <<<<<<<<<<<<<<
 *             return self.getDS()
 * 
*/

/* 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DM.pyx":2536
 *         """Discrete space."""
 *         def __get__(self) -> DS:
 *             return self.getDS()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getDS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 2536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DM.pyx":2535
 *     property ds:
 *         """Discrete space."""
 *         def __get__(self) -> DS:             # <<<<<<<<<<<<<<
 *             return self.getDS()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":2538
 *             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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "petsc4py/PETSc/DM.pyx":2539
 * 
 *         def __set__(self, value):
 *             self.setDS(value)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setDS, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 2539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DM.pyx":2538
 *             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_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":17
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":18
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.ds             # <<<<<<<<<<<<<<
 *         self.ds  = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->ds));

  /* "petsc4py/PETSc/DS.pyx":19
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.ds
 *         self.ds  = NULL             # <<<<<<<<<<<<<<
 * 
 *     def view(self, Viewer viewer=None) -> None:
*/
  __pyx_v_self->ds = NULL;

  /* "petsc4py/PETSc/DS.pyx":17
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.ds
 *         self.ds  = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/DS.pyx":21
 *         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:21");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DS_3view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_2view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(55, 21, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(55, 21, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(55, 21, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(55, 21, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 21, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(55, 21, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/DS.pyx":36
 * 
 *         """
 *         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":37
 *         """
 *         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":38
 *         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, 38, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":21
 *         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":40
 *         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:40");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DS_5destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_4destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DS.pyx":50
 * 
 *         """
 *         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, 50, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":51
 *         """
 *         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":40
 *         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":53
 *         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:53");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DS_7create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_6create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(55, 53, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(55, 53, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(55, 53, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(55, 53, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(55, 53, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DS.pyx":70
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(55, 70, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/DS.pyx":71
 *         """
 *         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":72
 *         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, 72, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":73
 *         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, 73, __pyx_L1_error)
  __pyx_v_self->ds = __pyx_v_newds;

  /* "petsc4py/PETSc/DS.pyx":74
 *         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":53
 *         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":76
 *         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:76");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DS_9setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_8setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ds_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(55, 76, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(55, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(55, 76, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(55, 76, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(55, 76, __pyx_L3_error)
    }
    __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, 76, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":91
 * 
 *         """
 *         cdef PetscDSType cval = NULL             # <<<<<<<<<<<<<<
 *         ds_type = str2bytes(ds_type, &cval)
 *         CHKERR(PetscDSSetType(self.ds, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DS.pyx":92
 *         """
 *         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, 92, __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":93
 *         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, 93, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":76
 *         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":95
 *         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:95");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DS_11getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_10getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DS.pyx":105
 * 
 *         """
 *         cdef PetscDSType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDSGetType(self.ds, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DS.pyx":106
 *         """
 *         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, 106, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":107
 *         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, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DS.pyx":95
 *         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":109
 *         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:109");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DS_13setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_13setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_12setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DS.pyx":119
 * 
 *         """
 *         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, 119, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":109
 *         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":121
 *         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:121");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DS_15setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_15setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_14setUp};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DS.pyx":131
 * 
 *         """
 *         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, 131, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":132
 *         """
 *         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":121
 *         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":136
 *     #
 * 
 *     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:136");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DS_17getSpatialDimension = {"getSpatialDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_17getSpatialDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_16getSpatialDimension};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSpatialDimension", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DS.pyx":149
 * 
 *         """
 *         cdef PetscInt dim = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDSGetSpatialDimension(self.ds, &dim))
 *         return toInt(dim)
*/
  __pyx_v_dim = 0;

  /* "petsc4py/PETSc/DS.pyx":150
 *         """
 *         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, 150, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":151
 *         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, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DS.pyx":136
 *     #
 * 
 *     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":153
 *         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:153");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DS_19getCoordinateDimension = {"getCoordinateDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_19getCoordinateDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_18getCoordinateDimension};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCoordinateDimension", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DS.pyx":166
 * 
 *         """
 *         cdef PetscInt dim = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDSGetCoordinateDimension(self.ds, &dim))
 *         return toInt(dim)
*/
  __pyx_v_dim = 0;

  /* "petsc4py/PETSc/DS.pyx":167
 *         """
 *         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, 167, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":168
 *         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, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DS.pyx":153
 *         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":170
 *         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:170");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DS_21getNumFields = {"getNumFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_21getNumFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_20getNumFields};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNumFields", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DS.pyx":180
 * 
 *         """
 *         cdef PetscInt nf = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDSGetNumFields(self.ds, &nf))
 *         return toInt(nf)
*/
  __pyx_v_nf = 0;

  /* "petsc4py/PETSc/DS.pyx":181
 *         """
 *         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, 181, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":182
 *         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, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DS.pyx":170
 *         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":184
 *         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:184");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DS_23getFieldIndex = {"getFieldIndex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_23getFieldIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_22getFieldIndex};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_disc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(55, 184, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(55, 184, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFieldIndex", 0) < (0)) __PYX_ERR(55, 184, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFieldIndex", 1, 1, 1, i); __PYX_ERR(55, 184, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(55, 184, __pyx_L3_error)
    }
    __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, 184, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, 0, "disc", 0))) __PYX_ERR(55, 184, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/DS.pyx":199
 * 
 *         """
 *         cdef PetscInt field = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDSGetFieldIndex(self.ds, disc.obj[0], &field))
 *         return toInt(field)
*/
  __pyx_v_field = 0;

  /* "petsc4py/PETSc/DS.pyx":200
 *         """
 *         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, 200, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":201
 *         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, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DS.pyx":184
 *         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":203
 *         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:203");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DS_25getTotalDimensions = {"getTotalDimensions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_25getTotalDimensions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_24getTotalDimensions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTotalDimensions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DS.pyx":213
 * 
 *         """
 *         cdef PetscInt tdim = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDSGetTotalDimension(self.ds, &tdim))
 *         return toInt(tdim)
*/
  __pyx_v_tdim = 0;

  /* "petsc4py/PETSc/DS.pyx":214
 *         """
 *         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, 214, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":215
 *         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, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DS.pyx":203
 *         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":217
 *         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:217");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DS_27getTotalComponents = {"getTotalComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_27getTotalComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_26getTotalComponents};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTotalComponents", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DS.pyx":227
 * 
 *         """
 *         cdef PetscInt tcmp = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDSGetTotalComponents(self.ds, &tcmp))
 *         return toInt(tcmp)
*/
  __pyx_v_tcmp = 0;

  /* "petsc4py/PETSc/DS.pyx":228
 *         """
 *         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, 228, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":229
 *         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, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DS.pyx":217
 *         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":231
 *         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:231");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DS_29getDimensions = {"getDimensions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_29getDimensions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_28getDimensions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDimensions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DS.pyx":241
 * 
 *         """
 *         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":242
 *         """
 *         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, 242, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":243
 *         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, 243, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":244
 *         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, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DS.pyx":231
 *         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":246
 *         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:246");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DS_31getComponents = {"getComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_31getComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_30getComponents};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getComponents", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DS.pyx":256
 * 
 *         """
 *         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":257
 *         """
 *         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, 257, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":258
 *         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, 258, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":259
 *         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, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DS.pyx":246
 *         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":261
 *         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:261");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_2DS_33setDiscretisation = {"setDiscretisation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_33setDiscretisation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_32setDiscretisation};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_f,&__pyx_mstate_global->__pyx_n_u_disc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(55, 261, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(55, 261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(55, 261, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDiscretisation", 0) < (0)) __PYX_ERR(55, 261, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDiscretisation", 1, 2, 2, i); __PYX_ERR(55, 261, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(55, 261, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(55, 261, __pyx_L3_error)
    }
    __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, 261, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DS.pyx":278
 * 
 *         """
 *         cdef PetscInt cf = asInt(f)             # <<<<<<<<<<<<<<
 *         cdef FE fe = disc
 *         CHKERR(PetscDSSetDiscretization(self.ds, cf, <PetscObject> 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, 278, __pyx_L1_error)
  __pyx_v_cf = __pyx_t_1;

  /* "petsc4py/PETSc/DS.pyx":279
 *         """
 *         cdef PetscInt cf = asInt(f)
 *         cdef FE fe = disc             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDSSetDiscretization(self.ds, cf, <PetscObject> fe.fe))
 * 
*/
  __pyx_t_2 = __pyx_v_disc;
  __Pyx_INCREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE))))) __PYX_ERR(55, 279, __pyx_L1_error)
  __pyx_v_fe = ((struct PyPetscFEObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DS.pyx":280
 *         cdef PetscInt cf = asInt(f)
 *         cdef FE fe = disc
 *         CHKERR(PetscDSSetDiscretization(self.ds, cf, <PetscObject> 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, 280, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":261
 *         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":32
 *     #
 * 
 *     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:32");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_1create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dim,&__pyx_mstate_global->__pyx_n_u_dof,&__pyx_mstate_global->__pyx_n_u_sizes,&__pyx_mstate_global->__pyx_n_u_proc_sizes,&__pyx_mstate_global->__pyx_n_u_boundary_type,&__pyx_mstate_global->__pyx_n_u_stencil_type,&__pyx_mstate_global->__pyx_n_u_stencil_width,&__pyx_mstate_global->__pyx_n_u_setup,&__pyx_mstate_global->__pyx_n_u_ownership_ranges,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 32, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(56, 32, __pyx_L3_error)

      /* "petsc4py/PETSc/DMDA.pyx":34
 *     def create(
 *         self,
 *         dim: int | None = None,             # <<<<<<<<<<<<<<
 *         dof: int | None = None,
 *         sizes: DimsSpec | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":35
 *         self,
 *         dim: int | None = None,
 *         dof: int | None = None,             # <<<<<<<<<<<<<<
 *         sizes: DimsSpec | None = None,
 *         proc_sizes: DimsSpec | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":36
 *         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,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":37
 *         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,
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":38
 *         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,
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":39
 *         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,
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":40
 *         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,
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":42
 *         stencil_width: int | None = None,
 *         bint setup: bool = True,
 *         ownership_ranges: tuple[Sequence[int], ...] | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a ``DMDA`` object.
*/
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":43
 *         bint setup: bool = True,
 *         ownership_ranges: tuple[Sequence[int], ...] | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a ``DMDA`` object.
 * 
*/
      if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 32, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMDA.pyx":34
 *     def create(
 *         self,
 *         dim: int | None = None,             # <<<<<<<<<<<<<<
 *         dof: int | None = None,
 *         sizes: DimsSpec | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":35
 *         self,
 *         dim: int | None = None,
 *         dof: int | None = None,             # <<<<<<<<<<<<<<
 *         sizes: DimsSpec | None = None,
 *         proc_sizes: DimsSpec | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":36
 *         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,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":37
 *         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,
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":38
 *         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,
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":39
 *         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,
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":40
 *         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,
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":42
 *         stencil_width: int | None = None,
 *         bint setup: bool = True,
 *         ownership_ranges: tuple[Sequence[int], ...] | None = None,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a ``DMDA`` object.
*/
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":43
 *         bint setup: bool = True,
 *         ownership_ranges: tuple[Sequence[int], ...] | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a ``DMDA`` object.
 * 
*/
      if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 41, __pyx_L3_error)
    } else {

      /* "petsc4py/PETSc/DMDA.pyx":41
 *         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) -> Self:
*/
      __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, 32, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":32
 *     #
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":93
 *         """
 *         #
 *         cdef object arg = None             # <<<<<<<<<<<<<<
 *         try: arg = tuple(dim)
 *         except TypeError: pass
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_arg = Py_None;

  /* "petsc4py/PETSc/DMDA.pyx":94
 *         #
 *         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, 94, __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":96
 *         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":95
 *         cdef object arg = None
 *         try: arg = tuple(dim)
 *         except TypeError: pass             # <<<<<<<<<<<<<<
 *         else: dim, sizes = None, arg
 *         #
*/
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_TypeError))));
    if (__pyx_t_6) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "petsc4py/PETSc/DMDA.pyx":94
 *         #
 *         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":98
 *         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":99
 *         #
 *         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":100
 *         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":101
 *         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":102
 *         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":103
 *         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":104
 *         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":105
 *         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":106
 *         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":107
 *         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":109
 *         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":110
 *         # 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":111
 *         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":112
 *         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":113
 *         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":114
 *         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, 114, __pyx_L1_error)
    __pyx_v_gdim = __pyx_t_8;

    /* "petsc4py/PETSc/DMDA.pyx":113
 *         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":115
 *         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":116
 *             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, 116, __pyx_L1_error)
    __pyx_v_pdim = __pyx_t_8;

    /* "petsc4py/PETSc/DMDA.pyx":115
 *         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":117
 *         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_L14_bool_binop_done;
  }
  __pyx_t_9 = (__pyx_v_pdim >= 0);
  __pyx_t_7 = __pyx_t_9;
  __pyx_L14_bool_binop_done:;
  if (__pyx_t_7) {

    /* "petsc4py/PETSc/DMDA.pyx":118
 *             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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(56, 118, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(56, 118, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/DMDA.pyx":117
 *         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":120
 *             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, 120, __pyx_L1_error)
    __pyx_v_ndim = __pyx_t_8;
  }

  /* "petsc4py/PETSc/DMDA.pyx":121
 *         # 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, 121, __pyx_L1_error)
    __pyx_v_ndof = __pyx_t_8;
  }

  /* "petsc4py/PETSc/DMDA.pyx":122
 *         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":123
 *         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":125
 *         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":126
 *         # 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, 126, __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":125
 *         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":130
 *                                                  &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":131
 *         # 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, 131, __pyx_L1_error)

    /* "petsc4py/PETSc/DMDA.pyx":130
 *                                                  &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":132
 *         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":133
 *             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, 133, __pyx_L1_error)
    __pyx_v_stype = __pyx_t_10;

    /* "petsc4py/PETSc/DMDA.pyx":132
 *         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":134
 *         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":135
 *             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, 135, __pyx_L1_error)
    __pyx_v_swidth = __pyx_t_8;

    /* "petsc4py/PETSc/DMDA.pyx":134
 *         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":136
 *         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_L25_bool_binop_done;
  }
  __pyx_t_9 = (__pyx_v_swidth == PETSC_DECIDE);
  __pyx_t_7 = __pyx_t_9;
  __pyx_L25_bool_binop_done:;
  if (__pyx_t_7) {
    __pyx_v_swidth = 0;
  }

  /* "petsc4py/PETSc/DMDA.pyx":138
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(56, 138, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_11;

  /* "petsc4py/PETSc/DMDA.pyx":139
 *         # 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":140
 *         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, 140, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":144
 *                             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_L28_bool_binop_done;
  }
  __pyx_t_9 = (__pyx_v_ndim > 0);
  __pyx_t_7 = __pyx_t_9;
  __pyx_L28_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, 144, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DMDA.pyx":145
 *                             &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, 145, __pyx_L1_error)
  __pyx_v_self->__pyx_base.dm = __pyx_v_newda;

  /* "petsc4py/PETSc/DMDA.pyx":146
 *         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":32
 *     #
 * 
 *     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":148
 *         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:148");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_3duplicate = {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_3duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_2duplicate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dof,&__pyx_mstate_global->__pyx_n_u_boundary_type,&__pyx_mstate_global->__pyx_n_u_stencil_type,&__pyx_mstate_global->__pyx_n_u_stencil_width,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 148, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(56, 148, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(56, 148, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 148, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 148, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "duplicate", 0) < (0)) __PYX_ERR(56, 148, __pyx_L3_error)

      /* "petsc4py/PETSc/DMDA.pyx":150
 *     def duplicate(
 *         self,
 *         dof: int | None = None,             # <<<<<<<<<<<<<<
 *         boundary_type: tuple[DM.BoundaryType | int | str | bool, ...] | None = None,
 *         stencil_type: StencilType | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":151
 *         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:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":152
 *         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:
 *         """Duplicate a DMDA.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":153
 *         boundary_type: tuple[DM.BoundaryType | int | str | bool, ...] | None = None,
 *         stencil_type: StencilType | None = None,
 *         stencil_width: int | None = None) -> DMDA:             # <<<<<<<<<<<<<<
 *         """Duplicate a DMDA.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(56, 148, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(56, 148, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 148, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 148, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMDA.pyx":150
 *     def duplicate(
 *         self,
 *         dof: int | None = None,             # <<<<<<<<<<<<<<
 *         boundary_type: tuple[DM.BoundaryType | int | str | bool, ...] | None = None,
 *         stencil_type: StencilType | None = None,
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":151
 *         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:
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":152
 *         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:
 *         """Duplicate a DMDA.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMDA.pyx":153
 *         boundary_type: tuple[DM.BoundaryType | int | str | bool, ...] | None = None,
 *         stencil_type: StencilType | None = None,
 *         stencil_width: int | None = None) -> DMDA:             # <<<<<<<<<<<<<<
 *         """Duplicate a DMDA.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 148, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":148
 *         return self
 * 
 *     def duplicate(             # <<<<<<<<<<<<<<
 *         self,
 *         dof: int | None = None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("duplicate", 0);

  /* "petsc4py/PETSc/DMDA.pyx":178
 * 
 *         """
 *         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":179
 *         """
 *         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":180
 *         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":181
 *         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":182
 *         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":183
 *         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":184
 *         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":185
 *         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":186
 *         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, 186, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":193
 *                            &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":194
 *                            &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(<PetscObject>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, 194, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":195
 *         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(<PetscObject>self.dm, &comm))
 *         #
*/
  __pyx_v_comm = MPI_COMM_NULL;

  /* "petsc4py/PETSc/DMDA.pyx":196
 *         CHKERR(DMDAGetOwnershipRanges(self.dm, &lx, &ly, &lz))
 *         cdef MPI_Comm comm = MPI_COMM_NULL
 *         CHKERR(PetscObjectGetComm(<PetscObject>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, 196, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":198
 *         CHKERR(PetscObjectGetComm(<PetscObject>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":199
 *         #
 *         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, 199, __pyx_L1_error)
    __pyx_v_ndof = __pyx_t_3;

    /* "petsc4py/PETSc/DMDA.pyx":198
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.dm, &comm))
 *         #
 *         if dof is not None:             # <<<<<<<<<<<<<<
 *             ndof = asInt(dof)
 *         if boundary_type is not None:
*/
  }

  /* "petsc4py/PETSc/DMDA.pyx":200
 *         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":201
 *             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, 201, __pyx_L1_error)

    /* "petsc4py/PETSc/DMDA.pyx":200
 *         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":202
 *         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":203
 *             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, 203, __pyx_L1_error)
    __pyx_v_stype = __pyx_t_4;

    /* "petsc4py/PETSc/DMDA.pyx":202
 *         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":204
 *         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":205
 *             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, 205, __pyx_L1_error)
    __pyx_v_swidth = __pyx_t_3;

    /* "petsc4py/PETSc/DMDA.pyx":204
 *         if stencil_type  is not None:
 *             stype = asStencil(stencil_type)
 *         if stencil_width is not None:             # <<<<<<<<<<<<<<
 *             swidth = asInt(stencil_width)
 *         #
*/
  }

  /* "petsc4py/PETSc/DMDA.pyx":207
 *             swidth = asInt(stencil_width)
 *         #
 *         cdef DMDA da = DMDA()             # <<<<<<<<<<<<<<
 *         CHKERR(DMDACreateND(comm, ndim, ndof,
 *                             M, N, P, m, n, p, lx, ly, lz,
*/
  __pyx_t_6 = NULL;
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 207, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_5);
  }
  __pyx_v_da = ((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":208
 *         #
 *         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, 208, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":212
 *                             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, 212, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":213
 *                             &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":148
 *         return self
 * 
 *     def duplicate(             # <<<<<<<<<<<<<<
 *         self,
 *         dof: int | None = None,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":217
 *     #
 * 
 *     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:217");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_5setDim = {"setDim", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_5setDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_4setDim};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dim,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 217, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 217, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDim", 0) < (0)) __PYX_ERR(56, 217, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDim", 1, 1, 1, i); __PYX_ERR(56, 217, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 217, __pyx_L3_error)
    }
    __pyx_v_dim = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setDim", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 217, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setDim", 0);

  /* "petsc4py/PETSc/DMDA.pyx":232
 * 
 *         """
 *         return self.setDimension(dim)             # <<<<<<<<<<<<<<
 * 
 *     def getDim(self) -> int:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_dim};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setDimension, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":217
 *     #
 * 
 *     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_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":234
 *         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:234");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_7getDim = {"getDim", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_7getDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_6getDim};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDim", __pyx_kwds); 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDim", 0);

  /* "petsc4py/PETSc/DMDA.pyx":244
 * 
 *         """
 *         return self.getDimension()             # <<<<<<<<<<<<<<
 * 
 *     def setDof(self, dof: int) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getDimension, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":234
 *         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_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":246
 *         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:246");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_9setDof = {"setDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_9setDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_8setDof};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dof,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 246, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 246, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDof", 0) < (0)) __PYX_ERR(56, 246, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDof", 1, 1, 1, i); __PYX_ERR(56, 246, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 246, __pyx_L3_error)
    }
    __pyx_v_dof = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setDof", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 246, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":261
 * 
 *         """
 *         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, 261, __pyx_L1_error)
  __pyx_v_ndof = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":262
 *         """
 *         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, 262, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":246
 *         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":264
 *         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:264");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_11getDof = {"getDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_11getDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_10getDof};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDof", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":274
 * 
 *         """
 *         cdef PetscInt dof = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMDAGetInfo(self.dm,
 *                            NULL,
*/
  __pyx_v_dof = 0;

  /* "petsc4py/PETSc/DMDA.pyx":275
 *         """
 *         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, 275, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":282
 *                            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, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":264
 *         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":284
 *         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:284");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_13setSizes = {"setSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_13setSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_12setSizes};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sizes,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 284, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 284, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSizes", 0) < (0)) __PYX_ERR(56, 284, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSizes", 1, 1, 1, i); __PYX_ERR(56, 284, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 284, __pyx_L3_error)
    }
    __pyx_v_sizes = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setSizes", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 284, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":299
 * 
 *         """
 *         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, 299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_gsizes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":300
 *         """
 *         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":301
 *         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":302
 *         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":303
 *         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":304
 *         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, 304, __pyx_L1_error)
  __pyx_v_gdim = __pyx_t_2;

  /* "petsc4py/PETSc/DMDA.pyx":305
 *         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":306
 *         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, 306, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":307
 *         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":308
 *         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, 308, __pyx_L1_error)

    /* "petsc4py/PETSc/DMDA.pyx":307
 *         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":309
 *         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, 309, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":284
 *         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":311
 *         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:311");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_15getSizes = {"getSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_15getSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_14getSizes};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSizes", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":321
 * 
 *         """
 *         cdef PetscInt dim = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt M = PETSC_DECIDE
 *         cdef PetscInt N = PETSC_DECIDE
*/
  __pyx_v_dim = 0;

  /* "petsc4py/PETSc/DMDA.pyx":322
 *         """
 *         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":323
 *         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":324
 *         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":325
 *         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, 325, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":332
 *                            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, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":311
 *         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":334
 *         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:334");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_17setProcSizes = {"setProcSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_17setProcSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_16setProcSizes};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_proc_sizes,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 334, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 334, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setProcSizes", 0) < (0)) __PYX_ERR(56, 334, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setProcSizes", 1, 1, 1, i); __PYX_ERR(56, 334, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 334, __pyx_L3_error)
    }
    __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, 334, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":349
 * 
 *         """
 *         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, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_psizes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":350
 *         """
 *         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":351
 *         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":352
 *         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":353
 *         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":354
 *         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, 354, __pyx_L1_error)
  __pyx_v_pdim = __pyx_t_2;

  /* "petsc4py/PETSc/DMDA.pyx":355
 *         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":356
 *         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, 356, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":357
 *         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":358
 *         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, 358, __pyx_L1_error)

    /* "petsc4py/PETSc/DMDA.pyx":357
 *         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":359
 *         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, 359, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":334
 *         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":361
 *         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:361");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_19getProcSizes = {"getProcSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_19getProcSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_18getProcSizes};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getProcSizes", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":371
 * 
 *         """
 *         cdef PetscInt dim = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt m = PETSC_DECIDE
 *         cdef PetscInt n = PETSC_DECIDE
*/
  __pyx_v_dim = 0;

  /* "petsc4py/PETSc/DMDA.pyx":372
 *         """
 *         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":373
 *         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":374
 *         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":375
 *         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, 375, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":382
 *                            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, 382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":361
 *         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":384
 *         return toDims(dim, m, n, p)
 * 
 *     def setBoundaryType(             # <<<<<<<<<<<<<<
 *         self,
 *         boundary_type: tuple[DM.BoundaryType | int | str | bool, ...]) -> None:
*/

/* 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:384");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_21setBoundaryType = {"setBoundaryType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_21setBoundaryType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_20setBoundaryType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_boundary_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 384, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 384, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBoundaryType", 0) < (0)) __PYX_ERR(56, 384, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBoundaryType", 1, 1, 1, i); __PYX_ERR(56, 384, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 384, __pyx_L3_error)
    }
    __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, 384, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":401
 * 
 *         """
 *         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":402
 *         """
 *         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":403
 *         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":404
 *         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, 404, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":405
 *         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, 405, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":384
 *         return toDims(dim, m, n, p)
 * 
 *     def setBoundaryType(             # <<<<<<<<<<<<<<
 *         self,
 *         boundary_type: tuple[DM.BoundaryType | int | str | bool, ...]) -> None:
*/

  /* 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":407
 *         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:407");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_23getBoundaryType = {"getBoundaryType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_23getBoundaryType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_22getBoundaryType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBoundaryType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":417
 * 
 *         """
 *         cdef PetscInt dim = 0             # <<<<<<<<<<<<<<
 *         cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE
 *         cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE
*/
  __pyx_v_dim = 0;

  /* "petsc4py/PETSc/DMDA.pyx":418
 *         """
 *         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":419
 *         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":420
 *         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":421
 *         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, 421, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":428
 *                            &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, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":407
 *         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":430
 *         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:430");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_25setStencilType = {"setStencilType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_25setStencilType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_24setStencilType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_stencil_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 430, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 430, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setStencilType", 0) < (0)) __PYX_ERR(56, 430, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setStencilType", 1, 1, 1, i); __PYX_ERR(56, 430, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 430, __pyx_L3_error)
    }
    __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, 430, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":445
 * 
 *         """
 *         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, 445, __pyx_L1_error)
  __pyx_v_stype = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":446
 *         """
 *         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, 446, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":430
 *         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":448
 *         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:448");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_27getStencilType = {"getStencilType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_27getStencilType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_26getStencilType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getStencilType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":458
 * 
 *         """
 *         cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX             # <<<<<<<<<<<<<<
 *         CHKERR(DMDAGetInfo(self.dm,
 *                            NULL,
*/
  __pyx_v_stype = DMDA_STENCIL_BOX;

  /* "petsc4py/PETSc/DMDA.pyx":459
 *         """
 *         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, 459, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":466
 *                            NULL, NULL, NULL,
 *                            &stype))
 *         return stype             # <<<<<<<<<<<<<<
 * 
 *     def setStencilWidth(self, stencil_width: int) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_DMDAStencilType(__pyx_v_stype); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":448
 *         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":468
 *         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:468");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_29setStencilWidth = {"setStencilWidth", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_29setStencilWidth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_28setStencilWidth};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_stencil_width,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 468, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 468, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setStencilWidth", 0) < (0)) __PYX_ERR(56, 468, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setStencilWidth", 1, 1, 1, i); __PYX_ERR(56, 468, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 468, __pyx_L3_error)
    }
    __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, 468, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":483
 * 
 *         """
 *         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, 483, __pyx_L1_error)
  __pyx_v_swidth = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":484
 *         """
 *         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, 484, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":468
 *         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":486
 *         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:486");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_31getStencilWidth = {"getStencilWidth", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_31getStencilWidth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_30getStencilWidth};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getStencilWidth", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":496
 * 
 *         """
 *         cdef PetscInt swidth = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMDAGetInfo(self.dm,
 *                            NULL,
*/
  __pyx_v_swidth = 0;

  /* "petsc4py/PETSc/DMDA.pyx":497
 *         """
 *         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, 497, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":504
 *                            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, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":486
 *         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":506
 *         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:506");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_33setStencil = {"setStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_33setStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_32setStencil};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_stencil_type,&__pyx_mstate_global->__pyx_n_u_stencil_width,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 506, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 506, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setStencil", 0) < (0)) __PYX_ERR(56, 506, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setStencil", 1, 2, 2, i); __PYX_ERR(56, 506, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 506, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 506, __pyx_L3_error)
    }
    __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, 506, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":527
 * 
 *         """
 *         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, 527, __pyx_L1_error)
  __pyx_v_stype = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":528
 *         """
 *         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, 528, __pyx_L1_error)
  __pyx_v_swidth = __pyx_t_2;

  /* "petsc4py/PETSc/DMDA.pyx":529
 *         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, 529, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":530
 *         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, 530, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":506
 *         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":532
 *         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:532");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_35getStencil = {"getStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_35getStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_34getStencil};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getStencil", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":542
 * 
 *         """
 *         cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX             # <<<<<<<<<<<<<<
 *         cdef PetscInt swidth = 0
 *         CHKERR(DMDAGetInfo(self.dm,
*/
  __pyx_v_stype = DMDA_STENCIL_BOX;

  /* "petsc4py/PETSc/DMDA.pyx":543
 *         """
 *         cdef PetscDMDAStencilType stype = DMDA_STENCIL_BOX
 *         cdef PetscInt swidth = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMDAGetInfo(self.dm,
 *                            NULL,
*/
  __pyx_v_swidth = 0;

  /* "petsc4py/PETSc/DMDA.pyx":544
 *         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, 544, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":551
 *                            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, 551, __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, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 551, __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) != (0)) __PYX_ERR(56, 551, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(56, 551, __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":532
 *         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":555
 *     #
 * 
 *     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:555");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_37getRanges = {"getRanges", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_37getRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_36getRanges};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getRanges", __pyx_kwds); 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", 0);

  /* "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,
*/
  __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":569
 *         """
 *         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, 569, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":570
 *         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, 570, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":573
 *                               &x, &y, &z,
 *                               &m, &n, &p))
 *         return ((toInt(x), toInt(x+m)),             # <<<<<<<<<<<<<<
 *                 (toInt(y), toInt(y+n)),
 *                 (toInt(z), toInt(z+p)))[:<Py_ssize_t>dim]
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_x); 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_x + __pyx_v_m)); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 573, __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) != (0)) __PYX_ERR(56, 573, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(56, 573, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":574
 *                               &m, &n, &p))
 *         return ((toInt(x), toInt(x+m)),
 *                 (toInt(y), toInt(y+n)),             # <<<<<<<<<<<<<<
 *                 (toInt(z), toInt(z+p)))[:<Py_ssize_t>dim]
 * 
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 574, __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, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 574, __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) != (0)) __PYX_ERR(56, 574, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2) != (0)) __PYX_ERR(56, 574, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":575
 *         return ((toInt(x), toInt(x+m)),
 *                 (toInt(y), toInt(y+n)),
 *                 (toInt(z), toInt(z+p)))[:<Py_ssize_t>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, 575, __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, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 575, __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) != (0)) __PYX_ERR(56, 575, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3) != (0)) __PYX_ERR(56, 575, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":573
 *                               &x, &y, &z,
 *                               &m, &n, &p))
 *         return ((toInt(x), toInt(x+m)),             # <<<<<<<<<<<<<<
 *                 (toInt(y), toInt(y+n)),
 *                 (toInt(z), toInt(z+p)))[:<Py_ssize_t>dim]
*/
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 573, __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) != (0)) __PYX_ERR(56, 573, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5) != (0)) __PYX_ERR(56, 573, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6) != (0)) __PYX_ERR(56, 573, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":575
 *         return ((toInt(x), toInt(x+m)),
 *                 (toInt(y), toInt(y+n)),
 *                 (toInt(z), toInt(z+p)))[:<Py_ssize_t>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, 575, __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":555
 *     #
 * 
 *     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":577
 *                 (toInt(z), toInt(z+p)))[:<Py_ssize_t>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:577");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_39getGhostRanges = {"getGhostRanges", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_39getGhostRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_38getGhostRanges};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getGhostRanges", __pyx_kwds); 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", 0);

  /* "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,
*/
  __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":589
 *         """
 *         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, 589, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":590
 *         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, 590, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":593
 *                                    &x, &y, &z,
 *                                    &m, &n, &p))
 *         return ((toInt(x), toInt(x+m)),             # <<<<<<<<<<<<<<
 *                 (toInt(y), toInt(y+n)),
 *                 (toInt(z), toInt(z+p)))[:<Py_ssize_t>dim]
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_x); 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_x + __pyx_v_m)); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 593, __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) != (0)) __PYX_ERR(56, 593, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(56, 593, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":594
 *                                    &m, &n, &p))
 *         return ((toInt(x), toInt(x+m)),
 *                 (toInt(y), toInt(y+n)),             # <<<<<<<<<<<<<<
 *                 (toInt(z), toInt(z+p)))[:<Py_ssize_t>dim]
 * 
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 594, __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, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 594, __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) != (0)) __PYX_ERR(56, 594, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2) != (0)) __PYX_ERR(56, 594, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":595
 *         return ((toInt(x), toInt(x+m)),
 *                 (toInt(y), toInt(y+n)),
 *                 (toInt(z), toInt(z+p)))[:<Py_ssize_t>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, 595, __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, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 595, __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) != (0)) __PYX_ERR(56, 595, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3) != (0)) __PYX_ERR(56, 595, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":593
 *                                    &x, &y, &z,
 *                                    &m, &n, &p))
 *         return ((toInt(x), toInt(x+m)),             # <<<<<<<<<<<<<<
 *                 (toInt(y), toInt(y+n)),
 *                 (toInt(z), toInt(z+p)))[:<Py_ssize_t>dim]
*/
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(56, 593, __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) != (0)) __PYX_ERR(56, 593, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5) != (0)) __PYX_ERR(56, 593, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_6) != (0)) __PYX_ERR(56, 593, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":595
 *         return ((toInt(x), toInt(x+m)),
 *                 (toInt(y), toInt(y+n)),
 *                 (toInt(z), toInt(z+p)))[:<Py_ssize_t>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, 595, __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":577
 *                 (toInt(z), toInt(z+p)))[:<Py_ssize_t>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":597
 *                 (toInt(z), toInt(z+p)))[:<Py_ssize_t>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:597");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_41getOwnershipRanges = {"getOwnershipRanges", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_41getOwnershipRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_40getOwnershipRanges};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOwnershipRanges", __pyx_kwds); 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", 0);

  /* "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,
*/
  __pyx_v_dim = 0;
  __pyx_v_m = 0;
  __pyx_v_n = 0;
  __pyx_v_p = 0;

  /* "petsc4py/PETSc/DMDA.pyx":611
 *         """
 *         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":612
 *         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, 612, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":619
 *                            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, 619, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":620
 *                            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, 620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":597
 *                 (toInt(z), toInt(z+p)))[:<Py_ssize_t>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":622
 *         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:622");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_43getCorners = {"getCorners", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_43getCorners, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_42getCorners};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCorners", __pyx_kwds); 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", 0);

  /* "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,
*/
  __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":644
 *         """
 *         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, 644, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":645
 *         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, 645, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":648
 *                               &x, &y, &z,
 *                               &m, &n, &p))
 *         return ((toInt(x), toInt(y), toInt(z))[:<Py_ssize_t>dim],             # <<<<<<<<<<<<<<
 *                 (toInt(m), toInt(n), toInt(p))[:<Py_ssize_t>dim])
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 648, __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, 648, __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, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 648, __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) != (0)) __PYX_ERR(56, 648, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(56, 648, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4) != (0)) __PYX_ERR(56, 648, __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, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":649
 *                               &m, &n, &p))
 *         return ((toInt(x), toInt(y), toInt(z))[:<Py_ssize_t>dim],
 *                 (toInt(m), toInt(n), toInt(p))[:<Py_ssize_t>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, 649, __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, 649, __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, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 649, __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) != (0)) __PYX_ERR(56, 649, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3) != (0)) __PYX_ERR(56, 649, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2) != (0)) __PYX_ERR(56, 649, __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, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":648
 *                               &x, &y, &z,
 *                               &m, &n, &p))
 *         return ((toInt(x), toInt(y), toInt(z))[:<Py_ssize_t>dim],             # <<<<<<<<<<<<<<
 *                 (toInt(m), toInt(n), toInt(p))[:<Py_ssize_t>dim])
 * 
*/
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 648, __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) != (0)) __PYX_ERR(56, 648, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2) != (0)) __PYX_ERR(56, 648, __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":622
 *         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":651
 *                 (toInt(m), toInt(n), toInt(p))[:<Py_ssize_t>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:651");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_45getGhostCorners = {"getGhostCorners", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_45getGhostCorners, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_44getGhostCorners};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getGhostCorners", __pyx_kwds); 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", 0);

  /* "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,
*/
  __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":666
 *         """
 *         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, 666, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":667
 *         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, 667, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":670
 *                                    &x, &y, &z,
 *                                    &m, &n, &p))
 *         return ((toInt(x), toInt(y), toInt(z))[:<Py_ssize_t>dim],             # <<<<<<<<<<<<<<
 *                 (toInt(m), toInt(n), toInt(p))[:<Py_ssize_t>dim])
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 670, __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, 670, __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, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 670, __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) != (0)) __PYX_ERR(56, 670, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3) != (0)) __PYX_ERR(56, 670, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4) != (0)) __PYX_ERR(56, 670, __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, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":671
 *                                    &m, &n, &p))
 *         return ((toInt(x), toInt(y), toInt(z))[:<Py_ssize_t>dim],
 *                 (toInt(m), toInt(n), toInt(p))[:<Py_ssize_t>dim])             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_m); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 671, __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, 671, __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, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 671, __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) != (0)) __PYX_ERR(56, 671, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3) != (0)) __PYX_ERR(56, 671, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2) != (0)) __PYX_ERR(56, 671, __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, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":670
 *                                    &x, &y, &z,
 *                                    &m, &n, &p))
 *         return ((toInt(x), toInt(y), toInt(z))[:<Py_ssize_t>dim],             # <<<<<<<<<<<<<<
 *                 (toInt(m), toInt(n), toInt(p))[:<Py_ssize_t>dim])
 * 
*/
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 670, __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) != (0)) __PYX_ERR(56, 670, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2) != (0)) __PYX_ERR(56, 670, __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":651
 *                 (toInt(m), toInt(n), toInt(p))[:<Py_ssize_t>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":675
 *     #
 * 
 *     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:675");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_47setFieldName = {"setFieldName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_47setFieldName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_46setFieldName};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 675, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 675, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 675, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setFieldName", 0) < (0)) __PYX_ERR(56, 675, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setFieldName", 1, 2, 2, i); __PYX_ERR(56, 675, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 675, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 675, __pyx_L3_error)
    }
    __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, 675, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":694
 * 
 *         """
 *         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, 694, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":695
 *         """
 *         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":696
 *         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, 696, __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":697
 *         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, 697, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":675
 *     #
 * 
 *     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":699
 *         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:699");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_49getFieldName = {"getFieldName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_49getFieldName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_48getFieldName};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 699, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 699, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFieldName", 0) < (0)) __PYX_ERR(56, 699, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFieldName", 1, 1, 1, i); __PYX_ERR(56, 699, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 699, __pyx_L3_error)
    }
    __pyx_v_field = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getFieldName", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 699, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":716
 * 
 *         """
 *         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, 716, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":717
 *         """
 *         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":718
 *         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, 718, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":719
 *         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, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":699
 *         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":723
 *     #
 * 
 *     def getVecArray(self, Vec vec, readonly: bool = False) -> Any:             # <<<<<<<<<<<<<<
 *         """Get access to the vector as laid out on a N-d grid.
 * 
*/

/* 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, readonly: bool = False) -> Any\nGet access to the vector as laid out on a N-d grid.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        vec\n            The vector to which access is being requested.\n        readonly\n            Request read-only access.\n\n        See Also\n        --------\n        Vec.getArray, petsc.DMDAVecGetArray, petsc.DMDAVecGetArrayDOF\n\n        \nSource code at petsc4py/PETSc/DMDA.pyx:723");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_51getVecArray = {"getVecArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_51getVecArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_50getVecArray};
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;
  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("getVecArray (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,&__pyx_mstate_global->__pyx_n_u_readonly,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 723, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 723, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 723, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getVecArray", 0) < (0)) __PYX_ERR(56, 723, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getVecArray", 0, 1, 2, i); __PYX_ERR(56, 723, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 723, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 723, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __pyx_v_vec = ((struct PyPetscVecObject *)values[0]);
    __pyx_v_readonly = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getVecArray", 0, 1, 2, __pyx_nargs); __PYX_ERR(56, 723, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(56, 723, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_4DMDA_50getVecArray(((struct __pyx_obj_8petsc4py_5PETSc_DMDA *)__pyx_v_self), __pyx_v_vec, __pyx_v_readonly);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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_v_readonly) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getVecArray", 0);

  /* "petsc4py/PETSc/DMDA.pyx":740
 * 
 *         """
 *         return _DMDA_Vec_array(self, vec, readonly)             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_vec), __pyx_v_readonly};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 740, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":723
 *     #
 * 
 *     def getVecArray(self, Vec vec, readonly: bool = False) -> Any:             # <<<<<<<<<<<<<<
 *         """Get access to the vector as laid out on a N-d grid.
 * 
*/

  /* 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":744
 *     #
 * 
 *     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:744");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_53setUniformCoordinates = {"setUniformCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_53setUniformCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_52setUniformCoordinates};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_xmin,&__pyx_mstate_global->__pyx_n_u_xmax,&__pyx_mstate_global->__pyx_n_u_ymin,&__pyx_mstate_global->__pyx_n_u_ymax,&__pyx_mstate_global->__pyx_n_u_zmin,&__pyx_mstate_global->__pyx_n_u_zmax,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 744, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(56, 744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(56, 744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(56, 744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(56, 744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setUniformCoordinates", 0) < (0)) __PYX_ERR(56, 744, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(56, 744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(56, 744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(56, 744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(56, 744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 744, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
    }
    __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, 744, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":780
 * 
 *         """
 *         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, 780, __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, 780, __pyx_L1_error)
  __pyx_v__xmax = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":781
 *         """
 *         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, 781, __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, 781, __pyx_L1_error)
  __pyx_v__ymax = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":782
 *         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, 782, __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, 782, __pyx_L1_error)
  __pyx_v__zmax = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":783
 *         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, 783, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":744
 *     #
 * 
 *     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":788
 *                                          _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:788");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_55setCoordinateName = {"setCoordinateName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_55setCoordinateName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_54setCoordinateName};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_index,&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 788, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 788, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 788, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCoordinateName", 0) < (0)) __PYX_ERR(56, 788, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCoordinateName", 1, 2, 2, i); __PYX_ERR(56, 788, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 788, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 788, __pyx_L3_error)
    }
    __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, 788, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":805
 * 
 *         """
 *         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, 805, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":806
 *         """
 *         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":807
 *         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, 807, __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":808
 *         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, 808, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":788
 *                                          _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":810
 *         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:810");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_57getCoordinateName = {"getCoordinateName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_57getCoordinateName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_56getCoordinateName};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_index,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 810, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 810, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getCoordinateName", 0) < (0)) __PYX_ERR(56, 810, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getCoordinateName", 1, 1, 1, i); __PYX_ERR(56, 810, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 810, __pyx_L3_error)
    }
    __pyx_v_index = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getCoordinateName", 1, 1, 1, __pyx_nargs); __PYX_ERR(56, 810, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":825
 * 
 *         """
 *         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, 825, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":826
 *         """
 *         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":827
 *         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, 827, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":828
 *         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, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":810
 *         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":832
 *     #
 * 
 *     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:832");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_59createNaturalVec = {"createNaturalVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_59createNaturalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_58createNaturalVec};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("createNaturalVec", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createNaturalVec", 0);

  /* "petsc4py/PETSc/DMDA.pyx":845
 * 
 *         """
 *         cdef Vec vn = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(DMDACreateNaturalVector(self.dm, &vn.vec))
 *         return vn
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 845, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vn = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":846
 *         """
 *         cdef Vec vn = Vec()
 *         CHKERR(DMDACreateNaturalVector(self.dm, &vn.vec))             # <<<<<<<<<<<<<<
 *         return vn
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDACreateNaturalVector(__pyx_v_self->__pyx_base.dm, (&__pyx_v_vn->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 846, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":847
 *         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":832
 *     #
 * 
 *     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_XDECREF(__pyx_t_2);
  __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":849
 *         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:849");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_61globalToNatural = {"globalToNatural", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_61globalToNatural, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_60globalToNatural};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vg,&__pyx_mstate_global->__pyx_n_u_vn,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 849, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(56, 849, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 849, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 849, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "globalToNatural", 0) < (0)) __PYX_ERR(56, 849, __pyx_L3_error)

      /* "petsc4py/PETSc/DMDA.pyx":853
 *         Vec vg,
 *         Vec vn,
 *         addv: InsertMode | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Map values to the "natural" grid ordering.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("globalToNatural", 0, 2, 3, i); __PYX_ERR(56, 849, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(56, 849, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 849, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 849, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 849, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vg", 0))) __PYX_ERR(56, 851, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vn), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vn", 0))) __PYX_ERR(56, 852, __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":849
 *         return vn
 * 
 *     def globalToNatural(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec vg,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":875
 * 
 *         """
 *         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, 875, __pyx_L1_error)
  __pyx_v_im = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":876
 *         """
 *         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, 876, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":877
 *         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, 877, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":849
 *         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":879
 *         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:879");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_63naturalToGlobal = {"naturalToGlobal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_63naturalToGlobal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_62naturalToGlobal};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vn,&__pyx_mstate_global->__pyx_n_u_vg,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 879, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(56, 879, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 879, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 879, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "naturalToGlobal", 0) < (0)) __PYX_ERR(56, 879, __pyx_L3_error)

      /* "petsc4py/PETSc/DMDA.pyx":883
 *         Vec vn,
 *         Vec vg,
 *         addv: InsertMode | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Map values the to grid ordering.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("naturalToGlobal", 0, 2, 3, i); __PYX_ERR(56, 879, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(56, 879, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 879, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 879, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 879, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vn", 0))) __PYX_ERR(56, 881, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vg), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vg", 0))) __PYX_ERR(56, 882, __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":879
 *         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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":903
 * 
 *         """
 *         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, 903, __pyx_L1_error)
  __pyx_v_im = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":904
 *         """
 *         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, 904, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":905
 *         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, 905, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":879
 *         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":909
 *     #
 * 
 *     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:909");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_65getAO = {"getAO", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_65getAO, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_64getAO};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getAO", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getAO", 0);

  /* "petsc4py/PETSc/DMDA.pyx":925
 * 
 *         """
 *         cdef AO ao = AO()             # <<<<<<<<<<<<<<
 *         CHKERR(DMDAGetAO(self.dm, &ao.ao))
 *         CHKERR(PetscINCREF(ao.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_AO, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 925, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_ao = ((struct PyPetscAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":926
 *         """
 *         cdef AO ao = AO()
 *         CHKERR(DMDAGetAO(self.dm, &ao.ao))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(ao.obj))
 *         return ao
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetAO(__pyx_v_self->__pyx_base.dm, (&__pyx_v_ao->ao))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 926, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":927
 *         cdef AO ao = AO()
 *         CHKERR(DMDAGetAO(self.dm, &ao.ao))
 *         CHKERR(PetscINCREF(ao.obj))             # <<<<<<<<<<<<<<
 *         return ao
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ao->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 927, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":928
 *         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":909
 *     #
 * 
 *     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_XDECREF(__pyx_t_2);
  __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":930
 *         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:930");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_67getScatter = {"getScatter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_67getScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_66getScatter};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getScatter", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getScatter", 0);

  /* "petsc4py/PETSc/DMDA.pyx":940
 * 
 *         """
 *         cdef Scatter l2g = Scatter()             # <<<<<<<<<<<<<<
 *         cdef Scatter g2l = Scatter()
 *         CHKERR(DMDAGetScatter(self.dm, &l2g.sct, &g2l.sct))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 940, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_l2g = ((struct PyPetscScatterObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":941
 *         """
 *         cdef Scatter l2g = Scatter()
 *         cdef Scatter g2l = Scatter()             # <<<<<<<<<<<<<<
 *         CHKERR(DMDAGetScatter(self.dm, &l2g.sct, &g2l.sct))
 *         CHKERR(PetscINCREF(l2g.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 941, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_g2l = ((struct PyPetscScatterObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":942
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMDAGetScatter(__pyx_v_self->__pyx_base.dm, (&__pyx_v_l2g->sct), (&__pyx_v_g2l->sct))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 942, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":943
 *         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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_l2g->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 943, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":944
 *         CHKERR(DMDAGetScatter(self.dm, &l2g.sct, &g2l.sct))
 *         CHKERR(PetscINCREF(l2g.obj))
 *         CHKERR(PetscINCREF(g2l.obj))             # <<<<<<<<<<<<<<
 *         return (l2g, g2l)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_g2l->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(56, 944, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":945
 *         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, 945, __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)) != (0)) __PYX_ERR(56, 945, __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)) != (0)) __PYX_ERR(56, 945, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":930
 *         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_XDECREF(__pyx_t_2);
  __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":949
 *     #
 * 
 *     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:949");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_69setRefinementFactor = {"setRefinementFactor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_69setRefinementFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_68setRefinementFactor};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_refine_x,&__pyx_mstate_global->__pyx_n_u_refine_y,&__pyx_mstate_global->__pyx_n_u_refine_z,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 949, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(56, 949, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 949, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 949, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRefinementFactor", 0) < (0)) __PYX_ERR(56, 949, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_2));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_2));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_2));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(56, 949, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(56, 949, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 949, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_2));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_2));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_2));
    }
    __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, 949, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":973
 *         """
 *         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, 973, __pyx_L1_error)
  (__pyx_v_refine[0]) = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":974
 *         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, 974, __pyx_L1_error)
  (__pyx_v_refine[1]) = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":975
 *         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, 975, __pyx_L1_error)
  (__pyx_v_refine[2]) = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":976
 *         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, 976, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":949
 *     #
 * 
 *     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":981
 *                                        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:981");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_71getRefinementFactor = {"getRefinementFactor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_71getRefinementFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_70getRefinementFactor};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getRefinementFactor", __pyx_kwds); 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];
  long __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("getRefinementFactor", 0);

  /* "petsc4py/PETSc/DMDA.pyx":991
 * 
 *         """
 *         cdef PetscInt dim = 0, refine[3]             # <<<<<<<<<<<<<<
 *         CHKERR(DMDAGetDim(self.dm, &dim))
 *         CHKERR(DMDAGetRefinementFactor(self.dm,
*/
  __pyx_v_dim = 0;

  /* "petsc4py/PETSc/DMDA.pyx":992
 *         """
 *         cdef PetscInt 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, 992, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":993
 *         cdef PetscInt 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, 993, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":997
 *                                        &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, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_v_dim;
    for (__pyx_9genexpr20__pyx_v_i = 0; __pyx_9genexpr20__pyx_v_i < __pyx_t_3; __pyx_9genexpr20__pyx_v_i++) {
      __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toInt((__pyx_v_refine[__pyx_9genexpr20__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(56, 997, __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, 997, __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":981
 *                                        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":999
 *         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:999");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_73setInterpolationType = {"setInterpolationType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_73setInterpolationType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_72setInterpolationType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_interp_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 999, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 999, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setInterpolationType", 0) < (0)) __PYX_ERR(56, 999, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setInterpolationType", 1, 1, 1, i); __PYX_ERR(56, 999, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 999, __pyx_L3_error)
    }
    __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, 999, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1017
 * 
 *         """
 *         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, 1017, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":1018
 *         """
 *         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, 1018, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":999
 *         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":1020
 *         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:1020");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_75getInterpolationType = {"getInterpolationType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_75getInterpolationType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_74getInterpolationType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getInterpolationType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1030
 * 
 *         """
 *         cdef PetscDMDAInterpolationType ival = DMDA_INTERPOLATION_Q0             # <<<<<<<<<<<<<<
 *         CHKERR(DMDAGetInterpolationType(self.dm, &ival))
 *         return <long>ival
*/
  __pyx_v_ival = DMDA_Q0;

  /* "petsc4py/PETSc/DMDA.pyx":1031
 *         """
 *         cdef PetscDMDAInterpolationType ival = DMDA_INTERPOLATION_Q0
 *         CHKERR(DMDAGetInterpolationType(self.dm, &ival))             # <<<<<<<<<<<<<<
 *         return <long>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, 1031, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":1032
 *         cdef PetscDMDAInterpolationType ival = DMDA_INTERPOLATION_Q0
 *         CHKERR(DMDAGetInterpolationType(self.dm, &ival))
 *         return <long>ival             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_long(((long)__pyx_v_ival)); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":1020
 *         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":1036
 *     #
 * 
 *     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:1036");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_77setElementType = {"setElementType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_77setElementType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_76setElementType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_elem_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 1036, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 1036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setElementType", 0) < (0)) __PYX_ERR(56, 1036, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setElementType", 1, 1, 1, i); __PYX_ERR(56, 1036, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 1036, __pyx_L3_error)
    }
    __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, 1036, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1046
 * 
 *         """
 *         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, 1046, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/DMDA.pyx":1047
 *         """
 *         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, 1047, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":1036
 *     #
 * 
 *     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":1050
 * 
 *     # 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:1050");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_79getElementType = {"getElementType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_79getElementType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_78getElementType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getElementType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1060
 * 
 *         """
 *         cdef PetscDMDAElementType ival = DMDA_ELEMENT_Q1             # <<<<<<<<<<<<<<
 *         CHKERR(DMDAGetElementType(self.dm, &ival))
 *         return <long>ival
*/
  __pyx_v_ival = DMDA_ELEMENT_Q1;

  /* "petsc4py/PETSc/DMDA.pyx":1061
 *         """
 *         cdef PetscDMDAElementType ival = DMDA_ELEMENT_Q1
 *         CHKERR(DMDAGetElementType(self.dm, &ival))             # <<<<<<<<<<<<<<
 *         return <long>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, 1061, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":1062
 *         cdef PetscDMDAElementType ival = DMDA_ELEMENT_Q1
 *         CHKERR(DMDAGetElementType(self.dm, &ival))
 *         return <long>ival             # <<<<<<<<<<<<<<
 * 
 *     def getElements(self, elem_type: ElementType | None = None) -> ArrayInt:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_long(((long)__pyx_v_ival)); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 1062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":1050
 * 
 *     # 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":1064
 *         return <long>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:1064");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_4DMDA_81getElements = {"getElements", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_81getElements, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_80getElements};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_elem_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(56, 1064, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 1064, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getElements", 0) < (0)) __PYX_ERR(56, 1064, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(56, 1064, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1064, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1084
 * 
 *         """
 *         cdef PetscInt dim=0             # <<<<<<<<<<<<<<
 *         cdef PetscDMDAElementType etype
 *         cdef PetscInt nel=0, nen=0
*/
  __pyx_v_dim = 0;

  /* "petsc4py/PETSc/DMDA.pyx":1086
 *         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":1087
 *         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":1089
 *         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, 1089, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":1090
 *         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":1091
 *         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, 1091, __pyx_L1_error)
    __pyx_v_etype = __pyx_t_3;

    /* "petsc4py/PETSc/DMDA.pyx":1092
 *         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, 1092, __pyx_L1_error)

    /* "petsc4py/PETSc/DMDA.pyx":1090
 *         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":1093
 *             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":1094
 *             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, 1094, __pyx_L5_error)

    /* "petsc4py/PETSc/DMDA.pyx":1095
 *         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, 1095, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_elements = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "petsc4py/PETSc/DMDA.pyx":1096
 *             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, 1096, __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, 1096, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(56, 1096, __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) != (0)) __PYX_ERR(56, 1096, __pyx_L5_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5) != (0)) __PYX_ERR(56, 1096, __pyx_L5_error);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_elements, __pyx_mstate_global->__pyx_n_u_shape, __pyx_t_6) < (0)) __PYX_ERR(56, 1096, __pyx_L5_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "petsc4py/PETSc/DMDA.pyx":1098
 *             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, 1098, __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;
       __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
      if ( 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, 1098, __pyx_L8_error)
      }
      __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:;
      __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":1099
 *         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":1064
 *         return <long>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":1105
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1106
 *         """The grid dimension."""
 *         def __get__(self) -> int:
 *             return self.getDim()             # <<<<<<<<<<<<<<
 * 
 *     property dof:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getDim, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":1105
 *     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_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":1110
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1111
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getDof, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":1110
 *     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_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":1115
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1116
 *         """The global dimension."""
 *         def __get__(self) -> tuple[int, ...]:
 *             return self.getSizes()             # <<<<<<<<<<<<<<
 * 
 *     property proc_sizes:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getSizes, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":1115
 *     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_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":1120
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1121
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getProcSizes, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":1120
 *     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_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":1125
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1126
 *         """Boundary types in each dimension."""
 *         def __get__(self) -> tuple[DM.BoundaryType, ...]:
 *             return self.getBoundaryType()             # <<<<<<<<<<<<<<
 * 
 *     property stencil:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getBoundaryType, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1126, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":1125
 *     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_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":1130
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1131
 *         """Stencil type and width."""
 *         def __get__(self) -> tuple[StencilType, int]:
 *             return self.getStencil()             # <<<<<<<<<<<<<<
 * 
 *     property stencil_type:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getStencil, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":1130
 *     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_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":1135
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1136
 *         """Stencil type."""
 *         def __get__(self) -> str:
 *             return self.getStencilType()             # <<<<<<<<<<<<<<
 * 
 *     property stencil_width:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getStencilType, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":1135
 *     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_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":1140
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1141
 *         """Elementwise stencil width."""
 *         def __get__(self) -> int:
 *             return self.getStencilWidth()             # <<<<<<<<<<<<<<
 * 
 *     property ranges:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getStencilWidth, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":1140
 *     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_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":1145
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1146
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getRanges, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":1145
 *     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_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":1150
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1151
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getGhostRanges, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":1150
 *     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_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":1155
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1156
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getCorners, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":1155
 *     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_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":1160
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMDA.pyx":1161
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getGhostCorners, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(56, 1161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMDA.pyx":1160
 *     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_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":14
 *     #
 * 
 *     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:14");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_1create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 14, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 14, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(57, 14, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 14, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 14, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":29
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(57, 29, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":30
 *         """
 *         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":31
 *         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, 31, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":32
 *         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, 32, __pyx_L1_error)
  __pyx_v_self->__pyx_base.dm = __pyx_v_newdm;

  /* "petsc4py/PETSc/DMPlex.pyx":33
 *         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":14
 *     #
 * 
 *     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":35
 *         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:35");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_3createFromCellList = {"createFromCellList", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_3createFromCellList, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_2createFromCellList};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dim,&__pyx_mstate_global->__pyx_n_u_cells,&__pyx_mstate_global->__pyx_n_u_coords,&__pyx_mstate_global->__pyx_n_u_interpolate,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 35, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 35, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 35, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 35, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 35, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 35, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createFromCellList", 0) < (0)) __PYX_ERR(57, 35, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createFromCellList", 0, 3, 5, i); __PYX_ERR(57, 35, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 35, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 35, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 35, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 35, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 35, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 35, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  PetscErrorCode __pyx_t_10;
  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":59
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(57, 59, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":60
 *         """
 *         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 = __Pyx_PyObject_IsTrue(__pyx_v_interpolate); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(57, 60, __pyx_L1_error)
  __pyx_v_interp = __pyx_t_2;

  /* "petsc4py/PETSc/DMPlex.pyx":61
 *         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":62
 *         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, 62, __pyx_L1_error)
  __pyx_v_cdim = __pyx_t_3;

  /* "petsc4py/PETSc/DMPlex.pyx":63
 *         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":64
 *         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":65
 *         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":66
 *         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":67
 *         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":68
 *         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":69
 *         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":70
 *         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, 70, __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":71
 *         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, 71, __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":72
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 72, __pyx_L1_error)
  __pyx_t_5 = (PyArray_NDIM(((PyArrayObject *)__pyx_v_cells)) != 2);
  if (unlikely(__pyx_t_5)) {
    __pyx_t_6 = NULL;

    /* "petsc4py/PETSc/DMPlex.pyx":74
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 74, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyLong_From_int(PyArray_NDIM(((PyArrayObject *)__pyx_v_cells))); if (unlikely(!__pyx_t_7)) __PYX_ERR(57, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_cell_indices_must_have_two_dimen, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(57, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 72, __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(57, 72, __pyx_L1_error)

    /* "petsc4py/PETSc/DMPlex.pyx":72
 *         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)))
*/
  }

  /* "petsc4py/PETSc/DMPlex.pyx":75
 *                 ("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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 75, __pyx_L1_error)
  __pyx_t_5 = (PyArray_NDIM(((PyArrayObject *)__pyx_v_coords)) != 2);
  if (unlikely(__pyx_t_5)) {
    __pyx_t_8 = NULL;

    /* "petsc4py/PETSc/DMPlex.pyx":77
 *         if PyArray_NDIM(coords) != 2: raise ValueError(
 *                 ("coords vertices must have two dimensions: "
 *                  "coords.ndim=%d") % (PyArray_NDIM(coords)))             # <<<<<<<<<<<<<<
 *         numCells     = <PetscInt> PyArray_DIM(cells, 0)
 *         numCorners   = <PetscInt> PyArray_DIM(cells, 1)
*/
    if (!(likely(((__pyx_v_coords) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_coords, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 77, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyLong_From_int(PyArray_NDIM(((PyArrayObject *)__pyx_v_coords))); if (unlikely(!__pyx_t_6)) __PYX_ERR(57, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_coords_vertices_must_have_two_di, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(57, 77, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
      __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 75, __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(57, 75, __pyx_L1_error)

    /* "petsc4py/PETSc/DMPlex.pyx":75
 *                 ("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)))
*/
  }

  /* "petsc4py/PETSc/DMPlex.pyx":78
 *                 ("coords vertices must have two dimensions: "
 *                  "coords.ndim=%d") % (PyArray_NDIM(coords)))
 *         numCells     = <PetscInt> PyArray_DIM(cells, 0)             # <<<<<<<<<<<<<<
 *         numCorners   = <PetscInt> PyArray_DIM(cells, 1)
 *         numVertices  = <PetscInt> PyArray_DIM(coords, 0)
*/
  if (!(likely(((__pyx_v_cells) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cells, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 78, __pyx_L1_error)
  __pyx_v_numCells = ((PetscInt)PyArray_DIM(((PyArrayObject *)__pyx_v_cells), 0));

  /* "petsc4py/PETSc/DMPlex.pyx":79
 *                  "coords.ndim=%d") % (PyArray_NDIM(coords)))
 *         numCells     = <PetscInt> PyArray_DIM(cells, 0)
 *         numCorners   = <PetscInt> PyArray_DIM(cells, 1)             # <<<<<<<<<<<<<<
 *         numVertices  = <PetscInt> PyArray_DIM(coords, 0)
 *         spaceDim     = <PetscInt> PyArray_DIM(coords, 1)
*/
  if (!(likely(((__pyx_v_cells) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cells, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 79, __pyx_L1_error)
  __pyx_v_numCorners = ((PetscInt)PyArray_DIM(((PyArrayObject *)__pyx_v_cells), 1));

  /* "petsc4py/PETSc/DMPlex.pyx":80
 *         numCells     = <PetscInt> PyArray_DIM(cells, 0)
 *         numCorners   = <PetscInt> PyArray_DIM(cells, 1)
 *         numVertices  = <PetscInt> PyArray_DIM(coords, 0)             # <<<<<<<<<<<<<<
 *         spaceDim     = <PetscInt> PyArray_DIM(coords, 1)
 *         cellVertices = <PetscInt*> PyArray_DATA(cells)
*/
  if (!(likely(((__pyx_v_coords) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_coords, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 80, __pyx_L1_error)
  __pyx_v_numVertices = ((PetscInt)PyArray_DIM(((PyArrayObject *)__pyx_v_coords), 0));

  /* "petsc4py/PETSc/DMPlex.pyx":81
 *         numCorners   = <PetscInt> PyArray_DIM(cells, 1)
 *         numVertices  = <PetscInt> PyArray_DIM(coords, 0)
 *         spaceDim     = <PetscInt> PyArray_DIM(coords, 1)             # <<<<<<<<<<<<<<
 *         cellVertices = <PetscInt*> PyArray_DATA(cells)
 *         vertexCoords = <PetscReal*> PyArray_DATA(coords)
*/
  if (!(likely(((__pyx_v_coords) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_coords, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 81, __pyx_L1_error)
  __pyx_v_spaceDim = ((PetscInt)PyArray_DIM(((PyArrayObject *)__pyx_v_coords), 1));

  /* "petsc4py/PETSc/DMPlex.pyx":82
 *         numVertices  = <PetscInt> PyArray_DIM(coords, 0)
 *         spaceDim     = <PetscInt> PyArray_DIM(coords, 1)
 *         cellVertices = <PetscInt*> PyArray_DATA(cells)             # <<<<<<<<<<<<<<
 *         vertexCoords = <PetscReal*> PyArray_DATA(coords)
 *         CHKERR(DMPlexCreateFromCellListPetsc(ccomm, cdim, numCells, numVertices,
*/
  if (!(likely(((__pyx_v_cells) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cells, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 82, __pyx_L1_error)
  __pyx_v_cellVertices = ((PetscInt *)PyArray_DATA(((PyArrayObject *)__pyx_v_cells)));

  /* "petsc4py/PETSc/DMPlex.pyx":83
 *         spaceDim     = <PetscInt> PyArray_DIM(coords, 1)
 *         cellVertices = <PetscInt*> PyArray_DATA(cells)
 *         vertexCoords = <PetscReal*> 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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ndarray))))) __PYX_ERR(57, 83, __pyx_L1_error)
  __pyx_v_vertexCoords = ((PetscReal *)PyArray_DATA(((PyArrayObject *)__pyx_v_coords)));

  /* "petsc4py/PETSc/DMPlex.pyx":84
 *         cellVertices = <PetscInt*> PyArray_DATA(cells)
 *         vertexCoords = <PetscReal*> PyArray_DATA(coords)
 *         CHKERR(DMPlexCreateFromCellListPetsc(ccomm, cdim, numCells, numVertices,             # <<<<<<<<<<<<<<
 *                                              numCorners, interp, cellVertices,
 *                                              spaceDim, vertexCoords, &newdm))
*/
  __pyx_t_10 = __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_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 84, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":87
 *                                              numCorners, interp, cellVertices,
 *                                              spaceDim, vertexCoords, &newdm))
 *         CHKERR(PetscCLEAR(self.obj)); self.dm = newdm             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_10 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 87, __pyx_L1_error)
  __pyx_v_self->__pyx_base.dm = __pyx_v_newdm;

  /* "petsc4py/PETSc/DMPlex.pyx":88
 *                                              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":35
 *         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_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __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":90
 *         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, localizationHeight: int | None = 0, sparseLocalize: 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, localizationHeight: int | None = 0, sparseLocalize: 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        localizationHeight\n            Flag to localize edges and faces in addition to cells;\n            only significant for periodic meshes.\n        sparseLocalize\n            Flag to localize coordinates only for cells near the\n            periodic boundary; only significant for periodic meshes.\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:90");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_5createBoxMesh = {"createBoxMesh", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_5createBoxMesh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_4createBoxMesh};
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_localizationHeight = 0;
  PyObject *__pyx_v_sparseLocalize = 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[9] = {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("createBoxMesh (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_faces,&__pyx_mstate_global->__pyx_n_u_lower,&__pyx_mstate_global->__pyx_n_u_upper,&__pyx_mstate_global->__pyx_n_u_simplex,&__pyx_mstate_global->__pyx_n_u_periodic,&__pyx_mstate_global->__pyx_n_u_interpolate,&__pyx_mstate_global->__pyx_n_u_localizationHeight,&__pyx_mstate_global->__pyx_n_u_sparseLocalize,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 90, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createBoxMesh", 0) < (0)) __PYX_ERR(57, 90, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_tuple[7]));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_tuple[8]));

      /* "petsc4py/PETSc/DMPlex.pyx":91
 * 
 *     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, localizationHeight: int | None = 0, sparseLocalize: bool | None = True, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a mesh on the tensor product of intervals.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createBoxMesh", 0, 1, 9, i); __PYX_ERR(57, 90, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 90, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMPlex.pyx":90
 *         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, localizationHeight: int | None = 0, sparseLocalize: bool | None = True, comm: Comm | None = None) -> Self:
 *         """Create a mesh on the tensor product of intervals.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_tuple[7]));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_tuple[8]));

      /* "petsc4py/PETSc/DMPlex.pyx":91
 * 
 *     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, localizationHeight: int | None = 0, sparseLocalize: bool | None = True, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a mesh on the tensor product of intervals.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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_localizationHeight = values[6];
    __pyx_v_sparseLocalize = values[7];
    __pyx_v_comm = values[8];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createBoxMesh", 0, 1, 9, __pyx_nargs); __PYX_ERR(57, 90, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_localizationHeight, __pyx_v_sparseLocalize, __pyx_v_comm);

  /* "petsc4py/PETSc/DMPlex.pyx":90
 *         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, localizationHeight: int | None = 0, sparseLocalize: bool | None = True, comm: Comm | None = None) -> Self:
 *         """Create a mesh on the tensor product of intervals.
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_localizationHeight, PyObject *__pyx_v_sparseLocalize, 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;
  PetscInt __pyx_v_clocalizationHeight;
  PetscBool __pyx_v_csparseLocalize;
  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":126
 * 
 *         """
 *         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":127
 *         """
 *         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":128
 *         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, 128, __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":129
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(57, 129, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(57, 129, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DMPlex.pyx":131
 *         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":132
 *         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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 132, __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, 132, __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":134
 *         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":135
 *         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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 135, __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, 135, __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":137
 *         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, 137, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":138
 *         cdef PetscDMBoundaryType btype[3]
 *         asBoundary(periodic, &btype[0], &btype[1], &btype[2])
 *         cdef PetscBool csimplex = simplex             # <<<<<<<<<<<<<<
 *         cdef PetscBool cinterp = interpolate
 *         cdef PetscInt  clocalizationHeight = asInt(localizationHeight)
*/
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_simplex); if (unlikely((__pyx_t_6 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(57, 138, __pyx_L1_error)
  __pyx_v_csimplex = __pyx_t_6;

  /* "petsc4py/PETSc/DMPlex.pyx":139
 *         asBoundary(periodic, &btype[0], &btype[1], &btype[2])
 *         cdef PetscBool csimplex = simplex
 *         cdef PetscBool cinterp = interpolate             # <<<<<<<<<<<<<<
 *         cdef PetscInt  clocalizationHeight = asInt(localizationHeight)
 *         cdef PetscBool csparseLocalize = sparseLocalize
*/
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_interpolate); if (unlikely((__pyx_t_6 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(57, 139, __pyx_L1_error)
  __pyx_v_cinterp = __pyx_t_6;

  /* "petsc4py/PETSc/DMPlex.pyx":140
 *         cdef PetscBool csimplex = simplex
 *         cdef PetscBool cinterp = interpolate
 *         cdef PetscInt  clocalizationHeight = asInt(localizationHeight)             # <<<<<<<<<<<<<<
 *         cdef PetscBool csparseLocalize = sparseLocalize
 *         cdef MPI_Comm  ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_localizationHeight); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 140, __pyx_L1_error)
  __pyx_v_clocalizationHeight = __pyx_t_4;

  /* "petsc4py/PETSc/DMPlex.pyx":141
 *         cdef PetscBool cinterp = interpolate
 *         cdef PetscInt  clocalizationHeight = asInt(localizationHeight)
 *         cdef PetscBool csparseLocalize = sparseLocalize             # <<<<<<<<<<<<<<
 *         cdef MPI_Comm  ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
 *         cdef PetscDM   newdm = NULL
*/
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_sparseLocalize); if (unlikely((__pyx_t_6 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(57, 141, __pyx_L1_error)
  __pyx_v_csparseLocalize = __pyx_t_6;

  /* "petsc4py/PETSc/DMPlex.pyx":142
 *         cdef PetscInt  clocalizationHeight = asInt(localizationHeight)
 *         cdef PetscBool csparseLocalize = sparseLocalize
 *         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 const )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 csparseLocalize = sparseLocalize
 *         cdef MPI_Comm  ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
 *         cdef PetscDM   newdm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexCreateBoxMesh(ccomm, dim, csimplex, cfaces,
 *                                    clower, cupper, btype, cinterp, clocalizationHeight, csparseLocalize, &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, clocalizationHeight, csparseLocalize, &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_clocalizationHeight, __pyx_v_csparseLocalize, (&__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, clocalizationHeight, csparseLocalize, &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, clocalizationHeight, csparseLocalize, &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":90
 *         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, localizationHeight: int | None = 0, sparseLocalize: 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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_7createBoxSurfaceMesh = {"createBoxSurfaceMesh", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_7createBoxSurfaceMesh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_6createBoxSurfaceMesh};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_faces,&__pyx_mstate_global->__pyx_n_u_lower,&__pyx_mstate_global->__pyx_n_u_upper,&__pyx_mstate_global->__pyx_n_u_interpolate,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 149, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createBoxSurfaceMesh", 0) < (0)) __PYX_ERR(57, 149, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_tuple[7]));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_tuple[8]));

      /* "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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createBoxSurfaceMesh", 0, 1, 5, i); __PYX_ERR(57, 149, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 149, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 149, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_tuple[7]));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_tuple[8]));

      /* "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.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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(((PyObject *)(((PyTypeObject*)PyExc_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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); 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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); 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 = __Pyx_PyObject_IsTrue(__pyx_v_interpolate); if (unlikely((__pyx_t_6 == ((PetscBool)-1)) && 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 const )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) -> Self:
*/
  __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) -> Self:             # <<<<<<<<<<<<<<
 *         """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) -> Self\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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_9createFromFile = {"createFromFile", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_9createFromFile, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_8createFromFile};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename,&__pyx_mstate_global->__pyx_n_u_plexname,&__pyx_mstate_global->__pyx_n_u_interpolate,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 192, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createFromFile", 0) < (0)) __PYX_ERR(57, 192, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_unnamed));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createFromFile", 0, 1, 4, i); __PYX_ERR(57, 192, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 192, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 192, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_unnamed));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 const )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 = __Pyx_PyObject_IsTrue(__pyx_v_interpolate); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && 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) -> Self:             # <<<<<<<<<<<<<<
 *         """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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_11createCGNS = {"createCGNS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_11createCGNS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_10createCGNS};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cgid,&__pyx_mstate_global->__pyx_n_u_interpolate,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 226, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createCGNS", 0) < (0)) __PYX_ERR(57, 226, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createCGNS", 0, 1, 3, i); __PYX_ERR(57, 226, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 226, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 226, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "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 const )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 = __Pyx_PyObject_IsTrue(__pyx_v_interpolate); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && 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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_13createCGNSFromFile = {"createCGNSFromFile", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_13createCGNSFromFile, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_12createCGNSFromFile};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename,&__pyx_mstate_global->__pyx_n_u_interpolate,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 254, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 254, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 254, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 254, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createCGNSFromFile", 0) < (0)) __PYX_ERR(57, 254, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createCGNSFromFile", 0, 1, 3, i); __PYX_ERR(57, 254, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 254, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 254, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 254, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 const )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 = __Pyx_PyObject_IsTrue(__pyx_v_interpolate); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && 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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_15createExodusFromFile = {"createExodusFromFile", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_15createExodusFromFile, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_14createExodusFromFile};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename,&__pyx_mstate_global->__pyx_n_u_interpolate,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 283, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createExodusFromFile", 0) < (0)) __PYX_ERR(57, 283, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createExodusFromFile", 0, 1, 3, i); __PYX_ERR(57, 283, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 283, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 283, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 const )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 = __Pyx_PyObject_IsTrue(__pyx_v_interpolate); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && 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 file 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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_17createExodus = {"createExodus", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_17createExodus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_16createExodus};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_exoid,&__pyx_mstate_global->__pyx_n_u_interpolate,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 312, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createExodus", 0) < (0)) __PYX_ERR(57, 312, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createExodus", 0, 1, 3, i); __PYX_ERR(57, 312, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 312, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "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 const )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 = __Pyx_PyObject_IsTrue(__pyx_v_interpolate); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && 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, <int> 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, <int> 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, <int> cexoid, interp, &newdm))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscCLEAR(self.obj)); self.dm = newdm
 *         return self
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateExodus(__pyx_v_ccomm, ((int)__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, <int> 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, <int> 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 <d>`` 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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_19createGmsh = {"createGmsh", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_19createGmsh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_18createGmsh};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,&__pyx_mstate_global->__pyx_n_u_interpolate,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 339, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 339, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 339, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 339, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createGmsh", 0) < (0)) __PYX_ERR(57, 339, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createGmsh", 0, 1, 3, i); __PYX_ERR(57, 339, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 339, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 339, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 339, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "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 const )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 = __Pyx_PyObject_IsTrue(__pyx_v_interpolate); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && 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 createCoordinateSpace(self, degree: int, localized: bool, project: bool) -> None:
*/
  __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 createCoordinateSpace(self, degree: int, localized: bool, project: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Create a finite element space for the coordinates.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_21createCoordinateSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_20createCoordinateSpace, "DMPlex.createCoordinateSpace(self, degree: int, localized: bool, project: bool) -> None\nCreate a finite element space for the coordinates.\n\n        Collective.\n\n        Parameters\n        ----------\n        degree\n            The degree of the finite element.\n        localized\n            Flag to create a localized (DG) coordinate space.\n        project\n            Flag to project current coordinates into the space.\n\n        See Also\n        --------\n        DM, DMPlex, petsc.DMPlexCreateCoordinateSpace\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:377");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_21createCoordinateSpace = {"createCoordinateSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_21createCoordinateSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_20createCoordinateSpace};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_21createCoordinateSpace(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_localized = 0;
  PyObject *__pyx_v_project = 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("createCoordinateSpace (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_degree,&__pyx_mstate_global->__pyx_n_u_localized,&__pyx_mstate_global->__pyx_n_u_project,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 377, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 377, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 377, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 377, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createCoordinateSpace", 0) < (0)) __PYX_ERR(57, 377, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createCoordinateSpace", 1, 3, 3, i); __PYX_ERR(57, 377, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 377, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 377, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 377, __pyx_L3_error)
    }
    __pyx_v_degree = values[0];
    __pyx_v_localized = values[1];
    __pyx_v_project = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createCoordinateSpace", 1, 3, 3, __pyx_nargs); __PYX_ERR(57, 377, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCoordinateSpace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_20createCoordinateSpace(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_degree, __pyx_v_localized, __pyx_v_project);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_20createCoordinateSpace(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_degree, PyObject *__pyx_v_localized, PyObject *__pyx_v_project) {
  PetscInt __pyx_v_cdegree;
  PetscBool __pyx_v_clocalized;
  PetscBool __pyx_v_cproject;
  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("createCoordinateSpace", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":396
 * 
 *         """
 *         cdef PetscInt cdegree = asInt(degree)             # <<<<<<<<<<<<<<
 *         cdef PetscBool clocalized = localized
 *         cdef PetscBool cproject = project
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_degree); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 396, __pyx_L1_error)
  __pyx_v_cdegree = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":397
 *         """
 *         cdef PetscInt cdegree = asInt(degree)
 *         cdef PetscBool clocalized = localized             # <<<<<<<<<<<<<<
 *         cdef PetscBool cproject = project
 *         CHKERR(DMPlexCreateCoordinateSpace(self.dm, cdegree, clocalized, cproject))
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_localized); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(57, 397, __pyx_L1_error)
  __pyx_v_clocalized = __pyx_t_2;

  /* "petsc4py/PETSc/DMPlex.pyx":398
 *         cdef PetscInt cdegree = asInt(degree)
 *         cdef PetscBool clocalized = localized
 *         cdef PetscBool cproject = project             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexCreateCoordinateSpace(self.dm, cdegree, clocalized, cproject))
 * 
*/
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_project); if (unlikely((__pyx_t_2 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(57, 398, __pyx_L1_error)
  __pyx_v_cproject = __pyx_t_2;

  /* "petsc4py/PETSc/DMPlex.pyx":399
 *         cdef PetscBool clocalized = localized
 *         cdef PetscBool cproject = project
 *         CHKERR(DMPlexCreateCoordinateSpace(self.dm, cdegree, clocalized, cproject))             # <<<<<<<<<<<<<<
 * 
 *     def createCohesiveSubmesh(self, hasLagrange: bool, value: int) -> DMPlex:
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateCoordinateSpace(__pyx_v_self->__pyx_base.dm, __pyx_v_cdegree, __pyx_v_clocalized, __pyx_v_cproject)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 399, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":377
 *         return self
 * 
 *     def createCoordinateSpace(self, degree: int, localized: bool, project: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Create a finite element space for the coordinates.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createCoordinateSpace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMPlex.pyx":401
 *         CHKERR(DMPlexCreateCoordinateSpace(self.dm, cdegree, clocalized, cproject))
 * 
 *     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_23createCohesiveSubmesh(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_22createCohesiveSubmesh, "DMPlex.createCohesiveSubmesh(self, hasLagrange: bool, value: int) -> DMPlex\nExtract the hypersurface defined by one face of the cohesive cells.\n\n        Collective.\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:401");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_23createCohesiveSubmesh = {"createCohesiveSubmesh", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_23createCohesiveSubmesh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_22createCohesiveSubmesh};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_23createCohesiveSubmesh(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_hasLagrange,&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 401, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createCohesiveSubmesh", 0) < (0)) __PYX_ERR(57, 401, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createCohesiveSubmesh", 1, 2, 2, i); __PYX_ERR(57, 401, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 401, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 401, __pyx_L3_error)
    }
    __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, 401, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_22createCohesiveSubmesh(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_hasLagrange, __pyx_v_value);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_22createCohesiveSubmesh(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createCohesiveSubmesh", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":418
 * 
 *         """
 *         cdef PetscBool flag = hasLagrange             # <<<<<<<<<<<<<<
 *         cdef PetscInt cvalue = asInt(value)
 *         cdef DM subdm = DMPlex()
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_hasLagrange); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(57, 418, __pyx_L1_error)
  __pyx_v_flag = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":419
 *         """
 *         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, 419, __pyx_L1_error)
  __pyx_v_cvalue = __pyx_t_2;

  /* "petsc4py/PETSc/DMPlex.pyx":420
 *         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_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 420, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_3);
  }
  __pyx_v_subdm = ((struct PyPetscDMObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":421
 *         cdef PetscInt cvalue = asInt(value)
 *         cdef DM subdm = DMPlex()
 *         CHKERR(DMPlexCreateCohesiveSubmesh(self.dm, flag, NULL, cvalue, &subdm.dm))             # <<<<<<<<<<<<<<
 *         return subdm
 * 
*/
  __pyx_t_6 = __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_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 421, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":422
 *         cdef DM subdm = DMPlex()
 *         CHKERR(DMPlexCreateCohesiveSubmesh(self.dm, flag, NULL, cvalue, &subdm.dm))
 *         return subdm             # <<<<<<<<<<<<<<
 * 
 *     def createColoring(self, depth: int = 0, distance: int = 1) -> list:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_subdm);
  __pyx_r = ((PyObject *)__pyx_v_subdm);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":401
 *         CHKERR(DMPlexCreateCoordinateSpace(self.dm, cdegree, clocalized, cproject))
 * 
 *     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_XDECREF(__pyx_t_4);
  __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":424
 *         return subdm
 * 
 *     def createColoring(self, depth: int = 0, distance: int = 1) -> list:             # <<<<<<<<<<<<<<
 *         """Return the coloring of the connectivity graph of entities in the DMPlex.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_25createColoring(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_24createColoring, "DMPlex.createColoring(self, depth: int = 0, distance: int = 1) -> list\nReturn the coloring of the connectivity graph of entities in the DMPlex.\n\n        Collective.\n\n        Parameters\n        ----------\n        depth\n            The entity dimension of nodes in the connectivity graph.\n        distance\n            The distance of the coloring (either 1 or 2).\n\n        See Also\n        --------\n        DM, DMPlex, petsc.DMPlexCreateColoring\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:424");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_25createColoring = {"createColoring", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_25createColoring, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_24createColoring};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_25createColoring(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_depth = 0;
  PyObject *__pyx_v_distance = 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("createColoring (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_depth,&__pyx_mstate_global->__pyx_n_u_distance,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 424, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createColoring", 0) < (0)) __PYX_ERR(57, 424, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 424, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
    }
    __pyx_v_depth = values[0];
    __pyx_v_distance = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createColoring", 0, 0, 2, __pyx_nargs); __PYX_ERR(57, 424, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createColoring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_24createColoring(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_depth, __pyx_v_distance);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_24createColoring(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_depth, PyObject *__pyx_v_distance) {
  PetscInt __pyx_v_cdepth;
  PetscInt __pyx_v_cdistance;
  PetscInt __pyx_v_ncolors;
  IS *__pyx_v_iscolors;
  ISColoring __pyx_v_coloring;
  PyObject *__pyx_v_isets = 0;
  long __pyx_9genexpr21__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscInt __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("createColoring", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":441
 * 
 *         """
 *         cdef PetscInt cdepth = asInt(depth)             # <<<<<<<<<<<<<<
 *         cdef PetscInt cdistance = asInt(distance)
 *         cdef PetscInt ncolors = 0
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_depth); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 441, __pyx_L1_error)
  __pyx_v_cdepth = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":442
 *         """
 *         cdef PetscInt cdepth = asInt(depth)
 *         cdef PetscInt cdistance = asInt(distance)             # <<<<<<<<<<<<<<
 *         cdef PetscInt ncolors = 0
 *         cdef PetscIS *iscolors = NULL
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_distance); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 442, __pyx_L1_error)
  __pyx_v_cdistance = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":443
 *         cdef PetscInt cdepth = asInt(depth)
 *         cdef PetscInt cdistance = asInt(distance)
 *         cdef PetscInt ncolors = 0             # <<<<<<<<<<<<<<
 *         cdef PetscIS *iscolors = NULL
 *         cdef ISColoring coloring = NULL
*/
  __pyx_v_ncolors = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":444
 *         cdef PetscInt cdistance = asInt(distance)
 *         cdef PetscInt ncolors = 0
 *         cdef PetscIS *iscolors = NULL             # <<<<<<<<<<<<<<
 *         cdef ISColoring coloring = NULL
 * 
*/
  __pyx_v_iscolors = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":445
 *         cdef PetscInt ncolors = 0
 *         cdef PetscIS *iscolors = NULL
 *         cdef ISColoring coloring = NULL             # <<<<<<<<<<<<<<
 * 
 *         CHKERR(DMPlexCreateColoring(self.dm, cdepth, cdistance, &coloring))
*/
  __pyx_v_coloring = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":447
 *         cdef ISColoring coloring = NULL
 * 
 *         CHKERR(DMPlexCreateColoring(self.dm, cdepth, cdistance, &coloring))             # <<<<<<<<<<<<<<
 *         CHKERR(ISColoringGetIS(coloring, PETSC_USE_POINTER, &ncolors, &iscolors))
 * 
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateColoring(__pyx_v_self->__pyx_base.dm, __pyx_v_cdepth, __pyx_v_cdistance, (&__pyx_v_coloring))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 447, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":448
 * 
 *         CHKERR(DMPlexCreateColoring(self.dm, cdepth, cdistance, &coloring))
 *         CHKERR(ISColoringGetIS(coloring, PETSC_USE_POINTER, &ncolors, &iscolors))             # <<<<<<<<<<<<<<
 * 
 *         cdef list isets = [ref_IS(iscolors[i]) for i from 0 <= i < ncolors]
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(ISColoringGetIS(__pyx_v_coloring, PETSC_USE_POINTER, (&__pyx_v_ncolors), (&__pyx_v_iscolors))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 448, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":450
 *         CHKERR(ISColoringGetIS(coloring, PETSC_USE_POINTER, &ncolors, &iscolors))
 * 
 *         cdef list isets = [ref_IS(iscolors[i]) for i from 0 <= i < ncolors]             # <<<<<<<<<<<<<<
 *         return isets
 * 
*/
  { /* enter inner scope */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_v_ncolors;
    for (__pyx_9genexpr21__pyx_v_i = 0; __pyx_9genexpr21__pyx_v_i < __pyx_t_1; __pyx_9genexpr21__pyx_v_i++) {
      __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_iscolors[__pyx_9genexpr21__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 450, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(57, 450, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  } /* exit inner scope */
  __pyx_v_isets = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":451
 * 
 *         cdef list isets = [ref_IS(iscolors[i]) for i from 0 <= i < ncolors]
 *         return isets             # <<<<<<<<<<<<<<
 * 
 *     def filter(self, label: DMLabel | None = None, value: int | None = None, ignoreHalo: bool = False,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_isets);
  __pyx_r = __pyx_v_isets;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":424
 *         return subdm
 * 
 *     def createColoring(self, depth: int = 0, distance: int = 1) -> list:             # <<<<<<<<<<<<<<
 *         """Return the coloring of the connectivity graph of entities in the DMPlex.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createColoring", __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/DMPlex.pyx":453
 *         return isets
 * 
 *     def filter(self, label: DMLabel | None = None, value: int | None = None, ignoreHalo: bool = False,             # <<<<<<<<<<<<<<
 *                sanitizeSubMesh: bool = False, comm: Comm | None = None) -> tuple[DMPlex, SF]:
 *         """Extract a subset of mesh cells defined by a label as a separate mesh.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_27filter(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_26filter, "DMPlex.filter(self, label: DMLabel | None = None, value: int | None = None, ignoreHalo: bool = False, sanitizeSubMesh: bool = False, comm: Comm | None = None) -> tuple[DMPlex, SF]\nExtract a subset of mesh cells defined by a label as a separate mesh.\n\n        Collective.\n\n        Parameters\n        ----------\n        cellLabel\n            label marking cells to be contained in the new mesh\n        value\n            label value to use\n        ignoreHalo\n            Flag indicating if labeled points that are in the halo are ignored\n        sanitizeSubmesh\n            Flag indicating if a subpoint is forced to be owned by a rank that owns\n            a subcell that contains that point in its closure\n        comm\n           The communicator you want the mesh on\n\n        See Also\n        --------\n        DM, DMPlex, petsc.DMPlexFilter\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:453");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_27filter = {"filter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_27filter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_26filter};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_27filter(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_ignoreHalo = 0;
  PyObject *__pyx_v_sanitizeSubMesh = 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("filter (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_label,&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_ignoreHalo,&__pyx_mstate_global->__pyx_n_u_sanitizeSubMesh,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 453, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "filter", 0) < (0)) __PYX_ERR(57, 453, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "petsc4py/PETSc/DMPlex.pyx":454
 * 
 *     def filter(self, label: DMLabel | None = None, value: int | None = None, ignoreHalo: bool = False,
 *                sanitizeSubMesh: bool = False, comm: Comm | None = None) -> tuple[DMPlex, SF]:             # <<<<<<<<<<<<<<
 *         """Extract a subset of mesh cells defined by a label as a separate mesh.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMPlex.pyx":453
 *         return isets
 * 
 *     def filter(self, label: DMLabel | None = None, value: int | None = None, ignoreHalo: bool = False,             # <<<<<<<<<<<<<<
 *                sanitizeSubMesh: bool = False, comm: Comm | None = None) -> tuple[DMPlex, SF]:
 *         """Extract a subset of mesh cells defined by a label as a separate mesh.
*/
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "petsc4py/PETSc/DMPlex.pyx":454
 * 
 *     def filter(self, label: DMLabel | None = None, value: int | None = None, ignoreHalo: bool = False,
 *                sanitizeSubMesh: bool = False, comm: Comm | None = None) -> tuple[DMPlex, SF]:             # <<<<<<<<<<<<<<
 *         """Extract a subset of mesh cells defined by a label as a separate mesh.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_label = values[0];
    __pyx_v_value = values[1];
    __pyx_v_ignoreHalo = values[2];
    __pyx_v_sanitizeSubMesh = values[3];
    __pyx_v_comm = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("filter", 0, 0, 5, __pyx_nargs); __PYX_ERR(57, 453, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_26filter(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_label, __pyx_v_value, __pyx_v_ignoreHalo, __pyx_v_sanitizeSubMesh, __pyx_v_comm);

  /* "petsc4py/PETSc/DMPlex.pyx":453
 *         return isets
 * 
 *     def filter(self, label: DMLabel | None = None, value: int | None = None, ignoreHalo: bool = False,             # <<<<<<<<<<<<<<
 *                sanitizeSubMesh: bool = False, comm: Comm | None = None) -> tuple[DMPlex, SF]:
 *         """Extract a subset of mesh cells defined by a label as a separate mesh.
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_26filter(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_label, PyObject *__pyx_v_value, PyObject *__pyx_v_ignoreHalo, PyObject *__pyx_v_sanitizeSubMesh, PyObject *__pyx_v_comm) {
  struct PyPetscDMObject *__pyx_v_subdm = 0;
  DMLabel __pyx_v_clbl;
  MPI_Comm __pyx_v_ccomm;
  MPI_Comm __pyx_v_dmcomm;
  PetscInt __pyx_v_cvalue;
  PetscBool __pyx_v_cignoreHalo;
  PetscBool __pyx_v_csanitize;
  struct PyPetscSFObject *__pyx_v_sf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscBool __pyx_t_4;
  int __pyx_t_5;
  DMLabel __pyx_t_6;
  PetscInt __pyx_t_7;
  PetscErrorCode __pyx_t_8;
  MPI_Comm __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("filter", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":478
 * 
 *         """
 *         cdef DM subdm = DMPlex()             # <<<<<<<<<<<<<<
 *         cdef PetscDMLabel clbl = NULL
 *         cdef MPI_Comm ccomm = MPI_COMM_NULL
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 478, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_subdm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":479
 *         """
 *         cdef DM subdm = DMPlex()
 *         cdef PetscDMLabel clbl = NULL             # <<<<<<<<<<<<<<
 *         cdef MPI_Comm ccomm = MPI_COMM_NULL
 *         cdef MPI_Comm dmcomm = MPI_COMM_NULL
*/
  __pyx_v_clbl = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":480
 *         cdef DM subdm = DMPlex()
 *         cdef PetscDMLabel clbl = NULL
 *         cdef MPI_Comm ccomm = MPI_COMM_NULL             # <<<<<<<<<<<<<<
 *         cdef MPI_Comm dmcomm = MPI_COMM_NULL
 *         cdef PetscInt cvalue = -1
*/
  __pyx_v_ccomm = MPI_COMM_NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":481
 *         cdef PetscDMLabel clbl = NULL
 *         cdef MPI_Comm ccomm = MPI_COMM_NULL
 *         cdef MPI_Comm dmcomm = MPI_COMM_NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt cvalue = -1
 *         cdef PetscBool cignoreHalo = ignoreHalo
*/
  __pyx_v_dmcomm = MPI_COMM_NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":482
 *         cdef MPI_Comm ccomm = MPI_COMM_NULL
 *         cdef MPI_Comm dmcomm = MPI_COMM_NULL
 *         cdef PetscInt cvalue = -1             # <<<<<<<<<<<<<<
 *         cdef PetscBool cignoreHalo = ignoreHalo
 *         cdef PetscBool csanitize = sanitizeSubMesh
*/
  __pyx_v_cvalue = -1L;

  /* "petsc4py/PETSc/DMPlex.pyx":483
 *         cdef MPI_Comm dmcomm = MPI_COMM_NULL
 *         cdef PetscInt cvalue = -1
 *         cdef PetscBool cignoreHalo = ignoreHalo             # <<<<<<<<<<<<<<
 *         cdef PetscBool csanitize = sanitizeSubMesh
 *         cdef SF sf = SF()
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_ignoreHalo); if (unlikely((__pyx_t_4 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(57, 483, __pyx_L1_error)
  __pyx_v_cignoreHalo = __pyx_t_4;

  /* "petsc4py/PETSc/DMPlex.pyx":484
 *         cdef PetscInt cvalue = -1
 *         cdef PetscBool cignoreHalo = ignoreHalo
 *         cdef PetscBool csanitize = sanitizeSubMesh             # <<<<<<<<<<<<<<
 *         cdef SF sf = SF()
 *         if label is not None:
*/
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_sanitizeSubMesh); if (unlikely((__pyx_t_4 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(57, 484, __pyx_L1_error)
  __pyx_v_csanitize = __pyx_t_4;

  /* "petsc4py/PETSc/DMPlex.pyx":485
 *         cdef PetscBool cignoreHalo = ignoreHalo
 *         cdef PetscBool csanitize = sanitizeSubMesh
 *         cdef SF sf = SF()             # <<<<<<<<<<<<<<
 *         if label is not None:
 *             clbl = (<DMLabel?>label).dmlabel
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 485, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":486
 *         cdef PetscBool csanitize = sanitizeSubMesh
 *         cdef SF sf = SF()
 *         if label is not None:             # <<<<<<<<<<<<<<
 *             clbl = (<DMLabel?>label).dmlabel
 *         if value is not None:
*/
  __pyx_t_5 = (__pyx_v_label != Py_None);
  if (__pyx_t_5) {

    /* "petsc4py/PETSc/DMPlex.pyx":487
 *         cdef SF sf = SF()
 *         if label is not None:
 *             clbl = (<DMLabel?>label).dmlabel             # <<<<<<<<<<<<<<
 *         if value is not None:
 *             cvalue = asInt(value)
*/
    if (!(likely(__Pyx_TypeTest(__pyx_v_label, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel)))) __PYX_ERR(57, 487, __pyx_L1_error)
    __pyx_t_6 = ((struct PyPetscDMLabelObject *)__pyx_v_label)->dmlabel;
    __pyx_v_clbl = __pyx_t_6;

    /* "petsc4py/PETSc/DMPlex.pyx":486
 *         cdef PetscBool csanitize = sanitizeSubMesh
 *         cdef SF sf = SF()
 *         if label is not None:             # <<<<<<<<<<<<<<
 *             clbl = (<DMLabel?>label).dmlabel
 *         if value is not None:
*/
  }

  /* "petsc4py/PETSc/DMPlex.pyx":488
 *         if label is not None:
 *             clbl = (<DMLabel?>label).dmlabel
 *         if value is not None:             # <<<<<<<<<<<<<<
 *             cvalue = asInt(value)
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.dm, &dmcomm))
*/
  __pyx_t_5 = (__pyx_v_value != Py_None);
  if (__pyx_t_5) {

    /* "petsc4py/PETSc/DMPlex.pyx":489
 *             clbl = (<DMLabel?>label).dmlabel
 *         if value is not None:
 *             cvalue = asInt(value)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.dm, &dmcomm))
 *         ccomm = def_Comm(comm, dmcomm)
*/
    __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_value); if (unlikely(__pyx_t_7 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 489, __pyx_L1_error)
    __pyx_v_cvalue = __pyx_t_7;

    /* "petsc4py/PETSc/DMPlex.pyx":488
 *         if label is not None:
 *             clbl = (<DMLabel?>label).dmlabel
 *         if value is not None:             # <<<<<<<<<<<<<<
 *             cvalue = asInt(value)
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.dm, &dmcomm))
*/
  }

  /* "petsc4py/PETSc/DMPlex.pyx":490
 *         if value is not None:
 *             cvalue = asInt(value)
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.dm, &dmcomm))             # <<<<<<<<<<<<<<
 *         ccomm = def_Comm(comm, dmcomm)
 *         CHKERR(DMPlexFilter(self.dm, clbl, cvalue, cignoreHalo, csanitize, ccomm, &sf.sf, &subdm.dm))
*/
  __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_self->__pyx_base.dm), (&__pyx_v_dmcomm))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 490, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":491
 *             cvalue = asInt(value)
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.dm, &dmcomm))
 *         ccomm = def_Comm(comm, dmcomm)             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexFilter(self.dm, clbl, cvalue, cignoreHalo, csanitize, ccomm, &sf.sf, &subdm.dm))
 *         return subdm, sf
*/
  __pyx_t_9 = __pyx_f_8petsc4py_5PETSc_def_Comm(__pyx_v_comm, __pyx_v_dmcomm); if (unlikely(__pyx_t_9 == ((MPI_Comm const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(57, 491, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_9;

  /* "petsc4py/PETSc/DMPlex.pyx":492
 *         CHKERR(PetscObjectGetComm(<PetscObject>self.dm, &dmcomm))
 *         ccomm = def_Comm(comm, dmcomm)
 *         CHKERR(DMPlexFilter(self.dm, clbl, cvalue, cignoreHalo, csanitize, ccomm, &sf.sf, &subdm.dm))             # <<<<<<<<<<<<<<
 *         return subdm, sf
 * 
*/
  __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexFilter(__pyx_v_self->__pyx_base.dm, __pyx_v_clbl, __pyx_v_cvalue, __pyx_v_cignoreHalo, __pyx_v_csanitize, __pyx_v_ccomm, (&__pyx_v_sf->sf), (&__pyx_v_subdm->dm))); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 492, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":493
 *         ccomm = def_Comm(comm, dmcomm)
 *         CHKERR(DMPlexFilter(self.dm, clbl, cvalue, cignoreHalo, csanitize, ccomm, &sf.sf, &subdm.dm))
 *         return subdm, sf             # <<<<<<<<<<<<<<
 * 
 *     def getChart(self) -> tuple[int, int]:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_subdm);
  __Pyx_GIVEREF((PyObject *)__pyx_v_subdm);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_subdm)) != (0)) __PYX_ERR(57, 493, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_sf);
  __Pyx_GIVEREF((PyObject *)__pyx_v_sf);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_sf)) != (0)) __PYX_ERR(57, 493, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":453
 *         return isets
 * 
 *     def filter(self, label: DMLabel | None = None, value: int | None = None, ignoreHalo: bool = False,             # <<<<<<<<<<<<<<
 *                sanitizeSubMesh: bool = False, comm: Comm | None = None) -> tuple[DMPlex, SF]:
 *         """Extract a subset of mesh cells defined by a label as a separate mesh.
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.filter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_subdm);
  __Pyx_XDECREF((PyObject *)__pyx_v_sf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMPlex.pyx":495
 *         return subdm, sf
 * 
 *     def getChart(self) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return the interval for all mesh points [``pStart``, ``pEnd``).
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_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_6DMPlex_28getChart, "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:495");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_29getChart = {"getChart", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_29getChart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_28getChart};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getChart", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_28getChart(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_28getChart(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":512
 * 
 *         """
 *         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":513
 *         """
 *         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, 513, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":514
 *         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, 514, __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, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 514, __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) != (0)) __PYX_ERR(57, 514, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(57, 514, __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":495
 *         return subdm, sf
 * 
 *     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":516
 *         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_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_6DMPlex_30setChart, "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:516");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_31setChart = {"setChart", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_31setChart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_30setChart};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pStart,&__pyx_mstate_global->__pyx_n_u_pEnd,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 516, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 516, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 516, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setChart", 0) < (0)) __PYX_ERR(57, 516, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setChart", 1, 2, 2, i); __PYX_ERR(57, 516, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 516, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 516, __pyx_L3_error)
    }
    __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, 516, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_30setChart(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_pStart, __pyx_v_pEnd);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_30setChart(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":533
 * 
 *         """
 *         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, 533, __pyx_L1_error)
  __pyx_v_cStart = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":534
 *         """
 *         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, 534, __pyx_L1_error)
  __pyx_v_cEnd = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":535
 *         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, 535, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":516
 *         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":537
 *         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_33getConeSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_32getConeSize, "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:537");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_33getConeSize = {"getConeSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_33getConeSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_32getConeSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_33getConeSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 537, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 537, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getConeSize", 0) < (0)) __PYX_ERR(57, 537, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getConeSize", 1, 1, 1, i); __PYX_ERR(57, 537, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 537, __pyx_L3_error)
    }
    __pyx_v_p = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getConeSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 537, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_32getConeSize(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_32getConeSize(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":553
 * 
 *         """
 *         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, 553, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":554
 *         """
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
*/
  __pyx_v_pStart = 0;
  __pyx_v_pEnd = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":555
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))             # <<<<<<<<<<<<<<
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt csize = 0
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetChart(__pyx_v_self->__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 555, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":556
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd             # <<<<<<<<<<<<<<
 *         cdef PetscInt csize = 0
 *         CHKERR(DMPlexGetConeSize(self.dm, cp, &csize))
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = (__pyx_v_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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(57, 556, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(57, 556, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DMPlex.pyx":557
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt csize = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetConeSize(self.dm, cp, &csize))
 *         return toInt(csize)
*/
  __pyx_v_csize = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":558
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt csize = 0
 *         CHKERR(DMPlexGetConeSize(self.dm, cp, &csize))             # <<<<<<<<<<<<<<
 *         return toInt(csize)
 * 
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetConeSize(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, (&__pyx_v_csize))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 558, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":559
 *         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, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":537
 *         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":561
 *         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_35setConeSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_34setConeSize, "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:561");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_35setConeSize = {"setConeSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_35setConeSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_34setConeSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_35setConeSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,&__pyx_mstate_global->__pyx_n_u_size,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 561, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setConeSize", 0) < (0)) __PYX_ERR(57, 561, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setConeSize", 1, 2, 2, i); __PYX_ERR(57, 561, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 561, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 561, __pyx_L3_error)
    }
    __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, 561, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_34setConeSize(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_size);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_34setConeSize(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":579
 * 
 *         """
 *         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, 579, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":580
 *         """
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
*/
  __pyx_v_pStart = 0;
  __pyx_v_pEnd = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":581
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))             # <<<<<<<<<<<<<<
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt csize = asInt(size)
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetChart(__pyx_v_self->__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 581, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":582
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd             # <<<<<<<<<<<<<<
 *         cdef PetscInt csize = asInt(size)
 *         CHKERR(DMPlexSetConeSize(self.dm, cp, csize))
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = (__pyx_v_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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(57, 582, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(57, 582, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DMPlex.pyx":583
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt csize = asInt(size)             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexSetConeSize(self.dm, cp, csize))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_size); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 583, __pyx_L1_error)
  __pyx_v_csize = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":584
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt csize = asInt(size)
 *         CHKERR(DMPlexSetConeSize(self.dm, cp, csize))             # <<<<<<<<<<<<<<
 * 
 *     def getCone(self, p: int) -> 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, 584, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":561
 *         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":586
 *         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_37getCone(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_36getCone, "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:586");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_37getCone = {"getCone", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_37getCone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_36getCone};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_37getCone(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 586, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 586, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getCone", 0) < (0)) __PYX_ERR(57, 586, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getCone", 1, 1, 1, i); __PYX_ERR(57, 586, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 586, __pyx_L3_error)
    }
    __pyx_v_p = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getCone", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 586, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_36getCone(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_36getCone(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":602
 * 
 *         """
 *         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, 602, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":603
 *         """
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
*/
  __pyx_v_pStart = 0;
  __pyx_v_pEnd = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":604
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))             # <<<<<<<<<<<<<<
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt        ncone = 0
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetChart(__pyx_v_self->__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 604, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":605
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd             # <<<<<<<<<<<<<<
 *         cdef PetscInt        ncone = 0
 *         cdef const PetscInt *icone = NULL
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = (__pyx_v_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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(57, 605, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(57, 605, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DMPlex.pyx":606
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt        ncone = 0             # <<<<<<<<<<<<<<
 *         cdef const PetscInt *icone = NULL
 *         CHKERR(DMPlexGetConeSize(self.dm, cp, &ncone))
*/
  __pyx_v_ncone = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":607
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt        ncone = 0
 *         cdef const PetscInt *icone = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetConeSize(self.dm, cp, &ncone))
 *         CHKERR(DMPlexGetCone(self.dm, cp, &icone))
*/
  __pyx_v_icone = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":608
 *         cdef PetscInt        ncone = 0
 *         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(DMPlexGetConeSize(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, (&__pyx_v_ncone))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 608, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":609
 *         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, 609, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":610
 *         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, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":586
 *         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":612
 *         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_39setCone(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_38setCone, "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:612");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_39setCone = {"setCone", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_39setCone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_38setCone};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_39setCone(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,&__pyx_mstate_global->__pyx_n_u_cone,&__pyx_mstate_global->__pyx_n_u_orientation,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 612, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 612, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 612, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 612, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCone", 0) < (0)) __PYX_ERR(57, 612, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCone", 0, 2, 3, i); __PYX_ERR(57, 612, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 612, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 612, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 612, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 612, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_38setCone(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_cone, __pyx_v_orientation);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_38setCone(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":633
 * 
 *         """
 *         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, 633, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":634
 *         """
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
*/
  __pyx_v_pStart = 0;
  __pyx_v_pEnd = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":635
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))             # <<<<<<<<<<<<<<
 *         assert cp>=pStart and cp<pEnd
 *         #
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetChart(__pyx_v_self->__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 635, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":636
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd             # <<<<<<<<<<<<<<
 *         #
 *         cdef PetscInt  ncone = 0
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = (__pyx_v_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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(57, 636, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(57, 636, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DMPlex.pyx":638
 *         assert cp>=pStart and cp<pEnd
 *         #
 *         cdef PetscInt  ncone = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt *icone = NULL
 *         cone = iarray_i(cone, &ncone, &icone)
*/
  __pyx_v_ncone = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":639
 *         #
 *         cdef PetscInt  ncone = 0
 *         cdef PetscInt *icone = NULL             # <<<<<<<<<<<<<<
 *         cone = iarray_i(cone, &ncone, &icone)
 *         CHKERR(DMPlexSetConeSize(self.dm, cp, ncone))
*/
  __pyx_v_icone = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":640
 *         cdef PetscInt  ncone = 0
 *         cdef PetscInt *icone = NULL
 *         cone = iarray_i(cone, &ncone, &icone)             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexSetConeSize(self.dm, cp, ncone))
 *         CHKERR(DMPlexSetCone(self.dm, cp, icone))
*/
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_cone, (&__pyx_v_ncone), (&__pyx_v_icone))); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF_SET(__pyx_v_cone, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":641
 *         cdef PetscInt *icone = NULL
 *         cone = iarray_i(cone, &ncone, &icone)
 *         CHKERR(DMPlexSetConeSize(self.dm, cp, ncone))             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexSetCone(self.dm, cp, icone))
 *         #
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetConeSize(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_ncone)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 641, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":642
 *         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, 642, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":644
 *         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":645
 *         #
 *         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":646
 *         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":647
 *         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, 647, __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":648
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(57, 648, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(57, 648, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/DMPlex.pyx":649
 *             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, 649, __pyx_L1_error)

    /* "petsc4py/PETSc/DMPlex.pyx":646
 *         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":612
 *         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":651
 *             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_41insertCone(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_40insertCone, "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:651");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_41insertCone = {"insertCone", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_41insertCone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_40insertCone};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_41insertCone(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,&__pyx_mstate_global->__pyx_n_u_conePos,&__pyx_mstate_global->__pyx_n_u_conePoint,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 651, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 651, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 651, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 651, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "insertCone", 0) < (0)) __PYX_ERR(57, 651, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("insertCone", 1, 3, 3, i); __PYX_ERR(57, 651, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 651, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 651, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 651, __pyx_L3_error)
    }
    __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, 651, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_40insertCone(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_conePos, __pyx_v_conePoint);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_40insertCone(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":671
 * 
 *         """
 *         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, 671, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":672
 *         """
 *         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, 672, __pyx_L1_error)
  __pyx_v_cconePos = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":673
 *         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, 673, __pyx_L1_error)
  __pyx_v_cconePoint = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":674
 *         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, 674, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":651
 *             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":676
 *         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_43insertConeOrientation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_42insertConeOrientation, "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:676");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_43insertConeOrientation = {"insertConeOrientation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_43insertConeOrientation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_42insertConeOrientation};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_43insertConeOrientation(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,&__pyx_mstate_global->__pyx_n_u_conePos,&__pyx_mstate_global->__pyx_n_u_coneOrientation,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 676, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 676, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 676, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 676, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "insertConeOrientation", 0) < (0)) __PYX_ERR(57, 676, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("insertConeOrientation", 1, 3, 3, i); __PYX_ERR(57, 676, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 676, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 676, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 676, __pyx_L3_error)
    }
    __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, 676, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_42insertConeOrientation(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_conePos, __pyx_v_coneOrientation);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_42insertConeOrientation(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":696
 * 
 *         """
 *         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, 696, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":697
 *         """
 *         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, 697, __pyx_L1_error)
  __pyx_v_cconePos = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":698
 *         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, 698, __pyx_L1_error)
  __pyx_v_cconeOrientation = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":699
 *         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, 699, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":676
 *         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":701
 *         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_45getConeOrientation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_44getConeOrientation, "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:701");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_45getConeOrientation = {"getConeOrientation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_45getConeOrientation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_44getConeOrientation};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_45getConeOrientation(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 701, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 701, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getConeOrientation", 0) < (0)) __PYX_ERR(57, 701, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getConeOrientation", 1, 1, 1, i); __PYX_ERR(57, 701, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 701, __pyx_L3_error)
    }
    __pyx_v_p = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getConeOrientation", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 701, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_44getConeOrientation(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_44getConeOrientation(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":717
 * 
 *         """
 *         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, 717, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":718
 *         """
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
*/
  __pyx_v_pStart = 0;
  __pyx_v_pEnd = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":719
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))             # <<<<<<<<<<<<<<
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt        norie = 0
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetChart(__pyx_v_self->__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 719, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":720
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd             # <<<<<<<<<<<<<<
 *         cdef PetscInt        norie = 0
 *         cdef const PetscInt *iorie = NULL
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = (__pyx_v_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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(57, 720, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(57, 720, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DMPlex.pyx":721
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt        norie = 0             # <<<<<<<<<<<<<<
 *         cdef const PetscInt *iorie = NULL
 *         CHKERR(DMPlexGetConeSize(self.dm, cp, &norie))
*/
  __pyx_v_norie = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":722
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt        norie = 0
 *         cdef const PetscInt *iorie = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetConeSize(self.dm, cp, &norie))
 *         CHKERR(DMPlexGetConeOrientation(self.dm, cp, &iorie))
*/
  __pyx_v_iorie = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":723
 *         cdef PetscInt        norie = 0
 *         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(DMPlexGetConeSize(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, (&__pyx_v_norie))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 723, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":724
 *         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, 724, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":725
 *         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, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":701
 *         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":727
 *         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_47setConeOrientation(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_46setConeOrientation, "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:727");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_47setConeOrientation = {"setConeOrientation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_47setConeOrientation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_46setConeOrientation};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_47setConeOrientation(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,&__pyx_mstate_global->__pyx_n_u_orientation,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 727, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 727, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 727, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setConeOrientation", 0) < (0)) __PYX_ERR(57, 727, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setConeOrientation", 1, 2, 2, i); __PYX_ERR(57, 727, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 727, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 727, __pyx_L3_error)
    }
    __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, 727, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_46setConeOrientation(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_orientation);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_46setConeOrientation(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":746
 * 
 *         """
 *         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, 746, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":747
 *         """
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
*/
  __pyx_v_pStart = 0;
  __pyx_v_pEnd = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":748
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))             # <<<<<<<<<<<<<<
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt ncone = 0
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetChart(__pyx_v_self->__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 748, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":749
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd             # <<<<<<<<<<<<<<
 *         cdef PetscInt ncone = 0
 *         CHKERR(DMPlexGetConeSize(self.dm, cp, &ncone))
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = (__pyx_v_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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(57, 749, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(57, 749, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DMPlex.pyx":750
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt ncone = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetConeSize(self.dm, cp, &ncone))
 *         cdef PetscInt  norie = 0
*/
  __pyx_v_ncone = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":751
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt ncone = 0
 *         CHKERR(DMPlexGetConeSize(self.dm, cp, &ncone))             # <<<<<<<<<<<<<<
 *         cdef PetscInt  norie = 0
 *         cdef PetscInt *iorie = NULL
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetConeSize(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, (&__pyx_v_ncone))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 751, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":752
 *         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":753
 *         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":754
 *         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, 754, __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":755
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(57, 755, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(57, 755, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DMPlex.pyx":756
 *         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, 756, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":727
 *         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":758
 *         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_49setCellType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_48setCellType, "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:758");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_49setCellType = {"setCellType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_49setCellType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_48setCellType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_49setCellType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,&__pyx_mstate_global->__pyx_n_u_ctype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 758, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 758, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 758, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCellType", 0) < (0)) __PYX_ERR(57, 758, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCellType", 1, 2, 2, i); __PYX_ERR(57, 758, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 758, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 758, __pyx_L3_error)
    }
    __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, 758, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_48setCellType(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_ctype);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_48setCellType(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":776
 * 
 *         """
 *         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, 776, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":777
 *         """
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscDMPolytopeType val = ctype             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexSetCellType(self.dm, cp, val))
 * 
*/
  __pyx_t_2 = ((DMPolytopeType)__Pyx_PyLong_As_DMPolytopeType(__pyx_v_ctype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 777, __pyx_L1_error)
  __pyx_v_val = __pyx_t_2;

  /* "petsc4py/PETSc/DMPlex.pyx":778
 *         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, 778, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":758
 *         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":780
 *         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_51getCellType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_50getCellType, "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:780");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_51getCellType = {"getCellType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_51getCellType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_50getCellType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_51getCellType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 780, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 780, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getCellType", 0) < (0)) __PYX_ERR(57, 780, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getCellType", 1, 1, 1, i); __PYX_ERR(57, 780, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 780, __pyx_L3_error)
    }
    __pyx_v_p = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getCellType", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 780, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_50getCellType(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_50getCellType(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":796
 * 
 *         """
 *         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, 796, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":797
 *         """
 *         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":798
 *         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, 798, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":799
 *         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, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":780
 *         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":801
 *         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_53getCellTypeLabel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_52getCellTypeLabel, "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:801");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_53getCellTypeLabel = {"getCellTypeLabel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_53getCellTypeLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_52getCellTypeLabel};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_53getCellTypeLabel(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCellTypeLabel", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_52getCellTypeLabel(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_52getCellTypeLabel(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCellTypeLabel", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":812
 * 
 *         """
 *         cdef DMLabel label = DMLabel()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetCellTypeLabel(self.dm, &label.dmlabel))
 *         CHKERR(PetscINCREF(label.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 812, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_label = ((struct PyPetscDMLabelObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":813
 *         """
 *         cdef DMLabel label = DMLabel()
 *         CHKERR(DMPlexGetCellTypeLabel(self.dm, &label.dmlabel))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(label.obj))
 *         return label
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetCellTypeLabel(__pyx_v_self->__pyx_base.dm, (&__pyx_v_label->dmlabel))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 813, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":814
 *         cdef DMLabel label = DMLabel()
 *         CHKERR(DMPlexGetCellTypeLabel(self.dm, &label.dmlabel))
 *         CHKERR(PetscINCREF(label.obj))             # <<<<<<<<<<<<<<
 *         return label
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_label->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 814, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":815
 *         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":801
 *         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_XDECREF(__pyx_t_2);
  __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":817
 *         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_55getSupportSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_54getSupportSize, "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:817");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_55getSupportSize = {"getSupportSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_55getSupportSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_54getSupportSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_55getSupportSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 817, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 817, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSupportSize", 0) < (0)) __PYX_ERR(57, 817, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSupportSize", 1, 1, 1, i); __PYX_ERR(57, 817, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 817, __pyx_L3_error)
    }
    __pyx_v_p = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getSupportSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 817, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_54getSupportSize(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_54getSupportSize(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":833
 * 
 *         """
 *         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, 833, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":834
 *         """
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
*/
  __pyx_v_pStart = 0;
  __pyx_v_pEnd = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":835
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))             # <<<<<<<<<<<<<<
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt ssize = 0
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetChart(__pyx_v_self->__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 835, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":836
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd             # <<<<<<<<<<<<<<
 *         cdef PetscInt ssize = 0
 *         CHKERR(DMPlexGetSupportSize(self.dm, cp, &ssize))
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = (__pyx_v_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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(57, 836, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(57, 836, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DMPlex.pyx":837
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt ssize = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetSupportSize(self.dm, cp, &ssize))
 *         return toInt(ssize)
*/
  __pyx_v_ssize = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":838
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt ssize = 0
 *         CHKERR(DMPlexGetSupportSize(self.dm, cp, &ssize))             # <<<<<<<<<<<<<<
 *         return toInt(ssize)
 * 
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetSupportSize(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, (&__pyx_v_ssize))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 838, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":839
 *         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, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":817
 *         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":841
 *         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_57setSupportSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_56setSupportSize, "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:841");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_57setSupportSize = {"setSupportSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_57setSupportSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_56setSupportSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_57setSupportSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,&__pyx_mstate_global->__pyx_n_u_size,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 841, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 841, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 841, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSupportSize", 0) < (0)) __PYX_ERR(57, 841, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSupportSize", 1, 2, 2, i); __PYX_ERR(57, 841, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 841, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 841, __pyx_L3_error)
    }
    __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, 841, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_56setSupportSize(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_size);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_56setSupportSize(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":859
 * 
 *         """
 *         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, 859, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":860
 *         """
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
*/
  __pyx_v_pStart = 0;
  __pyx_v_pEnd = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":861
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))             # <<<<<<<<<<<<<<
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt ssize = asInt(size)
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetChart(__pyx_v_self->__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 861, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":862
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd             # <<<<<<<<<<<<<<
 *         cdef PetscInt ssize = asInt(size)
 *         CHKERR(DMPlexSetSupportSize(self.dm, cp, ssize))
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = (__pyx_v_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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(57, 862, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(57, 862, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DMPlex.pyx":863
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt ssize = asInt(size)             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexSetSupportSize(self.dm, cp, ssize))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_size); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(57, 863, __pyx_L1_error)
  __pyx_v_ssize = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":864
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt ssize = asInt(size)
 *         CHKERR(DMPlexSetSupportSize(self.dm, cp, ssize))             # <<<<<<<<<<<<<<
 * 
 *     def getSupport(self, p: int) -> 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, 864, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":841
 *         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":866
 *         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_59getSupport(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_58getSupport, "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:866");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_59getSupport = {"getSupport", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_59getSupport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_58getSupport};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_59getSupport(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 866, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 866, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSupport", 0) < (0)) __PYX_ERR(57, 866, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSupport", 1, 1, 1, i); __PYX_ERR(57, 866, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 866, __pyx_L3_error)
    }
    __pyx_v_p = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getSupport", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 866, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_58getSupport(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_58getSupport(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":882
 * 
 *         """
 *         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, 882, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":883
 *         """
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
*/
  __pyx_v_pStart = 0;
  __pyx_v_pEnd = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":884
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))             # <<<<<<<<<<<<<<
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt        nsupp = 0
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetChart(__pyx_v_self->__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 884, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":885
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd             # <<<<<<<<<<<<<<
 *         cdef PetscInt        nsupp = 0
 *         cdef const PetscInt *isupp = NULL
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = (__pyx_v_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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(57, 885, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(57, 885, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DMPlex.pyx":886
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt        nsupp = 0             # <<<<<<<<<<<<<<
 *         cdef const PetscInt *isupp = NULL
 *         CHKERR(DMPlexGetSupportSize(self.dm, cp, &nsupp))
*/
  __pyx_v_nsupp = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":887
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt        nsupp = 0
 *         cdef const PetscInt *isupp = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetSupportSize(self.dm, cp, &nsupp))
 *         CHKERR(DMPlexGetSupport(self.dm, cp, &isupp))
*/
  __pyx_v_isupp = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":888
 *         cdef PetscInt        nsupp = 0
 *         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(DMPlexGetSupportSize(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, (&__pyx_v_nsupp))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 888, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":889
 *         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, 889, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":890
 *         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, 890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":866
 *         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":892
 *         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_61setSupport(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_60setSupport, "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:892");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_61setSupport = {"setSupport", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_61setSupport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_60setSupport};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_61setSupport(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,&__pyx_mstate_global->__pyx_n_u_supp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 892, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 892, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 892, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSupport", 0) < (0)) __PYX_ERR(57, 892, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSupport", 1, 2, 2, i); __PYX_ERR(57, 892, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 892, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 892, __pyx_L3_error)
    }
    __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, 892, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_60setSupport(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_supp);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_60setSupport(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":911
 * 
 *         """
 *         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, 911, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":912
 *         """
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
*/
  __pyx_v_pStart = 0;
  __pyx_v_pEnd = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":913
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))             # <<<<<<<<<<<<<<
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt  nsupp = 0
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetChart(__pyx_v_self->__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 913, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":914
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd             # <<<<<<<<<<<<<<
 *         cdef PetscInt  nsupp = 0
 *         cdef PetscInt *isupp = NULL
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = (__pyx_v_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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(57, 914, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(57, 914, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DMPlex.pyx":915
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt  nsupp = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt *isupp = NULL
 *         supp = iarray_i(supp, &nsupp, &isupp)
*/
  __pyx_v_nsupp = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":916
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscInt  nsupp = 0
 *         cdef PetscInt *isupp = NULL             # <<<<<<<<<<<<<<
 *         supp = iarray_i(supp, &nsupp, &isupp)
 *         CHKERR(DMPlexSetSupportSize(self.dm, cp, nsupp))
*/
  __pyx_v_isupp = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":917
 *         cdef PetscInt  nsupp = 0
 *         cdef PetscInt *isupp = NULL
 *         supp = iarray_i(supp, &nsupp, &isupp)             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexSetSupportSize(self.dm, cp, nsupp))
 *         CHKERR(DMPlexSetSupport(self.dm, cp, isupp))
*/
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_supp, (&__pyx_v_nsupp), (&__pyx_v_isupp))); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF_SET(__pyx_v_supp, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":918
 *         cdef PetscInt *isupp = NULL
 *         supp = iarray_i(supp, &nsupp, &isupp)
 *         CHKERR(DMPlexSetSupportSize(self.dm, cp, nsupp))             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexSetSupport(self.dm, cp, isupp))
 * 
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetSupportSize(__pyx_v_self->__pyx_base.dm, __pyx_v_cp, __pyx_v_nsupp)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 918, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":919
 *         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, 919, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":892
 *         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":921
 *         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_63getMaxSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_62getMaxSizes, "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:921");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_63getMaxSizes = {"getMaxSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_63getMaxSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_62getMaxSizes};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_63getMaxSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMaxSizes", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_62getMaxSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_62getMaxSizes(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":939
 * 
 *         """
 *         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":940
 *         """
 *         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, 940, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":941
 *         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, 941, __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, 941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 941, __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) != (0)) __PYX_ERR(57, 941, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(57, 941, __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":921
 *         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":943
 *         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_65symmetrize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_64symmetrize, "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:943");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_65symmetrize = {"symmetrize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_65symmetrize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_64symmetrize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_65symmetrize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("symmetrize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_64symmetrize(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_64symmetrize(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":954
 * 
 *         """
 *         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, 954, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":943
 *         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":956
 *         CHKERR(DMPlexSymmetrize(self.dm))
 * 
 *     def stratify(self) -> None:             # <<<<<<<<<<<<<<
 *         """Calculate the strata of DAG.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_67stratify(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_66stratify, "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:956");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_67stratify = {"stratify", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_67stratify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_66stratify};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_67stratify(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("stratify", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_66stratify(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_66stratify(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":966
 * 
 *         """
 *         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, 966, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":956
 *         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":968
 *         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_69orient(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_68orient, "DMPlex.orient(self) -> None\nGive a consistent orientation to the input mesh.\n\n        Collective.\n\n        See Also\n        --------\n        DM, DMPlex, DM.create, petsc.DMPlexOrient\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:968");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_69orient = {"orient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_69orient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_68orient};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_69orient(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("orient", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_68orient(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_68orient(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":978
 * 
 *         """
 *         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, 978, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":968
 *         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":980
 *         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_71getCellNumbering(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_70getCellNumbering, "DMPlex.getCellNumbering(self) -> IS\nReturn a global cell numbering for all cells on this process.\n\n        Collective the first time it is called.\n\n        See Also\n        --------\n        DM, DMPlex, DMPlex.getVertexNumbering, petsc.DMPlexGetCellNumbering\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:980");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_71getCellNumbering = {"getCellNumbering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_71getCellNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_70getCellNumbering};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_71getCellNumbering(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCellNumbering", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_70getCellNumbering(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_70getCellNumbering(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCellNumbering", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":990
 * 
 *         """
 *         cdef IS iset = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetCellNumbering(self.dm, &iset.iset))
 *         CHKERR(PetscINCREF(iset.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 990, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":991
 *         """
 *         cdef IS iset = IS()
 *         CHKERR(DMPlexGetCellNumbering(self.dm, &iset.iset))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(iset.obj))
 *         return iset
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetCellNumbering(__pyx_v_self->__pyx_base.dm, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 991, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":992
 *         cdef IS iset = IS()
 *         CHKERR(DMPlexGetCellNumbering(self.dm, &iset.iset))
 *         CHKERR(PetscINCREF(iset.obj))             # <<<<<<<<<<<<<<
 *         return iset
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_iset->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 992, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":993
 *         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":980
 *         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_XDECREF(__pyx_t_2);
  __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":995
 *         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_73getVertexNumbering(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_72getVertexNumbering, "DMPlex.getVertexNumbering(self) -> IS\nReturn a global vertex numbering for all vertices on this process.\n\n        Collective the first time it is called.\n\n        See Also\n        --------\n        DM, DMPlex, DMPlex.getCellNumbering, petsc.DMPlexGetVertexNumbering\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:995");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_73getVertexNumbering = {"getVertexNumbering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_73getVertexNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_72getVertexNumbering};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_73getVertexNumbering(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getVertexNumbering", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_72getVertexNumbering(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_72getVertexNumbering(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getVertexNumbering", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1005
 * 
 *         """
 *         cdef IS iset = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetVertexNumbering(self.dm, &iset.iset))
 *         CHKERR(PetscINCREF(iset.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 1005, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1006
 *         """
 *         cdef IS iset = IS()
 *         CHKERR(DMPlexGetVertexNumbering(self.dm, &iset.iset))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(iset.obj))
 *         return iset
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetVertexNumbering(__pyx_v_self->__pyx_base.dm, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1006, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1007
 *         cdef IS iset = IS()
 *         CHKERR(DMPlexGetVertexNumbering(self.dm, &iset.iset))
 *         CHKERR(PetscINCREF(iset.obj))             # <<<<<<<<<<<<<<
 *         return iset
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_iset->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1007, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1008
 *         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":995
 *         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_XDECREF(__pyx_t_2);
  __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":1010
 *         return iset
 * 
 *     def createPointNumbering(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Create a global numbering for all points.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_75createPointNumbering(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_74createPointNumbering, "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:1010");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_75createPointNumbering = {"createPointNumbering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_75createPointNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_74createPointNumbering};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_75createPointNumbering(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("createPointNumbering", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_74createPointNumbering(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_74createPointNumbering(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createPointNumbering", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1020
 * 
 *         """
 *         cdef IS iset = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexCreatePointNumbering(self.dm, &iset.iset))
 *         return iset
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 1020, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1021
 *         """
 *         cdef IS iset = IS()
 *         CHKERR(DMPlexCreatePointNumbering(self.dm, &iset.iset))             # <<<<<<<<<<<<<<
 *         return iset
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreatePointNumbering(__pyx_v_self->__pyx_base.dm, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1021, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1022
 *         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":1010
 *         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_XDECREF(__pyx_t_2);
  __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":1024
 *         return iset
 * 
 *     def getDepth(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the depth of the DAG representing this mesh.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_77getDepth(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_76getDepth, "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:1024");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_77getDepth = {"getDepth", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_77getDepth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_76getDepth};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_77getDepth(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDepth", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_76getDepth(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_76getDepth(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1035
 * 
 *         """
 *         cdef PetscInt depth = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetDepth(self.dm, &depth))
 *         return toInt(depth)
*/
  __pyx_v_depth = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1036
 *         """
 *         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, 1036, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1037
 *         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, 1037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":1024
 *         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":1039
 *         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_79getDepthStratum(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_78getDepthStratum, "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:1039");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_79getDepthStratum = {"getDepthStratum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_79getDepthStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_78getDepthStratum};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_79getDepthStratum(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_svalue,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1039, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1039, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getDepthStratum", 0) < (0)) __PYX_ERR(57, 1039, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getDepthStratum", 1, 1, 1, i); __PYX_ERR(57, 1039, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1039, __pyx_L3_error)
    }
    __pyx_v_svalue = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getDepthStratum", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1039, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_78getDepthStratum(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_svalue);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_78getDepthStratum(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1062
 * 
 *         """
 *         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, 1062, __pyx_L1_error)
  __pyx_v_csvalue = __pyx_t_1;
  __pyx_v_sStart = 0;
  __pyx_v_sEnd = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1063
 *         """
 *         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, 1063, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1064
 *         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, 1064, __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, 1064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1064, __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) != (0)) __PYX_ERR(57, 1064, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(57, 1064, __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":1039
 *         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":1066
 *         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_81getHeightStratum(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_80getHeightStratum, "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:1066");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_81getHeightStratum = {"getHeightStratum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_81getHeightStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_80getHeightStratum};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_81getHeightStratum(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_svalue,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1066, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1066, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getHeightStratum", 0) < (0)) __PYX_ERR(57, 1066, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getHeightStratum", 1, 1, 1, i); __PYX_ERR(57, 1066, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1066, __pyx_L3_error)
    }
    __pyx_v_svalue = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getHeightStratum", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1066, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_80getHeightStratum(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_svalue);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_80getHeightStratum(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1089
 * 
 *         """
 *         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, 1089, __pyx_L1_error)
  __pyx_v_csvalue = __pyx_t_1;
  __pyx_v_sStart = 0;
  __pyx_v_sEnd = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1090
 *         """
 *         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, 1090, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1091
 *         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, 1091, __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, 1091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1091, __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) != (0)) __PYX_ERR(57, 1091, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(57, 1091, __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":1066
 *         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":1093
 *         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_83getPointDepth(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_82getPointDepth, "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:1093");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_83getPointDepth = {"getPointDepth", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_83getPointDepth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_82getPointDepth};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_83getPointDepth(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1093, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1093, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getPointDepth", 0) < (0)) __PYX_ERR(57, 1093, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getPointDepth", 1, 1, 1, i); __PYX_ERR(57, 1093, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1093, __pyx_L3_error)
    }
    __pyx_v_point = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getPointDepth", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1093, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_82getPointDepth(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_point);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_82getPointDepth(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1109
 * 
 *         """
 *         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, 1109, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":1110
 *         """
 *         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":1111
 *         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, 1111, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1112
 *         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, 1112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":1093
 *         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":1114
 *         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_85getPointHeight(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_84getPointHeight, "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:1114");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_85getPointHeight = {"getPointHeight", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_85getPointHeight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_84getPointHeight};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_85getPointHeight(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1114, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1114, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getPointHeight", 0) < (0)) __PYX_ERR(57, 1114, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getPointHeight", 1, 1, 1, i); __PYX_ERR(57, 1114, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1114, __pyx_L3_error)
    }
    __pyx_v_point = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getPointHeight", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1114, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_84getPointHeight(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_point);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_84getPointHeight(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1130
 * 
 *         """
 *         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, 1130, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":1131
 *         """
 *         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":1132
 *         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, 1132, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1133
 *         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, 1133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":1114
 *         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":1135
 *         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_87getMeet(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_86getMeet, "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:1135");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_87getMeet = {"getMeet", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_87getMeet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_86getMeet};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_87getMeet(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_points,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1135, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getMeet", 0) < (0)) __PYX_ERR(57, 1135, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getMeet", 1, 1, 1, i); __PYX_ERR(57, 1135, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1135, __pyx_L3_error)
    }
    __pyx_v_points = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getMeet", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1135, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_86getMeet(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_points);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_86getMeet(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":1150
 * 
 *         """
 *         cdef PetscInt  numPoints = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt *ipoints = NULL
 *         cdef PetscInt  numCoveringPoints = 0
*/
  __pyx_v_numPoints = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1151
 *         """
 *         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":1152
 *         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":1153
 *         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":1154
 *         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, 1154, __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":1155
 *         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, 1155, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1156
 *         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":1157
 *         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, 1157, __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":1159
 *             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;
       __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if ( 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, 1159, __pyx_L7_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);
      __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:;
      __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, 1159, __pyx_L1_error)
      __pyx_r = __pyx_t_11;
      __pyx_t_11 = 0;
      goto __pyx_L0;
    }
  }

  /* "petsc4py/PETSc/DMPlex.pyx":1135
 *         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":1161
 *             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_89getJoin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_88getJoin, "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:1161");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_89getJoin = {"getJoin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_89getJoin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_88getJoin};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_89getJoin(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_points,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1161, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1161, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getJoin", 0) < (0)) __PYX_ERR(57, 1161, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getJoin", 1, 1, 1, i); __PYX_ERR(57, 1161, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1161, __pyx_L3_error)
    }
    __pyx_v_points = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getJoin", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1161, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_88getJoin(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_points);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_88getJoin(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":1176
 * 
 *         """
 *         cdef PetscInt  numPoints = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt *ipoints = NULL
 *         cdef PetscInt  numCoveringPoints = 0
*/
  __pyx_v_numPoints = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1177
 *         """
 *         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":1178
 *         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":1179
 *         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":1180
 *         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, 1180, __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":1181
 *         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, 1181, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1182
 *         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":1183
 *         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, 1183, __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":1185
 *             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;
       __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if ( 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, 1185, __pyx_L7_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);
      __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:;
      __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, 1185, __pyx_L1_error)
      __pyx_r = __pyx_t_11;
      __pyx_t_11 = 0;
      goto __pyx_L0;
    }
  }

  /* "petsc4py/PETSc/DMPlex.pyx":1161
 *             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":1187
 *             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_91getFullJoin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_90getFullJoin, "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:1187");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_91getFullJoin = {"getFullJoin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_91getFullJoin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_90getFullJoin};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_91getFullJoin(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_points,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1187, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1187, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFullJoin", 0) < (0)) __PYX_ERR(57, 1187, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFullJoin", 1, 1, 1, i); __PYX_ERR(57, 1187, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1187, __pyx_L3_error)
    }
    __pyx_v_points = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getFullJoin", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1187, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_90getFullJoin(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_points);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_90getFullJoin(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":1202
 * 
 *         """
 *         cdef PetscInt  numPoints = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt *ipoints = NULL
 *         cdef PetscInt  numCoveringPoints = 0
*/
  __pyx_v_numPoints = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1203
 *         """
 *         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":1204
 *         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":1205
 *         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":1206
 *         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, 1206, __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":1207
 *         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, 1207, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1208
 *         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":1209
 *         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, 1209, __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":1211
 *             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;
       __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      if ( 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, 1211, __pyx_L7_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);
      __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:;
      __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, 1211, __pyx_L1_error)
      __pyx_r = __pyx_t_11;
      __pyx_t_11 = 0;
      goto __pyx_L0;
    }
  }

  /* "petsc4py/PETSc/DMPlex.pyx":1187
 *             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":1213
 *             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_93getTransitiveClosure(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_92getTransitiveClosure, "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:1213");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_93getTransitiveClosure = {"getTransitiveClosure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_93getTransitiveClosure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_92getTransitiveClosure};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_93getTransitiveClosure(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,&__pyx_mstate_global->__pyx_n_u_useCone,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1213, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1213, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1213, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getTransitiveClosure", 0) < (0)) __PYX_ERR(57, 1213, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getTransitiveClosure", 0, 1, 2, i); __PYX_ERR(57, 1213, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1213, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1213, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __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, 1213, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_92getTransitiveClosure(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p, __pyx_v_useCone);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_92getTransitiveClosure(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1238
 * 
 *         """
 *         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, 1238, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":1239
 *         """
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
*/
  __pyx_v_pStart = 0;
  __pyx_v_pEnd = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1240
 *         cdef PetscInt cp = asInt(p)
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))             # <<<<<<<<<<<<<<
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscBool cuseCone = useCone
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetChart(__pyx_v_self->__pyx_base.dm, (&__pyx_v_pStart), (&__pyx_v_pEnd))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1240, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1241
 *         cdef PetscInt pStart = 0, pEnd = 0
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd             # <<<<<<<<<<<<<<
 *         cdef PetscBool cuseCone = useCone
 *         cdef PetscInt  numPoints = 0
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = (__pyx_v_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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(57, 1241, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(57, 1241, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DMPlex.pyx":1242
 *         CHKERR(DMPlexGetChart(self.dm, &pStart, &pEnd))
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscBool cuseCone = useCone             # <<<<<<<<<<<<<<
 *         cdef PetscInt  numPoints = 0
 *         cdef PetscInt *points = NULL
*/
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_useCone); if (unlikely((__pyx_t_5 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(57, 1242, __pyx_L1_error)
  __pyx_v_cuseCone = __pyx_t_5;

  /* "petsc4py/PETSc/DMPlex.pyx":1243
 *         assert cp>=pStart and cp<pEnd
 *         cdef PetscBool cuseCone = useCone
 *         cdef PetscInt  numPoints = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt *points = NULL
 *         CHKERR(DMPlexGetTransitiveClosure(self.dm, cp, cuseCone, &numPoints, &points))
*/
  __pyx_v_numPoints = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1244
 *         cdef PetscBool cuseCone = useCone
 *         cdef PetscInt  numPoints = 0
 *         cdef PetscInt *points = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetTransitiveClosure(self.dm, cp, cuseCone, &numPoints, &points))
 *         try:
*/
  __pyx_v_points = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":1245
 *         cdef PetscInt  numPoints = 0
 *         cdef PetscInt *points = NULL
 *         CHKERR(DMPlexGetTransitiveClosure(self.dm, cp, cuseCone, &numPoints, &points))             # <<<<<<<<<<<<<<
 *         try:
 *             out = array_i(2*numPoints, points)
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetTransitiveClosure(__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, 1245, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1246
 *         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":1247
 *         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, 1247, __pyx_L6_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_out = ((PyArrayObject *)__pyx_t_6);
    __pyx_t_6 = 0;
  }

  /* "petsc4py/PETSc/DMPlex.pyx":1249
 *             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, 1249, __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;
       __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
      if ( 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, 1249, __pyx_L9_error)
      }
      __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:;
      __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":1250
 *         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_mstate_global->__pyx_slice[2]); if (unlikely(!__pyx_t_6)) __PYX_ERR(57, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_16 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_out), __pyx_mstate_global->__pyx_slice[3]); if (unlikely(!__pyx_t_16)) __PYX_ERR(57, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(57, 1250, __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) != (0)) __PYX_ERR(57, 1250, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_16);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_16) != (0)) __PYX_ERR(57, 1250, __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":1213
 *             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":1252
 *         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_95vecGetClosure(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_94vecGetClosure, "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:1252");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_95vecGetClosure = {"vecGetClosure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_95vecGetClosure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_94vecGetClosure};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_95vecGetClosure(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sec,&__pyx_mstate_global->__pyx_n_u_vec,&__pyx_mstate_global->__pyx_n_u_p,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1252, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1252, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1252, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1252, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "vecGetClosure", 0) < (0)) __PYX_ERR(57, 1252, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("vecGetClosure", 1, 3, 3, i); __PYX_ERR(57, 1252, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1252, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1252, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1252, __pyx_L3_error)
    }
    __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, 1252, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(57, 1252, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(57, 1252, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_94vecGetClosure(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_94vecGetClosure(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1271
 * 
 *         """
 *         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, 1271, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;
  __pyx_v_csize = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1272
 *         """
 *         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":1273
 *         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, 1273, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1274
 *         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":1275
 *         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, 1275, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_closure = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
  }

  /* "petsc4py/PETSc/DMPlex.pyx":1277
 *             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, 1277, __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;
       __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if ( 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, 1277, __pyx_L7_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);
      __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:;
      __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":1278
 *         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":1252
 *         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":1280
 *         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_97getVecClosure(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_96getVecClosure, "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:1280");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_97getVecClosure = {"getVecClosure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_97getVecClosure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_96getVecClosure};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_97getVecClosure(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sec,&__pyx_mstate_global->__pyx_n_u_vec,&__pyx_mstate_global->__pyx_n_u_point,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1280, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1280, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1280, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1280, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getVecClosure", 0) < (0)) __PYX_ERR(57, 1280, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getVecClosure", 1, 3, 3, i); __PYX_ERR(57, 1280, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1280, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1280, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1280, __pyx_L3_error)
    }
    __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, 1280, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 1, "sec", 0))) __PYX_ERR(57, 1280, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(57, 1280, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_96getVecClosure(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_96getVecClosure(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1300
 * 
 *         """
 *         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":1301
 *         """
 *         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, 1301, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_3;
  __pyx_v_csize = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1302
 *         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":1303
 *         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, 1303, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1304
 *         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":1305
 *         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, 1305, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_closure = ((PyArrayObject *)__pyx_t_5);
    __pyx_t_5 = 0;
  }

  /* "petsc4py/PETSc/DMPlex.pyx":1307
 *             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, 1307, __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;
       __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      if ( 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, 1307, __pyx_L7_error)
      }
      __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:;
      __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":1308
 *         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":1280
 *         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":1310
 *         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_99setVecClosure(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_98setVecClosure, "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:1310");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_99setVecClosure = {"setVecClosure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_99setVecClosure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_98setVecClosure};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_99setVecClosure(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sec,&__pyx_mstate_global->__pyx_n_u_vec,&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1310, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 1310, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 1310, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1310, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1310, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1310, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setVecClosure", 0) < (0)) __PYX_ERR(57, 1310, __pyx_L3_error)
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setVecClosure", 0, 4, 5, i); __PYX_ERR(57, 1310, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 1310, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 1310, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1310, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1310, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1310, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1310, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 1, "sec", 0))) __PYX_ERR(57, 1310, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(57, 1310, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_98setVecClosure(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_98setVecClosure(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_unused = 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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1334
 * 
 *         """
 *         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":1335
 *         """
 *         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, 1335, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_3;

  /* "petsc4py/PETSc/DMPlex.pyx":1336
 *         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 unused = iarray_s(values, &csize, &cvals)
*/
  __pyx_v_csize = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1337
 *         cdef PetscInt cp = asInt(point)
 *         cdef PetscInt csize = 0
 *         cdef PetscScalar *cvals = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = iarray_s(values, &csize, &cvals)
 *         cdef PetscInsertMode im = insertmode(addv)
*/
  __pyx_v_cvals = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":1338
 *         cdef PetscInt csize = 0
 *         cdef PetscScalar *cvals = NULL
 *         cdef object unused = 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, 1338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_unused = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1339
 *         cdef PetscScalar *cvals = NULL
 *         cdef object unused = 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, 1339, __pyx_L1_error)
  __pyx_v_im = __pyx_t_5;

  /* "petsc4py/PETSc/DMPlex.pyx":1340
 *         cdef object unused = 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, 1340, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1310
 *         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_unused);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMPlex.pyx":1342
 *         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_101setMatClosure(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_100setMatClosure, "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:1342");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_101setMatClosure = {"setMatClosure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_101setMatClosure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_100setMatClosure};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_101setMatClosure(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sec,&__pyx_mstate_global->__pyx_n_u_gsec,&__pyx_mstate_global->__pyx_n_u_mat,&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_values,&__pyx_mstate_global->__pyx_n_u_addv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1342, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(57, 1342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 1342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 1342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMatClosure", 0) < (0)) __PYX_ERR(57, 1342, __pyx_L3_error)

      /* "petsc4py/PETSc/DMPlex.pyx":1343
 * 
 *     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``.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 5; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMatClosure", 0, 5, 6, i); __PYX_ERR(57, 1342, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(57, 1342, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 1342, __pyx_L3_error)
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 1342, __pyx_L3_error)
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1342, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1342, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1342, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1342, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 1, "sec", 0))) __PYX_ERR(57, 1342, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gsec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 1, "gsec", 0))) __PYX_ERR(57, 1342, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mat), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "mat", 0))) __PYX_ERR(57, 1343, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_100setMatClosure(((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":1342
 *         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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_100setMatClosure(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_unused = 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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1370
 * 
 *         """
 *         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":1371
 *         """
 *         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":1372
 *         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, 1372, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_3;

  /* "petsc4py/PETSc/DMPlex.pyx":1373
 *         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 unused = iarray_s(values, &csize, &cvals)
*/
  __pyx_v_csize = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1374
 *         cdef PetscInt cp = asInt(point)
 *         cdef PetscInt csize = 0
 *         cdef PetscScalar *cvals = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = iarray_s(values, &csize, &cvals)
 *         cdef PetscInsertMode im = insertmode(addv)
*/
  __pyx_v_cvals = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":1375
 *         cdef PetscInt csize = 0
 *         cdef PetscScalar *cvals = NULL
 *         cdef object unused = 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, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_unused = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1376
 *         cdef PetscScalar *cvals = NULL
 *         cdef object unused = 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, 1376, __pyx_L1_error)
  __pyx_v_im = __pyx_t_5;

  /* "petsc4py/PETSc/DMPlex.pyx":1377
 *         cdef object unused = 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, 1377, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1342
 *         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_unused);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMPlex.pyx":1379
 *         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_103generate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_102generate, "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:1379");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_103generate = {"generate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_103generate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_102generate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_103generate(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_boundary,&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_interpolate,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1379, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1379, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1379, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1379, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "generate", 0) < (0)) __PYX_ERR(57, 1379, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("generate", 0, 1, 3, i); __PYX_ERR(57, 1379, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1379, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1379, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1379, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __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, 1379, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, 0, "boundary", 0))) __PYX_ERR(57, 1379, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_102generate(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_102generate(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":1399
 * 
 *         """
 *         cdef PetscBool interp = interpolate             # <<<<<<<<<<<<<<
 *         cdef const char *cname = NULL
 *         if name: name = str2bytes(name, &cname)
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_interpolate); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(57, 1399, __pyx_L1_error)
  __pyx_v_interp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":1400
 *         """
 *         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":1401
 *         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, 1401, __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, 1401, __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":1402
 *         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":1403
 *         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, 1403, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1404
 *         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, 1404, __pyx_L1_error)
  __pyx_v_self->__pyx_base.dm = __pyx_v_newdm;

  /* "petsc4py/PETSc/DMPlex.pyx":1405
 *         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":1379
 *         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":1407
 *         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_105setTriangleOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_104setTriangleOptions, "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:1407");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_105setTriangleOptions = {"setTriangleOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_105setTriangleOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_104setTriangleOptions};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_105setTriangleOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_opts,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1407, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1407, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTriangleOptions", 0) < (0)) __PYX_ERR(57, 1407, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setTriangleOptions", 1, 1, 1, i); __PYX_ERR(57, 1407, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1407, __pyx_L3_error)
    }
    __pyx_v_opts = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setTriangleOptions", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1407, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_104setTriangleOptions(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_opts);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_104setTriangleOptions(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":1423
 * 
 *         """
 *         cdef const char *copts = NULL             # <<<<<<<<<<<<<<
 *         opts = str2bytes(opts, &copts)
 *         CHKERR(DMPlexTriangleSetOptions(self.dm, copts))
*/
  __pyx_v_copts = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":1424
 *         """
 *         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, 1424, __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":1425
 *         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, 1425, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1407
 *         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":1427
 *         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_107setTetGenOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_106setTetGenOptions, "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:1427");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_107setTetGenOptions = {"setTetGenOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_107setTetGenOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_106setTetGenOptions};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_107setTetGenOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_opts,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1427, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1427, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTetGenOptions", 0) < (0)) __PYX_ERR(57, 1427, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setTetGenOptions", 1, 1, 1, i); __PYX_ERR(57, 1427, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1427, __pyx_L3_error)
    }
    __pyx_v_opts = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setTetGenOptions", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1427, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_106setTetGenOptions(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_opts);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_106setTetGenOptions(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":1443
 * 
 *         """
 *         cdef const char *copts = NULL             # <<<<<<<<<<<<<<
 *         opts = str2bytes(opts, &copts)
 *         CHKERR(DMPlexTetgenSetOptions(self.dm, copts))
*/
  __pyx_v_copts = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":1444
 *         """
 *         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, 1444, __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":1445
 *         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, 1445, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1427
 *         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":1447
 *         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_109markBoundaryFaces(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_108markBoundaryFaces, "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:1447");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_109markBoundaryFaces = {"markBoundaryFaces", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_109markBoundaryFaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_108markBoundaryFaces};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_109markBoundaryFaces(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_label,&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1447, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "markBoundaryFaces", 0) < (0)) __PYX_ERR(57, 1447, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("markBoundaryFaces", 0, 1, 2, i); __PYX_ERR(57, 1447, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1447, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1447, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 1447, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_108markBoundaryFaces(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_label, __pyx_v_value);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_108markBoundaryFaces(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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  PetscErrorCode __pyx_t_7;
  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":1464
 * 
 *         """
 *         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":1465
 *         """
 *         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, 1465, __pyx_L1_error)
    __pyx_v_ival = __pyx_t_2;
  }

  /* "petsc4py/PETSc/DMPlex.pyx":1466
 *         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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_label};
    __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hasLabel, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 1466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(57, 1466, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = (!__pyx_t_1);
  if (__pyx_t_6) {

    /* "petsc4py/PETSc/DMPlex.pyx":1467
 *         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 = ((PyObject *)__pyx_v_self);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_label};
      __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_createLabel, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 1467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/DMPlex.pyx":1466
 *         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":1468
 *         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":1469
 *             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, 1469, __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":1470
 *         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":1471
 *         label = str2bytes(label, &cval)
 *         cdef PetscDMLabel clbl = NULL
 *         CHKERR(DMGetLabel(self.dm, cval, &clbl))             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMarkBoundaryFaces(self.dm, ival, clbl))
 * 
*/
  __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMGetLabel(__pyx_v_self->__pyx_base.dm, __pyx_v_cval, (&__pyx_v_clbl))); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1471, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1472
 *         cdef PetscDMLabel clbl = NULL
 *         CHKERR(DMGetLabel(self.dm, cval, &clbl))
 *         CHKERR(DMPlexMarkBoundaryFaces(self.dm, ival, clbl))             # <<<<<<<<<<<<<<
 * 
 *     def labelComplete(self, DMLabel label) -> None:
*/
  __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMarkBoundaryFaces(__pyx_v_self->__pyx_base.dm, __pyx_v_ival, __pyx_v_clbl)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1472, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1447
 *         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_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":1474
 *         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_111labelComplete(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_110labelComplete, "DMPlex.labelComplete(self, label: DMLabel) -> None\nAdd the transitive closure to the surface.\n\n        Not collective.\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:1474");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_111labelComplete = {"labelComplete", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_111labelComplete, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_110labelComplete};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_111labelComplete(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_label,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1474, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1474, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "labelComplete", 0) < (0)) __PYX_ERR(57, 1474, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("labelComplete", 1, 1, 1, i); __PYX_ERR(57, 1474, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1474, __pyx_L3_error)
    }
    __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, 1474, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, 0, "label", 0))) __PYX_ERR(57, 1474, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_110labelComplete(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_label);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_110labelComplete(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1489
 * 
 *         """
 *         CHKERR(DMPlexLabelComplete(self.dm, label.dmlabel))             # <<<<<<<<<<<<<<
 * 
 *     def labelCohesiveComplete(self, DMLabel label, DMLabel bdlabel, bdvalue: int,
*/
  __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, 1489, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1474
 *         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":1491
 *         CHKERR(DMPlexLabelComplete(self.dm, label.dmlabel))
 * 
 *     def labelCohesiveComplete(self, DMLabel label, DMLabel bdlabel, bdvalue: int,             # <<<<<<<<<<<<<<
 *                               flip: bool, split: bool, DMPlex subdm) -> None:
 *         """Add all other mesh pieces to complete the surface.
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_113labelCohesiveComplete(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_112labelCohesiveComplete, "DMPlex.labelCohesiveComplete(self, label: DMLabel, bdlabel: DMLabel, bdvalue: int, flip: bool, split: bool, subdm: DMPlex) -> None\nAdd all other mesh pieces to complete the surface.\n\n        Not collective.\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        split\n            Flag to split faces incident on the surface boundary,\n            rather than clamping those faces to the boundary\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:1491");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_113labelCohesiveComplete = {"labelCohesiveComplete", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_113labelCohesiveComplete, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_112labelCohesiveComplete};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_113labelCohesiveComplete(PyObject *__pyx_v_self, 
#if 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;
  PyObject *__pyx_v_split = 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[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("labelCohesiveComplete (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_label,&__pyx_mstate_global->__pyx_n_u_bdlabel,&__pyx_mstate_global->__pyx_n_u_bdvalue,&__pyx_mstate_global->__pyx_n_u_flip,&__pyx_mstate_global->__pyx_n_u_split,&__pyx_mstate_global->__pyx_n_u_subdm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1491, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(57, 1491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 1491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 1491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1491, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "labelCohesiveComplete", 0) < (0)) __PYX_ERR(57, 1491, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 6; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("labelCohesiveComplete", 1, 6, 6, i); __PYX_ERR(57, 1491, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 6)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1491, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1491, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1491, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 1491, __pyx_L3_error)
      values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 1491, __pyx_L3_error)
      values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(57, 1491, __pyx_L3_error)
    }
    __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_split = values[4];
    __pyx_v_subdm = ((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)values[5]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("labelCohesiveComplete", 1, 6, 6, __pyx_nargs); __PYX_ERR(57, 1491, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, 0, "label", 0))) __PYX_ERR(57, 1491, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_bdlabel), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, 0, "bdlabel", 0))) __PYX_ERR(57, 1491, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_subdm), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, 0, "subdm", 0))) __PYX_ERR(57, 1492, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_112labelCohesiveComplete(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_label, __pyx_v_bdlabel, __pyx_v_bdvalue, __pyx_v_flip, __pyx_v_split, __pyx_v_subdm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_112labelCohesiveComplete(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, PyObject *__pyx_v_split, struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_subdm) {
  PetscBool __pyx_v_flg;
  PetscBool __pyx_v_flg2;
  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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1521
 * 
 *         """
 *         cdef PetscBool flg  = flip             # <<<<<<<<<<<<<<
 *         cdef PetscBool flg2 = split
 *         cdef PetscInt  val  = asInt(bdvalue)
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flip); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(57, 1521, __pyx_L1_error)
  __pyx_v_flg = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":1522
 *         """
 *         cdef PetscBool flg  = flip
 *         cdef PetscBool flg2 = split             # <<<<<<<<<<<<<<
 *         cdef PetscInt  val  = asInt(bdvalue)
 *         CHKERR(DMPlexLabelCohesiveComplete(self.dm, label.dmlabel, bdlabel.dmlabel, val, flg, flg2, subdm.dm))
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_split); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(57, 1522, __pyx_L1_error)
  __pyx_v_flg2 = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":1523
 *         cdef PetscBool flg  = flip
 *         cdef PetscBool flg2 = split
 *         cdef PetscInt  val  = asInt(bdvalue)             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexLabelCohesiveComplete(self.dm, label.dmlabel, bdlabel.dmlabel, val, flg, flg2, 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, 1523, __pyx_L1_error)
  __pyx_v_val = __pyx_t_2;

  /* "petsc4py/PETSc/DMPlex.pyx":1524
 *         cdef PetscBool flg2 = split
 *         cdef PetscInt  val  = asInt(bdvalue)
 *         CHKERR(DMPlexLabelCohesiveComplete(self.dm, label.dmlabel, bdlabel.dmlabel, val, flg, flg2, 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_flg2, __pyx_v_subdm->__pyx_base.dm)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1524, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1491
 *         CHKERR(DMPlexLabelComplete(self.dm, label.dmlabel))
 * 
 *     def labelCohesiveComplete(self, DMLabel label, DMLabel bdlabel, bdvalue: int,             # <<<<<<<<<<<<<<
 *                               flip: bool, split: 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":1526
 *         CHKERR(DMPlexLabelCohesiveComplete(self.dm, label.dmlabel, bdlabel.dmlabel, val, flg, flg2, 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_115setAdjacencyUseAnchors(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_114setAdjacencyUseAnchors, "DMPlex.setAdjacencyUseAnchors(self, useAnchors: bool = True) -> None\nDefine adjacency in the mesh using the point-to-point constraints.\n\n        Logically collective.\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:1526");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_115setAdjacencyUseAnchors = {"setAdjacencyUseAnchors", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_115setAdjacencyUseAnchors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_114setAdjacencyUseAnchors};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_115setAdjacencyUseAnchors(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_useAnchors,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1526, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1526, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setAdjacencyUseAnchors", 0) < (0)) __PYX_ERR(57, 1526, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1526, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_useAnchors = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setAdjacencyUseAnchors", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 1526, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_114setAdjacencyUseAnchors(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_useAnchors);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_114setAdjacencyUseAnchors(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1544
 * 
 *         """
 *         cdef PetscBool flag = useAnchors             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexSetAdjacencyUseAnchors(self.dm, flag))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_useAnchors); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(57, 1544, __pyx_L1_error)
  __pyx_v_flag = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":1545
 *         """
 *         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, 1545, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1526
 *         CHKERR(DMPlexLabelCohesiveComplete(self.dm, label.dmlabel, bdlabel.dmlabel, val, flg, flg2, 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":1547
 *         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_117getAdjacencyUseAnchors(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_116getAdjacencyUseAnchors, "DMPlex.getAdjacencyUseAnchors(self) -> bool\nQuery whether adjacency in the mesh uses the point-to-point constraints.\n\n        Not collective.\n\n        See Also\n        --------\n        DMPlex, DMPlex.getAdjacency, DMPlex.distribute\n        petsc.DMPlexGetAdjacencyUseAnchors\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:1547");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_117getAdjacencyUseAnchors = {"getAdjacencyUseAnchors", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_117getAdjacencyUseAnchors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_116getAdjacencyUseAnchors};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_117getAdjacencyUseAnchors(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getAdjacencyUseAnchors", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_116getAdjacencyUseAnchors(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_116getAdjacencyUseAnchors(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1558
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetAdjacencyUseAnchors(self.dm, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/DMPlex.pyx":1559
 *         """
 *         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, 1559, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1560
 *         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, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":1547
 *         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":1562
 *         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_119getAdjacency(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_118getAdjacency, "DMPlex.getAdjacency(self, p: int) -> ArrayInt\nReturn all points adjacent to the given point.\n\n        Not collective.\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:1562");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_119getAdjacency = {"getAdjacency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_119getAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_118getAdjacency};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_119getAdjacency(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1562, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1562, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getAdjacency", 0) < (0)) __PYX_ERR(57, 1562, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getAdjacency", 1, 1, 1, i); __PYX_ERR(57, 1562, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1562, __pyx_L3_error)
    }
    __pyx_v_p = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getAdjacency", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1562, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_118getAdjacency(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_118getAdjacency(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1577
 * 
 *         """
 *         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, 1577, __pyx_L1_error)
  __pyx_v_cp = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":1578
 *         """
 *         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":1579
 *         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":1580
 *         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, 1580, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1581
 *         cdef PetscInt *iadj = NULL
 *         CHKERR(DMPlexGetAdjacency(self.dm, cp, &nadj, &iadj))
 *         try:             # <<<<<<<<<<<<<<
 *             adjacency = array_i(nadj, iadj)
 *         finally:
*/
  /*try:*/ {

    /* "petsc4py/PETSc/DMPlex.pyx":1582
 *         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, 1582, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_adjacency = ((PyArrayObject *)__pyx_t_3);
    __pyx_t_3 = 0;
  }

  /* "petsc4py/PETSc/DMPlex.pyx":1584
 *             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, 1584, __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;
       __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if ( 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, 1584, __pyx_L7_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);
      __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:;
      __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":1585
 *         finally:
 *             CHKERR(PetscFree(iadj))
 *         return adjacency             # <<<<<<<<<<<<<<
 * 
 *     def setPartitioner(self, Partitioner part) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_adjacency);
  __pyx_r = ((PyObject *)__pyx_v_adjacency);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":1562
 *         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":1587
 *         return adjacency
 * 
 *     def setPartitioner(self, Partitioner part) -> None:             # <<<<<<<<<<<<<<
 *         """Set the mesh partitioner.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_121setPartitioner(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_120setPartitioner, "DMPlex.setPartitioner(self, part: Partitioner) -> None\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:1587");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_121setPartitioner = {"setPartitioner", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_121setPartitioner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_120setPartitioner};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_121setPartitioner(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_part,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1587, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1587, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPartitioner", 0) < (0)) __PYX_ERR(57, 1587, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPartitioner", 1, 1, 1, i); __PYX_ERR(57, 1587, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1587, __pyx_L3_error)
    }
    __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, 1587, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner, 0, "part", 0))) __PYX_ERR(57, 1587, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_120setPartitioner(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_part);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_120setPartitioner(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1603
 * 
 *         """
 *         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, 1603, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1587
 *         return adjacency
 * 
 *     def setPartitioner(self, Partitioner part) -> None:             # <<<<<<<<<<<<<<
 *         """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":1605
 *         CHKERR(DMPlexSetPartitioner(self.dm, part.part))
 * 
 *     def getPartitioner(self) -> Partitioner:             # <<<<<<<<<<<<<<
 *         """Return the mesh partitioner.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_123getPartitioner(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_122getPartitioner, "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:1605");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_123getPartitioner = {"getPartitioner", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_123getPartitioner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_122getPartitioner};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_123getPartitioner(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPartitioner", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_122getPartitioner(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_122getPartitioner(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getPartitioner", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1617
 * 
 *         """
 *         cdef Partitioner part = Partitioner()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetPartitioner(self.dm, &part.part))
 *         CHKERR(PetscINCREF(part.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 1617, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_part = ((struct PyPetscPartitionerObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1618
 *         """
 *         cdef Partitioner part = Partitioner()
 *         CHKERR(DMPlexGetPartitioner(self.dm, &part.part))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(part.obj))
 *         return part
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetPartitioner(__pyx_v_self->__pyx_base.dm, (&__pyx_v_part->part))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1618, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1619
 *         cdef Partitioner part = Partitioner()
 *         CHKERR(DMPlexGetPartitioner(self.dm, &part.part))
 *         CHKERR(PetscINCREF(part.obj))             # <<<<<<<<<<<<<<
 *         return part
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_part->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1619, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1620
 *         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":1605
 *         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_XDECREF(__pyx_t_2);
  __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":1622
 *         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_125rebalanceSharedPoints(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_124rebalanceSharedPoints, "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        Collective.\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:1622");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_125rebalanceSharedPoints = {"rebalanceSharedPoints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_125rebalanceSharedPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_124rebalanceSharedPoints};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_125rebalanceSharedPoints(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_entityDepth,&__pyx_mstate_global->__pyx_n_u_useInitialGuess,&__pyx_mstate_global->__pyx_n_u_parallel,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1622, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1622, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1622, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1622, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "rebalanceSharedPoints", 0) < (0)) __PYX_ERR(57, 1622, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1622, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1622, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1622, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __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, 1622, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_124rebalanceSharedPoints(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_entityDepth, __pyx_v_useInitialGuess, __pyx_v_parallel);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_124rebalanceSharedPoints(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1649
 * 
 *         """
 *         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, 1649, __pyx_L1_error)
  __pyx_v_centityDepth = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":1650
 *         """
 *         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, 1650, __pyx_L1_error)
  __pyx_v_cuseInitialGuess = __pyx_t_2;

  /* "petsc4py/PETSc/DMPlex.pyx":1651
 *         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, 1651, __pyx_L1_error)
  __pyx_v_cparallel = __pyx_t_2;

  /* "petsc4py/PETSc/DMPlex.pyx":1652
 *         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":1653
 *         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, 1653, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1654
 *         cdef PetscBool csuccess = PETSC_FALSE
 *         CHKERR(DMPlexRebalanceSharedPoints(self.dm, centityDepth, cuseInitialGuess, cparallel, &csuccess))
 *         return toBool(csuccess)             # <<<<<<<<<<<<<<
 * 
 *     def distribute(self, overlap: int | None = 0) -> SF | None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_toBool(__pyx_v_csuccess); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1654, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":1622
 *         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":1656
 *         return toBool(csuccess)
 * 
 *     def distribute(self, overlap: int | None = 0) -> SF | None:             # <<<<<<<<<<<<<<
 *         """Distribute the mesh and any associated sections.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_127distribute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_126distribute, "DMPlex.distribute(self, overlap: int | None = 0) -> SF | 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:1656");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_127distribute = {"distribute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_127distribute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_126distribute};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_127distribute(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_overlap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1656, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1656, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "distribute", 0) < (0)) __PYX_ERR(57, 1656, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1656, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __pyx_v_overlap = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("distribute", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 1656, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_126distribute(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_overlap);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_126distribute(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __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("distribute", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1676
 * 
 *         """
 *         cdef PetscDM dmParallel = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt coverlap = asInt(overlap)
 *         cdef SF sf = SF()
*/
  __pyx_v_dmParallel = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":1677
 *         """
 *         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, 1677, __pyx_L1_error)
  __pyx_v_coverlap = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":1678
 *         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_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1678, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1679
 *         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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1679, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1680
 *         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_6 = (__pyx_v_dmParallel != NULL);
  if (__pyx_t_6) {

    /* "petsc4py/PETSc/DMPlex.pyx":1681
 *         CHKERR(DMPlexDistribute(self.dm, coverlap, &sf.sf, &dmParallel))
 *         if dmParallel != NULL:
 *             CHKERR(PetscCLEAR(self.obj)); self.dm = dmParallel             # <<<<<<<<<<<<<<
 *             return sf
 * 
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1681, __pyx_L1_error)
    __pyx_v_self->__pyx_base.dm = __pyx_v_dmParallel;

    /* "petsc4py/PETSc/DMPlex.pyx":1682
 *         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":1680
 *         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":1656
 *         return toBool(csuccess)
 * 
 *     def distribute(self, overlap: int | None = 0) -> SF | 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_XDECREF(__pyx_t_3);
  __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":1684
 *             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_129distributeOverlap(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_128distributeOverlap, "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:1684");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_129distributeOverlap = {"distributeOverlap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_129distributeOverlap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_128distributeOverlap};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_129distributeOverlap(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_overlap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1684, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1684, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "distributeOverlap", 0) < (0)) __PYX_ERR(57, 1684, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1684, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __pyx_v_overlap = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("distributeOverlap", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 1684, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_128distributeOverlap(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_overlap);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_128distributeOverlap(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("distributeOverlap", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1705
 * 
 *         """
 *         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, 1705, __pyx_L1_error)
  __pyx_v_coverlap = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":1706
 *         """
 *         cdef PetscInt coverlap = asInt(overlap)
 *         cdef SF sf = SF()             # <<<<<<<<<<<<<<
 *         cdef PetscDM dmOverlap = NULL
 *         CHKERR(DMPlexDistributeOverlap(self.dm, coverlap,
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1706, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1707
 *         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":1708
 *         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_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1708, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1710
 *         CHKERR(DMPlexDistributeOverlap(self.dm, coverlap,
 *                                        &sf.sf, &dmOverlap))
 *         CHKERR(PetscCLEAR(self.obj)); self.dm = dmOverlap             # <<<<<<<<<<<<<<
 *         return sf
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1710, __pyx_L1_error)
  __pyx_v_self->__pyx_base.dm = __pyx_v_dmOverlap;

  /* "petsc4py/PETSc/DMPlex.pyx":1711
 *                                        &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":1684
 *             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_XDECREF(__pyx_t_3);
  __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":1713
 *         return sf
 * 
 *     def isDistributed(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag indicating if the mesh is distributed.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_131isDistributed(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_130isDistributed, "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:1713");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_131isDistributed = {"isDistributed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_131isDistributed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_130isDistributed};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_131isDistributed(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isDistributed", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_130isDistributed(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_130isDistributed(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1723
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexIsDistributed(self.dm, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/DMPlex.pyx":1724
 *         """
 *         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, 1724, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1725
 *         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, 1725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":1713
 *         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":1727
 *         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_133isSimplex(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_132isSimplex, "DMPlex.isSimplex(self) -> bool\nReturn the flag indicating if the first cell is a simplex.\n\n        Not collective.\n\n        See Also\n        --------\n        DM, DMPlex, DMPlex.getCellType, DMPlex.getHeightStratum\n        petsc.DMPlexIsSimplex\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:1727");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_133isSimplex = {"isSimplex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_133isSimplex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_132isSimplex};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_133isSimplex(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("isSimplex", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_132isSimplex(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_132isSimplex(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1738
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexIsSimplex(self.dm, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/DMPlex.pyx":1739
 *         """
 *         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, 1739, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1740
 *         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, 1740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":1727
 *         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":1742
 *         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_135distributeGetDefault(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_134distributeGetDefault, "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:1742");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_135distributeGetDefault = {"distributeGetDefault", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_135distributeGetDefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_134distributeGetDefault};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_135distributeGetDefault(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("distributeGetDefault", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_134distributeGetDefault(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_134distributeGetDefault(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1758
 * 
 *         """
 *         cdef PetscBool dist = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexDistributeGetDefault(self.dm, &dist))
 *         return toBool(dist)
*/
  __pyx_v_dist = PETSC_FALSE;

  /* "petsc4py/PETSc/DMPlex.pyx":1759
 *         """
 *         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, 1759, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1760
 *         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, 1760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":1742
 *         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":1762
 *         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_137distributeSetDefault(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_136distributeSetDefault, "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:1762");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_137distributeSetDefault = {"distributeSetDefault", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_137distributeSetDefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_136distributeSetDefault};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_137distributeSetDefault(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1762, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1762, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "distributeSetDefault", 0) < (0)) __PYX_ERR(57, 1762, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("distributeSetDefault", 1, 1, 1, i); __PYX_ERR(57, 1762, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1762, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("distributeSetDefault", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1762, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_136distributeSetDefault(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_136distributeSetDefault(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1778
 * 
 *         """
 *         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, 1778, __pyx_L1_error)
  __pyx_v_dist = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":1779
 *         """
 *         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, 1779, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1780
 *         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":1762
 *         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":1782
 *         return
 * 
 *     def distributionSetName(self, name: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the name of the specific parallel distribution.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_139distributionSetName(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_138distributionSetName, "DMPlex.distributionSetName(self, name: str) -> None\nSet the name of the specific parallel distribution.\n\n        Logically collective.\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:1782");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_139distributionSetName = {"distributionSetName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_139distributionSetName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_138distributionSetName};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_139distributionSetName(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1782, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1782, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "distributionSetName", 0) < (0)) __PYX_ERR(57, 1782, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("distributionSetName", 1, 1, 1, i); __PYX_ERR(57, 1782, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1782, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("distributionSetName", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 1782, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_138distributionSetName(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_138distributionSetName(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":1798
 * 
 *         """
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         if name is not None:
 *             name = str2bytes(name, &cname)
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":1799
 *         """
 *         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":1800
 *         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, 1800, __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":1799
 *         """
 *         cdef const char *cname = NULL
 *         if name is not None:             # <<<<<<<<<<<<<<
 *             name = str2bytes(name, &cname)
 *         CHKERR(DMPlexDistributionSetName(self.dm, cname))
*/
  }

  /* "petsc4py/PETSc/DMPlex.pyx":1801
 *         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, 1801, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1782
 *         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":1803
 *         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_141distributionGetName(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_140distributionGetName, "DMPlex.distributionGetName(self) -> str\nRetrieve the name of the specific parallel distribution.\n\n        Not collective.\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:1803");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_141distributionGetName = {"distributionGetName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_141distributionGetName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_140distributionGetName};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_141distributionGetName(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("distributionGetName", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_140distributionGetName(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_140distributionGetName(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1819
 * 
 *         """
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexDistributionGetName(self.dm, &cname))
 *         return bytes2str(cname)
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":1820
 *         """
 *         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, 1820, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1821
 *         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, 1821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":1803
 *         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":1823
 *         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_143interpolate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_142interpolate, "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:1823");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_143interpolate = {"interpolate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_143interpolate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_142interpolate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_143interpolate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("interpolate", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_142interpolate(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_142interpolate(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1834
 * 
 *         """
 *         cdef PetscDM newdm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexInterpolate(self.dm, &newdm))
 *         CHKERR(PetscCLEAR(self.obj)); self.dm = newdm
*/
  __pyx_v_newdm = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":1835
 *         """
 *         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, 1835, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1836
 *         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, 1836, __pyx_L1_error)
  __pyx_v_self->__pyx_base.dm = __pyx_v_newdm;

  /* "petsc4py/PETSc/DMPlex.pyx":1823
 *         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":1838
 *         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_145uninterpolate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_144uninterpolate, "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:1838");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_145uninterpolate = {"uninterpolate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_145uninterpolate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_144uninterpolate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_145uninterpolate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("uninterpolate", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_144uninterpolate(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_144uninterpolate(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1849
 * 
 *         """
 *         cdef PetscDM newdm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexUninterpolate(self.dm, &newdm))
 *         CHKERR(PetscCLEAR(self.obj)); self.dm = newdm
*/
  __pyx_v_newdm = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":1850
 *         """
 *         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, 1850, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1851
 *         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, 1851, __pyx_L1_error)
  __pyx_v_self->__pyx_base.dm = __pyx_v_newdm;

  /* "petsc4py/PETSc/DMPlex.pyx":1838
 *         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":1853
 *         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_147distributeField(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_146distributeField, "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:1853");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_147distributeField = {"distributeField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_147distributeField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_146distributeField};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_147distributeField(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sf,&__pyx_mstate_global->__pyx_n_u_sec,&__pyx_mstate_global->__pyx_n_u_vec,&__pyx_mstate_global->__pyx_n_u_newsec,&__pyx_mstate_global->__pyx_n_u_newvec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1853, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 1853, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 1853, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1853, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1853, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1853, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "distributeField", 0) < (0)) __PYX_ERR(57, 1853, __pyx_L3_error)

      /* "petsc4py/PETSc/DMPlex.pyx":1854
 * 
 *     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`.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscSectionObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("distributeField", 0, 3, 5, i); __PYX_ERR(57, 1853, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 1853, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 1853, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1853, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1853, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1853, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct PyPetscSectionObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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, 1853, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(57, 1853, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 0, "sec", 0))) __PYX_ERR(57, 1853, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(57, 1853, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_newsec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 1, "newsec", 0))) __PYX_ERR(57, 1854, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_newvec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 1, "newvec", 0))) __PYX_ERR(57, 1854, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_146distributeField(((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":1853
 *         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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_146distributeField(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  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":1884
 * 
 *         """
 *         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":1885
 *         """
 *         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_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1885, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_newsec, ((struct PyPetscSectionObject *)__pyx_t_2));
    __pyx_t_2 = 0;
  }

  /* "petsc4py/PETSc/DMPlex.pyx":1886
 *         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(<PetscObject>sec.sec, &ccomm))
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_newvec) == Py_None);
  if (__pyx_t_1) {
    __pyx_t_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1886, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__pyx_t_2);
    }
    __Pyx_DECREF_SET(__pyx_v_newvec, ((struct PyPetscVecObject *)__pyx_t_2));
    __pyx_t_2 = 0;
  }

  /* "petsc4py/PETSc/DMPlex.pyx":1887
 *         if newsec is None: newsec = Section()
 *         if newvec is None: newvec = Vec()
 *         if newsec.sec == NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscObjectGetComm(<PetscObject>sec.sec, &ccomm))
 *             CHKERR(PetscSectionCreate(ccomm, &newsec.sec))
*/
  __pyx_t_1 = (__pyx_v_newsec->sec == NULL);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/DMPlex.pyx":1888
 *         if newvec is None: newvec = Vec()
 *         if newsec.sec == NULL:
 *             CHKERR(PetscObjectGetComm(<PetscObject>sec.sec, &ccomm))             # <<<<<<<<<<<<<<
 *             CHKERR(PetscSectionCreate(ccomm, &newsec.sec))
 *         if newvec.vec == NULL:
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_sec->sec), (&__pyx_v_ccomm))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1888, __pyx_L1_error)

    /* "petsc4py/PETSc/DMPlex.pyx":1889
 *         if newsec.sec == NULL:
 *             CHKERR(PetscObjectGetComm(<PetscObject>sec.sec, &ccomm))
 *             CHKERR(PetscSectionCreate(ccomm, &newsec.sec))             # <<<<<<<<<<<<<<
 *         if newvec.vec == NULL:
 *             CHKERR(PetscObjectGetComm(<PetscObject>vec.vec, &ccomm))
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSectionCreate(__pyx_v_ccomm, (&__pyx_v_newsec->sec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1889, __pyx_L1_error)

    /* "petsc4py/PETSc/DMPlex.pyx":1887
 *         if newsec is None: newsec = Section()
 *         if newvec is None: newvec = Vec()
 *         if newsec.sec == NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscObjectGetComm(<PetscObject>sec.sec, &ccomm))
 *             CHKERR(PetscSectionCreate(ccomm, &newsec.sec))
*/
  }

  /* "petsc4py/PETSc/DMPlex.pyx":1890
 *             CHKERR(PetscObjectGetComm(<PetscObject>sec.sec, &ccomm))
 *             CHKERR(PetscSectionCreate(ccomm, &newsec.sec))
 *         if newvec.vec == NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscObjectGetComm(<PetscObject>vec.vec, &ccomm))
 *             CHKERR(VecCreate(ccomm, &newvec.vec))
*/
  __pyx_t_1 = (__pyx_v_newvec->vec == NULL);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/DMPlex.pyx":1891
 *             CHKERR(PetscSectionCreate(ccomm, &newsec.sec))
 *         if newvec.vec == NULL:
 *             CHKERR(PetscObjectGetComm(<PetscObject>vec.vec, &ccomm))             # <<<<<<<<<<<<<<
 *             CHKERR(VecCreate(ccomm, &newvec.vec))
 *         CHKERR(DMPlexDistributeField(self.dm, sf.sf,
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectGetComm(((PetscObject)__pyx_v_vec->vec), (&__pyx_v_ccomm))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1891, __pyx_L1_error)

    /* "petsc4py/PETSc/DMPlex.pyx":1892
 *         if newvec.vec == NULL:
 *             CHKERR(PetscObjectGetComm(<PetscObject>vec.vec, &ccomm))
 *             CHKERR(VecCreate(ccomm, &newvec.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexDistributeField(self.dm, sf.sf,
 *                                      sec.sec, vec.vec,
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecCreate(__pyx_v_ccomm, (&__pyx_v_newvec->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1892, __pyx_L1_error)

    /* "petsc4py/PETSc/DMPlex.pyx":1890
 *             CHKERR(PetscObjectGetComm(<PetscObject>sec.sec, &ccomm))
 *             CHKERR(PetscSectionCreate(ccomm, &newsec.sec))
 *         if newvec.vec == NULL:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscObjectGetComm(<PetscObject>vec.vec, &ccomm))
 *             CHKERR(VecCreate(ccomm, &newvec.vec))
*/
  }

  /* "petsc4py/PETSc/DMPlex.pyx":1893
 *             CHKERR(PetscObjectGetComm(<PetscObject>vec.vec, &ccomm))
 *             CHKERR(VecCreate(ccomm, &newvec.vec))
 *         CHKERR(DMPlexDistributeField(self.dm, sf.sf,             # <<<<<<<<<<<<<<
 *                                      sec.sec, vec.vec,
 *                                      newsec.sec, newvec.vec))
*/
  __pyx_t_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1893, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1896
 *                                      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, 1896, __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)) != (0)) __PYX_ERR(57, 1896, __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)) != (0)) __PYX_ERR(57, 1896, __pyx_L1_error);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":1853
 *         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_XDECREF(__pyx_t_3);
  __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":1898
 *         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_149getMinRadius(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_148getMinRadius, "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:1898");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_149getMinRadius = {"getMinRadius", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_149getMinRadius, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_148getMinRadius};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_149getMinRadius(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMinRadius", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_148getMinRadius(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_148getMinRadius(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1908
 * 
 *         """
 *         cdef PetscReal cminradius = 0.             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetMinRadius(self.dm, &cminradius))
 *         return asReal(cminradius)
*/
  __pyx_v_cminradius = 0.;

  /* "petsc4py/PETSc/DMPlex.pyx":1909
 *         """
 *         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, 1909, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1910
 *         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, 1910, __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, 1910, __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, 1910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":1898
 *         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":1912
 *         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_151createCoarsePointIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_150createCoarsePointIS, "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:1912");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_151createCoarsePointIS = {"createCoarsePointIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_151createCoarsePointIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_150createCoarsePointIS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_151createCoarsePointIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("createCoarsePointIS", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_150createCoarsePointIS(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_150createCoarsePointIS(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createCoarsePointIS", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":1928
 * 
 *         """
 *         cdef IS fpoint = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexCreateCoarsePointIS(self.dm, &fpoint.iset))
 *         return fpoint
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 1928, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_fpoint = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1929
 *         """
 *         cdef IS fpoint = IS()
 *         CHKERR(DMPlexCreateCoarsePointIS(self.dm, &fpoint.iset))             # <<<<<<<<<<<<<<
 *         return fpoint
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateCoarsePointIS(__pyx_v_self->__pyx_base.dm, (&__pyx_v_fpoint->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 1929, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1930
 *         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":1912
 *         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_XDECREF(__pyx_t_2);
  __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":1932
 *         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_153createSection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_152createSection, "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:1932");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_153createSection = {"createSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_153createSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_152createSection};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_153createSection(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_numComp,&__pyx_mstate_global->__pyx_n_u_numDof,&__pyx_mstate_global->__pyx_n_u_bcField,&__pyx_mstate_global->__pyx_n_u_bcComps,&__pyx_mstate_global->__pyx_n_u_bcPoints,&__pyx_mstate_global->__pyx_n_u_perm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 1932, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(57, 1932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 1932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 1932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createSection", 0) < (0)) __PYX_ERR(57, 1932, __pyx_L3_error)

      /* "petsc4py/PETSc/DMPlex.pyx":1933
 * 
 *     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.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMPlex.pyx":1934
 *     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.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createSection", 0, 2, 6, i); __PYX_ERR(57, 1932, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(57, 1932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 1932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 1932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 1932, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 1932, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 1932, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMPlex.pyx":1933
 * 
 *     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.
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMPlex.pyx":1934
 *     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.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef((PyObject *)((struct PyPetscISObject *)Py_None));
    }
    __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, 1932, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 1, "perm", 0))) __PYX_ERR(57, 1934, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_152createSection(((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":1932
 *         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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_152createSection(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 PyObject *__pyx_v_unused1 = 0;
  CYTHON_UNUSED PyObject *__pyx_v_unused2 = 0;
  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;
  size_t __pyx_t_8;
  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":1965
 *         """
 *         # topological dimension
 *         cdef PetscInt dim = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetDimension(self.dm, &dim))
 *         # components and DOFs
*/
  __pyx_v_dim = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1966
 *         # 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, 1966, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":1968
 *         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":1969
 *         # 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":1970
 *         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, 1970, __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":1971
 *         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, 1971, __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":1972
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(57, 1972, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(57, 1972, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DMPlex.pyx":1974
 *         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":1975
 *         # 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":1976
 *         cdef PetscInt nbc = 0, i = 0
 *         cdef PetscInt *bcfield = NULL
 *         cdef PetscIS *bccomps  = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscIS *bcpoints = NULL
 *         cdef object unused1, unused2
*/
  __pyx_v_bccomps = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":1977
 *         cdef PetscInt *bcfield = NULL
 *         cdef PetscIS *bccomps  = NULL
 *         cdef PetscIS *bcpoints = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused1, unused2
 *         if bcField is not None:
*/
  __pyx_v_bcpoints = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":1979
 *         cdef PetscIS *bcpoints = NULL
 *         cdef object unused1, unused2
 *         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":1980
 *         cdef object unused1, unused2
 *         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, 1980, __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":1981
 *         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":1982
 *             bcField = iarray_i(bcField, &nbc, &bcfield)
 *             if bcComps is not None:
 *                 bcComps = list(bcComps)             # <<<<<<<<<<<<<<
 *                 assert len(bcComps) == nbc
 *                 unused1 = oarray_p(empty_p(nbc), NULL, <void**>&bccomps)
*/
      __pyx_t_2 = PySequence_List(__pyx_v_bcComps); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1982, __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":1983
 *             if bcComps is not None:
 *                 bcComps = list(bcComps)
 *                 assert len(bcComps) == nbc             # <<<<<<<<<<<<<<
 *                 unused1 = oarray_p(empty_p(nbc), NULL, <void**>&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, 1983, __pyx_L1_error)
        __pyx_t_3 = (__pyx_t_4 == __pyx_v_nbc);
        if (unlikely(!__pyx_t_3)) {
          __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
          __PYX_ERR(57, 1983, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(57, 1983, __pyx_L1_error)
      #endif

      /* "petsc4py/PETSc/DMPlex.pyx":1984
 *                 bcComps = list(bcComps)
 *                 assert len(bcComps) == nbc
 *                 unused1 = oarray_p(empty_p(nbc), NULL, <void**>&bccomps)             # <<<<<<<<<<<<<<
 *                 for i from 0 <= i < nbc:
 *                     bccomps[i] = (<IS?>bcComps[<Py_ssize_t>i]).iset
*/
      __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nbc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1984, __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, 1984, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_unused1 = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "petsc4py/PETSc/DMPlex.pyx":1985
 *                 assert len(bcComps) == nbc
 *                 unused1 = oarray_p(empty_p(nbc), NULL, <void**>&bccomps)
 *                 for i from 0 <= i < nbc:             # <<<<<<<<<<<<<<
 *                     bccomps[i] = (<IS?>bcComps[<Py_ssize_t>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":1986
 *                 unused1 = oarray_p(empty_p(nbc), NULL, <void**>&bccomps)
 *                 for i from 0 <= i < nbc:
 *                     bccomps[i] = (<IS?>bcComps[<Py_ssize_t>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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1986, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (!(likely(__Pyx_TypeTest(__pyx_t_5, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(57, 1986, __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":1981
 *         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":1987
 *                 for i from 0 <= i < nbc:
 *                     bccomps[i] = (<IS?>bcComps[<Py_ssize_t>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":1988
 *                     bccomps[i] = (<IS?>bcComps[<Py_ssize_t>i]).iset
 *             if bcPoints is not None:
 *                 bcPoints = list(bcPoints)             # <<<<<<<<<<<<<<
 *                 assert len(bcPoints) == nbc
 *                 unused2 = oarray_p(empty_p(nbc), NULL, <void**>&bcpoints)
*/
      __pyx_t_5 = PySequence_List(__pyx_v_bcPoints); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1988, __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":1989
 *             if bcPoints is not None:
 *                 bcPoints = list(bcPoints)
 *                 assert len(bcPoints) == nbc             # <<<<<<<<<<<<<<
 *                 unused2 = oarray_p(empty_p(nbc), NULL, <void**>&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, 1989, __pyx_L1_error)
        __pyx_t_3 = (__pyx_t_4 == __pyx_v_nbc);
        if (unlikely(!__pyx_t_3)) {
          __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
          __PYX_ERR(57, 1989, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(57, 1989, __pyx_L1_error)
      #endif

      /* "petsc4py/PETSc/DMPlex.pyx":1990
 *                 bcPoints = list(bcPoints)
 *                 assert len(bcPoints) == nbc
 *                 unused2 = oarray_p(empty_p(nbc), NULL, <void**>&bcpoints)             # <<<<<<<<<<<<<<
 *                 for i from 0 <= i < nbc:
 *                     bcpoints[i] = (<IS?>bcPoints[<Py_ssize_t>i]).iset
*/
      __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nbc)); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1990, __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, 1990, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_unused2 = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "petsc4py/PETSc/DMPlex.pyx":1991
 *                 assert len(bcPoints) == nbc
 *                 unused2 = oarray_p(empty_p(nbc), NULL, <void**>&bcpoints)
 *                 for i from 0 <= i < nbc:             # <<<<<<<<<<<<<<
 *                     bcpoints[i] = (<IS?>bcPoints[<Py_ssize_t>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":1992
 *                 unused2 = oarray_p(empty_p(nbc), NULL, <void**>&bcpoints)
 *                 for i from 0 <= i < nbc:
 *                     bcpoints[i] = (<IS?>bcPoints[<Py_ssize_t>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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1992, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(57, 1992, __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":1987
 *                 for i from 0 <= i < nbc:
 *                     bccomps[i] = (<IS?>bcComps[<Py_ssize_t>i]).iset
 *             if bcPoints is not None:             # <<<<<<<<<<<<<<
 *                 bcPoints = list(bcPoints)
 *                 assert len(bcPoints) == nbc
*/
      goto __pyx_L7;
    }

    /* "petsc4py/PETSc/DMPlex.pyx":1994
 *                     bcpoints[i] = (<IS?>bcPoints[<Py_ssize_t>i]).iset
 *             else:
 *                 raise ValueError("bcPoints is a required argument")             # <<<<<<<<<<<<<<
 *         else:
 *             assert bcComps  is None
*/
    /*else*/ {
      __pyx_t_5 = NULL;
      __pyx_t_8 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_bcPoints_is_a_required_argument};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 1994, __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, 1994, __pyx_L1_error)
    }
    __pyx_L7:;

    /* "petsc4py/PETSc/DMPlex.pyx":1979
 *         cdef PetscIS *bcpoints = NULL
 *         cdef object unused1, unused2
 *         if bcField is not None:             # <<<<<<<<<<<<<<
 *             bcField = iarray_i(bcField, &nbc, &bcfield)
 *             if bcComps is not None:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DMPlex.pyx":1996
 *                 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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(57, 1996, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(57, 1996, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/DMPlex.pyx":1997
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(57, 1997, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(57, 1997, __pyx_L1_error)
    #endif
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DMPlex.pyx":1999
 *             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":2000
 *         # 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":2002
 *         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_5 = NULL;
  __pyx_t_8 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2002, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_sec = ((struct PyPetscSectionObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2003
 *         # 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, 2003, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2006
 *                                    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":1932
 *         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(__pyx_v_unused1);
  __Pyx_XDECREF(__pyx_v_unused2);
  __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":2008
 *         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_155getPointLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_154getPointLocal, "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:2008");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_155getPointLocal = {"getPointLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_155getPointLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_154getPointLocal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_155getPointLocal(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2008, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2008, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getPointLocal", 0) < (0)) __PYX_ERR(57, 2008, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getPointLocal", 1, 1, 1, i); __PYX_ERR(57, 2008, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2008, __pyx_L3_error)
    }
    __pyx_v_point = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getPointLocal", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2008, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_154getPointLocal(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_point);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_154getPointLocal(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2031
 * 
 *         """
 *         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":2032
 *         """
 *         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, 2032, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2033
 *         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, 2033, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2034
 *         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, 2034, __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, 2034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2034, __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) != (0)) __PYX_ERR(57, 2034, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(57, 2034, __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":2008
 *         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":2036
 *         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_157getPointLocalField(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_156getPointLocalField, "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:2036");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_157getPointLocalField = {"getPointLocalField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_157getPointLocalField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_156getPointLocalField};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_157getPointLocalField(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2036, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getPointLocalField", 0) < (0)) __PYX_ERR(57, 2036, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getPointLocalField", 1, 2, 2, i); __PYX_ERR(57, 2036, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2036, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 2036, __pyx_L3_error)
    }
    __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, 2036, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_156getPointLocalField(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_point, __pyx_v_field);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_156getPointLocalField(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2061
 * 
 *         """
 *         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":2062
 *         """
 *         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, 2062, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2063
 *         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, 2063, __pyx_L1_error)
  __pyx_v_cfield = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2064
 *         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, 2064, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2065
 *         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, 2065, __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, 2065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2065, __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) != (0)) __PYX_ERR(57, 2065, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(57, 2065, __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":2036
 *         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":2067
 *         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_159getPointGlobal(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_158getPointGlobal, "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:2067");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_159getPointGlobal = {"getPointGlobal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_159getPointGlobal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_158getPointGlobal};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_159getPointGlobal(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2067, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2067, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getPointGlobal", 0) < (0)) __PYX_ERR(57, 2067, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getPointGlobal", 1, 1, 1, i); __PYX_ERR(57, 2067, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2067, __pyx_L3_error)
    }
    __pyx_v_point = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getPointGlobal", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2067, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_158getPointGlobal(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_point);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_158getPointGlobal(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2090
 * 
 *         """
 *         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":2091
 *         """
 *         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, 2091, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2092
 *         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, 2092, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2093
 *         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, 2093, __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, 2093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2093, __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) != (0)) __PYX_ERR(57, 2093, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(57, 2093, __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":2067
 *         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":2095
 *         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_161getPointGlobalField(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_160getPointGlobalField, "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:2095");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_161getPointGlobalField = {"getPointGlobalField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_161getPointGlobalField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_160getPointGlobalField};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_161getPointGlobalField(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2095, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 2095, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2095, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getPointGlobalField", 0) < (0)) __PYX_ERR(57, 2095, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getPointGlobalField", 1, 2, 2, i); __PYX_ERR(57, 2095, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2095, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 2095, __pyx_L3_error)
    }
    __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, 2095, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_160getPointGlobalField(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_point, __pyx_v_field);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_160getPointGlobalField(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2120
 * 
 *         """
 *         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":2121
 *         """
 *         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, 2121, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2122
 *         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, 2122, __pyx_L1_error)
  __pyx_v_cfield = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2123
 *         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, 2123, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2124
 *         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, 2124, __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, 2124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2124, __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) != (0)) __PYX_ERR(57, 2124, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(57, 2124, __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":2095
 *         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":2126
 *         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_163createClosureIndex(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_162createClosureIndex, "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:2126");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_163createClosureIndex = {"createClosureIndex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_163createClosureIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_162createClosureIndex};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_163createClosureIndex(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2126, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2126, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createClosureIndex", 0) < (0)) __PYX_ERR(57, 2126, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createClosureIndex", 1, 1, 1, i); __PYX_ERR(57, 2126, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2126, __pyx_L3_error)
    }
    __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, 2126, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 1, "sec", 0))) __PYX_ERR(57, 2126, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_162createClosureIndex(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_sec);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_162createClosureIndex(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2143
 * 
 *         """
 *         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":2144
 *         """
 *         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, 2144, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2126
 *         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":2148
 *     #
 * 
 *     def setRefinementUniform(self, refinementUniform: bool | None = True) -> None:             # <<<<<<<<<<<<<<
 *         """Set the flag for uniform refinement.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_165setRefinementUniform(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_164setRefinementUniform, "DMPlex.setRefinementUniform(self, refinementUniform: bool | None = True) -> None\nSet the flag for uniform refinement.\n\n        Logically collective.\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:2148");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_165setRefinementUniform = {"setRefinementUniform", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_165setRefinementUniform, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_164setRefinementUniform};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_165setRefinementUniform(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_refinementUniform,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2148, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2148, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRefinementUniform", 0) < (0)) __PYX_ERR(57, 2148, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2148, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __pyx_v_refinementUniform = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setRefinementUniform", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 2148, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_164setRefinementUniform(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_refinementUniform);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_164setRefinementUniform(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2165
 * 
 *         """
 *         cdef PetscBool flag = refinementUniform             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexSetRefinementUniform(self.dm, flag))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_refinementUniform); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(57, 2165, __pyx_L1_error)
  __pyx_v_flag = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2166
 *         """
 *         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, 2166, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2148
 *     #
 * 
 *     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":2168
 *         CHKERR(DMPlexSetRefinementUniform(self.dm, flag))
 * 
 *     def getRefinementUniform(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Retrieve the flag for uniform refinement.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_167getRefinementUniform(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_166getRefinementUniform, "DMPlex.getRefinementUniform(self) -> bool\nRetrieve the flag for uniform refinement.\n\n        Not collective.\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:2168");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_167getRefinementUniform = {"getRefinementUniform", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_167getRefinementUniform, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_166getRefinementUniform};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_167getRefinementUniform(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getRefinementUniform", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_166getRefinementUniform(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_166getRefinementUniform(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2185
 * 
 *         """
 *         cdef PetscBool flag = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetRefinementUniform(self.dm, &flag))
 *         return toBool(flag)
*/
  __pyx_v_flag = PETSC_FALSE;

  /* "petsc4py/PETSc/DMPlex.pyx":2186
 *         """
 *         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, 2186, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2187
 *         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, 2187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2168
 *         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":2189
 *         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_169setRefinementLimit(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_168setRefinementLimit, "DMPlex.setRefinementLimit(self, refinementLimit: float) -> None\nSet the maximum cell volume for refinement.\n\n        Logically collective.\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:2189");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_169setRefinementLimit = {"setRefinementLimit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_169setRefinementLimit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_168setRefinementLimit};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_169setRefinementLimit(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_refinementLimit,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2189, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2189, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRefinementLimit", 0) < (0)) __PYX_ERR(57, 2189, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setRefinementLimit", 1, 1, 1, i); __PYX_ERR(57, 2189, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2189, __pyx_L3_error)
    }
    __pyx_v_refinementLimit = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setRefinementLimit", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2189, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_168setRefinementLimit(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_refinementLimit);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_168setRefinementLimit(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2206
 * 
 *         """
 *         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, 2206, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2207
 *         """
 *         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, 2207, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2189
 *         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":2209
 *         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_171getRefinementLimit(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_170getRefinementLimit, "DMPlex.getRefinementLimit(self) -> float\nRetrieve the maximum cell volume for refinement.\n\n        Not collective.\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:2209");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_171getRefinementLimit = {"getRefinementLimit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_171getRefinementLimit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_170getRefinementLimit};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_171getRefinementLimit(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getRefinementLimit", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_170getRefinementLimit(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_170getRefinementLimit(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2221
 * 
 *         """
 *         cdef PetscReal rval = 0.0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetRefinementLimit(self.dm, &rval))
 *         return toReal(rval)
*/
  __pyx_v_rval = 0.0;

  /* "petsc4py/PETSc/DMPlex.pyx":2222
 *         """
 *         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, 2222, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2223
 *         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, 2223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2209
 *         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":2225
 *         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_173getOrdering(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_172getOrdering, "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:2225");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_173getOrdering = {"getOrdering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_173getOrdering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_172getOrdering};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_173getOrdering(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_otype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2225, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2225, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getOrdering", 0) < (0)) __PYX_ERR(57, 2225, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getOrdering", 1, 1, 1, i); __PYX_ERR(57, 2225, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2225, __pyx_L3_error)
    }
    __pyx_v_otype = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getOrdering", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2225, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_172getOrdering(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_otype);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_172getOrdering(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  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":2246
 * 
 *         """
 *         cdef PetscMatOrderingType cval = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscDMLabel label = NULL
 *         otype = str2bytes(otype, &cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":2247
 *         """
 *         cdef PetscMatOrderingType cval = NULL
 *         cdef PetscDMLabel label = NULL             # <<<<<<<<<<<<<<
 *         otype = str2bytes(otype, &cval)
 *         cdef IS perm = IS()
*/
  __pyx_v_label = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":2248
 *         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, 2248, __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":2249
 *         cdef PetscDMLabel label = NULL
 *         otype = str2bytes(otype, &cval)
 *         cdef IS perm = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetOrdering(self.dm, cval, label, &perm.iset))
 *         return perm
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 2249, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_perm = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2250
 *         otype = str2bytes(otype, &cval)
 *         cdef IS perm = IS()
 *         CHKERR(DMPlexGetOrdering(self.dm, cval, label, &perm.iset))             # <<<<<<<<<<<<<<
 *         return perm
 * 
*/
  __pyx_t_4 = __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_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2250, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2251
 *         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":2225
 *         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_XDECREF(__pyx_t_2);
  __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":2253
 *         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_175permute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_174permute, "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:2253");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_175permute = {"permute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_175permute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_174permute};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_175permute(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_perm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2253, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2253, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "permute", 0) < (0)) __PYX_ERR(57, 2253, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("permute", 1, 1, 1, i); __PYX_ERR(57, 2253, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2253, __pyx_L3_error)
    }
    __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, 2253, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "perm", 0))) __PYX_ERR(57, 2253, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_174permute(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_perm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_174permute(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;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("permute", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2273
 * 
 *         """
 *         cdef DMPlex dm = <DMPlex>type(self)()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexPermute(self.dm, perm.iset, &dm.dm))
 *         return dm
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_3 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 2273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_3 = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dm = ((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2274
 *         """
 *         cdef DMPlex dm = <DMPlex>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, 2274, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2275
 *         cdef DMPlex dm = <DMPlex>type(self)()
 *         CHKERR(DMPlexPermute(self.dm, perm.iset, &dm.dm))
 *         return dm             # <<<<<<<<<<<<<<
 * 
 *     def reorderGetDefault(self) -> DM.ReorderDefaultFlag:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_dm);
  __pyx_r = ((PyObject *)__pyx_v_dm);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2253
 *         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":2277
 *         return dm
 * 
 *     def reorderGetDefault(self) -> DM.ReorderDefaultFlag:             # <<<<<<<<<<<<<<
 *         """Return flag indicating whether the `DMPlex` should be reordered by default.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_177reorderGetDefault(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_176reorderGetDefault, "DMPlex.reorderGetDefault(self) -> DM.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:2277");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_177reorderGetDefault = {"reorderGetDefault", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_177reorderGetDefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_176reorderGetDefault};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_177reorderGetDefault(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("reorderGetDefault", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_176reorderGetDefault(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_176reorderGetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) {
  DMReorderDefaultFlag __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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2287
 * 
 *         """
 *         cdef PetscDMReorderDefaultFlag reorder = DM_REORDER_DEFAULT_NOTSET             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexReorderGetDefault(self.dm, &reorder))
 *         return reorder
*/
  __pyx_v_reorder = DM_REORDER_DEFAULT_NOTSET;

  /* "petsc4py/PETSc/DMPlex.pyx":2288
 *         """
 *         cdef PetscDMReorderDefaultFlag reorder = DM_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, 2288, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2289
 *         cdef PetscDMReorderDefaultFlag reorder = DM_REORDER_DEFAULT_NOTSET
 *         CHKERR(DMPlexReorderGetDefault(self.dm, &reorder))
 *         return reorder             # <<<<<<<<<<<<<<
 * 
 *     def reorderSetDefault(self, flag: DM.ReorderDefaultFlag) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_DMReorderDefaultFlag(__pyx_v_reorder); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 2289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2277
 *         return dm
 * 
 *     def reorderGetDefault(self) -> DM.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":2291
 *         return reorder
 * 
 *     def reorderSetDefault(self, flag: DM.ReorderDefaultFlag) -> None:             # <<<<<<<<<<<<<<
 *         """Set flag indicating whether the DM should be reordered by default.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_179reorderSetDefault(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_178reorderSetDefault, "DMPlex.reorderSetDefault(self, flag: DM.ReorderDefaultFlag) -> None\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:2291");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_179reorderSetDefault = {"reorderSetDefault", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_179reorderSetDefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_178reorderSetDefault};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_179reorderSetDefault(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2291, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2291, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "reorderSetDefault", 0) < (0)) __PYX_ERR(57, 2291, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("reorderSetDefault", 1, 1, 1, i); __PYX_ERR(57, 2291, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2291, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reorderSetDefault", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2291, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_178reorderSetDefault(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_178reorderSetDefault(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, PyObject *__pyx_v_flag) {
  DMReorderDefaultFlag __pyx_v_reorder;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  DMReorderDefaultFlag __pyx_t_1;
  PetscErrorCode __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reorderSetDefault", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2306
 * 
 *         """
 *         cdef PetscDMReorderDefaultFlag reorder = flag             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexReorderSetDefault(self.dm, reorder))
 *         return
*/
  __pyx_t_1 = ((DMReorderDefaultFlag)__Pyx_PyLong_As_DMReorderDefaultFlag(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(57, 2306, __pyx_L1_error)
  __pyx_v_reorder = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2307
 *         """
 *         cdef PetscDMReorderDefaultFlag 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, 2307, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2308
 *         cdef PetscDMReorderDefaultFlag 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":2291
 *         return reorder
 * 
 *     def reorderSetDefault(self, flag: DM.ReorderDefaultFlag) -> None:             # <<<<<<<<<<<<<<
 *         """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":2312
 *     #
 * 
 *     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_181computeCellGeometryFVM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_180computeCellGeometryFVM, "DMPlex.computeCellGeometryFVM(self, cell: int) -> tuple[float, ArrayReal, ArrayReal]\nCompute the volume for a given cell.\n\n        Not 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:2312");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_181computeCellGeometryFVM = {"computeCellGeometryFVM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_181computeCellGeometryFVM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_180computeCellGeometryFVM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_181computeCellGeometryFVM(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cell,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2312, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2312, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeCellGeometryFVM", 0) < (0)) __PYX_ERR(57, 2312, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeCellGeometryFVM", 1, 1, 1, i); __PYX_ERR(57, 2312, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2312, __pyx_L3_error)
    }
    __pyx_v_cell = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("computeCellGeometryFVM", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2312, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_180computeCellGeometryFVM(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_cell);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_180computeCellGeometryFVM(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2337
 * 
 *         """
 *         cdef PetscInt cdim = 0             # <<<<<<<<<<<<<<
 *         cdef PetscInt ccell = asInt(cell)
 *         CHKERR(DMGetCoordinateDim(self.dm, &cdim))
*/
  __pyx_v_cdim = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2338
 *         """
 *         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, 2338, __pyx_L1_error)
  __pyx_v_ccell = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2339
 *         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, 2339, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2340
 *         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":2341
 *         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, 2341, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2342
 *         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, 2342, __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, 2342, __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, 2342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(57, 2342, __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) != (0)) __PYX_ERR(57, 2342, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4) != (0)) __PYX_ERR(57, 2342, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5) != (0)) __PYX_ERR(57, 2342, __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":2312
 *     #
 * 
 *     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":2344
 *         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_183constructGhostCells(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_182constructGhostCells, "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:2344");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_183constructGhostCells = {"constructGhostCells", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_183constructGhostCells, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_182constructGhostCells};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_183constructGhostCells(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_labelName,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2344, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2344, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "constructGhostCells", 0) < (0)) __PYX_ERR(57, 2344, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2344, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_labelName = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("constructGhostCells", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 2344, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_182constructGhostCells(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_labelName);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_182constructGhostCells(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":2365
 * 
 *         """
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         labelName = str2bytes(labelName, &cname)
 *         cdef PetscInt numGhostCells = 0
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":2366
 *         """
 *         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, 2366, __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":2367
 *         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":2368
 *         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":2369
 *         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, 2369, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2370
 *         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, 2370, __pyx_L1_error)
  __pyx_v_self->__pyx_base.dm = __pyx_v_dmGhosted;

  /* "petsc4py/PETSc/DMPlex.pyx":2371
 *         CHKERR(DMPlexConstructGhostCells(self.dm, cname, &numGhostCells, &dmGhosted))
 *         CHKERR(PetscCLEAR(self.obj)); self.dm = dmGhosted
 *         return toInt(numGhostCells)             # <<<<<<<<<<<<<<
 * 
 *     def getSubpointIS(self) -> IS:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_numGhostCells); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 2371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2344
 *         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":2373
 *         return toInt(numGhostCells)
 * 
 *     def getSubpointIS(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return an `IS` covering the entire subdm chart.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_185getSubpointIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_184getSubpointIS, "DMPlex.getSubpointIS(self) -> IS\nReturn an `IS` covering the entire subdm chart.\n\n        Not collective.\n\n        Returns\n        -------\n        iset : IS\n            The `IS` containing subdm's parent's points.\n\n        See Also\n        --------\n        DM, DMPlex, petsc.DMPlexGetSubpointIS\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:2373");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_185getSubpointIS = {"getSubpointIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_185getSubpointIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_184getSubpointIS};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_185getSubpointIS(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getSubpointIS (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSubpointIS", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSubpointIS", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_184getSubpointIS(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_184getSubpointIS(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getSubpointIS", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2388
 * 
 *         """
 *         cdef IS iset = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetSubpointIS(self.dm, &iset.iset))
 *         PetscINCREF(iset.obj)
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 2388, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2389
 *         """
 *         cdef IS iset = IS()
 *         CHKERR(DMPlexGetSubpointIS(self.dm, &iset.iset))             # <<<<<<<<<<<<<<
 *         PetscINCREF(iset.obj)
 *         return iset
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetSubpointIS(__pyx_v_self->__pyx_base.dm, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2389, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2390
 *         cdef IS iset = IS()
 *         CHKERR(DMPlexGetSubpointIS(self.dm, &iset.iset))
 *         PetscINCREF(iset.obj)             # <<<<<<<<<<<<<<
 *         return iset
 * 
*/
  (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_iset->__pyx_base.obj));

  /* "petsc4py/PETSc/DMPlex.pyx":2391
 *         CHKERR(DMPlexGetSubpointIS(self.dm, &iset.iset))
 *         PetscINCREF(iset.obj)
 *         return iset             # <<<<<<<<<<<<<<
 * 
 *     def getSubpointMap(self) -> DMLabel:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_iset);
  __pyx_r = ((PyObject *)__pyx_v_iset);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2373
 *         return toInt(numGhostCells)
 * 
 *     def getSubpointIS(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return an `IS` covering the entire subdm chart.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getSubpointIS", __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":2393
 *         return iset
 * 
 *     def getSubpointMap(self) -> DMLabel:             # <<<<<<<<<<<<<<
 *         """Return a `DMLabel` with point dimension as values.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_187getSubpointMap(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_186getSubpointMap, "DMPlex.getSubpointMap(self) -> DMLabel\nReturn a `DMLabel` with point dimension as values.\n\n        Not collective.\n\n        Returns\n        -------\n        label : DMLabel\n            The `DMLabel` whose values are subdm's point dimensions.\n\n        See Also\n        --------\n        DM, DMPlex, petsc.DMPlexGetSubpointMap\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:2393");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_187getSubpointMap = {"getSubpointMap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_187getSubpointMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_186getSubpointMap};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_187getSubpointMap(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getSubpointMap (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getSubpointMap", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSubpointMap", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_186getSubpointMap(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_186getSubpointMap(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getSubpointMap", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2408
 * 
 *         """
 *         cdef DMLabel label = DMLabel()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetSubpointMap(self.dm, &label.dmlabel))
 *         PetscINCREF(label.obj)
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 2408, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_label = ((struct PyPetscDMLabelObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2409
 *         """
 *         cdef DMLabel label = DMLabel()
 *         CHKERR(DMPlexGetSubpointMap(self.dm, &label.dmlabel))             # <<<<<<<<<<<<<<
 *         PetscINCREF(label.obj)
 *         return label
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetSubpointMap(__pyx_v_self->__pyx_base.dm, (&__pyx_v_label->dmlabel))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 2409, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2410
 *         cdef DMLabel label = DMLabel()
 *         CHKERR(DMPlexGetSubpointMap(self.dm, &label.dmlabel))
 *         PetscINCREF(label.obj)             # <<<<<<<<<<<<<<
 *         return label
 * 
*/
  (void)(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_label->__pyx_base.obj));

  /* "petsc4py/PETSc/DMPlex.pyx":2411
 *         CHKERR(DMPlexGetSubpointMap(self.dm, &label.dmlabel))
 *         PetscINCREF(label.obj)
 *         return label             # <<<<<<<<<<<<<<
 * 
 *     # Metric
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_label);
  __pyx_r = ((PyObject *)__pyx_v_label);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2393
 *         return iset
 * 
 *     def getSubpointMap(self) -> DMLabel:             # <<<<<<<<<<<<<<
 *         """Return a `DMLabel` with point dimension as values.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getSubpointMap", __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":2415
 *     # Metric
 * 
 *     def metricSetFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the object from the options database.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_189metricSetFromOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_188metricSetFromOptions, "DMPlex.metricSetFromOptions(self) -> None\nConfigure the object from the options database.\n\n        Collective.\n\n        See Also\n        --------\n        petsc_options\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:2415");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_189metricSetFromOptions = {"metricSetFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_189metricSetFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_188metricSetFromOptions};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_189metricSetFromOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricSetFromOptions", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_188metricSetFromOptions(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_188metricSetFromOptions(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2426
 *         """
 *         # FIXME petsc.DMPlexMetricSetFromOptions
 *         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, 2426, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2415
 *     # Metric
 * 
 *     def metricSetFromOptions(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.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":2428
 *         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_191metricSetUniform(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_190metricSetUniform, "DMPlex.metricSetUniform(self, uniform: bool) -> None\nRecord whether the metric is uniform or not.\n\n        Logically collective.\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:2428");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_191metricSetUniform = {"metricSetUniform", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_191metricSetUniform, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_190metricSetUniform};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_191metricSetUniform(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_uniform,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2428, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2428, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricSetUniform", 0) < (0)) __PYX_ERR(57, 2428, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricSetUniform", 1, 1, 1, i); __PYX_ERR(57, 2428, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2428, __pyx_L3_error)
    }
    __pyx_v_uniform = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("metricSetUniform", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2428, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_190metricSetUniform(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_uniform);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_190metricSetUniform(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2444
 * 
 *         """
 *         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, 2444, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2445
 *         """
 *         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, 2445, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2428
 *         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":2447
 *         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_193metricIsUniform(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_192metricIsUniform, "DMPlex.metricIsUniform(self) -> bool\nReturn the flag indicating whether the metric is uniform or not.\n\n        Not collective.\n\n        See Also\n        --------\n        DMPlex.metricSetUniform, DMPlex.metricRestrictAnisotropyFirst\n        petsc.DMPlexMetricIsUniform\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:2447");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_193metricIsUniform = {"metricIsUniform", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_193metricIsUniform, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_192metricIsUniform};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_193metricIsUniform(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricIsUniform", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_192metricIsUniform(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_192metricIsUniform(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2458
 * 
 *         """
 *         cdef PetscBool uniform = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMetricIsUniform(self.dm, &uniform))
 *         return toBool(uniform)
*/
  __pyx_v_uniform = PETSC_FALSE;

  /* "petsc4py/PETSc/DMPlex.pyx":2459
 *         """
 *         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, 2459, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2460
 *         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, 2460, __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(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":2462
 *         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_195metricSetIsotropic(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_194metricSetIsotropic, "DMPlex.metricSetIsotropic(self, isotropic: bool) -> None\nRecord whether the metric is isotropic or not.\n\n        Logically collective.\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:2462");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_195metricSetIsotropic = {"metricSetIsotropic", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_195metricSetIsotropic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_194metricSetIsotropic};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_195metricSetIsotropic(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isotropic,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2462, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2462, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricSetIsotropic", 0) < (0)) __PYX_ERR(57, 2462, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricSetIsotropic", 1, 1, 1, i); __PYX_ERR(57, 2462, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2462, __pyx_L3_error)
    }
    __pyx_v_isotropic = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("metricSetIsotropic", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2462, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_194metricSetIsotropic(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_isotropic);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_194metricSetIsotropic(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2478
 * 
 *         """
 *         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, 2478, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2479
 *         """
 *         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, 2479, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2462
 *         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":2481
 *         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_197metricIsIsotropic(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_196metricIsIsotropic, "DMPlex.metricIsIsotropic(self) -> bool\nReturn the flag indicating whether the metric is isotropic or not.\n\n        Not collective.\n\n        See Also\n        --------\n        DMPlex.metricSetIsotropic, DMPlex.metricIsUniform\n        DMPlex.metricRestrictAnisotropyFirst, petsc.DMPlexMetricIsIsotropic\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:2481");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_197metricIsIsotropic = {"metricIsIsotropic", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_197metricIsIsotropic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_196metricIsIsotropic};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_197metricIsIsotropic(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricIsIsotropic", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_196metricIsIsotropic(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_196metricIsIsotropic(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2492
 * 
 *         """
 *         cdef PetscBool isotropic = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMetricIsIsotropic(self.dm, &isotropic))
 *         return toBool(isotropic)
*/
  __pyx_v_isotropic = PETSC_FALSE;

  /* "petsc4py/PETSc/DMPlex.pyx":2493
 *         """
 *         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, 2493, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2494
 *         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, 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":2481
 *         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":2496
 *         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_199metricSetRestrictAnisotropyFirst(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_198metricSetRestrictAnisotropyFirst, "DMPlex.metricSetRestrictAnisotropyFirst(self, restrictAnisotropyFirst: bool) -> None\nRecord whether anisotropy is be restricted before normalization or after.\n\n        Logically collective.\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:2496");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_199metricSetRestrictAnisotropyFirst = {"metricSetRestrictAnisotropyFirst", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_199metricSetRestrictAnisotropyFirst, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_198metricSetRestrictAnisotropyFirst};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_199metricSetRestrictAnisotropyFirst(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_restrictAnisotropyFirst,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2496, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricSetRestrictAnisotropyFirst", 0) < (0)) __PYX_ERR(57, 2496, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricSetRestrictAnisotropyFirst", 1, 1, 1, i); __PYX_ERR(57, 2496, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2496, __pyx_L3_error)
    }
    __pyx_v_restrictAnisotropyFirst = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("metricSetRestrictAnisotropyFirst", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2496, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_198metricSetRestrictAnisotropyFirst(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_restrictAnisotropyFirst);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_198metricSetRestrictAnisotropyFirst(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2512
 * 
 *         """
 *         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, 2512, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2513
 *         """
 *         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, 2513, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2496
 *         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":2515
 *         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_201metricRestrictAnisotropyFirst(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_200metricRestrictAnisotropyFirst, "DMPlex.metricRestrictAnisotropyFirst(self) -> bool\nReturn ``true`` if anisotropy is restricted before normalization.\n\n        Not collective.\n\n        See Also\n        --------\n        DMPlex.metricIsIsotropic, DMPlex.metricSetRestrictAnisotropyFirst\n        petsc.DMPlexMetricRestrictAnisotropyFirst\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:2515");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_201metricRestrictAnisotropyFirst = {"metricRestrictAnisotropyFirst", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_201metricRestrictAnisotropyFirst, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_200metricRestrictAnisotropyFirst};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_201metricRestrictAnisotropyFirst(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricRestrictAnisotropyFirst", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_200metricRestrictAnisotropyFirst(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_200metricRestrictAnisotropyFirst(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2526
 * 
 *         """
 *         cdef PetscBool restrictAnisotropyFirst = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMetricRestrictAnisotropyFirst(self.dm, &restrictAnisotropyFirst))
 *         return toBool(restrictAnisotropyFirst)
*/
  __pyx_v_restrictAnisotropyFirst = PETSC_FALSE;

  /* "petsc4py/PETSc/DMPlex.pyx":2527
 *         """
 *         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, 2527, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2528
 *         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, 2528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2515
 *         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":2530
 *         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_203metricSetNoInsertion(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_202metricSetNoInsertion, "DMPlex.metricSetNoInsertion(self, noInsert: bool) -> None\nSet the flag indicating whether node insertion should be turned off.\n\n        Logically collective.\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:2530");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_203metricSetNoInsertion = {"metricSetNoInsertion", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_203metricSetNoInsertion, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_202metricSetNoInsertion};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_203metricSetNoInsertion(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_noInsert,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2530, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2530, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricSetNoInsertion", 0) < (0)) __PYX_ERR(57, 2530, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricSetNoInsertion", 1, 1, 1, i); __PYX_ERR(57, 2530, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2530, __pyx_L3_error)
    }
    __pyx_v_noInsert = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("metricSetNoInsertion", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2530, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_202metricSetNoInsertion(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_noInsert);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_202metricSetNoInsertion(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2547
 * 
 *         """
 *         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, 2547, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2548
 *         """
 *         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, 2548, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2530
 *         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":2550
 *         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_205metricNoInsertion(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_204metricNoInsertion, "DMPlex.metricNoInsertion(self) -> bool\nReturn the flag indicating whether node insertion and deletion are turned off.\n\n        Not collective.\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:2550");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_205metricNoInsertion = {"metricNoInsertion", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_205metricNoInsertion, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_204metricNoInsertion};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_205metricNoInsertion(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricNoInsertion", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_204metricNoInsertion(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_204metricNoInsertion(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2562
 * 
 *         """
 *         cdef PetscBool noInsert = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMetricNoInsertion(self.dm, &noInsert))
 *         return toBool(noInsert)
*/
  __pyx_v_noInsert = PETSC_FALSE;

  /* "petsc4py/PETSc/DMPlex.pyx":2563
 *         """
 *         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, 2563, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2564
 *         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, 2564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2550
 *         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":2566
 *         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_207metricSetNoSwapping(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_206metricSetNoSwapping, "DMPlex.metricSetNoSwapping(self, noSwap: bool) -> None\nSet the flag indicating whether facet swapping should be turned off.\n\n        Logically collective.\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:2566");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_207metricSetNoSwapping = {"metricSetNoSwapping", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_207metricSetNoSwapping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_206metricSetNoSwapping};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_207metricSetNoSwapping(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_noSwap,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2566, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2566, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricSetNoSwapping", 0) < (0)) __PYX_ERR(57, 2566, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricSetNoSwapping", 1, 1, 1, i); __PYX_ERR(57, 2566, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2566, __pyx_L3_error)
    }
    __pyx_v_noSwap = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("metricSetNoSwapping", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2566, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_206metricSetNoSwapping(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_noSwap);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_206metricSetNoSwapping(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2583
 * 
 *         """
 *         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, 2583, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2584
 *         """
 *         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, 2584, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2566
 *         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":2586
 *         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_209metricNoSwapping(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_208metricNoSwapping, "DMPlex.metricNoSwapping(self) -> bool\nReturn the flag indicating whether facet swapping is turned off.\n\n        Not collective.\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:2586");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_209metricNoSwapping = {"metricNoSwapping", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_209metricNoSwapping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_208metricNoSwapping};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_209metricNoSwapping(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricNoSwapping", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_208metricNoSwapping(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_208metricNoSwapping(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2598
 * 
 *         """
 *         cdef PetscBool noSwap = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMetricNoSwapping(self.dm, &noSwap))
 *         return toBool(noSwap)
*/
  __pyx_v_noSwap = PETSC_FALSE;

  /* "petsc4py/PETSc/DMPlex.pyx":2599
 *         """
 *         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, 2599, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2600
 *         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, 2600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2586
 *         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":2602
 *         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_211metricSetNoMovement(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_210metricSetNoMovement, "DMPlex.metricSetNoMovement(self, noMove: bool) -> None\nSet the flag indicating whether node movement should be turned off.\n\n        Logically collective.\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:2602");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_211metricSetNoMovement = {"metricSetNoMovement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_211metricSetNoMovement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_210metricSetNoMovement};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_211metricSetNoMovement(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_noMove,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2602, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2602, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricSetNoMovement", 0) < (0)) __PYX_ERR(57, 2602, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricSetNoMovement", 1, 1, 1, i); __PYX_ERR(57, 2602, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2602, __pyx_L3_error)
    }
    __pyx_v_noMove = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("metricSetNoMovement", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2602, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_210metricSetNoMovement(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_noMove);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_210metricSetNoMovement(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2619
 * 
 *         """
 *         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, 2619, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2620
 *         """
 *         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, 2620, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2602
 *         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":2622
 *         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_213metricNoMovement(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_212metricNoMovement, "DMPlex.metricNoMovement(self) -> bool\nReturn the flag indicating whether node movement is turned off.\n\n        Not collective.\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:2622");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_213metricNoMovement = {"metricNoMovement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_213metricNoMovement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_212metricNoMovement};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_213metricNoMovement(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricNoMovement", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_212metricNoMovement(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_212metricNoMovement(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2634
 * 
 *         """
 *         cdef PetscBool noMove = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMetricNoMovement(self.dm, &noMove))
 *         return toBool(noMove)
*/
  __pyx_v_noMove = PETSC_FALSE;

  /* "petsc4py/PETSc/DMPlex.pyx":2635
 *         """
 *         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, 2635, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2636
 *         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, 2636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2622
 *         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":2638
 *         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_215metricSetNoSurf(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_214metricSetNoSurf, "DMPlex.metricSetNoSurf(self, noSurf: bool) -> None\nSet the flag indicating whether surface modification should be turned off.\n\n        Logically collective.\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:2638");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_215metricSetNoSurf = {"metricSetNoSurf", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_215metricSetNoSurf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_214metricSetNoSurf};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_215metricSetNoSurf(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_noSurf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2638, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2638, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricSetNoSurf", 0) < (0)) __PYX_ERR(57, 2638, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricSetNoSurf", 1, 1, 1, i); __PYX_ERR(57, 2638, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2638, __pyx_L3_error)
    }
    __pyx_v_noSurf = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("metricSetNoSurf", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2638, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_214metricSetNoSurf(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_noSurf);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_214metricSetNoSurf(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2655
 * 
 *         """
 *         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, 2655, __pyx_L1_error)
  __pyx_v_bval = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2656
 *         """
 *         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, 2656, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2638
 *         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":2658
 *         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_217metricNoSurf(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_216metricNoSurf, "DMPlex.metricNoSurf(self) -> bool\nReturn the flag indicating whether surface modification is turned off.\n\n        Not collective.\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:2658");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_217metricNoSurf = {"metricNoSurf", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_217metricNoSurf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_216metricNoSurf};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_217metricNoSurf(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricNoSurf", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_216metricNoSurf(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_216metricNoSurf(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2670
 * 
 *         """
 *         cdef PetscBool noSurf = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMetricNoSurf(self.dm, &noSurf))
 *         return toBool(noSurf)
*/
  __pyx_v_noSurf = PETSC_FALSE;

  /* "petsc4py/PETSc/DMPlex.pyx":2671
 *         """
 *         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, 2671, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2672
 *         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, 2672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2658
 *         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":2674
 *         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_219metricSetVerbosity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_218metricSetVerbosity, "DMPlex.metricSetVerbosity(self, verbosity: int) -> None\nSet the verbosity of the mesh adaptation package.\n\n        Logically collective.\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:2674");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_219metricSetVerbosity = {"metricSetVerbosity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_219metricSetVerbosity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_218metricSetVerbosity};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_219metricSetVerbosity(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_verbosity,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2674, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2674, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricSetVerbosity", 0) < (0)) __PYX_ERR(57, 2674, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricSetVerbosity", 1, 1, 1, i); __PYX_ERR(57, 2674, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2674, __pyx_L3_error)
    }
    __pyx_v_verbosity = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("metricSetVerbosity", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2674, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_218metricSetVerbosity(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_verbosity);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_218metricSetVerbosity(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2690
 * 
 *         """
 *         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, 2690, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2691
 *         """
 *         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, 2691, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2674
 *         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":2693
 *         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_221metricGetVerbosity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_220metricGetVerbosity, "DMPlex.metricGetVerbosity(self) -> int\nReturn the verbosity of the mesh adaptation package.\n\n        Not collective.\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:2693");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_221metricGetVerbosity = {"metricGetVerbosity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_221metricGetVerbosity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_220metricGetVerbosity};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_221metricGetVerbosity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricGetVerbosity", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_220metricGetVerbosity(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_220metricGetVerbosity(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2709
 * 
 *         """
 *         cdef PetscInt verbosity = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMetricGetVerbosity(self.dm, &verbosity))
 *         return toInt(verbosity)
*/
  __pyx_v_verbosity = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2710
 *         """
 *         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, 2710, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2711
 *         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, 2711, __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(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":2713
 *         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_223metricSetNumIterations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_222metricSetNumIterations, "DMPlex.metricSetNumIterations(self, numIter: int) -> None\nSet the number of parallel adaptation iterations.\n\n        Logically collective.\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:2713");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_223metricSetNumIterations = {"metricSetNumIterations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_223metricSetNumIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_222metricSetNumIterations};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_223metricSetNumIterations(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_numIter,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2713, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2713, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricSetNumIterations", 0) < (0)) __PYX_ERR(57, 2713, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricSetNumIterations", 1, 1, 1, i); __PYX_ERR(57, 2713, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2713, __pyx_L3_error)
    }
    __pyx_v_numIter = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("metricSetNumIterations", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2713, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_222metricSetNumIterations(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_numIter);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_222metricSetNumIterations(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2729
 * 
 *         """
 *         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, 2729, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2730
 *         """
 *         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, 2730, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2713
 *         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":2732
 *         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_225metricGetNumIterations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_224metricGetNumIterations, "DMPlex.metricGetNumIterations(self) -> int\nReturn the number of parallel adaptation iterations.\n\n        Not collective.\n\n        See Also\n        --------\n        DMPlex.metricSetNumIterations, DMPlex.metricGetVerbosity\n        petsc.DMPlexMetricGetNumIterations\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:2732");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_225metricGetNumIterations = {"metricGetNumIterations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_225metricGetNumIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_224metricGetNumIterations};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_225metricGetNumIterations(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricGetNumIterations", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_224metricGetNumIterations(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_224metricGetNumIterations(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2743
 * 
 *         """
 *         cdef PetscInt numIter = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMetricGetNumIterations(self.dm, &numIter))
 *         return toInt(numIter)
*/
  __pyx_v_numIter = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2744
 *         """
 *         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, 2744, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2745
 *         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, 2745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2732
 *         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":2747
 *         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_227metricSetMinimumMagnitude(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_226metricSetMinimumMagnitude, "DMPlex.metricSetMinimumMagnitude(self, h_min: float) -> None\nSet the minimum tolerated metric magnitude.\n\n        Logically collective.\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:2747");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_227metricSetMinimumMagnitude = {"metricSetMinimumMagnitude", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_227metricSetMinimumMagnitude, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_226metricSetMinimumMagnitude};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_227metricSetMinimumMagnitude(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_h_min,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2747, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2747, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricSetMinimumMagnitude", 0) < (0)) __PYX_ERR(57, 2747, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricSetMinimumMagnitude", 1, 1, 1, i); __PYX_ERR(57, 2747, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2747, __pyx_L3_error)
    }
    __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, 2747, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_226metricSetMinimumMagnitude(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_h_min);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_226metricSetMinimumMagnitude(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2763
 * 
 *         """
 *         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, 2763, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2764
 *         """
 *         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, 2764, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2747
 *         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":2766
 *         CHKERR(DMPlexMetricSetMinimumMagnitude(self.dm, rval))
 * 
 *     def metricGetMinimumMagnitude(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the minimum tolerated metric magnitude.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_229metricGetMinimumMagnitude(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_228metricGetMinimumMagnitude, "DMPlex.metricGetMinimumMagnitude(self) -> float\nReturn the minimum tolerated metric magnitude.\n\n        Not collective.\n\n        See Also\n        --------\n        DMPlex.metricSetMinimumMagnitude, DMPlex.metricGetMaximumMagnitude\n        petsc.DMPlexMetricGetMinimumMagnitude\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:2766");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_229metricGetMinimumMagnitude = {"metricGetMinimumMagnitude", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_229metricGetMinimumMagnitude, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_228metricGetMinimumMagnitude};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_229metricGetMinimumMagnitude(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricGetMinimumMagnitude", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_228metricGetMinimumMagnitude(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_228metricGetMinimumMagnitude(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2777
 * 
 *         """
 *         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":2778
 *         """
 *         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, 2778, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2779
 *         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, 2779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2766
 *         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":2781
 *         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_231metricSetMaximumMagnitude(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_230metricSetMaximumMagnitude, "DMPlex.metricSetMaximumMagnitude(self, h_max: float) -> None\nSet the maximum tolerated metric magnitude.\n\n        Logically collective.\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:2781");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_231metricSetMaximumMagnitude = {"metricSetMaximumMagnitude", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_231metricSetMaximumMagnitude, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_230metricSetMaximumMagnitude};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_231metricSetMaximumMagnitude(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_h_max,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2781, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2781, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricSetMaximumMagnitude", 0) < (0)) __PYX_ERR(57, 2781, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricSetMaximumMagnitude", 1, 1, 1, i); __PYX_ERR(57, 2781, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2781, __pyx_L3_error)
    }
    __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, 2781, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_230metricSetMaximumMagnitude(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_h_max);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_230metricSetMaximumMagnitude(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2797
 * 
 *         """
 *         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, 2797, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2798
 *         """
 *         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, 2798, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2781
 *         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":2800
 *         CHKERR(DMPlexMetricSetMaximumMagnitude(self.dm, rval))
 * 
 *     def metricGetMaximumMagnitude(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the maximum tolerated metric magnitude.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_233metricGetMaximumMagnitude(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_232metricGetMaximumMagnitude, "DMPlex.metricGetMaximumMagnitude(self) -> float\nReturn the maximum tolerated metric magnitude.\n\n        Not collective.\n\n        See Also\n        --------\n        DMPlex.metricSetMaximumMagnitude, DMPlex.metricGetMinimumMagnitude\n        petsc.DMPlexMetricGetMaximumMagnitude\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:2800");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_233metricGetMaximumMagnitude = {"metricGetMaximumMagnitude", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_233metricGetMaximumMagnitude, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_232metricGetMaximumMagnitude};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_233metricGetMaximumMagnitude(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricGetMaximumMagnitude", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_232metricGetMaximumMagnitude(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_232metricGetMaximumMagnitude(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2811
 * 
 *         """
 *         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":2812
 *         """
 *         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, 2812, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2813
 *         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, 2813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2800
 *         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":2815
 *         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_235metricSetMaximumAnisotropy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_234metricSetMaximumAnisotropy, "DMPlex.metricSetMaximumAnisotropy(self, a_max: float) -> None\nSet the maximum tolerated metric anisotropy.\n\n        Logically collective.\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:2815");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_235metricSetMaximumAnisotropy = {"metricSetMaximumAnisotropy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_235metricSetMaximumAnisotropy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_234metricSetMaximumAnisotropy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_235metricSetMaximumAnisotropy(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_a_max,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2815, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2815, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricSetMaximumAnisotropy", 0) < (0)) __PYX_ERR(57, 2815, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricSetMaximumAnisotropy", 1, 1, 1, i); __PYX_ERR(57, 2815, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2815, __pyx_L3_error)
    }
    __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, 2815, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_234metricSetMaximumAnisotropy(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_a_max);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_234metricSetMaximumAnisotropy(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2831
 * 
 *         """
 *         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, 2831, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2832
 *         """
 *         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, 2832, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2815
 *         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":2834
 *         CHKERR(DMPlexMetricSetMaximumAnisotropy(self.dm, rval))
 * 
 *     def metricGetMaximumAnisotropy(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the maximum tolerated metric anisotropy.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_237metricGetMaximumAnisotropy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_236metricGetMaximumAnisotropy, "DMPlex.metricGetMaximumAnisotropy(self) -> float\nReturn the maximum tolerated metric anisotropy.\n\n        Not collective.\n\n        See Also\n        --------\n        DMPlex.metricSetMaximumAnisotropy, DMPlex.metricGetMaximumMagnitude\n        petsc.DMPlexMetricGetMaximumAnisotropy\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:2834");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_237metricGetMaximumAnisotropy = {"metricGetMaximumAnisotropy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_237metricGetMaximumAnisotropy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_236metricGetMaximumAnisotropy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_237metricGetMaximumAnisotropy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricGetMaximumAnisotropy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_236metricGetMaximumAnisotropy(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_236metricGetMaximumAnisotropy(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2845
 * 
 *         """
 *         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":2846
 *         """
 *         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, 2846, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2847
 *         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, 2847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2834
 *         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":2849
 *         return toReal(a_max)
 * 
 *     def metricSetTargetComplexity(self, targetComplexity: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the target metric complexity.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_239metricSetTargetComplexity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_238metricSetTargetComplexity, "DMPlex.metricSetTargetComplexity(self, targetComplexity: float) -> None\nSet the target metric complexity.\n\n        Logically collective.\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:2849");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_239metricSetTargetComplexity = {"metricSetTargetComplexity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_239metricSetTargetComplexity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_238metricSetTargetComplexity};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_239metricSetTargetComplexity(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_targetComplexity,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2849, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2849, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricSetTargetComplexity", 0) < (0)) __PYX_ERR(57, 2849, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricSetTargetComplexity", 1, 1, 1, i); __PYX_ERR(57, 2849, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2849, __pyx_L3_error)
    }
    __pyx_v_targetComplexity = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("metricSetTargetComplexity", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2849, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_238metricSetTargetComplexity(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_targetComplexity);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_238metricSetTargetComplexity(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2865
 * 
 *         """
 *         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, 2865, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2866
 *         """
 *         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, 2866, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2849
 *         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":2868
 *         CHKERR(DMPlexMetricSetTargetComplexity(self.dm, rval))
 * 
 *     def metricGetTargetComplexity(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the target metric complexity.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_241metricGetTargetComplexity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_240metricGetTargetComplexity, "DMPlex.metricGetTargetComplexity(self) -> float\nReturn the target metric complexity.\n\n        Not collective.\n\n        See Also\n        --------\n        DMPlex.metricSetTargetComplexity, DMPlex.metricGetNormalizationOrder\n        petsc.DMPlexMetricGetTargetComplexity\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:2868");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_241metricGetTargetComplexity = {"metricGetTargetComplexity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_241metricGetTargetComplexity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_240metricGetTargetComplexity};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_241metricGetTargetComplexity(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricGetTargetComplexity", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_240metricGetTargetComplexity(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_240metricGetTargetComplexity(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2879
 * 
 *         """
 *         cdef PetscReal targetComplexity = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMetricGetTargetComplexity(self.dm, &targetComplexity))
 *         return toReal(targetComplexity)
*/
  __pyx_v_targetComplexity = 0.0;

  /* "petsc4py/PETSc/DMPlex.pyx":2880
 *         """
 *         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, 2880, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2881
 *         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, 2881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2868
 *         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":2883
 *         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_243metricSetNormalizationOrder(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_242metricSetNormalizationOrder, "DMPlex.metricSetNormalizationOrder(self, p: float) -> None\nSet the order p for L-p normalization.\n\n        Logically collective.\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:2883");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_243metricSetNormalizationOrder = {"metricSetNormalizationOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_243metricSetNormalizationOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_242metricSetNormalizationOrder};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_243metricSetNormalizationOrder(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_p,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2883, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2883, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricSetNormalizationOrder", 0) < (0)) __PYX_ERR(57, 2883, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricSetNormalizationOrder", 1, 1, 1, i); __PYX_ERR(57, 2883, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2883, __pyx_L3_error)
    }
    __pyx_v_p = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("metricSetNormalizationOrder", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2883, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_242metricSetNormalizationOrder(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_p);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_242metricSetNormalizationOrder(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2899
 * 
 *         """
 *         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, 2899, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2900
 *         """
 *         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, 2900, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2883
 *         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":2902
 *         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_245metricGetNormalizationOrder(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_244metricGetNormalizationOrder, "DMPlex.metricGetNormalizationOrder(self) -> float\nReturn the order p for L-p normalization.\n\n        Not collective.\n\n        See Also\n        --------\n        DMPlex.metricSetNormalizationOrder, DMPlex.metricGetTargetComplexity\n        petsc.DMPlexMetricGetNormalizationOrder\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:2902");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_245metricGetNormalizationOrder = {"metricGetNormalizationOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_245metricGetNormalizationOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_244metricGetNormalizationOrder};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_245metricGetNormalizationOrder(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricGetNormalizationOrder", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_244metricGetNormalizationOrder(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_244metricGetNormalizationOrder(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2913
 * 
 *         """
 *         cdef PetscReal p = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMetricGetNormalizationOrder(self.dm, &p))
 *         return toReal(p)
*/
  __pyx_v_p = 0.0;

  /* "petsc4py/PETSc/DMPlex.pyx":2914
 *         """
 *         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, 2914, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2915
 *         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, 2915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2902
 *         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":2917
 *         return toReal(p)
 * 
 *     def metricSetGradationFactor(self, beta: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the metric gradation factor.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_247metricSetGradationFactor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_246metricSetGradationFactor, "DMPlex.metricSetGradationFactor(self, beta: float) -> None\nSet the metric gradation factor.\n\n        Logically collective.\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:2917");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_247metricSetGradationFactor = {"metricSetGradationFactor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_247metricSetGradationFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_246metricSetGradationFactor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_247metricSetGradationFactor(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_beta,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2917, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2917, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricSetGradationFactor", 0) < (0)) __PYX_ERR(57, 2917, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricSetGradationFactor", 1, 1, 1, i); __PYX_ERR(57, 2917, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2917, __pyx_L3_error)
    }
    __pyx_v_beta = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("metricSetGradationFactor", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2917, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_246metricSetGradationFactor(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_beta);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_246metricSetGradationFactor(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2933
 * 
 *         """
 *         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, 2933, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2934
 *         """
 *         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, 2934, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2917
 *         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":2936
 *         CHKERR(DMPlexMetricSetGradationFactor(self.dm, rval))
 * 
 *     def metricGetGradationFactor(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the metric gradation factor.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_249metricGetGradationFactor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_248metricGetGradationFactor, "DMPlex.metricGetGradationFactor(self) -> float\nReturn the metric gradation factor.\n\n        Not collective.\n\n        See Also\n        --------\n        DMPlex.metricSetGradationFactor, DMPlex.metricGetHausdorffNumber\n        petsc.DMPlexMetricGetGradationFactor\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:2936");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_249metricGetGradationFactor = {"metricGetGradationFactor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_249metricGetGradationFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_248metricGetGradationFactor};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_249metricGetGradationFactor(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricGetGradationFactor", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_248metricGetGradationFactor(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_248metricGetGradationFactor(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2947
 * 
 *         """
 *         cdef PetscReal beta = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMetricGetGradationFactor(self.dm, &beta))
 *         return toReal(beta)
*/
  __pyx_v_beta = 0.0;

  /* "petsc4py/PETSc/DMPlex.pyx":2948
 *         """
 *         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, 2948, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2949
 *         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, 2949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2936
 *         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":2951
 *         return toReal(beta)
 * 
 *     def metricSetHausdorffNumber(self, hausd: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the metric Hausdorff number.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_251metricSetHausdorffNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_250metricSetHausdorffNumber, "DMPlex.metricSetHausdorffNumber(self, hausd: float) -> None\nSet the metric Hausdorff number.\n\n        Logically collective.\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:2951");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_251metricSetHausdorffNumber = {"metricSetHausdorffNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_251metricSetHausdorffNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_250metricSetHausdorffNumber};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_251metricSetHausdorffNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_hausd,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2951, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2951, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricSetHausdorffNumber", 0) < (0)) __PYX_ERR(57, 2951, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricSetHausdorffNumber", 1, 1, 1, i); __PYX_ERR(57, 2951, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2951, __pyx_L3_error)
    }
    __pyx_v_hausd = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("metricSetHausdorffNumber", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 2951, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_250metricSetHausdorffNumber(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_hausd);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_250metricSetHausdorffNumber(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2967
 * 
 *         """
 *         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, 2967, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":2968
 *         """
 *         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, 2968, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2951
 *         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":2970
 *         CHKERR(DMPlexMetricSetHausdorffNumber(self.dm, rval))
 * 
 *     def metricGetHausdorffNumber(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the metric Hausdorff number.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_253metricGetHausdorffNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_252metricGetHausdorffNumber, "DMPlex.metricGetHausdorffNumber(self) -> float\nReturn the metric Hausdorff number.\n\n        Not collective.\n\n        See Also\n        --------\n        DMPlex.metricGetGradationFactor, DMPlex.metricSetHausdorffNumber\n        petsc.DMPlexMetricGetHausdorffNumber\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:2970");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_253metricGetHausdorffNumber = {"metricGetHausdorffNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_253metricGetHausdorffNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_252metricGetHausdorffNumber};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_253metricGetHausdorffNumber(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("metricGetHausdorffNumber", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_252metricGetHausdorffNumber(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_252metricGetHausdorffNumber(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":2981
 * 
 *         """
 *         cdef PetscReal hausd = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMetricGetHausdorffNumber(self.dm, &hausd))
 *         return toReal(hausd)
*/
  __pyx_v_hausd = 0.0;

  /* "petsc4py/PETSc/DMPlex.pyx":2982
 *         """
 *         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, 2982, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":2983
 *         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, 2983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":2970
 *         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":2985
 *         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_255metricCreate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_254metricCreate, "DMPlex.metricCreate(self, field: int | None = 0) -> Vec\nCreate a Riemannian metric field.\n\n        Collective.\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:2985");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_255metricCreate = {"metricCreate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_255metricCreate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_254metricCreate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_255metricCreate(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 2985, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2985, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricCreate", 0) < (0)) __PYX_ERR(57, 2985, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 2985, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __pyx_v_field = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("metricCreate", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 2985, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_254metricCreate(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_field);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_254metricCreate(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("metricCreate", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3001
 * 
 *         """
 *         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, 3001, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":3002
 *         """
 *         cdef PetscInt ival = asInt(field)
 *         cdef Vec metric = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMetricCreate(self.dm, ival, &metric.vec))
 *         return metric
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 3002, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_metric = ((struct PyPetscVecObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3003
 *         cdef PetscInt ival = asInt(field)
 *         cdef Vec metric = Vec()
 *         CHKERR(DMPlexMetricCreate(self.dm, ival, &metric.vec))             # <<<<<<<<<<<<<<
 *         return metric
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMetricCreate(__pyx_v_self->__pyx_base.dm, __pyx_v_ival, (&__pyx_v_metric->vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3003, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3004
 *         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":2985
 *         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_XDECREF(__pyx_t_3);
  __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":3006
 *         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_257metricCreateUniform(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_256metricCreateUniform, "DMPlex.metricCreateUniform(self, alpha: float, field: int | None = 0) -> Vec\nConstruct a uniform isotropic metric.\n\n        Collective.\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:3006");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_257metricCreateUniform = {"metricCreateUniform", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_257metricCreateUniform, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_256metricCreateUniform};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_257metricCreateUniform(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_alpha,&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3006, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricCreateUniform", 0) < (0)) __PYX_ERR(57, 3006, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricCreateUniform", 0, 1, 2, i); __PYX_ERR(57, 3006, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3006, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3006, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __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, 3006, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_256metricCreateUniform(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_alpha, __pyx_v_field);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_256metricCreateUniform(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("metricCreateUniform", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3024
 * 
 *         """
 *         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, 3024, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":3025
 *         """
 *         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, 3025, __pyx_L1_error)
  __pyx_v_rval = __pyx_t_2;

  /* "petsc4py/PETSc/DMPlex.pyx":3026
 *         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_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 3026, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_3);
  }
  __pyx_v_metric = ((struct PyPetscVecObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3027
 *         cdef PetscReal rval = asReal(alpha)
 *         cdef Vec metric = Vec()
 *         CHKERR(DMPlexMetricCreateUniform(self.dm, ival, rval, &metric.vec))             # <<<<<<<<<<<<<<
 *         return metric
 * 
*/
  __pyx_t_6 = __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_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3027, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3028
 *         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":3006
 *         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_XDECREF(__pyx_t_4);
  __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":3030
 *         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_259metricCreateIsotropic(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_258metricCreateIsotropic, "DMPlex.metricCreateIsotropic(self, indicator: Vec, field: int | None = 0) -> Vec\nConstruct an isotropic metric from an error indicator.\n\n        Collective.\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:3030");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_259metricCreateIsotropic = {"metricCreateIsotropic", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_259metricCreateIsotropic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_258metricCreateIsotropic};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_259metricCreateIsotropic(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_indicator,&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3030, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3030, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3030, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricCreateIsotropic", 0) < (0)) __PYX_ERR(57, 3030, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricCreateIsotropic", 0, 1, 2, i); __PYX_ERR(57, 3030, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3030, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3030, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __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, 3030, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "indicator", 0))) __PYX_ERR(57, 3030, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_258metricCreateIsotropic(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_258metricCreateIsotropic(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("metricCreateIsotropic", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3048
 * 
 *         """
 *         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, 3048, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":3049
 *         """
 *         cdef PetscInt  ival = asInt(field)
 *         cdef Vec metric = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMetricCreateIsotropic(self.dm, ival, indicator.vec, &metric.vec))
 *         return metric
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 3049, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_metric = ((struct PyPetscVecObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3050
 *         cdef PetscInt  ival = asInt(field)
 *         cdef Vec metric = Vec()
 *         CHKERR(DMPlexMetricCreateIsotropic(self.dm, ival, indicator.vec, &metric.vec))             # <<<<<<<<<<<<<<
 *         return metric
 * 
*/
  __pyx_t_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3050, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3051
 *         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":3030
 *         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_XDECREF(__pyx_t_3);
  __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":3053
 *         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_261metricDeterminantCreate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_260metricDeterminantCreate, "DMPlex.metricDeterminantCreate(self, field: int | None = 0) -> tuple[Vec, DM]\nCreate the determinant field for a Riemannian metric.\n\n        Collective.\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:3053");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_261metricDeterminantCreate = {"metricDeterminantCreate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_261metricDeterminantCreate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_260metricDeterminantCreate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_261metricDeterminantCreate(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_field,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3053, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3053, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricDeterminantCreate", 0) < (0)) __PYX_ERR(57, 3053, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3053, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
    }
    __pyx_v_field = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("metricDeterminantCreate", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 3053, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_260metricDeterminantCreate(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_field);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_260metricDeterminantCreate(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("metricDeterminantCreate", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3076
 * 
 *         """
 *         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, 3076, __pyx_L1_error)
  __pyx_v_ival = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":3077
 *         """
 *         cdef PetscInt  ival = asInt(field)
 *         cdef Vec determinant = Vec()             # <<<<<<<<<<<<<<
 *         cdef DM dmDet = DM()
 *         CHKERR(DMPlexMetricDeterminantCreate(self.dm, ival, &determinant.vec, &dmDet.dm))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 3077, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_determinant = ((struct PyPetscVecObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3078
 *         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_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 3078, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_dmDet = ((struct PyPetscDMObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3079
 *         cdef Vec determinant = Vec()
 *         cdef DM dmDet = DM()
 *         CHKERR(DMPlexMetricDeterminantCreate(self.dm, ival, &determinant.vec, &dmDet.dm))             # <<<<<<<<<<<<<<
 *         return (determinant, dmDet)
 * 
*/
  __pyx_t_5 = __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_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3079, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3080
 *         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, 3080, __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)) != (0)) __PYX_ERR(57, 3080, __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)) != (0)) __PYX_ERR(57, 3080, __pyx_L1_error);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":3053
 *         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_XDECREF(__pyx_t_3);
  __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":3082
 *         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_263metricEnforceSPD(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_262metricEnforceSPD, "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        Collective.\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:3082");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_263metricEnforceSPD = {"metricEnforceSPD", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_263metricEnforceSPD, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_262metricEnforceSPD};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_263metricEnforceSPD(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_metric,&__pyx_mstate_global->__pyx_n_u_ometric,&__pyx_mstate_global->__pyx_n_u_determinant,&__pyx_mstate_global->__pyx_n_u_restrictSizes,&__pyx_mstate_global->__pyx_n_u_restrictAnisotropy,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3082, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 3082, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 3082, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3082, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3082, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3082, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricEnforceSPD", 0) < (0)) __PYX_ERR(57, 3082, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricEnforceSPD", 0, 3, 5, i); __PYX_ERR(57, 3082, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 3082, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 3082, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3082, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3082, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3082, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_False));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __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, 3082, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric", 0))) __PYX_ERR(57, 3082, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ometric), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "ometric", 0))) __PYX_ERR(57, 3082, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_determinant), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "determinant", 0))) __PYX_ERR(57, 3082, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_262metricEnforceSPD(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_262metricEnforceSPD(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("metricEnforceSPD", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3113
 * 
 *         """
 *         cdef PetscBool bval_rs = asBool(restrictSizes)             # <<<<<<<<<<<<<<
 *         cdef PetscBool bval_ra = asBool(restrictAnisotropy)
 *         CHKERR(DMPlexMetricEnforceSPD(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, 3113, __pyx_L1_error)
  __pyx_v_bval_rs = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":3114
 *         """
 *         cdef PetscBool bval_rs = asBool(restrictSizes)
 *         cdef PetscBool bval_ra = asBool(restrictAnisotropy)             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMetricEnforceSPD(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, 3114, __pyx_L1_error)
  __pyx_v_bval_ra = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":3115
 *         cdef PetscBool bval_rs = asBool(restrictSizes)
 *         cdef PetscBool bval_ra = asBool(restrictAnisotropy)
 *         CHKERR(DMPlexMetricEnforceSPD(self.dm, metric.vec, bval_rs, bval_ra, ometric.vec, determinant.vec))             # <<<<<<<<<<<<<<
 *         return (ometric, determinant)
 * 
*/
  __pyx_t_2 = __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_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3115, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3116
 *         cdef PetscBool bval_ra = asBool(restrictAnisotropy)
 *         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_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(57, 3116, __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)) != (0)) __PYX_ERR(57, 3116, __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)) != (0)) __PYX_ERR(57, 3116, __pyx_L1_error);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":3082
 *         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_3);
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.metricEnforceSPD", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMPlex.pyx":3118
 *         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_265metricNormalize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_264metricNormalize, "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        Collective.\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:3118");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_265metricNormalize = {"metricNormalize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_265metricNormalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_264metricNormalize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_265metricNormalize(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_metric,&__pyx_mstate_global->__pyx_n_u_ometric,&__pyx_mstate_global->__pyx_n_u_determinant,&__pyx_mstate_global->__pyx_n_u_restrictSizes,&__pyx_mstate_global->__pyx_n_u_restrictAnisotropy,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3118, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 3118, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 3118, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3118, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3118, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3118, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricNormalize", 0) < (0)) __PYX_ERR(57, 3118, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_True));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricNormalize", 0, 3, 5, i); __PYX_ERR(57, 3118, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(57, 3118, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 3118, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3118, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3118, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3118, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_True));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_True));
    }
    __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, 3118, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric", 0))) __PYX_ERR(57, 3118, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ometric), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "ometric", 0))) __PYX_ERR(57, 3118, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_determinant), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "determinant", 0))) __PYX_ERR(57, 3118, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_264metricNormalize(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_264metricNormalize(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3149
 * 
 *         """
 *         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, 3149, __pyx_L1_error)
  __pyx_v_bval_rs = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":3150
 *         """
 *         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, 3150, __pyx_L1_error)
  __pyx_v_bval_ra = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":3151
 *         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, 3151, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3152
 *         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, 3152, __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)) != (0)) __PYX_ERR(57, 3152, __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)) != (0)) __PYX_ERR(57, 3152, __pyx_L1_error);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":3118
 *         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":3154
 *         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_267metricAverage2(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_266metricAverage2, "DMPlex.metricAverage2(self, metric1: Vec, metric2: Vec, metricAvg: Vec) -> Vec\nCompute and return the unweighted average of two metrics.\n\n        Collective.\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:3154");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_267metricAverage2 = {"metricAverage2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_267metricAverage2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_266metricAverage2};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_267metricAverage2(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_metric1,&__pyx_mstate_global->__pyx_n_u_metric2,&__pyx_mstate_global->__pyx_n_u_metricAvg,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3154, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3154, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3154, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3154, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricAverage2", 0) < (0)) __PYX_ERR(57, 3154, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricAverage2", 1, 3, 3, i); __PYX_ERR(57, 3154, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3154, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3154, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3154, __pyx_L3_error)
    }
    __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, 3154, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric1", 0))) __PYX_ERR(57, 3154, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric2), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric2", 0))) __PYX_ERR(57, 3154, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metricAvg), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metricAvg", 0))) __PYX_ERR(57, 3154, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_266metricAverage2(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_266metricAverage2(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3173
 * 
 *         """
 *         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, 3173, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3174
 *         """
 *         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":3154
 *         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":3176
 *         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_269metricAverage3(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_268metricAverage3, "DMPlex.metricAverage3(self, metric1: Vec, metric2: Vec, metric3: Vec, metricAvg: Vec) -> Vec\nCompute and return the unweighted average of three metrics.\n\n        Collective.\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:3176");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_269metricAverage3 = {"metricAverage3", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_269metricAverage3, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_268metricAverage3};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_269metricAverage3(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_metric1,&__pyx_mstate_global->__pyx_n_u_metric2,&__pyx_mstate_global->__pyx_n_u_metric3,&__pyx_mstate_global->__pyx_n_u_metricAvg,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3176, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 3176, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3176, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3176, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3176, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricAverage3", 0) < (0)) __PYX_ERR(57, 3176, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricAverage3", 1, 4, 4, i); __PYX_ERR(57, 3176, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3176, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3176, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3176, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 3176, __pyx_L3_error)
    }
    __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, 3176, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric1", 0))) __PYX_ERR(57, 3176, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric2), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric2", 0))) __PYX_ERR(57, 3176, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric3), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric3", 0))) __PYX_ERR(57, 3176, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metricAvg), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metricAvg", 0))) __PYX_ERR(57, 3176, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_268metricAverage3(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_268metricAverage3(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3197
 * 
 *         """
 *         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, 3197, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3198
 *         """
 *         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":3176
 *         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":3200
 *         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_271metricIntersection2(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_270metricIntersection2, "DMPlex.metricIntersection2(self, metric1: Vec, metric2: Vec, metricInt: Vec) -> Vec\nCompute and return the intersection of two metrics.\n\n        Collective.\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:3200");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_271metricIntersection2 = {"metricIntersection2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_271metricIntersection2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_270metricIntersection2};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_271metricIntersection2(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_metric1,&__pyx_mstate_global->__pyx_n_u_metric2,&__pyx_mstate_global->__pyx_n_u_metricInt,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3200, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3200, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3200, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3200, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricIntersection2", 0) < (0)) __PYX_ERR(57, 3200, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricIntersection2", 1, 3, 3, i); __PYX_ERR(57, 3200, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3200, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3200, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3200, __pyx_L3_error)
    }
    __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, 3200, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric1", 0))) __PYX_ERR(57, 3200, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric2), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric2", 0))) __PYX_ERR(57, 3200, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metricInt), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metricInt", 0))) __PYX_ERR(57, 3200, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_270metricIntersection2(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_270metricIntersection2(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3219
 * 
 *         """
 *         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, 3219, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3220
 *         """
 *         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":3200
 *         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":3222
 *         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_273metricIntersection3(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_272metricIntersection3, "DMPlex.metricIntersection3(self, metric1: Vec, metric2: Vec, metric3: Vec, metricInt: Vec) -> Vec\nCompute the intersection of three metrics.\n\n        Collective.\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:3222");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_273metricIntersection3 = {"metricIntersection3", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_273metricIntersection3, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_272metricIntersection3};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_273metricIntersection3(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_metric1,&__pyx_mstate_global->__pyx_n_u_metric2,&__pyx_mstate_global->__pyx_n_u_metric3,&__pyx_mstate_global->__pyx_n_u_metricInt,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3222, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 3222, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3222, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3222, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3222, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "metricIntersection3", 0) < (0)) __PYX_ERR(57, 3222, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("metricIntersection3", 1, 4, 4, i); __PYX_ERR(57, 3222, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3222, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3222, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3222, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 3222, __pyx_L3_error)
    }
    __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, 3222, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric1", 0))) __PYX_ERR(57, 3222, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric2), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric2", 0))) __PYX_ERR(57, 3222, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metric3), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metric3", 0))) __PYX_ERR(57, 3222, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metricInt), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "metricInt", 0))) __PYX_ERR(57, 3222, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_272metricIntersection3(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_272metricIntersection3(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3243
 * 
 *         """
 *         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, 3243, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3244
 *         """
 *         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":3222
 *         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":3246
 *         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_275computeGradientClementInterpolant(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_274computeGradientClementInterpolant, "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:3246");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_275computeGradientClementInterpolant = {"computeGradientClementInterpolant", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_275computeGradientClementInterpolant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_274computeGradientClementInterpolant};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_275computeGradientClementInterpolant(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_locX,&__pyx_mstate_global->__pyx_n_u_locC,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3246, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3246, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3246, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeGradientClementInterpolant", 0) < (0)) __PYX_ERR(57, 3246, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeGradientClementInterpolant", 1, 2, 2, i); __PYX_ERR(57, 3246, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3246, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3246, __pyx_L3_error)
    }
    __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, 3246, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "locX", 0))) __PYX_ERR(57, 3246, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_locC), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "locC", 0))) __PYX_ERR(57, 3246, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_274computeGradientClementInterpolant(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_274computeGradientClementInterpolant(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3263
 * 
 *         """
 *         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, 3263, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3264
 *         """
 *         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":3246
 *         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":3268
 *     # View
 * 
 *     def topologyView(self, Viewer viewer) -> None:             # <<<<<<<<<<<<<<
 *         """Save a `DMPlex` topology into a file.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_277topologyView(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_276topologyView, "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:3268");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_277topologyView = {"topologyView", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_277topologyView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_276topologyView};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_277topologyView(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3268, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3268, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "topologyView", 0) < (0)) __PYX_ERR(57, 3268, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("topologyView", 1, 1, 1, i); __PYX_ERR(57, 3268, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3268, __pyx_L3_error)
    }
    __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, 3268, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3268, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_276topologyView(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_276topologyView(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3284
 * 
 *         """
 *         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, 3284, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3268
 *     # 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":3286
 *         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_279coordinatesView(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_278coordinatesView, "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:3286");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_279coordinatesView = {"coordinatesView", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_279coordinatesView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_278coordinatesView};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_279coordinatesView(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3286, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "coordinatesView", 0) < (0)) __PYX_ERR(57, 3286, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("coordinatesView", 1, 1, 1, i); __PYX_ERR(57, 3286, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3286, __pyx_L3_error)
    }
    __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, 3286, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3286, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_278coordinatesView(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_278coordinatesView(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3302
 * 
 *         """
 *         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, 3302, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3286
 *         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":3304
 *         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_281labelsView(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_280labelsView, "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:3304");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_281labelsView = {"labelsView", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_281labelsView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_280labelsView};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_281labelsView(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3304, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3304, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "labelsView", 0) < (0)) __PYX_ERR(57, 3304, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("labelsView", 1, 1, 1, i); __PYX_ERR(57, 3304, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3304, __pyx_L3_error)
    }
    __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, 3304, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3304, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_280labelsView(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_280labelsView(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3320
 * 
 *         """
 *         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, 3320, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3304
 *         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":3322
 *         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_283sectionView(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_282sectionView, "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:3322");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_283sectionView = {"sectionView", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_283sectionView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_282sectionView};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_283sectionView(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,&__pyx_mstate_global->__pyx_n_u_sectiondm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3322, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3322, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3322, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sectionView", 0) < (0)) __PYX_ERR(57, 3322, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sectionView", 1, 2, 2, i); __PYX_ERR(57, 3322, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3322, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3322, __pyx_L3_error)
    }
    __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, 3322, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3322, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sectiondm), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "sectiondm", 0))) __PYX_ERR(57, 3322, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_282sectionView(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_282sectionView(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3341
 * 
 *         """
 *         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, 3341, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3322
 *         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":3343
 *         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_285globalVectorView(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_284globalVectorView, "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:3343");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_285globalVectorView = {"globalVectorView", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_285globalVectorView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_284globalVectorView};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_285globalVectorView(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,&__pyx_mstate_global->__pyx_n_u_sectiondm,&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3343, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3343, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3343, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3343, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "globalVectorView", 0) < (0)) __PYX_ERR(57, 3343, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("globalVectorView", 1, 3, 3, i); __PYX_ERR(57, 3343, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3343, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3343, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3343, __pyx_L3_error)
    }
    __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, 3343, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3343, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sectiondm), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "sectiondm", 0))) __PYX_ERR(57, 3343, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(57, 3343, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_284globalVectorView(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_284globalVectorView(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3365
 * 
 *         """
 *         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, 3365, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3343
 *         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":3367
 *         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_287localVectorView(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_286localVectorView, "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:3367");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_287localVectorView = {"localVectorView", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_287localVectorView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_286localVectorView};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_287localVectorView(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,&__pyx_mstate_global->__pyx_n_u_sectiondm,&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3367, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3367, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3367, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3367, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "localVectorView", 0) < (0)) __PYX_ERR(57, 3367, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("localVectorView", 1, 3, 3, i); __PYX_ERR(57, 3367, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3367, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3367, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3367, __pyx_L3_error)
    }
    __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, 3367, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3367, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sectiondm), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "sectiondm", 0))) __PYX_ERR(57, 3367, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(57, 3367, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_286localVectorView(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_286localVectorView(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3389
 * 
 *         """
 *         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, 3389, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3367
 *         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":3393
 *     # Load
 * 
 *     def topologyLoad(self, Viewer viewer) -> SF:             # <<<<<<<<<<<<<<
 *         """Load a topology into this `DMPlex` object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_289topologyLoad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_288topologyLoad, "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:3393");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_289topologyLoad = {"topologyLoad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_289topologyLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_288topologyLoad};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_289topologyLoad(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3393, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3393, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "topologyLoad", 0) < (0)) __PYX_ERR(57, 3393, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("topologyLoad", 1, 1, 1, i); __PYX_ERR(57, 3393, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3393, __pyx_L3_error)
    }
    __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, 3393, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3393, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_288topologyLoad(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_viewer);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_288topologyLoad(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("topologyLoad", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3415
 * 
 *         """
 *         cdef SF sf = SF()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexTopologyLoad(self.dm, viewer.vwr, &sf.sf))
 *         return sf
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 3415, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3416
 *         """
 *         cdef SF sf = SF()
 *         CHKERR(DMPlexTopologyLoad(self.dm, viewer.vwr, &sf.sf))             # <<<<<<<<<<<<<<
 *         return sf
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTopologyLoad(__pyx_v_self->__pyx_base.dm, __pyx_v_viewer->vwr, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3416, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3417
 *         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":3393
 *     # 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_XDECREF(__pyx_t_2);
  __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":3419
 *         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_291coordinatesLoad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_290coordinatesLoad, "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:3419");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_291coordinatesLoad = {"coordinatesLoad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_291coordinatesLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_290coordinatesLoad};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_291coordinatesLoad(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,&__pyx_mstate_global->__pyx_n_u_sfxc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3419, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3419, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3419, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "coordinatesLoad", 0) < (0)) __PYX_ERR(57, 3419, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("coordinatesLoad", 1, 2, 2, i); __PYX_ERR(57, 3419, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3419, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3419, __pyx_L3_error)
    }
    __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, 3419, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3419, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sfxc), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sfxc", 0))) __PYX_ERR(57, 3419, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_290coordinatesLoad(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_290coordinatesLoad(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3437
 * 
 *         """
 *         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, 3437, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3419
 *         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":3439
 *         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_293labelsLoad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_292labelsLoad, "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:3439");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_293labelsLoad = {"labelsLoad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_293labelsLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_292labelsLoad};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_293labelsLoad(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,&__pyx_mstate_global->__pyx_n_u_sfxc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3439, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3439, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3439, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "labelsLoad", 0) < (0)) __PYX_ERR(57, 3439, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("labelsLoad", 1, 2, 2, i); __PYX_ERR(57, 3439, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3439, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3439, __pyx_L3_error)
    }
    __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, 3439, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3439, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sfxc), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sfxc", 0))) __PYX_ERR(57, 3439, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_292labelsLoad(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_292labelsLoad(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3457
 * 
 *         """
 *         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, 3457, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3439
 *         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":3459
 *         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_295sectionLoad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_294sectionLoad, "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:3459");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_295sectionLoad = {"sectionLoad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_295sectionLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_294sectionLoad};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_295sectionLoad(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,&__pyx_mstate_global->__pyx_n_u_sectiondm,&__pyx_mstate_global->__pyx_n_u_sfxc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3459, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3459, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3459, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3459, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sectionLoad", 0) < (0)) __PYX_ERR(57, 3459, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sectionLoad", 1, 3, 3, i); __PYX_ERR(57, 3459, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3459, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3459, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3459, __pyx_L3_error)
    }
    __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, 3459, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3459, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sectiondm), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "sectiondm", 0))) __PYX_ERR(57, 3459, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sfxc), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sfxc", 0))) __PYX_ERR(57, 3459, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_294sectionLoad(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_294sectionLoad(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("sectionLoad", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3491
 * 
 *         """
 *         cdef SF gsf = SF()             # <<<<<<<<<<<<<<
 *         cdef SF lsf = SF()
 *         CHKERR(DMPlexSectionLoad(self.dm, viewer.vwr, sectiondm.dm, sfxc.sf, &gsf.sf, &lsf.sf))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 3491, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_gsf = ((struct PyPetscSFObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3492
 *         """
 *         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 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 3492, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_lsf = ((struct PyPetscSFObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3493
 *         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_4 = __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_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3493, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3494
 *         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, 3494, __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)) != (0)) __PYX_ERR(57, 3494, __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)) != (0)) __PYX_ERR(57, 3494, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":3459
 *         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_XDECREF(__pyx_t_2);
  __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":3496
 *         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_297globalVectorLoad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_296globalVectorLoad, "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:3496");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_297globalVectorLoad = {"globalVectorLoad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_297globalVectorLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_296globalVectorLoad};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_297globalVectorLoad(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,&__pyx_mstate_global->__pyx_n_u_sectiondm,&__pyx_mstate_global->__pyx_n_u_sf,&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3496, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 3496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "globalVectorLoad", 0) < (0)) __PYX_ERR(57, 3496, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("globalVectorLoad", 1, 4, 4, i); __PYX_ERR(57, 3496, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3496, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3496, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3496, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 3496, __pyx_L3_error)
    }
    __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, 3496, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3496, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sectiondm), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "sectiondm", 0))) __PYX_ERR(57, 3496, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(57, 3496, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(57, 3496, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_296globalVectorLoad(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_296globalVectorLoad(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3519
 * 
 *         """
 *         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, 3519, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3496
 *         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":3521
 *         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_299localVectorLoad(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_298localVectorLoad, "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:3521");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_299localVectorLoad = {"localVectorLoad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_299localVectorLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_298localVectorLoad};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_299localVectorLoad(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,&__pyx_mstate_global->__pyx_n_u_sectiondm,&__pyx_mstate_global->__pyx_n_u_sf,&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3521, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 3521, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3521, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3521, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3521, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "localVectorLoad", 0) < (0)) __PYX_ERR(57, 3521, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("localVectorLoad", 1, 4, 4, i); __PYX_ERR(57, 3521, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3521, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3521, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3521, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(57, 3521, __pyx_L3_error)
    }
    __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, 3521, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 0, "viewer", 0))) __PYX_ERR(57, 3521, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sectiondm), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "sectiondm", 0))) __PYX_ERR(57, 3521, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(57, 3521, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vec), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(57, 3521, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_298localVectorLoad(((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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_298localVectorLoad(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3544
 * 
 *         """
 *         CHKERR(DMPlexLocalVectorLoad(self.dm, viewer.vwr, sectiondm.dm, sf.sf, vec.vec))             # <<<<<<<<<<<<<<
 * 
 *     def createNaturalVec(self) -> 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, 3544, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3521
 *         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":3546
 *         CHKERR(DMPlexLocalVectorLoad(self.dm, viewer.vwr, sectiondm.dm, sf.sf, vec.vec))
 * 
 *     def createNaturalVec(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a natural vector.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_301createNaturalVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_300createNaturalVec, "DMPlex.createNaturalVec(self) -> Vec\nReturn a natural vector.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMPlexCreateNaturalVector\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3546");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_301createNaturalVec = {"createNaturalVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_301createNaturalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_300createNaturalVec};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_301createNaturalVec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("createNaturalVec", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_300createNaturalVec(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_300createNaturalVec(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_nv = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createNaturalVec", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3556
 * 
 *         """
 *         cdef Vec nv = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexCreateNaturalVector(self.dm, &nv.vec))
 *         return nv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 3556, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_nv = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3557
 *         """
 *         cdef Vec nv = Vec()
 *         CHKERR(DMPlexCreateNaturalVector(self.dm, &nv.vec))             # <<<<<<<<<<<<<<
 *         return nv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateNaturalVector(__pyx_v_self->__pyx_base.dm, (&__pyx_v_nv->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3557, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3558
 *         cdef Vec nv = Vec()
 *         CHKERR(DMPlexCreateNaturalVector(self.dm, &nv.vec))
 *         return nv             # <<<<<<<<<<<<<<
 * 
 *     def naturalToGlobalBegin(self, Vec nv, Vec gv) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_nv);
  __pyx_r = ((PyObject *)__pyx_v_nv);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":3546
 *         CHKERR(DMPlexLocalVectorLoad(self.dm, viewer.vwr, sectiondm.dm, sf.sf, vec.vec))
 * 
 *     def createNaturalVec(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a natural vector.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createNaturalVec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_nv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMPlex.pyx":3560
 *         return nv
 * 
 *     def naturalToGlobalBegin(self, Vec nv, Vec gv) -> None:             # <<<<<<<<<<<<<<
 *         """Rearrange a `Vec` in the natural order to the Global order.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_303naturalToGlobalBegin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_302naturalToGlobalBegin, "DMPlex.naturalToGlobalBegin(self, nv: Vec, gv: Vec) -> None\nRearrange a `Vec` in the natural order to the Global order.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMPlexNaturalToGlobalBegin\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3560");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_303naturalToGlobalBegin = {"naturalToGlobalBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_303naturalToGlobalBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_302naturalToGlobalBegin};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_303naturalToGlobalBegin(PyObject *__pyx_v_self, 
#if 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_nv = 0;
  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[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("naturalToGlobalBegin (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nv_2,&__pyx_mstate_global->__pyx_n_u_gv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3560, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3560, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3560, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "naturalToGlobalBegin", 0) < (0)) __PYX_ERR(57, 3560, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("naturalToGlobalBegin", 1, 2, 2, i); __PYX_ERR(57, 3560, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3560, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3560, __pyx_L3_error)
    }
    __pyx_v_nv = ((struct PyPetscVecObject *)values[0]);
    __pyx_v_gv = ((struct PyPetscVecObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("naturalToGlobalBegin", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 3560, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.naturalToGlobalBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nv), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "nv", 0))) __PYX_ERR(57, 3560, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gv), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gv", 0))) __PYX_ERR(57, 3560, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_302naturalToGlobalBegin(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_nv, __pyx_v_gv);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_302naturalToGlobalBegin(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_nv, 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("naturalToGlobalBegin", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3570
 * 
 *         """
 *         CHKERR(DMPlexNaturalToGlobalBegin(self.dm, nv.vec, gv.vec))             # <<<<<<<<<<<<<<
 * 
 *     def naturalToGlobalEnd(self, Vec nv, Vec gv) -> None:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexNaturalToGlobalBegin(__pyx_v_self->__pyx_base.dm, __pyx_v_nv->vec, __pyx_v_gv->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3570, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3560
 *         return nv
 * 
 *     def naturalToGlobalBegin(self, Vec nv, Vec gv) -> None:             # <<<<<<<<<<<<<<
 *         """Rearrange a `Vec` in the natural order to the Global order.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.naturalToGlobalBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMPlex.pyx":3572
 *         CHKERR(DMPlexNaturalToGlobalBegin(self.dm, nv.vec, gv.vec))
 * 
 *     def naturalToGlobalEnd(self, Vec nv, Vec gv) -> None:             # <<<<<<<<<<<<<<
 *         """Rearrange a `Vec` in the natural order to the Global order.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_305naturalToGlobalEnd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_304naturalToGlobalEnd, "DMPlex.naturalToGlobalEnd(self, nv: Vec, gv: Vec) -> None\nRearrange a `Vec` in the natural order to the Global order.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMPlexNaturalToGlobalEnd\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3572");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_305naturalToGlobalEnd = {"naturalToGlobalEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_305naturalToGlobalEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_304naturalToGlobalEnd};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_305naturalToGlobalEnd(PyObject *__pyx_v_self, 
#if 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_nv = 0;
  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[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("naturalToGlobalEnd (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nv_2,&__pyx_mstate_global->__pyx_n_u_gv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3572, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3572, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3572, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "naturalToGlobalEnd", 0) < (0)) __PYX_ERR(57, 3572, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("naturalToGlobalEnd", 1, 2, 2, i); __PYX_ERR(57, 3572, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3572, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3572, __pyx_L3_error)
    }
    __pyx_v_nv = ((struct PyPetscVecObject *)values[0]);
    __pyx_v_gv = ((struct PyPetscVecObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("naturalToGlobalEnd", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 3572, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.naturalToGlobalEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nv), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "nv", 0))) __PYX_ERR(57, 3572, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gv), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gv", 0))) __PYX_ERR(57, 3572, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_304naturalToGlobalEnd(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_nv, __pyx_v_gv);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_304naturalToGlobalEnd(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_nv, 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("naturalToGlobalEnd", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3582
 * 
 *         """
 *         CHKERR(DMPlexNaturalToGlobalEnd(self.dm, nv.vec, gv.vec))             # <<<<<<<<<<<<<<
 * 
 *     def globalToNaturalBegin(self, Vec gv, Vec nv) -> None:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexNaturalToGlobalEnd(__pyx_v_self->__pyx_base.dm, __pyx_v_nv->vec, __pyx_v_gv->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3582, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3572
 *         CHKERR(DMPlexNaturalToGlobalBegin(self.dm, nv.vec, gv.vec))
 * 
 *     def naturalToGlobalEnd(self, Vec nv, Vec gv) -> None:             # <<<<<<<<<<<<<<
 *         """Rearrange a `Vec` in the natural order to the Global order.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.naturalToGlobalEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMPlex.pyx":3584
 *         CHKERR(DMPlexNaturalToGlobalEnd(self.dm, nv.vec, gv.vec))
 * 
 *     def globalToNaturalBegin(self, Vec gv, Vec nv) -> None:             # <<<<<<<<<<<<<<
 *         """Rearrange a `Vec` in the Global order to the natural order.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_307globalToNaturalBegin(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_306globalToNaturalBegin, "DMPlex.globalToNaturalBegin(self, gv: Vec, nv: Vec) -> None\nRearrange a `Vec` in the Global order to the natural order.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMPlexGlobalToNaturalBegin\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3584");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_307globalToNaturalBegin = {"globalToNaturalBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_307globalToNaturalBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_306globalToNaturalBegin};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_307globalToNaturalBegin(PyObject *__pyx_v_self, 
#if 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;
  struct PyPetscVecObject *__pyx_v_nv = 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("globalToNaturalBegin (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gv,&__pyx_mstate_global->__pyx_n_u_nv_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3584, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3584, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3584, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "globalToNaturalBegin", 0) < (0)) __PYX_ERR(57, 3584, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("globalToNaturalBegin", 1, 2, 2, i); __PYX_ERR(57, 3584, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3584, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3584, __pyx_L3_error)
    }
    __pyx_v_gv = ((struct PyPetscVecObject *)values[0]);
    __pyx_v_nv = ((struct PyPetscVecObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("globalToNaturalBegin", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 3584, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.globalToNaturalBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gv), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gv", 0))) __PYX_ERR(57, 3584, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nv), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "nv", 0))) __PYX_ERR(57, 3584, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_306globalToNaturalBegin(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_gv, __pyx_v_nv);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_306globalToNaturalBegin(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gv, struct PyPetscVecObject *__pyx_v_nv) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscErrorCode __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("globalToNaturalBegin", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3594
 * 
 *         """
 *         CHKERR(DMPlexGlobalToNaturalBegin(self.dm, gv.vec, nv.vec))             # <<<<<<<<<<<<<<
 * 
 *     def globalToNaturalEnd(self, Vec gv, Vec nv) -> None:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGlobalToNaturalBegin(__pyx_v_self->__pyx_base.dm, __pyx_v_gv->vec, __pyx_v_nv->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3594, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3584
 *         CHKERR(DMPlexNaturalToGlobalEnd(self.dm, nv.vec, gv.vec))
 * 
 *     def globalToNaturalBegin(self, Vec gv, Vec nv) -> None:             # <<<<<<<<<<<<<<
 *         """Rearrange a `Vec` in the Global order to the natural order.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.globalToNaturalBegin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMPlex.pyx":3596
 *         CHKERR(DMPlexGlobalToNaturalBegin(self.dm, gv.vec, nv.vec))
 * 
 *     def globalToNaturalEnd(self, Vec gv, Vec nv) -> None:             # <<<<<<<<<<<<<<
 *         """Rearrange a `Vec` in the Global order to the natural order.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_309globalToNaturalEnd(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_308globalToNaturalEnd, "DMPlex.globalToNaturalEnd(self, gv: Vec, nv: Vec) -> None\nRearrange a `Vec` in the Global order to the natural order.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMPlexGlobalToNaturalEnd\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3596");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_309globalToNaturalEnd = {"globalToNaturalEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_309globalToNaturalEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_308globalToNaturalEnd};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_309globalToNaturalEnd(PyObject *__pyx_v_self, 
#if 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;
  struct PyPetscVecObject *__pyx_v_nv = 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("globalToNaturalEnd (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gv,&__pyx_mstate_global->__pyx_n_u_nv_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3596, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3596, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3596, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "globalToNaturalEnd", 0) < (0)) __PYX_ERR(57, 3596, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("globalToNaturalEnd", 1, 2, 2, i); __PYX_ERR(57, 3596, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3596, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3596, __pyx_L3_error)
    }
    __pyx_v_gv = ((struct PyPetscVecObject *)values[0]);
    __pyx_v_nv = ((struct PyPetscVecObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("globalToNaturalEnd", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 3596, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.globalToNaturalEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gv), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gv", 0))) __PYX_ERR(57, 3596, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_nv), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "nv", 0))) __PYX_ERR(57, 3596, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_308globalToNaturalEnd(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_gv, __pyx_v_nv);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_308globalToNaturalEnd(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscVecObject *__pyx_v_gv, struct PyPetscVecObject *__pyx_v_nv) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscErrorCode __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("globalToNaturalEnd", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3606
 * 
 *         """
 *         CHKERR(DMPlexGlobalToNaturalEnd(self.dm, gv.vec, nv.vec))             # <<<<<<<<<<<<<<
 * 
 *     def setMigrationSF(self, SF sf) -> None:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGlobalToNaturalEnd(__pyx_v_self->__pyx_base.dm, __pyx_v_gv->vec, __pyx_v_nv->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3606, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3596
 *         CHKERR(DMPlexGlobalToNaturalBegin(self.dm, gv.vec, nv.vec))
 * 
 *     def globalToNaturalEnd(self, Vec gv, Vec nv) -> None:             # <<<<<<<<<<<<<<
 *         """Rearrange a `Vec` in the Global order to the natural order.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.globalToNaturalEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMPlex.pyx":3608
 *         CHKERR(DMPlexGlobalToNaturalEnd(self.dm, gv.vec, nv.vec))
 * 
 *     def setMigrationSF(self, SF sf) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `SF` for migrating from a parent `DM` into this `DM`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_311setMigrationSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_310setMigrationSF, "DMPlex.setMigrationSF(self, sf: SF) -> None\nSet the `SF` for migrating from a parent `DM` into this `DM`.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.DMPlexSetMigrationSF\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3608");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_311setMigrationSF = {"setMigrationSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_311setMigrationSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_310setMigrationSF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_311setMigrationSF(PyObject *__pyx_v_self, 
#if 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("setMigrationSF (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3608, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3608, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMigrationSF", 0) < (0)) __PYX_ERR(57, 3608, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMigrationSF", 1, 1, 1, i); __PYX_ERR(57, 3608, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3608, __pyx_L3_error)
    }
    __pyx_v_sf = ((struct PyPetscSFObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setMigrationSF", 1, 1, 1, __pyx_nargs); __PYX_ERR(57, 3608, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setMigrationSF", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sf), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(57, 3608, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_310setMigrationSF(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_sf);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_310setMigrationSF(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__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("setMigrationSF", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3618
 * 
 *         """
 *         CHKERR(DMPlexSetMigrationSF(self.dm, sf.sf))             # <<<<<<<<<<<<<<
 * 
 *     def getMigrationSF(self) -> SF:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexSetMigrationSF(__pyx_v_self->__pyx_base.dm, __pyx_v_sf->sf)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3618, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3608
 *         CHKERR(DMPlexGlobalToNaturalEnd(self.dm, gv.vec, nv.vec))
 * 
 *     def setMigrationSF(self, SF sf) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `SF` for migrating from a parent `DM` into this `DM`.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.setMigrationSF", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMPlex.pyx":3620
 *         CHKERR(DMPlexSetMigrationSF(self.dm, sf.sf))
 * 
 *     def getMigrationSF(self) -> SF:             # <<<<<<<<<<<<<<
 *         """Get the `SF` for migrating from a parent `DM` into this `DM`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_313getMigrationSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_312getMigrationSF, "DMPlex.getMigrationSF(self) -> SF\nGet the `SF` for migrating from a parent `DM` into this `DM`.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.DMPlexGetMigrationSF\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3620");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_313getMigrationSF = {"getMigrationSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_313getMigrationSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_312getMigrationSF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_313getMigrationSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getMigrationSF (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getMigrationSF", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getMigrationSF", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_312getMigrationSF(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_312getMigrationSF(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self) {
  struct PyPetscSFObject *__pyx_v_sf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getMigrationSF", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3630
 * 
 *         """
 *         cdef SF sf = SF()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexGetMigrationSF(self.dm, &sf.sf))
 *         CHKERR(PetscINCREF(sf.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 3630, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3631
 *         """
 *         cdef SF sf = SF()
 *         CHKERR(DMPlexGetMigrationSF(self.dm, &sf.sf))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(sf.obj))
 *         return sf
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexGetMigrationSF(__pyx_v_self->__pyx_base.dm, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3631, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3632
 *         cdef SF sf = SF()
 *         CHKERR(DMPlexGetMigrationSF(self.dm, &sf.sf))
 *         CHKERR(PetscINCREF(sf.obj))             # <<<<<<<<<<<<<<
 *         return sf
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_sf->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3632, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3633
 *         CHKERR(DMPlexGetMigrationSF(self.dm, &sf.sf))
 *         CHKERR(PetscINCREF(sf.obj))
 *         return sf             # <<<<<<<<<<<<<<
 * 
 *     def createGlobalToNaturalSF(self, Section section, SF sfMigration) -> SF:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_sf);
  __pyx_r = ((PyObject *)__pyx_v_sf);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":3620
 *         CHKERR(DMPlexSetMigrationSF(self.dm, sf.sf))
 * 
 *     def getMigrationSF(self) -> SF:             # <<<<<<<<<<<<<<
 *         """Get the `SF` for migrating from a parent `DM` into this `DM`.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.getMigrationSF", __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":3635
 *         return sf
 * 
 *     def createGlobalToNaturalSF(self, Section section, SF sfMigration) -> SF:             # <<<<<<<<<<<<<<
 *         """Create the `SF` for mapping Global `Vec` to the Natural `Vec`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_315createGlobalToNaturalSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_314createGlobalToNaturalSF, "DMPlex.createGlobalToNaturalSF(self, section: Section, sfMigration: SF) -> SF\nCreate the `SF` for mapping Global `Vec` to the Natural `Vec`.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMPlexCreateGlobalToNaturalSF\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3635");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_315createGlobalToNaturalSF = {"createGlobalToNaturalSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_315createGlobalToNaturalSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_314createGlobalToNaturalSF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_315createGlobalToNaturalSF(PyObject *__pyx_v_self, 
#if 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_section = 0;
  struct PyPetscSFObject *__pyx_v_sfMigration = 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("createGlobalToNaturalSF (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_section,&__pyx_mstate_global->__pyx_n_u_sfMigration,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3635, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3635, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3635, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createGlobalToNaturalSF", 0) < (0)) __PYX_ERR(57, 3635, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createGlobalToNaturalSF", 1, 2, 2, i); __PYX_ERR(57, 3635, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3635, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3635, __pyx_L3_error)
    }
    __pyx_v_section = ((struct PyPetscSectionObject *)values[0]);
    __pyx_v_sfMigration = ((struct PyPetscSFObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createGlobalToNaturalSF", 1, 2, 2, __pyx_nargs); __PYX_ERR(57, 3635, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createGlobalToNaturalSF", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_section), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, 0, "section", 0))) __PYX_ERR(57, 3635, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sfMigration), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sfMigration", 0))) __PYX_ERR(57, 3635, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_314createGlobalToNaturalSF(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_section, __pyx_v_sfMigration);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_314createGlobalToNaturalSF(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscSectionObject *__pyx_v_section, struct PyPetscSFObject *__pyx_v_sfMigration) {
  struct PyPetscSFObject *__pyx_v_sf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createGlobalToNaturalSF", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3645
 * 
 *         """
 *         cdef SF sf = SF()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexCreateGlobalToNaturalSF(self.dm, section.sec, sfMigration.sf, &sf.sf))
 *         return sf
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 3645, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3646
 *         """
 *         cdef SF sf = SF()
 *         CHKERR(DMPlexCreateGlobalToNaturalSF(self.dm, section.sec, sfMigration.sf, &sf.sf))             # <<<<<<<<<<<<<<
 *         return sf
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateGlobalToNaturalSF(__pyx_v_self->__pyx_base.dm, __pyx_v_section->sec, __pyx_v_sfMigration->sf, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3646, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3647
 *         cdef SF sf = SF()
 *         CHKERR(DMPlexCreateGlobalToNaturalSF(self.dm, section.sec, sfMigration.sf, &sf.sf))
 *         return sf             # <<<<<<<<<<<<<<
 * 
 *     def migrateGlobalToNaturalSF(self, DM dmOld, SF sfNaturalOld, SF sfMigration) -> SF:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_sf);
  __pyx_r = ((PyObject *)__pyx_v_sf);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":3635
 *         return sf
 * 
 *     def createGlobalToNaturalSF(self, Section section, SF sfMigration) -> SF:             # <<<<<<<<<<<<<<
 *         """Create the `SF` for mapping Global `Vec` to the Natural `Vec`.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.createGlobalToNaturalSF", __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":3649
 *         return sf
 * 
 *     def migrateGlobalToNaturalSF(self, DM dmOld, SF sfNaturalOld, SF sfMigration) -> SF:             # <<<<<<<<<<<<<<
 *         """Create the `SF` for mapping Global `Vec` to the Natural `Vec` in the new `DM`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_317migrateGlobalToNaturalSF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_316migrateGlobalToNaturalSF, "DMPlex.migrateGlobalToNaturalSF(self, dmOld: DM, sfNaturalOld: SF, sfMigration: SF) -> SF\nCreate the `SF` for mapping Global `Vec` to the Natural `Vec` in the new `DM`.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMPlexMigrateGlobalToNaturalSF\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3649");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMPlex_317migrateGlobalToNaturalSF = {"migrateGlobalToNaturalSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_317migrateGlobalToNaturalSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_316migrateGlobalToNaturalSF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6DMPlex_317migrateGlobalToNaturalSF(PyObject *__pyx_v_self, 
#if 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_dmOld = 0;
  struct PyPetscSFObject *__pyx_v_sfNaturalOld = 0;
  struct PyPetscSFObject *__pyx_v_sfMigration = 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("migrateGlobalToNaturalSF (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dmOld,&__pyx_mstate_global->__pyx_n_u_sfNaturalOld,&__pyx_mstate_global->__pyx_n_u_sfMigration,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3649, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3649, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3649, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3649, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "migrateGlobalToNaturalSF", 0) < (0)) __PYX_ERR(57, 3649, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("migrateGlobalToNaturalSF", 1, 3, 3, i); __PYX_ERR(57, 3649, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3649, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(57, 3649, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(57, 3649, __pyx_L3_error)
    }
    __pyx_v_dmOld = ((struct PyPetscDMObject *)values[0]);
    __pyx_v_sfNaturalOld = ((struct PyPetscSFObject *)values[1]);
    __pyx_v_sfMigration = ((struct PyPetscSFObject *)values[2]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("migrateGlobalToNaturalSF", 1, 3, 3, __pyx_nargs); __PYX_ERR(57, 3649, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.migrateGlobalToNaturalSF", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmOld), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dmOld", 0))) __PYX_ERR(57, 3649, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sfNaturalOld), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sfNaturalOld", 0))) __PYX_ERR(57, 3649, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sfMigration), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sfMigration", 0))) __PYX_ERR(57, 3649, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6DMPlex_316migrateGlobalToNaturalSF(((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_v_self), __pyx_v_dmOld, __pyx_v_sfNaturalOld, __pyx_v_sfMigration);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6DMPlex_316migrateGlobalToNaturalSF(struct __pyx_obj_8petsc4py_5PETSc_DMPlex *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dmOld, struct PyPetscSFObject *__pyx_v_sfNaturalOld, struct PyPetscSFObject *__pyx_v_sfMigration) {
  struct PyPetscSFObject *__pyx_v_sf = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("migrateGlobalToNaturalSF", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3659
 * 
 *         """
 *         cdef SF sf = SF()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexMigrateGlobalToNaturalSF(dmOld.dm, self.dm, sfNaturalOld.sf, sfMigration.sf, &sf.sf))
 *         return sf
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 3659, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_sf = ((struct PyPetscSFObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3660
 *         """
 *         cdef SF sf = SF()
 *         CHKERR(DMPlexMigrateGlobalToNaturalSF(dmOld.dm, self.dm, sfNaturalOld.sf, sfMigration.sf, &sf.sf))             # <<<<<<<<<<<<<<
 *         return sf
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexMigrateGlobalToNaturalSF(__pyx_v_dmOld->dm, __pyx_v_self->__pyx_base.dm, __pyx_v_sfNaturalOld->sf, __pyx_v_sfMigration->sf, (&__pyx_v_sf->sf))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3660, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3661
 *         cdef SF sf = SF()
 *         CHKERR(DMPlexMigrateGlobalToNaturalSF(dmOld.dm, self.dm, sfNaturalOld.sf, sfMigration.sf, &sf.sf))
 *         return sf             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_sf);
  __pyx_r = ((PyObject *)__pyx_v_sf);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":3649
 *         return sf
 * 
 *     def migrateGlobalToNaturalSF(self, DM dmOld, SF sfNaturalOld, SF sfMigration) -> SF:             # <<<<<<<<<<<<<<
 *         """Create the `SF` for mapping Global `Vec` to the Natural `Vec` in the new `DM`.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.DMPlex.migrateGlobalToNaturalSF", __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":3683
 *     """Mesh transformations."""
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":3684
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.tr             # <<<<<<<<<<<<<<
 *         self.tr  = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->tr));

  /* "petsc4py/PETSc/DMPlex.pyx":3685
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.tr
 *         self.tr  = NULL             # <<<<<<<<<<<<<<
 * 
 *     def apply(self, DM dm) -> DM:
*/
  __pyx_v_self->tr = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":3683
 *     """Mesh transformations."""
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.tr
 *         self.tr  = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/DMPlex.pyx":3687
 *         self.tr  = NULL
 * 
 *     def apply(self, DM dm) -> DM:             # <<<<<<<<<<<<<<
 *         """Apply a mesh transformation.
 * 
*/

/* 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) -> DM\nApply a mesh transformation.\n\n        Collective.\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3687");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_3apply = {"apply", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_3apply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_2apply};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3687, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3687, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "apply", 0) < (0)) __PYX_ERR(57, 3687, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("apply", 1, 1, 1, i); __PYX_ERR(57, 3687, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3687, __pyx_L3_error)
    }
    __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, 3687, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(57, 3687, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("apply", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3694
 *         """
 *         # FIXME petsc.DMPlexTransformApply
 *         cdef DMPlex newdm = DMPlex()             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexTransformApply(self.tr, dm.dm, &newdm.dm))
 *         return newdm
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 3694, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_newdm = ((struct __pyx_obj_8petsc4py_5PETSc_DMPlex *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3695
 *         # FIXME petsc.DMPlexTransformApply
 *         cdef DMPlex newdm = DMPlex()
 *         CHKERR(DMPlexTransformApply(self.tr, dm.dm, &newdm.dm))             # <<<<<<<<<<<<<<
 *         return newdm
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexTransformApply(__pyx_v_self->tr, __pyx_v_dm->dm, (&__pyx_v_newdm->__pyx_base.dm))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(57, 3695, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3696
 *         cdef DMPlex newdm = DMPlex()
 *         CHKERR(DMPlexTransformApply(self.tr, dm.dm, &newdm.dm))
 *         return newdm             # <<<<<<<<<<<<<<
 * 
 *     def create(self, comm: Comm | None = None) -> Self:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_newdm);
  __pyx_r = ((PyObject *)__pyx_v_newdm);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":3687
 *         self.tr  = NULL
 * 
 *     def apply(self, DM dm) -> DM:             # <<<<<<<<<<<<<<
 *         """Apply a mesh transformation.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3698
 *         return newdm
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a mesh transformation.
 * 
*/

/* 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: Comm | None = None) -> Self\nCreate a mesh transformation.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMPlexTransformCreate\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3698");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_5create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_4create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3698, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3698, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(57, 3698, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3698, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(57, 3698, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3708
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(57, 3708, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/DMPlex.pyx":3709
 *         """
 *         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":3710
 *         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, 3710, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3711
 *         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, 3711, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3712
 *         CHKERR(DMPlexTransformCreate(ccomm, &newtr))
 *         CHKERR(PetscCLEAR(self.obj))
 *         self.tr = newtr             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_v_self->tr = __pyx_v_newtr;

  /* "petsc4py/PETSc/DMPlex.pyx":3713
 *         CHKERR(PetscCLEAR(self.obj))
 *         self.tr = newtr
 *         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/DMPlex.pyx":3698
 *         return newdm
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a mesh transformation.
 * 
*/

  /* 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":3715
 *         return self
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy a mesh transformation.
 * 
*/

/* 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) -> Self\nDestroy a mesh transformation.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMPlexTransformDestroy\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3715");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_7destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_6destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3725
 * 
 *         """
 *         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, 3725, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3726
 *         """
 *         CHKERR(DMPlexTransformDestroy(&self.tr))
 *         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/DMPlex.pyx":3715
 *         return self
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy a mesh transformation.
 * 
*/

  /* 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":3728
 *         return self
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the transformation type name.
 * 
*/

/* 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) -> str\nReturn the transformation type name.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.DMPlexTransformGetType\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3728");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_9getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_9getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_8getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3738
 * 
 *         """
 *         cdef PetscDMPlexTransformType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMPlexTransformGetType(self.tr, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":3739
 *         """
 *         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, 3739, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3740
 *         cdef PetscDMPlexTransformType cval = NULL
 *         CHKERR(DMPlexTransformGetType(self.tr, &cval))
 *         return bytes2str(cval)             # <<<<<<<<<<<<<<
 * 
 *     def setUp(self) -> Self:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 3740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMPlex.pyx":3728
 *         return self
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the transformation type name.
 * 
*/

  /* 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":3742
 *         return bytes2str(cval)
 * 
 *     def setUp(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Setup a mesh transformation.
 * 
*/

/* 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) -> Self\nSetup a mesh transformation.\n\n        Collective.\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3742");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_11setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_11setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_10setUp};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3749
 *         """
 *         # FIXME petsc.DMPlexTransformSetUp
 *         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, 3749, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3750
 *         # FIXME petsc.DMPlexTransformSetUp
 *         CHKERR(DMPlexTransformSetUp(self.tr))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def setType(self, tr_type : DMPlexTransformType | 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":3742
 *         return bytes2str(cval)
 * 
 *     def setUp(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Setup a mesh transformation.
 * 
*/

  /* 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":3752
 *         return self
 * 
 *     def setType(self, tr_type : DMPlexTransformType | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the transformation type.
 * 
*/

/* 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: DMPlexTransformType | str) -> None\nSet the transformation type.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.DMPlexTransformSetType\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3752");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_13setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_13setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_12setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tr_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3752, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3752, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(57, 3752, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(57, 3752, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3752, __pyx_L3_error)
    }
    __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, 3752, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":3762
 * 
 *         """
 *         cdef PetscDMPlexTransformType cval = NULL             # <<<<<<<<<<<<<<
 *         tr_type = str2bytes(tr_type, &cval)
 *         CHKERR(DMPlexTransformSetType(self.tr, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DMPlex.pyx":3763
 *         """
 *         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, 3763, __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":3764
 *         cdef PetscDMPlexTransformType cval = NULL
 *         tr_type = str2bytes(tr_type, &cval)
 *         CHKERR(DMPlexTransformSetType(self.tr, cval))             # <<<<<<<<<<<<<<
 * 
 *     def setDM(self, DM dm) -> None:
*/
  __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, 3764, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3752
 *         return self
 * 
 *     def setType(self, tr_type : DMPlexTransformType | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the transformation 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.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":3766
 *         CHKERR(DMPlexTransformSetType(self.tr, cval))
 * 
 *     def setDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `DM` for the transformation.
 * 
*/

/* 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) -> None\nSet the `DM` for the transformation.\n\n        Logically collective.\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3766");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_15setDM = {"setDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_15setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_14setDM};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3766, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3766, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDM", 0) < (0)) __PYX_ERR(57, 3766, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, i); __PYX_ERR(57, 3766, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3766, __pyx_L3_error)
    }
    __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, 3766, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(57, 3766, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3773
 *         """
 *         # FIXME petsc.DMPlexTransformSetDM
 *         CHKERR(DMPlexTransformSetDM(self.tr, dm.dm))             # <<<<<<<<<<<<<<
 * 
 *     def setFromOptions(self) -> None:
*/
  __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, 3773, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3766
 *         CHKERR(DMPlexTransformSetType(self.tr, cval))
 * 
 *     def setDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `DM` for the transformation.
 * 
*/

  /* 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":3775
 *         CHKERR(DMPlexTransformSetDM(self.tr, dm.dm))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the transformation from the options database.
 * 
*/

/* 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) -> None\nConfigure the transformation from the options database.\n\n        Collective.\n\n        See Also\n        --------\n        petsc_options, petsc.DMPlexTransformSetFromOptions\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3775");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_17setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_17setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_16setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3785
 * 
 *         """
 *         CHKERR(DMPlexTransformSetFromOptions(self.tr))             # <<<<<<<<<<<<<<
 * 
 *     def view(self, Viewer viewer=None) -> 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, 3785, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3775
 *         CHKERR(DMPlexTransformSetDM(self.tr, dm.dm))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the transformation 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.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":3787
 *         CHKERR(DMPlexTransformSetFromOptions(self.tr))
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the mesh transformation.
 * 
*/

/* 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) -> None\nView the mesh transformation.\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.DMPlexTransformView\n\n        \nSource code at petsc4py/PETSc/DMPlex.pyx:3787");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_19view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_19view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_18view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(57, 3787, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3787, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(57, 3787, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(57, 3787, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 3787, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(57, 3787, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/DMPlex.pyx":3802
 * 
 *         """
 *         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":3803
 *         """
 *         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":3804
 *         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, 3804, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":3787
 *         CHKERR(DMPlexTransformSetFromOptions(self.tr))
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the mesh transformation.
 * 
*/

  /* 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":50
 *     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:50");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_1create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dim,&__pyx_mstate_global->__pyx_n_u_dofs,&__pyx_mstate_global->__pyx_n_u_sizes,&__pyx_mstate_global->__pyx_n_u_boundary_types,&__pyx_mstate_global->__pyx_n_u_stencil_type,&__pyx_mstate_global->__pyx_n_u_stencil_width,&__pyx_mstate_global->__pyx_n_u_proc_sizes,&__pyx_mstate_global->__pyx_n_u_ownership_ranges,&__pyx_mstate_global->__pyx_n_u_comm,&__pyx_mstate_global->__pyx_n_u_setUp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 50, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(58, 50, __pyx_L3_error)

      /* "petsc4py/PETSc/DMStag.pyx":53
 *         self,
 *         dim: int,
 *         dofs: tuple[int, ...] | None = None,             # <<<<<<<<<<<<<<
 *         sizes: tuple[int, ...] | None = None,
 *         boundary_types: tuple[DM.BoundaryType | int | str | bool, ...] | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMStag.pyx":54
 *         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,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMStag.pyx":55
 *         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,
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMStag.pyx":56
 *         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,
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMStag.pyx":57
 *         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,
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMStag.pyx":58
 *         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,
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMStag.pyx":59
 *         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:
*/
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMStag.pyx":60
 *         proc_sizes: tuple[int, ...] | None = None,
 *         ownership_ranges: tuple[Sequence[int], ...] | None = None,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *         setUp: bool | None = False) -> Self:
 *         """Create a DMDA object.
*/
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMStag.pyx":61
 *         ownership_ranges: tuple[Sequence[int], ...] | None = None,
 *         comm: Comm | None = None,
 *         setUp: bool | None = False) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a DMDA object.
 * 
*/
      if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("create", 0, 1, 10, i); __PYX_ERR(58, 50, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(58, 50, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 50, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMStag.pyx":53
 *         self,
 *         dim: int,
 *         dofs: tuple[int, ...] | None = None,             # <<<<<<<<<<<<<<
 *         sizes: tuple[int, ...] | None = None,
 *         boundary_types: tuple[DM.BoundaryType | int | str | bool, ...] | None = None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMStag.pyx":54
 *         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,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMStag.pyx":55
 *         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,
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMStag.pyx":56
 *         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,
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMStag.pyx":57
 *         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,
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMStag.pyx":58
 *         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,
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMStag.pyx":59
 *         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:
*/
      if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMStag.pyx":60
 *         proc_sizes: tuple[int, ...] | None = None,
 *         ownership_ranges: tuple[Sequence[int], ...] | None = None,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *         setUp: bool | None = False) -> Self:
 *         """Create a DMDA object.
*/
      if (!values[8]) values[8] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMStag.pyx":61
 *         ownership_ranges: tuple[Sequence[int], ...] | None = None,
 *         comm: Comm | None = None,
 *         setUp: bool | None = False) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a DMDA object.
 * 
*/
      if (!values[9]) values[9] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __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, 50, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":50
 *     StencilLocation   = DMStagStencilLocation
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMStag.pyx":102
 *         """
 *         # 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, 102, __pyx_L1_error)
  __pyx_v_ndim = __pyx_t_1;

  /* "petsc4py/PETSc/DMStag.pyx":105
 * 
 *         # 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":106
 *         # 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":107
 *         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":108
 *         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, 108, __pyx_L1_error)
    __pyx_v_nsizes = __pyx_t_1;

    /* "petsc4py/PETSc/DMStag.pyx":109
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(58, 109, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(58, 109, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/DMStag.pyx":107
 *         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":112
 * 
 *         # 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":113
 *         # 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":114
 *         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":115
 *         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, 115, __pyx_L1_error)
    __pyx_v_ndofs = __pyx_t_1;

    /* "petsc4py/PETSc/DMStag.pyx":116
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(58, 116, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(58, 116, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/DMStag.pyx":114
 *         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":119
 * 
 *         # 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":120
 *         # 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":121
 *         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":122
 *         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, 122, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":125
 * 
 *         # stencil
 *         cdef PetscInt swidth = 0             # <<<<<<<<<<<<<<
 *         if stencil_width is not None:
 *             swidth = asInt(stencil_width)
*/
  __pyx_v_swidth = 0;

  /* "petsc4py/PETSc/DMStag.pyx":126
 *         # 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":127
 *         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, 127, __pyx_L1_error)
    __pyx_v_swidth = __pyx_t_1;

    /* "petsc4py/PETSc/DMStag.pyx":126
 *         # 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":128
 *         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":129
 *             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":130
 *         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, 130, __pyx_L1_error)
    __pyx_v_stype = __pyx_t_3;

    /* "petsc4py/PETSc/DMStag.pyx":129
 *             swidth = asInt(stencil_width)
 *         cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_NONE
 *         if stencil_type is not None:             # <<<<<<<<<<<<<<
 *             stype = asStagStencil(stencil_type)
 * 
*/
  }

  /* "petsc4py/PETSc/DMStag.pyx":133
 * 
 *         # 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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(58, 133, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_4;

  /* "petsc4py/PETSc/DMStag.pyx":136
 * 
 *         # 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":137
 *         # 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":138
 *         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":139
 *         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, 139, __pyx_L1_error)
    __pyx_v_nprocs = __pyx_t_1;

    /* "petsc4py/PETSc/DMStag.pyx":140
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(58, 140, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(58, 140, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/DMStag.pyx":138
 *         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":143
 * 
 *         # 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":144
 *         # 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":145
 *         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, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_nranges = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "petsc4py/PETSc/DMStag.pyx":146
 *         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_PyLong_From_PetscInt(__pyx_v_ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 146, __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, 146, __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, 146, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) {
        __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
        __PYX_ERR(58, 146, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(58, 146, __pyx_L1_error)
    #endif

    /* "petsc4py/PETSc/DMStag.pyx":144
 *         # 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":149
 * 
 *         # 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":150
 *         # 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_PyLong_BoolEqObjC(__pyx_v_dim, __pyx_mstate_global->__pyx_int_1, 1, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(58, 150, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/DMStag.pyx":151
 *         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, 151, __pyx_L1_error)

    /* "petsc4py/PETSc/DMStag.pyx":150
 *         # 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":152
 *         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_PyLong_BoolEqObjC(__pyx_v_dim, __pyx_mstate_global->__pyx_int_2, 2, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(58, 152, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/DMStag.pyx":153
 *             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, 153, __pyx_L1_error)

    /* "petsc4py/PETSc/DMStag.pyx":152
 *         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":154
 *         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_PyLong_BoolEqObjC(__pyx_v_dim, __pyx_mstate_global->__pyx_int_3, 3, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(58, 154, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/DMStag.pyx":155
 *             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, 155, __pyx_L1_error)

    /* "petsc4py/PETSc/DMStag.pyx":154
 *         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":156
 *         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, 156, __pyx_L1_error)
  __pyx_v_self->__pyx_base.dm = __pyx_v_newda;

  /* "petsc4py/PETSc/DMStag.pyx":157
 *             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, 157, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/DMStag.pyx":158
 *         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, 158, __pyx_L1_error)

    /* "petsc4py/PETSc/DMStag.pyx":157
 *             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":159
 *         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":50
 *     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":163
 *     # 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:163");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_3setStencilWidth = {"setStencilWidth", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_3setStencilWidth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_2setStencilWidth};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_swidth,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 163, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 163, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setStencilWidth", 0) < (0)) __PYX_ERR(58, 163, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setStencilWidth", 1, 1, 1, i); __PYX_ERR(58, 163, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 163, __pyx_L3_error)
    }
    __pyx_v_swidth = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setStencilWidth", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 163, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMStag.pyx":180
 * 
 *         """
 *         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, 180, __pyx_L1_error)
  __pyx_v_sw = __pyx_t_1;

  /* "petsc4py/PETSc/DMStag.pyx":181
 *         """
 *         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, 181, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":163
 *     # 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":183
 *         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:183");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_5setStencilType = {"setStencilType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_5setStencilType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_4setStencilType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_stenciltype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 183, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 183, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setStencilType", 0) < (0)) __PYX_ERR(58, 183, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setStencilType", 1, 1, 1, i); __PYX_ERR(58, 183, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 183, __pyx_L3_error)
    }
    __pyx_v_stenciltype = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setStencilType", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 183, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMStag.pyx":198
 * 
 *         """
 *         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, 198, __pyx_L1_error)
  __pyx_v_stype = __pyx_t_1;

  /* "petsc4py/PETSc/DMStag.pyx":199
 *         """
 *         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, 199, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":183
 *         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":201
 *         CHKERR(DMStagSetStencilType(self.dm, stype))
 * 
 *     def setBoundaryTypes(             # <<<<<<<<<<<<<<
 *         self,
 *         boundary_types: tuple[DM.BoundaryType | int | str | bool, ...]) -> None:
*/

/* 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:201");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_7setBoundaryTypes = {"setBoundaryTypes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_7setBoundaryTypes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_6setBoundaryTypes};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_boundary_types,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 201, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 201, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setBoundaryTypes", 0) < (0)) __PYX_ERR(58, 201, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setBoundaryTypes", 1, 1, 1, i); __PYX_ERR(58, 201, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 201, __pyx_L3_error)
    }
    __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, 201, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMStag.pyx":218
 * 
 *         """
 *         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":219
 *         """
 *         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":220
 *         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":221
 *         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, 221, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":222
 *         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, 222, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":201
 *         CHKERR(DMStagSetStencilType(self.dm, stype))
 * 
 *     def setBoundaryTypes(             # <<<<<<<<<<<<<<
 *         self,
 *         boundary_types: tuple[DM.BoundaryType | int | str | bool, ...]) -> None:
*/

  /* 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":224
 *         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:224");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_9setDof = {"setDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_9setDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_8setDof};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dofs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 224, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 224, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDof", 0) < (0)) __PYX_ERR(58, 224, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDof", 1, 1, 1, i); __PYX_ERR(58, 224, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 224, __pyx_L3_error)
    }
    __pyx_v_dofs = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setDof", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 224, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  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", 0);

  /* "petsc4py/PETSc/DMStag.pyx":241
 * 
 *         """
 *         cdef tuple gdofs = tuple(dofs)             # <<<<<<<<<<<<<<
 *         cdef PetscInt dof0=1, dof1=0, dof2=0, dof3=0
 *         asDofs(gdofs, &dof0, &dof1, &dof2, &dof3)
*/
  __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_dofs); if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_gdofs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":242
 *         """
 *         cdef tuple gdofs = tuple(dofs)
 *         cdef PetscInt dof0=1, dof1=0, dof2=0, dof3=0             # <<<<<<<<<<<<<<
 *         asDofs(gdofs, &dof0, &dof1, &dof2, &dof3)
 *         CHKERR(DMStagSetDOF(self.dm, dof0, dof1, dof2, dof3))
*/
  __pyx_v_dof0 = 1;
  __pyx_v_dof1 = 0;
  __pyx_v_dof2 = 0;
  __pyx_v_dof3 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":243
 *         cdef tuple gdofs = tuple(dofs)
 *         cdef PetscInt dof0=1, dof1=0, dof2=0, dof3=0
 *         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, 243, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":244
 *         cdef PetscInt dof0=1, dof1=0, dof2=0, dof3=0
 *         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, 244, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":224
 *         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":246
 *         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:246");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_11setGlobalSizes = {"setGlobalSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_11setGlobalSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_10setGlobalSizes};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sizes,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 246, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 246, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setGlobalSizes", 0) < (0)) __PYX_ERR(58, 246, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setGlobalSizes", 1, 1, 1, i); __PYX_ERR(58, 246, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 246, __pyx_L3_error)
    }
    __pyx_v_sizes = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setGlobalSizes", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 246, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  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", 0);

  /* "petsc4py/PETSc/DMStag.pyx":261
 * 
 *         """
 *         cdef tuple gsizes = tuple(sizes)             # <<<<<<<<<<<<<<
 *         cdef PetscInt M=1, N=1, P=1
 *         asStagDims(gsizes, &M, &N, &P)
*/
  __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_sizes); if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_gsizes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":262
 *         """
 *         cdef tuple gsizes = tuple(sizes)
 *         cdef PetscInt M=1, N=1, P=1             # <<<<<<<<<<<<<<
 *         asStagDims(gsizes, &M, &N, &P)
 *         CHKERR(DMStagSetGlobalSizes(self.dm, M, N, P))
*/
  __pyx_v_M = 1;
  __pyx_v_N = 1;
  __pyx_v_P = 1;

  /* "petsc4py/PETSc/DMStag.pyx":263
 *         cdef tuple gsizes = tuple(sizes)
 *         cdef PetscInt M=1, N=1, P=1
 *         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, 263, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":264
 *         cdef PetscInt M=1, N=1, P=1
 *         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, 264, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":246
 *         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":266
 *         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:266");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_13setProcSizes = {"setProcSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_13setProcSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_12setProcSizes};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sizes,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 266, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 266, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setProcSizes", 0) < (0)) __PYX_ERR(58, 266, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setProcSizes", 1, 1, 1, i); __PYX_ERR(58, 266, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 266, __pyx_L3_error)
    }
    __pyx_v_sizes = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setProcSizes", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 266, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  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", 0);

  /* "petsc4py/PETSc/DMStag.pyx":281
 * 
 *         """
 *         cdef tuple psizes = tuple(sizes)             # <<<<<<<<<<<<<<
 *         cdef PetscInt m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE
 *         asStagDims(psizes, &m, &n, &p)
*/
  __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_sizes); if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_psizes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":282
 *         """
 *         cdef tuple psizes = tuple(sizes)
 *         cdef PetscInt m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE             # <<<<<<<<<<<<<<
 *         asStagDims(psizes, &m, &n, &p)
 *         CHKERR(DMStagSetNumRanks(self.dm, m, n, p))
*/
  __pyx_v_m = PETSC_DECIDE;
  __pyx_v_n = PETSC_DECIDE;
  __pyx_v_p = PETSC_DECIDE;

  /* "petsc4py/PETSc/DMStag.pyx":283
 *         cdef tuple psizes = tuple(sizes)
 *         cdef PetscInt m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE
 *         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, 283, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":284
 *         cdef PetscInt m=PETSC_DECIDE, n=PETSC_DECIDE, p=PETSC_DECIDE
 *         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, 284, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":266
 *         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":286
 *         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:286");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_15setOwnershipRanges = {"setOwnershipRanges", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_15setOwnershipRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_14setOwnershipRanges};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ranges,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 286, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 286, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOwnershipRanges", 0) < (0)) __PYX_ERR(58, 286, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setOwnershipRanges", 1, 1, 1, i); __PYX_ERR(58, 286, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 286, __pyx_L3_error)
    }
    __pyx_v_ranges = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setOwnershipRanges", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 286, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  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", 0);

  /* "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))
*/
  __pyx_v_dim = 0;
  __pyx_v_m = PETSC_DECIDE;
  __pyx_v_n = PETSC_DECIDE;
  __pyx_v_p = PETSC_DECIDE;

  /* "petsc4py/PETSc/DMStag.pyx":302
 *         """
 *         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":303
 *         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))
 *         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, 303, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":304
 *         cdef PetscInt *lx = NULL, *ly = NULL, *lz = NULL
 *         CHKERR(DMGetDimension(self.dm, &dim))
 *         CHKERR(DMStagGetNumRanks(self.dm, &m, &n, &p))             # <<<<<<<<<<<<<<
 *         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, 304, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":305
 *         CHKERR(DMGetDimension(self.dm, &dim))
 *         CHKERR(DMStagGetNumRanks(self.dm, &m, &n, &p))
 *         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, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":306
 *         CHKERR(DMStagGetNumRanks(self.dm, &m, &n, &p))
 *         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, 306, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":286
 *         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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMStag.pyx":310
 *     # 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:310");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_17getDim = {"getDim", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_17getDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_16getDim};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDim", __pyx_kwds); 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDim", 0);

  /* "petsc4py/PETSc/DMStag.pyx":316
 * 
 *         """
 *         return self.getDimension()             # <<<<<<<<<<<<<<
 * 
 *     def getEntriesPerElement(self) -> int:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getDimension, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":310
 *     # 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_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":318
 *         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:318");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_19getEntriesPerElement = {"getEntriesPerElement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_19getEntriesPerElement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_18getEntriesPerElement};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getEntriesPerElement", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMStag.pyx":330
 * 
 *         """
 *         cdef PetscInt epe=0             # <<<<<<<<<<<<<<
 *         CHKERR(DMStagGetEntriesPerElement(self.dm, &epe))
 *         return toInt(epe)
*/
  __pyx_v_epe = 0;

  /* "petsc4py/PETSc/DMStag.pyx":331
 *         """
 *         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, 331, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":332
 *         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, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":318
 *         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":334
 *         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:334");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_21getStencilWidth = {"getStencilWidth", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_21getStencilWidth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_20getStencilWidth};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getStencilWidth", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMStag.pyx":344
 * 
 *         """
 *         cdef PetscInt swidth=0             # <<<<<<<<<<<<<<
 *         CHKERR(DMStagGetStencilWidth(self.dm, &swidth))
 *         return toInt(swidth)
*/
  __pyx_v_swidth = 0;

  /* "petsc4py/PETSc/DMStag.pyx":345
 *         """
 *         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, 345, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":346
 *         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, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":334
 *         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":348
 *         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:348");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_23getDof = {"getDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_23getDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_22getDof};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDof", __pyx_kwds); 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", 0);

  /* "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))
*/
  __pyx_v_dim = 0;
  __pyx_v_dof0 = 0;
  __pyx_v_dof1 = 0;
  __pyx_v_dof2 = 0;
  __pyx_v_dof3 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":359
 *         """
 *         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, 359, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":360
 *         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, 360, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":361
 *         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, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":348
 *         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":363
 *         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:363");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_25getCorners = {"getCorners", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_25getCorners, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_24getCorners};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCorners", __pyx_kwds); 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", 0);

  /* "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))
*/
  __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":381
 *         """
 *         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))[:<Py_ssize_t>dim], (asInt(m), asInt(n), asInt(p))[:<Py_ssize_t>dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:<Py_ssize_t>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, 381, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":382
 *         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))[:<Py_ssize_t>dim], (asInt(m), asInt(n), asInt(p))[:<Py_ssize_t>dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:<Py_ssize_t>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, 382, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":383
 *         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))[:<Py_ssize_t>dim], (asInt(m), asInt(n), asInt(p))[:<Py_ssize_t>dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:<Py_ssize_t>dim]             # <<<<<<<<<<<<<<
 * 
 *     def getGhostCorners(self) -> tuple[tuple[int, ...], tuple[int, ...]]:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_PetscInt(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 383, __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, 383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyLong_From_PetscInt(__pyx_v_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 383, __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, 383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_PetscInt(__pyx_v_z); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 383, __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, 383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyLong_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 383, __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) != (0)) __PYX_ERR(58, 383, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4) != (0)) __PYX_ERR(58, 383, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5) != (0)) __PYX_ERR(58, 383, __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, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyLong_From_PetscInt(__pyx_v_m); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 383, __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, 383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyLong_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyLong_From_PetscInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 383, __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, 383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyLong_From_PetscInt(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 383, __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, 383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(58, 383, __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) != (0)) __PYX_ERR(58, 383, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4) != (0)) __PYX_ERR(58, 383, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2) != (0)) __PYX_ERR(58, 383, __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, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyLong_From_PetscInt(__pyx_v_nExtrax); if (unlikely(!__pyx_t_7)) __PYX_ERR(58, 383, __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, 383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyLong_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(58, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyLong_From_PetscInt(__pyx_v_nExtray); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 383, __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, 383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyLong_From_PetscInt(__pyx_v_nExtraz); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 383, __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, 383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyLong_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(58, 383, __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) != (0)) __PYX_ERR(58, 383, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4) != (0)) __PYX_ERR(58, 383, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6) != (0)) __PYX_ERR(58, 383, __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, 383, __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, 383, __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) != (0)) __PYX_ERR(58, 383, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2) != (0)) __PYX_ERR(58, 383, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6) != (0)) __PYX_ERR(58, 383, __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":363
 *         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":385
 *         return (asInt(x), asInt(y), asInt(z))[:<Py_ssize_t>dim], (asInt(m), asInt(n), asInt(p))[:<Py_ssize_t>dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:<Py_ssize_t>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:385");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_27getGhostCorners = {"getGhostCorners", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_27getGhostCorners, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_26getGhostCorners};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getGhostCorners", __pyx_kwds); 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", 0);

  /* "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))
*/
  __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":396
 *         """
 *         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))[:<Py_ssize_t>dim], (asInt(m), asInt(n), asInt(p))[:<Py_ssize_t>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, 396, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":397
 *         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))[:<Py_ssize_t>dim], (asInt(m), asInt(n), asInt(p))[:<Py_ssize_t>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, 397, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":398
 *         CHKERR(DMGetDimension(self.dm, &dim))
 *         CHKERR(DMStagGetGhostCorners(self.dm, &x, &y, &z, &m, &n, &p))
 *         return (asInt(x), asInt(y), asInt(z))[:<Py_ssize_t>dim], (asInt(m), asInt(n), asInt(p))[:<Py_ssize_t>dim]             # <<<<<<<<<<<<<<
 * 
 *     def getLocalSizes(self) -> tuple[int, ...]:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_PetscInt(__pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 398, __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, 398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyLong_From_PetscInt(__pyx_v_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 398, __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, 398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_PetscInt(__pyx_v_z); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 398, __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, 398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyLong_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 398, __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) != (0)) __PYX_ERR(58, 398, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4) != (0)) __PYX_ERR(58, 398, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5) != (0)) __PYX_ERR(58, 398, __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, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyLong_From_PetscInt(__pyx_v_m); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 398, __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, 398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyLong_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(58, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyLong_From_PetscInt(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 398, __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, 398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyLong_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyLong_From_PetscInt(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 398, __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, 398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyLong_From_PetscInt(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(58, 398, __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) != (0)) __PYX_ERR(58, 398, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4) != (0)) __PYX_ERR(58, 398, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2) != (0)) __PYX_ERR(58, 398, __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, 398, __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, 398, __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) != (0)) __PYX_ERR(58, 398, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2) != (0)) __PYX_ERR(58, 398, __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":385
 *         return (asInt(x), asInt(y), asInt(z))[:<Py_ssize_t>dim], (asInt(m), asInt(n), asInt(p))[:<Py_ssize_t>dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:<Py_ssize_t>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":400
 *         return (asInt(x), asInt(y), asInt(z))[:<Py_ssize_t>dim], (asInt(m), asInt(n), asInt(p))[:<Py_ssize_t>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:400");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_29getLocalSizes = {"getLocalSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_29getLocalSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_28getLocalSizes};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLocalSizes", __pyx_kwds); 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", 0);

  /* "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))
*/
  __pyx_v_dim = 0;
  __pyx_v_m = PETSC_DECIDE;
  __pyx_v_n = PETSC_DECIDE;
  __pyx_v_p = PETSC_DECIDE;

  /* "petsc4py/PETSc/DMStag.pyx":413
 *         """
 *         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, 413, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":414
 *         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, 414, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":415
 *         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, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":400
 *         return (asInt(x), asInt(y), asInt(z))[:<Py_ssize_t>dim], (asInt(m), asInt(n), asInt(p))[:<Py_ssize_t>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":417
 *         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:417");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_31getGlobalSizes = {"getGlobalSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_31getGlobalSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_30getGlobalSizes};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getGlobalSizes", __pyx_kwds); 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", 0);

  /* "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))
*/
  __pyx_v_dim = 0;
  __pyx_v_m = PETSC_DECIDE;
  __pyx_v_n = PETSC_DECIDE;
  __pyx_v_p = PETSC_DECIDE;

  /* "petsc4py/PETSc/DMStag.pyx":428
 *         """
 *         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, 428, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":429
 *         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, 429, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":430
 *         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, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":417
 *         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":432
 *         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:432");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_33getProcSizes = {"getProcSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_33getProcSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_32getProcSizes};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getProcSizes", __pyx_kwds); 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", 0);

  /* "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))
*/
  __pyx_v_dim = 0;
  __pyx_v_m = PETSC_DECIDE;
  __pyx_v_n = PETSC_DECIDE;
  __pyx_v_p = PETSC_DECIDE;

  /* "petsc4py/PETSc/DMStag.pyx":443
 *         """
 *         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, 443, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":444
 *         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, 444, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":445
 *         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, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":432
 *         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":447
 *         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:447");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_35getStencilType = {"getStencilType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_35getStencilType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_34getStencilType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getStencilType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMStag.pyx":457
 * 
 *         """
 *         cdef PetscDMStagStencilType stype = DMSTAG_STENCIL_BOX             # <<<<<<<<<<<<<<
 *         CHKERR(DMStagGetStencilType(self.dm, &stype))
 *         return toStagStencil(stype)
*/
  __pyx_v_stype = DMSTAG_STENCIL_BOX;

  /* "petsc4py/PETSc/DMStag.pyx":458
 *         """
 *         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, 458, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":459
 *         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, 459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":447
 *         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":461
 *         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:461");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_37getOwnershipRanges = {"getOwnershipRanges", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_37getOwnershipRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_36getOwnershipRanges};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOwnershipRanges", __pyx_kwds); 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", 0);

  /* "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))
*/
  __pyx_v_dim = 0;
  __pyx_v_m = 0;
  __pyx_v_n = 0;
  __pyx_v_p = 0;

  /* "petsc4py/PETSc/DMStag.pyx":472
 *         """
 *         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":473
 *         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, 473, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":474
 *         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, 474, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":475
 *         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, 475, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":476
 *         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, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":461
 *         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":478
 *         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:478");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_39getBoundaryTypes = {"getBoundaryTypes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_39getBoundaryTypes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_38getBoundaryTypes};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBoundaryTypes", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMStag.pyx":488
 * 
 *         """
 *         cdef PetscInt dim=0             # <<<<<<<<<<<<<<
 *         cdef PetscDMBoundaryType btx = DM_BOUNDARY_NONE
 *         cdef PetscDMBoundaryType bty = DM_BOUNDARY_NONE
*/
  __pyx_v_dim = 0;

  /* "petsc4py/PETSc/DMStag.pyx":489
 *         """
 *         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":490
 *         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":491
 *         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":492
 *         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, 492, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":493
 *         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, 493, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":494
 *         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, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":478
 *         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":496
 *         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:496");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_41getIsFirstRank = {"getIsFirstRank", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_41getIsFirstRank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_40getIsFirstRank};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getIsFirstRank", __pyx_kwds); 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", 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))
*/
  __pyx_v_rank0 = PETSC_FALSE;
  __pyx_v_rank1 = PETSC_FALSE;
  __pyx_v_rank2 = PETSC_FALSE;

  /* "petsc4py/PETSc/DMStag.pyx":507
 *         """
 *         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":508
 *         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, 508, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":509
 *         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, 509, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":510
 *         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, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":496
 *         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":512
 *         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:512");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_43getIsLastRank = {"getIsLastRank", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_43getIsLastRank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_42getIsLastRank};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getIsLastRank", __pyx_kwds); 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", 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))
*/
  __pyx_v_rank0 = PETSC_FALSE;
  __pyx_v_rank1 = PETSC_FALSE;
  __pyx_v_rank2 = PETSC_FALSE;

  /* "petsc4py/PETSc/DMStag.pyx":523
 *         """
 *         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":524
 *         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, 524, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":525
 *         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, 525, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":526
 *         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, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":512
 *         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":530
 *     # 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:530");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_45setUniformCoordinatesExplicit = {"setUniformCoordinatesExplicit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_45setUniformCoordinatesExplicit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_44setUniformCoordinatesExplicit};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_xmin,&__pyx_mstate_global->__pyx_n_u_xmax,&__pyx_mstate_global->__pyx_n_u_ymin,&__pyx_mstate_global->__pyx_n_u_ymax,&__pyx_mstate_global->__pyx_n_u_zmin,&__pyx_mstate_global->__pyx_n_u_zmax,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 530, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(58, 530, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(58, 530, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(58, 530, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(58, 530, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(58, 530, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 530, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setUniformCoordinatesExplicit", 0) < (0)) __PYX_ERR(58, 530, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(58, 530, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(58, 530, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(58, 530, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(58, 530, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(58, 530, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 530, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
    }
    __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, 530, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "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)
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_v_xmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 563, __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, 563, __pyx_L1_error)
  __pyx_v__xmax = __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_ymin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 564, __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, 564, __pyx_L1_error)
  __pyx_v__ymax = __pyx_t_1;

  /* "petsc4py/PETSc/DMStag.pyx":565
 *         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, 565, __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, 565, __pyx_L1_error)
  __pyx_v__zmax = __pyx_t_1;

  /* "petsc4py/PETSc/DMStag.pyx":566
 *         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, 566, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":530
 *     # 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":568
 *         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:568");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_47setUniformCoordinatesProduct = {"setUniformCoordinatesProduct", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_47setUniformCoordinatesProduct, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_46setUniformCoordinatesProduct};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_xmin,&__pyx_mstate_global->__pyx_n_u_xmax,&__pyx_mstate_global->__pyx_n_u_ymin,&__pyx_mstate_global->__pyx_n_u_ymax,&__pyx_mstate_global->__pyx_n_u_zmin,&__pyx_mstate_global->__pyx_n_u_zmax,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 568, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(58, 568, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(58, 568, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(58, 568, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(58, 568, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(58, 568, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 568, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setUniformCoordinatesProduct", 0) < (0)) __PYX_ERR(58, 568, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(58, 568, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(58, 568, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(58, 568, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(58, 568, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(58, 568, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 568, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
    }
    __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, 568, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "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":568
 *         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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_49setUniformCoordinates = {"setUniformCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_49setUniformCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_48setUniformCoordinates};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_xmin,&__pyx_mstate_global->__pyx_n_u_xmax,&__pyx_mstate_global->__pyx_n_u_ymin,&__pyx_mstate_global->__pyx_n_u_ymax,&__pyx_mstate_global->__pyx_n_u_zmin,&__pyx_mstate_global->__pyx_n_u_zmax,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 610, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(58, 610, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(58, 610, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(58, 610, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(58, 610, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(58, 610, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 610, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setUniformCoordinates", 0) < (0)) __PYX_ERR(58, 610, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(58, 610, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(58, 610, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(58, 610, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(58, 610, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(58, 610, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 610, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_0));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_int_1));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMStag.pyx":652
 * 
 *         """
 *         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, 652, __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, 652, __pyx_L1_error)
  __pyx_v__xmax = __pyx_t_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)
 *         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, 653, __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, 653, __pyx_L1_error)
  __pyx_v__ymax = __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_zmin); if (unlikely(__pyx_t_1 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(58, 654, __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, 654, __pyx_L1_error)
  __pyx_v__zmax = __pyx_t_1;

  /* "petsc4py/PETSc/DMStag.pyx":655
 *         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, 655, __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":657
 *         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:657");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_51setCoordinateDMType = {"setCoordinateDMType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_51setCoordinateDMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_50setCoordinateDMType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dmtype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 657, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 657, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCoordinateDMType", 0) < (0)) __PYX_ERR(58, 657, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCoordinateDMType", 1, 1, 1, i); __PYX_ERR(58, 657, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 657, __pyx_L3_error)
    }
    __pyx_v_dmtype = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setCoordinateDMType", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 657, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":672
 * 
 *         """
 *         cdef PetscDMType cval = NULL             # <<<<<<<<<<<<<<
 *         dmtype = str2bytes(dmtype, &cval)
 *         CHKERR(DMStagSetCoordinateDMType(self.dm, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DMStag.pyx":673
 *         """
 *         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, 673, __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":674
 *         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, 674, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":657
 *         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":678
 *     # 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:678");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_53getLocationSlot = {"getLocationSlot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_53getLocationSlot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_52getLocationSlot};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_loc,&__pyx_mstate_global->__pyx_n_u_c,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 678, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(58, 678, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 678, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getLocationSlot", 0) < (0)) __PYX_ERR(58, 678, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getLocationSlot", 1, 2, 2, i); __PYX_ERR(58, 678, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 678, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(58, 678, __pyx_L3_error)
    }
    __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, 678, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMStag.pyx":695
 * 
 *         """
 *         cdef PetscInt slot=0             # <<<<<<<<<<<<<<
 *         cdef PetscInt comp=asInt(c)
 *         cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc)
*/
  __pyx_v_slot = 0;

  /* "petsc4py/PETSc/DMStag.pyx":696
 *         """
 *         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, 696, __pyx_L1_error)
  __pyx_v_comp = __pyx_t_1;

  /* "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))
 *         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, 697, __pyx_L1_error)
  __pyx_v_sloc = __pyx_t_2;

  /* "petsc4py/PETSc/DMStag.pyx":698
 *         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, 698, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":699
 *         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, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":678
 *     # 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":701
 *         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:701");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_55getProductCoordinateLocationSlot = {"getProductCoordinateLocationSlot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_55getProductCoordinateLocationSlot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_54getProductCoordinateLocationSlot};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_loc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 701, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 701, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getProductCoordinateLocationSlot", 0) < (0)) __PYX_ERR(58, 701, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getProductCoordinateLocationSlot", 1, 1, 1, i); __PYX_ERR(58, 701, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 701, __pyx_L3_error)
    }
    __pyx_v_loc = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getProductCoordinateLocationSlot", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 701, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMStag.pyx":716
 * 
 *         """
 *         cdef PetscInt slot=0             # <<<<<<<<<<<<<<
 *         cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc)
 *         CHKERR(DMStagGetProductCoordinateLocationSlot(self.dm, sloc, &slot))
*/
  __pyx_v_slot = 0;

  /* "petsc4py/PETSc/DMStag.pyx":717
 *         """
 *         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, 717, __pyx_L1_error)
  __pyx_v_sloc = __pyx_t_1;

  /* "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_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, 718, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":719
 *         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, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":701
 *         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":721
 *         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:721");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_57getLocationDof = {"getLocationDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_57getLocationDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_56getLocationDof};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_loc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 721, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 721, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getLocationDof", 0) < (0)) __PYX_ERR(58, 721, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getLocationDof", 1, 1, 1, i); __PYX_ERR(58, 721, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 721, __pyx_L3_error)
    }
    __pyx_v_loc = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getLocationDof", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 721, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMStag.pyx":736
 * 
 *         """
 *         cdef PetscInt dof=0             # <<<<<<<<<<<<<<
 *         cdef PetscDMStagStencilLocation sloc = asStagStencilLocation(loc)
 *         CHKERR(DMStagGetLocationDOF(self.dm, sloc, &dof))
*/
  __pyx_v_dof = 0;

  /* "petsc4py/PETSc/DMStag.pyx":737
 *         """
 *         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, 737, __pyx_L1_error)
  __pyx_v_sloc = __pyx_t_1;

  /* "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_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, 738, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":739
 *         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, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":721
 *         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":743
 *     # 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:743");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_59migrateVec = {"migrateVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_59migrateVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_58migrateVec};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,&__pyx_mstate_global->__pyx_n_u_dmTo,&__pyx_mstate_global->__pyx_n_u_vecTo,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 743, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(58, 743, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(58, 743, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 743, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "migrateVec", 0) < (0)) __PYX_ERR(58, 743, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("migrateVec", 1, 3, 3, i); __PYX_ERR(58, 743, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 743, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(58, 743, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(58, 743, __pyx_L3_error)
    }
    __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, 743, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(58, 743, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmTo), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dmTo", 0))) __PYX_ERR(58, 743, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_vecTo), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vecTo", 0))) __PYX_ERR(58, 743, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/DMStag.pyx":764
 * 
 *         """
 *         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, 764, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":743
 *     # 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":766
 *         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:766");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_61createCompatibleDMStag = {"createCompatibleDMStag", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_61createCompatibleDMStag, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_60createCompatibleDMStag};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dofs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 766, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 766, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createCompatibleDMStag", 0) < (0)) __PYX_ERR(58, 766, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createCompatibleDMStag", 1, 1, 1, i); __PYX_ERR(58, 766, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 766, __pyx_L3_error)
    }
    __pyx_v_dofs = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createCompatibleDMStag", 1, 1, 1, __pyx_nargs); __PYX_ERR(58, 766, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createCompatibleDMStag", 0);

  /* "petsc4py/PETSc/DMStag.pyx":781
 * 
 *         """
 *         cdef tuple gdofs = tuple(dofs)             # <<<<<<<<<<<<<<
 *         cdef PetscInt dof0=1, dof1=0, dof2=0, dof3=0
 *         asDofs(gdofs, &dof0, &dof1, &dof2, &dof3)
*/
  __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_dofs); if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_gdofs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":782
 *         """
 *         cdef tuple gdofs = tuple(dofs)
 *         cdef PetscInt dof0=1, dof1=0, dof2=0, dof3=0             # <<<<<<<<<<<<<<
 *         asDofs(gdofs, &dof0, &dof1, &dof2, &dof3)
 *         cdef PetscDM newda = NULL
*/
  __pyx_v_dof0 = 1;
  __pyx_v_dof1 = 0;
  __pyx_v_dof2 = 0;
  __pyx_v_dof3 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":783
 *         cdef tuple gdofs = tuple(dofs)
 *         cdef PetscInt dof0=1, dof1=0, dof2=0, dof3=0
 *         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, 783, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":784
 *         cdef PetscInt dof0=1, dof1=0, dof2=0, dof3=0
 *         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":785
 *         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, 785, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":786
 *         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_t_4 = NULL;
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
  __pyx_t_5 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); 
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_4);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(58, 786, __pyx_L1_error)
  __pyx_v_newdm = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":787
 *         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, 787, __pyx_L1_error)
  __pyx_v_newdm->dm = __pyx_v_newda;

  /* "petsc4py/PETSc/DMStag.pyx":788
 *         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":766
 *         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":790
 *         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:790");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_63VecSplitToDMDA = {"VecSplitToDMDA", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_63VecSplitToDMDA, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_62VecSplitToDMDA};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,&__pyx_mstate_global->__pyx_n_u_loc,&__pyx_mstate_global->__pyx_n_u_c,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 790, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(58, 790, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(58, 790, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 790, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "VecSplitToDMDA", 0) < (0)) __PYX_ERR(58, 790, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("VecSplitToDMDA", 1, 3, 3, i); __PYX_ERR(58, 790, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 790, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(58, 790, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(58, 790, __pyx_L3_error)
    }
    __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, 790, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(58, 792, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("VecSplitToDMDA", 0);

  /* "petsc4py/PETSc/DMStag.pyx":817
 * 
 *         """
 *         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, 817, __pyx_L1_error)
  __pyx_v_pc = __pyx_t_1;

  /* "petsc4py/PETSc/DMStag.pyx":818
 *         """
 *         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, 818, __pyx_L1_error)
  __pyx_v_sloc = __pyx_t_2;

  /* "petsc4py/PETSc/DMStag.pyx":819
 *         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":820
 *         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":821
 *         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, 821, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":822
 *         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_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 822, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __pyx_v_da = ((struct PyPetscDMObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":823
 *         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, 823, __pyx_L1_error)
  __pyx_v_da->dm = __pyx_v_pda;

  /* "petsc4py/PETSc/DMStag.pyx":824
 *         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_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 824, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __pyx_v_davec = ((struct PyPetscVecObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":825
 *         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, 825, __pyx_L1_error)
  __pyx_v_davec->vec = __pyx_v_pdavec;

  /* "petsc4py/PETSc/DMStag.pyx":826
 *         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, 826, __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)) != (0)) __PYX_ERR(58, 826, __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)) != (0)) __PYX_ERR(58, 826, __pyx_L1_error);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":790
 *         return newdm
 * 
 *     def VecSplitToDMDA(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec vec,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":828
 *         return (da, davec)
 * 
 *     def getVecArray(self, Vec vec) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         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\nNot implemented.\nSource code at petsc4py/PETSc/DMStag.pyx:828");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_65getVecArray = {"getVecArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_65getVecArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_64getVecArray};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(58, 828, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 828, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getVecArray", 0) < (0)) __PYX_ERR(58, 828, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getVecArray", 1, 1, 1, i); __PYX_ERR(58, 828, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(58, 828, __pyx_L3_error)
    }
    __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, 828, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(58, 828, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getVecArray", 0);

  /* "petsc4py/PETSc/DMStag.pyx":830
 *     def getVecArray(self, Vec vec) -> None:
 *         """Not implemented."""
 *         raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py')             # <<<<<<<<<<<<<<
 * 
 *     def get1dCoordinatecArrays(self) -> None:
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_getVecArray_for_DMStag_not_yet_i};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 830, __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, 830, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":828
 *         return (da, davec)
 * 
 *     def getVecArray(self, Vec vec) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":832
 *         raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py')
 * 
 *     def get1dCoordinatecArrays(self) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         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\nNot implemented.\nSource code at petsc4py/PETSc/DMStag.pyx:832");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6DMStag_67get1dCoordinatecArrays = {"get1dCoordinatecArrays", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_67get1dCoordinatecArrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_66get1dCoordinatecArrays};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get1dCoordinatecArrays", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get1dCoordinatecArrays", 0);

  /* "petsc4py/PETSc/DMStag.pyx":834
 *     def get1dCoordinatecArrays(self) -> None:
 *         """Not implemented."""
 *         raise NotImplementedError('get1dCoordinatecArrays for DMStag not yet implemented in petsc4py')             # <<<<<<<<<<<<<<
 * 
 *     property dim:
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_get1dCoordinatecArrays_for_DMSta};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_NotImplementedError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 834, __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, 834, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":832
 *         raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py')
 * 
 *     def get1dCoordinatecArrays(self) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         raise NotImplementedError('get1dCoordinatecArrays for DMStag not yet implemented in petsc4py')
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":838
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMStag.pyx":839
 *         """The dimension."""
 *         def __get__(self) -> int:
 *             return self.getDim()             # <<<<<<<<<<<<<<
 * 
 *     property dofs:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getDim, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":838
 *     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_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":843
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMStag.pyx":844
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getDof, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 844, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":843
 *     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_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":848
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMStag.pyx":849
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getEntriesPerElement, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":848
 *     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_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":853
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMStag.pyx":854
 *         """Global element counts in each dimension."""
 *         def __get__(self) -> tuple[int, ...]:
 *             return self.getGlobalSizes()             # <<<<<<<<<<<<<<
 * 
 *     property local_sizes:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getGlobalSizes, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 854, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":853
 *     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_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":858
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMStag.pyx":859
 *         """Local elementwise sizes in each dimension."""
 *         def __get__(self) -> tuple[int, ...]:
 *             return self.getLocalSizes()             # <<<<<<<<<<<<<<
 * 
 *     property proc_sizes:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getLocalSizes, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 859, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":858
 *     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_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":863
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMStag.pyx":864
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getProcSizes, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":863
 *     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_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":868
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMStag.pyx":869
 *         """Boundary types in each dimension."""
 *         def __get__(self) -> tuple[str, ...]:
 *             return self.getBoundaryTypes()             # <<<<<<<<<<<<<<
 * 
 *     property stencil_type:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getBoundaryTypes, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":868
 *     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_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":873
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMStag.pyx":874
 *         """Stencil type."""
 *         def __get__(self) -> str:
 *             return self.getStencilType()             # <<<<<<<<<<<<<<
 * 
 *     property stencil_width:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getStencilType, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":873
 *     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_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":878
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMStag.pyx":879
 *         """Elementwise stencil width."""
 *         def __get__(self) -> int:
 *             return self.getStencilWidth()             # <<<<<<<<<<<<<<
 * 
 *     property corners:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getStencilWidth, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":878
 *     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_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":883
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMStag.pyx":884
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getCorners, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":883
 *     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_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":888
 *     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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "petsc4py/PETSc/DMStag.pyx":889
 *         """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 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getGhostCorners, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(58, 889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMStag.pyx":888
 *     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_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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11DMComposite_1create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(59, 6, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(59, 6, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(59, 6, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(59, 6, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "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 const )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))
*/
  __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
*/
  __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)

  /* "petsc4py/PETSc/DMComposite.pyx":25
 *         CHKERR(DMCompositeCreate(ccomm, &newdm))
 *         CHKERR(PetscCLEAR(self.obj))
 *         self.dm = newdm             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_v_self->__pyx_base.dm = __pyx_v_newdm;

  /* "petsc4py/PETSc/DMComposite.pyx":26
 *         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":28
 *         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:28");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11DMComposite_3addDM = {"addDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_3addDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_2addDM};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __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 ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(59, 28, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        default:
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(59, 28, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      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 (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, used_pos_args, __pyx_kwds_len, "addDM", 0) < (0)) __PYX_ERR(59, 28, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addDM", 0, 1, 1, i); __PYX_ERR(59, 28, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs < 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(59, 28, __pyx_L3_error)
    }
    __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, 28, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(59, 28, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_DECREF(__pyx_v_args);
  __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":45
 * 
 *         """
 *         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, 45, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":47
 *         CHKERR(DMCompositeAddDM(self.dm, dm.dm))
 *         cdef object item
 *         for item in args:             # <<<<<<<<<<<<<<
 *             dm = <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_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(59, 47, __pyx_L1_error)
      #endif
      if (__pyx_t_3 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
    #else
    __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
    #endif
    ++__pyx_t_3;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "petsc4py/PETSc/DMComposite.pyx":48
 *         cdef object item
 *         for item in args:
 *             dm = <DM?> item             # <<<<<<<<<<<<<<
 *             CHKERR(DMCompositeAddDM(self.dm, dm.dm))
 * 
*/
    if (!(likely(__Pyx_TypeTest(__pyx_v_item, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(59, 48, __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":49
 *         for item in args:
 *             dm = <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, 49, __pyx_L1_error)

    /* "petsc4py/PETSc/DMComposite.pyx":47
 *         CHKERR(DMCompositeAddDM(self.dm, dm.dm))
 *         cdef object item
 *         for item in args:             # <<<<<<<<<<<<<<
 *             dm = <DM?> item
 *             CHKERR(DMCompositeAddDM(self.dm, dm.dm))
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":28
 *         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":51
 *             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:51");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11DMComposite_5getNumber = {"getNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_5getNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_4getNumber};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNumber", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMComposite.pyx":61
 * 
 *         """
 *         cdef PetscInt n = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))
 *         return toInt(n)
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":62
 *         """
 *         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, 62, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":63
 *         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, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMComposite.pyx":51
 *             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":66
 *     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:66");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11DMComposite_7getEntries = {"getEntries", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_7getEntries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_6getEntries};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getEntries", __pyx_kwds); 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_unused = 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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getEntries", 0);

  /* "petsc4py/PETSc/DMComposite.pyx":76
 * 
 *         """
 *         cdef PetscInt i, n = 0             # <<<<<<<<<<<<<<
 *         cdef PetscDM *cdms = NULL
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":77
 *         """
 *         cdef PetscInt i, n = 0
 *         cdef PetscDM *cdms = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&cdms)
*/
  __pyx_v_cdms = NULL;

  /* "petsc4py/PETSc/DMComposite.pyx":78
 *         cdef PetscInt i, n = 0
 *         cdef PetscDM *cdms = NULL
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&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, 78, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":79
 *         cdef PetscDM *cdms = NULL
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&cdms)             # <<<<<<<<<<<<<<
 *         CHKERR(DMCompositeGetEntriesArray(self.dm, cdms))
 *         cdef DM entry = None
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_n))); if (unlikely(!__pyx_t_2)) __PYX_ERR(59, 79, __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, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":80
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&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, 80, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":81
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&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":82
 *         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, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_entries = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":83
 *         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":84
 *         cdef list entries = []
 *         for i from 0 <= i < n:
 *             entry = subtype_DM(cdms[i])()             # <<<<<<<<<<<<<<
 *             entry.dm = cdms[i]
 *             CHKERR(PetscINCREF(entry.obj))
*/
    __pyx_t_2 = NULL;
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM((__pyx_v_cdms[__pyx_v_i]))); if (unlikely(!__pyx_t_5)) __PYX_ERR(59, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(59, 84, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(59, 84, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_entry, ((struct PyPetscDMObject *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/DMComposite.pyx":85
 *         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":86
 *             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, 86, __pyx_L1_error)

    /* "petsc4py/PETSc/DMComposite.pyx":87
 *             entry.dm = cdms[i]
 *             CHKERR(PetscINCREF(entry.obj))
 *             entries.append(entry)             # <<<<<<<<<<<<<<
 *         return entries
 * 
*/
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_entries, ((PyObject *)__pyx_v_entry)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(59, 87, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DMComposite.pyx":88
 *             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":66
 *     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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("petsc4py.PETSc.DMComposite.getEntries", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF((PyObject *)__pyx_v_entry);
  __Pyx_XDECREF(__pyx_v_entries);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMComposite.pyx":90
 *         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:90");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11DMComposite_9scatter = {"scatter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_9scatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_8scatter};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gvec,&__pyx_mstate_global->__pyx_n_u_lvecs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(59, 90, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(59, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(59, 90, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "scatter", 0) < (0)) __PYX_ERR(59, 90, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("scatter", 1, 2, 2, i); __PYX_ERR(59, 90, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(59, 90, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(59, 90, __pyx_L3_error)
    }
    __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, 90, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(59, 90, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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_unused = 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", 0);

  /* "petsc4py/PETSc/DMComposite.pyx":107
 * 
 *         """
 *         cdef PetscInt i, n = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))
 *         cdef PetscVec *clvecs = NULL
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":108
 *         """
 *         cdef PetscInt i, n = 0
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))             # <<<<<<<<<<<<<<
 *         cdef PetscVec *clvecs = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&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, 108, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":109
 *         cdef PetscInt i, n = 0
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))
 *         cdef PetscVec *clvecs = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&clvecs)
 *         for i from 0 <= i < n:
*/
  __pyx_v_clvecs = NULL;

  /* "petsc4py/PETSc/DMComposite.pyx":110
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))
 *         cdef PetscVec *clvecs = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&clvecs)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < n:
 *             clvecs[i] = (<Vec?>lvecs[<Py_ssize_t>i]).vec
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_n))); if (unlikely(!__pyx_t_2)) __PYX_ERR(59, 110, __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, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":111
 *         cdef PetscVec *clvecs = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&clvecs)
 *         for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *             clvecs[i] = (<Vec?>lvecs[<Py_ssize_t>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":112
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&clvecs)
 *         for i from 0 <= i < n:
 *             clvecs[i] = (<Vec?>lvecs[<Py_ssize_t>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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(59, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(59, 112, __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":113
 *         for i from 0 <= i < n:
 *             clvecs[i] = (<Vec?>lvecs[<Py_ssize_t>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, 113, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":90
 *         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_unused);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMComposite.pyx":115
 *         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:115");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11DMComposite_11gather = {"gather", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_11gather, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_10gather};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gvec,&__pyx_mstate_global->__pyx_n_u_imode,&__pyx_mstate_global->__pyx_n_u_lvecs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(59, 115, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(59, 115, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(59, 115, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(59, 115, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "gather", 0) < (0)) __PYX_ERR(59, 115, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("gather", 1, 3, 3, i); __PYX_ERR(59, 115, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(59, 115, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(59, 115, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(59, 115, __pyx_L3_error)
    }
    __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, 115, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(59, 115, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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_unused = 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", 0);

  /* "petsc4py/PETSc/DMComposite.pyx":134
 * 
 *         """
 *         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, 134, __pyx_L1_error)
  __pyx_v_cimode = __pyx_t_1;

  /* "petsc4py/PETSc/DMComposite.pyx":135
 *         """
 *         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":136
 *         cdef PetscInsertMode cimode = insertmode(imode)
 *         cdef PetscInt i, n = 0
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))             # <<<<<<<<<<<<<<
 *         cdef PetscVec *clvecs = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&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, 136, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":137
 *         cdef PetscInt i, n = 0
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))
 *         cdef PetscVec *clvecs = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&clvecs)
 *         for i from 0 <= i < n:
*/
  __pyx_v_clvecs = NULL;

  /* "petsc4py/PETSc/DMComposite.pyx":138
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))
 *         cdef PetscVec *clvecs = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&clvecs)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < n:
 *             clvecs[i] = (<Vec?>lvecs[<Py_ssize_t>i]).vec
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(((PetscInt)__pyx_v_n))); if (unlikely(!__pyx_t_3)) __PYX_ERR(59, 138, __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, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_unused = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":139
 *         cdef PetscVec *clvecs = NULL
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&clvecs)
 *         for i from 0 <= i < n:             # <<<<<<<<<<<<<<
 *             clvecs[i] = (<Vec?>lvecs[<Py_ssize_t>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":140
 *         cdef object unused = oarray_p(empty_p(<PetscInt>n), NULL, <void**>&clvecs)
 *         for i from 0 <= i < n:
 *             clvecs[i] = (<Vec?>lvecs[<Py_ssize_t>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, PyLong_FromSsize_t, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(59, 140, __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":141
 *         for i from 0 <= i < n:
 *             clvecs[i] = (<Vec?>lvecs[<Py_ssize_t>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, 141, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":115
 *         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_unused);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMComposite.pyx":143
 *         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:143");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11DMComposite_13getGlobalISs = {"getGlobalISs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_13getGlobalISs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_12getGlobalISs};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getGlobalISs", __pyx_kwds); 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_9genexpr22__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", 0);

  /* "petsc4py/PETSc/DMComposite.pyx":160
 * 
 *         """
 *         cdef PetscInt i, n = 0             # <<<<<<<<<<<<<<
 *         cdef PetscIS *cis = NULL
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":161
 *         """
 *         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":162
 *         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, 162, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":163
 *         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, 163, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":164
 *         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, 164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_v_n;
    for (__pyx_9genexpr22__pyx_v_i = 0; __pyx_9genexpr22__pyx_v_i < __pyx_t_3; __pyx_9genexpr22__pyx_v_i++) {
      __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_cis[__pyx_9genexpr22__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(59, 164, __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":165
 *         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":166
 *         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, 166, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DMComposite.pyx":167
 *         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, 167, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":168
 *             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":143
 *         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":170
 *         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:170");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11DMComposite_15getLocalISs = {"getLocalISs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_15getLocalISs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_14getLocalISs};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLocalISs", __pyx_kwds); 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_9genexpr23__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", 0);

  /* "petsc4py/PETSc/DMComposite.pyx":186
 * 
 *         """
 *         cdef PetscInt i, n = 0             # <<<<<<<<<<<<<<
 *         cdef PetscIS *cis = NULL
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":187
 *         """
 *         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":188
 *         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, 188, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":189
 *         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, 189, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":190
 *         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, 190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_v_n;
    for (__pyx_9genexpr23__pyx_v_i = 0; __pyx_9genexpr23__pyx_v_i < __pyx_t_3; __pyx_9genexpr23__pyx_v_i++) {
      __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_IS((__pyx_v_cis[__pyx_9genexpr23__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 190, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(59, 190, __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":191
 *         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":192
 *         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, 192, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DMComposite.pyx":193
 *         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, 193, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":194
 *             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":170
 *         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":196
 *         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:196");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11DMComposite_17getLGMaps = {"getLGMaps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_17getLGMaps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_16getLGMaps};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLGMaps", __pyx_kwds); 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_9genexpr24__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", 0);

  /* "petsc4py/PETSc/DMComposite.pyx":209
 * 
 *         """
 *         cdef PetscInt i, n = 0             # <<<<<<<<<<<<<<
 *         cdef PetscLGMap *clgm = NULL
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))
*/
  __pyx_v_n = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":210
 *         """
 *         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":211
 *         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, 211, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":212
 *         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, 212, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":213
 *         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, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_v_n;
    for (__pyx_9genexpr24__pyx_v_i = 0; __pyx_9genexpr24__pyx_v_i < __pyx_t_3; __pyx_9genexpr24__pyx_v_i++) {
      __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_ref_LGMap((__pyx_v_clgm[__pyx_9genexpr24__pyx_v_i]))); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 213, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_4))) __PYX_ERR(59, 213, __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":214
 *         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":215
 *         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, 215, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DMComposite.pyx":216
 *         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, 216, __pyx_L1_error)

  /* "petsc4py/PETSc/DMComposite.pyx":217
 *             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":196
 *         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":219
 *         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:219");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11DMComposite_19getAccess = {"getAccess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_19getAccess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_18getAccess};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gvec,&__pyx_mstate_global->__pyx_n_u_locs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(59, 219, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(59, 219, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(59, 219, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getAccess", 0) < (0)) __PYX_ERR(59, 219, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getAccess", 0, 1, 2, i); __PYX_ERR(59, 219, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(59, 219, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(59, 219, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 219, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "gvec", 0))) __PYX_ERR(59, 219, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getAccess", 0);

  /* "petsc4py/PETSc/DMComposite.pyx":234
 * 
 *         """
 *         return _DMComposite_access(self, gvec, locs)             # <<<<<<<<<<<<<<
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_gvec), __pyx_v_locs};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__DMComposite_access, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(59, 234, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMComposite.pyx":219
 *         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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_1create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 4, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(60, 4, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 4, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "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 const )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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_3setMatrix = {"setMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_3setMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_2setMatrix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mat,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 25, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 25, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setMatrix", 0) < (0)) __PYX_ERR(60, 25, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setMatrix", 1, 1, 1, i); __PYX_ERR(60, 25, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 25, __pyx_L3_error)
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_5setGlobalVector = {"setGlobalVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_5setGlobalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_4setGlobalVector};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 42, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 42, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setGlobalVector", 0) < (0)) __PYX_ERR(60, 42, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setGlobalVector", 1, 1, 1, i); __PYX_ERR(60, 42, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 42, __pyx_L3_error)
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_7setLocalVector = {"setLocalVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_7setLocalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_6setLocalVector};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_lv,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 59, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 59, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLocalVector", 0) < (0)) __PYX_ERR(60, 59, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLocalVector", 1, 1, 1, i); __PYX_ERR(60, 59, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 59, __pyx_L3_error)
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_9setCreateGlobalVector = {"setCreateGlobalVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_9setCreateGlobalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_8setCreateGlobalVector};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_create_gvec,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 76, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCreateGlobalVector", 0) < (0)) __PYX_ERR(60, 76, __pyx_L3_error)

      /* "petsc4py/PETSc/DMShell.pyx":79
 *         self,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCreateGlobalVector", 0, 1, 3, i); __PYX_ERR(60, 76, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 76, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 76, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMShell.pyx":79
 *         self,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":99
 * 
 *         """
 *         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":100
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "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)
 *             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, 101, __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":102
 *             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, 102, __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) != (0)) __PYX_ERR(60, 102, __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) != (0)) __PYX_ERR(60, 102, __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) != (0)) __PYX_ERR(60, 102, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":103
 *             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, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":104
 *             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, 104, __pyx_L1_error)

    /* "petsc4py/PETSc/DMShell.pyx":99
 * 
 *         """
 *         if create_gvec is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DMShell.pyx":106
 *             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, 106, __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":108
 *             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:108");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_11setCreateLocalVector = {"setCreateLocalVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_11setCreateLocalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_10setCreateLocalVector};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_create_lvec,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 108, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCreateLocalVector", 0) < (0)) __PYX_ERR(60, 108, __pyx_L3_error)

      /* "petsc4py/PETSc/DMShell.pyx":111
 *         self,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":112
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCreateLocalVector", 0, 1, 3, i); __PYX_ERR(60, 108, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 108, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 108, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMShell.pyx":111
 *         self,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":112
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 108, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":108
 *             CHKERR(DMShellSetCreateGlobalVector(self.dm, NULL))
 * 
 *     def setCreateLocalVector(             # <<<<<<<<<<<<<<
 *         self,
 *         create_lvec: Callable[[DM], Vec] | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":131
 * 
 *         """
 *         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":132
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":133
 *         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, 133, __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":134
 *             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, 134, __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) != (0)) __PYX_ERR(60, 134, __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) != (0)) __PYX_ERR(60, 134, __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) != (0)) __PYX_ERR(60, 134, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":135
 *             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, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":136
 *             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, 136, __pyx_L1_error)

    /* "petsc4py/PETSc/DMShell.pyx":131
 * 
 *         """
 *         if create_lvec is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DMShell.pyx":138
 *             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, 138, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DMShell.pyx":108
 *             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":140
 *             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:140");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_13setGlobalToLocal = {"setGlobalToLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_13setGlobalToLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_12setGlobalToLocal};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_begin,&__pyx_mstate_global->__pyx_n_u_end,&__pyx_mstate_global->__pyx_n_u_begin_args,&__pyx_mstate_global->__pyx_n_u_begin_kargs,&__pyx_mstate_global->__pyx_n_u_end_args,&__pyx_mstate_global->__pyx_n_u_end_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 140, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(60, 140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(60, 140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(60, 140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setGlobalToLocal", 0) < (0)) __PYX_ERR(60, 140, __pyx_L3_error)

      /* "petsc4py/PETSc/DMShell.pyx":144
 *         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,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":145
 *         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:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":146
 *         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:
 *         """Set the routines used to perform a global to local scatter.
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":147
 *         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.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setGlobalToLocal", 0, 2, 6, i); __PYX_ERR(60, 140, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(60, 140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(60, 140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(60, 140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 140, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 140, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 140, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMShell.pyx":144
 *         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,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":145
 *         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:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":146
 *         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:
 *         """Set the routines used to perform a global to local scatter.
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":147
 *         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.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 140, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":140
 *             CHKERR(DMShellSetCreateLocalVector(self.dm, NULL))
 * 
 *     def setGlobalToLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         begin: Callable[[DM, Vec, InsertMode, Vec], None] | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":174
 * 
 *         """
 *         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":175
 *         """
 *         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":176
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_begin_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":177
 *         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, 177, __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":178
 *             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, 178, __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) != (0)) __PYX_ERR(60, 178, __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) != (0)) __PYX_ERR(60, 178, __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) != (0)) __PYX_ERR(60, 178, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":179
 *             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, 179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":180
 *             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":175
 *         """
 *         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":181
 *             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":182
 *             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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_end_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":183
 *         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, 183, __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":184
 *             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, 184, __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) != (0)) __PYX_ERR(60, 184, __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) != (0)) __PYX_ERR(60, 184, __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) != (0)) __PYX_ERR(60, 184, __pyx_L1_error);
    __Pyx_XDECREF_SET(__pyx_v_context, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":185
 *             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, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":186
 *             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":181
 *             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":187
 *             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, 187, __pyx_L1_error)

  /* "petsc4py/PETSc/DMShell.pyx":140
 *             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":189
 *         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:189");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_15setGlobalToLocalVecScatter = {"setGlobalToLocalVecScatter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_15setGlobalToLocalVecScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_14setGlobalToLocalVecScatter};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_gtol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 189, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 189, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setGlobalToLocalVecScatter", 0) < (0)) __PYX_ERR(60, 189, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setGlobalToLocalVecScatter", 1, 1, 1, i); __PYX_ERR(60, 189, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 189, __pyx_L3_error)
    }
    __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, 189, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, 0, "gtol", 0))) __PYX_ERR(60, 189, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/DMShell.pyx":204
 * 
 *         """
 *         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, 204, __pyx_L1_error)

  /* "petsc4py/PETSc/DMShell.pyx":189
 *         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":206
 *         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:206");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_17setLocalToGlobal = {"setLocalToGlobal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_17setLocalToGlobal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_16setLocalToGlobal};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_begin,&__pyx_mstate_global->__pyx_n_u_end,&__pyx_mstate_global->__pyx_n_u_begin_args,&__pyx_mstate_global->__pyx_n_u_begin_kargs,&__pyx_mstate_global->__pyx_n_u_end_args,&__pyx_mstate_global->__pyx_n_u_end_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 206, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(60, 206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(60, 206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(60, 206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLocalToGlobal", 0) < (0)) __PYX_ERR(60, 206, __pyx_L3_error)

      /* "petsc4py/PETSc/DMShell.pyx":210
 *         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,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":211
 *         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:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":212
 *         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:
 *         """Set the routines used to perform a local to global scatter.
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":213
 *         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.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLocalToGlobal", 0, 2, 6, i); __PYX_ERR(60, 206, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(60, 206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(60, 206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(60, 206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 206, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 206, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 206, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMShell.pyx":210
 *         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,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":211
 *         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:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":212
 *         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:
 *         """Set the routines used to perform a local to global scatter.
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":213
 *         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.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 206, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":206
 *         CHKERR(DMShellSetGlobalToLocalVecScatter(self.dm, gtol.sct))
 * 
 *     def setLocalToGlobal(             # <<<<<<<<<<<<<<
 *         self,
 *         begin: Callable[[DM, Vec, InsertMode, Vec], None] | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":238
 * 
 *         """
 *         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":239
 *         """
 *         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":240
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_begin_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":241
 *         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, 241, __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":242
 *             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, 242, __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) != (0)) __PYX_ERR(60, 242, __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) != (0)) __PYX_ERR(60, 242, __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) != (0)) __PYX_ERR(60, 242, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":243
 *             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, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":244
 *             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":239
 *         """
 *         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":245
 *             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":246
 *             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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_end_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":247
 *         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, 247, __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":248
 *             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, 248, __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) != (0)) __PYX_ERR(60, 248, __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) != (0)) __PYX_ERR(60, 248, __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) != (0)) __PYX_ERR(60, 248, __pyx_L1_error);
    __Pyx_XDECREF_SET(__pyx_v_context, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":249
 *             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, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":250
 *             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":245
 *             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":251
 *             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, 251, __pyx_L1_error)

  /* "petsc4py/PETSc/DMShell.pyx":206
 *         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":253
 *         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:253");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_19setLocalToGlobalVecScatter = {"setLocalToGlobalVecScatter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_19setLocalToGlobalVecScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_18setLocalToGlobalVecScatter};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ltog,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 253, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 253, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLocalToGlobalVecScatter", 0) < (0)) __PYX_ERR(60, 253, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLocalToGlobalVecScatter", 1, 1, 1, i); __PYX_ERR(60, 253, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 253, __pyx_L3_error)
    }
    __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, 253, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, 0, "ltog", 0))) __PYX_ERR(60, 253, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/DMShell.pyx":268
 * 
 *         """
 *         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, 268, __pyx_L1_error)

  /* "petsc4py/PETSc/DMShell.pyx":253
 *         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":270
 *         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:270");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_21setLocalToLocal = {"setLocalToLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_21setLocalToLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_20setLocalToLocal};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_begin,&__pyx_mstate_global->__pyx_n_u_end,&__pyx_mstate_global->__pyx_n_u_begin_args,&__pyx_mstate_global->__pyx_n_u_begin_kargs,&__pyx_mstate_global->__pyx_n_u_end_args,&__pyx_mstate_global->__pyx_n_u_end_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 270, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(60, 270, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(60, 270, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(60, 270, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 270, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 270, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 270, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLocalToLocal", 0) < (0)) __PYX_ERR(60, 270, __pyx_L3_error)

      /* "petsc4py/PETSc/DMShell.pyx":274
 *         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,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":275
 *         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:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":276
 *         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:
 *         """Set the routines used to perform a local to local scatter.
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":277
 *         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.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLocalToLocal", 0, 2, 6, i); __PYX_ERR(60, 270, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(60, 270, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(60, 270, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(60, 270, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 270, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 270, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 270, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMShell.pyx":274
 *         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,
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":275
 *         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:
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":276
 *         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:
 *         """Set the routines used to perform a local to local scatter.
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":277
 *         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.
 * 
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 270, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":270
 *         CHKERR(DMShellSetLocalToGlobalVecScatter(self.dm, ltog.sct))
 * 
 *     def setLocalToLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         begin: Callable[[DM, Vec, InsertMode, Vec], None] | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":302
 * 
 *         """
 *         cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL             # <<<<<<<<<<<<<<
 *         cbegin = NULL
 *         cend = NULL
*/
  __pyx_v_cbegin = NULL;
  __pyx_v_cend = NULL;

  /* "petsc4py/PETSc/DMShell.pyx":303
 *         """
 *         cdef PetscDMShellXToYFunction cbegin = NULL, cend = NULL
 *         cbegin = NULL             # <<<<<<<<<<<<<<
 *         cend = NULL
 *         if begin is not None:
*/
  __pyx_v_cbegin = NULL;

  /* "petsc4py/PETSc/DMShell.pyx":304
 *         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":305
 *         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":306
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_begin_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":307
 *         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, 307, __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":308
 *             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, 308, __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) != (0)) __PYX_ERR(60, 308, __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) != (0)) __PYX_ERR(60, 308, __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) != (0)) __PYX_ERR(60, 308, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":309
 *             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, 309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":310
 *             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":305
 *         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":311
 *             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":312
 *             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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_end_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":313
 *         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, 313, __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":314
 *             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, 314, __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) != (0)) __PYX_ERR(60, 314, __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) != (0)) __PYX_ERR(60, 314, __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) != (0)) __PYX_ERR(60, 314, __pyx_L1_error);
    __Pyx_XDECREF_SET(__pyx_v_context, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":315
 *             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, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":316
 *             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":311
 *             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":317
 *             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, 317, __pyx_L1_error)

  /* "petsc4py/PETSc/DMShell.pyx":270
 *         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":319
 *         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:319");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_23setLocalToLocalVecScatter = {"setLocalToLocalVecScatter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_23setLocalToLocalVecScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_22setLocalToLocalVecScatter};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ltol,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 319, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 319, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLocalToLocalVecScatter", 0) < (0)) __PYX_ERR(60, 319, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLocalToLocalVecScatter", 1, 1, 1, i); __PYX_ERR(60, 319, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 319, __pyx_L3_error)
    }
    __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, 319, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, 0, "ltol", 0))) __PYX_ERR(60, 319, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/DMShell.pyx":334
 * 
 *         """
 *         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, 334, __pyx_L1_error)

  /* "petsc4py/PETSc/DMShell.pyx":319
 *         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":336
 *         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:336");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_25setCreateMatrix = {"setCreateMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_25setCreateMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_24setCreateMatrix};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_create_matrix,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 336, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 336, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 336, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 336, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCreateMatrix", 0) < (0)) __PYX_ERR(60, 336, __pyx_L3_error)

      /* "petsc4py/PETSc/DMShell.pyx":339
 *         self,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":340
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCreateMatrix", 0, 1, 3, i); __PYX_ERR(60, 336, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 336, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 336, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 336, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMShell.pyx":339
 *         self,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":340
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 336, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":336
 *         CHKERR(DMShellSetLocalToLocalVecScatter(self.dm, ltol.sct))
 * 
 *     def setCreateMatrix(             # <<<<<<<<<<<<<<
 *         self,
 *         create_matrix: Callable[[DM], Mat] | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":359
 * 
 *         """
 *         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":360
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":361
 *         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, 361, __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":362
 *             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, 362, __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) != (0)) __PYX_ERR(60, 362, __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) != (0)) __PYX_ERR(60, 362, __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) != (0)) __PYX_ERR(60, 362, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":363
 *             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, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":364
 *             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, 364, __pyx_L1_error)

    /* "petsc4py/PETSc/DMShell.pyx":359
 * 
 *         """
 *         if create_matrix is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DMShell.pyx":366
 *             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, 366, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DMShell.pyx":336
 *         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":368
 *             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:368");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_27setCoarsen = {"setCoarsen", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_27setCoarsen, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_26setCoarsen};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_coarsen,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 368, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCoarsen", 0) < (0)) __PYX_ERR(60, 368, __pyx_L3_error)

      /* "petsc4py/PETSc/DMShell.pyx":371
 *         self,
 *         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`.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":372
 *         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`.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCoarsen", 0, 1, 3, i); __PYX_ERR(60, 368, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 368, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 368, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMShell.pyx":371
 *         self,
 *         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`.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":372
 *         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`.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 368, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":368
 *             CHKERR(DMShellSetCreateMatrix(self.dm, NULL))
 * 
 *     def setCoarsen(             # <<<<<<<<<<<<<<
 *         self,
 *         coarsen: Callable[[DM, Comm], DM] | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":391
 * 
 *         """
 *         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":392
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":393
 *         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, 393, __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":394
 *             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, 394, __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) != (0)) __PYX_ERR(60, 394, __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) != (0)) __PYX_ERR(60, 394, __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) != (0)) __PYX_ERR(60, 394, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":395
 *             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, 395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":396
 *             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, 396, __pyx_L1_error)

    /* "petsc4py/PETSc/DMShell.pyx":391
 * 
 *         """
 *         if coarsen is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DMShell.pyx":398
 *             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, 398, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DMShell.pyx":368
 *             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":400
 *             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:400");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_29setRefine = {"setRefine", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_29setRefine, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_28setRefine};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_refine,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 400, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 400, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 400, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 400, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRefine", 0) < (0)) __PYX_ERR(60, 400, __pyx_L3_error)

      /* "petsc4py/PETSc/DMShell.pyx":403
 *         self,
 *         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`.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":404
 *         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`.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setRefine", 0, 1, 3, i); __PYX_ERR(60, 400, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 400, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 400, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 400, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMShell.pyx":403
 *         self,
 *         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`.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":404
 *         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`.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 400, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":400
 *             CHKERR(DMShellSetCoarsen(self.dm, NULL))
 * 
 *     def setRefine(             # <<<<<<<<<<<<<<
 *         self,
 *         refine: Callable[[DM, Comm], DM] | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":423
 * 
 *         """
 *         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":424
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":425
 *         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, 425, __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":426
 *             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, 426, __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) != (0)) __PYX_ERR(60, 426, __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) != (0)) __PYX_ERR(60, 426, __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) != (0)) __PYX_ERR(60, 426, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":427
 *             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, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":428
 *             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, 428, __pyx_L1_error)

    /* "petsc4py/PETSc/DMShell.pyx":423
 * 
 *         """
 *         if refine is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DMShell.pyx":430
 *             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, 430, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DMShell.pyx":400
 *             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":432
 *             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:432");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_31setCreateInterpolation = {"setCreateInterpolation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_31setCreateInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_30setCreateInterpolation};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_create_interpolation,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 432, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 432, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 432, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 432, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCreateInterpolation", 0) < (0)) __PYX_ERR(60, 432, __pyx_L3_error)

      /* "petsc4py/PETSc/DMShell.pyx":435
 *         self,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":436
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCreateInterpolation", 0, 1, 3, i); __PYX_ERR(60, 432, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 432, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 432, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 432, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMShell.pyx":435
 *         self,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":436
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 432, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":432
 *             CHKERR(DMShellSetRefine(self.dm, NULL))
 * 
 *     def setCreateInterpolation(             # <<<<<<<<<<<<<<
 *         self,
 *         create_interpolation: Callable[[DM, DM], tuple[Mat, Vec]] | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":455
 * 
 *         """
 *         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":456
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":457
 *         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, 457, __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":458
 *             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, 458, __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) != (0)) __PYX_ERR(60, 458, __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) != (0)) __PYX_ERR(60, 458, __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) != (0)) __PYX_ERR(60, 458, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":459
 *             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, 459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":460
 *             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, 460, __pyx_L1_error)

    /* "petsc4py/PETSc/DMShell.pyx":455
 * 
 *         """
 *         if create_interpolation is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DMShell.pyx":462
 *             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, 462, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DMShell.pyx":432
 *             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":464
 *             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:464");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_33setCreateInjection = {"setCreateInjection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_33setCreateInjection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_32setCreateInjection};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_create_injection,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 464, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 464, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 464, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 464, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCreateInjection", 0) < (0)) __PYX_ERR(60, 464, __pyx_L3_error)

      /* "petsc4py/PETSc/DMShell.pyx":467
 *         self,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":468
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCreateInjection", 0, 1, 3, i); __PYX_ERR(60, 464, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 464, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 464, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 464, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMShell.pyx":467
 *         self,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":468
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 464, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":464
 *             CHKERR(DMShellSetCreateInterpolation(self.dm, NULL))
 * 
 *     def setCreateInjection(             # <<<<<<<<<<<<<<
 *         self,
 *         create_injection: Callable[[DM, DM], Mat] | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":487
 * 
 *         """
 *         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":488
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":489
 *         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, 489, __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":490
 *             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, 490, __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) != (0)) __PYX_ERR(60, 490, __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) != (0)) __PYX_ERR(60, 490, __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) != (0)) __PYX_ERR(60, 490, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":491
 *             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, 491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":492
 *             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, 492, __pyx_L1_error)

    /* "petsc4py/PETSc/DMShell.pyx":487
 * 
 *         """
 *         if create_injection is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DMShell.pyx":494
 *             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, 494, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DMShell.pyx":464
 *             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":496
 *             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:496");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_35setCreateRestriction = {"setCreateRestriction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_35setCreateRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_34setCreateRestriction};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_create_restriction,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 496, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCreateRestriction", 0) < (0)) __PYX_ERR(60, 496, __pyx_L3_error)

      /* "petsc4py/PETSc/DMShell.pyx":499
 *         self,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":500
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCreateRestriction", 0, 1, 3, i); __PYX_ERR(60, 496, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 496, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 496, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMShell.pyx":499
 *         self,
 *         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.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":500
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 496, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":496
 *             CHKERR(DMShellSetCreateInjection(self.dm, NULL))
 * 
 *     def setCreateRestriction(             # <<<<<<<<<<<<<<
 *         self,
 *         create_restriction: Callable[[DM, DM], Mat] | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":519
 * 
 *         """
 *         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":520
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":521
 *         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, 521, __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":522
 *             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, 522, __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) != (0)) __PYX_ERR(60, 522, __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) != (0)) __PYX_ERR(60, 522, __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) != (0)) __PYX_ERR(60, 522, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":523
 *             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, 523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":524
 *             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, 524, __pyx_L1_error)

    /* "petsc4py/PETSc/DMShell.pyx":519
 * 
 *         """
 *         if create_restriction is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args  = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DMShell.pyx":526
 *             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, 526, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DMShell.pyx":496
 *             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":528
 *             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:528");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_37setCreateFieldDecomposition = {"setCreateFieldDecomposition", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_37setCreateFieldDecomposition, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_36setCreateFieldDecomposition};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_decomp,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 528, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCreateFieldDecomposition", 0) < (0)) __PYX_ERR(60, 528, __pyx_L3_error)

      /* "petsc4py/PETSc/DMShell.pyx":531
 *         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:
 *         """Set the routine used to create a field decomposition.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":532
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCreateFieldDecomposition", 0, 1, 3, i); __PYX_ERR(60, 528, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 528, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMShell.pyx":531
 *         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:
 *         """Set the routine used to create a field decomposition.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":532
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 528, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":528
 *             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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":551
 * 
 *         """
 *         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":552
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":553
 *         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, 553, __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":554
 *             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, 554, __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) != (0)) __PYX_ERR(60, 554, __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) != (0)) __PYX_ERR(60, 554, __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) != (0)) __PYX_ERR(60, 554, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":555
 *             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, 555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":556
 *             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, 556, __pyx_L1_error)

    /* "petsc4py/PETSc/DMShell.pyx":551
 * 
 *         """
 *         if decomp is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DMShell.pyx":558
 *             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, 558, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DMShell.pyx":528
 *             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":560
 *             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:560");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_39setCreateDomainDecomposition = {"setCreateDomainDecomposition", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_39setCreateDomainDecomposition, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_38setCreateDomainDecomposition};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_decomp,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 560, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 560, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 560, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 560, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCreateDomainDecomposition", 0) < (0)) __PYX_ERR(60, 560, __pyx_L3_error)

      /* "petsc4py/PETSc/DMShell.pyx":563
 *         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:
 *         """Set the routine used to create a domain decomposition.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":564
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCreateDomainDecomposition", 0, 1, 3, i); __PYX_ERR(60, 560, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 560, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 560, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 560, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMShell.pyx":563
 *         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:
 *         """Set the routine used to create a domain decomposition.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":564
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 560, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":560
 *             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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":583
 * 
 *         """
 *         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":584
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":585
 *         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, 585, __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":586
 *             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, 586, __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) != (0)) __PYX_ERR(60, 586, __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) != (0)) __PYX_ERR(60, 586, __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) != (0)) __PYX_ERR(60, 586, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":587
 *             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, 587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":588
 *             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, 588, __pyx_L1_error)

    /* "petsc4py/PETSc/DMShell.pyx":583
 * 
 *         """
 *         if decomp is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DMShell.pyx":590
 *             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, 590, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DMShell.pyx":560
 *             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":592
 *             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:592");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_41setCreateDomainDecompositionScatters = {"setCreateDomainDecompositionScatters", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_41setCreateDomainDecompositionScatters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_40setCreateDomainDecompositionScatters};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_scatter,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 592, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 592, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 592, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 592, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCreateDomainDecompositionScatters", 0) < (0)) __PYX_ERR(60, 592, __pyx_L3_error)

      /* "petsc4py/PETSc/DMShell.pyx":595
 *         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:
 *         """Set the routine used to create the scatter contexts for domain decomposition.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":596
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCreateDomainDecompositionScatters", 0, 1, 3, i); __PYX_ERR(60, 592, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 592, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 592, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 592, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMShell.pyx":595
 *         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:
 *         """Set the routine used to create the scatter contexts for domain decomposition.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":596
 *         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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 592, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":592
 *             CHKERR(DMShellSetCreateDomainDecomposition(self.dm, NULL))
 * 
 *     def setCreateDomainDecompositionScatters(             # <<<<<<<<<<<<<<
 *         self,
 *         scatter: Callable[[DM, list[DM]], tuple[list[Scatter], list[Scatter], list[Scatter]]] | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":615
 * 
 *         """
 *         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":616
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":617
 *         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, 617, __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":618
 *             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, 618, __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) != (0)) __PYX_ERR(60, 618, __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) != (0)) __PYX_ERR(60, 618, __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) != (0)) __PYX_ERR(60, 618, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":619
 *             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, 619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":620
 *             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, 620, __pyx_L1_error)

    /* "petsc4py/PETSc/DMShell.pyx":615
 * 
 *         """
 *         if scatter is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DMShell.pyx":622
 *             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, 622, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DMShell.pyx":592
 *             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":624
 *             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:624");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMShell_43setCreateSubDM = {"setCreateSubDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_43setCreateSubDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_42setCreateSubDM};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_create_subdm,&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_kargs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(60, 624, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCreateSubDM", 0) < (0)) __PYX_ERR(60, 624, __pyx_L3_error)

      /* "petsc4py/PETSc/DMShell.pyx":627
 *         self,
 *         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`.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":628
 *         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`.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCreateSubDM", 0, 1, 3, i); __PYX_ERR(60, 624, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(60, 624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(60, 624, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(60, 624, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMShell.pyx":627
 *         self,
 *         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`.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/DMShell.pyx":628
 *         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`.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 624, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":624
 *             CHKERR(DMShellSetCreateDomainDecompositionScatters(self.dm, NULL))
 * 
 *     def setCreateSubDM(             # <<<<<<<<<<<<<<
 *         self,
 *         create_subdm: Callable[[DM, Sequence[int]], tuple[IS, DM]] | None,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":647
 * 
 *         """
 *         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":648
 *         """
 *         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_mstate_global->__pyx_empty_tuple);
      __Pyx_DECREF_SET(__pyx_v_args, __pyx_mstate_global->__pyx_empty_tuple);
    }

    /* "petsc4py/PETSc/DMShell.pyx":649
 *         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, 649, __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":650
 *             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, 650, __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) != (0)) __PYX_ERR(60, 650, __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) != (0)) __PYX_ERR(60, 650, __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) != (0)) __PYX_ERR(60, 650, __pyx_L1_error);
    __pyx_v_context = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":651
 *             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, 651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/DMShell.pyx":652
 *             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, 652, __pyx_L1_error)

    /* "petsc4py/PETSc/DMShell.pyx":647
 * 
 *         """
 *         if create_subdm is not None:             # <<<<<<<<<<<<<<
 *             if args  is None: args = ()
 *             if kargs is None: kargs = {}
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/DMShell.pyx":654
 *             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, 654, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/DMShell.pyx":624
 *             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 = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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 = <PetscObject*> &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 = <PetscObject*> &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 = <PetscObject*> &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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_3destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_3destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_2destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_5view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_4view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 21, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 21, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(61, 21, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 21, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_7create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_6create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 40, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(61, 40, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 40, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(61, 40, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("create", 0, 1, 2, i); __PYX_ERR(61, 40, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(61, 40, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 40, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 const )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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_9duplicate = {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_9duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_8duplicate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("duplicate", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("duplicate", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":75
 * 
 *         """
 *         cdef DMLabel new = DMLabel()             # <<<<<<<<<<<<<<
 *         CHKERR(DMLabelDuplicate(self.dmlabel, &new.dmlabel))
 *         return new
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 75, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelDuplicate(__pyx_v_self->dmlabel, (&__pyx_v_new->dmlabel))); if (unlikely(__pyx_t_4 == ((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_XDECREF(__pyx_t_2);
  __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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_11reset = {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_11reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_10reset};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("reset", __pyx_kwds); 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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_13insertIS = {"insertIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_13insertIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_12insertIS};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_iset,&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 91, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(61, 91, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 91, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "insertIS", 0) < (0)) __PYX_ERR(61, 91, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("insertIS", 1, 2, 2, i); __PYX_ERR(61, 91, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 91, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(61, 91, __pyx_L3_error)
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_15setValue = {"setValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_15setValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_14setValue};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 112, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(61, 112, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 112, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setValue", 0) < (0)) __PYX_ERR(61, 112, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setValue", 1, 2, 2, i); __PYX_ERR(61, 112, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 112, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(61, 112, __pyx_L3_error)
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_17getValue = {"getValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_17getValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_16getValue};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 137, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 137, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getValue", 0) < (0)) __PYX_ERR(61, 137, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getValue", 1, 1, 1, i); __PYX_ERR(61, 137, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 137, __pyx_L3_error)
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_19getDefaultValue = {"getDefaultValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_19getDefaultValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_18getDefaultValue};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDefaultValue", __pyx_kwds); 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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_21setDefaultValue = {"setDefaultValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_21setDefaultValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_20setDefaultValue};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 178, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 178, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDefaultValue", 0) < (0)) __PYX_ERR(61, 178, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDefaultValue", 1, 1, 1, i); __PYX_ERR(61, 178, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 178, __pyx_L3_error)
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_23clearValue = {"clearValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_23clearValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_22clearValue};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 199, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(61, 199, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 199, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "clearValue", 0) < (0)) __PYX_ERR(61, 199, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("clearValue", 1, 2, 2, i); __PYX_ERR(61, 199, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 199, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(61, 199, __pyx_L3_error)
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "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        Not collective.\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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_25addStratum = {"addStratum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_25addStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_24addStratum};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 220, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 220, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addStratum", 0) < (0)) __PYX_ERR(61, 220, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addStratum", 1, 1, 1, i); __PYX_ERR(61, 220, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 220, __pyx_L3_error)
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":235
 * 
 *         """
 *         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, 235, __pyx_L1_error)
  __pyx_v_cvalue = __pyx_t_1;

  /* "petsc4py/PETSc/DMLabel.pyx":236
 *         """
 *         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, 236, __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":238
 *         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:238");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_27addStrata = {"addStrata", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_27addStrata, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_26addStrata};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_strata,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 238, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 238, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addStrata", 0) < (0)) __PYX_ERR(61, 238, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addStrata", 1, 1, 1, i); __PYX_ERR(61, 238, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 238, __pyx_L3_error)
    }
    __pyx_v_strata = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("addStrata", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 238, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  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", 0);
  __Pyx_INCREF(__pyx_v_strata);

  /* "petsc4py/PETSc/DMLabel.pyx":253
 * 
 *         """
 *         cdef PetscInt *istrata = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt numStrata = 0
 *         strata = iarray_i(strata, &numStrata, &istrata)
*/
  __pyx_v_istrata = NULL;

  /* "petsc4py/PETSc/DMLabel.pyx":254
 *         """
 *         cdef PetscInt *istrata = NULL
 *         cdef PetscInt numStrata = 0             # <<<<<<<<<<<<<<
 *         strata = iarray_i(strata, &numStrata, &istrata)
 *         CHKERR(DMLabelAddStrata(self.dmlabel, numStrata, istrata))
*/
  __pyx_v_numStrata = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":255
 *         cdef PetscInt *istrata = NULL
 *         cdef PetscInt numStrata = 0
 *         strata = 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, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_strata, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":256
 *         cdef PetscInt numStrata = 0
 *         strata = 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, 256, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":238
 *         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(__pyx_v_strata);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMLabel.pyx":258
 *         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:258");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_29addStrataIS = {"addStrataIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_29addStrataIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_28addStrataIS};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_iset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 258, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 258, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addStrataIS", 0) < (0)) __PYX_ERR(61, 258, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addStrataIS", 1, 1, 1, i); __PYX_ERR(61, 258, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 258, __pyx_L3_error)
    }
    __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, 258, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(61, 258, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":273
 * 
 *         """
 *         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, 273, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":258
 *         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":275
 *         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:275");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_31getNumValues = {"getNumValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_31getNumValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_30getNumValues};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNumValues", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":285
 * 
 *         """
 *         cdef PetscInt numValues = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMLabelGetNumValues(self.dmlabel, &numValues))
 *         return toInt(numValues)
*/
  __pyx_v_numValues = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":286
 *         """
 *         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, 286, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":287
 *         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, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMLabel.pyx":275
 *         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":289
 *         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:289");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_33getValueIS = {"getValueIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_33getValueIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_32getValueIS};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getValueIS", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getValueIS", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":299
 * 
 *         """
 *         cdef IS iset = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(DMLabelGetValueIS(self.dmlabel, &iset.iset))
 *         return iset
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 299, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":300
 *         """
 *         cdef IS iset = IS()
 *         CHKERR(DMLabelGetValueIS(self.dmlabel, &iset.iset))             # <<<<<<<<<<<<<<
 *         return iset
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelGetValueIS(__pyx_v_self->dmlabel, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 300, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":301
 *         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":289
 *         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_XDECREF(__pyx_t_2);
  __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":303
 *         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:303");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_35stratumHasPoint = {"stratumHasPoint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_35stratumHasPoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_34stratumHasPoint};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_point,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 303, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(61, 303, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 303, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "stratumHasPoint", 0) < (0)) __PYX_ERR(61, 303, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("stratumHasPoint", 1, 2, 2, i); __PYX_ERR(61, 303, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 303, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(61, 303, __pyx_L3_error)
    }
    __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, 303, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":320
 * 
 *         """
 *         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, 320, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/DMLabel.pyx":321
 *         """
 *         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, 321, __pyx_L1_error)
  __pyx_v_cvalue = __pyx_t_1;

  /* "petsc4py/PETSc/DMLabel.pyx":322
 *         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":323
 *         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, 323, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":324
 *         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, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMLabel.pyx":303
 *         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":326
 *         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:326");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_37hasStratum = {"hasStratum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_37hasStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_36hasStratum};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 326, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 326, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "hasStratum", 0) < (0)) __PYX_ERR(61, 326, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("hasStratum", 1, 1, 1, i); __PYX_ERR(61, 326, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 326, __pyx_L3_error)
    }
    __pyx_v_value = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("hasStratum", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 326, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":341
 * 
 *         """
 *         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, 341, __pyx_L1_error)
  __pyx_v_cvalue = __pyx_t_1;

  /* "petsc4py/PETSc/DMLabel.pyx":342
 *         """
 *         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":343
 *         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, 343, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":344
 *         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, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMLabel.pyx":326
 *         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":346
 *         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:346");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_39getStratumSize = {"getStratumSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_39getStratumSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_38getStratumSize};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_stratum,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 346, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 346, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getStratumSize", 0) < (0)) __PYX_ERR(61, 346, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getStratumSize", 1, 1, 1, i); __PYX_ERR(61, 346, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 346, __pyx_L3_error)
    }
    __pyx_v_stratum = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getStratumSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 346, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":361
 * 
 *         """
 *         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, 361, __pyx_L1_error)
  __pyx_v_cstratum = __pyx_t_1;

  /* "petsc4py/PETSc/DMLabel.pyx":362
 *         """
 *         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":363
 *         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, 363, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":364
 *         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, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMLabel.pyx":346
 *         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":366
 *         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:366");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_41getStratumIS = {"getStratumIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_41getStratumIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_40getStratumIS};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_stratum,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 366, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 366, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getStratumIS", 0) < (0)) __PYX_ERR(61, 366, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getStratumIS", 1, 1, 1, i); __PYX_ERR(61, 366, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 366, __pyx_L3_error)
    }
    __pyx_v_stratum = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getStratumIS", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 366, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getStratumIS", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":381
 * 
 *         """
 *         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, 381, __pyx_L1_error)
  __pyx_v_cstratum = __pyx_t_1;

  /* "petsc4py/PETSc/DMLabel.pyx":382
 *         """
 *         cdef PetscInt cstratum = asInt(stratum)
 *         cdef IS iset = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(DMLabelGetStratumIS(self.dmlabel, cstratum, &iset.iset))
 *         return iset
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(61, 382, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":383
 *         cdef PetscInt cstratum = asInt(stratum)
 *         cdef IS iset = IS()
 *         CHKERR(DMLabelGetStratumIS(self.dmlabel, cstratum, &iset.iset))             # <<<<<<<<<<<<<<
 *         return iset
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelGetStratumIS(__pyx_v_self->dmlabel, __pyx_v_cstratum, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 383, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":384
 *         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":366
 *         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_XDECREF(__pyx_t_3);
  __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":386
 *         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:386");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_43setStratumIS = {"setStratumIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_43setStratumIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_42setStratumIS};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_stratum,&__pyx_mstate_global->__pyx_n_u_iset,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 386, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(61, 386, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 386, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setStratumIS", 0) < (0)) __PYX_ERR(61, 386, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setStratumIS", 1, 2, 2, i); __PYX_ERR(61, 386, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 386, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(61, 386, __pyx_L3_error)
    }
    __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, 386, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "iset", 0))) __PYX_ERR(61, 386, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":403
 * 
 *         """
 *         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, 403, __pyx_L1_error)
  __pyx_v_cstratum = __pyx_t_1;

  /* "petsc4py/PETSc/DMLabel.pyx":404
 *         """
 *         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, 404, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":386
 *         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":406
 *         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:406");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_45clearStratum = {"clearStratum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_45clearStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_44clearStratum};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_stratum,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 406, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 406, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "clearStratum", 0) < (0)) __PYX_ERR(61, 406, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("clearStratum", 1, 1, 1, i); __PYX_ERR(61, 406, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 406, __pyx_L3_error)
    }
    __pyx_v_stratum = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("clearStratum", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 406, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":421
 * 
 *         """
 *         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, 421, __pyx_L1_error)
  __pyx_v_cstratum = __pyx_t_1;

  /* "petsc4py/PETSc/DMLabel.pyx":422
 *         """
 *         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, 422, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":406
 *         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":424
 *         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:424");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_47computeIndex = {"computeIndex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_47computeIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_46computeIndex};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("computeIndex", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":436
 * 
 *         """
 *         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, 436, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":424
 *         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":438
 *         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:438");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_49createIndex = {"createIndex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_49createIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_48createIndex};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pStart,&__pyx_mstate_global->__pyx_n_u_pEnd,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 438, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(61, 438, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 438, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createIndex", 0) < (0)) __PYX_ERR(61, 438, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createIndex", 1, 2, 2, i); __PYX_ERR(61, 438, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 438, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(61, 438, __pyx_L3_error)
    }
    __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, 438, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":455
 * 
 *         """
 *         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, 455, __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, 455, __pyx_L1_error)
  __pyx_v_cpend = __pyx_t_1;

  /* "petsc4py/PETSc/DMLabel.pyx":456
 *         """
 *         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, 456, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":438
 *         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":458
 *         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:458");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_51destroyIndex = {"destroyIndex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_51destroyIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_50destroyIndex};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroyIndex", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":468
 * 
 *         """
 *         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, 468, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":458
 *         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":470
 *         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:470");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_53hasValue = {"hasValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_53hasValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_52hasValue};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_value,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 470, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 470, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "hasValue", 0) < (0)) __PYX_ERR(61, 470, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("hasValue", 1, 1, 1, i); __PYX_ERR(61, 470, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 470, __pyx_L3_error)
    }
    __pyx_v_value = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("hasValue", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 470, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":485
 * 
 *         """
 *         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, 485, __pyx_L1_error)
  __pyx_v_cvalue = __pyx_t_1;

  /* "petsc4py/PETSc/DMLabel.pyx":486
 *         """
 *         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":487
 *         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, 487, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":488
 *         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, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMLabel.pyx":470
 *         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":490
 *         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:490");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_55hasPoint = {"hasPoint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_55hasPoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_54hasPoint};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_point,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 490, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 490, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "hasPoint", 0) < (0)) __PYX_ERR(61, 490, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("hasPoint", 1, 1, 1, i); __PYX_ERR(61, 490, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 490, __pyx_L3_error)
    }
    __pyx_v_point = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("hasPoint", 1, 1, 1, __pyx_nargs); __PYX_ERR(61, 490, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":507
 * 
 *         """
 *         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, 507, __pyx_L1_error)
  __pyx_v_cpoint = __pyx_t_1;

  /* "petsc4py/PETSc/DMLabel.pyx":508
 *         """
 *         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":509
 *         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, 509, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":510
 *         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, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMLabel.pyx":490
 *         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":512
 *         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:512");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_57getBounds = {"getBounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_57getBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_56getBounds};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getBounds", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":524
 * 
 *         """
 *         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":525
 *         """
 *         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, 525, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":526
 *         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, 526, __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, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 526, __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) != (0)) __PYX_ERR(61, 526, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(61, 526, __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":512
 *         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":528
 *         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:528");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_59filter = {"filter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_59filter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_58filter};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_start,&__pyx_mstate_global->__pyx_n_u_end,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 528, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(61, 528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "filter", 0) < (0)) __PYX_ERR(61, 528, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("filter", 1, 2, 2, i); __PYX_ERR(61, 528, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 528, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(61, 528, __pyx_L3_error)
    }
    __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, 528, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":545
 * 
 *         """
 *         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, 545, __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, 545, __pyx_L1_error)
  __pyx_v_cend = __pyx_t_1;

  /* "petsc4py/PETSc/DMLabel.pyx":546
 *         """
 *         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, 546, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":528
 *         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":548
 *         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:548");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_61permute = {"permute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_61permute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_60permute};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_permutation,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 548, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 548, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "permute", 0) < (0)) __PYX_ERR(61, 548, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("permute", 1, 1, 1, i); __PYX_ERR(61, 548, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 548, __pyx_L3_error)
    }
    __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, 548, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, 0, "permutation", 0))) __PYX_ERR(61, 548, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("permute", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":563
 * 
 *         """
 *         cdef DMLabel new = DMLabel()             # <<<<<<<<<<<<<<
 *         CHKERR(DMLabelPermute(self.dmlabel, permutation.iset, &new.dmlabel))
 *         return new
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 563, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_new = ((struct PyPetscDMLabelObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":564
 *         """
 *         cdef DMLabel new = DMLabel()
 *         CHKERR(DMLabelPermute(self.dmlabel, permutation.iset, &new.dmlabel))             # <<<<<<<<<<<<<<
 *         return new
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelPermute(__pyx_v_self->dmlabel, __pyx_v_permutation->iset, (&__pyx_v_new->dmlabel))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 564, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":565
 *         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":548
 *         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_XDECREF(__pyx_t_2);
  __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":567
 *         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:567");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_63distribute = {"distribute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_63distribute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_62distribute};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 567, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "distribute", 0) < (0)) __PYX_ERR(61, 567, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("distribute", 1, 1, 1, i); __PYX_ERR(61, 567, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 567, __pyx_L3_error)
    }
    __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, 567, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(61, 567, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("distribute", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":582
 * 
 *         """
 *         cdef DMLabel new = DMLabel()             # <<<<<<<<<<<<<<
 *         CHKERR(DMLabelDistribute(self.dmlabel, sf.sf, &new.dmlabel))
 *         return new
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 582, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_new = ((struct PyPetscDMLabelObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":583
 *         """
 *         cdef DMLabel new = DMLabel()
 *         CHKERR(DMLabelDistribute(self.dmlabel, sf.sf, &new.dmlabel))             # <<<<<<<<<<<<<<
 *         return new
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelDistribute(__pyx_v_self->dmlabel, __pyx_v_sf->sf, (&__pyx_v_new->dmlabel))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 583, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":584
 *         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":567
 *         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_XDECREF(__pyx_t_2);
  __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":586
 *         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:586");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_65gather = {"gather", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_65gather, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_64gather};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sf,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(61, 586, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 586, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "gather", 0) < (0)) __PYX_ERR(61, 586, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("gather", 1, 1, 1, i); __PYX_ERR(61, 586, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(61, 586, __pyx_L3_error)
    }
    __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, 586, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, 0, "sf", 0))) __PYX_ERR(61, 586, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("gather", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":603
 * 
 *         """
 *         cdef DMLabel new = DMLabel()             # <<<<<<<<<<<<<<
 *         CHKERR(DMLabelGather(self.dmlabel, sf.sf, &new.dmlabel))
 *         return new
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 603, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_new = ((struct PyPetscDMLabelObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":604
 *         """
 *         cdef DMLabel new = DMLabel()
 *         CHKERR(DMLabelGather(self.dmlabel, sf.sf, &new.dmlabel))             # <<<<<<<<<<<<<<
 *         return new
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelGather(__pyx_v_self->dmlabel, __pyx_v_sf->sf, (&__pyx_v_new->dmlabel))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 604, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":605
 *         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":586
 *         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_XDECREF(__pyx_t_2);
  __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":607
 *         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:607");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_67convertToSection = {"convertToSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_67convertToSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_66convertToSection};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("convertToSection", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convertToSection", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":617
 * 
 *         """
 *         cdef Section section = Section()             # <<<<<<<<<<<<<<
 *         cdef IS iset = IS()
 *         CHKERR(DMLabelConvertToSection(self.dmlabel, &section.sec, &iset.iset))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 617, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_section = ((struct PyPetscSectionObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":618
 *         """
 *         cdef Section section = Section()
 *         cdef IS iset = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(DMLabelConvertToSection(self.dmlabel, &section.sec, &iset.iset))
 *         return section, iset
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 618, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":619
 *         cdef Section section = Section()
 *         cdef IS iset = IS()
 *         CHKERR(DMLabelConvertToSection(self.dmlabel, &section.sec, &iset.iset))             # <<<<<<<<<<<<<<
 *         return section, iset
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelConvertToSection(__pyx_v_self->dmlabel, (&__pyx_v_section->sec), (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 619, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":620
 *         cdef IS iset = IS()
 *         CHKERR(DMLabelConvertToSection(self.dmlabel, &section.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, 620, __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)) != (0)) __PYX_ERR(61, 620, __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)) != (0)) __PYX_ERR(61, 620, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMLabel.pyx":607
 *         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_XDECREF(__pyx_t_2);
  __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":622
 *         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:622");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMLabel_69getNonEmptyStratumValuesIS = {"getNonEmptyStratumValuesIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_69getNonEmptyStratumValuesIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_68getNonEmptyStratumValuesIS};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNonEmptyStratumValuesIS", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getNonEmptyStratumValuesIS", 0);

  /* "petsc4py/PETSc/DMLabel.pyx":632
 * 
 *         """
 *         cdef IS iset = IS()             # <<<<<<<<<<<<<<
 *         CHKERR(DMLabelGetNonEmptyStratumValuesIS(self.dmlabel, &iset.iset))
 *         return iset
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 632, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_iset = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":633
 *         """
 *         cdef IS iset = IS()
 *         CHKERR(DMLabelGetNonEmptyStratumValuesIS(self.dmlabel, &iset.iset))             # <<<<<<<<<<<<<<
 *         return iset
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMLabelGetNonEmptyStratumValuesIS(__pyx_v_self->dmlabel, (&__pyx_v_iset->iset))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(61, 633, __pyx_L1_error)

  /* "petsc4py/PETSc/DMLabel.pyx":634
 *         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":622
 *         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_XDECREF(__pyx_t_2);
  __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":39
 *     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:39");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_1create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 39, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 39, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(62, 39, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 39, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(62, 39, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":58
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(62, 58, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":59
 *         """
 *         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":60
 *         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, 60, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":61
 *         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, 61, __pyx_L1_error)
  __pyx_v_self->__pyx_base.dm = __pyx_v_newdm;

  /* "petsc4py/PETSc/DMSwarm.pyx":62
 *         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, 62, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":63
 *         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":39
 *     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":65
 *         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:65");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_3createGlobalVectorFromField = {"createGlobalVectorFromField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_3createGlobalVectorFromField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_2createGlobalVectorFromField};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fieldname,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 65, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 65, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createGlobalVectorFromField", 0) < (0)) __PYX_ERR(62, 65, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createGlobalVectorFromField", 1, 1, 1, i); __PYX_ERR(62, 65, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 65, __pyx_L3_error)
    }
    __pyx_v_fieldname = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createGlobalVectorFromField", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 65, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  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":83
 * 
 *         """
 *         cdef const char *cfieldname = NULL             # <<<<<<<<<<<<<<
 *         cdef Vec vg = Vec()
 *         fieldname = str2bytes(fieldname, &cfieldname)
*/
  __pyx_v_cfieldname = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":84
 *         """
 *         cdef const char *cfieldname = NULL
 *         cdef Vec vg = Vec()             # <<<<<<<<<<<<<<
 *         fieldname = str2bytes(fieldname, &cfieldname)
 *         CHKERR(DMSwarmCreateGlobalVectorFromField(self.dm, cfieldname, &vg.vec))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 84, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vg = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":85
 *         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, 85, __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":86
 *         cdef Vec vg = Vec()
 *         fieldname = str2bytes(fieldname, &cfieldname)
 *         CHKERR(DMSwarmCreateGlobalVectorFromField(self.dm, cfieldname, &vg.vec))             # <<<<<<<<<<<<<<
 *         return vg
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCreateGlobalVectorFromField(__pyx_v_self->__pyx_base.dm, __pyx_v_cfieldname, (&__pyx_v_vg->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 86, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":87
 *         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":65
 *         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_XDECREF(__pyx_t_2);
  __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":89
 *         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:89");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_5destroyGlobalVectorFromField = {"destroyGlobalVectorFromField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_5destroyGlobalVectorFromField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_4destroyGlobalVectorFromField};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fieldname,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 89, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 89, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroyGlobalVectorFromField", 0) < (0)) __PYX_ERR(62, 89, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroyGlobalVectorFromField", 1, 1, 1, i); __PYX_ERR(62, 89, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 89, __pyx_L3_error)
    }
    __pyx_v_fieldname = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroyGlobalVectorFromField", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 89, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":104
 * 
 *         """
 *         cdef const char *cfieldname = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscVec vec = NULL
 *         fieldname = str2bytes(fieldname, &cfieldname)
*/
  __pyx_v_cfieldname = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":105
 *         """
 *         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":106
 *         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, 106, __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":107
 *         cdef PetscVec vec = NULL
 *         fieldname = str2bytes(fieldname, &cfieldname)
 *         CHKERR(DMSwarmDestroyGlobalVectorFromField(self.dm, cfieldname, &vec))             # <<<<<<<<<<<<<<
 * 
 *     def createGlobalVectorFromFields(self, fieldnames: Sequence[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, 107, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":89
 *         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":109
 *         CHKERR(DMSwarmDestroyGlobalVectorFromField(self.dm, cfieldname, &vec))
 * 
 *     def createGlobalVectorFromFields(self, fieldnames: Sequence[str]) -> Vec:             # <<<<<<<<<<<<<<
 *         """Create a global `Vec` object associated with a given set of fields.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_7createGlobalVectorFromFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_6createGlobalVectorFromFields, "DMSwarm.createGlobalVectorFromFields(self, fieldnames: Sequence[str]) -> Vec\nCreate a global `Vec` object associated with a given set of fields.\n\n        Collective.\n\n        The vector must be returned to the `DMSwarm` using a matching call to\n        `destroyGlobalVectorFromFields`.\n\n        Parameters\n        ----------\n        fieldnames\n            The textual name given to each registered field.\n\n        See Also\n        --------\n        destroyGlobalVectorFromFields, petsc.DMSwarmCreateGlobalVectorFromFields\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:109");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_7createGlobalVectorFromFields = {"createGlobalVectorFromFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_7createGlobalVectorFromFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_6createGlobalVectorFromFields};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_7createGlobalVectorFromFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createGlobalVectorFromFields (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fieldnames,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 109, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 109, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createGlobalVectorFromFields", 0) < (0)) __PYX_ERR(62, 109, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createGlobalVectorFromFields", 1, 1, 1, i); __PYX_ERR(62, 109, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 109, __pyx_L3_error)
    }
    __pyx_v_fieldnames = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createGlobalVectorFromFields", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 109, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.createGlobalVectorFromFields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_6createGlobalVectorFromFields(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldnames);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_6createGlobalVectorFromFields(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldnames) {
  char const *__pyx_v_cval;
  PetscInt __pyx_v_i;
  PetscInt __pyx_v_nf;
  char const **__pyx_v_cfieldnames;
  CYTHON_UNUSED PyObject *__pyx_v_unused = 0;
  struct PyPetscVecObject *__pyx_v_vg = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PetscInt __pyx_t_4;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createGlobalVectorFromFields", 0);
  __Pyx_INCREF(__pyx_v_fieldnames);

  /* "petsc4py/PETSc/DMSwarm.pyx":127
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fieldnames)
 *         cdef const char **cfieldnames = NULL
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":128
 *         """
 *         cdef const char *cval = NULL
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fieldnames)             # <<<<<<<<<<<<<<
 *         cdef const char **cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)
*/
  __pyx_v_i = 0;
  __pyx_t_1 = PyObject_Length(__pyx_v_fieldnames); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(62, 128, __pyx_L1_error)
  __pyx_v_nf = ((PetscInt)__pyx_t_1);

  /* "petsc4py/PETSc/DMSwarm.pyx":129
 *         cdef const char *cval = NULL
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fieldnames)
 *         cdef const char **cfieldnames = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)
 *         fieldnames = list(fieldnames)
*/
  __pyx_v_cfieldnames = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":130
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fieldnames)
 *         cdef const char **cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)             # <<<<<<<<<<<<<<
 *         fieldnames = list(fieldnames)
 *         for i from 0 <= i < nf:
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 130, __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, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":131
 *         cdef const char **cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)
 *         fieldnames = list(fieldnames)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nf:
 *             str2bytes(fieldnames[i], &cval)
*/
  __pyx_t_3 = PySequence_List(__pyx_v_fieldnames); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 131, __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":132
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)
 *         fieldnames = list(fieldnames)
 *         for i from 0 <= i < nf:             # <<<<<<<<<<<<<<
 *             str2bytes(fieldnames[i], &cval)
 *             cfieldnames[i] = cval
*/
  __pyx_t_4 = __pyx_v_nf;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "petsc4py/PETSc/DMSwarm.pyx":133
 *         fieldnames = list(fieldnames)
 *         for i from 0 <= i < nf:
 *             str2bytes(fieldnames[i], &cval)             # <<<<<<<<<<<<<<
 *             cfieldnames[i] = cval
 *         cdef Vec vg = Vec()
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_fieldnames, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_3, (&__pyx_v_cval)); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 133, __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/DMSwarm.pyx":134
 *         for i from 0 <= i < nf:
 *             str2bytes(fieldnames[i], &cval)
 *             cfieldnames[i] = cval             # <<<<<<<<<<<<<<
 *         cdef Vec vg = Vec()
 *         CHKERR(DMSwarmCreateGlobalVectorFromFields(self.dm, nf, cfieldnames, &vg.vec))
*/
    (__pyx_v_cfieldnames[__pyx_v_i]) = __pyx_v_cval;
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":135
 *             str2bytes(fieldnames[i], &cval)
 *             cfieldnames[i] = cval
 *         cdef Vec vg = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmCreateGlobalVectorFromFields(self.dm, nf, cfieldnames, &vg.vec))
 *         return vg
*/
  __pyx_t_3 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 135, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_vg = ((struct PyPetscVecObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":136
 *             cfieldnames[i] = cval
 *         cdef Vec vg = Vec()
 *         CHKERR(DMSwarmCreateGlobalVectorFromFields(self.dm, nf, cfieldnames, &vg.vec))             # <<<<<<<<<<<<<<
 *         return vg
 * 
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCreateGlobalVectorFromFields(__pyx_v_self->__pyx_base.dm, __pyx_v_nf, __pyx_v_cfieldnames, (&__pyx_v_vg->vec))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 136, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":137
 *         cdef Vec vg = Vec()
 *         CHKERR(DMSwarmCreateGlobalVectorFromFields(self.dm, nf, cfieldnames, &vg.vec))
 *         return vg             # <<<<<<<<<<<<<<
 * 
 *     def destroyGlobalVectorFromFields(self, fieldnames: Sequence[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":109
 *         CHKERR(DMSwarmDestroyGlobalVectorFromField(self.dm, cfieldname, &vec))
 * 
 *     def createGlobalVectorFromFields(self, fieldnames: Sequence[str]) -> Vec:             # <<<<<<<<<<<<<<
 *         """Create a global `Vec` object associated with a given set of fields.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.createGlobalVectorFromFields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF((PyObject *)__pyx_v_vg);
  __Pyx_XDECREF(__pyx_v_fieldnames);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":139
 *         return vg
 * 
 *     def destroyGlobalVectorFromFields(self, fieldnames: Sequence[str]) -> None:             # <<<<<<<<<<<<<<
 *         """Destroy the global `Vec` object associated with a given set of fields.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_9destroyGlobalVectorFromFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_8destroyGlobalVectorFromFields, "DMSwarm.destroyGlobalVectorFromFields(self, fieldnames: Sequence[str]) -> None\nDestroy the global `Vec` object associated with a given set of fields.\n\n        Collective.\n\n        Parameters\n        ----------\n        fieldnames\n            The textual name given to each registered field.\n\n        See Also\n        --------\n        createGlobalVectorFromFields, petsc.DMSwarmDestroyGlobalVectorFromFields\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:139");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_9destroyGlobalVectorFromFields = {"destroyGlobalVectorFromFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_9destroyGlobalVectorFromFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_8destroyGlobalVectorFromFields};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_9destroyGlobalVectorFromFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyGlobalVectorFromFields (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fieldnames,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 139, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 139, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroyGlobalVectorFromFields", 0) < (0)) __PYX_ERR(62, 139, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroyGlobalVectorFromFields", 1, 1, 1, i); __PYX_ERR(62, 139, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 139, __pyx_L3_error)
    }
    __pyx_v_fieldnames = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroyGlobalVectorFromFields", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 139, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.destroyGlobalVectorFromFields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_8destroyGlobalVectorFromFields(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldnames);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_8destroyGlobalVectorFromFields(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldnames) {
  char const *__pyx_v_cval;
  PetscInt __pyx_v_i;
  PetscInt __pyx_v_nf;
  char const **__pyx_v_cfieldnames;
  CYTHON_UNUSED PyObject *__pyx_v_unused = 0;
  Vec __pyx_v_vec;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  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("destroyGlobalVectorFromFields", 0);
  __Pyx_INCREF(__pyx_v_fieldnames);

  /* "petsc4py/PETSc/DMSwarm.pyx":154
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fieldnames)
 *         cdef const char **cfieldnames = NULL
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":155
 *         """
 *         cdef const char *cval = NULL
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fieldnames)             # <<<<<<<<<<<<<<
 *         cdef const char **cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)
*/
  __pyx_v_i = 0;
  __pyx_t_1 = PyObject_Length(__pyx_v_fieldnames); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(62, 155, __pyx_L1_error)
  __pyx_v_nf = ((PetscInt)__pyx_t_1);

  /* "petsc4py/PETSc/DMSwarm.pyx":156
 *         cdef const char *cval = NULL
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fieldnames)
 *         cdef const char **cfieldnames = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)
 *         fieldnames = list(fieldnames)
*/
  __pyx_v_cfieldnames = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":157
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fieldnames)
 *         cdef const char **cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)             # <<<<<<<<<<<<<<
 *         fieldnames = list(fieldnames)
 *         for i from 0 <= i < nf:
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 157, __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, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":158
 *         cdef const char **cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)
 *         fieldnames = list(fieldnames)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nf:
 *             str2bytes(fieldnames[i], &cval)
*/
  __pyx_t_3 = PySequence_List(__pyx_v_fieldnames); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 158, __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":159
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)
 *         fieldnames = list(fieldnames)
 *         for i from 0 <= i < nf:             # <<<<<<<<<<<<<<
 *             str2bytes(fieldnames[i], &cval)
 *             cfieldnames[i] = cval
*/
  __pyx_t_4 = __pyx_v_nf;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "petsc4py/PETSc/DMSwarm.pyx":160
 *         fieldnames = list(fieldnames)
 *         for i from 0 <= i < nf:
 *             str2bytes(fieldnames[i], &cval)             # <<<<<<<<<<<<<<
 *             cfieldnames[i] = cval
 *         cdef PetscVec vec = NULL
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_fieldnames, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_3, (&__pyx_v_cval)); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 160, __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/DMSwarm.pyx":161
 *         for i from 0 <= i < nf:
 *             str2bytes(fieldnames[i], &cval)
 *             cfieldnames[i] = cval             # <<<<<<<<<<<<<<
 *         cdef PetscVec vec = NULL
 *         CHKERR(DMSwarmDestroyGlobalVectorFromFields(self.dm, nf, cfieldnames, &vec))
*/
    (__pyx_v_cfieldnames[__pyx_v_i]) = __pyx_v_cval;
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":162
 *             str2bytes(fieldnames[i], &cval)
 *             cfieldnames[i] = cval
 *         cdef PetscVec vec = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmDestroyGlobalVectorFromFields(self.dm, nf, cfieldnames, &vec))
 * 
*/
  __pyx_v_vec = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":163
 *             cfieldnames[i] = cval
 *         cdef PetscVec vec = NULL
 *         CHKERR(DMSwarmDestroyGlobalVectorFromFields(self.dm, nf, cfieldnames, &vec))             # <<<<<<<<<<<<<<
 * 
 *     def createLocalVectorFromField(self, fieldname: str) -> Vec:
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmDestroyGlobalVectorFromFields(__pyx_v_self->__pyx_base.dm, __pyx_v_nf, __pyx_v_cfieldnames, (&__pyx_v_vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 163, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":139
 *         return vg
 * 
 *     def destroyGlobalVectorFromFields(self, fieldnames: Sequence[str]) -> None:             # <<<<<<<<<<<<<<
 *         """Destroy the global `Vec` object associated with a given set of fields.
 * 
*/

  /* 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.destroyGlobalVectorFromFields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF(__pyx_v_fieldnames);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":165
 *         CHKERR(DMSwarmDestroyGlobalVectorFromFields(self.dm, nf, cfieldnames, &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_11createLocalVectorFromField(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_10createLocalVectorFromField, "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:165");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_11createLocalVectorFromField = {"createLocalVectorFromField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_11createLocalVectorFromField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_10createLocalVectorFromField};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_11createLocalVectorFromField(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fieldname,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 165, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createLocalVectorFromField", 0) < (0)) __PYX_ERR(62, 165, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createLocalVectorFromField", 1, 1, 1, i); __PYX_ERR(62, 165, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 165, __pyx_L3_error)
    }
    __pyx_v_fieldname = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createLocalVectorFromField", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 165, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_10createLocalVectorFromField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_10createLocalVectorFromField(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  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":183
 * 
 *         """
 *         cdef const char *cfieldname = NULL             # <<<<<<<<<<<<<<
 *         cdef Vec vl = Vec()
 *         fieldname = str2bytes(fieldname, &cfieldname)
*/
  __pyx_v_cfieldname = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":184
 *         """
 *         cdef const char *cfieldname = NULL
 *         cdef Vec vl = Vec()             # <<<<<<<<<<<<<<
 *         fieldname = str2bytes(fieldname, &cfieldname)
 *         CHKERR(DMSwarmCreateLocalVectorFromField(self.dm, cfieldname, &vl.vec))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 184, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vl = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":185
 *         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, 185, __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":186
 *         cdef Vec vl = Vec()
 *         fieldname = str2bytes(fieldname, &cfieldname)
 *         CHKERR(DMSwarmCreateLocalVectorFromField(self.dm, cfieldname, &vl.vec))             # <<<<<<<<<<<<<<
 *         return vl
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCreateLocalVectorFromField(__pyx_v_self->__pyx_base.dm, __pyx_v_cfieldname, (&__pyx_v_vl->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 186, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":187
 *         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":165
 *         CHKERR(DMSwarmDestroyGlobalVectorFromFields(self.dm, nf, cfieldnames, &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_XDECREF(__pyx_t_2);
  __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":189
 *         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_13destroyLocalVectorFromField(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_12destroyLocalVectorFromField, "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:189");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_13destroyLocalVectorFromField = {"destroyLocalVectorFromField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_13destroyLocalVectorFromField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_12destroyLocalVectorFromField};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_13destroyLocalVectorFromField(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fieldname,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 189, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 189, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroyLocalVectorFromField", 0) < (0)) __PYX_ERR(62, 189, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroyLocalVectorFromField", 1, 1, 1, i); __PYX_ERR(62, 189, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 189, __pyx_L3_error)
    }
    __pyx_v_fieldname = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroyLocalVectorFromField", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 189, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_12destroyLocalVectorFromField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_12destroyLocalVectorFromField(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":204
 * 
 *         """
 *         cdef const char *cfieldname = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscVec vec = NULL
 *         fieldname = str2bytes(fieldname, &cfieldname)
*/
  __pyx_v_cfieldname = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":205
 *         """
 *         cdef const char *cfieldname = NULL
 *         cdef PetscVec vec = NULL             # <<<<<<<<<<<<<<
 *         fieldname = str2bytes(fieldname, &cfieldname)
 *         CHKERR(DMSwarmDestroyLocalVectorFromField(self.dm, cfieldname, &vec))
*/
  __pyx_v_vec = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":206
 *         cdef const char *cfieldname = NULL
 *         cdef PetscVec vec = NULL
 *         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, 206, __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":207
 *         cdef PetscVec vec = NULL
 *         fieldname = str2bytes(fieldname, &cfieldname)
 *         CHKERR(DMSwarmDestroyLocalVectorFromField(self.dm, cfieldname, &vec))             # <<<<<<<<<<<<<<
 * 
 *     def createLocalVectorFromFields(self, fieldnames: Sequence[str]) -> Vec:
*/
  __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, 207, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":189
 *         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":209
 *         CHKERR(DMSwarmDestroyLocalVectorFromField(self.dm, cfieldname, &vec))
 * 
 *     def createLocalVectorFromFields(self, fieldnames: Sequence[str]) -> Vec:             # <<<<<<<<<<<<<<
 *         """Create a local `Vec` object associated with a given set of fields.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_15createLocalVectorFromFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_14createLocalVectorFromFields, "DMSwarm.createLocalVectorFromFields(self, fieldnames: Sequence[str]) -> Vec\nCreate a local `Vec` object associated with a given set of fields.\n\n        Collective.\n\n        The vector must be returned to the `DMSwarm` using a matching call to\n        `destroyLocalVectorFromFields`.\n\n        Parameters\n        ----------\n        fieldnames\n            The textual name given to each registered field.\n\n        See Also\n        --------\n        destroyLocalVectorFromFields, petsc.DMSwarmCreateLocalVectorFromFields\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:209");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_15createLocalVectorFromFields = {"createLocalVectorFromFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_15createLocalVectorFromFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_14createLocalVectorFromFields};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_15createLocalVectorFromFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("createLocalVectorFromFields (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fieldnames,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 209, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 209, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "createLocalVectorFromFields", 0) < (0)) __PYX_ERR(62, 209, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("createLocalVectorFromFields", 1, 1, 1, i); __PYX_ERR(62, 209, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 209, __pyx_L3_error)
    }
    __pyx_v_fieldnames = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("createLocalVectorFromFields", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 209, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.createLocalVectorFromFields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_14createLocalVectorFromFields(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldnames);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_14createLocalVectorFromFields(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldnames) {
  char const *__pyx_v_cval;
  PetscInt __pyx_v_i;
  PetscInt __pyx_v_nf;
  char const **__pyx_v_cfieldnames;
  CYTHON_UNUSED PyObject *__pyx_v_unused = 0;
  struct PyPetscVecObject *__pyx_v_vl = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PetscInt __pyx_t_4;
  size_t __pyx_t_5;
  PetscErrorCode __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createLocalVectorFromFields", 0);
  __Pyx_INCREF(__pyx_v_fieldnames);

  /* "petsc4py/PETSc/DMSwarm.pyx":227
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fieldnames)
 *         cdef const char **cfieldnames = NULL
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":228
 *         """
 *         cdef const char *cval = NULL
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fieldnames)             # <<<<<<<<<<<<<<
 *         cdef const char **cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)
*/
  __pyx_v_i = 0;
  __pyx_t_1 = PyObject_Length(__pyx_v_fieldnames); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(62, 228, __pyx_L1_error)
  __pyx_v_nf = ((PetscInt)__pyx_t_1);

  /* "petsc4py/PETSc/DMSwarm.pyx":229
 *         cdef const char *cval = NULL
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fieldnames)
 *         cdef const char **cfieldnames = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)
 *         fieldnames = list(fieldnames)
*/
  __pyx_v_cfieldnames = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":230
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fieldnames)
 *         cdef const char **cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)             # <<<<<<<<<<<<<<
 *         fieldnames = list(fieldnames)
 *         for i from 0 <= i < nf:
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 230, __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, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":231
 *         cdef const char **cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)
 *         fieldnames = list(fieldnames)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nf:
 *             str2bytes(fieldnames[i], &cval)
*/
  __pyx_t_3 = PySequence_List(__pyx_v_fieldnames); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 231, __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":232
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)
 *         fieldnames = list(fieldnames)
 *         for i from 0 <= i < nf:             # <<<<<<<<<<<<<<
 *             str2bytes(fieldnames[i], &cval)
 *             cfieldnames[i] = cval
*/
  __pyx_t_4 = __pyx_v_nf;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "petsc4py/PETSc/DMSwarm.pyx":233
 *         fieldnames = list(fieldnames)
 *         for i from 0 <= i < nf:
 *             str2bytes(fieldnames[i], &cval)             # <<<<<<<<<<<<<<
 *             cfieldnames[i] = cval
 *         cdef Vec vl = Vec()
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_fieldnames, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 233, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_3, (&__pyx_v_cval)); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 233, __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/DMSwarm.pyx":234
 *         for i from 0 <= i < nf:
 *             str2bytes(fieldnames[i], &cval)
 *             cfieldnames[i] = cval             # <<<<<<<<<<<<<<
 *         cdef Vec vl = Vec()
 *         CHKERR(DMSwarmCreateLocalVectorFromFields(self.dm, nf, cfieldnames, &vl.vec))
*/
    (__pyx_v_cfieldnames[__pyx_v_i]) = __pyx_v_cval;
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":235
 *             str2bytes(fieldnames[i], &cval)
 *             cfieldnames[i] = cval
 *         cdef Vec vl = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmCreateLocalVectorFromFields(self.dm, nf, cfieldnames, &vl.vec))
 *         return vl
*/
  __pyx_t_3 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 235, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_vl = ((struct PyPetscVecObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":236
 *             cfieldnames[i] = cval
 *         cdef Vec vl = Vec()
 *         CHKERR(DMSwarmCreateLocalVectorFromFields(self.dm, nf, cfieldnames, &vl.vec))             # <<<<<<<<<<<<<<
 *         return vl
 * 
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCreateLocalVectorFromFields(__pyx_v_self->__pyx_base.dm, __pyx_v_nf, __pyx_v_cfieldnames, (&__pyx_v_vl->vec))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 236, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":237
 *         cdef Vec vl = Vec()
 *         CHKERR(DMSwarmCreateLocalVectorFromFields(self.dm, nf, cfieldnames, &vl.vec))
 *         return vl             # <<<<<<<<<<<<<<
 * 
 *     def destroyLocalVectorFromFields(self, fieldnames: Sequence[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":209
 *         CHKERR(DMSwarmDestroyLocalVectorFromField(self.dm, cfieldname, &vec))
 * 
 *     def createLocalVectorFromFields(self, fieldnames: Sequence[str]) -> Vec:             # <<<<<<<<<<<<<<
 *         """Create a local `Vec` object associated with a given set of fields.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.createLocalVectorFromFields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF((PyObject *)__pyx_v_vl);
  __Pyx_XDECREF(__pyx_v_fieldnames);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":239
 *         return vl
 * 
 *     def destroyLocalVectorFromFields(self, fieldnames: Sequence[str]) -> None:             # <<<<<<<<<<<<<<
 *         """Destroy the local `Vec` object associated with a given set of fields.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_17destroyLocalVectorFromFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_16destroyLocalVectorFromFields, "DMSwarm.destroyLocalVectorFromFields(self, fieldnames: Sequence[str]) -> None\nDestroy the local `Vec` object associated with a given set of fields.\n\n        Collective.\n\n        Parameters\n        ----------\n        fieldnames\n            The textual name given to each registered field.\n\n        See Also\n        --------\n        createLocalVectorFromFields, petsc.DMSwarmDestroyLocalVectorFromFields\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:239");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_17destroyLocalVectorFromFields = {"destroyLocalVectorFromFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_17destroyLocalVectorFromFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_16destroyLocalVectorFromFields};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_17destroyLocalVectorFromFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroyLocalVectorFromFields (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fieldnames,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 239, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 239, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "destroyLocalVectorFromFields", 0) < (0)) __PYX_ERR(62, 239, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("destroyLocalVectorFromFields", 1, 1, 1, i); __PYX_ERR(62, 239, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 239, __pyx_L3_error)
    }
    __pyx_v_fieldnames = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("destroyLocalVectorFromFields", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 239, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.destroyLocalVectorFromFields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_16destroyLocalVectorFromFields(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldnames);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_16destroyLocalVectorFromFields(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_fieldnames) {
  char const *__pyx_v_cval;
  PetscInt __pyx_v_i;
  PetscInt __pyx_v_nf;
  char const **__pyx_v_cfieldnames;
  CYTHON_UNUSED PyObject *__pyx_v_unused = 0;
  Vec __pyx_v_vec;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  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("destroyLocalVectorFromFields", 0);
  __Pyx_INCREF(__pyx_v_fieldnames);

  /* "petsc4py/PETSc/DMSwarm.pyx":254
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fieldnames)
 *         cdef const char **cfieldnames = NULL
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":255
 *         """
 *         cdef const char *cval = NULL
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fieldnames)             # <<<<<<<<<<<<<<
 *         cdef const char **cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)
*/
  __pyx_v_i = 0;
  __pyx_t_1 = PyObject_Length(__pyx_v_fieldnames); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(62, 255, __pyx_L1_error)
  __pyx_v_nf = ((PetscInt)__pyx_t_1);

  /* "petsc4py/PETSc/DMSwarm.pyx":256
 *         cdef const char *cval = NULL
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fieldnames)
 *         cdef const char **cfieldnames = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)
 *         fieldnames = list(fieldnames)
*/
  __pyx_v_cfieldnames = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":257
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fieldnames)
 *         cdef const char **cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)             # <<<<<<<<<<<<<<
 *         fieldnames = list(fieldnames)
 *         for i from 0 <= i < nf:
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 257, __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, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":258
 *         cdef const char **cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)
 *         fieldnames = list(fieldnames)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nf:
 *             str2bytes(fieldnames[i], &cval)
*/
  __pyx_t_3 = PySequence_List(__pyx_v_fieldnames); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 258, __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":259
 *         cdef object unused = oarray_p(empty_p(nf), NULL, <void**>&cfieldnames)
 *         fieldnames = list(fieldnames)
 *         for i from 0 <= i < nf:             # <<<<<<<<<<<<<<
 *             str2bytes(fieldnames[i], &cval)
 *             cfieldnames[i] = cval
*/
  __pyx_t_4 = __pyx_v_nf;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "petsc4py/PETSc/DMSwarm.pyx":260
 *         fieldnames = list(fieldnames)
 *         for i from 0 <= i < nf:
 *             str2bytes(fieldnames[i], &cval)             # <<<<<<<<<<<<<<
 *             cfieldnames[i] = cval
 *         cdef PetscVec vec = NULL
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_fieldnames, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_3, (&__pyx_v_cval)); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 260, __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/DMSwarm.pyx":261
 *         for i from 0 <= i < nf:
 *             str2bytes(fieldnames[i], &cval)
 *             cfieldnames[i] = cval             # <<<<<<<<<<<<<<
 *         cdef PetscVec vec = NULL
 *         CHKERR(DMSwarmDestroyLocalVectorFromFields(self.dm, nf, cfieldnames, &vec))
*/
    (__pyx_v_cfieldnames[__pyx_v_i]) = __pyx_v_cval;
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":262
 *             str2bytes(fieldnames[i], &cval)
 *             cfieldnames[i] = cval
 *         cdef PetscVec vec = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmDestroyLocalVectorFromFields(self.dm, nf, cfieldnames, &vec))
 * 
*/
  __pyx_v_vec = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":263
 *             cfieldnames[i] = cval
 *         cdef PetscVec vec = NULL
 *         CHKERR(DMSwarmDestroyLocalVectorFromFields(self.dm, nf, cfieldnames, &vec))             # <<<<<<<<<<<<<<
 * 
 *     def initializeFieldRegister(self) -> None:
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmDestroyLocalVectorFromFields(__pyx_v_self->__pyx_base.dm, __pyx_v_nf, __pyx_v_cfieldnames, (&__pyx_v_vec))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 263, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":239
 *         return vl
 * 
 *     def destroyLocalVectorFromFields(self, fieldnames: Sequence[str]) -> None:             # <<<<<<<<<<<<<<
 *         """Destroy the local `Vec` object associated with a given set of fields.
 * 
*/

  /* 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.destroyLocalVectorFromFields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unused);
  __Pyx_XDECREF(__pyx_v_fieldnames);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":265
 *         CHKERR(DMSwarmDestroyLocalVectorFromFields(self.dm, nf, cfieldnames, &vec))
 * 
 *     def initializeFieldRegister(self) -> None:             # <<<<<<<<<<<<<<
 *         """Initiate the registration of fields to a `DMSwarm`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_19initializeFieldRegister(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_18initializeFieldRegister, "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:265");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_19initializeFieldRegister = {"initializeFieldRegister", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_19initializeFieldRegister, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_18initializeFieldRegister};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_19initializeFieldRegister(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("initializeFieldRegister", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_18initializeFieldRegister(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_18initializeFieldRegister(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":277
 * 
 *         """
 *         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, 277, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":265
 *         CHKERR(DMSwarmDestroyLocalVectorFromFields(self.dm, nf, cfieldnames, &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":279
 *         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_21finalizeFieldRegister(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_20finalizeFieldRegister, "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:279");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_21finalizeFieldRegister = {"finalizeFieldRegister", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_21finalizeFieldRegister, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_20finalizeFieldRegister};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_21finalizeFieldRegister(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("finalizeFieldRegister", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_20finalizeFieldRegister(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_20finalizeFieldRegister(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":289
 * 
 *         """
 *         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, 289, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":279
 *         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":291
 *         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_23setLocalSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_22setLocalSizes, "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:291");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_23setLocalSizes = {"setLocalSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_23setLocalSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_22setLocalSizes};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_23setLocalSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nlocal,&__pyx_mstate_global->__pyx_n_u_buffer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 291, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 291, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 291, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLocalSizes", 0) < (0)) __PYX_ERR(62, 291, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLocalSizes", 1, 2, 2, i); __PYX_ERR(62, 291, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 291, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 291, __pyx_L3_error)
    }
    __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, 291, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_22setLocalSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_nlocal, __pyx_v_buffer);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_22setLocalSizes(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":308
 * 
 *         """
 *         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, 308, __pyx_L1_error)
  __pyx_v_cnlocal = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":309
 *         """
 *         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, 309, __pyx_L1_error)
  __pyx_v_cbuffer = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":310
 *         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, 310, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":311
 *         cdef PetscInt cbuffer = asInt(buffer)
 *         CHKERR(DMSwarmSetLocalSizes(self.dm, cnlocal, cbuffer))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def registerField(self, fieldname: str, blocksize: int, dtype: type | 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":291
 *         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":313
 *         return self
 * 
 *     def registerField(self, fieldname: str, blocksize: int, dtype: type | dtype = ScalarType) -> None:             # <<<<<<<<<<<<<<
 *         """Register a field to a `DMSwarm` with a native PETSc data type.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_25registerField(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_24registerField, "DMSwarm.registerField(self, fieldname: str, blocksize: int, dtype: type | 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:313");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_25registerField = {"registerField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_25registerField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_24registerField};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_25registerField(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fieldname,&__pyx_mstate_global->__pyx_n_u_blocksize,&__pyx_mstate_global->__pyx_n_u_dtype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 313, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(62, 313, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 313, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 313, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "registerField", 0) < (0)) __PYX_ERR(62, 313, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__26);
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("registerField", 0, 2, 3, i); __PYX_ERR(62, 313, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(62, 313, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 313, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 313, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(__pyx_mstate_global->__pyx_k__26);
    }
    __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, 313, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_24registerField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname, __pyx_v_blocksize, __pyx_v_dtype);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_24registerField(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":332
 * 
 *         """
 *         cdef const char *cfieldname = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt cblocksize = asInt(blocksize)
 *         cdef PetscDataType ctype  = PETSC_DATATYPE_UNKNOWN
*/
  __pyx_v_cfieldname = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":333
 *         """
 *         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, 333, __pyx_L1_error)
  __pyx_v_cblocksize = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":334
 *         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":335
 *         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_mstate_global->__pyx_n_u_IntType); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 335, __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, 335, __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, 335, __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":336
 *         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_mstate_global->__pyx_n_u_RealType); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 336, __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, 336, __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, 336, __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":337
 *         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_mstate_global->__pyx_n_u_ScalarType); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 337, __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, 337, __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, 337, __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":338
 *         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_mstate_global->__pyx_n_u_ComplexType); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 338, __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, 338, __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, 338, __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":339
 *         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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(62, 339, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(62, 339, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DMSwarm.pyx":340
 *         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, 340, __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":341
 *         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, 341, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":313
 *         return self
 * 
 *     def registerField(self, fieldname: str, blocksize: int, dtype: type | 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":343
 *         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_27getField(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_26getField, "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. The array is two dimensional with shape ``(num_points, blocksize)``.\n\n        See Also\n        --------\n        restoreField, petsc.DMSwarmGetField\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:343");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_27getField = {"getField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_27getField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_26getField};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_27getField(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fieldname,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 343, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 343, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getField", 0) < (0)) __PYX_ERR(62, 343, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getField", 1, 1, 1, i); __PYX_ERR(62, 343, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 343, __pyx_L3_error)
    }
    __pyx_v_fieldname = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getField", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 343, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_26getField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_26getField(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[2];
  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":369
 * 
 *         """
 *         cdef const char *cfieldname = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt blocksize = 0
 *         cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN
*/
  __pyx_v_cfieldname = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":370
 *         """
 *         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":371
 *         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":372
 *         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":373
 *         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, <void**> &data))
*/
  __pyx_v_nlocal = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":374
 *         cdef PetscReal *data = NULL
 *         cdef PetscInt nlocal = 0
 *         fieldname = str2bytes(fieldname, &cfieldname)             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmGetField(self.dm, cfieldname, &blocksize, &ctype, <void**> &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, 374, __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":375
 *         cdef PetscInt nlocal = 0
 *         fieldname = str2bytes(fieldname, &cfieldname)
 *         CHKERR(DMSwarmGetField(self.dm, cfieldname, &blocksize, &ctype, <void**> &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, 375, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":376
 *         fieldname = str2bytes(fieldname, &cfieldname)
 *         CHKERR(DMSwarmGetField(self.dm, cfieldname, &blocksize, &ctype, <void**> &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, 376, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":377
 *         CHKERR(DMSwarmGetField(self.dm, cfieldname, &blocksize, &ctype, <void**> &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":378
 *         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":379
 *         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":380
 *         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
 *         if ctype == PETSC_DOUBLE:  typenum = NPY_DOUBLE
*/
  __pyx_t_3 = (__pyx_v_ctype == PETSC_SCALAR);
  if (__pyx_t_3) {
    __pyx_v_typenum = NPY_PETSC_SCALAR;
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":381
 *         if ctype == PETSC_REAL:    typenum = NPY_PETSC_REAL
 *         if ctype == PETSC_SCALAR:  typenum = NPY_PETSC_SCALAR
 *         if ctype == PETSC_COMPLEX: typenum = NPY_PETSC_COMPLEX             # <<<<<<<<<<<<<<
 *         if ctype == PETSC_DOUBLE:  typenum = NPY_DOUBLE
 *         assert typenum != -1
*/
  __pyx_t_3 = (__pyx_v_ctype == PETSC_COMPLEX);
  if (__pyx_t_3) {
    __pyx_v_typenum = NPY_PETSC_COMPLEX;
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":382
 *         if ctype == PETSC_SCALAR:  typenum = NPY_PETSC_SCALAR
 *         if ctype == PETSC_COMPLEX: typenum = NPY_PETSC_COMPLEX
 *         if ctype == PETSC_DOUBLE:  typenum = NPY_DOUBLE             # <<<<<<<<<<<<<<
 *         assert typenum != -1
 *         cdef npy_intp s[2]
*/
  __pyx_t_3 = (__pyx_v_ctype == PETSC_DOUBLE);
  if (__pyx_t_3) {
    __pyx_v_typenum = NPY_DOUBLE;
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":383
 *         if ctype == PETSC_COMPLEX: typenum = NPY_PETSC_COMPLEX
 *         if ctype == PETSC_DOUBLE:  typenum = NPY_DOUBLE
 *         assert typenum != -1             # <<<<<<<<<<<<<<
 *         cdef npy_intp s[2]
 *         s[0] = <npy_intp> nlocal
*/
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_3 = (__pyx_v_typenum != -1L);
    if (unlikely(!__pyx_t_3)) {
      __Pyx_Raise(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(62, 383, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(62, 383, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/DMSwarm.pyx":385
 *         assert typenum != -1
 *         cdef npy_intp s[2]
 *         s[0] = <npy_intp> nlocal             # <<<<<<<<<<<<<<
 *         s[1] = <npy_intp> blocksize
 *         return <object> PyArray_SimpleNewFromData(2, s, typenum, data)
*/
  (__pyx_v_s[0]) = ((npy_intp)__pyx_v_nlocal);

  /* "petsc4py/PETSc/DMSwarm.pyx":386
 *         cdef npy_intp s[2]
 *         s[0] = <npy_intp> nlocal
 *         s[1] = <npy_intp> blocksize             # <<<<<<<<<<<<<<
 *         return <object> PyArray_SimpleNewFromData(2, s, typenum, data)
 * 
*/
  (__pyx_v_s[1]) = ((npy_intp)__pyx_v_blocksize);

  /* "petsc4py/PETSc/DMSwarm.pyx":387
 *         s[0] = <npy_intp> nlocal
 *         s[1] = <npy_intp> blocksize
 *         return <object> PyArray_SimpleNewFromData(2, s, typenum, data)             # <<<<<<<<<<<<<<
 * 
 *     def restoreField(self, fieldname: str) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)PyArray_SimpleNewFromData(2, __pyx_v_s, __pyx_v_typenum, __pyx_v_data)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 387, __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":343
 *         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":389
 *         return <object> PyArray_SimpleNewFromData(2, 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_29restoreField(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_28restoreField, "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:389");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_29restoreField = {"restoreField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_29restoreField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_28restoreField};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_29restoreField(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fieldname,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 389, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 389, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "restoreField", 0) < (0)) __PYX_ERR(62, 389, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("restoreField", 1, 1, 1, i); __PYX_ERR(62, 389, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 389, __pyx_L3_error)
    }
    __pyx_v_fieldname = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("restoreField", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 389, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_28restoreField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_28restoreField(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":404
 * 
 *         """
 *         cdef const char *cfieldname = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt blocksize = 0
 *         cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN
*/
  __pyx_v_cfieldname = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":405
 *         """
 *         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":406
 *         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, <void**> 0))
*/
  __pyx_v_ctype = PETSC_DATATYPE_UNKNOWN;

  /* "petsc4py/PETSc/DMSwarm.pyx":407
 *         cdef PetscInt blocksize = 0
 *         cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN
 *         fieldname = str2bytes(fieldname, &cfieldname)             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmRestoreField(self.dm, cfieldname, &blocksize, &ctype, <void**> 0))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_fieldname, (&__pyx_v_cfieldname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 407, __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":408
 *         cdef PetscDataType ctype = PETSC_DATATYPE_UNKNOWN
 *         fieldname = str2bytes(fieldname, &cfieldname)
 *         CHKERR(DMSwarmRestoreField(self.dm, cfieldname, &blocksize, &ctype, <void**> 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, 408, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":389
 *         return <object> PyArray_SimpleNewFromData(2, 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":410
 *         CHKERR(DMSwarmRestoreField(self.dm, cfieldname, &blocksize, &ctype, <void**> 0))
 * 
 *     def vectorDefineField(self, fieldname: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the fields from which to define a `Vec` object.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_31vectorDefineField(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_30vectorDefineField, "DMSwarm.vectorDefineField(self, fieldname: str) -> None\nSet the fields 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 names given to a registered field.\n\n        See Also\n        --------\n        petsc.DMSwarmVectorDefineField\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:410");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_31vectorDefineField = {"vectorDefineField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_31vectorDefineField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_30vectorDefineField};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_31vectorDefineField(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fieldname,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 410, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 410, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "vectorDefineField", 0) < (0)) __PYX_ERR(62, 410, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("vectorDefineField", 1, 1, 1, i); __PYX_ERR(62, 410, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 410, __pyx_L3_error)
    }
    __pyx_v_fieldname = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("vectorDefineField", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 410, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_30vectorDefineField(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_fieldname);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_30vectorDefineField(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":428
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         fieldname = str2bytes(fieldname, &cval)
 *         CHKERR(DMSwarmVectorDefineField(self.dm, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":429
 *         """
 *         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, 429, __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":430
 *         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, 430, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":410
 *         CHKERR(DMSwarmRestoreField(self.dm, cfieldname, &blocksize, &ctype, <void**> 0))
 * 
 *     def vectorDefineField(self, fieldname: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the fields 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":432
 *         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_33addPoint(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_32addPoint, "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:432");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_33addPoint = {"addPoint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_33addPoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_32addPoint};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_33addPoint(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("addPoint", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_32addPoint(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_32addPoint(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":442
 * 
 *         """
 *         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, 442, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":432
 *         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":444
 *         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_35addNPoints(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_34addNPoints, "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:444");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_35addNPoints = {"addNPoints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_35addNPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_34addNPoints};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_35addNPoints(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_npoints,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 444, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 444, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addNPoints", 0) < (0)) __PYX_ERR(62, 444, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addNPoints", 1, 1, 1, i); __PYX_ERR(62, 444, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 444, __pyx_L3_error)
    }
    __pyx_v_npoints = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("addNPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 444, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_34addNPoints(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_npoints);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_34addNPoints(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":459
 * 
 *         """
 *         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, 459, __pyx_L1_error)
  __pyx_v_cnpoints = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":460
 *         """
 *         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, 460, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":444
 *         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":462
 *         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_37removePoint(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_36removePoint, "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:462");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_37removePoint = {"removePoint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_37removePoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_36removePoint};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_37removePoint(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("removePoint", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_36removePoint(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_36removePoint(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":472
 * 
 *         """
 *         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, 472, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":462
 *         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":474
 *         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_39removePointAtIndex(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_38removePointAtIndex, "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:474");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_39removePointAtIndex = {"removePointAtIndex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_39removePointAtIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_38removePointAtIndex};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_39removePointAtIndex(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_index,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 474, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 474, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "removePointAtIndex", 0) < (0)) __PYX_ERR(62, 474, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("removePointAtIndex", 1, 1, 1, i); __PYX_ERR(62, 474, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 474, __pyx_L3_error)
    }
    __pyx_v_index = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("removePointAtIndex", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 474, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_38removePointAtIndex(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_index);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_38removePointAtIndex(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":489
 * 
 *         """
 *         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, 489, __pyx_L1_error)
  __pyx_v_cindex = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":490
 *         """
 *         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, 490, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":474
 *         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":492
 *         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_41copyPoint(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_40copyPoint, "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:492");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_41copyPoint = {"copyPoint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_41copyPoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_40copyPoint};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_41copyPoint(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pi,&__pyx_mstate_global->__pyx_n_u_pj,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 492, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 492, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 492, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "copyPoint", 0) < (0)) __PYX_ERR(62, 492, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("copyPoint", 1, 2, 2, i); __PYX_ERR(62, 492, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 492, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 492, __pyx_L3_error)
    }
    __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, 492, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_40copyPoint(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_pi, __pyx_v_pj);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_40copyPoint(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":509
 * 
 *         """
 *         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, 509, __pyx_L1_error)
  __pyx_v_cpi = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":510
 *         """
 *         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, 510, __pyx_L1_error)
  __pyx_v_cpj = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":511
 *         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, 511, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":492
 *         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":513
 *         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_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_7DMSwarm_42getLocalSize, "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:513");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_43getLocalSize = {"getLocalSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_43getLocalSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_42getLocalSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLocalSize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_42getLocalSize(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_42getLocalSize(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":523
 * 
 *         """
 *         cdef PetscInt size = asInt(0)             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmGetLocalSize(self.dm, &size))
 *         return toInt(size)
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_mstate_global->__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 523, __pyx_L1_error)
  __pyx_v_size = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":524
 *         """
 *         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, 524, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":525
 *         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, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMSwarm.pyx":513
 *         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":527
 *         return toInt(size)
 * 
 *     def getSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the total length of fields registered.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_45getSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_44getSize, "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:527");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_45getSize = {"getSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_45getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_44getSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_45getSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSize", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_44getSize(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_44getSize(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":537
 * 
 *         """
 *         cdef PetscInt size = asInt(0)             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmGetSize(self.dm, &size))
 *         return toInt(size)
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_mstate_global->__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 537, __pyx_L1_error)
  __pyx_v_size = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":538
 *         """
 *         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, 538, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":539
 *         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, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMSwarm.pyx":527
 *         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":541
 *         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_47migrate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_46migrate, "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:541");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_47migrate = {"migrate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_47migrate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_46migrate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_47migrate(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_remove_sent_points,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 541, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 541, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "migrate", 0) < (0)) __PYX_ERR(62, 541, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 541, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __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, 541, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_46migrate(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_remove_sent_points);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_46migrate(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":557
 * 
 *         """
 *         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, 557, __pyx_L1_error)
  __pyx_v_remove_pts = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":558
 *         """
 *         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, 558, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":541
 *         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":560
 *         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_49collectViewCreate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_48collectViewCreate, "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:560");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_49collectViewCreate = {"collectViewCreate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_49collectViewCreate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_48collectViewCreate};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_49collectViewCreate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("collectViewCreate", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_48collectViewCreate(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_48collectViewCreate(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":570
 * 
 *         """
 *         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, 570, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":560
 *         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":572
 *         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_51collectViewDestroy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_50collectViewDestroy, "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:572");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_51collectViewDestroy = {"collectViewDestroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_51collectViewDestroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_50collectViewDestroy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_51collectViewDestroy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("collectViewDestroy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_50collectViewDestroy(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_50collectViewDestroy(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":582
 * 
 *         """
 *         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, 582, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":572
 *         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":584
 *         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_53setCellDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_52setCellDM, "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:584");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_53setCellDM = {"setCellDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_53setCellDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_52setCellDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_53setCellDM(PyObject *__pyx_v_self, 
#if 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 584, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 584, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCellDM", 0) < (0)) __PYX_ERR(62, 584, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCellDM", 1, 1, 1, i); __PYX_ERR(62, 584, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 584, __pyx_L3_error)
    }
    __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, 584, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(62, 584, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_52setCellDM(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_dm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_52setCellDM(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":599
 * 
 *         """
 *         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, 599, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":584
 *         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":601
 *         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_55getCellDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_54getCellDM, "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:601");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_55getCellDM = {"getCellDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_55getCellDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_54getCellDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_55getCellDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCellDM", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_54getCellDM(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_54getCellDM(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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCellDM", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":611
 * 
 *         """
 *         cdef PetscDM newdm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmGetCellDM(self.dm, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()
*/
  __pyx_v_newdm = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":612
 *         """
 *         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, 612, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":613
 *         cdef PetscDM newdm = NULL
 *         CHKERR(DMSwarmGetCellDM(self.dm, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()             # <<<<<<<<<<<<<<
 *         dm.dm = newdm
 *         CHKERR(PetscINCREF(dm.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(62, 613, __pyx_L1_error)
  __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":614
 *         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":615
 *         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, 615, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":616
 *         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":601
 *         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_XDECREF(__pyx_t_4);
  __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":618
 *         return dm
 * 
 *     def setType(self, dmswarm_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set particular flavor of `DMSwarm`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_57setType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_56setType, "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:618");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_57setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_57setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_56setType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_57setType(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dmswarm_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 618, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 618, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(62, 618, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(62, 618, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 618, __pyx_L3_error)
    }
    __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, 618, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_56setType(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_dmswarm_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_56setType(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":633
 * 
 *         """
 *         cdef PetscDMSwarmType cval = dmswarm_type             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmSetType(self.dm, cval))
 * 
*/
  __pyx_t_1 = ((DMSwarmType)__Pyx_PyLong_As_DMSwarmType(__pyx_v_dmswarm_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 633, __pyx_L1_error)
  __pyx_v_cval = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":634
 *         """
 *         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, 634, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":618
 *         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":636
 *         CHKERR(DMSwarmSetType(self.dm, cval))
 * 
 *     def setPointsUniformCoordinates(             # <<<<<<<<<<<<<<
 *         self,
 *         min: Sequence[float],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_59setPointsUniformCoordinates(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_58setPointsUniformCoordinates, "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:636");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_59setPointsUniformCoordinates = {"setPointsUniformCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_59setPointsUniformCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_58setPointsUniformCoordinates};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_59setPointsUniformCoordinates(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_min,&__pyx_mstate_global->__pyx_n_u_max,&__pyx_mstate_global->__pyx_n_u_npoints,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 636, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(62, 636, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(62, 636, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 636, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 636, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPointsUniformCoordinates", 0) < (0)) __PYX_ERR(62, 636, __pyx_L3_error)

      /* "petsc4py/PETSc/DMSwarm.pyx":641
 *         max: Sequence[float],
 *         npoints: Sequence[int],
 *         mode: InsertMode | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Set point coordinates in a `DMSwarm` on a regular (ijk) grid.
 * 
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPointsUniformCoordinates", 0, 3, 4, i); __PYX_ERR(62, 636, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(62, 636, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(62, 636, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 636, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 636, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 636, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_58setPointsUniformCoordinates(((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":636
 *         CHKERR(DMSwarmSetType(self.dm, cval))
 * 
 *     def setPointsUniformCoordinates(             # <<<<<<<<<<<<<<
 *         self,
 *         min: Sequence[float],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_58setPointsUniformCoordinates(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":665
 * 
 *         """
 *         cdef PetscInt dim = asInt(0)             # <<<<<<<<<<<<<<
 *         CHKERR(DMGetDimension(self.dm, &dim))
 *         cdef PetscReal cmin[3]
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_mstate_global->__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 665, __pyx_L1_error)
  __pyx_v_dim = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":666
 *         """
 *         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, 666, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":668
 *         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_mstate_global->__pyx_float_0_); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(62, 668, __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":669
 *         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_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 669, __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, 669, __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":671
 *         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_mstate_global->__pyx_float_0_); if (unlikely(__pyx_t_3 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(62, 671, __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":672
 *         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_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 672, __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, 672, __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":674
 *         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_mstate_global->__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 674, __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":675
 *         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_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyLong_As_PetscInt(__pyx_t_4); if (unlikely((__pyx_t_5 == ((PetscInt)-1)) && PyErr_Occurred())) __PYX_ERR(62, 675, __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":676
 *         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, 676, __pyx_L1_error)
  __pyx_v_cmode = __pyx_t_6;

  /* "petsc4py/PETSc/DMSwarm.pyx":677
 *         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, 677, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":678
 *         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":636
 *         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":680
 *         return self
 * 
 *     def setPointCoordinates(             # <<<<<<<<<<<<<<
 *         self,
 *         coordinates: Sequence[float],
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_61setPointCoordinates(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_60setPointCoordinates, "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:680");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_61setPointCoordinates = {"setPointCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_61setPointCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_60setPointCoordinates};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_61setPointCoordinates(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_coordinates,&__pyx_mstate_global->__pyx_n_u_redundant,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 680, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(62, 680, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 680, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 680, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPointCoordinates", 0) < (0)) __PYX_ERR(62, 680, __pyx_L3_error)

      /* "petsc4py/PETSc/DMSwarm.pyx":683
 *         self,
 *         coordinates: Sequence[float],
 *         redundant: bool = False,             # <<<<<<<<<<<<<<
 *         mode: InsertMode | None = None) -> None:
 *         """Set point coordinates in a `DMSwarm` from a user-defined list.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "petsc4py/PETSc/DMSwarm.pyx":684
 *         coordinates: Sequence[float],
 *         redundant: bool = False,
 *         mode: InsertMode | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set point coordinates in a `DMSwarm` from a user-defined list.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPointCoordinates", 0, 1, 3, i); __PYX_ERR(62, 680, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(62, 680, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 680, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 680, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMSwarm.pyx":683
 *         self,
 *         coordinates: Sequence[float],
 *         redundant: bool = False,             # <<<<<<<<<<<<<<
 *         mode: InsertMode | None = None) -> None:
 *         """Set point coordinates in a `DMSwarm` from a user-defined list.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_False));

      /* "petsc4py/PETSc/DMSwarm.pyx":684
 *         coordinates: Sequence[float],
 *         redundant: bool = False,
 *         mode: InsertMode | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set point coordinates in a `DMSwarm` from a user-defined list.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 680, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_60setPointCoordinates(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_coordinates, __pyx_v_redundant, __pyx_v_mode);

  /* "petsc4py/PETSc/DMSwarm.pyx":680
 *         return self
 * 
 *     def setPointCoordinates(             # <<<<<<<<<<<<<<
 *         self,
 *         coordinates: Sequence[float],
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_60setPointCoordinates(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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PetscBool __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("setPointCoordinates", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":705
 * 
 *         """
 *         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, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_xyz = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":706
 *         """
 *         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, 706, __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":707
 *         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)) {
    __pyx_t_3 = NULL;

    /* "petsc4py/PETSc/DMSwarm.pyx":709
 *         if PyArray_NDIM(xyz) != 2: raise ValueError(
 *             ("coordinates must have two dimensions: "
 *              "coordinates.ndim=%d") % (PyArray_NDIM(xyz)))             # <<<<<<<<<<<<<<
 *         cdef PetscInt cnpoints = <PetscInt> PyArray_DIM(xyz, 0)
 *         cdef PetscBool credundant = asBool(redundant)
*/
    __pyx_t_4 = __Pyx_PyLong_From_int(PyArray_NDIM(__pyx_v_xyz)); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_coordinates_must_have_two_dimens, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 707, __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(62, 707, __pyx_L1_error)

    /* "petsc4py/PETSc/DMSwarm.pyx":707
 *         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)))
*/
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":710
 *             ("coordinates must have two dimensions: "
 *              "coordinates.ndim=%d") % (PyArray_NDIM(xyz)))
 *         cdef PetscInt cnpoints = <PetscInt> 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":711
 *              "coordinates.ndim=%d") % (PyArray_NDIM(xyz)))
 *         cdef PetscInt cnpoints = <PetscInt> PyArray_DIM(xyz, 0)
 *         cdef PetscBool credundant = asBool(redundant)             # <<<<<<<<<<<<<<
 *         cdef PetscInsertMode cmode = insertmode(mode)
 *         cdef PetscReal *coords = <PetscReal*> PyArray_DATA(xyz)
*/
  __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_redundant); if (unlikely(__pyx_t_7 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(62, 711, __pyx_L1_error)
  __pyx_v_credundant = __pyx_t_7;

  /* "petsc4py/PETSc/DMSwarm.pyx":712
 *         cdef PetscInt cnpoints = <PetscInt> PyArray_DIM(xyz, 0)
 *         cdef PetscBool credundant = asBool(redundant)
 *         cdef PetscInsertMode cmode = insertmode(mode)             # <<<<<<<<<<<<<<
 *         cdef PetscReal *coords = <PetscReal*> PyArray_DATA(xyz)
 *         CHKERR(DMSwarmSetPointCoordinates(self.dm, cnpoints, coords, credundant, cmode))
*/
  __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_insertmode(__pyx_v_mode); if (unlikely(__pyx_t_8 == ((InsertMode)((InsertMode)-1L)))) __PYX_ERR(62, 712, __pyx_L1_error)
  __pyx_v_cmode = __pyx_t_8;

  /* "petsc4py/PETSc/DMSwarm.pyx":713
 *         cdef PetscBool credundant = asBool(redundant)
 *         cdef PetscInsertMode cmode = insertmode(mode)
 *         cdef PetscReal *coords = <PetscReal*> PyArray_DATA(xyz)             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmSetPointCoordinates(self.dm, cnpoints, coords, credundant, cmode))
 * 
*/
  __pyx_v_coords = ((PetscReal *)PyArray_DATA(__pyx_v_xyz));

  /* "petsc4py/PETSc/DMSwarm.pyx":714
 *         cdef PetscInsertMode cmode = insertmode(mode)
 *         cdef PetscReal *coords = <PetscReal*> PyArray_DATA(xyz)
 *         CHKERR(DMSwarmSetPointCoordinates(self.dm, cnpoints, coords, credundant, cmode))             # <<<<<<<<<<<<<<
 * 
 *     def insertPointUsingCellDM(self, layoutType: PICLayoutType, fill_param: int) -> None:
*/
  __pyx_t_9 = __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_9 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 714, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":680
 *         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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":716
 *         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_63insertPointUsingCellDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_62insertPointUsingCellDM, "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:716");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_63insertPointUsingCellDM = {"insertPointUsingCellDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_63insertPointUsingCellDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_62insertPointUsingCellDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_63insertPointUsingCellDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_layoutType,&__pyx_mstate_global->__pyx_n_u_fill_param,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 716, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 716, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 716, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "insertPointUsingCellDM", 0) < (0)) __PYX_ERR(62, 716, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("insertPointUsingCellDM", 1, 2, 2, i); __PYX_ERR(62, 716, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 716, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 716, __pyx_L3_error)
    }
    __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, 716, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_62insertPointUsingCellDM(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_layoutType, __pyx_v_fill_param);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_62insertPointUsingCellDM(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":734
 * 
 *         """
 *         cdef PetscDMSwarmPICLayoutType clayoutType = layoutType             # <<<<<<<<<<<<<<
 *         cdef PetscInt cfill_param = asInt(fill_param)
 *         CHKERR(DMSwarmInsertPointsUsingCellDM(self.dm, clayoutType, cfill_param))
*/
  __pyx_t_1 = ((DMSwarmPICLayoutType)__Pyx_PyLong_As_DMSwarmPICLayoutType(__pyx_v_layoutType)); if (unlikely(PyErr_Occurred())) __PYX_ERR(62, 734, __pyx_L1_error)
  __pyx_v_clayoutType = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":735
 *         """
 *         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, 735, __pyx_L1_error)
  __pyx_v_cfill_param = __pyx_t_2;

  /* "petsc4py/PETSc/DMSwarm.pyx":736
 *         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, 736, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":716
 *         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":738
 *         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_65setPointCoordinatesCellwise(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_64setPointCoordinatesCellwise, "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:738");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_65setPointCoordinatesCellwise = {"setPointCoordinatesCellwise", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_65setPointCoordinatesCellwise, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_64setPointCoordinatesCellwise};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_65setPointCoordinatesCellwise(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_coordinates,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 738, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 738, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPointCoordinatesCellwise", 0) < (0)) __PYX_ERR(62, 738, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPointCoordinatesCellwise", 1, 1, 1, i); __PYX_ERR(62, 738, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 738, __pyx_L3_error)
    }
    __pyx_v_coordinates = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPointCoordinatesCellwise", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 738, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_64setPointCoordinatesCellwise(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_coordinates);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_64setPointCoordinatesCellwise(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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  PetscErrorCode __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setPointCoordinatesCellwise", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":756
 * 
 *         """
 *         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, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_xyz = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":757
 *         """
 *         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, 757, __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":758
 *         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)) {
    __pyx_t_3 = NULL;

    /* "petsc4py/PETSc/DMSwarm.pyx":760
 *         if PyArray_NDIM(xyz) != 2: raise ValueError(
 *             ("coordinates must have two dimensions: "
 *              "coordinates.ndim=%d") % (PyArray_NDIM(xyz)))             # <<<<<<<<<<<<<<
 *         cdef PetscInt cnpoints = <PetscInt> PyArray_DIM(xyz, 0)
 *         cdef PetscReal *coords = <PetscReal*> PyArray_DATA(xyz)
*/
    __pyx_t_4 = __Pyx_PyLong_From_int(PyArray_NDIM(__pyx_v_xyz)); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_coordinates_must_have_two_dimens, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 758, __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(62, 758, __pyx_L1_error)

    /* "petsc4py/PETSc/DMSwarm.pyx":758
 *         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)))
*/
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":761
 *             ("coordinates must have two dimensions: "
 *              "coordinates.ndim=%d") % (PyArray_NDIM(xyz)))
 *         cdef PetscInt cnpoints = <PetscInt> PyArray_DIM(xyz, 0)             # <<<<<<<<<<<<<<
 *         cdef PetscReal *coords = <PetscReal*> PyArray_DATA(xyz)
 *         CHKERR(DMSwarmSetPointCoordinatesCellwise(self.dm, cnpoints, coords))
*/
  __pyx_v_cnpoints = ((PetscInt)PyArray_DIM(__pyx_v_xyz, 0));

  /* "petsc4py/PETSc/DMSwarm.pyx":762
 *              "coordinates.ndim=%d") % (PyArray_NDIM(xyz)))
 *         cdef PetscInt cnpoints = <PetscInt> PyArray_DIM(xyz, 0)
 *         cdef PetscReal *coords = <PetscReal*> PyArray_DATA(xyz)             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmSetPointCoordinatesCellwise(self.dm, cnpoints, coords))
 * 
*/
  __pyx_v_coords = ((PetscReal *)PyArray_DATA(__pyx_v_xyz));

  /* "petsc4py/PETSc/DMSwarm.pyx":763
 *         cdef PetscInt cnpoints = <PetscInt> PyArray_DIM(xyz, 0)
 *         cdef PetscReal *coords = <PetscReal*> PyArray_DATA(xyz)
 *         CHKERR(DMSwarmSetPointCoordinatesCellwise(self.dm, cnpoints, coords))             # <<<<<<<<<<<<<<
 * 
 *     def viewFieldsXDMF(self, filename: str, fieldnames: Sequence[str]) -> None:
*/
  __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSetPointCoordinatesCellwise(__pyx_v_self->__pyx_base.dm, __pyx_v_cnpoints, __pyx_v_coords)); if (unlikely(__pyx_t_7 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 763, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":738
 *         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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":765
 *         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_67viewFieldsXDMF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_66viewFieldsXDMF, "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:765");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_67viewFieldsXDMF = {"viewFieldsXDMF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_67viewFieldsXDMF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_66viewFieldsXDMF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_67viewFieldsXDMF(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename,&__pyx_mstate_global->__pyx_n_u_fieldnames,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 765, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 765, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 765, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "viewFieldsXDMF", 0) < (0)) __PYX_ERR(62, 765, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("viewFieldsXDMF", 1, 2, 2, i); __PYX_ERR(62, 765, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 765, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 765, __pyx_L3_error)
    }
    __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, 765, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_66viewFieldsXDMF(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_filename, __pyx_v_fieldnames);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_66viewFieldsXDMF(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_unused = 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":782
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         cdef const char *cfilename = NULL
 *         filename = str2bytes(filename, &cfilename)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":783
 *         """
 *         cdef const char *cval = NULL
 *         cdef const char *cfilename = NULL             # <<<<<<<<<<<<<<
 *         filename = str2bytes(filename, &cfilename)
 *         cdef PetscInt cnfields = <PetscInt> len(fieldnames)
*/
  __pyx_v_cfilename = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":784
 *         cdef const char *cval = NULL
 *         cdef const char *cfilename = NULL
 *         filename = str2bytes(filename, &cfilename)             # <<<<<<<<<<<<<<
 *         cdef PetscInt cnfields = <PetscInt> 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, 784, __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":785
 *         cdef const char *cfilename = NULL
 *         filename = str2bytes(filename, &cfilename)
 *         cdef PetscInt cnfields = <PetscInt> len(fieldnames)             # <<<<<<<<<<<<<<
 *         cdef const char** cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(cnfields), NULL, <void**>&cfieldnames)
*/
  __pyx_t_2 = PyObject_Length(__pyx_v_fieldnames); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(62, 785, __pyx_L1_error)
  __pyx_v_cnfields = ((PetscInt)__pyx_t_2);

  /* "petsc4py/PETSc/DMSwarm.pyx":786
 *         filename = str2bytes(filename, &cfilename)
 *         cdef PetscInt cnfields = <PetscInt> len(fieldnames)
 *         cdef const char** cfieldnames = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(cnfields), NULL, <void**>&cfieldnames)
 *         fieldnames = list(fieldnames)
*/
  __pyx_v_cfieldnames = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":787
 *         cdef PetscInt cnfields = <PetscInt> len(fieldnames)
 *         cdef const char** cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(cnfields), NULL, <void**>&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, 787, __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, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":788
 *         cdef const char** cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(cnfields), NULL, <void**>&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, 788, __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":789
 *         cdef object unused = oarray_p(empty_p(cnfields), NULL, <void**>&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":790
 *         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_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 790, __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, 790, __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_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument) < 0))) __PYX_ERR(62, 790, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "petsc4py/PETSc/DMSwarm.pyx":791
 *         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":792
 *             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, 792, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":765
 *         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_unused);
  __Pyx_XDECREF(__pyx_v_filename);
  __Pyx_XDECREF(__pyx_v_fieldnames);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":794
 *         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_69viewXDMF(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_68viewXDMF, "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:794");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_69viewXDMF = {"viewXDMF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_69viewXDMF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_68viewXDMF};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_69viewXDMF(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_filename,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 794, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 794, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "viewXDMF", 0) < (0)) __PYX_ERR(62, 794, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("viewXDMF", 1, 1, 1, i); __PYX_ERR(62, 794, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 794, __pyx_L3_error)
    }
    __pyx_v_filename = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("viewXDMF", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 794, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_68viewXDMF(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_filename);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_68viewXDMF(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":809
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         filename = str2bytes(filename, &cval)
 *         CHKERR(DMSwarmViewXDMF(self.dm, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":810
 *         """
 *         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, 810, __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":811
 *         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, 811, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":794
 *         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":813
 *         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_71sortGetAccess(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_70sortGetAccess, "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:813");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_71sortGetAccess = {"sortGetAccess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_71sortGetAccess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_70sortGetAccess};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_71sortGetAccess(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("sortGetAccess", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_70sortGetAccess(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_70sortGetAccess(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":829
 * 
 *         """
 *         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, 829, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":813
 *         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":831
 *         CHKERR(DMSwarmSortGetAccess(self.dm))
 * 
 *     def sortRestoreAccess(self) -> None:             # <<<<<<<<<<<<<<
 *         """Invalidate the `DMSwarm` point sorting context.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_73sortRestoreAccess(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_72sortRestoreAccess, "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:831");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_73sortRestoreAccess = {"sortRestoreAccess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_73sortRestoreAccess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_72sortRestoreAccess};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_73sortRestoreAccess(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("sortRestoreAccess", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_72sortRestoreAccess(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_72sortRestoreAccess(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":841
 * 
 *         """
 *         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, 841, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":831
 *         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":843
 *         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_75sortGetPointsPerCell(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_74sortGetPointsPerCell, "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:843");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_75sortGetPointsPerCell = {"sortGetPointsPerCell", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_75sortGetPointsPerCell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_74sortGetPointsPerCell};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_75sortGetPointsPerCell(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_e,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 843, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 843, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sortGetPointsPerCell", 0) < (0)) __PYX_ERR(62, 843, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sortGetPointsPerCell", 1, 1, 1, i); __PYX_ERR(62, 843, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 843, __pyx_L3_error)
    }
    __pyx_v_e = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sortGetPointsPerCell", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 843, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_74sortGetPointsPerCell(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_e);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_74sortGetPointsPerCell(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":858
 * 
 *         """
 *         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, 858, __pyx_L1_error)
  __pyx_v_ce = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":859
 *         """
 *         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_mstate_global->__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 859, __pyx_L1_error)
  __pyx_v_cnpoints = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":860
 *         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":861
 *         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, 861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_pidlist = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":862
 *         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, 862, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":863
 *         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_PyLong_From_PetscInt(__pyx_v_cnpoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 863, __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, 863, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_npoints = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":864
 *         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_PyLong_From_PetscInt((__pyx_v_cpidlist[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 864, __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, 864, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyLong_From_PetscInt(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 864, __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, 864, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":865
 *         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":843
 *         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":867
 *         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_77sortGetNumberOfPointsPerCell(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_76sortGetNumberOfPointsPerCell, "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:867");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_77sortGetNumberOfPointsPerCell = {"sortGetNumberOfPointsPerCell", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_77sortGetNumberOfPointsPerCell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_76sortGetNumberOfPointsPerCell};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_77sortGetNumberOfPointsPerCell(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_e,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 867, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 867, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "sortGetNumberOfPointsPerCell", 0) < (0)) __PYX_ERR(62, 867, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("sortGetNumberOfPointsPerCell", 1, 1, 1, i); __PYX_ERR(62, 867, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 867, __pyx_L3_error)
    }
    __pyx_v_e = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("sortGetNumberOfPointsPerCell", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 867, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_76sortGetNumberOfPointsPerCell(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_e);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_76sortGetNumberOfPointsPerCell(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":882
 * 
 *         """
 *         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, 882, __pyx_L1_error)
  __pyx_v_ce = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":883
 *         """
 *         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_mstate_global->__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 883, __pyx_L1_error)
  __pyx_v_npoints = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":884
 *         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, 884, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":885
 *         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, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMSwarm.pyx":867
 *         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":887
 *         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_79sortGetIsValid(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_78sortGetIsValid, "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:887");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_79sortGetIsValid = {"sortGetIsValid", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_79sortGetIsValid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_78sortGetIsValid};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_79sortGetIsValid(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("sortGetIsValid", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_78sortGetIsValid(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_78sortGetIsValid(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":899
 * 
 *         """
 *         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, 899, __pyx_L1_error)
  __pyx_v_isValid = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":900
 *         """
 *         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, 900, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":901
 *         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, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMSwarm.pyx":887
 *         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":903
 *         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_81sortGetSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_80sortGetSizes, "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:903");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_81sortGetSizes = {"sortGetSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_81sortGetSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_80sortGetSizes};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_81sortGetSizes(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("sortGetSizes", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_80sortGetSizes(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_80sortGetSizes(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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":920
 * 
 *         """
 *         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_mstate_global->__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 920, __pyx_L1_error)
  __pyx_v_ncells = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":921
 *         """
 *         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_mstate_global->__pyx_int_0); if (unlikely(__pyx_t_1 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 921, __pyx_L1_error)
  __pyx_v_npoints = __pyx_t_1;

  /* "petsc4py/PETSc/DMSwarm.pyx":922
 *         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, 922, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":923
 *         cdef PetscInt npoints = asInt(0)
 *         CHKERR(DMSwarmSortGetSizes(self.dm, &ncells, &npoints))
 *         return (toInt(ncells), toInt(npoints))             # <<<<<<<<<<<<<<
 * 
 *     def projectFields(self, DM dm, 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, 923, __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, 923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 923, __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) != (0)) __PYX_ERR(62, 923, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(62, 923, __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":903
 *         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":925
 *         return (toInt(ncells), toInt(npoints))
 * 
 *     def projectFields(self, DM dm, 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_83projectFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_82projectFields, "DMSwarm.projectFields(self, dm: DM, 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        dm\n            The continuum `DM`.\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:925");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_83projectFields = {"projectFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_83projectFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_82projectFields};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_83projectFields(PyObject *__pyx_v_self, 
#if 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_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[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("projectFields (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,&__pyx_mstate_global->__pyx_n_u_fieldnames,&__pyx_mstate_global->__pyx_n_u_vecs,&__pyx_mstate_global->__pyx_n_u_mode,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 925, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(62, 925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(62, 925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "projectFields", 0) < (0)) __PYX_ERR(62, 925, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("projectFields", 0, 3, 4, i); __PYX_ERR(62, 925, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(62, 925, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(62, 925, __pyx_L3_error)
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 925, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 925, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_dm = ((struct PyPetscDMObject *)values[0]);
    __pyx_v_fieldnames = values[1];
    __pyx_v_vecs = values[2];
    __pyx_v_mode = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("projectFields", 0, 3, 4, __pyx_nargs); __PYX_ERR(62, 925, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.projectFields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(62, 925, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_82projectFields(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_dm, __pyx_v_fieldnames, __pyx_v_vecs, __pyx_v_mode);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_82projectFields(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, 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_unused = 0;
  Vec *__pyx_v_cfieldvecs;
  CYTHON_UNUSED PyObject *__pyx_v_unused2 = 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":942
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt cnfields = <PetscInt> len(fieldnames)
 *         cdef const char** cfieldnames = NULL
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":943
 *         """
 *         cdef const char *cval = NULL
 *         cdef PetscInt cnfields = <PetscInt> len(fieldnames)             # <<<<<<<<<<<<<<
 *         cdef const char** cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(cnfields), NULL, <void**>&cfieldnames)
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_fieldnames); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(62, 943, __pyx_L1_error)
  __pyx_v_cnfields = ((PetscInt)__pyx_t_1);

  /* "petsc4py/PETSc/DMSwarm.pyx":944
 *         cdef const char *cval = NULL
 *         cdef PetscInt cnfields = <PetscInt> len(fieldnames)
 *         cdef const char** cfieldnames = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused = oarray_p(empty_p(cnfields), NULL, <void**>&cfieldnames)
 *         cdef PetscVec *cfieldvecs = NULL
*/
  __pyx_v_cfieldnames = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":945
 *         cdef PetscInt cnfields = <PetscInt> len(fieldnames)
 *         cdef const char** cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(cnfields), NULL, <void**>&cfieldnames)             # <<<<<<<<<<<<<<
 *         cdef PetscVec *cfieldvecs = NULL
 *         cdef object unused2 = oarray_p(empty_p(cnfields), NULL, <void**>&cfieldvecs)
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_cnfields)); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 945, __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, 945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unused = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":946
 *         cdef const char** cfieldnames = NULL
 *         cdef object unused = oarray_p(empty_p(cnfields), NULL, <void**>&cfieldnames)
 *         cdef PetscVec *cfieldvecs = NULL             # <<<<<<<<<<<<<<
 *         cdef object unused2 = oarray_p(empty_p(cnfields), NULL, <void**>&cfieldvecs)
 *         cdef PetscScatterMode cmode = scattermode(mode)
*/
  __pyx_v_cfieldvecs = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":947
 *         cdef object unused = oarray_p(empty_p(cnfields), NULL, <void**>&cfieldnames)
 *         cdef PetscVec *cfieldvecs = NULL
 *         cdef object unused2 = oarray_p(empty_p(cnfields), NULL, <void**>&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, 947, __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, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_unused2 = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":948
 *         cdef PetscVec *cfieldvecs = NULL
 *         cdef object unused2 = oarray_p(empty_p(cnfields), NULL, <void**>&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, 948, __pyx_L1_error)
  __pyx_v_cmode = __pyx_t_4;

  /* "petsc4py/PETSc/DMSwarm.pyx":949
 *         cdef object unused2 = oarray_p(empty_p(cnfields), NULL, <void**>&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, 949, __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":950
 *         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":951
 *         fieldnames = list(fieldnames)
 *         for i from 0 <= i < cnfields:
 *             fieldnames[i] = str2bytes(fieldnames[i], &cval)             # <<<<<<<<<<<<<<
 *             cfieldnames[i] = cval
 *             cfieldvecs[i] = (<Vec?>(vecs[i])).vec
*/
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fieldnames, __pyx_v_i, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 951, __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, 951, __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_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument) < 0))) __PYX_ERR(62, 951, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/DMSwarm.pyx":952
 *         for i from 0 <= i < cnfields:
 *             fieldnames[i] = str2bytes(fieldnames[i], &cval)
 *             cfieldnames[i] = cval             # <<<<<<<<<<<<<<
 *             cfieldvecs[i] = (<Vec?>(vecs[i])).vec
 *         CHKERR(DMSwarmProjectFields(self.dm, dm.dm, cnfields, cfieldnames, cfieldvecs, cmode))
*/
    (__pyx_v_cfieldnames[__pyx_v_i]) = __pyx_v_cval;

    /* "petsc4py/PETSc/DMSwarm.pyx":953
 *             fieldnames[i] = str2bytes(fieldnames[i], &cval)
 *             cfieldnames[i] = cval
 *             cfieldvecs[i] = (<Vec?>(vecs[i])).vec             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmProjectFields(self.dm, dm.dm, cnfields, cfieldnames, cfieldvecs, cmode))
 *         return
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vecs, __pyx_v_i, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(62, 953, __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":954
 *             cfieldnames[i] = cval
 *             cfieldvecs[i] = (<Vec?>(vecs[i])).vec
 *         CHKERR(DMSwarmProjectFields(self.dm, dm.dm, cnfields, cfieldnames, cfieldvecs, cmode))             # <<<<<<<<<<<<<<
 *         return
 * 
*/
  __pyx_t_7 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmProjectFields(__pyx_v_self->__pyx_base.dm, __pyx_v_dm->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, 954, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":955
 *             cfieldvecs[i] = (<Vec?>(vecs[i])).vec
 *         CHKERR(DMSwarmProjectFields(self.dm, dm.dm, cnfields, cfieldnames, cfieldvecs, cmode))
 *         return             # <<<<<<<<<<<<<<
 * 
 *     def addCellDM(self, CellDM celldm) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMSwarm.pyx":925
 *         return (toInt(ncells), toInt(npoints))
 * 
 *     def projectFields(self, DM dm, 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_unused);
  __Pyx_XDECREF(__pyx_v_unused2);
  __Pyx_XDECREF(__pyx_v_fieldnames);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":957
 *         return
 * 
 *     def addCellDM(self, CellDM celldm) -> None:             # <<<<<<<<<<<<<<
 *         """Add a cell DM to the `DMSwarm`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_85addCellDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_84addCellDM, "DMSwarm.addCellDM(self, celldm: CellDM) -> None\nAdd a cell DM to the `DMSwarm`.\n\n        Logically collective.\n\n        Parameters\n        -------\n        cellDM : CellDM\n            The cell DM object\n\n        See Also\n        --------\n        petsc.DMSwarmAddCellDM\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:957");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_85addCellDM = {"addCellDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_85addCellDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_84addCellDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_85addCellDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct PyPetscDMSwarmCellDMObject *__pyx_v_celldm = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("addCellDM (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_celldm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 957, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 957, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "addCellDM", 0) < (0)) __PYX_ERR(62, 957, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("addCellDM", 1, 1, 1, i); __PYX_ERR(62, 957, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 957, __pyx_L3_error)
    }
    __pyx_v_celldm = ((struct PyPetscDMSwarmCellDMObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("addCellDM", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 957, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.addCellDM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_celldm), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_CellDM, 0, "celldm", 0))) __PYX_ERR(62, 957, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_84addCellDM(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_celldm);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_84addCellDM(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, struct PyPetscDMSwarmCellDMObject *__pyx_v_celldm) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscErrorCode __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("addCellDM", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":972
 * 
 *         """
 *         CHKERR(DMSwarmAddCellDM(self.dm, celldm.cdm))             # <<<<<<<<<<<<<<
 * 
 *     def setCellDMActive(self, name : str) -> None:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmAddCellDM(__pyx_v_self->__pyx_base.dm, __pyx_v_celldm->cdm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 972, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":957
 *         return
 * 
 *     def addCellDM(self, CellDM celldm) -> None:             # <<<<<<<<<<<<<<
 *         """Add a cell DM to the `DMSwarm`.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.addCellDM", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":974
 *         CHKERR(DMSwarmAddCellDM(self.dm, celldm.cdm))
 * 
 *     def setCellDMActive(self, name : str) -> None:             # <<<<<<<<<<<<<<
 *         """Activate a cell DM in the `DMSwarm`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_87setCellDMActive(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_86setCellDMActive, "DMSwarm.setCellDMActive(self, name: str) -> None\nActivate a cell DM in the `DMSwarm`.\n\n        Logically collective.\n\n        Parameters\n        -------\n        name : str\n            The name of the cell DM to activate\n\n        See Also\n        --------\n        petsc.DMSwarmSetCellDMActive\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:974");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_87setCellDMActive = {"setCellDMActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_87setCellDMActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_86setCellDMActive};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_87setCellDMActive(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("setCellDMActive (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 974, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 974, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setCellDMActive", 0) < (0)) __PYX_ERR(62, 974, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setCellDMActive", 1, 1, 1, i); __PYX_ERR(62, 974, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 974, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setCellDMActive", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 974, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.setCellDMActive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_86setCellDMActive(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_86setCellDMActive(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__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("setCellDMActive", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":989
 * 
 *         """
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         str2bytes(name, &cname)
 *         CHKERR(DMSwarmSetCellDMActive(self.dm, cname))
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":990
 *         """
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmSetCellDMActive(self.dm, cname))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":991
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)
 *         CHKERR(DMSwarmSetCellDMActive(self.dm, cname))             # <<<<<<<<<<<<<<
 * 
 *     def getCellDMActive(self) -> CellDM:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmSetCellDMActive(__pyx_v_self->__pyx_base.dm, __pyx_v_cname)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 991, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":974
 *         CHKERR(DMSwarmAddCellDM(self.dm, celldm.cdm))
 * 
 *     def setCellDMActive(self, name : str) -> None:             # <<<<<<<<<<<<<<
 *         """Activate a cell DM in the `DMSwarm`.
 * 
*/

  /* 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.setCellDMActive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":993
 *         CHKERR(DMSwarmSetCellDMActive(self.dm, cname))
 * 
 *     def getCellDMActive(self) -> CellDM:             # <<<<<<<<<<<<<<
 *         """Return the active cell DM in the `DMSwarm`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_89getCellDMActive(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_88getCellDMActive, "DMSwarm.getCellDMActive(self) -> CellDM\nReturn the active cell DM in the `DMSwarm`.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.DMSwarmGetCellDMActive\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:993");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_89getCellDMActive = {"getCellDMActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_89getCellDMActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_88getCellDMActive};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_89getCellDMActive(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getCellDMActive (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCellDMActive", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCellDMActive", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_88getCellDMActive(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_88getCellDMActive(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) {
  DMSwarmCellDM __pyx_v_newcdm;
  struct PyPetscDMSwarmCellDMObject *__pyx_v_cdm = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscErrorCode __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCellDMActive", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":1003
 * 
 *         """
 *         cdef PetscDMSwarmCellDM newcdm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmGetCellDMActive(self.dm, &newcdm))
 *         cdef CellDM cdm = CellDM()
*/
  __pyx_v_newcdm = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1004
 *         """
 *         cdef PetscDMSwarmCellDM newcdm = NULL
 *         CHKERR(DMSwarmGetCellDMActive(self.dm, &newcdm))             # <<<<<<<<<<<<<<
 *         cdef CellDM cdm = CellDM()
 *         cdm.cdm = newcdm
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmGetCellDMActive(__pyx_v_self->__pyx_base.dm, (&__pyx_v_newcdm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 1004, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1005
 *         cdef PetscDMSwarmCellDM newcdm = NULL
 *         CHKERR(DMSwarmGetCellDMActive(self.dm, &newcdm))
 *         cdef CellDM cdm = CellDM()             # <<<<<<<<<<<<<<
 *         cdm.cdm = newcdm
 *         CHKERR(PetscINCREF(cdm.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_CellDM, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 1005, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_cdm = ((struct PyPetscDMSwarmCellDMObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1006
 *         CHKERR(DMSwarmGetCellDMActive(self.dm, &newcdm))
 *         cdef CellDM cdm = CellDM()
 *         cdm.cdm = newcdm             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(cdm.obj))
 *         return cdm
*/
  __pyx_v_cdm->cdm = __pyx_v_newcdm;

  /* "petsc4py/PETSc/DMSwarm.pyx":1007
 *         cdef CellDM cdm = CellDM()
 *         cdm.cdm = newcdm
 *         CHKERR(PetscINCREF(cdm.obj))             # <<<<<<<<<<<<<<
 *         return cdm
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_cdm->__pyx_base.obj)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 1007, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1008
 *         cdm.cdm = newcdm
 *         CHKERR(PetscINCREF(cdm.obj))
 *         return cdm             # <<<<<<<<<<<<<<
 * 
 *     def getCellDMByName(self, name: str) -> CellDM:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_cdm);
  __pyx_r = ((PyObject *)__pyx_v_cdm);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMSwarm.pyx":993
 *         CHKERR(DMSwarmSetCellDMActive(self.dm, cname))
 * 
 *     def getCellDMActive(self) -> CellDM:             # <<<<<<<<<<<<<<
 *         """Return the active cell DM in the `DMSwarm`.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.getCellDMActive", __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/DMSwarm.pyx":1010
 *         return cdm
 * 
 *     def getCellDMByName(self, name: str) -> CellDM:             # <<<<<<<<<<<<<<
 *         """Return the cell DM with the given name in the `DMSwarm`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_91getCellDMByName(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_90getCellDMByName, "DMSwarm.getCellDMByName(self, name: str) -> CellDM\nReturn the cell DM with the given name in the `DMSwarm`.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.DMSwarmGetCellDMByName\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:1010");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_91getCellDMByName = {"getCellDMByName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_91getCellDMByName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_90getCellDMByName};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_91getCellDMByName(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("getCellDMByName (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 1010, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 1010, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getCellDMByName", 0) < (0)) __PYX_ERR(62, 1010, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getCellDMByName", 1, 1, 1, i); __PYX_ERR(62, 1010, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 1010, __pyx_L3_error)
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getCellDMByName", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 1010, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.getCellDMByName", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_90getCellDMByName(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_90getCellDMByName(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_name) {
  DMSwarmCellDM __pyx_v_newcdm;
  char const *__pyx_v_cname;
  struct PyPetscDMSwarmCellDMObject *__pyx_v_cdm = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PetscErrorCode __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCellDMByName", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":1020
 * 
 *         """
 *         cdef PetscDMSwarmCellDM newcdm = NULL             # <<<<<<<<<<<<<<
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)
*/
  __pyx_v_newcdm = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1021
 *         """
 *         cdef PetscDMSwarmCellDM newcdm = NULL
 *         cdef const char *cname = NULL             # <<<<<<<<<<<<<<
 *         str2bytes(name, &cname)
 *         CHKERR(DMSwarmGetCellDMByName(self.dm, cname, &newcdm))
*/
  __pyx_v_cname = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1022
 *         cdef PetscDMSwarmCellDM newcdm = NULL
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmGetCellDMByName(self.dm, cname, &newcdm))
 *         cdef CellDM cdm = CellDM()
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_name, (&__pyx_v_cname)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 1022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1023
 *         cdef const char *cname = NULL
 *         str2bytes(name, &cname)
 *         CHKERR(DMSwarmGetCellDMByName(self.dm, cname, &newcdm))             # <<<<<<<<<<<<<<
 *         cdef CellDM cdm = CellDM()
 *         cdm.cdm = newcdm
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmGetCellDMByName(__pyx_v_self->__pyx_base.dm, __pyx_v_cname, (&__pyx_v_newcdm))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 1023, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1024
 *         str2bytes(name, &cname)
 *         CHKERR(DMSwarmGetCellDMByName(self.dm, cname, &newcdm))
 *         cdef CellDM cdm = CellDM()             # <<<<<<<<<<<<<<
 *         cdm.cdm = newcdm
 *         CHKERR(PetscINCREF(cdm.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_CellDM, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 1024, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_cdm = ((struct PyPetscDMSwarmCellDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1025
 *         CHKERR(DMSwarmGetCellDMByName(self.dm, cname, &newcdm))
 *         cdef CellDM cdm = CellDM()
 *         cdm.cdm = newcdm             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(cdm.obj))
 *         return cdm
*/
  __pyx_v_cdm->cdm = __pyx_v_newcdm;

  /* "petsc4py/PETSc/DMSwarm.pyx":1026
 *         cdef CellDM cdm = CellDM()
 *         cdm.cdm = newcdm
 *         CHKERR(PetscINCREF(cdm.obj))             # <<<<<<<<<<<<<<
 *         return cdm
 * 
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_cdm->__pyx_base.obj)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 1026, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1027
 *         cdm.cdm = newcdm
 *         CHKERR(PetscINCREF(cdm.obj))
 *         return cdm             # <<<<<<<<<<<<<<
 * 
 *     def getCellDMNames(self) -> list[str]:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_cdm);
  __pyx_r = ((PyObject *)__pyx_v_cdm);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1010
 *         return cdm
 * 
 *     def getCellDMByName(self, name: str) -> CellDM:             # <<<<<<<<<<<<<<
 *         """Return the cell DM with the given name in the `DMSwarm`.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.getCellDMByName", __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/DMSwarm.pyx":1029
 *         return cdm
 * 
 *     def getCellDMNames(self) -> list[str]:             # <<<<<<<<<<<<<<
 *         """Return the names of all cell DMs in the `DMSwarm`.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_93getCellDMNames(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_92getCellDMNames, "DMSwarm.getCellDMNames(self) -> list[str]\nReturn the names of all cell DMs in the `DMSwarm`.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.DMSwarmGetCellDMNames\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:1029");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_93getCellDMNames = {"getCellDMNames", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_93getCellDMNames, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_92getCellDMNames};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_93getCellDMNames(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getCellDMNames (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCellDMNames", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCellDMNames", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_92getCellDMNames(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_92getCellDMNames(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self) {
  PetscInt __pyx_v_i;
  PetscInt __pyx_v_nc;
  char const **__pyx_v_c;
  PyObject *__pyx_v_names = 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("getCellDMNames", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":1039
 * 
 *         """
 *         cdef PetscInt i = 0, nc = 0             # <<<<<<<<<<<<<<
 *         cdef const char **c = NULL
 *         CHKERR(DMSwarmGetCellDMNames(self.dm, &nc, &c))
*/
  __pyx_v_i = 0;
  __pyx_v_nc = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1040
 *         """
 *         cdef PetscInt i = 0, nc = 0
 *         cdef const char **c = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmGetCellDMNames(self.dm, &nc, &c))
 *         cdef list names = []
*/
  __pyx_v_c = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1041
 *         cdef PetscInt i = 0, nc = 0
 *         cdef const char **c = NULL
 *         CHKERR(DMSwarmGetCellDMNames(self.dm, &nc, &c))             # <<<<<<<<<<<<<<
 *         cdef list names = []
 *         for i from 0 <= i < nc:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmGetCellDMNames(__pyx_v_self->__pyx_base.dm, (&__pyx_v_nc), (&__pyx_v_c))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 1041, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1042
 *         cdef const char **c = NULL
 *         CHKERR(DMSwarmGetCellDMNames(self.dm, &nc, &c))
 *         cdef list names = []             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nc:
 *             names.append(bytes2str(c[i]))
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_names = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1043
 *         CHKERR(DMSwarmGetCellDMNames(self.dm, &nc, &c))
 *         cdef list names = []
 *         for i from 0 <= i < nc:             # <<<<<<<<<<<<<<
 *             names.append(bytes2str(c[i]))
 *         return names
*/
  __pyx_t_3 = __pyx_v_nc;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {

    /* "petsc4py/PETSc/DMSwarm.pyx":1044
 *         cdef list names = []
 *         for i from 0 <= i < nc:
 *             names.append(bytes2str(c[i]))             # <<<<<<<<<<<<<<
 *         return names
 * 
*/
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str((__pyx_v_c[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 1044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_names, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(62, 1044, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":1045
 *         for i from 0 <= i < nc:
 *             names.append(bytes2str(c[i]))
 *         return names             # <<<<<<<<<<<<<<
 * 
 *     def computeMoments(self, coord: str, weight: str) -> list[float]:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_names);
  __pyx_r = __pyx_v_names;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1029
 *         return cdm
 * 
 *     def getCellDMNames(self) -> list[str]:             # <<<<<<<<<<<<<<
 *         """Return the names of all cell DMs in the `DMSwarm`.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.getCellDMNames", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":1047
 *         return names
 * 
 *     def computeMoments(self, coord: str, weight: str) -> list[float]:             # <<<<<<<<<<<<<<
 *         """Return the moments defined in the active cell DM.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_95computeMoments(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_94computeMoments, "DMSwarm.computeMoments(self, coord: str, weight: str) -> list[float]\nReturn the moments defined in the active cell DM.\n\n        Collective.\n\n        Notes\n        -----\n        We integrate the given weight field over the given coordinate\n\n        See Also\n        --------\n        petsc.DMSwarmComputeMoments\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:1047");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_7DMSwarm_95computeMoments = {"computeMoments", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_95computeMoments, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_94computeMoments};
static PyObject *__pyx_pw_8petsc4py_5PETSc_7DMSwarm_95computeMoments(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_coord = 0;
  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[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("computeMoments (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_coord,&__pyx_mstate_global->__pyx_n_u_weight,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 1047, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 1047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 1047, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "computeMoments", 0) < (0)) __PYX_ERR(62, 1047, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("computeMoments", 1, 2, 2, i); __PYX_ERR(62, 1047, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 1047, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 1047, __pyx_L3_error)
    }
    __pyx_v_coord = values[0];
    __pyx_v_weight = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("computeMoments", 1, 2, 2, __pyx_nargs); __PYX_ERR(62, 1047, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.computeMoments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_7DMSwarm_94computeMoments(((struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *)__pyx_v_self), __pyx_v_coord, __pyx_v_weight);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_7DMSwarm_94computeMoments(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm *__pyx_v_self, PyObject *__pyx_v_coord, PyObject *__pyx_v_weight) {
  PetscReal *__pyx_v_mom;
  PetscInt __pyx_v_cbs;
  char const *__pyx_v_ccoord;
  char const *__pyx_v_cweight;
  PyObject *__pyx_v_moments = 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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("computeMoments", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":1061
 * 
 *         """
 *         cdef PetscReal *mom = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt cbs = 0
 *         cdef const char *ccoord = NULL
*/
  __pyx_v_mom = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1062
 *         """
 *         cdef PetscReal *mom = NULL
 *         cdef PetscInt cbs = 0             # <<<<<<<<<<<<<<
 *         cdef const char *ccoord = NULL
 *         cdef const char *cweight = NULL
*/
  __pyx_v_cbs = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1063
 *         cdef PetscReal *mom = NULL
 *         cdef PetscInt cbs = 0
 *         cdef const char *ccoord = NULL             # <<<<<<<<<<<<<<
 *         cdef const char *cweight = NULL
 *         str2bytes(coord, &ccoord)
*/
  __pyx_v_ccoord = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1064
 *         cdef PetscInt cbs = 0
 *         cdef const char *ccoord = NULL
 *         cdef const char *cweight = NULL             # <<<<<<<<<<<<<<
 *         str2bytes(coord, &ccoord)
 *         str2bytes(weight, &cweight)
*/
  __pyx_v_cweight = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1065
 *         cdef const char *ccoord = NULL
 *         cdef const char *cweight = NULL
 *         str2bytes(coord, &ccoord)             # <<<<<<<<<<<<<<
 *         str2bytes(weight, &cweight)
 *         CHKERR(DMSwarmGetFieldInfo(self.dm, ccoord, &cbs, NULL))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_coord, (&__pyx_v_ccoord)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 1065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1066
 *         cdef const char *cweight = NULL
 *         str2bytes(coord, &ccoord)
 *         str2bytes(weight, &cweight)             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmGetFieldInfo(self.dm, ccoord, &cbs, NULL))
 *         cdef object moments = oarray_r(empty_r(asInt(cbs) + 2), NULL, &mom)
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_weight, (&__pyx_v_cweight)); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 1066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1067
 *         str2bytes(coord, &ccoord)
 *         str2bytes(weight, &cweight)
 *         CHKERR(DMSwarmGetFieldInfo(self.dm, ccoord, &cbs, NULL))             # <<<<<<<<<<<<<<
 *         cdef object moments = oarray_r(empty_r(asInt(cbs) + 2), NULL, &mom)
 *         CHKERR(DMSwarmComputeMoments(self.dm, ccoord, cweight, mom))
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmGetFieldInfo(__pyx_v_self->__pyx_base.dm, __pyx_v_ccoord, (&__pyx_v_cbs), NULL)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 1067, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1068
 *         str2bytes(weight, &cweight)
 *         CHKERR(DMSwarmGetFieldInfo(self.dm, ccoord, &cbs, NULL))
 *         cdef object moments = oarray_r(empty_r(asInt(cbs) + 2), NULL, &mom)             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmComputeMoments(self.dm, ccoord, cweight, mom))
 *         return moments
*/
  __pyx_t_1 = __Pyx_PyLong_From_PetscInt(__pyx_v_cbs); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 1068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_1); if (unlikely(__pyx_t_3 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(62, 1068, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_r((__pyx_t_3 + 2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 1068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_oarray_r(__pyx_t_1, NULL, (&__pyx_v_mom))); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 1068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_moments = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1069
 *         CHKERR(DMSwarmGetFieldInfo(self.dm, ccoord, &cbs, NULL))
 *         cdef object moments = oarray_r(empty_r(asInt(cbs) + 2), NULL, &mom)
 *         CHKERR(DMSwarmComputeMoments(self.dm, ccoord, cweight, mom))             # <<<<<<<<<<<<<<
 *         return moments
 * 
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmComputeMoments(__pyx_v_self->__pyx_base.dm, __pyx_v_ccoord, __pyx_v_cweight, __pyx_v_mom)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 1069, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1070
 *         cdef object moments = oarray_r(empty_r(asInt(cbs) + 2), NULL, &mom)
 *         CHKERR(DMSwarmComputeMoments(self.dm, ccoord, cweight, mom))
 *         return moments             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_moments);
  __pyx_r = __pyx_v_moments;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1047
 *         return names
 * 
 *     def computeMoments(self, coord: str, weight: str) -> list[float]:             # <<<<<<<<<<<<<<
 *         """Return the moments defined in the active cell DM.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("petsc4py.PETSc.DMSwarm.computeMoments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_moments);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":1084
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.cdm
 *         self.cdm = NULL
*/

/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_6CellDM_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_6CellDM_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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6CellDM___cinit__(((struct PyPetscDMSwarmCellDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8petsc4py_5PETSc_6CellDM___cinit__(struct PyPetscDMSwarmCellDMObject *__pyx_v_self) {
  int __pyx_r;

  /* "petsc4py/PETSc/DMSwarm.pyx":1085
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.cdm             # <<<<<<<<<<<<<<
 *         self.cdm = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->cdm));

  /* "petsc4py/PETSc/DMSwarm.pyx":1086
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.cdm
 *         self.cdm = NULL             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __pyx_v_self->cdm = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1084
 *     #
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.cdm
 *         self.cdm = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":1090
 *     #
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the cell DM.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6CellDM_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_6CellDM_2view, "CellDM.view(self, viewer: Viewer | None = None) -> None\nView the cell DM.\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.DMSwarmCellDMView\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:1090");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6CellDM_3view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6CellDM_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6CellDM_2view};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6CellDM_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 1090, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 1090, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(62, 1090, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 1090, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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(62, 1090, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.CellDM.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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(62, 1090, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6CellDM_2view(((struct PyPetscDMSwarmCellDMObject *)__pyx_v_self), __pyx_v_viewer);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6CellDM_2view(struct PyPetscDMSwarmCellDMObject *__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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":1105
 * 
 *         """
 *         cdef PetscViewer vwr = NULL             # <<<<<<<<<<<<<<
 *         if viewer is not None: vwr = viewer.vwr
 *         CHKERR(DMSwarmCellDMView(self.cdm, vwr))
*/
  __pyx_v_vwr = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1106
 *         """
 *         cdef PetscViewer vwr = NULL
 *         if viewer is not None: vwr = viewer.vwr             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmCellDMView(self.cdm, 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/DMSwarm.pyx":1107
 *         cdef PetscViewer vwr = NULL
 *         if viewer is not None: vwr = viewer.vwr
 *         CHKERR(DMSwarmCellDMView(self.cdm, vwr))             # <<<<<<<<<<<<<<
 * 
 *     def destroy(self) -> Self:
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCellDMView(__pyx_v_self->cdm, __pyx_v_vwr)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 1107, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1090
 *     #
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the cell DM.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.CellDM.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":1109
 *         CHKERR(DMSwarmCellDMView(self.cdm, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the cell DM.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6CellDM_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_6CellDM_4destroy, "CellDM.destroy(self) -> Self\nDestroy the cell DM.\n\n        Collective.\n\n        See Also\n        --------\n        create, petsc.DMSwarmCellDMDestroy\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:1109");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6CellDM_5destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6CellDM_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6CellDM_4destroy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6CellDM_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6CellDM_4destroy(((struct PyPetscDMSwarmCellDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6CellDM_4destroy(struct PyPetscDMSwarmCellDMObject *__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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":1119
 * 
 *         """
 *         CHKERR(DMSwarmCellDMDestroy(&self.cdm))             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCellDMDestroy((&__pyx_v_self->cdm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 1119, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1120
 *         """
 *         CHKERR(DMSwarmCellDMDestroy(&self.cdm))
 *         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/DMSwarm.pyx":1109
 *         CHKERR(DMSwarmCellDMView(self.cdm, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the cell DM.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.CellDM.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":1122
 *         return self
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         DM dm,
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6CellDM_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_6CellDM_6create, "CellDM.create(self, dm: DM, fields: Sequence[str], coords: Sequence[str]) -> Self\nCreate the cell DM.\n\n        Collective.\n\n        Parameters\n        ----------\n        dm\n            The underlying DM on which to place particles\n        fields\n            The swarm fields represented on the DM\n        coords\n            The swarm fields to use as coordinates in the DM\n\n        See Also\n        --------\n        destroy, petsc.DMSwarmCellDMCreate\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:1122");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6CellDM_7create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6CellDM_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6CellDM_6create};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6CellDM_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
) {
  struct PyPetscDMObject *__pyx_v_dm = 0;
  PyObject *__pyx_v_fields = 0;
  PyObject *__pyx_v_coords = 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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,&__pyx_mstate_global->__pyx_n_u_fields,&__pyx_mstate_global->__pyx_n_u_coords,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 1122, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(62, 1122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 1122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 1122, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(62, 1122, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("create", 1, 3, 3, i); __PYX_ERR(62, 1122, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 1122, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(62, 1122, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(62, 1122, __pyx_L3_error)
    }
    __pyx_v_dm = ((struct PyPetscDMObject *)values[0]);
    __pyx_v_fields = values[1];
    __pyx_v_coords = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 1, 3, 3, __pyx_nargs); __PYX_ERR(62, 1122, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.CellDM.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(62, 1124, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6CellDM_6create(((struct PyPetscDMSwarmCellDMObject *)__pyx_v_self), __pyx_v_dm, __pyx_v_fields, __pyx_v_coords);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6CellDM_6create(struct PyPetscDMSwarmCellDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_dm, PyObject *__pyx_v_fields, PyObject *__pyx_v_coords) {
  char const *__pyx_v_cval;
  PetscInt __pyx_v_i;
  PetscInt __pyx_v_nf;
  char const **__pyx_v_fieldnames;
  CYTHON_UNUSED PyObject *__pyx_v_unuseda = 0;
  PetscInt __pyx_v_nc;
  char const **__pyx_v_coordnames;
  CYTHON_UNUSED PyObject *__pyx_v_unusedb = 0;
  DMSwarmCellDM __pyx_v_newcdm;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  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("create", 0);
  __Pyx_INCREF(__pyx_v_fields);
  __Pyx_INCREF(__pyx_v_coords);

  /* "petsc4py/PETSc/DMSwarm.pyx":1145
 * 
 *         """
 *         cdef const char *cval = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fields)
 *         cdef const char** fieldnames = NULL
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1146
 *         """
 *         cdef const char *cval = NULL
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fields)             # <<<<<<<<<<<<<<
 *         cdef const char** fieldnames = NULL
 *         cdef object unuseda = oarray_p(empty_p(nf), NULL, <void**>&fieldnames)
*/
  __pyx_v_i = 0;
  __pyx_t_1 = PyObject_Length(__pyx_v_fields); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(62, 1146, __pyx_L1_error)
  __pyx_v_nf = ((PetscInt)__pyx_t_1);

  /* "petsc4py/PETSc/DMSwarm.pyx":1147
 *         cdef const char *cval = NULL
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fields)
 *         cdef const char** fieldnames = NULL             # <<<<<<<<<<<<<<
 *         cdef object unuseda = oarray_p(empty_p(nf), NULL, <void**>&fieldnames)
 *         fields = list(fields)
*/
  __pyx_v_fieldnames = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1148
 *         cdef PetscInt i = 0, nf = <PetscInt> len(fields)
 *         cdef const char** fieldnames = NULL
 *         cdef object unuseda = oarray_p(empty_p(nf), NULL, <void**>&fieldnames)             # <<<<<<<<<<<<<<
 *         fields = list(fields)
 *         for i from 0 <= i < nf:
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 1148, __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_fieldnames)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unuseda = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1149
 *         cdef const char** fieldnames = NULL
 *         cdef object unuseda = oarray_p(empty_p(nf), NULL, <void**>&fieldnames)
 *         fields = list(fields)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nf:
 *             str2bytes(fields[i], &cval)
*/
  __pyx_t_3 = PySequence_List(__pyx_v_fields); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 1149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_fields, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1150
 *         cdef object unuseda = oarray_p(empty_p(nf), NULL, <void**>&fieldnames)
 *         fields = list(fields)
 *         for i from 0 <= i < nf:             # <<<<<<<<<<<<<<
 *             str2bytes(fields[i], &cval)
 *             fieldnames[i] = cval
*/
  __pyx_t_4 = __pyx_v_nf;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "petsc4py/PETSc/DMSwarm.pyx":1151
 *         fields = list(fields)
 *         for i from 0 <= i < nf:
 *             str2bytes(fields[i], &cval)             # <<<<<<<<<<<<<<
 *             fieldnames[i] = cval
 *         cdef PetscInt nc = <PetscInt> len(coords)
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_fields, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 1151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_3, (&__pyx_v_cval)); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 1151, __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/DMSwarm.pyx":1152
 *         for i from 0 <= i < nf:
 *             str2bytes(fields[i], &cval)
 *             fieldnames[i] = cval             # <<<<<<<<<<<<<<
 *         cdef PetscInt nc = <PetscInt> len(coords)
 *         cdef const char** coordnames = NULL
*/
    (__pyx_v_fieldnames[__pyx_v_i]) = __pyx_v_cval;
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":1153
 *             str2bytes(fields[i], &cval)
 *             fieldnames[i] = cval
 *         cdef PetscInt nc = <PetscInt> len(coords)             # <<<<<<<<<<<<<<
 *         cdef const char** coordnames = NULL
 *         cdef object unusedb = oarray_p(empty_p(nf), NULL, <void**>&coordnames)
*/
  __pyx_t_1 = PyObject_Length(__pyx_v_coords); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(62, 1153, __pyx_L1_error)
  __pyx_v_nc = ((PetscInt)__pyx_t_1);

  /* "petsc4py/PETSc/DMSwarm.pyx":1154
 *             fieldnames[i] = cval
 *         cdef PetscInt nc = <PetscInt> len(coords)
 *         cdef const char** coordnames = NULL             # <<<<<<<<<<<<<<
 *         cdef object unusedb = oarray_p(empty_p(nf), NULL, <void**>&coordnames)
 *         coords = list(coords)
*/
  __pyx_v_coordnames = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1155
 *         cdef PetscInt nc = <PetscInt> len(coords)
 *         cdef const char** coordnames = NULL
 *         cdef object unusedb = oarray_p(empty_p(nf), NULL, <void**>&coordnames)             # <<<<<<<<<<<<<<
 *         coords = list(coords)
 *         for i from 0 <= i < nc:
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_empty_p(__pyx_v_nf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 1155, __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_coordnames)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_unusedb = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1156
 *         cdef const char** coordnames = NULL
 *         cdef object unusedb = oarray_p(empty_p(nf), NULL, <void**>&coordnames)
 *         coords = list(coords)             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nc:
 *             str2bytes(coords[i], &cval)
*/
  __pyx_t_3 = PySequence_List(__pyx_v_coords); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_coords, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1157
 *         cdef object unusedb = oarray_p(empty_p(nf), NULL, <void**>&coordnames)
 *         coords = list(coords)
 *         for i from 0 <= i < nc:             # <<<<<<<<<<<<<<
 *             str2bytes(coords[i], &cval)
 *             coordnames[i] = cval
*/
  __pyx_t_4 = __pyx_v_nc;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {

    /* "petsc4py/PETSc/DMSwarm.pyx":1158
 *         coords = list(coords)
 *         for i from 0 <= i < nc:
 *             str2bytes(coords[i], &cval)             # <<<<<<<<<<<<<<
 *             coordnames[i] = cval
 *         cdef PetscDMSwarmCellDM newcdm = NULL
*/
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_coords, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_3)) __PYX_ERR(62, 1158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_t_3, (&__pyx_v_cval)); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 1158, __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/DMSwarm.pyx":1159
 *         for i from 0 <= i < nc:
 *             str2bytes(coords[i], &cval)
 *             coordnames[i] = cval             # <<<<<<<<<<<<<<
 *         cdef PetscDMSwarmCellDM newcdm = NULL
 *         CHKERR(DMSwarmCellDMCreate(dm.dm, nf, fieldnames, nc, coordnames, &newcdm))
*/
    (__pyx_v_coordnames[__pyx_v_i]) = __pyx_v_cval;
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":1160
 *             str2bytes(coords[i], &cval)
 *             coordnames[i] = cval
 *         cdef PetscDMSwarmCellDM newcdm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmCellDMCreate(dm.dm, nf, fieldnames, nc, coordnames, &newcdm))
 *         CHKERR(PetscCLEAR(self.obj)); self.cdm = newcdm
*/
  __pyx_v_newcdm = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1161
 *             coordnames[i] = cval
 *         cdef PetscDMSwarmCellDM newcdm = NULL
 *         CHKERR(DMSwarmCellDMCreate(dm.dm, nf, fieldnames, nc, coordnames, &newcdm))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscCLEAR(self.obj)); self.cdm = newcdm
 *         return self
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCellDMCreate(__pyx_v_dm->dm, __pyx_v_nf, __pyx_v_fieldnames, __pyx_v_nc, __pyx_v_coordnames, (&__pyx_v_newcdm))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 1161, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1162
 *         cdef PetscDMSwarmCellDM newcdm = NULL
 *         CHKERR(DMSwarmCellDMCreate(dm.dm, nf, fieldnames, nc, coordnames, &newcdm))
 *         CHKERR(PetscCLEAR(self.obj)); self.cdm = newcdm             # <<<<<<<<<<<<<<
 *         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(62, 1162, __pyx_L1_error)
  __pyx_v_self->cdm = __pyx_v_newcdm;

  /* "petsc4py/PETSc/DMSwarm.pyx":1163
 *         CHKERR(DMSwarmCellDMCreate(dm.dm, nf, fieldnames, nc, coordnames, &newcdm))
 *         CHKERR(PetscCLEAR(self.obj)); self.cdm = newcdm
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def getDM(self) -> DM:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1122
 *         return self
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         DM dm,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("petsc4py.PETSc.CellDM.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_unuseda);
  __Pyx_XDECREF(__pyx_v_unusedb);
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XDECREF(__pyx_v_coords);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":1165
 *         return self
 * 
 *     def getDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the underlying DM.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6CellDM_9getDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6CellDM_8getDM, "CellDM.getDM(self) -> DM\nReturn the underlying DM.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.DMSwarmCellDMGetDM\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:1165");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6CellDM_9getDM = {"getDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6CellDM_9getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6CellDM_8getDM};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6CellDM_9getDM(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDM", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6CellDM_8getDM(((struct PyPetscDMSwarmCellDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6CellDM_8getDM(struct PyPetscDMSwarmCellDMObject *__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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDM", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":1175
 * 
 *         """
 *         cdef PetscDM newdm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmCellDMGetDM(self.cdm, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()
*/
  __pyx_v_newdm = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1176
 *         """
 *         cdef PetscDM newdm = NULL
 *         CHKERR(DMSwarmCellDMGetDM(self.cdm, &newdm))             # <<<<<<<<<<<<<<
 *         cdef DM dm = subtype_DM(newdm)()
 *         dm.dm = newdm
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCellDMGetDM(__pyx_v_self->cdm, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 1176, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1177
 *         cdef PetscDM newdm = NULL
 *         CHKERR(DMSwarmCellDMGetDM(self.cdm, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()             # <<<<<<<<<<<<<<
 *         dm.dm = newdm
 *         CHKERR(PetscINCREF(dm.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 1177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(62, 1177, __pyx_L1_error)
  __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1178
 *         CHKERR(DMSwarmCellDMGetDM(self.cdm, &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":1179
 *         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, 1179, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1180
 *         dm.dm = newdm
 *         CHKERR(PetscINCREF(dm.obj))
 *         return dm             # <<<<<<<<<<<<<<
 * 
 *     def getCellID(self) -> str:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_dm);
  __pyx_r = ((PyObject *)__pyx_v_dm);
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1165
 *         return self
 * 
 *     def getDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the underlying DM.
 * 
*/

  /* 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.CellDM.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/DMSwarm.pyx":1182
 *         return dm
 * 
 *     def getCellID(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the cellid field for this cell DM.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6CellDM_11getCellID(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6CellDM_10getCellID, "CellDM.getCellID(self) -> str\nReturn the cellid field for this cell DM.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.DMSwarmCellDMGetCellID\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:1182");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6CellDM_11getCellID = {"getCellID", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6CellDM_11getCellID, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6CellDM_10getCellID};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6CellDM_11getCellID(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getCellID (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCellID", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCellID", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6CellDM_10getCellID(((struct PyPetscDMSwarmCellDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6CellDM_10getCellID(struct PyPetscDMSwarmCellDMObject *__pyx_v_self) {
  char const *__pyx_v_cellid;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscErrorCode __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCellID", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":1192
 * 
 *         """
 *         cdef const char *cellid = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmCellDMGetCellID(self.cdm, &cellid))
 *         return bytes2str(cellid)
*/
  __pyx_v_cellid = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1193
 *         """
 *         cdef const char *cellid = NULL
 *         CHKERR(DMSwarmCellDMGetCellID(self.cdm, &cellid))             # <<<<<<<<<<<<<<
 *         return bytes2str(cellid)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCellDMGetCellID(__pyx_v_self->cdm, (&__pyx_v_cellid))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 1193, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1194
 *         cdef const char *cellid = NULL
 *         CHKERR(DMSwarmCellDMGetCellID(self.cdm, &cellid))
 *         return bytes2str(cellid)             # <<<<<<<<<<<<<<
 * 
 *     def getBlockSize(self, DM sw) -> int:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_cellid); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1182
 *         return dm
 * 
 *     def getCellID(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the cellid field for this cell DM.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.CellDM.getCellID", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":1196
 *         return bytes2str(cellid)
 * 
 *     def getBlockSize(self, DM sw) -> int:             # <<<<<<<<<<<<<<
 *         """Return the block size for this cell DM.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6CellDM_13getBlockSize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6CellDM_12getBlockSize, "CellDM.getBlockSize(self, sw: DM) -> int\nReturn the block size for this cell DM.\n\n        Not collective.\n\n        Parameters\n        ----------\n        sw:\n            The `DMSwarm` object\n\n        See Also\n        --------\n        petsc.DMSwarmCellDMGetBlockSize\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:1196");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6CellDM_13getBlockSize = {"getBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6CellDM_13getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6CellDM_12getBlockSize};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6CellDM_13getBlockSize(PyObject *__pyx_v_self, 
#if 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_sw = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getBlockSize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sw,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(62, 1196, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 1196, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getBlockSize", 0) < (0)) __PYX_ERR(62, 1196, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getBlockSize", 1, 1, 1, i); __PYX_ERR(62, 1196, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(62, 1196, __pyx_L3_error)
    }
    __pyx_v_sw = ((struct PyPetscDMObject *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getBlockSize", 1, 1, 1, __pyx_nargs); __PYX_ERR(62, 1196, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.CellDM.getBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sw), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "sw", 0))) __PYX_ERR(62, 1196, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6CellDM_12getBlockSize(((struct PyPetscDMSwarmCellDMObject *)__pyx_v_self), __pyx_v_sw);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6CellDM_12getBlockSize(struct PyPetscDMSwarmCellDMObject *__pyx_v_self, struct PyPetscDMObject *__pyx_v_sw) {
  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", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":1211
 * 
 *         """
 *         cdef PetscInt bs = 0             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmCellDMGetBlockSize(self.cdm, sw.dm, &bs))
 *         return toInt(bs)
*/
  __pyx_v_bs = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1212
 *         """
 *         cdef PetscInt bs = 0
 *         CHKERR(DMSwarmCellDMGetBlockSize(self.cdm, sw.dm, &bs))             # <<<<<<<<<<<<<<
 *         return toInt(bs)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCellDMGetBlockSize(__pyx_v_self->cdm, __pyx_v_sw->dm, (&__pyx_v_bs))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 1212, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1213
 *         cdef PetscInt bs = 0
 *         CHKERR(DMSwarmCellDMGetBlockSize(self.cdm, sw.dm, &bs))
 *         return toInt(bs)             # <<<<<<<<<<<<<<
 * 
 *     def getFields(self) -> list[str]:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_bs); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 1213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1196
 *         return bytes2str(cellid)
 * 
 *     def getBlockSize(self, DM sw) -> int:             # <<<<<<<<<<<<<<
 *         """Return the block size for this cell DM.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.CellDM.getBlockSize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":1215
 *         return toInt(bs)
 * 
 *     def getFields(self) -> list[str]:             # <<<<<<<<<<<<<<
 *         """Return the swarm fields defined on this cell DM.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6CellDM_15getFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6CellDM_14getFields, "CellDM.getFields(self) -> list[str]\nReturn the swarm fields defined on this cell DM.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.DMSwarmCellDMGetFields\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:1215");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6CellDM_15getFields = {"getFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6CellDM_15getFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6CellDM_14getFields};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6CellDM_15getFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getFields (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getFields", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getFields", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6CellDM_14getFields(((struct PyPetscDMSwarmCellDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6CellDM_14getFields(struct PyPetscDMSwarmCellDMObject *__pyx_v_self) {
  PetscInt __pyx_v_i;
  PetscInt __pyx_v_nf;
  char const **__pyx_v_f;
  PyObject *__pyx_v_fields = 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("getFields", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":1225
 * 
 *         """
 *         cdef PetscInt i = 0, nf = 0             # <<<<<<<<<<<<<<
 *         cdef const char **f = NULL
 *         CHKERR(DMSwarmCellDMGetFields(self.cdm, &nf, &f))
*/
  __pyx_v_i = 0;
  __pyx_v_nf = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1226
 *         """
 *         cdef PetscInt i = 0, nf = 0
 *         cdef const char **f = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmCellDMGetFields(self.cdm, &nf, &f))
 *         cdef list fields = []
*/
  __pyx_v_f = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1227
 *         cdef PetscInt i = 0, nf = 0
 *         cdef const char **f = NULL
 *         CHKERR(DMSwarmCellDMGetFields(self.cdm, &nf, &f))             # <<<<<<<<<<<<<<
 *         cdef list fields = []
 *         for i from 0 <= i < nf:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCellDMGetFields(__pyx_v_self->cdm, (&__pyx_v_nf), (&__pyx_v_f))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 1227, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1228
 *         cdef const char **f = NULL
 *         CHKERR(DMSwarmCellDMGetFields(self.cdm, &nf, &f))
 *         cdef list fields = []             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < nf:
 *             fields.append(bytes2str(f[i]))
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_fields = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1229
 *         CHKERR(DMSwarmCellDMGetFields(self.cdm, &nf, &f))
 *         cdef list fields = []
 *         for i from 0 <= i < nf:             # <<<<<<<<<<<<<<
 *             fields.append(bytes2str(f[i]))
 *         return fields
*/
  __pyx_t_3 = __pyx_v_nf;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {

    /* "petsc4py/PETSc/DMSwarm.pyx":1230
 *         cdef list fields = []
 *         for i from 0 <= i < nf:
 *             fields.append(bytes2str(f[i]))             # <<<<<<<<<<<<<<
 *         return fields
 * 
*/
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str((__pyx_v_f[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 1230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_fields, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(62, 1230, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":1231
 *         for i from 0 <= i < nf:
 *             fields.append(bytes2str(f[i]))
 *         return fields             # <<<<<<<<<<<<<<
 * 
 *     def getCoordinateFields(self) -> list[str]:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_fields);
  __pyx_r = __pyx_v_fields;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1215
 *         return toInt(bs)
 * 
 *     def getFields(self) -> list[str]:             # <<<<<<<<<<<<<<
 *         """Return the swarm fields defined on this cell DM.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.CellDM.getFields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/DMSwarm.pyx":1233
 *         return fields
 * 
 *     def getCoordinateFields(self) -> list[str]:             # <<<<<<<<<<<<<<
 *         """Return the swarm fields used as coordinates on this cell DM.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_6CellDM_17getCoordinateFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_6CellDM_16getCoordinateFields, "CellDM.getCoordinateFields(self) -> list[str]\nReturn the swarm fields used as coordinates on this cell DM.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.DMSwarmCellDMGetCoordinateFields\n\n        \nSource code at petsc4py/PETSc/DMSwarm.pyx:1233");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_6CellDM_17getCoordinateFields = {"getCoordinateFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6CellDM_17getCoordinateFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6CellDM_16getCoordinateFields};
static PyObject *__pyx_pw_8petsc4py_5PETSc_6CellDM_17getCoordinateFields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getCoordinateFields (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getCoordinateFields", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCoordinateFields", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_6CellDM_16getCoordinateFields(((struct PyPetscDMSwarmCellDMObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_6CellDM_16getCoordinateFields(struct PyPetscDMSwarmCellDMObject *__pyx_v_self) {
  PetscInt __pyx_v_i;
  PetscInt __pyx_v_ncf;
  char const **__pyx_v_cf;
  PyObject *__pyx_v_fields = 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("getCoordinateFields", 0);

  /* "petsc4py/PETSc/DMSwarm.pyx":1243
 * 
 *         """
 *         cdef PetscInt i = 0, ncf = 0             # <<<<<<<<<<<<<<
 *         cdef const char **cf = NULL
 *         CHKERR(DMSwarmCellDMGetCoordinateFields(self.cdm, &ncf, &cf))
*/
  __pyx_v_i = 0;
  __pyx_v_ncf = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1244
 *         """
 *         cdef PetscInt i = 0, ncf = 0
 *         cdef const char **cf = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(DMSwarmCellDMGetCoordinateFields(self.cdm, &ncf, &cf))
 *         cdef list fields = []
*/
  __pyx_v_cf = NULL;

  /* "petsc4py/PETSc/DMSwarm.pyx":1245
 *         cdef PetscInt i = 0, ncf = 0
 *         cdef const char **cf = NULL
 *         CHKERR(DMSwarmCellDMGetCoordinateFields(self.cdm, &ncf, &cf))             # <<<<<<<<<<<<<<
 *         cdef list fields = []
 *         for i from 0 <= i < ncf:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMSwarmCellDMGetCoordinateFields(__pyx_v_self->cdm, (&__pyx_v_ncf), (&__pyx_v_cf))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(62, 1245, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1246
 *         cdef const char **cf = NULL
 *         CHKERR(DMSwarmCellDMGetCoordinateFields(self.cdm, &ncf, &cf))
 *         cdef list fields = []             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < ncf:
 *             fields.append(bytes2str(cf[i]))
*/
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 1246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_fields = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1247
 *         CHKERR(DMSwarmCellDMGetCoordinateFields(self.cdm, &ncf, &cf))
 *         cdef list fields = []
 *         for i from 0 <= i < ncf:             # <<<<<<<<<<<<<<
 *             fields.append(bytes2str(cf[i]))
 *         return fields
*/
  __pyx_t_3 = __pyx_v_ncf;
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {

    /* "petsc4py/PETSc/DMSwarm.pyx":1248
 *         cdef list fields = []
 *         for i from 0 <= i < ncf:
 *             fields.append(bytes2str(cf[i]))             # <<<<<<<<<<<<<<
 *         return fields
 * 
*/
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str((__pyx_v_cf[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 1248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_fields, __pyx_t_2); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(62, 1248, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":1249
 *         for i from 0 <= i < ncf:
 *             fields.append(bytes2str(cf[i]))
 *         return fields             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_fields);
  __pyx_r = __pyx_v_fields;
  goto __pyx_L0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1233
 *         return fields
 * 
 *     def getCoordinateFields(self) -> list[str]:             # <<<<<<<<<<<<<<
 *         """Return the swarm fields used as coordinates on this cell DM.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.CellDM.getCoordinateFields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fields);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Partitioner.pyx":22
 *     Type = PartitionerType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":23
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.part             # <<<<<<<<<<<<<<
 *         self.part = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->part));

  /* "petsc4py/PETSc/Partitioner.pyx":24
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.part
 *         self.part = NULL             # <<<<<<<<<<<<<<
 * 
 *     def view(self, Viewer viewer=None) -> None:
*/
  __pyx_v_self->part = NULL;

  /* "petsc4py/PETSc/Partitioner.pyx":22
 *     Type = PartitionerType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.part
 *         self.part = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/Partitioner.pyx":26
 *         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:26");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11Partitioner_3view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_2view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(63, 26, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(63, 26, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(63, 26, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(63, 26, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 26, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(63, 26, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Partitioner.pyx":41
 * 
 *         """
 *         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":42
 *         """
 *         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":43
 *         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, 43, __pyx_L1_error)

  /* "petsc4py/PETSc/Partitioner.pyx":26
 *         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":45
 *         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:45");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11Partitioner_5destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_4destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Partitioner.pyx":55
 * 
 *         """
 *         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, 55, __pyx_L1_error)

  /* "petsc4py/PETSc/Partitioner.pyx":56
 *         """
 *         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":45
 *         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":58
 *         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:58");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11Partitioner_7create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_6create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(63, 58, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(63, 58, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(63, 58, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(63, 58, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(63, 58, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Partitioner.pyx":75
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(63, 75, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Partitioner.pyx":76
 *         """
 *         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":77
 *         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, 77, __pyx_L1_error)

  /* "petsc4py/PETSc/Partitioner.pyx":78
 *         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, 78, __pyx_L1_error)
  __pyx_v_self->part = __pyx_v_newpart;

  /* "petsc4py/PETSc/Partitioner.pyx":79
 *         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":58
 *         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":81
 *         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:81");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11Partitioner_9setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_8setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_part_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(63, 81, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(63, 81, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(63, 81, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(63, 81, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(63, 81, __pyx_L3_error)
    }
    __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, 81, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":96
 * 
 *         """
 *         cdef PetscPartitionerType cval = NULL             # <<<<<<<<<<<<<<
 *         part_type = str2bytes(part_type, &cval)
 *         CHKERR(PetscPartitionerSetType(self.part, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Partitioner.pyx":97
 *         """
 *         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, 97, __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":98
 *         cdef PetscPartitionerType cval = NULL
 *         part_type = str2bytes(part_type, &cval)
 *         CHKERR(PetscPartitionerSetType(self.part, cval))             # <<<<<<<<<<<<<<
 * 
 *     def getType(self) -> str:
*/
  __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, 98, __pyx_L1_error)

  /* "petsc4py/PETSc/Partitioner.pyx":81
 *         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":100
 *         CHKERR(PetscPartitionerSetType(self.part, cval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """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) -> str\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:100");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11Partitioner_11getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_10getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Partitioner.pyx":110
 * 
 *         """
 *         cdef PetscPartitionerType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscPartitionerGetType(self.part, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Partitioner.pyx":111
 *         """
 *         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, 111, __pyx_L1_error)

  /* "petsc4py/PETSc/Partitioner.pyx":112
 *         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, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Partitioner.pyx":100
 *         CHKERR(PetscPartitionerSetType(self.part, cval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """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":114
 *         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:114");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11Partitioner_13setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_13setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_12setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Partitioner.pyx":124
 * 
 *         """
 *         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, 124, __pyx_L1_error)

  /* "petsc4py/PETSc/Partitioner.pyx":114
 *         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":126
 *         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:126");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11Partitioner_15setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_15setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_14setUp};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Partitioner.pyx":136
 * 
 *         """
 *         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, 136, __pyx_L1_error)

  /* "petsc4py/PETSc/Partitioner.pyx":126
 *         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":138
 *         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:138");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11Partitioner_17reset = {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_17reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_16reset};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("reset", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Partitioner.pyx":148
 * 
 *         """
 *         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, 148, __pyx_L1_error)

  /* "petsc4py/PETSc/Partitioner.pyx":138
 *         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":150
 *         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:150");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_11Partitioner_19setShellPartition = {"setShellPartition", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_19setShellPartition, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_18setShellPartition};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_numProcs,&__pyx_mstate_global->__pyx_n_u_sizes,&__pyx_mstate_global->__pyx_n_u_points,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(63, 150, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(63, 150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(63, 150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(63, 150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setShellPartition", 0) < (0)) __PYX_ERR(63, 150, __pyx_L3_error)

      /* "petsc4py/PETSc/Partitioner.pyx":153
 *         self,
 *         numProcs: int,
 *         sizes: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         points: Sequence[int] | None = None) -> None:
 *         """Set a custom partition for a mesh.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Partitioner.pyx":154
 *         numProcs: int,
 *         sizes: Sequence[int] | None = None,
 *         points: Sequence[int] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set a custom partition for a mesh.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setShellPartition", 0, 1, 3, i); __PYX_ERR(63, 150, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(63, 150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(63, 150, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(63, 150, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/Partitioner.pyx":153
 *         self,
 *         numProcs: int,
 *         sizes: Sequence[int] | None = None,             # <<<<<<<<<<<<<<
 *         points: Sequence[int] | None = None) -> None:
 *         """Set a custom partition for a mesh.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));

      /* "petsc4py/PETSc/Partitioner.pyx":154
 *         numProcs: int,
 *         sizes: Sequence[int] | None = None,
 *         points: Sequence[int] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set a custom partition for a mesh.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 150, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":150
 *         CHKERR(PetscPartitionerReset(self.part))
 * 
 *     def setShellPartition(             # <<<<<<<<<<<<<<
 *         self,
 *         numProcs: int,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  PetscErrorCode __pyx_t_8;
  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":173
 * 
 *         """
 *         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, 173, __pyx_L1_error)
  __pyx_v_cnumProcs = __pyx_t_1;

  /* "petsc4py/PETSc/Partitioner.pyx":174
 *         """
 *         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":175
 *         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":176
 *         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":177
 *         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":178
 *         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, 178, __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":179
 *         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":180
 *             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_4 = NULL;

      /* "petsc4py/PETSc/Partitioner.pyx":181
 *             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_5 = __Pyx_PyUnicode_FormatSafe(__pyx_mstate_global->__pyx_kp_u_sizes_array_should_have_d_entrie, __pyx_v_numProcs); if (unlikely(!__pyx_t_5)) __PYX_ERR(63, 180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_nsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(63, 181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_5, __pyx_t_6};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__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_3)) __PYX_ERR(63, 180, __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(63, 180, __pyx_L1_error)

      /* "petsc4py/PETSc/Partitioner.pyx":179
 *         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":182
 *                 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":183
 *                                  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_6 = NULL;
      __pyx_t_7 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Must_provide_both_sizes_and_poin};
        __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(63, 183, __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(63, 183, __pyx_L1_error)

      /* "petsc4py/PETSc/Partitioner.pyx":182
 *                 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":177
 *         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":184
 *             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":185
 *                 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_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_iarray_i(__pyx_v_points, NULL, (&__pyx_v_cpoints))); if (unlikely(!__pyx_t_3)) __PYX_ERR(63, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_points, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/Partitioner.pyx":184
 *             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":186
 *         if points is not None:
 *             points = iarray_i(points, NULL, &cpoints)
 *         CHKERR(PetscPartitionerShellSetPartition(self.part, cnumProcs,             # <<<<<<<<<<<<<<
 *                                                  csizes, cpoints))
 * 
*/
  __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscPartitionerShellSetPartition(__pyx_v_self->part, __pyx_v_cnumProcs, __pyx_v_csizes, __pyx_v_cpoints)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(63, 186, __pyx_L1_error)

  /* "petsc4py/PETSc/Partitioner.pyx":150
 *         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_XDECREF(__pyx_t_6);
  __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":20
 *     Type = SpaceType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":21
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.space             # <<<<<<<<<<<<<<
 *         self.space  = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->space));

  /* "petsc4py/PETSc/Space.pyx":22
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.space
 *         self.space  = NULL             # <<<<<<<<<<<<<<
 * 
 *     def setUp(self) -> None:
*/
  __pyx_v_self->space = NULL;

  /* "petsc4py/PETSc/Space.pyx":20
 *     Type = SpaceType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.space
 *         self.space  = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/Space.pyx":24
 *         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:24");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_3setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_3setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_2setUp};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":34
 * 
 *         """
 *         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, 34, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":24
 *         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":36
 *         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:36");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_5create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_4create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 36, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 36, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(64, 36, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 36, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(64, 36, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Space.pyx":53
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(64, 53, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":54
 *         """
 *         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":55
 *         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, 55, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":56
 *         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, 56, __pyx_L1_error)
  __pyx_v_self->space = __pyx_v_newsp;

  /* "petsc4py/PETSc/Space.pyx":57
 *         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":36
 *         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":59
 *         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:59");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_7destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_6destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":69
 * 
 *         """
 *         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, 69, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":70
 *         """
 *         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":59
 *         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":72
 *         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:72");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_9view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_9view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_8view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 72, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 72, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(64, 72, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 72, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 72, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(64, 72, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Space.pyx":87
 * 
 *         """
 *         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":88
 *         """
 *         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":89
 *         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, 89, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":72
 *         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":91
 *         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:91");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_11setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_11setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_10setFromOptions};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":101
 * 
 *         """
 *         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, 101, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":91
 *         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":103
 *         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        Not collective.\n\n        See Also\n        --------\n        petsc.PetscSpaceGetDimension\n\n        \nSource code at petsc4py/PETSc/Space.pyx:103");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_13getDimension = {"getDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_13getDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_12getDimension};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDimension", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":113
 * 
 *         """
 *         cdef PetscInt cdim = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSpaceGetDimension(self.space, &cdim))
 *         return toInt(cdim)
*/
  __pyx_v_cdim = 0;

  /* "petsc4py/PETSc/Space.pyx":114
 *         """
 *         cdef PetscInt cdim = 0
 *         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, 114, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":115
 *         cdef PetscInt cdim = 0
 *         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, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":103
 *         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":117
 *         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        Not collective.\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:117");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_15getDegree = {"getDegree", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_15getDegree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_14getDegree};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDegree", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":134
 * 
 *         """
 *         cdef PetscInt cdegmax = 0, cdegmin = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSpaceGetDegree(self.space, &cdegmin, &cdegmax))
 *         return toInt(cdegmin), toInt(cdegmax)
*/
  __pyx_v_cdegmax = 0;
  __pyx_v_cdegmin = 0;

  /* "petsc4py/PETSc/Space.pyx":135
 *         """
 *         cdef PetscInt cdegmax = 0, cdegmin = 0
 *         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, 135, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":136
 *         cdef PetscInt cdegmax = 0, cdegmin = 0
 *         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, 136, __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, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 136, __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) != (0)) __PYX_ERR(64, 136, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3) != (0)) __PYX_ERR(64, 136, __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":117
 *         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":138
 *         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        Logically collective.\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:138");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_17setDegree = {"setDegree", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_17setDegree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_16setDegree};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_degree,&__pyx_mstate_global->__pyx_n_u_maxDegree,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 138, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(64, 138, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 138, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDegree", 0) < (0)) __PYX_ERR(64, 138, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDegree", 1, 2, 2, i); __PYX_ERR(64, 138, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 138, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(64, 138, __pyx_L3_error)
    }
    __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, 138, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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
  int __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("setDegree", 0);

  /* "petsc4py/PETSc/Space.pyx":157
 * 
 *         """
 *         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":158
 *         """
 *         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_1 = (__pyx_v_degree != Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_degree); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 158, __pyx_L1_error)
    __pyx_v_cdegree = __pyx_t_2;
  }

  /* "petsc4py/PETSc/Space.pyx":159
 *         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":160
 *         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_1 = (__pyx_v_maxDegree != Py_None);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_maxDegree); if (unlikely(__pyx_t_2 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 160, __pyx_L1_error)
    __pyx_v_cmaxdegree = __pyx_t_2;
  }

  /* "petsc4py/PETSc/Space.pyx":161
 *         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_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceSetDegree(__pyx_v_self->space, __pyx_v_cdegree, __pyx_v_cmaxdegree)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 161, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":138
 *         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_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":163
 *         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        Not collective.\n\n        See Also\n        --------\n        setNumVariables, petsc.PetscSpaceGetNumVariables\n\n        \nSource code at petsc4py/PETSc/Space.pyx:163");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_19getNumVariables = {"getNumVariables", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_19getNumVariables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_18getNumVariables};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNumVariables", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":173
 * 
 *         """
 *         cdef PetscInt cnvars = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSpaceGetNumVariables(self.space, &cnvars))
 *         return toInt(cnvars)
*/
  __pyx_v_cnvars = 0;

  /* "petsc4py/PETSc/Space.pyx":174
 *         """
 *         cdef PetscInt cnvars = 0
 *         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, 174, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":175
 *         cdef PetscInt cnvars = 0
 *         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, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":163
 *         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":177
 *         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        Logically collective.\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:177");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_21setNumVariables = {"setNumVariables", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_21setNumVariables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_20setNumVariables};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 177, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 177, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNumVariables", 0) < (0)) __PYX_ERR(64, 177, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNumVariables", 1, 1, 1, i); __PYX_ERR(64, 177, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 177, __pyx_L3_error)
    }
    __pyx_v_n = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setNumVariables", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 177, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Space.pyx":192
 * 
 *         """
 *         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, 192, __pyx_L1_error)
  __pyx_v_cn = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":193
 *         """
 *         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, 193, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":177
 *         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":195
 *         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        Not collective.\n\n        See Also\n        --------\n        setNumComponents, petsc.PetscSpaceGetNumComponents\n\n        \nSource code at petsc4py/PETSc/Space.pyx:195");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_23getNumComponents = {"getNumComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_23getNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_22getNumComponents};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNumComponents", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":205
 * 
 *         """
 *         cdef PetscInt cncomps = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSpaceGetNumComponents(self.space, &cncomps))
 *         return toInt(cncomps)
*/
  __pyx_v_cncomps = 0;

  /* "petsc4py/PETSc/Space.pyx":206
 *         """
 *         cdef PetscInt cncomps = 0
 *         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, 206, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":207
 *         cdef PetscInt cncomps = 0
 *         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, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":195
 *         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":209
 *         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        Logically collective.\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:209");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_25setNumComponents = {"setNumComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_25setNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_24setNumComponents};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 209, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 209, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNumComponents", 0) < (0)) __PYX_ERR(64, 209, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNumComponents", 1, 1, 1, i); __PYX_ERR(64, 209, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 209, __pyx_L3_error)
    }
    __pyx_v_nc = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setNumComponents", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 209, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Space.pyx":224
 * 
 *         """
 *         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, 224, __pyx_L1_error)
  __pyx_v_cnc = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":225
 *         """
 *         cdef PetscInt cnc = asInt(nc)
 *         CHKERR(PetscSpaceSetNumComponents(self.space, cnc))             # <<<<<<<<<<<<<<
 * 
 *     def getType(self) -> str:
*/
  __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, 225, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":209
 *         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":227
 *         CHKERR(PetscSpaceSetNumComponents(self.space, cnc))
 * 
 *     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:227");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_27getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_27getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_26getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":237
 * 
 *         """
 *         cdef PetscSpaceType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSpaceGetType(self.space, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Space.pyx":238
 *         """
 *         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, 238, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":239
 *         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, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":227
 *         CHKERR(PetscSpaceSetNumComponents(self.space, cnc))
 * 
 *     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":241
 *         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:241");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_29setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_29setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_28setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_space_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 241, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 241, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(64, 241, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(64, 241, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 241, __pyx_L3_error)
    }
    __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, 241, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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":256
 * 
 *         """
 *         cdef PetscSpaceType cval = NULL             # <<<<<<<<<<<<<<
 *         space_type = str2bytes(space_type, &cval)
 *         CHKERR(PetscSpaceSetType(self.space, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Space.pyx":257
 *         """
 *         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, 257, __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":258
 *         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, 258, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":259
 *         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":241
 *         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":261
 *         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        Not collective.\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:261");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_31getSumConcatenate = {"getSumConcatenate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_31getSumConcatenate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_30getSumConcatenate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSumConcatenate", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":276
 * 
 *         """
 *         cdef PetscBool concatenate = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSpaceSumGetConcatenate(self.space, &concatenate))
 *         return toBool(concatenate)
*/
  __pyx_v_concatenate = PETSC_FALSE;

  /* "petsc4py/PETSc/Space.pyx":277
 *         """
 *         cdef PetscBool concatenate = PETSC_FALSE
 *         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, 277, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":278
 *         cdef PetscBool concatenate = PETSC_FALSE
 *         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, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":261
 *         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":280
 *         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        Logically collective.\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:280");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_33setSumConcatenate = {"setSumConcatenate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_33setSumConcatenate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_32setSumConcatenate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_concatenate,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 280, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 280, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSumConcatenate", 0) < (0)) __PYX_ERR(64, 280, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSumConcatenate", 1, 1, 1, i); __PYX_ERR(64, 280, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 280, __pyx_L3_error)
    }
    __pyx_v_concatenate = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setSumConcatenate", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 280, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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) {
  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", 0);

  /* "petsc4py/PETSc/Space.pyx":301
 * 
 *         """
 *         cdef PetscBool cconcatenate = asBool(concatenate)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSpaceSumSetConcatenate(self.space, cconcatenate))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_asBool(__pyx_v_concatenate); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(64, 301, __pyx_L1_error)
  __pyx_v_cconcatenate = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":302
 *         """
 *         cdef PetscBool cconcatenate = asBool(concatenate)
 *         CHKERR(PetscSpaceSumSetConcatenate(self.space, cconcatenate))             # <<<<<<<<<<<<<<
 * 
 *     def getSumNumSubspaces(self) -> int:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceSumSetConcatenate(__pyx_v_self->space, __pyx_v_cconcatenate)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 302, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":280
 *         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":304
 *         CHKERR(PetscSpaceSumSetConcatenate(self.space, cconcatenate))
 * 
 *     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        Not collective.\n\n        See Also\n        --------\n        setSumNumSubspaces, petsc.PetscSpaceSumGetNumSubspaces\n\n        \nSource code at petsc4py/PETSc/Space.pyx:304");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_35getSumNumSubspaces = {"getSumNumSubspaces", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_35getSumNumSubspaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_34getSumNumSubspaces};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getSumNumSubspaces", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":314
 * 
 *         """
 *         cdef PetscInt numSumSpaces = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSpaceSumGetNumSubspaces(self.space, &numSumSpaces))
 *         return toInt(numSumSpaces)
*/
  __pyx_v_numSumSpaces = 0;

  /* "petsc4py/PETSc/Space.pyx":315
 *         """
 *         cdef PetscInt numSumSpaces = 0
 *         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, 315, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":316
 *         cdef PetscInt numSumSpaces = 0
 *         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, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":304
 *         CHKERR(PetscSpaceSumSetConcatenate(self.space, cconcatenate))
 * 
 *     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":318
 *         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        Not collective.\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:318");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_37getSumSubspace = {"getSumSubspace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_37getSumSubspace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_36getSumSubspace};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_s_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 318, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 318, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getSumSubspace", 0) < (0)) __PYX_ERR(64, 318, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getSumSubspace", 1, 1, 1, i); __PYX_ERR(64, 318, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 318, __pyx_L3_error)
    }
    __pyx_v_s = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getSumSubspace", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 318, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PetscInt __pyx_v_cs;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __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("getSumSubspace", 0);

  /* "petsc4py/PETSc/Space.pyx":333
 * 
 *         """
 *         cdef Space subsp = Space()             # <<<<<<<<<<<<<<
 *         cdef PetscInt cs = asInt(s)
 *         CHKERR(PetscSpaceSumGetSubspace(self.space, cs, &subsp.space))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(64, 333, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_subsp = ((struct PyPetscSpaceObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Space.pyx":334
 *         """
 *         cdef Space subsp = Space()
 *         cdef PetscInt cs = asInt(s)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSpaceSumGetSubspace(self.space, cs, &subsp.space))
 *         return subsp
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_v_s); if (unlikely(__pyx_t_4 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(64, 334, __pyx_L1_error)
  __pyx_v_cs = __pyx_t_4;

  /* "petsc4py/PETSc/Space.pyx":335
 *         cdef Space subsp = Space()
 *         cdef PetscInt cs = asInt(s)
 *         CHKERR(PetscSpaceSumGetSubspace(self.space, cs, &subsp.space))             # <<<<<<<<<<<<<<
 *         return subsp
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceSumGetSubspace(__pyx_v_self->space, __pyx_v_cs, (&__pyx_v_subsp->space))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 335, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":336
 *         cdef PetscInt cs = asInt(s)
 *         CHKERR(PetscSpaceSumGetSubspace(self.space, cs, &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":318
 *         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_XDECREF(__pyx_t_2);
  __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":338
 *         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        Logically collective.\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:338");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_39setSumSubspace = {"setSumSubspace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_39setSumSubspace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_38setSumSubspace};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_s_2,&__pyx_mstate_global->__pyx_n_u_subsp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 338, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(64, 338, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 338, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSumSubspace", 0) < (0)) __PYX_ERR(64, 338, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSumSubspace", 1, 2, 2, i); __PYX_ERR(64, 338, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 338, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(64, 338, __pyx_L3_error)
    }
    __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, 338, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, 0, "subsp", 0))) __PYX_ERR(64, 338, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Space.pyx":355
 * 
 *         """
 *         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, 355, __pyx_L1_error)
  __pyx_v_cs = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":356
 *         """
 *         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, 356, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":338
 *         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":358
 *         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        Logically collective.\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:358");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_41setSumNumSubspaces = {"setSumNumSubspaces", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_41setSumNumSubspaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_40setSumNumSubspaces};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_numSumSpaces,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 358, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 358, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSumNumSubspaces", 0) < (0)) __PYX_ERR(64, 358, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSumNumSubspaces", 1, 1, 1, i); __PYX_ERR(64, 358, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 358, __pyx_L3_error)
    }
    __pyx_v_numSumSpaces = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setSumNumSubspaces", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 358, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Space.pyx":373
 * 
 *         """
 *         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, 373, __pyx_L1_error)
  __pyx_v_cnumSumSpaces = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":374
 *         """
 *         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, 374, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":358
 *         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":376
 *         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        Not collective.\n\n        See Also\n        --------\n        setTensorNumSubspaces, petsc.PetscSpaceTensorGetNumSubspaces\n\n        \nSource code at petsc4py/PETSc/Space.pyx:376");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_43getTensorNumSubspaces = {"getTensorNumSubspaces", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_43getTensorNumSubspaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_42getTensorNumSubspaces};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTensorNumSubspaces", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":386
 * 
 *         """
 *         cdef PetscInt cnumTensSpaces = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSpaceTensorGetNumSubspaces(self.space, &cnumTensSpaces))
 *         return toInt(cnumTensSpaces)
*/
  __pyx_v_cnumTensSpaces = 0;

  /* "petsc4py/PETSc/Space.pyx":387
 *         """
 *         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, 387, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":388
 *         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, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":376
 *         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":390
 *         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        Logically collective.\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:390");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_45setTensorSubspace = {"setTensorSubspace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_45setTensorSubspace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_44setTensorSubspace};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_s_2,&__pyx_mstate_global->__pyx_n_u_subsp,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 390, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(64, 390, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 390, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTensorSubspace", 0) < (0)) __PYX_ERR(64, 390, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setTensorSubspace", 1, 2, 2, i); __PYX_ERR(64, 390, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 390, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(64, 390, __pyx_L3_error)
    }
    __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, 390, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, 0, "subsp", 0))) __PYX_ERR(64, 390, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Space.pyx":407
 * 
 *         """
 *         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, 407, __pyx_L1_error)
  __pyx_v_cs = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":408
 *         """
 *         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, 408, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":390
 *         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":410
 *         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        Not collective.\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:410");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_47getTensorSubspace = {"getTensorSubspace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_47getTensorSubspace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_46getTensorSubspace};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_s_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 410, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 410, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getTensorSubspace", 0) < (0)) __PYX_ERR(64, 410, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getTensorSubspace", 1, 1, 1, i); __PYX_ERR(64, 410, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 410, __pyx_L3_error)
    }
    __pyx_v_s = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getTensorSubspace", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 410, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getTensorSubspace", 0);

  /* "petsc4py/PETSc/Space.pyx":425
 * 
 *         """
 *         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, 425, __pyx_L1_error)
  __pyx_v_cs = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":426
 *         """
 *         cdef PetscInt cs = asInt(s)
 *         cdef Space subsp = Space()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSpaceTensorGetSubspace(self.space, cs, &subsp.space))
 *         return subsp
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 426, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_subsp = ((struct PyPetscSpaceObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Space.pyx":427
 *         cdef PetscInt cs = asInt(s)
 *         cdef Space subsp = Space()
 *         CHKERR(PetscSpaceTensorGetSubspace(self.space, cs, &subsp.space))             # <<<<<<<<<<<<<<
 *         return subsp
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpaceTensorGetSubspace(__pyx_v_self->space, __pyx_v_cs, (&__pyx_v_subsp->space))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 427, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":428
 *         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":410
 *         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_XDECREF(__pyx_t_3);
  __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":430
 *         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        Logically collective.\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:430");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_49setTensorNumSubspaces = {"setTensorNumSubspaces", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_49setTensorNumSubspaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_48setTensorNumSubspaces};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_numTensSpaces,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 430, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 430, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setTensorNumSubspaces", 0) < (0)) __PYX_ERR(64, 430, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setTensorNumSubspaces", 1, 1, 1, i); __PYX_ERR(64, 430, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 430, __pyx_L3_error)
    }
    __pyx_v_numTensSpaces = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setTensorNumSubspaces", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 430, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Space.pyx":445
 * 
 *         """
 *         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, 445, __pyx_L1_error)
  __pyx_v_cnumTensSpaces = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":446
 *         """
 *         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, 446, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":430
 *         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":448
 *         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        Not collective.\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:448");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_51getPolynomialTensor = {"getPolynomialTensor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_51getPolynomialTensor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_50getPolynomialTensor};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPolynomialTensor", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":464
 * 
 *         """
 *         cdef PetscBool ctensor = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSpacePolynomialGetTensor(self.space, &ctensor))
 *         return toBool(ctensor)
*/
  __pyx_v_ctensor = PETSC_FALSE;

  /* "petsc4py/PETSc/Space.pyx":465
 *         """
 *         cdef PetscBool ctensor = PETSC_FALSE
 *         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, 465, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":466
 *         cdef PetscBool ctensor = PETSC_FALSE
 *         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, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":448
 *         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":468
 *         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        Logically collective.\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:468");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_53setPolynomialTensor = {"setPolynomialTensor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_53setPolynomialTensor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_52setPolynomialTensor};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tensor,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 468, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 468, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPolynomialTensor", 0) < (0)) __PYX_ERR(64, 468, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPolynomialTensor", 1, 1, 1, i); __PYX_ERR(64, 468, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 468, __pyx_L3_error)
    }
    __pyx_v_tensor = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPolynomialTensor", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 468, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Space.pyx":490
 * 
 *         """
 *         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, 490, __pyx_L1_error)
  __pyx_v_ctensor = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":491
 *         """
 *         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, 491, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":468
 *         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":493
 *         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:493");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_55setPointPoints = {"setPointPoints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_55setPointPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_54setPointPoints};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_quad,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 493, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 493, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPointPoints", 0) < (0)) __PYX_ERR(64, 493, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPointPoints", 1, 1, 1, i); __PYX_ERR(64, 493, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 493, __pyx_L3_error)
    }
    __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, 493, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, 0, "quad", 0))) __PYX_ERR(64, 493, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Space.pyx":511
 * 
 *         """
 *         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, 511, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":493
 *         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":513
 *         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:513");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_57getPointPoints = {"getPointPoints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_57getPointPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_56getPointPoints};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPointPoints", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getPointPoints", 0);

  /* "petsc4py/PETSc/Space.pyx":523
 * 
 *         """
 *         cdef Quad quad = Quad()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSpacePointGetPoints(self.space, &quad.quad))
 *         CHKERR(PetscINCREF(quad.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(64, 523, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_quad = ((struct PyPetscQuadObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Space.pyx":524
 *         """
 *         cdef Quad quad = Quad()
 *         CHKERR(PetscSpacePointGetPoints(self.space, &quad.quad))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(quad.obj))
 *         return quad
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscSpacePointGetPoints(__pyx_v_self->space, (&__pyx_v_quad->quad))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 524, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":525
 *         cdef Quad quad = Quad()
 *         CHKERR(PetscSpacePointGetPoints(self.space, &quad.quad))
 *         CHKERR(PetscINCREF(quad.obj))             # <<<<<<<<<<<<<<
 *         return quad
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_quad->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 525, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":526
 *         CHKERR(PetscSpacePointGetPoints(self.space, &quad.quad))
 *         CHKERR(PetscINCREF(quad.obj))
 *         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":513
 *         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_XDECREF(__pyx_t_2);
  __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":528
 *         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        Logically collective.\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:528");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_59setPTrimmedFormDegree = {"setPTrimmedFormDegree", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_59setPTrimmedFormDegree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_58setPTrimmedFormDegree};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_formDegree,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 528, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 528, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setPTrimmedFormDegree", 0) < (0)) __PYX_ERR(64, 528, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setPTrimmedFormDegree", 1, 1, 1, i); __PYX_ERR(64, 528, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 528, __pyx_L3_error)
    }
    __pyx_v_formDegree = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setPTrimmedFormDegree", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 528, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Space.pyx":543
 * 
 *         """
 *         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, 543, __pyx_L1_error)
  __pyx_v_cformDegree = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":544
 *         """
 *         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, 544, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":528
 *         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":546
 *         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        Not collective.\n\n        See Also\n        --------\n        setPTrimmedFormDegree, petsc.PetscSpacePTrimmedGetFormDegree\n\n        \nSource code at petsc4py/PETSc/Space.pyx:546");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5Space_61getPTrimmedFormDegree = {"getPTrimmedFormDegree", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_61getPTrimmedFormDegree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_60getPTrimmedFormDegree};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getPTrimmedFormDegree", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":556
 * 
 *         """
 *         cdef PetscInt cformDegree = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscSpacePTrimmedGetFormDegree(self.space, &cformDegree))
 *         return toInt(cformDegree)
*/
  __pyx_v_cformDegree = 0;

  /* "petsc4py/PETSc/Space.pyx":557
 *         """
 *         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, 557, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":558
 *         cdef PetscInt cformDegree = 0
 *         CHKERR(PetscSpacePTrimmedGetFormDegree(self.space, &cformDegree))
 *         return toInt(cformDegree)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_cformDegree); if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":546
 *         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":578
 *     Type = DualSpaceType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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":579
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.dualspace             # <<<<<<<<<<<<<<
 *         self.dualspace  = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->dualspace));

  /* "petsc4py/PETSc/Space.pyx":580
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.dualspace
 *         self.dualspace  = NULL             # <<<<<<<<<<<<<<
 * 
 *     def setUp(self) -> None:
*/
  __pyx_v_self->dualspace = NULL;

  /* "petsc4py/PETSc/Space.pyx":578
 *     Type = DualSpaceType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.dualspace
 *         self.dualspace  = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/Space.pyx":582
 *         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:582");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_3setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_3setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_2setUp};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":592
 * 
 *         """
 *         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, 592, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":582
 *         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":594
 *         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:594");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_5create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_4create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 594, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 594, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(64, 594, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 594, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(64, 594, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Space.pyx":611
 * 
 *         """
 *         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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(64, 611, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":612
 *         """
 *         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":613
 *         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, 613, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":614
 *         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, 614, __pyx_L1_error)
  __pyx_v_self->dualspace = __pyx_v_newdsp;

  /* "petsc4py/PETSc/Space.pyx":615
 *         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":594
 *         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":617
 *         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:617");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_7view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_7view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_6view};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 617, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 617, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(64, 617, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 617, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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, 617, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(64, 617, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Space.pyx":632
 * 
 *         """
 *         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":633
 *         """
 *         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":634
 *         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, 634, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":617
 *         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":636
 *         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:636");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_9destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_9destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_8destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":646
 * 
 *         """
 *         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, 646, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":647
 *         """
 *         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":636
 *         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":649
 *         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:649");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_11duplicate = {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_11duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_10duplicate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("duplicate", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("duplicate", 0);

  /* "petsc4py/PETSc/Space.pyx":659
 * 
 *         """
 *         cdef DualSpace spNew = DualSpace()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDualSpaceDuplicate(self.dualspace, &spNew.dualspace))
 * 
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(64, 659, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_spNew = ((struct PyPetscDualSpaceObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Space.pyx":660
 *         """
 *         cdef DualSpace spNew = DualSpace()
 *         CHKERR(PetscDualSpaceDuplicate(self.dualspace, &spNew.dualspace))             # <<<<<<<<<<<<<<
 * 
 *     def getDM(self) -> DM:
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceDuplicate(__pyx_v_self->dualspace, (&__pyx_v_spNew->dualspace))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 660, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":649
 *         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_XDECREF(__pyx_t_2);
  __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":662
 *         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:662");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_13getDM = {"getDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_13getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_12getDM};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDM", __pyx_kwds); 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) {
  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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getDM", 0);

  /* "petsc4py/PETSc/Space.pyx":672
 * 
 *         """
 *         cdef PetscDM newdm = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDualSpaceGetDM(self.dualspace, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()
*/
  __pyx_v_newdm = NULL;

  /* "petsc4py/PETSc/Space.pyx":673
 *         """
 *         cdef PetscDM newdm = NULL
 *         CHKERR(PetscDualSpaceGetDM(self.dualspace, &newdm))             # <<<<<<<<<<<<<<
 *         cdef DM dm = subtype_DM(newdm)()
 *         dm.dm = newdm
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceGetDM(__pyx_v_self->dualspace, (&__pyx_v_newdm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 673, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":674
 *         cdef PetscDM newdm = NULL
 *         CHKERR(PetscDualSpaceGetDM(self.dualspace, &newdm))
 *         cdef DM dm = subtype_DM(newdm)()             # <<<<<<<<<<<<<<
 *         dm.dm = newdm
 *         CHKERR(PetscINCREF(dm.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_newdm)); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(64, 674, __pyx_L1_error)
  __pyx_v_dm = ((struct PyPetscDMObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Space.pyx":675
 *         CHKERR(PetscDualSpaceGetDM(self.dualspace, &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/Space.pyx":676
 *         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(64, 676, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":677
 *         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/Space.pyx":662
 *         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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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":679
 *         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:679");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_15setDM = {"setDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_15setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_14setDM};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 679, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 679, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDM", 0) < (0)) __PYX_ERR(64, 679, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDM", 1, 1, 1, i); __PYX_ERR(64, 679, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 679, __pyx_L3_error)
    }
    __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, 679, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(64, 679, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/Space.pyx":694
 * 
 *         """
 *         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, 694, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":679
 *         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":696
 *         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:696");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_17getDimension = {"getDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_17getDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_16getDimension};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDimension", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":708
 * 
 *         """
 *         cdef PetscInt cdim = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDualSpaceGetDimension(self.dualspace, &cdim))
 *         return toInt(cdim)
*/
  __pyx_v_cdim = 0;

  /* "petsc4py/PETSc/Space.pyx":709
 *         """
 *         cdef PetscInt cdim = 0
 *         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, 709, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":710
 *         cdef PetscInt cdim = 0
 *         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, 710, __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
 *         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":712
 *         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        Not collective.\n\n        See Also\n        --------\n        setNumComponents, petsc.PetscDualSpaceGetNumComponents\n\n        \nSource code at petsc4py/PETSc/Space.pyx:712");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_19getNumComponents = {"getNumComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_19getNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_18getNumComponents};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNumComponents", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":722
 * 
 *         """
 *         cdef PetscInt cncomps = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDualSpaceGetNumComponents(self.dualspace, &cncomps))
 *         return toInt(cncomps)
*/
  __pyx_v_cncomps = 0;

  /* "petsc4py/PETSc/Space.pyx":723
 *         """
 *         cdef PetscInt cncomps = 0
 *         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, 723, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":724
 *         cdef PetscInt cncomps = 0
 *         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, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":712
 *         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":726
 *         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        Logically collective.\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:726");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_21setNumComponents = {"setNumComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_21setNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_20setNumComponents};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_nc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 726, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 726, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setNumComponents", 0) < (0)) __PYX_ERR(64, 726, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setNumComponents", 1, 1, 1, i); __PYX_ERR(64, 726, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 726, __pyx_L3_error)
    }
    __pyx_v_nc = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setNumComponents", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 726, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Space.pyx":741
 * 
 *         """
 *         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, 741, __pyx_L1_error)
  __pyx_v_cnc = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":742
 *         """
 *         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, 742, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":726
 *         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":744
 *         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:744");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_23getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_23getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_22getType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":754
 * 
 *         """
 *         cdef PetscDualSpaceType cval = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDualSpaceGetType(self.dualspace, &cval))
 *         return bytes2str(cval)
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Space.pyx":755
 *         """
 *         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, 755, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":756
 *         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, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":744
 *         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":758
 *         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:758");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_25setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_25setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_24setType};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dualspace_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 758, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 758, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(64, 758, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(64, 758, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 758, __pyx_L3_error)
    }
    __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, 758, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  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_dualspace_type);

  /* "petsc4py/PETSc/Space.pyx":773
 * 
 *         """
 *         cdef PetscDualSpaceType cval = NULL             # <<<<<<<<<<<<<<
 *         dualspace_type = str2bytes(dualspace_type, &cval)
 *         CHKERR(PetscDualSpaceSetType(self.dualspace, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Space.pyx":774
 *         """
 *         cdef PetscDualSpaceType cval = NULL
 *         dualspace_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, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_dualspace_type, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Space.pyx":775
 *         cdef PetscDualSpaceType cval = NULL
 *         dualspace_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, 775, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":776
 *         dualspace_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":758
 *         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_dualspace_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Space.pyx":778
 *         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:778");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_27getOrder = {"getOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_27getOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_26getOrder};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getOrder", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":788
 * 
 *         """
 *         cdef PetscInt corder = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDualSpaceGetOrder(self.dualspace, &corder))
 *         return toInt(corder)
*/
  __pyx_v_corder = 0;

  /* "petsc4py/PETSc/Space.pyx":789
 *         """
 *         cdef PetscInt corder = 0
 *         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, 789, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":790
 *         cdef PetscInt corder = 0
 *         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, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":778
 *         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":792
 *         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:792");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_29setOrder = {"setOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_29setOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_28setOrder};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_order,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 792, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 792, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setOrder", 0) < (0)) __PYX_ERR(64, 792, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setOrder", 1, 1, 1, i); __PYX_ERR(64, 792, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 792, __pyx_L3_error)
    }
    __pyx_v_order = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setOrder", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 792, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Space.pyx":807
 * 
 *         """
 *         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, 807, __pyx_L1_error)
  __pyx_v_corder = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":808
 *         """
 *         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, 808, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":792
 *         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":810
 *         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:810");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_31getNumDof = {"getNumDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_31getNumDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_30getNumDof};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getNumDof", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":820
 * 
 *         """
 *         cdef const PetscInt *cndof = NULL             # <<<<<<<<<<<<<<
 *         cdef PetscInt cdim = 0
 *         CHKERR(PetscDualSpaceGetDimension(self.dualspace, &cdim))
*/
  __pyx_v_cndof = NULL;

  /* "petsc4py/PETSc/Space.pyx":821
 *         """
 *         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":822
 *         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, 822, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":823
 *         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, 823, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":824
 *         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, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":810
 *         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":826
 *         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:826");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_33getFunctional = {"getFunctional", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_33getFunctional, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_32getFunctional};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_i,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 826, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 826, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getFunctional", 0) < (0)) __PYX_ERR(64, 826, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getFunctional", 1, 1, 1, i); __PYX_ERR(64, 826, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 826, __pyx_L3_error)
    }
    __pyx_v_i = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("getFunctional", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 826, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getFunctional", 0);

  /* "petsc4py/PETSc/Space.pyx":841
 * 
 *         """
 *         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, 841, __pyx_L1_error)
  __pyx_v_ci = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":842
 *         """
 *         cdef PetscInt ci = asInt(i)
 *         cdef Quad functional = Quad()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDualSpaceGetFunctional(self.dualspace, ci, &functional.quad))
 *         CHKERR(PetscINCREF(functional.obj))
*/
  __pyx_t_3 = NULL;
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(64, 842, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_2);
  }
  __pyx_v_functional = ((struct PyPetscQuadObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/Space.pyx":843
 *         cdef PetscInt ci = asInt(i)
 *         cdef Quad functional = Quad()
 *         CHKERR(PetscDualSpaceGetFunctional(self.dualspace, ci, &functional.quad))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(functional.obj))
 *         return functional
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDualSpaceGetFunctional(__pyx_v_self->dualspace, __pyx_v_ci, (&__pyx_v_functional->quad))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 843, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":844
 *         cdef Quad functional = Quad()
 *         CHKERR(PetscDualSpaceGetFunctional(self.dualspace, ci, &functional.quad))
 *         CHKERR(PetscINCREF(functional.obj))             # <<<<<<<<<<<<<<
 *         return functional
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_functional->__pyx_base.obj)); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(64, 844, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":845
 *         CHKERR(PetscDualSpaceGetFunctional(self.dualspace, ci, &functional.quad))
 *         CHKERR(PetscINCREF(functional.obj))
 *         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":826
 *         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_XDECREF(__pyx_t_3);
  __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":847
 *         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:847");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_35getInteriorDimension = {"getInteriorDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_35getInteriorDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_34getInteriorDimension};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getInteriorDimension", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":860
 * 
 *         """
 *         cdef PetscInt cintdim = 0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDualSpaceGetInteriorDimension(self.dualspace, &cintdim))
 *         return toInt(cintdim)
*/
  __pyx_v_cintdim = 0;

  /* "petsc4py/PETSc/Space.pyx":861
 *         """
 *         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, 861, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":862
 *         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, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":847
 *         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":864
 *         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:864");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_37getLagrangeContinuity = {"getLagrangeContinuity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_37getLagrangeContinuity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_36getLagrangeContinuity};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLagrangeContinuity", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":874
 * 
 *         """
 *         cdef PetscBool ccontinuous = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDualSpaceLagrangeGetContinuity(self.dualspace, &ccontinuous))
 *         return toBool(ccontinuous)
*/
  __pyx_v_ccontinuous = PETSC_FALSE;

  /* "petsc4py/PETSc/Space.pyx":875
 *         """
 *         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, 875, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":876
 *         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, 876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":864
 *         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":878
 *         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:878");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_39setLagrangeContinuity = {"setLagrangeContinuity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_39setLagrangeContinuity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_38setLagrangeContinuity};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_continuous,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 878, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLagrangeContinuity", 0) < (0)) __PYX_ERR(64, 878, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLagrangeContinuity", 1, 1, 1, i); __PYX_ERR(64, 878, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 878, __pyx_L3_error)
    }
    __pyx_v_continuous = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setLagrangeContinuity", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 878, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Space.pyx":893
 * 
 *         """
 *         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, 893, __pyx_L1_error)
  __pyx_v_ccontinuous = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":894
 *         """
 *         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, 894, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":878
 *         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":896
 *         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:896");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_41getLagrangeTensor = {"getLagrangeTensor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_41getLagrangeTensor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_40getLagrangeTensor};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLagrangeTensor", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":906
 * 
 *         """
 *         cdef PetscBool ctensor = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDualSpaceLagrangeGetTensor(self.dualspace, &ctensor))
 *         return toBool(ctensor)
*/
  __pyx_v_ctensor = PETSC_FALSE;

  /* "petsc4py/PETSc/Space.pyx":907
 *         """
 *         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, 907, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":908
 *         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, 908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":896
 *         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":910
 *         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:910");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_43setLagrangeTensor = {"setLagrangeTensor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_43setLagrangeTensor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_42setLagrangeTensor};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_tensor,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 910, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 910, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLagrangeTensor", 0) < (0)) __PYX_ERR(64, 910, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLagrangeTensor", 1, 1, 1, i); __PYX_ERR(64, 910, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 910, __pyx_L3_error)
    }
    __pyx_v_tensor = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setLagrangeTensor", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 910, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Space.pyx":925
 * 
 *         """
 *         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, 925, __pyx_L1_error)
  __pyx_v_ctensor = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":926
 *         """
 *         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, 926, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":910
 *         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":928
 *         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:928");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_45getLagrangeTrimmed = {"getLagrangeTrimmed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_45getLagrangeTrimmed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_44getLagrangeTrimmed};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLagrangeTrimmed", __pyx_kwds); 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", 0);

  /* "petsc4py/PETSc/Space.pyx":938
 * 
 *         """
 *         cdef PetscBool ctrimmed = PETSC_FALSE             # <<<<<<<<<<<<<<
 *         CHKERR(PetscDualSpaceLagrangeGetTrimmed(self.dualspace, &ctrimmed))
 *         return toBool(ctrimmed)
*/
  __pyx_v_ctrimmed = PETSC_FALSE;

  /* "petsc4py/PETSc/Space.pyx":939
 *         """
 *         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, 939, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":940
 *         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, 940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Space.pyx":928
 *         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":942
 *         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:942");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_47setLagrangeTrimmed = {"setLagrangeTrimmed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_47setLagrangeTrimmed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_46setLagrangeTrimmed};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_trimmed,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 942, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 942, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLagrangeTrimmed", 0) < (0)) __PYX_ERR(64, 942, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLagrangeTrimmed", 1, 1, 1, i); __PYX_ERR(64, 942, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 942, __pyx_L3_error)
    }
    __pyx_v_trimmed = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setLagrangeTrimmed", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 942, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "petsc4py/PETSc/Space.pyx":959
 * 
 *         """
 *         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, 959, __pyx_L1_error)
  __pyx_v_ctrimmed = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":960
 *         """
 *         cdef PetscBool ctrimmed = asBool(trimmed)
 *         CHKERR(PetscDualSpaceLagrangeSetTrimmed(self.dualspace, ctrimmed))             # <<<<<<<<<<<<<<
 * 
 *     def setSimpleDimension(self, dim: int) -> 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, 960, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":942
 *         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":962
 *         CHKERR(PetscDualSpaceLagrangeSetTrimmed(self.dualspace, ctrimmed))
 * 
 *     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_49setSimpleDimension(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_48setSimpleDimension, "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:962");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_49setSimpleDimension = {"setSimpleDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_49setSimpleDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_48setSimpleDimension};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_49setSimpleDimension(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dim,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 962, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 962, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSimpleDimension", 0) < (0)) __PYX_ERR(64, 962, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSimpleDimension", 1, 1, 1, i); __PYX_ERR(64, 962, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 962, __pyx_L3_error)
    }
    __pyx_v_dim = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setSimpleDimension", 1, 1, 1, __pyx_nargs); __PYX_ERR(64, 962, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_48setSimpleDimension(((struct PyPetscDualSpaceObject *)__pyx_v_self), __pyx_v_dim);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_48setSimpleDimension(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", 0);

  /* "petsc4py/PETSc/Space.pyx":977
 * 
 *         """
 *         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, 977, __pyx_L1_error)
  __pyx_v_cdim = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":978
 *         """
 *         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, 978, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":962
 *         CHKERR(PetscDualSpaceLagrangeSetTrimmed(self.dualspace, ctrimmed))
 * 
 *     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":980
 *         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_51setSimpleFunctional(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_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_50setSimpleFunctional, "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:980");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9DualSpace_51setSimpleFunctional = {"setSimpleFunctional", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_51setSimpleFunctional, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_50setSimpleFunctional};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9DualSpace_51setSimpleFunctional(PyObject *__pyx_v_self, 
#if CYTHON_METH_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_func,&__pyx_mstate_global->__pyx_n_u_functional,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(64, 980, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(64, 980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 980, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setSimpleFunctional", 0) < (0)) __PYX_ERR(64, 980, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setSimpleFunctional", 1, 2, 2, i); __PYX_ERR(64, 980, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(64, 980, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(64, 980, __pyx_L3_error)
    }
    __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, 980, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, 0, "functional", 0))) __PYX_ERR(64, 980, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9DualSpace_50setSimpleFunctional(((struct PyPetscDualSpaceObject *)__pyx_v_self), __pyx_v_func, __pyx_v_functional);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9DualSpace_50setSimpleFunctional(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", 0);

  /* "petsc4py/PETSc/Space.pyx":997
 * 
 *         """
 *         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, 997, __pyx_L1_error)
  __pyx_v_cfunc = __pyx_t_1;

  /* "petsc4py/PETSc/Space.pyx":998
 *         """
 *         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, 998, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":980
 *         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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); 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;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "petsc4py/PETSc/DMUtils.pyx":11
 * 
 *     def __dealloc__(self):
 *         self.destroy()             # <<<<<<<<<<<<<<
 * 
 *     def create(self, comm: Comm | None = None) -> Self:
*/
  __pyx_t_2 = ((PyObject *)__pyx_v_self);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_destroy, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(65, 11, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __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_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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_5create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_4create};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(65, 13, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(65, 13, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(65, 13, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(65, 13, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "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 const )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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_7destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_6destroy};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); 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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_9evaluate = {"evaluate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_9evaluate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_8evaluate};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,&__pyx_mstate_global->__pyx_n_u_x,&__pyx_mstate_global->__pyx_n_u_v,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(65, 48, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(65, 48, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(65, 48, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(65, 48, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "evaluate", 0) < (0)) __PYX_ERR(65, 48, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("evaluate", 0, 2, 3, i); __PYX_ERR(65, 48, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(65, 48, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(65, 48, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(65, 48, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct PyPetscVecObject *)Py_None));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, 0, "dm", 0))) __PYX_ERR(65, 48, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "x", 0))) __PYX_ERR(65, 48, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_mstate_global->__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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  PetscErrorCode __pyx_t_5;
  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_3 = NULL;
    __pyx_t_4 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(65, 68, __pyx_L1_error)
      __Pyx_GOTREF((PyObject *)__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_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMInterpolationGetVector(__pyx_v_self->dminterp, (&__pyx_v_v->vec))); if (unlikely(__pyx_t_5 == ((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_5 = __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_5 == ((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_XDECREF(__pyx_t_3);
  __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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_11getCoordinates = {"getCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_11getCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_10getCoordinates};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getCoordinates", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getCoordinates", 0);

  /* "petsc4py/PETSc/DMUtils.pyx":87
 * 
 *         """
 *         cdef Vec coords = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(DMInterpolationGetCoordinates(self.dminterp, &coords.vec))
 *         CHKERR(PetscINCREF(coords.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(65, 87, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMInterpolationGetCoordinates(__pyx_v_self->dminterp, (&__pyx_v_coords->vec))); if (unlikely(__pyx_t_4 == ((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_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_coords->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((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_XDECREF(__pyx_t_2);
  __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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_13getDim = {"getDim", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_13getDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_12getDim};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDim", __pyx_kwds); 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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_15getDof = {"getDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_15getDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_14getDof};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getDof", __pyx_kwds); 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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_17setDim = {"setDim", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_17setDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_16setDim};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dim,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(65, 120, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(65, 120, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDim", 0) < (0)) __PYX_ERR(65, 120, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDim", 1, 1, 1, i); __PYX_ERR(65, 120, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(65, 120, __pyx_L3_error)
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_19setDof = {"setDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_19setDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_18setDof};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dof,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(65, 138, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(65, 138, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setDof", 0) < (0)) __PYX_ERR(65, 138, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setDof", 1, 1, 1, i); __PYX_ERR(65, 138, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(65, 138, __pyx_L3_error)
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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", 0);

  /* "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 PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_21setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_21setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_20setUp};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_dm,&__pyx_mstate_global->__pyx_n_u_redundantPoints,&__pyx_mstate_global->__pyx_n_u_ignoreOutsideDomain,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(65, 156, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(65, 156, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(65, 156, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(65, 156, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setUp", 0) < (0)) __PYX_ERR(65, 156, __pyx_L3_error)

      /* "petsc4py/PETSc/DMUtils.pyx":159
 *         self,
 *         DM dm,
 *         redundantPoints: bool = False,             # <<<<<<<<<<<<<<
 *         ignoreOutsideDomain: bool = False) -> None:
 *         """Compute spatial indices for point location during interpolation.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setUp", 0, 1, 3, i); __PYX_ERR(65, 156, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(65, 156, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(65, 156, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(65, 156, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "petsc4py/PETSc/DMUtils.pyx":159
 *         self,
 *         DM dm,
 *         redundantPoints: bool = False,             # <<<<<<<<<<<<<<
 *         ignoreOutsideDomain: bool = False) -> None:
 *         """Compute spatial indices for point location during interpolation.
*/
      if (!values[1]) values[1] = __Pyx_NewRef(((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.
 * 
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_False));
    }
    __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:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/DMUtils.pyx":181
 * 
 *         """
 *         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, 181, __pyx_L1_error)
  __pyx_v_credundantPoints = __pyx_t_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_ignoreOutsideDomain); if (unlikely(__pyx_t_1 == ((PetscBool)((PetscBool)0)) && PyErr_Occurred())) __PYX_ERR(65, 182, __pyx_L1_error)
  __pyx_v_cignoreOutsideDomain = __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))             # <<<<<<<<<<<<<<
 * 
 *     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, 183, __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":185
 *         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:185");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_23getVector = {"getVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_23getVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_22getVector};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getVector", __pyx_kwds); 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getVector", 0);

  /* "petsc4py/PETSc/DMUtils.pyx":197
 * 
 *         """
 *         cdef Vec vec = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(DMInterpolationGetVector(self.dminterp, &vec.vec))
 *         return vec
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(65, 197, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_vec = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/DMUtils.pyx":198
 *         """
 *         cdef Vec vec = Vec()
 *         CHKERR(DMInterpolationGetVector(self.dminterp, &vec.vec))             # <<<<<<<<<<<<<<
 *         return vec
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMInterpolationGetVector(__pyx_v_self->dminterp, (&__pyx_v_vec->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(65, 198, __pyx_L1_error)

  /* "petsc4py/PETSc/DMUtils.pyx":199
 *         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":185
 *         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_XDECREF(__pyx_t_2);
  __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":201
 *         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:201");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_25restoreVector = {"restoreVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_25restoreVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_24restoreVector};
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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_vec,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(65, 201, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(65, 201, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "restoreVector", 0) < (0)) __PYX_ERR(65, 201, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("restoreVector", 1, 1, 1, i); __PYX_ERR(65, 201, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(65, 201, __pyx_L3_error)
    }
    __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, 201, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "vec", 0))) __PYX_ERR(65, 201, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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", 0);

  /* "petsc4py/PETSc/DMUtils.pyx":216
 * 
 *         """
 *         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, 216, __pyx_L1_error)

  /* "petsc4py/PETSc/DMUtils.pyx":201
 *         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/Regressor.pyx":38
 *     LinearType = RegressorLinearType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.regressor
 *         self.regressor = NULL
*/

/* Python wrapper */
static int __pyx_pw_8petsc4py_5PETSc_9Regressor_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8petsc4py_5PETSc_9Regressor_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_SIZE
  __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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__cinit__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor___cinit__(((struct PyPetscRegressorObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8petsc4py_5PETSc_9Regressor___cinit__(struct PyPetscRegressorObject *__pyx_v_self) {
  int __pyx_r;

  /* "petsc4py/PETSc/Regressor.pyx":39
 * 
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.regressor             # <<<<<<<<<<<<<<
 *         self.regressor = NULL
 * 
*/
  __pyx_v_self->__pyx_base.obj = ((PetscObject *)(&__pyx_v_self->regressor));

  /* "petsc4py/PETSc/Regressor.pyx":40
 *     def __cinit__(self):
 *         self.obj = <PetscObject*> &self.regressor
 *         self.regressor = NULL             # <<<<<<<<<<<<<<
 * 
 *     def view(self, Viewer viewer=None) -> None:
*/
  __pyx_v_self->regressor = NULL;

  /* "petsc4py/PETSc/Regressor.pyx":38
 *     LinearType = RegressorLinearType
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.obj = <PetscObject*> &self.regressor
 *         self.regressor = NULL
*/

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":42
 *         self.regressor = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_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_9Regressor_2view, "Regressor.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.PetscRegressorView\n\n        \nSource code at petsc4py/PETSc/Regressor.pyx:42");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_3view = {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_2view};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_viewer,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(66, 42, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 42, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "view", 0) < (0)) __PYX_ERR(66, 42, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 42, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct PyPetscViewerObject *)Py_None));
    }
    __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(66, 42, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, 1, "viewer", 0))) __PYX_ERR(66, 42, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_2view(((struct PyPetscRegressorObject *)__pyx_v_self), __pyx_v_viewer);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_2view(struct PyPetscRegressorObject *__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", 0);

  /* "petsc4py/PETSc/Regressor.pyx":57
 * 
 *         """
 *         cdef PetscViewer cviewer = NULL             # <<<<<<<<<<<<<<
 *         if viewer is not None: cviewer = viewer.vwr
 *         CHKERR(PetscRegressorView(self.regressor, cviewer))
*/
  __pyx_v_cviewer = NULL;

  /* "petsc4py/PETSc/Regressor.pyx":58
 *         """
 *         cdef PetscViewer cviewer = NULL
 *         if viewer is not None: cviewer = viewer.vwr             # <<<<<<<<<<<<<<
 *         CHKERR(PetscRegressorView(self.regressor, 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/Regressor.pyx":59
 *         cdef PetscViewer cviewer = NULL
 *         if viewer is not None: cviewer = viewer.vwr
 *         CHKERR(PetscRegressorView(self.regressor, cviewer))             # <<<<<<<<<<<<<<
 * 
 *     def create(self, comm=None) -> Self:
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorView(__pyx_v_self->regressor, __pyx_v_cviewer)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 59, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":42
 *         self.regressor = 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.Regressor.view", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":61
 *         CHKERR(PetscRegressorView(self.regressor, cviewer))
 * 
 *     def create(self, comm=None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a REGRESSOR solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_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_9Regressor_4create, "Regressor.create(self, comm=None) -> Self\nCreate a REGRESSOR 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.PetscRegressorCreate\n\n        \nSource code at petsc4py/PETSc/Regressor.pyx:61");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_5create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_4create};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(66, 61, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 61, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < (0)) __PYX_ERR(66, 61, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 61, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_comm = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 0, 1, __pyx_nargs); __PYX_ERR(66, 61, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_4create(((struct PyPetscRegressorObject *)__pyx_v_self), __pyx_v_comm);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_4create(struct PyPetscRegressorObject *__pyx_v_self, PyObject *__pyx_v_comm) {
  MPI_Comm __pyx_v_ccomm;
  PetscRegressor __pyx_v_newregressor;
  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", 0);

  /* "petsc4py/PETSc/Regressor.pyx":76
 * 
 *         """
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)             # <<<<<<<<<<<<<<
 *         cdef PetscRegressor newregressor = NULL
 *         CHKERR(PetscRegressorCreate(ccomm, &newregressor))
*/
  __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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(66, 76, __pyx_L1_error)
  __pyx_v_ccomm = __pyx_t_1;

  /* "petsc4py/PETSc/Regressor.pyx":77
 *         """
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
 *         cdef PetscRegressor newregressor = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscRegressorCreate(ccomm, &newregressor))
 *         PetscCLEAR(self.obj); self.regressor = newregressor
*/
  __pyx_v_newregressor = NULL;

  /* "petsc4py/PETSc/Regressor.pyx":78
 *         cdef MPI_Comm ccomm = def_Comm(comm, PETSC_COMM_DEFAULT)
 *         cdef PetscRegressor newregressor = NULL
 *         CHKERR(PetscRegressorCreate(ccomm, &newregressor))             # <<<<<<<<<<<<<<
 *         PetscCLEAR(self.obj); self.regressor = newregressor
 *         return self
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorCreate(__pyx_v_ccomm, (&__pyx_v_newregressor))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 78, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":79
 *         cdef PetscRegressor newregressor = NULL
 *         CHKERR(PetscRegressorCreate(ccomm, &newregressor))
 *         PetscCLEAR(self.obj); self.regressor = newregressor             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  (void)(__pyx_f_8petsc4py_5PETSc_PetscCLEAR(__pyx_v_self->__pyx_base.obj));
  __pyx_v_self->regressor = __pyx_v_newregressor;

  /* "petsc4py/PETSc/Regressor.pyx":80
 *         CHKERR(PetscRegressorCreate(ccomm, &newregressor))
 *         PetscCLEAR(self.obj); self.regressor = newregressor
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def setRegularizerWeight(self, weight: float) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Regressor.pyx":61
 *         CHKERR(PetscRegressorView(self.regressor, cviewer))
 * 
 *     def create(self, comm=None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a REGRESSOR solver.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":82
 *         return self
 * 
 *     def setRegularizerWeight(self, weight: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the weight to be used for the regularizer.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_7setRegularizerWeight(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9Regressor_6setRegularizerWeight, "Regressor.setRegularizerWeight(self, weight: float) -> None\nSet the weight to be used for the regularizer.\n\n        Logically collective.\n\n        See Also\n        --------\n        setType, petsc.PetscRegressorSetRegularizerWeight\n        \nSource code at petsc4py/PETSc/Regressor.pyx:82");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_7setRegularizerWeight = {"setRegularizerWeight", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_7setRegularizerWeight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_6setRegularizerWeight};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_7setRegularizerWeight(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("setRegularizerWeight (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_weight,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(66, 82, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 82, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setRegularizerWeight", 0) < (0)) __PYX_ERR(66, 82, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setRegularizerWeight", 1, 1, 1, i); __PYX_ERR(66, 82, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 82, __pyx_L3_error)
    }
    __pyx_v_weight = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setRegularizerWeight", 1, 1, 1, __pyx_nargs); __PYX_ERR(66, 82, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.setRegularizerWeight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_6setRegularizerWeight(((struct PyPetscRegressorObject *)__pyx_v_self), __pyx_v_weight);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_6setRegularizerWeight(struct PyPetscRegressorObject *__pyx_v_self, PyObject *__pyx_v_weight) {
  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("setRegularizerWeight", 0);

  /* "petsc4py/PETSc/Regressor.pyx":91
 *         setType, petsc.PetscRegressorSetRegularizerWeight
 *         """
 *         CHKERR(PetscRegressorSetRegularizerWeight(self.regressor, weight))             # <<<<<<<<<<<<<<
 * 
 *     def setFromOptions(self) -> None:
*/
  __pyx_t_1 = __Pyx_PyFloat_AsDouble(__pyx_v_weight); if (unlikely((__pyx_t_1 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(66, 91, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorSetRegularizerWeight(__pyx_v_self->regressor, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 91, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":82
 *         return self
 * 
 *     def setRegularizerWeight(self, weight: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the weight to be used for the regularizer.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.setRegularizerWeight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":93
 *         CHKERR(PetscRegressorSetRegularizerWeight(self.regressor, weight))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the solver from the options database.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_9setFromOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9Regressor_8setFromOptions, "Regressor.setFromOptions(self) -> None\nConfigure the solver from the options database.\n\n        Collective.\n\n        See Also\n        --------\n        petsc_options, petsc.PetscRegressorSetFromOptions\n        \nSource code at petsc4py/PETSc/Regressor.pyx:93");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_9setFromOptions = {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_9setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_8setFromOptions};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_9setFromOptions(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setFromOptions", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_8setFromOptions(((struct PyPetscRegressorObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_8setFromOptions(struct PyPetscRegressorObject *__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", 0);

  /* "petsc4py/PETSc/Regressor.pyx":102
 *         petsc_options, petsc.PetscRegressorSetFromOptions
 *         """
 *         CHKERR(PetscRegressorSetFromOptions(self.regressor))             # <<<<<<<<<<<<<<
 * 
 *     def setUp(self) -> None:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorSetFromOptions(__pyx_v_self->regressor)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 102, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":93
 *         CHKERR(PetscRegressorSetRegularizerWeight(self.regressor, weight))
 * 
 *     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.Regressor.setFromOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":104
 *         CHKERR(PetscRegressorSetFromOptions(self.regressor))
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_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_9Regressor_10setUp, "Regressor.setUp(self) -> None\nSet up the internal data structures for using the solver.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.PetscRegressorSetUp\n\n        \nSource code at petsc4py/PETSc/Regressor.pyx:104");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_11setUp = {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_11setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_10setUp};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("setUp", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_10setUp(((struct PyPetscRegressorObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_10setUp(struct PyPetscRegressorObject *__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", 0);

  /* "petsc4py/PETSc/Regressor.pyx":114
 * 
 *         """
 *         CHKERR(PetscRegressorSetUp(self.regressor))             # <<<<<<<<<<<<<<
 * 
 *     def fit(self, Mat X, Vec y) -> None:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorSetUp(__pyx_v_self->regressor)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 114, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":104
 *         CHKERR(PetscRegressorSetFromOptions(self.regressor))
 * 
 *     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.Regressor.setUp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":116
 *         CHKERR(PetscRegressorSetUp(self.regressor))
 * 
 *     def fit(self, Mat X, Vec y) -> None:             # <<<<<<<<<<<<<<
 *         """Fit the regression problem.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_13fit(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9Regressor_12fit, "Regressor.fit(self, X: Mat, y: Vec) -> None\nFit the regression problem.\n\n        Collective.\n\n        Parameters\n        ----------\n        X\n            The matrix of training data\n        y\n            The vector of target values from the training dataset\n\n        See Also\n        --------\n        petsc.PetscRegressorPredict\n\n        \nSource code at petsc4py/PETSc/Regressor.pyx:116");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_13fit = {"fit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_13fit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_12fit};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_13fit(PyObject *__pyx_v_self, 
#if 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 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("fit (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_X,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(66, 116, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(66, 116, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 116, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "fit", 0) < (0)) __PYX_ERR(66, 116, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("fit", 1, 2, 2, i); __PYX_ERR(66, 116, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 116, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(66, 116, __pyx_L3_error)
    }
    __pyx_v_X = ((struct PyPetscMatObject *)values[0]);
    __pyx_v_y = ((struct PyPetscVecObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fit", 1, 2, 2, __pyx_nargs); __PYX_ERR(66, 116, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.fit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(66, 116, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(66, 116, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_12fit(((struct PyPetscRegressorObject *)__pyx_v_self), __pyx_v_X, __pyx_v_y);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_12fit(struct PyPetscRegressorObject *__pyx_v_self, struct PyPetscMatObject *__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("fit", 0);

  /* "petsc4py/PETSc/Regressor.pyx":133
 * 
 *         """
 *         CHKERR(PetscRegressorFit(self.regressor, X.mat, y.vec))             # <<<<<<<<<<<<<<
 * 
 *     def predict(self, Mat X, Vec y) -> None:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorFit(__pyx_v_self->regressor, __pyx_v_X->mat, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 133, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":116
 *         CHKERR(PetscRegressorSetUp(self.regressor))
 * 
 *     def fit(self, Mat X, Vec y) -> None:             # <<<<<<<<<<<<<<
 *         """Fit the regression problem.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.fit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":135
 *         CHKERR(PetscRegressorFit(self.regressor, X.mat, y.vec))
 * 
 *     def predict(self, Mat X, Vec y) -> None:             # <<<<<<<<<<<<<<
 *         """Predict the regression problem.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_15predict(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9Regressor_14predict, "Regressor.predict(self, X: Mat, y: Vec) -> None\nPredict the regression problem.\n\n        Collective.\n\n        Parameters\n        ----------\n        X\n            The matrix of unlabeled observations\n        y\n            The vector of predicted labels\n\n        See Also\n        --------\n        petsc.PetscRegressorFit\n\n        \nSource code at petsc4py/PETSc/Regressor.pyx:135");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_15predict = {"predict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_15predict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_14predict};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_15predict(PyObject *__pyx_v_self, 
#if 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 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("predict (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_X,&__pyx_mstate_global->__pyx_n_u_y,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(66, 135, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(66, 135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 135, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "predict", 0) < (0)) __PYX_ERR(66, 135, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("predict", 1, 2, 2, i); __PYX_ERR(66, 135, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 135, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(66, 135, __pyx_L3_error)
    }
    __pyx_v_X = ((struct PyPetscMatObject *)values[0]);
    __pyx_v_y = ((struct PyPetscVecObject *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("predict", 1, 2, 2, __pyx_nargs); __PYX_ERR(66, 135, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.predict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_X), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, 0, "X", 0))) __PYX_ERR(66, 135, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, 0, "y", 0))) __PYX_ERR(66, 135, __pyx_L1_error)
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_14predict(((struct PyPetscRegressorObject *)__pyx_v_self), __pyx_v_X, __pyx_v_y);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_14predict(struct PyPetscRegressorObject *__pyx_v_self, struct PyPetscMatObject *__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("predict", 0);

  /* "petsc4py/PETSc/Regressor.pyx":152
 * 
 *         """
 *         CHKERR(PetscRegressorPredict(self.regressor, X.mat, y.vec))             # <<<<<<<<<<<<<<
 * 
 *     def getTAO(self) -> TAO:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorPredict(__pyx_v_self->regressor, __pyx_v_X->mat, __pyx_v_y->vec)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 152, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":135
 *         CHKERR(PetscRegressorFit(self.regressor, X.mat, y.vec))
 * 
 *     def predict(self, Mat X, Vec y) -> None:             # <<<<<<<<<<<<<<
 *         """Predict the regression problem.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.predict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":154
 *         CHKERR(PetscRegressorPredict(self.regressor, X.mat, y.vec))
 * 
 *     def getTAO(self) -> TAO:             # <<<<<<<<<<<<<<
 *         """Return the underlying `TAO` object .
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_17getTAO(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9Regressor_16getTAO, "Regressor.getTAO(self) -> TAO\nReturn the underlying `TAO` object .\n\n        Not collective.\n\n        See Also\n        --------\n        getLinearKSP, petsc.PetscRegressorGetTao\n        \nSource code at petsc4py/PETSc/Regressor.pyx:154");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_17getTAO = {"getTAO", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_17getTAO, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_16getTAO};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_17getTAO(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getTAO (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getTAO", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getTAO", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_16getTAO(((struct PyPetscRegressorObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_16getTAO(struct PyPetscRegressorObject *__pyx_v_self) {
  struct PyPetscTAOObject *__pyx_v_tao = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getTAO", 0);

  /* "petsc4py/PETSc/Regressor.pyx":163
 *         getLinearKSP, petsc.PetscRegressorGetTao
 *         """
 *         cdef TAO tao = TAO()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscRegressorGetTao(self.regressor, &tao.tao))
 *         CHKERR(PetscINCREF(tao.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 163, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_tao = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":164
 *         """
 *         cdef TAO tao = TAO()
 *         CHKERR(PetscRegressorGetTao(self.regressor, &tao.tao))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(tao.obj))
 *         return tao
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorGetTao(__pyx_v_self->regressor, (&__pyx_v_tao->tao))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 164, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":165
 *         cdef TAO tao = TAO()
 *         CHKERR(PetscRegressorGetTao(self.regressor, &tao.tao))
 *         CHKERR(PetscINCREF(tao.obj))             # <<<<<<<<<<<<<<
 *         return tao
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_tao->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 165, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":166
 *         CHKERR(PetscRegressorGetTao(self.regressor, &tao.tao))
 *         CHKERR(PetscINCREF(tao.obj))
 *         return tao             # <<<<<<<<<<<<<<
 * 
 *     def reset(self) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_tao);
  __pyx_r = ((PyObject *)__pyx_v_tao);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Regressor.pyx":154
 *         CHKERR(PetscRegressorPredict(self.regressor, X.mat, y.vec))
 * 
 *     def getTAO(self) -> TAO:             # <<<<<<<<<<<<<<
 *         """Return the underlying `TAO` object .
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.getTAO", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_tao);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":168
 *         return tao
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         """Destroy internal data structures of the solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_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_9Regressor_18reset, "Regressor.reset(self) -> None\nDestroy internal data structures of the solver.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.PetscRegressorDestroy\n\n        \nSource code at petsc4py/PETSc/Regressor.pyx:168");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_19reset = {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_19reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_18reset};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("reset", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_18reset(((struct PyPetscRegressorObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_18reset(struct PyPetscRegressorObject *__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", 0);

  /* "petsc4py/PETSc/Regressor.pyx":178
 * 
 *         """
 *         CHKERR(PetscRegressorReset(self.regressor))             # <<<<<<<<<<<<<<
 * 
 *     def destroy(self) -> Self:
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorReset(__pyx_v_self->regressor)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 178, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":168
 *         return tao
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         """Destroy internal data structures of the solver.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":180
 *         CHKERR(PetscRegressorReset(self.regressor))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_21destroy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9Regressor_20destroy, "Regressor.destroy(self) -> Self\nDestroy the solver.\n\n        Collective.\n\n        See Also\n        --------\n        petsc.PetscRegressorDestroy\n\n        \nSource code at petsc4py/PETSc/Regressor.pyx:180");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_21destroy = {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_21destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_20destroy};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_21destroy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("destroy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_20destroy(((struct PyPetscRegressorObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_20destroy(struct PyPetscRegressorObject *__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", 0);

  /* "petsc4py/PETSc/Regressor.pyx":190
 * 
 *         """
 *         CHKERR(PetscRegressorDestroy(&self.regressor))             # <<<<<<<<<<<<<<
 *         return self
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorDestroy((&__pyx_v_self->regressor))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 190, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":191
 *         """
 *         CHKERR(PetscRegressorDestroy(&self.regressor))
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def setType(self, regressor_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/Regressor.pyx":180
 *         CHKERR(PetscRegressorReset(self.regressor))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the solver.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":193
 *         return self
 * 
 *     def setType(self, regressor_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_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_9Regressor_22setType, "Regressor.setType(self, regressor_type: Type | str) -> None\nSet the type of the solver.\n\n        Logically collective.\n\n        Parameters\n        ----------\n        regressor_type\n            The type of the solver.\n\n        See Also\n        --------\n        getType, petsc.PetscRegressorSetType\n\n        \nSource code at petsc4py/PETSc/Regressor.pyx:193");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_23setType = {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_23setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_22setType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_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_regressor_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_regressor_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(66, 193, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 193, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setType", 0) < (0)) __PYX_ERR(66, 193, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, i); __PYX_ERR(66, 193, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 193, __pyx_L3_error)
    }
    __pyx_v_regressor_type = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setType", 1, 1, 1, __pyx_nargs); __PYX_ERR(66, 193, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.setType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_22setType(((struct PyPetscRegressorObject *)__pyx_v_self), __pyx_v_regressor_type);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_22setType(struct PyPetscRegressorObject *__pyx_v_self, PyObject *__pyx_v_regressor_type) {
  PetscRegressorType __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_regressor_type);

  /* "petsc4py/PETSc/Regressor.pyx":208
 * 
 *         """
 *         cdef PetscRegressorType cval = NULL             # <<<<<<<<<<<<<<
 *         regressor_type = str2bytes(regressor_type, &cval)
 *         CHKERR(PetscRegressorSetType(self.regressor, cval))
*/
  __pyx_v_cval = NULL;

  /* "petsc4py/PETSc/Regressor.pyx":209
 *         """
 *         cdef PetscRegressorType cval = NULL
 *         regressor_type = str2bytes(regressor_type, &cval)             # <<<<<<<<<<<<<<
 *         CHKERR(PetscRegressorSetType(self.regressor, cval))
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_str2bytes(__pyx_v_regressor_type, (&__pyx_v_cval)); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_regressor_type, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":210
 *         cdef PetscRegressorType cval = NULL
 *         regressor_type = str2bytes(regressor_type, &cval)
 *         CHKERR(PetscRegressorSetType(self.regressor, cval))             # <<<<<<<<<<<<<<
 * 
 *     def getType(self) -> str:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorSetType(__pyx_v_self->regressor, __pyx_v_cval)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 210, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":193
 *         return self
 * 
 *     def setType(self, regressor_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.Regressor.setType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_regressor_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":212
 *         CHKERR(PetscRegressorSetType(self.regressor, cval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the solver.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_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_9Regressor_24getType, "Regressor.getType(self) -> str\nReturn the type of the solver.\n\n        Not collective.\n\n        See Also\n        --------\n        setType, petsc.PetscRegressorGetType\n\n        \nSource code at petsc4py/PETSc/Regressor.pyx:212");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_25getType = {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_25getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_24getType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (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; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_24getType(((struct PyPetscRegressorObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_24getType(struct PyPetscRegressorObject *__pyx_v_self) {
  PetscRegressorType __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", 0);

  /* "petsc4py/PETSc/Regressor.pyx":222
 * 
 *         """
 *         cdef PetscRegressorType ctype = NULL             # <<<<<<<<<<<<<<
 *         CHKERR(PetscRegressorGetType(self.regressor, &ctype))
 *         return bytes2str(ctype)
*/
  __pyx_v_ctype = NULL;

  /* "petsc4py/PETSc/Regressor.pyx":223
 *         """
 *         cdef PetscRegressorType ctype = NULL
 *         CHKERR(PetscRegressorGetType(self.regressor, &ctype))             # <<<<<<<<<<<<<<
 *         return bytes2str(ctype)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorGetType(__pyx_v_self->regressor, (&__pyx_v_ctype))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 223, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":224
 *         cdef PetscRegressorType ctype = NULL
 *         CHKERR(PetscRegressorGetType(self.regressor, &ctype))
 *         return bytes2str(ctype)             # <<<<<<<<<<<<<<
 * 
 *     # --- Linear ---
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_ctype); if (unlikely(!__pyx_t_2)) __PYX_ERR(66, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Regressor.pyx":212
 *         CHKERR(PetscRegressorSetType(self.regressor, 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.Regressor.getType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":228
 *     # --- Linear ---
 * 
 *     def setLinearFitIntercept(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set a flag to indicate that the intercept should be calculated.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_27setLinearFitIntercept(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9Regressor_26setLinearFitIntercept, "Regressor.setLinearFitIntercept(self, flag: bool) -> None\nSet a flag to indicate that the intercept should be calculated.\n\n        Logically collective.\n\n        See Also\n        --------\n        petsc.PetscRegressorLinearSetFitIntercept\n        \nSource code at petsc4py/PETSc/Regressor.pyx:228");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_27setLinearFitIntercept = {"setLinearFitIntercept", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_27setLinearFitIntercept, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_26setLinearFitIntercept};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_27setLinearFitIntercept(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("setLinearFitIntercept (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(66, 228, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 228, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLinearFitIntercept", 0) < (0)) __PYX_ERR(66, 228, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLinearFitIntercept", 1, 1, 1, i); __PYX_ERR(66, 228, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 228, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setLinearFitIntercept", 1, 1, 1, __pyx_nargs); __PYX_ERR(66, 228, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.setLinearFitIntercept", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_26setLinearFitIntercept(((struct PyPetscRegressorObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_26setLinearFitIntercept(struct PyPetscRegressorObject *__pyx_v_self, PyObject *__pyx_v_flag) {
  PetscBool __pyx_v_fitintercept;
  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("setLinearFitIntercept", 0);

  /* "petsc4py/PETSc/Regressor.pyx":237
 *         petsc.PetscRegressorLinearSetFitIntercept
 *         """
 *         cdef PetscBool fitintercept = flag             # <<<<<<<<<<<<<<
 *         CHKERR(PetscRegressorLinearSetFitIntercept(self.regressor, fitintercept))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(66, 237, __pyx_L1_error)
  __pyx_v_fitintercept = __pyx_t_1;

  /* "petsc4py/PETSc/Regressor.pyx":238
 *         """
 *         cdef PetscBool fitintercept = flag
 *         CHKERR(PetscRegressorLinearSetFitIntercept(self.regressor, fitintercept))             # <<<<<<<<<<<<<<
 * 
 *     def setLinearUseKSP(self, flag: bool) -> None:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorLinearSetFitIntercept(__pyx_v_self->regressor, __pyx_v_fitintercept)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 238, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":228
 *     # --- Linear ---
 * 
 *     def setLinearFitIntercept(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set a flag to indicate that the intercept should be calculated.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.setLinearFitIntercept", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":240
 *         CHKERR(PetscRegressorLinearSetFitIntercept(self.regressor, fitintercept))
 * 
 *     def setLinearUseKSP(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set a flag to indicate that `KSP` instead of `TAO` solvers should be used.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_29setLinearUseKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9Regressor_28setLinearUseKSP, "Regressor.setLinearUseKSP(self, flag: bool) -> None\nSet a flag to indicate that `KSP` instead of `TAO` solvers should be used.\n\n        Logically collective.\n\n        See Also\n        --------\n        petsc.PetscRegressorLinearSetUseKSP\n        \nSource code at petsc4py/PETSc/Regressor.pyx:240");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_29setLinearUseKSP = {"setLinearUseKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_29setLinearUseKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_28setLinearUseKSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_29setLinearUseKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_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("setLinearUseKSP (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flag,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(66, 240, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 240, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLinearUseKSP", 0) < (0)) __PYX_ERR(66, 240, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLinearUseKSP", 1, 1, 1, i); __PYX_ERR(66, 240, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 240, __pyx_L3_error)
    }
    __pyx_v_flag = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setLinearUseKSP", 1, 1, 1, __pyx_nargs); __PYX_ERR(66, 240, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.setLinearUseKSP", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_28setLinearUseKSP(((struct PyPetscRegressorObject *)__pyx_v_self), __pyx_v_flag);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_28setLinearUseKSP(struct PyPetscRegressorObject *__pyx_v_self, PyObject *__pyx_v_flag) {
  PetscBool __pyx_v_useksp;
  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("setLinearUseKSP", 0);

  /* "petsc4py/PETSc/Regressor.pyx":249
 *         petsc.PetscRegressorLinearSetUseKSP
 *         """
 *         cdef PetscBool useksp = flag             # <<<<<<<<<<<<<<
 *         CHKERR(PetscRegressorLinearSetUseKSP(self.regressor, useksp))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely((__pyx_t_1 == ((PetscBool)-1)) && PyErr_Occurred())) __PYX_ERR(66, 249, __pyx_L1_error)
  __pyx_v_useksp = __pyx_t_1;

  /* "petsc4py/PETSc/Regressor.pyx":250
 *         """
 *         cdef PetscBool useksp = flag
 *         CHKERR(PetscRegressorLinearSetUseKSP(self.regressor, useksp))             # <<<<<<<<<<<<<<
 * 
 *     def getLinearKSP(self) -> KSP:
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorLinearSetUseKSP(__pyx_v_self->regressor, __pyx_v_useksp)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 250, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":240
 *         CHKERR(PetscRegressorLinearSetFitIntercept(self.regressor, fitintercept))
 * 
 *     def setLinearUseKSP(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set a flag to indicate that `KSP` instead of `TAO` solvers should be used.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.setLinearUseKSP", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":252
 *         CHKERR(PetscRegressorLinearSetUseKSP(self.regressor, useksp))
 * 
 *     def getLinearKSP(self) -> KSP:             # <<<<<<<<<<<<<<
 *         """Returns the `KSP` context used by the linear regressor.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_31getLinearKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9Regressor_30getLinearKSP, "Regressor.getLinearKSP(self) -> KSP\nReturns the `KSP` context used by the linear regressor.\n\n        Not collective.\n\n        See Also\n        --------\n        petsc.PetscRegressorLinearGetKSP\n        \nSource code at petsc4py/PETSc/Regressor.pyx:252");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_31getLinearKSP = {"getLinearKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_31getLinearKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_30getLinearKSP};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_31getLinearKSP(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getLinearKSP (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLinearKSP", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLinearKSP", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_30getLinearKSP(((struct PyPetscRegressorObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_30getLinearKSP(struct PyPetscRegressorObject *__pyx_v_self) {
  struct PyPetscKSPObject *__pyx_v_ksp = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLinearKSP", 0);

  /* "petsc4py/PETSc/Regressor.pyx":261
 *         petsc.PetscRegressorLinearGetKSP
 *         """
 *         cdef KSP ksp = KSP()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscRegressorLinearGetKSP(self.regressor, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 261, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_ksp = ((struct PyPetscKSPObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":262
 *         """
 *         cdef KSP ksp = KSP()
 *         CHKERR(PetscRegressorLinearGetKSP(self.regressor, &ksp.ksp))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(ksp.obj))
 *         return ksp
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorLinearGetKSP(__pyx_v_self->regressor, (&__pyx_v_ksp->ksp))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 262, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":263
 *         cdef KSP ksp = KSP()
 *         CHKERR(PetscRegressorLinearGetKSP(self.regressor, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))             # <<<<<<<<<<<<<<
 *         return ksp
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_ksp->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 263, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":264
 *         CHKERR(PetscRegressorLinearGetKSP(self.regressor, &ksp.ksp))
 *         CHKERR(PetscINCREF(ksp.obj))
 *         return ksp             # <<<<<<<<<<<<<<
 * 
 *     def getLinearCoefficients(self) -> Vec:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_ksp);
  __pyx_r = ((PyObject *)__pyx_v_ksp);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Regressor.pyx":252
 *         CHKERR(PetscRegressorLinearSetUseKSP(self.regressor, useksp))
 * 
 *     def getLinearKSP(self) -> KSP:             # <<<<<<<<<<<<<<
 *         """Returns the `KSP` context used by the linear regressor.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.getLinearKSP", __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/Regressor.pyx":266
 *         return ksp
 * 
 *     def getLinearCoefficients(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Get a vector of the fitted coefficients from a linear regression model.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_33getLinearCoefficients(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9Regressor_32getLinearCoefficients, "Regressor.getLinearCoefficients(self) -> Vec\nGet a vector of the fitted coefficients from a linear regression model.\n\n        Not collective.\n\n        See Also\n        --------\n        getLinearIntercept, petsc.PetscRegressorLinearGetCoefficients\n        \nSource code at petsc4py/PETSc/Regressor.pyx:266");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_33getLinearCoefficients = {"getLinearCoefficients", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_33getLinearCoefficients, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_32getLinearCoefficients};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_33getLinearCoefficients(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getLinearCoefficients (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLinearCoefficients", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLinearCoefficients", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_32getLinearCoefficients(((struct PyPetscRegressorObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_32getLinearCoefficients(struct PyPetscRegressorObject *__pyx_v_self) {
  struct PyPetscVecObject *__pyx_v_coeffs = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLinearCoefficients", 0);

  /* "petsc4py/PETSc/Regressor.pyx":275
 *         getLinearIntercept, petsc.PetscRegressorLinearGetCoefficients
 *         """
 *         cdef Vec coeffs = Vec()             # <<<<<<<<<<<<<<
 *         CHKERR(PetscRegressorLinearGetCoefficients(self.regressor, &coeffs.vec))
 *         CHKERR(PetscINCREF(coeffs.obj))
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 275, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_coeffs = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":276
 *         """
 *         cdef Vec coeffs = Vec()
 *         CHKERR(PetscRegressorLinearGetCoefficients(self.regressor, &coeffs.vec))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscINCREF(coeffs.obj))
 *         return coeffs
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorLinearGetCoefficients(__pyx_v_self->regressor, (&__pyx_v_coeffs->vec))); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 276, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":277
 *         cdef Vec coeffs = Vec()
 *         CHKERR(PetscRegressorLinearGetCoefficients(self.regressor, &coeffs.vec))
 *         CHKERR(PetscINCREF(coeffs.obj))             # <<<<<<<<<<<<<<
 *         return coeffs
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_f_8petsc4py_5PETSc_PetscINCREF(__pyx_v_coeffs->__pyx_base.obj)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 277, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":278
 *         CHKERR(PetscRegressorLinearGetCoefficients(self.regressor, &coeffs.vec))
 *         CHKERR(PetscINCREF(coeffs.obj))
 *         return coeffs             # <<<<<<<<<<<<<<
 * 
 *     def getLinearIntercept(self) -> Scalar:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_coeffs);
  __pyx_r = ((PyObject *)__pyx_v_coeffs);
  goto __pyx_L0;

  /* "petsc4py/PETSc/Regressor.pyx":266
 *         return ksp
 * 
 *     def getLinearCoefficients(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Get a vector of the fitted coefficients from a linear regression model.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.getLinearCoefficients", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_coeffs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":280
 *         return coeffs
 * 
 *     def getLinearIntercept(self) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Get the intercept from a linear regression model.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_35getLinearIntercept(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9Regressor_34getLinearIntercept, "Regressor.getLinearIntercept(self) -> Scalar\nGet the intercept from a linear regression model.\n\n        Not collective.\n\n        See Also\n        --------\n        setLinearFitIntercept, petsc.PetscRegressorLinearGetIntercept\n        \nSource code at petsc4py/PETSc/Regressor.pyx:280");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_35getLinearIntercept = {"getLinearIntercept", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_35getLinearIntercept, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_34getLinearIntercept};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_35getLinearIntercept(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getLinearIntercept (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLinearIntercept", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLinearIntercept", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_34getLinearIntercept(((struct PyPetscRegressorObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_34getLinearIntercept(struct PyPetscRegressorObject *__pyx_v_self) {
  PetscScalar __pyx_v_intercept;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscErrorCode __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getLinearIntercept", 0);

  /* "petsc4py/PETSc/Regressor.pyx":289
 *         setLinearFitIntercept, petsc.PetscRegressorLinearGetIntercept
 *         """
 *         cdef PetscScalar intercept = 0.0             # <<<<<<<<<<<<<<
 *         CHKERR(PetscRegressorLinearGetIntercept(self.regressor, &intercept))
 *         return toScalar(intercept)
*/
  __pyx_v_intercept = 0.0;

  /* "petsc4py/PETSc/Regressor.pyx":290
 *         """
 *         cdef PetscScalar intercept = 0.0
 *         CHKERR(PetscRegressorLinearGetIntercept(self.regressor, &intercept))             # <<<<<<<<<<<<<<
 *         return toScalar(intercept)
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorLinearGetIntercept(__pyx_v_self->regressor, (&__pyx_v_intercept))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 290, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":291
 *         cdef PetscScalar intercept = 0.0
 *         CHKERR(PetscRegressorLinearGetIntercept(self.regressor, &intercept))
 *         return toScalar(intercept)             # <<<<<<<<<<<<<<
 * 
 *     def setLinearType(self, lineartype: RegressorLinearType) -> None:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_intercept); if (unlikely(!__pyx_t_2)) __PYX_ERR(66, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Regressor.pyx":280
 *         return coeffs
 * 
 *     def getLinearIntercept(self) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Get the intercept from a linear regression model.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.getLinearIntercept", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":293
 *         return toScalar(intercept)
 * 
 *     def setLinearType(self, lineartype: RegressorLinearType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of linear regression to be performed.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_37setLinearType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9Regressor_36setLinearType, "Regressor.setLinearType(self, lineartype: RegressorLinearType) -> None\nSet the type of linear regression to be performed.\n\n        Logically collective.\n\n        See Also\n        --------\n        getLinearType, petsc.PetscRegressorLinearSetType\n        \nSource code at petsc4py/PETSc/Regressor.pyx:293");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_37setLinearType = {"setLinearType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_37setLinearType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_36setLinearType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_37setLinearType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_lineartype = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setLinearType (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_lineartype,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(66, 293, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 293, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "setLinearType", 0) < (0)) __PYX_ERR(66, 293, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("setLinearType", 1, 1, 1, i); __PYX_ERR(66, 293, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(66, 293, __pyx_L3_error)
    }
    __pyx_v_lineartype = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setLinearType", 1, 1, 1, __pyx_nargs); __PYX_ERR(66, 293, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.setLinearType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_36setLinearType(((struct PyPetscRegressorObject *)__pyx_v_self), __pyx_v_lineartype);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_36setLinearType(struct PyPetscRegressorObject *__pyx_v_self, PyObject *__pyx_v_lineartype) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PetscRegressorLinearType __pyx_t_1;
  PetscErrorCode __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setLinearType", 0);

  /* "petsc4py/PETSc/Regressor.pyx":302
 *         getLinearType, petsc.PetscRegressorLinearSetType
 *         """
 *         CHKERR(PetscRegressorLinearSetType(self.regressor, lineartype))             # <<<<<<<<<<<<<<
 * 
 *     def getLinearType(self) -> RegressorLinearType:
*/
  __pyx_t_1 = ((PetscRegressorLinearType)__Pyx_PyLong_As_PetscRegressorLinearType(__pyx_v_lineartype)); if (unlikely(PyErr_Occurred())) __PYX_ERR(66, 302, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorLinearSetType(__pyx_v_self->regressor, __pyx_t_1)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 302, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":293
 *         return toScalar(intercept)
 * 
 *     def setLinearType(self, lineartype: RegressorLinearType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of linear regression to be performed.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.setLinearType", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/Regressor.pyx":304
 *         CHKERR(PetscRegressorLinearSetType(self.regressor, lineartype))
 * 
 *     def getLinearType(self) -> RegressorLinearType:             # <<<<<<<<<<<<<<
 *         """Return the type of the linear regressor.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_39getLinearType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_8petsc4py_5PETSc_9Regressor_38getLinearType, "Regressor.getLinearType(self) -> RegressorLinearType\nReturn the type of the linear regressor.\n\n        Not collective.\n\n        See Also\n        --------\n        setLinearType, petsc.PetscRegressorLinearGetType\n        \nSource code at petsc4py/PETSc/Regressor.pyx:304");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_9Regressor_39getLinearType = {"getLinearType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_39getLinearType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_38getLinearType};
static PyObject *__pyx_pw_8petsc4py_5PETSc_9Regressor_39getLinearType(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getLinearType (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("getLinearType", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("getLinearType", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_8petsc4py_5PETSc_9Regressor_38getLinearType(((struct PyPetscRegressorObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8petsc4py_5PETSc_9Regressor_38getLinearType(struct PyPetscRegressorObject *__pyx_v_self) {
  PetscRegressorLinearType __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("getLinearType", 0);

  /* "petsc4py/PETSc/Regressor.pyx":313
 *         setLinearType, petsc.PetscRegressorLinearGetType
 *         """
 *         cdef PetscRegressorLinearType cval = REGRESSOR_LINEAR_OLS             # <<<<<<<<<<<<<<
 *         CHKERR(PetscRegressorLinearGetType(self.regressor, &cval))
 *         return cval
*/
  __pyx_v_cval = REGRESSOR_LINEAR_OLS;

  /* "petsc4py/PETSc/Regressor.pyx":314
 *         """
 *         cdef PetscRegressorLinearType cval = REGRESSOR_LINEAR_OLS
 *         CHKERR(PetscRegressorLinearGetType(self.regressor, &cval))             # <<<<<<<<<<<<<<
 *         return cval
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscRegressorLinearGetType(__pyx_v_self->regressor, (&__pyx_v_cval))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(66, 314, __pyx_L1_error)

  /* "petsc4py/PETSc/Regressor.pyx":315
 *         cdef PetscRegressorLinearType cval = REGRESSOR_LINEAR_OLS
 *         CHKERR(PetscRegressorLinearGetType(self.regressor, &cval))
 *         return cval             # <<<<<<<<<<<<<<
 * 
 * del RegressorType
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyLong_From_PetscRegressorLinearType(__pyx_v_cval); if (unlikely(!__pyx_t_2)) __PYX_ERR(66, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/Regressor.pyx":304
 *         CHKERR(PetscRegressorLinearSetType(self.regressor, lineartype))
 * 
 *     def getLinearType(self) -> RegressorLinearType:             # <<<<<<<<<<<<<<
 *         """Return the type of the linear regressor.
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.Regressor.getLinearType", __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 = <PetscObject*> d
 *     cdef PetscObject source = <PetscObject> 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 = <PetscObject*> d             # <<<<<<<<<<<<<<
 *     cdef PetscObject source = <PetscObject> 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 = <PetscObject*> d
 *     cdef PetscObject source = <PetscObject> s             # <<<<<<<<<<<<<<
 *     CHKERR(PetscINCREF(&source))
 *     dest[0] = source
*/
  __pyx_v_source = ((PetscObject)__pyx_v_s);

  /* "petsc4py/PETSc/CAPI.pyx":6
 *     cdef PetscObject *dest = <PetscObject*> d
 *     cdef PetscObject source = <PetscObject> 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(67, 6, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":7
 *     cdef PetscObject source = <PetscObject> 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 = <PetscObject*> d
 *     cdef PetscObject source = <PetscObject> 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;

  /* "petsc4py/PETSc/CAPI.pyx":15
 * 
 * cdef api int PyPetscError_Set(PetscErrorCode ierr):
 *     return SETERR(ierr)             # <<<<<<<<<<<<<<
 * 
 * # -- Comm --
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_SETERR(__pyx_v_ierr);
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":14
 * # -- Error --
 * 
 * cdef api int PyPetscError_Set(PetscErrorCode ierr):             # <<<<<<<<<<<<<<
 *     return SETERR(ierr)
 * 
*/

  /* function exit code */
  __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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscComm_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":20
 * 
 * cdef api object PyPetscComm_New(MPI_Comm arg):
 *     cdef Comm retv = Comm()             # <<<<<<<<<<<<<<
 *     retv.comm = arg
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 20, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__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_XDECREF(__pyx_t_2);
  __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 = <Comm?> 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", 0);

  /* "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 = <Comm?> 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 = <Comm?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.comm
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm)))) __PYX_ERR(67, 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 = <Comm?> 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 = <Comm?> 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 = <Comm?> 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 = <Comm?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":31
 * 
 * cdef api MPI_Comm* PyPetscComm_GetPtr(object arg) except NULL:
 *     cdef MPI_Comm *retv = NULL             # <<<<<<<<<<<<<<
 *     cdef Comm ob = <Comm?> 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 = <Comm?> arg             # <<<<<<<<<<<<<<
 *     retv = &ob.comm
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm)))) __PYX_ERR(67, 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 = <Comm?> arg
 *     retv = &ob.comm             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_v_retv = (&__pyx_v_ob->comm);

  /* "petsc4py/PETSc/CAPI.pyx":34
 *     cdef Comm ob = <Comm?> 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 = <Comm?> 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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscObject_New", 0);

  /* "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_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_Object(__pyx_v_arg)); if (unlikely(!__pyx_t_3)) __PYX_ERR(67, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(67, 39, __pyx_L1_error)
  __pyx_v_retv = ((struct PyPetscObjectObject *)__pyx_t_1);
  __pyx_t_1 = 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_5 = __pyx_f_8petsc4py_5PETSc_setref((&(__pyx_v_retv->obj[0])), __pyx_v_arg); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(67, 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_XDECREF(__pyx_t_3);
  __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 = <Object?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":44
 * 
 * cdef api PetscObject PyPetscObject_Get(object arg) except ? NULL:
 *     cdef PetscObject retv = NULL             # <<<<<<<<<<<<<<
 *     cdef Object ob = <Object?> 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 = <Object?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.obj[0]
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object)))) __PYX_ERR(67, 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 = <Object?> arg
 *     retv = ob.obj[0]             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_v_retv = (__pyx_v_ob->obj[0]);

  /* "petsc4py/PETSc/CAPI.pyx":47
 *     cdef Object ob = <Object?> 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 = <Object?> 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 = <Object?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":50
 * 
 * cdef api PetscObject* PyPetscObject_GetPtr(object arg) except NULL:
 *     cdef PetscObject *retv = NULL             # <<<<<<<<<<<<<<
 *     cdef Object ob = <Object?> 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 = <Object?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.obj
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object)))) __PYX_ERR(67, 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 = <Object?> 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 = <Object?> 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 = <Object?> 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscViewer_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":58
 * 
 * cdef api object PyPetscViewer_New(PetscViewer arg):
 *     cdef Viewer retv = Viewer()             # <<<<<<<<<<<<<<
 *     setref(&retv.vwr, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 58, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__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_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->vwr), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 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_XDECREF(__pyx_t_2);
  __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 = <Viewer?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":63
 * 
 * cdef api PetscViewer PyPetscViewer_Get(object arg) except ? NULL:
 *     cdef PetscViewer retv = NULL             # <<<<<<<<<<<<<<
 *     cdef Viewer ob = <Viewer?> 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 = <Viewer?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.vwr
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer)))) __PYX_ERR(67, 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 = <Viewer?> 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 = <Viewer?> 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 = <Viewer?> 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscRandom_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":71
 * 
 * cdef api object PyPetscRandom_New(PetscRandom arg):
 *     cdef Random retv = Random()             # <<<<<<<<<<<<<<
 *     setref(&retv.rnd, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 71, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__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_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->rnd), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 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_XDECREF(__pyx_t_2);
  __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 = <Random?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":76
 * 
 * cdef api PetscRandom PyPetscRandom_Get(object arg) except ? NULL:
 *     cdef PetscRandom retv = NULL             # <<<<<<<<<<<<<<
 *     cdef Random ob = <Random?> 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 = <Random?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.rnd
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random)))) __PYX_ERR(67, 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 = <Random?> 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 = <Random?> 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 = <Random?> 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()
 *     CHKERR(PetscDeviceReference(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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  PetscErrorCode __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscDevice_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":84
 * 
 * cdef api Device PyPetscDevice_New(PetscDevice arg):
 *     cdef Device ret = Device()             # <<<<<<<<<<<<<<
 *     CHKERR(PetscDeviceReference(arg))
 *     ret.device = arg
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 84, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__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()
 *     CHKERR(PetscDeviceReference(arg))             # <<<<<<<<<<<<<<
 *     ret.device = arg
 *     return ret
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscDeviceReference(__pyx_v_arg)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(67, 85, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":86
 *     cdef Device ret = Device()
 *     CHKERR(PetscDeviceReference(arg))
 *     ret.device = arg             # <<<<<<<<<<<<<<
 *     return ret
 * 
*/
  __pyx_v_ret->device = __pyx_v_arg;

  /* "petsc4py/PETSc/CAPI.pyx":87
 *     CHKERR(PetscDeviceReference(arg))
 *     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()
 *     CHKERR(PetscDeviceReference(arg))
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":89
 *     return ret
 * 
 * cdef api PetscDevice PyPetscDevice_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef Device      obj = <Device?>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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":90
 * 
 * cdef api PetscDevice PyPetscDevice_Get(object arg) except ? NULL:
 *     cdef Device      obj = <Device?>arg             # <<<<<<<<<<<<<<
 *     cdef PetscDevice ret = obj.device
 *     return ret
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device)))) __PYX_ERR(67, 90, __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":91
 * cdef api PetscDevice PyPetscDevice_Get(object arg) except ? NULL:
 *     cdef Device      obj = <Device?>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":92
 *     cdef Device      obj = <Device?>arg
 *     cdef PetscDevice ret = obj.device
 *     return ret             # <<<<<<<<<<<<<<
 * 
 * # -- DeviceContext --
*/
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":89
 *     return ret
 * 
 * cdef api PetscDevice PyPetscDevice_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef Device      obj = <Device?>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":96
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscDeviceContext_New", 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 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 97, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscDeviceContextObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":98
 * cdef api DeviceContext PyPetscDeviceContext_New(PetscDeviceContext arg):
 *     cdef DeviceContext retv = DeviceContext()
 *     setref(&retv.dctx, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->dctx), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 98, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":99
 *     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":96
 * # -- 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_XDECREF(__pyx_t_2);
  __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":101
 *     return retv
 * 
 * cdef api PetscDeviceContext PyPetscDeviceContext_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef DeviceContext      obj = <DeviceContext?>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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":102
 * 
 * cdef api PetscDeviceContext PyPetscDeviceContext_Get(object arg) except ? NULL:
 *     cdef DeviceContext      obj = <DeviceContext?>arg             # <<<<<<<<<<<<<<
 *     cdef PetscDeviceContext ret = obj.dctx
 *     return ret
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext)))) __PYX_ERR(67, 102, __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":103
 * cdef api PetscDeviceContext PyPetscDeviceContext_Get(object arg) except ? NULL:
 *     cdef DeviceContext      obj = <DeviceContext?>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":104
 *     cdef DeviceContext      obj = <DeviceContext?>arg
 *     cdef PetscDeviceContext ret = obj.dctx
 *     return ret             # <<<<<<<<<<<<<<
 * 
 * # -- IS --
*/
  __pyx_r = __pyx_v_ret;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":101
 *     return retv
 * 
 * cdef api PetscDeviceContext PyPetscDeviceContext_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef DeviceContext      obj = <DeviceContext?>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":108
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscIS_New", 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 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 109, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscISObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":110
 * cdef api object PyPetscIS_New(PetscIS arg):
 *     cdef IS retv = IS()
 *     setref(&retv.iset, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->iset), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 110, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":111
 *     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":108
 * # -- 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_XDECREF(__pyx_t_2);
  __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":113
 *     return retv
 * 
 * cdef api PetscIS PyPetscIS_Get(object arg) except? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscIS retv = NULL
 *     cdef IS ob = <IS?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":114
 * 
 * cdef api PetscIS PyPetscIS_Get(object arg) except? NULL:
 *     cdef PetscIS retv = NULL             # <<<<<<<<<<<<<<
 *     cdef IS ob = <IS?> arg
 *     retv = ob.iset
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":115
 * cdef api PetscIS PyPetscIS_Get(object arg) except? NULL:
 *     cdef PetscIS retv = NULL
 *     cdef IS ob = <IS?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.iset
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS)))) __PYX_ERR(67, 115, __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":116
 *     cdef PetscIS retv = NULL
 *     cdef IS ob = <IS?> arg
 *     retv = ob.iset             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->iset;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":117
 *     cdef IS ob = <IS?> arg
 *     retv = ob.iset
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- LGMap --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":113
 *     return retv
 * 
 * cdef api PetscIS PyPetscIS_Get(object arg) except? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscIS retv = NULL
 *     cdef IS ob = <IS?> 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":121
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscLGMap_New", 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 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 122, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscLGMapObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":123
 * cdef api object PyPetscLGMap_New(PetscLGMap arg):
 *     cdef LGMap retv = LGMap()
 *     setref(&retv.lgm, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->lgm), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 123, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":124
 *     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":121
 * # -- 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_XDECREF(__pyx_t_2);
  __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":126
 *     return retv
 * 
 * cdef api PetscLGMap PyPetscLGMap_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscLGMap retv = NULL
 *     cdef LGMap ob = <LGMap?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":127
 * 
 * cdef api PetscLGMap PyPetscLGMap_Get(object arg) except ? NULL:
 *     cdef PetscLGMap retv = NULL             # <<<<<<<<<<<<<<
 *     cdef LGMap ob = <LGMap?> arg
 *     retv = ob.lgm
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":128
 * cdef api PetscLGMap PyPetscLGMap_Get(object arg) except ? NULL:
 *     cdef PetscLGMap retv = NULL
 *     cdef LGMap ob = <LGMap?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.lgm
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap)))) __PYX_ERR(67, 128, __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":129
 *     cdef PetscLGMap retv = NULL
 *     cdef LGMap ob = <LGMap?> arg
 *     retv = ob.lgm             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->lgm;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":130
 *     cdef LGMap ob = <LGMap?> arg
 *     retv = ob.lgm
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- SF --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":126
 *     return retv
 * 
 * cdef api PetscLGMap PyPetscLGMap_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscLGMap retv = NULL
 *     cdef LGMap ob = <LGMap?> 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":134
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscSF_New", 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 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 135, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscSFObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":136
 * cdef api object PyPetscSF_New(PetscSF arg):
 *     cdef SF retv = SF()
 *     setref(&retv.sf, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->sf), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 136, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":137
 *     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":134
 * # -- 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_XDECREF(__pyx_t_2);
  __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":139
 *     return retv
 * 
 * cdef api PetscSF PyPetscSF_Get(object arg) except? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscSF retv = NULL
 *     cdef SF ob = <SF?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":140
 * 
 * cdef api PetscSF PyPetscSF_Get(object arg) except? NULL:
 *     cdef PetscSF retv = NULL             # <<<<<<<<<<<<<<
 *     cdef SF ob = <SF?> arg
 *     retv = ob.sf
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":141
 * cdef api PetscSF PyPetscSF_Get(object arg) except? NULL:
 *     cdef PetscSF retv = NULL
 *     cdef SF ob = <SF?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.sf
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF)))) __PYX_ERR(67, 141, __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":142
 *     cdef PetscSF retv = NULL
 *     cdef SF ob = <SF?> arg
 *     retv = ob.sf             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->sf;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":143
 *     cdef SF ob = <SF?> arg
 *     retv = ob.sf
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- Vec --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":139
 *     return retv
 * 
 * cdef api PetscSF PyPetscSF_Get(object arg) except? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscSF retv = NULL
 *     cdef SF ob = <SF?> 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":147
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscVec_New", 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 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 148, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscVecObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":149
 * cdef api object PyPetscVec_New(PetscVec arg):
 *     cdef Vec retv = Vec()
 *     setref(&retv.vec, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->vec), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 149, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":150
 *     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":147
 * # -- 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_XDECREF(__pyx_t_2);
  __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":152
 *     return retv
 * 
 * cdef api PetscVec PyPetscVec_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscVec retv = NULL
 *     cdef Vec ob = <Vec?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":153
 * 
 * cdef api PetscVec PyPetscVec_Get(object arg) except ? NULL:
 *     cdef PetscVec retv = NULL             # <<<<<<<<<<<<<<
 *     cdef Vec ob = <Vec?> arg
 *     retv = ob.vec
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":154
 * cdef api PetscVec PyPetscVec_Get(object arg) except ? NULL:
 *     cdef PetscVec retv = NULL
 *     cdef Vec ob = <Vec?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.vec
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec)))) __PYX_ERR(67, 154, __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":155
 *     cdef PetscVec retv = NULL
 *     cdef Vec ob = <Vec?> arg
 *     retv = ob.vec             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->vec;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":156
 *     cdef Vec ob = <Vec?> arg
 *     retv = ob.vec
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- Scatter --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":152
 *     return retv
 * 
 * cdef api PetscVec PyPetscVec_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscVec retv = NULL
 *     cdef Vec ob = <Vec?> 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":160
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscScatter_New", 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 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 161, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscScatterObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":162
 * cdef api object PyPetscScatter_New(PetscScatter arg):
 *     cdef Scatter retv = Scatter()
 *     setref(&retv.sct, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->sct), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 162, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":163
 *     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":160
 * # -- 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_XDECREF(__pyx_t_2);
  __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":165
 *     return retv
 * 
 * cdef api PetscScatter PyPetscScatter_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscScatter retv = NULL
 *     cdef Scatter ob = <Scatter?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":166
 * 
 * cdef api PetscScatter PyPetscScatter_Get(object arg) except ? NULL:
 *     cdef PetscScatter retv = NULL             # <<<<<<<<<<<<<<
 *     cdef Scatter ob = <Scatter?> arg
 *     retv = ob.sct
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":167
 * cdef api PetscScatter PyPetscScatter_Get(object arg) except ? NULL:
 *     cdef PetscScatter retv = NULL
 *     cdef Scatter ob = <Scatter?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.sct
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter)))) __PYX_ERR(67, 167, __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":168
 *     cdef PetscScatter retv = NULL
 *     cdef Scatter ob = <Scatter?> arg
 *     retv = ob.sct             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->sct;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":169
 *     cdef Scatter ob = <Scatter?> arg
 *     retv = ob.sct
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- Section --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":165
 *     return retv
 * 
 * cdef api PetscScatter PyPetscScatter_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscScatter retv = NULL
 *     cdef Scatter ob = <Scatter?> 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":173
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscSection_New", 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 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 174, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscSectionObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":175
 * cdef api object PyPetscSection_New(PetscSection arg):
 *     cdef Section retv = Section()
 *     setref(&retv.sec, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->sec), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 175, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":176
 *     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":173
 * # -- 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_XDECREF(__pyx_t_2);
  __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":178
 *     return retv
 * 
 * cdef api PetscSection PyPetscSection_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscSection retv = NULL
 *     cdef Section ob = <Section?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":179
 * 
 * cdef api PetscSection PyPetscSection_Get(object arg) except ? NULL:
 *     cdef PetscSection retv = NULL             # <<<<<<<<<<<<<<
 *     cdef Section ob = <Section?> arg
 *     retv = ob.sec
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":180
 * cdef api PetscSection PyPetscSection_Get(object arg) except ? NULL:
 *     cdef PetscSection retv = NULL
 *     cdef Section ob = <Section?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.sec
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section)))) __PYX_ERR(67, 180, __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":181
 *     cdef PetscSection retv = NULL
 *     cdef Section ob = <Section?> arg
 *     retv = ob.sec             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->sec;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":182
 *     cdef Section ob = <Section?> arg
 *     retv = ob.sec
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- Mat --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":178
 *     return retv
 * 
 * cdef api PetscSection PyPetscSection_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscSection retv = NULL
 *     cdef Section ob = <Section?> 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":186
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscMat_New", 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 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 187, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscMatObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":188
 * cdef api object PyPetscMat_New(PetscMat arg):
 *     cdef Mat retv = Mat()
 *     setref(&retv.mat, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->mat), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 188, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":189
 *     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":186
 * # -- 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_XDECREF(__pyx_t_2);
  __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":191
 *     return retv
 * 
 * cdef api PetscMat PyPetscMat_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscMat retv = NULL
 *     cdef Mat ob = <Mat?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":192
 * 
 * cdef api PetscMat PyPetscMat_Get(object arg) except ? NULL:
 *     cdef PetscMat retv = NULL             # <<<<<<<<<<<<<<
 *     cdef Mat ob = <Mat?> arg
 *     retv = ob.mat
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":193
 * cdef api PetscMat PyPetscMat_Get(object arg) except ? NULL:
 *     cdef PetscMat retv = NULL
 *     cdef Mat ob = <Mat?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.mat
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat)))) __PYX_ERR(67, 193, __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":194
 *     cdef PetscMat retv = NULL
 *     cdef Mat ob = <Mat?> arg
 *     retv = ob.mat             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->mat;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":195
 *     cdef Mat ob = <Mat?> arg
 *     retv = ob.mat
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- MatPartitioning --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":191
 *     return retv
 * 
 * cdef api PetscMat PyPetscMat_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscMat retv = NULL
 *     cdef Mat ob = <Mat?> 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":199
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscMatPartitioning_New", 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 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 200, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscMatPartitioningObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":201
 * cdef api object PyPetscMatPartitioning_New(PetscMatPartitioning arg):
 *     cdef MatPartitioning retv = MatPartitioning()
 *     setref(&retv.part, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->part), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 201, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":202
 *     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":199
 * # -- 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_XDECREF(__pyx_t_2);
  __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":204
 *     return retv
 * 
 * cdef api PetscMatPartitioning PyPetscMatPartitioning_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscMatPartitioning retv = NULL
 *     cdef MatPartitioning ob = <MatPartitioning?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":205
 * 
 * cdef api PetscMatPartitioning PyPetscMatPartitioning_Get(object arg) except ? NULL:
 *     cdef PetscMatPartitioning retv = NULL             # <<<<<<<<<<<<<<
 *     cdef MatPartitioning ob = <MatPartitioning?> arg
 *     retv = ob.part
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":206
 * cdef api PetscMatPartitioning PyPetscMatPartitioning_Get(object arg) except ? NULL:
 *     cdef PetscMatPartitioning retv = NULL
 *     cdef MatPartitioning ob = <MatPartitioning?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.part
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning)))) __PYX_ERR(67, 206, __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":207
 *     cdef PetscMatPartitioning retv = NULL
 *     cdef MatPartitioning ob = <MatPartitioning?> arg
 *     retv = ob.part             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->part;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":208
 *     cdef MatPartitioning ob = <MatPartitioning?> arg
 *     retv = ob.part
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- PC --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":204
 *     return retv
 * 
 * cdef api PetscMatPartitioning PyPetscMatPartitioning_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscMatPartitioning retv = NULL
 *     cdef MatPartitioning ob = <MatPartitioning?> 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":212
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscPC_New", 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 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 213, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscPCObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":214
 * cdef api object PyPetscPC_New(PetscPC arg):
 *     cdef PC retv = PC()
 *     setref(&retv.pc, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->pc), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 214, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":215
 *     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":212
 * # -- 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_XDECREF(__pyx_t_2);
  __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":217
 *     return retv
 * 
 * cdef api PetscPC PyPetscPC_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscPC retv = NULL
 *     cdef PC ob = <PC?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":218
 * 
 * cdef api PetscPC PyPetscPC_Get(object arg) except ? NULL:
 *     cdef PetscPC retv = NULL             # <<<<<<<<<<<<<<
 *     cdef PC ob = <PC?> arg
 *     retv = ob.pc
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":219
 * cdef api PetscPC PyPetscPC_Get(object arg) except ? NULL:
 *     cdef PetscPC retv = NULL
 *     cdef PC ob = <PC?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.pc
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC)))) __PYX_ERR(67, 219, __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":220
 *     cdef PetscPC retv = NULL
 *     cdef PC ob = <PC?> arg
 *     retv = ob.pc             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->pc;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":221
 *     cdef PC ob = <PC?> arg
 *     retv = ob.pc
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- KSP --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":217
 *     return retv
 * 
 * cdef api PetscPC PyPetscPC_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscPC retv = NULL
 *     cdef PC ob = <PC?> 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":225
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscKSP_New", 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 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 226, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscKSPObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":227
 * cdef api object PyPetscKSP_New(PetscKSP arg):
 *     cdef KSP retv = KSP()
 *     setref(&retv.ksp, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->ksp), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 227, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":228
 *     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":225
 * # -- 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_XDECREF(__pyx_t_2);
  __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":230
 *     return retv
 * 
 * cdef api PetscKSP PyPetscKSP_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscKSP retv = NULL
 *     cdef KSP ob = <KSP?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":231
 * 
 * cdef api PetscKSP PyPetscKSP_Get(object arg) except ? NULL:
 *     cdef PetscKSP retv = NULL             # <<<<<<<<<<<<<<
 *     cdef KSP ob = <KSP?> arg
 *     retv = ob.ksp
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":232
 * cdef api PetscKSP PyPetscKSP_Get(object arg) except ? NULL:
 *     cdef PetscKSP retv = NULL
 *     cdef KSP ob = <KSP?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.ksp
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP)))) __PYX_ERR(67, 232, __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":233
 *     cdef PetscKSP retv = NULL
 *     cdef KSP ob = <KSP?> arg
 *     retv = ob.ksp             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->ksp;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":234
 *     cdef KSP ob = <KSP?> arg
 *     retv = ob.ksp
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- SNES --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":230
 *     return retv
 * 
 * cdef api PetscKSP PyPetscKSP_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscKSP retv = NULL
 *     cdef KSP ob = <KSP?> 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":238
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscSNES_New", 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 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 239, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscSNESObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":240
 * cdef api object PyPetscSNES_New(PetscSNES arg):
 *     cdef SNES retv = SNES()
 *     setref(&retv.snes, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->snes), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 240, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":241
 *     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":238
 * # -- 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_XDECREF(__pyx_t_2);
  __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":243
 *     return retv
 * 
 * cdef api PetscSNES PyPetscSNES_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscSNES retv = NULL
 *     cdef SNES ob = <SNES?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":244
 * 
 * cdef api PetscSNES PyPetscSNES_Get(object arg) except ? NULL:
 *     cdef PetscSNES retv = NULL             # <<<<<<<<<<<<<<
 *     cdef SNES ob = <SNES?> arg
 *     retv = ob.snes
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":245
 * cdef api PetscSNES PyPetscSNES_Get(object arg) except ? NULL:
 *     cdef PetscSNES retv = NULL
 *     cdef SNES ob = <SNES?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.snes
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES)))) __PYX_ERR(67, 245, __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":246
 *     cdef PetscSNES retv = NULL
 *     cdef SNES ob = <SNES?> arg
 *     retv = ob.snes             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->snes;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":247
 *     cdef SNES ob = <SNES?> arg
 *     retv = ob.snes
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * cdef api object PyPetscSNESLineSearch_New(PetscSNESLineSearch arg):
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":243
 *     return retv
 * 
 * cdef api PetscSNES PyPetscSNES_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscSNES retv = NULL
 *     cdef SNES ob = <SNES?> 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":249
 *     return retv
 * 
 * cdef api object PyPetscSNESLineSearch_New(PetscSNESLineSearch arg):             # <<<<<<<<<<<<<<
 *     cdef SNESLineSearch retv = SNESLineSearch()
 *     setref(&retv.snesls, arg)
*/

static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscSNESLineSearch_New(SNESLineSearch __pyx_v_arg) {
  struct PyPetscSNESLineSearchObject *__pyx_v_retv = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscSNESLineSearch_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":250
 * 
 * cdef api object PyPetscSNESLineSearch_New(PetscSNESLineSearch arg):
 *     cdef SNESLineSearch retv = SNESLineSearch()             # <<<<<<<<<<<<<<
 *     setref(&retv.snesls, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 250, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscSNESLineSearchObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":251
 * cdef api object PyPetscSNESLineSearch_New(PetscSNESLineSearch arg):
 *     cdef SNESLineSearch retv = SNESLineSearch()
 *     setref(&retv.snesls, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->snesls), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 251, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":252
 *     cdef SNESLineSearch retv = SNESLineSearch()
 *     setref(&retv.snesls, arg)
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * cdef api PetscSNESLineSearch PyPetscSNESLineSearch_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":249
 *     return retv
 * 
 * cdef api object PyPetscSNESLineSearch_New(PetscSNESLineSearch arg):             # <<<<<<<<<<<<<<
 *     cdef SNESLineSearch retv = SNESLineSearch()
 *     setref(&retv.snesls, arg)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.PyPetscSNESLineSearch_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":254
 *     return retv
 * 
 * cdef api PetscSNESLineSearch PyPetscSNESLineSearch_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscSNESLineSearch retv = NULL
 *     cdef SNESLineSearch ob = <SNESLineSearch?> arg
*/

static SNESLineSearch __pyx_f_8petsc4py_5PETSc_PyPetscSNESLineSearch_Get(PyObject *__pyx_v_arg) {
  SNESLineSearch __pyx_v_retv;
  struct PyPetscSNESLineSearchObject *__pyx_v_ob = 0;
  SNESLineSearch __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  SNESLineSearch __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscSNESLineSearch_Get", 0);

  /* "petsc4py/PETSc/CAPI.pyx":255
 * 
 * cdef api PetscSNESLineSearch PyPetscSNESLineSearch_Get(object arg) except ? NULL:
 *     cdef PetscSNESLineSearch retv = NULL             # <<<<<<<<<<<<<<
 *     cdef SNESLineSearch ob = <SNESLineSearch?> arg
 *     retv = ob.snesls
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":256
 * cdef api PetscSNESLineSearch PyPetscSNESLineSearch_Get(object arg) except ? NULL:
 *     cdef PetscSNESLineSearch retv = NULL
 *     cdef SNESLineSearch ob = <SNESLineSearch?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.snesls
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch)))) __PYX_ERR(67, 256, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_arg;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_ob = ((struct PyPetscSNESLineSearchObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":257
 *     cdef PetscSNESLineSearch retv = NULL
 *     cdef SNESLineSearch ob = <SNESLineSearch?> arg
 *     retv = ob.snesls             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->snesls;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":258
 *     cdef SNESLineSearch ob = <SNESLineSearch?> arg
 *     retv = ob.snesls
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- TS --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":254
 *     return retv
 * 
 * cdef api PetscSNESLineSearch PyPetscSNESLineSearch_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscSNESLineSearch retv = NULL
 *     cdef SNESLineSearch ob = <SNESLineSearch?> arg
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("petsc4py.PETSc.PyPetscSNESLineSearch_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":262
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscTS_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":263
 * 
 * cdef api object PyPetscTS_New(PetscTS arg):
 *     cdef TS retv = TS()             # <<<<<<<<<<<<<<
 *     setref(&retv.ts, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 263, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscTSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":264
 * cdef api object PyPetscTS_New(PetscTS arg):
 *     cdef TS retv = TS()
 *     setref(&retv.ts, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->ts), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 264, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":265
 *     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":262
 * # -- 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_XDECREF(__pyx_t_2);
  __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":267
 *     return retv
 * 
 * cdef api PetscTS PyPetscTS_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscTS retv = NULL
 *     cdef TS ob = <TS?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":268
 * 
 * cdef api PetscTS PyPetscTS_Get(object arg) except ? NULL:
 *     cdef PetscTS retv = NULL             # <<<<<<<<<<<<<<
 *     cdef TS ob = <TS?> arg
 *     retv = ob.ts
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":269
 * cdef api PetscTS PyPetscTS_Get(object arg) except ? NULL:
 *     cdef PetscTS retv = NULL
 *     cdef TS ob = <TS?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.ts
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS)))) __PYX_ERR(67, 269, __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":270
 *     cdef PetscTS retv = NULL
 *     cdef TS ob = <TS?> arg
 *     retv = ob.ts             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->ts;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":271
 *     cdef TS ob = <TS?> arg
 *     retv = ob.ts
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- TAO --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":267
 *     return retv
 * 
 * cdef api PetscTS PyPetscTS_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscTS retv = NULL
 *     cdef TS ob = <TS?> 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":275
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscTAO_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":276
 * 
 * cdef api object PyPetscTAO_New(PetscTAO arg):
 *     cdef TAO retv = TAO()             # <<<<<<<<<<<<<<
 *     setref(&retv.tao, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 276, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscTAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":277
 * cdef api object PyPetscTAO_New(PetscTAO arg):
 *     cdef TAO retv = TAO()
 *     setref(&retv.tao, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->tao), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 277, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":278
 *     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":275
 * # -- 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_XDECREF(__pyx_t_2);
  __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":280
 *     return retv
 * 
 * cdef api PetscTAO PyPetscTAO_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscTAO retv = NULL
 *     cdef TAO ob = <TAO?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":281
 * 
 * cdef api PetscTAO PyPetscTAO_Get(object arg) except ? NULL:
 *     cdef PetscTAO retv = NULL             # <<<<<<<<<<<<<<
 *     cdef TAO ob = <TAO?> arg
 *     retv = ob.tao
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":282
 * cdef api PetscTAO PyPetscTAO_Get(object arg) except ? NULL:
 *     cdef PetscTAO retv = NULL
 *     cdef TAO ob = <TAO?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.tao
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO)))) __PYX_ERR(67, 282, __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":283
 *     cdef PetscTAO retv = NULL
 *     cdef TAO ob = <TAO?> arg
 *     retv = ob.tao             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->tao;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":284
 *     cdef TAO ob = <TAO?> 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":280
 *     return retv
 * 
 * cdef api PetscTAO PyPetscTAO_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscTAO retv = NULL
 *     cdef TAO ob = <TAO?> 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":286
 *     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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscTAOLineSearch_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":287
 * 
 * cdef api object PyPetscTAOLineSearch_New(PetscTAOLineSearch arg):
 *     cdef TAOLineSearch retv = TAOLineSearch()             # <<<<<<<<<<<<<<
 *     setref(&retv.taols, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 287, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscTAOLineSearchObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":288
 * cdef api object PyPetscTAOLineSearch_New(PetscTAOLineSearch arg):
 *     cdef TAOLineSearch retv = TAOLineSearch()
 *     setref(&retv.taols, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->taols), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 288, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":289
 *     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":286
 *     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_XDECREF(__pyx_t_2);
  __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":291
 *     return retv
 * 
 * cdef api PetscTAOLineSearch PyPetscTAOLineSearch_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscTAOLineSearch retv = NULL
 *     cdef TAOLineSearch ob = <TAOLineSearch?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":292
 * 
 * cdef api PetscTAOLineSearch PyPetscTAOLineSearch_Get(object arg) except ? NULL:
 *     cdef PetscTAOLineSearch retv = NULL             # <<<<<<<<<<<<<<
 *     cdef TAOLineSearch ob = <TAOLineSearch?> arg
 *     retv = ob.taols
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":293
 * cdef api PetscTAOLineSearch PyPetscTAOLineSearch_Get(object arg) except ? NULL:
 *     cdef PetscTAOLineSearch retv = NULL
 *     cdef TAOLineSearch ob = <TAOLineSearch?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.taols
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch)))) __PYX_ERR(67, 293, __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":294
 *     cdef PetscTAOLineSearch retv = NULL
 *     cdef TAOLineSearch ob = <TAOLineSearch?> arg
 *     retv = ob.taols             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->taols;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":295
 *     cdef TAOLineSearch ob = <TAOLineSearch?> arg
 *     retv = ob.taols
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * cdef api object PyPetscTAOTerm_New(PetscTAOTerm arg):
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":291
 *     return retv
 * 
 * cdef api PetscTAOLineSearch PyPetscTAOLineSearch_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscTAOLineSearch retv = NULL
 *     cdef TAOLineSearch ob = <TAOLineSearch?> 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":297
 *     return retv
 * 
 * cdef api object PyPetscTAOTerm_New(PetscTAOTerm arg):             # <<<<<<<<<<<<<<
 *     cdef TAOTerm retv = TAOTerm()
 *     setref(&retv.taoterm, arg)
*/

static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscTAOTerm_New(TaoTerm __pyx_v_arg) {
  struct PyPetscTAOTermObject *__pyx_v_retv = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscTAOTerm_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":298
 * 
 * cdef api object PyPetscTAOTerm_New(PetscTAOTerm arg):
 *     cdef TAOTerm retv = TAOTerm()             # <<<<<<<<<<<<<<
 *     setref(&retv.taoterm, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOTerm, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 298, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscTAOTermObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":299
 * cdef api object PyPetscTAOTerm_New(PetscTAOTerm arg):
 *     cdef TAOTerm retv = TAOTerm()
 *     setref(&retv.taoterm, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->taoterm), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 299, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":300
 *     cdef TAOTerm retv = TAOTerm()
 *     setref(&retv.taoterm, arg)
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * cdef api PetscTAOTerm PyPetscTAOTerm_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":297
 *     return retv
 * 
 * cdef api object PyPetscTAOTerm_New(PetscTAOTerm arg):             # <<<<<<<<<<<<<<
 *     cdef TAOTerm retv = TAOTerm()
 *     setref(&retv.taoterm, arg)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.PyPetscTAOTerm_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":302
 *     return retv
 * 
 * cdef api PetscTAOTerm PyPetscTAOTerm_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscTAOTerm retv = NULL
 *     cdef TAOTerm ob = <TAOTerm?> arg
*/

static TaoTerm __pyx_f_8petsc4py_5PETSc_PyPetscTAOTerm_Get(PyObject *__pyx_v_arg) {
  TaoTerm __pyx_v_retv;
  struct PyPetscTAOTermObject *__pyx_v_ob = 0;
  TaoTerm __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  TaoTerm __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscTAOTerm_Get", 0);

  /* "petsc4py/PETSc/CAPI.pyx":303
 * 
 * cdef api PetscTAOTerm PyPetscTAOTerm_Get(object arg) except ? NULL:
 *     cdef PetscTAOTerm retv = NULL             # <<<<<<<<<<<<<<
 *     cdef TAOTerm ob = <TAOTerm?> arg
 *     retv = ob.taoterm
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":304
 * cdef api PetscTAOTerm PyPetscTAOTerm_Get(object arg) except ? NULL:
 *     cdef PetscTAOTerm retv = NULL
 *     cdef TAOTerm ob = <TAOTerm?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.taoterm
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOTerm)))) __PYX_ERR(67, 304, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_arg;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_ob = ((struct PyPetscTAOTermObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":305
 *     cdef PetscTAOTerm retv = NULL
 *     cdef TAOTerm ob = <TAOTerm?> arg
 *     retv = ob.taoterm             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->taoterm;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":306
 *     cdef TAOTerm ob = <TAOTerm?> arg
 *     retv = ob.taoterm
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- AO --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":302
 *     return retv
 * 
 * cdef api PetscTAOTerm PyPetscTAOTerm_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscTAOTerm retv = NULL
 *     cdef TAOTerm ob = <TAOTerm?> arg
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("petsc4py.PETSc.PyPetscTAOTerm_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":310
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscAO_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":311
 * 
 * cdef api object PyPetscAO_New(PetscAO arg):
 *     cdef AO retv = AO()             # <<<<<<<<<<<<<<
 *     setref(&retv.ao, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_AO, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 311, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscAOObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":312
 * cdef api object PyPetscAO_New(PetscAO arg):
 *     cdef AO retv = AO()
 *     setref(&retv.ao, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->ao), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 312, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":313
 *     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":310
 * # -- 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_XDECREF(__pyx_t_2);
  __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":315
 *     return retv
 * 
 * cdef api PetscAO PyPetscAO_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscAO retv = NULL
 *     cdef AO ob = <AO?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":316
 * 
 * cdef api PetscAO PyPetscAO_Get(object arg) except ? NULL:
 *     cdef PetscAO retv = NULL             # <<<<<<<<<<<<<<
 *     cdef AO ob = <AO?> arg
 *     retv = ob.ao
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":317
 * cdef api PetscAO PyPetscAO_Get(object arg) except ? NULL:
 *     cdef PetscAO retv = NULL
 *     cdef AO ob = <AO?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.ao
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_AO)))) __PYX_ERR(67, 317, __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":318
 *     cdef PetscAO retv = NULL
 *     cdef AO ob = <AO?> arg
 *     retv = ob.ao             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->ao;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":319
 *     cdef AO ob = <AO?> arg
 *     retv = ob.ao
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- DM --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":315
 *     return retv
 * 
 * cdef api PetscAO PyPetscAO_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscAO retv = NULL
 *     cdef AO ob = <AO?> 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":323
 * # -- 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;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscDM_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":324
 * 
 * cdef api object PyPetscDM_New(PetscDM arg):
 *     cdef DM retv = subtype_DM(arg)()             # <<<<<<<<<<<<<<
 *     setref(&retv.dm, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_subtype_DM(__pyx_v_arg)); if (unlikely(!__pyx_t_3)) __PYX_ERR(67, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM))))) __PYX_ERR(67, 324, __pyx_L1_error)
  __pyx_v_retv = ((struct PyPetscDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":325
 * cdef api object PyPetscDM_New(PetscDM arg):
 *     cdef DM retv = subtype_DM(arg)()
 *     setref(&retv.dm, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->dm), __pyx_v_arg); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(67, 325, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":326
 *     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":323
 * # -- 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_XDECREF(__pyx_t_3);
  __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":328
 *     return retv
 * 
 * cdef api PetscDM PyPetscDM_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscDM retv = NULL
 *     cdef DM ob = <DM?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":329
 * 
 * cdef api PetscDM PyPetscDM_Get(object arg) except ? NULL:
 *     cdef PetscDM retv = NULL             # <<<<<<<<<<<<<<
 *     cdef DM ob = <DM?> arg
 *     retv = ob.dm
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":330
 * cdef api PetscDM PyPetscDM_Get(object arg) except ? NULL:
 *     cdef PetscDM retv = NULL
 *     cdef DM ob = <DM?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.dm
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM)))) __PYX_ERR(67, 330, __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":331
 *     cdef PetscDM retv = NULL
 *     cdef DM ob = <DM?> arg
 *     retv = ob.dm             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->dm;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":332
 *     cdef DM ob = <DM?> arg
 *     retv = ob.dm
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- DS --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":328
 *     return retv
 * 
 * cdef api PetscDM PyPetscDM_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscDM retv = NULL
 *     cdef DM ob = <DM?> 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":336
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscDS_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":337
 * 
 * cdef api object PyPetscDS_New(PetscDS arg):
 *     cdef DS retv = DS()             # <<<<<<<<<<<<<<
 *     setref(&retv.ds, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 337, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscDSObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":338
 * cdef api object PyPetscDS_New(PetscDS arg):
 *     cdef DS retv = DS()
 *     setref(&retv.ds, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->ds), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 338, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":339
 *     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":336
 * # -- 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_XDECREF(__pyx_t_2);
  __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":341
 *     return retv
 * 
 * cdef api PetscDS PyPetscDS_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscDS retv = NULL
 *     cdef DS ob = <DS?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":342
 * 
 * cdef api PetscDS PyPetscDS_Get(object arg) except ? NULL:
 *     cdef PetscDS retv = NULL             # <<<<<<<<<<<<<<
 *     cdef DS ob = <DS?> arg
 *     retv = ob.ds
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":343
 * cdef api PetscDS PyPetscDS_Get(object arg) except ? NULL:
 *     cdef PetscDS retv = NULL
 *     cdef DS ob = <DS?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.ds
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS)))) __PYX_ERR(67, 343, __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":344
 *     cdef PetscDS retv = NULL
 *     cdef DS ob = <DS?> arg
 *     retv = ob.ds             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->ds;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":345
 *     cdef DS ob = <DS?> arg
 *     retv = ob.ds
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- Partitioner --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":341
 *     return retv
 * 
 * cdef api PetscDS PyPetscDS_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscDS retv = NULL
 *     cdef DS ob = <DS?> 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":349
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscPartitioner_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":350
 * 
 * cdef api object PyPetscPartitioner_New(PetscPartitioner arg):
 *     cdef Partitioner retv = Partitioner()             # <<<<<<<<<<<<<<
 *     setref(&retv.part, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 350, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscPartitionerObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":351
 * cdef api object PyPetscPartitioner_New(PetscPartitioner arg):
 *     cdef Partitioner retv = Partitioner()
 *     setref(&retv.part, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->part), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 351, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":352
 *     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":349
 * # -- 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_XDECREF(__pyx_t_2);
  __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":354
 *     return retv
 * 
 * cdef api PetscPartitioner PyPetscPartitioner_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscPartitioner retv = NULL
 *     cdef Partitioner ob = <Partitioner?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":355
 * 
 * cdef api PetscPartitioner PyPetscPartitioner_Get(object arg) except ? NULL:
 *     cdef PetscPartitioner retv = NULL             # <<<<<<<<<<<<<<
 *     cdef Partitioner ob = <Partitioner?> arg
 *     retv = ob.part
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":356
 * cdef api PetscPartitioner PyPetscPartitioner_Get(object arg) except ? NULL:
 *     cdef PetscPartitioner retv = NULL
 *     cdef Partitioner ob = <Partitioner?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.part
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner)))) __PYX_ERR(67, 356, __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":357
 *     cdef PetscPartitioner retv = NULL
 *     cdef Partitioner ob = <Partitioner?> arg
 *     retv = ob.part             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->part;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":358
 *     cdef Partitioner ob = <Partitioner?> arg
 *     retv = ob.part
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- FE --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":354
 *     return retv
 * 
 * cdef api PetscPartitioner PyPetscPartitioner_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscPartitioner retv = NULL
 *     cdef Partitioner ob = <Partitioner?> 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":362
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscFE_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":363
 * 
 * cdef api object PyPetscFE_New(PetscFE arg):
 *     cdef FE retv = FE()             # <<<<<<<<<<<<<<
 *     setref(&retv.fe, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 363, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscFEObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":364
 * cdef api object PyPetscFE_New(PetscFE arg):
 *     cdef FE retv = FE()
 *     setref(&retv.fe, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->fe), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 364, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":365
 *     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":362
 * # -- 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_XDECREF(__pyx_t_2);
  __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":367
 *     return retv
 * 
 * cdef api PetscFE PyPetscFE_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscFE retv = NULL
 *     cdef FE ob = <FE?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":368
 * 
 * cdef api PetscFE PyPetscFE_Get(object arg) except ? NULL:
 *     cdef PetscFE retv = NULL             # <<<<<<<<<<<<<<
 *     cdef FE ob = <FE?> arg
 *     retv = ob.fe
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":369
 * cdef api PetscFE PyPetscFE_Get(object arg) except ? NULL:
 *     cdef PetscFE retv = NULL
 *     cdef FE ob = <FE?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.fe
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE)))) __PYX_ERR(67, 369, __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":370
 *     cdef PetscFE retv = NULL
 *     cdef FE ob = <FE?> arg
 *     retv = ob.fe             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->fe;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":371
 *     cdef FE ob = <FE?> arg
 *     retv = ob.fe
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- QUAD --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":367
 *     return retv
 * 
 * cdef api PetscFE PyPetscFE_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscFE retv = NULL
 *     cdef FE ob = <FE?> 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":375
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscQuad_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":376
 * 
 * cdef api object PyPetscQuad_New(PetscQuadrature arg):
 *     cdef Quad retv = Quad()             # <<<<<<<<<<<<<<
 *     setref(&retv.quad, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 376, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscQuadObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":377
 * cdef api object PyPetscQuad_New(PetscQuadrature arg):
 *     cdef Quad retv = Quad()
 *     setref(&retv.quad, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->quad), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 377, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":378
 *     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":375
 * # -- 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_XDECREF(__pyx_t_2);
  __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":380
 *     return retv
 * 
 * cdef api PetscQuadrature PyPetscQuad_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscQuadrature retv = NULL
 *     cdef Quad ob = <Quad?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":381
 * 
 * cdef api PetscQuadrature PyPetscQuad_Get(object arg) except ? NULL:
 *     cdef PetscQuadrature retv = NULL             # <<<<<<<<<<<<<<
 *     cdef Quad ob = <Quad?> arg
 *     retv = ob.quad
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":382
 * cdef api PetscQuadrature PyPetscQuad_Get(object arg) except ? NULL:
 *     cdef PetscQuadrature retv = NULL
 *     cdef Quad ob = <Quad?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.quad
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad)))) __PYX_ERR(67, 382, __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":383
 *     cdef PetscQuadrature retv = NULL
 *     cdef Quad ob = <Quad?> arg
 *     retv = ob.quad             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->quad;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":384
 *     cdef Quad ob = <Quad?> arg
 *     retv = ob.quad
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- DMLabel --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":380
 *     return retv
 * 
 * cdef api PetscQuadrature PyPetscQuad_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscQuadrature retv = NULL
 *     cdef Quad ob = <Quad?> 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":388
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscDMLabel_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":389
 * 
 * cdef api object PyPetscDMLabel_New(PetscDMLabel arg):
 *     cdef DMLabel retv = DMLabel()             # <<<<<<<<<<<<<<
 *     setref(&retv.dmlabel, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 389, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscDMLabelObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":390
 * cdef api object PyPetscDMLabel_New(PetscDMLabel arg):
 *     cdef DMLabel retv = DMLabel()
 *     setref(&retv.dmlabel, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->dmlabel), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 390, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":391
 *     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":388
 * # -- 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_XDECREF(__pyx_t_2);
  __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":393
 *     return retv
 * 
 * cdef api PetscDMLabel PyPetscDMLabel_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscDMLabel retv = NULL
 *     cdef DMLabel ob = <DMLabel?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":394
 * 
 * cdef api PetscDMLabel PyPetscDMLabel_Get(object arg) except ? NULL:
 *     cdef PetscDMLabel retv = NULL             # <<<<<<<<<<<<<<
 *     cdef DMLabel ob = <DMLabel?> arg
 *     retv = ob.dmlabel
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":395
 * cdef api PetscDMLabel PyPetscDMLabel_Get(object arg) except ? NULL:
 *     cdef PetscDMLabel retv = NULL
 *     cdef DMLabel ob = <DMLabel?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.dmlabel
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel)))) __PYX_ERR(67, 395, __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":396
 *     cdef PetscDMLabel retv = NULL
 *     cdef DMLabel ob = <DMLabel?> arg
 *     retv = ob.dmlabel             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->dmlabel;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":397
 *     cdef DMLabel ob = <DMLabel?> arg
 *     retv = ob.dmlabel
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":393
 *     return retv
 * 
 * cdef api PetscDMLabel PyPetscDMLabel_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscDMLabel retv = NULL
 *     cdef DMLabel ob = <DMLabel?> 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":402
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscSpace_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":403
 * 
 * cdef api object PyPetscSpace_New(PetscSpace arg):
 *     cdef Space retv = Space()             # <<<<<<<<<<<<<<
 *     setref(&retv.space, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 403, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscSpaceObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":404
 * cdef api object PyPetscSpace_New(PetscSpace arg):
 *     cdef Space retv = Space()
 *     setref(&retv.space, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->space), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 404, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":405
 *     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":402
 * # -- 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_XDECREF(__pyx_t_2);
  __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":407
 *     return retv
 * 
 * cdef api PetscSpace PyPetscSpace_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscSpace retv = NULL
 *     cdef Space ob = <Space?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":408
 * 
 * cdef api PetscSpace PyPetscSpace_Get(object arg) except ? NULL:
 *     cdef PetscSpace retv = NULL             # <<<<<<<<<<<<<<
 *     cdef Space ob = <Space?> arg
 *     retv = ob.space
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":409
 * cdef api PetscSpace PyPetscSpace_Get(object arg) except ? NULL:
 *     cdef PetscSpace retv = NULL
 *     cdef Space ob = <Space?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.space
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space)))) __PYX_ERR(67, 409, __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":410
 *     cdef PetscSpace retv = NULL
 *     cdef Space ob = <Space?> arg
 *     retv = ob.space             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->space;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":411
 *     cdef Space ob = <Space?> arg
 *     retv = ob.space
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- DUALSPACE --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":407
 *     return retv
 * 
 * cdef api PetscSpace PyPetscSpace_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscSpace retv = NULL
 *     cdef Space ob = <Space?> 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":415
 * # -- 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;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscDualSpace_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":416
 * 
 * cdef api object PyPetscDualSpace_New(PetscDualSpace arg):
 *     cdef DualSpace retv = DualSpace()             # <<<<<<<<<<<<<<
 *     setref(&retv.dualspace, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 416, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscDualSpaceObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":417
 * cdef api object PyPetscDualSpace_New(PetscDualSpace arg):
 *     cdef DualSpace retv = DualSpace()
 *     setref(&retv.dualspace, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->dualspace), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 417, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":418
 *     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":415
 * # -- 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_XDECREF(__pyx_t_2);
  __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":420
 *     return retv
 * 
 * cdef api PetscDualSpace PyPetscDualSpace_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscDualSpace retv = NULL
 *     cdef DualSpace ob = <DualSpace?> 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", 0);

  /* "petsc4py/PETSc/CAPI.pyx":421
 * 
 * cdef api PetscDualSpace PyPetscDualSpace_Get(object arg) except ? NULL:
 *     cdef PetscDualSpace retv = NULL             # <<<<<<<<<<<<<<
 *     cdef DualSpace ob = <DualSpace?> arg
 *     retv = ob.dualspace
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":422
 * cdef api PetscDualSpace PyPetscDualSpace_Get(object arg) except ? NULL:
 *     cdef PetscDualSpace retv = NULL
 *     cdef DualSpace ob = <DualSpace?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.dualspace
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace)))) __PYX_ERR(67, 422, __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":423
 *     cdef PetscDualSpace retv = NULL
 *     cdef DualSpace ob = <DualSpace?> arg
 *     retv = ob.dualspace             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->dualspace;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":424
 *     cdef DualSpace ob = <DualSpace?> arg
 *     retv = ob.dualspace
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- DMSwarmCellDM --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":420
 *     return retv
 * 
 * cdef api PetscDualSpace PyPetscDualSpace_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscDualSpace retv = NULL
 *     cdef DualSpace ob = <DualSpace?> 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/CAPI.pyx":428
 * # -- DMSwarmCellDM --
 * 
 * cdef api object PyPetscDMSwarmCellDM_New(PetscDMSwarmCellDM arg):             # <<<<<<<<<<<<<<
 *     cdef CellDM retv = CellDM()
 *     setref(&retv.cdm, arg)
*/

static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscDMSwarmCellDM_New(DMSwarmCellDM __pyx_v_arg) {
  struct PyPetscDMSwarmCellDMObject *__pyx_v_retv = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscDMSwarmCellDM_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":429
 * 
 * cdef api object PyPetscDMSwarmCellDM_New(PetscDMSwarmCellDM arg):
 *     cdef CellDM retv = CellDM()             # <<<<<<<<<<<<<<
 *     setref(&retv.cdm, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_CellDM, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 429, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscDMSwarmCellDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":430
 * cdef api object PyPetscDMSwarmCellDM_New(PetscDMSwarmCellDM arg):
 *     cdef CellDM retv = CellDM()
 *     setref(&retv.cdm, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->cdm), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 430, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":431
 *     cdef CellDM retv = CellDM()
 *     setref(&retv.cdm, arg)
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * cdef api PetscDMSwarmCellDM PyPetscDMSwarmCellDM_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":428
 * # -- DMSwarmCellDM --
 * 
 * cdef api object PyPetscDMSwarmCellDM_New(PetscDMSwarmCellDM arg):             # <<<<<<<<<<<<<<
 *     cdef CellDM retv = CellDM()
 *     setref(&retv.cdm, arg)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDMSwarmCellDM_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":433
 *     return retv
 * 
 * cdef api PetscDMSwarmCellDM PyPetscDMSwarmCellDM_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscDMSwarmCellDM retv = NULL
 *     cdef CellDM ob = <CellDM?> arg
*/

static DMSwarmCellDM __pyx_f_8petsc4py_5PETSc_PyPetscDMSwarmCellDM_Get(PyObject *__pyx_v_arg) {
  DMSwarmCellDM __pyx_v_retv;
  struct PyPetscDMSwarmCellDMObject *__pyx_v_ob = 0;
  DMSwarmCellDM __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  DMSwarmCellDM __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscDMSwarmCellDM_Get", 0);

  /* "petsc4py/PETSc/CAPI.pyx":434
 * 
 * cdef api PetscDMSwarmCellDM PyPetscDMSwarmCellDM_Get(object arg) except ? NULL:
 *     cdef PetscDMSwarmCellDM retv = NULL             # <<<<<<<<<<<<<<
 *     cdef CellDM ob = <CellDM?> arg
 *     retv = ob.cdm
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":435
 * cdef api PetscDMSwarmCellDM PyPetscDMSwarmCellDM_Get(object arg) except ? NULL:
 *     cdef PetscDMSwarmCellDM retv = NULL
 *     cdef CellDM ob = <CellDM?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.cdm
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_CellDM)))) __PYX_ERR(67, 435, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_arg;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_ob = ((struct PyPetscDMSwarmCellDMObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":436
 *     cdef PetscDMSwarmCellDM retv = NULL
 *     cdef CellDM ob = <CellDM?> arg
 *     retv = ob.cdm             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->cdm;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":437
 *     cdef CellDM ob = <CellDM?> arg
 *     retv = ob.cdm
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # -- PetscRegressor --
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":433
 *     return retv
 * 
 * cdef api PetscDMSwarmCellDM PyPetscDMSwarmCellDM_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscDMSwarmCellDM retv = NULL
 *     cdef CellDM ob = <CellDM?> arg
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("petsc4py.PETSc.PyPetscDMSwarmCellDM_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":441
 * # -- PetscRegressor --
 * 
 * cdef api object PyPetscRegressor_New(PetscRegressor arg):             # <<<<<<<<<<<<<<
 *     cdef Regressor retv = Regressor()
 *     setref(&retv.regressor, arg)
*/

static PyObject *__pyx_f_8petsc4py_5PETSc_PyPetscRegressor_New(PetscRegressor __pyx_v_arg) {
  struct PyPetscRegressorObject *__pyx_v_retv = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  size_t __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscRegressor_New", 0);

  /* "petsc4py/PETSc/CAPI.pyx":442
 * 
 * cdef api object PyPetscRegressor_New(PetscRegressor arg):
 *     cdef Regressor retv = Regressor()             # <<<<<<<<<<<<<<
 *     setref(&retv.regressor, arg)
 *     return retv
*/
  __pyx_t_2 = NULL;
  __pyx_t_3 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(67, 442, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_v_retv = ((struct PyPetscRegressorObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":443
 * cdef api object PyPetscRegressor_New(PetscRegressor arg):
 *     cdef Regressor retv = Regressor()
 *     setref(&retv.regressor, arg)             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_setref((&__pyx_v_retv->regressor), __pyx_v_arg); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(67, 443, __pyx_L1_error)

  /* "petsc4py/PETSc/CAPI.pyx":444
 *     cdef Regressor retv = Regressor()
 *     setref(&retv.regressor, arg)
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * cdef api PetscRegressor PyPetscRegressor_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":441
 * # -- PetscRegressor --
 * 
 * cdef api object PyPetscRegressor_New(PetscRegressor arg):             # <<<<<<<<<<<<<<
 *     cdef Regressor retv = Regressor()
 *     setref(&retv.regressor, arg)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.PyPetscRegressor_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":446
 *     return retv
 * 
 * cdef api PetscRegressor PyPetscRegressor_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscRegressor retv = NULL
 *     cdef Regressor ob = <Regressor?> arg
*/

static PetscRegressor __pyx_f_8petsc4py_5PETSc_PyPetscRegressor_Get(PyObject *__pyx_v_arg) {
  PetscRegressor __pyx_v_retv;
  struct PyPetscRegressorObject *__pyx_v_ob = 0;
  PetscRegressor __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PetscRegressor __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PyPetscRegressor_Get", 0);

  /* "petsc4py/PETSc/CAPI.pyx":447
 * 
 * cdef api PetscRegressor PyPetscRegressor_Get(object arg) except ? NULL:
 *     cdef PetscRegressor retv = NULL             # <<<<<<<<<<<<<<
 *     cdef Regressor ob = <Regressor?> arg
 *     retv = ob.regressor
*/
  __pyx_v_retv = NULL;

  /* "petsc4py/PETSc/CAPI.pyx":448
 * cdef api PetscRegressor PyPetscRegressor_Get(object arg) except ? NULL:
 *     cdef PetscRegressor retv = NULL
 *     cdef Regressor ob = <Regressor?> arg             # <<<<<<<<<<<<<<
 *     retv = ob.regressor
 *     return retv
*/
  if (!(likely(__Pyx_TypeTest(__pyx_v_arg, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor)))) __PYX_ERR(67, 448, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_arg;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_ob = ((struct PyPetscRegressorObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/CAPI.pyx":449
 *     cdef PetscRegressor retv = NULL
 *     cdef Regressor ob = <Regressor?> arg
 *     retv = ob.regressor             # <<<<<<<<<<<<<<
 *     return retv
 * 
*/
  __pyx_t_2 = __pyx_v_ob->regressor;
  __pyx_v_retv = __pyx_t_2;

  /* "petsc4py/PETSc/CAPI.pyx":450
 *     cdef Regressor ob = <Regressor?> arg
 *     retv = ob.regressor
 *     return retv             # <<<<<<<<<<<<<<
 * 
 * # ---------------------------------------------------------------------
*/
  __pyx_r = __pyx_v_retv;
  goto __pyx_L0;

  /* "petsc4py/PETSc/CAPI.pyx":446
 *     return retv
 * 
 * cdef api PetscRegressor PyPetscRegressor_Get(object arg) except ? NULL:             # <<<<<<<<<<<<<<
 *     cdef PetscRegressor retv = NULL
 *     cdef Regressor ob = <Regressor?> arg
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("petsc4py.PETSc.PyPetscRegressor_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":34
 * 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":36
 * 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":37
 *     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":38
 *     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":39
 *     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":40
 *     istack += 1
 *     if istack >= 1024:
 *         istack = 0             # <<<<<<<<<<<<<<
 *     return
 * 
*/
    __pyx_v_8petsc4py_5PETSc_istack = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":39
 *     fstack[istack] = FUNCT
 *     istack += 1
 *     if istack >= 1024:             # <<<<<<<<<<<<<<
 *         istack = 0
 *     return
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":41
 *     if istack >= 1024:
 *         istack = 0
 *     return             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscErrorCode FunctionEnd() noexcept nogil:
*/
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":34
 * 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":43
 *     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":45
 * 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":46
 *     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":47
 *     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":48
 *     istack -= 1
 *     if istack < 0:
 *         istack = 1024             # <<<<<<<<<<<<<<
 *     FUNCT = fstack[istack]
 *     return PETSC_SUCCESS
*/
    __pyx_v_8petsc4py_5PETSc_istack = 0x400;

    /* "petsc4py/PETSc/libpetsc4py.pyx":47
 *     FUNCT = NULL
 *     istack -= 1
 *     if istack < 0:             # <<<<<<<<<<<<<<
 *         istack = 1024
 *     FUNCT = fstack[istack]
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":49
 *     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":50
 *         istack = 1024
 *     FUNCT = fstack[istack]
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode PetscSETERR(PetscErrorCode ierr, const char msg[]) noexcept nogil:
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":43
 *     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":52
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode PetscSETERR(PetscErrorCode ierr, const char msg[]) noexcept nogil:             # <<<<<<<<<<<<<<
 *     global istack, fstack
 *     istack = 0
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscSETERR(PetscErrorCode __pyx_v_ierr, char const *__pyx_v_msg) {
  PetscErrorCode __pyx_r;

  /* "petsc4py/PETSc/libpetsc4py.pyx":54
 * cdef PetscErrorCode PetscSETERR(PetscErrorCode ierr, const 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":55
 *     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":56
 *     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":52
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode PetscSETERR(PetscErrorCode ierr, const char msg[]) noexcept nogil:             # <<<<<<<<<<<<<<
 *     global istack, fstack
 *     istack = 0
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":59
 *                       PETSC_ERROR_INITIAL, msg, NULL)
 * 
 * cdef PetscErrorCode UNSUPPORTED(const 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 const *__pyx_v_msg) {
  PetscErrorCode __pyx_r;

  /* "petsc4py/PETSc/libpetsc4py.pyx":60
 * 
 * cdef PetscErrorCode UNSUPPORTED(const 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":59
 *                       PETSC_ERROR_INITIAL, msg, NULL)
 * 
 * cdef PetscErrorCode UNSUPPORTED(const 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":65
 * # --------------------------------------------------------------------
 * 
 * cdef inline PetscInt getRef(void *pobj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef PetscObject obj = <PetscObject>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":66
 * 
 * cdef inline PetscInt getRef(void *pobj) noexcept nogil:
 *     cdef PetscObject obj = <PetscObject>pobj             # <<<<<<<<<<<<<<
 *     if obj == NULL: return 0
 *     else: return obj.refct
*/
  __pyx_v_obj = ((PetscObject)__pyx_v_pobj);

  /* "petsc4py/PETSc/libpetsc4py.pyx":67
 * cdef inline PetscInt getRef(void *pobj) noexcept nogil:
 *     cdef PetscObject obj = <PetscObject>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":68
 *     cdef PetscObject obj = <PetscObject>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":65
 * # --------------------------------------------------------------------
 * 
 * cdef inline PetscInt getRef(void *pobj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef PetscObject obj = <PetscObject>pobj
 *     if obj == NULL: return 0
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":70
 *     else: return obj.refct
 * 
 * cdef inline void addRef(void *pobj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef PetscObject obj = <PetscObject>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":71
 * 
 * cdef inline void addRef(void *pobj) noexcept nogil:
 *     cdef PetscObject obj = <PetscObject>pobj             # <<<<<<<<<<<<<<
 *     if obj != NULL: obj.refct += 1
 * 
*/
  __pyx_v_obj = ((PetscObject)__pyx_v_pobj);

  /* "petsc4py/PETSc/libpetsc4py.pyx":72
 * cdef inline void addRef(void *pobj) noexcept nogil:
 *     cdef PetscObject obj = <PetscObject>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":70
 *     else: return obj.refct
 * 
 * cdef inline void addRef(void *pobj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef PetscObject obj = <PetscObject>pobj
 *     if obj != NULL: obj.refct += 1
*/

  /* function exit code */
}

/* "petsc4py/PETSc/libpetsc4py.pyx":74
 *     if obj != NULL: obj.refct += 1
 * 
 * cdef inline void delRef(void *pobj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef PetscObject obj = <PetscObject>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":75
 * 
 * cdef inline void delRef(void *pobj) noexcept nogil:
 *     cdef PetscObject obj = <PetscObject>pobj             # <<<<<<<<<<<<<<
 *     if obj != NULL: obj.refct -= 1
 * 
*/
  __pyx_v_obj = ((PetscObject)__pyx_v_pobj);

  /* "petsc4py/PETSc/libpetsc4py.pyx":76
 * cdef inline void delRef(void *pobj) noexcept nogil:
 *     cdef PetscObject obj = <PetscObject>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":74
 *     if obj != NULL: obj.refct += 1
 * 
 * cdef inline void delRef(void *pobj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef PetscObject obj = <PetscObject>pobj
 *     if obj != NULL: obj.refct -= 1
*/

  /* function exit code */
}

/* "petsc4py/PETSc/libpetsc4py.pyx":78
 *     if obj != NULL: obj.refct -= 1
 * 
 * cdef inline PetscObject newRef(void *pobj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef PetscObject obj = <PetscObject>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":79
 * 
 * cdef inline PetscObject newRef(void *pobj) noexcept nogil:
 *     cdef PetscObject obj = <PetscObject>pobj             # <<<<<<<<<<<<<<
 *     cdef int ierr = 0
 *     if obj != NULL:
*/
  __pyx_v_obj = ((PetscObject)__pyx_v_pobj);

  /* "petsc4py/PETSc/libpetsc4py.pyx":80
 * cdef inline PetscObject newRef(void *pobj) noexcept nogil:
 *     cdef PetscObject obj = <PetscObject>pobj
 *     cdef int ierr = 0             # <<<<<<<<<<<<<<
 *     if obj != NULL:
 *         ierr = PetscObjectReference(obj)
*/
  __pyx_v_ierr = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":81
 *     cdef PetscObject obj = <PetscObject>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":82
 *     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":83
 *     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":81
 *     cdef PetscObject obj = <PetscObject>pobj
 *     cdef int ierr = 0
 *     if obj != NULL:             # <<<<<<<<<<<<<<
 *         ierr = PetscObjectReference(obj)
 *         if ierr: return NULL # XXX warning!
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":84
 *         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":78
 *     if obj != NULL: obj.refct -= 1
 * 
 * cdef inline PetscObject newRef(void *pobj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef PetscObject obj = <PetscObject>pobj
 *     cdef int ierr = 0
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":86
 *     return obj
 * 
 * cdef inline const char* getPrefix(void *pobj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef PetscObject obj = <PetscObject>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":87
 * 
 * cdef inline const char* getPrefix(void *pobj) noexcept nogil:
 *     cdef PetscObject obj = <PetscObject>pobj             # <<<<<<<<<<<<<<
 *     if obj == NULL: return NULL
 *     return obj.prefix
*/
  __pyx_v_obj = ((PetscObject)__pyx_v_pobj);

  /* "petsc4py/PETSc/libpetsc4py.pyx":88
 * cdef inline const char* getPrefix(void *pobj) noexcept nogil:
 *     cdef PetscObject obj = <PetscObject>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":89
 *     cdef PetscObject obj = <PetscObject>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":86
 *     return obj
 * 
 * cdef inline const char* getPrefix(void *pobj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef PetscObject obj = <PetscObject>pobj
 *     if obj == NULL: return NULL
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":91
 *     return obj.prefix
 * 
 * cdef inline int getCommSize(void *pobj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef PetscObject obj = <PetscObject>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":92
 * 
 * cdef inline int getCommSize(void *pobj) noexcept nogil:
 *     cdef PetscObject obj = <PetscObject>pobj             # <<<<<<<<<<<<<<
 *     if obj == NULL: return 0
 *     cdef int size = 0
*/
  __pyx_v_obj = ((PetscObject)__pyx_v_pobj);

  /* "petsc4py/PETSc/libpetsc4py.pyx":93
 * cdef inline int getCommSize(void *pobj) noexcept nogil:
 *     cdef PetscObject obj = <PetscObject>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":94
 *     cdef PetscObject obj = <PetscObject>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":95
 *     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":96
 *     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":91
 *     return obj.prefix
 * 
 * cdef inline int getCommSize(void *pobj) noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef PetscObject obj = <PetscObject>pobj
 *     if obj == NULL: return 0
*/

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":98
 *     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_", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":99
 * 
 * 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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 99, __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":100
 * 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":101
 *     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":98
 *     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":103
 *     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_", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":104
 * 
 * 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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 104, __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":105
 * 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":106
 *     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":103
 *     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":108
 *     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_", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":109
 * 
 * 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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 109, __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":110
 * 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":111
 *     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":108
 *     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":113
 *     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_", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":114
 * 
 * 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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 114, __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":115
 * 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":116
 *     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":113
 *     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":118
 *     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_", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":119
 * 
 * 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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 119, __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":120
 * 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":121
 *     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":118
 *     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":123
 *     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_", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":124
 * 
 * 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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 124, __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":125
 * 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":126
 *     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":123
 *     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":128
 *     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_", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":129
 * 
 * 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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 129, __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":130
 * 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":131
 *     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":128
 *     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":133
 *     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_", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":134
 * 
 * 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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 134, __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":135
 * 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":136
 *     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":133
 *     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":138
 *     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_", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":139
 * 
 * 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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 139, __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":140
 * 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":141
 *     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":138
 *     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":145
 * # --------------------------------------------------------------------
 * 
 * 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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":146
 * 
 * cdef object parse_url(object url):
 *     path, name = url.rsplit(":", 1)             # <<<<<<<<<<<<<<
 *     return (path, name)
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_url, __pyx_mstate_global->__pyx_n_u_rsplit); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_mstate_global->__pyx_tuple[9], NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 146, __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(5, 146, __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_INCREF(__pyx_t_1);
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_3);
    } else {
      __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 146, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 146, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_3);
    }
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 146, __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(5, 146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(5, 146, __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(5, 146, __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":147
 * 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(5, 147, __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) != (0)) __PYX_ERR(5, 147, __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) != (0)) __PYX_ERR(5, 147, __pyx_L1_error);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":145
 * # --------------------------------------------------------------------
 * 
 * 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":151
 * 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_code = 0;
  PyObject *__pyx_v_source = 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;
  size_t __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;
  int __pyx_t_15;
  int __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("load_module", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":152
 * 
 * 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(5, 152, __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(5, 152, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":153
 * 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(5, 153, __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(5, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":152
 * 
 * cdef object load_module(object path):
 *     if path in module_cache:             # <<<<<<<<<<<<<<
 *         return module_cache[path]
 *     module = PyModule_New("__petsc__")
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":154
 *     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(5, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_module = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":155
 *         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_mstate_global->__pyx_n_u_file, __pyx_v_path) < (0)) __PYX_ERR(5, 155, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":156
 *     module = PyModule_New("__petsc__")
 *     module.__file__ = path
 *     module.__package__ = None             # <<<<<<<<<<<<<<
 *     module_cache[path] = module
 *     cdef object code = None
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_module, __pyx_mstate_global->__pyx_n_u_package_2, Py_None) < (0)) __PYX_ERR(5, 156, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":157
 *     module.__file__ = path
 *     module.__package__ = None
 *     module_cache[path] = module             # <<<<<<<<<<<<<<
 *     cdef object code = None
 *     try:
*/
  if (unlikely(__pyx_v_8petsc4py_5PETSc_module_cache == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(5, 157, __pyx_L1_error)
  }
  if (unlikely((PyDict_SetItem(__pyx_v_8petsc4py_5PETSc_module_cache, __pyx_v_path, __pyx_v_module) < 0))) __PYX_ERR(5, 157, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":158
 *     module.__package__ = None
 *     module_cache[path] = module
 *     cdef object code = None             # <<<<<<<<<<<<<<
 *     try:
 *         with open(path, 'r') as source:
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_code = Py_None;

  /* "petsc4py/PETSc/libpetsc4py.pyx":159
 *     module_cache[path] = module
 *     cdef object code = None
 *     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":160
 *     cdef object code = None
 *     try:
 *         with open(path, 'r') as source:             # <<<<<<<<<<<<<<
 *             code = compile(source.read(), path, 'exec')
 *         exec(code, module.__dict__)
*/
      /*with:*/ {
        __pyx_t_6 = NULL;
        __pyx_t_7 = 1;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_path, __pyx_mstate_global->__pyx_n_u_r};
          __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_open, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 160, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 160, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = NULL;
        __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 160, __pyx_L10_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_7 = 1;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
          assert(__pyx_t_9);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
          __pyx_t_7 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
          __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_10, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 160, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __pyx_t_10 = __pyx_t_6;
        __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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_10;
              __pyx_t_10 = 0;

              /* "petsc4py/PETSc/libpetsc4py.pyx":161
 *     try:
 *         with open(path, 'r') as source:
 *             code = compile(source.read(), path, 'exec')             # <<<<<<<<<<<<<<
 *         exec(code, module.__dict__)
 *     except Exception:
*/
              __pyx_t_2 = NULL;
              __pyx_t_9 = __pyx_v_source;
              __Pyx_INCREF(__pyx_t_9);
              __pyx_t_7 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
                __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_read, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
                if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 161, __pyx_L14_error)
                __Pyx_GOTREF(__pyx_t_6);
              }
              __pyx_t_7 = 1;
              {
                PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_6, __pyx_v_path, __pyx_mstate_global->__pyx_n_u_exec};
                __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_compile, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 161, __pyx_L14_error)
                __Pyx_GOTREF(__pyx_t_10);
              }
              __Pyx_DECREF_SET(__pyx_v_code, __pyx_t_10);
              __pyx_t_10 = 0;

              /* "petsc4py/PETSc/libpetsc4py.pyx":160
 *     cdef object code = None
 *     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_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 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_10, &__pyx_t_6, &__pyx_t_2) < 0) __PYX_ERR(5, 160, __pyx_L16_except_error)
              __Pyx_XGOTREF(__pyx_t_10);
              __Pyx_XGOTREF(__pyx_t_6);
              __Pyx_XGOTREF(__pyx_t_2);
              __pyx_t_9 = PyTuple_Pack(3, __pyx_t_10, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 160, __pyx_L16_except_error)
              __Pyx_GOTREF(__pyx_t_9);
              __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL);
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 160, __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(5, 160, __pyx_L16_except_error)
              __pyx_t_15 = (!__pyx_t_1);
              if (unlikely(__pyx_t_15)) {
                __Pyx_GIVEREF(__pyx_t_10);
                __Pyx_GIVEREF(__pyx_t_6);
                __Pyx_XGIVEREF(__pyx_t_2);
                __Pyx_ErrRestoreWithState(__pyx_t_10, __pyx_t_6, __pyx_t_2);
                __pyx_t_10 = 0;  __pyx_t_6 = 0;  __pyx_t_2 = 0; 
                __PYX_ERR(5, 160, __pyx_L16_except_error)
              }
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 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_8) {
              __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[4], NULL);
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 160, __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_8); __pyx_t_8 = 0;
        goto __pyx_L4_error;
        __pyx_L23:;
      }

      /* "petsc4py/PETSc/libpetsc4py.pyx":162
 *         with open(path, 'r') as source:
 *             code = compile(source.read(), path, 'exec')
 *         exec(code, module.__dict__)             # <<<<<<<<<<<<<<
 *     except Exception:
 *         del module_cache[path]
*/
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_module, __pyx_mstate_global->__pyx_n_u_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 162, __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(5, 162, __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":159
 *     module_cache[path] = module
 *     cdef object code = None
 *     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_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":163
 *             code = compile(source.read(), path, 'exec')
 *         exec(code, module.__dict__)
 *     except Exception:             # <<<<<<<<<<<<<<
 *         del module_cache[path]
 *         raise
*/
    __pyx_t_16 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_16) {
      __Pyx_AddTraceback("petsc4py.PETSc.load_module", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_10) < 0) __PYX_ERR(5, 163, __pyx_L6_except_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_10);

      /* "petsc4py/PETSc/libpetsc4py.pyx":164
 *         exec(code, module.__dict__)
 *     except Exception:
 *         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(5, 164, __pyx_L6_except_error)
      }
      if (unlikely((PyDict_DelItem(__pyx_v_8petsc4py_5PETSc_module_cache, __pyx_v_path) < 0))) __PYX_ERR(5, 164, __pyx_L6_except_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":165
 *     except Exception:
 *         del module_cache[path]
 *         raise             # <<<<<<<<<<<<<<
 *     return module
 * 
*/
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_2, __pyx_t_10);
      __pyx_t_6 = 0;  __pyx_t_2 = 0;  __pyx_t_10 = 0; 
      __PYX_ERR(5, 165, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;

    /* "petsc4py/PETSc/libpetsc4py.pyx":159
 *     module_cache[path] = module
 *     cdef object code = None
 *     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":166
 *         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":151
 * 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __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_code);
  __Pyx_XDECREF(__pyx_v_source);
  __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__", 0);

  /* "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(5, 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 == <void*>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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setcontext", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":182
 *     cdef int setcontext(self, void *ctx, Object base) except -1:
 *         #
 *         if ctx == <void*>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 == <void*>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 == <void*>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_mstate_global->__pyx_n_u_destroy); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 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_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_destroy);
    __pyx_t_4 = __pyx_v_destroy; 
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_base)};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __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 = <object>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 = <object>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 = <object>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 = <object>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_mstate_global->__pyx_n_u_create); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 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_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_create);
    __pyx_t_3 = __pyx_v_create; 
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_base)};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __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 == <void*>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] = <void*> 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] = <void*> 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] = <void*> 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] = <void*> self.self
 *         else:
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":208
 *             ctx[0] = <void*> 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, const 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, const 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 const *__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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":212
 * 
 *     cdef int setname(self, const 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, const 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(5, 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, const 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, const 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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getname", 0);

  /* "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(5, 222, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->name); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(5, 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_mstate_global->__pyx_n_u_name_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 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_mstate_global->__pyx_n_u_module, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 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_mstate_global->__pyx_n_u_class, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 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(5, 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_mstate_global->__pyx_n_u_name_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 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(5, 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_mstate_global->__pyx_n_u_module, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 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(5, 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(5, 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_mstate_global->__pyx_kp_u__2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 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(5, 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(5, 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(5, 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_v_name;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_6 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 242, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_5))) __PYX_ERR(5, 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(5, 244, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->name); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(5, 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(const 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_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(const char name_p[]):             # <<<<<<<<<<<<<<
 *     if name_p == NULL: return None
 *     cdef name = bytes2str(name_p)
*/

static PyObject *__pyx_f_8petsc4py_5PETSc_createcontext(char const *__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 *);
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("createcontext", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":248
 * 
 * cdef createcontext(const char name_p[]):
 *     if name_p == NULL: return None             # <<<<<<<<<<<<<<
 *     cdef name = bytes2str(name_p)
 *     cdef mod
*/
  __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(const char name_p[]):
 *     if name_p == NULL: return None
 *     cdef name = bytes2str(name_p)             # <<<<<<<<<<<<<<
 *     cdef mod
 *     cdef path
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_name_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_name = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":252
 *     cdef mod
 *     cdef path
 *     cdef modname=None             # <<<<<<<<<<<<<<
 *     cdef cls
 *     cdef attr
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_modname = Py_None;

  /* "petsc4py/PETSc/libpetsc4py.pyx":255
 *     cdef cls
 *     cdef attr
 *     cdef clsname=None             # <<<<<<<<<<<<<<
 *     # path/to/filename.py:{function|class}
 *     if ':' in name:
*/
  __Pyx_INCREF(Py_None);
  __pyx_v_clsname = Py_None;

  /* "petsc4py/PETSc/libpetsc4py.pyx":257
 *     cdef 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_mstate_global->__pyx_kp_u__8, __pyx_v_name, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 257, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":258
 *     # 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(5, 258, __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(5, 258, __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_INCREF(__pyx_t_3);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 258, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 258, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 258, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 258, __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(5, 258, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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(5, 258, __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(5, 258, __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":259
 *     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(5, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_mod = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":260
 *         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(5, 260, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/libpetsc4py.pyx":261
 *         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(5, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_cls = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "petsc4py/PETSc/libpetsc4py.pyx":262
 *         if attr:
 *             cls = getattr(mod, attr)
 *             return cls()             # <<<<<<<<<<<<<<
 *         else:
 *             return mod
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_cls);
      __pyx_t_3 = __pyx_v_cls; 
      __pyx_t_7 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_7 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 262, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* "petsc4py/PETSc/libpetsc4py.pyx":260
 *         path, attr = parse_url(name)
 *         mod = load_module(path)
 *         if attr:             # <<<<<<<<<<<<<<
 *             cls = getattr(mod, attr)
 *             return cls()
*/
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":264
 *             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":257
 *     cdef clsname=None
 *     # path/to/filename.py:{function|class}
 *     if ':' in name:             # <<<<<<<<<<<<<<
 *         path, attr = parse_url(name)
 *         mod = load_module(path)
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":266
 *             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_mstate_global->__pyx_kp_u__2, __pyx_v_name, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 266, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":267
 *     # 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_mstate_global->__pyx_n_u_rsplit); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[10], NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    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(5, 267, __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_INCREF(__pyx_t_2);
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_4);
      } else {
        __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 267, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_2);
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 267, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
      }
      #else
      __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __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_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < (0)) __PYX_ERR(5, 267, __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(5, 267, __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_4);
    __pyx_t_4 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":268
 *     if '.' in name:
 *         modname, clsname = name.rsplit('.', 1)
 *         mod = PyImport_Import(modname)             # <<<<<<<<<<<<<<
 *         if hasattr(mod, clsname):
 *             cls = getattr(mod, clsname)
*/
    __pyx_t_3 = PyImport_Import(__pyx_v_modname); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_mod = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":269
 *         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(5, 269, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "petsc4py/PETSc/libpetsc4py.pyx":270
 *         mod = PyImport_Import(modname)
 *         if hasattr(mod, clsname):
 *             cls = getattr(mod, clsname)             # <<<<<<<<<<<<<<
 *             if not PyModule_Check(cls):
 *                 return cls()
*/
      __pyx_t_3 = __Pyx_GetAttr(__pyx_v_mod, __pyx_v_clsname); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 270, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_cls = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "petsc4py/PETSc/libpetsc4py.pyx":271
 *         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":272
 *             cls = getattr(mod, clsname)
 *             if not PyModule_Check(cls):
 *                 return cls()             # <<<<<<<<<<<<<<
 *     # package[.module]
 *     mod = PyImport_Import(name)
*/
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_cls);
        __pyx_t_2 = __pyx_v_cls; 
        __pyx_t_7 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
          assert(__pyx_t_4);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
          __pyx_t_7 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
          __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 272, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __pyx_r = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L0;

        /* "petsc4py/PETSc/libpetsc4py.pyx":271
 *         if hasattr(mod, clsname):
 *             cls = getattr(mod, clsname)
 *             if not PyModule_Check(cls):             # <<<<<<<<<<<<<<
 *                 return cls()
 *     # package[.module]
*/
      }

      /* "petsc4py/PETSc/libpetsc4py.pyx":269
 *         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":266
 *             return mod
 *     # package.module[.{function|class}]
 *     if '.' in name:             # <<<<<<<<<<<<<<
 *         modname, clsname = name.rsplit('.', 1)
 *         mod = PyImport_Import(modname)
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":274
 *                 return cls()
 *     # package[.module]
 *     mod = PyImport_Import(name)             # <<<<<<<<<<<<<<
 *     return mod
 * 
*/
  __pyx_t_3 = PyImport_Import(__pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XDECREF_SET(__pyx_v_mod, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":275
 *     # 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(const 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":277
 *     return mod
 * 
 * cdef int viewcontext(_PyObj ctx, PetscViewer viewer) except -1:             # <<<<<<<<<<<<<<
 *     cdef PetscBool isascii = PETSC_FALSE, isstring = PETSC_FALSE
 *     CHKERR(PetscObjectTypeCompare(<PetscObject>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":278
 * 
 * cdef int viewcontext(_PyObj ctx, PetscViewer viewer) except -1:
 *     cdef PetscBool isascii = PETSC_FALSE, isstring = PETSC_FALSE             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectTypeCompare(<PetscObject>viewer, PETSCVIEWERASCII, &isascii))
 *     CHKERR(PetscObjectTypeCompare(<PetscObject>viewer, PETSCVIEWERSTRING, &isstring))
*/
  __pyx_v_isascii = PETSC_FALSE;
  __pyx_v_isstring = PETSC_FALSE;

  /* "petsc4py/PETSc/libpetsc4py.pyx":279
 * cdef int viewcontext(_PyObj ctx, PetscViewer viewer) except -1:
 *     cdef PetscBool isascii = PETSC_FALSE, isstring = PETSC_FALSE
 *     CHKERR(PetscObjectTypeCompare(<PetscObject>viewer, PETSCVIEWERASCII, &isascii))             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectTypeCompare(<PetscObject>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(5, 279, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":280
 *     cdef PetscBool isascii = PETSC_FALSE, isstring = PETSC_FALSE
 *     CHKERR(PetscObjectTypeCompare(<PetscObject>viewer, PETSCVIEWERASCII, &isascii))
 *     CHKERR(PetscObjectTypeCompare(<PetscObject>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(5, 280, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":281
 *     CHKERR(PetscObjectTypeCompare(<PetscObject>viewer, PETSCVIEWERASCII, &isascii))
 *     CHKERR(PetscObjectTypeCompare(<PetscObject>viewer, PETSCVIEWERSTRING, &isstring))
 *     cdef char *name = ctx.getname()             # <<<<<<<<<<<<<<
 *     if isascii:
 *         if name == NULL: name = b"unknown/not 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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 281, __pyx_L1_error)
  __pyx_v_name = __pyx_t_2;

  /* "petsc4py/PETSc/libpetsc4py.pyx":282
 *     CHKERR(PetscObjectTypeCompare(<PetscObject>viewer, PETSCVIEWERSTRING, &isstring))
 *     cdef char *name = ctx.getname()
 *     if isascii:             # <<<<<<<<<<<<<<
 *         if name == NULL: name = b"unknown/not yet set"
 *         CHKERR(PetscViewerASCIIPrintf(viewer, b"  Python: %s\n", name))
*/
  __pyx_t_3 = (__pyx_v_isascii != 0);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":283
 *     cdef char *name = ctx.getname()
 *     if isascii:
 *         if name == NULL: name = b"unknown/not 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/not yet set");
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":284
 *     if isascii:
 *         if name == NULL: name = b"unknown/not yet set"
 *         CHKERR(PetscViewerASCIIPrintf(viewer, b"  Python: %s\n", name))             # <<<<<<<<<<<<<<
 *     if isstring:
 *         if name == NULL: name = b"<unknown>"
*/
    __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(5, 284, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":282
 *     CHKERR(PetscObjectTypeCompare(<PetscObject>viewer, PETSCVIEWERSTRING, &isstring))
 *     cdef char *name = ctx.getname()
 *     if isascii:             # <<<<<<<<<<<<<<
 *         if name == NULL: name = b"unknown/not yet set"
 *         CHKERR(PetscViewerASCIIPrintf(viewer, b"  Python: %s\n", name))
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":285
 *         if name == NULL: name = b"unknown/not yet set"
 *         CHKERR(PetscViewerASCIIPrintf(viewer, b"  Python: %s\n", name))
 *     if isstring:             # <<<<<<<<<<<<<<
 *         if name == NULL: name = b"<unknown>"
 *         CHKERR(PetscViewerStringSPrintf(viewer, "%s", name))
*/
  __pyx_t_3 = (__pyx_v_isstring != 0);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":286
 *         CHKERR(PetscViewerASCIIPrintf(viewer, b"  Python: %s\n", name))
 *     if isstring:
 *         if name == NULL: name = b"<unknown>"             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerStringSPrintf(viewer, "%s", name))
 *     return 0
*/
    __pyx_t_3 = (__pyx_v_name == NULL);
    if (__pyx_t_3) {
      __pyx_v_name = ((char *)"<unknown>");
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":287
 *     if isstring:
 *         if name == NULL: name = b"<unknown>"
 *         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(5, 287, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":285
 *         if name == NULL: name = b"unknown/not yet set"
 *         CHKERR(PetscViewerASCIIPrintf(viewer, b"  Python: %s\n", name))
 *     if isstring:             # <<<<<<<<<<<<<<
 *         if name == NULL: name = b"<unknown>"
 *         CHKERR(PetscViewerStringSPrintf(viewer, "%s", name))
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":288
 *         if name == NULL: name = b"<unknown>"
 *         CHKERR(PetscViewerStringSPrintf(viewer, "%s", name))
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":277
 *     return mod
 * 
 * cdef int viewcontext(_PyObj ctx, PetscViewer viewer) except -1:             # <<<<<<<<<<<<<<
 *     cdef PetscBool isascii = PETSC_FALSE, isstring = PETSC_FALSE
 *     CHKERR(PetscObjectTypeCompare(<PetscObject>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":310
 *     cdef bytes filename
 * 
 *     cdef int setfilename(self, const char name[]) except -1:             # <<<<<<<<<<<<<<
 *         if name != NULL and name[0] != 0:
 *             self.filename = name
*/

static int __pyx_f_8petsc4py_5PETSc_6_PyVwr_setfilename(struct __pyx_obj_8petsc4py_5PETSc__PyVwr *__pyx_v_self, char const *__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("setfilename", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":311
 * 
 *     cdef int setfilename(self, const char name[]) except -1:
 *         if name != NULL and name[0] != 0:             # <<<<<<<<<<<<<<
 *             self.filename = 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":312
 *     cdef int setfilename(self, const char name[]) except -1:
 *         if name != NULL and name[0] != 0:
 *             self.filename = name             # <<<<<<<<<<<<<<
 *         else:
 *             self.filename = None
*/
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->filename);
    __Pyx_DECREF(__pyx_v_self->filename);
    __pyx_v_self->filename = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":311
 * 
 *     cdef int setfilename(self, const char name[]) except -1:
 *         if name != NULL and name[0] != 0:             # <<<<<<<<<<<<<<
 *             self.filename = name
 *         else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":314
 *             self.filename = name
 *         else:
 *             self.filename = None             # <<<<<<<<<<<<<<
 *         return 0
 * 
*/
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->filename);
    __Pyx_DECREF(__pyx_v_self->filename);
    __pyx_v_self->filename = ((PyObject*)Py_None);
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":315
 *         else:
 *             self.filename = None
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     cdef char* getfilename(self) except? NULL:
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":310
 *     cdef bytes filename
 * 
 *     cdef int setfilename(self, const char name[]) except -1:             # <<<<<<<<<<<<<<
 *         if name != NULL and name[0] != 0:
 *             self.filename = name
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("petsc4py.PETSc._PyVwr.setfilename", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":317
 *         return 0
 * 
 *     cdef char* getfilename(self) except? NULL:             # <<<<<<<<<<<<<<
 *         if self.self is None:
 *             return NULL
*/

static char *__pyx_f_8petsc4py_5PETSc_6_PyVwr_getfilename(struct __pyx_obj_8petsc4py_5PETSc__PyVwr *__pyx_v_self) {
  char *__pyx_r;
  int __pyx_t_1;
  char *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":318
 * 
 *     cdef char* getfilename(self) except? NULL:
 *         if self.self is None:             # <<<<<<<<<<<<<<
 *             return NULL
 *         if self.filename is not None:
*/
  __pyx_t_1 = (__pyx_v_self->__pyx_base.self == Py_None);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":319
 *     cdef char* getfilename(self) except? NULL:
 *         if self.self is None:
 *             return NULL             # <<<<<<<<<<<<<<
 *         if self.filename is not None:
 *             return self.filename
*/
    __pyx_r = NULL;
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":318
 * 
 *     cdef char* getfilename(self) except? NULL:
 *         if self.self is None:             # <<<<<<<<<<<<<<
 *             return NULL
 *         if self.filename is not None:
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":320
 *         if self.self is None:
 *             return NULL
 *         if self.filename is not None:             # <<<<<<<<<<<<<<
 *             return self.filename
 *         return NULL
*/
  __pyx_t_1 = (__pyx_v_self->filename != ((PyObject*)Py_None));
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":321
 *             return NULL
 *         if self.filename is not None:
 *             return self.filename             # <<<<<<<<<<<<<<
 *         return NULL
 * 
*/
    if (unlikely(__pyx_v_self->filename == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
      __PYX_ERR(5, 321, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->filename); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(5, 321, __pyx_L1_error)
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":320
 *         if self.self is None:
 *             return NULL
 *         if self.filename is not None:             # <<<<<<<<<<<<<<
 *             return self.filename
 *         return NULL
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":322
 *         if self.filename is not None:
 *             return self.filename
 *         return NULL             # <<<<<<<<<<<<<<
 * 
 * cdef inline _PyVwr PyVwr(PetscViewer viewer):
*/
  __pyx_r = NULL;
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":317
 *         return 0
 * 
 *     cdef char* getfilename(self) except? NULL:             # <<<<<<<<<<<<<<
 *         if self.self is None:
 *             return NULL
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc._PyVwr.getfilename", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":324
 *         return NULL
 * 
 * cdef inline _PyVwr PyVwr(PetscViewer viewer):             # <<<<<<<<<<<<<<
 *     if viewer != NULL and viewer.data != NULL:
 *         return <_PyVwr>viewer.data
*/

static CYTHON_INLINE struct __pyx_obj_8petsc4py_5PETSc__PyVwr *__pyx_f_8petsc4py_5PETSc_PyVwr(PetscViewer __pyx_v_viewer) {
  struct __pyx_obj_8petsc4py_5PETSc__PyVwr *__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("PyVwr", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":325
 * 
 * cdef inline _PyVwr PyVwr(PetscViewer viewer):
 *     if viewer != NULL and viewer.data != NULL:             # <<<<<<<<<<<<<<
 *         return <_PyVwr>viewer.data
 *     else:
*/
  __pyx_t_2 = (__pyx_v_viewer != NULL);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_viewer->data != NULL);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":326
 * cdef inline _PyVwr PyVwr(PetscViewer viewer):
 *     if viewer != NULL and viewer.data != NULL:
 *         return <_PyVwr>viewer.data             # <<<<<<<<<<<<<<
 *     else:
 *         return _PyVwr.__new__(_PyVwr)
*/
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)__pyx_v_viewer->data));
    __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)__pyx_v_viewer->data);
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":325
 * 
 * cdef inline _PyVwr PyVwr(PetscViewer viewer):
 *     if viewer != NULL and viewer.data != NULL:             # <<<<<<<<<<<<<<
 *         return <_PyVwr>viewer.data
 *     else:
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":328
 *         return <_PyVwr>viewer.data
 *     else:
 *         return _PyVwr.__new__(_PyVwr)             # <<<<<<<<<<<<<<
 * 
 * cdef public PetscErrorCode PetscViewerPythonGetContext(PetscViewer viewer, void **ctx) \
*/
  /*else*/ {
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_8petsc4py_5PETSc__PyVwr(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyVwr), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 328, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_3);
    __pyx_r = ((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":324
 *         return NULL
 * 
 * cdef inline _PyVwr PyVwr(PetscViewer viewer):             # <<<<<<<<<<<<<<
 *     if viewer != NULL and viewer.data != NULL:
 *         return <_PyVwr>viewer.data
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("petsc4py.PETSc.PyVwr", __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":330
 *         return _PyVwr.__new__(_PyVwr)
 * 
 * cdef public PetscErrorCode PetscViewerPythonGetContext(PetscViewer viewer, void **ctx) \             # <<<<<<<<<<<<<<
 *     except PETSC_ERR_PYTHON:
 *     FunctionBegin(b"PetscViewerPythonGetContext")
*/

PetscErrorCode PetscViewerPythonGetContext(PetscViewer __pyx_v_viewer, 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("PetscViewerPythonGetContext", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":332
 * cdef public PetscErrorCode PetscViewerPythonGetContext(PetscViewer viewer, void **ctx) \
 *     except PETSC_ERR_PYTHON:
 *     FunctionBegin(b"PetscViewerPythonGetContext")             # <<<<<<<<<<<<<<
 *     PyVwr(viewer).getcontext(ctx)
 *     return FunctionEnd()
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PetscViewerPythonGetContext"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":333
 *     except PETSC_ERR_PYTHON:
 *     FunctionBegin(b"PetscViewerPythonGetContext")
 *     PyVwr(viewer).getcontext(ctx)             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(__pyx_v_viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyVwr *)((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)__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(5, 333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":334
 *     FunctionBegin(b"PetscViewerPythonGetContext")
 *     PyVwr(viewer).getcontext(ctx)
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef public PetscErrorCode PetscViewerPythonSetContext(PetscViewer viewer, void *ctx) \
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":330
 *         return _PyVwr.__new__(_PyVwr)
 * 
 * cdef public PetscErrorCode PetscViewerPythonGetContext(PetscViewer viewer, void **ctx) \             # <<<<<<<<<<<<<<
 *     except PETSC_ERR_PYTHON:
 *     FunctionBegin(b"PetscViewerPythonGetContext")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("petsc4py.PETSc.PetscViewerPythonGetContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":336
 *     return FunctionEnd()
 * 
 * cdef public PetscErrorCode PetscViewerPythonSetContext(PetscViewer viewer, void *ctx) \             # <<<<<<<<<<<<<<
 *     except PETSC_ERR_PYTHON:
 *     FunctionBegin(b"PetscViewerPythonSetContext")
*/

PetscErrorCode PetscViewerPythonSetContext(PetscViewer __pyx_v_viewer, 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("PetscViewerPythonSetContext", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":338
 * cdef public PetscErrorCode PetscViewerPythonSetContext(PetscViewer viewer, void *ctx) \
 *     except PETSC_ERR_PYTHON:
 *     FunctionBegin(b"PetscViewerPythonSetContext")             # <<<<<<<<<<<<<<
 *     PyVwr(viewer).setcontext(ctx, Viewer_(viewer))
 *     return FunctionEnd()
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PetscViewerPythonSetContext"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":339
 *     except PETSC_ERR_PYTHON:
 *     FunctionBegin(b"PetscViewerPythonSetContext")
 *     PyVwr(viewer).setcontext(ctx, Viewer_(viewer))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(__pyx_v_viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyVwr *)((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)__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(5, 339, __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":340
 *     FunctionBegin(b"PetscViewerPythonSetContext")
 *     PyVwr(viewer).setcontext(ctx, Viewer_(viewer))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode PetscViewerPythonSetType_PYTHON(PetscViewer viewer, const char *name) \
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":336
 *     return FunctionEnd()
 * 
 * cdef public PetscErrorCode PetscViewerPythonSetContext(PetscViewer viewer, void *ctx) \             # <<<<<<<<<<<<<<
 *     except PETSC_ERR_PYTHON:
 *     FunctionBegin(b"PetscViewerPythonSetContext")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.PetscViewerPythonSetContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":342
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerPythonSetType_PYTHON(PetscViewer viewer, const char *name) \             # <<<<<<<<<<<<<<
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonSetType_PYTHON")
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerPythonSetType_PYTHON(PetscViewer __pyx_v_viewer, char const *__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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PetscViewerPythonSetType_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":344
 * cdef PetscErrorCode PetscViewerPythonSetType_PYTHON(PetscViewer viewer, const char *name) \
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonSetType_PYTHON")             # <<<<<<<<<<<<<<
 *     if name == NULL: return FunctionEnd() # XXX
 *     cdef object ctx = createcontext(name)
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PetscViewerPythonSetType_PYTHON"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":345
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonSetType_PYTHON")
 *     if name == NULL: return FunctionEnd() # XXX             # <<<<<<<<<<<<<<
 *     cdef object ctx = createcontext(name)
 *     PetscViewerPythonSetContext(viewer, <void*>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":346
 *     FunctionBegin(b"PetscViewerPythonSetType_PYTHON")
 *     if name == NULL: return FunctionEnd() # XXX
 *     cdef object ctx = createcontext(name)             # <<<<<<<<<<<<<<
 *     PetscViewerPythonSetContext(viewer, <void*>ctx)
 *     PyVwr(viewer).setname(name)
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ctx = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":347
 *     if name == NULL: return FunctionEnd() # XXX
 *     cdef object ctx = createcontext(name)
 *     PetscViewerPythonSetContext(viewer, <void*>ctx)             # <<<<<<<<<<<<<<
 *     PyVwr(viewer).setname(name)
 *     return FunctionEnd()
*/
  __pyx_t_3 = PetscViewerPythonSetContext(__pyx_v_viewer, ((void *)__pyx_v_ctx)); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 347, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":348
 *     cdef object ctx = createcontext(name)
 *     PetscViewerPythonSetContext(viewer, <void*>ctx)
 *     PyVwr(viewer).setname(name)             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(__pyx_v_viewer)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyVwr *)((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)__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(5, 348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":349
 *     PetscViewerPythonSetContext(viewer, <void*>ctx)
 *     PyVwr(viewer).setname(name)
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode PetscViewerPythonGetType_PYTHON(PetscViewer viewer, const char *name[]) \
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":342
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerPythonSetType_PYTHON(PetscViewer viewer, const char *name) \             # <<<<<<<<<<<<<<
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonSetType_PYTHON")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("petsc4py.PETSc.PetscViewerPythonSetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ctx);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":351
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerPythonGetType_PYTHON(PetscViewer viewer, const char *name[]) \             # <<<<<<<<<<<<<<
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonGetType_PYTHON")
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerPythonGetType_PYTHON(PetscViewer __pyx_v_viewer, 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PetscViewerPythonGetType_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":353
 * cdef PetscErrorCode PetscViewerPythonGetType_PYTHON(PetscViewer viewer, const char *name[]) \
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonGetType_PYTHON")             # <<<<<<<<<<<<<<
 *     name[0] = PyVwr(viewer).getname()
 *     return FunctionEnd()
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PetscViewerPythonGetType_PYTHON"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":354
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonGetType_PYTHON")
 *     name[0] = PyVwr(viewer).getname()             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(__pyx_v_viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyVwr *)((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 354, __pyx_L1_error)
  (__pyx_v_name[0]) = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":355
 *     FunctionBegin(b"PetscViewerPythonGetType_PYTHON")
 *     name[0] = PyVwr(viewer).getname()
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode PetscViewerPythonSetFilename_PYTHON(PetscViewer viewer, const char *name) \
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":351
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerPythonGetType_PYTHON(PetscViewer viewer, const char *name[]) \             # <<<<<<<<<<<<<<
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonGetType_PYTHON")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("petsc4py.PETSc.PetscViewerPythonGetType_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":357
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerPythonSetFilename_PYTHON(PetscViewer viewer, const char *name) \             # <<<<<<<<<<<<<<
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonSetFilename_PYTHON")
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerPythonSetFilename_PYTHON(PetscViewer __pyx_v_viewer, char const *__pyx_v_name) {
  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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PetscViewerPythonSetFilename_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":359
 * cdef PetscErrorCode PetscViewerPythonSetFilename_PYTHON(PetscViewer viewer, const char *name) \
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonSetFilename_PYTHON")             # <<<<<<<<<<<<<<
 *     PyVwr(viewer).setfilename(name)
 *     return FunctionEnd()
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PetscViewerPythonSetFilename_PYTHON"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":360
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonSetFilename_PYTHON")
 *     PyVwr(viewer).setfilename(name)             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(__pyx_v_viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyVwr *)((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)__pyx_t_1)->__pyx_base.__pyx_vtab)->setfilename(((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)__pyx_t_1), __pyx_v_name); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":361
 *     FunctionBegin(b"PetscViewerPythonSetFilename_PYTHON")
 *     PyVwr(viewer).setfilename(name)
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode PetscViewerPythonGetFilename_PYTHON(PetscViewer viewer, const char *name[]) \
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":357
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerPythonSetFilename_PYTHON(PetscViewer viewer, const char *name) \             # <<<<<<<<<<<<<<
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonSetFilename_PYTHON")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("petsc4py.PETSc.PetscViewerPythonSetFilename_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":363
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerPythonGetFilename_PYTHON(PetscViewer viewer, const char *name[]) \             # <<<<<<<<<<<<<<
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonGetFilename_PYTHON")
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerPythonGetFilename_PYTHON(PetscViewer __pyx_v_viewer, 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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PetscViewerPythonGetFilename_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":365
 * cdef PetscErrorCode PetscViewerPythonGetFilename_PYTHON(PetscViewer viewer, const char *name[]) \
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonGetFilename_PYTHON")             # <<<<<<<<<<<<<<
 *     name[0] = PyVwr(viewer).getfilename()
 *     return FunctionEnd()
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PetscViewerPythonGetFilename_PYTHON"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":366
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonGetFilename_PYTHON")
 *     name[0] = PyVwr(viewer).getfilename()             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(__pyx_v_viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyVwr *)((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)__pyx_t_1)->__pyx_base.__pyx_vtab)->getfilename(((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 366, __pyx_L1_error)
  (__pyx_v_name[0]) = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":367
 *     FunctionBegin(b"PetscViewerPythonGetFilename_PYTHON")
 *     name[0] = PyVwr(viewer).getfilename()
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode PetscViewerPythonViewObject_PYTHON(PetscViewer viewer, PetscObject obj) \
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":363
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerPythonGetFilename_PYTHON(PetscViewer viewer, const char *name[]) \             # <<<<<<<<<<<<<<
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonGetFilename_PYTHON")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("petsc4py.PETSc.PetscViewerPythonGetFilename_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":369
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerPythonViewObject_PYTHON(PetscViewer viewer, PetscObject obj) \             # <<<<<<<<<<<<<<
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonViewObject_PYTHON")
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerPythonViewObject_PYTHON(PetscViewer __pyx_v_viewer, PetscObject __pyx_v_obj) {
  PyObject *__pyx_v_viewObject = 0;
  struct PyPetscObjectObject *__pyx_v_pobj = 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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PetscViewerPythonViewObject_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":371
 * cdef PetscErrorCode PetscViewerPythonViewObject_PYTHON(PetscViewer viewer, PetscObject obj) \
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonViewObject_PYTHON")             # <<<<<<<<<<<<<<
 *     cdef viewObject = PyVwr(viewer).viewObject
 *     cdef Object pobj = PyPetscObject_New(obj)
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PetscViewerPythonViewObject_PYTHON"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":372
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonViewObject_PYTHON")
 *     cdef viewObject = PyVwr(viewer).viewObject             # <<<<<<<<<<<<<<
 *     cdef Object pobj = PyPetscObject_New(obj)
 *     if viewObject is not None:
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(__pyx_v_viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_viewObject); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_viewObject = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":373
 *     FunctionBegin(b"PetscViewerPythonViewObject_PYTHON")
 *     cdef viewObject = PyVwr(viewer).viewObject
 *     cdef Object pobj = PyPetscObject_New(obj)             # <<<<<<<<<<<<<<
 *     if viewObject is not None:
 *         viewObject(Viewer_(viewer), pobj)
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_PyPetscObject_New(__pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(5, 373, __pyx_L1_error)
  __pyx_v_pobj = ((struct PyPetscObjectObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":374
 *     cdef viewObject = PyVwr(viewer).viewObject
 *     cdef Object pobj = PyPetscObject_New(obj)
 *     if viewObject is not None:             # <<<<<<<<<<<<<<
 *         viewObject(Viewer_(viewer), pobj)
 *     return FunctionEnd()
*/
  __pyx_t_3 = (__pyx_v_viewObject != Py_None);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":375
 *     cdef Object pobj = PyPetscObject_New(obj)
 *     if viewObject is not None:
 *         viewObject(Viewer_(viewer), pobj)             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_viewObject);
    __pyx_t_4 = __pyx_v_viewObject; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_viewer)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_5, ((PyObject *)__pyx_v_pobj)};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 375, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":374
 *     cdef viewObject = PyVwr(viewer).viewObject
 *     cdef Object pobj = PyPetscObject_New(obj)
 *     if viewObject is not None:             # <<<<<<<<<<<<<<
 *         viewObject(Viewer_(viewer), pobj)
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":376
 *     if viewObject is not None:
 *         viewObject(Viewer_(viewer), pobj)
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode PetscViewerCreate_Python(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":369
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerPythonViewObject_PYTHON(PetscViewer viewer, PetscObject obj) \             # <<<<<<<<<<<<<<
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerPythonViewObject_PYTHON")
*/

  /* 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.PetscViewerPythonViewObject_PYTHON", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_viewObject);
  __Pyx_XDECREF((PyObject *)__pyx_v_pobj);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":378
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerCreate_Python(             # <<<<<<<<<<<<<<
 *     PetscViewer viewer,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerCreate_Python(PetscViewer __pyx_v_viewer) {
  PetscViewerOps __pyx_v_ops;
  PyObject *__pyx_v_ctx = 0;
  PetscErrorCode __pyx_r;
  __Pyx_RefNannyDeclarations
  PetscViewerOps __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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PetscViewerCreate_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":381
 *     PetscViewer viewer,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerCreate_Python")             # <<<<<<<<<<<<<<
 *     cdef PetscViewerOps ops    = viewer.ops
 *     ops.destroy        = PetscViewerDestroy_Python
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PetscViewerCreate_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":382
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerCreate_Python")
 *     cdef PetscViewerOps ops    = viewer.ops             # <<<<<<<<<<<<<<
 *     ops.destroy        = PetscViewerDestroy_Python
 *     ops.view           = PetscViewerView_Python
*/
  __pyx_t_1 = __pyx_v_viewer->ops;
  __pyx_v_ops = __pyx_t_1;

  /* "petsc4py/PETSc/libpetsc4py.pyx":383
 *     FunctionBegin(b"PetscViewerCreate_Python")
 *     cdef PetscViewerOps ops    = viewer.ops
 *     ops.destroy        = PetscViewerDestroy_Python             # <<<<<<<<<<<<<<
 *     ops.view           = PetscViewerView_Python
 *     ops.setup          = PetscViewerSetUp_Python
*/
  __pyx_v_ops->destroy = __pyx_f_8petsc4py_5PETSc_PetscViewerDestroy_Python;

  /* "petsc4py/PETSc/libpetsc4py.pyx":384
 *     cdef PetscViewerOps ops    = viewer.ops
 *     ops.destroy        = PetscViewerDestroy_Python
 *     ops.view           = PetscViewerView_Python             # <<<<<<<<<<<<<<
 *     ops.setup          = PetscViewerSetUp_Python
 *     ops.setfromoptions = PetscViewerSetFromOptions_Python
*/
  __pyx_v_ops->view = __pyx_f_8petsc4py_5PETSc_PetscViewerView_Python;

  /* "petsc4py/PETSc/libpetsc4py.pyx":385
 *     ops.destroy        = PetscViewerDestroy_Python
 *     ops.view           = PetscViewerView_Python
 *     ops.setup          = PetscViewerSetUp_Python             # <<<<<<<<<<<<<<
 *     ops.setfromoptions = PetscViewerSetFromOptions_Python
 *     ops.flush          = PetscViewerFlush_Python
*/
  __pyx_v_ops->setup = __pyx_f_8petsc4py_5PETSc_PetscViewerSetUp_Python;

  /* "petsc4py/PETSc/libpetsc4py.pyx":386
 *     ops.view           = PetscViewerView_Python
 *     ops.setup          = PetscViewerSetUp_Python
 *     ops.setfromoptions = PetscViewerSetFromOptions_Python             # <<<<<<<<<<<<<<
 *     ops.flush          = PetscViewerFlush_Python
 *     #
*/
  __pyx_v_ops->setfromoptions = __pyx_f_8petsc4py_5PETSc_PetscViewerSetFromOptions_Python;

  /* "petsc4py/PETSc/libpetsc4py.pyx":387
 *     ops.setup          = PetscViewerSetUp_Python
 *     ops.setfromoptions = PetscViewerSetFromOptions_Python
 *     ops.flush          = PetscViewerFlush_Python             # <<<<<<<<<<<<<<
 *     #
 *     CHKERR(PetscObjectComposeFunction(
*/
  __pyx_v_ops->flush = __pyx_f_8petsc4py_5PETSc_PetscViewerFlush_Python;

  /* "petsc4py/PETSc/libpetsc4py.pyx":389
 *     ops.flush          = PetscViewerFlush_Python
 *     #
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>viewer, b"PetscViewerPythonSetType_C",
 *             <PetscVoidFunction>PetscViewerPythonSetType_PYTHON))
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_viewer), ((char *)"PetscViewerPythonSetType_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_PetscViewerPythonSetType_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 389, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":392
 *             <PetscObject>viewer, b"PetscViewerPythonSetType_C",
 *             <PetscVoidFunction>PetscViewerPythonSetType_PYTHON))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>viewer, b"PetscViewerPythonGetType_C",
 *             <PetscVoidFunction>PetscViewerPythonGetType_PYTHON))
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_viewer), ((char *)"PetscViewerPythonGetType_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_PetscViewerPythonGetType_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 392, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":395
 *             <PetscObject>viewer, b"PetscViewerPythonGetType_C",
 *             <PetscVoidFunction>PetscViewerPythonGetType_PYTHON))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>viewer, b"PetscViewerFileSetName_C",
 *             <PetscVoidFunction>PetscViewerPythonSetFilename_PYTHON))
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_viewer), ((char *)"PetscViewerFileSetName_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_PetscViewerPythonSetFilename_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 395, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":398
 *             <PetscObject>viewer, b"PetscViewerFileSetName_C",
 *             <PetscVoidFunction>PetscViewerPythonSetFilename_PYTHON))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>viewer, b"PetscViewerFileGetName_C",
 *             <PetscVoidFunction>PetscViewerPythonGetFilename_PYTHON))
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_viewer), ((char *)"PetscViewerFileGetName_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_PetscViewerPythonGetFilename_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 398, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":401
 *             <PetscObject>viewer, b"PetscViewerFileGetName_C",
 *             <PetscVoidFunction>PetscViewerPythonGetFilename_PYTHON))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>viewer, b"PetscViewerPythonViewObject_C",
 *             <PetscVoidFunction>PetscViewerPythonViewObject_PYTHON))
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_viewer), ((char *)"PetscViewerPythonViewObject_C"), ((PetscVoidFunction)__pyx_f_8petsc4py_5PETSc_PetscViewerPythonViewObject_PYTHON))); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 401, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":405
 *             <PetscVoidFunction>PetscViewerPythonViewObject_PYTHON))
 *     #
 *     cdef ctx = PyVwr(NULL)             # <<<<<<<<<<<<<<
 *     viewer.data = <void*> ctx
 *     Py_INCREF(<PyObject*>viewer.data)
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_ctx = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":406
 *     #
 *     cdef ctx = PyVwr(NULL)
 *     viewer.data = <void*> ctx             # <<<<<<<<<<<<<<
 *     Py_INCREF(<PyObject*>viewer.data)
 *     return FunctionEnd()
*/
  __pyx_v_viewer->data = ((void *)__pyx_v_ctx);

  /* "petsc4py/PETSc/libpetsc4py.pyx":407
 *     cdef ctx = PyVwr(NULL)
 *     viewer.data = <void*> ctx
 *     Py_INCREF(<PyObject*>viewer.data)             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  Py_INCREF(((PyObject *)__pyx_v_viewer->data));

  /* "petsc4py/PETSc/libpetsc4py.pyx":408
 *     viewer.data = <void*> ctx
 *     Py_INCREF(<PyObject*>viewer.data)
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscErrorCode PetscViewerDestroy_Python_inner(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":378
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerCreate_Python(             # <<<<<<<<<<<<<<
 *     PetscViewer viewer,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("petsc4py.PETSc.PetscViewerCreate_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ctx);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":410
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode PetscViewerDestroy_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscViewer viewer,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

static CYTHON_INLINE PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerDestroy_Python_inner(PetscViewer __pyx_v_viewer) {
  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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PetscViewerDestroy_Python_inner", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":413
 *     PetscViewer viewer,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     try:             # <<<<<<<<<<<<<<
 *         addRef(viewer)
 *         PetscViewerPythonSetContext(viewer, NULL)
*/
  /*try:*/ {

    /* "petsc4py/PETSc/libpetsc4py.pyx":414
 *     ) except PETSC_ERR_PYTHON with gil:
 *     try:
 *         addRef(viewer)             # <<<<<<<<<<<<<<
 *         PetscViewerPythonSetContext(viewer, NULL)
 *     finally:
*/
    __pyx_f_8petsc4py_5PETSc_addRef(__pyx_v_viewer);

    /* "petsc4py/PETSc/libpetsc4py.pyx":415
 *     try:
 *         addRef(viewer)
 *         PetscViewerPythonSetContext(viewer, NULL)             # <<<<<<<<<<<<<<
 *     finally:
 *         delRef(viewer)
*/
    __pyx_t_1 = PetscViewerPythonSetContext(__pyx_v_viewer, NULL); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 415, __pyx_L4_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":417
 *         PetscViewerPythonSetContext(viewer, NULL)
 *     finally:
 *         delRef(viewer)             # <<<<<<<<<<<<<<
 *         Py_DECREF(<PyObject*>viewer.data)
 *         viewer.data = NULL
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_viewer);

      /* "petsc4py/PETSc/libpetsc4py.pyx":418
 *     finally:
 *         delRef(viewer)
 *         Py_DECREF(<PyObject*>viewer.data)             # <<<<<<<<<<<<<<
 *         viewer.data = NULL
 *     return PETSC_SUCCESS
*/
      Py_DECREF(((PyObject *)__pyx_v_viewer->data));

      /* "petsc4py/PETSc/libpetsc4py.pyx":419
 *         delRef(viewer)
 *         Py_DECREF(<PyObject*>viewer.data)
 *         viewer.data = NULL             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
      __pyx_v_viewer->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;
       __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if ( 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":417
 *         PetscViewerPythonSetContext(viewer, NULL)
 *     finally:
 *         delRef(viewer)             # <<<<<<<<<<<<<<
 *         Py_DECREF(<PyObject*>viewer.data)
 *         viewer.data = NULL
*/
        __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_viewer);

        /* "petsc4py/PETSc/libpetsc4py.pyx":418
 *     finally:
 *         delRef(viewer)
 *         Py_DECREF(<PyObject*>viewer.data)             # <<<<<<<<<<<<<<
 *         viewer.data = NULL
 *     return PETSC_SUCCESS
*/
        Py_DECREF(((PyObject *)__pyx_v_viewer->data));

        /* "petsc4py/PETSc/libpetsc4py.pyx":419
 *         delRef(viewer)
 *         Py_DECREF(<PyObject*>viewer.data)
 *         viewer.data = NULL             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
        __pyx_v_viewer->data = NULL;
      }
      __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":420
 *         Py_DECREF(<PyObject*>viewer.data)
 *         viewer.data = NULL
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode PetscViewerDestroy_Python(
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":410
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode PetscViewerDestroy_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscViewer viewer,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("petsc4py.PETSc.PetscViewerDestroy_Python_inner", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":422
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode PetscViewerDestroy_Python(             # <<<<<<<<<<<<<<
 *     PetscViewer viewer,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerDestroy_Python(PetscViewer __pyx_v_viewer) {
  PetscErrorCode __pyx_r;
  PetscErrorCode __pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save;

  /* "petsc4py/PETSc/libpetsc4py.pyx":425
 *     PetscViewer viewer,
 *     ) except PETSC_ERR_PYTHON nogil:
 *     FunctionBegin(b"PetscViewerDestroy_Python")             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectComposeFunction(
 *             <PetscObject>viewer, b"PetscViewerPythonSetType_C",
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PetscViewerDestroy_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":426
 *     ) except PETSC_ERR_PYTHON nogil:
 *     FunctionBegin(b"PetscViewerDestroy_Python")
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>viewer, b"PetscViewerPythonSetType_C",
 *             <PetscVoidFunction>NULL))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_viewer), ((char *)"PetscViewerPythonSetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 426, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":429
 *             <PetscObject>viewer, b"PetscViewerPythonSetType_C",
 *             <PetscVoidFunction>NULL))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>viewer, b"PetscViewerPythonGetType_C",
 *             <PetscVoidFunction>NULL))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_viewer), ((char *)"PetscViewerPythonGetType_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 429, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":432
 *             <PetscObject>viewer, b"PetscViewerPythonGetType_C",
 *             <PetscVoidFunction>NULL))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>viewer, b"PetscViewerFileSetName_C",
 *             <PetscVoidFunction>NULL))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_viewer), ((char *)"PetscViewerFileSetName_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 432, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":435
 *             <PetscObject>viewer, b"PetscViewerFileSetName_C",
 *             <PetscVoidFunction>NULL))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>viewer, b"PetscViewerFileGetName_C",
 *             <PetscVoidFunction>NULL))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_viewer), ((char *)"PetscViewerFileGetName_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 435, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":438
 *             <PetscObject>viewer, b"PetscViewerFileGetName_C",
 *             <PetscVoidFunction>NULL))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>viewer, b"PetscViewerPythonViewObject_C",
 *             <PetscVoidFunction>NULL))
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscObjectComposeFunction(((PetscObject)__pyx_v_viewer), ((char *)"PetscViewerPythonViewObject_C"), ((PetscVoidFunction)NULL))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 438, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":442
 *             <PetscVoidFunction>NULL))
 *     #
 *     if Py_IsInitialized(): PetscViewerDestroy_Python_inner(viewer)             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_2 = (Py_IsInitialized() != 0);
  if (__pyx_t_2) {
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_PetscViewerDestroy_Python_inner(__pyx_v_viewer); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 442, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":443
 *     #
 *     if Py_IsInitialized(): PetscViewerDestroy_Python_inner(viewer)
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode PetscViewerSetUp_Python(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":422
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode PetscViewerDestroy_Python(             # <<<<<<<<<<<<<<
 *     PetscViewer viewer,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("petsc4py.PETSc.PetscViewerDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":445
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerSetUp_Python(             # <<<<<<<<<<<<<<
 *     PetscViewer viewer,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerSetUp_Python(PetscViewer __pyx_v_viewer) {
  char __pyx_v_name[2048];
  PetscBool __pyx_v_found;
  char __pyx_v_fname[2048];
  char const *__pyx_v_fdefault;
  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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PetscViewerSetUp_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":448
 *     PetscViewer viewer,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerSetUp_Python")             # <<<<<<<<<<<<<<
 *     cdef char name[2048]
 *     cdef PetscBool found = PETSC_FALSE
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PetscViewerSetUp_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":450
 *     FunctionBegin(b"PetscViewerSetUp_Python")
 *     cdef char name[2048]
 *     cdef PetscBool found = PETSC_FALSE             # <<<<<<<<<<<<<<
 *     if PyVwr(viewer).self is None:
 *         CHKERR(PetscOptionsGetString(NULL,
*/
  __pyx_v_found = PETSC_FALSE;

  /* "petsc4py/PETSc/libpetsc4py.pyx":451
 *     cdef char name[2048]
 *     cdef PetscBool found = PETSC_FALSE
 *     if PyVwr(viewer).self is None:             # <<<<<<<<<<<<<<
 *         CHKERR(PetscOptionsGetString(NULL,
 *                getPrefix(viewer), b"-viewer_python_type",
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(__pyx_v_viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)__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":452
 *     cdef PetscBool found = PETSC_FALSE
 *     if PyVwr(viewer).self is None:
 *         CHKERR(PetscOptionsGetString(NULL,             # <<<<<<<<<<<<<<
 *                getPrefix(viewer), b"-viewer_python_type",
 *                name, sizeof(name), &found))
*/
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetString(NULL, __pyx_f_8petsc4py_5PETSc_getPrefix(__pyx_v_viewer), ((char *)"-viewer_python_type"), __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 452, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":455
 *                getPrefix(viewer), b"-viewer_python_type",
 *                name, sizeof(name), &found))
 *         if found and name[0]:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscViewerPythonSetType_PYTHON(viewer, name))
 *     cdef char fname[2048]
*/
    __pyx_t_4 = (__pyx_v_found != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      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":456
 *                name, sizeof(name), &found))
 *         if found and name[0]:
 *             CHKERR(PetscViewerPythonSetType_PYTHON(viewer, name))             # <<<<<<<<<<<<<<
 *     cdef char fname[2048]
 *     cdef const char *fdefault = NULL
*/
      __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PetscViewerPythonSetType_PYTHON(__pyx_v_viewer, __pyx_v_name); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 456, __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(5, 456, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":455
 *                getPrefix(viewer), b"-viewer_python_type",
 *                name, sizeof(name), &found))
 *         if found and name[0]:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscViewerPythonSetType_PYTHON(viewer, name))
 *     cdef char fname[2048]
*/
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":451
 *     cdef char name[2048]
 *     cdef PetscBool found = PETSC_FALSE
 *     if PyVwr(viewer).self is None:             # <<<<<<<<<<<<<<
 *         CHKERR(PetscOptionsGetString(NULL,
 *                getPrefix(viewer), b"-viewer_python_type",
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":458
 *             CHKERR(PetscViewerPythonSetType_PYTHON(viewer, name))
 *     cdef char fname[2048]
 *     cdef const char *fdefault = NULL             # <<<<<<<<<<<<<<
 *     CHKERR(PetscViewerFileGetName(viewer, &fdefault))
 *     if not fdefault:
*/
  __pyx_v_fdefault = NULL;

  /* "petsc4py/PETSc/libpetsc4py.pyx":459
 *     cdef char fname[2048]
 *     cdef const char *fdefault = NULL
 *     CHKERR(PetscViewerFileGetName(viewer, &fdefault))             # <<<<<<<<<<<<<<
 *     if not fdefault:
 *         CHKERR(PetscOptionsGetString(NULL,
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerFileGetName(__pyx_v_viewer, (&__pyx_v_fdefault))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 459, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":460
 *     cdef const char *fdefault = NULL
 *     CHKERR(PetscViewerFileGetName(viewer, &fdefault))
 *     if not fdefault:             # <<<<<<<<<<<<<<
 *         CHKERR(PetscOptionsGetString(NULL,
 *                getPrefix(viewer), b"-viewer_python_filename",
*/
  __pyx_t_2 = (!(__pyx_v_fdefault != 0));
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":461
 *     CHKERR(PetscViewerFileGetName(viewer, &fdefault))
 *     if not fdefault:
 *         CHKERR(PetscOptionsGetString(NULL,             # <<<<<<<<<<<<<<
 *                getPrefix(viewer), b"-viewer_python_filename",
 *                fname, sizeof(fname), &found))
*/
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsGetString(NULL, __pyx_f_8petsc4py_5PETSc_getPrefix(__pyx_v_viewer), ((char *)"-viewer_python_filename"), __pyx_v_fname, (sizeof(__pyx_v_fname)), (&__pyx_v_found))); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 461, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":464
 *                getPrefix(viewer), b"-viewer_python_filename",
 *                fname, sizeof(fname), &found))
 *         if found and fname[0]:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscViewerPythonSetFilename_PYTHON(viewer, fname))
 *     if PyVwr(viewer).self is None:
*/
    __pyx_t_4 = (__pyx_v_found != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_4 = ((__pyx_v_fname[0]) != 0);
    __pyx_t_2 = __pyx_t_4;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_2) {

      /* "petsc4py/PETSc/libpetsc4py.pyx":465
 *                fname, sizeof(fname), &found))
 *         if found and fname[0]:
 *             CHKERR(PetscViewerPythonSetFilename_PYTHON(viewer, fname))             # <<<<<<<<<<<<<<
 *     if PyVwr(viewer).self is None:
 *         return PetscSETERR(PETSC_ERR_USER,
*/
      __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_PetscViewerPythonSetFilename_PYTHON(__pyx_v_viewer, __pyx_v_fname); if (unlikely(__pyx_t_5 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 465, __pyx_L1_error)
      __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_5); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 465, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":464
 *                getPrefix(viewer), b"-viewer_python_filename",
 *                fname, sizeof(fname), &found))
 *         if found and fname[0]:             # <<<<<<<<<<<<<<
 *             CHKERR(PetscViewerPythonSetFilename_PYTHON(viewer, fname))
 *     if PyVwr(viewer).self is None:
*/
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":460
 *     cdef const char *fdefault = NULL
 *     CHKERR(PetscViewerFileGetName(viewer, &fdefault))
 *     if not fdefault:             # <<<<<<<<<<<<<<
 *         CHKERR(PetscOptionsGetString(NULL,
 *                getPrefix(viewer), b"-viewer_python_filename",
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":466
 *         if found and fname[0]:
 *             CHKERR(PetscViewerPythonSetFilename_PYTHON(viewer, fname))
 *     if PyVwr(viewer).self is None:             # <<<<<<<<<<<<<<
 *         return PetscSETERR(PETSC_ERR_USER,
 *                            "Python context not set, call one of \n"
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(__pyx_v_viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)__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":467
 *             CHKERR(PetscViewerPythonSetFilename_PYTHON(viewer, fname))
 *     if PyVwr(viewer).self is None:
 *         return PetscSETERR(PETSC_ERR_USER,             # <<<<<<<<<<<<<<
 *                            "Python context not set, call one of \n"
 *                            " * PetscViewerPythonSetType(viewer, \"[package.]module.class\")\n"
*/
    __pyx_r = __pyx_f_8petsc4py_5PETSc_PetscSETERR(PETSC_ERR_USER, __pyx_k_Python_context_not_set_call_one);
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":466
 *         if found and fname[0]:
 *             CHKERR(PetscViewerPythonSetFilename_PYTHON(viewer, fname))
 *     if PyVwr(viewer).self is None:             # <<<<<<<<<<<<<<
 *         return PetscSETERR(PETSC_ERR_USER,
 *                            "Python context not set, call one of \n"
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":473
 *                            "-viewer_python_type [package.]module.class")
 *     #
 *     cdef setUp = PyVwr(viewer).setUp             # <<<<<<<<<<<<<<
 *     if setUp is not None:
 *         setUp(Viewer_(viewer))
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(__pyx_v_viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 473, __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":474
 *     #
 *     cdef setUp = PyVwr(viewer).setUp
 *     if setUp is not None:             # <<<<<<<<<<<<<<
 *         setUp(Viewer_(viewer))
 *     return FunctionEnd()
*/
  __pyx_t_2 = (__pyx_v_setUp != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":475
 *     cdef setUp = PyVwr(viewer).setUp
 *     if setUp is not None:
 *         setUp(Viewer_(viewer))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_setUp);
    __pyx_t_7 = __pyx_v_setUp; 
    __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_viewer)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 475, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_8};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 475, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":474
 *     #
 *     cdef setUp = PyVwr(viewer).setUp
 *     if setUp is not None:             # <<<<<<<<<<<<<<
 *         setUp(Viewer_(viewer))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":476
 *     if setUp is not None:
 *         setUp(Viewer_(viewer))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode PetscViewerSetFromOptions_Python(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":445
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerSetUp_Python(             # <<<<<<<<<<<<<<
 *     PetscViewer viewer,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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.PetscViewerSetUp_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_setUp);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":478
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerSetFromOptions_Python(             # <<<<<<<<<<<<<<
 *     PetscViewer viewer,
 *     PetscOptionItems PetscOptionsObject,
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerSetFromOptions_Python(PetscViewer __pyx_v_viewer, PetscOptionItems __pyx_v_PetscOptionsObject) {
  char __pyx_v_name[2048];
  char *__pyx_v_defval;
  PetscBool __pyx_v_found;
  PetscOptionItems PetscOptionsObject;
  char __pyx_v_fname[2048];
  char *__pyx_v_fdefval;
  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;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PetscViewerSetFromOptions_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":482
 *     PetscOptionItems PetscOptionsObject,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerSetFromOptions_Python")             # <<<<<<<<<<<<<<
 *     cdef char name[2048], *defval = PyVwr(viewer).getname()
 *     cdef PetscBool found = PETSC_FALSE
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PetscViewerSetFromOptions_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":483
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerSetFromOptions_Python")
 *     cdef char name[2048], *defval = PyVwr(viewer).getname()             # <<<<<<<<<<<<<<
 *     cdef PetscBool found = PETSC_FALSE
 *     cdef PetscOptionItems opts "PetscOptionsObject" = PetscOptionsObject
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(__pyx_v_viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyVwr *)((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)__pyx_t_1)->__pyx_base.__pyx_vtab)->__pyx_base.getname(((struct __pyx_obj_8petsc4py_5PETSc__PyObj *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 483, __pyx_L1_error)
  __pyx_v_defval = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":484
 *     FunctionBegin(b"PetscViewerSetFromOptions_Python")
 *     cdef char name[2048], *defval = PyVwr(viewer).getname()
 *     cdef PetscBool found = PETSC_FALSE             # <<<<<<<<<<<<<<
 *     cdef PetscOptionItems opts "PetscOptionsObject" = PetscOptionsObject
 *     CHKERR(PetscOptionsString(
*/
  __pyx_v_found = PETSC_FALSE;

  /* "petsc4py/PETSc/libpetsc4py.pyx":485
 *     cdef char name[2048], *defval = PyVwr(viewer).getname()
 *     cdef PetscBool found = PETSC_FALSE
 *     cdef PetscOptionItems opts "PetscOptionsObject" = PetscOptionsObject             # <<<<<<<<<<<<<<
 *     CHKERR(PetscOptionsString(
 *            b"-viewer_python_type", b"Python [package.]module[.{class|function}]",
*/
  PetscOptionsObject = __pyx_v_PetscOptionsObject;

  /* "petsc4py/PETSc/libpetsc4py.pyx":486
 *     cdef PetscBool found = PETSC_FALSE
 *     cdef PetscOptionItems opts "PetscOptionsObject" = PetscOptionsObject
 *     CHKERR(PetscOptionsString(             # <<<<<<<<<<<<<<
 *            b"-viewer_python_type", b"Python [package.]module[.{class|function}]",
 *            b"PetscViewerPythonSetType", defval, name, sizeof(name), &found)); <void>opts
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsString(((char *)"-viewer_python_type"), ((char *)"Python [package.]module[.{class|function}]"), ((char *)"PetscViewerPythonSetType"), __pyx_v_defval, __pyx_v_name, (sizeof(__pyx_v_name)), (&__pyx_v_found))); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 486, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":488
 *     CHKERR(PetscOptionsString(
 *            b"-viewer_python_type", b"Python [package.]module[.{class|function}]",
 *            b"PetscViewerPythonSetType", defval, name, sizeof(name), &found)); <void>opts             # <<<<<<<<<<<<<<
 *     if found and name[0]:
 *         CHKERR(PetscViewerPythonSetType_PYTHON(viewer, name))
*/
  ((void)PetscOptionsObject);

  /* "petsc4py/PETSc/libpetsc4py.pyx":489
 *            b"-viewer_python_type", b"Python [package.]module[.{class|function}]",
 *            b"PetscViewerPythonSetType", defval, name, sizeof(name), &found)); <void>opts
 *     if found and name[0]:             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerPythonSetType_PYTHON(viewer, name))
 *     #
*/
  __pyx_t_5 = (__pyx_v_found != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    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":490
 *            b"PetscViewerPythonSetType", defval, name, sizeof(name), &found)); <void>opts
 *     if found and name[0]:
 *         CHKERR(PetscViewerPythonSetType_PYTHON(viewer, name))             # <<<<<<<<<<<<<<
 *     #
 *     cdef char fname[2048], *fdefval = PyVwr(viewer).getfilename()
*/
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PetscViewerPythonSetType_PYTHON(__pyx_v_viewer, __pyx_v_name); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 490, __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(5, 490, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":489
 *            b"-viewer_python_type", b"Python [package.]module[.{class|function}]",
 *            b"PetscViewerPythonSetType", defval, name, sizeof(name), &found)); <void>opts
 *     if found and name[0]:             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerPythonSetType_PYTHON(viewer, name))
 *     #
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":492
 *         CHKERR(PetscViewerPythonSetType_PYTHON(viewer, name))
 *     #
 *     cdef char fname[2048], *fdefval = PyVwr(viewer).getfilename()             # <<<<<<<<<<<<<<
 *     CHKERR(PetscOptionsString(
 *            b"-viewer_python_filename", b"Output filename for viewer",
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(__pyx_v_viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_8petsc4py_5PETSc__PyVwr *)((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)__pyx_t_1)->__pyx_base.__pyx_vtab)->getfilename(((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 492, __pyx_L1_error)
  __pyx_v_fdefval = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":493
 *     #
 *     cdef char fname[2048], *fdefval = PyVwr(viewer).getfilename()
 *     CHKERR(PetscOptionsString(             # <<<<<<<<<<<<<<
 *            b"-viewer_python_filename", b"Output filename for viewer",
 *            b"PetscViewerPythonSetFilename", fdefval, fname, sizeof(fname), &found)); <void>opts
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscOptionsString(((char *)"-viewer_python_filename"), ((char *)"Output filename for viewer"), ((char *)"PetscViewerPythonSetFilename"), __pyx_v_fdefval, __pyx_v_fname, (sizeof(__pyx_v_fname)), (&__pyx_v_found))); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 493, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":495
 *     CHKERR(PetscOptionsString(
 *            b"-viewer_python_filename", b"Output filename for viewer",
 *            b"PetscViewerPythonSetFilename", fdefval, fname, sizeof(fname), &found)); <void>opts             # <<<<<<<<<<<<<<
 *     if found and fname[0]:
 *         CHKERR(PetscViewerPythonSetFilename_PYTHON(viewer, fname))
*/
  ((void)PetscOptionsObject);

  /* "petsc4py/PETSc/libpetsc4py.pyx":496
 *            b"-viewer_python_filename", b"Output filename for viewer",
 *            b"PetscViewerPythonSetFilename", fdefval, fname, sizeof(fname), &found)); <void>opts
 *     if found and fname[0]:             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerPythonSetFilename_PYTHON(viewer, fname))
 *     cdef setFromOptions = PyVwr(viewer).setFromOptions
*/
  __pyx_t_5 = (__pyx_v_found != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_fname[0]) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_4) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":497
 *            b"PetscViewerPythonSetFilename", fdefval, fname, sizeof(fname), &found)); <void>opts
 *     if found and fname[0]:
 *         CHKERR(PetscViewerPythonSetFilename_PYTHON(viewer, fname))             # <<<<<<<<<<<<<<
 *     cdef setFromOptions = PyVwr(viewer).setFromOptions
 *     if setFromOptions is not None:
*/
    __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_PetscViewerPythonSetFilename_PYTHON(__pyx_v_viewer, __pyx_v_fname); if (unlikely(__pyx_t_6 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 497, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_CHKERR(__pyx_t_6); if (unlikely(__pyx_t_3 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 497, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":496
 *            b"-viewer_python_filename", b"Output filename for viewer",
 *            b"PetscViewerPythonSetFilename", fdefval, fname, sizeof(fname), &found)); <void>opts
 *     if found and fname[0]:             # <<<<<<<<<<<<<<
 *         CHKERR(PetscViewerPythonSetFilename_PYTHON(viewer, fname))
 *     cdef setFromOptions = PyVwr(viewer).setFromOptions
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":498
 *     if found and fname[0]:
 *         CHKERR(PetscViewerPythonSetFilename_PYTHON(viewer, fname))
 *     cdef setFromOptions = PyVwr(viewer).setFromOptions             # <<<<<<<<<<<<<<
 *     if setFromOptions is not None:
 *         setFromOptions(Viewer_(viewer))
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(__pyx_v_viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 498, __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":499
 *         CHKERR(PetscViewerPythonSetFilename_PYTHON(viewer, fname))
 *     cdef setFromOptions = PyVwr(viewer).setFromOptions
 *     if setFromOptions is not None:             # <<<<<<<<<<<<<<
 *         setFromOptions(Viewer_(viewer))
 *     return FunctionEnd()
*/
  __pyx_t_4 = (__pyx_v_setFromOptions != Py_None);
  if (__pyx_t_4) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":500
 *     cdef setFromOptions = PyVwr(viewer).setFromOptions
 *     if setFromOptions is not None:
 *         setFromOptions(Viewer_(viewer))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_setFromOptions);
    __pyx_t_8 = __pyx_v_setFromOptions; 
    __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_viewer)); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_9};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 500, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":499
 *         CHKERR(PetscViewerPythonSetFilename_PYTHON(viewer, fname))
 *     cdef setFromOptions = PyVwr(viewer).setFromOptions
 *     if setFromOptions is not None:             # <<<<<<<<<<<<<<
 *         setFromOptions(Viewer_(viewer))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":501
 *     if setFromOptions is not None:
 *         setFromOptions(Viewer_(viewer))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode PetscViewerView_Python(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":478
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerSetFromOptions_Python(             # <<<<<<<<<<<<<<
 *     PetscViewer viewer,
 *     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.PetscViewerSetFromOptions_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_setFromOptions);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":503
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerView_Python(             # <<<<<<<<<<<<<<
 *     PetscViewer viewer,
 *     PetscViewer vwr,
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerView_Python(PetscViewer __pyx_v_viewer, 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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PetscViewerView_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":507
 *     PetscViewer vwr,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerView_Python")             # <<<<<<<<<<<<<<
 *     viewcontext(PyVwr(viewer), vwr)
 *     cdef view = PyVwr(viewer).view
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PetscViewerView_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":508
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerView_Python")
 *     viewcontext(PyVwr(viewer), vwr)             # <<<<<<<<<<<<<<
 *     cdef view = PyVwr(viewer).view
 *     if view is not None:
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(__pyx_v_viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 508, __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(5, 508, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":509
 *     FunctionBegin(b"PetscViewerView_Python")
 *     viewcontext(PyVwr(viewer), vwr)
 *     cdef view = PyVwr(viewer).view             # <<<<<<<<<<<<<<
 *     if view is not None:
 *         view(Viewer_(viewer), Viewer_(vwr))
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(__pyx_v_viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 509, __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":510
 *     viewcontext(PyVwr(viewer), vwr)
 *     cdef view = PyVwr(viewer).view
 *     if view is not None:             # <<<<<<<<<<<<<<
 *         view(Viewer_(viewer), Viewer_(vwr))
 *     return FunctionEnd()
*/
  __pyx_t_4 = (__pyx_v_view != Py_None);
  if (__pyx_t_4) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":511
 *     cdef view = PyVwr(viewer).view
 *     if view is not None:
 *         view(Viewer_(viewer), Viewer_(vwr))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_view);
    __pyx_t_5 = __pyx_v_view; 
    __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_viewer)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_6, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 511, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":510
 *     viewcontext(PyVwr(viewer), vwr)
 *     cdef view = PyVwr(viewer).view
 *     if view is not None:             # <<<<<<<<<<<<<<
 *         view(Viewer_(viewer), Viewer_(vwr))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":512
 *     if view is not None:
 *         view(Viewer_(viewer), Viewer_(vwr))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode PetscViewerFlush_Python(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":503
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerView_Python(             # <<<<<<<<<<<<<<
 *     PetscViewer viewer,
 *     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.PetscViewerView_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_view);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":514
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerFlush_Python(             # <<<<<<<<<<<<<<
 *     PetscViewer viewer,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PetscViewerFlush_Python(PetscViewer __pyx_v_viewer) {
  PyObject *__pyx_v_flush = 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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PetscViewerFlush_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":517
 *     PetscViewer viewer,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerFlush_Python")             # <<<<<<<<<<<<<<
 *     cdef flush = PyVwr(viewer).flush
 *     if flush is not None:
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PetscViewerFlush_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":518
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PetscViewerFlush_Python")
 *     cdef flush = PyVwr(viewer).flush             # <<<<<<<<<<<<<<
 *     if flush is not None:
 *         flush(Viewer_(viewer))
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyVwr(__pyx_v_viewer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_flush); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_flush = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":519
 *     FunctionBegin(b"PetscViewerFlush_Python")
 *     cdef flush = PyVwr(viewer).flush
 *     if flush is not None:             # <<<<<<<<<<<<<<
 *         flush(Viewer_(viewer))
 *     return FunctionEnd()
*/
  __pyx_t_3 = (__pyx_v_flush != Py_None);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":520
 *     cdef flush = PyVwr(viewer).flush
 *     if flush is not None:
 *         flush(Viewer_(viewer))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * # --------------------------------------------------------------------
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_flush);
    __pyx_t_4 = __pyx_v_flush; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_viewer)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 520, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":519
 *     FunctionBegin(b"PetscViewerFlush_Python")
 *     cdef flush = PyVwr(viewer).flush
 *     if flush is not None:             # <<<<<<<<<<<<<<
 *         flush(Viewer_(viewer))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":521
 *     if flush is not None:
 *         flush(Viewer_(viewer))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * # --------------------------------------------------------------------
 * 
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":514
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PetscViewerFlush_Python(             # <<<<<<<<<<<<<<
 *     PetscViewer viewer,
 *     ) 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("petsc4py.PETSc.PetscViewerFlush_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_flush);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":579
 * @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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":580
 * 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":581
 * 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":580
 * 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":583
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyMat), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 583, __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":579
 * @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":585
 *         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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":587
 * 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":588
 *     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(5, 588, __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(5, 588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":589
 *     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":585
 *         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":591
 *     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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":593
 * cdef public PetscErrorCode MatPythonSetContext(PetscMat mat, void *ctx) \
 *     except PETSC_ERR_PYTHON:
 *     FunctionBegin(b"MatPythonSetContext")             # <<<<<<<<<<<<<<
 *     PyMat(mat).setcontext(ctx, Mat_(mat))
 *     mat.preallocated = PETSC_FALSE
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatPythonSetContext"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":594
 *     except PETSC_ERR_PYTHON:
 *     FunctionBegin(b"MatPythonSetContext")
 *     PyMat(mat).setcontext(ctx, Mat_(mat))             # <<<<<<<<<<<<<<
 *     mat.preallocated = PETSC_FALSE
 *     return FunctionEnd()
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 594, __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(5, 594, __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(5, 594, __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":595
 *     FunctionBegin(b"MatPythonSetContext")
 *     PyMat(mat).setcontext(ctx, Mat_(mat))
 *     mat.preallocated = PETSC_FALSE             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_v_mat->preallocated = PETSC_FALSE;

  /* "petsc4py/PETSc/libpetsc4py.pyx":596
 *     PyMat(mat).setcontext(ctx, Mat_(mat))
 *     mat.preallocated = PETSC_FALSE
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode MatPythonSetType_PYTHON(PetscMat mat, const char *name) \
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":591
 *     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":598
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode MatPythonSetType_PYTHON(PetscMat mat, const 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 const *__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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatPythonSetType_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":600
 * cdef PetscErrorCode MatPythonSetType_PYTHON(PetscMat mat, const 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":601
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"MatPythonSetType_PYTHON")
 *     if name == NULL: return FunctionEnd() # XXX             # <<<<<<<<<<<<<<
 *     cdef object ctx = createcontext(name)
 *     MatPythonSetContext(mat, <void*>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":602
 *     FunctionBegin(b"MatPythonSetType_PYTHON")
 *     if name == NULL: return FunctionEnd() # XXX
 *     cdef object ctx = createcontext(name)             # <<<<<<<<<<<<<<
 *     MatPythonSetContext(mat, <void*>ctx)
 *     PyMat(mat).setname(name)
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ctx = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":603
 *     if name == NULL: return FunctionEnd() # XXX
 *     cdef object ctx = createcontext(name)
 *     MatPythonSetContext(mat, <void*>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(5, 603, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":604
 *     cdef object ctx = createcontext(name)
 *     MatPythonSetContext(mat, <void*>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(5, 604, __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(5, 604, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":605
 *     MatPythonSetContext(mat, <void*>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":598
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode MatPythonSetType_PYTHON(PetscMat mat, const 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":607
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatPythonGetType_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":609
 * 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":610
 *     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(5, 610, __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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 610, __pyx_L1_error)
  (__pyx_v_name[0]) = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":611
 *     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":607
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":645
 *                     }
 * 
 * cdef PetscErrorCode MatCreate_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatCreate_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":648
 *     PetscMat mat,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"MatCreate_Python")             # <<<<<<<<<<<<<<
 *     cdef MatOps ops       = mat.ops
 *     ops.destroy           = MatDestroy_Python
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatCreate_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":649
 *     ) except PETSC_ERR_PYTHON with gil:
 *     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":650
 *     FunctionBegin(b"MatCreate_Python")
 *     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":651
 *     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":652
 *     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":653
 *     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":654
 *     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":655
 *     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":656
 *     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":657
 *     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":658
 *     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":659
 *     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":660
 *     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":661
 *     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":662
 *     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":663
 *     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":664
 *     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":665
 *     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":666
 *     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":667
 *     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":668
 *     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":669
 *     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":670
 *     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":671
 *     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":672
 *     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":673
 *     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":674
 *     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":675
 *     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":676
 *     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":677
 *     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":678
 *     ops.solvetransposeadd = MatSolveTransposeAdd_Python
 *     ops.getdiagonal       = MatGetDiagonal_Python
 *     ops.setdiagonal       = MatSetDiagonal_Python             # <<<<<<<<<<<<<<
 *     ops.diagonalscale     = MatDiagonalScale_Python
 *     ops.norm              = MatNorm_Python
*/
  __pyx_v_ops->diagonalset = __pyx_f_8petsc4py_5PETSc_MatSetDiagonal_Python;

  /* "petsc4py/PETSc/libpetsc4py.pyx":679
 *     ops.getdiagonal       = MatGetDiagonal_Python
 *     ops.setdiagonal       = MatSetDiagonal_Python
 *     ops.diagonalscale     = MatDiagonalScale_Python             # <<<<<<<<<<<<<<
 *     ops.norm              = MatNorm_Python
 *     ops.realpart          = MatRealPart_Python
*/
  __pyx_v_ops->diagonalscale = __pyx_f_8petsc4py_5PETSc_MatDiagonalScale_Python;

  /* "petsc4py/PETSc/libpetsc4py.pyx":680
 *     ops.setdiagonal       = MatSetDiagonal_Python
 *     ops.diagonalscale     = MatDiagonalScale_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":681
 *     ops.diagonalscale     = MatDiagonalScale_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":682
 *     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":683
 *     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":684
 *     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":685
 *     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":687
 *     ops.getdiagonalblock  = MatGetDiagonalBlock_Python
 * 
 *     ops.productsetfromoptions = MatProductSetFromOptions_Python             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __pyx_v_ops->productsetfromoptions = __pyx_f_8petsc4py_5PETSc_MatProductSetFromOptions_Python;

  /* "petsc4py/PETSc/libpetsc4py.pyx":690
 * 
 *     #
 *     mat.assembled    = PETSC_TRUE  # XXX             # <<<<<<<<<<<<<<
 *     mat.preallocated = PETSC_FALSE # XXX
 *     #
*/
  __pyx_v_mat->assembled = PETSC_TRUE;

  /* "petsc4py/PETSc/libpetsc4py.pyx":691
 *     #
 *     mat.assembled    = PETSC_TRUE  # XXX
 *     mat.preallocated = PETSC_FALSE # XXX             # <<<<<<<<<<<<<<
 *     #
 *     CHKERR(PetscObjectComposeFunction(
*/
  __pyx_v_mat->preallocated = PETSC_FALSE;

  /* "petsc4py/PETSc/libpetsc4py.pyx":693
 *     mat.preallocated = PETSC_FALSE # XXX
 *     #
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>mat, b"MatPythonSetType_C",
 *             <PetscVoidFunction>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(5, 693, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":696
 *             <PetscObject>mat, b"MatPythonSetType_C",
 *             <PetscVoidFunction>MatPythonSetType_PYTHON))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>mat, b"MatPythonGetType_C",
 *             <PetscVoidFunction>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(5, 696, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":699
 *             <PetscObject>mat, b"MatPythonGetType_C",
 *             <PetscVoidFunction>MatPythonGetType_PYTHON))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>mat, b"MatProductSetFromOptions_anytype_C",
 *             <PetscVoidFunction>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(5, 699, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":702
 *             <PetscObject>mat, b"MatProductSetFromOptions_anytype_C",
 *             <PetscVoidFunction>MatProductSetFromOptions_Python))
 *     CHKERR(PetscObjectChangeTypeName(             # <<<<<<<<<<<<<<
 *             <PetscObject>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(5, 702, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":705
 *             <PetscObject>mat, MATPYTHON))
 *     #
 *     cdef ctx = PyMat(NULL)             # <<<<<<<<<<<<<<
 *     mat.data = <void*> ctx
 *     Py_INCREF(<PyObject*>mat.data)
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_ctx = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":706
 *     #
 *     cdef ctx = PyMat(NULL)
 *     mat.data = <void*> ctx             # <<<<<<<<<<<<<<
 *     Py_INCREF(<PyObject*>mat.data)
 *     return FunctionEnd()
*/
  __pyx_v_mat->data = ((void *)__pyx_v_ctx);

  /* "petsc4py/PETSc/libpetsc4py.pyx":707
 *     cdef ctx = PyMat(NULL)
 *     mat.data = <void*> ctx
 *     Py_INCREF(<PyObject*>mat.data)             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  Py_INCREF(((PyObject *)__pyx_v_mat->data));

  /* "petsc4py/PETSc/libpetsc4py.pyx":708
 *     mat.data = <void*> ctx
 *     Py_INCREF(<PyObject*>mat.data)
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscErrorCode MatDestroy_Python_inner(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":645
 *                     }
 * 
 * cdef PetscErrorCode MatCreate_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":710
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode MatDestroy_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscMat mat,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatDestroy_Python_inner", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":713
 *     PetscMat mat,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     try:             # <<<<<<<<<<<<<<
 *         addRef(mat)
 *         MatPythonSetContext(mat, NULL)
*/
  /*try:*/ {

    /* "petsc4py/PETSc/libpetsc4py.pyx":714
 *     ) 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":715
 *     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(5, 715, __pyx_L4_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":717
 *         MatPythonSetContext(mat, NULL)
 *     finally:
 *         delRef(mat)             # <<<<<<<<<<<<<<
 *         Py_DECREF(<PyObject*>mat.data)
 *         mat.data = NULL
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_mat);

      /* "petsc4py/PETSc/libpetsc4py.pyx":718
 *     finally:
 *         delRef(mat)
 *         Py_DECREF(<PyObject*>mat.data)             # <<<<<<<<<<<<<<
 *         mat.data = NULL
 *     return PETSC_SUCCESS
*/
      Py_DECREF(((PyObject *)__pyx_v_mat->data));

      /* "petsc4py/PETSc/libpetsc4py.pyx":719
 *         delRef(mat)
 *         Py_DECREF(<PyObject*>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;
       __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if ( 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":717
 *         MatPythonSetContext(mat, NULL)
 *     finally:
 *         delRef(mat)             # <<<<<<<<<<<<<<
 *         Py_DECREF(<PyObject*>mat.data)
 *         mat.data = NULL
*/
        __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_mat);

        /* "petsc4py/PETSc/libpetsc4py.pyx":718
 *     finally:
 *         delRef(mat)
 *         Py_DECREF(<PyObject*>mat.data)             # <<<<<<<<<<<<<<
 *         mat.data = NULL
 *     return PETSC_SUCCESS
*/
        Py_DECREF(((PyObject *)__pyx_v_mat->data));

        /* "petsc4py/PETSc/libpetsc4py.pyx":719
 *         delRef(mat)
 *         Py_DECREF(<PyObject*>mat.data)
 *         mat.data = NULL             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
        __pyx_v_mat->data = NULL;
      }
      __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":720
 *         Py_DECREF(<PyObject*>mat.data)
 *         mat.data = NULL
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode MatDestroy_Python(
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":710
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode MatDestroy_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscMat mat,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":722
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode MatDestroy_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "petsc4py/PETSc/libpetsc4py.pyx":725
 *     PetscMat mat,
 *     ) except PETSC_ERR_PYTHON nogil:
 *     FunctionBegin(b"MatDestroy_Python")             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectComposeFunction(
 *             <PetscObject>mat, b"MatPythonSetType_C",
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatDestroy_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":726
 *     ) except PETSC_ERR_PYTHON nogil:
 *     FunctionBegin(b"MatDestroy_Python")
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>mat, b"MatPythonSetType_C",
 *             <PetscVoidFunction>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(5, 726, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":729
 *             <PetscObject>mat, b"MatPythonSetType_C",
 *             <PetscVoidFunction>NULL))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>mat, b"MatPythonGetType_C",
 *             <PetscVoidFunction>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(5, 729, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":732
 *             <PetscObject>mat, b"MatPythonGetType_C",
 *             <PetscVoidFunction>NULL))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>mat, b"MatProductSetFromOptions_anytype_C",
 *             <PetscVoidFunction>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(5, 732, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":735
 *             <PetscObject>mat, b"MatProductSetFromOptions_anytype_C",
 *             <PetscVoidFunction>NULL))
 *     CHKERR(PetscObjectChangeTypeName(             # <<<<<<<<<<<<<<
 *             <PetscObject>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(5, 735, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":738
 *             <PetscObject>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(5, 738, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":739
 * 
 *     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":722
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode MatDestroy_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("petsc4py.PETSc.MatDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":741
 *     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[2048];
  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;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatSetFromOptions_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":745
 *     PetscOptionItems PetscOptionsObject,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"MatSetFromOptions_Python")             # <<<<<<<<<<<<<<
 *     cdef char name[2048], *defval = PyMat(mat).getname()
 *     cdef PetscBool found = PETSC_FALSE
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatSetFromOptions_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":746
 *     ) except PETSC_ERR_PYTHON with gil:
 *     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(5, 746, __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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 746, __pyx_L1_error)
  __pyx_v_defval = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":747
 *     FunctionBegin(b"MatSetFromOptions_Python")
 *     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":748
 *     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":749
 *     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)); <void>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(5, 749, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":751
 *     CHKERR(PetscOptionsString(
 *             b"-mat_python_type", b"Python [package.]module[.{class|function}]",
 *             b"MatPythonSetType", defval, name, sizeof(name), &found)); <void>opts             # <<<<<<<<<<<<<<
 *     if found and name[0]:
 *         CHKERR(MatPythonSetType_PYTHON(mat, name))
*/
  ((void)PetscOptionsObject);

  /* "petsc4py/PETSc/libpetsc4py.pyx":752
 *             b"-mat_python_type", b"Python [package.]module[.{class|function}]",
 *             b"MatPythonSetType", defval, name, sizeof(name), &found)); <void>opts
 *     if found and name[0]:             # <<<<<<<<<<<<<<
 *         CHKERR(MatPythonSetType_PYTHON(mat, name))
 *     #
*/
  __pyx_t_5 = (__pyx_v_found != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    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":753
 *             b"MatPythonSetType", defval, name, sizeof(name), &found)); <void>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(5, 753, __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(5, 753, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":752
 *             b"-mat_python_type", b"Python [package.]module[.{class|function}]",
 *             b"MatPythonSetType", defval, name, sizeof(name), &found)); <void>opts
 *     if found and name[0]:             # <<<<<<<<<<<<<<
 *         CHKERR(MatPythonSetType_PYTHON(mat, name))
 *     #
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":755
 *         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(5, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 755, __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":756
 *     #
 *     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":757
 *     cdef setFromOptions = PyMat(mat).setFromOptions
 *     if setFromOptions is not None:
 *         setFromOptions(Mat_(mat))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_setFromOptions);
    __pyx_t_8 = __pyx_v_setFromOptions; 
    __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_9};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 757, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":756
 *     #
 *     cdef setFromOptions = PyMat(mat).setFromOptions
 *     if setFromOptions is not None:             # <<<<<<<<<<<<<<
 *         setFromOptions(Mat_(mat))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":758
 *     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":741
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":760
 *     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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatView_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":764
 *     PetscViewer vwr,
 *     ) 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":765
 *     ) 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(5, 765, __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(5, 765, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":766
 *     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(5, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 766, __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":767
 *     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":768
 *     cdef view = PyMat(mat).view
 *     if view is not None:
 *         view(Mat_(mat), Viewer_(vwr))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_view);
    __pyx_t_5 = __pyx_v_view; 
    __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_6, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 768, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":767
 *     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":769
 *     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":760
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":771
 *     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;
  size_t __pyx_t_7;
  Mat __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatDuplicate_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":776
 *     PetscMat* out,
 *     ) 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":777
 *     ) 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), <long>op)
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_duplicate); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 777, __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":778
 *     FunctionBegin(b"MatDuplicate_Python")
 *     cdef duplicate = PyMat(mat).duplicate
 *     if duplicate is None: return UNSUPPORTED(b"duplicate")             # <<<<<<<<<<<<<<
 *     cdef Mat m = duplicate(Mat_(mat), <long>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(__pyx_k_duplicate);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":779
 *     cdef duplicate = PyMat(mat).duplicate
 *     if duplicate is None: return UNSUPPORTED(b"duplicate")
 *     cdef Mat m = duplicate(Mat_(mat), <long>op)             # <<<<<<<<<<<<<<
 *     out[0] = m.mat; m.mat = NULL
 *     return FunctionEnd()
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_duplicate);
  __pyx_t_4 = __pyx_v_duplicate; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyLong_From_long(((long)__pyx_v_op)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_5, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(5, 779, __pyx_L1_error)
  __pyx_v_m = ((struct PyPetscMatObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":780
 *     if duplicate is None: return UNSUPPORTED(b"duplicate")
 *     cdef Mat m = duplicate(Mat_(mat), <long>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":781
 *     cdef Mat m = duplicate(Mat_(mat), <long>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":771
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":783
 *     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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatCopy_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":788
 *     PetscMatStructure op,
 *     ) 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":789
 *     ) 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), <long>op)
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 789, __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":790
 *     FunctionBegin(b"MatCopy_Python")
 *     cdef copy = PyMat(mat).copy
 *     if copy is None: return UNSUPPORTED(b"copy")             # <<<<<<<<<<<<<<
 *     copy(Mat_(mat), Mat_(out), <long>op)
 *     return FunctionEnd()
*/
  __pyx_t_3 = (__pyx_v_copy == Py_None);
  if (__pyx_t_3) {
    __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(__pyx_k_copy);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":791
 *     cdef copy = PyMat(mat).copy
 *     if copy is None: return UNSUPPORTED(b"copy")
 *     copy(Mat_(mat), Mat_(out), <long>op)             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_copy);
  __pyx_t_4 = __pyx_v_copy; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_out)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyLong_From_long(((long)__pyx_v_op)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":792
 *     if copy is None: return UNSUPPORTED(b"copy")
 *     copy(Mat_(mat), Mat_(out), <long>op)
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode MatGetDiagonalBlock_Python(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":783
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":794
 *     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;
  size_t __pyx_t_16;
  Mat __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatGetDiagonalBlock_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":798
 *     PetscMat  *out
 *     ) 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":799
 *     ) 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(5, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_getDiagonalBlock); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 799, __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":800
 *     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":801
 *     cdef getDiagonalBlock = PyMat(mat).getDiagonalBlock
 *     if getDiagonalBlock is None:
 *         try:             # <<<<<<<<<<<<<<
 *             mat.ops.getdiagonalblock = NULL
 *             CHKERR(MatGetDiagonalBlock(mat, out))
*/
    /*try:*/ {

      /* "petsc4py/PETSc/libpetsc4py.pyx":802
 *     if getDiagonalBlock is None:
 *         try:
 *             mat.ops.getdiagonalblock = NULL             # <<<<<<<<<<<<<<
 *             CHKERR(MatGetDiagonalBlock(mat, out))
 *         finally:
*/
      __pyx_v_mat->ops->getdiagonalblock = NULL;

      /* "petsc4py/PETSc/libpetsc4py.pyx":803
 *         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(5, 803, __pyx_L5_error)
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":805
 *             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;
         __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if ( 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;
        }
        __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.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":800
 *     FunctionBegin(b"MatGetDiagonalBlock_Python")
 *     cdef getDiagonalBlock = PyMat(mat).getDiagonalBlock
 *     if getDiagonalBlock is None:             # <<<<<<<<<<<<<<
 *         try:
 *             mat.ops.getdiagonalblock = NULL
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":807
 *             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 = NULL;
  __Pyx_INCREF(__pyx_v_getDiagonalBlock);
  __pyx_t_14 = __pyx_v_getDiagonalBlock; 
  __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
    __pyx_t_16 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_15};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_16, (2-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 807, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(5, 807, __pyx_L1_error)
  __pyx_v_sub = ((struct PyPetscMatObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":808
 *         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_17 = __pyx_v_sub->mat;
    (__pyx_v_out[0]) = __pyx_t_17;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":809
 *     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":794
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":811
 *     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;
  size_t __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  Mat __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatCreateSubMatrix_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":818
 *     PetscMat *out,
 *     ) 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":819
 *     ) 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(5, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_createSubMatrix); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 819, __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":820
 *     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":821
 *     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":822
 *     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":823
 *         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(5, 823, __pyx_L5_error)
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":825
 *             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;
         __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if ( 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;
        }
        __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":826
 *         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":820
 *     FunctionBegin(b"MatCreateSubMatrix_Python")
 *     cdef createSubMatrix = PyMat(mat).createSubMatrix
 *     if createSubMatrix is None:             # <<<<<<<<<<<<<<
 *         try:
 *             mat.ops.createsubmatrix = NULL
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":827
 *             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":828
 *         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":829
 *     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":828
 *         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":830
 *     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":831
 *         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 = NULL;
    __Pyx_INCREF(__pyx_v_createSubMatrix);
    __pyx_t_14 = __pyx_v_createSubMatrix; 
    __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_16 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_IS_(__pyx_v_row)); if (unlikely(!__pyx_t_16)) __PYX_ERR(5, 831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __pyx_t_17 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_IS_(__pyx_v_col)); if (unlikely(!__pyx_t_17)) __PYX_ERR(5, 831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_18 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_14))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
      __pyx_t_18 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_1, __pyx_t_15, __pyx_t_16, __pyx_t_17, Py_None};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_18, (5-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 831, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(5, 831, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_sub, ((struct PyPetscMatObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":832
 *     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":833
 *         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":832
 *     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":830
 *     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":834
 *         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":835
 *             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_14 = NULL;
    __Pyx_INCREF(__pyx_v_createSubMatrix);
    __pyx_t_17 = __pyx_v_createSubMatrix; 
    __pyx_t_16 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_16)) __PYX_ERR(5, 835, __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(5, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_IS_(__pyx_v_col)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_19 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_((__pyx_v_out[0]))); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_19);
    __pyx_t_18 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_17))) {
      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_17);
      assert(__pyx_t_14);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_17);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_17, __pyx__function);
      __pyx_t_18 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_14, __pyx_t_16, __pyx_t_15, __pyx_t_1, __pyx_t_19};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_17, __pyx_callargs+__pyx_t_18, (5-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 835, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(5, 835, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_sub, ((struct PyPetscMatObject *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":834
 *         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":836
 *     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":837
 *         sub = createSubMatrix(Mat_(mat), IS_(row), IS_(col), Mat_(out[0]))
 *     if sub is not None:
 *         out[0] = sub.mat             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_20 = __pyx_v_sub->mat;
    (__pyx_v_out[0]) = __pyx_t_20;

    /* "petsc4py/PETSc/libpetsc4py.pyx":836
 *     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":838
 *     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":811
 *     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_19);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":840
 *     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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatSetOption_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":845
 *     PetscBool flag,
 *     ) 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":846
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"MatSetOption_Python")
 *     cdef setOption = PyMat(mat).setOption             # <<<<<<<<<<<<<<
 *     if setOption is not None:
 *         setOption(Mat_(mat), <long>op, <bint>(<int>flag))
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_setOption); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 846, __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":847
 *     FunctionBegin(b"MatSetOption_Python")
 *     cdef setOption = PyMat(mat).setOption
 *     if setOption is not None:             # <<<<<<<<<<<<<<
 *         setOption(Mat_(mat), <long>op, <bint>(<int>flag))
 *     return FunctionEnd()
*/
  __pyx_t_3 = (__pyx_v_setOption != Py_None);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":848
 *     cdef setOption = PyMat(mat).setOption
 *     if setOption is not None:
 *         setOption(Mat_(mat), <long>op, <bint>(<int>flag))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_setOption);
    __pyx_t_4 = __pyx_v_setOption; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyLong_From_long(((long)__pyx_v_op)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyBool_FromLong((((int)__pyx_v_flag) != 0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 848, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":847
 *     FunctionBegin(b"MatSetOption_Python")
 *     cdef setOption = PyMat(mat).setOption
 *     if setOption is not None:             # <<<<<<<<<<<<<<
 *         setOption(Mat_(mat), <long>op, <bint>(<int>flag))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":849
 *     if setOption is not None:
 *         setOption(Mat_(mat), <long>op, <bint>(<int>flag))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode MatSetUp_Python(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":840
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":851
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode MatSetUp_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_MatSetUp_Python(Mat __pyx_v_mat) {
  PetscInt __pyx_v_rbs;
  PetscInt __pyx_v_cbs;
  char __pyx_v_name[2048];
  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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatSetUp_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":854
 *     PetscMat mat,
 *     ) 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":855
 *     ) 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":856
 *     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(5, 856, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":857
 *     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(5, 857, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":858
 *     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":859
 *     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":860
 *     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(5, 860, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":861
 *     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(5, 861, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":862
 *     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(5, 862, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":863
 *     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(5, 863, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":864
 *     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":867
 *     #
 *     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":868
 *     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(5, 868, __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":869
 *     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(5, 869, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":872
 *                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:
*/
    __pyx_t_4 = (__pyx_v_found != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      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":873
 *                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(5, 873, __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(5, 873, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":872
 *                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":868
 *     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":874
 *         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(5, 874, __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":875
 *             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, __pyx_k_Python_context_not_set_call_one_2);
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":874
 *         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":881
 *                            "-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(5, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 881, __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":882
 *     #
 *     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":883
 *     cdef setUp = PyMat(mat).setUp
 *     if setUp is not None:
 *         setUp(Mat_(mat))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_setUp);
    __pyx_t_7 = __pyx_v_setUp; 
    __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 883, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_8};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 883, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":882
 *     #
 *     cdef setUp = PyMat(mat).setUp
 *     if setUp is not None:             # <<<<<<<<<<<<<<
 *         setUp(Mat_(mat))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":884
 *     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":851
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode MatSetUp_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":886
 *     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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatAssemblyBegin_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":890
 *     PetscMatAssemblyType at,
 *     ) 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":891
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"MatAssemblyBegin_Python")
 *     cdef assembly = PyMat(mat).assemblyBegin             # <<<<<<<<<<<<<<
 *     if assembly is not None:
 *         assembly(Mat_(mat), <long>at)
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_assemblyBegin); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 891, __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":892
 *     FunctionBegin(b"MatAssemblyBegin_Python")
 *     cdef assembly = PyMat(mat).assemblyBegin
 *     if assembly is not None:             # <<<<<<<<<<<<<<
 *         assembly(Mat_(mat), <long>at)
 *     return FunctionEnd()
*/
  __pyx_t_3 = (__pyx_v_assembly != Py_None);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":893
 *     cdef assembly = PyMat(mat).assemblyBegin
 *     if assembly is not None:
 *         assembly(Mat_(mat), <long>at)             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_assembly);
    __pyx_t_4 = __pyx_v_assembly; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyLong_From_long(((long)__pyx_v_at)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_5, __pyx_t_6};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 893, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":892
 *     FunctionBegin(b"MatAssemblyBegin_Python")
 *     cdef assembly = PyMat(mat).assemblyBegin
 *     if assembly is not None:             # <<<<<<<<<<<<<<
 *         assembly(Mat_(mat), <long>at)
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":894
 *     if assembly is not None:
 *         assembly(Mat_(mat), <long>at)
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode MatAssemblyEnd_Python(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":886
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":896
 *     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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatAssemblyEnd_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":900
 *     PetscMatAssemblyType at,
 *     ) 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":901
 *     ) 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(5, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_assemblyEnd); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 901, __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":902
 *     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":903
 *     cdef assembly = PyMat(mat).assemblyEnd
 *     if assembly is None:
 *         assembly = PyMat(mat).assembly             # <<<<<<<<<<<<<<
 *     if assembly is not None:
 *         assembly(Mat_(mat), <long>at)
*/
    __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyMat(__pyx_v_mat)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_assembly); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 903, __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":902
 *     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":904
 *     if assembly is None:
 *         assembly = PyMat(mat).assembly
 *     if assembly is not None:             # <<<<<<<<<<<<<<
 *         assembly(Mat_(mat), <long>at)
 *     return FunctionEnd()
*/
  __pyx_t_3 = (__pyx_v_assembly != Py_None);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":905
 *         assembly = PyMat(mat).assembly
 *     if assembly is not None:
 *         assembly(Mat_(mat), <long>at)             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_assembly);
    __pyx_t_4 = __pyx_v_assembly; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyLong_From_long(((long)__pyx_v_at)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 905, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":904
 *     if assembly is None:
 *         assembly = PyMat(mat).assembly
 *     if assembly is not None:             # <<<<<<<<<<<<<<
 *         assembly(Mat_(mat), <long>at)
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":906
 *     if assembly is not None:
 *         assembly(Mat_(mat), <long>at)
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode MatZeroEntries_Python(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":896
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":908
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode MatZeroEntries_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatZeroEntries_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":911
 *     PetscMat mat,
 *     ) 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":912
 *     ) 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(5, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_zeroEntries); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 912, __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":913
 *     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(__pyx_k_zeroEntries);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":914
 *     cdef zeroEntries = PyMat(mat).zeroEntries
 *     if zeroEntries is None: return UNSUPPORTED(b"zeroEntries")
 *     zeroEntries(Mat_(mat))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_zeroEntries);
  __pyx_t_4 = __pyx_v_zeroEntries; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":915
 *     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":908
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode MatZeroEntries_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat,
 *     ) 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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":917
 *     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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatZeroRowsColumns_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":925
 *     PetscVec b,
 *     ) 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":926
 *     ) 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(5, 926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_zeroRowsColumns); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 926, __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":927
 *     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(__pyx_k_zeroRowsColumns);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":928
 *     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(5, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_pyrows = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":929
 *     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 = NULL;
  __Pyx_INCREF(__pyx_v_zeroRowsColumns);
  __pyx_t_4 = __pyx_v_zeroRowsColumns; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_diag); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[6] = {__pyx_t_1, __pyx_t_5, ((PyObject *)__pyx_v_pyrows), __pyx_t_6, __pyx_t_7, __pyx_t_8};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (6-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 929, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":930
 *     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":917
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":932
 *     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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatScale_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":936
 *     PetscScalar s,
 *     ) 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":937
 *     ) 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(5, 937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_scale); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 937, __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":938
 *     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(__pyx_k_scale);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":939
 *     cdef scale = PyMat(mat).scale
 *     if scale is None: return UNSUPPORTED(b"scale")
 *     scale(Mat_(mat), toScalar(s))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_scale);
  __pyx_t_4 = __pyx_v_scale; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 939, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_s); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 939, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_5, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":940
 *     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":932
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":942
 *     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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatShift_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":946
 *     PetscScalar s,
 *     ) 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":947
 *     ) 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(5, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_shift); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 947, __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":948
 *     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(__pyx_k_shift);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":949
 *     cdef shift = PyMat(mat).shift
 *     if shift is None: return UNSUPPORTED(b"shift")
 *     shift(Mat_(mat), toScalar(s))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_shift);
  __pyx_t_4 = __pyx_v_shift; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toScalar(__pyx_v_s); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_5, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 949, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":950
 *     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":942
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":952
 *     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;
  size_t __pyx_t_16;
  PyObject *(*__pyx_t_17)(PyObject *);
  Vec __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatCreateVecs_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":957
 *     PetscVec *y,
 *     ) 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":958
 *     ) 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(5, 958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_createVecs); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 958, __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":959
 *     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":960
 *     cdef createVecs = PyMat(mat).createVecs
 *     if createVecs is None:
 *         try:             # <<<<<<<<<<<<<<
 *             mat.ops.getvecs = NULL
 *             CHKERR(MatCreateVecs(mat, x, y))
*/
    /*try:*/ {

      /* "petsc4py/PETSc/libpetsc4py.pyx":961
 *     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":962
 *         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(5, 962, __pyx_L5_error)
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":964
 *             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;
         __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if ( 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;
        }
        __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":965
 *         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":959
 *     FunctionBegin(b"MatCreateVecs_Python")
 *     cdef createVecs = PyMat(mat).createVecs
 *     if createVecs is None:             # <<<<<<<<<<<<<<
 *         try:
 *             mat.ops.getvecs = NULL
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":967
 *         return FunctionEnd()
 *     cdef Vec u, v
 *     u, v = createVecs(Mat_(mat))             # <<<<<<<<<<<<<<
 *     if x != NULL:
 *         x[0] = u.vec
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_createVecs);
  __pyx_t_14 = __pyx_v_createVecs; 
  __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
    __pyx_t_16 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_15};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_16, (2-__pyx_t_16) | (__pyx_t_16*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 967, __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(5, 967, __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_INCREF(__pyx_t_14);
      __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1);
      __Pyx_INCREF(__pyx_t_15);
    } else {
      __pyx_t_14 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 967, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_14);
      __pyx_t_15 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
      if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 967, __pyx_L1_error)
      __Pyx_XGOTREF(__pyx_t_15);
    }
    #else
    __pyx_t_14 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_15 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 967, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_17 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1);
    index = 0; __pyx_t_14 = __pyx_t_17(__pyx_t_1); if (unlikely(!__pyx_t_14)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_14);
    index = 1; __pyx_t_15 = __pyx_t_17(__pyx_t_1); if (unlikely(!__pyx_t_15)) goto __pyx_L9_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_15);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_1), 2) < (0)) __PYX_ERR(5, 967, __pyx_L1_error)
    __pyx_t_17 = NULL;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L10_unpacking_done;
    __pyx_L9_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_17 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(5, 967, __pyx_L1_error)
    __pyx_L10_unpacking_done:;
  }
  if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(5, 967, __pyx_L1_error)
  if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec))))) __PYX_ERR(5, 967, __pyx_L1_error)
  __pyx_v_u = ((struct PyPetscVecObject *)__pyx_t_14);
  __pyx_t_14 = 0;
  __pyx_v_v = ((struct PyPetscVecObject *)__pyx_t_15);
  __pyx_t_15 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":968
 *     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":969
 *     u, v = createVecs(Mat_(mat))
 *     if x != NULL:
 *         x[0] = u.vec             # <<<<<<<<<<<<<<
 *         u.vec = NULL
 *     if y != NULL:
*/
    __pyx_t_18 = __pyx_v_u->vec;
    (__pyx_v_x[0]) = __pyx_t_18;

    /* "petsc4py/PETSc/libpetsc4py.pyx":970
 *     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":968
 *     cdef Vec u, v
 *     u, v = createVecs(Mat_(mat))
 *     if x != NULL:             # <<<<<<<<<<<<<<
 *         x[0] = u.vec
 *         u.vec = NULL
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":971
 *         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":972
 *         u.vec = NULL
 *     if y != NULL:
 *         y[0] = v.vec             # <<<<<<<<<<<<<<
 *         v.vec = NULL
 *     return FunctionEnd()
*/
    __pyx_t_18 = __pyx_v_v->vec;
    (__pyx_v_y[0]) = __pyx_t_18;

    /* "petsc4py/PETSc/libpetsc4py.pyx":973
 *     if y != NULL:
 *         y[0] = v.vec
 *         v.vec = NULL             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_v_v->vec = NULL;

    /* "petsc4py/PETSc/libpetsc4py.pyx":971
 *         x[0] = u.vec
 *         u.vec = NULL
 *     if y != NULL:             # <<<<<<<<<<<<<<
 *         y[0] = v.vec
 *         v.vec = NULL
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":974
 *         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":952
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":976
 *     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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatMult_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":981
 *     PetscVec y,
 *     ) 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":982
 *     ) 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(5, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_mult); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 982, __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":983
 *     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(__pyx_k_mult);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":984
 *     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 = NULL;
  __Pyx_INCREF(__pyx_v_mult);
  __pyx_t_4 = __pyx_v_mult; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 984, __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(5, 984, __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(5, 984, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":985
 *     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":976
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":987
 *     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;
  size_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatMultTranspose_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":992
 *     PetscVec y,
 *     ) 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":993
 *     ) 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(5, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_multTranspose); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 993, __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":994
 *     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":995
 *     cdef multTranspose = PyMat(mat).multTranspose
 *     if multTranspose is None:
 *         try:             # <<<<<<<<<<<<<<
 *             mat.ops.multtranspose = NULL
 *             CHKERR(MatMultTranspose(mat, x, y))
*/
    /*try:*/ {

      /* "petsc4py/PETSc/libpetsc4py.pyx":996
 *     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":997
 *         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(5, 997, __pyx_L5_error)
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":999
 *             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;
         __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if ( 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;
        }
        __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":1000
 *         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":994
 *     FunctionBegin(b"MatMultTranspose_Python")
 *     cdef multTranspose = PyMat(mat).multTranspose
 *     if multTranspose is None:             # <<<<<<<<<<<<<<
 *         try:
 *             mat.ops.multtranspose = NULL
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1001
 *             mat.ops.multtranspose = MatMultTranspose_Python
 *         return FunctionEnd()
 *     multTranspose(Mat_(mat), Vec_(x), Vec_(y))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_multTranspose);
  __pyx_t_14 = __pyx_v_multTranspose; 
  __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 1001, __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(5, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_17)) __PYX_ERR(5, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
    __pyx_t_18 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_15, __pyx_t_16, __pyx_t_17};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_18, (4-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1002
 *         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":987
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1004
 *     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;
  size_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatMultHermitian_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1009
 *     PetscVec y,
 *     ) 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":1010
 *     ) 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(5, 1010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_multHermitian); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1010, __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":1011
 *     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":1012
 *     cdef multHermitian = PyMat(mat).multHermitian
 *     if multHermitian is None:
 *         try:             # <<<<<<<<<<<<<<
 *             mat.ops.multhermitian = NULL
 *             CHKERR(MatMultHermitian(mat, x, y))
*/
    /*try:*/ {

      /* "petsc4py/PETSc/libpetsc4py.pyx":1013
 *     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":1014
 *         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(5, 1014, __pyx_L5_error)
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":1016
 *             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;
         __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if ( 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;
        }
        __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":1017
 *         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":1011
 *     FunctionBegin(b"MatMultHermitian_Python")
 *     cdef multHermitian = PyMat(mat).multHermitian
 *     if multHermitian is None:             # <<<<<<<<<<<<<<
 *         try:
 *             mat.ops.multhermitian = NULL
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1018
 *             mat.ops.multhermitian = MatMultHermitian_Python
 *         return FunctionEnd()
 *     multHermitian(Mat_(mat), Vec_(x), Vec_(y))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_multHermitian);
  __pyx_t_14 = __pyx_v_multHermitian; 
  __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 1018, __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(5, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_17)) __PYX_ERR(5, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
    __pyx_t_18 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_15, __pyx_t_16, __pyx_t_17};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_18, (4-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1019
 *         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":1004
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1021
 *     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;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatMultAdd_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1027
 *     PetscVec y,
 *     ) 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":1028
 *     ) 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(5, 1028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_multAdd); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1028, __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":1029
 *     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":1030
 *     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":1031
 *     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":1032
 *     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(5, 1032, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":1033
 *         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(5, 1033, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":1034
 *             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(5, 1034, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":1035
 *             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(5, 1035, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":1031
 *     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":1037
 *             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(5, 1037, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":1038
 *         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(5, 1038, __pyx_L1_error)
    }
    __pyx_L4:;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1039
 *             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":1030
 *     cdef multAdd = PyMat(mat).multAdd
 *     cdef PetscVec t = NULL
 *     if multAdd is None:             # <<<<<<<<<<<<<<
 *         if v == y:
 *             CHKERR(VecDuplicate(y, &t))
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1040
 *             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(__pyx_k_multAdd);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1041
 *         return FunctionEnd()
 *     if multAdd is None: return UNSUPPORTED(b"multAdd")
 *     multAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_multAdd);
  __pyx_t_5 = __pyx_v_multAdd; 
  __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 1041, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_1, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_10, (5-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __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;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1042
 *     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":1021
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1044
 *     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;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatMultTransposeAdd_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1050
 *     PetscVec y,
 *     ) 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":1051
 *     ) 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(5, 1051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_multTransposeAdd); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1051, __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":1052
 *     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":1053
 *     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":1054
 *     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":1055
 *     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(5, 1055, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":1056
 *         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(5, 1056, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":1057
 *             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(5, 1057, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":1058
 *             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(5, 1058, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":1054
 *     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":1060
 *             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(5, 1060, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":1061
 *         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(5, 1061, __pyx_L1_error)
    }
    __pyx_L4:;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1062
 *             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":1053
 *     cdef multTransposeAdd = PyMat(mat).multTransposeAdd
 *     cdef PetscVec t = NULL
 *     if multTransposeAdd is None:             # <<<<<<<<<<<<<<
 *         if v == y:
 *             CHKERR(VecDuplicate(y, &t))
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1063
 *             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(__pyx_k_multTransposeAdd);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1064
 *         return FunctionEnd()
 *     if multTransposeAdd is None: return UNSUPPORTED(b"multTransposeAdd")
 *     multTransposeAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_multTransposeAdd);
  __pyx_t_5 = __pyx_v_multTransposeAdd; 
  __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 1064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_10 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_1, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_10, (5-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __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;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1065
 *     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":1044
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1067
 *     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;
  size_t __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatMultHermitianAdd_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1073
 *     PetscVec y,
 *     ) 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":1074
 *     ) 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(5, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_multHermitianAdd); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1074, __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":1075
 *     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":1076
 *     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":1077
 *     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":1078
 *         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(5, 1078, __pyx_L5_error)
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":1080
 *             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;
         __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if ( 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;
        }
        __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":1081
 *         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":1075
 *     FunctionBegin(b"MatMultHermitianAdd_Python")
 *     cdef multHermitianAdd = PyMat(mat).multHermitianAdd
 *     if multHermitianAdd is None:             # <<<<<<<<<<<<<<
 *         try:
 *             mat.ops.multhermitianadd = NULL
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1082
 *             mat.ops.multhermitianadd = MatMultHermitianAdd_Python
 *         return FunctionEnd()
 *     multHermitianAdd(Mat_(mat), Vec_(x), Vec_(v), Vec_(y))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_multHermitianAdd);
  __pyx_t_14 = __pyx_v_multHermitianAdd; 
  __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 1082, __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(5, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_17)) __PYX_ERR(5, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
    __pyx_t_19 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_1, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_19, (5-__pyx_t_19) | (__pyx_t_19*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1082, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1083
 *         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":1067
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1085
 *     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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatMultDiagonalBlock_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1090
 *     PetscVec y,
 *     ) 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":1091
 *     ) 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(5, 1091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_multDiagonalBlock); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1091, __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":1092
 *     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(__pyx_k_multDiagonalBlock);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1093
 *     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 = NULL;
  __Pyx_INCREF(__pyx_v_multDiagonalBlock);
  __pyx_t_4 = __pyx_v_multDiagonalBlock; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1093, __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(5, 1093, __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(5, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1093, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1094
 *     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":1085
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1096
 *     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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatSolve_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1101
 *     PetscVec x,
 *     ) 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":1102
 *     ) 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(5, 1102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_solve); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1102, __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":1103
 *     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(__pyx_k_solve);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1104
 *     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 = NULL;
  __Pyx_INCREF(__pyx_v_solve);
  __pyx_t_4 = __pyx_v_solve; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1104, __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(5, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1105
 *     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":1096
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1107
 *     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;
  size_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatSolveTranspose_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1112
 *     PetscVec x,
 *     ) 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":1113
 *     ) 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(5, 1113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_solveTranspose); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1113, __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":1114
 *     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":1115
 *     cdef solveTranspose = PyMat(mat).solveTranspose
 *     if solveTranspose is None:
 *         try:             # <<<<<<<<<<<<<<
 *             mat.ops.solvetranspose = NULL
 *             CHKERR(MatSolveTranspose(mat, b, x))
*/
    /*try:*/ {

      /* "petsc4py/PETSc/libpetsc4py.pyx":1116
 *     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":1117
 *         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(5, 1117, __pyx_L5_error)
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":1119
 *             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;
         __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if ( 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;
        }
        __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":1114
 *     FunctionBegin(b"MatSolveTranspose_Python")
 *     cdef solveTranspose = PyMat(mat).solveTranspose
 *     if solveTranspose is None:             # <<<<<<<<<<<<<<
 *         try:
 *             mat.ops.solvetranspose = NULL
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1120
 *         finally:
 *             mat.ops.solvetranspose = MatSolveTranspose_Python
 *     solveTranspose(Mat_(mat), Vec_(b), Vec_(x))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_solveTranspose);
  __pyx_t_14 = __pyx_v_solveTranspose; 
  __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 1120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_16)) __PYX_ERR(5, 1120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_17)) __PYX_ERR(5, 1120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
    __pyx_t_18 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_15, __pyx_t_16, __pyx_t_17};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_18, (4-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1121
 *             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":1107
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1123
 *     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;
  size_t __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatSolveAdd_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1129
 *     PetscVec x,
 *     ) 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":1130
 *     ) 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(5, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_solveAdd); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1130, __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":1131
 *     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":1132
 *     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":1133
 *     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":1134
 *         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(5, 1134, __pyx_L5_error)
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":1136
 *             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;
         __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if ( 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;
        }
        __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":1137
 *         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":1131
 *     FunctionBegin(b"MatSolveAdd_Python")
 *     cdef solveAdd = PyMat(mat).solveAdd
 *     if solveAdd is None:             # <<<<<<<<<<<<<<
 *         try:
 *             mat.ops.solveadd = NULL
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1138
 *             mat.ops.solveadd = MatSolveAdd_Python
 *         return FunctionEnd()
 *     solveAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_solveAdd);
  __pyx_t_14 = __pyx_v_solveAdd; 
  __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_16)) __PYX_ERR(5, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_17)) __PYX_ERR(5, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
    __pyx_t_19 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_1, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_19, (5-__pyx_t_19) | (__pyx_t_19*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1139
 *         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":1123
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1141
 *     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;
  size_t __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatSolveTransposeAdd_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1147
 *     PetscVec x,
 *     ) 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":1148
 *     ) 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(5, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_solveTransposeAdd); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1148, __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":1149
 *     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":1150
 *     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":1151
 *     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":1152
 *         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(5, 1152, __pyx_L5_error)
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":1154
 *             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;
         __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if ( 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;
        }
        __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":1155
 *         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":1149
 *     FunctionBegin(b"MatSolveTransposeAdd_Python")
 *     cdef solveTransposeAdd = PyMat(mat).solveTransposeAdd
 *     if solveTransposeAdd is None:             # <<<<<<<<<<<<<<
 *         try:
 *             mat.ops.solvetransposeadd = NULL
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1156
 *             mat.ops.solvetransposeadd = MatSolveTransposeAdd_Python
 *         return FunctionEnd()
 *     solveTransposeAdd(Mat_(mat), Vec_(b), Vec_(y), Vec_(x))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_solveTransposeAdd);
  __pyx_t_14 = __pyx_v_solveTransposeAdd; 
  __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_16)) __PYX_ERR(5, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_y)); if (unlikely(!__pyx_t_17)) __PYX_ERR(5, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
    __pyx_t_19 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_1, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_19, (5-__pyx_t_19) | (__pyx_t_19*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1157
 *         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":1141
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1159
 *     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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PetscReal __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PetscInt __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  size_t __pyx_t_15;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatSOR_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1169
 *     PetscVec x
 *     ) 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":1170
 *     ) 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(5, 1170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_SOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1170, __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":1171
 *     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(__pyx_k_SOR);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1172
 *     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 = NULL;
  __Pyx_INCREF(__pyx_v_SOR);
  __pyx_t_4 = __pyx_v_SOR; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1172, __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(5, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_omega); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_t_7); if (unlikely(__pyx_t_8 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyFloat_FromDouble(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = __Pyx_PyLong_From_MatSORType(__pyx_v_sortype); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_9); if (unlikely(__pyx_t_10 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyLong_From_PetscInt(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_shift); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_asReal(__pyx_t_11); if (unlikely(__pyx_t_8 == ((PetscReal)-1.0) && PyErr_Occurred())) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __pyx_t_11 = PyFloat_FromDouble(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = __Pyx_PyLong_From_PetscInt(__pyx_v_its); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_12); if (unlikely(__pyx_t_10 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_PyLong_From_PetscInt(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyLong_From_PetscInt(__pyx_v_lits); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_10 = __pyx_f_8petsc4py_5PETSc_asInt(__pyx_t_13); if (unlikely(__pyx_t_10 == ((PetscInt)-1L) && PyErr_Occurred())) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyLong_From_PetscInt(__pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_15 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_15 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[9] = {__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_9, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_15, (9-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1173
 *     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":1159
 *     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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1175
 *     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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatGetDiagonal_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1179
 *     PetscVec v,
 *     ) 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":1180
 *     ) 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(5, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_getDiagonal); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1180, __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":1181
 *     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(__pyx_k_getDiagonal);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1182
 *     cdef getDiagonal = PyMat(mat).getDiagonal
 *     if getDiagonal is None: return UNSUPPORTED(b"getDiagonal")
 *     getDiagonal(Mat_(mat), Vec_(v))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_getDiagonal);
  __pyx_t_4 = __pyx_v_getDiagonal; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1182, __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(5, 1182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_5, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1183
 *     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":1175
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1185
 *     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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatSetDiagonal_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1190
 *     PetscInsertMode im,
 *     ) 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":1191
 *     ) 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(5, 1191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_setDiagonal); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1191, __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":1192
 *     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":1193
 *     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(__pyx_k_setDiagonal);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1194
 *     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 = NULL;
  __Pyx_INCREF(__pyx_v_setDiagonal);
  __pyx_t_5 = __pyx_v_setDiagonal; 
  __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_addv); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_6, __pyx_t_7, __pyx_t_8};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __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;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1195
 *     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":1185
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1197
 *     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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatDiagonalScale_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1202
 *     PetscVec r,
 *     ) 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":1203
 *     ) 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(5, 1203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_diagonalScale); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1203, __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":1204
 *     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(__pyx_k_diagonalScale);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1205
 *     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 = NULL;
  __Pyx_INCREF(__pyx_v_diagonalScale);
  __pyx_t_4 = __pyx_v_diagonalScale; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_l)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_r)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1206
 *     if diagonalScale is None: return UNSUPPORTED(b"diagonalScale")
 *     diagonalScale(Mat_(mat), Vec_(l), Vec_(r))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode MatNorm_Python(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1197
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1208
 *     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;
  size_t __pyx_t_7;
  PetscReal __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatNorm_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1213
 *     PetscReal *nrm,
 *     ) 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":1214
 *     ) 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(5, 1214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_norm); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1214, __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":1215
 *     FunctionBegin(b"MatNorm_Python")
 *     cdef norm = PyMat(mat).norm
 *     if norm is None: return UNSUPPORTED(b"norm")             # <<<<<<<<<<<<<<
 *     retval = norm(Mat_(mat), ntype)
 *     nrm[0] = <PetscReal>retval
*/
  __pyx_t_3 = (__pyx_v_norm == Py_None);
  if (__pyx_t_3) {
    __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(__pyx_k_norm);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1216
 *     cdef norm = PyMat(mat).norm
 *     if norm is None: return UNSUPPORTED(b"norm")
 *     retval = norm(Mat_(mat), ntype)             # <<<<<<<<<<<<<<
 *     nrm[0] = <PetscReal>retval
 *     return FunctionEnd()
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_norm);
  __pyx_t_4 = __pyx_v_norm; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyLong_From_NormType(__pyx_v_ntype); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_5, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_retval = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1217
 *     if norm is None: return UNSUPPORTED(b"norm")
 *     retval = norm(Mat_(mat), ntype)
 *     nrm[0] = <PetscReal>retval             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_8 = __Pyx_PyFloat_AsDouble(__pyx_v_retval); if (unlikely((__pyx_t_8 == ((PetscReal)-1)) && PyErr_Occurred())) __PYX_ERR(5, 1217, __pyx_L1_error)
  (__pyx_v_nrm[0]) = ((PetscReal)__pyx_t_8);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1218
 *     retval = norm(Mat_(mat), ntype)
 *     nrm[0] = <PetscReal>retval
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode MatRealPart_Python(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1208
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1220
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode MatRealPart_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatRealPart_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1223
 *     PetscMat mat,
 *     ) 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":1224
 *     ) 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(5, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_realPart); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1224, __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":1225
 *     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(__pyx_k_realPart);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1226
 *     cdef realPart = PyMat(mat).realPart
 *     if realPart is None: return UNSUPPORTED(b"realPart")
 *     realPart(Mat_(mat))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_realPart);
  __pyx_t_4 = __pyx_v_realPart; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1227
 *     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":1220
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode MatRealPart_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat,
 *     ) 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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1229
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode MatImagPart_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatImagPart_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1232
 *     PetscMat mat,
 *     ) 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":1233
 *     ) 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(5, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_imagPart); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1233, __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":1234
 *     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(__pyx_k_imagPart);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1235
 *     cdef imagPart = PyMat(mat).imagPart
 *     if imagPart is None: return UNSUPPORTED(b"imagPart")
 *     imagPart(Mat_(mat))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_imagPart);
  __pyx_t_4 = __pyx_v_imagPart; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1236
 *     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":1229
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode MatImagPart_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat,
 *     ) 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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1238
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode MatConjugate_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatConjugate_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1241
 *     PetscMat mat,
 *     ) 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":1242
 *     ) 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(5, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_conjugate); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1242, __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":1243
 *     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(__pyx_k_conjugate);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1244
 *     cdef conjugate = PyMat(mat).conjugate
 *     if conjugate is None: return UNSUPPORTED(b"conjugate")
 *     conjugate(Mat_(mat))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_conjugate);
  __pyx_t_4 = __pyx_v_conjugate; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_mat)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1245
 *     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":1238
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode MatConjugate_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat,
 *     ) 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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1247
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatHasOperation_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1252
 *     PetscBool *flag
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"MatHasOperation_Python")             # <<<<<<<<<<<<<<
 *     flag[0] = PETSC_FALSE
 *     cdef long i  = <long> op
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"MatHasOperation_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":1253
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"MatHasOperation_Python")
 *     flag[0] = PETSC_FALSE             # <<<<<<<<<<<<<<
 *     cdef long i  = <long> op
 *     global dMatOps
*/
  (__pyx_v_flag[0]) = PETSC_FALSE;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1254
 *     FunctionBegin(b"MatHasOperation_Python")
 *     flag[0] = PETSC_FALSE
 *     cdef long i  = <long> op             # <<<<<<<<<<<<<<
 *     global dMatOps
 *     name = dMatOps.get(i, None)
*/
  __pyx_v_i = ((long)__pyx_v_op);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1256
 *     cdef long i  = <long> 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(5, 1256, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyLong_From_long(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1256, __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(5, 1256, __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":1257
 *     global dMatOps
 *     name = dMatOps.get(i, None)
 *     cdef void** ops = NULL             # <<<<<<<<<<<<<<
 *     if name is None:
 *         ops = <void**> mat.ops
*/
  __pyx_v_ops = NULL;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1258
 *     name = dMatOps.get(i, None)
 *     cdef void** ops = NULL
 *     if name is None:             # <<<<<<<<<<<<<<
 *         ops = <void**> 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":1259
 *     cdef void** ops = NULL
 *     if name is None:
 *         ops = <void**> mat.ops             # <<<<<<<<<<<<<<
 *         if ops and ops[i]: flag[0] = PETSC_TRUE
 *     else:
*/
    __pyx_v_ops = ((void **)__pyx_v_mat->ops);

    /* "petsc4py/PETSc/libpetsc4py.pyx":1260
 *     if name is None:
 *         ops = <void**> 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":1258
 *     name = dMatOps.get(i, None)
 *     cdef void** ops = NULL
 *     if name is None:             # <<<<<<<<<<<<<<
 *         ops = <void**> mat.ops
 *         if ops and ops[i]: flag[0] = PETSC_TRUE
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1262
 *         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(5, 1262, __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(5, 1262, __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":1263
 *     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":1247
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1265
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode MatProductNumeric_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatProductNumeric_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1268
 *     PetscMat mat
 *     ) 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":1269
 *     ) 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":1270
 *     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":1271
 *     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":1272
 *     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":1273
 *     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(5, 1273, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1274
 *     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(5, 1274, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1276
 *     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(5, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_AB); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_AB) < (0)) __PYX_ERR(5, 1276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_ABt); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ABt) < (0)) __PYX_ERR(5, 1276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_AtB); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_AtB) < (0)) __PYX_ERR(5, 1276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_PtAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_PtAP) < (0)) __PYX_ERR(5, 1276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_RARt); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_RARt) < (0)) __PYX_ERR(5, 1276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_ABC); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ABC) < (0)) __PYX_ERR(5, 1276, __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":1278
 *     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 = <PetscInt> <Py_uintptr_t> 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":1279
 * 
 *     cdef Mat_Product *product = mat.product
 *     cdef PetscInt i = <PetscInt> <Py_uintptr_t> 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":1280
 *     cdef Mat_Product *product = mat.product
 *     cdef PetscInt i = <PetscInt> <Py_uintptr_t> 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":1281
 *     cdef PetscInt i = <PetscInt> <Py_uintptr_t> 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, __pyx_k_Corrupted_composed_id);
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1280
 *     cdef Mat_Product *product = mat.product
 *     cdef PetscInt i = <PetscInt> <Py_uintptr_t> product.data
 *     if i < 0 or i > 2:             # <<<<<<<<<<<<<<
 *         return PetscSETERR(PETSC_ERR_PLIB,
 *                            "Corrupted composed id")
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1283
 *         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":1285
 *     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(5, 1285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_PyA = ((struct PyPetscMatObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1286
 * 
 *     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(5, 1286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_PyB = ((struct PyPetscMatObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1287
 *     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(5, 1287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_PyC = ((struct PyPetscMatObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1288
 *     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":1289
 *     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(5, 1289, __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)) != (0)) __PYX_ERR(5, 1289, __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)) != (0)) __PYX_ERR(5, 1289, __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)) != (0)) __PYX_ERR(5, 1289, __pyx_L1_error);
    __pyx_v_mats = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1288
 *     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":1291
 *         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(5, 1291, __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)) != (0)) __PYX_ERR(5, 1291, __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)) != (0)) __PYX_ERR(5, 1291, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None) != (0)) __PYX_ERR(5, 1291, __pyx_L1_error);
    __pyx_v_mats = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L6:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1293
 *         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(5, 1293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_productNumeric); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1293, __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":1294
 * 
 *     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(__pyx_k_productNumeric);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1295
 *     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(5, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = __Pyx_PyLong_From_MatProductType(__pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 1295, __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(5, 1295, __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(5, 1295, __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) != (0)) __PYX_ERR(5, 1295, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2) != (0)) __PYX_ERR(5, 1295, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_10) != (0)) __PYX_ERR(5, 1295, __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(5, 1295, __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(5, 1295, __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":1297
 *     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":1265
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode MatProductNumeric_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1301
 * cdef PetscInt matmatid = -1
 * 
 * cdef PetscErrorCode MatProductSymbolic_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatProductSymbolic_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1304
 *     PetscMat mat
 *     ) 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":1305
 *     ) 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":1306
 *     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":1307
 *     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":1308
 *     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":1309
 *     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(5, 1309, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1310
 *     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(5, 1310, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1312
 *     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(5, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_AB); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_AB) < (0)) __PYX_ERR(5, 1312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_ABt); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ABt) < (0)) __PYX_ERR(5, 1312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_AtB); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_AtB) < (0)) __PYX_ERR(5, 1312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_PtAP); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_PtAP) < (0)) __PYX_ERR(5, 1312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_RARt); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_RARt) < (0)) __PYX_ERR(5, 1312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_ABC); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_n_u_ABC) < (0)) __PYX_ERR(5, 1312, __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":1315
 * 
 *     global matmatid
 *     cdef PetscInt i = -1             # <<<<<<<<<<<<<<
 *     cdef PetscBool flg = PETSC_FALSE
 *     CHKERR(PetscObjectComposedDataGetIntPy(<PetscObject>mat, matmatid, &i, &flg))
*/
  __pyx_v_i = -1L;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1316
 *     global matmatid
 *     cdef PetscInt i = -1
 *     cdef PetscBool flg = PETSC_FALSE             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectComposedDataGetIntPy(<PetscObject>mat, matmatid, &i, &flg))
 *     if flg is not PETSC_TRUE:
*/
  __pyx_v_flg = PETSC_FALSE;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1317
 *     cdef PetscInt i = -1
 *     cdef PetscBool flg = PETSC_FALSE
 *     CHKERR(PetscObjectComposedDataGetIntPy(<PetscObject>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(5, 1317, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1318
 *     cdef PetscBool flg = PETSC_FALSE
 *     CHKERR(PetscObjectComposedDataGetIntPy(<PetscObject>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":1319
 *     CHKERR(PetscObjectComposedDataGetIntPy(<PetscObject>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, __pyx_k_Missing_composed_id);
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1318
 *     cdef PetscBool flg = PETSC_FALSE
 *     CHKERR(PetscObjectComposedDataGetIntPy(<PetscObject>mat, matmatid, &i, &flg))
 *     if flg is not PETSC_TRUE:             # <<<<<<<<<<<<<<
 *         return PetscSETERR(PETSC_ERR_PLIB,
 *                            "Missing composed id")
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1321
 *         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":1322
 *                            "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, __pyx_k_Corrupted_composed_id);
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1321
 *         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":1324
 *         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":1326
 *     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(5, 1326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_PyA = ((struct PyPetscMatObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1327
 * 
 *     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(5, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_PyB = ((struct PyPetscMatObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1328
 *     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(5, 1328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_PyC = ((struct PyPetscMatObject *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1329
 *     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":1330
 *     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(5, 1330, __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)) != (0)) __PYX_ERR(5, 1330, __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)) != (0)) __PYX_ERR(5, 1330, __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)) != (0)) __PYX_ERR(5, 1330, __pyx_L1_error);
    __pyx_v_mats = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1329
 *     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":1332
 *         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(5, 1332, __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)) != (0)) __PYX_ERR(5, 1332, __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)) != (0)) __PYX_ERR(5, 1332, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None) != (0)) __PYX_ERR(5, 1332, __pyx_L1_error);
    __pyx_v_mats = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L7:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1334
 *         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(5, 1334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_productSymbolic); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1334, __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":1335
 * 
 *     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(__pyx_k_productSymbolic);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1336
 *     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(5, 1336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyLong_From_MatProductType(__pyx_v_mtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1336, __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(5, 1336, __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(5, 1336, __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) != (0)) __PYX_ERR(5, 1336, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2) != (0)) __PYX_ERR(5, 1336, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_9) != (0)) __PYX_ERR(5, 1336, __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(5, 1336, __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(5, 1336, __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":1339
 * 
 *     # Store id in matrix product
 *     cdef Mat_Product *product = mat.product             # <<<<<<<<<<<<<<
 *     product.data = <void*> <Py_uintptr_t> i
 * 
*/
  __pyx_t_10 = __pyx_v_mat->product;
  __pyx_v_product = __pyx_t_10;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1340
 *     # Store id in matrix product
 *     cdef Mat_Product *product = mat.product
 *     product.data = <void*> <Py_uintptr_t> i             # <<<<<<<<<<<<<<
 * 
 *     cdef MatOps ops = mat.ops
*/
  __pyx_v_product->data = ((void *)((Py_uintptr_t)__pyx_v_i));

  /* "petsc4py/PETSc/libpetsc4py.pyx":1342
 *     product.data = <void*> <Py_uintptr_t> 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":1343
 * 
 *     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":1344
 *     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":1301
 * cdef PetscInt matmatid = -1
 * 
 * cdef PetscErrorCode MatProductSymbolic_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1346
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode MatProductSetFromOptions_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("MatProductSetFromOptions_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1349
 *     PetscMat mat
 *     ) 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":1350
 *     ) 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":1351
 *     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":1352
 *     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":1353
 *     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(5, 1353, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1354
 *     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":1355
 *     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, __pyx_k_Missing_matrices);
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1354
 *     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":1358
 *                            "Missing matrices")
 * 
 *     cdef PetscMatProductType mtype = MATPRODUCT_UNSPECIFIED             # <<<<<<<<<<<<<<
 *     CHKERR(MatProductGetType(mat, &mtype))
 *     if mtype == MATPRODUCT_UNSPECIFIED:
*/
  __pyx_v_mtype = MATPRODUCT_UNSPECIFIED;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1359
 * 
 *     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(5, 1359, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1360
 *     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":1361
 *     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, __pyx_k_Unknown_product_type);
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1360
 *     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":1364
 *                            "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(5, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_AB); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_AB) < (0)) __PYX_ERR(5, 1364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_ABt); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_ABt) < (0)) __PYX_ERR(5, 1364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_AtB); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_AtB) < (0)) __PYX_ERR(5, 1364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_PtAP); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PtAP) < (0)) __PYX_ERR(5, 1364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_RARt); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_RARt) < (0)) __PYX_ERR(5, 1364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyLong_From_MatProductType(MATPRODUCT_ABC); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_ABC) < (0)) __PYX_ERR(5, 1364, __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":1366
 *     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(5, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_PyA = ((struct PyPetscMatObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1367
 * 
 *     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(5, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_PyB = ((struct PyPetscMatObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1368
 *     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(5, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_PyC = ((struct PyPetscMatObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1369
 *     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":1370
 *     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(5, 1370, __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)) != (0)) __PYX_ERR(5, 1370, __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)) != (0)) __PYX_ERR(5, 1370, __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)) != (0)) __PYX_ERR(5, 1370, __pyx_L1_error);
    __pyx_v_mats = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1369
 *     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":1372
 *         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(5, 1372, __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)) != (0)) __PYX_ERR(5, 1372, __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)) != (0)) __PYX_ERR(5, 1372, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None) != (0)) __PYX_ERR(5, 1372, __pyx_L1_error);
    __pyx_v_mats = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L7:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1375
 * 
 *     # 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":1376
 *     # 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":1377
 *     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":1379
 *     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":1380
 *     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(5, 1380, __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":1381
 *     cdef PetscInt i = -1
 *     for i in range(len(mats)):
 *         if mats[i] is None: continue             # <<<<<<<<<<<<<<
 *         mm = mats[i]
 *         pM = <PetscMat>mm.mat
*/
    __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_mats, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1381, __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":1382
 *     for i in range(len(mats)):
 *         if mats[i] is None: continue
 *         mm = mats[i]             # <<<<<<<<<<<<<<
 *         pM = <PetscMat>mm.mat
 *         CHKERR(PetscObjectTypeCompare(<PetscObject>pM, MATPYTHON,  &mispy))
*/
    __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_mats, __pyx_v_i, PetscInt, 1, __Pyx_PyLong_From_PetscInt, 0, 1, 1, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat))))) __PYX_ERR(5, 1382, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_mm, ((struct PyPetscMatObject *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1383
 *         if mats[i] is None: continue
 *         mm = mats[i]
 *         pM = <PetscMat>mm.mat             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectTypeCompare(<PetscObject>pM, MATPYTHON,  &mispy))
 *         if mispy:
*/
    __pyx_v_pM = ((Mat)__pyx_v_mm->mat);

    /* "petsc4py/PETSc/libpetsc4py.pyx":1384
 *         mm = mats[i]
 *         pM = <PetscMat>mm.mat
 *         CHKERR(PetscObjectTypeCompare(<PetscObject>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(5, 1384, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":1385
 *         pM = <PetscMat>mm.mat
 *         CHKERR(PetscObjectTypeCompare(<PetscObject>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_t_2 = (__pyx_v_mispy != 0);
    if (__pyx_t_2) {

      /* "petsc4py/PETSc/libpetsc4py.pyx":1386
 *         CHKERR(PetscObjectTypeCompare(<PetscObject>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(5, 1386, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_productSetFromOptions); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1386, __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":1387
 *         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(5, 1387, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_productSetFromOptions); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1387, __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_PyLong_From_MatProductType(__pyx_v_mtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 1387, __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(5, 1387, __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(5, 1387, __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) != (0)) __PYX_ERR(5, 1387, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_10);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10) != (0)) __PYX_ERR(5, 1387, __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(5, 1387, __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(5, 1387, __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":1388
 *             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(5, 1388, __pyx_L1_error)
        if (__pyx_t_2) {
          goto __pyx_L9_break;
        }

        /* "petsc4py/PETSc/libpetsc4py.pyx":1386
 *         CHKERR(PetscObjectTypeCompare(<PetscObject>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":1385
 *         pM = <PetscMat>mm.mat
 *         CHKERR(PetscObjectTypeCompare(<PetscObject>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":1389
 *                 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(5, 1389, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":1390
 *                 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":1389
 *                 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":1392
 *         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":1393
 * 
 *     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":1399
 *     # Symbolic operation will get this index and store it in the product data
 *     global matmatid
 *     if matmatid < 0:             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectComposedDataRegisterPy(&matmatid))
 *     CHKERR(PetscObjectComposedDataSetIntPy(<PetscObject>mat, matmatid, i))
*/
  __pyx_t_3 = (__pyx_v_8petsc4py_5PETSc_matmatid < 0);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":1400
 *     global matmatid
 *     if matmatid < 0:
 *         CHKERR(PetscObjectComposedDataRegisterPy(&matmatid))             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectComposedDataSetIntPy(<PetscObject>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(5, 1400, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":1399
 *     # Symbolic operation will get this index and store it in the product data
 *     global matmatid
 *     if matmatid < 0:             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectComposedDataRegisterPy(&matmatid))
 *     CHKERR(PetscObjectComposedDataSetIntPy(<PetscObject>mat, matmatid, i))
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1401
 *     if matmatid < 0:
 *         CHKERR(PetscObjectComposedDataRegisterPy(&matmatid))
 *     CHKERR(PetscObjectComposedDataSetIntPy(<PetscObject>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(5, 1401, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1403
 *     CHKERR(PetscObjectComposedDataSetIntPy(<PetscObject>mat, matmatid, i))
 * 
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1346
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode MatProductSetFromOptions_Python(             # <<<<<<<<<<<<<<
 *     PetscMat mat
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1430
 * @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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1431
 * 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":1432
 * 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":1431
 * 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":1434
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyPC), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1434, __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":1430
 * @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":1436
 *         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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1438
 * 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":1439
 *     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(5, 1439, __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(5, 1439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1440
 *     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":1436
 *         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":1442
 *     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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1444
 * 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":1445
 *     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(5, 1445, __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(5, 1445, __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(5, 1445, __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":1446
 *     FunctionBegin(b"PCPythonSetContext")
 *     PyPC(pc).setcontext(ctx, PC_(pc))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode PCPythonSetType_PYTHON(PetscPC pc, const char *name) \
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1442
 *     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":1448
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PCPythonSetType_PYTHON(PetscPC pc, const 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 const *__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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCPythonSetType_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1450
 * cdef PetscErrorCode PCPythonSetType_PYTHON(PetscPC pc, const 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":1451
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PCPythonSetType_PYTHON")
 *     if name == NULL: return FunctionEnd() # XXX             # <<<<<<<<<<<<<<
 *     cdef object ctx = createcontext(name)
 *     PCPythonSetContext(pc, <void*>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":1452
 *     FunctionBegin(b"PCPythonSetType_PYTHON")
 *     if name == NULL: return FunctionEnd() # XXX
 *     cdef object ctx = createcontext(name)             # <<<<<<<<<<<<<<
 *     PCPythonSetContext(pc, <void*>ctx)
 *     PyPC(pc).setname(name)
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ctx = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1453
 *     if name == NULL: return FunctionEnd() # XXX
 *     cdef object ctx = createcontext(name)
 *     PCPythonSetContext(pc, <void*>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(5, 1453, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1454
 *     cdef object ctx = createcontext(name)
 *     PCPythonSetContext(pc, <void*>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(5, 1454, __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(5, 1454, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1455
 *     PCPythonSetContext(pc, <void*>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":1448
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PCPythonSetType_PYTHON(PetscPC pc, const 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1457
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCPythonGetType_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1459
 * 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":1460
 *     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(5, 1460, __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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 1460, __pyx_L1_error)
  (__pyx_v_name[0]) = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1461
 *     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":1457
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1463
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PCCreate_Python(             # <<<<<<<<<<<<<<
 *     PetscPC pc,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCCreate_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1466
 *     PetscPC pc,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PCCreate_Python")             # <<<<<<<<<<<<<<
 *     cdef PCOps ops          = pc.ops
 *     ops.reset               = PCReset_Python
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCCreate_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":1467
 *     ) except PETSC_ERR_PYTHON with gil:
 *     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":1468
 *     FunctionBegin(b"PCCreate_Python")
 *     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":1469
 *     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":1470
 *     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":1471
 *     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":1472
 *     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":1473
 *     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":1474
 *     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":1475
 *     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":1476
 *     ops.postsolve           = PCPostSolve_Python
 *     ops.apply               = PCApply_Python
 *     ops.matapply            = PCMatApply_Python             # <<<<<<<<<<<<<<
 *     ops.applytranspose      = PCApplyTranspose_Python
 *     ops.matapplytranspose   = PCMatApplyTranspose_Python
*/
  __pyx_v_ops->matapply = __pyx_f_8petsc4py_5PETSc_PCMatApply_Python;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1477
 *     ops.apply               = PCApply_Python
 *     ops.matapply            = PCMatApply_Python
 *     ops.applytranspose      = PCApplyTranspose_Python             # <<<<<<<<<<<<<<
 *     ops.matapplytranspose   = PCMatApplyTranspose_Python
 *     ops.applysymmetricleft  = PCApplySymmetricLeft_Python
*/
  __pyx_v_ops->applytranspose = __pyx_f_8petsc4py_5PETSc_PCApplyTranspose_Python;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1478
 *     ops.matapply            = PCMatApply_Python
 *     ops.applytranspose      = PCApplyTranspose_Python
 *     ops.matapplytranspose   = PCMatApplyTranspose_Python             # <<<<<<<<<<<<<<
 *     ops.applysymmetricleft  = PCApplySymmetricLeft_Python
 *     ops.applysymmetricright = PCApplySymmetricRight_Python
*/
  __pyx_v_ops->matapplytranspose = __pyx_f_8petsc4py_5PETSc_PCMatApplyTranspose_Python;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1479
 *     ops.applytranspose      = PCApplyTranspose_Python
 *     ops.matapplytranspose   = PCMatApplyTranspose_Python
 *     ops.applysymmetricleft  = PCApplySymmetricLeft_Python             # <<<<<<<<<<<<<<
 *     ops.applysymmetricright = PCApplySymmetricRight_Python
 *     #
*/
  __pyx_v_ops->applysymmetricleft = __pyx_f_8petsc4py_5PETSc_PCApplySymmetricLeft_Python;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1480
 *     ops.matapplytranspose   = PCMatApplyTranspose_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":1482
 *     ops.applysymmetricright = PCApplySymmetricRight_Python
 *     #
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>pc, b"PCPythonSetType_C",
 *             <PetscVoidFunction>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(5, 1482, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1485
 *             <PetscObject>pc, b"PCPythonSetType_C",
 *             <PetscVoidFunction>PCPythonSetType_PYTHON))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>pc, b"PCPythonGetType_C",
 *             <PetscVoidFunction>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(5, 1485, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1489
 *             <PetscVoidFunction>PCPythonGetType_PYTHON))
 *     #
 *     cdef ctx = PyPC(NULL)             # <<<<<<<<<<<<<<
 *     pc.data = <void*> ctx
 *     Py_INCREF(<PyObject*>pc.data)
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_ctx = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1490
 *     #
 *     cdef ctx = PyPC(NULL)
 *     pc.data = <void*> ctx             # <<<<<<<<<<<<<<
 *     Py_INCREF(<PyObject*>pc.data)
 *     return FunctionEnd()
*/
  __pyx_v_pc->data = ((void *)__pyx_v_ctx);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1491
 *     cdef ctx = PyPC(NULL)
 *     pc.data = <void*> ctx
 *     Py_INCREF(<PyObject*>pc.data)             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  Py_INCREF(((PyObject *)__pyx_v_pc->data));

  /* "petsc4py/PETSc/libpetsc4py.pyx":1492
 *     pc.data = <void*> ctx
 *     Py_INCREF(<PyObject*>pc.data)
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscErrorCode PCDestroy_Python_inner(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1463
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PCCreate_Python(             # <<<<<<<<<<<<<<
 *     PetscPC pc,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1494
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode PCDestroy_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscPC pc,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCDestroy_Python_inner", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1497
 *     PetscPC pc,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     try:             # <<<<<<<<<<<<<<
 *         addRef(pc)
 *         PCPythonSetContext(pc, NULL)
*/
  /*try:*/ {

    /* "petsc4py/PETSc/libpetsc4py.pyx":1498
 *     ) 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":1499
 *     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(5, 1499, __pyx_L4_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1501
 *         PCPythonSetContext(pc, NULL)
 *     finally:
 *         delRef(pc)             # <<<<<<<<<<<<<<
 *         Py_DECREF(<PyObject*>pc.data)
 *         pc.data = NULL
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_pc);

      /* "petsc4py/PETSc/libpetsc4py.pyx":1502
 *     finally:
 *         delRef(pc)
 *         Py_DECREF(<PyObject*>pc.data)             # <<<<<<<<<<<<<<
 *         pc.data = NULL
 *     return PETSC_SUCCESS
*/
      Py_DECREF(((PyObject *)__pyx_v_pc->data));

      /* "petsc4py/PETSc/libpetsc4py.pyx":1503
 *         delRef(pc)
 *         Py_DECREF(<PyObject*>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;
       __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if ( 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":1501
 *         PCPythonSetContext(pc, NULL)
 *     finally:
 *         delRef(pc)             # <<<<<<<<<<<<<<
 *         Py_DECREF(<PyObject*>pc.data)
 *         pc.data = NULL
*/
        __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_pc);

        /* "petsc4py/PETSc/libpetsc4py.pyx":1502
 *     finally:
 *         delRef(pc)
 *         Py_DECREF(<PyObject*>pc.data)             # <<<<<<<<<<<<<<
 *         pc.data = NULL
 *     return PETSC_SUCCESS
*/
        Py_DECREF(((PyObject *)__pyx_v_pc->data));

        /* "petsc4py/PETSc/libpetsc4py.pyx":1503
 *         delRef(pc)
 *         Py_DECREF(<PyObject*>pc.data)
 *         pc.data = NULL             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
        __pyx_v_pc->data = NULL;
      }
      __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":1504
 *         Py_DECREF(<PyObject*>pc.data)
 *         pc.data = NULL
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode PCDestroy_Python(
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1494
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode PCDestroy_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscPC pc,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1506
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode PCDestroy_Python(             # <<<<<<<<<<<<<<
 *     PetscPC pc,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1509
 *     PetscPC pc,
 *     ) except PETSC_ERR_PYTHON nogil:
 *     FunctionBegin(b"PCDestroy_Python")             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectComposeFunction(
 *             <PetscObject>pc, b"PCPythonSetType_C",
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCDestroy_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":1510
 *     ) except PETSC_ERR_PYTHON nogil:
 *     FunctionBegin(b"PCDestroy_Python")
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>pc, b"PCPythonSetType_C",
 *             <PetscVoidFunction>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(5, 1510, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1513
 *             <PetscObject>pc, b"PCPythonSetType_C",
 *             <PetscVoidFunction>NULL))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>pc, b"PCPythonGetType_C",
 *             <PetscVoidFunction>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(5, 1513, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1517
 *             <PetscVoidFunction>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(5, 1517, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1518
 *     #
 *     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":1506
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode PCDestroy_Python(             # <<<<<<<<<<<<<<
 *     PetscPC pc,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("petsc4py.PETSc.PCDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1520
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PCSetUp_Python(             # <<<<<<<<<<<<<<
 *     PetscPC pc,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCSetUp_Python(PC __pyx_v_pc) {
  char __pyx_v_name[2048];
  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;
  size_t __pyx_t_9;
  PCOps __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCSetUp_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1523
 *     PetscPC pc,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PCSetUp_Python")             # <<<<<<<<<<<<<<
 *     cdef char name[2048]
 *     cdef PetscBool found = PETSC_FALSE
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCSetUp_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":1525
 *     FunctionBegin(b"PCSetUp_Python")
 *     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":1526
 *     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(5, 1526, __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":1527
 *     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(5, 1527, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":1530
 *                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:
*/
    __pyx_t_4 = (__pyx_v_found != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      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":1531
 *                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(5, 1531, __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(5, 1531, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":1530
 *                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":1526
 *     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":1532
 *         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(5, 1532, __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":1533
 *             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, __pyx_k_Python_context_not_set_call_one_3);
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1532
 *         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":1539
 *                            "-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(5, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1539, __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":1540
 *     #
 *     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":1541
 *     cdef setUp = PyPC(pc).setUp
 *     if setUp is not None:
 *         setUp(PC_(pc))             # <<<<<<<<<<<<<<
 *     #
 *     cdef o = PyPC(pc)
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_setUp);
    __pyx_t_7 = __pyx_v_setUp; 
    __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_8};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1541, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1540
 *     #
 *     cdef setUp = PyPC(pc).setUp
 *     if setUp is not None:             # <<<<<<<<<<<<<<
 *         setUp(PC_(pc))
 *     #
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1543
 *         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(5, 1543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_o = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1544
 *     #
 *     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":1545
 *     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_mstate_global->__pyx_n_u_applyTranspose); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1545, __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":1546
 *     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":1545
 *     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":1547
 *     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_mstate_global->__pyx_n_u_applySymmetricLeft); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1547, __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":1548
 *         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":1547
 *     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":1549
 *     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_mstate_global->__pyx_n_u_applySymmetricRight); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1549, __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":1550
 *         ops.applysymmetricleft = NULL
 *     if o.applySymmetricRight is None:
 *         ops.applysymmetricright = NULL             # <<<<<<<<<<<<<<
 *     #
 *     return FunctionEnd()
*/
    __pyx_v_ops->applysymmetricright = NULL;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1549
 *     if o.applySymmetricLeft is None:
 *         ops.applysymmetricleft = NULL
 *     if o.applySymmetricRight is None:             # <<<<<<<<<<<<<<
 *         ops.applysymmetricright = NULL
 *     #
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1552
 *         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":1520
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PCSetUp_Python(             # <<<<<<<<<<<<<<
 *     PetscPC pc,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1554
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode PCReset_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscPC pc,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCReset_Python_inner", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1557
 *     PetscPC pc,
 *     ) 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(5, 1557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_reset); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1557, __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":1558
 *     ) 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":1559
 *     cdef reset = PyPC(pc).reset
 *     if reset is not None:
 *         reset(PC_(pc))             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_reset);
    __pyx_t_4 = __pyx_v_reset; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1559, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1558
 *     ) 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":1560
 *     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":1554
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode PCReset_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscPC pc,
 *     ) 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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1562
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode PCReset_Python(             # <<<<<<<<<<<<<<
 *     PetscPC pc,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1565
 *     PetscPC pc,
 *     ) 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":1566
 *     ) 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":1567
 *     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(5, 1567, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1568
 *     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":1562
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode PCReset_Python(             # <<<<<<<<<<<<<<
 *     PetscPC pc,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("petsc4py.PETSc.PCReset_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1570
 *     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[2048];
  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;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCSetFromOptions_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1574
 *     PetscOptionItems PetscOptionsObject,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PCSetFromOptions_Python")             # <<<<<<<<<<<<<<
 *     cdef char name[2048], *defval = PyPC(pc).getname()
 *     cdef PetscBool found = PETSC_FALSE
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCSetFromOptions_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":1575
 *     ) except PETSC_ERR_PYTHON with gil:
 *     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(5, 1575, __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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 1575, __pyx_L1_error)
  __pyx_v_defval = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1576
 *     FunctionBegin(b"PCSetFromOptions_Python")
 *     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":1577
 *     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":1578
 *     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)); <void>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(5, 1578, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1580
 *     CHKERR(PetscOptionsString(
 *             b"-pc_python_type", b"Python [package.]module[.{class|function}]",
 *             b"PCPythonSetType", defval, name, sizeof(name), &found)); <void>opts             # <<<<<<<<<<<<<<
 *     if found and name[0]:
 *         CHKERR(PCPythonSetType_PYTHON(pc, name))
*/
  ((void)PetscOptionsObject);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1581
 *             b"-pc_python_type", b"Python [package.]module[.{class|function}]",
 *             b"PCPythonSetType", defval, name, sizeof(name), &found)); <void>opts
 *     if found and name[0]:             # <<<<<<<<<<<<<<
 *         CHKERR(PCPythonSetType_PYTHON(pc, name))
 *     #
*/
  __pyx_t_5 = (__pyx_v_found != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    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":1582
 *             b"PCPythonSetType", defval, name, sizeof(name), &found)); <void>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(5, 1582, __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(5, 1582, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":1581
 *             b"-pc_python_type", b"Python [package.]module[.{class|function}]",
 *             b"PCPythonSetType", defval, name, sizeof(name), &found)); <void>opts
 *     if found and name[0]:             # <<<<<<<<<<<<<<
 *         CHKERR(PCPythonSetType_PYTHON(pc, name))
 *     #
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1584
 *         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(5, 1584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1584, __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":1585
 *     #
 *     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":1586
 *     cdef setFromOptions = PyPC(pc).setFromOptions
 *     if setFromOptions is not None:
 *         setFromOptions(PC_(pc))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_setFromOptions);
    __pyx_t_8 = __pyx_v_setFromOptions; 
    __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 1586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_9};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1586, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1585
 *     #
 *     cdef setFromOptions = PyPC(pc).setFromOptions
 *     if setFromOptions is not None:             # <<<<<<<<<<<<<<
 *         setFromOptions(PC_(pc))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1587
 *     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":1570
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1589
 *     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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCView_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1593
 *     PetscViewer vwr,
 *     ) 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":1594
 *     ) 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(5, 1594, __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(5, 1594, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1595
 *     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(5, 1595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1595, __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":1596
 *     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":1597
 *     cdef view = PyPC(pc).view
 *     if view is not None:
 *         view(PC_(pc), Viewer_(vwr))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_view);
    __pyx_t_5 = __pyx_v_view; 
    __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_6, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1597, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1596
 *     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":1598
 *     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":1589
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1600
 *     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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCPreSolve_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1606
 *     PetscVec x,
 *     ) 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":1607
 *     ) 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(5, 1607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_preSolve); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1607, __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":1608
 *     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":1609
 *     cdef preSolve = PyPC(pc).preSolve
 *     if preSolve is not None:
 *         preSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_preSolve);
    __pyx_t_4 = __pyx_v_preSolve; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (5-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1608
 *     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":1610
 *     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":1600
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1612
 *     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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCPostSolve_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1618
 *     PetscVec x,
 *     ) 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":1619
 *     ) 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(5, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_postSolve); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1619, __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":1620
 *     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":1621
 *     cdef postSolve = PyPC(pc).postSolve
 *     if postSolve is not None:
 *         postSolve(PC_(pc), KSP_(ksp), Vec_(b), Vec_(x))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_postSolve);
    __pyx_t_4 = __pyx_v_postSolve; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (5-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1621, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1620
 *     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":1622
 *     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":1612
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1624
 *     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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCApply_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1629
 *     PetscVec y,
 *     ) 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":1630
 *     ) 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(5, 1630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_apply); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1630, __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":1631
 *     FunctionBegin(b"PCApply_Python")
 *     cdef apply = PyPC(pc).apply
 *     apply(PC_(pc), Vec_(x), Vec_(y))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_apply);
  __pyx_t_3 = __pyx_v_apply; 
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1631, __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(5, 1631, __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(5, 1631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_4, __pyx_t_5, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1631, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1632
 *     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":1624
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1634
 *     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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCApplyTranspose_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1639
 *     PetscVec y,
 *     ) 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":1640
 *     ) 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(5, 1640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_applyTranspose); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1640, __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":1641
 *     FunctionBegin(b"PCApplyTranspose_Python")
 *     cdef applyTranspose = PyPC(pc).applyTranspose
 *     applyTranspose(PC_(pc), Vec_(x), Vec_(y))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_applyTranspose);
  __pyx_t_3 = __pyx_v_applyTranspose; 
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1641, __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(5, 1641, __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(5, 1641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_4, __pyx_t_5, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1642
 *     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":1634
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1644
 *     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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCApplySymmetricLeft_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1649
 *     PetscVec y,
 *     ) 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":1650
 *     ) 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(5, 1650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_applySymmetricLeft); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1650, __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":1651
 *     FunctionBegin(b"PCApplySymmetricLeft_Python")
 *     cdef applySymmetricLeft = PyPC(pc).applySymmetricLeft
 *     applySymmetricLeft(PC_(pc), Vec_(x), Vec_(y))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_applySymmetricLeft);
  __pyx_t_3 = __pyx_v_applySymmetricLeft; 
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1651, __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(5, 1651, __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(5, 1651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_4, __pyx_t_5, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1652
 *     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":1644
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1654
 *     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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCApplySymmetricRight_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1659
 *     PetscVec y,
 *     ) 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":1660
 *     ) 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(5, 1660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_applySymmetricRight); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1660, __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":1661
 *     FunctionBegin(b"PCApplySymmetricRight_Python")
 *     cdef applySymmetricRight = PyPC(pc).applySymmetricRight
 *     applySymmetricRight(PC_(pc), Vec_(x), Vec_(y))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_applySymmetricRight);
  __pyx_t_3 = __pyx_v_applySymmetricRight; 
  __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1661, __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(5, 1661, __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(5, 1661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_7 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_4, __pyx_t_5, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1661, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1662
 *     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":1654
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1664
 *     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;
  size_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCMatApply_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1669
 *     PetscMat Y,
 *     ) 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":1670
 *     ) 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(5, 1670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_matApply); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1670, __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":1671
 *     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":1672
 *     cdef matApply = PyPC(pc).matApply
 *     if matApply is None:
 *         try:             # <<<<<<<<<<<<<<
 *             pc.ops.matapply = NULL
 *             CHKERR(PCMatApply(pc, X, Y))
*/
    /*try:*/ {

      /* "petsc4py/PETSc/libpetsc4py.pyx":1673
 *     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":1674
 *         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(5, 1674, __pyx_L5_error)
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":1676
 *             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;
         __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if ( 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;
        }
        __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":1677
 *         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":1671
 *     FunctionBegin(b"PCMatApply_Python")
 *     cdef matApply = PyPC(pc).matApply
 *     if matApply is None:             # <<<<<<<<<<<<<<
 *         try:
 *             pc.ops.matapply = NULL
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1678
 *             pc.ops.matapply = PCMatApply_Python
 *         return FunctionEnd()
 *     matApply(PC_(pc), Mat_(X), Mat_(Y))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_matApply);
  __pyx_t_14 = __pyx_v_matApply; 
  __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 1678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_X)); if (unlikely(!__pyx_t_16)) __PYX_ERR(5, 1678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_Y)); if (unlikely(!__pyx_t_17)) __PYX_ERR(5, 1678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
    __pyx_t_18 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_15, __pyx_t_16, __pyx_t_17};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_18, (4-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1679
 *         return FunctionEnd()
 *     matApply(PC_(pc), Mat_(X), Mat_(Y))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode PCMatApplyTranspose_Python(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1664
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1681
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PCMatApplyTranspose_Python(             # <<<<<<<<<<<<<<
 *     PetscPC  pc,
 *     PetscMat X,
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_PCMatApplyTranspose_Python(PC __pyx_v_pc, Mat __pyx_v_X, Mat __pyx_v_Y) {
  PyObject *__pyx_v_matApplyTranspose = 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;
  size_t __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PCMatApplyTranspose_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1686
 *     PetscMat Y,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PCMatApplyTranspose_Python")             # <<<<<<<<<<<<<<
 *     cdef matApplyTranspose = PyPC(pc).matApplyTranspose
 *     if matApplyTranspose is None:
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PCMatApplyTranspose_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":1687
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"PCMatApplyTranspose_Python")
 *     cdef matApplyTranspose = PyPC(pc).matApplyTranspose             # <<<<<<<<<<<<<<
 *     if matApplyTranspose is None:
 *         try:
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyPC(__pyx_v_pc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_matApplyTranspose); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_matApplyTranspose = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1688
 *     FunctionBegin(b"PCMatApplyTranspose_Python")
 *     cdef matApplyTranspose = PyPC(pc).matApplyTranspose
 *     if matApplyTranspose is None:             # <<<<<<<<<<<<<<
 *         try:
 *             pc.ops.matapplytranspose = NULL
*/
  __pyx_t_3 = (__pyx_v_matApplyTranspose == Py_None);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":1689
 *     cdef matApplyTranspose = PyPC(pc).matApplyTranspose
 *     if matApplyTranspose is None:
 *         try:             # <<<<<<<<<<<<<<
 *             pc.ops.matapplytranspose = NULL
 *             CHKERR(PCMatApplyTranspose(pc, X, Y))
*/
    /*try:*/ {

      /* "petsc4py/PETSc/libpetsc4py.pyx":1690
 *     if matApplyTranspose is None:
 *         try:
 *             pc.ops.matapplytranspose = NULL             # <<<<<<<<<<<<<<
 *             CHKERR(PCMatApplyTranspose(pc, X, Y))
 *         finally:
*/
      __pyx_v_pc->ops->matapplytranspose = NULL;

      /* "petsc4py/PETSc/libpetsc4py.pyx":1691
 *         try:
 *             pc.ops.matapplytranspose = NULL
 *             CHKERR(PCMatApplyTranspose(pc, X, Y))             # <<<<<<<<<<<<<<
 *         finally:
 *             pc.ops.matapplytranspose = PCMatApplyTranspose_Python
*/
      __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_CHKERR(PCMatApplyTranspose(__pyx_v_pc, __pyx_v_X, __pyx_v_Y)); if (unlikely(__pyx_t_4 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 1691, __pyx_L5_error)
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":1693
 *             CHKERR(PCMatApplyTranspose(pc, X, Y))
 *         finally:
 *             pc.ops.matapplytranspose = PCMatApplyTranspose_Python             # <<<<<<<<<<<<<<
 *         return FunctionEnd()
 *     matApplyTranspose(PC_(pc), Mat_(X), Mat_(Y))
*/
    /*finally:*/ {
      /*normal exit:*/{
        __pyx_v_pc->ops->matapplytranspose = __pyx_f_8petsc4py_5PETSc_PCMatApplyTranspose_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;
         __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        if ( 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->matapplytranspose = __pyx_f_8petsc4py_5PETSc_PCMatApplyTranspose_Python;
        }
        __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":1694
 *         finally:
 *             pc.ops.matapplytranspose = PCMatApplyTranspose_Python
 *         return FunctionEnd()             # <<<<<<<<<<<<<<
 *     matApplyTranspose(PC_(pc), Mat_(X), Mat_(Y))
 *     return FunctionEnd()
*/
    __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1688
 *     FunctionBegin(b"PCMatApplyTranspose_Python")
 *     cdef matApplyTranspose = PyPC(pc).matApplyTranspose
 *     if matApplyTranspose is None:             # <<<<<<<<<<<<<<
 *         try:
 *             pc.ops.matapplytranspose = NULL
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1695
 *             pc.ops.matapplytranspose = PCMatApplyTranspose_Python
 *         return FunctionEnd()
 *     matApplyTranspose(PC_(pc), Mat_(X), Mat_(Y))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_matApplyTranspose);
  __pyx_t_14 = __pyx_v_matApplyTranspose; 
  __pyx_t_15 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PC_(__pyx_v_pc)); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 1695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_X)); if (unlikely(!__pyx_t_16)) __PYX_ERR(5, 1695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);
  __pyx_t_17 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Mat_(__pyx_v_Y)); if (unlikely(!__pyx_t_17)) __PYX_ERR(5, 1695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);
  __pyx_t_18 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_14))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
    __pyx_t_18 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_15, __pyx_t_16, __pyx_t_17};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_14, __pyx_callargs+__pyx_t_18, (4-__pyx_t_18) | (__pyx_t_18*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1696
 *         return FunctionEnd()
 *     matApplyTranspose(PC_(pc), Mat_(X), Mat_(Y))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1681
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode PCMatApplyTranspose_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.PCMatApplyTranspose_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_matApplyTranspose);
  __Pyx_RefNannyFinishContext();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1726
 * @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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1727
 * 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":1728
 * 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":1727
 * 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":1730
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyKSP), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1730, __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":1726
 * @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":1732
 *         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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1734
 * 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":1735
 *     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(5, 1735, __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(5, 1735, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1736
 *     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":1732
 *         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":1738
 *     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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1740
 * 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":1741
 *     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(5, 1741, __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(5, 1741, __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(5, 1741, __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":1742
 *     FunctionBegin(b"KSPPythonSetContext")
 *     PyKSP(ksp).setcontext(ctx, KSP_(ksp))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode KSPPythonSetType_PYTHON(PetscKSP ksp, const char *name) \
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1738
 *     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":1744
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode KSPPythonSetType_PYTHON(PetscKSP ksp, const 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 const *__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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSPPythonSetType_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1746
 * cdef PetscErrorCode KSPPythonSetType_PYTHON(PetscKSP ksp, const 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":1747
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"KSPPythonSetType_PYTHON")
 *     if name == NULL: return FunctionEnd() # XXX             # <<<<<<<<<<<<<<
 *     cdef object ctx = createcontext(name)
 *     KSPPythonSetContext(ksp, <void*>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":1748
 *     FunctionBegin(b"KSPPythonSetType_PYTHON")
 *     if name == NULL: return FunctionEnd() # XXX
 *     cdef object ctx = createcontext(name)             # <<<<<<<<<<<<<<
 *     KSPPythonSetContext(ksp, <void*>ctx)
 *     PyKSP(ksp).setname(name)
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ctx = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1749
 *     if name == NULL: return FunctionEnd() # XXX
 *     cdef object ctx = createcontext(name)
 *     KSPPythonSetContext(ksp, <void*>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(5, 1749, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1750
 *     cdef object ctx = createcontext(name)
 *     KSPPythonSetContext(ksp, <void*>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(5, 1750, __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(5, 1750, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1751
 *     KSPPythonSetContext(ksp, <void*>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":1744
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode KSPPythonSetType_PYTHON(PetscKSP ksp, const 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1753
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSPPythonGetType_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1755
 * 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":1756
 *     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(5, 1756, __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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 1756, __pyx_L1_error)
  (__pyx_v_name[0]) = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1757
 *     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":1753
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1759
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode KSPCreate_Python(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSPCreate_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1762
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"KSPCreate_Python")             # <<<<<<<<<<<<<<
 *     cdef KSPOps ops    = ksp.ops
 *     ops.reset          = KSPReset_Python
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPCreate_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":1763
 *     ) except PETSC_ERR_PYTHON with gil:
 *     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":1764
 *     FunctionBegin(b"KSPCreate_Python")
 *     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":1765
 *     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":1766
 *     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":1767
 *     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":1768
 *     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":1769
 *     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":1770
 *     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":1771
 *     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":1773
 *     ops.buildresidual  = KSPBuildResidual_Python
 *     #
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>ksp, b"KSPPythonSetType_C",
 *             <PetscVoidFunction>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(5, 1773, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1776
 *             <PetscObject>ksp, b"KSPPythonSetType_C",
 *             <PetscVoidFunction>KSPPythonSetType_PYTHON))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>ksp, b"KSPPythonGetType_C",
 *             <PetscVoidFunction>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(5, 1776, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1780
 *             <PetscVoidFunction>KSPPythonGetType_PYTHON))
 *     #
 *     cdef ctx = PyKSP(NULL)             # <<<<<<<<<<<<<<
 *     ksp.data = <void*> ctx
 *     Py_INCREF(<PyObject*>ksp.data)
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_ctx = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1781
 *     #
 *     cdef ctx = PyKSP(NULL)
 *     ksp.data = <void*> ctx             # <<<<<<<<<<<<<<
 *     Py_INCREF(<PyObject*>ksp.data)
 *     #
*/
  __pyx_v_ksp->data = ((void *)__pyx_v_ctx);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1782
 *     cdef ctx = PyKSP(NULL)
 *     ksp.data = <void*> ctx
 *     Py_INCREF(<PyObject*>ksp.data)             # <<<<<<<<<<<<<<
 *     #
 *     CHKERR(KSPSetSupportedNorm(
*/
  Py_INCREF(((PyObject *)__pyx_v_ksp->data));

  /* "petsc4py/PETSc/libpetsc4py.pyx":1784
 *     Py_INCREF(<PyObject*>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(5, 1784, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1786
 *     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(5, 1786, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1788
 *     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(5, 1788, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1790
 *     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(5, 1790, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1792
 *     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(5, 1792, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1794
 *     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(5, 1794, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1796
 *     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":1759
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode KSPCreate_Python(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1798
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode KSPDestroy_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSPDestroy_Python_inner", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1801
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     try:             # <<<<<<<<<<<<<<
 *         addRef(ksp)
 *         KSPPythonSetContext(ksp, NULL)
*/
  /*try:*/ {

    /* "petsc4py/PETSc/libpetsc4py.pyx":1802
 *     ) 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":1803
 *     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(5, 1803, __pyx_L4_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1805
 *         KSPPythonSetContext(ksp, NULL)
 *     finally:
 *         delRef(ksp)             # <<<<<<<<<<<<<<
 *         Py_DECREF(<PyObject*>ksp.data)
 *         ksp.data = NULL
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_ksp);

      /* "petsc4py/PETSc/libpetsc4py.pyx":1806
 *     finally:
 *         delRef(ksp)
 *         Py_DECREF(<PyObject*>ksp.data)             # <<<<<<<<<<<<<<
 *         ksp.data = NULL
 *     return PETSC_SUCCESS
*/
      Py_DECREF(((PyObject *)__pyx_v_ksp->data));

      /* "petsc4py/PETSc/libpetsc4py.pyx":1807
 *         delRef(ksp)
 *         Py_DECREF(<PyObject*>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;
       __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if ( 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":1805
 *         KSPPythonSetContext(ksp, NULL)
 *     finally:
 *         delRef(ksp)             # <<<<<<<<<<<<<<
 *         Py_DECREF(<PyObject*>ksp.data)
 *         ksp.data = NULL
*/
        __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_ksp);

        /* "petsc4py/PETSc/libpetsc4py.pyx":1806
 *     finally:
 *         delRef(ksp)
 *         Py_DECREF(<PyObject*>ksp.data)             # <<<<<<<<<<<<<<
 *         ksp.data = NULL
 *     return PETSC_SUCCESS
*/
        Py_DECREF(((PyObject *)__pyx_v_ksp->data));

        /* "petsc4py/PETSc/libpetsc4py.pyx":1807
 *         delRef(ksp)
 *         Py_DECREF(<PyObject*>ksp.data)
 *         ksp.data = NULL             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
        __pyx_v_ksp->data = NULL;
      }
      __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":1808
 *         Py_DECREF(<PyObject*>ksp.data)
 *         ksp.data = NULL
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode KSPDestroy_Python(
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1798
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode KSPDestroy_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1810
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode KSPDestroy_Python(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1813
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON nogil:
 *     FunctionBegin(b"KSPDestroy_Python")             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectComposeFunction(
 *             <PetscObject>ksp, b"KSPPythonSetType_C",
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPDestroy_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":1814
 *     ) except PETSC_ERR_PYTHON nogil:
 *     FunctionBegin(b"KSPDestroy_Python")
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>ksp, b"KSPPythonSetType_C",
 *             <PetscVoidFunction>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(5, 1814, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1817
 *             <PetscObject>ksp, b"KSPPythonSetType_C",
 *             <PetscVoidFunction>NULL))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>ksp, b"KSPPythonGetType_C",
 *             <PetscVoidFunction>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(5, 1817, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1821
 *             <PetscVoidFunction>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(5, 1821, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1822
 *     #
 *     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":1810
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode KSPDestroy_Python(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("petsc4py.PETSc.KSPDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1824
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode KSPSetUp_Python(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_KSPSetUp_Python(KSP __pyx_v_ksp) {
  char __pyx_v_name[2048];
  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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSPSetUp_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1827
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"KSPSetUp_Python")             # <<<<<<<<<<<<<<
 *     cdef char name[2048]
 *     cdef PetscBool found = PETSC_FALSE
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPSetUp_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":1829
 *     FunctionBegin(b"KSPSetUp_Python")
 *     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":1830
 *     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(5, 1830, __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":1831
 *     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(5, 1831, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":1834
 *                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:
*/
    __pyx_t_4 = (__pyx_v_found != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      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":1835
 *                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(5, 1835, __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(5, 1835, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":1834
 *                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":1830
 *     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":1836
 *         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(5, 1836, __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":1837
 *             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, __pyx_k_Python_context_not_set_call_one_4);
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1836
 *         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":1843
 *                            "-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(5, 1843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1843, __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":1844
 *     #
 *     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":1845
 *     cdef setUp = PyKSP(ksp).setUp
 *     if setUp is not None:
 *         setUp(KSP_(ksp))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_setUp);
    __pyx_t_7 = __pyx_v_setUp; 
    __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_8};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1845, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1844
 *     #
 *     cdef setUp = PyKSP(ksp).setUp
 *     if setUp is not None:             # <<<<<<<<<<<<<<
 *         setUp(KSP_(ksp))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1846
 *     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":1824
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode KSPSetUp_Python(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1848
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode KSPReset_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSPReset_Python_inner", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1851
 *     PetscKSP ksp,
 *     ) 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(5, 1851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_reset); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1851, __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":1852
 *     ) 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":1853
 *     cdef reset = PyKSP(ksp).reset
 *     if reset is not None:
 *         reset(KSP_(ksp))             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_reset);
    __pyx_t_4 = __pyx_v_reset; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1853, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1853, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1852
 *     ) 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":1854
 *     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":1848
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode KSPReset_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) 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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1856
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode KSPReset_Python(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1859
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON nogil:
 *     if getRef(ksp) == 0: return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 *     FunctionBegin(b"KSPReset_Python")
 *     CHKERR(PetscObjectCompose(<PetscObject>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":1860
 *     ) except PETSC_ERR_PYTHON nogil:
 *     if getRef(ksp) == 0: return PETSC_SUCCESS
 *     FunctionBegin(b"KSPReset_Python")             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectCompose(<PetscObject>ksp, b"@ksp.vec_work_sol", NULL))
 *     CHKERR(PetscObjectCompose(<PetscObject>ksp, b"@ksp.vec_work_res", NULL))
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPReset_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":1861
 *     if getRef(ksp) == 0: return PETSC_SUCCESS
 *     FunctionBegin(b"KSPReset_Python")
 *     CHKERR(PetscObjectCompose(<PetscObject>ksp, b"@ksp.vec_work_sol", NULL))             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectCompose(<PetscObject>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(5, 1861, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1862
 *     FunctionBegin(b"KSPReset_Python")
 *     CHKERR(PetscObjectCompose(<PetscObject>ksp, b"@ksp.vec_work_sol", NULL))
 *     CHKERR(PetscObjectCompose(<PetscObject>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(5, 1862, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1863
 *     CHKERR(PetscObjectCompose(<PetscObject>ksp, b"@ksp.vec_work_sol", NULL))
 *     CHKERR(PetscObjectCompose(<PetscObject>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(5, 1863, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1864
 *     CHKERR(PetscObjectCompose(<PetscObject>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":1856
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode KSPReset_Python(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("petsc4py.PETSc.KSPReset_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1866
 *     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[2048];
  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;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSPSetFromOptions_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1870
 *     PetscOptionItems PetscOptionsObject
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"KSPSetFromOptions_Python")             # <<<<<<<<<<<<<<
 *     cdef char name[2048], *defval = PyKSP(ksp).getname()
 *     cdef PetscBool found = PETSC_FALSE
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPSetFromOptions_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":1871
 *     ) except PETSC_ERR_PYTHON with gil:
 *     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(5, 1871, __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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 1871, __pyx_L1_error)
  __pyx_v_defval = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1872
 *     FunctionBegin(b"KSPSetFromOptions_Python")
 *     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":1873
 *     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":1874
 *     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)); <void>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(5, 1874, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1876
 *     CHKERR(PetscOptionsString(
 *             b"-ksp_python_type", b"Python [package.]module[.{class|function}]",
 *             b"KSPPythonSetType", defval, name, sizeof(name), &found)); <void>opts             # <<<<<<<<<<<<<<
 *     if found and name[0]:
 *         CHKERR(KSPPythonSetType_PYTHON(ksp, name))
*/
  ((void)PetscOptionsObject);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1877
 *             b"-ksp_python_type", b"Python [package.]module[.{class|function}]",
 *             b"KSPPythonSetType", defval, name, sizeof(name), &found)); <void>opts
 *     if found and name[0]:             # <<<<<<<<<<<<<<
 *         CHKERR(KSPPythonSetType_PYTHON(ksp, name))
 *     #
*/
  __pyx_t_5 = (__pyx_v_found != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    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":1878
 *             b"KSPPythonSetType", defval, name, sizeof(name), &found)); <void>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(5, 1878, __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(5, 1878, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":1877
 *             b"-ksp_python_type", b"Python [package.]module[.{class|function}]",
 *             b"KSPPythonSetType", defval, name, sizeof(name), &found)); <void>opts
 *     if found and name[0]:             # <<<<<<<<<<<<<<
 *         CHKERR(KSPPythonSetType_PYTHON(ksp, name))
 *     #
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1880
 *         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(5, 1880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1880, __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":1881
 *     #
 *     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":1882
 *     cdef setFromOptions = PyKSP(ksp).setFromOptions
 *     if setFromOptions is not None:
 *         setFromOptions(KSP_(ksp))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_setFromOptions);
    __pyx_t_8 = __pyx_v_setFromOptions; 
    __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 1882, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_9};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1882, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1881
 *     #
 *     cdef setFromOptions = PyKSP(ksp).setFromOptions
 *     if setFromOptions is not None:             # <<<<<<<<<<<<<<
 *         setFromOptions(KSP_(ksp))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1883
 *     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":1866
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1885
 *     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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSPView_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1889
 *     PetscViewer vwr,
 *     ) 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":1890
 *     ) 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(5, 1890, __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(5, 1890, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1891
 *     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(5, 1891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1891, __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":1892
 *     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":1893
 *     cdef view = PyKSP(ksp).view
 *     if view is not None:
 *         view(KSP_(ksp), Viewer_(vwr))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_view);
    __pyx_t_5 = __pyx_v_view; 
    __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_6, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1893, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1892
 *     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":1894
 *     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":1885
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1896
 *     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;
  size_t __pyx_t_7;
  PetscErrorCode __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSPBuildSolution_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1901
 *     PetscVec *V,
 *     ) 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":1902
 *     ) 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":1903
 *     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(5, 1903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_buildSolution); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1903, __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":1904
 *     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":1905
 *     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":1906
 *     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 = NULL;
    __Pyx_INCREF(__pyx_v_buildSolution);
    __pyx_t_4 = __pyx_v_buildSolution; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1906, __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(5, 1906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_5, __pyx_t_6};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1906, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1907
 *         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":1904
 *     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":1909
 *         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(5, 1909, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1910
 *     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":1896
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1912
 *     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;
  size_t __pyx_t_8;
  PetscErrorCode __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSPBuildResidual_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1918
 *     PetscVec *V,
 *     ) 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":1919
 *     ) 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(5, 1919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_buildResidual); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1919, __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":1920
 *     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":1921
 *     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 = NULL;
    __Pyx_INCREF(__pyx_v_buildResidual);
    __pyx_t_4 = __pyx_v_buildResidual; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_t)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_v)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1921, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1922
 *     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":1920
 *     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":1924
 *         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(5, 1924, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1925
 *     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":1912
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1927
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode KSPSolve_Python(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSPSolve_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":1930
 *     PetscKSP ksp,
 *     ) 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":1931
 *     ) 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":1932
 *     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(5, 1932, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1933
 *     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(5, 1933, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1935
 *     CHKERR(KSPGetSolution(ksp, &X))
 *     #
 *     ksp.iter = 0             # <<<<<<<<<<<<<<
 *     ksp.reason = KSP_CONVERGED_ITERATING
 *     #
*/
  __pyx_v_ksp->its = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1936
 *     #
 *     ksp.iter = 0
 *     ksp.reason = KSP_CONVERGED_ITERATING             # <<<<<<<<<<<<<<
 *     #
 *     cdef solve = None
*/
  __pyx_v_ksp->reason = KSP_CONVERGED_ITERATING;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1938
 *     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":1939
 *     #
 *     cdef solve = None
 *     if ksp.transpose_solve:             # <<<<<<<<<<<<<<
 *         solve = PyKSP(ksp).solveTranspose
 *     else:
*/
  __pyx_t_2 = (__pyx_v_ksp->transpose_solve != 0);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":1940
 *     cdef solve = None
 *     if ksp.transpose_solve:
 *         solve = PyKSP(ksp).solveTranspose             # <<<<<<<<<<<<<<
 *     else:
 *         solve = PyKSP(ksp).solve
*/
    __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_solveTranspose); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_solve, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1939
 *     #
 *     cdef solve = None
 *     if ksp.transpose_solve:             # <<<<<<<<<<<<<<
 *         solve = PyKSP(ksp).solveTranspose
 *     else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1942
 *         solve = PyKSP(ksp).solveTranspose
 *     else:
 *         solve = PyKSP(ksp).solve             # <<<<<<<<<<<<<<
 *     if solve is not None:
 *         solve(KSP_(ksp), Vec_(B), Vec_(X))
*/
  /*else*/ {
    __pyx_t_4 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_solve); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_solve, __pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1943
 *     else:
 *         solve = PyKSP(ksp).solve
 *     if solve is not None:             # <<<<<<<<<<<<<<
 *         solve(KSP_(ksp), Vec_(B), Vec_(X))
 *     else:
*/
  __pyx_t_2 = (__pyx_v_solve != Py_None);
  if (__pyx_t_2) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":1944
 *         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_4 = NULL;
    __Pyx_INCREF(__pyx_v_solve);
    __pyx_t_5 = __pyx_v_solve; 
    __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_B)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_X)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_6, __pyx_t_7, __pyx_t_8};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __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;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1944, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":1943
 *     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":1946
 *         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(5, 1946, __pyx_L1_error)
  }
  __pyx_L4:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1947
 *     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":1927
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode KSPSolve_Python(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":1949
 *     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;
  Vec __pyx_v_R;
  PetscReal __pyx_v_rnorm;
  long __pyx_v_its;
  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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();

  /* "petsc4py/PETSc/libpetsc4py.pyx":1954
 *     PetscVec X,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"KSPSolve_Python_default")             # <<<<<<<<<<<<<<
 *     cdef PetscVec t = NULL
 *     CHKERR(PetscObjectQuery(
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"KSPSolve_Python_default"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":1955
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"KSPSolve_Python_default")
 *     cdef PetscVec t = NULL             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectQuery(
 *             <PetscObject>ksp,
*/
  __pyx_v_t = NULL;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1956
 *     FunctionBegin(b"KSPSolve_Python_default")
 *     cdef PetscVec t = NULL
 *     CHKERR(PetscObjectQuery(             # <<<<<<<<<<<<<<
 *             <PetscObject>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(5, 1956, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1960
 *             b"@ksp.vec_work_sol",
 *             <PetscObject*>&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":1961
 *             <PetscObject*>&t))
 *     if t == NULL:
 *         CHKERR(VecDuplicate(X, &t))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectCompose(
 *                 <PetscObject>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(5, 1961, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":1962
 *     if t == NULL:
 *         CHKERR(VecDuplicate(X, &t))
 *         CHKERR(PetscObjectCompose(             # <<<<<<<<<<<<<<
 *                 <PetscObject>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(5, 1962, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":1960
 *             b"@ksp.vec_work_sol",
 *             <PetscObject*>&t))
 *     if t == NULL:             # <<<<<<<<<<<<<<
 *         CHKERR(VecDuplicate(X, &t))
 *         CHKERR(PetscObjectCompose(
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1966
 *                 b"@ksp.vec_work_sol",
 *                 <PetscObject>t))
 *     cdef PetscVec v = NULL             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectQuery(
 *             <PetscObject>ksp,
*/
  __pyx_v_v = NULL;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1967
 *                 <PetscObject>t))
 *     cdef PetscVec v = NULL
 *     CHKERR(PetscObjectQuery(             # <<<<<<<<<<<<<<
 *             <PetscObject>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(5, 1967, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1971
 *             b"@ksp.vec_work_res",
 *             <PetscObject*>&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":1972
 *             <PetscObject*>&v))
 *     if v == NULL:
 *         CHKERR(VecDuplicate(B, &v))             # <<<<<<<<<<<<<<
 *         CHKERR(PetscObjectCompose(
 *                 <PetscObject>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(5, 1972, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":1973
 *     if v == NULL:
 *         CHKERR(VecDuplicate(B, &v))
 *         CHKERR(PetscObjectCompose(             # <<<<<<<<<<<<<<
 *                 <PetscObject>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(5, 1973, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":1971
 *             b"@ksp.vec_work_res",
 *             <PetscObject*>&v))
 *     if v == NULL:             # <<<<<<<<<<<<<<
 *         CHKERR(VecDuplicate(B, &v))
 *         CHKERR(PetscObjectCompose(
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":1978
 *                 <PetscObject>v))
 *     #
 *     cdef PetscVec R = NULL             # <<<<<<<<<<<<<<
 *     cdef PetscReal rnorm = 0
 *     #
*/
  __pyx_v_R = NULL;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1979
 *     #
 *     cdef PetscVec R = NULL
 *     cdef PetscReal rnorm = 0             # <<<<<<<<<<<<<<
 *     #
 *     CHKERR(KSPBuildResidual(ksp, t, v, &R))
*/
  __pyx_v_rnorm = 0.0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1981
 *     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(5, 1981, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1982
 *     #
 *     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(5, 1982, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1984
 *     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(5, 1984, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1985
 *     #
 *     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(5, 1985, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1986
 *     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:
 *         <void> its # unused
*/
  __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(5, 1986, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":1987
 *     CHKERR(KSPLogHistory(ksp, ksp.norm))
 *     CHKERR(KSPMonitor(ksp, ksp.iter, ksp.norm))
 *     for its from 0 <= its < ksp.max_its:             # <<<<<<<<<<<<<<
 *         <void> its # unused
 *         if ksp.reason: break
*/
  __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":1988
 *     CHKERR(KSPMonitor(ksp, ksp.iter, ksp.norm))
 *     for its from 0 <= its < ksp.max_its:
 *         <void> its # unused             # <<<<<<<<<<<<<<
 *         if ksp.reason: break
 *         KSPPreStep_Python(ksp)
*/
    ((void)__pyx_v_its);

    /* "petsc4py/PETSc/libpetsc4py.pyx":1989
 *     for its from 0 <= its < ksp.max_its:
 *         <void> its # unused
 *         if ksp.reason: break             # <<<<<<<<<<<<<<
 *         KSPPreStep_Python(ksp)
 *         #
*/
    if (__pyx_v_ksp->reason) {
      goto __pyx_L6_break;
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":1990
 *         <void> its # unused
 *         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(5, 1990, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":1992
 *         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(5, 1992, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":1993
 *         #
 *         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(5, 1993, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":1994
 *         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(5, 1994, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":1995
 *         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":1997
 *         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(5, 1997, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":1998
 *         #
 *         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(5, 1998, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":1999
 *         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(5, 1999, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2000
 *         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(5, 2000, __pyx_L1_error)
  }
  __pyx_L6_break:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2001
 *         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":2002
 *         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":2003
 *     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":2002
 *         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":2001
 *         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":2005
 *             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":1949
 *     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:;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2007
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode KSPPreStep_Python(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSPPreStep_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2010
 *     PetscKSP ksp,
 *     ) 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":2011
 *     ) 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(5, 2011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_preStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2011, __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":2012
 *     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":2013
 *     cdef preStep = PyKSP(ksp).preStep
 *     if preStep is not None:
 *         preStep(KSP_(ksp))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_preStep);
    __pyx_t_4 = __pyx_v_preStep; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2013, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2013, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2012
 *     FunctionBegin(b"KSPPreStep_Python")
 *     cdef preStep = PyKSP(ksp).preStep
 *     if preStep is not None:             # <<<<<<<<<<<<<<
 *         preStep(KSP_(ksp))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2014
 *     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":2007
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode KSPPreStep_Python(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) 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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2016
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode KSPPostStep_Python(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSPPostStep_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2019
 *     PetscKSP ksp,
 *     ) 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":2020
 *     ) 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(5, 2020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_postStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2020, __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":2021
 *     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":2022
 *     cdef postStep = PyKSP(ksp).postStep
 *     if postStep is not None:
 *         postStep(KSP_(ksp))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_postStep);
    __pyx_t_4 = __pyx_v_postStep; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2022, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2021
 *     FunctionBegin(b"KSPPostStep_Python")
 *     cdef postStep = PyKSP(ksp).postStep
 *     if postStep is not None:             # <<<<<<<<<<<<<<
 *         postStep(KSP_(ksp))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2023
 *     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":2016
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode KSPPostStep_Python(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     ) 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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2025
 *     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
  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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("KSPStep_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2030
 *     PetscVec X,
 *     ) 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":2031
 *     ) 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":2032
 *     FunctionBegin(b"KSPStep_Python")
 *     cdef step = None
 *     if ksp.transpose_solve:             # <<<<<<<<<<<<<<
 *         step = PyKSP(ksp).stepTranspose
 *         if step is None: return UNSUPPORTED(b"stepTranspose")
*/
  __pyx_t_1 = (__pyx_v_ksp->transpose_solve != 0);
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":2033
 *     cdef step = None
 *     if ksp.transpose_solve:
 *         step = PyKSP(ksp).stepTranspose             # <<<<<<<<<<<<<<
 *         if step is None: return UNSUPPORTED(b"stepTranspose")
 *     else:
*/
    __pyx_t_2 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2033, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stepTranspose); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2033, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_step, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2034
 *     if ksp.transpose_solve:
 *         step = PyKSP(ksp).stepTranspose
 *         if step is None: return UNSUPPORTED(b"stepTranspose")             # <<<<<<<<<<<<<<
 *     else:
 *         step = PyKSP(ksp).step
*/
    __pyx_t_1 = (__pyx_v_step == Py_None);
    if (__pyx_t_1) {
      __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(__pyx_k_stepTranspose);
      goto __pyx_L0;
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":2032
 *     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":2036
 *         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_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyKSP(__pyx_v_ksp)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_step, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2037
 *     else:
 *         step = PyKSP(ksp).step
 *         if step is None: return UNSUPPORTED(b"step")             # <<<<<<<<<<<<<<
 *     step(KSP_(ksp), Vec_(B), Vec_(X))
 *     return FunctionEnd()
*/
    __pyx_t_1 = (__pyx_v_step == Py_None);
    if (__pyx_t_1) {
      __pyx_r = __pyx_f_8petsc4py_5PETSc_UNSUPPORTED(__pyx_k_step);
      goto __pyx_L0;
    }
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2038
 *         step = PyKSP(ksp).step
 *         if step is None: return UNSUPPORTED(b"step")
 *     step(KSP_(ksp), Vec_(B), Vec_(X))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_INCREF(__pyx_v_step);
  __pyx_t_4 = __pyx_v_step; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_KSP_(__pyx_v_ksp)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2038, __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(5, 2038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_X)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2039
 *         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":2025
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode KSPStep_Python(             # <<<<<<<<<<<<<<
 *     PetscKSP ksp,
 *     PetscVec B,
*/

  /* 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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2069
 * @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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2070
 * 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":2071
 * 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":2070
 * 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":2073
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PySNES), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2073, __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":2069
 * @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":2075
 *         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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2077
 * 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":2078
 *     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(5, 2078, __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(5, 2078, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2079
 *     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":2075
 *         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":2081
 *     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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2083
 * 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":2084
 *     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(5, 2084, __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(5, 2084, __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(5, 2084, __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":2085
 *     FunctionBegin(b"SNESPythonSetContext ")
 *     PySNES(snes).setcontext(ctx, SNES_(snes))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode SNESPythonSetType_PYTHON(PetscSNES snes, const char *name) \
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2081
 *     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":2087
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode SNESPythonSetType_PYTHON(PetscSNES snes, const 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 const *__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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNESPythonSetType_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2089
 * cdef PetscErrorCode SNESPythonSetType_PYTHON(PetscSNES snes, const 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":2090
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"SNESPythonSetType_PYTHON")
 *     if name == NULL: return FunctionEnd() # XXX             # <<<<<<<<<<<<<<
 *     cdef object ctx = createcontext(name)
 *     SNESPythonSetContext(snes, <void*>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":2091
 *     FunctionBegin(b"SNESPythonSetType_PYTHON")
 *     if name == NULL: return FunctionEnd() # XXX
 *     cdef object ctx = createcontext(name)             # <<<<<<<<<<<<<<
 *     SNESPythonSetContext(snes, <void*>ctx)
 *     PySNES(snes).setname(name)
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ctx = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2092
 *     if name == NULL: return FunctionEnd() # XXX
 *     cdef object ctx = createcontext(name)
 *     SNESPythonSetContext(snes, <void*>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(5, 2092, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2093
 *     cdef object ctx = createcontext(name)
 *     SNESPythonSetContext(snes, <void*>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(5, 2093, __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(5, 2093, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2094
 *     SNESPythonSetContext(snes, <void*>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":2087
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode SNESPythonSetType_PYTHON(PetscSNES snes, const 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2096
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNESPythonGetType_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2098
 * 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":2099
 *     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(5, 2099, __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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 2099, __pyx_L1_error)
  (__pyx_v_name[0]) = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2100
 *     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":2096
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2102
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode SNESCreate_Python(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNESCreate_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2105
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"SNESCreate_Python")             # <<<<<<<<<<<<<<
 *     cdef SNESOps ops   = snes.ops
 *     cdef PetscSNESLineSearch ls = NULL
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESCreate_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2106
 *     ) except PETSC_ERR_PYTHON with gil:
 *     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":2107
 *     FunctionBegin(b"SNESCreate_Python")
 *     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":2108
 *     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":2109
 *     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":2110
 *     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":2111
 *     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":2112
 *     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":2113
 *     ops.setfromoptions = SNESSetFromOptions_Python
 *     ops.view           = SNESView_Python
 *     ops.solve          = SNESSolve_Python             # <<<<<<<<<<<<<<
 *     #
 *     CHKERR(SNESParametersInitialize(snes))
*/
  __pyx_v_ops->solve = __pyx_f_8petsc4py_5PETSc_SNESSolve_Python;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2115
 *     ops.solve          = SNESSolve_Python
 *     #
 *     CHKERR(SNESParametersInitialize(snes))             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectComposeFunction(
 *             <PetscObject>snes, b"SNESPythonSetType_C",
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESParametersInitialize(__pyx_v_snes)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 2115, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2116
 *     #
 *     CHKERR(SNESParametersInitialize(snes))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>snes, b"SNESPythonSetType_C",
 *             <PetscVoidFunction>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(5, 2116, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2119
 *             <PetscObject>snes, b"SNESPythonSetType_C",
 *             <PetscVoidFunction>SNESPythonSetType_PYTHON))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>snes, b"SNESPythonGetType_C",
 *             <PetscVoidFunction>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(5, 2119, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2123
 *             <PetscVoidFunction>SNESPythonGetType_PYTHON))
 *     #
 *     cdef ctx = PySNES(NULL)             # <<<<<<<<<<<<<<
 *     snes.data = <void*> ctx
 * 
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PySNES(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_ctx = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2124
 *     #
 *     cdef ctx = PySNES(NULL)
 *     snes.data = <void*> ctx             # <<<<<<<<<<<<<<
 * 
 *     # Ensure that the SNES has a linesearch object early enough that
*/
  __pyx_v_snes->data = ((void *)__pyx_v_ctx);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2128
 *     # Ensure that the SNES has a linesearch object early enough that
 *     # it gets setFromOptions.
 *     CHKERR(SNESGetLineSearch(snes, &ls))             # <<<<<<<<<<<<<<
 *     Py_INCREF(<PyObject*>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(5, 2128, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2129
 *     # it gets setFromOptions.
 *     CHKERR(SNESGetLineSearch(snes, &ls))
 *     Py_INCREF(<PyObject*>snes.data)             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  Py_INCREF(((PyObject *)__pyx_v_snes->data));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2130
 *     CHKERR(SNESGetLineSearch(snes, &ls))
 *     Py_INCREF(<PyObject*>snes.data)
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscErrorCode SNESDestroy_Python_inner(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2102
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode SNESCreate_Python(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2132
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode SNESDestroy_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNESDestroy_Python_inner", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2135
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     try:             # <<<<<<<<<<<<<<
 *         addRef(snes)
 *         SNESPythonSetContext(snes, NULL)
*/
  /*try:*/ {

    /* "petsc4py/PETSc/libpetsc4py.pyx":2136
 *     ) 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":2137
 *     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(5, 2137, __pyx_L4_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2139
 *         SNESPythonSetContext(snes, NULL)
 *     finally:
 *         delRef(snes)             # <<<<<<<<<<<<<<
 *         Py_DECREF(<PyObject*>snes.data)
 *         snes.data = NULL
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_snes);

      /* "petsc4py/PETSc/libpetsc4py.pyx":2140
 *     finally:
 *         delRef(snes)
 *         Py_DECREF(<PyObject*>snes.data)             # <<<<<<<<<<<<<<
 *         snes.data = NULL
 *     return PETSC_SUCCESS
*/
      Py_DECREF(((PyObject *)__pyx_v_snes->data));

      /* "petsc4py/PETSc/libpetsc4py.pyx":2141
 *         delRef(snes)
 *         Py_DECREF(<PyObject*>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;
       __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if ( 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":2139
 *         SNESPythonSetContext(snes, NULL)
 *     finally:
 *         delRef(snes)             # <<<<<<<<<<<<<<
 *         Py_DECREF(<PyObject*>snes.data)
 *         snes.data = NULL
*/
        __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_snes);

        /* "petsc4py/PETSc/libpetsc4py.pyx":2140
 *     finally:
 *         delRef(snes)
 *         Py_DECREF(<PyObject*>snes.data)             # <<<<<<<<<<<<<<
 *         snes.data = NULL
 *     return PETSC_SUCCESS
*/
        Py_DECREF(((PyObject *)__pyx_v_snes->data));

        /* "petsc4py/PETSc/libpetsc4py.pyx":2141
 *         delRef(snes)
 *         Py_DECREF(<PyObject*>snes.data)
 *         snes.data = NULL             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
        __pyx_v_snes->data = NULL;
      }
      __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":2142
 *         Py_DECREF(<PyObject*>snes.data)
 *         snes.data = NULL
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode SNESDestroy_Python(
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2132
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode SNESDestroy_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2144
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode SNESDestroy_Python(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2147
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON nogil:
 *     FunctionBegin(b"SNESDestroy_Python")             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectComposeFunction(
 *             <PetscObject>snes, b"SNESPythonSetType_C",
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESDestroy_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2148
 *     ) except PETSC_ERR_PYTHON nogil:
 *     FunctionBegin(b"SNESDestroy_Python")
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>snes, b"SNESPythonSetType_C",
 *             <PetscVoidFunction>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(5, 2148, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2151
 *             <PetscObject>snes, b"SNESPythonSetType_C",
 *             <PetscVoidFunction>NULL))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>snes, b"SNESPythonGetType_C",
 *             <PetscVoidFunction>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(5, 2151, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2155
 *             <PetscVoidFunction>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(5, 2155, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2156
 *     #
 *     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":2144
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode SNESDestroy_Python(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("petsc4py.PETSc.SNESDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2158
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode SNESSetUp_Python(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_SNESSetUp_Python(SNES __pyx_v_snes) {
  char __pyx_v_name[2048];
  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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNESSetUp_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2161
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"SNESSetUp_Python")             # <<<<<<<<<<<<<<
 *     cdef char name[2048]
 *     cdef PetscBool found = PETSC_FALSE
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESSetUp_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2163
 *     FunctionBegin(b"SNESSetUp_Python")
 *     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":2164
 *     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(5, 2164, __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":2165
 *     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(5, 2165, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2168
 *                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:
*/
    __pyx_t_4 = (__pyx_v_found != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      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":2169
 *                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(5, 2169, __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(5, 2169, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":2168
 *                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":2164
 *     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":2170
 *         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(5, 2170, __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":2171
 *             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, __pyx_k_Python_context_not_set_call_one_5);
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2170
 *         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":2177
 *                            "-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(5, 2177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2177, __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":2178
 *     #
 *     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":2179
 *     cdef setUp = PySNES(snes).setUp
 *     if setUp is not None:
 *         setUp(SNES_(snes))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_setUp);
    __pyx_t_7 = __pyx_v_setUp; 
    __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 2179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_8};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2178
 *     #
 *     cdef setUp = PySNES(snes).setUp
 *     if setUp is not None:             # <<<<<<<<<<<<<<
 *         setUp(SNES_(snes))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2180
 *     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":2158
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode SNESSetUp_Python(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2182
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode SNESReset_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNESReset_Python_inner", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2185
 *     PetscSNES snes,
 *     ) 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(5, 2185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_reset); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2185, __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":2186
 *     ) 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":2187
 *     cdef reset = PySNES(snes).reset
 *     if reset is not None:
 *         reset(SNES_(snes))             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_reset);
    __pyx_t_4 = __pyx_v_reset; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2186
 *     ) 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":2188
 *     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":2182
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode SNESReset_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) 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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2190
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode SNESReset_Python(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2193
 *     PetscSNES snes,
 *     ) 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":2194
 *     ) 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":2195
 *     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(5, 2195, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2196
 *     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":2190
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode SNESReset_Python(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("petsc4py.PETSc.SNESReset_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2198
 *     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[2048];
  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;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNESSetFromOptions_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2202
 *     PetscOptionItems PetscOptionsObject,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"SNESSetFromOptions_Python")             # <<<<<<<<<<<<<<
 *     cdef char name[2048], *defval = PySNES(snes).getname()
 *     cdef PetscBool found = PETSC_FALSE
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESSetFromOptions_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2203
 *     ) except PETSC_ERR_PYTHON with gil:
 *     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(5, 2203, __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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 2203, __pyx_L1_error)
  __pyx_v_defval = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2204
 *     FunctionBegin(b"SNESSetFromOptions_Python")
 *     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":2205
 *     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":2206
 *     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)); <void>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(5, 2206, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2208
 *     CHKERR(PetscOptionsString(
 *             b"-snes_python_type", b"Python [package.]module[.{class|function}]",
 *             b"SNESPythonSetType", defval, name, sizeof(name), &found)); <void>opts             # <<<<<<<<<<<<<<
 *     if found and name[0]:
 *         CHKERR(SNESPythonSetType_PYTHON(snes, name))
*/
  ((void)PetscOptionsObject);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2209
 *             b"-snes_python_type", b"Python [package.]module[.{class|function}]",
 *             b"SNESPythonSetType", defval, name, sizeof(name), &found)); <void>opts
 *     if found and name[0]:             # <<<<<<<<<<<<<<
 *         CHKERR(SNESPythonSetType_PYTHON(snes, name))
 *     #
*/
  __pyx_t_5 = (__pyx_v_found != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    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":2210
 *             b"SNESPythonSetType", defval, name, sizeof(name), &found)); <void>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(5, 2210, __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(5, 2210, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2209
 *             b"-snes_python_type", b"Python [package.]module[.{class|function}]",
 *             b"SNESPythonSetType", defval, name, sizeof(name), &found)); <void>opts
 *     if found and name[0]:             # <<<<<<<<<<<<<<
 *         CHKERR(SNESPythonSetType_PYTHON(snes, name))
 *     #
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2212
 *         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(5, 2212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2212, __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":2213
 *     #
 *     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":2214
 *     cdef setFromOptions = PySNES(snes).setFromOptions
 *     if setFromOptions is not None:
 *         setFromOptions(SNES_(snes))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_setFromOptions);
    __pyx_t_8 = __pyx_v_setFromOptions; 
    __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 2214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_9};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2213
 *     #
 *     cdef setFromOptions = PySNES(snes).setFromOptions
 *     if setFromOptions is not None:             # <<<<<<<<<<<<<<
 *         setFromOptions(SNES_(snes))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2215
 *     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":2198
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2217
 *     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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNESView_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2221
 *     PetscViewer vwr,
 *     ) 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":2222
 *     ) 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(5, 2222, __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(5, 2222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2223
 *     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(5, 2223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2223, __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":2224
 *     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":2225
 *     cdef view = PySNES(snes).view
 *     if view is not None:
 *         view(SNES_(snes), Viewer_(vwr))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_view);
    __pyx_t_5 = __pyx_v_view; 
    __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_6, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2225, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2224
 *     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":2226
 *     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":2217
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2228
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode SNESSolve_Python(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNESSolve_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2231
 *     PetscSNES snes,
 *     ) 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":2232
 *     ) 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":2233
 *     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(5, 2233, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2234
 *     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(5, 2234, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2236
 *     CHKERR(SNESGetSolution(snes, &x))
 *     #
 *     snes.iter = 0             # <<<<<<<<<<<<<<
 *     #
 *     cdef solve = PySNES(snes).solve
*/
  __pyx_v_snes->iter = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2238
 *     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(5, 2238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_solve); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2238, __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":2239
 *     #
 *     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":2240
 *     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 = NULL;
    __Pyx_INCREF(__pyx_v_solve);
    __pyx_t_5 = __pyx_v_solve; 
    __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = (__pyx_v_b != NULL);
    if (__pyx_t_4) {
      __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_b)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 2240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __pyx_t_8;
      __pyx_t_8 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_7 = Py_None;
    }
    __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 2240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_6, __pyx_t_7, __pyx_t_8};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __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;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2239
 *     #
 *     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":2242
 *         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(5, 2242, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2244
 *         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":2228
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode SNESSolve_Python(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2246
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode SNESSolve_Python_default(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  PetscInt __pyx_v_lits;
  long __pyx_v_its;
  PetscErrorCode __pyx_r;
  PetscErrorCode __pyx_t_1;
  PetscInt __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();

  /* "petsc4py/PETSc/libpetsc4py.pyx":2249
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"SNESSolve_Python_default")             # <<<<<<<<<<<<<<
 *     cdef PetscVec X=NULL, F=NULL, Y=NULL
 *     cdef PetscSNESLineSearch ls=NULL
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESSolve_Python_default"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2250
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"SNESSolve_Python_default")
 *     cdef PetscVec X=NULL, F=NULL, Y=NULL             # <<<<<<<<<<<<<<
 *     cdef PetscSNESLineSearch ls=NULL
 *     CHKERR(SNESGetSolution(snes, &X))
*/
  __pyx_v_X = NULL;
  __pyx_v_F = NULL;
  __pyx_v_Y = NULL;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2251
 *     FunctionBegin(b"SNESSolve_Python_default")
 *     cdef PetscVec X=NULL, F=NULL, Y=NULL
 *     cdef PetscSNESLineSearch ls=NULL             # <<<<<<<<<<<<<<
 *     CHKERR(SNESGetSolution(snes, &X))
 *     CHKERR(SNESGetFunction(snes, &F, NULL, NULL))
*/
  __pyx_v_ls = NULL;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2252
 *     cdef PetscVec X=NULL, F=NULL, Y=NULL
 *     cdef PetscSNESLineSearch ls=NULL
 *     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(5, 2252, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2253
 *     cdef PetscSNESLineSearch ls=NULL
 *     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(5, 2253, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2254
 *     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(SNESGetSolutionUpdate(__pyx_v_snes, (&__pyx_v_Y))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 2254, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2255
 *     CHKERR(SNESGetFunction(snes, &F, NULL, NULL))
 *     CHKERR(SNESGetSolutionUpdate(snes, &Y))
 *     CHKERR(SNESGetLineSearch(snes, &ls))             # <<<<<<<<<<<<<<
 *     #
 *     CHKERR(VecSet(Y, 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(5, 2255, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2257
 *     CHKERR(SNESGetLineSearch(snes, &ls))
 *     #
 *     CHKERR(VecSet(Y, 0.0))             # <<<<<<<<<<<<<<
 *     snes.ynorm = 0.0
 *     CHKERR(SNESComputeFunction(snes, X, F))
*/
  __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(5, 2257, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2258
 *     #
 *     CHKERR(VecSet(Y, 0.0))
 *     snes.ynorm = 0.0             # <<<<<<<<<<<<<<
 *     CHKERR(SNESComputeFunction(snes, X, F))
 *     CHKERR(VecNorm(X, PETSC_NORM_2, &snes.xnorm))
*/
  __pyx_v_snes->ynorm = 0.0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2259
 *     CHKERR(VecSet(Y, 0.0))
 *     snes.ynorm = 0.0
 *     CHKERR(SNESComputeFunction(snes, X, F))             # <<<<<<<<<<<<<<
 *     CHKERR(VecNorm(X, PETSC_NORM_2, &snes.xnorm))
 *     CHKERR(VecNorm(F, PETSC_NORM_2, &snes.norm))
*/
  __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(5, 2259, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2260
 *     snes.ynorm = 0.0
 *     CHKERR(SNESComputeFunction(snes, X, F))
 *     CHKERR(VecNorm(X, PETSC_NORM_2, &snes.xnorm))             # <<<<<<<<<<<<<<
 *     CHKERR(VecNorm(F, PETSC_NORM_2, &snes.norm))
 *     #
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNorm(__pyx_v_X, NORM_2, (&__pyx_v_snes->xnorm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 2260, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2261
 *     CHKERR(SNESComputeFunction(snes, X, F))
 *     CHKERR(VecNorm(X, PETSC_NORM_2, &snes.xnorm))
 *     CHKERR(VecNorm(F, PETSC_NORM_2, &snes.norm))             # <<<<<<<<<<<<<<
 *     #
 *     cdef PetscInt lits=0
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecNorm(__pyx_v_F, NORM_2, (&__pyx_v_snes->norm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 2261, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2263
 *     CHKERR(VecNorm(F, PETSC_NORM_2, &snes.norm))
 *     #
 *     cdef PetscInt lits=0             # <<<<<<<<<<<<<<
 *     CHKERR(SNESLogHistory(snes, snes.norm, lits))
 *     CHKERR(SNESConverged(snes, snes.iter, snes.xnorm, snes.ynorm, snes.norm))
*/
  __pyx_v_lits = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2264
 *     #
 *     cdef PetscInt lits=0
 *     CHKERR(SNESLogHistory(snes, snes.norm, lits))             # <<<<<<<<<<<<<<
 *     CHKERR(SNESConverged(snes, snes.iter, snes.xnorm, snes.ynorm, snes.norm))
 *     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(5, 2264, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2265
 *     cdef PetscInt lits=0
 *     CHKERR(SNESLogHistory(snes, snes.norm, lits))
 *     CHKERR(SNESConverged(snes, snes.iter, snes.xnorm, snes.ynorm, snes.norm))             # <<<<<<<<<<<<<<
 *     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_snes->xnorm, __pyx_v_snes->ynorm, __pyx_v_snes->norm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 2265, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2266
 *     CHKERR(SNESLogHistory(snes, snes.norm, lits))
 *     CHKERR(SNESConverged(snes, snes.iter, snes.xnorm, snes.ynorm, snes.norm))
 *     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(5, 2266, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2267
 *     CHKERR(SNESConverged(snes, snes.iter, snes.xnorm, snes.ynorm, snes.norm))
 *     CHKERR(SNESMonitor(snes, snes.iter, snes.norm))
 *     if snes.reason:             # <<<<<<<<<<<<<<
 *         return FunctionEnd()
 * 
*/
  if (__pyx_v_snes->reason) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":2268
 *     CHKERR(SNESMonitor(snes, snes.iter, snes.norm))
 *     if snes.reason:
 *         return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 *     for its from 0 <= its < snes.max_its:
*/
    __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2267
 *     CHKERR(SNESConverged(snes, snes.iter, snes.xnorm, snes.ynorm, snes.norm))
 *     CHKERR(SNESMonitor(snes, snes.iter, snes.norm))
 *     if snes.reason:             # <<<<<<<<<<<<<<
 *         return FunctionEnd()
 * 
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2270
 *         return FunctionEnd()
 * 
 *     for its from 0 <= its < snes.max_its:             # <<<<<<<<<<<<<<
 *         <void> its # unused
 *         SNESComputeUpdate(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":2271
 * 
 *     for its from 0 <= its < snes.max_its:
 *         <void> its # unused             # <<<<<<<<<<<<<<
 *         SNESComputeUpdate(snes)
 *         SNESPreStep_Python(snes)
*/
    ((void)__pyx_v_its);

    /* "petsc4py/PETSc/libpetsc4py.pyx":2272
 *     for its from 0 <= its < snes.max_its:
 *         <void> its # unused
 *         SNESComputeUpdate(snes)             # <<<<<<<<<<<<<<
 *         SNESPreStep_Python(snes)
 *         #
*/
    (void)(SNESComputeUpdate(__pyx_v_snes));

    /* "petsc4py/PETSc/libpetsc4py.pyx":2273
 *         <void> its # unused
 *         SNESComputeUpdate(snes)
 *         SNESPreStep_Python(snes)             # <<<<<<<<<<<<<<
 *         #
 *         lits = -snes.linear_its
*/
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_SNESPreStep_Python(__pyx_v_snes); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 2273, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2275
 *         SNESPreStep_Python(snes)
 *         #
 *         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":2276
 *         #
 *         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(5, 2276, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2277
 *         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":2279
 *         lits += snes.linear_its
 *         #
 *         CHKERR(SNESLineSearchApply(ls, X, F, NULL, Y))             # <<<<<<<<<<<<<<
 *         CHKERR(SNESLineSearchGetNorms(ls, &snes.xnorm, &snes.norm, &snes.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(5, 2279, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2280
 *         #
 *         CHKERR(SNESLineSearchApply(ls, X, F, NULL, Y))
 *         CHKERR(SNESLineSearchGetNorms(ls, &snes.xnorm, &snes.norm, &snes.ynorm))             # <<<<<<<<<<<<<<
 *         snes.iter += 1
 *         #
*/
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(SNESLineSearchGetNorms(__pyx_v_ls, (&__pyx_v_snes->xnorm), (&__pyx_v_snes->norm), (&__pyx_v_snes->ynorm))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 2280, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2281
 *         CHKERR(SNESLineSearchApply(ls, X, F, NULL, Y))
 *         CHKERR(SNESLineSearchGetNorms(ls, &snes.xnorm, &snes.norm, &snes.ynorm))
 *         snes.iter += 1             # <<<<<<<<<<<<<<
 *         #
 *         SNESPostStep_Python(snes)
*/
    __pyx_v_snes->iter = (__pyx_v_snes->iter + 1);

    /* "petsc4py/PETSc/libpetsc4py.pyx":2283
 *         snes.iter += 1
 *         #
 *         SNESPostStep_Python(snes)             # <<<<<<<<<<<<<<
 *         CHKERR(SNESLogHistory(snes, snes.norm, lits))
 *         CHKERR(SNESConverged(snes, snes.iter, snes.xnorm, snes.ynorm, snes.norm))
*/
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_SNESPostStep_Python(__pyx_v_snes); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 2283, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2284
 *         #
 *         SNESPostStep_Python(snes)
 *         CHKERR(SNESLogHistory(snes, snes.norm, lits))             # <<<<<<<<<<<<<<
 *         CHKERR(SNESConverged(snes, snes.iter, snes.xnorm, snes.ynorm, snes.norm))
 *         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(5, 2284, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2285
 *         SNESPostStep_Python(snes)
 *         CHKERR(SNESLogHistory(snes, snes.norm, lits))
 *         CHKERR(SNESConverged(snes, snes.iter, snes.xnorm, snes.ynorm, snes.norm))             # <<<<<<<<<<<<<<
 *         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_snes->xnorm, __pyx_v_snes->ynorm, __pyx_v_snes->norm)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 2285, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2286
 *         CHKERR(SNESLogHistory(snes, snes.norm, lits))
 *         CHKERR(SNESConverged(snes, snes.iter, snes.xnorm, snes.ynorm, snes.norm))
 *         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(5, 2286, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2287
 *         CHKERR(SNESConverged(snes, snes.iter, snes.xnorm, snes.ynorm, snes.norm))
 *         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":2289
 *         if snes.reason: break
 *     #
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode SNESPreStep_Python(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2246
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode SNESSolve_Python_default(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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:;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2291
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode SNESPreStep_Python(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNESPreStep_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2294
 *     PetscSNES snes,
 *     ) 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":2295
 *     ) 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(5, 2295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_preStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2295, __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":2296
 *     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":2297
 *     cdef preStep = PySNES(snes).preStep
 *     if preStep is not None:
 *         preStep(SNES_(snes))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_preStep);
    __pyx_t_4 = __pyx_v_preStep; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2296
 *     FunctionBegin(b"SNESPreStep_Python")
 *     cdef preStep = PySNES(snes).preStep
 *     if preStep is not None:             # <<<<<<<<<<<<<<
 *         preStep(SNES_(snes))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2298
 *     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":2291
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode SNESPreStep_Python(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) 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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2300
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode SNESPostStep_Python(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNESPostStep_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2303
 *     PetscSNES snes,
 *     ) 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":2304
 *     ) 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(5, 2304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_postStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2304, __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":2305
 *     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":2306
 *     cdef postStep = PySNES(snes).postStep
 *     if postStep is not None:
 *         postStep(SNES_(snes))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_postStep);
    __pyx_t_4 = __pyx_v_postStep; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2305
 *     FunctionBegin(b"SNESPostStep_Python")
 *     cdef postStep = PySNES(snes).postStep
 *     if postStep is not None:             # <<<<<<<<<<<<<<
 *         postStep(SNES_(snes))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2307
 *     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":2300
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode SNESPostStep_Python(             # <<<<<<<<<<<<<<
 *     PetscSNES snes,
 *     ) 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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2309
 *     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;
  size_t __pyx_t_9;
  PetscErrorCode __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNESStep_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2315
 *     PetscVec  Y,
 *     ) 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":2316
 *     ) 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(5, 2316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2316, __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":2317
 *     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":2318
 *     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 = NULL;
    __Pyx_INCREF(__pyx_v_step);
    __pyx_t_4 = __pyx_v_step; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_SNES_(__pyx_v_snes)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2318, __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(5, 2318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_F)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_Y)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 2318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_9, (5-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2317
 *     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":2320
 *         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(5, 2320, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2321
 *     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":2309
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2323
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();

  /* "petsc4py/PETSc/libpetsc4py.pyx":2329
 *     PetscVec  Y,
 *     ) 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":2330
 *     ) 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":2331
 *     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":2332
 *     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(5, 2332, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2333
 *     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(5, 2333, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2334
 *     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(5, 2334, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2335
 *     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(5, 2335, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2336
 *     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(5, 2336, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2337
 *     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":2338
 *     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":2323
 *     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:;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2392
 * @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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2393
 * 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":2394
 * 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":2393
 * 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":2396
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyTS), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2396, __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":2392
 * @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":2398
 *         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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2400
 * 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":2401
 *     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(5, 2401, __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(5, 2401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2402
 *     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":2398
 *         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":2404
 *     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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2406
 * 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":2407
 *     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(5, 2407, __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(5, 2407, __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(5, 2407, __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":2408
 *     FunctionBegin(b"TSPythonSetContext")
 *     PyTS(ts).setcontext(ctx, TS_(ts))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode TSPythonSetType_PYTHON(PetscTS ts, const char *name) \
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2404
 *     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":2410
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TSPythonSetType_PYTHON(PetscTS ts, const 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 const *__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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TSPythonSetType_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2412
 * cdef PetscErrorCode TSPythonSetType_PYTHON(PetscTS ts, const 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":2413
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"TSPythonSetType_PYTHON")
 *     if name == NULL: return FunctionEnd() # XXX             # <<<<<<<<<<<<<<
 *     cdef object ctx = createcontext(name)
 *     TSPythonSetContext(ts, <void*>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":2414
 *     FunctionBegin(b"TSPythonSetType_PYTHON")
 *     if name == NULL: return FunctionEnd() # XXX
 *     cdef object ctx = createcontext(name)             # <<<<<<<<<<<<<<
 *     TSPythonSetContext(ts, <void*>ctx)
 *     PyTS(ts).setname(name)
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ctx = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2415
 *     if name == NULL: return FunctionEnd() # XXX
 *     cdef object ctx = createcontext(name)
 *     TSPythonSetContext(ts, <void*>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(5, 2415, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2416
 *     cdef object ctx = createcontext(name)
 *     TSPythonSetContext(ts, <void*>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(5, 2416, __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(5, 2416, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2417
 *     TSPythonSetContext(ts, <void*>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":2410
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TSPythonSetType_PYTHON(PetscTS ts, const 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2419
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TSPythonGetType_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2421
 * 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":2422
 *     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(5, 2422, __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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 2422, __pyx_L1_error)
  (__pyx_v_name[0]) = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2423
 *     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":2419
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2425
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TSCreate_Python(             # <<<<<<<<<<<<<<
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TSCreate_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2428
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"TSCreate_Python")             # <<<<<<<<<<<<<<
 *     cdef TSOps ops     = ts.ops
 *     ops.reset          = TSReset_Python
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSCreate_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2429
 *     ) except PETSC_ERR_PYTHON with gil:
 *     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":2430
 *     FunctionBegin(b"TSCreate_Python")
 *     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":2431
 *     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":2432
 *     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":2433
 *     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":2434
 *     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":2435
 *     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":2436
 *     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":2437
 *     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":2438
 *     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":2439
 *     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":2440
 *     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":2442
 *     ops.snesjacobian   = SNESTSFormJacobian_Python
 *     #
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>ts, b"TSPythonSetType_C",
 *             <PetscVoidFunction>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(5, 2442, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2445
 *             <PetscObject>ts, b"TSPythonSetType_C",
 *             <PetscVoidFunction>TSPythonSetType_PYTHON))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>ts, b"TSPythonGetType_C",
 *             <PetscVoidFunction>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(5, 2445, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2449
 *             <PetscVoidFunction>TSPythonGetType_PYTHON))
 *     #
 *     ts.usessnes = PETSC_TRUE             # <<<<<<<<<<<<<<
 *     #
 *     cdef ctx = PyTS(NULL)
*/
  __pyx_v_ts->usessnes = PETSC_TRUE;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2451
 *     ts.usessnes = PETSC_TRUE
 *     #
 *     cdef ctx = PyTS(NULL)             # <<<<<<<<<<<<<<
 *     ts.data = <void*> ctx
 *     Py_INCREF(<PyObject*>ts.data)
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_ctx = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2452
 *     #
 *     cdef ctx = PyTS(NULL)
 *     ts.data = <void*> ctx             # <<<<<<<<<<<<<<
 *     Py_INCREF(<PyObject*>ts.data)
 *     return FunctionEnd()
*/
  __pyx_v_ts->data = ((void *)__pyx_v_ctx);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2453
 *     cdef ctx = PyTS(NULL)
 *     ts.data = <void*> ctx
 *     Py_INCREF(<PyObject*>ts.data)             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  Py_INCREF(((PyObject *)__pyx_v_ts->data));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2454
 *     ts.data = <void*> ctx
 *     Py_INCREF(<PyObject*>ts.data)
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscErrorCode TSDestroy_Python_inner(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2425
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TSCreate_Python(             # <<<<<<<<<<<<<<
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2456
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode TSDestroy_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TSDestroy_Python_inner", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2459
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     try:             # <<<<<<<<<<<<<<
 *         addRef(ts)
 *         TSPythonSetContext(ts, NULL)
*/
  /*try:*/ {

    /* "petsc4py/PETSc/libpetsc4py.pyx":2460
 *     ) 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":2461
 *     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(5, 2461, __pyx_L4_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2463
 *         TSPythonSetContext(ts, NULL)
 *     finally:
 *         delRef(ts)             # <<<<<<<<<<<<<<
 *         Py_DECREF(<PyObject*>ts.data)
 *         ts.data = NULL
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_ts);

      /* "petsc4py/PETSc/libpetsc4py.pyx":2464
 *     finally:
 *         delRef(ts)
 *         Py_DECREF(<PyObject*>ts.data)             # <<<<<<<<<<<<<<
 *         ts.data = NULL
 *     return PETSC_SUCCESS
*/
      Py_DECREF(((PyObject *)__pyx_v_ts->data));

      /* "petsc4py/PETSc/libpetsc4py.pyx":2465
 *         delRef(ts)
 *         Py_DECREF(<PyObject*>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;
       __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if ( 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":2463
 *         TSPythonSetContext(ts, NULL)
 *     finally:
 *         delRef(ts)             # <<<<<<<<<<<<<<
 *         Py_DECREF(<PyObject*>ts.data)
 *         ts.data = NULL
*/
        __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_ts);

        /* "petsc4py/PETSc/libpetsc4py.pyx":2464
 *     finally:
 *         delRef(ts)
 *         Py_DECREF(<PyObject*>ts.data)             # <<<<<<<<<<<<<<
 *         ts.data = NULL
 *     return PETSC_SUCCESS
*/
        Py_DECREF(((PyObject *)__pyx_v_ts->data));

        /* "petsc4py/PETSc/libpetsc4py.pyx":2465
 *         delRef(ts)
 *         Py_DECREF(<PyObject*>ts.data)
 *         ts.data = NULL             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
        __pyx_v_ts->data = NULL;
      }
      __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":2466
 *         Py_DECREF(<PyObject*>ts.data)
 *         ts.data = NULL
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode TSDestroy_Python(
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2456
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode TSDestroy_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2468
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode TSDestroy_Python(             # <<<<<<<<<<<<<<
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2471
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON nogil:
 *     FunctionBegin(b"TSDestroy_Python")             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectComposeFunction(
 *             <PetscObject>ts, b"TSPythonSetType_C",
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSDestroy_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2472
 *     ) except PETSC_ERR_PYTHON nogil:
 *     FunctionBegin(b"TSDestroy_Python")
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>ts, b"TSPythonSetType_C",
 *             <PetscVoidFunction>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(5, 2472, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2475
 *             <PetscObject>ts, b"TSPythonSetType_C",
 *             <PetscVoidFunction>NULL))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>ts, b"TSPythonGetType_C",
 *             <PetscVoidFunction>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(5, 2475, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2479
 *             <PetscVoidFunction>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(5, 2479, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2480
 *     #
 *     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":2468
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode TSDestroy_Python(             # <<<<<<<<<<<<<<
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("petsc4py.PETSc.TSDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2482
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TSSetUp_Python(             # <<<<<<<<<<<<<<
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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[2048];
  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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TSSetUp_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2485
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"TSSetUp_Python")             # <<<<<<<<<<<<<<
 *     cdef PetscVec vec_update = NULL
 *     CHKERR(VecDuplicate(ts.vec_sol, &vec_update))
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSSetUp_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2486
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"TSSetUp_Python")
 *     cdef PetscVec vec_update = NULL             # <<<<<<<<<<<<<<
 *     CHKERR(VecDuplicate(ts.vec_sol, &vec_update))
 *     CHKERR(PetscObjectCompose(<PetscObject>ts,
*/
  __pyx_v_vec_update = NULL;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2487
 *     FunctionBegin(b"TSSetUp_Python")
 *     cdef PetscVec vec_update = NULL
 *     CHKERR(VecDuplicate(ts.vec_sol, &vec_update))             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectCompose(<PetscObject>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(5, 2487, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2488
 *     cdef PetscVec vec_update = NULL
 *     CHKERR(VecDuplicate(ts.vec_sol, &vec_update))
 *     CHKERR(PetscObjectCompose(<PetscObject>ts,             # <<<<<<<<<<<<<<
 *                               b"@ts.vec_update",
 *                               <PetscObject>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(5, 2488, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2491
 *                               b"@ts.vec_update",
 *                               <PetscObject>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(5, 2491, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2492
 *                               <PetscObject>vec_update))
 *     CHKERR(VecDestroy(&vec_update))
 *     cdef PetscVec vec_dot = NULL             # <<<<<<<<<<<<<<
 *     CHKERR(VecDuplicate(ts.vec_sol, &vec_dot))
 *     CHKERR(PetscObjectCompose(<PetscObject>ts,
*/
  __pyx_v_vec_dot = NULL;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2493
 *     CHKERR(VecDestroy(&vec_update))
 *     cdef PetscVec vec_dot = NULL
 *     CHKERR(VecDuplicate(ts.vec_sol, &vec_dot))             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectCompose(<PetscObject>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(5, 2493, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2494
 *     cdef PetscVec vec_dot = NULL
 *     CHKERR(VecDuplicate(ts.vec_sol, &vec_dot))
 *     CHKERR(PetscObjectCompose(<PetscObject>ts,             # <<<<<<<<<<<<<<
 *                               b"@ts.vec_dot",
 *                               <PetscObject>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(5, 2494, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2497
 *                               b"@ts.vec_dot",
 *                               <PetscObject>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(5, 2497, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2500
 *     #
 *     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":2501
 *     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(5, 2501, __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":2502
 *     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(5, 2502, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2505
 *                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:
*/
    __pyx_t_4 = (__pyx_v_found != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      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":2506
 *                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(5, 2506, __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(5, 2506, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":2505
 *                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":2501
 *     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":2507
 *         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(5, 2507, __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":2508
 *             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, __pyx_k_Python_context_not_set_call_one_6);
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2507
 *         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":2514
 *                            "-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(5, 2514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2514, __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":2515
 *     #
 *     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":2516
 *     cdef setUp = PyTS(ts).setUp
 *     if setUp is not None:
 *         setUp(TS_(ts))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_setUp);
    __pyx_t_7 = __pyx_v_setUp; 
    __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 2516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_8};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2515
 *     #
 *     cdef setUp = PyTS(ts).setUp
 *     if setUp is not None:             # <<<<<<<<<<<<<<
 *         setUp(TS_(ts))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2517
 *     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":2482
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TSSetUp_Python(             # <<<<<<<<<<<<<<
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2519
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode TSReset_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TSReset_Python_inner", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2522
 *     PetscTS ts,
 *     ) 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(5, 2522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_reset); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2522, __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":2523
 *     ) 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":2524
 *     cdef reset = PyTS(ts).reset
 *     if reset is not None:
 *         reset(TS_(ts))             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_reset);
    __pyx_t_4 = __pyx_v_reset; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2524, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2523
 *     ) 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":2525
 *     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":2519
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode TSReset_Python_inner(             # <<<<<<<<<<<<<<
 *     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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2527
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode TSReset_Python(             # <<<<<<<<<<<<<<
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2530
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON nogil:
 *     if getRef(ts) == 0: return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 *     FunctionBegin(b"TSReset_Python")
 *     CHKERR(PetscObjectCompose(<PetscObject>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":2531
 *     ) except PETSC_ERR_PYTHON nogil:
 *     if getRef(ts) == 0: return PETSC_SUCCESS
 *     FunctionBegin(b"TSReset_Python")             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectCompose(<PetscObject>ts, b"@ts.vec_update", NULL))
 *     CHKERR(PetscObjectCompose(<PetscObject>ts, b"@ts.vec_dot",    NULL))
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSReset_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2532
 *     if getRef(ts) == 0: return PETSC_SUCCESS
 *     FunctionBegin(b"TSReset_Python")
 *     CHKERR(PetscObjectCompose(<PetscObject>ts, b"@ts.vec_update", NULL))             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectCompose(<PetscObject>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(5, 2532, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2533
 *     FunctionBegin(b"TSReset_Python")
 *     CHKERR(PetscObjectCompose(<PetscObject>ts, b"@ts.vec_update", NULL))
 *     CHKERR(PetscObjectCompose(<PetscObject>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(5, 2533, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2534
 *     CHKERR(PetscObjectCompose(<PetscObject>ts, b"@ts.vec_update", NULL))
 *     CHKERR(PetscObjectCompose(<PetscObject>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(5, 2534, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2535
 *     CHKERR(PetscObjectCompose(<PetscObject>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":2527
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode TSReset_Python(             # <<<<<<<<<<<<<<
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("petsc4py.PETSc.TSReset_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2537
 *     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[2048];
  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;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TSSetFromOptions_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2541
 *     PetscOptionItems PetscOptionsObject,
 *     ) 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":2542
 *     ) 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(5, 2542, __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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 2542, __pyx_L1_error)
  __pyx_v_defval = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2543
 *     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":2544
 *     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":2545
 *     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)); <void>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(5, 2545, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2547
 *     CHKERR(PetscOptionsString(
 *             b"-ts_python_type", b"Python [package.]module[.{class|function}]",
 *             b"TSPythonSetType", defval, name, sizeof(name), &found)); <void>opts             # <<<<<<<<<<<<<<
 *     if found and name[0]:
 *         CHKERR(TSPythonSetType_PYTHON(ts, name))
*/
  ((void)PetscOptionsObject);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2548
 *             b"-ts_python_type", b"Python [package.]module[.{class|function}]",
 *             b"TSPythonSetType", defval, name, sizeof(name), &found)); <void>opts
 *     if found and name[0]:             # <<<<<<<<<<<<<<
 *         CHKERR(TSPythonSetType_PYTHON(ts, name))
 *     #
*/
  __pyx_t_5 = (__pyx_v_found != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    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":2549
 *             b"TSPythonSetType", defval, name, sizeof(name), &found)); <void>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(5, 2549, __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(5, 2549, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2548
 *             b"-ts_python_type", b"Python [package.]module[.{class|function}]",
 *             b"TSPythonSetType", defval, name, sizeof(name), &found)); <void>opts
 *     if found and name[0]:             # <<<<<<<<<<<<<<
 *         CHKERR(TSPythonSetType_PYTHON(ts, name))
 *     #
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2551
 *         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(5, 2551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2551, __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":2552
 *     #
 *     cdef setFromOptions = PyTS(ts).setFromOptions
 *     if setFromOptions is not None:             # <<<<<<<<<<<<<<
 *         setFromOptions(TS_(ts))
 *     return FunctionEnd()
*/
  __pyx_t_4 = (__pyx_v_setFromOptions != Py_None);
  if (__pyx_t_4) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":2553
 *     cdef setFromOptions = PyTS(ts).setFromOptions
 *     if setFromOptions is not None:
 *         setFromOptions(TS_(ts))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_setFromOptions);
    __pyx_t_8 = __pyx_v_setFromOptions; 
    __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 2553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_9};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2553, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2552
 *     #
 *     cdef setFromOptions = PyTS(ts).setFromOptions
 *     if setFromOptions is not None:             # <<<<<<<<<<<<<<
 *         setFromOptions(TS_(ts))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2554
 *     if setFromOptions is not None:
 *         setFromOptions(TS_(ts))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode TSView_Python(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2537
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2556
 *     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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TSView_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2560
 *     PetscViewer vwr,
 *     ) 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":2561
 *     ) 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(5, 2561, __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(5, 2561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2562
 *     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(5, 2562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2562, __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":2563
 *     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":2564
 *     cdef view = PyTS(ts).view
 *     if view is not None:
 *         view(TS_(ts), Viewer_(vwr))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_view);
    __pyx_t_5 = __pyx_v_view; 
    __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_6, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2563
 *     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":2565
 *     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":2556
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2567
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TSStep_Python(             # <<<<<<<<<<<<<<
 *     PetscTS   ts,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  PetscErrorCode __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TSStep_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2570
 *     PetscTS   ts,
 *     ) 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":2571
 *     ) 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(5, 2571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2571, __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":2572
 *     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":2573
 *     cdef step = PyTS(ts).step
 *     if step is not None:
 *         step(TS_(ts))             # <<<<<<<<<<<<<<
 *     else:
 *         TSStep_Python_default(ts)
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_step);
    __pyx_t_4 = __pyx_v_step; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2573, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2572
 *     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":2575
 *         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(5, 2575, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2576
 *     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":2567
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TSStep_Python(             # <<<<<<<<<<<<<<
 *     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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2578
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TSRollBack_Python(             # <<<<<<<<<<<<<<
 *     PetscTS   ts,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TSRollBack_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2581
 *     PetscTS   ts,
 *     ) 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":2582
 *     ) 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(5, 2582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_rollback); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2582, __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":2583
 *     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(__pyx_k_rollback);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2584
 *     cdef rollback = PyTS(ts).rollback
 *     if rollback is None: return UNSUPPORTED(b"rollback")
 *     rollback(TS_(ts))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  __pyx_t_1 = NULL;
  __Pyx_INCREF(__pyx_v_rollback);
  __pyx_t_4 = __pyx_v_rollback; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2585
 *     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":2578
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TSRollBack_Python(             # <<<<<<<<<<<<<<
 *     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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2587
 *     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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TSInterpolate_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2592
 *     PetscVec  x,
 *     ) 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":2593
 *     ) 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(5, 2593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2593, __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":2594
 *     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(__pyx_k_interpolate);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2595
 *     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 = NULL;
  __Pyx_INCREF(__pyx_v_interpolate);
  __pyx_t_4 = __pyx_v_interpolate; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toReal(__pyx_v_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2596
 *     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":2587
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2598
 *     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;
  size_t __pyx_t_8;
  PetscBool __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TSEvaluateStep_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2604
 *     PetscBool *flag,
 *     ) 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":2605
 *     ) 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(5, 2605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_evaluatestep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2605, __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":2606
 *     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(__pyx_k_evaluatestep);
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2607
 *     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 = NULL;
  __Pyx_INCREF(__pyx_v_evaluatestep);
  __pyx_t_4 = __pyx_v_evaluatestep; 
  __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_toInt(__pyx_v_o); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__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;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2607, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  }
  __pyx_v_done = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2608
 *     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":2609
 *     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(5, 2609, __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":2608
 *     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":2610
 *     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(5, 2610, __pyx_L1_error)
  __pyx_t_10 = (!__pyx_t_3);
  if (__pyx_t_10) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":2611
 *         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, __pyx_k_Cannot_evaluate_step);
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2610
 *     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":2612
 *     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":2598
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2614
 *     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;
  size_t __pyx_t_7;
  PetscErrorCode __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNESTSFormFunction_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2620
 *     PetscTS   ts,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"SNESTSFormFunction _Python")             # <<<<<<<<<<<<<<
 *     cdef formSNESFunction = PyTS(ts).formSNESFunction
 *     if formSNESFunction is not None:
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESTSFormFunction _Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2621
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"SNESTSFormFunction _Python")
 *     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(5, 2621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_formSNESFunction); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2621, __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":2622
 *     FunctionBegin(b"SNESTSFormFunction _Python")
 *     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":2623
 *     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(5, 2623, __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(5, 2623, __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(5, 2623, __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(5, 2623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2623, __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) != (0)) __PYX_ERR(5, 2623, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1) != (0)) __PYX_ERR(5, 2623, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4) != (0)) __PYX_ERR(5, 2623, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5) != (0)) __PYX_ERR(5, 2623, __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":2624
 *     if formSNESFunction is not None:
 *         args = (SNES_(snes), Vec_(x), Vec_(f), TS_(ts))
 *         formSNESFunction(args)             # <<<<<<<<<<<<<<
 *         return FunctionEnd()
 *     #
*/
    __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_formSNESFunction);
    __pyx_t_4 = __pyx_v_formSNESFunction; 
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_args};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2624, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2625
 *         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":2622
 *     FunctionBegin(b"SNESTSFormFunction _Python")
 *     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":2627
 *         return FunctionEnd()
 *     #
 *     cdef PetscVec dx = NULL             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectQuery(
 *             <PetscObject>ts,
*/
  __pyx_v_dx = NULL;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2628
 *     #
 *     cdef PetscVec dx = NULL
 *     CHKERR(PetscObjectQuery(             # <<<<<<<<<<<<<<
 *             <PetscObject>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(5, 2628, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2633
 *             <PetscObject*>&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":2634
 *     #
 *     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":2635
 *     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(5, 2635, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2636
 *     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(5, 2636, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2637
 *     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(5, 2637, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2638
 *     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":2614
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2640
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("SNESTSFormJacobian_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2647
 *     PetscTS   ts,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"SNESTSFormJacobian _Python")             # <<<<<<<<<<<<<<
 *     cdef formSNESJacobian = PyTS(ts).formSNESJacobian
 *     if formSNESJacobian is not None:
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"SNESTSFormJacobian _Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2648
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"SNESTSFormJacobian _Python")
 *     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(5, 2648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_formSNESJacobian); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2648, __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":2649
 *     FunctionBegin(b"SNESTSFormJacobian _Python")
 *     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":2650
 *     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(5, 2650, __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(5, 2650, __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(5, 2650, __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(5, 2650, __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(5, 2650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2650, __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) != (0)) __PYX_ERR(5, 2650, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1) != (0)) __PYX_ERR(5, 2650, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4) != (0)) __PYX_ERR(5, 2650, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_5) != (0)) __PYX_ERR(5, 2650, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_6) != (0)) __PYX_ERR(5, 2650, __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":2651
 *     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(5, 2651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2652
 *         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":2649
 *     FunctionBegin(b"SNESTSFormJacobian _Python")
 *     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":2654
 *         return FunctionEnd()
 *     #
 *     cdef PetscVec dx = NULL             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectQuery(
 *             <PetscObject>ts,
*/
  __pyx_v_dx = NULL;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2655
 *     #
 *     cdef PetscVec dx = NULL
 *     CHKERR(PetscObjectQuery(             # <<<<<<<<<<<<<<
 *             <PetscObject>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(5, 2655, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2660
 *             <PetscObject*>&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":2661
 *     #
 *     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":2662
 *     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(5, 2662, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2663
 *     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(5, 2663, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2664
 *     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(5, 2664, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2665
 *     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":2640
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2667
 *     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;
  size_t __pyx_t_8;
  PetscErrorCode __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TSSolveStep_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2672
 *     PetscVec  x,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"TSSolveStep_Python")             # <<<<<<<<<<<<<<
 *     cdef solveStep = PyTS(ts).solveStep
 *     if solveStep is not None:
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TSSolveStep_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2673
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"TSSolveStep_Python")
 *     cdef solveStep = PyTS(ts).solveStep             # <<<<<<<<<<<<<<
 *     if solveStep is not None:
 *         solveStep(TS_(ts), <double>t, Vec_(x))
*/
  __pyx_t_1 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTS(__pyx_v_ts)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 2673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_solveStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2673, __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":2674
 *     FunctionBegin(b"TSSolveStep_Python")
 *     cdef solveStep = PyTS(ts).solveStep
 *     if solveStep is not None:             # <<<<<<<<<<<<<<
 *         solveStep(TS_(ts), <double>t, Vec_(x))
 *         return FunctionEnd()
*/
  __pyx_t_3 = (__pyx_v_solveStep != Py_None);
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":2675
 *     cdef solveStep = PyTS(ts).solveStep
 *     if solveStep is not None:
 *         solveStep(TS_(ts), <double>t, Vec_(x))             # <<<<<<<<<<<<<<
 *         return FunctionEnd()
 *     #
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_solveStep);
    __pyx_t_4 = __pyx_v_solveStep; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyFloat_FromDouble(((double)__pyx_v_t)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_8, (4-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2675, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2676
 *     if solveStep is not None:
 *         solveStep(TS_(ts), <double>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":2674
 *     FunctionBegin(b"TSSolveStep_Python")
 *     cdef solveStep = PyTS(ts).solveStep
 *     if solveStep is not None:             # <<<<<<<<<<<<<<
 *         solveStep(TS_(ts), <double>t, Vec_(x))
 *         return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2678
 *         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":2679
 *     #
 *     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(5, 2679, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2680
 *     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(5, 2680, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2681
 *     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(5, 2681, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2682
 *     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":2683
 *     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":2684
 *     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":2667
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2686
 *     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;
  size_t __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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TSAdaptStep_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2693
 *     PetscBool *stepok,
 *     ) 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":2694
 *     ) 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":2695
 *     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":2697
 *     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(5, 2697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_adaptStep); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2697, __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":2698
 *     #
 *     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":2702
 *     cdef double dt
 *     cdef bint   ok
 *     retval = adaptStep(TS_(ts), <double>t, Vec_(x))             # <<<<<<<<<<<<<<
 *     if retval is None: pass
 *     elif isinstance(retval, float):
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_v_adaptStep);
  __pyx_t_5 = __pyx_v_adaptStep; 
  __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TS_(__pyx_v_ts)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyFloat_FromDouble(((double)__pyx_v_t)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_x)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = 1;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
    __pyx_t_9 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_t_6, __pyx_t_7, __pyx_t_8};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_9, (4-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __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;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __pyx_v_retval = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2703
 *     cdef bint   ok
 *     retval = adaptStep(TS_(ts), <double>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":2704
 *     retval = adaptStep(TS_(ts), <double>t, Vec_(x))
 *     if retval is None: pass
 *     elif isinstance(retval, float):             # <<<<<<<<<<<<<<
 *         dt = retval
 *         nextdt[0] = <PetscReal>dt
*/
  __pyx_t_4 = PyFloat_Check(__pyx_v_retval); 
  if (__pyx_t_4) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":2705
 *     if retval is None: pass
 *     elif isinstance(retval, float):
 *         dt = retval             # <<<<<<<<<<<<<<
 *         nextdt[0] = <PetscReal>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(5, 2705, __pyx_L1_error)
    __pyx_v_dt = __pyx_t_10;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2706
 *     elif isinstance(retval, float):
 *         dt = retval
 *         nextdt[0] = <PetscReal>dt             # <<<<<<<<<<<<<<
 *         stepok[0] = PETSC_TRUE
 *     elif isinstance(retval, bool):
*/
    (__pyx_v_nextdt[0]) = ((PetscReal)__pyx_v_dt);

    /* "petsc4py/PETSc/libpetsc4py.pyx":2707
 *         dt = retval
 *         nextdt[0] = <PetscReal>dt
 *         stepok[0] = PETSC_TRUE             # <<<<<<<<<<<<<<
 *     elif isinstance(retval, bool):
 *         ok = retval
*/
    (__pyx_v_stepok[0]) = PETSC_TRUE;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2704
 *     retval = adaptStep(TS_(ts), <double>t, Vec_(x))
 *     if retval is None: pass
 *     elif isinstance(retval, float):             # <<<<<<<<<<<<<<
 *         dt = retval
 *         nextdt[0] = <PetscReal>dt
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2708
 *         nextdt[0] = <PetscReal>dt
 *         stepok[0] = PETSC_TRUE
 *     elif isinstance(retval, bool):             # <<<<<<<<<<<<<<
 *         ok = retval
 *         nextdt[0] = ts.time_step
*/
  __pyx_t_4 = PyBool_Check(__pyx_v_retval); 
  if (__pyx_t_4) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":2709
 *         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(5, 2709, __pyx_L1_error)
    __pyx_v_ok = __pyx_t_4;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2710
 *     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":2711
 *         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":2708
 *         nextdt[0] = <PetscReal>dt
 *         stepok[0] = PETSC_TRUE
 *     elif isinstance(retval, bool):             # <<<<<<<<<<<<<<
 *         ok = retval
 *         nextdt[0] = ts.time_step
*/
    goto __pyx_L4;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2713
 *         stepok[0] = PETSC_TRUE if ok else PETSC_FALSE
 *     else:
 *         dt, ok = retval             # <<<<<<<<<<<<<<
 *         nextdt[0] = <PetscReal>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(5, 2713, __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_INCREF(__pyx_t_3);
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_5);
      } else {
        __pyx_t_3 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2713, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2713, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
      }
      #else
      __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2713, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2713, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_v_retval); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 2713, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_12 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
      index = 0; __pyx_t_3 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_5 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < (0)) __PYX_ERR(5, 2713, __pyx_L1_error)
      __pyx_t_12 = 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_12 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(5, 2713, __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(5, 2713, __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 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 2713, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_dt = __pyx_t_10;
    __pyx_v_ok = __pyx_t_4;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2714
 *     else:
 *         dt, ok = retval
 *         nextdt[0] = <PetscReal>dt             # <<<<<<<<<<<<<<
 *         stepok[0] = PETSC_TRUE if ok else PETSC_FALSE
 *     return FunctionEnd()
*/
    (__pyx_v_nextdt[0]) = ((PetscReal)__pyx_v_dt);

    /* "petsc4py/PETSc/libpetsc4py.pyx":2715
 *         dt, ok = retval
 *         nextdt[0] = <PetscReal>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":2716
 *         nextdt[0] = <PetscReal>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":2686
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2718
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TSStep_Python_default(             # <<<<<<<<<<<<<<
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TSStep_Python_default(TS __pyx_v_ts) {
  Vec __pyx_v_vec_update;
  PetscReal __pyx_v_tt;
  PetscReal __pyx_v_dt;
  PetscBool __pyx_v_accept;
  PetscBool __pyx_v_stageok;
  long __pyx_v_r;
  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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();

  /* "petsc4py/PETSc/libpetsc4py.pyx":2721
 *     PetscTS ts,
 *     ) 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":2722
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"TSStep_Python_default")
 *     cdef PetscVec vec_update = NULL             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectQuery(
 *             <PetscObject>ts,
*/
  __pyx_v_vec_update = NULL;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2723
 *     FunctionBegin(b"TSStep_Python_default")
 *     cdef PetscVec vec_update = NULL
 *     CHKERR(PetscObjectQuery(             # <<<<<<<<<<<<<<
 *             <PetscObject>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(5, 2723, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2728
 *             <PetscObject*>&vec_update))
 *     #
 *     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":2729
 *     #
 *     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":2730
 *     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":2731
 *     cdef PetscReal dt = ts.time_step
 *     cdef PetscBool accept  = PETSC_TRUE
 *     cdef PetscBool stageok = PETSC_TRUE             # <<<<<<<<<<<<<<
 *     for r from 0 <= r < ts.max_reject:
 *         <void> r # unused
*/
  __pyx_v_stageok = PETSC_TRUE;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2732
 *     cdef PetscBool accept  = PETSC_TRUE
 *     cdef PetscBool stageok = PETSC_TRUE
 *     for r from 0 <= r < ts.max_reject:             # <<<<<<<<<<<<<<
 *         <void> r # unused
 *         tt = ts.ptime + ts.time_step
*/
  __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":2733
 *     cdef PetscBool stageok = PETSC_TRUE
 *     for r from 0 <= r < ts.max_reject:
 *         <void> r # unused             # <<<<<<<<<<<<<<
 *         tt = ts.ptime + ts.time_step
 *         CHKERR(VecCopy(ts.vec_sol, vec_update))
*/
    ((void)__pyx_v_r);

    /* "petsc4py/PETSc/libpetsc4py.pyx":2734
 *     for r from 0 <= r < ts.max_reject:
 *         <void> r # unused
 *         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":2735
 *         <void> r # unused
 *         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(5, 2735, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2736
 *         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(5, 2736, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2737
 *         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(5, 2737, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2738
 *         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(5, 2738, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2739
 *         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(5, 2739, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2740
 *         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 != 0));
    if (__pyx_t_4) {

      /* "petsc4py/PETSc/libpetsc4py.pyx":2741
 *         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":2742
 *         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":2740
 *         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":2743
 *             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(5, 2743, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2744
 *             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 != 0));
    if (__pyx_t_4) {

      /* "petsc4py/PETSc/libpetsc4py.pyx":2745
 *         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":2746
 *         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":2747
 *             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":2744
 *             continue
 *         TSAdaptStep_Python(ts, tt, vec_update, &dt, &accept)
 *         if not accept:             # <<<<<<<<<<<<<<
 *             ts.time_step = dt
 *             ts.reject += 1
*/
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":2748
 *             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(5, 2748, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2749
 *             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":2750
 *         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":2751
 *         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":2752
 *         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 != 0));
  if (!__pyx_t_5) {
  } else {
    goto __pyx_L9_next_and;
  }
  __pyx_t_5 = (!(__pyx_v_accept != 0));
  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":2753
 *         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":2752
 *         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":2754
 *     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":2718
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TSStep_Python_default(             # <<<<<<<<<<<<<<
 *     PetscTS ts,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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:;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2792
 * @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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2793
 * 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":2794
 * 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":2793
 * 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":2796
 *         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_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyTao), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2796, __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":2792
 * @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":2798
 *         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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2800
 * 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":2801
 *     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(5, 2801, __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(5, 2801, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2802
 *     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":2798
 *         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":2804
 *     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", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2806
 * 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":2807
 *     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(5, 2807, __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(5, 2807, __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(5, 2807, __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":2808
 *     FunctionBegin(b"TaoPythonSetContext")
 *     PyTao(tao).setcontext(ctx, TAO_(tao))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode TaoPythonSetType_PYTHON(PetscTAO tao, const char *name) \
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2804
 *     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":2810
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TaoPythonSetType_PYTHON(PetscTAO tao, const 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 const *__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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TaoPythonSetType_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2812
 * cdef PetscErrorCode TaoPythonSetType_PYTHON(PetscTAO tao, const 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":2813
 *     except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"TaoPythonSetType_PYTHON")
 *     if name == NULL: return FunctionEnd() # XXX             # <<<<<<<<<<<<<<
 *     cdef object ctx = createcontext(name)
 *     TaoPythonSetContext(tao, <void*>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":2814
 *     FunctionBegin(b"TaoPythonSetType_PYTHON")
 *     if name == NULL: return FunctionEnd() # XXX
 *     cdef object ctx = createcontext(name)             # <<<<<<<<<<<<<<
 *     TaoPythonSetContext(tao, <void*>ctx)
 *     PyTao(tao).setname(name)
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_createcontext(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ctx = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2815
 *     if name == NULL: return FunctionEnd() # XXX
 *     cdef object ctx = createcontext(name)
 *     TaoPythonSetContext(tao, <void*>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(5, 2815, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2816
 *     cdef object ctx = createcontext(name)
 *     TaoPythonSetContext(tao, <void*>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(5, 2816, __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(5, 2816, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2817
 *     TaoPythonSetContext(tao, <void*>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":2810
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TaoPythonSetType_PYTHON(PetscTAO tao, const 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2819
 *     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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TaoPythonGetType_PYTHON", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2821
 * 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":2822
 *     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(5, 2822, __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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 2822, __pyx_L1_error)
  (__pyx_v_name[0]) = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2823
 *     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":2819
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2825
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TaoCreate_Python(             # <<<<<<<<<<<<<<
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TaoCreate_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2828
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"TaoCreate_Python")             # <<<<<<<<<<<<<<
 *     cdef TaoOps ops    = tao.ops
 *     ops.destroy        = TaoDestroy_Python
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoCreate_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2829
 *     ) except PETSC_ERR_PYTHON with gil:
 *     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":2830
 *     FunctionBegin(b"TaoCreate_Python")
 *     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":2831
 *     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":2832
 *     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":2833
 *     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":2834
 *     ops.solve          = TaoSolve_Python
 *     ops.setup          = TaoSetUp_Python
 *     ops.setfromoptions = TaoSetFromOptions_Python             # <<<<<<<<<<<<<<
 *     #
 *     CHKERR(TaoParametersInitialize(tao))
*/
  __pyx_v_ops->setfromoptions = __pyx_f_8petsc4py_5PETSc_TaoSetFromOptions_Python;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2836
 *     ops.setfromoptions = TaoSetFromOptions_Python
 *     #
 *     CHKERR(TaoParametersInitialize(tao))             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectComposeFunction(
 *             <PetscObject>tao, b"TaoPythonSetType_C",
*/
  __pyx_t_2 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoParametersInitialize(__pyx_v_tao)); if (unlikely(__pyx_t_2 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 2836, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2837
 *     #
 *     CHKERR(TaoParametersInitialize(tao))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>tao, b"TaoPythonSetType_C",
 *             <PetscVoidFunction>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(5, 2837, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2840
 *             <PetscObject>tao, b"TaoPythonSetType_C",
 *             <PetscVoidFunction>TaoPythonSetType_PYTHON))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>tao, b"TaoPythonGetType_C",
 *             <PetscVoidFunction>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(5, 2840, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2844
 *             <PetscVoidFunction>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(5, 2844, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2845
 *     #
 *     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(5, 2845, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2847
 *     CHKERR(TaoCreateDefaultKSP(tao))
 *     #
 *     cdef ctx = PyTao(NULL)             # <<<<<<<<<<<<<<
 *     tao.data = <void*> ctx
 *     Py_INCREF(<PyObject*>tao.data)
*/
  __pyx_t_3 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_PyTao(NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_ctx = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2848
 *     #
 *     cdef ctx = PyTao(NULL)
 *     tao.data = <void*> ctx             # <<<<<<<<<<<<<<
 *     Py_INCREF(<PyObject*>tao.data)
 *     return FunctionEnd()
*/
  __pyx_v_tao->data = ((void *)__pyx_v_ctx);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2849
 *     cdef ctx = PyTao(NULL)
 *     tao.data = <void*> ctx
 *     Py_INCREF(<PyObject*>tao.data)             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
  Py_INCREF(((PyObject *)__pyx_v_tao->data));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2850
 *     tao.data = <void*> ctx
 *     Py_INCREF(<PyObject*>tao.data)
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef inline PetscErrorCode TaoDestroy_Python_inner(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2825
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TaoCreate_Python(             # <<<<<<<<<<<<<<
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2852
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode TaoDestroy_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TaoDestroy_Python_inner", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2855
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     try:             # <<<<<<<<<<<<<<
 *         addRef(tao)
 *         TaoPythonSetContext(tao, NULL)
*/
  /*try:*/ {

    /* "petsc4py/PETSc/libpetsc4py.pyx":2856
 *     ) 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":2857
 *     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(5, 2857, __pyx_L4_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2859
 *         TaoPythonSetContext(tao, NULL)
 *     finally:
 *         delRef(tao)             # <<<<<<<<<<<<<<
 *         Py_DECREF(<PyObject*>tao.data)
 *         tao.data = NULL
*/
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_tao);

      /* "petsc4py/PETSc/libpetsc4py.pyx":2860
 *     finally:
 *         delRef(tao)
 *         Py_DECREF(<PyObject*>tao.data)             # <<<<<<<<<<<<<<
 *         tao.data = NULL
 *     return PETSC_SUCCESS
*/
      Py_DECREF(((PyObject *)__pyx_v_tao->data));

      /* "petsc4py/PETSc/libpetsc4py.pyx":2861
 *         delRef(tao)
 *         Py_DECREF(<PyObject*>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;
       __Pyx_ExceptionSwap(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      if ( 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":2859
 *         TaoPythonSetContext(tao, NULL)
 *     finally:
 *         delRef(tao)             # <<<<<<<<<<<<<<
 *         Py_DECREF(<PyObject*>tao.data)
 *         tao.data = NULL
*/
        __pyx_f_8petsc4py_5PETSc_delRef(__pyx_v_tao);

        /* "petsc4py/PETSc/libpetsc4py.pyx":2860
 *     finally:
 *         delRef(tao)
 *         Py_DECREF(<PyObject*>tao.data)             # <<<<<<<<<<<<<<
 *         tao.data = NULL
 *     return PETSC_SUCCESS
*/
        Py_DECREF(((PyObject *)__pyx_v_tao->data));

        /* "petsc4py/PETSc/libpetsc4py.pyx":2861
 *         delRef(tao)
 *         Py_DECREF(<PyObject*>tao.data)
 *         tao.data = NULL             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
        __pyx_v_tao->data = NULL;
      }
      __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":2862
 *         Py_DECREF(<PyObject*>tao.data)
 *         tao.data = NULL
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode TaoDestroy_Python(
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2852
 *     return FunctionEnd()
 * 
 * cdef inline PetscErrorCode TaoDestroy_Python_inner(             # <<<<<<<<<<<<<<
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2864
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode TaoDestroy_Python(             # <<<<<<<<<<<<<<
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2867
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON nogil:
 *     FunctionBegin(b"TaoDestroy_Python")             # <<<<<<<<<<<<<<
 *     CHKERR(PetscObjectComposeFunction(
 *             <PetscObject>tao, b"TaoPythonSetType_C",
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoDestroy_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2868
 *     ) except PETSC_ERR_PYTHON nogil:
 *     FunctionBegin(b"TaoDestroy_Python")
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>tao, b"TaoPythonSetType_C",
 *             <PetscVoidFunction>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(5, 2868, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2871
 *             <PetscObject>tao, b"TaoPythonSetType_C",
 *             <PetscVoidFunction>NULL))
 *     CHKERR(PetscObjectComposeFunction(             # <<<<<<<<<<<<<<
 *             <PetscObject>tao, b"TaoPythonGetType_C",
 *             <PetscVoidFunction>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(5, 2871, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2875
 *             <PetscVoidFunction>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(5, 2875, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2876
 *     #
 *     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":2864
 *     return PETSC_SUCCESS
 * 
 * cdef PetscErrorCode TaoDestroy_Python(             # <<<<<<<<<<<<<<
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("petsc4py.PETSc.TaoDestroy_Python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = PETSC_ERR_PYTHON;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2878
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TaoSetUp_Python(             # <<<<<<<<<<<<<<
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

static PetscErrorCode __pyx_f_8petsc4py_5PETSc_TaoSetUp_Python(Tao __pyx_v_tao) {
  char __pyx_v_name[2048];
  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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TaoSetUp_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2881
 *     PetscTAO tao,
 *     ) 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":2883
 *     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":2884
 *     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(5, 2884, __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":2885
 *     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(5, 2885, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2888
 *                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:
*/
    __pyx_t_4 = (__pyx_v_found != 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      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":2889
 *                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(5, 2889, __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(5, 2889, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":2888
 *                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":2884
 *     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":2890
 *         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(5, 2890, __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":2891
 *             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, __pyx_k_Python_context_not_set_call_one_7);
    goto __pyx_L0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2890
 *         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":2897
 *                            "-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(5, 2897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_setUp); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2897, __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":2898
 *     #
 *     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":2899
 *     cdef setUp = PyTao(tao).setUp
 *     if setUp is not None:
 *         setUp(TAO_(tao))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_setUp);
    __pyx_t_7 = __pyx_v_setUp; 
    __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TAO_(__pyx_v_tao)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 2899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_8};
      __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2899, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2898
 *     #
 *     cdef setUp = PyTao(tao).setUp
 *     if setUp is not None:             # <<<<<<<<<<<<<<
 *         setUp(TAO_(tao))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2900
 *     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":2878
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TaoSetUp_Python(             # <<<<<<<<<<<<<<
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2902
 *     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[2048];
  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;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TaoSetFromOptions_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2906
 *     PetscOptionItems PetscOptionsObject,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"TaoSetFromOptions_Python")             # <<<<<<<<<<<<<<
 *     cdef char name[2048], *defval = PyTao(tao).getname()
 *     cdef PetscBool found = PETSC_FALSE
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoSetFromOptions_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2907
 *     ) except PETSC_ERR_PYTHON with gil:
 *     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(5, 2907, __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 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 2907, __pyx_L1_error)
  __pyx_v_defval = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2908
 *     FunctionBegin(b"TaoSetFromOptions_Python")
 *     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":2909
 *     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":2910
 *     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)); <void>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(5, 2910, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2912
 *     CHKERR(PetscOptionsString(
 *             b"-tao_python_type", b"Python [package.]module[.{class|function}]",
 *             b"TaoPythonSetType", defval, name, sizeof(name), &found)); <void>opts             # <<<<<<<<<<<<<<
 *     if found and name[0]:
 *         CHKERR(TaoPythonSetType_PYTHON(tao, name))
*/
  ((void)PetscOptionsObject);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2913
 *             b"-tao_python_type", b"Python [package.]module[.{class|function}]",
 *             b"TaoPythonSetType", defval, name, sizeof(name), &found)); <void>opts
 *     if found and name[0]:             # <<<<<<<<<<<<<<
 *         CHKERR(TaoPythonSetType_PYTHON(tao, name))
 *     #
*/
  __pyx_t_5 = (__pyx_v_found != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    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":2914
 *             b"TaoPythonSetType", defval, name, sizeof(name), &found)); <void>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(5, 2914, __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(5, 2914, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2913
 *             b"-tao_python_type", b"Python [package.]module[.{class|function}]",
 *             b"TaoPythonSetType", defval, name, sizeof(name), &found)); <void>opts
 *     if found and name[0]:             # <<<<<<<<<<<<<<
 *         CHKERR(TaoPythonSetType_PYTHON(tao, name))
 *     #
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2916
 *         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(5, 2916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_setFromOptions); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2916, __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":2917
 *     #
 *     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":2918
 *     cdef setFromOptions = PyTao(tao).setFromOptions
 *     if setFromOptions is not None:
 *         setFromOptions(TAO_(tao))             # <<<<<<<<<<<<<<
 *     CHKERR(KSPSetFromOptions(tao.ksp))
 *     return FunctionEnd()
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_setFromOptions);
    __pyx_t_8 = __pyx_v_setFromOptions; 
    __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TAO_(__pyx_v_tao)); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 2918, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_9};
      __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2918, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2917
 *     #
 *     cdef setFromOptions = PyTao(tao).setFromOptions
 *     if setFromOptions is not None:             # <<<<<<<<<<<<<<
 *         setFromOptions(TAO_(tao))
 *     CHKERR(KSPSetFromOptions(tao.ksp))
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2919
 *     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(5, 2919, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2920
 *         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":2902
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2922
 *     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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TaoView_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2926
 *     PetscViewer vwr,
 *     ) 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":2927
 *     ) 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(5, 2927, __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(5, 2927, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2928
 *     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(5, 2928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_view); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2928, __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":2929
 *     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":2930
 *     cdef view = PyTao(tao).view
 *     if view is not None:
 *         view(TAO_(tao), Viewer_(vwr))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_view);
    __pyx_t_5 = __pyx_v_view; 
    __pyx_t_6 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TAO_(__pyx_v_tao)); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 2930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Viewer_(__pyx_v_vwr)); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 2930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_6, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_8, (3-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 2930, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2929
 *     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":2931
 *     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":2922
 *     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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2933
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TaoSolve_Python(             # <<<<<<<<<<<<<<
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  PetscErrorCode __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TaoSolve_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":2936
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"TaoSolve_Python")             # <<<<<<<<<<<<<<
 *     tao.niter = 0
 *     tao.ksp_its = 0
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoSolve_Python"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2937
 *     ) except PETSC_ERR_PYTHON with gil:
 *     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":2938
 *     FunctionBegin(b"TaoSolve_Python")
 *     tao.niter = 0
 *     tao.ksp_its = 0             # <<<<<<<<<<<<<<
 *     tao.reason = TAO_CONTINUE_ITERATING
 *     #
*/
  __pyx_v_tao->ksp_its = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2939
 *     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":2941
 *     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(5, 2941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_solve); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2941, __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":2942
 *     #
 *     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":2943
 *     cdef solve = PyTao(tao).solve
 *     if solve is not None:
 *         solve(TAO_(tao))             # <<<<<<<<<<<<<<
 *     else:
 *         TaoSolve_Python_default(tao)
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_solve);
    __pyx_t_4 = __pyx_v_solve; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TAO_(__pyx_v_tao)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 2943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2943, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2942
 *     #
 *     cdef solve = PyTao(tao).solve
 *     if solve is not None:             # <<<<<<<<<<<<<<
 *         solve(TAO_(tao))
 *     else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":2945
 *         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(5, 2945, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2947
 *         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":2933
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TaoSolve_Python(             # <<<<<<<<<<<<<<
 *     PetscTAO tao,
 *     ) 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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":2949
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TaoSolve_Python_default(             # <<<<<<<<<<<<<<
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  TaoLineSearchConvergedReason __pyx_v_lsr;
  long __pyx_v_its;
  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;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();

  /* "petsc4py/PETSc/libpetsc4py.pyx":2952
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON with gil:
 *     FunctionBegin(b"TaoSolve_Python_default")             # <<<<<<<<<<<<<<
 *     cdef PetscVec X = NULL, G = NULL, S = NULL
 *     CHKERR(TaoGetVecs(tao, &X, &G, &S))
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"TaoSolve_Python_default"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":2953
 *     ) except PETSC_ERR_PYTHON with gil:
 *     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":2954
 *     FunctionBegin(b"TaoSolve_Python_default")
 *     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(5, 2954, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2956
 *     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":2957
 *     #
 *     cdef PetscReal f = 0.0
 *     cdef PetscReal gnorm = 0.0             # <<<<<<<<<<<<<<
 *     cdef PetscReal step = 1.0
 *     #
*/
  __pyx_v_gnorm = 0.0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2958
 *     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":2960
 *     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":2961
 *     #
 *     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(5, 2961, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2962
 *     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(5, 2962, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2960
 *     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":2964
 *         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(5, 2964, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2965
 *     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(5, 2965, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2967
 *     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(5, 2967, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2968
 * 
 *     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(5, 2968, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2969
 *     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 PetscTAOLineSearchConvergedReason lsr = TAOLINESEARCH_SUCCESS
*/
  __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(5, 2969, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":2971
 *     CHKERR(TaoConverged(tao, &tao.reason))
 * 
 *     cdef PetscTAOLineSearchConvergedReason lsr = TAOLINESEARCH_SUCCESS             # <<<<<<<<<<<<<<
 *     for its from 0 <= its < tao.max_it:
 *         <void> its # unused
*/
  __pyx_v_lsr = TAOLINESEARCH_SUCCESS;

  /* "petsc4py/PETSc/libpetsc4py.pyx":2972
 * 
 *     cdef PetscTAOLineSearchConvergedReason lsr = TAOLINESEARCH_SUCCESS
 *     for its from 0 <= its < tao.max_it:             # <<<<<<<<<<<<<<
 *         <void> its # unused
 *         if tao.reason: break
*/
  __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":2973
 *     cdef PetscTAOLineSearchConvergedReason lsr = TAOLINESEARCH_SUCCESS
 *     for its from 0 <= its < tao.max_it:
 *         <void> its # unused             # <<<<<<<<<<<<<<
 *         if tao.reason: break
 *         CHKERR(TaoComputeUpdate(tao, &f))
*/
    ((void)__pyx_v_its);

    /* "petsc4py/PETSc/libpetsc4py.pyx":2974
 *     for its from 0 <= its < tao.max_it:
 *         <void> its # unused
 *         if tao.reason: break             # <<<<<<<<<<<<<<
 *         CHKERR(TaoComputeUpdate(tao, &f))
 * 
*/
    if (__pyx_v_tao->reason) {
      goto __pyx_L5_break;
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":2975
 *         <void> its # unused
 *         if tao.reason: break
 *         CHKERR(TaoComputeUpdate(tao, &f))             # <<<<<<<<<<<<<<
 * 
 *         TaoPreStep_Python(tao)
*/
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeUpdate(__pyx_v_tao, (&__pyx_v_f))); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 2975, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2977
 *         CHKERR(TaoComputeUpdate(tao, &f))
 * 
 *         TaoPreStep_Python(tao)             # <<<<<<<<<<<<<<
 *         #
 *         tao.ksp_its = 0
*/
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_TaoPreStep_Python(__pyx_v_tao); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 2977, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2979
 *         TaoPreStep_Python(tao)
 *         #
 *         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":2980
 *         #
 *         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(5, 2980, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2981
 *         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(5, 2981, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2982
 *         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":2984
 *         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":2985
 *         #
 *         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(5, 2985, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":2986
 *         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(5, 2986, __pyx_L1_error)

      /* "petsc4py/PETSc/libpetsc4py.pyx":2987
 *             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":2988
 *             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":2987
 *             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":2984
 *         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_L7;
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":2990
 *                 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(5, 2990, __pyx_L1_error)
    }
    __pyx_L7:;

    /* "petsc4py/PETSc/libpetsc4py.pyx":2991
 *         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(5, 2991, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2993
 *         CHKERR(TaoCheckReals(tao, f, gnorm))
 * 
 *         tao.niter += 1             # <<<<<<<<<<<<<<
 *         #
 *         TaoPostStep_Python(tao)
*/
    __pyx_v_tao->niter = (__pyx_v_tao->niter + 1);

    /* "petsc4py/PETSc/libpetsc4py.pyx":2995
 *         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(5, 2995, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2996
 *         #
 *         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(5, 2996, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2997
 *         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(5, 2997, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":2998
 *         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(5, 2998, __pyx_L1_error)
  }
  __pyx_L5_break:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":3000
 *         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":3001
 * 
 *     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":3002
 *     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":3001
 * 
 *     if tao.niter == tao.max_it:
 *         if tao.reason <= 0:             # <<<<<<<<<<<<<<
 *             tao.reason = TAO_DIVERGED_MAXITS
 *     #
*/
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":3000
 *         CHKERR(TaoConverged(tao, &tao.reason))
 * 
 *     if tao.niter == tao.max_it:             # <<<<<<<<<<<<<<
 *         if tao.reason <= 0:
 *             tao.reason = TAO_DIVERGED_MAXITS
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":3004
 *             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":2949
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TaoSolve_Python_default(             # <<<<<<<<<<<<<<
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

  /* 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:;
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":3006
 *     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;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  PetscErrorCode __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TaoStep_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":3012
 *     PetscVec S,
 *     ) 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":3013
 *     ) 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(5, 3013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3013, __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":3014
 *     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":3015
 *     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 = NULL;
    __Pyx_INCREF(__pyx_v_step);
    __pyx_t_4 = __pyx_v_step; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TAO_(__pyx_v_tao)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 3015, __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(5, 3015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = (__pyx_v_G != NULL);
    if (__pyx_t_3) {
      __pyx_t_8 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_G)); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 3015, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __pyx_t_8;
      __pyx_t_8 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_7 = Py_None;
    }
    __pyx_t_3 = (__pyx_v_S != NULL);
    if (__pyx_t_3) {
      __pyx_t_9 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_Vec_(__pyx_v_S)); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 3015, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = __pyx_t_9;
      __pyx_t_9 = 0;
    } else {
      __Pyx_INCREF(Py_None);
      __pyx_t_8 = Py_None;
    }
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_10, (5-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3015, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":3014
 *     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":3018
 *     else:
 *         # TaoStep_Python_default(tao, X, G, S)
 *         CHKERR(TaoComputeGradient(tao, X, G))             # <<<<<<<<<<<<<<
 *         CHKERR(VecAXPBY(S, -1.0, 0.0, G))
 *     return FunctionEnd()
*/
  /*else*/ {
    __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(TaoComputeGradient(__pyx_v_tao, __pyx_v_X, __pyx_v_G)); if (unlikely(__pyx_t_11 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 3018, __pyx_L1_error)

    /* "petsc4py/PETSc/libpetsc4py.pyx":3019
 *         # TaoStep_Python_default(tao, X, G, S)
 *         CHKERR(TaoComputeGradient(tao, X, G))
 *         CHKERR(VecAXPBY(S, -1.0, 0.0, G))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_11 = __pyx_f_8petsc4py_5PETSc_CHKERR(VecAXPBY(__pyx_v_S, -1.0, 0.0, __pyx_v_G)); if (unlikely(__pyx_t_11 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 3019, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":3020
 *         CHKERR(TaoComputeGradient(tao, X, G))
 *         CHKERR(VecAXPBY(S, -1.0, 0.0, G))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode TaoPreStep_Python(
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":3006
 *     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_XDECREF(__pyx_t_9);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":3022
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TaoPreStep_Python(             # <<<<<<<<<<<<<<
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TaoPreStep_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":3025
 *     PetscTAO tao,
 *     ) 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":3026
 *     ) 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(5, 3026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_preStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3026, __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":3027
 *     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":3028
 *     cdef preStep = PyTao(tao).preStep
 *     if preStep is not None:
 *         preStep(TAO_(tao))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_preStep);
    __pyx_t_4 = __pyx_v_preStep; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TAO_(__pyx_v_tao)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 3028, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3028, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":3027
 *     FunctionBegin(b"TaoPreStep_Python")
 *     cdef preStep = PyTao(tao).preStep
 *     if preStep is not None:             # <<<<<<<<<<<<<<
 *         preStep(TAO_(tao))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":3029
 *     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":3022
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TaoPreStep_Python(             # <<<<<<<<<<<<<<
 *     PetscTAO tao,
 *     ) 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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":3031
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TaoPostStep_Python(             # <<<<<<<<<<<<<<
 *     PetscTAO tao,
 *     ) except PETSC_ERR_PYTHON with gil:
*/

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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("TaoPostStep_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":3034
 *     PetscTAO tao,
 *     ) 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":3035
 *     ) 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(5, 3035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_postStep); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3035, __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":3036
 *     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":3037
 *     cdef postStep = PyTao(tao).postStep
 *     if postStep is not None:
 *         postStep(TAO_(tao))             # <<<<<<<<<<<<<<
 *     return FunctionEnd()
 * 
*/
    __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_postStep);
    __pyx_t_4 = __pyx_v_postStep; 
    __pyx_t_5 = ((PyObject *)__pyx_f_8petsc4py_5PETSc_TAO_(__pyx_v_tao)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 3037, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_1);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__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;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 3037, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":3036
 *     FunctionBegin(b"TaoPostStep_Python")
 *     cdef postStep = PyTao(tao).postStep
 *     if postStep is not None:             # <<<<<<<<<<<<<<
 *         postStep(TAO_(tao))
 *     return FunctionEnd()
*/
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":3038
 *     if postStep is not None:
 *         postStep(TAO_(tao))
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":3031
 *     return FunctionEnd()
 * 
 * cdef PetscErrorCode TaoPostStep_Python(             # <<<<<<<<<<<<<<
 *     PetscTAO tao,
 *     ) 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_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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":3042
 * # --------------------------------------------------------------------
 * 
 * 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;
  size_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;
  PyObject *(*__pyx_t_10)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PetscPythonMonitorSet_Python", 0);

  /* "petsc4py/PETSc/libpetsc4py.pyx":3046
 *     const char *url_p,
 *     ) 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":3047
 *     ) 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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(5, 3047, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(5, 3047, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/libpetsc4py.pyx":3048
 *     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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(5, 3048, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(5, 3048, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/libpetsc4py.pyx":3049
 *     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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(5, 3049, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(5, 3049, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/libpetsc4py.pyx":3051
 *     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":3052
 *     #
 *     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(5, 3052, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":3053
 *     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(5, 3053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_klass = ((PyTypeObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":3054
 *     CHKERR(PetscObjectGetClassId(obj_p, &classid))
 *     cdef type klass = PyPetscType_Lookup(classid)
 *     cdef Object ob = klass()             # <<<<<<<<<<<<<<
 *     ob.obj[0] = newRef(obj_p)
 *     #
*/
  __pyx_t_4 = NULL;
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_v_klass, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3054, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object))))) __PYX_ERR(5, 3054, __pyx_L1_error)
  __pyx_v_ob = ((struct PyPetscObjectObject *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":3055
 *     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":3057
 *     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(5, 3057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_url = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":3058
 *     #
 *     cdef url = bytes2str(url_p)
 *     if ':' in url:             # <<<<<<<<<<<<<<
 *         path, names = parse_url(url)
 *     else:
*/
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_mstate_global->__pyx_kp_u__8, __pyx_v_url, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(5, 3058, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/libpetsc4py.pyx":3059
 *     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(5, 3059, __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(5, 3059, __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_INCREF(__pyx_t_4);
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_6);
      } else {
        __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 3059, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 3059, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
      }
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 3059, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 3059, __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(5, 3059, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < (0)) __PYX_ERR(5, 3059, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(5, 3059, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_path = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_names = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":3058
 *     #
 *     cdef url = bytes2str(url_p)
 *     if ':' in url:             # <<<<<<<<<<<<<<
 *         path, names = parse_url(url)
 *     else:
*/
    goto __pyx_L3;
  }

  /* "petsc4py/PETSc/libpetsc4py.pyx":3061
 *         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_6 = __pyx_mstate_global->__pyx_n_u_monitor;
    __Pyx_INCREF(__pyx_t_6);
    __pyx_v_path = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_v_names = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/libpetsc4py.pyx":3062
 *     else:
 *         path, names = url, 'monitor'
 *     module = load_module(path)             # <<<<<<<<<<<<<<
 *     for attr in names.split(', '):
 *         monitor = getattr(module, attr)
*/
  __pyx_t_6 = __pyx_f_8petsc4py_5PETSc_load_module(__pyx_v_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 3062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_module = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":3063
 *         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_v_names;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_5 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u__27};
    __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 3063, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
  }
  if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
    __pyx_t_3 = __pyx_t_6; __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_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 3063, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 3063, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 3063, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_9, __Pyx_ReferenceSharing_OwnStrongReference);
        ++__pyx_t_9;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(5, 3063, __pyx_L1_error)
          #endif
          if (__pyx_t_9 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9));
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_9);
        #endif
        ++__pyx_t_9;
      }
      if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 3063, __pyx_L1_error)
    } else {
      __pyx_t_6 = __pyx_t_10(__pyx_t_3);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(5, 3063, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_attr, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":3064
 *     module = load_module(path)
 *     for attr in names.split(', '):
 *         monitor = getattr(module, attr)             # <<<<<<<<<<<<<<
 *         if isinstance(monitor, type):
 *             monitor = monitor(ob)
*/
    __pyx_t_6 = __Pyx_GetAttr(__pyx_v_module, __pyx_v_attr); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 3064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_monitor, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":3065
 *     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":3066
 *         monitor = getattr(module, attr)
 *         if isinstance(monitor, type):
 *             monitor = monitor(ob)             # <<<<<<<<<<<<<<
 *         ob.setMonitor(monitor)
 *     #
*/
      __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_monitor);
      __pyx_t_7 = __pyx_v_monitor; 
      __pyx_t_5 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_5 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_ob)};
        __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_7, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 3066, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_DECREF_SET(__pyx_v_monitor, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "petsc4py/PETSc/libpetsc4py.pyx":3065
 *     for attr in names.split(', '):
 *         monitor = getattr(module, attr)
 *         if isinstance(monitor, type):             # <<<<<<<<<<<<<<
 *             monitor = monitor(ob)
 *         ob.setMonitor(monitor)
*/
    }

    /* "petsc4py/PETSc/libpetsc4py.pyx":3067
 *         if isinstance(monitor, type):
 *             monitor = monitor(ob)
 *         ob.setMonitor(monitor)             # <<<<<<<<<<<<<<
 *     #
 *     return FunctionEnd()
*/
    __pyx_t_7 = ((PyObject *)__pyx_v_ob);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_5 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_monitor};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_setMonitor, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 3067, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "petsc4py/PETSc/libpetsc4py.pyx":3063
 *         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":3069
 *         ob.setMonitor(monitor)
 *     #
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":3042
 * # --------------------------------------------------------------------
 * 
 * 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/libpetsc4py.pyx":3095
 * 
 * 
 * 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":3096
 * 
 * cdef public PetscErrorCode PetscPythonRegisterAll() except PETSC_ERR_PYTHON:
 *     FunctionBegin(b"PetscPythonRegisterAll")             # <<<<<<<<<<<<<<
 * 
 *     # Python subtypes
*/
  __pyx_f_8petsc4py_5PETSc_FunctionBegin(((char *)"PetscPythonRegisterAll"));

  /* "petsc4py/PETSc/libpetsc4py.pyx":3099
 * 
 *     # 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(5, 3099, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":3100
 *     # 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(5, 3100, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":3101
 *     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(5, 3101, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":3102
 *     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(5, 3102, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":3103
 *     CHKERR(KSPRegister(KSPPYTHON, KSPCreate_Python))
 *     CHKERR(SNESRegister(SNESPYTHON, SNESCreate_Python))
 *     CHKERR(TSRegister(TSPYTHON, TSCreate_Python))             # <<<<<<<<<<<<<<
 *     CHKERR(TaoRegister(TAOPYTHON, TaoCreate_Python))
 *     CHKERR(PetscViewerRegister(PETSCVIEWERPYTHON, PetscViewerCreate_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(5, 3103, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":3104
 *     CHKERR(SNESRegister(SNESPYTHON, SNESCreate_Python))
 *     CHKERR(TSRegister(TSPYTHON, TSCreate_Python))
 *     CHKERR(TaoRegister(TAOPYTHON, TaoCreate_Python))             # <<<<<<<<<<<<<<
 *     CHKERR(PetscViewerRegister(PETSCVIEWERPYTHON, PetscViewerCreate_Python))
 * 
*/
  __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(5, 3104, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":3105
 *     CHKERR(TSRegister(TSPYTHON, TSCreate_Python))
 *     CHKERR(TaoRegister(TAOPYTHON, TaoCreate_Python))
 *     CHKERR(PetscViewerRegister(PETSCVIEWERPYTHON, PetscViewerCreate_Python))             # <<<<<<<<<<<<<<
 * 
 *     # Python monitors
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscViewerRegister(PETSCVIEWERPYTHON, __pyx_f_8petsc4py_5PETSc_PetscViewerCreate_Python)); if (unlikely(__pyx_t_1 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(5, 3105, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":3109
 *     # Python monitors
 *     global PetscPythonMonitorSet_C
 *     PetscPythonMonitorSet_C = PetscPythonMonitorSet_Python             # <<<<<<<<<<<<<<
 * 
 *     return FunctionEnd()
*/
  PetscPythonMonitorSet_C = __pyx_f_8petsc4py_5PETSc_PetscPythonMonitorSet_Python;

  /* "petsc4py/PETSc/libpetsc4py.pyx":3111
 *     PetscPythonMonitorSet_C = PetscPythonMonitorSet_Python
 * 
 *     return FunctionEnd()             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_r = __pyx_f_8petsc4py_5PETSc_FunctionEnd();
  goto __pyx_L0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":3095
 * 
 * 
 * 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":288
 * 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;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4[5];
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8[4];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("traceback", 0);

  /* "petsc4py/PETSc/PETSc.pyx":298
 *     void          *ctx,
 * ) except (<PetscErrorCode>-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":299
 * ) except (<PetscErrorCode>-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":300
 *     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":302
 *     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":303
 *     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(7, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_fun = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":304
 *     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(7, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_fnm = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":305
 *     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_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_fun), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_fnm), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyUnicode_From_int(__pyx_v_line, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4[0] = __pyx_t_1;
  __pyx_t_4[1] = __pyx_mstate_global->__pyx_kp_u_at;
  __pyx_t_4[2] = __pyx_t_2;
  __pyx_t_4[3] = __pyx_mstate_global->__pyx_kp_u__8;
  __pyx_t_4[4] = __pyx_t_3;
  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 1 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __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;
  __pyx_v_m = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":306
 *     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_6 = PyList_Insert(__pyx_v_tbl, 0, __pyx_v_m); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(7, 306, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":307
 *     cdef object m = "%s() at %s:%d" % (fun, fnm, line)
 *     PyList_Insert(tbl, 0, m)
 *     if p != PETSC_ERROR_INITIAL:             # <<<<<<<<<<<<<<
 *         return n
 *     #
*/
  __pyx_t_7 = (__pyx_v_p != PETSC_ERROR_INITIAL);
  if (__pyx_t_7) {

    /* "petsc4py/PETSc/PETSc.pyx":308
 *     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":307
 *     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":310
 *         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_mstate_global->__pyx_slice[1], 1, 0, 1) < (0)) __PYX_ERR(7, 310, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":311
 *     #
 *     del tbl[1:] # clear any previous stuff
 *     if n == PETSC_ERR_MEM: # special case             # <<<<<<<<<<<<<<
 *         PetscMallocGetCurrentUsage(&mem)
 *         PetscMemoryGetCurrentUsage(&rss)
*/
  __pyx_t_7 = (__pyx_v_n == PETSC_ERR_MEM);
  if (__pyx_t_7) {

    /* "petsc4py/PETSc/PETSc.pyx":312
 *     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":313
 *     if n == PETSC_ERR_MEM: # special case
 *         PetscMallocGetCurrentUsage(&mem)
 *         PetscMemoryGetCurrentUsage(&rss)             # <<<<<<<<<<<<<<
 *         m = (
 *             "Out of memory. "
*/
    (void)(PetscMemoryGetCurrentUsage((&__pyx_v_rss)));

    /* "petsc4py/PETSc/PETSc.pyx":318
 *             "Allocated: %d, "
 *             "Used by process: %d"
 *         ) % (mem, rss)             # <<<<<<<<<<<<<<
 *         PyList_Append(tbl, m)
 *     else:
*/
    __pyx_t_5 = PyFloat_FromDouble(__pyx_v_mem); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyFloat_FromDouble(__pyx_v_rss); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_FormatAndDecref(__Pyx_PyNumber_Long(__pyx_t_5), __pyx_mstate_global->__pyx_n_u_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 318, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_Out_of_memory_Allocated;
    __pyx_t_8[1] = __pyx_t_3;
    __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_Used_by_process;
    __pyx_t_8[3] = __pyx_t_2;

    /* "petsc4py/PETSc/PETSc.pyx":315
 *         PetscMemoryGetCurrentUsage(&rss)
 *         m = (
 *             "Out of memory. "             # <<<<<<<<<<<<<<
 *             "Allocated: %d, "
 *             "Used by process: %d"
*/
    __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_8, 4, 26 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 19 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
    if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_m, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "petsc4py/PETSc/PETSc.pyx":319
 *             "Used by process: %d"
 *         ) % (mem, rss)
 *         PyList_Append(tbl, m)             # <<<<<<<<<<<<<<
 *     else:
 *         PetscErrorMessage(n, &text, NULL)
*/
    __pyx_t_6 = PyList_Append(__pyx_v_tbl, __pyx_v_m); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(7, 319, __pyx_L1_error)

    /* "petsc4py/PETSc/PETSc.pyx":311
 *     #
 *     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":321
 *         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":322
 *     else:
 *         PetscErrorMessage(n, &text, NULL)
 *     if text != NULL: PyList_Append(tbl, bytes2str(text))             # <<<<<<<<<<<<<<
 *     if mess != NULL: PyList_Append(tbl, bytes2str(mess))
 *     <void>comm # unused
*/
  __pyx_t_7 = (__pyx_v_text != NULL);
  if (__pyx_t_7) {
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_text); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyList_Append(__pyx_v_tbl, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(7, 322, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "petsc4py/PETSc/PETSc.pyx":323
 *         PetscErrorMessage(n, &text, NULL)
 *     if text != NULL: PyList_Append(tbl, bytes2str(text))
 *     if mess != NULL: PyList_Append(tbl, bytes2str(mess))             # <<<<<<<<<<<<<<
 *     <void>comm # unused
 *     <void>ctx  # unused
*/
  __pyx_t_7 = (__pyx_v_mess != NULL);
  if (__pyx_t_7) {
    __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_bytes2str(__pyx_v_mess); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyList_Append(__pyx_v_tbl, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(7, 323, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }

  /* "petsc4py/PETSc/PETSc.pyx":324
 *     if text != NULL: PyList_Append(tbl, bytes2str(text))
 *     if mess != NULL: PyList_Append(tbl, bytes2str(mess))
 *     <void>comm # unused             # <<<<<<<<<<<<<<
 *     <void>ctx  # unused
 *     return n
*/
  ((void)__pyx_v_comm);

  /* "petsc4py/PETSc/PETSc.pyx":325
 *     if mess != NULL: PyList_Append(tbl, bytes2str(mess))
 *     <void>comm # unused
 *     <void>ctx  # unused             # <<<<<<<<<<<<<<
 *     return n
 * 
*/
  ((void)__pyx_v_ctx);

  /* "petsc4py/PETSc/PETSc.pyx":326
 *     <void>comm # unused
 *     <void>ctx  # unused
 *     return n             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode PetscPythonErrorHandler(
*/
  __pyx_r = __pyx_v_n;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PETSc.pyx":288
 * 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_3);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/PETSc.pyx":328
 *     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;
  PyGILState_STATE __pyx_gilstate_save;

  /* "petsc4py/PETSc/PETSc.pyx":339
 * ) except (<PetscErrorCode>-1) nogil:
 *     global tracebacklist
 *     if (<void*>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":340
 *     global tracebacklist
 *     if (<void*>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(7, 340, __pyx_L1_error)
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;

    /* "petsc4py/PETSc/PETSc.pyx":339
 * ) except (<PetscErrorCode>-1) nogil:
 *     global tracebacklist
 *     if (<void*>tracebacklist) != NULL and Py_IsInitialized():             # <<<<<<<<<<<<<<
 *         return traceback(comm, line, cfunc, cfile, n, p, mess, ctx)
 *     else:
*/
  }

  /* "petsc4py/PETSc/PETSc.pyx":342
 *         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":328
 *     return n
 * 
 * cdef PetscErrorCode PetscPythonErrorHandler(             # <<<<<<<<<<<<<<
 *     MPI_Comm       comm,
 *     int            line,
*/

  /* function exit code */
  __pyx_L1_error:;
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_AddTraceback("petsc4py.PETSc.PetscPythonErrorHandler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = ((PetscErrorCode)-1L);
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  __pyx_L0:;
  return __pyx_r;
}

/* "petsc4py/PETSc/PETSc.pyx":378
 * 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_9genexpr25__pyx_v_a = NULL;
  PyObject *__pyx_9genexpr26__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;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  char *__pyx_t_12;
  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":380
 * 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":381
 *     # 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":382
 *     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(7, 382, __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":383
 *     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 = <int> len(args)
*/
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 383, __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(7, 383, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 383, __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_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 383, __pyx_L6_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) break;
          }
          __pyx_t_6 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_4;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 383, __pyx_L6_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4));
          #else
          __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4);
          #endif
          ++__pyx_t_4;
        }
        if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 383, __pyx_L6_error)
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(7, 383, __pyx_L6_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_9genexpr25__pyx_v_a, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_Unicode(__pyx_9genexpr25__pyx_v_a); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 383, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyUnicode_AsEncodedString(((PyObject*)__pyx_t_6), NULL, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 383, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(7, 383, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_a); __pyx_9genexpr25__pyx_v_a = 0;
    goto __pyx_L10_exit_scope;
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_a); __pyx_9genexpr25__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":384
 *     if args is None: args = []
 *     args = [str(a).encode() for a in args]
 *     args = [a for a in args if a]             # <<<<<<<<<<<<<<
 *     c = <int> len(args)
 *     v = <char**> malloc(<size_t>(c+1)*sizeof(char*))
*/
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 384, __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(7, 384, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 384, __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_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 384, __pyx_L13_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) break;
          }
          __pyx_t_7 = __Pyx_PyList_GetItemRefFast(__pyx_t_3, __pyx_t_4, __Pyx_ReferenceSharing_OwnStrongReference);
          ++__pyx_t_4;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 384, __pyx_L13_error)
            #endif
            if (__pyx_t_4 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4));
          #else
          __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4);
          #endif
          ++__pyx_t_4;
        }
        if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 384, __pyx_L13_error)
      } else {
        __pyx_t_7 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(7, 384, __pyx_L13_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_9genexpr26__pyx_v_a, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_9genexpr26__pyx_v_a); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(7, 384, __pyx_L13_error)
      if (__pyx_t_1) {
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr26__pyx_v_a))) __PYX_ERR(7, 384, __pyx_L13_error)
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_a); __pyx_9genexpr26__pyx_v_a = 0;
    goto __pyx_L18_exit_scope;
    __pyx_L13_error:;
    __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_a); __pyx_9genexpr26__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":385
 *     args = [str(a).encode() for a in args]
 *     args = [a for a in args if a]
 *     c = <int> len(args)             # <<<<<<<<<<<<<<
 *     v = <char**> malloc(<size_t>(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(7, 385, __pyx_L1_error)
  __pyx_v_c = ((int)__pyx_t_4);

  /* "petsc4py/PETSc/PETSc.pyx":386
 *     args = [a for a in args if a]
 *     c = <int> len(args)
 *     v = <char**> malloc(<size_t>(c+1)*sizeof(char*))             # <<<<<<<<<<<<<<
 *     if v == NULL: raise MemoryError
 *     memset(v, 0, <size_t>(c+1)*sizeof(char*))
*/
  __pyx_v_v = ((char **)malloc((((size_t)(__pyx_v_c + 1)) * (sizeof(char *)))));

  /* "petsc4py/PETSc/PETSc.pyx":387
 *     c = <int> len(args)
 *     v = <char**> malloc(<size_t>(c+1)*sizeof(char*))
 *     if v == NULL: raise MemoryError             # <<<<<<<<<<<<<<
 *     memset(v, 0, <size_t>(c+1)*sizeof(char*))
 *     try:
*/
  __pyx_t_1 = (__pyx_v_v == NULL);
  if (unlikely(__pyx_t_1)) {
    PyErr_NoMemory(); __PYX_ERR(7, 387, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/PETSc.pyx":388
 *     v = <char**> malloc(<size_t>(c+1)*sizeof(char*))
 *     if v == NULL: raise MemoryError
 *     memset(v, 0, <size_t>(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":389
 *     if v == NULL: raise MemoryError
 *     memset(v, 0, <size_t>(c+1)*sizeof(char*))
 *     try:             # <<<<<<<<<<<<<<
 *         for 0 <= i < c:
 *             v[i] = strdup(args[i])
*/
  {
    __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/PETSc.pyx":390
 *     memset(v, 0, <size_t>(c+1)*sizeof(char*))
 *     try:
 *         for 0 <= i < c:             # <<<<<<<<<<<<<<
 *             v[i] = strdup(args[i])
 *             if v[i] == NULL:
*/
      __pyx_t_11 = __pyx_v_c;
      for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) {

        /* "petsc4py/PETSc/PETSc.pyx":391
 *     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_PyLong_From_int, 0, 1, 1, 1, __Pyx_ReferenceSharing_FunctionArgument); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 391, __pyx_L20_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_12 = __Pyx_PyObject_AsWritableString(__pyx_t_2); if (unlikely((!__pyx_t_12) && PyErr_Occurred())) __PYX_ERR(7, 391, __pyx_L20_error)
        (__pyx_v_v[__pyx_v_i]) = strdup(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "petsc4py/PETSc/PETSc.pyx":392
 *         for 0 <= i < c:
 *             v[i] = strdup(args[i])
 *             if v[i] == NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *     except Exception:
*/
        __pyx_t_1 = ((__pyx_v_v[__pyx_v_i]) == NULL);
        if (unlikely(__pyx_t_1)) {

          /* "petsc4py/PETSc/PETSc.pyx":393
 *             v[i] = strdup(args[i])
 *             if v[i] == NULL:
 *                 raise MemoryError             # <<<<<<<<<<<<<<
 *     except Exception:
 *         delinitargs(&c, &v); raise
*/
          PyErr_NoMemory(); __PYX_ERR(7, 393, __pyx_L20_error)

          /* "petsc4py/PETSc/PETSc.pyx":392
 *         for 0 <= i < c:
 *             v[i] = strdup(args[i])
 *             if v[i] == NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *     except Exception:
*/
        }
      }

      /* "petsc4py/PETSc/PETSc.pyx":389
 *     if v == NULL: raise MemoryError
 *     memset(v, 0, <size_t>(c+1)*sizeof(char*))
 *     try:             # <<<<<<<<<<<<<<
 *         for 0 <= i < c:
 *             v[i] = strdup(args[i])
*/
    }
    __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;
    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;

    /* "petsc4py/PETSc/PETSc.pyx":394
 *             if v[i] == NULL:
 *                 raise MemoryError
 *     except Exception:             # <<<<<<<<<<<<<<
 *         delinitargs(&c, &v); raise
 *     argc[0] = c; argv[0] = v
*/
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_11) {
      __Pyx_AddTraceback("petsc4py.PETSc.getinitargs", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_7) < 0) __PYX_ERR(7, 394, __pyx_L22_except_error)
      __Pyx_XGOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_7);

      /* "petsc4py/PETSc/PETSc.pyx":395
 *                 raise MemoryError
 *     except Exception:
 *         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_7);
      __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_7);
      __pyx_t_2 = 0;  __pyx_t_3 = 0;  __pyx_t_7 = 0; 
      __PYX_ERR(7, 395, __pyx_L22_except_error)
    }
    goto __pyx_L22_except_error;

    /* "petsc4py/PETSc/PETSc.pyx":389
 *     if v == NULL: raise MemoryError
 *     memset(v, 0, <size_t>(c+1)*sizeof(char*))
 *     try:             # <<<<<<<<<<<<<<
 *         for 0 <= i < c:
 *             v[i] = strdup(args[i])
*/
    __pyx_L22_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_L25_try_end:;
  }

  /* "petsc4py/PETSc/PETSc.pyx":396
 *     except Exception:
 *         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":397
 *         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":378
 * 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_AddTraceback("petsc4py.PETSc.getinitargs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_9genexpr25__pyx_v_a);
  __Pyx_XDECREF(__pyx_9genexpr26__pyx_v_a);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "petsc4py/PETSc/PETSc.pyx":399
 *     return 0
 * 
 * cdef void delinitargs(int *argc, char **argv[]) noexcept nogil:             # <<<<<<<<<<<<<<
 *     # deallocate 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":401
 * cdef void delinitargs(int *argc, char **argv[]) noexcept nogil:
 *     # deallocate 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":402
 *     # deallocate 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":403
 *     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":404
 *     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":405
 *     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":406
 *     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":407
 *         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":404
 *     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":399
 *     return 0
 * 
 * cdef void delinitargs(int *argc, char **argv[]) noexcept nogil:             # <<<<<<<<<<<<<<
 *     # deallocate command line arguments
 *     cdef int i, c = argc[0]
*/

  /* function exit code */
}

/* "petsc4py/PETSc/PETSc.pyx":409
 *         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":410
 * 
 * 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":414
 *     global PyPetsc_Argc, PyPetsc_Argv
 *     global PetscVFPrintf, prevfprintf
 *     delinitargs(&PyPetsc_Argc, &PyPetsc_Argv)             # <<<<<<<<<<<<<<
 *     # manage PETSc finalization
 *     if not (<int>PetscInitializeCalled): return
*/
  __pyx_f_8petsc4py_5PETSc_delinitargs((&__pyx_v_8petsc4py_5PETSc_PyPetsc_Argc), (&__pyx_v_8petsc4py_5PETSc_PyPetsc_Argv));

  /* "petsc4py/PETSc/PETSc.pyx":416
 *     delinitargs(&PyPetsc_Argc, &PyPetsc_Argv)
 *     # manage PETSc finalization
 *     if not (<int>PetscInitializeCalled): return             # <<<<<<<<<<<<<<
 *     if (<int>PetscFinalizeCalled): return
 *     # stop stdout/stderr redirect
*/
  __pyx_t_1 = (!(((int)PetscInitializeCalled) != 0));
  if (__pyx_t_1) {
    goto __pyx_L0;
  }

  /* "petsc4py/PETSc/PETSc.pyx":417
 *     # manage PETSc finalization
 *     if not (<int>PetscInitializeCalled): return
 *     if (<int>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":419
 *     if (<int>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":420
 *     # 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":421
 *     if (prevfprintf != NULL):
 *         PetscVFPrintf = prevfprintf
 *         prevfprintf = NULL             # <<<<<<<<<<<<<<
 *     # deinstall Python error handler
 *     ierr = PetscPopErrorHandler()
*/
    __pyx_v_8petsc4py_5PETSc_prevfprintf = NULL;

    /* "petsc4py/PETSc/PETSc.pyx":419
 *     if (<int>PetscFinalizeCalled): return
 *     # stop stdout/stderr redirect
 *     if (prevfprintf != NULL):             # <<<<<<<<<<<<<<
 *         PetscVFPrintf = prevfprintf
 *         prevfprintf = NULL
*/
  }

  /* "petsc4py/PETSc/PETSc.pyx":423
 *         prevfprintf = NULL
 *     # deinstall Python error handler
 *     ierr = PetscPopErrorHandler()             # <<<<<<<<<<<<<<
 *     if ierr != 0:
 *         fprintf(stderr,
*/
  __pyx_v_ierr = PetscPopErrorHandler();

  /* "petsc4py/PETSc/PETSc.pyx":424
 *     # 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":425
 *     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":424
 *     # deinstall Python error handler
 *     ierr = PetscPopErrorHandler()
 *     if ierr != 0:             # <<<<<<<<<<<<<<
 *         fprintf(stderr,
 *                 "PetscPopErrorHandler() failed "
*/
  }

  /* "petsc4py/PETSc/PETSc.pyx":429
 *                 "[error code: %d]\n", ierr)
 *     # finalize PETSc
 *     ierr = PetscFinalize()             # <<<<<<<<<<<<<<
 *     if ierr != 0:
 *         fprintf(stderr,
*/
  __pyx_v_ierr = PetscFinalize();

  /* "petsc4py/PETSc/PETSc.pyx":430
 *     # 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":431
 *     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":430
 *     # finalize PETSc
 *     ierr = PetscFinalize()
 *     if ierr != 0:             # <<<<<<<<<<<<<<
 *         fprintf(stderr,
 *                 "PetscFinalize() failed "
*/
  }

  /* "petsc4py/PETSc/PETSc.pyx":409
 *         free(v)
 * 
 * cdef void finalize() noexcept nogil:             # <<<<<<<<<<<<<<
 *     cdef int ierr = 0
 *     # deallocate command line arguments
*/

  /* function exit code */
  __pyx_L0:;
}

/* "petsc4py/PETSc/PETSc.pyx":444
 * 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[8192];
  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;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PetscErrorCode __pyx_t_8;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  __Pyx_RefNannySetupContext("PetscVFPrintf_PythonStdStream", 0);

  /* "petsc4py/PETSc/PETSc.pyx":447
 *     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_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sys, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 447, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sys = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":449
 *     import sys
 *     cdef char cstring[8192]
 *     cdef size_t stringlen = sizeof(cstring)             # <<<<<<<<<<<<<<
 *     cdef size_t final_pos = 0
 *     if (fd == PETSC_STDOUT) and not (sys.stdout == sys.__stdout__):
*/
  __pyx_v_stringlen = (sizeof(__pyx_v_cstring));

  /* "petsc4py/PETSc/PETSc.pyx":450
 *     cdef char cstring[8192]
 *     cdef size_t stringlen = sizeof(cstring)
 *     cdef size_t final_pos = 0             # <<<<<<<<<<<<<<
 *     if (fd == PETSC_STDOUT) and not (sys.stdout == sys.__stdout__):
 *         CHKERR(PetscVSNPrintf(&cstring[0], stringlen, fmt, &final_pos, ap))
*/
  __pyx_v_final_pos = 0;

  /* "petsc4py/PETSc/PETSc.pyx":451
 *     cdef size_t stringlen = sizeof(cstring)
 *     cdef size_t final_pos = 0
 *     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_4 = (__pyx_v_fd == PETSC_STDOUT);
  if (__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_mstate_global->__pyx_n_u_stdout); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_mstate_global->__pyx_n_u_stdout_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(7, 451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = (!__pyx_t_4);
  __pyx_t_3 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/PETSc.pyx":452
 *     cdef size_t final_pos = 0
 *     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_8 = __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_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 452, __pyx_L1_error)

    /* "petsc4py/PETSc/PETSc.pyx":453
 *     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_7 = (__pyx_v_final_pos > 0);
    if (__pyx_t_7) {
    } else {
      __pyx_t_3 = __pyx_t_7;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_7 = ((__pyx_v_cstring[(__pyx_v_final_pos - 1)]) == '\x00');
    __pyx_t_3 = __pyx_t_7;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_3) {

      /* "petsc4py/PETSc/PETSc.pyx":454
 *         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":453
 *     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":455
 *         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_6 = __Pyx_decode_c_string(__pyx_v_cstring, 0, __pyx_v_final_pos, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_ustring = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "petsc4py/PETSc/PETSc.pyx":456
 *             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_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_mstate_global->__pyx_n_u_stdout); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __pyx_t_1;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_ustring};
      __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 456, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "petsc4py/PETSc/PETSc.pyx":451
 *     cdef size_t stringlen = sizeof(cstring)
 *     cdef size_t final_pos = 0
 *     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":457
 *         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_7 = (__pyx_v_fd == PETSC_STDERR);
  if (__pyx_t_7) {
  } else {
    __pyx_t_3 = __pyx_t_7;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_mstate_global->__pyx_n_u_stderr); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_mstate_global->__pyx_n_u_stderr_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(7, 457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_4 = (!__pyx_t_7);
  __pyx_t_3 = __pyx_t_4;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_3) {

    /* "petsc4py/PETSc/PETSc.pyx":458
 *         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_8 = __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_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 458, __pyx_L1_error)

    /* "petsc4py/PETSc/PETSc.pyx":459
 *     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_4 = (__pyx_v_final_pos > 0);
    if (__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L12_bool_binop_done;
    }
    __pyx_t_4 = ((__pyx_v_cstring[(__pyx_v_final_pos - 1)]) == '\x00');
    __pyx_t_3 = __pyx_t_4;
    __pyx_L12_bool_binop_done:;
    if (__pyx_t_3) {

      /* "petsc4py/PETSc/PETSc.pyx":460
 *         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":459
 *     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":461
 *         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_5 = __Pyx_decode_c_string(__pyx_v_cstring, 0, __pyx_v_final_pos, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_ustring = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "petsc4py/PETSc/PETSc.pyx":462
 *             final_pos -= 1
 *         ustring = cstring[:final_pos].decode('UTF-8')
 *         sys.stderr.write(ustring)             # <<<<<<<<<<<<<<
 *     else:
 *         CHKERR(PetscVFPrintfDefault(fd, fmt, ap))
*/
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_mstate_global->__pyx_n_u_stderr); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __pyx_t_6;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = 0;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_ustring};
      __pyx_t_5 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_write, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 462, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "petsc4py/PETSc/PETSc.pyx":457
 *         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":464
 *         sys.stderr.write(ustring)
 *     else:
 *         CHKERR(PetscVFPrintfDefault(fd, fmt, ap))             # <<<<<<<<<<<<<<
 *     return PETSC_SUCCESS
 * 
*/
  /*else*/ {
    __pyx_t_8 = __pyx_f_8petsc4py_5PETSc_CHKERR(PetscVFPrintfDefault(__pyx_v_fd, __pyx_v_fmt, __pyx_v_ap)); if (unlikely(__pyx_t_8 == ((PetscErrorCode)PETSC_ERR_PYTHON))) __PYX_ERR(7, 464, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "petsc4py/PETSc/PETSc.pyx":465
 *     else:
 *         CHKERR(PetscVFPrintfDefault(fd, fmt, ap))
 *     return PETSC_SUCCESS             # <<<<<<<<<<<<<<
 * 
 * cdef int _push_vfprintf(
*/
  __pyx_r = PETSC_SUCCESS;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PETSc.pyx":444
 * 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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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();
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  return __pyx_r;
}

/* "petsc4py/PETSc/PETSc.pyx":467
 *     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":471
 * ) 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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(7, 471, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(7, 471, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/PETSc.pyx":472
 *     global PetscVFPrintf, prevfprintf
 *     assert prevfprintf == NULL
 *     prevfprintf = PetscVFPrintf             # <<<<<<<<<<<<<<
 *     PetscVFPrintf = vfprintf
 * 
*/
  __pyx_v_8petsc4py_5PETSc_prevfprintf = PetscVFPrintf;

  /* "petsc4py/PETSc/PETSc.pyx":473
 *     assert prevfprintf == NULL
 *     prevfprintf = PetscVFPrintf
 *     PetscVFPrintf = vfprintf             # <<<<<<<<<<<<<<
 * 
 * cdef int _pop_vfprintf() except -1:
*/
  PetscVFPrintf = __pyx_v_vfprintf;

  /* "petsc4py/PETSc/PETSc.pyx":467
 *     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":475
 *     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":477
 * 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(((PyObject *)(((PyTypeObject*)PyExc_AssertionError))), 0, 0, 0);
      __PYX_ERR(7, 477, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(7, 477, __pyx_L1_error)
  #endif

  /* "petsc4py/PETSc/PETSc.pyx":478
 *     global PetscVFPrintf, prevfprintf
 *     assert prevfprintf != NULL
 *     PetscVFPrintf = prevfprintf             # <<<<<<<<<<<<<<
 *     prevfprintf == NULL
 * 
*/
  PetscVFPrintf = __pyx_v_8petsc4py_5PETSc_prevfprintf;

  /* "petsc4py/PETSc/PETSc.pyx":479
 *     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":475
 *     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":481
 *     prevfprintf == NULL
 * 
 * cdef int initialize(object args, object comm) except -1:             # <<<<<<<<<<<<<<
 *     if (<int>PetscInitializeCalled): return 1
 *     if (<int>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;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("initialize", 0);

  /* "petsc4py/PETSc/PETSc.pyx":482
 * 
 * cdef int initialize(object args, object comm) except -1:
 *     if (<int>PetscInitializeCalled): return 1             # <<<<<<<<<<<<<<
 *     if (<int>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":483
 * cdef int initialize(object args, object comm) except -1:
 *     if (<int>PetscInitializeCalled): return 1
 *     if (<int>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":486
 *     # 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(7, 486, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":489
 *     # 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 const )MPI_COMM_NULL) && PyErr_Occurred())) __PYX_ERR(7, 489, __pyx_L1_error)
  PETSC_COMM_WORLD = __pyx_t_3;

  /* "petsc4py/PETSc/PETSc.pyx":491
 *     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(7, 491, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":493
 *     CHKERR(PetscInitialize(&PyPetsc_Argc, &PyPetsc_Argv, NULL, NULL))
 *     # install Python error handler
 *     cdef PetscErrorHandlerFunction handler = NULL             # <<<<<<<<<<<<<<
 *     handler = <PetscErrorHandlerFunction>PetscPythonErrorHandler
 *     CHKERR(PetscPushErrorHandler(handler, NULL))
*/
  __pyx_v_handler = NULL;

  /* "petsc4py/PETSc/PETSc.pyx":494
 *     # install Python error handler
 *     cdef PetscErrorHandlerFunction handler = NULL
 *     handler = <PetscErrorHandlerFunction>PetscPythonErrorHandler             # <<<<<<<<<<<<<<
 *     CHKERR(PetscPushErrorHandler(handler, NULL))
 *     # redirect PETSc std streams
*/
  __pyx_v_handler = ((PetscErrorHandlerFunction)__pyx_f_8petsc4py_5PETSc_PetscPythonErrorHandler);

  /* "petsc4py/PETSc/PETSc.pyx":495
 *     cdef PetscErrorHandlerFunction handler = NULL
 *     handler = <PetscErrorHandlerFunction>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(7, 495, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":497
 *     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_6 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_sys, 0, 0, NULL, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 497, __pyx_L1_error)
  __pyx_t_5 = __pyx_t_6;
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v_sys = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":498
 *     # 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_mstate_global->__pyx_n_u_stdout); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_mstate_global->__pyx_n_u_stdout_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyObject_RichCompare(__pyx_t_5, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 498, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(7, 498, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (!__pyx_t_9) {
  } else {
    __pyx_t_1 = __pyx_t_9;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_mstate_global->__pyx_n_u_stderr); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_sys, __pyx_mstate_global->__pyx_n_u_stderr_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_8, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 498, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(7, 498, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __pyx_t_9;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_1) {

    /* "petsc4py/PETSc/PETSc.pyx":499
 *     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(7, 499, __pyx_L1_error)

    /* "petsc4py/PETSc/PETSc.pyx":498
 *     # 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":501
 *         _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":502
 *     # 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":501
 *         _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":504
 *         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":481
 *     prevfprintf == NULL
 * 
 * cdef int initialize(object args, object comm) except -1:             # <<<<<<<<<<<<<<
 *     if (<int>PetscInitializeCalled): return 1
 *     if (<int>PetscFinalizeCalled):   return 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __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":551
 * """
 * 
 * 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":553
 * 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":554
 *     global registercalled
 *     if registercalled: return 0
 *     registercalled = True             # <<<<<<<<<<<<<<
 *     # register citation
 *     CHKERR(PetscCitationsRegister(citation, NULL))
*/
  __pyx_v_8petsc4py_5PETSc_registercalled = 1;

  /* "petsc4py/PETSc/PETSc.pyx":556
 *     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(7, 556, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":558
 *     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(7, 558, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":560
 *     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(7, 560, __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(7, 560, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":562
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 562, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":563
 *     # 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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 563, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":564
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 564, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":565
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 565, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":566
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 566, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":567
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 567, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":568
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 568, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":569
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 569, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":570
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 570, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":571
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 571, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":572
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 572, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":573
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 573, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":574
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 574, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":575
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 575, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":576
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 576, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":577
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 577, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":578
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 578, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":579
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 579, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":580
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 580, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":581
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_AO); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 581, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":582
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 582, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":583
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 583, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":584
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 584, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":585
 *     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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 585, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":586
 *     PyPetscType_Register(PETSC_FE_CLASSID,               FE)
 *     PyPetscType_Register(PETSC_DMLABEL_CLASSID,          DMLabel)
 *     PyPetscType_Register(PETSC_SPACE_CLASSID,            Space)             # <<<<<<<<<<<<<<
 *     PyPetscType_Register(PETSC_DUALSPACE_CLASSID,        DualSpace)
 *     PyPetscType_Register(PETSC_REGRESSOR_CLASSID,        Regressor)
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSCSPACE_CLASSID, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 586, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":587
 *     PyPetscType_Register(PETSC_DMLABEL_CLASSID,          DMLabel)
 *     PyPetscType_Register(PETSC_SPACE_CLASSID,            Space)
 *     PyPetscType_Register(PETSC_DUALSPACE_CLASSID,        DualSpace)             # <<<<<<<<<<<<<<
 *     PyPetscType_Register(PETSC_REGRESSOR_CLASSID,        Regressor)
 *     return 0 # and we are done, enjoy !!
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSCDUALSPACE_CLASSID, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 587, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":588
 *     PyPetscType_Register(PETSC_SPACE_CLASSID,            Space)
 *     PyPetscType_Register(PETSC_DUALSPACE_CLASSID,        DualSpace)
 *     PyPetscType_Register(PETSC_REGRESSOR_CLASSID,        Regressor)             # <<<<<<<<<<<<<<
 *     return 0 # and we are done, enjoy !!
 * 
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_PyPetscType_Register(PETSCREGRESSOR_CLASSID, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 588, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":589
 *     PyPetscType_Register(PETSC_DUALSPACE_CLASSID,        DualSpace)
 *     PyPetscType_Register(PETSC_REGRESSOR_CLASSID,        Regressor)
 *     return 0 # and we are done, enjoy !!             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_r = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PETSc.pyx":551
 * """
 * 
 * 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":594
 * 
 * 
 * def _initialize(args=None, comm=None):             # <<<<<<<<<<<<<<
 *     import atexit
 *     global PetscError
*/

/* 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:594");
static PyMethodDef __pyx_mdef_8petsc4py_5PETSc_5_initialize = {"_initialize", (PyCFunction)(void(*)(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_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_args,&__pyx_mstate_global->__pyx_n_u_comm,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len < 0)) __PYX_ERR(7, 594, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(7, 594, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 594, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_initialize", 0) < (0)) __PYX_ERR(7, 594, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(7, 594, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(7, 594, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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(7, 594, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(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;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_initialize", 0);

  /* "petsc4py/PETSc/PETSc.pyx":595
 * 
 * def _initialize(args=None, comm=None):
 *     import atexit             # <<<<<<<<<<<<<<
 *     global PetscError
 *     PetscError = Error
*/
  __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_atexit, 0, 0, NULL, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 595, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_atexit = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":597
 *     import atexit
 *     global PetscError
 *     PetscError = Error             # <<<<<<<<<<<<<<
 *     #
 *     cdef int ready = initialize(args, comm)
*/
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 597, __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":599
 *     PetscError = Error
 *     #
 *     cdef int ready = initialize(args, comm)             # <<<<<<<<<<<<<<
 *     if ready: register()
 *     #
*/
  __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_initialize(__pyx_v_args, __pyx_v_comm); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 599, __pyx_L1_error)
  __pyx_v_ready = __pyx_t_3;

  /* "petsc4py/PETSc/PETSc.pyx":600
 *     #
 *     cdef int ready = initialize(args, comm)
 *     if ready: register()             # <<<<<<<<<<<<<<
 *     #
 *     global __COMM_SELF__, __COMM_WORLD__
*/
  __pyx_t_4 = (__pyx_v_ready != 0);
  if (__pyx_t_4) {
    __pyx_t_3 = __pyx_f_8petsc4py_5PETSc_register(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 600, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/PETSc.pyx":603
 *     #
 *     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":604
 *     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":607
 *     #
 *     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":609
 *     PETSC_COMM_DEFAULT = PETSC_COMM_WORLD
 *     # Register finalizer
 *     atexit.register(_pre_finalize)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_5 = __pyx_v_atexit;
  __Pyx_INCREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_pre_finalize); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":594
 * 
 * 
 * def _initialize(args=None, comm=None):             # <<<<<<<<<<<<<<
 *     import atexit
 *     global PetscError
*/

  /* 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_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":612
 * 
 * 
 * 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:612");
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;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_pre_finalize", 0);

  /* "petsc4py/PETSc/PETSc.pyx":614
 * def _pre_finalize():
 *     # Called while the Python interpreter is still running
 *     garbage_cleanup()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_garbage_cleanup); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":612
 * 
 * 
 * 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":617
 * 
 * 
 * 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:617");
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", 0);

  /* "petsc4py/PETSc/PETSc.pyx":618
 * 
 * def _finalize():
 *     finalize()             # <<<<<<<<<<<<<<
 *     #
 *     global __COMM_SELF__
*/
  __pyx_f_8petsc4py_5PETSc_finalize();

  /* "petsc4py/PETSc/PETSc.pyx":621
 *     #
 *     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":623
 *     __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":626
 *     #
 *     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":629
 *     #
 *     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(7, 629, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_8petsc4py_5PETSc_type_registry); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 629, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":631
 *     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(7, 631, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_8petsc4py_5PETSc_stage_registry); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 631, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":633
 *     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(7, 633, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_8petsc4py_5PETSc_class_registry); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 633, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":635
 *     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(7, 635, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_8petsc4py_5PETSc_event_registry); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 635, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":637
 *     event_registry.clear()
 *     global citations_registry
 *     citations_registry.clear()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (unlikely(__pyx_v_8petsc4py_5PETSc_citations_registry == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
    __PYX_ERR(7, 637, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_Clear(__pyx_v_8petsc4py_5PETSc_citations_registry); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 637, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":617
 * 
 * 
 * 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":640
 * 
 * 
 * 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:640");
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", 0);

  /* "petsc4py/PETSc/PETSc.pyx":641
 * 
 * def _push_python_vfprintf():
 *     _push_vfprintf(&PetscVFPrintf_PythonStdStream)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc__push_vfprintf((&__pyx_f_8petsc4py_5PETSc_PetscVFPrintf_PythonStdStream)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 641, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":640
 * 
 * 
 * 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":644
 * 
 * 
 * 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:644");
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", 0);

  /* "petsc4py/PETSc/PETSc.pyx":645
 * 
 * def _pop_python_vfprintf():
 *     _pop_vfprintf()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_1 = __pyx_f_8petsc4py_5PETSc__pop_vfprintf(); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 645, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":644
 * 
 * 
 * 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":648
 * 
 * 
 * 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:648");
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", 0);

  /* "petsc4py/PETSc/PETSc.pyx":650
 * 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(7, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "petsc4py/PETSc/PETSc.pyx":648
 * 
 * 
 * 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;
}
/* #### Code section: module_exttypes ### */

static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Comm(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyPetscCommObject *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  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(__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_DeallocKeepAliveBegin(o);
    __pyx_pw_8petsc4py_5PETSc_4Comm_3__dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->base);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_8petsc4py_5PETSc_Comm(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyPetscCommObject *p = (struct PyPetscCommObject *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_9destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_8destroy},
  {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_11duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_10duplicate},
  {"getSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_13getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_12getSize},
  {"getRank", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_15getRank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_14getRank},
  {"barrier", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Comm_17barrier, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Comm_16barrier},
  {"tompi4py", (PyCFunction)(void(*)(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[] = {
  {"size", __pyx_getprop_8petsc4py_5PETSc_4Comm_size, 0, PyDoc_STR("Comm.size: int\nCommunicator size.\nSource code at petsc4py/PETSc/Comm.pyx:135"), 0},
  {"rank", __pyx_getprop_8petsc4py_5PETSc_4Comm_rank, 0, PyDoc_STR("Comm.rank: int\nCommunicator rank.\nSource code at petsc4py/PETSc/Comm.pyx:140"), 0},
  {"fortran", __pyx_getprop_8petsc4py_5PETSc_4Comm_fortran, 0, 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*/
  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*/
  0, /*nb_int*/
  0, /*nb_long (reserved)*/
  0, /*nb_float*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  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*/
  0, /*nb_matrix_multiply*/
  0, /*nb_inplace_matrix_multiply*/
};

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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct PyPetscObjectObject *)o);
  p->__pyx_vtab = __pyx_vtabptr_8petsc4py_5PETSc_Object;
  p->__dummy__ = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_8petsc4py_5PETSc_6Object_1__cinit__(o, __pyx_mstate_global->__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(__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_DeallocKeepAliveBegin(o);
    __pyx_pw_8petsc4py_5PETSc_6Object_3__dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->__dummy__);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static int __pyx_tp_traverse_8petsc4py_5PETSc_Object(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyPetscObjectObject *p = (struct PyPetscObjectObject *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->__dummy__) {
    e = (*v)(p->__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->__dummy__);
  p->__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_id(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8petsc4py_5PETSc_6Object_2id_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(*)(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(*)(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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_13view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_12view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_15destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_14destroy},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_17getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_16getType},
  {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_19setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_18setOptionsPrefix},
  {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_21getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_20getOptionsPrefix},
  {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_23appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_22appendOptionsPrefix},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_25setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_24setFromOptions},
  {"viewFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_27viewFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_26viewFromOptions},
  {"setOptionsHandler", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_29setOptionsHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_28setOptionsHandler},
  {"destroyOptionsHandlers", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_31destroyOptionsHandlers, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_30destroyOptionsHandlers},
  {"getComm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_33getComm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_32getComm},
  {"getName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_35getName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_34getName},
  {"setName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_37setName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_36setName},
  {"getClassId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_39getClassId, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_38getClassId},
  {"getClassName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_41getClassName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_40getClassName},
  {"getRefCount", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_43getRefCount, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_42getRefCount},
  {"getId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_45getId, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_44getId},
  {"compose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_47compose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_46compose},
  {"query", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_49query, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_48query},
  {"incRef", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_51incRef, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_50incRef},
  {"decRef", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_53decRef, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_52decRef},
  {"getAttr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_55getAttr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_54getAttr},
  {"setAttr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_57setAttr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_56setAttr},
  {"getDict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_59getDict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_58getDict},
  {"stateIncrease", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_61stateIncrease, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_60stateIncrease},
  {"stateGet", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_63stateGet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_62stateGet},
  {"stateSet", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_65stateSet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_64stateSet},
  {"incrementTabLevel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_67incrementTabLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_66incrementTabLevel},
  {"setTabLevel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_69setTabLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_68setTabLevel},
  {"getTabLevel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Object_71getTabLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Object_70getTabLevel},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Object[] = {
  {"type", __pyx_getprop_8petsc4py_5PETSc_6Object_type, __pyx_setprop_8petsc4py_5PETSc_6Object_type, PyDoc_STR("Object.type: str\nObject type.\nSource code at petsc4py/PETSc/Object.pyx:534"), 0},
  {"prefix", __pyx_getprop_8petsc4py_5PETSc_6Object_prefix, __pyx_setprop_8petsc4py_5PETSc_6Object_prefix, PyDoc_STR("Object.prefix: str\nOptions prefix.\nSource code at petsc4py/PETSc/Object.pyx:542"), 0},
  {"comm", __pyx_getprop_8petsc4py_5PETSc_6Object_comm, 0, PyDoc_STR("Object.comm: Comm\nThe object communicator.\nSource code at petsc4py/PETSc/Object.pyx:550"), 0},
  {"name", __pyx_getprop_8petsc4py_5PETSc_6Object_name, __pyx_setprop_8petsc4py_5PETSc_6Object_name, PyDoc_STR("Object.name: str\nThe object name.\nSource code at petsc4py/PETSc/Object.pyx:555"), 0},
  {"classid", __pyx_getprop_8petsc4py_5PETSc_6Object_classid, 0, PyDoc_STR("Object.classid: int\nThe class identifier.\nSource code at petsc4py/PETSc/Object.pyx:563"), 0},
  {"id", __pyx_getprop_8petsc4py_5PETSc_6Object_id, 0, PyDoc_STR("Object.id: int\nThe object identifier.\nSource code at petsc4py/PETSc/Object.pyx:568"), 0},
  {"klass", __pyx_getprop_8petsc4py_5PETSc_6Object_klass, 0, PyDoc_STR("Object.klass: str\nThe class name.\nSource code at petsc4py/PETSc/Object.pyx:573"), 0},
  {"refcount", __pyx_getprop_8petsc4py_5PETSc_6Object_refcount, 0, PyDoc_STR("Object.refcount: int\nReference count.\nSource code at petsc4py/PETSc/Object.pyx:578"), 0},
  {"handle", __pyx_getprop_8petsc4py_5PETSc_6Object_handle, 0, PyDoc_STR("Object.handle: int\nHandle for ctypes support.\nSource code at petsc4py/PETSc/Object.pyx:585"), 0},
  {"fortran", __pyx_getprop_8petsc4py_5PETSc_6Object_fortran, 0, PyDoc_STR("Object.fortran: int\nFortran handle.\nSource code at petsc4py/PETSc/Object.pyx:593"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyMemberDef PyPetscObject_Type_members[] = {
  #if !CYTHON_USE_TYPE_SLOTS
  {"__weaklistoffset__", T_PYSSIZET, offsetof(struct PyPetscObjectObject, __weakref__), READONLY, 0},
  #endif
  {0, 0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
#if defined(__GNUC__) || defined(__clang__)
#warning "petsc4py/PETSc.pxd:133:9: : __weakref__ is unsupported in the Limited API when running on Python <3.9."
#elif defined(_MSC_VER)
#pragma message("petsc4py/PETSc.pxd:133:9: : __weakref__ is unsupported in the Limited API when running on Python <3.9.")
#endif
#endif
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_doc, (void *)PyDoc_STR("Base class wrapping a PETSc object.\n\n    See Also\n    --------\n    petsc.PetscObject\n\n    ")},
  {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},
  {Py_tp_members, (void*)PyPetscObject_Type_members},
  {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*/
  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*/
  0, /*nb_int*/
  0, /*nb_long (reserved)*/
  0, /*nb_float*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  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*/
  0, /*nb_matrix_multiply*/
  0, /*nb_inplace_matrix_multiply*/
};

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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("Base class wrapping a PETSc object.\n\n    See Also\n    --------\n    petsc.PetscObject\n\n    "), /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_4view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_6destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_8create},
  {"createASCII", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_11createASCII, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_10createASCII},
  {"createBinary", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_13createBinary, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_12createBinary},
  {"createMPIIO", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_15createMPIIO, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_14createMPIIO},
  {"createVTK", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_17createVTK, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_16createVTK},
  {"createHDF5", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_19createHDF5, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_18createHDF5},
  {"createDraw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_21createDraw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_20createDraw},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_23setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_22setType},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_25getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_24getType},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_27setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_26setFromOptions},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_29setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_28setUp},
  {"getFormat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_31getFormat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_30getFormat},
  {"pushFormat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_33pushFormat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_32pushFormat},
  {"popFormat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_35popFormat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_34popFormat},
  {"getSubViewer", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_37getSubViewer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_36getSubViewer},
  {"restoreSubViewer", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_39restoreSubViewer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_38restoreSubViewer},
  {"STDOUT", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_41STDOUT, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_40STDOUT},
  {"STDERR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_43STDERR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_42STDERR},
  {"ASCII", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_45ASCII, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_44ASCII},
  {"BINARY", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_47BINARY, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_46BINARY},
  {"DRAW", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_49DRAW, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_48DRAW},
  {"setASCIITab", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_51setASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_50setASCIITab},
  {"getASCIITab", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_53getASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_52getASCIITab},
  {"addASCIITab", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_55addASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_54addASCIITab},
  {"subtractASCIITab", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_57subtractASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_56subtractASCIITab},
  {"pushASCIISynchronized", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_59pushASCIISynchronized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_58pushASCIISynchronized},
  {"popASCIISynchronized", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_61popASCIISynchronized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_60popASCIISynchronized},
  {"pushASCIITab", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_63pushASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_62pushASCIITab},
  {"popASCIITab", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_65popASCIITab, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_64popASCIITab},
  {"useASCIITabs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_67useASCIITabs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_66useASCIITabs},
  {"printfASCII", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_69printfASCII, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_68printfASCII},
  {"printfASCIISynchronized", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_71printfASCIISynchronized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_70printfASCIISynchronized},
  {"flush", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_73flush, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_72flush},
  {"setFileMode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_75setFileMode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_74setFileMode},
  {"getFileMode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_77getFileMode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_76getFileMode},
  {"setFileName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_79setFileName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_78setFileName},
  {"getFileName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_81getFileName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_80getFileName},
  {"setDrawInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_83setDrawInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_82setDrawInfo},
  {"clearDraw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_85clearDraw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_84clearDraw},
  {"createPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_87createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_86createPython},
  {"setPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_89setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_88setPythonContext},
  {"getPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_91getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_90getPythonContext},
  {"setPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_93setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_92setPythonType},
  {"getPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_95getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_94getPythonType},
  {"viewObjectPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Viewer_97viewObjectPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Viewer_96viewObjectPython},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscViewer_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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 <petsc:sec_viewers>`.\n\n    Viewers can be called as functions where the argument specified\n    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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 <petsc:sec_viewers>`.\n\n    Viewers can be called as functions where the argument specified\n    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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_4view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_6destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_8create},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_10setType},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_12getType},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_15setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_14setFromOptions},
  {"getValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_17getValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_16getValue},
  {"getValueReal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_19getValueReal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_18getValueReal},
  {"getSeed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_21getSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_20getSeed},
  {"setSeed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_23setSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_22setSeed},
  {"getInterval", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Random_25getInterval, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Random_24getInterval},
  {"setInterval", (PyCFunction)(void(*)(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[] = {
  {"seed", __pyx_getprop_8petsc4py_5PETSc_6Random_seed, __pyx_setprop_8petsc4py_5PETSc_6Random_seed, PyDoc_STR("Random.seed: int\nThe seed of the random number generator.\nSource code at petsc4py/PETSc/Random.pyx:233"), 0},
  {"interval", __pyx_getprop_8petsc4py_5PETSc_6Random_interval, __pyx_setprop_8petsc4py_5PETSc_6Random_interval, PyDoc_STR("Random.interval: tuple[Scalar, Scalar]\nThe interval of the generated random numbers.\nSource code at petsc4py/PETSc/Random.pyx:241"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscRandom_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_8petsc4py_5PETSc_6Device_1__cinit__(o, __pyx_mstate_global->__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(__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_DeallocKeepAliveBegin(o);
    __pyx_pw_8petsc4py_5PETSc_6Device_3__dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    PyErr_Restore(etype, eval, etb);
  }
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_4create},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_6destroy},
  {"configure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_9configure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_8configure},
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_11view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_10view},
  {"getDeviceType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_13getDeviceType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_12getDeviceType},
  {"getDeviceId", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6Device_15getDeviceId, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6Device_14getDeviceId},
  {"setDefaultType", (PyCFunction)(void(*)(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[] = {
  {"type", __pyx_getprop_8petsc4py_5PETSc_6Device_type, 0, PyDoc_STR("Device.type: str\nThe device type.\nSource code at petsc4py/PETSc/Device.pyx:210"), 0},
  {"device_id", __pyx_getprop_8petsc4py_5PETSc_6Device_device_id, 0, PyDoc_STR("Device.device_id: int\nThe device id.\nSource code at petsc4py/PETSc/Device.pyx:215"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyMemberDef PyPetscDevice_Type_members[] = {
  #if !CYTHON_USE_TYPE_SLOTS
  {"__weaklistoffset__", T_PYSSIZET, offsetof(struct PyPetscDeviceObject, __weakref__), READONLY, 0},
  #endif
  {0, 0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
#if defined(__GNUC__) || defined(__clang__)
#warning "petsc4py/PETSc.pxd:158:16: : __weakref__ is unsupported in the Limited API when running on Python <3.9."
#elif defined(_MSC_VER)
#pragma message("petsc4py/PETSc.pxd:158:16: : __weakref__ is unsupported in the Limited API when running on Python <3.9.")
#endif
#endif
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},
  {Py_tp_members, (void*)PyPetscDevice_Type_members},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_3create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_2create},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_4destroy},
  {"getStreamType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_7getStreamType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_6getStreamType},
  {"setStreamType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_9setStreamType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_8setStreamType},
  {"getDevice", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_11getDevice, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_10getDevice},
  {"setDevice", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_13setDevice, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_12setDevice},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_15setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_14setUp},
  {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_17duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_16duplicate},
  {"idle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_19idle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_18idle},
  {"waitFor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_21waitFor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_20waitFor},
  {"fork", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_23fork, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_22fork},
  {"join", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_25join, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_24join},
  {"synchronize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_27synchronize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_26synchronize},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_29setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_28setFromOptions},
  {"getCurrent", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13DeviceContext_31getCurrent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13DeviceContext_30getCurrent},
  {"setCurrent", (PyCFunction)(void(*)(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[] = {
  {"stream_type", __pyx_getprop_8petsc4py_5PETSc_13DeviceContext_stream_type, __pyx_setprop_8petsc4py_5PETSc_13DeviceContext_stream_type, PyDoc_STR("DeviceContext.stream_type: str\nThe stream type.\nSource code at petsc4py/PETSc/Device.pyx:558"), 0},
  {"device", __pyx_getprop_8petsc4py_5PETSc_13DeviceContext_device, __pyx_setprop_8petsc4py_5PETSc_13DeviceContext_device, PyDoc_STR("DeviceContext.device: Device\nThe device associated to the device context.\nSource code at petsc4py/PETSc/Device.pyx:566"), 0},
  {"current", __pyx_getprop_8petsc4py_5PETSc_13DeviceContext_current, __pyx_setprop_8petsc4py_5PETSc_13DeviceContext_current, PyDoc_STR("DeviceContext.current: DeviceContext\nThe current global device context.\nSource code at petsc4py/PETSc/Device.pyx:574"), 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_Object},
  {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_Object, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(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(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_9__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_8__exit__},
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_11view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_10view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_13destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_12destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_15create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_14create},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_17setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_16setType},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_19getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_18getType},
  {"createGeneral", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_21createGeneral, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_20createGeneral},
  {"createBlock", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_23createBlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_22createBlock},
  {"createStride", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_25createStride, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_24createStride},
  {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_27duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_26duplicate},
  {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_29copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_28copy},
  {"load", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_31load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_30load},
  {"allGather", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_33allGather, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_32allGather},
  {"toGeneral", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_35toGeneral, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_34toGeneral},
  {"buildTwoSided", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_37buildTwoSided, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_36buildTwoSided},
  {"invertPermutation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_39invertPermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_38invertPermutation},
  {"partitioningToNumbering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_41partitioningToNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_40partitioningToNumbering},
  {"partitioningCount", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_43partitioningCount, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_42partitioningCount},
  {"getSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_45getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_44getSize},
  {"getLocalSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_47getLocalSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_46getLocalSize},
  {"getSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_49getSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_48getSizes},
  {"getBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_51getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_50getBlockSize},
  {"setBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_53setBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_52setBlockSize},
  {"sort", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_55sort, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_54sort},
  {"isSorted", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_57isSorted, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_56isSorted},
  {"setPermutation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_59setPermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_58setPermutation},
  {"isPermutation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_61isPermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_60isPermutation},
  {"setIdentity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_63setIdentity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_62setIdentity},
  {"isIdentity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_65isIdentity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_64isIdentity},
  {"equal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_67equal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_66equal},
  {"sum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_69sum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_68sum},
  {"expand", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_71expand, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_70expand},
  {"union", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_73union, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_72union},
  {"intersect", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_75intersect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_74intersect},
  {"difference", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_77difference, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_76difference},
  {"complement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_79complement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_78complement},
  {"embed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_81embed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_80embed},
  {"renumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_83renumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_82renumber},
  {"setIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_85setIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_84setIndices},
  {"getIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_87getIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_86getIndices},
  {"setBlockIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_89setBlockIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_88setBlockIndices},
  {"getBlockIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_91getBlockIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_90getBlockIndices},
  {"setStride", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_93setStride, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_92setStride},
  {"getStride", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_95getStride, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_94getStride},
  {"getInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2IS_97getInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2IS_96getInfo},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_IS[] = {
  {"permutation", __pyx_getprop_8petsc4py_5PETSc_2IS_permutation, 0, 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:999"), 0},
  {"identity", __pyx_getprop_8petsc4py_5PETSc_2IS_identity, 0, 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:1012"), 0},
  {"sorted", __pyx_getprop_8petsc4py_5PETSc_2IS_sorted, 0, 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:1025"), 0},
  {"sizes", __pyx_getprop_8petsc4py_5PETSc_2IS_sizes, 0, 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:1040"), 0},
  {"size", __pyx_getprop_8petsc4py_5PETSc_2IS_size, 0, 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:1053"), 0},
  {"local_size", __pyx_getprop_8petsc4py_5PETSc_2IS_local_size, 0, 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:1066"), 0},
  {"block_size", __pyx_getprop_8petsc4py_5PETSc_2IS_block_size, 0, 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:1079"), 0},
  {"indices", __pyx_getprop_8petsc4py_5PETSc_2IS_indices, 0, 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:1092"), 0},
  {"array", __pyx_getprop_8petsc4py_5PETSc_2IS_array, 0, 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:1105"), 0},
  {"__array_interface__", __pyx_getprop_8petsc4py_5PETSc_2IS___array_interface__, 0, 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 = {
  __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[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  #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 = {
  __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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_5setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_4setType},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_7setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_6setFromOptions},
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_9view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_8view},
  {"load", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_11load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_10load},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_13destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_12destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_15create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_14create},
  {"createIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_17createIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_16createIS},
  {"createSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_19createSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_18createSF},
  {"getSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_21getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_20getSize},
  {"getBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_23getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_22getBlockSize},
  {"getIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_25getIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_24getIndices},
  {"getBlockIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_27getBlockIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_26getBlockIndices},
  {"getInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_29getInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_28getInfo},
  {"getBlockInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_31getBlockInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_30getBlockInfo},
  {"apply", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_33apply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_32apply},
  {"applyBlock", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_35applyBlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_34applyBlock},
  {"applyIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_37applyIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_36applyIS},
  {"applyInverse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_39applyInverse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_38applyInverse},
  {"applyBlockInverse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5LGMap_41applyBlockInverse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5LGMap_40applyBlockInverse},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_LGMap[] = {
  {"size", __pyx_getprop_8petsc4py_5PETSc_5LGMap_size, 0, 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:1673"), 0},
  {"block_size", __pyx_getprop_8petsc4py_5PETSc_5LGMap_block_size, 0, 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:1686"), 0},
  {"indices", __pyx_getprop_8petsc4py_5PETSc_5LGMap_indices, 0, 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:1699"), 0},
  {"block_indices", __pyx_getprop_8petsc4py_5PETSc_5LGMap_block_indices, 0, 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:1712"), 0},
  {"info", __pyx_getprop_8petsc4py_5PETSc_5LGMap_info, 0, 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:1725"), 0},
  {"block_info", __pyx_getprop_8petsc4py_5PETSc_5LGMap_block_info, 0, 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:1738"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscLGMap_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {Py_tp_call, (void *)__pyx_pw_8petsc4py_5PETSc_5LGMap_3__call__},
  {Py_tp_doc, (void *)PyDoc_STR("Mapping from a local to a global ordering.\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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 a local to a global ordering.\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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyMethodDef __pyx_methods_8petsc4py_5PETSc_SF[] = {
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_2view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_4destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_6create},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_8setType},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_10getType},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_13setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_12setFromOptions},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_15setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_14setUp},
  {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_17reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_16reset},
  {"getGraph", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_19getGraph, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_18getGraph},
  {"setGraph", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_21setGraph, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_20setGraph},
  {"setRankOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_23setRankOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_22setRankOrder},
  {"getMulti", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_25getMulti, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_24getMulti},
  {"createInverse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_27createInverse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_26createInverse},
  {"computeDegree", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_29computeDegree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_28computeDegree},
  {"createEmbeddedRootSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_31createEmbeddedRootSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_30createEmbeddedRootSF},
  {"createEmbeddedLeafSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_33createEmbeddedLeafSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_32createEmbeddedLeafSF},
  {"createSectionSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_35createSectionSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_34createSectionSF},
  {"distributeSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_37distributeSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_36distributeSection},
  {"compose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_39compose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_38compose},
  {"bcastBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_41bcastBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_40bcastBegin},
  {"bcastEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_43bcastEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_42bcastEnd},
  {"reduceBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_45reduceBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_44reduceBegin},
  {"reduceEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_47reduceEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_46reduceEnd},
  {"scatterBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_49scatterBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_48scatterBegin},
  {"scatterEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_51scatterEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_50scatterEnd},
  {"gatherBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_53gatherBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_52gatherBegin},
  {"gatherEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_55gatherEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_54gatherEnd},
  {"fetchAndOpBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_57fetchAndOpBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_56fetchAndOpBegin},
  {"fetchAndOpEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2SF_59fetchAndOpEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2SF_58fetchAndOpEnd},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscSF_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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_Object, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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 = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  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;
    objobjargproc f = __Pyx_PyType_TryGetSubSlot(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, tp_as_mapping, mp_ass_subscript, objobjargproc);
    if (f)
    return f(o, i, v);
    o_type_name = __Pyx_PyType_GetFullyQualifiedName(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
    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_mstate_global->__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_mstate_global->__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
    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_mstate_global->__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_mstate_global->__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
    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_mstate_global->__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_mstate_global->__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);
}



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
    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_mstate_global->__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_mstate_global->__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);
}



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
    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_mstate_global->__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_mstate_global->__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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, tp_base, PyTypeObject*), left, right );
    }
    return __Pyx_NewRef(Py_NotImplemented);
}



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[] = {
  {"__idiv__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_15__idiv__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_14__idiv__},
  {"__add__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Vec_19__add__, METH_O|METH_COEXIST, 0},
  {"__radd__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Vec_21__radd__, METH_O|METH_COEXIST, 0},
  {"__sub__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Vec_23__sub__, METH_O|METH_COEXIST, 0},
  {"__rsub__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Vec_25__rsub__, METH_O|METH_COEXIST, 0},
  {"__mul__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Vec_27__mul__, METH_O|METH_COEXIST, 0},
  {"__rmul__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Vec_29__rmul__, METH_O|METH_COEXIST, 0},
  {"__div__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_31__div__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_30__div__},
  {"__rdiv__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_33__rdiv__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_32__rdiv__},
  {"__truediv__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Vec_35__truediv__, METH_O|METH_COEXIST, 0},
  {"__rtruediv__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Vec_37__rtruediv__, METH_O|METH_COEXIST, 0},
  {"__matmul__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Vec_39__matmul__, METH_O|METH_COEXIST, 0},
  {"__enter__", (PyCFunction)(void(*)(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(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_51__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_50__exit__},
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_53view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_52view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_55destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_54destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_57create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_56create},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_59setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_58setType},
  {"setSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_61setSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_60setSizes},
  {"createSeq", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_63createSeq, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_62createSeq},
  {"createMPI", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_65createMPI, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_64createMPI},
  {"createWithArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_67createWithArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_66createWithArray},
  {"createCUDAWithArrays", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_69createCUDAWithArrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_68createCUDAWithArrays},
  {"createHIPWithArrays", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_71createHIPWithArrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_70createHIPWithArrays},
  {"createViennaCLWithArrays", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_73createViennaCLWithArrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_72createViennaCLWithArrays},
  {"createWithDLPack", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_75createWithDLPack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_74createWithDLPack},
  {"attachDLPackInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_77attachDLPackInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_76attachDLPackInfo},
  {"clearDLPackInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_79clearDLPackInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_78clearDLPackInfo},
  {"__dlpack__", (PyCFunction)(void(*)(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(*)(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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_85toDLPack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_84toDLPack},
  {"createGhost", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_87createGhost, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_86createGhost},
  {"createGhostWithArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_89createGhostWithArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_88createGhostWithArray},
  {"createShared", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_91createShared, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_90createShared},
  {"createNest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_93createNest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_92createNest},
  {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_95setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_94setOptionsPrefix},
  {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_97getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_96getOptionsPrefix},
  {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_99appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_98appendOptionsPrefix},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_101setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_100setFromOptions},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_103setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_102setUp},
  {"setOption", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_105setOption, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_104setOption},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_107getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_106getType},
  {"getSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_109getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_108getSize},
  {"getLocalSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_111getLocalSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_110getLocalSize},
  {"getSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_113getSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_112getSizes},
  {"setBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_115setBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_114setBlockSize},
  {"getBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_117getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_116getBlockSize},
  {"getOwnershipRange", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_119getOwnershipRange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_118getOwnershipRange},
  {"getOwnershipRanges", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_121getOwnershipRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_120getOwnershipRanges},
  {"createLocalVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_123createLocalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_122createLocalVector},
  {"getLocalVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_125getLocalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_124getLocalVector},
  {"restoreLocalVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_127restoreLocalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_126restoreLocalVector},
  {"getBuffer", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_129getBuffer, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_128getBuffer},
  {"getArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_131getArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_130getArray},
  {"setArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_133setArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_132setArray},
  {"placeArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_135placeArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_134placeArray},
  {"resetArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_137resetArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_136resetArray},
  {"bindToCPU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_139bindToCPU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_138bindToCPU},
  {"boundToCPU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_141boundToCPU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_140boundToCPU},
  {"getCUDAHandle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_143getCUDAHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_142getCUDAHandle},
  {"restoreCUDAHandle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_145restoreCUDAHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_144restoreCUDAHandle},
  {"getHIPHandle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_147getHIPHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_146getHIPHandle},
  {"restoreHIPHandle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_149restoreHIPHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_148restoreHIPHandle},
  {"getOffloadMask", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_151getOffloadMask, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_150getOffloadMask},
  {"getCLContextHandle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_153getCLContextHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_152getCLContextHandle},
  {"getCLQueueHandle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_155getCLQueueHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_154getCLQueueHandle},
  {"getCLMemHandle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_157getCLMemHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_156getCLMemHandle},
  {"restoreCLMemHandle", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_159restoreCLMemHandle, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_158restoreCLMemHandle},
  {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_161duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_160duplicate},
  {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_163copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_162copy},
  {"chop", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_165chop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_164chop},
  {"load", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_167load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_166load},
  {"equal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_169equal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_168equal},
  {"dot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_171dot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_170dot},
  {"dotBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_173dotBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_172dotBegin},
  {"dotEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_175dotEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_174dotEnd},
  {"tDot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_177tDot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_176tDot},
  {"tDotBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_179tDotBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_178tDotBegin},
  {"tDotEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_181tDotEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_180tDotEnd},
  {"mDot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_183mDot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_182mDot},
  {"mDotBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_185mDotBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_184mDotBegin},
  {"mDotEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_187mDotEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_186mDotEnd},
  {"mtDot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_189mtDot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_188mtDot},
  {"mtDotBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_191mtDotBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_190mtDotBegin},
  {"mtDotEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_193mtDotEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_192mtDotEnd},
  {"norm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_195norm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_194norm},
  {"normBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_197normBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_196normBegin},
  {"normEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_199normEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_198normEnd},
  {"dotNorm2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_201dotNorm2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_200dotNorm2},
  {"sum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_203sum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_202sum},
  {"mean", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_205mean, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_204mean},
  {"min", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_207min, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_206min},
  {"max", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_209max, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_208max},
  {"normalize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_211normalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_210normalize},
  {"reciprocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_213reciprocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_212reciprocal},
  {"exp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_215exp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_214exp},
  {"log", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_217log, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_216log},
  {"sqrtabs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_219sqrtabs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_218sqrtabs},
  {"abs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_221abs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_220abs},
  {"conjugate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_223conjugate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_222conjugate},
  {"setRandom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_225setRandom, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_224setRandom},
  {"permute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_227permute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_226permute},
  {"zeroEntries", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_229zeroEntries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_228zeroEntries},
  {"set", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_231set, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_230set},
  {"isset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_233isset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_232isset},
  {"scale", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_235scale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_234scale},
  {"shift", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_237shift, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_236shift},
  {"swap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_239swap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_238swap},
  {"axpy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_241axpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_240axpy},
  {"isaxpy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_243isaxpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_242isaxpy},
  {"aypx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_245aypx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_244aypx},
  {"axpby", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_247axpby, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_246axpby},
  {"waxpy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_249waxpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_248waxpy},
  {"maxpy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_251maxpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_250maxpy},
  {"pointwiseMult", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_253pointwiseMult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_252pointwiseMult},
  {"pointwiseDivide", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_255pointwiseDivide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_254pointwiseDivide},
  {"pointwiseMin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_257pointwiseMin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_256pointwiseMin},
  {"pointwiseMax", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_259pointwiseMax, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_258pointwiseMax},
  {"pointwiseMaxAbs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_261pointwiseMaxAbs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_260pointwiseMaxAbs},
  {"maxPointwiseDivide", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_263maxPointwiseDivide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_262maxPointwiseDivide},
  {"getValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_265getValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_264getValue},
  {"getValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_267getValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_266getValues},
  {"getValuesStagStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_269getValuesStagStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_268getValuesStagStencil},
  {"setValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_271setValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_270setValue},
  {"setValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_273setValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_272setValues},
  {"setValuesBlocked", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_275setValuesBlocked, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_274setValuesBlocked},
  {"setValuesStagStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_277setValuesStagStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_276setValuesStagStencil},
  {"setLGMap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_279setLGMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_278setLGMap},
  {"getLGMap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_281getLGMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_280getLGMap},
  {"setValueLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_283setValueLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_282setValueLocal},
  {"setValuesLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_285setValuesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_284setValuesLocal},
  {"setValuesBlockedLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_287setValuesBlockedLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_286setValuesBlockedLocal},
  {"assemblyBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_289assemblyBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_288assemblyBegin},
  {"assemblyEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_291assemblyEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_290assemblyEnd},
  {"assemble", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_293assemble, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_292assemble},
  {"strideScale", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_295strideScale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_294strideScale},
  {"strideSum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_297strideSum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_296strideSum},
  {"strideMin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_299strideMin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_298strideMin},
  {"strideMax", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_301strideMax, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_300strideMax},
  {"strideNorm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_303strideNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_302strideNorm},
  {"strideScatter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_305strideScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_304strideScatter},
  {"strideGather", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_307strideGather, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_306strideGather},
  {"localForm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_309localForm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_308localForm},
  {"ghostUpdateBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_311ghostUpdateBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_310ghostUpdateBegin},
  {"ghostUpdateEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_313ghostUpdateEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_312ghostUpdateEnd},
  {"ghostUpdate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_315ghostUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_314ghostUpdate},
  {"setMPIGhost", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_317setMPIGhost, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_316setMPIGhost},
  {"getGhostIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_319getGhostIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_318getGhostIS},
  {"getSubVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_321getSubVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_320getSubVector},
  {"restoreSubVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_323restoreSubVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_322restoreSubVector},
  {"getNestSubVecs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_325getNestSubVecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_324getNestSubVecs},
  {"setNestSubVecs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_327setNestSubVecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_326setNestSubVecs},
  {"setDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_329setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_328setDM},
  {"getDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_331getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_330getDM},
  {"concatenate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Vec_333concatenate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Vec_332concatenate},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Vec[] = {
  {"sizes", __pyx_getprop_8petsc4py_5PETSc_3Vec_sizes, __pyx_setprop_8petsc4py_5PETSc_3Vec_sizes, PyDoc_STR("Vec.sizes: LayoutSizeSpec\nThe local and global vector sizes.\nSource code at petsc4py/PETSc/Vec.pyx:3596"), 0},
  {"size", __pyx_getprop_8petsc4py_5PETSc_3Vec_size, 0, PyDoc_STR("Vec.size: int\nThe global vector size.\nSource code at petsc4py/PETSc/Vec.pyx:3604"), 0},
  {"local_size", __pyx_getprop_8petsc4py_5PETSc_3Vec_local_size, 0, PyDoc_STR("Vec.local_size: int\nThe local vector size.\nSource code at petsc4py/PETSc/Vec.pyx:3609"), 0},
  {"block_size", __pyx_getprop_8petsc4py_5PETSc_3Vec_block_size, 0, PyDoc_STR("Vec.block_size: int\nThe block size.\nSource code at petsc4py/PETSc/Vec.pyx:3614"), 0},
  {"owner_range", __pyx_getprop_8petsc4py_5PETSc_3Vec_owner_range, 0, 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:3619"), 0},
  {"owner_ranges", __pyx_getprop_8petsc4py_5PETSc_3Vec_owner_ranges, 0, PyDoc_STR("Vec.owner_ranges: ArrayInt\nThe range of indices owned by each process.\nSource code at petsc4py/PETSc/Vec.pyx:3624"), 0},
  {"buffer_w", __pyx_getprop_8petsc4py_5PETSc_3Vec_buffer_w, 0, PyDoc_STR("Vec.buffer_w: Any\nWriteable buffered view of the local portion of the vector.\nSource code at petsc4py/PETSc/Vec.pyx:3629"), 0},
  {"buffer_r", __pyx_getprop_8petsc4py_5PETSc_3Vec_buffer_r, 0, PyDoc_STR("Vec.buffer_r: Any\nRead-only buffered view of the local portion of the vector.\nSource code at petsc4py/PETSc/Vec.pyx:3634"), 0},
  {"array_w", __pyx_getprop_8petsc4py_5PETSc_3Vec_array_w, __pyx_setprop_8petsc4py_5PETSc_3Vec_array_w, PyDoc_STR("Vec.array_w: ArrayScalar\nWriteable `ndarray` containing the local portion of the vector.\nSource code at petsc4py/PETSc/Vec.pyx:3639"), 0},
  {"array_r", __pyx_getprop_8petsc4py_5PETSc_3Vec_array_r, 0, PyDoc_STR("Vec.array_r: ArrayScalar\nRead-only `ndarray` containing the local portion of the vector.\nSource code at petsc4py/PETSc/Vec.pyx:3648"), 0},
  {"buffer", __pyx_getprop_8petsc4py_5PETSc_3Vec_buffer, 0, PyDoc_STR("Vec.buffer: Any\nAlias for `buffer_w`.\nSource code at petsc4py/PETSc/Vec.pyx:3653"), 0},
  {"array", __pyx_getprop_8petsc4py_5PETSc_3Vec_array, __pyx_setprop_8petsc4py_5PETSc_3Vec_array, PyDoc_STR("Vec.array: ArrayScalar\nAlias for `array_w`.\nSource code at petsc4py/PETSc/Vec.pyx:3658"), 0},
  {"__array_interface__", __pyx_getprop_8petsc4py_5PETSc_3Vec___array_interface__, 0, 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 = {
  __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_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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},
  {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__},
  {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__},
  {Py_nb_matrix_multiply, (void *)__pyx_nb_matrix_multiply_8petsc4py_5PETSc_Vec},
  {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*/
  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*/
  0, /*nb_int*/
  0, /*nb_long (reserved)*/
  0, /*nb_float*/
  __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*/
  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*/
  __pyx_nb_matrix_multiply_8petsc4py_5PETSc_Vec, /*nb_matrix_multiply*/
  0, /*nb_inplace_matrix_multiply*/
};

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 = {
  __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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_3setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_2setUp},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_4create},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_6destroy},
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_9view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_8view},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_11setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_10setFromOptions},
  {"getDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_13getDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_12getDimension},
  {"getDegree", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_15getDegree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_14getDegree},
  {"setDegree", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_17setDegree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_16setDegree},
  {"getNumVariables", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_19getNumVariables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_18getNumVariables},
  {"setNumVariables", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_21setNumVariables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_20setNumVariables},
  {"getNumComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_23getNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_22getNumComponents},
  {"setNumComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_25setNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_24setNumComponents},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_27getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_26getType},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_29setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_28setType},
  {"getSumConcatenate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_31getSumConcatenate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_30getSumConcatenate},
  {"setSumConcatenate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_33setSumConcatenate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_32setSumConcatenate},
  {"getSumNumSubspaces", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_35getSumNumSubspaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_34getSumNumSubspaces},
  {"getSumSubspace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_37getSumSubspace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_36getSumSubspace},
  {"setSumSubspace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_39setSumSubspace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_38setSumSubspace},
  {"setSumNumSubspaces", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_41setSumNumSubspaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_40setSumNumSubspaces},
  {"getTensorNumSubspaces", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_43getTensorNumSubspaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_42getTensorNumSubspaces},
  {"setTensorSubspace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_45setTensorSubspace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_44setTensorSubspace},
  {"getTensorSubspace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_47getTensorSubspace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_46getTensorSubspace},
  {"setTensorNumSubspaces", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_49setTensorNumSubspaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_48setTensorNumSubspaces},
  {"getPolynomialTensor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_51getPolynomialTensor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_50getPolynomialTensor},
  {"setPolynomialTensor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_53setPolynomialTensor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_52setPolynomialTensor},
  {"setPointPoints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_55setPointPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_54setPointPoints},
  {"getPointPoints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_57getPointPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_56getPointPoints},
  {"setPTrimmedFormDegree", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_59setPTrimmedFormDegree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_58setPTrimmedFormDegree},
  {"getPTrimmedFormDegree", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_5Space_61getPTrimmedFormDegree, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_5Space_60getPTrimmedFormDegree},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscSpace_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {Py_tp_doc, (void *)PyDoc_STR("Function 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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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("Function 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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_3setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_2setUp},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_4create},
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_7view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_6view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_9destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_8destroy},
  {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_11duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_10duplicate},
  {"getDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_13getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_12getDM},
  {"setDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_15setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_14setDM},
  {"getDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_17getDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_16getDimension},
  {"getNumComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_19getNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_18getNumComponents},
  {"setNumComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_21setNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_20setNumComponents},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_23getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_22getType},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_25setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_24setType},
  {"getOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_27getOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_26getOrder},
  {"setOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_29setOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_28setOrder},
  {"getNumDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_31getNumDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_30getNumDof},
  {"getFunctional", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_33getFunctional, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_32getFunctional},
  {"getInteriorDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_35getInteriorDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_34getInteriorDimension},
  {"getLagrangeContinuity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_37getLagrangeContinuity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_36getLagrangeContinuity},
  {"setLagrangeContinuity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_39setLagrangeContinuity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_38setLagrangeContinuity},
  {"getLagrangeTensor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_41getLagrangeTensor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_40getLagrangeTensor},
  {"setLagrangeTensor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_43setLagrangeTensor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_42setLagrangeTensor},
  {"getLagrangeTrimmed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_45getLagrangeTrimmed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_44getLagrangeTrimmed},
  {"setLagrangeTrimmed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_47setLagrangeTrimmed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_46setLagrangeTrimmed},
  {"setSimpleDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_49setSimpleDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_48setSimpleDimension},
  {"setSimpleFunctional", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9DualSpace_51setSimpleFunctional, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9DualSpace_50setSimpleFunctional},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscDualSpace_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_2view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_4destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_6create},
  {"createDefault", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_9createDefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_8createDefault},
  {"createByCell", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_11createByCell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_10createByCell},
  {"createLagrange", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_13createLagrange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_12createLagrange},
  {"getQuadrature", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_15getQuadrature, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_14getQuadrature},
  {"getDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_17getDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_16getDimension},
  {"getSpatialDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_19getSpatialDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_18getSpatialDimension},
  {"getNumComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_21getNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_20getNumComponents},
  {"setNumComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_23setNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_22setNumComponents},
  {"getNumDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_25getNumDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_24getNumDof},
  {"getTileSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_27getTileSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_26getTileSizes},
  {"setTileSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_29setTileSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_28setTileSizes},
  {"getFaceQuadrature", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_31getFaceQuadrature, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_30getFaceQuadrature},
  {"setQuadrature", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_33setQuadrature, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_32setQuadrature},
  {"setFaceQuadrature", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_35setFaceQuadrature, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_34setFaceQuadrature},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_37setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_36setType},
  {"getBasisSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_39getBasisSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_38getBasisSpace},
  {"setBasisSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_41setBasisSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_40setBasisSpace},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_43setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_42setFromOptions},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_45setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_44setUp},
  {"getDualSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_47getDualSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_46getDualSpace},
  {"setDualSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2FE_49setDualSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2FE_48setDualSpace},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscFE_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_2view},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_4create},
  {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_7duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_6duplicate},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_9destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_8destroy},
  {"getData", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_11getData, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_10getData},
  {"getNumComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_13getNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_12getNumComponents},
  {"setNumComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_15setNumComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_14setNumComponents},
  {"getOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4Quad_17getOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4Quad_16getOrder},
  {"setOrder", (PyCFunction)(void(*)(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_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_4view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_6destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_8create},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_10setType},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_12getType},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_15setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_14setFromOptions},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_17setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_16setUp},
  {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_19copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_18copy},
  {"toAll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_21toAll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_20toAll},
  {"toZero", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_23toZero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_22toZero},
  {"begin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_25begin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_24begin},
  {"end", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Scatter_27end, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Scatter_26end},
  {"scatter", (PyCFunction)(void(*)(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_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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 <petsc:sec_scatter>`.\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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 <petsc:sec_scatter>`.\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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Section[] = {
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_2view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_4destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_6create},
  {"clone", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_9clone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_8clone},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_11setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_10setUp},
  {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_13reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_12reset},
  {"getNumFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_15getNumFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_14getNumFields},
  {"setNumFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_17setNumFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_16setNumFields},
  {"getFieldName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_19getFieldName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_18getFieldName},
  {"setFieldName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_21setFieldName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_20setFieldName},
  {"getFieldComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_23getFieldComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_22getFieldComponents},
  {"setFieldComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_25setFieldComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_24setFieldComponents},
  {"getChart", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_27getChart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_26getChart},
  {"setChart", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_29setChart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_28setChart},
  {"getPermutation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_31getPermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_30getPermutation},
  {"setPermutation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_33setPermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_32setPermutation},
  {"getDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_35getDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_34getDof},
  {"setDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_37setDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_36setDof},
  {"addDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_39addDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_38addDof},
  {"getFieldDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_41getFieldDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_40getFieldDof},
  {"setFieldDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_43setFieldDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_42setFieldDof},
  {"addFieldDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_45addFieldDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_44addFieldDof},
  {"getConstraintDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_47getConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_46getConstraintDof},
  {"setConstraintDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_49setConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_48setConstraintDof},
  {"addConstraintDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_51addConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_50addConstraintDof},
  {"getFieldConstraintDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_53getFieldConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_52getFieldConstraintDof},
  {"setFieldConstraintDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_55setFieldConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_54setFieldConstraintDof},
  {"addFieldConstraintDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_57addFieldConstraintDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_56addFieldConstraintDof},
  {"getConstraintIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_59getConstraintIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_58getConstraintIndices},
  {"setConstraintIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_61setConstraintIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_60setConstraintIndices},
  {"getFieldConstraintIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_63getFieldConstraintIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_62getFieldConstraintIndices},
  {"setFieldConstraintIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_65setFieldConstraintIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_64setFieldConstraintIndices},
  {"getMaxDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_67getMaxDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_66getMaxDof},
  {"getStorageSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_69getStorageSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_68getStorageSize},
  {"getConstrainedStorageSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_71getConstrainedStorageSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_70getConstrainedStorageSize},
  {"getOffset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_73getOffset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_72getOffset},
  {"setOffset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_75setOffset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_74setOffset},
  {"getFieldOffset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_77getFieldOffset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_76getFieldOffset},
  {"setFieldOffset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_79setFieldOffset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_78setFieldOffset},
  {"getOffsetRange", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_81getOffsetRange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_80getOffsetRange},
  {"createGlobalSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Section_83createGlobalSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Section_82createGlobalSection},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscSection_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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_Object, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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 = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  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;
    objobjargproc f = __Pyx_PyType_TryGetSubSlot(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, tp_as_mapping, mp_ass_subscript, objobjargproc);
    if (f)
    return f(o, i, v);
    o_type_name = __Pyx_PyType_GetFullyQualifiedName(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
    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_mstate_global->__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_mstate_global->__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
    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_mstate_global->__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_mstate_global->__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
    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_mstate_global->__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_mstate_global->__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);
}



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
    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_mstate_global->__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_mstate_global->__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);
}



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
    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_mstate_global->__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_mstate_global->__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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, tp_base, PyTypeObject*), left, right );
    }
    return __Pyx_NewRef(Py_NotImplemented);
}



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[] = {
  {"__idiv__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_13__idiv__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_12__idiv__},
  {"__add__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Mat_17__add__, METH_O|METH_COEXIST, 0},
  {"__radd__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Mat_19__radd__, METH_O|METH_COEXIST, 0},
  {"__sub__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Mat_21__sub__, METH_O|METH_COEXIST, 0},
  {"__rsub__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Mat_23__rsub__, METH_O|METH_COEXIST, 0},
  {"__mul__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Mat_25__mul__, METH_O|METH_COEXIST, 0},
  {"__rmul__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Mat_27__rmul__, METH_O|METH_COEXIST, 0},
  {"__div__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_29__div__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_28__div__},
  {"__rdiv__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_31__rdiv__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_30__rdiv__},
  {"__truediv__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Mat_33__truediv__, METH_O|METH_COEXIST, 0},
  {"__rtruediv__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Mat_35__rtruediv__, METH_O|METH_COEXIST, 0},
  {"__matmul__", (PyCFunction)__pyx_pw_8petsc4py_5PETSc_3Mat_37__matmul__, METH_O|METH_COEXIST, 0},
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_45view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_44view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_47destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_46destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_49create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_48create},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_51setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_50setType},
  {"setSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_53setSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_52setSizes},
  {"setBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_55setBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_54setBlockSize},
  {"setBlockSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_57setBlockSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_56setBlockSizes},
  {"setVariableBlockSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_59setVariableBlockSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_58setVariableBlockSizes},
  {"setVecType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_61setVecType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_60setVecType},
  {"getVecType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_63getVecType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_62getVecType},
  {"setNestVecType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_65setNestVecType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_64setNestVecType},
  {"createAIJ", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_67createAIJ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_66createAIJ},
  {"createBAIJ", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_69createBAIJ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_68createBAIJ},
  {"createSBAIJ", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_71createSBAIJ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_70createSBAIJ},
  {"createAIJCRL", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_73createAIJCRL, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_72createAIJCRL},
  {"setPreallocationNNZ", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_75setPreallocationNNZ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_74setPreallocationNNZ},
  {"setPreallocationCOO", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_77setPreallocationCOO, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_76setPreallocationCOO},
  {"setPreallocationCOOLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_79setPreallocationCOOLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_78setPreallocationCOOLocal},
  {"setPreallocationCSR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_81setPreallocationCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_80setPreallocationCSR},
  {"preallocatorPreallocate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_83preallocatorPreallocate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_82preallocatorPreallocate},
  {"createAIJWithArrays", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_85createAIJWithArrays, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_84createAIJWithArrays},
  {"createDense", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_87createDense, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_86createDense},
  {"createDenseCUDA", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_89createDenseCUDA, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_88createDenseCUDA},
  {"setPreallocationDense", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_91setPreallocationDense, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_90setPreallocationDense},
  {"createScatter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_93createScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_92createScatter},
  {"createNormal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_95createNormal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_94createNormal},
  {"createTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_97createTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_96createTranspose},
  {"getTransposeMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_99getTransposeMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_98getTransposeMat},
  {"createNormalHermitian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_101createNormalHermitian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_100createNormalHermitian},
  {"createHermitianTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_103createHermitianTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_102createHermitianTranspose},
  {"createLRC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_105createLRC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_104createLRC},
  {"createSubMatrixVirtual", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_107createSubMatrixVirtual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_106createSubMatrixVirtual},
  {"createNest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_109createNest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_108createNest},
  {"createH2OpusFromMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_111createH2OpusFromMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_110createH2OpusFromMat},
  {"createHtoolFromKernel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_113createHtoolFromKernel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_112createHtoolFromKernel},
  {"createIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_115createIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_114createIS},
  {"createConstantDiagonal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_117createConstantDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_116createConstantDiagonal},
  {"createDiagonal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_119createDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_118createDiagonal},
  {"createPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_121createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_120createPython},
  {"setPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_123setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_122setPythonContext},
  {"getPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_125getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_124getPythonContext},
  {"setPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_127setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_126setPythonType},
  {"getPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_129getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_128getPythonType},
  {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_131setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_130setOptionsPrefix},
  {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_133getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_132getOptionsPrefix},
  {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_135appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_134appendOptionsPrefix},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_137setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_136setFromOptions},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_139setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_138setUp},
  {"setOption", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_141setOption, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_140setOption},
  {"getOption", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_143getOption, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_142getOption},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_145getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_144getType},
  {"getSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_147getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_146getSize},
  {"getLocalSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_149getLocalSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_148getLocalSize},
  {"getSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_151getSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_150getSizes},
  {"getBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_153getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_152getBlockSize},
  {"getBlockSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_155getBlockSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_154getBlockSizes},
  {"getOwnershipRange", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_157getOwnershipRange, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_156getOwnershipRange},
  {"getOwnershipRanges", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_159getOwnershipRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_158getOwnershipRanges},
  {"getOwnershipRangeColumn", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_161getOwnershipRangeColumn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_160getOwnershipRangeColumn},
  {"getOwnershipRangesColumn", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_163getOwnershipRangesColumn, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_162getOwnershipRangesColumn},
  {"getOwnershipIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_165getOwnershipIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_164getOwnershipIS},
  {"getInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_167getInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_166getInfo},
  {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_169duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_168duplicate},
  {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_171copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_170copy},
  {"load", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_173load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_172load},
  {"convert", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_175convert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_174convert},
  {"transpose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_177transpose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_176transpose},
  {"setTransposePrecursor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_179setTransposePrecursor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_178setTransposePrecursor},
  {"hermitianTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_181hermitianTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_180hermitianTranspose},
  {"realPart", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_183realPart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_182realPart},
  {"imagPart", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_185imagPart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_184imagPart},
  {"conjugate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_187conjugate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_186conjugate},
  {"permute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_189permute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_188permute},
  {"equal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_191equal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_190equal},
  {"isTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_193isTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_192isTranspose},
  {"isSymmetric", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_195isSymmetric, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_194isSymmetric},
  {"isSymmetricKnown", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_197isSymmetricKnown, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_196isSymmetricKnown},
  {"isHermitian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_199isHermitian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_198isHermitian},
  {"isHermitianKnown", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_201isHermitianKnown, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_200isHermitianKnown},
  {"isStructurallySymmetric", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_203isStructurallySymmetric, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_202isStructurallySymmetric},
  {"isLinear", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_205isLinear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_204isLinear},
  {"zeroEntries", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_207zeroEntries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_206zeroEntries},
  {"getValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_209getValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_208getValue},
  {"getValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_211getValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_210getValues},
  {"getValuesCSR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_213getValuesCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_212getValuesCSR},
  {"getRow", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_215getRow, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_214getRow},
  {"getRowIJ", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_217getRowIJ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_216getRowIJ},
  {"getColumnIJ", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_219getColumnIJ, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_218getColumnIJ},
  {"setValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_221setValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_220setValue},
  {"setValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_223setValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_222setValues},
  {"setValuesRCV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_225setValuesRCV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_224setValuesRCV},
  {"setValuesIJV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_227setValuesIJV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_226setValuesIJV},
  {"setValuesCOO", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_229setValuesCOO, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_228setValuesCOO},
  {"setValuesCSR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_231setValuesCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_230setValuesCSR},
  {"setValuesBlocked", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_233setValuesBlocked, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_232setValuesBlocked},
  {"setValuesBlockedRCV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_235setValuesBlockedRCV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_234setValuesBlockedRCV},
  {"setValuesBlockedIJV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_237setValuesBlockedIJV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_236setValuesBlockedIJV},
  {"setValuesBlockedCSR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_239setValuesBlockedCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_238setValuesBlockedCSR},
  {"setLGMap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_241setLGMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_240setLGMap},
  {"getLGMap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_243getLGMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_242getLGMap},
  {"setValueLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_245setValueLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_244setValueLocal},
  {"setValuesLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_247setValuesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_246setValuesLocal},
  {"setValuesLocalRCV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_249setValuesLocalRCV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_248setValuesLocalRCV},
  {"setValuesLocalIJV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_251setValuesLocalIJV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_250setValuesLocalIJV},
  {"setValuesLocalCSR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_253setValuesLocalCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_252setValuesLocalCSR},
  {"setValuesBlockedLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_255setValuesBlockedLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_254setValuesBlockedLocal},
  {"setValuesBlockedLocalRCV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_257setValuesBlockedLocalRCV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_256setValuesBlockedLocalRCV},
  {"setValuesBlockedLocalIJV", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_259setValuesBlockedLocalIJV, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_258setValuesBlockedLocalIJV},
  {"setValuesBlockedLocalCSR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_261setValuesBlockedLocalCSR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_260setValuesBlockedLocalCSR},
  {"setStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_263setStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_262setStencil},
  {"setValueStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_265setValueStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_264setValueStencil},
  {"setValueStagStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_267setValueStagStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_266setValueStagStencil},
  {"setValueBlockedStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_269setValueBlockedStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_268setValueBlockedStencil},
  {"setValueBlockedStagStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_271setValueBlockedStagStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_270setValueBlockedStagStencil},
  {"zeroRows", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_273zeroRows, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_272zeroRows},
  {"zeroRowsLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_275zeroRowsLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_274zeroRowsLocal},
  {"zeroRowsColumns", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_277zeroRowsColumns, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_276zeroRowsColumns},
  {"zeroRowsColumnsLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_279zeroRowsColumnsLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_278zeroRowsColumnsLocal},
  {"zeroRowsColumnsStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_281zeroRowsColumnsStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_280zeroRowsColumnsStencil},
  {"storeValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_283storeValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_282storeValues},
  {"retrieveValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_285retrieveValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_284retrieveValues},
  {"assemblyBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_287assemblyBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_286assemblyBegin},
  {"assemblyEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_289assemblyEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_288assemblyEnd},
  {"assemble", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_291assemble, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_290assemble},
  {"isAssembled", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_293isAssembled, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_292isAssembled},
  {"findZeroRows", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_295findZeroRows, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_294findZeroRows},
  {"createVecs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_297createVecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_296createVecs},
  {"createVecRight", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_299createVecRight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_298createVecRight},
  {"createVecLeft", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_301createVecLeft, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_300createVecLeft},
  {"getColumnVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_303getColumnVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_302getColumnVector},
  {"getRedundantMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_305getRedundantMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_304getRedundantMatrix},
  {"getDiagonal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_307getDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_306getDiagonal},
  {"getRowSum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_309getRowSum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_308getRowSum},
  {"setDiagonal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_311setDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_310setDiagonal},
  {"diagonalScale", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_313diagonalScale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_312diagonalScale},
  {"invertBlockDiagonal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_315invertBlockDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_314invertBlockDiagonal},
  {"setNullSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_317setNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_316setNullSpace},
  {"getNullSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_319getNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_318getNullSpace},
  {"setTransposeNullSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_321setTransposeNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_320setTransposeNullSpace},
  {"getTransposeNullSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_323getTransposeNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_322getTransposeNullSpace},
  {"setNearNullSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_325setNearNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_324setNearNullSpace},
  {"getNearNullSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_327getNearNullSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_326getNearNullSpace},
  {"mult", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_329mult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_328mult},
  {"multAdd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_331multAdd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_330multAdd},
  {"multTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_333multTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_332multTranspose},
  {"multTransposeAdd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_335multTransposeAdd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_334multTransposeAdd},
  {"multHermitian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_337multHermitian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_336multHermitian},
  {"multHermitianAdd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_339multHermitianAdd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_338multHermitianAdd},
  {"SOR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_341SOR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_340SOR},
  {"getDiagonalBlock", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_343getDiagonalBlock, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_342getDiagonalBlock},
  {"increaseOverlap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_345increaseOverlap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_344increaseOverlap},
  {"createSubMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_347createSubMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_346createSubMatrix},
  {"createSubMatrices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_349createSubMatrices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_348createSubMatrices},
  {"createSchurComplement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_351createSchurComplement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_350createSchurComplement},
  {"getSchurComplementSubMatrices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_353getSchurComplementSubMatrices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_352getSchurComplementSubMatrices},
  {"getLocalSubMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_355getLocalSubMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_354getLocalSubMatrix},
  {"restoreLocalSubMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_357restoreLocalSubMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_356restoreLocalSubMatrix},
  {"norm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_359norm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_358norm},
  {"scale", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_361scale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_360scale},
  {"shift", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_363shift, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_362shift},
  {"chop", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_365chop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_364chop},
  {"setRandom", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_367setRandom, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_366setRandom},
  {"axpy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_369axpy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_368axpy},
  {"aypx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_371aypx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_370aypx},
  {"matMult", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_373matMult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_372matMult},
  {"matTransposeMult", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_375matTransposeMult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_374matTransposeMult},
  {"transposeMatMult", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_377transposeMatMult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_376transposeMatMult},
  {"ptap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_379ptap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_378ptap},
  {"rart", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_381rart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_380rart},
  {"matMatMult", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_383matMatMult, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_382matMatMult},
  {"kron", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_385kron, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_384kron},
  {"bindToCPU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_387bindToCPU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_386bindToCPU},
  {"boundToCPU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_389boundToCPU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_388boundToCPU},
  {"getOrdering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_391getOrdering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_390getOrdering},
  {"reorderForNonzeroDiagonal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_393reorderForNonzeroDiagonal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_392reorderForNonzeroDiagonal},
  {"factorLU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_395factorLU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_394factorLU},
  {"factorSymbolicLU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_397factorSymbolicLU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_396factorSymbolicLU},
  {"factorNumericLU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_399factorNumericLU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_398factorNumericLU},
  {"factorILU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_401factorILU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_400factorILU},
  {"factorSymbolicILU", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_403factorSymbolicILU, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_402factorSymbolicILU},
  {"factorCholesky", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_405factorCholesky, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_404factorCholesky},
  {"factorSymbolicCholesky", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_407factorSymbolicCholesky, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_406factorSymbolicCholesky},
  {"factorNumericCholesky", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_409factorNumericCholesky, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_408factorNumericCholesky},
  {"factorICC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_411factorICC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_410factorICC},
  {"factorSymbolicICC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_413factorSymbolicICC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_412factorSymbolicICC},
  {"getInertia", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_415getInertia, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_414getInertia},
  {"setUnfactored", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_417setUnfactored, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_416setUnfactored},
  {"setISAllowRepeated", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_419setISAllowRepeated, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_418setISAllowRepeated},
  {"getISAllowRepeated", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_421getISAllowRepeated, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_420getISAllowRepeated},
  {"fixISLocalEmpty", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_423fixISLocalEmpty, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_422fixISLocalEmpty},
  {"getISLocalMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_425getISLocalMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_424getISLocalMat},
  {"restoreISLocalMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_427restoreISLocalMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_426restoreISLocalMat},
  {"setISLocalMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_429setISLocalMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_428setISLocalMat},
  {"setISPreallocation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_431setISPreallocation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_430setISPreallocation},
  {"getLRCMats", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_433getLRCMats, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_432getLRCMats},
  {"setLRCMats", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_435setLRCMats, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_434setLRCMats},
  {"H2OpusOrthogonalize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_437H2OpusOrthogonalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_436H2OpusOrthogonalize},
  {"H2OpusCompress", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_439H2OpusCompress, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_438H2OpusCompress},
  {"H2OpusLowRankUpdate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_441H2OpusLowRankUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_440H2OpusLowRankUpdate},
  {"HtoolGetPermutationSource", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_443HtoolGetPermutationSource, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_442HtoolGetPermutationSource},
  {"HtoolGetPermutationTarget", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_445HtoolGetPermutationTarget, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_444HtoolGetPermutationTarget},
  {"HtoolUsePermutation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_447HtoolUsePermutation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_446HtoolUsePermutation},
  {"HtoolUseRecompression", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_449HtoolUseRecompression, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_448HtoolUseRecompression},
  {"getLMVMJ0", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_451getLMVMJ0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_450getLMVMJ0},
  {"setLMVMJ0", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_453setLMVMJ0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_452setLMVMJ0},
  {"getLMVMJ0KSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_455getLMVMJ0KSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_454getLMVMJ0KSP},
  {"setLMVMJ0KSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_457setLMVMJ0KSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_456setLMVMJ0KSP},
  {"allocateLMVM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_459allocateLMVM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_458allocateLMVM},
  {"updateLMVM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_461updateLMVM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_460updateLMVM},
  {"resetLMVM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_463resetLMVM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_462resetLMVM},
  {"setMumpsIcntl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_465setMumpsIcntl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_464setMumpsIcntl},
  {"getMumpsIcntl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_467getMumpsIcntl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_466getMumpsIcntl},
  {"setMumpsCntl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_469setMumpsCntl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_468setMumpsCntl},
  {"getMumpsCntl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_471getMumpsCntl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_470getMumpsCntl},
  {"getMumpsInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_473getMumpsInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_472getMumpsInfo},
  {"getMumpsInfog", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_475getMumpsInfog, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_474getMumpsInfog},
  {"getMumpsRinfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_477getMumpsRinfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_476getMumpsRinfo},
  {"getMumpsRinfog", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_479getMumpsRinfog, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_478getMumpsRinfog},
  {"solveForward", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_481solveForward, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_480solveForward},
  {"solveBackward", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_483solveBackward, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_482solveBackward},
  {"solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_485solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_484solve},
  {"solveTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_487solveTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_486solveTranspose},
  {"solveAdd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_489solveAdd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_488solveAdd},
  {"solveTransposeAdd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_491solveTransposeAdd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_490solveTransposeAdd},
  {"matSolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_493matSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_492matSolve},
  {"setDenseLDA", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_495setDenseLDA, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_494setDenseLDA},
  {"getDenseLDA", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_497getDenseLDA, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_496getDenseLDA},
  {"getDenseArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_499getDenseArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_498getDenseArray},
  {"getDenseLocalMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_501getDenseLocalMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_500getDenseLocalMatrix},
  {"getDenseSubMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_503getDenseSubMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_502getDenseSubMatrix},
  {"restoreDenseSubMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_505restoreDenseSubMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_504restoreDenseSubMatrix},
  {"getDenseColumnVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_507getDenseColumnVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_506getDenseColumnVec},
  {"restoreDenseColumnVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_509restoreDenseColumnVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_508restoreDenseColumnVec},
  {"getNestSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_511getNestSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_510getNestSize},
  {"getNestISs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_513getNestISs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_512getNestISs},
  {"getNestLocalISs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_515getNestLocalISs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_514getNestLocalISs},
  {"getNestSubMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_517getNestSubMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_516getNestSubMatrix},
  {"getDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_519getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_518getDM},
  {"setDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_521setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_520setDM},
  {"__dlpack__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_523__dlpack__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_522__dlpack__},
  {"__dlpack_device__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_525__dlpack_device__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_524__dlpack_device__},
  {"toDLPack", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Mat_527toDLPack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Mat_526toDLPack},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Mat[] = {
  {"sizes", __pyx_getprop_8petsc4py_5PETSc_3Mat_sizes, __pyx_setprop_8petsc4py_5PETSc_3Mat_sizes, PyDoc_STR("Mat.sizes: tuple[tuple[int, int], tuple[int, int]]\nMatrix local and global sizes.\nSource code at petsc4py/PETSc/Mat.pyx:6119"), 0},
  {"size", __pyx_getprop_8petsc4py_5PETSc_3Mat_size, 0, PyDoc_STR("Mat.size: tuple[int, int]\nMatrix global size.\nSource code at petsc4py/PETSc/Mat.pyx:6127"), 0},
  {"local_size", __pyx_getprop_8petsc4py_5PETSc_3Mat_local_size, 0, PyDoc_STR("Mat.local_size: int\nMatrix local size.\nSource code at petsc4py/PETSc/Mat.pyx:6132"), 0},
  {"block_size", __pyx_getprop_8petsc4py_5PETSc_3Mat_block_size, 0, PyDoc_STR("Mat.block_size: int\nMatrix block size.\nSource code at petsc4py/PETSc/Mat.pyx:6137"), 0},
  {"block_sizes", __pyx_getprop_8petsc4py_5PETSc_3Mat_block_sizes, 0, PyDoc_STR("Mat.block_sizes: tuple[int, int]\nMatrix row and column block sizes.\nSource code at petsc4py/PETSc/Mat.pyx:6142"), 0},
  {"owner_range", __pyx_getprop_8petsc4py_5PETSc_3Mat_owner_range, 0, PyDoc_STR("Mat.owner_range: tuple[int, int]\nMatrix local row range.\nSource code at petsc4py/PETSc/Mat.pyx:6147"), 0},
  {"owner_ranges", __pyx_getprop_8petsc4py_5PETSc_3Mat_owner_ranges, 0, PyDoc_STR("Mat.owner_ranges: ArrayInt\nMatrix row ranges.\nSource code at petsc4py/PETSc/Mat.pyx:6152"), 0},
  {"assembled", __pyx_getprop_8petsc4py_5PETSc_3Mat_assembled, 0, PyDoc_STR("Mat.assembled: bool\nThe boolean flag indicating if the matrix is assembled.\nSource code at petsc4py/PETSc/Mat.pyx:6159"), 0},
  {"symmetric", __pyx_getprop_8petsc4py_5PETSc_3Mat_symmetric, 0, PyDoc_STR("Mat.symmetric: bool\nThe boolean flag indicating if the matrix is symmetric.\nSource code at petsc4py/PETSc/Mat.pyx:6163"), 0},
  {"hermitian", __pyx_getprop_8petsc4py_5PETSc_3Mat_hermitian, 0, PyDoc_STR("Mat.hermitian: bool\nThe boolean flag indicating if the matrix is Hermitian.\nSource code at petsc4py/PETSc/Mat.pyx:6167"), 0},
  {"structsymm", __pyx_getprop_8petsc4py_5PETSc_3Mat_structsymm, 0, PyDoc_STR("Mat.structsymm: bool\nThe boolean flag indicating if the matrix is structurally symmetric.\nSource code at petsc4py/PETSc/Mat.pyx:6171"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscMat_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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},
  {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__},
  {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__},
  {Py_nb_matrix_multiply, (void *)__pyx_nb_matrix_multiply_8petsc4py_5PETSc_Mat},
  {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 <petsc:manual/mat>`.\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*/
  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*/
  0, /*nb_int*/
  0, /*nb_long (reserved)*/
  0, /*nb_float*/
  __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*/
  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*/
  __pyx_nb_matrix_multiply_8petsc4py_5PETSc_Mat, /*nb_matrix_multiply*/
  0, /*nb_inplace_matrix_multiply*/
};

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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 <petsc:manual/mat>`.\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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_4view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_6destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_8create},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_10setType},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_12getType},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_15setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_14setFromOptions},
  {"setAdjacency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15MatPartitioning_17setAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15MatPartitioning_16setAdjacency},
  {"apply", (PyCFunction)(void(*)(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_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_4view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_6destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_8create},
  {"createRigidBody", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_11createRigidBody, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_10createRigidBody},
  {"setFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_13setFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_12setFunction},
  {"hasConstant", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_15hasConstant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_14hasConstant},
  {"getVecs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_17getVecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_16getVecs},
  {"getFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_19getFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_18getFunction},
  {"remove", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9NullSpace_21remove, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9NullSpace_20remove},
  {"test", (PyCFunction)(void(*)(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_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_4view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_6destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_8create},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_10setType},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_12getType},
  {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_15setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_14setOptionsPrefix},
  {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_17getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_16getOptionsPrefix},
  {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_19appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_18appendOptionsPrefix},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_21setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_20setFromOptions},
  {"setOperators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_23setOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_22setOperators},
  {"getOperators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_25getOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_24getOperators},
  {"setUseAmat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_27setUseAmat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_26setUseAmat},
  {"getUseAmat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_29getUseAmat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_28getUseAmat},
  {"setReusePreconditioner", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_31setReusePreconditioner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_30setReusePreconditioner},
  {"setFailedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_33setFailedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_32setFailedReason},
  {"getFailedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_35getFailedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_34getFailedReason},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_37setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_36setUp},
  {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_39reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_38reset},
  {"setUpOnBlocks", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_41setUpOnBlocks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_40setUpOnBlocks},
  {"apply", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_43apply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_42apply},
  {"matApply", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_45matApply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_44matApply},
  {"applyTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_47applyTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_46applyTranspose},
  {"matApplyTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_49matApplyTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_48matApplyTranspose},
  {"applySymmetricLeft", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_51applySymmetricLeft, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_50applySymmetricLeft},
  {"applySymmetricRight", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_53applySymmetricRight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_52applySymmetricRight},
  {"getDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_55getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_54getDM},
  {"setDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_57setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_56setDM},
  {"setCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_59setCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_58setCoordinates},
  {"createPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_61createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_60createPython},
  {"setPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_63setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_62setPythonContext},
  {"getPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_65getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_64getPythonContext},
  {"setPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_67setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_66setPythonType},
  {"getPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_69getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_68getPythonType},
  {"getBJacobiSubKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_71getBJacobiSubKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_70getBJacobiSubKSP},
  {"setASMType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_73setASMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_72setASMType},
  {"setASMOverlap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_75setASMOverlap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_74setASMOverlap},
  {"setASMLocalSubdomains", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_77setASMLocalSubdomains, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_76setASMLocalSubdomains},
  {"setASMTotalSubdomains", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_79setASMTotalSubdomains, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_78setASMTotalSubdomains},
  {"getASMSubKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_81getASMSubKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_80getASMSubKSP},
  {"setASMSortIndices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_83setASMSortIndices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_82setASMSortIndices},
  {"setGASMType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_85setGASMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_84setGASMType},
  {"setGASMOverlap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_87setGASMOverlap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_86setGASMOverlap},
  {"setGAMGType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_89setGAMGType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_88setGAMGType},
  {"setGAMGLevels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_91setGAMGLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_90setGAMGLevels},
  {"setGAMGSmooths", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_93setGAMGSmooths, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_92setGAMGSmooths},
  {"getHYPREType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_95getHYPREType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_94getHYPREType},
  {"setHYPREType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_97setHYPREType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_96setHYPREType},
  {"setHYPREDiscreteCurl", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_99setHYPREDiscreteCurl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_98setHYPREDiscreteCurl},
  {"setHYPREDiscreteGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_101setHYPREDiscreteGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_100setHYPREDiscreteGradient},
  {"setHYPRESetAlphaPoissonMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_103setHYPRESetAlphaPoissonMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_102setHYPRESetAlphaPoissonMatrix},
  {"setHYPRESetBetaPoissonMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_105setHYPRESetBetaPoissonMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_104setHYPRESetBetaPoissonMatrix},
  {"setHYPRESetInterpolations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_107setHYPRESetInterpolations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_106setHYPRESetInterpolations},
  {"setHYPRESetEdgeConstantVectors", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_109setHYPRESetEdgeConstantVectors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_108setHYPRESetEdgeConstantVectors},
  {"setHYPREAMSSetInteriorNodes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_111setHYPREAMSSetInteriorNodes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_110setHYPREAMSSetInteriorNodes},
  {"setFactorSolverType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_113setFactorSolverType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_112setFactorSolverType},
  {"getFactorSolverType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_115getFactorSolverType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_114getFactorSolverType},
  {"setFactorSetUpSolverType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_117setFactorSetUpSolverType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_116setFactorSetUpSolverType},
  {"setFactorOrdering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_119setFactorOrdering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_118setFactorOrdering},
  {"setFactorPivot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_121setFactorPivot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_120setFactorPivot},
  {"setFactorShift", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_123setFactorShift, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_122setFactorShift},
  {"setFactorLevels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_125setFactorLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_124setFactorLevels},
  {"getFactorMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_127getFactorMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_126getFactorMatrix},
  {"setFieldSplitType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_129setFieldSplitType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_128setFieldSplitType},
  {"setFieldSplitIS", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_131setFieldSplitIS, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_130setFieldSplitIS},
  {"setFieldSplitFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_133setFieldSplitFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_132setFieldSplitFields},
  {"getFieldSplitSubKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_135getFieldSplitSubKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_134getFieldSplitSubKSP},
  {"getFieldSplitSchurGetSubKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_137getFieldSplitSchurGetSubKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_136getFieldSplitSchurGetSubKSP},
  {"getFieldSplitSubIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_139getFieldSplitSubIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_138getFieldSplitSubIS},
  {"setFieldSplitSchurFactType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_141setFieldSplitSchurFactType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_140setFieldSplitSchurFactType},
  {"setFieldSplitSchurPreType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_143setFieldSplitSchurPreType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_142setFieldSplitSchurPreType},
  {"setCompositeType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_145setCompositeType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_144setCompositeType},
  {"getCompositePC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_147getCompositePC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_146getCompositePC},
  {"addCompositePCType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_149addCompositePCType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_148addCompositePCType},
  {"getKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_151getKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_150getKSP},
  {"getMGType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_153getMGType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_152getMGType},
  {"setMGType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_155setMGType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_154setMGType},
  {"getMGLevels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_157getMGLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_156getMGLevels},
  {"setMGLevels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_159setMGLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_158setMGLevels},
  {"getMGCoarseSolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_161getMGCoarseSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_160getMGCoarseSolve},
  {"setMGInterpolation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_163setMGInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_162setMGInterpolation},
  {"getMGInterpolation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_165getMGInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_164getMGInterpolation},
  {"setMGRestriction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_167setMGRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_166setMGRestriction},
  {"getMGRestriction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_169getMGRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_168getMGRestriction},
  {"setMGRScale", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_171setMGRScale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_170setMGRScale},
  {"getMGRScale", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_173getMGRScale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_172getMGRScale},
  {"getMGSmoother", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_175getMGSmoother, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_174getMGSmoother},
  {"getMGSmootherDown", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_177getMGSmootherDown, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_176getMGSmootherDown},
  {"getMGSmootherUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_179getMGSmootherUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_178getMGSmootherUp},
  {"setMGCycleType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_181setMGCycleType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_180setMGCycleType},
  {"setMGCycleTypeOnLevel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_183setMGCycleTypeOnLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_182setMGCycleTypeOnLevel},
  {"setMGRhs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_185setMGRhs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_184setMGRhs},
  {"setMGX", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_187setMGX, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_186setMGX},
  {"setMGR", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_189setMGR, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_188setMGR},
  {"setBDDCLocalAdjacency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_191setBDDCLocalAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_190setBDDCLocalAdjacency},
  {"setBDDCDivergenceMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_193setBDDCDivergenceMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_192setBDDCDivergenceMat},
  {"setBDDCDiscreteGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_195setBDDCDiscreteGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_194setBDDCDiscreteGradient},
  {"setBDDCChangeOfBasisMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_197setBDDCChangeOfBasisMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_196setBDDCChangeOfBasisMat},
  {"setBDDCPrimalVerticesIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_199setBDDCPrimalVerticesIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_198setBDDCPrimalVerticesIS},
  {"setBDDCPrimalVerticesLocalIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_201setBDDCPrimalVerticesLocalIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_200setBDDCPrimalVerticesLocalIS},
  {"setBDDCCoarseningRatio", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_203setBDDCCoarseningRatio, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_202setBDDCCoarseningRatio},
  {"setBDDCLevels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_205setBDDCLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_204setBDDCLevels},
  {"setBDDCDirichletBoundaries", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_207setBDDCDirichletBoundaries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_206setBDDCDirichletBoundaries},
  {"setBDDCDirichletBoundariesLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_209setBDDCDirichletBoundariesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_208setBDDCDirichletBoundariesLocal},
  {"setBDDCNeumannBoundaries", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_211setBDDCNeumannBoundaries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_210setBDDCNeumannBoundaries},
  {"setBDDCNeumannBoundariesLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_213setBDDCNeumannBoundariesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_212setBDDCNeumannBoundariesLocal},
  {"setBDDCDofsSplitting", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_215setBDDCDofsSplitting, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_214setBDDCDofsSplitting},
  {"setBDDCDofsSplittingLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_217setBDDCDofsSplittingLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_216setBDDCDofsSplittingLocal},
  {"getPatchSubKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_219getPatchSubKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_218getPatchSubKSP},
  {"setPatchCellNumbering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_221setPatchCellNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_220setPatchCellNumbering},
  {"setPatchDiscretisationInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_223setPatchDiscretisationInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_222setPatchDiscretisationInfo},
  {"setPatchComputeOperator", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_225setPatchComputeOperator, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_224setPatchComputeOperator},
  {"setPatchComputeOperatorInteriorFacets", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_227setPatchComputeOperatorInteriorFacets, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_226setPatchComputeOperatorInteriorFacets},
  {"setPatchComputeFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_229setPatchComputeFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_228setPatchComputeFunction},
  {"setPatchComputeFunctionInteriorFacets", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_231setPatchComputeFunctionInteriorFacets, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_230setPatchComputeFunctionInteriorFacets},
  {"setPatchConstructType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_233setPatchConstructType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_232setPatchConstructType},
  {"setHPDDMAuxiliaryMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_235setHPDDMAuxiliaryMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_234setHPDDMAuxiliaryMat},
  {"setHPDDMRHSMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_237setHPDDMRHSMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_236setHPDDMRHSMat},
  {"getHPDDMComplexities", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_239getHPDDMComplexities, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_238getHPDDMComplexities},
  {"setHPDDMHasNeumannMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_241setHPDDMHasNeumannMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_240setHPDDMHasNeumannMat},
  {"setHPDDMCoarseCorrectionType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_243setHPDDMCoarseCorrectionType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_242setHPDDMCoarseCorrectionType},
  {"getHPDDMCoarseCorrectionType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_245getHPDDMCoarseCorrectionType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_244getHPDDMCoarseCorrectionType},
  {"getHPDDMSTShareSubKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_247getHPDDMSTShareSubKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_246getHPDDMSTShareSubKSP},
  {"setHPDDMDeflationMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_249setHPDDMDeflationMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_248setHPDDMDeflationMat},
  {"setSPAIEpsilon", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_251setSPAIEpsilon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_250setSPAIEpsilon},
  {"setSPAINBSteps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_253setSPAINBSteps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_252setSPAINBSteps},
  {"setSPAIMax", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_255setSPAIMax, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_254setSPAIMax},
  {"setSPAIMaxNew", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_257setSPAIMaxNew, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_256setSPAIMaxNew},
  {"setSPAIBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_259setSPAIBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_258setSPAIBlockSize},
  {"setSPAICacheSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_261setSPAICacheSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_260setSPAICacheSize},
  {"setSPAIVerbose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_263setSPAIVerbose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_262setSPAIVerbose},
  {"setSPAISp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_265setSPAISp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_264setSPAISp},
  {"setDeflationInitOnly", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_267setDeflationInitOnly, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_266setDeflationInitOnly},
  {"setDeflationLevels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_269setDeflationLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_268setDeflationLevels},
  {"setDeflationReductionFactor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_271setDeflationReductionFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_270setDeflationReductionFactor},
  {"setDeflationCorrectionFactor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_273setDeflationCorrectionFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_272setDeflationCorrectionFactor},
  {"setDeflationSpaceToCompute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_275setDeflationSpaceToCompute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_274setDeflationSpaceToCompute},
  {"setDeflationSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_277setDeflationSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_276setDeflationSpace},
  {"setDeflationProjectionNullSpaceMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_279setDeflationProjectionNullSpaceMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_278setDeflationProjectionNullSpaceMat},
  {"setDeflationCoarseMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_281setDeflationCoarseMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_280setDeflationCoarseMat},
  {"getDeflationCoarseKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_283getDeflationCoarseKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_282getDeflationCoarseKSP},
  {"getDeflationPC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2PC_285getDeflationPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2PC_284getDeflationPC},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscPC_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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 <petsc:sec_ksppc>`.\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) # u is created internally\n    >>> pc.apply(v, u) # u 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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 <petsc:sec_ksppc>`.\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) # u is created internally\n    >>> pc.apply(v, u) # u 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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_4view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_6destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_8create},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_10setType},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_12getType},
  {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_15setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_14setOptionsPrefix},
  {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_17getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_16getOptionsPrefix},
  {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_19appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_18appendOptionsPrefix},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_21setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_20setFromOptions},
  {"setAppCtx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_23setAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_22setAppCtx},
  {"getAppCtx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_25getAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_24getAppCtx},
  {"getDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_27getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_26getDM},
  {"setDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_29setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_28setDM},
  {"setDMActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_31setDMActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_30setDMActive},
  {"setComputeRHS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_33setComputeRHS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_32setComputeRHS},
  {"setComputeOperators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_35setComputeOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_34setComputeOperators},
  {"setOperators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_37setOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_36setOperators},
  {"getOperators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_39getOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_38getOperators},
  {"setPC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_41setPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_40setPC},
  {"getPC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_43getPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_42getPC},
  {"setTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_45setTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_44setTolerances},
  {"getTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_47getTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_46getTolerances},
  {"setConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_49setConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_48setConvergenceTest},
  {"addConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_51addConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_50addConvergenceTest},
  {"getConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_53getConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_52getConvergenceTest},
  {"callConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_55callConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_54callConvergenceTest},
  {"setConvergenceHistory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_57setConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_56setConvergenceHistory},
  {"getConvergenceHistory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_59getConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_58getConvergenceHistory},
  {"logConvergenceHistory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_61logConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_60logConvergenceHistory},
  {"setMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_63setMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_62setMonitor},
  {"getMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_65getMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_64getMonitor},
  {"monitorCancel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_67monitorCancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_66monitorCancel},
  {"monitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_69monitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_68monitor},
  {"setPCSide", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_71setPCSide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_70setPCSide},
  {"getPCSide", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_73getPCSide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_72getPCSide},
  {"setNormType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_75setNormType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_74setNormType},
  {"getNormType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_77getNormType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_76getNormType},
  {"setComputeEigenvalues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_79setComputeEigenvalues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_78setComputeEigenvalues},
  {"getComputeEigenvalues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_81getComputeEigenvalues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_80getComputeEigenvalues},
  {"setComputeSingularValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_83setComputeSingularValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_82setComputeSingularValues},
  {"getComputeSingularValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_85getComputeSingularValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_84getComputeSingularValues},
  {"setInitialGuessNonzero", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_87setInitialGuessNonzero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_86setInitialGuessNonzero},
  {"getInitialGuessNonzero", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_89getInitialGuessNonzero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_88getInitialGuessNonzero},
  {"setInitialGuessKnoll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_91setInitialGuessKnoll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_90setInitialGuessKnoll},
  {"getInitialGuessKnoll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_93getInitialGuessKnoll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_92getInitialGuessKnoll},
  {"setUseFischerGuess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_95setUseFischerGuess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_94setUseFischerGuess},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_97setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_96setUp},
  {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_99reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_98reset},
  {"setUpOnBlocks", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_101setUpOnBlocks, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_100setUpOnBlocks},
  {"setPreSolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_103setPreSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_102setPreSolve},
  {"setPostSolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_105setPostSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_104setPostSolve},
  {"solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_107solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_106solve},
  {"solveTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_109solveTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_108solveTranspose},
  {"matSolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_111matSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_110matSolve},
  {"matSolveTranspose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_113matSolveTranspose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_112matSolveTranspose},
  {"setIterationNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_115setIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_114setIterationNumber},
  {"getIterationNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_117getIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_116getIterationNumber},
  {"setResidualNorm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_119setResidualNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_118setResidualNorm},
  {"getResidualNorm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_121getResidualNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_120getResidualNorm},
  {"setConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_123setConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_122setConvergedReason},
  {"getConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_125getConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_124getConvergedReason},
  {"getCGObjectiveValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_127getCGObjectiveValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_126getCGObjectiveValue},
  {"setHPDDMType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_129setHPDDMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_128setHPDDMType},
  {"getHPDDMType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_131getHPDDMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_130getHPDDMType},
  {"setErrorIfNotConverged", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_133setErrorIfNotConverged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_132setErrorIfNotConverged},
  {"getErrorIfNotConverged", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_135getErrorIfNotConverged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_134getErrorIfNotConverged},
  {"getRhs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_137getRhs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_136getRhs},
  {"getSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_139getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_138getSolution},
  {"getWorkVecs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_141getWorkVecs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_140getWorkVecs},
  {"buildSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_143buildSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_142buildSolution},
  {"buildResidual", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_145buildResidual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_144buildResidual},
  {"computeEigenvalues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_147computeEigenvalues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_146computeEigenvalues},
  {"computeExtremeSingularValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_149computeExtremeSingularValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_148computeExtremeSingularValues},
  {"setGMRESRestart", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_151setGMRESRestart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_150setGMRESRestart},
  {"createPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_153createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_152createPython},
  {"setPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_155setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_154setPythonContext},
  {"getPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_157getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_156getPythonContext},
  {"setPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_159setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_158setPythonType},
  {"getPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3KSP_161getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3KSP_160getPythonType},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_KSP[] = {
  {"appctx", __pyx_getprop_8petsc4py_5PETSc_3KSP_appctx, __pyx_setprop_8petsc4py_5PETSc_3KSP_appctx, PyDoc_STR("KSP.appctx: Any\nThe solver application context.\nSource code at petsc4py/PETSc/KSP.pyx:2256"), 0},
  {"dm", __pyx_getprop_8petsc4py_5PETSc_3KSP_dm, __pyx_setprop_8petsc4py_5PETSc_3KSP_dm, PyDoc_STR("KSP.dm: DM\nThe solver `DM`.\nSource code at petsc4py/PETSc/KSP.pyx:2266"), 0},
  {"vec_sol", __pyx_getprop_8petsc4py_5PETSc_3KSP_vec_sol, 0, PyDoc_STR("KSP.vec_sol: Vec\nThe solution vector.\nSource code at petsc4py/PETSc/KSP.pyx:2276"), 0},
  {"vec_rhs", __pyx_getprop_8petsc4py_5PETSc_3KSP_vec_rhs, 0, PyDoc_STR("KSP.vec_rhs: Vec\nThe right-hand side vector.\nSource code at petsc4py/PETSc/KSP.pyx:2281"), 0},
  {"mat_op", __pyx_getprop_8petsc4py_5PETSc_3KSP_mat_op, 0, PyDoc_STR("KSP.mat_op: Mat\nThe system matrix operator.\nSource code at petsc4py/PETSc/KSP.pyx:2288"), 0},
  {"mat_pc", __pyx_getprop_8petsc4py_5PETSc_3KSP_mat_pc, 0, PyDoc_STR("KSP.mat_pc: Mat\nThe preconditioner operator.\nSource code at petsc4py/PETSc/KSP.pyx:2293"), 0},
  {"guess_nonzero", __pyx_getprop_8petsc4py_5PETSc_3KSP_guess_nonzero, __pyx_setprop_8petsc4py_5PETSc_3KSP_guess_nonzero, PyDoc_STR("KSP.guess_nonzero: bool\nWhether guess is non-zero.\nSource code at petsc4py/PETSc/KSP.pyx:2300"), 0},
  {"guess_knoll", __pyx_getprop_8petsc4py_5PETSc_3KSP_guess_knoll, __pyx_setprop_8petsc4py_5PETSc_3KSP_guess_knoll, PyDoc_STR("KSP.guess_knoll: bool\nWhether solver uses Knoll trick.\nSource code at petsc4py/PETSc/KSP.pyx:2308"), 0},
  {"pc", __pyx_getprop_8petsc4py_5PETSc_3KSP_pc, 0, PyDoc_STR("KSP.pc: PC\nThe `PC` of the solver.\nSource code at petsc4py/PETSc/KSP.pyx:2318"), 0},
  {"pc_side", __pyx_getprop_8petsc4py_5PETSc_3KSP_pc_side, __pyx_setprop_8petsc4py_5PETSc_3KSP_pc_side, PyDoc_STR("KSP.pc_side: PC.Side\nThe side on which preconditioning is performed.\nSource code at petsc4py/PETSc/KSP.pyx:2323"), 0},
  {"norm_type", __pyx_getprop_8petsc4py_5PETSc_3KSP_norm_type, __pyx_setprop_8petsc4py_5PETSc_3KSP_norm_type, PyDoc_STR("KSP.norm_type: NormType\nThe norm used by the solver.\nSource code at petsc4py/PETSc/KSP.pyx:2331"), 0},
  {"rtol", __pyx_getprop_8petsc4py_5PETSc_3KSP_rtol, __pyx_setprop_8petsc4py_5PETSc_3KSP_rtol, PyDoc_STR("KSP.rtol: float\nThe relative tolerance of the solver.\nSource code at petsc4py/PETSc/KSP.pyx:2341"), 0},
  {"atol", __pyx_getprop_8petsc4py_5PETSc_3KSP_atol, __pyx_setprop_8petsc4py_5PETSc_3KSP_atol, PyDoc_STR("KSP.atol: float\nThe absolute tolerance of the solver.\nSource code at petsc4py/PETSc/KSP.pyx:2349"), 0},
  {"divtol", __pyx_getprop_8petsc4py_5PETSc_3KSP_divtol, __pyx_setprop_8petsc4py_5PETSc_3KSP_divtol, PyDoc_STR("KSP.divtol: float\nThe divergence tolerance of the solver.\nSource code at petsc4py/PETSc/KSP.pyx:2357"), 0},
  {"max_it", __pyx_getprop_8petsc4py_5PETSc_3KSP_max_it, __pyx_setprop_8petsc4py_5PETSc_3KSP_max_it, PyDoc_STR("KSP.max_it: int\nThe maximum number of iteration the solver may take.\nSource code at petsc4py/PETSc/KSP.pyx:2365"), 0},
  {"its", __pyx_getprop_8petsc4py_5PETSc_3KSP_its, __pyx_setprop_8petsc4py_5PETSc_3KSP_its, PyDoc_STR("KSP.its: int\nThe current number of iterations the solver has taken.\nSource code at petsc4py/PETSc/KSP.pyx:2375"), 0},
  {"norm", __pyx_getprop_8petsc4py_5PETSc_3KSP_norm, __pyx_setprop_8petsc4py_5PETSc_3KSP_norm, PyDoc_STR("KSP.norm: float\nThe norm of the residual at the current iteration.\nSource code at petsc4py/PETSc/KSP.pyx:2383"), 0},
  {"history", __pyx_getprop_8petsc4py_5PETSc_3KSP_history, 0, PyDoc_STR("KSP.history: ndarray\nThe convergence history of the solver.\nSource code at petsc4py/PETSc/KSP.pyx:2391"), 0},
  {"reason", __pyx_getprop_8petsc4py_5PETSc_3KSP_reason, __pyx_setprop_8petsc4py_5PETSc_3KSP_reason, PyDoc_STR("KSP.reason: KSP.ConvergedReason\nThe converged reason.\nSource code at petsc4py/PETSc/KSP.pyx:2398"), 0},
  {"is_iterating", __pyx_getprop_8petsc4py_5PETSc_3KSP_is_iterating, 0, PyDoc_STR("KSP.is_iterating: bool\nBoolean indicating if the solver has not converged yet.\nSource code at petsc4py/PETSc/KSP.pyx:2406"), 0},
  {"is_converged", __pyx_getprop_8petsc4py_5PETSc_3KSP_is_converged, 0, PyDoc_STR("KSP.is_converged: bool\nBoolean indicating if the solver has converged.\nSource code at petsc4py/PETSc/KSP.pyx:2411"), 0},
  {"is_diverged", __pyx_getprop_8petsc4py_5PETSc_3KSP_is_diverged, 0, PyDoc_STR("KSP.is_diverged: bool\nBoolean indicating if the solver has failed.\nSource code at petsc4py/PETSc/KSP.pyx:2416"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscKSP_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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_ksp(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8petsc4py_5PETSc_4SNES_7use_ksp_1__get__(o);
}

static int __pyx_setprop_8petsc4py_5PETSc_4SNES_use_ksp(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_8petsc4py_5PETSc_4SNES_7use_ksp_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 PyObject *__pyx_getprop_8petsc4py_5PETSc_4SNES_linesearch(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8petsc4py_5PETSc_4SNES_10linesearch_1__get__(o);
}

static int __pyx_setprop_8petsc4py_5PETSc_4SNES_linesearch(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_8petsc4py_5PETSc_4SNES_10linesearch_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_8petsc4py_5PETSc_SNES[] = {
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_2view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_4destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_6create},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_8setType},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_10getType},
  {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_13setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_12setOptionsPrefix},
  {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_15getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_14getOptionsPrefix},
  {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_17appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_16appendOptionsPrefix},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_19setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_18setFromOptions},
  {"setApplicationContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_21setApplicationContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_20setApplicationContext},
  {"getApplicationContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_23getApplicationContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_22getApplicationContext},
  {"getDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_25getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_24getDM},
  {"setDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_27setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_26setDM},
  {"setTRTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_29setTRTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_28setTRTolerances},
  {"getTRTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_31getTRTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_30getTRTolerances},
  {"setTRUpdateParameters", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_33setTRUpdateParameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_32setTRUpdateParameters},
  {"getTRUpdateParameters", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_35getTRUpdateParameters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_34getTRUpdateParameters},
  {"setFASInterpolation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_37setFASInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_36setFASInterpolation},
  {"getFASInterpolation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_39getFASInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_38getFASInterpolation},
  {"setFASRestriction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_41setFASRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_40setFASRestriction},
  {"getFASRestriction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_43getFASRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_42getFASRestriction},
  {"setFASInjection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_45setFASInjection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_44setFASInjection},
  {"getFASInjection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_47getFASInjection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_46getFASInjection},
  {"setFASRScale", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_49setFASRScale, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_48setFASRScale},
  {"setFASLevels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_51setFASLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_50setFASLevels},
  {"getFASLevels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_53getFASLevels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_52getFASLevels},
  {"getFASCycleSNES", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_55getFASCycleSNES, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_54getFASCycleSNES},
  {"getFASCoarseSolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_57getFASCoarseSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_56getFASCoarseSolve},
  {"getFASSmoother", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_59getFASSmoother, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_58getFASSmoother},
  {"getFASSmootherDown", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_61getFASSmootherDown, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_60getFASSmootherDown},
  {"getFASSmootherUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_63getFASSmootherUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_62getFASSmootherUp},
  {"getNPC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_65getNPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_64getNPC},
  {"hasNPC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_67hasNPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_66hasNPC},
  {"setNPC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_69setNPC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_68setNPC},
  {"setNPCSide", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_71setNPCSide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_70setNPCSide},
  {"getNPCSide", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_73getNPCSide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_72getNPCSide},
  {"setLineSearchPreCheck", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_75setLineSearchPreCheck, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_74setLineSearchPreCheck},
  {"setInitialGuess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_77setInitialGuess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_76setInitialGuess},
  {"getInitialGuess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_79getInitialGuess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_78getInitialGuess},
  {"setFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_81setFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_80setFunction},
  {"getFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_83getFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_82getFunction},
  {"setUpdate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_85setUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_84setUpdate},
  {"getUpdate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_87getUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_86getUpdate},
  {"setJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_89setJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_88setJacobian},
  {"getJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_91getJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_90getJacobian},
  {"setObjective", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_93setObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_92setObjective},
  {"getObjective", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_95getObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_94getObjective},
  {"computeFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_97computeFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_96computeFunction},
  {"computeJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_99computeJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_98computeJacobian},
  {"computeObjective", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_101computeObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_100computeObjective},
  {"setNGS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_103setNGS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_102setNGS},
  {"getNGS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_105getNGS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_104getNGS},
  {"computeNGS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_107computeNGS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_106computeNGS},
  {"setTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_109setTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_108setTolerances},
  {"getTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_111getTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_110getTolerances},
  {"setDivergenceTolerance", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_113setDivergenceTolerance, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_112setDivergenceTolerance},
  {"getDivergenceTolerance", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_115getDivergenceTolerance, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_114getDivergenceTolerance},
  {"setNormSchedule", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_117setNormSchedule, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_116setNormSchedule},
  {"getNormSchedule", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_119getNormSchedule, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_118getNormSchedule},
  {"setConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_121setConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_120setConvergenceTest},
  {"getConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_123getConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_122getConvergenceTest},
  {"callConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_125callConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_124callConvergenceTest},
  {"converged", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_127converged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_126converged},
  {"setConvergenceHistory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_129setConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_128setConvergenceHistory},
  {"getConvergenceHistory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_131getConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_130getConvergenceHistory},
  {"logConvergenceHistory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_133logConvergenceHistory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_132logConvergenceHistory},
  {"setResetCounters", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_135setResetCounters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_134setResetCounters},
  {"setMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_137setMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_136setMonitor},
  {"getMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_139getMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_138getMonitor},
  {"monitorCancel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_141monitorCancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_140monitorCancel},
  {"monitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_143monitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_142monitor},
  {"setMaxFunctionEvaluations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_145setMaxFunctionEvaluations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_144setMaxFunctionEvaluations},
  {"getMaxFunctionEvaluations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_147getMaxFunctionEvaluations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_146getMaxFunctionEvaluations},
  {"getFunctionEvaluations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_149getFunctionEvaluations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_148getFunctionEvaluations},
  {"setMaxStepFailures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_151setMaxStepFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_150setMaxStepFailures},
  {"getMaxStepFailures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_153getMaxStepFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_152getMaxStepFailures},
  {"getStepFailures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_155getStepFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_154getStepFailures},
  {"setMaxKSPFailures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_157setMaxKSPFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_156setMaxKSPFailures},
  {"getMaxKSPFailures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_159getMaxKSPFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_158getMaxKSPFailures},
  {"getKSPFailures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_161getKSPFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_160getKSPFailures},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_163setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_162setUp},
  {"setUpMatrices", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_165setUpMatrices, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_164setUpMatrices},
  {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_167reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_166reset},
  {"solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_169solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_168solve},
  {"setConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_171setConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_170setConvergedReason},
  {"getConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_173getConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_172getConvergedReason},
  {"setErrorIfNotConverged", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_175setErrorIfNotConverged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_174setErrorIfNotConverged},
  {"getErrorIfNotConverged", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_177getErrorIfNotConverged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_176getErrorIfNotConverged},
  {"setIterationNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_179setIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_178setIterationNumber},
  {"getIterationNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_181getIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_180getIterationNumber},
  {"setForceIteration", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_183setForceIteration, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_182setForceIteration},
  {"setFunctionNorm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_185setFunctionNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_184setFunctionNorm},
  {"getFunctionNorm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_187getFunctionNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_186getFunctionNorm},
  {"getLinearSolveIterations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_189getLinearSolveIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_188getLinearSolveIterations},
  {"getRhs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_191getRhs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_190getRhs},
  {"getSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_193getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_192getSolution},
  {"setSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_195setSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_194setSolution},
  {"getSolutionUpdate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_197getSolutionUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_196getSolutionUpdate},
  {"setKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_199setKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_198setKSP},
  {"getKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_201getKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_200getKSP},
  {"setUseEW", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_203setUseEW, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_202setUseEW},
  {"getUseEW", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_205getUseEW, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_204getUseEW},
  {"setParamsEW", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_207setParamsEW, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_206setParamsEW},
  {"getParamsEW", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_209getParamsEW, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_208getParamsEW},
  {"setUseKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_211setUseKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_210setUseKSP},
  {"getUseKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_213getUseKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_212getUseKSP},
  {"setUseMF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_215setUseMF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_214setUseMF},
  {"getUseMF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_217getUseMF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_216getUseMF},
  {"setUseFD", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_219setUseFD, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_218setUseFD},
  {"getUseFD", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_221getUseFD, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_220getUseFD},
  {"setVariableBounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_223setVariableBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_222setVariableBounds},
  {"getVariableBounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_225getVariableBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_224getVariableBounds},
  {"getVIInactiveSet", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_227getVIInactiveSet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_226getVIInactiveSet},
  {"createPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_229createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_228createPython},
  {"setPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_231setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_230setPythonContext},
  {"getPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_233getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_232getPythonContext},
  {"setPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_235setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_234setPythonType},
  {"getPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_237getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_236getPythonType},
  {"getCompositeSNES", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_239getCompositeSNES, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_238getCompositeSNES},
  {"getCompositeNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_241getCompositeNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_240getCompositeNumber},
  {"getNASMSNES", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_243getNASMSNES, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_242getNASMSNES},
  {"getNASMNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_245getNASMNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_244getNASMNumber},
  {"setPatchCellNumbering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_247setPatchCellNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_246setPatchCellNumbering},
  {"setPatchDiscretisationInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_249setPatchDiscretisationInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_248setPatchDiscretisationInfo},
  {"setPatchComputeOperator", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_251setPatchComputeOperator, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_250setPatchComputeOperator},
  {"setPatchComputeFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_253setPatchComputeFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_252setPatchComputeFunction},
  {"setPatchConstructType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_255setPatchConstructType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_254setPatchConstructType},
  {"getLineSearch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_257getLineSearch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_256getLineSearch},
  {"setLineSearch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_259setLineSearch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_258setLineSearch},
  {"setNewtonALFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_261setNewtonALFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_260setNewtonALFunction},
  {"getNewtonALLoadParameter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_263getNewtonALLoadParameter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_262getNewtonALLoadParameter},
  {"setNewtonALCorrectionType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4SNES_265setNewtonALCorrectionType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4SNES_264setNewtonALCorrectionType},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_SNES[] = {
  {"appctx", __pyx_getprop_8petsc4py_5PETSc_4SNES_appctx, __pyx_setprop_8petsc4py_5PETSc_4SNES_appctx, PyDoc_STR("SNES.appctx: Any\nApplication context.\nSource code at petsc4py/PETSc/SNES.pyx:2436"), 0},
  {"dm", __pyx_getprop_8petsc4py_5PETSc_4SNES_dm, __pyx_setprop_8petsc4py_5PETSc_4SNES_dm, PyDoc_STR("SNES.dm: DM\n`DM`.\nSource code at petsc4py/PETSc/SNES.pyx:2446"), 0},
  {"npc", __pyx_getprop_8petsc4py_5PETSc_4SNES_npc, __pyx_setprop_8petsc4py_5PETSc_4SNES_npc, PyDoc_STR("SNES.npc: SNES\nNonlinear preconditioner.\nSource code at petsc4py/PETSc/SNES.pyx:2456"), 0},
  {"vec_sol", __pyx_getprop_8petsc4py_5PETSc_4SNES_vec_sol, 0, PyDoc_STR("SNES.vec_sol: Vec\nSolution vector.\nSource code at petsc4py/PETSc/SNES.pyx:2466"), 0},
  {"vec_upd", __pyx_getprop_8petsc4py_5PETSc_4SNES_vec_upd, 0, PyDoc_STR("SNES.vec_upd: Vec\nUpdate vector.\nSource code at petsc4py/PETSc/SNES.pyx:2471"), 0},
  {"vec_rhs", __pyx_getprop_8petsc4py_5PETSc_4SNES_vec_rhs, 0, PyDoc_STR("SNES.vec_rhs: Vec\nRight-hand side vector.\nSource code at petsc4py/PETSc/SNES.pyx:2476"), 0},
  {"ksp", __pyx_getprop_8petsc4py_5PETSc_4SNES_ksp, __pyx_setprop_8petsc4py_5PETSc_4SNES_ksp, PyDoc_STR("SNES.ksp: KSP\nLinear solver.\nSource code at petsc4py/PETSc/SNES.pyx:2483"), 0},
  {"use_ksp", __pyx_getprop_8petsc4py_5PETSc_4SNES_use_ksp, __pyx_setprop_8petsc4py_5PETSc_4SNES_use_ksp, PyDoc_STR("SNES.use_ksp: bool\nBoolean indicating if the solver uses a linear solver.\nSource code at petsc4py/PETSc/SNES.pyx:2491"), 0},
  {"use_ew", __pyx_getprop_8petsc4py_5PETSc_4SNES_use_ew, __pyx_setprop_8petsc4py_5PETSc_4SNES_use_ew, PyDoc_STR("SNES.use_ew: bool\nUse the Eisenstat-Walker trick.\nSource code at petsc4py/PETSc/SNES.pyx:2499"), 0},
  {"rtol", __pyx_getprop_8petsc4py_5PETSc_4SNES_rtol, __pyx_setprop_8petsc4py_5PETSc_4SNES_rtol, PyDoc_STR("SNES.rtol: float\nRelative residual tolerance.\nSource code at petsc4py/PETSc/SNES.pyx:2509"), 0},
  {"atol", __pyx_getprop_8petsc4py_5PETSc_4SNES_atol, __pyx_setprop_8petsc4py_5PETSc_4SNES_atol, PyDoc_STR("SNES.atol: float\nAbsolute residual tolerance.\nSource code at petsc4py/PETSc/SNES.pyx:2517"), 0},
  {"stol", __pyx_getprop_8petsc4py_5PETSc_4SNES_stol, __pyx_setprop_8petsc4py_5PETSc_4SNES_stol, PyDoc_STR("SNES.stol: float\nSolution update tolerance.\nSource code at petsc4py/PETSc/SNES.pyx:2525"), 0},
  {"max_it", __pyx_getprop_8petsc4py_5PETSc_4SNES_max_it, __pyx_setprop_8petsc4py_5PETSc_4SNES_max_it, PyDoc_STR("SNES.max_it: int\nMaximum number of iterations.\nSource code at petsc4py/PETSc/SNES.pyx:2533"), 0},
  {"max_funcs", __pyx_getprop_8petsc4py_5PETSc_4SNES_max_funcs, __pyx_setprop_8petsc4py_5PETSc_4SNES_max_funcs, PyDoc_STR("SNES.max_funcs: int\nMaximum number of function evaluations.\nSource code at petsc4py/PETSc/SNES.pyx:2543"), 0},
  {"its", __pyx_getprop_8petsc4py_5PETSc_4SNES_its, __pyx_setprop_8petsc4py_5PETSc_4SNES_its, PyDoc_STR("SNES.its: int\nNumber of iterations.\nSource code at petsc4py/PETSc/SNES.pyx:2553"), 0},
  {"norm", __pyx_getprop_8petsc4py_5PETSc_4SNES_norm, __pyx_setprop_8petsc4py_5PETSc_4SNES_norm, PyDoc_STR("SNES.norm: float\nFunction norm.\nSource code at petsc4py/PETSc/SNES.pyx:2561"), 0},
  {"history", __pyx_getprop_8petsc4py_5PETSc_4SNES_history, 0, PyDoc_STR("SNES.history: tuple[ArrayReal, ArrayInt]\nConvergence history.\nSource code at petsc4py/PETSc/SNES.pyx:2569"), 0},
  {"reason", __pyx_getprop_8petsc4py_5PETSc_4SNES_reason, __pyx_setprop_8petsc4py_5PETSc_4SNES_reason, PyDoc_STR("SNES.reason: ConvergedReason\nConverged reason.\nSource code at petsc4py/PETSc/SNES.pyx:2576"), 0},
  {"is_iterating", __pyx_getprop_8petsc4py_5PETSc_4SNES_is_iterating, 0, PyDoc_STR("SNES.is_iterating: bool\nBoolean indicating if the solver has not converged yet.\nSource code at petsc4py/PETSc/SNES.pyx:2584"), 0},
  {"is_converged", __pyx_getprop_8petsc4py_5PETSc_4SNES_is_converged, 0, PyDoc_STR("SNES.is_converged: bool\nBoolean indicating if the solver has converged.\nSource code at petsc4py/PETSc/SNES.pyx:2589"), 0},
  {"is_diverged", __pyx_getprop_8petsc4py_5PETSc_4SNES_is_diverged, 0, PyDoc_STR("SNES.is_diverged: bool\nBoolean indicating if the solver has failed.\nSource code at petsc4py/PETSc/SNES.pyx:2594"), 0},
  {"use_mf", __pyx_getprop_8petsc4py_5PETSc_4SNES_use_mf, __pyx_setprop_8petsc4py_5PETSc_4SNES_use_mf, PyDoc_STR("SNES.use_mf: bool\nBoolean indicating if the solver uses matrix-free finite-differencing.\nSource code at petsc4py/PETSc/SNES.pyx:2601"), 0},
  {"use_fd", __pyx_getprop_8petsc4py_5PETSc_4SNES_use_fd, __pyx_setprop_8petsc4py_5PETSc_4SNES_use_fd, PyDoc_STR("SNES.use_fd: bool\nBoolean indicating if the solver uses coloring finite-differencing.\nSource code at petsc4py/PETSc/SNES.pyx:2609"), 0},
  {"linesearch", __pyx_getprop_8petsc4py_5PETSc_4SNES_linesearch, __pyx_setprop_8petsc4py_5PETSc_4SNES_linesearch, PyDoc_STR("SNES.linesearch: SNESLineSearch\nThe linesearch object associated with this SNES.\nSource code at petsc4py/PETSc/SNES.pyx:2646"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscSNES_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {Py_tp_doc, (void *)PyDoc_STR("Nonlinear equations solver.\n\n    SNES is described in the `PETSc manual <petsc:manual/snes>`.\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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 <petsc:manual/snes>`.\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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_SNESLineSearch __pyx_vtable_8petsc4py_5PETSc_SNESLineSearch;

static PyObject *__pyx_tp_new_8petsc4py_5PETSc_SNESLineSearch(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyPetscSNESLineSearchObject *p;
  PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct PyPetscSNESLineSearchObject *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_SNESLineSearch;
  if (unlikely(__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_1__cinit__(o, __pyx_mstate_global->__pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyMethodDef __pyx_methods_8petsc4py_5PETSc_SNESLineSearch[] = {
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_3create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_2create},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_5setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_4setFromOptions},
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_7view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_6view},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_9getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_8getType},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_11setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_10setType},
  {"getTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_13getTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_12getTolerances},
  {"setTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_15setTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_14setTolerances},
  {"getOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_17getOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_16getOrder},
  {"setOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_19setOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_18setOrder},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_14SNESLineSearch_21destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_14SNESLineSearch_20destroy},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscSNESLineSearch_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {Py_tp_doc, (void *)PyDoc_STR("Linesearch object used by SNES solvers.\n\n    See Also\n    --------\n    petsc.SNESLineSearch\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_SNESLineSearch},
  {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_SNESLineSearch},
  {0, 0},
};
static PyType_Spec PyPetscSNESLineSearch_Type_spec = {
  "petsc4py.PETSc.SNESLineSearch",
  sizeof(struct PyPetscSNESLineSearchObject),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  PyPetscSNESLineSearch_Type_slots,
};
#else

DL_EXPORT(PyTypeObject) PyPetscSNESLineSearch_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "petsc4py.PETSc.""SNESLineSearch", /*tp_name*/
  sizeof(struct PyPetscSNESLineSearchObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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("Linesearch object used by SNES solvers.\n\n    See Also\n    --------\n    petsc.SNESLineSearch\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_SNESLineSearch, /*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_SNESLineSearch, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_2view},
  {"load", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_5load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_4load},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_6destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_8create},
  {"clone", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_11clone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_10clone},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_13setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_12setType},
  {"setRKType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_15setRKType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_14setRKType},
  {"setARKIMEXType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_17setARKIMEXType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_16setARKIMEXType},
  {"setARKIMEXFullyImplicit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_19setARKIMEXFullyImplicit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_18setARKIMEXFullyImplicit},
  {"setARKIMEXFastSlowSplit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_21setARKIMEXFastSlowSplit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_20setARKIMEXFastSlowSplit},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_23getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_22getType},
  {"getRKType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_25getRKType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_24getRKType},
  {"getARKIMEXType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_27getARKIMEXType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_26getARKIMEXType},
  {"setDIRKType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_29setDIRKType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_28setDIRKType},
  {"getDIRKType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_31getDIRKType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_30getDIRKType},
  {"setProblemType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_33setProblemType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_32setProblemType},
  {"getProblemType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_35getProblemType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_34getProblemType},
  {"setEquationType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_37setEquationType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_36setEquationType},
  {"getEquationType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_39getEquationType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_38getEquationType},
  {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_41setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_40setOptionsPrefix},
  {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_43getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_42getOptionsPrefix},
  {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_45appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_44appendOptionsPrefix},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_47setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_46setFromOptions},
  {"setAppCtx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_49setAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_48setAppCtx},
  {"getAppCtx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_51getAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_50getAppCtx},
  {"setRHSFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_53setRHSFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_52setRHSFunction},
  {"setRHSJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_55setRHSJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_54setRHSJacobian},
  {"computeRHSFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_57computeRHSFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_56computeRHSFunction},
  {"computeRHSFunctionLinear", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_59computeRHSFunctionLinear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_58computeRHSFunctionLinear},
  {"computeRHSJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_61computeRHSJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_60computeRHSJacobian},
  {"computeRHSJacobianConstant", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_63computeRHSJacobianConstant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_62computeRHSJacobianConstant},
  {"getRHSFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_65getRHSFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_64getRHSFunction},
  {"getRHSJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_67getRHSJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_66getRHSJacobian},
  {"setIFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_69setIFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_68setIFunction},
  {"setIJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_71setIJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_70setIJacobian},
  {"setIJacobianP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_73setIJacobianP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_72setIJacobianP},
  {"computeIFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_75computeIFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_74computeIFunction},
  {"computeIJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_77computeIJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_76computeIJacobian},
  {"computeIJacobianP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_79computeIJacobianP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_78computeIJacobianP},
  {"getIFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_81getIFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_80getIFunction},
  {"getIJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_83getIJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_82getIJacobian},
  {"setI2Function", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_85setI2Function, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_84setI2Function},
  {"setI2Jacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_87setI2Jacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_86setI2Jacobian},
  {"computeI2Function", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_89computeI2Function, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_88computeI2Function},
  {"computeI2Jacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_91computeI2Jacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_90computeI2Jacobian},
  {"getI2Function", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_93getI2Function, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_92getI2Function},
  {"getI2Jacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_95getI2Jacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_94getI2Jacobian},
  {"setRHSSplitIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_97setRHSSplitIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_96setRHSSplitIS},
  {"setRHSSplitRHSFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_99setRHSSplitRHSFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_98setRHSSplitRHSFunction},
  {"setRHSSplitIFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_101setRHSSplitIFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_100setRHSSplitIFunction},
  {"setRHSSplitIJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_103setRHSSplitIJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_102setRHSSplitIJacobian},
  {"setSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_105setSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_104setSolution},
  {"getSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_107getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_106getSolution},
  {"setSolution2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_109setSolution2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_108setSolution2},
  {"getSolution2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_111getSolution2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_110getSolution2},
  {"setEvaluationTimes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_113setEvaluationTimes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_112setEvaluationTimes},
  {"getEvaluationTimes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_115getEvaluationTimes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_114getEvaluationTimes},
  {"getEvaluationSolutions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_117getEvaluationSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_116getEvaluationSolutions},
  {"setTimeSpan", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_119setTimeSpan, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_118setTimeSpan},
  {"getTimeSpanSolutions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_121getTimeSpanSolutions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_120getTimeSpanSolutions},
  {"getSNES", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_123getSNES, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_122getSNES},
  {"getKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_125getKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_124getKSP},
  {"getDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_127getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_126getDM},
  {"setDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_129setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_128setDM},
  {"setTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_131setTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_130setTime},
  {"getTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_133getTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_132getTime},
  {"getPrevTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_135getPrevTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_134getPrevTime},
  {"getSolveTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_137getSolveTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_136getSolveTime},
  {"setTimeStep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_139setTimeStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_138setTimeStep},
  {"getTimeStep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_141getTimeStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_140getTimeStep},
  {"setStepNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_143setStepNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_142setStepNumber},
  {"getStepNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_145getStepNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_144getStepNumber},
  {"setMaxTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_147setMaxTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_146setMaxTime},
  {"getMaxTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_149getMaxTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_148getMaxTime},
  {"setMaxSteps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_151setMaxSteps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_150setMaxSteps},
  {"getMaxSteps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_153getMaxSteps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_152getMaxSteps},
  {"getSNESIterations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_155getSNESIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_154getSNESIterations},
  {"getKSPIterations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_157getKSPIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_156getKSPIterations},
  {"setMaxStepRejections", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_159setMaxStepRejections, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_158setMaxStepRejections},
  {"getStepRejections", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_161getStepRejections, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_160getStepRejections},
  {"setMaxSNESFailures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_163setMaxSNESFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_162setMaxSNESFailures},
  {"getSNESFailures", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_165getSNESFailures, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_164getSNESFailures},
  {"setErrorIfStepFails", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_167setErrorIfStepFails, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_166setErrorIfStepFails},
  {"setTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_169setTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_168setTolerances},
  {"getTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_171getTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_170getTolerances},
  {"setExactFinalTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_173setExactFinalTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_172setExactFinalTime},
  {"setConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_175setConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_174setConvergedReason},
  {"getConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_177getConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_176getConvergedReason},
  {"setMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_179setMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_178setMonitor},
  {"getMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_181getMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_180getMonitor},
  {"monitorCancel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_183monitorCancel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_182monitorCancel},
  {"monitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_185monitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_184monitor},
  {"setEventHandler", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_187setEventHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_186setEventHandler},
  {"setEventTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_189setEventTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_188setEventTolerances},
  {"getNumEvents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_191getNumEvents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_190getNumEvents},
  {"setPreStep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_193setPreStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_192setPreStep},
  {"getPreStep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_195getPreStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_194getPreStep},
  {"setPostStep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_197setPostStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_196setPostStep},
  {"getPostStep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_199getPostStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_198getPostStep},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_201setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_200setUp},
  {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_203reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_202reset},
  {"step", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_205step, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_204step},
  {"restartStep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_207restartStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_206restartStep},
  {"rollBack", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_209rollBack, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_208rollBack},
  {"solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_211solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_210solve},
  {"interpolate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_213interpolate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_212interpolate},
  {"setStepLimits", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_215setStepLimits, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_214setStepLimits},
  {"getStepLimits", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_217getStepLimits, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_216getStepLimits},
  {"setSaveTrajectory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_219setSaveTrajectory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_218setSaveTrajectory},
  {"removeTrajectory", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_221removeTrajectory, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_220removeTrajectory},
  {"getCostIntegral", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_223getCostIntegral, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_222getCostIntegral},
  {"setCostGradients", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_225setCostGradients, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_224setCostGradients},
  {"getCostGradients", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_227getCostGradients, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_226getCostGradients},
  {"setRHSJacobianP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_229setRHSJacobianP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_228setRHSJacobianP},
  {"createQuadratureTS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_231createQuadratureTS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_230createQuadratureTS},
  {"getQuadratureTS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_233getQuadratureTS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_232getQuadratureTS},
  {"setRHSJacobianP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_235setRHSJacobianP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_234setRHSJacobianP},
  {"computeRHSJacobianP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_237computeRHSJacobianP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_236computeRHSJacobianP},
  {"adjointSetSteps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_239adjointSetSteps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_238adjointSetSteps},
  {"adjointSetUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_241adjointSetUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_240adjointSetUp},
  {"adjointSolve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_243adjointSolve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_242adjointSolve},
  {"adjointStep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_245adjointStep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_244adjointStep},
  {"adjointReset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_247adjointReset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_246adjointReset},
  {"createPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_249createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_248createPython},
  {"setPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_251setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_250setPythonContext},
  {"getPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_253getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_252getPythonContext},
  {"setPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_255setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_254setPythonType},
  {"getPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_257getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_256getPythonType},
  {"setTheta", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_259setTheta, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_258setTheta},
  {"getTheta", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_261getTheta, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_260getTheta},
  {"setThetaEndpoint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_263setThetaEndpoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_262setThetaEndpoint},
  {"getThetaEndpoint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_265getThetaEndpoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_264getThetaEndpoint},
  {"setAlphaRadius", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_267setAlphaRadius, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_266setAlphaRadius},
  {"setAlphaParams", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_269setAlphaParams, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_268setAlphaParams},
  {"getAlphaParams", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2TS_271getAlphaParams, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2TS_270getAlphaParams},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_TS[] = {
  {"appctx", __pyx_getprop_8petsc4py_5PETSc_2TS_appctx, __pyx_setprop_8petsc4py_5PETSc_2TS_appctx, PyDoc_STR("TS.appctx: Any\nApplication context.\nSource code at petsc4py/PETSc/TS.pyx:3145"), 0},
  {"dm", __pyx_getprop_8petsc4py_5PETSc_2TS_dm, __pyx_setprop_8petsc4py_5PETSc_2TS_dm, PyDoc_STR("TS.dm: DM\nThe `DM`.\nSource code at petsc4py/PETSc/TS.pyx:3155"), 0},
  {"problem_type", __pyx_getprop_8petsc4py_5PETSc_2TS_problem_type, __pyx_setprop_8petsc4py_5PETSc_2TS_problem_type, PyDoc_STR("TS.problem_type: ProblemType\nThe problem type.\nSource code at petsc4py/PETSc/TS.pyx:3165"), 0},
  {"equation_type", __pyx_getprop_8petsc4py_5PETSc_2TS_equation_type, __pyx_setprop_8petsc4py_5PETSc_2TS_equation_type, PyDoc_STR("TS.equation_type: EquationType\nThe equation type.\nSource code at petsc4py/PETSc/TS.pyx:3173"), 0},
  {"snes", __pyx_getprop_8petsc4py_5PETSc_2TS_snes, 0, PyDoc_STR("TS.snes: SNES\nThe `SNES`.\nSource code at petsc4py/PETSc/TS.pyx:3181"), 0},
  {"ksp", __pyx_getprop_8petsc4py_5PETSc_2TS_ksp, 0, PyDoc_STR("TS.ksp: KSP\nThe `KSP`.\nSource code at petsc4py/PETSc/TS.pyx:3186"), 0},
  {"vec_sol", __pyx_getprop_8petsc4py_5PETSc_2TS_vec_sol, 0, PyDoc_STR("TS.vec_sol: Vec\nThe solution vector.\nSource code at petsc4py/PETSc/TS.pyx:3191"), 0},
  {"time", __pyx_getprop_8petsc4py_5PETSc_2TS_time, __pyx_setprop_8petsc4py_5PETSc_2TS_time, PyDoc_STR("TS.time: float\nThe current time.\nSource code at petsc4py/PETSc/TS.pyx:3198"), 0},
  {"time_step", __pyx_getprop_8petsc4py_5PETSc_2TS_time_step, __pyx_setprop_8petsc4py_5PETSc_2TS_time_step, PyDoc_STR("TS.time_step: None\nThe current time step size.\nSource code at petsc4py/PETSc/TS.pyx:3206"), 0},
  {"step_number", __pyx_getprop_8petsc4py_5PETSc_2TS_step_number, __pyx_setprop_8petsc4py_5PETSc_2TS_step_number, PyDoc_STR("TS.step_number: int\nThe current step number.\nSource code at petsc4py/PETSc/TS.pyx:3214"), 0},
  {"max_time", __pyx_getprop_8petsc4py_5PETSc_2TS_max_time, __pyx_setprop_8petsc4py_5PETSc_2TS_max_time, PyDoc_STR("TS.max_time: float\nThe maximum time.\nSource code at petsc4py/PETSc/TS.pyx:3222"), 0},
  {"max_steps", __pyx_getprop_8petsc4py_5PETSc_2TS_max_steps, __pyx_setprop_8petsc4py_5PETSc_2TS_max_steps, PyDoc_STR("TS.max_steps: int\nThe maximum number of steps.\nSource code at petsc4py/PETSc/TS.pyx:3230"), 0},
  {"rtol", __pyx_getprop_8petsc4py_5PETSc_2TS_rtol, __pyx_setprop_8petsc4py_5PETSc_2TS_rtol, PyDoc_STR("TS.rtol: float\nThe relative tolerance.\nSource code at petsc4py/PETSc/TS.pyx:3240"), 0},
  {"atol", __pyx_getprop_8petsc4py_5PETSc_2TS_atol, __pyx_setprop_8petsc4py_5PETSc_2TS_atol, PyDoc_STR("TS.atol: float\nThe absolute tolerance.\nSource code at petsc4py/PETSc/TS.pyx:3248"), 0},
  {"reason", __pyx_getprop_8petsc4py_5PETSc_2TS_reason, __pyx_setprop_8petsc4py_5PETSc_2TS_reason, PyDoc_STR("TS.reason: ConvergedReason\nThe converged reason.\nSource code at petsc4py/PETSc/TS.pyx:3256"), 0},
  {"iterating", __pyx_getprop_8petsc4py_5PETSc_2TS_iterating, 0, PyDoc_STR("TS.iterating: bool\nIndicates the `TS` is still iterating.\nSource code at petsc4py/PETSc/TS.pyx:3264"), 0},
  {"converged", __pyx_getprop_8petsc4py_5PETSc_2TS_converged, 0, PyDoc_STR("TS.converged: bool\nIndicates the `TS` has converged.\nSource code at petsc4py/PETSc/TS.pyx:3269"), 0},
  {"diverged", __pyx_getprop_8petsc4py_5PETSc_2TS_diverged, 0, PyDoc_STR("TS.diverged: bool\nIndicates the `TS` has stopped.\nSource code at petsc4py/PETSc/TS.pyx:3274"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscTS_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {Py_tp_doc, (void *)PyDoc_STR("ODE integrator.\n\n    TS is described in the `PETSc manual <petsc:manual/ts>`.\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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 <petsc:manual/ts>`.\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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_2view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_4destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_6create},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_8setType},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_10getType},
  {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_13setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_12setOptionsPrefix},
  {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_15appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_14appendOptionsPrefix},
  {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_17getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_16getOptionsPrefix},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_19setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_18setFromOptions},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_21setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_20setUp},
  {"setInitialTrustRegionRadius", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_23setInitialTrustRegionRadius, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_22setInitialTrustRegionRadius},
  {"setAppCtx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_25setAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_24setAppCtx},
  {"getAppCtx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_27getAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_26getAppCtx},
  {"setSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_29setSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_28setSolution},
  {"setObjective", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_31setObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_30setObjective},
  {"setResidual", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_33setResidual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_32setResidual},
  {"setJacobianResidual", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_35setJacobianResidual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_34setJacobianResidual},
  {"setGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_37setGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_36setGradient},
  {"getObjective", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_39getObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_38getObjective},
  {"getGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_41getGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_40getGradient},
  {"setObjectiveGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_43setObjectiveGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_42setObjectiveGradient},
  {"getObjectiveAndGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_45getObjectiveAndGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_44getObjectiveAndGradient},
  {"setVariableBounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_47setVariableBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_46setVariableBounds},
  {"setConstraints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_49setConstraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_48setConstraints},
  {"setHessian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_51setHessian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_50setHessian},
  {"getHessian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_53getHessian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_52getHessian},
  {"setJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_55setJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_54setJacobian},
  {"setStateDesignIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_57setStateDesignIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_56setStateDesignIS},
  {"setJacobianState", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_59setJacobianState, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_58setJacobianState},
  {"setJacobianDesign", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_61setJacobianDesign, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_60setJacobianDesign},
  {"getLMVMMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_63getLMVMMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_62getLMVMMat},
  {"setLMVMMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_65setLMVMMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_64setLMVMMat},
  {"setEqualityConstraints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_67setEqualityConstraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_66setEqualityConstraints},
  {"getEqualityConstraints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_69getEqualityConstraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_68getEqualityConstraints},
  {"setJacobianEquality", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_71setJacobianEquality, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_70setJacobianEquality},
  {"getJacobianEquality", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_73getJacobianEquality, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_72getJacobianEquality},
  {"setInequalityConstraints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_75setInequalityConstraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_74setInequalityConstraints},
  {"getInequalityConstraints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_77getInequalityConstraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_76getInequalityConstraints},
  {"setJacobianInequality", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_79setJacobianInequality, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_78setJacobianInequality},
  {"getJacobianInequality", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_81getJacobianInequality, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_80getJacobianInequality},
  {"setUpdate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_83setUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_82setUpdate},
  {"getUpdate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_85getUpdate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_84getUpdate},
  {"computeObjective", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_87computeObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_86computeObjective},
  {"computeResidual", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_89computeResidual, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_88computeResidual},
  {"computeGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_91computeGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_90computeGradient},
  {"computeObjectiveGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_93computeObjectiveGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_92computeObjectiveGradient},
  {"computeDualVariables", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_95computeDualVariables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_94computeDualVariables},
  {"computeVariableBounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_97computeVariableBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_96computeVariableBounds},
  {"computeConstraints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_99computeConstraints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_98computeConstraints},
  {"computeHessian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_101computeHessian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_100computeHessian},
  {"computeJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_103computeJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_102computeJacobian},
  {"setTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_105setTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_104setTolerances},
  {"getTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_107getTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_106getTolerances},
  {"setMaximumIterations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_109setMaximumIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_108setMaximumIterations},
  {"getMaximumIterations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_111getMaximumIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_110getMaximumIterations},
  {"setMaximumFunctionEvaluations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_113setMaximumFunctionEvaluations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_112setMaximumFunctionEvaluations},
  {"getMaximumFunctionEvaluations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_115getMaximumFunctionEvaluations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_114getMaximumFunctionEvaluations},
  {"setConstraintTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_117setConstraintTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_116setConstraintTolerances},
  {"getConstraintTolerances", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_119getConstraintTolerances, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_118getConstraintTolerances},
  {"setConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_121setConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_120setConvergenceTest},
  {"getConvergenceTest", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_123getConvergenceTest, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_122getConvergenceTest},
  {"setConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_125setConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_124setConvergedReason},
  {"getConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_127getConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_126getConvergedReason},
  {"setMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_129setMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_128setMonitor},
  {"getMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_131getMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_130getMonitor},
  {"cancelMonitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_133cancelMonitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_132cancelMonitor},
  {"monitor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_135monitor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_134monitor},
  {"solve", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_137solve, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_136solve},
  {"getSolution", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_139getSolution, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_138getSolution},
  {"setGradientNorm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_141setGradientNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_140setGradientNorm},
  {"getGradientNorm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_143getGradientNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_142getGradientNorm},
  {"setLMVMH0", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_145setLMVMH0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_144setLMVMH0},
  {"getLMVMH0", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_147getLMVMH0, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_146getLMVMH0},
  {"getLMVMH0KSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_149getLMVMH0KSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_148getLMVMH0KSP},
  {"getVariableBounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_151getVariableBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_150getVariableBounds},
  {"setBNCGType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_153setBNCGType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_152setBNCGType},
  {"getBNCGType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_155getBNCGType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_154getBNCGType},
  {"setIterationNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_157setIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_156setIterationNumber},
  {"getIterationNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_159getIterationNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_158getIterationNumber},
  {"getObjectiveValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_161getObjectiveValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_160getObjectiveValue},
  {"getConvergedReason", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_163getConvergedReason, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_162getConvergedReason},
  {"getSolutionNorm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_165getSolutionNorm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_164getSolutionNorm},
  {"getSolutionStatus", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_167getSolutionStatus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_166getSolutionStatus},
  {"checkConverged", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_169checkConverged, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_168checkConverged},
  {"getKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_171getKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_170getKSP},
  {"getTerm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_173getTerm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_172getTerm},
  {"addTerm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_175addTerm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_174addTerm},
  {"getALMMSubsolver", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_177getALMMSubsolver, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_176getALMMSubsolver},
  {"getALMMType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_179getALMMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_178getALMMType},
  {"setALMMSubsolver", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_181setALMMSubsolver, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_180setALMMSubsolver},
  {"setALMMType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_183setALMMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_182setALMMType},
  {"getBRGNSubsolver", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_185getBRGNSubsolver, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_184getBRGNSubsolver},
  {"setBRGNRegularizerObjectiveGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_187setBRGNRegularizerObjectiveGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_186setBRGNRegularizerObjectiveGradient},
  {"setBRGNRegularizerHessian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_189setBRGNRegularizerHessian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_188setBRGNRegularizerHessian},
  {"setBRGNRegularizerWeight", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_191setBRGNRegularizerWeight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_190setBRGNRegularizerWeight},
  {"setBRGNSmoothL1Epsilon", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_193setBRGNSmoothL1Epsilon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_192setBRGNSmoothL1Epsilon},
  {"setBRGNDictionaryMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_195setBRGNDictionaryMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_194setBRGNDictionaryMatrix},
  {"getBRGNDampingVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_197getBRGNDampingVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_196getBRGNDampingVector},
  {"createPython", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_199createPython, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_198createPython},
  {"setPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_201setPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_200setPythonContext},
  {"getPythonContext", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_203getPythonContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_202getPythonContext},
  {"setPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_205setPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_204setPythonType},
  {"getPythonType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_207getPythonType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_206getPythonType},
  {"getLineSearch", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3TAO_209getLineSearch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3TAO_208getLineSearch},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_TAO[] = {
  {"appctx", __pyx_getprop_8petsc4py_5PETSc_3TAO_appctx, __pyx_setprop_8petsc4py_5PETSc_3TAO_appctx, PyDoc_STR("TAO.appctx: Any\nApplication context.\nSource code at petsc4py/PETSc/TAO.pyx:2060"), 0},
  {"ksp", __pyx_getprop_8petsc4py_5PETSc_3TAO_ksp, 0, PyDoc_STR("TAO.ksp: KSP\nLinear solver.\nSource code at petsc4py/PETSc/TAO.pyx:2070"), 0},
  {"ftol", __pyx_getprop_8petsc4py_5PETSc_3TAO_ftol, __pyx_setprop_8petsc4py_5PETSc_3TAO_ftol, PyDoc_STR("TAO.ftol: Any\nBroken.\nSource code at petsc4py/PETSc/TAO.pyx:2078"), 0},
  {"gtol", __pyx_getprop_8petsc4py_5PETSc_3TAO_gtol, __pyx_setprop_8petsc4py_5PETSc_3TAO_gtol, PyDoc_STR("TAO.gtol: Any\nBroken.\nSource code at petsc4py/PETSc/TAO.pyx:2091"), 0},
  {"ctol", __pyx_getprop_8petsc4py_5PETSc_3TAO_ctol, __pyx_setprop_8petsc4py_5PETSc_3TAO_ctol, PyDoc_STR("TAO.ctol: Any\nBroken.\nSource code at petsc4py/PETSc/TAO.pyx:2104"), 0},
  {"its", __pyx_getprop_8petsc4py_5PETSc_3TAO_its, 0, PyDoc_STR("TAO.its: int\nNumber of iterations.\nSource code at petsc4py/PETSc/TAO.pyx:2119"), 0},
  {"gnorm", __pyx_getprop_8petsc4py_5PETSc_3TAO_gnorm, 0, PyDoc_STR("TAO.gnorm: float\nGradient norm.\nSource code at petsc4py/PETSc/TAO.pyx:2124"), 0},
  {"cnorm", __pyx_getprop_8petsc4py_5PETSc_3TAO_cnorm, 0, PyDoc_STR("TAO.cnorm: float\nConstraints norm.\nSource code at petsc4py/PETSc/TAO.pyx:2129"), 0},
  {"solution", __pyx_getprop_8petsc4py_5PETSc_3TAO_solution, 0, PyDoc_STR("TAO.solution: Vec\nSolution vector.\nSource code at petsc4py/PETSc/TAO.pyx:2134"), 0},
  {"objective", __pyx_getprop_8petsc4py_5PETSc_3TAO_objective, 0, PyDoc_STR("TAO.objective: float\nObjective value.\nSource code at petsc4py/PETSc/TAO.pyx:2139"), 0},
  {"function", __pyx_getprop_8petsc4py_5PETSc_3TAO_function, 0, PyDoc_STR("TAO.function: float\nObjective value.\nSource code at petsc4py/PETSc/TAO.pyx:2144"), 0},
  {"gradient", __pyx_getprop_8petsc4py_5PETSc_3TAO_gradient, 0, PyDoc_STR("TAO.gradient: Vec\nGradient vector.\nSource code at petsc4py/PETSc/TAO.pyx:2149"), 0},
  {"reason", __pyx_getprop_8petsc4py_5PETSc_3TAO_reason, 0, PyDoc_STR("TAO.reason: ConvergedReason\nConverged reason.\nSource code at petsc4py/PETSc/TAO.pyx:2156"), 0},
  {"iterating", __pyx_getprop_8petsc4py_5PETSc_3TAO_iterating, 0, PyDoc_STR("TAO.iterating: bool\nBoolean indicating if the solver has not converged yet.\nSource code at petsc4py/PETSc/TAO.pyx:2161"), 0},
  {"converged", __pyx_getprop_8petsc4py_5PETSc_3TAO_converged, 0, PyDoc_STR("TAO.converged: bool\nBoolean indicating if the solver has converged.\nSource code at petsc4py/PETSc/TAO.pyx:2166"), 0},
  {"diverged", __pyx_getprop_8petsc4py_5PETSc_3TAO_diverged, 0, PyDoc_STR("TAO.diverged: bool\nBoolean indicating if the solver has failed.\nSource code at petsc4py/PETSc/TAO.pyx:2171"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscTAO_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {Py_tp_doc, (void *)PyDoc_STR("Optimization solver.\n\n    TAO is described in the `PETSc manual <petsc:manual/tao>`.\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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 <petsc:manual/tao>`.\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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_2view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_4destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_6create},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_8setType},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_10getType},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_13setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_12setFromOptions},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_15setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_14setUp},
  {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_17setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_16setOptionsPrefix},
  {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_19getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_18getOptionsPrefix},
  {"setObjective", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_21setObjective, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_20setObjective},
  {"setGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_23setGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_22setGradient},
  {"setObjectiveGradient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_25setObjectiveGradient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_24setObjectiveGradient},
  {"useTAORoutine", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_27useTAORoutine, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_26useTAORoutine},
  {"apply", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_29apply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_28apply},
  {"setInitialStepLength", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_13TAOLineSearch_31setInitialStepLength, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_13TAOLineSearch_30setInitialStepLength},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscTAOLineSearch_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_TAOTerm __pyx_vtable_8petsc4py_5PETSc_TAOTerm;

static PyObject *__pyx_tp_new_8petsc4py_5PETSc_TAOTerm(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyPetscTAOTermObject *p;
  PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct PyPetscTAOTermObject *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_TAOTerm;
  if (unlikely(__pyx_pw_8petsc4py_5PETSc_7TAOTerm_1__cinit__(o, __pyx_mstate_global->__pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyMethodDef __pyx_methods_8petsc4py_5PETSc_TAOTerm[] = {
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7TAOTerm_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7TAOTerm_2view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7TAOTerm_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7TAOTerm_4destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7TAOTerm_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7TAOTerm_6create},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7TAOTerm_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7TAOTerm_8setType},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7TAOTerm_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7TAOTerm_10getType},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7TAOTerm_13setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7TAOTerm_12setFromOptions},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7TAOTerm_15setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7TAOTerm_14setUp},
  {"setSolutionTemplate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7TAOTerm_17setSolutionTemplate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7TAOTerm_16setSolutionTemplate},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscTAOTerm_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {Py_tp_doc, (void *)PyDoc_STR("TAO Term.")},
  {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_TAOTerm},
  {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_TAOTerm},
  {0, 0},
};
static PyType_Spec PyPetscTAOTerm_Type_spec = {
  "petsc4py.PETSc.TAOTerm",
  sizeof(struct PyPetscTAOTermObject),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  PyPetscTAOTerm_Type_slots,
};
#else

DL_EXPORT(PyTypeObject) PyPetscTAOTerm_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "petsc4py.PETSc.""TAOTerm", /*tp_name*/
  sizeof(struct PyPetscTAOTermObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 Term."), /*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_TAOTerm, /*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_TAOTerm, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_2view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_4destroy},
  {"createBasic", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_7createBasic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_6createBasic},
  {"createMemoryScalable", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_9createMemoryScalable, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_8createMemoryScalable},
  {"createMapping", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_11createMapping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_10createMapping},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_13getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_12getType},
  {"app2petsc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2AO_15app2petsc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2AO_14app2petsc},
  {"petsc2app", (PyCFunction)(void(*)(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_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_2view},
  {"load", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_5load, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_4load},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_6destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_9create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_8create},
  {"clone", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_11clone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_10clone},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_13setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_12setType},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_15getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_14getType},
  {"getDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_17getDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_16getDimension},
  {"setDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_19setDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_18setDimension},
  {"getCoordinateDim", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_21getCoordinateDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_20getCoordinateDim},
  {"setCoordinateDim", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_23setCoordinateDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_22setCoordinateDim},
  {"setOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_25setOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_24setOptionsPrefix},
  {"getOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_27getOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_26getOptionsPrefix},
  {"appendOptionsPrefix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_29appendOptionsPrefix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_28appendOptionsPrefix},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_31setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_30setFromOptions},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_33setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_32setUp},
  {"setAppCtx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_35setAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_34setAppCtx},
  {"getAppCtx", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_37getAppCtx, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_36getAppCtx},
  {"getUseNatural", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_39getUseNatural, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_38getUseNatural},
  {"setUseNatural", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_41setUseNatural, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_40setUseNatural},
  {"setBasicAdjacency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_43setBasicAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_42setBasicAdjacency},
  {"getBasicAdjacency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_45getBasicAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_44getBasicAdjacency},
  {"setFieldAdjacency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_47setFieldAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_46setFieldAdjacency},
  {"getFieldAdjacency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_49getFieldAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_48getFieldAdjacency},
  {"createSubDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_51createSubDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_50createSubDM},
  {"setAuxiliaryVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_53setAuxiliaryVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_52setAuxiliaryVec},
  {"getAuxiliaryVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_55getAuxiliaryVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_54getAuxiliaryVec},
  {"setNumFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_57setNumFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_56setNumFields},
  {"getNumFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_59getNumFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_58getNumFields},
  {"setField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_61setField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_60setField},
  {"getField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_63getField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_62getField},
  {"addField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_65addField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_64addField},
  {"clearFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_67clearFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_66clearFields},
  {"copyFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_69copyFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_68copyFields},
  {"createDS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_71createDS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_70createDS},
  {"clearDS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_73clearDS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_72clearDS},
  {"getDS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_75getDS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_74getDS},
  {"copyDS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_77copyDS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_76copyDS},
  {"copyDisc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_79copyDisc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_78copyDisc},
  {"getBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_81getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_80getBlockSize},
  {"setVecType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_83setVecType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_82setVecType},
  {"createGlobalVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_85createGlobalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_84createGlobalVec},
  {"createLocalVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_87createLocalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_86createLocalVec},
  {"getGlobalVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_89getGlobalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_88getGlobalVec},
  {"restoreGlobalVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_91restoreGlobalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_90restoreGlobalVec},
  {"getLocalVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_93getLocalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_92getLocalVec},
  {"restoreLocalVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_95restoreLocalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_94restoreLocalVec},
  {"globalToLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_97globalToLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_96globalToLocal},
  {"localToGlobal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_99localToGlobal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_98localToGlobal},
  {"localToLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_101localToLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_100localToLocal},
  {"getLGMap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_103getLGMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_102getLGMap},
  {"getCoarseDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_105getCoarseDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_104getCoarseDM},
  {"setCoarseDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_107setCoarseDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_106setCoarseDM},
  {"getCoordinateDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_109getCoordinateDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_108getCoordinateDM},
  {"getCoordinateSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_111getCoordinateSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_110getCoordinateSection},
  {"setCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_113setCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_112setCoordinates},
  {"getCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_115getCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_114getCoordinates},
  {"setCoordinatesLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_117setCoordinatesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_116setCoordinatesLocal},
  {"getCoordinatesLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_119getCoordinatesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_118getCoordinatesLocal},
  {"setCellCoordinateDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_121setCellCoordinateDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_120setCellCoordinateDM},
  {"getCellCoordinateDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_123getCellCoordinateDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_122getCellCoordinateDM},
  {"setCellCoordinateSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_125setCellCoordinateSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_124setCellCoordinateSection},
  {"getCellCoordinateSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_127getCellCoordinateSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_126getCellCoordinateSection},
  {"setCellCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_129setCellCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_128setCellCoordinates},
  {"getCellCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_131getCellCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_130getCellCoordinates},
  {"setCellCoordinatesLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_133setCellCoordinatesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_132setCellCoordinatesLocal},
  {"getCellCoordinatesLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_135getCellCoordinatesLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_134getCellCoordinatesLocal},
  {"setCoordinateDisc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_137setCoordinateDisc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_136setCoordinateDisc},
  {"getCoordinatesLocalized", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_139getCoordinatesLocalized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_138getCoordinatesLocalized},
  {"getSparseLocalize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_141getSparseLocalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_140getSparseLocalize},
  {"setSparseLocalize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_143setSparseLocalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_142setSparseLocalize},
  {"getBoundingBox", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_145getBoundingBox, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_144getBoundingBox},
  {"getLocalBoundingBox", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_147getLocalBoundingBox, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_146getLocalBoundingBox},
  {"localizeCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_149localizeCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_148localizeCoordinates},
  {"getPeriodicity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_151getPeriodicity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_150getPeriodicity},
  {"setPeriodicity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_153setPeriodicity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_152setPeriodicity},
  {"setMatType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_155setMatType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_154setMatType},
  {"createMat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_157createMat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_156createMat},
  {"createMassMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_159createMassMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_158createMassMatrix},
  {"createInterpolation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_161createInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_160createInterpolation},
  {"createInjection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_163createInjection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_162createInjection},
  {"createRestriction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_165createRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_164createRestriction},
  {"convert", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_167convert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_166convert},
  {"refine", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_169refine, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_168refine},
  {"coarsen", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_171coarsen, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_170coarsen},
  {"refineHierarchy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_173refineHierarchy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_172refineHierarchy},
  {"coarsenHierarchy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_175coarsenHierarchy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_174coarsenHierarchy},
  {"getRefineLevel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_177getRefineLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_176getRefineLevel},
  {"setRefineLevel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_179setRefineLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_178setRefineLevel},
  {"getCoarsenLevel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_181getCoarsenLevel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_180getCoarsenLevel},
  {"adaptLabel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_183adaptLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_182adaptLabel},
  {"adaptMetric", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_185adaptMetric, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_184adaptMetric},
  {"getLabel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_187getLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_186getLabel},
  {"setLocalSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_189setLocalSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_188setLocalSection},
  {"getLocalSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_191getLocalSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_190getLocalSection},
  {"setGlobalSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_193setGlobalSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_192setGlobalSection},
  {"getGlobalSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_195getGlobalSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_194getGlobalSection},
  {"createSectionSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_197createSectionSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_196createSectionSF},
  {"getSectionSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_199getSectionSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_198getSectionSF},
  {"setSectionSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_201setSectionSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_200setSectionSF},
  {"getPointSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_203getPointSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_202getPointSF},
  {"setPointSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_205setPointSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_204setPointSF},
  {"getNumLabels", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_207getNumLabels, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_206getNumLabels},
  {"getLabelName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_209getLabelName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_208getLabelName},
  {"hasLabel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_211hasLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_210hasLabel},
  {"createLabel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_213createLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_212createLabel},
  {"removeLabel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_215removeLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_214removeLabel},
  {"getLabelValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_217getLabelValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_216getLabelValue},
  {"setLabelValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_219setLabelValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_218setLabelValue},
  {"clearLabelValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_221clearLabelValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_220clearLabelValue},
  {"getLabelSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_223getLabelSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_222getLabelSize},
  {"getLabelIdIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_225getLabelIdIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_224getLabelIdIS},
  {"getStratumSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_227getStratumSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_226getStratumSize},
  {"getStratumIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_229getStratumIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_228getStratumIS},
  {"clearLabelStratum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_231clearLabelStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_230clearLabelStratum},
  {"setLabelOutput", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_233setLabelOutput, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_232setLabelOutput},
  {"getLabelOutput", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_235getLabelOutput, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_234getLabelOutput},
  {"setKSPComputeOperators", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_237setKSPComputeOperators, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_236setKSPComputeOperators},
  {"createFieldDecomposition", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_239createFieldDecomposition, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_238createFieldDecomposition},
  {"setSNESFunction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_241setSNESFunction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_240setSNESFunction},
  {"setSNESJacobian", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_243setSNESJacobian, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_242setSNESJacobian},
  {"addCoarsenHook", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DM_245addCoarsenHook, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DM_244addCoarsenHook},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_DM[] = {
  {"appctx", __pyx_getprop_8petsc4py_5PETSc_2DM_appctx, __pyx_setprop_8petsc4py_5PETSc_2DM_appctx, PyDoc_STR("DM.appctx: object\nApplication context.\nSource code at petsc4py/PETSc/DM.pyx:2523"), 0},
  {"ds", __pyx_getprop_8petsc4py_5PETSc_2DM_ds, __pyx_setprop_8petsc4py_5PETSc_2DM_ds, PyDoc_STR("DM.ds: DS\nDiscrete space.\nSource code at petsc4py/PETSc/DM.pyx:2533"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscDM_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {Py_tp_doc, (void *)PyDoc_STR("An object describing a computational grid or mesh.")},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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."), /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_3apply, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_2apply},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_4create},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_6destroy},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_9getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_8getType},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_11setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_10setUp},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_13setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_12setType},
  {"setDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_15setDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_14setDM},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMPlexTransform_17setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMPlexTransform_16setFromOptions},
  {"view", (PyCFunction)(void(*)(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_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {Py_tp_doc, (void *)PyDoc_STR("Mesh transformations.")},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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("Mesh transformations."), /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_CellDM __pyx_vtable_8petsc4py_5PETSc_CellDM;

static PyObject *__pyx_tp_new_8petsc4py_5PETSc_CellDM(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyPetscDMSwarmCellDMObject *p;
  PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct PyPetscDMSwarmCellDMObject *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_CellDM;
  if (unlikely(__pyx_pw_8petsc4py_5PETSc_6CellDM_1__cinit__(o, __pyx_mstate_global->__pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyMethodDef __pyx_methods_8petsc4py_5PETSc_CellDM[] = {
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6CellDM_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6CellDM_2view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6CellDM_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6CellDM_4destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6CellDM_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6CellDM_6create},
  {"getDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6CellDM_9getDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6CellDM_8getDM},
  {"getCellID", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6CellDM_11getCellID, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6CellDM_10getCellID},
  {"getBlockSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6CellDM_13getBlockSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6CellDM_12getBlockSize},
  {"getFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6CellDM_15getFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6CellDM_14getFields},
  {"getCoordinateFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6CellDM_17getCoordinateFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6CellDM_16getCoordinateFields},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscDMSwarmCellDM_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {Py_tp_doc, (void *)PyDoc_STR("CellDM object.\n\n    See Also\n    --------\n    petsc.DMSwarmCellDM\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_CellDM},
  {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_CellDM},
  {0, 0},
};
static PyType_Spec PyPetscDMSwarmCellDM_Type_spec = {
  "petsc4py.PETSc.CellDM",
  sizeof(struct PyPetscDMSwarmCellDMObject),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  PyPetscDMSwarmCellDM_Type_slots,
};
#else

DL_EXPORT(PyTypeObject) PyPetscDMSwarmCellDM_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "petsc4py.PETSc.""CellDM", /*tp_name*/
  sizeof(struct PyPetscDMSwarmCellDMObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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("CellDM object.\n\n    See Also\n    --------\n    petsc.DMSwarmCellDM\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_CellDM, /*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_CellDM, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_2view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_4destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_6create},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_8setType},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_10getType},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_13setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_12setFromOptions},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_15setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_14setUp},
  {"getSpatialDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_17getSpatialDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_16getSpatialDimension},
  {"getCoordinateDimension", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_19getCoordinateDimension, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_18getCoordinateDimension},
  {"getNumFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_21getNumFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_20getNumFields},
  {"getFieldIndex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_23getFieldIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_22getFieldIndex},
  {"getTotalDimensions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_25getTotalDimensions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_24getTotalDimensions},
  {"getTotalComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_27getTotalComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_26getTotalComponents},
  {"getDimensions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_29getDimensions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_28getDimensions},
  {"getComponents", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_2DS_31getComponents, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_2DS_30getComponents},
  {"setDiscretisation", (PyCFunction)(void(*)(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_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_2view},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_5destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_4destroy},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_6create},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_9setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_8setType},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_11getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_10getType},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_13setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_12setFromOptions},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_15setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_14setUp},
  {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11Partitioner_17reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11Partitioner_16reset},
  {"setShellPartition", (PyCFunction)(void(*)(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_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_mstate_global->__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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_3destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_2destroy},
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_5view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_4view},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_7create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_6create},
  {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_9duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_8duplicate},
  {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_11reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_10reset},
  {"insertIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_13insertIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_12insertIS},
  {"setValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_15setValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_14setValue},
  {"getValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_17getValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_16getValue},
  {"getDefaultValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_19getDefaultValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_18getDefaultValue},
  {"setDefaultValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_21setDefaultValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_20setDefaultValue},
  {"clearValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_23clearValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_22clearValue},
  {"addStratum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_25addStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_24addStratum},
  {"addStrata", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_27addStrata, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_26addStrata},
  {"addStrataIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_29addStrataIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_28addStrataIS},
  {"getNumValues", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_31getNumValues, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_30getNumValues},
  {"getValueIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_33getValueIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_32getValueIS},
  {"stratumHasPoint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_35stratumHasPoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_34stratumHasPoint},
  {"hasStratum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_37hasStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_36hasStratum},
  {"getStratumSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_39getStratumSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_38getStratumSize},
  {"getStratumIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_41getStratumIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_40getStratumIS},
  {"setStratumIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_43setStratumIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_42setStratumIS},
  {"clearStratum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_45clearStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_44clearStratum},
  {"computeIndex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_47computeIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_46computeIndex},
  {"createIndex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_49createIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_48createIndex},
  {"destroyIndex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_51destroyIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_50destroyIndex},
  {"hasValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_53hasValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_52hasValue},
  {"hasPoint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_55hasPoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_54hasPoint},
  {"getBounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_57getBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_56getBounds},
  {"filter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_59filter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_58filter},
  {"permute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_61permute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_60permute},
  {"distribute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_63distribute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_62distribute},
  {"gather", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_65gather, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_64gather},
  {"convertToSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMLabel_67convertToSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMLabel_66convertToSection},
  {"getNonEmptyStratumValuesIS", (PyCFunction)(void(*)(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_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_Regressor __pyx_vtable_8petsc4py_5PETSc_Regressor;

static PyObject *__pyx_tp_new_8petsc4py_5PETSc_Regressor(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyPetscRegressorObject *p;
  PyObject *o = __pyx_tp_new_8petsc4py_5PETSc_Object(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct PyPetscRegressorObject *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc_Object*)__pyx_vtabptr_8petsc4py_5PETSc_Regressor;
  if (unlikely(__pyx_pw_8petsc4py_5PETSc_9Regressor_1__cinit__(o, __pyx_mstate_global->__pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Regressor[] = {
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_3view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_2view},
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_4create},
  {"setRegularizerWeight", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_7setRegularizerWeight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_6setRegularizerWeight},
  {"setFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_9setFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_8setFromOptions},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_11setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_10setUp},
  {"fit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_13fit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_12fit},
  {"predict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_15predict, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_14predict},
  {"getTAO", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_17getTAO, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_16getTAO},
  {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_19reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_18reset},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_21destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_20destroy},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_23setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_22setType},
  {"getType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_25getType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_24getType},
  {"setLinearFitIntercept", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_27setLinearFitIntercept, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_26setLinearFitIntercept},
  {"setLinearUseKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_29setLinearUseKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_28setLinearUseKSP},
  {"getLinearKSP", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_31getLinearKSP, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_30getLinearKSP},
  {"getLinearCoefficients", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_33getLinearCoefficients, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_32getLinearCoefficients},
  {"getLinearIntercept", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_35getLinearIntercept, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_34getLinearIntercept},
  {"setLinearType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_37setLinearType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_36setLinearType},
  {"getLinearType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_9Regressor_39getLinearType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_9Regressor_38getLinearType},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot PyPetscRegressor_Type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {Py_tp_doc, (void *)PyDoc_STR("Regression solver.\n\n    REGRESSOR  is described in the `PETSc manual <petsc:manual/regressor>`.\n\n    See Also\n    --------\n    petsc.PetscRegressor\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_Regressor},
  {Py_tp_new, (void *)__pyx_tp_new_8petsc4py_5PETSc_Regressor},
  {0, 0},
};
static PyType_Spec PyPetscRegressor_Type_spec = {
  "petsc4py.PETSc.Regressor",
  sizeof(struct PyPetscRegressorObject),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  PyPetscRegressor_Type_slots,
};
#else

DL_EXPORT(PyTypeObject) PyPetscRegressor_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "petsc4py.PETSc.""Regressor", /*tp_name*/
  sizeof(struct PyPetscRegressorObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8petsc4py_5PETSc_Object, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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("Regression solver.\n\n    REGRESSOR  is described in the `PETSc manual <petsc:manual/regressor>`.\n\n    See Also\n    --------\n    petsc.PetscRegressor\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_Regressor, /*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_Regressor, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  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(__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_DeallocKeepAliveBegin(o);
    __pyx_pw_8petsc4py_5PETSc_10_IS_buffer_3__dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    PyErr_Restore(etype, eval, etb);
  }
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #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(*)(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(*)(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[] = {
  {"__array_interface__", __pyx_getprop_8petsc4py_5PETSc_10_IS_buffer___array_interface__, 0, 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 = {
  __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 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 = {
  __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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  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(__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_DeallocKeepAliveBegin(o);
    __pyx_pw_8petsc4py_5PETSc_11_Vec_buffer_3__dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    PyErr_Restore(etype, eval, etb);
  }
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #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(*)(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(*)(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[] = {
  {"__array_interface__", __pyx_getprop_8petsc4py_5PETSc_11_Vec_buffer___array_interface__, 0, 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 = {
  __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 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 = {
  __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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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, PyObject *a, PyObject *k) {
  struct __pyx_obj_8petsc4py_5PETSc__Vec_LocalForm *p;
  PyObject *o;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  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);
  if (unlikely(__pyx_pw_8petsc4py_5PETSc_14_Vec_LocalForm_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_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(__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);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #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;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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(*)(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(*)(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_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_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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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__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
  0, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  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(__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);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #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;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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 = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  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_GetFullyQualifiedName(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(*)(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(*)(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[] = {
  {"starts", __pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_starts, 0, 0, 0},
  {"sizes", __pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_sizes, 0, 0, 0},
  {"shape", __pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_shape, 0, 0, 0},
  {"strides", __pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_strides, 0, 0, 0},
  {"array", __pyx_getprop_8petsc4py_5PETSc_15_DMDA_Vec_array_array, 0, 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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  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(__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_DeallocKeepAliveBegin(o);
    __pyx_pw_8petsc4py_5PETSc_19_DMComposite_access_3__dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->locs_mem);
  Py_CLEAR(p->vecs_mem);
  Py_CLEAR(p->access);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #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;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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(*)(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(*)(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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  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(__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_DeallocKeepAliveBegin(o);
    __pyx_pw_8petsc4py_5PETSc_7Options_3__dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_prefix);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #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;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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 = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_13create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_12create},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_15destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_14destroy},
  {"clear", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_17clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_16clear},
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_19view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_18view},
  {"prefixPush", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_21prefixPush, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_20prefixPush},
  {"prefixPop", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_23prefixPop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_22prefixPop},
  {"hasName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_25hasName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_24hasName},
  {"used", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_27used, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_26used},
  {"setValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_29setValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_28setValue},
  {"delValue", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_31delValue, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_30delValue},
  {"getBool", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_33getBool, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_32getBool},
  {"getBoolArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_35getBoolArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_34getBoolArray},
  {"getInt", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_37getInt, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_36getInt},
  {"getIntArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_39getIntArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_38getIntArray},
  {"getReal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_41getReal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_40getReal},
  {"getRealArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_43getRealArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_42getRealArray},
  {"getScalar", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_45getScalar, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_44getScalar},
  {"getScalarArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_47getScalarArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_46getScalarArray},
  {"getString", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_49getString, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_48getString},
  {"insertString", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_51insertString, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_50insertString},
  {"getAll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7Options_53getAll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7Options_52getAll},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8petsc4py_5PETSc_Options[] = {
  {"prefix", __pyx_getprop_8petsc4py_5PETSc_7Options_prefix, __pyx_setprop_8petsc4py_5PETSc_7Options_prefix, PyDoc_STR("Options.prefix: str\nPrefix for options.\nSource code at petsc4py/PETSc/Options.pyx:67"), 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("The options database object.\n\n    A dictionary-like object to store and operate with\n    command line options.\n\n    Parameters\n    ----------\n    prefix : str, optional\n        Optional string to prepend to all the options.\n\n    Examples\n    --------\n    Create an option database and operate with it.\n\n    >>> from petsc4py import PETSc\n    >>> opts = PETSc.Options()\n    >>> opts['a'] = 1 # insert the command-line option '-a 1'\n    >>> if 'a' in opts: # if the option is present\n    >>>     val = opts['a'] # return the option value as 'str'\n    >>> a_int = opts.getInt('a') # return the option value as 'int'\n    >>> a_bool = opts.getBool('a') # return the option value as 'bool'\n\n    Read command line and use default values.\n\n    >>> from petsc4py import PETSc\n    >>> opts = PETSc.Options()\n    >>> b_float = opts.getReal('b', 1) # return the value or 1.0 if not present\n\n    Read command line options prepended with a prefix.\n\n    >>> from petsc4py import PETSc\n    >>> opts = PETSc.Options('prefix_')\n    >>> opts.getString('b', 'some_default_string') # read -prefix_b xxx\n\n    See Also\n    --------\n    petsc_options\n\n    ")},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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("The options database object.\n\n    A dictionary-like object to store and operate with\n    command line options.\n\n    Parameters\n    ----------\n    prefix : str, optional\n        Optional string to prepend to all the options.\n\n    Examples\n    --------\n    Create an option database and operate with it.\n\n    >>> from petsc4py import PETSc\n    >>> opts = PETSc.Options()\n    >>> opts['a'] = 1 # insert the command-line option '-a 1'\n    >>> if 'a' in opts: # if the option is present\n    >>>     val = opts['a'] # return the option value as 'str'\n    >>> a_int = opts.getInt('a') # return the option value as 'int'\n    >>> a_bool = opts.getBool('a') # return the option value as 'bool'\n\n    Read command line and use default values.\n\n    >>> from petsc4py import PETSc\n    >>> opts = PETSc.Options()\n    >>> b_float = opts.getReal('b', 1) # return the value or 1.0 if not present\n\n    Read command line options prepended with a prefix.\n\n    >>> from petsc4py import PETSc\n    >>> opts = PETSc.Options('prefix_')\n    >>> opts.getString('b', 'some_default_string') # read -prefix_b xxx\n\n    See Also\n    --------\n    petsc_options\n\n    "), /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_8petsc4py_5PETSc_Sys(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Sys[] = {
  {"getVersion", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_1getVersion, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_getVersion},
  {"getVersionInfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_3getVersionInfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_2getVersionInfo},
  {"isInitialized", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_5isInitialized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_4isInitialized},
  {"isFinalized", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_7isFinalized, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_6isFinalized},
  {"getDefaultComm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_9getDefaultComm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_8getDefaultComm},
  {"setDefaultComm", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_11setDefaultComm, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_10setDefaultComm},
  {"Print", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_13Print, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_12Print},
  {"syncPrint", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_15syncPrint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_14syncPrint},
  {"syncFlush", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_17syncFlush, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_16syncFlush},
  {"splitOwnership", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_19splitOwnership, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_18splitOwnership},
  {"sleep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_21sleep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_20sleep},
  {"pushErrorHandler", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_23pushErrorHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_22pushErrorHandler},
  {"popErrorHandler", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_25popErrorHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_24popErrorHandler},
  {"popSignalHandler", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_27popSignalHandler, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_26popSignalHandler},
  {"infoAllow", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_29infoAllow, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_28infoAllow},
  {"registerCitation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Sys_31registerCitation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Sys_30registerCitation},
  {"hasExternalPackage", (PyCFunction)(void(*)(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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_8petsc4py_5PETSc_Log(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_8petsc4py_5PETSc_Log[] = {
  {"Stage", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_1Stage, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_Stage},
  {"Class", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_3Class, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_2Class},
  {"Event", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_5Event, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_4Event},
  {"begin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_7begin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_6begin},
  {"view", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_9view, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_8view},
  {"logFlops", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_11logFlops, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_10logFlops},
  {"addFlops", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_13addFlops, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_12addFlops},
  {"getFlops", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_15getFlops, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_14getFlops},
  {"getTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_17getTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_16getTime},
  {"getCPUTime", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_19getCPUTime, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_18getCPUTime},
  {"EventDecorator", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_3Log_21EventDecorator, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_3Log_20EventDecorator},
  {"isActive", (PyCFunction)(void(*)(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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_8petsc4py_5PETSc_8LogStage_1__cinit__(o, __pyx_mstate_global->__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(__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
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

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 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 PyMethodDef __pyx_methods_8petsc4py_5PETSc_LogStage[] = {
  {"__enter__", (PyCFunction)(void(*)(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(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_7__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_6__exit__},
  {"push", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_9push, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_8push},
  {"pop", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_11pop, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_10pop},
  {"getName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_13getName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_12getName},
  {"activate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_15activate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_14activate},
  {"deactivate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_17deactivate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_16deactivate},
  {"getActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_19getActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_18getActive},
  {"setActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_21setActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_20setActive},
  {"getVisible", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogStage_23getVisible, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogStage_22getVisible},
  {"setVisible", (PyCFunction)(void(*)(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[] = {
  {"id", __pyx_getprop_8petsc4py_5PETSc_8LogStage_id, 0, PyDoc_STR("LogStage.id: int\nThe log stage identifier.\nSource code at petsc4py/PETSc/Log.pyx:277"), 0},
  {"name", __pyx_getprop_8petsc4py_5PETSc_8LogStage_name, __pyx_setprop_8petsc4py_5PETSc_8LogStage_name, PyDoc_STR("LogStage.name: str\nThe current stage name.\nSource code at petsc4py/PETSc/Log.pyx:330"), 0},
  {"active", __pyx_getprop_8petsc4py_5PETSc_8LogStage_active, __pyx_setprop_8petsc4py_5PETSc_8LogStage_active, PyDoc_STR("LogStage.active: bool\nWhether the stage is activate.\nSource code at petsc4py/PETSc/Log.pyx:393"), 0},
  {"visible", __pyx_getprop_8petsc4py_5PETSc_8LogStage_visible, __pyx_setprop_8petsc4py_5PETSc_8LogStage_visible, PyDoc_STR("LogStage.visible: bool\nWhether the stage is visible.\nSource code at petsc4py/PETSc/Log.pyx:436"), 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__},
  {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*/
  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*/
  __pyx_pw_8petsc4py_5PETSc_8LogStage_3__int__, /*nb_int*/
  0, /*nb_long (reserved)*/
  0, /*nb_float*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  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*/
  0, /*nb_matrix_multiply*/
  0, /*nb_inplace_matrix_multiply*/
};

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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_8petsc4py_5PETSc_8LogClass_1__cinit__(o, __pyx_mstate_global->__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(__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
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

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 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 PyMethodDef __pyx_methods_8petsc4py_5PETSc_LogClass[] = {
  {"getName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_5getName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_4getName},
  {"activate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_7activate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_6activate},
  {"deactivate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_9deactivate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_8deactivate},
  {"getActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogClass_11getActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogClass_10getActive},
  {"setActive", (PyCFunction)(void(*)(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[] = {
  {"id", __pyx_getprop_8petsc4py_5PETSc_8LogClass_id, 0, PyDoc_STR("LogClass.id: int\nThe log class identifier.\nSource code at petsc4py/PETSc/Log.pyx:463"), 0},
  {"name", __pyx_getprop_8petsc4py_5PETSc_8LogClass_name, __pyx_setprop_8petsc4py_5PETSc_8LogClass_name, PyDoc_STR("LogClass.name: str\nThe log class name.\nSource code at petsc4py/PETSc/Log.pyx:482"), 0},
  {"active", __pyx_getprop_8petsc4py_5PETSc_8LogClass_active, __pyx_setprop_8petsc4py_5PETSc_8LogClass_active, PyDoc_STR("LogClass.active: bool\nLog class activation.\nSource code at petsc4py/PETSc/Log.pyx:513"), 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__},
  {Py_tp_doc, (void *)PyDoc_STR("Logging support.")},
  {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*/
  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*/
  __pyx_pw_8petsc4py_5PETSc_8LogClass_3__int__, /*nb_int*/
  0, /*nb_long (reserved)*/
  0, /*nb_float*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  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*/
  0, /*nb_matrix_multiply*/
  0, /*nb_inplace_matrix_multiply*/
};

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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  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_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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_8petsc4py_5PETSc_8LogEvent_1__cinit__(o, __pyx_mstate_global->__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(__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
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

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 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 PyMethodDef __pyx_methods_8petsc4py_5PETSc_LogEvent[] = {
  {"__enter__", (PyCFunction)(void(*)(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(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_7__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_6__exit__},
  {"begin", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_9begin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_8begin},
  {"end", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_11end, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_10end},
  {"getName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_13getName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_12getName},
  {"activate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_15activate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_14activate},
  {"deactivate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_17deactivate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_16deactivate},
  {"getActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_19getActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_18getActive},
  {"setActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_21setActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_20setActive},
  {"getActiveAll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_23getActiveAll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_22getActiveAll},
  {"setActiveAll", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_8LogEvent_25setActiveAll, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_8LogEvent_24setActiveAll},
  {"getPerfInfo", (PyCFunction)(void(*)(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[] = {
  {"id", __pyx_getprop_8petsc4py_5PETSc_8LogEvent_id, 0, PyDoc_STR("LogEvent.id: int\nThe log event identifier.\nSource code at petsc4py/PETSc/Log.pyx:540"), 0},
  {"name", __pyx_getprop_8petsc4py_5PETSc_8LogEvent_name, __pyx_setprop_8petsc4py_5PETSc_8LogEvent_name, PyDoc_STR("LogEvent.name: str\nThe current event name.\nSource code at petsc4py/PETSc/Log.pyx:603"), 0},
  {"active", __pyx_getprop_8petsc4py_5PETSc_8LogEvent_active, __pyx_setprop_8petsc4py_5PETSc_8LogEvent_active, PyDoc_STR("LogEvent.active: bool\nEvent activation.\nSource code at petsc4py/PETSc/Log.pyx:663"), 0},
  {"active_all", __pyx_getprop_8petsc4py_5PETSc_8LogEvent_active_all, __pyx_setprop_8petsc4py_5PETSc_8LogEvent_active_all, PyDoc_STR("LogEvent.active_all: bool\nAll events activation.\nSource code at petsc4py/PETSc/Log.pyx:695"), 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__},
  {Py_tp_doc, (void *)PyDoc_STR("Logging support.")},
  {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*/
  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*/
  __pyx_pw_8petsc4py_5PETSc_8LogEvent_3__int__, /*nb_int*/
  0, /*nb_long (reserved)*/
  0, /*nb_float*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  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*/
  0, /*nb_matrix_multiply*/
  0, /*nb_inplace_matrix_multiply*/
};

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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  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_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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_create},
  {"pushTimestepping", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_3pushTimestepping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_2pushTimestepping},
  {"popTimestepping", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_5popTimestepping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_4popTimestepping},
  {"getTimestep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_7getTimestep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_6getTimestep},
  {"setTimestep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_9setTimestep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_8setTimestep},
  {"incrementTimestep", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_11incrementTimestep, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_10incrementTimestep},
  {"pushGroup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_13pushGroup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_12pushGroup},
  {"popGroup", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_10ViewerHDF5_15popGroup, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_10ViewerHDF5_14popGroup},
  {"getGroup", (PyCFunction)(void(*)(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_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {Py_tp_doc, (void *)PyDoc_STR("Viewer object for HDF5 file formats.\n\n    Viewer is described in the `PETSc manual <petsc:sec_viewers>`.\n\n    See Also\n    --------\n    Viewer\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_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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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*/
  PyDoc_STR("Viewer object for HDF5 file formats.\n\n    Viewer is described in the `PETSc manual <petsc:sec_viewers>`.\n\n    See Also\n    --------\n    Viewer\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_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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_8petsc4py_5PETSc_MatStencil(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #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[] = {
  {"i", __pyx_getprop_8petsc4py_5PETSc_10MatStencil_i, __pyx_setprop_8petsc4py_5PETSc_10MatStencil_i, PyDoc_STR("MatStencil.i: int\nFirst logical grid coordinate.\nSource code at petsc4py/PETSc/Mat.pyx:297"), 0},
  {"j", __pyx_getprop_8petsc4py_5PETSc_10MatStencil_j, __pyx_setprop_8petsc4py_5PETSc_10MatStencil_j, PyDoc_STR("MatStencil.j: int\nSecond logical grid coordinate.\nSource code at petsc4py/PETSc/Mat.pyx:305"), 0},
  {"k", __pyx_getprop_8petsc4py_5PETSc_10MatStencil_k, __pyx_setprop_8petsc4py_5PETSc_10MatStencil_k, PyDoc_STR("MatStencil.k: int\nThird logical grid coordinate.\nSource code at petsc4py/PETSc/Mat.pyx:313"), 0},
  {"c", __pyx_getprop_8petsc4py_5PETSc_10MatStencil_c, __pyx_setprop_8petsc4py_5PETSc_10MatStencil_c, PyDoc_STR("MatStencil.c: int\nField component.\nSource code at petsc4py/PETSc/Mat.pyx:321"), 0},
  {"index", __pyx_getprop_8petsc4py_5PETSc_10MatStencil_index, __pyx_setprop_8petsc4py_5PETSc_10MatStencil_index, PyDoc_STR("MatStencil.index: tuple[int, int, int]\nLogical grid coordinates ``(i, j, k)``.\nSource code at petsc4py/PETSc/Mat.pyx:329"), 0},
  {"field", __pyx_getprop_8petsc4py_5PETSc_10MatStencil_field, __pyx_setprop_8petsc4py_5PETSc_10MatStencil_field, PyDoc_STR("MatStencil.field: int\nField component.\nSource code at petsc4py/PETSc/Mat.pyx:340"), 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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_create},
  {"duplicate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_3duplicate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_2duplicate},
  {"setDim", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_5setDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_4setDim},
  {"getDim", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_7getDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_6getDim},
  {"setDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_9setDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_8setDof},
  {"getDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_11getDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_10getDof},
  {"setSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_13setSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_12setSizes},
  {"getSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_15getSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_14getSizes},
  {"setProcSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_17setProcSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_16setProcSizes},
  {"getProcSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_19getProcSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_18getProcSizes},
  {"setBoundaryType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_21setBoundaryType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_20setBoundaryType},
  {"getBoundaryType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_23getBoundaryType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_22getBoundaryType},
  {"setStencilType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_25setStencilType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_24setStencilType},
  {"getStencilType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_27getStencilType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_26getStencilType},
  {"setStencilWidth", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_29setStencilWidth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_28setStencilWidth},
  {"getStencilWidth", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_31getStencilWidth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_30getStencilWidth},
  {"setStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_33setStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_32setStencil},
  {"getStencil", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_35getStencil, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_34getStencil},
  {"getRanges", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_37getRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_36getRanges},
  {"getGhostRanges", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_39getGhostRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_38getGhostRanges},
  {"getOwnershipRanges", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_41getOwnershipRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_40getOwnershipRanges},
  {"getCorners", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_43getCorners, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_42getCorners},
  {"getGhostCorners", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_45getGhostCorners, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_44getGhostCorners},
  {"setFieldName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_47setFieldName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_46setFieldName},
  {"getFieldName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_49getFieldName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_48getFieldName},
  {"getVecArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_51getVecArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_50getVecArray},
  {"setUniformCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_53setUniformCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_52setUniformCoordinates},
  {"setCoordinateName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_55setCoordinateName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_54setCoordinateName},
  {"getCoordinateName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_57getCoordinateName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_56getCoordinateName},
  {"createNaturalVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_59createNaturalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_58createNaturalVec},
  {"globalToNatural", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_61globalToNatural, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_60globalToNatural},
  {"naturalToGlobal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_63naturalToGlobal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_62naturalToGlobal},
  {"getAO", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_65getAO, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_64getAO},
  {"getScatter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_67getScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_66getScatter},
  {"setRefinementFactor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_69setRefinementFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_68setRefinementFactor},
  {"getRefinementFactor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_71getRefinementFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_70getRefinementFactor},
  {"setInterpolationType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_73setInterpolationType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_72setInterpolationType},
  {"getInterpolationType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_75getInterpolationType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_74getInterpolationType},
  {"setElementType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_77setElementType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_76setElementType},
  {"getElementType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_4DMDA_79getElementType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_4DMDA_78getElementType},
  {"getElements", (PyCFunction)(void(*)(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[] = {
  {"dim", __pyx_getprop_8petsc4py_5PETSc_4DMDA_dim, 0, PyDoc_STR("DMDA.dim: int\nThe grid dimension.\nSource code at petsc4py/PETSc/DMDA.pyx:1103"), 0},
  {"dof", __pyx_getprop_8petsc4py_5PETSc_4DMDA_dof, 0, PyDoc_STR("DMDA.dof: int\nThe number of DOFs associated with each stratum of the grid.\nSource code at petsc4py/PETSc/DMDA.pyx:1108"), 0},
  {"sizes", __pyx_getprop_8petsc4py_5PETSc_4DMDA_sizes, 0, PyDoc_STR("DMDA.sizes: tuple[int, ...]\nThe global dimension.\nSource code at petsc4py/PETSc/DMDA.pyx:1113"), 0},
  {"proc_sizes", __pyx_getprop_8petsc4py_5PETSc_4DMDA_proc_sizes, 0, 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:1118"), 0},
  {"boundary_type", __pyx_getprop_8petsc4py_5PETSc_4DMDA_boundary_type, 0, PyDoc_STR("DMDA.boundary_type: tuple[DM.BoundaryType, ...]\nBoundary types in each dimension.\nSource code at petsc4py/PETSc/DMDA.pyx:1123"), 0},
  {"stencil", __pyx_getprop_8petsc4py_5PETSc_4DMDA_stencil, 0, PyDoc_STR("DMDA.stencil: tuple[StencilType, int]\nStencil type and width.\nSource code at petsc4py/PETSc/DMDA.pyx:1128"), 0},
  {"stencil_type", __pyx_getprop_8petsc4py_5PETSc_4DMDA_stencil_type, 0, PyDoc_STR("DMDA.stencil_type: str\nStencil type.\nSource code at petsc4py/PETSc/DMDA.pyx:1133"), 0},
  {"stencil_width", __pyx_getprop_8petsc4py_5PETSc_4DMDA_stencil_width, 0, PyDoc_STR("DMDA.stencil_width: int\nElementwise stencil width.\nSource code at petsc4py/PETSc/DMDA.pyx:1138"), 0},
  {"ranges", __pyx_getprop_8petsc4py_5PETSc_4DMDA_ranges, 0, PyDoc_STR("DMDA.ranges: tuple[tuple[int, int], ...]\nRanges of the local region in each dimension.\nSource code at petsc4py/PETSc/DMDA.pyx:1143"), 0},
  {"ghost_ranges", __pyx_getprop_8petsc4py_5PETSc_4DMDA_ghost_ranges, 0, PyDoc_STR("DMDA.ghost_ranges: tuple[tuple[int, int], ...]\nRanges of local region, including ghost nodes.\nSource code at petsc4py/PETSc/DMDA.pyx:1148"), 0},
  {"corners", __pyx_getprop_8petsc4py_5PETSc_4DMDA_corners, 0, 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:1153"), 0},
  {"ghost_corners", __pyx_getprop_8petsc4py_5PETSc_4DMDA_ghost_corners, 0, 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:1158"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8petsc4py_5PETSc_DMDA_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_create},
  {"createFromCellList", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_3createFromCellList, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_2createFromCellList},
  {"createBoxMesh", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_5createBoxMesh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_4createBoxMesh},
  {"createBoxSurfaceMesh", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_7createBoxSurfaceMesh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_6createBoxSurfaceMesh},
  {"createFromFile", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_9createFromFile, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_8createFromFile},
  {"createCGNS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_11createCGNS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_10createCGNS},
  {"createCGNSFromFile", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_13createCGNSFromFile, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_12createCGNSFromFile},
  {"createExodusFromFile", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_15createExodusFromFile, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_14createExodusFromFile},
  {"createExodus", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_17createExodus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_16createExodus},
  {"createGmsh", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_19createGmsh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_18createGmsh},
  {"createCoordinateSpace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_21createCoordinateSpace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_20createCoordinateSpace},
  {"createCohesiveSubmesh", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_23createCohesiveSubmesh, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_22createCohesiveSubmesh},
  {"createColoring", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_25createColoring, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_24createColoring},
  {"filter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_27filter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_26filter},
  {"getChart", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_29getChart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_28getChart},
  {"setChart", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_31setChart, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_30setChart},
  {"getConeSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_33getConeSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_32getConeSize},
  {"setConeSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_35setConeSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_34setConeSize},
  {"getCone", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_37getCone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_36getCone},
  {"setCone", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_39setCone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_38setCone},
  {"insertCone", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_41insertCone, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_40insertCone},
  {"insertConeOrientation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_43insertConeOrientation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_42insertConeOrientation},
  {"getConeOrientation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_45getConeOrientation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_44getConeOrientation},
  {"setConeOrientation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_47setConeOrientation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_46setConeOrientation},
  {"setCellType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_49setCellType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_48setCellType},
  {"getCellType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_51getCellType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_50getCellType},
  {"getCellTypeLabel", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_53getCellTypeLabel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_52getCellTypeLabel},
  {"getSupportSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_55getSupportSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_54getSupportSize},
  {"setSupportSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_57setSupportSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_56setSupportSize},
  {"getSupport", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_59getSupport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_58getSupport},
  {"setSupport", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_61setSupport, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_60setSupport},
  {"getMaxSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_63getMaxSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_62getMaxSizes},
  {"symmetrize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_65symmetrize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_64symmetrize},
  {"stratify", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_67stratify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_66stratify},
  {"orient", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_69orient, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_68orient},
  {"getCellNumbering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_71getCellNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_70getCellNumbering},
  {"getVertexNumbering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_73getVertexNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_72getVertexNumbering},
  {"createPointNumbering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_75createPointNumbering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_74createPointNumbering},
  {"getDepth", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_77getDepth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_76getDepth},
  {"getDepthStratum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_79getDepthStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_78getDepthStratum},
  {"getHeightStratum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_81getHeightStratum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_80getHeightStratum},
  {"getPointDepth", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_83getPointDepth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_82getPointDepth},
  {"getPointHeight", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_85getPointHeight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_84getPointHeight},
  {"getMeet", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_87getMeet, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_86getMeet},
  {"getJoin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_89getJoin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_88getJoin},
  {"getFullJoin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_91getFullJoin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_90getFullJoin},
  {"getTransitiveClosure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_93getTransitiveClosure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_92getTransitiveClosure},
  {"vecGetClosure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_95vecGetClosure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_94vecGetClosure},
  {"getVecClosure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_97getVecClosure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_96getVecClosure},
  {"setVecClosure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_99setVecClosure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_98setVecClosure},
  {"setMatClosure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_101setMatClosure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_100setMatClosure},
  {"generate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_103generate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_102generate},
  {"setTriangleOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_105setTriangleOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_104setTriangleOptions},
  {"setTetGenOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_107setTetGenOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_106setTetGenOptions},
  {"markBoundaryFaces", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_109markBoundaryFaces, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_108markBoundaryFaces},
  {"labelComplete", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_111labelComplete, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_110labelComplete},
  {"labelCohesiveComplete", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_113labelCohesiveComplete, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_112labelCohesiveComplete},
  {"setAdjacencyUseAnchors", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_115setAdjacencyUseAnchors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_114setAdjacencyUseAnchors},
  {"getAdjacencyUseAnchors", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_117getAdjacencyUseAnchors, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_116getAdjacencyUseAnchors},
  {"getAdjacency", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_119getAdjacency, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_118getAdjacency},
  {"setPartitioner", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_121setPartitioner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_120setPartitioner},
  {"getPartitioner", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_123getPartitioner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_122getPartitioner},
  {"rebalanceSharedPoints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_125rebalanceSharedPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_124rebalanceSharedPoints},
  {"distribute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_127distribute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_126distribute},
  {"distributeOverlap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_129distributeOverlap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_128distributeOverlap},
  {"isDistributed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_131isDistributed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_130isDistributed},
  {"isSimplex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_133isSimplex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_132isSimplex},
  {"distributeGetDefault", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_135distributeGetDefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_134distributeGetDefault},
  {"distributeSetDefault", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_137distributeSetDefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_136distributeSetDefault},
  {"distributionSetName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_139distributionSetName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_138distributionSetName},
  {"distributionGetName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_141distributionGetName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_140distributionGetName},
  {"interpolate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_143interpolate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_142interpolate},
  {"uninterpolate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_145uninterpolate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_144uninterpolate},
  {"distributeField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_147distributeField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_146distributeField},
  {"getMinRadius", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_149getMinRadius, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_148getMinRadius},
  {"createCoarsePointIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_151createCoarsePointIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_150createCoarsePointIS},
  {"createSection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_153createSection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_152createSection},
  {"getPointLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_155getPointLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_154getPointLocal},
  {"getPointLocalField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_157getPointLocalField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_156getPointLocalField},
  {"getPointGlobal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_159getPointGlobal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_158getPointGlobal},
  {"getPointGlobalField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_161getPointGlobalField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_160getPointGlobalField},
  {"createClosureIndex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_163createClosureIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_162createClosureIndex},
  {"setRefinementUniform", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_165setRefinementUniform, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_164setRefinementUniform},
  {"getRefinementUniform", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_167getRefinementUniform, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_166getRefinementUniform},
  {"setRefinementLimit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_169setRefinementLimit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_168setRefinementLimit},
  {"getRefinementLimit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_171getRefinementLimit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_170getRefinementLimit},
  {"getOrdering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_173getOrdering, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_172getOrdering},
  {"permute", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_175permute, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_174permute},
  {"reorderGetDefault", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_177reorderGetDefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_176reorderGetDefault},
  {"reorderSetDefault", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_179reorderSetDefault, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_178reorderSetDefault},
  {"computeCellGeometryFVM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_181computeCellGeometryFVM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_180computeCellGeometryFVM},
  {"constructGhostCells", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_183constructGhostCells, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_182constructGhostCells},
  {"getSubpointIS", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_185getSubpointIS, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_184getSubpointIS},
  {"getSubpointMap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_187getSubpointMap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_186getSubpointMap},
  {"metricSetFromOptions", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_189metricSetFromOptions, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_188metricSetFromOptions},
  {"metricSetUniform", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_191metricSetUniform, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_190metricSetUniform},
  {"metricIsUniform", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_193metricIsUniform, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_192metricIsUniform},
  {"metricSetIsotropic", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_195metricSetIsotropic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_194metricSetIsotropic},
  {"metricIsIsotropic", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_197metricIsIsotropic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_196metricIsIsotropic},
  {"metricSetRestrictAnisotropyFirst", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_199metricSetRestrictAnisotropyFirst, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_198metricSetRestrictAnisotropyFirst},
  {"metricRestrictAnisotropyFirst", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_201metricRestrictAnisotropyFirst, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_200metricRestrictAnisotropyFirst},
  {"metricSetNoInsertion", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_203metricSetNoInsertion, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_202metricSetNoInsertion},
  {"metricNoInsertion", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_205metricNoInsertion, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_204metricNoInsertion},
  {"metricSetNoSwapping", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_207metricSetNoSwapping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_206metricSetNoSwapping},
  {"metricNoSwapping", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_209metricNoSwapping, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_208metricNoSwapping},
  {"metricSetNoMovement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_211metricSetNoMovement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_210metricSetNoMovement},
  {"metricNoMovement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_213metricNoMovement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_212metricNoMovement},
  {"metricSetNoSurf", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_215metricSetNoSurf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_214metricSetNoSurf},
  {"metricNoSurf", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_217metricNoSurf, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_216metricNoSurf},
  {"metricSetVerbosity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_219metricSetVerbosity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_218metricSetVerbosity},
  {"metricGetVerbosity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_221metricGetVerbosity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_220metricGetVerbosity},
  {"metricSetNumIterations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_223metricSetNumIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_222metricSetNumIterations},
  {"metricGetNumIterations", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_225metricGetNumIterations, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_224metricGetNumIterations},
  {"metricSetMinimumMagnitude", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_227metricSetMinimumMagnitude, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_226metricSetMinimumMagnitude},
  {"metricGetMinimumMagnitude", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_229metricGetMinimumMagnitude, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_228metricGetMinimumMagnitude},
  {"metricSetMaximumMagnitude", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_231metricSetMaximumMagnitude, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_230metricSetMaximumMagnitude},
  {"metricGetMaximumMagnitude", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_233metricGetMaximumMagnitude, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_232metricGetMaximumMagnitude},
  {"metricSetMaximumAnisotropy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_235metricSetMaximumAnisotropy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_234metricSetMaximumAnisotropy},
  {"metricGetMaximumAnisotropy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_237metricGetMaximumAnisotropy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_236metricGetMaximumAnisotropy},
  {"metricSetTargetComplexity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_239metricSetTargetComplexity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_238metricSetTargetComplexity},
  {"metricGetTargetComplexity", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_241metricGetTargetComplexity, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_240metricGetTargetComplexity},
  {"metricSetNormalizationOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_243metricSetNormalizationOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_242metricSetNormalizationOrder},
  {"metricGetNormalizationOrder", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_245metricGetNormalizationOrder, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_244metricGetNormalizationOrder},
  {"metricSetGradationFactor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_247metricSetGradationFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_246metricSetGradationFactor},
  {"metricGetGradationFactor", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_249metricGetGradationFactor, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_248metricGetGradationFactor},
  {"metricSetHausdorffNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_251metricSetHausdorffNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_250metricSetHausdorffNumber},
  {"metricGetHausdorffNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_253metricGetHausdorffNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_252metricGetHausdorffNumber},
  {"metricCreate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_255metricCreate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_254metricCreate},
  {"metricCreateUniform", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_257metricCreateUniform, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_256metricCreateUniform},
  {"metricCreateIsotropic", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_259metricCreateIsotropic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_258metricCreateIsotropic},
  {"metricDeterminantCreate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_261metricDeterminantCreate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_260metricDeterminantCreate},
  {"metricEnforceSPD", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_263metricEnforceSPD, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_262metricEnforceSPD},
  {"metricNormalize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_265metricNormalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_264metricNormalize},
  {"metricAverage2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_267metricAverage2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_266metricAverage2},
  {"metricAverage3", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_269metricAverage3, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_268metricAverage3},
  {"metricIntersection2", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_271metricIntersection2, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_270metricIntersection2},
  {"metricIntersection3", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_273metricIntersection3, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_272metricIntersection3},
  {"computeGradientClementInterpolant", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_275computeGradientClementInterpolant, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_274computeGradientClementInterpolant},
  {"topologyView", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_277topologyView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_276topologyView},
  {"coordinatesView", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_279coordinatesView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_278coordinatesView},
  {"labelsView", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_281labelsView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_280labelsView},
  {"sectionView", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_283sectionView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_282sectionView},
  {"globalVectorView", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_285globalVectorView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_284globalVectorView},
  {"localVectorView", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_287localVectorView, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_286localVectorView},
  {"topologyLoad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_289topologyLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_288topologyLoad},
  {"coordinatesLoad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_291coordinatesLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_290coordinatesLoad},
  {"labelsLoad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_293labelsLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_292labelsLoad},
  {"sectionLoad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_295sectionLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_294sectionLoad},
  {"globalVectorLoad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_297globalVectorLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_296globalVectorLoad},
  {"localVectorLoad", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_299localVectorLoad, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_298localVectorLoad},
  {"createNaturalVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_301createNaturalVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_300createNaturalVec},
  {"naturalToGlobalBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_303naturalToGlobalBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_302naturalToGlobalBegin},
  {"naturalToGlobalEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_305naturalToGlobalEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_304naturalToGlobalEnd},
  {"globalToNaturalBegin", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_307globalToNaturalBegin, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_306globalToNaturalBegin},
  {"globalToNaturalEnd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_309globalToNaturalEnd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_308globalToNaturalEnd},
  {"setMigrationSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_311setMigrationSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_310setMigrationSF},
  {"getMigrationSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_313getMigrationSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_312getMigrationSF},
  {"createGlobalToNaturalSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_315createGlobalToNaturalSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_314createGlobalToNaturalSF},
  {"migrateGlobalToNaturalSF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMPlex_317migrateGlobalToNaturalSF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMPlex_316migrateGlobalToNaturalSF},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8petsc4py_5PETSc_DMPlex_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {Py_tp_doc, (void *)PyDoc_STR("Encapsulate an unstructured mesh.\n\n    DMPlex encapsulates both topology and geometry.\n    It is capable of parallel refinement and coarsening (using Pragmatic or ParMmg)\n    and parallel redistribution for load balancing.\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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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.\n    It is capable of parallel refinement and coarsening (using Pragmatic or ParMmg)\n    and parallel redistribution for load balancing.\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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_create},
  {"setStencilWidth", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_3setStencilWidth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_2setStencilWidth},
  {"setStencilType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_5setStencilType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_4setStencilType},
  {"setBoundaryTypes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_7setBoundaryTypes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_6setBoundaryTypes},
  {"setDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_9setDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_8setDof},
  {"setGlobalSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_11setGlobalSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_10setGlobalSizes},
  {"setProcSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_13setProcSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_12setProcSizes},
  {"setOwnershipRanges", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_15setOwnershipRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_14setOwnershipRanges},
  {"getDim", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_17getDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_16getDim},
  {"getEntriesPerElement", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_19getEntriesPerElement, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_18getEntriesPerElement},
  {"getStencilWidth", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_21getStencilWidth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_20getStencilWidth},
  {"getDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_23getDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_22getDof},
  {"getCorners", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_25getCorners, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_24getCorners},
  {"getGhostCorners", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_27getGhostCorners, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_26getGhostCorners},
  {"getLocalSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_29getLocalSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_28getLocalSizes},
  {"getGlobalSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_31getGlobalSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_30getGlobalSizes},
  {"getProcSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_33getProcSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_32getProcSizes},
  {"getStencilType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_35getStencilType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_34getStencilType},
  {"getOwnershipRanges", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_37getOwnershipRanges, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_36getOwnershipRanges},
  {"getBoundaryTypes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_39getBoundaryTypes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_38getBoundaryTypes},
  {"getIsFirstRank", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_41getIsFirstRank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_40getIsFirstRank},
  {"getIsLastRank", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_43getIsLastRank, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_42getIsLastRank},
  {"setUniformCoordinatesExplicit", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_45setUniformCoordinatesExplicit, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_44setUniformCoordinatesExplicit},
  {"setUniformCoordinatesProduct", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_47setUniformCoordinatesProduct, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_46setUniformCoordinatesProduct},
  {"setUniformCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_49setUniformCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_48setUniformCoordinates},
  {"setCoordinateDMType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_51setCoordinateDMType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_50setCoordinateDMType},
  {"getLocationSlot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_53getLocationSlot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_52getLocationSlot},
  {"getProductCoordinateLocationSlot", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_55getProductCoordinateLocationSlot, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_54getProductCoordinateLocationSlot},
  {"getLocationDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_57getLocationDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_56getLocationDof},
  {"migrateVec", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_59migrateVec, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_58migrateVec},
  {"createCompatibleDMStag", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_61createCompatibleDMStag, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_60createCompatibleDMStag},
  {"VecSplitToDMDA", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_63VecSplitToDMDA, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_62VecSplitToDMDA},
  {"getVecArray", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_6DMStag_65getVecArray, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_6DMStag_64getVecArray},
  {"get1dCoordinatecArrays", (PyCFunction)(void(*)(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[] = {
  {"dim", __pyx_getprop_8petsc4py_5PETSc_6DMStag_dim, 0, PyDoc_STR("DMStag.dim: int\nThe dimension.\nSource code at petsc4py/PETSc/DMStag.pyx:836"), 0},
  {"dofs", __pyx_getprop_8petsc4py_5PETSc_6DMStag_dofs, 0, PyDoc_STR("DMStag.dofs: tuple[int, ...]\nThe number of DOFs associated with each stratum of the grid.\nSource code at petsc4py/PETSc/DMStag.pyx:841"), 0},
  {"entries_per_element", __pyx_getprop_8petsc4py_5PETSc_6DMStag_entries_per_element, 0, PyDoc_STR("DMStag.entries_per_element: int\nThe number of entries per element in the local representation.\nSource code at petsc4py/PETSc/DMStag.pyx:846"), 0},
  {"global_sizes", __pyx_getprop_8petsc4py_5PETSc_6DMStag_global_sizes, 0, PyDoc_STR("DMStag.global_sizes: tuple[int, ...]\nGlobal element counts in each dimension.\nSource code at petsc4py/PETSc/DMStag.pyx:851"), 0},
  {"local_sizes", __pyx_getprop_8petsc4py_5PETSc_6DMStag_local_sizes, 0, PyDoc_STR("DMStag.local_sizes: tuple[int, ...]\nLocal elementwise sizes in each dimension.\nSource code at petsc4py/PETSc/DMStag.pyx:856"), 0},
  {"proc_sizes", __pyx_getprop_8petsc4py_5PETSc_6DMStag_proc_sizes, 0, 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:861"), 0},
  {"boundary_types", __pyx_getprop_8petsc4py_5PETSc_6DMStag_boundary_types, 0, PyDoc_STR("DMStag.boundary_types: tuple[str, ...]\nBoundary types in each dimension.\nSource code at petsc4py/PETSc/DMStag.pyx:866"), 0},
  {"stencil_type", __pyx_getprop_8petsc4py_5PETSc_6DMStag_stencil_type, 0, PyDoc_STR("DMStag.stencil_type: str\nStencil type.\nSource code at petsc4py/PETSc/DMStag.pyx:871"), 0},
  {"stencil_width", __pyx_getprop_8petsc4py_5PETSc_6DMStag_stencil_width, 0, PyDoc_STR("DMStag.stencil_width: int\nElementwise stencil width.\nSource code at petsc4py/PETSc/DMStag.pyx:876"), 0},
  {"corners", __pyx_getprop_8petsc4py_5PETSc_6DMStag_corners, 0, 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:881"), 0},
  {"ghost_corners", __pyx_getprop_8petsc4py_5PETSc_6DMStag_ghost_corners, 0, 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:886"), 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8petsc4py_5PETSc_DMStag_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_create},
  {"addDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_3addDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_2addDM},
  {"getNumber", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_5getNumber, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_4getNumber},
  {"getEntries", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_7getEntries, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_6getEntries},
  {"scatter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_9scatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_8scatter},
  {"gather", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_11gather, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_10gather},
  {"getGlobalISs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_13getGlobalISs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_12getGlobalISs},
  {"getLocalISs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_15getLocalISs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_14getLocalISs},
  {"getLGMaps", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_11DMComposite_17getLGMaps, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_11DMComposite_16getLGMaps},
  {"getAccess", (PyCFunction)(void(*)(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_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_create},
  {"setMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_3setMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_2setMatrix},
  {"setGlobalVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_5setGlobalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_4setGlobalVector},
  {"setLocalVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_7setLocalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_6setLocalVector},
  {"setCreateGlobalVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_9setCreateGlobalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_8setCreateGlobalVector},
  {"setCreateLocalVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_11setCreateLocalVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_10setCreateLocalVector},
  {"setGlobalToLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_13setGlobalToLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_12setGlobalToLocal},
  {"setGlobalToLocalVecScatter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_15setGlobalToLocalVecScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_14setGlobalToLocalVecScatter},
  {"setLocalToGlobal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_17setLocalToGlobal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_16setLocalToGlobal},
  {"setLocalToGlobalVecScatter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_19setLocalToGlobalVecScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_18setLocalToGlobalVecScatter},
  {"setLocalToLocal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_21setLocalToLocal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_20setLocalToLocal},
  {"setLocalToLocalVecScatter", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_23setLocalToLocalVecScatter, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_22setLocalToLocalVecScatter},
  {"setCreateMatrix", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_25setCreateMatrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_24setCreateMatrix},
  {"setCoarsen", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_27setCoarsen, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_26setCoarsen},
  {"setRefine", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_29setRefine, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_28setRefine},
  {"setCreateInterpolation", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_31setCreateInterpolation, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_30setCreateInterpolation},
  {"setCreateInjection", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_33setCreateInjection, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_32setCreateInjection},
  {"setCreateRestriction", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_35setCreateRestriction, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_34setCreateRestriction},
  {"setCreateFieldDecomposition", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_37setCreateFieldDecomposition, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_36setCreateFieldDecomposition},
  {"setCreateDomainDecomposition", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_39setCreateDomainDecomposition, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_38setCreateDomainDecomposition},
  {"setCreateDomainDecompositionScatters", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMShell_41setCreateDomainDecompositionScatters, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMShell_40setCreateDomainDecompositionScatters},
  {"setCreateSubDM", (PyCFunction)(void(*)(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_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_1create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_create},
  {"createGlobalVectorFromField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_3createGlobalVectorFromField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_2createGlobalVectorFromField},
  {"destroyGlobalVectorFromField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_5destroyGlobalVectorFromField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_4destroyGlobalVectorFromField},
  {"createGlobalVectorFromFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_7createGlobalVectorFromFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_6createGlobalVectorFromFields},
  {"destroyGlobalVectorFromFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_9destroyGlobalVectorFromFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_8destroyGlobalVectorFromFields},
  {"createLocalVectorFromField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_11createLocalVectorFromField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_10createLocalVectorFromField},
  {"destroyLocalVectorFromField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_13destroyLocalVectorFromField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_12destroyLocalVectorFromField},
  {"createLocalVectorFromFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_15createLocalVectorFromFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_14createLocalVectorFromFields},
  {"destroyLocalVectorFromFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_17destroyLocalVectorFromFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_16destroyLocalVectorFromFields},
  {"initializeFieldRegister", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_19initializeFieldRegister, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_18initializeFieldRegister},
  {"finalizeFieldRegister", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_21finalizeFieldRegister, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_20finalizeFieldRegister},
  {"setLocalSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_23setLocalSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_22setLocalSizes},
  {"registerField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_25registerField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_24registerField},
  {"getField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_27getField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_26getField},
  {"restoreField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_29restoreField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_28restoreField},
  {"vectorDefineField", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_31vectorDefineField, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_30vectorDefineField},
  {"addPoint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_33addPoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_32addPoint},
  {"addNPoints", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_35addNPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_34addNPoints},
  {"removePoint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_37removePoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_36removePoint},
  {"removePointAtIndex", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_39removePointAtIndex, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_38removePointAtIndex},
  {"copyPoint", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_41copyPoint, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_40copyPoint},
  {"getLocalSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_43getLocalSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_42getLocalSize},
  {"getSize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_45getSize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_44getSize},
  {"migrate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_47migrate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_46migrate},
  {"collectViewCreate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_49collectViewCreate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_48collectViewCreate},
  {"collectViewDestroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_51collectViewDestroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_50collectViewDestroy},
  {"setCellDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_53setCellDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_52setCellDM},
  {"getCellDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_55getCellDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_54getCellDM},
  {"setType", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_57setType, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_56setType},
  {"setPointsUniformCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_59setPointsUniformCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_58setPointsUniformCoordinates},
  {"setPointCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_61setPointCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_60setPointCoordinates},
  {"insertPointUsingCellDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_63insertPointUsingCellDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_62insertPointUsingCellDM},
  {"setPointCoordinatesCellwise", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_65setPointCoordinatesCellwise, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_64setPointCoordinatesCellwise},
  {"viewFieldsXDMF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_67viewFieldsXDMF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_66viewFieldsXDMF},
  {"viewXDMF", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_69viewXDMF, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_68viewXDMF},
  {"sortGetAccess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_71sortGetAccess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_70sortGetAccess},
  {"sortRestoreAccess", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_73sortRestoreAccess, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_72sortRestoreAccess},
  {"sortGetPointsPerCell", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_75sortGetPointsPerCell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_74sortGetPointsPerCell},
  {"sortGetNumberOfPointsPerCell", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_77sortGetNumberOfPointsPerCell, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_76sortGetNumberOfPointsPerCell},
  {"sortGetIsValid", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_79sortGetIsValid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_78sortGetIsValid},
  {"sortGetSizes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_81sortGetSizes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_80sortGetSizes},
  {"projectFields", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_83projectFields, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_82projectFields},
  {"addCellDM", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_85addCellDM, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_84addCellDM},
  {"setCellDMActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_87setCellDMActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_86setCellDMActive},
  {"getCellDMActive", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_89getCellDMActive, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_88getCellDMActive},
  {"getCellDMByName", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_91getCellDMByName, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_90getCellDMByName},
  {"getCellDMNames", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_93getCellDMNames, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_92getCellDMNames},
  {"computeMoments", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_7DMSwarm_95computeMoments, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_7DMSwarm_94computeMoments},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8petsc4py_5PETSc_DMSwarm_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc_Object},
  {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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_1__cinit__(o, __pyx_mstate_global->__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(__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_DeallocKeepAliveBegin(o);
    __pyx_pw_8petsc4py_5PETSc_15DMInterpolation_3__dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    PyErr_Restore(etype, eval, etb);
  }
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyMethodDef __pyx_methods_8petsc4py_5PETSc_DMInterpolation[] = {
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_4create},
  {"destroy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_7destroy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_6destroy},
  {"evaluate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_9evaluate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_8evaluate},
  {"getCoordinates", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_11getCoordinates, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_10getCoordinates},
  {"getDim", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_13getDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_12getDim},
  {"getDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_15getDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_14getDof},
  {"setDim", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_17setDim, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_16setDim},
  {"setDof", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_19setDof, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_18setDof},
  {"setUp", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_21setUp, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_20setUp},
  {"getVector", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8petsc4py_5PETSc_15DMInterpolation_23getVector, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8petsc4py_5PETSc_15DMInterpolation_22getVector},
  {"restoreVector", (PyCFunction)(void(*)(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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  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(__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);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #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;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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 = 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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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__PyVwr __pyx_vtable_8petsc4py_5PETSc__PyVwr;

static PyObject *__pyx_tp_new_8petsc4py_5PETSc__PyVwr(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8petsc4py_5PETSc__PyVwr *p;
  PyObject *o = __pyx_tp_new_8petsc4py_5PETSc__PyObj(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8petsc4py_5PETSc__PyObj*)__pyx_vtabptr_8petsc4py_5PETSc__PyVwr;
  p->filename = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8petsc4py_5PETSc__PyVwr(PyObject *o) {
  struct __pyx_obj_8petsc4py_5PETSc__PyVwr *p = (struct __pyx_obj_8petsc4py_5PETSc__PyVwr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(__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__PyVwr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->filename);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_8petsc4py_5PETSc__PyObj(o);
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_8petsc4py_5PETSc__PyVwr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_8petsc4py_5PETSc__PyVwr},
  {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__PyVwr},
  {0, 0},
};
static PyType_Spec __pyx_type_8petsc4py_5PETSc__PyVwr_spec = {
  "petsc4py.PETSc._PyVwr",
  sizeof(struct __pyx_obj_8petsc4py_5PETSc__PyVwr),
  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__PyVwr_slots,
};
#else

static PyTypeObject __pyx_type_8petsc4py_5PETSc__PyVwr = {
  PyVarObject_HEAD_INIT(0, 0)
  "petsc4py.PETSc.""_PyVwr", /*tp_name*/
  sizeof(struct __pyx_obj_8petsc4py_5PETSc__PyVwr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8petsc4py_5PETSc__PyVwr, /*tp_dealloc*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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__PyVwr, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_dealloc, (void *)__pyx_tp_dealloc_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_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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_dealloc, (void *)__pyx_tp_dealloc_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_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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_dealloc, (void *)__pyx_tp_dealloc_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_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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_dealloc, (void *)__pyx_tp_dealloc_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_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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_dealloc, (void *)__pyx_tp_dealloc_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_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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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_dealloc, (void *)__pyx_tp_dealloc_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_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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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___pyx_scope_struct__EventDecorator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator, sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator[--__pyx_mstate_global->__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  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(__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_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator, sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator))))
  {
    __pyx_mstate_global->__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator[__pyx_mstate_global->__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator++] = ((struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #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;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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,
  __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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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___pyx_scope_struct_1_decorator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator > 0) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(t, __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator, sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator))))
  {
    o = (PyObject*)__pyx_mstate_global->__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct_1_decorator[--__pyx_mstate_global->__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator];
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(Py_TYPE(o));
    #endif
    memset(o, 0, sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator));
    #if CYTHON_COMPILING_IN_LIMITED_API
    (void) PyObject_Init(o, t);
    #else
    (void) PyObject_INIT(o, t);
    #endif
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = __Pyx_AllocateExtensionType(t, 1);
    if (unlikely(!o)) return 0;
  }
  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(__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_USE_FREELISTS
  if (likely((int)(__pyx_mstate_global->__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator < 8) & __PYX_CHECK_FINAL_TYPE_FOR_FREELISTS(Py_TYPE(o), __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator, sizeof(struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator))))
  {
    __pyx_mstate_global->__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct_1_decorator[__pyx_mstate_global->__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator++] = ((struct __pyx_obj_8petsc4py_5PETSc___pyx_scope_struct_1_decorator *)o);
  } else
  #endif
  {
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #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;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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,
  __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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  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(__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_DeallocKeepAliveBegin(o);
    __pyx_array___dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->mode);
  Py_CLEAR(p->_format);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #endif
}

static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  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_GetFullyQualifiedName(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 = 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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(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[] = {
  {"memview", __pyx_getprop___pyx_array_memview, 0, 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 = {
  __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 = {
  __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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  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(__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);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #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;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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 PyMethodDef __pyx_methods_Enum[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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;
  o = __Pyx_AllocateExtensionType(t, 0);
  if (unlikely(!o)) return 0;
  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->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(__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_DeallocKeepAliveBegin(o);
    __pyx_memoryview___dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->obj);
  Py_CLEAR(p->_size);
  PyTypeObject *tp = Py_TYPE(o);
  #if CYTHON_USE_TYPE_SLOTS
  (*tp->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  Py_DECREF(tp);
  #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;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  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->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);
  Py_CLEAR(p->view.obj);
  return 0;
}

static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  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_GetFullyQualifiedName(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 PyMethodDef __pyx_methods_memoryview[] = {
  {"is_c_contig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"is_f_contig", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"copy_fortran", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(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[] = {
  {"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
  {"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
  {"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
  {"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
  {"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
  {"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
  {"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
  {"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
  {"size", __pyx_getprop___pyx_memoryview_size, 0, 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 = {
  __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 = {
  __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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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(__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_DeallocKeepAliveBegin(o);
    __pyx_memoryviewslice___dealloc__(o);
    __Pyx_DeallocKeepAliveEnd(o);
    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(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(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*/
  0, /*tp_vectorcall_offset*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  #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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if !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 PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #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}
};
/* #### Code section: initfunc_declarations ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE void __Pyx_CleanupGlobals(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
/* #### Code section: init_module ### */

static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __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(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  {
    __pyx_t_1 = __Pyx_ApiExport_GetApiDict(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    const char * __pyx_export_signature = __Pyx_PyBytes_AsString(__pyx_mstate_global->__pyx_kp_b_AO_PyObject_DM_PyObject_DMLabel);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (unlikely(!__pyx_export_signature)) __PYX_ERR(0, 1, __pyx_L1_error)
    #endif
    const char * __pyx_export_name = __pyx_export_signature + 1749;
    void (*const __pyx_export_pointers[])(void) = {(void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscAO_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscDM_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscDMLabel_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscDMSwarmCellDM_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscIS_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscLGMap_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscKSP_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscComm_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_GetComm, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_GetCommDefault, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscComm_GetPtr, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscMat_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscMatPartitioning_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscPC_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscDS_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscDevice_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscDualSpace_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_CHKERR, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_CHKERRMPI, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscFE_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscObject_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscObject_GetPtr, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscQuad_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscRandom_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscRegressor_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscSF_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscSection_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscSpace_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscViewer_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscAO_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscDM_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscDMLabel_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscDMSwarmCellDM_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscIS_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscLGMap_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscKSP_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscComm_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscMat_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscMatPartitioning_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscPC_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscDS_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscDualSpace_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscFE_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscObject_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscPartitioner_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscQuad_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscRandom_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscRegressor_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscSF_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscSection_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscSpace_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscViewer_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscSNES_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscSNESLineSearch_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscTS_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscTAO_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscTAOLineSearch_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscTAOTerm_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscVec_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscScatter_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscType_Lookup, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscSNES_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscSNESLineSearch_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscTS_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscTAO_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscTAOLineSearch_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscTAOTerm_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscVec_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscScatter_Get, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscError_Set, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscType_Register, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscDeviceContext_New, (void (*)(void))&__pyx_f_8petsc4py_5PETSc_PyPetscDevice_New, (void (*)(void)) NULL};
    void (*const *__pyx_export_pointer)(void) = __pyx_export_pointers;
    const char *__pyx_export_current_signature = __pyx_export_signature;
    while (*__pyx_export_pointer) {
      if (__Pyx_ExportFunction(__pyx_t_1, __pyx_export_name, *__pyx_export_pointer, __pyx_export_current_signature) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
      ++__pyx_export_pointer;
      __pyx_export_name = strchr(__pyx_export_name, '\0') + 1;
      __pyx_export_signature = strchr(__pyx_export_signature, '\0') + 1;
      if (*__pyx_export_signature != '\0') __pyx_export_current_signature = __pyx_export_signature;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  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_mstate->__pyx_ptype_8petsc4py_5PETSc_Comm = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscComm_Type_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Comm)) __PYX_ERR(34, 3, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscComm_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Comm) < (0)) __PYX_ERR(34, 3, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Comm) < (0)) __PYX_ERR(34, 3, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Comm);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Comm->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Comm->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Comm->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Comm, (PyObject *) __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Object = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscObject_Type_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Object)) __PYX_ERR(35, 3, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscObject_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Object) < (0)) __PYX_ERR(35, 3, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Object) < (0)) __PYX_ERR(35, 3, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Object);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Object->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Object->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Object->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_vtabptr_8petsc4py_5PETSc_Object) < (0)) __PYX_ERR(35, 3, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Object) < (0)) __PYX_ERR(35, 3, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Object, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Object) < (0)) __PYX_ERR(35, 3, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Object->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Object->tp_weaklistoffset = offsetof(struct PyPetscObjectObject, __weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(37, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Viewer)) __PYX_ERR(37, 91, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscViewer_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Viewer) < (0)) __PYX_ERR(37, 91, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Viewer = &PyPetscViewer_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Viewer) < (0)) __PYX_ERR(37, 91, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Viewer);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Viewer, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(37, 91, __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_mstate->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_vtabptr_8petsc4py_5PETSc_Viewer) < (0)) __PYX_ERR(37, 91, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Viewer) < (0)) __PYX_ERR(37, 91, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Viewer, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Viewer) < (0)) __PYX_ERR(37, 91, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Viewer->tp_weaklistoffset = offsetof(struct PyPetscViewerObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(38, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Random)) __PYX_ERR(38, 14, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscRandom_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Random) < (0)) __PYX_ERR(38, 14, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Random = &PyPetscRandom_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Random) < (0)) __PYX_ERR(38, 14, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Random);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Random->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Random->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Random->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Random, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(38, 14, __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_mstate->__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_vtabptr_8petsc4py_5PETSc_Random) < (0)) __PYX_ERR(38, 14, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Random) < (0)) __PYX_ERR(38, 14, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Random, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Random) < (0)) __PYX_ERR(38, 14, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Random->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Random->tp_weaklistoffset = offsetof(struct PyPetscRandomObject, __pyx_base.__weakref__);
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Device = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscDevice_Type_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Device)) __PYX_ERR(2, 75, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscDevice_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Device) < (0)) __PYX_ERR(2, 75, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Device) < (0)) __PYX_ERR(2, 75, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Device);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Device->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Device->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Device->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Device, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Device) < (0)) __PYX_ERR(2, 75, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Device->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Device->tp_weaklistoffset = offsetof(struct PyPetscDeviceObject, __weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_DeviceContext)) __PYX_ERR(2, 223, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscDeviceContext_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DeviceContext) < (0)) __PYX_ERR(2, 223, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DeviceContext = &PyPetscDeviceContext_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DeviceContext) < (0)) __PYX_ERR(2, 223, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DeviceContext);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DeviceContext->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DeviceContext->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DeviceContext->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_vtabptr_8petsc4py_5PETSc_DeviceContext) < (0)) __PYX_ERR(2, 223, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DeviceContext) < (0)) __PYX_ERR(2, 223, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DeviceContext, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DeviceContext) < (0)) __PYX_ERR(2, 223, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DeviceContext->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DeviceContext->tp_weaklistoffset = offsetof(struct PyPetscDeviceContextObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_IS)) __PYX_ERR(39, 12, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_IS) < (0)) __PYX_ERR(39, 12, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_IS = &PyPetscIS_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_IS) < (0)) __PYX_ERR(39, 12, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_IS);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_IS->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_IS->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_IS->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_vtabptr_8petsc4py_5PETSc_IS) < (0)) __PYX_ERR(39, 12, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_IS) < (0)) __PYX_ERR(39, 12, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_IS, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_IS) < (0)) __PYX_ERR(39, 12, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_IS->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_IS->tp_weaklistoffset = offsetof(struct PyPetscISObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(39, 1149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_LGMap)) __PYX_ERR(39, 1149, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscLGMap_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LGMap) < (0)) __PYX_ERR(39, 1149, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LGMap = &PyPetscLGMap_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LGMap) < (0)) __PYX_ERR(39, 1149, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LGMap);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LGMap->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LGMap->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LGMap->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LGMap, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(39, 1149, __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_mstate->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_vtabptr_8petsc4py_5PETSc_LGMap) < (0)) __PYX_ERR(39, 1149, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LGMap) < (0)) __PYX_ERR(39, 1149, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_LGMap, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LGMap) < (0)) __PYX_ERR(39, 1149, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LGMap->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LGMap->tp_weaklistoffset = offsetof(struct PyPetscLGMapObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(40, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_SF)) __PYX_ERR(40, 17, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscSF_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SF) < (0)) __PYX_ERR(40, 17, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SF = &PyPetscSF_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SF) < (0)) __PYX_ERR(40, 17, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SF);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SF->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SF->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SF->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_vtabptr_8petsc4py_5PETSc_SF) < (0)) __PYX_ERR(40, 17, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SF) < (0)) __PYX_ERR(40, 17, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SF, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SF) < (0)) __PYX_ERR(40, 17, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SF->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SF->tp_weaklistoffset = offsetof(struct PyPetscSFObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(41, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Vec)) __PYX_ERR(41, 32, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Vec) < (0)) __PYX_ERR(41, 32, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Vec = &PyPetscVec_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Vec) < (0)) __PYX_ERR(41, 32, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Vec);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Vec->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Vec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Vec->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_vtabptr_8petsc4py_5PETSc_Vec) < (0)) __PYX_ERR(41, 32, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Vec) < (0)) __PYX_ERR(41, 32, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Vec, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Vec) < (0)) __PYX_ERR(41, 32, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Vec->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Vec->tp_weaklistoffset = offsetof(struct PyPetscVecObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(64, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Space)) __PYX_ERR(64, 16, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscSpace_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Space) < (0)) __PYX_ERR(64, 16, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Space = &PyPetscSpace_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Space) < (0)) __PYX_ERR(64, 16, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Space);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Space->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Space->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Space->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_vtabptr_8petsc4py_5PETSc_Space) < (0)) __PYX_ERR(64, 16, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Space) < (0)) __PYX_ERR(64, 16, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Space, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Space) < (0)) __PYX_ERR(64, 16, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Space->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Space->tp_weaklistoffset = offsetof(struct PyPetscSpaceObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(64, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_DualSpace)) __PYX_ERR(64, 573, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscDualSpace_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DualSpace) < (0)) __PYX_ERR(64, 573, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DualSpace = &PyPetscDualSpace_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DualSpace) < (0)) __PYX_ERR(64, 573, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DualSpace);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DualSpace->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DualSpace->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DualSpace->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_vtabptr_8petsc4py_5PETSc_DualSpace) < (0)) __PYX_ERR(64, 573, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DualSpace) < (0)) __PYX_ERR(64, 573, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DualSpace, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DualSpace) < (0)) __PYX_ERR(64, 573, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DualSpace->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DualSpace->tp_weaklistoffset = offsetof(struct PyPetscDualSpaceObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(43, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_FE)) __PYX_ERR(43, 12, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscFE_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_FE) < (0)) __PYX_ERR(43, 12, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_FE = &PyPetscFE_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_FE) < (0)) __PYX_ERR(43, 12, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_FE);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_FE->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_FE->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_FE->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_vtabptr_8petsc4py_5PETSc_FE) < (0)) __PYX_ERR(43, 12, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_FE) < (0)) __PYX_ERR(43, 12, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FE, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_FE) < (0)) __PYX_ERR(43, 12, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_FE->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_FE->tp_weaklistoffset = offsetof(struct PyPetscFEObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(42, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Quad)) __PYX_ERR(42, 3, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscQuad_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Quad) < (0)) __PYX_ERR(42, 3, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Quad = &PyPetscQuad_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Quad) < (0)) __PYX_ERR(42, 3, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Quad);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Quad->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Quad->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Quad->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_vtabptr_8petsc4py_5PETSc_Quad) < (0)) __PYX_ERR(42, 3, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Quad) < (0)) __PYX_ERR(42, 3, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Quad, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Quad) < (0)) __PYX_ERR(42, 3, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Quad->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Quad->tp_weaklistoffset = offsetof(struct PyPetscQuadObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(44, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Scatter)) __PYX_ERR(44, 23, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscScatter_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Scatter) < (0)) __PYX_ERR(44, 23, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Scatter = &PyPetscScatter_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Scatter) < (0)) __PYX_ERR(44, 23, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Scatter);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Scatter->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Scatter->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Scatter->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Scatter, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(44, 23, __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_mstate->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_vtabptr_8petsc4py_5PETSc_Scatter) < (0)) __PYX_ERR(44, 23, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Scatter) < (0)) __PYX_ERR(44, 23, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Scatter, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Scatter) < (0)) __PYX_ERR(44, 23, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Scatter->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Scatter->tp_weaklistoffset = offsetof(struct PyPetscScatterObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(45, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Section)) __PYX_ERR(45, 3, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscSection_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Section) < (0)) __PYX_ERR(45, 3, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Section = &PyPetscSection_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Section) < (0)) __PYX_ERR(45, 3, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Section);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Section->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Section->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Section->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_vtabptr_8petsc4py_5PETSc_Section) < (0)) __PYX_ERR(45, 3, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Section) < (0)) __PYX_ERR(45, 3, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Section, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Section) < (0)) __PYX_ERR(45, 3, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Section->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Section->tp_weaklistoffset = offsetof(struct PyPetscSectionObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Mat)) __PYX_ERR(46, 376, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscMat_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Mat) < (0)) __PYX_ERR(46, 376, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Mat = &PyPetscMat_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Mat) < (0)) __PYX_ERR(46, 376, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Mat);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Mat->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Mat->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Mat->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_vtabptr_8petsc4py_5PETSc_Mat) < (0)) __PYX_ERR(46, 376, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Mat) < (0)) __PYX_ERR(46, 376, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Mat, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Mat) < (0)) __PYX_ERR(46, 376, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Mat->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Mat->tp_weaklistoffset = offsetof(struct PyPetscMatObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(47, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning)) __PYX_ERR(47, 17, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscMatPartitioning_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning) < (0)) __PYX_ERR(47, 17, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning = &PyPetscMatPartitioning_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning) < (0)) __PYX_ERR(47, 17, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning, __pyx_vtabptr_8petsc4py_5PETSc_MatPartitioning) < (0)) __PYX_ERR(47, 17, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning) < (0)) __PYX_ERR(47, 17, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MatPartitioning, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning) < (0)) __PYX_ERR(47, 17, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning->tp_weaklistoffset = offsetof(struct PyPetscMatPartitioningObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(46, 6257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_NullSpace)) __PYX_ERR(46, 6257, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscNullSpace_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_NullSpace) < (0)) __PYX_ERR(46, 6257, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_NullSpace = &PyPetscNullSpace_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_NullSpace) < (0)) __PYX_ERR(46, 6257, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_NullSpace);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_NullSpace->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_NullSpace->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_NullSpace->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_NullSpace, __pyx_vtabptr_8petsc4py_5PETSc_NullSpace) < (0)) __PYX_ERR(46, 6257, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_NullSpace) < (0)) __PYX_ERR(46, 6257, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_NullSpace, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_NullSpace) < (0)) __PYX_ERR(46, 6257, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_NullSpace->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_NullSpace->tp_weaklistoffset = offsetof(struct PyPetscNullSpaceObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(48, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_PC)) __PYX_ERR(48, 174, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscPC_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_PC) < (0)) __PYX_ERR(48, 174, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_PC = &PyPetscPC_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_PC) < (0)) __PYX_ERR(48, 174, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_PC);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_PC->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_PC->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_PC->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_vtabptr_8petsc4py_5PETSc_PC) < (0)) __PYX_ERR(48, 174, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_PC) < (0)) __PYX_ERR(48, 174, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PC, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_PC) < (0)) __PYX_ERR(48, 174, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_PC->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_PC->tp_weaklistoffset = offsetof(struct PyPetscPCObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(49, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_KSP)) __PYX_ERR(49, 375, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscKSP_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_KSP) < (0)) __PYX_ERR(49, 375, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_KSP = &PyPetscKSP_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_KSP) < (0)) __PYX_ERR(49, 375, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_KSP);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_KSP->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_KSP->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_KSP->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_KSP, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(49, 375, __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_mstate->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_vtabptr_8petsc4py_5PETSc_KSP) < (0)) __PYX_ERR(49, 375, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_KSP) < (0)) __PYX_ERR(49, 375, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_KSP, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_KSP) < (0)) __PYX_ERR(49, 375, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_KSP->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_KSP->tp_weaklistoffset = offsetof(struct PyPetscKSPObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_SNES)) __PYX_ERR(50, 105, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscSNES_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNES) < (0)) __PYX_ERR(50, 105, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNES = &PyPetscSNES_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNES) < (0)) __PYX_ERR(50, 105, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNES);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNES->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNES->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNES->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_vtabptr_8petsc4py_5PETSc_SNES) < (0)) __PYX_ERR(50, 105, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNES) < (0)) __PYX_ERR(50, 105, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SNES, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNES) < (0)) __PYX_ERR(50, 105, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNES->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNES->tp_weaklistoffset = offsetof(struct PyPetscSNESObject, __pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_8petsc4py_5PETSc_SNESLineSearch = &__pyx_vtable_8petsc4py_5PETSc_SNESLineSearch;
  __pyx_vtable_8petsc4py_5PETSc_SNESLineSearch.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(50, 2736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscSNESLineSearch_Type_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch)) __PYX_ERR(50, 2736, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscSNESLineSearch_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch) < (0)) __PYX_ERR(50, 2736, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch = &PyPetscSNESLineSearch_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch) < (0)) __PYX_ERR(50, 2736, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch, __pyx_vtabptr_8petsc4py_5PETSc_SNESLineSearch) < (0)) __PYX_ERR(50, 2736, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch) < (0)) __PYX_ERR(50, 2736, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SNESLineSearch, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch) < (0)) __PYX_ERR(50, 2736, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch->tp_weaklistoffset = offsetof(struct PyPetscSNESLineSearchObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(51, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_TS)) __PYX_ERR(51, 139, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscTS_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TS) < (0)) __PYX_ERR(51, 139, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TS = &PyPetscTS_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TS) < (0)) __PYX_ERR(51, 139, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TS);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TS->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TS->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TS->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_vtabptr_8petsc4py_5PETSc_TS) < (0)) __PYX_ERR(51, 139, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TS) < (0)) __PYX_ERR(51, 139, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TS, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TS) < (0)) __PYX_ERR(51, 139, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TS->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TS->tp_weaklistoffset = offsetof(struct PyPetscTSObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_TAO)) __PYX_ERR(52, 98, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscTAO_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAO) < (0)) __PYX_ERR(52, 98, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAO = &PyPetscTAO_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAO) < (0)) __PYX_ERR(52, 98, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAO);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAO->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAO->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAO->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_vtabptr_8petsc4py_5PETSc_TAO) < (0)) __PYX_ERR(52, 98, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAO) < (0)) __PYX_ERR(52, 98, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TAO, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAO) < (0)) __PYX_ERR(52, 98, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAO->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAO->tp_weaklistoffset = offsetof(struct PyPetscTAOObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch)) __PYX_ERR(52, 2218, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscTAOLineSearch_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch) < (0)) __PYX_ERR(52, 2218, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch = &PyPetscTAOLineSearch_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch) < (0)) __PYX_ERR(52, 2218, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_vtabptr_8petsc4py_5PETSc_TAOLineSearch) < (0)) __PYX_ERR(52, 2218, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch) < (0)) __PYX_ERR(52, 2218, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TAOLineSearch, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch) < (0)) __PYX_ERR(52, 2218, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch->tp_weaklistoffset = offsetof(struct PyPetscTAOLineSearchObject, __pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_8petsc4py_5PETSc_TAOTerm = &__pyx_vtable_8petsc4py_5PETSc_TAOTerm;
  __pyx_vtable_8petsc4py_5PETSc_TAOTerm.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(52, 2509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOTerm = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscTAOTerm_Type_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOTerm)) __PYX_ERR(52, 2509, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscTAOTerm_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOTerm) < (0)) __PYX_ERR(52, 2509, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOTerm = &PyPetscTAOTerm_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOTerm->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOTerm) < (0)) __PYX_ERR(52, 2509, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOTerm);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOTerm->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOTerm->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOTerm->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOTerm, __pyx_vtabptr_8petsc4py_5PETSc_TAOTerm) < (0)) __PYX_ERR(52, 2509, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOTerm) < (0)) __PYX_ERR(52, 2509, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TAOTerm, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOTerm) < (0)) __PYX_ERR(52, 2509, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOTerm->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_TAOTerm->tp_weaklistoffset = offsetof(struct PyPetscTAOTermObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(53, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_AO)) __PYX_ERR(53, 13, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscAO_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_AO) < (0)) __PYX_ERR(53, 13, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_AO = &PyPetscAO_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_AO->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_AO) < (0)) __PYX_ERR(53, 13, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_AO);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_AO->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_AO->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_AO->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_AO, __pyx_vtabptr_8petsc4py_5PETSc_AO) < (0)) __PYX_ERR(53, 13, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_AO) < (0)) __PYX_ERR(53, 13, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_AO, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_AO) < (0)) __PYX_ERR(53, 13, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_AO->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_AO->tp_weaklistoffset = offsetof(struct PyPetscAOObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(54, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_DM)) __PYX_ERR(54, 61, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscDM_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DM) < (0)) __PYX_ERR(54, 61, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DM = &PyPetscDM_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DM) < (0)) __PYX_ERR(54, 61, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DM);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DM->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DM->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DM->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_vtabptr_8petsc4py_5PETSc_DM) < (0)) __PYX_ERR(54, 61, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DM) < (0)) __PYX_ERR(54, 61, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DM, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DM) < (0)) __PYX_ERR(54, 61, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DM->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DM->tp_weaklistoffset = offsetof(struct PyPetscDMObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(57, 3680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform)) __PYX_ERR(57, 3680, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscDMPlexTransform_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform) < (0)) __PYX_ERR(57, 3680, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform = &PyPetscDMPlexTransform_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform) < (0)) __PYX_ERR(57, 3680, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform, __pyx_vtabptr_8petsc4py_5PETSc_DMPlexTransform) < (0)) __PYX_ERR(57, 3680, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform) < (0)) __PYX_ERR(57, 3680, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMPlexTransform, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform) < (0)) __PYX_ERR(57, 3680, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform->tp_weaklistoffset = offsetof(struct PyPetscDMPlexTransformObject, __pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_8petsc4py_5PETSc_CellDM = &__pyx_vtable_8petsc4py_5PETSc_CellDM;
  __pyx_vtable_8petsc4py_5PETSc_CellDM.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(62, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_CellDM = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscDMSwarmCellDM_Type_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_CellDM)) __PYX_ERR(62, 1074, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscDMSwarmCellDM_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_CellDM) < (0)) __PYX_ERR(62, 1074, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_CellDM = &PyPetscDMSwarmCellDM_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_CellDM->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_CellDM) < (0)) __PYX_ERR(62, 1074, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_CellDM);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_CellDM->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_CellDM->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_CellDM->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_CellDM, __pyx_vtabptr_8petsc4py_5PETSc_CellDM) < (0)) __PYX_ERR(62, 1074, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_CellDM) < (0)) __PYX_ERR(62, 1074, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_CellDM, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_CellDM) < (0)) __PYX_ERR(62, 1074, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_CellDM->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_CellDM->tp_weaklistoffset = offsetof(struct PyPetscDMSwarmCellDMObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(55, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_DS)) __PYX_ERR(55, 10, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscDS_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DS) < (0)) __PYX_ERR(55, 10, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DS = &PyPetscDS_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DS) < (0)) __PYX_ERR(55, 10, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DS);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DS->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DS->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DS->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_vtabptr_8petsc4py_5PETSc_DS) < (0)) __PYX_ERR(55, 10, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DS) < (0)) __PYX_ERR(55, 10, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DS, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DS) < (0)) __PYX_ERR(55, 10, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DS->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DS->tp_weaklistoffset = offsetof(struct PyPetscDSObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(63, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Partitioner)) __PYX_ERR(63, 17, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscPartitioner_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Partitioner) < (0)) __PYX_ERR(63, 17, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Partitioner = &PyPetscPartitioner_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Partitioner) < (0)) __PYX_ERR(63, 17, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Partitioner);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Partitioner->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Partitioner->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Partitioner->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Partitioner, __pyx_vtabptr_8petsc4py_5PETSc_Partitioner) < (0)) __PYX_ERR(63, 17, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Partitioner) < (0)) __PYX_ERR(63, 17, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Partitioner, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Partitioner) < (0)) __PYX_ERR(63, 17, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Partitioner->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Partitioner->tp_weaklistoffset = offsetof(struct PyPetscPartitionerObject, __pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(61, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_DMLabel)) __PYX_ERR(61, 2, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscDMLabel_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMLabel) < (0)) __PYX_ERR(61, 2, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMLabel = &PyPetscDMLabel_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMLabel) < (0)) __PYX_ERR(61, 2, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMLabel);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMLabel->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMLabel->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMLabel->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_vtabptr_8petsc4py_5PETSc_DMLabel) < (0)) __PYX_ERR(61, 2, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMLabel) < (0)) __PYX_ERR(61, 2, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMLabel, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMLabel) < (0)) __PYX_ERR(61, 2, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMLabel->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMLabel->tp_weaklistoffset = offsetof(struct PyPetscDMLabelObject, __pyx_base.__weakref__);
  #endif
  __pyx_vtabptr_8petsc4py_5PETSc_Regressor = &__pyx_vtable_8petsc4py_5PETSc_Regressor;
  __pyx_vtable_8petsc4py_5PETSc_Regressor.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc_Object;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object); if (unlikely(!__pyx_t_1)) __PYX_ERR(66, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Regressor = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &PyPetscRegressor_Type_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Regressor)) __PYX_ERR(66, 24, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&PyPetscRegressor_Type_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Regressor) < (0)) __PYX_ERR(66, 24, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Regressor = &PyPetscRegressor_Type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Regressor) < (0)) __PYX_ERR(66, 24, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Regressor);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Regressor->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Regressor->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Regressor->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_vtabptr_8petsc4py_5PETSc_Regressor) < (0)) __PYX_ERR(66, 24, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Regressor) < (0)) __PYX_ERR(66, 24, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Regressor, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Regressor) < (0)) __PYX_ERR(66, 24, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Regressor->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Regressor->tp_weaklistoffset = offsetof(struct PyPetscRegressorObject, __pyx_base.__weakref__);
  #endif
  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_dtype = __Pyx_ImportType_3_2_8(__pyx_t_1, "numpy", "dtype",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyArray_Descr),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyArray_Descr),
  #else
  sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyArray_Descr),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_8); if (!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_dtype) __PYX_ERR(8, 9, __pyx_L1_error)
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_ndarray = __Pyx_ImportType_3_2_8(__pyx_t_1, "numpy", "ndarray",
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyArrayObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyArrayObject),
  #else
  sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_2_8(PyArrayObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_2_8); if (!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_ndarray) __PYX_ERR(8, 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;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__IS_buffer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__IS_buffer_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__IS_buffer)) __PYX_ERR(18, 122, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc__IS_buffer) < (0)) __PYX_ERR(18, 122, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc__IS_buffer) < (0)) __PYX_ERR(18, 122, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__IS_buffer);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__IS_buffer->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__IS_buffer->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__IS_buffer->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__IS_buffer, __pyx_vtabptr_8petsc4py_5PETSc__IS_buffer) < (0)) __PYX_ERR(18, 122, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__IS_buffer) < (0)) __PYX_ERR(18, 122, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_IS_buffer, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__IS_buffer) < (0)) __PYX_ERR(18, 122, __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;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__Vec_buffer_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer)) __PYX_ERR(3, 503, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer) < (0)) __PYX_ERR(3, 503, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer) < (0)) __PYX_ERR(3, 503, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer, __pyx_vtabptr_8petsc4py_5PETSc__Vec_buffer) < (0)) __PYX_ERR(3, 503, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer) < (0)) __PYX_ERR(3, 503, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Vec_buffer, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer) < (0)) __PYX_ERR(3, 503, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__Vec_LocalForm_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm)) __PYX_ERR(3, 594, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__Vec_LocalForm_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm) < (0)) __PYX_ERR(3, 594, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm) < (0)) __PYX_ERR(3, 594, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Vec_LocalForm, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm) < (0)) __PYX_ERR(3, 594, __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_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array)) __PYX_ERR(4, 198, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__DMDA_Vec_array_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array) < (0)) __PYX_ERR(4, 198, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array) < (0)) __PYX_ERR(4, 198, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array, __pyx_vtabptr_8petsc4py_5PETSc__DMDA_Vec_array) < (0)) __PYX_ERR(4, 198, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array) < (0)) __PYX_ERR(4, 198, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMDA_Vec_array, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array) < (0)) __PYX_ERR(4, 198, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__DMComposite_access = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__DMComposite_access_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__DMComposite_access)) __PYX_ERR(27, 17, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__DMComposite_access_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__DMComposite_access) < (0)) __PYX_ERR(27, 17, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc__DMComposite_access) < (0)) __PYX_ERR(27, 17, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__DMComposite_access);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__DMComposite_access->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__DMComposite_access->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__DMComposite_access->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMComposite_access, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__DMComposite_access) < (0)) __PYX_ERR(27, 17, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Options = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_Options_spec, NULL); if (unlikely(!__pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Options) < (0)) __PYX_ERR(31, 3, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Options) < (0)) __PYX_ERR(31, 3, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Options);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Options->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Options->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Options->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Options, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Options) < (0)) __PYX_ERR(31, 3, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Sys = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_Sys_spec, NULL); if (unlikely(!__pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Sys) < (0)) __PYX_ERR(32, 3, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Sys) < (0)) __PYX_ERR(32, 3, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Sys);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Sys->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Sys->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Sys->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Sys, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Sys) < (0)) __PYX_ERR(32, 3, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Log = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_Log_spec, NULL); if (unlikely(!__pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Log) < (0)) __PYX_ERR(33, 8, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_Log) < (0)) __PYX_ERR(33, 8, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Log);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Log->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Log->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Log->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Log, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_Log) < (0)) __PYX_ERR(33, 8, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogStage = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_LogStage_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogStage)) __PYX_ERR(33, 272, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_LogStage_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogStage) < (0)) __PYX_ERR(33, 272, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_LogStage) < (0)) __PYX_ERR(33, 272, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogStage);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogStage->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogStage->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogStage->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_LogStage, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogStage) < (0)) __PYX_ERR(33, 272, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogClass = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_LogClass_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogClass)) __PYX_ERR(33, 458, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_LogClass_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogClass) < (0)) __PYX_ERR(33, 458, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_LogClass) < (0)) __PYX_ERR(33, 458, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogClass);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogClass->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogClass->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogClass->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_LogClass, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogClass) < (0)) __PYX_ERR(33, 458, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogEvent = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_LogEvent_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogEvent)) __PYX_ERR(33, 535, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_LogEvent_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogEvent) < (0)) __PYX_ERR(33, 535, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_LogEvent) < (0)) __PYX_ERR(33, 535, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogEvent);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogEvent->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogEvent->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogEvent->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_LogEvent, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_LogEvent) < (0)) __PYX_ERR(33, 535, __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer); if (unlikely(!__pyx_t_2)) __PYX_ERR(37, 1033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5)) __PYX_ERR(37, 1033, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_ViewerHDF5_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5) < (0)) __PYX_ERR(37, 1033, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5 = &__pyx_type_8petsc4py_5PETSc_ViewerHDF5;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5) < (0)) __PYX_ERR(37, 1033, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5, __pyx_vtabptr_8petsc4py_5PETSc_ViewerHDF5) < (0)) __PYX_ERR(37, 1033, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5) < (0)) __PYX_ERR(37, 1033, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ViewerHDF5, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5) < (0)) __PYX_ERR(37, 1033, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5->tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_ViewerHDF5, __pyx_base.__pyx_base.__weakref__);
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatStencil = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_MatStencil_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatStencil)) __PYX_ERR(46, 285, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_MatStencil_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatStencil) < (0)) __PYX_ERR(46, 285, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_MatStencil) < (0)) __PYX_ERR(46, 285, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatStencil);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatStencil->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatStencil->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_MatStencil->tp_getattro = 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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM); if (unlikely(!__pyx_t_2)) __PYX_ERR(56, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_DMDA)) __PYX_ERR(56, 23, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_DMDA_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMDA) < (0)) __PYX_ERR(56, 23, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMDA = &__pyx_type_8petsc4py_5PETSc_DMDA;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMDA) < (0)) __PYX_ERR(56, 23, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMDA);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMDA->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMDA->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMDA->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_vtabptr_8petsc4py_5PETSc_DMDA) < (0)) __PYX_ERR(56, 23, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMDA) < (0)) __PYX_ERR(56, 23, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMDA, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMDA) < (0)) __PYX_ERR(56, 23, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMDA->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMDA->tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMDA, __pyx_base.__pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM); if (unlikely(!__pyx_t_2)) __PYX_ERR(57, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlex)) __PYX_ERR(57, 3, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_DMPlex_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlex) < (0)) __PYX_ERR(57, 3, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlex = &__pyx_type_8petsc4py_5PETSc_DMPlex;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlex) < (0)) __PYX_ERR(57, 3, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlex);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlex->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlex->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlex->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_vtabptr_8petsc4py_5PETSc_DMPlex) < (0)) __PYX_ERR(57, 3, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlex) < (0)) __PYX_ERR(57, 3, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMPlex, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlex) < (0)) __PYX_ERR(57, 3, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlex->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMPlex->tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMPlex, __pyx_base.__pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM); if (unlikely(!__pyx_t_2)) __PYX_ERR(58, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_DMStag)) __PYX_ERR(58, 44, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_DMStag_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMStag) < (0)) __PYX_ERR(58, 44, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMStag = &__pyx_type_8petsc4py_5PETSc_DMStag;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMStag) < (0)) __PYX_ERR(58, 44, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMStag);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMStag->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMStag->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMStag->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_vtabptr_8petsc4py_5PETSc_DMStag) < (0)) __PYX_ERR(58, 44, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMStag) < (0)) __PYX_ERR(58, 44, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMStag, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMStag) < (0)) __PYX_ERR(58, 44, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMStag->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMStag->tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMStag, __pyx_base.__pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM); if (unlikely(!__pyx_t_2)) __PYX_ERR(59, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__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_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_DMComposite) < (0)) __PYX_ERR(59, 3, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMComposite = &__pyx_type_8petsc4py_5PETSc_DMComposite;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMComposite->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMComposite) < (0)) __PYX_ERR(59, 3, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMComposite);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMComposite->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMComposite->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMComposite->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_vtabptr_8petsc4py_5PETSc_DMComposite) < (0)) __PYX_ERR(59, 3, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMComposite) < (0)) __PYX_ERR(59, 3, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMComposite, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMComposite) < (0)) __PYX_ERR(59, 3, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMComposite->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMComposite->tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMComposite, __pyx_base.__pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM); if (unlikely(!__pyx_t_2)) __PYX_ERR(60, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__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_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_DMShell) < (0)) __PYX_ERR(60, 1, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMShell = &__pyx_type_8petsc4py_5PETSc_DMShell;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMShell) < (0)) __PYX_ERR(60, 1, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMShell);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMShell->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMShell->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMShell->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_vtabptr_8petsc4py_5PETSc_DMShell) < (0)) __PYX_ERR(60, 1, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMShell) < (0)) __PYX_ERR(60, 1, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMShell, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMShell) < (0)) __PYX_ERR(60, 1, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMShell->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMShell->tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMShell, __pyx_base.__pyx_base.__weakref__);
  #endif
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM); if (unlikely(!__pyx_t_2)) __PYX_ERR(62, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_DMSwarm)) __PYX_ERR(62, 32, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc_DMSwarm_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMSwarm) < (0)) __PYX_ERR(62, 32, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMSwarm = &__pyx_type_8petsc4py_5PETSc_DMSwarm;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMSwarm) < (0)) __PYX_ERR(62, 32, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMSwarm);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_vtabptr_8petsc4py_5PETSc_DMSwarm) < (0)) __PYX_ERR(62, 32, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMSwarm) < (0)) __PYX_ERR(62, 32, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMSwarm, (PyObject *) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMSwarm) < (0)) __PYX_ERR(62, 32, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SLOTS
  if (__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_weaklistoffset == 0) __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMSwarm->tp_weaklistoffset = offsetof(struct __pyx_obj_8petsc4py_5PETSc_DMSwarm, __pyx_base.__pyx_base.__weakref__);
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc_DMInterpolation_spec, NULL); if (unlikely(!__pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation) < (0)) __PYX_ERR(65, 2, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation) < (0)) __PYX_ERR(65, 2, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMInterpolation, (PyObject *) __pyx_mstate->__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 const *))__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_mstate->__pyx_ptype_8petsc4py_5PETSc__PyObj = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__PyObj_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyObj)) __PYX_ERR(5, 171, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__PyObj_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyObj) < (0)) __PYX_ERR(5, 171, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc__PyObj) < (0)) __PYX_ERR(5, 171, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyObj);
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyObj, __pyx_vtabptr_8petsc4py_5PETSc__PyObj) < (0)) __PYX_ERR(5, 171, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyObj) < (0)) __PYX_ERR(5, 171, __pyx_L1_error)
  __pyx_vtabptr_8petsc4py_5PETSc__PyVwr = &__pyx_vtable_8petsc4py_5PETSc__PyVwr;
  __pyx_vtable_8petsc4py_5PETSc__PyVwr.__pyx_base = *__pyx_vtabptr_8petsc4py_5PETSc__PyObj;
  __pyx_vtable_8petsc4py_5PETSc__PyVwr.setfilename = (int (*)(struct __pyx_obj_8petsc4py_5PETSc__PyVwr *, char const *))__pyx_f_8petsc4py_5PETSc_6_PyVwr_setfilename;
  __pyx_vtable_8petsc4py_5PETSc__PyVwr.getfilename = (char *(*)(struct __pyx_obj_8petsc4py_5PETSc__PyVwr *))__pyx_f_8petsc4py_5PETSc_6_PyVwr_getfilename;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyObj); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyVwr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_8petsc4py_5PETSc__PyVwr_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyVwr)) __PYX_ERR(5, 305, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__PyVwr_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyVwr) < (0)) __PYX_ERR(5, 305, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyVwr = &__pyx_type_8petsc4py_5PETSc__PyVwr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyVwr->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyObj;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyVwr) < (0)) __PYX_ERR(5, 305, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyVwr);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyVwr->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyVwr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyVwr->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyVwr, __pyx_vtabptr_8petsc4py_5PETSc__PyVwr) < (0)) __PYX_ERR(5, 305, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyVwr) < (0)) __PYX_ERR(5, 305, __pyx_L1_error)
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyObj); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc__PyMat)) __PYX_ERR(5, 577, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__PyMat_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyMat) < (0)) __PYX_ERR(5, 577, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyMat = &__pyx_type_8petsc4py_5PETSc__PyMat;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyMat->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyObj;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyMat) < (0)) __PYX_ERR(5, 577, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyMat);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyMat->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyMat->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyMat->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyMat, __pyx_vtabptr_8petsc4py_5PETSc__PyMat) < (0)) __PYX_ERR(5, 577, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyMat) < (0)) __PYX_ERR(5, 577, __pyx_L1_error)
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyObj); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc__PyPC)) __PYX_ERR(5, 1428, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__PyPC_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyPC) < (0)) __PYX_ERR(5, 1428, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyPC = &__pyx_type_8petsc4py_5PETSc__PyPC;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyPC->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyObj;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyPC) < (0)) __PYX_ERR(5, 1428, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyPC);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyPC->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyPC->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyPC->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyPC, __pyx_vtabptr_8petsc4py_5PETSc__PyPC) < (0)) __PYX_ERR(5, 1428, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyPC) < (0)) __PYX_ERR(5, 1428, __pyx_L1_error)
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyObj); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc__PyKSP)) __PYX_ERR(5, 1724, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__PyKSP_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyKSP) < (0)) __PYX_ERR(5, 1724, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyKSP = &__pyx_type_8petsc4py_5PETSc__PyKSP;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyKSP->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyObj;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyKSP) < (0)) __PYX_ERR(5, 1724, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyKSP);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyKSP->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyKSP->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyKSP->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyKSP, __pyx_vtabptr_8petsc4py_5PETSc__PyKSP) < (0)) __PYX_ERR(5, 1724, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyKSP) < (0)) __PYX_ERR(5, 1724, __pyx_L1_error)
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyObj); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc__PySNES)) __PYX_ERR(5, 2067, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__PySNES_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PySNES) < (0)) __PYX_ERR(5, 2067, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PySNES = &__pyx_type_8petsc4py_5PETSc__PySNES;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PySNES->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyObj;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PySNES) < (0)) __PYX_ERR(5, 2067, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PySNES);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PySNES->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PySNES->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PySNES->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PySNES, __pyx_vtabptr_8petsc4py_5PETSc__PySNES) < (0)) __PYX_ERR(5, 2067, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PySNES) < (0)) __PYX_ERR(5, 2067, __pyx_L1_error)
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyObj); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTS)) __PYX_ERR(5, 2390, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__PyTS_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTS) < (0)) __PYX_ERR(5, 2390, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTS = &__pyx_type_8petsc4py_5PETSc__PyTS;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyTS->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyObj;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTS) < (0)) __PYX_ERR(5, 2390, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTS);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTS->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTS->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTS->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTS, __pyx_vtabptr_8petsc4py_5PETSc__PyTS) < (0)) __PYX_ERR(5, 2390, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTS) < (0)) __PYX_ERR(5, 2390, __pyx_L1_error)
  __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_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyObj); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 2790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTao)) __PYX_ERR(5, 2790, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc__PyTao_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTao) < (0)) __PYX_ERR(5, 2790, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTao = &__pyx_type_8petsc4py_5PETSc__PyTao;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyTao->tp_base = __pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__PyObj;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTao) < (0)) __PYX_ERR(5, 2790, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTao);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTao->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTao->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTao->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTao, __pyx_vtabptr_8petsc4py_5PETSc__PyTao) < (0)) __PYX_ERR(5, 2790, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc__PyTao) < (0)) __PYX_ERR(5, 2790, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator)) __PYX_ERR(33, 240, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator) < (0)) __PYX_ERR(33, 240, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator) < (0)) __PYX_ERR(33, 240, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator)) __PYX_ERR(33, 243, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_8petsc4py_5PETSc___pyx_scope_struct_1_decorator_spec, __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator) < (0)) __PYX_ERR(33, 243, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator) < (0)) __PYX_ERR(33, 243, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator->tp_dictoffset && __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_8petsc4py_5PETSc___pyx_scope_struct_1_decorator->tp_getattro = PyObject_GenericGetAttr;
  }
  #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_mstate->__pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_array_type)) __PYX_ERR(6, 118, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate->__pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
  if (!__pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer && __pyx_mstate->__pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) {
    __pyx_mstate->__pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__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_mstate->__pyx_array_type) < (0)) __PYX_ERR(6, 118, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_array_type) < (0)) __PYX_ERR(6, 118, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_array_type);
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_array_type, __pyx_vtabptr_array) < (0)) __PYX_ERR(6, 118, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(6, 118, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_array_type) < (0)) __PYX_ERR(6, 118, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_MemviewEnum_type)) __PYX_ERR(6, 307, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_MemviewEnum_spec, __pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(6, 307, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(6, 307, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_MemviewEnum_type);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_MemviewEnum_type->tp_dictoffset && __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_MemviewEnum_type->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_MemviewEnum_type) < (0)) __PYX_ERR(6, 307, __pyx_L1_error)
  __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_mstate->__pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_memoryview_type)) __PYX_ERR(6, 342, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate->__pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
  if (!__pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_mstate->__pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) {
    __pyx_mstate->__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_mstate->__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_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(6, 342, __pyx_L1_error)
  #else
  __pyx_mstate->__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_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(6, 342, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryview_type);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_memoryview_type->tp_dictoffset && __pyx_mstate->__pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_memoryview_type->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryview_type, __pyx_vtabptr_memoryview) < (0)) __PYX_ERR(6, 342, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(6, 342, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryview_type) < (0)) __PYX_ERR(6, 342, __pyx_L1_error)
  __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_mstate_global->__pyx_memoryview_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_mstate->__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_mstate->__pyx_memoryviewslice_type)) __PYX_ERR(6, 856, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryviewslice_spec, __pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(6, 856, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_memoryviewslice_type->tp_base = __pyx_mstate_global->__pyx_memoryview_type;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(6, 856, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_memoryviewslice_type);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_memoryviewslice_type->tp_dictoffset && __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_memoryviewslice_type->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < (0)) __PYX_ERR(6, 856, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(6, 856, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_memoryviewslice_type) < (0)) __PYX_ERR(6, 856, __pyx_L1_error)
  __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(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

#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},
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
  #endif
  #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
  {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
  #endif
  {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_USE_MODULE_STATE
      sizeof(__pyx_mstatetype), /* m_size */
    #else
      (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -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

/* PyModInitFuncType */
#ifndef CYTHON_NO_PYINIT_EXPORT
  #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#else
  #ifdef __cplusplus
  #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
  #else
  #define __Pyx_PyMODINIT_FUNC PyObject *
  #endif
#endif

__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);
}
/* ModuleCreationPEP489 */
#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
    {
        PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
        if (!module) {
            PyErr_Clear(); // just try the 3.8-3.12 version
            module = PyImport_ImportModule("_xxsubinterpreters");
            if (!module) goto bad;
        }
        PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
        Py_DECREF(module);
        if (!current) goto bad;
        if (PyTuple_Check(current)) {
            PyObject *new_current = PySequence_GetItem(current, 0);
            Py_DECREF(current);
            current = new_current;
            if (!new_current) goto bad;
        }
        long long as_c_int = PyLong_AsLongLong(current);
        Py_DECREF(current);
        return as_c_int;
    }
  bad:
    PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
    return -1;
}
#endif
#if !CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    static PY_INT64_T main_interpreter_id = -1;
#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
    PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_GRAAL
    PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
      || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
    PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
#elif CYTHON_COMPILING_IN_LIMITED_API
    PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
#else
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
#endif
    if (unlikely(current_id == -1)) {
        return -1;
    }
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return 0;
    } else if (unlikely(main_interpreter_id != current_id)) {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#endif
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)
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        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 !CYTHON_USE_MODULE_STATE
    if (__Pyx_check_single_interpreter())
        return NULL;
    #endif
    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;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    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
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  __pyx_mstatetype *__pyx_mstate = NULL;
  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;
  size_t __pyx_t_6;
  static PyThread_type_lock __pyx_t_7[8];
  int __pyx_t_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;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = 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;
  }
  #else
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_t_1 = __pyx_pyinit_module;
  Py_INCREF(__pyx_t_1);
  #else
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #if CYTHON_USE_MODULE_STATE
  {
    int add_module_result = __Pyx_State_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(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = __pyx_t_1;
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
  #endif
  __pyx_mstate = __pyx_mstate_global;
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_mstate->__pyx_d);
  __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /* ImportRefnannyAPI */
  #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("PyInit_PETSc", 0);
  __Pyx_init_runtime_version();
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Library function declarations ---*/
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__pyx_module_is_main_petsc4py__PETSc) {
    if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "petsc4py.PETSc")) {
      if (unlikely((PyDict_SetItemString(modules, "petsc4py.PETSc", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code(__pyx_mstate);
  (void)__Pyx_modinit_variable_export_code(__pyx_mstate);
  if (unlikely((__Pyx_modinit_function_export_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_type_import_code(__pyx_mstate);
  (void)__Pyx_modinit_variable_import_code(__pyx_mstate);
  (void)__Pyx_modinit_function_import_code(__pyx_mstate);
  /*--- Execution code ---*/

  /* "View.MemoryView":108
 * 
 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
 * try:             # <<<<<<<<<<<<<<
 *     __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 * except:
*/
  {
    __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":109
 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
 * try:
 *     __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence             # <<<<<<<<<<<<<<
 * except:
 * 
*/
      __pyx_t_5 = NULL;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_collections_abc};
        __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin___import__, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 109, __pyx_L2_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_abc); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 109, __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_mstate_global->__pyx_n_u_Sequence); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 109, __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":108
 * 
 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
 * try:             # <<<<<<<<<<<<<<
 *     __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 * except:
*/
    }
    __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":110
 * try:
 *     __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 * except:             # <<<<<<<<<<<<<<
 * 
 *     __pyx_collections_abc_Sequence = None
*/
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);

      /* "View.MemoryView":112
 * 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);
      goto __pyx_L3_exception_handled;
    }
    __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":247
 * 
 * 
 *     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":248
 * 
 *     try:
 *         count = __pyx_collections_abc_Sequence.count             # <<<<<<<<<<<<<<
 *         index = __pyx_collections_abc_Sequence.index
 *     except:
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 248, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_array_type, __pyx_mstate_global->__pyx_n_u_count, __pyx_t_4) < (0)) __PYX_ERR(6, 248, __pyx_L10_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "View.MemoryView":249
 *     try:
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index             # <<<<<<<<<<<<<<
 *     except:
 *         pass
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 249, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_array_type, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_4) < (0)) __PYX_ERR(6, 249, __pyx_L10_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "View.MemoryView":247
 * 
 * 
 *     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_L15_try_end;
    __pyx_L10_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "View.MemoryView":250
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
 *     except:             # <<<<<<<<<<<<<<
 *         pass
 * 
*/
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L11_exception_handled;
    }
    __pyx_L11_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_L15_try_end:;
  }

  /* "View.MemoryView":315
 *         return self.name
 * 
 * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct_or_indirect};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 315, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __Pyx_XGOTREF(generic);
  __Pyx_DECREF_SET(generic, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":316
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
 * cdef indirect = Enum("<strided and indirect>")
 * 
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_direct};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 316, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __Pyx_XGOTREF(strided);
  __Pyx_DECREF_SET(strided, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":317
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_strided_and_indirect};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 317, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __Pyx_XGOTREF(indirect);
  __Pyx_DECREF_SET(indirect, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":320
 * 
 * 
 * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
 * 
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_direct};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 320, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __Pyx_XGOTREF(contiguous);
  __Pyx_DECREF_SET(contiguous, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":321
 * 
 * cdef contiguous = Enum("<contiguous and direct>")
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_5 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_contiguous_and_indirect};
    __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_MemviewEnum_type, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 321, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_4);
  }
  __Pyx_XGOTREF(indirect_contiguous);
  __Pyx_DECREF_SET(indirect_contiguous, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":329
 * 
 * 
 * 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":330
 * 
 * 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_7[0] = PyThread_allocate_lock();
  __pyx_t_7[1] = PyThread_allocate_lock();
  __pyx_t_7[2] = PyThread_allocate_lock();
  __pyx_t_7[3] = PyThread_allocate_lock();
  __pyx_t_7[4] = PyThread_allocate_lock();
  __pyx_t_7[5] = PyThread_allocate_lock();
  __pyx_t_7[6] = PyThread_allocate_lock();
  __pyx_t_7[7] = PyThread_allocate_lock();
  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_7, sizeof(__pyx_memoryview_thread_locks[0]) * (8));

  /* "View.MemoryView":888
 * 
 * 
 *     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":889
 * 
 *     try:
 *         count = __pyx_collections_abc_Sequence.count             # <<<<<<<<<<<<<<
 *         index = __pyx_collections_abc_Sequence.index
 *     except:
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 889, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_memoryviewslice_type, __pyx_mstate_global->__pyx_n_u_count, __pyx_t_4) < (0)) __PYX_ERR(6, 889, __pyx_L18_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "View.MemoryView":890
 *     try:
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index             # <<<<<<<<<<<<<<
 *     except:
 *         pass
*/
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 890, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_memoryviewslice_type, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_4) < (0)) __PYX_ERR(6, 890, __pyx_L18_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "View.MemoryView":888
 * 
 * 
 *     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_L23_try_end;
    __pyx_L18_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "View.MemoryView":891
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
 *     except:             # <<<<<<<<<<<<<<
 *         pass
 * 
*/
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L19_exception_handled;
    }
    __pyx_L19_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_L23_try_end:;
  }

  /* "View.MemoryView":894
 *         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":895
 * 
 * try:
 *     if __pyx_collections_abc_Sequence:             # <<<<<<<<<<<<<<
 * 
 * 
*/
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(6, 895, __pyx_L26_error)
      if (__pyx_t_8) {

        /* "View.MemoryView":899
 * 
 * 
 *         __pyx_collections_abc_Sequence.register(_memoryviewslice)             # <<<<<<<<<<<<<<
 *         __pyx_collections_abc_Sequence.register(array)
 * except:
*/
        __pyx_t_5 = __pyx_collections_abc_Sequence;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_memoryviewslice_type)};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 899, __pyx_L26_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "View.MemoryView":900
 * 
 *         __pyx_collections_abc_Sequence.register(_memoryviewslice)
 *         __pyx_collections_abc_Sequence.register(array)             # <<<<<<<<<<<<<<
 * except:
 *     pass  # ignore failure, it's a minor issue
*/
        __pyx_t_5 = __pyx_collections_abc_Sequence;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, ((PyObject *)__pyx_mstate_global->__pyx_array_type)};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_register, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 900, __pyx_L26_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "View.MemoryView":895
 * 
 * try:
 *     if __pyx_collections_abc_Sequence:             # <<<<<<<<<<<<<<
 * 
 * 
*/
      }

      /* "View.MemoryView":894
 *         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_L31_try_end;
    __pyx_L26_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "View.MemoryView":901
 *         __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_L27_exception_handled;
    }
    __pyx_L27_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_L31_try_end:;
  }

  /* "(tree fragment)":4
 *     int __Pyx_CheckUnpickleChecksum(long, long, long, long, const char*) except -1
 *     int __Pyx_UpdateUnpickledDict(object, object, Py_ssize_t) except -1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_result
 *     __Pyx_CheckUnpickleChecksum(__pyx_checksum, 0x82a3537, 0x6ae9995, 0xb068931, b'name')
*/
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_mstate_global->__pyx_n_u_View_MemoryView); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_unpickle_Enum, __pyx_t_4) < (0)) __PYX_ERR(6, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":67
 *     void PyException_SetCause(PyObject*, PyObject*)
 * 
 * cdef object PetscError = <object>PyExc_RuntimeError             # <<<<<<<<<<<<<<
 * 
 * cdef inline void PetscTracebackAdd(object exc) noexcept:
*/
  __pyx_t_4 = ((PyObject *)PyExc_RuntimeError);
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_PetscError);
  __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_PetscError, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":173
 * 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(7, 173, __pyx_L1_error)

  /* "petsc4py/PETSc/PETSc.pyx":175
 * import_array()
 * 
 * IntType     = PyArray_TypeObjectFromType(NPY_PETSC_INT)             # <<<<<<<<<<<<<<
 * RealType    = PyArray_TypeObjectFromType(NPY_PETSC_REAL)
 * ScalarType  = PyArray_TypeObjectFromType(NPY_PETSC_SCALAR)
*/
  __pyx_t_4 = PyArray_TypeObjectFromType(NPY_PETSC_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_IntType, __pyx_t_4) < (0)) __PYX_ERR(7, 175, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":176
 * 
 * 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_4 = PyArray_TypeObjectFromType(NPY_PETSC_REAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RealType, __pyx_t_4) < (0)) __PYX_ERR(7, 176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":177
 * 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_4 = PyArray_TypeObjectFromType(NPY_PETSC_SCALAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ScalarType, __pyx_t_4) < (0)) __PYX_ERR(7, 177, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":178
 * RealType    = PyArray_TypeObjectFromType(NPY_PETSC_REAL)
 * ScalarType  = PyArray_TypeObjectFromType(NPY_PETSC_SCALAR)
 * ComplexType = PyArray_TypeObjectFromType(NPY_PETSC_COMPLEX)             # <<<<<<<<<<<<<<
 * 
 * include "dlpack.pxi"
*/
  __pyx_t_4 = PyArray_TypeObjectFromType(NPY_PETSC_COMPLEX); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ComplexType, __pyx_t_4) < (0)) __PYX_ERR(7, 178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/petscis.pxi":189
 *         return None
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self.enter()
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_10_IS_buffer_9__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_buffer___enter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__IS_buffer, __pyx_mstate_global->__pyx_n_u_enter, __pyx_t_4) < (0)) __PYX_ERR(18, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/petscis.pxi":192
 *         return self.enter()
 * 
 *     def __exit__(self, *exc):             # <<<<<<<<<<<<<<
 *         return self.exit()
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_10_IS_buffer_11__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_buffer___exit, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_4)) __PYX_ERR(18, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__IS_buffer, __pyx_mstate_global->__pyx_n_u_exit, __pyx_t_4) < (0)) __PYX_ERR(18, 192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":571
 *         return None
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self.enter()
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11_Vec_buffer_9__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_buffer___enter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer, __pyx_mstate_global->__pyx_n_u_enter, __pyx_t_4) < (0)) __PYX_ERR(3, 571, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":574
 *         return self.enter()
 * 
 *     def __exit__(self, *exc):             # <<<<<<<<<<<<<<
 *         return self.exit()
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11_Vec_buffer_11__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_buffer___exit, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__Vec_buffer, __pyx_mstate_global->__pyx_n_u_exit, __pyx_t_4) < (0)) __PYX_ERR(3, 574, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":603
 *         self.lvec = Vec()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         cdef PetscVec gvec = self.gvec.vec
 *         CHKERR(VecGhostGetLocalForm(gvec, &self.lvec.vec))
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_14_Vec_LocalForm_3__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_LocalForm___enter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm, __pyx_mstate_global->__pyx_n_u_enter, __pyx_t_4) < (0)) __PYX_ERR(3, 603, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/petscvec.pxi":608
 *         return self.lvec
 * 
 *     def __exit__(self, *exc):             # <<<<<<<<<<<<<<
 *         cdef PetscVec gvec = self.gvec.vec
 *         CHKERR(VecGhostRestoreLocalForm(gvec, &self.lvec.vec))
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_14_Vec_LocalForm_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_LocalForm___exit, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__Vec_LocalForm, __pyx_mstate_global->__pyx_n_u_exit, __pyx_t_4) < (0)) __PYX_ERR(3, 608, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/petscdmda.pxi":280
 *     # 'with' statement (PEP 343)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         self.acquire()
 *         return self
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15_DMDA_Vec_array_7__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_Vec_array___enter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array, __pyx_mstate_global->__pyx_n_u_enter, __pyx_t_4) < (0)) __PYX_ERR(4, 280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/petscdmda.pxi":284
 *         return self
 * 
 *     def __exit__(self, *exc):             # <<<<<<<<<<<<<<
 *         self.release()
 *         return None
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15_DMDA_Vec_array_9__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_Vec_array___exit, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__DMDA_Vec_array, __pyx_mstate_global->__pyx_n_u_exit, __pyx_t_4) < (0)) __PYX_ERR(4, 284, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/petscdmcomposite.pxi":43
 *         CHKERR(VecDestroy(&self.gvec))
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t n = self.nlocs
 *         CHKERR(DMCompositeGetAccessArray(self.dm, self.gvec, self.nlocs, self.locs, self.vecs))
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_19_DMComposite_access_5__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMComposite_access___enter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__DMComposite_access, __pyx_mstate_global->__pyx_n_u_enter, __pyx_t_4) < (0)) __PYX_ERR(27, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "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: (<Vec>self.access[i]).vec = NULL
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_19_DMComposite_access_7__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMComposite_access___exit, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_4)) __PYX_ERR(27, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc__DMComposite_access, __pyx_mstate_global->__pyx_n_u_exit, __pyx_t_4) < (0)) __PYX_ERR(27, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/petscpyappctx.pxi":1
 * cdef set appctx_registry = set()             # <<<<<<<<<<<<<<
 * 
 * cdef inline object registerAppCtx(void *appctx):
*/
  __pyx_t_4 = PySet_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(29, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_appctx_registry);
  __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_appctx_registry, ((PyObject*)__pyx_t_4));
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":228
 * # --------------------------------------------------------------------
 * 
 * __doc__ = """             # <<<<<<<<<<<<<<
 * Portable, Extensible Toolkit for Scientific Computation.
 * """
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_doc, __pyx_mstate_global->__pyx_kp_u_Portable_Extensible_Toolkit_for) < (0)) __PYX_ERR(7, 228, __pyx_L1_error)

  /* "petsc4py/PETSc/Const.pyx":3
 * # ------------------------------------------------------------------------------
 * 
 * DECIDE    = PETSC_DECIDE             # <<<<<<<<<<<<<<
 * DEFAULT   = PETSC_DEFAULT
 * DETERMINE = PETSC_DETERMINE
*/
  __pyx_t_4 = __Pyx_PyLong_From___pyx_anon_enum(PETSC_DECIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DECIDE, __pyx_t_4) < (0)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Const.pyx":4
 * 
 * DECIDE    = PETSC_DECIDE
 * DEFAULT   = PETSC_DEFAULT             # <<<<<<<<<<<<<<
 * DETERMINE = PETSC_DETERMINE
 * CURRENT   = PETSC_CURRENT
*/
  __pyx_t_4 = __Pyx_PyLong_From___pyx_anon_enum(PETSC_DEFAULT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DEFAULT, __pyx_t_4) < (0)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Const.pyx":5
 * DECIDE    = PETSC_DECIDE
 * DEFAULT   = PETSC_DEFAULT
 * DETERMINE = PETSC_DETERMINE             # <<<<<<<<<<<<<<
 * CURRENT   = PETSC_CURRENT
 * UNLIMITED = PETSC_UNLIMITED
*/
  __pyx_t_4 = __Pyx_PyLong_From___pyx_anon_enum(PETSC_DETERMINE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DETERMINE, __pyx_t_4) < (0)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Const.pyx":6
 * DEFAULT   = PETSC_DEFAULT
 * DETERMINE = PETSC_DETERMINE
 * CURRENT   = PETSC_CURRENT             # <<<<<<<<<<<<<<
 * UNLIMITED = PETSC_UNLIMITED
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From___pyx_anon_enum(PETSC_CURRENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CURRENT, __pyx_t_4) < (0)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Const.pyx":7
 * DETERMINE = PETSC_DETERMINE
 * CURRENT   = PETSC_CURRENT
 * UNLIMITED = PETSC_UNLIMITED             # <<<<<<<<<<<<<<
 * 
 * __doc__ += """
*/
  __pyx_t_4 = __Pyx_PyLong_From___pyx_anon_enum(PETSC_UNLIMITED); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_UNLIMITED, __pyx_t_4) < (0)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Const.pyx":9
 * UNLIMITED = PETSC_UNLIMITED
 * 
 * __doc__ += """             # <<<<<<<<<<<<<<
 * Basic constants:
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_doc); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Basic_constants_DECIDE_Use_a_de); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_doc, __pyx_t_5) < (0)) __PYX_ERR(1, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Const.pyx":29
 * # ------------------------------------------------------------------------------
 * 
 * INFINITY  = toReal(PETSC_INFINITY)             # <<<<<<<<<<<<<<
 * NINFINITY = toReal(PETSC_NINFINITY)
 * PINFINITY = toReal(PETSC_INFINITY)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(PETSC_INFINITY); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_INFINITY, __pyx_t_5) < (0)) __PYX_ERR(1, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Const.pyx":30
 * 
 * INFINITY  = toReal(PETSC_INFINITY)
 * NINFINITY = toReal(PETSC_NINFINITY)             # <<<<<<<<<<<<<<
 * PINFINITY = toReal(PETSC_INFINITY)
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(PETSC_NINFINITY); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NINFINITY, __pyx_t_5) < (0)) __PYX_ERR(1, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Const.pyx":31
 * INFINITY  = toReal(PETSC_INFINITY)
 * NINFINITY = toReal(PETSC_NINFINITY)
 * PINFINITY = toReal(PETSC_INFINITY)             # <<<<<<<<<<<<<<
 * 
 * __doc__ += """
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_toReal(PETSC_INFINITY); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PINFINITY, __pyx_t_5) < (0)) __PYX_ERR(1, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Const.pyx":33
 * PINFINITY = toReal(PETSC_INFINITY)
 * 
 * __doc__ += """             # <<<<<<<<<<<<<<
 * More constants:
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_doc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_More_constants_INFINITY_Very_la); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_doc, __pyx_t_4) < (0)) __PYX_ERR(1, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Const.pyx":47
 * 
 * 
 * class InsertMode(object):             # <<<<<<<<<<<<<<
 *     """Insertion mode.
 * 
*/
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[12]); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_InsertMode, __pyx_mstate_global->__pyx_n_u_InsertMode, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Insertion_mode_Most_commonly_use); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[12]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[12]) < 0))) __PYX_ERR(1, 47, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Const.pyx":65
 *     """
 *     # native
 *     NOT_SET_VALUES    = PETSC_NOT_SET_VALUES             # <<<<<<<<<<<<<<
 *     INSERT_VALUES     = PETSC_INSERT_VALUES
 *     ADD_VALUES        = PETSC_ADD_VALUES
*/
  __pyx_t_11 = __Pyx_PyLong_From_InsertMode(NOT_SET_VALUES); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NOT_SET_VALUES, __pyx_t_11) < (0)) __PYX_ERR(1, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":66
 *     # 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_11 = __Pyx_PyLong_From_InsertMode(INSERT_VALUES); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INSERT_VALUES, __pyx_t_11) < (0)) __PYX_ERR(1, 66, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":67
 *     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_11 = __Pyx_PyLong_From_InsertMode(ADD_VALUES); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ADD_VALUES, __pyx_t_11) < (0)) __PYX_ERR(1, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":68
 *     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_11 = __Pyx_PyLong_From_InsertMode(MAX_VALUES); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MAX_VALUES, __pyx_t_11) < (0)) __PYX_ERR(1, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":69
 *     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_11 = __Pyx_PyLong_From_InsertMode(INSERT_ALL_VALUES); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INSERT_ALL_VALUES, __pyx_t_11) < (0)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":70
 *     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_11 = __Pyx_PyLong_From_InsertMode(ADD_ALL_VALUES); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ADD_ALL_VALUES, __pyx_t_11) < (0)) __PYX_ERR(1, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":71
 *     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_11 = __Pyx_PyLong_From_InsertMode(INSERT_BC_VALUES); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INSERT_BC_VALUES, __pyx_t_11) < (0)) __PYX_ERR(1, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":72
 *     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_11 = __Pyx_PyLong_From_InsertMode(ADD_BC_VALUES); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ADD_BC_VALUES, __pyx_t_11) < (0)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":74
 *     ADD_BC_VALUES     = PETSC_ADD_BC_VALUES
 *     # aliases
 *     INSERT     = INSERT_VALUES             # <<<<<<<<<<<<<<
 *     ADD        = ADD_VALUES
 *     MAX        = MAX_VALUES
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INSERT_VALUES);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_INSERT_VALUES);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INSERT, __pyx_t_11) < (0)) __PYX_ERR(1, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":75
 *     # aliases
 *     INSERT     = INSERT_VALUES
 *     ADD        = ADD_VALUES             # <<<<<<<<<<<<<<
 *     MAX        = MAX_VALUES
 *     INSERT_ALL = INSERT_ALL_VALUES
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ADD_VALUES);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ADD_VALUES);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ADD, __pyx_t_11) < (0)) __PYX_ERR(1, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":76
 *     INSERT     = INSERT_VALUES
 *     ADD        = ADD_VALUES
 *     MAX        = MAX_VALUES             # <<<<<<<<<<<<<<
 *     INSERT_ALL = INSERT_ALL_VALUES
 *     ADD_ALL    = ADD_ALL_VALUES
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MAX_VALUES);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_MAX_VALUES);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MAX, __pyx_t_11) < (0)) __PYX_ERR(1, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":77
 *     ADD        = ADD_VALUES
 *     MAX        = MAX_VALUES
 *     INSERT_ALL = INSERT_ALL_VALUES             # <<<<<<<<<<<<<<
 *     ADD_ALL    = ADD_ALL_VALUES
 *     INSERT_BC  = INSERT_BC_VALUES
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INSERT_ALL_VALUES);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_INSERT_ALL_VALUES);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INSERT_ALL, __pyx_t_11) < (0)) __PYX_ERR(1, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":78
 *     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_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ADD_ALL_VALUES);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ADD_ALL_VALUES);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ADD_ALL, __pyx_t_11) < (0)) __PYX_ERR(1, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":79
 *     INSERT_ALL = INSERT_ALL_VALUES
 *     ADD_ALL    = ADD_ALL_VALUES
 *     INSERT_BC  = INSERT_BC_VALUES             # <<<<<<<<<<<<<<
 *     ADD_BC     = ADD_BC_VALUES
 * 
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INSERT_BC_VALUES);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_INSERT_BC_VALUES);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INSERT_BC, __pyx_t_11) < (0)) __PYX_ERR(1, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":80
 *     ADD_ALL    = ADD_ALL_VALUES
 *     INSERT_BC  = INSERT_BC_VALUES
 *     ADD_BC     = ADD_BC_VALUES             # <<<<<<<<<<<<<<
 * 
 * # ------------------------------------------------------------------------------
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ADD_BC_VALUES);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ADD_BC_VALUES);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ADD_BC, __pyx_t_11) < (0)) __PYX_ERR(1, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":47
 * 
 * 
 * class InsertMode(object):             # <<<<<<<<<<<<<<
 *     """Insertion mode.
 * 
*/
  __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InsertMode, __pyx_t_4, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InsertMode, __pyx_t_11) < (0)) __PYX_ERR(1, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __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;

  /* "petsc4py/PETSc/Const.pyx":85
 * 
 * 
 * class ScatterMode(object):             # <<<<<<<<<<<<<<
 *     """Scatter mode.
 * 
*/
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[14]); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_ScatterMode, __pyx_mstate_global->__pyx_n_u_ScatterMode, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Scatter_mode_Most_commonly_used); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[14]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[14]) < 0))) __PYX_ERR(1, 85, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Const.pyx":102
 *     """
 *     # native
 *     SCATTER_FORWARD       = PETSC_SCATTER_FORWARD             # <<<<<<<<<<<<<<
 *     SCATTER_REVERSE       = PETSC_SCATTER_REVERSE
 *     SCATTER_FORWARD_LOCAL = PETSC_SCATTER_FORWARD_LOCAL
*/
  __pyx_t_11 = __Pyx_PyLong_From_ScatterMode(SCATTER_FORWARD); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SCATTER_FORWARD, __pyx_t_11) < (0)) __PYX_ERR(1, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":103
 *     # 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_11 = __Pyx_PyLong_From_ScatterMode(SCATTER_REVERSE); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SCATTER_REVERSE, __pyx_t_11) < (0)) __PYX_ERR(1, 103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":104
 *     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_11 = __Pyx_PyLong_From_ScatterMode(SCATTER_FORWARD_LOCAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SCATTER_FORWARD_LOCAL, __pyx_t_11) < (0)) __PYX_ERR(1, 104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":105
 *     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_11 = __Pyx_PyLong_From_ScatterMode(SCATTER_REVERSE_LOCAL); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SCATTER_REVERSE_LOCAL, __pyx_t_11) < (0)) __PYX_ERR(1, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":107
 *     SCATTER_REVERSE_LOCAL = PETSC_SCATTER_REVERSE_LOCAL
 *     # aliases
 *     FORWARD       = SCATTER_FORWARD             # <<<<<<<<<<<<<<
 *     REVERSE       = SCATTER_REVERSE
 *     FORWARD_LOCAL = SCATTER_FORWARD_LOCAL
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SCATTER_FORWARD);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_SCATTER_FORWARD);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FORWARD, __pyx_t_11) < (0)) __PYX_ERR(1, 107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":108
 *     # aliases
 *     FORWARD       = SCATTER_FORWARD
 *     REVERSE       = SCATTER_REVERSE             # <<<<<<<<<<<<<<
 *     FORWARD_LOCAL = SCATTER_FORWARD_LOCAL
 *     REVERSE_LOCAL = SCATTER_REVERSE_LOCAL
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SCATTER_REVERSE);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_SCATTER_REVERSE);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_REVERSE, __pyx_t_11) < (0)) __PYX_ERR(1, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":109
 *     FORWARD       = SCATTER_FORWARD
 *     REVERSE       = SCATTER_REVERSE
 *     FORWARD_LOCAL = SCATTER_FORWARD_LOCAL             # <<<<<<<<<<<<<<
 *     REVERSE_LOCAL = SCATTER_REVERSE_LOCAL
 * 
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SCATTER_FORWARD_LOCAL);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_SCATTER_FORWARD_LOCAL);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FORWARD_LOCAL, __pyx_t_11) < (0)) __PYX_ERR(1, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":110
 *     REVERSE       = SCATTER_REVERSE
 *     FORWARD_LOCAL = SCATTER_FORWARD_LOCAL
 *     REVERSE_LOCAL = SCATTER_REVERSE_LOCAL             # <<<<<<<<<<<<<<
 * 
 * # ------------------------------------------------------------------------------
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SCATTER_REVERSE_LOCAL);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_SCATTER_REVERSE_LOCAL);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_REVERSE_LOCAL, __pyx_t_11) < (0)) __PYX_ERR(1, 110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":85
 * 
 * 
 * class ScatterMode(object):             # <<<<<<<<<<<<<<
 *     """Scatter mode.
 * 
*/
  __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ScatterMode, __pyx_t_4, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ScatterMode, __pyx_t_11) < (0)) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __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;

  /* "petsc4py/PETSc/Const.pyx":115
 * 
 * 
 * class NormType(object):             # <<<<<<<<<<<<<<
 *     """Norm type.
 * 
*/
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[16]); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_NormType, __pyx_mstate_global->__pyx_n_u_NormType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Norm_type_Commonly_used_norm_typ); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[16]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[16]) < 0))) __PYX_ERR(1, 115, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Const.pyx":135
 *     """
 *     # native
 *     NORM_1         = PETSC_NORM_1             # <<<<<<<<<<<<<<
 *     NORM_2         = PETSC_NORM_2
 *     NORM_1_AND_2   = PETSC_NORM_1_AND_2
*/
  __pyx_t_11 = __Pyx_PyLong_From_NormType(NORM_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_1, __pyx_t_11) < (0)) __PYX_ERR(1, 135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":136
 *     # 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_11 = __Pyx_PyLong_From_NormType(NORM_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_2, __pyx_t_11) < (0)) __PYX_ERR(1, 136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":137
 *     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_11 = __Pyx_PyLong_From_NormType(NORM_1_AND_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_1_AND_2, __pyx_t_11) < (0)) __PYX_ERR(1, 137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":138
 *     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_11 = __Pyx_PyLong_From_NormType(NORM_FROBENIUS); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_FROBENIUS, __pyx_t_11) < (0)) __PYX_ERR(1, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":139
 *     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_11 = __Pyx_PyLong_From_NormType(NORM_INFINITY); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_INFINITY, __pyx_t_11) < (0)) __PYX_ERR(1, 139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":140
 *     NORM_FROBENIUS = PETSC_NORM_FROBENIUS
 *     NORM_INFINITY  = PETSC_NORM_INFINITY
 *     NORM_MAX       = PETSC_NORM_MAX             # <<<<<<<<<<<<<<
 *     # aliases
 *     N1        = NORM_1
*/
  __pyx_t_11 = __Pyx_PyLong_From_NormType(NORM_MAX); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_MAX, __pyx_t_11) < (0)) __PYX_ERR(1, 140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":142
 *     NORM_MAX       = PETSC_NORM_MAX
 *     # aliases
 *     N1        = NORM_1             # <<<<<<<<<<<<<<
 *     N2        = NORM_2
 *     N12       = NORM_1_AND_2
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_1);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_NORM_1);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_N1, __pyx_t_11) < (0)) __PYX_ERR(1, 142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":143
 *     # aliases
 *     N1        = NORM_1
 *     N2        = NORM_2             # <<<<<<<<<<<<<<
 *     N12       = NORM_1_AND_2
 *     MAX       = NORM_MAX
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_2);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_NORM_2);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_N2, __pyx_t_11) < (0)) __PYX_ERR(1, 143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":144
 *     N1        = NORM_1
 *     N2        = NORM_2
 *     N12       = NORM_1_AND_2             # <<<<<<<<<<<<<<
 *     MAX       = NORM_MAX
 *     FROBENIUS = NORM_FROBENIUS
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_1_AND_2);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_NORM_1_AND_2);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_N12, __pyx_t_11) < (0)) __PYX_ERR(1, 144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":145
 *     N2        = NORM_2
 *     N12       = NORM_1_AND_2
 *     MAX       = NORM_MAX             # <<<<<<<<<<<<<<
 *     FROBENIUS = NORM_FROBENIUS
 *     INFINITY  = NORM_INFINITY
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_MAX);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_NORM_MAX);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MAX, __pyx_t_11) < (0)) __PYX_ERR(1, 145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":146
 *     N12       = NORM_1_AND_2
 *     MAX       = NORM_MAX
 *     FROBENIUS = NORM_FROBENIUS             # <<<<<<<<<<<<<<
 *     INFINITY  = NORM_INFINITY
 *     # extra aliases
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_FROBENIUS);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_NORM_FROBENIUS);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FROBENIUS, __pyx_t_11) < (0)) __PYX_ERR(1, 146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":147
 *     MAX       = NORM_MAX
 *     FROBENIUS = NORM_FROBENIUS
 *     INFINITY  = NORM_INFINITY             # <<<<<<<<<<<<<<
 *     # extra aliases
 *     FRB = FROBENIUS
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_INFINITY);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_NORM_INFINITY);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INFINITY, __pyx_t_11) < (0)) __PYX_ERR(1, 147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":149
 *     INFINITY  = NORM_INFINITY
 *     # extra aliases
 *     FRB = FROBENIUS             # <<<<<<<<<<<<<<
 *     INF = INFINITY
 * 
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FROBENIUS);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_FROBENIUS);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FRB, __pyx_t_11) < (0)) __PYX_ERR(1, 149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":150
 *     # extra aliases
 *     FRB = FROBENIUS
 *     INF = INFINITY             # <<<<<<<<<<<<<<
 * 
 * # ------------------------------------------------------------------------------
*/
  __pyx_t_11 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INFINITY);
  if (unlikely(!__pyx_t_11)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_INFINITY);
  }
  if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INF, __pyx_t_11) < (0)) __PYX_ERR(1, 150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Const.pyx":115
 * 
 * 
 * class NormType(object):             # <<<<<<<<<<<<<<
 *     """Norm type.
 * 
*/
  __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NormType, __pyx_t_4, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NormType, __pyx_t_11) < (0)) __PYX_ERR(1, 115, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __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;

  /* "petsc4py/PETSc/Error.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class Error(RuntimeError):             # <<<<<<<<<<<<<<
 *     """PETSc Error.
 * 
*/
  __pyx_t_4 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_RuntimeError)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(30, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(30, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_Error, __pyx_mstate_global->__pyx_n_u_Error, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_PETSc_Error_Attributes_ierr_int); if (unlikely(!__pyx_t_11)) __PYX_ERR(30, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__pyx_t_5 != __pyx_t_4) {
    if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(30, 3, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Error.pyx":13
 *     """
 * 
 *     def __init__(self, int ierr=0):             # <<<<<<<<<<<<<<
 *         self.ierr = ierr
 *         self._traceback = []
*/
  __pyx_t_4 = __Pyx_PyLong_From_int(((int)0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(30, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Error_1__init__, 0, __pyx_mstate_global->__pyx_n_u_Error___init, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_12);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < (0)) __PYX_ERR(30, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Error.pyx":18
 *         RuntimeError.__init__(self, self.ierr)
 * 
 *     def __bool__(self):             # <<<<<<<<<<<<<<
 *         cdef int ierr = self.ierr
 *         return ierr != 0
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Error_3__bool__, 0, __pyx_mstate_global->__pyx_n_u_Error___bool, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_bool_2, __pyx_t_4) < (0)) __PYX_ERR(30, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Error.pyx":22
 *         return ierr != 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'PETSc.Error(%d)' % self.ierr
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Error_5__repr__, 0, __pyx_mstate_global->__pyx_n_u_Error___repr, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_repr, __pyx_t_4) < (0)) __PYX_ERR(30, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Error.pyx":25
 *         return 'PETSc.Error(%d)' % self.ierr
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         cdef int csize=1, crank=0
 *         if not (<int>PetscFinalizeCalled):
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Error_7__str__, 0, __pyx_mstate_global->__pyx_n_u_Error___str, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_str, __pyx_t_4) < (0)) __PYX_ERR(30, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Error.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class Error(RuntimeError):             # <<<<<<<<<<<<<<
 *     """PETSc Error.
 * 
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_Error, __pyx_t_5, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(30, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Error, __pyx_t_4) < (0)) __PYX_ERR(30, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Options.pyx":79
 *     #
 * 
 *     def create(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an options database."""
 *         if self.opt != NULL: return
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(31, 79, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_13create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_10) < (0)) __PYX_ERR(31, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Options.pyx":85
 *         return self
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy an options database."""
 *         if self.opt == NULL: return
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(31, 85, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_15destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_5) < (0)) __PYX_ERR(31, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Options.pyx":91
 *         return self
 * 
 *     def clear(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Clear an options database."""
 *         if self.opt == NULL: return
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(31, 91, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_17clear, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_clear, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_clear, __pyx_t_10) < (0)) __PYX_ERR(31, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Options.pyx":97
 *         return self
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the options database.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(31, 97, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_19view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_5) < (0)) __PYX_ERR(31, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Options.pyx":116
 *         CHKERR(PetscOptionsView(self.opt, vwr))
 * 
 *     def prefixPush(self, prefix: str | Options | Object | None) -> None:             # <<<<<<<<<<<<<<
 *         """Push a prefix for the options database.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_Options_Object_None) < (0)) __PYX_ERR(31, 116, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(31, 116, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_21prefixPush, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_prefixPush, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_prefixPush, __pyx_t_10) < (0)) __PYX_ERR(31, 116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Options.pyx":131
 *         CHKERR(PetscOptionsPrefixPush(self.opt, cprefix))
 * 
 *     def prefixPop(self) -> None:             # <<<<<<<<<<<<<<
 *         """Pop a prefix for the options database.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(31, 131, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_23prefixPop, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_prefixPop, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_prefixPop, __pyx_t_5) < (0)) __PYX_ERR(31, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Options.pyx":144
 *     #
 * 
 *     def hasName(self, name: str) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the boolean indicating if the option is in the database."""
 *         cdef const char *pr = NULL
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(31, 144, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(31, 144, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_25hasName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_hasName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_hasName, __pyx_t_10) < (0)) __PYX_ERR(31, 144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Options.pyx":153
 *         return toBool(flag)
 * 
 *     def used(self, name: str) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the boolean indicating if the option was queried from the database."""
 *         cdef const char *key = NULL
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(31, 153, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(31, 153, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_27used, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_used, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_used, __pyx_t_5) < (0)) __PYX_ERR(31, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Options.pyx":161
 *         return toBool(flag)
 * 
 *     def setValue(self, name: str,             # <<<<<<<<<<<<<<
 *                  value: bool | int | float | Scalar | Sequence[bool] | Sequence[int] | Sequence[float] | Sequence[Scalar] | str) -> None:
 *         """Set a value for an option.
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(31, 161, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_kp_u_bool_int_float_Scalar_Sequence_b) < (0)) __PYX_ERR(31, 161, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(31, 161, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_29setValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_setValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_setValue, __pyx_t_10) < (0)) __PYX_ERR(31, 161, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Options.pyx":203
 *         CHKERR(PetscOptionsSetValue(self.opt, key, val))
 * 
 *     def delValue(self, name: str) -> None:             # <<<<<<<<<<<<<<
 *         """Delete an option from the database.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(31, 203, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(31, 203, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_31delValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_delValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_delValue, __pyx_t_5) < (0)) __PYX_ERR(31, 203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Options.pyx":226
 *     #
 * 
 *     def getBool(self, name: str, default=None) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the boolean value associated with the option.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(31, 226, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(31, 226, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_33getBool, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_getBool, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_getBool, __pyx_t_10) < (0)) __PYX_ERR(31, 226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Options.pyx":246
 *         return getopt(self.opt, OPT_BOOL, self.prefix, name, default)
 * 
 *     def getBoolArray(self, name: str, default=None) -> ArrayBool:             # <<<<<<<<<<<<<<
 *         """Return the boolean values associated with the option.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(31, 246, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayBool) < (0)) __PYX_ERR(31, 246, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_35getBoolArray, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_getBoolArray, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_getBoolArray, __pyx_t_5) < (0)) __PYX_ERR(31, 246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Options.pyx":266
 *         return getopt(self.opt, OPT_BOOLARRAY, self.prefix, name, default)
 * 
 *     def getInt(self, name: str, default=None) -> int:             # <<<<<<<<<<<<<<
 *         """Return the integer value associated with the option.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(31, 266, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(31, 266, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_37getInt, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_getInt, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_getInt, __pyx_t_10) < (0)) __PYX_ERR(31, 266, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Options.pyx":286
 *         return getopt(self.opt, OPT_INT, self.prefix, name, default)
 * 
 *     def getIntArray(self, name: str, default=None) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the integer array associated with the option.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(31, 286, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(31, 286, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_39getIntArray, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_getIntArray, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_getIntArray, __pyx_t_5) < (0)) __PYX_ERR(31, 286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Options.pyx":306
 *         return getopt(self.opt, OPT_INTARRAY, self.prefix, name, default)
 * 
 *     def getReal(self, name: str, default=None) -> float:             # <<<<<<<<<<<<<<
 *         """Return the real value associated with the option.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(31, 306, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(31, 306, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_41getReal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_getReal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_getReal, __pyx_t_10) < (0)) __PYX_ERR(31, 306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Options.pyx":326
 *         return getopt(self.opt, OPT_REAL, self.prefix, name, default)
 * 
 *     def getRealArray(self, name: str, default=None) -> ArrayReal:             # <<<<<<<<<<<<<<
 *         """Return the real array associated with the option.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(31, 326, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayReal) < (0)) __PYX_ERR(31, 326, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_43getRealArray, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_getRealArray, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_getRealArray, __pyx_t_5) < (0)) __PYX_ERR(31, 326, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Options.pyx":346
 *         return getopt(self.opt, OPT_REALARRAY, self.prefix, name, default)
 * 
 *     def getScalar(self, name: str, default=None) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Return the scalar value associated with the option.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(31, 346, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(31, 346, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_45getScalar, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_getScalar, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_getScalar, __pyx_t_10) < (0)) __PYX_ERR(31, 346, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Options.pyx":366
 *         return getopt(self.opt, OPT_SCALAR, self.prefix, name, default)
 * 
 *     def getScalarArray(self, name: str, default=None) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Return the scalar array associated with the option.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(31, 366, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayScalar) < (0)) __PYX_ERR(31, 366, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_47getScalarArray, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_getScalarArray, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_getScalarArray, __pyx_t_5) < (0)) __PYX_ERR(31, 366, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Options.pyx":386
 *         return getopt(self.opt, OPT_SCALARARRAY, self.prefix, name, default)
 * 
 *     def getString(self, name: str, default=None) -> str:             # <<<<<<<<<<<<<<
 *         """Return the string associated with the option.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(31, 386, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(31, 386, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_49getString, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_getString, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_getString, __pyx_t_10) < (0)) __PYX_ERR(31, 386, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Options.pyx":408
 *     #
 * 
 *     def insertString(self, string: str) -> None:             # <<<<<<<<<<<<<<
 *         """Insert a string in the options database.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_string, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(31, 408, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(31, 408, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_51insertString, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_insertString, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_insertString, __pyx_t_5) < (0)) __PYX_ERR(31, 408, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Options.pyx":422
 *         CHKERR(PetscOptionsInsertString(self.opt, cstring))
 * 
 *     def getAll(self) -> dict[str, str]:             # <<<<<<<<<<<<<<
 *         """Return all the options and their values.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(31, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_dict_str_str) < (0)) __PYX_ERR(31, 422, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Options_53getAll, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Options_getAll, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_10)) __PYX_ERR(31, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Options, __pyx_mstate_global->__pyx_n_u_getAll, __pyx_t_10) < (0)) __PYX_ERR(31, 422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Sys.pyx":7
 *     """System utilities."""
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def getVersion(
 *         cls,
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_devel, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(32, 7, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_date, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(32, 7, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_author, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(32, 7, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int_int) < (0)) __PYX_ERR(32, 7, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_1getVersion, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_getVersion, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[18]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_getVersion, __pyx_t_5) < (0)) __PYX_ERR(32, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_getVersion); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_getVersion, __pyx_t_10) < (0)) __PYX_ERR(32, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Sys.pyx":62
 *         return tuple(out)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def getVersionInfo(cls) -> dict[str, bool | int | str]:
 *         """Return PETSc version information.
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_dict_str_bool_int_str) < (0)) __PYX_ERR(32, 62, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_3getVersionInfo, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_getVersionInfo, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_getVersionInfo, __pyx_t_5) < (0)) __PYX_ERR(32, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_getVersionInfo); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_getVersionInfo, __pyx_t_10) < (0)) __PYX_ERR(32, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Sys.pyx":88
 *     # --- xxx ---
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def isInitialized(cls) -> bool:
 *         """Return whether PETSc has been initialized.
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(32, 88, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_5isInitialized, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_isInitialized, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_isInitialized, __pyx_t_5) < (0)) __PYX_ERR(32, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_isInitialized); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_isInitialized, __pyx_t_10) < (0)) __PYX_ERR(32, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Sys.pyx":101
 *         return toBool(PetscInitializeCalled)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def isFinalized(cls) -> bool:
 *         """Return whether PETSc has been finalized.
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(32, 101, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_7isFinalized, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_isFinalized, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_isFinalized, __pyx_t_5) < (0)) __PYX_ERR(32, 101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_isFinalized); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_isFinalized, __pyx_t_10) < (0)) __PYX_ERR(32, 101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Sys.pyx":116
 *     # --- xxx ---
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def getDefaultComm(cls) -> Comm:
 *         """Get the default MPI communicator used to create PETSc objects.
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Comm) < (0)) __PYX_ERR(32, 116, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_9getDefaultComm, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_getDefaultComm, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_getDefaultComm, __pyx_t_5) < (0)) __PYX_ERR(32, 116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_getDefaultComm); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_getDefaultComm, __pyx_t_10) < (0)) __PYX_ERR(32, 116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Sys.pyx":131
 *         return comm
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def setDefaultComm(cls, comm: Comm | None) -> None:
 *         """Set the default MPI communicator used to create PETSc objects.
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(32, 131, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(32, 131, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_11setDefaultComm, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_setDefaultComm, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_setDefaultComm, __pyx_t_5) < (0)) __PYX_ERR(32, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_setDefaultComm); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_setDefaultComm, __pyx_t_10) < (0)) __PYX_ERR(32, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Sys.pyx":155
 *     # --- xxx ---
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def Print(
 *         cls,
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_sep, __pyx_mstate_global->__pyx_kp_u__12) < (0)) __PYX_ERR(32, 155, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_end, __pyx_mstate_global->__pyx_kp_u__15) < (0)) __PYX_ERR(32, 155, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":161
 *         sep: str = ' ',
 *         end: str = '\n',
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *         **kwargs: Any) -> None: # noqa: E129
 *         """Print output from the first processor of a communicator.
*/
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_comm, Py_None) < (0)) __PYX_ERR(32, 155, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":155
 *     # --- xxx ---
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def Print(
 *         cls,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sep, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(32, 155, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_end, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(32, 155, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(32, 155, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(32, 155, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kwargs, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(32, 155, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(32, 155, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_13Print, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_Print, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_11, __pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_Print, __pyx_t_11) < (0)) __PYX_ERR(32, 155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_GetNameInClass(__pyx_t_11, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_Print); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_Print, __pyx_t_5) < (0)) __PYX_ERR(32, 155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Sys.pyx":197
 *         CHKERR(PetscPrintf(ccomm, '%s', m))
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def syncPrint(
 *         cls,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(32, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sep, __pyx_mstate_global->__pyx_kp_u__12) < (0)) __PYX_ERR(32, 197, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_end, __pyx_mstate_global->__pyx_kp_u__15) < (0)) __PYX_ERR(32, 197, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":203
 *         sep: str = ' ',
 *         end: str = '\n',
 *         flush: bool = False,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None,
 *         **kwargs: Any) -> None: # noqa: E129
*/
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_flush, Py_False) < (0)) __PYX_ERR(32, 197, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":204
 *         end: str = '\n',
 *         flush: bool = False,
 *         comm: Comm | None = None,             # <<<<<<<<<<<<<<
 *         **kwargs: Any) -> None: # noqa: E129
 *         """Print synchronized output from several processors of a communicator.
*/
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, Py_None) < (0)) __PYX_ERR(32, 197, __pyx_L1_error)

  /* "petsc4py/PETSc/Sys.pyx":197
 *         CHKERR(PetscPrintf(ccomm, '%s', m))
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def syncPrint(
 *         cls,
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_sep, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(32, 197, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_end, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(32, 197, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_flush, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(32, 197, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(32, 197, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(32, 197, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_kwargs, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(32, 197, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(32, 197, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_15syncPrint, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_syncPrint, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_10, __pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_syncPrint, __pyx_t_10) < (0)) __PYX_ERR(32, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_syncPrint); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_syncPrint, __pyx_t_11) < (0)) __PYX_ERR(32, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Sys.pyx":240
 *         if flush: CHKERR(PetscSynchronizedFlush(ccomm, PETSC_STDOUT))
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def syncFlush(cls, comm: Comm | None = None) -> None:
 *         """Flush output from previous `syncPrint` calls.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(32, 240, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(32, 240, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_17syncFlush, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_syncFlush, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_syncFlush, __pyx_t_10) < (0)) __PYX_ERR(32, 240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_syncFlush); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_syncFlush, __pyx_t_11) < (0)) __PYX_ERR(32, 240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Sys.pyx":261
 *     # --- xxx ---
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def splitOwnership(
 *         cls,
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_kp_u_int_tuple_int_int) < (0)) __PYX_ERR(32, 261, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(32, 261, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(32, 261, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(32, 261, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_19splitOwnership, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_splitOwnership, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_splitOwnership, __pyx_t_10) < (0)) __PYX_ERR(32, 261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_splitOwnership); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_splitOwnership, __pyx_t_11) < (0)) __PYX_ERR(32, 261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Sys.pyx":310
 *         return (toInt(n), toInt(N))
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def sleep(cls, seconds: float = 1.0) -> None:
 *         """Sleep some number of seconds.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_seconds, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(32, 310, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(32, 310, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_21sleep, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_sleep, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[20]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_sleep, __pyx_t_10) < (0)) __PYX_ERR(32, 310, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_sleep); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_sleep, __pyx_t_11) < (0)) __PYX_ERR(32, 310, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Sys.pyx":331
 *     # --- xxx ---
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def pushErrorHandler(cls, errhandler: str) -> None:
 *         """Set the current error handler.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_errhandler, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(32, 331, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(32, 331, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_23pushErrorHandler, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_pushErrorHandler, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_pushErrorHandler, __pyx_t_10) < (0)) __PYX_ERR(32, 331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_pushErrorHandler); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_pushErrorHandler, __pyx_t_11) < (0)) __PYX_ERR(32, 331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Sys.pyx":366
 *         CHKERR(PetscPushErrorHandler(handler, NULL))
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def popErrorHandler(cls) -> None:
 *         """Remove the current error handler.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(32, 366, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_25popErrorHandler, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_popErrorHandler, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49])); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_popErrorHandler, __pyx_t_10) < (0)) __PYX_ERR(32, 366, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_popErrorHandler); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_popErrorHandler, __pyx_t_11) < (0)) __PYX_ERR(32, 366, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Sys.pyx":379
 *         CHKERR(PetscPopErrorHandler())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def popSignalHandler(cls) -> None:
 *         """Remove the current signal handler.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(32, 379, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_27popSignalHandler, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_popSignalHandler, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[50])); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_popSignalHandler, __pyx_t_10) < (0)) __PYX_ERR(32, 379, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_popSignalHandler); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_popSignalHandler, __pyx_t_11) < (0)) __PYX_ERR(32, 379, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Sys.pyx":392
 *         CHKERR(PetscPopSignalHandler())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def infoAllow(
 *         cls,
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(32, 392, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_filename, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(32, 392, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(32, 392, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(32, 392, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_29infoAllow, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_infoAllow, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[51])); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[21]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_infoAllow, __pyx_t_10) < (0)) __PYX_ERR(32, 392, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_infoAllow); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_infoAllow, __pyx_t_11) < (0)) __PYX_ERR(32, 392, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Sys.pyx":426
 *             CHKERR(PetscInfoSetFile(cfilename, cmode))
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def registerCitation(cls, citation: str) -> None:
 *         """Register BibTeX citation.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_citation, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(32, 426, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(32, 426, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_31registerCitation, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_registerCitation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[52])); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_registerCitation, __pyx_t_10) < (0)) __PYX_ERR(32, 426, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_registerCitation); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_registerCitation, __pyx_t_11) < (0)) __PYX_ERR(32, 426, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Sys.pyx":449
 *         set_citation(citation, toBool(flag))
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def hasExternalPackage(cls, package: str) -> bool:
 *         """Return whether PETSc has support for external package.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_package, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(32, 449, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(32, 449, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Sys_33hasExternalPackage, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Sys_hasExternalPackage, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[53])); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_hasExternalPackage, __pyx_t_10) < (0)) __PYX_ERR(32, 449, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_hasExternalPackage); if (unlikely(!__pyx_t_10)) __PYX_ERR(32, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Sys, __pyx_mstate_global->__pyx_n_u_hasExternalPackage, __pyx_t_11) < (0)) __PYX_ERR(32, 449, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Sys.pyx":472
 * 
 * 
 * cdef dict citations_registry = {}             # <<<<<<<<<<<<<<
 * 
 * cdef PetscBool get_citation(object citation):
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(32, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_citations_registry);
  __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_citations_registry, ((PyObject*)__pyx_t_11));
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_t_11 = 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_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_functools, 0, 0, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(33, 4, __pyx_L1_error)
  __pyx_t_11 = __pyx_t_1;
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_functools);
  __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_functools, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":11
 *     """Logging support."""
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def Stage(cls, name: str) -> LogStage:
 *         """Create a log stage.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(33, 11, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_LogStage) < (0)) __PYX_ERR(33, 11, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_1Stage, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Log_Stage, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[54])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_Stage, __pyx_t_10) < (0)) __PYX_ERR(33, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_Stage); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_Stage, __pyx_t_11) < (0)) __PYX_ERR(33, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":45
 *         return stage
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def Class(cls, name: str) -> LogClass:
 *         """Create a log class.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(33, 45, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_LogClass) < (0)) __PYX_ERR(33, 45, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_3Class, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Log_Class, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[55])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_Class, __pyx_t_10) < (0)) __PYX_ERR(33, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_Class); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_Class, __pyx_t_11) < (0)) __PYX_ERR(33, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":79
 *         return klass
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def Event(cls, name: str, klass: LogClass | None = None) -> LogEvent:
 *         """Create a log event.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(33, 79, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_klass, __pyx_mstate_global->__pyx_kp_u_LogClass_None) < (0)) __PYX_ERR(33, 79, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_LogEvent) < (0)) __PYX_ERR(33, 79, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_5Event, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Log_Event, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[56])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_Event, __pyx_t_10) < (0)) __PYX_ERR(33, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_Event); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_Event, __pyx_t_11) < (0)) __PYX_ERR(33, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":117
 *         return event
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def begin(cls) -> None:
 *         """Turn on logging of objects and events.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 117, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_7begin, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Log_begin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[57])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_begin, __pyx_t_10) < (0)) __PYX_ERR(33, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_begin); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_begin, __pyx_t_11) < (0)) __PYX_ERR(33, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":130
 *         CHKERR(PetscLogDefaultBegin())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def view(cls, Viewer viewer=None) -> None:
 *         """Print the log.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 130, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_9view, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Log_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[58])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_10) < (0)) __PYX_ERR(33, 130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_view); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_11) < (0)) __PYX_ERR(33, 130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":151
 *         CHKERR(PetscLogView(vwr))
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def logFlops(cls, flops: float) -> None:
 *         """Add floating point operations to the current event.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_flops, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(33, 151, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 151, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_11logFlops, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Log_logFlops, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[59])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_logFlops, __pyx_t_10) < (0)) __PYX_ERR(33, 151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_logFlops); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_logFlops, __pyx_t_11) < (0)) __PYX_ERR(33, 151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":170
 *         CHKERR(PetscLogFlops(cflops))
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def addFlops(cls, flops: float) -> None:
 *         """Add floating point operations to the current event.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_flops, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(33, 170, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 170, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_13addFlops, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Log_addFlops, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[60])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_addFlops, __pyx_t_10) < (0)) __PYX_ERR(33, 170, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_addFlops); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_addFlops, __pyx_t_11) < (0)) __PYX_ERR(33, 170, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":193
 *         CHKERR(PetscLogFlops(cflops))
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def getFlops(cls) -> float:
 *         """Return the number of flops used on this processor since the program began.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(33, 193, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_15getFlops, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Log_getFlops, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[61])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_getFlops, __pyx_t_10) < (0)) __PYX_ERR(33, 193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_getFlops); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_getFlops, __pyx_t_11) < (0)) __PYX_ERR(33, 193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":213
 *         return cflops
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def getTime(cls) -> float:
 *         """Return the current time of day in seconds.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(33, 213, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_17getTime, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Log_getTime, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[62])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_getTime, __pyx_t_10) < (0)) __PYX_ERR(33, 213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_getTime); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_getTime, __pyx_t_11) < (0)) __PYX_ERR(33, 213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":233
 *         return wctime
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def getCPUTime(cls) -> float:
 *         """Return the CPU time."""
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(33, 233, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_19getCPUTime, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Log_getCPUTime, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[63])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_getCPUTime, __pyx_t_10) < (0)) __PYX_ERR(33, 233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_getCPUTime); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_getCPUTime, __pyx_t_11) < (0)) __PYX_ERR(33, 233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":240
 *         return cputime
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def EventDecorator(cls, name=None, klass=None) -> Any:
 *         """Decorate a function with a `PETSc` event."""
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(33, 240, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_21EventDecorator, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Log_EventDecorator, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[64])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_EventDecorator, __pyx_t_10) < (0)) __PYX_ERR(33, 240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_EventDecorator); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_EventDecorator, __pyx_t_11) < (0)) __PYX_ERR(33, 240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":255
 *         return decorator
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def isActive(cls) -> bool:
 *         """Return whether logging is currently in progress.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(33, 255, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Log_23isActive, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Log_isActive, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[65])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_isActive, __pyx_t_10) < (0)) __PYX_ERR(33, 255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_isActive); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Log, __pyx_mstate_global->__pyx_n_u_isActive, __pyx_t_11) < (0)) __PYX_ERR(33, 255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":288
 *         return <int> self.id
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         self.push()
 *         return self
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogStage_5__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogStage___enter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[66])); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogStage, __pyx_mstate_global->__pyx_n_u_enter, __pyx_t_11) < (0)) __PYX_ERR(33, 288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":292
 *         return self
 * 
 *     def __exit__(self, *exc):             # <<<<<<<<<<<<<<
 *         self.pop()
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogStage_7__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogStage___exit, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[67])); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogStage, __pyx_mstate_global->__pyx_n_u_exit, __pyx_t_11) < (0)) __PYX_ERR(33, 292, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":297
 *     #
 * 
 *     def push(self) -> None:             # <<<<<<<<<<<<<<
 *         """Push a stage on the logging stack.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 297, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogStage_9push, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogStage_push, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[68])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogStage, __pyx_mstate_global->__pyx_n_u_push, __pyx_t_10) < (0)) __PYX_ERR(33, 297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Log.pyx":309
 *         CHKERR(PetscLogStagePush(self.id))
 * 
 *     def pop(self) -> None:             # <<<<<<<<<<<<<<
 *         """Pop a stage from the logging stack.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 309, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogStage_11pop, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogStage_pop, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[69])); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogStage, __pyx_mstate_global->__pyx_n_u_pop, __pyx_t_11) < (0)) __PYX_ERR(33, 309, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":324
 *     #
 * 
 *     def getName(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the current stage name."""
 *         cdef const char *cval = NULL
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(33, 324, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogStage_13getName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogStage_getName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[70])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogStage, __pyx_mstate_global->__pyx_n_u_getName, __pyx_t_10) < (0)) __PYX_ERR(33, 324, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Log.pyx":341
 *     #
 * 
 *     def activate(self) -> None:             # <<<<<<<<<<<<<<
 *         """Activate the stage.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 341, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogStage_15activate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogStage_activate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[71])); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogStage, __pyx_mstate_global->__pyx_n_u_activate, __pyx_t_11) < (0)) __PYX_ERR(33, 341, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":353
 *         CHKERR(PetscLogStageSetActive(self.id, PETSC_TRUE))
 * 
 *     def deactivate(self) -> None:             # <<<<<<<<<<<<<<
 *         """Deactivate the stage.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 353, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogStage_17deactivate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogStage_deactivate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[72])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogStage, __pyx_mstate_global->__pyx_n_u_deactivate, __pyx_t_10) < (0)) __PYX_ERR(33, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Log.pyx":365
 *         CHKERR(PetscLogStageSetActive(self.id, PETSC_FALSE))
 * 
 *     def getActive(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Check if the stage is activated.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(33, 365, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogStage_19getActive, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogStage_getActive, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[73])); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogStage, __pyx_mstate_global->__pyx_n_u_getActive, __pyx_t_11) < (0)) __PYX_ERR(33, 365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":379
 *         return toBool(flag)
 * 
 *     def setActive(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Activate or deactivate the current stage.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(33, 379, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 379, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogStage_21setActive, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogStage_setActive, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[74])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogStage, __pyx_mstate_global->__pyx_n_u_setActive, __pyx_t_10) < (0)) __PYX_ERR(33, 379, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Log.pyx":403
 *     #
 * 
 *     def getVisible(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the stage is visible.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(33, 403, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogStage_23getVisible, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogStage_getVisible, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[75])); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogStage, __pyx_mstate_global->__pyx_n_u_getVisible, __pyx_t_11) < (0)) __PYX_ERR(33, 403, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":417
 *         return toBool(flag)
 * 
 *     def setVisible(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set the visibility of the stage.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(33, 417, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 417, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogStage_25setVisible, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogStage_setVisible, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[76])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogStage, __pyx_mstate_global->__pyx_n_u_setVisible, __pyx_t_10) < (0)) __PYX_ERR(33, 417, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Log.pyx":445
 * 
 * 
 * cdef dict stage_registry = {}             # <<<<<<<<<<<<<<
 * 
 * cdef LogStage get_LogStage(object name):
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_stage_registry);
  __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_stage_registry, ((PyObject*)__pyx_t_10));
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Log.pyx":476
 *     #
 * 
 *     def getName(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the log class name."""
 *         cdef const char *cval = NULL
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(33, 476, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogClass_5getName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogClass_getName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[77])); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogClass, __pyx_mstate_global->__pyx_n_u_getName, __pyx_t_11) < (0)) __PYX_ERR(33, 476, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":493
 *     #
 * 
 *     def activate(self) -> None:             # <<<<<<<<<<<<<<
 *         """Activate the log class."""
 *         CHKERR(PetscLogClassActivate(self.id))
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 493, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogClass_7activate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogClass_activate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[78])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogClass, __pyx_mstate_global->__pyx_n_u_activate, __pyx_t_10) < (0)) __PYX_ERR(33, 493, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Log.pyx":497
 *         CHKERR(PetscLogClassActivate(self.id))
 * 
 *     def deactivate(self) -> None:             # <<<<<<<<<<<<<<
 *         """Deactivate the log class."""
 *         CHKERR(PetscLogClassDeactivate(self.id))
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 497, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogClass_9deactivate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogClass_deactivate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[79])); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogClass, __pyx_mstate_global->__pyx_n_u_deactivate, __pyx_t_11) < (0)) __PYX_ERR(33, 497, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":501
 *         CHKERR(PetscLogClassDeactivate(self.id))
 * 
 *     def getActive(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         <void>self # unused
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(33, 501, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogClass_11getActive, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogClass_getActive, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[80])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogClass, __pyx_mstate_global->__pyx_n_u_getActive, __pyx_t_10) < (0)) __PYX_ERR(33, 501, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Log.pyx":506
 *         raise NotImplementedError
 * 
 *     def setActive(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Activate or deactivate the log class."""
 *         if flag:
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(33, 506, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 506, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogClass_13setActive, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogClass_setActive, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[81])); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogClass, __pyx_mstate_global->__pyx_n_u_setActive, __pyx_t_11) < (0)) __PYX_ERR(33, 506, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":522
 * 
 * 
 * cdef dict class_registry = {}             # <<<<<<<<<<<<<<
 * 
 * cdef LogClass get_LogClass(object name):
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_class_registry);
  __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_class_registry, ((PyObject*)__pyx_t_11));
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":551
 *         return <int> self.id
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         self.begin()
 *         return self
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogEvent_5__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogEvent___enter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[82])); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogEvent, __pyx_mstate_global->__pyx_n_u_enter, __pyx_t_11) < (0)) __PYX_ERR(33, 551, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":555
 *         return self
 * 
 *     def __exit__(self, *exc):             # <<<<<<<<<<<<<<
 *         self.end()
 * 
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogEvent_7__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogEvent___exit, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[83])); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogEvent, __pyx_mstate_global->__pyx_n_u_exit, __pyx_t_11) < (0)) __PYX_ERR(33, 555, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":558
 *         self.end()
 * 
 *     def begin(self, *objs) -> None:             # <<<<<<<<<<<<<<
 *         """Log the beginning of a user event.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 558, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogEvent_9begin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogEvent_begin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[84])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogEvent, __pyx_mstate_global->__pyx_n_u_begin, __pyx_t_10) < (0)) __PYX_ERR(33, 558, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Log.pyx":577
 *         CHKERR(PetscLogEventBegin(self.id, o[0], o[1], o[2], o[3]))
 * 
 *     def end(self, *objs) -> None:             # <<<<<<<<<<<<<<
 *         """Log the end of a user event.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 577, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogEvent_11end, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogEvent_end, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[85])); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogEvent, __pyx_mstate_global->__pyx_n_u_end, __pyx_t_11) < (0)) __PYX_ERR(33, 577, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":597
 * 
 *     #
 *     def getName(self) -> str:             # <<<<<<<<<<<<<<
 *         """The current event name."""
 *         cdef const char *cval = NULL
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(33, 597, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogEvent_13getName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogEvent_getName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[86])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogEvent, __pyx_mstate_global->__pyx_n_u_getName, __pyx_t_10) < (0)) __PYX_ERR(33, 597, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Log.pyx":614
 *     #
 * 
 *     def activate(self) -> None:             # <<<<<<<<<<<<<<
 *         """Indicate that the event should be logged.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 614, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogEvent_15activate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogEvent_activate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[87])); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogEvent, __pyx_mstate_global->__pyx_n_u_activate, __pyx_t_11) < (0)) __PYX_ERR(33, 614, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":626
 *         CHKERR(PetscLogEventActivate(self.id))
 * 
 *     def deactivate(self) -> None:             # <<<<<<<<<<<<<<
 *         """Indicate that the event should not be logged.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 626, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogEvent_17deactivate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogEvent_deactivate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[88])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogEvent, __pyx_mstate_global->__pyx_n_u_deactivate, __pyx_t_10) < (0)) __PYX_ERR(33, 626, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Log.pyx":638
 *         CHKERR(PetscLogEventDeactivate(self.id))
 * 
 *     def getActive(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         <void>self # unused
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(33, 638, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogEvent_19getActive, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogEvent_getActive, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[89])); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogEvent, __pyx_mstate_global->__pyx_n_u_getActive, __pyx_t_11) < (0)) __PYX_ERR(33, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":643
 *         raise NotImplementedError
 * 
 *     def setActive(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Indicate whether or not the event should be logged.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(33, 643, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 643, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogEvent_21setActive, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogEvent_setActive, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[90])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogEvent, __pyx_mstate_global->__pyx_n_u_setActive, __pyx_t_10) < (0)) __PYX_ERR(33, 643, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Log.pyx":671
 *             self.setActive(value)
 * 
 *     def getActiveAll(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         <void>self # unused
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(33, 671, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogEvent_23getActiveAll, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogEvent_getActiveAll, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[91])); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogEvent, __pyx_mstate_global->__pyx_n_u_getActiveAll, __pyx_t_11) < (0)) __PYX_ERR(33, 671, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":676
 *         raise NotImplementedError
 * 
 *     def setActiveAll(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Turn on logging of all events.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(33, 676, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(33, 676, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogEvent_25setActiveAll, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogEvent_setActiveAll, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[92])); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogEvent, __pyx_mstate_global->__pyx_n_u_setActiveAll, __pyx_t_10) < (0)) __PYX_ERR(33, 676, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Log.pyx":705
 *     #
 * 
 *     def getPerfInfo(self, stage: int | None = None) -> dict:             # <<<<<<<<<<<<<<
 *         """Get the performance information about the given event in the given event.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(33, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_stage, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(33, 705, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_dict_2) < (0)) __PYX_ERR(33, 705, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_8LogEvent_27getPerfInfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LogEvent_getPerfInfo, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[93])); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LogEvent, __pyx_mstate_global->__pyx_n_u_getPerfInfo, __pyx_t_11) < (0)) __PYX_ERR(33, 705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Log.pyx":731
 *         return info
 * 
 * cdef dict event_registry = {}             # <<<<<<<<<<<<<<
 * 
 * cdef LogEvent get_LogEvent(object name):
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(33, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_event_registry);
  __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_event_registry, ((PyObject*)__pyx_t_11));
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Comm.pyx":61
 *     #
 * 
 *     def destroy(self) -> None:             # <<<<<<<<<<<<<<
 *         """Destroy the communicator.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(34, 61, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4Comm_9destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Comm_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[94])); if (unlikely(!__pyx_t_10)) __PYX_ERR(34, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_10) < (0)) __PYX_ERR(34, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Comm.pyx":79
 *         self.base = None
 * 
 *     def duplicate(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Duplicate the communicator.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(34, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(34, 79, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4Comm_11duplicate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Comm_duplicate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[95])); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_duplicate, __pyx_t_11) < (0)) __PYX_ERR(34, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Comm.pyx":99
 *         return comm
 * 
 *     def getSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of processes in the communicator.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(34, 99, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4Comm_13getSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Comm_getSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[96])); if (unlikely(!__pyx_t_10)) __PYX_ERR(34, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_getSize, __pyx_t_10) < (0)) __PYX_ERR(34, 99, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Comm.pyx":111
 *         return size
 * 
 *     def getRank(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the rank of the calling processes in the communicator.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(34, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(34, 111, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4Comm_15getRank, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Comm_getRank, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[97])); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_getRank, __pyx_t_11) < (0)) __PYX_ERR(34, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Comm.pyx":123
 *         return rank
 * 
 *     def barrier(self) -> None:             # <<<<<<<<<<<<<<
 *         """Barrier synchronization.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(34, 123, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4Comm_17barrier, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Comm_barrier, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[98])); if (unlikely(!__pyx_t_10)) __PYX_ERR(34, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_barrier, __pyx_t_10) < (0)) __PYX_ERR(34, 123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Comm.pyx":155
 *     # --- mpi4py support ---
 * 
 *     def tompi4py(self) -> Intracomm:             # <<<<<<<<<<<<<<
 *         """Convert communicator to `mpi4py`.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(34, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Intracomm) < (0)) __PYX_ERR(34, 155, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4Comm_19tompi4py, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Comm_tompi4py, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[99])); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_tompi4py, __pyx_t_11) < (0)) __PYX_ERR(34, 155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Comm.pyx":170
 *     # --- mpi4py compatibility API ---
 * 
 *     Free     = destroy             # <<<<<<<<<<<<<<
 *     Clone    = duplicate
 *     Dup      = duplicate
*/
  __Pyx_GetNameInClass(__pyx_t_11, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_destroy); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_Free, __pyx_t_11) < (0)) __PYX_ERR(34, 170, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Comm.pyx":171
 * 
 *     Free     = destroy
 *     Clone    = duplicate             # <<<<<<<<<<<<<<
 *     Dup      = duplicate
 *     Get_size = getSize
*/
  __Pyx_GetNameInClass(__pyx_t_11, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_duplicate); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_Clone, __pyx_t_11) < (0)) __PYX_ERR(34, 171, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Comm.pyx":172
 *     Free     = destroy
 *     Clone    = duplicate
 *     Dup      = duplicate             # <<<<<<<<<<<<<<
 *     Get_size = getSize
 *     Get_rank = getRank
*/
  __Pyx_GetNameInClass(__pyx_t_11, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_duplicate); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_Dup, __pyx_t_11) < (0)) __PYX_ERR(34, 172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Comm.pyx":173
 *     Clone    = duplicate
 *     Dup      = duplicate
 *     Get_size = getSize             # <<<<<<<<<<<<<<
 *     Get_rank = getRank
 *     Barrier  = barrier
*/
  __Pyx_GetNameInClass(__pyx_t_11, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_getSize); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_Get_size, __pyx_t_11) < (0)) __PYX_ERR(34, 173, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Comm.pyx":174
 *     Dup      = duplicate
 *     Get_size = getSize
 *     Get_rank = getRank             # <<<<<<<<<<<<<<
 *     Barrier  = barrier
 * 
*/
  __Pyx_GetNameInClass(__pyx_t_11, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_getRank); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_Get_rank, __pyx_t_11) < (0)) __PYX_ERR(34, 174, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Comm.pyx":175
 *     Get_size = getSize
 *     Get_rank = getRank
 *     Barrier  = barrier             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __Pyx_GetNameInClass(__pyx_t_11, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_barrier); if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_mstate_global->__pyx_n_u_Barrier, __pyx_t_11) < (0)) __PYX_ERR(34, 175, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Comm.pyx":179
 * # --------------------------------------------------------------------
 * 
 * cdef Comm __COMM_NULL__  = Comm()             # <<<<<<<<<<<<<<
 * cdef Comm __COMM_SELF__  = Comm()
 * cdef Comm __COMM_WORLD__ = Comm()
*/
  __pyx_t_10 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
    __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 179, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_11);
  }
  __Pyx_XGOTREF((PyObject *)__pyx_v_8petsc4py_5PETSc___COMM_NULL__);
  __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc___COMM_NULL__, ((struct PyPetscCommObject *)__pyx_t_11));
  __Pyx_GIVEREF((PyObject *)__pyx_t_11);
  __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Comm.pyx":180
 * 
 * cdef Comm __COMM_NULL__  = Comm()
 * cdef Comm __COMM_SELF__  = Comm()             # <<<<<<<<<<<<<<
 * cdef Comm __COMM_WORLD__ = Comm()
 * 
*/
  __pyx_t_10 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
    __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 180, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_11);
  }
  __Pyx_XGOTREF((PyObject *)__pyx_v_8petsc4py_5PETSc___COMM_SELF__);
  __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc___COMM_SELF__, ((struct PyPetscCommObject *)__pyx_t_11));
  __Pyx_GIVEREF((PyObject *)__pyx_t_11);
  __pyx_t_11 = 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_10 = NULL;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
    __pyx_t_11 = __Pyx_PyObject_FastCall((PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Comm, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_11)) __PYX_ERR(34, 181, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_11);
  }
  __Pyx_XGOTREF((PyObject *)__pyx_v_8petsc4py_5PETSc___COMM_WORLD__);
  __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc___COMM_WORLD__, ((struct PyPetscCommObject *)__pyx_t_11));
  __Pyx_GIVEREF((PyObject *)__pyx_t_11);
  __pyx_t_11 = 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_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_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/Object.pyx":32
 *         return self.obj[0] != NULL
 * 
 *     def __copy__(self):             # <<<<<<<<<<<<<<
 *         cdef Object obj = type(self)()
 *         cdef PetscObject o = self.obj[0]
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_9__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object___copy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[100])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_copy_2, __pyx_t_11) < (0)) __PYX_ERR(35, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":40
 *         return obj
 * 
 *     def __deepcopy__(self, dict memo):             # <<<<<<<<<<<<<<
 *         cdef object obj_copy = None
 *         try:
*/
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_11__deepcopy__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object___deepcopy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[101])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_deepcopy, __pyx_t_11) < (0)) __PYX_ERR(35, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":62
 *     #
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """Display the object.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(35, 62, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_13view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[102])); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_10) < (0)) __PYX_ERR(35, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Object.pyx":81
 *         CHKERR(PetscObjectView(self.obj[0], vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the object.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(35, 81, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_15destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[103])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_11) < (0)) __PYX_ERR(35, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":94
 *         return self
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the object type name.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(35, 94, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_17getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[104])); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_10) < (0)) __PYX_ERR(35, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Object.pyx":110
 *     #
 * 
 *     def setOptionsPrefix(self, prefix : str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(35, 110, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(35, 110, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_19setOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_setOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[105])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_setOptionsPrefix, __pyx_t_11) < (0)) __PYX_ERR(35, 110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":124
 *         CHKERR(PetscObjectSetOptionsPrefix(self.obj[0], cval))
 * 
 *     def getOptionsPrefix(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(35, 124, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_21getOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_getOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[106])); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_getOptionsPrefix, __pyx_t_10) < (0)) __PYX_ERR(35, 124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Object.pyx":138
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Append to the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(35, 138, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(35, 138, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_23appendOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_appendOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[107])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_appendOptionsPrefix, __pyx_t_11) < (0)) __PYX_ERR(35, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":152
 *         CHKERR(PetscObjectAppendOptionsPrefix(self.obj[0], cval))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the object from the options database.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(35, 152, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_25setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[108])); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_10) < (0)) __PYX_ERR(35, 152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Object.pyx":167
 *         CHKERR(PetscObjectSetFromOptions(self.obj[0]))
 * 
 *     def viewFromOptions(self, name : str, Object objpre=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the object via command line options.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(35, 167, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(35, 167, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_27viewFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_viewFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[109])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_viewFromOptions, __pyx_t_11) < (0)) __PYX_ERR(35, 167, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":190
 *         CHKERR(PetscObjectViewFromOptions(self.obj[0], pobj, cval))
 * 
 *     def setOptionsHandler(self, handler: PetscOptionsHandlerFunction | None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the callback for processing extra options.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_handler, __pyx_mstate_global->__pyx_kp_u_PetscOptionsHandlerFunction_None) < (0)) __PYX_ERR(35, 190, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(35, 190, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_29setOptionsHandler, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_setOptionsHandler, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[110])); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_setOptionsHandler, __pyx_t_10) < (0)) __PYX_ERR(35, 190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Object.pyx":213
 *             self.set_attr('__optshandler__', None)
 * 
 *     def destroyOptionsHandlers(self) -> None:             # <<<<<<<<<<<<<<
 *         """Clear all the option handlers.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(35, 213, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_31destroyOptionsHandlers, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_destroyOptionsHandlers, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[111])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_destroyOptionsHandlers, __pyx_t_11) < (0)) __PYX_ERR(35, 213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":228
 *     #
 * 
 *     def getComm(self) -> Comm:             # <<<<<<<<<<<<<<
 *         """Return the communicator of the object.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Comm) < (0)) __PYX_ERR(35, 228, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_33getComm, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_getComm, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[112])); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_getComm, __pyx_t_10) < (0)) __PYX_ERR(35, 228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Object.pyx":242
 *         return comm
 * 
 *     def getName(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the name of the object.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(35, 242, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_35getName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_getName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[113])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_getName, __pyx_t_11) < (0)) __PYX_ERR(35, 242, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":256
 *         return bytes2str(cval)
 * 
 *     def setName(self, name : str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Associate a name to the object.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(35, 256, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(35, 256, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_37setName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_setName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[114])); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_setName, __pyx_t_10) < (0)) __PYX_ERR(35, 256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Object.pyx":270
 *         CHKERR(PetscObjectSetName(self.obj[0], cval))
 * 
 *     def getClassId(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the class identifier of the object.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(35, 270, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_39getClassId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_getClassId, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[115])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_getClassId, __pyx_t_11) < (0)) __PYX_ERR(35, 270, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":284
 *         return <long>classid
 * 
 *     def getClassName(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the class name of the object.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(35, 284, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_41getClassName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_getClassName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[116])); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_getClassName, __pyx_t_10) < (0)) __PYX_ERR(35, 284, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Object.pyx":298
 *         return bytes2str(cval)
 * 
 *     def getRefCount(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the reference count of the object.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(35, 298, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_43getRefCount, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_getRefCount, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[117])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_getRefCount, __pyx_t_11) < (0)) __PYX_ERR(35, 298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":313
 *         return toInt(refcnt)
 * 
 *     def getId(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the unique identifier of the object.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(35, 313, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_45getId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_getId, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[118])); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_getId, __pyx_t_10) < (0)) __PYX_ERR(35, 313, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Object.pyx":329
 *     # --- general support ---
 * 
 *     def compose(self, name : str | None, Object obj or None) -> None:             # <<<<<<<<<<<<<<
 *         """Associate a PETSc object using a key string.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(35, 329, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(35, 329, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_47compose, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_compose, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[119])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_compose, __pyx_t_11) < (0)) __PYX_ERR(35, 329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":352
 *         CHKERR(PetscObjectCompose(self.obj[0], cval, cobj))
 * 
 *     def query(self, name: str) -> Object:             # <<<<<<<<<<<<<<
 *         """Query for the PETSc object associated with a key string.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(35, 352, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Object) < (0)) __PYX_ERR(35, 352, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_49query, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_query, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[120])); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_query, __pyx_t_10) < (0)) __PYX_ERR(35, 352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Object.pyx":372
 *         return obj
 * 
 *     def incRef(self) -> int:             # <<<<<<<<<<<<<<
 *         """Increment the object reference count.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(35, 372, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_51incRef, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_incRef, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[121])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_incRef, __pyx_t_11) < (0)) __PYX_ERR(35, 372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":389
 *         return toInt(refct)
 * 
 *     def decRef(self) -> int:             # <<<<<<<<<<<<<<
 *         """Decrement the object reference count.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(35, 389, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_53decRef, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_decRef, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[122])); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_decRef, __pyx_t_10) < (0)) __PYX_ERR(35, 389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Object.pyx":408
 *         return toInt(refct)
 * 
 *     def getAttr(self, name : str) -> object:             # <<<<<<<<<<<<<<
 *         """Return the attribute associated with a given name.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(35, 408, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_object) < (0)) __PYX_ERR(35, 408, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_55getAttr, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_getAttr, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[123])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_getAttr, __pyx_t_11) < (0)) __PYX_ERR(35, 408, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":422
 *         return self.get_attr(<char*>cval)
 * 
 *     def setAttr(self, name : str, attr : object) -> None:             # <<<<<<<<<<<<<<
 *         """Set an the attribute associated with a given name.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(35, 422, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_attr, __pyx_mstate_global->__pyx_n_u_object) < (0)) __PYX_ERR(35, 422, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(35, 422, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_57setAttr, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_setAttr, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[124])); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_setAttr, __pyx_t_10) < (0)) __PYX_ERR(35, 422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Object.pyx":436
 *         self.set_attr(<char*>cval, attr)
 * 
 *     def getDict(self) -> dict:             # <<<<<<<<<<<<<<
 *         """Return the dictionary of attributes.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_dict_2) < (0)) __PYX_ERR(35, 436, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_59getDict, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_getDict, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[125])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_getDict, __pyx_t_11) < (0)) __PYX_ERR(35, 436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":450
 *     # --- state manipulation ---
 * 
 *     def stateIncrease(self) -> None:             # <<<<<<<<<<<<<<
 *         """Increment the PETSc object state.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(35, 450, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_61stateIncrease, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_stateIncrease, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[126])); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_stateIncrease, __pyx_t_10) < (0)) __PYX_ERR(35, 450, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Object.pyx":462
 *         PetscINCSTATE(self.obj)
 * 
 *     def stateGet(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the PETSc object state.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(35, 462, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_63stateGet, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_stateGet, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[127])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_stateGet, __pyx_t_11) < (0)) __PYX_ERR(35, 462, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":476
 *         return <long>state
 * 
 *     def stateSet(self, state : int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the PETSc object state.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_state, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(35, 476, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(35, 476, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_65stateSet, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_stateSet, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[128])); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_stateSet, __pyx_t_10) < (0)) __PYX_ERR(35, 476, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Object.pyx":491
 *     # --- tab level ---
 * 
 *     def incrementTabLevel(self, tab : int, Object parent=None) -> None:             # <<<<<<<<<<<<<<
 *         """Increment the PETSc object tab level.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_tab, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(35, 491, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(35, 491, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_67incrementTabLevel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_incrementTabLevel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[129])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_incrementTabLevel, __pyx_t_11) < (0)) __PYX_ERR(35, 491, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":505
 *         CHKERR(PetscObjectIncrementTabLevel(self.obj[0], cobj, ctab))
 * 
 *     def setTabLevel(self, level : int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the PETSc object tab level.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(35, 505, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(35, 505, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_69setTabLevel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_setTabLevel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[130])); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_setTabLevel, __pyx_t_10) < (0)) __PYX_ERR(35, 505, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Object.pyx":518
 *         CHKERR(PetscObjectSetTabLevel(self.obj[0], clevel))
 * 
 *     def getTabLevel(self) -> None:             # <<<<<<<<<<<<<<
 *         """Return the PETSc object tab level.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(35, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(35, 518, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Object_71getTabLevel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Object_getTabLevel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[131])); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Object, __pyx_mstate_global->__pyx_n_u_getTabLevel, __pyx_t_11) < (0)) __PYX_ERR(35, 518, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/cyclicgc.pxi":59
 * 
 * 
 * def garbage_cleanup(comm: Comm | None = None) -> None:             # <<<<<<<<<<<<<<
 *     """Clean up unused PETSc objects.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(36, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(36, 59, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(36, 59, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_1garbage_cleanup, 0, __pyx_mstate_global->__pyx_n_u_garbage_cleanup, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[132])); if (unlikely(!__pyx_t_10)) __PYX_ERR(36, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_garbage_cleanup, __pyx_t_10) < (0)) __PYX_ERR(36, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/cyclicgc.pxi":83
 * 
 * 
 * def garbage_view(comm: Comm | None = None) -> None:             # <<<<<<<<<<<<<<
 *     """Print summary of the garbage PETSc objects.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(36, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(36, 83, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(36, 83, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3garbage_view, 0, __pyx_mstate_global->__pyx_n_u_garbage_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[133])); if (unlikely(!__pyx_t_11)) __PYX_ERR(36, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_garbage_view, __pyx_t_11) < (0)) __PYX_ERR(36, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":603
 * include "cyclicgc.pxi"
 * 
 * cdef dict type_registry = {0 : None}             # <<<<<<<<<<<<<<
 * __type_registry__ = type_registry
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(35, 603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_int_0, Py_None) < (0)) __PYX_ERR(35, 603, __pyx_L1_error)
  __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_type_registry);
  __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_type_registry, ((PyObject*)__pyx_t_11));
  __Pyx_GIVEREF(__pyx_t_11);
  __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Object.pyx":604
 * 
 * cdef dict type_registry = {0 : None}
 * __type_registry__ = type_registry             # <<<<<<<<<<<<<<
 * 
 * cdef int PyPetscType_Register(int classid, type cls) except -1:
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_type_registry, __pyx_v_8petsc4py_5PETSc_type_registry) < (0)) __PYX_ERR(35, 604, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class ViewerType(object):             # <<<<<<<<<<<<<<
 *     """Viewer type."""
 *     SOCKET      = S_(PETSCVIEWERSOCKET)
*/
  __pyx_t_11 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[23]); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_11, __pyx_mstate_global->__pyx_n_u_ViewerType, __pyx_mstate_global->__pyx_n_u_ViewerType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Viewer_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(37, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_11 != __pyx_mstate_global->__pyx_tuple[23]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[23]) < 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_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERSOCKET); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SOCKET, __pyx_t_4) < (0)) __PYX_ERR(37, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":6
 *     """Viewer type."""
 *     SOCKET      = S_(PETSCVIEWERSOCKET)
 *     ASCII       = S_(PETSCVIEWERASCII)             # <<<<<<<<<<<<<<
 *     BINARY      = S_(PETSCVIEWERBINARY)
 *     STRING      = S_(PETSCVIEWERSTRING)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII, __pyx_t_4) < (0)) __PYX_ERR(37, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":7
 *     SOCKET      = S_(PETSCVIEWERSOCKET)
 *     ASCII       = S_(PETSCVIEWERASCII)
 *     BINARY      = S_(PETSCVIEWERBINARY)             # <<<<<<<<<<<<<<
 *     STRING      = S_(PETSCVIEWERSTRING)
 *     DRAW        = S_(PETSCVIEWERDRAW)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERBINARY); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BINARY, __pyx_t_4) < (0)) __PYX_ERR(37, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":8
 *     ASCII       = S_(PETSCVIEWERASCII)
 *     BINARY      = S_(PETSCVIEWERBINARY)
 *     STRING      = S_(PETSCVIEWERSTRING)             # <<<<<<<<<<<<<<
 *     DRAW        = S_(PETSCVIEWERDRAW)
 *     VU          = S_(PETSCVIEWERVU)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERSTRING); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_STRING, __pyx_t_4) < (0)) __PYX_ERR(37, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":9
 *     BINARY      = S_(PETSCVIEWERBINARY)
 *     STRING      = S_(PETSCVIEWERSTRING)
 *     DRAW        = S_(PETSCVIEWERDRAW)             # <<<<<<<<<<<<<<
 *     VU          = S_(PETSCVIEWERVU)
 *     MATHEMATICA = S_(PETSCVIEWERMATHEMATICA)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERDRAW); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DRAW, __pyx_t_4) < (0)) __PYX_ERR(37, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":10
 *     STRING      = S_(PETSCVIEWERSTRING)
 *     DRAW        = S_(PETSCVIEWERDRAW)
 *     VU          = S_(PETSCVIEWERVU)             # <<<<<<<<<<<<<<
 *     MATHEMATICA = S_(PETSCVIEWERMATHEMATICA)
 *     HDF5        = S_(PETSCVIEWERHDF5)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERVU); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VU, __pyx_t_4) < (0)) __PYX_ERR(37, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":11
 *     DRAW        = S_(PETSCVIEWERDRAW)
 *     VU          = S_(PETSCVIEWERVU)
 *     MATHEMATICA = S_(PETSCVIEWERMATHEMATICA)             # <<<<<<<<<<<<<<
 *     HDF5        = S_(PETSCVIEWERHDF5)
 *     VTK         = S_(PETSCVIEWERVTK)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERMATHEMATICA); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MATHEMATICA, __pyx_t_4) < (0)) __PYX_ERR(37, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":12
 *     VU          = S_(PETSCVIEWERVU)
 *     MATHEMATICA = S_(PETSCVIEWERMATHEMATICA)
 *     HDF5        = S_(PETSCVIEWERHDF5)             # <<<<<<<<<<<<<<
 *     VTK         = S_(PETSCVIEWERVTK)
 *     MATLAB      = S_(PETSCVIEWERMATLAB)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERHDF5); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HDF5, __pyx_t_4) < (0)) __PYX_ERR(37, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":13
 *     MATHEMATICA = S_(PETSCVIEWERMATHEMATICA)
 *     HDF5        = S_(PETSCVIEWERHDF5)
 *     VTK         = S_(PETSCVIEWERVTK)             # <<<<<<<<<<<<<<
 *     MATLAB      = S_(PETSCVIEWERMATLAB)
 *     SAWS        = S_(PETSCVIEWERSAWS)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERVTK); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VTK, __pyx_t_4) < (0)) __PYX_ERR(37, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":14
 *     HDF5        = S_(PETSCVIEWERHDF5)
 *     VTK         = S_(PETSCVIEWERVTK)
 *     MATLAB      = S_(PETSCVIEWERMATLAB)             # <<<<<<<<<<<<<<
 *     SAWS        = S_(PETSCVIEWERSAWS)
 *     GLVIS       = S_(PETSCVIEWERGLVIS)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERMATLAB); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MATLAB, __pyx_t_4) < (0)) __PYX_ERR(37, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":15
 *     VTK         = S_(PETSCVIEWERVTK)
 *     MATLAB      = S_(PETSCVIEWERMATLAB)
 *     SAWS        = S_(PETSCVIEWERSAWS)             # <<<<<<<<<<<<<<
 *     GLVIS       = S_(PETSCVIEWERGLVIS)
 *     ADIOS       = S_(PETSCVIEWERADIOS)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERSAWS); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SAWS, __pyx_t_4) < (0)) __PYX_ERR(37, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":16
 *     MATLAB      = S_(PETSCVIEWERMATLAB)
 *     SAWS        = S_(PETSCVIEWERSAWS)
 *     GLVIS       = S_(PETSCVIEWERGLVIS)             # <<<<<<<<<<<<<<
 *     ADIOS       = S_(PETSCVIEWERADIOS)
 *     EXODUSII    = S_(PETSCVIEWEREXODUSII)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERGLVIS); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_GLVIS, __pyx_t_4) < (0)) __PYX_ERR(37, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":17
 *     SAWS        = S_(PETSCVIEWERSAWS)
 *     GLVIS       = S_(PETSCVIEWERGLVIS)
 *     ADIOS       = S_(PETSCVIEWERADIOS)             # <<<<<<<<<<<<<<
 *     EXODUSII    = S_(PETSCVIEWEREXODUSII)
 *     PYTHON      = S_(PETSCVIEWERPYTHON)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERADIOS); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ADIOS, __pyx_t_4) < (0)) __PYX_ERR(37, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":18
 *     GLVIS       = S_(PETSCVIEWERGLVIS)
 *     ADIOS       = S_(PETSCVIEWERADIOS)
 *     EXODUSII    = S_(PETSCVIEWEREXODUSII)             # <<<<<<<<<<<<<<
 *     PYTHON      = S_(PETSCVIEWERPYTHON)
 *     PYVISTA     = S_(PETSCVIEWERPYVISTA)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWEREXODUSII); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_EXODUSII, __pyx_t_4) < (0)) __PYX_ERR(37, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":19
 *     ADIOS       = S_(PETSCVIEWERADIOS)
 *     EXODUSII    = S_(PETSCVIEWEREXODUSII)
 *     PYTHON      = S_(PETSCVIEWERPYTHON)             # <<<<<<<<<<<<<<
 *     PYVISTA     = S_(PETSCVIEWERPYVISTA)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERPYTHON); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PYTHON, __pyx_t_4) < (0)) __PYX_ERR(37, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":20
 *     EXODUSII    = S_(PETSCVIEWEREXODUSII)
 *     PYTHON      = S_(PETSCVIEWERPYTHON)
 *     PYVISTA     = S_(PETSCVIEWERPYVISTA)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCVIEWERPYVISTA); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PYVISTA, __pyx_t_4) < (0)) __PYX_ERR(37, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class ViewerType(object):             # <<<<<<<<<<<<<<
 *     """Viewer type."""
 *     SOCKET      = S_(PETSCVIEWERSOCKET)
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ViewerType, __pyx_t_11, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ViewerType, __pyx_t_4) < (0)) __PYX_ERR(37, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":23
 * 
 * 
 * class ViewerFormat(object):             # <<<<<<<<<<<<<<
 *     """Viewer format."""
 *     DEFAULT           = PETSC_VIEWER_DEFAULT
*/
  __pyx_t_11 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[25]); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_11, __pyx_mstate_global->__pyx_n_u_ViewerFormat, __pyx_mstate_global->__pyx_n_u_ViewerFormat, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Viewer_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(37, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_11 != __pyx_mstate_global->__pyx_tuple[25]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[25]) < 0))) __PYX_ERR(37, 23, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Viewer.pyx":25
 * class ViewerFormat(object):
 *     """Viewer format."""
 *     DEFAULT           = PETSC_VIEWER_DEFAULT             # <<<<<<<<<<<<<<
 *     ASCII_MATLAB      = PETSC_VIEWER_ASCII_MATLAB
 *     ASCII_MATHEMATICA = PETSC_VIEWER_ASCII_MATHEMATICA
*/
  __pyx_t_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_DEFAULT); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DEFAULT, __pyx_t_4) < (0)) __PYX_ERR(37, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":26
 *     """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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_MATLAB); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_MATLAB, __pyx_t_4) < (0)) __PYX_ERR(37, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":27
 *     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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_MATHEMATICA); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_MATHEMATICA, __pyx_t_4) < (0)) __PYX_ERR(37, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":28
 *     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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_IMPL); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_IMPL, __pyx_t_4) < (0)) __PYX_ERR(37, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":29
 *     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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_INFO); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_INFO, __pyx_t_4) < (0)) __PYX_ERR(37, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":30
 *     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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_INFO_DETAIL); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_INFO_DETAIL, __pyx_t_4) < (0)) __PYX_ERR(37, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":31
 *     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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_COMMON); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_COMMON, __pyx_t_4) < (0)) __PYX_ERR(37, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":32
 *     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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_SYMMODU); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_SYMMODU, __pyx_t_4) < (0)) __PYX_ERR(37, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":33
 *     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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_INDEX); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_INDEX, __pyx_t_4) < (0)) __PYX_ERR(37, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":34
 *     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_PCICE       = PETSC_VIEWER_ASCII_PCICE
*/
  __pyx_t_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_DENSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_DENSE, __pyx_t_4) < (0)) __PYX_ERR(37, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":35
 *     ASCII_INDEX       = PETSC_VIEWER_ASCII_INDEX
 *     ASCII_DENSE       = PETSC_VIEWER_ASCII_DENSE
 *     ASCII_MATRIXMARKET= PETSC_VIEWER_ASCII_MATRIXMARKET             # <<<<<<<<<<<<<<
 *     ASCII_PCICE       = PETSC_VIEWER_ASCII_PCICE
 *     ASCII_PYTHON      = PETSC_VIEWER_ASCII_PYTHON
*/
  __pyx_t_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_MATRIXMARKET); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_MATRIXMARKET, __pyx_t_4) < (0)) __PYX_ERR(37, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":36
 *     ASCII_DENSE       = PETSC_VIEWER_ASCII_DENSE
 *     ASCII_MATRIXMARKET= PETSC_VIEWER_ASCII_MATRIXMARKET
 *     ASCII_PCICE       = PETSC_VIEWER_ASCII_PCICE             # <<<<<<<<<<<<<<
 *     ASCII_PYTHON      = PETSC_VIEWER_ASCII_PYTHON
 *     ASCII_FACTOR_INFO = PETSC_VIEWER_ASCII_FACTOR_INFO
*/
  __pyx_t_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_PCICE); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_PCICE, __pyx_t_4) < (0)) __PYX_ERR(37, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":37
 *     ASCII_MATRIXMARKET= PETSC_VIEWER_ASCII_MATRIXMARKET
 *     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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_PYTHON); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_PYTHON, __pyx_t_4) < (0)) __PYX_ERR(37, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_FACTOR_INFO); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_FACTOR_INFO, __pyx_t_4) < (0)) __PYX_ERR(37, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_LATEX); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_LATEX, __pyx_t_4) < (0)) __PYX_ERR(37, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_XML); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_XML, __pyx_t_4) < (0)) __PYX_ERR(37, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_GLVIS); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_GLVIS, __pyx_t_4) < (0)) __PYX_ERR(37, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_ASCII_CSV); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ASCII_CSV, __pyx_t_4) < (0)) __PYX_ERR(37, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_DRAW_BASIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DRAW_BASIC, __pyx_t_4) < (0)) __PYX_ERR(37, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_DRAW_LG); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DRAW_LG, __pyx_t_4) < (0)) __PYX_ERR(37, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_DRAW_LG_XRANGE); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DRAW_LG_XRANGE, __pyx_t_4) < (0)) __PYX_ERR(37, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_DRAW_CONTOUR); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DRAW_CONTOUR, __pyx_t_4) < (0)) __PYX_ERR(37, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_DRAW_PORTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DRAW_PORTS, __pyx_t_4) < (0)) __PYX_ERR(37, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_VTK_VTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VTK_VTS, __pyx_t_4) < (0)) __PYX_ERR(37, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_VTK_VTR); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VTK_VTR, __pyx_t_4) < (0)) __PYX_ERR(37, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_VTK_VTU); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VTK_VTU, __pyx_t_4) < (0)) __PYX_ERR(37, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_BINARY_MATLAB); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BINARY_MATLAB, __pyx_t_4) < (0)) __PYX_ERR(37, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_NATIVE); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NATIVE, __pyx_t_4) < (0)) __PYX_ERR(37, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_HDF5_PETSC); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HDF5_PETSC, __pyx_t_4) < (0)) __PYX_ERR(37, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_HDF5_VIZ); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HDF5_VIZ, __pyx_t_4) < (0)) __PYX_ERR(37, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_HDF5_XDMF); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HDF5_XDMF, __pyx_t_4) < (0)) __PYX_ERR(37, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_HDF5_MAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HDF5_MAT, __pyx_t_4) < (0)) __PYX_ERR(37, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_NOFORMAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NOFORMAT, __pyx_t_4) < (0)) __PYX_ERR(37, 57, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_LOAD_BALANCE); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LOAD_BALANCE, __pyx_t_4) < (0)) __PYX_ERR(37, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":59
 *     NOFORMAT          = PETSC_VIEWER_NOFORMAT
 *     LOAD_BALANCE      = PETSC_VIEWER_LOAD_BALANCE
 *     FAILED            = PETSC_VIEWER_FAILED             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_PetscViewerFormat(PETSC_VIEWER_FAILED); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FAILED, __pyx_t_4) < (0)) __PYX_ERR(37, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":23
 * 
 * 
 * class ViewerFormat(object):             # <<<<<<<<<<<<<<
 *     """Viewer format."""
 *     DEFAULT           = PETSC_VIEWER_DEFAULT
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ViewerFormat, __pyx_t_11, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ViewerFormat, __pyx_t_4) < (0)) __PYX_ERR(37, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":62
 * 
 * 
 * class ViewerFileMode(object):             # <<<<<<<<<<<<<<
 *     """Viewer file mode."""
 *     # native
*/
  __pyx_t_11 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[27]); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_11, __pyx_mstate_global->__pyx_n_u_ViewerFileMode, __pyx_mstate_global->__pyx_n_u_ViewerFileMode, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Viewer_file_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(37, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_11 != __pyx_mstate_global->__pyx_tuple[27]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[27]) < 0))) __PYX_ERR(37, 62, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Viewer.pyx":65
 *     """Viewer file mode."""
 *     # native
 *     READ          = PETSC_FILE_MODE_READ             # <<<<<<<<<<<<<<
 *     WRITE         = PETSC_FILE_MODE_WRITE
 *     APPEND        = PETSC_FILE_MODE_APPEND
*/
  __pyx_t_4 = __Pyx_PyLong_From_PetscFileMode(FILE_MODE_READ); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_READ, __pyx_t_4) < (0)) __PYX_ERR(37, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":66
 *     # native
 *     READ          = PETSC_FILE_MODE_READ
 *     WRITE         = PETSC_FILE_MODE_WRITE             # <<<<<<<<<<<<<<
 *     APPEND        = PETSC_FILE_MODE_APPEND
 *     UPDATE        = PETSC_FILE_MODE_UPDATE
*/
  __pyx_t_4 = __Pyx_PyLong_From_PetscFileMode(FILE_MODE_WRITE); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_WRITE, __pyx_t_4) < (0)) __PYX_ERR(37, 66, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":67
 *     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_4 = __Pyx_PyLong_From_PetscFileMode(FILE_MODE_APPEND); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_APPEND, __pyx_t_4) < (0)) __PYX_ERR(37, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":68
 *     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_4 = __Pyx_PyLong_From_PetscFileMode(FILE_MODE_UPDATE); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_UPDATE, __pyx_t_4) < (0)) __PYX_ERR(37, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":69
 *     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_4 = __Pyx_PyLong_From_PetscFileMode(FILE_MODE_APPEND_UPDATE); if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_APPEND_UPDATE, __pyx_t_4) < (0)) __PYX_ERR(37, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":71
 *     APPEND_UPDATE = PETSC_FILE_MODE_APPEND_UPDATE
 *     # aliases
 *     R, W, A, U = READ, WRITE, APPEND, UPDATE             # <<<<<<<<<<<<<<
 *     AU = UA    = APPEND_UPDATE
 * 
*/
  __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_READ);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_READ);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(37, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_12 = PyObject_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_WRITE);
  if (unlikely(!__pyx_t_12)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_WRITE);
  }
  if (unlikely(!__pyx_t_12)) __PYX_ERR(37, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = PyObject_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_APPEND);
  if (unlikely(!__pyx_t_13)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_APPEND);
  }
  if (unlikely(!__pyx_t_13)) __PYX_ERR(37, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = PyObject_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_UPDATE);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_UPDATE);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(37, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_R, __pyx_t_4) < (0)) __PYX_ERR(37, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_W, __pyx_t_12) < (0)) __PYX_ERR(37, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_A, __pyx_t_13) < (0)) __PYX_ERR(37, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_U, __pyx_t_14) < (0)) __PYX_ERR(37, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":72
 *     # aliases
 *     R, W, A, U = READ, WRITE, APPEND, UPDATE
 *     AU = UA    = APPEND_UPDATE             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_APPEND_UPDATE);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_APPEND_UPDATE);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(37, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_AU, __pyx_t_14) < (0)) __PYX_ERR(37, 72, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_UA, __pyx_t_14) < (0)) __PYX_ERR(37, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":62
 * 
 * 
 * class ViewerFileMode(object):             # <<<<<<<<<<<<<<
 *     """Viewer file mode."""
 *     # native
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ViewerFileMode, __pyx_t_11, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(37, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ViewerFileMode, __pyx_t_14) < (0)) __PYX_ERR(37, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":75
 * 
 * 
 * class ViewerDrawSize(object):             # <<<<<<<<<<<<<<
 *     """Window size."""
 *     # native
*/
  __pyx_t_11 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[29]); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_11, __pyx_mstate_global->__pyx_n_u_ViewerDrawSize, __pyx_mstate_global->__pyx_n_u_ViewerDrawSize, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Window_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(37, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_11 != __pyx_mstate_global->__pyx_tuple[29]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[29]) < 0))) __PYX_ERR(37, 75, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Viewer.pyx":78
 *     """Window size."""
 *     # native
 *     FULL_SIZE    = PETSC_DRAW_FULL_SIZE             # <<<<<<<<<<<<<<
 *     HALF_SIZE    = PETSC_DRAW_HALF_SIZE
 *     THIRD_SIZE   = PETSC_DRAW_THIRD_SIZE
*/
  __pyx_t_14 = __Pyx_PyLong_From___pyx_anon_enum(PETSC_DRAW_FULL_SIZE); if (unlikely(!__pyx_t_14)) __PYX_ERR(37, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FULL_SIZE, __pyx_t_14) < (0)) __PYX_ERR(37, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":79
 *     # 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_14 = __Pyx_PyLong_From___pyx_anon_enum(PETSC_DRAW_HALF_SIZE); if (unlikely(!__pyx_t_14)) __PYX_ERR(37, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HALF_SIZE, __pyx_t_14) < (0)) __PYX_ERR(37, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":80
 *     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_14 = __Pyx_PyLong_From___pyx_anon_enum(PETSC_DRAW_THIRD_SIZE); if (unlikely(!__pyx_t_14)) __PYX_ERR(37, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_THIRD_SIZE, __pyx_t_14) < (0)) __PYX_ERR(37, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":81
 *     HALF_SIZE    = PETSC_DRAW_HALF_SIZE
 *     THIRD_SIZE   = PETSC_DRAW_THIRD_SIZE
 *     QUARTER_SIZE = PETSC_DRAW_QUARTER_SIZE             # <<<<<<<<<<<<<<
 *     # aliases
 *     FULL    = FULL_SIZE
*/
  __pyx_t_14 = __Pyx_PyLong_From___pyx_anon_enum(PETSC_DRAW_QUARTER_SIZE); if (unlikely(!__pyx_t_14)) __PYX_ERR(37, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_QUARTER_SIZE, __pyx_t_14) < (0)) __PYX_ERR(37, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":83
 *     QUARTER_SIZE = PETSC_DRAW_QUARTER_SIZE
 *     # aliases
 *     FULL    = FULL_SIZE             # <<<<<<<<<<<<<<
 *     HALF    = HALF_SIZE
 *     THIRD   = THIRD_SIZE
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FULL_SIZE);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_FULL_SIZE);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(37, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FULL, __pyx_t_14) < (0)) __PYX_ERR(37, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":84
 *     # aliases
 *     FULL    = FULL_SIZE
 *     HALF    = HALF_SIZE             # <<<<<<<<<<<<<<
 *     THIRD   = THIRD_SIZE
 *     QUARTER = QUARTER_SIZE
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HALF_SIZE);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_HALF_SIZE);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(37, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HALF, __pyx_t_14) < (0)) __PYX_ERR(37, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":85
 *     FULL    = FULL_SIZE
 *     HALF    = HALF_SIZE
 *     THIRD   = THIRD_SIZE             # <<<<<<<<<<<<<<
 *     QUARTER = QUARTER_SIZE
 * 
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_THIRD_SIZE);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_THIRD_SIZE);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(37, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_THIRD, __pyx_t_14) < (0)) __PYX_ERR(37, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":86
 *     HALF    = HALF_SIZE
 *     THIRD   = THIRD_SIZE
 *     QUARTER = QUARTER_SIZE             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_QUARTER_SIZE);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_QUARTER_SIZE);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(37, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_QUARTER, __pyx_t_14) < (0)) __PYX_ERR(37, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":75
 * 
 * 
 * class ViewerDrawSize(object):             # <<<<<<<<<<<<<<
 *     """Window size."""
 *     # native
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ViewerDrawSize, __pyx_t_11, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(37, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ViewerDrawSize, __pyx_t_14) < (0)) __PYX_ERR(37, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":116
 *     """
 * 
 *     Type   = ViewerType             # <<<<<<<<<<<<<<
 *     Format = ViewerFormat
 *     FileMode = ViewerFileMode
*/
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ViewerType); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_11) < (0)) __PYX_ERR(37, 116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":117
 * 
 *     Type   = ViewerType
 *     Format = ViewerFormat             # <<<<<<<<<<<<<<
 *     FileMode = ViewerFileMode
 *     DrawSize = ViewerDrawSize
*/
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ViewerFormat); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_Format, __pyx_t_11) < (0)) __PYX_ERR(37, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":118
 *     Type   = ViewerType
 *     Format = ViewerFormat
 *     FileMode = ViewerFileMode             # <<<<<<<<<<<<<<
 *     DrawSize = ViewerDrawSize
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ViewerFileMode); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_FileMode, __pyx_t_11) < (0)) __PYX_ERR(37, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":119
 *     Format = ViewerFormat
 *     FileMode = ViewerFileMode
 *     DrawSize = ViewerDrawSize             # <<<<<<<<<<<<<<
 * 
 *     # backward compatibility
*/
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ViewerDrawSize); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_DrawSize, __pyx_t_11) < (0)) __PYX_ERR(37, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":122
 * 
 *     # backward compatibility
 *     Mode = ViewerFileMode             # <<<<<<<<<<<<<<
 *     Size = ViewerFileMode
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ViewerFileMode); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_Mode, __pyx_t_11) < (0)) __PYX_ERR(37, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":123
 *     # backward compatibility
 *     Mode = ViewerFileMode
 *     Size = ViewerFileMode             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_ViewerFileMode); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_Size, __pyx_t_11) < (0)) __PYX_ERR(37, 123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":138
 *     #
 * 
 *     def view(self, obj: Viewer | Object | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """View the viewer.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_obj, __pyx_mstate_global->__pyx_kp_u_Viewer_Object_None) < (0)) __PYX_ERR(37, 138, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 138, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_5view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[134])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_10) < (0)) __PYX_ERR(37, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":166
 *             CHKERR(PetscObjectView((<Object?>obj).obj[0], self.vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the viewer.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(37, 166, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_7destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[135])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_11) < (0)) __PYX_ERR(37, 166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":179
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a viewer.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(37, 179, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(37, 179, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_9create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[136])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_10) < (0)) __PYX_ERR(37, 179, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":200
 *         return self
 * 
 *     def createASCII(             # <<<<<<<<<<<<<<
 *         self,
 *         name: str,
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(37, 200, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_kp_u_FileMode_str_None) < (0)) __PYX_ERR(37, 200, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(37, 200, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(37, 200, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_11createASCII, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_createASCII, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[137])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_createASCII, __pyx_t_11) < (0)) __PYX_ERR(37, 200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":238
 *         return self
 * 
 *     def createBinary(             # <<<<<<<<<<<<<<
 *         self,
 *         name: str,
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(37, 238, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_kp_u_FileMode_str_None) < (0)) __PYX_ERR(37, 238, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(37, 238, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(37, 238, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_13createBinary, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_createBinary, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[138])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_createBinary, __pyx_t_10) < (0)) __PYX_ERR(37, 238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":271
 *         return self
 * 
 *     def createMPIIO(             # <<<<<<<<<<<<<<
 *         self,
 *         name: str,
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(37, 271, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_kp_u_FileMode_str_None) < (0)) __PYX_ERR(37, 271, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(37, 271, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(37, 271, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_15createMPIIO, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_createMPIIO, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[139])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_createMPIIO, __pyx_t_11) < (0)) __PYX_ERR(37, 271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":308
 *         return self
 * 
 *     def createVTK(             # <<<<<<<<<<<<<<
 *         self,
 *         name: str,
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(37, 308, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_kp_u_FileMode_str_None) < (0)) __PYX_ERR(37, 308, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(37, 308, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(37, 308, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_17createVTK, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_createVTK, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[140])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_createVTK, __pyx_t_10) < (0)) __PYX_ERR(37, 308, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":344
 *         return self
 * 
 *     def createHDF5(             # <<<<<<<<<<<<<<
 *         self,
 *         name: str,
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(37, 344, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_kp_u_FileMode_str_None) < (0)) __PYX_ERR(37, 344, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(37, 344, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(37, 344, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_19createHDF5, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_createHDF5, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[141])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_createHDF5, __pyx_t_11) < (0)) __PYX_ERR(37, 344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":380
 *         return self
 * 
 *     def createDraw(             # <<<<<<<<<<<<<<
 *         self,
 *         display: str | None = None,
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_display, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(37, 380, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_title, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(37, 380, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_position, __pyx_mstate_global->__pyx_kp_u_tuple_int_int_None) < (0)) __PYX_ERR(37, 380, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_kp_u_tuple_int_int_int_None) < (0)) __PYX_ERR(37, 380, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(37, 380, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(37, 380, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_21createDraw, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_createDraw, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[142])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[30]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_createDraw, __pyx_t_10) < (0)) __PYX_ERR(37, 380, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":430
 *         return self
 * 
 *     def setType(self, vwr_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the viewer.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_vwr_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(37, 430, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 430, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_23setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[143])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_11) < (0)) __PYX_ERR(37, 430, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":449
 *         CHKERR(PetscViewerSetType(self.vwr, cval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the viewer.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(37, 449, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_25getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[144])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_10) < (0)) __PYX_ERR(37, 449, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":463
 *         return bytes2str(cval)
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the object from the options database.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 463, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_27setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[145])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_11) < (0)) __PYX_ERR(37, 463, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":475
 *         CHKERR(PetscViewerSetFromOptions(self.vwr))
 * 
 *     def setUp(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the viewer.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(37, 475, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_29setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[146])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_10) < (0)) __PYX_ERR(37, 475, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":488
 *         return self
 * 
 *     def getFormat(self) -> Format:             # <<<<<<<<<<<<<<
 *         """Return the format of the viewer.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Format) < (0)) __PYX_ERR(37, 488, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_31getFormat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_getFormat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[147])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_getFormat, __pyx_t_11) < (0)) __PYX_ERR(37, 488, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":502
 *         return format
 * 
 *     def pushFormat(self, format: Format) -> None:             # <<<<<<<<<<<<<<
 *         """Push format to the viewer.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_format, __pyx_mstate_global->__pyx_n_u_Format) < (0)) __PYX_ERR(37, 502, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 502, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_33pushFormat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_pushFormat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[148])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_pushFormat, __pyx_t_10) < (0)) __PYX_ERR(37, 502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":514
 *         CHKERR(PetscViewerPushFormat(self.vwr, format))
 * 
 *     def popFormat(self) -> None:             # <<<<<<<<<<<<<<
 *         """Pop format from the viewer.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 514, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_35popFormat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_popFormat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[149])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_popFormat, __pyx_t_11) < (0)) __PYX_ERR(37, 514, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":526
 *         CHKERR(PetscViewerPopFormat(self.vwr))
 * 
 *     def getSubViewer(self, comm: Comm | None = None) -> Viewer:             # <<<<<<<<<<<<<<
 *         """Return a viewer defined on a subcommunicator.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(37, 526, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Viewer) < (0)) __PYX_ERR(37, 526, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_37getSubViewer, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_getSubViewer, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[150])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_getSubViewer, __pyx_t_10) < (0)) __PYX_ERR(37, 526, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":550
 *         return sub
 * 
 *     def restoreSubViewer(self, Viewer sub) -> None:             # <<<<<<<<<<<<<<
 *         """Restore a viewer defined on a subcommunicator.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 550, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_39restoreSubViewer, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_restoreSubViewer, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[151])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_restoreSubViewer, __pyx_t_11) < (0)) __PYX_ERR(37, 550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":568
 *         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_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(37, 568, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Viewer) < (0)) __PYX_ERR(37, 568, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_41STDOUT, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_STDOUT, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[152])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_STDOUT, __pyx_t_10) < (0)) __PYX_ERR(37, 568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_STDOUT); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_STDOUT, __pyx_t_11) < (0)) __PYX_ERR(37, 568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":586
 *         return viewer
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def STDERR(cls, comm: Comm | None = None) -> Viewer:
 *         """Return the standard error viewer associated with the communicator.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(37, 586, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Viewer) < (0)) __PYX_ERR(37, 586, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_43STDERR, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_STDERR, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[153])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_STDERR, __pyx_t_10) < (0)) __PYX_ERR(37, 586, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_STDERR); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_STDERR, __pyx_t_11) < (0)) __PYX_ERR(37, 586, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":604
 *         return viewer
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def ASCII(cls, name : str, comm: Comm | None = None) -> Viewer:
 *         """Return an ASCII viewer associated with the communicator.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(37, 604, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(37, 604, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Viewer) < (0)) __PYX_ERR(37, 604, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_45ASCII, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_ASCII, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[154])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_ASCII, __pyx_t_10) < (0)) __PYX_ERR(37, 604, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_ASCII); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_ASCII, __pyx_t_11) < (0)) __PYX_ERR(37, 604, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":625
 *         return viewer
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def BINARY(cls, comm: Comm | None = None) -> Viewer:
 *         """Return the default `Type.BINARY` viewer associated with the communicator.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(37, 625, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Viewer) < (0)) __PYX_ERR(37, 625, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_47BINARY, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_BINARY, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[155])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_BINARY, __pyx_t_10) < (0)) __PYX_ERR(37, 625, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_BINARY); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_BINARY, __pyx_t_11) < (0)) __PYX_ERR(37, 625, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":643
 *         return viewer
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def DRAW(cls, comm: Comm | None = None) -> Viewer:
 *         """Return the default `Type.DRAW` viewer associated with the communicator.
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(37, 643, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Viewer) < (0)) __PYX_ERR(37, 643, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_49DRAW, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_DRAW, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[156])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_DRAW, __pyx_t_10) < (0)) __PYX_ERR(37, 643, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_GetNameInClass(__pyx_t_10, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_DRAW); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_Method_ClassMethod(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_DRAW, __pyx_t_11) < (0)) __PYX_ERR(37, 643, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":663
 *     # --- ASCII viewers ---
 * 
 *     def setASCIITab(self, tabs : int) -> None:             # <<<<<<<<<<<<<<
 *         """Set ASCII tab level.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_tabs, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(37, 663, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 663, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_51setASCIITab, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_setASCIITab, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[157])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_setASCIITab, __pyx_t_10) < (0)) __PYX_ERR(37, 663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":676
 *         CHKERR(PetscViewerASCIISetTab(self.vwr, ctabs))
 * 
 *     def getASCIITab(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the ASCII tab level.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(37, 676, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_53getASCIITab, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_getASCIITab, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[158])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_getASCIITab, __pyx_t_11) < (0)) __PYX_ERR(37, 676, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":690
 *         return toInt(tabs)
 * 
 *     def addASCIITab(self, tabs: int) -> None:             # <<<<<<<<<<<<<<
 *         """Increment the ASCII tab level.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_tabs, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(37, 690, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 690, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_55addASCIITab, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_addASCIITab, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[159])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_addASCIITab, __pyx_t_10) < (0)) __PYX_ERR(37, 690, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":703
 *         CHKERR(PetscViewerASCIIAddTab(self.vwr, ctabs))
 * 
 *     def subtractASCIITab(self, tabs: int) -> None:             # <<<<<<<<<<<<<<
 *         """Decrement the ASCII tab level.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_tabs, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(37, 703, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 703, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_57subtractASCIITab, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_subtractASCIITab, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[160])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_subtractASCIITab, __pyx_t_11) < (0)) __PYX_ERR(37, 703, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":716
 *         CHKERR(PetscViewerASCIISubtractTab(self.vwr, ctabs))
 * 
 *     def pushASCIISynchronized(self) -> None:             # <<<<<<<<<<<<<<
 *         """Allow ASCII synchronized calls.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 716, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_59pushASCIISynchronized, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_pushASCIISynchronized, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[161])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_pushASCIISynchronized, __pyx_t_10) < (0)) __PYX_ERR(37, 716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":729
 *         CHKERR(PetscViewerASCIIPushSynchronized(self.vwr))
 * 
 *     def popASCIISynchronized(self) -> None:             # <<<<<<<<<<<<<<
 *         """Disallow ASCII synchronized calls.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 729, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_61popASCIISynchronized, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_popASCIISynchronized, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[162])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_popASCIISynchronized, __pyx_t_11) < (0)) __PYX_ERR(37, 729, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":742
 *         CHKERR(PetscViewerASCIIPopSynchronized(self.vwr))
 * 
 *     def pushASCIITab(self) -> None:             # <<<<<<<<<<<<<<
 *         """Push an additional tab level.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 742, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_63pushASCIITab, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_pushASCIITab, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[163])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_pushASCIITab, __pyx_t_10) < (0)) __PYX_ERR(37, 742, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":754
 *         CHKERR(PetscViewerASCIIPushTab(self.vwr))
 * 
 *     def popASCIITab(self) -> None:             # <<<<<<<<<<<<<<
 *         """Pop an additional tab level pushed via `pushASCIITab`.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 754, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_65popASCIITab, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_popASCIITab, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[164])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_popASCIITab, __pyx_t_11) < (0)) __PYX_ERR(37, 754, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":766
 *         CHKERR(PetscViewerASCIIPopTab(self.vwr))
 * 
 *     def useASCIITabs(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Enable/disable the use of ASCII tabs.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(37, 766, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 766, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_67useASCIITabs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_useASCIITabs, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[165])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_useASCIITabs, __pyx_t_10) < (0)) __PYX_ERR(37, 766, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":779
 *         CHKERR(PetscViewerASCIIUseTabs(self.vwr, flg))
 * 
 *     def printfASCII(self, msg: str) -> None:             # <<<<<<<<<<<<<<
 *         """Print a message.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_msg, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(37, 779, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 779, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_69printfASCII, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_printfASCII, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[166])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_printfASCII, __pyx_t_11) < (0)) __PYX_ERR(37, 779, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":793
 *         CHKERR(PetscViewerASCIIPrintf(self.vwr, '%s', cmsg))
 * 
 *     def printfASCIISynchronized(self, msg: str) -> None:             # <<<<<<<<<<<<<<
 *         """Print a synchronized message.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_msg, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(37, 793, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 793, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_71printfASCIISynchronized, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_printfASCIISynchronized, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[167])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_printfASCIISynchronized, __pyx_t_10) < (0)) __PYX_ERR(37, 793, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":809
 *     # --- methods specific to file viewers ---
 * 
 *     def flush(self) -> None:             # <<<<<<<<<<<<<<
 *         """Flush the viewer.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 809, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_73flush, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_flush, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[168])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_flush, __pyx_t_11) < (0)) __PYX_ERR(37, 809, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":821
 *         CHKERR(PetscViewerFlush(self.vwr))
 * 
 *     def setFileMode(self, mode: FileMode | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set file mode.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_kp_u_FileMode_str) < (0)) __PYX_ERR(37, 821, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 821, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_75setFileMode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_setFileMode, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[169])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_setFileMode, __pyx_t_10) < (0)) __PYX_ERR(37, 821, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":833
 *         CHKERR(PetscViewerFileSetMode(self.vwr, filemode(mode)))
 * 
 *     def getFileMode(self) -> FileMode:             # <<<<<<<<<<<<<<
 *         """Return the file mode.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_FileMode) < (0)) __PYX_ERR(37, 833, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_77getFileMode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_getFileMode, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[170])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_getFileMode, __pyx_t_11) < (0)) __PYX_ERR(37, 833, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":847
 *         return mode
 * 
 *     def setFileName(self, name: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set file name.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(37, 847, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 847, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_79setFileName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_setFileName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[171])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_setFileName, __pyx_t_10) < (0)) __PYX_ERR(37, 847, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":861
 *         CHKERR(PetscViewerFileSetName(self.vwr, cval))
 * 
 *     def getFileName(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return file name.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(37, 861, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_81getFileName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_getFileName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[172])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_getFileName, __pyx_t_11) < (0)) __PYX_ERR(37, 861, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":877
 *     # --- methods specific to draw viewers ---
 * 
 *     def setDrawInfo(             # <<<<<<<<<<<<<<
 *         self,
 *         display: str | None = None,
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_display, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(37, 877, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_title, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(37, 877, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_position, __pyx_mstate_global->__pyx_kp_u_tuple_int_int_None) < (0)) __PYX_ERR(37, 877, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_kp_u_tuple_int_int_int_None) < (0)) __PYX_ERR(37, 877, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 877, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_83setDrawInfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_setDrawInfo, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[173])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_setDrawInfo, __pyx_t_10) < (0)) __PYX_ERR(37, 877, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":921
 *                                       x, y, w, h))
 * 
 *     def clearDraw(self) -> None:             # <<<<<<<<<<<<<<
 *         """Reset graphics.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 921, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_85clearDraw, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_clearDraw, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[174])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_clearDraw, __pyx_t_11) < (0)) __PYX_ERR(37, 921, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":933
 *         CHKERR(PetscViewerDrawClear(self.vwr))
 * 
 *     def createPython(self, context: Any = None, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.PYTHON` viewer.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_context, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(37, 933, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(37, 933, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(37, 933, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_87createPython, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_createPython, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[175])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_createPython, __pyx_t_10) < (0)) __PYX_ERR(37, 933, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":961
 *         return self
 * 
 *     def setPythonContext(self, context: Any) -> None:             # <<<<<<<<<<<<<<
 *         """Set the instance of the class implementing the required Python methods.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_context, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(37, 961, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 961, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_89setPythonContext, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_setPythonContext, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[176])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_setPythonContext, __pyx_t_11) < (0)) __PYX_ERR(37, 961, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":973
 *         CHKERR(PetscViewerPythonSetContext(self.vwr, <void*>context))
 * 
 *     def getPythonContext(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return the instance of the class implementing the required Python methods.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(37, 973, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_91getPythonContext, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_getPythonContext, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[177])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_getPythonContext, __pyx_t_10) < (0)) __PYX_ERR(37, 973, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":988
 *         else: return <object> context
 * 
 *     def setPythonType(self, py_type: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the fully qualified Python name of the class to be used.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_py_type, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(37, 988, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 988, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_93setPythonType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_setPythonType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[178])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_setPythonType, __pyx_t_11) < (0)) __PYX_ERR(37, 988, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":1003
 *         CHKERR(PetscViewerPythonSetType(self.vwr, cval))
 * 
 *     def getPythonType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the fully qualified Python name of the class used by the viewer.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(37, 1003, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_95getPythonType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_getPythonType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[179])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_getPythonType, __pyx_t_10) < (0)) __PYX_ERR(37, 1003, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":1018
 *         return bytes2str(cval)
 * 
 *     def viewObjectPython(self, Object obj) -> None:             # <<<<<<<<<<<<<<
 *         """View a generic `Object`.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 1018, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Viewer_97viewObjectPython, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Viewer_viewObjectPython, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[180])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Viewer, __pyx_mstate_global->__pyx_n_u_viewObjectPython, __pyx_t_11) < (0)) __PYX_ERR(37, 1018, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":1044
 *     """
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         name: str,
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 1044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(37, 1044, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_kp_u_Viewer_FileMode_str_None) < (0)) __PYX_ERR(37, 1044, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(37, 1044, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(37, 1044, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_1create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ViewerHDF5_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[181])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 1044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_10) < (0)) __PYX_ERR(37, 1044, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":1080
 *         return self
 * 
 *     def pushTimestepping(self) -> None:             # <<<<<<<<<<<<<<
 *         """Activate the timestepping mode.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 1080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 1080, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_3pushTimestepping, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ViewerHDF5_pushTimestepping, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[182])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 1080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5, __pyx_mstate_global->__pyx_n_u_pushTimestepping, __pyx_t_11) < (0)) __PYX_ERR(37, 1080, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":1092
 *         CHKERR(PetscViewerHDF5PushTimestepping(self.vwr))
 * 
 *     def popTimestepping(self) -> None:             # <<<<<<<<<<<<<<
 *         """Deactivate the timestepping mode.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 1092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 1092, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_5popTimestepping, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ViewerHDF5_popTimestepping, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[183])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 1092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5, __pyx_mstate_global->__pyx_n_u_popTimestepping, __pyx_t_10) < (0)) __PYX_ERR(37, 1092, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":1104
 *         CHKERR(PetscViewerHDF5PopTimestepping(self.vwr))
 * 
 *     def getTimestep(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the current time step.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(37, 1104, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_7getTimestep, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ViewerHDF5_getTimestep, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[184])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5, __pyx_mstate_global->__pyx_n_u_getTimestep, __pyx_t_11) < (0)) __PYX_ERR(37, 1104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":1119
 *         return toInt(ctimestep)
 * 
 *     def setTimestep(self, timestep: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the current time step.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 1119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_timestep, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(37, 1119, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 1119, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_9setTimestep, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ViewerHDF5_setTimestep, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[185])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 1119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5, __pyx_mstate_global->__pyx_n_u_setTimestep, __pyx_t_10) < (0)) __PYX_ERR(37, 1119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":1132
 *         CHKERR(PetscViewerHDF5SetTimestep(self.vwr, asInt(timestep)))
 * 
 *     def incrementTimestep(self) -> None:             # <<<<<<<<<<<<<<
 *         """Increment the time step.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 1132, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_11incrementTimestep, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ViewerHDF5_incrementTimestep, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[186])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5, __pyx_mstate_global->__pyx_n_u_incrementTimestep, __pyx_t_11) < (0)) __PYX_ERR(37, 1132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":1145
 *         CHKERR(PetscViewerHDF5IncrementTimestep(self.vwr))
 * 
 *     def pushGroup(self, group: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the current group.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_group, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(37, 1145, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 1145, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_13pushGroup, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ViewerHDF5_pushGroup, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[187])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5, __pyx_mstate_global->__pyx_n_u_pushGroup, __pyx_t_10) < (0)) __PYX_ERR(37, 1145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":1159
 *         CHKERR(PetscViewerHDF5PushGroup(self.vwr, cgroup))
 * 
 *     def popGroup(self) -> None:             # <<<<<<<<<<<<<<
 *         """Pop the current group from the stack.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 1159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(37, 1159, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_15popGroup, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ViewerHDF5_popGroup, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[188])); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 1159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5, __pyx_mstate_global->__pyx_n_u_popGroup, __pyx_t_11) < (0)) __PYX_ERR(37, 1159, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":1171
 *         CHKERR(PetscViewerHDF5PopGroup(self.vwr))
 * 
 *     def getGroup(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the current group.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(37, 1171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(37, 1171, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_10ViewerHDF5_17getGroup, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ViewerHDF5_getGroup, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[189])); if (unlikely(!__pyx_t_10)) __PYX_ERR(37, 1171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_ViewerHDF5, __pyx_mstate_global->__pyx_n_u_getGroup, __pyx_t_10) < (0)) __PYX_ERR(37, 1171, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Viewer.pyx":1189
 * # --------------------------------------------------------------------
 * 
 * del ViewerType             # <<<<<<<<<<<<<<
 * del ViewerFormat
 * del ViewerFileMode
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ViewerType) < (0)) __PYX_ERR(37, 1189, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1190
 * 
 * del ViewerType
 * del ViewerFormat             # <<<<<<<<<<<<<<
 * del ViewerFileMode
 * del ViewerDrawSize
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ViewerFormat) < (0)) __PYX_ERR(37, 1190, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1191
 * del ViewerType
 * del ViewerFormat
 * del ViewerFileMode             # <<<<<<<<<<<<<<
 * del ViewerDrawSize
 * 
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ViewerFileMode) < (0)) __PYX_ERR(37, 1191, __pyx_L1_error)

  /* "petsc4py/PETSc/Viewer.pyx":1192
 * del ViewerFormat
 * del ViewerFileMode
 * del ViewerDrawSize             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ViewerDrawSize) < (0)) __PYX_ERR(37, 1192, __pyx_L1_error)

  /* "petsc4py/PETSc/Random.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class RandomType(object):             # <<<<<<<<<<<<<<
 *     """The random number generator type."""
 *     RAND      = S_(PETSCRAND)
*/
  __pyx_t_10 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[33]); if (unlikely(!__pyx_t_10)) __PYX_ERR(38, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(38, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_10, __pyx_mstate_global->__pyx_n_u_RandomType, __pyx_mstate_global->__pyx_n_u_RandomType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_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_10 != __pyx_mstate_global->__pyx_tuple[33]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[33]) < 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_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCRAND); if (unlikely(!__pyx_t_14)) __PYX_ERR(38, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_RAND, __pyx_t_14) < (0)) __PYX_ERR(38, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 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_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCRAND48); if (unlikely(!__pyx_t_14)) __PYX_ERR(38, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_RAND48, __pyx_t_14) < (0)) __PYX_ERR(38, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Random.pyx":7
 *     RAND      = S_(PETSCRAND)
 *     RAND48    = S_(PETSCRAND48)
 *     SPRNG     = S_(PETSCSPRNG)             # <<<<<<<<<<<<<<
 *     RANDER48  = S_(PETSCRANDER48)
 *     RANDOM123 = S_(PETSCRANDOM123)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPRNG); if (unlikely(!__pyx_t_14)) __PYX_ERR(38, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SPRNG, __pyx_t_14) < (0)) __PYX_ERR(38, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Random.pyx":8
 *     RAND48    = S_(PETSCRAND48)
 *     SPRNG     = S_(PETSCSPRNG)
 *     RANDER48  = S_(PETSCRANDER48)             # <<<<<<<<<<<<<<
 *     RANDOM123 = S_(PETSCRANDOM123)
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCRANDER48); if (unlikely(!__pyx_t_14)) __PYX_ERR(38, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_RANDER48, __pyx_t_14) < (0)) __PYX_ERR(38, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Random.pyx":9
 *     SPRNG     = S_(PETSCSPRNG)
 *     RANDER48  = S_(PETSCRANDER48)
 *     RANDOM123 = S_(PETSCRANDOM123)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCRANDOM123); if (unlikely(!__pyx_t_14)) __PYX_ERR(38, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_RANDOM123, __pyx_t_14) < (0)) __PYX_ERR(38, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Random.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class RandomType(object):             # <<<<<<<<<<<<<<
 *     """The random number generator type."""
 *     RAND      = S_(PETSCRAND)
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_RandomType, __pyx_t_10, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(38, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RandomType, __pyx_t_14) < (0)) __PYX_ERR(38, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Random.pyx":23
 *     """
 * 
 *     Type = RandomType             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self) -> None:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RandomType); if (unlikely(!__pyx_t_10)) __PYX_ERR(38, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_10) < (0)) __PYX_ERR(38, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Random.pyx":41
 *         return self.getValue()
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View a random number generator object.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(38, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(38, 41, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Random_5view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Random_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[190])); if (unlikely(!__pyx_t_11)) __PYX_ERR(38, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_11) < (0)) __PYX_ERR(38, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Random.pyx":61
 *         CHKERR(PetscRandomView(self.rnd, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the random number generator object.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(38, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(38, 61, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Random_7destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Random_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[191])); if (unlikely(!__pyx_t_10)) __PYX_ERR(38, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_10) < (0)) __PYX_ERR(38, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Random.pyx":74
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a random number generator object.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(38, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(38, 74, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(38, 74, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Random_9create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Random_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[192])); if (unlikely(!__pyx_t_11)) __PYX_ERR(38, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_11) < (0)) __PYX_ERR(38, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Random.pyx":93
 *         return self
 * 
 *     def setType(self, rnd_type: Random.Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the random number generator object.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(38, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_rnd_type, __pyx_mstate_global->__pyx_kp_u_Random_Type_str) < (0)) __PYX_ERR(38, 93, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(38, 93, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Random_11setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Random_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[193])); if (unlikely(!__pyx_t_10)) __PYX_ERR(38, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_10) < (0)) __PYX_ERR(38, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Random.pyx":112
 *         CHKERR(PetscRandomSetType(self.rnd, cval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the random number generator object.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(38, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(38, 112, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Random_13getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Random_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[194])); if (unlikely(!__pyx_t_11)) __PYX_ERR(38, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_11) < (0)) __PYX_ERR(38, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Random.pyx":126
 *         return bytes2str(cval)
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the random number generator from the options database.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(38, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(38, 126, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Random_15setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Random_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[195])); if (unlikely(!__pyx_t_10)) __PYX_ERR(38, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_10) < (0)) __PYX_ERR(38, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Random.pyx":138
 *         CHKERR(PetscRandomSetFromOptions(self.rnd))
 * 
 *     def getValue(self) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Generate a scalar random number.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(38, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(38, 138, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Random_17getValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Random_getValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[196])); if (unlikely(!__pyx_t_11)) __PYX_ERR(38, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_mstate_global->__pyx_n_u_getValue, __pyx_t_11) < (0)) __PYX_ERR(38, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Random.pyx":152
 *         return toScalar(sval)
 * 
 *     def getValueReal(self) -> float:             # <<<<<<<<<<<<<<
 *         """Generate a real random number.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(38, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(38, 152, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Random_19getValueReal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Random_getValueReal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[197])); if (unlikely(!__pyx_t_10)) __PYX_ERR(38, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_mstate_global->__pyx_n_u_getValueReal, __pyx_t_10) < (0)) __PYX_ERR(38, 152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Random.pyx":166
 *         return toReal(rval)
 * 
 *     def getSeed(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the random number generator seed.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(38, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(38, 166, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Random_21getSeed, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Random_getSeed, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[198])); if (unlikely(!__pyx_t_11)) __PYX_ERR(38, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_mstate_global->__pyx_n_u_getSeed, __pyx_t_11) < (0)) __PYX_ERR(38, 166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Random.pyx":180
 *         return seed
 * 
 *     def setSeed(self, seed: int | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the seed of random number generator.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(38, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_seed, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(38, 180, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(38, 180, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Random_23setSeed, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Random_setSeed, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[199])); if (unlikely(!__pyx_t_10)) __PYX_ERR(38, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_mstate_global->__pyx_n_u_setSeed, __pyx_t_10) < (0)) __PYX_ERR(38, 180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Random.pyx":199
 *         CHKERR(PetscRandomSeed(self.rnd))
 * 
 *     def getInterval(self) -> tuple[Scalar, Scalar]:             # <<<<<<<<<<<<<<
 *         """Return the interval containing the random numbers generated.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(38, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Scalar_Scalar) < (0)) __PYX_ERR(38, 199, __pyx_L1_error)
  __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Random_25getInterval, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Random_getInterval, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[200])); if (unlikely(!__pyx_t_11)) __PYX_ERR(38, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_11);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_mstate_global->__pyx_n_u_getInterval, __pyx_t_11) < (0)) __PYX_ERR(38, 199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "petsc4py/PETSc/Random.pyx":214
 *         return (toScalar(sval1), toScalar(sval2))
 * 
 *     def setInterval(self, interval: tuple[Scalar, Scalar]) -> None:             # <<<<<<<<<<<<<<
 *         """Set the interval of the random number generator.
 * 
*/
  __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(38, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_interval, __pyx_mstate_global->__pyx_kp_u_tuple_Scalar_Scalar) < (0)) __PYX_ERR(38, 214, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(38, 214, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Random_27setInterval, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Random_setInterval, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[201])); if (unlikely(!__pyx_t_10)) __PYX_ERR(38, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Random, __pyx_mstate_global->__pyx_n_u_setInterval, __pyx_t_10) < (0)) __PYX_ERR(38, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Random.pyx":251
 * # --------------------------------------------------------------------
 * 
 * del RandomType             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_RandomType) < (0)) __PYX_ERR(38, 251, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class staticproperty(property):             # <<<<<<<<<<<<<<
 *     def __get__(self, *args, **kwargs):
 *         return self.fget.__get__(*args, **kwargs)()
*/
  __pyx_t_10 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[35]); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_10, __pyx_mstate_global->__pyx_n_u_staticproperty, __pyx_mstate_global->__pyx_n_u_staticproperty, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_10 != __pyx_mstate_global->__pyx_tuple[35]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[35]) < 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_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_14staticproperty_1__get__, 0, __pyx_mstate_global->__pyx_n_u_staticproperty___get, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[202])); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_get, __pyx_t_14) < (0)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Device.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class staticproperty(property):             # <<<<<<<<<<<<<<
 *     def __get__(self, *args, **kwargs):
 *         return self.fget.__get__(*args, **kwargs)()
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_staticproperty, __pyx_t_10, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_staticproperty, __pyx_t_14) < (0)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Device.pyx":30
 *   """,
 *   (
 *     ("HOST"    , PETSC_DEVICE_HOST),             # <<<<<<<<<<<<<<
 *     ("CUDA"    , PETSC_DEVICE_CUDA),
 *     ("HIP"     , PETSC_DEVICE_HIP),
*/
  __pyx_t_10 = __Pyx_PyLong_From_PetscDeviceType(PETSC_DEVICE_HOST); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_HOST, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Device.pyx":31
 *   (
 *     ("HOST"    , PETSC_DEVICE_HOST),
 *     ("CUDA"    , PETSC_DEVICE_CUDA),             # <<<<<<<<<<<<<<
 *     ("HIP"     , PETSC_DEVICE_HIP),
 *     ("SYCL"    , PETSC_DEVICE_SYCL),
*/
  __pyx_t_10 = __Pyx_PyLong_From_PetscDeviceType(PETSC_DEVICE_CUDA); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_5 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_CUDA, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Device.pyx":32
 *     ("HOST"    , PETSC_DEVICE_HOST),
 *     ("CUDA"    , PETSC_DEVICE_CUDA),
 *     ("HIP"     , PETSC_DEVICE_HIP),             # <<<<<<<<<<<<<<
 *     ("SYCL"    , PETSC_DEVICE_SYCL),
 *     ("DEFAULT" , staticproperty(lambda *_, **__: PETSC_DEVICE_DEFAULT()))
*/
  __pyx_t_10 = __Pyx_PyLong_From_PetscDeviceType(PETSC_DEVICE_HIP); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_14 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_HIP, __pyx_t_10); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Device.pyx":33
 *     ("CUDA"    , PETSC_DEVICE_CUDA),
 *     ("HIP"     , PETSC_DEVICE_HIP),
 *     ("SYCL"    , PETSC_DEVICE_SYCL),             # <<<<<<<<<<<<<<
 *     ("DEFAULT" , staticproperty(lambda *_, **__: PETSC_DEVICE_DEFAULT()))
 *   )
*/
  __pyx_t_10 = __Pyx_PyLong_From_PetscDeviceType(PETSC_DEVICE_SYCL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_13 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_SYCL, __pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Device.pyx":34
 *     ("HIP"     , PETSC_DEVICE_HIP),
 *     ("SYCL"    , PETSC_DEVICE_SYCL),
 *     ("DEFAULT" , staticproperty(lambda *_, **__: PETSC_DEVICE_DEFAULT()))             # <<<<<<<<<<<<<<
 *   )
 * )
*/
  __pyx_t_12 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_staticproperty); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_15 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_16lambda, 0, __pyx_mstate_global->__pyx_n_u_lambda, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[203])); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_15);
  #endif
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_15};
    __pyx_t_10 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 34, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
  }
  __pyx_t_4 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_DEFAULT, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Device.pyx":30
 *   """,
 *   (
 *     ("HOST"    , PETSC_DEVICE_HOST),             # <<<<<<<<<<<<<<
 *     ("CUDA"    , PETSC_DEVICE_CUDA),
 *     ("HIP"     , PETSC_DEVICE_HIP),
*/
  __pyx_t_10 = PyTuple_Pack(5, __pyx_t_11, __pyx_t_5, __pyx_t_14, __pyx_t_13, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Device.pyx":20
 *     return type(class_name, (object,), attrs)
 * 
 * DeviceType = make_enum_class(             # <<<<<<<<<<<<<<
 *   "DeviceType",
 *   """The type of device.
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_make_enum_class(__pyx_mstate_global->__pyx_n_u_DeviceType, __pyx_mstate_global->__pyx_kp_u_The_type_of_device_See_Also_Devi, ((PyObject*)__pyx_t_10)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DeviceType, __pyx_t_4) < (0)) __PYX_ERR(2, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Device.pyx":49
 *   """,
 *   (
 *     ("DEFAULT"                  , PETSC_STREAM_DEFAULT),             # <<<<<<<<<<<<<<
 *     ("NONBLOCKING"              , PETSC_STREAM_NONBLOCKING),
 *     ("DEFAULT_WITH_BARRIER"     , PETSC_STREAM_DEFAULT_WITH_BARRIER),
*/
  __pyx_t_4 = __Pyx_PyLong_From_PetscStreamType(PETSC_STREAM_DEFAULT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_DEFAULT, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Device.pyx":50
 *   (
 *     ("DEFAULT"                  , PETSC_STREAM_DEFAULT),
 *     ("NONBLOCKING"              , PETSC_STREAM_NONBLOCKING),             # <<<<<<<<<<<<<<
 *     ("DEFAULT_WITH_BARRIER"     , PETSC_STREAM_DEFAULT_WITH_BARRIER),
 *     ("NONBLOCKING_WITH_BARRIER" , PETSC_STREAM_NONBLOCKING_WITH_BARRIER),
*/
  __pyx_t_4 = __Pyx_PyLong_From_PetscStreamType(PETSC_STREAM_NONBLOCKING); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_13 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_NONBLOCKING, __pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Device.pyx":51
 *     ("DEFAULT"                  , PETSC_STREAM_DEFAULT),
 *     ("NONBLOCKING"              , PETSC_STREAM_NONBLOCKING),
 *     ("DEFAULT_WITH_BARRIER"     , PETSC_STREAM_DEFAULT_WITH_BARRIER),             # <<<<<<<<<<<<<<
 *     ("NONBLOCKING_WITH_BARRIER" , PETSC_STREAM_NONBLOCKING_WITH_BARRIER),
 *   )
*/
  __pyx_t_4 = __Pyx_PyLong_From_PetscStreamType(PETSC_STREAM_DEFAULT_WITH_BARRIER); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_14 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_DEFAULT_WITH_BARRIER, __pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Device.pyx":52
 *     ("NONBLOCKING"              , PETSC_STREAM_NONBLOCKING),
 *     ("DEFAULT_WITH_BARRIER"     , PETSC_STREAM_DEFAULT_WITH_BARRIER),
 *     ("NONBLOCKING_WITH_BARRIER" , PETSC_STREAM_NONBLOCKING_WITH_BARRIER),             # <<<<<<<<<<<<<<
 *   )
 * )
*/
  __pyx_t_4 = __Pyx_PyLong_From_PetscStreamType(PETSC_STREAM_NONBLOCKING_WITH_BARRIER); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_NONBLOCKING_WITH_BARRIER, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Device.pyx":49
 *   """,
 *   (
 *     ("DEFAULT"                  , PETSC_STREAM_DEFAULT),             # <<<<<<<<<<<<<<
 *     ("NONBLOCKING"              , PETSC_STREAM_NONBLOCKING),
 *     ("DEFAULT_WITH_BARRIER"     , PETSC_STREAM_DEFAULT_WITH_BARRIER),
*/
  __pyx_t_4 = PyTuple_Pack(4, __pyx_t_10, __pyx_t_13, __pyx_t_14, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Device.pyx":38
 * )
 * 
 * StreamType = make_enum_class(             # <<<<<<<<<<<<<<
 *   "StreamType",
 *   """The type of stream.
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_make_enum_class(__pyx_mstate_global->__pyx_n_u_StreamType, __pyx_mstate_global->__pyx_kp_u_The_type_of_stream_See_Also_Devi, ((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_StreamType, __pyx_t_5) < (0)) __PYX_ERR(2, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Device.pyx":67
 *   """,
 *   (
 *     ("DESTROY" , PETSC_DEVICE_CONTEXT_JOIN_DESTROY),             # <<<<<<<<<<<<<<
 *     ("SYNC"    , PETSC_DEVICE_CONTEXT_JOIN_SYNC),
 *     ("NO_SYNC" , PETSC_DEVICE_CONTEXT_JOIN_NO_SYNC),
*/
  __pyx_t_5 = __Pyx_PyLong_From_PetscDeviceContextJoinMode(PETSC_DEVICE_CONTEXT_JOIN_DESTROY); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_DESTROY, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Device.pyx":68
 *   (
 *     ("DESTROY" , PETSC_DEVICE_CONTEXT_JOIN_DESTROY),
 *     ("SYNC"    , PETSC_DEVICE_CONTEXT_JOIN_SYNC),             # <<<<<<<<<<<<<<
 *     ("NO_SYNC" , PETSC_DEVICE_CONTEXT_JOIN_NO_SYNC),
 *   )
*/
  __pyx_t_5 = __Pyx_PyLong_From_PetscDeviceContextJoinMode(PETSC_DEVICE_CONTEXT_JOIN_SYNC); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_14 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_SYNC, __pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Device.pyx":69
 *     ("DESTROY" , PETSC_DEVICE_CONTEXT_JOIN_DESTROY),
 *     ("SYNC"    , PETSC_DEVICE_CONTEXT_JOIN_SYNC),
 *     ("NO_SYNC" , PETSC_DEVICE_CONTEXT_JOIN_NO_SYNC),             # <<<<<<<<<<<<<<
 *   )
 * )
*/
  __pyx_t_5 = __Pyx_PyLong_From_PetscDeviceContextJoinMode(PETSC_DEVICE_CONTEXT_JOIN_NO_SYNC); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_13 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_NO_SYNC, __pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Device.pyx":67
 *   """,
 *   (
 *     ("DESTROY" , PETSC_DEVICE_CONTEXT_JOIN_DESTROY),             # <<<<<<<<<<<<<<
 *     ("SYNC"    , PETSC_DEVICE_CONTEXT_JOIN_SYNC),
 *     ("NO_SYNC" , PETSC_DEVICE_CONTEXT_JOIN_NO_SYNC),
*/
  __pyx_t_5 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_14, __pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":56
 * )
 * 
 * DeviceJoinMode = make_enum_class(             # <<<<<<<<<<<<<<
 *   "JoinMode",
 *   """The type of join to perform.
*/
  __pyx_t_13 = __pyx_f_8petsc4py_5PETSc_make_enum_class(__pyx_mstate_global->__pyx_n_u_JoinMode, __pyx_mstate_global->__pyx_kp_u_The_type_of_join_to_perform_See, ((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DeviceJoinMode, __pyx_t_13) < (0)) __PYX_ERR(2, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":86
 *     """
 * 
 *     Type = DeviceType             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_DeviceType); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_13) < (0)) __PYX_ERR(2, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":95
 * 
 *     @classmethod
 *     def create(cls, dtype: Type | None = None, device_id: int = DECIDE) -> Device:             # <<<<<<<<<<<<<<
 *         """Create a device object.
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_DECIDE); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_mstate_global->__pyx_k__18 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":94
 *         self.destroy()
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def create(cls, dtype: Type | None = None, device_id: int = DECIDE) -> Device:
 *         """Create a device object.
*/
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_DECIDE); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = PyTuple_Pack(2, Py_None, __pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_dtype, __pyx_mstate_global->__pyx_kp_u_Type_None) < (0)) __PYX_ERR(2, 94, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_device_id, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(2, 94, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Device) < (0)) __PYX_ERR(2, 94, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Device_5create, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Device_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[204])); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_14) < (0)) __PYX_ERR(2, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_GetNameInClass(__pyx_t_14, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_mstate_global->__pyx_n_u_create); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_Method_ClassMethod(__pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_13) < (0)) __PYX_ERR(2, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":120
 *         return device
 * 
 *     def destroy(self) -> None:             # <<<<<<<<<<<<<<
 *         """Destroy a device object.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(2, 120, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Device_7destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Device_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[205])); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_14) < (0)) __PYX_ERR(2, 120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Device.pyx":132
 *         CHKERR(PetscDeviceDestroy(&self.device))
 * 
 *     def configure(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure and setup a device object.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(2, 132, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Device_9configure, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Device_configure, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[206])); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_mstate_global->__pyx_n_u_configure, __pyx_t_13) < (0)) __PYX_ERR(2, 132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":144
 *         CHKERR(PetscDeviceConfigure(self.device))
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View a device object.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(2, 144, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Device_11view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Device_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[207])); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_14) < (0)) __PYX_ERR(2, 144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Device.pyx":165
 *         CHKERR(PetscDeviceView(self.device, vwr))
 * 
 *     def getDeviceType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the device.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(2, 165, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Device_13getDeviceType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Device_getDeviceType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[208])); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_mstate_global->__pyx_n_u_getDeviceType, __pyx_t_13) < (0)) __PYX_ERR(2, 165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":180
 *         return toDeviceType(cdtype)
 * 
 *     def getDeviceId(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the device id.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(2, 180, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Device_15getDeviceId, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Device_getDeviceId, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[209])); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_mstate_global->__pyx_n_u_getDeviceId, __pyx_t_14) < (0)) __PYX_ERR(2, 180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Device.pyx":195
 *         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_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_device_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(2, 195, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(2, 195, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6Device_17setDefaultType, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Device_setDefaultType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[210])); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_mstate_global->__pyx_n_u_setDefaultType, __pyx_t_13) < (0)) __PYX_ERR(2, 195, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_14 = NULL;
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_mstate_global->__pyx_n_u_setDefaultType); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_5};
    __pyx_t_13 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Device, __pyx_mstate_global->__pyx_n_u_setDefaultType, __pyx_t_13) < (0)) __PYX_ERR(2, 195, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":233
 * 
 *     """
 *     JoinMode   = DeviceJoinMode             # <<<<<<<<<<<<<<
 *     StreamType = StreamType
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_DeviceJoinMode); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_JoinMode, __pyx_t_13) < (0)) __PYX_ERR(2, 233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":234
 *     """
 *     JoinMode   = DeviceJoinMode
 *     StreamType = StreamType             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_GetNameInClass(__pyx_t_13, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_StreamType); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_StreamType, __pyx_t_13) < (0)) __PYX_ERR(2, 234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":240
 *         self.dctx = NULL
 * 
 *     def create(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an empty DeviceContext.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(2, 240, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_3create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DeviceContext_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[211])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_5) < (0)) __PYX_ERR(2, 240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Device.pyx":255
 *         return self
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy a device context.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(2, 255, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DeviceContext_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[212])); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_13) < (0)) __PYX_ERR(2, 255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":268
 *         return self
 * 
 *     def getStreamType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the `StreamType`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(2, 268, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_7getStreamType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DeviceContext_getStreamType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[213])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_getStreamType, __pyx_t_5) < (0)) __PYX_ERR(2, 268, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Device.pyx":283
 *         return toStreamType(cstream_type)
 * 
 *     def setStreamType(self, stream_type: StreamType | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `StreamType`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stream_type, __pyx_mstate_global->__pyx_kp_u_StreamType_str) < (0)) __PYX_ERR(2, 283, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(2, 283, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_9setStreamType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DeviceContext_setStreamType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[214])); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_setStreamType, __pyx_t_13) < (0)) __PYX_ERR(2, 283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":302
 *         CHKERR(PetscDeviceContextSetStreamType(self.dctx, cstream_type))
 * 
 *     def getDevice(self) -> Device:             # <<<<<<<<<<<<<<
 *         """Get the `Device` which this instance is attached to.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Device) < (0)) __PYX_ERR(2, 302, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_11getDevice, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DeviceContext_getDevice, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[215])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_getDevice, __pyx_t_5) < (0)) __PYX_ERR(2, 302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Device.pyx":317
 *         return PyPetscDevice_New(device)
 * 
 *     def setDevice(self, Device device not None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `Device` which this `DeviceContext` is attached to.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(2, 317, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_13setDevice, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DeviceContext_setDevice, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[216])); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_setDevice, __pyx_t_13) < (0)) __PYX_ERR(2, 317, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":336
 *         CHKERR(PetscDeviceContextSetDevice(self.dctx, cdevice))
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the device context.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(2, 336, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_15setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DeviceContext_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[217])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_5) < (0)) __PYX_ERR(2, 336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Device.pyx":348
 *         CHKERR(PetscDeviceContextSetUp(self.dctx))
 * 
 *     def duplicate(self) -> DeviceContext:             # <<<<<<<<<<<<<<
 *         """Duplicate a the device context.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DeviceContext) < (0)) __PYX_ERR(2, 348, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_17duplicate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DeviceContext_duplicate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[218])); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_duplicate, __pyx_t_13) < (0)) __PYX_ERR(2, 348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":363
 *         return octx
 * 
 *     def idle(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the underlying stream for the device context is idle.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(2, 363, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_19idle, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DeviceContext_idle, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[219])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_idle, __pyx_t_5) < (0)) __PYX_ERR(2, 363, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Device.pyx":378
 *         return toBool(is_idle)
 * 
 *     def waitFor(self, other: DeviceContext | None) -> None:             # <<<<<<<<<<<<<<
 *         """Make this instance wait for ``other``.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_other, __pyx_mstate_global->__pyx_kp_u_DeviceContext_None) < (0)) __PYX_ERR(2, 378, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(2, 378, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_21waitFor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DeviceContext_waitFor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[220])); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_waitFor, __pyx_t_13) < (0)) __PYX_ERR(2, 378, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":399
 *         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.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_n, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(2, 399, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_stream_type, __pyx_mstate_global->__pyx_kp_u_DeviceContext_StreamType_str_Non) < (0)) __PYX_ERR(2, 399, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_DeviceContext) < (0)) __PYX_ERR(2, 399, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_23fork, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DeviceContext_fork, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[221])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_fork, __pyx_t_5) < (0)) __PYX_ERR(2, 399, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Device.pyx":448
 *         return subctxs
 * 
 *     def join(self, join_mode: JoinMode | str, py_sub_ctxs: list[DeviceContext]) -> None:             # <<<<<<<<<<<<<<
 *         """Join a set of device contexts on this one.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_join_mode, __pyx_mstate_global->__pyx_kp_u_JoinMode_str) < (0)) __PYX_ERR(2, 448, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_py_sub_ctxs, __pyx_mstate_global->__pyx_kp_u_list_DeviceContext) < (0)) __PYX_ERR(2, 448, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(2, 448, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_25join, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DeviceContext_join, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[222])); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_join, __pyx_t_13) < (0)) __PYX_ERR(2, 448, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":483
 *             CHKERR(PetscFree(np_subctx))
 * 
 *     def synchronize(self) -> None:             # <<<<<<<<<<<<<<
 *         """Synchronize a device context.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(2, 483, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_27synchronize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DeviceContext_synchronize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[223])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_synchronize, __pyx_t_5) < (0)) __PYX_ERR(2, 483, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Device.pyx":500
 *         CHKERR(PetscDeviceContextSynchronize(self.dctx))
 * 
 *     def setFromOptions(self, comm: Comm | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the `DeviceContext` from the options database.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(2, 500, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(2, 500, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_29setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DeviceContext_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[224])); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_13) < (0)) __PYX_ERR(2, 500, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Device.pyx":519
 *         CHKERR(PetscDeviceContextSetFromOptions(ccomm, self.dctx))
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def getCurrent() -> DeviceContext:
 *         """Return the current device context.
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DeviceContext) < (0)) __PYX_ERR(2, 519, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_31getCurrent, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DeviceContext_getCurrent, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[225])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_getCurrent, __pyx_t_5) < (0)) __PYX_ERR(2, 519, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_13 = NULL;
  __Pyx_GetNameInClass(__pyx_t_14, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_getCurrent); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_14};
    __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_getCurrent, __pyx_t_5) < (0)) __PYX_ERR(2, 519, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Device.pyx":535
 *         return PyPetscDeviceContext_New(dctx)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def setCurrent(dctx: DeviceContext | None) -> None:
 *         """Set the current device context.
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_dctx, __pyx_mstate_global->__pyx_kp_u_DeviceContext_None) < (0)) __PYX_ERR(2, 535, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(2, 535, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13DeviceContext_33setCurrent, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DeviceContext_setCurrent, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[226])); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_setCurrent, __pyx_t_14) < (0)) __PYX_ERR(2, 535, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __pyx_t_5 = NULL;
  __Pyx_GetNameInClass(__pyx_t_13, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_setCurrent); if (unlikely(!__pyx_t_13)) __PYX_ERR(2, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_13};
    __pyx_t_14 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_staticmethod, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_14);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DeviceContext, __pyx_mstate_global->__pyx_n_u_setCurrent, __pyx_t_14) < (0)) __PYX_ERR(2, 535, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Device.pyx":584
 * # --------------------------------------------------------------------
 * 
 * del DeviceType             # <<<<<<<<<<<<<<
 * del DeviceJoinMode
 * del StreamType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DeviceType) < (0)) __PYX_ERR(2, 584, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":585
 * 
 * del DeviceType
 * del DeviceJoinMode             # <<<<<<<<<<<<<<
 * del StreamType
 * del staticproperty
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DeviceJoinMode) < (0)) __PYX_ERR(2, 585, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":586
 * del DeviceType
 * del DeviceJoinMode
 * del StreamType             # <<<<<<<<<<<<<<
 * del staticproperty
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_StreamType) < (0)) __PYX_ERR(2, 586, __pyx_L1_error)

  /* "petsc4py/PETSc/Device.pyx":587
 * del DeviceJoinMode
 * del StreamType
 * del staticproperty             # <<<<<<<<<<<<<<
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_staticproperty) < (0)) __PYX_ERR(2, 587, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class ISType(object):             # <<<<<<<<<<<<<<
 *     """The index set types."""
 *     GENERAL = S_(ISGENERAL)
*/
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[37]); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_ISType, __pyx_mstate_global->__pyx_n_u_ISType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_index_set_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_mstate_global->__pyx_tuple[37]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[37]) < 0))) __PYX_ERR(39, 3, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/IS.pyx":5
 * class ISType(object):
 *     """The index set types."""
 *     GENERAL = S_(ISGENERAL)             # <<<<<<<<<<<<<<
 *     BLOCK   = S_(ISBLOCK)
 *     STRIDE  = S_(ISSTRIDE)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(ISGENERAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_GENERAL, __pyx_t_4) < (0)) __PYX_ERR(39, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/IS.pyx":6
 *     """The index set types."""
 *     GENERAL = S_(ISGENERAL)
 *     BLOCK   = S_(ISBLOCK)             # <<<<<<<<<<<<<<
 *     STRIDE  = S_(ISSTRIDE)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(ISBLOCK); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BLOCK, __pyx_t_4) < (0)) __PYX_ERR(39, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/IS.pyx":7
 *     GENERAL = S_(ISGENERAL)
 *     BLOCK   = S_(ISBLOCK)
 *     STRIDE  = S_(ISSTRIDE)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(ISSTRIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_STRIDE, __pyx_t_4) < (0)) __PYX_ERR(39, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/IS.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class ISType(object):             # <<<<<<<<<<<<<<
 *     """The index set types."""
 *     GENERAL = S_(ISGENERAL)
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_ISType, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ISType, __pyx_t_4) < (0)) __PYX_ERR(39, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":24
 *     """
 * 
 *     Type = ISType             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ISType); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_14) < (0)) __PYX_ERR(39, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":45
 *     # 'with' statement (PEP 343)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         cdef _IS_buffer buf = _IS_buffer(self)
 *         self.set_attr('__buffer__', buf)
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_7__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS___enter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[227])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_enter, __pyx_t_14) < (0)) __PYX_ERR(39, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":50
 *         return buf.enter()
 * 
 *     def __exit__(self, *exc):             # <<<<<<<<<<<<<<
 *         cdef _IS_buffer buf = self.get_attr('__buffer__')
 *         self.set_attr('__buffer__', None)
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_9__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS___exit, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[228])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_exit, __pyx_t_14) < (0)) __PYX_ERR(39, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":56
 *     #
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """Display the index set.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(39, 56, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_11view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[229])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_13) < (0)) __PYX_ERR(39, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":75
 *         CHKERR(ISView(self.iset, cviewer))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the index set.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(39, 75, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_13destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[230])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_14) < (0)) __PYX_ERR(39, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":88
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an IS.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(39, 88, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(39, 88, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_15create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[231])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_13) < (0)) __PYX_ERR(39, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":109
 *         return self
 * 
 *     def setType(self, is_type: IS.Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the index set.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_is_type, __pyx_mstate_global->__pyx_kp_u_IS_Type_str) < (0)) __PYX_ERR(39, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(39, 109, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_17setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[232])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_14) < (0)) __PYX_ERR(39, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":128
 *         CHKERR(ISSetType(self.iset, cval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the index set type associated with the IS.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(39, 128, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_19getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[233])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_13) < (0)) __PYX_ERR(39, 128, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":142
 *         return bytes2str(cval)
 * 
 *     def createGeneral(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(39, 142, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(39, 142, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(39, 142, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_21createGeneral, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_createGeneral, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[234])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_createGeneral, __pyx_t_14) < (0)) __PYX_ERR(39, 142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":171
 *         return self
 * 
 *     def createBlock(             # <<<<<<<<<<<<<<
 *         self,
 *         bsize: int,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 171, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(39, 171, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(39, 171, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(39, 171, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_23createBlock, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_createBlock, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[235])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_createBlock, __pyx_t_13) < (0)) __PYX_ERR(39, 171, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":204
 *         return self
 * 
 *     def createStride(             # <<<<<<<<<<<<<<
 *         self,
 *         size: int,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 204, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_first, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 204, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_step, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 204, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(39, 204, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(39, 204, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_25createStride, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_createStride, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[236])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[38]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_createStride, __pyx_t_14) < (0)) __PYX_ERR(39, 204, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":239
 *         return self
 * 
 *     def duplicate(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Create a copy of the index set.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(39, 239, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_27duplicate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_duplicate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[237])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_duplicate, __pyx_t_13) < (0)) __PYX_ERR(39, 239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":253
 *         return iset
 * 
 *     def copy(self, IS result=None) -> IS:             # <<<<<<<<<<<<<<
 *         """Copy the contents of the index set into another.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(39, 253, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_29copy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_copy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[238])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_copy, __pyx_t_14) < (0)) __PYX_ERR(39, 253, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":281
 *         return result
 * 
 *     def load(self, Viewer viewer) -> Self:             # <<<<<<<<<<<<<<
 *         """Load a stored index set.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(39, 281, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_31load, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_load, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[239])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_load, __pyx_t_13) < (0)) __PYX_ERR(39, 281, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":304
 *         return self
 * 
 *     def allGather(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Concatenate index sets stored across processors.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(39, 304, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_33allGather, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_allGather, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[240])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_allGather, __pyx_t_14) < (0)) __PYX_ERR(39, 304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":320
 *         return iset
 * 
 *     def toGeneral(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Convert the index set type to `IS.Type.GENERAL`.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(39, 320, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_35toGeneral, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_toGeneral, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[241])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_toGeneral, __pyx_t_13) < (0)) __PYX_ERR(39, 320, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":333
 *         return self
 * 
 *     def buildTwoSided(self, IS toindx=None) -> IS:             # <<<<<<<<<<<<<<
 *         """Create an index set describing a global mapping.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(39, 333, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_37buildTwoSided, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_buildTwoSided, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[242])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_buildTwoSided, __pyx_t_14) < (0)) __PYX_ERR(39, 333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":363
 *         return result
 * 
 *     def invertPermutation(self, nlocal: int | None = None) -> IS:             # <<<<<<<<<<<<<<
 *         """Invert the index set.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_nlocal, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(39, 363, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(39, 363, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_39invertPermutation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_invertPermutation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[243])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_invertPermutation, __pyx_t_13) < (0)) __PYX_ERR(39, 363, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":387
 *         return iset
 * 
 *     def partitioningToNumbering(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the new global numbering after a partitioning.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(39, 387, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_41partitioningToNumbering, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_partitioningToNumbering, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[244])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_partitioningToNumbering, __pyx_t_14) < (0)) __PYX_ERR(39, 387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":404
 *         return iset
 * 
 *     def partitioningCount(self, npart: int | None = None) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the number of elements per process after a partitioning.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_npart, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(39, 404, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(39, 404, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_43partitioningCount, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_partitioningCount, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[245])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_partitioningCount, __pyx_t_13) < (0)) __PYX_ERR(39, 404, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":436
 *         return ocounts
 * 
 *     def getSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the global length of an index set.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 436, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_45getSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_getSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[246])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_getSize, __pyx_t_14) < (0)) __PYX_ERR(39, 436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":450
 *         return toInt(N)
 * 
 *     def getLocalSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the process-local length of the index set.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 450, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_47getLocalSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_getLocalSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[247])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_getLocalSize, __pyx_t_13) < (0)) __PYX_ERR(39, 450, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":464
 *         return toInt(n)
 * 
 *     def getSizes(self) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return the local and global sizes of the index set.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(39, 464, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_49getSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_getSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[248])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_getSizes, __pyx_t_14) < (0)) __PYX_ERR(39, 464, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":486
 *         return (toInt(n), toInt(N))
 * 
 *     def getBlockSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of elements in a block.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 486, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_51getBlockSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_getBlockSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[249])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_getBlockSize, __pyx_t_13) < (0)) __PYX_ERR(39, 486, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":500
 *         return toInt(bs)
 * 
 *     def setBlockSize(self, bs: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the block size of the index set.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_bs_2, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 500, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(39, 500, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_53setBlockSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_setBlockSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[250])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_setBlockSize, __pyx_t_14) < (0)) __PYX_ERR(39, 500, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":518
 *         CHKERR(ISSetBlockSize(self.iset, cbs))
 * 
 *     def sort(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Sort the indices of an index set.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(39, 518, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_55sort, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_sort, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[251])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_sort, __pyx_t_13) < (0)) __PYX_ERR(39, 518, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":531
 *         return self
 * 
 *     def isSorted(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the indices have been sorted.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(39, 531, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_57isSorted, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_isSorted, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[252])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_isSorted, __pyx_t_14) < (0)) __PYX_ERR(39, 531, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":545
 *         return toBool(flag)
 * 
 *     def setPermutation(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Mark the index set as being a permutation.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(39, 545, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_59setPermutation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_setPermutation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[253])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_setPermutation, __pyx_t_13) < (0)) __PYX_ERR(39, 545, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":558
 *         return self
 * 
 *     def isPermutation(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether an index set has been declared to be a permutation.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(39, 558, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_61isPermutation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_isPermutation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[254])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_isPermutation, __pyx_t_14) < (0)) __PYX_ERR(39, 558, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":572
 *         return toBool(flag)
 * 
 *     def setIdentity(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Mark the index set as being an identity.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(39, 572, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_63setIdentity, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_setIdentity, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[255])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_setIdentity, __pyx_t_13) < (0)) __PYX_ERR(39, 572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":585
 *         return self
 * 
 *     def isIdentity(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the index set has been declared as an identity.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(39, 585, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_65isIdentity, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_isIdentity, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[256])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_isIdentity, __pyx_t_14) < (0)) __PYX_ERR(39, 585, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":599
 *         return toBool(flag)
 * 
 *     def equal(self, IS iset) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the index sets have the same set of indices or not.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(39, 599, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_67equal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_equal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[257])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_equal, __pyx_t_13) < (0)) __PYX_ERR(39, 599, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":618
 *         return toBool(flag)
 * 
 *     def sum(self, IS iset) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the union of two (sorted) index sets.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(39, 618, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_69sum, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_sum, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[258])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_sum, __pyx_t_14) < (0)) __PYX_ERR(39, 618, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":637
 *         return out
 * 
 *     def expand(self, IS iset) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the union of two (possibly unsorted) index sets.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(39, 637, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_71expand, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_expand, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[259])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_expand, __pyx_t_13) < (0)) __PYX_ERR(39, 637, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":664
 *         return out
 * 
 *     def union(self, IS iset) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the union of two (possibly unsorted) index sets.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(39, 664, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_73union, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_union, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[260])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_union, __pyx_t_14) < (0)) __PYX_ERR(39, 664, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":699
 *         return out
 * 
 *     def intersect(self, IS iset: IS) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the intersection of two index sets.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_iset, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(39, 699, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(39, 699, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_75intersect, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_intersect, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[261])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_intersect, __pyx_t_13) < (0)) __PYX_ERR(39, 699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":723
 *         return out
 * 
 *     def difference(self, IS iset: IS) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the difference between two index sets.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_iset, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(39, 723, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(39, 723, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_77difference, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_difference, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[262])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_difference, __pyx_t_14) < (0)) __PYX_ERR(39, 723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":747
 *         return out
 * 
 *     def complement(self, nmin: int, nmax: int) -> IS:             # <<<<<<<<<<<<<<
 *         """Create a complement index set.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_nmin, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 747, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_nmax, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 747, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(39, 747, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_79complement, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_complement, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[263])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_complement, __pyx_t_13) < (0)) __PYX_ERR(39, 747, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":783
 *         return out
 * 
 *     def embed(self, IS iset, drop: bool) -> IS:             # <<<<<<<<<<<<<<
 *         """Embed ``self`` into ``iset``.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_drop, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(39, 783, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(39, 783, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_81embed, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_embed, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[264])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_embed, __pyx_t_14) < (0)) __PYX_ERR(39, 783, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":814
 *         return out
 * 
 *     def renumber(self, IS mult=None) -> tuple[int, IS]:             # <<<<<<<<<<<<<<
 *         """Renumber the non-negative entries of an index set, starting from 0.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_IS) < (0)) __PYX_ERR(39, 814, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_83renumber, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_renumber, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[265])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_renumber, __pyx_t_13) < (0)) __PYX_ERR(39, 814, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":845
 *     #
 * 
 *     def setIndices(self, indices: Sequence[int]) -> None:             # <<<<<<<<<<<<<<
 *         """Set the indices of an index set.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(39, 845, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(39, 845, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_85setIndices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_setIndices, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[266])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_setIndices, __pyx_t_14) < (0)) __PYX_ERR(39, 845, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":862
 *         CHKERR(ISGeneralSetIndices(self.iset, nidx, idx, cm))
 * 
 *     def getIndices(self) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the indices of the index set.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(39, 862, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_87getIndices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_getIndices, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[267])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_getIndices, __pyx_t_13) < (0)) __PYX_ERR(39, 862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":883
 *         return oindices
 * 
 *     def setBlockIndices(self, bsize: int, indices: Sequence[int]) -> None:             # <<<<<<<<<<<<<<
 *         """Set the indices for an index set with type `IS.Type.BLOCK`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 883, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(39, 883, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(39, 883, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_89setBlockIndices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_setBlockIndices, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[268])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_setBlockIndices, __pyx_t_14) < (0)) __PYX_ERR(39, 883, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":906
 *         CHKERR(ISBlockSetIndices(self.iset, bs, nidx, idx, cm))
 * 
 *     def getBlockIndices(self) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the indices of an index set with type `IS.Type.BLOCK`.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(39, 906, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_91getBlockIndices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_getBlockIndices, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[269])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_getBlockIndices, __pyx_t_13) < (0)) __PYX_ERR(39, 906, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":928
 *         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`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 928, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_first, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 928, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_step, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 928, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(39, 928, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_93setStride, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_setStride, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[270])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[39]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_setStride, __pyx_t_14) < (0)) __PYX_ERR(39, 928, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":952
 *         CHKERR(ISStrideSetStride(self.iset, csize, cfirst, cstep))
 * 
 *     def getStride(self) -> tuple[int, int, int]:             # <<<<<<<<<<<<<<
 *         """Return size and stride information.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int_int) < (0)) __PYX_ERR(39, 952, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_95getStride, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_getStride, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[271])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_getStride, __pyx_t_13) < (0)) __PYX_ERR(39, 952, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":976
 *         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`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(39, 976, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2IS_97getInfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_IS_getInfo, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[272])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_IS, __pyx_mstate_global->__pyx_n_u_getInfo, __pyx_t_14) < (0)) __PYX_ERR(39, 976, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":1124
 * 
 * 
 * class LGMapMapMode(object):             # <<<<<<<<<<<<<<
 *     """Enum describing mapping behavior when global indices are missing.
 * 
*/
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[41]); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_LGMapMapMode, __pyx_mstate_global->__pyx_n_u_LGMapMapMode, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Enum_describing_mapping_behavior); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 1124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_mstate_global->__pyx_tuple[41]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[41]) < 0))) __PYX_ERR(39, 1124, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/IS.pyx":1137
 * 
 *     """
 *     MASK = PETSC_IS_GTOLM_MASK             # <<<<<<<<<<<<<<
 *     DROP = PETSC_IS_GTOLM_DROP
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_ISGlobalToLocalMappingMode(IS_GTOLM_MASK); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MASK, __pyx_t_4) < (0)) __PYX_ERR(39, 1137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/IS.pyx":1138
 *     """
 *     MASK = PETSC_IS_GTOLM_MASK
 *     DROP = PETSC_IS_GTOLM_DROP             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_ISGlobalToLocalMappingMode(IS_GTOLM_DROP); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 1138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DROP, __pyx_t_4) < (0)) __PYX_ERR(39, 1138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/IS.pyx":1124
 * 
 * 
 * class LGMapMapMode(object):             # <<<<<<<<<<<<<<
 *     """Enum describing mapping behavior when global indices are missing.
 * 
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_LGMapMapMode, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 1124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LGMapMapMode, __pyx_t_4) < (0)) __PYX_ERR(39, 1124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":1141
 * 
 * 
 * class LGMapType(object):             # <<<<<<<<<<<<<<
 *     """Local to global map types."""
 *     BASIC = S_(ISLOCALTOGLOBALMAPPINGBASIC)
*/
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[43]); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_LGMapType, __pyx_mstate_global->__pyx_n_u_LGMapType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Local_to_global_map_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(39, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_mstate_global->__pyx_tuple[43]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[43]) < 0))) __PYX_ERR(39, 1141, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/IS.pyx":1143
 * class LGMapType(object):
 *     """Local to global map types."""
 *     BASIC = S_(ISLOCALTOGLOBALMAPPINGBASIC)             # <<<<<<<<<<<<<<
 *     HASH  = S_(ISLOCALTOGLOBALMAPPINGHASH)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(ISLOCALTOGLOBALMAPPINGBASIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BASIC, __pyx_t_4) < (0)) __PYX_ERR(39, 1143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/IS.pyx":1144
 *     """Local to global map types."""
 *     BASIC = S_(ISLOCALTOGLOBALMAPPINGBASIC)
 *     HASH  = S_(ISLOCALTOGLOBALMAPPINGHASH)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(ISLOCALTOGLOBALMAPPINGHASH); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HASH, __pyx_t_4) < (0)) __PYX_ERR(39, 1144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/IS.pyx":1141
 * 
 * 
 * class LGMapType(object):             # <<<<<<<<<<<<<<
 *     """Local to global map types."""
 *     BASIC = S_(ISLOCALTOGLOBALMAPPINGBASIC)
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_LGMapType, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(39, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_LGMapType, __pyx_t_4) < (0)) __PYX_ERR(39, 1141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":1158
 *     """
 * 
 *     MapMode = LGMapMapMode             # <<<<<<<<<<<<<<
 * 
 *     Type = LGMapType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_LGMapMapMode); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_MapMode, __pyx_t_14) < (0)) __PYX_ERR(39, 1158, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":1160
 *     MapMode = LGMapMapMode
 * 
 *     Type = LGMapType             # <<<<<<<<<<<<<<
 *     #
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_LGMapType); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_14) < (0)) __PYX_ERR(39, 1160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":1192
 *     #
 * 
 *     def setType(self, lgmap_type: LGMap.Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the local-to-global map.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_lgmap_type, __pyx_mstate_global->__pyx_kp_u_LGMap_Type_str) < (0)) __PYX_ERR(39, 1192, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(39, 1192, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_5setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[273])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_13) < (0)) __PYX_ERR(39, 1192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":1216
 *         CHKERR(ISLocalToGlobalMappingSetType(self.lgm, cval))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set mapping options from the options database.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(39, 1216, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_7setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[274])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_14) < (0)) __PYX_ERR(39, 1216, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":1228
 *         CHKERR(ISLocalToGlobalMappingSetFromOptions(self.lgm))
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the local-to-global mapping.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(39, 1228, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_9view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[275])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_13) < (0)) __PYX_ERR(39, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":1247
 *         CHKERR(ISLocalToGlobalMappingView(self.lgm, cviewer))
 * 
 *     def load(self, Viewer viewer) -> Self:             # <<<<<<<<<<<<<<
 *         """Load a local-to-global mapping.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(39, 1247, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_11load, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_load, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[276])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_load, __pyx_t_14) < (0)) __PYX_ERR(39, 1247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":1265
 *         return self
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the local-to-global mapping.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(39, 1265, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_13destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[277])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_13) < (0)) __PYX_ERR(39, 1265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":1278
 *         return self
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(39, 1278, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(39, 1278, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(39, 1278, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(39, 1278, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_15create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[278])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_14) < (0)) __PYX_ERR(39, 1278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":1313
 *         return self
 * 
 *     def createIS(self, IS iset) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a local-to-global mapping from an index set.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(39, 1313, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_17createIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_createIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[279])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_createIS, __pyx_t_13) < (0)) __PYX_ERR(39, 1313, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":1334
 *         return self
 * 
 *     def createSF(self, SF sf, start: int) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a local-to-global mapping from a star forest.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_start, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 1334, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(39, 1334, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_19createSF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_createSF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[280])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_createSF, __pyx_t_14) < (0)) __PYX_ERR(39, 1334, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":1357
 *         return self
 * 
 *     def getSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the local size of the local-to-global mapping.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 1357, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_21getSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_getSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[281])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_getSize, __pyx_t_13) < (0)) __PYX_ERR(39, 1357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":1371
 *         return toInt(n)
 * 
 *     def getBlockSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the block size of the local-to-global mapping.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(39, 1371, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_23getBlockSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_getBlockSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[282])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_getBlockSize, __pyx_t_14) < (0)) __PYX_ERR(39, 1371, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":1385
 *         return toInt(bs)
 * 
 *     def getIndices(self) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the global indices for each local point in the mapping.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(39, 1385, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_25getIndices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_getIndices, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[283])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_getIndices, __pyx_t_13) < (0)) __PYX_ERR(39, 1385, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":1409
 *         return oindices
 * 
 *     def getBlockIndices(self) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the global indices for each local block.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(39, 1409, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_27getBlockIndices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_getBlockIndices, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[284])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_getBlockIndices, __pyx_t_14) < (0)) __PYX_ERR(39, 1409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":1435
 *         return oindices
 * 
 *     def getInfo(self) -> dict[int, ArrayInt]:             # <<<<<<<<<<<<<<
 *         """Determine the indices shared with neighboring processes.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_dict_int_ArrayInt) < (0)) __PYX_ERR(39, 1435, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_29getInfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_getInfo, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[285])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_getInfo, __pyx_t_13) < (0)) __PYX_ERR(39, 1435, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":1464
 *         return neighs
 * 
 *     def getBlockInfo(self) -> dict[int, ArrayInt]:             # <<<<<<<<<<<<<<
 *         """Determine the block indices shared with neighboring processes.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_dict_int_ArrayInt) < (0)) __PYX_ERR(39, 1464, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_31getBlockInfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_getBlockInfo, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[286])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_getBlockInfo, __pyx_t_14) < (0)) __PYX_ERR(39, 1464, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":1495
 *     #
 * 
 *     def apply(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(39, 1495, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_result, __pyx_mstate_global->__pyx_kp_u_ArrayInt_None) < (0)) __PYX_ERR(39, 1495, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(39, 1495, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_33apply, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_apply, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[287])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_apply, __pyx_t_13) < (0)) __PYX_ERR(39, 1495, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":1532
 *         return result
 * 
 *     def applyBlock(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(39, 1532, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_result, __pyx_mstate_global->__pyx_kp_u_ArrayInt_None) < (0)) __PYX_ERR(39, 1532, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(39, 1532, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_35applyBlock, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_applyBlock, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[288])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_applyBlock, __pyx_t_14) < (0)) __PYX_ERR(39, 1532, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":1569
 *         return result
 * 
 *     def applyIS(self, IS iset) -> IS:             # <<<<<<<<<<<<<<
 *         """Create an index set with global numbering from a local numbering.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(39, 1569, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_37applyIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_applyIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[289])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_applyIS, __pyx_t_13) < (0)) __PYX_ERR(39, 1569, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":1594
 *         return result
 * 
 *     def applyInverse(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(39, 1594, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_kp_u_LGMap_MapMode_str_None) < (0)) __PYX_ERR(39, 1594, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(39, 1594, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_39applyInverse, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_applyInverse, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[290])); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_applyInverse, __pyx_t_14) < (0)) __PYX_ERR(39, 1594, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/IS.pyx":1633
 *         return result
 * 
 *     def applyBlockInverse(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(39, 1633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(39, 1633, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_kp_u_LGMap_MapMode_str_None) < (0)) __PYX_ERR(39, 1633, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(39, 1633, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5LGMap_41applyBlockInverse, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_LGMap_applyBlockInverse, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[291])); if (unlikely(!__pyx_t_13)) __PYX_ERR(39, 1633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_LGMap, __pyx_mstate_global->__pyx_n_u_applyBlockInverse, __pyx_t_13) < (0)) __PYX_ERR(39, 1633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/IS.pyx":1753
 * # --------------------------------------------------------------------
 * 
 * del ISType             # <<<<<<<<<<<<<<
 * del LGMapMapMode
 * del LGMapType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ISType) < (0)) __PYX_ERR(39, 1753, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1754
 * 
 * del ISType
 * del LGMapMapMode             # <<<<<<<<<<<<<<
 * del LGMapType
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_LGMapMapMode) < (0)) __PYX_ERR(39, 1754, __pyx_L1_error)

  /* "petsc4py/PETSc/IS.pyx":1755
 * del ISType
 * del LGMapMapMode
 * del LGMapType             # <<<<<<<<<<<<<<
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_LGMapType) < (0)) __PYX_ERR(39, 1755, __pyx_L1_error)

  /* "petsc4py/PETSc/SF.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class SFType(object):             # <<<<<<<<<<<<<<
 *     """The star forest types."""
 *     BASIC      = S_(PETSCSFBASIC)
*/
  __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[45]); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_14, __pyx_t_13, __pyx_mstate_global->__pyx_n_u_SFType, __pyx_mstate_global->__pyx_n_u_SFType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_star_forest_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(40, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_13 != __pyx_mstate_global->__pyx_tuple[45]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[45]) < 0))) __PYX_ERR(40, 3, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/SF.pyx":5
 * class SFType(object):
 *     """The star forest types."""
 *     BASIC      = S_(PETSCSFBASIC)             # <<<<<<<<<<<<<<
 *     NEIGHBOR   = S_(PETSCSFNEIGHBOR)
 *     ALLGATHERV = S_(PETSCSFALLGATHERV)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFBASIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BASIC, __pyx_t_4) < (0)) __PYX_ERR(40, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SF.pyx":6
 *     """The star forest types."""
 *     BASIC      = S_(PETSCSFBASIC)
 *     NEIGHBOR   = S_(PETSCSFNEIGHBOR)             # <<<<<<<<<<<<<<
 *     ALLGATHERV = S_(PETSCSFALLGATHERV)
 *     ALLGATHER  = S_(PETSCSFALLGATHER)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFNEIGHBOR); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NEIGHBOR, __pyx_t_4) < (0)) __PYX_ERR(40, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SF.pyx":7
 *     BASIC      = S_(PETSCSFBASIC)
 *     NEIGHBOR   = S_(PETSCSFNEIGHBOR)
 *     ALLGATHERV = S_(PETSCSFALLGATHERV)             # <<<<<<<<<<<<<<
 *     ALLGATHER  = S_(PETSCSFALLGATHER)
 *     GATHERV    = S_(PETSCSFGATHERV)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLGATHERV); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ALLGATHERV, __pyx_t_4) < (0)) __PYX_ERR(40, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SF.pyx":8
 *     NEIGHBOR   = S_(PETSCSFNEIGHBOR)
 *     ALLGATHERV = S_(PETSCSFALLGATHERV)
 *     ALLGATHER  = S_(PETSCSFALLGATHER)             # <<<<<<<<<<<<<<
 *     GATHERV    = S_(PETSCSFGATHERV)
 *     GATHER     = S_(PETSCSFGATHER)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLGATHER); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ALLGATHER, __pyx_t_4) < (0)) __PYX_ERR(40, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SF.pyx":9
 *     ALLGATHERV = S_(PETSCSFALLGATHERV)
 *     ALLGATHER  = S_(PETSCSFALLGATHER)
 *     GATHERV    = S_(PETSCSFGATHERV)             # <<<<<<<<<<<<<<
 *     GATHER     = S_(PETSCSFGATHER)
 *     ALLTOALL   = S_(PETSCSFALLTOALL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFGATHERV); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_GATHERV, __pyx_t_4) < (0)) __PYX_ERR(40, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SF.pyx":10
 *     ALLGATHER  = S_(PETSCSFALLGATHER)
 *     GATHERV    = S_(PETSCSFGATHERV)
 *     GATHER     = S_(PETSCSFGATHER)             # <<<<<<<<<<<<<<
 *     ALLTOALL   = S_(PETSCSFALLTOALL)
 *     WINDOW     = S_(PETSCSFWINDOW)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFGATHER); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_GATHER, __pyx_t_4) < (0)) __PYX_ERR(40, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SF.pyx":11
 *     GATHERV    = S_(PETSCSFGATHERV)
 *     GATHER     = S_(PETSCSFGATHER)
 *     ALLTOALL   = S_(PETSCSFALLTOALL)             # <<<<<<<<<<<<<<
 *     WINDOW     = S_(PETSCSFWINDOW)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLTOALL); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ALLTOALL, __pyx_t_4) < (0)) __PYX_ERR(40, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SF.pyx":12
 *     GATHER     = S_(PETSCSFGATHER)
 *     ALLTOALL   = S_(PETSCSFALLTOALL)
 *     WINDOW     = S_(PETSCSFWINDOW)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFWINDOW); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_WINDOW, __pyx_t_4) < (0)) __PYX_ERR(40, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SF.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class SFType(object):             # <<<<<<<<<<<<<<
 *     """The star forest types."""
 *     BASIC      = S_(PETSCSFBASIC)
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_SFType, __pyx_t_13, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(40, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SFType, __pyx_t_4) < (0)) __PYX_ERR(40, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/SF.pyx":25
 *     """
 * 
 *     Type = SFType             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_SFType); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_13) < (0)) __PYX_ERR(40, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/SF.pyx":31
 *         self.sf  = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View a star forest.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 31, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_3view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[292])); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_14) < (0)) __PYX_ERR(40, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SF.pyx":50
 *         CHKERR(PetscSFView(self.sf, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the star forest.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(40, 50, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[293])); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_13) < (0)) __PYX_ERR(40, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/SF.pyx":63
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a star forest communication context.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(40, 63, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(40, 63, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_7create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[294])); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_14) < (0)) __PYX_ERR(40, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SF.pyx":84
 *         return self
 * 
 *     def setType(self, sf_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the star forest.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_sf_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(40, 84, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 84, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_9setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[295])); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_13) < (0)) __PYX_ERR(40, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/SF.pyx":103
 *         CHKERR(PetscSFSetType(self.sf, cval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type name of the star forest.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(40, 103, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_11getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[296])); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_14) < (0)) __PYX_ERR(40, 103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SF.pyx":117
 *         return bytes2str(cval)
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set options using the options database.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 117, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_13setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[297])); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_13) < (0)) __PYX_ERR(40, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/SF.pyx":129
 *         CHKERR(PetscSFSetFromOptions(self.sf))
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up communication structures.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 129, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_15setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[298])); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_14) < (0)) __PYX_ERR(40, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SF.pyx":141
 *         CHKERR(PetscSFSetUp(self.sf))
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         """Reset a star forest so that different sizes or neighbors can be used.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 141, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_17reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_reset, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[299])); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_13) < (0)) __PYX_ERR(40, 141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/SF.pyx":155
 *     #
 * 
 *     def getGraph(self) -> tuple[int, ArrayInt, ArrayInt]:             # <<<<<<<<<<<<<<
 *         """Return star forest graph.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_ArrayInt_ArrayInt) < (0)) __PYX_ERR(40, 155, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_19getGraph, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_getGraph, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[300])); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_getGraph, __pyx_t_14) < (0)) __PYX_ERR(40, 155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SF.pyx":190
 *         return toInt(nroots), local, remote
 * 
 *     def setGraph(self, nroots: int, local: Sequence[int], remote: Sequence[int]) -> None:             # <<<<<<<<<<<<<<
 *         """Set star forest graph.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_nroots, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(40, 190, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_local, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(40, 190, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_remote, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(40, 190, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 190, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_21setGraph, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_setGraph, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[301])); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_setGraph, __pyx_t_13) < (0)) __PYX_ERR(40, 190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/SF.pyx":229
 *         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.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(40, 229, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 229, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_23setRankOrder, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_setRankOrder, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[302])); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_setRankOrder, __pyx_t_14) < (0)) __PYX_ERR(40, 229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SF.pyx":247
 *         CHKERR(PetscSFSetRankOrder(self.sf, bval))
 * 
 *     def getMulti(self) -> SF:             # <<<<<<<<<<<<<<
 *         """Return the inner SF implementing gathers and scatters.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SF) < (0)) __PYX_ERR(40, 247, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_25getMulti, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_getMulti, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[303])); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_getMulti, __pyx_t_13) < (0)) __PYX_ERR(40, 247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/SF.pyx":262
 *         return sf
 * 
 *     def createInverse(self) -> SF:             # <<<<<<<<<<<<<<
 *         """Create the inverse map.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SF) < (0)) __PYX_ERR(40, 262, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_27createInverse, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_createInverse, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[304])); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_createInverse, __pyx_t_14) < (0)) __PYX_ERR(40, 262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SF.pyx":279
 *         return sf
 * 
 *     def computeDegree(self) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Compute and return the degree of each root vertex.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(40, 279, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_29computeDegree, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_computeDegree, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[305])); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_computeDegree, __pyx_t_13) < (0)) __PYX_ERR(40, 279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/SF.pyx":297
 *         return degree
 * 
 *     def createEmbeddedRootSF(self, selected: Sequence[int]) -> SF:             # <<<<<<<<<<<<<<
 *         """Remove edges from all but the selected roots.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_selected, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(40, 297, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SF) < (0)) __PYX_ERR(40, 297, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_31createEmbeddedRootSF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_createEmbeddedRootSF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[306])); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_createEmbeddedRootSF, __pyx_t_14) < (0)) __PYX_ERR(40, 297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SF.pyx":321
 *         return sf
 * 
 *     def createEmbeddedLeafSF(self, selected: Sequence[int]) -> SF:             # <<<<<<<<<<<<<<
 *         """Remove edges from all but the selected leaves.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_selected, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(40, 321, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SF) < (0)) __PYX_ERR(40, 321, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_33createEmbeddedLeafSF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_createEmbeddedLeafSF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[307])); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_createEmbeddedLeafSF, __pyx_t_13) < (0)) __PYX_ERR(40, 321, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/SF.pyx":345
 *         return sf
 * 
 *     def createSectionSF(self, Section rootSection, remoteOffsets: Sequence[int] | None, Section leafSection) -> SF:             # <<<<<<<<<<<<<<
 *         """Create an expanded `SF` of DOFs.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_remoteOffsets, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(40, 345, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SF) < (0)) __PYX_ERR(40, 345, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_35createSectionSF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_createSectionSF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[308])); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_createSectionSF, __pyx_t_14) < (0)) __PYX_ERR(40, 345, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SF.pyx":378
 *         return sectionSF
 * 
 *     def distributeSection(self, Section rootSection, Section leafSection=None) -> tuple[ArrayInt, Section]:             # <<<<<<<<<<<<<<
 *         """Create a new, reorganized `Section`.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_ArrayInt_Section) < (0)) __PYX_ERR(40, 378, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_37distributeSection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_distributeSection, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[309])); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_distributeSection, __pyx_t_13) < (0)) __PYX_ERR(40, 378, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/SF.pyx":413
 *         return (remoteOffsets, leafSection)
 * 
 *     def compose(self, SF sf) -> SF:             # <<<<<<<<<<<<<<
 *         """Compose a new `SF`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SF) < (0)) __PYX_ERR(40, 413, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_39compose, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_compose, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[310])); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_compose, __pyx_t_14) < (0)) __PYX_ERR(40, 413, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SF.pyx":434
 *         return csf
 * 
 *     def bcastBegin(self, unit: Datatype, ndarray rootdata, ndarray leafdata, op: Op) -> None:             # <<<<<<<<<<<<<<
 *         """Begin pointwise broadcast.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_unit, __pyx_mstate_global->__pyx_n_u_Datatype) < (0)) __PYX_ERR(40, 434, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_op, __pyx_mstate_global->__pyx_n_u_Op) < (0)) __PYX_ERR(40, 434, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 434, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_41bcastBegin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_bcastBegin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[311])); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_bcastBegin, __pyx_t_13) < (0)) __PYX_ERR(40, 434, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/SF.pyx":463
 *                                  <void*>PyArray_DATA(leafdata), cop))
 * 
 *     def bcastEnd(self, unit: Datatype, ndarray rootdata, ndarray leafdata, op: Op) -> None:             # <<<<<<<<<<<<<<
 *         """End a broadcast & reduce operation started with `bcastBegin`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_unit, __pyx_mstate_global->__pyx_n_u_Datatype) < (0)) __PYX_ERR(40, 463, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_op, __pyx_mstate_global->__pyx_n_u_Op) < (0)) __PYX_ERR(40, 463, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 463, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_43bcastEnd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_bcastEnd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[312])); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 463, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_bcastEnd, __pyx_t_14) < (0)) __PYX_ERR(40, 463, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SF.pyx":489
 *                                <void*>PyArray_DATA(leafdata), cop))
 * 
 *     def reduceBegin(self, unit: Datatype, ndarray leafdata, ndarray rootdata, op: Op) -> None:             # <<<<<<<<<<<<<<
 *         """Begin reduction of leafdata into rootdata.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_unit, __pyx_mstate_global->__pyx_n_u_Datatype) < (0)) __PYX_ERR(40, 489, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_op, __pyx_mstate_global->__pyx_n_u_Op) < (0)) __PYX_ERR(40, 489, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 489, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_45reduceBegin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_reduceBegin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[313])); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_reduceBegin, __pyx_t_13) < (0)) __PYX_ERR(40, 489, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/SF.pyx":517
 *                                   <void*>PyArray_DATA(rootdata), cop))
 * 
 *     def reduceEnd(self, unit: Datatype, ndarray leafdata, ndarray rootdata, op: Op) -> None:             # <<<<<<<<<<<<<<
 *         """End a reduction operation started with `reduceBegin`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_unit, __pyx_mstate_global->__pyx_n_u_Datatype) < (0)) __PYX_ERR(40, 517, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_op, __pyx_mstate_global->__pyx_n_u_Op) < (0)) __PYX_ERR(40, 517, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 517, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_47reduceEnd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_reduceEnd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[314])); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_reduceEnd, __pyx_t_14) < (0)) __PYX_ERR(40, 517, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SF.pyx":543
 *                                 <void*>PyArray_DATA(rootdata), cop))
 * 
 *     def scatterBegin(self, unit: Datatype, ndarray multirootdata, ndarray leafdata) -> None:             # <<<<<<<<<<<<<<
 *         """Begin pointwise scatter operation.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_unit, __pyx_mstate_global->__pyx_n_u_Datatype) < (0)) __PYX_ERR(40, 543, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 543, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_49scatterBegin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_scatterBegin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[315])); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_scatterBegin, __pyx_t_13) < (0)) __PYX_ERR(40, 543, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/SF.pyx":569
 *                                    <void*>PyArray_DATA(leafdata)))
 * 
 *     def scatterEnd(self, unit: Datatype, ndarray multirootdata, ndarray leafdata) -> None:             # <<<<<<<<<<<<<<
 *         """End scatter operation that was started with `scatterBegin`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_unit, __pyx_mstate_global->__pyx_n_u_Datatype) < (0)) __PYX_ERR(40, 569, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 569, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_51scatterEnd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_scatterEnd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[316])); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_scatterEnd, __pyx_t_14) < (0)) __PYX_ERR(40, 569, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SF.pyx":592
 *                                  <void*>PyArray_DATA(leafdata)))
 * 
 *     def gatherBegin(self, unit: Datatype, ndarray leafdata, ndarray multirootdata) -> None:             # <<<<<<<<<<<<<<
 *         """Begin pointwise gather of all leaves into multi-roots.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_unit, __pyx_mstate_global->__pyx_n_u_Datatype) < (0)) __PYX_ERR(40, 592, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 592, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_53gatherBegin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_gatherBegin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[317])); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_gatherBegin, __pyx_t_13) < (0)) __PYX_ERR(40, 592, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/SF.pyx":618
 *                                   <void*>PyArray_DATA(multirootdata)))
 * 
 *     def gatherEnd(self, unit: Datatype, ndarray leafdata, ndarray multirootdata) -> None:             # <<<<<<<<<<<<<<
 *         """End gather operation that was started with `gatherBegin`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_unit, __pyx_mstate_global->__pyx_n_u_Datatype) < (0)) __PYX_ERR(40, 618, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 618, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_55gatherEnd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_gatherEnd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[318])); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_gatherEnd, __pyx_t_14) < (0)) __PYX_ERR(40, 618, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SF.pyx":642
 *                                 <void*>PyArray_DATA(multirootdata)))
 * 
 *     def fetchAndOpBegin(self, unit: Datatype, rootdata: ndarray, leafdata: ndarray, leafupdate: ndarray, op: Op) -> None:             # <<<<<<<<<<<<<<
 *         """Begin fetch and update operation.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_unit, __pyx_mstate_global->__pyx_n_u_Datatype) < (0)) __PYX_ERR(40, 642, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_rootdata, __pyx_mstate_global->__pyx_n_u_ndarray) < (0)) __PYX_ERR(40, 642, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_leafdata, __pyx_mstate_global->__pyx_n_u_ndarray) < (0)) __PYX_ERR(40, 642, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_leafupdate, __pyx_mstate_global->__pyx_n_u_ndarray) < (0)) __PYX_ERR(40, 642, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_op, __pyx_mstate_global->__pyx_n_u_Op) < (0)) __PYX_ERR(40, 642, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 642, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_57fetchAndOpBegin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_fetchAndOpBegin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[319])); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_fetchAndOpBegin, __pyx_t_13) < (0)) __PYX_ERR(40, 642, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/SF.pyx":678
 *                                       <void*>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`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_13)) __PYX_ERR(40, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_unit, __pyx_mstate_global->__pyx_n_u_Datatype) < (0)) __PYX_ERR(40, 678, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_rootdata, __pyx_mstate_global->__pyx_n_u_ndarray) < (0)) __PYX_ERR(40, 678, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_leafdata, __pyx_mstate_global->__pyx_n_u_ndarray) < (0)) __PYX_ERR(40, 678, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_leafupdate, __pyx_mstate_global->__pyx_n_u_ndarray) < (0)) __PYX_ERR(40, 678, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_op, __pyx_mstate_global->__pyx_n_u_Op) < (0)) __PYX_ERR(40, 678, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(40, 678, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2SF_59fetchAndOpEnd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SF_fetchAndOpEnd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[320])); if (unlikely(!__pyx_t_14)) __PYX_ERR(40, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SF, __pyx_mstate_global->__pyx_n_u_fetchAndOpEnd, __pyx_t_14) < (0)) __PYX_ERR(40, 678, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SF.pyx":711
 * # --------------------------------------------------------------------
 * 
 * del SFType             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SFType) < (0)) __PYX_ERR(40, 711, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class VecType(object):             # <<<<<<<<<<<<<<
 *     """The vector type."""
 *     SEQ        = S_(VECSEQ)
*/
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[47]); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_VecType, __pyx_mstate_global->__pyx_n_u_VecType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_vector_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_mstate_global->__pyx_tuple[47]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[47]) < 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_4 = __pyx_f_8petsc4py_5PETSc_S_(VECSEQ); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQ, __pyx_t_4) < (0)) __PYX_ERR(41, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":6
 *     """The vector type."""
 *     SEQ        = S_(VECSEQ)
 *     MPI        = S_(VECMPI)             # <<<<<<<<<<<<<<
 *     STANDARD   = S_(VECSTANDARD)
 *     SHARED     = S_(VECSHARED)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(VECMPI); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPI, __pyx_t_4) < (0)) __PYX_ERR(41, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":7
 *     SEQ        = S_(VECSEQ)
 *     MPI        = S_(VECMPI)
 *     STANDARD   = S_(VECSTANDARD)             # <<<<<<<<<<<<<<
 *     SHARED     = S_(VECSHARED)
 *     SEQVIENNACL= S_(VECSEQVIENNACL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(VECSTANDARD); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_STANDARD, __pyx_t_4) < (0)) __PYX_ERR(41, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":8
 *     MPI        = S_(VECMPI)
 *     STANDARD   = S_(VECSTANDARD)
 *     SHARED     = S_(VECSHARED)             # <<<<<<<<<<<<<<
 *     SEQVIENNACL= S_(VECSEQVIENNACL)
 *     MPIVIENNACL= S_(VECMPIVIENNACL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(VECSHARED); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SHARED, __pyx_t_4) < (0)) __PYX_ERR(41, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":9
 *     STANDARD   = S_(VECSTANDARD)
 *     SHARED     = S_(VECSHARED)
 *     SEQVIENNACL= S_(VECSEQVIENNACL)             # <<<<<<<<<<<<<<
 *     MPIVIENNACL= S_(VECMPIVIENNACL)
 *     VIENNACL   = S_(VECVIENNACL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(VECSEQVIENNACL); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQVIENNACL, __pyx_t_4) < (0)) __PYX_ERR(41, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":10
 *     SHARED     = S_(VECSHARED)
 *     SEQVIENNACL= S_(VECSEQVIENNACL)
 *     MPIVIENNACL= S_(VECMPIVIENNACL)             # <<<<<<<<<<<<<<
 *     VIENNACL   = S_(VECVIENNACL)
 *     SEQCUDA    = S_(VECSEQCUDA)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(VECMPIVIENNACL); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIVIENNACL, __pyx_t_4) < (0)) __PYX_ERR(41, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":11
 *     SEQVIENNACL= S_(VECSEQVIENNACL)
 *     MPIVIENNACL= S_(VECMPIVIENNACL)
 *     VIENNACL   = S_(VECVIENNACL)             # <<<<<<<<<<<<<<
 *     SEQCUDA    = S_(VECSEQCUDA)
 *     MPICUDA    = S_(VECMPICUDA)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(VECVIENNACL); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_VIENNACL, __pyx_t_4) < (0)) __PYX_ERR(41, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":12
 *     MPIVIENNACL= S_(VECMPIVIENNACL)
 *     VIENNACL   = S_(VECVIENNACL)
 *     SEQCUDA    = S_(VECSEQCUDA)             # <<<<<<<<<<<<<<
 *     MPICUDA    = S_(VECMPICUDA)
 *     CUDA       = S_(VECCUDA)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(VECSEQCUDA); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQCUDA, __pyx_t_4) < (0)) __PYX_ERR(41, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":13
 *     VIENNACL   = S_(VECVIENNACL)
 *     SEQCUDA    = S_(VECSEQCUDA)
 *     MPICUDA    = S_(VECMPICUDA)             # <<<<<<<<<<<<<<
 *     CUDA       = S_(VECCUDA)
 *     SEQHIP     = S_(VECSEQHIP)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(VECMPICUDA); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPICUDA, __pyx_t_4) < (0)) __PYX_ERR(41, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":14
 *     SEQCUDA    = S_(VECSEQCUDA)
 *     MPICUDA    = S_(VECMPICUDA)
 *     CUDA       = S_(VECCUDA)             # <<<<<<<<<<<<<<
 *     SEQHIP     = S_(VECSEQHIP)
 *     MPIHIP     = S_(VECMPIHIP)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(VECCUDA); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CUDA, __pyx_t_4) < (0)) __PYX_ERR(41, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":15
 *     MPICUDA    = S_(VECMPICUDA)
 *     CUDA       = S_(VECCUDA)
 *     SEQHIP     = S_(VECSEQHIP)             # <<<<<<<<<<<<<<
 *     MPIHIP     = S_(VECMPIHIP)
 *     HIP        = S_(VECHIP)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(VECSEQHIP); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQHIP, __pyx_t_4) < (0)) __PYX_ERR(41, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":16
 *     CUDA       = S_(VECCUDA)
 *     SEQHIP     = S_(VECSEQHIP)
 *     MPIHIP     = S_(VECMPIHIP)             # <<<<<<<<<<<<<<
 *     HIP        = S_(VECHIP)
 *     NEST       = S_(VECNEST)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(VECMPIHIP); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIHIP, __pyx_t_4) < (0)) __PYX_ERR(41, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":17
 *     SEQHIP     = S_(VECSEQHIP)
 *     MPIHIP     = S_(VECMPIHIP)
 *     HIP        = S_(VECHIP)             # <<<<<<<<<<<<<<
 *     NEST       = S_(VECNEST)
 *     SEQKOKKOS  = S_(VECSEQKOKKOS)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(VECHIP); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HIP, __pyx_t_4) < (0)) __PYX_ERR(41, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":18
 *     MPIHIP     = S_(VECMPIHIP)
 *     HIP        = S_(VECHIP)
 *     NEST       = S_(VECNEST)             # <<<<<<<<<<<<<<
 *     SEQKOKKOS  = S_(VECSEQKOKKOS)
 *     MPIKOKKOS  = S_(VECMPIKOKKOS)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(VECNEST); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NEST, __pyx_t_4) < (0)) __PYX_ERR(41, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":19
 *     HIP        = S_(VECHIP)
 *     NEST       = S_(VECNEST)
 *     SEQKOKKOS  = S_(VECSEQKOKKOS)             # <<<<<<<<<<<<<<
 *     MPIKOKKOS  = S_(VECMPIKOKKOS)
 *     KOKKOS     = S_(VECKOKKOS)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(VECSEQKOKKOS); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQKOKKOS, __pyx_t_4) < (0)) __PYX_ERR(41, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":20
 *     NEST       = S_(VECNEST)
 *     SEQKOKKOS  = S_(VECSEQKOKKOS)
 *     MPIKOKKOS  = S_(VECMPIKOKKOS)             # <<<<<<<<<<<<<<
 *     KOKKOS     = S_(VECKOKKOS)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(VECMPIKOKKOS); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIKOKKOS, __pyx_t_4) < (0)) __PYX_ERR(41, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":21
 *     SEQKOKKOS  = S_(VECSEQKOKKOS)
 *     MPIKOKKOS  = S_(VECMPIKOKKOS)
 *     KOKKOS     = S_(VECKOKKOS)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(VECKOKKOS); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_KOKKOS, __pyx_t_4) < (0)) __PYX_ERR(41, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class VecType(object):             # <<<<<<<<<<<<<<
 *     """The vector type."""
 *     SEQ        = S_(VECSEQ)
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_VecType, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VecType, __pyx_t_4) < (0)) __PYX_ERR(41, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":24
 * 
 * 
 * class VecOption(object):             # <<<<<<<<<<<<<<
 *     """Vector assembly option."""
 *     IGNORE_OFF_PROC_ENTRIES = VEC_IGNORE_OFF_PROC_ENTRIES
*/
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[49]); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_VecOption, __pyx_mstate_global->__pyx_n_u_VecOption, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Vector_assembly_option); if (unlikely(!__pyx_t_5)) __PYX_ERR(41, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_mstate_global->__pyx_tuple[49]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[49]) < 0))) __PYX_ERR(41, 24, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Vec.pyx":26
 * class VecOption(object):
 *     """Vector assembly option."""
 *     IGNORE_OFF_PROC_ENTRIES = VEC_IGNORE_OFF_PROC_ENTRIES             # <<<<<<<<<<<<<<
 *     IGNORE_NEGATIVE_INDICES = VEC_IGNORE_NEGATIVE_INDICES
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_VecOption(VEC_IGNORE_OFF_PROC_ENTRIES); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_IGNORE_OFF_PROC_ENTRIES, __pyx_t_4) < (0)) __PYX_ERR(41, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":27
 *     """Vector assembly option."""
 *     IGNORE_OFF_PROC_ENTRIES = VEC_IGNORE_OFF_PROC_ENTRIES
 *     IGNORE_NEGATIVE_INDICES = VEC_IGNORE_NEGATIVE_INDICES             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_4 = __Pyx_PyLong_From_VecOption(VEC_IGNORE_NEGATIVE_INDICES); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_IGNORE_NEGATIVE_INDICES, __pyx_t_4) < (0)) __PYX_ERR(41, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Vec.pyx":24
 * 
 * 
 * class VecOption(object):             # <<<<<<<<<<<<<<
 *     """Vector assembly option."""
 *     IGNORE_OFF_PROC_ENTRIES = VEC_IGNORE_OFF_PROC_ENTRIES
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_VecOption, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(41, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_VecOption, __pyx_t_4) < (0)) __PYX_ERR(41, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":41
 *     """
 * 
 *     Type = VecType             # <<<<<<<<<<<<<<
 *     Option = VecOption
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_VecType); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_14) < (0)) __PYX_ERR(41, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":42
 * 
 *     Type = VecType
 *     Option = VecOption             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_VecOption); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_Option, __pyx_t_14) < (0)) __PYX_ERR(41, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":72
 *         return vec_imul(self, other)
 * 
 *     def __idiv__(self, other):             # <<<<<<<<<<<<<<
 *         return vec_idiv(self, other)
 * 
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_15__idiv__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec___idiv, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[321])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_idiv, __pyx_t_14) < (0)) __PYX_ERR(41, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":98
 *         return vec_rmul(self, other)
 * 
 *     def __div__(self, other):             # <<<<<<<<<<<<<<
 *         return vec_div(self, other)
 * 
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_31__div__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec___div, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[322])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_div_2, __pyx_t_14) < (0)) __PYX_ERR(41, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":101
 *         return vec_div(self, other)
 * 
 *     def __rdiv__(self, other):             # <<<<<<<<<<<<<<
 *         return vec_rdiv(self, other)
 * 
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_33__rdiv__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec___rdiv, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[323])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_rdiv, __pyx_t_14) < (0)) __PYX_ERR(41, 101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":132
 *     # 'with' statement (PEP 343)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         cdef _Vec_buffer buf = _Vec_buffer(self)
 *         self.set_attr('__buffer__', buf)
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_49__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec___enter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[324])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_enter, __pyx_t_14) < (0)) __PYX_ERR(41, 132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":137
 *         return buf.enter()
 * 
 *     def __exit__(self, *exc):             # <<<<<<<<<<<<<<
 *         cdef _Vec_buffer buf = self.get_attr('__buffer__')
 *         self.set_attr('__buffer__', None)
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_51__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec___exit, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[325])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_exit, __pyx_t_14) < (0)) __PYX_ERR(41, 137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":144
 *     #
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """Display the vector.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 144, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_53view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[326])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_13) < (0)) __PYX_ERR(41, 144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":163
 *         CHKERR(VecView(self.vec, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the vector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 163, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_55destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[327])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_14) < (0)) __PYX_ERR(41, 163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":176
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a vector object.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(41, 176, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 176, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_57create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[328])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_13) < (0)) __PYX_ERR(41, 176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":199
 *         return self
 * 
 *     def setType(self, vec_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the vector type.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_vec_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(41, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 199, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_59setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[329])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_14) < (0)) __PYX_ERR(41, 199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":218
 *         CHKERR(VecSetType(self.vec, cval))
 * 
 *     def setSizes(             # <<<<<<<<<<<<<<
 *         self,
 *         size: LayoutSizeSpec,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_LayoutSizeSpec) < (0)) __PYX_ERR(41, 218, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(41, 218, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 218, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_61setSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[330])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setSizes, __pyx_t_13) < (0)) __PYX_ERR(41, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":247
 * 
 *     # FIXME the comm argument is hideous.
 *     def createSeq(             # <<<<<<<<<<<<<<
 *         self,
 *         size: LayoutSizeSpec,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_LayoutSizeSpec) < (0)) __PYX_ERR(41, 247, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(41, 247, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(41, 247, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 247, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_63createSeq, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_createSeq, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[331])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_createSeq, __pyx_t_14) < (0)) __PYX_ERR(41, 247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":283
 *         return self
 * 
 *     def createMPI(             # <<<<<<<<<<<<<<
 *         self,
 *         size: LayoutSizeSpec,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_LayoutSizeSpec) < (0)) __PYX_ERR(41, 283, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(41, 283, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(41, 283, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 283, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_65createMPI, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_createMPI, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[332])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_createMPI, __pyx_t_13) < (0)) __PYX_ERR(41, 283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":319
 *         return self
 * 
 *     def createWithArray(             # <<<<<<<<<<<<<<
 *         self,
 *         array: Sequence[Scalar],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_array, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(41, 319, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_kp_u_LayoutSizeSpec_None) < (0)) __PYX_ERR(41, 319, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(41, 319, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(41, 319, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 319, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_67createWithArray, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_createWithArray, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[333])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_createWithArray, __pyx_t_14) < (0)) __PYX_ERR(41, 319, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":370
 *         return self
 * 
 *     def createCUDAWithArrays(             # <<<<<<<<<<<<<<
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_cpuarray, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar_None) < (0)) __PYX_ERR(41, 370, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_cudahandle, __pyx_mstate_global->__pyx_kp_u_Any_None) < (0)) __PYX_ERR(41, 370, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_kp_u_LayoutSizeSpec_None) < (0)) __PYX_ERR(41, 370, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(41, 370, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(41, 370, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 370, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_69createCUDAWithArrays, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_createCUDAWithArrays, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[334])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[30]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_createCUDAWithArrays, __pyx_t_13) < (0)) __PYX_ERR(41, 370, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":428
 *         return self
 * 
 *     def createHIPWithArrays(             # <<<<<<<<<<<<<<
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_cpuarray, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar_None) < (0)) __PYX_ERR(41, 428, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_hiphandle, __pyx_mstate_global->__pyx_kp_u_Any_None) < (0)) __PYX_ERR(41, 428, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_kp_u_LayoutSizeSpec_None) < (0)) __PYX_ERR(41, 428, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(41, 428, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(41, 428, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 428, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_71createHIPWithArrays, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_createHIPWithArrays, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[335])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[30]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_createHIPWithArrays, __pyx_t_14) < (0)) __PYX_ERR(41, 428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":486
 *         return self
 * 
 *     def createViennaCLWithArrays(             # <<<<<<<<<<<<<<
 *         self,
 *         cpuarray: Sequence[Scalar] | None = None,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_cpuarray, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar_None) < (0)) __PYX_ERR(41, 486, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_viennaclvechandle, __pyx_mstate_global->__pyx_kp_u_Any_None) < (0)) __PYX_ERR(41, 486, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_kp_u_LayoutSizeSpec_None) < (0)) __PYX_ERR(41, 486, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(41, 486, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(41, 486, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 486, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_73createViennaCLWithArrays, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_createViennaCLWithArrays, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[336])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[30]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_createViennaCLWithArrays, __pyx_t_13) < (0)) __PYX_ERR(41, 486, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":545
 * 
 *     # FIXME: object? Do we need to specify it? Can't we just use Any?
 *     def createWithDLPack(             # <<<<<<<<<<<<<<
 *         self,
 *         object dltensor,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_kp_u_LayoutSizeSpec_None) < (0)) __PYX_ERR(41, 545, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(41, 545, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(41, 545, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 545, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_75createWithDLPack, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_createWithDLPack, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[337])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_createWithDLPack, __pyx_t_14) < (0)) __PYX_ERR(41, 545, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":643
 *         return self
 * 
 *     def attachDLPackInfo(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec vec=None,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 643, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_77attachDLPackInfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_attachDLPackInfo, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[338])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_attachDLPackInfo, __pyx_t_13) < (0)) __PYX_ERR(41, 643, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":705
 *         return self
 * 
 *     def clearDLPackInfo(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Clear tensor information.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 705, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_79clearDLPackInfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_clearDLPackInfo, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[339])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_clearDLPackInfo, __pyx_t_14) < (0)) __PYX_ERR(41, 705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":719
 * 
 *     # TODO Stream
 *     def __dlpack__(self, stream=-1):             # <<<<<<<<<<<<<<
 *         return self.toDLPack('rw')
 * 
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_81__dlpack__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec___dlpack, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[340])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[0]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_dlpack, __pyx_t_14) < (0)) __PYX_ERR(41, 719, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":722
 *         return self.toDLPack('rw')
 * 
 *     def __dlpack_device__(self):             # <<<<<<<<<<<<<<
 *         (dltype, devId, _, _, _) = vec_get_dlpack_ctx(self)
 *         return (dltype, devId)
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_83__dlpack_device__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec___dlpack_device, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[341])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_dlpack_device, __pyx_t_14) < (0)) __PYX_ERR(41, 722, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":726
 *         return (dltype, devId)
 * 
 *     def toDLPack(self, mode: AccessModeSpec = 'rw') -> Any:             # <<<<<<<<<<<<<<
 *         """Return a DLPack `PyCapsule` wrapping the vector data.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_AccessModeSpec) < (0)) __PYX_ERR(41, 726, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(41, 726, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_85toDLPack, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_toDLPack, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[342])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[50]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_toDLPack, __pyx_t_13) < (0)) __PYX_ERR(41, 726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":819
 *         return PyCapsule_New(dlm_tensor, 'dltensor', pycapsule_deleter)
 * 
 *     def createGhost(             # <<<<<<<<<<<<<<
 *         self,
 *         ghosts: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_ghosts, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(41, 819, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_LayoutSizeSpec) < (0)) __PYX_ERR(41, 819, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(41, 819, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(41, 819, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 819, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_87createGhost, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_createGhost, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[343])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_createGhost, __pyx_t_14) < (0)) __PYX_ERR(41, 819, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":861
 *         return self
 * 
 *     def createGhostWithArray(             # <<<<<<<<<<<<<<
 *         self,
 *         ghosts: Sequence[int],
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ghosts, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(41, 861, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_array, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(41, 861, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_kp_u_LayoutSizeSpec_None) < (0)) __PYX_ERR(41, 861, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(41, 861, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(41, 861, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 861, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_89createGhostWithArray, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_createGhostWithArray, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[344])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_createGhostWithArray, __pyx_t_13) < (0)) __PYX_ERR(41, 861, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":918
 *         return self
 * 
 *     def createShared(             # <<<<<<<<<<<<<<
 *         self,
 *         size: LayoutSizeSpec,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_LayoutSizeSpec) < (0)) __PYX_ERR(41, 918, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(41, 918, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(41, 918, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 918, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_91createShared, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_createShared, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[345])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_createShared, __pyx_t_14) < (0)) __PYX_ERR(41, 918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":952
 *         return self
 * 
 *     def createNest(             # <<<<<<<<<<<<<<
 *         self,
 *         vecs: Sequence[Vec],
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_vecs, __pyx_mstate_global->__pyx_kp_u_Sequence_Vec) < (0)) __PYX_ERR(41, 952, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_isets, __pyx_mstate_global->__pyx_kp_u_Sequence_IS_None) < (0)) __PYX_ERR(41, 952, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(41, 952, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 952, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_93createNest, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_createNest, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[346])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_createNest, __pyx_t_13) < (0)) __PYX_ERR(41, 952, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1000
 *     #
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(41, 1000, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1000, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_95setOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[347])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setOptionsPrefix, __pyx_t_14) < (0)) __PYX_ERR(41, 1000, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1014
 *         CHKERR(VecSetOptionsPrefix(self.vec, cval))
 * 
 *     def getOptionsPrefix(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(41, 1014, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_97getOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[348])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getOptionsPrefix, __pyx_t_13) < (0)) __PYX_ERR(41, 1014, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1028
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Append to the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(41, 1028, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1028, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_99appendOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_appendOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[349])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_appendOptionsPrefix, __pyx_t_14) < (0)) __PYX_ERR(41, 1028, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1042
 *         CHKERR(VecAppendOptionsPrefix(self.vec, cval))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the vector from the options database.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1042, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_101setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[350])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_13) < (0)) __PYX_ERR(41, 1042, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1054
 *         CHKERR(VecSetFromOptions(self.vec))
 * 
 *     def setUp(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the vector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 1054, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_103setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[351])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_14) < (0)) __PYX_ERR(41, 1054, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1067
 *         return self
 * 
 *     def setOption(self, option: Option, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set option.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_option, __pyx_mstate_global->__pyx_n_u_Option) < (0)) __PYX_ERR(41, 1067, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(41, 1067, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1067, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_105setOption, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setOption, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[352])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setOption, __pyx_t_13) < (0)) __PYX_ERR(41, 1067, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1079
 *         CHKERR(VecSetOption(self.vec, option, flag))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the vector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(41, 1079, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_107getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[353])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_14) < (0)) __PYX_ERR(41, 1079, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1093
 *         return bytes2str(cval)
 * 
 *     def getSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the global size of the vector.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 1093, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_109getSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[354])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getSize, __pyx_t_13) < (0)) __PYX_ERR(41, 1093, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1107
 *         return toInt(N)
 * 
 *     def getLocalSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the local size of the vector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 1107, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_111getLocalSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getLocalSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[355])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getLocalSize, __pyx_t_14) < (0)) __PYX_ERR(41, 1107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1121
 *         return toInt(n)
 * 
 *     def getSizes(self) -> LayoutSizeSpec:             # <<<<<<<<<<<<<<
 *         """Return the vector sizes.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_LayoutSizeSpec) < (0)) __PYX_ERR(41, 1121, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_113getSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[356])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getSizes, __pyx_t_13) < (0)) __PYX_ERR(41, 1121, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1136
 *         return (toInt(n), toInt(N))
 * 
 *     def setBlockSize(self, bsize: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the block size of the vector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 1136, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1136, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_115setBlockSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setBlockSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[357])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setBlockSize, __pyx_t_14) < (0)) __PYX_ERR(41, 1136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1149
 *         CHKERR(VecSetBlockSize(self.vec, bs))
 * 
 *     def getBlockSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the block size of the vector.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 1149, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_117getBlockSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getBlockSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[358])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getBlockSize, __pyx_t_13) < (0)) __PYX_ERR(41, 1149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1163
 *         return toInt(bs)
 * 
 *     def getOwnershipRange(self) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return the locally owned range of indices ``(start, end)``.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(41, 1163, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_119getOwnershipRange, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getOwnershipRange, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[359])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getOwnershipRange, __pyx_t_14) < (0)) __PYX_ERR(41, 1163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1184
 *         return (toInt(low), toInt(high))
 * 
 *     def getOwnershipRanges(self) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the range of indices owned by each process.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(41, 1184, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_121getOwnershipRanges, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getOwnershipRanges, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[360])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getOwnershipRanges, __pyx_t_13) < (0)) __PYX_ERR(41, 1184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1204
 *         return array_i(size+1, rng)
 * 
 *     def createLocalVector(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Create a local vector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(41, 1204, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_123createLocalVector, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_createLocalVector, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[361])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_createLocalVector, __pyx_t_14) < (0)) __PYX_ERR(41, 1204, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1223
 *         return lvec
 * 
 *     def getLocalVector(self, Vec lvec, readonly: bool = False) -> None:             # <<<<<<<<<<<<<<
 *         """Maps the local portion of the vector into a local vector.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_readonly, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(41, 1223, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1223, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_125getLocalVector, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getLocalVector, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[362])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getLocalVector, __pyx_t_13) < (0)) __PYX_ERR(41, 1223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1246
 *             CHKERR(VecGetLocalVector(self.vec, lvec.vec))
 * 
 *     def restoreLocalVector(self, Vec lvec, readonly: bool = False) -> None:             # <<<<<<<<<<<<<<
 *         """Unmap a local access obtained with `getLocalVector`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_readonly, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(41, 1246, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1246, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_127restoreLocalVector, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_restoreLocalVector, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[363])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_restoreLocalVector, __pyx_t_14) < (0)) __PYX_ERR(41, 1246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1270
 * 
 *     # 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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_readonly, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(41, 1270, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(41, 1270, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_129getBuffer, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getBuffer, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[364])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getBuffer, __pyx_t_13) < (0)) __PYX_ERR(41, 1270, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1313
 *             return vec_getbuffer_w(self)
 * 
 *     def getArray(self, readonly: bool = False) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Return local portion of the vector as an `ndarray`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_readonly, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(41, 1313, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayScalar) < (0)) __PYX_ERR(41, 1313, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_131getArray, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getArray, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[365])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getArray, __pyx_t_14) < (0)) __PYX_ERR(41, 1313, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1333
 *             return vec_getarray_w(self)
 * 
 *     def setArray(self, array: Sequence[Scalar]) -> None:             # <<<<<<<<<<<<<<
 *         """Set values for the local portion of the vector.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_array, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(41, 1333, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1333, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_133setArray, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setArray, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[366])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setArray, __pyx_t_13) < (0)) __PYX_ERR(41, 1333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1345
 *         vec_setarray(self, array)
 * 
 *     def placeArray(self, array: Sequence[Scalar]) -> None:             # <<<<<<<<<<<<<<
 *         """Set the local portion of the vector to a provided array.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_array, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(41, 1345, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1345, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_135placeArray, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_placeArray, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[367])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_placeArray, __pyx_t_14) < (0)) __PYX_ERR(41, 1345, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1366
 *         self.set_attr('__placed_array__', array)
 * 
 *     def resetArray(self, force: bool = False) -> ArrayScalar | None:             # <<<<<<<<<<<<<<
 *         """Reset the vector to use its default array.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_force, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(41, 1366, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_ArrayScalar_None) < (0)) __PYX_ERR(41, 1366, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_137resetArray, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_resetArray, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[368])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_resetArray, __pyx_t_13) < (0)) __PYX_ERR(41, 1366, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1396
 *         return array
 * 
 *     def bindToCPU(self, flg: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Bind vector operations execution on the CPU.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_flg, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(41, 1396, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1396, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_139bindToCPU, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_bindToCPU, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[369])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_bindToCPU, __pyx_t_14) < (0)) __PYX_ERR(41, 1396, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1409
 *         CHKERR(VecBindToCPU(self.vec, bindFlg))
 * 
 *     def boundToCPU(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the vector has been bound to the CPU.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(41, 1409, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_141boundToCPU, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_boundToCPU, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[370])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_boundToCPU, __pyx_t_13) < (0)) __PYX_ERR(41, 1409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1423
 *         return toBool(flg)
 * 
 *     def getCUDAHandle(             # <<<<<<<<<<<<<<
 *         self,
 *         mode: AccessModeSpec = 'rw') -> Any:  # FIXME What is the right return type?
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_AccessModeSpec) < (0)) __PYX_ERR(41, 1423, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(41, 1423, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_143getCUDAHandle, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getCUDAHandle, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[371])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[50]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getCUDAHandle, __pyx_t_14) < (0)) __PYX_ERR(41, 1423, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1462
 *         return <Py_uintptr_t>hdl
 * 
 *     def restoreCUDAHandle(             # <<<<<<<<<<<<<<
 *         self,
 *         handle: Any,  # FIXME What type hint is appropriate?
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_handle, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(41, 1462, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_AccessModeSpec) < (0)) __PYX_ERR(41, 1462, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1462, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_145restoreCUDAHandle, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_restoreCUDAHandle, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[372])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[50]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_restoreCUDAHandle, __pyx_t_13) < (0)) __PYX_ERR(41, 1462, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1495
 *             raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")
 * 
 *     def getHIPHandle(             # <<<<<<<<<<<<<<
 *         self,
 *         mode: AccessModeSpec = 'rw') -> Any:  # FIXME What is the right return type?
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_AccessModeSpec) < (0)) __PYX_ERR(41, 1495, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(41, 1495, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_147getHIPHandle, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getHIPHandle, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[373])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[50]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getHIPHandle, __pyx_t_14) < (0)) __PYX_ERR(41, 1495, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1534
 *         return <Py_uintptr_t>hdl
 * 
 *     def restoreHIPHandle(             # <<<<<<<<<<<<<<
 *         self,
 *         handle: Any,  # FIXME What type hint is appropriate?
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_handle, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(41, 1534, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_AccessModeSpec) < (0)) __PYX_ERR(41, 1534, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1534, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_149restoreHIPHandle, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_restoreHIPHandle, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[374])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[50]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_restoreHIPHandle, __pyx_t_13) < (0)) __PYX_ERR(41, 1534, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1567
 *             raise ValueError("Invalid mode: expected 'rw', 'r', or 'w'")
 * 
 *     def getOffloadMask(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the offloading status of the vector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 1567, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_151getOffloadMask, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getOffloadMask, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[375])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getOffloadMask, __pyx_t_14) < (0)) __PYX_ERR(41, 1567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1593
 *         return mask
 * 
 *     def getCLContextHandle(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the OpenCL context associated with the vector.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 1593, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_153getCLContextHandle, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getCLContextHandle, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[376])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getCLContextHandle, __pyx_t_13) < (0)) __PYX_ERR(41, 1593, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1613
 *         return ctxhdl
 * 
 *     def getCLQueueHandle(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the OpenCL command queue associated with the vector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 1613, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_155getCLQueueHandle, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getCLQueueHandle, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[377])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getCLQueueHandle, __pyx_t_14) < (0)) __PYX_ERR(41, 1613, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1633
 *         return queuehdl
 * 
 *     def getCLMemHandle(             # <<<<<<<<<<<<<<
 *         self,
 *         mode: AccessModeSpec = 'rw') -> int:
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_AccessModeSpec) < (0)) __PYX_ERR(41, 1633, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 1633, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_157getCLMemHandle, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getCLMemHandle, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[378])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[50]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getCLMemHandle, __pyx_t_13) < (0)) __PYX_ERR(41, 1633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1670
 *         return memhdl
 * 
 *     def restoreCLMemHandle(self) -> None:             # <<<<<<<<<<<<<<
 *         """Restore a pointer to the OpenCL buffer obtained with `getCLMemHandle`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1670, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_159restoreCLMemHandle, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_restoreCLMemHandle, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[379])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_restoreCLMemHandle, __pyx_t_14) < (0)) __PYX_ERR(41, 1670, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1682
 *         CHKERR(VecViennaCLRestoreCLMemWrite(self.vec))
 * 
 *     def duplicate(self, array: Sequence[Scalar] | None = None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Create a new vector with the same type, optionally with data.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_array, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar_None) < (0)) __PYX_ERR(41, 1682, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(41, 1682, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_161duplicate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_duplicate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[380])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_duplicate, __pyx_t_13) < (0)) __PYX_ERR(41, 1682, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1707
 *         return vec
 * 
 *     def copy(self, Vec result=None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a copy of the vector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(41, 1707, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_163copy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_copy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[381])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_copy, __pyx_t_14) < (0)) __PYX_ERR(41, 1707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1732
 *         return result
 * 
 *     def chop(self, tol: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set all vector entries less than some absolute tolerance to zero.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_tol, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(41, 1732, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1732, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_165chop, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_chop, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[382])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_chop, __pyx_t_13) < (0)) __PYX_ERR(41, 1732, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1750
 *         CHKERR(VecFilter(self.vec, rval))
 * 
 *     def load(self, Viewer viewer) -> Self:             # <<<<<<<<<<<<<<
 *         """Load a vector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(41, 1750, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_167load, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_load, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[383])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_load, __pyx_t_14) < (0)) __PYX_ERR(41, 1750, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1768
 *         return self
 * 
 *     def equal(self, Vec vec) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the vector is equal to another.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(41, 1768, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_169equal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_equal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[384])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_equal, __pyx_t_13) < (0)) __PYX_ERR(41, 1768, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1787
 *         return toBool(flag)
 * 
 *     def dot(self, Vec vec) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Return the dot product with ``vec``.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 1787, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_171dot, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_dot, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[385])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_dot, __pyx_t_14) < (0)) __PYX_ERR(41, 1787, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1812
 *         return toScalar(sval)
 * 
 *     def dotBegin(self, Vec vec) -> None:             # <<<<<<<<<<<<<<
 *         """Begin computing the dot product.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1812, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_173dotBegin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_dotBegin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[386])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_dotBegin, __pyx_t_13) < (0)) __PYX_ERR(41, 1812, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1832
 *         CHKERR(VecDotBegin(self.vec, vec.vec, &sval))
 * 
 *     def dotEnd(self, Vec vec) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Finish computing the dot product initiated with `dotBegin`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 1832, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_175dotEnd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_dotEnd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[387])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_dotEnd, __pyx_t_14) < (0)) __PYX_ERR(41, 1832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1846
 *         return toScalar(sval)
 * 
 *     def tDot(self, Vec vec) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Return the indefinite dot product with ``vec``.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 1846, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_177tDot, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_tDot, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[388])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_tDot, __pyx_t_13) < (0)) __PYX_ERR(41, 1846, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1868
 *         return toScalar(sval)
 * 
 *     def tDotBegin(self, Vec vec) -> None:             # <<<<<<<<<<<<<<
 *         """Begin computing the indefinite dot product.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1868, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_179tDotBegin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_tDotBegin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[389])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_tDotBegin, __pyx_t_14) < (0)) __PYX_ERR(41, 1868, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1888
 *         CHKERR(VecTDotBegin(self.vec, vec.vec, &sval))
 * 
 *     def tDotEnd(self, Vec vec) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Finish computing the indefinite dot product initiated with `tDotBegin`.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 1888, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_181tDotEnd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_tDotEnd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[390])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_tDotEnd, __pyx_t_13) < (0)) __PYX_ERR(41, 1888, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1902
 *         return toScalar(sval)
 * 
 *     def mDot(self, vecs: Sequence[Vec], out: ArrayScalar | None = None) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Compute Xy with X an array of vectors.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_vecs, __pyx_mstate_global->__pyx_kp_u_Sequence_Vec) < (0)) __PYX_ERR(41, 1902, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_out, __pyx_mstate_global->__pyx_kp_u_ArrayScalar_None) < (0)) __PYX_ERR(41, 1902, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayScalar) < (0)) __PYX_ERR(41, 1902, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_183mDot, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_mDot, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[391])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_mDot, __pyx_t_14) < (0)) __PYX_ERR(41, 1902, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1935
 *         return out
 * 
 *     def mDotBegin(self, vecs: Sequence[Vec], out: ArrayScalar) -> None:             # <<<<<<<<<<<<<<
 *         """Starts a split phase multiple dot product computation.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_vecs, __pyx_mstate_global->__pyx_kp_u_Sequence_Vec) < (0)) __PYX_ERR(41, 1935, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_out, __pyx_mstate_global->__pyx_n_u_ArrayScalar) < (0)) __PYX_ERR(41, 1935, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 1935, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_185mDotBegin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_mDotBegin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[392])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_mDotBegin, __pyx_t_13) < (0)) __PYX_ERR(41, 1935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1965
 *         CHKERR(VecMDotBegin(self.vec, nv, v, val))
 * 
 *     def mDotEnd(self, vecs: Sequence[Vec], out: ArrayScalar) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Ends a split phase multiple dot product computation.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_vecs, __pyx_mstate_global->__pyx_kp_u_Sequence_Vec) < (0)) __PYX_ERR(41, 1965, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_out, __pyx_mstate_global->__pyx_n_u_ArrayScalar) < (0)) __PYX_ERR(41, 1965, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayScalar) < (0)) __PYX_ERR(41, 1965, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_187mDotEnd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_mDotEnd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[393])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_mDotEnd, __pyx_t_14) < (0)) __PYX_ERR(41, 1965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":1996
 *         return out
 * 
 *     def mtDot(self, vecs: Sequence[Vec], out: ArrayScalar | None = None) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Compute Xy with X an array of vectors.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 1996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_vecs, __pyx_mstate_global->__pyx_kp_u_Sequence_Vec) < (0)) __PYX_ERR(41, 1996, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_out, __pyx_mstate_global->__pyx_kp_u_ArrayScalar_None) < (0)) __PYX_ERR(41, 1996, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayScalar) < (0)) __PYX_ERR(41, 1996, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_189mtDot, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_mtDot, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[394])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 1996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_mtDot, __pyx_t_13) < (0)) __PYX_ERR(41, 1996, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2029
 *         return out
 * 
 *     def mtDotBegin(self, vecs: Sequence[Vec], out: ArrayScalar) -> None:             # <<<<<<<<<<<<<<
 *         """Starts a split phase transpose multiple dot product computation.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_vecs, __pyx_mstate_global->__pyx_kp_u_Sequence_Vec) < (0)) __PYX_ERR(41, 2029, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_out, __pyx_mstate_global->__pyx_n_u_ArrayScalar) < (0)) __PYX_ERR(41, 2029, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2029, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_191mtDotBegin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_mtDotBegin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[395])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_mtDotBegin, __pyx_t_14) < (0)) __PYX_ERR(41, 2029, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2059
 *         CHKERR(VecMTDotBegin(self.vec, nv, v, val))
 * 
 *     def mtDotEnd(self, vecs: Sequence[Vec], out: ArrayScalar) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Ends a split phase transpose multiple dot product computation.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_vecs, __pyx_mstate_global->__pyx_kp_u_Sequence_Vec) < (0)) __PYX_ERR(41, 2059, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_out, __pyx_mstate_global->__pyx_n_u_ArrayScalar) < (0)) __PYX_ERR(41, 2059, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayScalar) < (0)) __PYX_ERR(41, 2059, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_193mtDotEnd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_mtDotEnd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[396])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_mtDotEnd, __pyx_t_13) < (0)) __PYX_ERR(41, 2059, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2090
 *         return out
 * 
 *     def norm(             # <<<<<<<<<<<<<<
 *         self,
 *         norm_type: NormTypeSpec = None) -> float | tuple[float, float]:
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_norm_type, __pyx_mstate_global->__pyx_n_u_NormTypeSpec) < (0)) __PYX_ERR(41, 2090, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_float_tuple_float_float) < (0)) __PYX_ERR(41, 2090, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_195norm, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_norm, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[397])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_norm, __pyx_t_14) < (0)) __PYX_ERR(41, 2090, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2112
 *         else: return (toReal(rval[0]), toReal(rval[1]))
 * 
 *     def normBegin(             # <<<<<<<<<<<<<<
 *         self,
 *         norm_type: NormTypeSpec = None) -> None:
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_norm_type, __pyx_mstate_global->__pyx_n_u_NormTypeSpec) < (0)) __PYX_ERR(41, 2112, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2112, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_197normBegin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_normBegin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[398])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_normBegin, __pyx_t_13) < (0)) __PYX_ERR(41, 2112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2131
 *         CHKERR(VecNormBegin(self.vec, ntype, dummy))
 * 
 *     def normEnd(             # <<<<<<<<<<<<<<
 *         self,
 *         norm_type: NormTypeSpec = None) -> float | tuple[float, float]:
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_norm_type, __pyx_mstate_global->__pyx_n_u_NormTypeSpec) < (0)) __PYX_ERR(41, 2131, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_float_tuple_float_float) < (0)) __PYX_ERR(41, 2131, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_199normEnd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_normEnd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[399])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_normEnd, __pyx_t_14) < (0)) __PYX_ERR(41, 2131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2151
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Scalar_float) < (0)) __PYX_ERR(41, 2151, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_201dotNorm2, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_dotNorm2, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[400])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_dotNorm2, __pyx_t_13) < (0)) __PYX_ERR(41, 2151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2166
 *         return toScalar(sval), toReal(float)
 * 
 *     def sum(self) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Return the sum of all the entries of the vector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 2166, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_203sum, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_sum, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[401])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_sum, __pyx_t_14) < (0)) __PYX_ERR(41, 2166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2180
 *         return toScalar(sval)
 * 
 *     def mean(self) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Return the arithmetic mean of all the entries of the vector.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 2180, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_205mean, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_mean, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[402])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_mean, __pyx_t_13) < (0)) __PYX_ERR(41, 2180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2194
 *         return toScalar(sval)
 * 
 *     def min(self) -> tuple[int, float]:             # <<<<<<<<<<<<<<
 *         """Return the vector entry with minimum real part and its location.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_float) < (0)) __PYX_ERR(41, 2194, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_207min, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_min, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[403])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_min, __pyx_t_14) < (0)) __PYX_ERR(41, 2194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2217
 *         return (toInt(ival), toReal(rval))
 * 
 *     def max(self) -> tuple[int, float]:             # <<<<<<<<<<<<<<
 *         """Return the vector entry with maximum real part and its location.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_float) < (0)) __PYX_ERR(41, 2217, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_209max, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_max, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[404])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_max, __pyx_t_13) < (0)) __PYX_ERR(41, 2217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2240
 *         return (toInt(ival), toReal(rval))
 * 
 *     def normalize(self) -> float:             # <<<<<<<<<<<<<<
 *         """Normalize the vector by its 2-norm.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(41, 2240, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_211normalize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_normalize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[405])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_normalize, __pyx_t_14) < (0)) __PYX_ERR(41, 2240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2259
 *         return toReal(rval)
 * 
 *     def reciprocal(self) -> None:             # <<<<<<<<<<<<<<
 *         """Replace each entry in the vector by its reciprocal.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2259, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_213reciprocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_reciprocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[406])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_reciprocal, __pyx_t_13) < (0)) __PYX_ERR(41, 2259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2271
 *         CHKERR(VecReciprocal(self.vec))
 * 
 *     def exp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Replace each entry (x) in the vector by exp(x).
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2271, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_215exp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_exp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[407])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_exp, __pyx_t_14) < (0)) __PYX_ERR(41, 2271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2283
 *         CHKERR(VecExp(self.vec))
 * 
 *     def log(self) -> None:             # <<<<<<<<<<<<<<
 *         """Replace each entry in the vector by its natural logarithm.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2283, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_217log, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_log, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[408])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_log, __pyx_t_13) < (0)) __PYX_ERR(41, 2283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2295
 *         CHKERR(VecLog(self.vec))
 * 
 *     def sqrtabs(self) -> None:             # <<<<<<<<<<<<<<
 *         """Replace each entry (x) in the vector by |x|.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2295, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_219sqrtabs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_sqrtabs, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[409])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_sqrtabs, __pyx_t_14) < (0)) __PYX_ERR(41, 2295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2307
 *         CHKERR(VecSqrtAbs(self.vec))
 * 
 *     def abs(self) -> None:             # <<<<<<<<<<<<<<
 *         """Replace each entry (x) in the vector by abs|x|.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2307, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_221abs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_abs, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[410])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_abs, __pyx_t_13) < (0)) __PYX_ERR(41, 2307, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2319
 *         CHKERR(VecAbs(self.vec))
 * 
 *     def conjugate(self) -> None:             # <<<<<<<<<<<<<<
 *         """Conjugate the vector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2319, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_223conjugate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_conjugate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[411])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_conjugate, __pyx_t_14) < (0)) __PYX_ERR(41, 2319, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2331
 *         CHKERR(VecConjugate(self.vec))
 * 
 *     def setRandom(self, Random random=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set all components of the vector to random numbers.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2331, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_225setRandom, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setRandom, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[412])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setRandom, __pyx_t_13) < (0)) __PYX_ERR(41, 2331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2351
 *         CHKERR(VecSetRandom(self.vec, rnd))
 * 
 *     def permute(self, IS order, invert: bool = False) -> None:             # <<<<<<<<<<<<<<
 *         """Permute the vector in-place with a provided ordering.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_invert, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(41, 2351, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2351, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_227permute, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_permute, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[413])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_permute, __pyx_t_14) < (0)) __PYX_ERR(41, 2351, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2372
 *         CHKERR(VecPermute(self.vec, order.iset, cinvert))
 * 
 *     def zeroEntries(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set all entries in the vector to zero.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2372, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_229zeroEntries, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_zeroEntries, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[414])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_zeroEntries, __pyx_t_13) < (0)) __PYX_ERR(41, 2372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2384
 *         CHKERR(VecZeroEntries(self.vec))
 * 
 *     def set(self, alpha: Scalar) -> None:             # <<<<<<<<<<<<<<
 *         """Set all components of the vector to the same value.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 2384, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2384, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_231set, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_set, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[415])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_set, __pyx_t_14) < (0)) __PYX_ERR(41, 2384, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2397
 *         CHKERR(VecSet(self.vec, sval))
 * 
 *     def isset(self, IS idx, alpha: Scalar) -> None:             # <<<<<<<<<<<<<<
 *         """Set specific elements of the vector to the same value.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 2397, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2397, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_233isset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_isset, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[416])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_isset, __pyx_t_13) < (0)) __PYX_ERR(41, 2397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2417
 *         CHKERR(VecISSet(self.vec, idx.iset, aval))
 * 
 *     def scale(self, alpha: Scalar) -> None:             # <<<<<<<<<<<<<<
 *         """Scale all entries of the vector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 2417, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2417, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_235scale, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_scale, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[417])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_scale, __pyx_t_14) < (0)) __PYX_ERR(41, 2417, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2437
 *         CHKERR(VecScale(self.vec, sval))
 * 
 *     def shift(self, alpha: Scalar) -> None:             # <<<<<<<<<<<<<<
 *         """Shift all entries in the vector.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 2437, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2437, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_237shift, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_shift, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[418])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_shift, __pyx_t_13) < (0)) __PYX_ERR(41, 2437, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2457
 *         CHKERR(VecShift(self.vec, sval))
 * 
 *     def swap(self, Vec vec) -> None:             # <<<<<<<<<<<<<<
 *         """Swap the content of two vectors.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2457, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_239swap, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_swap, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[419])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_swap, __pyx_t_14) < (0)) __PYX_ERR(41, 2457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2474
 *         CHKERR(VecSwap(self.vec, vec.vec))
 * 
 *     def axpy(self, alpha: Scalar, Vec x) -> None:             # <<<<<<<<<<<<<<
 *         """Compute and store y = x + y.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 2474, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2474, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_241axpy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_axpy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[420])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_axpy, __pyx_t_13) < (0)) __PYX_ERR(41, 2474, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2494
 *         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.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 2494, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2494, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_243isaxpy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_isaxpy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[421])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_isaxpy, __pyx_t_14) < (0)) __PYX_ERR(41, 2494, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2518
 *         CHKERR(VecISAXPY(self.vec, idx.iset, sval, x.vec))
 * 
 *     def aypx(self, alpha: Scalar, Vec x) -> None:             # <<<<<<<<<<<<<<
 *         """Compute and store y = x + y.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 2518, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2518, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_245aypx, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_aypx, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[422])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_aypx, __pyx_t_13) < (0)) __PYX_ERR(41, 2518, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2538
 *         CHKERR(VecAYPX(self.vec, sval, x.vec))
 * 
 *     def axpby(self, alpha: Scalar, beta: Scalar, Vec x) -> None:             # <<<<<<<<<<<<<<
 *         """Compute and store y = x + y.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 2538, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_beta, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 2538, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2538, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_247axpby, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_axpby, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[423])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_axpby, __pyx_t_14) < (0)) __PYX_ERR(41, 2538, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2561
 *         CHKERR(VecAXPBY(self.vec, sval1, sval2, x.vec))
 * 
 *     def waxpy(self, alpha: Scalar, Vec x, Vec y) -> None:             # <<<<<<<<<<<<<<
 *         """Compute and store w = x + y.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 2561, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2561, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_249waxpy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_waxpy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[424])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_waxpy, __pyx_t_13) < (0)) __PYX_ERR(41, 2561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2583
 *         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.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_alphas, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(41, 2583, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_vecs, __pyx_mstate_global->__pyx_kp_u_Sequence_Vec) < (0)) __PYX_ERR(41, 2583, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2583, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_251maxpy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_maxpy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[425])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_maxpy, __pyx_t_14) < (0)) __PYX_ERR(41, 2583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2613
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2613, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_253pointwiseMult, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_pointwiseMult, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[426])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_pointwiseMult, __pyx_t_13) < (0)) __PYX_ERR(41, 2613, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2632
 *         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.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2632, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_255pointwiseDivide, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_pointwiseDivide, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[427])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_pointwiseDivide, __pyx_t_14) < (0)) __PYX_ERR(41, 2632, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2653
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2653, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_257pointwiseMin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_pointwiseMin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[428])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_pointwiseMin, __pyx_t_13) < (0)) __PYX_ERR(41, 2653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2672
 *         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.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2672, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_259pointwiseMax, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_pointwiseMax, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[429])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_pointwiseMax, __pyx_t_14) < (0)) __PYX_ERR(41, 2672, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2691
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2691, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_261pointwiseMaxAbs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_pointwiseMaxAbs, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[430])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_pointwiseMaxAbs, __pyx_t_13) < (0)) __PYX_ERR(41, 2691, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2710
 *         CHKERR(VecPointwiseMaxAbs(self.vec, x.vec, y.vec))
 * 
 *     def maxPointwiseDivide(self, Vec vec) -> float:             # <<<<<<<<<<<<<<
 *         """Return the maximum of the component-wise absolute value division.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(41, 2710, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_263maxPointwiseDivide, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_maxPointwiseDivide, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[431])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_maxPointwiseDivide, __pyx_t_14) < (0)) __PYX_ERR(41, 2710, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2734
 *         return toReal(rval)
 * 
 *     def getValue(self, index: int) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Return a single value from the vector.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_index, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 2734, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 2734, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_265getValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[432])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getValue, __pyx_t_13) < (0)) __PYX_ERR(41, 2734, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2756
 *         return toScalar(sval)
 * 
 *     def getValues(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(41, 2756, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_values, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar_None) < (0)) __PYX_ERR(41, 2756, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayScalar) < (0)) __PYX_ERR(41, 2756, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_267getValues, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getValues, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[433])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getValues, __pyx_t_14) < (0)) __PYX_ERR(41, 2756, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2781
 *         return vecgetvalues(self.vec, indices, values)
 * 
 *     def getValuesStagStencil(self, indices, values=None) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         raise NotImplementedError
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2781, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_269getValuesStagStencil, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getValuesStagStencil, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[434])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getValuesStagStencil, __pyx_t_13) < (0)) __PYX_ERR(41, 2781, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2785
 *         raise NotImplementedError
 * 
 *     def setValue(             # <<<<<<<<<<<<<<
 *         self,
 *         index: int,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_index, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 2785, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 2785, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(41, 2785, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2785, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_271setValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[435])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setValue, __pyx_t_14) < (0)) __PYX_ERR(41, 2785, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2822
 *         CHKERR(VecSetValues(self.vec, 1, &ival, &sval, caddv))
 * 
 *     def setValues(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(41, 2822, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_values, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(41, 2822, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(41, 2822, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2822, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_273setValues, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setValues, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[436])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setValues, __pyx_t_13) < (0)) __PYX_ERR(41, 2822, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2856
 *         vecsetvalues(self.vec, indices, values, addv, 0, 0)
 * 
 *     def setValuesBlocked(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(41, 2856, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_values, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(41, 2856, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(41, 2856, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2856, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_275setValuesBlocked, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setValuesBlocked, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[437])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setValuesBlocked, __pyx_t_14) < (0)) __PYX_ERR(41, 2856, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2894
 *         vecsetvalues(self.vec, indices, values, addv, 1, 0)
 * 
 *     def setValuesStagStencil(self, indices, values, addv=None) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         raise NotImplementedError
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2894, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_277setValuesStagStencil, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setValuesStagStencil, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[438])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setValuesStagStencil, __pyx_t_13) < (0)) __PYX_ERR(41, 2894, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2898
 *         raise NotImplementedError
 * 
 *     def setLGMap(self, LGMap lgmap) -> None:             # <<<<<<<<<<<<<<
 *         """Set the local-to-global mapping.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2898, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_279setLGMap, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setLGMap, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[439])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setLGMap, __pyx_t_14) < (0)) __PYX_ERR(41, 2898, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2913
 *         CHKERR(VecSetLocalToGlobalMapping(self.vec, lgmap.lgm))
 * 
 *     def getLGMap(self) -> LGMap:             # <<<<<<<<<<<<<<
 *         """Return the local-to-global mapping.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_LGMap) < (0)) __PYX_ERR(41, 2913, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_281getLGMap, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getLGMap, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[440])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getLGMap, __pyx_t_13) < (0)) __PYX_ERR(41, 2913, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2928
 *         return cmap
 * 
 *     def setValueLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         index: int,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_index, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 2928, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 2928, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(41, 2928, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2928, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_283setValueLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setValueLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[441])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setValueLocal, __pyx_t_14) < (0)) __PYX_ERR(41, 2928, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2965
 *         CHKERR(VecSetValuesLocal(self.vec, 1, &ival, &sval, caddv))
 * 
 *     def setValuesLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(41, 2965, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_values, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(41, 2965, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(41, 2965, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2965, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_285setValuesLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setValuesLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[442])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setValuesLocal, __pyx_t_13) < (0)) __PYX_ERR(41, 2965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":2999
 *         vecsetvalues(self.vec, indices, values, addv, 0, 1)
 * 
 *     def setValuesBlockedLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         indices: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 2999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(41, 2999, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_values, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(41, 2999, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(41, 2999, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 2999, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_287setValuesBlockedLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setValuesBlockedLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[443])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 2999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setValuesBlockedLocal, __pyx_t_14) < (0)) __PYX_ERR(41, 2999, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3037
 *         vecsetvalues(self.vec, indices, values, addv, 1, 1)
 * 
 *     def assemblyBegin(self) -> None:             # <<<<<<<<<<<<<<
 *         """Begin an assembling stage of the vector.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 3037, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_289assemblyBegin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_assemblyBegin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[444])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_assemblyBegin, __pyx_t_13) < (0)) __PYX_ERR(41, 3037, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3049
 *         CHKERR(VecAssemblyBegin(self.vec))
 * 
 *     def assemblyEnd(self) -> None:             # <<<<<<<<<<<<<<
 *         """Finish the assembling stage initiated with `assemblyBegin`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 3049, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_291assemblyEnd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_assemblyEnd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[445])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_assemblyEnd, __pyx_t_14) < (0)) __PYX_ERR(41, 3049, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3061
 *         CHKERR(VecAssemblyEnd(self.vec))
 * 
 *     def assemble(self) -> None:             # <<<<<<<<<<<<<<
 *         """Assemble the vector.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 3061, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_293assemble, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_assemble, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[446])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_assemble, __pyx_t_13) < (0)) __PYX_ERR(41, 3061, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3076
 *     # --- methods for strided vectors ---
 * 
 *     def strideScale(self, field: int, alpha: Scalar) -> None:             # <<<<<<<<<<<<<<
 *         """Scale a component of the vector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 3076, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 3076, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 3076, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_295strideScale, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_strideScale, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[447])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_strideScale, __pyx_t_14) < (0)) __PYX_ERR(41, 3076, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3097
 *         CHKERR(VecStrideScale(self.vec, ival, sval))
 * 
 *     def strideSum(self, field: int) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Sum subvector entries.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 3097, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(41, 3097, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_297strideSum, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_strideSum, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[448])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_strideSum, __pyx_t_13) < (0)) __PYX_ERR(41, 3097, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3120
 *         return toScalar(sval)
 * 
 *     def strideMin(self, field: int) -> tuple[int, float]:             # <<<<<<<<<<<<<<
 *         """Return the minimum of entries in a subvector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 3120, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_float) < (0)) __PYX_ERR(41, 3120, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_299strideMin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_strideMin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[449])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_strideMin, __pyx_t_14) < (0)) __PYX_ERR(41, 3120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3151
 *         return (toInt(ival2), toReal(rval))
 * 
 *     def strideMax(self, field: int) -> tuple[int, float]:             # <<<<<<<<<<<<<<
 *         """Return the maximum of entries in a subvector.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 3151, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_float) < (0)) __PYX_ERR(41, 3151, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_301strideMax, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_strideMax, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[450])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_strideMax, __pyx_t_13) < (0)) __PYX_ERR(41, 3151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3182
 *         return (toInt(ival2), toReal(rval))
 * 
 *     def strideNorm(             # <<<<<<<<<<<<<<
 *         self,
 *         field: int,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 3182, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_norm_type, __pyx_mstate_global->__pyx_n_u_NormTypeSpec) < (0)) __PYX_ERR(41, 3182, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_float_tuple_float_float) < (0)) __PYX_ERR(41, 3182, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_303strideNorm, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_strideNorm, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[451])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_strideNorm, __pyx_t_14) < (0)) __PYX_ERR(41, 3182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3214
 *         else: return (toReal(rval[0]), toReal(rval[1]))
 * 
 *     def strideScatter(             # <<<<<<<<<<<<<<
 *         self,
 *         field: int,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 3214, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(41, 3214, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 3214, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_305strideScatter, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_strideScatter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[452])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_strideScatter, __pyx_t_13) < (0)) __PYX_ERR(41, 3214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3245
 *         CHKERR(VecStrideScatter(self.vec, ival, vec.vec, caddv))
 * 
 *     def strideGather(             # <<<<<<<<<<<<<<
 *         self,
 *         field: int,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(41, 3245, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(41, 3245, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 3245, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_307strideGather, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_strideGather, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[453])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_strideGather, __pyx_t_14) < (0)) __PYX_ERR(41, 3245, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3278
 *     # --- methods for vectors with ghost values ---
 * 
 *     def localForm(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return a context manager for viewing ghost vectors in local form.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(41, 3278, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_309localForm, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_localForm, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[454])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_localForm, __pyx_t_13) < (0)) __PYX_ERR(41, 3278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3311
 *         return _Vec_LocalForm(self)
 * 
 *     def ghostUpdateBegin(             # <<<<<<<<<<<<<<
 *         self,
 *         addv: InsertModeSpec = None,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(41, 3311, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_ScatterModeSpec) < (0)) __PYX_ERR(41, 3311, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 3311, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_311ghostUpdateBegin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_ghostUpdateBegin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[455])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_ghostUpdateBegin, __pyx_t_14) < (0)) __PYX_ERR(41, 3311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3328
 *         CHKERR(VecGhostUpdateBegin(self.vec, caddv, csctm))
 * 
 *     def ghostUpdateEnd(             # <<<<<<<<<<<<<<
 *         self,
 *         addv: InsertModeSpec = None,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(41, 3328, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_ScatterModeSpec) < (0)) __PYX_ERR(41, 3328, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 3328, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_313ghostUpdateEnd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_ghostUpdateEnd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[456])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_ghostUpdateEnd, __pyx_t_13) < (0)) __PYX_ERR(41, 3328, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3345
 *         CHKERR(VecGhostUpdateEnd(self.vec, caddv, csctm))
 * 
 *     def ghostUpdate(             # <<<<<<<<<<<<<<
 *         self,
 *         addv: InsertModeSpec = None,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(41, 3345, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_ScatterModeSpec) < (0)) __PYX_ERR(41, 3345, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 3345, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_315ghostUpdate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_ghostUpdate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[457])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_ghostUpdate, __pyx_t_14) < (0)) __PYX_ERR(41, 3345, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3380
 *         CHKERR(VecGhostUpdateEnd(self.vec, caddv, csctm))
 * 
 *     def setMPIGhost(self, ghosts: Sequence[int]) -> None:             # <<<<<<<<<<<<<<
 *         """Set the ghost points for a ghosted vector.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ghosts, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(41, 3380, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 3380, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_317setMPIGhost, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setMPIGhost, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[458])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setMPIGhost, __pyx_t_13) < (0)) __PYX_ERR(41, 3380, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3399
 *         CHKERR(VecMPISetGhost(self.vec, ng, ig))
 * 
 *     def getGhostIS(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return ghosting indices of a ghost vector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(41, 3399, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_319getGhostIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getGhostIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[459])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getGhostIS, __pyx_t_14) < (0)) __PYX_ERR(41, 3399, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3420
 *     #
 * 
 *     def getSubVector(self, IS iset, Vec subvec=None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a subvector from given indices.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(41, 3420, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_321getSubVector, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getSubVector, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[460])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getSubVector, __pyx_t_13) < (0)) __PYX_ERR(41, 3420, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3446
 *         return subvec
 * 
 *     def restoreSubVector(self, IS iset, Vec subvec) -> None:             # <<<<<<<<<<<<<<
 *         """Restore a subvector extracted using `getSubVector`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 3446, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_323restoreSubVector, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_restoreSubVector, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[461])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_restoreSubVector, __pyx_t_14) < (0)) __PYX_ERR(41, 3446, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3465
 *         CHKERR(VecRestoreSubVector(self.vec, iset.iset, &subvec.vec))
 * 
 *     def getNestSubVecs(self) -> list[Vec]:             # <<<<<<<<<<<<<<
 *         """Return all the vectors contained in the nested vector.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_Vec) < (0)) __PYX_ERR(41, 3465, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_325getNestSubVecs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getNestSubVecs, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[462])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getNestSubVecs, __pyx_t_13) < (0)) __PYX_ERR(41, 3465, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3487
 *         return output
 * 
 *     def setNestSubVecs(             # <<<<<<<<<<<<<<
 *         self,
 *         sx: Sequence[Vec],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_sx, __pyx_mstate_global->__pyx_kp_u_Sequence_Vec) < (0)) __PYX_ERR(41, 3487, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_idxm, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(41, 3487, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 3487, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_327setNestSubVecs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setNestSubVecs, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[463])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setNestSubVecs, __pyx_t_14) < (0)) __PYX_ERR(41, 3487, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3521
 *     #
 * 
 *     def setDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Associate a `DM` to the vector.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(41, 3521, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_329setDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_setDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[464])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_setDM, __pyx_t_13) < (0)) __PYX_ERR(41, 3521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3533
 *         CHKERR(VecSetDM(self.vec, dm.dm))
 * 
 *     def getDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the `DM` associated to the vector.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(41, 3533, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_331getDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_getDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[465])); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_getDM, __pyx_t_14) < (0)) __PYX_ERR(41, 3533, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3552
 *     #
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def concatenate(cls, vecs: Sequence[Vec]) -> tuple[Vec, list[IS]]:
 *         """Concatenate vectors into a single vector.
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_vecs, __pyx_mstate_global->__pyx_kp_u_Sequence_Vec) < (0)) __PYX_ERR(41, 3552, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Vec_list_IS) < (0)) __PYX_ERR(41, 3552, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Vec_333concatenate, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Vec_concatenate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[466])); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_concatenate, __pyx_t_13) < (0)) __PYX_ERR(41, 3552, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_GetNameInClass(__pyx_t_13, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_concatenate); if (unlikely(!__pyx_t_13)) __PYX_ERR(41, 3552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_Method_ClassMethod(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(41, 3552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Vec, __pyx_mstate_global->__pyx_n_u_concatenate, __pyx_t_14) < (0)) __PYX_ERR(41, 3552, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Vec.pyx":3675
 * # --------------------------------------------------------------------
 * 
 * del VecType             # <<<<<<<<<<<<<<
 * del VecOption
 * 
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_VecType) < (0)) __PYX_ERR(41, 3675, __pyx_L1_error)

  /* "petsc4py/PETSc/Vec.pyx":3676
 * 
 * del VecType
 * del VecOption             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_VecOption) < (0)) __PYX_ERR(41, 3676, __pyx_L1_error)

  /* "petsc4py/PETSc/DT.pyx":9
 *         self.quad = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View a `Quad` object.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(42, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(42, 9, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4Quad_3view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Quad_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[467])); if (unlikely(!__pyx_t_13)) __PYX_ERR(42, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_13) < (0)) __PYX_ERR(42, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/DT.pyx":28
 *         CHKERR(PetscQuadratureView(self.quad, vwr))
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Quad` object.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(42, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(42, 28, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(42, 28, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4Quad_5create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Quad_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[468])); if (unlikely(!__pyx_t_14)) __PYX_ERR(42, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_14) < (0)) __PYX_ERR(42, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DT.pyx":49
 *         return self
 * 
 *     def duplicate(self) -> Quad:             # <<<<<<<<<<<<<<
 *         """Create a deep copy of the `Quad` object.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(42, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Quad) < (0)) __PYX_ERR(42, 49, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4Quad_7duplicate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Quad_duplicate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[469])); if (unlikely(!__pyx_t_13)) __PYX_ERR(42, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_mstate_global->__pyx_n_u_duplicate, __pyx_t_13) < (0)) __PYX_ERR(42, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/DT.pyx":63
 *         return newquad
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the `Quad` object.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(42, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(42, 63, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4Quad_9destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Quad_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[470])); if (unlikely(!__pyx_t_14)) __PYX_ERR(42, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_14) < (0)) __PYX_ERR(42, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DT.pyx":76
 *         return self
 * 
 *     def getData(self) -> tuple[ArrayReal, ArrayReal]:             # <<<<<<<<<<<<<<
 *         """Return the data defining the `Quad`.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(42, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_ArrayReal_ArrayReal) < (0)) __PYX_ERR(42, 76, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4Quad_11getData, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Quad_getData, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[471])); if (unlikely(!__pyx_t_13)) __PYX_ERR(42, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_mstate_global->__pyx_n_u_getData, __pyx_t_13) < (0)) __PYX_ERR(42, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/DT.pyx":104
 *     # def setData(???)
 * 
 *     def getNumComponents(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of components for functions to be integrated.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(42, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(42, 104, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4Quad_13getNumComponents, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Quad_getNumComponents, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[472])); if (unlikely(!__pyx_t_14)) __PYX_ERR(42, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_mstate_global->__pyx_n_u_getNumComponents, __pyx_t_14) < (0)) __PYX_ERR(42, 104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DT.pyx":118
 *         return toInt(cnc)
 * 
 *     def setNumComponents(self, nc: int) -> None:             # <<<<<<<<<<<<<<
 *         """Return the number of components for functions to be integrated.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(42, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_nc, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(42, 118, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(42, 118, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4Quad_15setNumComponents, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Quad_setNumComponents, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[473])); if (unlikely(!__pyx_t_13)) __PYX_ERR(42, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_mstate_global->__pyx_n_u_setNumComponents, __pyx_t_13) < (0)) __PYX_ERR(42, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/DT.pyx":136
 *         CHKERR(PetscQuadratureSetNumComponents(self.quad, cnc))
 * 
 *     def getOrder(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the order of the method in the `Quad`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(42, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(42, 136, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4Quad_17getOrder, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Quad_getOrder, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[474])); if (unlikely(!__pyx_t_14)) __PYX_ERR(42, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_mstate_global->__pyx_n_u_getOrder, __pyx_t_14) < (0)) __PYX_ERR(42, 136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DT.pyx":150
 *         return toInt(corder)
 * 
 *     def setOrder(self, order: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the order of the method in the `Quad`.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(42, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_order, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(42, 150, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(42, 150, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4Quad_19setOrder, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Quad_setOrder, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[475])); if (unlikely(!__pyx_t_13)) __PYX_ERR(42, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Quad, __pyx_mstate_global->__pyx_n_u_setOrder, __pyx_t_13) < (0)) __PYX_ERR(42, 150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/FE.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class FEType(object):             # <<<<<<<<<<<<<<
 *     """The finite element types."""
 *     BASIC     = S_(PETSCFEBASIC)
*/
  __pyx_t_13 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[53]); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_CalculateMetaclass(NULL, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_14, __pyx_t_13, __pyx_mstate_global->__pyx_n_u_FEType, __pyx_mstate_global->__pyx_n_u_FEType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_finite_element_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_13 != __pyx_mstate_global->__pyx_tuple[53]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[53]) < 0))) __PYX_ERR(43, 3, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/FE.pyx":5
 * class FEType(object):
 *     """The finite element types."""
 *     BASIC     = S_(PETSCFEBASIC)             # <<<<<<<<<<<<<<
 *     OPENCL    = S_(PETSCFEOPENCL)
 *     COMPOSITE = S_(PETSCFECOMPOSITE)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCFEBASIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BASIC, __pyx_t_4) < (0)) __PYX_ERR(43, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/FE.pyx":6
 *     """The finite element types."""
 *     BASIC     = S_(PETSCFEBASIC)
 *     OPENCL    = S_(PETSCFEOPENCL)             # <<<<<<<<<<<<<<
 *     COMPOSITE = S_(PETSCFECOMPOSITE)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCFEOPENCL); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OPENCL, __pyx_t_4) < (0)) __PYX_ERR(43, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/FE.pyx":7
 *     BASIC     = S_(PETSCFEBASIC)
 *     OPENCL    = S_(PETSCFEOPENCL)
 *     COMPOSITE = S_(PETSCFECOMPOSITE)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCFECOMPOSITE); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_COMPOSITE, __pyx_t_4) < (0)) __PYX_ERR(43, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/FE.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class FEType(object):             # <<<<<<<<<<<<<<
 *     """The finite element types."""
 *     BASIC     = S_(PETSCFEBASIC)
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_FEType, __pyx_t_13, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(43, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FEType, __pyx_t_4) < (0)) __PYX_ERR(43, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/FE.pyx":15
 *     """A PETSc object that manages a finite element space."""
 * 
 *     Type = FEType             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_FEType); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_13) < (0)) __PYX_ERR(43, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/FE.pyx":21
 *         self.fe = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View a `FE` object.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(43, 21, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_3view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[476])); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_14) < (0)) __PYX_ERR(43, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/FE.pyx":40
 *         CHKERR(PetscFEView(self.fe, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the `FE` object.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(43, 40, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[477])); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_13) < (0)) __PYX_ERR(43, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/FE.pyx":53
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an empty `FE` object.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(43, 53, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(43, 53, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_7create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[478])); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_14) < (0)) __PYX_ERR(43, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/FE.pyx":81
 *         nc: int,
 *         isSimplex: bool,
 *         qorder: int = DETERMINE,             # <<<<<<<<<<<<<<
 *         prefix: str | None = None,
 *         comm: Comm | None = None) -> Self:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_DETERMINE); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_mstate_global->__pyx_k__19 = __pyx_t_14;
  __Pyx_GIVEREF(__pyx_t_14);
  __pyx_t_14 = 0;

  /* "petsc4py/PETSc/FE.pyx":76
 *         return self
 * 
 *     def createDefault(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_DETERMINE); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);

  /* "petsc4py/PETSc/FE.pyx":83
 *         qorder: int = DETERMINE,
 *         prefix: str | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `FE` for basic FEM computation.
 * 
*/
  __pyx_t_13 = PyTuple_Pack(3, __pyx_t_14, Py_None, Py_None); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/FE.pyx":76
 *         return self
 * 
 *     def createDefault(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_dim, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 76, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_nc, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 76, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_isSimplex, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(43, 76, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_qorder, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 76, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(43, 76, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(43, 76, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(43, 76, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_9createDefault, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_createDefault, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[479])); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_t_13);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_createDefault, __pyx_t_5) < (0)) __PYX_ERR(43, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/FE.pyx":127
 *         nc: int,
 *         ctype: DM.PolytopeType,
 *         qorder: int = DETERMINE,             # <<<<<<<<<<<<<<
 *         prefix: str | None = None,
 *         comm: Comm | None = None) -> Self:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DETERMINE); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_mstate_global->__pyx_k__20 = __pyx_t_5;
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "petsc4py/PETSc/FE.pyx":122
 *         return self
 * 
 *     def createByCell(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DETERMINE); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "petsc4py/PETSc/FE.pyx":129
 *         qorder: int = DETERMINE,
 *         prefix: str | None = None,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `FE` for basic FEM computation.
 * 
*/
  __pyx_t_14 = PyTuple_Pack(3, __pyx_t_5, Py_None, Py_None); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/FE.pyx":122
 *         return self
 * 
 *     def createByCell(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_dim, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 122, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_nc, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 122, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ctype, __pyx_mstate_global->__pyx_kp_u_DM_PolytopeType) < (0)) __PYX_ERR(43, 122, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_qorder, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 122, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(43, 122, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(43, 122, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(43, 122, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_11createByCell, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_createByCell, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[480])); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_t_14);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_createByCell, __pyx_t_13) < (0)) __PYX_ERR(43, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/FE.pyx":174
 *         isSimplex: bool,
 *         k: int,
 *         qorder: int = DETERMINE,             # <<<<<<<<<<<<<<
 *         comm: Comm | None = None) -> Self:
 *         """Create a `FE` for the basic Lagrange space of degree k.
*/
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_DETERMINE); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_mstate_global->__pyx_k__21 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "petsc4py/PETSc/FE.pyx":168
 *         return self
 * 
 *     def createLagrange(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_DETERMINE); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);

  /* "petsc4py/PETSc/FE.pyx":175
 *         k: int,
 *         qorder: int = DETERMINE,
 *         comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `FE` for the basic Lagrange space of degree k.
 * 
*/
  __pyx_t_5 = PyTuple_Pack(2, __pyx_t_13, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(43, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/FE.pyx":168
 *         return self
 * 
 *     def createLagrange(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_dim, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 168, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nc, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 168, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_isSimplex, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(43, 168, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_k, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 168, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_qorder, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 168, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(43, 168, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(43, 168, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_13createLagrange, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_createLagrange, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[481])); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_createLagrange, __pyx_t_14) < (0)) __PYX_ERR(43, 168, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/FE.pyx":212
 *         return self
 * 
 *     def getQuadrature(self) -> Quad:             # <<<<<<<<<<<<<<
 *         """Return the `Quad` used to calculate inner products.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Quad) < (0)) __PYX_ERR(43, 212, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_15getQuadrature, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_getQuadrature, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[482])); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_getQuadrature, __pyx_t_13) < (0)) __PYX_ERR(43, 212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/FE.pyx":227
 *         return quad
 * 
 *     def getDimension(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the dimension of the finite element space on a cell.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 227, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_17getDimension, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_getDimension, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[483])); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_getDimension, __pyx_t_14) < (0)) __PYX_ERR(43, 227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/FE.pyx":241
 *         return toInt(cdim)
 * 
 *     def getSpatialDimension(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the spatial dimension of the element.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 241, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_19getSpatialDimension, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_getSpatialDimension, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[484])); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_getSpatialDimension, __pyx_t_13) < (0)) __PYX_ERR(43, 241, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/FE.pyx":255
 *         return toInt(csdim)
 * 
 *     def getNumComponents(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of components in the element.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 255, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_21getNumComponents, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_getNumComponents, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[485])); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_getNumComponents, __pyx_t_14) < (0)) __PYX_ERR(43, 255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/FE.pyx":269
 *         return toInt(comp)
 * 
 *     def setNumComponents(self, comp: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of field components in the element.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comp, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 269, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(43, 269, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_23setNumComponents, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_setNumComponents, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[486])); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_setNumComponents, __pyx_t_13) < (0)) __PYX_ERR(43, 269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/FE.pyx":287
 *         CHKERR(PetscFESetNumComponents(self.fe, ccomp))
 * 
 *     def getNumDof(self) -> ndarray:             # <<<<<<<<<<<<<<
 *         """Return the number of DOFs.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ndarray) < (0)) __PYX_ERR(43, 287, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_25getNumDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_getNumDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[487])); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_getNumDof, __pyx_t_14) < (0)) __PYX_ERR(43, 287, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/FE.pyx":306
 *         return array_i(cdim, numDof)
 * 
 *     def getTileSizes(self) -> tuple[int, int, int, int]:             # <<<<<<<<<<<<<<
 *         """Return the tile sizes for evaluation.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int_int_int) < (0)) __PYX_ERR(43, 306, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_27getTileSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_getTileSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[488])); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_getTileSizes, __pyx_t_13) < (0)) __PYX_ERR(43, 306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/FE.pyx":332
 *         return toInt(blockSize), toInt(numBlocks), toInt(batchSize), toInt(numBatches)
 * 
 *     def setTileSizes(             # <<<<<<<<<<<<<<
 *         self,
 *         blockSize: int,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_blockSize, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 332, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_numBlocks, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 332, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_batchSize, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 332, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_numBatches, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(43, 332, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(43, 332, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_29setTileSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_setTileSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[489])); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_setTileSizes, __pyx_t_14) < (0)) __PYX_ERR(43, 332, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/FE.pyx":362
 *         CHKERR(PetscFESetTileSizes(self.fe, cblockSize, cnumBlocks, cbatchSize, cnumBatches))
 * 
 *     def getFaceQuadrature(self) -> Quad:             # <<<<<<<<<<<<<<
 *         """Return the `Quad` used to calculate inner products on faces.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Quad) < (0)) __PYX_ERR(43, 362, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_31getFaceQuadrature, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_getFaceQuadrature, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[490])); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_getFaceQuadrature, __pyx_t_13) < (0)) __PYX_ERR(43, 362, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/FE.pyx":377
 *         return quad
 * 
 *     def setQuadrature(self, Quad quad) -> Self:             # <<<<<<<<<<<<<<
 *         """Set the `Quad` used to calculate inner products.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(43, 377, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_33setQuadrature, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_setQuadrature, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[491])); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_setQuadrature, __pyx_t_14) < (0)) __PYX_ERR(43, 377, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/FE.pyx":395
 *         return self
 * 
 *     def setFaceQuadrature(self, Quad quad) -> Quad:             # <<<<<<<<<<<<<<
 *         """Set the `Quad` used to calculate inner products on faces.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Quad) < (0)) __PYX_ERR(43, 395, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_35setFaceQuadrature, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_setFaceQuadrature, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[492])); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_setFaceQuadrature, __pyx_t_13) < (0)) __PYX_ERR(43, 395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/FE.pyx":413
 *         return self
 * 
 *     def setType(self, fe_type: Type | str) -> Self:             # <<<<<<<<<<<<<<
 *         """Build a particular `FE`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_fe_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(43, 413, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(43, 413, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_37setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[493])); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_14) < (0)) __PYX_ERR(43, 413, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/FE.pyx":433
 *         return self
 * 
 *     def getBasisSpace(self) -> Space:             # <<<<<<<<<<<<<<
 *         """Return the `Space` used for the approximation of the `FE` solution.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Space) < (0)) __PYX_ERR(43, 433, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_39getBasisSpace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_getBasisSpace, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[494])); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_getBasisSpace, __pyx_t_13) < (0)) __PYX_ERR(43, 433, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/FE.pyx":448
 *         return sp
 * 
 *     def setBasisSpace(self, Space sp) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `Space` used for the approximation of the solution.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(43, 448, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_41setBasisSpace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_setBasisSpace, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[495])); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_setBasisSpace, __pyx_t_14) < (0)) __PYX_ERR(43, 448, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/FE.pyx":465
 *         CHKERR(PetscFESetBasisSpace(self.fe, sp.space))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set parameters in a `FE` from the options database.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(43, 465, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_43setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[496])); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_13) < (0)) __PYX_ERR(43, 465, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/FE.pyx":477
 *         CHKERR(PetscFESetFromOptions(self.fe))
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Construct data structures for the `FE` after the `Type` has been set.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(43, 477, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_45setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[497])); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_14) < (0)) __PYX_ERR(43, 477, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/FE.pyx":489
 *         CHKERR(PetscFESetUp(self.fe))
 * 
 *     def getDualSpace(self) -> DualSpace:             # <<<<<<<<<<<<<<
 *         """Return the `DualSpace` used to define the inner product for the `FE`.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DualSpace) < (0)) __PYX_ERR(43, 489, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_47getDualSpace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_getDualSpace, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[498])); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_getDualSpace, __pyx_t_13) < (0)) __PYX_ERR(43, 489, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/FE.pyx":504
 *         return dspace
 * 
 *     def setDualSpace(self, DualSpace dspace) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `DualSpace` used to define the inner product.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(43, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(43, 504, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2FE_49setDualSpace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FE_setDualSpace, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[499])); if (unlikely(!__pyx_t_14)) __PYX_ERR(43, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_FE, __pyx_mstate_global->__pyx_n_u_setDualSpace, __pyx_t_14) < (0)) __PYX_ERR(43, 504, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/FE.pyx":523
 * # --------------------------------------------------------------------
 * 
 * del FEType             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FEType) < (0)) __PYX_ERR(43, 523, __pyx_L1_error)

  /* "petsc4py/PETSc/Scatter.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class ScatterType(object):             # <<<<<<<<<<<<<<
 *     """Scatter type.
 * 
*/
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[55]); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_ScatterType, __pyx_mstate_global->__pyx_n_u_ScatterType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Scatter_type_See_Also_petsc_VecS); if (unlikely(!__pyx_t_5)) __PYX_ERR(44, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_mstate_global->__pyx_tuple[55]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[55]) < 0))) __PYX_ERR(44, 3, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Scatter.pyx":11
 * 
 *     """
 *     BASIC      = S_(PETSCSFBASIC)             # <<<<<<<<<<<<<<
 *     NEIGHBOR   = S_(PETSCSFNEIGHBOR)
 *     ALLGATHERV = S_(PETSCSFALLGATHERV)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFBASIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(44, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BASIC, __pyx_t_4) < (0)) __PYX_ERR(44, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":12
 *     """
 *     BASIC      = S_(PETSCSFBASIC)
 *     NEIGHBOR   = S_(PETSCSFNEIGHBOR)             # <<<<<<<<<<<<<<
 *     ALLGATHERV = S_(PETSCSFALLGATHERV)
 *     ALLGATHER  = S_(PETSCSFALLGATHER)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFNEIGHBOR); if (unlikely(!__pyx_t_4)) __PYX_ERR(44, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NEIGHBOR, __pyx_t_4) < (0)) __PYX_ERR(44, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":13
 *     BASIC      = S_(PETSCSFBASIC)
 *     NEIGHBOR   = S_(PETSCSFNEIGHBOR)
 *     ALLGATHERV = S_(PETSCSFALLGATHERV)             # <<<<<<<<<<<<<<
 *     ALLGATHER  = S_(PETSCSFALLGATHER)
 *     GATHERV    = S_(PETSCSFGATHERV)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLGATHERV); if (unlikely(!__pyx_t_4)) __PYX_ERR(44, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ALLGATHERV, __pyx_t_4) < (0)) __PYX_ERR(44, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":14
 *     NEIGHBOR   = S_(PETSCSFNEIGHBOR)
 *     ALLGATHERV = S_(PETSCSFALLGATHERV)
 *     ALLGATHER  = S_(PETSCSFALLGATHER)             # <<<<<<<<<<<<<<
 *     GATHERV    = S_(PETSCSFGATHERV)
 *     GATHER     = S_(PETSCSFGATHER)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLGATHER); if (unlikely(!__pyx_t_4)) __PYX_ERR(44, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ALLGATHER, __pyx_t_4) < (0)) __PYX_ERR(44, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":15
 *     ALLGATHERV = S_(PETSCSFALLGATHERV)
 *     ALLGATHER  = S_(PETSCSFALLGATHER)
 *     GATHERV    = S_(PETSCSFGATHERV)             # <<<<<<<<<<<<<<
 *     GATHER     = S_(PETSCSFGATHER)
 *     ALLTOALL   = S_(PETSCSFALLTOALL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFGATHERV); if (unlikely(!__pyx_t_4)) __PYX_ERR(44, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_GATHERV, __pyx_t_4) < (0)) __PYX_ERR(44, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":16
 *     ALLGATHER  = S_(PETSCSFALLGATHER)
 *     GATHERV    = S_(PETSCSFGATHERV)
 *     GATHER     = S_(PETSCSFGATHER)             # <<<<<<<<<<<<<<
 *     ALLTOALL   = S_(PETSCSFALLTOALL)
 *     WINDOW     = S_(PETSCSFWINDOW)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFGATHER); if (unlikely(!__pyx_t_4)) __PYX_ERR(44, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_GATHER, __pyx_t_4) < (0)) __PYX_ERR(44, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":17
 *     GATHERV    = S_(PETSCSFGATHERV)
 *     GATHER     = S_(PETSCSFGATHER)
 *     ALLTOALL   = S_(PETSCSFALLTOALL)             # <<<<<<<<<<<<<<
 *     WINDOW     = S_(PETSCSFWINDOW)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFALLTOALL); if (unlikely(!__pyx_t_4)) __PYX_ERR(44, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ALLTOALL, __pyx_t_4) < (0)) __PYX_ERR(44, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":18
 *     GATHER     = S_(PETSCSFGATHER)
 *     ALLTOALL   = S_(PETSCSFALLTOALL)
 *     WINDOW     = S_(PETSCSFWINDOW)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSFWINDOW); if (unlikely(!__pyx_t_4)) __PYX_ERR(44, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_WINDOW, __pyx_t_4) < (0)) __PYX_ERR(44, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class ScatterType(object):             # <<<<<<<<<<<<<<
 *     """Scatter type.
 * 
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_ScatterType, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(44, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ScatterType, __pyx_t_4) < (0)) __PYX_ERR(44, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":35
 *     """
 * 
 *     Type = ScatterType             # <<<<<<<<<<<<<<
 *     Mode = ScatterMode
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ScatterType); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_14) < (0)) __PYX_ERR(44, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":36
 * 
 *     Type = ScatterType
 *     Mode = ScatterMode             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ScatterMode); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_Mode, __pyx_t_14) < (0)) __PYX_ERR(44, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":58
 *     #
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the scatter.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(44, 58, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Scatter_5view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scatter_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[500])); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_13) < (0)) __PYX_ERR(44, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":77
 *         CHKERR(VecScatterView(self.sct, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the scatter.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(44, 77, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Scatter_7destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scatter_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[501])); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_14) < (0)) __PYX_ERR(44, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":90
 *         return self
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec vec_from,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(44, 90, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Scatter_9create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scatter_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[502])); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_13) < (0)) __PYX_ERR(44, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":146
 *         return self
 * 
 *     def setType(self, scatter_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the scatter.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_scatter_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(44, 146, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(44, 146, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Scatter_11setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scatter_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[503])); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_14) < (0)) __PYX_ERR(44, 146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":160
 *         CHKERR(VecScatterSetType(self.sct, cval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the scatter.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(44, 160, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Scatter_13getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scatter_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[504])); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_13) < (0)) __PYX_ERR(44, 160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":174
 *         return bytes2str(cval)
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the scatter from the options database.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(44, 174, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Scatter_15setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scatter_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[505])); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_14) < (0)) __PYX_ERR(44, 174, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":186
 *         CHKERR(VecScatterSetFromOptions(self.sct))
 * 
 *     def setUp(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the scatter.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(44, 186, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Scatter_17setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scatter_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[506])); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_13) < (0)) __PYX_ERR(44, 186, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":199
 *         return self
 * 
 *     def copy(self) -> Scatter:             # <<<<<<<<<<<<<<
 *         """Return a copy of the scatter."""
 *         cdef Scatter scatter = Scatter()
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Scatter) < (0)) __PYX_ERR(44, 199, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Scatter_19copy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scatter_copy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[507])); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_copy, __pyx_t_14) < (0)) __PYX_ERR(44, 199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":205
 *         return scatter
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def toAll(cls, Vec vec) -> tuple[Scatter, Vec]:
 *         """Create a scatter that communicates a vector to all sharing processes.
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Scatter_Vec) < (0)) __PYX_ERR(44, 205, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Scatter_21toAll, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scatter_toAll, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[508])); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_toAll, __pyx_t_13) < (0)) __PYX_ERR(44, 205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_GetNameInClass(__pyx_t_13, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_toAll); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_Method_ClassMethod(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_toAll, __pyx_t_14) < (0)) __PYX_ERR(44, 205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":233
 *         return (scatter, ovec)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def toZero(cls, Vec vec) -> tuple[Scatter, Vec]:
 *         """Create a scatter that communicates a vector to rank zero.
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Scatter_Vec) < (0)) __PYX_ERR(44, 233, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Scatter_23toZero, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scatter_toZero, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[509])); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_toZero, __pyx_t_13) < (0)) __PYX_ERR(44, 233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_GetNameInClass(__pyx_t_13, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_toZero); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_14 = __Pyx_Method_ClassMethod(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_toZero, __pyx_t_14) < (0)) __PYX_ERR(44, 233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":262
 *     #
 * 
 *     def begin(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec vec_from,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(44, 262, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_ScatterModeSpec) < (0)) __PYX_ERR(44, 262, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(44, 262, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Scatter_25begin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scatter_begin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[510])); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_begin, __pyx_t_13) < (0)) __PYX_ERR(44, 262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":285
 *                                caddv, csctm))
 * 
 *     def end(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec vec_from,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(44, 285, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_ScatterModeSpec) < (0)) __PYX_ERR(44, 285, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(44, 285, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Scatter_27end, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scatter_end, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[511])); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_end, __pyx_t_14) < (0)) __PYX_ERR(44, 285, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":308
 *                              caddv, csctm))
 * 
 *     def scatter(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec vec_from,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(44, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(44, 308, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_ScatterModeSpec) < (0)) __PYX_ERR(44, 308, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(44, 308, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Scatter_29scatter, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Scatter_scatter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[512])); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_scatter, __pyx_t_13) < (0)) __PYX_ERR(44, 308, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":341
 *                              caddv, csctm))
 * 
 *     scatterBegin = begin             # <<<<<<<<<<<<<<
 *     scatterEnd = end
 * 
*/
  __Pyx_GetNameInClass(__pyx_t_13, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_begin); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_scatterBegin, __pyx_t_13) < (0)) __PYX_ERR(44, 341, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":342
 * 
 *     scatterBegin = begin
 *     scatterEnd = end             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __Pyx_GetNameInClass(__pyx_t_13, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_13)) __PYX_ERR(44, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Scatter, __pyx_mstate_global->__pyx_n_u_scatterEnd, __pyx_t_13) < (0)) __PYX_ERR(44, 342, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Scatter.pyx":346
 * # --------------------------------------------------------------------
 * 
 * del ScatterType             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ScatterType) < (0)) __PYX_ERR(44, 346, __pyx_L1_error)

  /* "petsc4py/PETSc/Section.pyx":10
 *         self.sec  = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the section.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 10, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_3view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[513])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_14) < (0)) __PYX_ERR(45, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":29
 *         CHKERR(PetscSectionView(self.sec, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy a section.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(45, 29, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[514])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_13) < (0)) __PYX_ERR(45, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":42
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Allocate a section and set the map contents to the default.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(45, 42, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(45, 42, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_7create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[515])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_14) < (0)) __PYX_ERR(45, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":80
 *         return self
 * 
 *     def clone(self) -> Section:             # <<<<<<<<<<<<<<
 *         """Return a copy of the section.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Section) < (0)) __PYX_ERR(45, 80, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_9clone, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_clone, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[516])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_clone, __pyx_t_13) < (0)) __PYX_ERR(45, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":96
 *         return sec
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Calculate offsets.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 96, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_11setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[517])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_14) < (0)) __PYX_ERR(45, 96, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":110
 *         CHKERR(PetscSectionSetUp(self.sec))
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         """Free all section data.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 110, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_13reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_reset, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[518])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_13) < (0)) __PYX_ERR(45, 110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":122
 *         CHKERR(PetscSectionReset(self.sec))
 * 
 *     def getNumFields(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of fields in a section.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 122, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_15getNumFields, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getNumFields, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[519])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getNumFields, __pyx_t_14) < (0)) __PYX_ERR(45, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":138
 *         return toInt(numFields)
 * 
 *     def setNumFields(self, numFields: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of fields in a section.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_numFields, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 138, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 138, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_17setNumFields, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_setNumFields, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[520])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_setNumFields, __pyx_t_13) < (0)) __PYX_ERR(45, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":156
 *         CHKERR(PetscSectionSetNumFields(self.sec, cnumFields))
 * 
 *     def getFieldName(self, field: int) -> str:             # <<<<<<<<<<<<<<
 *         """Return the name of a field in the section.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 156, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(45, 156, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_19getFieldName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getFieldName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[521])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getFieldName, __pyx_t_14) < (0)) __PYX_ERR(45, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":176
 *         return bytes2str(fieldName)
 * 
 *     def setFieldName(self, field: int, fieldName: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the name of a field in the section.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 176, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_fieldName, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(45, 176, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 176, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_21setFieldName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_setFieldName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[522])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_setFieldName, __pyx_t_13) < (0)) __PYX_ERR(45, 176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":198
 *         CHKERR(PetscSectionSetFieldName(self.sec, cfield, cname))
 * 
 *     def getFieldComponents(self, field: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of field components for the given field.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 198, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 198, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_23getFieldComponents, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getFieldComponents, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[523])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getFieldComponents, __pyx_t_14) < (0)) __PYX_ERR(45, 198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":217
 *         return toInt(cnumComp)
 * 
 *     def setFieldComponents(self, field: int, numComp: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of field components for the given field.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 217, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_numComp, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 217, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 217, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_25setFieldComponents, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_setFieldComponents, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[524])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_setFieldComponents, __pyx_t_13) < (0)) __PYX_ERR(45, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":238
 *         CHKERR(PetscSectionSetFieldComponents(self.sec, cfield, cnumComp))
 * 
 *     def getChart(self) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return the range in which points (indices) lie for this section.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(45, 238, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_27getChart, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getChart, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[525])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getChart, __pyx_t_14) < (0)) __PYX_ERR(45, 238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":255
 *         return toInt(pStart), toInt(pEnd)
 * 
 *     def setChart(self, pStart: int, pEnd: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the range in which points (indices) lie for this section.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_pStart, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 255, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_pEnd, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 255, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 255, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_29setChart, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_setChart, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[526])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_setChart, __pyx_t_13) < (0)) __PYX_ERR(45, 255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":279
 *         CHKERR(PetscSectionSetChart(self.sec, cStart, cEnd))
 * 
 *     def getPermutation(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the permutation that was set with `setPermutation`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(45, 279, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_31getPermutation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getPermutation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[527])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getPermutation, __pyx_t_14) < (0)) __PYX_ERR(45, 279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":294
 *         return perm
 * 
 *     def setPermutation(self, IS perm) -> None:             # <<<<<<<<<<<<<<
 *         """Set the permutation for [0, pEnd - pStart).
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 294, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_33setPermutation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_setPermutation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[528])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_setPermutation, __pyx_t_13) < (0)) __PYX_ERR(45, 294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":311
 *         CHKERR(PetscSectionSetPermutation(self.sec, perm.iset))
 * 
 *     def getDof(self, point: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of degrees of freedom for a given point.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 311, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 311, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_35getDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[529])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getDof, __pyx_t_14) < (0)) __PYX_ERR(45, 311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":333
 *         return toInt(cnumDof)
 * 
 *     def setDof(self, point: int, numDof: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of degrees of freedom associated with a given point.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 333, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_numDof, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 333, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 333, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_37setDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_setDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[530])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_setDof, __pyx_t_13) < (0)) __PYX_ERR(45, 333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":354
 *         CHKERR(PetscSectionSetDof(self.sec, cpoint, cnumDof))
 * 
 *     def addDof(self, point: int, numDof: int) -> None:             # <<<<<<<<<<<<<<
 *         """Add ``numDof`` degrees of freedom associated with a given point.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 354, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_numDof, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 354, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 354, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_39addDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_addDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[531])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_addDof, __pyx_t_14) < (0)) __PYX_ERR(45, 354, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":375
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 375, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 375, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 375, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_41getFieldDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getFieldDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[532])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getFieldDof, __pyx_t_13) < (0)) __PYX_ERR(45, 375, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":397
 *         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.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 397, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 397, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_numDof, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 397, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 397, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_43setFieldDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_setFieldDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[533])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_setFieldDof, __pyx_t_14) < (0)) __PYX_ERR(45, 397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":421
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 421, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 421, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_numDof, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 421, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 421, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_45addFieldDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_addFieldDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[534])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_addFieldDof, __pyx_t_13) < (0)) __PYX_ERR(45, 421, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":445
 *         CHKERR(PetscSectionAddFieldDof(self.sec, cpoint, cfield, cnumDof))
 * 
 *     def getConstraintDof(self, point: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of constrained DOFs associated with a given point.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 445, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 445, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_47getConstraintDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getConstraintDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[535])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getConstraintDof, __pyx_t_14) < (0)) __PYX_ERR(45, 445, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":464
 *         return toInt(cnumDof)
 * 
 *     def setConstraintDof(self, point: int, numDof: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of constrained DOFs associated with a given point.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 464, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_numDof, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 464, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 464, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_49setConstraintDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_setConstraintDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[536])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_setConstraintDof, __pyx_t_13) < (0)) __PYX_ERR(45, 464, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":485
 *         CHKERR(PetscSectionSetConstraintDof(self.sec, cpoint, cnumDof))
 * 
 *     def addConstraintDof(self, point: int, numDof: int) -> None:             # <<<<<<<<<<<<<<
 *         """Increment the number of constrained DOFs for a given point.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 485, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_numDof, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 485, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 485, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_51addConstraintDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_addConstraintDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[537])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_addConstraintDof, __pyx_t_14) < (0)) __PYX_ERR(45, 485, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":506
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 506, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 506, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 506, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_53getFieldConstraintDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getFieldConstraintDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[538])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getFieldConstraintDof, __pyx_t_13) < (0)) __PYX_ERR(45, 506, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":528
 *         return toInt(cnumDof)
 * 
 *     def setFieldConstraintDof(             # <<<<<<<<<<<<<<
 *         self,
 *         point: int,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 528, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 528, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_numDof, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 528, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 528, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_55setFieldConstraintDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_setFieldConstraintDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[539])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_setFieldConstraintDof, __pyx_t_14) < (0)) __PYX_ERR(45, 528, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":557
 *         CHKERR(PetscSectionSetFieldConstraintDof(self.sec, cpoint, cfield, cnumDof))
 * 
 *     def addFieldConstraintDof(             # <<<<<<<<<<<<<<
 *         self,
 *         point: int,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 557, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 557, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_numDof, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 557, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 557, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_57addFieldConstraintDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_addFieldConstraintDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[540])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_addFieldConstraintDof, __pyx_t_13) < (0)) __PYX_ERR(45, 557, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":586
 *         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.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 586, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(45, 586, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_59getConstraintIndices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getConstraintIndices, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[541])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getConstraintIndices, __pyx_t_14) < (0)) __PYX_ERR(45, 586, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":610
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 610, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(45, 610, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 610, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_61setConstraintIndices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_setConstraintIndices, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[542])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_setConstraintIndices, __pyx_t_13) < (0)) __PYX_ERR(45, 610, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":634
 *         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.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 634, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 634, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(45, 634, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_63getFieldConstraintIndices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getFieldConstraintIndice, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[543])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getFieldConstraintIndices, __pyx_t_14) < (0)) __PYX_ERR(45, 634, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":661
 *         return array_i(nindex, indices)
 * 
 *     def setFieldConstraintIndices(             # <<<<<<<<<<<<<<
 *         self,
 *         point: int,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 661, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 661, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(45, 661, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 661, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_65setFieldConstraintIndices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_setFieldConstraintIndice, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[544])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_setFieldConstraintIndices, __pyx_t_13) < (0)) __PYX_ERR(45, 661, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":692
 *         CHKERR(PetscSectionSetFieldConstraintIndices(self.sec, cpoint, cfield, cindices))
 * 
 *     def getMaxDof(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the maximum number of DOFs for any point in the section.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 692, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_67getMaxDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getMaxDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[545])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getMaxDof, __pyx_t_14) < (0)) __PYX_ERR(45, 692, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":706
 *         return toInt(maxDof)
 * 
 *     def getStorageSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the size capable of holding all the DOFs defined in a section.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 706, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_69getStorageSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getStorageSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[546])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getStorageSize, __pyx_t_13) < (0)) __PYX_ERR(45, 706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":720
 *         return toInt(size)
 * 
 *     def getConstrainedStorageSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the size capable of holding all unconstrained DOFs in a section.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 720, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_71getConstrainedStorageSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getConstrainedStorageSiz, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[547])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getConstrainedStorageSize, __pyx_t_14) < (0)) __PYX_ERR(45, 720, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":734
 *         return toInt(size)
 * 
 *     def getOffset(self, point: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the offset for the DOFs associated with the given point.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 734, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 734, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_73getOffset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getOffset, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[548])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getOffset, __pyx_t_13) < (0)) __PYX_ERR(45, 734, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":756
 *         return toInt(offset)
 * 
 *     def setOffset(self, point: int, offset: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the offset for the DOFs associated with the given point.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 756, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_offset, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 756, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 756, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_75setOffset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_setOffset, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[549])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 756, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_setOffset, __pyx_t_14) < (0)) __PYX_ERR(45, 756, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":779
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 779, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 779, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 779, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_77getFieldOffset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getFieldOffset, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[550])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getFieldOffset, __pyx_t_13) < (0)) __PYX_ERR(45, 779, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":805
 *         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.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 805, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 805, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_offset, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(45, 805, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(45, 805, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_79setFieldOffset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_setFieldOffset, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[551])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_setFieldOffset, __pyx_t_14) < (0)) __PYX_ERR(45, 805, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Section.pyx":831
 *         CHKERR(PetscSectionSetFieldOffset(self.sec, cpoint, cfield, coffset))
 * 
 *     def getOffsetRange(self) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return the full range of offsets, [start, end), for a section.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(45, 831, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_81getOffsetRange, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_getOffsetRange, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[552])); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_getOffsetRange, __pyx_t_13) < (0)) __PYX_ERR(45, 831, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Section.pyx":846
 * 
 *     # FIXME: Hardcoded PETSC_FALSE parameters
 *     def createGlobalSection(self, SF sf) -> Section:             # <<<<<<<<<<<<<<
 *         """Create a section describing the global field layout.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(45, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Section) < (0)) __PYX_ERR(45, 846, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7Section_83createGlobalSection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Section_createGlobalSection, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[553])); if (unlikely(!__pyx_t_14)) __PYX_ERR(45, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Section, __pyx_mstate_global->__pyx_n_u_createGlobalSection, __pyx_t_14) < (0)) __PYX_ERR(45, 846, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class MatType(object):             # <<<<<<<<<<<<<<
 *     """Matrix type.
 * 
*/
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[57]); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatType, __pyx_mstate_global->__pyx_n_u_MatType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Matrix_type_See_Also_petsc_MatTy); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_mstate_global->__pyx_tuple[57]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[57]) < 0))) __PYX_ERR(46, 3, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Mat.pyx":11
 * 
 *     """
 *     SAME            = S_(MATSAME)             # <<<<<<<<<<<<<<
 *     MAIJ            = S_(MATMAIJ)
 *     SEQMAIJ         = S_(MATSEQMAIJ)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSAME); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SAME, __pyx_t_4) < (0)) __PYX_ERR(46, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":12
 *     """
 *     SAME            = S_(MATSAME)
 *     MAIJ            = S_(MATMAIJ)             # <<<<<<<<<<<<<<
 *     SEQMAIJ         = S_(MATSEQMAIJ)
 *     MPIMAIJ         = S_(MATMPIMAIJ)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMAIJ); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MAIJ, __pyx_t_4) < (0)) __PYX_ERR(46, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":13
 *     SAME            = S_(MATSAME)
 *     MAIJ            = S_(MATMAIJ)
 *     SEQMAIJ         = S_(MATSEQMAIJ)             # <<<<<<<<<<<<<<
 *     MPIMAIJ         = S_(MATMPIMAIJ)
 *     KAIJ            = S_(MATKAIJ)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQMAIJ); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQMAIJ, __pyx_t_4) < (0)) __PYX_ERR(46, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":14
 *     MAIJ            = S_(MATMAIJ)
 *     SEQMAIJ         = S_(MATSEQMAIJ)
 *     MPIMAIJ         = S_(MATMPIMAIJ)             # <<<<<<<<<<<<<<
 *     KAIJ            = S_(MATKAIJ)
 *     SEQKAIJ         = S_(MATSEQKAIJ)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIMAIJ); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIMAIJ, __pyx_t_4) < (0)) __PYX_ERR(46, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":15
 *     SEQMAIJ         = S_(MATSEQMAIJ)
 *     MPIMAIJ         = S_(MATMPIMAIJ)
 *     KAIJ            = S_(MATKAIJ)             # <<<<<<<<<<<<<<
 *     SEQKAIJ         = S_(MATSEQKAIJ)
 *     MPIKAIJ         = S_(MATMPIKAIJ)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATKAIJ); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_KAIJ, __pyx_t_4) < (0)) __PYX_ERR(46, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":16
 *     MPIMAIJ         = S_(MATMPIMAIJ)
 *     KAIJ            = S_(MATKAIJ)
 *     SEQKAIJ         = S_(MATSEQKAIJ)             # <<<<<<<<<<<<<<
 *     MPIKAIJ         = S_(MATMPIKAIJ)
 *     IS              = S_(MATIS)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQKAIJ); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQKAIJ, __pyx_t_4) < (0)) __PYX_ERR(46, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":17
 *     KAIJ            = S_(MATKAIJ)
 *     SEQKAIJ         = S_(MATSEQKAIJ)
 *     MPIKAIJ         = S_(MATMPIKAIJ)             # <<<<<<<<<<<<<<
 *     IS              = S_(MATIS)
 *     AIJ             = S_(MATAIJ)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIKAIJ); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIKAIJ, __pyx_t_4) < (0)) __PYX_ERR(46, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":18
 *     SEQKAIJ         = S_(MATSEQKAIJ)
 *     MPIKAIJ         = S_(MATMPIKAIJ)
 *     IS              = S_(MATIS)             # <<<<<<<<<<<<<<
 *     AIJ             = S_(MATAIJ)
 *     SEQAIJ          = S_(MATSEQAIJ)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATIS); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_IS, __pyx_t_4) < (0)) __PYX_ERR(46, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":19
 *     MPIKAIJ         = S_(MATMPIKAIJ)
 *     IS              = S_(MATIS)
 *     AIJ             = S_(MATAIJ)             # <<<<<<<<<<<<<<
 *     SEQAIJ          = S_(MATSEQAIJ)
 *     MPIAIJ          = S_(MATMPIAIJ)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJ); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_AIJ, __pyx_t_4) < (0)) __PYX_ERR(46, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":20
 *     IS              = S_(MATIS)
 *     AIJ             = S_(MATAIJ)
 *     SEQAIJ          = S_(MATSEQAIJ)             # <<<<<<<<<<<<<<
 *     MPIAIJ          = S_(MATMPIAIJ)
 *     AIJCRL          = S_(MATAIJCRL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJ); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQAIJ, __pyx_t_4) < (0)) __PYX_ERR(46, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":21
 *     AIJ             = S_(MATAIJ)
 *     SEQAIJ          = S_(MATSEQAIJ)
 *     MPIAIJ          = S_(MATMPIAIJ)             # <<<<<<<<<<<<<<
 *     AIJCRL          = S_(MATAIJCRL)
 *     SEQAIJCRL       = S_(MATSEQAIJCRL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJ); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIAIJ, __pyx_t_4) < (0)) __PYX_ERR(46, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":22
 *     SEQAIJ          = S_(MATSEQAIJ)
 *     MPIAIJ          = S_(MATMPIAIJ)
 *     AIJCRL          = S_(MATAIJCRL)             # <<<<<<<<<<<<<<
 *     SEQAIJCRL       = S_(MATSEQAIJCRL)
 *     MPIAIJCRL       = S_(MATMPIAIJCRL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJCRL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_AIJCRL, __pyx_t_4) < (0)) __PYX_ERR(46, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":23
 *     MPIAIJ          = S_(MATMPIAIJ)
 *     AIJCRL          = S_(MATAIJCRL)
 *     SEQAIJCRL       = S_(MATSEQAIJCRL)             # <<<<<<<<<<<<<<
 *     MPIAIJCRL       = S_(MATMPIAIJCRL)
 *     AIJCUSPARSE     = S_(MATAIJCUSPARSE)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJCRL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQAIJCRL, __pyx_t_4) < (0)) __PYX_ERR(46, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":24
 *     AIJCRL          = S_(MATAIJCRL)
 *     SEQAIJCRL       = S_(MATSEQAIJCRL)
 *     MPIAIJCRL       = S_(MATMPIAIJCRL)             # <<<<<<<<<<<<<<
 *     AIJCUSPARSE     = S_(MATAIJCUSPARSE)
 *     SEQAIJCUSPARSE  = S_(MATSEQAIJCUSPARSE)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJCRL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIAIJCRL, __pyx_t_4) < (0)) __PYX_ERR(46, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":25
 *     SEQAIJCRL       = S_(MATSEQAIJCRL)
 *     MPIAIJCRL       = S_(MATMPIAIJCRL)
 *     AIJCUSPARSE     = S_(MATAIJCUSPARSE)             # <<<<<<<<<<<<<<
 *     SEQAIJCUSPARSE  = S_(MATSEQAIJCUSPARSE)
 *     MPIAIJCUSPARSE  = S_(MATMPIAIJCUSPARSE)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJCUSPARSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_AIJCUSPARSE, __pyx_t_4) < (0)) __PYX_ERR(46, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":26
 *     MPIAIJCRL       = S_(MATMPIAIJCRL)
 *     AIJCUSPARSE     = S_(MATAIJCUSPARSE)
 *     SEQAIJCUSPARSE  = S_(MATSEQAIJCUSPARSE)             # <<<<<<<<<<<<<<
 *     MPIAIJCUSPARSE  = S_(MATMPIAIJCUSPARSE)
 *     AIJVIENNACL     = S_(MATAIJVIENNACL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJCUSPARSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQAIJCUSPARSE, __pyx_t_4) < (0)) __PYX_ERR(46, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":27
 *     AIJCUSPARSE     = S_(MATAIJCUSPARSE)
 *     SEQAIJCUSPARSE  = S_(MATSEQAIJCUSPARSE)
 *     MPIAIJCUSPARSE  = S_(MATMPIAIJCUSPARSE)             # <<<<<<<<<<<<<<
 *     AIJVIENNACL     = S_(MATAIJVIENNACL)
 *     SEQAIJVIENNACL  = S_(MATSEQAIJVIENNACL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJCUSPARSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIAIJCUSPARSE, __pyx_t_4) < (0)) __PYX_ERR(46, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":28
 *     SEQAIJCUSPARSE  = S_(MATSEQAIJCUSPARSE)
 *     MPIAIJCUSPARSE  = S_(MATMPIAIJCUSPARSE)
 *     AIJVIENNACL     = S_(MATAIJVIENNACL)             # <<<<<<<<<<<<<<
 *     SEQAIJVIENNACL  = S_(MATSEQAIJVIENNACL)
 *     MPIAIJVIENNACL  = S_(MATMPIAIJVIENNACL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJVIENNACL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_AIJVIENNACL, __pyx_t_4) < (0)) __PYX_ERR(46, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":29
 *     MPIAIJCUSPARSE  = S_(MATMPIAIJCUSPARSE)
 *     AIJVIENNACL     = S_(MATAIJVIENNACL)
 *     SEQAIJVIENNACL  = S_(MATSEQAIJVIENNACL)             # <<<<<<<<<<<<<<
 *     MPIAIJVIENNACL  = S_(MATMPIAIJVIENNACL)
 *     AIJPERM         = S_(MATAIJPERM)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJVIENNACL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQAIJVIENNACL, __pyx_t_4) < (0)) __PYX_ERR(46, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":30
 *     AIJVIENNACL     = S_(MATAIJVIENNACL)
 *     SEQAIJVIENNACL  = S_(MATSEQAIJVIENNACL)
 *     MPIAIJVIENNACL  = S_(MATMPIAIJVIENNACL)             # <<<<<<<<<<<<<<
 *     AIJPERM         = S_(MATAIJPERM)
 *     SEQAIJPERM      = S_(MATSEQAIJPERM)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJVIENNACL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIAIJVIENNACL, __pyx_t_4) < (0)) __PYX_ERR(46, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":31
 *     SEQAIJVIENNACL  = S_(MATSEQAIJVIENNACL)
 *     MPIAIJVIENNACL  = S_(MATMPIAIJVIENNACL)
 *     AIJPERM         = S_(MATAIJPERM)             # <<<<<<<<<<<<<<
 *     SEQAIJPERM      = S_(MATSEQAIJPERM)
 *     MPIAIJPERM      = S_(MATMPIAIJPERM)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJPERM); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_AIJPERM, __pyx_t_4) < (0)) __PYX_ERR(46, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":32
 *     MPIAIJVIENNACL  = S_(MATMPIAIJVIENNACL)
 *     AIJPERM         = S_(MATAIJPERM)
 *     SEQAIJPERM      = S_(MATSEQAIJPERM)             # <<<<<<<<<<<<<<
 *     MPIAIJPERM      = S_(MATMPIAIJPERM)
 *     AIJSELL         = S_(MATAIJSELL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJPERM); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQAIJPERM, __pyx_t_4) < (0)) __PYX_ERR(46, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":33
 *     AIJPERM         = S_(MATAIJPERM)
 *     SEQAIJPERM      = S_(MATSEQAIJPERM)
 *     MPIAIJPERM      = S_(MATMPIAIJPERM)             # <<<<<<<<<<<<<<
 *     AIJSELL         = S_(MATAIJSELL)
 *     SEQAIJSELL      = S_(MATSEQAIJSELL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJPERM); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIAIJPERM, __pyx_t_4) < (0)) __PYX_ERR(46, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":34
 *     SEQAIJPERM      = S_(MATSEQAIJPERM)
 *     MPIAIJPERM      = S_(MATMPIAIJPERM)
 *     AIJSELL         = S_(MATAIJSELL)             # <<<<<<<<<<<<<<
 *     SEQAIJSELL      = S_(MATSEQAIJSELL)
 *     MPIAIJSELL      = S_(MATMPIAIJSELL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJSELL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_AIJSELL, __pyx_t_4) < (0)) __PYX_ERR(46, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":35
 *     MPIAIJPERM      = S_(MATMPIAIJPERM)
 *     AIJSELL         = S_(MATAIJSELL)
 *     SEQAIJSELL      = S_(MATSEQAIJSELL)             # <<<<<<<<<<<<<<
 *     MPIAIJSELL      = S_(MATMPIAIJSELL)
 *     AIJMKL          = S_(MATAIJMKL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJSELL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQAIJSELL, __pyx_t_4) < (0)) __PYX_ERR(46, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":36
 *     AIJSELL         = S_(MATAIJSELL)
 *     SEQAIJSELL      = S_(MATSEQAIJSELL)
 *     MPIAIJSELL      = S_(MATMPIAIJSELL)             # <<<<<<<<<<<<<<
 *     AIJMKL          = S_(MATAIJMKL)
 *     SEQAIJMKL       = S_(MATSEQAIJMKL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJSELL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIAIJSELL, __pyx_t_4) < (0)) __PYX_ERR(46, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":37
 *     SEQAIJSELL      = S_(MATSEQAIJSELL)
 *     MPIAIJSELL      = S_(MATMPIAIJSELL)
 *     AIJMKL          = S_(MATAIJMKL)             # <<<<<<<<<<<<<<
 *     SEQAIJMKL       = S_(MATSEQAIJMKL)
 *     MPIAIJMKL       = S_(MATMPIAIJMKL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATAIJMKL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_AIJMKL, __pyx_t_4) < (0)) __PYX_ERR(46, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":38
 *     MPIAIJSELL      = S_(MATMPIAIJSELL)
 *     AIJMKL          = S_(MATAIJMKL)
 *     SEQAIJMKL       = S_(MATSEQAIJMKL)             # <<<<<<<<<<<<<<
 *     MPIAIJMKL       = S_(MATMPIAIJMKL)
 *     BAIJMKL         = S_(MATBAIJMKL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQAIJMKL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQAIJMKL, __pyx_t_4) < (0)) __PYX_ERR(46, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":39
 *     AIJMKL          = S_(MATAIJMKL)
 *     SEQAIJMKL       = S_(MATSEQAIJMKL)
 *     MPIAIJMKL       = S_(MATMPIAIJMKL)             # <<<<<<<<<<<<<<
 *     BAIJMKL         = S_(MATBAIJMKL)
 *     SEQBAIJMKL      = S_(MATSEQBAIJMKL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIAIJMKL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIAIJMKL, __pyx_t_4) < (0)) __PYX_ERR(46, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":40
 *     SEQAIJMKL       = S_(MATSEQAIJMKL)
 *     MPIAIJMKL       = S_(MATMPIAIJMKL)
 *     BAIJMKL         = S_(MATBAIJMKL)             # <<<<<<<<<<<<<<
 *     SEQBAIJMKL      = S_(MATSEQBAIJMKL)
 *     MPIBAIJMKL      = S_(MATMPIBAIJMKL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATBAIJMKL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BAIJMKL, __pyx_t_4) < (0)) __PYX_ERR(46, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":41
 *     MPIAIJMKL       = S_(MATMPIAIJMKL)
 *     BAIJMKL         = S_(MATBAIJMKL)
 *     SEQBAIJMKL      = S_(MATSEQBAIJMKL)             # <<<<<<<<<<<<<<
 *     MPIBAIJMKL      = S_(MATMPIBAIJMKL)
 *     SHELL           = S_(MATSHELL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQBAIJMKL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQBAIJMKL, __pyx_t_4) < (0)) __PYX_ERR(46, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":42
 *     BAIJMKL         = S_(MATBAIJMKL)
 *     SEQBAIJMKL      = S_(MATSEQBAIJMKL)
 *     MPIBAIJMKL      = S_(MATMPIBAIJMKL)             # <<<<<<<<<<<<<<
 *     SHELL           = S_(MATSHELL)
 *     DENSE           = S_(MATDENSE)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIBAIJMKL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIBAIJMKL, __pyx_t_4) < (0)) __PYX_ERR(46, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":43
 *     SEQBAIJMKL      = S_(MATSEQBAIJMKL)
 *     MPIBAIJMKL      = S_(MATMPIBAIJMKL)
 *     SHELL           = S_(MATSHELL)             # <<<<<<<<<<<<<<
 *     DENSE           = S_(MATDENSE)
 *     DENSECUDA       = S_(MATDENSECUDA)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSHELL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SHELL, __pyx_t_4) < (0)) __PYX_ERR(46, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":44
 *     MPIBAIJMKL      = S_(MATMPIBAIJMKL)
 *     SHELL           = S_(MATSHELL)
 *     DENSE           = S_(MATDENSE)             # <<<<<<<<<<<<<<
 *     DENSECUDA       = S_(MATDENSECUDA)
 *     DENSEHIP        = S_(MATDENSEHIP)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATDENSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DENSE, __pyx_t_4) < (0)) __PYX_ERR(46, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":45
 *     SHELL           = S_(MATSHELL)
 *     DENSE           = S_(MATDENSE)
 *     DENSECUDA       = S_(MATDENSECUDA)             # <<<<<<<<<<<<<<
 *     DENSEHIP        = S_(MATDENSEHIP)
 *     SEQDENSE        = S_(MATSEQDENSE)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATDENSECUDA); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DENSECUDA, __pyx_t_4) < (0)) __PYX_ERR(46, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":46
 *     DENSE           = S_(MATDENSE)
 *     DENSECUDA       = S_(MATDENSECUDA)
 *     DENSEHIP        = S_(MATDENSEHIP)             # <<<<<<<<<<<<<<
 *     SEQDENSE        = S_(MATSEQDENSE)
 *     SEQDENSECUDA    = S_(MATSEQDENSECUDA)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATDENSEHIP); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DENSEHIP, __pyx_t_4) < (0)) __PYX_ERR(46, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":47
 *     DENSECUDA       = S_(MATDENSECUDA)
 *     DENSEHIP        = S_(MATDENSEHIP)
 *     SEQDENSE        = S_(MATSEQDENSE)             # <<<<<<<<<<<<<<
 *     SEQDENSECUDA    = S_(MATSEQDENSECUDA)
 *     SEQDENSEHIP     = S_(MATSEQDENSEHIP)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQDENSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQDENSE, __pyx_t_4) < (0)) __PYX_ERR(46, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":48
 *     DENSEHIP        = S_(MATDENSEHIP)
 *     SEQDENSE        = S_(MATSEQDENSE)
 *     SEQDENSECUDA    = S_(MATSEQDENSECUDA)             # <<<<<<<<<<<<<<
 *     SEQDENSEHIP     = S_(MATSEQDENSEHIP)
 *     MPIDENSE        = S_(MATMPIDENSE)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQDENSECUDA); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQDENSECUDA, __pyx_t_4) < (0)) __PYX_ERR(46, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":49
 *     SEQDENSE        = S_(MATSEQDENSE)
 *     SEQDENSECUDA    = S_(MATSEQDENSECUDA)
 *     SEQDENSEHIP     = S_(MATSEQDENSEHIP)             # <<<<<<<<<<<<<<
 *     MPIDENSE        = S_(MATMPIDENSE)
 *     MPIDENSECUDA    = S_(MATMPIDENSECUDA)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQDENSEHIP); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQDENSEHIP, __pyx_t_4) < (0)) __PYX_ERR(46, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":50
 *     SEQDENSECUDA    = S_(MATSEQDENSECUDA)
 *     SEQDENSEHIP     = S_(MATSEQDENSEHIP)
 *     MPIDENSE        = S_(MATMPIDENSE)             # <<<<<<<<<<<<<<
 *     MPIDENSECUDA    = S_(MATMPIDENSECUDA)
 *     MPIDENSEHIP     = S_(MATMPIDENSEHIP)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIDENSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIDENSE, __pyx_t_4) < (0)) __PYX_ERR(46, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":51
 *     SEQDENSEHIP     = S_(MATSEQDENSEHIP)
 *     MPIDENSE        = S_(MATMPIDENSE)
 *     MPIDENSECUDA    = S_(MATMPIDENSECUDA)             # <<<<<<<<<<<<<<
 *     MPIDENSEHIP     = S_(MATMPIDENSEHIP)
 *     ELEMENTAL       = S_(MATELEMENTAL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIDENSECUDA); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIDENSECUDA, __pyx_t_4) < (0)) __PYX_ERR(46, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":52
 *     MPIDENSE        = S_(MATMPIDENSE)
 *     MPIDENSECUDA    = S_(MATMPIDENSECUDA)
 *     MPIDENSEHIP     = S_(MATMPIDENSEHIP)             # <<<<<<<<<<<<<<
 *     ELEMENTAL       = S_(MATELEMENTAL)
 *     BAIJ            = S_(MATBAIJ)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIDENSEHIP); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIDENSEHIP, __pyx_t_4) < (0)) __PYX_ERR(46, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":53
 *     MPIDENSECUDA    = S_(MATMPIDENSECUDA)
 *     MPIDENSEHIP     = S_(MATMPIDENSEHIP)
 *     ELEMENTAL       = S_(MATELEMENTAL)             # <<<<<<<<<<<<<<
 *     BAIJ            = S_(MATBAIJ)
 *     SEQBAIJ         = S_(MATSEQBAIJ)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATELEMENTAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ELEMENTAL, __pyx_t_4) < (0)) __PYX_ERR(46, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":54
 *     MPIDENSEHIP     = S_(MATMPIDENSEHIP)
 *     ELEMENTAL       = S_(MATELEMENTAL)
 *     BAIJ            = S_(MATBAIJ)             # <<<<<<<<<<<<<<
 *     SEQBAIJ         = S_(MATSEQBAIJ)
 *     MPIBAIJ         = S_(MATMPIBAIJ)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATBAIJ); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BAIJ, __pyx_t_4) < (0)) __PYX_ERR(46, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":55
 *     ELEMENTAL       = S_(MATELEMENTAL)
 *     BAIJ            = S_(MATBAIJ)
 *     SEQBAIJ         = S_(MATSEQBAIJ)             # <<<<<<<<<<<<<<
 *     MPIBAIJ         = S_(MATMPIBAIJ)
 *     MPIADJ          = S_(MATMPIADJ)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQBAIJ); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQBAIJ, __pyx_t_4) < (0)) __PYX_ERR(46, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":56
 *     BAIJ            = S_(MATBAIJ)
 *     SEQBAIJ         = S_(MATSEQBAIJ)
 *     MPIBAIJ         = S_(MATMPIBAIJ)             # <<<<<<<<<<<<<<
 *     MPIADJ          = S_(MATMPIADJ)
 *     SBAIJ           = S_(MATSBAIJ)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIBAIJ); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIBAIJ, __pyx_t_4) < (0)) __PYX_ERR(46, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":57
 *     SEQBAIJ         = S_(MATSEQBAIJ)
 *     MPIBAIJ         = S_(MATMPIBAIJ)
 *     MPIADJ          = S_(MATMPIADJ)             # <<<<<<<<<<<<<<
 *     SBAIJ           = S_(MATSBAIJ)
 *     SEQSBAIJ        = S_(MATSEQSBAIJ)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPIADJ); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPIADJ, __pyx_t_4) < (0)) __PYX_ERR(46, 57, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":58
 *     MPIBAIJ         = S_(MATMPIBAIJ)
 *     MPIADJ          = S_(MATMPIADJ)
 *     SBAIJ           = S_(MATSBAIJ)             # <<<<<<<<<<<<<<
 *     SEQSBAIJ        = S_(MATSEQSBAIJ)
 *     MPISBAIJ        = S_(MATMPISBAIJ)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSBAIJ); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SBAIJ, __pyx_t_4) < (0)) __PYX_ERR(46, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":59
 *     MPIADJ          = S_(MATMPIADJ)
 *     SBAIJ           = S_(MATSBAIJ)
 *     SEQSBAIJ        = S_(MATSEQSBAIJ)             # <<<<<<<<<<<<<<
 *     MPISBAIJ        = S_(MATMPISBAIJ)
 *     MFFD            = S_(MATMFFD)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQSBAIJ); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQSBAIJ, __pyx_t_4) < (0)) __PYX_ERR(46, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":60
 *     SBAIJ           = S_(MATSBAIJ)
 *     SEQSBAIJ        = S_(MATSEQSBAIJ)
 *     MPISBAIJ        = S_(MATMPISBAIJ)             # <<<<<<<<<<<<<<
 *     MFFD            = S_(MATMFFD)
 *     NORMAL          = S_(MATNORMAL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPISBAIJ); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPISBAIJ, __pyx_t_4) < (0)) __PYX_ERR(46, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":61
 *     SEQSBAIJ        = S_(MATSEQSBAIJ)
 *     MPISBAIJ        = S_(MATMPISBAIJ)
 *     MFFD            = S_(MATMFFD)             # <<<<<<<<<<<<<<
 *     NORMAL          = S_(MATNORMAL)
 *     NORMALHERMITIAN = S_(MATNORMALHERMITIAN)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMFFD); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MFFD, __pyx_t_4) < (0)) __PYX_ERR(46, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":62
 *     MPISBAIJ        = S_(MATMPISBAIJ)
 *     MFFD            = S_(MATMFFD)
 *     NORMAL          = S_(MATNORMAL)             # <<<<<<<<<<<<<<
 *     NORMALHERMITIAN = S_(MATNORMALHERMITIAN)
 *     LRC             = S_(MATLRC)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATNORMAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NORMAL, __pyx_t_4) < (0)) __PYX_ERR(46, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":63
 *     MFFD            = S_(MATMFFD)
 *     NORMAL          = S_(MATNORMAL)
 *     NORMALHERMITIAN = S_(MATNORMALHERMITIAN)             # <<<<<<<<<<<<<<
 *     LRC             = S_(MATLRC)
 *     SCATTER         = S_(MATSCATTER)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATNORMALHERMITIAN); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NORMALHERMITIAN, __pyx_t_4) < (0)) __PYX_ERR(46, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":64
 *     NORMAL          = S_(MATNORMAL)
 *     NORMALHERMITIAN = S_(MATNORMALHERMITIAN)
 *     LRC             = S_(MATLRC)             # <<<<<<<<<<<<<<
 *     SCATTER         = S_(MATSCATTER)
 *     BLOCKMAT        = S_(MATBLOCKMAT)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATLRC); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LRC, __pyx_t_4) < (0)) __PYX_ERR(46, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":65
 *     NORMALHERMITIAN = S_(MATNORMALHERMITIAN)
 *     LRC             = S_(MATLRC)
 *     SCATTER         = S_(MATSCATTER)             # <<<<<<<<<<<<<<
 *     BLOCKMAT        = S_(MATBLOCKMAT)
 *     COMPOSITE       = S_(MATCOMPOSITE)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSCATTER); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SCATTER, __pyx_t_4) < (0)) __PYX_ERR(46, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":66
 *     LRC             = S_(MATLRC)
 *     SCATTER         = S_(MATSCATTER)
 *     BLOCKMAT        = S_(MATBLOCKMAT)             # <<<<<<<<<<<<<<
 *     COMPOSITE       = S_(MATCOMPOSITE)
 *     FFT             = S_(MATFFT)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATBLOCKMAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BLOCKMAT, __pyx_t_4) < (0)) __PYX_ERR(46, 66, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":67
 *     SCATTER         = S_(MATSCATTER)
 *     BLOCKMAT        = S_(MATBLOCKMAT)
 *     COMPOSITE       = S_(MATCOMPOSITE)             # <<<<<<<<<<<<<<
 *     FFT             = S_(MATFFT)
 *     FFTW            = S_(MATFFTW)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATCOMPOSITE); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_COMPOSITE, __pyx_t_4) < (0)) __PYX_ERR(46, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":68
 *     BLOCKMAT        = S_(MATBLOCKMAT)
 *     COMPOSITE       = S_(MATCOMPOSITE)
 *     FFT             = S_(MATFFT)             # <<<<<<<<<<<<<<
 *     FFTW            = S_(MATFFTW)
 *     SEQCUFFT        = S_(MATSEQCUFFT)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATFFT); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FFT, __pyx_t_4) < (0)) __PYX_ERR(46, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":69
 *     COMPOSITE       = S_(MATCOMPOSITE)
 *     FFT             = S_(MATFFT)
 *     FFTW            = S_(MATFFTW)             # <<<<<<<<<<<<<<
 *     SEQCUFFT        = S_(MATSEQCUFFT)
 *     TRANSPOSE       = S_(MATTRANSPOSEVIRTUAL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATFFTW); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FFTW, __pyx_t_4) < (0)) __PYX_ERR(46, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":70
 *     FFT             = S_(MATFFT)
 *     FFTW            = S_(MATFFTW)
 *     SEQCUFFT        = S_(MATSEQCUFFT)             # <<<<<<<<<<<<<<
 *     TRANSPOSE       = S_(MATTRANSPOSEVIRTUAL)
 *     HERMITIANTRANSPOSE = S_(MATHERMITIANTRANSPOSEVIRTUAL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQCUFFT); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQCUFFT, __pyx_t_4) < (0)) __PYX_ERR(46, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":71
 *     FFTW            = S_(MATFFTW)
 *     SEQCUFFT        = S_(MATSEQCUFFT)
 *     TRANSPOSE       = S_(MATTRANSPOSEVIRTUAL)             # <<<<<<<<<<<<<<
 *     HERMITIANTRANSPOSE = S_(MATHERMITIANTRANSPOSEVIRTUAL)
 *     SCHURCOMPLEMENT = S_(MATSCHURCOMPLEMENT)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATTRANSPOSEVIRTUAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_TRANSPOSE, __pyx_t_4) < (0)) __PYX_ERR(46, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":72
 *     SEQCUFFT        = S_(MATSEQCUFFT)
 *     TRANSPOSE       = S_(MATTRANSPOSEVIRTUAL)
 *     HERMITIANTRANSPOSE = S_(MATHERMITIANTRANSPOSEVIRTUAL)             # <<<<<<<<<<<<<<
 *     SCHURCOMPLEMENT = S_(MATSCHURCOMPLEMENT)
 *     PYTHON          = S_(MATPYTHON)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATHERMITIANTRANSPOSEVIRTUAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HERMITIANTRANSPOSE, __pyx_t_4) < (0)) __PYX_ERR(46, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":73
 *     TRANSPOSE       = S_(MATTRANSPOSEVIRTUAL)
 *     HERMITIANTRANSPOSE = S_(MATHERMITIANTRANSPOSEVIRTUAL)
 *     SCHURCOMPLEMENT = S_(MATSCHURCOMPLEMENT)             # <<<<<<<<<<<<<<
 *     PYTHON          = S_(MATPYTHON)
 *     HYPRE           = S_(MATHYPRE)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSCHURCOMPLEMENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SCHURCOMPLEMENT, __pyx_t_4) < (0)) __PYX_ERR(46, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":74
 *     HERMITIANTRANSPOSE = S_(MATHERMITIANTRANSPOSEVIRTUAL)
 *     SCHURCOMPLEMENT = S_(MATSCHURCOMPLEMENT)
 *     PYTHON          = S_(MATPYTHON)             # <<<<<<<<<<<<<<
 *     HYPRE           = S_(MATHYPRE)
 *     HYPRESTRUCT     = S_(MATHYPRESTRUCT)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATPYTHON); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PYTHON, __pyx_t_4) < (0)) __PYX_ERR(46, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":75
 *     SCHURCOMPLEMENT = S_(MATSCHURCOMPLEMENT)
 *     PYTHON          = S_(MATPYTHON)
 *     HYPRE           = S_(MATHYPRE)             # <<<<<<<<<<<<<<
 *     HYPRESTRUCT     = S_(MATHYPRESTRUCT)
 *     HYPRESSTRUCT    = S_(MATHYPRESSTRUCT)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATHYPRE); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HYPRE, __pyx_t_4) < (0)) __PYX_ERR(46, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":76
 *     PYTHON          = S_(MATPYTHON)
 *     HYPRE           = S_(MATHYPRE)
 *     HYPRESTRUCT     = S_(MATHYPRESTRUCT)             # <<<<<<<<<<<<<<
 *     HYPRESSTRUCT    = S_(MATHYPRESSTRUCT)
 *     SUBMATRIX       = S_(MATSUBMATRIX)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATHYPRESTRUCT); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HYPRESTRUCT, __pyx_t_4) < (0)) __PYX_ERR(46, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":77
 *     HYPRE           = S_(MATHYPRE)
 *     HYPRESTRUCT     = S_(MATHYPRESTRUCT)
 *     HYPRESSTRUCT    = S_(MATHYPRESSTRUCT)             # <<<<<<<<<<<<<<
 *     SUBMATRIX       = S_(MATSUBMATRIX)
 *     LOCALREF        = S_(MATLOCALREF)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATHYPRESSTRUCT); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HYPRESSTRUCT, __pyx_t_4) < (0)) __PYX_ERR(46, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":78
 *     HYPRESTRUCT     = S_(MATHYPRESTRUCT)
 *     HYPRESSTRUCT    = S_(MATHYPRESSTRUCT)
 *     SUBMATRIX       = S_(MATSUBMATRIX)             # <<<<<<<<<<<<<<
 *     LOCALREF        = S_(MATLOCALREF)
 *     NEST            = S_(MATNEST)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSUBMATRIX); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SUBMATRIX, __pyx_t_4) < (0)) __PYX_ERR(46, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":79
 *     HYPRESSTRUCT    = S_(MATHYPRESSTRUCT)
 *     SUBMATRIX       = S_(MATSUBMATRIX)
 *     LOCALREF        = S_(MATLOCALREF)             # <<<<<<<<<<<<<<
 *     NEST            = S_(MATNEST)
 *     PREALLOCATOR    = S_(MATPREALLOCATOR)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATLOCALREF); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LOCALREF, __pyx_t_4) < (0)) __PYX_ERR(46, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":80
 *     SUBMATRIX       = S_(MATSUBMATRIX)
 *     LOCALREF        = S_(MATLOCALREF)
 *     NEST            = S_(MATNEST)             # <<<<<<<<<<<<<<
 *     PREALLOCATOR    = S_(MATPREALLOCATOR)
 *     SELL            = S_(MATSELL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATNEST); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NEST, __pyx_t_4) < (0)) __PYX_ERR(46, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":81
 *     LOCALREF        = S_(MATLOCALREF)
 *     NEST            = S_(MATNEST)
 *     PREALLOCATOR    = S_(MATPREALLOCATOR)             # <<<<<<<<<<<<<<
 *     SELL            = S_(MATSELL)
 *     SEQSELL         = S_(MATSEQSELL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATPREALLOCATOR); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PREALLOCATOR, __pyx_t_4) < (0)) __PYX_ERR(46, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":82
 *     NEST            = S_(MATNEST)
 *     PREALLOCATOR    = S_(MATPREALLOCATOR)
 *     SELL            = S_(MATSELL)             # <<<<<<<<<<<<<<
 *     SEQSELL         = S_(MATSEQSELL)
 *     MPISELL         = S_(MATMPISELL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSELL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SELL, __pyx_t_4) < (0)) __PYX_ERR(46, 82, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":83
 *     PREALLOCATOR    = S_(MATPREALLOCATOR)
 *     SELL            = S_(MATSELL)
 *     SEQSELL         = S_(MATSEQSELL)             # <<<<<<<<<<<<<<
 *     MPISELL         = S_(MATMPISELL)
 *     DUMMY           = S_(MATDUMMY)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSEQSELL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SEQSELL, __pyx_t_4) < (0)) __PYX_ERR(46, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":84
 *     SELL            = S_(MATSELL)
 *     SEQSELL         = S_(MATSEQSELL)
 *     MPISELL         = S_(MATMPISELL)             # <<<<<<<<<<<<<<
 *     DUMMY           = S_(MATDUMMY)
 *     LMVM            = S_(MATLMVM)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATMPISELL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MPISELL, __pyx_t_4) < (0)) __PYX_ERR(46, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":85
 *     SEQSELL         = S_(MATSEQSELL)
 *     MPISELL         = S_(MATMPISELL)
 *     DUMMY           = S_(MATDUMMY)             # <<<<<<<<<<<<<<
 *     LMVM            = S_(MATLMVM)
 *     LMVMDFP         = S_(MATLMVMDFP)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATDUMMY); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DUMMY, __pyx_t_4) < (0)) __PYX_ERR(46, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":86
 *     MPISELL         = S_(MATMPISELL)
 *     DUMMY           = S_(MATDUMMY)
 *     LMVM            = S_(MATLMVM)             # <<<<<<<<<<<<<<
 *     LMVMDFP         = S_(MATLMVMDFP)
 *     LMVMDDFP        = S_(MATLMVMDDFP)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVM); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LMVM, __pyx_t_4) < (0)) __PYX_ERR(46, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":87
 *     DUMMY           = S_(MATDUMMY)
 *     LMVM            = S_(MATLMVM)
 *     LMVMDFP         = S_(MATLMVMDFP)             # <<<<<<<<<<<<<<
 *     LMVMDDFP        = S_(MATLMVMDDFP)
 *     LMVMBFGS        = S_(MATLMVMBFGS)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMDFP); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LMVMDFP, __pyx_t_4) < (0)) __PYX_ERR(46, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":88
 *     LMVM            = S_(MATLMVM)
 *     LMVMDFP         = S_(MATLMVMDFP)
 *     LMVMDDFP        = S_(MATLMVMDDFP)             # <<<<<<<<<<<<<<
 *     LMVMBFGS        = S_(MATLMVMBFGS)
 *     LMVMDBFGS       = S_(MATLMVMDBFGS)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMDDFP); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LMVMDDFP, __pyx_t_4) < (0)) __PYX_ERR(46, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":89
 *     LMVMDFP         = S_(MATLMVMDFP)
 *     LMVMDDFP        = S_(MATLMVMDDFP)
 *     LMVMBFGS        = S_(MATLMVMBFGS)             # <<<<<<<<<<<<<<
 *     LMVMDBFGS       = S_(MATLMVMDBFGS)
 *     LMVMDQN         = S_(MATLMVMDQN)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMBFGS); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LMVMBFGS, __pyx_t_4) < (0)) __PYX_ERR(46, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":90
 *     LMVMDDFP        = S_(MATLMVMDDFP)
 *     LMVMBFGS        = S_(MATLMVMBFGS)
 *     LMVMDBFGS       = S_(MATLMVMDBFGS)             # <<<<<<<<<<<<<<
 *     LMVMDQN         = S_(MATLMVMDQN)
 *     LMVMSR1         = S_(MATLMVMSR1)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMDBFGS); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LMVMDBFGS, __pyx_t_4) < (0)) __PYX_ERR(46, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":91
 *     LMVMBFGS        = S_(MATLMVMBFGS)
 *     LMVMDBFGS       = S_(MATLMVMDBFGS)
 *     LMVMDQN         = S_(MATLMVMDQN)             # <<<<<<<<<<<<<<
 *     LMVMSR1         = S_(MATLMVMSR1)
 *     LMVMBROYDEN     = S_(MATLMVMBROYDEN)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMDQN); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LMVMDQN, __pyx_t_4) < (0)) __PYX_ERR(46, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":92
 *     LMVMDBFGS       = S_(MATLMVMDBFGS)
 *     LMVMDQN         = S_(MATLMVMDQN)
 *     LMVMSR1         = S_(MATLMVMSR1)             # <<<<<<<<<<<<<<
 *     LMVMBROYDEN     = S_(MATLMVMBROYDEN)
 *     LMVMBADBROYDEN  = S_(MATLMVMBADBROYDEN)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMSR1); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LMVMSR1, __pyx_t_4) < (0)) __PYX_ERR(46, 92, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":93
 *     LMVMDQN         = S_(MATLMVMDQN)
 *     LMVMSR1         = S_(MATLMVMSR1)
 *     LMVMBROYDEN     = S_(MATLMVMBROYDEN)             # <<<<<<<<<<<<<<
 *     LMVMBADBROYDEN  = S_(MATLMVMBADBROYDEN)
 *     LMVMSYMBROYDEN  = S_(MATLMVMSYMBROYDEN)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMBROYDEN); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LMVMBROYDEN, __pyx_t_4) < (0)) __PYX_ERR(46, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":94
 *     LMVMSR1         = S_(MATLMVMSR1)
 *     LMVMBROYDEN     = S_(MATLMVMBROYDEN)
 *     LMVMBADBROYDEN  = S_(MATLMVMBADBROYDEN)             # <<<<<<<<<<<<<<
 *     LMVMSYMBROYDEN  = S_(MATLMVMSYMBROYDEN)
 *     LMVMSYMBADBROYDEN = S_(MATLMVMSYMBADBROYDEN)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMBADBROYDEN); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LMVMBADBROYDEN, __pyx_t_4) < (0)) __PYX_ERR(46, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":95
 *     LMVMBROYDEN     = S_(MATLMVMBROYDEN)
 *     LMVMBADBROYDEN  = S_(MATLMVMBADBROYDEN)
 *     LMVMSYMBROYDEN  = S_(MATLMVMSYMBROYDEN)             # <<<<<<<<<<<<<<
 *     LMVMSYMBADBROYDEN = S_(MATLMVMSYMBADBROYDEN)
 *     LMVMDIAGBBROYDEN = S_(MATLMVMDIAGBROYDEN)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMSYMBROYDEN); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LMVMSYMBROYDEN, __pyx_t_4) < (0)) __PYX_ERR(46, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":96
 *     LMVMBADBROYDEN  = S_(MATLMVMBADBROYDEN)
 *     LMVMSYMBROYDEN  = S_(MATLMVMSYMBROYDEN)
 *     LMVMSYMBADBROYDEN = S_(MATLMVMSYMBADBROYDEN)             # <<<<<<<<<<<<<<
 *     LMVMDIAGBBROYDEN = S_(MATLMVMDIAGBROYDEN)
 *     CONSTANTDIAGONAL = S_(MATCONSTANTDIAGONAL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMSYMBADBROYDEN); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LMVMSYMBADBROYDEN, __pyx_t_4) < (0)) __PYX_ERR(46, 96, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":97
 *     LMVMSYMBROYDEN  = S_(MATLMVMSYMBROYDEN)
 *     LMVMSYMBADBROYDEN = S_(MATLMVMSYMBADBROYDEN)
 *     LMVMDIAGBBROYDEN = S_(MATLMVMDIAGBROYDEN)             # <<<<<<<<<<<<<<
 *     CONSTANTDIAGONAL = S_(MATCONSTANTDIAGONAL)
 *     DIAGONAL         = S_(MATDIAGONAL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATLMVMDIAGBROYDEN); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LMVMDIAGBBROYDEN, __pyx_t_4) < (0)) __PYX_ERR(46, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":98
 *     LMVMSYMBADBROYDEN = S_(MATLMVMSYMBADBROYDEN)
 *     LMVMDIAGBBROYDEN = S_(MATLMVMDIAGBROYDEN)
 *     CONSTANTDIAGONAL = S_(MATCONSTANTDIAGONAL)             # <<<<<<<<<<<<<<
 *     DIAGONAL         = S_(MATDIAGONAL)
 *     H2OPUS           = S_(MATH2OPUS)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATCONSTANTDIAGONAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CONSTANTDIAGONAL, __pyx_t_4) < (0)) __PYX_ERR(46, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":99
 *     LMVMDIAGBBROYDEN = S_(MATLMVMDIAGBROYDEN)
 *     CONSTANTDIAGONAL = S_(MATCONSTANTDIAGONAL)
 *     DIAGONAL         = S_(MATDIAGONAL)             # <<<<<<<<<<<<<<
 *     H2OPUS           = S_(MATH2OPUS)
 *     HTOOL            = S_(MATHTOOL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATDIAGONAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DIAGONAL, __pyx_t_4) < (0)) __PYX_ERR(46, 99, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":100
 *     CONSTANTDIAGONAL = S_(MATCONSTANTDIAGONAL)
 *     DIAGONAL         = S_(MATDIAGONAL)
 *     H2OPUS           = S_(MATH2OPUS)             # <<<<<<<<<<<<<<
 *     HTOOL            = S_(MATHTOOL)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATH2OPUS); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_H2OPUS, __pyx_t_4) < (0)) __PYX_ERR(46, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":101
 *     DIAGONAL         = S_(MATDIAGONAL)
 *     H2OPUS           = S_(MATH2OPUS)
 *     HTOOL            = S_(MATHTOOL)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATHTOOL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HTOOL, __pyx_t_4) < (0)) __PYX_ERR(46, 101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class MatType(object):             # <<<<<<<<<<<<<<
 *     """Matrix type.
 * 
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_MatType, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MatType, __pyx_t_4) < (0)) __PYX_ERR(46, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":104
 * 
 * 
 * class MatOption(object):             # <<<<<<<<<<<<<<
 *     """Matrix option.
 * 
*/
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[59]); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatOption, __pyx_mstate_global->__pyx_n_u_MatOption, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Matrix_option_See_Also_petsc_Mat); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_mstate_global->__pyx_tuple[59]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[59]) < 0))) __PYX_ERR(46, 104, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Mat.pyx":112
 * 
 *     """
 *     OPTION_MIN                  = MAT_OPTION_MIN             # <<<<<<<<<<<<<<
 *     UNUSED_NONZERO_LOCATION_ERR = MAT_UNUSED_NONZERO_LOCATION_ERR
 *     ROW_ORIENTED                = MAT_ROW_ORIENTED
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatOption(MAT_OPTION_MIN); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OPTION_MIN, __pyx_t_4) < (0)) __PYX_ERR(46, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":113
 *     """
 *     OPTION_MIN                  = MAT_OPTION_MIN
 *     UNUSED_NONZERO_LOCATION_ERR = MAT_UNUSED_NONZERO_LOCATION_ERR             # <<<<<<<<<<<<<<
 *     ROW_ORIENTED                = MAT_ROW_ORIENTED
 *     SYMMETRIC                   = MAT_SYMMETRIC
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatOption(MAT_UNUSED_NONZERO_LOCATION_ERR); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_UNUSED_NONZERO_LOCATION_ERR, __pyx_t_4) < (0)) __PYX_ERR(46, 113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":114
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_ROW_ORIENTED); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ROW_ORIENTED, __pyx_t_4) < (0)) __PYX_ERR(46, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":115
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_SYMMETRIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SYMMETRIC, __pyx_t_4) < (0)) __PYX_ERR(46, 115, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":116
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_STRUCTURALLY_SYMMETRIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_STRUCTURALLY_SYMMETRIC, __pyx_t_4) < (0)) __PYX_ERR(46, 116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":117
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_FORCE_DIAGONAL_ENTRIES); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FORCE_DIAGONAL_ENTRIES, __pyx_t_4) < (0)) __PYX_ERR(46, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":118
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_IGNORE_OFF_PROC_ENTRIES); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_IGNORE_OFF_PROC_ENTRIES, __pyx_t_4) < (0)) __PYX_ERR(46, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":119
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_USE_HASH_TABLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_USE_HASH_TABLE, __pyx_t_4) < (0)) __PYX_ERR(46, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":120
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_KEEP_NONZERO_PATTERN); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_KEEP_NONZERO_PATTERN, __pyx_t_4) < (0)) __PYX_ERR(46, 120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":121
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_IGNORE_ZERO_ENTRIES); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_IGNORE_ZERO_ENTRIES, __pyx_t_4) < (0)) __PYX_ERR(46, 121, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":122
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_USE_INODES); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_USE_INODES, __pyx_t_4) < (0)) __PYX_ERR(46, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":123
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_HERMITIAN); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HERMITIAN, __pyx_t_4) < (0)) __PYX_ERR(46, 123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":124
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_SYMMETRY_ETERNAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SYMMETRY_ETERNAL, __pyx_t_4) < (0)) __PYX_ERR(46, 124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":125
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_NEW_NONZERO_LOCATION_ERR); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NEW_NONZERO_LOCATION_ERR, __pyx_t_4) < (0)) __PYX_ERR(46, 125, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":126
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_IGNORE_LOWER_TRIANGULAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_IGNORE_LOWER_TRIANGULAR, __pyx_t_4) < (0)) __PYX_ERR(46, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":127
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_ERROR_LOWER_TRIANGULAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ERROR_LOWER_TRIANGULAR, __pyx_t_4) < (0)) __PYX_ERR(46, 127, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":128
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_GETROW_UPPERTRIANGULAR); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_GETROW_UPPERTRIANGULAR, __pyx_t_4) < (0)) __PYX_ERR(46, 128, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":129
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_SPD); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SPD, __pyx_t_4) < (0)) __PYX_ERR(46, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":130
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_NO_OFF_PROC_ZERO_ROWS); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NO_OFF_PROC_ZERO_ROWS, __pyx_t_4) < (0)) __PYX_ERR(46, 130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":131
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_NO_OFF_PROC_ENTRIES); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NO_OFF_PROC_ENTRIES, __pyx_t_4) < (0)) __PYX_ERR(46, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":132
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_NEW_NONZERO_LOCATIONS); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NEW_NONZERO_LOCATIONS, __pyx_t_4) < (0)) __PYX_ERR(46, 132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":133
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_NEW_NONZERO_ALLOCATION_ERR); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NEW_NONZERO_ALLOCATION_ERR, __pyx_t_4) < (0)) __PYX_ERR(46, 133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":134
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_SUBSET_OFF_PROC_ENTRIES); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SUBSET_OFF_PROC_ENTRIES, __pyx_t_4) < (0)) __PYX_ERR(46, 134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":135
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_SUBMAT_SINGLEIS); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SUBMAT_SINGLEIS, __pyx_t_4) < (0)) __PYX_ERR(46, 135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":136
 *     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_4 = __Pyx_PyLong_From_MatOption(MAT_STRUCTURE_ONLY); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_STRUCTURE_ONLY, __pyx_t_4) < (0)) __PYX_ERR(46, 136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":137
 *     SUBMAT_SINGLEIS             = MAT_SUBMAT_SINGLEIS
 *     STRUCTURE_ONLY              = MAT_STRUCTURE_ONLY
 *     SORTED_FULL                 = MAT_SORTED_FULL             # <<<<<<<<<<<<<<
 *     OPTION_MAX                  = MAT_OPTION_MAX
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatOption(MAT_SORTED_FULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SORTED_FULL, __pyx_t_4) < (0)) __PYX_ERR(46, 137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":138
 *     STRUCTURE_ONLY              = MAT_STRUCTURE_ONLY
 *     SORTED_FULL                 = MAT_SORTED_FULL
 *     OPTION_MAX                  = MAT_OPTION_MAX             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatOption(MAT_OPTION_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OPTION_MAX, __pyx_t_4) < (0)) __PYX_ERR(46, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":104
 * 
 * 
 * class MatOption(object):             # <<<<<<<<<<<<<<
 *     """Matrix option.
 * 
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_MatOption, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MatOption, __pyx_t_4) < (0)) __PYX_ERR(46, 104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":141
 * 
 * 
 * class MatAssemblyType(object):             # <<<<<<<<<<<<<<
 *     """Matrix assembly type.
 * 
*/
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[61]); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatAssemblyType, __pyx_mstate_global->__pyx_n_u_MatAssemblyType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Matrix_assembly_type_See_Also_pe); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_mstate_global->__pyx_tuple[61]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[61]) < 0))) __PYX_ERR(46, 141, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Mat.pyx":150
 *     """
 *     # native
 *     FINAL_ASSEMBLY = MAT_FINAL_ASSEMBLY             # <<<<<<<<<<<<<<
 *     FLUSH_ASSEMBLY = MAT_FLUSH_ASSEMBLY
 *     # aliases
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatAssemblyType(MAT_FINAL_ASSEMBLY); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FINAL_ASSEMBLY, __pyx_t_4) < (0)) __PYX_ERR(46, 150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":151
 *     # native
 *     FINAL_ASSEMBLY = MAT_FINAL_ASSEMBLY
 *     FLUSH_ASSEMBLY = MAT_FLUSH_ASSEMBLY             # <<<<<<<<<<<<<<
 *     # aliases
 *     FINAL = FINAL_ASSEMBLY
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatAssemblyType(MAT_FLUSH_ASSEMBLY); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FLUSH_ASSEMBLY, __pyx_t_4) < (0)) __PYX_ERR(46, 151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":153
 *     FLUSH_ASSEMBLY = MAT_FLUSH_ASSEMBLY
 *     # aliases
 *     FINAL = FINAL_ASSEMBLY             # <<<<<<<<<<<<<<
 *     FLUSH = FLUSH_ASSEMBLY
 * 
*/
  __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FINAL_ASSEMBLY);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FINAL_ASSEMBLY);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FINAL, __pyx_t_4) < (0)) __PYX_ERR(46, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":154
 *     # aliases
 *     FINAL = FINAL_ASSEMBLY
 *     FLUSH = FLUSH_ASSEMBLY             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FLUSH_ASSEMBLY);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FLUSH_ASSEMBLY);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FLUSH, __pyx_t_4) < (0)) __PYX_ERR(46, 154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":141
 * 
 * 
 * class MatAssemblyType(object):             # <<<<<<<<<<<<<<
 *     """Matrix assembly type.
 * 
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_MatAssemblyType, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MatAssemblyType, __pyx_t_4) < (0)) __PYX_ERR(46, 141, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":157
 * 
 * 
 * class MatInfoType(object):             # <<<<<<<<<<<<<<
 *     """Matrix info type."""
 *     LOCAL = MAT_LOCAL
*/
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[63]); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatInfoType, __pyx_mstate_global->__pyx_n_u_MatInfoType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Matrix_info_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_mstate_global->__pyx_tuple[63]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[63]) < 0))) __PYX_ERR(46, 157, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Mat.pyx":159
 * class MatInfoType(object):
 *     """Matrix info type."""
 *     LOCAL = MAT_LOCAL             # <<<<<<<<<<<<<<
 *     GLOBAL_MAX = MAT_GLOBAL_MAX
 *     GLOBAL_SUM = MAT_GLOBAL_SUM
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatInfoType(MAT_LOCAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LOCAL, __pyx_t_4) < (0)) __PYX_ERR(46, 159, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":160
 *     """Matrix info type."""
 *     LOCAL = MAT_LOCAL
 *     GLOBAL_MAX = MAT_GLOBAL_MAX             # <<<<<<<<<<<<<<
 *     GLOBAL_SUM = MAT_GLOBAL_SUM
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatInfoType(MAT_GLOBAL_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_GLOBAL_MAX, __pyx_t_4) < (0)) __PYX_ERR(46, 160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":161
 *     LOCAL = MAT_LOCAL
 *     GLOBAL_MAX = MAT_GLOBAL_MAX
 *     GLOBAL_SUM = MAT_GLOBAL_SUM             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatInfoType(MAT_GLOBAL_SUM); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_GLOBAL_SUM, __pyx_t_4) < (0)) __PYX_ERR(46, 161, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":157
 * 
 * 
 * class MatInfoType(object):             # <<<<<<<<<<<<<<
 *     """Matrix info type."""
 *     LOCAL = MAT_LOCAL
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_MatInfoType, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MatInfoType, __pyx_t_4) < (0)) __PYX_ERR(46, 157, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":164
 * 
 * 
 * class MatStructure(object):             # <<<<<<<<<<<<<<
 *     """Matrix modification structure.
 * 
*/
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[65]); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatStructure, __pyx_mstate_global->__pyx_n_u_MatStructure, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Matrix_modification_structure_Se); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_mstate_global->__pyx_tuple[65]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[65]) < 0))) __PYX_ERR(46, 164, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Mat.pyx":173
 *     """
 *     # native
 *     SAME_NONZERO_PATTERN      = MAT_SAME_NONZERO_PATTERN             # <<<<<<<<<<<<<<
 *     DIFFERENT_NONZERO_PATTERN = MAT_DIFFERENT_NONZERO_PATTERN
 *     SUBSET_NONZERO_PATTERN    = MAT_SUBSET_NONZERO_PATTERN
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatStructure(SAME_NONZERO_PATTERN); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SAME_NONZERO_PATTERN, __pyx_t_4) < (0)) __PYX_ERR(46, 173, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":174
 *     # 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_4 = __Pyx_PyLong_From_MatStructure(DIFFERENT_NONZERO_PATTERN); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DIFFERENT_NONZERO_PATTERN, __pyx_t_4) < (0)) __PYX_ERR(46, 174, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":175
 *     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_4 = __Pyx_PyLong_From_MatStructure(SUBSET_NONZERO_PATTERN); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SUBSET_NONZERO_PATTERN, __pyx_t_4) < (0)) __PYX_ERR(46, 175, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":176
 *     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_4 = __Pyx_PyLong_From_MatStructure(UNKNOWN_NONZERO_PATTERN); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_UNKNOWN_NONZERO_PATTERN, __pyx_t_4) < (0)) __PYX_ERR(46, 176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":178
 *     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_4 = PyObject_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SAME_NONZERO_PATTERN);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SAME_NONZERO_PATTERN);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SAME, __pyx_t_4) < (0)) __PYX_ERR(46, 178, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SAME_NZ, __pyx_t_4) < (0)) __PYX_ERR(46, 178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":179
 *     # 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_4 = PyObject_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SUBSET_NONZERO_PATTERN);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SUBSET_NONZERO_PATTERN);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SUBSET, __pyx_t_4) < (0)) __PYX_ERR(46, 179, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SUBSET_NZ, __pyx_t_4) < (0)) __PYX_ERR(46, 179, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":180
 *     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_4 = PyObject_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DIFFERENT_NONZERO_PATTERN);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DIFFERENT_NONZERO_PATTERN);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DIFFERENT, __pyx_t_4) < (0)) __PYX_ERR(46, 180, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DIFFERENT_NZ, __pyx_t_4) < (0)) __PYX_ERR(46, 180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":181
 *     SUBSET    = SUBSET_NZ    = SUBSET_NONZERO_PATTERN
 *     DIFFERENT = DIFFERENT_NZ = DIFFERENT_NONZERO_PATTERN
 *     UNKNOWN   = UNKNOWN_NZ   = UNKNOWN_NONZERO_PATTERN             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_UNKNOWN_NONZERO_PATTERN);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_UNKNOWN_NONZERO_PATTERN);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_UNKNOWN, __pyx_t_4) < (0)) __PYX_ERR(46, 181, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_UNKNOWN_NZ, __pyx_t_4) < (0)) __PYX_ERR(46, 181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":164
 * 
 * 
 * class MatStructure(object):             # <<<<<<<<<<<<<<
 *     """Matrix modification structure.
 * 
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_MatStructure, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MatStructure, __pyx_t_4) < (0)) __PYX_ERR(46, 164, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":184
 * 
 * 
 * class MatDuplicateOption(object):             # <<<<<<<<<<<<<<
 *     """Matrix duplicate option.
 * 
*/
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[67]); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatDuplicateOption, __pyx_mstate_global->__pyx_n_u_MatDuplicateOption, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Matrix_duplicate_option_See_Also); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_mstate_global->__pyx_tuple[67]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[67]) < 0))) __PYX_ERR(46, 184, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Mat.pyx":192
 * 
 *     """
 *     DO_NOT_COPY_VALUES    = MAT_DO_NOT_COPY_VALUES             # <<<<<<<<<<<<<<
 *     COPY_VALUES           = MAT_COPY_VALUES
 *     SHARE_NONZERO_PATTERN = MAT_SHARE_NONZERO_PATTERN
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatDuplicateOption(MAT_DO_NOT_COPY_VALUES); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DO_NOT_COPY_VALUES, __pyx_t_4) < (0)) __PYX_ERR(46, 192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":193
 *     """
 *     DO_NOT_COPY_VALUES    = MAT_DO_NOT_COPY_VALUES
 *     COPY_VALUES           = MAT_COPY_VALUES             # <<<<<<<<<<<<<<
 *     SHARE_NONZERO_PATTERN = MAT_SHARE_NONZERO_PATTERN
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatDuplicateOption(MAT_COPY_VALUES); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_COPY_VALUES, __pyx_t_4) < (0)) __PYX_ERR(46, 193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":194
 *     DO_NOT_COPY_VALUES    = MAT_DO_NOT_COPY_VALUES
 *     COPY_VALUES           = MAT_COPY_VALUES
 *     SHARE_NONZERO_PATTERN = MAT_SHARE_NONZERO_PATTERN             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatDuplicateOption(MAT_SHARE_NONZERO_PATTERN); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SHARE_NONZERO_PATTERN, __pyx_t_4) < (0)) __PYX_ERR(46, 194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":184
 * 
 * 
 * class MatDuplicateOption(object):             # <<<<<<<<<<<<<<
 *     """Matrix duplicate option.
 * 
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_MatDuplicateOption, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MatDuplicateOption, __pyx_t_4) < (0)) __PYX_ERR(46, 184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":197
 * 
 * 
 * class MatOrderingType(object):             # <<<<<<<<<<<<<<
 *     """Factored matrix ordering type.
 * 
*/
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[69]); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatOrderingType, __pyx_mstate_global->__pyx_n_u_MatOrderingType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Factored_matrix_ordering_type_Se); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_mstate_global->__pyx_tuple[69]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[69]) < 0))) __PYX_ERR(46, 197, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Mat.pyx":205
 * 
 *     """
 *     NATURAL     = S_(MATORDERINGNATURAL)             # <<<<<<<<<<<<<<
 *     ND          = S_(MATORDERINGND)
 *     OWD         = S_(MATORDERING1WD)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGNATURAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NATURAL, __pyx_t_4) < (0)) __PYX_ERR(46, 205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":206
 *     """
 *     NATURAL     = S_(MATORDERINGNATURAL)
 *     ND          = S_(MATORDERINGND)             # <<<<<<<<<<<<<<
 *     OWD         = S_(MATORDERING1WD)
 *     RCM         = S_(MATORDERINGRCM)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGND); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ND, __pyx_t_4) < (0)) __PYX_ERR(46, 206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":207
 *     NATURAL     = S_(MATORDERINGNATURAL)
 *     ND          = S_(MATORDERINGND)
 *     OWD         = S_(MATORDERING1WD)             # <<<<<<<<<<<<<<
 *     RCM         = S_(MATORDERINGRCM)
 *     QMD         = S_(MATORDERINGQMD)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERING1WD); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OWD, __pyx_t_4) < (0)) __PYX_ERR(46, 207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":208
 *     ND          = S_(MATORDERINGND)
 *     OWD         = S_(MATORDERING1WD)
 *     RCM         = S_(MATORDERINGRCM)             # <<<<<<<<<<<<<<
 *     QMD         = S_(MATORDERINGQMD)
 *     ROWLENGTH   = S_(MATORDERINGROWLENGTH)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGRCM); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_RCM, __pyx_t_4) < (0)) __PYX_ERR(46, 208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":209
 *     OWD         = S_(MATORDERING1WD)
 *     RCM         = S_(MATORDERINGRCM)
 *     QMD         = S_(MATORDERINGQMD)             # <<<<<<<<<<<<<<
 *     ROWLENGTH   = S_(MATORDERINGROWLENGTH)
 *     WBM         = S_(MATORDERINGWBM)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGQMD); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_QMD, __pyx_t_4) < (0)) __PYX_ERR(46, 209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":210
 *     RCM         = S_(MATORDERINGRCM)
 *     QMD         = S_(MATORDERINGQMD)
 *     ROWLENGTH   = S_(MATORDERINGROWLENGTH)             # <<<<<<<<<<<<<<
 *     WBM         = S_(MATORDERINGWBM)
 *     SPECTRAL    = S_(MATORDERINGSPECTRAL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGROWLENGTH); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ROWLENGTH, __pyx_t_4) < (0)) __PYX_ERR(46, 210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":211
 *     QMD         = S_(MATORDERINGQMD)
 *     ROWLENGTH   = S_(MATORDERINGROWLENGTH)
 *     WBM         = S_(MATORDERINGWBM)             # <<<<<<<<<<<<<<
 *     SPECTRAL    = S_(MATORDERINGSPECTRAL)
 *     AMD         = S_(MATORDERINGAMD)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGWBM); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_WBM, __pyx_t_4) < (0)) __PYX_ERR(46, 211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":212
 *     ROWLENGTH   = S_(MATORDERINGROWLENGTH)
 *     WBM         = S_(MATORDERINGWBM)
 *     SPECTRAL    = S_(MATORDERINGSPECTRAL)             # <<<<<<<<<<<<<<
 *     AMD         = S_(MATORDERINGAMD)
 *     METISND     = S_(MATORDERINGMETISND)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGSPECTRAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SPECTRAL, __pyx_t_4) < (0)) __PYX_ERR(46, 212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":213
 *     WBM         = S_(MATORDERINGWBM)
 *     SPECTRAL    = S_(MATORDERINGSPECTRAL)
 *     AMD         = S_(MATORDERINGAMD)             # <<<<<<<<<<<<<<
 *     METISND     = S_(MATORDERINGMETISND)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGAMD); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_AMD, __pyx_t_4) < (0)) __PYX_ERR(46, 213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":214
 *     SPECTRAL    = S_(MATORDERINGSPECTRAL)
 *     AMD         = S_(MATORDERINGAMD)
 *     METISND     = S_(MATORDERINGMETISND)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATORDERINGMETISND); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_METISND, __pyx_t_4) < (0)) __PYX_ERR(46, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":197
 * 
 * 
 * class MatOrderingType(object):             # <<<<<<<<<<<<<<
 *     """Factored matrix ordering type.
 * 
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_MatOrderingType, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MatOrderingType, __pyx_t_4) < (0)) __PYX_ERR(46, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":217
 * 
 * 
 * class MatSolverType(object):             # <<<<<<<<<<<<<<
 *     """Factored matrix solver type.
 * 
*/
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[71]); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatSolverType, __pyx_mstate_global->__pyx_n_u_MatSolverType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Factored_matrix_solver_type_See); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_mstate_global->__pyx_tuple[71]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[71]) < 0))) __PYX_ERR(46, 217, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Mat.pyx":225
 * 
 *     """
 *     SUPERLU         = S_(MATSOLVERSUPERLU)             # <<<<<<<<<<<<<<
 *     SUPERLU_DIST    = S_(MATSOLVERSUPERLU_DIST)
 *     STRUMPACK       = S_(MATSOLVERSTRUMPACK)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERSUPERLU); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SUPERLU, __pyx_t_4) < (0)) __PYX_ERR(46, 225, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":226
 *     """
 *     SUPERLU         = S_(MATSOLVERSUPERLU)
 *     SUPERLU_DIST    = S_(MATSOLVERSUPERLU_DIST)             # <<<<<<<<<<<<<<
 *     STRUMPACK       = S_(MATSOLVERSTRUMPACK)
 *     UMFPACK         = S_(MATSOLVERUMFPACK)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERSUPERLU_DIST); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SUPERLU_DIST, __pyx_t_4) < (0)) __PYX_ERR(46, 226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":227
 *     SUPERLU         = S_(MATSOLVERSUPERLU)
 *     SUPERLU_DIST    = S_(MATSOLVERSUPERLU_DIST)
 *     STRUMPACK       = S_(MATSOLVERSTRUMPACK)             # <<<<<<<<<<<<<<
 *     UMFPACK         = S_(MATSOLVERUMFPACK)
 *     CHOLMOD         = S_(MATSOLVERCHOLMOD)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERSTRUMPACK); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_STRUMPACK, __pyx_t_4) < (0)) __PYX_ERR(46, 227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":228
 *     SUPERLU_DIST    = S_(MATSOLVERSUPERLU_DIST)
 *     STRUMPACK       = S_(MATSOLVERSTRUMPACK)
 *     UMFPACK         = S_(MATSOLVERUMFPACK)             # <<<<<<<<<<<<<<
 *     CHOLMOD         = S_(MATSOLVERCHOLMOD)
 *     KLU             = S_(MATSOLVERKLU)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERUMFPACK); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_UMFPACK, __pyx_t_4) < (0)) __PYX_ERR(46, 228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":229
 *     STRUMPACK       = S_(MATSOLVERSTRUMPACK)
 *     UMFPACK         = S_(MATSOLVERUMFPACK)
 *     CHOLMOD         = S_(MATSOLVERCHOLMOD)             # <<<<<<<<<<<<<<
 *     KLU             = S_(MATSOLVERKLU)
 *     ELEMENTAL       = S_(MATSOLVERELEMENTAL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERCHOLMOD); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CHOLMOD, __pyx_t_4) < (0)) __PYX_ERR(46, 229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":230
 *     UMFPACK         = S_(MATSOLVERUMFPACK)
 *     CHOLMOD         = S_(MATSOLVERCHOLMOD)
 *     KLU             = S_(MATSOLVERKLU)             # <<<<<<<<<<<<<<
 *     ELEMENTAL       = S_(MATSOLVERELEMENTAL)
 *     SCALAPACK       = S_(MATSOLVERSCALAPACK)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERKLU); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_KLU, __pyx_t_4) < (0)) __PYX_ERR(46, 230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":231
 *     CHOLMOD         = S_(MATSOLVERCHOLMOD)
 *     KLU             = S_(MATSOLVERKLU)
 *     ELEMENTAL       = S_(MATSOLVERELEMENTAL)             # <<<<<<<<<<<<<<
 *     SCALAPACK       = S_(MATSOLVERSCALAPACK)
 *     ESSL            = S_(MATSOLVERESSL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERELEMENTAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ELEMENTAL, __pyx_t_4) < (0)) __PYX_ERR(46, 231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":232
 *     KLU             = S_(MATSOLVERKLU)
 *     ELEMENTAL       = S_(MATSOLVERELEMENTAL)
 *     SCALAPACK       = S_(MATSOLVERSCALAPACK)             # <<<<<<<<<<<<<<
 *     ESSL            = S_(MATSOLVERESSL)
 *     LUSOL           = S_(MATSOLVERLUSOL)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERSCALAPACK); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SCALAPACK, __pyx_t_4) < (0)) __PYX_ERR(46, 232, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":233
 *     ELEMENTAL       = S_(MATSOLVERELEMENTAL)
 *     SCALAPACK       = S_(MATSOLVERSCALAPACK)
 *     ESSL            = S_(MATSOLVERESSL)             # <<<<<<<<<<<<<<
 *     LUSOL           = S_(MATSOLVERLUSOL)
 *     MUMPS           = S_(MATSOLVERMUMPS)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERESSL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ESSL, __pyx_t_4) < (0)) __PYX_ERR(46, 233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":234
 *     SCALAPACK       = S_(MATSOLVERSCALAPACK)
 *     ESSL            = S_(MATSOLVERESSL)
 *     LUSOL           = S_(MATSOLVERLUSOL)             # <<<<<<<<<<<<<<
 *     MUMPS           = S_(MATSOLVERMUMPS)
 *     MKL_PARDISO     = S_(MATSOLVERMKL_PARDISO)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERLUSOL); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LUSOL, __pyx_t_4) < (0)) __PYX_ERR(46, 234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":235
 *     ESSL            = S_(MATSOLVERESSL)
 *     LUSOL           = S_(MATSOLVERLUSOL)
 *     MUMPS           = S_(MATSOLVERMUMPS)             # <<<<<<<<<<<<<<
 *     MKL_PARDISO     = S_(MATSOLVERMKL_PARDISO)
 *     MKL_CPARDISO    = S_(MATSOLVERMKL_CPARDISO)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERMUMPS); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MUMPS, __pyx_t_4) < (0)) __PYX_ERR(46, 235, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":236
 *     LUSOL           = S_(MATSOLVERLUSOL)
 *     MUMPS           = S_(MATSOLVERMUMPS)
 *     MKL_PARDISO     = S_(MATSOLVERMKL_PARDISO)             # <<<<<<<<<<<<<<
 *     MKL_CPARDISO    = S_(MATSOLVERMKL_CPARDISO)
 *     PASTIX          = S_(MATSOLVERPASTIX)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERMKL_PARDISO); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MKL_PARDISO, __pyx_t_4) < (0)) __PYX_ERR(46, 236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":237
 *     MUMPS           = S_(MATSOLVERMUMPS)
 *     MKL_PARDISO     = S_(MATSOLVERMKL_PARDISO)
 *     MKL_CPARDISO    = S_(MATSOLVERMKL_CPARDISO)             # <<<<<<<<<<<<<<
 *     PASTIX          = S_(MATSOLVERPASTIX)
 *     MATLAB          = S_(MATSOLVERMATLAB)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERMKL_CPARDISO); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MKL_CPARDISO, __pyx_t_4) < (0)) __PYX_ERR(46, 237, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":238
 *     MKL_PARDISO     = S_(MATSOLVERMKL_PARDISO)
 *     MKL_CPARDISO    = S_(MATSOLVERMKL_CPARDISO)
 *     PASTIX          = S_(MATSOLVERPASTIX)             # <<<<<<<<<<<<<<
 *     MATLAB          = S_(MATSOLVERMATLAB)
 *     PETSC           = S_(MATSOLVERPETSC)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERPASTIX); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PASTIX, __pyx_t_4) < (0)) __PYX_ERR(46, 238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":239
 *     MKL_CPARDISO    = S_(MATSOLVERMKL_CPARDISO)
 *     PASTIX          = S_(MATSOLVERPASTIX)
 *     MATLAB          = S_(MATSOLVERMATLAB)             # <<<<<<<<<<<<<<
 *     PETSC           = S_(MATSOLVERPETSC)
 *     BAS             = S_(MATSOLVERBAS)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERMATLAB); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MATLAB, __pyx_t_4) < (0)) __PYX_ERR(46, 239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":240
 *     PASTIX          = S_(MATSOLVERPASTIX)
 *     MATLAB          = S_(MATSOLVERMATLAB)
 *     PETSC           = S_(MATSOLVERPETSC)             # <<<<<<<<<<<<<<
 *     BAS             = S_(MATSOLVERBAS)
 *     CUSPARSE        = S_(MATSOLVERCUSPARSE)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERPETSC); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PETSC, __pyx_t_4) < (0)) __PYX_ERR(46, 240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":241
 *     MATLAB          = S_(MATSOLVERMATLAB)
 *     PETSC           = S_(MATSOLVERPETSC)
 *     BAS             = S_(MATSOLVERBAS)             # <<<<<<<<<<<<<<
 *     CUSPARSE        = S_(MATSOLVERCUSPARSE)
 *     CUDA            = S_(MATSOLVERCUDA)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERBAS); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BAS, __pyx_t_4) < (0)) __PYX_ERR(46, 241, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":242
 *     PETSC           = S_(MATSOLVERPETSC)
 *     BAS             = S_(MATSOLVERBAS)
 *     CUSPARSE        = S_(MATSOLVERCUSPARSE)             # <<<<<<<<<<<<<<
 *     CUDA            = S_(MATSOLVERCUDA)
 *     SPQR            = S_(MATSOLVERSPQR)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERCUSPARSE); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CUSPARSE, __pyx_t_4) < (0)) __PYX_ERR(46, 242, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":243
 *     BAS             = S_(MATSOLVERBAS)
 *     CUSPARSE        = S_(MATSOLVERCUSPARSE)
 *     CUDA            = S_(MATSOLVERCUDA)             # <<<<<<<<<<<<<<
 *     SPQR            = S_(MATSOLVERSPQR)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERCUDA); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CUDA, __pyx_t_4) < (0)) __PYX_ERR(46, 243, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":244
 *     CUSPARSE        = S_(MATSOLVERCUSPARSE)
 *     CUDA            = S_(MATSOLVERCUDA)
 *     SPQR            = S_(MATSOLVERSPQR)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(MATSOLVERSPQR); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SPQR, __pyx_t_4) < (0)) __PYX_ERR(46, 244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":217
 * 
 * 
 * class MatSolverType(object):             # <<<<<<<<<<<<<<
 *     """Factored matrix solver type.
 * 
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_MatSolverType, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MatSolverType, __pyx_t_4) < (0)) __PYX_ERR(46, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":247
 * 
 * 
 * class MatFactorShiftType(object):             # <<<<<<<<<<<<<<
 *     """Factored matrix shift type.
 * 
*/
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[73]); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatFactorShiftType, __pyx_mstate_global->__pyx_n_u_MatFactorShiftType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Factored_matrix_shift_type_See_A); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_mstate_global->__pyx_tuple[73]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[73]) < 0))) __PYX_ERR(46, 247, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Mat.pyx":256
 *     """
 *     # native
 *     NONE              = MAT_SHIFT_NONE             # <<<<<<<<<<<<<<
 *     NONZERO           = MAT_SHIFT_NONZERO
 *     POSITIVE_DEFINITE = MAT_SHIFT_POSITIVE_DEFINITE
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatFactorShiftType(MAT_SHIFT_NONE); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NONE, __pyx_t_4) < (0)) __PYX_ERR(46, 256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":257
 *     # native
 *     NONE              = MAT_SHIFT_NONE
 *     NONZERO           = MAT_SHIFT_NONZERO             # <<<<<<<<<<<<<<
 *     POSITIVE_DEFINITE = MAT_SHIFT_POSITIVE_DEFINITE
 *     INBLOCKS          = MAT_SHIFT_INBLOCKS
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatFactorShiftType(MAT_SHIFT_NONZERO); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NONZERO, __pyx_t_4) < (0)) __PYX_ERR(46, 257, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":258
 *     NONE              = MAT_SHIFT_NONE
 *     NONZERO           = MAT_SHIFT_NONZERO
 *     POSITIVE_DEFINITE = MAT_SHIFT_POSITIVE_DEFINITE             # <<<<<<<<<<<<<<
 *     INBLOCKS          = MAT_SHIFT_INBLOCKS
 *     # aliases
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatFactorShiftType(MAT_SHIFT_POSITIVE_DEFINITE); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_POSITIVE_DEFINITE, __pyx_t_4) < (0)) __PYX_ERR(46, 258, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":259
 *     NONZERO           = MAT_SHIFT_NONZERO
 *     POSITIVE_DEFINITE = MAT_SHIFT_POSITIVE_DEFINITE
 *     INBLOCKS          = MAT_SHIFT_INBLOCKS             # <<<<<<<<<<<<<<
 *     # aliases
 *     NZ = MAT_SHIFT_NONZERO
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatFactorShiftType(MAT_SHIFT_INBLOCKS); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_INBLOCKS, __pyx_t_4) < (0)) __PYX_ERR(46, 259, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":261
 *     INBLOCKS          = MAT_SHIFT_INBLOCKS
 *     # aliases
 *     NZ = MAT_SHIFT_NONZERO             # <<<<<<<<<<<<<<
 *     PD = MAT_SHIFT_POSITIVE_DEFINITE
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatFactorShiftType(MAT_SHIFT_NONZERO); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_NZ, __pyx_t_4) < (0)) __PYX_ERR(46, 261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":262
 *     # aliases
 *     NZ = MAT_SHIFT_NONZERO
 *     PD = MAT_SHIFT_POSITIVE_DEFINITE             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatFactorShiftType(MAT_SHIFT_POSITIVE_DEFINITE); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PD, __pyx_t_4) < (0)) __PYX_ERR(46, 262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":247
 * 
 * 
 * class MatFactorShiftType(object):             # <<<<<<<<<<<<<<
 *     """Factored matrix shift type.
 * 
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_MatFactorShiftType, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MatFactorShiftType, __pyx_t_4) < (0)) __PYX_ERR(46, 247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":265
 * 
 * 
 * class MatSORType(object):             # <<<<<<<<<<<<<<
 *     """Matrix SOR type.
 * 
*/
  __pyx_t_14 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[75]); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  __pyx_t_13 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_13, __pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatSORType, __pyx_mstate_global->__pyx_n_u_MatSORType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Matrix_SOR_type_See_Also_petsc_M); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_14 != __pyx_mstate_global->__pyx_tuple[75]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[75]) < 0))) __PYX_ERR(46, 265, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Mat.pyx":273
 * 
 *     """
 *     FORWARD_SWEEP         = SOR_FORWARD_SWEEP             # <<<<<<<<<<<<<<
 *     BACKWARD_SWEEP        = SOR_BACKWARD_SWEEP
 *     SYMMETRY_SWEEP        = SOR_SYMMETRIC_SWEEP
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatSORType(SOR_FORWARD_SWEEP); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FORWARD_SWEEP, __pyx_t_4) < (0)) __PYX_ERR(46, 273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":274
 *     """
 *     FORWARD_SWEEP         = SOR_FORWARD_SWEEP
 *     BACKWARD_SWEEP        = SOR_BACKWARD_SWEEP             # <<<<<<<<<<<<<<
 *     SYMMETRY_SWEEP        = SOR_SYMMETRIC_SWEEP
 *     LOCAL_FORWARD_SWEEP   = SOR_LOCAL_FORWARD_SWEEP
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatSORType(SOR_BACKWARD_SWEEP); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BACKWARD_SWEEP, __pyx_t_4) < (0)) __PYX_ERR(46, 274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":275
 *     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_4 = __Pyx_PyLong_From_MatSORType(SOR_SYMMETRIC_SWEEP); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SYMMETRY_SWEEP, __pyx_t_4) < (0)) __PYX_ERR(46, 275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":276
 *     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_4 = __Pyx_PyLong_From_MatSORType(SOR_LOCAL_FORWARD_SWEEP); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LOCAL_FORWARD_SWEEP, __pyx_t_4) < (0)) __PYX_ERR(46, 276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":277
 *     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_4 = __Pyx_PyLong_From_MatSORType(SOR_LOCAL_BACKWARD_SWEEP); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LOCAL_BACKWARD_SWEEP, __pyx_t_4) < (0)) __PYX_ERR(46, 277, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":278
 *     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_4 = __Pyx_PyLong_From_MatSORType(SOR_LOCAL_SYMMETRIC_SWEEP); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LOCAL_SYMMETRIC_SWEEP, __pyx_t_4) < (0)) __PYX_ERR(46, 278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":279
 *     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_4 = __Pyx_PyLong_From_MatSORType(SOR_ZERO_INITIAL_GUESS); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ZERO_INITIAL_GUESS, __pyx_t_4) < (0)) __PYX_ERR(46, 279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":280
 *     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_4 = __Pyx_PyLong_From_MatSORType(SOR_EISENSTAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_EISENSTAT, __pyx_t_4) < (0)) __PYX_ERR(46, 280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":281
 *     ZERO_INITIAL_GUESS    = SOR_ZERO_INITIAL_GUESS
 *     EISENSTAT             = SOR_EISENSTAT
 *     APPLY_UPPER           = SOR_APPLY_UPPER             # <<<<<<<<<<<<<<
 *     APPLY_LOWER           = SOR_APPLY_LOWER
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatSORType(SOR_APPLY_UPPER); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_APPLY_UPPER, __pyx_t_4) < (0)) __PYX_ERR(46, 281, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":282
 *     EISENSTAT             = SOR_EISENSTAT
 *     APPLY_UPPER           = SOR_APPLY_UPPER
 *     APPLY_LOWER           = SOR_APPLY_LOWER             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_MatSORType(SOR_APPLY_LOWER); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_APPLY_LOWER, __pyx_t_4) < (0)) __PYX_ERR(46, 282, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":265
 * 
 * 
 * class MatSORType(object):             # <<<<<<<<<<<<<<
 *     """Matrix SOR type.
 * 
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_MatSORType, __pyx_t_14, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MatSORType, __pyx_t_4) < (0)) __PYX_ERR(46, 265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":387
 *     """
 * 
 *     Type            = MatType             # <<<<<<<<<<<<<<
 *     Option          = MatOption
 *     AssemblyType    = MatAssemblyType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatType); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_14) < (0)) __PYX_ERR(46, 387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":388
 * 
 *     Type            = MatType
 *     Option          = MatOption             # <<<<<<<<<<<<<<
 *     AssemblyType    = MatAssemblyType
 *     InfoType        = MatInfoType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatOption); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_Option, __pyx_t_14) < (0)) __PYX_ERR(46, 388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":389
 *     Type            = MatType
 *     Option          = MatOption
 *     AssemblyType    = MatAssemblyType             # <<<<<<<<<<<<<<
 *     InfoType        = MatInfoType
 *     Structure       = MatStructure
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatAssemblyType); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_AssemblyType, __pyx_t_14) < (0)) __PYX_ERR(46, 389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":390
 *     Option          = MatOption
 *     AssemblyType    = MatAssemblyType
 *     InfoType        = MatInfoType             # <<<<<<<<<<<<<<
 *     Structure       = MatStructure
 *     DuplicateOption = MatDuplicateOption
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatInfoType); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_InfoType, __pyx_t_14) < (0)) __PYX_ERR(46, 390, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":391
 *     AssemblyType    = MatAssemblyType
 *     InfoType        = MatInfoType
 *     Structure       = MatStructure             # <<<<<<<<<<<<<<
 *     DuplicateOption = MatDuplicateOption
 *     OrderingType    = MatOrderingType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatStructure); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_Structure, __pyx_t_14) < (0)) __PYX_ERR(46, 391, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":392
 *     InfoType        = MatInfoType
 *     Structure       = MatStructure
 *     DuplicateOption = MatDuplicateOption             # <<<<<<<<<<<<<<
 *     OrderingType    = MatOrderingType
 *     SolverType      = MatSolverType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatDuplicateOption); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_DuplicateOption, __pyx_t_14) < (0)) __PYX_ERR(46, 392, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":393
 *     Structure       = MatStructure
 *     DuplicateOption = MatDuplicateOption
 *     OrderingType    = MatOrderingType             # <<<<<<<<<<<<<<
 *     SolverType      = MatSolverType
 *     FactorShiftType = MatFactorShiftType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatOrderingType); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_OrderingType, __pyx_t_14) < (0)) __PYX_ERR(46, 393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":394
 *     DuplicateOption = MatDuplicateOption
 *     OrderingType    = MatOrderingType
 *     SolverType      = MatSolverType             # <<<<<<<<<<<<<<
 *     FactorShiftType = MatFactorShiftType
 *     SORType         = MatSORType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatSolverType); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_SolverType, __pyx_t_14) < (0)) __PYX_ERR(46, 394, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":395
 *     OrderingType    = MatOrderingType
 *     SolverType      = MatSolverType
 *     FactorShiftType = MatFactorShiftType             # <<<<<<<<<<<<<<
 *     SORType         = MatSORType
 *     #
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatFactorShiftType); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_FactorShiftType, __pyx_t_14) < (0)) __PYX_ERR(46, 395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":396
 *     SolverType      = MatSolverType
 *     FactorShiftType = MatFactorShiftType
 *     SORType         = MatSORType             # <<<<<<<<<<<<<<
 *     #
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_MatSORType); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_SORType, __pyx_t_14) < (0)) __PYX_ERR(46, 396, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":422
 *         return mat_imul(self, other)
 * 
 *     def __idiv__(self, other):             # <<<<<<<<<<<<<<
 *         return mat_idiv(self, other)
 * 
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_13__idiv__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat___idiv, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[554])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_idiv, __pyx_t_14) < (0)) __PYX_ERR(46, 422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":448
 *         return mat_rmul(self, other)
 * 
 *     def __div__(self, other):             # <<<<<<<<<<<<<<
 *         return mat_div(self, other)
 * 
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_29__div__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat___div, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[555])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_div_2, __pyx_t_14) < (0)) __PYX_ERR(46, 448, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":451
 *         return mat_div(self, other)
 * 
 *     def __rdiv__(self, other):             # <<<<<<<<<<<<<<
 *         return mat_rdiv(self, other)
 * 
*/
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_31__rdiv__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat___rdiv, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[556])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_rdiv, __pyx_t_14) < (0)) __PYX_ERR(46, 451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":478
 *     #
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 478, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_45view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[557])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_13) < (0)) __PYX_ERR(46, 478, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":503
 *         CHKERR(MatView(self.mat, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 503, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_47destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[558])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_14) < (0)) __PYX_ERR(46, 503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":516
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create the matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(46, 516, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 516, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_49create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[559])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_13) < (0)) __PYX_ERR(46, 516, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":542
 *         return self
 * 
 *     def setType(self, mat_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the matrix type.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_mat_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(46, 542, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 542, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_51setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[560])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_14) < (0)) __PYX_ERR(46, 542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":561
 *         CHKERR(MatSetType(self.mat, cval))
 * 
 *     def setSizes(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_MatSizeSpec) < (0)) __PYX_ERR(46, 561, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_MatBlockSizeSpec_None) < (0)) __PYX_ERR(46, 561, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 561, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_53setSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[561])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setSizes, __pyx_t_13) < (0)) __PYX_ERR(46, 561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":614
 *                 CHKERR(MatSetBlockSize(self.mat, rbs))
 * 
 *     def setBlockSize(self, bsize: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the matrix block size (same for rows and columns).
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 614, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 614, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_55setBlockSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setBlockSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[562])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setBlockSize, __pyx_t_14) < (0)) __PYX_ERR(46, 614, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":632
 *         CHKERR(MatSetBlockSize(self.mat, bs))
 * 
 *     def setBlockSizes(self, row_bsize: int, col_bsize: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the row and column block sizes.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_row_bsize, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 632, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_col_bsize, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 632, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 632, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_57setBlockSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setBlockSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[563])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setBlockSizes, __pyx_t_13) < (0)) __PYX_ERR(46, 632, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":653
 *         CHKERR(MatSetBlockSizes(self.mat, rbs, cbs))
 * 
 *     def setVariableBlockSizes(self, blocks: Sequence[int]) -> None:             # <<<<<<<<<<<<<<
 *         """Set diagonal point-blocks of the matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_blocks, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 653, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 653, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_59setVariableBlockSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setVariableBlockSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[564])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setVariableBlockSizes, __pyx_t_14) < (0)) __PYX_ERR(46, 653, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":667
 *         CHKERR(MatSetVariableBlockSizes(self.mat, nb, b))
 * 
 *     def setVecType(self, vec_type: Vec.Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the vector type.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_vec_type, __pyx_mstate_global->__pyx_kp_u_Vec_Type_str) < (0)) __PYX_ERR(46, 667, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 667, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_61setVecType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setVecType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[565])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setVecType, __pyx_t_13) < (0)) __PYX_ERR(46, 667, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":686
 *         CHKERR(MatSetVecType(self.mat, cval))
 * 
 *     def getVecType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the vector type used by the matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(46, 686, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_63getVecType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getVecType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[566])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getVecType, __pyx_t_14) < (0)) __PYX_ERR(46, 686, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":700
 *         return bytes2str(cval)
 * 
 *     def setNestVecType(self, vec_type: Vec.Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the vector type for a `Type.NEST` matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_vec_type, __pyx_mstate_global->__pyx_kp_u_Vec_Type_str) < (0)) __PYX_ERR(46, 700, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 700, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_65setNestVecType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setNestVecType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[567])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setNestVecType, __pyx_t_13) < (0)) __PYX_ERR(46, 700, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":721
 *     #
 * 
 *     def createAIJ(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_MatSizeSpec) < (0)) __PYX_ERR(46, 721, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_MatBlockSizeSpec_None) < (0)) __PYX_ERR(46, 721, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nnz, __pyx_mstate_global->__pyx_kp_u_NNZSpec_None) < (0)) __PYX_ERR(46, 721, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_csr, __pyx_mstate_global->__pyx_kp_u_CSRSpec_CSRIndicesSpec_None) < (0)) __PYX_ERR(46, 721, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(46, 721, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 721, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_67createAIJ, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createAIJ, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[568])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createAIJ, __pyx_t_14) < (0)) __PYX_ERR(46, 721, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":766
 *         return self
 * 
 *     def createBAIJ(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_MatSizeSpec) < (0)) __PYX_ERR(46, 766, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_n_u_MatBlockSizeSpec) < (0)) __PYX_ERR(46, 766, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_nnz, __pyx_mstate_global->__pyx_kp_u_NNZSpec_None) < (0)) __PYX_ERR(46, 766, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_csr, __pyx_mstate_global->__pyx_kp_u_CSRSpec_CSRIndicesSpec_None) < (0)) __PYX_ERR(46, 766, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(46, 766, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 766, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_69createBAIJ, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createBAIJ, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[569])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createBAIJ, __pyx_t_13) < (0)) __PYX_ERR(46, 766, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":810
 *         return self
 * 
 *     def createSBAIJ(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_MatSizeSpec) < (0)) __PYX_ERR(46, 810, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_n_u_MatBlockSizeSpec) < (0)) __PYX_ERR(46, 810, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nnz, __pyx_mstate_global->__pyx_kp_u_NNZSpec_None) < (0)) __PYX_ERR(46, 810, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_csr, __pyx_mstate_global->__pyx_kp_u_CSRSpec_CSRIndicesSpec_None) < (0)) __PYX_ERR(46, 810, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(46, 810, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 810, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_71createSBAIJ, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createSBAIJ, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[570])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createSBAIJ, __pyx_t_14) < (0)) __PYX_ERR(46, 810, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":854
 *         return self
 * 
 *     def createAIJCRL(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_MatSizeSpec) < (0)) __PYX_ERR(46, 854, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_MatBlockSizeSpec_None) < (0)) __PYX_ERR(46, 854, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_nnz, __pyx_mstate_global->__pyx_kp_u_NNZSpec_None) < (0)) __PYX_ERR(46, 854, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_csr, __pyx_mstate_global->__pyx_kp_u_CSRSpec_CSRIndicesSpec_None) < (0)) __PYX_ERR(46, 854, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(46, 854, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 854, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_73createAIJCRL, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createAIJCRL, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[571])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createAIJCRL, __pyx_t_13) < (0)) __PYX_ERR(46, 854, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":901
 *         return self
 * 
 *     def setPreallocationNNZ(self, nnz: NNZSpec) -> Self:             # <<<<<<<<<<<<<<
 *         """Preallocate memory for the matrix with a non-zero pattern.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nnz, __pyx_mstate_global->__pyx_n_u_NNZSpec) < (0)) __PYX_ERR(46, 901, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 901, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_75setPreallocationNNZ, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setPreallocationNNZ, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[572])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setPreallocationNNZ, __pyx_t_14) < (0)) __PYX_ERR(46, 901, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":927
 *         return self
 * 
 *     def setPreallocationCOO(self, coo_i: Sequence[int], coo_j: Sequence[int]) -> Self:             # <<<<<<<<<<<<<<
 *         """Set preallocation using coordinate format with global indices.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_coo_i, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 927, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_coo_j, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 927, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 927, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_77setPreallocationCOO, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setPreallocationCOO, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[573])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setPreallocationCOO, __pyx_t_13) < (0)) __PYX_ERR(46, 927, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":959
 *         return self
 * 
 *     def setPreallocationCOOLocal(self, coo_i: Sequence[int], coo_j: Sequence[int]) -> Self:             # <<<<<<<<<<<<<<
 *         """Set preallocation using coordinate format with local indices.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_coo_i, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 959, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_coo_j, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 959, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 959, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_79setPreallocationCOOLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setPreallocationCOOLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[574])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setPreallocationCOOLocal, __pyx_t_14) < (0)) __PYX_ERR(46, 959, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":991
 *         return self
 * 
 *     def setPreallocationCSR(self, csr: CSRSpec | CSRIndicesSpec) -> Self:             # <<<<<<<<<<<<<<
 *         """Preallocate memory for the matrix with a CSR layout.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_csr, __pyx_mstate_global->__pyx_kp_u_CSRSpec_CSRIndicesSpec) < (0)) __PYX_ERR(46, 991, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 991, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_81setPreallocationCSR, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setPreallocationCSR, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[575])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setPreallocationCSR, __pyx_t_13) < (0)) __PYX_ERR(46, 991, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1025
 *         return self
 * 
 *     def preallocatorPreallocate(self, Mat A, fill: bool = True) -> None:             # <<<<<<<<<<<<<<
 *         """Preallocate memory for a matrix using a preallocator matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_fill, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 1025, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 1025, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_83preallocatorPreallocate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_preallocatorPreallocate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[576])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[76]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_preallocatorPreallocate, __pyx_t_14) < (0)) __PYX_ERR(46, 1025, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1048
 *         CHKERR(MatPreallocatorPreallocate(self.mat, cfill, A.mat))
 * 
 *     def createAIJWithArrays(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_MatSizeSpec) < (0)) __PYX_ERR(46, 1048, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_csr, __pyx_mstate_global->__pyx_kp_u_CSRSpec_tuple_CSRSpec_CSRSpec) < (0)) __PYX_ERR(46, 1048, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_MatBlockSizeSpec_None) < (0)) __PYX_ERR(46, 1048, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(46, 1048, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1048, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_85createAIJWithArrays, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createAIJWithArrays, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[577])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createAIJWithArrays, __pyx_t_13) < (0)) __PYX_ERR(46, 1048, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1139
 *     #
 * 
 *     def createDense(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_MatSizeSpec) < (0)) __PYX_ERR(46, 1139, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_MatBlockSizeSpec_None) < (0)) __PYX_ERR(46, 1139, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_array, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar_None) < (0)) __PYX_ERR(46, 1139, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(46, 1139, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1139, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_87createDense, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createDense, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[578])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createDense, __pyx_t_14) < (0)) __PYX_ERR(46, 1139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1175
 *         return self
 * 
 *     def createDenseCUDA(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_MatSizeSpec) < (0)) __PYX_ERR(46, 1175, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_MatBlockSizeSpec_None) < (0)) __PYX_ERR(46, 1175, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_array, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar_None) < (0)) __PYX_ERR(46, 1175, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_cudahandle, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(46, 1175, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(46, 1175, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1175, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_89createDenseCUDA, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createDenseCUDA, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[579])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createDenseCUDA, __pyx_t_13) < (0)) __PYX_ERR(46, 1175, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1232
 *         return self
 * 
 *     def setPreallocationDense(self, array: Sequence[Scalar]) -> Self:             # <<<<<<<<<<<<<<
 *         """Set the array used for storing matrix elements for a dense matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_array, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 1232, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1232, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_91setPreallocationDense, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setPreallocationDense, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[580])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setPreallocationDense, __pyx_t_14) < (0)) __PYX_ERR(46, 1232, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1256
 *     #
 * 
 *     def createScatter(self, Scatter scatter, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.SCATTER` matrix from a vector scatter.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(46, 1256, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1256, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_93createScatter, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createScatter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[581])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createScatter, __pyx_t_13) < (0)) __PYX_ERR(46, 1256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1280
 *         return self
 * 
 *     def createNormal(self, Mat mat) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.NORMAL` matrix representing AA.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1280, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_95createNormal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createNormal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[582])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createNormal, __pyx_t_14) < (0)) __PYX_ERR(46, 1280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1305
 *         return self
 * 
 *     def createTranspose(self, Mat mat) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.TRANSPOSE` matrix that behaves like A.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1305, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_97createTranspose, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createTranspose, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[583])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createTranspose, __pyx_t_13) < (0)) __PYX_ERR(46, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1330
 *         return self
 * 
 *     def getTransposeMat(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the internal matrix of a `Type.TRANSPOSE` matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 1330, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_99getTransposeMat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getTransposeMat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[584])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getTransposeMat, __pyx_t_14) < (0)) __PYX_ERR(46, 1330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1350
 *         return mat
 * 
 *     def createNormalHermitian(self, Mat mat) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.NORMALHERMITIAN` matrix representing (A*)A.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1350, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_101createNormalHermitian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createNormalHermitian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[585])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createNormalHermitian, __pyx_t_13) < (0)) __PYX_ERR(46, 1350, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1375
 *         return self
 * 
 *     def createHermitianTranspose(self, Mat mat) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.HERMITIANTRANSPOSE` matrix that behaves like (A*).
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1375, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_103createHermitianTranspose, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createHermitianTranspose, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[586])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createHermitianTranspose, __pyx_t_14) < (0)) __PYX_ERR(46, 1375, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1400
 *         return self
 * 
 *     def createLRC(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat A or None: Mat | None,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_A, __pyx_mstate_global->__pyx_kp_u_Mat_None) < (0)) __PYX_ERR(46, 1400, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_c, __pyx_mstate_global->__pyx_kp_u_Vec_None) < (0)) __PYX_ERR(46, 1400, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_V, __pyx_mstate_global->__pyx_kp_u_Mat_None) < (0)) __PYX_ERR(46, 1400, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1400, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_105createLRC, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createLRC, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[587])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createLRC, __pyx_t_13) < (0)) __PYX_ERR(46, 1400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1454
 *         return self
 * 
 *     def createSubMatrixVirtual(self, Mat A, IS isrow, IS iscol=None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.SUBMATRIX` matrix that acts as a submatrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1454, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_107createSubMatrixVirtual, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createSubMatrixVirtual, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[588])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createSubMatrixVirtual, __pyx_t_14) < (0)) __PYX_ERR(46, 1454, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1479
 *         return self
 * 
 *     def createNest(             # <<<<<<<<<<<<<<
 *         self,
 *         mats: Sequence[Sequence[Mat]],
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_mats, __pyx_mstate_global->__pyx_kp_u_Sequence_Sequence_Mat) < (0)) __PYX_ERR(46, 1479, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_isrows, __pyx_mstate_global->__pyx_kp_u_Sequence_IS_None) < (0)) __PYX_ERR(46, 1479, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_iscols, __pyx_mstate_global->__pyx_kp_u_Sequence_IS_None) < (0)) __PYX_ERR(46, 1479, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(46, 1479, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1479, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_109createNest, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createNest, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[589])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createNest, __pyx_t_13) < (0)) __PYX_ERR(46, 1479, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1546
 *         return self
 * 
 *     def createH2OpusFromMat(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat A,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_coordinates, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar_None) < (0)) __PYX_ERR(46, 1546, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_dist, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(46, 1546, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_eta, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(46, 1546, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_leafsize, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(46, 1546, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_maxrank, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(46, 1546, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_bs_2, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(46, 1546, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_rtol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(46, 1546, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1546, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_111createH2OpusFromMat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createH2OpusFromMat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[590])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[77]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createH2OpusFromMat, __pyx_t_14) < (0)) __PYX_ERR(46, 1546, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1627
 *         return self
 * 
 *     def createHtoolFromKernel(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_MatSizeSpec) < (0)) __PYX_ERR(46, 1627, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_spacedim, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 1627, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_coords_target, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 1627, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_coords_source, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 1627, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_kernel, __pyx_mstate_global->__pyx_n_u_MatHtoolKernelFunction) < (0)) __PYX_ERR(46, 1627, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_kernelctx, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(46, 1627, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(46, 1627, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1627, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_113createHtoolFromKernel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createHtoolFromKernel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[591])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createHtoolFromKernel, __pyx_t_13) < (0)) __PYX_ERR(46, 1627, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1717
 *         return self
 * 
 *     def createIS(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_MatSizeSpec) < (0)) __PYX_ERR(46, 1717, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_kp_u_MatBlockSizeSpec_None) < (0)) __PYX_ERR(46, 1717, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(46, 1717, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1717, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_115createIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[592])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createIS, __pyx_t_14) < (0)) __PYX_ERR(46, 1717, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1770
 *         return self
 * 
 *     def createConstantDiagonal(             # <<<<<<<<<<<<<<
 *         self,
 *         size: MatSizeSpec,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_MatSizeSpec) < (0)) __PYX_ERR(46, 1770, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_diag, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(46, 1770, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(46, 1770, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1770, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_117createConstantDiagonal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createConstantDiagonal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[593])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createConstantDiagonal, __pyx_t_13) < (0)) __PYX_ERR(46, 1770, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1803
 *         return self
 * 
 *     def createDiagonal(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec diag) -> Self:
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1803, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_119createDiagonal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createDiagonal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[594])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createDiagonal, __pyx_t_14) < (0)) __PYX_ERR(46, 1803, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1826
 *         return self
 * 
 *     def createPython(self, size: MatSizeSpec, context: Any = None, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.PYTHON` matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_MatSizeSpec) < (0)) __PYX_ERR(46, 1826, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_context, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(46, 1826, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(46, 1826, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1826, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_121createPython, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createPython, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[595])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createPython, __pyx_t_13) < (0)) __PYX_ERR(46, 1826, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1863
 *         return self
 * 
 *     def setPythonContext(self, context: Any) -> None:             # <<<<<<<<<<<<<<
 *         """Set the instance of the class implementing the required Python methods.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_context, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(46, 1863, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 1863, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_123setPythonContext, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setPythonContext, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[596])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setPythonContext, __pyx_t_14) < (0)) __PYX_ERR(46, 1863, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1880
 *         CHKERR(MatPythonSetContext(self.mat, <void*>context))
 * 
 *     def getPythonContext(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return the instance of the class implementing the required Python methods.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(46, 1880, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_125getPythonContext, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getPythonContext, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[597])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getPythonContext, __pyx_t_13) < (0)) __PYX_ERR(46, 1880, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1895
 *         else: return <object> context
 * 
 *     def setPythonType(self, py_type: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the fully qualified Python name of the class to be used.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_py_type, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(46, 1895, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 1895, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_127setPythonType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setPythonType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[598])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setPythonType, __pyx_t_14) < (0)) __PYX_ERR(46, 1895, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1915
 *         CHKERR(MatPythonSetType(self.mat, cval))
 * 
 *     def getPythonType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the fully qualified Python name of the class used by the matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(46, 1915, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_129getPythonType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getPythonType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[599])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getPythonType, __pyx_t_13) < (0)) __PYX_ERR(46, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1932
 *     #
 * 
 *     def setOptionsPrefix(self, prefix: str | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(46, 1932, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 1932, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_131setOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[600])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setOptionsPrefix, __pyx_t_14) < (0)) __PYX_ERR(46, 1932, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1946
 *         CHKERR(MatSetOptionsPrefix(self.mat, cval))
 * 
 *     def getOptionsPrefix(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(46, 1946, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_133getOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[601])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getOptionsPrefix, __pyx_t_13) < (0)) __PYX_ERR(46, 1946, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1960
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Append to the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(46, 1960, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 1960, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_135appendOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_appendOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[602])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_appendOptionsPrefix, __pyx_t_14) < (0)) __PYX_ERR(46, 1960, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1974
 *         CHKERR(MatAppendOptionsPrefix(self.mat, cval))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the matrix from the options database.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 1974, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_137setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[603])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_13) < (0)) __PYX_ERR(46, 1974, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1986
 *         CHKERR(MatSetFromOptions(self.mat))
 * 
 *     def setUp(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 1986, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_139setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[604])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_14) < (0)) __PYX_ERR(46, 1986, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":1999
 *         return self
 * 
 *     def setOption(self, option: Option, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set option.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 1999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_option, __pyx_mstate_global->__pyx_n_u_Option) < (0)) __PYX_ERR(46, 1999, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 1999, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 1999, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_141setOption, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setOption, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[605])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 1999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setOption, __pyx_t_13) < (0)) __PYX_ERR(46, 1999, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2011
 *         CHKERR(MatSetOption(self.mat, option, flag))
 * 
 *     def getOption(self, option: Option) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the option value.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_option, __pyx_mstate_global->__pyx_n_u_Option) < (0)) __PYX_ERR(46, 2011, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 2011, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_143getOption, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getOption, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[606])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getOption, __pyx_t_14) < (0)) __PYX_ERR(46, 2011, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2025
 *         return toBool(flag)
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(46, 2025, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_145getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[607])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_13) < (0)) __PYX_ERR(46, 2025, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2039
 *         return bytes2str(cval)
 * 
 *     def getSize(self) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return the global number of rows and columns.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(46, 2039, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_147getSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[608])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getSize, __pyx_t_14) < (0)) __PYX_ERR(46, 2039, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2053
 *         return (toInt(M), toInt(N))
 * 
 *     def getLocalSize(self) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return the local number of rows and columns.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(46, 2053, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_149getLocalSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getLocalSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[609])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getLocalSize, __pyx_t_13) < (0)) __PYX_ERR(46, 2053, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2067
 *         return (toInt(m), toInt(n))
 * 
 *     def getSizes(self) -> tuple[LayoutSizeSpec, LayoutSizeSpec]:             # <<<<<<<<<<<<<<
 *         """Return the tuple of matrix layouts.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_LayoutSizeSpec_LayoutSizeS) < (0)) __PYX_ERR(46, 2067, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_151getSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[610])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getSizes, __pyx_t_14) < (0)) __PYX_ERR(46, 2067, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2083
 *         return ((toInt(m), toInt(M)), (toInt(n), toInt(N)))
 * 
 *     def getBlockSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the matrix block size.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 2083, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_153getBlockSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getBlockSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[611])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getBlockSize, __pyx_t_13) < (0)) __PYX_ERR(46, 2083, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2097
 *         return toInt(bs)
 * 
 *     def getBlockSizes(self) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return the row and column block sizes.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(46, 2097, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_155getBlockSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getBlockSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[612])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getBlockSizes, __pyx_t_14) < (0)) __PYX_ERR(46, 2097, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2111
 *         return (toInt(rbs), toInt(cbs))
 * 
 *     def getOwnershipRange(self) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return the locally owned range of rows.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(46, 2111, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_157getOwnershipRange, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getOwnershipRange, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[613])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getOwnershipRange, __pyx_t_13) < (0)) __PYX_ERR(46, 2111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2125
 *         return (toInt(ival1), toInt(ival2))
 * 
 *     def getOwnershipRanges(self) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the range of rows owned by each process.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(46, 2125, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_159getOwnershipRanges, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getOwnershipRanges, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[614])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getOwnershipRanges, __pyx_t_14) < (0)) __PYX_ERR(46, 2125, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2145
 *         return array_i(size+1, rowrng)
 * 
 *     def getOwnershipRangeColumn(self) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return the locally owned range of columns.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(46, 2145, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_161getOwnershipRangeColumn, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getOwnershipRangeColumn, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[615])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getOwnershipRangeColumn, __pyx_t_13) < (0)) __PYX_ERR(46, 2145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2160
 *         return (toInt(ival1), toInt(ival2))
 * 
 *     def getOwnershipRangesColumn(self) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the range of columns owned by each process.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(46, 2160, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_163getOwnershipRangesColumn, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getOwnershipRangesColumn, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[616])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getOwnershipRangesColumn, __pyx_t_14) < (0)) __PYX_ERR(46, 2160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2178
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_IS_IS) < (0)) __PYX_ERR(46, 2178, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_165getOwnershipIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getOwnershipIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[617])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getOwnershipIS, __pyx_t_13) < (0)) __PYX_ERR(46, 2178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2193
 *         return (rows, cols)
 * 
 *     def getInfo(self, info: InfoType | None = None) -> dict[str, float]:             # <<<<<<<<<<<<<<
 *         """Return summary information.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_info, __pyx_mstate_global->__pyx_kp_u_InfoType_None) < (0)) __PYX_ERR(46, 2193, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_dict_str_float) < (0)) __PYX_ERR(46, 2193, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_167getInfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getInfo, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[618])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getInfo, __pyx_t_14) < (0)) __PYX_ERR(46, 2193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2213
 *         return cinfo
 * 
 *     def duplicate(self, copy: DuplicateOption | bool = False) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return a clone of the matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_copy, __pyx_mstate_global->__pyx_kp_u_DuplicateOption_bool) < (0)) __PYX_ERR(46, 2213, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 2213, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_169duplicate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_duplicate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[619])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_duplicate, __pyx_t_13) < (0)) __PYX_ERR(46, 2213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2233
 *         return mat
 * 
 *     def copy(self, Mat result=None, structure: Structure | None = None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return a copy of the matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_structure, __pyx_mstate_global->__pyx_kp_u_Structure_None) < (0)) __PYX_ERR(46, 2233, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 2233, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_171copy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_copy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[620])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_copy, __pyx_t_14) < (0)) __PYX_ERR(46, 2233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2260
 *         return result
 * 
 *     def load(self, Viewer viewer) -> Self:             # <<<<<<<<<<<<<<
 *         """Load a matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 2260, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_173load, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_load, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[621])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_load, __pyx_t_13) < (0)) __PYX_ERR(46, 2260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2278
 *         return self
 * 
 *     def convert(self, mat_type: Type | str | None = None, Mat out=None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Convert the matrix type.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_mat_type, __pyx_mstate_global->__pyx_kp_u_Type_str_None) < (0)) __PYX_ERR(46, 2278, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 2278, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_175convert, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_convert, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[622])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_convert, __pyx_t_14) < (0)) __PYX_ERR(46, 2278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2310
 *         return out
 * 
 *     def transpose(self, Mat out=None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the transposed matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 2310, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_177transpose, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_transpose, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[623])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_transpose, __pyx_t_13) < (0)) __PYX_ERR(46, 2310, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2337
 *         return out
 * 
 *     def setTransposePrecursor(self, Mat out) -> None:             # <<<<<<<<<<<<<<
 *         """Set transpose precursor.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 2337, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_179setTransposePrecursor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setTransposePrecursor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[624])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setTransposePrecursor, __pyx_t_14) < (0)) __PYX_ERR(46, 2337, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2349
 *         CHKERR(MatTransposeSetPrecursor(self.mat, out.mat))
 * 
 *     def hermitianTranspose(self, Mat out=None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the transposed Hermitian matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 2349, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_181hermitianTranspose, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_hermitianTranspose, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[625])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_hermitianTranspose, __pyx_t_13) < (0)) __PYX_ERR(46, 2349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2376
 *         return out
 * 
 *     def realPart(self, Mat out=None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the real part of the matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 2376, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_183realPart, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_realPart, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[626])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_realPart, __pyx_t_14) < (0)) __PYX_ERR(46, 2376, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2399
 *         return out
 * 
 *     def imagPart(self, Mat out=None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the imaginary part of the matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 2399, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_185imagPart, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_imagPart, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[627])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_imagPart, __pyx_t_13) < (0)) __PYX_ERR(46, 2399, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2422
 *         return out
 * 
 *     def conjugate(self, Mat out=None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the conjugate matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 2422, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_187conjugate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_conjugate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[628])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_conjugate, __pyx_t_14) < (0)) __PYX_ERR(46, 2422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2445
 *         return out
 * 
 *     def permute(self, IS row, IS col) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the permuted matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 2445, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_189permute, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_permute, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[629])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_permute, __pyx_t_13) < (0)) __PYX_ERR(46, 2445, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2466
 *         return mat
 * 
 *     def equal(self, Mat mat) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the result of matrix comparison.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 2466, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_191equal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_equal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[630])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_equal, __pyx_t_14) < (0)) __PYX_ERR(46, 2466, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2480
 *         return toBool(flag)
 * 
 *     def isTranspose(self, Mat mat=None, tol: float = 0) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the result of matrix comparison with transposition.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_tol, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(46, 2480, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 2480, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_193isTranspose, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_isTranspose, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[631])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[78]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_isTranspose, __pyx_t_13) < (0)) __PYX_ERR(46, 2480, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2503
 *         return toBool(flag)
 * 
 *     def isSymmetric(self, tol: float = 0) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the boolean indicating if the matrix is symmetric.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_tol, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(46, 2503, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 2503, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_195isSymmetric, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_isSymmetric, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[632])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[79]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_isSymmetric, __pyx_t_14) < (0)) __PYX_ERR(46, 2503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2523
 *         return toBool(flag)
 * 
 *     def isSymmetricKnown(self) -> tuple[bool, bool]:             # <<<<<<<<<<<<<<
 *         """Return the 2-tuple indicating if the matrix is known to be symmetric.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_bool_bool) < (0)) __PYX_ERR(46, 2523, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_197isSymmetricKnown, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_isSymmetricKnown, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[633])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_isSymmetricKnown, __pyx_t_13) < (0)) __PYX_ERR(46, 2523, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2538
 *         return (toBool(flag1), toBool(flag2))
 * 
 *     def isHermitian(self, tol: float = 0) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the boolean indicating if the matrix is Hermitian.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_tol, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(46, 2538, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 2538, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_199isHermitian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_isHermitian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[634])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[79]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_isHermitian, __pyx_t_14) < (0)) __PYX_ERR(46, 2538, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2558
 *         return toBool(flag)
 * 
 *     def isHermitianKnown(self) -> tuple[bool, bool]:             # <<<<<<<<<<<<<<
 *         """Return the 2-tuple indicating if the matrix is known to be Hermitian.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_bool_bool) < (0)) __PYX_ERR(46, 2558, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_201isHermitianKnown, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_isHermitianKnown, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[635])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_isHermitianKnown, __pyx_t_13) < (0)) __PYX_ERR(46, 2558, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2573
 *         return (toBool(flag1), toBool(flag2))
 * 
 *     def isStructurallySymmetric(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the boolean indicating if the matrix is structurally symmetric.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 2573, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_203isStructurallySymmetric, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_isStructurallySymmetric, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[636])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_isStructurallySymmetric, __pyx_t_14) < (0)) __PYX_ERR(46, 2573, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2587
 *         return toBool(flag)
 * 
 *     def isLinear(self, n: int = 1) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the Mat is a linear operator.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_n, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 2587, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 2587, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_205isLinear, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_isLinear, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[637])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[80]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_isLinear, __pyx_t_13) < (0)) __PYX_ERR(46, 2587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2606
 *         return toBool(flag)
 * 
 *     def zeroEntries(self) -> None:             # <<<<<<<<<<<<<<
 *         """Zero the entries of the matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 2606, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_207zeroEntries, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_zeroEntries, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[638])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_zeroEntries, __pyx_t_14) < (0)) __PYX_ERR(46, 2606, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2618
 *         CHKERR(MatZeroEntries(self.mat))
 * 
 *     def getValue(self, row, col) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Return the value in the (row, col) position.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(46, 2618, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_209getValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[639])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getValue, __pyx_t_13) < (0)) __PYX_ERR(46, 2618, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2634
 *         return toScalar(sval)
 * 
 *     def getValues(self, rows: Sequence[int], cols: Sequence[int], values: ArrayScalar | None = None) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Return the values in the ``zip(rows, cols)`` positions.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_rows, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 2634, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_cols, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 2634, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_values, __pyx_mstate_global->__pyx_kp_u_ArrayScalar_None) < (0)) __PYX_ERR(46, 2634, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayScalar) < (0)) __PYX_ERR(46, 2634, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_211getValues, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getValues, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[640])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getValues, __pyx_t_14) < (0)) __PYX_ERR(46, 2634, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2655
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_ArrayInt_ArrayInt_ArraySca) < (0)) __PYX_ERR(46, 2655, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_213getValuesCSR, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getValuesCSR, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[641])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getValuesCSR, __pyx_t_13) < (0)) __PYX_ERR(46, 2655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2693
 *         return (ai, aj, av)
 * 
 *     def getRow(self, row: int) -> tuple[ArrayInt, ArrayScalar]:             # <<<<<<<<<<<<<<
 *         """Return the column indices and values for the requested row.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_row, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 2693, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_ArrayInt_ArrayScalar) < (0)) __PYX_ERR(46, 2693, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_215getRow, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getRow, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[642])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getRow, __pyx_t_14) < (0)) __PYX_ERR(46, 2693, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2713
 *         return (cols, vals)
 * 
 *     def getRowIJ(self, symmetric: bool = False, compressed: bool = False) -> tuple[ArrayInt, ArrayInt]:             # <<<<<<<<<<<<<<
 *         """Return the CSR representation of the local sparsity pattern.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_symmetric, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 2713, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_compressed, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 2713, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_ArrayInt_ArrayInt) < (0)) __PYX_ERR(46, 2713, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_217getRowIJ, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getRowIJ, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[643])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[81]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getRowIJ, __pyx_t_13) < (0)) __PYX_ERR(46, 2713, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2744
 *         return (ai, aj)
 * 
 *     def getColumnIJ(self, symmetric: bool = False, compressed: bool = False) -> tuple[ArrayInt, ArrayInt]:             # <<<<<<<<<<<<<<
 *         """Return the CSC representation of the local sparsity pattern.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_symmetric, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 2744, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_compressed, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 2744, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_ArrayInt_ArrayInt) < (0)) __PYX_ERR(46, 2744, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_219getColumnIJ, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getColumnIJ, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[644])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[81]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getColumnIJ, __pyx_t_14) < (0)) __PYX_ERR(46, 2744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2774
 *         return (ai, aj)
 * 
 *     def setValue(             # <<<<<<<<<<<<<<
 *         self,
 *         row: int,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_row, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 2774, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_col, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 2774, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(46, 2774, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 2774, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 2774, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_221setValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[645])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValue, __pyx_t_13) < (0)) __PYX_ERR(46, 2774, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2806
 *         CHKERR(MatSetValues(self.mat, 1, &ival1, 1, &ival2, &sval, caddv))
 * 
 *     def setValues(             # <<<<<<<<<<<<<<
 *         self,
 *         rows: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_rows, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 2806, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_cols, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 2806, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_values, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 2806, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 2806, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 2806, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_223setValues, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValues, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[646])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValues, __pyx_t_14) < (0)) __PYX_ERR(46, 2806, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2834
 *         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)
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 2834, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_225setValuesRCV, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValuesRCV, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[647])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValuesRCV, __pyx_t_13) < (0)) __PYX_ERR(46, 2834, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2838
 *         matsetvalues_rcv(self.mat, R, C, V, addv, 0, 0)
 * 
 *     def setValuesIJV(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_I, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 2838, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_J, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 2838, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_V, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 2838, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 2838, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_rowmap, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(46, 2838, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 2838, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_227setValuesIJV, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValuesIJV, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[648])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValuesIJV, __pyx_t_14) < (0)) __PYX_ERR(46, 2838, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2869
 *         matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 0)
 * 
 *     def setValuesCOO(             # <<<<<<<<<<<<<<
 *         self,
 *         coo_v: Sequence[Scalar],
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_coo_v, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 2869, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 2869, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 2869, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_229setValuesCOO, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValuesCOO, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[649])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValuesCOO, __pyx_t_13) < (0)) __PYX_ERR(46, 2869, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2890
 *         matsetvalues_coo(self.mat, coo_v, addv)
 * 
 *     def setValuesCSR(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_I, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 2890, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_J, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 2890, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_V, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 2890, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 2890, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 2890, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_231setValuesCSR, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValuesCSR, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[650])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValuesCSR, __pyx_t_14) < (0)) __PYX_ERR(46, 2890, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2918
 *         matsetvalues_csr(self.mat, I, J, V, addv, 0, 0)
 * 
 *     def setValuesBlocked(             # <<<<<<<<<<<<<<
 *         self,
 *         rows: Sequence[int],
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_rows, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 2918, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_cols, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 2918, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_values, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 2918, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 2918, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 2918, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_233setValuesBlocked, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValuesBlocked, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[651])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValuesBlocked, __pyx_t_13) < (0)) __PYX_ERR(46, 2918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2948
 *         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)
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 2948, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_235setValuesBlockedRCV, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValuesBlockedRCV, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[652])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValuesBlockedRCV, __pyx_t_14) < (0)) __PYX_ERR(46, 2948, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2952
 *         matsetvalues_rcv(self.mat, R, C, V, addv, 1, 0)
 * 
 *     def setValuesBlockedIJV(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_I, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 2952, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_J, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 2952, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_V, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 2952, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 2952, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_rowmap, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(46, 2952, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 2952, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_237setValuesBlockedIJV, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValuesBlockedIJV, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[653])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValuesBlockedIJV, __pyx_t_13) < (0)) __PYX_ERR(46, 2952, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":2983
 *         matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 0)
 * 
 *     def setValuesBlockedCSR(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 2983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_I, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 2983, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_J, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 2983, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_V, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 2983, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 2983, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 2983, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_239setValuesBlockedCSR, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValuesBlockedCSR, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[654])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 2983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValuesBlockedCSR, __pyx_t_14) < (0)) __PYX_ERR(46, 2983, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3011
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3011, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_241setLGMap, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setLGMap, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[655])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setLGMap, __pyx_t_13) < (0)) __PYX_ERR(46, 3011, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3031
 *         CHKERR(MatSetLocalToGlobalMapping(self.mat, rmap.lgm, cmap.lgm))
 * 
 *     def getLGMap(self) -> tuple[LGMap, LGMap]:             # <<<<<<<<<<<<<<
 *         """Return the local-to-global mappings.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_LGMap_LGMap) < (0)) __PYX_ERR(46, 3031, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_243getLGMap, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getLGMap, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[656])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getLGMap, __pyx_t_14) < (0)) __PYX_ERR(46, 3031, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3048
 *         return (rmap, cmap)
 * 
 *     def setValueLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         row: int,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_row, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 3048, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_col, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 3048, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(46, 3048, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 3048, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3048, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_245setValueLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValueLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[657])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValueLocal, __pyx_t_13) < (0)) __PYX_ERR(46, 3048, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3081
 *                 self.mat, 1, &ival1, 1, &ival2, &sval, caddv))
 * 
 *     def setValuesLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         rows: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_rows, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 3081, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_cols, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 3081, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_values, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 3081, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 3081, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3081, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_247setValuesLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValuesLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[658])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValuesLocal, __pyx_t_14) < (0)) __PYX_ERR(46, 3081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3109
 *         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)
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3109, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_249setValuesLocalRCV, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValuesLocalRCV, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[659])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValuesLocalRCV, __pyx_t_13) < (0)) __PYX_ERR(46, 3109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3113
 *         matsetvalues_rcv(self.mat, R, C, V, addv, 0, 1)
 * 
 *     def setValuesLocalIJV(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_I, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 3113, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_J, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 3113, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_V, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 3113, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 3113, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_rowmap, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(46, 3113, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3113, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_251setValuesLocalIJV, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValuesLocalIJV, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[660])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValuesLocalIJV, __pyx_t_14) < (0)) __PYX_ERR(46, 3113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3144
 *         matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 0, 1)
 * 
 *     def setValuesLocalCSR(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_I, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 3144, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_J, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 3144, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_V, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 3144, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 3144, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3144, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_253setValuesLocalCSR, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValuesLocalCSR, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[661])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValuesLocalCSR, __pyx_t_13) < (0)) __PYX_ERR(46, 3144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3172
 *         matsetvalues_csr(self.mat, I, J, V, addv, 0, 1)
 * 
 *     def setValuesBlockedLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         rows: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_rows, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 3172, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_cols, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 3172, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_values, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 3172, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 3172, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3172, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_255setValuesBlockedLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValuesBlockedLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[662])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValuesBlockedLocal, __pyx_t_14) < (0)) __PYX_ERR(46, 3172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3202
 *         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)
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3202, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_257setValuesBlockedLocalRCV, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValuesBlockedLocalRCV, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[663])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValuesBlockedLocalRCV, __pyx_t_13) < (0)) __PYX_ERR(46, 3202, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3206
 *         matsetvalues_rcv(self.mat, R, C, V, addv, 1, 1)
 * 
 *     def setValuesBlockedLocalIJV(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_I, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 3206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_J, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 3206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_V, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 3206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 3206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_rowmap, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(46, 3206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3206, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_259setValuesBlockedLocalIJV, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValuesBlockedLocalIJV, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[664])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValuesBlockedLocalIJV, __pyx_t_14) < (0)) __PYX_ERR(46, 3206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3237
 *         matsetvalues_ijv(self.mat, I, J, V, addv, rowmap, 1, 1)
 * 
 *     def setValuesBlockedLocalCSR(             # <<<<<<<<<<<<<<
 *         self,
 *         I: Sequence[int],
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_I, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 3237, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_J, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 3237, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_V, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 3237, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 3237, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3237, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_261setValuesBlockedLocalCSR, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValuesBlockedLocalCSR, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[665])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValuesBlockedLocalCSR, __pyx_t_13) < (0)) __PYX_ERR(46, 3237, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3267
 *     #
 * 
 *     Stencil = MatStencil             # <<<<<<<<<<<<<<
 * 
 *     def setStencil(self, dims: DimsSpec, starts: DimsSpec | None = None, dof: int = 1) -> None:
*/
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_Stencil, ((PyObject *)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatStencil)) < (0)) __PYX_ERR(46, 3267, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":3269
 *     Stencil = MatStencil
 * 
 *     def setStencil(self, dims: DimsSpec, starts: DimsSpec | None = None, dof: int = 1) -> None:             # <<<<<<<<<<<<<<
 *         """Set matrix stencil.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_dims, __pyx_mstate_global->__pyx_n_u_DimsSpec) < (0)) __PYX_ERR(46, 3269, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_starts, __pyx_mstate_global->__pyx_kp_u_DimsSpec_None) < (0)) __PYX_ERR(46, 3269, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_dof, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 3269, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3269, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_263setStencil, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setStencil, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[666])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[82]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setStencil, __pyx_t_14) < (0)) __PYX_ERR(46, 3269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3289
 *         CHKERR(MatSetStencil(self.mat, ndim, cdims, cstarts, ndof))
 * 
 *     def setValueStencil(             # <<<<<<<<<<<<<<
 *         self,
 *         MatStencil row: Stencil,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_row, __pyx_mstate_global->__pyx_n_u_Stencil) < (0)) __PYX_ERR(46, 3289, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_col, __pyx_mstate_global->__pyx_n_u_Stencil) < (0)) __PYX_ERR(46, 3289, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 3289, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 3289, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3289, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_265setValueStencil, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValueStencil, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[667])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValueStencil, __pyx_t_13) < (0)) __PYX_ERR(46, 3289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3319
 *         matsetvaluestencil(self.mat, r, c, value, im, 0)
 * 
 *     def setValueStagStencil(self, row, col, value, addv=None) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         raise NotImplementedError
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3319, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_267setValueStagStencil, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValueStagStencil, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[668])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValueStagStencil, __pyx_t_14) < (0)) __PYX_ERR(46, 3319, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3323
 *         raise NotImplementedError
 * 
 *     def setValueBlockedStencil(             # <<<<<<<<<<<<<<
 *         self,
 *         row: Stencil,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_row, __pyx_mstate_global->__pyx_n_u_Stencil) < (0)) __PYX_ERR(46, 3323, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_col, __pyx_mstate_global->__pyx_n_u_Stencil) < (0)) __PYX_ERR(46, 3323, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(46, 3323, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 3323, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3323, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_269setValueBlockedStencil, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValueBlockedStencil, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[669])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValueBlockedStencil, __pyx_t_13) < (0)) __PYX_ERR(46, 3323, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3353
 *         matsetvaluestencil(self.mat, r, c, value, im, 1)
 * 
 *     def setValueBlockedStagStencil(self, row, col, value, addv=None) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         raise NotImplementedError
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3353, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_271setValueBlockedStagStencil, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setValueBlockedStagStencil, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[670])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setValueBlockedStagStencil, __pyx_t_14) < (0)) __PYX_ERR(46, 3353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3357
 *         raise NotImplementedError
 * 
 *     def zeroRows(self, rows: IS | Sequence[int], diag: Scalar = 1.0, Vec x=None, Vec b=None) -> None:             # <<<<<<<<<<<<<<
 *         """Zero selected rows of the matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_rows, __pyx_mstate_global->__pyx_kp_u_IS_Sequence_int) < (0)) __PYX_ERR(46, 3357, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_diag, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(46, 3357, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3357, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_273zeroRows, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_zeroRows, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[671])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[83]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_zeroRows, __pyx_t_13) < (0)) __PYX_ERR(46, 3357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3390
 *             CHKERR(MatZeroRows(self.mat, ni, i, sval, xvec, bvec))
 * 
 *     def zeroRowsLocal(self, rows: IS | Sequence[int], diag: Scalar = 1.0, Vec x=None, Vec b=None) -> None:             # <<<<<<<<<<<<<<
 *         """Zero selected rows of the matrix in local ordering.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_rows, __pyx_mstate_global->__pyx_kp_u_IS_Sequence_int) < (0)) __PYX_ERR(46, 3390, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_diag, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(46, 3390, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3390, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_275zeroRowsLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_zeroRowsLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[672])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[83]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_zeroRowsLocal, __pyx_t_14) < (0)) __PYX_ERR(46, 3390, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3423
 *             CHKERR(MatZeroRowsLocal(self.mat, ni, i, sval, xvec, bvec))
 * 
 *     def zeroRowsColumns(self, rows: IS | Sequence[int], diag: Scalar = 1.0, Vec x=None, Vec b=None) -> None:             # <<<<<<<<<<<<<<
 *         """Zero selected rows and columns of the matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_rows, __pyx_mstate_global->__pyx_kp_u_IS_Sequence_int) < (0)) __PYX_ERR(46, 3423, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_diag, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(46, 3423, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3423, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_277zeroRowsColumns, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_zeroRowsColumns, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[673])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[83]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_zeroRowsColumns, __pyx_t_13) < (0)) __PYX_ERR(46, 3423, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3457
 *             CHKERR(MatZeroRowsColumns(self.mat, ni, i, sval, xvec, bvec))
 * 
 *     def zeroRowsColumnsLocal(self, rows: IS | Sequence[int], diag: Scalar = 1.0, Vec x=None, Vec b=None) -> None:             # <<<<<<<<<<<<<<
 *         """Zero selected rows and columns of the matrix in local ordering.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_rows, __pyx_mstate_global->__pyx_kp_u_IS_Sequence_int) < (0)) __PYX_ERR(46, 3457, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_diag, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(46, 3457, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3457, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_279zeroRowsColumnsLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_zeroRowsColumnsLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[674])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[83]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_zeroRowsColumnsLocal, __pyx_t_14) < (0)) __PYX_ERR(46, 3457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3491
 *             CHKERR(MatZeroRowsColumnsLocal(self.mat, ni, i, sval, xvec, bvec))
 * 
 *     def zeroRowsColumnsStencil(self, rows: Sequence[Stencil], diag: Scalar = 1.0, Vec x=None, Vec b=None) -> None:             # <<<<<<<<<<<<<<
 *         """Zero selected rows and columns of the matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_rows, __pyx_mstate_global->__pyx_kp_u_Sequence_Stencil) < (0)) __PYX_ERR(46, 3491, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_diag, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(46, 3491, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3491, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_281zeroRowsColumnsStencil, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_zeroRowsColumnsStencil, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[675])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[83]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_zeroRowsColumnsStencil, __pyx_t_13) < (0)) __PYX_ERR(46, 3491, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3525
 *         CHKERR(PetscFree(crows))
 * 
 *     def storeValues(self) -> None:             # <<<<<<<<<<<<<<
 *         """Stash a copy of the matrix values.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3525, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_283storeValues, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_storeValues, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[676])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_storeValues, __pyx_t_14) < (0)) __PYX_ERR(46, 3525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3537
 *         CHKERR(MatStoreValues(self.mat))
 * 
 *     def retrieveValues(self) -> None:             # <<<<<<<<<<<<<<
 *         """Retrieve a copy of the matrix values previously stored with `storeValues`.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3537, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_285retrieveValues, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_retrieveValues, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[677])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_retrieveValues, __pyx_t_13) < (0)) __PYX_ERR(46, 3537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3549
 *         CHKERR(MatRetrieveValues(self.mat))
 * 
 *     def assemblyBegin(self, assembly: MatAssemblySpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Begin an assembling stage of the matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_assembly, __pyx_mstate_global->__pyx_n_u_MatAssemblySpec) < (0)) __PYX_ERR(46, 3549, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3549, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_287assemblyBegin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_assemblyBegin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[678])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_assemblyBegin, __pyx_t_14) < (0)) __PYX_ERR(46, 3549, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3567
 *         CHKERR(MatAssemblyBegin(self.mat, flag))
 * 
 *     def assemblyEnd(self, assembly: MatAssemblySpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Complete an assembling stage of the matrix initiated with `assemblyBegin`.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_assembly, __pyx_mstate_global->__pyx_n_u_MatAssemblySpec) < (0)) __PYX_ERR(46, 3567, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3567, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_289assemblyEnd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_assemblyEnd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[679])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_assemblyEnd, __pyx_t_13) < (0)) __PYX_ERR(46, 3567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3585
 *         CHKERR(MatAssemblyEnd(self.mat, flag))
 * 
 *     def assemble(self, assembly: MatAssemblySpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Assemble the matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_assembly, __pyx_mstate_global->__pyx_n_u_MatAssemblySpec) < (0)) __PYX_ERR(46, 3585, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3585, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_291assemble, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_assemble, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[680])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_assemble, __pyx_t_14) < (0)) __PYX_ERR(46, 3585, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3604
 *         CHKERR(MatAssemblyEnd(self.mat, flag))
 * 
 *     def isAssembled(self) -> bool:             # <<<<<<<<<<<<<<
 *         """The boolean flag indicating if the matrix is assembled.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 3604, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_293isAssembled, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_isAssembled, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[681])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_isAssembled, __pyx_t_13) < (0)) __PYX_ERR(46, 3604, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3618
 *         return toBool(flag)
 * 
 *     def findZeroRows(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the index set of empty rows.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(46, 3618, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_295findZeroRows, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_findZeroRows, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[682])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_findZeroRows, __pyx_t_14) < (0)) __PYX_ERR(46, 3618, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3632
 *         return zerorows
 * 
 *     def createVecs(             # <<<<<<<<<<<<<<
 *         self,
 *         side: Literal['r', 'R', 'right', 'Right', 'RIGHT', 'l', 'L', 'left', 'Left', 'LEFT'] | None = None) -> Vec | tuple[Vec, Vec]:
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_side, __pyx_mstate_global->__pyx_kp_u_Literal_r_R_right_Right_RIGHT_l) < (0)) __PYX_ERR(46, 3632, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Vec_tuple_Vec_Vec) < (0)) __PYX_ERR(46, 3632, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_297createVecs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createVecs, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[683])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createVecs, __pyx_t_13) < (0)) __PYX_ERR(46, 3632, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3671
 *             raise ValueError("side '%r' not understood" % side)
 * 
 *     def createVecRight(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a right vector, a vector that the matrix can be multiplied against.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(46, 3671, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_299createVecRight, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createVecRight, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[684])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createVecRight, __pyx_t_14) < (0)) __PYX_ERR(46, 3671, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3685
 *         return vecr
 * 
 *     def createVecLeft(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a left vector, a vector that the matrix vector product can be stored in.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(46, 3685, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_301createVecLeft, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createVecLeft, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[685])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createVecLeft, __pyx_t_13) < (0)) __PYX_ERR(46, 3685, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3699
 *         return vecl
 * 
 *     getVecs = createVecs             # <<<<<<<<<<<<<<
 *     getVecRight = createVecRight
 *     getVecLeft = createVecLeft
*/
  __Pyx_GetNameInClass(__pyx_t_13, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createVecs); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getVecs, __pyx_t_13) < (0)) __PYX_ERR(46, 3699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3700
 * 
 *     getVecs = createVecs
 *     getVecRight = createVecRight             # <<<<<<<<<<<<<<
 *     getVecLeft = createVecLeft
 * 
*/
  __Pyx_GetNameInClass(__pyx_t_13, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createVecRight); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getVecRight, __pyx_t_13) < (0)) __PYX_ERR(46, 3700, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3701
 *     getVecs = createVecs
 *     getVecRight = createVecRight
 *     getVecLeft = createVecLeft             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __Pyx_GetNameInClass(__pyx_t_13, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createVecLeft); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getVecLeft, __pyx_t_13) < (0)) __PYX_ERR(46, 3701, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3705
 *     #
 * 
 *     def getColumnVector(self, column: int, Vec result=None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the column column vector of the matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_column, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 3705, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(46, 3705, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_303getColumnVector, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getColumnVector, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[686])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getColumnVector, __pyx_t_14) < (0)) __PYX_ERR(46, 3705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3730
 *         return result
 * 
 *     def getRedundantMatrix(self, nsubcomm: int, subcomm: Comm | None = None, Mat out=None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return redundant matrices on subcommunicators.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_nsubcomm, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 3730, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_subcomm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(46, 3730, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 3730, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_305getRedundantMatrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getRedundantMatrix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[687])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getRedundantMatrix, __pyx_t_13) < (0)) __PYX_ERR(46, 3730, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3760
 *         return out
 * 
 *     def getDiagonal(self, Vec result=None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the diagonal of the matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(46, 3760, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_307getDiagonal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getDiagonal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[688])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getDiagonal, __pyx_t_14) < (0)) __PYX_ERR(46, 3760, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3782
 *         return result
 * 
 *     def getRowSum(self, Vec result=None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the row-sum vector.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(46, 3782, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_309getRowSum, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getRowSum, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[689])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getRowSum, __pyx_t_13) < (0)) __PYX_ERR(46, 3782, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3804
 *         return result
 * 
 *     def setDiagonal(self, Vec diag, addv: InsertModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the diagonal values of the matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(46, 3804, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3804, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_311setDiagonal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setDiagonal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[690])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setDiagonal, __pyx_t_14) < (0)) __PYX_ERR(46, 3804, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3824
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3824, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_313diagonalScale, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_diagonalScale, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[691])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_diagonalScale, __pyx_t_13) < (0)) __PYX_ERR(46, 3824, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3846
 *         CHKERR(MatDiagonalScale(self.mat, vecl, vecr))
 * 
 *     def invertBlockDiagonal(self) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Return the inverse of the block-diagonal entries.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayScalar) < (0)) __PYX_ERR(46, 3846, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_315invertBlockDiagonal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_invertBlockDiagonal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[692])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_invertBlockDiagonal, __pyx_t_14) < (0)) __PYX_ERR(46, 3846, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3867
 *     # null space
 * 
 *     def setNullSpace(self, NullSpace nsp) -> None:             # <<<<<<<<<<<<<<
 *         """Set the nullspace.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3867, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_317setNullSpace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setNullSpace, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[693])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setNullSpace, __pyx_t_13) < (0)) __PYX_ERR(46, 3867, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3879
 *         CHKERR(MatSetNullSpace(self.mat, nsp.nsp))
 * 
 *     def getNullSpace(self) -> NullSpace:             # <<<<<<<<<<<<<<
 *         """Return the nullspace.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_NullSpace) < (0)) __PYX_ERR(46, 3879, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_319getNullSpace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getNullSpace, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[694])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getNullSpace, __pyx_t_14) < (0)) __PYX_ERR(46, 3879, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3894
 *         return nsp
 * 
 *     def setTransposeNullSpace(self, NullSpace nsp) -> None:             # <<<<<<<<<<<<<<
 *         """Set the transpose nullspace.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3894, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_321setTransposeNullSpace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setTransposeNullSpace, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[695])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setTransposeNullSpace, __pyx_t_13) < (0)) __PYX_ERR(46, 3894, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3906
 *         CHKERR(MatSetTransposeNullSpace(self.mat, nsp.nsp))
 * 
 *     def getTransposeNullSpace(self) -> NullSpace:             # <<<<<<<<<<<<<<
 *         """Return the transpose nullspace.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_NullSpace) < (0)) __PYX_ERR(46, 3906, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_323getTransposeNullSpace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getTransposeNullSpace, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[696])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getTransposeNullSpace, __pyx_t_14) < (0)) __PYX_ERR(46, 3906, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3921
 *         return nsp
 * 
 *     def setNearNullSpace(self, NullSpace nsp) -> None:             # <<<<<<<<<<<<<<
 *         """Set the near-nullspace.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3921, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_325setNearNullSpace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setNearNullSpace, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[697])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setNearNullSpace, __pyx_t_13) < (0)) __PYX_ERR(46, 3921, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3933
 *         CHKERR(MatSetNearNullSpace(self.mat, nsp.nsp))
 * 
 *     def getNearNullSpace(self) -> NullSpace:             # <<<<<<<<<<<<<<
 *         """Return the near-nullspace.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_NullSpace) < (0)) __PYX_ERR(46, 3933, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_327getNearNullSpace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getNearNullSpace, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[698])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getNearNullSpace, __pyx_t_14) < (0)) __PYX_ERR(46, 3933, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3950
 *     # matrix-vector product
 * 
 *     def mult(self, Vec x, Vec y) -> None:             # <<<<<<<<<<<<<<
 *         """Perform the matrix vector product y = A @ x.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3950, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_329mult, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_mult, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[699])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_mult, __pyx_t_13) < (0)) __PYX_ERR(46, 3950, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3969
 *         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.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3969, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_331multAdd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_multAdd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[700])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_multAdd, __pyx_t_14) < (0)) __PYX_ERR(46, 3969, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":3990
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 3990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 3990, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_333multTranspose, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_multTranspose, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[701])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 3990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_multTranspose, __pyx_t_13) < (0)) __PYX_ERR(46, 3990, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4009
 *         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.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4009, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_335multTransposeAdd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_multTransposeAdd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[702])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_multTransposeAdd, __pyx_t_14) < (0)) __PYX_ERR(46, 4009, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4030
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4030, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_337multHermitian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_multHermitian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[703])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_multHermitian, __pyx_t_13) < (0)) __PYX_ERR(46, 4030, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4049
 *         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.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4049, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_339multHermitianAdd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_multHermitianAdd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[704])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_multHermitianAdd, __pyx_t_14) < (0)) __PYX_ERR(46, 4049, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4072
 *     # SOR
 * 
 *     def SOR(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec b,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_omega, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(46, 4072, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_sortype, __pyx_mstate_global->__pyx_kp_u_SORType_None) < (0)) __PYX_ERR(46, 4072, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_shift, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(46, 4072, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_its, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 4072, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_lits, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 4072, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4072, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_341SOR, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_SOR, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[705])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[84]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_SOR, __pyx_t_13) < (0)) __PYX_ERR(46, 4072, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4101
 *     #
 * 
 *     def getDiagonalBlock(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the part of the matrix associated with the on-process coupling.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 4101, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_343getDiagonalBlock, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getDiagonalBlock, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[706])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getDiagonalBlock, __pyx_t_14) < (0)) __PYX_ERR(46, 4101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4116
 *         return submat
 * 
 *     def increaseOverlap(self, IS iset, overlap: int = 1) -> None:             # <<<<<<<<<<<<<<
 *         """Increase the overlap of a index set.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_overlap, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 4116, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4116, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_345increaseOverlap, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_increaseOverlap, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[707])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[80]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_increaseOverlap, __pyx_t_13) < (0)) __PYX_ERR(46, 4116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4129
 *         CHKERR(MatIncreaseOverlap(self.mat, 1, &iset.iset, ival))
 * 
 *     def createSubMatrix(self, IS isrow, IS iscol=None, Mat submat=None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return a submatrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 4129, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_347createSubMatrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createSubMatrix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[708])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createSubMatrix, __pyx_t_14) < (0)) __PYX_ERR(46, 4129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4159
 *         return submat
 * 
 *     def createSubMatrices(             # <<<<<<<<<<<<<<
 *         self,
 *         isrows: IS | Sequence[IS],
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_isrows, __pyx_mstate_global->__pyx_kp_u_IS_Sequence_IS) < (0)) __PYX_ERR(46, 4159, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_iscols, __pyx_mstate_global->__pyx_kp_u_IS_Sequence_IS_None) < (0)) __PYX_ERR(46, 4159, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_submats, __pyx_mstate_global->__pyx_kp_u_Mat_Sequence_Mat_None) < (0)) __PYX_ERR(46, 4159, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Sequence_Mat) < (0)) __PYX_ERR(46, 4159, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_349createSubMatrices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createSubMatrices, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[709])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createSubMatrices, __pyx_t_13) < (0)) __PYX_ERR(46, 4159, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4216
 *     #
 * 
 *     def createSchurComplement(self, Mat A00, Mat Ap00, Mat A01, Mat A10, Mat A11=None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `Type.SCHURCOMPLEMENT` matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 4216, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_351createSchurComplement, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_createSchurComplement, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[710])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_createSchurComplement, __pyx_t_14) < (0)) __PYX_ERR(46, 4216, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4250
 *     #
 * 
 *     def getSchurComplementSubMatrices(self) -> tuple[Mat, Mat, Mat, Mat, Mat]:             # <<<<<<<<<<<<<<
 *         """Return Schur complement sub-matrices.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Mat_Mat_Mat_Mat_Mat) < (0)) __PYX_ERR(46, 4250, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_353getSchurComplementSubMatrices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getSchurComplementSubMatrice, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[711])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getSchurComplementSubMatrices, __pyx_t_13) < (0)) __PYX_ERR(46, 4250, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4271
 *     #
 * 
 *     def getLocalSubMatrix(self, IS isrow, IS iscol, Mat submat=None) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return a reference to a submatrix specified in local numbering.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 4271, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_355getLocalSubMatrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getLocalSubMatrix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[712])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getLocalSubMatrix, __pyx_t_14) < (0)) __PYX_ERR(46, 4271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4297
 *         return submat
 * 
 *     def restoreLocalSubMatrix(self, IS isrow, IS iscol, Mat submat) -> None:             # <<<<<<<<<<<<<<
 *         """Restore a reference to a submatrix obtained with `getLocalSubMatrix`.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4297, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_357restoreLocalSubMatrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_restoreLocalSubMatrix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[713])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_restoreLocalSubMatrix, __pyx_t_13) < (0)) __PYX_ERR(46, 4297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4320
 *     #
 * 
 *     def norm(             # <<<<<<<<<<<<<<
 *         self,
 *         norm_type: NormTypeSpec = None) -> float | tuple[float, float]:
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_norm_type, __pyx_mstate_global->__pyx_n_u_NormTypeSpec) < (0)) __PYX_ERR(46, 4320, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_float_tuple_float_float) < (0)) __PYX_ERR(46, 4320, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_359norm, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_norm, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[714])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_norm, __pyx_t_14) < (0)) __PYX_ERR(46, 4320, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4342
 *         else: return (toReal(rval[0]), toReal(rval[1]))
 * 
 *     def scale(self, alpha: Scalar) -> None:             # <<<<<<<<<<<<<<
 *         """Scale the matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(46, 4342, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4342, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_361scale, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_scale, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[715])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_scale, __pyx_t_13) < (0)) __PYX_ERR(46, 4342, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4355
 *         CHKERR(MatScale(self.mat, sval))
 * 
 *     def shift(self, alpha: Scalar) -> None:             # <<<<<<<<<<<<<<
 *         """Shift the matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(46, 4355, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4355, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_363shift, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_shift, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[716])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_shift, __pyx_t_14) < (0)) __PYX_ERR(46, 4355, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4368
 *         CHKERR(MatShift(self.mat, sval))
 * 
 *     def chop(self, tol: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set entries smallest of tol (in absolute values) to zero.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_tol, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(46, 4368, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4368, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_365chop, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_chop, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[717])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_chop, __pyx_t_13) < (0)) __PYX_ERR(46, 4368, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4381
 *         CHKERR(MatFilter(self.mat, rval, PETSC_FALSE, PETSC_FALSE))
 * 
 *     def setRandom(self, Random random=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set random values in the matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4381, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_367setRandom, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setRandom, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[718])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setRandom, __pyx_t_14) < (0)) __PYX_ERR(46, 4381, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4400
 *         CHKERR(MatSetRandom(self.mat, rnd))
 * 
 *     def axpy(self, alpha: Scalar, Mat X, structure: Structure | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Perform the matrix summation ``self`` + = X.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(46, 4400, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_structure, __pyx_mstate_global->__pyx_kp_u_Structure_None) < (0)) __PYX_ERR(46, 4400, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4400, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_369axpy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_axpy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[719])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_axpy, __pyx_t_13) < (0)) __PYX_ERR(46, 4400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4423
 *         CHKERR(MatAXPY(self.mat, sval, X.mat, flag))
 * 
 *     def aypx(self, alpha: Scalar, Mat X, structure: Structure | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Perform the matrix summation ``self`` = ``self`` + X.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(46, 4423, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_structure, __pyx_mstate_global->__pyx_kp_u_Structure_None) < (0)) __PYX_ERR(46, 4423, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4423, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_371aypx, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_aypx, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[720])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_aypx, __pyx_t_14) < (0)) __PYX_ERR(46, 4423, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4448
 *     # matrix-matrix product
 * 
 *     def matMult(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat mat,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_fill, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(46, 4448, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 4448, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_373matMult, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_matMult, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[721])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_matMult, __pyx_t_13) < (0)) __PYX_ERR(46, 4448, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4495
 *         return result
 * 
 *     def matTransposeMult(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat mat,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_fill, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(46, 4495, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 4495, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_375matTransposeMult, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_matTransposeMult, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[722])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_matTransposeMult, __pyx_t_14) < (0)) __PYX_ERR(46, 4495, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4542
 *         return result
 * 
 *     def transposeMatMult(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat mat,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_fill, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(46, 4542, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 4542, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_377transposeMatMult, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_transposeMatMult, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[723])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_transposeMatMult, __pyx_t_13) < (0)) __PYX_ERR(46, 4542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4589
 *         return result
 * 
 *     def ptap(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat P,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_fill, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(46, 4589, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 4589, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_379ptap, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_ptap, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[724])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_ptap, __pyx_t_14) < (0)) __PYX_ERR(46, 4589, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4640
 *         return result
 * 
 *     def rart(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat R,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_fill, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(46, 4640, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 4640, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_381rart, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_rart, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[725])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_rart, __pyx_t_13) < (0)) __PYX_ERR(46, 4640, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4687
 *         return result
 * 
 *     def matMatMult(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat B,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_fill, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(46, 4687, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 4687, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_383matMatMult, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_matMatMult, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[726])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_matMatMult, __pyx_t_14) < (0)) __PYX_ERR(46, 4687, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4732
 *         return result
 * 
 *     def kron(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat mat,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 4732, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_385kron, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_kron, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[727])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_kron, __pyx_t_13) < (0)) __PYX_ERR(46, 4732, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4767
 *         return result
 * 
 *     def bindToCPU(self, flg: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Mark a matrix to temporarily stay on the CPU.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_flg, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 4767, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4767, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_387bindToCPU, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_bindToCPU, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[728])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_bindToCPU, __pyx_t_14) < (0)) __PYX_ERR(46, 4767, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4787
 *         CHKERR(MatBindToCPU(self.mat, bindFlg))
 * 
 *     def boundToCPU(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Query if a matrix is bound to the CPU.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 4787, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_389boundToCPU, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_boundToCPU, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[729])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_boundToCPU, __pyx_t_13) < (0)) __PYX_ERR(46, 4787, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4803
 *     # XXX factorization
 * 
 *     def getOrdering(self, ord_type: OrderingType) -> tuple[IS, IS]:             # <<<<<<<<<<<<<<
 *         """Return a reordering for a matrix to improve a LU factorization.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_ord_type, __pyx_mstate_global->__pyx_n_u_OrderingType) < (0)) __PYX_ERR(46, 4803, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_IS_IS) < (0)) __PYX_ERR(46, 4803, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_391getOrdering, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getOrdering, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[730])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getOrdering, __pyx_t_14) < (0)) __PYX_ERR(46, 4803, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4831
 *         return (rp, cp)
 * 
 *     def reorderForNonzeroDiagonal(             # <<<<<<<<<<<<<<
 *         self,
 *         IS isrow,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_atol, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(46, 4831, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4831, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_393reorderForNonzeroDiagonal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_reorderForNonzeroDiagonal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[731])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[79]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_reorderForNonzeroDiagonal, __pyx_t_13) < (0)) __PYX_ERR(46, 4831, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4859
 *         CHKERR(MatReorderForNonzeroDiagonal(self.mat, rval, rp, cp))
 * 
 *     def factorLU(             # <<<<<<<<<<<<<<
 *         self,
 *         IS isrow,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_options, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(46, 4859, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4859, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_395factorLU, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_factorLU, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[732])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_factorLU, __pyx_t_14) < (0)) __PYX_ERR(46, 4859, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4889
 *         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
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4889, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_397factorSymbolicLU, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_factorSymbolicLU, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[733])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_factorSymbolicLU, __pyx_t_13) < (0)) __PYX_ERR(46, 4889, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4893
 *         raise NotImplementedError
 * 
 *     def factorNumericLU(self, Mat mat, options=None) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         raise NotImplementedError
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4893, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_399factorNumericLU, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_factorNumericLU, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[734])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_factorNumericLU, __pyx_t_14) < (0)) __PYX_ERR(46, 4893, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4897
 *         raise NotImplementedError
 * 
 *     def factorILU(             # <<<<<<<<<<<<<<
 *         self,
 *         IS isrow,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_options, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(46, 4897, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4897, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_401factorILU, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_factorILU, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[735])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_factorILU, __pyx_t_13) < (0)) __PYX_ERR(46, 4897, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4927
 *         CHKERR(MatILUFactor(self.mat, isrow.iset, iscol.iset, &info))
 * 
 *     def factorSymbolicILU(self, IS isrow, IS iscol, options=None) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         raise NotImplementedError
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4927, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_403factorSymbolicILU, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_factorSymbolicILU, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[736])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_factorSymbolicILU, __pyx_t_14) < (0)) __PYX_ERR(46, 4927, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4931
 *         raise NotImplementedError
 * 
 *     def factorCholesky(             # <<<<<<<<<<<<<<
 *         self,
 *         IS isperm,
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_options, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(46, 4931, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4931, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_405factorCholesky, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_factorCholesky, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[737])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_factorCholesky, __pyx_t_13) < (0)) __PYX_ERR(46, 4931, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4956
 *         CHKERR(MatCholeskyFactor(self.mat, isperm.iset, &info))
 * 
 *     def factorSymbolicCholesky(self, IS isperm, options=None) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         raise NotImplementedError
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4956, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_407factorSymbolicCholesky, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_factorSymbolicCholesky, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[738])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_factorSymbolicCholesky, __pyx_t_14) < (0)) __PYX_ERR(46, 4956, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4960
 *         raise NotImplementedError
 * 
 *     def factorNumericCholesky(self, Mat mat, options=None) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         raise NotImplementedError
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4960, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_409factorNumericCholesky, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_factorNumericCholesky, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[739])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_factorNumericCholesky, __pyx_t_13) < (0)) __PYX_ERR(46, 4960, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4964
 *         raise NotImplementedError
 * 
 *     def factorICC(             # <<<<<<<<<<<<<<
 *         self,
 *         IS isperm,
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_options, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(46, 4964, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4964, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_411factorICC, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_factorICC, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[740])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_factorICC, __pyx_t_14) < (0)) __PYX_ERR(46, 4964, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4989
 *         CHKERR(MatICCFactor(self.mat, isperm.iset, &info))
 * 
 *     def factorSymbolicICC(self, IS isperm, options=None) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         raise NotImplementedError
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 4989, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_413factorSymbolicICC, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_factorSymbolicICC, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[741])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_factorSymbolicICC, __pyx_t_13) < (0)) __PYX_ERR(46, 4989, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":4993
 *         raise NotImplementedError
 * 
 *     def getInertia(self) -> tuple[int, int, int]:             # <<<<<<<<<<<<<<
 *         """Return the inertia from a factored matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 4993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int_int) < (0)) __PYX_ERR(46, 4993, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_415getInertia, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getInertia, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[742])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 4993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getInertia, __pyx_t_14) < (0)) __PYX_ERR(46, 4993, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5018
 *         return (toInt(ival1), toInt(ival2), toInt(ival3))
 * 
 *     def setUnfactored(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set a factored matrix to be treated as unfactored.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5018, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_417setUnfactored, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setUnfactored, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[743])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setUnfactored, __pyx_t_13) < (0)) __PYX_ERR(46, 5018, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5032
 *     # IS
 * 
 *     def setISAllowRepeated(self, allow: bool = True) -> None:             # <<<<<<<<<<<<<<
 *         """Allow repeated entries in the local to global map.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_allow, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 5032, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5032, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_419setISAllowRepeated, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setISAllowRepeated, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[744])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[76]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setISAllowRepeated, __pyx_t_14) < (0)) __PYX_ERR(46, 5032, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5050
 *         CHKERR(MatISSetAllowRepeated(self.mat, callow))
 * 
 *     def getISAllowRepeated(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Get the flag for repeated entries in the local to global map.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 5050, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_421getISAllowRepeated, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getISAllowRepeated, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[745])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getISAllowRepeated, __pyx_t_13) < (0)) __PYX_ERR(46, 5050, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5064
 *         return asBool(callow)
 * 
 *     def fixISLocalEmpty(self, fix: bool = True) -> None:             # <<<<<<<<<<<<<<
 *         """Compress out zero local rows from the local matrices.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_fix, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 5064, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5064, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_423fixISLocalEmpty, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_fixISLocalEmpty, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[746])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[76]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_fixISLocalEmpty, __pyx_t_14) < (0)) __PYX_ERR(46, 5064, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5083
 *         CHKERR(MatISFixLocalEmpty(self.mat, cfix))
 * 
 *     def getISLocalMat(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the local matrix stored inside a `Type.IS` matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 5083, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_425getISLocalMat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getISLocalMat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[747])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getISLocalMat, __pyx_t_13) < (0)) __PYX_ERR(46, 5083, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5098
 *         return local
 * 
 *     def restoreISLocalMat(self, Mat local not None) -> None:             # <<<<<<<<<<<<<<
 *         """Restore the local matrix obtained with `getISLocalMat`.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5098, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_427restoreISLocalMat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_restoreISLocalMat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[748])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_restoreISLocalMat, __pyx_t_14) < (0)) __PYX_ERR(46, 5098, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5115
 *         CHKERR(MatISRestoreLocalMat(self.mat, &local.mat))
 * 
 *     def setISLocalMat(self, Mat local not None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the local matrix stored inside a `Type.IS`.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5115, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_429setISLocalMat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setISLocalMat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[749])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setISLocalMat, __pyx_t_13) < (0)) __PYX_ERR(46, 5115, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5132
 *         CHKERR(MatISSetLocalMat(self.mat, local.mat))
 * 
 *     def setISPreallocation(             # <<<<<<<<<<<<<<
 *         self,
 *         nnz: Sequence[int],
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_nnz, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 5132, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_onnz, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(46, 5132, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 5132, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_431setISPreallocation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setISPreallocation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[750])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setISPreallocation, __pyx_t_14) < (0)) __PYX_ERR(46, 5132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5165
 *     # LRC
 * 
 *     def getLRCMats(self) -> tuple[Mat, Mat, Vec, Mat]:             # <<<<<<<<<<<<<<
 *         """Return the constituents of a `Type.LRC` matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Mat_Mat_Vec_Mat) < (0)) __PYX_ERR(46, 5165, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_433getLRCMats, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getLRCMats, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[751])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getLRCMats, __pyx_t_13) < (0)) __PYX_ERR(46, 5165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5197
 *         return (A, U, c, V)
 * 
 *     def setLRCMats(self, Mat A, Mat U, Vec c=None, Mat V=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the constituents of a `Type.LRC` matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5197, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_435setLRCMats, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setLRCMats, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[752])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setLRCMats, __pyx_t_14) < (0)) __PYX_ERR(46, 5197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5226
 *     # H2Opus
 * 
 *     def H2OpusOrthogonalize(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Orthogonalize the basis tree of a hierarchical matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 5226, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_437H2OpusOrthogonalize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_H2OpusOrthogonalize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[753])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_H2OpusOrthogonalize, __pyx_t_13) < (0)) __PYX_ERR(46, 5226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5239
 *         return self
 * 
 *     def H2OpusCompress(self, tol: float) -> Self:             # <<<<<<<<<<<<<<
 *         """Compress a hierarchical matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_tol, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(46, 5239, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 5239, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_439H2OpusCompress, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_H2OpusCompress, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[754])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_H2OpusCompress, __pyx_t_14) < (0)) __PYX_ERR(46, 5239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5258
 *         return self
 * 
 *     def H2OpusLowRankUpdate(self, Mat U, Mat V=None, s: float = 1.0) -> Self:             # <<<<<<<<<<<<<<
 *         """Perform a low-rank update of the form ``self`` += sUV.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_s_2, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(46, 5258, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 5258, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_441H2OpusLowRankUpdate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_H2OpusLowRankUpdate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[755])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_13, __pyx_mstate_global->__pyx_tuple[85]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_H2OpusLowRankUpdate, __pyx_t_13) < (0)) __PYX_ERR(46, 5258, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5286
 *     # Htool
 * 
 *     def HtoolGetPermutationSource(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Get the permutation of source (column) indices computed by Htool.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(46, 5286, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_443HtoolGetPermutationSource, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_HtoolGetPermutationSource, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[756])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_HtoolGetPermutationSource, __pyx_t_14) < (0)) __PYX_ERR(46, 5286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5305
 *         return iset
 * 
 *     def HtoolGetPermutationTarget(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Get the permutation of target (row) indices computed by Htool.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(46, 5305, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_445HtoolGetPermutationTarget, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_HtoolGetPermutationTarget, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[757])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_HtoolGetPermutationTarget, __pyx_t_13) < (0)) __PYX_ERR(46, 5305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5324
 *         return iset
 * 
 *     def HtoolUsePermutation(self, use: bool) -> Self:             # <<<<<<<<<<<<<<
 *         """Set whether to use the permutation computed by Htool.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_use, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 5324, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 5324, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_447HtoolUsePermutation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_HtoolUsePermutation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[758])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_HtoolUsePermutation, __pyx_t_14) < (0)) __PYX_ERR(46, 5324, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5343
 *         return self
 * 
 *     def HtoolUseRecompression(self, use: bool) -> Self:             # <<<<<<<<<<<<<<
 *         """Set whether to recompress the matrix after assembly.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_use, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 5343, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 5343, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_449HtoolUseRecompression, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_HtoolUseRecompression, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[759])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_HtoolUseRecompression, __pyx_t_13) < (0)) __PYX_ERR(46, 5343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5364
 *     # LMVM
 * 
 *     def getLMVMJ0(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Get the initial Jacobian of the LMVM matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 5364, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_451getLMVMJ0, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getLMVMJ0, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[760])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getLMVMJ0, __pyx_t_14) < (0)) __PYX_ERR(46, 5364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5378
 *         return M
 * 
 *     def setLMVMJ0(self, Mat J0) -> None:             # <<<<<<<<<<<<<<
 *         """Set the initial Jacobian of the LMVM matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5378, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_453setLMVMJ0, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setLMVMJ0, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[761])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setLMVMJ0, __pyx_t_13) < (0)) __PYX_ERR(46, 5378, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5395
 *         CHKERR(MatLMVMSetJ0(self.mat, ctype))
 * 
 *     def getLMVMJ0KSP(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Get the KSP of the LMVM matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 5395, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_455getLMVMJ0KSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getLMVMJ0KSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[762])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getLMVMJ0KSP, __pyx_t_14) < (0)) __PYX_ERR(46, 5395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5409
 *         return ksp
 * 
 *     def setLMVMJ0KSP(self, KSP ksp) -> None:             # <<<<<<<<<<<<<<
 *         """Set the KSP of the LMVM matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5409, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_457setLMVMJ0KSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setLMVMJ0KSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[763])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setLMVMJ0KSP, __pyx_t_13) < (0)) __PYX_ERR(46, 5409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5426
 *         CHKERR(MatLMVMSetJ0KSP(self.mat, ctype))
 * 
 *     def allocateLMVM(self, Vec x, Vec f) -> None:             # <<<<<<<<<<<<<<
 *         """Allocate all necessary common memory LMVM matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5426, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_459allocateLMVM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_allocateLMVM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[764])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_allocateLMVM, __pyx_t_14) < (0)) __PYX_ERR(46, 5426, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5446
 *         CHKERR(MatLMVMAllocate(self.mat, xvec, fvec))
 * 
 *     def updateLMVM(self, Vec x, Vec f) -> None:             # <<<<<<<<<<<<<<
 *         """Adds (X-Xprev) and (F-Fprev) updates to LMVM matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5446, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_461updateLMVM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_updateLMVM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[765])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_updateLMVM, __pyx_t_13) < (0)) __PYX_ERR(46, 5446, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5466
 *         CHKERR(MatLMVMUpdate(self.mat, xvec, fvec))
 * 
 *     def resetLMVM(self, destructive: bool = False) -> None:             # <<<<<<<<<<<<<<
 *         """Flushes all of the accumulated updates out of the LMVM matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_destructive, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 5466, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5466, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_463resetLMVM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_resetLMVM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[766])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_resetLMVM, __pyx_t_14) < (0)) __PYX_ERR(46, 5466, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5485
 *     # MUMPS
 * 
 *     def setMumpsIcntl(self, icntl: int, ival: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set a MUMPS parameter, ``ICNTL[icntl] = ival``.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_icntl, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5485, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_ival, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5485, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5485, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_465setMumpsIcntl, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setMumpsIcntl, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[767])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setMumpsIcntl, __pyx_t_13) < (0)) __PYX_ERR(46, 5485, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5506
 *         CHKERR(MatMumpsSetIcntl(self.mat, _icntl, _ival))
 * 
 *     def getMumpsIcntl(self, icntl: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the MUMPS parameter, ``ICNTL[icntl]``.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_icntl, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5506, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5506, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_467getMumpsIcntl, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getMumpsIcntl, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[768])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getMumpsIcntl, __pyx_t_14) < (0)) __PYX_ERR(46, 5506, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5521
 *         return toInt(ival)
 * 
 *     def setMumpsCntl(self, icntl: int, val: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set a MUMPS parameter, ``CNTL[icntl] = val``.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_icntl, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5521, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_val, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(46, 5521, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5521, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_469setMumpsCntl, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setMumpsCntl, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[769])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setMumpsCntl, __pyx_t_13) < (0)) __PYX_ERR(46, 5521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5542
 *         CHKERR(MatMumpsSetCntl(self.mat, _icntl, _val))
 * 
 *     def getMumpsCntl(self, icntl: int) -> float:             # <<<<<<<<<<<<<<
 *         """Return the MUMPS parameter, ``CNTL[icntl]``.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_icntl, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5542, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(46, 5542, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_471getMumpsCntl, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getMumpsCntl, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[770])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getMumpsCntl, __pyx_t_14) < (0)) __PYX_ERR(46, 5542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5557
 *         return toReal(val)
 * 
 *     def getMumpsInfo(self, icntl: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the MUMPS parameter, ``INFO[icntl]``.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_icntl, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5557, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5557, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_473getMumpsInfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getMumpsInfo, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[771])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getMumpsInfo, __pyx_t_13) < (0)) __PYX_ERR(46, 5557, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5577
 *         return toInt(ival)
 * 
 *     def getMumpsInfog(self, icntl: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the MUMPS parameter, ``INFOG[icntl]``.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_icntl, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5577, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5577, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_475getMumpsInfog, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getMumpsInfog, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[772])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getMumpsInfog, __pyx_t_14) < (0)) __PYX_ERR(46, 5577, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5597
 *         return toInt(ival)
 * 
 *     def getMumpsRinfo(self, icntl: int) -> float:             # <<<<<<<<<<<<<<
 *         """Return the MUMPS parameter, ``RINFO[icntl]``.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_icntl, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5597, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(46, 5597, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_477getMumpsRinfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getMumpsRinfo, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[773])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getMumpsRinfo, __pyx_t_13) < (0)) __PYX_ERR(46, 5597, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5617
 *         return toReal(val)
 * 
 *     def getMumpsRinfog(self, icntl: int) -> float:             # <<<<<<<<<<<<<<
 *         """Return the MUMPS parameter, ``RINFOG[icntl]``.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_icntl, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5617, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(46, 5617, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_479getMumpsRinfog, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getMumpsRinfog, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[774])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getMumpsRinfog, __pyx_t_14) < (0)) __PYX_ERR(46, 5617, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5639
 *     # solve
 * 
 *     def solveForward(self, Vec b, Vec x) -> None:             # <<<<<<<<<<<<<<
 *         """Solve Lx = b, given a factored matrix A = LU.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5639, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_481solveForward, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_solveForward, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[775])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_solveForward, __pyx_t_13) < (0)) __PYX_ERR(46, 5639, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5658
 *         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.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5658, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_483solveBackward, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_solveBackward, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[776])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_solveBackward, __pyx_t_14) < (0)) __PYX_ERR(46, 5658, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5677
 *         CHKERR(MatBackwardSolve(self.mat, b.vec, x.vec))
 * 
 *     def solve(self, Vec b, Vec x) -> None:             # <<<<<<<<<<<<<<
 *         """Solve Ax=b, given a factored matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5677, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_485solve, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_solve, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[777])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_solve, __pyx_t_13) < (0)) __PYX_ERR(46, 5677, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5700
 *         CHKERR(MatSolve(self.mat, b.vec, x.vec))
 * 
 *     def solveTranspose(self, Vec b, Vec x) -> None:             # <<<<<<<<<<<<<<
 *         """Solve Ax=b, given a factored matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5700, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_487solveTranspose, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_solveTranspose, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[778])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_solveTranspose, __pyx_t_14) < (0)) __PYX_ERR(46, 5700, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5721
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5721, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_489solveAdd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_solveAdd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[779])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_solveAdd, __pyx_t_13) < (0)) __PYX_ERR(46, 5721, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5744
 *         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.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5744, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_491solveTransposeAdd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_solveTransposeAdd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[780])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_solveTransposeAdd, __pyx_t_14) < (0)) __PYX_ERR(46, 5744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5767
 *         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.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5767, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_493matSolve, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_matSolve, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[781])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_matSolve, __pyx_t_13) < (0)) __PYX_ERR(46, 5767, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5789
 *     # dense matrices
 * 
 *     def setDenseLDA(self, lda: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the leading dimension of the array used by the dense matrix.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_lda, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5789, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5789, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_495setDenseLDA, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setDenseLDA, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[782])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setDenseLDA, __pyx_t_14) < (0)) __PYX_ERR(46, 5789, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5807
 *         CHKERR(MatDenseSetLDA(self.mat, _ilda))
 * 
 *     def getDenseLDA(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the leading dimension of the array used by the dense matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5807, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_497getDenseLDA, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getDenseLDA, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[783])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getDenseLDA, __pyx_t_13) < (0)) __PYX_ERR(46, 5807, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5821
 *         return toInt(lda)
 * 
 *     def getDenseArray(self, readonly: bool = False) -> ArrayScalar:             # <<<<<<<<<<<<<<
 *         """Return the array where the data is stored.
 * 
*/
  __pyx_t_13 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_readonly, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 5821, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayScalar) < (0)) __PYX_ERR(46, 5821, __pyx_L1_error)
  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_499getDenseArray, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getDenseArray, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[784])); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_14, __pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_14, __pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getDenseArray, __pyx_t_14) < (0)) __PYX_ERR(46, 5821, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5862
 *         return array
 * 
 *     def getDenseLocalMatrix(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the local part of the dense matrix.
 * 
*/
  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (PyDict_SetItem(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 5862, __pyx_L1_error)
  __pyx_t_13 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_501getDenseLocalMatrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getDenseLocalMatrix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[785])); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_13);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_13, __pyx_t_14);
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getDenseLocalMatrix, __pyx_t_13) < (0)) __PYX_ERR(46, 5862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5878
 * 
 *     def getDenseSubMatrix(self,
 *                           rbegin: int = DECIDE,             # <<<<<<<<<<<<<<
 *                           rend: int = DECIDE,
 *                           cbegin: int = DECIDE,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_DECIDE); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_mstate_global->__pyx_k__22 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5879
 *     def getDenseSubMatrix(self,
 *                           rbegin: int = DECIDE,
 *                           rend: int = DECIDE,             # <<<<<<<<<<<<<<
 *                           cbegin: int = DECIDE,
 *                           cend: int = DECIDE) -> Mat:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_DECIDE); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_mstate_global->__pyx_k__23 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5880
 *                           rbegin: int = DECIDE,
 *                           rend: int = DECIDE,
 *                           cbegin: int = DECIDE,             # <<<<<<<<<<<<<<
 *                           cend: int = DECIDE) -> Mat:
 *         """Get access to a submatrix of a `Type.DENSE` matrix.
*/
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_DECIDE); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_mstate_global->__pyx_k__24 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5881
 *                           rend: int = DECIDE,
 *                           cbegin: int = DECIDE,
 *                           cend: int = DECIDE) -> Mat:             # <<<<<<<<<<<<<<
 *         """Get access to a submatrix of a `Type.DENSE` matrix.
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_DECIDE); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_mstate_global->__pyx_k__25 = __pyx_t_13;
  __Pyx_GIVEREF(__pyx_t_13);
  __pyx_t_13 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5878
 * 
 *     def getDenseSubMatrix(self,
 *                           rbegin: int = DECIDE,             # <<<<<<<<<<<<<<
 *                           rend: int = DECIDE,
 *                           cbegin: int = DECIDE,
*/
  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_DECIDE); if (unlikely(!__pyx_t_13)) __PYX_ERR(46, 5878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);

  /* "petsc4py/PETSc/Mat.pyx":5879
 *     def getDenseSubMatrix(self,
 *                           rbegin: int = DECIDE,
 *                           rend: int = DECIDE,             # <<<<<<<<<<<<<<
 *                           cbegin: int = DECIDE,
 *                           cend: int = DECIDE) -> Mat:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_DECIDE); if (unlikely(!__pyx_t_14)) __PYX_ERR(46, 5879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);

  /* "petsc4py/PETSc/Mat.pyx":5880
 *                           rbegin: int = DECIDE,
 *                           rend: int = DECIDE,
 *                           cbegin: int = DECIDE,             # <<<<<<<<<<<<<<
 *                           cend: int = DECIDE) -> Mat:
 *         """Get access to a submatrix of a `Type.DENSE` matrix.
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DECIDE); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 5880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "petsc4py/PETSc/Mat.pyx":5881
 *                           rend: int = DECIDE,
 *                           cbegin: int = DECIDE,
 *                           cend: int = DECIDE) -> Mat:             # <<<<<<<<<<<<<<
 *         """Get access to a submatrix of a `Type.DENSE` matrix.
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DECIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 5881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "petsc4py/PETSc/Mat.pyx":5877
 *         return mat
 * 
 *     def getDenseSubMatrix(self,             # <<<<<<<<<<<<<<
 *                           rbegin: int = DECIDE,
 *                           rend: int = DECIDE,
*/
  __pyx_t_10 = PyTuple_Pack(4, __pyx_t_13, __pyx_t_14, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(46, 5877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 5877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_rbegin, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5877, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_rend, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5877, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_cbegin, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5877, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_cend, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5877, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 5877, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_503getDenseSubMatrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getDenseSubMatrix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[786])); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 5877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getDenseSubMatrix, __pyx_t_5) < (0)) __PYX_ERR(46, 5877, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5911
 *         return mat
 * 
 *     def restoreDenseSubMatrix(self, Mat mat) -> None:             # <<<<<<<<<<<<<<
 *         """Restore access to a submatrix of a `Type.DENSE` matrix.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 5911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5911, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_505restoreDenseSubMatrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_restoreDenseSubMatrix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[787])); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 5911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_restoreDenseSubMatrix, __pyx_t_4) < (0)) __PYX_ERR(46, 5911, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5930
 *         CHKERR(PetscCLEAR(mat.obj))
 * 
 *     def getDenseColumnVec(self, i: int, mode: AccessModeSpec = 'rw') -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the i column vector of the dense matrix.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 5930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_i, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5930, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_AccessModeSpec) < (0)) __PYX_ERR(46, 5930, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(46, 5930, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_507getDenseColumnVec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getDenseColumnVec, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[788])); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 5930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[50]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getDenseColumnVec, __pyx_t_5) < (0)) __PYX_ERR(46, 5930, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5962
 *         return v
 * 
 *     def restoreDenseColumnVec(self, i: int, mode: AccessModeSpec = 'rw', Vec V=None) -> None:             # <<<<<<<<<<<<<<
 *         """Restore the i column vector of the dense matrix.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 5962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_i, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 5962, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_AccessModeSpec) < (0)) __PYX_ERR(46, 5962, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 5962, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_509restoreDenseColumnVec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_restoreDenseColumnVec, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[789])); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 5962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[86]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_restoreDenseColumnVec, __pyx_t_4) < (0)) __PYX_ERR(46, 5962, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":5997
 *     # Nest
 * 
 *     def getNestSize(self) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return the number of rows and columns of the matrix.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 5997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(46, 5997, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_511getNestSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getNestSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[790])); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 5997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getNestSize, __pyx_t_5) < (0)) __PYX_ERR(46, 5997, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6011
 *         return toInt(nrows), toInt(ncols)
 * 
 *     def getNestISs(self) -> tuple[list[IS], list[IS]]:             # <<<<<<<<<<<<<<
 *         """Return the index sets representing the row and column spaces.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_list_IS_list_IS) < (0)) __PYX_ERR(46, 6011, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_513getNestISs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getNestISs, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[791])); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getNestISs, __pyx_t_4) < (0)) __PYX_ERR(46, 6011, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6032
 *         return isetsrows, isetscols
 * 
 *     def getNestLocalISs(self) -> tuple[list[IS], list[IS]]:             # <<<<<<<<<<<<<<
 *         """Return the local index sets representing the row and column spaces.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_list_IS_list_IS) < (0)) __PYX_ERR(46, 6032, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_515getNestLocalISs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getNestLocalISs, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[792])); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getNestLocalISs, __pyx_t_5) < (0)) __PYX_ERR(46, 6032, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6053
 *         return isetsrows, isetscols
 * 
 *     def getNestSubMatrix(self, i: int, j: int) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return a single submatrix.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_i, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 6053, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_j, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(46, 6053, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(46, 6053, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_517getNestSubMatrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getNestSubMatrix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[793])); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getNestSubMatrix, __pyx_t_4) < (0)) __PYX_ERR(46, 6053, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6079
 *     # DM
 * 
 *     def getDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the DM defining the data layout of the matrix.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(46, 6079, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_519getDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_getDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[794])); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_getDM, __pyx_t_5) < (0)) __PYX_ERR(46, 6079, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6096
 *         return dm
 * 
 *     def setDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Set the DM defining the data layout of the matrix.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 6096, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_521setDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_setDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[795])); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_setDM, __pyx_t_4) < (0)) __PYX_ERR(46, 6096, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6115
 *     # backward compatibility
 * 
 *     PtAP = ptap             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_ptap); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_PtAP, __pyx_t_4) < (0)) __PYX_ERR(46, 6115, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6177
 * 
 *     # TODO Stream
 *     def __dlpack__(self, stream=-1):             # <<<<<<<<<<<<<<
 *         return self.toDLPack('rw')
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_523__dlpack__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat___dlpack, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[796])); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_dlpack, __pyx_t_4) < (0)) __PYX_ERR(46, 6177, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6180
 *         return self.toDLPack('rw')
 * 
 *     def __dlpack_device__(self):             # <<<<<<<<<<<<<<
 *         (dltype, devId, _, _, _) = mat_get_dlpack_ctx(self)
 *         return (dltype, devId)
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_525__dlpack_device__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat___dlpack_device, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[797])); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_dlpack_device, __pyx_t_4) < (0)) __PYX_ERR(46, 6180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6184
 *         return (dltype, devId)
 * 
 *     def toDLPack(self, mode: AccessModeSpec = 'rw') -> Any:             # <<<<<<<<<<<<<<
 *         """Return a DLPack `PyCapsule` wrapping the vector data."""
 *         if mode is None: mode = 'rw'
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_AccessModeSpec) < (0)) __PYX_ERR(46, 6184, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(46, 6184, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3Mat_527toDLPack, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Mat_toDLPack, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[798])); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[50]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Mat, __pyx_mstate_global->__pyx_n_u_toDLPack, __pyx_t_5) < (0)) __PYX_ERR(46, 6184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6276
 *     #
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the null space.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 6276, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9NullSpace_5view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NullSpace_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[799])); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_4) < (0)) __PYX_ERR(46, 6276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6295
 *         CHKERR(MatNullSpaceView(self.nsp, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the null space.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 6295, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9NullSpace_7destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NullSpace_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[800])); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_5) < (0)) __PYX_ERR(46, 6295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6308
 *         return self
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         constant: bool = False,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constant, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 6308, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vectors, __pyx_mstate_global->__pyx_kp_u_Sequence_Vec) < (0)) __PYX_ERR(46, 6308, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 6308, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9NullSpace_9create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NullSpace_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[801])); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[87]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_4) < (0)) __PYX_ERR(46, 6308, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6344
 *         return self
 * 
 *     def createRigidBody(self, Vec coords) -> Self:             # <<<<<<<<<<<<<<
 *         """Create rigid body modes from coordinates.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(46, 6344, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9NullSpace_11createRigidBody, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NullSpace_createRigidBody, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[802])); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, __pyx_mstate_global->__pyx_n_u_createRigidBody, __pyx_t_5) < (0)) __PYX_ERR(46, 6344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6365
 *         return self
 * 
 *     def setFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         function: MatNullFunction,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_function, __pyx_mstate_global->__pyx_n_u_MatNullFunction) < (0)) __PYX_ERR(46, 6365, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(46, 6365, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(46, 6365, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 6365, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9NullSpace_13setFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NullSpace_setFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[803])); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, __pyx_mstate_global->__pyx_n_u_setFunction, __pyx_t_4) < (0)) __PYX_ERR(46, 6365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6399
 *     #
 * 
 *     def hasConstant(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the null space contains the constant.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 6399, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9NullSpace_15hasConstant, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NullSpace_hasConstant, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[804])); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, __pyx_mstate_global->__pyx_n_u_hasConstant, __pyx_t_5) < (0)) __PYX_ERR(46, 6399, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6413
 *         return toBool(flag)
 * 
 *     def getVecs(self) -> list[Vec]:             # <<<<<<<<<<<<<<
 *         """Return the vectors defining the null space.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_Vec) < (0)) __PYX_ERR(46, 6413, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9NullSpace_17getVecs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NullSpace_getVecs, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[805])); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, __pyx_mstate_global->__pyx_n_u_getVecs, __pyx_t_4) < (0)) __PYX_ERR(46, 6413, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6435
 *         return vectors
 * 
 *     def getFunction(self) -> MatNullFunction:             # <<<<<<<<<<<<<<
 *         """Return the callback to remove the nullspace.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_MatNullFunction) < (0)) __PYX_ERR(46, 6435, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9NullSpace_19getFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NullSpace_getFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[806])); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, __pyx_mstate_global->__pyx_n_u_getFunction, __pyx_t_5) < (0)) __PYX_ERR(46, 6435, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6449
 *     #
 * 
 *     def remove(self, Vec vec) -> None:             # <<<<<<<<<<<<<<
 *         """Remove all components of a null space from a vector.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(46, 6449, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9NullSpace_21remove, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NullSpace_remove, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[807])); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, __pyx_mstate_global->__pyx_n_u_remove, __pyx_t_4) < (0)) __PYX_ERR(46, 6449, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6466
 *         CHKERR(MatNullSpaceRemove(self.nsp, vec.vec))
 * 
 *     def test(self, Mat mat) -> bool:             # <<<<<<<<<<<<<<
 *         """Return if the claimed null space is valid for a matrix.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(46, 6466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(46, 6466, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9NullSpace_23test, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_NullSpace_test, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[808])); if (unlikely(!__pyx_t_5)) __PYX_ERR(46, 6466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_NullSpace, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_5) < (0)) __PYX_ERR(46, 6466, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/Mat.pyx":6487
 * # --------------------------------------------------------------------
 * 
 * del MatType             # <<<<<<<<<<<<<<
 * del MatOption
 * del MatAssemblyType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MatType) < (0)) __PYX_ERR(46, 6487, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6488
 * 
 * del MatType
 * del MatOption             # <<<<<<<<<<<<<<
 * del MatAssemblyType
 * del MatInfoType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MatOption) < (0)) __PYX_ERR(46, 6488, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6489
 * del MatType
 * del MatOption
 * del MatAssemblyType             # <<<<<<<<<<<<<<
 * del MatInfoType
 * del MatStructure
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MatAssemblyType) < (0)) __PYX_ERR(46, 6489, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6490
 * del MatOption
 * del MatAssemblyType
 * del MatInfoType             # <<<<<<<<<<<<<<
 * del MatStructure
 * del MatDuplicateOption
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MatInfoType) < (0)) __PYX_ERR(46, 6490, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6491
 * del MatAssemblyType
 * del MatInfoType
 * del MatStructure             # <<<<<<<<<<<<<<
 * del MatDuplicateOption
 * del MatOrderingType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MatStructure) < (0)) __PYX_ERR(46, 6491, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6492
 * del MatInfoType
 * del MatStructure
 * del MatDuplicateOption             # <<<<<<<<<<<<<<
 * del MatOrderingType
 * del MatSolverType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MatDuplicateOption) < (0)) __PYX_ERR(46, 6492, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6493
 * del MatStructure
 * del MatDuplicateOption
 * del MatOrderingType             # <<<<<<<<<<<<<<
 * del MatSolverType
 * del MatFactorShiftType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MatOrderingType) < (0)) __PYX_ERR(46, 6493, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6494
 * del MatDuplicateOption
 * del MatOrderingType
 * del MatSolverType             # <<<<<<<<<<<<<<
 * del MatFactorShiftType
 * del MatSORType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MatSolverType) < (0)) __PYX_ERR(46, 6494, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6495
 * del MatOrderingType
 * del MatSolverType
 * del MatFactorShiftType             # <<<<<<<<<<<<<<
 * del MatSORType
 * 
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MatFactorShiftType) < (0)) __PYX_ERR(46, 6495, __pyx_L1_error)

  /* "petsc4py/PETSc/Mat.pyx":6496
 * del MatSolverType
 * del MatFactorShiftType
 * del MatSORType             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MatSORType) < (0)) __PYX_ERR(46, 6496, __pyx_L1_error)

  /* "petsc4py/PETSc/MatPartitioning.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class MatPartitioningType(object):             # <<<<<<<<<<<<<<
 *     """The partitioning types."""
 *     PARTITIONINGCURRENT  = S_(MATPARTITIONINGCURRENT)
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[89]); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_MatPartitioningType, __pyx_mstate_global->__pyx_n_u_MatPartitioningType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_partitioning_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(47, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[89]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[89]) < 0))) __PYX_ERR(47, 3, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/MatPartitioning.pyx":5
 * class MatPartitioningType(object):
 *     """The partitioning types."""
 *     PARTITIONINGCURRENT  = S_(MATPARTITIONINGCURRENT)             # <<<<<<<<<<<<<<
 *     PARTITIONINGAVERAGE  = S_(MATPARTITIONINGAVERAGE)
 *     PARTITIONINGSQUARE   = S_(MATPARTITIONINGSQUARE)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(MATPARTITIONINGCURRENT); if (unlikely(!__pyx_t_14)) __PYX_ERR(47, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PARTITIONINGCURRENT, __pyx_t_14) < (0)) __PYX_ERR(47, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":6
 *     """The partitioning types."""
 *     PARTITIONINGCURRENT  = S_(MATPARTITIONINGCURRENT)
 *     PARTITIONINGAVERAGE  = S_(MATPARTITIONINGAVERAGE)             # <<<<<<<<<<<<<<
 *     PARTITIONINGSQUARE   = S_(MATPARTITIONINGSQUARE)
 *     PARTITIONINGPARMETIS = S_(MATPARTITIONINGPARMETIS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(MATPARTITIONINGAVERAGE); if (unlikely(!__pyx_t_14)) __PYX_ERR(47, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PARTITIONINGAVERAGE, __pyx_t_14) < (0)) __PYX_ERR(47, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":7
 *     PARTITIONINGCURRENT  = S_(MATPARTITIONINGCURRENT)
 *     PARTITIONINGAVERAGE  = S_(MATPARTITIONINGAVERAGE)
 *     PARTITIONINGSQUARE   = S_(MATPARTITIONINGSQUARE)             # <<<<<<<<<<<<<<
 *     PARTITIONINGPARMETIS = S_(MATPARTITIONINGPARMETIS)
 *     PARTITIONINGCHACO    = S_(MATPARTITIONINGCHACO)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(MATPARTITIONINGSQUARE); if (unlikely(!__pyx_t_14)) __PYX_ERR(47, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PARTITIONINGSQUARE, __pyx_t_14) < (0)) __PYX_ERR(47, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":8
 *     PARTITIONINGAVERAGE  = S_(MATPARTITIONINGAVERAGE)
 *     PARTITIONINGSQUARE   = S_(MATPARTITIONINGSQUARE)
 *     PARTITIONINGPARMETIS = S_(MATPARTITIONINGPARMETIS)             # <<<<<<<<<<<<<<
 *     PARTITIONINGCHACO    = S_(MATPARTITIONINGCHACO)
 *     PARTITIONINGPARTY    = S_(MATPARTITIONINGPARTY)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(MATPARTITIONINGPARMETIS); if (unlikely(!__pyx_t_14)) __PYX_ERR(47, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PARTITIONINGPARMETIS, __pyx_t_14) < (0)) __PYX_ERR(47, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":9
 *     PARTITIONINGSQUARE   = S_(MATPARTITIONINGSQUARE)
 *     PARTITIONINGPARMETIS = S_(MATPARTITIONINGPARMETIS)
 *     PARTITIONINGCHACO    = S_(MATPARTITIONINGCHACO)             # <<<<<<<<<<<<<<
 *     PARTITIONINGPARTY    = S_(MATPARTITIONINGPARTY)
 *     PARTITIONINGPTSCOTCH = S_(MATPARTITIONINGPTSCOTCH)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(MATPARTITIONINGCHACO); if (unlikely(!__pyx_t_14)) __PYX_ERR(47, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PARTITIONINGCHACO, __pyx_t_14) < (0)) __PYX_ERR(47, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":10
 *     PARTITIONINGPARMETIS = S_(MATPARTITIONINGPARMETIS)
 *     PARTITIONINGCHACO    = S_(MATPARTITIONINGCHACO)
 *     PARTITIONINGPARTY    = S_(MATPARTITIONINGPARTY)             # <<<<<<<<<<<<<<
 *     PARTITIONINGPTSCOTCH = S_(MATPARTITIONINGPTSCOTCH)
 *     PARTITIONINGHIERARCH = S_(MATPARTITIONINGHIERARCH)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(MATPARTITIONINGPARTY); if (unlikely(!__pyx_t_14)) __PYX_ERR(47, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PARTITIONINGPARTY, __pyx_t_14) < (0)) __PYX_ERR(47, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":11
 *     PARTITIONINGCHACO    = S_(MATPARTITIONINGCHACO)
 *     PARTITIONINGPARTY    = S_(MATPARTITIONINGPARTY)
 *     PARTITIONINGPTSCOTCH = S_(MATPARTITIONINGPTSCOTCH)             # <<<<<<<<<<<<<<
 *     PARTITIONINGHIERARCH = S_(MATPARTITIONINGHIERARCH)
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(MATPARTITIONINGPTSCOTCH); if (unlikely(!__pyx_t_14)) __PYX_ERR(47, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PARTITIONINGPTSCOTCH, __pyx_t_14) < (0)) __PYX_ERR(47, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":12
 *     PARTITIONINGPARTY    = S_(MATPARTITIONINGPARTY)
 *     PARTITIONINGPTSCOTCH = S_(MATPARTITIONINGPTSCOTCH)
 *     PARTITIONINGHIERARCH = S_(MATPARTITIONINGHIERARCH)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(MATPARTITIONINGHIERARCH); if (unlikely(!__pyx_t_14)) __PYX_ERR(47, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PARTITIONINGHIERARCH, __pyx_t_14) < (0)) __PYX_ERR(47, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class MatPartitioningType(object):             # <<<<<<<<<<<<<<
 *     """The partitioning types."""
 *     PARTITIONINGCURRENT  = S_(MATPARTITIONINGCURRENT)
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MatPartitioningType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(47, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MatPartitioningType, __pyx_t_14) < (0)) __PYX_ERR(47, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":20
 *     """Object for managing the partitioning of a matrix or graph."""
 * 
 *     Type = MatPartitioningType             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MatPartitioningType); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_5) < (0)) __PYX_ERR(47, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":29
 *         return self.getValue()
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the partitioning data structure.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(47, 29, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15MatPartitioning_5view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MatPartitioning_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[809])); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_4) < (0)) __PYX_ERR(47, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":49
 *         CHKERR(MatPartitioningView(self.part, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the partitioning context.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(47, 49, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15MatPartitioning_7destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MatPartitioning_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[810])); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_5) < (0)) __PYX_ERR(47, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":62
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a partitioning context.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(47, 62, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(47, 62, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15MatPartitioning_9create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MatPartitioning_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[811])); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_4) < (0)) __PYX_ERR(47, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":81
 *         return self
 * 
 *     def setType(self, matpartitioning_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the partitioner to use.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_matpartitioning_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(47, 81, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(47, 81, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15MatPartitioning_11setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MatPartitioning_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[812])); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_5) < (0)) __PYX_ERR(47, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":100
 *         CHKERR(MatPartitioningSetType(self.part, cval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the partitioning method.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(47, 100, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15MatPartitioning_13getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MatPartitioning_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[813])); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_4) < (0)) __PYX_ERR(47, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":114
 *         return bytes2str(cval)
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set parameters in the partitioner from the options database.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(47, 114, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15MatPartitioning_15setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MatPartitioning_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[814])); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_5) < (0)) __PYX_ERR(47, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":126
 *         CHKERR(MatPartitioningSetFromOptions(self.part))
 * 
 *     def setAdjacency(self, Mat adj) -> None:             # <<<<<<<<<<<<<<
 *         """Set the adjacency graph (matrix) of the thing to be partitioned.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(47, 126, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15MatPartitioning_17setAdjacency, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MatPartitioning_setAdjacency, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[815])); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning, __pyx_mstate_global->__pyx_n_u_setAdjacency, __pyx_t_4) < (0)) __PYX_ERR(47, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":144
 *         CHKERR(MatPartitioningSetAdjacency(self.part, adj.mat))
 * 
 *     def apply(self, IS partitioning) -> None:             # <<<<<<<<<<<<<<
 *         """Return a partitioning for the graph represented by a sparse matrix.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(47, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(47, 144, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15MatPartitioning_19apply, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MatPartitioning_apply, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[816])); if (unlikely(!__pyx_t_5)) __PYX_ERR(47, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_MatPartitioning, __pyx_mstate_global->__pyx_n_u_apply, __pyx_t_5) < (0)) __PYX_ERR(47, 144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/MatPartitioning.pyx":161
 * # --------------------------------------------------------------------
 * 
 * del MatPartitioningType             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MatPartitioningType) < (0)) __PYX_ERR(47, 161, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class PCType(object):             # <<<<<<<<<<<<<<
 *     """The preconditioner method."""
 *     NONE               = S_(PCNONE)
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[91]); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCType, __pyx_mstate_global->__pyx_n_u_PCType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_preconditioner_method); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[91]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[91]) < 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_14 = __pyx_f_8petsc4py_5PETSc_S_(PCNONE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NONE, __pyx_t_14) < (0)) __PYX_ERR(48, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":6
 *     """The preconditioner method."""
 *     NONE               = S_(PCNONE)
 *     JACOBI             = S_(PCJACOBI)             # <<<<<<<<<<<<<<
 *     SOR                = S_(PCSOR)
 *     LU                 = S_(PCLU)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCJACOBI); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_JACOBI, __pyx_t_14) < (0)) __PYX_ERR(48, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":7
 *     NONE               = S_(PCNONE)
 *     JACOBI             = S_(PCJACOBI)
 *     SOR                = S_(PCSOR)             # <<<<<<<<<<<<<<
 *     LU                 = S_(PCLU)
 *     QR                 = S_(PCQR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCSOR); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SOR, __pyx_t_14) < (0)) __PYX_ERR(48, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":8
 *     JACOBI             = S_(PCJACOBI)
 *     SOR                = S_(PCSOR)
 *     LU                 = S_(PCLU)             # <<<<<<<<<<<<<<
 *     QR                 = S_(PCQR)
 *     SHELL              = S_(PCSHELL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCLU); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LU, __pyx_t_14) < (0)) __PYX_ERR(48, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":9
 *     SOR                = S_(PCSOR)
 *     LU                 = S_(PCLU)
 *     QR                 = S_(PCQR)             # <<<<<<<<<<<<<<
 *     SHELL              = S_(PCSHELL)
 *     BJACOBI            = S_(PCBJACOBI)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCQR); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QR, __pyx_t_14) < (0)) __PYX_ERR(48, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":10
 *     LU                 = S_(PCLU)
 *     QR                 = S_(PCQR)
 *     SHELL              = S_(PCSHELL)             # <<<<<<<<<<<<<<
 *     BJACOBI            = S_(PCBJACOBI)
 *     VPBJACOBI          = S_(PCVPBJACOBI)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCSHELL); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SHELL, __pyx_t_14) < (0)) __PYX_ERR(48, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":11
 *     QR                 = S_(PCQR)
 *     SHELL              = S_(PCSHELL)
 *     BJACOBI            = S_(PCBJACOBI)             # <<<<<<<<<<<<<<
 *     VPBJACOBI          = S_(PCVPBJACOBI)
 *     MG                 = S_(PCMG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCBJACOBI); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BJACOBI, __pyx_t_14) < (0)) __PYX_ERR(48, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":12
 *     SHELL              = S_(PCSHELL)
 *     BJACOBI            = S_(PCBJACOBI)
 *     VPBJACOBI          = S_(PCVPBJACOBI)             # <<<<<<<<<<<<<<
 *     MG                 = S_(PCMG)
 *     EISENSTAT          = S_(PCEISENSTAT)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCVPBJACOBI); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_VPBJACOBI, __pyx_t_14) < (0)) __PYX_ERR(48, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":13
 *     BJACOBI            = S_(PCBJACOBI)
 *     VPBJACOBI          = S_(PCVPBJACOBI)
 *     MG                 = S_(PCMG)             # <<<<<<<<<<<<<<
 *     EISENSTAT          = S_(PCEISENSTAT)
 *     ILU                = S_(PCILU)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCMG); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MG, __pyx_t_14) < (0)) __PYX_ERR(48, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":14
 *     VPBJACOBI          = S_(PCVPBJACOBI)
 *     MG                 = S_(PCMG)
 *     EISENSTAT          = S_(PCEISENSTAT)             # <<<<<<<<<<<<<<
 *     ILU                = S_(PCILU)
 *     ICC                = S_(PCICC)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCEISENSTAT); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_EISENSTAT, __pyx_t_14) < (0)) __PYX_ERR(48, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":15
 *     MG                 = S_(PCMG)
 *     EISENSTAT          = S_(PCEISENSTAT)
 *     ILU                = S_(PCILU)             # <<<<<<<<<<<<<<
 *     ICC                = S_(PCICC)
 *     ASM                = S_(PCASM)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCILU); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ILU, __pyx_t_14) < (0)) __PYX_ERR(48, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":16
 *     EISENSTAT          = S_(PCEISENSTAT)
 *     ILU                = S_(PCILU)
 *     ICC                = S_(PCICC)             # <<<<<<<<<<<<<<
 *     ASM                = S_(PCASM)
 *     GASM               = S_(PCGASM)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCICC); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ICC, __pyx_t_14) < (0)) __PYX_ERR(48, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":17
 *     ILU                = S_(PCILU)
 *     ICC                = S_(PCICC)
 *     ASM                = S_(PCASM)             # <<<<<<<<<<<<<<
 *     GASM               = S_(PCGASM)
 *     KSP                = S_(PCKSP)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCASM); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ASM, __pyx_t_14) < (0)) __PYX_ERR(48, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":18
 *     ICC                = S_(PCICC)
 *     ASM                = S_(PCASM)
 *     GASM               = S_(PCGASM)             # <<<<<<<<<<<<<<
 *     KSP                = S_(PCKSP)
 *     COMPOSITE          = S_(PCCOMPOSITE)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCGASM); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_GASM, __pyx_t_14) < (0)) __PYX_ERR(48, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":19
 *     ASM                = S_(PCASM)
 *     GASM               = S_(PCGASM)
 *     KSP                = S_(PCKSP)             # <<<<<<<<<<<<<<
 *     COMPOSITE          = S_(PCCOMPOSITE)
 *     REDUNDANT          = S_(PCREDUNDANT)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCKSP); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_KSP, __pyx_t_14) < (0)) __PYX_ERR(48, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":20
 *     GASM               = S_(PCGASM)
 *     KSP                = S_(PCKSP)
 *     COMPOSITE          = S_(PCCOMPOSITE)             # <<<<<<<<<<<<<<
 *     REDUNDANT          = S_(PCREDUNDANT)
 *     SPAI               = S_(PCSPAI)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCCOMPOSITE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_COMPOSITE, __pyx_t_14) < (0)) __PYX_ERR(48, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":21
 *     KSP                = S_(PCKSP)
 *     COMPOSITE          = S_(PCCOMPOSITE)
 *     REDUNDANT          = S_(PCREDUNDANT)             # <<<<<<<<<<<<<<
 *     SPAI               = S_(PCSPAI)
 *     NN                 = S_(PCNN)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCREDUNDANT); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_REDUNDANT, __pyx_t_14) < (0)) __PYX_ERR(48, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":22
 *     COMPOSITE          = S_(PCCOMPOSITE)
 *     REDUNDANT          = S_(PCREDUNDANT)
 *     SPAI               = S_(PCSPAI)             # <<<<<<<<<<<<<<
 *     NN                 = S_(PCNN)
 *     CHOLESKY           = S_(PCCHOLESKY)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCSPAI); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SPAI, __pyx_t_14) < (0)) __PYX_ERR(48, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":23
 *     REDUNDANT          = S_(PCREDUNDANT)
 *     SPAI               = S_(PCSPAI)
 *     NN                 = S_(PCNN)             # <<<<<<<<<<<<<<
 *     CHOLESKY           = S_(PCCHOLESKY)
 *     PBJACOBI           = S_(PCPBJACOBI)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCNN); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NN, __pyx_t_14) < (0)) __PYX_ERR(48, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":24
 *     SPAI               = S_(PCSPAI)
 *     NN                 = S_(PCNN)
 *     CHOLESKY           = S_(PCCHOLESKY)             # <<<<<<<<<<<<<<
 *     PBJACOBI           = S_(PCPBJACOBI)
 *     MAT                = S_(PCMAT)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCCHOLESKY); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CHOLESKY, __pyx_t_14) < (0)) __PYX_ERR(48, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":25
 *     NN                 = S_(PCNN)
 *     CHOLESKY           = S_(PCCHOLESKY)
 *     PBJACOBI           = S_(PCPBJACOBI)             # <<<<<<<<<<<<<<
 *     MAT                = S_(PCMAT)
 *     HYPRE              = S_(PCHYPRE)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCPBJACOBI); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PBJACOBI, __pyx_t_14) < (0)) __PYX_ERR(48, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":26
 *     CHOLESKY           = S_(PCCHOLESKY)
 *     PBJACOBI           = S_(PCPBJACOBI)
 *     MAT                = S_(PCMAT)             # <<<<<<<<<<<<<<
 *     HYPRE              = S_(PCHYPRE)
 *     PARMS              = S_(PCPARMS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCMAT); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MAT, __pyx_t_14) < (0)) __PYX_ERR(48, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":27
 *     PBJACOBI           = S_(PCPBJACOBI)
 *     MAT                = S_(PCMAT)
 *     HYPRE              = S_(PCHYPRE)             # <<<<<<<<<<<<<<
 *     PARMS              = S_(PCPARMS)
 *     FIELDSPLIT         = S_(PCFIELDSPLIT)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCHYPRE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_HYPRE, __pyx_t_14) < (0)) __PYX_ERR(48, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":28
 *     MAT                = S_(PCMAT)
 *     HYPRE              = S_(PCHYPRE)
 *     PARMS              = S_(PCPARMS)             # <<<<<<<<<<<<<<
 *     FIELDSPLIT         = S_(PCFIELDSPLIT)
 *     TFS                = S_(PCTFS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCPARMS); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PARMS, __pyx_t_14) < (0)) __PYX_ERR(48, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":29
 *     HYPRE              = S_(PCHYPRE)
 *     PARMS              = S_(PCPARMS)
 *     FIELDSPLIT         = S_(PCFIELDSPLIT)             # <<<<<<<<<<<<<<
 *     TFS                = S_(PCTFS)
 *     ML                 = S_(PCML)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCFIELDSPLIT); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FIELDSPLIT, __pyx_t_14) < (0)) __PYX_ERR(48, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":30
 *     PARMS              = S_(PCPARMS)
 *     FIELDSPLIT         = S_(PCFIELDSPLIT)
 *     TFS                = S_(PCTFS)             # <<<<<<<<<<<<<<
 *     ML                 = S_(PCML)
 *     GALERKIN           = S_(PCGALERKIN)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCTFS); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_TFS, __pyx_t_14) < (0)) __PYX_ERR(48, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":31
 *     FIELDSPLIT         = S_(PCFIELDSPLIT)
 *     TFS                = S_(PCTFS)
 *     ML                 = S_(PCML)             # <<<<<<<<<<<<<<
 *     GALERKIN           = S_(PCGALERKIN)
 *     EXOTIC             = S_(PCEXOTIC)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCML); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ML, __pyx_t_14) < (0)) __PYX_ERR(48, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":32
 *     TFS                = S_(PCTFS)
 *     ML                 = S_(PCML)
 *     GALERKIN           = S_(PCGALERKIN)             # <<<<<<<<<<<<<<
 *     EXOTIC             = S_(PCEXOTIC)
 *     CP                 = S_(PCCP)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCGALERKIN); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_GALERKIN, __pyx_t_14) < (0)) __PYX_ERR(48, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":33
 *     ML                 = S_(PCML)
 *     GALERKIN           = S_(PCGALERKIN)
 *     EXOTIC             = S_(PCEXOTIC)             # <<<<<<<<<<<<<<
 *     CP                 = S_(PCCP)
 *     LSC                = S_(PCLSC)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCEXOTIC); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_EXOTIC, __pyx_t_14) < (0)) __PYX_ERR(48, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":34
 *     GALERKIN           = S_(PCGALERKIN)
 *     EXOTIC             = S_(PCEXOTIC)
 *     CP                 = S_(PCCP)             # <<<<<<<<<<<<<<
 *     LSC                = S_(PCLSC)
 *     PYTHON             = S_(PCPYTHON)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCCP); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CP, __pyx_t_14) < (0)) __PYX_ERR(48, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":35
 *     EXOTIC             = S_(PCEXOTIC)
 *     CP                 = S_(PCCP)
 *     LSC                = S_(PCLSC)             # <<<<<<<<<<<<<<
 *     PYTHON             = S_(PCPYTHON)
 *     PFMG               = S_(PCPFMG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCLSC); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LSC, __pyx_t_14) < (0)) __PYX_ERR(48, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":36
 *     CP                 = S_(PCCP)
 *     LSC                = S_(PCLSC)
 *     PYTHON             = S_(PCPYTHON)             # <<<<<<<<<<<<<<
 *     PFMG               = S_(PCPFMG)
 *     SYSPFMG            = S_(PCSYSPFMG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCPYTHON); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PYTHON, __pyx_t_14) < (0)) __PYX_ERR(48, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":37
 *     LSC                = S_(PCLSC)
 *     PYTHON             = S_(PCPYTHON)
 *     PFMG               = S_(PCPFMG)             # <<<<<<<<<<<<<<
 *     SYSPFMG            = S_(PCSYSPFMG)
 *     REDISTRIBUTE       = S_(PCREDISTRIBUTE)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCPFMG); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PFMG, __pyx_t_14) < (0)) __PYX_ERR(48, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":38
 *     PYTHON             = S_(PCPYTHON)
 *     PFMG               = S_(PCPFMG)
 *     SYSPFMG            = S_(PCSYSPFMG)             # <<<<<<<<<<<<<<
 *     REDISTRIBUTE       = S_(PCREDISTRIBUTE)
 *     SVD                = S_(PCSVD)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCSYSPFMG); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SYSPFMG, __pyx_t_14) < (0)) __PYX_ERR(48, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":39
 *     PFMG               = S_(PCPFMG)
 *     SYSPFMG            = S_(PCSYSPFMG)
 *     REDISTRIBUTE       = S_(PCREDISTRIBUTE)             # <<<<<<<<<<<<<<
 *     SVD                = S_(PCSVD)
 *     GAMG               = S_(PCGAMG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCREDISTRIBUTE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_REDISTRIBUTE, __pyx_t_14) < (0)) __PYX_ERR(48, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":40
 *     SYSPFMG            = S_(PCSYSPFMG)
 *     REDISTRIBUTE       = S_(PCREDISTRIBUTE)
 *     SVD                = S_(PCSVD)             # <<<<<<<<<<<<<<
 *     GAMG               = S_(PCGAMG)
 *     CHOWILUVIENNACL    = S_(PCCHOWILUVIENNACL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCSVD); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SVD, __pyx_t_14) < (0)) __PYX_ERR(48, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":41
 *     REDISTRIBUTE       = S_(PCREDISTRIBUTE)
 *     SVD                = S_(PCSVD)
 *     GAMG               = S_(PCGAMG)             # <<<<<<<<<<<<<<
 *     CHOWILUVIENNACL    = S_(PCCHOWILUVIENNACL)
 *     ROWSCALINGVIENNACL = S_(PCROWSCALINGVIENNACL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCGAMG); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_GAMG, __pyx_t_14) < (0)) __PYX_ERR(48, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":42
 *     SVD                = S_(PCSVD)
 *     GAMG               = S_(PCGAMG)
 *     CHOWILUVIENNACL    = S_(PCCHOWILUVIENNACL)             # <<<<<<<<<<<<<<
 *     ROWSCALINGVIENNACL = S_(PCROWSCALINGVIENNACL)
 *     SAVIENNACL         = S_(PCSAVIENNACL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCCHOWILUVIENNACL); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CHOWILUVIENNACL, __pyx_t_14) < (0)) __PYX_ERR(48, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":43
 *     GAMG               = S_(PCGAMG)
 *     CHOWILUVIENNACL    = S_(PCCHOWILUVIENNACL)
 *     ROWSCALINGVIENNACL = S_(PCROWSCALINGVIENNACL)             # <<<<<<<<<<<<<<
 *     SAVIENNACL         = S_(PCSAVIENNACL)
 *     BDDC               = S_(PCBDDC)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCROWSCALINGVIENNACL); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ROWSCALINGVIENNACL, __pyx_t_14) < (0)) __PYX_ERR(48, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":44
 *     CHOWILUVIENNACL    = S_(PCCHOWILUVIENNACL)
 *     ROWSCALINGVIENNACL = S_(PCROWSCALINGVIENNACL)
 *     SAVIENNACL         = S_(PCSAVIENNACL)             # <<<<<<<<<<<<<<
 *     BDDC               = S_(PCBDDC)
 *     KACZMARZ           = S_(PCKACZMARZ)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCSAVIENNACL); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SAVIENNACL, __pyx_t_14) < (0)) __PYX_ERR(48, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":45
 *     ROWSCALINGVIENNACL = S_(PCROWSCALINGVIENNACL)
 *     SAVIENNACL         = S_(PCSAVIENNACL)
 *     BDDC               = S_(PCBDDC)             # <<<<<<<<<<<<<<
 *     KACZMARZ           = S_(PCKACZMARZ)
 *     TELESCOPE          = S_(PCTELESCOPE)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCBDDC); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BDDC, __pyx_t_14) < (0)) __PYX_ERR(48, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":46
 *     SAVIENNACL         = S_(PCSAVIENNACL)
 *     BDDC               = S_(PCBDDC)
 *     KACZMARZ           = S_(PCKACZMARZ)             # <<<<<<<<<<<<<<
 *     TELESCOPE          = S_(PCTELESCOPE)
 *     PATCH              = S_(PCPATCH)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCKACZMARZ); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_KACZMARZ, __pyx_t_14) < (0)) __PYX_ERR(48, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":47
 *     BDDC               = S_(PCBDDC)
 *     KACZMARZ           = S_(PCKACZMARZ)
 *     TELESCOPE          = S_(PCTELESCOPE)             # <<<<<<<<<<<<<<
 *     PATCH              = S_(PCPATCH)
 *     LMVM               = S_(PCLMVM)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCTELESCOPE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_TELESCOPE, __pyx_t_14) < (0)) __PYX_ERR(48, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":48
 *     KACZMARZ           = S_(PCKACZMARZ)
 *     TELESCOPE          = S_(PCTELESCOPE)
 *     PATCH              = S_(PCPATCH)             # <<<<<<<<<<<<<<
 *     LMVM               = S_(PCLMVM)
 *     HMG                = S_(PCHMG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCPATCH); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PATCH, __pyx_t_14) < (0)) __PYX_ERR(48, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":49
 *     TELESCOPE          = S_(PCTELESCOPE)
 *     PATCH              = S_(PCPATCH)
 *     LMVM               = S_(PCLMVM)             # <<<<<<<<<<<<<<
 *     HMG                = S_(PCHMG)
 *     DEFLATION          = S_(PCDEFLATION)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCLMVM); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LMVM, __pyx_t_14) < (0)) __PYX_ERR(48, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":50
 *     PATCH              = S_(PCPATCH)
 *     LMVM               = S_(PCLMVM)
 *     HMG                = S_(PCHMG)             # <<<<<<<<<<<<<<
 *     DEFLATION          = S_(PCDEFLATION)
 *     HPDDM              = S_(PCHPDDM)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCHMG); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_HMG, __pyx_t_14) < (0)) __PYX_ERR(48, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":51
 *     LMVM               = S_(PCLMVM)
 *     HMG                = S_(PCHMG)
 *     DEFLATION          = S_(PCDEFLATION)             # <<<<<<<<<<<<<<
 *     HPDDM              = S_(PCHPDDM)
 *     H2OPUS             = S_(PCH2OPUS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCDEFLATION); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFLATION, __pyx_t_14) < (0)) __PYX_ERR(48, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":52
 *     HMG                = S_(PCHMG)
 *     DEFLATION          = S_(PCDEFLATION)
 *     HPDDM              = S_(PCHPDDM)             # <<<<<<<<<<<<<<
 *     H2OPUS             = S_(PCH2OPUS)
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCHPDDM); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_HPDDM, __pyx_t_14) < (0)) __PYX_ERR(48, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":53
 *     DEFLATION          = S_(PCDEFLATION)
 *     HPDDM              = S_(PCHPDDM)
 *     H2OPUS             = S_(PCH2OPUS)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCH2OPUS); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_H2OPUS, __pyx_t_14) < (0)) __PYX_ERR(48, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class PCType(object):             # <<<<<<<<<<<<<<
 *     """The preconditioner method."""
 *     NONE               = S_(PCNONE)
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PCType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PCType, __pyx_t_14) < (0)) __PYX_ERR(48, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":56
 * 
 * 
 * class PCSide(object):             # <<<<<<<<<<<<<<
 *     """The manner in which the preconditioner is applied."""
 *     # native
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[93]); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCSide, __pyx_mstate_global->__pyx_n_u_PCSide, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_manner_in_which_the_precondi); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[93]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[93]) < 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_14 = __Pyx_PyLong_From_PCSide(PC_LEFT); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LEFT, __pyx_t_14) < (0)) __PYX_ERR(48, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":60
 *     # native
 *     LEFT      = PC_LEFT
 *     RIGHT     = PC_RIGHT             # <<<<<<<<<<<<<<
 *     SYMMETRIC = PC_SYMMETRIC
 *     # aliases
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCSide(PC_RIGHT); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RIGHT, __pyx_t_14) < (0)) __PYX_ERR(48, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":61
 *     LEFT      = PC_LEFT
 *     RIGHT     = PC_RIGHT
 *     SYMMETRIC = PC_SYMMETRIC             # <<<<<<<<<<<<<<
 *     # aliases
 *     L = LEFT
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCSide(PC_SYMMETRIC); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SYMMETRIC, __pyx_t_14) < (0)) __PYX_ERR(48, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":63
 *     SYMMETRIC = PC_SYMMETRIC
 *     # aliases
 *     L = LEFT             # <<<<<<<<<<<<<<
 *     R = RIGHT
 *     S = SYMMETRIC
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LEFT);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_LEFT);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_L, __pyx_t_14) < (0)) __PYX_ERR(48, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":64
 *     # aliases
 *     L = LEFT
 *     R = RIGHT             # <<<<<<<<<<<<<<
 *     S = SYMMETRIC
 * 
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RIGHT);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_RIGHT);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_R, __pyx_t_14) < (0)) __PYX_ERR(48, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":65
 *     L = LEFT
 *     R = RIGHT
 *     S = SYMMETRIC             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SYMMETRIC);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_SYMMETRIC);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_S, __pyx_t_14) < (0)) __PYX_ERR(48, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":56
 * 
 * 
 * class PCSide(object):             # <<<<<<<<<<<<<<
 *     """The manner in which the preconditioner is applied."""
 *     # native
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PCSide, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PCSide, __pyx_t_14) < (0)) __PYX_ERR(48, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":68
 * 
 * 
 * class PCASMType(object):             # <<<<<<<<<<<<<<
 *     """The *ASM* subtype."""
 *     NONE        = PC_ASM_NONE
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[95]); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCASMType, __pyx_mstate_global->__pyx_n_u_PCASMType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_ASM_subtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[95]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[95]) < 0))) __PYX_ERR(48, 68, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/PC.pyx":70
 * class PCASMType(object):
 *     """The *ASM* subtype."""
 *     NONE        = PC_ASM_NONE             # <<<<<<<<<<<<<<
 *     BASIC       = PC_ASM_BASIC
 *     RESTRICT    = PC_ASM_RESTRICT
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCASMType(PC_ASM_NONE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NONE, __pyx_t_14) < (0)) __PYX_ERR(48, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":71
 *     """The *ASM* subtype."""
 *     NONE        = PC_ASM_NONE
 *     BASIC       = PC_ASM_BASIC             # <<<<<<<<<<<<<<
 *     RESTRICT    = PC_ASM_RESTRICT
 *     INTERPOLATE = PC_ASM_INTERPOLATE
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCASMType(PC_ASM_BASIC); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BASIC, __pyx_t_14) < (0)) __PYX_ERR(48, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":72
 *     NONE        = PC_ASM_NONE
 *     BASIC       = PC_ASM_BASIC
 *     RESTRICT    = PC_ASM_RESTRICT             # <<<<<<<<<<<<<<
 *     INTERPOLATE = PC_ASM_INTERPOLATE
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCASMType(PC_ASM_RESTRICT); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RESTRICT, __pyx_t_14) < (0)) __PYX_ERR(48, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":73
 *     BASIC       = PC_ASM_BASIC
 *     RESTRICT    = PC_ASM_RESTRICT
 *     INTERPOLATE = PC_ASM_INTERPOLATE             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCASMType(PC_ASM_INTERPOLATE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INTERPOLATE, __pyx_t_14) < (0)) __PYX_ERR(48, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":68
 * 
 * 
 * class PCASMType(object):             # <<<<<<<<<<<<<<
 *     """The *ASM* subtype."""
 *     NONE        = PC_ASM_NONE
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PCASMType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PCASMType, __pyx_t_14) < (0)) __PYX_ERR(48, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":76
 * 
 * 
 * class PCGASMType(object):             # <<<<<<<<<<<<<<
 *     """The *GASM* subtype."""
 *     NONE        = PC_GASM_NONE
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[97]); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCGASMType, __pyx_mstate_global->__pyx_n_u_PCGASMType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_GASM_subtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[97]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[97]) < 0))) __PYX_ERR(48, 76, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/PC.pyx":78
 * class PCGASMType(object):
 *     """The *GASM* subtype."""
 *     NONE        = PC_GASM_NONE             # <<<<<<<<<<<<<<
 *     BASIC       = PC_GASM_BASIC
 *     RESTRICT    = PC_GASM_RESTRICT
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCGASMType(PC_GASM_NONE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NONE, __pyx_t_14) < (0)) __PYX_ERR(48, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":79
 *     """The *GASM* subtype."""
 *     NONE        = PC_GASM_NONE
 *     BASIC       = PC_GASM_BASIC             # <<<<<<<<<<<<<<
 *     RESTRICT    = PC_GASM_RESTRICT
 *     INTERPOLATE = PC_GASM_INTERPOLATE
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCGASMType(PC_GASM_BASIC); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BASIC, __pyx_t_14) < (0)) __PYX_ERR(48, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":80
 *     NONE        = PC_GASM_NONE
 *     BASIC       = PC_GASM_BASIC
 *     RESTRICT    = PC_GASM_RESTRICT             # <<<<<<<<<<<<<<
 *     INTERPOLATE = PC_GASM_INTERPOLATE
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCGASMType(PC_GASM_RESTRICT); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RESTRICT, __pyx_t_14) < (0)) __PYX_ERR(48, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":81
 *     BASIC       = PC_GASM_BASIC
 *     RESTRICT    = PC_GASM_RESTRICT
 *     INTERPOLATE = PC_GASM_INTERPOLATE             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCGASMType(PC_GASM_INTERPOLATE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INTERPOLATE, __pyx_t_14) < (0)) __PYX_ERR(48, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":76
 * 
 * 
 * class PCGASMType(object):             # <<<<<<<<<<<<<<
 *     """The *GASM* subtype."""
 *     NONE        = PC_GASM_NONE
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PCGASMType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PCGASMType, __pyx_t_14) < (0)) __PYX_ERR(48, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":84
 * 
 * 
 * class PCMGType(object):             # <<<<<<<<<<<<<<
 *     """The *MG* subtype."""
 *     MULTIPLICATIVE = PC_MG_MULTIPLICATIVE
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[99]); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCMGType, __pyx_mstate_global->__pyx_n_u_PCMGType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_MG_subtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[99]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[99]) < 0))) __PYX_ERR(48, 84, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/PC.pyx":86
 * class PCMGType(object):
 *     """The *MG* subtype."""
 *     MULTIPLICATIVE = PC_MG_MULTIPLICATIVE             # <<<<<<<<<<<<<<
 *     ADDITIVE       = PC_MG_ADDITIVE
 *     FULL           = PC_MG_FULL
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCMGType(PC_MG_MULTIPLICATIVE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MULTIPLICATIVE, __pyx_t_14) < (0)) __PYX_ERR(48, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":87
 *     """The *MG* subtype."""
 *     MULTIPLICATIVE = PC_MG_MULTIPLICATIVE
 *     ADDITIVE       = PC_MG_ADDITIVE             # <<<<<<<<<<<<<<
 *     FULL           = PC_MG_FULL
 *     KASKADE        = PC_MG_KASKADE
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCMGType(PC_MG_ADDITIVE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ADDITIVE, __pyx_t_14) < (0)) __PYX_ERR(48, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":88
 *     MULTIPLICATIVE = PC_MG_MULTIPLICATIVE
 *     ADDITIVE       = PC_MG_ADDITIVE
 *     FULL           = PC_MG_FULL             # <<<<<<<<<<<<<<
 *     KASKADE        = PC_MG_KASKADE
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCMGType(PC_MG_FULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FULL, __pyx_t_14) < (0)) __PYX_ERR(48, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":89
 *     ADDITIVE       = PC_MG_ADDITIVE
 *     FULL           = PC_MG_FULL
 *     KASKADE        = PC_MG_KASKADE             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCMGType(PC_MG_KASKADE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_KASKADE, __pyx_t_14) < (0)) __PYX_ERR(48, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":84
 * 
 * 
 * class PCMGType(object):             # <<<<<<<<<<<<<<
 *     """The *MG* subtype."""
 *     MULTIPLICATIVE = PC_MG_MULTIPLICATIVE
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PCMGType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PCMGType, __pyx_t_14) < (0)) __PYX_ERR(48, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":92
 * 
 * 
 * class PCMGCycleType(object):             # <<<<<<<<<<<<<<
 *     """The *MG* cycle type."""
 *     V = PC_MG_CYCLE_V
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[101]); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCMGCycleType, __pyx_mstate_global->__pyx_n_u_PCMGCycleType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_MG_cycle_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[101]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[101]) < 0))) __PYX_ERR(48, 92, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/PC.pyx":94
 * class PCMGCycleType(object):
 *     """The *MG* cycle type."""
 *     V = PC_MG_CYCLE_V             # <<<<<<<<<<<<<<
 *     W = PC_MG_CYCLE_W
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCMGCycleType(PC_MG_CYCLE_V); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_V, __pyx_t_14) < (0)) __PYX_ERR(48, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":95
 *     """The *MG* cycle type."""
 *     V = PC_MG_CYCLE_V
 *     W = PC_MG_CYCLE_W             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCMGCycleType(PC_MG_CYCLE_W); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_W, __pyx_t_14) < (0)) __PYX_ERR(48, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":92
 * 
 * 
 * class PCMGCycleType(object):             # <<<<<<<<<<<<<<
 *     """The *MG* cycle type."""
 *     V = PC_MG_CYCLE_V
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PCMGCycleType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PCMGCycleType, __pyx_t_14) < (0)) __PYX_ERR(48, 92, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":98
 * 
 * 
 * class PCGAMGType(object):             # <<<<<<<<<<<<<<
 *     """The *GAMG* subtype."""
 *     AGG       = S_(PCGAMGAGG)
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[103]); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCGAMGType, __pyx_mstate_global->__pyx_n_u_PCGAMGType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_GAMG_subtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[103]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[103]) < 0))) __PYX_ERR(48, 98, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/PC.pyx":100
 * class PCGAMGType(object):
 *     """The *GAMG* subtype."""
 *     AGG       = S_(PCGAMGAGG)             # <<<<<<<<<<<<<<
 *     GEO       = S_(PCGAMGGEO)
 *     CLASSICAL = S_(PCGAMGCLASSICAL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCGAMGAGG); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_AGG, __pyx_t_14) < (0)) __PYX_ERR(48, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":101
 *     """The *GAMG* subtype."""
 *     AGG       = S_(PCGAMGAGG)
 *     GEO       = S_(PCGAMGGEO)             # <<<<<<<<<<<<<<
 *     CLASSICAL = S_(PCGAMGCLASSICAL)
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCGAMGGEO); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_GEO, __pyx_t_14) < (0)) __PYX_ERR(48, 101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":102
 *     AGG       = S_(PCGAMGAGG)
 *     GEO       = S_(PCGAMGGEO)
 *     CLASSICAL = S_(PCGAMGCLASSICAL)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PCGAMGCLASSICAL); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CLASSICAL, __pyx_t_14) < (0)) __PYX_ERR(48, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":98
 * 
 * 
 * class PCGAMGType(object):             # <<<<<<<<<<<<<<
 *     """The *GAMG* subtype."""
 *     AGG       = S_(PCGAMGAGG)
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PCGAMGType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PCGAMGType, __pyx_t_14) < (0)) __PYX_ERR(48, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":105
 * 
 * 
 * class PCCompositeType(object):             # <<<<<<<<<<<<<<
 *     """The composite type."""
 *     ADDITIVE                 = PC_COMPOSITE_ADDITIVE
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[105]); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCCompositeType, __pyx_mstate_global->__pyx_n_u_PCCompositeType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_composite_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[105]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[105]) < 0))) __PYX_ERR(48, 105, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/PC.pyx":107
 * class PCCompositeType(object):
 *     """The composite type."""
 *     ADDITIVE                 = PC_COMPOSITE_ADDITIVE             # <<<<<<<<<<<<<<
 *     MULTIPLICATIVE           = PC_COMPOSITE_MULTIPLICATIVE
 *     SYMMETRIC_MULTIPLICATIVE = PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCCompositeType(PC_COMPOSITE_ADDITIVE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ADDITIVE, __pyx_t_14) < (0)) __PYX_ERR(48, 107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":108
 *     """The composite type."""
 *     ADDITIVE                 = PC_COMPOSITE_ADDITIVE
 *     MULTIPLICATIVE           = PC_COMPOSITE_MULTIPLICATIVE             # <<<<<<<<<<<<<<
 *     SYMMETRIC_MULTIPLICATIVE = PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE
 *     SPECIAL                  = PC_COMPOSITE_SPECIAL
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCCompositeType(PC_COMPOSITE_MULTIPLICATIVE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MULTIPLICATIVE, __pyx_t_14) < (0)) __PYX_ERR(48, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":109
 *     ADDITIVE                 = PC_COMPOSITE_ADDITIVE
 *     MULTIPLICATIVE           = PC_COMPOSITE_MULTIPLICATIVE
 *     SYMMETRIC_MULTIPLICATIVE = PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE             # <<<<<<<<<<<<<<
 *     SPECIAL                  = PC_COMPOSITE_SPECIAL
 *     SCHUR                    = PC_COMPOSITE_SCHUR
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCCompositeType(PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SYMMETRIC_MULTIPLICATIVE, __pyx_t_14) < (0)) __PYX_ERR(48, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":110
 *     MULTIPLICATIVE           = PC_COMPOSITE_MULTIPLICATIVE
 *     SYMMETRIC_MULTIPLICATIVE = PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE
 *     SPECIAL                  = PC_COMPOSITE_SPECIAL             # <<<<<<<<<<<<<<
 *     SCHUR                    = PC_COMPOSITE_SCHUR
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCCompositeType(PC_COMPOSITE_SPECIAL); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SPECIAL, __pyx_t_14) < (0)) __PYX_ERR(48, 110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":111
 *     SYMMETRIC_MULTIPLICATIVE = PC_COMPOSITE_SYMMETRIC_MULTIPLICATIVE
 *     SPECIAL                  = PC_COMPOSITE_SPECIAL
 *     SCHUR                    = PC_COMPOSITE_SCHUR             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCCompositeType(PC_COMPOSITE_SCHUR); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SCHUR, __pyx_t_14) < (0)) __PYX_ERR(48, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":105
 * 
 * 
 * class PCCompositeType(object):             # <<<<<<<<<<<<<<
 *     """The composite type."""
 *     ADDITIVE                 = PC_COMPOSITE_ADDITIVE
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PCCompositeType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PCCompositeType, __pyx_t_14) < (0)) __PYX_ERR(48, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":114
 * 
 * 
 * class PCFieldSplitSchurPreType(object):             # <<<<<<<<<<<<<<
 *     """The field split Schur subtype."""
 *     SELF                     = PC_FIELDSPLIT_SCHUR_PRE_SELF
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[107]); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCFieldSplitSchurPreType, __pyx_mstate_global->__pyx_n_u_PCFieldSplitSchurPreType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_field_split_Schur_subtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[107]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[107]) < 0))) __PYX_ERR(48, 114, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/PC.pyx":116
 * 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_14 = __Pyx_PyLong_From_PCFieldSplitSchurPreType(PC_FIELDSPLIT_SCHUR_PRE_SELF); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SELF, __pyx_t_14) < (0)) __PYX_ERR(48, 116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":117
 *     """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_14 = __Pyx_PyLong_From_PCFieldSplitSchurPreType(PC_FIELDSPLIT_SCHUR_PRE_SELFP); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SELFP, __pyx_t_14) < (0)) __PYX_ERR(48, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":118
 *     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_14 = __Pyx_PyLong_From_PCFieldSplitSchurPreType(PC_FIELDSPLIT_SCHUR_PRE_A11); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_A11, __pyx_t_14) < (0)) __PYX_ERR(48, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":119
 *     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_14 = __Pyx_PyLong_From_PCFieldSplitSchurPreType(PC_FIELDSPLIT_SCHUR_PRE_USER); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_USER, __pyx_t_14) < (0)) __PYX_ERR(48, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":120
 *     A11                      = PC_FIELDSPLIT_SCHUR_PRE_A11
 *     USER                     = PC_FIELDSPLIT_SCHUR_PRE_USER
 *     FULL                     = PC_FIELDSPLIT_SCHUR_PRE_FULL             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCFieldSplitSchurPreType(PC_FIELDSPLIT_SCHUR_PRE_FULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FULL, __pyx_t_14) < (0)) __PYX_ERR(48, 120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":114
 * 
 * 
 * class PCFieldSplitSchurPreType(object):             # <<<<<<<<<<<<<<
 *     """The field split Schur subtype."""
 *     SELF                     = PC_FIELDSPLIT_SCHUR_PRE_SELF
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PCFieldSplitSchurPreType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PCFieldSplitSchurPreType, __pyx_t_14) < (0)) __PYX_ERR(48, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":123
 * 
 * 
 * class PCFieldSplitSchurFactType(object):             # <<<<<<<<<<<<<<
 *     """The field split Schur factorization type."""
 *     DIAG                     = PC_FIELDSPLIT_SCHUR_FACT_DIAG
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[109]); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCFieldSplitSchurFactType, __pyx_mstate_global->__pyx_n_u_PCFieldSplitSchurFactType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_field_split_Schur_factorizat); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[109]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[109]) < 0))) __PYX_ERR(48, 123, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/PC.pyx":125
 * 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_14 = __Pyx_PyLong_From_PCFieldSplitSchurFactType(PC_FIELDSPLIT_SCHUR_FACT_DIAG); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIAG, __pyx_t_14) < (0)) __PYX_ERR(48, 125, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":126
 *     """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_14 = __Pyx_PyLong_From_PCFieldSplitSchurFactType(PC_FIELDSPLIT_SCHUR_FACT_LOWER); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LOWER, __pyx_t_14) < (0)) __PYX_ERR(48, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":127
 *     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_14 = __Pyx_PyLong_From_PCFieldSplitSchurFactType(PC_FIELDSPLIT_SCHUR_FACT_UPPER); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_UPPER, __pyx_t_14) < (0)) __PYX_ERR(48, 127, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":128
 *     LOWER                    = PC_FIELDSPLIT_SCHUR_FACT_LOWER
 *     UPPER                    = PC_FIELDSPLIT_SCHUR_FACT_UPPER
 *     FULL                     = PC_FIELDSPLIT_SCHUR_FACT_FULL             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCFieldSplitSchurFactType(PC_FIELDSPLIT_SCHUR_FACT_FULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FULL, __pyx_t_14) < (0)) __PYX_ERR(48, 128, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":123
 * 
 * 
 * class PCFieldSplitSchurFactType(object):             # <<<<<<<<<<<<<<
 *     """The field split Schur factorization type."""
 *     DIAG                     = PC_FIELDSPLIT_SCHUR_FACT_DIAG
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PCFieldSplitSchurFactType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PCFieldSplitSchurFactType, __pyx_t_14) < (0)) __PYX_ERR(48, 123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":131
 * 
 * 
 * class PCPatchConstructType(object):             # <<<<<<<<<<<<<<
 *     """The patch construction type."""
 *     STAR                     = PC_PATCH_STAR
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[111]); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCPatchConstructType, __pyx_mstate_global->__pyx_n_u_PCPatchConstructType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_patch_construction_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[111]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[111]) < 0))) __PYX_ERR(48, 131, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/PC.pyx":133
 * class PCPatchConstructType(object):
 *     """The patch construction type."""
 *     STAR                     = PC_PATCH_STAR             # <<<<<<<<<<<<<<
 *     VANKA                    = PC_PATCH_VANKA
 *     PARDECOMP                = PC_PATCH_PARDECOMP
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCPatchConstructType(PC_PATCH_STAR); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_STAR, __pyx_t_14) < (0)) __PYX_ERR(48, 133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":134
 *     """The patch construction type."""
 *     STAR                     = PC_PATCH_STAR
 *     VANKA                    = PC_PATCH_VANKA             # <<<<<<<<<<<<<<
 *     PARDECOMP                = PC_PATCH_PARDECOMP
 *     USER                     = PC_PATCH_USER
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCPatchConstructType(PC_PATCH_VANKA); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_VANKA, __pyx_t_14) < (0)) __PYX_ERR(48, 134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":135
 *     STAR                     = PC_PATCH_STAR
 *     VANKA                    = PC_PATCH_VANKA
 *     PARDECOMP                = PC_PATCH_PARDECOMP             # <<<<<<<<<<<<<<
 *     USER                     = PC_PATCH_USER
 *     PYTHON                   = PC_PATCH_PYTHON
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCPatchConstructType(PC_PATCH_PARDECOMP); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PARDECOMP, __pyx_t_14) < (0)) __PYX_ERR(48, 135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":136
 *     VANKA                    = PC_PATCH_VANKA
 *     PARDECOMP                = PC_PATCH_PARDECOMP
 *     USER                     = PC_PATCH_USER             # <<<<<<<<<<<<<<
 *     PYTHON                   = PC_PATCH_PYTHON
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCPatchConstructType(PC_PATCH_USER); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_USER, __pyx_t_14) < (0)) __PYX_ERR(48, 136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":137
 *     PARDECOMP                = PC_PATCH_PARDECOMP
 *     USER                     = PC_PATCH_USER
 *     PYTHON                   = PC_PATCH_PYTHON             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCPatchConstructType(PC_PATCH_PYTHON); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PYTHON, __pyx_t_14) < (0)) __PYX_ERR(48, 137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":131
 * 
 * 
 * class PCPatchConstructType(object):             # <<<<<<<<<<<<<<
 *     """The patch construction type."""
 *     STAR                     = PC_PATCH_STAR
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PCPatchConstructType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PCPatchConstructType, __pyx_t_14) < (0)) __PYX_ERR(48, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":140
 * 
 * 
 * class PCHPDDMCoarseCorrectionType(object):             # <<<<<<<<<<<<<<
 *     """The *HPDDM* coarse correction type."""
 *     DEFLATED                 = PC_HPDDM_COARSE_CORRECTION_DEFLATED
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[113]); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCHPDDMCoarseCorrectionType, __pyx_mstate_global->__pyx_n_u_PCHPDDMCoarseCorrectionType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_HPDDM_coarse_correction_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[113]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[113]) < 0))) __PYX_ERR(48, 140, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/PC.pyx":142
 * 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_14 = __Pyx_PyLong_From_PCHPDDMCoarseCorrectionType(PC_HPDDM_COARSE_CORRECTION_DEFLATED); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFLATED, __pyx_t_14) < (0)) __PYX_ERR(48, 142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":143
 *     """The *HPDDM* coarse correction type."""
 *     DEFLATED                 = PC_HPDDM_COARSE_CORRECTION_DEFLATED
 *     ADDITIVE                 = PC_HPDDM_COARSE_CORRECTION_ADDITIVE             # <<<<<<<<<<<<<<
 *     BALANCED                 = PC_HPDDM_COARSE_CORRECTION_BALANCED
 *     NONE                     = PC_HPDDM_COARSE_CORRECTION_NONE
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCHPDDMCoarseCorrectionType(PC_HPDDM_COARSE_CORRECTION_ADDITIVE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ADDITIVE, __pyx_t_14) < (0)) __PYX_ERR(48, 143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":144
 *     DEFLATED                 = PC_HPDDM_COARSE_CORRECTION_DEFLATED
 *     ADDITIVE                 = PC_HPDDM_COARSE_CORRECTION_ADDITIVE
 *     BALANCED                 = PC_HPDDM_COARSE_CORRECTION_BALANCED             # <<<<<<<<<<<<<<
 *     NONE                     = PC_HPDDM_COARSE_CORRECTION_NONE
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCHPDDMCoarseCorrectionType(PC_HPDDM_COARSE_CORRECTION_BALANCED); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BALANCED, __pyx_t_14) < (0)) __PYX_ERR(48, 144, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":145
 *     ADDITIVE                 = PC_HPDDM_COARSE_CORRECTION_ADDITIVE
 *     BALANCED                 = PC_HPDDM_COARSE_CORRECTION_BALANCED
 *     NONE                     = PC_HPDDM_COARSE_CORRECTION_NONE             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCHPDDMCoarseCorrectionType(PC_HPDDM_COARSE_CORRECTION_NONE); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NONE, __pyx_t_14) < (0)) __PYX_ERR(48, 145, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":140
 * 
 * 
 * class PCHPDDMCoarseCorrectionType(object):             # <<<<<<<<<<<<<<
 *     """The *HPDDM* coarse correction type."""
 *     DEFLATED                 = PC_HPDDM_COARSE_CORRECTION_DEFLATED
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PCHPDDMCoarseCorrectionType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PCHPDDMCoarseCorrectionType, __pyx_t_14) < (0)) __PYX_ERR(48, 140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":148
 * 
 * 
 * class PCDeflationSpaceType(object):             # <<<<<<<<<<<<<<
 *     """The deflation space subtype."""
 *     HAAR                     = PC_DEFLATION_SPACE_HAAR
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[115]); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCDeflationSpaceType, __pyx_mstate_global->__pyx_n_u_PCDeflationSpaceType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_deflation_space_subtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[115]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[115]) < 0))) __PYX_ERR(48, 148, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/PC.pyx":150
 * class PCDeflationSpaceType(object):
 *     """The deflation space subtype."""
 *     HAAR                     = PC_DEFLATION_SPACE_HAAR             # <<<<<<<<<<<<<<
 *     DB2                      = PC_DEFLATION_SPACE_DB2
 *     DB4                      = PC_DEFLATION_SPACE_DB4
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_HAAR); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_HAAR, __pyx_t_14) < (0)) __PYX_ERR(48, 150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":151
 *     """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_14 = __Pyx_PyLong_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_DB2); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DB2, __pyx_t_14) < (0)) __PYX_ERR(48, 151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":152
 *     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_14 = __Pyx_PyLong_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_DB4); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DB4, __pyx_t_14) < (0)) __PYX_ERR(48, 152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":153
 *     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_14 = __Pyx_PyLong_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_DB8); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DB8, __pyx_t_14) < (0)) __PYX_ERR(48, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":154
 *     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_14 = __Pyx_PyLong_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_DB16); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DB16, __pyx_t_14) < (0)) __PYX_ERR(48, 154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":155
 *     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_14 = __Pyx_PyLong_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_BIORTH22); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BIORTH22, __pyx_t_14) < (0)) __PYX_ERR(48, 155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":156
 *     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_14 = __Pyx_PyLong_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_MEYER); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MEYER, __pyx_t_14) < (0)) __PYX_ERR(48, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":157
 *     BIORTH22                 = PC_DEFLATION_SPACE_BIORTH22
 *     MEYER                    = PC_DEFLATION_SPACE_MEYER
 *     AGGREGATION              = PC_DEFLATION_SPACE_AGGREGATION             # <<<<<<<<<<<<<<
 *     USER                     = PC_DEFLATION_SPACE_USER
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_AGGREGATION); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_AGGREGATION, __pyx_t_14) < (0)) __PYX_ERR(48, 157, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":158
 *     MEYER                    = PC_DEFLATION_SPACE_MEYER
 *     AGGREGATION              = PC_DEFLATION_SPACE_AGGREGATION
 *     USER                     = PC_DEFLATION_SPACE_USER             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCDeflationSpaceType(PC_DEFLATION_SPACE_USER); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_USER, __pyx_t_14) < (0)) __PYX_ERR(48, 158, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":148
 * 
 * 
 * class PCDeflationSpaceType(object):             # <<<<<<<<<<<<<<
 *     """The deflation space subtype."""
 *     HAAR                     = PC_DEFLATION_SPACE_HAAR
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PCDeflationSpaceType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PCDeflationSpaceType, __pyx_t_14) < (0)) __PYX_ERR(48, 148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":161
 * 
 * 
 * class PCFailedReason(object):             # <<<<<<<<<<<<<<
 *     """The reason the preconditioner has failed."""
 *     SETUP_ERROR              = PC_SETUP_ERROR
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[117]); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCFailedReason, __pyx_mstate_global->__pyx_n_u_PCFailedReason, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_reason_the_preconditioner_ha); if (unlikely(!__pyx_t_10)) __PYX_ERR(48, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[117]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[117]) < 0))) __PYX_ERR(48, 161, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/PC.pyx":163
 * 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_14 = __Pyx_PyLong_From_PCFailedReason(PC_SETUP_ERROR); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SETUP_ERROR, __pyx_t_14) < (0)) __PYX_ERR(48, 163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":164
 *     """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_14 = __Pyx_PyLong_From_PCFailedReason(PC_NOERROR); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NOERROR, __pyx_t_14) < (0)) __PYX_ERR(48, 164, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":165
 *     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_14 = __Pyx_PyLong_From_PCFailedReason(PC_FACTOR_STRUCT_ZEROPIVOT); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FACTOR_STRUCT_ZEROPIVOT, __pyx_t_14) < (0)) __PYX_ERR(48, 165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":166
 *     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_14 = __Pyx_PyLong_From_PCFailedReason(PC_FACTOR_NUMERIC_ZEROPIVOT); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FACTOR_NUMERIC_ZEROPIVOT, __pyx_t_14) < (0)) __PYX_ERR(48, 166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":167
 *     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_14 = __Pyx_PyLong_From_PCFailedReason(PC_FACTOR_OUTMEMORY); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FACTOR_OUTMEMORY, __pyx_t_14) < (0)) __PYX_ERR(48, 167, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":168
 *     FACTOR_NUMERIC_ZEROPIVOT = PC_FACTOR_NUMERIC_ZEROPIVOT
 *     FACTOR_OUTMEMORY         = PC_FACTOR_OUTMEMORY
 *     FACTOR_OTHER             = PC_FACTOR_OTHER             # <<<<<<<<<<<<<<
 *     SUBPC_ERROR              = PC_SUBPC_ERROR
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCFailedReason(PC_FACTOR_OTHER); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FACTOR_OTHER, __pyx_t_14) < (0)) __PYX_ERR(48, 168, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":169
 *     FACTOR_OUTMEMORY         = PC_FACTOR_OUTMEMORY
 *     FACTOR_OTHER             = PC_FACTOR_OTHER
 *     SUBPC_ERROR              = PC_SUBPC_ERROR             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_14 = __Pyx_PyLong_From_PCFailedReason(PC_SUBPC_ERROR); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SUBPC_ERROR, __pyx_t_14) < (0)) __PYX_ERR(48, 169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/PC.pyx":161
 * 
 * 
 * class PCFailedReason(object):             # <<<<<<<<<<<<<<
 *     """The reason the preconditioner has failed."""
 *     SETUP_ERROR              = PC_SETUP_ERROR
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PCFailedReason, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(48, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PCFailedReason, __pyx_t_14) < (0)) __PYX_ERR(48, 161, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":197
 *     """
 * 
 *     Type = PCType             # <<<<<<<<<<<<<<
 *     Side = PCSide
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCType); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_5) < (0)) __PYX_ERR(48, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":198
 * 
 *     Type = PCType
 *     Side = PCSide             # <<<<<<<<<<<<<<
 * 
 *     ASMType                   = PCASMType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCSide); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_Side, __pyx_t_5) < (0)) __PYX_ERR(48, 198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":200
 *     Side = PCSide
 * 
 *     ASMType                   = PCASMType             # <<<<<<<<<<<<<<
 *     GASMType                  = PCGASMType
 *     MGType                    = PCMGType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCASMType); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_ASMType, __pyx_t_5) < (0)) __PYX_ERR(48, 200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":201
 * 
 *     ASMType                   = PCASMType
 *     GASMType                  = PCGASMType             # <<<<<<<<<<<<<<
 *     MGType                    = PCMGType
 *     MGCycleType               = PCMGCycleType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCGASMType); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_GASMType, __pyx_t_5) < (0)) __PYX_ERR(48, 201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":202
 *     ASMType                   = PCASMType
 *     GASMType                  = PCGASMType
 *     MGType                    = PCMGType             # <<<<<<<<<<<<<<
 *     MGCycleType               = PCMGCycleType
 *     GAMGType                  = PCGAMGType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCMGType); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_MGType, __pyx_t_5) < (0)) __PYX_ERR(48, 202, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":203
 *     GASMType                  = PCGASMType
 *     MGType                    = PCMGType
 *     MGCycleType               = PCMGCycleType             # <<<<<<<<<<<<<<
 *     GAMGType                  = PCGAMGType
 *     CompositeType             = PCCompositeType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCMGCycleType); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_MGCycleType, __pyx_t_5) < (0)) __PYX_ERR(48, 203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":204
 *     MGType                    = PCMGType
 *     MGCycleType               = PCMGCycleType
 *     GAMGType                  = PCGAMGType             # <<<<<<<<<<<<<<
 *     CompositeType             = PCCompositeType
 *     FieldSplitSchurFactType   = PCFieldSplitSchurFactType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCGAMGType); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_GAMGType, __pyx_t_5) < (0)) __PYX_ERR(48, 204, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":205
 *     MGCycleType               = PCMGCycleType
 *     GAMGType                  = PCGAMGType
 *     CompositeType             = PCCompositeType             # <<<<<<<<<<<<<<
 *     FieldSplitSchurFactType   = PCFieldSplitSchurFactType
 *     FieldSplitSchurPreType    = PCFieldSplitSchurPreType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCCompositeType); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_CompositeType, __pyx_t_5) < (0)) __PYX_ERR(48, 205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":206
 *     GAMGType                  = PCGAMGType
 *     CompositeType             = PCCompositeType
 *     FieldSplitSchurFactType   = PCFieldSplitSchurFactType             # <<<<<<<<<<<<<<
 *     FieldSplitSchurPreType    = PCFieldSplitSchurPreType
 *     PatchConstructType        = PCPatchConstructType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCFieldSplitSchurFactType); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_FieldSplitSchurFactType, __pyx_t_5) < (0)) __PYX_ERR(48, 206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":207
 *     CompositeType             = PCCompositeType
 *     FieldSplitSchurFactType   = PCFieldSplitSchurFactType
 *     FieldSplitSchurPreType    = PCFieldSplitSchurPreType             # <<<<<<<<<<<<<<
 *     PatchConstructType        = PCPatchConstructType
 *     HPDDMCoarseCorrectionType = PCHPDDMCoarseCorrectionType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCFieldSplitSchurPreType); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_FieldSplitSchurPreType, __pyx_t_5) < (0)) __PYX_ERR(48, 207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":208
 *     FieldSplitSchurFactType   = PCFieldSplitSchurFactType
 *     FieldSplitSchurPreType    = PCFieldSplitSchurPreType
 *     PatchConstructType        = PCPatchConstructType             # <<<<<<<<<<<<<<
 *     HPDDMCoarseCorrectionType = PCHPDDMCoarseCorrectionType
 *     DeflationSpaceType        = PCDeflationSpaceType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCPatchConstructType); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_PatchConstructType, __pyx_t_5) < (0)) __PYX_ERR(48, 208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":209
 *     FieldSplitSchurPreType    = PCFieldSplitSchurPreType
 *     PatchConstructType        = PCPatchConstructType
 *     HPDDMCoarseCorrectionType = PCHPDDMCoarseCorrectionType             # <<<<<<<<<<<<<<
 *     DeflationSpaceType        = PCDeflationSpaceType
 *     FailedReason              = PCFailedReason
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCHPDDMCoarseCorrectionType); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_HPDDMCoarseCorrectionType, __pyx_t_5) < (0)) __PYX_ERR(48, 209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":210
 *     PatchConstructType        = PCPatchConstructType
 *     HPDDMCoarseCorrectionType = PCHPDDMCoarseCorrectionType
 *     DeflationSpaceType        = PCDeflationSpaceType             # <<<<<<<<<<<<<<
 *     FailedReason              = PCFailedReason
 *     # Backward compatibility
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCDeflationSpaceType); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_DeflationSpaceType, __pyx_t_5) < (0)) __PYX_ERR(48, 210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":211
 *     HPDDMCoarseCorrectionType = PCHPDDMCoarseCorrectionType
 *     DeflationSpaceType        = PCDeflationSpaceType
 *     FailedReason              = PCFailedReason             # <<<<<<<<<<<<<<
 *     # Backward compatibility
 *     SchurFactType             = PCFieldSplitSchurFactType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCFailedReason); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_FailedReason, __pyx_t_5) < (0)) __PYX_ERR(48, 211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":213
 *     FailedReason              = PCFailedReason
 *     # Backward compatibility
 *     SchurFactType             = PCFieldSplitSchurFactType             # <<<<<<<<<<<<<<
 *     SchurPreType              = PCFieldSplitSchurPreType
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCFieldSplitSchurFactType); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_SchurFactType, __pyx_t_5) < (0)) __PYX_ERR(48, 213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":214
 *     # Backward compatibility
 *     SchurFactType             = PCFieldSplitSchurFactType
 *     SchurPreType              = PCFieldSplitSchurPreType             # <<<<<<<<<<<<<<
 * 
 *     # --- xxx ---
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PCFieldSplitSchurPreType); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_SchurPreType, __pyx_t_5) < (0)) __PYX_ERR(48, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":230
 *     # --- xxx ---
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the `PC` object.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 230, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_5view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[817])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_4) < (0)) __PYX_ERR(48, 230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":249
 *         CHKERR(PCView(self.pc, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the `PC` that was created with `create`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(48, 249, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_7destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[818])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_5) < (0)) __PYX_ERR(48, 249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":263
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an empty `PC`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(48, 263, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(48, 263, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_9create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[819])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_4) < (0)) __PYX_ERR(48, 263, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":288
 *         return self
 * 
 *     def setType(self, pc_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the preconditioner type.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pc_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(48, 288, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 288, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_11setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[820])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_5) < (0)) __PYX_ERR(48, 288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":307
 *         CHKERR(PCSetType(self.pc, cval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the preconditioner type.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(48, 307, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_13getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[821])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_4) < (0)) __PYX_ERR(48, 307, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":321
 *         return bytes2str(cval)
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the prefix used for all the `PC` options.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(48, 321, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 321, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_15setOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[822])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setOptionsPrefix, __pyx_t_5) < (0)) __PYX_ERR(48, 321, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":340
 *         CHKERR(PCSetOptionsPrefix(self.pc, cval))
 * 
 *     def getOptionsPrefix(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the prefix used for all the `PC` options.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(48, 340, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_17getOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[823])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getOptionsPrefix, __pyx_t_4) < (0)) __PYX_ERR(48, 340, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":354
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Append to the prefix used for all the `PC` options.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(48, 354, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 354, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_19appendOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_appendOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[824])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_appendOptionsPrefix, __pyx_t_5) < (0)) __PYX_ERR(48, 354, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":373
 *         CHKERR(PCAppendOptionsPrefix(self.pc, cval))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set various `PC` parameters from user options.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 373, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_21setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[825])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_4) < (0)) __PYX_ERR(48, 373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":385
 *         CHKERR(PCSetFromOptions(self.pc))
 * 
 *     def setOperators(self, Mat A=None, Mat P=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the matrices associated with the linear system.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 385, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_23setOperators, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setOperators, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[826])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setOperators, __pyx_t_5) < (0)) __PYX_ERR(48, 385, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":420
 *         CHKERR(PCSetOperators(self.pc, amat, pmat))
 * 
 *     def getOperators(self) -> tuple[Mat, Mat]:             # <<<<<<<<<<<<<<
 *         """Return the matrices associated with a linear system.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Mat_Mat) < (0)) __PYX_ERR(48, 420, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_25getOperators, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getOperators, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[827])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getOperators, __pyx_t_4) < (0)) __PYX_ERR(48, 420, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":436
 *         return (A, P)
 * 
 *     def setUseAmat(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set to indicate to apply `PC` to ``A`` and not ``P``.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(48, 436, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 436, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_27setUseAmat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setUseAmat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[828])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setUseAmat, __pyx_t_5) < (0)) __PYX_ERR(48, 436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":462
 *         CHKERR(PCSetUseAmat(self.pc, cflag))
 * 
 *     def getUseAmat(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag to indicate if `PC` is applied to ``A`` or ``P``.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(48, 462, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_29getUseAmat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getUseAmat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[829])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getUseAmat, __pyx_t_4) < (0)) __PYX_ERR(48, 462, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":481
 *         return toBool(cflag)
 * 
 *     def setReusePreconditioner(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set to indicate the preconditioner is to be reused.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(48, 481, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 481, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_31setReusePreconditioner, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setReusePreconditioner, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[830])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setReusePreconditioner, __pyx_t_5) < (0)) __PYX_ERR(48, 481, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":506
 *         CHKERR(PCSetReusePreconditioner(self.pc, cflag))
 * 
 *     def setFailedReason(self, reason: FailedReason | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the reason the `PC` terminated.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_reason, __pyx_mstate_global->__pyx_kp_u_FailedReason_str) < (0)) __PYX_ERR(48, 506, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 506, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_33setFailedReason, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setFailedReason, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[831])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setFailedReason, __pyx_t_4) < (0)) __PYX_ERR(48, 506, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":524
 *         CHKERR(PCSetFailedReason(self.pc, val))
 * 
 *     def getFailedReason(self) -> FailedReason:             # <<<<<<<<<<<<<<
 *         """Return the reason the `PC` terminated.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_FailedReason) < (0)) __PYX_ERR(48, 524, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_35getFailedReason, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getFailedReason, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[832])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getFailedReason, __pyx_t_5) < (0)) __PYX_ERR(48, 524, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":545
 *         return reason
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for the `PC`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 545, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_37setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[833])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_4) < (0)) __PYX_ERR(48, 545, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":557
 *         CHKERR(PCSetUp(self.pc))
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         """Reset the `PC`, removing any allocated vectors and matrices.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 557, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_39reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_reset, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[834])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_5) < (0)) __PYX_ERR(48, 557, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":569
 *         CHKERR(PCReset(self.pc))
 * 
 *     def setUpOnBlocks(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the `PC` for each block.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 569, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_41setUpOnBlocks, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setUpOnBlocks, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[835])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setUpOnBlocks, __pyx_t_4) < (0)) __PYX_ERR(48, 569, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":585
 *         CHKERR(PCSetUpOnBlocks(self.pc))
 * 
 *     def apply(self, Vec x, Vec y) -> None:             # <<<<<<<<<<<<<<
 *         """Apply the `PC` to a vector.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 585, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_43apply, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_apply, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[836])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_apply, __pyx_t_5) < (0)) __PYX_ERR(48, 585, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":604
 *         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`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 604, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_45matApply, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_matApply, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[837])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_matApply, __pyx_t_4) < (0)) __PYX_ERR(48, 604, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":623
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 623, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_47applyTranspose, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_applyTranspose, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[838])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_applyTranspose, __pyx_t_5) < (0)) __PYX_ERR(48, 623, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":645
 *         CHKERR(PCApplyTranspose(self.pc, x.vec, y.vec))
 * 
 *     def matApplyTranspose(self, Mat x, Mat y) -> None:             # <<<<<<<<<<<<<<
 *         """Apply the transpose of the `PC` to many vectors stored as `Mat.Type.DENSE`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 645, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_49matApplyTranspose, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_matApplyTranspose, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[839])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_matApplyTranspose, __pyx_t_4) < (0)) __PYX_ERR(48, 645, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":664
 *         CHKERR(PCMatApplyTranspose(self.pc, x.mat, y.mat))
 * 
 *     def applySymmetricLeft(self, Vec x, Vec y) -> None:             # <<<<<<<<<<<<<<
 *         """Apply the left part of a symmetric `PC` to a vector.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 664, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_51applySymmetricLeft, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_applySymmetricLeft, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[840])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_applySymmetricLeft, __pyx_t_5) < (0)) __PYX_ERR(48, 664, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":683
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 683, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_53applySymmetricRight, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_applySymmetricRight, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[841])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_applySymmetricRight, __pyx_t_4) < (0)) __PYX_ERR(48, 683, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":704
 *     # --- discretization space ---
 * 
 *     def getDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the `DM` associated with the `PC`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(48, 704, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_55getDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[842])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getDM, __pyx_t_5) < (0)) __PYX_ERR(48, 704, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":721
 *         return dm
 * 
 *     def setDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `DM` that may be used by some preconditioners.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 721, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_57setDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[843])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setDM, __pyx_t_4) < (0)) __PYX_ERR(48, 721, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":738
 *         CHKERR(PCSetDM(self.pc, dm.dm))
 * 
 *     def setCoordinates(self, coordinates: Sequence[Sequence[float]]) -> None:             # <<<<<<<<<<<<<<
 *         """Set the coordinates for the nodes on the local process.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_coordinates, __pyx_mstate_global->__pyx_kp_u_Sequence_Sequence_float) < (0)) __PYX_ERR(48, 738, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 738, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_59setCoordinates, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setCoordinates, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[844])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setCoordinates, __pyx_t_5) < (0)) __PYX_ERR(48, 738, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":765
 *     # --- Python ---
 * 
 *     def createPython(self, context: Any = None, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a preconditioner of Python type.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_context, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(48, 765, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(48, 765, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(48, 765, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_61createPython, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_createPython, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[845])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_createPython, __pyx_t_4) < (0)) __PYX_ERR(48, 765, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":790
 *         return self
 * 
 *     def setPythonContext(self, context: Any) -> None:             # <<<<<<<<<<<<<<
 *         """Set the instance of the class implementing the required Python methods.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_context, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(48, 790, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 790, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_63setPythonContext, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setPythonContext, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[846])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setPythonContext, __pyx_t_5) < (0)) __PYX_ERR(48, 790, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":802
 *         CHKERR(PCPythonSetContext(self.pc, <void*>context))
 * 
 *     def getPythonContext(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return the instance of the class implementing the required Python methods.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(48, 802, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_65getPythonContext, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getPythonContext, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[847])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getPythonContext, __pyx_t_4) < (0)) __PYX_ERR(48, 802, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":817
 *         else: return <object> context
 * 
 *     def setPythonType(self, py_type: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the fully qualified Python name of the class to be used.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_py_type, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(48, 817, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 817, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_67setPythonType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setPythonType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[848])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setPythonType, __pyx_t_5) < (0)) __PYX_ERR(48, 817, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":831
 *         CHKERR(PCPythonSetType(self.pc, cval))
 * 
 *     def getPythonType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the fully qualified Python name of the class used by the preconditioner.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(48, 831, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_69getPythonType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getPythonType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[849])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getPythonType, __pyx_t_4) < (0)) __PYX_ERR(48, 831, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":847
 *     # --- Block Jacobi ---
 * 
 *     def getBJacobiSubKSP(self) -> list[KSP]:             # <<<<<<<<<<<<<<
 *         """Return the local `KSP` object for all blocks on this process.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_KSP) < (0)) __PYX_ERR(48, 847, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_71getBJacobiSubKSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getBJacobiSubKSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[850])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getBJacobiSubKSP, __pyx_t_5) < (0)) __PYX_ERR(48, 847, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":864
 *     # --- ASM ---
 * 
 *     def setASMType(self, asmtype: ASMType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of restriction and interpolation.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_asmtype, __pyx_mstate_global->__pyx_n_u_ASMType) < (0)) __PYX_ERR(48, 864, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 864, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_73setASMType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setASMType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[851])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setASMType, __pyx_t_4) < (0)) __PYX_ERR(48, 864, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":882
 *         CHKERR(PCASMSetType(self.pc, cval))
 * 
 *     def setASMOverlap(self, overlap: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the overlap between a pair of subdomains.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_overlap, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 882, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 882, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_75setASMOverlap, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setASMOverlap, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[852])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setASMOverlap, __pyx_t_5) < (0)) __PYX_ERR(48, 882, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":900
 *         CHKERR(PCASMSetOverlap(self.pc, ival))
 * 
 *     def setASMLocalSubdomains(             # <<<<<<<<<<<<<<
 *         self,
 *         nsd: int,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_nsd, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 900, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_is_sub, __pyx_mstate_global->__pyx_kp_u_Sequence_IS_None) < (0)) __PYX_ERR(48, 900, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_is_local, __pyx_mstate_global->__pyx_kp_u_Sequence_IS_None) < (0)) __PYX_ERR(48, 900, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 900, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_77setASMLocalSubdomains, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setASMLocalSubdomains, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[853])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setASMLocalSubdomains, __pyx_t_4) < (0)) __PYX_ERR(48, 900, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":943
 *         CHKERR(PetscFree(isets_local))
 * 
 *     def setASMTotalSubdomains(             # <<<<<<<<<<<<<<
 *         self,
 *         nsd: int,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_nsd, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 943, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_is_sub, __pyx_mstate_global->__pyx_kp_u_Sequence_IS_None) < (0)) __PYX_ERR(48, 943, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_is_local, __pyx_mstate_global->__pyx_kp_u_Sequence_IS_None) < (0)) __PYX_ERR(48, 943, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 943, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_79setASMTotalSubdomains, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setASMTotalSubdomains, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[854])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setASMTotalSubdomains, __pyx_t_5) < (0)) __PYX_ERR(48, 943, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":986
 *         CHKERR(PetscFree(isets_local))
 * 
 *     def getASMSubKSP(self) -> list[KSP]:             # <<<<<<<<<<<<<<
 *         """Return the local `KSP` object for all blocks on this process.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_KSP) < (0)) __PYX_ERR(48, 986, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_81getASMSubKSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getASMSubKSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[855])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 986, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getASMSubKSP, __pyx_t_4) < (0)) __PYX_ERR(48, 986, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1001
 *         return [ref_KSP(p[i]) for i from 0 <= i <n]
 * 
 *     def setASMSortIndices(self, dosort: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set to sort subdomain indices.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dosort, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(48, 1001, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1001, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_83setASMSortIndices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setASMSortIndices, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[856])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setASMSortIndices, __pyx_t_5) < (0)) __PYX_ERR(48, 1001, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1021
 *     # --- GASM ---
 * 
 *     def setGASMType(self, gasmtype: GASMType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of restriction and interpolation.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_gasmtype, __pyx_mstate_global->__pyx_n_u_GASMType) < (0)) __PYX_ERR(48, 1021, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1021, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_85setGASMType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setGASMType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[857])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setGASMType, __pyx_t_4) < (0)) __PYX_ERR(48, 1021, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1039
 *         CHKERR(PCGASMSetType(self.pc, cval))
 * 
 *     def setGASMOverlap(self, overlap: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the overlap between a pair of subdomains.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_overlap, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1039, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1039, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_87setGASMOverlap, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setGASMOverlap, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[858])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setGASMOverlap, __pyx_t_5) < (0)) __PYX_ERR(48, 1039, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1059
 *     # --- GAMG ---
 * 
 *     def setGAMGType(self, gamgtype: GAMGType | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of algorithm.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_gamgtype, __pyx_mstate_global->__pyx_kp_u_GAMGType_str) < (0)) __PYX_ERR(48, 1059, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1059, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_89setGAMGType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setGAMGType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[859])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setGAMGType, __pyx_t_4) < (0)) __PYX_ERR(48, 1059, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1078
 *         CHKERR(PCGAMGSetType(self.pc, cval))
 * 
 *     def setGAMGLevels(self, levels: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum number of levels.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_levels, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1078, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1078, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_91setGAMGLevels, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setGAMGLevels, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[860])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setGAMGLevels, __pyx_t_5) < (0)) __PYX_ERR(48, 1078, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1096
 *         CHKERR(PCGAMGSetNlevels(self.pc, ival))
 * 
 *     def setGAMGSmooths(self, smooths: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of smoothing steps used on all levels.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_smooths, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1096, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1096, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_93setGAMGSmooths, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setGAMGSmooths, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[861])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setGAMGSmooths, __pyx_t_4) < (0)) __PYX_ERR(48, 1096, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1116
 *     # --- Hypre ---
 * 
 *     def getHYPREType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the `Type.HYPRE` type.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(48, 1116, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_95getHYPREType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getHYPREType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[862])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getHYPREType, __pyx_t_5) < (0)) __PYX_ERR(48, 1116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1130
 *         return bytes2str(cval)
 * 
 *     def setHYPREType(self, hypretype: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `Type.HYPRE` type.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_hypretype, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(48, 1130, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1130, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_97setHYPREType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setHYPREType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[863])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setHYPREType, __pyx_t_4) < (0)) __PYX_ERR(48, 1130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1150
 *         CHKERR(PCHYPRESetType(self.pc, cval))
 * 
 *     def setHYPREDiscreteCurl(self, Mat mat) -> None:             # <<<<<<<<<<<<<<
 *         """Set the discrete curl matrix.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1150, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_99setHYPREDiscreteCurl, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setHYPREDiscreteCurl, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[864])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setHYPREDiscreteCurl, __pyx_t_5) < (0)) __PYX_ERR(48, 1150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1167
 *         CHKERR(PCHYPRESetDiscreteCurl(self.pc, mat.mat))
 * 
 *     def setHYPREDiscreteGradient(self, Mat mat) -> None:             # <<<<<<<<<<<<<<
 *         """Set the discrete gradient matrix.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1167, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_101setHYPREDiscreteGradient, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setHYPREDiscreteGradient, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[865])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setHYPREDiscreteGradient, __pyx_t_4) < (0)) __PYX_ERR(48, 1167, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1184
 *         CHKERR(PCHYPRESetDiscreteGradient(self.pc, mat.mat))
 * 
 *     def setHYPRESetAlphaPoissonMatrix(self, Mat mat) -> None:             # <<<<<<<<<<<<<<
 *         """Set the vector Poisson matrix.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1184, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_103setHYPRESetAlphaPoissonMatrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setHYPRESetAlphaPoissonMatrix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[866])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setHYPRESetAlphaPoissonMatrix, __pyx_t_5) < (0)) __PYX_ERR(48, 1184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1201
 *         CHKERR(PCHYPRESetAlphaPoissonMatrix(self.pc, mat.mat))
 * 
 *     def setHYPRESetBetaPoissonMatrix(self, Mat mat=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the Posson matrix.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1201, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_105setHYPRESetBetaPoissonMatrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setHYPRESetBetaPoissonMatrix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[867])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setHYPRESetBetaPoissonMatrix, __pyx_t_4) < (0)) __PYX_ERR(48, 1201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1220
 *         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.
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dim, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1220, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1220, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_107setHYPRESetInterpolations, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setHYPRESetInterpolations, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[868])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setHYPRESetInterpolations, __pyx_t_5) < (0)) __PYX_ERR(48, 1220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1268
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1268, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_109setHYPRESetEdgeConstantVectors, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setHYPRESetEdgeConstantVector, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[869])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setHYPRESetEdgeConstantVectors, __pyx_t_4) < (0)) __PYX_ERR(48, 1268, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1292
 *                                              zzo_vec))
 * 
 *     def setHYPREAMSSetInteriorNodes(self, Vec interior) -> None:             # <<<<<<<<<<<<<<
 *         """Set the list of interior nodes to a zero conductivity region.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1292, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_111setHYPREAMSSetInteriorNodes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setHYPREAMSSetInteriorNodes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[870])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setHYPREAMSSetInteriorNodes, __pyx_t_5) < (0)) __PYX_ERR(48, 1292, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1311
 *     # --- Factor ---
 * 
 *     def setFactorSolverType(self, solver: Mat.SolverType | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the solver package used to perform the factorization.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_solver, __pyx_mstate_global->__pyx_kp_u_Mat_SolverType_str) < (0)) __PYX_ERR(48, 1311, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1311, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_113setFactorSolverType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setFactorSolverType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[871])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setFactorSolverType, __pyx_t_4) < (0)) __PYX_ERR(48, 1311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1330
 *         CHKERR(PCFactorSetMatSolverType(self.pc, cval))
 * 
 *     def getFactorSolverType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the solver package used to perform the factorization.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(48, 1330, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_115getFactorSolverType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getFactorSolverType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[872])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getFactorSolverType, __pyx_t_5) < (0)) __PYX_ERR(48, 1330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1344
 *         return bytes2str(cval)
 * 
 *     def setFactorSetUpSolverType(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the factorization solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1344, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_117setFactorSetUpSolverType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setFactorSetUpSolverType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[873])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setFactorSetUpSolverType, __pyx_t_4) < (0)) __PYX_ERR(48, 1344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1360
 *         CHKERR(PCFactorSetUpMatSolverType(self.pc))
 * 
 *     def setFactorOrdering(             # <<<<<<<<<<<<<<
 *         self,
 *         ord_type: str | None = None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ord_type, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(48, 1360, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_nzdiag, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(48, 1360, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_reuse, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(48, 1360, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1360, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_119setFactorOrdering, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setFactorOrdering, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[874])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setFactorOrdering, __pyx_t_5) < (0)) __PYX_ERR(48, 1360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1397
 *             CHKERR(PCFactorSetReuseOrdering(self.pc, bval))
 * 
 *     def setFactorPivot(             # <<<<<<<<<<<<<<
 *         self,
 *         zeropivot: float | None = None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_zeropivot, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(48, 1397, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_inblocks, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(48, 1397, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1397, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_121setFactorPivot, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setFactorPivot, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[875])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setFactorPivot, __pyx_t_4) < (0)) __PYX_ERR(48, 1397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1426
 *             CHKERR(PCFactorSetPivotInBlocks(self.pc, bval))
 * 
 *     def setFactorShift(             # <<<<<<<<<<<<<<
 *         self,
 *         shift_type: Mat.FactorShiftType | None = None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_shift_type, __pyx_mstate_global->__pyx_kp_u_Mat_FactorShiftType_None) < (0)) __PYX_ERR(48, 1426, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_amount, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(48, 1426, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1426, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_123setFactorShift, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setFactorShift, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[876])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setFactorShift, __pyx_t_5) < (0)) __PYX_ERR(48, 1426, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1456
 *             CHKERR(PCFactorSetShiftAmount(self.pc, rval))
 * 
 *     def setFactorLevels(self, levels: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of levels of fill.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_levels, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1456, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1456, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_125setFactorLevels, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setFactorLevels, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[877])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setFactorLevels, __pyx_t_4) < (0)) __PYX_ERR(48, 1456, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1474
 *         CHKERR(PCFactorSetLevels(self.pc, ival))
 * 
 *     def getFactorMatrix(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the factored matrix.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(48, 1474, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_127getFactorMatrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getFactorMatrix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[878])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getFactorMatrix, __pyx_t_5) < (0)) __PYX_ERR(48, 1474, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1491
 *     # --- FieldSplit ---
 * 
 *     def setFieldSplitType(self, ctype: CompositeType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of composition of a field split preconditioner.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ctype, __pyx_mstate_global->__pyx_n_u_CompositeType) < (0)) __PYX_ERR(48, 1491, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1491, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_129setFieldSplitType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setFieldSplitType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[879])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setFieldSplitType, __pyx_t_4) < (0)) __PYX_ERR(48, 1491, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1509
 *         CHKERR(PCFieldSplitSetType(self.pc, cval))
 * 
 *     def setFieldSplitIS(self, *fields: tuple[str, IS]) -> None:             # <<<<<<<<<<<<<<
 *         """Set the elements for the field split by `IS`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fields, __pyx_mstate_global->__pyx_kp_u_tuple_str_IS) < (0)) __PYX_ERR(48, 1509, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1509, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_131setFieldSplitIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setFieldSplitIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[880])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setFieldSplitIS, __pyx_t_5) < (0)) __PYX_ERR(48, 1509, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1535
 *             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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_bsize, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1535, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_fields, __pyx_mstate_global->__pyx_kp_u_tuple_str_Sequence_int) < (0)) __PYX_ERR(48, 1535, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1535, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_133setFieldSplitFields, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setFieldSplitFields, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[881])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setFieldSplitFields, __pyx_t_4) < (0)) __PYX_ERR(48, 1535, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1565
 *                                          nfields, ifields, ifields))
 * 
 *     def getFieldSplitSubKSP(self) -> list[KSP]:             # <<<<<<<<<<<<<<
 *         """Return the `KSP` for all splits.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_KSP) < (0)) __PYX_ERR(48, 1565, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_135getFieldSplitSubKSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getFieldSplitSubKSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[882])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getFieldSplitSubKSP, __pyx_t_5) < (0)) __PYX_ERR(48, 1565, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1585
 *         return subksp
 * 
 *     def getFieldSplitSchurGetSubKSP(self) -> list[KSP]:             # <<<<<<<<<<<<<<
 *         """Return the `KSP` for the Schur complement based splits.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_KSP) < (0)) __PYX_ERR(48, 1585, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_137getFieldSplitSchurGetSubKSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getFieldSplitSchurGetSubKSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[883])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getFieldSplitSchurGetSubKSP, __pyx_t_4) < (0)) __PYX_ERR(48, 1585, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1605
 *         return subksp
 * 
 *     def getFieldSplitSubIS(self, splitname: str) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the `IS` associated with a given name.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_splitname, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(48, 1605, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(48, 1605, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_139getFieldSplitSubIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getFieldSplitSubIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[884])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getFieldSplitSubIS, __pyx_t_5) < (0)) __PYX_ERR(48, 1605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1621
 *         return ref_IS(field)
 * 
 *     def setFieldSplitSchurFactType(self, ctype: FieldSplitSchurFactType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of approximate block factorization.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ctype, __pyx_mstate_global->__pyx_n_u_FieldSplitSchurFactType) < (0)) __PYX_ERR(48, 1621, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1621, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_141setFieldSplitSchurFactType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setFieldSplitSchurFactType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[885])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setFieldSplitSchurFactType, __pyx_t_4) < (0)) __PYX_ERR(48, 1621, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1639
 *         CHKERR(PCFieldSplitSetSchurFactType(self.pc, cval))
 * 
 *     def setFieldSplitSchurPreType(             # <<<<<<<<<<<<<<
 *         self,
 *         ptype: FieldSplitSchurPreType,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ptype, __pyx_mstate_global->__pyx_n_u_FieldSplitSchurPreType) < (0)) __PYX_ERR(48, 1639, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1639, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_143setFieldSplitSchurPreType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setFieldSplitSchurPreType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[886])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setFieldSplitSchurPreType, __pyx_t_5) < (0)) __PYX_ERR(48, 1639, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1666
 *     # --- COMPOSITE ---
 * 
 *     def setCompositeType(self, ctype: CompositeType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of composite preconditioner.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ctype, __pyx_mstate_global->__pyx_n_u_CompositeType) < (0)) __PYX_ERR(48, 1666, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1666, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_145setCompositeType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setCompositeType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[887])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setCompositeType, __pyx_t_4) < (0)) __PYX_ERR(48, 1666, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1684
 *         CHKERR(PCCompositeSetType(self.pc, cval))
 * 
 *     def getCompositePC(self, n: int) -> None:             # <<<<<<<<<<<<<<
 *         """Return a component of the composite `PC`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_n, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1684, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1684, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_147getCompositePC, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getCompositePC, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[888])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getCompositePC, __pyx_t_5) < (0)) __PYX_ERR(48, 1684, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1705
 *         return pc
 * 
 *     def addCompositePCType(self, pc_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Add a `PC` of the given type to the composite `PC`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pc_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(48, 1705, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1705, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_149addCompositePCType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_addCompositePCType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[889])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_addCompositePCType, __pyx_t_4) < (0)) __PYX_ERR(48, 1705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1726
 *     # --- KSP ---
 * 
 *     def getKSP(self) -> KSP:             # <<<<<<<<<<<<<<
 *         """Return the `KSP` if the `PC` is `Type.KSP`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_KSP) < (0)) __PYX_ERR(48, 1726, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_151getKSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getKSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[890])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getKSP, __pyx_t_5) < (0)) __PYX_ERR(48, 1726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1743
 *     # --- MG ---
 * 
 *     def getMGType(self) -> MGType:             # <<<<<<<<<<<<<<
 *         """Return the form of multigrid.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_MGType) < (0)) __PYX_ERR(48, 1743, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_153getMGType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getMGType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[891])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getMGType, __pyx_t_4) < (0)) __PYX_ERR(48, 1743, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1757
 *         return cval
 * 
 *     def setMGType(self, mgtype: MGType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the form of multigrid.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_mgtype, __pyx_mstate_global->__pyx_n_u_MGType) < (0)) __PYX_ERR(48, 1757, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1757, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_155setMGType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setMGType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[892])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setMGType, __pyx_t_5) < (0)) __PYX_ERR(48, 1757, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1770
 *         CHKERR(PCMGSetType(self.pc, cval))
 * 
 *     def getMGLevels(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of `MG` levels.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1770, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_157getMGLevels, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getMGLevels, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[893])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getMGLevels, __pyx_t_4) < (0)) __PYX_ERR(48, 1770, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1784
 *         return toInt(levels)
 * 
 *     def setMGLevels(self, levels: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of `MG` levels.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_levels, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1784, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1784, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_159setMGLevels, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setMGLevels, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[894])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setMGLevels, __pyx_t_5) < (0)) __PYX_ERR(48, 1784, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1802
 *         CHKERR(PCMGSetLevels(self.pc, clevels, NULL))
 * 
 *     def getMGCoarseSolve(self) -> KSP:             # <<<<<<<<<<<<<<
 *         """Return the `KSP` used on the coarse grid.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_KSP) < (0)) __PYX_ERR(48, 1802, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_161getMGCoarseSolve, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getMGCoarseSolve, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[895])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getMGCoarseSolve, __pyx_t_4) < (0)) __PYX_ERR(48, 1802, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1817
 *         return ksp
 * 
 *     def setMGInterpolation(self, level, Mat mat) -> None:             # <<<<<<<<<<<<<<
 *         """Set the interpolation operator for the given level.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1817, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_163setMGInterpolation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setMGInterpolation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[896])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setMGInterpolation, __pyx_t_5) < (0)) __PYX_ERR(48, 1817, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1837
 *         CHKERR(PCMGSetInterpolation(self.pc, clevel, mat.mat))
 * 
 *     def getMGInterpolation(self, level: int) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the interpolation operator for the given level.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1837, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(48, 1837, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_165getMGInterpolation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getMGInterpolation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[897])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getMGInterpolation, __pyx_t_4) < (0)) __PYX_ERR(48, 1837, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1858
 *         return interpolation
 * 
 *     def setMGRestriction(self, level: int, Mat mat) -> None:             # <<<<<<<<<<<<<<
 *         """Set the restriction operator for the given level.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1858, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1858, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_167setMGRestriction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setMGRestriction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[898])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setMGRestriction, __pyx_t_5) < (0)) __PYX_ERR(48, 1858, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1878
 *         CHKERR(PCMGSetRestriction(self.pc, clevel, mat.mat))
 * 
 *     def getMGRestriction(self, level: int) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the restriction operator for the given level.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1878, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(48, 1878, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_169getMGRestriction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getMGRestriction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[899])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getMGRestriction, __pyx_t_4) < (0)) __PYX_ERR(48, 1878, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1899
 *         return restriction
 * 
 *     def setMGRScale(self, level: int, Vec rscale) -> None:             # <<<<<<<<<<<<<<
 *         """Set the pointwise scaling for the restriction operator on the given level.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1899, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 1899, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_171setMGRScale, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setMGRScale, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[900])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setMGRScale, __pyx_t_5) < (0)) __PYX_ERR(48, 1899, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1919
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1919, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(48, 1919, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_173getMGRScale, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getMGRScale, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[901])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getMGRScale, __pyx_t_4) < (0)) __PYX_ERR(48, 1919, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1940
 *         return rscale
 * 
 *     def getMGSmoother(self, level: int) -> KSP:             # <<<<<<<<<<<<<<
 *         """Return the `KSP` to be used as a smoother.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1940, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_KSP) < (0)) __PYX_ERR(48, 1940, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_175getMGSmoother, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getMGSmoother, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[902])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getMGSmoother, __pyx_t_5) < (0)) __PYX_ERR(48, 1940, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":1961
 *         return ksp
 * 
 *     def getMGSmootherDown(self, level: int) -> KSP:             # <<<<<<<<<<<<<<
 *         """Return the `KSP` to be used as a smoother before coarse grid correction.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1961, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_KSP) < (0)) __PYX_ERR(48, 1961, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_177getMGSmootherDown, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getMGSmootherDown, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[903])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getMGSmootherDown, __pyx_t_4) < (0)) __PYX_ERR(48, 1961, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":1982
 *         return ksp
 * 
 *     def getMGSmootherUp(self, level: int) -> KSP:             # <<<<<<<<<<<<<<
 *         """Return the `KSP` to be used as a smoother after coarse grid correction.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 1982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 1982, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_KSP) < (0)) __PYX_ERR(48, 1982, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_179getMGSmootherUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getMGSmootherUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[904])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 1982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getMGSmootherUp, __pyx_t_5) < (0)) __PYX_ERR(48, 1982, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2003
 *         return ksp
 * 
 *     def setMGCycleType(self, cycle_type: MGCycleType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of cycles.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_cycle_type, __pyx_mstate_global->__pyx_n_u_MGCycleType) < (0)) __PYX_ERR(48, 2003, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2003, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_181setMGCycleType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setMGCycleType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[905])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setMGCycleType, __pyx_t_4) < (0)) __PYX_ERR(48, 2003, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2021
 *         CHKERR(PCMGSetCycleType(self.pc, ctype))
 * 
 *     def setMGCycleTypeOnLevel(self, level: int, cycle_type: MGCycleType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of cycle on the given level.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2021, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_cycle_type, __pyx_mstate_global->__pyx_n_u_MGCycleType) < (0)) __PYX_ERR(48, 2021, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2021, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_183setMGCycleTypeOnLevel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setMGCycleTypeOnLevel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[906])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setMGCycleTypeOnLevel, __pyx_t_5) < (0)) __PYX_ERR(48, 2021, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2042
 *         CHKERR(PCMGSetCycleTypeOnLevel(self.pc, clevel, ctype))
 * 
 *     def setMGRhs(self, level: int, Vec rhs) -> None:             # <<<<<<<<<<<<<<
 *         """Set the vector where the right-hand side is stored.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2042, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2042, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_185setMGRhs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setMGRhs, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[907])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setMGRhs, __pyx_t_4) < (0)) __PYX_ERR(48, 2042, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2065
 *         CHKERR(PCMGSetRhs(self.pc, clevel, rhs.vec))
 * 
 *     def setMGX(self, level: int, Vec x) -> None:             # <<<<<<<<<<<<<<
 *         """Set the vector where the solution is stored.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2065, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2065, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_187setMGX, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setMGX, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[908])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2065, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setMGX, __pyx_t_5) < (0)) __PYX_ERR(48, 2065, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2088
 *         CHKERR(PCMGSetX(self.pc, clevel, x.vec))
 * 
 *     def setMGR(self, level: int, Vec r) -> None:             # <<<<<<<<<<<<<<
 *         """Set the vector where the residual is stored.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2088, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2088, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_189setMGR, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setMGR, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[909])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setMGR, __pyx_t_4) < (0)) __PYX_ERR(48, 2088, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2113
 *     # --- BDDC ---
 * 
 *     def setBDDCLocalAdjacency(self, csr: CSRIndicesSpec) -> None:             # <<<<<<<<<<<<<<
 *         """Provide a custom connectivity graph for local dofs.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_csr, __pyx_mstate_global->__pyx_n_u_CSRIndicesSpec) < (0)) __PYX_ERR(48, 2113, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2113, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_191setBDDCLocalAdjacency, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setBDDCLocalAdjacency, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[910])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setBDDCLocalAdjacency, __pyx_t_5) < (0)) __PYX_ERR(48, 2113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2143
 *         CHKERR(PCBDDCSetLocalAdjacencyGraph(self.pc, ni - 1, i, j, PETSC_COPY_VALUES))
 * 
 *     def setBDDCDivergenceMat(self, Mat div, trans: bool = False, IS l2l=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the linear operator representing  div(u)p dx.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_trans, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(48, 2143, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2143, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_193setBDDCDivergenceMat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setBDDCDivergenceMat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[911])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[118]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setBDDCDivergenceMat, __pyx_t_4) < (0)) __PYX_ERR(48, 2143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2169
 *         CHKERR(PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l))
 * 
 *     def setBDDCDiscreteGradient(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat G,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_order, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_gord, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(48, 2169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_conforming, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(48, 2169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2169, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_195setBDDCDiscreteGradient, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setBDDCDiscreteGradient, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[912])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[119]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setBDDCDiscreteGradient, __pyx_t_5) < (0)) __PYX_ERR(48, 2169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2205
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_interior, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(48, 2205, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2205, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_197setBDDCChangeOfBasisMat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setBDDCChangeOfBasisMat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[913])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setBDDCChangeOfBasisMat, __pyx_t_4) < (0)) __PYX_ERR(48, 2205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2226
 *         CHKERR(PCBDDCSetChangeOfBasisMat(self.pc, T.mat, pinterior))
 * 
 *     def setBDDCPrimalVerticesIS(self, IS primv) -> None:             # <<<<<<<<<<<<<<
 *         """Set additional user defined primal vertices.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2226, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_199setBDDCPrimalVerticesIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setBDDCPrimalVerticesIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[914])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setBDDCPrimalVerticesIS, __pyx_t_5) < (0)) __PYX_ERR(48, 2226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2243
 *         CHKERR(PCBDDCSetPrimalVerticesIS(self.pc, primv.iset))
 * 
 *     def setBDDCPrimalVerticesLocalIS(self, IS primv) -> None:             # <<<<<<<<<<<<<<
 *         """Set additional user defined primal vertices.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2243, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_201setBDDCPrimalVerticesLocalIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setBDDCPrimalVerticesLocalIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[915])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setBDDCPrimalVerticesLocalIS, __pyx_t_4) < (0)) __PYX_ERR(48, 2243, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2260
 *         CHKERR(PCBDDCSetPrimalVerticesLocalIS(self.pc, primv.iset))
 * 
 *     def setBDDCCoarseningRatio(self, cratio: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the coarsening ratio used in the multilevel version.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_cratio, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2260, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2260, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_203setBDDCCoarseningRatio, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setBDDCCoarseningRatio, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[916])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setBDDCCoarseningRatio, __pyx_t_5) < (0)) __PYX_ERR(48, 2260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2278
 *         CHKERR(PCBDDCSetCoarseningRatio(self.pc, pcratio))
 * 
 *     def setBDDCLevels(self, levels: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum number of additional levels allowed.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_levels, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2278, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2278, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_205setBDDCLevels, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setBDDCLevels, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[917])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setBDDCLevels, __pyx_t_4) < (0)) __PYX_ERR(48, 2278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2296
 *         CHKERR(PCBDDCSetLevels(self.pc, plevels))
 * 
 *     def setBDDCDirichletBoundaries(self, IS bndr) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `IS` defining Dirichlet boundaries for the global problem.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2296, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_207setBDDCDirichletBoundaries, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setBDDCDirichletBoundaries, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[918])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setBDDCDirichletBoundaries, __pyx_t_5) < (0)) __PYX_ERR(48, 2296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2313
 *         CHKERR(PCBDDCSetDirichletBoundaries(self.pc, bndr.iset))
 * 
 *     def setBDDCDirichletBoundariesLocal(self, IS bndr) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `IS` defining Dirichlet boundaries in local ordering.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2313, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_209setBDDCDirichletBoundariesLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setBDDCDirichletBoundariesLoc, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[919])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setBDDCDirichletBoundariesLocal, __pyx_t_4) < (0)) __PYX_ERR(48, 2313, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2330
 *         CHKERR(PCBDDCSetDirichletBoundariesLocal(self.pc, bndr.iset))
 * 
 *     def setBDDCNeumannBoundaries(self, IS bndr) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `IS` defining Neumann boundaries for the global problem.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2330, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_211setBDDCNeumannBoundaries, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setBDDCNeumannBoundaries, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[920])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setBDDCNeumannBoundaries, __pyx_t_5) < (0)) __PYX_ERR(48, 2330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2347
 *         CHKERR(PCBDDCSetNeumannBoundaries(self.pc, bndr.iset))
 * 
 *     def setBDDCNeumannBoundariesLocal(self, IS bndr) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `IS` defining Neumann boundaries in local ordering.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2347, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_213setBDDCNeumannBoundariesLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setBDDCNeumannBoundariesLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[921])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setBDDCNeumannBoundariesLocal, __pyx_t_4) < (0)) __PYX_ERR(48, 2347, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2364
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_isfields, __pyx_mstate_global->__pyx_kp_u_IS_Sequence_IS) < (0)) __PYX_ERR(48, 2364, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2364, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_215setBDDCDofsSplitting, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setBDDCDofsSplitting, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[922])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setBDDCDofsSplitting, __pyx_t_5) < (0)) __PYX_ERR(48, 2364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2386
 *         CHKERR(PCBDDCSetDofsSplitting(self.pc, <PetscInt>n, cisfields))
 * 
 *     def setBDDCDofsSplittingLocal(self, isfields: IS | Sequence[IS]) -> None:             # <<<<<<<<<<<<<<
 *         """Set the index set(s) defining fields of the local subdomain matrix.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_isfields, __pyx_mstate_global->__pyx_kp_u_IS_Sequence_IS) < (0)) __PYX_ERR(48, 2386, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2386, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_217setBDDCDofsSplittingLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setBDDCDofsSplittingLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[923])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setBDDCDofsSplittingLocal, __pyx_t_4) < (0)) __PYX_ERR(48, 2386, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2412
 * 
 *     # --- Patch ---
 *     def getPatchSubKSP(self) -> list[KSP]:             # <<<<<<<<<<<<<<
 *         """Return the local `KSP` object for all blocks on this process.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_KSP) < (0)) __PYX_ERR(48, 2412, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_219getPatchSubKSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getPatchSubKSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[924])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getPatchSubKSP, __pyx_t_5) < (0)) __PYX_ERR(48, 2412, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2423
 *         return [ref_KSP(p[i]) for i from 0 <= i <n]
 * 
 *     def setPatchCellNumbering(self, Section sec) -> None:             # <<<<<<<<<<<<<<
 *         """Set the cell numbering."""
 *         CHKERR(PCPatchSetCellNumbering(self.pc, sec.sec))
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2423, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_221setPatchCellNumbering, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setPatchCellNumbering, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[925])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setPatchCellNumbering, __pyx_t_4) < (0)) __PYX_ERR(48, 2423, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2427
 *         CHKERR(PCPatchSetCellNumbering(self.pc, sec.sec))
 * 
 *     def setPatchDiscretisationInfo(self, dms, bs,             # <<<<<<<<<<<<<<
 *                                    cellNodeMaps,
 *                                    subspaceOffsets,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2427, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_223setPatchDiscretisationInfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setPatchDiscretisationInfo, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[926])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setPatchDiscretisationInfo, __pyx_t_5) < (0)) __PYX_ERR(48, 2427, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2468
 *         CHKERR(PetscFree(ccellNodeMaps))
 * 
 *     def setPatchComputeOperator(self, operator, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set compute operator callbacks."""
 *         if args is  None: args  = ()
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2468, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_225setPatchComputeOperator, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setPatchComputeOperator, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[927])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setPatchComputeOperator, __pyx_t_4) < (0)) __PYX_ERR(48, 2468, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2476
 *         CHKERR(PCPatchSetComputeOperator(self.pc, PCPatch_ComputeOperator, <void*>context))
 * 
 *     def setPatchComputeOperatorInteriorFacets(self, operator, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set compute operator callbacks."""
 *         if args is  None: args  = ()
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2476, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_227setPatchComputeOperatorInteriorFacets, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setPatchComputeOperatorInteri, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[928])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setPatchComputeOperatorInteriorF, __pyx_t_5) < (0)) __PYX_ERR(48, 2476, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2484
 *         CHKERR(PCPatchSetComputeOperatorInteriorFacets(self.pc, PCPatch_ComputeOperatorInteriorFacets, <void*>context))
 * 
 *     def setPatchComputeFunction(self, function, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set compute operator callbacks."""
 *         if args is  None: args  = ()
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2484, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_229setPatchComputeFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setPatchComputeFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[929])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setPatchComputeFunction, __pyx_t_4) < (0)) __PYX_ERR(48, 2484, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2492
 *         CHKERR(PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunction, <void*>context))
 * 
 *     def setPatchComputeFunctionInteriorFacets(self, function, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set compute operator callbacks."""
 *         if args is  None: args  = ()
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2492, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_231setPatchComputeFunctionInteriorFacets, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setPatchComputeFunctionInteri, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[930])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setPatchComputeFunctionInteriorF, __pyx_t_5) < (0)) __PYX_ERR(48, 2492, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2500
 *         CHKERR(PCPatchSetComputeFunction(self.pc, PCPatch_ComputeFunctionInteriorFacets, <void*>context))
 * 
 *     def setPatchConstructType(self, typ, operator=None, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set compute operator callbacks."""
 *         if args is  None: args  = ()
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2500, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_233setPatchConstructType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setPatchConstructType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[931])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setPatchConstructType, __pyx_t_4) < (0)) __PYX_ERR(48, 2500, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2516
 *     # --- HPDDM ---
 * 
 *     def setHPDDMAuxiliaryMat(self, IS uis, Mat uaux) -> None:             # <<<<<<<<<<<<<<
 *         """Set the auxiliary matrix used by the preconditioner.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2516, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_235setHPDDMAuxiliaryMat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setHPDDMAuxiliaryMat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[932])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setHPDDMAuxiliaryMat, __pyx_t_5) < (0)) __PYX_ERR(48, 2516, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2535
 *         CHKERR(PCHPDDMSetAuxiliaryMat(self.pc, uis.iset, uaux.mat, NULL, <void*>NULL))
 * 
 *     def setHPDDMRHSMat(self, Mat B) -> None:             # <<<<<<<<<<<<<<
 *         """Set the right-hand side matrix of the preconditioner.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2535, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_237setHPDDMRHSMat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setHPDDMRHSMat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[933])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setHPDDMRHSMat, __pyx_t_4) < (0)) __PYX_ERR(48, 2535, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2552
 *         CHKERR(PCHPDDMSetRHSMat(self.pc, B.mat))
 * 
 *     def getHPDDMComplexities(self) -> tuple[float, float]:             # <<<<<<<<<<<<<<
 *         """Compute the grid and operator complexities.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_float) < (0)) __PYX_ERR(48, 2552, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_239getHPDDMComplexities, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getHPDDMComplexities, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[934])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getHPDDMComplexities, __pyx_t_5) < (0)) __PYX_ERR(48, 2552, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2566
 *         return (toReal(gc), toReal(oc))
 * 
 *     def setHPDDMHasNeumannMat(self, has: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set to indicate that the `Mat` passed to the `PC` is the local Neumann matrix.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_has, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(48, 2566, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2566, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_241setHPDDMHasNeumannMat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setHPDDMHasNeumannMat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[935])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setHPDDMHasNeumannMat, __pyx_t_4) < (0)) __PYX_ERR(48, 2566, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2584
 *         CHKERR(PCHPDDMHasNeumannMat(self.pc, phas))
 * 
 *     def setHPDDMCoarseCorrectionType(self, correction_type: HPDDMCoarseCorrectionType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the coarse correction type.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_correction_type, __pyx_mstate_global->__pyx_n_u_HPDDMCoarseCorrectionType) < (0)) __PYX_ERR(48, 2584, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2584, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_243setHPDDMCoarseCorrectionType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setHPDDMCoarseCorrectionType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[936])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setHPDDMCoarseCorrectionType, __pyx_t_5) < (0)) __PYX_ERR(48, 2584, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2602
 *         CHKERR(PCHPDDMSetCoarseCorrectionType(self.pc, ctype))
 * 
 *     def getHPDDMCoarseCorrectionType(self) -> HPDDMCoarseCorrectionType:             # <<<<<<<<<<<<<<
 *         """Return the coarse correction type.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_HPDDMCoarseCorrectionType) < (0)) __PYX_ERR(48, 2602, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_245getHPDDMCoarseCorrectionType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getHPDDMCoarseCorrectionType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[937])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getHPDDMCoarseCorrectionType, __pyx_t_4) < (0)) __PYX_ERR(48, 2602, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2616
 *         return cval
 * 
 *     def getHPDDMSTShareSubKSP(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return true if the `KSP` in SLEPc ``ST`` and the subdomain solver is shared.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(48, 2616, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_247getHPDDMSTShareSubKSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getHPDDMSTShareSubKSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[938])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getHPDDMSTShareSubKSP, __pyx_t_5) < (0)) __PYX_ERR(48, 2616, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2630
 *         return toBool(cval)
 * 
 *     def setHPDDMDeflationMat(self, IS uis, Mat U) -> None:             # <<<<<<<<<<<<<<
 *         """Set the deflation space used to assemble a coarse operator.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2630, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_249setHPDDMDeflationMat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setHPDDMDeflationMat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[939])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setHPDDMDeflationMat, __pyx_t_4) < (0)) __PYX_ERR(48, 2630, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2651
 *     # --- SPAI ---
 * 
 *     def setSPAIEpsilon(self, val: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the tolerance for the preconditioner.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_val, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(48, 2651, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2651, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_251setSPAIEpsilon, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setSPAIEpsilon, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[940])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setSPAIEpsilon, __pyx_t_5) < (0)) __PYX_ERR(48, 2651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2669
 *         CHKERR(PCSPAISetEpsilon(self.pc, cval))
 * 
 *     def setSPAINBSteps(self, nbsteps: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum number of improvement steps per row.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_nbsteps, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2669, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2669, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_253setSPAINBSteps, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setSPAINBSteps, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[941])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setSPAINBSteps, __pyx_t_4) < (0)) __PYX_ERR(48, 2669, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2687
 *         CHKERR(PCSPAISetNBSteps(self.pc, cval))
 * 
 *     def setSPAIMax(self, maxval: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the size of working buffers in the preconditioner.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_maxval, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2687, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2687, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_255setSPAIMax, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setSPAIMax, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[942])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setSPAIMax, __pyx_t_5) < (0)) __PYX_ERR(48, 2687, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2706
 *         CHKERR(PCSPAISetMax(self.pc, cval))
 * 
 *     def setSPAIMaxNew(self, maxval: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum number of new non-zero candidates per step.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_maxval, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2706, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2706, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_257setSPAIMaxNew, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setSPAIMaxNew, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[943])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setSPAIMaxNew, __pyx_t_4) < (0)) __PYX_ERR(48, 2706, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2724
 *         CHKERR(PCSPAISetMaxNew(self.pc, cval))
 * 
 *     def setSPAIBlockSize(self, n: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the block size of the preconditioner.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_n, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2724, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2724, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_259setSPAIBlockSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setSPAIBlockSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[944])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setSPAIBlockSize, __pyx_t_5) < (0)) __PYX_ERR(48, 2724, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2742
 *         CHKERR(PCSPAISetBlockSize(self.pc, cval))
 * 
 *     def setSPAICacheSize(self, size: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the cache size.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2742, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2742, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_261setSPAICacheSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setSPAICacheSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[945])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setSPAICacheSize, __pyx_t_4) < (0)) __PYX_ERR(48, 2742, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2760
 *         CHKERR(PCSPAISetCacheSize(self.pc, cval))
 * 
 *     def setSPAIVerbose(self, level: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the verbosity level.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2760, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2760, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_263setSPAIVerbose, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setSPAIVerbose, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[946])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setSPAIVerbose, __pyx_t_5) < (0)) __PYX_ERR(48, 2760, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2778
 *         CHKERR(PCSPAISetVerbose(self.pc, cval))
 * 
 *     def setSPAISp(self, sym: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set to specify a symmetric sparsity pattern.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sym, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2778, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2778, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_265setSPAISp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setSPAISp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[947])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setSPAISp, __pyx_t_4) < (0)) __PYX_ERR(48, 2778, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2798
 *     # --- DEFLATION ---
 * 
 *     def setDeflationInitOnly(self, flg: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set to only perform the initialization.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_flg, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(48, 2798, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2798, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_267setDeflationInitOnly, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setDeflationInitOnly, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[948])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setDeflationInitOnly, __pyx_t_5) < (0)) __PYX_ERR(48, 2798, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2820
 *         CHKERR(PCDeflationSetInitOnly(self.pc, cflg))
 * 
 *     def setDeflationLevels(self, levels: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum level of deflation nesting.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_levels, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2820, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2820, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_269setDeflationLevels, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setDeflationLevels, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[949])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setDeflationLevels, __pyx_t_4) < (0)) __PYX_ERR(48, 2820, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2838
 *         CHKERR(PCDeflationSetLevels(self.pc, clevels))
 * 
 *     def setDeflationReductionFactor(self, red: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the reduction factor for the preconditioner.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_red, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2838, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2838, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_271setDeflationReductionFactor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setDeflationReductionFactor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[950])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setDeflationReductionFactor, __pyx_t_5) < (0)) __PYX_ERR(48, 2838, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2856
 *         CHKERR(PCDeflationSetReductionFactor(self.pc, cred))
 * 
 *     def setDeflationCorrectionFactor(self, fact: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the coarse problem correction factor.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_fact, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(48, 2856, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2856, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_273setDeflationCorrectionFactor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setDeflationCorrectionFactor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[951])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setDeflationCorrectionFactor, __pyx_t_4) < (0)) __PYX_ERR(48, 2856, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2874
 *         CHKERR(PCDeflationSetCorrectionFactor(self.pc, cfact))
 * 
 *     def setDeflationSpaceToCompute(self, space_type: DeflationSpaceType, size: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the deflation space type.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_space_type, __pyx_mstate_global->__pyx_n_u_DeflationSpaceType) < (0)) __PYX_ERR(48, 2874, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(48, 2874, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2874, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_275setDeflationSpaceToCompute, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setDeflationSpaceToCompute, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[952])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setDeflationSpaceToCompute, __pyx_t_5) < (0)) __PYX_ERR(48, 2874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2895
 *         CHKERR(PCDeflationSetSpaceToCompute(self.pc, ctype, csize))
 * 
 *     def setDeflationSpace(self, Mat W, transpose: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set the deflation space matrix or its (Hermitian) transpose.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_transpose, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(48, 2895, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2895, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_277setDeflationSpace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setDeflationSpace, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[953])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setDeflationSpace, __pyx_t_4) < (0)) __PYX_ERR(48, 2895, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2916
 *         CHKERR(PCDeflationSetSpace(self.pc, W.mat, ctranspose))
 * 
 *     def setDeflationProjectionNullSpaceMat(self, Mat mat) -> None:             # <<<<<<<<<<<<<<
 *         """Set the projection null space matrix.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2916, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_279setDeflationProjectionNullSpaceMat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setDeflationProjectionNullSpa, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[954])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setDeflationProjectionNullSpaceM, __pyx_t_5) < (0)) __PYX_ERR(48, 2916, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2933
 *         CHKERR(PCDeflationSetProjectionNullSpaceMat(self.pc, mat.mat))
 * 
 *     def setDeflationCoarseMat(self, Mat mat) -> None:             # <<<<<<<<<<<<<<
 *         """Set the coarse problem matrix.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(48, 2933, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_281setDeflationCoarseMat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_setDeflationCoarseMat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[955])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_setDeflationCoarseMat, __pyx_t_4) < (0)) __PYX_ERR(48, 2933, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2950
 *         CHKERR(PCDeflationSetCoarseMat(self.pc, mat.mat))
 * 
 *     def getDeflationCoarseKSP(self) -> KSP:             # <<<<<<<<<<<<<<
 *         """Return the coarse problem `KSP`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_KSP) < (0)) __PYX_ERR(48, 2950, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_283getDeflationCoarseKSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getDeflationCoarseKSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[956])); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getDeflationCoarseKSP, __pyx_t_5) < (0)) __PYX_ERR(48, 2950, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/PC.pyx":2965
 *         return ksp
 * 
 *     def getDeflationPC(self) -> PC:             # <<<<<<<<<<<<<<
 *         """Return the additional preconditioner.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(48, 2965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PC) < (0)) __PYX_ERR(48, 2965, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2PC_285getDeflationPC, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PC_getDeflationPC, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[957])); if (unlikely(!__pyx_t_4)) __PYX_ERR(48, 2965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_PC, __pyx_mstate_global->__pyx_n_u_getDeflationPC, __pyx_t_4) < (0)) __PYX_ERR(48, 2965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PC.pyx":2982
 * # --------------------------------------------------------------------
 * 
 * del PCType             # <<<<<<<<<<<<<<
 * del PCSide
 * del PCASMType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PCType) < (0)) __PYX_ERR(48, 2982, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2983
 * 
 * del PCType
 * del PCSide             # <<<<<<<<<<<<<<
 * del PCASMType
 * del PCGASMType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PCSide) < (0)) __PYX_ERR(48, 2983, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2984
 * del PCType
 * del PCSide
 * del PCASMType             # <<<<<<<<<<<<<<
 * del PCGASMType
 * del PCMGType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PCASMType) < (0)) __PYX_ERR(48, 2984, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2985
 * del PCSide
 * del PCASMType
 * del PCGASMType             # <<<<<<<<<<<<<<
 * del PCMGType
 * del PCMGCycleType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PCGASMType) < (0)) __PYX_ERR(48, 2985, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2986
 * del PCASMType
 * del PCGASMType
 * del PCMGType             # <<<<<<<<<<<<<<
 * del PCMGCycleType
 * del PCGAMGType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PCMGType) < (0)) __PYX_ERR(48, 2986, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2987
 * del PCGASMType
 * del PCMGType
 * del PCMGCycleType             # <<<<<<<<<<<<<<
 * del PCGAMGType
 * del PCCompositeType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PCMGCycleType) < (0)) __PYX_ERR(48, 2987, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2988
 * del PCMGType
 * del PCMGCycleType
 * del PCGAMGType             # <<<<<<<<<<<<<<
 * del PCCompositeType
 * del PCFieldSplitSchurPreType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PCGAMGType) < (0)) __PYX_ERR(48, 2988, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2989
 * del PCMGCycleType
 * del PCGAMGType
 * del PCCompositeType             # <<<<<<<<<<<<<<
 * del PCFieldSplitSchurPreType
 * del PCFieldSplitSchurFactType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PCCompositeType) < (0)) __PYX_ERR(48, 2989, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2990
 * del PCGAMGType
 * del PCCompositeType
 * del PCFieldSplitSchurPreType             # <<<<<<<<<<<<<<
 * del PCFieldSplitSchurFactType
 * del PCPatchConstructType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PCFieldSplitSchurPreType) < (0)) __PYX_ERR(48, 2990, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2991
 * del PCCompositeType
 * del PCFieldSplitSchurPreType
 * del PCFieldSplitSchurFactType             # <<<<<<<<<<<<<<
 * del PCPatchConstructType
 * del PCHPDDMCoarseCorrectionType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PCFieldSplitSchurFactType) < (0)) __PYX_ERR(48, 2991, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2992
 * del PCFieldSplitSchurPreType
 * del PCFieldSplitSchurFactType
 * del PCPatchConstructType             # <<<<<<<<<<<<<<
 * del PCHPDDMCoarseCorrectionType
 * del PCDeflationSpaceType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PCPatchConstructType) < (0)) __PYX_ERR(48, 2992, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2993
 * del PCFieldSplitSchurFactType
 * del PCPatchConstructType
 * del PCHPDDMCoarseCorrectionType             # <<<<<<<<<<<<<<
 * del PCDeflationSpaceType
 * del PCFailedReason
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PCHPDDMCoarseCorrectionType) < (0)) __PYX_ERR(48, 2993, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2994
 * del PCPatchConstructType
 * del PCHPDDMCoarseCorrectionType
 * del PCDeflationSpaceType             # <<<<<<<<<<<<<<
 * del PCFailedReason
 * 
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PCDeflationSpaceType) < (0)) __PYX_ERR(48, 2994, __pyx_L1_error)

  /* "petsc4py/PETSc/PC.pyx":2995
 * del PCHPDDMCoarseCorrectionType
 * del PCDeflationSpaceType
 * del PCFailedReason             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PCFailedReason) < (0)) __PYX_ERR(48, 2995, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class KSPType(object):             # <<<<<<<<<<<<<<
 *     """KSP Type.
 * 
*/
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[121]); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_KSPType, __pyx_mstate_global->__pyx_n_u_KSPType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_KSP_Type_The_available_types_are); if (unlikely(!__pyx_t_10)) __PYX_ERR(49, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[121]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[121]) < 0))) __PYX_ERR(49, 3, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/KSP.pyx":174
 * 
 *     """
 *     RICHARDSON = S_(KSPRICHARDSON)             # <<<<<<<<<<<<<<
 *     CHEBYSHEV  = S_(KSPCHEBYSHEV)
 *     CG         = S_(KSPCG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPRICHARDSON); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RICHARDSON, __pyx_t_14) < (0)) __PYX_ERR(49, 174, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":175
 *     """
 *     RICHARDSON = S_(KSPRICHARDSON)
 *     CHEBYSHEV  = S_(KSPCHEBYSHEV)             # <<<<<<<<<<<<<<
 *     CG         = S_(KSPCG)
 *     GROPPCG    = S_(KSPGROPPCG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPCHEBYSHEV); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CHEBYSHEV, __pyx_t_14) < (0)) __PYX_ERR(49, 175, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":176
 *     RICHARDSON = S_(KSPRICHARDSON)
 *     CHEBYSHEV  = S_(KSPCHEBYSHEV)
 *     CG         = S_(KSPCG)             # <<<<<<<<<<<<<<
 *     GROPPCG    = S_(KSPGROPPCG)
 *     PIPECG     = S_(KSPPIPECG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPCG); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CG, __pyx_t_14) < (0)) __PYX_ERR(49, 176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":177
 *     CHEBYSHEV  = S_(KSPCHEBYSHEV)
 *     CG         = S_(KSPCG)
 *     GROPPCG    = S_(KSPGROPPCG)             # <<<<<<<<<<<<<<
 *     PIPECG     = S_(KSPPIPECG)
 *     PIPECGRR   = S_(KSPPIPECGRR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPGROPPCG); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_GROPPCG, __pyx_t_14) < (0)) __PYX_ERR(49, 177, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":178
 *     CG         = S_(KSPCG)
 *     GROPPCG    = S_(KSPGROPPCG)
 *     PIPECG     = S_(KSPPIPECG)             # <<<<<<<<<<<<<<
 *     PIPECGRR   = S_(KSPPIPECGRR)
 *     PIPELCG    = S_(KSPPIPELCG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPECG); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PIPECG, __pyx_t_14) < (0)) __PYX_ERR(49, 178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":179
 *     GROPPCG    = S_(KSPGROPPCG)
 *     PIPECG     = S_(KSPPIPECG)
 *     PIPECGRR   = S_(KSPPIPECGRR)             # <<<<<<<<<<<<<<
 *     PIPELCG    = S_(KSPPIPELCG)
 *     PIPEPRCG   = S_(KSPPIPEPRCG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPECGRR); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PIPECGRR, __pyx_t_14) < (0)) __PYX_ERR(49, 179, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":180
 *     PIPECG     = S_(KSPPIPECG)
 *     PIPECGRR   = S_(KSPPIPECGRR)
 *     PIPELCG    = S_(KSPPIPELCG)             # <<<<<<<<<<<<<<
 *     PIPEPRCG   = S_(KSPPIPEPRCG)
 *     PIPECG2    = S_(KSPPIPECG2)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPELCG); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PIPELCG, __pyx_t_14) < (0)) __PYX_ERR(49, 180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":181
 *     PIPECGRR   = S_(KSPPIPECGRR)
 *     PIPELCG    = S_(KSPPIPELCG)
 *     PIPEPRCG   = S_(KSPPIPEPRCG)             # <<<<<<<<<<<<<<
 *     PIPECG2    = S_(KSPPIPECG2)
 *     CGNE       = S_(KSPCGNE)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPEPRCG); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PIPEPRCG, __pyx_t_14) < (0)) __PYX_ERR(49, 181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":182
 *     PIPELCG    = S_(KSPPIPELCG)
 *     PIPEPRCG   = S_(KSPPIPEPRCG)
 *     PIPECG2    = S_(KSPPIPECG2)             # <<<<<<<<<<<<<<
 *     CGNE       = S_(KSPCGNE)
 *     NASH       = S_(KSPNASH)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPECG2); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PIPECG2, __pyx_t_14) < (0)) __PYX_ERR(49, 182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":183
 *     PIPEPRCG   = S_(KSPPIPEPRCG)
 *     PIPECG2    = S_(KSPPIPECG2)
 *     CGNE       = S_(KSPCGNE)             # <<<<<<<<<<<<<<
 *     NASH       = S_(KSPNASH)
 *     STCG       = S_(KSPSTCG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPCGNE); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CGNE, __pyx_t_14) < (0)) __PYX_ERR(49, 183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":184
 *     PIPECG2    = S_(KSPPIPECG2)
 *     CGNE       = S_(KSPCGNE)
 *     NASH       = S_(KSPNASH)             # <<<<<<<<<<<<<<
 *     STCG       = S_(KSPSTCG)
 *     GLTR       = S_(KSPGLTR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPNASH); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NASH, __pyx_t_14) < (0)) __PYX_ERR(49, 184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":185
 *     CGNE       = S_(KSPCGNE)
 *     NASH       = S_(KSPNASH)
 *     STCG       = S_(KSPSTCG)             # <<<<<<<<<<<<<<
 *     GLTR       = S_(KSPGLTR)
 *     FCG        = S_(KSPFCG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPSTCG); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_STCG, __pyx_t_14) < (0)) __PYX_ERR(49, 185, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":186
 *     NASH       = S_(KSPNASH)
 *     STCG       = S_(KSPSTCG)
 *     GLTR       = S_(KSPGLTR)             # <<<<<<<<<<<<<<
 *     FCG        = S_(KSPFCG)
 *     PIPEFCG    = S_(KSPPIPEFCG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPGLTR); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_GLTR, __pyx_t_14) < (0)) __PYX_ERR(49, 186, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":187
 *     STCG       = S_(KSPSTCG)
 *     GLTR       = S_(KSPGLTR)
 *     FCG        = S_(KSPFCG)             # <<<<<<<<<<<<<<
 *     PIPEFCG    = S_(KSPPIPEFCG)
 *     GMRES      = S_(KSPGMRES)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPFCG); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FCG, __pyx_t_14) < (0)) __PYX_ERR(49, 187, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":188
 *     GLTR       = S_(KSPGLTR)
 *     FCG        = S_(KSPFCG)
 *     PIPEFCG    = S_(KSPPIPEFCG)             # <<<<<<<<<<<<<<
 *     GMRES      = S_(KSPGMRES)
 *     PIPEFGMRES = S_(KSPPIPEFGMRES)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPEFCG); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PIPEFCG, __pyx_t_14) < (0)) __PYX_ERR(49, 188, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":189
 *     FCG        = S_(KSPFCG)
 *     PIPEFCG    = S_(KSPPIPEFCG)
 *     GMRES      = S_(KSPGMRES)             # <<<<<<<<<<<<<<
 *     PIPEFGMRES = S_(KSPPIPEFGMRES)
 *     FGMRES     = S_(KSPFGMRES)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPGMRES); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_GMRES, __pyx_t_14) < (0)) __PYX_ERR(49, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":190
 *     PIPEFCG    = S_(KSPPIPEFCG)
 *     GMRES      = S_(KSPGMRES)
 *     PIPEFGMRES = S_(KSPPIPEFGMRES)             # <<<<<<<<<<<<<<
 *     FGMRES     = S_(KSPFGMRES)
 *     LGMRES     = S_(KSPLGMRES)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPEFGMRES); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PIPEFGMRES, __pyx_t_14) < (0)) __PYX_ERR(49, 190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":191
 *     GMRES      = S_(KSPGMRES)
 *     PIPEFGMRES = S_(KSPPIPEFGMRES)
 *     FGMRES     = S_(KSPFGMRES)             # <<<<<<<<<<<<<<
 *     LGMRES     = S_(KSPLGMRES)
 *     DGMRES     = S_(KSPDGMRES)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPFGMRES); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FGMRES, __pyx_t_14) < (0)) __PYX_ERR(49, 191, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":192
 *     PIPEFGMRES = S_(KSPPIPEFGMRES)
 *     FGMRES     = S_(KSPFGMRES)
 *     LGMRES     = S_(KSPLGMRES)             # <<<<<<<<<<<<<<
 *     DGMRES     = S_(KSPDGMRES)
 *     PGMRES     = S_(KSPPGMRES)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPLGMRES); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LGMRES, __pyx_t_14) < (0)) __PYX_ERR(49, 192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":193
 *     FGMRES     = S_(KSPFGMRES)
 *     LGMRES     = S_(KSPLGMRES)
 *     DGMRES     = S_(KSPDGMRES)             # <<<<<<<<<<<<<<
 *     PGMRES     = S_(KSPPGMRES)
 *     TCQMR      = S_(KSPTCQMR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPDGMRES); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DGMRES, __pyx_t_14) < (0)) __PYX_ERR(49, 193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":194
 *     LGMRES     = S_(KSPLGMRES)
 *     DGMRES     = S_(KSPDGMRES)
 *     PGMRES     = S_(KSPPGMRES)             # <<<<<<<<<<<<<<
 *     TCQMR      = S_(KSPTCQMR)
 *     BCGS       = S_(KSPBCGS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPPGMRES); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PGMRES, __pyx_t_14) < (0)) __PYX_ERR(49, 194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":195
 *     DGMRES     = S_(KSPDGMRES)
 *     PGMRES     = S_(KSPPGMRES)
 *     TCQMR      = S_(KSPTCQMR)             # <<<<<<<<<<<<<<
 *     BCGS       = S_(KSPBCGS)
 *     IBCGS      = S_(KSPIBCGS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPTCQMR); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_TCQMR, __pyx_t_14) < (0)) __PYX_ERR(49, 195, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":196
 *     PGMRES     = S_(KSPPGMRES)
 *     TCQMR      = S_(KSPTCQMR)
 *     BCGS       = S_(KSPBCGS)             # <<<<<<<<<<<<<<
 *     IBCGS      = S_(KSPIBCGS)
 *     QMRCGS     = S_(KSPQMRCGS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPBCGS); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BCGS, __pyx_t_14) < (0)) __PYX_ERR(49, 196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":197
 *     TCQMR      = S_(KSPTCQMR)
 *     BCGS       = S_(KSPBCGS)
 *     IBCGS      = S_(KSPIBCGS)             # <<<<<<<<<<<<<<
 *     QMRCGS     = S_(KSPQMRCGS)
 *     FBCGS      = S_(KSPFBCGS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPIBCGS); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_IBCGS, __pyx_t_14) < (0)) __PYX_ERR(49, 197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":198
 *     BCGS       = S_(KSPBCGS)
 *     IBCGS      = S_(KSPIBCGS)
 *     QMRCGS     = S_(KSPQMRCGS)             # <<<<<<<<<<<<<<
 *     FBCGS      = S_(KSPFBCGS)
 *     FBCGSR     = S_(KSPFBCGSR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPQMRCGS); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QMRCGS, __pyx_t_14) < (0)) __PYX_ERR(49, 198, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":199
 *     IBCGS      = S_(KSPIBCGS)
 *     QMRCGS     = S_(KSPQMRCGS)
 *     FBCGS      = S_(KSPFBCGS)             # <<<<<<<<<<<<<<
 *     FBCGSR     = S_(KSPFBCGSR)
 *     BCGSL      = S_(KSPBCGSL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPFBCGS); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FBCGS, __pyx_t_14) < (0)) __PYX_ERR(49, 199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":200
 *     QMRCGS     = S_(KSPQMRCGS)
 *     FBCGS      = S_(KSPFBCGS)
 *     FBCGSR     = S_(KSPFBCGSR)             # <<<<<<<<<<<<<<
 *     BCGSL      = S_(KSPBCGSL)
 *     PIPEBCGS   = S_(KSPPIPEBCGS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPFBCGSR); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FBCGSR, __pyx_t_14) < (0)) __PYX_ERR(49, 200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":201
 *     FBCGS      = S_(KSPFBCGS)
 *     FBCGSR     = S_(KSPFBCGSR)
 *     BCGSL      = S_(KSPBCGSL)             # <<<<<<<<<<<<<<
 *     PIPEBCGS   = S_(KSPPIPEBCGS)
 *     CGS        = S_(KSPCGS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPBCGSL); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BCGSL, __pyx_t_14) < (0)) __PYX_ERR(49, 201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":202
 *     FBCGSR     = S_(KSPFBCGSR)
 *     BCGSL      = S_(KSPBCGSL)
 *     PIPEBCGS   = S_(KSPPIPEBCGS)             # <<<<<<<<<<<<<<
 *     CGS        = S_(KSPCGS)
 *     TFQMR      = S_(KSPTFQMR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPEBCGS); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PIPEBCGS, __pyx_t_14) < (0)) __PYX_ERR(49, 202, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":203
 *     BCGSL      = S_(KSPBCGSL)
 *     PIPEBCGS   = S_(KSPPIPEBCGS)
 *     CGS        = S_(KSPCGS)             # <<<<<<<<<<<<<<
 *     TFQMR      = S_(KSPTFQMR)
 *     CR         = S_(KSPCR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPCGS); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CGS, __pyx_t_14) < (0)) __PYX_ERR(49, 203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":204
 *     PIPEBCGS   = S_(KSPPIPEBCGS)
 *     CGS        = S_(KSPCGS)
 *     TFQMR      = S_(KSPTFQMR)             # <<<<<<<<<<<<<<
 *     CR         = S_(KSPCR)
 *     PIPECR     = S_(KSPPIPECR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPTFQMR); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_TFQMR, __pyx_t_14) < (0)) __PYX_ERR(49, 204, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":205
 *     CGS        = S_(KSPCGS)
 *     TFQMR      = S_(KSPTFQMR)
 *     CR         = S_(KSPCR)             # <<<<<<<<<<<<<<
 *     PIPECR     = S_(KSPPIPECR)
 *     LSQR       = S_(KSPLSQR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPCR); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CR, __pyx_t_14) < (0)) __PYX_ERR(49, 205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":206
 *     TFQMR      = S_(KSPTFQMR)
 *     CR         = S_(KSPCR)
 *     PIPECR     = S_(KSPPIPECR)             # <<<<<<<<<<<<<<
 *     LSQR       = S_(KSPLSQR)
 *     PREONLY    = S_(KSPPREONLY)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPECR); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PIPECR, __pyx_t_14) < (0)) __PYX_ERR(49, 206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":207
 *     CR         = S_(KSPCR)
 *     PIPECR     = S_(KSPPIPECR)
 *     LSQR       = S_(KSPLSQR)             # <<<<<<<<<<<<<<
 *     PREONLY    = S_(KSPPREONLY)
 *     NONE       = S_(KSPNONE)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPLSQR); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LSQR, __pyx_t_14) < (0)) __PYX_ERR(49, 207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":208
 *     PIPECR     = S_(KSPPIPECR)
 *     LSQR       = S_(KSPLSQR)
 *     PREONLY    = S_(KSPPREONLY)             # <<<<<<<<<<<<<<
 *     NONE       = S_(KSPNONE)
 *     QCG        = S_(KSPQCG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPPREONLY); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PREONLY, __pyx_t_14) < (0)) __PYX_ERR(49, 208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":209
 *     LSQR       = S_(KSPLSQR)
 *     PREONLY    = S_(KSPPREONLY)
 *     NONE       = S_(KSPNONE)             # <<<<<<<<<<<<<<
 *     QCG        = S_(KSPQCG)
 *     BICG       = S_(KSPBICG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPNONE); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NONE, __pyx_t_14) < (0)) __PYX_ERR(49, 209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":210
 *     PREONLY    = S_(KSPPREONLY)
 *     NONE       = S_(KSPNONE)
 *     QCG        = S_(KSPQCG)             # <<<<<<<<<<<<<<
 *     BICG       = S_(KSPBICG)
 *     MINRES     = S_(KSPMINRES)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPQCG); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QCG, __pyx_t_14) < (0)) __PYX_ERR(49, 210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":211
 *     NONE       = S_(KSPNONE)
 *     QCG        = S_(KSPQCG)
 *     BICG       = S_(KSPBICG)             # <<<<<<<<<<<<<<
 *     MINRES     = S_(KSPMINRES)
 *     SYMMLQ     = S_(KSPSYMMLQ)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPBICG); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BICG, __pyx_t_14) < (0)) __PYX_ERR(49, 211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":212
 *     QCG        = S_(KSPQCG)
 *     BICG       = S_(KSPBICG)
 *     MINRES     = S_(KSPMINRES)             # <<<<<<<<<<<<<<
 *     SYMMLQ     = S_(KSPSYMMLQ)
 *     LCD        = S_(KSPLCD)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPMINRES); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MINRES, __pyx_t_14) < (0)) __PYX_ERR(49, 212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":213
 *     BICG       = S_(KSPBICG)
 *     MINRES     = S_(KSPMINRES)
 *     SYMMLQ     = S_(KSPSYMMLQ)             # <<<<<<<<<<<<<<
 *     LCD        = S_(KSPLCD)
 *     PYTHON     = S_(KSPPYTHON)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPSYMMLQ); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SYMMLQ, __pyx_t_14) < (0)) __PYX_ERR(49, 213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":214
 *     MINRES     = S_(KSPMINRES)
 *     SYMMLQ     = S_(KSPSYMMLQ)
 *     LCD        = S_(KSPLCD)             # <<<<<<<<<<<<<<
 *     PYTHON     = S_(KSPPYTHON)
 *     GCR        = S_(KSPGCR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPLCD); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LCD, __pyx_t_14) < (0)) __PYX_ERR(49, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":215
 *     SYMMLQ     = S_(KSPSYMMLQ)
 *     LCD        = S_(KSPLCD)
 *     PYTHON     = S_(KSPPYTHON)             # <<<<<<<<<<<<<<
 *     GCR        = S_(KSPGCR)
 *     PIPEGCR    = S_(KSPPIPEGCR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPPYTHON); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PYTHON, __pyx_t_14) < (0)) __PYX_ERR(49, 215, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":216
 *     LCD        = S_(KSPLCD)
 *     PYTHON     = S_(KSPPYTHON)
 *     GCR        = S_(KSPGCR)             # <<<<<<<<<<<<<<
 *     PIPEGCR    = S_(KSPPIPEGCR)
 *     TSIRM      = S_(KSPTSIRM)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPGCR); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_GCR, __pyx_t_14) < (0)) __PYX_ERR(49, 216, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":217
 *     PYTHON     = S_(KSPPYTHON)
 *     GCR        = S_(KSPGCR)
 *     PIPEGCR    = S_(KSPPIPEGCR)             # <<<<<<<<<<<<<<
 *     TSIRM      = S_(KSPTSIRM)
 *     CGLS       = S_(KSPCGLS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPPIPEGCR); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PIPEGCR, __pyx_t_14) < (0)) __PYX_ERR(49, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":218
 *     GCR        = S_(KSPGCR)
 *     PIPEGCR    = S_(KSPPIPEGCR)
 *     TSIRM      = S_(KSPTSIRM)             # <<<<<<<<<<<<<<
 *     CGLS       = S_(KSPCGLS)
 *     FETIDP     = S_(KSPFETIDP)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPTSIRM); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_TSIRM, __pyx_t_14) < (0)) __PYX_ERR(49, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":219
 *     PIPEGCR    = S_(KSPPIPEGCR)
 *     TSIRM      = S_(KSPTSIRM)
 *     CGLS       = S_(KSPCGLS)             # <<<<<<<<<<<<<<
 *     FETIDP     = S_(KSPFETIDP)
 *     HPDDM      = S_(KSPHPDDM)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPCGLS); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CGLS, __pyx_t_14) < (0)) __PYX_ERR(49, 219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":220
 *     TSIRM      = S_(KSPTSIRM)
 *     CGLS       = S_(KSPCGLS)
 *     FETIDP     = S_(KSPFETIDP)             # <<<<<<<<<<<<<<
 *     HPDDM      = S_(KSPHPDDM)
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPFETIDP); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FETIDP, __pyx_t_14) < (0)) __PYX_ERR(49, 220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":221
 *     CGLS       = S_(KSPCGLS)
 *     FETIDP     = S_(KSPFETIDP)
 *     HPDDM      = S_(KSPHPDDM)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(KSPHPDDM); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_HPDDM, __pyx_t_14) < (0)) __PYX_ERR(49, 221, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class KSPType(object):             # <<<<<<<<<<<<<<
 *     """KSP Type.
 * 
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_KSPType, __pyx_t_4, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_KSPType, __pyx_t_14) < (0)) __PYX_ERR(49, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __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;

  /* "petsc4py/PETSc/KSP.pyx":224
 * 
 * 
 * class KSPNormType(object):             # <<<<<<<<<<<<<<
 *     """KSP norm type.
 * 
*/
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[123]); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_KSPNormType, __pyx_mstate_global->__pyx_n_u_KSPNormType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_KSP_norm_type_The_available_norm); if (unlikely(!__pyx_t_10)) __PYX_ERR(49, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[123]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[123]) < 0))) __PYX_ERR(49, 224, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/KSP.pyx":247
 *     """
 *     # native
 *     NORM_DEFAULT          = KSP_NORM_DEFAULT             # <<<<<<<<<<<<<<
 *     NORM_NONE             = KSP_NORM_NONE
 *     NORM_PRECONDITIONED   = KSP_NORM_PRECONDITIONED
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPNormType(KSP_NORM_DEFAULT); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_DEFAULT, __pyx_t_14) < (0)) __PYX_ERR(49, 247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":248
 *     # native
 *     NORM_DEFAULT          = KSP_NORM_DEFAULT
 *     NORM_NONE             = KSP_NORM_NONE             # <<<<<<<<<<<<<<
 *     NORM_PRECONDITIONED   = KSP_NORM_PRECONDITIONED
 *     NORM_UNPRECONDITIONED = KSP_NORM_UNPRECONDITIONED
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPNormType(KSP_NORM_NONE); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_NONE, __pyx_t_14) < (0)) __PYX_ERR(49, 248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":249
 *     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_14 = __Pyx_PyLong_From_KSPNormType(KSP_NORM_PRECONDITIONED); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_PRECONDITIONED, __pyx_t_14) < (0)) __PYX_ERR(49, 249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":250
 *     NORM_NONE             = KSP_NORM_NONE
 *     NORM_PRECONDITIONED   = KSP_NORM_PRECONDITIONED
 *     NORM_UNPRECONDITIONED = KSP_NORM_UNPRECONDITIONED             # <<<<<<<<<<<<<<
 *     NORM_NATURAL          = KSP_NORM_NATURAL
 *     # aliases
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPNormType(KSP_NORM_UNPRECONDITIONED); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_UNPRECONDITIONED, __pyx_t_14) < (0)) __PYX_ERR(49, 250, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":251
 *     NORM_PRECONDITIONED   = KSP_NORM_PRECONDITIONED
 *     NORM_UNPRECONDITIONED = KSP_NORM_UNPRECONDITIONED
 *     NORM_NATURAL          = KSP_NORM_NATURAL             # <<<<<<<<<<<<<<
 *     # aliases
 *     DEFAULT          = NORM_DEFAULT
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPNormType(KSP_NORM_NATURAL); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_NATURAL, __pyx_t_14) < (0)) __PYX_ERR(49, 251, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":253
 *     NORM_NATURAL          = KSP_NORM_NATURAL
 *     # aliases
 *     DEFAULT          = NORM_DEFAULT             # <<<<<<<<<<<<<<
 *     NONE = NO        = NORM_NONE
 *     PRECONDITIONED   = NORM_PRECONDITIONED
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_DEFAULT);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_NORM_DEFAULT);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT, __pyx_t_14) < (0)) __PYX_ERR(49, 253, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":254
 *     # aliases
 *     DEFAULT          = NORM_DEFAULT
 *     NONE = NO        = NORM_NONE             # <<<<<<<<<<<<<<
 *     PRECONDITIONED   = NORM_PRECONDITIONED
 *     UNPRECONDITIONED = NORM_UNPRECONDITIONED
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_NONE);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_NORM_NONE);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NONE, __pyx_t_14) < (0)) __PYX_ERR(49, 254, __pyx_L1_error)
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NO, __pyx_t_14) < (0)) __PYX_ERR(49, 254, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":255
 *     DEFAULT          = NORM_DEFAULT
 *     NONE = NO        = NORM_NONE
 *     PRECONDITIONED   = NORM_PRECONDITIONED             # <<<<<<<<<<<<<<
 *     UNPRECONDITIONED = NORM_UNPRECONDITIONED
 *     NATURAL          = NORM_NATURAL
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_PRECONDITIONED);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_NORM_PRECONDITIONED);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PRECONDITIONED, __pyx_t_14) < (0)) __PYX_ERR(49, 255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":256
 *     NONE = NO        = NORM_NONE
 *     PRECONDITIONED   = NORM_PRECONDITIONED
 *     UNPRECONDITIONED = NORM_UNPRECONDITIONED             # <<<<<<<<<<<<<<
 *     NATURAL          = NORM_NATURAL
 * 
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_UNPRECONDITIONED);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_NORM_UNPRECONDITIONED);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_UNPRECONDITIONED, __pyx_t_14) < (0)) __PYX_ERR(49, 256, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":257
 *     PRECONDITIONED   = NORM_PRECONDITIONED
 *     UNPRECONDITIONED = NORM_UNPRECONDITIONED
 *     NATURAL          = NORM_NATURAL             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_NATURAL);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_NORM_NATURAL);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NATURAL, __pyx_t_14) < (0)) __PYX_ERR(49, 257, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":224
 * 
 * 
 * class KSPNormType(object):             # <<<<<<<<<<<<<<
 *     """KSP norm type.
 * 
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_KSPNormType, __pyx_t_4, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_KSPNormType, __pyx_t_14) < (0)) __PYX_ERR(49, 224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __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;

  /* "petsc4py/PETSc/KSP.pyx":260
 * 
 * 
 * class KSPConvergedReason(object):             # <<<<<<<<<<<<<<
 *     """KSP Converged Reason.
 * 
*/
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[125]); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_KSPConvergedReason, __pyx_mstate_global->__pyx_n_u_KSPConvergedReason, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_KSP_Converged_Reason_CONVERGED_I); if (unlikely(!__pyx_t_10)) __PYX_ERR(49, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[125]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[125]) < 0))) __PYX_ERR(49, 260, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/KSP.pyx":328
 *     """
 *     # iterating
 *     CONVERGED_ITERATING       = KSP_CONVERGED_ITERATING             # <<<<<<<<<<<<<<
 *     ITERATING                 = KSP_CONVERGED_ITERATING
 *     # converged
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_CONVERGED_ITERATING); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CONVERGED_ITERATING, __pyx_t_14) < (0)) __PYX_ERR(49, 328, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":329
 *     # iterating
 *     CONVERGED_ITERATING       = KSP_CONVERGED_ITERATING
 *     ITERATING                 = KSP_CONVERGED_ITERATING             # <<<<<<<<<<<<<<
 *     # converged
 *     CONVERGED_RTOL_NORMAL_EQUATIONS = KSP_CONVERGED_RTOL_NORMAL_EQUATIONS
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_CONVERGED_ITERATING); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ITERATING, __pyx_t_14) < (0)) __PYX_ERR(49, 329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":331
 *     ITERATING                 = KSP_CONVERGED_ITERATING
 *     # converged
 *     CONVERGED_RTOL_NORMAL_EQUATIONS = KSP_CONVERGED_RTOL_NORMAL_EQUATIONS             # <<<<<<<<<<<<<<
 *     CONVERGED_ATOL_NORMAL_EQUATIONS = KSP_CONVERGED_ATOL_NORMAL_EQUATIONS
 *     CONVERGED_RTOL            = KSP_CONVERGED_RTOL
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_CONVERGED_RTOL_NORMAL_EQUATIONS); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CONVERGED_RTOL_NORMAL_EQUATIONS, __pyx_t_14) < (0)) __PYX_ERR(49, 331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":332
 *     # converged
 *     CONVERGED_RTOL_NORMAL_EQUATIONS = KSP_CONVERGED_RTOL_NORMAL_EQUATIONS
 *     CONVERGED_ATOL_NORMAL_EQUATIONS = KSP_CONVERGED_ATOL_NORMAL_EQUATIONS             # <<<<<<<<<<<<<<
 *     CONVERGED_RTOL            = KSP_CONVERGED_RTOL
 *     CONVERGED_ATOL            = KSP_CONVERGED_ATOL
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_CONVERGED_ATOL_NORMAL_EQUATIONS); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CONVERGED_ATOL_NORMAL_EQUATIONS, __pyx_t_14) < (0)) __PYX_ERR(49, 332, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":333
 *     CONVERGED_RTOL_NORMAL_EQUATIONS = KSP_CONVERGED_RTOL_NORMAL_EQUATIONS
 *     CONVERGED_ATOL_NORMAL_EQUATIONS = KSP_CONVERGED_ATOL_NORMAL_EQUATIONS
 *     CONVERGED_RTOL            = KSP_CONVERGED_RTOL             # <<<<<<<<<<<<<<
 *     CONVERGED_ATOL            = KSP_CONVERGED_ATOL
 *     CONVERGED_ITS             = KSP_CONVERGED_ITS
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_CONVERGED_RTOL); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CONVERGED_RTOL, __pyx_t_14) < (0)) __PYX_ERR(49, 333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":334
 *     CONVERGED_ATOL_NORMAL_EQUATIONS = KSP_CONVERGED_ATOL_NORMAL_EQUATIONS
 *     CONVERGED_RTOL            = KSP_CONVERGED_RTOL
 *     CONVERGED_ATOL            = KSP_CONVERGED_ATOL             # <<<<<<<<<<<<<<
 *     CONVERGED_ITS             = KSP_CONVERGED_ITS
 *     CONVERGED_NEG_CURVE       = KSP_CONVERGED_NEG_CURVE
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_CONVERGED_ATOL); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CONVERGED_ATOL, __pyx_t_14) < (0)) __PYX_ERR(49, 334, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":335
 *     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_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_CONVERGED_ITS); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CONVERGED_ITS, __pyx_t_14) < (0)) __PYX_ERR(49, 335, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":336
 *     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_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_CONVERGED_NEG_CURVE); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CONVERGED_NEG_CURVE, __pyx_t_14) < (0)) __PYX_ERR(49, 336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":337
 *     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_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_CONVERGED_STEP_LENGTH); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CONVERGED_STEP_LENGTH, __pyx_t_14) < (0)) __PYX_ERR(49, 337, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":338
 *     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_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_CONVERGED_HAPPY_BREAKDOWN); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CONVERGED_HAPPY_BREAKDOWN, __pyx_t_14) < (0)) __PYX_ERR(49, 338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":340
 *     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_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_DIVERGED_NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_NULL, __pyx_t_14) < (0)) __PYX_ERR(49, 340, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":341
 *     # 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_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_DIVERGED_ITS); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_MAX_IT, __pyx_t_14) < (0)) __PYX_ERR(49, 341, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":342
 *     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_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_DIVERGED_DTOL); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_DTOL, __pyx_t_14) < (0)) __PYX_ERR(49, 342, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":343
 *     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_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_DIVERGED_BREAKDOWN); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_BREAKDOWN, __pyx_t_14) < (0)) __PYX_ERR(49, 343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":344
 *     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_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_DIVERGED_BREAKDOWN_BICG); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_BREAKDOWN_BICG, __pyx_t_14) < (0)) __PYX_ERR(49, 344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":345
 *     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_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_DIVERGED_NONSYMMETRIC); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_NONSYMMETRIC, __pyx_t_14) < (0)) __PYX_ERR(49, 345, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":346
 *     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_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_DIVERGED_INDEFINITE_PC); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_INDEFINITE_PC, __pyx_t_14) < (0)) __PYX_ERR(49, 346, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":347
 *     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_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_DIVERGED_NANORINF); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_NANORINF, __pyx_t_14) < (0)) __PYX_ERR(49, 347, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":348
 *     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_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_DIVERGED_INDEFINITE_MAT); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_INDEFINITE_MAT, __pyx_t_14) < (0)) __PYX_ERR(49, 348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":349
 *     DIVERGED_NANORINF         = KSP_DIVERGED_NANORINF
 *     DIVERGED_INDEFINITE_MAT   = KSP_DIVERGED_INDEFINITE_MAT
 *     DIVERGED_PCSETUP_FAILED   = KSP_DIVERGED_PC_FAILED             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPConvergedReason(KSP_DIVERGED_PC_FAILED); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_PCSETUP_FAILED, __pyx_t_14) < (0)) __PYX_ERR(49, 349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":260
 * 
 * 
 * class KSPConvergedReason(object):             # <<<<<<<<<<<<<<
 *     """KSP Converged Reason.
 * 
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_KSPConvergedReason, __pyx_t_4, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_KSPConvergedReason, __pyx_t_14) < (0)) __PYX_ERR(49, 260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __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;

  /* "petsc4py/PETSc/KSP.pyx":352
 * 
 * 
 * class KSPHPDDMType(object):             # <<<<<<<<<<<<<<
 *     """The *HPDDM* Krylov solver type."""
 *     GMRES                     = KSP_HPDDM_TYPE_GMRES
*/
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[127]); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_KSPHPDDMType, __pyx_mstate_global->__pyx_n_u_KSPHPDDMType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_HPDDM_Krylov_solver_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(49, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[127]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[127]) < 0))) __PYX_ERR(49, 352, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/KSP.pyx":354
 * 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_14 = __Pyx_PyLong_From_KSPHPDDMType(KSP_HPDDM_TYPE_GMRES); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_GMRES, __pyx_t_14) < (0)) __PYX_ERR(49, 354, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":355
 *     """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_14 = __Pyx_PyLong_From_KSPHPDDMType(KSP_HPDDM_TYPE_BGMRES); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BGMRES, __pyx_t_14) < (0)) __PYX_ERR(49, 355, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":356
 *     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_14 = __Pyx_PyLong_From_KSPHPDDMType(KSP_HPDDM_TYPE_CG); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CG, __pyx_t_14) < (0)) __PYX_ERR(49, 356, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":357
 *     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_14 = __Pyx_PyLong_From_KSPHPDDMType(KSP_HPDDM_TYPE_BCG); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BCG, __pyx_t_14) < (0)) __PYX_ERR(49, 357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":358
 *     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_14 = __Pyx_PyLong_From_KSPHPDDMType(KSP_HPDDM_TYPE_GCRODR); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_GCRODR, __pyx_t_14) < (0)) __PYX_ERR(49, 358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":359
 *     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_14 = __Pyx_PyLong_From_KSPHPDDMType(KSP_HPDDM_TYPE_BGCRODR); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BGCRODR, __pyx_t_14) < (0)) __PYX_ERR(49, 359, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":360
 *     GCRODR                    = KSP_HPDDM_TYPE_GCRODR
 *     BGCRODR                   = KSP_HPDDM_TYPE_BGCRODR
 *     BFBCG                     = KSP_HPDDM_TYPE_BFBCG             # <<<<<<<<<<<<<<
 *     PREONLY                   = KSP_HPDDM_TYPE_PREONLY
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPHPDDMType(KSP_HPDDM_TYPE_BFBCG); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BFBCG, __pyx_t_14) < (0)) __PYX_ERR(49, 360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":361
 *     BGCRODR                   = KSP_HPDDM_TYPE_BGCRODR
 *     BFBCG                     = KSP_HPDDM_TYPE_BFBCG
 *     PREONLY                   = KSP_HPDDM_TYPE_PREONLY             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPHPDDMType(KSP_HPDDM_TYPE_PREONLY); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PREONLY, __pyx_t_14) < (0)) __PYX_ERR(49, 361, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":352
 * 
 * 
 * class KSPHPDDMType(object):             # <<<<<<<<<<<<<<
 *     """The *HPDDM* Krylov solver type."""
 *     GMRES                     = KSP_HPDDM_TYPE_GMRES
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_KSPHPDDMType, __pyx_t_4, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_KSPHPDDMType, __pyx_t_14) < (0)) __PYX_ERR(49, 352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __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;

  /* "petsc4py/PETSc/KSP.pyx":364
 * 
 * 
 * class KSPDMActive(object):             # <<<<<<<<<<<<<<
 *     """Argument to KSPSetDMActive()."""
 *     OPERATOR      = KSP_DMACTIVE_OPERATOR
*/
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[129]); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_KSPDMActive, __pyx_mstate_global->__pyx_n_u_KSPDMActive, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Argument_to_KSPSetDMActive); if (unlikely(!__pyx_t_10)) __PYX_ERR(49, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[129]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[129]) < 0))) __PYX_ERR(49, 364, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/KSP.pyx":366
 * class KSPDMActive(object):
 *     """Argument to KSPSetDMActive()."""
 *     OPERATOR      = KSP_DMACTIVE_OPERATOR             # <<<<<<<<<<<<<<
 *     RHS           = KSP_DMACTIVE_RHS
 *     INITIAL_GUESS = KSP_DMACTIVE_INITIAL_GUESS
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPDMActive(KSP_DMACTIVE_OPERATOR); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_OPERATOR, __pyx_t_14) < (0)) __PYX_ERR(49, 366, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":367
 *     """Argument to KSPSetDMActive()."""
 *     OPERATOR      = KSP_DMACTIVE_OPERATOR
 *     RHS           = KSP_DMACTIVE_RHS             # <<<<<<<<<<<<<<
 *     INITIAL_GUESS = KSP_DMACTIVE_INITIAL_GUESS
 *     ALL           = KSP_DMACTIVE_ALL
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPDMActive(KSP_DMACTIVE_RHS); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RHS, __pyx_t_14) < (0)) __PYX_ERR(49, 367, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":368
 *     OPERATOR      = KSP_DMACTIVE_OPERATOR
 *     RHS           = KSP_DMACTIVE_RHS
 *     INITIAL_GUESS = KSP_DMACTIVE_INITIAL_GUESS             # <<<<<<<<<<<<<<
 *     ALL           = KSP_DMACTIVE_ALL
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPDMActive(KSP_DMACTIVE_INITIAL_GUESS); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INITIAL_GUESS, __pyx_t_14) < (0)) __PYX_ERR(49, 368, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":369
 *     RHS           = KSP_DMACTIVE_RHS
 *     INITIAL_GUESS = KSP_DMACTIVE_INITIAL_GUESS
 *     ALL           = KSP_DMACTIVE_ALL             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_KSPDMActive(KSP_DMACTIVE_ALL); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ALL, __pyx_t_14) < (0)) __PYX_ERR(49, 369, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/KSP.pyx":364
 * 
 * 
 * class KSPDMActive(object):             # <<<<<<<<<<<<<<
 *     """Argument to KSPSetDMActive()."""
 *     OPERATOR      = KSP_DMACTIVE_OPERATOR
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_KSPDMActive, __pyx_t_4, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(49, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_KSPDMActive, __pyx_t_14) < (0)) __PYX_ERR(49, 364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __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;

  /* "petsc4py/PETSc/KSP.pyx":395
 *     """
 * 
 *     Type            = KSPType             # <<<<<<<<<<<<<<
 *     NormType        = KSPNormType
 *     ConvergedReason = KSPConvergedReason
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_KSPType); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_4) < (0)) __PYX_ERR(49, 395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":396
 * 
 *     Type            = KSPType
 *     NormType        = KSPNormType             # <<<<<<<<<<<<<<
 *     ConvergedReason = KSPConvergedReason
 *     HPDDMType       = KSPHPDDMType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_KSPNormType); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_NormType, __pyx_t_4) < (0)) __PYX_ERR(49, 396, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":397
 *     Type            = KSPType
 *     NormType        = KSPNormType
 *     ConvergedReason = KSPConvergedReason             # <<<<<<<<<<<<<<
 *     HPDDMType       = KSPHPDDMType
 *     DMActive        = KSPDMActive
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_KSPConvergedReason); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_ConvergedReason, __pyx_t_4) < (0)) __PYX_ERR(49, 397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":398
 *     NormType        = KSPNormType
 *     ConvergedReason = KSPConvergedReason
 *     HPDDMType       = KSPHPDDMType             # <<<<<<<<<<<<<<
 *     DMActive        = KSPDMActive
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_KSPHPDDMType); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_HPDDMType, __pyx_t_4) < (0)) __PYX_ERR(49, 398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":399
 *     ConvergedReason = KSPConvergedReason
 *     HPDDMType       = KSPHPDDMType
 *     DMActive        = KSPDMActive             # <<<<<<<<<<<<<<
 * 
 *     # --- xxx ---
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_KSPDMActive); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_DMActive, __pyx_t_4) < (0)) __PYX_ERR(49, 399, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":435
 *     # --- xxx ---
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """Print the KSP data structure.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 435, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_5view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[958])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_5) < (0)) __PYX_ERR(49, 435, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":454
 *         CHKERR(KSPView(self.ksp, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy KSP context.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(49, 454, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_7destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[959])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_4) < (0)) __PYX_ERR(49, 454, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":467
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create the KSP context.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(49, 467, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(49, 467, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_9create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[960])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_5) < (0)) __PYX_ERR(49, 467, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":483
 *         return self
 * 
 *     def setType(self, ksp_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Build the `KSP` data structure for a particular `Type`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ksp_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(49, 483, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 483, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_11setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[961])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_4) < (0)) __PYX_ERR(49, 483, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":519
 *         CHKERR(KSPSetType(self.ksp, cval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the KSP type as a string from the `KSP` object.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(49, 519, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_13getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[962])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_5) < (0)) __PYX_ERR(49, 519, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":533
 *         return bytes2str(cval)
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the prefix used for all `KSP` options in the database.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(49, 533, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 533, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_15setOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[963])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setOptionsPrefix, __pyx_t_4) < (0)) __PYX_ERR(49, 533, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":571
 *         CHKERR(KSPSetOptionsPrefix(self.ksp, cval))
 * 
 *     def getOptionsPrefix(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the prefix used for all `KSP` options in the database.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(49, 571, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_17getOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[964])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getOptionsPrefix, __pyx_t_5) < (0)) __PYX_ERR(49, 571, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":585
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Append to prefix used for all `KSP` options in the database.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(49, 585, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 585, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_19appendOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_appendOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[965])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_appendOptionsPrefix, __pyx_t_4) < (0)) __PYX_ERR(49, 585, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":610
 *         CHKERR(KSPAppendOptionsPrefix(self.ksp, cval))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set `KSP` options from the options database.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 610, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_21setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[966])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_5) < (0)) __PYX_ERR(49, 610, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":627
 *     # --- application context ---
 * 
 *     def setAppCtx(self, appctx: Any) -> None:             # <<<<<<<<<<<<<<
 *         """Set the optional user-defined context for the linear solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_appctx, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(49, 627, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 627, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_23setAppCtx, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setAppCtx, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[967])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setAppCtx, __pyx_t_4) < (0)) __PYX_ERR(49, 627, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":650
 *         self.set_attr('__appctx__', appctx)
 * 
 *     def getAppCtx(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return the user-defined context for the linear solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(49, 650, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_25getAppCtx, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getAppCtx, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[968])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getAppCtx, __pyx_t_5) < (0)) __PYX_ERR(49, 650, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":664
 *     # --- discretization space ---
 * 
 *     def getDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the `DM` that may be used by some preconditioners.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(49, 664, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_27getDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[969])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getDM, __pyx_t_4) < (0)) __PYX_ERR(49, 664, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":681
 *         return dm
 * 
 *     def setDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `DM` that may be used by some preconditioners.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 681, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_29setDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[970])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setDM, __pyx_t_5) < (0)) __PYX_ERR(49, 681, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":715
 *         CHKERR(KSPSetDM(self.ksp, dm.dm))
 * 
 *     def setDMActive(self, dmactive: DMActive, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """`DM` should be used to generate system matrix & RHS vector.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_dmactive, __pyx_mstate_global->__pyx_n_u_DMActive) < (0)) __PYX_ERR(49, 715, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(49, 715, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 715, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_31setDMActive, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setDMActive, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[971])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setDMActive, __pyx_t_4) < (0)) __PYX_ERR(49, 715, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":741
 *     # --- operators and preconditioner ---
 * 
 *     def setComputeRHS(             # <<<<<<<<<<<<<<
 *         self,
 *         rhs: KSPRHSFunction,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_rhs, __pyx_mstate_global->__pyx_n_u_KSPRHSFunction) < (0)) __PYX_ERR(49, 741, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(49, 741, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(49, 741, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 741, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_33setComputeRHS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setComputeRHS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[972])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setComputeRHS, __pyx_t_5) < (0)) __PYX_ERR(49, 741, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":775
 *         CHKERR(KSPSetComputeRHS(self.ksp, KSP_ComputeRHS, <void*>context))
 * 
 *     def setComputeOperators(             # <<<<<<<<<<<<<<
 *         self,
 *         operators: KSPOperatorsFunction,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_operators, __pyx_mstate_global->__pyx_n_u_KSPOperatorsFunction) < (0)) __PYX_ERR(49, 775, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(49, 775, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(49, 775, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 775, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_35setComputeOperators, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setComputeOperators, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[973])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setComputeOperators, __pyx_t_4) < (0)) __PYX_ERR(49, 775, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":820
 *         CHKERR(KSPSetComputeOperators(self.ksp, KSP_ComputeOps, <void*>context))
 * 
 *     def setOperators(self, Mat A=None, Mat P=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set matrix associated with the linear system.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 820, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_37setOperators, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setOperators, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[974])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setOperators, __pyx_t_5) < (0)) __PYX_ERR(49, 820, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":864
 *         CHKERR(KSPSetOperators(self.ksp, amat, pmat))
 * 
 *     def getOperators(self) -> tuple[Mat, Mat]:             # <<<<<<<<<<<<<<
 *         """Return the matrix associated with the linear system.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Mat_Mat) < (0)) __PYX_ERR(49, 864, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_39getOperators, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getOperators, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[975])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getOperators, __pyx_t_4) < (0)) __PYX_ERR(49, 864, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":891
 *         return (A, P)
 * 
 *     def setPC(self, PC pc) -> None:             # <<<<<<<<<<<<<<
 *         """Set the preconditioner.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 891, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_41setPC, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setPC, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[976])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setPC, __pyx_t_5) < (0)) __PYX_ERR(49, 891, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":911
 *         CHKERR(KSPSetPC(self.ksp, pc.pc))
 * 
 *     def getPC(self) -> PC:             # <<<<<<<<<<<<<<
 *         """Return the preconditioner.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_PC) < (0)) __PYX_ERR(49, 911, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_43getPC, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getPC, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[977])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getPC, __pyx_t_4) < (0)) __PYX_ERR(49, 911, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":928
 *     # --- tolerances and convergence ---
 * 
 *     def setTolerances(             # <<<<<<<<<<<<<<
 *         self,
 *         rtol: float | None = None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_rtol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(49, 928, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_atol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(49, 928, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_divtol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(49, 928, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_max_it, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(49, 928, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 928, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_45setTolerances, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setTolerances, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[978])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setTolerances, __pyx_t_5) < (0)) __PYX_ERR(49, 928, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":985
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_float_float_int) < (0)) __PYX_ERR(49, 985, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_47getTolerances, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getTolerances, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[979])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getTolerances, __pyx_t_4) < (0)) __PYX_ERR(49, 985, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1014
 *         return (toReal(crtol), toReal(catol), toReal(cdivtol), toInt(cmaxits))
 * 
 *     def setConvergenceTest(             # <<<<<<<<<<<<<<
 *         self,
 *         converged: KSPConvergenceTestFunction,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_converged, __pyx_mstate_global->__pyx_n_u_KSPConvergenceTestFunction) < (0)) __PYX_ERR(49, 1014, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(49, 1014, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(49, 1014, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1014, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_49setConvergenceTest, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setConvergenceTest, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[980])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setConvergenceTest, __pyx_t_5) < (0)) __PYX_ERR(49, 1014, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1079
 *             self.set_attr('__converged__', None)
 * 
 *     def addConvergenceTest(             # <<<<<<<<<<<<<<
 *         self,
 *         converged: KSPConvergenceTestFunction,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_converged, __pyx_mstate_global->__pyx_n_u_KSPConvergenceTestFunction) < (0)) __PYX_ERR(49, 1079, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(49, 1079, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(49, 1079, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_prepend, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(49, 1079, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1079, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_51addConvergenceTest, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_addConvergenceTest, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[981])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[130]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_addConvergenceTest, __pyx_t_4) < (0)) __PYX_ERR(49, 1079, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1122
 *         self.set_attr('__converged__', (converged, args, kargs))
 * 
 *     def getConvergenceTest(self) -> KSPConvergenceTestFunction:             # <<<<<<<<<<<<<<
 *         """Return the function to be used to determine convergence.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_KSPConvergenceTestFunction) < (0)) __PYX_ERR(49, 1122, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_53getConvergenceTest, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getConvergenceTest, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[982])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getConvergenceTest, __pyx_t_5) < (0)) __PYX_ERR(49, 1122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1135
 *         return self.get_attr('__converged__')
 * 
 *     def callConvergenceTest(self, its: int, rnorm: float) -> None:             # <<<<<<<<<<<<<<
 *         """Call the convergence test callback.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_its, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(49, 1135, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_rnorm, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(49, 1135, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1135, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_55callConvergenceTest, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_callConvergenceTest, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[983])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_callConvergenceTest, __pyx_t_4) < (0)) __PYX_ERR(49, 1135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1158
 *         return reason
 * 
 *     def setConvergenceHistory(             # <<<<<<<<<<<<<<
 *         self,
 *         length: int | None = None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_length, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(49, 1158, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_reset, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(49, 1158, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1158, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_57setConvergenceHistory, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setConvergenceHistory, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[984])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[131]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setConvergenceHistory, __pyx_t_5) < (0)) __PYX_ERR(49, 1158, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1202
 *         CHKERR(KSPSetResidualHistory(self.ksp, data, size, flag))
 * 
 *     def getConvergenceHistory(self) -> ArrayReal:             # <<<<<<<<<<<<<<
 *         """Return array containing the residual history.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayReal) < (0)) __PYX_ERR(49, 1202, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_59getConvergenceHistory, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getConvergenceHistory, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[985])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getConvergenceHistory, __pyx_t_4) < (0)) __PYX_ERR(49, 1202, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1217
 *         return array_r(size, data)
 * 
 *     def logConvergenceHistory(self, rnorm: float) -> None:             # <<<<<<<<<<<<<<
 *         """Add residual to convergence history.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_rnorm, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(49, 1217, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1217, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_61logConvergenceHistory, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_logConvergenceHistory, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[986])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_logConvergenceHistory, __pyx_t_5) < (0)) __PYX_ERR(49, 1217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1233
 *     # --- monitoring ---
 * 
 *     def setMonitor(self,             # <<<<<<<<<<<<<<
 *                    monitor: KSPMonitorFunction,
 *                    args: tuple[Any, ...] | None = None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_monitor, __pyx_mstate_global->__pyx_n_u_KSPMonitorFunction) < (0)) __PYX_ERR(49, 1233, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(49, 1233, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(49, 1233, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1233, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_63setMonitor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setMonitor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[987])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setMonitor, __pyx_t_4) < (0)) __PYX_ERR(49, 1233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1280
 *         monitorlist.append((monitor, args, kargs))
 * 
 *     def getMonitor(self) -> KSPMonitorFunction:             # <<<<<<<<<<<<<<
 *         """Return function used to monitor the residual.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_KSPMonitorFunction) < (0)) __PYX_ERR(49, 1280, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_65getMonitor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getMonitor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[988])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getMonitor, __pyx_t_5) < (0)) __PYX_ERR(49, 1280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1293
 *         return self.get_attr('__monitor__')
 * 
 *     def monitorCancel(self) -> None:             # <<<<<<<<<<<<<<
 *         """Clear all monitors for a `KSP` object.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1293, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_67monitorCancel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_monitorCancel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[989])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_monitorCancel, __pyx_t_4) < (0)) __PYX_ERR(49, 1293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1306
 *         self.set_attr('__monitor__', None)
 * 
 *     cancelMonitor = monitorCancel             # <<<<<<<<<<<<<<
 * 
 *     def monitor(self, its: int, rnorm: float) -> None:
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_monitorCancel); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_cancelMonitor, __pyx_t_4) < (0)) __PYX_ERR(49, 1306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1308
 *     cancelMonitor = monitorCancel
 * 
 *     def monitor(self, its: int, rnorm: float) -> None:             # <<<<<<<<<<<<<<
 *         """Run the user provided monitor routines, if they exist.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_its, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(49, 1308, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_rnorm, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(49, 1308, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1308, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_69monitor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_monitor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[990])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_monitor, __pyx_t_5) < (0)) __PYX_ERR(49, 1308, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1329
 *     # --- customization ---
 * 
 *     def setPCSide(self, side: PC.Side) -> None:             # <<<<<<<<<<<<<<
 *         """Set the preconditioning side.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_side, __pyx_mstate_global->__pyx_kp_u_PC_Side) < (0)) __PYX_ERR(49, 1329, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1329, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_71setPCSide, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setPCSide, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[991])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setPCSide, __pyx_t_4) < (0)) __PYX_ERR(49, 1329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1363
 *         CHKERR(KSPSetPCSide(self.ksp, side))
 * 
 *     def getPCSide(self) -> PC.Side:             # <<<<<<<<<<<<<<
 *         """Return the preconditioning side.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_PC_Side) < (0)) __PYX_ERR(49, 1363, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_73getPCSide, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getPCSide, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[992])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getPCSide, __pyx_t_5) < (0)) __PYX_ERR(49, 1363, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1377
 *         return side
 * 
 *     def setNormType(self, normtype: NormType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the norm that is used for convergence testing.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_normtype, __pyx_mstate_global->__pyx_n_u_NormType) < (0)) __PYX_ERR(49, 1377, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1377, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_75setNormType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setNormType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[993])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setNormType, __pyx_t_4) < (0)) __PYX_ERR(49, 1377, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1404
 *         CHKERR(KSPSetNormType(self.ksp, normtype))
 * 
 *     def getNormType(self) -> NormType:             # <<<<<<<<<<<<<<
 *         """Return the norm that is used for convergence testing.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_NormType) < (0)) __PYX_ERR(49, 1404, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_77getNormType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getNormType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[994])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getNormType, __pyx_t_5) < (0)) __PYX_ERR(49, 1404, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1418
 *         return normtype
 * 
 *     def setComputeEigenvalues(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set a flag to compute eigenvalues.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(49, 1418, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1418, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_79setComputeEigenvalues, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setComputeEigenvalues, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[995])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setComputeEigenvalues, __pyx_t_4) < (0)) __PYX_ERR(49, 1418, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1444
 *         CHKERR(KSPSetComputeEigenvalues(self.ksp, compute))
 * 
 *     def getComputeEigenvalues(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return flag indicating whether eigenvalues will be calculated.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(49, 1444, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_81getComputeEigenvalues, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getComputeEigenvalues, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[996])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getComputeEigenvalues, __pyx_t_5) < (0)) __PYX_ERR(49, 1444, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1462
 *         return toBool(flag)
 * 
 *     def setComputeSingularValues(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set flag to calculate singular values.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(49, 1462, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1462, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_83setComputeSingularValues, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setComputeSingularValues, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[997])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setComputeSingularValues, __pyx_t_4) < (0)) __PYX_ERR(49, 1462, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1488
 *         CHKERR(KSPSetComputeSingularValues(self.ksp, compute))
 * 
 *     def getComputeSingularValues(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return flag indicating whether singular values will be calculated.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(49, 1488, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_85getComputeSingularValues, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getComputeSingularValues, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[998])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getComputeSingularValues, __pyx_t_5) < (0)) __PYX_ERR(49, 1488, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1508
 *     # --- initial guess ---
 * 
 *     def setInitialGuessNonzero(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Tell the iterative solver that the initial guess is nonzero.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(49, 1508, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1508, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_87setInitialGuessNonzero, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setInitialGuessNonzero, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[999])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setInitialGuessNonzero, __pyx_t_4) < (0)) __PYX_ERR(49, 1508, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1530
 *         CHKERR(KSPSetInitialGuessNonzero(self.ksp, guess_nonzero))
 * 
 *     def getInitialGuessNonzero(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Determine whether the KSP solver uses a zero initial guess.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(49, 1530, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_89getInitialGuessNonzero, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getInitialGuessNonzero, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1000])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getInitialGuessNonzero, __pyx_t_5) < (0)) __PYX_ERR(49, 1530, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1544
 *         return toBool(flag)
 * 
 *     def setInitialGuessKnoll(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Tell solver to use `PC.apply` to compute the initial guess.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(49, 1544, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1544, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_91setInitialGuessKnoll, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setInitialGuessKnoll, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1001])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setInitialGuessKnoll, __pyx_t_4) < (0)) __PYX_ERR(49, 1544, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1564
 *         CHKERR(KSPSetInitialGuessKnoll(self.ksp, guess_knoll))
 * 
 *     def getInitialGuessKnoll(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Determine whether the KSP solver is using the Knoll trick.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(49, 1564, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_93getInitialGuessKnoll, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getInitialGuessKnoll, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1002])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getInitialGuessKnoll, __pyx_t_5) < (0)) __PYX_ERR(49, 1564, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1581
 *         return toBool(flag)
 * 
 *     def setUseFischerGuess(self, model: int, size: int) -> None:             # <<<<<<<<<<<<<<
 *         """Use the Paul Fischer algorithm to compute initial guesses.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_model, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(49, 1581, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(49, 1581, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1581, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_95setUseFischerGuess, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setUseFischerGuess, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1003])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setUseFischerGuess, __pyx_t_4) < (0)) __PYX_ERR(49, 1581, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1609
 *     # --- solving ---
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up internal data structures for an iterative solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1609, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_97setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1004])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_5) < (0)) __PYX_ERR(49, 1609, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1621
 *         CHKERR(KSPSetUp(self.ksp))
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         """Resets a KSP context.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1621, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_99reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_reset, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1005])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_4) < (0)) __PYX_ERR(49, 1621, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1636
 *         CHKERR(KSPReset(self.ksp))
 * 
 *     def setUpOnBlocks(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the preconditioner for each block in a block method.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1636, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_101setUpOnBlocks, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setUpOnBlocks, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1006])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setUpOnBlocks, __pyx_t_5) < (0)) __PYX_ERR(49, 1636, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1651
 *         CHKERR(KSPSetUpOnBlocks(self.ksp))
 * 
 *     def setPreSolve(             # <<<<<<<<<<<<<<
 *         self,
 *         presolve: KSPPreSolveFunction | None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_presolve, __pyx_mstate_global->__pyx_kp_u_KSPPreSolveFunction_None) < (0)) __PYX_ERR(49, 1651, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(49, 1651, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(49, 1651, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1651, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_103setPreSolve, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setPreSolve, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1007])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setPreSolve, __pyx_t_4) < (0)) __PYX_ERR(49, 1651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1684
 *             CHKERR(KSPSetPreSolve(self.ksp, NULL, NULL))
 * 
 *     def setPostSolve(             # <<<<<<<<<<<<<<
 *         self,
 *         postsolve: KSPPostSolveFunction | None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_postsolve, __pyx_mstate_global->__pyx_kp_u_KSPPostSolveFunction_None) < (0)) __PYX_ERR(49, 1684, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(49, 1684, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(49, 1684, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1684, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_105setPostSolve, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setPostSolve, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1008])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setPostSolve, __pyx_t_5) < (0)) __PYX_ERR(49, 1684, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1717
 *             CHKERR(KSPSetPostSolve(self.ksp, NULL, NULL))
 * 
 *     def solve(self, Vec b, Vec x) -> None:             # <<<<<<<<<<<<<<
 *         """Solve the linear system.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1717, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_107solve, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_solve, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1009])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_solve, __pyx_t_4) < (0)) __PYX_ERR(49, 1717, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1798
 *         CHKERR(KSPSolve(self.ksp, b_vec, x_vec))
 * 
 *     def solveTranspose(self, Vec b, Vec x) -> None:             # <<<<<<<<<<<<<<
 *         """Solve the transpose of a linear system.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1798, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_109solveTranspose, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_solveTranspose, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1010])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_solveTranspose, __pyx_t_5) < (0)) __PYX_ERR(49, 1798, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1822
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1822, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_111matSolve, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_matSolve, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1011])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_matSolve, __pyx_t_4) < (0)) __PYX_ERR(49, 1822, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1844
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1844, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_113matSolveTranspose, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_matSolveTranspose, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1012])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_matSolveTranspose, __pyx_t_5) < (0)) __PYX_ERR(49, 1844, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1863
 *         CHKERR(KSPMatSolveTranspose(self.ksp, B.mat, X.mat))
 * 
 *     def setIterationNumber(self, its: int) -> None:             # <<<<<<<<<<<<<<
 *         """Use `its` property."""
 *         cdef PetscInt ival = asInt(its)
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_its, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(49, 1863, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1863, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_115setIterationNumber, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setIterationNumber, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1013])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setIterationNumber, __pyx_t_4) < (0)) __PYX_ERR(49, 1863, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1868
 *         CHKERR(KSPSetIterationNumber(self.ksp, ival))
 * 
 *     def getIterationNumber(self) -> int:             # <<<<<<<<<<<<<<
 *         """Use `its` property."""
 *         cdef PetscInt ival = 0
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(49, 1868, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_117getIterationNumber, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getIterationNumber, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1014])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getIterationNumber, __pyx_t_5) < (0)) __PYX_ERR(49, 1868, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1874
 *         return toInt(ival)
 * 
 *     def setResidualNorm(self, rnorm: float) -> None:             # <<<<<<<<<<<<<<
 *         """Use `norm` property."""
 *         cdef PetscReal rval = asReal(rnorm)
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_rnorm, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(49, 1874, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1874, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_119setResidualNorm, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setResidualNorm, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1015])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setResidualNorm, __pyx_t_4) < (0)) __PYX_ERR(49, 1874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1879
 *         CHKERR(KSPSetResidualNorm(self.ksp, rval))
 * 
 *     def getResidualNorm(self) -> float:             # <<<<<<<<<<<<<<
 *         """Use `norm` property."""
 *         cdef PetscReal rval = 0
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(49, 1879, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_121getResidualNorm, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getResidualNorm, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1016])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getResidualNorm, __pyx_t_5) < (0)) __PYX_ERR(49, 1879, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1885
 *         return toReal(rval)
 * 
 *     def setConvergedReason(self, reason: KSP.ConvergedReason) -> None:             # <<<<<<<<<<<<<<
 *         """Use `reason` property."""
 *         cdef PetscKSPConvergedReason val = reason
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_reason, __pyx_mstate_global->__pyx_kp_u_KSP_ConvergedReason) < (0)) __PYX_ERR(49, 1885, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1885, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_123setConvergedReason, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setConvergedReason, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1017])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setConvergedReason, __pyx_t_4) < (0)) __PYX_ERR(49, 1885, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1890
 *         CHKERR(KSPSetConvergedReason(self.ksp, val))
 * 
 *     def getConvergedReason(self) -> KSP.ConvergedReason:             # <<<<<<<<<<<<<<
 *         """Use `reason` property."""
 *         cdef PetscKSPConvergedReason reason = KSP_CONVERGED_ITERATING
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_KSP_ConvergedReason) < (0)) __PYX_ERR(49, 1890, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_125getConvergedReason, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getConvergedReason, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1018])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getConvergedReason, __pyx_t_5) < (0)) __PYX_ERR(49, 1890, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1896
 *         return reason
 * 
 *     def getCGObjectiveValue(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the CG objective function value.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(49, 1896, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_127getCGObjectiveValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getCGObjectiveValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1019])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getCGObjectiveValue, __pyx_t_4) < (0)) __PYX_ERR(49, 1896, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1910
 *         return cval
 * 
 *     def setHPDDMType(self, hpddm_type: HPDDMType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the Krylov solver type.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_hpddm_type, __pyx_mstate_global->__pyx_n_u_HPDDMType) < (0)) __PYX_ERR(49, 1910, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1910, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_129setHPDDMType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setHPDDMType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1020])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setHPDDMType, __pyx_t_5) < (0)) __PYX_ERR(49, 1910, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1928
 *         CHKERR(KSPHPDDMSetType(self.ksp, ctype))
 * 
 *     def getHPDDMType(self) -> HPDDMType:             # <<<<<<<<<<<<<<
 *         """Return the Krylov solver type.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_HPDDMType) < (0)) __PYX_ERR(49, 1928, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_131getHPDDMType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getHPDDMType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1021])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getHPDDMType, __pyx_t_4) < (0)) __PYX_ERR(49, 1928, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1942
 *         return cval
 * 
 *     def setErrorIfNotConverged(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Cause `solve` to generate an error if not converged.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(49, 1942, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 1942, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_133setErrorIfNotConverged, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setErrorIfNotConverged, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1022])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setErrorIfNotConverged, __pyx_t_5) < (0)) __PYX_ERR(49, 1942, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1960
 *         CHKERR(KSPSetErrorIfNotConverged(self.ksp, ernc))
 * 
 *     def getErrorIfNotConverged(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag indicating the solver will error if divergent.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(49, 1960, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_135getErrorIfNotConverged, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getErrorIfNotConverged, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1023])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getErrorIfNotConverged, __pyx_t_4) < (0)) __PYX_ERR(49, 1960, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1974
 *         return toBool(flag)
 * 
 *     def getRhs(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the right-hand side vector for the linear system.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(49, 1974, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_137getRhs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getRhs, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1024])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getRhs, __pyx_t_5) < (0)) __PYX_ERR(49, 1974, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":1989
 *         return vec
 * 
 *     def getSolution(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the solution for the linear system to be solved.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 1989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(49, 1989, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_139getSolution, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1025])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 1989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_4) < (0)) __PYX_ERR(49, 1989, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2007
 *         return vec
 * 
 *     def getWorkVecs(             # <<<<<<<<<<<<<<
 *         self,
 *         right: int | None = None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 2007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_right, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(49, 2007, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_left, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(49, 2007, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_list_Vec_list_Vec_list_Vec) < (0)) __PYX_ERR(49, 2007, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_141getWorkVecs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getWorkVecs, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1026])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 2007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getWorkVecs, __pyx_t_5) < (0)) __PYX_ERR(49, 2007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2055
 *         else:       return None
 * 
 *     def buildSolution(self, Vec x=None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the solution vector.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 2055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(49, 2055, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_143buildSolution, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_buildSolution, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1027])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 2055, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_buildSolution, __pyx_t_4) < (0)) __PYX_ERR(49, 2055, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2077
 *         return x
 * 
 *     def buildResidual(self, Vec r=None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the residual of the linear system.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 2077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(49, 2077, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_145buildResidual, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_buildResidual, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1028])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 2077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_buildResidual, __pyx_t_5) < (0)) __PYX_ERR(49, 2077, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2099
 *         return r
 * 
 *     def computeEigenvalues(self) -> ArrayComplex:             # <<<<<<<<<<<<<<
 *         """Compute the extreme eigenvalues for the preconditioned operator.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 2099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayComplex) < (0)) __PYX_ERR(49, 2099, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_147computeEigenvalues, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_computeEigenvalues, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1029])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 2099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_computeEigenvalues, __pyx_t_4) < (0)) __PYX_ERR(49, 2099, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2122
 *         return eigen
 * 
 *     def computeExtremeSingularValues(self) -> tuple[float, float]:             # <<<<<<<<<<<<<<
 *         """Compute the extreme singular values for the preconditioned operator.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 2122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_float) < (0)) __PYX_ERR(49, 2122, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_149computeExtremeSingularValues, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_computeExtremeSingularValues, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1030])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 2122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_computeExtremeSingularValues, __pyx_t_5) < (0)) __PYX_ERR(49, 2122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2146
 *     # --- GMRES ---
 * 
 *     def setGMRESRestart(self, restart: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set number of iterations at which KSP restarts.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 2146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_restart, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(49, 2146, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 2146, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_151setGMRESRestart, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setGMRESRestart, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1031])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 2146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setGMRESRestart, __pyx_t_4) < (0)) __PYX_ERR(49, 2146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2168
 *     # --- Python ---
 * 
 *     def createPython(             # <<<<<<<<<<<<<<
 *         self,
 *         context: Any = None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 2168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_context, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(49, 2168, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(49, 2168, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(49, 2168, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_153createPython, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_createPython, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1032])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 2168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_createPython, __pyx_t_5) < (0)) __PYX_ERR(49, 2168, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2197
 *         return self
 * 
 *     def setPythonContext(self, context: Any | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the instance of the class implementing Python methods.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 2197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_context, __pyx_mstate_global->__pyx_kp_u_Any_None) < (0)) __PYX_ERR(49, 2197, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 2197, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_155setPythonContext, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setPythonContext, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1033])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 2197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setPythonContext, __pyx_t_4) < (0)) __PYX_ERR(49, 2197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2209
 *         CHKERR(KSPPythonSetContext(self.ksp, <void*>context))
 * 
 *     def getPythonContext(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return the instance of the class implementing Python methods.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 2209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(49, 2209, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_157getPythonContext, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getPythonContext, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1034])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 2209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getPythonContext, __pyx_t_5) < (0)) __PYX_ERR(49, 2209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2224
 *         else: return <object> context
 * 
 *     def setPythonType(self, py_type: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the fully qualified Python name of the class to be used.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 2224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_py_type, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(49, 2224, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(49, 2224, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_159setPythonType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_setPythonType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1035])); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 2224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_setPythonType, __pyx_t_4) < (0)) __PYX_ERR(49, 2224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2239
 *         CHKERR(KSPPythonSetType(self.ksp, cval))
 * 
 *     def getPythonType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the fully qualified Python name of the class used by the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(49, 2239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(49, 2239, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3KSP_161getPythonType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_KSP_getPythonType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1036])); if (unlikely(!__pyx_t_5)) __PYX_ERR(49, 2239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_KSP, __pyx_mstate_global->__pyx_n_u_getPythonType, __pyx_t_5) < (0)) __PYX_ERR(49, 2239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/KSP.pyx":2423
 * # --------------------------------------------------------------------
 * 
 * del KSPType             # <<<<<<<<<<<<<<
 * del KSPNormType
 * del KSPConvergedReason
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_KSPType) < (0)) __PYX_ERR(49, 2423, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2424
 * 
 * del KSPType
 * del KSPNormType             # <<<<<<<<<<<<<<
 * del KSPConvergedReason
 * del KSPHPDDMType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_KSPNormType) < (0)) __PYX_ERR(49, 2424, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2425
 * del KSPType
 * del KSPNormType
 * del KSPConvergedReason             # <<<<<<<<<<<<<<
 * del KSPHPDDMType
 * 
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_KSPConvergedReason) < (0)) __PYX_ERR(49, 2425, __pyx_L1_error)

  /* "petsc4py/PETSc/KSP.pyx":2426
 * del KSPNormType
 * del KSPConvergedReason
 * del KSPHPDDMType             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_KSPHPDDMType) < (0)) __PYX_ERR(49, 2426, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class SNESType(object):             # <<<<<<<<<<<<<<
 *     """SNES solver type.
 * 
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[133]); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_SNESType, __pyx_mstate_global->__pyx_n_u_SNESType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_SNES_solver_type_See_Also_petsc); if (unlikely(!__pyx_t_10)) __PYX_ERR(50, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[133]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[133]) < 0))) __PYX_ERR(50, 3, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/SNES.pyx":11
 * 
 *     """
 *     NEWTONLS         = S_(SNESNEWTONLS)             # <<<<<<<<<<<<<<
 *     NEWTONTR         = S_(SNESNEWTONTR)
 *     NEWTONAL         = S_(SNESNEWTONAL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESNEWTONLS); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NEWTONLS, __pyx_t_14) < (0)) __PYX_ERR(50, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":12
 *     """
 *     NEWTONLS         = S_(SNESNEWTONLS)
 *     NEWTONTR         = S_(SNESNEWTONTR)             # <<<<<<<<<<<<<<
 *     NEWTONAL         = S_(SNESNEWTONAL)
 *     PYTHON           = S_(SNESPYTHON)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESNEWTONTR); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NEWTONTR, __pyx_t_14) < (0)) __PYX_ERR(50, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":13
 *     NEWTONLS         = S_(SNESNEWTONLS)
 *     NEWTONTR         = S_(SNESNEWTONTR)
 *     NEWTONAL         = S_(SNESNEWTONAL)             # <<<<<<<<<<<<<<
 *     PYTHON           = S_(SNESPYTHON)
 *     NRICHARDSON      = S_(SNESNRICHARDSON)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESNEWTONAL); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NEWTONAL, __pyx_t_14) < (0)) __PYX_ERR(50, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":14
 *     NEWTONTR         = S_(SNESNEWTONTR)
 *     NEWTONAL         = S_(SNESNEWTONAL)
 *     PYTHON           = S_(SNESPYTHON)             # <<<<<<<<<<<<<<
 *     NRICHARDSON      = S_(SNESNRICHARDSON)
 *     KSPONLY          = S_(SNESKSPONLY)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESPYTHON); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PYTHON, __pyx_t_14) < (0)) __PYX_ERR(50, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":15
 *     NEWTONAL         = S_(SNESNEWTONAL)
 *     PYTHON           = S_(SNESPYTHON)
 *     NRICHARDSON      = S_(SNESNRICHARDSON)             # <<<<<<<<<<<<<<
 *     KSPONLY          = S_(SNESKSPONLY)
 *     KSPTRANSPOSEONLY = S_(SNESKSPTRANSPOSEONLY)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESNRICHARDSON); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NRICHARDSON, __pyx_t_14) < (0)) __PYX_ERR(50, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":16
 *     PYTHON           = S_(SNESPYTHON)
 *     NRICHARDSON      = S_(SNESNRICHARDSON)
 *     KSPONLY          = S_(SNESKSPONLY)             # <<<<<<<<<<<<<<
 *     KSPTRANSPOSEONLY = S_(SNESKSPTRANSPOSEONLY)
 *     VINEWTONRSLS     = S_(SNESVINEWTONRSLS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESKSPONLY); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_KSPONLY, __pyx_t_14) < (0)) __PYX_ERR(50, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":17
 *     NRICHARDSON      = S_(SNESNRICHARDSON)
 *     KSPONLY          = S_(SNESKSPONLY)
 *     KSPTRANSPOSEONLY = S_(SNESKSPTRANSPOSEONLY)             # <<<<<<<<<<<<<<
 *     VINEWTONRSLS     = S_(SNESVINEWTONRSLS)
 *     VINEWTONSSLS     = S_(SNESVINEWTONSSLS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESKSPTRANSPOSEONLY); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_KSPTRANSPOSEONLY, __pyx_t_14) < (0)) __PYX_ERR(50, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":18
 *     KSPONLY          = S_(SNESKSPONLY)
 *     KSPTRANSPOSEONLY = S_(SNESKSPTRANSPOSEONLY)
 *     VINEWTONRSLS     = S_(SNESVINEWTONRSLS)             # <<<<<<<<<<<<<<
 *     VINEWTONSSLS     = S_(SNESVINEWTONSSLS)
 *     NGMRES           = S_(SNESNGMRES)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESVINEWTONRSLS); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_VINEWTONRSLS, __pyx_t_14) < (0)) __PYX_ERR(50, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":19
 *     KSPTRANSPOSEONLY = S_(SNESKSPTRANSPOSEONLY)
 *     VINEWTONRSLS     = S_(SNESVINEWTONRSLS)
 *     VINEWTONSSLS     = S_(SNESVINEWTONSSLS)             # <<<<<<<<<<<<<<
 *     NGMRES           = S_(SNESNGMRES)
 *     QN               = S_(SNESQN)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESVINEWTONSSLS); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_VINEWTONSSLS, __pyx_t_14) < (0)) __PYX_ERR(50, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":20
 *     VINEWTONRSLS     = S_(SNESVINEWTONRSLS)
 *     VINEWTONSSLS     = S_(SNESVINEWTONSSLS)
 *     NGMRES           = S_(SNESNGMRES)             # <<<<<<<<<<<<<<
 *     QN               = S_(SNESQN)
 *     SHELL            = S_(SNESSHELL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESNGMRES); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NGMRES, __pyx_t_14) < (0)) __PYX_ERR(50, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":21
 *     VINEWTONSSLS     = S_(SNESVINEWTONSSLS)
 *     NGMRES           = S_(SNESNGMRES)
 *     QN               = S_(SNESQN)             # <<<<<<<<<<<<<<
 *     SHELL            = S_(SNESSHELL)
 *     NGS              = S_(SNESNGS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESQN); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QN, __pyx_t_14) < (0)) __PYX_ERR(50, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":22
 *     NGMRES           = S_(SNESNGMRES)
 *     QN               = S_(SNESQN)
 *     SHELL            = S_(SNESSHELL)             # <<<<<<<<<<<<<<
 *     NGS              = S_(SNESNGS)
 *     NCG              = S_(SNESNCG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESSHELL); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SHELL, __pyx_t_14) < (0)) __PYX_ERR(50, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":23
 *     QN               = S_(SNESQN)
 *     SHELL            = S_(SNESSHELL)
 *     NGS              = S_(SNESNGS)             # <<<<<<<<<<<<<<
 *     NCG              = S_(SNESNCG)
 *     FAS              = S_(SNESFAS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESNGS); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NGS, __pyx_t_14) < (0)) __PYX_ERR(50, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":24
 *     SHELL            = S_(SNESSHELL)
 *     NGS              = S_(SNESNGS)
 *     NCG              = S_(SNESNCG)             # <<<<<<<<<<<<<<
 *     FAS              = S_(SNESFAS)
 *     MS               = S_(SNESMS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESNCG); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NCG, __pyx_t_14) < (0)) __PYX_ERR(50, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":25
 *     NGS              = S_(SNESNGS)
 *     NCG              = S_(SNESNCG)
 *     FAS              = S_(SNESFAS)             # <<<<<<<<<<<<<<
 *     MS               = S_(SNESMS)
 *     NASM             = S_(SNESNASM)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESFAS); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FAS, __pyx_t_14) < (0)) __PYX_ERR(50, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":26
 *     NCG              = S_(SNESNCG)
 *     FAS              = S_(SNESFAS)
 *     MS               = S_(SNESMS)             # <<<<<<<<<<<<<<
 *     NASM             = S_(SNESNASM)
 *     ANDERSON         = S_(SNESANDERSON)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESMS); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MS, __pyx_t_14) < (0)) __PYX_ERR(50, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":27
 *     FAS              = S_(SNESFAS)
 *     MS               = S_(SNESMS)
 *     NASM             = S_(SNESNASM)             # <<<<<<<<<<<<<<
 *     ANDERSON         = S_(SNESANDERSON)
 *     ASPIN            = S_(SNESASPIN)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESNASM); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NASM, __pyx_t_14) < (0)) __PYX_ERR(50, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":28
 *     MS               = S_(SNESMS)
 *     NASM             = S_(SNESNASM)
 *     ANDERSON         = S_(SNESANDERSON)             # <<<<<<<<<<<<<<
 *     ASPIN            = S_(SNESASPIN)
 *     COMPOSITE        = S_(SNESCOMPOSITE)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESANDERSON); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ANDERSON, __pyx_t_14) < (0)) __PYX_ERR(50, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":29
 *     NASM             = S_(SNESNASM)
 *     ANDERSON         = S_(SNESANDERSON)
 *     ASPIN            = S_(SNESASPIN)             # <<<<<<<<<<<<<<
 *     COMPOSITE        = S_(SNESCOMPOSITE)
 *     PATCH            = S_(SNESPATCH)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESASPIN); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ASPIN, __pyx_t_14) < (0)) __PYX_ERR(50, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":30
 *     ANDERSON         = S_(SNESANDERSON)
 *     ASPIN            = S_(SNESASPIN)
 *     COMPOSITE        = S_(SNESCOMPOSITE)             # <<<<<<<<<<<<<<
 *     PATCH            = S_(SNESPATCH)
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESCOMPOSITE); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_COMPOSITE, __pyx_t_14) < (0)) __PYX_ERR(50, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":31
 *     ASPIN            = S_(SNESASPIN)
 *     COMPOSITE        = S_(SNESCOMPOSITE)
 *     PATCH            = S_(SNESPATCH)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESPATCH); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PATCH, __pyx_t_14) < (0)) __PYX_ERR(50, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class SNESType(object):             # <<<<<<<<<<<<<<
 *     """SNES solver type.
 * 
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SNESType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SNESType, __pyx_t_14) < (0)) __PYX_ERR(50, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":34
 * 
 * 
 * class SNESNormSchedule(object):             # <<<<<<<<<<<<<<
 *     """SNES norm schedule.
 * 
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[135]); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_SNESNormSchedule, __pyx_mstate_global->__pyx_n_u_SNESNormSchedule, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_SNES_norm_schedule_See_Also_pets); if (unlikely(!__pyx_t_10)) __PYX_ERR(50, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[135]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[135]) < 0))) __PYX_ERR(50, 34, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/SNES.pyx":43
 *     """
 *     # native
 *     NORM_DEFAULT            = SNES_NORM_DEFAULT             # <<<<<<<<<<<<<<
 *     NORM_NONE               = SNES_NORM_NONE
 *     NORM_ALWAYS             = SNES_NORM_ALWAYS
*/
  __pyx_t_14 = __Pyx_PyLong_From_SNESNormSchedule(SNES_NORM_DEFAULT); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_DEFAULT, __pyx_t_14) < (0)) __PYX_ERR(50, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":44
 *     # 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_14 = __Pyx_PyLong_From_SNESNormSchedule(SNES_NORM_NONE); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_NONE, __pyx_t_14) < (0)) __PYX_ERR(50, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":45
 *     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_14 = __Pyx_PyLong_From_SNESNormSchedule(SNES_NORM_ALWAYS); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_ALWAYS, __pyx_t_14) < (0)) __PYX_ERR(50, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":46
 *     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_14 = __Pyx_PyLong_From_SNESNormSchedule(SNES_NORM_INITIAL_ONLY); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_INITIAL_ONLY, __pyx_t_14) < (0)) __PYX_ERR(50, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":47
 *     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_14 = __Pyx_PyLong_From_SNESNormSchedule(SNES_NORM_FINAL_ONLY); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_FINAL_ONLY, __pyx_t_14) < (0)) __PYX_ERR(50, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":48
 *     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_14 = __Pyx_PyLong_From_SNESNormSchedule(SNES_NORM_INITIAL_FINAL_ONLY); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_INITIAL_FINAL_ONLY, __pyx_t_14) < (0)) __PYX_ERR(50, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":50
 *     NORM_INITIAL_FINAL_ONLY = SNES_NORM_INITIAL_FINAL_ONLY
 *     # aliases
 *     DEFAULT            = NORM_DEFAULT             # <<<<<<<<<<<<<<
 *     NONE               = NORM_NONE
 *     ALWAYS             = NORM_ALWAYS
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_DEFAULT);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_NORM_DEFAULT);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DEFAULT, __pyx_t_14) < (0)) __PYX_ERR(50, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":51
 *     # aliases
 *     DEFAULT            = NORM_DEFAULT
 *     NONE               = NORM_NONE             # <<<<<<<<<<<<<<
 *     ALWAYS             = NORM_ALWAYS
 *     INITIAL_ONLY       = NORM_INITIAL_ONLY
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_NONE);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_NORM_NONE);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NONE, __pyx_t_14) < (0)) __PYX_ERR(50, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":52
 *     DEFAULT            = NORM_DEFAULT
 *     NONE               = NORM_NONE
 *     ALWAYS             = NORM_ALWAYS             # <<<<<<<<<<<<<<
 *     INITIAL_ONLY       = NORM_INITIAL_ONLY
 *     FINAL_ONLY         = NORM_FINAL_ONLY
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_ALWAYS);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_NORM_ALWAYS);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ALWAYS, __pyx_t_14) < (0)) __PYX_ERR(50, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":53
 *     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_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_INITIAL_ONLY);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_NORM_INITIAL_ONLY);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INITIAL_ONLY, __pyx_t_14) < (0)) __PYX_ERR(50, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":54
 *     ALWAYS             = NORM_ALWAYS
 *     INITIAL_ONLY       = NORM_INITIAL_ONLY
 *     FINAL_ONLY         = NORM_FINAL_ONLY             # <<<<<<<<<<<<<<
 *     INITIAL_FINAL_ONLY = NORM_INITIAL_FINAL_ONLY
 * 
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_FINAL_ONLY);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_NORM_FINAL_ONLY);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FINAL_ONLY, __pyx_t_14) < (0)) __PYX_ERR(50, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":55
 *     INITIAL_ONLY       = NORM_INITIAL_ONLY
 *     FINAL_ONLY         = NORM_FINAL_ONLY
 *     INITIAL_FINAL_ONLY = NORM_INITIAL_FINAL_ONLY             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORM_INITIAL_FINAL_ONLY);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_NORM_INITIAL_FINAL_ONLY);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INITIAL_FINAL_ONLY, __pyx_t_14) < (0)) __PYX_ERR(50, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":34
 * 
 * 
 * class SNESNormSchedule(object):             # <<<<<<<<<<<<<<
 *     """SNES norm schedule.
 * 
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SNESNormSchedule, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SNESNormSchedule, __pyx_t_14) < (0)) __PYX_ERR(50, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":59
 * 
 * # FIXME Missing reference petsc.SNESConvergedReason
 * class SNESConvergedReason(object):             # <<<<<<<<<<<<<<
 *     """SNES solver termination reason.
 * 
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[137]); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_SNESConvergedReason, __pyx_mstate_global->__pyx_n_u_SNESConvergedReason, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_SNES_solver_termination_reason_S); if (unlikely(!__pyx_t_10)) __PYX_ERR(50, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[137]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[137]) < 0))) __PYX_ERR(50, 59, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/SNES.pyx":68
 *     """
 *     # iterating
 *     CONVERGED_ITERATING         = SNES_CONVERGED_ITERATING             # <<<<<<<<<<<<<<
 *     ITERATING                   = SNES_CONVERGED_ITERATING
 *     # converged
*/
  __pyx_t_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_CONVERGED_ITERATING); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CONVERGED_ITERATING, __pyx_t_14) < (0)) __PYX_ERR(50, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":69
 *     # iterating
 *     CONVERGED_ITERATING         = SNES_CONVERGED_ITERATING
 *     ITERATING                   = SNES_CONVERGED_ITERATING             # <<<<<<<<<<<<<<
 *     # converged
 *     CONVERGED_FNORM_ABS         = SNES_CONVERGED_FNORM_ABS
*/
  __pyx_t_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_CONVERGED_ITERATING); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ITERATING, __pyx_t_14) < (0)) __PYX_ERR(50, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":71
 *     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_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_CONVERGED_FNORM_ABS); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CONVERGED_FNORM_ABS, __pyx_t_14) < (0)) __PYX_ERR(50, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":72
 *     # 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_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_CONVERGED_FNORM_RELATIVE); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CONVERGED_FNORM_RELATIVE, __pyx_t_14) < (0)) __PYX_ERR(50, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":73
 *     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_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_CONVERGED_SNORM_RELATIVE); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CONVERGED_SNORM_RELATIVE, __pyx_t_14) < (0)) __PYX_ERR(50, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":74
 *     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_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_CONVERGED_ITS); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CONVERGED_ITS, __pyx_t_14) < (0)) __PYX_ERR(50, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":76
 *     CONVERGED_ITS               = SNES_CONVERGED_ITS
 *     # diverged
 *     DIVERGED_FUNCTION_DOMAIN    = SNES_DIVERGED_FUNCTION_DOMAIN             # <<<<<<<<<<<<<<
 *     DIVERGED_FUNCTION_NANORINF  = SNES_DIVERGED_FUNCTION_NANORINF
 *     DIVERGED_OBJECTIVE_DOMAIN   = SNES_DIVERGED_OBJECTIVE_DOMAIN
*/
  __pyx_t_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_DIVERGED_FUNCTION_DOMAIN); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_FUNCTION_DOMAIN, __pyx_t_14) < (0)) __PYX_ERR(50, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":77
 *     # diverged
 *     DIVERGED_FUNCTION_DOMAIN    = SNES_DIVERGED_FUNCTION_DOMAIN
 *     DIVERGED_FUNCTION_NANORINF  = SNES_DIVERGED_FUNCTION_NANORINF             # <<<<<<<<<<<<<<
 *     DIVERGED_OBJECTIVE_DOMAIN   = SNES_DIVERGED_OBJECTIVE_DOMAIN
 *     DIVERGED_OBJECTIVE_NANORINF = SNES_DIVERGED_OBJECTIVE_NANORINF
*/
  __pyx_t_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_DIVERGED_FUNCTION_NANORINF); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_FUNCTION_NANORINF, __pyx_t_14) < (0)) __PYX_ERR(50, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":78
 *     DIVERGED_FUNCTION_DOMAIN    = SNES_DIVERGED_FUNCTION_DOMAIN
 *     DIVERGED_FUNCTION_NANORINF  = SNES_DIVERGED_FUNCTION_NANORINF
 *     DIVERGED_OBJECTIVE_DOMAIN   = SNES_DIVERGED_OBJECTIVE_DOMAIN             # <<<<<<<<<<<<<<
 *     DIVERGED_OBJECTIVE_NANORINF = SNES_DIVERGED_OBJECTIVE_NANORINF
 *     DIVERGED_JACOBIAN_DOMAIN    = SNES_DIVERGED_JACOBIAN_DOMAIN
*/
  __pyx_t_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_DIVERGED_OBJECTIVE_DOMAIN); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_OBJECTIVE_DOMAIN, __pyx_t_14) < (0)) __PYX_ERR(50, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":79
 *     DIVERGED_FUNCTION_NANORINF  = SNES_DIVERGED_FUNCTION_NANORINF
 *     DIVERGED_OBJECTIVE_DOMAIN   = SNES_DIVERGED_OBJECTIVE_DOMAIN
 *     DIVERGED_OBJECTIVE_NANORINF = SNES_DIVERGED_OBJECTIVE_NANORINF             # <<<<<<<<<<<<<<
 *     DIVERGED_JACOBIAN_DOMAIN    = SNES_DIVERGED_JACOBIAN_DOMAIN
 *     DIVERGED_FUNCTION_COUNT     = SNES_DIVERGED_FUNCTION_COUNT
*/
  __pyx_t_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_DIVERGED_OBJECTIVE_NANORINF); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_OBJECTIVE_NANORINF, __pyx_t_14) < (0)) __PYX_ERR(50, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":80
 *     DIVERGED_OBJECTIVE_DOMAIN   = SNES_DIVERGED_OBJECTIVE_DOMAIN
 *     DIVERGED_OBJECTIVE_NANORINF = SNES_DIVERGED_OBJECTIVE_NANORINF
 *     DIVERGED_JACOBIAN_DOMAIN    = SNES_DIVERGED_JACOBIAN_DOMAIN             # <<<<<<<<<<<<<<
 *     DIVERGED_FUNCTION_COUNT     = SNES_DIVERGED_FUNCTION_COUNT
 *     DIVERGED_LINEAR_SOLVE       = SNES_DIVERGED_LINEAR_SOLVE
*/
  __pyx_t_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_DIVERGED_JACOBIAN_DOMAIN); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_JACOBIAN_DOMAIN, __pyx_t_14) < (0)) __PYX_ERR(50, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":81
 *     DIVERGED_OBJECTIVE_NANORINF = SNES_DIVERGED_OBJECTIVE_NANORINF
 *     DIVERGED_JACOBIAN_DOMAIN    = SNES_DIVERGED_JACOBIAN_DOMAIN
 *     DIVERGED_FUNCTION_COUNT     = SNES_DIVERGED_FUNCTION_COUNT             # <<<<<<<<<<<<<<
 *     DIVERGED_LINEAR_SOLVE       = SNES_DIVERGED_LINEAR_SOLVE
 *     DIVERGED_MAX_IT             = SNES_DIVERGED_MAX_IT
*/
  __pyx_t_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_DIVERGED_FUNCTION_COUNT); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_FUNCTION_COUNT, __pyx_t_14) < (0)) __PYX_ERR(50, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":82
 *     DIVERGED_JACOBIAN_DOMAIN    = SNES_DIVERGED_JACOBIAN_DOMAIN
 *     DIVERGED_FUNCTION_COUNT     = SNES_DIVERGED_FUNCTION_COUNT
 *     DIVERGED_LINEAR_SOLVE       = SNES_DIVERGED_LINEAR_SOLVE             # <<<<<<<<<<<<<<
 *     DIVERGED_MAX_IT             = SNES_DIVERGED_MAX_IT
 *     DIVERGED_LINE_SEARCH        = SNES_DIVERGED_LINE_SEARCH
*/
  __pyx_t_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_DIVERGED_LINEAR_SOLVE); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_LINEAR_SOLVE, __pyx_t_14) < (0)) __PYX_ERR(50, 82, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":83
 *     DIVERGED_FUNCTION_COUNT     = SNES_DIVERGED_FUNCTION_COUNT
 *     DIVERGED_LINEAR_SOLVE       = SNES_DIVERGED_LINEAR_SOLVE
 *     DIVERGED_MAX_IT             = SNES_DIVERGED_MAX_IT             # <<<<<<<<<<<<<<
 *     DIVERGED_LINE_SEARCH        = SNES_DIVERGED_LINE_SEARCH
 *     DIVERGED_INNER              = SNES_DIVERGED_INNER
*/
  __pyx_t_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_DIVERGED_MAX_IT); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_MAX_IT, __pyx_t_14) < (0)) __PYX_ERR(50, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":84
 *     DIVERGED_LINEAR_SOLVE       = SNES_DIVERGED_LINEAR_SOLVE
 *     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_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_DIVERGED_LINE_SEARCH); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_LINE_SEARCH, __pyx_t_14) < (0)) __PYX_ERR(50, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":85
 *     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_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_DIVERGED_INNER); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_INNER, __pyx_t_14) < (0)) __PYX_ERR(50, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":86
 *     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_TR_DELTA           = SNES_DIVERGED_TR_DELTA
*/
  __pyx_t_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_DIVERGED_LOCAL_MIN); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_LOCAL_MIN, __pyx_t_14) < (0)) __PYX_ERR(50, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":87
 *     DIVERGED_INNER              = SNES_DIVERGED_INNER
 *     DIVERGED_LOCAL_MIN          = SNES_DIVERGED_LOCAL_MIN
 *     DIVERGED_DTOL               = SNES_DIVERGED_DTOL             # <<<<<<<<<<<<<<
 *     DIVERGED_TR_DELTA           = SNES_DIVERGED_TR_DELTA
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_DIVERGED_DTOL); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_DTOL, __pyx_t_14) < (0)) __PYX_ERR(50, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":88
 *     DIVERGED_LOCAL_MIN          = SNES_DIVERGED_LOCAL_MIN
 *     DIVERGED_DTOL               = SNES_DIVERGED_DTOL
 *     DIVERGED_TR_DELTA           = SNES_DIVERGED_TR_DELTA             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_SNESConvergedReason(SNES_DIVERGED_TR_DELTA); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIVERGED_TR_DELTA, __pyx_t_14) < (0)) __PYX_ERR(50, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":59
 * 
 * # FIXME Missing reference petsc.SNESConvergedReason
 * class SNESConvergedReason(object):             # <<<<<<<<<<<<<<
 *     """SNES solver termination reason.
 * 
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SNESConvergedReason, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SNESConvergedReason, __pyx_t_14) < (0)) __PYX_ERR(50, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":91
 * 
 * 
 * class SNESNewtonALCorrectionType(object):             # <<<<<<<<<<<<<<
 *     """SNESNEWTONAL correction type.
 * 
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[139]); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_SNESNewtonALCorrectionType, __pyx_mstate_global->__pyx_n_u_SNESNewtonALCorrectionType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_SNESNEWTONAL_correction_type_See); if (unlikely(!__pyx_t_10)) __PYX_ERR(50, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[139]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[139]) < 0))) __PYX_ERR(50, 91, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/SNES.pyx":99
 * 
 *     """
 *     EXACT = SNES_NEWTONAL_CORRECTION_EXACT             # <<<<<<<<<<<<<<
 *     NORMAL = SNES_NEWTONAL_CORRECTION_NORMAL
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_SNESNewtonALCorrectionType(SNES_NEWTONAL_CORRECTION_EXACT); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_EXACT, __pyx_t_14) < (0)) __PYX_ERR(50, 99, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":100
 *     """
 *     EXACT = SNES_NEWTONAL_CORRECTION_EXACT
 *     NORMAL = SNES_NEWTONAL_CORRECTION_NORMAL             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_14 = __Pyx_PyLong_From_SNESNewtonALCorrectionType(SNES_NEWTONAL_CORRECTION_NORMAL); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NORMAL, __pyx_t_14) < (0)) __PYX_ERR(50, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":91
 * 
 * 
 * class SNESNewtonALCorrectionType(object):             # <<<<<<<<<<<<<<
 *     """SNESNEWTONAL correction type.
 * 
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SNESNewtonALCorrectionType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SNESNewtonALCorrectionType, __pyx_t_14) < (0)) __PYX_ERR(50, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":116
 *     """
 * 
 *     Type = SNESType             # <<<<<<<<<<<<<<
 *     NormSchedule = SNESNormSchedule
 *     ConvergedReason = SNESConvergedReason
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SNESType); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_5) < (0)) __PYX_ERR(50, 116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":117
 * 
 *     Type = SNESType
 *     NormSchedule = SNESNormSchedule             # <<<<<<<<<<<<<<
 *     ConvergedReason = SNESConvergedReason
 *     NewtonALCorrectionType = SNESNewtonALCorrectionType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SNESNormSchedule); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_NormSchedule, __pyx_t_5) < (0)) __PYX_ERR(50, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":118
 *     Type = SNESType
 *     NormSchedule = SNESNormSchedule
 *     ConvergedReason = SNESConvergedReason             # <<<<<<<<<<<<<<
 *     NewtonALCorrectionType = SNESNewtonALCorrectionType
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SNESConvergedReason); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_ConvergedReason, __pyx_t_5) < (0)) __PYX_ERR(50, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":119
 *     NormSchedule = SNESNormSchedule
 *     ConvergedReason = SNESConvergedReason
 *     NewtonALCorrectionType = SNESNewtonALCorrectionType             # <<<<<<<<<<<<<<
 * 
 *     # --- xxx ---
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SNESNewtonALCorrectionType); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_NewtonALCorrectionType, __pyx_t_5) < (0)) __PYX_ERR(50, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":129
 *     # --- xxx ---
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 129, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_3view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1037])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_4) < (0)) __PYX_ERR(50, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":148
 *         CHKERR(SNESView(self.snes, cviewer))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(50, 148, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1038])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_5) < (0)) __PYX_ERR(50, 148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":161
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a SNES solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(50, 161, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(50, 161, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_7create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1039])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_4) < (0)) __PYX_ERR(50, 161, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":182
 *         return self
 * 
 *     def setType(self, snes_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_snes_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(50, 182, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 182, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_9setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1040])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_5) < (0)) __PYX_ERR(50, 182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":201
 *         CHKERR(SNESSetType(self.snes, cval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(50, 201, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_11getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1041])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_4) < (0)) __PYX_ERR(50, 201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":215
 *         return bytes2str(cval)
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(50, 215, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 215, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_13setOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1042])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setOptionsPrefix, __pyx_t_5) < (0)) __PYX_ERR(50, 215, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":229
 *         CHKERR(SNESSetOptionsPrefix(self.snes, cval))
 * 
 *     def getOptionsPrefix(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(50, 229, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_15getOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1043])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getOptionsPrefix, __pyx_t_4) < (0)) __PYX_ERR(50, 229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":243
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Append to the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(50, 243, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 243, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_17appendOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_appendOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1044])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_appendOptionsPrefix, __pyx_t_5) < (0)) __PYX_ERR(50, 243, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":257
 *         CHKERR(SNESAppendOptionsPrefix(self.snes, cval))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the solver from the options database.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 257, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_19setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1045])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_4) < (0)) __PYX_ERR(50, 257, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":271
 *     # --- application context ---
 * 
 *     def setApplicationContext(self, appctx: Any) -> None:             # <<<<<<<<<<<<<<
 *         """Set the application context."""
 *         self.set_attr('__appctx__', appctx)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_appctx, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(50, 271, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 271, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_21setApplicationContext, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setApplicationContext, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1046])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setApplicationContext, __pyx_t_5) < (0)) __PYX_ERR(50, 271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":280
 *             CHKERR(SNESSetApplicationContext(self.snes, NULL))
 * 
 *     def getApplicationContext(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return the application context."""
 *         cdef void *ctx = NULL
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(50, 280, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_23getApplicationContext, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getApplicationContext, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1047])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getApplicationContext, __pyx_t_4) < (0)) __PYX_ERR(50, 280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":290
 * 
 *     # backward compatibility
 *     setAppCtx = setApplicationContext             # <<<<<<<<<<<<<<
 *     getAppCtx = getApplicationContext
 * 
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setApplicationContext); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setAppCtx, __pyx_t_4) < (0)) __PYX_ERR(50, 290, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":291
 *     # backward compatibility
 *     setAppCtx = setApplicationContext
 *     getAppCtx = getApplicationContext             # <<<<<<<<<<<<<<
 * 
 *     # --- discretization space ---
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getApplicationContext); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getAppCtx, __pyx_t_4) < (0)) __PYX_ERR(50, 291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":295
 *     # --- discretization space ---
 * 
 *     def getDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the `DM` associated with the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(50, 295, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_25getDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1048])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getDM, __pyx_t_5) < (0)) __PYX_ERR(50, 295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":312
 *         return dm
 * 
 *     def setDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Associate a `DM` with the solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 312, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_27setDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1049])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setDM, __pyx_t_4) < (0)) __PYX_ERR(50, 312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":326
 *     # --- TR ---
 * 
 *     def setTRTolerances(self, delta_min: float | None = None, delta_max: float | None = None, delta_0: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the tolerance parameters used for the trust region.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_delta_min, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 326, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_delta_max, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 326, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_delta_0, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 326, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 326, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_29setTRTolerances, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setTRTolerances, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1050])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setTRTolerances, __pyx_t_5) < (0)) __PYX_ERR(50, 326, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":353
 *         CHKERR(SNESNewtonTRSetTolerances(self.snes, cdmin, cdmax, cd0))
 * 
 *     def getTRTolerances(self) -> tuple[float, float, float]:             # <<<<<<<<<<<<<<
 *         """Return the tolerance parameters used for the trust region.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_float_float) < (0)) __PYX_ERR(50, 353, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_31getTRTolerances, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getTRTolerances, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1051])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getTRTolerances, __pyx_t_4) < (0)) __PYX_ERR(50, 353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":377
 *         return (toReal(cdmin), toReal(cdmax), toReal(cd0))
 * 
 *     def setTRUpdateParameters(self,             # <<<<<<<<<<<<<<
 *                               eta1: float | None = None, eta2: float | None = None, eta3: float | None = None,
 *                               t1: float | None = None, t2: float | None = None) -> None:
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_eta1, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 377, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_eta2, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 377, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_eta3, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 377, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_t1, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 377, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_t2, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 377, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 377, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_33setTRUpdateParameters, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setTRUpdateParameters, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1052])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[30]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setTRUpdateParameters, __pyx_t_5) < (0)) __PYX_ERR(50, 377, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":412
 *         CHKERR(SNESNewtonTRSetUpdateParameters(self.snes, ceta1, ceta2, ceta3, ct1, ct2))
 * 
 *     def getTRUpdateParameters(self) -> tuple[float, float, float, float, float]:             # <<<<<<<<<<<<<<
 *         """Return the update parameters used for the trust region.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_float_float_float_fl) < (0)) __PYX_ERR(50, 412, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_35getTRUpdateParameters, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getTRUpdateParameters, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1053])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getTRUpdateParameters, __pyx_t_4) < (0)) __PYX_ERR(50, 412, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":442
 *     # --- FAS ---
 * 
 *     def setFASInterpolation(self, level: int, Mat mat) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `Mat` to be used to apply the interpolation from level-1 to level.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 442, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 442, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_37setFASInterpolation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setFASInterpolation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1054])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setFASInterpolation, __pyx_t_5) < (0)) __PYX_ERR(50, 442, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":456
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 456, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(50, 456, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_39getFASInterpolation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getFASInterpolation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1055])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getFASInterpolation, __pyx_t_4) < (0)) __PYX_ERR(50, 456, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":472
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 472, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 472, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_41setFASRestriction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setFASRestriction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1056])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setFASRestriction, __pyx_t_5) < (0)) __PYX_ERR(50, 472, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":486
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 486, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(50, 486, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_43getFASRestriction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getFASRestriction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1057])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getFASRestriction, __pyx_t_4) < (0)) __PYX_ERR(50, 486, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":502
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 502, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 502, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_45setFASInjection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setFASInjection, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1058])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setFASInjection, __pyx_t_5) < (0)) __PYX_ERR(50, 502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":516
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 516, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(50, 516, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_47getFASInjection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getFASInjection, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1059])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getFASInjection, __pyx_t_4) < (0)) __PYX_ERR(50, 516, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":532
 *         return mat
 * 
 *     def setFASRScale(self, level: int, Vec vec) -> None:             # <<<<<<<<<<<<<<
 *         """Set the scaling factor of the restriction operator from level to level-1.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 532, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 532, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_49setFASRScale, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setFASRScale, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1060])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setFASRScale, __pyx_t_5) < (0)) __PYX_ERR(50, 532, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":545
 *         CHKERR(SNESFASSetRScale(self.snes, clevel, vec.vec))
 * 
 *     def setFASLevels(self, levels: int, comms: Sequence[Comm] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of levels to use with FAS.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_levels, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 545, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comms, __pyx_mstate_global->__pyx_kp_u_Sequence_Comm_None) < (0)) __PYX_ERR(50, 545, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 545, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_51setFASLevels, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setFASLevels, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1061])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setFASLevels, __pyx_t_4) < (0)) __PYX_ERR(50, 545, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":579
 *             CHKERR(SNESFASSetLevels(self.snes, clevels, ccomms))
 * 
 *     def getFASLevels(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of levels used.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 579, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_53getFASLevels, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getFASLevels, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1062])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getFASLevels, __pyx_t_5) < (0)) __PYX_ERR(50, 579, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":593
 *         return toInt(levels)
 * 
 *     def getFASCycleSNES(self, level: int) -> SNES:             # <<<<<<<<<<<<<<
 *         """Return the `SNES` corresponding to a particular level of the FAS hierarchy.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 593, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SNES) < (0)) __PYX_ERR(50, 593, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_55getFASCycleSNES, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getFASCycleSNES, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1063])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getFASCycleSNES, __pyx_t_4) < (0)) __PYX_ERR(50, 593, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":610
 *         return lsnes
 * 
 *     def getFASCoarseSolve(self) -> SNES:             # <<<<<<<<<<<<<<
 *         """Return the `SNES` used at the coarsest level of the FAS hierarchy.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SNES) < (0)) __PYX_ERR(50, 610, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_57getFASCoarseSolve, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getFASCoarseSolve, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1064])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getFASCoarseSolve, __pyx_t_5) < (0)) __PYX_ERR(50, 610, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":625
 *         return smooth
 * 
 *     def getFASSmoother(self, level: int) -> SNES:             # <<<<<<<<<<<<<<
 *         """Return the smoother used at a given level of the FAS hierarchy.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 625, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SNES) < (0)) __PYX_ERR(50, 625, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_59getFASSmoother, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getFASSmoother, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1065])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getFASSmoother, __pyx_t_4) < (0)) __PYX_ERR(50, 625, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":642
 *         return smooth
 * 
 *     def getFASSmootherDown(self, level: int) -> SNES:             # <<<<<<<<<<<<<<
 *         """Return the downsmoother used at a given level of the FAS hierarchy.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 642, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SNES) < (0)) __PYX_ERR(50, 642, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_61getFASSmootherDown, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getFASSmootherDown, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1066])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getFASSmootherDown, __pyx_t_5) < (0)) __PYX_ERR(50, 642, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":659
 *         return smooth
 * 
 *     def getFASSmootherUp(self, level: int) -> SNES:             # <<<<<<<<<<<<<<
 *         """Return the upsmoother used at a given level of the FAS hierarchy.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 659, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SNES) < (0)) __PYX_ERR(50, 659, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_63getFASSmootherUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getFASSmootherUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1067])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getFASSmootherUp, __pyx_t_4) < (0)) __PYX_ERR(50, 659, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":678
 *     # --- nonlinear preconditioner ---
 * 
 *     def getNPC(self) -> SNES:             # <<<<<<<<<<<<<<
 *         """Return the nonlinear preconditioner associated with the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SNES) < (0)) __PYX_ERR(50, 678, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_65getNPC, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getNPC, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1068])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getNPC, __pyx_t_5) < (0)) __PYX_ERR(50, 678, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":693
 *         return snes
 * 
 *     def hasNPC(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return a boolean indicating whether the solver has a nonlinear preconditioner.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(50, 693, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_67hasNPC, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_hasNPC, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1069])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_hasNPC, __pyx_t_4) < (0)) __PYX_ERR(50, 693, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":707
 *         return toBool(flag)
 * 
 *     def setNPC(self, SNES snes) -> None:             # <<<<<<<<<<<<<<
 *         """Set the nonlinear preconditioner.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 707, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_69setNPC, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setNPC, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1070])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setNPC, __pyx_t_5) < (0)) __PYX_ERR(50, 707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":719
 *         CHKERR(SNESSetNPC(self.snes, snes.snes))
 * 
 *     def setNPCSide(self, side: PC.Side) -> None:             # <<<<<<<<<<<<<<
 *         """Set the nonlinear preconditioning side.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_side, __pyx_mstate_global->__pyx_kp_u_PC_Side) < (0)) __PYX_ERR(50, 719, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 719, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_71setNPCSide, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setNPCSide, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1071])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setNPCSide, __pyx_t_4) < (0)) __PYX_ERR(50, 719, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":731
 *         CHKERR(SNESSetNPCSide(self.snes, side))
 * 
 *     def getNPCSide(self) -> PC.Side:             # <<<<<<<<<<<<<<
 *         """Return the nonlinear preconditioning side.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_PC_Side) < (0)) __PYX_ERR(50, 731, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_73getNPCSide, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getNPCSide, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1072])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getNPCSide, __pyx_t_5) < (0)) __PYX_ERR(50, 731, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":747
 *     # --- user Function/Jacobian routines ---
 * 
 *     def setLineSearchPreCheck(self, precheck: SNESLSPreFunction | None,             # <<<<<<<<<<<<<<
 *                               args: tuple[Any, ...] | None = None,
 *                               kargs: dict[str, Any] | None = None) -> None:
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_precheck, __pyx_mstate_global->__pyx_kp_u_SNESLSPreFunction_None) < (0)) __PYX_ERR(50, 747, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(50, 747, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(50, 747, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 747, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_75setLineSearchPreCheck, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setLineSearchPreCheck, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1073])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setLineSearchPreCheck, __pyx_t_4) < (0)) __PYX_ERR(50, 747, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":781
 *             CHKERR(SNESLineSearchSetPreCheck(snesls, NULL, NULL))
 * 
 *     def setInitialGuess(self, initialguess: SNESGuessFunction | None,             # <<<<<<<<<<<<<<
 *                         args: tuple[Any, ...] | None = None,
 *                         kargs: dict[str, Any] | None = None) -> None:
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_initialguess, __pyx_mstate_global->__pyx_kp_u_SNESGuessFunction_None) < (0)) __PYX_ERR(50, 781, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(50, 781, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(50, 781, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 781, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_77setInitialGuess, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setInitialGuess, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1074])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setInitialGuess, __pyx_t_5) < (0)) __PYX_ERR(50, 781, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":812
 *             CHKERR(SNESSetComputeInitialGuess(self.snes, NULL, NULL))
 * 
 *     def getInitialGuess(self) -> SNESGuessFunction:             # <<<<<<<<<<<<<<
 *         """Return the callback to compute the initial guess.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SNESGuessFunction) < (0)) __PYX_ERR(50, 812, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_79getInitialGuess, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getInitialGuess, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1075])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getInitialGuess, __pyx_t_4) < (0)) __PYX_ERR(50, 812, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":824
 *         return self.get_attr('__initialguess__')
 * 
 *     def setFunction(self, function: SNESFunction | None,             # <<<<<<<<<<<<<<
 *                     Vec f=None,
 *                     args: tuple[Any, ...] | None = None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_function, __pyx_mstate_global->__pyx_kp_u_SNESFunction_None) < (0)) __PYX_ERR(50, 824, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(50, 824, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(50, 824, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 824, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_81setFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1076])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setFunction, __pyx_t_5) < (0)) __PYX_ERR(50, 824, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":859
 *             CHKERR(SNESSetFunction(self.snes, fvec, NULL, NULL))
 * 
 *     def getFunction(self) -> SNESFunction:             # <<<<<<<<<<<<<<
 *         """Return the callback to compute the nonlinear function.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SNESFunction) < (0)) __PYX_ERR(50, 859, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_83getFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1077])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getFunction, __pyx_t_4) < (0)) __PYX_ERR(50, 859, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":889
 *         return (f, None)
 * 
 *     def setUpdate(self, update: SNESUpdateFunction | None,             # <<<<<<<<<<<<<<
 *                   args: tuple[Any, ...] | None = None,
 *                   kargs: dict[str, Any] | None = None) -> None:
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_update, __pyx_mstate_global->__pyx_kp_u_SNESUpdateFunction_None) < (0)) __PYX_ERR(50, 889, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(50, 889, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(50, 889, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 889, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_85setUpdate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setUpdate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1078])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setUpdate, __pyx_t_5) < (0)) __PYX_ERR(50, 889, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":920
 *             CHKERR(SNESSetUpdate(self.snes, NULL))
 * 
 *     def getUpdate(self) -> SNESUpdateFunction:             # <<<<<<<<<<<<<<
 *         """Return the callback to compute the update at the beginning of each step.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SNESUpdateFunction) < (0)) __PYX_ERR(50, 920, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_87getUpdate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getUpdate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1079])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getUpdate, __pyx_t_4) < (0)) __PYX_ERR(50, 920, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":932
 *         return self.get_attr('__update__')
 * 
 *     def setJacobian(self,             # <<<<<<<<<<<<<<
 *                     jacobian: SNESJacobianFunction | None,
 *                     Mat J=None, Mat P=None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_jacobian, __pyx_mstate_global->__pyx_kp_u_SNESJacobianFunction_None) < (0)) __PYX_ERR(50, 932, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(50, 932, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(50, 932, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 932, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_89setJacobian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setJacobian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1080])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setJacobian, __pyx_t_5) < (0)) __PYX_ERR(50, 932, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":971
 *             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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Mat_Mat_SNESJacobianFuncti) < (0)) __PYX_ERR(50, 971, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_91getJacobian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getJacobian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1081])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getJacobian, __pyx_t_4) < (0)) __PYX_ERR(50, 971, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":998
 *         return (J, P, jacobian)
 * 
 *     def setObjective(self,             # <<<<<<<<<<<<<<
 *                      objective: SNESObjFunction | None,
 *                      args: tuple[Any, ...] | None = None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_objective, __pyx_mstate_global->__pyx_kp_u_SNESObjFunction_None) < (0)) __PYX_ERR(50, 998, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(50, 998, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(50, 998, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 998, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_93setObjective, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setObjective, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1082])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setObjective, __pyx_t_5) < (0)) __PYX_ERR(50, 998, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1029
 *             CHKERR(SNESSetObjective(self.snes, NULL, NULL))
 * 
 *     def getObjective(self) -> SNESObjFunction:             # <<<<<<<<<<<<<<
 *         """Return the objective callback tuple.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SNESObjFunction) < (0)) __PYX_ERR(50, 1029, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_95getObjective, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getObjective, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1083])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getObjective, __pyx_t_4) < (0)) __PYX_ERR(50, 1029, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1043
 *         return objective
 * 
 *     def computeFunction(self, Vec x, Vec f) -> None:             # <<<<<<<<<<<<<<
 *         """Compute the function.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1043, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_97computeFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_computeFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1084])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1043, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_computeFunction, __pyx_t_5) < (0)) __PYX_ERR(50, 1043, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1062
 *         CHKERR(SNESComputeFunction(self.snes, x.vec, f.vec))
 * 
 *     def computeJacobian(self, Vec x, Mat J, Mat P=None) -> None:             # <<<<<<<<<<<<<<
 *         """Compute the Jacobian.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1062, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_99computeJacobian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_computeJacobian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1085])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_computeJacobian, __pyx_t_4) < (0)) __PYX_ERR(50, 1062, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1085
 *         CHKERR(SNESComputeJacobian(self.snes, x.vec, jmat, pmat))
 * 
 *     def computeObjective(self, Vec x) -> float:             # <<<<<<<<<<<<<<
 *         """Compute the value of the objective function.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(50, 1085, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_101computeObjective, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_computeObjective, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1086])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_computeObjective, __pyx_t_5) < (0)) __PYX_ERR(50, 1085, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1104
 *         return toReal(o)
 * 
 *     def setNGS(self,             # <<<<<<<<<<<<<<
 *                ngs: SNESNGSFunction | None,
 *                args: tuple[Any, ...] | None = None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ngs, __pyx_mstate_global->__pyx_kp_u_SNESNGSFunction_None) < (0)) __PYX_ERR(50, 1104, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(50, 1104, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(50, 1104, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1104, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_103setNGS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setNGS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1087])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setNGS, __pyx_t_4) < (0)) __PYX_ERR(50, 1104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1135
 *             CHKERR(SNESSetNGS(self.snes, NULL, NULL))
 * 
 *     def getNGS(self) -> SNESNGSFunction:             # <<<<<<<<<<<<<<
 *         """Return the nonlinear Gauss-Seidel callback tuple.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SNESNGSFunction) < (0)) __PYX_ERR(50, 1135, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_105getNGS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getNGS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1088])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getNGS, __pyx_t_5) < (0)) __PYX_ERR(50, 1135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1149
 *         return ngs
 * 
 *     def computeNGS(self, Vec x, Vec b=None) -> None:             # <<<<<<<<<<<<<<
 *         """Compute a nonlinear Gauss-Seidel step.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1149, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_107computeNGS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_computeNGS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1089])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_computeNGS, __pyx_t_4) < (0)) __PYX_ERR(50, 1149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1172
 *     # --- tolerances and convergence ---
 * 
 *     def setTolerances(self, rtol: float | None = None, atol: float | None = None, stol: float | None = None, max_it: int | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the tolerance parameters used in the solver convergence tests.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_rtol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 1172, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_atol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 1172, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_stol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 1172, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_max_it, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(50, 1172, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1172, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_109setTolerances, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setTolerances, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1090])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setTolerances, __pyx_t_5) < (0)) __PYX_ERR(50, 1172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1211
 *                                  cmaxit, PETSC_CURRENT))
 * 
 *     def getTolerances(self) -> tuple[float, float, float, int]:             # <<<<<<<<<<<<<<
 *         """Return the tolerance parameters used in the solver convergence tests.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_float_float_int) < (0)) __PYX_ERR(50, 1211, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_111getTolerances, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getTolerances, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1091])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getTolerances, __pyx_t_4) < (0)) __PYX_ERR(50, 1211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1238
 *         return (toReal(crtol), toReal(catol), toReal(cstol), toInt(cmaxit))
 * 
 *     def setDivergenceTolerance(self, dtol: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the divergence tolerance parameter used in the convergence tests.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dtol, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(50, 1238, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1238, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_113setDivergenceTolerance, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setDivergenceTolerance, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1092])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setDivergenceTolerance, __pyx_t_5) < (0)) __PYX_ERR(50, 1238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1255
 *         CHKERR(SNESSetDivergenceTolerance(self.snes, asReal(dtol)))
 * 
 *     def getDivergenceTolerance(self) -> float:             # <<<<<<<<<<<<<<
 *         """Get the divergence tolerance parameter used in the convergence tests.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(50, 1255, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_115getDivergenceTolerance, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getDivergenceTolerance, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1093])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getDivergenceTolerance, __pyx_t_4) < (0)) __PYX_ERR(50, 1255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1269
 *         return toReal(cdtol)
 * 
 *     def setNormSchedule(self, normsched: NormSchedule) -> None:             # <<<<<<<<<<<<<<
 *         """Set the norm schedule.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_normsched, __pyx_mstate_global->__pyx_n_u_NormSchedule) < (0)) __PYX_ERR(50, 1269, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1269, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_117setNormSchedule, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setNormSchedule, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1094])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setNormSchedule, __pyx_t_5) < (0)) __PYX_ERR(50, 1269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1281
 *         CHKERR(SNESSetNormSchedule(self.snes, normsched))
 * 
 *     def getNormSchedule(self) -> NormSchedule:             # <<<<<<<<<<<<<<
 *         """Return the norm schedule.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_NormSchedule) < (0)) __PYX_ERR(50, 1281, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_119getNormSchedule, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getNormSchedule, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1095])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getNormSchedule, __pyx_t_4) < (0)) __PYX_ERR(50, 1281, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1295
 *         return normsched
 * 
 *     def setConvergenceTest(self, converged: SNESConvergedFunction | Literal["skip", "default"],             # <<<<<<<<<<<<<<
 *                            args: tuple[Any, ...] | None = None,
 *                            kargs: dict[str, Any] | None = None) -> None:
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_converged, __pyx_mstate_global->__pyx_kp_u_SNESConvergedFunction_Literal_sk) < (0)) __PYX_ERR(50, 1295, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(50, 1295, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(50, 1295, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1295, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_121setConvergenceTest, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setConvergenceTest, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1096])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setConvergenceTest, __pyx_t_5) < (0)) __PYX_ERR(50, 1295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1330
 *             CHKERR(SNESSetConvergenceTest(self.snes, SNES_Converged, <void*>context, NULL))
 * 
 *     def getConvergenceTest(self) -> SNESConvergedFunction:             # <<<<<<<<<<<<<<
 *         """Return the callback to used as convergence test.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SNESConvergedFunction) < (0)) __PYX_ERR(50, 1330, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_123getConvergenceTest, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getConvergenceTest, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1097])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getConvergenceTest, __pyx_t_4) < (0)) __PYX_ERR(50, 1330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1342
 *         return self.get_attr('__converged__')
 * 
 *     def callConvergenceTest(self, its: int, xnorm: float, ynorm: float, fnorm: float) -> ConvergedReason:             # <<<<<<<<<<<<<<
 *         """Compute the convergence test.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_its, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 1342, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_xnorm, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(50, 1342, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ynorm, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(50, 1342, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fnorm, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(50, 1342, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ConvergedReason) < (0)) __PYX_ERR(50, 1342, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_125callConvergenceTest, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_callConvergenceTest, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1098])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_callConvergenceTest, __pyx_t_5) < (0)) __PYX_ERR(50, 1342, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1372
 *         return reason
 * 
 *     def converged(self, its: int, xnorm: float, ynorm: float, fnorm: float) -> None:             # <<<<<<<<<<<<<<
 *         """Compute the convergence test and update the solver converged reason.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_its, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 1372, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_xnorm, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(50, 1372, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ynorm, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(50, 1372, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_fnorm, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(50, 1372, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1372, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_127converged, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_converged, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1099])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_converged, __pyx_t_4) < (0)) __PYX_ERR(50, 1372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1399
 *         CHKERR(SNESConverged(self.snes, ival, rval1, rval2, rval3))
 * 
 *     def setConvergenceHistory(self, length=None, reset=False) -> None:             # <<<<<<<<<<<<<<
 *         """Set the convergence history.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1399, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_129setConvergenceHistory, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setConvergenceHistory, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1100])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[131]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setConvergenceHistory, __pyx_t_5) < (0)) __PYX_ERR(50, 1399, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1423
 *         CHKERR(SNESSetConvergenceHistory(self.snes, rdata, idata, size, flag))
 * 
 *     def getConvergenceHistory(self) -> tuple[ArrayReal, ArrayInt]:             # <<<<<<<<<<<<<<
 *         """Return the convergence history.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_ArrayReal_ArrayInt) < (0)) __PYX_ERR(50, 1423, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_131getConvergenceHistory, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getConvergenceHistory, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1101])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getConvergenceHistory, __pyx_t_4) < (0)) __PYX_ERR(50, 1423, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1441
 *         return (rhist, ihist)
 * 
 *     def logConvergenceHistory(self, norm: float, linear_its: int = 0) -> None:             # <<<<<<<<<<<<<<
 *         """Log residual norm and linear iterations."""
 *         cdef PetscReal rval = asReal(norm)
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_norm, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(50, 1441, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_linear_its, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 1441, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1441, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_133logConvergenceHistory, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_logConvergenceHistory, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1102])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[79]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_logConvergenceHistory, __pyx_t_5) < (0)) __PYX_ERR(50, 1441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1447
 *         CHKERR(SNESLogConvergenceHistory(self.snes, rval, ival))
 * 
 *     def setResetCounters(self, reset: bool = True) -> None:             # <<<<<<<<<<<<<<
 *         """Set the flag to reset the counters.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_reset, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(50, 1447, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1447, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_135setResetCounters, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setResetCounters, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1103])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[76]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setResetCounters, __pyx_t_4) < (0)) __PYX_ERR(50, 1447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1462
 *     # --- monitoring ---
 * 
 *     def setMonitor(self,             # <<<<<<<<<<<<<<
 *                    monitor: SNESMonitorFunction | None,
 *                    args: tuple[Any, ...] | None = None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_monitor, __pyx_mstate_global->__pyx_kp_u_SNESMonitorFunction_None) < (0)) __PYX_ERR(50, 1462, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(50, 1462, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(50, 1462, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1462, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_137setMonitor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setMonitor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1104])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setMonitor, __pyx_t_5) < (0)) __PYX_ERR(50, 1462, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1495
 *         monitorlist.append(context)
 * 
 *     def getMonitor(self) -> list[tuple[SNESMonitorFunction, tuple[Any, ...], dict[str, Any]]]:             # <<<<<<<<<<<<<<
 *         """Return the callback used to monitor solver convergence.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_tuple_SNESMonitorFunction_t) < (0)) __PYX_ERR(50, 1495, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_139getMonitor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getMonitor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1105])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getMonitor, __pyx_t_4) < (0)) __PYX_ERR(50, 1495, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1507
 *         return self.get_attr('__monitor__')
 * 
 *     def monitorCancel(self) -> None:             # <<<<<<<<<<<<<<
 *         """Cancel all the monitors of the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1507, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_141monitorCancel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_monitorCancel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1106])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_monitorCancel, __pyx_t_5) < (0)) __PYX_ERR(50, 1507, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1520
 *         self.set_attr('__monitor__', None)
 * 
 *     cancelMonitor = monitorCancel             # <<<<<<<<<<<<<<
 * 
 *     def monitor(self, its, rnorm) -> None:
*/
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_monitorCancel); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_cancelMonitor, __pyx_t_5) < (0)) __PYX_ERR(50, 1520, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1522
 *     cancelMonitor = monitorCancel
 * 
 *     def monitor(self, its, rnorm) -> None:             # <<<<<<<<<<<<<<
 *         """Monitor the solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1522, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_143monitor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_monitor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1107])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_monitor, __pyx_t_4) < (0)) __PYX_ERR(50, 1522, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1545
 *     # --- more tolerances ---
 * 
 *     def setMaxFunctionEvaluations(self, max_funcs: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum allowed number of function evaluations.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_max_funcs, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 1545, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1545, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_145setMaxFunctionEvaluations, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setMaxFunctionEvaluations, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1108])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setMaxFunctionEvaluations, __pyx_t_5) < (0)) __PYX_ERR(50, 1545, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1560
 *         CHKERR(SNESSetTolerances(self.snes, r, r, r, i, ival))
 * 
 *     def getMaxFunctionEvaluations(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the maximum allowed number of function evaluations.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 1560, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_147getMaxFunctionEvaluations, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getMaxFunctionEvaluations, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1109])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getMaxFunctionEvaluations, __pyx_t_4) < (0)) __PYX_ERR(50, 1560, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1576
 *         return toInt(ival)
 * 
 *     def getFunctionEvaluations(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the current number of function evaluations.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 1576, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_149getFunctionEvaluations, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getFunctionEvaluations, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1110])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getFunctionEvaluations, __pyx_t_5) < (0)) __PYX_ERR(50, 1576, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1590
 *         return toInt(ival)
 * 
 *     def setMaxStepFailures(self, max_fails: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum allowed number of step failures.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_max_fails, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 1590, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1590, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_151setMaxStepFailures, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setMaxStepFailures, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1111])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setMaxStepFailures, __pyx_t_4) < (0)) __PYX_ERR(50, 1590, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1603
 *         CHKERR(SNESSetMaxNonlinearStepFailures(self.snes, ival))
 * 
 *     def getMaxStepFailures(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the maximum allowed number of step failures.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 1603, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_153getMaxStepFailures, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getMaxStepFailures, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1112])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getMaxStepFailures, __pyx_t_5) < (0)) __PYX_ERR(50, 1603, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1617
 *         return toInt(ival)
 * 
 *     def getStepFailures(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the current number of step failures.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 1617, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_155getStepFailures, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getStepFailures, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1113])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getStepFailures, __pyx_t_4) < (0)) __PYX_ERR(50, 1617, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1631
 *         return toInt(ival)
 * 
 *     def setMaxKSPFailures(self, max_fails: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum allowed number of linear solve failures.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_max_fails, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 1631, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1631, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_157setMaxKSPFailures, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setMaxKSPFailures, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1114])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setMaxKSPFailures, __pyx_t_5) < (0)) __PYX_ERR(50, 1631, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1644
 *         CHKERR(SNESSetMaxLinearSolveFailures(self.snes, ival))
 * 
 *     def getMaxKSPFailures(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the maximum allowed number of linear solve failures.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 1644, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_159getMaxKSPFailures, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getMaxKSPFailures, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1115])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getMaxKSPFailures, __pyx_t_4) < (0)) __PYX_ERR(50, 1644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1658
 *         return toInt(ival)
 * 
 *     def getKSPFailures(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the current number of linear solve failures.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 1658, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_161getKSPFailures, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getKSPFailures, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1116])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getKSPFailures, __pyx_t_5) < (0)) __PYX_ERR(50, 1658, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1672
 *         return toInt(ival)
 * 
 *     setMaxNonlinearStepFailures = setMaxStepFailures             # <<<<<<<<<<<<<<
 *     getMaxNonlinearStepFailures = getMaxStepFailures
 *     getNonlinearStepFailures    = getStepFailures
*/
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setMaxStepFailures); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setMaxNonlinearStepFailures, __pyx_t_5) < (0)) __PYX_ERR(50, 1672, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1673
 * 
 *     setMaxNonlinearStepFailures = setMaxStepFailures
 *     getMaxNonlinearStepFailures = getMaxStepFailures             # <<<<<<<<<<<<<<
 *     getNonlinearStepFailures    = getStepFailures
 *     setMaxLinearSolveFailures   = setMaxKSPFailures
*/
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getMaxStepFailures); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getMaxNonlinearStepFailures, __pyx_t_5) < (0)) __PYX_ERR(50, 1673, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1674
 *     setMaxNonlinearStepFailures = setMaxStepFailures
 *     getMaxNonlinearStepFailures = getMaxStepFailures
 *     getNonlinearStepFailures    = getStepFailures             # <<<<<<<<<<<<<<
 *     setMaxLinearSolveFailures   = setMaxKSPFailures
 *     getMaxLinearSolveFailures   = getMaxKSPFailures
*/
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getStepFailures); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getNonlinearStepFailures, __pyx_t_5) < (0)) __PYX_ERR(50, 1674, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1675
 *     getMaxNonlinearStepFailures = getMaxStepFailures
 *     getNonlinearStepFailures    = getStepFailures
 *     setMaxLinearSolveFailures   = setMaxKSPFailures             # <<<<<<<<<<<<<<
 *     getMaxLinearSolveFailures   = getMaxKSPFailures
 *     getLinearSolveFailures      = getKSPFailures
*/
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setMaxKSPFailures); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setMaxLinearSolveFailures, __pyx_t_5) < (0)) __PYX_ERR(50, 1675, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1676
 *     getNonlinearStepFailures    = getStepFailures
 *     setMaxLinearSolveFailures   = setMaxKSPFailures
 *     getMaxLinearSolveFailures   = getMaxKSPFailures             # <<<<<<<<<<<<<<
 *     getLinearSolveFailures      = getKSPFailures
 * 
*/
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getMaxKSPFailures); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getMaxLinearSolveFailures, __pyx_t_5) < (0)) __PYX_ERR(50, 1676, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1677
 *     setMaxLinearSolveFailures   = setMaxKSPFailures
 *     getMaxLinearSolveFailures   = getMaxKSPFailures
 *     getLinearSolveFailures      = getKSPFailures             # <<<<<<<<<<<<<<
 * 
 *     # --- solving ---
*/
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getKSPFailures); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getLinearSolveFailures, __pyx_t_5) < (0)) __PYX_ERR(50, 1677, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1681
 *     # --- solving ---
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1681, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_163setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1117])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_4) < (0)) __PYX_ERR(50, 1681, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1693
 *         CHKERR(SNESSetUp(self.snes))
 * 
 *     def setUpMatrices(self) -> None:             # <<<<<<<<<<<<<<
 *         """Ensures that matrices are available for Newton-like methods.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1693, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_165setUpMatrices, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setUpMatrices, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1118])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setUpMatrices, __pyx_t_5) < (0)) __PYX_ERR(50, 1693, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1707
 *         CHKERR(SNESSetUpMatrices(self.snes))
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         """Reset the solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1707, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_167reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_reset, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1119])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_4) < (0)) __PYX_ERR(50, 1707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1719
 *         CHKERR(SNESReset(self.snes))
 * 
 *     def solve(self, Vec b = None, Vec x = None) -> None:             # <<<<<<<<<<<<<<
 *         """Solve the nonlinear equations.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1719, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_169solve, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_solve, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1120])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_solve, __pyx_t_5) < (0)) __PYX_ERR(50, 1719, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1742
 *         CHKERR(SNESSolve(self.snes, rhs, sol))
 * 
 *     def setConvergedReason(self, reason: ConvergedReason) -> None:             # <<<<<<<<<<<<<<
 *         """Set the termination flag.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_reason, __pyx_mstate_global->__pyx_n_u_ConvergedReason) < (0)) __PYX_ERR(50, 1742, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1742, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_171setConvergedReason, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setConvergedReason, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1121])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setConvergedReason, __pyx_t_4) < (0)) __PYX_ERR(50, 1742, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1755
 *         CHKERR(SNESSetConvergedReason(self.snes, eval))
 * 
 *     def getConvergedReason(self) -> ConvergedReason:             # <<<<<<<<<<<<<<
 *         """Return the termination flag.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ConvergedReason) < (0)) __PYX_ERR(50, 1755, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_173getConvergedReason, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getConvergedReason, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1122])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getConvergedReason, __pyx_t_5) < (0)) __PYX_ERR(50, 1755, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1769
 *         return reason
 * 
 *     def setErrorIfNotConverged(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Immediately generate an error if the solver has not converged.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(50, 1769, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1769, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_175setErrorIfNotConverged, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setErrorIfNotConverged, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1123])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setErrorIfNotConverged, __pyx_t_4) < (0)) __PYX_ERR(50, 1769, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1782
 *         CHKERR(SNESSetErrorIfNotConverged(self.snes, ernc))
 * 
 *     def getErrorIfNotConverged(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag indicating error on divergence.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(50, 1782, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_177getErrorIfNotConverged, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getErrorIfNotConverged, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1124])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getErrorIfNotConverged, __pyx_t_5) < (0)) __PYX_ERR(50, 1782, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1796
 *         return toBool(flag)
 * 
 *     def setIterationNumber(self, its: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the current iteration number.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1796, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_its, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 1796, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1796, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_179setIterationNumber, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setIterationNumber, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1125])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1796, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setIterationNumber, __pyx_t_4) < (0)) __PYX_ERR(50, 1796, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1811
 *         CHKERR(SNESSetIterationNumber(self.snes, ival))
 * 
 *     def getIterationNumber(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the current iteration number.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 1811, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_181getIterationNumber, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getIterationNumber, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1126])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1811, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getIterationNumber, __pyx_t_5) < (0)) __PYX_ERR(50, 1811, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1825
 *         return toInt(ival)
 * 
 *     def setForceIteration(self, force: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Force solve to take at least one iteration.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_force, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(50, 1825, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1825, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_183setForceIteration, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setForceIteration, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1127])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setForceIteration, __pyx_t_4) < (0)) __PYX_ERR(50, 1825, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1838
 *         CHKERR(SNESSetForceIteration(self.snes, bval))
 * 
 *     def setFunctionNorm(self, norm: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the function norm value.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_norm, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(50, 1838, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1838, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_185setFunctionNorm, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setFunctionNorm, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1128])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setFunctionNorm, __pyx_t_5) < (0)) __PYX_ERR(50, 1838, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1853
 *         CHKERR(SNESSetFunctionNorm(self.snes, rval))
 * 
 *     def getFunctionNorm(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the function norm.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(50, 1853, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_187getFunctionNorm, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getFunctionNorm, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1129])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getFunctionNorm, __pyx_t_4) < (0)) __PYX_ERR(50, 1853, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1867
 *         return toReal(rval)
 * 
 *     def getLinearSolveIterations(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the total number of linear iterations.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 1867, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_189getLinearSolveIterations, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getLinearSolveIterations, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1130])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getLinearSolveIterations, __pyx_t_5) < (0)) __PYX_ERR(50, 1867, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1881
 *         return toInt(ival)
 * 
 *     def getRhs(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the vector holding the right-hand side.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(50, 1881, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_191getRhs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getRhs, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1131])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getRhs, __pyx_t_4) < (0)) __PYX_ERR(50, 1881, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1896
 *         return vec
 * 
 *     def getSolution(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the vector holding the solution.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(50, 1896, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_193getSolution, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1132])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_5) < (0)) __PYX_ERR(50, 1896, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1911
 *         return vec
 * 
 *     def setSolution(self, Vec vec) -> None:             # <<<<<<<<<<<<<<
 *         """Set the vector used to store the solution.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1911, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_195setSolution, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setSolution, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1133])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setSolution, __pyx_t_4) < (0)) __PYX_ERR(50, 1911, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1923
 *         CHKERR(SNESSetSolution(self.snes, vec.vec))
 * 
 *     def getSolutionUpdate(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the vector holding the solution update.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(50, 1923, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_197getSolutionUpdate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getSolutionUpdate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1134])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getSolutionUpdate, __pyx_t_5) < (0)) __PYX_ERR(50, 1923, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1940
 *     # --- linear solver ---
 * 
 *     def setKSP(self, KSP ksp) -> None:             # <<<<<<<<<<<<<<
 *         """Set the linear solver that will be used by the nonlinear solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1940, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_199setKSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setKSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1135])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setKSP, __pyx_t_4) < (0)) __PYX_ERR(50, 1940, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1952
 *         CHKERR(SNESSetKSP(self.snes, ksp.ksp))
 * 
 *     def getKSP(self) -> KSP:             # <<<<<<<<<<<<<<
 *         """Return the linear solver used by the nonlinear solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_KSP) < (0)) __PYX_ERR(50, 1952, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_201getKSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getKSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1136])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getKSP, __pyx_t_5) < (0)) __PYX_ERR(50, 1952, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1967
 *         return ksp
 * 
 *     def setUseEW(self, flag: bool = True, *targs: Any, **kargs: Any) -> None:             # <<<<<<<<<<<<<<
 *         """Tell the solver to use the Eisenstat-Walker trick.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(50, 1967, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_targs, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(50, 1967, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(50, 1967, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 1967, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_203setUseEW, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setUseEW, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1137])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[76]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setUseEW, __pyx_t_4) < (0)) __PYX_ERR(50, 1967, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":1990
 *         if targs or kargs: self.setParamsEW(*targs, **kargs)
 * 
 *     def getUseEW(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag indicating if the solver uses the Eisenstat-Walker trick.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 1990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(50, 1990, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_205getUseEW, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getUseEW, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1138])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 1990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getUseEW, __pyx_t_5) < (0)) __PYX_ERR(50, 1990, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2004
 *         return toBool(flag)
 * 
 *     def setParamsEW(self,             # <<<<<<<<<<<<<<
 *                     version: int | None = None,
 *                     rtol_0: float | None = None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_version, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(50, 2004, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_rtol_0, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 2004, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_rtol_max, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 2004, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_gamma, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 2004, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 2004, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_alpha2, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 2004, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_threshold, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 2004, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2004, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_207setParamsEW, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setParamsEW, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1139])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[77]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setParamsEW, __pyx_t_4) < (0)) __PYX_ERR(50, 2004, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2056
 *             cgamma, calpha, calpha2, cthreshold))
 * 
 *     def getParamsEW(self) -> dict[str, int | float]:             # <<<<<<<<<<<<<<
 *         """Get the parameters of the Eisenstat and Walker trick.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_dict_str_int_float) < (0)) __PYX_ERR(50, 2056, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_209getParamsEW, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getParamsEW, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1140])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getParamsEW, __pyx_t_5) < (0)) __PYX_ERR(50, 2056, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2081
 *                 'threshold' : toReal(threshold), }
 * 
 *     def setUseKSP(self, flag=True) -> None:             # <<<<<<<<<<<<<<
 *         """Set the boolean flag indicating to use a linear solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2081, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_211setUseKSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setUseKSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1141])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[76]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setUseKSP, __pyx_t_4) < (0)) __PYX_ERR(50, 2081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2094
 *         CHKERR(SNESSetUseKSP(self.snes, bval))
 * 
 *     def getUseKSP(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag indicating if the solver uses a linear solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(50, 2094, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_213getUseKSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getUseKSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1142])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getUseKSP, __pyx_t_5) < (0)) __PYX_ERR(50, 2094, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2110
 *     # --- matrix-free / finite differences ---
 * 
 *     def setUseMF(self, flag=True) -> None:             # <<<<<<<<<<<<<<
 *         """Set the boolean flag indicating to use matrix-free finite-differencing.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2110, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_215setUseMF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setUseMF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1143])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[76]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setUseMF, __pyx_t_4) < (0)) __PYX_ERR(50, 2110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2123
 *         CHKERR(SNESSetUseMFFD(self.snes, bval))
 * 
 *     def getUseMF(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag indicating if the solver uses matrix-free finite-differencing.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(50, 2123, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_217getUseMF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getUseMF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1144])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getUseMF, __pyx_t_5) < (0)) __PYX_ERR(50, 2123, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2137
 *         return toBool(flag)
 * 
 *     def setUseFD(self, flag=True) -> None:             # <<<<<<<<<<<<<<
 *         """Set the boolean flag to use coloring finite-differencing for Jacobian assembly.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2137, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_219setUseFD, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setUseFD, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1145])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[76]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setUseFD, __pyx_t_4) < (0)) __PYX_ERR(50, 2137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2150
 *         CHKERR(SNESSetUseFDColoring(self.snes, bval))
 * 
 *     def getUseFD(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return ``true`` if the solver uses color finite-differencing for the Jacobian.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(50, 2150, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_221getUseFD, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getUseFD, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1146])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getUseFD, __pyx_t_5) < (0)) __PYX_ERR(50, 2150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2166
 *     # --- VI ---
 * 
 *     def setVariableBounds(self, Vec xl, Vec xu) -> None:             # <<<<<<<<<<<<<<
 *         """Set the vector for the variable bounds.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2166, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_223setVariableBounds, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setVariableBounds, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1147])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setVariableBounds, __pyx_t_4) < (0)) __PYX_ERR(50, 2166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2178
 *         CHKERR(SNESVISetVariableBounds(self.snes, xl.vec, xu.vec))
 * 
 *     def getVariableBounds(self) -> tuple[Vec, Vec]:             # <<<<<<<<<<<<<<
 *         """Get the vectors for the variable bounds.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Vec_Vec) < (0)) __PYX_ERR(50, 2178, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_225getVariableBounds, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getVariableBounds, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1148])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getVariableBounds, __pyx_t_5) < (0)) __PYX_ERR(50, 2178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2193
 *         return (xl, xu)
 * 
 *     def getVIInactiveSet(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the index set for the inactive set.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(50, 2193, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_227getVIInactiveSet, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getVIInactiveSet, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1149])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getVIInactiveSet, __pyx_t_4) < (0)) __PYX_ERR(50, 2193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2210
 *     # --- Python ---
 * 
 *     def createPython(self, context: Any = None, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a nonlinear solver of Python type.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_context, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(50, 2210, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(50, 2210, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(50, 2210, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_229createPython, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_createPython, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1150])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_createPython, __pyx_t_5) < (0)) __PYX_ERR(50, 2210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2235
 *         return self
 * 
 *     def setPythonContext(self, context: Any) -> None:             # <<<<<<<<<<<<<<
 *         """Set the instance of the class implementing the required Python methods.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_context, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(50, 2235, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2235, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_231setPythonContext, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setPythonContext, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1151])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setPythonContext, __pyx_t_4) < (0)) __PYX_ERR(50, 2235, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2247
 *         CHKERR(SNESPythonSetContext(self.snes, <void*>context))
 * 
 *     def getPythonContext(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return the instance of the class implementing the required Python methods.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(50, 2247, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_233getPythonContext, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getPythonContext, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1152])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getPythonContext, __pyx_t_5) < (0)) __PYX_ERR(50, 2247, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2262
 *         else: return <object> context
 * 
 *     def setPythonType(self, py_type: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the fully qualified Python name of the class to be used.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_py_type, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(50, 2262, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2262, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_235setPythonType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setPythonType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1153])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setPythonType, __pyx_t_4) < (0)) __PYX_ERR(50, 2262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2277
 *         CHKERR(SNESPythonSetType(self.snes, cval))
 * 
 *     def getPythonType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the fully qualified Python name of the class used by the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(50, 2277, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_237getPythonType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getPythonType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1154])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getPythonType, __pyx_t_5) < (0)) __PYX_ERR(50, 2277, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2294
 *     # --- Composite ---
 * 
 *     def getCompositeSNES(self, int n) -> SNES:             # <<<<<<<<<<<<<<
 *         """Return the n-th solver in the composite.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SNES) < (0)) __PYX_ERR(50, 2294, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_239getCompositeSNES, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getCompositeSNES, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1155])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getCompositeSNES, __pyx_t_4) < (0)) __PYX_ERR(50, 2294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2311
 *         return snes
 * 
 *     def getCompositeNumber(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of solvers in the composite.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 2311, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_241getCompositeNumber, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getCompositeNumber, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1156])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getCompositeNumber, __pyx_t_5) < (0)) __PYX_ERR(50, 2311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2327
 *     # --- NASM ---
 * 
 *     def getNASMSNES(self, n: int) -> SNES:             # <<<<<<<<<<<<<<
 *         """Return the n-th solver in NASM.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_n, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 2327, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SNES) < (0)) __PYX_ERR(50, 2327, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_243getNASMSNES, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getNASMSNES, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1157])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getNASMSNES, __pyx_t_4) < (0)) __PYX_ERR(50, 2327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2343
 *         return snes
 * 
 *     def getNASMNumber(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of solvers in NASM.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 2343, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_245getNASMNumber, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getNASMNumber, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1158])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getNASMNumber, __pyx_t_5) < (0)) __PYX_ERR(50, 2343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2359
 *     # --- Patch ---
 * 
 *     def setPatchCellNumbering(self, Section sec) -> None:             # <<<<<<<<<<<<<<
 *         """Set cell patch numbering."""
 *         CHKERR(SNESPatchSetCellNumbering(self.snes, sec.sec))
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2359, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_247setPatchCellNumbering, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setPatchCellNumbering, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1159])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setPatchCellNumbering, __pyx_t_4) < (0)) __PYX_ERR(50, 2359, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2363
 *         CHKERR(SNESPatchSetCellNumbering(self.snes, sec.sec))
 * 
 *     def setPatchDiscretisationInfo(self, dms, bs,             # <<<<<<<<<<<<<<
 *                                    cellNodeMaps,
 *                                    subspaceOffsets,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2363, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_249setPatchDiscretisationInfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setPatchDiscretisationInfo, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1160])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setPatchDiscretisationInfo, __pyx_t_5) < (0)) __PYX_ERR(50, 2363, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2404
 *         CHKERR(PetscFree(ccellNodeMaps))
 * 
 *     def setPatchComputeOperator(self, operator, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set patch compute operator."""
 *         if args is  None: args  = ()
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2404, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_251setPatchComputeOperator, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setPatchComputeOperator, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1161])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setPatchComputeOperator, __pyx_t_4) < (0)) __PYX_ERR(50, 2404, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2412
 *         CHKERR(SNESPatchSetComputeOperator(self.snes, PCPatch_ComputeOperator, <void*>context))
 * 
 *     def setPatchComputeFunction(self, function, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set patch compute function."""
 *         if args is  None: args  = ()
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2412, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_253setPatchComputeFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setPatchComputeFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1162])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setPatchComputeFunction, __pyx_t_5) < (0)) __PYX_ERR(50, 2412, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2420
 *         CHKERR(SNESPatchSetComputeFunction(self.snes, PCPatch_ComputeFunction, <void*>context))
 * 
 *     def setPatchConstructType(self, typ, operator=None, args=None, kargs=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set patch construct type."""
 *         if args is  None: args  = ()
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2420, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_255setPatchConstructType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setPatchConstructType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1163])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setPatchConstructType, __pyx_t_4) < (0)) __PYX_ERR(50, 2420, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2619
 *     # --- linesearch ---
 * 
 *     def getLineSearch(self) -> SNESLineSearch:             # <<<<<<<<<<<<<<
 *         """Return the linesearch object associated with this SNES.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SNESLineSearch) < (0)) __PYX_ERR(50, 2619, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_257getLineSearch, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getLineSearch, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1164])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getLineSearch, __pyx_t_5) < (0)) __PYX_ERR(50, 2619, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2634
 *         return linesearch
 * 
 *     def setLineSearch(self, SNESLineSearch linesearch) -> None:             # <<<<<<<<<<<<<<
 *         """Set the linesearch object to be used by this SNES.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2634, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_259setLineSearch, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setLineSearch, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1165])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setLineSearch, __pyx_t_4) < (0)) __PYX_ERR(50, 2634, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2656
 *     # --- NewtonAL methods ---
 * 
 *     def setNewtonALFunction(self, function: SNESFunction | None,             # <<<<<<<<<<<<<<
 *                             args: tuple[Any, ...] | None = None,
 *                             kargs: dict[str, Any] | None = None) -> None:
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_function, __pyx_mstate_global->__pyx_kp_u_SNESFunction_None) < (0)) __PYX_ERR(50, 2656, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(50, 2656, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(50, 2656, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2656, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_261setNewtonALFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setNewtonALFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1166])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setNewtonALFunction, __pyx_t_5) < (0)) __PYX_ERR(50, 2656, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2687
 *             CHKERR(SNESNewtonALSetFunction(self.snes, NULL, NULL))
 * 
 *     def getNewtonALLoadParameter(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the load parameter for SNESNEWTONAL.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(50, 2687, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_263getNewtonALLoadParameter, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_getNewtonALLoadParameter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1167])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_getNewtonALLoadParameter, __pyx_t_4) < (0)) __PYX_ERR(50, 2687, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2702
 *         return toReal(load)
 * 
 *     def setNewtonALCorrectionType(self, corrtype: NewtonALCorrectionType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the correction type for SNESNEWTONAL.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_corrtype, __pyx_mstate_global->__pyx_n_u_NewtonALCorrectionType) < (0)) __PYX_ERR(50, 2702, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2702, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4SNES_265setNewtonALCorrectionType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNES_setNewtonALCorrectionType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1168])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNES, __pyx_mstate_global->__pyx_n_u_setNewtonALCorrectionType, __pyx_t_5) < (0)) __PYX_ERR(50, 2702, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2717
 * 
 * 
 * class SNESLineSearchType(object):             # <<<<<<<<<<<<<<
 *     """SNES linesearch type.
 * 
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[141]); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_SNESLineSearchType, __pyx_mstate_global->__pyx_n_u_SNESLineSearchType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_SNES_linesearch_type_See_Also_pe); if (unlikely(!__pyx_t_10)) __PYX_ERR(50, 2717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[141]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[141]) < 0))) __PYX_ERR(50, 2717, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/SNES.pyx":2725
 * 
 *     """
 *     BT         = S_(SNESLINESEARCHBT)             # <<<<<<<<<<<<<<
 *     NLEQERR    = S_(SNESLINESEARCHNLEQERR)
 *     BASIC      = S_(SNESLINESEARCHBASIC)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESLINESEARCHBT); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 2725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BT, __pyx_t_14) < (0)) __PYX_ERR(50, 2725, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2726
 *     """
 *     BT         = S_(SNESLINESEARCHBT)
 *     NLEQERR    = S_(SNESLINESEARCHNLEQERR)             # <<<<<<<<<<<<<<
 *     BASIC      = S_(SNESLINESEARCHBASIC)
 *     NONE       = S_(SNESLINESEARCHNONE)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESLINESEARCHNLEQERR); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 2726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NLEQERR, __pyx_t_14) < (0)) __PYX_ERR(50, 2726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2727
 *     BT         = S_(SNESLINESEARCHBT)
 *     NLEQERR    = S_(SNESLINESEARCHNLEQERR)
 *     BASIC      = S_(SNESLINESEARCHBASIC)             # <<<<<<<<<<<<<<
 *     NONE       = S_(SNESLINESEARCHNONE)
 *     SECANT     = S_(SNESLINESEARCHSECANT)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESLINESEARCHBASIC); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 2727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BASIC, __pyx_t_14) < (0)) __PYX_ERR(50, 2727, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2728
 *     NLEQERR    = S_(SNESLINESEARCHNLEQERR)
 *     BASIC      = S_(SNESLINESEARCHBASIC)
 *     NONE       = S_(SNESLINESEARCHNONE)             # <<<<<<<<<<<<<<
 *     SECANT     = S_(SNESLINESEARCHSECANT)
 *     CP         = S_(SNESLINESEARCHCP)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESLINESEARCHNONE); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 2728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NONE, __pyx_t_14) < (0)) __PYX_ERR(50, 2728, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2729
 *     BASIC      = S_(SNESLINESEARCHBASIC)
 *     NONE       = S_(SNESLINESEARCHNONE)
 *     SECANT     = S_(SNESLINESEARCHSECANT)             # <<<<<<<<<<<<<<
 *     CP         = S_(SNESLINESEARCHCP)
 *     SHELL      = S_(SNESLINESEARCHSHELL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESLINESEARCHSECANT); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 2729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SECANT, __pyx_t_14) < (0)) __PYX_ERR(50, 2729, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2730
 *     NONE       = S_(SNESLINESEARCHNONE)
 *     SECANT     = S_(SNESLINESEARCHSECANT)
 *     CP         = S_(SNESLINESEARCHCP)             # <<<<<<<<<<<<<<
 *     SHELL      = S_(SNESLINESEARCHSHELL)
 *     NCGLINEAR  = S_(SNESLINESEARCHNCGLINEAR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESLINESEARCHCP); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 2730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CP, __pyx_t_14) < (0)) __PYX_ERR(50, 2730, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2731
 *     SECANT     = S_(SNESLINESEARCHSECANT)
 *     CP         = S_(SNESLINESEARCHCP)
 *     SHELL      = S_(SNESLINESEARCHSHELL)             # <<<<<<<<<<<<<<
 *     NCGLINEAR  = S_(SNESLINESEARCHNCGLINEAR)
 *     BISECTION  = S_(SNESLINESEARCHBISECTION)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESLINESEARCHSHELL); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 2731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SHELL, __pyx_t_14) < (0)) __PYX_ERR(50, 2731, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2732
 *     CP         = S_(SNESLINESEARCHCP)
 *     SHELL      = S_(SNESLINESEARCHSHELL)
 *     NCGLINEAR  = S_(SNESLINESEARCHNCGLINEAR)             # <<<<<<<<<<<<<<
 *     BISECTION  = S_(SNESLINESEARCHBISECTION)
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESLINESEARCHNCGLINEAR); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 2732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NCGLINEAR, __pyx_t_14) < (0)) __PYX_ERR(50, 2732, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2733
 *     SHELL      = S_(SNESLINESEARCHSHELL)
 *     NCGLINEAR  = S_(SNESLINESEARCHNCGLINEAR)
 *     BISECTION  = S_(SNESLINESEARCHBISECTION)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(SNESLINESEARCHBISECTION); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 2733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BISECTION, __pyx_t_14) < (0)) __PYX_ERR(50, 2733, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2717
 * 
 * 
 * class SNESLineSearchType(object):             # <<<<<<<<<<<<<<
 *     """SNES linesearch type.
 * 
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SNESLineSearchType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(50, 2717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SNESLineSearchType, __pyx_t_14) < (0)) __PYX_ERR(50, 2717, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2745
 *     """
 * 
 *     Type = SNESLineSearchType             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SNESLineSearchType); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_5) < (0)) __PYX_ERR(50, 2745, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2751
 *         self.snesls = NULL
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a new linesearch object.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(50, 2751, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(50, 2751, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_3create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNESLineSearch_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1169])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_4) < (0)) __PYX_ERR(50, 2751, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2772
 *         return self
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the linesearch from the options database.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2772, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_5setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNESLineSearch_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1170])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_5) < (0)) __PYX_ERR(50, 2772, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2784
 *         CHKERR(SNESLineSearchSetFromOptions(self.snesls))
 * 
 *     def view(self, Viewer viewer = None) -> None:             # <<<<<<<<<<<<<<
 *         """View the linesearch object.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2784, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_7view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNESLineSearch_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1171])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_4) < (0)) __PYX_ERR(50, 2784, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2803
 *         CHKERR(SNESLineSearchView(self.snesls, cviewer))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the linesearch.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(50, 2803, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_9getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNESLineSearch_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1172])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_5) < (0)) __PYX_ERR(50, 2803, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2817
 *         return bytes2str(ctype)
 * 
 *     def setType(self, ls_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the linesearch.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ls_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(50, 2817, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2817, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_11setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNESLineSearch_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1173])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_4) < (0)) __PYX_ERR(50, 2817, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2831
 *         CHKERR(SNESLineSearchSetType(self.snesls, ctype))
 * 
 *     def getTolerances(self) -> tuple[float, float, float, float, float, int]:             # <<<<<<<<<<<<<<
 *         """Return the tolerance parameters used in the linesearch.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_float_float_float_fl_2) < (0)) __PYX_ERR(50, 2831, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_13getTolerances, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNESLineSearch_getTolerances, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1174])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch, __pyx_mstate_global->__pyx_n_u_getTolerances, __pyx_t_5) < (0)) __PYX_ERR(50, 2831, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2860
 *         return (toReal(minstep), toReal(maxstep), toReal(rtol), toReal(atol), toReal(ltol), toInt(max_its))
 * 
 *     def setTolerances(self, minstep: float | None = None, maxstep: float | None = None, rtol: float | None = None, atol: float | None = None, ltol: float | None = None, max_its: int | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the tolerance parameters used in the linesearch.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_minstep, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 2860, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_maxstep, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 2860, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_rtol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 2860, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_atol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 2860, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ltol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(50, 2860, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_max_its, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(50, 2860, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2860, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_15setTolerances, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNESLineSearch_setTolerances, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1175])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[142]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch, __pyx_mstate_global->__pyx_n_u_setTolerances, __pyx_t_4) < (0)) __PYX_ERR(50, 2860, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2898
 *         CHKERR(SNESLineSearchSetTolerances(self.snesls, cminstep, cmaxstep, crtol, catol, cltol, cmaxits))
 * 
 *     def getOrder(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the order of the linesearch.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 2898, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_17getOrder, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNESLineSearch_getOrder, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1176])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch, __pyx_mstate_global->__pyx_n_u_getOrder, __pyx_t_5) < (0)) __PYX_ERR(50, 2898, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2912
 *         return toInt(order)
 * 
 *     def setOrder(self, order: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the order of the linesearch.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_order, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(50, 2912, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(50, 2912, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_19setOrder, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNESLineSearch_setOrder, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1177])); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch, __pyx_mstate_global->__pyx_n_u_setOrder, __pyx_t_4) < (0)) __PYX_ERR(50, 2912, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2925
 *         CHKERR(SNESLineSearchSetOrder(self.snesls, iorder))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the linesearch object.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(50, 2925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(50, 2925, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_14SNESLineSearch_21destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SNESLineSearch_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1178])); if (unlikely(!__pyx_t_5)) __PYX_ERR(50, 2925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_SNESLineSearch, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_5) < (0)) __PYX_ERR(50, 2925, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/SNES.pyx":2938
 *         return self
 * 
 * del SNESType             # <<<<<<<<<<<<<<
 * del SNESNormSchedule
 * del SNESConvergedReason
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SNESType) < (0)) __PYX_ERR(50, 2938, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2939
 * 
 * del SNESType
 * del SNESNormSchedule             # <<<<<<<<<<<<<<
 * del SNESConvergedReason
 * del SNESNewtonALCorrectionType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SNESNormSchedule) < (0)) __PYX_ERR(50, 2939, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2940
 * del SNESType
 * del SNESNormSchedule
 * del SNESConvergedReason             # <<<<<<<<<<<<<<
 * del SNESNewtonALCorrectionType
 * del SNESLineSearchType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SNESConvergedReason) < (0)) __PYX_ERR(50, 2940, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2941
 * del SNESNormSchedule
 * del SNESConvergedReason
 * del SNESNewtonALCorrectionType             # <<<<<<<<<<<<<<
 * del SNESLineSearchType
 * 
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SNESNewtonALCorrectionType) < (0)) __PYX_ERR(50, 2941, __pyx_L1_error)

  /* "petsc4py/PETSc/SNES.pyx":2942
 * del SNESConvergedReason
 * del SNESNewtonALCorrectionType
 * del SNESLineSearchType             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SNESLineSearchType) < (0)) __PYX_ERR(50, 2942, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":4
 * # -----------------------------------------------------------------------------
 * 
 * class TSType(object):             # <<<<<<<<<<<<<<
 *     """The time stepping method."""
 *     # native
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[144]); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_TSType, __pyx_mstate_global->__pyx_n_u_TSType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_time_stepping_method); if (unlikely(!__pyx_t_10)) __PYX_ERR(51, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[144]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[144]) < 0))) __PYX_ERR(51, 4, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/TS.pyx":7
 *     """The time stepping method."""
 *     # native
 *     EULER           = S_(TSEULER)             # <<<<<<<<<<<<<<
 *     BEULER          = S_(TSBEULER)
 *     BASICSYMPLECTIC = S_(TSBASICSYMPLECTIC)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSEULER); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_EULER, __pyx_t_14) < (0)) __PYX_ERR(51, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":8
 *     # native
 *     EULER           = S_(TSEULER)
 *     BEULER          = S_(TSBEULER)             # <<<<<<<<<<<<<<
 *     BASICSYMPLECTIC = S_(TSBASICSYMPLECTIC)
 *     PSEUDO          = S_(TSPSEUDO)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSBEULER); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BEULER, __pyx_t_14) < (0)) __PYX_ERR(51, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":9
 *     EULER           = S_(TSEULER)
 *     BEULER          = S_(TSBEULER)
 *     BASICSYMPLECTIC = S_(TSBASICSYMPLECTIC)             # <<<<<<<<<<<<<<
 *     PSEUDO          = S_(TSPSEUDO)
 *     CN              = S_(TSCN)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSBASICSYMPLECTIC); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BASICSYMPLECTIC, __pyx_t_14) < (0)) __PYX_ERR(51, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":10
 *     BEULER          = S_(TSBEULER)
 *     BASICSYMPLECTIC = S_(TSBASICSYMPLECTIC)
 *     PSEUDO          = S_(TSPSEUDO)             # <<<<<<<<<<<<<<
 *     CN              = S_(TSCN)
 *     SUNDIALS        = S_(TSSUNDIALS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSPSEUDO); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PSEUDO, __pyx_t_14) < (0)) __PYX_ERR(51, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":11
 *     BASICSYMPLECTIC = S_(TSBASICSYMPLECTIC)
 *     PSEUDO          = S_(TSPSEUDO)
 *     CN              = S_(TSCN)             # <<<<<<<<<<<<<<
 *     SUNDIALS        = S_(TSSUNDIALS)
 *     RK              = S_(TSRK)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSCN); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CN, __pyx_t_14) < (0)) __PYX_ERR(51, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":12
 *     PSEUDO          = S_(TSPSEUDO)
 *     CN              = S_(TSCN)
 *     SUNDIALS        = S_(TSSUNDIALS)             # <<<<<<<<<<<<<<
 *     RK              = S_(TSRK)
 *     PYTHON          = S_(TSPYTHON)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSSUNDIALS); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SUNDIALS, __pyx_t_14) < (0)) __PYX_ERR(51, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":13
 *     CN              = S_(TSCN)
 *     SUNDIALS        = S_(TSSUNDIALS)
 *     RK              = S_(TSRK)             # <<<<<<<<<<<<<<
 *     PYTHON          = S_(TSPYTHON)
 *     THETA           = S_(TSTHETA)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSRK); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RK, __pyx_t_14) < (0)) __PYX_ERR(51, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":14
 *     SUNDIALS        = S_(TSSUNDIALS)
 *     RK              = S_(TSRK)
 *     PYTHON          = S_(TSPYTHON)             # <<<<<<<<<<<<<<
 *     THETA           = S_(TSTHETA)
 *     ALPHA           = S_(TSALPHA)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSPYTHON); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PYTHON, __pyx_t_14) < (0)) __PYX_ERR(51, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":15
 *     RK              = S_(TSRK)
 *     PYTHON          = S_(TSPYTHON)
 *     THETA           = S_(TSTHETA)             # <<<<<<<<<<<<<<
 *     ALPHA           = S_(TSALPHA)
 *     ALPHA2          = S_(TSALPHA2)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSTHETA); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_THETA, __pyx_t_14) < (0)) __PYX_ERR(51, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":16
 *     PYTHON          = S_(TSPYTHON)
 *     THETA           = S_(TSTHETA)
 *     ALPHA           = S_(TSALPHA)             # <<<<<<<<<<<<<<
 *     ALPHA2          = S_(TSALPHA2)
 *     GLLE            = S_(TSGLLE)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSALPHA); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ALPHA, __pyx_t_14) < (0)) __PYX_ERR(51, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":17
 *     THETA           = S_(TSTHETA)
 *     ALPHA           = S_(TSALPHA)
 *     ALPHA2          = S_(TSALPHA2)             # <<<<<<<<<<<<<<
 *     GLLE            = S_(TSGLLE)
 *     GLEE            = S_(TSGLEE)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSALPHA2); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ALPHA2, __pyx_t_14) < (0)) __PYX_ERR(51, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":18
 *     ALPHA           = S_(TSALPHA)
 *     ALPHA2          = S_(TSALPHA2)
 *     GLLE            = S_(TSGLLE)             # <<<<<<<<<<<<<<
 *     GLEE            = S_(TSGLEE)
 *     SSP             = S_(TSSSP)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSGLLE); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_GLLE, __pyx_t_14) < (0)) __PYX_ERR(51, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":19
 *     ALPHA2          = S_(TSALPHA2)
 *     GLLE            = S_(TSGLLE)
 *     GLEE            = S_(TSGLEE)             # <<<<<<<<<<<<<<
 *     SSP             = S_(TSSSP)
 *     ARKIMEX         = S_(TSARKIMEX)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSGLEE); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_GLEE, __pyx_t_14) < (0)) __PYX_ERR(51, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":20
 *     GLLE            = S_(TSGLLE)
 *     GLEE            = S_(TSGLEE)
 *     SSP             = S_(TSSSP)             # <<<<<<<<<<<<<<
 *     ARKIMEX         = S_(TSARKIMEX)
 *     DIRK            = S_(TSDIRK)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSSSP); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SSP, __pyx_t_14) < (0)) __PYX_ERR(51, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":21
 *     GLEE            = S_(TSGLEE)
 *     SSP             = S_(TSSSP)
 *     ARKIMEX         = S_(TSARKIMEX)             # <<<<<<<<<<<<<<
 *     DIRK            = S_(TSDIRK)
 *     ROSW            = S_(TSROSW)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ARKIMEX, __pyx_t_14) < (0)) __PYX_ERR(51, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":22
 *     SSP             = S_(TSSSP)
 *     ARKIMEX         = S_(TSARKIMEX)
 *     DIRK            = S_(TSDIRK)             # <<<<<<<<<<<<<<
 *     ROSW            = S_(TSROSW)
 *     EIMEX           = S_(TSEIMEX)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRK); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRK, __pyx_t_14) < (0)) __PYX_ERR(51, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":23
 *     ARKIMEX         = S_(TSARKIMEX)
 *     DIRK            = S_(TSDIRK)
 *     ROSW            = S_(TSROSW)             # <<<<<<<<<<<<<<
 *     EIMEX           = S_(TSEIMEX)
 *     MIMEX           = S_(TSMIMEX)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSROSW); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ROSW, __pyx_t_14) < (0)) __PYX_ERR(51, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":24
 *     DIRK            = S_(TSDIRK)
 *     ROSW            = S_(TSROSW)
 *     EIMEX           = S_(TSEIMEX)             # <<<<<<<<<<<<<<
 *     MIMEX           = S_(TSMIMEX)
 *     BDF             = S_(TSBDF)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSEIMEX); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_EIMEX, __pyx_t_14) < (0)) __PYX_ERR(51, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":25
 *     ROSW            = S_(TSROSW)
 *     EIMEX           = S_(TSEIMEX)
 *     MIMEX           = S_(TSMIMEX)             # <<<<<<<<<<<<<<
 *     BDF             = S_(TSBDF)
 *     RADAU5          = S_(TSRADAU5)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSMIMEX); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MIMEX, __pyx_t_14) < (0)) __PYX_ERR(51, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":26
 *     EIMEX           = S_(TSEIMEX)
 *     MIMEX           = S_(TSMIMEX)
 *     BDF             = S_(TSBDF)             # <<<<<<<<<<<<<<
 *     RADAU5          = S_(TSRADAU5)
 *     MPRK            = S_(TSMPRK)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSBDF); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BDF, __pyx_t_14) < (0)) __PYX_ERR(51, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":27
 *     MIMEX           = S_(TSMIMEX)
 *     BDF             = S_(TSBDF)
 *     RADAU5          = S_(TSRADAU5)             # <<<<<<<<<<<<<<
 *     MPRK            = S_(TSMPRK)
 *     DISCGRAD        = S_(TSDISCGRAD)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSRADAU5); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RADAU5, __pyx_t_14) < (0)) __PYX_ERR(51, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":28
 *     BDF             = S_(TSBDF)
 *     RADAU5          = S_(TSRADAU5)
 *     MPRK            = S_(TSMPRK)             # <<<<<<<<<<<<<<
 *     DISCGRAD        = S_(TSDISCGRAD)
 *     # aliases
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSMPRK); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MPRK, __pyx_t_14) < (0)) __PYX_ERR(51, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":29
 *     RADAU5          = S_(TSRADAU5)
 *     MPRK            = S_(TSMPRK)
 *     DISCGRAD        = S_(TSDISCGRAD)             # <<<<<<<<<<<<<<
 *     # aliases
 *     FE = EULER
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDISCGRAD); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DISCGRAD, __pyx_t_14) < (0)) __PYX_ERR(51, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":31
 *     DISCGRAD        = S_(TSDISCGRAD)
 *     # aliases
 *     FE = EULER             # <<<<<<<<<<<<<<
 *     BE = BEULER
 *     TH = THETA
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_EULER);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_EULER);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FE, __pyx_t_14) < (0)) __PYX_ERR(51, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":32
 *     # aliases
 *     FE = EULER
 *     BE = BEULER             # <<<<<<<<<<<<<<
 *     TH = THETA
 *     CRANK_NICOLSON = CN
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BEULER);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_BEULER);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BE, __pyx_t_14) < (0)) __PYX_ERR(51, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":33
 *     FE = EULER
 *     BE = BEULER
 *     TH = THETA             # <<<<<<<<<<<<<<
 *     CRANK_NICOLSON = CN
 *     RUNGE_KUTTA    = RK
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_THETA);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_THETA);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_TH, __pyx_t_14) < (0)) __PYX_ERR(51, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":34
 *     BE = BEULER
 *     TH = THETA
 *     CRANK_NICOLSON = CN             # <<<<<<<<<<<<<<
 *     RUNGE_KUTTA    = RK
 * 
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CN);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_CN);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_CRANK_NICOLSON, __pyx_t_14) < (0)) __PYX_ERR(51, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":35
 *     TH = THETA
 *     CRANK_NICOLSON = CN
 *     RUNGE_KUTTA    = RK             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = PyObject_GetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RK);
  if (unlikely(!__pyx_t_14)) {
    PyErr_Clear();
    __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_RK);
  }
  if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RUNGE_KUTTA, __pyx_t_14) < (0)) __PYX_ERR(51, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":4
 * # -----------------------------------------------------------------------------
 * 
 * class TSType(object):             # <<<<<<<<<<<<<<
 *     """The time stepping method."""
 *     # native
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TSType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TSType, __pyx_t_14) < (0)) __PYX_ERR(51, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":38
 * 
 * 
 * class TSRKType(object):             # <<<<<<<<<<<<<<
 *     """The *RK* subtype."""
 *     RK1FE = S_(TSRK1FE)
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[146]); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_TSRKType, __pyx_mstate_global->__pyx_n_u_TSRKType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_RK_subtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(51, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[146]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[146]) < 0))) __PYX_ERR(51, 38, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/TS.pyx":40
 * class TSRKType(object):
 *     """The *RK* subtype."""
 *     RK1FE = S_(TSRK1FE)             # <<<<<<<<<<<<<<
 *     RK2A  = S_(TSRK2A)
 *     RK2B  = S_(TSRK2B)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSRK1FE); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RK1FE, __pyx_t_14) < (0)) __PYX_ERR(51, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":41
 *     """The *RK* subtype."""
 *     RK1FE = S_(TSRK1FE)
 *     RK2A  = S_(TSRK2A)             # <<<<<<<<<<<<<<
 *     RK2B  = S_(TSRK2B)
 *     RK4   = S_(TSRK4)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSRK2A); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RK2A, __pyx_t_14) < (0)) __PYX_ERR(51, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":42
 *     RK1FE = S_(TSRK1FE)
 *     RK2A  = S_(TSRK2A)
 *     RK2B  = S_(TSRK2B)             # <<<<<<<<<<<<<<
 *     RK4   = S_(TSRK4)
 *     RK3BS = S_(TSRK3BS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSRK2B); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RK2B, __pyx_t_14) < (0)) __PYX_ERR(51, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":43
 *     RK2A  = S_(TSRK2A)
 *     RK2B  = S_(TSRK2B)
 *     RK4   = S_(TSRK4)             # <<<<<<<<<<<<<<
 *     RK3BS = S_(TSRK3BS)
 *     RK3   = S_(TSRK3)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSRK4); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RK4, __pyx_t_14) < (0)) __PYX_ERR(51, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":44
 *     RK2B  = S_(TSRK2B)
 *     RK4   = S_(TSRK4)
 *     RK3BS = S_(TSRK3BS)             # <<<<<<<<<<<<<<
 *     RK3   = S_(TSRK3)
 *     RK5F  = S_(TSRK5F)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSRK3BS); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RK3BS, __pyx_t_14) < (0)) __PYX_ERR(51, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":45
 *     RK4   = S_(TSRK4)
 *     RK3BS = S_(TSRK3BS)
 *     RK3   = S_(TSRK3)             # <<<<<<<<<<<<<<
 *     RK5F  = S_(TSRK5F)
 *     RK5DP = S_(TSRK5DP)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSRK3); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RK3, __pyx_t_14) < (0)) __PYX_ERR(51, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":46
 *     RK3BS = S_(TSRK3BS)
 *     RK3   = S_(TSRK3)
 *     RK5F  = S_(TSRK5F)             # <<<<<<<<<<<<<<
 *     RK5DP = S_(TSRK5DP)
 *     RK5BS = S_(TSRK5BS)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSRK5F); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RK5F, __pyx_t_14) < (0)) __PYX_ERR(51, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":47
 *     RK3   = S_(TSRK3)
 *     RK5F  = S_(TSRK5F)
 *     RK5DP = S_(TSRK5DP)             # <<<<<<<<<<<<<<
 *     RK5BS = S_(TSRK5BS)
 *     RK6VR = S_(TSRK6VR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSRK5DP); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RK5DP, __pyx_t_14) < (0)) __PYX_ERR(51, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":48
 *     RK5F  = S_(TSRK5F)
 *     RK5DP = S_(TSRK5DP)
 *     RK5BS = S_(TSRK5BS)             # <<<<<<<<<<<<<<
 *     RK6VR = S_(TSRK6VR)
 *     RK7VR = S_(TSRK7VR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSRK5BS); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RK5BS, __pyx_t_14) < (0)) __PYX_ERR(51, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":49
 *     RK5DP = S_(TSRK5DP)
 *     RK5BS = S_(TSRK5BS)
 *     RK6VR = S_(TSRK6VR)             # <<<<<<<<<<<<<<
 *     RK7VR = S_(TSRK7VR)
 *     RK8VR = S_(TSRK8VR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSRK6VR); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RK6VR, __pyx_t_14) < (0)) __PYX_ERR(51, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":50
 *     RK5BS = S_(TSRK5BS)
 *     RK6VR = S_(TSRK6VR)
 *     RK7VR = S_(TSRK7VR)             # <<<<<<<<<<<<<<
 *     RK8VR = S_(TSRK8VR)
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSRK7VR); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RK7VR, __pyx_t_14) < (0)) __PYX_ERR(51, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":51
 *     RK6VR = S_(TSRK6VR)
 *     RK7VR = S_(TSRK7VR)
 *     RK8VR = S_(TSRK8VR)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSRK8VR); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RK8VR, __pyx_t_14) < (0)) __PYX_ERR(51, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":38
 * 
 * 
 * class TSRKType(object):             # <<<<<<<<<<<<<<
 *     """The *RK* subtype."""
 *     RK1FE = S_(TSRK1FE)
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TSRKType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TSRKType, __pyx_t_14) < (0)) __PYX_ERR(51, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":54
 * 
 * 
 * class TSARKIMEXType(object):             # <<<<<<<<<<<<<<
 *     """The *ARKIMEX* subtype."""
 *     ARKIMEX1BEE   = S_(TSARKIMEX1BEE)
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[148]); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_TSARKIMEXType, __pyx_mstate_global->__pyx_n_u_TSARKIMEXType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_ARKIMEX_subtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(51, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[148]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[148]) < 0))) __PYX_ERR(51, 54, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/TS.pyx":56
 * class TSARKIMEXType(object):
 *     """The *ARKIMEX* subtype."""
 *     ARKIMEX1BEE   = S_(TSARKIMEX1BEE)             # <<<<<<<<<<<<<<
 *     ARKIMEXA2     = S_(TSARKIMEXA2)
 *     ARKIMEXL2     = S_(TSARKIMEXL2)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX1BEE); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ARKIMEX1BEE, __pyx_t_14) < (0)) __PYX_ERR(51, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":57
 *     """The *ARKIMEX* subtype."""
 *     ARKIMEX1BEE   = S_(TSARKIMEX1BEE)
 *     ARKIMEXA2     = S_(TSARKIMEXA2)             # <<<<<<<<<<<<<<
 *     ARKIMEXL2     = S_(TSARKIMEXL2)
 *     ARKIMEXARS122 = S_(TSARKIMEXARS122)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXA2); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ARKIMEXA2, __pyx_t_14) < (0)) __PYX_ERR(51, 57, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":58
 *     ARKIMEX1BEE   = S_(TSARKIMEX1BEE)
 *     ARKIMEXA2     = S_(TSARKIMEXA2)
 *     ARKIMEXL2     = S_(TSARKIMEXL2)             # <<<<<<<<<<<<<<
 *     ARKIMEXARS122 = S_(TSARKIMEXARS122)
 *     ARKIMEX2C     = S_(TSARKIMEX2C)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXL2); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ARKIMEXL2, __pyx_t_14) < (0)) __PYX_ERR(51, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":59
 *     ARKIMEXA2     = S_(TSARKIMEXA2)
 *     ARKIMEXL2     = S_(TSARKIMEXL2)
 *     ARKIMEXARS122 = S_(TSARKIMEXARS122)             # <<<<<<<<<<<<<<
 *     ARKIMEX2C     = S_(TSARKIMEX2C)
 *     ARKIMEX2D     = S_(TSARKIMEX2D)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXARS122); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ARKIMEXARS122, __pyx_t_14) < (0)) __PYX_ERR(51, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":60
 *     ARKIMEXL2     = S_(TSARKIMEXL2)
 *     ARKIMEXARS122 = S_(TSARKIMEXARS122)
 *     ARKIMEX2C     = S_(TSARKIMEX2C)             # <<<<<<<<<<<<<<
 *     ARKIMEX2D     = S_(TSARKIMEX2D)
 *     ARKIMEX2E     = S_(TSARKIMEX2E)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX2C); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ARKIMEX2C, __pyx_t_14) < (0)) __PYX_ERR(51, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":61
 *     ARKIMEXARS122 = S_(TSARKIMEXARS122)
 *     ARKIMEX2C     = S_(TSARKIMEX2C)
 *     ARKIMEX2D     = S_(TSARKIMEX2D)             # <<<<<<<<<<<<<<
 *     ARKIMEX2E     = S_(TSARKIMEX2E)
 *     ARKIMEXPRSSP2 = S_(TSARKIMEXPRSSP2)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX2D); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ARKIMEX2D, __pyx_t_14) < (0)) __PYX_ERR(51, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":62
 *     ARKIMEX2C     = S_(TSARKIMEX2C)
 *     ARKIMEX2D     = S_(TSARKIMEX2D)
 *     ARKIMEX2E     = S_(TSARKIMEX2E)             # <<<<<<<<<<<<<<
 *     ARKIMEXPRSSP2 = S_(TSARKIMEXPRSSP2)
 *     ARKIMEX3      = S_(TSARKIMEX3)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX2E); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ARKIMEX2E, __pyx_t_14) < (0)) __PYX_ERR(51, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":63
 *     ARKIMEX2D     = S_(TSARKIMEX2D)
 *     ARKIMEX2E     = S_(TSARKIMEX2E)
 *     ARKIMEXPRSSP2 = S_(TSARKIMEXPRSSP2)             # <<<<<<<<<<<<<<
 *     ARKIMEX3      = S_(TSARKIMEX3)
 *     ARKIMEXBPR3   = S_(TSARKIMEXBPR3)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXPRSSP2); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ARKIMEXPRSSP2, __pyx_t_14) < (0)) __PYX_ERR(51, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":64
 *     ARKIMEX2E     = S_(TSARKIMEX2E)
 *     ARKIMEXPRSSP2 = S_(TSARKIMEXPRSSP2)
 *     ARKIMEX3      = S_(TSARKIMEX3)             # <<<<<<<<<<<<<<
 *     ARKIMEXBPR3   = S_(TSARKIMEXBPR3)
 *     ARKIMEXARS443 = S_(TSARKIMEXARS443)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX3); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ARKIMEX3, __pyx_t_14) < (0)) __PYX_ERR(51, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":65
 *     ARKIMEXPRSSP2 = S_(TSARKIMEXPRSSP2)
 *     ARKIMEX3      = S_(TSARKIMEX3)
 *     ARKIMEXBPR3   = S_(TSARKIMEXBPR3)             # <<<<<<<<<<<<<<
 *     ARKIMEXARS443 = S_(TSARKIMEXARS443)
 *     ARKIMEX4      = S_(TSARKIMEX4)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXBPR3); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ARKIMEXBPR3, __pyx_t_14) < (0)) __PYX_ERR(51, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":66
 *     ARKIMEX3      = S_(TSARKIMEX3)
 *     ARKIMEXBPR3   = S_(TSARKIMEXBPR3)
 *     ARKIMEXARS443 = S_(TSARKIMEXARS443)             # <<<<<<<<<<<<<<
 *     ARKIMEX4      = S_(TSARKIMEX4)
 *     ARKIMEX5      = S_(TSARKIMEX5)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEXARS443); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ARKIMEXARS443, __pyx_t_14) < (0)) __PYX_ERR(51, 66, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":67
 *     ARKIMEXBPR3   = S_(TSARKIMEXBPR3)
 *     ARKIMEXARS443 = S_(TSARKIMEXARS443)
 *     ARKIMEX4      = S_(TSARKIMEX4)             # <<<<<<<<<<<<<<
 *     ARKIMEX5      = S_(TSARKIMEX5)
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX4); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ARKIMEX4, __pyx_t_14) < (0)) __PYX_ERR(51, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":68
 *     ARKIMEXARS443 = S_(TSARKIMEXARS443)
 *     ARKIMEX4      = S_(TSARKIMEX4)
 *     ARKIMEX5      = S_(TSARKIMEX5)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSARKIMEX5); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ARKIMEX5, __pyx_t_14) < (0)) __PYX_ERR(51, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":54
 * 
 * 
 * class TSARKIMEXType(object):             # <<<<<<<<<<<<<<
 *     """The *ARKIMEX* subtype."""
 *     ARKIMEX1BEE   = S_(TSARKIMEX1BEE)
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TSARKIMEXType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TSARKIMEXType, __pyx_t_14) < (0)) __PYX_ERR(51, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":71
 * 
 * 
 * class TSDIRKType(object):             # <<<<<<<<<<<<<<
 *     """The *DIRK* subtype."""
 *     DIRKS212      = S_(TSDIRKS212)
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[150]); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_TSDIRKType, __pyx_mstate_global->__pyx_n_u_TSDIRKType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_DIRK_subtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(51, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[150]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[150]) < 0))) __PYX_ERR(51, 71, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/TS.pyx":73
 * class TSDIRKType(object):
 *     """The *DIRK* subtype."""
 *     DIRKS212      = S_(TSDIRKS212)             # <<<<<<<<<<<<<<
 *     DIRKES122SAL  = S_(TSDIRKES122SAL)
 *     DIRKES213SAL  = S_(TSDIRKES213SAL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKS212); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRKS212, __pyx_t_14) < (0)) __PYX_ERR(51, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":74
 *     """The *DIRK* subtype."""
 *     DIRKS212      = S_(TSDIRKS212)
 *     DIRKES122SAL  = S_(TSDIRKES122SAL)             # <<<<<<<<<<<<<<
 *     DIRKES213SAL  = S_(TSDIRKES213SAL)
 *     DIRKES324SAL  = S_(TSDIRKES324SAL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKES122SAL); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRKES122SAL, __pyx_t_14) < (0)) __PYX_ERR(51, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":75
 *     DIRKS212      = S_(TSDIRKS212)
 *     DIRKES122SAL  = S_(TSDIRKES122SAL)
 *     DIRKES213SAL  = S_(TSDIRKES213SAL)             # <<<<<<<<<<<<<<
 *     DIRKES324SAL  = S_(TSDIRKES324SAL)
 *     DIRKES325SAL  = S_(TSDIRKES325SAL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKES213SAL); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRKES213SAL, __pyx_t_14) < (0)) __PYX_ERR(51, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":76
 *     DIRKES122SAL  = S_(TSDIRKES122SAL)
 *     DIRKES213SAL  = S_(TSDIRKES213SAL)
 *     DIRKES324SAL  = S_(TSDIRKES324SAL)             # <<<<<<<<<<<<<<
 *     DIRKES325SAL  = S_(TSDIRKES325SAL)
 *     DIRK657A      = S_(TSDIRK657A)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKES324SAL); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRKES324SAL, __pyx_t_14) < (0)) __PYX_ERR(51, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":77
 *     DIRKES213SAL  = S_(TSDIRKES213SAL)
 *     DIRKES324SAL  = S_(TSDIRKES324SAL)
 *     DIRKES325SAL  = S_(TSDIRKES325SAL)             # <<<<<<<<<<<<<<
 *     DIRK657A      = S_(TSDIRK657A)
 *     DIRKES648SA   = S_(TSDIRKES648SA)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKES325SAL); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRKES325SAL, __pyx_t_14) < (0)) __PYX_ERR(51, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":78
 *     DIRKES324SAL  = S_(TSDIRKES324SAL)
 *     DIRKES325SAL  = S_(TSDIRKES325SAL)
 *     DIRK657A      = S_(TSDIRK657A)             # <<<<<<<<<<<<<<
 *     DIRKES648SA   = S_(TSDIRKES648SA)
 *     DIRK658A      = S_(TSDIRK658A)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRK657A); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRK657A, __pyx_t_14) < (0)) __PYX_ERR(51, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":79
 *     DIRKES325SAL  = S_(TSDIRKES325SAL)
 *     DIRK657A      = S_(TSDIRK657A)
 *     DIRKES648SA   = S_(TSDIRKES648SA)             # <<<<<<<<<<<<<<
 *     DIRK658A      = S_(TSDIRK658A)
 *     DIRKS659A     = S_(TSDIRKS659A)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKES648SA); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRKES648SA, __pyx_t_14) < (0)) __PYX_ERR(51, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":80
 *     DIRK657A      = S_(TSDIRK657A)
 *     DIRKES648SA   = S_(TSDIRKES648SA)
 *     DIRK658A      = S_(TSDIRK658A)             # <<<<<<<<<<<<<<
 *     DIRKS659A     = S_(TSDIRKS659A)
 *     DIRK7510SAL   = S_(TSDIRK7510SAL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRK658A); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRK658A, __pyx_t_14) < (0)) __PYX_ERR(51, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":81
 *     DIRKES648SA   = S_(TSDIRKES648SA)
 *     DIRK658A      = S_(TSDIRK658A)
 *     DIRKS659A     = S_(TSDIRKS659A)             # <<<<<<<<<<<<<<
 *     DIRK7510SAL   = S_(TSDIRK7510SAL)
 *     DIRKES7510SA  = S_(TSDIRKES7510SA)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKS659A); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRKS659A, __pyx_t_14) < (0)) __PYX_ERR(51, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":82
 *     DIRK658A      = S_(TSDIRK658A)
 *     DIRKS659A     = S_(TSDIRKS659A)
 *     DIRK7510SAL   = S_(TSDIRK7510SAL)             # <<<<<<<<<<<<<<
 *     DIRKES7510SA  = S_(TSDIRKES7510SA)
 *     DIRK759A      = S_(TSDIRK759A)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRK7510SAL); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRK7510SAL, __pyx_t_14) < (0)) __PYX_ERR(51, 82, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":83
 *     DIRKS659A     = S_(TSDIRKS659A)
 *     DIRK7510SAL   = S_(TSDIRK7510SAL)
 *     DIRKES7510SA  = S_(TSDIRKES7510SA)             # <<<<<<<<<<<<<<
 *     DIRK759A      = S_(TSDIRK759A)
 *     DIRKS7511SAL  = S_(TSDIRKS7511SAL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKES7510SA); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRKES7510SA, __pyx_t_14) < (0)) __PYX_ERR(51, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":84
 *     DIRK7510SAL   = S_(TSDIRK7510SAL)
 *     DIRKES7510SA  = S_(TSDIRKES7510SA)
 *     DIRK759A      = S_(TSDIRK759A)             # <<<<<<<<<<<<<<
 *     DIRKS7511SAL  = S_(TSDIRKS7511SAL)
 *     DIRK8614A     = S_(TSDIRK8614A)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRK759A); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRK759A, __pyx_t_14) < (0)) __PYX_ERR(51, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":85
 *     DIRKES7510SA  = S_(TSDIRKES7510SA)
 *     DIRK759A      = S_(TSDIRK759A)
 *     DIRKS7511SAL  = S_(TSDIRKS7511SAL)             # <<<<<<<<<<<<<<
 *     DIRK8614A     = S_(TSDIRK8614A)
 *     DIRK8616SAL   = S_(TSDIRK8616SAL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKS7511SAL); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRKS7511SAL, __pyx_t_14) < (0)) __PYX_ERR(51, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":86
 *     DIRK759A      = S_(TSDIRK759A)
 *     DIRKS7511SAL  = S_(TSDIRKS7511SAL)
 *     DIRK8614A     = S_(TSDIRK8614A)             # <<<<<<<<<<<<<<
 *     DIRK8616SAL   = S_(TSDIRK8616SAL)
 *     DIRKES8516SAL = S_(TSDIRKES8516SAL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRK8614A); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRK8614A, __pyx_t_14) < (0)) __PYX_ERR(51, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":87
 *     DIRKS7511SAL  = S_(TSDIRKS7511SAL)
 *     DIRK8614A     = S_(TSDIRK8614A)
 *     DIRK8616SAL   = S_(TSDIRK8616SAL)             # <<<<<<<<<<<<<<
 *     DIRKES8516SAL = S_(TSDIRKES8516SAL)
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRK8616SAL); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRK8616SAL, __pyx_t_14) < (0)) __PYX_ERR(51, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":88
 *     DIRK8614A     = S_(TSDIRK8614A)
 *     DIRK8616SAL   = S_(TSDIRK8616SAL)
 *     DIRKES8516SAL = S_(TSDIRKES8516SAL)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(TSDIRKES8516SAL); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DIRKES8516SAL, __pyx_t_14) < (0)) __PYX_ERR(51, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":71
 * 
 * 
 * class TSDIRKType(object):             # <<<<<<<<<<<<<<
 *     """The *DIRK* subtype."""
 *     DIRKS212      = S_(TSDIRKS212)
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TSDIRKType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TSDIRKType, __pyx_t_14) < (0)) __PYX_ERR(51, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":91
 * 
 * 
 * class TSProblemType(object):             # <<<<<<<<<<<<<<
 *     """Distinguishes linear and nonlinear problems."""
 *     LINEAR    = TS_LINEAR
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[152]); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_TSProblemType, __pyx_mstate_global->__pyx_n_u_TSProblemType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Distinguishes_linear_and_nonline); if (unlikely(!__pyx_t_10)) __PYX_ERR(51, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[152]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[152]) < 0))) __PYX_ERR(51, 91, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/TS.pyx":93
 * class TSProblemType(object):
 *     """Distinguishes linear and nonlinear problems."""
 *     LINEAR    = TS_LINEAR             # <<<<<<<<<<<<<<
 *     NONLINEAR = TS_NONLINEAR
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_TSProblemType(TS_LINEAR); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LINEAR, __pyx_t_14) < (0)) __PYX_ERR(51, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":94
 *     """Distinguishes linear and nonlinear problems."""
 *     LINEAR    = TS_LINEAR
 *     NONLINEAR = TS_NONLINEAR             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_TSProblemType(TS_NONLINEAR); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NONLINEAR, __pyx_t_14) < (0)) __PYX_ERR(51, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":91
 * 
 * 
 * class TSProblemType(object):             # <<<<<<<<<<<<<<
 *     """Distinguishes linear and nonlinear problems."""
 *     LINEAR    = TS_LINEAR
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TSProblemType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TSProblemType, __pyx_t_14) < (0)) __PYX_ERR(51, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":97
 * 
 * 
 * class TSEquationType(object):             # <<<<<<<<<<<<<<
 *     """Distinguishes among types of explicit and implicit equations."""
 *     UNSPECIFIED               = TS_EQ_UNSPECIFIED
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[154]); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_TSEquationType, __pyx_mstate_global->__pyx_n_u_TSEquationType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Distinguishes_among_types_of_exp); if (unlikely(!__pyx_t_10)) __PYX_ERR(51, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[154]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[154]) < 0))) __PYX_ERR(51, 97, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/TS.pyx":99
 * 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_14 = __Pyx_PyLong_From_TSEquationType(TS_EQ_UNSPECIFIED); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_UNSPECIFIED, __pyx_t_14) < (0)) __PYX_ERR(51, 99, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":100
 *     """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_14 = __Pyx_PyLong_From_TSEquationType(TS_EQ_EXPLICIT); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_EXPLICIT, __pyx_t_14) < (0)) __PYX_ERR(51, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":101
 *     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_14 = __Pyx_PyLong_From_TSEquationType(TS_EQ_ODE_EXPLICIT); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ODE_EXPLICIT, __pyx_t_14) < (0)) __PYX_ERR(51, 101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":102
 *     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_14 = __Pyx_PyLong_From_TSEquationType(TS_EQ_DAE_SEMI_EXPLICIT_INDEX1); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DAE_SEMI_EXPLICIT_INDEX1, __pyx_t_14) < (0)) __PYX_ERR(51, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":103
 *     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_14 = __Pyx_PyLong_From_TSEquationType(TS_EQ_DAE_SEMI_EXPLICIT_INDEX2); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DAE_SEMI_EXPLICIT_INDEX2, __pyx_t_14) < (0)) __PYX_ERR(51, 103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":104
 *     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_14 = __Pyx_PyLong_From_TSEquationType(TS_EQ_DAE_SEMI_EXPLICIT_INDEX3); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DAE_SEMI_EXPLICIT_INDEX3, __pyx_t_14) < (0)) __PYX_ERR(51, 104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":105
 *     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_14 = __Pyx_PyLong_From_TSEquationType(TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DAE_SEMI_EXPLICIT_INDEXHI, __pyx_t_14) < (0)) __PYX_ERR(51, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":106
 *     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_14 = __Pyx_PyLong_From_TSEquationType(TS_EQ_IMPLICIT); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_IMPLICIT, __pyx_t_14) < (0)) __PYX_ERR(51, 106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":107
 *     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_14 = __Pyx_PyLong_From_TSEquationType(TS_EQ_ODE_IMPLICIT); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ODE_IMPLICIT, __pyx_t_14) < (0)) __PYX_ERR(51, 107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":108
 *     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_14 = __Pyx_PyLong_From_TSEquationType(TS_EQ_DAE_IMPLICIT_INDEX1); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DAE_IMPLICIT_INDEX1, __pyx_t_14) < (0)) __PYX_ERR(51, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":109
 *     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_14 = __Pyx_PyLong_From_TSEquationType(TS_EQ_DAE_IMPLICIT_INDEX2); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DAE_IMPLICIT_INDEX2, __pyx_t_14) < (0)) __PYX_ERR(51, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":110
 *     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_14 = __Pyx_PyLong_From_TSEquationType(TS_EQ_DAE_IMPLICIT_INDEX3); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DAE_IMPLICIT_INDEX3, __pyx_t_14) < (0)) __PYX_ERR(51, 110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":111
 *     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_14 = __Pyx_PyLong_From_TSEquationType(TS_EQ_DAE_IMPLICIT_INDEXHI); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DAE_IMPLICIT_INDEXHI, __pyx_t_14) < (0)) __PYX_ERR(51, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":97
 * 
 * 
 * class TSEquationType(object):             # <<<<<<<<<<<<<<
 *     """Distinguishes among types of explicit and implicit equations."""
 *     UNSPECIFIED               = TS_EQ_UNSPECIFIED
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TSEquationType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TSEquationType, __pyx_t_14) < (0)) __PYX_ERR(51, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":114
 * 
 * 
 * class TSExactFinalTime(object):             # <<<<<<<<<<<<<<
 *     """The method for ending time stepping."""
 *     UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[156]); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_TSExactFinalTime, __pyx_mstate_global->__pyx_n_u_TSExactFinalTime, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_method_for_ending_time_stepp); if (unlikely(!__pyx_t_10)) __PYX_ERR(51, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[156]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[156]) < 0))) __PYX_ERR(51, 114, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/TS.pyx":116
 * class TSExactFinalTime(object):
 *     """The method for ending time stepping."""
 *     UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED             # <<<<<<<<<<<<<<
 *     STEPOVER    = TS_EXACTFINALTIME_STEPOVER
 *     INTERPOLATE = TS_EXACTFINALTIME_INTERPOLATE
*/
  __pyx_t_14 = __Pyx_PyLong_From_TSExactFinalTimeOption(TS_EXACTFINALTIME_UNSPECIFIED); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_UNSPECIFIED, __pyx_t_14) < (0)) __PYX_ERR(51, 116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":117
 *     """The method for ending time stepping."""
 *     UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED
 *     STEPOVER    = TS_EXACTFINALTIME_STEPOVER             # <<<<<<<<<<<<<<
 *     INTERPOLATE = TS_EXACTFINALTIME_INTERPOLATE
 *     MATCHSTEP   = TS_EXACTFINALTIME_MATCHSTEP
*/
  __pyx_t_14 = __Pyx_PyLong_From_TSExactFinalTimeOption(TS_EXACTFINALTIME_STEPOVER); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_STEPOVER, __pyx_t_14) < (0)) __PYX_ERR(51, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":118
 *     UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED
 *     STEPOVER    = TS_EXACTFINALTIME_STEPOVER
 *     INTERPOLATE = TS_EXACTFINALTIME_INTERPOLATE             # <<<<<<<<<<<<<<
 *     MATCHSTEP   = TS_EXACTFINALTIME_MATCHSTEP
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_TSExactFinalTimeOption(TS_EXACTFINALTIME_INTERPOLATE); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INTERPOLATE, __pyx_t_14) < (0)) __PYX_ERR(51, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":119
 *     STEPOVER    = TS_EXACTFINALTIME_STEPOVER
 *     INTERPOLATE = TS_EXACTFINALTIME_INTERPOLATE
 *     MATCHSTEP   = TS_EXACTFINALTIME_MATCHSTEP             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_TSExactFinalTimeOption(TS_EXACTFINALTIME_MATCHSTEP); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MATCHSTEP, __pyx_t_14) < (0)) __PYX_ERR(51, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/TS.pyx":114
 * 
 * 
 * class TSExactFinalTime(object):             # <<<<<<<<<<<<<<
 *     """The method for ending time stepping."""
 *     UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TSExactFinalTime, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(51, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TSExactFinalTime, __pyx_t_14) < (0)) __PYX_ERR(51, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":122
 * 
 * 
 * class TSConvergedReason:             # <<<<<<<<<<<<<<
 *     """The reason the time step is converging."""
 *     # iterating
*/
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_TSConvergedReason, __pyx_mstate_global->__pyx_n_u_TSConvergedReason, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_reason_the_time_step_is_conv); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "petsc4py/PETSc/TS.pyx":125
 *     """The reason the time step is converging."""
 *     # iterating
 *     CONVERGED_ITERATING      = TS_CONVERGED_ITERATING             # <<<<<<<<<<<<<<
 *     ITERATING                = TS_CONVERGED_ITERATING
 *     # converged
*/
  __pyx_t_4 = __Pyx_PyLong_From_TSConvergedReason(TS_CONVERGED_ITERATING); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CONVERGED_ITERATING, __pyx_t_4) < (0)) __PYX_ERR(51, 125, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":126
 *     # iterating
 *     CONVERGED_ITERATING      = TS_CONVERGED_ITERATING
 *     ITERATING                = TS_CONVERGED_ITERATING             # <<<<<<<<<<<<<<
 *     # converged
 *     CONVERGED_TIME           = TS_CONVERGED_TIME
*/
  __pyx_t_4 = __Pyx_PyLong_From_TSConvergedReason(TS_CONVERGED_ITERATING); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ITERATING, __pyx_t_4) < (0)) __PYX_ERR(51, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":128
 *     ITERATING                = TS_CONVERGED_ITERATING
 *     # converged
 *     CONVERGED_TIME           = TS_CONVERGED_TIME             # <<<<<<<<<<<<<<
 *     CONVERGED_ITS            = TS_CONVERGED_ITS
 *     CONVERGED_USER           = TS_CONVERGED_USER
*/
  __pyx_t_4 = __Pyx_PyLong_From_TSConvergedReason(TS_CONVERGED_TIME); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CONVERGED_TIME, __pyx_t_4) < (0)) __PYX_ERR(51, 128, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":129
 *     # converged
 *     CONVERGED_TIME           = TS_CONVERGED_TIME
 *     CONVERGED_ITS            = TS_CONVERGED_ITS             # <<<<<<<<<<<<<<
 *     CONVERGED_USER           = TS_CONVERGED_USER
 *     CONVERGED_EVENT          = TS_CONVERGED_EVENT
*/
  __pyx_t_4 = __Pyx_PyLong_From_TSConvergedReason(TS_CONVERGED_ITS); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CONVERGED_ITS, __pyx_t_4) < (0)) __PYX_ERR(51, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":130
 *     CONVERGED_TIME           = TS_CONVERGED_TIME
 *     CONVERGED_ITS            = TS_CONVERGED_ITS
 *     CONVERGED_USER           = TS_CONVERGED_USER             # <<<<<<<<<<<<<<
 *     CONVERGED_EVENT          = TS_CONVERGED_EVENT
 *     # diverged
*/
  __pyx_t_4 = __Pyx_PyLong_From_TSConvergedReason(TS_CONVERGED_USER); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CONVERGED_USER, __pyx_t_4) < (0)) __PYX_ERR(51, 130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":131
 *     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_4 = __Pyx_PyLong_From_TSConvergedReason(TS_CONVERGED_EVENT); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CONVERGED_EVENT, __pyx_t_4) < (0)) __PYX_ERR(51, 131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":133
 *     CONVERGED_EVENT          = TS_CONVERGED_EVENT
 *     # diverged
 *     DIVERGED_NONLINEAR_SOLVE = TS_DIVERGED_NONLINEAR_SOLVE             # <<<<<<<<<<<<<<
 *     DIVERGED_STEP_REJECTED   = TS_DIVERGED_STEP_REJECTED
 * 
*/
  __pyx_t_4 = __Pyx_PyLong_From_TSConvergedReason(TS_DIVERGED_NONLINEAR_SOLVE); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DIVERGED_NONLINEAR_SOLVE, __pyx_t_4) < (0)) __PYX_ERR(51, 133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":134
 *     # diverged
 *     DIVERGED_NONLINEAR_SOLVE = TS_DIVERGED_NONLINEAR_SOLVE
 *     DIVERGED_STEP_REJECTED   = TS_DIVERGED_STEP_REJECTED             # <<<<<<<<<<<<<<
 * 
 * # -----------------------------------------------------------------------------
*/
  __pyx_t_4 = __Pyx_PyLong_From_TSConvergedReason(TS_DIVERGED_STEP_REJECTED); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DIVERGED_STEP_REJECTED, __pyx_t_4) < (0)) __PYX_ERR(51, 134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":122
 * 
 * 
 * class TSConvergedReason:             # <<<<<<<<<<<<<<
 *     """The reason the time step is converging."""
 *     # iterating
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_TSConvergedReason, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TSConvergedReason, __pyx_t_4) < (0)) __PYX_ERR(51, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":149
 * 
 *     """
 *     Type = TSType             # <<<<<<<<<<<<<<
 *     RKType = TSRKType
 *     ARKIMEXType = TSARKIMEXType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_TSType); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_5) < (0)) __PYX_ERR(51, 149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":150
 *     """
 *     Type = TSType
 *     RKType = TSRKType             # <<<<<<<<<<<<<<
 *     ARKIMEXType = TSARKIMEXType
 *     DIRKType = TSDIRKType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_TSRKType); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_RKType, __pyx_t_5) < (0)) __PYX_ERR(51, 150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":151
 *     Type = TSType
 *     RKType = TSRKType
 *     ARKIMEXType = TSARKIMEXType             # <<<<<<<<<<<<<<
 *     DIRKType = TSDIRKType
 *     ProblemType = TSProblemType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_TSARKIMEXType); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_ARKIMEXType, __pyx_t_5) < (0)) __PYX_ERR(51, 151, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":152
 *     RKType = TSRKType
 *     ARKIMEXType = TSARKIMEXType
 *     DIRKType = TSDIRKType             # <<<<<<<<<<<<<<
 *     ProblemType = TSProblemType
 *     EquationType = TSEquationType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_TSDIRKType); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_DIRKType, __pyx_t_5) < (0)) __PYX_ERR(51, 152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":153
 *     ARKIMEXType = TSARKIMEXType
 *     DIRKType = TSDIRKType
 *     ProblemType = TSProblemType             # <<<<<<<<<<<<<<
 *     EquationType = TSEquationType
 *     ExactFinalTime = TSExactFinalTime
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_TSProblemType); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_ProblemType, __pyx_t_5) < (0)) __PYX_ERR(51, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":154
 *     DIRKType = TSDIRKType
 *     ProblemType = TSProblemType
 *     EquationType = TSEquationType             # <<<<<<<<<<<<<<
 *     ExactFinalTime = TSExactFinalTime
 *     ExactFinalTimeOption = TSExactFinalTime
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_TSEquationType); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_EquationType, __pyx_t_5) < (0)) __PYX_ERR(51, 154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":155
 *     ProblemType = TSProblemType
 *     EquationType = TSEquationType
 *     ExactFinalTime = TSExactFinalTime             # <<<<<<<<<<<<<<
 *     ExactFinalTimeOption = TSExactFinalTime
 *     ConvergedReason = TSConvergedReason
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_TSExactFinalTime); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_ExactFinalTime, __pyx_t_5) < (0)) __PYX_ERR(51, 155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":156
 *     EquationType = TSEquationType
 *     ExactFinalTime = TSExactFinalTime
 *     ExactFinalTimeOption = TSExactFinalTime             # <<<<<<<<<<<<<<
 *     ConvergedReason = TSConvergedReason
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_TSExactFinalTime); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_ExactFinalTimeOption, __pyx_t_5) < (0)) __PYX_ERR(51, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":157
 *     ExactFinalTime = TSExactFinalTime
 *     ExactFinalTimeOption = TSExactFinalTime
 *     ConvergedReason = TSConvergedReason             # <<<<<<<<<<<<<<
 * 
 *     # --- xxx ---
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_TSConvergedReason); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_ConvergedReason, __pyx_t_5) < (0)) __PYX_ERR(51, 157, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":167
 *     # --- xxx ---
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """Print the `TS` object.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 167, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_3view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1179])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_4) < (0)) __PYX_ERR(51, 167, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":190
 *         CHKERR(TSView(self.ts, cviewer))
 * 
 *     def load(self, Viewer viewer) -> None:             # <<<<<<<<<<<<<<
 *         """Load a `TS` that has been stored in binary with `view`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 190, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_5load, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_load, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1180])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_load, __pyx_t_5) < (0)) __PYX_ERR(51, 190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":207
 *         CHKERR(TSLoad(self.ts, viewer.vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the `TS` that was created with `create`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(51, 207, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_7destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1181])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_4) < (0)) __PYX_ERR(51, 207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":220
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an empty `TS`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(51, 220, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(51, 220, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_9create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1182])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_5) < (0)) __PYX_ERR(51, 220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":244
 *         return self
 * 
 *     def clone(self) -> TS:             # <<<<<<<<<<<<<<
 *         """Return a shallow clone of the `TS` object.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_TS) < (0)) __PYX_ERR(51, 244, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_11clone, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_clone, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1183])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_clone, __pyx_t_4) < (0)) __PYX_ERR(51, 244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":258
 *         return ts
 * 
 *     def setType(self, ts_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the method to be used as the `TS` solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ts_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(51, 258, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 258, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_13setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1184])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_5) < (0)) __PYX_ERR(51, 258, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":281
 *         CHKERR(TSSetType(self.ts, cval))
 * 
 *     def setRKType(self, ts_type: RKType | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the *Runge-Kutta* scheme.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ts_type, __pyx_mstate_global->__pyx_kp_u_RKType_str) < (0)) __PYX_ERR(51, 281, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 281, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_15setRKType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setRKType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1185])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setRKType, __pyx_t_4) < (0)) __PYX_ERR(51, 281, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":304
 *         CHKERR(TSRKSetType(self.ts, cval))
 * 
 *     def setARKIMEXType(self, ts_type: ARKIMEXType | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of `Type.ARKIMEX` scheme.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ts_type, __pyx_mstate_global->__pyx_kp_u_ARKIMEXType_str) < (0)) __PYX_ERR(51, 304, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 304, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_17setARKIMEXType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setARKIMEXType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1186])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setARKIMEXType, __pyx_t_5) < (0)) __PYX_ERR(51, 304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":327
 *         CHKERR(TSARKIMEXSetType(self.ts, cval))
 * 
 *     def setARKIMEXFullyImplicit(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Solve both parts of the equation implicitly.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(51, 327, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 327, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_19setARKIMEXFullyImplicit, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setARKIMEXFullyImplicit, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1187])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setARKIMEXFullyImplicit, __pyx_t_4) < (0)) __PYX_ERR(51, 327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":345
 *         CHKERR(TSARKIMEXSetFullyImplicit(self.ts, bval))
 * 
 *     def setARKIMEXFastSlowSplit(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Use ARKIMEX for solving a fast-slow system.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(51, 345, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 345, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_21setARKIMEXFastSlowSplit, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setARKIMEXFastSlowSplit, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1188])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setARKIMEXFastSlowSplit, __pyx_t_5) < (0)) __PYX_ERR(51, 345, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":362
 *         CHKERR(TSARKIMEXSetFastSlowSplit(self.ts, bval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the `TS` type.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(51, 362, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_23getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1189])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_4) < (0)) __PYX_ERR(51, 362, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":376
 *         return bytes2str(cval)
 * 
 *     def getRKType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the `Type.RK` scheme.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(51, 376, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_25getRKType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getRKType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1190])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getRKType, __pyx_t_5) < (0)) __PYX_ERR(51, 376, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":390
 *         return bytes2str(cval)
 * 
 *     def getARKIMEXType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the `Type.ARKIMEX` scheme.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(51, 390, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_27getARKIMEXType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getARKIMEXType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1191])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getARKIMEXType, __pyx_t_4) < (0)) __PYX_ERR(51, 390, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":404
 *         return bytes2str(cval)
 * 
 *     def setDIRKType(self, ts_type: DIRKType | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of `Type.DIRK` scheme.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ts_type, __pyx_mstate_global->__pyx_kp_u_DIRKType_str) < (0)) __PYX_ERR(51, 404, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 404, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_29setDIRKType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setDIRKType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1192])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setDIRKType, __pyx_t_5) < (0)) __PYX_ERR(51, 404, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":427
 *         CHKERR(TSDIRKSetType(self.ts, cval))
 * 
 *     def getDIRKType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the `Type.DIRK` scheme.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(51, 427, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_31getDIRKType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getDIRKType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1193])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getDIRKType, __pyx_t_4) < (0)) __PYX_ERR(51, 427, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":441
 *         return bytes2str(cval)
 * 
 *     def setProblemType(self, ptype: ProblemType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of problem to be solved.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ptype, __pyx_mstate_global->__pyx_n_u_ProblemType) < (0)) __PYX_ERR(51, 441, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 441, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_33setProblemType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setProblemType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1194])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setProblemType, __pyx_t_5) < (0)) __PYX_ERR(51, 441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":458
 *         CHKERR(TSSetProblemType(self.ts, ptype))
 * 
 *     def getProblemType(self) -> ProblemType:             # <<<<<<<<<<<<<<
 *         """Return the type of problem to be solved.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ProblemType) < (0)) __PYX_ERR(51, 458, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_35getProblemType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getProblemType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1195])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getProblemType, __pyx_t_4) < (0)) __PYX_ERR(51, 458, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":472
 *         return ptype
 * 
 *     def setEquationType(self, eqtype: EquationType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the equation that `TS` is solving.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_eqtype, __pyx_mstate_global->__pyx_n_u_EquationType) < (0)) __PYX_ERR(51, 472, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 472, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_37setEquationType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setEquationType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1196])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setEquationType, __pyx_t_5) < (0)) __PYX_ERR(51, 472, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":489
 *         CHKERR(TSSetEquationType(self.ts, eqtype))
 * 
 *     def getEquationType(self) -> EquationType:             # <<<<<<<<<<<<<<
 *         """Get the type of the equation that `TS` is solving.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_EquationType) < (0)) __PYX_ERR(51, 489, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_39getEquationType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getEquationType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1197])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getEquationType, __pyx_t_4) < (0)) __PYX_ERR(51, 489, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":503
 *         return eqtype
 * 
 *     def setOptionsPrefix(self, prefix : str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the prefix used for all the `TS` options.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(51, 503, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 503, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_41setOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1198])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setOptionsPrefix, __pyx_t_5) < (0)) __PYX_ERR(51, 503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":526
 *         CHKERR(TSSetOptionsPrefix(self.ts, cval))
 * 
 *     def getOptionsPrefix(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the prefix used for all the `TS` options.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(51, 526, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_43getOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1199])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getOptionsPrefix, __pyx_t_4) < (0)) __PYX_ERR(51, 526, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":540
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Append to the prefix used for all the `TS` options.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(51, 540, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 540, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_45appendOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_appendOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1200])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_appendOptionsPrefix, __pyx_t_5) < (0)) __PYX_ERR(51, 540, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":563
 *         CHKERR(TSAppendOptionsPrefix(self.ts, cval))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set various `TS` parameters from user options.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 563, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_47setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1201])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_4) < (0)) __PYX_ERR(51, 563, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":577
 *     # --- application context ---
 * 
 *     def setAppCtx(self, appctx: Any) -> None:             # <<<<<<<<<<<<<<
 *         """Set the application context.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_appctx, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(51, 577, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 577, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_49setAppCtx, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setAppCtx, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1202])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setAppCtx, __pyx_t_5) < (0)) __PYX_ERR(51, 577, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":590
 *         self.set_attr('__appctx__', appctx)
 * 
 *     def getAppCtx(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return the application context."""
 *         return self.get_attr('__appctx__')
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(51, 590, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_51getAppCtx, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getAppCtx, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1203])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getAppCtx, __pyx_t_4) < (0)) __PYX_ERR(51, 590, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":596
 *     # --- user RHS Function/Jacobian routines ---
 * 
 *     def setRHSFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         function: TSRHSFunction | None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_function, __pyx_mstate_global->__pyx_kp_u_TSRHSFunction_None) < (0)) __PYX_ERR(51, 596, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(51, 596, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(51, 596, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 596, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_53setRHSFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setRHSFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1204])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setRHSFunction, __pyx_t_5) < (0)) __PYX_ERR(51, 596, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":633
 *             CHKERR(TSSetRHSFunction(self.ts, fvec, NULL, NULL))
 * 
 *     def setRHSJacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobian: TSRHSJacobian | None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_jacobian, __pyx_mstate_global->__pyx_kp_u_TSRHSJacobian_None) < (0)) __PYX_ERR(51, 633, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(51, 633, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(51, 633, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 633, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_55setRHSJacobian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setRHSJacobian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1205])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setRHSJacobian, __pyx_t_4) < (0)) __PYX_ERR(51, 633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":675
 *             CHKERR(TSSetRHSJacobian(self.ts, Jmat, Pmat, NULL, NULL))
 * 
 *     def computeRHSFunction(self, t: float, Vec x, Vec f) -> None:             # <<<<<<<<<<<<<<
 *         """Evaluate the right-hand side function.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_t, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 675, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 675, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_57computeRHSFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_computeRHSFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1206])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_computeRHSFunction, __pyx_t_5) < (0)) __PYX_ERR(51, 675, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":697
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_t, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 697, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 697, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_59computeRHSFunctionLinear, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_computeRHSFunctionLinear, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1207])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_computeRHSFunctionLinear, __pyx_t_4) < (0)) __PYX_ERR(51, 697, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":719
 *         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`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_t, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 719, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 719, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_61computeRHSJacobian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_computeRHSJacobian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1208])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_computeRHSJacobian, __pyx_t_5) < (0)) __PYX_ERR(51, 719, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":745
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_t, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 745, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 745, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_63computeRHSJacobianConstant, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_computeRHSJacobianConstant, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1209])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_computeRHSJacobianConstant, __pyx_t_4) < (0)) __PYX_ERR(51, 745, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":771
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Vec_TSRHSFunction) < (0)) __PYX_ERR(51, 771, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_65getRHSFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getRHSFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1210])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getRHSFunction, __pyx_t_5) < (0)) __PYX_ERR(51, 771, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":787
 *         return (f, function)
 * 
 *     def getRHSJacobian(self) -> tuple[Mat, Mat, TSRHSJacobian]:             # <<<<<<<<<<<<<<
 *         """Return the Jacobian and the function used to compute them.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Mat_Mat_TSRHSJacobian) < (0)) __PYX_ERR(51, 787, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_67getRHSJacobian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getRHSJacobian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1211])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getRHSJacobian, __pyx_t_4) < (0)) __PYX_ERR(51, 787, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":805
 *     # --- user Implicit Function/Jacobian routines ---
 * 
 *     def setIFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         function: TSIFunction | None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_function, __pyx_mstate_global->__pyx_kp_u_TSIFunction_None) < (0)) __PYX_ERR(51, 805, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(51, 805, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(51, 805, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 805, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_69setIFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setIFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1212])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setIFunction, __pyx_t_5) < (0)) __PYX_ERR(51, 805, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":842
 *             CHKERR(TSSetIFunction(self.ts, fvec, NULL, NULL))
 * 
 *     def setIJacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobian: TSIJacobian | None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_jacobian, __pyx_mstate_global->__pyx_kp_u_TSIJacobian_None) < (0)) __PYX_ERR(51, 842, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(51, 842, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(51, 842, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 842, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_71setIJacobian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setIJacobian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1213])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setIJacobian, __pyx_t_4) < (0)) __PYX_ERR(51, 842, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":887
 *             CHKERR(TSSetIJacobian(self.ts, Jmat, Pmat, NULL, NULL))
 * 
 *     def setIJacobianP(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobian,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(51, 887, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(51, 887, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 887, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_73setIJacobianP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setIJacobianP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1214])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setIJacobianP, __pyx_t_5) < (0)) __PYX_ERR(51, 887, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":928
 *             CHKERR(TSSetIJacobianP(self.ts, Jmat, NULL, NULL))
 * 
 *     def computeIFunction(self,             # <<<<<<<<<<<<<<
 *                          t: float, Vec x, Vec xdot,
 *                          Vec f, imex: bool = False) -> None:
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_t, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 928, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_imex, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(51, 928, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 928, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_75computeIFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_computeIFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1215])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_computeIFunction, __pyx_t_4) < (0)) __PYX_ERR(51, 928, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":958
 *                                   f.vec, bval))
 * 
 *     def computeIJacobian(self,             # <<<<<<<<<<<<<<
 *                          t: float, Vec x, Vec xdot, a: float,
 *                          Mat J, Mat P = None, imex: bool = False) -> None:
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_t, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 958, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_a, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 958, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_imex, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(51, 958, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 958, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_77computeIJacobian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_computeIJacobian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1216])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[131]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_computeIJacobian, __pyx_t_5) < (0)) __PYX_ERR(51, 958, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":998
 *                                   jmat, pmat, bval))
 * 
 *     def computeIJacobianP(self,             # <<<<<<<<<<<<<<
 *                           t: float, Vec x, Vec xdot, a: float,
 *                           Mat J, imex: bool = False) -> None:
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_t, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 998, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_a, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 998, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_imex, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(51, 998, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 998, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_79computeIJacobianP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_computeIJacobianP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1217])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_computeIJacobianP, __pyx_t_4) < (0)) __PYX_ERR(51, 998, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1032
 *                                    jmat, bval))
 * 
 *     def getIFunction(self) -> tuple[Vec, TSIFunction]:             # <<<<<<<<<<<<<<
 *         """Return the vector and function which computes the implicit residual.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Vec_TSIFunction) < (0)) __PYX_ERR(51, 1032, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_81getIFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getIFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1218])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1032, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getIFunction, __pyx_t_5) < (0)) __PYX_ERR(51, 1032, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1048
 *         return (f, function)
 * 
 *     def getIJacobian(self) -> tuple[Mat, Mat, TSIJacobian]:             # <<<<<<<<<<<<<<
 *         """Return the matrices and function which computes the implicit Jacobian.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Mat_Mat_TSIJacobian) < (0)) __PYX_ERR(51, 1048, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_83getIJacobian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getIJacobian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1219])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getIJacobian, __pyx_t_4) < (0)) __PYX_ERR(51, 1048, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1064
 *         return (J, P, jacobian)
 * 
 *     def setI2Function(             # <<<<<<<<<<<<<<
 *         self,
 *         function: TSI2Function | None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_function, __pyx_mstate_global->__pyx_kp_u_TSI2Function_None) < (0)) __PYX_ERR(51, 1064, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(51, 1064, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(51, 1064, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1064, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_85setI2Function, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setI2Function, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1220])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setI2Function, __pyx_t_5) < (0)) __PYX_ERR(51, 1064, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1101
 *             CHKERR(TSSetI2Function(self.ts, fvec, NULL, NULL))
 * 
 *     def setI2Jacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobian: TSI2Jacobian | None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_jacobian, __pyx_mstate_global->__pyx_kp_u_TSI2Jacobian_None) < (0)) __PYX_ERR(51, 1101, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1101, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_87setI2Jacobian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setI2Jacobian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1221])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setI2Jacobian, __pyx_t_4) < (0)) __PYX_ERR(51, 1101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1143
 *             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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_t, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 1143, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1143, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_89computeI2Function, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_computeI2Function, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1222])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_computeI2Function, __pyx_t_5) < (0)) __PYX_ERR(51, 1143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1170
 *                                    f.vec))
 * 
 *     def computeI2Jacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         t: float,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_t, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 1170, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_v, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 1170, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_a, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 1170, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1170, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_91computeI2Jacobian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_computeI2Jacobian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1223])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_computeI2Jacobian, __pyx_t_4) < (0)) __PYX_ERR(51, 1170, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1219
 *                                    jmat, pmat))
 * 
 *     def getI2Function(self) -> tuple[Vec, TSI2Function]:             # <<<<<<<<<<<<<<
 *         """Return the vector and function which computes the residual.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Vec_TSI2Function) < (0)) __PYX_ERR(51, 1219, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_93getI2Function, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getI2Function, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1224])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getI2Function, __pyx_t_5) < (0)) __PYX_ERR(51, 1219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1235
 *         return (f, function)
 * 
 *     def getI2Jacobian(self) -> tuple[Mat, Mat, TSI2Jacobian]:             # <<<<<<<<<<<<<<
 *         """Return the matrices and function which computes the Jacobian.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Mat_Mat_TSI2Jacobian) < (0)) __PYX_ERR(51, 1235, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_95getI2Jacobian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getI2Jacobian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1225])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getI2Jacobian, __pyx_t_4) < (0)) __PYX_ERR(51, 1235, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1252
 * 
 *     # --- TSRHSSplit routines to support multirate and IMEX solvers ---
 *     def setRHSSplitIS(self, splitname: str, IS iss) -> None:             # <<<<<<<<<<<<<<
 *         """Set the index set for the specified split.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_splitname, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(51, 1252, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1252, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_97setRHSSplitIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setRHSSplitIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1226])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setRHSSplitIS, __pyx_t_5) < (0)) __PYX_ERR(51, 1252, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1273
 *         CHKERR(TSRHSSplitSetIS(self.ts, cname, iss.iset))
 * 
 *     def setRHSSplitRHSFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         splitname: str,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_splitname, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(51, 1273, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_function, __pyx_mstate_global->__pyx_n_u_TSRHSFunction) < (0)) __PYX_ERR(51, 1273, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(51, 1273, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(51, 1273, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1273, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_99setRHSSplitRHSFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setRHSSplitRHSFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1227])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setRHSSplitRHSFunction, __pyx_t_4) < (0)) __PYX_ERR(51, 1273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1317
 *             CHKERR(TSRHSSplitSetRHSFunction(self.ts, cname, rvec, NULL, NULL))
 * 
 *     def setRHSSplitIFunction(             # <<<<<<<<<<<<<<
 *         self,
 *         splitname: str,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_splitname, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(51, 1317, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_function, __pyx_mstate_global->__pyx_n_u_TSIFunction) < (0)) __PYX_ERR(51, 1317, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(51, 1317, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(51, 1317, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1317, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_101setRHSSplitIFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setRHSSplitIFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1228])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setRHSSplitIFunction, __pyx_t_5) < (0)) __PYX_ERR(51, 1317, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1361
 *             CHKERR(TSRHSSplitSetIFunction(self.ts, cname, rvec, NULL, NULL))
 * 
 *     def setRHSSplitIJacobian(             # <<<<<<<<<<<<<<
 *         self,
 *         splitname: str,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_splitname, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(51, 1361, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_jacobian, __pyx_mstate_global->__pyx_n_u_TSRHSJacobian) < (0)) __PYX_ERR(51, 1361, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(51, 1361, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(51, 1361, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1361, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_103setRHSSplitIJacobian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setRHSSplitIJacobian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1229])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setRHSSplitIJacobian, __pyx_t_4) < (0)) __PYX_ERR(51, 1361, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1412
 *     # --- solution vector ---
 * 
 *     def setSolution(self, Vec u) -> None:             # <<<<<<<<<<<<<<
 *         """Set the initial solution vector.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1412, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_105setSolution, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setSolution, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1230])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setSolution, __pyx_t_5) < (0)) __PYX_ERR(51, 1412, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1429
 *         CHKERR(TSSetSolution(self.ts, u.vec))
 * 
 *     def getSolution(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the solution at the present timestep.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(51, 1429, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_107getSolution, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1231])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_4) < (0)) __PYX_ERR(51, 1429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1448
 *         return u
 * 
 *     def setSolution2(self, Vec u, Vec v) -> None:             # <<<<<<<<<<<<<<
 *         """Set the initial solution and its time derivative.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1448, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_109setSolution2, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setSolution2, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1232])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setSolution2, __pyx_t_5) < (0)) __PYX_ERR(51, 1448, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1467
 *         CHKERR(TS2SetSolution(self.ts, u.vec, v.vec))
 * 
 *     def getSolution2(self) -> tuple[Vec, Vec]:             # <<<<<<<<<<<<<<
 *         """Return the solution and time derivative at the present timestep.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Vec_Vec) < (0)) __PYX_ERR(51, 1467, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_111getSolution2, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getSolution2, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1233])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getSolution2, __pyx_t_4) < (0)) __PYX_ERR(51, 1467, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1490
 *     # --- evaluation times ---
 * 
 *     def setEvaluationTimes(self, tspan: Sequence[float]) -> None:             # <<<<<<<<<<<<<<
 *         """Sets evaluation points where solution will be computed and stored.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tspan, __pyx_mstate_global->__pyx_kp_u_Sequence_float) < (0)) __PYX_ERR(51, 1490, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1490, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_113setEvaluationTimes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setEvaluationTimes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1234])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setEvaluationTimes, __pyx_t_5) < (0)) __PYX_ERR(51, 1490, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1523
 *         CHKERR(TSSetEvaluationTimes(self.ts, nt, rtspan))
 * 
 *     def getEvaluationTimes(self) -> ArrayReal:             # <<<<<<<<<<<<<<
 *         """Return the evaluation points.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayReal) < (0)) __PYX_ERR(51, 1523, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_115getEvaluationTimes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getEvaluationTimes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1235])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getEvaluationTimes, __pyx_t_4) < (0)) __PYX_ERR(51, 1523, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1539
 *         return tspan
 * 
 *     def getEvaluationSolutions(self) -> tuple[ArrayReal, list[Vec]]:             # <<<<<<<<<<<<<<
 *         """Return the solutions and the times they were recorded at.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_ArrayReal_list_Vec) < (0)) __PYX_ERR(51, 1539, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_117getEvaluationSolutions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getEvaluationSolutions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1236])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getEvaluationSolutions, __pyx_t_5) < (0)) __PYX_ERR(51, 1539, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1561
 *     # --- time span ---
 * 
 *     def setTimeSpan(self, tspan: Sequence[float]) -> None:             # <<<<<<<<<<<<<<
 *         """Set the time span and time points to evaluate solution at.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_tspan, __pyx_mstate_global->__pyx_kp_u_Sequence_float) < (0)) __PYX_ERR(51, 1561, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1561, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_119setTimeSpan, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setTimeSpan, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1237])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setTimeSpan, __pyx_t_4) < (0)) __PYX_ERR(51, 1561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1594
 *         CHKERR(TSSetTimeSpan(self.ts, nt, rtspan))
 * 
 *     getTimeSpan = getEvaluationTimes             # <<<<<<<<<<<<<<
 * 
 *     def getTimeSpanSolutions(self) -> list[Vec]:
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getEvaluationTimes); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getTimeSpan, __pyx_t_4) < (0)) __PYX_ERR(51, 1594, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1596
 *     getTimeSpan = getEvaluationTimes
 * 
 *     def getTimeSpanSolutions(self) -> list[Vec]:             # <<<<<<<<<<<<<<
 *         """Return the solutions at the times in the time span. Deprecated.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_Vec) < (0)) __PYX_ERR(51, 1596, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_121getTimeSpanSolutions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getTimeSpanSolutions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1238])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getTimeSpanSolutions, __pyx_t_5) < (0)) __PYX_ERR(51, 1596, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1616
 *     # --- inner solver ---
 * 
 *     def getSNES(self) -> SNES:             # <<<<<<<<<<<<<<
 *         """Return the `SNES` associated with the `TS`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SNES) < (0)) __PYX_ERR(51, 1616, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_123getSNES, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getSNES, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1239])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getSNES, __pyx_t_4) < (0)) __PYX_ERR(51, 1616, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1631
 *         return snes
 * 
 *     def getKSP(self) -> KSP:             # <<<<<<<<<<<<<<
 *         """Return the `KSP` associated with the `TS`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_KSP) < (0)) __PYX_ERR(51, 1631, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_125getKSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getKSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1240])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getKSP, __pyx_t_5) < (0)) __PYX_ERR(51, 1631, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1648
 *     # --- discretization space ---
 * 
 *     def getDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the `DM` associated with the `TS`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(51, 1648, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_127getDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1241])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getDM, __pyx_t_4) < (0)) __PYX_ERR(51, 1648, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1668
 *         return dm
 * 
 *     def setDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Set the DM that may be used by some nonlinear solvers or preconditioners.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1668, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_129setDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1242])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setDM, __pyx_t_5) < (0)) __PYX_ERR(51, 1668, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1687
 *     # --- customization ---
 * 
 *     def setTime(self, t: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the time.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_t, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 1687, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1687, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_131setTime, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setTime, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1243])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setTime, __pyx_t_4) < (0)) __PYX_ERR(51, 1687, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1705
 *         CHKERR(TSSetTime(self.ts, rval))
 * 
 *     def getTime(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the time of the most recently completed step.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 1705, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_133getTime, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getTime, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1244])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getTime, __pyx_t_5) < (0)) __PYX_ERR(51, 1705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1723
 *         return toReal(rval)
 * 
 *     def getPrevTime(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the starting time of the previously completed step.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 1723, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_135getPrevTime, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getPrevTime, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1245])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getPrevTime, __pyx_t_4) < (0)) __PYX_ERR(51, 1723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1737
 *         return toReal(rval)
 * 
 *     def getSolveTime(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the time after a call to `solve`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 1737, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_137getSolveTime, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getSolveTime, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1246])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getSolveTime, __pyx_t_5) < (0)) __PYX_ERR(51, 1737, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1754
 *         return toReal(rval)
 * 
 *     def setTimeStep(self, time_step: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the duration of the timestep.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_time_step, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 1754, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1754, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_139setTimeStep, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setTimeStep, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1247])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setTimeStep, __pyx_t_4) < (0)) __PYX_ERR(51, 1754, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1772
 *         CHKERR(TSSetTimeStep(self.ts, rval))
 * 
 *     def getTimeStep(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the duration of the current timestep.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 1772, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_141getTimeStep, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getTimeStep, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1248])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getTimeStep, __pyx_t_5) < (0)) __PYX_ERR(51, 1772, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1786
 *         return toReal(tstep)
 * 
 *     def setStepNumber(self, step_number: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of steps completed.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_step_number, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(51, 1786, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1786, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_143setStepNumber, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setStepNumber, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1249])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setStepNumber, __pyx_t_4) < (0)) __PYX_ERR(51, 1786, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1813
 *         CHKERR(TSSetStepNumber(self.ts, ival))
 * 
 *     def getStepNumber(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of time steps completed.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(51, 1813, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_145getStepNumber, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getStepNumber, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1250])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getStepNumber, __pyx_t_5) < (0)) __PYX_ERR(51, 1813, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1827
 *         return toInt(ival)
 * 
 *     def setMaxTime(self, max_time: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum (final) time.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_max_time, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 1827, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1827, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_147setMaxTime, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setMaxTime, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1251])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setMaxTime, __pyx_t_4) < (0)) __PYX_ERR(51, 1827, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1849
 *         CHKERR(TSSetMaxTime(self.ts, rval))
 * 
 *     def getMaxTime(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the maximum (final) time.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 1849, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_149getMaxTime, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getMaxTime, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1252])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getMaxTime, __pyx_t_5) < (0)) __PYX_ERR(51, 1849, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1865
 *         return toReal(rval)
 * 
 *     def setMaxSteps(self, max_steps: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum number of steps to use.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_max_steps, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(51, 1865, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1865, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_151setMaxSteps, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setMaxSteps, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1253])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setMaxSteps, __pyx_t_4) < (0)) __PYX_ERR(51, 1865, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1885
 *         CHKERR(TSSetMaxSteps(self.ts, ival))
 * 
 *     def getMaxSteps(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the maximum number of steps to use.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(51, 1885, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_153getMaxSteps, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getMaxSteps, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1254])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getMaxSteps, __pyx_t_5) < (0)) __PYX_ERR(51, 1885, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1899
 *         return toInt(ival)
 * 
 *     def getSNESIterations(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the total number of nonlinear iterations used by the `TS`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(51, 1899, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_155getSNESIterations, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getSNESIterations, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1255])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getSNESIterations, __pyx_t_4) < (0)) __PYX_ERR(51, 1899, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1916
 *         return toInt(n)
 * 
 *     def getKSPIterations(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the total number of linear iterations used by the `TS`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(51, 1916, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_157getKSPIterations, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getKSPIterations, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1256])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getKSPIterations, __pyx_t_5) < (0)) __PYX_ERR(51, 1916, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1933
 *         return toInt(n)
 * 
 *     def setMaxStepRejections(self, n: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum number of step rejections before a time step fails.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_n, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(51, 1933, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1933, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_159setMaxStepRejections, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setMaxStepRejections, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1257])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setMaxStepRejections, __pyx_t_4) < (0)) __PYX_ERR(51, 1933, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1955
 *         CHKERR(TSSetMaxStepRejections(self.ts, rej))
 * 
 *     def getStepRejections(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the total number of rejected steps.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(51, 1955, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_161getStepRejections, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getStepRejections, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1258])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getStepRejections, __pyx_t_5) < (0)) __PYX_ERR(51, 1955, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":1972
 *         return toInt(n)
 * 
 *     def setMaxSNESFailures(self, n: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum number of SNES solves failures allowed.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_n, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(51, 1972, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 1972, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_163setMaxSNESFailures, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setMaxSNESFailures, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1259])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setMaxSNESFailures, __pyx_t_4) < (0)) __PYX_ERR(51, 1972, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":1990
 *         CHKERR(TSSetMaxSNESFailures(self.ts, fails))
 * 
 *     def getSNESFailures(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the total number of failed `SNES` solves in the `TS`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 1990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(51, 1990, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_165getSNESFailures, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getSNESFailures, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1260])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 1990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getSNESFailures, __pyx_t_5) < (0)) __PYX_ERR(51, 1990, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2007
 *         return toInt(n)
 * 
 *     def setErrorIfStepFails(self, flag: bool = True) -> None:             # <<<<<<<<<<<<<<
 *         """Immediately error is no step succeeds.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(51, 2007, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2007, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_167setErrorIfStepFails, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setErrorIfStepFails, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1261])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[76]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setErrorIfStepFails, __pyx_t_4) < (0)) __PYX_ERR(51, 2007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2029
 *         CHKERR(TSSetErrorIfStepFails(self.ts, bval))
 * 
 *     def setTolerances(self, rtol: float | None = None, atol: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set tolerances for local truncation error when using an adaptive controller.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_rtol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(51, 2029, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_atol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(51, 2029, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2029, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_169setTolerances, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setTolerances, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1262])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setTolerances, __pyx_t_5) < (0)) __PYX_ERR(51, 2029, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2072
 *         CHKERR(TSSetTolerances(self.ts, ratol, vatol, rrtol, vrtol))
 * 
 *     def getTolerances(self) ->tuple[float, float]:             # <<<<<<<<<<<<<<
 *         """Return the tolerances for local truncation error.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_float) < (0)) __PYX_ERR(51, 2072, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_171getTolerances, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getTolerances, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1263])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getTolerances, __pyx_t_4) < (0)) __PYX_ERR(51, 2072, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2106
 *         return (rtol, atol)
 * 
 *     def setExactFinalTime(self, option: ExactFinalTime) -> None:             # <<<<<<<<<<<<<<
 *         """Set method of computing the final time step.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_option, __pyx_mstate_global->__pyx_n_u_ExactFinalTime) < (0)) __PYX_ERR(51, 2106, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2106, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_173setExactFinalTime, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setExactFinalTime, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1264])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setExactFinalTime, __pyx_t_5) < (0)) __PYX_ERR(51, 2106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2128
 *         CHKERR(TSSetExactFinalTime(self.ts, oval))
 * 
 *     def setConvergedReason(self, reason: ConvergedReason) -> None:             # <<<<<<<<<<<<<<
 *         """Set the reason for handling the convergence of `solve`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_reason, __pyx_mstate_global->__pyx_n_u_ConvergedReason) < (0)) __PYX_ERR(51, 2128, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2128, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_175setConvergedReason, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setConvergedReason, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1265])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setConvergedReason, __pyx_t_4) < (0)) __PYX_ERR(51, 2128, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2149
 *         CHKERR(TSSetConvergedReason(self.ts, cval))
 * 
 *     def getConvergedReason(self) -> ConvergedReason:             # <<<<<<<<<<<<<<
 *         """Return the reason the `TS` step was stopped.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ConvergedReason) < (0)) __PYX_ERR(51, 2149, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_177getConvergedReason, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getConvergedReason, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1266])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getConvergedReason, __pyx_t_5) < (0)) __PYX_ERR(51, 2149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2167
 *     # --- monitoring ---
 * 
 *     def setMonitor(             # <<<<<<<<<<<<<<
 *         self,
 *         monitor: TSMonitorFunction | None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_monitor, __pyx_mstate_global->__pyx_kp_u_TSMonitorFunction_None) < (0)) __PYX_ERR(51, 2167, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(51, 2167, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(51, 2167, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2167, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_179setMonitor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setMonitor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1267])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setMonitor, __pyx_t_4) < (0)) __PYX_ERR(51, 2167, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2201
 *         monitorlist.append(context)
 * 
 *     def getMonitor(self) -> list[tuple[TSMonitorFunction, tuple[Any, ...], dict[str, Any]]]:             # <<<<<<<<<<<<<<
 *         """Return the monitor.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_tuple_TSMonitorFunction_tup) < (0)) __PYX_ERR(51, 2201, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_181getMonitor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getMonitor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1268])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getMonitor, __pyx_t_5) < (0)) __PYX_ERR(51, 2201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2213
 *         return self.get_attr('__monitor__')
 * 
 *     def monitorCancel(self) -> None:             # <<<<<<<<<<<<<<
 *         """Clear all the monitors that have been set.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2213, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_183monitorCancel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_monitorCancel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1269])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_monitorCancel, __pyx_t_4) < (0)) __PYX_ERR(51, 2213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2226
 *         CHKERR(TSMonitorCancel(self.ts))
 * 
 *     cancelMonitor = monitorCancel             # <<<<<<<<<<<<<<
 * 
 *     def monitor(self, step: int, time: float, Vec u=None) -> None:
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_monitorCancel); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_cancelMonitor, __pyx_t_4) < (0)) __PYX_ERR(51, 2226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2228
 *     cancelMonitor = monitorCancel
 * 
 *     def monitor(self, step: int, time: float, Vec u=None) -> None:             # <<<<<<<<<<<<<<
 *         """Monitor the solve.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_step, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(51, 2228, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_time, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 2228, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2228, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_185monitor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_monitor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1270])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_monitor, __pyx_t_5) < (0)) __PYX_ERR(51, 2228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2257
 *     # --- event handling ---
 * 
 *     def setEventHandler(             # <<<<<<<<<<<<<<
 *         self,
 *         direction: Sequence[int],
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_direction, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(51, 2257, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_terminate, __pyx_mstate_global->__pyx_kp_u_Sequence_bool) < (0)) __PYX_ERR(51, 2257, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_indicator, __pyx_mstate_global->__pyx_kp_u_TSIndicatorFunction_None) < (0)) __PYX_ERR(51, 2257, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_postevent, __pyx_mstate_global->__pyx_kp_u_TSPostEventFunction_None) < (0)) __PYX_ERR(51, 2257, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(51, 2257, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(51, 2257, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2257, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_187setEventHandler, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setEventHandler, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1271])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setEventHandler, __pyx_t_4) < (0)) __PYX_ERR(51, 2257, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2312
 *             CHKERR(TSSetEventHandler(self.ts, nevents, idirs, iterm, NULL, NULL, <void*>NULL))
 * 
 *     def setEventTolerances(self, tol: float | None = None, vtol: Sequence[float] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set tolerances for event zero crossings when using event handler.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(51, 2312, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vtol, __pyx_mstate_global->__pyx_kp_u_Sequence_float_None) < (0)) __PYX_ERR(51, 2312, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2312, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_189setEventTolerances, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setEventTolerances, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1272])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setEventTolerances, __pyx_t_5) < (0)) __PYX_ERR(51, 2312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2348
 *         CHKERR(TSSetEventTolerances(self.ts, tolr, vtolr))
 * 
 *     def getNumEvents(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of events.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(51, 2348, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_191getNumEvents, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getNumEvents, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1273])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getNumEvents, __pyx_t_4) < (0)) __PYX_ERR(51, 2348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2364
 *     # --- solving ---
 * 
 *     def setPreStep(             # <<<<<<<<<<<<<<
 *         self,
 *         prestep: TSPreStepFunction | None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_prestep, __pyx_mstate_global->__pyx_kp_u_TSPreStepFunction_None) < (0)) __PYX_ERR(51, 2364, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(51, 2364, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(51, 2364, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2364, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_193setPreStep, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setPreStep, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1274])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setPreStep, __pyx_t_5) < (0)) __PYX_ERR(51, 2364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2397
 *             CHKERR(TSSetPreStep(self.ts, NULL))
 * 
 *     def getPreStep(self) -> tuple[TSPreStepFunction, tuple[Any, ...] | None, dict[str, Any] | None]:             # <<<<<<<<<<<<<<
 *         """Return the prestep function.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_TSPreStepFunction_tuple_An) < (0)) __PYX_ERR(51, 2397, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_195getPreStep, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getPreStep, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1275])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getPreStep, __pyx_t_4) < (0)) __PYX_ERR(51, 2397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2409
 *         return self.get_attr('__prestep__')
 * 
 *     def setPostStep(self,             # <<<<<<<<<<<<<<
 *                     poststep: TSPostStepFunction | None,
 *                     args: tuple[Any, ...] | None = None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_poststep, __pyx_mstate_global->__pyx_kp_u_TSPostStepFunction_None) < (0)) __PYX_ERR(51, 2409, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(51, 2409, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(51, 2409, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2409, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_197setPostStep, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setPostStep, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1276])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setPostStep, __pyx_t_5) < (0)) __PYX_ERR(51, 2409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2441
 *             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__')
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_TSPostStepFunction_tuple_A) < (0)) __PYX_ERR(51, 2441, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_199getPostStep, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getPostStep, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1277])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getPostStep, __pyx_t_4) < (0)) __PYX_ERR(51, 2441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2445
 *         return self.get_attr('__poststep__')
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for the `TS`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2445, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_201setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1278])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_5) < (0)) __PYX_ERR(51, 2445, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2457
 *         CHKERR(TSSetUp(self.ts))
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         """Reset the `TS`, removing any allocated vectors and matrices.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2457, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_203reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_reset, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1279])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_4) < (0)) __PYX_ERR(51, 2457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2469
 *         CHKERR(TSReset(self.ts))
 * 
 *     def step(self) -> None:             # <<<<<<<<<<<<<<
 *         """Take one step.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2469, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_205step, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_step, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1280])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_step, __pyx_t_5) < (0)) __PYX_ERR(51, 2469, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2485
 *         CHKERR(TSStep(self.ts))
 * 
 *     def restartStep(self) -> None:             # <<<<<<<<<<<<<<
 *         """Flag the solver to restart the next step.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2485, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_207restartStep, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_restartStep, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1281])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_restartStep, __pyx_t_4) < (0)) __PYX_ERR(51, 2485, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2508
 *         CHKERR(TSRestartStep(self.ts))
 * 
 *     def rollBack(self) -> None:             # <<<<<<<<<<<<<<
 *         """Roll back one time step.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2508, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_209rollBack, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_rollBack, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1282])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_rollBack, __pyx_t_5) < (0)) __PYX_ERR(51, 2508, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2520
 *         CHKERR(TSRollBack(self.ts))
 * 
 *     def solve(self, Vec u=None) -> None:             # <<<<<<<<<<<<<<
 *         """Step the requested number of timesteps.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2520, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_211solve, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_solve, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1283])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2520, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_solve, __pyx_t_4) < (0)) __PYX_ERR(51, 2520, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2539
 *         CHKERR(TSSolve(self.ts, uvec))
 * 
 *     def interpolate(self, t: float, Vec u) -> None:             # <<<<<<<<<<<<<<
 *         """Interpolate the solution to a given time.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_t, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 2539, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2539, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_213interpolate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_interpolate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1284])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_interpolate, __pyx_t_5) < (0)) __PYX_ERR(51, 2539, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2559
 *         CHKERR(TSInterpolate(self.ts, rval, u.vec))
 * 
 *     def setStepLimits(self, hmin: float, hmax: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the minimum and maximum allowed step sizes.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_hmin, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 2559, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_hmax, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 2559, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2559, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_215setStepLimits, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setStepLimits, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1285])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setStepLimits, __pyx_t_4) < (0)) __PYX_ERR(51, 2559, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2582
 *         CHKERR(TSAdaptSetStepLimits(tsadapt, hminr, hmaxr))
 * 
 *     def getStepLimits(self) -> tuple[float, float]:             # <<<<<<<<<<<<<<
 *         """Return the minimum and maximum allowed time step sizes.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_float) < (0)) __PYX_ERR(51, 2582, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_217getStepLimits, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getStepLimits, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1286])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getStepLimits, __pyx_t_5) < (0)) __PYX_ERR(51, 2582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2601
 *     # --- Adjoint methods ---
 * 
 *     def setSaveTrajectory(self) -> None:             # <<<<<<<<<<<<<<
 *         """Enable to save solutions as an internal `TS` trajectory.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2601, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_219setSaveTrajectory, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setSaveTrajectory, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1287])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setSaveTrajectory, __pyx_t_4) < (0)) __PYX_ERR(51, 2601, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2620
 *         CHKERR(TSSetSaveTrajectory(self.ts))
 * 
 *     def removeTrajectory(self) -> None:             # <<<<<<<<<<<<<<
 *         """Remove the internal `TS` trajectory object.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2620, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_221removeTrajectory, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_removeTrajectory, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1288])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_removeTrajectory, __pyx_t_5) < (0)) __PYX_ERR(51, 2620, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2632
 *         CHKERR(TSRemoveTrajectory(self.ts))
 * 
 *     def getCostIntegral(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a vector of values of the integral term in the cost functions.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(51, 2632, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_223getCostIntegral, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getCostIntegral, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1289])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getCostIntegral, __pyx_t_4) < (0)) __PYX_ERR(51, 2632, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2647
 *         return cost
 * 
 *     def setCostGradients(             # <<<<<<<<<<<<<<
 *         self,
 *         vl: Vec | Sequence[Vec] | None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vl, __pyx_mstate_global->__pyx_kp_u_Vec_Sequence_Vec_None) < (0)) __PYX_ERR(51, 2647, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_vm, __pyx_mstate_global->__pyx_kp_u_Vec_Sequence_Vec_None) < (0)) __PYX_ERR(51, 2647, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2647, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_225setCostGradients, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setCostGradients, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1290])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setCostGradients, __pyx_t_5) < (0)) __PYX_ERR(51, 2647, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2693
 *         CHKERR(TSSetCostGradients(self.ts, n, vecl, vecm))
 * 
 *     def getCostGradients(self) -> tuple[list[Vec], list[Vec]]:             # <<<<<<<<<<<<<<
 *         """Return the cost gradients.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_list_Vec_list_Vec) < (0)) __PYX_ERR(51, 2693, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_227getCostGradients, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getCostGradients, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1291])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getCostGradients, __pyx_t_4) < (0)) __PYX_ERR(51, 2693, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2714
 *         return (vl, vm)
 * 
 *     def setRHSJacobianP(             # <<<<<<<<<<<<<<
 *         self,
 *         jacobianp: TSRHSJacobianP | None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_jacobianp, __pyx_mstate_global->__pyx_kp_u_TSRHSJacobianP_None) < (0)) __PYX_ERR(51, 2714, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(51, 2714, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(51, 2714, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2714, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_229setRHSJacobianP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setRHSJacobianP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1292])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setRHSJacobianP, __pyx_t_5) < (0)) __PYX_ERR(51, 2714, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2751
 *             CHKERR(TSSetRHSJacobianP(self.ts, Amat, NULL, NULL))
 * 
 *     def createQuadratureTS(self, forward: bool = True) -> TS:             # <<<<<<<<<<<<<<
 *         """Create a sub `TS` that evaluates integrals over time.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_forward, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(51, 2751, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_TS) < (0)) __PYX_ERR(51, 2751, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_231createQuadratureTS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_createQuadratureTS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1293])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[76]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_createQuadratureTS, __pyx_t_4) < (0)) __PYX_ERR(51, 2751, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2772
 *         return qts
 * 
 *     def getQuadratureTS(self) -> tuple[bool, TS]:             # <<<<<<<<<<<<<<
 *         """Return the sub `TS` that evaluates integrals over time.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_bool_TS) < (0)) __PYX_ERR(51, 2772, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_233getQuadratureTS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getQuadratureTS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1294])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getQuadratureTS, __pyx_t_5) < (0)) __PYX_ERR(51, 2772, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2795
 *         return (toBool(fwd), qts)
 * 
 *     def setRHSJacobianP(             # <<<<<<<<<<<<<<
 *         self,
 *         rhsjacobianp: TSRHSJacobianP | None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_rhsjacobianp, __pyx_mstate_global->__pyx_kp_u_TSRHSJacobianP_None) < (0)) __PYX_ERR(51, 2795, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(51, 2795, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(51, 2795, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2795, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_235setRHSJacobianP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setRHSJacobianP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1295])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setRHSJacobianP, __pyx_t_4) < (0)) __PYX_ERR(51, 2795, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2832
 *             CHKERR(TSSetRHSJacobianP(self.ts, Amat, NULL, NULL))
 * 
 *     def computeRHSJacobianP(self, t: float, Vec x, Mat J) -> None:             # <<<<<<<<<<<<<<
 *         """Run the user-defined JacobianP function.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_t, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 2832, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2832, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_237computeRHSJacobianP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_computeRHSJacobianP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1296])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_computeRHSJacobianP, __pyx_t_5) < (0)) __PYX_ERR(51, 2832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2854
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_adjoint_steps, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(51, 2854, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2854, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_239adjointSetSteps, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_adjointSetSteps, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1297])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_adjointSetSteps, __pyx_t_4) < (0)) __PYX_ERR(51, 2854, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2872
 *         CHKERR(TSAdjointSetSteps(self.ts, ival))
 * 
 *     def adjointSetUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for the later use of an adjoint solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2872, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_241adjointSetUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_adjointSetUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1298])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_adjointSetUp, __pyx_t_5) < (0)) __PYX_ERR(51, 2872, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2884
 *         CHKERR(TSAdjointSetUp(self.ts))
 * 
 *     def adjointSolve(self) -> None:             # <<<<<<<<<<<<<<
 *         """Solve the discrete adjoint problem for an ODE/DAE.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2884, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_243adjointSolve, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_adjointSolve, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1299])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_adjointSolve, __pyx_t_4) < (0)) __PYX_ERR(51, 2884, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2896
 *         CHKERR(TSAdjointSolve(self.ts))
 * 
 *     def adjointStep(self) -> None:             # <<<<<<<<<<<<<<
 *         """Step one time step backward in the adjoint run.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2896, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_245adjointStep, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_adjointStep, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1300])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_adjointStep, __pyx_t_5) < (0)) __PYX_ERR(51, 2896, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2908
 *         CHKERR(TSAdjointStep(self.ts))
 * 
 *     def adjointReset(self) -> None:             # <<<<<<<<<<<<<<
 *         """Reset a `TS`, removing any allocated vectors and matrices.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2908, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_247adjointReset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_adjointReset, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1301])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_adjointReset, __pyx_t_4) < (0)) __PYX_ERR(51, 2908, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2922
 *     # --- Python ---
 * 
 *     def createPython(self, context: Any = None, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an integrator of Python type.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_context, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(51, 2922, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(51, 2922, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(51, 2922, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_249createPython, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_createPython, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1302])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_createPython, __pyx_t_5) < (0)) __PYX_ERR(51, 2922, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2947
 *         return self
 * 
 *     def setPythonContext(self, context: Any) -> None:             # <<<<<<<<<<<<<<
 *         """Set the instance of the class implementing the required Python methods.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_context, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(51, 2947, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2947, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_251setPythonContext, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setPythonContext, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1303])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setPythonContext, __pyx_t_4) < (0)) __PYX_ERR(51, 2947, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2959
 *         CHKERR(TSPythonSetContext(self.ts, <void*>context))
 * 
 *     def getPythonContext(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return the instance of the class implementing the required Python methods.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(51, 2959, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_253getPythonContext, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getPythonContext, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1304])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getPythonContext, __pyx_t_5) < (0)) __PYX_ERR(51, 2959, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":2974
 *         else: return <object> context
 * 
 *     def setPythonType(self, py_type: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the fully qualified Python name of the class to be used.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_py_type, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(51, 2974, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 2974, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_255setPythonType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setPythonType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1305])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setPythonType, __pyx_t_4) < (0)) __PYX_ERR(51, 2974, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":2988
 *         CHKERR(TSPythonSetType(self.ts, cval))
 * 
 *     def getPythonType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the fully qualified Python name of the class used by the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 2988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(51, 2988, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_257getPythonType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getPythonType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1306])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 2988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getPythonType, __pyx_t_5) < (0)) __PYX_ERR(51, 2988, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":3004
 *     # --- Theta ---
 * 
 *     def setTheta(self, theta: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the abscissa of the stage in ``(0, 1]`` for `Type.THETA`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 3004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_theta, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 3004, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 3004, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_259setTheta, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setTheta, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1307])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 3004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setTheta, __pyx_t_4) < (0)) __PYX_ERR(51, 3004, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":3026
 *         CHKERR(TSThetaSetTheta(self.ts, rval))
 * 
 *     def getTheta(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the abscissa of the stage in ``(0, 1]`` for `Type.THETA`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 3026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 3026, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_261getTheta, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getTheta, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1308])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 3026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getTheta, __pyx_t_5) < (0)) __PYX_ERR(51, 3026, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":3040
 *         return toReal(rval)
 * 
 *     def setThetaEndpoint(self, flag=True) -> None:             # <<<<<<<<<<<<<<
 *         """Set to use the endpoint variant of `Type.THETA`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 3040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 3040, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_263setThetaEndpoint, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setThetaEndpoint, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1309])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 3040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[76]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setThetaEndpoint, __pyx_t_4) < (0)) __PYX_ERR(51, 3040, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":3058
 *         CHKERR(TSThetaSetEndpoint(self.ts, bval))
 * 
 *     def getThetaEndpoint(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the endpoint variable of `Type.THETA` is used.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 3058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(51, 3058, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_265getThetaEndpoint, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getThetaEndpoint, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1310])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 3058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getThetaEndpoint, __pyx_t_5) < (0)) __PYX_ERR(51, 3058, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":3074
 *     # --- Alpha ---
 * 
 *     def setAlphaRadius(self, radius: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the spectral radius for `Type.ALPHA`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 3074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_radius, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(51, 3074, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 3074, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_267setAlphaRadius, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setAlphaRadius, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1311])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 3074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setAlphaRadius, __pyx_t_4) < (0)) __PYX_ERR(51, 3074, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":3096
 *         CHKERR(TSAlphaSetRadius(self.ts, rval))
 * 
 *     def setAlphaParams(             # <<<<<<<<<<<<<<
 *         self,
 *         alpha_m: float | None = None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 3096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_alpha_m, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(51, 3096, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_alpha_f, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(51, 3096, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_gamma, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(51, 3096, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(51, 3096, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_269setAlphaParams, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_setAlphaParams, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1312])); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 3096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_setAlphaParams, __pyx_t_5) < (0)) __PYX_ERR(51, 3096, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TS.pyx":3129
 *         CHKERR(TSAlphaSetParams(self.ts,  rval1,  rval2,  rval3))
 * 
 *     def getAlphaParams(self) -> tuple[float, float, float]:             # <<<<<<<<<<<<<<
 *         """Return the algorithmic parameters for `Type.ALPHA`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(51, 3129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_float_float) < (0)) __PYX_ERR(51, 3129, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2TS_271getAlphaParams, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TS_getAlphaParams, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1313])); if (unlikely(!__pyx_t_4)) __PYX_ERR(51, 3129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TS, __pyx_mstate_global->__pyx_n_u_getAlphaParams, __pyx_t_4) < (0)) __PYX_ERR(51, 3129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TS.pyx":3281
 * # -----------------------------------------------------------------------------
 * 
 * del TSType             # <<<<<<<<<<<<<<
 * del TSRKType
 * del TSARKIMEXType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TSType) < (0)) __PYX_ERR(51, 3281, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":3282
 * 
 * del TSType
 * del TSRKType             # <<<<<<<<<<<<<<
 * del TSARKIMEXType
 * del TSDIRKType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TSRKType) < (0)) __PYX_ERR(51, 3282, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":3283
 * del TSType
 * del TSRKType
 * del TSARKIMEXType             # <<<<<<<<<<<<<<
 * del TSDIRKType
 * del TSProblemType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TSARKIMEXType) < (0)) __PYX_ERR(51, 3283, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":3284
 * del TSRKType
 * del TSARKIMEXType
 * del TSDIRKType             # <<<<<<<<<<<<<<
 * del TSProblemType
 * del TSEquationType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TSDIRKType) < (0)) __PYX_ERR(51, 3284, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":3285
 * del TSARKIMEXType
 * del TSDIRKType
 * del TSProblemType             # <<<<<<<<<<<<<<
 * del TSEquationType
 * del TSExactFinalTime
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TSProblemType) < (0)) __PYX_ERR(51, 3285, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":3286
 * del TSDIRKType
 * del TSProblemType
 * del TSEquationType             # <<<<<<<<<<<<<<
 * del TSExactFinalTime
 * del TSConvergedReason
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TSEquationType) < (0)) __PYX_ERR(51, 3286, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":3287
 * del TSProblemType
 * del TSEquationType
 * del TSExactFinalTime             # <<<<<<<<<<<<<<
 * del TSConvergedReason
 * 
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TSExactFinalTime) < (0)) __PYX_ERR(51, 3287, __pyx_L1_error)

  /* "petsc4py/PETSc/TS.pyx":3288
 * del TSEquationType
 * del TSExactFinalTime
 * del TSConvergedReason             # <<<<<<<<<<<<<<
 * 
 * # -----------------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TSConvergedReason) < (0)) __PYX_ERR(51, 3288, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class TAOType:             # <<<<<<<<<<<<<<
 *     """TAO solver type.
 * 
*/
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_TAOType, __pyx_mstate_global->__pyx_n_u_TAOType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_TAO_solver_type_See_Also_petsc_T); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "petsc4py/PETSc/TAO.pyx":11
 * 
 *     """
 *     LMVM     = S_(TAOLMVM)             # <<<<<<<<<<<<<<
 *     NLS      = S_(TAONLS)
 *     NTR      = S_(TAONTR)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOLMVM); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_LMVM, __pyx_t_5) < (0)) __PYX_ERR(52, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":12
 *     """
 *     LMVM     = S_(TAOLMVM)
 *     NLS      = S_(TAONLS)             # <<<<<<<<<<<<<<
 *     NTR      = S_(TAONTR)
 *     NTL      = S_(TAONTL)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAONLS); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_NLS, __pyx_t_5) < (0)) __PYX_ERR(52, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":13
 *     LMVM     = S_(TAOLMVM)
 *     NLS      = S_(TAONLS)
 *     NTR      = S_(TAONTR)             # <<<<<<<<<<<<<<
 *     NTL      = S_(TAONTL)
 *     CG       = S_(TAOCG)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAONTR); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_NTR, __pyx_t_5) < (0)) __PYX_ERR(52, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":14
 *     NLS      = S_(TAONLS)
 *     NTR      = S_(TAONTR)
 *     NTL      = S_(TAONTL)             # <<<<<<<<<<<<<<
 *     CG       = S_(TAOCG)
 *     TRON     = S_(TAOTRON)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAONTL); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_NTL, __pyx_t_5) < (0)) __PYX_ERR(52, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":15
 *     NTR      = S_(TAONTR)
 *     NTL      = S_(TAONTL)
 *     CG       = S_(TAOCG)             # <<<<<<<<<<<<<<
 *     TRON     = S_(TAOTRON)
 *     OWLQN    = S_(TAOOWLQN)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOCG); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_CG, __pyx_t_5) < (0)) __PYX_ERR(52, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":16
 *     NTL      = S_(TAONTL)
 *     CG       = S_(TAOCG)
 *     TRON     = S_(TAOTRON)             # <<<<<<<<<<<<<<
 *     OWLQN    = S_(TAOOWLQN)
 *     BMRM     = S_(TAOBMRM)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOTRON); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TRON, __pyx_t_5) < (0)) __PYX_ERR(52, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":17
 *     CG       = S_(TAOCG)
 *     TRON     = S_(TAOTRON)
 *     OWLQN    = S_(TAOOWLQN)             # <<<<<<<<<<<<<<
 *     BMRM     = S_(TAOBMRM)
 *     BLMVM    = S_(TAOBLMVM)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOOWLQN); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OWLQN, __pyx_t_5) < (0)) __PYX_ERR(52, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":18
 *     TRON     = S_(TAOTRON)
 *     OWLQN    = S_(TAOOWLQN)
 *     BMRM     = S_(TAOBMRM)             # <<<<<<<<<<<<<<
 *     BLMVM    = S_(TAOBLMVM)
 *     BQNLS    = S_(TAOBQNLS)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOBMRM); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BMRM, __pyx_t_5) < (0)) __PYX_ERR(52, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":19
 *     OWLQN    = S_(TAOOWLQN)
 *     BMRM     = S_(TAOBMRM)
 *     BLMVM    = S_(TAOBLMVM)             # <<<<<<<<<<<<<<
 *     BQNLS    = S_(TAOBQNLS)
 *     BNCG     = S_(TAOBNCG)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOBLMVM); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BLMVM, __pyx_t_5) < (0)) __PYX_ERR(52, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":20
 *     BMRM     = S_(TAOBMRM)
 *     BLMVM    = S_(TAOBLMVM)
 *     BQNLS    = S_(TAOBQNLS)             # <<<<<<<<<<<<<<
 *     BNCG     = S_(TAOBNCG)
 *     BNLS     = S_(TAOBNLS)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOBQNLS); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BQNLS, __pyx_t_5) < (0)) __PYX_ERR(52, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":21
 *     BLMVM    = S_(TAOBLMVM)
 *     BQNLS    = S_(TAOBQNLS)
 *     BNCG     = S_(TAOBNCG)             # <<<<<<<<<<<<<<
 *     BNLS     = S_(TAOBNLS)
 *     BNTR     = S_(TAOBNTR)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOBNCG); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BNCG, __pyx_t_5) < (0)) __PYX_ERR(52, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":22
 *     BQNLS    = S_(TAOBQNLS)
 *     BNCG     = S_(TAOBNCG)
 *     BNLS     = S_(TAOBNLS)             # <<<<<<<<<<<<<<
 *     BNTR     = S_(TAOBNTR)
 *     BNTL     = S_(TAOBNTL)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOBNLS); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BNLS, __pyx_t_5) < (0)) __PYX_ERR(52, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":23
 *     BNCG     = S_(TAOBNCG)
 *     BNLS     = S_(TAOBNLS)
 *     BNTR     = S_(TAOBNTR)             # <<<<<<<<<<<<<<
 *     BNTL     = S_(TAOBNTL)
 *     BQNKLS   = S_(TAOBQNKLS)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOBNTR); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BNTR, __pyx_t_5) < (0)) __PYX_ERR(52, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":24
 *     BNLS     = S_(TAOBNLS)
 *     BNTR     = S_(TAOBNTR)
 *     BNTL     = S_(TAOBNTL)             # <<<<<<<<<<<<<<
 *     BQNKLS   = S_(TAOBQNKLS)
 *     BQNKTR   = S_(TAOBQNKTR)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOBNTL); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BNTL, __pyx_t_5) < (0)) __PYX_ERR(52, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":25
 *     BNTR     = S_(TAOBNTR)
 *     BNTL     = S_(TAOBNTL)
 *     BQNKLS   = S_(TAOBQNKLS)             # <<<<<<<<<<<<<<
 *     BQNKTR   = S_(TAOBQNKTR)
 *     BQNKTL   = S_(TAOBQNKTL)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOBQNKLS); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BQNKLS, __pyx_t_5) < (0)) __PYX_ERR(52, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":26
 *     BNTL     = S_(TAOBNTL)
 *     BQNKLS   = S_(TAOBQNKLS)
 *     BQNKTR   = S_(TAOBQNKTR)             # <<<<<<<<<<<<<<
 *     BQNKTL   = S_(TAOBQNKTL)
 *     BQPIP    = S_(TAOBQPIP)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOBQNKTR); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BQNKTR, __pyx_t_5) < (0)) __PYX_ERR(52, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":27
 *     BQNKLS   = S_(TAOBQNKLS)
 *     BQNKTR   = S_(TAOBQNKTR)
 *     BQNKTL   = S_(TAOBQNKTL)             # <<<<<<<<<<<<<<
 *     BQPIP    = S_(TAOBQPIP)
 *     GPCG     = S_(TAOGPCG)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOBQNKTL); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BQNKTL, __pyx_t_5) < (0)) __PYX_ERR(52, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":28
 *     BQNKTR   = S_(TAOBQNKTR)
 *     BQNKTL   = S_(TAOBQNKTL)
 *     BQPIP    = S_(TAOBQPIP)             # <<<<<<<<<<<<<<
 *     GPCG     = S_(TAOGPCG)
 *     NM       = S_(TAONM)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOBQPIP); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BQPIP, __pyx_t_5) < (0)) __PYX_ERR(52, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":29
 *     BQNKTL   = S_(TAOBQNKTL)
 *     BQPIP    = S_(TAOBQPIP)
 *     GPCG     = S_(TAOGPCG)             # <<<<<<<<<<<<<<
 *     NM       = S_(TAONM)
 *     POUNDERS = S_(TAOPOUNDERS)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOGPCG); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_GPCG, __pyx_t_5) < (0)) __PYX_ERR(52, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":30
 *     BQPIP    = S_(TAOBQPIP)
 *     GPCG     = S_(TAOGPCG)
 *     NM       = S_(TAONM)             # <<<<<<<<<<<<<<
 *     POUNDERS = S_(TAOPOUNDERS)
 *     BRGN     = S_(TAOBRGN)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAONM); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_NM, __pyx_t_5) < (0)) __PYX_ERR(52, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":31
 *     GPCG     = S_(TAOGPCG)
 *     NM       = S_(TAONM)
 *     POUNDERS = S_(TAOPOUNDERS)             # <<<<<<<<<<<<<<
 *     BRGN     = S_(TAOBRGN)
 *     LCL      = S_(TAOLCL)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOPOUNDERS); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_POUNDERS, __pyx_t_5) < (0)) __PYX_ERR(52, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":32
 *     NM       = S_(TAONM)
 *     POUNDERS = S_(TAOPOUNDERS)
 *     BRGN     = S_(TAOBRGN)             # <<<<<<<<<<<<<<
 *     LCL      = S_(TAOLCL)
 *     SSILS    = S_(TAOSSILS)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOBRGN); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_BRGN, __pyx_t_5) < (0)) __PYX_ERR(52, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":33
 *     POUNDERS = S_(TAOPOUNDERS)
 *     BRGN     = S_(TAOBRGN)
 *     LCL      = S_(TAOLCL)             # <<<<<<<<<<<<<<
 *     SSILS    = S_(TAOSSILS)
 *     SSFLS    = S_(TAOSSFLS)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOLCL); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_LCL, __pyx_t_5) < (0)) __PYX_ERR(52, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":34
 *     BRGN     = S_(TAOBRGN)
 *     LCL      = S_(TAOLCL)
 *     SSILS    = S_(TAOSSILS)             # <<<<<<<<<<<<<<
 *     SSFLS    = S_(TAOSSFLS)
 *     ASILS    = S_(TAOASILS)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOSSILS); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SSILS, __pyx_t_5) < (0)) __PYX_ERR(52, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":35
 *     LCL      = S_(TAOLCL)
 *     SSILS    = S_(TAOSSILS)
 *     SSFLS    = S_(TAOSSFLS)             # <<<<<<<<<<<<<<
 *     ASILS    = S_(TAOASILS)
 *     ASFLS    = S_(TAOASFLS)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOSSFLS); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SSFLS, __pyx_t_5) < (0)) __PYX_ERR(52, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":36
 *     SSILS    = S_(TAOSSILS)
 *     SSFLS    = S_(TAOSSFLS)
 *     ASILS    = S_(TAOASILS)             # <<<<<<<<<<<<<<
 *     ASFLS    = S_(TAOASFLS)
 *     IPM      = S_(TAOIPM)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOASILS); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ASILS, __pyx_t_5) < (0)) __PYX_ERR(52, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":37
 *     SSFLS    = S_(TAOSSFLS)
 *     ASILS    = S_(TAOASILS)
 *     ASFLS    = S_(TAOASFLS)             # <<<<<<<<<<<<<<
 *     IPM      = S_(TAOIPM)
 *     PDIPM    = S_(TAOPDIPM)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOASFLS); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ASFLS, __pyx_t_5) < (0)) __PYX_ERR(52, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":38
 *     ASILS    = S_(TAOASILS)
 *     ASFLS    = S_(TAOASFLS)
 *     IPM      = S_(TAOIPM)             # <<<<<<<<<<<<<<
 *     PDIPM    = S_(TAOPDIPM)
 *     SHELL    = S_(TAOSHELL)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOIPM); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_IPM, __pyx_t_5) < (0)) __PYX_ERR(52, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":39
 *     ASFLS    = S_(TAOASFLS)
 *     IPM      = S_(TAOIPM)
 *     PDIPM    = S_(TAOPDIPM)             # <<<<<<<<<<<<<<
 *     SHELL    = S_(TAOSHELL)
 *     ADMM     = S_(TAOADMM)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOPDIPM); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PDIPM, __pyx_t_5) < (0)) __PYX_ERR(52, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":40
 *     IPM      = S_(TAOIPM)
 *     PDIPM    = S_(TAOPDIPM)
 *     SHELL    = S_(TAOSHELL)             # <<<<<<<<<<<<<<
 *     ADMM     = S_(TAOADMM)
 *     ALMM     = S_(TAOALMM)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOSHELL); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SHELL, __pyx_t_5) < (0)) __PYX_ERR(52, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":41
 *     PDIPM    = S_(TAOPDIPM)
 *     SHELL    = S_(TAOSHELL)
 *     ADMM     = S_(TAOADMM)             # <<<<<<<<<<<<<<
 *     ALMM     = S_(TAOALMM)
 *     PYTHON   = S_(TAOPYTHON)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOADMM); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ADMM, __pyx_t_5) < (0)) __PYX_ERR(52, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":42
 *     SHELL    = S_(TAOSHELL)
 *     ADMM     = S_(TAOADMM)
 *     ALMM     = S_(TAOALMM)             # <<<<<<<<<<<<<<
 *     PYTHON   = S_(TAOPYTHON)
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOALMM); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ALMM, __pyx_t_5) < (0)) __PYX_ERR(52, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":43
 *     ADMM     = S_(TAOADMM)
 *     ALMM     = S_(TAOALMM)
 *     PYTHON   = S_(TAOPYTHON)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOPYTHON); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PYTHON, __pyx_t_5) < (0)) __PYX_ERR(52, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class TAOType:             # <<<<<<<<<<<<<<
 *     """TAO solver type.
 * 
*/
  __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_TAOType, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TAOType, __pyx_t_5) < (0)) __PYX_ERR(52, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":46
 * 
 * 
 * class TAOConvergedReason:             # <<<<<<<<<<<<<<
 *     """TAO solver termination reason.
 * 
*/
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_TAOConvergedReason, __pyx_mstate_global->__pyx_n_u_TAOConvergedReason, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_TAO_solver_termination_reason_Se); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "petsc4py/PETSc/TAO.pyx":55
 *     """
 *     # iterating
 *     CONTINUE_ITERATING    = TAO_CONTINUE_ITERATING    # iterating             # <<<<<<<<<<<<<<
 *     CONVERGED_ITERATING   = TAO_CONTINUE_ITERATING    # iterating
 *     ITERATING             = TAO_CONTINUE_ITERATING    # iterating
*/
  __pyx_t_5 = __Pyx_PyLong_From_TaoConvergedReason(TAO_CONTINUE_ITERATING); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_CONTINUE_ITERATING, __pyx_t_5) < (0)) __PYX_ERR(52, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":56
 *     # iterating
 *     CONTINUE_ITERATING    = TAO_CONTINUE_ITERATING    # iterating
 *     CONVERGED_ITERATING   = TAO_CONTINUE_ITERATING    # iterating             # <<<<<<<<<<<<<<
 *     ITERATING             = TAO_CONTINUE_ITERATING    # iterating
 *     # converged
*/
  __pyx_t_5 = __Pyx_PyLong_From_TaoConvergedReason(TAO_CONTINUE_ITERATING); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_CONVERGED_ITERATING, __pyx_t_5) < (0)) __PYX_ERR(52, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":57
 *     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_5 = __Pyx_PyLong_From_TaoConvergedReason(TAO_CONTINUE_ITERATING); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ITERATING, __pyx_t_5) < (0)) __PYX_ERR(52, 57, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":59
 *     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_5 = __Pyx_PyLong_From_TaoConvergedReason(TAO_CONVERGED_GATOL); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_CONVERGED_GATOL, __pyx_t_5) < (0)) __PYX_ERR(52, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":60
 *     # 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_5 = __Pyx_PyLong_From_TaoConvergedReason(TAO_CONVERGED_GRTOL); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_CONVERGED_GRTOL, __pyx_t_5) < (0)) __PYX_ERR(52, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":61
 *     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_5 = __Pyx_PyLong_From_TaoConvergedReason(TAO_CONVERGED_GTTOL); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_CONVERGED_GTTOL, __pyx_t_5) < (0)) __PYX_ERR(52, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":62
 *     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_5 = __Pyx_PyLong_From_TaoConvergedReason(TAO_CONVERGED_STEPTOL); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_CONVERGED_STEPTOL, __pyx_t_5) < (0)) __PYX_ERR(52, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":63
 *     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_5 = __Pyx_PyLong_From_TaoConvergedReason(TAO_CONVERGED_MINF); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_CONVERGED_MINF, __pyx_t_5) < (0)) __PYX_ERR(52, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":64
 *     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_5 = __Pyx_PyLong_From_TaoConvergedReason(TAO_CONVERGED_USER); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_CONVERGED_USER, __pyx_t_5) < (0)) __PYX_ERR(52, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":66
 *     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_5 = __Pyx_PyLong_From_TaoConvergedReason(TAO_DIVERGED_MAXITS); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DIVERGED_MAXITS, __pyx_t_5) < (0)) __PYX_ERR(52, 66, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":67
 *     # 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_5 = __Pyx_PyLong_From_TaoConvergedReason(TAO_DIVERGED_NAN); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DIVERGED_NAN, __pyx_t_5) < (0)) __PYX_ERR(52, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":68
 *     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_5 = __Pyx_PyLong_From_TaoConvergedReason(TAO_DIVERGED_MAXFCN); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DIVERGED_MAXFCN, __pyx_t_5) < (0)) __PYX_ERR(52, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":69
 *     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_5 = __Pyx_PyLong_From_TaoConvergedReason(TAO_DIVERGED_LS_FAILURE); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DIVERGED_LS_FAILURE, __pyx_t_5) < (0)) __PYX_ERR(52, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":70
 *     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_5 = __Pyx_PyLong_From_TaoConvergedReason(TAO_DIVERGED_TR_REDUCTION); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DIVERGED_TR_REDUCTION, __pyx_t_5) < (0)) __PYX_ERR(52, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":71
 *     DIVERGED_LS_FAILURE   = TAO_DIVERGED_LS_FAILURE   #
 *     DIVERGED_TR_REDUCTION = TAO_DIVERGED_TR_REDUCTION #
 *     DIVERGED_USER         = TAO_DIVERGED_USER         # user defined             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_5 = __Pyx_PyLong_From_TaoConvergedReason(TAO_DIVERGED_USER); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DIVERGED_USER, __pyx_t_5) < (0)) __PYX_ERR(52, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":46
 * 
 * 
 * class TAOConvergedReason:             # <<<<<<<<<<<<<<
 *     """TAO solver termination reason.
 * 
*/
  __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_TAOConvergedReason, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TAOConvergedReason, __pyx_t_5) < (0)) __PYX_ERR(52, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":74
 * 
 * 
 * class TAOBNCGType:             # <<<<<<<<<<<<<<
 *     """TAO Bound Constrained Conjugate Gradient (BNCG) Update Type."""
 *     GD         = TAO_BNCG_GD
*/
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_TAOBNCGType, __pyx_mstate_global->__pyx_n_u_TAOBNCGType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_TAO_Bound_Constrained_Conjugate); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "petsc4py/PETSc/TAO.pyx":76
 * class TAOBNCGType:
 *     """TAO Bound Constrained Conjugate Gradient (BNCG) Update Type."""
 *     GD         = TAO_BNCG_GD             # <<<<<<<<<<<<<<
 *     PCGD       = TAO_BNCG_PCGD
 *     HS         = TAO_BNCG_HS
*/
  __pyx_t_5 = __Pyx_PyLong_From_TaoBNCGType(TAO_BNCG_GD); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_GD, __pyx_t_5) < (0)) __PYX_ERR(52, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":77
 *     """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_5 = __Pyx_PyLong_From_TaoBNCGType(TAO_BNCG_PCGD); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PCGD, __pyx_t_5) < (0)) __PYX_ERR(52, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":78
 *     GD         = TAO_BNCG_GD
 *     PCGD       = TAO_BNCG_PCGD
 *     HS         = TAO_BNCG_HS             # <<<<<<<<<<<<<<
 *     FR         = TAO_BNCG_FR
 *     PRP        = TAO_BNCG_PRP
*/
  __pyx_t_5 = __Pyx_PyLong_From_TaoBNCGType(TAO_BNCG_HS); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_HS, __pyx_t_5) < (0)) __PYX_ERR(52, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":79
 *     PCGD       = TAO_BNCG_PCGD
 *     HS         = TAO_BNCG_HS
 *     FR         = TAO_BNCG_FR             # <<<<<<<<<<<<<<
 *     PRP        = TAO_BNCG_PRP
 *     PRP_PLUS   = TAO_BNCG_PRP_PLUS
*/
  __pyx_t_5 = __Pyx_PyLong_From_TaoBNCGType(TAO_BNCG_FR); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FR, __pyx_t_5) < (0)) __PYX_ERR(52, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":80
 *     HS         = TAO_BNCG_HS
 *     FR         = TAO_BNCG_FR
 *     PRP        = TAO_BNCG_PRP             # <<<<<<<<<<<<<<
 *     PRP_PLUS   = TAO_BNCG_PRP_PLUS
 *     DY         = TAO_BNCG_DY
*/
  __pyx_t_5 = __Pyx_PyLong_From_TaoBNCGType(TAO_BNCG_PRP); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PRP, __pyx_t_5) < (0)) __PYX_ERR(52, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":81
 *     FR         = TAO_BNCG_FR
 *     PRP        = TAO_BNCG_PRP
 *     PRP_PLUS   = TAO_BNCG_PRP_PLUS             # <<<<<<<<<<<<<<
 *     DY         = TAO_BNCG_DY
 *     HZ         = TAO_BNCG_HZ
*/
  __pyx_t_5 = __Pyx_PyLong_From_TaoBNCGType(TAO_BNCG_PRP_PLUS); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PRP_PLUS, __pyx_t_5) < (0)) __PYX_ERR(52, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":82
 *     PRP        = TAO_BNCG_PRP
 *     PRP_PLUS   = TAO_BNCG_PRP_PLUS
 *     DY         = TAO_BNCG_DY             # <<<<<<<<<<<<<<
 *     HZ         = TAO_BNCG_HZ
 *     DK         = TAO_BNCG_DK
*/
  __pyx_t_5 = __Pyx_PyLong_From_TaoBNCGType(TAO_BNCG_DY); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DY, __pyx_t_5) < (0)) __PYX_ERR(52, 82, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":83
 *     PRP_PLUS   = TAO_BNCG_PRP_PLUS
 *     DY         = TAO_BNCG_DY
 *     HZ         = TAO_BNCG_HZ             # <<<<<<<<<<<<<<
 *     DK         = TAO_BNCG_DK
 *     KD         = TAO_BNCG_KD
*/
  __pyx_t_5 = __Pyx_PyLong_From_TaoBNCGType(TAO_BNCG_HZ); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_HZ, __pyx_t_5) < (0)) __PYX_ERR(52, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":84
 *     DY         = TAO_BNCG_DY
 *     HZ         = TAO_BNCG_HZ
 *     DK         = TAO_BNCG_DK             # <<<<<<<<<<<<<<
 *     KD         = TAO_BNCG_KD
 *     SSML_BFGS  = TAO_BNCG_SSML_BFGS
*/
  __pyx_t_5 = __Pyx_PyLong_From_TaoBNCGType(TAO_BNCG_DK); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DK, __pyx_t_5) < (0)) __PYX_ERR(52, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":85
 *     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_5 = __Pyx_PyLong_From_TaoBNCGType(TAO_BNCG_KD); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_KD, __pyx_t_5) < (0)) __PYX_ERR(52, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":86
 *     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_5 = __Pyx_PyLong_From_TaoBNCGType(TAO_BNCG_SSML_BFGS); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SSML_BFGS, __pyx_t_5) < (0)) __PYX_ERR(52, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":87
 *     KD         = TAO_BNCG_KD
 *     SSML_BFGS  = TAO_BNCG_SSML_BFGS
 *     SSML_DFP   = TAO_BNCG_SSML_DFP             # <<<<<<<<<<<<<<
 *     SSML_BRDN  = TAO_BNCG_SSML_BRDN
 * 
*/
  __pyx_t_5 = __Pyx_PyLong_From_TaoBNCGType(TAO_BNCG_SSML_DFP); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SSML_DFP, __pyx_t_5) < (0)) __PYX_ERR(52, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":88
 *     SSML_BFGS  = TAO_BNCG_SSML_BFGS
 *     SSML_DFP   = TAO_BNCG_SSML_DFP
 *     SSML_BRDN  = TAO_BNCG_SSML_BRDN             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_5 = __Pyx_PyLong_From_TaoBNCGType(TAO_BNCG_SSML_BRDN); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SSML_BRDN, __pyx_t_5) < (0)) __PYX_ERR(52, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":74
 * 
 * 
 * class TAOBNCGType:             # <<<<<<<<<<<<<<
 *     """TAO Bound Constrained Conjugate Gradient (BNCG) Update Type."""
 *     GD         = TAO_BNCG_GD
*/
  __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_TAOBNCGType, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TAOBNCGType, __pyx_t_5) < (0)) __PYX_ERR(52, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":91
 * 
 * 
 * class TAOALMMType:             # <<<<<<<<<<<<<<
 *     """TAO Augmented Lagrangian Multiplier method (ALMM) Type."""
 *     CLASSIC = TAO_ALMM_CLASSIC
*/
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_TAOALMMType, __pyx_mstate_global->__pyx_n_u_TAOALMMType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_TAO_Augmented_Lagrangian_Multipl); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "petsc4py/PETSc/TAO.pyx":93
 * class TAOALMMType:
 *     """TAO Augmented Lagrangian Multiplier method (ALMM) Type."""
 *     CLASSIC = TAO_ALMM_CLASSIC             # <<<<<<<<<<<<<<
 *     PHR     = TAO_ALMM_PHR
 * # --------------------------------------------------------------------
*/
  __pyx_t_5 = __Pyx_PyLong_From_TaoALMMType(TAO_ALMM_CLASSIC); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_CLASSIC, __pyx_t_5) < (0)) __PYX_ERR(52, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":94
 *     """TAO Augmented Lagrangian Multiplier method (ALMM) Type."""
 *     CLASSIC = TAO_ALMM_CLASSIC
 *     PHR     = TAO_ALMM_PHR             # <<<<<<<<<<<<<<
 * # --------------------------------------------------------------------
 * 
*/
  __pyx_t_5 = __Pyx_PyLong_From_TaoALMMType(TAO_ALMM_PHR); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 94, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PHR, __pyx_t_5) < (0)) __PYX_ERR(52, 94, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":91
 * 
 * 
 * class TAOALMMType:             # <<<<<<<<<<<<<<
 *     """TAO Augmented Lagrangian Multiplier method (ALMM) Type."""
 *     CLASSIC = TAO_ALMM_CLASSIC
*/
  __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_TAOALMMType, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TAOALMMType, __pyx_t_5) < (0)) __PYX_ERR(52, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":109
 *     """
 * 
 *     Type = TAOType             # <<<<<<<<<<<<<<
 *     ConvergedReason = TAOConvergedReason
 *     BNCGType = TAOBNCGType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TAOType); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_4) < (0)) __PYX_ERR(52, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":110
 * 
 *     Type = TAOType
 *     ConvergedReason = TAOConvergedReason             # <<<<<<<<<<<<<<
 *     BNCGType = TAOBNCGType
 *     ALMMType = TAOALMMType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TAOConvergedReason); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_ConvergedReason, __pyx_t_4) < (0)) __PYX_ERR(52, 110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":111
 *     Type = TAOType
 *     ConvergedReason = TAOConvergedReason
 *     BNCGType = TAOBNCGType             # <<<<<<<<<<<<<<
 *     ALMMType = TAOALMMType
 *     # FIXME backward compatibility
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TAOBNCGType); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_BNCGType, __pyx_t_4) < (0)) __PYX_ERR(52, 111, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":112
 *     ConvergedReason = TAOConvergedReason
 *     BNCGType = TAOBNCGType
 *     ALMMType = TAOALMMType             # <<<<<<<<<<<<<<
 *     # FIXME backward compatibility
 *     Reason = TAOConvergedReason
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TAOALMMType); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_ALMMType, __pyx_t_4) < (0)) __PYX_ERR(52, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":114
 *     ALMMType = TAOALMMType
 *     # FIXME backward compatibility
 *     Reason = TAOConvergedReason             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TAOConvergedReason); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_Reason, __pyx_t_4) < (0)) __PYX_ERR(52, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":120
 *         self.tao = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 120, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_3view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1314])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_5) < (0)) __PYX_ERR(52, 120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":139
 *         CHKERR(TaoView(self.tao, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(52, 139, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1315])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_4) < (0)) __PYX_ERR(52, 139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":152
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a TAO solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(52, 152, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(52, 152, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_7create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1316])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_5) < (0)) __PYX_ERR(52, 152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":173
 *         return self
 * 
 *     def setType(self, tao_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_tao_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(52, 173, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 173, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_9setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1317])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_4) < (0)) __PYX_ERR(52, 173, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":192
 *         CHKERR(TaoSetType(self.tao, ctype))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(52, 192, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_11getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1318])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_5) < (0)) __PYX_ERR(52, 192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":206
 *         return bytes2str(ctype)
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(52, 206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 206, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_13setOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1319])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setOptionsPrefix, __pyx_t_4) < (0)) __PYX_ERR(52, 206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":220
 *         CHKERR(TaoSetOptionsPrefix(self.tao, cprefix))
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Append to the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(52, 220, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 220, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_15appendOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_appendOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1320])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_appendOptionsPrefix, __pyx_t_5) < (0)) __PYX_ERR(52, 220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":234
 *         CHKERR(TaoAppendOptionsPrefix(self.tao, cprefix))
 * 
 *     def getOptionsPrefix(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(52, 234, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_17getOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1321])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getOptionsPrefix, __pyx_t_4) < (0)) __PYX_ERR(52, 234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":248
 *         return bytes2str(prefix)
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the solver from the options database.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 248, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_19setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1322])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_5) < (0)) __PYX_ERR(52, 248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":260
 *         CHKERR(TaoSetFromOptions(self.tao))
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 260, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_21setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1323])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_4) < (0)) __PYX_ERR(52, 260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":274
 *     #
 * 
 *     def setInitialTrustRegionRadius(self, radius: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the initial trust region radius.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_radius, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(52, 274, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 274, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_23setInitialTrustRegionRadius, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setInitialTrustRegionRadius, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1324])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setInitialTrustRegionRadius, __pyx_t_5) < (0)) __PYX_ERR(52, 274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":289
 *     # --------------
 * 
 *     def setAppCtx(self, appctx: Any) -> None:             # <<<<<<<<<<<<<<
 *         """Set the application context."""
 *         self.set_attr("__appctx__", appctx)
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_appctx, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(52, 289, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 289, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_25setAppCtx, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setAppCtx, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1325])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setAppCtx, __pyx_t_4) < (0)) __PYX_ERR(52, 289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":293
 *         self.set_attr("__appctx__", appctx)
 * 
 *     def getAppCtx(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return the application context."""
 *         return self.get_attr("__appctx__")
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(52, 293, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_27getAppCtx, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getAppCtx, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1326])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getAppCtx, __pyx_t_5) < (0)) __PYX_ERR(52, 293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":297
 *         return self.get_attr("__appctx__")
 * 
 *     def setSolution(self, Vec x) -> None:             # <<<<<<<<<<<<<<
 *         """Set the vector used to store the solution.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 297, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_29setSolution, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setSolution, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1327])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setSolution, __pyx_t_4) < (0)) __PYX_ERR(52, 297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":309
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_objective, __pyx_mstate_global->__pyx_n_u_TAOObjectiveFunction) < (0)) __PYX_ERR(52, 309, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 309, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 309, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 309, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_31setObjective, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setObjective, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1328])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setObjective, __pyx_t_5) < (0)) __PYX_ERR(52, 309, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":334
 *         CHKERR(TaoSetObjective(self.tao, TAO_Objective, <void*>context))
 * 
 *     def setResidual(self, residual: TAOResidualFunction, Vec R, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the residual evaluation callback for least-squares applications.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_residual, __pyx_mstate_global->__pyx_n_u_TAOResidualFunction) < (0)) __PYX_ERR(52, 334, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 334, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 334, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 334, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_33setResidual, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setResidual, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1329])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setResidual, __pyx_t_4) < (0)) __PYX_ERR(52, 334, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":361
 *         CHKERR(TaoSetResidualRoutine(self.tao, R.vec, TAO_Residual, <void*>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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_jacobian, __pyx_mstate_global->__pyx_n_u_TAOJacobianResidualFunction) < (0)) __PYX_ERR(52, 361, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 361, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 361, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 361, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_35setJacobianResidual, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setJacobianResidual, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1330])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setJacobianResidual, __pyx_t_5) < (0)) __PYX_ERR(52, 361, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":394
 *         CHKERR(TaoSetJacobianResidualRoutine(self.tao, Jmat, Pmat, TAO_JacobianResidual, <void*>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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_gradient, __pyx_mstate_global->__pyx_n_u_TAOGradientFunction) < (0)) __PYX_ERR(52, 394, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 394, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 394, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 394, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_37setGradient, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setGradient, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1331])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setGradient, __pyx_t_4) < (0)) __PYX_ERR(52, 394, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":423
 *         CHKERR(TaoSetGradient(self.tao, gvec, TAO_Gradient, <void*>context))
 * 
 *     def getObjective(self) -> TAOObjectiveFunction:             # <<<<<<<<<<<<<<
 *         """Return the objective evaluation callback.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_TAOObjectiveFunction) < (0)) __PYX_ERR(52, 423, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_39getObjective, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getObjective, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1332])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getObjective, __pyx_t_5) < (0)) __PYX_ERR(52, 423, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":436
 *         return objective
 * 
 *     def getGradient(self) -> tuple[Vec, TAOGradientFunction]:             # <<<<<<<<<<<<<<
 *         """Return the vector used to store the gradient and the evaluation callback.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Vec_TAOGradientFunction) < (0)) __PYX_ERR(52, 436, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_41getGradient, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getGradient, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1333])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getGradient, __pyx_t_4) < (0)) __PYX_ERR(52, 436, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":452
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_objgrad, __pyx_mstate_global->__pyx_n_u_TAOObjectiveGradientFunction) < (0)) __PYX_ERR(52, 452, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 452, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 452, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 452, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_43setObjectiveGradient, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setObjectiveGradient, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1334])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setObjectiveGradient, __pyx_t_5) < (0)) __PYX_ERR(52, 452, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":482
 *         CHKERR(TaoSetObjectiveAndGradient(self.tao, gvec, TAO_ObjGrad, <void*>context))
 * 
 *     def getObjectiveAndGradient(self) -> tuple[Vec, TAOObjectiveGradientFunction]:             # <<<<<<<<<<<<<<
 *         """Return the vector used to store the gradient and the evaluation callback.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Vec_TAOObjectiveGradientFu) < (0)) __PYX_ERR(52, 482, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_45getObjectiveAndGradient, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getObjectiveAndGradient, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1335])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getObjectiveAndGradient, __pyx_t_4) < (0)) __PYX_ERR(52, 482, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":498
 *         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 lower and upper bounds for the optimization problem.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_varbounds, __pyx_mstate_global->__pyx_kp_u_tuple_Vec_Vec_TAOVariableBoundsF) < (0)) __PYX_ERR(52, 498, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 498, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 498, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 498, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_47setVariableBounds, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setVariableBounds, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1336])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setVariableBounds, __pyx_t_5) < (0)) __PYX_ERR(52, 498, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":534
 *         CHKERR(TaoSetVariableBoundsRoutine(self.tao, TAO_VarBounds, <void*>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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_constraints, __pyx_mstate_global->__pyx_n_u_TAOConstraintsFunction) < (0)) __PYX_ERR(52, 534, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 534, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 534, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 534, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_49setConstraints, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setConstraints, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1337])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setConstraints, __pyx_t_4) < (0)) __PYX_ERR(52, 534, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":563
 *         CHKERR(TaoSetConstraintsRoutine(self.tao, Cvec, TAO_Constraints, <void*>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.
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_hessian, __pyx_mstate_global->__pyx_n_u_TAOHessianFunction) < (0)) __PYX_ERR(52, 563, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 563, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 563, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 563, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_51setHessian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setHessian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1338])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setHessian, __pyx_t_5) < (0)) __PYX_ERR(52, 563, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":598
 *         CHKERR(TaoSetHessian(self.tao, Hmat, Pmat, TAO_Hessian, <void*>context))
 * 
 *     def getHessian(self) -> tuple[Mat, Mat, TAOHessianFunction]:             # <<<<<<<<<<<<<<
 *         """Return the matrices used to store the Hessian and the evaluation callback.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Mat_Mat_TAOHessianFunction) < (0)) __PYX_ERR(52, 598, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_53getHessian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getHessian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1339])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getHessian, __pyx_t_4) < (0)) __PYX_ERR(52, 598, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":616
 *         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.
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_jacobian, __pyx_mstate_global->__pyx_n_u_TAOJacobianFunction) < (0)) __PYX_ERR(52, 616, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 616, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 616, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 616, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_55setJacobian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setJacobian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1340])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setJacobian, __pyx_t_5) < (0)) __PYX_ERR(52, 616, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":650
 *         CHKERR(TaoSetJacobianRoutine(self.tao, Jmat, Pmat, TAO_Jacobian, <void*>context))
 * 
 *     def setStateDesignIS(self, IS state=None, IS design=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the index sets indicating state and design variables.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 650, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_57setStateDesignIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setStateDesignIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1341])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setStateDesignIS, __pyx_t_4) < (0)) __PYX_ERR(52, 650, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":665
 *         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.
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 665, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 665, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 665, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_59setJacobianState, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setJacobianState, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1342])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[30]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setJacobianState, __pyx_t_5) < (0)) __PYX_ERR(52, 665, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":689
 *                                           TAO_JacobianState, <void*>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.
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 689, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 689, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 689, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_61setJacobianDesign, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setJacobianDesign, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1343])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setJacobianDesign, __pyx_t_4) < (0)) __PYX_ERR(52, 689, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":709
 *                                            TAO_JacobianDesign, <void*>context))
 * 
 *     def getLMVMMat(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Get the LMVM matrix.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(52, 709, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_63getLMVMMat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getLMVMMat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1344])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getLMVMMat, __pyx_t_5) < (0)) __PYX_ERR(52, 709, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":724
 *         return M
 * 
 *     def setLMVMMat(self, Mat M) -> None:             # <<<<<<<<<<<<<<
 *         """Set the LMVM matrix.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 724, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_65setLMVMMat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setLMVMMat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1345])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setLMVMMat, __pyx_t_4) < (0)) __PYX_ERR(52, 724, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":737
 *         CHKERR(TaoSetLMVMMatrix(self.tao, ctype))
 * 
 *     def setEqualityConstraints(self, equality_constraints, Vec c,             # <<<<<<<<<<<<<<
 *                                args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:
 *         """Set equality constraints callback.
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 737, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 737, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 737, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_67setEqualityConstraints, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setEqualityConstraints, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1346])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setEqualityConstraints, __pyx_t_5) < (0)) __PYX_ERR(52, 737, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":755
 *                                                 TAO_EqualityConstraints, <void*>context))
 * 
 *     def getEqualityConstraints(self) -> tuple[Vec, tuple[TAOConstraintsFunction, tuple[Any, ...] | None, dict[str, Any] | None]]:             # <<<<<<<<<<<<<<
 *         """Return tuple holding vector and callback of equality constraints.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Vec_tuple_TAOConstraintsFu) < (0)) __PYX_ERR(52, 755, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_69getEqualityConstraints, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getEqualityConstraints, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1347])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getEqualityConstraints, __pyx_t_4) < (0)) __PYX_ERR(52, 755, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":770
 *         return (c, equality_constraints)
 * 
 *     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.
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 770, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 770, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 770, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_71setJacobianEquality, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setJacobianEquality, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1348])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setJacobianEquality, __pyx_t_5) < (0)) __PYX_ERR(52, 770, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":792
 *                                              TAO_JacobianEquality, <void*>context))
 * 
 *     def getJacobianEquality(self) -> tuple[Mat, Mat, tuple[TAOConstraintsJacobianFunction, tuple[Any, ...] | None,             # <<<<<<<<<<<<<<
 *                                            dict[str, Any] | None]]:
 *         """Return matrix, precon matrix and callback of equality constraints Jacobian.
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Mat_Mat_tuple_TAOConstrain) < (0)) __PYX_ERR(52, 792, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_73getJacobianEquality, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getJacobianEquality, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1349])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getJacobianEquality, __pyx_t_4) < (0)) __PYX_ERR(52, 792, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":810
 *         return (J, Jpre, jacobian_equality)
 * 
 *     def setInequalityConstraints(self, inequality_constraints, Vec c,             # <<<<<<<<<<<<<<
 *                                  args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:
 *         """Set inequality constraints callback.
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 810, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 810, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 810, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_75setInequalityConstraints, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setInequalityConstraints, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1350])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setInequalityConstraints, __pyx_t_5) < (0)) __PYX_ERR(52, 810, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":828
 *                                                   TAO_InequalityConstraints, <void*>context))
 * 
 *     def getInequalityConstraints(self) -> tuple[Vec, tuple[TAOConstraintsFunction, tuple[Any, ...] | None, dict[str, Any] | None]]:             # <<<<<<<<<<<<<<
 *         """Return tuple holding vector and callback of inequality constraints.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Vec_tuple_TAOConstraintsFu) < (0)) __PYX_ERR(52, 828, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_77getInequalityConstraints, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getInequalityConstraints, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1351])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getInequalityConstraints, __pyx_t_4) < (0)) __PYX_ERR(52, 828, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":843
 *         return (c, inequality_constraints)
 * 
 *     def setJacobianInequality(self, jacobian_inequality, Mat J=None, Mat P=None,             # <<<<<<<<<<<<<<
 *                               args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None:
 *         """Set Jacobian inequality constraints callback.
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 843, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 843, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 843, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_79setJacobianInequality, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setJacobianInequality, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1352])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setJacobianInequality, __pyx_t_5) < (0)) __PYX_ERR(52, 843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":865
 *                                                TAO_JacobianInequality, <void*>context))
 * 
 *     def getJacobianInequality(self) -> tuple[Mat, Mat, tuple[TAOConstraintsJacobianFunction, tuple[Any, ...] | None, dict[str, Any] | None]]:             # <<<<<<<<<<<<<<
 *         """Return matrix, precon matrix and callback of ineq. constraints Jacobian.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Mat_Mat_tuple_TAOConstrain) < (0)) __PYX_ERR(52, 865, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_81getJacobianInequality, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getJacobianInequality, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1353])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getJacobianInequality, __pyx_t_4) < (0)) __PYX_ERR(52, 865, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":882
 *         return (J, Jpre, jacobian_inequality)
 * 
 *     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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_update, __pyx_mstate_global->__pyx_n_u_TAOUpdateFunction) < (0)) __PYX_ERR(52, 882, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 882, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 882, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 882, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_83setUpdate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setUpdate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1354])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setUpdate, __pyx_t_5) < (0)) __PYX_ERR(52, 882, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":911
 *             CHKERR(TaoSetUpdate(self.tao, NULL, NULL))
 * 
 *     def getUpdate(self) -> tuple[TAOUpdateFunction, tuple[Any, ...], dict[str, Any]]:             # <<<<<<<<<<<<<<
 *         """Return the callback to compute the update.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_TAOUpdateFunction_tuple_An) < (0)) __PYX_ERR(52, 911, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_85getUpdate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getUpdate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1355])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getUpdate, __pyx_t_4) < (0)) __PYX_ERR(52, 911, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":925
 *     # --------------
 * 
 *     def computeObjective(self, Vec x) -> float:             # <<<<<<<<<<<<<<
 *         """Compute the value of the objective function.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(52, 925, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_87computeObjective, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_computeObjective, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1356])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_computeObjective, __pyx_t_5) < (0)) __PYX_ERR(52, 925, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":944
 *         return toReal(f)
 * 
 *     def computeResidual(self, Vec x, Vec f) -> None:             # <<<<<<<<<<<<<<
 *         """Compute the residual.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 944, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_89computeResidual, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_computeResidual, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1357])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_computeResidual, __pyx_t_4) < (0)) __PYX_ERR(52, 944, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":963
 *         CHKERR(TaoComputeResidual(self.tao, x.vec, f.vec))
 * 
 *     def computeGradient(self, Vec x, Vec g) -> None:             # <<<<<<<<<<<<<<
 *         """Compute the gradient of the objective function.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 963, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_91computeGradient, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_computeGradient, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1358])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_computeGradient, __pyx_t_5) < (0)) __PYX_ERR(52, 963, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":982
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(52, 982, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_93computeObjectiveGradient, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_computeObjectiveGradient, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1359])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_computeObjectiveGradient, __pyx_t_4) < (0)) __PYX_ERR(52, 982, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1004
 *         return toReal(f)
 * 
 *     def computeDualVariables(self, Vec xl, Vec xu) -> None:             # <<<<<<<<<<<<<<
 *         """Compute the dual vectors corresponding to variables' bounds.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1004, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_95computeDualVariables, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_computeDualVariables, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1360])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1004, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_computeDualVariables, __pyx_t_5) < (0)) __PYX_ERR(52, 1004, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1016
 *         CHKERR(TaoComputeDualVariables(self.tao, xl.vec, xu.vec))
 * 
 *     def computeVariableBounds(self, Vec xl, Vec xu) -> None:             # <<<<<<<<<<<<<<
 *         """Compute the vectors corresponding to variables' bounds.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1016, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_97computeVariableBounds, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_computeVariableBounds, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1361])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_computeVariableBounds, __pyx_t_4) < (0)) __PYX_ERR(52, 1016, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1040
 *                 CHKERR(VecSet(xu.vec, <PetscScalar>PETSC_INFINITY))
 * 
 *     def computeConstraints(self, Vec x, Vec c) -> None:             # <<<<<<<<<<<<<<
 *         """Compute the vector corresponding to the constraints.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1040, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_99computeConstraints, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_computeConstraints, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1362])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_computeConstraints, __pyx_t_5) < (0)) __PYX_ERR(52, 1040, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1059
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1059, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_101computeHessian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_computeHessian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1363])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_computeHessian, __pyx_t_4) < (0)) __PYX_ERR(52, 1059, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1082
 *         CHKERR(TaoComputeHessian(self.tao, x.vec, hmat, pmat))
 * 
 *     def computeJacobian(self, Vec x, Mat J, Mat P=None) -> None:             # <<<<<<<<<<<<<<
 *         """Compute the Jacobian.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1082, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_103computeJacobian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_computeJacobian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1364])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_computeJacobian, __pyx_t_5) < (0)) __PYX_ERR(52, 1082, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1107
 *     # --------------
 * 
 *     def setTolerances(self, gatol: float | None = None, grtol: float | None = None, gttol: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the tolerance parameters used in the solver convergence tests.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_gatol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(52, 1107, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_grtol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(52, 1107, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_gttol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(52, 1107, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1107, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_105setTolerances, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setTolerances, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1365])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setTolerances, __pyx_t_4) < (0)) __PYX_ERR(52, 1107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1140
 *         CHKERR(TaoSetTolerances(self.tao, _gatol, _grtol, _gttol))
 * 
 *     def getTolerances(self) -> tuple[float, float, float]:             # <<<<<<<<<<<<<<
 *         """Return the tolerance parameters used in the solver convergence tests.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_float_float) < (0)) __PYX_ERR(52, 1140, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_107getTolerances, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getTolerances, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1366])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getTolerances, __pyx_t_5) < (0)) __PYX_ERR(52, 1140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1164
 *         return (toReal(_gatol), toReal(_grtol), toReal(_gttol))
 * 
 *     def setMaximumIterations(self, mit: int) -> float:             # <<<<<<<<<<<<<<
 *         """Set the maximum number of solver iterations.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_mit, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(52, 1164, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(52, 1164, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_109setMaximumIterations, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setMaximumIterations, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1367])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setMaximumIterations, __pyx_t_4) < (0)) __PYX_ERR(52, 1164, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1177
 *         CHKERR(TaoSetMaximumIterations(self.tao, _mit))
 * 
 *     def getMaximumIterations(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the maximum number of solver iterations.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(52, 1177, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_111getMaximumIterations, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getMaximumIterations, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1368])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getMaximumIterations, __pyx_t_5) < (0)) __PYX_ERR(52, 1177, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1191
 *         return toInt(_mit)
 * 
 *     def setMaximumFunctionEvaluations(self, mit: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum number of objective evaluations within the solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_mit, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(52, 1191, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1191, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_113setMaximumFunctionEvaluations, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setMaximumFunctionEvaluation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1369])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setMaximumFunctionEvaluations, __pyx_t_4) < (0)) __PYX_ERR(52, 1191, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1204
 *         CHKERR(TaoSetMaximumFunctionEvaluations(self.tao, _mit))
 * 
 *     def getMaximumFunctionEvaluations(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the maximum number of objective evaluations within the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(52, 1204, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_115getMaximumFunctionEvaluations, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getMaximumFunctionEvaluation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1370])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getMaximumFunctionEvaluations, __pyx_t_5) < (0)) __PYX_ERR(52, 1204, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1218
 *         return toInt(_mit)
 * 
 *     def setConstraintTolerances(self, catol: float | None = None, crtol: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the constraints tolerance parameters used in the solver convergence tests.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_catol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(52, 1218, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_crtol, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(52, 1218, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1218, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_117setConstraintTolerances, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setConstraintTolerances, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1371])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setConstraintTolerances, __pyx_t_4) < (0)) __PYX_ERR(52, 1218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1244
 *         CHKERR(TaoSetConstraintTolerances(self.tao, _catol, _crtol))
 * 
 *     def getConstraintTolerances(self) -> tuple[float, float]:             # <<<<<<<<<<<<<<
 *         """Return the constraints tolerance parameters used in the convergence tests.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_float) < (0)) __PYX_ERR(52, 1244, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_119getConstraintTolerances, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getConstraintTolerances, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1372])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getConstraintTolerances, __pyx_t_5) < (0)) __PYX_ERR(52, 1244, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1265
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_converged, __pyx_mstate_global->__pyx_kp_u_TAOConvergedFunction_None) < (0)) __PYX_ERR(52, 1265, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 1265, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 1265, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1265, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_121setConvergenceTest, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setConvergenceTest, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1373])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setConvergenceTest, __pyx_t_4) < (0)) __PYX_ERR(52, 1265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1293
 *             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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_TAOConvergedFunction_tuple) < (0)) __PYX_ERR(52, 1293, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_123getConvergenceTest, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getConvergenceTest, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1374])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getConvergenceTest, __pyx_t_5) < (0)) __PYX_ERR(52, 1293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1305
 *         return self.get_attr('__converged__')
 * 
 *     def setConvergedReason(self, reason: ConvergedReason) -> None:             # <<<<<<<<<<<<<<
 *         """Set the termination flag.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_reason, __pyx_mstate_global->__pyx_n_u_ConvergedReason) < (0)) __PYX_ERR(52, 1305, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1305, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_125setConvergedReason, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setConvergedReason, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1375])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setConvergedReason, __pyx_t_4) < (0)) __PYX_ERR(52, 1305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1318
 *         CHKERR(TaoSetConvergedReason(self.tao, creason))
 * 
 *     def getConvergedReason(self) -> ConvergedReason:             # <<<<<<<<<<<<<<
 *         """Return the termination flag.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ConvergedReason) < (0)) __PYX_ERR(52, 1318, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_127getConvergedReason, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getConvergedReason, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1376])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getConvergedReason, __pyx_t_5) < (0)) __PYX_ERR(52, 1318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1332
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_monitor, __pyx_mstate_global->__pyx_n_u_TAOMonitorFunction) < (0)) __PYX_ERR(52, 1332, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 1332, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 1332, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1332, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_129setMonitor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setMonitor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1377])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setMonitor, __pyx_t_4) < (0)) __PYX_ERR(52, 1332, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1361
 *             monitorlist.append((monitor, args, kargs))
 * 
 *     def getMonitor(self) -> list[tuple[TAOMonitorFunction, tuple[Any, ...], dict[str, Any]]]:             # <<<<<<<<<<<<<<
 *         """Return the callback used to monitor solver convergence.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_tuple_TAOMonitorFunction_tu) < (0)) __PYX_ERR(52, 1361, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_131getMonitor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getMonitor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1378])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getMonitor, __pyx_t_5) < (0)) __PYX_ERR(52, 1361, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1373
 *         return self.get_attr('__monitor__')
 * 
 *     def cancelMonitor(self) -> None:             # <<<<<<<<<<<<<<
 *         """Cancel all the monitors of the solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1373, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_133cancelMonitor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_cancelMonitor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1379])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_cancelMonitor, __pyx_t_4) < (0)) __PYX_ERR(52, 1373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1387
 * 
 *     # Tao overwrites these statistics. Copy user defined only if present
 *     def monitor(self, its: int | None = None, f: float | None = None, res: float | None = None, cnorm: float | None = None, step: float | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Monitor the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_its, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(52, 1387, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_f, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(52, 1387, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_res, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(52, 1387, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_cnorm, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(52, 1387, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_step, __pyx_mstate_global->__pyx_kp_u_float_None) < (0)) __PYX_ERR(52, 1387, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1387, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_135monitor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_monitor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1380])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[30]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_monitor, __pyx_t_5) < (0)) __PYX_ERR(52, 1387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1438
 *     #
 * 
 *     def solve(self, Vec x=None) -> None:             # <<<<<<<<<<<<<<
 *         """Solve the optimization problem.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1438, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_137solve, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_solve, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1381])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_solve, __pyx_t_4) < (0)) __PYX_ERR(52, 1438, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1457
 *         CHKERR(TaoSolve(self.tao))
 * 
 *     def getSolution(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the vector holding the solution.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(52, 1457, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_139getSolution, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getSolution, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1382])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getSolution, __pyx_t_5) < (0)) __PYX_ERR(52, 1457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1472
 *         return vec
 * 
 *     def setGradientNorm(self, Mat mat) -> None:             # <<<<<<<<<<<<<<
 *         """Set the matrix used to compute inner products.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1472, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_141setGradientNorm, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setGradientNorm, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1383])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setGradientNorm, __pyx_t_4) < (0)) __PYX_ERR(52, 1472, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1484
 *         CHKERR(TaoSetGradientNorm(self.tao, mat.mat))
 * 
 *     def getGradientNorm(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the matrix used to compute inner products.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(52, 1484, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_143getGradientNorm, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getGradientNorm, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1384])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getGradientNorm, __pyx_t_5) < (0)) __PYX_ERR(52, 1484, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1499
 *         return mat
 * 
 *     def setLMVMH0(self, Mat mat) -> None:             # <<<<<<<<<<<<<<
 *         """Set the initial Hessian for the quasi-Newton approximation.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1499, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_145setLMVMH0, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setLMVMH0, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1385])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setLMVMH0, __pyx_t_4) < (0)) __PYX_ERR(52, 1499, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1511
 *         CHKERR(TaoLMVMSetH0(self.tao, mat.mat))
 * 
 *     def getLMVMH0(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the initial Hessian for the quasi-Newton approximation.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(52, 1511, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_147getLMVMH0, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getLMVMH0, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1386])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getLMVMH0, __pyx_t_5) < (0)) __PYX_ERR(52, 1511, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1526
 *         return mat
 * 
 *     def getLMVMH0KSP(self) -> KSP:             # <<<<<<<<<<<<<<
 *         """Return the `KSP` for the inverse of the initial Hessian approximation.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_KSP) < (0)) __PYX_ERR(52, 1526, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_149getLMVMH0KSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getLMVMH0KSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1387])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getLMVMH0KSP, __pyx_t_4) < (0)) __PYX_ERR(52, 1526, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1541
 *         return ksp
 * 
 *     def getVariableBounds(self) -> tuple[Vec, Vec]:             # <<<<<<<<<<<<<<
 *         """Return the lower and upper bounds vectors.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Vec_Vec) < (0)) __PYX_ERR(52, 1541, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_151getVariableBounds, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getVariableBounds, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1388])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getVariableBounds, __pyx_t_5) < (0)) __PYX_ERR(52, 1541, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1556
 *         return (xl, xu)
 * 
 *     def setBNCGType(self, cg_type: BNCGType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the BNCG solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_cg_type, __pyx_mstate_global->__pyx_n_u_BNCGType) < (0)) __PYX_ERR(52, 1556, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1556, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_153setBNCGType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setBNCGType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1389])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setBNCGType, __pyx_t_4) < (0)) __PYX_ERR(52, 1556, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1569
 *         CHKERR(TaoBNCGSetType(self.tao, ctype))
 * 
 *     def getBNCGType(self) -> BNCGType:             # <<<<<<<<<<<<<<
 *         """Return the type of the BNCG solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_BNCGType) < (0)) __PYX_ERR(52, 1569, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_155getBNCGType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getBNCGType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1390])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getBNCGType, __pyx_t_5) < (0)) __PYX_ERR(52, 1569, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1583
 *         return cg_type
 * 
 *     def setIterationNumber(self, its: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the current iteration number.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_its, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(52, 1583, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1583, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_157setIterationNumber, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setIterationNumber, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1391])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setIterationNumber, __pyx_t_4) < (0)) __PYX_ERR(52, 1583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1596
 *         CHKERR(TaoSetIterationNumber(self.tao, ival))
 * 
 *     def getIterationNumber(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the current iteration number.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(52, 1596, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_159getIterationNumber, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getIterationNumber, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1392])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getIterationNumber, __pyx_t_5) < (0)) __PYX_ERR(52, 1596, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1610
 *         return toInt(its)
 * 
 *     def getObjectiveValue(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the current value of the objective function.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(52, 1610, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_161getObjectiveValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getObjectiveValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1393])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getObjectiveValue, __pyx_t_4) < (0)) __PYX_ERR(52, 1610, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1624
 *         return toReal(fval)
 * 
 *     getFunctionValue = getObjectiveValue             # <<<<<<<<<<<<<<
 * 
 *     def getConvergedReason(self) -> ConvergedReason:
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getObjectiveValue); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getFunctionValue, __pyx_t_4) < (0)) __PYX_ERR(52, 1624, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1626
 *     getFunctionValue = getObjectiveValue
 * 
 *     def getConvergedReason(self) -> ConvergedReason:             # <<<<<<<<<<<<<<
 *         """Return the reason for the solver convergence.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ConvergedReason) < (0)) __PYX_ERR(52, 1626, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_163getConvergedReason, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getConvergedReason, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1394])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getConvergedReason, __pyx_t_5) < (0)) __PYX_ERR(52, 1626, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1640
 *         return reason
 * 
 *     def getSolutionNorm(self) -> tuple[float, float, float]:             # <<<<<<<<<<<<<<
 *         """Return the objective function value and the norms of gradient and constraints.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_float_float) < (0)) __PYX_ERR(52, 1640, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_165getSolutionNorm, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getSolutionNorm, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1395])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getSolutionNorm, __pyx_t_4) < (0)) __PYX_ERR(52, 1640, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1665
 *         return (toReal(fval), toReal(gnorm), toReal(cnorm))
 * 
 *     def getSolutionStatus(self) -> tuple[int, float, float, float, float, ConvergedReason]:             # <<<<<<<<<<<<<<
 *         """Return the solution status.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_float_float_float_floa) < (0)) __PYX_ERR(52, 1665, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_167getSolutionStatus, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getSolutionStatus, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1396])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getSolutionStatus, __pyx_t_5) < (0)) __PYX_ERR(52, 1665, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1700
 *                 toReal(xdiff), reason)
 * 
 *     def checkConverged(self) -> ConvergedReason:             # <<<<<<<<<<<<<<
 *         """Run convergence test and return converged reason.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ConvergedReason) < (0)) __PYX_ERR(52, 1700, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_169checkConverged, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_checkConverged, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1397])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_checkConverged, __pyx_t_4) < (0)) __PYX_ERR(52, 1700, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1714
 *         return reason
 * 
 *     def getKSP(self) -> KSP:             # <<<<<<<<<<<<<<
 *         """Return the linear solver used by the nonlinear solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_KSP) < (0)) __PYX_ERR(52, 1714, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_171getKSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getKSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1398])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getKSP, __pyx_t_5) < (0)) __PYX_ERR(52, 1714, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1731
 *     # TaoTerm related routines
 * 
 *     def getTerm(self) -> tuple[float, TAOTerm, Vec, Mat]:             # <<<<<<<<<<<<<<
 *         """Return the entire objective term of the solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_TAOTerm_Vec_Mat) < (0)) __PYX_ERR(52, 1731, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_173getTerm, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getTerm, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1399])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getTerm, __pyx_t_4) < (0)) __PYX_ERR(52, 1731, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1762
 *         return (toReal(_scale), term, params, mapmat)
 * 
 *     def addTerm(self, prefix: str | None, scale: float, term: TAOTerm, Vec params=None, Mat mapmat=None) -> None:             # <<<<<<<<<<<<<<
 *         """Add an objective term to the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(52, 1762, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_scale, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(52, 1762, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_term, __pyx_mstate_global->__pyx_n_u_TAOTerm) < (0)) __PYX_ERR(52, 1762, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1762, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_175addTerm, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_addTerm, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1400])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_addTerm, __pyx_t_5) < (0)) __PYX_ERR(52, 1762, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1797
 *     # ALMM routines
 * 
 *     def getALMMSubsolver(self) -> TAO:             # <<<<<<<<<<<<<<
 *         """Return the subsolver inside the ALMM solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_TAO) < (0)) __PYX_ERR(52, 1797, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_177getALMMSubsolver, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getALMMSubsolver, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1401])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getALMMSubsolver, __pyx_t_4) < (0)) __PYX_ERR(52, 1797, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1812
 *         return subsolver
 * 
 *     def getALMMType(self) -> ALMMType:             # <<<<<<<<<<<<<<
 *         """Return the type of the ALMM solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ALMMType) < (0)) __PYX_ERR(52, 1812, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_179getALMMType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getALMMType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1402])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getALMMType, __pyx_t_5) < (0)) __PYX_ERR(52, 1812, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1826
 *         return almm_type
 * 
 *     def setALMMSubsolver(self, subsolver: TAO) -> None:             # <<<<<<<<<<<<<<
 *         """Set the subsolver inside the ALMM solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_subsolver, __pyx_mstate_global->__pyx_n_u_TAO) < (0)) __PYX_ERR(52, 1826, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1826, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_181setALMMSubsolver, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setALMMSubsolver, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1403])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setALMMSubsolver, __pyx_t_4) < (0)) __PYX_ERR(52, 1826, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1839
 *         CHKERR(TaoALMMSetSubsolver(self.tao, ctype.tao))
 * 
 *     def setALMMType(self, tao_almm_type: ALMMType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the ALMM type of the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tao_almm_type, __pyx_mstate_global->__pyx_n_u_ALMMType) < (0)) __PYX_ERR(52, 1839, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1839, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_183setALMMType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setALMMType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1404])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setALMMType, __pyx_t_5) < (0)) __PYX_ERR(52, 1839, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1859
 *     # BRGN routines
 * 
 *     def getBRGNSubsolver(self) -> TAO:             # <<<<<<<<<<<<<<
 *         """Return the subsolver inside the BRGN solver.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_TAO) < (0)) __PYX_ERR(52, 1859, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_185getBRGNSubsolver, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getBRGNSubsolver, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1405])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getBRGNSubsolver, __pyx_t_4) < (0)) __PYX_ERR(52, 1859, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1874
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 1874, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 1874, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1874, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_187setBRGNRegularizerObjectiveGradient, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setBRGNRegularizerObjectiveG, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1406])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setBRGNRegularizerObjectiveGradi, __pyx_t_5) < (0)) __PYX_ERR(52, 1874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1890
 *         CHKERR(TaoBRGNSetRegularizerObjectiveAndGradientRoutine(self.tao, TAO_BRGNRegObjGrad, <void*>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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 1890, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 1890, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1890, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_189setBRGNRegularizerHessian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setBRGNRegularizerHessian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1407])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setBRGNRegularizerHessian, __pyx_t_4) < (0)) __PYX_ERR(52, 1890, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1908
 *         CHKERR(TaoBRGNSetRegularizerHessianRoutine(self.tao, Hmat, TAO_BRGNRegHessian, <void*>context))
 * 
 *     def setBRGNRegularizerWeight(self, weight: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the regularizer weight.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_weight, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(52, 1908, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1908, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_191setBRGNRegularizerWeight, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setBRGNRegularizerWeight, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1408])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setBRGNRegularizerWeight, __pyx_t_5) < (0)) __PYX_ERR(52, 1908, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1917
 *         CHKERR(TaoBRGNSetRegularizerWeight(self.tao, cweight))
 * 
 *     def setBRGNSmoothL1Epsilon(self, epsilon: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the smooth L1 epsilon.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_epsilon, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(52, 1917, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1917, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_193setBRGNSmoothL1Epsilon, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setBRGNSmoothL1Epsilon, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1409])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setBRGNSmoothL1Epsilon, __pyx_t_4) < (0)) __PYX_ERR(52, 1917, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1930
 *         CHKERR(TaoBRGNSetL1SmoothEpsilon(self.tao, ceps))
 * 
 *     def setBRGNDictionaryMatrix(self, Mat D) -> None:             # <<<<<<<<<<<<<<
 *         """Set the dictionary matrix.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1930, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_195setBRGNDictionaryMatrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setBRGNDictionaryMatrix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1410])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setBRGNDictionaryMatrix, __pyx_t_5) < (0)) __PYX_ERR(52, 1930, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1942
 *         CHKERR(TaoBRGNSetDictionaryMatrix(self.tao, D.mat))
 * 
 *     def getBRGNDampingVector(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the damping vector.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(52, 1942, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_197getBRGNDampingVector, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getBRGNDampingVector, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1411])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getBRGNDampingVector, __pyx_t_4) < (0)) __PYX_ERR(52, 1942, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1957
 *         return damp
 * 
 *     def createPython(self, context: Any = None, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an optimization solver of Python type.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_context, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(52, 1957, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(52, 1957, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(52, 1957, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_199createPython, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_createPython, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1412])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_createPython, __pyx_t_5) < (0)) __PYX_ERR(52, 1957, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1982
 *         return self
 * 
 *     def setPythonContext(self, context: Any) -> None:             # <<<<<<<<<<<<<<
 *         """Set the instance of the class implementing the required Python methods.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_context, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(52, 1982, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 1982, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_201setPythonContext, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setPythonContext, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1413])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setPythonContext, __pyx_t_4) < (0)) __PYX_ERR(52, 1982, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":1994
 *         CHKERR(TaoPythonSetContext(self.tao, <void*>context))
 * 
 *     def getPythonContext(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return the instance of the class implementing the required Python methods.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 1994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(52, 1994, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_203getPythonContext, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getPythonContext, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1414])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 1994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getPythonContext, __pyx_t_5) < (0)) __PYX_ERR(52, 1994, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2009
 *         else: return <object> context
 * 
 *     def setPythonType(self, py_type: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the fully qualified Python name of the class to be used.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_py_type, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(52, 2009, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 2009, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_205setPythonType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_setPythonType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1415])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setPythonType, __pyx_t_4) < (0)) __PYX_ERR(52, 2009, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2024
 *         CHKERR(TaoPythonSetType(self.tao, cval))
 * 
 *     def getPythonType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the fully qualified Python name of the class used by the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(52, 2024, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_207getPythonType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getPythonType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1416])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getPythonType, __pyx_t_5) < (0)) __PYX_ERR(52, 2024, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2039
 *         return bytes2str(cval)
 * 
 *     def getLineSearch(self) -> TAOLineSearch:             # <<<<<<<<<<<<<<
 *         """Return the TAO Line Search object.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_TAOLineSearch) < (0)) __PYX_ERR(52, 2039, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_3TAO_209getLineSearch, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAO_getLineSearch, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1417])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_getLineSearch, __pyx_t_4) < (0)) __PYX_ERR(52, 2039, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2056
 *     # --- backward compatibility ---
 * 
 *     setInitial = setSolution             # <<<<<<<<<<<<<<
 * 
 *     # --- application context ---
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setSolution); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAO, __pyx_mstate_global->__pyx_n_u_setInitial, __pyx_t_4) < (0)) __PYX_ERR(52, 2056, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2178
 * # --------------------------------------------------------------------
 * 
 * del TAOType             # <<<<<<<<<<<<<<
 * del TAOConvergedReason
 * del TAOBNCGType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TAOType) < (0)) __PYX_ERR(52, 2178, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2179
 * 
 * del TAOType
 * del TAOConvergedReason             # <<<<<<<<<<<<<<
 * del TAOBNCGType
 * del TAOALMMType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TAOConvergedReason) < (0)) __PYX_ERR(52, 2179, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2180
 * del TAOType
 * del TAOConvergedReason
 * del TAOBNCGType             # <<<<<<<<<<<<<<
 * del TAOALMMType
 * 
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TAOBNCGType) < (0)) __PYX_ERR(52, 2180, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2181
 * del TAOConvergedReason
 * del TAOBNCGType
 * del TAOALMMType             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TAOALMMType) < (0)) __PYX_ERR(52, 2181, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2186
 * 
 * 
 * class TAOLineSearchType:             # <<<<<<<<<<<<<<
 *     """TAO Line Search Types."""
 *     UNIT        = S_(TAOLINESEARCHUNIT)
*/
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_TAOLineSearchType, __pyx_mstate_global->__pyx_n_u_TAOLineSearchType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_TAO_Line_Search_Types); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "petsc4py/PETSc/TAO.pyx":2188
 * class TAOLineSearchType:
 *     """TAO Line Search Types."""
 *     UNIT        = S_(TAOLINESEARCHUNIT)             # <<<<<<<<<<<<<<
 *     ARMIJO      = S_(TAOLINESEARCHARMIJO)
 *     MORETHUENTE = S_(TAOLINESEARCHMT)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOLINESEARCHUNIT); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_UNIT, __pyx_t_5) < (0)) __PYX_ERR(52, 2188, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2189
 *     """TAO Line Search Types."""
 *     UNIT        = S_(TAOLINESEARCHUNIT)
 *     ARMIJO      = S_(TAOLINESEARCHARMIJO)             # <<<<<<<<<<<<<<
 *     MORETHUENTE = S_(TAOLINESEARCHMT)
 *     IPM         = S_(TAOLINESEARCHIPM)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOLINESEARCHARMIJO); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ARMIJO, __pyx_t_5) < (0)) __PYX_ERR(52, 2189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2190
 *     UNIT        = S_(TAOLINESEARCHUNIT)
 *     ARMIJO      = S_(TAOLINESEARCHARMIJO)
 *     MORETHUENTE = S_(TAOLINESEARCHMT)             # <<<<<<<<<<<<<<
 *     IPM         = S_(TAOLINESEARCHIPM)
 *     OWARMIJO    = S_(TAOLINESEARCHOWARMIJO)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOLINESEARCHMT); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_MORETHUENTE, __pyx_t_5) < (0)) __PYX_ERR(52, 2190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2191
 *     ARMIJO      = S_(TAOLINESEARCHARMIJO)
 *     MORETHUENTE = S_(TAOLINESEARCHMT)
 *     IPM         = S_(TAOLINESEARCHIPM)             # <<<<<<<<<<<<<<
 *     OWARMIJO    = S_(TAOLINESEARCHOWARMIJO)
 *     GPCG        = S_(TAOLINESEARCHGPCG)
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOLINESEARCHIPM); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_IPM, __pyx_t_5) < (0)) __PYX_ERR(52, 2191, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2192
 *     MORETHUENTE = S_(TAOLINESEARCHMT)
 *     IPM         = S_(TAOLINESEARCHIPM)
 *     OWARMIJO    = S_(TAOLINESEARCHOWARMIJO)             # <<<<<<<<<<<<<<
 *     GPCG        = S_(TAOLINESEARCHGPCG)
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOLINESEARCHOWARMIJO); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_OWARMIJO, __pyx_t_5) < (0)) __PYX_ERR(52, 2192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2193
 *     IPM         = S_(TAOLINESEARCHIPM)
 *     OWARMIJO    = S_(TAOLINESEARCHOWARMIJO)
 *     GPCG        = S_(TAOLINESEARCHGPCG)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_5 = __pyx_f_8petsc4py_5PETSc_S_(TAOLINESEARCHGPCG); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_GPCG, __pyx_t_5) < (0)) __PYX_ERR(52, 2193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2186
 * 
 * 
 * class TAOLineSearchType:             # <<<<<<<<<<<<<<
 *     """TAO Line Search Types."""
 *     UNIT        = S_(TAOLINESEARCHUNIT)
*/
  __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_TAOLineSearchType, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TAOLineSearchType, __pyx_t_5) < (0)) __PYX_ERR(52, 2186, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2196
 * 
 * 
 * class TAOLineSearchConvergedReason:             # <<<<<<<<<<<<<<
 *     """TAO Line Search Termination Reasons."""
 *     # iterating
*/
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_TAOLineSearchConvergedReason, __pyx_mstate_global->__pyx_n_u_TAOLineSearchConvergedReason, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_TAO_Line_Search_Termination_Reas); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "petsc4py/PETSc/TAO.pyx":2199
 *     """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_5 = __Pyx_PyLong_From_TaoLineSearchConvergedReason(TAOLINESEARCH_CONTINUE_ITERATING); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_CONTINUE_SEARCH, __pyx_t_5) < (0)) __PYX_ERR(52, 2199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2201
 *     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_5 = __Pyx_PyLong_From_TaoLineSearchConvergedReason(TAOLINESEARCH_FAILED_INFORNAN); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FAILED_INFORNAN, __pyx_t_5) < (0)) __PYX_ERR(52, 2201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2202
 *     # 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_5 = __Pyx_PyLong_From_TaoLineSearchConvergedReason(TAOLINESEARCH_FAILED_BADPARAMETER); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FAILED_BADPARAMETER, __pyx_t_5) < (0)) __PYX_ERR(52, 2202, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2203
 *     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_5 = __Pyx_PyLong_From_TaoLineSearchConvergedReason(TAOLINESEARCH_FAILED_ASCENT); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FAILED_ASCENT, __pyx_t_5) < (0)) __PYX_ERR(52, 2203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2205
 *     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_5 = __Pyx_PyLong_From_TaoLineSearchConvergedReason(TAOLINESEARCH_SUCCESS); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SUCCESS, __pyx_t_5) < (0)) __PYX_ERR(52, 2205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2206
 *     # 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_5 = __Pyx_PyLong_From_TaoLineSearchConvergedReason(TAOLINESEARCH_SUCCESS_USER); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SUCCESS_USER, __pyx_t_5) < (0)) __PYX_ERR(52, 2206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2208
 *     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_5 = __Pyx_PyLong_From_TaoLineSearchConvergedReason(TAOLINESEARCH_HALTED_OTHER); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_HALTED_OTHER, __pyx_t_5) < (0)) __PYX_ERR(52, 2208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2209
 *     # 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_5 = __Pyx_PyLong_From_TaoLineSearchConvergedReason(TAOLINESEARCH_HALTED_MAXFCN); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_HALTED_MAXFCN, __pyx_t_5) < (0)) __PYX_ERR(52, 2209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2210
 *     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_5 = __Pyx_PyLong_From_TaoLineSearchConvergedReason(TAOLINESEARCH_HALTED_UPPERBOUND); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_HALTED_UPPERBOUND, __pyx_t_5) < (0)) __PYX_ERR(52, 2210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2211
 *     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_5 = __Pyx_PyLong_From_TaoLineSearchConvergedReason(TAOLINESEARCH_HALTED_LOWERBOUND); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_HALTED_LOWERBOUND, __pyx_t_5) < (0)) __PYX_ERR(52, 2211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2212
 *     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_5 = __Pyx_PyLong_From_TaoLineSearchConvergedReason(TAOLINESEARCH_HALTED_RTOL); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_HALTED_RTOL, __pyx_t_5) < (0)) __PYX_ERR(52, 2212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2213
 *     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_5 = __Pyx_PyLong_From_TaoLineSearchConvergedReason(TAOLINESEARCH_HALTED_USER); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_HALTED_USER, __pyx_t_5) < (0)) __PYX_ERR(52, 2213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2196
 * 
 * 
 * class TAOLineSearchConvergedReason:             # <<<<<<<<<<<<<<
 *     """TAO Line Search Termination Reasons."""
 *     # iterating
*/
  __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_TAOLineSearchConvergedReason, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TAOLineSearchConvergedReason, __pyx_t_5) < (0)) __PYX_ERR(52, 2196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2221
 *     """TAO Line Search."""
 * 
 *     Type   = TAOLineSearchType             # <<<<<<<<<<<<<<
 *     ConvergedReason = TAOLineSearchConvergedReason
 *     # FIXME backward compatibility
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TAOLineSearchType); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_4) < (0)) __PYX_ERR(52, 2221, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2222
 * 
 *     Type   = TAOLineSearchType
 *     ConvergedReason = TAOLineSearchConvergedReason             # <<<<<<<<<<<<<<
 *     # FIXME backward compatibility
 *     Reason = TAOLineSearchConvergedReason
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TAOLineSearchConvergedReason); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_ConvergedReason, __pyx_t_4) < (0)) __PYX_ERR(52, 2222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2224
 *     ConvergedReason = TAOLineSearchConvergedReason
 *     # FIXME backward compatibility
 *     Reason = TAOLineSearchConvergedReason             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_TAOLineSearchConvergedReason); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_Reason, __pyx_t_4) < (0)) __PYX_ERR(52, 2224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2230
 *         self.taols = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the linesearch object.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 2230, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_3view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOLineSearch_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1418])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_5) < (0)) __PYX_ERR(52, 2230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2249
 *         CHKERR(TaoLineSearchView(self.taols, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the linesearch object.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(52, 2249, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOLineSearch_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1419])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_4) < (0)) __PYX_ERR(52, 2249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2262
 *         return self
 * 
 *     def create(self, comm=None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a TAO linesearch.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(52, 2262, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_7create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOLineSearch_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1420])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_5) < (0)) __PYX_ERR(52, 2262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2283
 *         return self
 * 
 *     def setType(self, ls_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the linesearch.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ls_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(52, 2283, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 2283, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_9setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOLineSearch_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1421])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_4) < (0)) __PYX_ERR(52, 2283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2302
 *         CHKERR(TaoLineSearchSetType(self.taols, ctype))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the linesearch.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(52, 2302, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_11getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOLineSearch_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1422])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_5) < (0)) __PYX_ERR(52, 2302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2316
 *         return bytes2str(ctype)
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the linesearch from the options database.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 2316, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_13setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOLineSearch_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1423])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_4) < (0)) __PYX_ERR(52, 2316, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2328
 *         CHKERR(TaoLineSearchSetFromOptions(self.taols))
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the linesearch.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 2328, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_15setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOLineSearch_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1424])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_5) < (0)) __PYX_ERR(52, 2328, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2340
 *         CHKERR(TaoLineSearchSetUp(self.taols))
 * 
 *     def setOptionsPrefix(self, prefix: str | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(52, 2340, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 2340, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_17setOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOLineSearch_setOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1425])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_setOptionsPrefix, __pyx_t_4) < (0)) __PYX_ERR(52, 2340, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2354
 *         CHKERR(TaoLineSearchSetOptionsPrefix(self.taols, cprefix))
 * 
 *     def getOptionsPrefix(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(52, 2354, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_19getOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOLineSearch_getOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1426])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_getOptionsPrefix, __pyx_t_5) < (0)) __PYX_ERR(52, 2354, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2368
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_objective, __pyx_mstate_global->__pyx_n_u_TAOLSObjectiveFunction) < (0)) __PYX_ERR(52, 2368, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 2368, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 2368, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 2368, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_21setObjective, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOLineSearch_setObjective, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1427])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_setObjective, __pyx_t_4) < (0)) __PYX_ERR(52, 2368, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2393
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_gradient, __pyx_mstate_global->__pyx_n_u_TAOLSGradientFunction) < (0)) __PYX_ERR(52, 2393, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 2393, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 2393, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 2393, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_23setGradient, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOLineSearch_setGradient, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1428])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_setGradient, __pyx_t_5) < (0)) __PYX_ERR(52, 2393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2420
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_objgrad, __pyx_mstate_global->__pyx_n_u_TAOLSObjectiveGradientFunction) < (0)) __PYX_ERR(52, 2420, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(52, 2420, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(52, 2420, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 2420, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_25setObjectiveGradient, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOLineSearch_setObjectiveGradie, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1429])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_setObjectiveGradient, __pyx_t_4) < (0)) __PYX_ERR(52, 2420, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2447
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 2447, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_27useTAORoutine, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOLineSearch_useTAORoutine, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1430])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_useTAORoutine, __pyx_t_5) < (0)) __PYX_ERR(52, 2447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2459
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_float_str) < (0)) __PYX_ERR(52, 2459, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_29apply, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOLineSearch_apply, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1431])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_apply, __pyx_t_4) < (0)) __PYX_ERR(52, 2459, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2475
 *         return (toReal(f), toReal(steplen), reason)
 * 
 *     def setInitialStepLength(self, s: float) -> None:             # <<<<<<<<<<<<<<
 *         """Sets the initial step length of a line search.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_s_2, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(52, 2475, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 2475, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13TAOLineSearch_31setInitialStepLength, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOLineSearch_setInitialStepLeng, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1432])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2475, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOLineSearch, __pyx_mstate_global->__pyx_n_u_setInitialStepLength, __pyx_t_5) < (0)) __PYX_ERR(52, 2475, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2490
 * # --------------------------------------------------------------------
 * 
 * del TAOLineSearchType             # <<<<<<<<<<<<<<
 * del TAOLineSearchConvergedReason
 * 
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TAOLineSearchType) < (0)) __PYX_ERR(52, 2490, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2491
 * 
 * del TAOLineSearchType
 * del TAOLineSearchConvergedReason             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TAOLineSearchConvergedReason) < (0)) __PYX_ERR(52, 2491, __pyx_L1_error)

  /* "petsc4py/PETSc/TAO.pyx":2497
 * 
 * 
 * class TAOTermType:             # <<<<<<<<<<<<<<
 *     """TAO Term Types."""
 *     SHELL         = S_(TAOTERMSHELL)
*/
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_mstate_global->__pyx_empty_tuple, __pyx_mstate_global->__pyx_n_u_TAOTermType, __pyx_mstate_global->__pyx_n_u_TAOTermType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_TAO_Term_Types); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "petsc4py/PETSc/TAO.pyx":2499
 * class TAOTermType:
 *     """TAO Term Types."""
 *     SHELL         = S_(TAOTERMSHELL)             # <<<<<<<<<<<<<<
 *     CALLBACKS     = S_(TAOTERMCALLBACKS)
 *     SUM           = S_(TAOTERMSUM)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(TAOTERMSHELL); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SHELL, __pyx_t_4) < (0)) __PYX_ERR(52, 2499, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2500
 *     """TAO Term Types."""
 *     SHELL         = S_(TAOTERMSHELL)
 *     CALLBACKS     = S_(TAOTERMCALLBACKS)             # <<<<<<<<<<<<<<
 *     SUM           = S_(TAOTERMSUM)
 *     HALFL2SQUARED = S_(TAOTERMHALFL2SQUARED)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(TAOTERMCALLBACKS); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CALLBACKS, __pyx_t_4) < (0)) __PYX_ERR(52, 2500, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2501
 *     SHELL         = S_(TAOTERMSHELL)
 *     CALLBACKS     = S_(TAOTERMCALLBACKS)
 *     SUM           = S_(TAOTERMSUM)             # <<<<<<<<<<<<<<
 *     HALFL2SQUARED = S_(TAOTERMHALFL2SQUARED)
 *     L1            = S_(TAOTERML1)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(TAOTERMSUM); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SUM, __pyx_t_4) < (0)) __PYX_ERR(52, 2501, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2502
 *     CALLBACKS     = S_(TAOTERMCALLBACKS)
 *     SUM           = S_(TAOTERMSUM)
 *     HALFL2SQUARED = S_(TAOTERMHALFL2SQUARED)             # <<<<<<<<<<<<<<
 *     L1            = S_(TAOTERML1)
 *     QUADRATIC     = S_(TAOTERMQUADRATIC)
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(TAOTERMHALFL2SQUARED); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_HALFL2SQUARED, __pyx_t_4) < (0)) __PYX_ERR(52, 2502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2503
 *     SUM           = S_(TAOTERMSUM)
 *     HALFL2SQUARED = S_(TAOTERMHALFL2SQUARED)
 *     L1            = S_(TAOTERML1)             # <<<<<<<<<<<<<<
 *     QUADRATIC     = S_(TAOTERMQUADRATIC)
 * 
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(TAOTERML1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_L1, __pyx_t_4) < (0)) __PYX_ERR(52, 2503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2504
 *     HALFL2SQUARED = S_(TAOTERMHALFL2SQUARED)
 *     L1            = S_(TAOTERML1)
 *     QUADRATIC     = S_(TAOTERMQUADRATIC)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_4 = __pyx_f_8petsc4py_5PETSc_S_(TAOTERMQUADRATIC); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_QUADRATIC, __pyx_t_4) < (0)) __PYX_ERR(52, 2504, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2497
 * 
 * 
 * class TAOTermType:             # <<<<<<<<<<<<<<
 *     """TAO Term Types."""
 *     SHELL         = S_(TAOTERMSHELL)
*/
  __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_mstate_global->__pyx_n_u_TAOTermType, __pyx_mstate_global->__pyx_empty_tuple, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2497, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_TAOTermType, __pyx_t_4) < (0)) __PYX_ERR(52, 2497, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2512
 *     """TAO Term."""
 * 
 *     Type   = TAOTermType             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_TAOTermType); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOTerm, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_5) < (0)) __PYX_ERR(52, 2512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2518
 *         self.taoterm = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the term object.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 2518, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7TAOTerm_3view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOTerm_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1433])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOTerm, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_4) < (0)) __PYX_ERR(52, 2518, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2537
 *         CHKERR(TaoTermView(self.taoterm, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the term object.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(52, 2537, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7TAOTerm_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOTerm_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1434])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOTerm, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_5) < (0)) __PYX_ERR(52, 2537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2550
 *         return self
 * 
 *     def create(self, comm=None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a TAO Term.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(52, 2550, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7TAOTerm_7create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOTerm_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1435])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOTerm, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_4) < (0)) __PYX_ERR(52, 2550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2571
 *         return self
 * 
 *     def setType(self, term_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the term.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_term_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(52, 2571, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 2571, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7TAOTerm_9setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOTerm_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1436])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOTerm, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_5) < (0)) __PYX_ERR(52, 2571, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2590
 *         CHKERR(TaoTermSetType(self.taoterm, ctype))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the term.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(52, 2590, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7TAOTerm_11getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOTerm_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1437])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOTerm, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_4) < (0)) __PYX_ERR(52, 2590, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2604
 *         return bytes2str(ctype)
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the term from the options database.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 2604, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7TAOTerm_13setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOTerm_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1438])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOTerm, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_5) < (0)) __PYX_ERR(52, 2604, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2616
 *         CHKERR(TaoTermSetFromOptions(self.taoterm))
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the term.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 2616, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7TAOTerm_15setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOTerm_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1439])); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOTerm, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_4) < (0)) __PYX_ERR(52, 2616, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2628
 *         CHKERR(TaoTermSetUp(self.taoterm))
 * 
 *     def setSolutionTemplate(self, Vec x) -> None:             # <<<<<<<<<<<<<<
 *         """Set the solution vector template.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(52, 2628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(52, 2628, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7TAOTerm_17setSolutionTemplate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_TAOTerm_setSolutionTemplate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1440])); if (unlikely(!__pyx_t_5)) __PYX_ERR(52, 2628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_TAOTerm, __pyx_mstate_global->__pyx_n_u_setSolutionTemplate, __pyx_t_5) < (0)) __PYX_ERR(52, 2628, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/TAO.pyx":2643
 * # --------------------------------------------------------------------
 * 
 * del TAOTermType             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_TAOTermType) < (0)) __PYX_ERR(52, 2643, __pyx_L1_error)

  /* "petsc4py/PETSc/AO.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class AOType(object):             # <<<<<<<<<<<<<<
 *     """The application ordering types."""
 *     BASIC          = S_(AOBASIC)
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[158]); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_AOType, __pyx_mstate_global->__pyx_n_u_AOType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_application_ordering_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(53, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[158]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[158]) < 0))) __PYX_ERR(53, 3, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/AO.pyx":5
 * class AOType(object):
 *     """The application ordering types."""
 *     BASIC          = S_(AOBASIC)             # <<<<<<<<<<<<<<
 *     ADVANCED       = S_(AOADVANCED)
 *     MAPPING        = S_(AOMAPPING)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(AOBASIC); if (unlikely(!__pyx_t_14)) __PYX_ERR(53, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BASIC, __pyx_t_14) < (0)) __PYX_ERR(53, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/AO.pyx":6
 *     """The application ordering types."""
 *     BASIC          = S_(AOBASIC)
 *     ADVANCED       = S_(AOADVANCED)             # <<<<<<<<<<<<<<
 *     MAPPING        = S_(AOMAPPING)
 *     MEMORYSCALABLE = S_(AOMEMORYSCALABLE)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(AOADVANCED); if (unlikely(!__pyx_t_14)) __PYX_ERR(53, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ADVANCED, __pyx_t_14) < (0)) __PYX_ERR(53, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/AO.pyx":7
 *     BASIC          = S_(AOBASIC)
 *     ADVANCED       = S_(AOADVANCED)
 *     MAPPING        = S_(AOMAPPING)             # <<<<<<<<<<<<<<
 *     MEMORYSCALABLE = S_(AOMEMORYSCALABLE)
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(AOMAPPING); if (unlikely(!__pyx_t_14)) __PYX_ERR(53, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MAPPING, __pyx_t_14) < (0)) __PYX_ERR(53, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/AO.pyx":8
 *     ADVANCED       = S_(AOADVANCED)
 *     MAPPING        = S_(AOMAPPING)
 *     MEMORYSCALABLE = S_(AOMEMORYSCALABLE)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(AOMEMORYSCALABLE); if (unlikely(!__pyx_t_14)) __PYX_ERR(53, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MEMORYSCALABLE, __pyx_t_14) < (0)) __PYX_ERR(53, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/AO.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class AOType(object):             # <<<<<<<<<<<<<<
 *     """The application ordering types."""
 *     BASIC          = S_(AOBASIC)
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_AOType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(53, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_AOType, __pyx_t_14) < (0)) __PYX_ERR(53, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/AO.pyx":15
 * cdef class AO(Object):
 *     """Application ordering object."""
 *     Type = AOType             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_AOType); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_AO, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_5) < (0)) __PYX_ERR(53, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/AO.pyx":21
 *         self.ao = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """Display the application ordering.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(53, 21, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2AO_3view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AO_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1441])); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_AO, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_4) < (0)) __PYX_ERR(53, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/AO.pyx":40
 *         CHKERR(AOView(self.ao, cviewer))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the application ordering.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(53, 40, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2AO_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AO_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1442])); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_AO, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_5) < (0)) __PYX_ERR(53, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/AO.pyx":53
 *         return self
 * 
 *     def createBasic(             # <<<<<<<<<<<<<<
 *         self,
 *         app: Sequence[int] | IS,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_app, __pyx_mstate_global->__pyx_kp_u_Sequence_int_IS) < (0)) __PYX_ERR(53, 53, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_petsc, __pyx_mstate_global->__pyx_kp_u_Sequence_int_IS_None) < (0)) __PYX_ERR(53, 53, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(53, 53, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(53, 53, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2AO_7createBasic, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AO_createBasic, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1443])); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_AO, __pyx_mstate_global->__pyx_n_u_createBasic, __pyx_t_4) < (0)) __PYX_ERR(53, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/AO.pyx":102
 *         return self
 * 
 *     def createMemoryScalable(             # <<<<<<<<<<<<<<
 *         self,
 *         app: Sequence[int] | IS,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_app, __pyx_mstate_global->__pyx_kp_u_Sequence_int_IS) < (0)) __PYX_ERR(53, 102, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_petsc, __pyx_mstate_global->__pyx_kp_u_Sequence_int_IS_None) < (0)) __PYX_ERR(53, 102, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(53, 102, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(53, 102, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2AO_9createMemoryScalable, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AO_createMemoryScalable, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1444])); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_AO, __pyx_mstate_global->__pyx_n_u_createMemoryScalable, __pyx_t_5) < (0)) __PYX_ERR(53, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/AO.pyx":154
 *         return self
 * 
 *     def createMapping(             # <<<<<<<<<<<<<<
 *         self,
 *         app: Sequence[int] | IS,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_app, __pyx_mstate_global->__pyx_kp_u_Sequence_int_IS) < (0)) __PYX_ERR(53, 154, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_petsc, __pyx_mstate_global->__pyx_kp_u_Sequence_int_IS_None) < (0)) __PYX_ERR(53, 154, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(53, 154, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(53, 154, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2AO_11createMapping, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AO_createMapping, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1445])); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_AO, __pyx_mstate_global->__pyx_n_u_createMapping, __pyx_t_4) < (0)) __PYX_ERR(53, 154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/AO.pyx":200
 *         return self
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the application ordering type.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(53, 200, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2AO_13getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AO_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1446])); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_AO, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_5) < (0)) __PYX_ERR(53, 200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/AO.pyx":214
 *         return bytes2str(cval)
 * 
 *     def app2petsc(self, indices: Sequence[int] | IS) -> Sequence[int] | IS:             # <<<<<<<<<<<<<<
 *         """Map an application-defined ordering to the PETSc ordering.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int_IS) < (0)) __PYX_ERR(53, 214, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Sequence_int_IS) < (0)) __PYX_ERR(53, 214, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2AO_15app2petsc, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AO_app2petsc, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1447])); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_AO, __pyx_mstate_global->__pyx_n_u_app2petsc, __pyx_t_4) < (0)) __PYX_ERR(53, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/AO.pyx":248
 *         return indices
 * 
 *     def petsc2app(self, indices: Sequence[int] | IS) -> Sequence[int] | IS:             # <<<<<<<<<<<<<<
 *         """Map a PETSc ordering to the application-defined ordering.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(53, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_indices, __pyx_mstate_global->__pyx_kp_u_Sequence_int_IS) < (0)) __PYX_ERR(53, 248, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Sequence_int_IS) < (0)) __PYX_ERR(53, 248, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2AO_17petsc2app, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AO_petsc2app, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1448])); if (unlikely(!__pyx_t_5)) __PYX_ERR(53, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_AO, __pyx_mstate_global->__pyx_n_u_petsc2app, __pyx_t_5) < (0)) __PYX_ERR(53, 248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/AO.pyx":284
 * # --------------------------------------------------------------------
 * 
 * del AOType             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_AOType) < (0)) __PYX_ERR(53, 284, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class DMType(object):             # <<<<<<<<<<<<<<
 *     """`DM` types."""
 *     DA        = S_(DMDA_type)
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[160]); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMType, __pyx_mstate_global->__pyx_n_u_DMType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_DM_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(54, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[160]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[160]) < 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_14 = __pyx_f_8petsc4py_5PETSc_S_(DMDA); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DA, __pyx_t_14) < (0)) __PYX_ERR(54, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":6
 *     """`DM` types."""
 *     DA        = S_(DMDA_type)
 *     COMPOSITE = S_(DMCOMPOSITE)             # <<<<<<<<<<<<<<
 *     SLICED    = S_(DMSLICED)
 *     SHELL     = S_(DMSHELL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMCOMPOSITE); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_COMPOSITE, __pyx_t_14) < (0)) __PYX_ERR(54, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":7
 *     DA        = S_(DMDA_type)
 *     COMPOSITE = S_(DMCOMPOSITE)
 *     SLICED    = S_(DMSLICED)             # <<<<<<<<<<<<<<
 *     SHELL     = S_(DMSHELL)
 *     PLEX      = S_(DMPLEX)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMSLICED); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SLICED, __pyx_t_14) < (0)) __PYX_ERR(54, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":8
 *     COMPOSITE = S_(DMCOMPOSITE)
 *     SLICED    = S_(DMSLICED)
 *     SHELL     = S_(DMSHELL)             # <<<<<<<<<<<<<<
 *     PLEX      = S_(DMPLEX)
 *     REDUNDANT = S_(DMREDUNDANT)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMSHELL); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SHELL, __pyx_t_14) < (0)) __PYX_ERR(54, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":9
 *     SLICED    = S_(DMSLICED)
 *     SHELL     = S_(DMSHELL)
 *     PLEX      = S_(DMPLEX)             # <<<<<<<<<<<<<<
 *     REDUNDANT = S_(DMREDUNDANT)
 *     PATCH     = S_(DMPATCH)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEX); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PLEX, __pyx_t_14) < (0)) __PYX_ERR(54, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":10
 *     SHELL     = S_(DMSHELL)
 *     PLEX      = S_(DMPLEX)
 *     REDUNDANT = S_(DMREDUNDANT)             # <<<<<<<<<<<<<<
 *     PATCH     = S_(DMPATCH)
 *     MOAB      = S_(DMMOAB)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMREDUNDANT); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_REDUNDANT, __pyx_t_14) < (0)) __PYX_ERR(54, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":11
 *     PLEX      = S_(DMPLEX)
 *     REDUNDANT = S_(DMREDUNDANT)
 *     PATCH     = S_(DMPATCH)             # <<<<<<<<<<<<<<
 *     MOAB      = S_(DMMOAB)
 *     NETWORK   = S_(DMNETWORK)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMPATCH); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PATCH, __pyx_t_14) < (0)) __PYX_ERR(54, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":12
 *     REDUNDANT = S_(DMREDUNDANT)
 *     PATCH     = S_(DMPATCH)
 *     MOAB      = S_(DMMOAB)             # <<<<<<<<<<<<<<
 *     NETWORK   = S_(DMNETWORK)
 *     FOREST    = S_(DMFOREST)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMMOAB); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MOAB, __pyx_t_14) < (0)) __PYX_ERR(54, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":13
 *     PATCH     = S_(DMPATCH)
 *     MOAB      = S_(DMMOAB)
 *     NETWORK   = S_(DMNETWORK)             # <<<<<<<<<<<<<<
 *     FOREST    = S_(DMFOREST)
 *     P4EST     = S_(DMP4EST)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMNETWORK); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NETWORK, __pyx_t_14) < (0)) __PYX_ERR(54, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":14
 *     MOAB      = S_(DMMOAB)
 *     NETWORK   = S_(DMNETWORK)
 *     FOREST    = S_(DMFOREST)             # <<<<<<<<<<<<<<
 *     P4EST     = S_(DMP4EST)
 *     P8EST     = S_(DMP8EST)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMFOREST); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FOREST, __pyx_t_14) < (0)) __PYX_ERR(54, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":15
 *     NETWORK   = S_(DMNETWORK)
 *     FOREST    = S_(DMFOREST)
 *     P4EST     = S_(DMP4EST)             # <<<<<<<<<<<<<<
 *     P8EST     = S_(DMP8EST)
 *     SWARM     = S_(DMSWARM)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMP4EST); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_P4EST, __pyx_t_14) < (0)) __PYX_ERR(54, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":16
 *     FOREST    = S_(DMFOREST)
 *     P4EST     = S_(DMP4EST)
 *     P8EST     = S_(DMP8EST)             # <<<<<<<<<<<<<<
 *     SWARM     = S_(DMSWARM)
 *     PRODUCT   = S_(DMPRODUCT)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMP8EST); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_P8EST, __pyx_t_14) < (0)) __PYX_ERR(54, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":17
 *     P4EST     = S_(DMP4EST)
 *     P8EST     = S_(DMP8EST)
 *     SWARM     = S_(DMSWARM)             # <<<<<<<<<<<<<<
 *     PRODUCT   = S_(DMPRODUCT)
 *     STAG      = S_(DMSTAG)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMSWARM); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SWARM, __pyx_t_14) < (0)) __PYX_ERR(54, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":18
 *     P8EST     = S_(DMP8EST)
 *     SWARM     = S_(DMSWARM)
 *     PRODUCT   = S_(DMPRODUCT)             # <<<<<<<<<<<<<<
 *     STAG      = S_(DMSTAG)
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMPRODUCT); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PRODUCT, __pyx_t_14) < (0)) __PYX_ERR(54, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":19
 *     SWARM     = S_(DMSWARM)
 *     PRODUCT   = S_(DMPRODUCT)
 *     STAG      = S_(DMSTAG)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMSTAG); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_STAG, __pyx_t_14) < (0)) __PYX_ERR(54, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class DMType(object):             # <<<<<<<<<<<<<<
 *     """`DM` types."""
 *     DA        = S_(DMDA_type)
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DMType, __pyx_t_14) < (0)) __PYX_ERR(54, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":22
 * 
 * 
 * class DMBoundaryType(object):             # <<<<<<<<<<<<<<
 *     """`DM` Boundary types."""
 *     NONE     = DM_BOUNDARY_NONE
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[162]); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMBoundaryType, __pyx_mstate_global->__pyx_n_u_DMBoundaryType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_DM_Boundary_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(54, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[162]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[162]) < 0))) __PYX_ERR(54, 22, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DM.pyx":24
 * class DMBoundaryType(object):
 *     """`DM` Boundary types."""
 *     NONE     = DM_BOUNDARY_NONE             # <<<<<<<<<<<<<<
 *     GHOSTED  = DM_BOUNDARY_GHOSTED
 *     MIRROR   = DM_BOUNDARY_MIRROR
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMBoundaryType(DM_BOUNDARY_NONE); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NONE, __pyx_t_14) < (0)) __PYX_ERR(54, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":25
 *     """`DM` Boundary types."""
 *     NONE     = DM_BOUNDARY_NONE
 *     GHOSTED  = DM_BOUNDARY_GHOSTED             # <<<<<<<<<<<<<<
 *     MIRROR   = DM_BOUNDARY_MIRROR
 *     PERIODIC = DM_BOUNDARY_PERIODIC
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMBoundaryType(DM_BOUNDARY_GHOSTED); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_GHOSTED, __pyx_t_14) < (0)) __PYX_ERR(54, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":26
 *     NONE     = DM_BOUNDARY_NONE
 *     GHOSTED  = DM_BOUNDARY_GHOSTED
 *     MIRROR   = DM_BOUNDARY_MIRROR             # <<<<<<<<<<<<<<
 *     PERIODIC = DM_BOUNDARY_PERIODIC
 *     TWIST    = DM_BOUNDARY_TWIST
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMBoundaryType(DM_BOUNDARY_MIRROR); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MIRROR, __pyx_t_14) < (0)) __PYX_ERR(54, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":27
 *     GHOSTED  = DM_BOUNDARY_GHOSTED
 *     MIRROR   = DM_BOUNDARY_MIRROR
 *     PERIODIC = DM_BOUNDARY_PERIODIC             # <<<<<<<<<<<<<<
 *     TWIST    = DM_BOUNDARY_TWIST
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMBoundaryType(DM_BOUNDARY_PERIODIC); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PERIODIC, __pyx_t_14) < (0)) __PYX_ERR(54, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":28
 *     MIRROR   = DM_BOUNDARY_MIRROR
 *     PERIODIC = DM_BOUNDARY_PERIODIC
 *     TWIST    = DM_BOUNDARY_TWIST             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMBoundaryType(DM_BOUNDARY_TWIST); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_TWIST, __pyx_t_14) < (0)) __PYX_ERR(54, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":22
 * 
 * 
 * class DMBoundaryType(object):             # <<<<<<<<<<<<<<
 *     """`DM` Boundary types."""
 *     NONE     = DM_BOUNDARY_NONE
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMBoundaryType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DMBoundaryType, __pyx_t_14) < (0)) __PYX_ERR(54, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":31
 * 
 * 
 * class DMPolytopeType(object):             # <<<<<<<<<<<<<<
 *     """The `DM` cell types."""
 *     POINT              = DM_POLYTOPE_POINT
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[164]); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMPolytopeType, __pyx_mstate_global->__pyx_n_u_DMPolytopeType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_DM_cell_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(54, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[164]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[164]) < 0))) __PYX_ERR(54, 31, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DM.pyx":33
 * class DMPolytopeType(object):
 *     """The `DM` cell types."""
 *     POINT              = DM_POLYTOPE_POINT             # <<<<<<<<<<<<<<
 *     SEGMENT            = DM_POLYTOPE_SEGMENT
 *     POINT_PRISM_TENSOR = DM_POLYTOPE_POINT_PRISM_TENSOR
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_POINT); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_POINT, __pyx_t_14) < (0)) __PYX_ERR(54, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":34
 *     """The `DM` cell types."""
 *     POINT              = DM_POLYTOPE_POINT
 *     SEGMENT            = DM_POLYTOPE_SEGMENT             # <<<<<<<<<<<<<<
 *     POINT_PRISM_TENSOR = DM_POLYTOPE_POINT_PRISM_TENSOR
 *     TRIANGLE           = DM_POLYTOPE_TRIANGLE
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_SEGMENT); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SEGMENT, __pyx_t_14) < (0)) __PYX_ERR(54, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":35
 *     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_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_POINT_PRISM_TENSOR); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_POINT_PRISM_TENSOR, __pyx_t_14) < (0)) __PYX_ERR(54, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":36
 *     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_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_TRIANGLE); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_TRIANGLE, __pyx_t_14) < (0)) __PYX_ERR(54, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":37
 *     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_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_QUADRILATERAL); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QUADRILATERAL, __pyx_t_14) < (0)) __PYX_ERR(54, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":38
 *     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_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_SEG_PRISM_TENSOR); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SEG_PRISM_TENSOR, __pyx_t_14) < (0)) __PYX_ERR(54, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":39
 *     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_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_TETRAHEDRON); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_TETRAHEDRON, __pyx_t_14) < (0)) __PYX_ERR(54, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":40
 *     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_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_HEXAHEDRON); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_HEXAHEDRON, __pyx_t_14) < (0)) __PYX_ERR(54, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":41
 *     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_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_TRI_PRISM); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_TRI_PRISM, __pyx_t_14) < (0)) __PYX_ERR(54, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":42
 *     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_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_TRI_PRISM_TENSOR); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_TRI_PRISM_TENSOR, __pyx_t_14) < (0)) __PYX_ERR(54, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":43
 *     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_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_QUAD_PRISM_TENSOR); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_QUAD_PRISM_TENSOR, __pyx_t_14) < (0)) __PYX_ERR(54, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":44
 *     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_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_PYRAMID); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PYRAMID, __pyx_t_14) < (0)) __PYX_ERR(54, 44, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":45
 *     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_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_FV_GHOST); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FV_GHOST, __pyx_t_14) < (0)) __PYX_ERR(54, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":46
 *     PYRAMID            = DM_POLYTOPE_PYRAMID
 *     FV_GHOST           = DM_POLYTOPE_FV_GHOST
 *     INTERIOR_GHOST     = DM_POLYTOPE_INTERIOR_GHOST             # <<<<<<<<<<<<<<
 *     UNKNOWN            = DM_POLYTOPE_UNKNOWN
 *     UNKNOWN_CELL       = DM_POLYTOPE_UNKNOWN_CELL
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_INTERIOR_GHOST); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_INTERIOR_GHOST, __pyx_t_14) < (0)) __PYX_ERR(54, 46, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":47
 *     FV_GHOST           = DM_POLYTOPE_FV_GHOST
 *     INTERIOR_GHOST     = DM_POLYTOPE_INTERIOR_GHOST
 *     UNKNOWN            = DM_POLYTOPE_UNKNOWN             # <<<<<<<<<<<<<<
 *     UNKNOWN_CELL       = DM_POLYTOPE_UNKNOWN_CELL
 *     UNKNOWN_FACE       = DM_POLYTOPE_UNKNOWN_FACE
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_UNKNOWN); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_UNKNOWN, __pyx_t_14) < (0)) __PYX_ERR(54, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":48
 *     INTERIOR_GHOST     = DM_POLYTOPE_INTERIOR_GHOST
 *     UNKNOWN            = DM_POLYTOPE_UNKNOWN
 *     UNKNOWN_CELL       = DM_POLYTOPE_UNKNOWN_CELL             # <<<<<<<<<<<<<<
 *     UNKNOWN_FACE       = DM_POLYTOPE_UNKNOWN_FACE
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_UNKNOWN_CELL); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_UNKNOWN_CELL, __pyx_t_14) < (0)) __PYX_ERR(54, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":49
 *     UNKNOWN            = DM_POLYTOPE_UNKNOWN
 *     UNKNOWN_CELL       = DM_POLYTOPE_UNKNOWN_CELL
 *     UNKNOWN_FACE       = DM_POLYTOPE_UNKNOWN_FACE             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMPolytopeType(DM_POLYTOPE_UNKNOWN_FACE); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_UNKNOWN_FACE, __pyx_t_14) < (0)) __PYX_ERR(54, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":31
 * 
 * 
 * class DMPolytopeType(object):             # <<<<<<<<<<<<<<
 *     """The `DM` cell types."""
 *     POINT              = DM_POLYTOPE_POINT
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMPolytopeType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DMPolytopeType, __pyx_t_14) < (0)) __PYX_ERR(54, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":52
 * 
 * 
 * class DMReorderDefaultFlag(object):             # <<<<<<<<<<<<<<
 *     """The `DM` reordering default flags."""
 *     NOTSET = DM_REORDER_DEFAULT_NOTSET
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[166]); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMReorderDefaultFlag, __pyx_mstate_global->__pyx_n_u_DMReorderDefaultFlag, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_DM_reordering_default_flags); if (unlikely(!__pyx_t_10)) __PYX_ERR(54, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[166]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[166]) < 0))) __PYX_ERR(54, 52, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DM.pyx":54
 * class DMReorderDefaultFlag(object):
 *     """The `DM` reordering default flags."""
 *     NOTSET = DM_REORDER_DEFAULT_NOTSET             # <<<<<<<<<<<<<<
 *     FALSE  = DM_REORDER_DEFAULT_FALSE
 *     TRUE   = DM_REORDER_DEFAULT_TRUE
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMReorderDefaultFlag(DM_REORDER_DEFAULT_NOTSET); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NOTSET, __pyx_t_14) < (0)) __PYX_ERR(54, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":55
 *     """The `DM` reordering default flags."""
 *     NOTSET = DM_REORDER_DEFAULT_NOTSET
 *     FALSE  = DM_REORDER_DEFAULT_FALSE             # <<<<<<<<<<<<<<
 *     TRUE   = DM_REORDER_DEFAULT_TRUE
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMReorderDefaultFlag(DM_REORDER_DEFAULT_FALSE); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FALSE, __pyx_t_14) < (0)) __PYX_ERR(54, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":56
 *     NOTSET = DM_REORDER_DEFAULT_NOTSET
 *     FALSE  = DM_REORDER_DEFAULT_FALSE
 *     TRUE   = DM_REORDER_DEFAULT_TRUE             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMReorderDefaultFlag(DM_REORDER_DEFAULT_TRUE); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_TRUE, __pyx_t_14) < (0)) __PYX_ERR(54, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DM.pyx":52
 * 
 * 
 * class DMReorderDefaultFlag(object):             # <<<<<<<<<<<<<<
 *     """The `DM` reordering default flags."""
 *     NOTSET = DM_REORDER_DEFAULT_NOTSET
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMReorderDefaultFlag, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(54, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DMReorderDefaultFlag, __pyx_t_14) < (0)) __PYX_ERR(54, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":64
 *     """An object describing a computational grid or mesh."""
 * 
 *     Type         = DMType             # <<<<<<<<<<<<<<
 *     BoundaryType = DMBoundaryType
 *     PolytopeType = DMPolytopeType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMType); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_5) < (0)) __PYX_ERR(54, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":65
 * 
 *     Type         = DMType
 *     BoundaryType = DMBoundaryType             # <<<<<<<<<<<<<<
 *     PolytopeType = DMPolytopeType
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMBoundaryType); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_BoundaryType, __pyx_t_5) < (0)) __PYX_ERR(54, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":66
 *     Type         = DMType
 *     BoundaryType = DMBoundaryType
 *     PolytopeType = DMPolytopeType             # <<<<<<<<<<<<<<
 * 
 *     ReorderDefaultFlag = DMReorderDefaultFlag
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMPolytopeType); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_PolytopeType, __pyx_t_5) < (0)) __PYX_ERR(54, 66, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":68
 *     PolytopeType = DMPolytopeType
 * 
 *     ReorderDefaultFlag = DMReorderDefaultFlag             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMReorderDefaultFlag); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_ReorderDefaultFlag, __pyx_t_5) < (0)) __PYX_ERR(54, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":76
 *         self.dm  = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 76, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_3view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1449])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_4) < (0)) __PYX_ERR(54, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":95
 *         CHKERR(DMView(self.dm, vwr))
 * 
 *     def load(self, Viewer viewer) -> Self:             # <<<<<<<<<<<<<<
 *         """Return a `DM` stored in binary.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(54, 95, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_5load, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_load, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1450])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_load, __pyx_t_5) < (0)) __PYX_ERR(54, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":121
 *         return self
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the object.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(54, 121, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_7destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1451])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_4) < (0)) __PYX_ERR(54, 121, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":134
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Return an empty `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(54, 134, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(54, 134, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_9create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1452])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_5) < (0)) __PYX_ERR(54, 134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":155
 *         return self
 * 
 *     def clone(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the cloned `DM` .
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(54, 155, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_11clone, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_clone, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1453])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_clone, __pyx_t_4) < (0)) __PYX_ERR(54, 155, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":169
 *         return dm
 * 
 *     def setType(self, dm_type: DM.Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Build a `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dm_type, __pyx_mstate_global->__pyx_kp_u_DM_Type_str) < (0)) __PYX_ERR(54, 169, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 169, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_13setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1454])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_5) < (0)) __PYX_ERR(54, 169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":192
 *         CHKERR(DMSetType(self.dm, cval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the `DM` type name.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 192, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_15getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1455])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_4) < (0)) __PYX_ERR(54, 192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":206
 *         return bytes2str(cval)
 * 
 *     def getDimension(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the topological dimension of the `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 206, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_17getDimension, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getDimension, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1456])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getDimension, __pyx_t_5) < (0)) __PYX_ERR(54, 206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":220
 *         return toInt(dim)
 * 
 *     def setDimension(self, dim: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the topological dimension of the `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_dim, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 220, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 220, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_19setDimension, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setDimension, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1457])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setDimension, __pyx_t_4) < (0)) __PYX_ERR(54, 220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":238
 *         CHKERR(DMSetDimension(self.dm, cdim))
 * 
 *     def getCoordinateDim(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the dimension of embedding space for coordinates values.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 238, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_21getCoordinateDim, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getCoordinateDim, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1458])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getCoordinateDim, __pyx_t_5) < (0)) __PYX_ERR(54, 238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":252
 *         return toInt(dim)
 * 
 *     def setCoordinateDim(self, dim: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the dimension of embedding space for coordinates values.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_dim, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 252, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 252, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_23setCoordinateDim, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setCoordinateDim, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1459])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setCoordinateDim, __pyx_t_4) < (0)) __PYX_ERR(54, 252, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":270
 *         CHKERR(DMSetCoordinateDim(self.dm, cdim))
 * 
 *     def setOptionsPrefix(self, prefix: str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(54, 270, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 270, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_25setOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1460])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setOptionsPrefix, __pyx_t_5) < (0)) __PYX_ERR(54, 270, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":284
 *         CHKERR(DMSetOptionsPrefix(self.dm, cval))
 * 
 *     def getOptionsPrefix(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 284, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_27getOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1461])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getOptionsPrefix, __pyx_t_4) < (0)) __PYX_ERR(54, 284, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":298
 *         return bytes2str(cval)
 * 
 *     def appendOptionsPrefix(self, prefix: str | None) -> None:             # <<<<<<<<<<<<<<
 *         """Append to the prefix used for searching for options in the database.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_prefix, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(54, 298, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 298, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_29appendOptionsPrefix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_appendOptionsPrefix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1462])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_appendOptionsPrefix, __pyx_t_5) < (0)) __PYX_ERR(54, 298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":312
 *         CHKERR(DMAppendOptionsPrefix(self.dm, cval))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the object from the options database.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 312, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_31setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1463])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_4) < (0)) __PYX_ERR(54, 312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":324
 *         CHKERR(DMSetFromOptions(self.dm))
 * 
 *     def setUp(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Return the data structure.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(54, 324, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_33setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1464])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_5) < (0)) __PYX_ERR(54, 324, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":339
 *     # --- application context ---
 * 
 *     def setAppCtx(self, appctx: Any) -> None:             # <<<<<<<<<<<<<<
 *         """Set the application context."""
 *         self.set_attr('__appctx__', appctx)
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_appctx, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(54, 339, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 339, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_35setAppCtx, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setAppCtx, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1465])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setAppCtx, __pyx_t_4) < (0)) __PYX_ERR(54, 339, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":343
 *         self.set_attr('__appctx__', appctx)
 * 
 *     def getAppCtx(self) -> Any:             # <<<<<<<<<<<<<<
 *         """Return the application context."""
 *         return self.get_attr('__appctx__')
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(54, 343, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_37getAppCtx, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getAppCtx, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1466])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getAppCtx, __pyx_t_5) < (0)) __PYX_ERR(54, 343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":349
 *     #
 * 
 *     def getUseNatural(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Get the flag for constructing a global-to-natural map.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(54, 349, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_39getUseNatural, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getUseNatural, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1467])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getUseNatural, __pyx_t_4) < (0)) __PYX_ERR(54, 349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":368
 *         return toBool(uN)
 * 
 *     def setUseNatural(self, useNatural : bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set the flag for constructing a global-to-natural map.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_useNatural, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(54, 368, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 368, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_41setUseNatural, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setUseNatural, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1468])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setUseNatural, __pyx_t_5) < (0)) __PYX_ERR(54, 368, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":386
 *         CHKERR(DMSetUseNatural(self.dm, uN))
 * 
 *     def setBasicAdjacency(self, useCone: bool, useClosure: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set the flags for determining variable influence.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_useCone, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(54, 386, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_useClosure, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(54, 386, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 386, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_43setBasicAdjacency, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setBasicAdjacency, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1469])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setBasicAdjacency, __pyx_t_4) < (0)) __PYX_ERR(54, 386, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":407
 *         CHKERR(DMSetBasicAdjacency(self.dm, uC, uCl))
 * 
 *     def getBasicAdjacency(self) -> tuple[bool, bool]:             # <<<<<<<<<<<<<<
 *         """Return the flags for determining variable influence.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_bool_bool) < (0)) __PYX_ERR(54, 407, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_45getBasicAdjacency, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getBasicAdjacency, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1470])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getBasicAdjacency, __pyx_t_5) < (0)) __PYX_ERR(54, 407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":429
 *         return toBool(uC), toBool(uCl)
 * 
 *     def setFieldAdjacency(self, field: int, useCone: bool, useClosure: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set the flags for determining variable influence.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 429, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_useCone, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(54, 429, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_useClosure, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(54, 429, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 429, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_47setFieldAdjacency, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setFieldAdjacency, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1471])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setFieldAdjacency, __pyx_t_4) < (0)) __PYX_ERR(54, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":453
 *         CHKERR(DMSetAdjacency(self.dm, f, uC, uCl))
 * 
 *     def getFieldAdjacency(self, field: int) -> tuple[bool, bool]:             # <<<<<<<<<<<<<<
 *         """Return the flags for determining variable influence.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 453, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_bool_bool) < (0)) __PYX_ERR(54, 453, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_49getFieldAdjacency, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getFieldAdjacency, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1472])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getFieldAdjacency, __pyx_t_5) < (0)) __PYX_ERR(54, 453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":483
 *     #
 * 
 *     def createSubDM(self, fields: Sequence[int]) -> tuple[IS, DM]:             # <<<<<<<<<<<<<<
 *         """Return `IS` and `DM` encapsulating a subproblem.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_fields, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(54, 483, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_IS_DM) < (0)) __PYX_ERR(54, 483, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_51createSubDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_createSubDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1473])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createSubDM, __pyx_t_4) < (0)) __PYX_ERR(54, 483, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":510
 *     #
 * 
 *     def setAuxiliaryVec(self, Vec aux, label: DMLabel | None, value=0, part=0) -> None:             # <<<<<<<<<<<<<<
 *         """Set an auxiliary vector for a specific region.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_label, __pyx_mstate_global->__pyx_kp_u_DMLabel_None) < (0)) __PYX_ERR(54, 510, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 510, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_53setAuxiliaryVec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setAuxiliaryVec, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1474])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[167]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setAuxiliaryVec, __pyx_t_5) < (0)) __PYX_ERR(54, 510, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":540
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_label, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(54, 540, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(54, 540, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_part, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(54, 540, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(54, 540, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_55getAuxiliaryVec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getAuxiliaryVec, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1475])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[168]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getAuxiliaryVec, __pyx_t_4) < (0)) __PYX_ERR(54, 540, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":570
 *         return aux
 * 
 *     def setNumFields(self, numFields: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of fields in the `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_numFields, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 570, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 570, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_57setNumFields, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setNumFields, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1476])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setNumFields, __pyx_t_5) < (0)) __PYX_ERR(54, 570, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":583
 *         CHKERR(DMSetNumFields(self.dm, cnum))
 * 
 *     def getNumFields(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of fields in the `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 583, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_59getNumFields, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getNumFields, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1477])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getNumFields, __pyx_t_4) < (0)) __PYX_ERR(54, 583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":597
 *         return toInt(cnum)
 * 
 *     def setField(self, index: int, Object field, label: str | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the discretization object for a given `DM` field.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_index, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 597, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_label, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(54, 597, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 597, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_61setField, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setField, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1478])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setField, __pyx_t_5) < (0)) __PYX_ERR(54, 597, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":623
 *         CHKERR(DMSetField(self.dm, cidx, clbl, cobj))
 * 
 *     def getField(self, index: int) -> tuple[Object, None]:             # <<<<<<<<<<<<<<
 *         """Return the discretization object for a given `DM` field.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_index, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 623, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Object_None) < (0)) __PYX_ERR(54, 623, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_63getField, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getField, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1479])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getField, __pyx_t_4) < (0)) __PYX_ERR(54, 623, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":648
 *         return (field, None) # TODO REVIEW
 * 
 *     def addField(self, Object field, label: str | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Add a field to a `DM` object.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_label, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(54, 648, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 648, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_65addField, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_addField, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1480])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_addField, __pyx_t_5) < (0)) __PYX_ERR(54, 648, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":671
 *         CHKERR(DMAddField(self.dm, clbl, cobj))
 * 
 *     def clearFields(self) -> None:             # <<<<<<<<<<<<<<
 *         """Remove all fields from the `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 671, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_67clearFields, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_clearFields, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1481])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_clearFields, __pyx_t_4) < (0)) __PYX_ERR(54, 671, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":683
 *         CHKERR(DMClearFields(self.dm))
 * 
 *     def copyFields(self, DM dm, minDegree = None, maxDegree = None) -> None:             # <<<<<<<<<<<<<<
 *         """Copy the discretizations of this `DM` into another `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 683, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_69copyFields, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_copyFields, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1482])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_copyFields, __pyx_t_5) < (0)) __PYX_ERR(54, 683, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":716
 *         CHKERR(DMCopyFields(self.dm, mindeg, maxdeg, dm.dm))
 * 
 *     def createDS(self) -> None:             # <<<<<<<<<<<<<<
 *         """Create discrete systems.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 716, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_71createDS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_createDS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1483])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createDS, __pyx_t_4) < (0)) __PYX_ERR(54, 716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":728
 *         CHKERR(DMCreateDS(self.dm))
 * 
 *     def clearDS(self) -> None:             # <<<<<<<<<<<<<<
 *         """Remove all discrete systems from the `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 728, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_73clearDS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_clearDS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1484])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_clearDS, __pyx_t_5) < (0)) __PYX_ERR(54, 728, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":740
 *         CHKERR(DMClearDS(self.dm))
 * 
 *     def getDS(self) -> DS:             # <<<<<<<<<<<<<<
 *         """Return default `DS`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DS) < (0)) __PYX_ERR(54, 740, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_75getDS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getDS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1485])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getDS, __pyx_t_4) < (0)) __PYX_ERR(54, 740, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":755
 *         return ds
 * 
 *     def copyDS(self, DM dm, minDegree = None, maxDegree = None) -> None:             # <<<<<<<<<<<<<<
 *         """Copy the discrete systems for this `DM` into another `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 755, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_77copyDS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_copyDS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1486])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_copyDS, __pyx_t_5) < (0)) __PYX_ERR(54, 755, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":788
 *         CHKERR(DMCopyDS(self.dm, mindeg, maxdeg, dm.dm))
 * 
 *     def copyDisc(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Copy fields and discrete systems of a `DM` into another `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 788, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_79copyDisc, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_copyDisc, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1487])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_copyDisc, __pyx_t_4) < (0)) __PYX_ERR(54, 788, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":807
 *     #
 * 
 *     def getBlockSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the inherent block size associated with a `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 807, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_81getBlockSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getBlockSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1488])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getBlockSize, __pyx_t_5) < (0)) __PYX_ERR(54, 807, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":821
 *         return toInt(bs)
 * 
 *     def setVecType(self, vec_type: Vec.Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of vector.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_vec_type, __pyx_mstate_global->__pyx_kp_u_Vec_Type_str) < (0)) __PYX_ERR(54, 821, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 821, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_83setVecType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setVecType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1489])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setVecType, __pyx_t_4) < (0)) __PYX_ERR(54, 821, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":835
 *         CHKERR(DMSetVecType(self.dm, vtype))
 * 
 *     def createGlobalVec(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a global vector.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(54, 835, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_85createGlobalVec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_createGlobalVec, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1490])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createGlobalVec, __pyx_t_5) < (0)) __PYX_ERR(54, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":849
 *         return vg
 * 
 *     def createLocalVec(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a local vector.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(54, 849, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_87createLocalVec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_createLocalVec, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1491])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createLocalVec, __pyx_t_4) < (0)) __PYX_ERR(54, 849, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":863
 *         return vl
 * 
 *     def getGlobalVec(self, name : str | None = None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a global vector.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(54, 863, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(54, 863, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_89getGlobalVec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getGlobalVec, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1492])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getGlobalVec, __pyx_t_5) < (0)) __PYX_ERR(54, 863, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":892
 *         return vg
 * 
 *     def restoreGlobalVec(self, Vec vg, name : str | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Restore a global vector obtained with `getGlobalVec`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(54, 892, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 892, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_91restoreGlobalVec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_restoreGlobalVec, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1493])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_restoreGlobalVec, __pyx_t_4) < (0)) __PYX_ERR(54, 892, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":917
 *             CHKERR(DMRestoreGlobalVector(self.dm, &vg.vec))
 * 
 *     def getLocalVec(self, name : str | None = None) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a local vector.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(54, 917, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(54, 917, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_93getLocalVec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getLocalVec, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1494])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getLocalVec, __pyx_t_5) < (0)) __PYX_ERR(54, 917, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":946
 *         return vl
 * 
 *     def restoreLocalVec(self, Vec vl, name : str | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Restore a local vector obtained with `getLocalVec`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(54, 946, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 946, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_95restoreLocalVec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_restoreLocalVec, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1495])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_restoreLocalVec, __pyx_t_4) < (0)) __PYX_ERR(54, 946, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":971
 *             CHKERR(DMRestoreLocalVector(self.dm, &vl.vec))
 * 
 *     def globalToLocal(self, Vec vg, Vec vl, addv: InsertModeSpec | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Update local vectors from global vector.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_kp_u_InsertModeSpec_None) < (0)) __PYX_ERR(54, 971, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 971, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_97globalToLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_globalToLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1496])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_globalToLocal, __pyx_t_5) < (0)) __PYX_ERR(54, 971, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":994
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_kp_u_InsertModeSpec_None) < (0)) __PYX_ERR(54, 994, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 994, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_99localToGlobal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_localToGlobal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1497])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_localToGlobal, __pyx_t_4) < (0)) __PYX_ERR(54, 994, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1017
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_kp_u_InsertModeSpec_None) < (0)) __PYX_ERR(54, 1017, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1017, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_101localToLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_localToLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1498])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_localToLocal, __pyx_t_5) < (0)) __PYX_ERR(54, 1017, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1040
 *         CHKERR(DMLocalToLocalEnd  (self.dm, vl.vec, im, vlg.vec))
 * 
 *     def getLGMap(self) -> LGMap:             # <<<<<<<<<<<<<<
 *         """Return local mapping to global mapping.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_LGMap) < (0)) __PYX_ERR(54, 1040, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_103getLGMap, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getLGMap, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1499])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getLGMap, __pyx_t_4) < (0)) __PYX_ERR(54, 1040, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1057
 *     #
 * 
 *     def getCoarseDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the coarse `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(54, 1057, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_105getCoarseDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getCoarseDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1500])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getCoarseDM, __pyx_t_5) < (0)) __PYX_ERR(54, 1057, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1072
 *         return cdm
 * 
 *     def setCoarseDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Set the coarse `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1072, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_107setCoarseDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setCoarseDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1501])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setCoarseDM, __pyx_t_4) < (0)) __PYX_ERR(54, 1072, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1085
 *         return
 * 
 *     def getCoordinateDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the coordinate `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(54, 1085, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_109getCoordinateDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getCoordinateDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1502])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getCoordinateDM, __pyx_t_5) < (0)) __PYX_ERR(54, 1085, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1100
 *         return cdm
 * 
 *     def getCoordinateSection(self) -> Section:             # <<<<<<<<<<<<<<
 *         """Return coordinate values layout over the mesh.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Section) < (0)) __PYX_ERR(54, 1100, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_111getCoordinateSection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getCoordinateSection, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1503])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getCoordinateSection, __pyx_t_4) < (0)) __PYX_ERR(54, 1100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1115
 *         return sec
 * 
 *     def setCoordinates(self, Vec c) -> None:             # <<<<<<<<<<<<<<
 *         """Set a global vector that holds the coordinates.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1115, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_113setCoordinates, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setCoordinates, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1504])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setCoordinates, __pyx_t_5) < (0)) __PYX_ERR(54, 1115, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1132
 *         CHKERR(DMSetCoordinates(self.dm, c.vec))
 * 
 *     def getCoordinates(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a global vector with the coordinates associated.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(54, 1132, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_115getCoordinates, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getCoordinates, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1505])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getCoordinates, __pyx_t_4) < (0)) __PYX_ERR(54, 1132, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1147
 *         return c
 * 
 *     def setCoordinatesLocal(self, Vec c) -> None:             # <<<<<<<<<<<<<<
 *         """Set a local vector with the ghost point holding the coordinates.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1147, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_117setCoordinatesLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setCoordinatesLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1506])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setCoordinatesLocal, __pyx_t_5) < (0)) __PYX_ERR(54, 1147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1164
 *         CHKERR(DMSetCoordinatesLocal(self.dm, c.vec))
 * 
 *     def getCoordinatesLocal(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a local vector with the coordinates associated.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(54, 1164, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_119getCoordinatesLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getCoordinatesLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1507])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getCoordinatesLocal, __pyx_t_4) < (0)) __PYX_ERR(54, 1164, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1179
 *         return c
 * 
 *     def setCellCoordinateDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Set the cell coordinate `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1179, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_121setCellCoordinateDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setCellCoordinateDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1508])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setCellCoordinateDM, __pyx_t_5) < (0)) __PYX_ERR(54, 1179, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1196
 *         CHKERR(DMSetCellCoordinateDM(self.dm, dm.dm))
 * 
 *     def getCellCoordinateDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the cell coordinate `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(54, 1196, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_123getCellCoordinateDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getCellCoordinateDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1509])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getCellCoordinateDM, __pyx_t_4) < (0)) __PYX_ERR(54, 1196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1211
 *         return cdm
 * 
 *     def setCellCoordinateSection(self, dim: int, Section sec) -> None:             # <<<<<<<<<<<<<<
 *         """Set the cell coordinate layout over the `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dim, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 1211, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1211, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_125setCellCoordinateSection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setCellCoordinateSection, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1510])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setCellCoordinateSection, __pyx_t_5) < (0)) __PYX_ERR(54, 1211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1231
 *         CHKERR(DMSetCellCoordinateSection(self.dm, cdim, sec.sec))
 * 
 *     def getCellCoordinateSection(self) -> Section:             # <<<<<<<<<<<<<<
 *         """Return the cell coordinate layout over the `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Section) < (0)) __PYX_ERR(54, 1231, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_127getCellCoordinateSection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getCellCoordinateSection, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1511])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getCellCoordinateSection, __pyx_t_4) < (0)) __PYX_ERR(54, 1231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1246
 *         return sec
 * 
 *     def setCellCoordinates(self, Vec c) -> None:             # <<<<<<<<<<<<<<
 *         """Set a global vector with the cellwise coordinates.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1246, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_129setCellCoordinates, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setCellCoordinates, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1512])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setCellCoordinates, __pyx_t_5) < (0)) __PYX_ERR(54, 1246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1263
 *         CHKERR(DMSetCellCoordinates(self.dm, c.vec))
 * 
 *     def getCellCoordinates(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a global vector with the cellwise coordinates.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(54, 1263, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_131getCellCoordinates, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getCellCoordinates, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1513])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getCellCoordinates, __pyx_t_4) < (0)) __PYX_ERR(54, 1263, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1278
 *         return c
 * 
 *     def setCellCoordinatesLocal(self, Vec c) -> None:             # <<<<<<<<<<<<<<
 *         """Set a local vector with the cellwise coordinates.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1278, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_133setCellCoordinatesLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setCellCoordinatesLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1514])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setCellCoordinatesLocal, __pyx_t_5) < (0)) __PYX_ERR(54, 1278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1295
 *         CHKERR(DMSetCellCoordinatesLocal(self.dm, c.vec))
 * 
 *     def getCellCoordinatesLocal(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a local vector with the cellwise coordinates.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(54, 1295, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_135getCellCoordinatesLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getCellCoordinatesLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1515])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getCellCoordinatesLocal, __pyx_t_4) < (0)) __PYX_ERR(54, 1295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1310
 *         return c
 * 
 *     def setCoordinateDisc(self, FE disc, localized: bool, project: bool) -> Self:             # <<<<<<<<<<<<<<
 *         """Project coordinates to a different space.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_localized, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(54, 1310, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_project, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(54, 1310, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(54, 1310, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_137setCoordinateDisc, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setCoordinateDisc, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1516])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setCoordinateDisc, __pyx_t_5) < (0)) __PYX_ERR(54, 1310, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1334
 *         return self
 * 
 *     def getCoordinatesLocalized(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Check if the coordinates have been localized for cells.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(54, 1334, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_139getCoordinatesLocalized, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getCoordinatesLocalized, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1517])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getCoordinatesLocalized, __pyx_t_4) < (0)) __PYX_ERR(54, 1334, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1348
 *         return toBool(flag)
 * 
 *     def getSparseLocalize(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return if coordinates should only be localized at the boundary.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(54, 1348, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_141getSparseLocalize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getSparseLocalize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1518])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getSparseLocalize, __pyx_t_5) < (0)) __PYX_ERR(54, 1348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1362
 *         return toBool(flag)
 * 
 *     def setSparseLocalize(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set if coordinates should be only localized at the boundary.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(54, 1362, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1362, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_143setSparseLocalize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setSparseLocalize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1519])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setSparseLocalize, __pyx_t_4) < (0)) __PYX_ERR(54, 1362, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1381
 *         CHKERR(DMSetSparseLocalize(self.dm, cflag))
 * 
 *     def getBoundingBox(self) -> tuple[tuple[float, float], ...]:             # <<<<<<<<<<<<<<
 *         """Return the dimension of embedding space for coordinates values.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_tuple_float_float) < (0)) __PYX_ERR(54, 1381, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_145getBoundingBox, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getBoundingBox, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1520])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getBoundingBox, __pyx_t_5) < (0)) __PYX_ERR(54, 1381, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1398
 *                       for i from 0 <= i < dim])
 * 
 *     def getLocalBoundingBox(self) -> tuple[tuple[float, float], ...]:             # <<<<<<<<<<<<<<
 *         """Return the bounding box for the piece of the `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_tuple_float_float) < (0)) __PYX_ERR(54, 1398, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_147getLocalBoundingBox, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getLocalBoundingBox, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1521])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getLocalBoundingBox, __pyx_t_4) < (0)) __PYX_ERR(54, 1398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1415
 *                       for i from 0 <= i < dim])
 * 
 *     def localizeCoordinates(self) -> None:             # <<<<<<<<<<<<<<
 *         """Create local coordinates for cells having periodic faces.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1415, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_149localizeCoordinates, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_localizeCoordinates, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1522])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_localizeCoordinates, __pyx_t_5) < (0)) __PYX_ERR(54, 1415, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1432
 *     #
 * 
 *     def getPeriodicity(self) -> tuple[ArrayReal, ArrayReal, ArrayReal]:             # <<<<<<<<<<<<<<
 *         """Set the description of mesh periodicity.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_ArrayReal_ArrayReal_ArrayR) < (0)) __PYX_ERR(54, 1432, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_151getPeriodicity, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getPeriodicity, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1523])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getPeriodicity, __pyx_t_4) < (0)) __PYX_ERR(54, 1432, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1468
 *         return (mcell, lstart, lpy)
 * 
 *     def setPeriodicity(self, maxCell: Sequence[float], Lstart: Sequence[float], L: Sequence[float]) -> None:             # <<<<<<<<<<<<<<
 *         """Set the description of mesh periodicity.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_maxCell, __pyx_mstate_global->__pyx_kp_u_Sequence_float) < (0)) __PYX_ERR(54, 1468, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_Lstart, __pyx_mstate_global->__pyx_kp_u_Sequence_float) < (0)) __PYX_ERR(54, 1468, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_L, __pyx_mstate_global->__pyx_kp_u_Sequence_float) < (0)) __PYX_ERR(54, 1468, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1468, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_153setPeriodicity, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setPeriodicity, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1524])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setPeriodicity, __pyx_t_5) < (0)) __PYX_ERR(54, 1468, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1495
 *         CHKERR(DMSetPeriodicity(self.dm, MAXCELL, LSTART, LPY))
 * 
 *     def setMatType(self, mat_type: Mat.Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set matrix type to be used by `DM.createMat`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_mat_type, __pyx_mstate_global->__pyx_kp_u_Mat_Type_str) < (0)) __PYX_ERR(54, 1495, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1495, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_155setMatType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setMatType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1525])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setMatType, __pyx_t_4) < (0)) __PYX_ERR(54, 1495, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1518
 *         CHKERR(DMSetMatType(self.dm, mtype))
 * 
 *     def createMat(self) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return an empty matrix.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(54, 1518, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_157createMat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_createMat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1526])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createMat, __pyx_t_5) < (0)) __PYX_ERR(54, 1518, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1532
 *         return mat
 * 
 *     def createMassMatrix(self, DM dmf) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the mass matrix between this `DM` and the given `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(54, 1532, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_159createMassMatrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_createMassMatrix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1527])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createMassMatrix, __pyx_t_4) < (0)) __PYX_ERR(54, 1532, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1551
 *         return mat
 * 
 *     def createInterpolation(self, DM dm) -> tuple[Mat, Vec]:             # <<<<<<<<<<<<<<
 *         """Return the interpolation matrix to a finer `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Mat_Vec) < (0)) __PYX_ERR(54, 1551, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_161createInterpolation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_createInterpolation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1528])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createInterpolation, __pyx_t_5) < (0)) __PYX_ERR(54, 1551, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1572
 *         return (A, scale)
 * 
 *     def createInjection(self, DM dm) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the injection matrix into a finer `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(54, 1572, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_163createInjection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_createInjection, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1529])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createInjection, __pyx_t_4) < (0)) __PYX_ERR(54, 1572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1591
 *         return inject
 * 
 *     def createRestriction(self, DM dm) -> Mat:             # <<<<<<<<<<<<<<
 *         """Return the restriction matrix between this `DM` and the given `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Mat) < (0)) __PYX_ERR(54, 1591, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_165createRestriction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_createRestriction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1530])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createRestriction, __pyx_t_5) < (0)) __PYX_ERR(54, 1591, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1610
 *         return mat
 * 
 *     def convert(self, dm_type: DM.Type | str) -> DM:             # <<<<<<<<<<<<<<
 *         """Return a `DM` converted to another `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_dm_type, __pyx_mstate_global->__pyx_kp_u_DM_Type_str) < (0)) __PYX_ERR(54, 1610, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(54, 1610, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_167convert, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_convert, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1531])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_convert, __pyx_t_4) < (0)) __PYX_ERR(54, 1610, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1633
 *         return dm
 * 
 *     def refine(self, comm: Comm | None = None) -> DM:             # <<<<<<<<<<<<<<
 *         """Return a refined `DM` object.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(54, 1633, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(54, 1633, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_169refine, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_refine, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1532])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_refine, __pyx_t_5) < (0)) __PYX_ERR(54, 1633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1657
 *         return dm
 * 
 *     def coarsen(self, comm: Comm | None = None) -> DM:             # <<<<<<<<<<<<<<
 *         """Return a coarsened `DM` object.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(54, 1657, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(54, 1657, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_171coarsen, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_coarsen, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1533])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_coarsen, __pyx_t_4) < (0)) __PYX_ERR(54, 1657, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1681
 *         return dm
 * 
 *     def refineHierarchy(self, nlevels: int) -> list:             # <<<<<<<<<<<<<<
 *         """Refine this `DM` and return the refined `DM` hierarchy.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_nlevels, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 1681, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_list) < (0)) __PYX_ERR(54, 1681, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_173refineHierarchy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_refineHierarchy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1534])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_refineHierarchy, __pyx_t_5) < (0)) __PYX_ERR(54, 1681, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1708
 *         return hierarchy
 * 
 *     def coarsenHierarchy(self, nlevels: int) -> list:             # <<<<<<<<<<<<<<
 *         """Coarsen this `DM` and return the coarsened `DM` hierarchy.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_nlevels, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 1708, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_list) < (0)) __PYX_ERR(54, 1708, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_175coarsenHierarchy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_coarsenHierarchy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1535])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_coarsenHierarchy, __pyx_t_4) < (0)) __PYX_ERR(54, 1708, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1735
 *         return hierarchy
 * 
 *     def getRefineLevel(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the refinement level.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 1735, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_177getRefineLevel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getRefineLevel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1536])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getRefineLevel, __pyx_t_5) < (0)) __PYX_ERR(54, 1735, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1749
 *         return toInt(n)
 * 
 *     def setRefineLevel(self, level: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of refinements.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_level, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 1749, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1749, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_179setRefineLevel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setRefineLevel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1537])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setRefineLevel, __pyx_t_4) < (0)) __PYX_ERR(54, 1749, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1767
 *         CHKERR(DMSetRefineLevel(self.dm, clevel))
 * 
 *     def getCoarsenLevel(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of coarsenings.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 1767, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_181getCoarsenLevel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getCoarsenLevel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1538])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getCoarsenLevel, __pyx_t_5) < (0)) __PYX_ERR(54, 1767, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1783
 *     #
 * 
 *     def adaptLabel(self, label: str) -> DM:             # <<<<<<<<<<<<<<
 *         """Adapt a `DM` based on a `DMLabel`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_label, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 1783, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(54, 1783, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_183adaptLabel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_adaptLabel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1539])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_adaptLabel, __pyx_t_4) < (0)) __PYX_ERR(54, 1783, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1806
 *         return newdm
 * 
 *     def adaptMetric(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec metric,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_bdLabel, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(54, 1806, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_rgLabel, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(54, 1806, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(54, 1806, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_185adaptMetric, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_adaptMetric, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1540])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_adaptMetric, __pyx_t_5) < (0)) __PYX_ERR(54, 1806, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1842
 *         return newdm
 * 
 *     def getLabel(self, name: str) -> DMLabel:             # <<<<<<<<<<<<<<
 *         """Return the label of a given name.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 1842, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DMLabel) < (0)) __PYX_ERR(54, 1842, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_187getLabel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getLabel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1541])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getLabel, __pyx_t_4) < (0)) __PYX_ERR(54, 1842, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1861
 *     #
 * 
 *     def setLocalSection(self, Section sec) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `Section` encoding the local data layout for the `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1861, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_189setLocalSection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setLocalSection, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1542])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setLocalSection, __pyx_t_5) < (0)) __PYX_ERR(54, 1861, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1873
 *         CHKERR(DMSetLocalSection(self.dm, sec.sec))
 * 
 *     def getLocalSection(self) -> Section:             # <<<<<<<<<<<<<<
 *         """Return the `Section` encoding the local data layout for the `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Section) < (0)) __PYX_ERR(54, 1873, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_191getLocalSection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getLocalSection, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1543])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1873, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getLocalSection, __pyx_t_4) < (0)) __PYX_ERR(54, 1873, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1888
 *         return sec
 * 
 *     def setGlobalSection(self, Section sec) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `Section` encoding the global data layout for the `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1888, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_193setGlobalSection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setGlobalSection, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1544])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setGlobalSection, __pyx_t_5) < (0)) __PYX_ERR(54, 1888, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1900
 *         CHKERR(DMSetGlobalSection(self.dm, sec.sec))
 * 
 *     def getGlobalSection(self) -> Section:             # <<<<<<<<<<<<<<
 *         """Return the `Section` encoding the global data layout for the `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Section) < (0)) __PYX_ERR(54, 1900, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_195getGlobalSection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getGlobalSection, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1545])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getGlobalSection, __pyx_t_4) < (0)) __PYX_ERR(54, 1900, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1915
 *         return sec
 * 
 *     setSection = setLocalSection             # <<<<<<<<<<<<<<
 *     getSection = getLocalSection
 *     setDefaultSection = setLocalSection
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setLocalSection); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setSection, __pyx_t_4) < (0)) __PYX_ERR(54, 1915, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1916
 * 
 *     setSection = setLocalSection
 *     getSection = getLocalSection             # <<<<<<<<<<<<<<
 *     setDefaultSection = setLocalSection
 *     getDefaultSection = getLocalSection
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getLocalSection); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getSection, __pyx_t_4) < (0)) __PYX_ERR(54, 1916, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1917
 *     setSection = setLocalSection
 *     getSection = getLocalSection
 *     setDefaultSection = setLocalSection             # <<<<<<<<<<<<<<
 *     getDefaultSection = getLocalSection
 *     setDefaultLocalSection = setLocalSection
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setLocalSection); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setDefaultSection, __pyx_t_4) < (0)) __PYX_ERR(54, 1917, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1918
 *     getSection = getLocalSection
 *     setDefaultSection = setLocalSection
 *     getDefaultSection = getLocalSection             # <<<<<<<<<<<<<<
 *     setDefaultLocalSection = setLocalSection
 *     getDefaultLocalSection = getLocalSection
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getLocalSection); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getDefaultSection, __pyx_t_4) < (0)) __PYX_ERR(54, 1918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1919
 *     setDefaultSection = setLocalSection
 *     getDefaultSection = getLocalSection
 *     setDefaultLocalSection = setLocalSection             # <<<<<<<<<<<<<<
 *     getDefaultLocalSection = getLocalSection
 *     setDefaultGlobalSection = setGlobalSection
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setLocalSection); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setDefaultLocalSection, __pyx_t_4) < (0)) __PYX_ERR(54, 1919, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1920
 *     getDefaultSection = getLocalSection
 *     setDefaultLocalSection = setLocalSection
 *     getDefaultLocalSection = getLocalSection             # <<<<<<<<<<<<<<
 *     setDefaultGlobalSection = setGlobalSection
 *     getDefaultGlobalSection = getGlobalSection
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getLocalSection); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getDefaultLocalSection, __pyx_t_4) < (0)) __PYX_ERR(54, 1920, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1921
 *     setDefaultLocalSection = setLocalSection
 *     getDefaultLocalSection = getLocalSection
 *     setDefaultGlobalSection = setGlobalSection             # <<<<<<<<<<<<<<
 *     getDefaultGlobalSection = getGlobalSection
 * 
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setGlobalSection); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setDefaultGlobalSection, __pyx_t_4) < (0)) __PYX_ERR(54, 1921, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1922
 *     getDefaultLocalSection = getLocalSection
 *     setDefaultGlobalSection = setGlobalSection
 *     getDefaultGlobalSection = getGlobalSection             # <<<<<<<<<<<<<<
 * 
 *     def createSectionSF(self, Section localsec, Section globalsec) -> None:
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getGlobalSection); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getDefaultGlobalSection, __pyx_t_4) < (0)) __PYX_ERR(54, 1922, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1924
 *     getDefaultGlobalSection = getGlobalSection
 * 
 *     def createSectionSF(self, Section localsec, Section globalsec) -> None:             # <<<<<<<<<<<<<<
 *         """Create the `SF` encoding the parallel DOF overlap for the `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1924, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_197createSectionSF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_createSectionSF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1546])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createSectionSF, __pyx_t_5) < (0)) __PYX_ERR(54, 1924, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1947
 *         CHKERR(DMCreateSectionSF(self.dm, localsec.sec, globalsec.sec))
 * 
 *     def getSectionSF(self) -> SF:             # <<<<<<<<<<<<<<
 *         """Return the `Section` encoding the parallel DOF overlap.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SF) < (0)) __PYX_ERR(54, 1947, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_199getSectionSF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getSectionSF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1547])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getSectionSF, __pyx_t_4) < (0)) __PYX_ERR(54, 1947, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1962
 *         return sf
 * 
 *     def setSectionSF(self, SF sf) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `Section` encoding the parallel DOF overlap for the `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1962, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_201setSectionSF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setSectionSF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1548])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setSectionSF, __pyx_t_5) < (0)) __PYX_ERR(54, 1962, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1974
 *         CHKERR(DMSetSectionSF(self.dm, sf.sf))
 * 
 *     createDefaultSF = createSectionSF             # <<<<<<<<<<<<<<
 *     getDefaultSF = getSectionSF
 *     setDefaultSF = setSectionSF
*/
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createSectionSF); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createDefaultSF, __pyx_t_5) < (0)) __PYX_ERR(54, 1974, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1975
 * 
 *     createDefaultSF = createSectionSF
 *     getDefaultSF = getSectionSF             # <<<<<<<<<<<<<<
 *     setDefaultSF = setSectionSF
 * 
*/
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getSectionSF); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getDefaultSF, __pyx_t_5) < (0)) __PYX_ERR(54, 1975, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1976
 *     createDefaultSF = createSectionSF
 *     getDefaultSF = getSectionSF
 *     setDefaultSF = setSectionSF             # <<<<<<<<<<<<<<
 * 
 *     def getPointSF(self) -> SF:
*/
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setSectionSF); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setDefaultSF, __pyx_t_5) < (0)) __PYX_ERR(54, 1976, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":1978
 *     setDefaultSF = setSectionSF
 * 
 *     def getPointSF(self) -> SF:             # <<<<<<<<<<<<<<
 *         """Return the `SF` encoding the parallel DOF overlap for the `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SF) < (0)) __PYX_ERR(54, 1978, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_203getPointSF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getPointSF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1549])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getPointSF, __pyx_t_4) < (0)) __PYX_ERR(54, 1978, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":1993
 *         return sf
 * 
 *     def setPointSF(self, SF sf) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `SF` encoding the parallel DOF overlap for the `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 1993, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_205setPointSF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setPointSF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1550])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setPointSF, __pyx_t_5) < (0)) __PYX_ERR(54, 1993, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":2005
 *         CHKERR(DMSetPointSF(self.dm, sf.sf))
 * 
 *     def getNumLabels(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of labels defined by on the `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 2005, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_207getNumLabels, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getNumLabels, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1551])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getNumLabels, __pyx_t_4) < (0)) __PYX_ERR(54, 2005, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":2019
 *         return toInt(nLabels)
 * 
 *     def getLabelName(self, index: int) -> str:             # <<<<<<<<<<<<<<
 *         """Return the name of nth label.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_index, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 2019, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 2019, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_209getLabelName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getLabelName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1552])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2019, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getLabelName, __pyx_t_5) < (0)) __PYX_ERR(54, 2019, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":2039
 *         return bytes2str(cname)
 * 
 *     def hasLabel(self, name: str) -> bool:             # <<<<<<<<<<<<<<
 *         """Determine whether the `DM` has a label.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 2039, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(54, 2039, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_211hasLabel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_hasLabel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1553])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_hasLabel, __pyx_t_4) < (0)) __PYX_ERR(54, 2039, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":2060
 *         return toBool(flag)
 * 
 *     def createLabel(self, name: str) -> None:             # <<<<<<<<<<<<<<
 *         """Create a label of the given name if it does not already exist.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 2060, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 2060, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_213createLabel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_createLabel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1554])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createLabel, __pyx_t_5) < (0)) __PYX_ERR(54, 2060, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":2079
 *         CHKERR(DMCreateLabel(self.dm, cname))
 * 
 *     def removeLabel(self, name: str) -> None:             # <<<<<<<<<<<<<<
 *         """Remove and destroy the label by name.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 2079, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 2079, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_215removeLabel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_removeLabel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1555])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_removeLabel, __pyx_t_4) < (0)) __PYX_ERR(54, 2079, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":2101
 *         CHKERR(DMLabelDestroy(&clbl))
 * 
 *     def getLabelValue(self, name: str, point: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the value in `DMLabel` for the given point.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 2101, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 2101, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 2101, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_217getLabelValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getLabelValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1556])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getLabelValue, __pyx_t_5) < (0)) __PYX_ERR(54, 2101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":2124
 *         return toInt(value)
 * 
 *     def setLabelValue(self, name: str, point: int, value: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set a point to a `DMLabel` with a given value.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 2124, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 2124, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 2124, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 2124, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_219setLabelValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setLabelValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1557])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setLabelValue, __pyx_t_4) < (0)) __PYX_ERR(54, 2124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":2148
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 2148, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 2148, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 2148, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 2148, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_221clearLabelValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_clearLabelValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1558])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_clearLabelValue, __pyx_t_5) < (0)) __PYX_ERR(54, 2148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":2172
 *         CHKERR(DMClearLabelValue(self.dm, cname, cpoint, cvalue))
 * 
 *     def getLabelSize(self, name: str) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of values that the `DMLabel` takes.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 2172, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 2172, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_223getLabelSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getLabelSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1559])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getLabelSize, __pyx_t_4) < (0)) __PYX_ERR(54, 2172, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":2193
 *         return toInt(size)
 * 
 *     def getLabelIdIS(self, name: str) -> IS:             # <<<<<<<<<<<<<<
 *         """Return an `IS` of all values that the `DMLabel` takes.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 2193, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(54, 2193, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_225getLabelIdIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getLabelIdIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1560])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getLabelIdIS, __pyx_t_5) < (0)) __PYX_ERR(54, 2193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":2214
 *         return lis
 * 
 *     def getStratumSize(self, name: str, value: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of points in a label stratum.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 2214, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 2214, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 2214, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_227getStratumSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getStratumSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1561])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getStratumSize, __pyx_t_4) < (0)) __PYX_ERR(54, 2214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":2238
 *         return toInt(size)
 * 
 *     def getStratumIS(self, name: str, value: int) -> IS:             # <<<<<<<<<<<<<<
 *         """Return the points in a label stratum.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 2238, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 2238, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(54, 2238, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_229getStratumIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getStratumIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1562])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getStratumIS, __pyx_t_5) < (0)) __PYX_ERR(54, 2238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":2262
 *         return sis
 * 
 *     def clearLabelStratum(self, name: str, value: int) -> None:             # <<<<<<<<<<<<<<
 *         """Remove all points from a stratum.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 2262, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(54, 2262, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 2262, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_231clearLabelStratum, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_clearLabelStratum, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1563])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_clearLabelStratum, __pyx_t_4) < (0)) __PYX_ERR(54, 2262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":2284
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 2284, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_output, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(54, 2284, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 2284, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_233setLabelOutput, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setLabelOutput, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1564])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setLabelOutput, __pyx_t_5) < (0)) __PYX_ERR(54, 2284, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":2306
 *         CHKERR(DMSetLabelOutput(self.dm, cname, coutput))
 * 
 *     def getLabelOutput(self, name: str) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the output flag for a given label.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(54, 2306, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(54, 2306, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_235getLabelOutput, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_getLabelOutput, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1565])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getLabelOutput, __pyx_t_4) < (0)) __PYX_ERR(54, 2306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":2328
 * 
 *     # backward compatibility
 *     createGlobalVector = createGlobalVec             # <<<<<<<<<<<<<<
 *     createLocalVector = createLocalVec
 *     getMatrix = createMatrix = createMat
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createGlobalVec); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createGlobalVector, __pyx_t_4) < (0)) __PYX_ERR(54, 2328, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":2329
 *     # backward compatibility
 *     createGlobalVector = createGlobalVec
 *     createLocalVector = createLocalVec             # <<<<<<<<<<<<<<
 *     getMatrix = createMatrix = createMat
 * 
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createLocalVec); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createLocalVector, __pyx_t_4) < (0)) __PYX_ERR(54, 2329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":2330
 *     createGlobalVector = createGlobalVec
 *     createLocalVector = createLocalVec
 *     getMatrix = createMatrix = createMat             # <<<<<<<<<<<<<<
 * 
 *     def setKSPComputeOperators(
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createMat); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_getMatrix, __pyx_t_4) < (0)) __PYX_ERR(54, 2330, __pyx_L1_error)
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createMatrix, __pyx_t_4) < (0)) __PYX_ERR(54, 2330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":2332
 *     getMatrix = createMatrix = createMat
 * 
 *     def setKSPComputeOperators(             # <<<<<<<<<<<<<<
 *         self, operators,
 *         args: tuple[Any, ...] | None = None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(54, 2332, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(54, 2332, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 2332, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_237setKSPComputeOperators, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setKSPComputeOperators, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1566])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setKSPComputeOperators, __pyx_t_5) < (0)) __PYX_ERR(54, 2332, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":2360
 *         CHKERR(DMKSPSetComputeOperators(self.dm, KSP_ComputeOps, <void*>context))
 * 
 *     def createFieldDecomposition(self) -> tuple[list, list, list]:             # <<<<<<<<<<<<<<
 *         """Return field splitting information.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_list_list_list) < (0)) __PYX_ERR(54, 2360, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_239createFieldDecomposition, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_createFieldDecomposition, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1567])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_createFieldDecomposition, __pyx_t_4) < (0)) __PYX_ERR(54, 2360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":2407
 *         return (names, isets, dms)
 * 
 *     def setSNESFunction(             # <<<<<<<<<<<<<<
 *         self, function: SNESFunction,
 *         args: tuple[Any, ...] | None = None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_function, __pyx_mstate_global->__pyx_n_u_SNESFunction) < (0)) __PYX_ERR(54, 2407, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(54, 2407, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(54, 2407, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 2407, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_241setSNESFunction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setSNESFunction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1568])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setSNESFunction, __pyx_t_5) < (0)) __PYX_ERR(54, 2407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":2439
 *             CHKERR(DMSNESSetFunction(self.dm, NULL, NULL))
 * 
 *     def setSNESJacobian(             # <<<<<<<<<<<<<<
 *         self, jacobian: SNESJacobianFunction,
 *         args: tuple[Any, ...] | None = None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_jacobian, __pyx_mstate_global->__pyx_n_u_SNESJacobianFunction) < (0)) __PYX_ERR(54, 2439, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(54, 2439, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(54, 2439, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 2439, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_243setSNESJacobian, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_setSNESJacobian, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1569])); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_setSNESJacobian, __pyx_t_4) < (0)) __PYX_ERR(54, 2439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DM.pyx":2470
 *             CHKERR(DMSNESSetJacobian(self.dm, NULL, NULL))
 * 
 *     def addCoarsenHook(             # <<<<<<<<<<<<<<
 *         self,
 *         coarsenhook: DMCoarsenHookFunction,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(54, 2470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_coarsenhook, __pyx_mstate_global->__pyx_n_u_DMCoarsenHookFunction) < (0)) __PYX_ERR(54, 2470, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_restricthook, __pyx_mstate_global->__pyx_n_u_DMRestrictHookFunction) < (0)) __PYX_ERR(54, 2470, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(54, 2470, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(54, 2470, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(54, 2470, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DM_245addCoarsenHook, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DM_addCoarsenHook, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1570])); if (unlikely(!__pyx_t_5)) __PYX_ERR(54, 2470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DM, __pyx_mstate_global->__pyx_n_u_addCoarsenHook, __pyx_t_5) < (0)) __PYX_ERR(54, 2470, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DM.pyx":2543
 * # --------------------------------------------------------------------
 * 
 * del DMType             # <<<<<<<<<<<<<<
 * del DMBoundaryType
 * del DMPolytopeType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMType) < (0)) __PYX_ERR(54, 2543, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2544
 * 
 * del DMType
 * del DMBoundaryType             # <<<<<<<<<<<<<<
 * del DMPolytopeType
 * del DMReorderDefaultFlag
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMBoundaryType) < (0)) __PYX_ERR(54, 2544, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2545
 * del DMType
 * del DMBoundaryType
 * del DMPolytopeType             # <<<<<<<<<<<<<<
 * del DMReorderDefaultFlag
 * 
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMPolytopeType) < (0)) __PYX_ERR(54, 2545, __pyx_L1_error)

  /* "petsc4py/PETSc/DM.pyx":2546
 * del DMBoundaryType
 * del DMPolytopeType
 * del DMReorderDefaultFlag             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMReorderDefaultFlag) < (0)) __PYX_ERR(54, 2546, __pyx_L1_error)

  /* "petsc4py/PETSc/DS.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class DSType(object):             # <<<<<<<<<<<<<<
 *     """The Discrete System types."""
 *     BASIC = S_(PETSCDSBASIC)
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[170]); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_DSType, __pyx_mstate_global->__pyx_n_u_DSType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_Discrete_System_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(55, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[170]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[170]) < 0))) __PYX_ERR(55, 3, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DS.pyx":5
 * class DSType(object):
 *     """The Discrete System types."""
 *     BASIC = S_(PETSCDSBASIC)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCDSBASIC); if (unlikely(!__pyx_t_14)) __PYX_ERR(55, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BASIC, __pyx_t_14) < (0)) __PYX_ERR(55, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DS.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class DSType(object):             # <<<<<<<<<<<<<<
 *     """The Discrete System types."""
 *     BASIC = S_(PETSCDSBASIC)
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DSType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(55, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DSType, __pyx_t_14) < (0)) __PYX_ERR(55, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DS.pyx":13
 *     """Discrete System object."""
 * 
 *     Type = DSType             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DSType); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_5) < (0)) __PYX_ERR(55, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DS.pyx":21
 *         self.ds  = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View a discrete system.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(55, 21, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DS_3view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DS_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1571])); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_4) < (0)) __PYX_ERR(55, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DS.pyx":40
 *         CHKERR(PetscDSView(self.ds, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the discrete system.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(55, 40, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DS_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DS_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1572])); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_5) < (0)) __PYX_ERR(55, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DS.pyx":53
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an empty DS.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(55, 53, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(55, 53, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DS_7create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DS_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1573])); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_4) < (0)) __PYX_ERR(55, 53, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DS.pyx":76
 *         return self
 * 
 *     def setType(self, ds_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Build a particular type of a discrete system.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ds_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(55, 76, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(55, 76, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DS_9setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DS_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1574])); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_5) < (0)) __PYX_ERR(55, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DS.pyx":95
 *         CHKERR(PetscDSSetType(self.ds, cval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the discrete system.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(55, 95, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DS_11getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DS_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1575])); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_4) < (0)) __PYX_ERR(55, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DS.pyx":109
 *         return bytes2str(cval)
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set parameters in a `DS` from the options database.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(55, 109, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DS_13setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DS_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1576])); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_5) < (0)) __PYX_ERR(55, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DS.pyx":121
 *         CHKERR(PetscDSSetFromOptions(self.ds))
 * 
 *     def setUp(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Construct data structures for the discrete system.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(55, 121, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DS_15setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DS_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1577])); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_4) < (0)) __PYX_ERR(55, 121, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DS.pyx":136
 *     #
 * 
 *     def getSpatialDimension(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the spatial dimension of the DS.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(55, 136, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DS_17getSpatialDimension, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DS_getSpatialDimension, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1578])); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_getSpatialDimension, __pyx_t_5) < (0)) __PYX_ERR(55, 136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DS.pyx":153
 *         return toInt(dim)
 * 
 *     def getCoordinateDimension(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the coordinate dimension of the DS.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(55, 153, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DS_19getCoordinateDimension, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DS_getCoordinateDimension, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1579])); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_getCoordinateDimension, __pyx_t_4) < (0)) __PYX_ERR(55, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DS.pyx":170
 *         return toInt(dim)
 * 
 *     def getNumFields(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of fields in the DS.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(55, 170, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DS_21getNumFields, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DS_getNumFields, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1580])); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_getNumFields, __pyx_t_5) < (0)) __PYX_ERR(55, 170, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DS.pyx":184
 *         return toInt(nf)
 * 
 *     def getFieldIndex(self, Object disc) -> int:             # <<<<<<<<<<<<<<
 *         """Return the index of the given field.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(55, 184, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DS_23getFieldIndex, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DS_getFieldIndex, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1581])); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_getFieldIndex, __pyx_t_4) < (0)) __PYX_ERR(55, 184, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DS.pyx":203
 *         return toInt(field)
 * 
 *     def getTotalDimensions(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the total size of the approximation space for this system.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(55, 203, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DS_25getTotalDimensions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DS_getTotalDimensions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1582])); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_getTotalDimensions, __pyx_t_5) < (0)) __PYX_ERR(55, 203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DS.pyx":217
 *         return toInt(tdim)
 * 
 *     def getTotalComponents(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the total number of components in this system.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(55, 217, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DS_27getTotalComponents, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DS_getTotalComponents, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1583])); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_getTotalComponents, __pyx_t_4) < (0)) __PYX_ERR(55, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DS.pyx":231
 *         return toInt(tcmp)
 * 
 *     def getDimensions(self) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the size of the space for each field on an evaluation point.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(55, 231, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DS_29getDimensions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DS_getDimensions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1584])); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_getDimensions, __pyx_t_5) < (0)) __PYX_ERR(55, 231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DS.pyx":246
 *         return array_i(nf, dims)
 * 
 *     def getComponents(self) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the number of components for each field on an evaluation point.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(55, 246, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DS_31getComponents, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DS_getComponents, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1585])); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_getComponents, __pyx_t_4) < (0)) __PYX_ERR(55, 246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DS.pyx":261
 *         return array_i(nf, cmps)
 * 
 *     def setDiscretisation(self, f: int, disc: Object) -> None:             # <<<<<<<<<<<<<<
 *         """Set the discretization object for the given field.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(55, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_f, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(55, 261, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_disc, __pyx_mstate_global->__pyx_n_u_Object) < (0)) __PYX_ERR(55, 261, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(55, 261, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_2DS_33setDiscretisation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DS_setDiscretisation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1586])); if (unlikely(!__pyx_t_5)) __PYX_ERR(55, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DS, __pyx_mstate_global->__pyx_n_u_setDiscretisation, __pyx_t_5) < (0)) __PYX_ERR(55, 261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DS.pyx":284
 * # --------------------------------------------------------------------
 * 
 * del DSType             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DSType) < (0)) __PYX_ERR(55, 284, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class DMDAStencilType(object):             # <<<<<<<<<<<<<<
 *     """Stencil types."""
 *     STAR = DMDA_STENCIL_STAR
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[172]); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMDAStencilType, __pyx_mstate_global->__pyx_n_u_DMDAStencilType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Stencil_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(56, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[172]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[172]) < 0))) __PYX_ERR(56, 3, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DMDA.pyx":5
 * class DMDAStencilType(object):
 *     """Stencil types."""
 *     STAR = DMDA_STENCIL_STAR             # <<<<<<<<<<<<<<
 *     BOX  = DMDA_STENCIL_BOX
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMDAStencilType(DMDA_STENCIL_STAR); if (unlikely(!__pyx_t_14)) __PYX_ERR(56, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_STAR, __pyx_t_14) < (0)) __PYX_ERR(56, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":6
 *     """Stencil types."""
 *     STAR = DMDA_STENCIL_STAR
 *     BOX  = DMDA_STENCIL_BOX             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMDAStencilType(DMDA_STENCIL_BOX); if (unlikely(!__pyx_t_14)) __PYX_ERR(56, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BOX, __pyx_t_14) < (0)) __PYX_ERR(56, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class DMDAStencilType(object):             # <<<<<<<<<<<<<<
 *     """Stencil types."""
 *     STAR = DMDA_STENCIL_STAR
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMDAStencilType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(56, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DMDAStencilType, __pyx_t_14) < (0)) __PYX_ERR(56, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":9
 * 
 * 
 * class DMDAInterpolationType(object):             # <<<<<<<<<<<<<<
 *     """Interpolation types."""
 *     Q0 = DMDA_INTERPOLATION_Q0
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[174]); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMDAInterpolationType, __pyx_mstate_global->__pyx_n_u_DMDAInterpolationType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Interpolation_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(56, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[174]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[174]) < 0))) __PYX_ERR(56, 9, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DMDA.pyx":11
 * class DMDAInterpolationType(object):
 *     """Interpolation types."""
 *     Q0 = DMDA_INTERPOLATION_Q0             # <<<<<<<<<<<<<<
 *     Q1 = DMDA_INTERPOLATION_Q1
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMDAInterpolationType(DMDA_Q0); if (unlikely(!__pyx_t_14)) __PYX_ERR(56, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_Q0, __pyx_t_14) < (0)) __PYX_ERR(56, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":12
 *     """Interpolation types."""
 *     Q0 = DMDA_INTERPOLATION_Q0
 *     Q1 = DMDA_INTERPOLATION_Q1             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMDAInterpolationType(DMDA_Q1); if (unlikely(!__pyx_t_14)) __PYX_ERR(56, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_Q1, __pyx_t_14) < (0)) __PYX_ERR(56, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":9
 * 
 * 
 * class DMDAInterpolationType(object):             # <<<<<<<<<<<<<<
 *     """Interpolation types."""
 *     Q0 = DMDA_INTERPOLATION_Q0
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMDAInterpolationType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(56, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DMDAInterpolationType, __pyx_t_14) < (0)) __PYX_ERR(56, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":15
 * 
 * 
 * class DMDAElementType(object):             # <<<<<<<<<<<<<<
 *     """Element types."""
 *     P1 = DMDA_ELEMENT_P1
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[176]); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMDAElementType, __pyx_mstate_global->__pyx_n_u_DMDAElementType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Element_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(56, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[176]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[176]) < 0))) __PYX_ERR(56, 15, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DMDA.pyx":17
 * class DMDAElementType(object):
 *     """Element types."""
 *     P1 = DMDA_ELEMENT_P1             # <<<<<<<<<<<<<<
 *     Q1 = DMDA_ELEMENT_Q1
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMDAElementType(DMDA_ELEMENT_P1); if (unlikely(!__pyx_t_14)) __PYX_ERR(56, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_P1, __pyx_t_14) < (0)) __PYX_ERR(56, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":18
 *     """Element types."""
 *     P1 = DMDA_ELEMENT_P1
 *     Q1 = DMDA_ELEMENT_Q1             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMDAElementType(DMDA_ELEMENT_Q1); if (unlikely(!__pyx_t_14)) __PYX_ERR(56, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_Q1, __pyx_t_14) < (0)) __PYX_ERR(56, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":15
 * 
 * 
 * class DMDAElementType(object):             # <<<<<<<<<<<<<<
 *     """Element types."""
 *     P1 = DMDA_ELEMENT_P1
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMDAElementType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(56, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DMDAElementType, __pyx_t_14) < (0)) __PYX_ERR(56, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":26
 *     """A DM object that is used to manage data for a structured grid."""
 * 
 *     StencilType       = DMDAStencilType             # <<<<<<<<<<<<<<
 *     InterpolationType = DMDAInterpolationType
 *     ElementType       = DMDAElementType
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMDAStencilType); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_StencilType, __pyx_t_5) < (0)) __PYX_ERR(56, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":27
 * 
 *     StencilType       = DMDAStencilType
 *     InterpolationType = DMDAInterpolationType             # <<<<<<<<<<<<<<
 *     ElementType       = DMDAElementType
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMDAInterpolationType); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_InterpolationType, __pyx_t_5) < (0)) __PYX_ERR(56, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":28
 *     StencilType       = DMDAStencilType
 *     InterpolationType = DMDAInterpolationType
 *     ElementType       = DMDAElementType             # <<<<<<<<<<<<<<
 * 
 *     #
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMDAElementType); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_ElementType, __pyx_t_5) < (0)) __PYX_ERR(56, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":32
 *     #
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int | None = None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_dim, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(56, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_dof, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(56, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sizes, __pyx_mstate_global->__pyx_kp_u_DimsSpec_None) < (0)) __PYX_ERR(56, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_proc_sizes, __pyx_mstate_global->__pyx_kp_u_DimsSpec_None) < (0)) __PYX_ERR(56, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_boundary_type, __pyx_mstate_global->__pyx_kp_u_tuple_DM_BoundaryType_int_str_bo) < (0)) __PYX_ERR(56, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stencil_type, __pyx_mstate_global->__pyx_kp_u_StencilType_None) < (0)) __PYX_ERR(56, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stencil_width, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(56, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_setup, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(56, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ownership_ranges, __pyx_mstate_global->__pyx_kp_u_tuple_Sequence_int_None) < (0)) __PYX_ERR(56, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(56, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(56, 32, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_1create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1587])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[177]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_4) < (0)) __PYX_ERR(56, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":148
 *         return self
 * 
 *     def duplicate(             # <<<<<<<<<<<<<<
 *         self,
 *         dof: int | None = None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dof, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(56, 148, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_boundary_type, __pyx_mstate_global->__pyx_kp_u_tuple_DM_BoundaryType_int_str_bo) < (0)) __PYX_ERR(56, 148, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_stencil_type, __pyx_mstate_global->__pyx_kp_u_StencilType_None) < (0)) __PYX_ERR(56, 148, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_stencil_width, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(56, 148, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DMDA) < (0)) __PYX_ERR(56, 148, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_3duplicate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_duplicate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1588])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_duplicate, __pyx_t_5) < (0)) __PYX_ERR(56, 148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":217
 *     #
 * 
 *     def setDim(self, dim: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the topological dimension.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_dim, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(56, 217, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(56, 217, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_5setDim, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_setDim, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1589])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_setDim, __pyx_t_4) < (0)) __PYX_ERR(56, 217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":234
 *         return self.setDimension(dim)
 * 
 *     def getDim(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the topological dimension.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(56, 234, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_7getDim, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getDim, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1590])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getDim, __pyx_t_5) < (0)) __PYX_ERR(56, 234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":246
 *         return self.getDimension()
 * 
 *     def setDof(self, dof: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of degrees of freedom per vertex.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_dof, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(56, 246, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(56, 246, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_9setDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_setDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1591])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_setDof, __pyx_t_4) < (0)) __PYX_ERR(56, 246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":264
 *         CHKERR(DMDASetDof(self.dm, ndof))
 * 
 *     def getDof(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of degrees of freedom per node.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(56, 264, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_11getDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1592])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getDof, __pyx_t_5) < (0)) __PYX_ERR(56, 264, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":284
 *         return toInt(dof)
 * 
 *     def setSizes(self, sizes: DimsSpec) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of grid points in each dimension.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sizes, __pyx_mstate_global->__pyx_n_u_DimsSpec) < (0)) __PYX_ERR(56, 284, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(56, 284, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_13setSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_setSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1593])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_setSizes, __pyx_t_4) < (0)) __PYX_ERR(56, 284, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":311
 *         CHKERR(DMDASetSizes(self.dm, M, N, P))
 * 
 *     def getSizes(self) -> tuple[int, ...]:             # <<<<<<<<<<<<<<
 *         """Return the number of grid points in each dimension.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int) < (0)) __PYX_ERR(56, 311, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_15getSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1594])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getSizes, __pyx_t_5) < (0)) __PYX_ERR(56, 311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":334
 *         return toDims(dim, M, N, P)
 * 
 *     def setProcSizes(self, proc_sizes: DimsSpec) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of processes in each dimension.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_proc_sizes, __pyx_mstate_global->__pyx_n_u_DimsSpec) < (0)) __PYX_ERR(56, 334, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(56, 334, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_17setProcSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_setProcSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1595])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_setProcSizes, __pyx_t_4) < (0)) __PYX_ERR(56, 334, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":361
 *         CHKERR(DMDASetNumProcs(self.dm, m, n, p))
 * 
 *     def getProcSizes(self) -> tuple[int, ...]:             # <<<<<<<<<<<<<<
 *         """Return the number of processes in each dimension.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int) < (0)) __PYX_ERR(56, 361, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_19getProcSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getProcSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1596])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getProcSizes, __pyx_t_5) < (0)) __PYX_ERR(56, 361, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":384
 *         return toDims(dim, m, n, p)
 * 
 *     def setBoundaryType(             # <<<<<<<<<<<<<<
 *         self,
 *         boundary_type: tuple[DM.BoundaryType | int | str | bool, ...]) -> None:
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_boundary_type, __pyx_mstate_global->__pyx_kp_u_tuple_DM_BoundaryType_int_str_bo_2) < (0)) __PYX_ERR(56, 384, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(56, 384, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_21setBoundaryType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_setBoundaryType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1597])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_setBoundaryType, __pyx_t_4) < (0)) __PYX_ERR(56, 384, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":407
 *         CHKERR(DMDASetBoundaryType(self.dm, btx, bty, btz))
 * 
 *     def getBoundaryType(self) -> tuple[DM.BoundaryType, ...]:             # <<<<<<<<<<<<<<
 *         """Return the type of ghost nodes at boundary in each dimension.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_DM_BoundaryType) < (0)) __PYX_ERR(56, 407, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_23getBoundaryType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getBoundaryType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1598])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getBoundaryType, __pyx_t_5) < (0)) __PYX_ERR(56, 407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":430
 *         return toDims(dim, btx, bty, btz)
 * 
 *     def setStencilType(self, stencil_type: StencilType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the stencil type.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stencil_type, __pyx_mstate_global->__pyx_n_u_StencilType) < (0)) __PYX_ERR(56, 430, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(56, 430, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_25setStencilType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_setStencilType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1599])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_setStencilType, __pyx_t_4) < (0)) __PYX_ERR(56, 430, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":448
 *         CHKERR(DMDASetStencilType(self.dm, stype))
 * 
 *     def getStencilType(self) -> StencilType:             # <<<<<<<<<<<<<<
 *         """Return the stencil type.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_StencilType) < (0)) __PYX_ERR(56, 448, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_27getStencilType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getStencilType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1600])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getStencilType, __pyx_t_5) < (0)) __PYX_ERR(56, 448, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":468
 *         return stype
 * 
 *     def setStencilWidth(self, stencil_width: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the stencil width.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stencil_width, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(56, 468, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(56, 468, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_29setStencilWidth, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_setStencilWidth, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1601])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_setStencilWidth, __pyx_t_4) < (0)) __PYX_ERR(56, 468, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":486
 *         CHKERR(DMDASetStencilWidth(self.dm, swidth))
 * 
 *     def getStencilWidth(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the stencil width.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(56, 486, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_31getStencilWidth, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getStencilWidth, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1602])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getStencilWidth, __pyx_t_5) < (0)) __PYX_ERR(56, 486, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":506
 *         return toInt(swidth)
 * 
 *     def setStencil(             # <<<<<<<<<<<<<<
 *         self,
 *         stencil_type: StencilType,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stencil_type, __pyx_mstate_global->__pyx_n_u_StencilType) < (0)) __PYX_ERR(56, 506, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stencil_width, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(56, 506, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(56, 506, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_33setStencil, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_setStencil, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1603])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_setStencil, __pyx_t_4) < (0)) __PYX_ERR(56, 506, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":532
 *         CHKERR(DMDASetStencilWidth(self.dm, swidth))
 * 
 *     def getStencil(self) -> tuple[StencilType, int]:             # <<<<<<<<<<<<<<
 *         """Return the stencil type and width.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_StencilType_int) < (0)) __PYX_ERR(56, 532, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_35getStencil, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getStencil, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1604])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getStencil, __pyx_t_5) < (0)) __PYX_ERR(56, 532, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":555
 *     #
 * 
 *     def getRanges(self) -> tuple[tuple[int, int], ...]:             # <<<<<<<<<<<<<<
 *         """Return the ranges of the owned local region in each dimension.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_tuple_int_int) < (0)) __PYX_ERR(56, 555, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_37getRanges, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getRanges, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1605])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getRanges, __pyx_t_4) < (0)) __PYX_ERR(56, 555, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":577
 *                 (toInt(z), toInt(z+p)))[:<Py_ssize_t>dim]
 * 
 *     def getGhostRanges(self) -> tuple[tuple[int, int], ...]:             # <<<<<<<<<<<<<<
 *         """Return the ranges of the local region in each dimension, including ghost nodes.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_tuple_int_int) < (0)) __PYX_ERR(56, 577, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_39getGhostRanges, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getGhostRanges, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1606])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getGhostRanges, __pyx_t_5) < (0)) __PYX_ERR(56, 577, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":597
 *                 (toInt(z), toInt(z+p)))[:<Py_ssize_t>dim]
 * 
 *     def getOwnershipRanges(self) -> tuple[ArrayInt, ...]:             # <<<<<<<<<<<<<<
 *         """Return the ranges of indices in each dimension owned by each process.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_ArrayInt) < (0)) __PYX_ERR(56, 597, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_41getOwnershipRanges, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getOwnershipRanges, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1607])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getOwnershipRanges, __pyx_t_4) < (0)) __PYX_ERR(56, 597, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":622
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_tuple_int_tuple_int) < (0)) __PYX_ERR(56, 622, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_43getCorners, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getCorners, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1608])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getCorners, __pyx_t_5) < (0)) __PYX_ERR(56, 622, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":651
 *                 (toInt(m), toInt(n), toInt(p))[:<Py_ssize_t>dim])
 * 
 *     def getGhostCorners(self) -> tuple[tuple[int, ...], tuple[int, ...]]:             # <<<<<<<<<<<<<<
 *         """Return the lower left corner and the size of the ghosted local region.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_tuple_int_tuple_int) < (0)) __PYX_ERR(56, 651, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_45getGhostCorners, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getGhostCorners, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1609])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getGhostCorners, __pyx_t_4) < (0)) __PYX_ERR(56, 651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":675
 *     #
 * 
 *     def setFieldName(self, field: int, name: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the name of individual field components.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(56, 675, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(56, 675, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(56, 675, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_47setFieldName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_setFieldName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1610])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_setFieldName, __pyx_t_5) < (0)) __PYX_ERR(56, 675, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":699
 *         CHKERR(DMDASetFieldName(self.dm, ival, cval))
 * 
 *     def getFieldName(self, field: int) -> str:             # <<<<<<<<<<<<<<
 *         """Return the name of an individual field component.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(56, 699, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(56, 699, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_49getFieldName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getFieldName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1611])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getFieldName, __pyx_t_4) < (0)) __PYX_ERR(56, 699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":723
 *     #
 * 
 *     def getVecArray(self, Vec vec, readonly: bool = False) -> Any:             # <<<<<<<<<<<<<<
 *         """Get access to the vector as laid out on a N-d grid.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_readonly, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(56, 723, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(56, 723, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_51getVecArray, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getVecArray, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1612])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getVecArray, __pyx_t_5) < (0)) __PYX_ERR(56, 723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":744
 *     #
 * 
 *     def setUniformCoordinates(             # <<<<<<<<<<<<<<
 *         self,
 *         xmin: float = 0,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_xmin, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(56, 744, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_xmax, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(56, 744, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ymin, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(56, 744, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ymax, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(56, 744, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_zmin, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(56, 744, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_zmax, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(56, 744, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(56, 744, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_53setUniformCoordinates, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_setUniformCoordinates, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1613])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[178]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_setUniformCoordinates, __pyx_t_4) < (0)) __PYX_ERR(56, 744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":788
 *                                          _zmin, _zmax))
 * 
 *     def setCoordinateName(self, index: int, name: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the name of the coordinate dimension.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_index, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(56, 788, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(56, 788, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(56, 788, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_55setCoordinateName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_setCoordinateName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1614])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_setCoordinateName, __pyx_t_5) < (0)) __PYX_ERR(56, 788, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":810
 *         CHKERR(DMDASetCoordinateName(self.dm, ival, cval))
 * 
 *     def getCoordinateName(self, index: int) -> str:             # <<<<<<<<<<<<<<
 *         """Return the name of a coordinate dimension.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_index, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(56, 810, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(56, 810, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_57getCoordinateName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getCoordinateName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1615])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getCoordinateName, __pyx_t_4) < (0)) __PYX_ERR(56, 810, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":832
 *     #
 * 
 *     def createNaturalVec(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Create a vector that will hold values in the natural numbering.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(56, 832, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_59createNaturalVec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_createNaturalVec, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1616])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_createNaturalVec, __pyx_t_5) < (0)) __PYX_ERR(56, 832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":849
 *         return vn
 * 
 *     def globalToNatural(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec vg,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_kp_u_InsertMode_None) < (0)) __PYX_ERR(56, 849, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(56, 849, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_61globalToNatural, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_globalToNatural, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1617])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_globalToNatural, __pyx_t_4) < (0)) __PYX_ERR(56, 849, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":879
 *         CHKERR(DMDAGlobalToNaturalEnd(self.dm, vg.vec, im, vn.vec))
 * 
 *     def naturalToGlobal(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec vn,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_kp_u_InsertMode_None) < (0)) __PYX_ERR(56, 879, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(56, 879, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_63naturalToGlobal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_naturalToGlobal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1618])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_naturalToGlobal, __pyx_t_5) < (0)) __PYX_ERR(56, 879, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":909
 *     #
 * 
 *     def getAO(self) -> AO:             # <<<<<<<<<<<<<<
 *         """Return the application ordering context for a distributed array.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_AO) < (0)) __PYX_ERR(56, 909, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_65getAO, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getAO, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1619])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getAO, __pyx_t_4) < (0)) __PYX_ERR(56, 909, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":930
 *         return ao
 * 
 *     def getScatter(self) -> tuple[Scatter, Scatter]:             # <<<<<<<<<<<<<<
 *         """Return the global-to-local, and local-to-local scatter contexts.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Scatter_Scatter) < (0)) __PYX_ERR(56, 930, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_67getScatter, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getScatter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1620])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getScatter, __pyx_t_5) < (0)) __PYX_ERR(56, 930, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":949
 *     #
 * 
 *     def setRefinementFactor(             # <<<<<<<<<<<<<<
 *         self,
 *         refine_x: int = 2,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_refine_x, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(56, 949, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_refine_y, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(56, 949, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_refine_z, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(56, 949, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(56, 949, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_69setRefinementFactor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_setRefinementFactor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1621])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[179]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_setRefinementFactor, __pyx_t_4) < (0)) __PYX_ERR(56, 949, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":981
 *                                        refine[2]))
 * 
 *     def getRefinementFactor(self) -> tuple[int, ...]:             # <<<<<<<<<<<<<<
 *         """Return the ratios that the DMDA grid is refined in each dimension.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int) < (0)) __PYX_ERR(56, 981, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_71getRefinementFactor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getRefinementFactor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1622])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getRefinementFactor, __pyx_t_5) < (0)) __PYX_ERR(56, 981, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":999
 *         return tuple([toInt(refine[i]) for 0 <= i < dim])
 * 
 *     def setInterpolationType(self, interp_type: InterpolationType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of interpolation.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_interp_type, __pyx_mstate_global->__pyx_n_u_InterpolationType) < (0)) __PYX_ERR(56, 999, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(56, 999, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_73setInterpolationType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_setInterpolationType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1623])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 999, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_setInterpolationType, __pyx_t_4) < (0)) __PYX_ERR(56, 999, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":1020
 *         CHKERR(DMDASetInterpolationType(self.dm, ival))
 * 
 *     def getInterpolationType(self) -> InterpolationType:             # <<<<<<<<<<<<<<
 *         """Return the type of interpolation.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 1020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_InterpolationType) < (0)) __PYX_ERR(56, 1020, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_75getInterpolationType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getInterpolationType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1624])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 1020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getInterpolationType, __pyx_t_5) < (0)) __PYX_ERR(56, 1020, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":1036
 *     #
 * 
 *     def setElementType(self, elem_type: ElementType | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the element type to be returned by `getElements`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 1036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_elem_type, __pyx_mstate_global->__pyx_kp_u_ElementType_str) < (0)) __PYX_ERR(56, 1036, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(56, 1036, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_77setElementType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_setElementType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1625])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 1036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_setElementType, __pyx_t_4) < (0)) __PYX_ERR(56, 1036, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":1050
 * 
 *     # FIXME: Return type
 *     def getElementType(self) -> ElementType:             # <<<<<<<<<<<<<<
 *         """Return the element type to be returned by `getElements`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ElementType) < (0)) __PYX_ERR(56, 1050, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_79getElementType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getElementType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1626])); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getElementType, __pyx_t_5) < (0)) __PYX_ERR(56, 1050, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":1064
 *         return <long>ival
 * 
 *     def getElements(self, elem_type: ElementType | None = None) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return an array containing the indices of all the local elements.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(56, 1064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_elem_type, __pyx_mstate_global->__pyx_kp_u_ElementType_None) < (0)) __PYX_ERR(56, 1064, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(56, 1064, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_4DMDA_81getElements, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMDA_getElements, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1627])); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 1064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_getElements, __pyx_t_4) < (0)) __PYX_ERR(56, 1064, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":1164
 * 
 *     # backward compatibility
 *     createNaturalVector = createNaturalVec             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_GetNameInClass(__pyx_t_4, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_createNaturalVec); if (unlikely(!__pyx_t_4)) __PYX_ERR(56, 1164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA, __pyx_mstate_global->__pyx_n_u_createNaturalVector, __pyx_t_4) < (0)) __PYX_ERR(56, 1164, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMDA.pyx":1168
 * 
 * # backward compatibility alias
 * DA = DMDA             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DA, ((PyObject *)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMDA)) < (0)) __PYX_ERR(56, 1168, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":1172
 * # --------------------------------------------------------------------
 * 
 * del DMDAStencilType             # <<<<<<<<<<<<<<
 * del DMDAInterpolationType
 * del DMDAElementType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMDAStencilType) < (0)) __PYX_ERR(56, 1172, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":1173
 * 
 * del DMDAStencilType
 * del DMDAInterpolationType             # <<<<<<<<<<<<<<
 * del DMDAElementType
 * 
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMDAInterpolationType) < (0)) __PYX_ERR(56, 1173, __pyx_L1_error)

  /* "petsc4py/PETSc/DMDA.pyx":1174
 * del DMDAStencilType
 * del DMDAInterpolationType
 * del DMDAElementType             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMDAElementType) < (0)) __PYX_ERR(56, 1174, __pyx_L1_error)

  /* "petsc4py/PETSc/DMPlex.pyx":14
 *     #
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `DMPlex` object, which encapsulates an unstructured mesh.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(57, 14, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(57, 14, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_1create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1628])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_5) < (0)) __PYX_ERR(57, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":35
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_dim, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 35, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_cells, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(57, 35, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_coords, __pyx_mstate_global->__pyx_kp_u_Sequence_float) < (0)) __PYX_ERR(57, 35, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_interpolate, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 35, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(57, 35, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(57, 35, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_3createFromCellList, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createFromCellList, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1629])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[180]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createFromCellList, __pyx_t_4) < (0)) __PYX_ERR(57, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":90
 *         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, localizationHeight: int | None = 0, sparseLocalize: bool | None = True, comm: Comm | None = None) -> Self:
 *         """Create a mesh on the tensor product of intervals.
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_faces, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(57, 90, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_lower, __pyx_mstate_global->__pyx_kp_u_Sequence_float_None) < (0)) __PYX_ERR(57, 90, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_upper, __pyx_mstate_global->__pyx_kp_u_Sequence_float_None) < (0)) __PYX_ERR(57, 90, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_simplex, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 90, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_periodic, __pyx_mstate_global->__pyx_kp_u_Sequence_str_int_bool_None) < (0)) __PYX_ERR(57, 90, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_interpolate, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 90, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_localizationHeight, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(57, 90, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sparseLocalize, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 90, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(57, 90, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(57, 90, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_5createBoxMesh, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createBoxMesh, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1630])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[181]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createBoxMesh, __pyx_t_5) < (0)) __PYX_ERR(57, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "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.
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_faces, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(57, 149, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_lower, __pyx_mstate_global->__pyx_kp_u_Sequence_float_None) < (0)) __PYX_ERR(57, 149, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_upper, __pyx_mstate_global->__pyx_kp_u_Sequence_float_None) < (0)) __PYX_ERR(57, 149, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_interpolate, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 149, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(57, 149, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(57, 149, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_7createBoxSurfaceMesh, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createBoxSurfaceMesh, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1631])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[182]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createBoxSurfaceMesh, __pyx_t_4) < (0)) __PYX_ERR(57, 149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":192
 *         return self
 * 
 *     def createFromFile(self, filename: str, plexname: str | None = "unnamed", interpolate: bool | None = True, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create `DMPlex` from a file.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_filename, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(57, 192, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_plexname, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(57, 192, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_interpolate, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 192, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(57, 192, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(57, 192, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_9createFromFile, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createFromFile, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1632])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[183]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createFromFile, __pyx_t_5) < (0)) __PYX_ERR(57, 192, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_cgid, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 226, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_interpolate, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 226, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(57, 226, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(57, 226, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_11createCGNS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createCGNS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1633])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[180]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createCGNS, __pyx_t_4) < (0)) __PYX_ERR(57, 226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_filename, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(57, 254, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_interpolate, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 254, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(57, 254, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(57, 254, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_13createCGNSFromFile, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createCGNSFromFile, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1634])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[180]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createCGNSFromFile, __pyx_t_5) < (0)) __PYX_ERR(57, 254, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_filename, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(57, 283, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_interpolate, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 283, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(57, 283, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(57, 283, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_15createExodusFromFile, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createExodusFromFile, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1635])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[180]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createExodusFromFile, __pyx_t_4) < (0)) __PYX_ERR(57, 283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exoid, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 312, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_interpolate, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 312, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(57, 312, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(57, 312, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_17createExodus, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createExodus, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1636])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[180]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createExodus, __pyx_t_5) < (0)) __PYX_ERR(57, 312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_interpolate, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 339, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(57, 339, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(57, 339, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_19createGmsh, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createGmsh, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1637])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[180]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createGmsh, __pyx_t_4) < (0)) __PYX_ERR(57, 339, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":377
 *         return self
 * 
 *     def createCoordinateSpace(self, degree: int, localized: bool, project: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Create a finite element space for the coordinates.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_degree, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 377, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_localized, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 377, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_project, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 377, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 377, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_21createCoordinateSpace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createCoordinateSpace, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1638])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createCoordinateSpace, __pyx_t_5) < (0)) __PYX_ERR(57, 377, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":401
 *         CHKERR(DMPlexCreateCoordinateSpace(self.dm, cdegree, clocalized, cproject))
 * 
 *     def createCohesiveSubmesh(self, hasLagrange: bool, value: int) -> DMPlex:             # <<<<<<<<<<<<<<
 *         """Extract the hypersurface defined by one face of the cohesive cells.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_hasLagrange, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 401, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 401, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DMPlex) < (0)) __PYX_ERR(57, 401, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_23createCohesiveSubmesh, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createCohesiveSubmesh, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1639])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createCohesiveSubmesh, __pyx_t_4) < (0)) __PYX_ERR(57, 401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":424
 *         return subdm
 * 
 *     def createColoring(self, depth: int = 0, distance: int = 1) -> list:             # <<<<<<<<<<<<<<
 *         """Return the coloring of the connectivity graph of entities in the DMPlex.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_depth, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 424, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_distance, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 424, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_list) < (0)) __PYX_ERR(57, 424, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_25createColoring, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createColoring, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1640])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[39]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createColoring, __pyx_t_5) < (0)) __PYX_ERR(57, 424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":453
 *         return isets
 * 
 *     def filter(self, label: DMLabel | None = None, value: int | None = None, ignoreHalo: bool = False,             # <<<<<<<<<<<<<<
 *                sanitizeSubMesh: bool = False, comm: Comm | None = None) -> tuple[DMPlex, SF]:
 *         """Extract a subset of mesh cells defined by a label as a separate mesh.
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_label, __pyx_mstate_global->__pyx_kp_u_DMLabel_None) < (0)) __PYX_ERR(57, 453, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(57, 453, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ignoreHalo, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 453, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sanitizeSubMesh, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 453, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(57, 453, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_DMPlex_SF) < (0)) __PYX_ERR(57, 453, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_27filter, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_filter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1641])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[184]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_filter, __pyx_t_4) < (0)) __PYX_ERR(57, 453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":495
 *         return subdm, sf
 * 
 *     def getChart(self) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return the interval for all mesh points [``pStart``, ``pEnd``).
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(57, 495, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_29getChart, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getChart, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1642])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getChart, __pyx_t_5) < (0)) __PYX_ERR(57, 495, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":516
 *         return toInt(pStart), toInt(pEnd)
 * 
 *     def setChart(self, pStart: int, pEnd: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the interval for all mesh points [``pStart``, ``pEnd``).
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pStart, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 516, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pEnd, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 516, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 516, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_31setChart, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_setChart, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1643])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_setChart, __pyx_t_4) < (0)) __PYX_ERR(57, 516, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":537
 *         CHKERR(DMPlexSetChart(self.dm, cStart, cEnd))
 * 
 *     def getConeSize(self, p: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of in-edges for this point in the DAG.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 537, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 537, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_33getConeSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getConeSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1644])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getConeSize, __pyx_t_5) < (0)) __PYX_ERR(57, 537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":561
 *         return toInt(csize)
 * 
 *     def setConeSize(self, p: int, size: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of in-edges for this point in the DAG.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 561, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 561, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 561, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_35setConeSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_setConeSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1645])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_setConeSize, __pyx_t_4) < (0)) __PYX_ERR(57, 561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":586
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 586, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(57, 586, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_37getCone, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getCone, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1646])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getCone, __pyx_t_5) < (0)) __PYX_ERR(57, 586, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":612
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 612, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_cone, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(57, 612, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_orientation, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(57, 612, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 612, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_39setCone, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_setCone, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1647])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_setCone, __pyx_t_4) < (0)) __PYX_ERR(57, 612, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":651
 *             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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 651, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_conePos, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 651, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_conePoint, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 651, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 651, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_41insertCone, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_insertCone, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1648])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_insertCone, __pyx_t_5) < (0)) __PYX_ERR(57, 651, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":676
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 676, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_conePos, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 676, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_coneOrientation, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 676, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 676, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_43insertConeOrientation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_insertConeOrientation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1649])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_insertConeOrientation, __pyx_t_4) < (0)) __PYX_ERR(57, 676, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":701
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 701, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(57, 701, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_45getConeOrientation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getConeOrientation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1650])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getConeOrientation, __pyx_t_5) < (0)) __PYX_ERR(57, 701, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":727
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 727, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_orientation, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(57, 727, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 727, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_47setConeOrientation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_setConeOrientation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1651])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_setConeOrientation, __pyx_t_4) < (0)) __PYX_ERR(57, 727, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":758
 *         CHKERR(DMPlexSetConeOrientation(self.dm, cp, iorie))
 * 
 *     def setCellType(self, p: int, ctype: DM.PolytopeType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the polytope type of a given cell.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 758, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ctype, __pyx_mstate_global->__pyx_kp_u_DM_PolytopeType) < (0)) __PYX_ERR(57, 758, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 758, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_49setCellType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_setCellType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1652])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_setCellType, __pyx_t_5) < (0)) __PYX_ERR(57, 758, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":780
 *         CHKERR(DMPlexSetCellType(self.dm, cp, val))
 * 
 *     def getCellType(self, p: int) -> DM.PolytopeType:             # <<<<<<<<<<<<<<
 *         """Return the polytope type of a given cell.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 780, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_DM_PolytopeType) < (0)) __PYX_ERR(57, 780, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_51getCellType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getCellType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1653])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getCellType, __pyx_t_4) < (0)) __PYX_ERR(57, 780, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":801
 *         return toInt(ctype)
 * 
 *     def getCellTypeLabel(self) -> DMLabel:             # <<<<<<<<<<<<<<
 *         """Return the `DMLabel` recording the polytope type of each cell.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 801, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DMLabel) < (0)) __PYX_ERR(57, 801, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_53getCellTypeLabel, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getCellTypeLabel, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1654])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 801, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getCellTypeLabel, __pyx_t_5) < (0)) __PYX_ERR(57, 801, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":817
 *         return label
 * 
 *     def getSupportSize(self, p: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of out-edges for this point in the DAG.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 817, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 817, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_55getSupportSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getSupportSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1655])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getSupportSize, __pyx_t_4) < (0)) __PYX_ERR(57, 817, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":841
 *         return toInt(ssize)
 * 
 *     def setSupportSize(self, p: int, size: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of out-edges for this point in the DAG.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 841, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_size, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 841, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 841, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_57setSupportSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_setSupportSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1656])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_setSupportSize, __pyx_t_5) < (0)) __PYX_ERR(57, 841, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":866
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 866, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(57, 866, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_59getSupport, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getSupport, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1657])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getSupport, __pyx_t_4) < (0)) __PYX_ERR(57, 866, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":892
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 892, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_supp, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(57, 892, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 892, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_61setSupport, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_setSupport, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1658])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_setSupport, __pyx_t_5) < (0)) __PYX_ERR(57, 892, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":921
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(57, 921, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_63getMaxSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getMaxSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1659])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getMaxSizes, __pyx_t_4) < (0)) __PYX_ERR(57, 921, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":943
 *         return toInt(maxConeSize), toInt(maxSupportSize)
 * 
 *     def symmetrize(self) -> None:             # <<<<<<<<<<<<<<
 *         """Create support (out-edge) information from cone (in-edge) information.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 943, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_65symmetrize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_symmetrize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1660])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_symmetrize, __pyx_t_5) < (0)) __PYX_ERR(57, 943, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":956
 *         CHKERR(DMPlexSymmetrize(self.dm))
 * 
 *     def stratify(self) -> None:             # <<<<<<<<<<<<<<
 *         """Calculate the strata of DAG.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 956, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_67stratify, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_stratify, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1661])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_stratify, __pyx_t_4) < (0)) __PYX_ERR(57, 956, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":968
 *         CHKERR(DMPlexStratify(self.dm))
 * 
 *     def orient(self) -> None:             # <<<<<<<<<<<<<<
 *         """Give a consistent orientation to the input mesh.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 968, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_69orient, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_orient, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1662])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_orient, __pyx_t_5) < (0)) __PYX_ERR(57, 968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":980
 *         CHKERR(DMPlexOrient(self.dm))
 * 
 *     def getCellNumbering(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return a global cell numbering for all cells on this process.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(57, 980, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_71getCellNumbering, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getCellNumbering, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1663])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getCellNumbering, __pyx_t_4) < (0)) __PYX_ERR(57, 980, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":995
 *         return iset
 * 
 *     def getVertexNumbering(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return a global vertex numbering for all vertices on this process.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(57, 995, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_73getVertexNumbering, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getVertexNumbering, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1664])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getVertexNumbering, __pyx_t_5) < (0)) __PYX_ERR(57, 995, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1010
 *         return iset
 * 
 *     def createPointNumbering(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Create a global numbering for all points.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(57, 1010, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_75createPointNumbering, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createPointNumbering, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1665])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createPointNumbering, __pyx_t_4) < (0)) __PYX_ERR(57, 1010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1024
 *         return iset
 * 
 *     def getDepth(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the depth of the DAG representing this mesh.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 1024, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_77getDepth, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getDepth, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1666])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getDepth, __pyx_t_5) < (0)) __PYX_ERR(57, 1024, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1039
 *         return toInt(depth)
 * 
 *     def getDepthStratum(self, svalue: int) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return the bounds [``start``, ``end``) for all points at a certain depth.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_svalue, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 1039, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(57, 1039, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_79getDepthStratum, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getDepthStratum, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1667])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getDepthStratum, __pyx_t_4) < (0)) __PYX_ERR(57, 1039, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1066
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_svalue, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 1066, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(57, 1066, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_81getHeightStratum, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getHeightStratum, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1668])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getHeightStratum, __pyx_t_5) < (0)) __PYX_ERR(57, 1066, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1093
 *         return (toInt(sStart), toInt(sEnd))
 * 
 *     def getPointDepth(self, point: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the *depth* of a given point.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 1093, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 1093, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_83getPointDepth, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getPointDepth, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1669])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getPointDepth, __pyx_t_4) < (0)) __PYX_ERR(57, 1093, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1114
 *         return toInt(depth)
 * 
 *     def getPointHeight(self, point: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the *height* of a given point.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 1114, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 1114, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_85getPointHeight, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getPointHeight, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1670])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getPointHeight, __pyx_t_5) < (0)) __PYX_ERR(57, 1114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1135
 *         return toInt(height)
 * 
 *     def getMeet(self, points: Sequence[int]) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return an array for the meet of the set of points.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_points, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(57, 1135, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(57, 1135, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_87getMeet, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getMeet, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1671])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getMeet, __pyx_t_4) < (0)) __PYX_ERR(57, 1135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1161
 *             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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_points, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(57, 1161, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(57, 1161, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_89getJoin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getJoin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1672])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getJoin, __pyx_t_5) < (0)) __PYX_ERR(57, 1161, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1187
 *             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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_points, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(57, 1187, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(57, 1187, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_91getFullJoin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getFullJoin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1673])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getFullJoin, __pyx_t_4) < (0)) __PYX_ERR(57, 1187, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1213
 *             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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 1213, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_useCone, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 1213, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_ArrayInt_ArrayInt) < (0)) __PYX_ERR(57, 1213, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_93getTransitiveClosure, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getTransitiveClosure, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1674])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[76]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getTransitiveClosure, __pyx_t_5) < (0)) __PYX_ERR(57, 1213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1252
 *         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``.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 1252, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayScalar) < (0)) __PYX_ERR(57, 1252, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_95vecGetClosure, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_vecGetClosure, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1675])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_vecGetClosure, __pyx_t_4) < (0)) __PYX_ERR(57, 1252, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1280
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 1280, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayScalar) < (0)) __PYX_ERR(57, 1280, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_97getVecClosure, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getVecClosure, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1676])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getVecClosure, __pyx_t_5) < (0)) __PYX_ERR(57, 1280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1310
 *         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``.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 1310, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_values, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(57, 1310, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_kp_u_InsertModeSpec_None) < (0)) __PYX_ERR(57, 1310, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 1310, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_99setVecClosure, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_setVecClosure, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1677])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_setVecClosure, __pyx_t_4) < (0)) __PYX_ERR(57, 1310, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1342
 *         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``.
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 1342, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_values, __pyx_mstate_global->__pyx_kp_u_Sequence_Scalar) < (0)) __PYX_ERR(57, 1342, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_addv, __pyx_mstate_global->__pyx_kp_u_InsertModeSpec_None) < (0)) __PYX_ERR(57, 1342, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 1342, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_101setMatClosure, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_setMatClosure, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1678])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_setMatClosure, __pyx_t_5) < (0)) __PYX_ERR(57, 1342, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1379
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(57, 1379, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_interpolate, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 1379, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(57, 1379, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_103generate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_generate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1679])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[185]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_generate, __pyx_t_4) < (0)) __PYX_ERR(57, 1379, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1407
 *         return self
 * 
 *     def setTriangleOptions(self, opts: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the options used for the Triangle mesh generator.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_opts, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(57, 1407, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 1407, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_105setTriangleOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_setTriangleOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1680])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_setTriangleOptions, __pyx_t_5) < (0)) __PYX_ERR(57, 1407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1427
 *         CHKERR(DMPlexTriangleSetOptions(self.dm, copts))
 * 
 *     def setTetGenOptions(self, opts: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the options used for the Tetgen mesh generator.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_opts, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(57, 1427, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 1427, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_107setTetGenOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_setTetGenOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1681])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_setTetGenOptions, __pyx_t_4) < (0)) __PYX_ERR(57, 1427, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1447
 *         CHKERR(DMPlexTetgenSetOptions(self.dm, copts))
 * 
 *     def markBoundaryFaces(self, label: str, value: int | None = None) -> DMLabel:             # <<<<<<<<<<<<<<
 *         """Mark all faces on the boundary.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_label, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(57, 1447, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(57, 1447, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DMLabel) < (0)) __PYX_ERR(57, 1447, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_109markBoundaryFaces, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_markBoundaryFaces, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1682])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_markBoundaryFaces, __pyx_t_5) < (0)) __PYX_ERR(57, 1447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1474
 *         CHKERR(DMPlexMarkBoundaryFaces(self.dm, ival, clbl))
 * 
 *     def labelComplete(self, DMLabel label) -> None:             # <<<<<<<<<<<<<<
 *         """Add the transitive closure to the surface.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 1474, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_111labelComplete, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_labelComplete, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1683])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_labelComplete, __pyx_t_4) < (0)) __PYX_ERR(57, 1474, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1491
 *         CHKERR(DMPlexLabelComplete(self.dm, label.dmlabel))
 * 
 *     def labelCohesiveComplete(self, DMLabel label, DMLabel bdlabel, bdvalue: int,             # <<<<<<<<<<<<<<
 *                               flip: bool, split: bool, DMPlex subdm) -> None:
 *         """Add all other mesh pieces to complete the surface.
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_bdvalue, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 1491, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_flip, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 1491, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_split, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 1491, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 1491, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_113labelCohesiveComplete, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_labelCohesiveComplete, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1684])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_labelCohesiveComplete, __pyx_t_5) < (0)) __PYX_ERR(57, 1491, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1526
 *         CHKERR(DMPlexLabelCohesiveComplete(self.dm, label.dmlabel, bdlabel.dmlabel, val, flg, flg2, subdm.dm))
 * 
 *     def setAdjacencyUseAnchors(self, useAnchors: bool = True) -> None:             # <<<<<<<<<<<<<<
 *         """Define adjacency in the mesh using the point-to-point constraints.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_useAnchors, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 1526, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 1526, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_115setAdjacencyUseAnchors, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_setAdjacencyUseAnchors, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1685])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[76]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_setAdjacencyUseAnchors, __pyx_t_4) < (0)) __PYX_ERR(57, 1526, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1547
 *         CHKERR(DMPlexSetAdjacencyUseAnchors(self.dm, flag))
 * 
 *     def getAdjacencyUseAnchors(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Query whether adjacency in the mesh uses the point-to-point constraints.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 1547, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_117getAdjacencyUseAnchors, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getAdjacencyUseAnchors, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1686])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getAdjacencyUseAnchors, __pyx_t_5) < (0)) __PYX_ERR(57, 1547, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1562
 *         return toBool(flag)
 * 
 *     def getAdjacency(self, p: int) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return all points adjacent to the given point.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 1562, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(57, 1562, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_119getAdjacency, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getAdjacency, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1687])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getAdjacency, __pyx_t_4) < (0)) __PYX_ERR(57, 1562, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1587
 *         return adjacency
 * 
 *     def setPartitioner(self, Partitioner part) -> None:             # <<<<<<<<<<<<<<
 *         """Set the mesh partitioner.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 1587, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_121setPartitioner, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_setPartitioner, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1688])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_setPartitioner, __pyx_t_5) < (0)) __PYX_ERR(57, 1587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1605
 *         CHKERR(DMPlexSetPartitioner(self.dm, part.part))
 * 
 *     def getPartitioner(self) -> Partitioner:             # <<<<<<<<<<<<<<
 *         """Return the mesh partitioner.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Partitioner) < (0)) __PYX_ERR(57, 1605, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_123getPartitioner, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getPartitioner, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1689])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getPartitioner, __pyx_t_4) < (0)) __PYX_ERR(57, 1605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1622
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_entityDepth, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(57, 1622, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_useInitialGuess, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 1622, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_parallel, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 1622, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 1622, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_125rebalanceSharedPoints, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_rebalanceSharedPoints, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1690])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[186]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_rebalanceSharedPoints, __pyx_t_5) < (0)) __PYX_ERR(57, 1622, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1656
 *         return toBool(csuccess)
 * 
 *     def distribute(self, overlap: int | None = 0) -> SF | None:             # <<<<<<<<<<<<<<
 *         """Distribute the mesh and any associated sections.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_overlap, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(57, 1656, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_SF_None) < (0)) __PYX_ERR(57, 1656, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_127distribute, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_distribute, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1691])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[79]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_distribute, __pyx_t_4) < (0)) __PYX_ERR(57, 1656, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1684
 *             return sf
 * 
 *     def distributeOverlap(self, overlap: int | None = 0) -> SF:             # <<<<<<<<<<<<<<
 *         """Add partition overlap to a distributed non-overlapping `DMPlex`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_overlap, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(57, 1684, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SF) < (0)) __PYX_ERR(57, 1684, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_129distributeOverlap, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_distributeOverlap, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1692])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[79]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_distributeOverlap, __pyx_t_5) < (0)) __PYX_ERR(57, 1684, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1713
 *         return sf
 * 
 *     def isDistributed(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag indicating if the mesh is distributed.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 1713, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_131isDistributed, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_isDistributed, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1693])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_isDistributed, __pyx_t_4) < (0)) __PYX_ERR(57, 1713, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1727
 *         return toBool(flag)
 * 
 *     def isSimplex(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag indicating if the first cell is a simplex.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 1727, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_133isSimplex, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_isSimplex, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1694])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_isSimplex, __pyx_t_5) < (0)) __PYX_ERR(57, 1727, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1742
 *         return toBool(flag)
 * 
 *     def distributeGetDefault(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return a flag indicating whether the `DM` should be distributed by default.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 1742, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_135distributeGetDefault, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_distributeGetDefault, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1695])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_distributeGetDefault, __pyx_t_4) < (0)) __PYX_ERR(57, 1742, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1762
 *         return toBool(dist)
 * 
 *     def distributeSetDefault(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set flag indicating whether the `DMPlex` should be distributed by default.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 1762, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 1762, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_137distributeSetDefault, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_distributeSetDefault, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1696])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_distributeSetDefault, __pyx_t_5) < (0)) __PYX_ERR(57, 1762, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1782
 *         return
 * 
 *     def distributionSetName(self, name: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the name of the specific parallel distribution.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(57, 1782, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 1782, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_139distributionSetName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_distributionSetName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1697])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_distributionSetName, __pyx_t_4) < (0)) __PYX_ERR(57, 1782, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1803
 *         CHKERR(DMPlexDistributionSetName(self.dm, cname))
 * 
 *     def distributionGetName(self) -> str:             # <<<<<<<<<<<<<<
 *         """Retrieve the name of the specific parallel distribution.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(57, 1803, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_141distributionGetName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_distributionGetName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1698])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_distributionGetName, __pyx_t_5) < (0)) __PYX_ERR(57, 1803, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1823
 *         return bytes2str(cname)
 * 
 *     def interpolate(self) -> None:             # <<<<<<<<<<<<<<
 *         """Convert to a mesh with all intermediate faces, edges, etc.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 1823, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_143interpolate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_interpolate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1699])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_interpolate, __pyx_t_4) < (0)) __PYX_ERR(57, 1823, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1838
 *         CHKERR(PetscCLEAR(self.obj)); self.dm = newdm
 * 
 *     def uninterpolate(self) -> None:             # <<<<<<<<<<<<<<
 *         """Convert to a mesh with only cells and vertices.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 1838, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_145uninterpolate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_uninterpolate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1700])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_uninterpolate, __pyx_t_5) < (0)) __PYX_ERR(57, 1838, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1853
 *         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`.
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Section_Vec) < (0)) __PYX_ERR(57, 1853, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_147distributeField, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_distributeField, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1701])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_distributeField, __pyx_t_4) < (0)) __PYX_ERR(57, 1853, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1898
 *         return (newsec, newvec)
 * 
 *     def getMinRadius(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the minimum distance from any cell centroid to a face.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 1898, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_149getMinRadius, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getMinRadius, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1702])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getMinRadius, __pyx_t_5) < (0)) __PYX_ERR(57, 1898, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1912
 *         return asReal(cminradius)
 * 
 *     def createCoarsePointIS(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Create an `IS` covering the coarse `DMPlex` chart with the fine points as data.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(57, 1912, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_151createCoarsePointIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createCoarsePointIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1703])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createCoarsePointIS, __pyx_t_4) < (0)) __PYX_ERR(57, 1912, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":1932
 *         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:
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 1932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_numComp, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(57, 1932, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_numDof, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(57, 1932, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_bcField, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(57, 1932, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_bcComps, __pyx_mstate_global->__pyx_kp_u_Sequence_IS_None) < (0)) __PYX_ERR(57, 1932, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_bcPoints, __pyx_mstate_global->__pyx_kp_u_Sequence_IS_None) < (0)) __PYX_ERR(57, 1932, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Section) < (0)) __PYX_ERR(57, 1932, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_153createSection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createSection, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1704])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 1932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createSection, __pyx_t_5) < (0)) __PYX_ERR(57, 1932, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2008
 *         return sec
 * 
 *     def getPointLocal(self, point: int) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return location of point data in local `Vec`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 2008, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(57, 2008, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_155getPointLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getPointLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1705])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getPointLocal, __pyx_t_4) < (0)) __PYX_ERR(57, 2008, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2036
 *         return toInt(start), toInt(end)
 * 
 *     def getPointLocalField(self, point: int, field: int) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return location of point field data in local `Vec`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 2036, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 2036, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(57, 2036, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_157getPointLocalField, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getPointLocalField, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1706])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getPointLocalField, __pyx_t_5) < (0)) __PYX_ERR(57, 2036, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2067
 *         return toInt(start), toInt(end)
 * 
 *     def getPointGlobal(self, point: int) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return location of point data in global `Vec`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 2067, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(57, 2067, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_159getPointGlobal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getPointGlobal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1707])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getPointGlobal, __pyx_t_4) < (0)) __PYX_ERR(57, 2067, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2095
 *         return toInt(start), toInt(end)
 * 
 *     def getPointGlobalField(self, point: int, field: int) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return location of point field data in global `Vec`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 2095, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 2095, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(57, 2095, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_161getPointGlobalField, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getPointGlobalField, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1708])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getPointGlobalField, __pyx_t_5) < (0)) __PYX_ERR(57, 2095, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2126
 *         return toInt(start), toInt(end)
 * 
 *     def createClosureIndex(self, Section sec or None) -> None:             # <<<<<<<<<<<<<<
 *         """Calculate an index for ``sec`` for the closure operation.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2126, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_163createClosureIndex, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createClosureIndex, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1709])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createClosureIndex, __pyx_t_4) < (0)) __PYX_ERR(57, 2126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2148
 *     #
 * 
 *     def setRefinementUniform(self, refinementUniform: bool | None = True) -> None:             # <<<<<<<<<<<<<<
 *         """Set the flag for uniform refinement.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_refinementUniform, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 2148, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2148, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_165setRefinementUniform, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_setRefinementUniform, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1710])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[76]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_setRefinementUniform, __pyx_t_5) < (0)) __PYX_ERR(57, 2148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2168
 *         CHKERR(DMPlexSetRefinementUniform(self.dm, flag))
 * 
 *     def getRefinementUniform(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Retrieve the flag for uniform refinement.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 2168, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_167getRefinementUniform, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getRefinementUniform, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1711])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getRefinementUniform, __pyx_t_4) < (0)) __PYX_ERR(57, 2168, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2189
 *         return toBool(flag)
 * 
 *     def setRefinementLimit(self, refinementLimit: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum cell volume for refinement.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_refinementLimit, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 2189, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2189, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_169setRefinementLimit, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_setRefinementLimit, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1712])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_setRefinementLimit, __pyx_t_5) < (0)) __PYX_ERR(57, 2189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2209
 *         CHKERR(DMPlexSetRefinementLimit(self.dm, rval))
 * 
 *     def getRefinementLimit(self) -> float:             # <<<<<<<<<<<<<<
 *         """Retrieve the maximum cell volume for refinement.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 2209, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_171getRefinementLimit, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getRefinementLimit, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1713])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getRefinementLimit, __pyx_t_4) < (0)) __PYX_ERR(57, 2209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2225
 *         return toReal(rval)
 * 
 *     def getOrdering(self, otype: Mat.OrderingType) -> IS:             # <<<<<<<<<<<<<<
 *         """Calculate a reordering of the mesh.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_otype, __pyx_mstate_global->__pyx_kp_u_Mat_OrderingType) < (0)) __PYX_ERR(57, 2225, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(57, 2225, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_173getOrdering, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getOrdering, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1714])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getOrdering, __pyx_t_5) < (0)) __PYX_ERR(57, 2225, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2253
 *         return perm
 * 
 *     def permute(self, IS perm) -> DMPlex:             # <<<<<<<<<<<<<<
 *         """Reorder the mesh according to the input permutation.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DMPlex) < (0)) __PYX_ERR(57, 2253, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_175permute, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_permute, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1715])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_permute, __pyx_t_4) < (0)) __PYX_ERR(57, 2253, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2277
 *         return dm
 * 
 *     def reorderGetDefault(self) -> DM.ReorderDefaultFlag:             # <<<<<<<<<<<<<<
 *         """Return flag indicating whether the `DMPlex` should be reordered by default.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_DM_ReorderDefaultFlag) < (0)) __PYX_ERR(57, 2277, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_177reorderGetDefault, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_reorderGetDefault, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1716])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_reorderGetDefault, __pyx_t_5) < (0)) __PYX_ERR(57, 2277, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2291
 *         return reorder
 * 
 *     def reorderSetDefault(self, flag: DM.ReorderDefaultFlag) -> None:             # <<<<<<<<<<<<<<
 *         """Set flag indicating whether the DM should be reordered by default.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_kp_u_DM_ReorderDefaultFlag) < (0)) __PYX_ERR(57, 2291, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2291, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_179reorderSetDefault, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_reorderSetDefault, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1717])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_reorderSetDefault, __pyx_t_4) < (0)) __PYX_ERR(57, 2291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2312
 *     #
 * 
 *     def computeCellGeometryFVM(self, cell: int) -> tuple[float, ArrayReal, ArrayReal]:             # <<<<<<<<<<<<<<
 *         """Compute the volume for a given cell.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_cell, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 2312, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_float_ArrayReal_ArrayReal) < (0)) __PYX_ERR(57, 2312, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_181computeCellGeometryFVM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_computeCellGeometryFVM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1718])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_computeCellGeometryFVM, __pyx_t_5) < (0)) __PYX_ERR(57, 2312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2344
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_labelName, __pyx_mstate_global->__pyx_kp_u_str_None) < (0)) __PYX_ERR(57, 2344, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 2344, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_183constructGhostCells, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_constructGhostCells, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1719])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_constructGhostCells, __pyx_t_4) < (0)) __PYX_ERR(57, 2344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2373
 *         return toInt(numGhostCells)
 * 
 *     def getSubpointIS(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return an `IS` covering the entire subdm chart.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(57, 2373, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_185getSubpointIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getSubpointIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1720])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getSubpointIS, __pyx_t_5) < (0)) __PYX_ERR(57, 2373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2393
 *         return iset
 * 
 *     def getSubpointMap(self) -> DMLabel:             # <<<<<<<<<<<<<<
 *         """Return a `DMLabel` with point dimension as values.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DMLabel) < (0)) __PYX_ERR(57, 2393, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_187getSubpointMap, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getSubpointMap, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1721])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getSubpointMap, __pyx_t_4) < (0)) __PYX_ERR(57, 2393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2415
 *     # Metric
 * 
 *     def metricSetFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the object from the options database.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2415, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_189metricSetFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1722])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetFromOptions, __pyx_t_5) < (0)) __PYX_ERR(57, 2415, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2428
 *         CHKERR(DMPlexMetricSetFromOptions(self.dm))
 * 
 *     def metricSetUniform(self, uniform: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Record whether the metric is uniform or not.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_uniform, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 2428, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2428, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_191metricSetUniform, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetUniform, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1723])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetUniform, __pyx_t_4) < (0)) __PYX_ERR(57, 2428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2447
 *         CHKERR(DMPlexMetricSetUniform(self.dm, bval))
 * 
 *     def metricIsUniform(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag indicating whether the metric is uniform or not.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 2447, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_193metricIsUniform, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricIsUniform, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1724])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricIsUniform, __pyx_t_5) < (0)) __PYX_ERR(57, 2447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2462
 *         return toBool(uniform)
 * 
 *     def metricSetIsotropic(self, isotropic: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Record whether the metric is isotropic or not.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_isotropic, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 2462, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2462, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_195metricSetIsotropic, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetIsotropic, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1725])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetIsotropic, __pyx_t_4) < (0)) __PYX_ERR(57, 2462, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2481
 *         CHKERR(DMPlexMetricSetIsotropic(self.dm, bval))
 * 
 *     def metricIsIsotropic(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag indicating whether the metric is isotropic or not.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 2481, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_197metricIsIsotropic, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricIsIsotropic, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1726])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricIsIsotropic, __pyx_t_5) < (0)) __PYX_ERR(57, 2481, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2496
 *         return toBool(isotropic)
 * 
 *     def metricSetRestrictAnisotropyFirst(self, restrictAnisotropyFirst: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Record whether anisotropy is be restricted before normalization or after.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_restrictAnisotropyFirst, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 2496, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2496, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_199metricSetRestrictAnisotropyFirst, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetRestrictAnisotro, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1727])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetRestrictAnisotropyFirst, __pyx_t_4) < (0)) __PYX_ERR(57, 2496, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2515
 *         CHKERR(DMPlexMetricSetRestrictAnisotropyFirst(self.dm, bval))
 * 
 *     def metricRestrictAnisotropyFirst(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return ``true`` if anisotropy is restricted before normalization.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 2515, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_201metricRestrictAnisotropyFirst, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricRestrictAnisotropyF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1728])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricRestrictAnisotropyFirst, __pyx_t_5) < (0)) __PYX_ERR(57, 2515, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2530
 *         return toBool(restrictAnisotropyFirst)
 * 
 *     def metricSetNoInsertion(self, noInsert: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set the flag indicating whether node insertion should be turned off.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_noInsert, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 2530, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2530, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_203metricSetNoInsertion, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetNoInsertion, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1729])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetNoInsertion, __pyx_t_4) < (0)) __PYX_ERR(57, 2530, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2550
 *         CHKERR(DMPlexMetricSetNoInsertion(self.dm, bval))
 * 
 *     def metricNoInsertion(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag indicating whether node insertion and deletion are turned off.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 2550, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_205metricNoInsertion, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricNoInsertion, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1730])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricNoInsertion, __pyx_t_5) < (0)) __PYX_ERR(57, 2550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2566
 *         return toBool(noInsert)
 * 
 *     def metricSetNoSwapping(self, noSwap: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set the flag indicating whether facet swapping should be turned off.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_noSwap, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 2566, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2566, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_207metricSetNoSwapping, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetNoSwapping, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1731])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetNoSwapping, __pyx_t_4) < (0)) __PYX_ERR(57, 2566, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2586
 *         CHKERR(DMPlexMetricSetNoSwapping(self.dm, bval))
 * 
 *     def metricNoSwapping(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag indicating whether facet swapping is turned off.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 2586, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_209metricNoSwapping, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricNoSwapping, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1732])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricNoSwapping, __pyx_t_5) < (0)) __PYX_ERR(57, 2586, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2602
 *         return toBool(noSwap)
 * 
 *     def metricSetNoMovement(self, noMove: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set the flag indicating whether node movement should be turned off.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_noMove, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 2602, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2602, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_211metricSetNoMovement, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetNoMovement, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1733])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetNoMovement, __pyx_t_4) < (0)) __PYX_ERR(57, 2602, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2622
 *         CHKERR(DMPlexMetricSetNoMovement(self.dm, bval))
 * 
 *     def metricNoMovement(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag indicating whether node movement is turned off.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 2622, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_213metricNoMovement, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricNoMovement, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1734])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricNoMovement, __pyx_t_5) < (0)) __PYX_ERR(57, 2622, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2638
 *         return toBool(noMove)
 * 
 *     def metricSetNoSurf(self, noSurf: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set the flag indicating whether surface modification should be turned off.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_noSurf, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 2638, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2638, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_215metricSetNoSurf, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetNoSurf, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1735])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetNoSurf, __pyx_t_4) < (0)) __PYX_ERR(57, 2638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2658
 *         CHKERR(DMPlexMetricSetNoSurf(self.dm, bval))
 * 
 *     def metricNoSurf(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the flag indicating whether surface modification is turned off.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(57, 2658, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_217metricNoSurf, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricNoSurf, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1736])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricNoSurf, __pyx_t_5) < (0)) __PYX_ERR(57, 2658, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2674
 *         return toBool(noSurf)
 * 
 *     def metricSetVerbosity(self, verbosity: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the verbosity of the mesh adaptation package.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_verbosity, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 2674, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2674, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_219metricSetVerbosity, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetVerbosity, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1737])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetVerbosity, __pyx_t_4) < (0)) __PYX_ERR(57, 2674, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2693
 *         CHKERR(DMPlexMetricSetVerbosity(self.dm, ival))
 * 
 *     def metricGetVerbosity(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the verbosity of the mesh adaptation package.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 2693, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_221metricGetVerbosity, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricGetVerbosity, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1738])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricGetVerbosity, __pyx_t_5) < (0)) __PYX_ERR(57, 2693, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2713
 *         return toInt(verbosity)
 * 
 *     def metricSetNumIterations(self, numIter: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of parallel adaptation iterations.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_numIter, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 2713, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2713, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_223metricSetNumIterations, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetNumIterations, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1739])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetNumIterations, __pyx_t_4) < (0)) __PYX_ERR(57, 2713, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2732
 *         CHKERR(DMPlexMetricSetNumIterations(self.dm, ival))
 * 
 *     def metricGetNumIterations(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of parallel adaptation iterations.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(57, 2732, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_225metricGetNumIterations, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricGetNumIterations, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1740])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricGetNumIterations, __pyx_t_5) < (0)) __PYX_ERR(57, 2732, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2747
 *         return toInt(numIter)
 * 
 *     def metricSetMinimumMagnitude(self, h_min: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the minimum tolerated metric magnitude.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_h_min, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 2747, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2747, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_227metricSetMinimumMagnitude, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetMinimumMagnitude, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1741])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetMinimumMagnitude, __pyx_t_4) < (0)) __PYX_ERR(57, 2747, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2766
 *         CHKERR(DMPlexMetricSetMinimumMagnitude(self.dm, rval))
 * 
 *     def metricGetMinimumMagnitude(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the minimum tolerated metric magnitude.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 2766, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_229metricGetMinimumMagnitude, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricGetMinimumMagnitude, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1742])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricGetMinimumMagnitude, __pyx_t_5) < (0)) __PYX_ERR(57, 2766, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2781
 *         return toReal(h_min)
 * 
 *     def metricSetMaximumMagnitude(self, h_max: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum tolerated metric magnitude.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_h_max, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 2781, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2781, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_231metricSetMaximumMagnitude, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetMaximumMagnitude, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1743])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetMaximumMagnitude, __pyx_t_4) < (0)) __PYX_ERR(57, 2781, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2800
 *         CHKERR(DMPlexMetricSetMaximumMagnitude(self.dm, rval))
 * 
 *     def metricGetMaximumMagnitude(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the maximum tolerated metric magnitude.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 2800, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_233metricGetMaximumMagnitude, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricGetMaximumMagnitude, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1744])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricGetMaximumMagnitude, __pyx_t_5) < (0)) __PYX_ERR(57, 2800, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2815
 *         return toReal(h_max)
 * 
 *     def metricSetMaximumAnisotropy(self, a_max: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the maximum tolerated metric anisotropy.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_a_max, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 2815, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2815, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_235metricSetMaximumAnisotropy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetMaximumAnisotrop, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1745])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetMaximumAnisotropy, __pyx_t_4) < (0)) __PYX_ERR(57, 2815, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2834
 *         CHKERR(DMPlexMetricSetMaximumAnisotropy(self.dm, rval))
 * 
 *     def metricGetMaximumAnisotropy(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the maximum tolerated metric anisotropy.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 2834, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_237metricGetMaximumAnisotropy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricGetMaximumAnisotrop, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1746])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricGetMaximumAnisotropy, __pyx_t_5) < (0)) __PYX_ERR(57, 2834, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2849
 *         return toReal(a_max)
 * 
 *     def metricSetTargetComplexity(self, targetComplexity: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the target metric complexity.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_targetComplexity, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 2849, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2849, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_239metricSetTargetComplexity, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetTargetComplexity, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1747])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetTargetComplexity, __pyx_t_4) < (0)) __PYX_ERR(57, 2849, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2868
 *         CHKERR(DMPlexMetricSetTargetComplexity(self.dm, rval))
 * 
 *     def metricGetTargetComplexity(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the target metric complexity.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 2868, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_241metricGetTargetComplexity, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricGetTargetComplexity, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1748])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricGetTargetComplexity, __pyx_t_5) < (0)) __PYX_ERR(57, 2868, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2883
 *         return toReal(targetComplexity)
 * 
 *     def metricSetNormalizationOrder(self, p: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the order p for L-p normalization.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_p, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 2883, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2883, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_243metricSetNormalizationOrder, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetNormalizationOrd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1749])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetNormalizationOrder, __pyx_t_4) < (0)) __PYX_ERR(57, 2883, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2902
 *         CHKERR(DMPlexMetricSetNormalizationOrder(self.dm, rval))
 * 
 *     def metricGetNormalizationOrder(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the order p for L-p normalization.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 2902, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_245metricGetNormalizationOrder, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricGetNormalizationOrd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1750])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricGetNormalizationOrder, __pyx_t_5) < (0)) __PYX_ERR(57, 2902, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2917
 *         return toReal(p)
 * 
 *     def metricSetGradationFactor(self, beta: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the metric gradation factor.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_beta, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 2917, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2917, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_247metricSetGradationFactor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetGradationFactor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1751])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetGradationFactor, __pyx_t_4) < (0)) __PYX_ERR(57, 2917, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2936
 *         CHKERR(DMPlexMetricSetGradationFactor(self.dm, rval))
 * 
 *     def metricGetGradationFactor(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the metric gradation factor.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 2936, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_249metricGetGradationFactor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricGetGradationFactor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1752])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricGetGradationFactor, __pyx_t_5) < (0)) __PYX_ERR(57, 2936, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2951
 *         return toReal(beta)
 * 
 *     def metricSetHausdorffNumber(self, hausd: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the metric Hausdorff number.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_hausd, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 2951, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 2951, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_251metricSetHausdorffNumber, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricSetHausdorffNumber, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1753])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricSetHausdorffNumber, __pyx_t_4) < (0)) __PYX_ERR(57, 2951, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2970
 *         CHKERR(DMPlexMetricSetHausdorffNumber(self.dm, rval))
 * 
 *     def metricGetHausdorffNumber(self) -> float:             # <<<<<<<<<<<<<<
 *         """Return the metric Hausdorff number.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 2970, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_253metricGetHausdorffNumber, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricGetHausdorffNumber, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1754])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricGetHausdorffNumber, __pyx_t_5) < (0)) __PYX_ERR(57, 2970, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":2985
 *         return toReal(hausd)
 * 
 *     def metricCreate(self, field: int | None = 0) -> Vec:             # <<<<<<<<<<<<<<
 *         """Create a Riemannian metric field.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 2985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(57, 2985, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(57, 2985, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_255metricCreate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricCreate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1755])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 2985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[79]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricCreate, __pyx_t_4) < (0)) __PYX_ERR(57, 2985, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3006
 *         return metric
 * 
 *     def metricCreateUniform(self, alpha: float, field: int | None = 0) -> Vec:             # <<<<<<<<<<<<<<
 *         """Construct a uniform isotropic metric.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_alpha, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(57, 3006, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(57, 3006, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(57, 3006, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_257metricCreateUniform, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricCreateUniform, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1756])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[79]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricCreateUniform, __pyx_t_5) < (0)) __PYX_ERR(57, 3006, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3030
 *         return metric
 * 
 *     def metricCreateIsotropic(self, Vec indicator, field: int | None = 0) -> Vec:             # <<<<<<<<<<<<<<
 *         """Construct an isotropic metric from an error indicator.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(57, 3030, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(57, 3030, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_259metricCreateIsotropic, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricCreateIsotropic, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1757])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[79]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricCreateIsotropic, __pyx_t_4) < (0)) __PYX_ERR(57, 3030, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3053
 *         return metric
 * 
 *     def metricDeterminantCreate(self, field: int | None = 0) -> tuple[Vec, DM]:             # <<<<<<<<<<<<<<
 *         """Create the determinant field for a Riemannian metric.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_field, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(57, 3053, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Vec_DM) < (0)) __PYX_ERR(57, 3053, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_261metricDeterminantCreate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricDeterminantCreate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1758])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[79]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricDeterminantCreate, __pyx_t_5) < (0)) __PYX_ERR(57, 3053, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3082
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_restrictSizes, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 3082, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_restrictAnisotropy, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 3082, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Vec_Vec) < (0)) __PYX_ERR(57, 3082, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_263metricEnforceSPD, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricEnforceSPD, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1759])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[81]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricEnforceSPD, __pyx_t_4) < (0)) __PYX_ERR(57, 3082, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3118
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_restrictSizes, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 3118, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_restrictAnisotropy, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(57, 3118, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Vec_Vec) < (0)) __PYX_ERR(57, 3118, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_265metricNormalize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricNormalize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1760])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[187]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricNormalize, __pyx_t_5) < (0)) __PYX_ERR(57, 3118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3154
 *         return (ometric, determinant)
 * 
 *     def metricAverage2(self, Vec metric1, Vec metric2, Vec metricAvg) -> Vec:             # <<<<<<<<<<<<<<
 *         """Compute and return the unweighted average of two metrics.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(57, 3154, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_267metricAverage2, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricAverage2, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1761])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricAverage2, __pyx_t_4) < (0)) __PYX_ERR(57, 3154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3176
 *         return metricAvg
 * 
 *     def metricAverage3(self, Vec metric1, Vec metric2, Vec metric3, Vec metricAvg) -> Vec:             # <<<<<<<<<<<<<<
 *         """Compute and return the unweighted average of three metrics.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(57, 3176, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_269metricAverage3, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricAverage3, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1762])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricAverage3, __pyx_t_5) < (0)) __PYX_ERR(57, 3176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3200
 *         return metricAvg
 * 
 *     def metricIntersection2(self, Vec metric1, Vec metric2, Vec metricInt) -> Vec:             # <<<<<<<<<<<<<<
 *         """Compute and return the intersection of two metrics.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(57, 3200, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_271metricIntersection2, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricIntersection2, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1763])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricIntersection2, __pyx_t_4) < (0)) __PYX_ERR(57, 3200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3222
 *         return metricInt
 * 
 *     def metricIntersection3(self, Vec metric1, Vec metric2, Vec metric3, Vec metricInt) -> Vec:             # <<<<<<<<<<<<<<
 *         """Compute the intersection of three metrics.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(57, 3222, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_273metricIntersection3, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_metricIntersection3, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1764])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_metricIntersection3, __pyx_t_5) < (0)) __PYX_ERR(57, 3222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3246
 *         return metricInt
 * 
 *     def computeGradientClementInterpolant(self, Vec locX, Vec locC) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the L2 projection of the cellwise gradient of a function onto P1.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(57, 3246, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_275computeGradientClementInterpolant, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_computeGradientClementInt, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1765])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_computeGradientClementInterpolan, __pyx_t_4) < (0)) __PYX_ERR(57, 3246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3268
 *     # View
 * 
 *     def topologyView(self, Viewer viewer) -> None:             # <<<<<<<<<<<<<<
 *         """Save a `DMPlex` topology into a file.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3268, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_277topologyView, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_topologyView, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1766])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_topologyView, __pyx_t_5) < (0)) __PYX_ERR(57, 3268, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3286
 *         CHKERR(DMPlexTopologyView(self.dm, viewer.vwr))
 * 
 *     def coordinatesView(self, Viewer viewer) -> None:             # <<<<<<<<<<<<<<
 *         """Save `DMPlex` coordinates into a file.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3286, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_279coordinatesView, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_coordinatesView, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1767])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_coordinatesView, __pyx_t_4) < (0)) __PYX_ERR(57, 3286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3304
 *         CHKERR(DMPlexCoordinatesView(self.dm, viewer.vwr))
 * 
 *     def labelsView(self, Viewer viewer) -> None:             # <<<<<<<<<<<<<<
 *         """Save `DMPlex` labels into a file.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3304, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_281labelsView, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_labelsView, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1768])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_labelsView, __pyx_t_5) < (0)) __PYX_ERR(57, 3304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3322
 *         CHKERR(DMPlexLabelsView(self.dm, viewer.vwr))
 * 
 *     def sectionView(self, Viewer viewer, DM sectiondm) -> None:             # <<<<<<<<<<<<<<
 *         """Save a section associated with a `DMPlex`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3322, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_283sectionView, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_sectionView, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1769])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_sectionView, __pyx_t_4) < (0)) __PYX_ERR(57, 3322, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3343
 *         CHKERR(DMPlexSectionView(self.dm, viewer.vwr, sectiondm.dm))
 * 
 *     def globalVectorView(self, Viewer viewer, DM sectiondm, Vec vec) -> None:             # <<<<<<<<<<<<<<
 *         """Save a global vector.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3343, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_285globalVectorView, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_globalVectorView, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1770])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_globalVectorView, __pyx_t_5) < (0)) __PYX_ERR(57, 3343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3367
 *         CHKERR(DMPlexGlobalVectorView(self.dm, viewer.vwr, sectiondm.dm, vec.vec))
 * 
 *     def localVectorView(self, Viewer viewer, DM sectiondm, Vec vec) -> None:             # <<<<<<<<<<<<<<
 *         """Save a local vector.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3367, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_287localVectorView, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_localVectorView, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1771])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_localVectorView, __pyx_t_4) < (0)) __PYX_ERR(57, 3367, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3393
 *     # Load
 * 
 *     def topologyLoad(self, Viewer viewer) -> SF:             # <<<<<<<<<<<<<<
 *         """Load a topology into this `DMPlex` object.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SF) < (0)) __PYX_ERR(57, 3393, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_289topologyLoad, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_topologyLoad, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1772])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_topologyLoad, __pyx_t_5) < (0)) __PYX_ERR(57, 3393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3419
 *         return sf
 * 
 *     def coordinatesLoad(self, Viewer viewer, SF sfxc) -> None:             # <<<<<<<<<<<<<<
 *         """Load coordinates into this `DMPlex` object.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3419, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_291coordinatesLoad, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_coordinatesLoad, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1773])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_coordinatesLoad, __pyx_t_4) < (0)) __PYX_ERR(57, 3419, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3439
 *         CHKERR(DMPlexCoordinatesLoad(self.dm, viewer.vwr, sfxc.sf))
 * 
 *     def labelsLoad(self, Viewer viewer, SF sfxc) -> None:             # <<<<<<<<<<<<<<
 *         """Load labels into this `DMPlex` object.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3439, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_293labelsLoad, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_labelsLoad, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1774])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_labelsLoad, __pyx_t_5) < (0)) __PYX_ERR(57, 3439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3459
 *         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`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_SF_SF) < (0)) __PYX_ERR(57, 3459, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_295sectionLoad, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_sectionLoad, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1775])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_sectionLoad, __pyx_t_4) < (0)) __PYX_ERR(57, 3459, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3496
 *         return gsf, lsf
 * 
 *     def globalVectorLoad(self, Viewer viewer, DM sectiondm, SF sf, Vec vec) -> None:             # <<<<<<<<<<<<<<
 *         """Load on-disk vector data into a global vector.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3496, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_297globalVectorLoad, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_globalVectorLoad, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1776])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_globalVectorLoad, __pyx_t_5) < (0)) __PYX_ERR(57, 3496, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3521
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3521, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_299localVectorLoad, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_localVectorLoad, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1777])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_localVectorLoad, __pyx_t_4) < (0)) __PYX_ERR(57, 3521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3546
 *         CHKERR(DMPlexLocalVectorLoad(self.dm, viewer.vwr, sectiondm.dm, sf.sf, vec.vec))
 * 
 *     def createNaturalVec(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a natural vector.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(57, 3546, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_301createNaturalVec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createNaturalVec, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1778])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createNaturalVec, __pyx_t_5) < (0)) __PYX_ERR(57, 3546, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3560
 *         return nv
 * 
 *     def naturalToGlobalBegin(self, Vec nv, Vec gv) -> None:             # <<<<<<<<<<<<<<
 *         """Rearrange a `Vec` in the natural order to the Global order.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3560, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_303naturalToGlobalBegin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_naturalToGlobalBegin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1779])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_naturalToGlobalBegin, __pyx_t_4) < (0)) __PYX_ERR(57, 3560, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3572
 *         CHKERR(DMPlexNaturalToGlobalBegin(self.dm, nv.vec, gv.vec))
 * 
 *     def naturalToGlobalEnd(self, Vec nv, Vec gv) -> None:             # <<<<<<<<<<<<<<
 *         """Rearrange a `Vec` in the natural order to the Global order.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3572, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_305naturalToGlobalEnd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_naturalToGlobalEnd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1780])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_naturalToGlobalEnd, __pyx_t_5) < (0)) __PYX_ERR(57, 3572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3584
 *         CHKERR(DMPlexNaturalToGlobalEnd(self.dm, nv.vec, gv.vec))
 * 
 *     def globalToNaturalBegin(self, Vec gv, Vec nv) -> None:             # <<<<<<<<<<<<<<
 *         """Rearrange a `Vec` in the Global order to the natural order.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3584, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_307globalToNaturalBegin, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_globalToNaturalBegin, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1781])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_globalToNaturalBegin, __pyx_t_4) < (0)) __PYX_ERR(57, 3584, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3596
 *         CHKERR(DMPlexGlobalToNaturalBegin(self.dm, gv.vec, nv.vec))
 * 
 *     def globalToNaturalEnd(self, Vec gv, Vec nv) -> None:             # <<<<<<<<<<<<<<
 *         """Rearrange a `Vec` in the Global order to the natural order.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3596, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_309globalToNaturalEnd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_globalToNaturalEnd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1782])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_globalToNaturalEnd, __pyx_t_5) < (0)) __PYX_ERR(57, 3596, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3608
 *         CHKERR(DMPlexGlobalToNaturalEnd(self.dm, gv.vec, nv.vec))
 * 
 *     def setMigrationSF(self, SF sf) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `SF` for migrating from a parent `DM` into this `DM`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3608, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_311setMigrationSF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_setMigrationSF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1783])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_setMigrationSF, __pyx_t_4) < (0)) __PYX_ERR(57, 3608, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3620
 *         CHKERR(DMPlexSetMigrationSF(self.dm, sf.sf))
 * 
 *     def getMigrationSF(self) -> SF:             # <<<<<<<<<<<<<<
 *         """Get the `SF` for migrating from a parent `DM` into this `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SF) < (0)) __PYX_ERR(57, 3620, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_313getMigrationSF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_getMigrationSF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1784])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_getMigrationSF, __pyx_t_5) < (0)) __PYX_ERR(57, 3620, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3635
 *         return sf
 * 
 *     def createGlobalToNaturalSF(self, Section section, SF sfMigration) -> SF:             # <<<<<<<<<<<<<<
 *         """Create the `SF` for mapping Global `Vec` to the Natural `Vec`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SF) < (0)) __PYX_ERR(57, 3635, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_315createGlobalToNaturalSF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_createGlobalToNaturalSF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1785])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_createGlobalToNaturalSF, __pyx_t_4) < (0)) __PYX_ERR(57, 3635, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3649
 *         return sf
 * 
 *     def migrateGlobalToNaturalSF(self, DM dmOld, SF sfNaturalOld, SF sfMigration) -> SF:             # <<<<<<<<<<<<<<
 *         """Create the `SF` for mapping Global `Vec` to the Natural `Vec` in the new `DM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_SF) < (0)) __PYX_ERR(57, 3649, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMPlex_317migrateGlobalToNaturalSF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlex_migrateGlobalToNaturalSF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1786])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlex, __pyx_mstate_global->__pyx_n_u_migrateGlobalToNaturalSF, __pyx_t_5) < (0)) __PYX_ERR(57, 3649, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3666
 * 
 * 
 * class DMPlexTransformType(object):             # <<<<<<<<<<<<<<
 *     """Transformation types."""
 *     REFINEREGULAR = S_(DMPLEXREFINEREGULAR)
*/
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[189]); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMPlexTransformType, __pyx_mstate_global->__pyx_n_u_DMPlexTransformType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Transformation_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(57, 3666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_5 != __pyx_mstate_global->__pyx_tuple[189]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[189]) < 0))) __PYX_ERR(57, 3666, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DMPlex.pyx":3668
 * class DMPlexTransformType(object):
 *     """Transformation types."""
 *     REFINEREGULAR = S_(DMPLEXREFINEREGULAR)             # <<<<<<<<<<<<<<
 *     REFINEALFELD = S_(DMPLEXREFINEALFELD)
 *     REFINEPOWELLSABIN = S_(DMPLEXREFINEPOWELLSABIN)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXREFINEREGULAR); if (unlikely(!__pyx_t_14)) __PYX_ERR(57, 3668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_REFINEREGULAR, __pyx_t_14) < (0)) __PYX_ERR(57, 3668, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3669
 *     """Transformation types."""
 *     REFINEREGULAR = S_(DMPLEXREFINEREGULAR)
 *     REFINEALFELD = S_(DMPLEXREFINEALFELD)             # <<<<<<<<<<<<<<
 *     REFINEPOWELLSABIN = S_(DMPLEXREFINEPOWELLSABIN)
 *     REFINEBOUNDARYLAYER = S_(DMPLEXREFINEBOUNDARYLAYER)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXREFINEALFELD); if (unlikely(!__pyx_t_14)) __PYX_ERR(57, 3669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_REFINEALFELD, __pyx_t_14) < (0)) __PYX_ERR(57, 3669, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3670
 *     REFINEREGULAR = S_(DMPLEXREFINEREGULAR)
 *     REFINEALFELD = S_(DMPLEXREFINEALFELD)
 *     REFINEPOWELLSABIN = S_(DMPLEXREFINEPOWELLSABIN)             # <<<<<<<<<<<<<<
 *     REFINEBOUNDARYLAYER = S_(DMPLEXREFINEBOUNDARYLAYER)
 *     REFINESBR = S_(DMPLEXREFINESBR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXREFINEPOWELLSABIN); if (unlikely(!__pyx_t_14)) __PYX_ERR(57, 3670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_REFINEPOWELLSABIN, __pyx_t_14) < (0)) __PYX_ERR(57, 3670, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3671
 *     REFINEALFELD = S_(DMPLEXREFINEALFELD)
 *     REFINEPOWELLSABIN = S_(DMPLEXREFINEPOWELLSABIN)
 *     REFINEBOUNDARYLAYER = S_(DMPLEXREFINEBOUNDARYLAYER)             # <<<<<<<<<<<<<<
 *     REFINESBR = S_(DMPLEXREFINESBR)
 *     REFINETOBOX = S_(DMPLEXREFINETOBOX)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXREFINEBOUNDARYLAYER); if (unlikely(!__pyx_t_14)) __PYX_ERR(57, 3671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_REFINEBOUNDARYLAYER, __pyx_t_14) < (0)) __PYX_ERR(57, 3671, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3672
 *     REFINEPOWELLSABIN = S_(DMPLEXREFINEPOWELLSABIN)
 *     REFINEBOUNDARYLAYER = S_(DMPLEXREFINEBOUNDARYLAYER)
 *     REFINESBR = S_(DMPLEXREFINESBR)             # <<<<<<<<<<<<<<
 *     REFINETOBOX = S_(DMPLEXREFINETOBOX)
 *     REFINETOSIMPLEX = S_(DMPLEXREFINETOSIMPLEX)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXREFINESBR); if (unlikely(!__pyx_t_14)) __PYX_ERR(57, 3672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_REFINESBR, __pyx_t_14) < (0)) __PYX_ERR(57, 3672, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3673
 *     REFINEBOUNDARYLAYER = S_(DMPLEXREFINEBOUNDARYLAYER)
 *     REFINESBR = S_(DMPLEXREFINESBR)
 *     REFINETOBOX = S_(DMPLEXREFINETOBOX)             # <<<<<<<<<<<<<<
 *     REFINETOSIMPLEX = S_(DMPLEXREFINETOSIMPLEX)
 *     REFINE1D = S_(DMPLEXREFINE1D)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXREFINETOBOX); if (unlikely(!__pyx_t_14)) __PYX_ERR(57, 3673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_REFINETOBOX, __pyx_t_14) < (0)) __PYX_ERR(57, 3673, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3674
 *     REFINESBR = S_(DMPLEXREFINESBR)
 *     REFINETOBOX = S_(DMPLEXREFINETOBOX)
 *     REFINETOSIMPLEX = S_(DMPLEXREFINETOSIMPLEX)             # <<<<<<<<<<<<<<
 *     REFINE1D = S_(DMPLEXREFINE1D)
 *     EXTRUDE = S_(DMPLEXEXTRUDETYPE)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXREFINETOSIMPLEX); if (unlikely(!__pyx_t_14)) __PYX_ERR(57, 3674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_REFINETOSIMPLEX, __pyx_t_14) < (0)) __PYX_ERR(57, 3674, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3675
 *     REFINETOBOX = S_(DMPLEXREFINETOBOX)
 *     REFINETOSIMPLEX = S_(DMPLEXREFINETOSIMPLEX)
 *     REFINE1D = S_(DMPLEXREFINE1D)             # <<<<<<<<<<<<<<
 *     EXTRUDE = S_(DMPLEXEXTRUDETYPE)
 *     TRANSFORMFILTER = S_(DMPLEXTRANSFORMFILTER)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXREFINE1D); if (unlikely(!__pyx_t_14)) __PYX_ERR(57, 3675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_REFINE1D, __pyx_t_14) < (0)) __PYX_ERR(57, 3675, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3676
 *     REFINETOSIMPLEX = S_(DMPLEXREFINETOSIMPLEX)
 *     REFINE1D = S_(DMPLEXREFINE1D)
 *     EXTRUDE = S_(DMPLEXEXTRUDETYPE)             # <<<<<<<<<<<<<<
 *     TRANSFORMFILTER = S_(DMPLEXTRANSFORMFILTER)
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXEXTRUDETYPE); if (unlikely(!__pyx_t_14)) __PYX_ERR(57, 3676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_EXTRUDE, __pyx_t_14) < (0)) __PYX_ERR(57, 3676, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3677
 *     REFINE1D = S_(DMPLEXREFINE1D)
 *     EXTRUDE = S_(DMPLEXEXTRUDETYPE)
 *     TRANSFORMFILTER = S_(DMPLEXTRANSFORMFILTER)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(DMPLEXTRANSFORMFILTER); if (unlikely(!__pyx_t_14)) __PYX_ERR(57, 3677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_TRANSFORMFILTER, __pyx_t_14) < (0)) __PYX_ERR(57, 3677, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3666
 * 
 * 
 * class DMPlexTransformType(object):             # <<<<<<<<<<<<<<
 *     """Transformation types."""
 *     REFINEREGULAR = S_(DMPLEXREFINEREGULAR)
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMPlexTransformType, __pyx_t_5, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(57, 3666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DMPlexTransformType, __pyx_t_14) < (0)) __PYX_ERR(57, 3666, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3687
 *         self.tr  = NULL
 * 
 *     def apply(self, DM dm) -> DM:             # <<<<<<<<<<<<<<
 *         """Apply a mesh transformation.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(57, 3687, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_3apply, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlexTransform_apply, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1787])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform, __pyx_mstate_global->__pyx_n_u_apply, __pyx_t_4) < (0)) __PYX_ERR(57, 3687, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3698
 *         return newdm
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a mesh transformation.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(57, 3698, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(57, 3698, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_5create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlexTransform_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1788])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_5) < (0)) __PYX_ERR(57, 3698, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3715
 *         return self
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy a mesh transformation.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(57, 3715, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_7destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlexTransform_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1789])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_4) < (0)) __PYX_ERR(57, 3715, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3728
 *         return self
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the transformation type name.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(57, 3728, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_9getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlexTransform_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1790])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_5) < (0)) __PYX_ERR(57, 3728, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3742
 *         return bytes2str(cval)
 * 
 *     def setUp(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Setup a mesh transformation.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(57, 3742, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_11setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlexTransform_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1791])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_4) < (0)) __PYX_ERR(57, 3742, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3752
 *         return self
 * 
 *     def setType(self, tr_type : DMPlexTransformType | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the transformation type.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tr_type, __pyx_mstate_global->__pyx_kp_u_DMPlexTransformType_str) < (0)) __PYX_ERR(57, 3752, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3752, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_13setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlexTransform_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1792])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_5) < (0)) __PYX_ERR(57, 3752, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3766
 *         CHKERR(DMPlexTransformSetType(self.tr, cval))
 * 
 *     def setDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `DM` for the transformation.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3766, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_15setDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlexTransform_setDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1793])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform, __pyx_mstate_global->__pyx_n_u_setDM, __pyx_t_4) < (0)) __PYX_ERR(57, 3766, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3775
 *         CHKERR(DMPlexTransformSetDM(self.tr, dm.dm))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the transformation from the options database.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3775, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_17setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlexTransform_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1794])); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_5) < (0)) __PYX_ERR(57, 3775, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMPlex.pyx":3787
 *         CHKERR(DMPlexTransformSetFromOptions(self.tr))
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the mesh transformation.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(57, 3787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(57, 3787, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMPlexTransform_19view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMPlexTransform_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1795])); if (unlikely(!__pyx_t_4)) __PYX_ERR(57, 3787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMPlexTransform, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_4) < (0)) __PYX_ERR(57, 3787, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class DMStagStencilType(object):             # <<<<<<<<<<<<<<
 *     """Stencil types."""
 *     STAR = DMSTAG_STENCIL_STAR
*/
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[191]); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMStagStencilType, __pyx_mstate_global->__pyx_n_u_DMStagStencilType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Stencil_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(58, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[191]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[191]) < 0))) __PYX_ERR(58, 3, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DMStag.pyx":5
 * class DMStagStencilType(object):
 *     """Stencil types."""
 *     STAR = DMSTAG_STENCIL_STAR             # <<<<<<<<<<<<<<
 *     BOX  = DMSTAG_STENCIL_BOX
 *     NONE = DMSTAG_STENCIL_NONE
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMStagStencilType(DMSTAG_STENCIL_STAR); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_STAR, __pyx_t_14) < (0)) __PYX_ERR(58, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":6
 *     """Stencil types."""
 *     STAR = DMSTAG_STENCIL_STAR
 *     BOX  = DMSTAG_STENCIL_BOX             # <<<<<<<<<<<<<<
 *     NONE = DMSTAG_STENCIL_NONE
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMStagStencilType(DMSTAG_STENCIL_BOX); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BOX, __pyx_t_14) < (0)) __PYX_ERR(58, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":7
 *     STAR = DMSTAG_STENCIL_STAR
 *     BOX  = DMSTAG_STENCIL_BOX
 *     NONE = DMSTAG_STENCIL_NONE             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMStagStencilType(DMSTAG_STENCIL_NONE); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NONE, __pyx_t_14) < (0)) __PYX_ERR(58, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class DMStagStencilType(object):             # <<<<<<<<<<<<<<
 *     """Stencil types."""
 *     STAR = DMSTAG_STENCIL_STAR
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMStagStencilType, __pyx_t_4, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DMStagStencilType, __pyx_t_14) < (0)) __PYX_ERR(58, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __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;

  /* "petsc4py/PETSc/DMStag.pyx":10
 * 
 * 
 * class DMStagStencilLocation(object):             # <<<<<<<<<<<<<<
 *     """Stencil location types."""
 *     NULLLOC          = DMSTAG_NULL_LOCATION
*/
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[193]); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMStagStencilLocation, __pyx_mstate_global->__pyx_n_u_DMStagStencilLocation, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Stencil_location_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(58, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[193]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[193]) < 0))) __PYX_ERR(58, 10, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DMStag.pyx":12
 * class DMStagStencilLocation(object):
 *     """Stencil location types."""
 *     NULLLOC          = DMSTAG_NULL_LOCATION             # <<<<<<<<<<<<<<
 *     BACK_DOWN_LEFT   = DMSTAG_BACK_DOWN_LEFT
 *     BACK_DOWN        = DMSTAG_BACK_DOWN
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_NULL_LOCATION); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_NULLLOC, __pyx_t_14) < (0)) __PYX_ERR(58, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":13
 *     """Stencil location types."""
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_BACK_DOWN_LEFT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BACK_DOWN_LEFT, __pyx_t_14) < (0)) __PYX_ERR(58, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":14
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_BACK_DOWN); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BACK_DOWN, __pyx_t_14) < (0)) __PYX_ERR(58, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":15
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_BACK_DOWN_RIGHT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BACK_DOWN_RIGHT, __pyx_t_14) < (0)) __PYX_ERR(58, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":16
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_BACK_LEFT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BACK_LEFT, __pyx_t_14) < (0)) __PYX_ERR(58, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":17
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_BACK); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BACK, __pyx_t_14) < (0)) __PYX_ERR(58, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":18
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_BACK_RIGHT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BACK_RIGHT, __pyx_t_14) < (0)) __PYX_ERR(58, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":19
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_BACK_UP_LEFT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BACK_UP_LEFT, __pyx_t_14) < (0)) __PYX_ERR(58, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":20
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_BACK_UP); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BACK_UP, __pyx_t_14) < (0)) __PYX_ERR(58, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":21
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_BACK_UP_RIGHT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BACK_UP_RIGHT, __pyx_t_14) < (0)) __PYX_ERR(58, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":22
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_DOWN_LEFT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DOWN_LEFT, __pyx_t_14) < (0)) __PYX_ERR(58, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":23
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_DOWN); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DOWN, __pyx_t_14) < (0)) __PYX_ERR(58, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":24
 *     DOWN_LEFT        = DMSTAG_DOWN_LEFT
 *     DOWN             = DMSTAG_DOWN
 *     DOWN_RIGHT       = DMSTAG_DOWN_RIGHT             # <<<<<<<<<<<<<<
 *     LEFT             = DMSTAG_LEFT
 *     ELEMENT          = DMSTAG_ELEMENT
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_DOWN_RIGHT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DOWN_RIGHT, __pyx_t_14) < (0)) __PYX_ERR(58, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":25
 *     DOWN             = DMSTAG_DOWN
 *     DOWN_RIGHT       = DMSTAG_DOWN_RIGHT
 *     LEFT             = DMSTAG_LEFT             # <<<<<<<<<<<<<<
 *     ELEMENT          = DMSTAG_ELEMENT
 *     RIGHT            = DMSTAG_RIGHT
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_LEFT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LEFT, __pyx_t_14) < (0)) __PYX_ERR(58, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":26
 *     DOWN_RIGHT       = DMSTAG_DOWN_RIGHT
 *     LEFT             = DMSTAG_LEFT
 *     ELEMENT          = DMSTAG_ELEMENT             # <<<<<<<<<<<<<<
 *     RIGHT            = DMSTAG_RIGHT
 *     UP_LEFT          = DMSTAG_UP_LEFT
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_ELEMENT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_ELEMENT, __pyx_t_14) < (0)) __PYX_ERR(58, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":27
 *     LEFT             = DMSTAG_LEFT
 *     ELEMENT          = DMSTAG_ELEMENT
 *     RIGHT            = DMSTAG_RIGHT             # <<<<<<<<<<<<<<
 *     UP_LEFT          = DMSTAG_UP_LEFT
 *     UP               = DMSTAG_UP
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_RIGHT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RIGHT, __pyx_t_14) < (0)) __PYX_ERR(58, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":28
 *     ELEMENT          = DMSTAG_ELEMENT
 *     RIGHT            = DMSTAG_RIGHT
 *     UP_LEFT          = DMSTAG_UP_LEFT             # <<<<<<<<<<<<<<
 *     UP               = DMSTAG_UP
 *     UP_RIGHT         = DMSTAG_UP_RIGHT
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_UP_LEFT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_UP_LEFT, __pyx_t_14) < (0)) __PYX_ERR(58, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":29
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_UP); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_UP, __pyx_t_14) < (0)) __PYX_ERR(58, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":30
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_UP_RIGHT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_UP_RIGHT, __pyx_t_14) < (0)) __PYX_ERR(58, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":31
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_FRONT_DOWN_LEFT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FRONT_DOWN_LEFT, __pyx_t_14) < (0)) __PYX_ERR(58, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":32
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_FRONT_DOWN); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FRONT_DOWN, __pyx_t_14) < (0)) __PYX_ERR(58, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":33
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_FRONT_DOWN_RIGHT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FRONT_DOWN_RIGHT, __pyx_t_14) < (0)) __PYX_ERR(58, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":34
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_FRONT_LEFT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FRONT_LEFT, __pyx_t_14) < (0)) __PYX_ERR(58, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":35
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_FRONT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FRONT, __pyx_t_14) < (0)) __PYX_ERR(58, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":36
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_FRONT_RIGHT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FRONT_RIGHT, __pyx_t_14) < (0)) __PYX_ERR(58, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":37
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_FRONT_UP_LEFT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FRONT_UP_LEFT, __pyx_t_14) < (0)) __PYX_ERR(58, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":38
 *     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_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_FRONT_UP); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FRONT_UP, __pyx_t_14) < (0)) __PYX_ERR(58, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":39
 *     FRONT_UP_LEFT    = DMSTAG_FRONT_UP_LEFT
 *     FRONT_UP         = DMSTAG_FRONT_UP
 *     FRONT_UP_RIGHT   = DMSTAG_FRONT_UP_RIGHT             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMStagStencilLocation(DMSTAG_FRONT_UP_RIGHT); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_FRONT_UP_RIGHT, __pyx_t_14) < (0)) __PYX_ERR(58, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":10
 * 
 * 
 * class DMStagStencilLocation(object):             # <<<<<<<<<<<<<<
 *     """Stencil location types."""
 *     NULLLOC          = DMSTAG_NULL_LOCATION
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMStagStencilLocation, __pyx_t_4, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(58, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DMStagStencilLocation, __pyx_t_14) < (0)) __PYX_ERR(58, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __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;

  /* "petsc4py/PETSc/DMStag.pyx":47
 *     """A DM object representing a "staggered grid" or a structured cell complex."""
 * 
 *     StencilType       = DMStagStencilType             # <<<<<<<<<<<<<<
 *     StencilLocation   = DMStagStencilLocation
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMStagStencilType); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_StencilType, __pyx_t_4) < (0)) __PYX_ERR(58, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":48
 * 
 *     StencilType       = DMStagStencilType
 *     StencilLocation   = DMStagStencilLocation             # <<<<<<<<<<<<<<
 * 
 *     def create(
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMStagStencilLocation); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_StencilLocation, __pyx_t_4) < (0)) __PYX_ERR(58, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":50
 *     StencilLocation   = DMStagStencilLocation
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dim, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(58, 50, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dofs, __pyx_mstate_global->__pyx_kp_u_tuple_int_None) < (0)) __PYX_ERR(58, 50, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sizes, __pyx_mstate_global->__pyx_kp_u_tuple_int_None) < (0)) __PYX_ERR(58, 50, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_boundary_types, __pyx_mstate_global->__pyx_kp_u_tuple_DM_BoundaryType_int_str_bo) < (0)) __PYX_ERR(58, 50, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_stencil_type, __pyx_mstate_global->__pyx_kp_u_StencilType_None) < (0)) __PYX_ERR(58, 50, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_stencil_width, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(58, 50, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_proc_sizes, __pyx_mstate_global->__pyx_kp_u_tuple_int_None) < (0)) __PYX_ERR(58, 50, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ownership_ranges, __pyx_mstate_global->__pyx_kp_u_tuple_Sequence_int_None) < (0)) __PYX_ERR(58, 50, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(58, 50, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_mstate_global->__pyx_kp_u_bool_None) < (0)) __PYX_ERR(58, 50, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(58, 50, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_1create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1796])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[194]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_5) < (0)) __PYX_ERR(58, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":163
 *     # Setters
 * 
 *     def setStencilWidth(self, swidth: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set elementwise stencil width.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_swidth, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(58, 163, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(58, 163, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_3setStencilWidth, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_setStencilWidth, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1797])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_setStencilWidth, __pyx_t_4) < (0)) __PYX_ERR(58, 163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":183
 *         CHKERR(DMStagSetStencilWidth(self.dm, sw))
 * 
 *     def setStencilType(self, stenciltype: StencilType | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set elementwise ghost/halo stencil type.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_stenciltype, __pyx_mstate_global->__pyx_kp_u_StencilType_str) < (0)) __PYX_ERR(58, 183, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(58, 183, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_5setStencilType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_setStencilType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1798])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_setStencilType, __pyx_t_5) < (0)) __PYX_ERR(58, 183, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":201
 *         CHKERR(DMStagSetStencilType(self.dm, stype))
 * 
 *     def setBoundaryTypes(             # <<<<<<<<<<<<<<
 *         self,
 *         boundary_types: tuple[DM.BoundaryType | int | str | bool, ...]) -> None:
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_boundary_types, __pyx_mstate_global->__pyx_kp_u_tuple_DM_BoundaryType_int_str_bo_2) < (0)) __PYX_ERR(58, 201, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(58, 201, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_7setBoundaryTypes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_setBoundaryTypes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1799])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_setBoundaryTypes, __pyx_t_4) < (0)) __PYX_ERR(58, 201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":224
 *         CHKERR(DMStagSetBoundaryTypes(self.dm, btx, bty, btz))
 * 
 *     def setDof(self, dofs: tuple[int, ...]) -> None:             # <<<<<<<<<<<<<<
 *         """Set DOFs/stratum.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dofs, __pyx_mstate_global->__pyx_kp_u_tuple_int) < (0)) __PYX_ERR(58, 224, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(58, 224, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_9setDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_setDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1800])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_setDof, __pyx_t_5) < (0)) __PYX_ERR(58, 224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":246
 *         CHKERR(DMStagSetDOF(self.dm, dof0, dof1, dof2, dof3))
 * 
 *     def setGlobalSizes(self, sizes: tuple[int, ...]) -> None:             # <<<<<<<<<<<<<<
 *         """Set global element counts in each dimension.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sizes, __pyx_mstate_global->__pyx_kp_u_tuple_int) < (0)) __PYX_ERR(58, 246, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(58, 246, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_11setGlobalSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_setGlobalSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1801])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_setGlobalSizes, __pyx_t_4) < (0)) __PYX_ERR(58, 246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":266
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sizes, __pyx_mstate_global->__pyx_kp_u_tuple_int) < (0)) __PYX_ERR(58, 266, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(58, 266, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_13setProcSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_setProcSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1802])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_setProcSizes, __pyx_t_5) < (0)) __PYX_ERR(58, 266, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":286
 *         CHKERR(DMStagSetNumRanks(self.dm, m, n, p))
 * 
 *     def setOwnershipRanges(self, ranges: tuple[Sequence[int], ...]) -> None:             # <<<<<<<<<<<<<<
 *         """Set elements per process in each dimension.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ranges, __pyx_mstate_global->__pyx_kp_u_tuple_Sequence_int) < (0)) __PYX_ERR(58, 286, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(58, 286, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_15setOwnershipRanges, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_setOwnershipRanges, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1803])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_setOwnershipRanges, __pyx_t_4) < (0)) __PYX_ERR(58, 286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":310
 *     # Getters
 * 
 *     def getDim(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of dimensions.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(58, 310, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_17getDim, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getDim, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1804])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getDim, __pyx_t_5) < (0)) __PYX_ERR(58, 310, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":318
 *         return self.getDimension()
 * 
 *     def getEntriesPerElement(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of entries per element in the local representation.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(58, 318, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_19getEntriesPerElement, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getEntriesPerElement, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1805])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getEntriesPerElement, __pyx_t_4) < (0)) __PYX_ERR(58, 318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":334
 *         return toInt(epe)
 * 
 *     def getStencilWidth(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return elementwise stencil width.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(58, 334, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_21getStencilWidth, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getStencilWidth, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1806])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getStencilWidth, __pyx_t_5) < (0)) __PYX_ERR(58, 334, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":348
 *         return toInt(swidth)
 * 
 *     def getDof(self) -> tuple[int, ...]:             # <<<<<<<<<<<<<<
 *         """Get number of DOFs associated with each stratum of the grid.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int) < (0)) __PYX_ERR(58, 348, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_23getDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1807])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getDof, __pyx_t_4) < (0)) __PYX_ERR(58, 348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":363
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_tuple_int_tuple_int_tuple) < (0)) __PYX_ERR(58, 363, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_25getCorners, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getCorners, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1808])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getCorners, __pyx_t_5) < (0)) __PYX_ERR(58, 363, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":385
 *         return (asInt(x), asInt(y), asInt(z))[:<Py_ssize_t>dim], (asInt(m), asInt(n), asInt(p))[:<Py_ssize_t>dim], (asInt(nExtrax), asInt(nExtray), asInt(nExtraz))[:<Py_ssize_t>dim]
 * 
 *     def getGhostCorners(self) -> tuple[tuple[int, ...], tuple[int, ...]]:             # <<<<<<<<<<<<<<
 *         """Return starting element index and width of local region.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_tuple_int_tuple_int) < (0)) __PYX_ERR(58, 385, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_27getGhostCorners, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getGhostCorners, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1809])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getGhostCorners, __pyx_t_4) < (0)) __PYX_ERR(58, 385, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":400
 *         return (asInt(x), asInt(y), asInt(z))[:<Py_ssize_t>dim], (asInt(m), asInt(n), asInt(p))[:<Py_ssize_t>dim]
 * 
 *     def getLocalSizes(self) -> tuple[int, ...]:             # <<<<<<<<<<<<<<
 *         """Return local elementwise sizes in each dimension.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int) < (0)) __PYX_ERR(58, 400, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_29getLocalSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getLocalSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1810])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getLocalSizes, __pyx_t_5) < (0)) __PYX_ERR(58, 400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":417
 *         return toStagDims(dim, m, n, p)
 * 
 *     def getGlobalSizes(self) -> tuple[int, ...]:             # <<<<<<<<<<<<<<
 *         """Return global element counts in each dimension.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int) < (0)) __PYX_ERR(58, 417, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_31getGlobalSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getGlobalSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1811])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getGlobalSizes, __pyx_t_4) < (0)) __PYX_ERR(58, 417, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":432
 *         return toStagDims(dim, m, n, p)
 * 
 *     def getProcSizes(self) -> tuple[int, ...]:             # <<<<<<<<<<<<<<
 *         """Return number of processes in each dimension.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int) < (0)) __PYX_ERR(58, 432, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_33getProcSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getProcSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1812])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getProcSizes, __pyx_t_5) < (0)) __PYX_ERR(58, 432, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":447
 *         return toStagDims(dim, m, n, p)
 * 
 *     def getStencilType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return elementwise ghost/halo stencil type.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(58, 447, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_35getStencilType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getStencilType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1813])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getStencilType, __pyx_t_4) < (0)) __PYX_ERR(58, 447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":461
 *         return toStagStencil(stype)
 * 
 *     def getOwnershipRanges(self) -> tuple[Sequence[int], ...]:             # <<<<<<<<<<<<<<
 *         """Return elements per process in each dimension.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Sequence_int) < (0)) __PYX_ERR(58, 461, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_37getOwnershipRanges, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getOwnershipRanges, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1814])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getOwnershipRanges, __pyx_t_5) < (0)) __PYX_ERR(58, 461, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":478
 *         return toStagOwnershipRanges(dim, m, n, p, lx, ly, lz)
 * 
 *     def getBoundaryTypes(self) -> tuple[str, ...]:             # <<<<<<<<<<<<<<
 *         """Return boundary types in each dimension.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_str) < (0)) __PYX_ERR(58, 478, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_39getBoundaryTypes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getBoundaryTypes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1815])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getBoundaryTypes, __pyx_t_4) < (0)) __PYX_ERR(58, 478, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":496
 *         return toStagBoundaryTypes(dim, btx, bty, btz)
 * 
 *     def getIsFirstRank(self) -> tuple[int, ...]:             # <<<<<<<<<<<<<<
 *         """Return whether this process is first in each dimension in the process grid.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int) < (0)) __PYX_ERR(58, 496, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_41getIsFirstRank, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getIsFirstRank, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1816])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getIsFirstRank, __pyx_t_5) < (0)) __PYX_ERR(58, 496, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":512
 *         return toStagDims(dim, rank0, rank1, rank2)
 * 
 *     def getIsLastRank(self) -> tuple[int, ...]:             # <<<<<<<<<<<<<<
 *         """Return whether this process is last in each dimension in the process grid.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int) < (0)) __PYX_ERR(58, 512, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_43getIsLastRank, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getIsLastRank, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1817])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getIsLastRank, __pyx_t_4) < (0)) __PYX_ERR(58, 512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":530
 *     # Coordinate-related functions
 * 
 *     def setUniformCoordinatesExplicit(             # <<<<<<<<<<<<<<
 *         self,
 *         xmin: float = 0,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_xmin, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 530, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_xmax, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 530, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ymin, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 530, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ymax, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 530, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_zmin, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 530, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_zmax, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 530, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(58, 530, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_45setUniformCoordinatesExplicit, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_setUniformCoordinatesExpl, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1818])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[178]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_setUniformCoordinatesExplicit, __pyx_t_5) < (0)) __PYX_ERR(58, 530, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":568
 *         CHKERR(DMStagSetUniformCoordinatesExplicit(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax))
 * 
 *     def setUniformCoordinatesProduct(             # <<<<<<<<<<<<<<
 *         self,
 *         xmin: float = 0,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_xmin, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 568, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_xmax, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 568, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ymin, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 568, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ymax, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 568, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_zmin, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 568, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_zmax, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 568, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(58, 568, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_47setUniformCoordinatesProduct, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_setUniformCoordinatesProd, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1819])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[178]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_setUniformCoordinatesProduct, __pyx_t_4) < (0)) __PYX_ERR(58, 568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":610
 *         CHKERR(DMStagSetUniformCoordinatesProduct(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax))
 * 
 *     def setUniformCoordinates(             # <<<<<<<<<<<<<<
 *         self,
 *         xmin: float = 0,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_xmin, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 610, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_xmax, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 610, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ymin, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 610, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ymax, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 610, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_zmin, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 610, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_zmax, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(58, 610, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(58, 610, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_49setUniformCoordinates, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_setUniformCoordinates, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1820])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[178]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_setUniformCoordinates, __pyx_t_5) < (0)) __PYX_ERR(58, 610, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":657
 *         CHKERR(DMStagSetUniformCoordinates(self.dm, _xmin, _xmax, _ymin, _ymax, _zmin, _zmax))
 * 
 *     def setCoordinateDMType(self, dmtype: DM.Type) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type to store coordinates.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_dmtype, __pyx_mstate_global->__pyx_kp_u_DM_Type) < (0)) __PYX_ERR(58, 657, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(58, 657, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_51setCoordinateDMType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_setCoordinateDMType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1821])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_setCoordinateDMType, __pyx_t_4) < (0)) __PYX_ERR(58, 657, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":678
 *     # Location slot related functions
 * 
 *     def getLocationSlot(self, loc: StencilLocation, c: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return index to use in accessing raw local arrays.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_loc, __pyx_mstate_global->__pyx_n_u_StencilLocation) < (0)) __PYX_ERR(58, 678, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_c, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(58, 678, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(58, 678, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_53getLocationSlot, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getLocationSlot, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1822])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getLocationSlot, __pyx_t_5) < (0)) __PYX_ERR(58, 678, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":701
 *         return toInt(slot)
 * 
 *     def getProductCoordinateLocationSlot(self, loc: StencilLocation) -> None:             # <<<<<<<<<<<<<<
 *         """Return slot for use with local product coordinate arrays.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_loc, __pyx_mstate_global->__pyx_n_u_StencilLocation) < (0)) __PYX_ERR(58, 701, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(58, 701, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_55getProductCoordinateLocationSlot, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getProductCoordinateLocat, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1823])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getProductCoordinateLocationSlot, __pyx_t_4) < (0)) __PYX_ERR(58, 701, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":721
 *         return toInt(slot)
 * 
 *     def getLocationDof(self, loc: StencilLocation) -> int:             # <<<<<<<<<<<<<<
 *         """Return number of DOFs associated with a given point on the grid.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_loc, __pyx_mstate_global->__pyx_n_u_StencilLocation) < (0)) __PYX_ERR(58, 721, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(58, 721, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_57getLocationDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getLocationDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1824])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getLocationDof, __pyx_t_5) < (0)) __PYX_ERR(58, 721, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":743
 *     # Random other functions
 * 
 *     def migrateVec(self, Vec vec, DM dmTo, Vec vecTo) -> None:             # <<<<<<<<<<<<<<
 *         """Transfer a vector between two ``DMStag`` objects.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(58, 743, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_59migrateVec, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_migrateVec, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1825])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_migrateVec, __pyx_t_4) < (0)) __PYX_ERR(58, 743, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":766
 *         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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dofs, __pyx_mstate_global->__pyx_kp_u_tuple_int) < (0)) __PYX_ERR(58, 766, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(58, 766, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_61createCompatibleDMStag, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_createCompatibleDMStag, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1826])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_createCompatibleDMStag, __pyx_t_5) < (0)) __PYX_ERR(58, 766, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":790
 *         return newdm
 * 
 *     def VecSplitToDMDA(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec vec,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_loc, __pyx_mstate_global->__pyx_n_u_StencilLocation) < (0)) __PYX_ERR(58, 790, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_c, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(58, 790, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_DMDA_Vec) < (0)) __PYX_ERR(58, 790, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_63VecSplitToDMDA, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_VecSplitToDMDA, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1827])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_VecSplitToDMDA, __pyx_t_4) < (0)) __PYX_ERR(58, 790, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":828
 *         return (da, davec)
 * 
 *     def getVecArray(self, Vec vec) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py')
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(58, 828, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_65getVecArray, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_getVecArray, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1828])); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_getVecArray, __pyx_t_5) < (0)) __PYX_ERR(58, 828, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":832
 *         raise NotImplementedError('getVecArray for DMStag not yet implemented in petsc4py')
 * 
 *     def get1dCoordinatecArrays(self) -> None:             # <<<<<<<<<<<<<<
 *         """Not implemented."""
 *         raise NotImplementedError('get1dCoordinatecArrays for DMStag not yet implemented in petsc4py')
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(58, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(58, 832, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6DMStag_67get1dCoordinatecArrays, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMStag_get1dCoordinatecArrays, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1829])); if (unlikely(!__pyx_t_4)) __PYX_ERR(58, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMStag, __pyx_mstate_global->__pyx_n_u_get1dCoordinatecArrays, __pyx_t_4) < (0)) __PYX_ERR(58, 832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMStag.pyx":894
 * # --------------------------------------------------------------------
 * 
 * del DMStagStencilType             # <<<<<<<<<<<<<<
 * del DMStagStencilLocation
 * 
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMStagStencilType) < (0)) __PYX_ERR(58, 894, __pyx_L1_error)

  /* "petsc4py/PETSc/DMStag.pyx":895
 * 
 * del DMStagStencilType
 * del DMStagStencilLocation             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMStagStencilLocation) < (0)) __PYX_ERR(58, 895, __pyx_L1_error)

  /* "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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(59, 6, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(59, 6, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11DMComposite_1create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMComposite_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1830])); if (unlikely(!__pyx_t_5)) __PYX_ERR(59, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_5) < (0)) __PYX_ERR(59, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":28
 *         return self
 * 
 *     def addDM(self, DM dm, *args: DM) -> None:             # <<<<<<<<<<<<<<
 *         """Add a DM vector to the composite.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(59, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(59, 28, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(59, 28, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11DMComposite_3addDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMComposite_addDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1831])); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_mstate_global->__pyx_n_u_addDM, __pyx_t_4) < (0)) __PYX_ERR(59, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":51
 *             CHKERR(DMCompositeAddDM(self.dm, dm.dm))
 * 
 *     def getNumber(self) -> int:             # <<<<<<<<<<<<<<
 *         """Get number of sub-DMs contained in the composite.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(59, 51, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11DMComposite_5getNumber, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMComposite_getNumber, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1832])); if (unlikely(!__pyx_t_5)) __PYX_ERR(59, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_mstate_global->__pyx_n_u_getNumber, __pyx_t_5) < (0)) __PYX_ERR(59, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":64
 *         CHKERR(DMCompositeGetNumberDM(self.dm, &n))
 *         return toInt(n)
 *     getNumberDM = getNumber             # <<<<<<<<<<<<<<
 * 
 *     def getEntries(self) -> list[DM]:
*/
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_mstate_global->__pyx_n_u_getNumber); if (unlikely(!__pyx_t_5)) __PYX_ERR(59, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_mstate_global->__pyx_n_u_getNumberDM, __pyx_t_5) < (0)) __PYX_ERR(59, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":66
 *     getNumberDM = getNumber
 * 
 *     def getEntries(self) -> list[DM]:             # <<<<<<<<<<<<<<
 *         """Return sub-DMs contained in the composite.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(59, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_DM) < (0)) __PYX_ERR(59, 66, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11DMComposite_7getEntries, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMComposite_getEntries, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1833])); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_mstate_global->__pyx_n_u_getEntries, __pyx_t_4) < (0)) __PYX_ERR(59, 66, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":90
 *         return entries
 * 
 *     def scatter(self, Vec gvec, lvecs: Sequence[Vec]) -> None:             # <<<<<<<<<<<<<<
 *         """Scatter coupled global vector into split local vectors.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_lvecs, __pyx_mstate_global->__pyx_kp_u_Sequence_Vec) < (0)) __PYX_ERR(59, 90, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(59, 90, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11DMComposite_9scatter, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMComposite_scatter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1834])); if (unlikely(!__pyx_t_5)) __PYX_ERR(59, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_mstate_global->__pyx_n_u_scatter, __pyx_t_5) < (0)) __PYX_ERR(59, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":115
 *         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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(59, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_imode, __pyx_mstate_global->__pyx_n_u_InsertModeSpec) < (0)) __PYX_ERR(59, 115, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_lvecs, __pyx_mstate_global->__pyx_kp_u_Sequence_Vec) < (0)) __PYX_ERR(59, 115, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(59, 115, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11DMComposite_11gather, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMComposite_gather, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1835])); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_mstate_global->__pyx_n_u_gather, __pyx_t_4) < (0)) __PYX_ERR(59, 115, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":143
 *         CHKERR(DMCompositeGatherArray(self.dm, cimode, gvec.vec, clvecs))
 * 
 *     def getGlobalISs(self) -> list[IS]:             # <<<<<<<<<<<<<<
 *         """Return the index sets for each composed object in the composite.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_IS) < (0)) __PYX_ERR(59, 143, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11DMComposite_13getGlobalISs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMComposite_getGlobalISs, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1836])); if (unlikely(!__pyx_t_5)) __PYX_ERR(59, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_mstate_global->__pyx_n_u_getGlobalISs, __pyx_t_5) < (0)) __PYX_ERR(59, 143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":170
 *         return isets
 * 
 *     def getLocalISs(self) -> list[IS]:             # <<<<<<<<<<<<<<
 *         """Return index sets for each component of a composite local vector.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(59, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_IS) < (0)) __PYX_ERR(59, 170, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11DMComposite_15getLocalISs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMComposite_getLocalISs, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1837])); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_mstate_global->__pyx_n_u_getLocalISs, __pyx_t_4) < (0)) __PYX_ERR(59, 170, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":196
 *         return isets
 * 
 *     def getLGMaps(self) -> list[LGMap]:             # <<<<<<<<<<<<<<
 *         """Return a local-to-global mapping for each DM in the composite.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_LGMap) < (0)) __PYX_ERR(59, 196, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11DMComposite_17getLGMaps, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMComposite_getLGMaps, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1838])); if (unlikely(!__pyx_t_5)) __PYX_ERR(59, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_mstate_global->__pyx_n_u_getLGMaps, __pyx_t_5) < (0)) __PYX_ERR(59, 196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMComposite.pyx":219
 *         return lgms
 * 
 *     def getAccess(self, Vec gvec, locs: Sequence[int] | None = None) -> Any:             # <<<<<<<<<<<<<<
 *         """Get access to the individual vectors from the global vector.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(59, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_locs, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(59, 219, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Any) < (0)) __PYX_ERR(59, 219, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11DMComposite_19getAccess, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMComposite_getAccess, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1839])); if (unlikely(!__pyx_t_4)) __PYX_ERR(59, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMComposite, __pyx_mstate_global->__pyx_n_u_getAccess, __pyx_t_4) < (0)) __PYX_ERR(59, 219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(60, 4, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(60, 4, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_1create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1840])); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_5) < (0)) __PYX_ERR(60, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":25
 *         return self
 * 
 *     def setMatrix(self, Mat mat) -> None:             # <<<<<<<<<<<<<<
 *         """Set a template matrix.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 25, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_3setMatrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setMatrix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1841])); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setMatrix, __pyx_t_4) < (0)) __PYX_ERR(60, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":42
 *         CHKERR(DMShellSetMatrix(self.dm, mat.mat))
 * 
 *     def setGlobalVector(self, Vec gv) -> None:             # <<<<<<<<<<<<<<
 *         """Set a template global vector.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 42, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_5setGlobalVector, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setGlobalVector, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1842])); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setGlobalVector, __pyx_t_5) < (0)) __PYX_ERR(60, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":59
 *         CHKERR(DMShellSetGlobalVector(self.dm, gv.vec))
 * 
 *     def setLocalVector(self, Vec lv) -> None:             # <<<<<<<<<<<<<<
 *         """Set a template local vector.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 59, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_7setLocalVector, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setLocalVector, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1843])); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setLocalVector, __pyx_t_4) < (0)) __PYX_ERR(60, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":76
 *         CHKERR(DMShellSetLocalVector(self.dm, lv.vec))
 * 
 *     def setCreateGlobalVector(             # <<<<<<<<<<<<<<
 *         self,
 *         create_gvec: Callable[[DM], Vec] | None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_create_gvec, __pyx_mstate_global->__pyx_kp_u_Callable_DM_Vec_None) < (0)) __PYX_ERR(60, 76, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 76, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 76, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 76, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_9setCreateGlobalVector, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setCreateGlobalVector, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1844])); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setCreateGlobalVector, __pyx_t_5) < (0)) __PYX_ERR(60, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":108
 *             CHKERR(DMShellSetCreateGlobalVector(self.dm, NULL))
 * 
 *     def setCreateLocalVector(             # <<<<<<<<<<<<<<
 *         self,
 *         create_lvec: Callable[[DM], Vec] | None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_create_lvec, __pyx_mstate_global->__pyx_kp_u_Callable_DM_Vec_None) < (0)) __PYX_ERR(60, 108, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 108, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 108, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 108, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_11setCreateLocalVector, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setCreateLocalVector, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1845])); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setCreateLocalVector, __pyx_t_4) < (0)) __PYX_ERR(60, 108, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":140
 *             CHKERR(DMShellSetCreateLocalVector(self.dm, NULL))
 * 
 *     def setGlobalToLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         begin: Callable[[DM, Vec, InsertMode, Vec], None] | None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_begin, __pyx_mstate_global->__pyx_kp_u_Callable_DM_Vec_InsertMode_Vec_N) < (0)) __PYX_ERR(60, 140, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_end, __pyx_mstate_global->__pyx_kp_u_Callable_DM_Vec_InsertMode_Vec_N) < (0)) __PYX_ERR(60, 140, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_begin_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 140, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_begin_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 140, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_end_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 140, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_end_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 140, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 140, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_13setGlobalToLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setGlobalToLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1846])); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setGlobalToLocal, __pyx_t_5) < (0)) __PYX_ERR(60, 140, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":189
 *         CHKERR(DMShellSetGlobalToLocal(self.dm, cbegin, cend))
 * 
 *     def setGlobalToLocalVecScatter(self, Scatter gtol) -> None:             # <<<<<<<<<<<<<<
 *         """Set a `Scatter` context for global to local communication.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 189, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_15setGlobalToLocalVecScatter, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setGlobalToLocalVecScatt, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1847])); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setGlobalToLocalVecScatter, __pyx_t_4) < (0)) __PYX_ERR(60, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":206
 *         CHKERR(DMShellSetGlobalToLocalVecScatter(self.dm, gtol.sct))
 * 
 *     def setLocalToGlobal(             # <<<<<<<<<<<<<<
 *         self,
 *         begin: Callable[[DM, Vec, InsertMode, Vec], None] | None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_begin, __pyx_mstate_global->__pyx_kp_u_Callable_DM_Vec_InsertMode_Vec_N) < (0)) __PYX_ERR(60, 206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_end, __pyx_mstate_global->__pyx_kp_u_Callable_DM_Vec_InsertMode_Vec_N) < (0)) __PYX_ERR(60, 206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_begin_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_begin_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_end_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_end_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 206, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 206, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_17setLocalToGlobal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setLocalToGlobal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1848])); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setLocalToGlobal, __pyx_t_5) < (0)) __PYX_ERR(60, 206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":253
 *         CHKERR(DMShellSetLocalToGlobal(self.dm, cbegin, cend))
 * 
 *     def setLocalToGlobalVecScatter(self, Scatter ltog) -> None:             # <<<<<<<<<<<<<<
 *         """Set a `Scatter` context for local to global communication.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 253, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_19setLocalToGlobalVecScatter, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setLocalToGlobalVecScatt, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1849])); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setLocalToGlobalVecScatter, __pyx_t_4) < (0)) __PYX_ERR(60, 253, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":270
 *         CHKERR(DMShellSetLocalToGlobalVecScatter(self.dm, ltog.sct))
 * 
 *     def setLocalToLocal(             # <<<<<<<<<<<<<<
 *         self,
 *         begin: Callable[[DM, Vec, InsertMode, Vec], None] | None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_begin, __pyx_mstate_global->__pyx_kp_u_Callable_DM_Vec_InsertMode_Vec_N) < (0)) __PYX_ERR(60, 270, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_end, __pyx_mstate_global->__pyx_kp_u_Callable_DM_Vec_InsertMode_Vec_N) < (0)) __PYX_ERR(60, 270, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_begin_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 270, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_begin_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 270, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_end_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 270, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_end_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 270, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 270, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_21setLocalToLocal, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setLocalToLocal, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1850])); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setLocalToLocal, __pyx_t_5) < (0)) __PYX_ERR(60, 270, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":319
 *         CHKERR(DMShellSetLocalToLocal(self.dm, cbegin, cend))
 * 
 *     def setLocalToLocalVecScatter(self, Scatter ltol) -> None:             # <<<<<<<<<<<<<<
 *         """Set a ``Scatter`` context for local to local communication.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 319, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_23setLocalToLocalVecScatter, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setLocalToLocalVecScatte, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1851])); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setLocalToLocalVecScatter, __pyx_t_4) < (0)) __PYX_ERR(60, 319, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":336
 *         CHKERR(DMShellSetLocalToLocalVecScatter(self.dm, ltol.sct))
 * 
 *     def setCreateMatrix(             # <<<<<<<<<<<<<<
 *         self,
 *         create_matrix: Callable[[DM], Mat] | None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_create_matrix, __pyx_mstate_global->__pyx_kp_u_Callable_DM_Mat_None) < (0)) __PYX_ERR(60, 336, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 336, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 336, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 336, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_25setCreateMatrix, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setCreateMatrix, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1852])); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setCreateMatrix, __pyx_t_5) < (0)) __PYX_ERR(60, 336, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":368
 *             CHKERR(DMShellSetCreateMatrix(self.dm, NULL))
 * 
 *     def setCoarsen(             # <<<<<<<<<<<<<<
 *         self,
 *         coarsen: Callable[[DM, Comm], DM] | None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_coarsen, __pyx_mstate_global->__pyx_kp_u_Callable_DM_Comm_DM_None) < (0)) __PYX_ERR(60, 368, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 368, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 368, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 368, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_27setCoarsen, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setCoarsen, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1853])); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setCoarsen, __pyx_t_4) < (0)) __PYX_ERR(60, 368, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":400
 *             CHKERR(DMShellSetCoarsen(self.dm, NULL))
 * 
 *     def setRefine(             # <<<<<<<<<<<<<<
 *         self,
 *         refine: Callable[[DM, Comm], DM] | None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_refine, __pyx_mstate_global->__pyx_kp_u_Callable_DM_Comm_DM_None) < (0)) __PYX_ERR(60, 400, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 400, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 400, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 400, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_29setRefine, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setRefine, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1854])); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setRefine, __pyx_t_5) < (0)) __PYX_ERR(60, 400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":432
 *             CHKERR(DMShellSetRefine(self.dm, NULL))
 * 
 *     def setCreateInterpolation(             # <<<<<<<<<<<<<<
 *         self,
 *         create_interpolation: Callable[[DM, DM], tuple[Mat, Vec]] | None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_create_interpolation, __pyx_mstate_global->__pyx_kp_u_Callable_DM_DM_tuple_Mat_Vec_Non) < (0)) __PYX_ERR(60, 432, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 432, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 432, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 432, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_31setCreateInterpolation, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setCreateInterpolation, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1855])); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setCreateInterpolation, __pyx_t_4) < (0)) __PYX_ERR(60, 432, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":464
 *             CHKERR(DMShellSetCreateInterpolation(self.dm, NULL))
 * 
 *     def setCreateInjection(             # <<<<<<<<<<<<<<
 *         self,
 *         create_injection: Callable[[DM, DM], Mat] | None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_create_injection, __pyx_mstate_global->__pyx_kp_u_Callable_DM_DM_Mat_None) < (0)) __PYX_ERR(60, 464, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 464, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 464, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 464, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_33setCreateInjection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setCreateInjection, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1856])); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setCreateInjection, __pyx_t_5) < (0)) __PYX_ERR(60, 464, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":496
 *             CHKERR(DMShellSetCreateInjection(self.dm, NULL))
 * 
 *     def setCreateRestriction(             # <<<<<<<<<<<<<<
 *         self,
 *         create_restriction: Callable[[DM, DM], Mat] | None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_create_restriction, __pyx_mstate_global->__pyx_kp_u_Callable_DM_DM_Mat_None) < (0)) __PYX_ERR(60, 496, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 496, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 496, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 496, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_35setCreateRestriction, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setCreateRestriction, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1857])); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setCreateRestriction, __pyx_t_4) < (0)) __PYX_ERR(60, 496, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":528
 *             CHKERR(DMShellSetCreateRestriction(self.dm, NULL))
 * 
 *     def setCreateFieldDecomposition(             # <<<<<<<<<<<<<<
 *         self,
 *         decomp: Callable[[DM], tuple[list[str] | None, list[IS] | None, list[DM] | None]] | None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_decomp, __pyx_mstate_global->__pyx_kp_u_Callable_DM_tuple_list_str_None) < (0)) __PYX_ERR(60, 528, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 528, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 528, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 528, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_37setCreateFieldDecomposition, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setCreateFieldDecomposit, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1858])); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setCreateFieldDecomposition, __pyx_t_5) < (0)) __PYX_ERR(60, 528, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":560
 *             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,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_decomp, __pyx_mstate_global->__pyx_kp_u_Callable_DM_tuple_list_str_None_2) < (0)) __PYX_ERR(60, 560, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 560, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 560, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 560, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_39setCreateDomainDecomposition, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setCreateDomainDecomposi, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1859])); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setCreateDomainDecomposition, __pyx_t_4) < (0)) __PYX_ERR(60, 560, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":592
 *             CHKERR(DMShellSetCreateDomainDecomposition(self.dm, NULL))
 * 
 *     def setCreateDomainDecompositionScatters(             # <<<<<<<<<<<<<<
 *         self,
 *         scatter: Callable[[DM, list[DM]], tuple[list[Scatter], list[Scatter], list[Scatter]]] | None,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_scatter, __pyx_mstate_global->__pyx_kp_u_Callable_DM_list_DM_tuple_list_S) < (0)) __PYX_ERR(60, 592, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 592, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 592, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 592, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_41setCreateDomainDecompositionScatters, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setCreateDomainDecomposi_2, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1860])); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setCreateDomainDecompositionScat, __pyx_t_5) < (0)) __PYX_ERR(60, 592, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMShell.pyx":624
 *             CHKERR(DMShellSetCreateDomainDecompositionScatters(self.dm, NULL))
 * 
 *     def setCreateSubDM(             # <<<<<<<<<<<<<<
 *         self,
 *         create_subdm: Callable[[DM, Sequence[int]], tuple[IS, DM]] | None,
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(60, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_create_subdm, __pyx_mstate_global->__pyx_kp_u_Callable_DM_Sequence_int_tuple_I) < (0)) __PYX_ERR(60, 624, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_args, __pyx_mstate_global->__pyx_kp_u_tuple_Any_None) < (0)) __PYX_ERR(60, 624, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_kargs, __pyx_mstate_global->__pyx_kp_u_dict_str_Any_None) < (0)) __PYX_ERR(60, 624, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(60, 624, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMShell_43setCreateSubDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMShell_setCreateSubDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1861])); if (unlikely(!__pyx_t_4)) __PYX_ERR(60, 624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMShell, __pyx_mstate_global->__pyx_n_u_setCreateSubDM, __pyx_t_4) < (0)) __PYX_ERR(60, 624, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":8
 *         self.dmlabel  = NULL
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the label.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(61, 8, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_3destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1862])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_5) < (0)) __PYX_ERR(61, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":21
 *         return self
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the label.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(61, 21, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_5view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1863])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_4) < (0)) __PYX_ERR(61, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(61, 40, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(61, 40, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(61, 40, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_7create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1864])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_5) < (0)) __PYX_ERR(61, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":65
 *         return self
 * 
 *     def duplicate(self) -> DMLabel:             # <<<<<<<<<<<<<<
 *         """Duplicate the `DMLabel`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DMLabel) < (0)) __PYX_ERR(61, 65, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_9duplicate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_duplicate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1865])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_duplicate, __pyx_t_4) < (0)) __PYX_ERR(61, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":79
 *         return new
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         """Destroy internal data structures in the `DMLabel`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(61, 79, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_11reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_reset, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1866])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_5) < (0)) __PYX_ERR(61, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 91, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(61, 91, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_13insertIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_insertIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1867])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_insertIS, __pyx_t_4) < (0)) __PYX_ERR(61, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":112
 *         return self
 * 
 *     def setValue(self, point: int, value: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the value a label assigns to a point.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 112, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 112, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(61, 112, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_15setValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_setValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1868])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_setValue, __pyx_t_5) < (0)) __PYX_ERR(61, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "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.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 137, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 137, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_17getValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_getValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1869])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_getValue, __pyx_t_4) < (0)) __PYX_ERR(61, 137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":161
 *         return toInt(cvalue)
 * 
 *     def getDefaultValue(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the default value returned by `getValue`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 161, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_19getDefaultValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_getDefaultValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1870])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_getDefaultValue, __pyx_t_5) < (0)) __PYX_ERR(61, 161, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":178
 *         return toInt(cvalue)
 * 
 *     def setDefaultValue(self, value: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the default value returned by `getValue`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 178, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(61, 178, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_21setDefaultValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_setDefaultValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1871])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_setDefaultValue, __pyx_t_4) < (0)) __PYX_ERR(61, 178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 199, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(61, 199, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_23clearValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_clearValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1872])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_clearValue, __pyx_t_5) < (0)) __PYX_ERR(61, 199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "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`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 220, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(61, 220, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_25addStratum, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_addStratum, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1873])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_addStratum, __pyx_t_4) < (0)) __PYX_ERR(61, 220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":238
 *         CHKERR(DMLabelAddStratum(self.dmlabel, cvalue))
 * 
 *     def addStrata(self, strata: Sequence[int]) -> None:             # <<<<<<<<<<<<<<
 *         """Add new stratum values in a `DMLabel`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_strata, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(61, 238, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(61, 238, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_27addStrata, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_addStrata, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1874])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_addStrata, __pyx_t_5) < (0)) __PYX_ERR(61, 238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":258
 *         CHKERR(DMLabelAddStrata(self.dmlabel, numStrata, istrata))
 * 
 *     def addStrataIS(self, IS iset) -> None:             # <<<<<<<<<<<<<<
 *         """Add new stratum values in a `DMLabel`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(61, 258, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_29addStrataIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_addStrataIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1875])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_addStrataIS, __pyx_t_4) < (0)) __PYX_ERR(61, 258, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":275
 *         CHKERR(DMLabelAddStrataIS(self.dmlabel, iset.iset))
 * 
 *     def getNumValues(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of values that the `DMLabel` takes.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 275, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_31getNumValues, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_getNumValues, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1876])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_getNumValues, __pyx_t_5) < (0)) __PYX_ERR(61, 275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":289
 *         return toInt(numValues)
 * 
 *     def getValueIS(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return an `IS` of all values that the `DMLabel` takes.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(61, 289, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_33getValueIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_getValueIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1877])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_getValueIS, __pyx_t_4) < (0)) __PYX_ERR(61, 289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":303
 *         return iset
 * 
 *     def stratumHasPoint(self, value: int, point: int) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the stratum contains a point.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 303, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 303, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(61, 303, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_35stratumHasPoint, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_stratumHasPoint, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1878])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_stratumHasPoint, __pyx_t_5) < (0)) __PYX_ERR(61, 303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":326
 *         return toBool(ccontains)
 * 
 *     def hasStratum(self, value: int) -> bool:             # <<<<<<<<<<<<<<
 *         """Determine whether points exist with the given value.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 326, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(61, 326, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_37hasStratum, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_hasStratum, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1879])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_hasStratum, __pyx_t_4) < (0)) __PYX_ERR(61, 326, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":346
 *         return toBool(cexists)
 * 
 *     def getStratumSize(self, stratum: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the size of a stratum.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_stratum, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 346, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 346, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_39getStratumSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_getStratumSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1880])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_getStratumSize, __pyx_t_5) < (0)) __PYX_ERR(61, 346, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":366
 *         return toInt(csize)
 * 
 *     def getStratumIS(self, stratum: int) -> IS:             # <<<<<<<<<<<<<<
 *         """Return an `IS` with the stratum points.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stratum, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 366, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(61, 366, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_41getStratumIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_getStratumIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1881])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_getStratumIS, __pyx_t_4) < (0)) __PYX_ERR(61, 366, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":386
 *         return iset
 * 
 *     def setStratumIS(self, stratum: int, IS iset) -> None:             # <<<<<<<<<<<<<<
 *         """Set the stratum points using an `IS`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_stratum, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 386, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(61, 386, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_43setStratumIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_setStratumIS, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1882])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_setStratumIS, __pyx_t_5) < (0)) __PYX_ERR(61, 386, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":406
 *         CHKERR(DMLabelSetStratumIS(self.dmlabel, cstratum, iset.iset))
 * 
 *     def clearStratum(self, stratum: int) -> None:             # <<<<<<<<<<<<<<
 *         """Remove a stratum.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_stratum, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 406, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(61, 406, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_45clearStratum, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_clearStratum, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1883])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_clearStratum, __pyx_t_4) < (0)) __PYX_ERR(61, 406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":424
 *         CHKERR(DMLabelClearStratum(self.dmlabel, cstratum))
 * 
 *     def computeIndex(self) -> None:             # <<<<<<<<<<<<<<
 *         """Create an index structure for membership determination.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(61, 424, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_47computeIndex, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_computeIndex, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1884])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_computeIndex, __pyx_t_5) < (0)) __PYX_ERR(61, 424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":438
 *         CHKERR(DMLabelComputeIndex(self.dmlabel))
 * 
 *     def createIndex(self, pStart: int, pEnd: int) -> None:             # <<<<<<<<<<<<<<
 *         """Create an index structure for membership determination.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pStart, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 438, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_pEnd, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 438, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(61, 438, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_49createIndex, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_createIndex, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1885])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_createIndex, __pyx_t_4) < (0)) __PYX_ERR(61, 438, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":458
 *         CHKERR(DMLabelCreateIndex(self.dmlabel, cpstart, cpend))
 * 
 *     def destroyIndex(self) -> None:             # <<<<<<<<<<<<<<
 *         """Destroy the index structure.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(61, 458, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_51destroyIndex, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_destroyIndex, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1886])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_destroyIndex, __pyx_t_5) < (0)) __PYX_ERR(61, 458, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":470
 *         CHKERR(DMLabelDestroyIndex(self.dmlabel))
 * 
 *     def hasValue(self, value: int) -> bool:             # <<<<<<<<<<<<<<
 *         """Determine whether a label assigns the value to any point.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_value, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 470, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(61, 470, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_53hasValue, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_hasValue, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1887])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_hasValue, __pyx_t_4) < (0)) __PYX_ERR(61, 470, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":490
 *         return toBool(cexists)
 * 
 *     def hasPoint(self, point: int) -> bool:             # <<<<<<<<<<<<<<
 *         """Determine whether the label contains a point.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_point, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 490, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(61, 490, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_55hasPoint, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_hasPoint, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1888])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 490, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_hasPoint, __pyx_t_5) < (0)) __PYX_ERR(61, 490, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":512
 *         return toBool(cexists)
 * 
 *     def getBounds(self) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return the smallest and largest point in the label.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(61, 512, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_57getBounds, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_getBounds, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1889])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_getBounds, __pyx_t_4) < (0)) __PYX_ERR(61, 512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":528
 *         return toInt(cpstart), toInt(cpend)
 * 
 *     def filter(self, start: int, end: int) -> None:             # <<<<<<<<<<<<<<
 *         """Remove all points outside of [start, end).
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_start, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 528, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_end, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(61, 528, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(61, 528, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_59filter, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_filter, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1890])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_filter, __pyx_t_5) < (0)) __PYX_ERR(61, 528, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":548
 *         CHKERR(DMLabelFilter(self.dmlabel, cstart, cend))
 * 
 *     def permute(self, IS permutation) -> DMLabel:             # <<<<<<<<<<<<<<
 *         """Create a new label with permuted points.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DMLabel) < (0)) __PYX_ERR(61, 548, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_61permute, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_permute, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1891])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_permute, __pyx_t_4) < (0)) __PYX_ERR(61, 548, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":567
 *         return new
 * 
 *     def distribute(self, SF sf) -> DMLabel:             # <<<<<<<<<<<<<<
 *         """Create a new label pushed forward over the `SF`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DMLabel) < (0)) __PYX_ERR(61, 567, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_63distribute, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_distribute, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1892])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_distribute, __pyx_t_5) < (0)) __PYX_ERR(61, 567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":586
 *         return new
 * 
 *     def gather(self, SF sf) -> DMLabel:             # <<<<<<<<<<<<<<
 *         """Gather all label values from leaves into roots.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DMLabel) < (0)) __PYX_ERR(61, 586, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_65gather, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_gather, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1893])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_gather, __pyx_t_4) < (0)) __PYX_ERR(61, 586, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":607
 *         return new
 * 
 *     def convertToSection(self) -> tuple[Section, IS]:             # <<<<<<<<<<<<<<
 *         """Return a `Section` and `IS` that encode the label.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_Section_IS) < (0)) __PYX_ERR(61, 607, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_67convertToSection, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_convertToSection, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1894])); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_convertToSection, __pyx_t_5) < (0)) __PYX_ERR(61, 607, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMLabel.pyx":622
 *         return section, iset
 * 
 *     def getNonEmptyStratumValuesIS(self) -> IS:             # <<<<<<<<<<<<<<
 *         """Return an `IS` of all values that the `DMLabel` takes.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(61, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_IS) < (0)) __PYX_ERR(61, 622, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMLabel_69getNonEmptyStratumValuesIS, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMLabel_getNonEmptyStratumValues, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1895])); if (unlikely(!__pyx_t_4)) __PYX_ERR(61, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMLabel, __pyx_mstate_global->__pyx_n_u_getNonEmptyStratumValuesIS, __pyx_t_4) < (0)) __PYX_ERR(61, 622, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class DMSwarmType(object):             # <<<<<<<<<<<<<<
 *     """Swarm types."""
 *     BASIC = DMSWARM_BASIC
*/
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[196]); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMSwarmType, __pyx_mstate_global->__pyx_n_u_DMSwarmType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Swarm_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[196]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[196]) < 0))) __PYX_ERR(62, 3, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":5
 * class DMSwarmType(object):
 *     """Swarm types."""
 *     BASIC = DMSWARM_BASIC             # <<<<<<<<<<<<<<
 *     PIC = DMSWARM_PIC
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMSwarmType(DMSWARM_BASIC); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_BASIC, __pyx_t_14) < (0)) __PYX_ERR(62, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":6
 *     """Swarm types."""
 *     BASIC = DMSWARM_BASIC
 *     PIC = DMSWARM_PIC             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMSwarmType(DMSWARM_PIC); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PIC, __pyx_t_14) < (0)) __PYX_ERR(62, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class DMSwarmType(object):             # <<<<<<<<<<<<<<
 *     """Swarm types."""
 *     BASIC = DMSWARM_BASIC
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMSwarmType, __pyx_t_4, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DMSwarmType, __pyx_t_14) < (0)) __PYX_ERR(62, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __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;

  /* "petsc4py/PETSc/DMSwarm.pyx":9
 * 
 * 
 * class DMSwarmMigrateType(object):             # <<<<<<<<<<<<<<
 *     """Swarm migration types."""
 *     MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC
*/
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[198]); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMSwarmMigrateType, __pyx_mstate_global->__pyx_n_u_DMSwarmMigrateType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Swarm_migration_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[198]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[198]) < 0))) __PYX_ERR(62, 9, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":11
 * class DMSwarmMigrateType(object):
 *     """Swarm migration types."""
 *     MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC             # <<<<<<<<<<<<<<
 *     MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER
 *     MIGRATE_DMCELLEXACT = DMSWARM_MIGRATE_DMCELLEXACT
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMSwarmMigrateType(DMSWARM_MIGRATE_BASIC); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MIGRATE_BASIC, __pyx_t_14) < (0)) __PYX_ERR(62, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":12
 *     """Swarm migration types."""
 *     MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC
 *     MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER             # <<<<<<<<<<<<<<
 *     MIGRATE_DMCELLEXACT = DMSWARM_MIGRATE_DMCELLEXACT
 *     MIGRATE_USER = DMSWARM_MIGRATE_USER
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMSwarmMigrateType(DMSWARM_MIGRATE_DMCELLNSCATTER); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MIGRATE_DMCELLNSCATTER, __pyx_t_14) < (0)) __PYX_ERR(62, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":13
 *     MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC
 *     MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER
 *     MIGRATE_DMCELLEXACT = DMSWARM_MIGRATE_DMCELLEXACT             # <<<<<<<<<<<<<<
 *     MIGRATE_USER = DMSWARM_MIGRATE_USER
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMSwarmMigrateType(DMSWARM_MIGRATE_DMCELLEXACT); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MIGRATE_DMCELLEXACT, __pyx_t_14) < (0)) __PYX_ERR(62, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":14
 *     MIGRATE_DMCELLNSCATTER = DMSWARM_MIGRATE_DMCELLNSCATTER
 *     MIGRATE_DMCELLEXACT = DMSWARM_MIGRATE_DMCELLEXACT
 *     MIGRATE_USER = DMSWARM_MIGRATE_USER             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMSwarmMigrateType(DMSWARM_MIGRATE_USER); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_MIGRATE_USER, __pyx_t_14) < (0)) __PYX_ERR(62, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":9
 * 
 * 
 * class DMSwarmMigrateType(object):             # <<<<<<<<<<<<<<
 *     """Swarm migration types."""
 *     MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMSwarmMigrateType, __pyx_t_4, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DMSwarmMigrateType, __pyx_t_14) < (0)) __PYX_ERR(62, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __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;

  /* "petsc4py/PETSc/DMSwarm.pyx":17
 * 
 * 
 * class DMSwarmCollectType(object):             # <<<<<<<<<<<<<<
 *     """Swarm collection types."""
 *     COLLECT_BASIC = DMSWARM_COLLECT_BASIC
*/
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[200]); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMSwarmCollectType, __pyx_mstate_global->__pyx_n_u_DMSwarmCollectType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Swarm_collection_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[200]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[200]) < 0))) __PYX_ERR(62, 17, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":19
 * class DMSwarmCollectType(object):
 *     """Swarm collection types."""
 *     COLLECT_BASIC = DMSWARM_COLLECT_BASIC             # <<<<<<<<<<<<<<
 *     COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX
 *     COLLECT_GENERAL = DMSWARM_COLLECT_GENERAL
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMSwarmCollectType(DMSWARM_COLLECT_BASIC); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_COLLECT_BASIC, __pyx_t_14) < (0)) __PYX_ERR(62, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":20
 *     """Swarm collection types."""
 *     COLLECT_BASIC = DMSWARM_COLLECT_BASIC
 *     COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX             # <<<<<<<<<<<<<<
 *     COLLECT_GENERAL = DMSWARM_COLLECT_GENERAL
 *     COLLECT_USER = DMSWARM_COLLECT_USER
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMSwarmCollectType(DMSWARM_COLLECT_DMDABOUNDINGBOX); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_COLLECT_DMDABOUNDINGBOX, __pyx_t_14) < (0)) __PYX_ERR(62, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":21
 *     COLLECT_BASIC = DMSWARM_COLLECT_BASIC
 *     COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX
 *     COLLECT_GENERAL = DMSWARM_COLLECT_GENERAL             # <<<<<<<<<<<<<<
 *     COLLECT_USER = DMSWARM_COLLECT_USER
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMSwarmCollectType(DMSWARM_COLLECT_GENERAL); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_COLLECT_GENERAL, __pyx_t_14) < (0)) __PYX_ERR(62, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":22
 *     COLLECT_DMDABOUNDINGBOX = DMSWARM_COLLECT_DMDABOUNDINGBOX
 *     COLLECT_GENERAL = DMSWARM_COLLECT_GENERAL
 *     COLLECT_USER = DMSWARM_COLLECT_USER             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMSwarmCollectType(DMSWARM_COLLECT_USER); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_COLLECT_USER, __pyx_t_14) < (0)) __PYX_ERR(62, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":17
 * 
 * 
 * class DMSwarmCollectType(object):             # <<<<<<<<<<<<<<
 *     """Swarm collection types."""
 *     COLLECT_BASIC = DMSWARM_COLLECT_BASIC
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMSwarmCollectType, __pyx_t_4, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DMSwarmCollectType, __pyx_t_14) < (0)) __PYX_ERR(62, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __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;

  /* "petsc4py/PETSc/DMSwarm.pyx":25
 * 
 * 
 * class DMSwarmPICLayoutType(object):             # <<<<<<<<<<<<<<
 *     """Swarm PIC layout types."""
 *     LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR
*/
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[202]); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMSwarmPICLayoutType, __pyx_mstate_global->__pyx_n_u_DMSwarmPICLayoutType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Swarm_PIC_layout_types); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[202]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[202]) < 0))) __PYX_ERR(62, 25, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/DMSwarm.pyx":27
 * class DMSwarmPICLayoutType(object):
 *     """Swarm PIC layout types."""
 *     LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR             # <<<<<<<<<<<<<<
 *     LAYOUT_GAUSS = DMSWARMPIC_LAYOUT_GAUSS
 *     LAYOUT_SUBDIVISION = DMSWARMPIC_LAYOUT_SUBDIVISION
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMSwarmPICLayoutType(DMSWARMPIC_LAYOUT_REGULAR); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LAYOUT_REGULAR, __pyx_t_14) < (0)) __PYX_ERR(62, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":28
 *     """Swarm PIC layout types."""
 *     LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR
 *     LAYOUT_GAUSS = DMSWARMPIC_LAYOUT_GAUSS             # <<<<<<<<<<<<<<
 *     LAYOUT_SUBDIVISION = DMSWARMPIC_LAYOUT_SUBDIVISION
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMSwarmPICLayoutType(DMSWARMPIC_LAYOUT_GAUSS); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LAYOUT_GAUSS, __pyx_t_14) < (0)) __PYX_ERR(62, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":29
 *     LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR
 *     LAYOUT_GAUSS = DMSWARMPIC_LAYOUT_GAUSS
 *     LAYOUT_SUBDIVISION = DMSWARMPIC_LAYOUT_SUBDIVISION             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_DMSwarmPICLayoutType(DMSWARMPIC_LAYOUT_SUBDIVISION); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_LAYOUT_SUBDIVISION, __pyx_t_14) < (0)) __PYX_ERR(62, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":25
 * 
 * 
 * class DMSwarmPICLayoutType(object):             # <<<<<<<<<<<<<<
 *     """Swarm PIC layout types."""
 *     LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_DMSwarmPICLayoutType, __pyx_t_4, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(62, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DMSwarmPICLayoutType, __pyx_t_14) < (0)) __PYX_ERR(62, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __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;

  /* "petsc4py/PETSc/DMSwarm.pyx":34
 * 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_4, __pyx_mstate_global->__pyx_n_u_DMSwarmType); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_4) < (0)) __PYX_ERR(62, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":35
 *     """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_4, __pyx_mstate_global->__pyx_n_u_DMSwarmMigrateType); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_MigrateType, __pyx_t_4) < (0)) __PYX_ERR(62, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":36
 *     Type = DMSwarmType
 *     MigrateType = DMSwarmMigrateType
 *     CollectType = DMSwarmCollectType             # <<<<<<<<<<<<<<
 *     PICLayoutType = DMSwarmPICLayoutType
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMSwarmCollectType); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_CollectType, __pyx_t_4) < (0)) __PYX_ERR(62, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":37
 *     MigrateType = DMSwarmMigrateType
 *     CollectType = DMSwarmCollectType
 *     PICLayoutType = DMSwarmPICLayoutType             # <<<<<<<<<<<<<<
 * 
 *     def create(self, comm: Comm | None = None) -> Self:
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DMSwarmPICLayoutType); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_PICLayoutType, __pyx_t_4) < (0)) __PYX_ERR(62, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":39
 *     PICLayoutType = DMSwarmPICLayoutType
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an empty DM object and set its type to `DM.Type.SWARM`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(62, 39, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(62, 39, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_1create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1896])); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_5) < (0)) __PYX_ERR(62, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":65
 *         return self
 * 
 *     def createGlobalVectorFromField(self, fieldname: str) -> Vec:             # <<<<<<<<<<<<<<
 *         """Create a global `Vec` object associated with a given field.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_fieldname, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(62, 65, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(62, 65, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_3createGlobalVectorFromField, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_createGlobalVectorFromFi, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1897])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_createGlobalVectorFromField, __pyx_t_4) < (0)) __PYX_ERR(62, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":89
 *         return vg
 * 
 *     def destroyGlobalVectorFromField(self, fieldname: str) -> None:             # <<<<<<<<<<<<<<
 *         """Destroy the global `Vec` object associated with a given field.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fieldname, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(62, 89, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 89, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_5destroyGlobalVectorFromField, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_destroyGlobalVectorFromF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1898])); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_destroyGlobalVectorFromField, __pyx_t_5) < (0)) __PYX_ERR(62, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":109
 *         CHKERR(DMSwarmDestroyGlobalVectorFromField(self.dm, cfieldname, &vec))
 * 
 *     def createGlobalVectorFromFields(self, fieldnames: Sequence[str]) -> Vec:             # <<<<<<<<<<<<<<
 *         """Create a global `Vec` object associated with a given set of fields.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_fieldnames, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < (0)) __PYX_ERR(62, 109, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(62, 109, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_7createGlobalVectorFromFields, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_createGlobalVectorFromFi_2, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1899])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_createGlobalVectorFromFields, __pyx_t_4) < (0)) __PYX_ERR(62, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":139
 *         return vg
 * 
 *     def destroyGlobalVectorFromFields(self, fieldnames: Sequence[str]) -> None:             # <<<<<<<<<<<<<<
 *         """Destroy the global `Vec` object associated with a given set of fields.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fieldnames, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < (0)) __PYX_ERR(62, 139, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 139, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_9destroyGlobalVectorFromFields, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_destroyGlobalVectorFromF_2, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1900])); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_destroyGlobalVectorFromFields, __pyx_t_5) < (0)) __PYX_ERR(62, 139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":165
 *         CHKERR(DMSwarmDestroyGlobalVectorFromFields(self.dm, nf, cfieldnames, &vec))
 * 
 *     def createLocalVectorFromField(self, fieldname: str) -> Vec:             # <<<<<<<<<<<<<<
 *         """Create a local `Vec` object associated with a given field.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_fieldname, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(62, 165, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(62, 165, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_11createLocalVectorFromField, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_createLocalVectorFromFie, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1901])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_createLocalVectorFromField, __pyx_t_4) < (0)) __PYX_ERR(62, 165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":189
 *         return vl
 * 
 *     def destroyLocalVectorFromField(self, fieldname: str) -> None:             # <<<<<<<<<<<<<<
 *         """Destroy the local `Vec` object associated with a given field.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fieldname, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(62, 189, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 189, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_13destroyLocalVectorFromField, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_destroyLocalVectorFromFi, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1902])); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_destroyLocalVectorFromField, __pyx_t_5) < (0)) __PYX_ERR(62, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":209
 *         CHKERR(DMSwarmDestroyLocalVectorFromField(self.dm, cfieldname, &vec))
 * 
 *     def createLocalVectorFromFields(self, fieldnames: Sequence[str]) -> Vec:             # <<<<<<<<<<<<<<
 *         """Create a local `Vec` object associated with a given set of fields.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_fieldnames, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < (0)) __PYX_ERR(62, 209, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(62, 209, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_15createLocalVectorFromFields, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_createLocalVectorFromFie_2, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1903])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_createLocalVectorFromFields, __pyx_t_4) < (0)) __PYX_ERR(62, 209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":239
 *         return vl
 * 
 *     def destroyLocalVectorFromFields(self, fieldnames: Sequence[str]) -> None:             # <<<<<<<<<<<<<<
 *         """Destroy the local `Vec` object associated with a given set of fields.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fieldnames, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < (0)) __PYX_ERR(62, 239, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 239, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_17destroyLocalVectorFromFields, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_destroyLocalVectorFromFi_2, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1904])); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_destroyLocalVectorFromFields, __pyx_t_5) < (0)) __PYX_ERR(62, 239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":265
 *         CHKERR(DMSwarmDestroyLocalVectorFromFields(self.dm, nf, cfieldnames, &vec))
 * 
 *     def initializeFieldRegister(self) -> None:             # <<<<<<<<<<<<<<
 *         """Initiate the registration of fields to a `DMSwarm`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 265, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_19initializeFieldRegister, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_initializeFieldRegister, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1905])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_initializeFieldRegister, __pyx_t_4) < (0)) __PYX_ERR(62, 265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":279
 *         CHKERR(DMSwarmInitializeFieldRegister(self.dm))
 * 
 *     def finalizeFieldRegister(self) -> None:             # <<<<<<<<<<<<<<
 *         """Finalize the registration of fields to a `DMSwarm`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 279, __pyx_L1_error)
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_21finalizeFieldRegister, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_finalizeFieldRegister, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1906])); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_5);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_5, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_finalizeFieldRegister, __pyx_t_5) < (0)) __PYX_ERR(62, 279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":291
 *         CHKERR(DMSwarmFinalizeFieldRegister(self.dm))
 * 
 *     def setLocalSizes(self, nlocal: int, buffer: int) -> Self:             # <<<<<<<<<<<<<<
 *         """Set the length of all registered fields on the `DMSwarm`.
 * 
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_nlocal, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(62, 291, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_buffer, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(62, 291, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(62, 291, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_23setLocalSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_setLocalSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1907])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_setLocalSizes, __pyx_t_4) < (0)) __PYX_ERR(62, 291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":313
 *         return self
 * 
 *     def registerField(self, fieldname: str, blocksize: int, dtype: type | dtype = ScalarType) -> None:             # <<<<<<<<<<<<<<
 *         """Register a field to a `DMSwarm` with a native PETSc data type.
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ScalarType); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_mstate_global->__pyx_k__26 = __pyx_t_4;
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ScalarType); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_Pack(1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(62, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fieldname, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(62, 313, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_blocksize, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(62, 313, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dtype, __pyx_mstate_global->__pyx_kp_u_type_dtype) < (0)) __PYX_ERR(62, 313, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 313, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_25registerField, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_registerField, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1908])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_t_5);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_registerField, __pyx_t_10) < (0)) __PYX_ERR(62, 313, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":343
 *         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.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_fieldname, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(62, 343, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_Sequence_int_float_complex) < (0)) __PYX_ERR(62, 343, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_27getField, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_getField, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1909])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_getField, __pyx_t_4) < (0)) __PYX_ERR(62, 343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":389
 *         return <object> PyArray_SimpleNewFromData(2, s, typenum, data)
 * 
 *     def restoreField(self, fieldname: str) -> None:             # <<<<<<<<<<<<<<
 *         """Restore accesses associated with a registered field.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fieldname, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(62, 389, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 389, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_29restoreField, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_restoreField, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1910])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_restoreField, __pyx_t_10) < (0)) __PYX_ERR(62, 389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":410
 *         CHKERR(DMSwarmRestoreField(self.dm, cfieldname, &blocksize, &ctype, <void**> 0))
 * 
 *     def vectorDefineField(self, fieldname: str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the fields from which to define a `Vec` object.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_fieldname, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(62, 410, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 410, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_31vectorDefineField, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_vectorDefineField, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1911])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_vectorDefineField, __pyx_t_4) < (0)) __PYX_ERR(62, 410, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":432
 *         CHKERR(DMSwarmVectorDefineField(self.dm, cval))
 * 
 *     def addPoint(self) -> None:             # <<<<<<<<<<<<<<
 *         """Add space for one new point in the `DMSwarm`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 432, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_33addPoint, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_addPoint, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1912])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_addPoint, __pyx_t_10) < (0)) __PYX_ERR(62, 432, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":444
 *         CHKERR(DMSwarmAddPoint(self.dm))
 * 
 *     def addNPoints(self, npoints: int) -> None:             # <<<<<<<<<<<<<<
 *         """Add space for a number of new points in the `DMSwarm`.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_npoints, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(62, 444, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 444, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_35addNPoints, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_addNPoints, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1913])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_addNPoints, __pyx_t_4) < (0)) __PYX_ERR(62, 444, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":462
 *         CHKERR(DMSwarmAddNPoints(self.dm, cnpoints))
 * 
 *     def removePoint(self) -> None:             # <<<<<<<<<<<<<<
 *         """Remove the last point from the `DMSwarm`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 462, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_37removePoint, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_removePoint, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1914])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_removePoint, __pyx_t_10) < (0)) __PYX_ERR(62, 462, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":474
 *         CHKERR(DMSwarmRemovePoint(self.dm))
 * 
 *     def removePointAtIndex(self, index: int) -> None:             # <<<<<<<<<<<<<<
 *         """Remove a specific point from the `DMSwarm`.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_index, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(62, 474, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 474, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_39removePointAtIndex, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_removePointAtIndex, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1915])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_removePointAtIndex, __pyx_t_4) < (0)) __PYX_ERR(62, 474, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":492
 *         CHKERR(DMSwarmRemovePointAtIndex(self.dm, cindex))
 * 
 *     def copyPoint(self, pi: int, pj: int) -> None:             # <<<<<<<<<<<<<<
 *         """Copy point pi to point pj in the `DMSwarm`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pi, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(62, 492, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_pj, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(62, 492, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 492, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_41copyPoint, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_copyPoint, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1916])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_copyPoint, __pyx_t_10) < (0)) __PYX_ERR(62, 492, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":513
 *         CHKERR(DMSwarmCopyPoint(self.dm, cpi, cpj))
 * 
 *     def getLocalSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the local length of fields registered.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(62, 513, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_43getLocalSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_getLocalSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1917])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_getLocalSize, __pyx_t_4) < (0)) __PYX_ERR(62, 513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":527
 *         return toInt(size)
 * 
 *     def getSize(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the total length of fields registered.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(62, 527, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_45getSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_getSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1918])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_getSize, __pyx_t_10) < (0)) __PYX_ERR(62, 527, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":541
 *         return toInt(size)
 * 
 *     def migrate(self, remove_sent_points: bool = False) -> None:             # <<<<<<<<<<<<<<
 *         """Relocate points defined in the `DMSwarm` to other MPI ranks.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_remove_sent_points, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(62, 541, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 541, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_47migrate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_migrate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1919])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_migrate, __pyx_t_4) < (0)) __PYX_ERR(62, 541, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":560
 *         CHKERR(DMSwarmMigrate(self.dm, remove_pts))
 * 
 *     def collectViewCreate(self) -> None:             # <<<<<<<<<<<<<<
 *         """Apply a collection method and gather points in neighbor ranks.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 560, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_49collectViewCreate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_collectViewCreate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1920])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_collectViewCreate, __pyx_t_10) < (0)) __PYX_ERR(62, 560, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":572
 *         CHKERR(DMSwarmCollectViewCreate(self.dm))
 * 
 *     def collectViewDestroy(self) -> None:             # <<<<<<<<<<<<<<
 *         """Reset the `DMSwarm` to the size prior to calling `collectViewCreate`.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 572, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_51collectViewDestroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_collectViewDestroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1921])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_collectViewDestroy, __pyx_t_4) < (0)) __PYX_ERR(62, 572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":584
 *         CHKERR(DMSwarmCollectViewDestroy(self.dm))
 * 
 *     def setCellDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Attach a `DM` to a `DMSwarm`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 584, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_53setCellDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_setCellDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1922])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_setCellDM, __pyx_t_10) < (0)) __PYX_ERR(62, 584, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":601
 *         CHKERR(DMSwarmSetCellDM(self.dm, dm.dm))
 * 
 *     def getCellDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return `DM` cell attached to `DMSwarm`.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(62, 601, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_55getCellDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_getCellDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1923])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_getCellDM, __pyx_t_4) < (0)) __PYX_ERR(62, 601, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":618
 *         return dm
 * 
 *     def setType(self, dmswarm_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set particular flavor of `DMSwarm`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dmswarm_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(62, 618, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 618, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_57setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1924])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_10) < (0)) __PYX_ERR(62, 618, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":636
 *         CHKERR(DMSwarmSetType(self.dm, cval))
 * 
 *     def setPointsUniformCoordinates(             # <<<<<<<<<<<<<<
 *         self,
 *         min: Sequence[float],
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_min, __pyx_mstate_global->__pyx_kp_u_Sequence_float) < (0)) __PYX_ERR(62, 636, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_max, __pyx_mstate_global->__pyx_kp_u_Sequence_float) < (0)) __PYX_ERR(62, 636, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_npoints, __pyx_mstate_global->__pyx_kp_u_Sequence_int) < (0)) __PYX_ERR(62, 636, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_kp_u_InsertMode_None) < (0)) __PYX_ERR(62, 636, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(62, 636, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_59setPointsUniformCoordinates, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_setPointsUniformCoordina, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1925])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_setPointsUniformCoordinates, __pyx_t_4) < (0)) __PYX_ERR(62, 636, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":680
 *         return self
 * 
 *     def setPointCoordinates(             # <<<<<<<<<<<<<<
 *         self,
 *         coordinates: Sequence[float],
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_coordinates, __pyx_mstate_global->__pyx_kp_u_Sequence_float) < (0)) __PYX_ERR(62, 680, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_redundant, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(62, 680, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_kp_u_InsertMode_None) < (0)) __PYX_ERR(62, 680, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 680, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_61setPointCoordinates, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_setPointCoordinates, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1926])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[118]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_setPointCoordinates, __pyx_t_10) < (0)) __PYX_ERR(62, 680, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":716
 *         CHKERR(DMSwarmSetPointCoordinates(self.dm, cnpoints, coords, credundant, cmode))
 * 
 *     def insertPointUsingCellDM(self, layoutType: PICLayoutType, fill_param: int) -> None:             # <<<<<<<<<<<<<<
 *         """Insert point coordinates within each cell.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_layoutType, __pyx_mstate_global->__pyx_n_u_PICLayoutType) < (0)) __PYX_ERR(62, 716, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_fill_param, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(62, 716, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 716, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_63insertPointUsingCellDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_insertPointUsingCellDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1927])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_insertPointUsingCellDM, __pyx_t_4) < (0)) __PYX_ERR(62, 716, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":738
 *         CHKERR(DMSwarmInsertPointsUsingCellDM(self.dm, clayoutType, cfill_param))
 * 
 *     def setPointCoordinatesCellwise(self, coordinates: Sequence[float]) -> None:             # <<<<<<<<<<<<<<
 *         """Insert point coordinates within each cell.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_coordinates, __pyx_mstate_global->__pyx_kp_u_Sequence_float) < (0)) __PYX_ERR(62, 738, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 738, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_65setPointCoordinatesCellwise, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_setPointCoordinatesCellw, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1928])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_setPointCoordinatesCellwise, __pyx_t_10) < (0)) __PYX_ERR(62, 738, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":765
 *         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.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_filename, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(62, 765, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_fieldnames, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < (0)) __PYX_ERR(62, 765, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 765, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_67viewFieldsXDMF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_viewFieldsXDMF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1929])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_viewFieldsXDMF, __pyx_t_4) < (0)) __PYX_ERR(62, 765, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":794
 *         CHKERR(DMSwarmViewFieldsXDMF(self.dm, cfilename, cnfields, cfieldnames))
 * 
 *     def viewXDMF(self, filename: str) -> None:             # <<<<<<<<<<<<<<
 *         """Write this `DMSwarm` fields to an XDMF3 file.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_filename, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(62, 794, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 794, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_69viewXDMF, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_viewXDMF, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1930])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_viewXDMF, __pyx_t_10) < (0)) __PYX_ERR(62, 794, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":813
 *         CHKERR(DMSwarmViewXDMF(self.dm, cval))
 * 
 *     def sortGetAccess(self) -> None:             # <<<<<<<<<<<<<<
 *         """Setup up a `DMSwarm` point sort context.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 813, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_71sortGetAccess, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_sortGetAccess, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1931])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 813, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_sortGetAccess, __pyx_t_4) < (0)) __PYX_ERR(62, 813, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":831
 *         CHKERR(DMSwarmSortGetAccess(self.dm))
 * 
 *     def sortRestoreAccess(self) -> None:             # <<<<<<<<<<<<<<
 *         """Invalidate the `DMSwarm` point sorting context.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 831, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_73sortRestoreAccess, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_sortRestoreAccess, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1932])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_sortRestoreAccess, __pyx_t_10) < (0)) __PYX_ERR(62, 831, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":843
 *         CHKERR(DMSwarmSortRestoreAccess(self.dm))
 * 
 *     def sortGetPointsPerCell(self, e: int) -> list[int]:             # <<<<<<<<<<<<<<
 *         """Create an array of point indices for all points in a cell.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_e, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(62, 843, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_int) < (0)) __PYX_ERR(62, 843, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_75sortGetPointsPerCell, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_sortGetPointsPerCell, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1933])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_sortGetPointsPerCell, __pyx_t_4) < (0)) __PYX_ERR(62, 843, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":867
 *         return pidlist
 * 
 *     def sortGetNumberOfPointsPerCell(self, e: int) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of points in a cell.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_e, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(62, 867, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(62, 867, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_77sortGetNumberOfPointsPerCell, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_sortGetNumberOfPointsPer, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1934])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_sortGetNumberOfPointsPerCell, __pyx_t_10) < (0)) __PYX_ERR(62, 867, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":887
 *         return toInt(npoints)
 * 
 *     def sortGetIsValid(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the sort context is up-to-date.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(62, 887, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_79sortGetIsValid, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_sortGetIsValid, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1935])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_sortGetIsValid, __pyx_t_4) < (0)) __PYX_ERR(62, 887, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":903
 *         return toBool(isValid)
 * 
 *     def sortGetSizes(self) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return the sizes associated with a `DMSwarm` point sorting context.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(62, 903, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_81sortGetSizes, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_sortGetSizes, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1936])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_sortGetSizes, __pyx_t_10) < (0)) __PYX_ERR(62, 903, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":925
 *         return (toInt(ncells), toInt(npoints))
 * 
 *     def projectFields(self, DM dm, fieldnames: Sequence[str], vecs: Sequence[Vec], mode: ScatterModeSpec = None) -> None:             # <<<<<<<<<<<<<<
 *         """Project a set of `DMSwarm` fields onto the cell `DM`.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_fieldnames, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < (0)) __PYX_ERR(62, 925, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_vecs, __pyx_mstate_global->__pyx_kp_u_Sequence_Vec) < (0)) __PYX_ERR(62, 925, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_mode, __pyx_mstate_global->__pyx_n_u_ScatterModeSpec) < (0)) __PYX_ERR(62, 925, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 925, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_83projectFields, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_projectFields, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1937])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_projectFields, __pyx_t_4) < (0)) __PYX_ERR(62, 925, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":957
 *         return
 * 
 *     def addCellDM(self, CellDM celldm) -> None:             # <<<<<<<<<<<<<<
 *         """Add a cell DM to the `DMSwarm`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 957, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_85addCellDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_addCellDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1938])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_addCellDM, __pyx_t_10) < (0)) __PYX_ERR(62, 957, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":974
 *         CHKERR(DMSwarmAddCellDM(self.dm, celldm.cdm))
 * 
 *     def setCellDMActive(self, name : str) -> None:             # <<<<<<<<<<<<<<
 *         """Activate a cell DM in the `DMSwarm`.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(62, 974, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 974, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_87setCellDMActive, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_setCellDMActive, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1939])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_setCellDMActive, __pyx_t_4) < (0)) __PYX_ERR(62, 974, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":993
 *         CHKERR(DMSwarmSetCellDMActive(self.dm, cname))
 * 
 *     def getCellDMActive(self) -> CellDM:             # <<<<<<<<<<<<<<
 *         """Return the active cell DM in the `DMSwarm`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_CellDM) < (0)) __PYX_ERR(62, 993, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_89getCellDMActive, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_getCellDMActive, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1940])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_getCellDMActive, __pyx_t_10) < (0)) __PYX_ERR(62, 993, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1010
 *         return cdm
 * 
 *     def getCellDMByName(self, name: str) -> CellDM:             # <<<<<<<<<<<<<<
 *         """Return the cell DM with the given name in the `DMSwarm`.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 1010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(62, 1010, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_CellDM) < (0)) __PYX_ERR(62, 1010, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_91getCellDMByName, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_getCellDMByName, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1941])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 1010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_getCellDMByName, __pyx_t_4) < (0)) __PYX_ERR(62, 1010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1029
 *         return cdm
 * 
 *     def getCellDMNames(self) -> list[str]:             # <<<<<<<<<<<<<<
 *         """Return the names of all cell DMs in the `DMSwarm`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_str) < (0)) __PYX_ERR(62, 1029, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_93getCellDMNames, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_getCellDMNames, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1942])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_getCellDMNames, __pyx_t_10) < (0)) __PYX_ERR(62, 1029, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1047
 *         return names
 * 
 *     def computeMoments(self, coord: str, weight: str) -> list[float]:             # <<<<<<<<<<<<<<
 *         """Return the moments defined in the active cell DM.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_coord, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(62, 1047, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_weight, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(62, 1047, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_float) < (0)) __PYX_ERR(62, 1047, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7DMSwarm_95computeMoments, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMSwarm_computeMoments, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1943])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMSwarm, __pyx_mstate_global->__pyx_n_u_computeMoments, __pyx_t_4) < (0)) __PYX_ERR(62, 1047, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1090
 *     #
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the cell DM.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 1090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(62, 1090, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6CellDM_3view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CellDM_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1944])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 1090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_CellDM, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_10) < (0)) __PYX_ERR(62, 1090, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1109
 *         CHKERR(DMSwarmCellDMView(self.cdm, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the cell DM.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(62, 1109, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6CellDM_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CellDM_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1945])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_CellDM, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_4) < (0)) __PYX_ERR(62, 1109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1122
 *         return self
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         DM dm,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_fields, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < (0)) __PYX_ERR(62, 1122, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_coords, __pyx_mstate_global->__pyx_kp_u_Sequence_str) < (0)) __PYX_ERR(62, 1122, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(62, 1122, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6CellDM_7create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CellDM_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1946])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_CellDM, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_10) < (0)) __PYX_ERR(62, 1122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1165
 *         return self
 * 
 *     def getDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the underlying DM.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(62, 1165, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6CellDM_9getDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CellDM_getDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1947])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_CellDM, __pyx_mstate_global->__pyx_n_u_getDM, __pyx_t_4) < (0)) __PYX_ERR(62, 1165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1182
 *         return dm
 * 
 *     def getCellID(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the cellid field for this cell DM.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 1182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(62, 1182, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6CellDM_11getCellID, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CellDM_getCellID, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1948])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 1182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_CellDM, __pyx_mstate_global->__pyx_n_u_getCellID, __pyx_t_10) < (0)) __PYX_ERR(62, 1182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1196
 *         return bytes2str(cellid)
 * 
 *     def getBlockSize(self, DM sw) -> int:             # <<<<<<<<<<<<<<
 *         """Return the block size for this cell DM.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 1196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(62, 1196, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6CellDM_13getBlockSize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CellDM_getBlockSize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1949])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 1196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_CellDM, __pyx_mstate_global->__pyx_n_u_getBlockSize, __pyx_t_4) < (0)) __PYX_ERR(62, 1196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1215
 *         return toInt(bs)
 * 
 *     def getFields(self) -> list[str]:             # <<<<<<<<<<<<<<
 *         """Return the swarm fields defined on this cell DM.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 1215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_str) < (0)) __PYX_ERR(62, 1215, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6CellDM_15getFields, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CellDM_getFields, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1950])); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 1215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_CellDM, __pyx_mstate_global->__pyx_n_u_getFields, __pyx_t_10) < (0)) __PYX_ERR(62, 1215, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1233
 *         return fields
 * 
 *     def getCoordinateFields(self) -> list[str]:             # <<<<<<<<<<<<<<
 *         """Return the swarm fields used as coordinates on this cell DM.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(62, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_list_str) < (0)) __PYX_ERR(62, 1233, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_6CellDM_17getCoordinateFields, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CellDM_getCoordinateFields, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1951])); if (unlikely(!__pyx_t_4)) __PYX_ERR(62, 1233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_CellDM, __pyx_mstate_global->__pyx_n_u_getCoordinateFields, __pyx_t_4) < (0)) __PYX_ERR(62, 1233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMSwarm.pyx":1253
 * # --------------------------------------------------------------------
 * 
 * del DMSwarmType             # <<<<<<<<<<<<<<
 * del DMSwarmMigrateType
 * del DMSwarmCollectType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMSwarmType) < (0)) __PYX_ERR(62, 1253, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1254
 * 
 * del DMSwarmType
 * del DMSwarmMigrateType             # <<<<<<<<<<<<<<
 * del DMSwarmCollectType
 * del DMSwarmPICLayoutType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMSwarmMigrateType) < (0)) __PYX_ERR(62, 1254, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1255
 * del DMSwarmType
 * del DMSwarmMigrateType
 * del DMSwarmCollectType             # <<<<<<<<<<<<<<
 * del DMSwarmPICLayoutType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMSwarmCollectType) < (0)) __PYX_ERR(62, 1255, __pyx_L1_error)

  /* "petsc4py/PETSc/DMSwarm.pyx":1256
 * del DMSwarmMigrateType
 * del DMSwarmCollectType
 * del DMSwarmPICLayoutType             # <<<<<<<<<<<<<<
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DMSwarmPICLayoutType) < (0)) __PYX_ERR(62, 1256, __pyx_L1_error)

  /* "petsc4py/PETSc/Partitioner.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class PartitionerType(object):             # <<<<<<<<<<<<<<
 *     """The partitioner types."""
 *     PARMETIS        = S_(PETSCPARTITIONERPARMETIS)
*/
  __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[204]); if (unlikely(!__pyx_t_4)) __PYX_ERR(63, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(63, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_4, __pyx_mstate_global->__pyx_n_u_PartitionerType, __pyx_mstate_global->__pyx_n_u_PartitionerType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_partitioner_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(63, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_4 != __pyx_mstate_global->__pyx_tuple[204]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[204]) < 0))) __PYX_ERR(63, 3, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Partitioner.pyx":5
 * class PartitionerType(object):
 *     """The partitioner types."""
 *     PARMETIS        = S_(PETSCPARTITIONERPARMETIS)             # <<<<<<<<<<<<<<
 *     PTSCOTCH        = S_(PETSCPARTITIONERPTSCOTCH)
 *     CHACO           = S_(PETSCPARTITIONERCHACO)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERPARMETIS); if (unlikely(!__pyx_t_14)) __PYX_ERR(63, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PARMETIS, __pyx_t_14) < (0)) __PYX_ERR(63, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":6
 *     """The partitioner types."""
 *     PARMETIS        = S_(PETSCPARTITIONERPARMETIS)
 *     PTSCOTCH        = S_(PETSCPARTITIONERPTSCOTCH)             # <<<<<<<<<<<<<<
 *     CHACO           = S_(PETSCPARTITIONERCHACO)
 *     SIMPLE          = S_(PETSCPARTITIONERSIMPLE)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERPTSCOTCH); if (unlikely(!__pyx_t_14)) __PYX_ERR(63, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PTSCOTCH, __pyx_t_14) < (0)) __PYX_ERR(63, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":7
 *     PARMETIS        = S_(PETSCPARTITIONERPARMETIS)
 *     PTSCOTCH        = S_(PETSCPARTITIONERPTSCOTCH)
 *     CHACO           = S_(PETSCPARTITIONERCHACO)             # <<<<<<<<<<<<<<
 *     SIMPLE          = S_(PETSCPARTITIONERSIMPLE)
 *     SHELL           = S_(PETSCPARTITIONERSHELL)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERCHACO); if (unlikely(!__pyx_t_14)) __PYX_ERR(63, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_CHACO, __pyx_t_14) < (0)) __PYX_ERR(63, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":8
 *     PTSCOTCH        = S_(PETSCPARTITIONERPTSCOTCH)
 *     CHACO           = S_(PETSCPARTITIONERCHACO)
 *     SIMPLE          = S_(PETSCPARTITIONERSIMPLE)             # <<<<<<<<<<<<<<
 *     SHELL           = S_(PETSCPARTITIONERSHELL)
 *     GATHER          = S_(PETSCPARTITIONERGATHER)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERSIMPLE); if (unlikely(!__pyx_t_14)) __PYX_ERR(63, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SIMPLE, __pyx_t_14) < (0)) __PYX_ERR(63, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":9
 *     CHACO           = S_(PETSCPARTITIONERCHACO)
 *     SIMPLE          = S_(PETSCPARTITIONERSIMPLE)
 *     SHELL           = S_(PETSCPARTITIONERSHELL)             # <<<<<<<<<<<<<<
 *     GATHER          = S_(PETSCPARTITIONERGATHER)
 *     MATPARTITIONING = S_(PETSCPARTITIONERMATPARTITIONING)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERSHELL); if (unlikely(!__pyx_t_14)) __PYX_ERR(63, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SHELL, __pyx_t_14) < (0)) __PYX_ERR(63, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":10
 *     SIMPLE          = S_(PETSCPARTITIONERSIMPLE)
 *     SHELL           = S_(PETSCPARTITIONERSHELL)
 *     GATHER          = S_(PETSCPARTITIONERGATHER)             # <<<<<<<<<<<<<<
 *     MATPARTITIONING = S_(PETSCPARTITIONERMATPARTITIONING)
 *     MULTISTAGE      = S_(PETSCPARTITIONERMULTISTAGE)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERGATHER); if (unlikely(!__pyx_t_14)) __PYX_ERR(63, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_GATHER, __pyx_t_14) < (0)) __PYX_ERR(63, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":11
 *     SHELL           = S_(PETSCPARTITIONERSHELL)
 *     GATHER          = S_(PETSCPARTITIONERGATHER)
 *     MATPARTITIONING = S_(PETSCPARTITIONERMATPARTITIONING)             # <<<<<<<<<<<<<<
 *     MULTISTAGE      = S_(PETSCPARTITIONERMULTISTAGE)
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERMATPARTITIONING); if (unlikely(!__pyx_t_14)) __PYX_ERR(63, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MATPARTITIONING, __pyx_t_14) < (0)) __PYX_ERR(63, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":12
 *     GATHER          = S_(PETSCPARTITIONERGATHER)
 *     MATPARTITIONING = S_(PETSCPARTITIONERMATPARTITIONING)
 *     MULTISTAGE      = S_(PETSCPARTITIONERMULTISTAGE)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCPARTITIONERMULTISTAGE); if (unlikely(!__pyx_t_14)) __PYX_ERR(63, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_MULTISTAGE, __pyx_t_14) < (0)) __PYX_ERR(63, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class PartitionerType(object):             # <<<<<<<<<<<<<<
 *     """The partitioner types."""
 *     PARMETIS        = S_(PETSCPARTITIONERPARMETIS)
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_PartitionerType, __pyx_t_4, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(63, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_PartitionerType, __pyx_t_14) < (0)) __PYX_ERR(63, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":20
 *     """A graph partitioner."""
 * 
 *     Type = PartitionerType             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_PartitionerType); if (unlikely(!__pyx_t_4)) __PYX_ERR(63, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_4) < (0)) __PYX_ERR(63, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":26
 *         self.part = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the partitioner.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(63, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(63, 26, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11Partitioner_3view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Partitioner_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1952])); if (unlikely(!__pyx_t_10)) __PYX_ERR(63, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_10) < (0)) __PYX_ERR(63, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":45
 *         CHKERR(PetscPartitionerView(self.part, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the partitioner object.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(63, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(63, 45, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11Partitioner_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Partitioner_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1953])); if (unlikely(!__pyx_t_4)) __PYX_ERR(63, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_4) < (0)) __PYX_ERR(63, 45, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":58
 *         return self
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an empty partitioner object.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(63, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(63, 58, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(63, 58, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11Partitioner_7create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Partitioner_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1954])); if (unlikely(!__pyx_t_10)) __PYX_ERR(63, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_10) < (0)) __PYX_ERR(63, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":81
 *         return self
 * 
 *     def setType(self, part_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Build a particular type of the partitioner.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(63, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_part_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(63, 81, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(63, 81, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11Partitioner_9setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Partitioner_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1955])); if (unlikely(!__pyx_t_4)) __PYX_ERR(63, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_4) < (0)) __PYX_ERR(63, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":100
 *         CHKERR(PetscPartitionerSetType(self.part, cval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the partitioner type.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(63, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(63, 100, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11Partitioner_11getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Partitioner_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1956])); if (unlikely(!__pyx_t_10)) __PYX_ERR(63, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_10) < (0)) __PYX_ERR(63, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":114
 *         return bytes2str(cval)
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set parameters in the partitioner from the options database.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(63, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(63, 114, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11Partitioner_13setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Partitioner_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1957])); if (unlikely(!__pyx_t_4)) __PYX_ERR(63, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_4) < (0)) __PYX_ERR(63, 114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":126
 *         CHKERR(PetscPartitionerSetFromOptions(self.part))
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Construct data structures for the partitioner.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(63, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(63, 126, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11Partitioner_15setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Partitioner_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1958])); if (unlikely(!__pyx_t_10)) __PYX_ERR(63, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_10) < (0)) __PYX_ERR(63, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":138
 *         CHKERR(PetscPartitionerSetUp(self.part))
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         """Reset data structures of the partitioner.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(63, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(63, 138, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11Partitioner_17reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Partitioner_reset, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1959])); if (unlikely(!__pyx_t_4)) __PYX_ERR(63, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_4) < (0)) __PYX_ERR(63, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":150
 *         CHKERR(PetscPartitionerReset(self.part))
 * 
 *     def setShellPartition(             # <<<<<<<<<<<<<<
 *         self,
 *         numProcs: int,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(63, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_numProcs, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(63, 150, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sizes, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(63, 150, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_points, __pyx_mstate_global->__pyx_kp_u_Sequence_int_None) < (0)) __PYX_ERR(63, 150, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(63, 150, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11Partitioner_19setShellPartition, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Partitioner_setShellPartition, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1960])); if (unlikely(!__pyx_t_10)) __PYX_ERR(63, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Partitioner, __pyx_mstate_global->__pyx_n_u_setShellPartition, __pyx_t_10) < (0)) __PYX_ERR(63, 150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Partitioner.pyx":191
 * # --------------------------------------------------------------------
 * 
 * del PartitionerType             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PartitionerType) < (0)) __PYX_ERR(63, 191, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class SpaceType(object):             # <<<<<<<<<<<<<<
 *     """The function space types."""
 *     POLYNOMIAL = S_(PETSCSPACEPOLYNOMIAL)
*/
  __pyx_t_10 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[206]); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_10, __pyx_mstate_global->__pyx_n_u_SpaceType, __pyx_mstate_global->__pyx_n_u_SpaceType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_function_space_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(64, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_10 != __pyx_mstate_global->__pyx_tuple[206]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[206]) < 0))) __PYX_ERR(64, 3, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Space.pyx":5
 * class SpaceType(object):
 *     """The function space types."""
 *     POLYNOMIAL = S_(PETSCSPACEPOLYNOMIAL)             # <<<<<<<<<<<<<<
 *     PTRIMMED   = S_(PETSCSPACEPTRIMMED)
 *     TENSOR     = S_(PETSCSPACETENSOR)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPACEPOLYNOMIAL); if (unlikely(!__pyx_t_14)) __PYX_ERR(64, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_POLYNOMIAL, __pyx_t_14) < (0)) __PYX_ERR(64, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Space.pyx":6
 *     """The function space types."""
 *     POLYNOMIAL = S_(PETSCSPACEPOLYNOMIAL)
 *     PTRIMMED   = S_(PETSCSPACEPTRIMMED)             # <<<<<<<<<<<<<<
 *     TENSOR     = S_(PETSCSPACETENSOR)
 *     SUM        = S_(PETSCSPACESUM)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPACEPTRIMMED); if (unlikely(!__pyx_t_14)) __PYX_ERR(64, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PTRIMMED, __pyx_t_14) < (0)) __PYX_ERR(64, 6, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Space.pyx":7
 *     POLYNOMIAL = S_(PETSCSPACEPOLYNOMIAL)
 *     PTRIMMED   = S_(PETSCSPACEPTRIMMED)
 *     TENSOR     = S_(PETSCSPACETENSOR)             # <<<<<<<<<<<<<<
 *     SUM        = S_(PETSCSPACESUM)
 *     POINT      = S_(PETSCSPACEPOINT)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPACETENSOR); if (unlikely(!__pyx_t_14)) __PYX_ERR(64, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_TENSOR, __pyx_t_14) < (0)) __PYX_ERR(64, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Space.pyx":8
 *     PTRIMMED   = S_(PETSCSPACEPTRIMMED)
 *     TENSOR     = S_(PETSCSPACETENSOR)
 *     SUM        = S_(PETSCSPACESUM)             # <<<<<<<<<<<<<<
 *     POINT      = S_(PETSCSPACEPOINT)
 *     SUBSPACE   = S_(PETSCSPACESUBSPACE)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPACESUM); if (unlikely(!__pyx_t_14)) __PYX_ERR(64, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SUM, __pyx_t_14) < (0)) __PYX_ERR(64, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Space.pyx":9
 *     TENSOR     = S_(PETSCSPACETENSOR)
 *     SUM        = S_(PETSCSPACESUM)
 *     POINT      = S_(PETSCSPACEPOINT)             # <<<<<<<<<<<<<<
 *     SUBSPACE   = S_(PETSCSPACESUBSPACE)
 *     WXY        = S_(PETSCSPACEWXY)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPACEPOINT); if (unlikely(!__pyx_t_14)) __PYX_ERR(64, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_POINT, __pyx_t_14) < (0)) __PYX_ERR(64, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Space.pyx":10
 *     SUM        = S_(PETSCSPACESUM)
 *     POINT      = S_(PETSCSPACEPOINT)
 *     SUBSPACE   = S_(PETSCSPACESUBSPACE)             # <<<<<<<<<<<<<<
 *     WXY        = S_(PETSCSPACEWXY)
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPACESUBSPACE); if (unlikely(!__pyx_t_14)) __PYX_ERR(64, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SUBSPACE, __pyx_t_14) < (0)) __PYX_ERR(64, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Space.pyx":11
 *     POINT      = S_(PETSCSPACEPOINT)
 *     SUBSPACE   = S_(PETSCSPACESUBSPACE)
 *     WXY        = S_(PETSCSPACEWXY)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCSPACEWXY); if (unlikely(!__pyx_t_14)) __PYX_ERR(64, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_WXY, __pyx_t_14) < (0)) __PYX_ERR(64, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Space.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class SpaceType(object):             # <<<<<<<<<<<<<<
 *     """The function space types."""
 *     POLYNOMIAL = S_(PETSCSPACEPOLYNOMIAL)
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_SpaceType, __pyx_t_10, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(64, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SpaceType, __pyx_t_14) < (0)) __PYX_ERR(64, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":18
 * cdef class Space(Object):
 *     """Function space object."""
 *     Type = SpaceType             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_SpaceType); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_10) < (0)) __PYX_ERR(64, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":24
 *         self.space  = NULL
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Construct data structures for the `Space`.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 24, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_3setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1961])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_4) < (0)) __PYX_ERR(64, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":36
 *         CHKERR(PetscSpaceSetUp(self.space))
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an empty `Space` object.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(64, 36, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(64, 36, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_5create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1962])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_10) < (0)) __PYX_ERR(64, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":59
 *         return self
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the `Space` object.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(64, 59, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_7destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1963])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_4) < (0)) __PYX_ERR(64, 59, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":72
 *         return self
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View a `Space`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 72, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_9view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1964])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_10) < (0)) __PYX_ERR(64, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":91
 *         CHKERR(PetscSpaceView(self.space, vwr))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set parameters in `Space` from the options database.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 91, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_11setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1965])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_4) < (0)) __PYX_ERR(64, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":103
 *         CHKERR(PetscSpaceSetFromOptions(self.space))
 * 
 *     def getDimension(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of basis vectors.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 103, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_13getDimension, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_getDimension, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1966])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_getDimension, __pyx_t_10) < (0)) __PYX_ERR(64, 103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":117
 *         return toInt(cdim)
 * 
 *     def getDegree(self) -> tuple[int, int]:             # <<<<<<<<<<<<<<
 *         """Return the polynomial degrees that characterize this space.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_kp_u_tuple_int_int) < (0)) __PYX_ERR(64, 117, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_15getDegree, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_getDegree, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1967])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_getDegree, __pyx_t_4) < (0)) __PYX_ERR(64, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":138
 *         return toInt(cdegmin), toInt(cdegmax)
 * 
 *     def setDegree(self, degree: int | None, maxDegree: int | None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the degree of approximation for this space.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_degree, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(64, 138, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_maxDegree, __pyx_mstate_global->__pyx_kp_u_int_None) < (0)) __PYX_ERR(64, 138, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 138, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_17setDegree, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_setDegree, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1968])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_setDegree, __pyx_t_10) < (0)) __PYX_ERR(64, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":163
 *         CHKERR(PetscSpaceSetDegree(self.space, cdegree, cmaxdegree))
 * 
 *     def getNumVariables(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of variables for this space.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 163, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_19getNumVariables, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_getNumVariables, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1969])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_getNumVariables, __pyx_t_4) < (0)) __PYX_ERR(64, 163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":177
 *         return toInt(cnvars)
 * 
 *     def setNumVariables(self, n: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of variables for this space.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_n, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 177, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 177, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_21setNumVariables, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_setNumVariables, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1970])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_setNumVariables, __pyx_t_10) < (0)) __PYX_ERR(64, 177, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":195
 *         CHKERR(PetscSpaceSetNumVariables(self.space, cn))
 * 
 *     def getNumComponents(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of components for this space.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 195, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_23getNumComponents, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_getNumComponents, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1971])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_getNumComponents, __pyx_t_4) < (0)) __PYX_ERR(64, 195, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":209
 *         return toInt(cncomps)
 * 
 *     def setNumComponents(self, nc: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of components for this space.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_nc, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 209, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 209, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_25setNumComponents, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_setNumComponents, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1972])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_setNumComponents, __pyx_t_10) < (0)) __PYX_ERR(64, 209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":227
 *         CHKERR(PetscSpaceSetNumComponents(self.space, cnc))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the space object.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(64, 227, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_27getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1973])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_4) < (0)) __PYX_ERR(64, 227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":241
 *         return bytes2str(cval)
 * 
 *     def setType(self, space_type: Type | str) -> Self:             # <<<<<<<<<<<<<<
 *         """Build a particular type of space.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_space_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(64, 241, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(64, 241, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_29setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1974])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_10) < (0)) __PYX_ERR(64, 241, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":261
 *         return self
 * 
 *     def getSumConcatenate(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the concatenate flag for this space.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(64, 261, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_31getSumConcatenate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_getSumConcatenate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1975])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_getSumConcatenate, __pyx_t_4) < (0)) __PYX_ERR(64, 261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":280
 *         return toBool(concatenate)
 * 
 *     def setSumConcatenate(self, concatenate: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set the concatenate flag for this space.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_concatenate, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(64, 280, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 280, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_33setSumConcatenate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_setSumConcatenate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1976])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_setSumConcatenate, __pyx_t_10) < (0)) __PYX_ERR(64, 280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":304
 *         CHKERR(PetscSpaceSumSetConcatenate(self.space, cconcatenate))
 * 
 *     def getSumNumSubspaces(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of spaces in the sum.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 304, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_35getSumNumSubspaces, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_getSumNumSubspaces, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1977])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_getSumNumSubspaces, __pyx_t_4) < (0)) __PYX_ERR(64, 304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":318
 *         return toInt(numSumSpaces)
 * 
 *     def getSumSubspace(self, s: int) -> Space:             # <<<<<<<<<<<<<<
 *         """Return a space in the sum.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_s_2, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 318, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Space) < (0)) __PYX_ERR(64, 318, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_37getSumSubspace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_getSumSubspace, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1978])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_getSumSubspace, __pyx_t_10) < (0)) __PYX_ERR(64, 318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":338
 *         return subsp
 * 
 *     def setSumSubspace(self, s: int, Space subsp) -> None:             # <<<<<<<<<<<<<<
 *         """Set a space in the sum.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_s_2, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 338, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 338, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_39setSumSubspace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_setSumSubspace, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1979])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_setSumSubspace, __pyx_t_4) < (0)) __PYX_ERR(64, 338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":358
 *         CHKERR(PetscSpaceSumSetSubspace(self.space, cs, subsp.space))
 * 
 *     def setSumNumSubspaces(self, numSumSpaces: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of spaces in the sum.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_numSumSpaces, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 358, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 358, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_41setSumNumSubspaces, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_setSumNumSubspaces, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1980])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_setSumNumSubspaces, __pyx_t_10) < (0)) __PYX_ERR(64, 358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":376
 *         CHKERR(PetscSpaceSumSetNumSubspaces(self.space, cnumSumSpaces))
 * 
 *     def getTensorNumSubspaces(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of spaces in the tensor product.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 376, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_43getTensorNumSubspaces, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_getTensorNumSubspaces, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1981])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_getTensorNumSubspaces, __pyx_t_4) < (0)) __PYX_ERR(64, 376, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":390
 *         return toInt(cnumTensSpaces)
 * 
 *     def setTensorSubspace(self, s: int, Space subsp) -> None:             # <<<<<<<<<<<<<<
 *         """Set a space in the tensor product.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_s_2, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 390, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 390, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_45setTensorSubspace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_setTensorSubspace, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1982])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_setTensorSubspace, __pyx_t_10) < (0)) __PYX_ERR(64, 390, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":410
 *         CHKERR(PetscSpaceTensorSetSubspace(self.space, cs, subsp.space))
 * 
 *     def getTensorSubspace(self, s: int) -> Space:             # <<<<<<<<<<<<<<
 *         """Return a space in the tensor product.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_s_2, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 410, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Space) < (0)) __PYX_ERR(64, 410, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_47getTensorSubspace, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_getTensorSubspace, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1983])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_getTensorSubspace, __pyx_t_4) < (0)) __PYX_ERR(64, 410, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":430
 *         return subsp
 * 
 *     def setTensorNumSubspaces(self, numTensSpaces: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of spaces in the tensor product.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_numTensSpaces, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 430, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 430, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_49setTensorNumSubspaces, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_setTensorNumSubspaces, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1984])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_setTensorNumSubspaces, __pyx_t_10) < (0)) __PYX_ERR(64, 430, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":448
 *         CHKERR(PetscSpaceTensorSetNumSubspaces(self.space, cnumTensSpaces))
 * 
 *     def getPolynomialTensor(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether a function space is a space of tensor polynomials.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(64, 448, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_51getPolynomialTensor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_getPolynomialTensor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1985])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_getPolynomialTensor, __pyx_t_4) < (0)) __PYX_ERR(64, 448, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":468
 *         return toBool(ctensor)
 * 
 *     def setPolynomialTensor(self, tensor: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set whether a function space is a space of tensor polynomials.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_tensor, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(64, 468, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 468, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_53setPolynomialTensor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_setPolynomialTensor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1986])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_setPolynomialTensor, __pyx_t_10) < (0)) __PYX_ERR(64, 468, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":493
 *         CHKERR(PetscSpacePolynomialSetTensor(self.space, ctensor))
 * 
 *     def setPointPoints(self, Quad quad) -> None:             # <<<<<<<<<<<<<<
 *         """Set the evaluation points for the space to be based on a quad.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 493, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_55setPointPoints, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_setPointPoints, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1987])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_setPointPoints, __pyx_t_4) < (0)) __PYX_ERR(64, 493, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":513
 *         CHKERR(PetscSpacePointSetPoints(self.space, quad.quad))
 * 
 *     def getPointPoints(self) -> Quad:             # <<<<<<<<<<<<<<
 *         """Return the evaluation points for the space as the points of a quad.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Quad) < (0)) __PYX_ERR(64, 513, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_57getPointPoints, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_getPointPoints, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1988])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_getPointPoints, __pyx_t_10) < (0)) __PYX_ERR(64, 513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":528
 *         return quad
 * 
 *     def setPTrimmedFormDegree(self, formDegree: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the form degree of the trimmed polynomials.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_formDegree, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 528, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 528, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_59setPTrimmedFormDegree, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_setPTrimmedFormDegree, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1989])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_setPTrimmedFormDegree, __pyx_t_4) < (0)) __PYX_ERR(64, 528, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":546
 *         CHKERR(PetscSpacePTrimmedSetFormDegree(self.space, cformDegree))
 * 
 *     def getPTrimmedFormDegree(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the form degree of the trimmed polynomials.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 546, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5Space_61getPTrimmedFormDegree, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Space_getPTrimmedFormDegree, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1990])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Space, __pyx_mstate_global->__pyx_n_u_getPTrimmedFormDegree, __pyx_t_10) < (0)) __PYX_ERR(64, 546, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":563
 * 
 * 
 * class DualSpaceType(object):             # <<<<<<<<<<<<<<
 *     """The dual space types."""
 *     LAGRANGE = S_(PETSCDUALSPACELAGRANGE)
*/
  __pyx_t_10 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[208]); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_10, __pyx_mstate_global->__pyx_n_u_DualSpaceType, __pyx_mstate_global->__pyx_n_u_DualSpaceType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_The_dual_space_types); if (unlikely(!__pyx_t_5)) __PYX_ERR(64, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_10 != __pyx_mstate_global->__pyx_tuple[208]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[208]) < 0))) __PYX_ERR(64, 563, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Space.pyx":565
 * class DualSpaceType(object):
 *     """The dual space types."""
 *     LAGRANGE = S_(PETSCDUALSPACELAGRANGE)             # <<<<<<<<<<<<<<
 *     SIMPLE   = S_(PETSCDUALSPACESIMPLE)
 *     REFINED  = S_(PETSCDUALSPACEREFINED)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCDUALSPACELAGRANGE); if (unlikely(!__pyx_t_14)) __PYX_ERR(64, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LAGRANGE, __pyx_t_14) < (0)) __PYX_ERR(64, 565, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Space.pyx":566
 *     """The dual space types."""
 *     LAGRANGE = S_(PETSCDUALSPACELAGRANGE)
 *     SIMPLE   = S_(PETSCDUALSPACESIMPLE)             # <<<<<<<<<<<<<<
 *     REFINED  = S_(PETSCDUALSPACEREFINED)
 *     BDM      = S_(PETSCDUALSPACEBDM)
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCDUALSPACESIMPLE); if (unlikely(!__pyx_t_14)) __PYX_ERR(64, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_SIMPLE, __pyx_t_14) < (0)) __PYX_ERR(64, 566, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Space.pyx":567
 *     LAGRANGE = S_(PETSCDUALSPACELAGRANGE)
 *     SIMPLE   = S_(PETSCDUALSPACESIMPLE)
 *     REFINED  = S_(PETSCDUALSPACEREFINED)             # <<<<<<<<<<<<<<
 *     BDM      = S_(PETSCDUALSPACEBDM)
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCDUALSPACEREFINED); if (unlikely(!__pyx_t_14)) __PYX_ERR(64, 567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_REFINED, __pyx_t_14) < (0)) __PYX_ERR(64, 567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Space.pyx":568
 *     SIMPLE   = S_(PETSCDUALSPACESIMPLE)
 *     REFINED  = S_(PETSCDUALSPACEREFINED)
 *     BDM      = S_(PETSCDUALSPACEBDM)             # <<<<<<<<<<<<<<
 * 
 * # --------------------------------------------------------------------
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCDUALSPACEBDM); if (unlikely(!__pyx_t_14)) __PYX_ERR(64, 568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_BDM, __pyx_t_14) < (0)) __PYX_ERR(64, 568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Space.pyx":563
 * 
 * 
 * class DualSpaceType(object):             # <<<<<<<<<<<<<<
 *     """The dual space types."""
 *     LAGRANGE = S_(PETSCDUALSPACELAGRANGE)
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_DualSpaceType, __pyx_t_10, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(64, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DualSpaceType, __pyx_t_14) < (0)) __PYX_ERR(64, 563, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":576
 *     """Dual space to a linear space."""
 * 
 *     Type = DualSpaceType             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_DualSpaceType); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_10) < (0)) __PYX_ERR(64, 576, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":582
 *         self.dualspace  = NULL
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Construct a basis for a `DualSpace`.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 582, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_3setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1991])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_4) < (0)) __PYX_ERR(64, 582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":594
 *         CHKERR(PetscDualSpaceSetUp(self.dualspace))
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create an empty `DualSpace` object.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(64, 594, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(64, 594, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_5create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1992])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_10) < (0)) __PYX_ERR(64, 594, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":617
 *         return self
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View a `DualSpace`.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 617, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_7view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1993])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_4) < (0)) __PYX_ERR(64, 617, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":636
 *         CHKERR(PetscDualSpaceView(self.dualspace, vwr))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the `DualSpace` object.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(64, 636, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_9destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1994])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_10) < (0)) __PYX_ERR(64, 636, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":649
 *         return self
 * 
 *     def duplicate(self) -> DualSpace:             # <<<<<<<<<<<<<<
 *         """Create a duplicate `DualSpace` object that is not set up.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DualSpace) < (0)) __PYX_ERR(64, 649, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_11duplicate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_duplicate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1995])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_duplicate, __pyx_t_4) < (0)) __PYX_ERR(64, 649, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":662
 *         CHKERR(PetscDualSpaceDuplicate(self.dualspace, &spNew.dualspace))
 * 
 *     def getDM(self) -> DM:             # <<<<<<<<<<<<<<
 *         """Return the `DM` representing the reference cell of a `DualSpace`.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_DM) < (0)) __PYX_ERR(64, 662, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_13getDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_getDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1996])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_getDM, __pyx_t_10) < (0)) __PYX_ERR(64, 662, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":679
 *         return dm
 * 
 *     def setDM(self, DM dm) -> None:             # <<<<<<<<<<<<<<
 *         """Set the `DM` representing the reference cell.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 679, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_15setDM, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_setDM, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1997])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_setDM, __pyx_t_4) < (0)) __PYX_ERR(64, 679, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":696
 *         CHKERR(PetscDualSpaceSetDM(self.dualspace, dm.dm))
 * 
 *     def getDimension(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the dimension of the dual space.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 696, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_17getDimension, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_getDimension, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1998])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_getDimension, __pyx_t_10) < (0)) __PYX_ERR(64, 696, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":712
 *         return toInt(cdim)
 * 
 *     def getNumComponents(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of components for this space.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 712, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_19getNumComponents, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_getNumComponents, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1999])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_getNumComponents, __pyx_t_4) < (0)) __PYX_ERR(64, 712, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":726
 *         return toInt(cncomps)
 * 
 *     def setNumComponents(self, nc: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of components for this space.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_nc, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 726, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 726, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_21setNumComponents, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_setNumComponents, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2000])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_setNumComponents, __pyx_t_10) < (0)) __PYX_ERR(64, 726, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":744
 *         CHKERR(PetscDualSpaceSetNumComponents(self.dualspace, cnc))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the dual space object.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(64, 744, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_23getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2001])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_4) < (0)) __PYX_ERR(64, 744, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":758
 *         return bytes2str(cval)
 * 
 *     def setType(self, dualspace_type: Type | str) -> Self:             # <<<<<<<<<<<<<<
 *         """Build a particular type of dual space.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dualspace_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(64, 758, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(64, 758, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_25setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2002])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_10) < (0)) __PYX_ERR(64, 758, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":778
 *         return self
 * 
 *     def getOrder(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the order of the dual space.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 778, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_27getOrder, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_getOrder, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2003])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_getOrder, __pyx_t_4) < (0)) __PYX_ERR(64, 778, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":792
 *         return toInt(corder)
 * 
 *     def setOrder(self, order: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the order of the dual space.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_order, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 792, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 792, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_29setOrder, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_setOrder, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2004])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_setOrder, __pyx_t_10) < (0)) __PYX_ERR(64, 792, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":810
 *         CHKERR(PetscDualSpaceSetOrder(self.dualspace, corder))
 * 
 *     def getNumDof(self) -> ArrayInt:             # <<<<<<<<<<<<<<
 *         """Return the number of degrees of freedom for each spatial dimension.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_ArrayInt) < (0)) __PYX_ERR(64, 810, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_31getNumDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_getNumDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2005])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_getNumDof, __pyx_t_4) < (0)) __PYX_ERR(64, 810, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":826
 *         return array_i(cdim + 1, cndof)
 * 
 *     def getFunctional(self, i: int) -> Quad:             # <<<<<<<<<<<<<<
 *         """Return the i-th basis functional in the dual space.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_i, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 826, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Quad) < (0)) __PYX_ERR(64, 826, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_33getFunctional, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_getFunctional, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2006])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_getFunctional, __pyx_t_10) < (0)) __PYX_ERR(64, 826, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":847
 *         return functional
 * 
 *     def getInteriorDimension(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the interior dimension of the dual space.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 847, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_35getInteriorDimension, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_getInteriorDimension, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2007])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_getInteriorDimension, __pyx_t_4) < (0)) __PYX_ERR(64, 847, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":864
 *         return toInt(cintdim)
 * 
 *     def getLagrangeContinuity(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the element is continuous.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(64, 864, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_37getLagrangeContinuity, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_getLagrangeContinuity, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2008])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_getLagrangeContinuity, __pyx_t_10) < (0)) __PYX_ERR(64, 864, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":878
 *         return toBool(ccontinuous)
 * 
 *     def setLagrangeContinuity(self, continuous: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Indicate whether the element is continuous.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_continuous, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(64, 878, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 878, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_39setLagrangeContinuity, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_setLagrangeContinuity, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2009])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_setLagrangeContinuity, __pyx_t_4) < (0)) __PYX_ERR(64, 878, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":896
 *         CHKERR(PetscDualSpaceLagrangeSetContinuity(self.dualspace, ccontinuous))
 * 
 *     def getLagrangeTensor(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the tensor nature of the dual space.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(64, 896, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_41getLagrangeTensor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_getLagrangeTensor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2010])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_getLagrangeTensor, __pyx_t_10) < (0)) __PYX_ERR(64, 896, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":910
 *         return toBool(ctensor)
 * 
 *     def setLagrangeTensor(self, tensor: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set the tensor nature of the dual space.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_tensor, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(64, 910, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 910, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_43setLagrangeTensor, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_setLagrangeTensor, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2011])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_setLagrangeTensor, __pyx_t_4) < (0)) __PYX_ERR(64, 910, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":928
 *         CHKERR(PetscDualSpaceLagrangeSetTensor(self.dualspace, ctensor))
 * 
 *     def getLagrangeTrimmed(self) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the trimmed nature of the dual space.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(64, 928, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_45getLagrangeTrimmed, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_getLagrangeTrimmed, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2012])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_getLagrangeTrimmed, __pyx_t_10) < (0)) __PYX_ERR(64, 928, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":942
 *         return toBool(ctrimmed)
 * 
 *     def setLagrangeTrimmed(self, trimmed: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set the trimmed nature of the dual space.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_trimmed, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(64, 942, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 942, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_47setLagrangeTrimmed, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_setLagrangeTrimmed, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2013])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_setLagrangeTrimmed, __pyx_t_4) < (0)) __PYX_ERR(64, 942, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":962
 *         CHKERR(PetscDualSpaceLagrangeSetTrimmed(self.dualspace, ctrimmed))
 * 
 *     def setSimpleDimension(self, dim: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the number of functionals in the dual space basis.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dim, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 962, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 962, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_49setSimpleDimension, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_setSimpleDimension, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2014])); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_setSimpleDimension, __pyx_t_10) < (0)) __PYX_ERR(64, 962, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Space.pyx":980
 *         CHKERR(PetscDualSpaceSimpleSetDimension(self.dualspace, cdim))
 * 
 *     def setSimpleFunctional(self, func: int, Quad functional) -> None:             # <<<<<<<<<<<<<<
 *         """Set the given basis element for this dual space.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(64, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_func, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(64, 980, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(64, 980, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9DualSpace_51setSimpleFunctional, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DualSpace_setSimpleFunctional, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2015])); if (unlikely(!__pyx_t_4)) __PYX_ERR(64, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DualSpace, __pyx_mstate_global->__pyx_n_u_setSimpleFunctional, __pyx_t_4) < (0)) __PYX_ERR(64, 980, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Space.pyx":1000
 *         CHKERR(PetscDualSpaceSimpleSetFunctional(self.dualspace, cfunc, functional.quad))
 * 
 * del SpaceType             # <<<<<<<<<<<<<<
 * del DualSpaceType
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SpaceType) < (0)) __PYX_ERR(64, 1000, __pyx_L1_error)

  /* "petsc4py/PETSc/Space.pyx":1001
 * 
 * del SpaceType
 * del DualSpaceType             # <<<<<<<<<<<<<<
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_DualSpaceType) < (0)) __PYX_ERR(64, 1001, __pyx_L1_error)

  /* "petsc4py/PETSc/DMUtils.pyx":13
 *         self.destroy()
 * 
 *     def create(self, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a `DMInterpolation` context.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(65, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_comm, __pyx_mstate_global->__pyx_kp_u_Comm_None) < (0)) __PYX_ERR(65, 13, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(65, 13, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_5create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMInterpolation_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2016])); if (unlikely(!__pyx_t_10)) __PYX_ERR(65, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_10) < (0)) __PYX_ERR(65, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMUtils.pyx":35
 *         return self
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the `DMInterpolation` context.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(65, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(65, 35, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_7destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMInterpolation_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2017])); if (unlikely(!__pyx_t_4)) __PYX_ERR(65, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_4) < (0)) __PYX_ERR(65, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "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.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(65, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(65, 48, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_9evaluate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMInterpolation_evaluate, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2018])); if (unlikely(!__pyx_t_10)) __PYX_ERR(65, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation, __pyx_mstate_global->__pyx_n_u_evaluate, __pyx_t_10) < (0)) __PYX_ERR(65, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMUtils.pyx":74
 *         return v
 * 
 *     def getCoordinates(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return the coordinates of each interpolation point.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(65, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(65, 74, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_11getCoordinates, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMInterpolation_getCoordinates, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2019])); if (unlikely(!__pyx_t_4)) __PYX_ERR(65, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation, __pyx_mstate_global->__pyx_n_u_getCoordinates, __pyx_t_4) < (0)) __PYX_ERR(65, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMUtils.pyx":92
 *         return coords
 * 
 *     def getDim(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the spatial dimension of the interpolation context.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(65, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(65, 92, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_13getDim, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMInterpolation_getDim, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2020])); if (unlikely(!__pyx_t_10)) __PYX_ERR(65, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation, __pyx_mstate_global->__pyx_n_u_getDim, __pyx_t_10) < (0)) __PYX_ERR(65, 92, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMUtils.pyx":106
 *         return toInt(cdim)
 * 
 *     def getDof(self) -> int:             # <<<<<<<<<<<<<<
 *         """Return the number of fields interpolated at a point.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(65, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(65, 106, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_15getDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMInterpolation_getDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2021])); if (unlikely(!__pyx_t_4)) __PYX_ERR(65, 106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation, __pyx_mstate_global->__pyx_n_u_getDof, __pyx_t_4) < (0)) __PYX_ERR(65, 106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMUtils.pyx":120
 *         return toInt(cdof)
 * 
 *     def setDim(self, dim: int) -> None:             # <<<<<<<<<<<<<<
 *         """Set the spatial dimension for the interpolation context.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(65, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dim, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(65, 120, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(65, 120, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_17setDim, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMInterpolation_setDim, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2022])); if (unlikely(!__pyx_t_10)) __PYX_ERR(65, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation, __pyx_mstate_global->__pyx_n_u_setDim, __pyx_t_10) < (0)) __PYX_ERR(65, 120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "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.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(65, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_dof, __pyx_mstate_global->__pyx_n_u_int) < (0)) __PYX_ERR(65, 138, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(65, 138, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_19setDof, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMInterpolation_setDof, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2023])); if (unlikely(!__pyx_t_4)) __PYX_ERR(65, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation, __pyx_mstate_global->__pyx_n_u_setDof, __pyx_t_4) < (0)) __PYX_ERR(65, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMUtils.pyx":156
 *         CHKERR(DMInterpolationSetDof(self.dminterp, cdof))
 * 
 *     def setUp(             # <<<<<<<<<<<<<<
 *         self,
 *         DM dm,
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(65, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_redundantPoints, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(65, 156, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_ignoreOutsideDomain, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(65, 156, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(65, 156, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_21setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMInterpolation_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2024])); if (unlikely(!__pyx_t_10)) __PYX_ERR(65, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[81]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_10) < (0)) __PYX_ERR(65, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/DMUtils.pyx":185
 *         CHKERR(DMInterpolationSetUp(self.dminterp, dm.dm, credundantPoints, cignoreOutsideDomain))
 * 
 *     def getVector(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Return a `Vec` which can hold all the interpolated field values.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(65, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(65, 185, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_23getVector, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMInterpolation_getVector, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2025])); if (unlikely(!__pyx_t_4)) __PYX_ERR(65, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation, __pyx_mstate_global->__pyx_n_u_getVector, __pyx_t_4) < (0)) __PYX_ERR(65, 185, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/DMUtils.pyx":201
 *         return vec
 * 
 *     def restoreVector(self, Vec vec) -> None:             # <<<<<<<<<<<<<<
 *         """Restore a Vec which can hold all the interpolated field values.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(65, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(65, 201, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15DMInterpolation_25restoreVector, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_DMInterpolation_restoreVector, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2026])); if (unlikely(!__pyx_t_10)) __PYX_ERR(65, 201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_DMInterpolation, __pyx_mstate_global->__pyx_n_u_restoreVector, __pyx_t_10) < (0)) __PYX_ERR(65, 201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":1
 * class RegressorType(object):             # <<<<<<<<<<<<<<
 *     """REGRESSOR solver type.
 * 
*/
  __pyx_t_10 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[210]); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_10, __pyx_mstate_global->__pyx_n_u_RegressorType, __pyx_mstate_global->__pyx_n_u_RegressorType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_REGRESSOR_solver_type_See_Also_p); if (unlikely(!__pyx_t_5)) __PYX_ERR(66, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_10 != __pyx_mstate_global->__pyx_tuple[210]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[210]) < 0))) __PYX_ERR(66, 1, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Regressor.pyx":9
 * 
 *     """
 *     LINEAR = S_(PETSCREGRESSORLINEAR)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __pyx_f_8petsc4py_5PETSc_S_(PETSCREGRESSORLINEAR); if (unlikely(!__pyx_t_14)) __PYX_ERR(66, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LINEAR, __pyx_t_14) < (0)) __PYX_ERR(66, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":1
 * class RegressorType(object):             # <<<<<<<<<<<<<<
 *     """REGRESSOR solver type.
 * 
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_RegressorType, __pyx_t_10, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(66, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RegressorType, __pyx_t_14) < (0)) __PYX_ERR(66, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":12
 * 
 * 
 * class RegressorLinearType(object):             # <<<<<<<<<<<<<<
 *     """Linear regressor type.
 * 
*/
  __pyx_t_10 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[212]); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_10, __pyx_mstate_global->__pyx_n_u_RegressorLinearType, __pyx_mstate_global->__pyx_n_u_RegressorLinearType, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_kp_u_Linear_regressor_type_See_Also_p); if (unlikely(!__pyx_t_5)) __PYX_ERR(66, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_10 != __pyx_mstate_global->__pyx_tuple[212]) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[212]) < 0))) __PYX_ERR(66, 12, __pyx_L1_error)
  }

  /* "petsc4py/PETSc/Regressor.pyx":19
 *     petsc.PetscRegressorLinearType
 *     """
 *     OLS   = REGRESSOR_LINEAR_OLS             # <<<<<<<<<<<<<<
 *     LASSO = REGRESSOR_LINEAR_LASSO
 *     RIDGE = REGRESSOR_LINEAR_RIDGE
*/
  __pyx_t_14 = __Pyx_PyLong_From_PetscRegressorLinearType(REGRESSOR_LINEAR_OLS); if (unlikely(!__pyx_t_14)) __PYX_ERR(66, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OLS, __pyx_t_14) < (0)) __PYX_ERR(66, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":20
 *     """
 *     OLS   = REGRESSOR_LINEAR_OLS
 *     LASSO = REGRESSOR_LINEAR_LASSO             # <<<<<<<<<<<<<<
 *     RIDGE = REGRESSOR_LINEAR_RIDGE
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PetscRegressorLinearType(REGRESSOR_LINEAR_LASSO); if (unlikely(!__pyx_t_14)) __PYX_ERR(66, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_LASSO, __pyx_t_14) < (0)) __PYX_ERR(66, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":21
 *     OLS   = REGRESSOR_LINEAR_OLS
 *     LASSO = REGRESSOR_LINEAR_LASSO
 *     RIDGE = REGRESSOR_LINEAR_RIDGE             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_14 = __Pyx_PyLong_From_PetscRegressorLinearType(REGRESSOR_LINEAR_RIDGE); if (unlikely(!__pyx_t_14)) __PYX_ERR(66, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_RIDGE, __pyx_t_14) < (0)) __PYX_ERR(66, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":12
 * 
 * 
 * class RegressorLinearType(object):             # <<<<<<<<<<<<<<
 *     """Linear regressor type.
 * 
*/
  __pyx_t_14 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_RegressorLinearType, __pyx_t_10, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(66, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_14);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_14);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RegressorLinearType, __pyx_t_14) < (0)) __PYX_ERR(66, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":35
 *     """
 * 
 *     Type = RegressorType             # <<<<<<<<<<<<<<
 *     LinearType = RegressorLinearType
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RegressorType); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_Type, __pyx_t_10) < (0)) __PYX_ERR(66, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":36
 * 
 *     Type = RegressorType
 *     LinearType = RegressorLinearType             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
*/
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_RegressorLinearType); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_LinearType, __pyx_t_10) < (0)) __PYX_ERR(66, 36, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":42
 *         self.regressor = NULL
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the solver.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(66, 42, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_3view, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_view, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2027])); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_view, __pyx_t_4) < (0)) __PYX_ERR(66, 42, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":61
 *         CHKERR(PetscRegressorView(self.regressor, cviewer))
 * 
 *     def create(self, comm=None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create a REGRESSOR solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(66, 61, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_5create, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_create, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2028])); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_10) < (0)) __PYX_ERR(66, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":82
 *         return self
 * 
 *     def setRegularizerWeight(self, weight: float) -> None:             # <<<<<<<<<<<<<<
 *         """Set the weight to be used for the regularizer.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_weight, __pyx_mstate_global->__pyx_n_u_float) < (0)) __PYX_ERR(66, 82, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(66, 82, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_7setRegularizerWeight, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_setRegularizerWeight, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2029])); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_setRegularizerWeight, __pyx_t_4) < (0)) __PYX_ERR(66, 82, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":93
 *         CHKERR(PetscRegressorSetRegularizerWeight(self.regressor, weight))
 * 
 *     def setFromOptions(self) -> None:             # <<<<<<<<<<<<<<
 *         """Configure the solver from the options database.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(66, 93, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_9setFromOptions, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_setFromOptions, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2030])); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_setFromOptions, __pyx_t_10) < (0)) __PYX_ERR(66, 93, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":104
 *         CHKERR(PetscRegressorSetFromOptions(self.regressor))
 * 
 *     def setUp(self) -> None:             # <<<<<<<<<<<<<<
 *         """Set up the internal data structures for using the solver.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(66, 104, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_11setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_setUp, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2031])); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_setUp, __pyx_t_4) < (0)) __PYX_ERR(66, 104, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":116
 *         CHKERR(PetscRegressorSetUp(self.regressor))
 * 
 *     def fit(self, Mat X, Vec y) -> None:             # <<<<<<<<<<<<<<
 *         """Fit the regression problem.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(66, 116, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_13fit, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_fit, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2032])); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_fit, __pyx_t_10) < (0)) __PYX_ERR(66, 116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":135
 *         CHKERR(PetscRegressorFit(self.regressor, X.mat, y.vec))
 * 
 *     def predict(self, Mat X, Vec y) -> None:             # <<<<<<<<<<<<<<
 *         """Predict the regression problem.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(66, 135, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_15predict, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_predict, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2033])); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_predict, __pyx_t_4) < (0)) __PYX_ERR(66, 135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":154
 *         CHKERR(PetscRegressorPredict(self.regressor, X.mat, y.vec))
 * 
 *     def getTAO(self) -> TAO:             # <<<<<<<<<<<<<<
 *         """Return the underlying `TAO` object .
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_TAO) < (0)) __PYX_ERR(66, 154, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_17getTAO, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_getTAO, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2034])); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_getTAO, __pyx_t_10) < (0)) __PYX_ERR(66, 154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":168
 *         return tao
 * 
 *     def reset(self) -> None:             # <<<<<<<<<<<<<<
 *         """Destroy internal data structures of the solver.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(66, 168, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_19reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_reset, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2035])); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_4) < (0)) __PYX_ERR(66, 168, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":180
 *         CHKERR(PetscRegressorReset(self.regressor))
 * 
 *     def destroy(self) -> Self:             # <<<<<<<<<<<<<<
 *         """Destroy the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Self) < (0)) __PYX_ERR(66, 180, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_21destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_destroy, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2036])); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_10) < (0)) __PYX_ERR(66, 180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":193
 *         return self
 * 
 *     def setType(self, regressor_type: Type | str) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of the solver.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_regressor_type, __pyx_mstate_global->__pyx_kp_u_Type_str) < (0)) __PYX_ERR(66, 193, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(66, 193, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_23setType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_setType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2037])); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_setType, __pyx_t_4) < (0)) __PYX_ERR(66, 193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":212
 *         CHKERR(PetscRegressorSetType(self.regressor, cval))
 * 
 *     def getType(self) -> str:             # <<<<<<<<<<<<<<
 *         """Return the type of the solver.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_str_2) < (0)) __PYX_ERR(66, 212, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_25getType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_getType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2038])); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_getType, __pyx_t_10) < (0)) __PYX_ERR(66, 212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":228
 *     # --- Linear ---
 * 
 *     def setLinearFitIntercept(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set a flag to indicate that the intercept should be calculated.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(66, 228, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(66, 228, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_27setLinearFitIntercept, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_setLinearFitIntercept, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2039])); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_setLinearFitIntercept, __pyx_t_4) < (0)) __PYX_ERR(66, 228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":240
 *         CHKERR(PetscRegressorLinearSetFitIntercept(self.regressor, fitintercept))
 * 
 *     def setLinearUseKSP(self, flag: bool) -> None:             # <<<<<<<<<<<<<<
 *         """Set a flag to indicate that `KSP` instead of `TAO` solvers should be used.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_flag, __pyx_mstate_global->__pyx_n_u_bool) < (0)) __PYX_ERR(66, 240, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(66, 240, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_29setLinearUseKSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_setLinearUseKSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2040])); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_setLinearUseKSP, __pyx_t_10) < (0)) __PYX_ERR(66, 240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":252
 *         CHKERR(PetscRegressorLinearSetUseKSP(self.regressor, useksp))
 * 
 *     def getLinearKSP(self) -> KSP:             # <<<<<<<<<<<<<<
 *         """Returns the `KSP` context used by the linear regressor.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_KSP) < (0)) __PYX_ERR(66, 252, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_31getLinearKSP, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_getLinearKSP, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2041])); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_getLinearKSP, __pyx_t_4) < (0)) __PYX_ERR(66, 252, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":266
 *         return ksp
 * 
 *     def getLinearCoefficients(self) -> Vec:             # <<<<<<<<<<<<<<
 *         """Get a vector of the fitted coefficients from a linear regression model.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Vec) < (0)) __PYX_ERR(66, 266, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_33getLinearCoefficients, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_getLinearCoefficients, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2042])); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_getLinearCoefficients, __pyx_t_10) < (0)) __PYX_ERR(66, 266, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":280
 *         return coeffs
 * 
 *     def getLinearIntercept(self) -> Scalar:             # <<<<<<<<<<<<<<
 *         """Get the intercept from a linear regression model.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_Scalar) < (0)) __PYX_ERR(66, 280, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_35getLinearIntercept, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_getLinearIntercept, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2043])); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_getLinearIntercept, __pyx_t_4) < (0)) __PYX_ERR(66, 280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":293
 *         return toScalar(intercept)
 * 
 *     def setLinearType(self, lineartype: RegressorLinearType) -> None:             # <<<<<<<<<<<<<<
 *         """Set the type of linear regression to be performed.
 * 
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_lineartype, __pyx_mstate_global->__pyx_n_u_RegressorLinearType) < (0)) __PYX_ERR(66, 293, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_None) < (0)) __PYX_ERR(66, 293, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_37setLinearType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_setLinearType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2044])); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_10);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_setLinearType, __pyx_t_10) < (0)) __PYX_ERR(66, 293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":304
 *         CHKERR(PetscRegressorLinearSetType(self.regressor, lineartype))
 * 
 *     def getLinearType(self) -> RegressorLinearType:             # <<<<<<<<<<<<<<
 *         """Return the type of the linear regressor.
 * 
*/
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(66, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_return, __pyx_mstate_global->__pyx_n_u_RegressorLinearType) < (0)) __PYX_ERR(66, 304, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9Regressor_39getLinearType, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Regressor_getLinearType, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2045])); if (unlikely(!__pyx_t_4)) __PYX_ERR(66, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_8petsc4py_5PETSc_Regressor, __pyx_mstate_global->__pyx_n_u_getLinearType, __pyx_t_4) < (0)) __PYX_ERR(66, 304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/Regressor.pyx":317
 *         return cval
 * 
 * del RegressorType             # <<<<<<<<<<<<<<
*/
  if (__Pyx_PyObject_DelAttrStr(__pyx_m, __pyx_mstate_global->__pyx_n_u_RegressorType) < (0)) __PYX_ERR(66, 317, __pyx_L1_error)

  /* "petsc4py/PETSc/libpetsc4py.pyx":30
 * # --------------------------------------------------------------------
 * 
 * cdef char *FUNCT = NULL             # <<<<<<<<<<<<<<
 * cdef char *fstack[1024]
 * cdef int   istack = 0
*/
  __pyx_v_8petsc4py_5PETSc_FUNCT = NULL;

  /* "petsc4py/PETSc/libpetsc4py.pyx":32
 * 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":149
 *     return (path, name)
 * 
 * cdef dict module_cache = {}             # <<<<<<<<<<<<<<
 * 
 * cdef object load_module(object path):
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_module_cache);
  __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_module_cache, ((PyObject*)__pyx_t_4));
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":615
 * # FIXME: view and setFromOptions?
 * cdef dict dMatOps = {
 *                       3 : 'mult',             # <<<<<<<<<<<<<<
 *                       4 : 'multAdd',
 *                       5 : 'multTranspose',
*/
  __pyx_t_4 = __Pyx_PyDict_NewPresized(28); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_3, __pyx_mstate_global->__pyx_n_u_mult) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_4, __pyx_mstate_global->__pyx_n_u_multAdd) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_5, __pyx_mstate_global->__pyx_n_u_multTranspose) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_6, __pyx_mstate_global->__pyx_n_u_multTransposeAdd) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_7, __pyx_mstate_global->__pyx_n_u_solve) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_8, __pyx_mstate_global->__pyx_n_u_solveAdd) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_9, __pyx_mstate_global->__pyx_n_u_solveTranspose) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_10, __pyx_mstate_global->__pyx_n_u_solveTransposeAdd) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_13, __pyx_mstate_global->__pyx_n_u_SOR) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_17, __pyx_mstate_global->__pyx_n_u_getDiagonal) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_18, __pyx_mstate_global->__pyx_n_u_diagonalScale) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_19, __pyx_mstate_global->__pyx_n_u_norm) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_23, __pyx_mstate_global->__pyx_n_u_zeroEntries) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_32, __pyx_mstate_global->__pyx_n_u_getDiagonalBlock) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_34, __pyx_mstate_global->__pyx_n_u_duplicate) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_43, __pyx_mstate_global->__pyx_n_u_copy) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_45, __pyx_mstate_global->__pyx_n_u_scale) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_46, __pyx_mstate_global->__pyx_n_u_shift) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_47, __pyx_mstate_global->__pyx_n_u_setDiagonal) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_48, __pyx_mstate_global->__pyx_n_u_zeroRowsColumns) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_59, __pyx_mstate_global->__pyx_n_u_createSubMatrix) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_83, __pyx_mstate_global->__pyx_n_u_getVecs) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_93, __pyx_mstate_global->__pyx_n_u_conjugate) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_96, __pyx_mstate_global->__pyx_n_u_realPart) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_97, __pyx_mstate_global->__pyx_n_u_imagPart) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_109, __pyx_mstate_global->__pyx_n_u_multDiagonalBlock) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_111, __pyx_mstate_global->__pyx_n_u_multHermitian) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_4, __pyx_mstate_global->__pyx_int_112, __pyx_mstate_global->__pyx_n_u_multHermitianAdd) < (0)) __PYX_ERR(5, 615, __pyx_L1_error)
  __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_dMatOps);
  __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_dMatOps, ((PyObject*)__pyx_t_4));
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/libpetsc4py.pyx":1299
 *     return FunctionEnd()
 * 
 * cdef PetscInt matmatid = -1             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode MatProductSymbolic_Python(
*/
  __pyx_v_8petsc4py_5PETSc_matmatid = -1L;

  /* "petsc4py/PETSc/PETSc.pyx":286
 *     PetscErrorCode PetscTBEH(MPI_Comm, int, char*, char*, int, PetscErrorType, char*, void*)
 * 
 * cdef object tracebacklist = []             # <<<<<<<<<<<<<<
 * 
 * cdef PetscErrorCode traceback(
*/
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XGOTREF(__pyx_v_8petsc4py_5PETSc_tracebacklist);
  __Pyx_DECREF_SET(__pyx_v_8petsc4py_5PETSc_tracebacklist, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":375
 *     PetscErrorCode PetscInitializePackageAll()
 * 
 * cdef int    PyPetsc_Argc = 0             # <<<<<<<<<<<<<<
 * cdef char** PyPetsc_Argv = NULL
 * 
*/
  __pyx_v_8petsc4py_5PETSc_PyPetsc_Argc = 0;

  /* "petsc4py/PETSc/PETSc.pyx":376
 * 
 * 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":442
 * 
 * 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":535
 *     PetscClassId PETSC_REGRESSOR_CLASSID        "PETSCREGRESSOR_CLASSID"
 * 
 * cdef bint registercalled = 0             # <<<<<<<<<<<<<<
 * 
 * cdef const char *citation = b"""\
*/
  __pyx_v_8petsc4py_5PETSc_registercalled = 0;

  /* "petsc4py/PETSc/PETSc.pyx":537
 * 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 = __pyx_k_Article_Dalcin2011_Author_Lisan;

  /* "petsc4py/PETSc/PETSc.pyx":594
 * 
 * 
 * def _initialize(args=None, comm=None):             # <<<<<<<<<<<<<<
 *     import atexit
 *     global PetscError
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_5_initialize, 0, __pyx_mstate_global->__pyx_n_u_initialize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2046])); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[19]);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_initialize, __pyx_t_4) < (0)) __PYX_ERR(7, 594, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":612
 * 
 * 
 * def _pre_finalize():             # <<<<<<<<<<<<<<
 *     # Called while the Python interpreter is still running
 *     garbage_cleanup()
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_7_pre_finalize, 0, __pyx_mstate_global->__pyx_n_u_pre_finalize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2047])); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pre_finalize, __pyx_t_4) < (0)) __PYX_ERR(7, 612, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":617
 * 
 * 
 * def _finalize():             # <<<<<<<<<<<<<<
 *     finalize()
 *     #
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_9_finalize, 0, __pyx_mstate_global->__pyx_n_u_finalize, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2048])); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_finalize, __pyx_t_4) < (0)) __PYX_ERR(7, 617, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":640
 * 
 * 
 * def _push_python_vfprintf():             # <<<<<<<<<<<<<<
 *     _push_vfprintf(&PetscVFPrintf_PythonStdStream)
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_11_push_python_vfprintf, 0, __pyx_mstate_global->__pyx_n_u_push_python_vfprintf, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2049])); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_push_python_vfprintf, __pyx_t_4) < (0)) __PYX_ERR(7, 640, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":644
 * 
 * 
 * def _pop_python_vfprintf():             # <<<<<<<<<<<<<<
 *     _pop_vfprintf()
 * 
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_13_pop_python_vfprintf, 0, __pyx_mstate_global->__pyx_n_u_pop_python_vfprintf, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2050])); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pop_python_vfprintf, __pyx_t_4) < (0)) __PYX_ERR(7, 644, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "petsc4py/PETSc/PETSc.pyx":648
 * 
 * 
 * def _stdout_is_stderr():             # <<<<<<<<<<<<<<
 *     global PETSC_STDOUT, PETSC_STDERR
 *     return PETSC_STDOUT == PETSC_STDERR
*/
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8petsc4py_5PETSc_15_stdout_is_stderr, 0, __pyx_mstate_global->__pyx_n_u_stdout_is_stderr, NULL, __pyx_mstate_global->__pyx_n_u_petsc4py_PETSc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2051])); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  #endif
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_stdout_is_stderr, __pyx_t_4) < (0)) __PYX_ERR(7, 648, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /*--- Wrapped vars code ---*/

  if (__Pyx_RegisterCleanup()) __PYX_ERR(0, 1, __pyx_L1_error)
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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_XDECREF(__pyx_t_15);
  if (__pyx_m) {
    if (__pyx_mstate->__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;
  #else
  return __pyx_m;
  #endif
}
/* #### Code section: pystring_table ### */
/* #### Code section: cached_builtins ### */

static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_object); if (!__pyx_builtin_object) __PYX_ERR(1, 47, __pyx_L1_error)
  __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_property); if (!__pyx_builtin_property) __PYX_ERR(2, 3, __pyx_L1_error)
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(2, 195, __pyx_L1_error)
  __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(3, 325, __pyx_L1_error)
  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(3, 444, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(4, 293, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_open); if (!__pyx_builtin_open) __PYX_ERR(5, 160, __pyx_L1_error)
  __pyx_builtin_compile = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_compile); if (!__pyx_builtin_compile) __PYX_ERR(5, 161, __pyx_L1_error)
  __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_import); if (!__pyx_builtin___import__) __PYX_ERR(6, 109, __pyx_L1_error)
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id); if (!__pyx_builtin_id) __PYX_ERR(6, 628, __pyx_L1_error)

  /* Cached unbound methods */
  __pyx_mstate->__pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_get.method_name = &__pyx_mstate->__pyx_n_u_get_2;
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
  __pyx_mstate->__pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_keys.method_name = &__pyx_mstate->__pyx_n_u_keys;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
  __pyx_mstate->__pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type;
  __pyx_mstate->__pyx_umethod_PyList_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "View.MemoryView":592
 *     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_mstate_global->__pyx_tuple[0] = PyTuple_New(1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(6, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_neg_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_mstate_global->__pyx_tuple[0], 0, __pyx_mstate_global->__pyx_int_neg_1) != (0)) __PYX_ERR(6, 592, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);

  /* "View.MemoryView":689
 *     tup = <tuple>index if isinstance(index, tuple) else (index,)
 * 
 *     result = [slice(None)] * ndim             # <<<<<<<<<<<<<<
 *     have_slices = False
 *     seen_ellipsis = False
*/
  __pyx_mstate_global->__pyx_slice[0] = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(6, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);

  /* "petsc4py/PETSc/petscopt.pxi":248
 *     if not iskey(key):
 *         return None
 *     key = key[1:]             # <<<<<<<<<<<<<<
 *     if key[0] == '-':
 *         key = key[1:]
*/
  __pyx_mstate_global->__pyx_slice[1] = PySlice_New(__pyx_mstate_global->__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[1])) __PYX_ERR(11, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]);

  /* "petsc4py/PETSc/Sys.pyx":52
 *                 vstr = bytes2str(cversion)
 *                 if release != 0:
 *                     date = vstr.split(",", 1)[-1].strip()             # <<<<<<<<<<<<<<
 *                 else:
 *                     date = vstr.split("Git Date:")[-1].strip()
*/
  __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__11, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(32, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

  /* "petsc4py/PETSc/Sys.pyx":78
 * 
 *         """
 *         version, dev, date, author = cls.getVersion(True, True, True)             # <<<<<<<<<<<<<<
 *         return dict(major      = version[0],
 *                     minor      = version[1],
*/
  __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(3, Py_True, Py_True, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(32, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);

  /* "petsc4py/PETSc/Sys.pyx":187
 *         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_mstate_global->__pyx_tuple[3] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_kp_u__7); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(32, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);

  /* "petsc4py/PETSc/Log.pyx":250
 *                 else:
 *                     name_ = ".".join([func.__module__, getattr(func, "__qualname__", func.__name__)])
 *                 with cls.Event(name_, klass):             # <<<<<<<<<<<<<<
 *                     return func(*args, **kwargs)
 *             return wrapped_func
*/
  __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(33, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);

  /* "petsc4py/PETSc/Device.pyx":18
 *     attrs['__enum2str'] = enum2str
 *     attrs['__doc__']    = class_docstring
 *     return type(class_name, (object,), attrs)             # <<<<<<<<<<<<<<
 * 
 * DeviceType = make_enum_class(
*/
  __pyx_mstate_global->__pyx_tuple[5] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(2, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);

  /* "petsc4py/PETSc/Mat.pyx":3863
 *         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_mstate_global->__pyx_tuple[6] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_2, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(46, 3863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);

  /* "petsc4py/PETSc/DMPlex.pyx":90
 *         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, localizationHeight: int | None = 0, sparseLocalize: bool | None = True, comm: Comm | None = None) -> Self:
 *         """Create a mesh on the tensor product of intervals.
*/
  __pyx_mstate_global->__pyx_tuple[7] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(57, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]);
  __pyx_mstate_global->__pyx_tuple[8] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[8])) __PYX_ERR(57, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[8]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[8]);

  /* "petsc4py/PETSc/DMPlex.pyx":1250
 *         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_mstate_global->__pyx_slice[2] = PySlice_New(Py_None, Py_None, __pyx_mstate_global->__pyx_int_2); if (unlikely(!__pyx_mstate_global->__pyx_slice[2])) __PYX_ERR(57, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[2]);
  __pyx_mstate_global->__pyx_slice[3] = PySlice_New(__pyx_mstate_global->__pyx_int_1, Py_None, __pyx_mstate_global->__pyx_int_2); if (unlikely(!__pyx_mstate_global->__pyx_slice[3])) __PYX_ERR(57, 1250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[3]);

  /* "petsc4py/PETSc/libpetsc4py.pyx":146
 * 
 * cdef object parse_url(object url):
 *     path, name = url.rsplit(":", 1)             # <<<<<<<<<<<<<<
 *     return (path, name)
 * 
*/
  __pyx_mstate_global->__pyx_tuple[9] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__8, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[9])) __PYX_ERR(5, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[9]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[9]);

  /* "petsc4py/PETSc/libpetsc4py.pyx":267
 *     # package.module[.{function|class}]
 *     if '.' in name:
 *         modname, clsname = name.rsplit('.', 1)             # <<<<<<<<<<<<<<
 *         mod = PyImport_Import(modname)
 *         if hasattr(mod, clsname):
*/
  __pyx_mstate_global->__pyx_tuple[10] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u__2, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[10])) __PYX_ERR(5, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[10]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[10]);

  /* "petsc4py/PETSc/Const.pyx":47
 * 
 * 
 * class InsertMode(object):             # <<<<<<<<<<<<<<
 *     """Insertion mode.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[11] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[11])) __PYX_ERR(1, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[11]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[11]);
  __pyx_mstate_global->__pyx_tuple[12] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[12])) __PYX_ERR(1, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[12]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[12]);

  /* "petsc4py/PETSc/Const.pyx":85
 * 
 * 
 * class ScatterMode(object):             # <<<<<<<<<<<<<<
 *     """Scatter mode.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[13] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[13])) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[13]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[13]);
  __pyx_mstate_global->__pyx_tuple[14] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[14])) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[14]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[14]);

  /* "petsc4py/PETSc/Const.pyx":115
 * 
 * 
 * class NormType(object):             # <<<<<<<<<<<<<<
 *     """Norm type.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[15] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[15])) __PYX_ERR(1, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[15]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[15]);
  __pyx_mstate_global->__pyx_tuple[16] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[16])) __PYX_ERR(1, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[16]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[16]);

  /* "petsc4py/PETSc/Options.pyx":97
 *         return self
 * 
 *     def view(self, Viewer viewer=None) -> None:             # <<<<<<<<<<<<<<
 *         """View the options database.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[17] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[17])) __PYX_ERR(31, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[17]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[17]);

  /* "petsc4py/PETSc/Sys.pyx":7
 *     """System utilities."""
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def getVersion(
 *         cls,
*/
  __pyx_mstate_global->__pyx_tuple[18] = PyTuple_Pack(3, Py_False, Py_False, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[18])) __PYX_ERR(32, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[18]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[18]);

  /* "petsc4py/PETSc/Sys.pyx":261
 *     # --- xxx ---
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def splitOwnership(
 *         cls,
*/
  __pyx_mstate_global->__pyx_tuple[19] = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[19])) __PYX_ERR(32, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[19]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[19]);

  /* "petsc4py/PETSc/Sys.pyx":310
 *         return (toInt(n), toInt(N))
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def sleep(cls, seconds: float = 1.0) -> None:
 *         """Sleep some number of seconds.
*/
  __pyx_mstate_global->__pyx_tuple[20] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_float_1_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[20])) __PYX_ERR(32, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[20]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[20]);

  /* "petsc4py/PETSc/Sys.pyx":392
 *         CHKERR(PetscPopSignalHandler())
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def infoAllow(
 *         cls,
*/
  __pyx_mstate_global->__pyx_tuple[21] = PyTuple_Pack(2, Py_None, __pyx_mstate_global->__pyx_n_u_w); if (unlikely(!__pyx_mstate_global->__pyx_tuple[21])) __PYX_ERR(32, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[21]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[21]);

  /* "petsc4py/PETSc/Viewer.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class ViewerType(object):             # <<<<<<<<<<<<<<
 *     """Viewer type."""
 *     SOCKET      = S_(PETSCVIEWERSOCKET)
*/
  __pyx_mstate_global->__pyx_tuple[22] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[22])) __PYX_ERR(37, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[22]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[22]);
  __pyx_mstate_global->__pyx_tuple[23] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[23])) __PYX_ERR(37, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[23]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[23]);

  /* "petsc4py/PETSc/Viewer.pyx":23
 * 
 * 
 * class ViewerFormat(object):             # <<<<<<<<<<<<<<
 *     """Viewer format."""
 *     DEFAULT           = PETSC_VIEWER_DEFAULT
*/
  __pyx_mstate_global->__pyx_tuple[24] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[24])) __PYX_ERR(37, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[24]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[24]);
  __pyx_mstate_global->__pyx_tuple[25] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[25])) __PYX_ERR(37, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[25]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[25]);

  /* "petsc4py/PETSc/Viewer.pyx":62
 * 
 * 
 * class ViewerFileMode(object):             # <<<<<<<<<<<<<<
 *     """Viewer file mode."""
 *     # native
*/
  __pyx_mstate_global->__pyx_tuple[26] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[26])) __PYX_ERR(37, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[26]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[26]);
  __pyx_mstate_global->__pyx_tuple[27] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[27])) __PYX_ERR(37, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[27]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[27]);

  /* "petsc4py/PETSc/Viewer.pyx":75
 * 
 * 
 * class ViewerDrawSize(object):             # <<<<<<<<<<<<<<
 *     """Window size."""
 *     # native
*/
  __pyx_mstate_global->__pyx_tuple[28] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[28])) __PYX_ERR(37, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[28]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[28]);
  __pyx_mstate_global->__pyx_tuple[29] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[29])) __PYX_ERR(37, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[29]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[29]);

  /* "petsc4py/PETSc/Viewer.pyx":380
 *         return self
 * 
 *     def createDraw(             # <<<<<<<<<<<<<<
 *         self,
 *         display: str | None = None,
*/
  __pyx_mstate_global->__pyx_tuple[30] = PyTuple_Pack(5, Py_None, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[30])) __PYX_ERR(37, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[30]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[30]);

  /* "petsc4py/PETSc/Viewer.pyx":877
 *     # --- methods specific to draw viewers ---
 * 
 *     def setDrawInfo(             # <<<<<<<<<<<<<<
 *         self,
 *         display: str | None = None,
*/
  __pyx_mstate_global->__pyx_tuple[31] = PyTuple_Pack(4, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[31])) __PYX_ERR(37, 877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[31]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[31]);

  /* "petsc4py/PETSc/Random.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class RandomType(object):             # <<<<<<<<<<<<<<
 *     """The random number generator type."""
 *     RAND      = S_(PETSCRAND)
*/
  __pyx_mstate_global->__pyx_tuple[32] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[32])) __PYX_ERR(38, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[32]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[32]);
  __pyx_mstate_global->__pyx_tuple[33] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[33])) __PYX_ERR(38, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[33]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[33]);

  /* "petsc4py/PETSc/Device.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class staticproperty(property):             # <<<<<<<<<<<<<<
 *     def __get__(self, *args, **kwargs):
 *         return self.fget.__get__(*args, **kwargs)()
*/
  __pyx_mstate_global->__pyx_tuple[34] = PyTuple_Pack(1, __pyx_builtin_property); if (unlikely(!__pyx_mstate_global->__pyx_tuple[34])) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[34]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[34]);
  __pyx_mstate_global->__pyx_tuple[35] = PyTuple_Pack(1, __pyx_builtin_property); if (unlikely(!__pyx_mstate_global->__pyx_tuple[35])) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[35]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[35]);

  /* "petsc4py/PETSc/IS.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class ISType(object):             # <<<<<<<<<<<<<<
 *     """The index set types."""
 *     GENERAL = S_(ISGENERAL)
*/
  __pyx_mstate_global->__pyx_tuple[36] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[36])) __PYX_ERR(39, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[36]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[36]);
  __pyx_mstate_global->__pyx_tuple[37] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[37])) __PYX_ERR(39, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[37]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[37]);

  /* "petsc4py/PETSc/IS.pyx":204
 *         return self
 * 
 *     def createStride(             # <<<<<<<<<<<<<<
 *         self,
 *         size: int,
*/
  __pyx_mstate_global->__pyx_tuple[38] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[38])) __PYX_ERR(39, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[38]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[38]);

  /* "petsc4py/PETSc/IS.pyx":928
 *         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`.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[39] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[39])) __PYX_ERR(39, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[39]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[39]);

  /* "petsc4py/PETSc/IS.pyx":1124
 * 
 * 
 * class LGMapMapMode(object):             # <<<<<<<<<<<<<<
 *     """Enum describing mapping behavior when global indices are missing.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[40] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[40])) __PYX_ERR(39, 1124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[40]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[40]);
  __pyx_mstate_global->__pyx_tuple[41] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[41])) __PYX_ERR(39, 1124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[41]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[41]);

  /* "petsc4py/PETSc/IS.pyx":1141
 * 
 * 
 * class LGMapType(object):             # <<<<<<<<<<<<<<
 *     """Local to global map types."""
 *     BASIC = S_(ISLOCALTOGLOBALMAPPINGBASIC)
*/
  __pyx_mstate_global->__pyx_tuple[42] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[42])) __PYX_ERR(39, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[42]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[42]);
  __pyx_mstate_global->__pyx_tuple[43] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[43])) __PYX_ERR(39, 1141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[43]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[43]);

  /* "petsc4py/PETSc/SF.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class SFType(object):             # <<<<<<<<<<<<<<
 *     """The star forest types."""
 *     BASIC      = S_(PETSCSFBASIC)
*/
  __pyx_mstate_global->__pyx_tuple[44] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[44])) __PYX_ERR(40, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[44]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[44]);
  __pyx_mstate_global->__pyx_tuple[45] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[45])) __PYX_ERR(40, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[45]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[45]);

  /* "petsc4py/PETSc/Vec.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class VecType(object):             # <<<<<<<<<<<<<<
 *     """The vector type."""
 *     SEQ        = S_(VECSEQ)
*/
  __pyx_mstate_global->__pyx_tuple[46] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[46])) __PYX_ERR(41, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[46]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[46]);
  __pyx_mstate_global->__pyx_tuple[47] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[47])) __PYX_ERR(41, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[47]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[47]);

  /* "petsc4py/PETSc/Vec.pyx":24
 * 
 * 
 * class VecOption(object):             # <<<<<<<<<<<<<<
 *     """Vector assembly option."""
 *     IGNORE_OFF_PROC_ENTRIES = VEC_IGNORE_OFF_PROC_ENTRIES
*/
  __pyx_mstate_global->__pyx_tuple[48] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[48])) __PYX_ERR(41, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[48]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[48]);
  __pyx_mstate_global->__pyx_tuple[49] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[49])) __PYX_ERR(41, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[49]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[49]);

  /* "petsc4py/PETSc/Vec.pyx":726
 *         return (dltype, devId)
 * 
 *     def toDLPack(self, mode: AccessModeSpec = 'rw') -> Any:             # <<<<<<<<<<<<<<
 *         """Return a DLPack `PyCapsule` wrapping the vector data.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[50] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_rw); if (unlikely(!__pyx_mstate_global->__pyx_tuple[50])) __PYX_ERR(41, 726, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[50]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[50]);

  /* "petsc4py/PETSc/Vec.pyx":1223
 *         return lvec
 * 
 *     def getLocalVector(self, Vec lvec, readonly: bool = False) -> None:             # <<<<<<<<<<<<<<
 *         """Maps the local portion of the vector into a local vector.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[51] = PyTuple_Pack(1, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[51])) __PYX_ERR(41, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[51]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[51]);

  /* "petsc4py/PETSc/FE.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class FEType(object):             # <<<<<<<<<<<<<<
 *     """The finite element types."""
 *     BASIC     = S_(PETSCFEBASIC)
*/
  __pyx_mstate_global->__pyx_tuple[52] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[52])) __PYX_ERR(43, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[52]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[52]);
  __pyx_mstate_global->__pyx_tuple[53] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[53])) __PYX_ERR(43, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[53]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[53]);

  /* "petsc4py/PETSc/Scatter.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class ScatterType(object):             # <<<<<<<<<<<<<<
 *     """Scatter type.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[54] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[54])) __PYX_ERR(44, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[54]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[54]);
  __pyx_mstate_global->__pyx_tuple[55] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[55])) __PYX_ERR(44, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[55]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[55]);

  /* "petsc4py/PETSc/Mat.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class MatType(object):             # <<<<<<<<<<<<<<
 *     """Matrix type.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[56] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[56])) __PYX_ERR(46, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[56]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[56]);
  __pyx_mstate_global->__pyx_tuple[57] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[57])) __PYX_ERR(46, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[57]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[57]);

  /* "petsc4py/PETSc/Mat.pyx":104
 * 
 * 
 * class MatOption(object):             # <<<<<<<<<<<<<<
 *     """Matrix option.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[58] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[58])) __PYX_ERR(46, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[58]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[58]);
  __pyx_mstate_global->__pyx_tuple[59] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[59])) __PYX_ERR(46, 104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[59]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[59]);

  /* "petsc4py/PETSc/Mat.pyx":141
 * 
 * 
 * class MatAssemblyType(object):             # <<<<<<<<<<<<<<
 *     """Matrix assembly type.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[60] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[60])) __PYX_ERR(46, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[60]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[60]);
  __pyx_mstate_global->__pyx_tuple[61] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[61])) __PYX_ERR(46, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[61]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[61]);

  /* "petsc4py/PETSc/Mat.pyx":157
 * 
 * 
 * class MatInfoType(object):             # <<<<<<<<<<<<<<
 *     """Matrix info type."""
 *     LOCAL = MAT_LOCAL
*/
  __pyx_mstate_global->__pyx_tuple[62] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[62])) __PYX_ERR(46, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[62]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[62]);
  __pyx_mstate_global->__pyx_tuple[63] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[63])) __PYX_ERR(46, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[63]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[63]);

  /* "petsc4py/PETSc/Mat.pyx":164
 * 
 * 
 * class MatStructure(object):             # <<<<<<<<<<<<<<
 *     """Matrix modification structure.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[64] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[64])) __PYX_ERR(46, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[64]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[64]);
  __pyx_mstate_global->__pyx_tuple[65] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[65])) __PYX_ERR(46, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[65]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[65]);

  /* "petsc4py/PETSc/Mat.pyx":184
 * 
 * 
 * class MatDuplicateOption(object):             # <<<<<<<<<<<<<<
 *     """Matrix duplicate option.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[66] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[66])) __PYX_ERR(46, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[66]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[66]);
  __pyx_mstate_global->__pyx_tuple[67] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[67])) __PYX_ERR(46, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[67]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[67]);

  /* "petsc4py/PETSc/Mat.pyx":197
 * 
 * 
 * class MatOrderingType(object):             # <<<<<<<<<<<<<<
 *     """Factored matrix ordering type.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[68] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[68])) __PYX_ERR(46, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[68]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[68]);
  __pyx_mstate_global->__pyx_tuple[69] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[69])) __PYX_ERR(46, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[69]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[69]);

  /* "petsc4py/PETSc/Mat.pyx":217
 * 
 * 
 * class MatSolverType(object):             # <<<<<<<<<<<<<<
 *     """Factored matrix solver type.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[70] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[70])) __PYX_ERR(46, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[70]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[70]);
  __pyx_mstate_global->__pyx_tuple[71] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[71])) __PYX_ERR(46, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[71]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[71]);

  /* "petsc4py/PETSc/Mat.pyx":247
 * 
 * 
 * class MatFactorShiftType(object):             # <<<<<<<<<<<<<<
 *     """Factored matrix shift type.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[72] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[72])) __PYX_ERR(46, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[72]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[72]);
  __pyx_mstate_global->__pyx_tuple[73] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[73])) __PYX_ERR(46, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[73]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[73]);

  /* "petsc4py/PETSc/Mat.pyx":265
 * 
 * 
 * class MatSORType(object):             # <<<<<<<<<<<<<<
 *     """Matrix SOR type.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[74] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[74])) __PYX_ERR(46, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[74]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[74]);
  __pyx_mstate_global->__pyx_tuple[75] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[75])) __PYX_ERR(46, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[75]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[75]);

  /* "petsc4py/PETSc/Mat.pyx":1025
 *         return self
 * 
 *     def preallocatorPreallocate(self, Mat A, fill: bool = True) -> None:             # <<<<<<<<<<<<<<
 *         """Preallocate memory for a matrix using a preallocator matrix.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[76] = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[76])) __PYX_ERR(46, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[76]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[76]);

  /* "petsc4py/PETSc/Mat.pyx":1546
 *         return self
 * 
 *     def createH2OpusFromMat(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat A,
*/
  __pyx_mstate_global->__pyx_tuple[77] = PyTuple_Pack(7, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[77])) __PYX_ERR(46, 1546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[77]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[77]);

  /* "petsc4py/PETSc/Mat.pyx":2480
 *         return toBool(flag)
 * 
 *     def isTranspose(self, Mat mat=None, tol: float = 0) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the result of matrix comparison with transposition.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[78] = PyTuple_Pack(2, Py_None, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[78])) __PYX_ERR(46, 2480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[78]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[78]);

  /* "petsc4py/PETSc/Mat.pyx":2503
 *         return toBool(flag)
 * 
 *     def isSymmetric(self, tol: float = 0) -> bool:             # <<<<<<<<<<<<<<
 *         """Return the boolean indicating if the matrix is symmetric.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[79] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[79])) __PYX_ERR(46, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[79]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[79]);

  /* "petsc4py/PETSc/Mat.pyx":2587
 *         return toBool(flag)
 * 
 *     def isLinear(self, n: int = 1) -> bool:             # <<<<<<<<<<<<<<
 *         """Return whether the Mat is a linear operator.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[80] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[80])) __PYX_ERR(46, 2587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[80]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[80]);

  /* "petsc4py/PETSc/Mat.pyx":2713
 *         return (cols, vals)
 * 
 *     def getRowIJ(self, symmetric: bool = False, compressed: bool = False) -> tuple[ArrayInt, ArrayInt]:             # <<<<<<<<<<<<<<
 *         """Return the CSR representation of the local sparsity pattern.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[81] = PyTuple_Pack(2, Py_False, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[81])) __PYX_ERR(46, 2713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[81]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[81]);

  /* "petsc4py/PETSc/Mat.pyx":3269
 *     Stencil = MatStencil
 * 
 *     def setStencil(self, dims: DimsSpec, starts: DimsSpec | None = None, dof: int = 1) -> None:             # <<<<<<<<<<<<<<
 *         """Set matrix stencil.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[82] = PyTuple_Pack(2, Py_None, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[82])) __PYX_ERR(46, 3269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[82]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[82]);

  /* "petsc4py/PETSc/Mat.pyx":3357
 *         raise NotImplementedError
 * 
 *     def zeroRows(self, rows: IS | Sequence[int], diag: Scalar = 1.0, Vec x=None, Vec b=None) -> None:             # <<<<<<<<<<<<<<
 *         """Zero selected rows of the matrix.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[83] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_float_1_0, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[83])) __PYX_ERR(46, 3357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[83]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[83]);

  /* "petsc4py/PETSc/Mat.pyx":4072
 *     # SOR
 * 
 *     def SOR(             # <<<<<<<<<<<<<<
 *         self,
 *         Vec b,
*/
  __pyx_mstate_global->__pyx_tuple[84] = PyTuple_Pack(5, __pyx_mstate_global->__pyx_float_1_0, Py_None, __pyx_mstate_global->__pyx_float_0_0, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[84])) __PYX_ERR(46, 4072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[84]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[84]);

  /* "petsc4py/PETSc/Mat.pyx":5258
 *         return self
 * 
 *     def H2OpusLowRankUpdate(self, Mat U, Mat V=None, s: float = 1.0) -> Self:             # <<<<<<<<<<<<<<
 *         """Perform a low-rank update of the form ``self`` += sUV.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[85] = PyTuple_Pack(2, Py_None, __pyx_mstate_global->__pyx_float_1_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[85])) __PYX_ERR(46, 5258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[85]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[85]);

  /* "petsc4py/PETSc/Mat.pyx":5962
 *         return v
 * 
 *     def restoreDenseColumnVec(self, i: int, mode: AccessModeSpec = 'rw', Vec V=None) -> None:             # <<<<<<<<<<<<<<
 *         """Restore the i column vector of the dense matrix.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[86] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_rw, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[86])) __PYX_ERR(46, 5962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[86]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[86]);

  /* "petsc4py/PETSc/Mat.pyx":6308
 *         return self
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         constant: bool = False,
*/
  __pyx_mstate_global->__pyx_tuple[87] = PyTuple_Pack(3, Py_False, __pyx_mstate_global->__pyx_empty_tuple, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[87])) __PYX_ERR(46, 6308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[87]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[87]);

  /* "petsc4py/PETSc/MatPartitioning.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class MatPartitioningType(object):             # <<<<<<<<<<<<<<
 *     """The partitioning types."""
 *     PARTITIONINGCURRENT  = S_(MATPARTITIONINGCURRENT)
*/
  __pyx_mstate_global->__pyx_tuple[88] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[88])) __PYX_ERR(47, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[88]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[88]);
  __pyx_mstate_global->__pyx_tuple[89] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[89])) __PYX_ERR(47, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[89]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[89]);

  /* "petsc4py/PETSc/PC.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class PCType(object):             # <<<<<<<<<<<<<<
 *     """The preconditioner method."""
 *     NONE               = S_(PCNONE)
*/
  __pyx_mstate_global->__pyx_tuple[90] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[90])) __PYX_ERR(48, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[90]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[90]);
  __pyx_mstate_global->__pyx_tuple[91] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[91])) __PYX_ERR(48, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[91]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[91]);

  /* "petsc4py/PETSc/PC.pyx":56
 * 
 * 
 * class PCSide(object):             # <<<<<<<<<<<<<<
 *     """The manner in which the preconditioner is applied."""
 *     # native
*/
  __pyx_mstate_global->__pyx_tuple[92] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[92])) __PYX_ERR(48, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[92]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[92]);
  __pyx_mstate_global->__pyx_tuple[93] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[93])) __PYX_ERR(48, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[93]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[93]);

  /* "petsc4py/PETSc/PC.pyx":68
 * 
 * 
 * class PCASMType(object):             # <<<<<<<<<<<<<<
 *     """The *ASM* subtype."""
 *     NONE        = PC_ASM_NONE
*/
  __pyx_mstate_global->__pyx_tuple[94] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[94])) __PYX_ERR(48, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[94]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[94]);
  __pyx_mstate_global->__pyx_tuple[95] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[95])) __PYX_ERR(48, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[95]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[95]);

  /* "petsc4py/PETSc/PC.pyx":76
 * 
 * 
 * class PCGASMType(object):             # <<<<<<<<<<<<<<
 *     """The *GASM* subtype."""
 *     NONE        = PC_GASM_NONE
*/
  __pyx_mstate_global->__pyx_tuple[96] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[96])) __PYX_ERR(48, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[96]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[96]);
  __pyx_mstate_global->__pyx_tuple[97] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[97])) __PYX_ERR(48, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[97]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[97]);

  /* "petsc4py/PETSc/PC.pyx":84
 * 
 * 
 * class PCMGType(object):             # <<<<<<<<<<<<<<
 *     """The *MG* subtype."""
 *     MULTIPLICATIVE = PC_MG_MULTIPLICATIVE
*/
  __pyx_mstate_global->__pyx_tuple[98] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[98])) __PYX_ERR(48, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[98]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[98]);
  __pyx_mstate_global->__pyx_tuple[99] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[99])) __PYX_ERR(48, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[99]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[99]);

  /* "petsc4py/PETSc/PC.pyx":92
 * 
 * 
 * class PCMGCycleType(object):             # <<<<<<<<<<<<<<
 *     """The *MG* cycle type."""
 *     V = PC_MG_CYCLE_V
*/
  __pyx_mstate_global->__pyx_tuple[100] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[100])) __PYX_ERR(48, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[100]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[100]);
  __pyx_mstate_global->__pyx_tuple[101] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[101])) __PYX_ERR(48, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[101]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[101]);

  /* "petsc4py/PETSc/PC.pyx":98
 * 
 * 
 * class PCGAMGType(object):             # <<<<<<<<<<<<<<
 *     """The *GAMG* subtype."""
 *     AGG       = S_(PCGAMGAGG)
*/
  __pyx_mstate_global->__pyx_tuple[102] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[102])) __PYX_ERR(48, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[102]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[102]);
  __pyx_mstate_global->__pyx_tuple[103] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[103])) __PYX_ERR(48, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[103]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[103]);

  /* "petsc4py/PETSc/PC.pyx":105
 * 
 * 
 * class PCCompositeType(object):             # <<<<<<<<<<<<<<
 *     """The composite type."""
 *     ADDITIVE                 = PC_COMPOSITE_ADDITIVE
*/
  __pyx_mstate_global->__pyx_tuple[104] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[104])) __PYX_ERR(48, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[104]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[104]);
  __pyx_mstate_global->__pyx_tuple[105] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[105])) __PYX_ERR(48, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[105]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[105]);

  /* "petsc4py/PETSc/PC.pyx":114
 * 
 * 
 * class PCFieldSplitSchurPreType(object):             # <<<<<<<<<<<<<<
 *     """The field split Schur subtype."""
 *     SELF                     = PC_FIELDSPLIT_SCHUR_PRE_SELF
*/
  __pyx_mstate_global->__pyx_tuple[106] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[106])) __PYX_ERR(48, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[106]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[106]);
  __pyx_mstate_global->__pyx_tuple[107] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[107])) __PYX_ERR(48, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[107]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[107]);

  /* "petsc4py/PETSc/PC.pyx":123
 * 
 * 
 * class PCFieldSplitSchurFactType(object):             # <<<<<<<<<<<<<<
 *     """The field split Schur factorization type."""
 *     DIAG                     = PC_FIELDSPLIT_SCHUR_FACT_DIAG
*/
  __pyx_mstate_global->__pyx_tuple[108] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[108])) __PYX_ERR(48, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[108]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[108]);
  __pyx_mstate_global->__pyx_tuple[109] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[109])) __PYX_ERR(48, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[109]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[109]);

  /* "petsc4py/PETSc/PC.pyx":131
 * 
 * 
 * class PCPatchConstructType(object):             # <<<<<<<<<<<<<<
 *     """The patch construction type."""
 *     STAR                     = PC_PATCH_STAR
*/
  __pyx_mstate_global->__pyx_tuple[110] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[110])) __PYX_ERR(48, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[110]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[110]);
  __pyx_mstate_global->__pyx_tuple[111] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[111])) __PYX_ERR(48, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[111]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[111]);

  /* "petsc4py/PETSc/PC.pyx":140
 * 
 * 
 * class PCHPDDMCoarseCorrectionType(object):             # <<<<<<<<<<<<<<
 *     """The *HPDDM* coarse correction type."""
 *     DEFLATED                 = PC_HPDDM_COARSE_CORRECTION_DEFLATED
*/
  __pyx_mstate_global->__pyx_tuple[112] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[112])) __PYX_ERR(48, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[112]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[112]);
  __pyx_mstate_global->__pyx_tuple[113] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[113])) __PYX_ERR(48, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[113]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[113]);

  /* "petsc4py/PETSc/PC.pyx":148
 * 
 * 
 * class PCDeflationSpaceType(object):             # <<<<<<<<<<<<<<
 *     """The deflation space subtype."""
 *     HAAR                     = PC_DEFLATION_SPACE_HAAR
*/
  __pyx_mstate_global->__pyx_tuple[114] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[114])) __PYX_ERR(48, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[114]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[114]);
  __pyx_mstate_global->__pyx_tuple[115] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[115])) __PYX_ERR(48, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[115]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[115]);

  /* "petsc4py/PETSc/PC.pyx":161
 * 
 * 
 * class PCFailedReason(object):             # <<<<<<<<<<<<<<
 *     """The reason the preconditioner has failed."""
 *     SETUP_ERROR              = PC_SETUP_ERROR
*/
  __pyx_mstate_global->__pyx_tuple[116] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[116])) __PYX_ERR(48, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[116]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[116]);
  __pyx_mstate_global->__pyx_tuple[117] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[117])) __PYX_ERR(48, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[117]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[117]);

  /* "petsc4py/PETSc/PC.pyx":2143
 *         CHKERR(PCBDDCSetLocalAdjacencyGraph(self.pc, ni - 1, i, j, PETSC_COPY_VALUES))
 * 
 *     def setBDDCDivergenceMat(self, Mat div, trans: bool = False, IS l2l=None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the linear operator representing  div(u)p dx.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[118] = PyTuple_Pack(2, Py_False, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[118])) __PYX_ERR(48, 2143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[118]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[118]);

  /* "petsc4py/PETSc/PC.pyx":2169
 *         CHKERR(PCBDDCSetDivergenceMat(self.pc, div.mat, ptrans, pl2l))
 * 
 *     def setBDDCDiscreteGradient(             # <<<<<<<<<<<<<<
 *         self,
 *         Mat G,
*/
  __pyx_mstate_global->__pyx_tuple[119] = PyTuple_Pack(4, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_1, Py_True, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[119])) __PYX_ERR(48, 2169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[119]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[119]);

  /* "petsc4py/PETSc/KSP.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class KSPType(object):             # <<<<<<<<<<<<<<
 *     """KSP Type.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[120] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[120])) __PYX_ERR(49, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[120]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[120]);
  __pyx_mstate_global->__pyx_tuple[121] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[121])) __PYX_ERR(49, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[121]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[121]);

  /* "petsc4py/PETSc/KSP.pyx":224
 * 
 * 
 * class KSPNormType(object):             # <<<<<<<<<<<<<<
 *     """KSP norm type.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[122] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[122])) __PYX_ERR(49, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[122]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[122]);
  __pyx_mstate_global->__pyx_tuple[123] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[123])) __PYX_ERR(49, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[123]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[123]);

  /* "petsc4py/PETSc/KSP.pyx":260
 * 
 * 
 * class KSPConvergedReason(object):             # <<<<<<<<<<<<<<
 *     """KSP Converged Reason.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[124] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[124])) __PYX_ERR(49, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[124]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[124]);
  __pyx_mstate_global->__pyx_tuple[125] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[125])) __PYX_ERR(49, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[125]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[125]);

  /* "petsc4py/PETSc/KSP.pyx":352
 * 
 * 
 * class KSPHPDDMType(object):             # <<<<<<<<<<<<<<
 *     """The *HPDDM* Krylov solver type."""
 *     GMRES                     = KSP_HPDDM_TYPE_GMRES
*/
  __pyx_mstate_global->__pyx_tuple[126] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[126])) __PYX_ERR(49, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[126]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[126]);
  __pyx_mstate_global->__pyx_tuple[127] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[127])) __PYX_ERR(49, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[127]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[127]);

  /* "petsc4py/PETSc/KSP.pyx":364
 * 
 * 
 * class KSPDMActive(object):             # <<<<<<<<<<<<<<
 *     """Argument to KSPSetDMActive()."""
 *     OPERATOR      = KSP_DMACTIVE_OPERATOR
*/
  __pyx_mstate_global->__pyx_tuple[128] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[128])) __PYX_ERR(49, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[128]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[128]);
  __pyx_mstate_global->__pyx_tuple[129] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[129])) __PYX_ERR(49, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[129]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[129]);

  /* "petsc4py/PETSc/KSP.pyx":1079
 *             self.set_attr('__converged__', None)
 * 
 *     def addConvergenceTest(             # <<<<<<<<<<<<<<
 *         self,
 *         converged: KSPConvergenceTestFunction,
*/
  __pyx_mstate_global->__pyx_tuple[130] = PyTuple_Pack(3, Py_None, Py_None, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[130])) __PYX_ERR(49, 1079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[130]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[130]);

  /* "petsc4py/PETSc/KSP.pyx":1158
 *         return reason
 * 
 *     def setConvergenceHistory(             # <<<<<<<<<<<<<<
 *         self,
 *         length: int | None = None,
*/
  __pyx_mstate_global->__pyx_tuple[131] = PyTuple_Pack(2, Py_None, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[131])) __PYX_ERR(49, 1158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[131]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[131]);

  /* "petsc4py/PETSc/SNES.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class SNESType(object):             # <<<<<<<<<<<<<<
 *     """SNES solver type.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[132] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[132])) __PYX_ERR(50, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[132]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[132]);
  __pyx_mstate_global->__pyx_tuple[133] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[133])) __PYX_ERR(50, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[133]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[133]);

  /* "petsc4py/PETSc/SNES.pyx":34
 * 
 * 
 * class SNESNormSchedule(object):             # <<<<<<<<<<<<<<
 *     """SNES norm schedule.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[134] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[134])) __PYX_ERR(50, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[134]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[134]);
  __pyx_mstate_global->__pyx_tuple[135] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[135])) __PYX_ERR(50, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[135]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[135]);

  /* "petsc4py/PETSc/SNES.pyx":59
 * 
 * # FIXME Missing reference petsc.SNESConvergedReason
 * class SNESConvergedReason(object):             # <<<<<<<<<<<<<<
 *     """SNES solver termination reason.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[136] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[136])) __PYX_ERR(50, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[136]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[136]);
  __pyx_mstate_global->__pyx_tuple[137] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[137])) __PYX_ERR(50, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[137]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[137]);

  /* "petsc4py/PETSc/SNES.pyx":91
 * 
 * 
 * class SNESNewtonALCorrectionType(object):             # <<<<<<<<<<<<<<
 *     """SNESNEWTONAL correction type.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[138] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[138])) __PYX_ERR(50, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[138]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[138]);
  __pyx_mstate_global->__pyx_tuple[139] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[139])) __PYX_ERR(50, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[139]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[139]);

  /* "petsc4py/PETSc/SNES.pyx":2717
 * 
 * 
 * class SNESLineSearchType(object):             # <<<<<<<<<<<<<<
 *     """SNES linesearch type.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[140] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[140])) __PYX_ERR(50, 2717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[140]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[140]);
  __pyx_mstate_global->__pyx_tuple[141] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[141])) __PYX_ERR(50, 2717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[141]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[141]);

  /* "petsc4py/PETSc/SNES.pyx":2860
 *         return (toReal(minstep), toReal(maxstep), toReal(rtol), toReal(atol), toReal(ltol), toInt(max_its))
 * 
 *     def setTolerances(self, minstep: float | None = None, maxstep: float | None = None, rtol: float | None = None, atol: float | None = None, ltol: float | None = None, max_its: int | None = None) -> None:             # <<<<<<<<<<<<<<
 *         """Set the tolerance parameters used in the linesearch.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[142] = PyTuple_Pack(6, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[142])) __PYX_ERR(50, 2860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[142]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[142]);

  /* "petsc4py/PETSc/TS.pyx":4
 * # -----------------------------------------------------------------------------
 * 
 * class TSType(object):             # <<<<<<<<<<<<<<
 *     """The time stepping method."""
 *     # native
*/
  __pyx_mstate_global->__pyx_tuple[143] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[143])) __PYX_ERR(51, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[143]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[143]);
  __pyx_mstate_global->__pyx_tuple[144] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[144])) __PYX_ERR(51, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[144]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[144]);

  /* "petsc4py/PETSc/TS.pyx":38
 * 
 * 
 * class TSRKType(object):             # <<<<<<<<<<<<<<
 *     """The *RK* subtype."""
 *     RK1FE = S_(TSRK1FE)
*/
  __pyx_mstate_global->__pyx_tuple[145] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[145])) __PYX_ERR(51, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[145]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[145]);
  __pyx_mstate_global->__pyx_tuple[146] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[146])) __PYX_ERR(51, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[146]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[146]);

  /* "petsc4py/PETSc/TS.pyx":54
 * 
 * 
 * class TSARKIMEXType(object):             # <<<<<<<<<<<<<<
 *     """The *ARKIMEX* subtype."""
 *     ARKIMEX1BEE   = S_(TSARKIMEX1BEE)
*/
  __pyx_mstate_global->__pyx_tuple[147] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[147])) __PYX_ERR(51, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[147]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[147]);
  __pyx_mstate_global->__pyx_tuple[148] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[148])) __PYX_ERR(51, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[148]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[148]);

  /* "petsc4py/PETSc/TS.pyx":71
 * 
 * 
 * class TSDIRKType(object):             # <<<<<<<<<<<<<<
 *     """The *DIRK* subtype."""
 *     DIRKS212      = S_(TSDIRKS212)
*/
  __pyx_mstate_global->__pyx_tuple[149] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[149])) __PYX_ERR(51, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[149]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[149]);
  __pyx_mstate_global->__pyx_tuple[150] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[150])) __PYX_ERR(51, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[150]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[150]);

  /* "petsc4py/PETSc/TS.pyx":91
 * 
 * 
 * class TSProblemType(object):             # <<<<<<<<<<<<<<
 *     """Distinguishes linear and nonlinear problems."""
 *     LINEAR    = TS_LINEAR
*/
  __pyx_mstate_global->__pyx_tuple[151] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[151])) __PYX_ERR(51, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[151]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[151]);
  __pyx_mstate_global->__pyx_tuple[152] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[152])) __PYX_ERR(51, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[152]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[152]);

  /* "petsc4py/PETSc/TS.pyx":97
 * 
 * 
 * class TSEquationType(object):             # <<<<<<<<<<<<<<
 *     """Distinguishes among types of explicit and implicit equations."""
 *     UNSPECIFIED               = TS_EQ_UNSPECIFIED
*/
  __pyx_mstate_global->__pyx_tuple[153] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[153])) __PYX_ERR(51, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[153]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[153]);
  __pyx_mstate_global->__pyx_tuple[154] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[154])) __PYX_ERR(51, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[154]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[154]);

  /* "petsc4py/PETSc/TS.pyx":114
 * 
 * 
 * class TSExactFinalTime(object):             # <<<<<<<<<<<<<<
 *     """The method for ending time stepping."""
 *     UNSPECIFIED = TS_EXACTFINALTIME_UNSPECIFIED
*/
  __pyx_mstate_global->__pyx_tuple[155] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[155])) __PYX_ERR(51, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[155]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[155]);
  __pyx_mstate_global->__pyx_tuple[156] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[156])) __PYX_ERR(51, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[156]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[156]);

  /* "petsc4py/PETSc/AO.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class AOType(object):             # <<<<<<<<<<<<<<
 *     """The application ordering types."""
 *     BASIC          = S_(AOBASIC)
*/
  __pyx_mstate_global->__pyx_tuple[157] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[157])) __PYX_ERR(53, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[157]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[157]);
  __pyx_mstate_global->__pyx_tuple[158] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[158])) __PYX_ERR(53, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[158]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[158]);

  /* "petsc4py/PETSc/DM.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class DMType(object):             # <<<<<<<<<<<<<<
 *     """`DM` types."""
 *     DA        = S_(DMDA_type)
*/
  __pyx_mstate_global->__pyx_tuple[159] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[159])) __PYX_ERR(54, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[159]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[159]);
  __pyx_mstate_global->__pyx_tuple[160] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[160])) __PYX_ERR(54, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[160]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[160]);

  /* "petsc4py/PETSc/DM.pyx":22
 * 
 * 
 * class DMBoundaryType(object):             # <<<<<<<<<<<<<<
 *     """`DM` Boundary types."""
 *     NONE     = DM_BOUNDARY_NONE
*/
  __pyx_mstate_global->__pyx_tuple[161] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[161])) __PYX_ERR(54, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[161]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[161]);
  __pyx_mstate_global->__pyx_tuple[162] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[162])) __PYX_ERR(54, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[162]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[162]);

  /* "petsc4py/PETSc/DM.pyx":31
 * 
 * 
 * class DMPolytopeType(object):             # <<<<<<<<<<<<<<
 *     """The `DM` cell types."""
 *     POINT              = DM_POLYTOPE_POINT
*/
  __pyx_mstate_global->__pyx_tuple[163] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[163])) __PYX_ERR(54, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[163]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[163]);
  __pyx_mstate_global->__pyx_tuple[164] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[164])) __PYX_ERR(54, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[164]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[164]);

  /* "petsc4py/PETSc/DM.pyx":52
 * 
 * 
 * class DMReorderDefaultFlag(object):             # <<<<<<<<<<<<<<
 *     """The `DM` reordering default flags."""
 *     NOTSET = DM_REORDER_DEFAULT_NOTSET
*/
  __pyx_mstate_global->__pyx_tuple[165] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[165])) __PYX_ERR(54, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[165]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[165]);
  __pyx_mstate_global->__pyx_tuple[166] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[166])) __PYX_ERR(54, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[166]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[166]);

  /* "petsc4py/PETSc/DM.pyx":510
 *     #
 * 
 *     def setAuxiliaryVec(self, Vec aux, label: DMLabel | None, value=0, part=0) -> None:             # <<<<<<<<<<<<<<
 *         """Set an auxiliary vector for a specific region.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[167] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[167])) __PYX_ERR(54, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[167]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[167]);

  /* "petsc4py/PETSc/DM.pyx":540
 *         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.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[168] = PyTuple_Pack(3, Py_None, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[168])) __PYX_ERR(54, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[168]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[168]);

  /* "petsc4py/PETSc/DS.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class DSType(object):             # <<<<<<<<<<<<<<
 *     """The Discrete System types."""
 *     BASIC = S_(PETSCDSBASIC)
*/
  __pyx_mstate_global->__pyx_tuple[169] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[169])) __PYX_ERR(55, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[169]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[169]);
  __pyx_mstate_global->__pyx_tuple[170] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[170])) __PYX_ERR(55, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[170]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[170]);

  /* "petsc4py/PETSc/DMDA.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class DMDAStencilType(object):             # <<<<<<<<<<<<<<
 *     """Stencil types."""
 *     STAR = DMDA_STENCIL_STAR
*/
  __pyx_mstate_global->__pyx_tuple[171] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[171])) __PYX_ERR(56, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[171]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[171]);
  __pyx_mstate_global->__pyx_tuple[172] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[172])) __PYX_ERR(56, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[172]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[172]);

  /* "petsc4py/PETSc/DMDA.pyx":9
 * 
 * 
 * class DMDAInterpolationType(object):             # <<<<<<<<<<<<<<
 *     """Interpolation types."""
 *     Q0 = DMDA_INTERPOLATION_Q0
*/
  __pyx_mstate_global->__pyx_tuple[173] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[173])) __PYX_ERR(56, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[173]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[173]);
  __pyx_mstate_global->__pyx_tuple[174] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[174])) __PYX_ERR(56, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[174]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[174]);

  /* "petsc4py/PETSc/DMDA.pyx":15
 * 
 * 
 * class DMDAElementType(object):             # <<<<<<<<<<<<<<
 *     """Element types."""
 *     P1 = DMDA_ELEMENT_P1
*/
  __pyx_mstate_global->__pyx_tuple[175] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[175])) __PYX_ERR(56, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[175]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[175]);
  __pyx_mstate_global->__pyx_tuple[176] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[176])) __PYX_ERR(56, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[176]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[176]);

  /* "petsc4py/PETSc/DMDA.pyx":32
 *     #
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int | None = None,
*/
  __pyx_mstate_global->__pyx_tuple[177] = PyTuple_Pack(10, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None, Py_True, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[177])) __PYX_ERR(56, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[177]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[177]);

  /* "petsc4py/PETSc/DMDA.pyx":744
 *     #
 * 
 *     def setUniformCoordinates(             # <<<<<<<<<<<<<<
 *         self,
 *         xmin: float = 0,
*/
  __pyx_mstate_global->__pyx_tuple[178] = PyTuple_Pack(6, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_0, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[178])) __PYX_ERR(56, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[178]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[178]);

  /* "petsc4py/PETSc/DMDA.pyx":949
 *     #
 * 
 *     def setRefinementFactor(             # <<<<<<<<<<<<<<
 *         self,
 *         refine_x: int = 2,
*/
  __pyx_mstate_global->__pyx_tuple[179] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_2, __pyx_mstate_global->__pyx_int_2, __pyx_mstate_global->__pyx_int_2); if (unlikely(!__pyx_mstate_global->__pyx_tuple[179])) __PYX_ERR(56, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[179]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[179]);

  /* "petsc4py/PETSc/DMPlex.pyx":35
 *         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.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[180] = PyTuple_Pack(2, Py_True, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[180])) __PYX_ERR(57, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[180]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[180]);

  /* "petsc4py/PETSc/DMPlex.pyx":90
 *         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, localizationHeight: int | None = 0, sparseLocalize: bool | None = True, comm: Comm | None = None) -> Self:
 *         """Create a mesh on the tensor product of intervals.
*/
  __pyx_mstate_global->__pyx_tuple[181] = PyTuple_Pack(8, __pyx_mstate_global->__pyx_tuple[7], __pyx_mstate_global->__pyx_tuple[8], Py_True, Py_False, Py_True, __pyx_mstate_global->__pyx_int_0, Py_True, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[181])) __PYX_ERR(57, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[181]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[181]);

  /* "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.
*/
  __pyx_mstate_global->__pyx_tuple[182] = PyTuple_Pack(4, __pyx_mstate_global->__pyx_tuple[7], __pyx_mstate_global->__pyx_tuple[8], Py_True, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[182])) __PYX_ERR(57, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[182]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[182]);

  /* "petsc4py/PETSc/DMPlex.pyx":192
 *         return self
 * 
 *     def createFromFile(self, filename: str, plexname: str | None = "unnamed", interpolate: bool | None = True, comm: Comm | None = None) -> Self:             # <<<<<<<<<<<<<<
 *         """Create `DMPlex` from a file.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[183] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_n_u_unnamed, Py_True, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[183])) __PYX_ERR(57, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[183]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[183]);

  /* "petsc4py/PETSc/DMPlex.pyx":453
 *         return isets
 * 
 *     def filter(self, label: DMLabel | None = None, value: int | None = None, ignoreHalo: bool = False,             # <<<<<<<<<<<<<<
 *                sanitizeSubMesh: bool = False, comm: Comm | None = None) -> tuple[DMPlex, SF]:
 *         """Extract a subset of mesh cells defined by a label as a separate mesh.
*/
  __pyx_mstate_global->__pyx_tuple[184] = PyTuple_Pack(5, Py_None, Py_None, Py_False, Py_False, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[184])) __PYX_ERR(57, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[184]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[184]);

  /* "petsc4py/PETSc/DMPlex.pyx":1379
 *         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.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[185] = PyTuple_Pack(2, Py_None, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[185])) __PYX_ERR(57, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[185]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[185]);

  /* "petsc4py/PETSc/DMPlex.pyx":1622
 *         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.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[186] = PyTuple_Pack(3, __pyx_mstate_global->__pyx_int_0, Py_True, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[186])) __PYX_ERR(57, 1622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[186]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[186]);

  /* "petsc4py/PETSc/DMPlex.pyx":3118
 *         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.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[187] = PyTuple_Pack(2, Py_True, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[187])) __PYX_ERR(57, 3118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[187]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[187]);

  /* "petsc4py/PETSc/DMPlex.pyx":3666
 * 
 * 
 * class DMPlexTransformType(object):             # <<<<<<<<<<<<<<
 *     """Transformation types."""
 *     REFINEREGULAR = S_(DMPLEXREFINEREGULAR)
*/
  __pyx_mstate_global->__pyx_tuple[188] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[188])) __PYX_ERR(57, 3666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[188]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[188]);
  __pyx_mstate_global->__pyx_tuple[189] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[189])) __PYX_ERR(57, 3666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[189]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[189]);

  /* "petsc4py/PETSc/DMStag.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class DMStagStencilType(object):             # <<<<<<<<<<<<<<
 *     """Stencil types."""
 *     STAR = DMSTAG_STENCIL_STAR
*/
  __pyx_mstate_global->__pyx_tuple[190] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[190])) __PYX_ERR(58, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[190]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[190]);
  __pyx_mstate_global->__pyx_tuple[191] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[191])) __PYX_ERR(58, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[191]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[191]);

  /* "petsc4py/PETSc/DMStag.pyx":10
 * 
 * 
 * class DMStagStencilLocation(object):             # <<<<<<<<<<<<<<
 *     """Stencil location types."""
 *     NULLLOC          = DMSTAG_NULL_LOCATION
*/
  __pyx_mstate_global->__pyx_tuple[192] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[192])) __PYX_ERR(58, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[192]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[192]);
  __pyx_mstate_global->__pyx_tuple[193] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[193])) __PYX_ERR(58, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[193]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[193]);

  /* "petsc4py/PETSc/DMStag.pyx":50
 *     StencilLocation   = DMStagStencilLocation
 * 
 *     def create(             # <<<<<<<<<<<<<<
 *         self,
 *         dim: int,
*/
  __pyx_mstate_global->__pyx_tuple[194] = PyTuple_Pack(9, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None, Py_None, Py_False); if (unlikely(!__pyx_mstate_global->__pyx_tuple[194])) __PYX_ERR(58, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[194]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[194]);

  /* "petsc4py/PETSc/DMSwarm.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class DMSwarmType(object):             # <<<<<<<<<<<<<<
 *     """Swarm types."""
 *     BASIC = DMSWARM_BASIC
*/
  __pyx_mstate_global->__pyx_tuple[195] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[195])) __PYX_ERR(62, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[195]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[195]);
  __pyx_mstate_global->__pyx_tuple[196] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[196])) __PYX_ERR(62, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[196]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[196]);

  /* "petsc4py/PETSc/DMSwarm.pyx":9
 * 
 * 
 * class DMSwarmMigrateType(object):             # <<<<<<<<<<<<<<
 *     """Swarm migration types."""
 *     MIGRATE_BASIC = DMSWARM_MIGRATE_BASIC
*/
  __pyx_mstate_global->__pyx_tuple[197] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[197])) __PYX_ERR(62, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[197]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[197]);
  __pyx_mstate_global->__pyx_tuple[198] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[198])) __PYX_ERR(62, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[198]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[198]);

  /* "petsc4py/PETSc/DMSwarm.pyx":17
 * 
 * 
 * class DMSwarmCollectType(object):             # <<<<<<<<<<<<<<
 *     """Swarm collection types."""
 *     COLLECT_BASIC = DMSWARM_COLLECT_BASIC
*/
  __pyx_mstate_global->__pyx_tuple[199] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[199])) __PYX_ERR(62, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[199]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[199]);
  __pyx_mstate_global->__pyx_tuple[200] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[200])) __PYX_ERR(62, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[200]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[200]);

  /* "petsc4py/PETSc/DMSwarm.pyx":25
 * 
 * 
 * class DMSwarmPICLayoutType(object):             # <<<<<<<<<<<<<<
 *     """Swarm PIC layout types."""
 *     LAYOUT_REGULAR = DMSWARMPIC_LAYOUT_REGULAR
*/
  __pyx_mstate_global->__pyx_tuple[201] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[201])) __PYX_ERR(62, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[201]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[201]);
  __pyx_mstate_global->__pyx_tuple[202] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[202])) __PYX_ERR(62, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[202]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[202]);

  /* "petsc4py/PETSc/Partitioner.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class PartitionerType(object):             # <<<<<<<<<<<<<<
 *     """The partitioner types."""
 *     PARMETIS        = S_(PETSCPARTITIONERPARMETIS)
*/
  __pyx_mstate_global->__pyx_tuple[203] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[203])) __PYX_ERR(63, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[203]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[203]);
  __pyx_mstate_global->__pyx_tuple[204] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[204])) __PYX_ERR(63, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[204]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[204]);

  /* "petsc4py/PETSc/Space.pyx":3
 * # --------------------------------------------------------------------
 * 
 * class SpaceType(object):             # <<<<<<<<<<<<<<
 *     """The function space types."""
 *     POLYNOMIAL = S_(PETSCSPACEPOLYNOMIAL)
*/
  __pyx_mstate_global->__pyx_tuple[205] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[205])) __PYX_ERR(64, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[205]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[205]);
  __pyx_mstate_global->__pyx_tuple[206] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[206])) __PYX_ERR(64, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[206]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[206]);

  /* "petsc4py/PETSc/Space.pyx":563
 * 
 * 
 * class DualSpaceType(object):             # <<<<<<<<<<<<<<
 *     """The dual space types."""
 *     LAGRANGE = S_(PETSCDUALSPACELAGRANGE)
*/
  __pyx_mstate_global->__pyx_tuple[207] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[207])) __PYX_ERR(64, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[207]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[207]);
  __pyx_mstate_global->__pyx_tuple[208] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[208])) __PYX_ERR(64, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[208]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[208]);

  /* "petsc4py/PETSc/Regressor.pyx":1
 * class RegressorType(object):             # <<<<<<<<<<<<<<
 *     """REGRESSOR solver type.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[209] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[209])) __PYX_ERR(66, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[209]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[209]);
  __pyx_mstate_global->__pyx_tuple[210] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[210])) __PYX_ERR(66, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[210]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[210]);

  /* "petsc4py/PETSc/Regressor.pyx":12
 * 
 * 
 * class RegressorLinearType(object):             # <<<<<<<<<<<<<<
 *     """Linear regressor type.
 * 
*/
  __pyx_mstate_global->__pyx_tuple[211] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[211])) __PYX_ERR(66, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[211]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[211]);
  __pyx_mstate_global->__pyx_tuple[212] = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_mstate_global->__pyx_tuple[212])) __PYX_ERR(66, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[212]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[212]);
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_tuple;
    for (Py_ssize_t i=0; i<213; ++i) {
      #if PY_VERSION_HEX >= 0x030F0000
      PyUnstable_SetImmortal(table[i]);
      #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
      }
      #else
      if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_slice;
    for (Py_ssize_t i=0; i<4; ++i) {
      #if PY_VERSION_HEX >= 0x030F0000
      PyUnstable_SetImmortal(table[i]);
      #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
      }
      #else
      if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  {
    const struct { const unsigned int length: 13; } index[] = {{2},{17},{14},{10},{29},{15},{18},{479},{35},{24},{31},{33},{31},{30},{42},{26},{51},{49},{26},{83},{80},{97},{54},{37},{60},{24},{52},{11},{14},{14},{25},{20},{15},{21},{7},{13},{11},{20},{37},{28},{26},{15},{61},{44},{22},{18},{17},{14},{34},{248},{70},{40},{89},{89},{85},{18},{14},{21},{14},{9},{6},{17},{24},{18},{13},{8},{33},{15},{38},{21},{17},{326},{20},{45},{39},{40},{22},{14},{27},{26},{19},{2279},{6192},{831},{26},{16},{21},{89},{85},{26},{15},{23},{26},{10},{16},{26},{20},{14},{70},{80},{86},{17},{86},{67},{63},{15},{24},{172},{44},{41},{45},{14},{242},{28},{15},{179},{37},{26},{7},{90},{15},{34},{58},{84},{12},{17},{9},{50},{19},{24},{27},{24},{26},{99},{22},{22},{25},{83},{79},{97},{69},{14},{285},{71},{21},{19},{13},{16},{23},{23},{25},{17},{13},{14},{15},{22},{13},{18},{25},{20},{31},{13},{34},{18},{17},{23},{14},{16},{16},{23},{23},{22},{12},{27},{55},{60},{36},{22},{15},{92},{67},{19},{19},{18},{18},{26},{24},{26},{25},{24},{20},{21},{20},{48},{22},{18},{19},{20},{34},{26},{19},{19},{31},{35},{20},{17},{17},{31},{19},{28},{21},{41},{30},{25},{25},{20},{50},{36},{22},{23},{28},{26},{33},{41},{39},{22},{25},{128},{146},{144},{16},{21},{11},{10},{17},{32},{28},{19},{10},{26},{14},{21},{23},{18},{28},{22},{17},{14},{12},{12},{1},{1},{1},{1},{1},{1},{1},{1},{1},{2},{1},{1},{1},{1},{0},{1},{2},{8},{22},{5},{26},{29},{23},{24},{11},{13},{6},{6},{31},{12},{30},{18},{11},{103},{5},{5},{30},{19},{52},{15},{13},{20},{53},{22},{23},{25},{39},{41},{57},{36},{34},{61},{38},{34},{61},{38},{56},{8},{19},{21},{27},{16},{22},{14},{7},{14},{10},{6},{13},{11},{30},{28},{12},{27},{2},{65},{54},{12},{9},{12},{6},{35},{24},{29},{29},{31},{37},{50},{10},{21},{41},{9},{30},{5},{8},{19},{8},{9},{11},{9},{11},{9},{9},{65},{64},{63},{46},{11},{10},{7},{5},{5},{50},{16},{29},{17},{21},{5},{8},{18},{28},{36},{44},{21},{21},{23},{30},{23},{26},{25},{26},{25},{26},{26},{21},{21},{21},{25},{24},{21},{21},{22},{22},{34},{22},{25},{26},{21},{24},{30},{25},{28},{21},{23},{26},{26},{24},{22},{22},{21},{22},{25},{27},{35},{28},{26},{27},{8},{2},{18},{50},{39},{2},{24},{11},{11},{11},{15},{15},{15},{43},{10},{29},{20},{32},{22},{22},{20},{25},{38},{28},{24},{26},{27},{38},{27},{16},{17},{27},{53},{46},{13},{13},{19},{37},{15},{30},{37},{35},{29},{28},{30},{25},{101},{15},{19},{13},{21},{20},{23},{19},{18},{19},{25},{32},{23},{60},{57},{72},{71},{14},{31},{40},{24},{23},{25},{15},{43},{20},{88},{15},{17},{34},{31},{19},{26},{40},{45},{31},{24},{15},{30},{14},{22},{17},{55},{15},{22},{20},{28},{25},{25},{27},{46},{23},{15},{14},{25},{31},{27},{39},{56},{12},{30},{37},{39},{28},{28},{25},{23},{24},{23},{30},{21},{19},{24},{22},{33},{24},{23},{13},{53},{14},{2},{1},{3},{3},{3},{3},{7},{2},{3},{3},{3},{8},{7},{14},{6},{13},{10},{5},{4},{8},{3},{11},{2},{3},{6},{11},{6},{7},{7},{11},{2},{3},{9},{10},{8},{4},{8},{5},{6},{6},{3},{8},{2},{6},{12},{14},{16},{23},{10},{10},{12},{7},{6},{13},{11},{11},{7},{11},{9},{9},{9},{8},{8},{8},{9},{13},{13},{11},{9},{13},{11},{6},{5},{12},{9},{11},{17},{11},{10},{11},{10},{17},{11},{17},{12},{18},{11},{12},{13},{9},{5},{5},{3},{7},{5},{2},{2},{14},{4},{3},{4},{9},{12},{8},{9},{11},{12},{3},{1},{4},{14},{9},{14},{15},{9},{10},{7},{12},{13},{4},{7},{8},{3},{5},{15},{3},{4},{5},{4},{3},{3},{2},{6},{5},{7},{6},{4},{6},{13},{8},{9},{7},{5},{5},{8},{4},{4},{8},{4},{4},{4},{3},{6},{6},{6},{5},{5},{4},{2},{7},{12},{1},{9},{2},{4},{4},{3},{5},{9},{8},{7},{15},{7},{9},{2},{13},{23},{15},{12},{9},{9},{10},{9},{16},{18},{15},{14},{31},{15},{19},{24},{15},{15},{15},{25},{19},{13},{14},{19},{14},{31},{24},{17},{21},{14},{14},{11},{2},{2},{14},{14},{4},{7},{8},{6},{13},{14},{19},{16},{26},{12},{16},{11},{5},{5},{11},{4},{12},{12},{14},{12},{12},{13},{11},{13},{15},{4},{1},{2},{19},{19},{19},{20},{24},{24},{24},{25},{4},{3},{3},{3},{6},{7},{20},{8},{9},{5},{9},{8},{7},{9},{6},{4},{8},{9},{25},{12},{4},{8},{8},{11},{8},{9},{11},{12},{12},{12},{12},{11},{12},{13},{8},{9},{12},{8},{8},{18},{23},{13},{23},{24},{26},{23},{22},{14},{24},{21},{20},{18},{19},{15},{15},{15},{12},{17},{24},{21},{13},{25},{27},{23},{22},{17},{21},{13},{2},{2},{8},{14},{21},{11},{19},{29},{28},{17},{18},{18},{21},{22},{24},{21},{23},{21},{19},{4},{15},{21},{15},{15},{25},{24},{11},{21},{14},{10},{20},{22},{15},{11},{11},{19},{16},{17},{20},{19},{25},{23},{17},{14},{24},{15},{13},{15},{19},{20},{16},{20},{20},{20},{22},{11},{11},{19},{17},{25},{17},{24},{13},{15},{19},{20},{26},{15},{22},{23},{24},{30},{22},{22},{25},{29},{22},{22},{21},{7},{17},{19},{18},{20},{18},{20},{24},{14},{19},{15},{20},{18},{17},{14},{14},{17},{23},{34},{20},{20},{22},{16},{18},{16},{18},{16},{16},{15},{13},{23},{20},{16},{23},{12},{6},{15},{19},{21},{22},{23},{23},{21},{30},{23},{21},{20},{29},{40},{26},{22},{22},{13},{20},{27},{17},{25},{25},{26},{28},{21},{28},{19},{27},{25},{21},{30},{17},{23},{27},{20},{17},{22},{27},{24},{27},{26},{26},{13},{15},{19},{29},{23},{18},{23},{15},{14},{25},{18},{15},{22},{18},{23},{14},{18},{14},{21},{19},{18},{21},{20},{21},{26},{21},{20},{25},{25},{27},{20},{21},{17},{21},{27},{20},{25},{27},{25},{23},{23},{17},{28},{18},{20},{16},{28},{20},{17},{17},{22},{22},{24},{21},{21},{19},{28},{26},{30},{23},{31},{31},{33},{32},{32},{34},{29},{32},{25},{26},{26},{24},{22},{24},{23},{19},{23},{22},{36},{27},{31},{31},{25},{33},{32},{32},{27},{26},{22},{26},{34},{29},{39},{32},{23},{25},{31},{27},{25},{13},{14},{28},{24},{24},{18},{18},{29},{18},{15},{14},{25},{18},{20},{21},{21},{25},{27},{17},{21},{23},{25},{20},{15},{17},{19},{19},{20},{20},{14},{20},{22},{7},{14},{18},{36},{44},{35},{29},{26},{30},{28},{23},{28},{22},{24},{34},{23},{24},{34},{23},{33},{22},{17},{17},{6},{21},{17},{21},{13},{29},{29},{23},{17},{13},{13},{27},{22},{21},{21},{20},{20},{21},{22},{25},{19},{39},{21},{22},{18},{17},{23},{26},{13},{21},{25},{19},{21},{22},{28},{36},{35},{7},{18},{18},{20},{11},{17},{18},{16},{25},{26},{22},{17},{14},{35},{36},{34},{35},{36},{37},{35},{36},{29},{17},{23},{23},{22},{16},{20},{15},{31},{30},{15},{21},{21},{19},{26},{20},{17},{23},{21},{27},{35},{35},{15},{21},{22},{36},{28},{20},{25},{25},{22},{16},{6},{13},{14},{17},{11},{22},{10},{14},{20},{18},{8},{10},{19},{10},{9},{11},{13},{9},{11},{27},{18},{18},{22},{14},{17},{19},{12},{20},{18},{14},{10},{12},{18},{20},{15},{17},{22},{27},{21},{26},{14},{18},{18},{19},{23},{17},{22},{26},{8},{15},{11},{20},{19},{15},{11},{11},{15},{15},{17},{15},{16},{22},{18},{14},{15},{15},{19},{17},{13},{17},{15},{20},{15},{17},{10},{16},{16},{11},{7},{16},{15},{22},{9},{18},{14},{19},{18},{12},{18},{20},{22},{27},{21},{26},{14},{19},{20},{17},{22},{15},{11},{20},{17},{19},{25},{17},{16},{18},{13},{15},{19},{17},{13},{17},{18},{18},{15},{20},{10},{8},{16},{13},{7},{3},{4},{9},{10},{18},{4},{10},{12},{7},{14},{10},{4},{2},{6},{9},{10},{16},{25},{16},{16},{15},{22},{21},{21},{10},{20},{17},{10},{8},{7},{5},{2},{8},{18},{6},{13},{20},{21},{23},{18},{24},{23},{27},{18},{18},{24},{23},{28},{27},{19},{25},{21},{14},{10},{16},{13},{14},{18},{20},{21},{11},{8},{8},{9},{13},{16},{17},{19},{15},{22},{23},{30},{31},{27},{28},{26},{19},{18},{17},{15},{31},{27},{28},{26},{18},{28},{29},{17},{15},{14},{3},{15},{5},{9},{7},{9},{22},{4},{5},{5},{8},{6},{8},{7},{11},{8},{12},{5},{14},{14},{14},{13},{5},{14},{55},{33},{14},{20},{1},{24},{12},{16},{23},{6},{13},{19},{15},{5},{3},{5},{6},{3},{2},{6},{6},{9},{15},{16},{17},{10},{16},{15},{15},{20},{19},{12},{16},{22},{15},{16},{15},{20},{17},{19},{16},{15},{10},{8},{7},{3},{4},{6},{10},{5},{14},{10},{5},{14},{22},{6},{7},{13},{13},{2},{3},{9},{5},{10},{15},{16},{10},{11},{8},{13},{14},{4},{9},{8},{15},{12},{23},{22},{8},{6},{4},{1},{8},{4},{8},{4},{8},{6},{7},{3},{6},{2},{7},{3},{22},{7},{4},{4},{10},{10},{4},{5},{5},{4},{7},{8},{8},{1},{6},{14},{19},{19},{4},{4},{13},{9},{17},{13},{12},{11},{17},{11},{4},{4},{8},{10},{8},{9},{9},{18},{10},{3},{3},{4},{5},{25},{9},{2},{5},{5},{12},{11},{2},{4},{25},{25},{19},{21},{1},{5},{3},{23},{23},{23},{19},{3},{8},{8},{3},{8},{18},{13},{12},{6},{10},{17},{9},{16},{13},{14},{11},{3},{2},{6},{12},{11},{12},{10},{20},{19},{16},{13},{7},{9},{14},{16},{15},{10},{13},{12},{8},{8},{9},{18},{15},{13},{10},{15},{10},{11},{12},{10},{12},{20},{13},{16},{11},{7},{20},{26},{11},{18},{15},{14},{13},{17},{12},{10},{7},{6},{12},{8},{7},{9},{4},{8},{10},{14},{7},{17},{9},{1},{2},{6},{4},{8},{4},{8},{4},{7},{2},{20},{3},{6},{3},{18},{26},{11},{12},{18},{11},{7},{20},{14},{16},{7},{22},{23},{17},{17},{23},{22},{32},{10},{16},{11},{13},{23},{25},{28},{22},{25},{22},{9},{26},{16},{24},{26},{22},{14},{15},{16},{20},{9},{13},{20},{17},{19},{10},{15},{17},{11},{15},{25},{12},{21},{11},{17},{9},{13},{25},{23},{17},{28},{22},{25},{22},{9},{15},{26},{18},{19},{16},{24},{26},{22},{14},{15},{16},{20},{9},{13},{16},{15},{20},{17},{19},{17},{11},{9},{17},{22},{9},{18},{8},{1},{2},{8},{5},{12},{14},{18},{3},{3},{4},{6},{5},{12},{9},{11},{16},{23},{13},{18},{12},{14},{14},{13},{21},{18},{18},{16},{13},{13},{10},{20},{13},{10},{6},{4},{14},{8},{11},{9},{8},{7},{16},{7},{7},{17},{14},{12},{5},{8},{20},{19},{21},{5},{3},{3},{3},{4},{6},{2},{5},{14},{4},{10},{3},{8},{17},{19},{18},{16},{18},{8},{18},{17},{17},{14},{19},{12},{18},{21},{16},{20},{18},{21},{8},{18},{17},{17},{19},{18},{16},{19},{12},{13},{18},{19},{9},{9},{18},{9},{12},{9},{14},{12},{11},{12},{12},{8},{6},{4},{1},{4},{7},{4},{3},{9},{11},{6},{15},{3},{7},{10},{14},{7},{5},{4},{2},{11},{6},{13},{19},{22},{12},{5},{6},{6},{12},{11},{2},{4},{11},{3},{6},{6},{9},{14},{9},{10},{10},{14},{7},{10},{7},{8},{12},{11},{6},{7},{9},{7},{8},{7},{11},{4},{2},{14},{10},{5},{7},{3},{15},{15},{16},{18},{18},{22},{11},{15},{9},{15},{15},{19},{21},{22},{23},{23},{28},{30},{23},{20},{10},{11},{13},{12},{7},{18},{23},{23},{29},{29},{23},{25},{7},{11},{14},{21},{12},{12},{16},{23},{12},{17},{15},{8},{8},{13},{14},{8},{13},{11},{8},{10},{13},{16},{23},{14},{26},{15},{19},{18},{23},{28},{25},{12},{13},{14},{16},{25},{16},{15},{17},{25},{21},{19},{26},{19},{17},{18},{14},{11},{17},{13},{9},{18},{13},{13},{12},{25},{19},{26},{21},{21},{20},{16},{19},{16},{17},{15},{19},{9},{17},{21},{15},{23},{21},{15},{20},{22},{17},{14},{11},{12},{13},{16},{14},{16},{21},{16},{17},{16},{17},{17},{18},{20},{14},{19},{15},{20},{16},{13},{20},{15},{18},{21},{27},{22},{28},{20},{17},{22},{10},{12},{13},{33},{11},{12},{19},{25},{11},{12},{13},{16},{14},{22},{12},{19},{23},{15},{15},{20},{12},{27},{15},{20},{15},{8},{8},{14},{11},{12},{20},{8},{11},{17},{20},{17},{20},{8},{11},{27},{8},{8},{12},{29},{13},{25},{25},{21},{25},{18},{9},{16},{17},{9},{15},{15},{18},{22},{17},{22},{12},{13},{16},{14},{16},{17},{20},{18},{16},{13},{20},{23},{28},{23},{25},{23},{20},{17},{13},{12},{14},{25},{25},{11},{17},{9},{12},{30},{26},{17},{23},{19},{13},{20},{23},{23},{25},{28},{28},{28},{23},{16},{16},{16},{18},{21},{21},{21},{16},{25},{14},{9},{9},{12},{17},{16},{18},{21},{15},{12},{13},{20},{14},{8},{15},{12},{19},{24},{26},{17},{11},{4},{1},{2},{3},{2},{4},{4},{6},{7},{3},{9},{2},{5},{10},{9},{11},{8},{4},{7},{8},{8},{8},{26},{21},{24},{6},{3},{9},{7},{3},{2},{2},{7},{2},{7},{8},{11},{24},{4},{9},{7},{6},{15},{6},{12},{6},{11},{12},{15},{14},{13},{23},{17},{8},{12},{9},{19},{21},{6},{14},{19},{21},{7},{11},{3},{3},{7},{2},{22},{4},{12},{8},{12},{14},{9},{16},{25},{17},{21},{17},{21},{16},{21},{14},{14},{12},{12},{3},{6},{8},{10},{10},{8},{3},{5},{6},{15},{19},{26},{14},{13},{14},{29},{14},{17},{19},{14},{14},{12},{14},{23},{18},{18},{14},{13},{24},{12},{14},{21},{14},{24},{23},{18},{15},{20},{15},{11},{22},{2},{6},{7},{13},{14},{16},{15},{14},{15},{20},{14},{19},{15},{20},{17},{22},{17},{15},{20},{17},{18},{16},{12},{12},{12},{1},{2},{5},{5},{9},{8},{5},{19},{17},{19},{20},{20},{17},{20},{18},{6},{5},{8},{2},{9},{15},{20},{14},{25},{24},{10},{10},{4},{27},{13},{8},{20},{6},{6},{21},{22},{8},{21},{22},{17},{9},{15},{10},{15},{19},{17},{8},{24},{17},{18},{22},{18},{30},{21},{22},{31},{23},{24},{15},{9},{19},{21},{14},{14},{19},{16},{20},{18},{12},{15},{19},{17},{19},{16},{10},{13},{11},{20},{8},{24},{16},{20},{24},{13},{26},{25},{29},{34},{26},{23},{23},{28},{16},{24},{27},{32},{26},{31},{19},{17},{8},{24},{31},{23},{21},{37},{30},{20},{29},{18},{20},{17},{27},{17},{22},{18},{22},{18},{29},{28},{20},{17},{16},{17},{14},{17},{14},{23},{31},{23},{24},{17},{30},{23},{27},{32},{31},{33},{28},{15},{17},{24},{21},{14},{9},{14},{19},{11},{12},{9},{15},{19},{24},{26},{40},{26},{40},{24},{29},{19},{16},{25},{19},{19},{17},{13},{16},{17},{12},{17},{10},{8},{16},{13},{7},{2},{5},{8},{5},{4},{6},{3},{3},{13},{9},{8},{6},{7},{8},{6},{7},{10},{7},{7},{8},{4},{5},{18},{10},{17},{8},{12},{14},{7},{7},{3},{8},{6},{8},{8},{7},{6},{7},{11},{15},{18},{19},{19},{17},{26},{29},{19},{17},{16},{18},{4},{12},{5},{11},{4},{20},{2},{2},{3},{3},{6},{2},{2},{9},{13},{17},{7},{12},{4},{11},{12},{14},{12},{21},{13},{21},{13},{9},{1},{6},{4},{6},{8},{9},{4},{3},{4},{12},{9},{8},{12},{19},{7},{17},{13},{9},{11},{15},{8},{7},{13},{3},{10},{5},{5},{2},{5},{4},{4},{3},{5},{3},{5},{5},{4},{5},{5},{5},{6},{4},{9},{18},{12},{5},{10},{9},{11},{11},{6},{10},{13},{14},{18},{14},{14},{15},{19},{21},{18},{14},{14},{11},{8},{6},{9},{19},{13},{16},{17},{13},{31},{28},{22},{23},{16},{17},{17},{15},{24},{31},{23},{25},{30},{17},{15},{14},{18},{5},{1},{4},{20},{7},{10},{4},{5},{9},{7},{15},{21},{15},{21},{5},{15},{6},{7},{16},{4},{5},{4},{3},{6},{9},{14},{9},{10},{10},{14},{7},{10},{7},{8},{8},{12},{11},{6},{7},{9},{7},{8},{7},{11},{11},{2},{6},{13},{11},{10},{16},{9},{23},{23},{16},{18},{10},{20},{18},{16},{14},{12},{11},{11},{10},{14},{12},{8},{15},{13},{17},{11},{15},{10},{8},{7},{6},{21},{5},{6},{6},{4},{21},{19},{12},{17},{20},{14},{18},{21},{22},{23},{28},{22},{29},{23},{28},{22},{19},{15},{26},{16},{15},{8},{18},{24},{24},{20},{20},{15},{21},{14},{11},{17},{12},{26},{23},{21},{23},{26},{23},{10},{27},{27},{22},{20},{20},{24},{17},{22},{19},{23},{21},{16},{27},{20},{20},{23},{16},{11},{19},{18},{29},{30},{22},{23},{15},{18},{16},{11},{11},{15},{29},{20},{17},{21},{16},{21},{18},{11},{16},{22},{20},{20},{26},{18},{12},{14},{13},{13},{14},{13},{21},{22},{11},{26},{12},{18},{10},{26},{23},{26},{23},{10},{27},{27},{20},{24},{17},{17},{22},{22},{19},{16},{20},{20},{23},{16},{11},{18},{26},{30},{22},{23},{15},{11},{11},{15},{30},{24},{20},{17},{21},{16},{26},{28},{28},{26},{31},{21},{18},{21},{16},{20},{26},{18},{12},{10},{18},{14},{13},{13},{14},{13},{22},{10},{9},{6},{3},{11},{7},{4},{3},{7},{8},{4},{5},{5},{5},{9},{9},{8},{3},{4},{8},{4},{4},{6},{6},{8},{6},{6},{22},{14},{9},{9},{15},{11},{6},{22},{9},{23},{8},{7},{12},{3},{8},{7},{12},{3},{5},{4},{9},{24},{16},{14},{6},{4},{7},{6},{10},{7},{11},{15},{11},{13},{12},{14},{15},{11},{15},{15},{22},{15},{13},{13},{14},{12},{13},{12},{7},{24},{14},{29},{19},{13},{14},{27},{15},{16},{33},{24},{28},{14},{26},{29},{33},{19},{20},{22},{17},{20},{17},{22},{22},{22},{13},{16},{24},{28},{14},{26},{29},{33},{19},{20},{22},{20},{17},{22},{13},{12},{4},{8},{4},{4},{10},{5},{9},{12},{13},{15},{18},{22},{21},{27},{20},{25},{23},{24},{20},{27},{23},{13},{15},{20},{22},{21},{27},{20},{25},{23},{24},{20},{27},{23},{13},{11},{10},{5},{7},{15},{11},{10},{9},{3},{9},{18},{14},{18},{22},{13},{15},{17},{19},{20},{20},{20},{18},{9},{18},{13},{13},{3},{11},{11},{22},{18},{19},{18},{19},{27},{21},{22},{30},{13},{28},{17},{19},{20},{21},{30},{21},{28},{25},{34},{26},{34},{30},{21},{19},{27},{18},{18},{20},{28},{19},{7},{11},{14},{15},{15},{22},{27},{15},{13},{12},{7},{17},{11},{23},{17},{18},{22},{24},{19},{18},{19},{20},{28},{19},{25},{10},{16},{11},{20},{15},{13},{15},{24},{20},{27},{22},{22},{26},{15},{19},{14},{28},{22},{23},{25},{10},{13},{16},{14},{17},{33},{24},{14},{16},{27},{21},{20},{20},{17},{15},{19},{21},{11},{17},{11},{13},{21},{11},{20},{15},{13},{15},{27},{29},{39},{28},{26},{27},{18},{22},{22},{26},{18},{15},{19},{14},{28},{31},{22},{15},{21},{23},{25},{23},{20},{13},{14},{33},{24},{14},{16},{24},{20},{20},{17},{15},{15},{20},{17},{11},{9},{13},{21},{9},{8},{5},{9},{6},{11},{5},{3},{2},{5},{5},{10},{15},{9},{8},{9},{16},{4},{4},{2},{13},{17},{10},{14},{16},{11},{5},{13},{13},{13},{8},{6},{15},{18},{15},{15},{14},{22},{8},{20},{20},{19},{19},{20},{21},{27},{21},{29},{22},{9},{15},{21},{10},{17},{17},{12},{21},{19},{18},{14},{8},{18},{25},{21},{16},{16},{15},{15},{9},{19},{14},{13},{13},{15},{19},{14},{13},{14},{17},{19},{16},{18},{17},{17},{12},{10},{18},{20},{14},{15},{15},{16},{16},{20},{11},{19},{10},{23},{14},{16},{10},{14},{7},{10},{16},{19},{8},{14},{11},{26},{26},{17},{17},{17},{12},{21},{19},{14},{8},{18},{22},{21},{18},{21},{20},{17},{16},{16},{15},{15},{16},{21},{23},{14},{13},{13},{19},{14},{13},{17},{19},{16},{17},{17},{18},{23},{23},{16},{25},{12},{20},{14},{15},{16},{16},{11},{19},{10},{14},{14},{16},{10},{8},{8},{7},{7},{5},{1},{4},{1},{2},{7},{4},{7},{12},{12},{23},{10},{9},{16},{11},{27},{2},{6},{5},{7},{8},{4},{14},{10},{4},{4},{1},{5},{8},{12},{12},{9},{3},{7},{7},{7},{2},{3},{9},{14},{7},{14},{24},{23},{11},{14},{21},{13},{12},{12},{12},{7},{23},{12},{17},{15},{20},{9},{8},{8},{13},{14},{11},{21},{20},{8},{19},{15},{13},{8},{10},{24},{15},{24},{23},{21},{13},{14},{13},{16},{28},{19},{20},{11},{7},{12},{10},{12},{13},{9},{7},{12},{16},{13},{22},{18},{20},{17},{9},{14},{16},{12},{16},{18},{18},{18},{20},{21},{22},{11},{12},{16},{11},{12},{13},{24},{15},{20},{18},{10},{9},{8},{13},{7},{8},{13},{11},{7},{22},{9},{8},{7},{9},{14},{12},{8},{13},{11},{13},{11},{14},{19},{16},{19},{16},{17},{14},{14},{22},{21},{20},{22},{20},{9},{7},{12},{16},{9},{18},{12},{15},{18},{13},{20},{13},{12},{11},{9},{12},{17},{13},{20},{25},{18},{24},{9},{11},{16},{13},{13},{14},{15},{17},{13},{7},{8},{8},{13},{11},{12},{8},{9},{15},{15},{6},{14},{14},{12},{10},{17},{19},{22},{28},{19},{26},{20},{27},{22},{10},{12},{13},{11},{13},{13},{18},{16},{13},{18},{19},{17},{17},{18},{19},{16},{14},{12},{18},{18},{18},{16},{23},{20},{19},{14},{27},{18},{16},{18},{30},{28},{19},{17},{23},{18},{18},{18},{18},{21},{23},{20},{14},{12},{23},{19},{11},{23},{4},{1},{3},{6},{5},{3},{1},{18},{1},{2},{1},{5},{3},{5},{3},{8},{10},{11},{9},{11},{9},{14},{18},{16},{18},{5},{6},{8},{21},{11},{8},{10},{8},{9},{11},{10},{7},{4},{3},{9},{12},{15},{12},{12},{11},{13},{2},{2},{9},{12},{15},{7},{5},{9},{5},{6},{7},{7},{6},{4},{6},{5},{12},{2},{3},{3},{9},{6},{6},{19},{5},{10},{17},{7},{12},{18},{19},{14},{3},{4},{5},{19},{7},{7},{8},{10},{8},{13},{11},{6},{18},{6},{4},{16},{4},{2},{6},{10},{3},{2},{4},{5},{4},{4},{1},{5},{4},{9},{14},{15},{9},{10},{7},{12},{13},{7},{4},{9},{7},{7},{8},{10},{8},{7},{7},{4},{8},{7},{7},{7},{5},{10},{11},{4},{7},{9},{4},{9},{10},{6},{9},{4},{4},{8},{10},{8},{13},{14},{3},{2},{5},{3},{3},{5},{3},{3},{6},{8},{13},{13},{13},{12},{4},{7},{7},{4},{1},{9},{4},{6},{5},{19},{6},{6},{7},{13},{5},{6},{10},{6},{6},{10},{10},{3},{7},{7},{5},{13},{5},{5},{6},{5},{6},{5},{12},{16},{10},{8},{9},{11},{6},{6},{6},{4},{3},{5},{7},{7},{7},{6},{12},{7},{10},{12},{4},{5},{8},{5},{9},{7},{3},{5},{5},{4},{4},{5},{7},{5},{6},{2},{4},{12},{12},{6},{6},{5},{4},{12},{8},{4},{5},{5},{5},{7},{6},{2},{6},{5},{6},{10},{11},{10},{5},{9},{5},{11},{6},{4},{5},{4},{6},{11},{5},{7},{6},{13},{4},{14},{6},{5},{14},{4},{2},{7},{3},{4},{5},{11},{20},{6},{6},{8},{5},{7},{7},{7},{3},{10},{6},{7},{6},{9},{7},{7},{5},{3},{8},{4},{10},{2},{2},{9},{17},{7},{11},{4},{5},{15},{7},{9},{11},{17},{15},{12},{10},{4},{6},{7},{4},{18},{5},{19},{10},{5},{7},{6},{3},{5},{6},{2},{4},{5},{4},{10},{6},{7},{8},{4},{10},{8},{5},{4},{4},{2},{5},{9},{3},{7},{5},{8},{7},{5},{5},{4},{5},{8},{7},{4},{11},{10},{8},{7},{10},{9},{13},{14},{6},{7},{16},{14},{11},{12},{4},{4},{6},{7},{3},{9},{17},{18},{8},{6},{4},{6},{6},{4},{5},{4},{7},{10},{7},{10},{7},{22},{18},{13},{20},{18},{28},{15},{15},{33},{14},{17},{17},{16},{16},{17},{12},{15},{14},{10},{16},{24},{18},{24},{18},{26},{19},{15},{21},{11},{4},{15},{9},{7},{9},{10},{9},{5},{8},{11},{19},{7},{10},{9},{7},{16},{5},{5},{5},{5},{11},{15},{15},{10},{6},{13},{13},{3},{5},{4},{6},{8},{10},{9},{8},{6},{15},{8},{4},{6},{5},{6},{7},{14},{8},{2},{8},{9},{5},{5},{5},{3},{8},{3},{6},{7},{7},{8},{7},{8},{7},{7},{7},{5},{6},{7},{7},{6},{9},{12},{19},{11},{10},{11},{12},{11},{13},{20},{12},{10},{18},{20},{18},{19},{21},{14},{22},{22},{21},{8},{13},{15},{11},{15},{14},{10},{20},{20},{12},{20},{24},{18},{14},{13},{11},{20},{19},{23},{15},{18},{27},{28},{10},{19},{10},{19},{24},{21},{8},{11},{15},{19},{13},{9},{11},{14},{14},{17},{26},{27},{9},{11},{13},{16},{9},{12},{20},{16},{19},{10},{12},{21},{20},{12},{18},{17},{15},{11},{8},{13},{21},{13},{15},{9},{12},{12},{11},{17},{15},{22},{15},{9},{13},{14},{10},{24},{15},{16},{11},{16},{20},{11},{13},{18},{12},{4},{10},{16},{14},{5},{4},{6},{5},{5},{7},{6},{9},{2},{9},{6},{5},{5},{4},{9},{3},{6},{8},{5},{6},{8},{15},{3},{6},{6},{7},{6},{5},{5},{8},{12},{7},{8},{16},{8},{7},{3},{3},{3},{4},{5},{7},{10},{9},{6},{7},{10},{8},{3},{4},{6},{5},{10},{6},{8},{16},{4},{5},{6},{4},{5},{8},{7},{7},{8},{10},{1},{4},{2},{4},{4},{4},{5},{4},{10},{8},{6},{6},{6},{9},{12},{7},{6},{8},{7},{9},{9},{5},{5},{6},{7},{28},{29},{12},{27},{28},{22},{11},{11},{3},{5},{5},{6},{9},{11},{4},{13},{13},{8},{4},{10},{3},{4},{9},{4},{7},{4},{8},{10},{15},{20},{17},{17},{20},{19},{19},{3},{7},{6},{9},{10},{10},{17},{8},{6},{2},{5},{9},{5},{9},{10},{4},{7},{8},{3},{6},{3},{7},{3},{12},{6},{7},{3},{4},{4},{4},{4},{4},{4},{6},{3},{8},{6},{8},{4},{9},{10},{4},{2},{7},{6},{2},{5},{7},{4},{5},{15},{14},{5},{9},{4},{1},{5},{9},{7},{8},{5},{5},{5},{6},{3},{8},{9},{9},{11},{7},{5},{10},{9},{3},{7},{6},{5},{20},{4},{10},{5},{3},{4},{4},{4},{5},{4},{8},{12},{5},{7},{3},{4},{8},{5},{3},{6},{1},{5},{4},{14},{9},{9},{8},{21},{15},{22},{17},{17},{16},{14},{5},{2},{7},{15},{13},{4},{5},{9},{9},{10},{6},{8},{8},{4},{10},{16},{17},{6},{9},{21},{12},{5},{3},{12},{3},{15},{4},{5},{5},{5},{3},{4},{4},{5},{5},{5},{5},{5},{4},{10},{16},{16},{6},{7},{7},{6},{5},{10},{15},{16},{10},{11},{8},{13},{14},{3},{4},{8},{8},{10},{9},{4},{4},{3},{1},{3},{8},{5},{15},{12},{8},{6},{11},{9},{5},{6},{2},{4},{5},{8},{7},{22},{16},{11},{5},{14},{11},{12},{9},{9},{12},{12},{22},{6},{14},{9},{21},{8},{7},{15},{16},{11},{20},{16},{17},{13},{15},{12},{12},{13},{7},{12},{15},{16},{14},{9},{9},{19},{18},{14},{16},{10},{13},{19},{24},{18},{23},{9},{15},{15},{14},{9},{16},{11},{16},{8},{10},{12},{11},{15},{11},{15},{7},{13},{18},{14},{16},{21},{24},{7},{18},{11},{25},{16},{20},{23},{18},{21},{18},{15},{16},{22},{19},{17},{20},{14},{19},{23},{10},{16},{15},{10},{11},{5},{5},{7},{14},{23},{22},{12},{17},{15},{21},{14},{9},{13},{17},{11},{19},{17},{8},{15},{9},{11},{13},{11},{16},{7},{6},{12},{13},{22},{6},{12},{14},{11},{10},{20},{22},{15},{22},{22},{18},{17},{15},{15},{19},{12},{17},{14},{18},{16},{17},{15},{19},{15},{8},{17},{18},{21},{25},{11},{13},{12},{14},{27},{18},{19},{9},{11},{11},{8},{9},{11},{11},{22},{15},{21},{16},{13},{15},{10},{14},{12},{16},{14},{12},{11},{15},{21},{8},{8},{12},{28},{20},{21},{12},{12},{16},{10},{13},{13},{12},{12},{18},{13},{5},{10},{24},{10},{7},{15},{20},{22},{6},{11},{20},{20},{11},{14},{13},{18},{11},{19},{21},{7},{6},{14},{16},{8},{9},{9},{12},{9},{12},{10},{10},{8},{12},{12},{14},{12},{13},{21},{17},{18},{13},{21},{18},{12},{22},{24},{13},{19},{11},{15},{12},{13},{17},{11},{14},{14},{15},{16},{18},{11},{11},{16},{13},{17},{15},{9},{9},{9},{25},{17},{25},{27},{11},{18},{11},{10},{29},{20},{7},{14},{12},{10},{8},{12},{13},{12},{13},{13},{14},{13},{11},{6},{6},{10},{7},{16},{10},{15},{11},{16},{14},{24},{26},{24},{15},{11},{12},{16},{9},{12},{12},{12},{12},{15},{9},{11},{12},{23},{17},{14},{9},{14},{12},{9},{16},{8},{11},{14},{17},{23},{18},{24},{5},{9},{21},{11},{14},{14},{11},{14},{14},{13},{14},{19},{14},{13},{18},{14},{10},{19},{11},{10},{11},{14},{12},{32},{16},{13},{13},{15},{14},{14},{9},{9},{7},{7},{12},{18},{11},{14},{19},{18},{20},{15},{6},{6},{8},{9},{7},{15},{17},{9},{14},{10},{29},{10},{12},{7},{7},{8},{11},{12},{15},{17},{17},{12},{17},{19},{10},{14},{15},{15},{13},{13},{17},{14},{12},{14},{13},{9},{9},{12},{12},{13},{14},{17},{18},{14},{10},{14},{6},{15},{21},{11},{21},{17},{7},{8},{16},{12},{7},{11},{20},{11},{11},{13},{18},{18},{20},{15},{21},{7},{9},{10},{8},{8},{9},{8},{13},{16},{8},{10},{12},{9},{12},{20},{17},{11},{13},{10},{11},{10},{7},{9},{10},{14},{18},{10},{11},{3},{12},{12},{11},{16},{14},{7},{6},{13},{13},{15},{20},{18},{16},{16},{9},{4},{4},{5},{4},{8},{8},{5},{5},{6},{4},{3},{6},{4},{5},{6},{11},{13},{2},{4},{1},{5},{5},{6},{7},{3},{11},{18},{8},{11},{6},{7},{8},{10},{8},{9},{5},{3},{6},{18},{7},{9},{4},{9},{4},{4},{4},{5},{4},{5},{7},{10},{9},{1},{2},{2},{4},{6},{5},{6},{5},{5},{5},{2},{5},{4},{5},{8},{4},{4},{3},{6},{4},{6},{8},{4},{7},{2},{10},{19},{5},{4},{5},{6},{2},{4},{8},{4},{5},{10},{5},{8},{6},{15},{17},{17},{5},{9},{7},{22},{4},{9},{8},{12},{11},{23},{6},{10},{21},{8},{22},{12},{3},{9},{8},{6},{11},{11},{13},{9},{8},{6},{19},{17},{6},{5},{7},{7},{4},{8},{11},{13},{11},{11},{16},{10},{13},{8},{13},{9},{8},{23},{11},{16},{11},{7},{13},{7},{7},{8},{6},{5},{7},{5},{6},{5},{8},{6},{4},{5},{11},{9},{9},{8},{6},{9},{6},{7},{5},{6},{3},{5},{7},{5},{4},{5},{8},{5},{3},{5},{4},{5},{5},{5},{5},{1},{2},{8},{15},{17},{19},{14},{9},{4},{4},{4},{9},{1},{5},{6},{9},{3},{4},{4},{5},{4},{3},{8},{6},{1},{3},{3},{5},{21},{13},{9},{10},{10},{8},{5},{10},{3},{11},{8},{8},{10},{4},{6},{5},{6},{3},{5},{10},{6},{6},{4},{4},{4},{10},{10},{10},{3},{4},{4},{4},{4},{4},{3},{4},{4},{5},{9},{13},{12},{15},{15},{18},{19},{9},{8},{4},{3},{21},{8},{3},{5},{5},{7},{3},{2},{7},{3},{5},{5},{6},{4},{4},{2},{4},{5},{2},{2},{2},{1},{4},{9},{7},{8},{5},{7},{6},{17},{4},{3},{8},{17},{10},{7},{8},{17},{16},{8},{20},{4},{3},{7},{11},{9},{6},{18},{14},{9},{9},{6},{7},{9},{8},{6},{5},{4},{7},{7},{6},{2},{5},{4},{4},{4},{6},{4},{6},{7},{7},{13},{13},{6},{7},{7},{7},{14},{14},{9},{12},{21},{19},{23},{16},{24},{24},{26},{25},{25},{27},{22},{25},{18},{9},{19},{19},{17},{15},{17},{16},{12},{16},{15},{29},{20},{24},{24},{18},{26},{25},{25},{20},{19},{15},{19},{27},{22},{32},{25},{16},{18},{6},{5},{7},{24},{10},{3},{9},{6},{5},{7},{6},{3},{4},{3},{4},{5},{10},{3},{7},{7},{13},{11},{6},{8},{2},{15},{3},{4},{5},{10},{8},{5},{4},{7},{17},{13},{16},{13},{16},{13},{1},{7},{7},{7},{7},{2},{4},{4},{8},{5},{5},{4},{15},{20},{18},{2},{3},{7},{2},{6},{3},{7},{5},{5},{5},{4},{6},{6},{5},{7},{4},{5},{4},{5},{4},{6},{3},{3},{7},{7},{3},{5},{6},{7},{5},{5},{6},{6},{11},{10},{5},{6},{5},{7},{6},{6},{5},{6},{6},{7},{5},{7},{12},{6},{6},{5},{7},{5},{6},{8},{10},{5},{5},{6},{6},{2},{7},{2},{3},{2},{4},{5},{6},{2},{2},{7},{7},{6},{2},{4},{4},{3},{8},{6},{6},{6},{2},{5},{12},{8},{3},{5},{3},{4},{7},{5},{4},{9},{7},{8},{9},{6},{9},{9},{8},{4},{3},{9},{5},{6},{7},{5},{6},{9},{2},{7},{7},{6},{5},{3},{5},{6},{3},{8},{9},{5},{2},{5},{5},{5},{4},{10},{9},{8},{7},{10},{17},{6},{9},{11},{13},{12},{7},{11},{9},{8},{13},{9},{12},{12},{13},{9},{11},{8},{2},{4},{3},{3},{2},{12},{11},{7},{6},{1},{4},{6},{3},{8},{6},{9},{7},{6},{4},{2},{10},{7},{4},{6},{2},{4},{8},{2},{2},{5},{7},{4},{2},{4},{8},{9},{6},{7},{4},{8},{5},{6},{11},{5},{5},{2},{3},{6},{2},{4},{4},{7},{16},{3},{1},{2},{4},{6},{4},{7},{11},{8},{6},{6},{4},{9},{12},{17},{23},{3},{2},{7},{11},{7},{2},{3},{6},{4},{8},{4},{11},{7},{4},{5},{9},{14},{6},{5},{4},{2},{7},{9},{2},{4},{10},{7},{8},{4},{5},{4},{3},{5},{6},{15},{12},{15},{12},{13},{3},{3},{20},{11},{15},{9},{8},{16},{15},{20},{6},{8},{17},{9},{8},{9},{9},{8},{3},{2},{3},{8},{7},{13},{23},{8},{7},{6},{9},{10},{11},{7},{8},{7},{5},{11},{23},{10},{5},{14},{21},{15},{7},{13},{8},{6},{4},{3},{6},{5},{4},{21},{12},{16},{10},{9},{16},{21},{2},{4},{6},{11},{7},{6},{5},{12},{14},{11},{10},{19},{14},{2},{2},{6},{3},{4},{12},{5},{8},{1},{6},{6},{6},{4},{5},{5},{5},{4},{5},{6},{3},{5},{8},{4},{8},{5},{4},{8},{6},{21},{10},{3},{10},{11},{9},{17},{13},{9},{15},{6},{5},{6},{15},{8},{8},{8},{15},{17},{8},{16},{13},{14},{3},{7},{6},{13},{6},{11},{11},{18},{16},{10},{18},{4},{8},{7},{25},{17},{17},{7},{8},{3},{5},{10},{9},{7},{8},{7},{11},{18},{17},{21},{21},{12},{16},{16},{17},{21},{15},{18},{16},{16},{13},{18},{23},{13},{15},{12},{13},{11},{6},{14},{6},{5},{7},{7},{5},{3},{12},{5},{2},{4},{3},{8},{3},{5},{8},{8},{11},{8},{3},{9},{6},{6},{4},{2},{5},{6},{6},{6},{4},{6},{8},{6},{4},{5},{5},{5},{4},{2},{2},{2},{4},{6},{1},{2},{4},{2},{15},{5},{6},{7},{12},{10},{12},{4},{3},{7},{7},{11},{9},{11},{9},{4},{8},{4},{3},{3},{16},{11},{23},{23},{14},{11},{21},{13},{17},{21},{10},{9},{12},{12},{22},{14},{14},{9},{21},{8},{7},{15},{23},{22},{26},{31},{23},{20},{20},{25},{13},{21},{24},{29},{23},{28},{11},{23},{25},{35},{24},{22},{17},{13},{15},{12},{13},{15},{16},{19},{24},{18},{23},{9},{15},{11},{8},{11},{10},{16},{21},{19},{13},{24},{7},{18},{11},{16},{20},{23},{14},{18},{21},{18},{19},{16},{17},{17},{14},{19},{16},{28},{36},{27},{21},{18},{22},{20},{15},{20},{14},{10},{11},{5},{11},{5},{14},{23},{22},{12},{17},{14},{15},{21},{28},{20},{18},{34},{27},{17},{26},{9},{11},{9},{11},{6},{12},{17},{22},{6},{11},{12},{14},{22},{15},{22},{19},{18},{15},{18},{17},{15},{19},{12},{12},{17},{17},{15},{17},{14},{24},{14},{19},{15},{8},{17},{18},{21},{25},{11},{12},{14},{19},{15},{26},{25},{17},{11},{11},{17},{14},{11},{15},{21},{13},{14},{11},{14},{11},{15},{16},{14},{16},{26},{15},{11},{15},{8},{20},{28},{20},{21},{14},{12},{27},{20},{24},{29},{28},{30},{25},{12},{10},{13},{13},{12},{12},{13},{18},{13},{18},{11},{10},{24},{10},{15},{20},{22},{20},{27},{20},{11},{18},{11},{17},{19},{21},{19},{16},{6},{22},{8},{9},{9},{12},{10},{10},{14},{13},{21},{17},{18},{13},{21},{21},{13},{15},{15},{13},{16},{26},{15},{25},{14},{14},{21},{18},{11},{6},{11},{16},{8},{9},{6},{11},{13},{10},{9},{25},{17},{25},{27},{18},{18},{20},{11},{10},{29},{20},{14},{10},{12},{13},{6},{6},{10},{7},{16},{14},{14},{25},{19},{15},{11},{12},{16},{12},{15},{12},{20},{9},{12},{9},{17},{16},{8},{18},{5},{9},{21},{11},{14},{21},{23},{37},{23},{37},{21},{26},{14},{14},{19},{27},{14},{10},{27},{19},{12},{11},{11},{10},{19},{24},{19},{21},{19},{14},{12},{16},{13},{13},{14},{14},{15},{20},{20},{13},{22},{9},{9},{12},{9},{14},{19},{18},{20},{20},{16},{11},{15},{22},{15},{15},{16},{16},{14},{10},{13},{14},{9},{14},{17},{10},{12},{7},{17},{18},{19},{8},{11},{12},{19},{17},{16},{10},{14},{15},{13},{13},{12},{13},{9},{17},{18},{14},{10},{14},{15},{21},{11},{21},{17},{16},{8},{16},{12},{7},{11},{11},{11},{13},{21},{21},{18},{7},{13},{21},{29},{28},{5},{13},{13},{9},{10},{8},{8},{18},{9},{8},{13},{8},{26},{22},{13},{19},{15},{9},{16},{19},{19},{21},{24},{24},{24},{19},{12},{12},{12},{14},{17},{17},{17},{12},{20},{21},{17},{13},{10},{10},{12},{10},{12},{19},{5},{2},{11},{12},{7},{4},{5},{9},{13},{5},{10},{11},{9},{4},{7},{3},{4},{5},{4},{5},{4},{4},{4},{4},{6},{7},{4},{9},{6},{3},{7},{4},{5},{8},{13},{12},{9},{14},{17},{6},{4},{13},{14},{28},{20},{12},{17},{7},{2},{5},{8},{10},{8},{14},{5},{14},{9},{7},{5},{5},{7},{4},{5},{6},{10},{5},{8},{13},{8},{12},{14},{22},{6},{10},{6},{10},{17},{12},{13},{11},{4},{13},{11},{7},{4},{4},{11},{7},{3},{6},{8},{7},{15},{6},{11},{12},{9},{9},{10},{11},{13},{9},{7},{11},{6},{5},{6},{9},{5},{3},{7},{8},{7},{5},{6},{6},{7},{8},{9},{5},{15},{16},{6},{3},{4},{4},{5},{5},{5},{6},{2},{4},{6},{2},{3},{4},{9},{10},{9},{9},{11},{3},{1},{2},{2},{4},{9},{7},{3},{4},{3},{13},{8},{16},{5},{6},{6},{4},{4},{4},{6},{4},{9},{9},{4},{5},{9},{4},{9},{8},{5},{5},{8},{9},{6},{6},{3},{4},{6},{4},{8},{12},{12},{7},{10},{9},{5},{9},{16},{7},{2},{7},{7},{5},{5},{4},{5},{3},{17},{7},{7},{1},{2},{3},{2},{2},{4},{3},{7},{13},{5},{4},{7},{6},{6},{7},{7},{7},{7},{7},{7},{7},{2},{7},{8},{6},{10},{5},{3},{12},{10},{10},{7},{15},{10},{13},{4},{4},{6},{4},{1},{3},{4},{4},{5},{6},{9},{5},{6},{3},{13},{5},{8},{14},{6},{8},{4},{4},{4},{4},{5},{5},{17},{7},{9},{7},{12},{2},{17},{4},{14},{15},{10},{16},{8},{6},{2},{3},{2},{4},{2},{3},{2},{5},{4},{4},{5},{5},{3},{8},{1},{7},{5},{6},{6},{5},{12},{5},{5},{1},{5},{5},{4},{7},{2},{4},{5},{4},{5},{5},{2},{2},{2},{4},{3},{1},{4},{5},{4},{5},{5},{1},{11},{8},{15},{20},{22},{13},{9},{8},{4},{5},{4},{5},{3},{3},{7},{3075},{2},{1},{1},{0},{1},{1},{81},{36},{31},{160},{117},{34},{45},{33},{34},{28},{25},{25},{25},{25},{25},{25},{34},{44},{54},{35},{34},{160},{101},{166},{8},{45},{105},{11},{43},{35},{35},{77},{43},{43},{44},{115},{52},{31},{34},{39},{51},{171},{7},{104},{98},{48},{35},{14},{138},{52},{100},{90},{91},{91},{43},{39},{45},{45},{44},{44},{44},{44},{43},{75},{57},{49},{39},{64},{35},{91},{136},{54},{68},{39},{51},{39},{39},{119},{66},{52},{16},{57},{102},{119},{51},{34},{48},{94},{72},{29},{21},{20},{25},{52},{24},{35},{34},{51},{29},{43},{91},{21},{25},{29},{34},{39},{38},{29},{43},{25},{33},{40},{21},{40},{44},{64},{55},{24},{39},{39},{52},{63},{39},{15},{32},{38},{42},{30},{39},{57},{38},{77},{39},{48},{38},{39},{39},{39},{64},{25},{21},{21},{62},{25},{25},{34},{103},{30},{43},{51},{24},{29},{76},{76},{34},{33},{63},{61},{65},{64},{51},{83},{34},{39},{39},{34},{39},{38},{51},{39},{52},{38},{39},{42},{18},{16},{141},{34},{155},{113},{70},{70},{70},{26},{145},{124},{43},{38},{57},{57},{34},{34},{139},{139},{29},{25},{29},{34},{55},{57},{33},{19},{29},{30},{25},{29},{25},{25},{25},{54},{39},{155},{37},{40},{61},{52},{34},{45},{52},{12},{72},{88},{129},{55},{54},{120},{51},{59},{23},{23},{52},{26},{29},{29},{42},{87},{36},{61},{38},{128},{96},{48},{215},{72},{39},{39},{40},{54},{75},{45},{53},{62},{54},{39},{73},{25},{29},{117},{39},{38},{52},{110},{52},{61},{28},{12},{78},{78},{52},{160},{34},{33},{33},{84},{52},{123},{97},{92},{146},{132},{86},{50},{43},{43},{43},{43},{44},{54},{69},{29},{29},{25},{42},{69},{39},{52},{36},{94},{32},{123},{133},{112},{36},{126},{132},{74},{42},{52},{52},{52},{44},{112},{43},{47},{27},{33},{31},{26},{154},{39},{231},{36},{67},{48},{149},{59},{95},{43},{43},{43},{43},{43},{47},{43},{43},{52},{92},{34},{34},{34},{43},{34},{47},{45},{64},{52},{52},{52},{52},{64},{95},{57},{141},{123},{86},{108},{84},{98},{47},{39},{67},{67},{37},{67},{12},{25},{33},{36},{25},{25},{31},{39},{76},{133},{384},{51},{44},{42},{45},{87},{79},{40},{40},{34},{34},{40},{34},{38},{109},{67},{12},{31},{29},{31},{33},{25},{97},{55},{98},{92},{80},{278},{428},{35},{35},{221},{116},{116},{29},{138},{46},{144},{169},{138},{138},{141},{132},{144},{79},{127},{70},{70},{57},{64},{81},{211},{213},{212},{185},{189},{31},{225},{190},{109},{95},{95},{30},{29},{93},{39},{35},{30},{440},{190},{100},{95},{137},{213},{125},{129},{131},{45},{375},{46},{138},{117},{30},{122},{55},{154},{27},{114},{165},{14},{126},{355},{355},{432},{79},{100},{127},{151},{129},{186},{81},{152},{152},{36},{74},{76},{73},{264},{163},{193},{145},{175},{149},{143},{41},{329},{329},{339},{28},{18},{9},{79},{124},{14},{14},{53},{31},{14},{121},{286},{287},{487},{85},{118},{165},{632},{104},{103},{63},{59},{64},{92},{113},{366},{261},{112},{151},{26},{252},{182},{192},{182},{83},{146},{131},{35},{39},{37},{38},{39},{39},{39},{39},{39},{127},{98},{93},{38},{49},{53},{53},{50},{135},{51},{59},{135},{96},{52},{52},{234},{103},{38},{40},{59},{39},{107},{106},{106},{106},{109},{150},{19},{59},{133},{17},{21},{39},{24},{33},{39},{17},{167},{95},{68},{17},{20},{24},{25},{39},{27},{25},{25},{39},{39},{38},{151},{197},{281},{340},{832},{164},{107},{167},{151},{141},{558},{21},{157},{153},{270},{24},{23},{34},{214},{28},{94},{38},{47},{93},{33},{35},{430},{288},{110},{110},{110},{110},{130},{39},{39},{35},{19},{21},{28},{39},{95},{38},{39},{39},{162},{162},{110},{25},{120},{21},{25},{39},{89},{89},{86},{86},{39},{229},{79},{162},{68},{61},{33},{28},{38},{33},{40},{43},{39},{34},{34},{53},{74},{177},{59},{132},{59},{31},{62},{157},{92},{62},{44},{161},{25},{25},{70},{53},{105},{104},{637},{55},{38},{36},{81},{54},{39},{39},{85},{52},{62},{52},{62},{88},{126},{177},{142},{133},{95},{37},{113},{86},{141},{141},{84},{228},{107},{107},{106},{107},{106},{115},{120},{123},{113},{113},{88},{109},{48},{253},{123},{109},{107},{109},{107},{107},{107},{39},{39},{52},{72},{11},{19},{11},{18},{18},{18},{18},{33},{62},{134},{237},{128},{118},{16},{16},{55},{55},{13},{13},{169},{169},{157},{119},{36},{69},{70},{41},{41},{37},{55},{55},{170},{170},{53},{54},{41},{27},{87},{89},{42},{47},{153},{101},{90},{180},{105},{45},{113},{53},{71},{44},{180},{153},{80},{80},{49},{118},{192},{112},{12},{174},{96},{106},{112},{67},{103},{103},{124},{103},{120},{29},{143},{191},{181},{34},{33},{36},{128},{55},{167},{74},{77},{124},{124},{70},{61},{33},{33},{34},{34},{34},{34},{82},{74},{29},{34},{52},{34},{64},{65},{52},{47},{34},{52},{47},{50},{127},{35},{128},{33},{45},{119},{45},{12},{37},{30},{30},{29},{30},{34},{34},{34},{24},{42},{43},{20},{20},{18},{129},{133},{47},{152},{166},{39},{50},{34},{46},{43},{129},{96},{125},{45},{147},{135},{67},{60},{65},{71},{24},{49},{29},{52},{77},{35},{127},{53},{47},{32},{68},{94},{61},{38},{39},{29},{44},{43},{37},{54},{135},{230},{162},{39},{123},{66},{71},{68},{173},{130},{118},{68},{93},{65},{31},{86},{86},{39},{31},{39},{39},{43},{77},{132},{62},{44},{117},{130},{52},{301},{38},{95},{39},{97},{270},{76},{118},{87},{101},{87},{54},{38},{31},{39},{49},{43},{98},{96},{51},{52},{157},{78},{63},{50},{39},{39},{25},{25},{50},{50},{52},{21},{20},{20},{21},{39},{52},{39},{25},{35},{39},{21},{54},{20},{35},{26},{34},{34},{34},{39},{24},{38},{39},{39},{39},{43},{35},{39},{21},{38},{43},{38},{43},{34},{53},{39},{22},{29},{39},{24},{43},{50},{86},{25},{63},{39},{39},{39},{39},{39},{29},{63},{29},{52},{20},{24},{29},{38},{28},{28},{51},{51},{55},{56},{42},{61},{33},{43},{34},{50},{38},{38},{43},{31},{29},{39},{142},{51},{51},{68},{51},{56},{18},{16},{60},{38},{34},{35},{46},{48},{85},{53},{68},{96},{52},{52},{65},{172},{97},{93},{69},{52},{52},{52},{69},{69},{54},{23},{54},{120},{57},{138},{33},{116},{34},{33},{42},{34},{34},{52},{33},{123},{56},{113},{34},{34},{28},{48},{54},{45},{48},{52},{24},{35},{54},{198},{90},{51},{181},{104},{77},{43},{42},{43},{43},{43},{64},{52},{97},{45},{34},{33},{34},{33},{34},{56},{41},{117},{60},{34},{33},{34},{123},{117},{34},{67},{34},{65},{65},{65},{73},{63},{73},{43},{40},{72},{94},{69},{68},{79},{81},{67},{52},{29},{29},{34},{34},{33},{33},{34},{32},{20},{104},{32},{264},{224},{34},{33},{34},{32},{34},{72},{15},{7},{44},{25},{37},{28},{21},{27},{20},{21},{39},{87},{25},{30},{28},{27},{27},{52},{39},{27},{43},{42},{47},{42},{42},{43},{29},{39},{39},{63},{38},{38},{83},{52},{38},{38},{81},{15},{21},{26},{23},{21},{28},{64},{32},{43},{39},{39},{39},{28},{28},{32},{107},{27},{27},{27},{26},{38},{25},{35},{39},{52},{43},{43},{43},{43},{43},{28},{28},{19},{39},{21},{21},{21},{39},{39},{37},{25},{39},{39},{43},{95},{38},{39},{43},{23},{42},{51},{35},{21},{44},{21},{21},{132},{118},{144},{39},{39},{38},{38},{39},{39},{27},{28},{21},{20},{21},{21},{39},{63},{23},{62},{39},{38},{25},{51},{76},{92},{76},{79},{68},{25},{43},{35},{35},{39},{39},{29},{46},{103},{63},{25},{379},{51},{21},{30},{39},{25},{34},{39},{39},{39},{21},{21},{25},{21},{21},{41},{52},{25},{93},{39},{29},{39},{39},{39},{77},{21},{20},{39},{29},{38},{38},{38},{39},{38},{38},{39},{52},{25},{62},{39},{29},{29},{15},{21},{44},{29},{38},{54},{34},{39},{39},{39},{39},{126},{21},{21},{43},{38},{50},{38},{38},{38},{24},{39},{39},{39},{39},{37},{39},{25},{28},{28},{29},{30},{39},{41},{28},{35},{21},{21},{20},{92},{63},{57},{39},{20},{42},{25},{24},{38},{42},{33},{33},{24},{24},{25},{24},{42},{42},{37},{38},{38},{24},{32},{38},{42},{43},{86},{39},{37},{39},{27},{38},{25},{25},{25},{39},{44},{21},{21},{34},{26},{25},{57},{35},{25},{39},{78},{54},{39},{50},{127},{39},{51},{51},{52},{62},{96},{36},{34},{20},{38},{42},{38},{38},{34},{27},{27},{20},{20},{28},{24},{84},{38},{38},{38},{50},{42},{24},{40},{63},{67},{44},{44},{42},{52},{42},{39},{39},{39},{39},{56},{34},{34},{64},{70},{34},{34},{34},{37},{39},{33},{37},{83},{32},{288},{82},{56},{34},{34},{100},{34},{62},{42},{55},{34},{32},{34},{34},{33},{34},{34},{34},{66},{52},{102},{65},{34},{34},{34},{51},{51},{47},{47},{51},{65},{71},{50},{71},{68},{66},{67},{66},{66},{68},{81},{66},{66},{66},{67},{68},{45},{45},{67},{67},{67},{38},{66},{67},{66},{66},{66},{66},{66},{152},{62},{634},{40},{42},{651},{44},{81},{48},{28},{28},{66},{39},{103},{34},{45},{39},{60},{44},{44},{83},{32},{34},{50},{34},{34},{33},{47},{158},{51},{343},{25},{46},{56},{66},{64},{124},{47},{91},{32},{142},{95},{104},{88},{171},{44},{49},{126},{113},{93},{78},{81},{40},{39},{39},{65},{37},{119},{74},{42},{45},{45},{44},{45},{45},{44},{44},{44},{45},{45},{48},{45},{45},{44},{44},{44},{47},{43},{42},{43},{42},{45},{43},{39},{39},{52},{70},{32},{136},{51},{31},{52},{52},{39},{52},{66},{35},{49},{38},{38},{66},{39},{52},{65},{65},{65},{65},{50},{81},{16},{39},{51},{38},{51},{51},{92},{98},{68},{42},{52},{62},{81},{20},{21},{21},{25},{25},{26},{21},{68},{34},{32},{29},{25},{21},{39},{29},{43},{21},{21},{21},{32},{39},{39},{78},{39},{25},{54},{39},{39},{21},{61},{39},{38},{39},{39},{39},{43},{21},{20},{20},{25},{38},{39},{34},{25},{35},{52},{29},{29},{25},{21},{21},{21},{21},{33},{32},{26},{41},{25},{39},{39},{39},{50},{94},{59},{20},{25},{24},{42},{20},{20},{25},{20},{29},{54},{78},{77},{52},{53},{39},{80},{86},{92},{48},{160},{52},{38},{81},{52},{39},{52},{54},{52},{51},{43},{52},{52},{43},{52},{69},{51},{51},{46},{51},{56},{93},{69},{56},{55},{16},{16},{18},{20},{16},{16},{65},{65},{64},{51},{51},{52},{38},{51},{34},{34},{52},{39},{79},{65},{65},{60},{47},{46},{50},{140},{142},{135},{54},{91},{59},{33},{32},{237},{54},{66},{65},{33},{62},{74},{51},{66},{34},{52},{34},{123},{43},{34},{33},{45},{38},{42},{65},{65},{50},{63},{43},{53},{77},{72},{73},{165},{77},{26},{72},{67},{45},{12},{12},{39},{32},{36},{103},{71},{34},{39},{70},{56},{39},{74},{42},{64},{43},{109},{52},{60},{89},{44},{76},{63},{51},{50},{51},{46},{34},{34},{151},{1}};
    #if (CYTHON_COMPRESS_STRINGS) == 3 && __PYX_LIMITED_VERSION_HEX >= 0x030e0000 /* compression: zstd (63458 bytes) */
const char* const cstring = "(\265/\375\240\037\215\003\000\224@\001\272\3514+B\020k6nE\000\000\000\n^U\004@\021\000\000\240\204\337\376>\035\361d\263@+\264\301\213\0371\373M\203\354\301\212\267%kF\024\263\370X#R\335%\314>\034\243a\231\356\376?\316\035\000\000\"\340T\221\002\243\002\245\002\227\205Y\276K}<\020A\006\031\0216\300\307\305\201o\336\032J\034\000\365\004\022d\020\235\315\265\274a\n\245*J\005\231Iq\272**\223*\354\272\327n*\241&\026g\026I\311%+T\0059\020f\034\327\032\366\"\237-l3\005\370\220\006\206\306h\350\210\014\2044\032\r\255\341\366\346\316B\234\362\336\266\030E\321\331t\325\376\t\330\354\346\222\224\232\226\010\r\356\317\034\266\260j\274\016g\014\236\323\342\301\205I'\304\021\221D2EI\004\347\257~m~-\325\276\271\231n\214\325|eu\336Z\215d\233k\233\006\241\317r\374z\337U\355\353\256[\314c\337\267\313\220\223\2241\t\235\216\366\333\273\206\3747Bw\332emU\227\343\320\240\345\0137V2A\343\324\300\371\267Z\273\365\222o\006\352l7U\343\227\256\273X\255\275\254\016\316\232\375i\336U\315\303ow\234\2247\347KWy\\\326\035\316XW\307\366:\334\266\232\275\031\234\271\n\3375o\275\014\266\321[\2709\200\321\346[\347\256\363\336\001\006`u\275\251\223\341\320\3063\365F\"\355\233\316~y\227\367w\263\345L\221\363\237\256\017\264L\221\205\3032\374Z\323\365K\225\246h\342\232\321c\347\354\006\267\346\332>\256z7|\303v[\215\321\260\341\214\375\257\316\2473\347\034\304\026\276\227\275\214\335\227\352Z\203\337\305\031b:\367~{}\313\323\326\376xV\350\264\330\330^p\r\273\267\200\323\n\204\354:YL\021\204Xp\220)\272p\251\367V\310\002B.\370\355\274\375\256\331\rO\315;zQ\350}\263\376\271\313\360w\014\267\033\014\306{\0328\033\204<\316vW\0131\371\302y\230\3638\233Q\241F\363\036B6\354\345K\265D\022\233\323\224(\212\205\273b\327\332\323<\203\353\316\030\346\210\222\327E\201\266?\374\212\321\330\232c\270d\354\032\014\310e\355\357\301\267\232\r\3375\\\265\337\274#\333\353\270\014Qs\272$\246QLZ\360\273@\354\2375\032&Qb\304\321\276\235\253\272v5_\214\005Z6\266\026\210+\324\031\003\335\273u\003\367\365*\3067X\241?\0056\260""\310hB2\2624h\020\361\033\327\3758kP\263_\237\006\272\336\252\321\215\347W\265\216\316\303\341\033\273\2658E\333\251E'`\336pc\347\274\214\216\2163\365\341\0105\333b\300\014\253w\345`\324\373a\003\320\273\017\263 \2479qE\030\021\023\311\334\232\214\325\327\205{Y\3713R\006Kw\225\234\256\322\013\212\027\005\213\024tOoJ\005\027X\000A\006\226\216 \202\014.\344/6\243\375\036\206\357\337\377z\332\255\264\"RH\021>\266u\373v\352;\031\026\2233\367\260z\371\303\330\233\321<\374\r\273\234m\256a\205\220+\252 \304\3118\330~WW\270\353\365\207Z{\230OW}q\213\003W\307\254\310\241\255\006+\232\230\214X\264Gu@\374\024RIj\270\023\322\206\2141]\223b\230\2741\320\232`\025\321\306D\320\255\233\315\031\274s\330\317\333\243\202TA\252 q\236\005cO\327k9K-\026K\246d\265_1A\245TM \212\004Y\360\003hx\020\300\275^\341\355\354\276\036\007\363\336*\247\325\014\267\374\303\375\325\245\n\364\202\034\360!w,\202Q\014&7\350\327\234\277\325r\031\007\020\300\343!9:\227*\322c\264\312\351\234ih\200p@\010p\253n\253\006\317iy\330G\263\317\333K\245\022\350q\330\257^\005\\\255\256\233k\252\000a\221\3664\rg6\215\366_\306wW\267\n\2617\222\374j:k\355\360mF\326[\306\213R\307M\347\341\231\006\007\307\326u[l\247\014\366V\237$\220\010F\336\2379\350\027\366:\217\014\277\221\310\205I\022\010\243^\336\330V\355=D#e\211\017P\200A\274uK\312\311\030\235\2675\324\207\206\r\327\206}Y\322\343f\260_G\347\036IZ\275\235u]\322\232\217\256\313Z\222\321\354\365\316v\226\304\362\220@\226\303nUK2\036\006\234-\211\263q\315\177\027\327@\0259\241\025\217\234l6]5\232\255ht\305I\335@\213d\321H\2223\342@\026\366\315>\276x\357\332\273\266\376\316`1;ol\007\263\366\014\337\275\325\303|\273\326\363{\261_1\")\315\030\311,\n&)\026\241f\204~\261\217\267\016k\3067\237;\250\331\371\342\200\276-\266\030+\243&5\277\177X.*/\210Cs\216\373\272\374\033\232\027&\247\251B\002\315's\356\005\266\032MW\177\350\\~\254\275\035Y\223\t\035\257n\020t\\\253\335\327\213\335=\274]/k\371\267o[\326l\347\340&\337OO`\214\274]\\`\024`\203\022\010\300\207\2164Zu]\255\326>""\277$\2112#\212\242\212&\242\274\236\254\302\262\342d\202I()e\226\304\250\254d\022I\271\2275\334\357X\203\226\316^PK\2275\277\3327\246Z*$\252\222\001rV$I\247KZ\023\223\244W\264(E\272 \n3\316(\221\304HBT\254Dq\232\252I%E\212\225L\222b&+Q\024\367\023\241'>qW.sp\210\017\034\242\303\203\370\340A\214\003`@\\\347\272\201\020\033q\201\027\032\247Vo\243\323\276\353\010\205X\374\376\367\t\204\320\351Dn\365\013n\007`\317\031p\205\302c:\266\234\367k\337pC;h\324\001t\204\3037o\353\246q\233\315\310h\366\213P\310\262\2624e\004\243\177\355\246Ph\2122\276\316\251\"\001\004`\327t\237\3463\336\337\220\000\240\321\220\220h \000\201\367z\332\255vc\365\3162\317\262\214%\262\004\206\010\310\264&\307v\\\243qy\013\010\261p\034\007B\350\214\370\374\342\301\026#\214\254\177#a1\214\370]\261c\"2\016\270?k*_\007\341\337\024\275\006m\016Z\346\355%\240\001\202\216\255\346\377\341h\001!\357\000Zl\0028\270\000\367~\327\264\227?{\270\353\2461\330,{\275h\010\034\260e\314y\022Y\273T\347%\260\363\021\332\346@s !\361\027\010\331\357q\226v\311x\000w\205\017\007d\343\260\263\032\214\327Yk\337o\277\255\272\2765\343l\333\352\0005\342\321@ \001\213\013\r$\032 \304\341`X\nL\005+\225\210\307\224l\341\256\230\362\316_8\020\355\330f\014{{\006\022m\373\275~\325hoC\347\254\277k\017n{\375u\315\032\347\373?\n}\273\326\336F\231z]_\327&*\200\000o%6\213N.\327\335\306\276\221\033~\310\025\373\013\243\220z \370\230&)N\020W\233\301U\252\"Vu\306r\027B\323\202\034\2359_\256\335\026\033vl3~\2018\356ZRym\272b\\\221\342\252\"\277]\242-\247\235^\357\351\256[G\301p\251$\220\024q\336\030\256\245HU\030\205\316\333\342<\271\266\250\204\253\275d\255R\370wOb\321x*)\032\241\016\227/\211\274\252F\355\305\315\031\303\2763$\204\350l5\320~'\377\330\0348\034\rF@\255\335\276o\357\262\243\204\024F8\\\323*\256\034\377[#\215\254\341\373\035c&\324\3365\304\004\210\006\353!\370a\373\236\305\036\241\224I\311\247\272\"\017\016\020\245\000E\301KR\212\375\277\276\361\373:c\357\303\225{oz\010\261(\313\255\256\341\247\275BM\327y\262Se:@{\030\273e\016n""\361\273\027\316\257\212:\317\256\323\177\275P&Ky[4\260\210\224.\026\030\360\224|\345\262o\260\367er\336\037\306V\253\261\377\377\377\377\256\323\377\377S\r\256\256)\245\364\265\215\354\367\013c\223\247L=\204\207\377|\331\026\243\260\365\315\333\026g\352\364Y\034'\014F\347\355\275:\211,\352\032\226\033{\244\331.\353\235\177B\020\036<S\343\205\256\334\265t\213~\303\362\311\360\255\273m9+yv\253\027\336\356\031u\362\311\275^D\263;\217\254\256\034\347\255\253\346u\326h8\372S>\255b\330(\355\352\255$\\\204J\366[\351\275-g\310|3w\361\250o\354\273\206N\355}\276\324\243\232\367)#?\225\255f\3517\206\246J$\273\204\313:\362\335\311;\247\275\373\252\241\363\377m\306fEW\277\032\347\321Yw\325\233v\376\256\335b\312\377\377\377\377?\326\354\315R\\Z\326Vu}\326H0YsU\274U{\273RYFi\231N\031\267\327\314\266Ug\333\214,\363,s\262\213\234'x\212\246h\"\242DL\2720yQx*\n\212\310\213B+Y\221*\232]Q\212T\025aPFQ\"Q\274\246\203\204\207\010\023\"\235\000!!\002\304\003\004\010\016\017R\002\204\203\204\t\006\320\007\016\021\n\230\020\013\210 A\001\n\213VV]R\001\031\211\314\250\242\2720*#kN\242K\316\353\232`\223\"\233\360D\020O\364\360D\022\034\236\007\0132\233\223\244s\002\341\301\001\233\320\224\021\312\373\342\0029\316\027\372H4=3E\367:\024#\312\244\262\t*^\320\005Y\32041:a\227$J\362\242O\314\"\0305\201\250\244H\342\2140*b\024\233\264\262\"\351\252(\"\224\224H\250\031Q\224\352\311\244\n\242 \2124)&\220\004\242\020\244\335j]\037\354\241$\327sMP\025\036\013\325sI\030\365P\211z\246kz*\351\231*\223\364\314\247\202\"\205\007\222t>\017\017\023\354\252\346Sq\315\347\211<\227\224(\362\221\317\024=\221\350\201\242\350\221\250\004\302 )Y\320\224\342\363X\224,\263\244\244\240\331\004\024\237\347\331\021\2729?]\374p\214\225H\211t\232Rd\262@\211*hB\326da^O\224\"4',J3b\026$k\232tV$I\225]\025\006\305\210\244\224\214*\224\252\246\251\202\2629!\032+\ns\272,J/K\272\254\007\002\342\301\201F\200\200\020A\017R>\016\227\244\250\244\254B\222X\214,J\026Q\322\262\342\303\227\267\207\256\253NU\305*\242\342C\234XR\254\260""\312%'\024\242\004E\212\n\215o\250\2644ItA\355X\315\010\n\nP\000\223`0P\244`.\023\211E\273&\353\000D\245Fi\343g\002\201-\034J\204$GbT\004\214\002\002\005\001\000\000\0024\001\000<\000\220\004\230(L\211\270\232b\366\222L*\2338'>\004\376\315\033\214\t+v\3659\236\332\203]$+u\271V\021\242\247\244\245KI\027\253\203\217\330\263\207)\273\352_\343\214\261sm\206\367;\376i\212\270\346W\212!wC\t\252\331\312\361\235\001\275G\355~\340\010\223\201\200\253A\276[\213\353\205\341\037\307;\020\242 \202\337WA\000%\300\005ip1\305\207\311\203g,N6\203\013\241\317\340{\341\332\250\r\343\2078\220\000\276\002\302\316\3313\261\255\037\324j]\260\236\366\225$%\227n\024\327~(\321dx\242\203@\234\223\2179\372\326x\034\233\237\231\217B\033`W\257RBeY]z\036\312%Z\372\355p:\331\014\221\256\360`h\214\304\030\262b\006\036, \001\245 \253\"\366\242y\244\344\177\nt\265'\324,\223jF\213Vr\347=,c\033\337(.\230\200!DP_\256$\026\275\270WK<\346\200>\257\263He8\254<F\236\024E\276i\226\334\235\025\033\030\352\221\272\335\351\212\342}\241\277\365\367\236\251u\010c\376\305\210\315\021\233'[\244\261\373F\200\355#\311\n\1777\335 \341\342\021G\032x\352\001Z\245\256\r\203\017\342\372\200\306\036\375\227\267o\335\006\252\000\021\225\260\210\312\026Cy\241x\301\324~J\023\275\260\311+\267\232?\035qA\352\356f\307\325\0373\304,\021\375\276\216\272)\346\2360\024\342\233|\362\037F\206\266\246\371+\006\t\274\032\274\273i\033\240\322lJ\321\301\222\331\316\356\037\257\203\216\nd\"\217\200}C\365\223\373W\311 ZXk\250\254k\246[3\254\203\203\2762>Q\033\364.8\274*\235h\213e\0059\257\350?\242<\203A\305\227\252\035\317\320\321MG\247c\247\224w6P\276n\212\327\275cv\370\231I\244\241\311\203\357o\240\010\353w\006$\032\n\002\263R3\343\257\313\310\334kn\020\251Z\313\246X\312\352ri\373\365\235_\364\335\002\324\355o\253\027\3038\243\013\032!\240\254!\301n\261D|\257\251Q\375\026F\214\004d,eM\313~\350\217Lu\013\001f\221\211\3150\230\200.\222\343mf\005r6d\323\rs\006\221\260\314\325\037tf\240\245D\232\342\302\357\252\303\327\023n;bi\216d\351b\033cm""\010\026\212:}a8\035\304\356\321\225r\321\345\301\250\273KH<\224\346\217O\036\221%s\346\336\315\215\251U<\234\272\020\300:\274\217\027\003\017\036\314\034\037L\356\016\322\207\246O5\273\007/\254\257\327\260*\255r\235P\312\324\0018\002\356I\336\362`!\314\375\023U\266\2726+\207\217\t\021\335`S\375\277E*\244\246Z\023\341r\211q\331\320e\206\002\261^&\244\257\240\216\276S\177\026\204\202\310\010\204`8\224#\021\013\215|\275\366#\232\231m\274\"/\342\250\347\242>J\255\371R\301\020\221\360\365\233\306\244\314{\006\r,\336b\225\242\334\323\223\354\251\020\342\321\340Lh\034U\333\235\356k\005|\313N\241\013\230L\035\007\343H\321l\310\372\004\265lKZ\370w\003\005\314\007\211\333\204\234OD\004\022\262\242\333\331\325\006\264\257{\267\031\274\376\241\027dM\246e\357\t\353\301l\t?\2514\tQ\205\307C\203\242i\211\330h\273\221\0048\3624p\216JG\034\0132N\326\313\261YC\331iF\272\001\220j\365g\230\262iC\307\254\020\305!L6_\255\311k\341]\026\262\2554\022\343\220\325\362t\346\"\203\0368\254\340\372\247\364\326\275\364\307\204\353\225\241gzd\244\022\256\375\325\271\227b\211\264\3233\345c\202\342~\331\345\001\265%\273\256\026/\302\363\301\336\233\213q%u`*\013\266\024)\002\031nag\327\222\005\212\3274\331\031\236\n\213:9\037\326\201\313\240mrp\346<@\345\257\256\241\231\266NNa\006\300\230p\013\n\263\351\n\375\275\3646\263b\246\264\021\225E\252\265].\221\362\214\030\363\005\245\200\"\232\031\254\226\013\326#M\2101`8\215\215\323\221;\361`\243Z\325\034\017q\313\017U\034\270e\2575\0227\260\354oV\236*\213,r\244\245\342\237-\300z\261\317A\\\307\367\341\311\306\226O\354\354|\240`\200\214\252\355W\317G\365\202\337y\n\263+\201H\307\232\210\224`  \245\035\267?\343p=\\\362A\233\321\215\025B'\207\327\204a:\025\3107G,\316\316\0267>\030T\267\0248\334&\274\035\240\367\3053\321d\024w\244\347\332\226\273\355,\370j\352W\244\264\276\022\274\353\201{\252\357\241\244|>\256\276\256\200\013\013y\373|\370\242^\325X\350',W\030\325\\\377\247\273ux\2755\363*\356%\343P`\240\311B\317\024@\252\232O_\254v\032*\231\235~\261\305""\257\246/\000\0233\304\3673\2642\021/\347\204\263\003\3120\365U\371dz\347rm\340\365\245,\2242x_\023\222^j\267\222\257?\014\313\022\203D\375\316\203C7+\014\224\365\t\346\037\2105\336\271WU\274\275\341\224\004\013\300Z.\203\342\357\244\310\026\340\272\366B\235\2621\267?\222\222\230\2234\251\364%s\374B\020\250:;\352-[\250\235\275)\207\201\350\320\216\206\026 \001\261\305\021>\250,z\027\265\310\344\221V\334n%$.\256]e\353\307\362\301\\\031\205)y\337\2552|\346~3)\271^q\000Q\353\323T\244$?\232\207\263\223&X\0225\np \323]\003\353\027\205\216\321\251d\t\030*\301\37633.\202xX]\357C\365\266$i\213\227/w+kp\006\275\373\300\210s\334\336\005T\214s\336S\327q\242\300\353\205\031\215\016\247\002\002y\002#\233Sm\274\205\210\334\026\234A\2702b]mv\370'\257\231\330\366Etk\034O\263\032\240\353\033\327\270\256\377k\324\0319\353t4\235x \307Np\345ts\261\334\014\221\260\201\344$\233\026V\223a\020]\211\200\177\322\245\024\026#\353\201\333 )\215P\232\254+_s)9\\3\36035\026\253-\201\177\302\005\024nt0=~\030P\035\033\261\356\360\272 A\354\014\254\2174u,)_\270\000\301\241\006\317\211&\235\030\251\216@\25714)\017\253C\270\324\257\367z\277R)3\222\324BH\007A\263\n\235[\264\3520\250\037!\336\246\214\n\177C\343\325\341\334\327\361^\270\326\210\"\206\025+P\241r\rdA8\007\332t\000\207\262\333c\206\024Z\017\210\226\377\025\272\305Zj\323\214\374\035I\025s\234;\200Xj\341T\364T\357\232\226y\324\353\255[%\372'#\252d\324s\321\323E\352\0175T_\302\232\207\257\367\023\274\021\377)\307\312\201I\327\331[\377\004\244\302\270\357\006,\341&\246\263\247\335v\374\204\307@\331\357\227\251\010\360\375\301\251\255a(\345\370sX\301n\212T\320/B\262\033\313\255\270\n\022\321b\177=\226\263x\217\256i\241\020\271\261\355\n\346@\372wYM\233\366\037\364\316d\212#\214\204u\317S/l\223\352\356R#\212{\024\211\346\236\033\375|\303\236\013\370\216\034\235\337\313\367\361\347y\361 5HN\030``L\032\236}\2237\262e\2049*\354\374\312\3428f\n\343Q5\372\353\371\005 hPQUE\363\321B9<;\356\310\353\230\212UP\340\241\"\301n\331-P\246\247\241\016)\357""\315\234(\036\302\221{\251\2706\034\336\023\200\201{\262m\352\302r\233K\025[\302\272\213\346\267\212$Qc\333\204R\2252\222:q\266K\216\215\372\0201\035\n[\213m\237\375_6\006\370\234`_\277\332\014\311\3079\014ZX\267G\355\317)\302lc|?x\371*{\327\357\026\210\267\351_\300\177M\335\013\252v\241\266\263\212\311\220\265D\272\250\372 \264#\311:\\\276@\301E\326\333*\361]U/\017\313q\253:\006\334\035>V\306\022\257 \t\335-\360\036\311#\360\274\030[O\232H\226\205\205i\220i,E\014\005a\372\361\366\213\201\301W\363\254\350\0254\376^%\304\027ma\350\316A\202\270\246b\370\234\260\240d\3750\n(\024\215\247K\022\232=\230\247 \200 \334\344S\n\317qv\r+\266\2700\210\217\226\"\004\327\275t\264\221F\023\303\017\240\244|\200+Z\2207;x\305\204\004\007\231\254\303\326v\300\221A\201JJM\210RdX4\230\236\"\242bHt\324]M\010\215>\304\004\226\\d\214\267P\353V\352'Y\226\315\275\221\250B@\3649Wp\226\327\205\371\34699\346\310W\234\226\230B\334\352\362\376j\270\351\247(\374DSs\220\2115\245\023\237\tF|3\324*?\313\306Zl\224\tJ\225 \303\025\321\021\233\200R\262\305\025\231\345\t\265K\010\005\206\323J=\234\317d\355\021\rY\357\032=\220\207\032\225\331\227l\020I'\330ail\357\242\265\250\254\264\323\023\227\024\206s9h;\002\020q\241sz\023\303\313U4\230M\0306\030\003'\220\370\r\202\025Q\310\201?\244\233\224\355\002\324d\235\324?p\207\177Wt.f\032G\331\264\224\356\330\346H($Lc]?j)\352\372\\}TN\346f\350_\322\013\332A|\343\344\355_6\324\245\367J[n\346I\036\177r\222mN\\\236re\036\324\331[c\214?\n.\347K\351?\232`\342\324xR\033\251O\tZ\353\233~\262c\3726a~~\373t\234\211/\340\022\rMnzB\235\346i|\0227_\307\007\371\355\235\357TH\270\340\236\016\352\352r\343\276O\2515\241<\322\312\372\300\237\"g\207d\003Px \240\017@\"xmQw\365\225\214\027\322bY\305\2731\207\341\364M\333u>\370\3734\362Y\234\211\273#\243\267\003o\030\342\213\275\231*\212\256\000\244+{99>b`ie\331Y\273i\367F.\212\361t\004\324\265(\rk\0359\013\217\263\342\005B\2261\304\354\254\250\025\321i:*\357\262\215%\323I\025)2\330\000\214\341\242z\037\024\331*\350\344\034\342\242""\213;w\277\357\330\270:\373\324dI\354>Ic\203|\021\274<\025\250^\213]M\311\362\225&'\276\257\013r\210i}\031c({\341\263\254\362\213k\304\213K\322\241\354\023\274\311aS\355\\\202\210\2505J\326>\351HG\314\030\371\030\311\365\3615|\276\261\177\371\350T\325\314.)b\267E\277\214\342\253\266XV&ikr\014`\305,6\016\253[\202\001L\205r30\321\216uk\352\351\014\200\370\000\006\270!\217\301\340\215\303\305x\014UC\246'\004\244\027\377\234'_9?\372\257\010\342\010\r\005\366\253\314g7\241\023x\306\252\r\021p/\033\236[\300\002\202KQ\362x_\207\014\232\227\360\215\177\322\t\255p\315\320Yp\034d\264\215\000\374q\326\206}aYC\006\345\"\213yD-\341e\310\237\230\013\007Zr\227E\030\326\337Sd]1\000\373\027yz\271\027\371\247\301\336\365\217\234\026?v\254\322\263.\371\001S\022)0G\033d\337TAY+\2419\217\020\241W\255\244\302,R\374\031`\277\033\311\315\021\217fQ\273\017L\234\3477\232'\000\235B\035\310\264\332\372-\004!\356\343\254\261y\212\266\241\317u(\261\372zD\t\337\2779'\357\013H\266D\"5J\37733\310\ro\264r;\361\213)Z\207\364}u\265r\230 \\\257\260\246CO\2003z,j\343\270\241\030\263D\010/{\336\263\036x\371\351\010^\210#E\215\235o4\000$\361m\235\254\323\031\256\335)\323\252\227Zs\260]\364U}\351\260\023z\265\321\214\224*\372\244\335\241\2521\270\215\323\013\366\307|\341eB\213]\233\022\244\311\t\261\023\300\010uH\336py\231&\320~\231\032\351]\222\211\215\036\347\335\2023KD\036e\214\221\322\247\321\274\024\177\322\372\3028\253\331N\031Q\311c\2332*\245N\017Fsix!\317.P\345wm\253#\177\217\364\010\337\2725T;\250\341\000X\016\267\201\235A\332\245\311g\255\201j2\275\313\230\276R\341\255\342\034\224\314\267\201D\313\376\304\306\032\352\270Q+\222\206\000\321\020\251'S\341W,\310\340\250\001Vs\242\017_\021d\263e\201\222\231\033h+T\343\310\240\244f\000\264)\272\010-\363\317p*\312\036]K\264\252\210\031\327\242m\337\013^\202|\255\\t8z\\3\0270\231\373\244\007`%[\224 \021I4O\234\270\377\302\306\020@g\263\354\240z\327\010\234\323\026\316$\010\231\336I\245P\262\243\244\030\206\306\031-\207Wwwx\320\341qz}\273\215e>\352I\255'""\032\010\275\024&%%*\351\214\327\374\300\360Yn\366\224\263\215{;\016T\001o\r\310\025\004B\243$\305+X\371?q\013\t\377_\250\214vJ\357\357\217a\375b\240y\211c\377}0\004\3710\313\036\247\317?\010\rx\224\332D\365kTH\017\025\r\",2k\237W\316\026b\275\304\204\362{4!\270h\244 t\241\215f\251\204\3630}\350\354~C!\035\225\221\242\3655+\0076zndR\334\334\266\251\320qU\206*\001\317\004\250\315\200-Q\251\335\255g2\350e\277\243\313\202\342\205\221@\007\375\177y\004\360C$\333$\302c\035\301v\242wnQ\376\245\337\016L\227F\022\374\32561\256\207\351t-\252, \036\245)\305\000\2040\010\242\245>\330\"\352\273H\024\311\306\2712\036\330\003\273\362\227\323q\253\3102\374,\342r\250'\2362\342M!\354\355\0178\361Z.3\351\001\021\205\363\355\311\010\257\037\237kS\004q\322\355e\312\223k\033\232`\2441\0275\377my0\036\030\352\274]X\356\323\"\365Z:\276w\350\367D$\207d\373|\224u\246.]F\226me\271Fj/\275f\364\014\374R\214\2511\220K\303\030G\255\242\236\311v%R\210\231\235\243\210\026\221\3241\357F\212\233\236\252\246\214\236)7\030\311LS/\340s\272\210k\024\010\317\320\3727\017\333\237g\016g\260>}r\226(}\200\310\324\225r\221\005w\344\214\214\030\327\261\360\215\215\033+2\305\246\000G\300\314\373W4\331K\320\022 P\250[\274Ak}\300\320I5\215\256\273\247\240\213\033\256\344g\200\315c\246n\243\334\342\324\206\314\000\306\031s\005\013\365~\034Ea+?\024\n\216|\300 \215\310\034\305]\232\225\3433\202sS\027\275\206~\312~\366`\302&\204\336c\222\344\207\200\331A-\242]0\210\272{i>\210\037HX\2227\204\314\334^rh\374\344^\306\036\245o\036\316NQR\005j\333\2026\350^\303/\313\333b\031\266\223\035\235\224\265Q\350\307(3\314x\025Zi\035%\341\035,{GW\336\330]O\354\0100\330\202C\222\031B\244w\372\315\025w\336\007\266\377J\351\211\007\210`\2423\004\240\245\361\231\347\027\270{\217S\364Og\240\250\217\217*\004\024x\365\316\233\316=\021b\323\027\2158g\202\017\215d\317Hk\200:Z\336C4\323\376\333Lm\242\030N0zE\177$\261\023\337\017\236X\302\315\347\2268K\242\212\010\005U\311 d\362\342\237\272j\236\006\0322\3462\242?)\323\260.\301\206w\245\241h-""\356&\304\305,R<\212\361\317\217@\336H\264!_\\\324\236\305\002\335\002@\260r6V\311\233~\235\307Lz\023f%\214\234\2246N\375\271&\336\203\321\335&m\273\320\222XT\206\223X\341\373pb\303\204.\334\215\240\310\245(+x=\252/+\242\326:\334\212\3278~\342R\220A\230?U\327-\220\335\014\326I\320:\3554\230\204I}7\257\222R3\371\004\324\000\004\206;\335\351\254{\306{\222\230\033\323\202c\205a\373\201\250P\0036,.?\207L\262\377\344\344\212\257\222\354p\326\340\010n\327v\226r\262\334\356\020\324ixJn7\307Z\327\246\025\353v?\013\237\342\014\250\265\t\t\340TE\3145\006\3422~\372\222\023\025\325\223\267\332\033r\214r*lp+\326:\307>e@\246\247\315`X\026\246\022\374\337\257\375\225\000\310ax\323\347\311Q\273Z(@\025JB\246\233r\340\244m\027\002\036QdL\331J<4\200\237\224\243<\005\235\302\253\244\332\356?\3062\0354i\251\002#\022E\326\177x!1~p\035O_F\017\211\364\253X\266g\271\357\n\330\255\007\330\202\326E\342|\300w\305*\017\326\3117\360:\027\263\350\311K&u\306\004\302\370\346\001\365\306\227\331R\355\t$\236\2533\030\377@\007\370\027\r\327Jj\354g\231_\207pa3\264\216\242PAKw$\332\322/#\031\253^\205\240Z\375\377{Q\311&\302\325\245\013\205\036}R\300\013\234[sgd(`\222\3523\3653K\\\255\350\262\265\311\267`4/\247\374\366\203`p\212N\206\306\251owB\243/\261\020\036B\t\356V\264\314\226\0278\266[\003rH\202\225\311\005\267\315Q4\350G\351\315\225\330d\342\034hP\276\365:\321$9\231\205;]\322\212^\341\334\341Mb_\222T\333\316\363\231H\235\201d\\\016\212\006\035)ImF\373\273\004E\271\241\351\234\2128L\007k\252\224\351\265\361\203~G\274\235\375\220\314\325\211\225\255\203x\206\252I9\006\323\022p\376\306\334O&T\201L\262\004\350\001H\235\245\254/\333\306V\316n\026\246\177\315\004\014\217\020\262\255\217\nh\256\022\373\327\r[\340\314I\007{\237\346y\270r?\234\315\214u?\220\214n\203\345\224V\274\353\247\000\364 \370$\257Y\002\036\222\\\024O\214b{\031\003\016\275N\302l\036P\354)\241\320\361N\032\251\303\036\263\030\013\367\260\003\014\357f<\356|\242\214\375y\216\225\356'\300\204\004 P\220\236\254J\235\266\204\024\005\224""\305\201\200\223Wd\3166\300{q\357\204t+\221\t>\221&\345:<\365H\002r\001\256\245Sr\272\306\224\377R\343q\244ON^\237\301q\241[\330\301\212\315\177f\002\252i\344\035\037@\020\207\2404\345T5jhZj\t\003L:|\227U\016\306\252:\275\362\256H\352;.Z+1\316P\275\001%\345\002\254\206\337\365\031\265\177\305\325\260[\t\232\236\257\252\304=\030\n>~\034,\254\312\001\217\036\3111@\322\353u\276\202\230\023\220\314Ay\301\265\032=\365\371\266\333\021\200\317\006\317\202r.\273q\033\335\013\002\252P\252\344\214\221`\202\210hZ\242~\364\206EI\007\373\242A\t\216\031\321*\257z\275\312\034%$\020\243\350B\333\253l\306\234T}~\215\363\242om\255\266\ns$dC4\223\357\002\005\225`\030*8\343#E\301\022\252\217\271\177\363\234\267&a\263\022*\253^\360\314\313\002\255\\9L\2564(\201\013\364G\t\242.\272\241hR!w\033\271\276\232\240\t\0203\227\227[>\245N\242M\326\211\306\2504J\005\377L_\314``\333A.\031\343~( \201/\237\241X\265\177\201|\255\212\325\264\022\375\335\340\2700\203\024\354\243\362u\"\365\n\222\207\303c\\\301\307\365\252\325\206jC\313\300[\353\357\2459\346Z\004\363S\370\262\235)\030\022\266\001\312\201''4i\265*\277\254\304W\023\202?<\320\361\3217m\244\300\377\260\023\327r=\340\031\"[\0370B\230wx\257\202\"\010\275\311h\246\236>\376\201m\200\371\326\214j\256\214W\225\365}\2439\341\013\031\n\316j\035\254\033Q\346\"\022c\273\320\206\033J\016.\353\343\300\005\031U\337\377$\256\272\3262p\357g.K\362:\020Kc\327x;*\215\330\035\353~\362\242\r[<\235\032/\014\0226E~\232\247\242\201 X\200\345\t1E\226O\262\275\355Q\332UK]W\333Q\364\253\017n\324\005\023c\006\022\316\206\211\214T\000\372O\346C`\036\r\225J\007\323\273q\361\273\215\207c\255o/?r\021S\267PXf/\233\270\346\344K\312\300\317A\217?\023gq\306g\251\265\207C\325\036\025\023D<\022\375z.\331\256\247\002\217\324}b3\315\323_\332S\0260\372\254\305\323\256i\354\235b\004\021ZV^Xs\010\315\235\346@\370\325\023\356\363>f\252\325\275<\223\377'\304\236\357\343=S\351\\%G%\311\305\277\273-\017\262\002._\027\241\201&\336T/\256.\330\372\221\230I\350\034\216\267n\001\362\276""\311uH\222\t\271\221\210(\351\271\006Q\313\271\025\241fU \361\265\251w\341\217\"\035\337\024~\211\032\205*\005\214\346\250\247\331\034\255\340:\32799\273AP\322\3170\rDj\261h\2744\016\366F|\311\303\247\201<\n\004+\374,\355\340\3145\362!\020\353$\242Fnt\335;~\323['6\244\273yi\360#\301\322\274\003P\"'\372\2740\013%\303B\313\310\302i\367\t\3524N\242\244\262\243\373\275\367\260\372yq{{\025\342\376h'\331\366]\201\337=\300\216l\235\234\361$u\371\200\371s\230\371\207,\364\020\336\315\033\004\371\233\276\277\234\366F\023-H7\024\370\024\261\rWZ\224\002\237\234\252\347\207\365\206\306w>\305W\252}\241\2537\334\234B\023\254l$\301,4=w6\013:\265V\35662\367\207\037,\254\035\334\200\353\276\366\372\251%A8B\326\230\216\001k\245\035\272\302\317$\016\376\345P0\340y\244c\230\234C\333\320\t\\\210\n\255\222:n]\260\3057\264\254\016K\347\231\312\264HJ\252\243\020\2776\010\024(<\036\326\356\331\\[\200fV\372\244\343\3115z\226\347\207a\234G\276\327(\361\354\374\334I\254\311\315\244\275(\037\277\234\nR\364?CX\226\216\252\331\210\227\221\207p,3l\026G\260\"\347\211\022<\351%\341\024\n\255\315\201\274\315\027Q\230\274\226e\r+\371:0K\275\245\312\346m\202FFc\375\271\265\\[\342\234N\262\311\262\250\260(\177\320z\271\020\274L7\262\241d\251(\3418\024\370\344\236\302\316q{(\356\250|\245hu\220H\337\025\"\036\320X\221b$\022\237;0b\220$\274~\333\213\243\003''\035\324\357D\017\246[%j;\264W\273\345\252\204@~\006\3279Id\000J^\274C{xTt\350\316\317A\212?\035%\307\n\313<\332~\261>\346\346\371\373\327\355Y\202\310\0160\350[\t*\317\027)\377j9]\312a\215(b\303WZ\226\360\321\232 Q\372\276\320`\273C:1\010\r\352\253\302K>@\025\021\202\026\213\007(\232\242\n\340\250\301\305'S\242\177,)aF\341u\010\314l\035\310'\364\0304\r\215\306\233La\235\217m\014k\311\033\270\214\222\261k\373>\025/\013G+C\322\203\234Z\253\354\203S5AJ\225/\215\227?r\333\204\023\035jEmG\376 \177\205\340\261|\341\341V\300\210\242\302*%\356\332\307\261=\007C`\260{\207\267Lw1\201\260'\265\263M\255\217a\305\027\223\330\212-;B\313\344\376BIo\254\311\271u\3658""p+\313\224pG\273@F|`}\245+\360\201+\202\271Yi\236\200\310\364g$\370bjQ\220\324\205\302\3428i\275\240\251\311N\250\235\343\313+\226@4\316\320\262s\245l\027u\246\3136\222\013\304\373Uh'\254\242\252\206k\010Z8\200T.\254\247E\306\323\303\324O\273K$\264\036\274\357\367\000\031\346\265\230\013\034f|u`\204T\037\223%|\247\315\353\207\363\026G\270\333\223\010\324\027\321\230\304\020\341\302\036\356oI\306\303\251\010\264;]d\255Pf\343\206_\240\220$R\331\373\003I\221\023z~P\022\224\231c\257\014\2334iO\032O\200\350;\345\001\253\346{ot_B\334\004\265i\215\344\355\230\207\227}\271MJ\0079$\220\3631\225\230\035}\351Ba\014Y^\245\n\255\265D\244\363\245\302&rP\310\2756\333\311+\213I\263\234\315\343U\341\021\310\207p\233z\224\312\t\236.>\032\252T3-\230\333\330\033\032?Sd\235};\233\327\254D*}\256'\017\212\347\266<-\034\006J\333w\\l\"\246\000\310\010z\007\367\236\241\270g\370\231h\251\203\343\314F+\314\262r\355\016\003o\211\217\310n\300G{\367\323\254\370\2077\377\311\035\025\353\221w%9\273?n\010\321S~\311\377\241\227\332\366\217\"\315;\\\005-,\266k\n\233\3340\203\230_A\212\233,o@A\026-\226\315`\236\177\031pC,\372\305T\340<\324\200\315\275\024\217\310\231I?\211\365`di;;\270\275\364\030\270\017\352.\226L\361\316\007\255c\351\234N20\336\321\346\243\270\013y&\207G\305\310\326\252\\m\3379\270\364\353s\372\272d Tu\005\010z\216u\031\257\024\206\212\334[5KE@GR\334CxND\326\326\315\253!\262\304\367N\270{\320Y\014I\346\273D2\333\341,\027\355H\tC\010\364#vz\2255\200\232+\310\225\274T\223\2414\217\207\337\340\316\367\330\320\325\301gC\002\372\303=\341\241\341\263\201\013>\323\n\235\211\257\344\0058:\233\333J\211C\366\265\243\255B`@\004\370k\300\247\363T0\306{\247!\357\334\021\255\262\351\315M\313U\203\034\335_:'\371\r\237\201\242\215\347i!h\225S\230&\307&\360\0279\311\262q\025^\212A\240\3711\003W0\356\026\337O\007\214\366\t\271\333\221\377\020@Q0\374\\\300\225{X\341G# -\304z\201\013\302\201!7\364\007M\031\266\301qyleQ\351\360-\240\202mP\327\320\310\331Ha\025\016\217\223\230\303\014\027\346\033\212\347""\222\325:\266\013\177\360\320\225\336\\:}\346\310\273G\2667w\212\025\345\003\324?\201u\251j\254@\000|\"\355\210\023\234@\265'\344\205\325\332\223\246\264k\302G\005\325\214j\344k\312\326[\213J\376\354\323\341\322\022\277a\360\342\021\261\366\315\347\234Fo\326\035\016U\307\350\226\354\242\001cLc\341\031\237s?5\207a\300\013~\303\023\216\032\343\003\256\253\014\222\221\321\363\243\252\n\227\021\322\016.\255\254\367@z\216\033\351u\303n\366\211\346\330 !!f\242n\361\2764(\222\257@1\233})\250+\340+pU0\217\361\2067&\260\323s\022\250\375\214(\264H\320\223\331G\356\033\210\241\313VI\033\263\023J}\26056\n2\000#\210\363\037\225A]r\304,\310\320s\004\026@\244\304J\314\326\033\371<\363\253#\022\035\272\264\322\030e\024\275\220\007\335pR\3350RF\007\021\277\321\312\346\217\217\266)\356\371\355\255\000e\265\372\267\344\336\355\324'BT_\375\353\332\335<Db\267\232[\316\205,\3212\213\201\245\032\310\007\3318\244j\"\345\031z\334\342\3517\251\201p\016\221\223U\337'\220\276\232%\007\000\001\2329\203\316\000G\310\206\2700?2\337\030J\222<\272\223c\230'\227\033\240\263\261\177f\244\243\024\356[|\302K\366\322\346\034G\233\310D\363\010U\277\016A\004\370\362Z\264\205a\337F;\276C\201\2406\013\242\300\343\004kS4\263*\331\204\264\373J\355\004\224\307\240\242\312\200Y\330\177\210\360P\327\006\341\264~\256\345\017-\227%\327\037\022\275\351 +\332G\277\250\370\241M\2166Z\346\330d\371J\323\235 \300\206\377A$\371o\255\212\256(\332w\204Ri'\240*{\332\001\353;\035\031\001=\034\261\323u\362\251\373C\342\227*\231\335<]?\325\220\322\376\264\007\001\352~\360\025'\000i\246\352Ug\030\251\277\001V\346\006\007\031\324\334\206($\3132\260\364mG`\227\201\273z\013\364\377\377\377\377!\004P\001Z\001U\001\215\000\227\272\226B^\250\250Y\0312\374/u\307\324\r\235\010\313B9\n\243Jl\032.dB\2508\007\023\263Z\247L\2474\005!\037\243(\367&\266\347\2428\210\304%\274vhc%R\223\232\330)\235\3438V\347\322\r\224S\341\032\256\204M\376G\230\202\222#.q\211\302\222\332+q\rW\"\227\254q\325E\233t\254\227cY+\352\214.\332f\332\211x\324a\257\272""\330\310\304>\r\316\201(\006\310\300\300\013\030T\247\246K9\216;\376\204\243\310\271\326T\373^3\270`\363\252u\352\254\325\301%]t\320Y\327\317\271\311\361\377\207n\243\201)\207\204\251\214\243'z\034\014\017\325\240G9\0240\203\312I\205\037\006)S\217\337\010\302\325S=M\321\02416]=\307\321Se\333-u7\235\324)rU\004\216\002k3\023\2536\307&\363\377\377\317\377\377\377\237\212\240'Go&(\343\3121\373A\257[\003\337\005\027J\307\021np4Tl\232\222\376\237\2708\356\007u\361\"\345n\024\222.\024\223\330\020|AeL\010?\245\242\362\177\217\031\376j5\250LM\r~\343\221\017\244>\246\034\233d\217^\367\377\177\216\372\201\177\324\245\214\314\262\215-\210\206\230\300\301\372W\366\223\356\245\333\036\334\030\262P\341\304\344\310\331B\022N0=\036S\003$\271\307\245\260\202\3053E\216\263\000C\216c\0209d\214\256D]&VOl\032\225ga\023;2\265\031\2042\260\262w\240\255Gc\263\330\031\341\354\327\230\363bd-c\253\312Sb\264x0%*\261%I\254N\341b\223\375\354b\r\021\320\205\365\212\224\256\030\027w\001<n\350\224#\203\205;\246<!\030Q\264~\241\307@!C8\273\201\r\264u\331\206\365\320\220U\250\240\320I\\u\332\232\212\203\332\007\204&\255\265V\022\211dF\322\375\376 d\260\261\367\032\322\264\253\335\215BY\360\000\302\305qr\177i\376\377\377\377\257\377Y#a\027\030\225\262\214\242,1Y2\036^\024\206h\252jp\375k{2\314d\032\3100\215qm1\275\230\003o1\tu\305\004\266\230\003\007\000\0348\360P\357i<\311\221\253\206\343\177\266\225\344\310\354\311QE\345\206\336qfH\317\324p\0234\356B\272\270\337cjG\211\242\247\337\353\027\351\233\264\316\307\220n\224\327\3625\220\315J\235$\231-\225\367\026\267F9W\313\222\320\256R\305\264K\307\245\271eq=i[\373b\302C\260\001I[\226\356\322Y\307\3127a\245PI\020h]\250\022\023\332h\243S\177\272U#R\312\021\376\344\330\273w\334\372\352G\260\360\177^\001r\325E\2163}\026\246\216~\241,\273\343\372\263(K\371\233f\373\210\244yIz\032\216+\253G\013\270U\306dT\356C_Ocj\030r\353z\333\277\270_lHl\366\210\030e\2641\312(\243\213\"x\266\255\302.\325!V;\002T\000=\240t\3124g$\212\240\251\337OQ\022N\360\330j\201\033\364""\250\252:\343\326\305\205\356t/\3448\362\000\02331\345\243\263N\310\244\243\263a|\256\315\337\352\177\026\036PF \374\252\234 a\003\255\224L*zJ\307\272\266\262AX\316\201\343l2\247\224\361\340\240lEvu\3256d\352LX'\353D\034\303\301\324i\262I\031\021$\302\201<\220\322\000\232\034\024\266\\!\254\036\272\014\251\241\362\023\244\254='\373\377\377\377\357\202KU\224\312\227\242\262\004A\253\221)\005\014\320:\276\244\3604\360\302\342\326fo8\272\222\240\377\324s%\256\n\213\027U\022\373\324pD\000\0072\203\272\0224\335(Z\375V\203\261\261\367k8C\256\231\272\tQN\320x\364m\340C\301o\224\027\030\302QQ8\217\306\323\244R\027\321\324\270\266\336q\3300J\246{\243\0373\005\334S\236\240\3448jp\010\203?\372\377\377_\222\2322\242\373\377?\2031\025\236\216\242\225\253O\355\034\205\003\231\242\273!\332i`G\306\022\030\355\347`;H\023\235\002:\207\350\306l\327F\273\311V\225\004q`|\335\r\223C\265p=\346h7j\335\377;\376\377\377\025,\356\002\373\377\005\225\377\277q\037\351=D\022[Rm\302\2352\252$\256W\362\263\007{Y\372\013\323\272\214*\347\2324\343\271\020\272\220\203$W\375Y$0H\222N\272\262\203k\252(\213\271\256\315B;\261zu\202\213\253;A\275\302\311\\\323]\340\005f0nf\025f\374\027\272\267\227\265\r\3438E6\025\333:\235D\317J\240\"\022\332\006\014`\252\000\2466\022\200\251\310B`\252K\016\230\312T\247\264W-s=-\322\362!\253!\244\325A\327\016\234\263\r\322\2579V\253\272j\000\204\2038\253# \240\311U\0074\253\255Z\377\247z\252]\360\325V\017\362\320\342Aa\207\203\003\200C\303\225N\303\203:\016]\025BA\333\213\253*\232\213\361UKgk\\\323n uh\245\315\244p\2758i\235\035\215p\250T\330\226M\312h&\000\202 \000\363P\030T\0149\030\214\307\0039\323\274\017tC&\312c\251\022\371)\"\014\2260E\2219\003\002\260\004LQ\304\212\223\003\223\340LR\306\205\317\036\214wB19\215q3 2\372\322\033\\A\221E\023\250\037u>|\004;\255\302u\033\357c\243\306\320\260w\353\373\2719y\376G9\227\223\241\215\320e\037C\216\"\022\006\"\031\0013[\265\360\252\247-\000\266\030\315\\U\326PV\033U\t\330\334\021\267\364\026\370MY\2323\223\003\020\366\240\032""\325\213\321\247\223\0357O\272\\R\261\005\375\340\246\024\014\244\036\331h\246\307C\331j\035\252P\275\302\343\014\251\367\201\022\004\002\304\242\326\221\334H\034\244=\226\205!\316\221P\340\0300ct\203\251\0102\341\035)\202\202\257\321\273\266o\212s\313\261\323\357\014_q\347y\367\216\204\265x\313[\202N&\275\360\033\233zK\335\3139`\252HFf\004g+\027J'\367(\376KNVP\360\177-\030\310N's\202pZ\226T\300D\210e\313\364\213|@\235\214}\273\021g\271\217\264\330\206`d\036\301\351\370\233J\253@}$-\351\273J\221\266\207.i\272+\206\356R\271\234\346\314\264FG\255\037\024\351 \007\\\326-\322\303\260\374\241\336m\344\\\306z\344Qj\355h\2353\305\365\357\222\035#\301\331\r\366f,\271)\313jC\261=\272\223fg\355\032\034\303\370-C\223;\013|Z\250\264Hzi\324\013\353\347I\021a\270J\335\251\023\260{b7D\363\024\212\306R\230,z\240\004\010\231\275\222.\226\315\021\306D\212<d~\017\335(!J\254F|q\177\227\327\240\207U\356\033\257\275S\036\253\320\266qo\344\243DI\206G\246\334u\361\317\362\273j\201)n\336\256\242'\312\233zA\225\352\271g*/\332\014\216J\313\251\363\233]Z\262p\202\022Cn\323-\\\233\205q/\316\3116+s\301\232\013\267\254\003\373\316\307\252\313\361\266\245|\254\207\017\037\332\300m\t\324_\3345\230\177\224\232\265\341\022\\\241qd$?\304\220y\261\rg(\307\244\371t28\031\366\256\365k\344\007e\373\232\337\234h\310\004<\262\\'%\240<\325'\251f\300\276\304\311\237L\360\350\301\372\220\22492\363\223x\232\203\032(3\201\247\251j\355\227yl\326\313\265\235\2225\355\033\277\301gy$\377I,\255T\306u|\322s\212\343\223s\347\304\000\244\320\007K\262\311\036\0240\300\266\247\354\346\017\240;+\262\036\207t}\255\277\212\217\306\177\201\360\342\200|\024\231^-\324f\255h4\2751'@N*\301'\202\344\037\325<\367\301\013\273\267\025\006\256\270\243e6\226\3633\354\231\322~\240'c\273;\312\256\373kng\3544\346o\330\225\026\006)\005\r\346;6\214f&\2124\347\235\\\000c\242\n\331\213_%_\361\023\254=\216\222)\3750\352D*\024\207\256\007\265\004\251o\002\tk\227\354^\244\346\342\215\262+\025\326\325'\351\022<\331igv\t^\315}F\002.7\252\304\0301K""\372p\371\210\226\344\241(\272\222\362tv\340\003\327\217L\320vl\336\001\301\307\026\023\243\020~\361H\037\314\3410}K7\376V\014f\340;p\000\275\277\245\316\010c\235\312\n\252\006\235\"Z\006\272\357AZ,\255+\262\301Z!\320{\347\177M<\313\2140\t \245p\212\302]\254P\350d`\344\337\315\305\377`\350\213\233\210\337E\304\255s3\277\322\353\375\363h)\016=#\270\236@\2055S\215\263NY\374bN\305m\0260\357Z\300\313z\363\031\254\305o\200\356rT2\356\215#\334_mt\350\337''L \0164\351\355\005\026\013\241S\234\251\034\374\345\036\242N\332.\351\307\252\206\021\027\230a\236\342\221\250\314d\201\023F\355\220\302\355\225\035l\306\263\211\"\000_\311$\311fbY\317%\017\357\225\316\373k\247\332tdN\372\204Qh[\367\231CI\331\347#\030\rZB\320{Q\n\007\\U\021\246'\311\264[\322\207\375U\204\032g\346(\036v\220\"\t\310[\371\245$\034#L\341\355\225=\312l\302N\267y\031yd1gH7\242'\331\017\204q\232\037\340t\003\204\231B\301\301p89\316\033\213>\333\3423&\200\314\nu\263\035\235\2363\346\377)\373|\375\330.~\237\216\333\202f&\243\343Dj\027\276M\017\266\317\312R\263<\004\320{\266}\\\t]I3\363\027\t\010%\232F\026\321\210\366\26692xS\230V=\340\377s\344t\035<\355+\215_P^\035\205\213\316iAGb\037\264\351f\307\311[\333\336\370\241\204E`\232\\Y\320\334W+\270\217\024\243\014wlV\214\000\236S\034z\023\357D1G\367\212\236\361I\303ei\276\363'\266f\020\211\217nY\025z\362A\t\251\255\3723\246\221\335\033\277\233:\311\335\376\331\n\025t\2736\351\030\205\031\001\222p\36619(\306@\"}\277\261\376\305`\235\337\337\333\313s\254\235D\216!+\021~z\034\243.?\214J3\035\243=i\214,\023\002\0221\005O!\010\270\206k\316\033\366\261\030\331\227\262\303B/#\311\210\3500\226\326\326\227\300b_\300\"\000\200\304\275N,JD\266&e\2124\325R\314\333\355\233JN\\W\211\214\212\224\217\330\262\327\000\343\363<\203E/l\"\021\231\253\206\325\013\2275\315\3124\373\024)6\223@\267;F\221\261'\036\273\260\000\2143\302@\345\r\025\265;\214Q\256f\201\035\034oq\3306\250\211\230E\315\310Y\002\337wz(l\330\276\225j\217*\327\240*c\272\327> %J\365[g\217\3177[=p\343\221(\242g\177\342""\230,\016\000\017\023b\256\330E\235\323\3737z+\345S\274\013\250U\031\200\261$\242\233\032G\365r9\017}.q\311\273\355\203\3570\243\021SlT\024=\336\202\241\307\326\231\276\317xK\314\003X\331d\213\274M\232\302\032\033m\235\335\307\202\2674\201\253\236\2173c|Eh\216\031O\215\014\315\241Q\022w<9<*q\222;w\345\373\320\321\303G\212\024A!T\356\370\333\032A\310\366\352\300\351\300\233&\006r;\222\342%\356`\322\2763a\355\300\225\305\272\265\024\332*\353\257V(\021\\\207\252\236a\033\\,\025x6?\235[\233\232\021\025\034jT\315MS\226\237Y\253\364\222\311'\026\232\336\340Z\253\002\246\217\240\3231\257\206\271}\205\021\373\034\360\331M\333\217\313\376<[\253z\214|%j{\023\025X\024^\260\022P$\016\2140`\332\031\243\026\016R\374\234\302\207\330\003\002\226\032\274\232\261\232a\213c\304\325%\351Ml\236\006\205\241\206\361\207\277\301\001]\265\250\325\310\007t\2520\216\374\037\3613\261\257\"\014\360\024\004pk\254\027\333\254\007\036\351\362\326{\265\003\372\271?\314w+\313\260\346\270e\217\246/y;\365\nEdk@\364k\214i\316Y\314\000@\330\320\203\246\037F\272\3326XiW8h\324\371+\234\271\027\243\361\023\262\207&\205\303[\250H^\374M\000\321\373\322DDV\341\267oJ\010w\233\016\000O\310\305\302>}3$\252\363}9O7\3736\224\343\355\240E\231q\231\3269V\342[\216\333-\220V\021\006k-\2044\n\037\240(v\352\001K2R\304\372\200\256\237.\004\252\261\267\225u\210\210\331h\177\264\270\202\306\0332K\0032O\324\204G\204#\320\311+\007\244\336\366c\201\265\351\3354Z \246\277\247\325$\315\356=\244\252lO\222d\001`\277G(\033 \310\243\345\340\314G\257lQ&jM8\337\310\255\300\272\314\321\345-8i\317D\317\244\261\357\331\017\326a\273\352\227\372L\332\214\003\352\022\320p\3453Q8p\016\0227;\221\214\265\366\347y\336f\236\231\326I\357\022\322/Un\033c\356\357\"tYE\032\025]=\2728~@\244,Ft\274\td\033\300\211\215\226/\351L\220\307U\262=\020\004\022\352\375i\275\3136\353\301G`\024}b\013\301\376\264 C\351\022\276\352\031\r~]\311\355o\332\234\264L\3774\372\3412Zs\337\300UW\013\362\t\330\333\211A]\026s\333\333\027\230\3125;\323\316D\247pW?9D\345\361E""u\010\306G\342\203\236\365`\244\354\017Q\254\255\307\230W\253A\000\270\203jf\025\255\030Q\305\022\273\031\207\036\342G\341\347\232&\263\022m\347\035\200\244\245\202\367\021,\362\227\341V\205\324:\335\037A\205\324\310\343_\321\217\tS\020\225<\235\236\317\022\301\017K\357\211>l\315\216\352B\t]\"\336\ty\000\3200[\331Z\314N=\002@\207M\324\272\262\007\264\342\271\350\354\250jg_\002\033 \0008\244\231h\356L\311\337,\360\037(j\212\230f\221\002\2708\243\221N\2235\345\\\313\210\177\344^o\225\337\0047\000\017\270\371K\r\016\r\353N\031:\342e8\323\226Y\202i\244\030#\255\036]A\201\352\221 \202r\014\202\253m\266[lLf\0200E\004\002\244\364\265 \205\244O\325\177.n\301++x\330\352\241L\362\315\337\230b\265_t\245\330\346\023d\334\347\t\351\276\0378fA\002\252X0\366\335A\361\276\344xm\2708\271\200!k\025\220F(7\r\226I\006$\371\216\316\317]\177\333\212\332S\010\321g\324\231o\327`\335\367\203\013&\231\337\036\337\210\303\226q\344|\260\r\004\361\216m\350h\006\217\334\373(\017\335\"z/\325z\370\257b\030\272\022$B\345\025f\004C\036\343\331\317\222\300\254A\211\203\212\2512t\2454GMP\036\2211\013]\024d\364\004A1B\016\220\200\030\326+\303\014\316\225\322\330\\\237fL\203f\341\004\303nG\177t\206\366\223\2574\235\007AE\004\254\347iN\004\030\244\351\320\336Y\370\304\232\255+\254e2/\323\nU\323\305_Q`\377\332dS\355\223:\216cX#8\267\345-\256P\365$\245\203\266\230\260\017_\265\225\216\353\220\322\244\202(\245\330\216nZ2\251\315\350\310\231f\272\256\240~\220\251\311\222\031}D\327\345\247\355\374\274?\006t\216\367\240\021\206\004\322e\005\240K\266%$\251\373Y9\236CUb\350\262\375\036uO*\272P\207\343\367\247;\367\234\356\366\242E\2333\032:8\004d\025\225\0054\206\360\216\026\037N\220\215\312*\2717v\002\037\312s\0148\253*s\316\236\337t\316Pg\346\201\355\263\212\030\367\356d\252]\222\245P\351QF\350\0013\271p\300\027Y\312\031\374a\320\345\031\r8\201\352e\203\247\206\022\001\360a\032U\300 \305\331\207\"\271n\233\027@\267\225E\242r\253\3665\237\362\257SeI\204\242\227.\365\370\371\303\215I\255#\227\276\244\200>[\267""\275\307\350~\262\260E\3377\n\022\n\002\257D\330\232\346\0361\232[\035\264\263\262\213R,y\36444\372\306uk\274\260\360r}\234\325RF\265LU\002\243\246w\244\226\034g&\250\025\273\002\275\026Y\352\020,W\231\325\202Q\216\343\200d\231\223z\027\366\207@s\314\226\3152\331\226\246'\351 J\021\3468\000]\364\245\223\3327G\010\230\243\224n{=}8\342\304\342$\200\263E\n\234\365|\305s\210_2\2455\300\2433\032\272\326q\344b.\356\270\022\311]]X\244\r[\361+\322\332ig\315\350\234m\350\362hG\"\334\036\300\300\301\220oR\265\375\346\211\263\361G:\177\322\017%\033;\006\013\370\337\356\345\007l\362\267\326&\024Q\014E+!\n\355\367\006rt\033\023\006\307!\232\3769#ElWs,\207\006;\232\3644?Glb\344\353\004\274\327Ho\370}\334q\270\360\210+6\316\244\345Wg\022\010\307\220\013\007'\331^M\370=\376+~\2126\256\237@\002>\177\013T\266\0052\251\234C\316O\313\3738qO\374\370\372\272\320\240\2368\304\236\246-2T\335AE~\017\r\036.\035\027O\274\247m\277\004\274\363\0037\214\376\232}\257\3259\000\326\367\341\010\020\307\230\312\333\265\213\177\022JZ\t!3\330\350\2720@\374$\232\257\370\0047\374;\214\017`\323\332\340\027\203^\033\275\030\312A\267s\207\030#j\t\342\244\263\273\321\377\233\332\262\330\035\243]\350\246\352\320\350\266\370\303\374D\200\343\333\005?\227\361}?\355`\001D\177\236\310\300\366W\204D\027\330\n\205\342l\334B%dXwoP\354\370y\372\n\027\211\367\220J\033\276o\005\355 \200\033,dL\350\306\224\212\244T\252\226\260\324\315\205\311`\220k\314\351\331\302f)\252\376\265O\017\217W$\324\027\002H\371\033\317\027n^\007\310-\262R\360\024\010\365o\030a\032\300\323\235g\256\033\233\220\322p\013\025\337\365w|^\313N\361J\305B\370\254\21051DJ\364\020\360\205\340\265e#\025\231\351\231\224p\007\343\264k\032\247\376\177?@\250\302\337\010\216\003\376\361\364\255\350e#\034sb\264[\220\352y\311\366\354g\262c\225\257\333\346\251AD\226\023\326\216\250\235\226\277{\027;\245\002\212\340\230\356\"DC\215\332\374\252K\321\217H\210\267\252\214d\016O\227dU\341\335\314\027\370R\372\317\000\002\223\354\326\2467\0351\"J\376\372Y\237F=6\304""\345\034\362@\343\370\371c>\023\333\202\263\276L]P\324(\315\202\342H\224\372\273\314\304\246,\361\361\215\354\033\336MlF\250\351)\250f2\270/\034\202\252\254\211\276\336\344!\236_\330o\343Z\262\370\337\304\353\272M?r\013\036\243`\341bf\221\302\343k\320M\300\200\370\016[\351\200#$')\207\031\367\2613\032R\224\251\255=C\005\244\033\352\014D+\336\244\245\0327d\024\224\366:\305g\021\316W\353\230\206\245K\002\226e\237\323Z\221\377\022W1!\315\357\313\\:`\025x$+^\370\203\216\266W\254GQ\002\204\224#\211\367\006\020\371:4\200 \253\227\333\300]\006A\20712\032\215\371\rl/\206\334R`\371\276\351\255\231\002\244\252M\t\222\374)|\025\264B\310<\204\262\361Nq\273\206\241\302H3\000\373\326\234S>\024sNG(I\267\243\352%\317\211\210\375 {]\365\354o\202\242\260\363\"\232\201\251W\0057\232\340I\034:\257#d\314\031j\207G\034[\013\373T\341\35072:\313\221r*\337\305g\376\246\307\021r\025\200\016\216\234w\333\036)\250\276\033\367X\017F\375>\277$\364b\\\216_\232\237\326\010\370\207\267VRHx;\010/\311\211\002\353:i/\225\201\025\013\215-\302P\241\243R\237\245\321\244~\335\246\371* \0038)\274\311\342m\375<\310\330\3448\211A\210\022!%&J\031\366a\203\302\202\r\255y\203\361\n+\337\037}T\357\221\215G\016\241\372KM\210[\037X1[\376\"b\365\224\372\273]\213\347B\204_m\004#\216r\202:\031\222\213Y\212pzx\350\327\255\022\247\323\256\204\002ri\256\352\344\0208T\376WH\017\254\013z\256[\002\254\213\212\007T3\243\024\327\217zx\245\224\226\367\257\250\343\022\204q\025\277\371x<\314\007L5s\333\271\021\251 \345u\254\331\021\376\207\333\372:n\336\004v\226\306\307:\037\016\250\223\nl\217t~>r\251*kkIU\267\261\304\231\347n\203\035\226\325\"vd\267\013\226\204 \337\312\200R1\370 \357\344!8N\261\r:\254I-\"\037\223McA$\024\263\315\242\222\236<\226\201Mc\032\216\030\367\300\213\212qN\244E\235h b(\210u\347\313\320A\252\207\376'\r\255\231\220\353\021\032\366\016+\007\212\205$\206\360C\310\377<\203\"vN+\210%\3030\264\310N3\004\246\206\342{\322\300\034\377\t\"\2266A8,{k+\236r\005,y\252p\030O\203\006@\227(s\240\352f*\300\n\3017%-""\255t\354\260! \264\217\336WS\3574Y\304\t\250\204]NM\316\207\377@\247\333\304\234\355=\301\274U\334\306K3$D\355eA\265\273\177\203\017\362$\372\207M\306%\370UE;\273Ea\271\016\366Z&\201\341!\362\353\336\221\007\036\212oB\\]k\314g\"\376:d\344\276\026\031\242'\223i\260f\013\346\202\374\262|\002S\336\273\215\0162\356S\313E\220`\316e\032\221\016YjNU\376\324*\210\034C9\263\n\014n\221\324\222\t\250\373\326\236\037'\351X\277t1%n\233C\r\3028!@\241xCLFj\341\325\361U9I\216_6\264\262\342\203V\373\001'\325\023\204\306\261\312\010\026y\n\"X\210\234\3361C\264{\200\254Z\013xrS\247i\255K\232\035\226\363\313\276|\344!c)\224g\335\254e\\\215B]2\210\262\034D\037\032\304b\360\251\375\265\257\225I2\376e!N\354\216\370\330\353,+C\200\023(/\372\010\000a\2200\002\270\3165\245\260J[b\301\273\272\271}\207\303\266\267\265\305\361\035\214}O\004}Z\221\205\360\0338\207\"\027\367c&\276S\237\343\030\337\304\220\267\335\316R\253\300\222*\303ltB\240V\233\261\017A}\355=\323Y\027\"\361P:u\252l\010\016\303\207\217\261\200\362\226u<\251\017\225\007>\260\332\367\342\345S\035X\261\377\334K\021E\021\271R\211\361\017\372~(\217\377\021TI\230G\nGz\323\032\373\331&\246 LV\032u\034\3520M\202\323\267\024\n\203k5\202\314t\341\305xl\225\005em\2571\"\256\004\001\225\014\240cK\223\240\206\031~\nmi\257U\2368i5\334u\226\020/\005\352\343c\006\247\033(;?4\251\306\267\301J\3551}b_\002]\342;\322\355\2426\256u\243\001%\346\266d\277\333\024\3271\346p\017\033J\344_hqs.\0165)\003\240\231\337X\375\244\243\263\362Ira\323&I\360*\001h\343q^\202\341\345\353\252hY,8\356B\000.\302p\340KY%8\367\343\337\204\273\021\310E\307\214\275>6\253\221\335\301 e_\353o\256\270l\235;5\225\254VRx//u\370\265-'\t\246\200\346\020\311\367f!\030u\025\033\35398\270\370\325@\3028\026\310Z\322\000\007\364GAf\"~\254y\033\316\222\350A{\307\254\3332\274)\312\241\256\346\342<\231\210F\r\304\217l\032n\210e\374\370+\324P\273\t\202\016b[\301\234\345KAT\270\266$\036\260\265\263]N82\235#'\331\236\"\020\003x\034 \200qx](\270\325\274`:\351~\003\250\331\274\337\322\2264""\260\254bo\211|\336\221\017\013\274\350\262\236\227s>\200\353f\020\371\344;\034\023\0014EBH\367\310/-{\rEK\002\305\001\342\026&\350\031\020\014Z\005tX\211\307>\273\212\370\0206\316\264\273\245m*o.V\rH@b\353\322\237\232E\346G\335\325_\256\006B\367&\317<\302r\321\234\324\300\t\357E\265\t\006{>\tCM\232\331\377\240r8_\247jN\336\030VX\371o!\277;\260~,\257\314\311\252\271\363-P\223D\010m\241\276C\266\034'\377\257\037'\251\205\363@\207_\035\302\202\325A0\266\236\377\034\\7\022f\275*\303\004t\305\340\256\250\037\214\270\242\310\252\017+\254\022\031P\236\032\377\033%\324\361\005\3465\026WW\251\354\305\177\027f\331\307\320\372\371\327^\243\316_38\231\207\014WvJ\302\344,\250\222BD3\265\263\365\360CTG\310UQ\203+\311T\303\214\225\334\231\342~k\373\273\346kK\332\305]\306\370\204\353p%\330k\256\213\231\376\234!\352\216\336\247\337\214h\255\205\244\2473\341\360\343q3#\306\342\007>\235\271\031D'\236\300\335\224u6\036\024\220\033=\035\004\200D\325w\257\216\330!\260\347\344\347`R\221\255\022\026\017p\000&%\341\364K\230\317\260\001\017\364B\020\207\357\036\307N\246\034s\322\017\334\271\307\212\307A\373m\237\367\351\233\333\254\010\261\302\212y\264e\330\273=\243\036\t6\303\366\"\\MG\361\031\357\211\233\264\261\004:\246\365\277\0277\250\267\321\3320^A\276\335\304\030~\023\272\327~\"\254\254\227\230C>\022\302\300\005\267<wo\263=\217\036(\347\266\341/[\033\013l\035N\377\032\227\322y\014\356\275K\217S&l\005\020w\024\307\270\326\343G\353\352\031\232\267{6l\367\032CO\344\250\310\262\3610\"\005\302\313\025C\240\256\355x\332\016M\2529C\240E\362aa\204j*\343v3\016\345\033\340\346\020m8\246\252\306\212\311\021I\206\202a\337\241\322#HS\270\305}\216\010t\270\320B\333\265\375\271\207\363nz\244\177\314\321\251\306\026\023\364\026\316\305r\265@@V`\266\346\211+\327\335E\331l\2001Nqp=t\244\276A\027\325\276%\020\233\341\366q\251b\276\310m6\2731\210{\225JDH\255\010\2532D\302A\267\030\272S\366\331\247\222r\267\001\037\266w\211\367\ni\035`\356>\207\235\203\375\016,+\033j\004\224%V\301I\271\237hd?j\267)\025y""\024\376 \267\307\237n\002O\034f\340J\262\266^\210-P\351\322\360m\206\366\215\232\"\316\2161f\231\353\305Q\231\326\250\026f6\216\374\247\253\216\203k\177\030\321\356I\267\203R\350\250\r\263.7\346\311\020\305\351W\r\362B$\317\275\206\331\024e\360(,o\rX2\336:\301\2010\027\330\364\213\200\231\230\255\n\352W]\204\200R\276\357\360\016'\357\243\347\305@\236\334\363q\036\203\321\222\377\363bO\232\240\244\315\025\306h\010\214\036\324\305A\016\252\266Ezy\322,7hK\2559\366\266\263U\344\351\376l\215\367y\344\377\017X5\377>Z7)I\214\227wp\031\331>qW\346\034\320t\323Q\2406\301\332DHLu\0255\377\347\201\364\037\366qy\227U(\342|.d\243\007p\362\007&\006\213,h\003EdI\275S*\"\334rY\265\001&\211A\240\2515\022`'\013\315d\304\335\036,\004\034s\375\004\212\033\310\262\231\224\325\252\347AH\330\307b\222\017\027G\007\034\265\221\001n\032\036C\226h#m\315n\246Y\336\325\242q\3745\337B\233\367\305\304\310\nJS]^WQ=\255H\236\227y\014\016\223m\325\254\322\226[I\021\340\037Ht\3335\231\320mB\37793\250)\317A\331Y\2311|\200\3623\021\341\021Yi%D4g\241\344\317\314z8\234\261\211\r\225\010v\007\220@\350\242\223C\240\247\330T8\002]\\\263\270d\356h\220y\266\302H\220)P\242\355\357\221\376\203\326vv\032\027\022(\207\360Yb\313\360QM\376\237U$[C9\336\010\336\366\321>\245`Em}\227yef\346\207\204\205\256\2012\262\226\345\275}\261}\217\001\203\037\374\003\367\304\004p\333\237\353a`\270t}\203\032\306\274\367w\025\371s\000\247af\360(q\235+\016N2\355EgIV\275\3253[\263\005\336\027\321z\273?\221\2246l\317\273>\364\216\233\260\322\032R\020+S\033\227\n\324\330\354t\350\206\3111\305\312\0100}\261e\312\3528\034h\373\241U\346\212|\020\004\362\262\270/\007S\023,4\3170\222\265\247D\374\322\221\275\270\3406\023\206w\367\247\232\2133c\360\255\216\375_\226<\010\317\313\262q\331\277\322\245\030\224[EY\206\026p\340\237\202J\3134j\350\371\014\333T\3668\3112>\022j\224\207J.\322<\265hf\250\252\227\027\271\036\366\341!\212\237\264p\277\346\326\275\322H\336q\362T#@\037#\254|\263\235C\n\303G\306\373\372\376\005\2752\322\276\301\200\0242""\035\271\333(\001\370#\300\341\243\343\266n\007\315\257\300\314H\351`\320\225\225\313?-K\251\3074\301\001\201~H\"\260\222\324\362\303\226\037)'\377\256\002?\311\374\375z\301W\253\017\226\345Kz\034\n\271U\207%5\256\177\231\027m?\235\006)J\000Zi\004\342\025\250\242\347\330\351\317\242~RZ\345P\313\303\302\323`y\251\3072\266\362\214\345\203\t*\320\364x\267v\213\374\252\356W\313\2531:\243\003\211\014\366\037\216c\026\001\315\213\010l\267\001\r4\013\032\2732\202\204\240]\225\241s\264\312\271\364q\205\2035$D:\255\264# \014\370}p\330\037\316\200\217#\346\274\344\027\371\321\307\377e\003\352EYo\221a<g\312N\rX\352+A\035\303)Vo\021\373}3\007):\356\357\377\225\"\302\333\265\306\243\244\013\375\017\021\306l\320\225(\263c\314\244\301r\214\003m@\257 $\034\347\352\"b\025\220\327-\365\370\234\236@\362\023\374\026U\221\267}\202\204\235Tt\300\223\302F\002\344\262\377\250\"\200?Iz\235\226\3124\320\313\314\250\351\224\343\221M\304\243Ll\216\202w\037\003\373\341\201m \214E@\272\\\225Q\221\r\226\036\313ff>(\330\354\002p \244\313\242;9\263\314\345\352\22256\301\212\234\207d+\242\311\270$\362\365$\247\260 \003^j\374\023\375\330\263\327\237\256\343\253\321\3654P~\305Z6\"F\325\303\353\023\235\215r\244\313\244\333z\353\r\206\343\364\037\350\343\227\032~\227\343\227x<\231\211?\316\343\211\342\357\204\262\"\224\374\230\317\202\322\342M\271dQ\346\333\325\305Z\007\025V\330\014\263i\336\300Vklx\026\217J\033\317\217Z\002\000\346\016p,i\236\376\027\251\351\304\363x#}I\322\030\304\355\236\323\270v\205\372\366\202\264m1\032\300AC+;\334\354A\226v2@\252\367\336{A\373\"\210\213/\244\336\362\243\344\350p\352\241\232\210\367\0029\350\315\326 \354\3437\253m\032\037m\277\210\337\215\236\016\010X\032C\311w*_s\024,^s\221\201l\252\254\215Y\013L9]\307>\\\242U\262S\253.\254\276_\216Y\025=\200HLl=\361\357[<\021\001:g4\021$ o\253\003h\370\226U7\245\t\241\030\277\221 \375\322Wx\177\331NTq: \350\356\023\0000\0000p\036&\001\367\000\004\001LR\307q\222\232\"\226\221\212\224tPB\276\252\274+\n\353\233T\323\334\215\n>\325""\021|O\375=\272L}\317)\312g\224(\276*\211\201@G\255\243T\251\n\213\n\n\204\006\"A\001\241h0\240\240`\217\234\350\177\026\363<@\330`-\005p6c\004\001&(pR\242\346)1\376_\306;\005=\247b\217'\365&t\274v\376\344\014\244\301\301\"\026E<\326\300p0-\0232\034\250f\016\020\210\206\2558q\202V\315yGI^6\021\231\2100\022\315\204.4\023\014\303\300H@&\026\034\n&&\226I\221\251^\204Ap<8@\032U\210\210\003\362\270@8(x\250\003\305\203\303\202C\244\2018D\036\r\221\202H\244\241x\344\377\277(\206\201\370\377\377\2570\363\352q\347\240\254(\331\250\311\240\206I|\221$\20478%\333\017\301\234a\032\206i\230\206i\020\"\022\312 \201\3200@\036\016\t\210BS\320 (4\n\r\363x4\022\315\001\303@\376\377g\215\317\034\177$\233\377\r\206\377\377{\304\004(\004O-\265\316\272\326)\313\036\305\250V\264nA\001s\315\t\2413\t\315u\324\334enc\356\244\377\347W\036~\367\371\374\2769\271\325\367\032\240\016N\331\232M\371\234r\323O\217\377\301\310\305\340\031\315K\342\342\270\323\261\225\366\272+\245\t\001\261\230j\354rW\342@\227Jr0\003\010ewowC\267\275\355\361\311\235\034\325\333\347VF_L\3336\263Nu'\312s2\007\367\274;\367\361\316\350\001:\325\215\367M\213y9\274\274\313\336\366k\260\352=\325:\212p\247Ke\356\363\373|b+\2604\324\204\322\361\305L\302?pI\263\362?\206fdL6\253\327\330\332\200\265\323\224\022V\030\301\250\271\371\334\366\321\301\355\376\353\354.\273\313\354\356:WR\257J\311\230Ne:\323t\356L\320\271\\}e\2475O\324-g\305u\342{v\235\257\343\260+'F\322\251\343l\227\346d}\367\374\225\350\242s\255\342\300\2719Y/7\252\327\334\235b\356\254\225#P\313y\312\r\270\305\265\3059\312$~2\231\274\302&\223\211D\022\233U\242$\022\025X\032\363g\211q7\331%<\234g\n\224\014#\263\025Y1\3537=V\313\26127f9#\370\026O\213\037\350.\037/f\035\037+K\226b\305\254\314d\254@+B\217=\t\311I=\206 \010r\013Z\217\316\nAR;\330\023\235\363\355yk\255\333\262\237\375_\376\037@$\270\317\377\017\206ip@\376\377A[\333\326Z\214Z\235\346\226\326\026\345\221 t\252\243\030=r\362Dv\317\227\306\304\253\365\215\360\260\347\216\237>\021.\233\0303&\245d\212\301\330""\362\242\ns\330\317X\345\275Hw\256\271\036\241\\\023\256u\201\245\021\360,\374[\317\202\315[\020\317=\274\267&s\274\365\236[\352&/\325\005Y_\001\252\246d\255E\016[*\217\213\255\007\003U\375\372\177y\343\024I\n,\215VR\312CG\266^-\235<$[$\243+\210Y\035\3653\252cR\302\244\314\230\2245\35731]\267\344\035\351\226F\200\224,\372\304h`\004`\250\243\246\324\010\312\334d9v\364\242\253rT\253\223V\342\243\024\345\214*}5S\225Q\3725>\222F\325x\030\243[\\\224\304\3101F\000\305b\214j\305\025\343\235\370\327\2101#\003*\204\022\214 \214\020:(\201\220!\204p\341e\204\360\035-\315\230\223\324R3\335\2200{\352\337\353-[+\335\032[\212\226f\022\330\r\273\273\373\265\344Z\322\334\315\375\366\264\244H\250\346\262\271_\023\366\374\331\247\026T\024\306\332A\375nI|\375\364\266\323\353\264\3231vFeR\335\374^\273B)\337{\323=\235R2\224\313\215a\030\201&\2604XS\207Kc\237\234\254\017\374\344\022JT_\206\253\270\311\005\215p\250D\270\270\265\243\031\000\001\005\243pP\360\000%\024\210\005\204\321p&\317\0074\205\350(\244\306\022i9$\215\264,H\031V3\003\200\002\341i\220<\225;O\377\322Cg4\005\316\030\024\355\314\026(XC*\177\021\320\200\321\035\202\221\301\203Q^i\335\375V%\216\254\0247\\\251\371\214\245xo\212W\177O\026P\321\300\331|\266=\240\346\205\036:\315i>$\214-u\352g&\360p\023K\"\202\274\217 }\332\300\212\274\255EBv\034\372\246\006h\255\225\032\357\022\321\235\006S\032I\016\2228\373n\302%h\372$\307\001\322\354\003\350\311\026\205@\264\271A\000z\210\304\030\234>\253\016^\000.\216([\313q\033\027\353\331\300\272\344\025\276\007\026g\201\302\344\242\301\002\353 N\\\211U\346\333\317\022\255\217\020\354\244\303B\343\024\221\206n~\026\350/\244\3332t\253\342\tEl\365\037\273V\336\005\273=\006\203\345\235\367\250c\302\016\013\n\260n\004\357\251\315eA\255\336\316\233$\036RAZEd\254Ld\217P7\316\216\2766\ts\027\376\261\225\n\310\274\232m\212\252m\327df\267\313,\266\000D\235\337d!\034\213\022m\306\237\215Q\234\204\254&\342l\\\300\344\021\031\034\016\006c<_,\334\312\227\005\252@\365\276ae\267\343xqIC(\343\355'\027>x""\313/K}\250:&#\314\374u\027}\013t3\027r\223#Mm[\236v\035\020\371\342&\315;g\364<P\2318\204\335k\355\274\213\032\220\216\004\035\356\260\334Jz 3O\201\335\002c\347\300\370\004\001\311\253\265\0243p\271\335(k\201@\366\257\216\337\036\341\370<>\217,M\275\224I>\322\252\n\325\016\255*\277^B\035\347n\223\360\036F\220\337_\315;\n\303`\366\032q\007\211^^B@A\315\201S\301\322\352&4+\202\370aM\312\333uf\324\".\020\356\306j\325\251\337\323m+\005\302\342\310\266\274\261\t\315\260\032\222F\222i\357\313\247M\241 \263O\302{\246\210$ij\221\264\010\220$\341\221t\233h\2123m\0203\t\347\364\344\312\230Y\220\273\306L\234\343\026X\375M\007\245F\330/\260\243\223\353\036\033\264\315-'?\007\252\257\216J\245\034U\226q\327\003\260`$K\201\241>q\203\336+\220\327\027H3\r\370%\032s\014\362T\205\355\266\030\t$\236y\3510`\345_C\207x1_z\"\220H\311I\247\310p\254\021B\275R\371\372\206\033M4\300\347\202\311N\305C)5\300\333\t\277c\3426.O\307\230$\253!\315\326\362\267f\250\366\251\241\372\325\235\261\371\260\240G,\217'\026\337\206\265\316^\254\tk\306\n\232\370R\250\336e\260\026\307\311?\323\030[d\202\345\346\231\201e\251?\3112L\013\245\032\264x\305u5>}M\351\330`\027\376\034u\377\246\002\026\351\005\373\346yDy=B\t\242\322b\r\376\351\2551\300\355\3406\001\376\022\t\306\323\030\214$\304\006a\221\357\031+\274\237@\253v\230%\235\314I\372\303\314|\272g&\201'\3672\203\177k?\316\377\212k<\225\332v>xrV4\336\373N\257\t\261\333P\357\206\237\212\243\310+\001 LL\031w|\217$s\273\310D\374\350;\345\240\313\003\0164\353\013\206\351\242\tL\364\322\365\330\367\320[j/\027\234Z\374\026\203\002p\273\020\304Od\334\367\037\241h\"@\022\013G\034)3Akp\364\254:\334O\212\273\002\233\016\250\270\266\005\016o\323\360p.\3240\020\254E\302\263\326\340UO'\325\310\310\322\003\266`\312\350\2111 \023-\245r\253\340%\337\224\317AD\3472\373\246\271^)\213\317\315\237\002\313\271\334j\240F<\322-\256\332c\305\036\371\370% \341\216)\306\333!\000&\343\302\300\351\262\222\336\007}\034mP\021\250B\355el\023\301y\000\037\\\231\246\354\025\214\342fA\336""\021\220C\002\241\201\017\027\376\207\352l\344\237?R\336\216F,\355\356\236\342\030E\302\202O\":*\207\277 \250\036MR\355(i\263u[\242\252\005\017\020\222\262\257\244\241\365\202\220\3717a\265\036\020\243G(\367/\233\001BOP\353\017RU\237\036\005\350:\0016Lg\342\340y\326'\227\202\253\201>\207\316\001(\000\314\000\000-\213\023\"\207\020L\027l\030\315=\353\366\301~.\303\335p\315\343\266\320E<\203\321\335\371\343\347)Ay-\225\202\336iM\214!\031\230\231\302\353\017\312\262(\300\255\214\"B\233\310\032\337\225\330\275V\221$|I8\361\230\225O\343\303\013\235Ru\230\236\361R7\000ZX:\000\247\3324\\?\205\315\376\276\332\250\334\006\276\206\004\226\330\376hEO\255\017B6\265\225\3504\327Q\322\314\325\3046\333\347\356\235U\371\256\253\034\345g\312\323\017\254\312\\\246\201@\252\210\220i\264w\313\373\026\241\247\216\237\000@R\001o\007\332g_w;\321\023\320h\230\\\r\207M]\017Sm1\257\351\246Q>)\346\363-|J/\005\014E\310y\301\333\177$\017,\003\201\337g\271\021$*\233\221\253\331\314Gk\351\352\342\326J\320\300\301\222\271\352S}s\201\026$\370\320\034\336\"\220\334I\005c\333Z\375\351\334\227\376\307\321\002\031\273!\222\232\311X\315\304\376\030\227\010\307\355\007:\005\373\372p\025\020\255\206L\366J\310h\024\320\327\237!\273,,\265\367\342\234\253l\024\030d\362\336\340\364;\366dd\032Y#\177\227#\033\316#\207\003\222\023\207\344\376:\222s\225dc\341$\0171\245\253\222\257\207\344{Q\311\232x%\347\337\226\\l\275\344\366'&\367\3772\331\377\245\311\363\317&\253\027\234|\375\234\354,wr\356zr2~rE\250\311\275\177<\310\212P&K\266\264Jz\243\260m53\212\337w\017H\362\352\313\350\344\315\362\200\340\271\254\214Fn\200\260j\244n\235\223\200e\2337|c\337\027K(\313\024:y\207\020\232+\300\206r\035\345\032\251\227\305\000\210\302U\343\334\2144\004\213\032v,dVo1U\300<\310Ap\353\014\357J\264\233a\347\353{<\246\215:r\232h\nv\375X4\307\362\363\304RUy'\210@^\303\3055~\273\200\352\303\034\217\333\240\237E\240T\362D):B\321\023B\366d7u;\231v\020\316\027l\234\343x\225\n\322\270\2353\025P\r\342*\271M\035\377\376\202 \336/vI\201\031""\255\2124\231\2458/G\271\017\300l\342h_\266\337\275\277\225\305\n\243\305l\340e\264\341e_G\362\033\020\353\270\241\335\032\316z'\355\334\313\351vS\330\023\246!\252\344R><\270\351eO@_\237\312\\\002-\230\216e\025\334\021@j\344>\013\rCY\341\220\203\371W\301t5\362\200h\253\263\324\023&\210Gk\331%\235\017\013\375p\336\214\343\302\2136\375\207q\227\025\305\266oc/E \"\362h+\240\375\374\260\230\"\370zp2w\234\245\205<\246\347[\262zk\340IU\301 8\262\350$\036\355\216\014i\224\210\301i\2231\222\256\342D\305=\006\360\341\026\357\001\250o\330\002\246\223$\030\362\006\t\262\3009C|\337\255p\367\204.\355l\0137KK\307\365\021\255M8\0047\331\201\222-\321X_\003\357\024\307\233\311\264+\177\333\013?\017\3138\033\225,\354\275=\010h*EC\315\244\354l\371\220rXW\377h\271\366\347Z\360]un\327\326M\256\331\035\315\0233\347\203c\213\230Y\251\312\330\\\262\234\304\200!\007b\253\377\3111\247\344\314\373\n\2755\177U\217\234\3305J\252\272\351\234\362\037\344\016S\325.\200k8\2728/\352\224\1775`\222\271\032\352\227\363I\347VOQ\3306tf\364q\366E\303\2704J\255t\306\317\233\003R|\213\025\276m\345Fh8'\336\314\271,(o:\227{\")\340\237'\277q\000\316<\035Q\265\262\377\010\200\276\025\000\212\224\034A\272l\216\220\243\2734;\177\3365\201\222\002\3675\314\316_%\374\014\233p\204M\233b\220\234\375\026Jc\222u\337\343\364\216\360=\016\0338\346mG@\017\215\360\256\225k?L\305\242\217&~\226\024\333\032*\221\306\335\005\330'\216z]s\223\316\014\373sr+\003\252\357=\177\270\342\003\260\235\341\022\250\253\200r\010W\r\272\t\344O\025`^h\364\317\003\370x\360\237\227a\316\311\334w\262\360\236|QW\230\237\330[\323~#\241*\006\033\362\014J\317\341>\370Vl\351\323\023 c\360\345E\002\334\272\023W\033\177\233`\020\336%c\267\234p\261\227\274\3468\304_\010\257\242T\240\no4\231\301BY\316(\315\234*sq\304\315\356\304m^\305m\344\342\372\224\341\016\263\"z\3471\"B|\330\345\0140\200\006o\003\203\202^\321\262*\327\225(\207Ad\235\246\022h\324\333jc\356\311\313u\256T\204\007\256\343\307P\245\361\255\262i\034\363\276\031p\310\311\226\373$\304\036""\2705\370\302z\242\2106v*\006\030\006\350kP\315\033\206#\005\252\205\202:\373\203\252\242P\005^\366K\222\376\206#\325\370Q\244\335.\033x\265!\312|\263\320|\375\3662\221Y\240m\202-79\341\232T\237lm\314\306\024\324d\0314Qg\245\253\245\202\364\366\344^v\022\253\252\244\027\275\244\225\360\\\335#(c\234\005HTBwq\323\306\270\305\326\354\240\264Y\323\004F\016\337\317@\032P\250\256RE\232\320\014/q\0045<<\342&\"*\214\210\336\217\310\t\020ZLn\271\234\267\204\264\226)#\323\272w\002+p\020#\335\317\n\367\320D\337\207$\275\026\377\007D\277\352n`\233}l\200\025\013\360\216\352R\\\276qz\227B\242\244P\255\351\241E\352!B\036Ov\024\026=\312\034\215\342Mr\272BPx\030_k\232\257\355\342\305\341e?\177x\206I\033\024\357!\341e\216\031l\001\263\351\215\n\233\321\375\306H.p\3505\364&\010O\234i\r=\340\352L\270\222\320\307\222\353\325\206\001l\243\272m\214\3616\264\325\310\\t\371\220X\002\301\205br{Z\315-\265N^Z\215f\255g\313\032mzO \332\247E\300\277,\264\316\312)\255\266\256q_q\240\265QUM\323Ez\2223Z\240\310\024\224\000\031J8q\323\033\340j\347\257\032\036\252\327\200\235\235?g\205 \265]\200M\035\010\233^]\315\346\371\354\354\244\310\273\331\305\267\273\305W\3445]\313\236\213\211\212\037\230\377\r\353~\315,\210!:\226\337\272\335\336\315\020\220\266\364\007\035U\023\346\321K\021\361\247\010\336\251Hv\025i\330\2124'\005\355f\032m\305\266\367\255\221<\260Q\004p;\"\221\367i\022\351\353D\312\372D\332\363Qsl\250\320;\245\023O\013\226\247-\267\213\271\361\037\225_J\261\250\330\273\212xCz\277\202\1775\337DL\303\265#\366H\022\235\270\026y\342\376\026\327\034\020\236\003)IG\272b\224\364!)\272d(\375\366\224\336`\245\327\233\245\317\310\245K\344\020\347\201\210|C\356\221\305\r8>q\213\363\005\374\266A!<\317\223ZiR\016M\034\277U\250BL\336\250\371\204Ag\352\301qjY{j\327\244\311\010\020\254\253\022\314\216T\260\225L\2345'\356\346\023'\022\305\005(\305\225\276p=.G/\242\200_\331lr`wH\212.H\266\030]\262J\222\003\354\274\001g\324\216\3618\304\201\034\t\n\035Q5F\356\tG:d\20439BX\020*\225\247\266\251\307\313\077\077""\370!\371r\373\211\333\375(\230\374\236<\215\014\250\361\333<\0107\322\244\032 \322\321\000\241t`\220<#\355\340\367\n\376\3750\370\301\010\363\324Y\201\215\341\001\324\243\267\275\022n/t\344\366\270\343\304\356\340\306\037\343\270\020f%\234\321Ae=\333\003\030El6`3\301\326\337\247\235I\2145>L\300?\300\031\352\312\374\370<X8\313CI\360\355\324{\270[\254\263SA7\021rX\324\td\001\037\235o(\326Q\310\\1(\255\301\n\265vO\023\325\362D\303S?\311\351\230\025\2148\021\001GQVO\221\243\"\r\302-D\005\244\226w\244\326\316\244\236\361:1\265\220[S\344\364\312\270[Pr\365L\256\274\236\334\354\243\234\030*'\343V\356\234\352\366k\255\033\261\212\234\306\232\373\t\326\210b\325\036*\320^Wl@\254\0368\246\352\343\307b\t\341\352\327:\240\317\314\242;\310[f\021\253\314l\225\245\317DnUaNU\355\2712\377[\351u\0201\301C\204u\021q\357\021ad\022\221w\345\2257\021\024\277/_\267\356\002\240\3353\310\367\212<\275\1774\365\350\311\222`\335,\035\301\261K\306\231%\256\332\367\233\357\025\316I\361]7[\314+\335l\225#\223\035U\331\025\206 \322\026\037\312\225\035\302\325\354\240\230\303\341@\343\350\331\255\357\330\343l\003_\216\246\023IC\276,\315.\230Y\255l\"\321\324\352e|\210\301z\021\363\262)c\353\205\227'\312\276\324TS\346\332\330}\201\275_\250\035\001\326\020Y~\307\311\022M\353\014U\214\253\376\210\271\0166\n\177\000I\304\023BU4Ti\330\334\214\351\006\325w{\370\302\275)\322\370\252\007\371J\237r\021S\033\033\035\327\017\311\025\237\345\222f\275\205*\016\327=D?y\345\223H\025qc<\362\347\032\271\033\222\325,\ta\210#2\244\0174h\262\261\313\324m\217\355\333\3174\356\271y\271\315\025]\034\316\371\341\252z\377\262\345E\261~\001$\214\353d\234\353\305D\337E\rY#7+c\276\023m\022\335.\355\022X;S\007W\242\342\231t\361T1n=\326<8~^\221\323\265\244\235\023\211h\250\244\324?Yg\241\254\343\222\rZ7\033e\177\261\242`\034\363\354\024\372rF\311^\201\020|\251\236\333n5\360\321}\277%\230\210\n\217\310\246\010\247E\303Ga\000kcG{;\307\246Z.\256\244\016\216m\r]\036\323(\335\253\275\235\034&\234\343/7@L\321\231B\223\013\326\203x[@{""\365\213V\2062\201\301\236\331\356j\375\n\177NE\312\010>m!k\331`\027\020\277D[\363\312\246g\330\322\312\307\002G\036\302X\376`\245\006\366\351*\313\220\0174\217\2741\311bM\033\231\003\256\256\202+d\t\344s\305\026\017\"\254\202p\222\rH\276\347\235u\204c\232\353\310\2426F\352\261\300+1H\334\"\n\363#M\215\255\200\226c4\262k\001\316\036\360\324\013\260\027\014\330/\006Xv_W\031\\V\310\3372\360 \006=\350\232\000mV5\022+\315Sq%ub\331\374\200\330\303-\240\362\314T\271\301\005\312\201\273\013\245_/f\213hu\240d\210\312/\371j\277\037s\346`~\207)\016\227\025\001r\316g\277\023)\314\343\357\275i\346~\317\241`\314\354\251\347=\353\000e\036t\035\235d\344\226\322$\253\243\r\210~b\207\016P\300e\212.*\363j\030U\033\033N\230\002\202\216R\212\330\216\324\016\005\301\"$\356^\363#\021\325\027m\355\363\"_\223\260\202_VpxZ\231\252\212\374\034W0X\344\305\240\233\311Bqh7)\3244\242\252\214\264\2248X\276\014\205\000\354\314w=\353\322N\013\205\025\217\3347\\@C\267*\301\263\027\3713xA\257PH8\370\206\203\217K_\025\305\032\250\207\302\247Y\341\000\374\256\002H\230\033\021\303\330\023(\t\240\213\014\340\177\271)\277\346$E\277\367\336\217\361>K\341\242e{\020\335\241\222e.\307Yf\360\007$\270x\331\013aA\255w\020\0277i\351x\217\221\274F\261\244\355\242\323\304,9}\260\343\030\343\256\014\203\253\273H\210\351\374\347\337p\265\274\256AdB\212\213\200v\235J\021\243\270@\340)4\214/\245\267\321\364p\372\004u\335F!t\341&XO\303\330\227K\255EN\202\216\305|\204\373;=\365\332\024\310\321\236O\201Ou\036.\023\022P\362\327\225\336\r\214\304\341\023\344\307\027\216\324?-G\232\362\021\177\010\004\327\005\365\021\245t\352\212\204s\014\356S\316\215\251\034\312\031\272\260u\236\362\340\222z \250\271\212YP~~y\317\2132\347>%fP\215\233\3338\371\343\2429\241\334\241,\3745\030\000\264\304f\247Ss\277\272\tn\217\320\310\244\247\362\320\274\322HPn\243\277v\275\010>\334C\252\354\261E\013T\320\331\334\217\307Z\365\306,\220\267\302\241\215vd\036\223(\341\263\346^\333:8\024\300 \263P&\270D\252U\240\021\240\032Qb\352\213\034\304\300dnE""A6\250-\372\307\265^\006,\253\224<\200\010E\006\224\262jm<EU\223\266\024\333\310l]\010\3609\356-(1@V4\365\315\241\n\347\347w/jo>\322\013\316\345\022\247\344\034\252/\212\355\341X \3711-\337\021\010\004$&=\027\224\265\223_\354\236\205\271<s\324\255\243\010\027\320D\214\263!G\353\0328\312\215\356\344\265\255\335\275\002\177\244\232\272\234\226\242R\\\340G23\372\020\340)Q\336-\266\260$\206\326\026:rB\024\251q\264N<\2410\371P\030\242M\303\277\265hJ\310\205\224u\241\014<}Z\250be78Jw\360\353\321\354\350\231r\217\010^+\223\003cG\177\335R=\324R\301Z\320\022\206\343L\257\335\330\327\263M\352\274\rX\324\337\217j\206\305\305\204\020\310\376\211\013\234\304\255p\267\270\351-5\277\217?\271\235\205n\337\263\335v\003\340\020\016i\2610\211\277\340*\346\326~l\003\252H\001\367o\004N1\006.\365\017\\\231\310\325T\002\347 \340\002F \255\024\270\362\r\\\rR\302\007\271\242\300k\376z\327\003\254\212a\327u\374\355\372K\270n\024!\237\316\266\250\300\307\266/\203\226\302\000\305l'j\177q\313;)\212\251\312\236\315)\t\306T\024\357\013C\302$\340\247)\030&\206\025F\217\037\014\366\350\276\014\010\354c\nu\251\300\215J\26122D\001\226\366\025\216\357K\221q\"\035\211\302\230\225\250\031\306\264\264\223\343\360\316\225W|oD\342=\221\371\260\323\253\330\3317v\354\360I\206\347y8\365_'\243\201\226\363\276\231x\026\273\223\266TM\233X\255\345\370\3608m\350\000\245\365\315U\\\367C\334\367'j\351\032e{\362\230\243H\246\262nn\247$\325\021.\236\204\334I\220\r\257\233\255\327}\\u\007\327/^\235\277\270\351\354\312\242\252\377a)\tZ\240\357+\260\213rM\217p\261bC\313$\210\321\317G\n\025\216q\370\364;\351D\334\022\212k\017\305\313\224\025\032\255\264\3161,\207\301\2027%\006\3427\006\036\234Vl\003\214\366\225\0255jh\r\200\017pv\345\245\345BB\023\220\361;x\372\231{\252\260\265\314$\3670\377\274{\265)\243\252\370\344\335\361)\205\351#\232\024\323o\204,\241YC\316\327~\340\247e\251\321$D\006\327\254hdq\006\244\373f(c\234\362\000 \362]\026\257\257\214m?\\\346Oc\316\271m\224j\025\0330\203\003\301\020<\022\266\336H4I\212QQ""\032\353\303\357\254\242L[\\\274#\023[\244B\303\366[\201W\373h\r\030B\342\263\224D\022v\312\323\330\300`;\354\006l:O\003\327\215O\334\244\277h\0240\256\027\355H\017fBSncHg8\314#\001 k?83\177\265v\214\375\021\n\215\024p\360\305\233\337m\370\353{\240\351\201\310S\010CP\306\275\236\303\235\025hW\230oZ\230V\027\3067\364oZ\244\213#\244\342c\2536\200\351K\301t\227\230\3666\301\250\273 5H\217 !\230\005\000\352\374\004'\360jJX\200\352\375\353\250Ykb20 $\204`5\305\341\302\351!\250\032\006\356\264y\250@s\266(\324h\325j\037e\2513\375\332T\353\320aI\235\005\326Z\233\035\270\336\254\347W\337B\341\240\305T9\233r\253Yc\257\004w\003\007qKDi\2001\017q\230?_\326\222Y\035\352\226\003\346sB\307(c0\322\024;\005\217\224\241a\003%\213$\324c\246k\342J\376\305\255\362\243ON\274\214\014%\3325\240D42\362\257\007\317#\324\273l\366\341:\n` iPl\361\013*o\305S\260(U\232)\273\243\031\005\357\360\243\005\213t5\201r\252s\022\333(D\311\314O\366\245\203\334\034\220$\357mE\271\245\223\256z\321y\002\326\344\313H\303\216n\347\244\277t\307m{\273s\300\t#\234\350\357\263\\Ke\260\203W\031\242\374\010T\2443c\036\017bt\220\244>\020,=)\302M\250\027\027\020\324] \313\230}\037\270A\"\264\363\365{\210c\027X\276$\254\326\323\315E;\225\034\243\347\336\2649\007\314\201;\354\2009I\\\201C\004\251\007\345\253\263\376\222\366\341\330\277\212\332t8\255\231\257pX\177\303c\275\204\010\000K\356\245H\361\"c\277Q\200\303I8\305D'\211\232\223\300\021'\312.@\211`q,\215\342\236J\315\212\273]\200.\251\226\023 \202\303\305\275e\016a\224\2077\334\262@\230\211\243\337~\\\374r\3135\355\221\307(y\220\325\356\264zwp\242\005z\304U\256\247\344\321-\037\316\323\201\246\0103\362\322\205d?+\324Q\000\003\203\026\374\367\371\263\201\372\034\224\267}\007\026\346\315\300p$\223\311<\316\004\223\303T\334f\313\314\030w\354,\035\007\277:\271\211\001\024\333\263\273w\313\356[\251\203\232\347\t\266;\273\001@\244\250\220\362~\253\343jY\254\255G\030d\010\031\304\332\031\264\266\256b$\031\262\223|A$7\016\010'^\376rc\231\247\330\347\317(\032yj\322g\233""\332s\016\236\322\203G\232\254\304JU2\204\327\314\220\337\013\326%\026&P\001\274J\035\032Avv\3650\235J\362|\003K\037\030\325g+\366-\336>\374:,[@\236)\261G\300g@k!}\200V\371o?\216\212\003\230\235zg\336`+\207Y\005\t\276\225\250z\036\266qLV'\177\235\314\376\007\370)\245\020\264\210\210\377-1\376\340\231?\014{Y\325\000XoW\000\024\3624Z\323\253\314\364\026\370{\037.\014\340\343\234X\021\333\365d\310\222_RQQu\362\264\215\371\023[;\341_\017\246\002\316\205{\025\215S\231,k\270\021\223\2128\233X\341\311:\274\312 c;\315\230\035\220e\37115\034\253\362/\366\242\036\313p\030O\014\260|`\350s\377X\203\360\025\231~_BbK\330B/\317]3\22522\356G\261V0Sx3\221\000\252\214\220\014\260\350\003A\006\217Q\376\337;\001\264\342\261:\260e\227\202^\204\376\304:4\212C\005\226\320\244|\327\0234\306TG\265\013\266\021W\245^\035\355I\254W\350\245\032D\347\322\233%\026\301\005&\220[\362\007c8r\321z\020^\204\375J\221\013\211\231\276\277\325\016.\245\035\302:\220X\3437~\037.\007\357r\303\237\300\333>\235\245\205\216\\\242\352+\275\273o@\221\0132\034r\225`\n\000Q\361\315!;u\251\273\336y\322$\316\257\311\324\264\201?\332\355/i\017*Q\244=\272\230\007\002A\215\313\"\021\213\352\242\006\362O{\014\t6\030\202c\304\244\021\255]\224\210\262\306\030\317t\207\250\225R[\327{!h'\255`A\n\371\222\247\240\247Q\322\210\364\353\212\263\030)\266\250pIR\202\272\360\311L\331\222\330\264\023W\262\356\344i\226r\310D&\244\332&:\032\204\251\344\000k\205b\031A'\365\314\272\236\314\262\"\206z\233g\r\334Ic\254xu\304#\377\254<,\332\026M\365$,_\372\2559\207I\231\006\335\374\353\002\206CU\334\214>\356\215e\3118U8\362C\013\201\222\324\204\256\000\252\r\243\251Q\260L\327@\013\3639n7\231\305\226\351l\304G\244/O\304\222\002\330\200\320\2041T\026\032>A\254\373}hJP\336wS\375!\037\340\234\325;Ey\267\023\022\344\206\231\031\251$4<\303o\010\207\220\306\276\001\224\003\353\357\214\0010(\014\360\"\263\0135\227\"U\365Q\205\247\371x,D\350\332\327\2114QS\033bX\177\211\305<S\263B\264\242\356q\205\250N\226\234\025\205\023\217K8\345 <\206\323}@m-p$""\201dg\350\022\300>\276w\"\202\343\006\324\257Y\031o\250\375\324\020\353\344%\333\233(\321\031\333\n&\332\263\212\206\234! \253\231\252\234a\206\334\010\rW\023\216\205\305b\016\013\316\t\037\216\024D\303o\226C_/$:]\344\033\353\326\004-\237\332J\000\342\315|\201N\260a\242\341\\&\234!\350-\302A\3045\2700eT\237\225\233\373\275\305\026H\342!\316$\356\252\201\2765\\\356\225\372\231\367\375KR\326A\352\212\324\360_\233%_a+\241>I\306\217s\013NE\006\\*\026\345\232c\031\350\\\240\206\312\271\374\237\337\316\365\017 \206~\020\035\344\033\314\310\024q\331\002\025\274\246[k\340\3538N\361\271\020\357\001\006\221\265\207Ea\202\331\304Og\217\262e;0v\256\301\333V\016\221\005V\313\300\322\233{7\346\213q7GfC\234A\007Y\0368FvGD\301\016\305CZ0\212\367\374h\237\375\230\303\204\350\317\337\3421\\\002\224O-\214J(g\013\254R`\310rE#j\214\210@e\t\346\007_\363\263\005`\007\200\026\310\220\316(m\246\241 /\364\334\003x\356\223#\363\024\303\221K\032\353f\020\031\214\240\311i\030\210\025\013\211\274\235\316\024\031\322\363\206\177 \370\341\217OY\202V)\0072D9\336\212\366\300\301dFz\206\242\025*5\317\260\357\351\256Z\224m$\023\317\0266J\342Q.\342\010\225a\314-\240\240\363+\342o\336\000/\351\037S\362q\245(\364\255=\013`S\357\320\000\310\321,\365\026\227t\264C\273\343\202\022\371\037\221\314\265g\301\241g\240\325\350_\236\016,+\315n\267\323\202\025\010i6\344\367:\024\245\225\224\304@1`A\230\321g\346\26470b8\255A\021\016\220h+>\222\t\316\220n\254\271\371\266\332\030?\343\245\372\216\366\347\321\305!Fp\247P\227\245IO\020\232\311@\215\263\210\325b\264mR\2715#\341\364\031\272\374GT~\275\333\033=\026\274=\360\030\032\371\333-`\233 x42\333\014\372\241\313\370\261R\346tt\220\275\347\reX\337\221M\320h\224\027\304\022C\210e\240\214\233R\347\021b\003\221\001\027\354Y\310\303g\253'\303\277\3510\204E\316\225\207\373r4!\347\020\003\236\t\010\352\\\224c\353k\372\0341\220C8X\301rG\037\311\003h%S\245\244\034!(1\204\347\216\034\360\327\006S\307\372\234\260#\253\033\016\210\024\000|]4`\236\236j;\016\t\350|\334\256\220%""\220E\004\321\361\017\021\245*\020\356\360*X\204\342B\262\\.\300\024\221\376:|\335\335\353\214M\202\200\036\240kb\327\203\225MAR\322\034\214\262h\271\204\234:\002\337SGw\261\320\331\277\303|k\321*\035\2748\224KI;Ax\255C7\322\363\255\366\304n\217l\354\315<\t\277\025\004-\356\214@b\262\323\0357J\340G\032\2659\256\361\271\337Lu\314\254\3214\324DV\237\332M\"\022\237S\307\005\212:\t\247E\235BN#\344\350i\355\340Ts\212\204<\245-\225\272\261\321\224^8\352\231n\032\337\355\005\307\232\324\342\272p3\004\277\356)\034~b\264\262\371_<k\023\312W\341\232\322\375\\\301\336q\366E\331\207\225\277\256k\312\253\252t\340\216\225\353\r\241m\303*\350\204\330\232\266 g\322\337\031\035y(w\003\003\305(\374\r\202im\312\272\013\363\216\013X-\354\353\257\255\206\311\260\321!\231\014J\362xwp\014Cg\020\277\332u\270/\032\034\013)\327\003\035\023\035\317\320l\302\211P\2751\024\205\027^\344V\021S\r\373\232d\030\362\321\305\353\216)\330\330f\316\271W\335Mj\002E\025\2437\006.z\310\275\010\014\304\346\035\3546H\3475A\035\201Q\017\2766\274!\000\342\302\005\013\320\347U\177a`\263\021\002h1?\237\376\027\001\254\377\223w\\\002\201\256\250\241_\014Q\010\001\342\030B\010!D\300 ?\"\020\034\010\006A,\307q,\007R\216I\205\246d6I\245\003\217K\356?\236#\333w\203@U\342\207z\3125\340g\210\350m\360\360G9\370\027\001Z\250\260\360\201:(a\242\262\034\373\225\266n\312u\371\251y&\305\373\244\264M\347\2034\235\n\315sv\236\013@\"\371\220\347\334\265\t\321\3127J)v\350q\335\207Sw\260\373qy\377\322M\2537q=(Nh\301B4K\200\267\323\277\225\314\315\236*\310\354\r\262\203\220\271'd\"A\0262d\002\207\314\375\220%7\273?\316\256\020\310\"\200\346N\353\263\317\257\336\244/*o\006gh\217\313\370\274\276\366\256\013{&A\321L\233\335\217XA\017Dpt\347\240I\343ab\307\213W\310\361\313hx\2165\r\034R\013\004h\271!\306;\276G\217\360\2210>\336\312G\355\355\221\304|\327\270.\257\373\275W\353&\365\020'#\237&\321\2375$\300\307WH\343\273E\311\t\320\245G3\0365\023\346\027\243U\210\231T\\_Z\264\014\325\2269\341\332[\227a$\331\276\343\217\002\263\377\265A""\224U\nN'\274)\032p\204\002\034Q\022\307J\377@\017\223\002\315\363\310XD\372\200\364\303\343\023\352\221e\016\211\314\307]L\235U\364%\276\343\251(\216v\323\210\341<\304\304.1\335\246(\327)\022!\371\016\205\363\344/\225\234;\024\211\263O\316g\\v=\345\202\270q\370\307\336\242;\210k\226A\002\236U\013`h9P\303\214\373\341'\\\303\260\264\310Kk\204L\353:\213y`e;\255\220O\313\302\264\304\227\032yI\313K\251\0325\370\317s\377\324\024|\001\177\027\306\221\306r$\201\216\256L\213\213\321\342\271\322\205YZ\010\227V\260\336\263\365\266vaV\003\240e\374\352\216\342\365d5\350\216\004\352^\372M\326s\343'\371\361'\214\374\333\223\177t\345\337 \366\3473\377r\243\271\240\205\202\361\227G\303\246\344\212R\256\344N\245\031\354\257-\366O*\227\261r\257\227 8\023\374u\023\014\342\302\261\227\347\236\005f<\313\r\244\003\214K\334y\250\352\207\250\204$*\350\023\325\256\212\312\264\250~\030\225\r\006$\234\023\325KEu[TwvjF\305\350\222=r]s\353\023\271|\213\354\274\336\276Wm\217F\360&z\275:S\031\034\211 6\225\322\246\310m\n\352\246\256\200\221\261}\022,'\331\275\026\007F\3114\362+Y\224\230\354lK\265\341R\275\271T\266K\245i\204\270\215\340q\230\003p`\004\350@\202ld\tD\214\027\220\n\020\244\330A\312\251\220z4\244Xk<;lQw\025\021P}\214Ls!\321I\")\375\360\r \006\017\304d\030\304\371\2048%\r!\331\303\227\3519\370\242\310E\330\233\316\003\303\303\016\360C\310Xb\266\217\213f\342\377~GR%\267\362\273\022,\341fy\262,\305<\224\363T\345\363\344DO\252\364\264\201z\202VOQ\342q\007|\370\201\372}\236\245\203[\3368\026\216\024\230\216\313\246B\233\212|\260x/\324\030\021\355\023\244\275\306\264gP\2739\252]\300\332'\\\273%\260\2350\262\275\306j7$\002{\307j\000\254Mx\230\021\006\236\245c\276\006\344\031a\355\365\2631\tj{\326\243S;\316\037p\"\3179D\376\242\220\367\005woht\236H\347Z\351\364d:\t\210\223\202b\333Q\006q\305H\334\201\205\242\30724\020%X\311\000\000\222E\366\311\241?yNF28\324\373(\302\306\243\024\023g\277V\262\365\206:1\242\036TE=\255\214zIG\275\033R\367\300FvlT\032\331\300\006N\243 \333\310Xk\315k\203;\3405""\372\360F\215\275\321W\277\021\232l\224\023\216\214\017G\024\267\370\277\252\354X\004D\237\300\245XD#\000RM'\034Pos$\304JY\202`9\251\240\305g\002\006\207\265\323\233\013\335?\221QU\325\240\217\204\002\001\030\020\002\rA\200qxQ\244\031\305\030c\024\233{\373\335\251\223\333\247\272\273)<\204\n\241UH\241\n4\201\327\353\246\007Y]\014\261J\311\352H\"\006f9?\374\360\362\033w\204\027\354\032n\230\243\246\375u\227\333]\233\025G\262O\217\331e_\211\357CfQy\326to\377,\227\022\376m\371\355\013N{\250\246\362\271\356}=\377\263Q\3564cW\216\301\316\316\236\234\322\033\3073\201\256\250\361\352&i\r1\020\004r\306 \243\2201\010\357\301,\352\240\021\022\031I\222\024\n\303\030\347\247O\343]\262\362v\330\367\270\207\360R\217\320\021\213<[\021b\330\277\322\323\303m\346\353\214\217`1\t\350\005\037jX\366\255pK\346\232c0Q\235\202\2422\225Bmy@%I\213@\237\204A\347CN\201N\251\375Ud>f\325\363P\240N\347\276\\\210U\230\305\334\006\271I\351\014\017n\246\357\255\003\026\211\224CM\332=\001\023\010\004|\017\347\305\003\353\304\201_K41\036\341\371\343\277\347z>\344!:[\311\260@\205c\003|Oo\275\033\024\321\034in\013\177\344\220\002\021/\364\301Tp\n\314ttM\330\207v\250c$F\311\213\334\005:\236\205\002\301,\231\253\372y\314\345\267\265W\037\rs\330\256H\207\331\006\277\374g\000 \036TE)\273\231\254gg\201\003Yv\326\271@\007\306\242\225\353\210\322--\365\177\335\024T\250MJ\256\024\341 \245/r\351\227/\2066\242~\023h\245>\266h\330F\272\322\317Tq\266\345\361\331\340\r, \002\024\020\201\"&\354{\222\214\2357g\344\255 \000\302\305\375\244\242\250,\262BL%\223\246\250R^\302\342f\312<;\3502Q\225;\325\227\264\231\301\360-\225K<\235,Q\351\020\321(\213vw+\242T\2143\370o`I&\362w\242L\343\2117\211\321*\025c\206|\323\275\243P\376\206\000\216\243V\032\341|9{\343)\034M\323y\371W\235\005\255e\206\346o\270y2\271\033\247\027~\233\217\362\337?\036\204\235\327\327`\036[\211fU\201f\370\276\306\376\374\320\201\317v\\\314P\200\312h\251\033'\204\334\266\2039\271\243\001S\237;\324\246\237T\033Z\316H\000\307*Z\276z\221\312\303\314\374q""\022\375\312\350\004\322\2573h\016\200\353Q.b\207)&\005O\257\013\032\331\233\251L\031\370\005k9X\211H\nTp=\3568h\004c\362X\230&gF=\272\274:\030\376\240\320\300\247\365\226V\250a\220\033\346r\360\217@\370\335Ix@(\274\037\026~\0370<\314\004\320k\000\334\213+H\245\3763\"0\242\231}9\300\355\355\373f\247\037\264\314\344\275\342\000<\202\277\274}[X\033\261\305\207\352\036\212\270\004\315\035\022b\000\307D%q6\316R#\340(\025\347Q\320w\332\023\350\200\365\306\243\307\224Gb\206m\230\221*\017\004\205\372\346\010\001E\233\025m\207\273~/\000\032M\2501\350\301p\215/\371\027\253&\376\354\260)\327J\301c`\306\353\245\250m\025\324\362\276|\2217\374\\\201\252\366\n\352p\260\340\023\007l\023 \007O\242,\264\201\342\340\204\246\227\rM\362\210f\317\232Fu\2720\337\365P.\211\303~\275\221\347\000\301\313\321\374\204q.a\246\371\347\205\016=#g\315\352<\333\355Y\322y\314\213\311Y\263\342\t\276d\027\231\016\013\234rq\000\371\254\365[&y\356\320\032\352F\277%O}Ix\035\365\020\277\343w\333\247n\313\322\360\267\364~\021<\230\323\r\260\311\264Z\014E\300\354\251\021\231>\314\035Q\201\243\023\023\205\244\223\204L\017v|\253\366\231\231\230E#\370\227\037\003 \344]\016\310\330Ca\272\317\302\244\017\336\333z)\222|\017\033\325&'\317\216>\022\223*\344\266\2148?n\357\351\334\276\207\017\235\270\247\273\207\304\274\24733\215\020\260D?c\032#\314=\235o\304{\201\252\330\027T%\223\rLd.\021\262\230\213y\027\246\352\010\234Z\000JM\370\020;\000\327\016\374\377\227\225\340\276~\251\343\373\272\257\373\272\257\373\272\257\277\001;v\235\212\033\302s\302\n\250\355\307\224\340;|L\t\346dL\221\232\236u\005A5=5\306\005\t\"J\022\001\001\371\000\374\000\333\206v\014\210\017\241\372\360\312\003\216\332\206v\016\336s\2439\023\020\234\360\256\321\312|\313GL\337N\267\253Y\235\314o\376a\267j\303zC\007\363\221\3312\021\016\234\254\376\310A\346A\234\3060\337\353=\274\3353z\366j\010\035#p\246]i\277[c\313\264l\225\252=\321\330\344\341?t\201\216\302W>\3217V)\210'\333dI\373\217\253rj|r\3611V)\333\363\215\201\252\337r\237\275\3247\235j%""\246\002\201\363\365\255\367\351m\367\341-\027\340({\335\022\n\037\345\360\276m\243n\265\023\363e&\0208U-#p\256\261\017\343c\314>\304*\305z\242\233\246\372M 8\025K\3560\247(\3112t\201\303\230\230\337J\212\317\007c\204\204\031\n[P\220=\301\234\027\226F\341\022\275C\0278\374\001}0\310w(lAyau\300\341\017h$\362\r}0\310\227g\004\"R\322(r\002\267\034\253\213Y \257\273G\2678rO\302*\005{\332\324\374\032\367\037\233!\261/\342G\240\035Ws\242\376\325\177H\332\245yr\313\267?41K\344\016\026H\017\350W\3561\rx\317\265\271\213OXw+U\275\224\306\354\372\327\331\237E\221\254\314\003\265\027\360\327\022#\307\215\373G\355i\357\301\232\266J\351\202>~\334\266\315\372c\037H\375\257\253:\314/\216:B\365\005\266\035+\000\211\223\341,\216r\035\333\217\264\344\336\250)H4p\036\242fiT\303\010\242\326\230\251od\260\304\215K\375\n\345\034\033\251_\375$\2431\236i\207\361\235\332\201\255\226\320\016\253\367\350H\013\225\247\374\267o\236\240\317\024\177\221\370\211\276\257\3061\037\304[\334\335\354\2665|53\034D9|Uw\344\206\003\347\252\3716]B\276\352c=h\267\232`\376\362\220\255n\035,\247\334bb\253\001\357\177g\376\214\311\037\351\0322\347\332d\362%\266o\323\001z\204i\240r\ndh\225\2063R\361eIT\217\013\242\"\360\007\233\033\362\217\271\032\363@\036\256|\267\346\006UT\353Y\237\354oo\241\035\250r\264\\\031[2\253\230A\242rQk\274\363 \267\177K\352\232$\225\010n\260j\007\325\177]0l\327d\311U\367u.\230\250\306\005Q,/n\326F\367\210\305*/\0348_?\303\2035\266\302\234\350\346\320\310%0\027\231\031\253~\330;-\333E\025\227q\314\002\240L\273\271\205Kb\316\372\312\356\370\304\352C&\376D\t\312\362\\\273\254\266\352]f\330\352\005\347\345U\345D\241\340W\251\221\\\013\300\205\340\3156\000w N\263\205\372!\343\0317\365[\205\255\367d\334\237\322di\343\037\355\267^\330\213\\\271]\254_;\362\315\365r\256\315lNz\324s\030\341cn\2632\260\316]\253\024C\354\213y34\244\305sH\350\013\361|\2367\347\347\270\337=\371.=\331\353<\231\336\023@\010\220\002\220\202>\245RO\247\242_\244\363ub~\014\311\237\001\207\364\302*E\"\313x\341V\n\333:""\214\376\365-\331\213\002\211o\360VH\034\241\026\273\033\233G\237,=\334E\274\352\205z\\^{\233\3138x\341\204\275K(\350\007\355\374\035\225\177\343Gl\315\264y\221\013\342\335\360\212\225\226S\275L\367!\002AP\332\2462v\305\275\341Q\221e\365\214{\370tt\344X\236\202\363\210\261\2028\243\332\205\224T\036;2\3425\264\016\215\222Szt\033c5\217u\264T{\214g`\2430\241z\210\300\322\320\300\031\320\236)_\275\336\346\215\254\356r\341\256\361\010\243V\217\\\n\274\020\224\352\206\016\366a\273\007w\327\353\241\205\371\257&\211'v%\316\365\333,\\Ar\203\256\341\025\2209f\255\305s'\203\\\250\"\334N\232\032\221\221\244\244 I\007r\030\204\201\262,\3153M\245t\222\201*\343!\202\211R\216\210\214P\220\244\234\024\224J\255\001\270Q\220\365/\002\203\264jO\177\307.\234\365%eX\207p\376\025G\262\241\354\265\255 \335\016\214\357U\031\326\221S\275\361F`gaG\307\2301\006.\365\343E\307\375\001\306\304E\324\035i\357B\261P\346}r\343]\002\261p&\314\200o;\252\267'\010XDH\214<Q\231\204\335i@\035\377\326s5a9\344\265u\215\221G\240\254}\2237\255\350E\366\370\227\036\3710\332\207\314h\004)X\214\210Va*D\327\246\224\010\356\325%2<\273=\221\246$\270\207\266_\013\215\351\260\206\366\324\250C\351\265\372\260\253y5BJ\005\327p\251\330\033\316E3\241\032\020\275\036\001_\373\n\376?\207\026z\004\".3\313+P\376\004\030\324\351\277\003\2250)\237\353?~\021\003}\302\2309I\314aS[\0202+\001\350\352*\312\020\013E6\300\276w\0175;\021\3369\347jC\"T\305\200i$\t\254\020,5\3360\025\323g\364(G0*\261\330?\202}~\362\370\375Xa\247\317\002\340\r\264\202f\253g]\2535\267\353s\215\252 5\273\230YrJ\373\205\226\262!\355\rJ\033\014.\320Q\224>\367g\231\360\360_\255\256\247`\233\222\002\r, \nQyX\240\347\356|k\316\003\231\341\222\355dG\274\362\272\334cS\322\375\253\236\277\332\330\250&``\006\032\210|\245P \n\340\330\301\n\002\017\277%\361\002y8k5\342\221~\215\274\245\234\024\323{j\253\\<\010[\232>5\374z\242G\201#\342WWS\253\372\352\370\366\0166\23332\252H\202\026-\241mI'\006\n\261\252\034^\332\337sw\351\271\"\234dD\340\010\344\032\2300F\271\365\237""\0054\234\237~9V\317\311:\343K{b\332V\261\006e\335.\225\370\251(\252\215p9e\233\215\315\205\201\372\021\235\310\034\3229e\300\326\335\301\247\255q\224\372\343\316\034\202*\210\323D\300\360\342\241\022\372E\177E\266I\317\313\025t\322\255\362jF\"\022\025\323\312\003\034by@G:Fz7t\355v\347\322\207\305\221J`2.\276\222y\331EO\221\024\264\035\000\342\245<\364\035$\303\207\241?wZ\\Xe\035\031!\240\032\364\241\030\023rS\036L\021\027\035\372~\255\266\260=i\027\305\027/\023\000%Fe\261w)*\311\236\244\"\034\333!J\355\226`\364\034d=\366V&\303\266\232VF\244\302\025\031lD\326\247\363\303a\267\310\3321X\216\026\354\017\037\000w<\260\270\232\216\031Z;\223(\356\326e\227\307SWx\273\035\311x\315\376z\027\274\027\003\317\256R\017?*\235\233\356\362 \243\270\205\247G\251f2\243\020*\355\023SYk\327_\357\215\021\370[\014Y\031Z\036\221JV\266\032W\255\032\023\233Ef\376\237\274\314J\254@\217Y\354_\264\253\374i\032\t\365\261n\252\255S\206 \233\246\2072rF\362\340\256ho\245Lj\201@]Dj)\362\252\362i\344_\351\300\326D5\325\267\311\327E\006L+\010<\235\373\341o0\317\203\200#+z\3522\316\270i/\323\271<\355\004\320\261\340\371\221v/b\352\230\267#Y\342\314\tai\010\263w\\\304@\\B-H\227&\033\306\2271*s\r\341\360J\304\366\352m;\254R\352A\222J\347\204\3225\246R\036\222\200O\023\200l9\347\375\271e{A\337\311\035nW\200A\332\340\255pC\222\235\307\365\354\241\250'\034\220\341\270\264\034\307\266\306Bd\014h\220\217\363\310\326\371!V\006\220\300\234\274ZAy\244\332\00267\211\005{!$l\342>j\242}\255\223\006\337\322\262,?\221\353x\336\3344\026\022\207N\271\225;F\304\272&\005\367\262\306\245\346\307\352\356\352>\212\376K\247\315\323\n-\r\305\360\003H\343!\220U\302\346$\034\204n\333\0048\214\200\334\000\224L\223\246\235.f\261s\342\314y\033\223\364\305\251\010\273\303}\270f<8;\305Y\001\361\244\210\320\270\211\230\333\212\347A\237\035\020\216\266\204\251\270\314H\t\355\337\245`;\003*\000\260\034\240\010S\262\300\024`\262)\372\201\001\025/\006\235\207\251]\334Ucr\237\025QG\025v\364\240aL\361\325\224\250u*RO\347\252\203\236k""\231\200,\212\020\362\272\326f?\373L\025\337R\334\325p\362\335\323\340\212bp\316H:}\356\021\256\233~\350\332\273A\340\347\217\022\361\225\263\263*(\3765\301\243\204\325\204\007\323\233\276\324\033\234\304P\354\024\3329U\205\365hds}A)\301\022p\242\364lC\207-F\351\264\030m\200n\265,\332\n\2425y\0139s\021\342\376\027sb\3145\357<\205\277E\274Bp\351\017X\367\310\223\225\310\016)\362F\rH\314\311\022\262J8=I\010\350i\2611\315$y\035\203\3016\020z\322\234\314'\261\347-\215\376n7\305\010\363\227\006`\2512\2212\207\351\230\204\236\t59J\213k\3248*\307RS\303\034\241Y\025\341\200w\0223&:p\336}\220T\234;c\035 \235\010\352\210\213N\004w\014\260\276\260\350\t\210\024\306\"\020%\333\217\243\247\244\2025;\300 \241\214\266\023h\313\224\301\305\263V\302\350\213[\301\374\323\267\232\324ypU\"h%\265\311\034UC\204\277\000\310\303\230\211\305\215cz\304l\361\312\374\240\371\207`\014\365Xn\327\251f\367b\350\333\374\272\017c\346\212.D2\326/\220\252\023_\301X\313\317\253\327\261\370\372\3732/\010D\270\240\326\240N\336zs\350o\322!\275t\r\025V$l\342\r\203\035\207\026e\000\263^\206\331#)\242\312\010\215\321\312W\005M\005'\353\225\276b\313\205\262\352\306\013\272\251G\034v\243\353\323V\341\360\345\033\352!\243o\231\265\351\362=\324pA\270\270\025c\3536\271\202?\352\353\037\010:\374\312\345\202\004\336\344\326\373\235\202\\7R\341\351+\026\200\n\324w\201t\215\343\324TA\374=\215].2*\340R\363o\226\352\026mDua\243\343\274\323\327\324\000oN\024\023\215\\\236\301\305\346\205w\263\026\205\335\2267\230\250\242\306M\004\r\231D\204&\030\316\213\306\033F8SF\"K\017\332L\312\212\3576\202I;\367\"o\034&\241\253&\203o@\230\033uc\375\221~v{?\013\204\267id\224\035\312\260\013-o\007\335\356\351S\342M\010\000\307h\231\225\352\326\201ry\030>\2066<\235\264\362\336wf[\373\264\324_\276r\t\324\235\000zL\034\021<\340\224u0\3141\3161p-\230\035f\207\331\361|<\037\3171\216q\216\t~\033d\341cC\364\037\316Cw\264\274\274V\204\307\036\372\240\346\210\240\374B\275\2614\305\302\263!\017z\303\006\001\376\000\000\001\356V\330'\305\332""\211\361i]\344\304_\266\210\021\244\316\001vW\237q\341\016\3302.w\271t\307\324\"\254\231\004\305v\020f\356s\361\026\330i\321\321\324\211\325E@\020\301\004'b\351\034\224\356\021\\/$\310V\035\215\203\203\242\222\242\325U\305\352\346\326\n\2539\210RM\035\000\220\212.\236qm;\342f\346n(w\206\316v\023\227m\341J\226\371s\263\344\355\221R\347\340j\000\021\331\356h<\303\346\006\325\262\345T\t]\264\337\330\322\341\376Q\r\210\\\235\232\217\274>j\220\030\314\000\206YA\201t\206m\225r\341\231\317LA\243@\251J\265\247|\342\0032\375$q\230\037\217\307\036(J\004[\262N\345\231\202\244\320@\275\032\215)1k\236a\022\365\213/\031^\244\3224\230\343@\233\213\263\200\314*\021hC\004\326\006\227uv\245\n\225\002\002\256\247\352\311\240\240\240\232\000\360,\275$\177\003\002\351\223\264\020\006\265\177\242\211\241\323\320\2004\246/f\023\025g\371\212\301k7\233\271\262\377\270\211\016\205@\023\346a\224o\323oC:VR\357z\364\266QR;$\334s\270\314\251\326\366\345\360\261^p\007YC<\360\332\\\355XE\216\244\314c>\335\023\274\017\213\267 \365hL;|\310z\226\021\030\205k\035\331\356w%\203\336\3007`\340\207\226\356[\346\032\254\233=\350L8Cj1\376\201^\241k&\304<\377)\362\"R\335\353|:x\277^&\006\027\2562\354`\357\326\272\231Kb\317\352\334\353_3\022\017!{\231\304\357\203\312\225_\341\275\300\376]y\334_\013\313\263\250\274J\374'\335\311\205\272W\250\007\350\031\303\347v\001Wc\361\033\272r\333P\360\256\325\275M\253s.\327\313\265\256\344\273\362\226\266j\273\254\246r\361\016u\215\305\n\007\314S\022\371;=\203\003s\337\023w\222\017\217\035\315\005/\016\265\366\342d\036T\2774$0Y\36198\305\273\000?eO\205\355HK$\266\036\036\254\014\000@Q\214\362\225\300\367\251\337\227_<\020i\207:\3263f\364Z\005_\320\".\345\036\367\003\376\321C\336\177{\010\267\021\246\234\342\027t\307\234Fv\216\274\237/\3653\265\003J*\347N-\336\271\036l\004\364\005e\260\037\312\014\317\312u/\346\007\266X\253vcDC\334\353a8\321\217\266|K\310\207@{\261\303\375\307@\206\341d\244m\254\030\352\370#\353}/\266b}`\306\226oU\301\3043\257^&z\346\233n\000\265\240\220""\0325g\363\233\301?\330\276\210\0261\367\324n\322{eo\331\016\345\031\033\306\205x\231\2344\215g\247s\340en\3226\266R2\027a\t\250Ls[<\335h\246\234\362\025}\320\\3_'\3128\274\007\322\351&\274\347\301.\002\ngsMs\200\320\r\304\010\000\000E\243\233\221\3239J&G$#\2226(\250\245\241i]\\X\352t\371K\215\327\300=.\202\250\025\266\301 \363\231\311O^o\031\255G\013\303\254\016\365\367\277\230\311n\031\231\251\307S6\252Y\353\271z\222\247\320M\352\211&1\262\2347rM\326\217\230\231D\005\177\367\220f\252\236Z\270\355\010\232\376\024\371\021=\304\367\021\034\247\244q2\235LI\315(\312\221\276\264\346k\210O|\340',\231\234\031\240\210\357}3\025\332u\270\016\334\335\356\343\276\355C[\230\2548\261\304\014\t2\307T4ek\314\255\200\236\271\344};\361\340vc5\224\21471\216p\257q\224m\203U\033\267\307q\236\3725b\010\331.\343\302\013y\306H\3352z\001\337\251\337\226\320}e\330\221j\202S\014\351\343\361!\246\365\353\3265\313\351u\212\302\222\"+A9lSZ\370t\276S\370\017\373'\001\327<h\035\206\270\250#\272K\256H\222\244\324\034c0\020`\200\340\340\200L0\242T\355;\263\342a1@E\001\n\005\221H\031C\216H \201\310()(I\222\014\007\2005\262\031\035\2007rTk\233\244\305TKJE\305\276\362\337\366\017\251\274\341\010h\331l\030\224A\010,\322\221\331\221\206\210\272\3127`\310O\226\346\232{\320\037\025|\230\023\\\000\370\253\373\321\037&\214\177\245\013\205\303\004T$\320\014a\224\3721\311\366\341\022.\000\002\t\342\354\314\355`\276\337u@\034K\235\014\212f5;\220\3533\222\356\360\2618\310\370\325\274IH\031\342L\000\312\316\312\n%\210\263n\242^\344\245\r\272\026\370d\362o\235\250\0317\325\200&\332*\223\034\226\251p\014HAZ\020\222\321f\261d\367C\305$&Y\370\252^\2304\005\337\230\325\330$T<@\211P\273G\304OD\014P?rQ\tP\327\031\245\335W\177e\336$\343;\234\350r\230\275\303\032\241.]j\361h\3209p>#\177\364\270Z\326q@lI2\207\321\031\213\302{\215\243x\220\027\002@!)Z\356UK\023\343\242\rT\025H\265e \310\0247l\253\"@\001\234\327\230\330\005v0\003\246\344G\335\376\312J^\017Z$+\014\251\033M\262Z\316S\232s\335\265j\375\t2(\220S\226\222nX\337""\021\306|\241@\265\036H\341\032\363\002\326\212R\233HF8\311\245oh\n\310\027\264A\tir\026|w\"\003\365\345\223\201\020$\233\300D\234\006\021=\301\260\237\356Z\214\033\342n%8\013|\016\200K\003xEf6J\276\333I\202\310\331\035\252]g3\021_\314\210N=gc]&T\371\017\337F&bn\326\324zi\326\375J\271\250z\"\313\031e\246\232]\007\364\2440#\353p\273)6\010\032\304\346]\301\222\272Q\241o4\024\r\031,\3610\014\2110n@\233\027\304Z4.<\272\214L\2209\270\322\272\216:?\0137q\r\362\316Q\300\300\372\370\327\352\372\271r\203\333,>v!\275\342EoK\316b6P\271!\307R\013-\322\214M\361n!\013h\351\3238\331-x\376\301Y:7A\265\360\004\275\307}z\264\337\230\277\004~:\314\027\250\277A\220\2030\255\342v\355B^\327\254)\220\252\220V\202\321>\243'\207df\325V\2315\266j\371\360\202\013\217\205SX=2\026-?0CP\333\034?cR\212\246\001\334bw~\260\267\234\257\313\307\317\275\010<`\204r-*P\223\356k\026o>T\352\036\002\253\254\206\226\022\337\316q\304\277\340\026\224G\215\254\276\210ya,K\004\021\323\324N\363\233\221!\341\322\345\217\225,M\370\240A@\255}\31782\007\272K\215[y\027\330\304d)9d\010m\355'1\344\r_\027\242\327\222\214\023\215\231\034\246\007\205\304eL\373\0271\rm\326o\013R\270?x\023K\000(\003\272\033,:\007\276@\n\r\024M\355D\343\342\220\216\241dy\246\367\233\353c+\353\243\035\004DA\325\312\231%F\r1\t&\335\301,P\226\314R\370\274yPm\376\227\254E,\307\021\217\022\037\311\216/^\245\365D\0203u[\270Q\362\346Fr\213\350\3730Q\277\373J\314\343\024\374^\360\210^\367\211\r\234\026s\006\336\320\023\004\032\2032m\305\327\354\027C\r\257m\360\354yfi\342_\033\202G\304\212VH ~\372R'\262\270\335\034\301\272[\207\021\272\000g\353\305%k\245W\305\263\017\347\214\254;\027p+\351p 5\342j\004\204\2123\th4\347\246\227:\262\332@\232\356\336\276\367\345\277\247C\233\006\361\201\303$\225\210\240\235\355\023\300_\217\267!\255\366\332@\"/J3\2457\252\347{v\005\201\317Gg\267*v\023\207\026K\320\341\177\021_\227\235\367R\247\231\273Fbo<9\332\374\322m\327?\262 ]\200\032\241SU\333p\234\"\\\214\226kXMd\344\244\007\310\242K\203\204l\270\262\240u+d\\]\346u""\330\025\013W&pvdI\021\230L\365-K\007\205\350\220\024\317\262\000\364\351DX\030\031\225\301\214\240\377\247}_\361\210\263\234\204\013\030T\213wx\257\311\016\366\334^\262\307\254Jx\333\003u\305/\206\370\216\214\004r%@\270\233\023\325\355\374S\036\373+\376\220\020&/\266I)\322Qz\202\344&1\351\271\034\014\345\355\215\202\227s\235\024\352\315\007kd\355F\317\246\300:[b\\\207\034f\237\251\340\216\255\020l\036-\373\263Y\242u\024\000HF\232!\347\017\257\302\033\021l\330y;\354\246\010\317\021\006/e\246W\001\242M[\376\000\327\002\374\266\231\201\017g\212'\006x\202.|\357\250\206K\373?\251c{\024=\200\2774_\014\350T\\\014\314\340\202\362\334j<.<U\301\356n\3753J*c\n8r'\303\340\2672\325R\202\341\301;p\177\377cx,+\302\322\271d]\226\203\315\250\250\2575\272\305\022\257\322y\223\013\240\325\235\264t\344i=k\274\212\035D\035\334_k\247\000(\265=^*\005\277\205\017\340l_\242!\001:\253\342*!\022\213\005\312;UYp\221d\340h,\242%b[\005\331\261Xb\273\212;\200Y\253\001\277\323\250\340\240,\t\311 $\256\254\337UdAC\345@\033\272\364\321\377\347\006h\322\376mI\237\227\242\022\275\377g\211@\002)\325\2055\252\205D\207>=QW\023\355\037\345\020\270C\227>qs\224\212\213\037\027\022\245\241\321\\\240\347\271\217\354\343Xf?e6\315\341m\003I\346\035o\001de\3350\214\376\306G\325\327&\277\227\376\305\316\213\263T{\261c\261:$\250\204\334\214\370 \010\324\270\021\325?$\24111\222\265\230\300\374t\377\356\322\007}`\360\221\306\200\304,^\266($O\017\305\247\225\320\355J\232\253v%:\260g\017-\364\245\t/^\036\236\207L\027>\265\"\352%\260C2\367\002Xk\251C\201\276/H\032\016\311\306%=%n\352\301\271\363`\300\tE x\206c\207QG}\204\003\343\266\005\033\367e\207\332=\213QR\035\023$\371\306\366SD\034Y\264\371N\205\314\340\002u\024u\017L\263_M\306)\227|\200\343\202\313\036\\\350E\213\335\204\270\271\007\3061qRd\247L\326\030\023\006-\305\272'\r[\001\010\020\312\017\344\t\023\362|xt\217\327sap\005\251\377\005\320\234c\203\276\330\200\362T\232a9\346\366L} \357Y\326\363\027\341\217\374\033\276\217\274\332\377\212$\346\236\231\337s|\343""\000\221\004\332\221\242]\300\333\334\220v\244*\250\025\323\277\332h\245>\032\213\251w\\05\303\236\251\t\023\262\256\032\0219\364\304\010,\303\032\023\265\177\351\265\026k\"\263\032I\022r\354\240\331\022*Ed\242\245\214\374}8\340\355\005\035\331\n\374\377eB\200\001\000#\260\027e<\301'y\241\021=w@\023\314\010q\003\006\222~\326\231\027\264F\250t\340\313\216\375M\354\362g\000\"\277\002M_\241\033\210\305\314\007\263\037T\225kt\351\262\251\231\320\177\3315\301\262E2\336\324\311\026\035\363^ja;$\374\350\016\327u\037\013\317\027\024<\030\201\234\234\245\365\342\377\021\006\235F\352o\312\252\221\030\321\361\0014\035\310^L)\215U=]\025?L)\000\264\\gP\023\024\203\223\013unf\230\035\265`\275\351w\210\216S\211#\237j9\323\312\305\343\304\033\244\021\274T\277\270}J\010*\010O]\016\212\"\337\300[b\020z\206\330\362g\r\r\326\004(\007\246\211\367v\221\030\2208\200\352f\373\361H&\343\014\367\221\t\013;\263\221\033E\035\244\241\265J\3638yiT\246\364C\255q\252\244\006*aB\354\202,\356\007\031\2400\366\006R\007\177\336\200\007\023\023N*\332\230,c\233\244%\361\017q\202\033r\022-\275\034\242\274\035\214)\025\255G\355l\221;:\306P\216\232\020r\036FQ\311\005.\246\205\014\322\230\023lj\365\254c*\334}\204X\3030*i\231xp@x\355\312F\306\321@\221\014\236\337\251u5\266,\217\200\252\257\360~\207\010\230\277\277\363\227\002>\345\371\311\347\265\242\344E`\024\257O\033\341\240\344\271\300G\233\310\216\205T9v\010^5\275\003\242_[L@\311\030LU\235\330\204\032!\031\201_;\311\265\366t\"{\037fg\266]R0g\247ZD\235\\\251\224\nIg\365/R\240\331\214\234R(\0244\000\345:R\350T[\360g\273\274\242r\311t\2754\230\364\036-9\r-\300\270\033U\226\005\020\010\276\301\254\211O\252?\216P\214-dtz\214\013\255\234>z\226 \366A\216\207\014\271=o\314~\306\307w/\234\245\233\314K\311B\246\361\000\363\251h\200\021\016~o?\347\203\212\033\213\270.\232\032\227\326R1\213\036H\220s\304C\217\276\266LG\035J0\007y\200t\"[d\003\356\271x\251|\201\214\250J\232\244a\316\365c\3577\032\303<TQI~\365\371Ja\342\316\036\265\311m\2265\257\n.w.J5^\355(\247\016""\271\321\204\021t\341\363\337K\324,Mi&\211\0208i\217W\250[&\3079\017\rB\022\203o\236\325\321#\362\355En8\354\033\3303R\271C\030\364\231B\364W\273\005\252L\252\021&\3411\004F0cR\023\273\022#\320lI7\350\341DAG\023\334Y\200QH\t\\\300\252\310\235_\333\270\034$\305\350\264\2047\302\206\315\200\216\354N\003\241x\264\243\r\331\214\021\025\307\323@3zW$\204B\022\242p\244\025\007\276\016'\271\020+V\220\261\320W\360\264r~\260@\016\247\257A\202y\207\003\261\036#\304\202\0350\217B\214\270Y\000\251k\322\247\214A\2169\322\336g\351CfZ\010Q\236\000 \013\257\027\347\374\021\216\303\376*\001\372\246\010\236@\033u\240\220\236\nXc\263\246G\323\245\302\366\364\327K\025\354a\371\210\251U\213\007N\307\301]\245\261\323%\264\214%\r\023\333\362Cd\334\266R\344s\2212\202\332\214\270\363\234M\014J.\322o\231\237F #\312H=V\373\031\272S\330\214j\316w,\373\213m\320l\320\237B\024\214\364Jd~\324;px8@g\361\357\336\371\261X\335tL\355W&\020\211L\324\000z$\023w9O\212\266\020(\303^\003\032T\026\207\353\210}\357\247vAD\300\203j\327_\215\220\352S\206H\340\266\\\004\001\260\025\2174\214\363\020\323\261\324\245c\"\346\221\201\354\340G>,o\037\355\266\301$kC\016R\225\217\321\243I\241\357\262\370AIt\264\260\207R\300\223\035\302\240\352\256\277\321\242ZA\237OtloH\3332\325r40\006b&=\024U\345Vp\212\327\250\014\353k\373\326\3258\330t\223{Pl\206\237\202U\337\371n\355\013\222((\027\225#\021\244t\316\250\202C\306JYb.}\325\366\312]\263\232\263w\021\002\342v\034\347\235\337\31457\214\231\320d^\007\277\231\024\2264\217z\237\326\217\327\034\205\333(\310\004\031\201\345j\304\2427)|\021\271\231\262]z?\230\216\005\267\310!\2427\213\334b;\264\03212\306\246\\\320\\\254(\204\0135\221E\217`'\2151J\372\317\232\342FT\307\233\261\026|\216\373\221bo\031\221\344\321\317\244\2353\336\001\250\254\244u\375k\247\344\236\r\376\267j\331\335a\3736\226\347'\213r\371\321\322\004\302\013\244\331{\231\2137_\321[\025\375\275\016[\013\305D\036\202P\006\036\034\270\326\252B6#\022\002\032\244\335%\235\344\266\002rBw\247\250\274j>[P\262*`\200,\267xE""\304\017\344\264\346$H\310\304\233\021\332\251\237b$\277Re\341\305\356\316\254&\202U\266\310\375\217\035\n\336\024\276B\033s\031Z\\__\274j\332\214ge8\266X\360\271G!<\334\211\270\304\t\215]!\3209V\377\251\251\335\302\342yn\346h\243\234E\335\027\242=\0002\346\013\005\215\355R\346\340\354\016`kg\264\\e\237^\337\036\303\210\006\001\254T\037\272\201\371\\\307\252E\211D\177g\023!j\226\340zC\013y\177+\027\tw\025\261\326\347e\2428\"fm\370nF\211\030\020-7\227b\254VT\232\375\264\325\262\r\247&2x\337\316\303\202\347.\221Lw\t\307\022Ha\254\264\211\340\006}f\251Z\363~a\275\026>\370t\250\rU\312a\346\300\257\037\363\026\213iU\337\026{\222Ag\271e)Yiz\274\275DrY\247\262\254\373Z\357m]\240\026\n\034j\347g\3046\016b\335\262tjB\275l\003\234\250\031\232$\177h\260\310\354\337\330\271\361\330r\333\226\351u\014\342~pNJ\240\022\310h\034\352\271?\220\013\240\276\364\357\216\033\322dmc\351z\371-\255\226\366\026\273\313`=N\303\264\340\0216!O\002m\302\272NN`x\337\313\225\365\333\272a\3502\270\353\342V\253\251\237\033:\336M\243\221B1e\261\332N\024y@6t%\240Gl\210\035zk|\3440\364\204mM{\216\003\213\336j?@\253\240\322\351\214\344\305\002\224\333\035\235\202\202y)=\3404\260i9\316\357?FR\345\301\344u\246|\353\036\"\n\251\354\037M_\006*\206\251$\2643\031\2043J\027\333\n\3703t\"\024\354wS\213zd\3048\340\253l'\250\242UX\351{\2738ch\276\036%\000T\031.\326\023\366\337E\311\354\306!\242\325\3101x\351\330\350k\245\007\217\255\3250,\364<V\315\322\222\342\341\232\005\201\211\003\212\263\202\230\262f\245\223\r\370\0138X\345\251)3`o\026a\244\307$W\320.\211\361\333\354\252\010\221!\304\352\201\310\243&\223\300\035\30460\264\234\\ga\005\0045\277\302~\342\223\005\221\264\214\341 \344*\242\026\345s#a\2135\0171\334\342\270;>\023\305\217\335_\225&\247\300\264\376\255L\"\322\376C\005z\341g\233\200<\345\016\262\253y\256\014\240\276\234\314\tf\177\3267\021\243\330\272MI\014\031\354\\9\001\3561\330\312\025o\321\314t\227d{a\243K\263\256\340X3\234\002\220\3476Y2\"E\361\030\001\331i\227\300h%\273\243\3175,\376|\302Ah\331""\021\202A\312\235\224148\305\250\236#8\360\256\344\337\270*\252o|\256J\001D\203w\233\2063E\274+\341\346\364pBZ\232\325\255ki\266&\307\205U\335\334V\3045\t.\014*O\310\032\027\010d\236\001Z\202,\035;\360\260\035\314\3000\341H\312 \017)H\032>\0026\203\251\023\215\312\006\211\257\337\027\266\261\243\2208DL\315X?#\016k\366w\225\236\236hY\256\211\262$\222D\312\330\225\370\032\"\303\001\302\001\305\001a\204-1\t\373\275\366\002\031\256\213\374\224_me]\230\241\344\024\354\373\273\206h\014?X\267\3333\240=\223\210\200i\207g\013\007(\2540\\\274\377JP\305u)\024\314\313\265\323x\0058\354\265\373\344\234\0177\233\222Y\034\247}\357\250S\204>\315\22518Tb\273\265\352\003z3\350\2636c\255\351\255\2059\275Y\214\226\025\200S\2761\037\302/\255\371\300\317\352\246!=\322\023E\324=\357\370%gL\225\014 [(\227K\034C\311Xk\270\306G#\251\336\373\232\010\357x#c\214E\336Y{U\351\273<\344\227Q\037\277\261z\r\366\233E;\206\356\376T\247\270-\330\366\026\355\010\361\303\221k\214\215\265n\265\317,.\016\307YA\200\23386-+9J!|\032\253\373\021E/\214\245N\246}\245\262q\260\r\004jk\374N\267k8\242\374\332TB$\336\313\211\301V_\331\004\020\272\263\240)\215\362\342\\\\\0059Y\343?\301\204\341\273:hh\375;p\0071%\n\371BH\267@\337B\347\336U\342*RY+\370\031\031\337\354\360K\024veV0\025\247\300DJ\251J\246\331\206\372\364B=#\317\222`\177\316\240\345S#\224W\"\274\203\371\277\321\244\211aL\273\274\372\270\215|\342\275w\334\306\013\316-x\342\316\351\227\371\307\301\343\364DDT}\025\3678>>\262^\036\370\237\312\372\223\201\341\245\027\336\326EYS\221c\306AM\360\312z\313U\260\235\304\363\")\007\031\217:E\222\214!0\007\017\027MJ|\t\211'A\372\233\227\247\304\n(\007j\334$\310W\241\263\314\t\320\006\254\004\340\2725[\264J.\t\025\276\340\247\222\342S\260\036K\341K\371\003\327\245O\030=\306\250wP\027\300\224\332\334\335\252\330\375\317\347\263\225\257\030\250\322\352\263\234;\226[\362U\037\201\214\257\374\225\212z\377\356\330H\253\237m\",\305\200%\014\354\355\007gw2V&a3\303\233\364\231\302G\246lY\244O\033@\326H\244\000\335\035\006]-""\020\3606^\202j\036\257eTO\241\223T\005K\033\\<#\r:e\335\225\225u\276\311/\003\376f\376\311\243#\276&\256\000\177\374bO=\344\003\247+\3367\"\277h\225\005\241\271\256/\302\305)\340\232\004\223\254\222A\270O\227\227\031\226V\215\331\362M\256u!\035\010\220o\r\245\277W\320\253\003QjJ?\035\205\370\332>t\372e\265\310\202s+f\272\360\0239)\230#o\270\034\302`\033\254\345\002\030l\225\212\272\344\350\263g\272\211\364r\005\0078\034\210/\213\222:\346d\307\336g\352\023EO\303\320\231\3216\254v\306\024\003\357\333\353\027\277\314\010\262\216\025p\314\033U\343\300h\302%\364\356A\232(\275\212X8\353\365\030\224b`/76\356v\273\375\267\333\237X\r\317p\222\224y\341~g\255\022\211'\034\177\215\236\315\230\032\236_\215\233\322P\210\343\220\200F\235\252\213\323\000\035\020\374TF\273y,\216B\213\253\203r\241\237\203m\257\372\023\275F\254P\257\226#x\256\033\021\332\274\3723\314h\213\330N`\353r=W\353\265O\177Mn\303\010/\224\353\212\244\221\374\274:\236}\013\016\216\271~;\331\313\337\032\246\212\177i\366W\235G\203\0351\2642\004\373\204\007\001Gu\272p\325\0220\253\n\357\226\010\277\375O\263\326\336\232\023\014P\306\r\270\023\314K\023Tb\273\356\220\354}\272\223\001\313g\347\232\240^Q\361*\243\010\225\314\335:\2128:\335\230\266^]}S\r\260\313A\255\244y2\r\275s\r\026S\331\r\250\371A\272\\(\225h\370\034\205\372\255NbB+\371\260\003{f\211\304\216\034\245\3243\267s}\237:\257Z\314\257\3204\320\365\216\306\\\2169SQ9\025D7)\177R\tp\237\033\330\342A\375~I\332\177\311\242\020\276\325E\253l\304 1Z\274\273\317\361m\033|A\234|(\214R\303\304Km\275r\223\342\t\365i}\322\310?\037r<\364%0\351\377Sm\357\237\321\t\201\355\362\016\314e\236\244\021\3636\371\212\003\254\213i\224\371\250\217^\370Y~\375-\027>\252\253L}U\277\351\016\245\247G\310\2675\237\332x\177\233\312\253>\236\373\237E\204C\331~\034i\337tuo\205j~\276M\367k \004,\230\226\266\311R5\033\2415\207:\003\366w\331D\n\254bj\230WS\370,!\003&\234\3513\217!'\010\271\314\263\335)\004K\270\363\322\334\222\004'\242Isf4\200(\247\036\237\374\014\256\\9\347\032\320,\235MCk""\240Gk.\214\301\000F\321\342x\275\223\371\025\326\251h2\326.\001X\205I\274MO\2521\330\356\345h\"\r\024\212\213\317.\\\202\374\024\246V\334\203\025\205B\302J\305\222_\004\204.y\225\274i\264fv\257\031\3546J\340\266]B\r\013\326\234:f\360\341,\262\375&[~\226\265\246!\270\213\345\302\021\0013\232l'SIKy\304\370x\307ne^\334\331\014\035\036\016\016O4*\365\244\346\250\266\221\3004\233\350KI_\323_\223i\235\017\373;q\316\365#\351\202\362KH\367R#\370c\217\267\275:;\362\007a\346i\254\035`\260\253?9\363\331\2022\324\322\2611g\216r\206\331\231@\333\231\236\367L\205\330\272\373Sm\274Zg\232wo3$-\267\344\005nB\237\224W\336pmB\002>\230\007`\346)\036\013OE\005\312\311\322/\217\276\351\251\360PPx\222I\245W\336JJ:E\303o$\267\241\245\006J2\346\377OK\372\344\203\317\223\030\003\312\251\227\250\221=\337{\352\002z2\347\016\314-\225\227\226\312/o\307\340\342\217\246\0264\236\331$#\020\376\016^\177\340h\261\363\313\301\2008\360\341\017\216,\355\025\260\375\021\316\240\177\216i\302\247!\354\251\353\021u\265\020\021\2476\334\220\332\3006\225\277\206_\002\332\235\362\264\364\371mI \"\341\031\320\302Jy\266\036\026\026\217\210\210'$\304\263\261\341\251V=\030\030Ng\214\227C\251\177\206\320\333\325dd\303\307$1Hq\276C\301\t\251\256\221\313!\325\231\032\036\355\323\377\203'\375\276\230\227\211\275\035E\245\341~\355\177\316A6\256r\377\n#\355[\376\327B\235C?\213i\0102p\324G\"cB\032\267\225@\177\322\371`\002\363\223F\244Q\315Xh\245\332\\\251\373t\213\252\224\364\365E\233\275-\337\322\356(\335\314\365\002\243\3113\rGp\320\371\303\032\032O3\343g`<\3146G\346\253\374\032\354\216\221\330\344\364\232\313\360\321U4\222l\250$6\\\261\021\010\002\2030\000\024\020\210\005\243\361\250l>\260\365\0034%\210\314\302Gq\250\021\312a\031\307\240\000\010\000@\000\030\006@\000F\000\000f6\002\203MXX\217+\000\010\242\231\227\3128\264+\251\300=}\030\302\227\235\217\214\025\267|o\223\261x-\221\376\271\227\331`\346B\246x*\013\270\277\246\001\234\203\216!\276\221\264]v\302\317PA?\334\302\2459\024\301\322\323\300;>!\0003uU+\016/""\013\203\364T\202\212\343\340\352WB\362\361\005\363fl\235\271!4 MS'\2405\224\350\327\013\212i\345\260\361\223\025\352\235:\320=\273j\032\370\203\306~\222\311\367\225i\253i2\200\252\3348\212\314\350W%//\013\006fBd\223ch\244\r\t/\331W\275\366\376\241SN\370!\003\375_\252\356T\r\000\362\271s\247V\320\255\323ZM\251'2\300\274\3126+\367\031\223\346z\"I\270&\360\240\354\356\001R \253\223\026\027\n\026'(\241S\240\364\257\347\243\0104\033\267>\034\300\037\325U\014p\234\013)&I\262B\356.g\264\017\222\277\006\373\321d(0t$\325z\305\225\0365\023\000\036\346\313\322\033\2722\343\267\001\214\253_\330\323A+\203Q\262B\335R\275\202\342@/\";\202\374:\201\277\342L\004\222\224\230\232\264\371\005[>\2446\221\220\3653vj\013\370\346\247\025uW\327\310\360N(jT\017\346\273\315\331\347Y\301hB\020^&\351\316K\263\361g\365\023>\245\303\304\307H\"O\204\320\235\267a\245+\322\333\370\202\371\323t\030H{\004\254\315\202\312\000\343M\013\201y \324l\325\242r\027\347D\007\375\203\203\"D\327\316\216\376\234\334\261z\216\340\310\226\t5b\214\324\n\241\361\262Y\347D\360O\361\2454\341\351.\223\024.\374?K\017\230\374\346P2d\245\240\230\317\222\271\363\0269s\304-\242\205\"1\307f2\030\221\271\270QT*\255\265\3554A\007\313\341~O8\t||\360\252\332\023En\034\230\024\224 \014\245\001\017V\237\263\266\324\2101\351\235\no\237\244q\231\220RC=\337\204B|\332\332[\216y\274\033`\334f\002)O\372\353\330\305\036\226\022\201T\177<\357\374'$\353:]ZHB\267\205\216:u\362\233\220~\256\006\360\307\311pKk\234\263\370\324W/\307\344\242\244=\312Ze\264\303\271\333\302\007i\204\352\257\237\246\023\303\226\267\361\035?\032\t\023\225\tW\241\304\314\240\021D\\\315\257\0246\033\363\376\204\023\221h\024\021_1\256\031\265\275$\334\361\226\227\306\0015\264\223\016\014;\022\032\037Z\026\305\312\354P\335\201\305\025F\340\352$\315L\217\262|L\004\014<\352CM\3255\372G\205@\322\026\331\211\264f\027\273\217\310\310\000\312\253\2762N\211D\212%<\rE\033\252\2141\030\244\026\355\0251/u\016X|MV\377f\0255\350\017?=%\306\250\262\301\236 n\260\007\205/t:K\344""\353m\254/\373S)%\315R\034\275P\305\254\327\265+q$\030?n\007\346P\252\253\372\252\020\231\265\240\n\341)\372\037\230\226\353\236\251\353<\004\374\024\215\306*\220\256\003\360\235Z\322\224|_L\354\216\237L\303\362\005\213/q\022\032\332\207\270\306i\205\375\231)\336\013\010\241\001\237\023\323)$\323U\033\242\336E\226\204\3058n\327\r\305&\277\324K\353S\3472\243\215?\030\201\t}G\231o\306\016\275\314\002\226zyD\300\321\370olaM\026\263\010\240\367\013\231R*K|\374;~\223)L\265/\360\277\"\247\221[\001\370R'\322Q\314\217\210\324\354\204s\t\374$\300\031\271\007\2713/\203\022\214\027L\252E\233\3248\023c5v\344{\216Mi\215+gc\373\313\376\233P\356I\034\005\273\310V\307Ll*\\{\253\234\3518\372-\202\224\214\312\253\017z\306\367\367R\242N\3204\340\231\327\211Z\002\271\270h\355\235\203\021P+\257\033\224\026=Q\304\337\226Qc\3119\232n\004\260\235\305\2253\262\373\r\331h\357\335\340\304\014\270;\307\007\343w\337w\262\314\272\327\235\203\251\247H\300g\273\224\225\353s\335P\205\251\230<R\372,+A\027d \343PT\331\007\203K~0mP\236E\366\367_\300E#\013\3269\340\321\177E\245\261&]\257U[\363\251\"Nb\022\312>\000\027\177\034\002\317o\305\014\005Bs5\354n\301\256-\350fi\300\333<\327\0160\004E\346\241\031D\033\334.\274;\004\352\363\272\237\206\244#)9?2\332\370\244\001\311JT[\277?\030\302\0070\325\014\317\203\"\031\340kn\247\223\250\\F\244\320\342\3147ZJ\302e\235S\254(\032\263B|\177Ic/\004O?\030rEe\037~Z!uRxal\242w\310H\303\322\235\204\225\311(V[bao\310`\001\301L\207\306\337\320\010h\251K%i\326<\314\024\024\275\306\003bq\214ci;p\205\204p}\007\340\337\355\032\241\3541YO\332\036\310\352>?\227#\276\254\352\300sp\263\253\372\026N\207\177IZ.[\243\005\232\357\210\322V\253\3119\266\253\251i\335%SS;\342\023\212\350\343I\305V\0023\374\327d\250\232\3206[\270\310\001\337\240U~\217\324\331\267\331\362\004\201\24732{\244\223T\274o\241\307\224\206\256\036\375\032\303&\261\370d\313\n9\023\3667\314*\265\\\206\306\241\270\003pu\344P\323\221\324\024\034\235?\024=/#\023L\366y33\177\221\316\273\270\267\317^\376\210\223\031""\266\027\273KZ\006\351!\033J\036O\361\271\365\250$\363\342=#\213\251\324I\243\321\310+#\207\206\306Oz5\352[\363\375.\340\3053lWHui\313V\242\225\305\002\336\225JetV\300_N\032\302z\3129\226\205\345\340\273\333\260o\367m\022^\\\022eu\013_\205m\335\277\374H~Y\345\3206z:&]sM\227\364\367\007\320\360\301\271\2431e\275F\232{[\032\227\344\220+}\317U\261\213\003c\217J\341\223\377\271\315W\234\317\t/H>\231J\373P\035\020\331\200`\332\335x\326Q\263u\200\236\354\374\313\274\262\006]A\225Z\256\022\276\346\351\215\034\305NED@Lf\303\202\265\244\227^\253\254\2620\342\351b\372\340V}\344\34419,\353\025\001T\224)b=/\215N\344d\337\312\251c\350;\276=\213ZA\332\243\207\"\340\221\036f\177\273\310^\254\371\266\325j{\337%\202~\370\201\027\2445\244\007[W\245\003\336\3300vIed\316\365\270\001w\006\031hXA\322L\026\344Ec\326\0162\362^A/;{\314\006\247\322Z\362\002\354\033\354\306\027-\206\r&n\360\252o5Q\211\333&\215\272\370h{n\253\"\321\003\370\350\270!\321\"\342T\234\341\016\226\210\267q\346W\205\312Q\340z\022\234\3472\254\365\327\310eI\206b\335\231\253\310\326\250\233>\230\217&\031\274,$\246\2363\325\345D\304\276\313\300\253\361_\220\n\344\353b\310\236b\037\266~R*\266\034\037\215\200\336v\273Qe\223\332\006%]V\000\352\245!\214|e\370\353~\234\222\224\307\020\0043\211\252\333\266\260\002)\275\267\006P\202T:\206\022\214\260\216-\262\210*\370\212e\216I\r7z'\247\233\010\365\326\264\352F`\002\322\013r\263\033\274T\314xN\266*+ \213=Y8#?\334![N\003BB\t\266\024K\305\t2\336\304\302\311d\337\303\004\376P\377\027\201\232Jq\225lG\363?\3514\037dz\261FDy#\004\344\251t\311!\201\214L}\312 J\313\307N\357|\322E\324\347\016!E\325\356!\322\226\321w\266\033\230;snf\n\266\210g\366- \322\251\343\304\240T\231\020S\246@\216K\347\243\302\266)~O_f\301+U\"@\3341n\037\t!(\233\020\3711\n\237\206\337\272\021:\224\000\020\314\371\303pu\274\016\232\313\252\230\3618\357QT~\n\2302\254S\270\030\276\216T\243h\241\316\266'\322\032|L\273\016\\_\204\027t\356\26454\357D\001SmU\341\342>Rj\001+\217\364K\336l\024\221\374\330\211r\241\306""\225\033eou''\315\035\327\262\002\\\206\3628H\006b\204\276G\355(H<\247q\343\013.\252N\275\253nl\240}\020\000h\2006\302&J\216\2561,\251\r\326\252\230k]\020N\210\213M8\321'\r\307\340%'\236)08h\245\nx\316\201\212\271\360.%\274t\233\316\265\210{\355M\007\005#\217\215\221\317\226\213\nm\000*\333\231\020m\230\330\376`v\274\305\223\373|\003\263\016\303o\334\302\375\323\216\233R\270E\370\304\200\n\244\331\314]\235n\021\003\014x\035\225 A\004h\244h\022\367\022'\236\353\177\326`\317u\276\324\212\230 \n\213{\233\322T\366WiKR\004E\331\265<\241\336?\333\322\270\232\367X\031\342\026v\363\024v\007\311*t-(N\256E\302F+\006\204+\336\352\366$\240f+[\224Rnd\256\367\224\372\365\001.037-\002h\023\026r\322e\226\202\260\331bj\0013\337\301\367\335\014\361:V8X\304\313Y\204\031\200\263e\265]\266\271\320\373Sb\234\252<\342\031(\341\266V~\357|:\\CD\023\013fc\310\2145\211\205\345\323\031\262\235\315\345Z\267A\002n\n;\031m\373p7\347\010\313\234\243<\254tX\235\376\372\374\363\321\354N\273k\277jj\200\211{\242\310{\266\245b\223!\246Bt\367!\262b\004\341\325\355<jj\010\313C\313L\031\325e\316\"N7F\245\330\242\301E\323\272\302R\372)\001\236%\360#,\340\034\347\272\235\342(#B\024+q\270\271\000)\346&\032\217Q\3511\217X4c_\2354\240y\337[\315\006\033r\t\222ky\254\006=\255\205\367\242\036\307k:\006\364\250\261\356\226\200\274\203\313i\242\211\377\320\236\306\034\242s?]\265\337\014\352\3567&jQ[\223\234\230z\000D\231\246\210\253.\350\351\354Gw\357@w\356\262\310\325\316\252f|\214\342R\364Zmz\026\244\020\253D\235\302\270\204\253\\\201\315<\261\250\277'6\010\247\300\240\000\344VM\315\225Py3\020K\276?\2370\373\361\207\332\035.y\032;\037\350@CO\264\203\213\017&\005;\005\302\3252\304\261'\000\016\267\334\207\202\3750\\\njo\350\016\256)/\024X\322Q_\321\232\231\004Cy\373T\220aa\356\243\3751\010\324\014\352\034\306\020VA`9\024\360\026\n\001O\225Y83\233\324\205\342\";\332D(b\277\300\245p\025\354\237\017\324\370\036P\034\351\017\311\333\322\352\260n\312S \277\014F\367bX\223\354Rc\365\265#\032\037\222\001\212.\227\334\244""\256\234\365AP\357J\316\336\2449\200\017\234Z=6\266\330\224\361\211J=^\323\006$.\001\344\252\001\311\311\0143WF\247\305\274{\226\324\247\335k\312y\206>\227\360\305\321GQ\004`\014Q\260YU\t\3663\211\203A\305\343\326\332\005k`\233\000\332\371\2476.v\035\027N5~/d)\r\332)\364=c\377U\312\254\233s\277\270K\353\r\2020\025U`o\303\323\304\215l\310\007\ts\265\356\236Q*+\232%\277\256\200V\313\005B\355\022v\304uE\235\272,\210\246\\\375\306\275\353<\243\346]3\315S\313Rk\342\021\230\035\236\354.a\207=\336>\200nF\247\372\221\340z\231\rr\243\326\343a\267xM\225e\314\227\206D\212\206\000\232r\024\231\361>\333\231\313\244\276\006~fJ\306|\265H\221\341?\375J\362g9\350\366\033\207\000\337~ \332\200,\234\212Z#h\326n{\3069\301\034\312\361\200\350HRx\023c8&Q\273\225\214\366 \267\341\022\225aA\344\247\365h\030B-\321\251V)\372G:\007\010\271q\336/@,,\013A\271\201\366Q~\007\204\0302\217\345\236\260\255\244\n%\024\346\3318\227\304\022}D\035R\304\216\245Y\222\230\363\017\2201%\002\365\254\227r#L\357\331\200\241\307\341>\006\371\214J\303\253Ov\324\372*\237\277\345/\026\254\177\013\342\332X\027\207n.\2002\325\210u|\005\211\256\266X\217\221\333w\360\321\n(&%\265\347\000\230\253\035\374\242T=+Boz\036\324\213\215\250\256'\323\320\320\266\033p\326K\272o\357\016\264-G@\305jB\312\336-x\013\300Kp\023\001%\323\255P\305\351\021\332\314h\205,'rA\\\250o\375L~}w\213\\\201p\0101%\016\346N9b\257\021]\261\332#\301\0147\340\022Yn\211x\3406\343\323~\262mA\034*'\373\270\373\360\016i\240I\344\323T\355&\337\221\177a\340\231h\205\300\323\220M\367l\227\230\241\251\243~\306\031\2761+\273\224\370\274\236\"\201\304.\343\267\247\321|\374X\013\277\t\362\007z\207\334\010b\367S\363\001\325\341\222\240\021\001\245\336\205\2672\224\252>=\255\344\366=Y\312\246\327\376\025\262\321\016\326\332\312\\GFP\336\222\215\020ETT\344P\344s\343\"\177\310\326\361\026\362ip\205\205\321dh\234\305\342F\353\277aP`\025\265=\273\233[%\366\255h\322\"v\216x\364\216\006\303\376\213\ns\372\3709\t\322D&\030\026\t\340\032\273)\"L\217\340\375Y\355\3524""\243\216\221sy\370\274\276\004O\325\312\220\014\257\014\322\226N\330|<D!|o(\002!K\266\372\342\256\032\205\334F\207l\261_\025\334\014-\333&\344\027b@\233\342Bp\305~\3563=\327\236$\276\234\365\017\270\032\374\204\243\202\030\026\\C\217g\373+9\033S\304\210\016C`\345\306\0349\030\246\226\305\343\323\036\326H\230\360\221\205\235I\302\335\226\342\246{\035\r\266\361k\257=\211\rR\304\216n\306\372\352\341\203+8\\T\364r\177\360k\203=\317hP\366\323\204\037\2407\337\304\376\270\224\351X/\020\256/\024v.7\226\240\203\344\320RU\313\200\312\031\255\245\245\205\361\031\215\3765m\370\245E\343\223|\360\005\344\025\347\245\005\240\310\004\211\335\202\305\205m(\352\211<1\211\226\277`*\321\202\354\263\310\nk\246\340\277\355\221\252\365\331\035-\351\370\321\nr\233\377:?a\334hr\024\270\216X\302\373\232\356k\007E\003\223.\023\nr;\2472\336\217\361_\360\365\036\203LEm\244\025\007 -K\271\367\002\023\031S\202U\242\207l\002\370\017\000\222_\222\312Y\030\313\271\276z\034\272\236\335P\356\317N\254\033\034sx\232H\343\321\346C\355\235\275-\200\205\202\003\342\002\253\377\315\352\362\210\n\r\016\312\3759\017s\224=\026\010M\263\356\225\251\234\243\347?`\001\007\346T\220aL\\-h?yl=T:\360n\264l\233\212j\n\311O\310jxf_'\217\202|\351\301\226\0261j\016\220\222*\312~\276\020\3779`\223\271\000\034\253\264\226\013V\230\340\034 i\275\211\257\2428\020\347R\257\264\320\212?\004\266\235H\205\210\345i\345\240j\200\"\323\224\"\316\221\317\024\013\262\364\247\rf\005\204\027\243,\n\036\025:9\203\230\224\330\262\344\357j\321<C\312\344\034\371K\037\361\025]\245D\210>Z\036+\276\024\252=\036yk\241\3015\300\270\030\313\236\267\026\267\323\245*\307\361\230\002q\r\231{\324\324\372\343\252\277}=*\3551<\205r\332\342\022\302\217ES\252\325_H\"\311\244h,\333\302\023\007\330\024\202\314\244\312\350(\353l\n\370B\310\337'\326\016\273\322\022t\372\265[B\020\031\276Q\021o\006\212Q\373\325R\337\276\203\363\371\252\010\264\352C/l\273pV\213dO\005\016Ow\022\3527\255\315\207\321\"\243!\334\\\363\336V\313&\301\316\312'\177&sJ\2642\037`\313""\204\2702{\273\037\354\245\t\036\030\220\311\326j\337@\230\266`\370\233\034\302\252\214\341\371>\032Z\037Q)\237\237?\237\356\365\221g\233\010\352\340}\026)'\304L\\A\036\021\314Z\333w\2322\252\007\204\333^h\302(\030\365\273_\023G\274\242\230|d\004\324\203M)\356(FD\000\035\340\263Z-\335K\223)\214XF\025+\223y\205w\030W\337\351\300\177J\211\266\353\230\373T\034\352\250=\210\204\242\346|\215\232wp\217\314\203Y\252%\224\"\250E\314SV\002&X\277W\261\355\010\035\2548\300\n\220Q-\222\3401\245xk7\327\n\004s\2251\247\314\373\377 \246\010\273\360\370l\2519\00794\030| \026\365)\032\241\346a\337\370\\i\360\345\010\026\255\227q\233\237\rZ\264\205\272\301\367\023\220\273b\r\375\374\346E\352\331\026\270&\214\004N\371h\223&L\245\250\307\200-\362&[\347\215\211\217\212\252\262\214~P\357wv&\257\362\2023\177\275*\345\000\311\323\272\234\223\312\227\010\245k\215G\372\026\367\323J\316\n\277(\341W\025z\017\305T\035\307\001\370)\243\034\346m\226=\3019\033\336\2758\247\014\251\357\335\252I\nf\375=\346\234\213\035\361\220\314\201[\035\236#\315\223\370\307\266\225\250\033\231)\340\332\314\372f^\2200\220\323T_Rj\272J\240IB\244\2168XGdS\"\220\026\371\033m,\367\230\2144c\221\275\202\255\377\323\341fG\354\006\330q\205h\310RI\006\326V\313\301J%\333\301\223R\254\272\007\204|\025\241\243nZ'q\374\337\024\0317&\023\277AQ\303\336\253\326\231\214j\214O\21264xX\217\252\014\343\312\370m\277j\337\006\274\354\2522B=\355<\254\316\013\236DH\374\031\360\213;\342I\337X7\"Q\217\247T\302\360\266\357\331j\304g\013\305<\233\3327|\343<\363;\302 \010Yu\002\025\327\306\r\035\213]y5\203\252\027k\331\20643dW\377\235/v\216I\241t\215\n\325\214\033\332\311].\355\212\003s\367\207\354\363,^u\322MHc\034q]\366\277\200\363\277'\240./*h\275\361r#\232\365d\332L\340)\336\347$\374lEa\243\355\206kU\224|\213\316G\003\024=\376\001&V\202N\275\214\321'\314\306\255\370\004<\315\024\302_\177V\343U \001\211\370\363\th\331\350\"\016\300\244b\026Av\225f\207\214xZ\251l\302\207\023L\232\226]\203&|\034>\345(\376\016\310z\342\374\037\327\352/\n""\352|\030\264\025\030\374\034\361\214\236Ag\242p\014\244\250V\217I\346\347Up\250)\237\307\n~~L>\235s\013\177`FEV\333\310%\020\032\330\233\346\230g\253\232\237^\014\245\004\030Kf\023\033\273eZBAy?nD\203\264:-g\017\276\027\346\nx\357\001\302y\004%t1r\362\\0y\235N\2007_\216\261\213\177\211r\212\246\366-A\320\031\331\256\177\355\250v\025\372\246\001\377\374\346H\265\002\022\201\013\025s\330\356*\340?\276\317\204w\311Aca&\0207\301C\357\362\034\254A=)\203Q\032\214\253w\215\366(\264X\325\276^\000r@\307(F\235\263\330\213\326\311\021\307\232\025\\\244\231?\246<\244\263\313\317\205tG\316\317Y$,+\272g\234\324\256\020\027\207\252\022D\226\361\205IG\242\023\334TZU\266\347$\304Q\310\007\372\r\233u\364rE\034\214\245_\376}\347uW\004\371\300\301\317\302O\270\324\247\333p\273\372\237\306)\327\006\016\200\253\336\245\351)I\275\350SC@\370\340\346\316\271\234\367\356\224x=\377t\225\007%5\361KY\211z\301\032.\324Z\231\266'1\332\036\272=\307iEX\333l\247` \325Q)\350\255.!LuU\353\341\311y'\210u\tX\316\331|m{\332]\236m\343{_\303gU\226\261\341\246XN#8\362\022\264w\027|N\371tf\267Ul\242R\330\362n\207#\245\245\364\341\261W\031{\274\305\310\272\216\246\003\t)\211\333\375N\2405\243AI\242n\360c\231n\254\350\212\300\215]9\312Y}\365s\344R\304\275P\332O{\316\225\342\332\337\035\366\323\010\204\316\347}\016\342\"\241\314M\237M\226U\240\317\350a\353\355\370\001@P\270Ah`\262n\177\306OP\355\352\375-\375\256\250\346\307\000\252#\271\321\\\010&PN\031ZW\343\256\236\373\267o\250e\3003c\212\322\370\240&\273\222K\240\346\341\210\360\223=\361\260\204Ag)\333\205=\334\\JP\201\313\017\344C\252\234j\021S\010\226\225\231V\212\020\210\025f\245\376G\315\216\3007\321n\341F\220pqU#\361\344N\371w\220ww\004\243n\016\257\326\013\337[\3200\034\276]\202\301B\030$\300I\327\252\007\242\257\212\364\277\226\036\361\322\270\177\233\372\306\327v\256;\302%\341\214\312\233T\312.E\320W\003\272\024}\000\222yTP\260>\276\2611\311\023iB\222a\024\024\216hQ\204\037U1\275g\216\217\302\025\322\213\374\310\250\022N\217\005X\023x\003\205\316v""\253Z\035\231\272\223\3409\255\320\222\022\350f\220v)m\243\224\355q\363F~\243\346e&\361b\\T\235\330\371=5\204\310U\004\203T\020\335\230\214\327\272\\\007\233\236\356\241\277\177u%\366\206\270\023\206\217?\234&\226'v\371)\\d\227td\002\374\\\316i%\036\264\342zCC%\337\217\202\026]\206;\035\270U\300[\211j\0066\200\302\351U\267mR\367\341C\210\241G\301MJ\200\202\341\021\315\304\331\221B\304\023\245Z-\370\331\243\334\027\0246\270\t9\277\304\377\315vc\374w\257\367\004\020\247\261\304\037\026\332\026\351D%\370\233\317\330\207\260\270p\304j\035\250[\236\030B\222\276\377^\227\026\261\203\035\235\341\344\r\216u\315U\361?\213L\367\\-\231\010\341\243U\344\310\3606\203B \367\250\360\354\234\000\336\324\031\366\372\003i\241\323\235\231\321\314,\305\372\320>\255e\355y$\035\366\306\326\300(\036\236\277\034{\375\340\236<\033l\350\034\273\256sXOv\243\313\271Up\306\0250xA\036@*\344_\261\332\355C\242Fo\007\324\331\265\364\342\210\230\357;)D\262\300\255B\310\327\326Q\033\307p\016\276\257\\:n_\227\261Rq\034\233\302\273\031o&\352\300\357\335\344u.\007\226G\267V\323l\274\206\313\222L\363\016\023 4:\227\200vvv\007\006\245g\250\007PW\232\352\231{N+\364]i\302\365e\257\303\324O\3156\251\336\345\342ej\3473\346\202\264\321\372\007\007\244\252\010f\322\226\233f\014\265\341\247w\022-,\331\217@\037L\220b\215\212XB\033\353<\344\344\302k\256\240\271>\204]\244\013\344c\265\017\356m\"\3166P=>b\214\313oU\321C\231\213\202\213s\253[\0371#=\3419\3044O7]Tq\026X\335s\221\262#9\006\215\227ZOcg\032\327\345\322L9\t\216\220\346B\032\311\344\303\212\367\260\343aPu\203Uz\021\217^b[U\237\222\231*l\223\002\234\322\226\341\027\304\277\001H\242\250?w\221~F\3047!:F\304\005\013CNR\004/p\226'\201P=\266w\355J\377QL\361\271\230\205\321Z;\335\024\027\256\021\217=\301k\024\330\240\222\036\362\267\214xV\341@\027\274g\343\366\006\227\240G\372\242\0327\336\305\035\332Hs\036\356\337\366\336=\3077Q[\303\005\230)\007\306\037-\2125\363\346\233\261\340\330\340\2200\315\300\345A'\264\267H\r\330\016F\010e\260\241_\236.\344 \213\331Pa<""\026\216\037bF1\255\254\320|\0055HZ\221\2278Sv\263e\332I\247\232\212`\330\220\262\006\232\303\353e\251d\r2\332\241\216\311y\213\250\247\255\346\001\005\324\204\352\215\2730$e\336]\351nB[\311\033\214\272:\014\r\231\316\370}\350\243\022\274\003\320\320O:FZ\325\271\035\241n\004J\340%\253'\323\327\320o\211\230\354\206\036\362\224\2455\nUB\251W\323\204@l\004\227\035^\316\376\205\033\357\345\317Z\262\375\327\216\330\275P\222\250,d\242\273\0373\324\367\001\311'~\324~w\3752\245\237^^K\032S\370\227\324\366\302\251\342a#\021\304.\220\202\340\266\000\225\312\225\001\035\033:Sv[\035\010\214-{=Z\004m\220'\205\363 \277\030r\337\344F\026\367P\322;\251\366\216v\344\273p\221\350n\000QG\347\373\206\200%\300#\024\230\240\374\003X\207O\362\n\360c\346\211p+s\367\017\035\212\301[ \247a\235c\330f\374am\346\335\236\303\253\360\325\005\027\007\325\333S\3541\207\006\350\006e\357%\204\023\017\305S\014\224\372I\346\013\326\013m\356T5\203\311\311\263\214\200\363%W\316Lb\214\rf9\016|*\202\260h\361\244\336\327\024A\006\254;\375%\215\032k\002e\327\271\263\222Y\014Ku\210DV1\247P\266\206\334y\257\222\252\246\322j\013\276\032\224\274%\267:9\004\001M\371\203\253$^\330`\232\340|\024\226(Z\221\234\003\025&\000\206\366Y\363\026SB\242\244\221W\017\315\005\365_\367OM\246s6-\310\205\013tJ\034p\001#\202?Y\330,\355\365\237\367\254\254\303dkE\251\345g`&\330\275\2107\200\014\241\243\227\371\337r:\036%%\236r\305\\\374\216\216\t\n\016`\314\251\320\223L\"\240\267\2241\346ka\036|u\362A\306*\305A<{\253\363\214*\307v\025\330{\304S@\242;P\twq\324\324l!Jo8\374\356a\352\256\010z\313&\236[\335\222-\033qR\020\274\323\224\270U\270\352\300\010\031\010\276F\365\321\223\253\262\354\242R\350\347\300\242{\341\342\347\312\244\315\245w\221\223\345N\217\341p\312\330\340$\254\203\036\364\177\312\277\346\314\005p\361\325\031\024\037\323%,\271\037\0006\"\022\001\202;\025\350?\006\252T\014\352\314\206\341\237}\210t\254K+\021k\365\356\344\3344\334\306\334\001\360O\260)\007t9\024\375O\344\\\024\246\006V\2056a\243P{\034\270%s#\357\207""\321N\231\272R\360\202\370\270\255Gu\275\313&\323s\006\300a\245m\334\211\276\244\311\027!3\035\001d\327\363\010Y>\275\240LA\213XlX\267z\204\002g\027\232\022\005\200\316J\346qi\214\220\233\360\334\254$\022\245UX\265\264\213\010\010\027\241\271\310\323+6\246\317\273\\(X\316\361j:YW\211X\305\"\372\272\310s\344\020V\361Z\035s\327\203\007\222\221\030S\234\375\245B\016\237\326\031\367\013Gf2\246\312\2306:q\376N\025[3\252\344u\036\364+\t\226\016?[\266&;E\370m\356\351\357\330\232\031\347\032\220\321s(~\352\330\001cm\341\244\353\327\017\334\234a \253\314\207\033^O3|\201\037xyy\226\376rI\001af\340\326\256\216A\270\277B\3403\035\357\350!/st\353\301\32441\212\336\023dwyg\246\325.#n6U\256[\224\305C_}#\341\3623w\274\251D\223\271\213:^\340H\016@\331\037e\t\314\205\225\272\2268l\315w\034,\306E\253R\235X9\363C\263\035\024\014\315\2033\250\221:\227\365\252\363\262\222\327\212v\2027T\333\021\274\246|\347\314\331s\320\342\2223\345,\312\253\017\276+\355b\257-04&\034$\235^\331\245\t\271\335\025U\307ky/uH\211$A\246\371\251ei\026l\217\031#\267\354\030\261\335\346m\227ee\204\213\326\200\223\247^\236l5\223\3165\263\342\203\237\214\344\352\026~\347\301K\241\215\354I\347\240p\177\3274\222\221\253\032|\377W\006)\376C!8\"\036\342\304\035\325.\001\006\244)\331\314(\331\014\232V\003\003\304=\025\032\222$\342\341\343\355\317\207j\3541\000\221\206\201\344\363\325\327\311@\276\023\375\275\371\212[\000\2168\357\032\323\377p\261z\217g\023\027\311\014\340G\372\306\343\021\235\301u$\215/\220\345\005\2209\023JoK\310N)bR\373\367\215\274{\013\335\252>\255\035h\246\347\216\241\007pI\347`J\220&\204\353\371\240\314q:0b\034\017\356\277VM\0055\335U\034A8{\237\264\253*G\327\022a\317\240\240}\320\023\241\372zn\252%\302\033K~\236\263\234Dp\254\216\326>\350\347\022\254D\311\010\245\306\353D\337w\031\301\010\n\353\315\250/\360\301\205}V\363|\236\256\036\340\204k\265\310QOw\340u\227\004\372p\231R\3513\313\016\336\305\234VIV1\245\272D\2718\032/S\177\265\214\024\327\223s_\245\207\346\005\030)\347T\243v`s\2713F\212l\374""\r\344\325@,\255\342\346\216(~\306\202}\260o\000\205\317\364^\201\274Mn \357\311o\343{\234}\300Z\034\365\242\375\220\204rp\312Q\316n&\0259B\326\277Q\036^\314w\251\322\202)\351]s\351\363\033MA\204\276\2077\340\352F\367w4\355\267\003\217)\221\025%)je\221\334o\375\2365Wmxg\255t(w)\236\252\215\320S\037\033+\200\325t\351\354\023\257\221\21683\266e\"w!\363\366\370%}_|\207\002\305\263\261\247q?\255n\2550\205\216\004\354\312\252\273\013\023:\352\004\312=\342\024\221\343\201\353\231aJ\305\257\246\367\246\262\373\376\342%n\210\265O>\256\267b%\211f\224\022\223\200O\322\250\251>\267\371\231)\003\323\276\2619;\244\007\026\234dI\234\342x\3424\205\317\031\272^\031|l}x\370oy\177D\006\371\006\037\246\257O)\327\\\177\312\036Y\3234\035_J\204l\200sn\211\317\204o\t\037\342\304E#B\274k-\321\316x\321-n\003\266zRi\253i\003g\262W\204x\351\200\177~%\010\361}\367`\337\000\356]\351\331g\354\3608\275$Z\206\345\232\307\230!\367\321.\377\335k;\025\003\316\364Y\202t\362?,\305<)7L\005\373\224\005\310\037\273\275h\353h\324J=cN\205%\305\266\031><\353`\031.8V \250Rj\036y\0207{b\0214\022|KQ@\333\304\326\217\241\"\344\026\000\352\0341H\377w\002\362AD\276\314\020\213e\232\316\340\244j\323\270\013\2106\014\241\"cJ\273Q\t;\213b\036s\347\262\"\035oj4\021\021\227\3407~\364\205H\253\013\264\244\352'S\302\205\220\314<\340\324/!(\360\021I\035\177Z\335\257[k\225#f\356\321\223lU\363?\261\271\236d\346S\374\n>\017\035\020h\254\243\"\017\016\023\365\027\2524\365\264\305\230\002\244r\351\020*\227\301\225\302\017\023\t3\025\256\363\242n\005\n\343\020\246!\025\207\006\007z\200\366qc\220<Mt\200\017?n\017\0306\322O\277Z\3718\212\345\243\007'r\225b\223\326\260! J\247GBdN\244\321\001\307R4\003\365J.\010\212\214W\014\300\301\223\330\323\242\371g\354\261n\355\232\016.\333\020+\230\247\346\000V\0265U\023\214?B\236\026\327\303\005\360\315a\223/\337\274\233\252x\3050\035\335+(\240\352l\377C\224\030d\224\300\245H\225\261\212uQ\307B\306\032GpE~\2606o\274\300\261\312\303\243M\325\343K\023\312Ry\346\376H\272\256\313PFe\213\031\307""\205S\235__/@\362$`\037\330G\343\010\331\226O\274\261\304*\030/\"\330\363\024\376\347NH.\346\035;\217>\007\310m\247\257v\354\331\003\275\273\304Ip\217\360\340Bl\272\375\363\032\372\364Km/\212\300'\244\315p\355\222\201d\230\313V\261\203\306\001\007Y\347\342\345=\323\2716\305x\271\201\202\313O\006y<>\312e\2407\013\321\354X\365\305\031\365\n_\232\314%U\315-\241t\177\253\335\222\321\003\264Q^*N\276\305\363\332.07iN\324\007Zo\371\366Hw\304\373\360:F\300\302'\202\305\276\315\243Oof\014\262\225&\273s_\2138\003\223\366\224\214\301\336\302\304s\276\3362+\2612\274\370\336B\036\266\032\207V\274\272\322\003\354$\255\336o+\224\006\225\016\316Sy\356\235r\027\216\030\330Zq\343gb\324\275\375\217\377\242\352\341\277\t\230\323*\234\305\302\261aN\363K2Q\211\336\003g\353O\025;\216p\254\307\205\307\317\346,-\322\336\017_/,\342D\274\3652\302@\\\342\255t\244\316\035\356\t\270\336\261\n\325V\033\303}\275<\306\247\200V\244\325\265'\361\017\022&*\350\271\214\000\241R\206\031\230\347\217\256E\320\335\022\257\200*GG\t\340\037f\313\313v\036\257\342\353\010\n\343\355jd\351K5\351\221B5\005\301\304\312wl\000RPJ\335C2\032\017}X\355AJ\275\307\036VNWaQ\373\260\365]AdA\031\236\022{}w^\215\344<fE\025p\225W\t]\351\212\000\351\360\032D\333d\377b\206<\230F\342P\224[\206\204\223p\r\205\256m:\306\306w:\n\231IF3\013\022\2358\346^\276\232*ks\210\321\357O\350[\255\371\235\225\3177\037\005\027q4\211M\335\220]\035\0022\210\336\362\236;\335?\260q\236x\335P`\367\357M\2104u\364\025\200\020\013\346yH\317g\241\357\277\336\027h\263c\336j\344Gi\352\371\301u\275\217\216>\323p\307j(\027\353\317\356\254\266\3755\312\273\357L\361?\257\226\010\024u$\371i\030\000O\035\265\035\3043\324-nV\020\025\334o\345\367\333\236r\017\260\336.\350\354A<\212\243J\346t\275}\263`PhS:b7E\353\377kR\232\000\005\031\200p\t\205\303i \347{\255\023\232\202\220RDM\2342\260\204\256O\270c\313x5\214\217\035\025O\177Y\n\1776\345\242{\237mUe\301\351\323h\033\242`\"\304\256\323\242\342\324\350=\275\177H\004\303\216\215\035\220UP\355pH\307\003\216\027\247z"".\nPT\376\013Kl\234Q\013Y\326\023\354\270\306.\270<b\354kz&8\314\342TA\261\360\201\230=\354db\022\277\224?\243N\206\232\272f\305,@E2\310\372\300s\350\017\211\251'c2@\325\342\254@\337V\300m\367\312\211\350\244Z0\326D\275y_\030:u\010!\240\275\274\004\031\032paD\020\205\tv9lB\266OAD\213\231W6\005\240\373\200W!b\005\335\000B\246>\342\027\336Q\n\315\221\233\325\271\026\330+\211\262I\212z~\256\321\020T\221\241D\023\325\217h\355\022m\037\246\r\200\263\027\261\206\205\023\025\006.[\340\2474H~\220&\367\177\304e\244,\201\272\323M\331Q\033\217\352l\257\241=N\371\232'\2344\005\025Nh3\n\377\023sk(\233\014\n\324 (\356\364 X\332\263\031\331\320\204\216\330\345\241]\177\224\000'4z\222o\346\225\301`\322\326\003\222\344<=|u\227\244\356\310e\"\022\344\031\351 \233\334\235\340\243\246\025\263T\361u\310\351vqU\362o\367\022z\"\201\316\357\204\365>I\316\023\274\370\260\006<K\226\375c\357\337\212\367\311\264\036\014\320\324*n\255\262\301\024\351y\200\243\341D\225\r\2042]\003\204\204A>o\350\314O\353\271\016\030\227\003\343]\230@_^\260N\232\251\377\2222\236K~\236\336c\003\275\312\026\244;\250H]6F\254\311\232~uS\276]\346\253\212\202#\202\241rJ \236p\321\220p\241\177\351\360\271\r\200\302\262\377\360\337$E@F\256L\320\260\036\214\356\364\024\256\306\177\024\354\033\247H\212\334\001\261z\004\262B\220!\342T\032Z\243\353\216\24400\357\235C`E\270<\275W$\377\256A5a]x\346\rFZ\3379\261\\~>Lh\266\253\001\335Xa\237\261FH\030\2473\016\\\347\377\371\332\265\336\032s\361\032x\254\363\210%\3164-\331\035\014\275iE\025\016%W\031\274\010\361+\005\200\035\260\233@(Mb\350\013O\r\\\235\236A\020r\254\342NT\217\005\315\240\2645\223\363\343\272\330\221s{t%]\354\346=e\005\304\221/\377\330\300\253\330u:x\325\264\006YC\306gG\021\334y\3745Yc\273F\020\353\340~*\321Y\020\250\351\276\211\215,\274\000 U\325\242\377\323\373\255\304\025\356l\275j\303<0b(\343z]C\263C\0105y\263\3147\021P\201\215\327\313jdj\300\350\347`\216]\026\034\200l\036\320\264\320\270\006\334\014I\2734K<\004dTH@5?C\267\037\223\037,\235\222\261#+\317KF\240""\213\2530D\023\300\312\233\230V\337;R\341\377\022\317\356I\373\307\2122\342\315\304\343:\271\211\320\230\\A\331s<\3179\026|p\267\254h#7\024J\177\224p\322h\007\347\027\2044\372\303\341\314\234\346\331\205\337b\\L27H\r\027X\214\007\216\216\2773Q\300\310\223BZ\030\004q\006\362\363\221\021\305P8\245\r\n\200\373V\337\016D\310\223\362|$31P\354\242a\0040d*H\311s \345\027\357<\001\266\223\376E[\323l ;\322\230\261o\271\022\007'\226\264g\314CN\256\032(g\223\230.`\334\010\253\301%\014\3362zs\370\341\3275YHhd5\013b\265[lk\373\303\243\252\253\036m\033\207v\020\034\370\343E\233#\302\372_+WN\026\3542{|64\017\362\333\026E.\202\367\304D\300 \217\350R\371E\271\266M \001X\024\2543\003Q\203\260\373&\307\005B\201\037;\277\304\210\244\"\231,Ka!\277\002\001\316\217F\204M\001&\003\324-+\031]Q:\212\3608!N\201\224Qf\3269H\036X\230\263\312\371\363\256_\3465\255@n\002\256\270WH\240U;\246\017\226\341\304ws\210\300\0148Z_\260\rPE\375x*\364\330rHS\352\002S`\353\244p\227\266l\353i\272\353\231\341\226\"\232\236\262\237\335b\317M\377\362\234\212>\\\371\360Q\366\221\276\016\230\277\2329s\277\032\255\345\355k5O\222\375\306\233\023\2177\326\314 \026\354EP\312?\"\254\007\302\001\222\303\303\002)\343\036\211\006\220\3130\016\374\201s\320\215\332\351\204\247o\344\r\240~\221\2567\005\244@\246\322\216\260<v\351\257\241[\304\014\233\234\265+\261c\212\000\210\3615\000\032\0275\265\240\232\030\034\304\372\323v\010\241\3336\372 \244MM6\355/\013_\270\270\244\256\314m\324\003\014\005\236\"\3114\236\004\257\347\373\214\337\210\361\274\r\r\367\303G\310a\0167\033\225;\013\235L9\376\212\362\214R[\254\273$\234u\235\000\241\333\374\023\203\225\211\024p\203\016m\365\266t\266c\344\005\\g\021\017\023\311\204\000\336\307i\002Z@\310\3447\332\300'\026t\235\215S\333\331\305$_\261 ]\270t\276<\345a\272\r\220\001`\225';q\363\331\351%~K/e\006\250D9\307\035\030\032\323\300\335:\014\240\034i\346\215\305]\317\245_FH\330{\277\374\350\342\200\330TNlQ\024\206\026\200C\334yj\277\010\036-\334\\\322\371\332\007\313u\303R\355\325\271\376""\214/\356\030\301\034\261\265\327u\203c\022qKQ\033\035\205\263:\257\335\213\333\020]\210\364\n*\200&\360\370\216\025t\337\343\353\030\322\230%\315f[nVz\310 Z\034\007C\033\213,s\022\036<Pq\272\315[,Y\021\005\220\312c\312\025;\177ev}\216\t\211k\320Qr%D\221\360\244R\311H\312\374.wH2\313\026\343\3644\262Q\260\004\027\340n\377\203\313^H\214\"\244\243\027\234\240\261\221\265\371R\354\025y\302\324]\265 Y\363GW%\t PT\223\342b\203\"\271\352\253\3600Oh\347zJ\016\200}A\363\322\214\360\t-M\2103\312\364\247\375\n47h\003\017\317\326\241\222_\274\220\235\333\2171\217\002=6V\020=}\362\325`\357-\236\262\242\240\226d\003\314\260L9t\230`\351\006\330\355a;\250\320\215f!'3Q\010E=K#\263R~\025\022i\236\n\202\217}\356aW\254\264\351\3560K\244&\202\314,\263,\001\3512\274\323I\317\306(\345y~\226\340r,\033\244\334\336*kD\"\3669\272\371?\277|\275\316\336\265\010\242\347\334\243\242\375)\353\205\343\221\347\231I\325\222\206\273a\216\304\232bq\226\2340\306\227;x\207\037\260\325\245\237\333\373 \242\347\374\320\251\303\355\207\202q\030\304H\244<\322=\325u\357*\214G\216$\347\245q\366\232:\276\t\004*^O\321\201\007\221u\005\313\331V$\206%\205\325E\350\347|\264\027\037[[i\266\310,\2006L\273\0345\237B:\006c\275\335&'\312{\206\207u\314W\244\262\3601\005\2707\260.L\2745f\351\035\227Tx\006\3261\032\311\305a\231\337\227t\336b`2\356\334\262\320\242a\314P\316\272\207\247\222-\365\330\302\253\212\004^'E\241u%\3648\313\216\007\222\274\177B\253\201\200\003m#j\033\035\377P\t\002\276\357\370\317P#QF\246\002\337\003\345\021c\333\341\207l\3443t\272\345\255\222\365M\177\277\0220r\347\000j;2'\243\303\320t\t\245g\255\374\002U\363\344w\t\332Q\210\355\242\n\276&q0\000\205\266\242`2\373`l\334\242\333k\203\267\244m\"1\336\334\351+\263\r\335\2628x\223\321\211A\346B]\251Db\253\002\376\373\355\251\374\330\202R\333\206\303y\241\205f\202\206\021U\274[\213\254\210S\244\242^\243X\010\336\347\350\022q\316\226\246\266\013\377a(\215\3048_\352{\010\247\021Pv\020\034\254\253W\302a)L\217V\241K\303\002\346'\372\223\257H`;\226\030\225=""\256\023\347\201\005x\334\247\3631\266\245\033k\nE\313\271U\302\265\366\350\017\031\036\340\026\271\036A\314l\225BxJ>\334z\270![q\360\335\255[\025>\202\252\256\241\261)T\317P\350\355T\225\325\243^\201c\343\004J\216\017 \234<0\365j\243?l\326\321$\226\025\330\245u\231\2572\277U\301\237\242\247\324\354x\205\244\021\371 \213;\376]\367\244\321\202\024H\360\223\360\037\275\210\001kN<\021\026\001\022\001\017\001\235\026\214y\340\366#za\231\317\216\270=\273\231V[\355\373\207\346\302\354\224Z\253\021%\001\353\005\340\301\357\220\375\237/\374\307\004\240X\377\251/x0t\225\254\022\022\206N\000\334\222\356\241qh\005C\004\r~4\203\357\013\357\306\263\225\340y{pT\244\302]+x:x\007\036\215\275h\246\376\264!g\016\217<\tZ\351\3423\370\244\355ba\246\245\300\226\006u\225g\305\243\2422\"\243\353`F\001\316\200\210\210\200\207\200\007\317v\333\361\302X\340\034\304\337\243\341\231N-\274E\204\305\370\350\013[\320\262\201\037[X\210\344.6N\367\364*\252\025\267=\265+H\352TM12`\273)t3\235\202G\365QPH\275\0166V\372\274\257\316\233%l\336\234`H\230:x^m\2079NLx\220\310N\227;\241O\034\3751E\332\321Jx\333E\002\366\341\264\352\\X\230\345\311E\"\221\307\356\0306B\030\262\343\270\360\033\0213c\236\270\303\305\367[\245\3771\353\002\271L\206c#\377\325j\273~I3n\325\250\223\2541\371\254V\257\3226m9\014\341\200B\035f\0148\261\251'\321G\362\021\026\324W\020u\373r9lQ=\207NS\002@Q;7\006\246R\317\346\263\351HJ\341{a6^\\\210\004\330\350\361\326Z\013\360~6\255\315.\031\332\376\200F\223\361\0317|\2165Fj\036c\0069)\315\221 \207\235\227\251\375\024[\2545L\031j_\367\340\037j\277#\345\014\271)j*0\343(\247.\272\335g\260U\307\007M,)\205&\247\307\r1S\235\215\216\to \021a\233Gy\364G\250\307Pb\rv+\215\337\007>\234\344\305\023\031\253\026\232\321\227\225` \372\377\016v\341Kp\343\327N\202\347\177\301\005\277\200\373\325\344/\306\347\263\003\363b\223\031\363\352\333\356\345\360\271\254\033\265\002\030\312\244\201\223RT1M=\217\215\266V\255\207\253\331\262\004\247\031\372\361{\247\014\333\\\255\030,&\323\321''\223B\tTj\204\217""\370\371\223\374\227{,\310c\215\342I\014\325\320\346$4\235\313.\220;2[\235\264\375\007\377gZ\216\002\177@\201PR+\275X\336\026\263q\034\\\372\266&\346_,\370\232\257\216\264@\230mWEob\362{%h\365Y\027B}LNB\313\267\315\327 Ke\272\266y\266\235m\343\231\2144\371EZ\201\034\303&\\\237\330\263a\266\036\360\013\275\027\301`&\261su\326\261I\234\300\374\371W\326#\364\021\320DJ\033\035.\363Q\254\202\365X\2029\222\032\326\366\374\261\221\377t\227\314\226\007\360$\252VK\353\032\377\260\352\016oG`\265V\353v\253e\017\035 \233a:\233\306\\\336\264\253\266\321`\005\366Nw{E\347\234\014,\214\360\264\312:\270\361mc\311[6U\313\262\346\254\305\202\377eN}\223\347\245;\3116\231\317\303\342\032\273j\256\373\303\306\325\266qCAD\315\204\253\375Y,|\251e\350\356Z\233?\334\036#\026\035\335&\3216\252w\n\222#\274^m\266J\347\r\266^\215\266qm\210\245F\337<\353\320\244w\2460c\207\236_\250\301\006\272G\2325g\023A\330\325\263\334\357\345#f\214\361d;:\250\004`\037\315\033\360n\010X\355\266\311\220s\312v\334\351\340\230_\3062\003\212\213\264\007\240Z\002h-\027\033Dg\034\205I\274,\245\n\272|{;\010\236`\333\252.z\305k\341\313\006\263q\262\333\277\255:\335L\303\250\351\254\343\257\023\311kZM\354\201\315>]\265\341\324\372`\251Y\245*\361\354\246gX\020\301\251\260Z#`<\227\226fk\305'\035\360\377l6\030\"Bw\312\035W\213&\266\206\306\220j[\2755C\357\3441\022\340&\007\256r\240\005K\020\034x\177)\266\024\240\027\346\264l\375\266\304\227lx\024\236\330a\204\340\316\365H<\t\322\243\220r\026\024\024\342l\266Oh\304C\336^\344\351&\216`\231\203\033\316\226\001\252\335)\237B\"\370\222m\250t\271}*\240\001\243@\010 08\030\215\206cR\271t\304\370\001$\"E\025\t\243\204\202%\002\302 4\222\241\001B @\031\000\250h\000f\000\006\333\200\000=\221\366\265\031\200\020\004{\310\030\367}\244\367\352\330!\335\303@h\335\034\262\336\227`''\343s\240!)\374\245D|b\260\246)6\261\240\365\244\202MZvBl\263\262\241\257\256\2604>+7\347\275`\304\n\017?\027t\315\312\327z\202\320\023\372L\311\340\230\205\337\004\356\273\247:\234+\205\252za\260\357c\300!""\360\025\242#\255m-\025\316\357Q\230uyH;?Q8,\367r\365\326+fL\310\307\376\024{>\233\351\262*\000\233dZ\310\237\207\276@\021\217f\307\303X^\241\356\216\360*T\311\017\310\010d\302\210\306\275\216\251\037:\321\332x\270\232\311\370P.J\326F\227\360\262n\310\307xY\300N\002\352bv!\336\237\000\230\337\244\256q\272\206>\267d\250\277\036\275\200\014p\314\025]?\251\314S\t\334\230\251\010\333\262)`\020\004#\035\0139\303\363.1\017\310E\250\350\252\036)\001\010h\007\341\n\346\222\024z\266\304\224:\261H\261\307\337\374\266\203\034\217l\205\037\024L8`\263\350\255\"\037\200\266\245.#\331\206\301\252\200Ct\007\303E\"+\037_h\316L\260[<\243\211\007\366\276\373\210\364!\240~\016\004\200{\374\335f\315&\017k\325c\2721t\3271Qx\374$\277\332\317Ev\023\225\026\262\345\220\332\227\010)\005\014$\016b\274\341eq\327=\334r\003&h\033rf\263/\243 x. \347\037\231\213\036\3575\232J\240\002\304\275h;M:e\026B\030>^\205!_\351\003Ov\232\346\350\347\315G\n~\246g\240\347\007\242J\315\371\347QY\243\235\323\251a\374\211u\215\241\254\n\363\022(\016\260?(\213\214\270\230\327\013\330I\346\204.{iS\204!\251p!e3\245\352\010\003\302\244\371\n\200\370\344\236L\357EK3\033\036\203\316r\026?\324\301-\\1\374\024\325e\374\016\017\2355h\333\346D\016@\037V\366=\222\236T1\2313\2155i\207\315\36384\253\205\"t\010\007'\221F\366\232\364\367\013\2127\r\261\233mnD=d\332\2041\370f\262O*3\350H\320'\000D\221B\210)\350\034\210p\230{\216\321\370A2BC`hrkFw@T\276\006f\304\366\211M=;\322+G\367\310H\254\367\262\310g\0250wJ\001N\251{K\252p\303\032\360?3\374r\2760\263\250>\257\354K\324\242\233:\036\355c\331\215\312H\004\305\325l|\026\313J\253Q\212\363\274\335\216\351HK\335\250V\251UnGK\261To0\026o\216At\347\337te\222\222\317\346\324\277D\217\026\027\017\364\205\\\031UC\250:\204q\2439.\200\036\270\030U*\036\r_\204\231\264\002|\027\214[\335V\364b\017\005B~\0218\321\241nW\224y\362\341\216\033\035\2070\262\323\030j\276\364[.\026\241u*u $\351i<e8\t\207a\251\255E_X,\216\006\246u\"\206\371|\021\264%\035\306\332&\2448\373\025m\356~\034\031\r\236\030[:"".WG\346\204x\235\344\335,\022\013\255\0368!\270\006\250\264\210:\365=\371\211\201\212\325Da\367%EF\254\334\304\312U\267\035\324^\340<\020\232\311]K\02139=\006m!\202\367\350g\007\252\2743R\313\003%8\212v\352\037\232\346`\226\346\324\344X\311\2124vl@\235\260\322\0020\240?\002\324\212\014%.2\343n\021\331\260\222\321Tx\214E\223*\"\265\366\346\247hH\035\2752w\334\312A6<\364K\345[m\343\273\001\003&.Hz\221d\222ai\225bK,\317\006Y\302?\367\\.C:\355wz\302\036\330\343\274\332ea\346\253\305\341\020\2121\262\33014\277H\351\317\225&\257#\nA\016\374\032\221\264\345\263\024\300\r\300\375\246\227k\317+\244\212g\224\334\373rv\031\225\273\276O_\214\357\205\205$\033i8\206m\233tf\035\342\275\033\235N\362\245\020\252\302'\274 E\242\\\037@\230\246\206\225M\220\333lmS\227t\221\210\220\225L\276\t\327\320\320^S6k\224\004q\320\020E\212\030\212j\307T\217\340\270\303\261\\)Y4p\351\316\3454xM\201\\\223\332\314\256\353@)\265\221\312\324\316\250w\354\007\036\3259h\207!A.\243\030r\202`\212\n3\351\326\032\322\340\222S\"2\013_\265<\004\267\354\014\026f\035\250\313Z\016-\242bY=i\242\360\350\334\027Y\2467\025\260.\352\021\263<9\014M+\345\032\342\2507;\\k\300\360\333\211_C\023:\t\\\215\261\224\277\256%\"jV\010W\205?\312A\010\022\202~DR$\346\35564\244\351Tz\323\255\352\225\331\022I6v\034\334\336\225\337/sb\244<\343\013\374gy\235KtW\324Q\226\014\27087\032PzxPO\225E\026B\226lv\326\260auJ\366\332\340\035\341\006},\211\262\005,%D=\177\344a\230\267sy<<\2708W\017RG\370\237q\3357\261\320\2731\202<\364\026#\213\214~\354\327W\321\343(,\\\265\003\237\222%\013NAn\022{\000\323k\020\353\n\274#\013XKw#\260\034\000\247\302\314\037\361a\006\224\"\362h]\000\316V\217\265\004h\310\266\031\334\002\301f\221\210\201\226\n\\\250\021\025\272\345\233\303=\361!\240\271*\212\240\204\236\325\003w\277\316\340\365R\376e\260\263\363\377P\253\021\243\335\303\362\267\233\324\303;a\266\306\223E\202\330\223\241\004+S|\370\355\324)/\364o\240}`\013\007\245s\177\363\3047\034\005\010\027\245\034\032\324 A\356~\220\365\213K:#\016I\366W\265""\214m\244,;w\230#uA\022\376@\275\366kYOT\213\221k\223\252\245&\373\023\313\273\010Z\243\276X9u\231\003\351$\231i\362\352:=4;/H2\364t\244a\005\250%\222_\361C\310' D\264\245\0011\376T\255Aw\225x\367\216\232\347\r\361fP-\357Q\002\036<\264\035\017G<\212\007p2\203\034\240\227w\336<\005\016\303\244\306\261v\317c\321It\255\345|\"Z\010\251\270\311\251cL\037\222\010\337\272\223\261\212\230\255L\324\013\3010m\014O/zbUP\365\007\036\333\223g\301\217\207S\006\361n\243b\006\363_^F\3603Y\335i\252\355A<2r\003\002\316\261\3623D\035Yq\222\266\003\013p\321P\323\216\232\277zP$c\327\324,\233\005\020\360/\347\234p\231v\240\205\367\212nh\002A\251\357I<\367\024\225\027eF\233\357m \2717\313R|\024\242\202\221\307F\210\371Z\225\354T\0307\201%J\260[\306\214\r\341\232\311!\336\255)-\362\241C\325s\367\336T\336%\206\226\324i\027\016\315\003J=\223\337\004\202\307'\232\202\203\307,\312\215N\353t\212\205\t+\336F=~\374\025\222aj\263\321\353%(\025\010\360!\244\211\207\325]\255\370u:\276\265|\340\236}\302\251\246\344S\377\006\2456p'\265\202\243\325!+\274\237 %<\254\262\r\362G\250\025\3679\355\007\340\330\334\306\2138\201\263k'\261\252x\010\311\030\245Sg\322\n\3473\024\227z\033v\020 \253\203Cb\226\335\25180\211\350'\352\034Tl\223d\362\217\330\032\003g\360\222Z\354\233\306\347\206V\365W\213bY\3212\014\324%\013?\267d0\247(^W l)T\302U\313\275,\300v\274}\314\337K\002\264A\246\360\206_/\320\356\241\267m\200\026\177$>\361J\025,C\275\352\356Ih|\263\326\220(\306\264p ;\311F\356!Z:\221\3175c\227H\006\336\341\204\255Q)\255\2548\024\317Z$\356\2156\035\216z\231_\020\"b0H\005\210;\266\201\350\t\273,C4\322\r\245\330\206\366\010\222p\342\020/p\0210\372\226\364\2368\272y]\366\223\036\320T \267G\227\365\232Z\211\253[\261\3604a^\024\034TE\230\237@qd\0037\261\231\274\206{\t\314=\371\333\n\3158\257R\326X/\220'\351\2664\323p/\225\224\341\223\204A\3428\302\216\371/\0307\200\235\010\267S\177M\222\222@\267\306\237\272\300\262/\t\001f\037\357N\376\265\202L\352;%\024S\324ka\202)}/X!\251\r\270n9\257l\206\006\357Us\230=\326y\017""\315\220h*M\n\245h3\322\350G\321\276\026n\316`\223\250\262{M\357dF\3644x\340\375\t\211\344h\"\243S'\210).&\261\037\324\313[eX\r\254 (g~\333S_G\326\257\003\002[b\342\336ZN\372\355t\332\267\0227\327\001\366Q\002u\177\310\370\367dO\037\216\312pdY\353\004\372Z6\250%}c\333\317\272\251\263\246\237W\321\035\345w3\271wg\304\223\253|\027\214\014g\367\376\312\233\200t\236\344\033\250\261\360\351!\227R\377b\344\204\035\to\321c#(\343\216\205v}e\3676Eu\025\024\327+B\235\314k\244\237aQ#9\247fS\317O\336q\200o\371\334L(%YJ@\243\311\036\352\261\2346|\204[\240\034\253\027T\255.R[0\254\357@)\021\021\022&^v\276\332qQ\370>\370\230\326\367^e\201n\016\244\321{U\"!\250!\202\347\020\340\0010M\343\303y\031 \324tv\277\200\224\\5\347=*O\301\204Y\243\266%\270v^. ,\325F\2562\021iN\031\317\350i\343.\030E*H\001\030\321{a?\023\210\225Ac\3358:HMV-c\205\007H\226\255\r\262\030K7\246\320\306p\2579\031\314v$\2517\252^>\272\272\223\2238Q@\214=\007\372H\265\336\371[X\262\373*\205}:\030\323\215\327\225\251\216\341b\274\353\034h\376b;\260c\234\275\021d\354P+P:`\253\327\017\024\322\374\355\351\257\004\337\364\230\237\245G\016Z(SP\300R\353\014E\304@\262@U]Z\010H\306\003l\305L\275EO\003?&\026 \351\323IH\330\202\315\3636\340[\345\200\250V\243\033\220\305\000tm\265\207\216[\304\250\023\235k\302\375\262\306\227\334J\325U\233\245\327N3\336\337\371b\010WBC\222!\035\364&\343\016&\010\302\371Hga\276*n\30270\002\311\004# \313\205\370\034)\266\243\307\242+\233p\231\37430\205j\365\365\023\261\"\374\037\023\321\352\200\213\237\244Izk\002+6%~ T\025s\345ZO+)\365\002\261}^Ar\030\016\230\206\250Z@\321`d\027\32485\307\206\204\377%}\022\236\376\252c\3152\016ob\2448\373}\312c\244\200$$Zc\351s\346\010\357Q0\303\335\216\307o\251\221\201\03753\025\235\304\247h\000\364\270\276@\206P\231\277\214\343\230U\211I\276q\310\231Q\257d\304\202C`|\002y<<R\031\234,\255+\r\307\262\240\332\275X5\266\265\373-T\271\244\2233#E\231a\007\270D5.\203\264\021\035\360PW\372\364Z\311\263\207:\262\007\373\320\031\273d\030\316\\\361\347\317:Esnp'\214\350}""\250AaX\244\032T\204\005\362\353\230\3262\3509\t\271o)\245>\304\035A_\225[\314\320e1\256\036}Qr\375\320u\371\260\036rp\354\004DIt\035\006\213\020\215\2258\327\376\323?\177\254\237\3042\337\21106\216\037\252\034Q\260\026\nM\006\n\361<\246\027_\300\247\317\352\350\021\226\271*Z\004\004\212\361\202\376^TUw\244\251'\245\356]\211\023\025\235{\370H\007\001\354\304\374\330\000Fra\010\344\335\030\367\n\262`;r\256\t\246\027Z7\261 \021n<\303@\264Z\364\204\013\207F\203\031\022\n\354ZA\274&W|+\216cW\246\0132tR\036\354'\306\266\274tN<Om$i\272\205 \311\237((\017\025\274z4\037\237z5\213\033\362Vm\362\025\n44\203\273NDs\314\t\264\354sA(\272\330\014\220\340X\252L\305\034b0HLOI\0362P\2410q%Za\251a\241\325\177|z\000\336\363\037Y\014?\371@\267M.\373\177\000\001\037\000\265\276\005D{E\206\277Q{\352\303\014\330\\\325c]\336\372\242\214\026W\257\3764\026\370\327\227[\222\362\204\014\026\177\231j\007v\332h\216V\354!;\377^5\257\031\002\330\267\003ra\216\201\336\037\251\346\323a\312\214[TB\312\034\225a\336d\247\270\340Pl;\023\331E\320\n8\244\351j\320\201/\3076\371\226h\374\353\205\215\225n\030]_\"\371i\220\231\345\267}\241\324\3128\\B9\007\267\261\030\326\000\236\250fg\241a\252,\315@\230@H\200\\\205\276|\354\200\210a\372\224\351m\231!\207/\006\315LY\303=\370\253\262\237\001p'_{\270\352\265F\023MA\323\340\240 R\016A\277\031\217\323\\r\357!\316\027\205\277\273\033\202\316\021\325?\3578H~\37655\314\310\014i\203\227\327\377\000c\262\332n\315j\261\216g\266\264\370\262I\302\372\341c\230\014Gk\267z\036H\331\260j;R\303M3\333h\304cEM\233\255'+,%\017\222eFtK\340\204\3458\023W9\235b\005V\006\331$\272}\343\261\240\367\010?h\326\310O \301\244*\002\254b\347\014{!$\0026\177\215\217CE\251\330v\304@\333;\314I\030\025\352\000\322;}l\326\223\277\323\301+\321\031\033\273\260\034T9\000\217T\254\344@\3403\203L\013\035 \336\366\304L\363\24331\036\350B\331\361,\220c\037\212\262\257&\372?M\372\250\341RA\024T*L\030i*\265lC,W,\023-\266!\350\332\271K\327\360\350\345>\216\345\356\000\347\353\267/i\250\347!`\013\323\3155""\333\243\311d c\006\253\2620\035\204d\243\3235\303\204\252\\\320\025\260\203\006\323n+\037\234\301\270\356\313M\217=\177\343\210\010>\227\005\220\006F}\216\314z\027\300\215\312\236\336\341\335\336e\td!\256\324\327\035\2168[\313>\027\327a\316\233\201\264\252\260\207\246\003\025\327\226\354\315V;\257\372\201\246\254\347\213\017c\270\271e\257fe\352\310\r\362\273\000\320\244\306\221o\307\030K+\226\2241\025'>\252\370\375\342\267\375ut\343\330\260n\013T\270=[:]y\217\263\210\022\216$\364\351\242\322}\006\375\357G\322\020,\301@\036\201R\340P5(\377\215{\302\234)BBo\324\274>\004+P\357z\306\320\256\304\263\322\330\\\271\326\307\257\302\230\235R\357\037\232\020\035`\216\3171%-\017\023\262E\327k\305\342\262z\004?+\003c\361\035\037\364\202\025\010-\020\211\200\3536\331c\225\346px\033\250\365dy\260?'{ KP\306\207A\255\251\211R4\235\037f\257R\253\314\036\021\362\315\301!\224\234~\231~\026\202L\301 \360\"\001%\361\016=\230\030l\\\225\271'\230\314\304*\242fp\031\"\347\246\346\264D\211\231\t:}t\236\333\301\310\005\305G\366\357\263\363\0250S)P\321\357\034\271ij=\340FU\007\367\314E\262-\350g\214\314\217\266\305\236\264\377\3435\001Kh \311\340\235S\td^$\271u\225\243\372\305B\347Z\360\024%t\244\360\277\203=,\335-+\325\\$\026\360\036\315*\227\243\226\000\210\240I)\004]\325\227\014\356b^\257F\266\267\361rM\254\r\326L\025\313~\"E\357F\306\320n{\321\310VL\"I\030\034\251t,\213\370\236 I\220a\357\207\022'\272$\201\224@\263\320\215\262\266\242;\025\356\032\010\345~tfy\221\236\253\256i\333\333\240\302\221\213\375\336\247\344\r$\210\210\247\034$\030\025\360\303\216ts\220\"\303\363@3\032\320,\362\360\255\334\304gOSM\205g\220\263\200\320\344L\013l\367\360\360\370\365h\253I\202dS\376~\347)\315\304,\224^\275\330:Gb\354\212X\252\357M~\314\231\005h\005\313t;)\316\030\337j7\200\362\250\252\r\1777 \350\007@3\371\274H\323+\3053\370: w{F\2074>\340\r\035\0056\344\244^\016n\022pP+cY\221\364\037\034\211%&\364O\331\211\264\374\232\363\347\032\351\023P\343sT\336\265\361\206M\361\\Y\232h\023\362\005\001\263\t\032j""\246\270yg\226\362\272\211\014\232(\255',w\"\000\037\251\"\016\276w\201\246\352\372\210\336,\2143\352\264\245?\226\237\213\315{\324\373\220\330u\307\253\r\262Z\177\302\241\216\033e\324\302\341\260p\252\302\262\004?\032\304\356\310\206zM\2626\367P`\030:\200\020\215n\350cv\271\366L2r\231F\330\245\346\t\001\215\241\250o\342E\346\007\242\027\322i\201\000=+\270z\231\304l\017\225\256\336\332\217\364\260\2358\022\365\331\211\264\320\254\366\271\2038\367 \331\020\036\0142\3759\357p\246<{\007\3466\240b\277\365\002|^\355\003@\324\342\356\362\232#f\201-83\260\244{\224V\265\027\000\307\336\264\322\2470\020\316)\205\312\2516#M\030\242q\030g\254\246K\200_\006\322\334\032i\301\312\266\237\272\364\324\360\334\267U\003\372\331\375\273<\264\321{+\010\025\362\353u\321;\206,\347]e\326O\257\326<\027\010/\310\373\304}\362\217\305\303Z>\232\255Vs\334\255\032G\005\215\014\264\357p\333L!\362\336\301\221o\341\206\001H\270\211\326\t:[\270\263l]\003\252n\2506\013'(\030k\004\244\360j\250\274\224\213\363\212\004\224\206\033\234\027\003c\tw\223\210\016_r\006J\327O\361\357&\350g\220\r\350a\333L4q@D\017\027\021[:\270\266\333\263>\251T\210\365\213\003\032fa\377\364\2233\031g\033[l\035$\301\341\302\350\361\3425\245\316$\274\243\225\002\003\013z\336\345\373\3223\242\226\003\036\366\211\367\271b0*\025\330o/\367_\005\255\353\230\207o\334\243\250\242\355|\356\211b\311\005\251\226\235\365\275\006\035E\325\236\2456\036\212\247-\300P\267\313\253\304\233\243\326\342\225J\310Zj\225R\023G+\251\221hp\326\322v\340\314\202\006\252\271\216J\261E\036J\211I\303\344 \317W.\2448^\016\344\235\371\250\232s:Uu(\215\237\306\245 \202\345\t(h\327\005\343\227\007\316?\035^C\300\350\261\225\007h\220C\233\203G\250\370c\273\325\255\210\235,\351\204\033\261H}\007N?\361H\271s\235\373<\350~\237\353\223\271<\033\316fn\222\345\271I\213{(\360M0\226\344\330&\036|\206\315\252\235Z\360\323H\300\005\366\332\303\230\254\240zj\316\2161\014\302\256\\f\277~!>]K\024\274\333\376\362#\332\316\363\025\326m\312\274\020\336\326K-\317s\027\310\271r""^\333\216\006\326:\312\347I<NjV\243\220\206\332\253&\221n(qa\005\220\234\006~!d\225M\266b#\"\264\177\305o\265\023\246(\026p(\203sPf\243\351\276z\206\025\324\033\256P\273|{\342\247\326\007\"\2146\2660\331A\017\342\250\326\037\244\261\024\305\257\276t\014\340\371r\335\001\303S\251cU\367\312\310)P\037\324UIT\326\244\\\261(m\270-\200'\241\2777\003\007\236\221\022\304\261P\361.l!$\270\324&\375Y\362\010)\274\345\261v\246\032h\221\245\210\245,\301\240\273\025\016Hc-\261\016\336\202b\323$Y\312\004\210\347\301 \315#$t\034\003\367\324J\020\314\302\2728\341\003\307\230\026\243\261\265\177\037\013*\241\035\355\036o!9\211\357AW\201\252\243\206\202\312\240\242O\035\032\311.\247\243kH\361\002\356\335\227\312\2034\200\252\334\035\211d<\216fa\364T\363g\204\203\324 \227MK\233\331}\3014\r\252~T7)\224\204\356\314:\312\351\036\362\307\214\213\227\242yjY\305t;8\300X`\204\313L\230:4\247\024\365\326\201\372\014\332\236\374\031\374\213\347\372L\301\317\001\361\316\360\014\343\203\241\247V\273\221m\267\310\206\236cjT\255\274qZ\017\025\005l\245\235o\371\033\026\267\361\216\203\244\032f\307\027\275e\311i\\\262t@\322E\n\244\300\361\315\261\254\200k\010\363y\202\002\216oY\242\226$\351\233\374\004\3149/\244\351Lk\227\363\371SS\307Q\256\030\037\344g\234y\031R\315\363\346\204\305\347\2166\210\021\373dz\020m\016A$\346\255\260\336\253\310y\341\346\265\331\266A\305qa\226\230\362\247\035\t9\333\351\013<\343\003\013\206s\014\205|px|^\204F$\325\214\323LkW\247\202O\034I\256\312\235 \t\253\211\311Asc\271\025\323\200\236\001\327 \261\202\2746(5|\327\351\264\226\221\324)\370s\350J.\244\313R\275AC\\ZU\014+\035p\217\227&-\326\241/6q\375\236\241%\005\321\315@\205\020\304z$\222\231\201K\341\2063\272-\371}\"\260\233.I\010\265\200\222To\261\010\220\256\210\312\003~\311{0\372Ap\013?U'o\320)\317\321#\224\364\314Mq\006$\0266-T\246Z\231\032\n\375\360\230c\360\211\203\252\013\377\210lA\320W\024\205F36\022\365\355\313\004\034\311\275W\004J\332\310.9\236\312\277^\212\003\006 O58\032)l\242\026\022\276\240\310\005C\316L""\2636v\335#\261\010\370\030\006l\343\217\274h\203a\340\234\226\002\026\326\271\335\271\273<\0035|\256<>fC\252\353\006\177\200\373]\302\340HZ:\274#uul7!\037\004\346o\226S\020\202\030\204<\031Z?\007\222\325\000\341\013\216\002\257\246\247\033\367\275\255G\2740\003\376\354;\230Bwk3B7%\000\313\013\366)\352\204\ng\264\203\243\254i^\243\000!\006L(&\364\306@\271G`\224\356\314C\375w6AH\274\302\277\2329\016V\302QW\361B\333\363K\244\342\376\001%\0074N+e\264\014u>x4s\006\360\207\240\222\3031h\330\313\363\245\005\242\177\320\004nu\017R\351h\353\335\320_A\325hP9\251%Q\366\320\335\225\255'\200\177|\324\234\310\255\311n\325\021`\327\021[\177L\244\3716\275]\333?\202\037PH\266\271\223U\346\006\321\225t/\3247:bT\220I\330\255\365\222_)\233{\275\344\322\256\345`\342\326\251_<\370\236\261\324s\344\363l\235\234;RK\t\"\r\242I\353\265\315s\335\335\"3>\266\342x*\t?\344\201s.1\3450[s\377\033\243\326Rb\266Q]\356[\0205\220\237E^\337;\325\245\252I\222\341%\037\255\267\372\356_\270Y\351uV\250\256\311\257i\244\016\305[\305O\307\264\362\024.\222\033\266\020\273&$\351\177RA\263\022\350*\375\207Kbp\236\236g\235[\200\372\017\343\270^\356\305\271\272\201\0340\276|k~\367y\261'\006\230jL\313<\301\033\261\307\016\263\327\347I\241\2569\246\270\357\005t%\236\337\2618\022\2361\203\240\024W\030\007\262-\032\234\207w=\275\252\033\330<A\005fZ\372\001S\205\346\025n\036\367\311\255S\265\260\t\241y\374\275-G7;\255\215\016\256\301\257\252\304UI|\310\223y\264\320\231)\341\302\243\303h\275\201m\036\020\223\225\245\025\326\r\3253\033\365o=\371\275\325\002l\246\225\213\364\217@\241\373)\314\036\2257\023\264\267\017\241\377\372\003\257.\367\356\224\222\205\333\002\375\210W\263ZSm\010\254\374TV\005\237\211\367\212\361\000\314Gy\021\t\303=\030\355q\2557\227e\215\\\252\222\341\231\013\340\361\370\207G\356\260\357/\033j\033G#>Q\365\252\255K~I\256{\027\305\230\026\233\224>A\256\320\242pf8u\322\300M\320\257\026e\3034h\035\207IK\342\251\266j^\367F\301x\303cT\357\354B\361\345\033\250\350`\262j\242eY\245\022Wtu\033qQ3S\314\315O""n\020\t\212\274\214x,\210\226\310Jj\025\320\017\304\336\203HZ\254\315\252\304H?\307~\337a\361\370\333.Ww\216 p\257\032Z\374#\\i3uI\217\\\010o\377\324\316<\031;Ni[\312/\312J\362t\270T\334hv\030\344V\205\327$s{i|\203\277\233\214f\265 \n\236Pl\254z6\366q\261\305J\232D\310\020\027\177\000\201}I\340\352\316\214\362MG\013Yzl\364\362\213\275|P\016\311\366\322\010|]O\317+\037aE\014\0373\316\004\325\3441?\224e\365\003Gc\020\037\333\376\362HpE\024\225\356V*\037\033C\305D\223f\372\023t{\360Y\374\323\366\344~Ov\330X\314v\223+\200\272\353\013\213\260\025\367J\001!\021\023\352\272]\237b\363K6\030\223\231\t$\036\217\010j\276\272\241\032&4C1!\202l'|\215\274\337\352\250J^n\213\242P\240\230m\347\307\302\257\315\206\236/\374\361\n\272${\247\246\254\261\303\344\212F\006\260\213&\233T\241R[\220\375\002\275\244\376:\014\325\232\377\216\024\317\377x\022\3064\273\342\212/\336:f\035ka\356\204\214\367E<\312\006\211\265\204\264\243\343\250\007\341Y\205\001T\375\004O\0201\351\\\360\344M\023\005RCn\325\203\354\307=J\265d\tu\241<\224\\H\010VE\332\243\224`\356\2201/0\332\263+c\363\021\034\215\233N:\251l\n\"\322\2464\223-\314\246p\033\212\215\022\246\023\225\365\265^\332G\2303\\\215#\214\r:\273\214\325J4\026\255N>\365\233b\334TJ\233u\356\\\000\250r\374\354\203\313\364\312\363)\336\336\372\363\257\314\366M\272$\272Z\372q\"\210\334\255\245\020\3617jE\252^\242\032]\341=o\321\377\274\365\322%\214aG\2503c\367\033\244S<\371'\r{\210|R\363\226\203\001y \343\037\024j\207S\375o5\370\301\034\312\276J\331\301\177\235\340\243\004\311\2008U\221W\311\333y^D\374\005S|\026\342\336\260\260\345\214Q\250T\215\366jd^\223\276\367\260\327\321\217UB\264\316\320C\213!\035\031p8(Q.\302\305AO\277n>`\310\243\350\016S7K\217\030nj\0004B\221h\214$C\351!\245$\034\2300\317\260f\322\311\243b?\356\303\323\260\374.\000\000o\204\027\327\204}\346Q\007\325\001\251\343\257\357]\030\262;VO\\\256\3109\333U\363\265\017F \025\r\261\313%-.3u\32581]\242\234\001#\230\373\264\371\244czu\006`\205\355\267\271sM$\327\010\025%\200\016\010\260\347""\371\000<w\267L\236\317\036\275\007Me\002^\226\372\301C\312,\031\375\226\223\377\010\3377\016{K7(0Tp\221\246O8\375\234\013\240\272\n\"D\300\214\035/I[\344\350\320\006\301\353;\227,\227\325\325\257m\177_\006>\t-\326[co\\\305\372f\342x\267~R\200+\\b\326\271N\006\335Q\"\300\224\221\214U\022H\200k\237\226r\357\002\241\302\316\212e\177<\271\343\301\215\211N\374K\277\273^\350\010m\363b\314\262\344\354\361\334\360\370\002[\272rX\277H\372\010\261\215Xs^\027n\306\240\2443\266wEQN\007\331\022Z\021>\336^\327q\352\325\300[u{\211dz\260-\016C\222g\207\030\3223\246\245#\264\275a\337\244\225\270\344\010c6\363(?\306\207\024\334\260\213\235\366\326fz\014$\035U|IO\211t\371,F#\345\000 O\036\037.\326\273\335v\337\321\223\2235\304\024\033\371]L\022l\272\253]}\002+\325\225B\377\213T\007\310=\371\304\2026\315\022\340Y\300\355k\260`;N\026\356z\364a\241D\007f\257\311\360\247\372\262\200\222\223`\014\211\204\003Q\272\254S\367\223`3\216\243\265 &\344\0228|\001\271 \014\200\203\311\334m#\262\203I\005\300K\316\230hT\007\263\001\303h\302(\224\231\342<\273\303@#\036Lq\251\004\302\242\357\365 \216R\237%0\004\205\233Y\373|\372\036yDp\252\241\247\"\374\212y*f\300\270=@\032\346u\273\037'\361T%\310\235\302\353\237\371=\247\344\253\026fG\265\351\226\004\201\004\323i$\260\224L\366\013\341\212R\033(/P\253\340c\222c\020\367\270\330W\372\266\311>\216\263\231u\361\356\240g\344\206\334w\026H\000\251c\267`o\243@\3002H.2\225R\221\225\202\r\374\344H\342\370\216Y\177X\252)\300\304\275$d5\311T\262T\336\211\021\250\020\272\217l\002\200 \202ABVmr\020\275z\3423'\266\350I\361\201\014\010\302\207\265\007\310\017f6\036\243~?\024k\002\016\356\225q\241\242c4\"\303\357\277\033&\234[\341\360\251#C>\3656A\220%\221L\266*\210\337\222H\000\366\370;s&\030\362\374\262y\031ec\026S([/\350c3\337\020\243\231\201\375\225m\255.?4]\253Di8>]\207\213\325\305\373X)\205\233$xU%\234\322\360'\234\356\274\361\210P\227\210\243J\024\316H6~n0C\333W\262\260K\013\026\350\335\370Hx\245\226r\226\253\332;ZO\251\341 \301W<\307\367`\350\237\263S\032O""\274\316\333C\3745\355\331\252\r\377\276\016\262/\004\355a\233\240a\325&\375G\024\220\004\350f\201|\260\337pD\036\244\035\023V\256\205\372&\020 \375\030\374\220\344\371\332\307\257\331\021i\024\252\274\200\376G:\253i\270\246\2653\001:\203*&t\273\002\001)\204\274g\026\370\014:\223P\017*~\3720\311\021;\275\304\346\277\337\231+*\237U\343\317X58,\006\257\277|\032\016\033\346J\374!\177r\255\341y\321\232\344\3120\207c\022\310\204\362\330\210\304\253\253^D\005\316\\a\260u\316\313<)\217\362\005-c\022a\300\332\277\303B\035\014m\354\303\251\316\303\347\371\027\001\374\005\002\276\344w\323}\265\033c\303\036\023,\365\177\222R\203\322\201\346\273\t\317r\232\313\213cB\251B\204Z%x\333\010t\204\276b\0352\365u0\320\366W\214\r\377\320\r\026\371oB\315\021\354\254\001A8\256\316^*\372\2045\302B\357*\234\337\221Qb\026\354R\002\303\216*\002\036!\017\332\325\\\366ypBSLR]j\225\230cO\034\022\006V\275+\210\365{\tL\026\025\341\246\323\377u\257:\315U\340Tb\265\220\027\026\324\356\t}\021\253cg\216\313\355\014)\027\265\005\321;\315m\361p\322\034\212\354|%\220\032[q\310\366A0\334\032\210\020\326\304\272\275&\214q\376O\207\370)\0130\237\246E\2703myug\364\301)I\314\303\267\3759\306\336d\371\001\356\235+e\341\023f\017\215\216\n\267\313\361\362]\201\032\341\200L\224\320\351\310R\020\202\266\347p\312\317\323U0\353\324\305\035R\366\340H:\027\240\2110a)\035\266\267\213\206\314CL\300vI\233\"\337\320b<e\247\343\227L\001\243\320\2336\023\363\276K\000`\332P\310\201\221\205\324R\262\241|/f{\025\364m\200\314:\364\274\017\200\361\230q\246\327\322\226\200\375|\2232j~\231\376R\33385\340\204\2372\210\221\311\335\022cc\312,d\272\177\016F0\2262\005\243\220=\267\217\205\321O\276\311Z\217\262\330;\244\317\227yw)ZJ>}8\351f\r\000\261\312[\370\242\\=\316l\005\213ElW\035?\224Y\211m\360\007\262\212\351\315\241\254\025M\304\t\"\202\267\000\225\325\345[92\344\251\016\255\302\r\363\223\330+OS\t\226\224b\310c\350\202@\274\367\0318C\257\235\267\035Z\322%\300\371\212p8v\235\312\247\332\205a\211\347\327\371\300b\2133\310R1S~3""\335{\352qyQB\001\240'eq\247\340\321\357 \231\325<F~|\314U\352C:\255\006\270\014\366T\252\030\253\247\005\260}\360~\022'\177\237\242:\225&\267&\363\276\331\243\363\346.\201y i\030\355P}\375.\317\260\251\010&~\234\211\327\243\004\r&\022\256\365\363@7\255\217\321AM\3432x\373\274\351U\0002\274\tq\240\024\252\256\254\255\216\247\256v\355Ad_=\017\302\244\3158:\024Pvx\3128\203\230/\37120R\316\2208\023N\2577\277\371\002\006\265x\360\367\350}OD\311\361\025\373~\214\235\374\375\274\272m\233\344a!\233\255]\304\356\274w\360\305\341$\203\035\311j\345\003\231\366\226\314y\235u\263\252,m)\221C)\026E\241\235\332a`\221S\324\201+\022\247\024\177[X \316\311 {\375J\3731P!\244L6a;Go\"\0033Z\273\342\032#3\202\237\244\\\231\317\250\347\301\243\312\237\220e7\256QG\365~`\376\361\340\005\325!\212iX8\216\314\225\311\211\331J\233 \177SC\376&sYV\241e\363\350\3249\022m\375\233S\030W\003\240\362T&\211\323\035\006\276e\367>\367$\004\375\203G\276I_\326\310\343\351\223:V\267!\203\257l\324\0213@\202\314\246*\207\240\204W}\361\245;\301\2369M'4\ngf(/\346\326\332\355&\354'\243\204]\316\244\344\222\035\262d^\376Z\360k\030\301\346\367\377\232\311\236\235\277\321{\227\250 g\261\342\314\014\316R\276\315F\020\305\215\233\245Ch\030\274\333=x\332\243\273\276\037(\221\177s\r\205\316\033\303\210.\302\261\244\301t\3717` 7\244<\347\361\352zK/\357Y\n\274P\236\035,,\210\022\n\245\021\246np\274%\224]:\263^\276\324<\247\364m\224\036aEEAgp\323y TM\r\2055 \323t$\240@l-\211(,P4R\005\023\031\240C\001\205\265\264 \346\201\353\332+ ,\236\371\305\265\370\251>\330\313\304t\231]\373h7\024\025B\260\201QAv;\005\331\324b\002\340\212P\216\376\254\304\377\023\035G\320\267\367\223\314\247&\177\016\201\020\210&\032\362\264\005\255\336\024\312\307\302\215\271\202\342\212\305\033[\037\232f\362?\271\337\333\223\251\262\r\356\366\r<\361\357\023s9\026\177\322\270LG\0228$x\243]\0312W\023Q\271<d\361\254\323\335\210u\202[,\3149U{9\256|\267\023{\364@\217pttAr22\233\313\245\\\357%\337\220>\013\333\222*\023Y\016I\300\341\3714\230 \256\347*V""\310\270\362\0249!\326\233\271\206w\344\267\320\212\245\244H\005\275\303\341dq\316\t\002\200\023\261\024\244kZ\027\355G\243\312\275|\021\0233\304\352\017#\024\001zg\005Rm-\2139u\310\345\242\256\244\325+\262\230v\331\222\257\006\232a\326\254\227\332\342\3146d\367\374\366s\255\t5@G\372\200\231x\351\366\345\246\362%\313h\224\357\0241F\030T\304\020\245\016\004>+Vj\334P\371\241\250\266\327J\212vWE\252\304\261g<\201\203;w\313~\367I\316\250z\3019m\241\013\326\264\340\206^_[\231f\342F\t\205\325\214\025\2070\313\246s\240q\313\001\242\344\227#\322\327]\271\327%4}z\230}^\n\005\242\305\220\000,\220\367{\262\372r\227\350\3713D\253&\031\307\312.\020[a\001nA]\0273\225\341\362\235\322\215\352\275\311-X\325\342\326Q\202\354\032\2336\025\272O\025\030\257\2419{\252\351PD\231\267\254<L\327\031\205\207GZ~\034\271\035F\031P\366{\273\017\274iM\257\317nBl\010\270\017\340\243\267\000\252\276\307P\230\t?\204,\352\0246\310\245e\004\375\201\223\306Osg\361\005\003\003\013=\227p`\334$\034\305\212\254\t\nh>\000\341*(\351\306\304>d\211A\212\004D\266\250Q-N\341W\317\t\373\3550\365J\305\212/c\213\253\010C\277!\231F\207GX\361xNh\200\266\244ucB\010\021\030i\031}\267C\366\021\\\353\271\246\273l\226kf\032\3052d#\376!\322\361\334\003y\004s\020\342\367\004U_\311\206W\377\t\024\354\220*\251A\033\213.-\231V\200\310\233\256\005\036\206\201X\310\256\024\371\240\221\235\340\225o\030\210\213\230\266TQ\376\\\034o\354\013k\352\364@wxJ\274p{\\\337\024\304 \342\367C\2456\372\362R\013})\2221)R<\300i\206\367\023\264\026\356\0275\227wg\273 ]\037\306\364\300\014\206C\374j,'W\006d\030\220\375$\250cC\355\223^\327\345\332\276\246\234\025V\2074\251\223C`6\316\022]!\227H+i\340\221zq\210\212\353\331\014z\226\362z\245\344j\232\364\331\306kpSl\322\353d\001\202\230\314\353\3116\250\376\320\000I\302~\221\006O\376\013\371\234\210Uqm\331B'\371\332Cq3\027s\t\370\0270\001\377\202\212>\236X\252\002\374;\276\367\370\341\000\264\210[\227\201\315\217i\202\322\266\3064\212\"\017\0371\273\307\025\273\302\250r\372\276\252\225\305\026\334x5""\306\3675pM\376R\223\034\260\221\334\365\216\241\332W,dO\341\034d9\262\016\214m \361\032f5 G\001\305\277\033B\231\246M\004_\330~\016\360\375\013|7\031\370\325(:Y\0335\332T\310\313\200{=\0276`Hzg\342<8\232*\322}c\305-\310\2509\263\010\355F)\t`\326\244\271\325-\321(\201\3333\215tT\033D\322d\332\350\355\225@u\260\350\303\177\226\223\347\305\325jVj\306q\322\304\017\033\2636TZ_v\346\231\367\354\265\260si!\343\322\010\2642l\1777\225\034B\010d\234N2\341G|\303\343\351T6\2058\213N\352\353\264\345\215\267\032\247\020\322\017tl\r/\230\324a\3109\022\334\326\336\024\212\005\207|\000\311\353h\0053\307\030\233\252\356\233\265\032\207\224$W\266\361\255Y\261\376\007T\306&6\361a\336\200\264$\271\216\267\303\205\354\010\274\251'`\236\266\023\201aH2;\276\224\356\330IB\212E\330\372\014\2203k\215\332XQ\272J\262?5P#\260\341\306@i,~p\330/\002.\220\255\214;\005\013k\267\224hk\306E\306\320\305T\024E<\364\357\374\0079\260s\020\222\247\r\237\371\373\023\200\177\275\030|\354S\346aCOw\365<\373\373?J\001\203T3^%0\264\202\230\020\266\033\237;|\242\332\330+h$\013\021\260\305'\210m\247W`\314\2169\030$p\3538\367\212'\032\316X\262:y\340Pv\021E8\0210R2\014\337@0\332\027b=\260\007\202K\\K\034K\021\330\020s)\2561\375\34336\032\n\345\234\261\350\262f\267d\004x\277c\265,\271\220\361\363\243\263\374\240\307\353r\021i\265B\222\021u\374h(\244?\374\345\233P\317\223\322\215<'bOX\321Tv\346`\351\010\330L\255\255\016\035\034R\274/W+hi`\347\322F\354\355\223\266\206\300w-7>V \264\346\312C\300\3561\300H\215I|A\246\236\023\001-1\364\342\014\370p-X\010\007]\316\360^\242i?\334\345\373\351\250M\023`\224\254\321u\205:K\270'\177\314\037>5\223s\377v\314hP4p\276-\220\\?\034\375\231\023\030b\233\273\031\231El?[\373\302t\271q\247\030\rA\370\255\217\014\232t8\235\363w\236v\013\305\212\260K\226u/\022++\372h6\016\265\351\244X`\363a\260\346{\n\377\347\225\033-\2604;-\3070\270\332\347\327ribFKu#\234#)\360\345\256Ic\230\334\002'\212\223u:\346\242\201J\302\342\0008\244\207\271\224\226\246\326\321m9\024\027\036\257\377\3760kC\221\353s""\371\364\321O\352:\264\216\251\253t\357_\036\025\264!@\364=%\003\"\264\\\333\327\240\235#\r\353c\327A\016UV\2467\204\033d\242\216\207\207B\311\236nK\216\226\356n\335\0306\223\253\025\313\330t}\266\316\321\246OX\205\025\304\034\177b\3261|\324\314\211\305\221\265\376|\363\260@i\001!\331R\364z\266\000\330\312t\272\274O\374\215F}\361W\n'\225LG7Qc\303ny0\326\310\226Fh\275S\021zo\021\333\216\365\241\276K~\343M\252\330D\306\377\373Cx{\255\266g\321s\224s{\365I\305\223G\310\3248\255\016\365p@\006\025\\\203v\244N\321\2235\232.\230\200\207\314\331\005\203\375&\272N\243!\363\270\026\"\224t\314 \361\217.J\3445\242W\001U\307\216D\270\320\\ka\343\006\024\216\350/\r\313\316p\361\204\341L \002@\330\275\233d\232\274\215\312~W\311\007\322\310\302\023\363\327\3672\203\0376\1778\363u7\3542Q\007\305\242>[G\240\007\212W\216\365n\231\360\324*\313\020U\351Sni\365\207\362n\225\350?\272)\247|\363qA\303\000\027\221\320\354\334\203\343\244\340\024*U`\010*\000}\221t$\316p\317\277j\316\201\3360\343\032_\203\364\273\30260\273\304d\214@<C\324\364\014.\274\277\270*\356iF\007\205\203M\241\246a\241\341\373\032o~\230\202\023\241\273\352;\022\2015\305\212(a\210\310S\r\026\360\014\337\215\271\235\032i)\203\210a\342\254n\244\233\352\324\221Z\230\365`a^4\303l\301tQ-\344\301\005\347\032\337e~\354\375\r\316n;=G\006O2n\034\355kOB\3466\304\215\303\241O1\335\233&\271X\274\211U\233@\267\347\036I\000m2\330cE\266b|\351\223\215Swu\355c%\r7~\205.Kn\237\3619\016\363Pm\376\254e5L=GY\254\225\221\004\332\344f\032\202\375\206\271_\345'\372\374\327\240j\247U\005\331\200S!j\245\223\2350\357\376\213\264\205\005\303J/\037\365l\271\331\331\261\270\257\251\334\263\325\344\242ix\0003\0137Oh\250\004\"\033\304\r\306qN%\036\227\207<\357\203\361\331\363S\023\376\311\273\241\3426~\353/\213\253\344\221\217\366\346\222\214\222\177Y\032\311\335&\360\276\337\245\027\242\201Z\201\204\314\205\321\302\364Y\371aI\343\312=\022Z\020+\260\212\261\246\371\022F\022\356\215\303\nrs'\224\205z\217\020\221\334\3229\033\037O\323\014\370~\350O\200""\224\243\261\332\tNr\367\200>J\3237\016\\\336\264u\272\225\377\330\364p#b.:c\244\346ECC";
    PyObject *data = __Pyx_DecompressString(cstring, 63458, 3);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (57582 bytes) */
const char* const cstring = "BZh91AY&SY*\216J\267\000l\235\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\360@@@B@BhP@@@p\000@\000a-/\231d%\032\305@}\357\227v\371(\240(\273\225\344 \000\021\353\357g\200W[L\321\354\354\372\004\202\213\275\346\333{\014\232\0004\005>\222\200\037@\004\351\247\003\333\333D\205\013\217\240P\372i\350r\247C\016\315^\333\356\312\006\2006\3004m\272\242\246o\000\032Xp\n\240RP(zn\333\270\365A\005\266\360:\364\000\006=\271\003\320\036\2641\036\274\272\004\250h\014\217v\034\237n\341\355\200QNX\372`\000t\372\336\336\200\273\000\032\001\367ez=\331l\337n\237B\366\035\365\222Y\352\365\202@\244\361\336\315)\266g\276\253\276\207\335\203\344:$vN\356:\347z\035\0325]\016\353\003\204\364\350:\212\273\017\270\364\350\000\320(7O\247k5\360\363\355\363\276\3718\233{\272\362q\367\335\313\3374\357\227@\320R\335\365\365\221\361\036\347\032\3354:\n\247w^\255\357<\344\330\345-\215\365\335\256\324\364V\264\230\205f\323\355\273K\306\311\251\0355{}\332\276\206\317\247\036\236\271o6\251\360\000\000\000\000\333\355\214\315*\317\256\333\200\003\240\264N\335\353{\331\316\264\275\256\350\353W\273v<wAr\347\231\352[\321\351\357\036\353p\267[\264\355\313\273\336\367/\021\333J\2667\025\346\361\013g\236\306\026]\251\253\251=\344\335\330\245v\364\343\267g\275\316v\340\324\346\032\325\231DUc\201\240}\t-\367HW\337\013=\275`\236\236{;\335\327\236\366\237_\022\033P\356\311\240\037@;\313\356\304\222\211\2665\272\370=\276\216\035\334Q\300.\237]\341\367\017\276\315\276\372R\236\347wz7\263\2430\034\355\333e\323w\263Nd^\357\273\307g\255w\315\235\017\203\301\240\000\013\346\033R\203Z\024\001D\373\273]\007\257\274\316\317W2\033w\000\364t\255\260H\366\367\014\251\327\321\324\323:z\033\215\355\275\026\315\355\316\325\252=t\352\264t\327R\333\n\250\330M\227nD\\\203S1m\031\255\266\025\264\233\031V\244\305\205\206\322\226m\006\244\010\314[P&\303T\032\240\000\006\232\r\000}\000\000\000\021\320\262\200\000\0007\276\001\204\016\364\220\000\000\000\000\000\000\005>\332\200PH\017Z\240+\256\242&\356\000""\363\330\000\000\000@\204\246\210 \010\002h\020\320\t\204\311\200L\2152\0011\002`\214\2311\032j\236\214\232\247\223\323\005O\"1\017L\243!\240i\204$D\204\232#)\246&\243d`$\362e16\247\244`F\020i\351\036\220\323F\230\363\001\223M)\250\200\000\001\240\365\004\232DI\004\221\023iO\321#M\251\352x\243\312\001\262A\352b=M\006\236\236\250\311\223\324=@6\233Bzd\311\021\223M4\006\236S\322h\000\022z\245)2\231O$\024\374\251\344L\217P\036\240\000\006M\000\006\206\200\000\000h\032h\000\r\000\000\000\001\022H\20112\000#M12\002z\230\2154\304i\243#@h&\232G\222mL\023I\351\211O\304\312`\201\224\364z\247\211\243P\004\232\210A\002\004\004\020d\rSh\203\t\350\232\217ji=\rG\244\332\231\000\000\003F\203j\000\000\000\000\017\377\314\303\r\274\263\245\327\025;.\335\276\263v9v\210\367\373\266Y3\277\344\303\307m\2269s[\207\213*U\311\305\205\311\2046M\231\341\005\003\313\\\317\305\257\315gO:9\265\374\266n\365\307k\003W\326\341\216v\270l\224\3150\331<=\031hr\366a\256\010\263\303\361\370\217\007\250\364\2253\351\317\270\236\220\007E5\200\207\2511\033,\242\215_\361\234\215\303\314X\372\332\364 ]\221\276=\236o\t\025\201\t \254$S\235T\343\0079\357\323Y\213z\253-\350\375\250\276\231\224)\341\253\252F\016>\205Y\276t\203d\251'$\025I:\332\215\003g_\216\352\351\370\266\356\225\312\352m\370iC\t$\355\2616\205\265\027k\335\0008\236\313\342Z\351\r$=\332\2152\305\347gG\221\206\253\261\357\306\223II\262([:\263\013Te\244\261\350t\336\344\307\306\247\241F:\340\356\311\325\307\221\301\306\332#\343bwTS\272{\231\333\312\266\272\342\332v\362\347\313&\026\274y\343/Wv\330\260\324\345\230\357\357O\335\362\255\241\221}\335o\311\350\314\261\254\264\227T\213\353\227%u\271\327'\231I]Y\264\251dZ$\307\026u\234\201\370\234\324+\2211c\234[-\333\307t\260\2751A\022\341\303:\311\313\266E\353Q\303\006QQand5\230\317D\231\240[S)0\310z\262u\272\365\257\t}\371=q\203\236\215l\205a8\272S\263\032P\317{\316JP\311\363\276R&\241\343#m\321L\334I\264a\226;\256\325*\205\246\274\\\203z\036\327t\306\032\234\035hR4n\210@\204\322\223\261J\331\rn\264""\344]\275\032#\226T\242\321\255\362\312\302 \240\223\327n\231\312U}n\362+\017\016\350\372\215\372\345\237^\255\323h\237\026\234\270\252\276/A\235\342\370\3135\367\240\226\253\250\253\017\215]B56$D\351\204\245k\217\256v\205d\367aY\010V\240\325\272fF\264v\367\224w1\373\235\355z\002\236l\206\326t7\302iZ\211\344\226\274\316\377\037{Y;\373\337\034\373d\344\301\213i\346\233=\261\345\212\014F\201\241\227\237\036\324\3376e\313\301\2574\305\342\204\267\"\261E\016ln\306S\302\314v(\313\032\231\343n(\331Lu<\254z\346W\014\256\222\245T \271$\032G\336\301JG\347]\2317\364\256\211m\363R\221\261\225\267\253jt\3129L\212\317\001\333:D\224\240\036\246Np(\346\202\225 JWmyi\024\3562xl\224\026\272q\022e\031\273E\327\342\263\225Z\202x\317~\352\023\265\332\256S\030\234\362\270\344\323I\355\026\255$\230,N\372\241\2454\356\370h\306d\261M;\362x\202\n\345\247~D\253\200\331&u\204eL\244\027S\0145\206\022(\244\250c(A\203\206\267\215\025\224\337\014\nK\007\224'\334\2355l\232\207M\232\244X#r\337J`\245\303\027\225H\231|\335 SC\210\340\343\303\216\214v\271\0023}\321l\003\206\205f\327\234\3644\017J\304\224\2337m*(\354\332\263U\276\223W\325\361\225#\240\321\271\325\244\261\0301\237\357R4\304\251\321\234\273\"7\223\246\004\200~\357\246\306O\363\245)\025\206\375\374\223M\260\264\2421\244d\240\245\255V\364\337\342\000\177}\303\367\235\300<t9\300\017\3578\000\022\036\357k\331wcm\206]*2\311\372\211)\002\037n\305\222\351IQ\002e\025\3030`\374\277\213\360\375\307\354G\366Nz\1773\277\343\375\225-S\375q\023j\377\237\367\377\177\374?\361\377\207\372\177\336\270\227\374\250\357\317t\347\210\377\227\006/\367\377\236O\374?\370\377;\354\177\356\177\257\373\037\353u\327\334`\225j0\251H\000\340\001\000\344\010\023\302\020\016\022\001\344\220\362\007N\366\366\271\306\340\221\ne\265G\033\202\323 \221d\271.\254]\225i\332\244\3202EiTt\025%e\253M\221e\034\212F#\261\202\350\177\350\350\316\347o:\352\236_\021jL\345$.\315\303\254\344\345\340\316\0336&z\337\007\273\336wM-\241\267\034\242p\020\3016$\3347v\335\273\210n\323\004\222Y""\306KU\233&\304\"D\230\010\341\262\232\322\3332\225L\243\273\227n\243\231\\J+e\264\307#\273sV\250Y\265l\312\033\201\314\263v\342\305\034\314.\\\3144\323\002\346f\346-j\322\302\273K\253ki\013\205\2420\353\024\021\240n\241uV\023\310\3561!\215Z\243|\274yi\251^&\345v\361\263kV\321X\343\216-\243w0\310\243\222c\346\347\234\263\224\267\274\262\260\014\022\006\355<\346n\023\316\027S\214\342\341f\341\216\230N\363\216T\254\215\033\300L\241\314\226,d\326\027NKr\002&\216\014\342bj\034y\034\334\303\254\026U4\177\275s'\003\327\231\352\3135\256e\214\266\027{\206v\314\311\275\252\034\021\345*\214\264\260{\270L\336\320\340\311\233e\021 \322\356_L\251\334\331\320\260B\035k\254\253\315i!i:7\270\014\206\325\303x\005\202a\346)C\221\025\\\241\210\010\"\301\256&b\3453&s\r7\234\315a\253\315\271\024lS*v\231k\2276\247s\025\035JUp\302\246[wj\363[\313\202\332\302i\002;*\322\201\202\261)\021\014\021qQ+\0244\225\261\033m9J\027?\327\377\333\233\3739\316\227\373I\035\037\334E=\362\275Q\377\267\375\335\253\305\317n\027\177y\340\300\273\017\373\360\306\207\357?\253\367\376\372\377\217\247\251\375n\247\366k\177l\243'\251\375\331\353\374<3\374\247\245w\247\330z\343\314\363\034\335e\353<\333\\\335>'\211.y]\301\301\314q\007#\310s\032\206\360q\234\234|G\t\324:\235G\221\352u:\234OY\272\275~\277?g~\356>.~_G\223\223\376]\036\235\230n\377\313\331g\016\203\243\223+;\323\2376\213\273\3143\007x\000\355\n\235\245N\320\207h_M=,\331\263f\315\233c\376\377\375\237\3761!\007\376 \256[?\006\213sV\311m\262V\265U\373\034\266\325f\323\0132\210\226jf\031lki E\004\330T\330A6\005\000\330\005M\200Sa\023av\014G\270c@q\202\343\025q\210\2061\034k\213\327-\371\001\357\212\0322 \344Q\003\"\210dEp\250\231\021\314\272\201\202\343 b\001l b\027\020\241z& \304\342\013\262\000h\320\002Z\215E\242\252\244\324\231\233\026\210\3265a)e\213kc\032\322mF\326\305\266f\264m\261m\006\2125\0053i6\261\255\242\244\255\261\262l\246\266-h\325cmI\253EURQm\242\255\215Q\265VE\023U\026\265\215Tkj6\253EV+EV\242\261j6\333clj\251KQ\265\261h*\305\266-\244""\252J\325\264kZ\203m\266\322[\032\212\243[F6\222\264m\255\215AmYM\266\321Yf\2666\261\264\233V*\250\266-\251-&\261\240\333\033h\326\242\264\026-\215\265\222\333\026\261\255F#Q\215\243\033h\266\306\332(\321\025V5\261\250\265EVJ\265c[\024\232\325\215%\243m\375\033\343|uo\215\253\343\010b\0202\210e\023+\252\250\003\222\"0\202\200\211\3471\212\2467\030\2060\034`\343G\036\020\316\020\023?\017\340\"\177\214\242\037\302J*F\243@6\253K;\323\362$l\321\333A\364\3767\026\t@\332\035`\037a$\233\rH\317\346\271\371\366\246\216\244\307!m\014\254\226m-U%E*\004\252J\301\362|\024\241\337\201\237\344\303|S(\037\274\207\3540\227\232\222p\220\236?E\201^U i<\356\361\316\370\300\277\364\245%-?Rmy\347J\345e\366<\360\245\272\350aJ\266>\257\331-?\\\262,m\215n\341\277\374V\316\211S\374e\360\221\337\303\004\234g\030\361\241\306\274|`q\274\177\243\227\252A\223\262.aDC4G6U\312\271\\\271C\000\234\300d\027\253\226\226*\202\306\330\252\330\265\033F\266\010\324\0324U\02666\2503\022\305m%\2635&\311$0E3\"\261\024F5%\030(\244\251LZ*\"\",&\214\014\202eidI2\262V\244\2654\306\2121\260\006\2501cV\n\3315\242e\250\333F\326\246l\276Z\255{\255\361[b\205r\272\241\230\314\271\2071\230\306\352\376\2213\t\231d`@\212\347\226\334\267KE\224\272T\033}iW\256\277\207\253\352\221I\024\361\343\300x<O\023\300\273\220\236s\277^\352\304PD\212T\262N\232\335J\261\255\243f|\355\\\004R\210\215EY\237\365\t\207T\024\021uM]Q\3255s\230\r<\020\016\247X\305\"\241\334\242\206\252PSL\003\274$%\260E\032\202\253D\020\004\250\252\312\240@\245\030 \305 +\020\212\241\030\212\206t\020\014(\026\333\347\324\326CM$\242\332\250Di\266\254\233B\265\246j\032\243j\024\333`b\304\210\01020Q{\367\357's\313Z\021\017\355\204\207\327\371o\2154\013\033h\321\276K\246\214[\t\212F`\254\233\226\306\332\344\226\327\311[\345\276v\326\367\373\354\233EQ\266\217-\333ui\201\252RFH\262\014Y\001\022\022x\322o\337\000=x04\312\200\242#\271DD\364\360w{\306\253\303V#\351V7\177\313:\207b\035\322ED\236\346,\252J\356\224a(\021\010\204Q\270\205@\327\0241\000\240j\010\010d\000G(""\310O\220!\363!?\022I\334\351\316\350\252\332u\206e\3476\216\353M\313\224V\362\233\241r\354n^3x]\3127mZe\335\330\"\326,\226\252\334a\025\261\200,\241`\206j\336k\204\342S\023\212\270\\}\036\272BN\212\372\363\014f\013O2g\202;wy\225\256\336\3472qq\24570V/$v\332\0318Y\220E\037Z\\7\017:^9-9\243\251\226\233\210J\306\246\240o.\362\212\362)\3070v\027\005{u\231,l\243n\343y\273;\273\245\232\271i\205\346fb\266\270T|u \253\336\336\232S\271\314\304\0144\253y\315\336S0\272\204\264\004$\341\016\010\364\325\005-\225\255\004\222A\260\262@\355+I T0D\332\262%\251@Se\335\310\r\213\210U\211\314\341d7\214\225\027D\314\241\273SIM\023\2033\270g\023\220\345\270bc\023\272]5\262\221&eJq\302,\"e\225\206\226\220\346\346NS\034-\261)<\270b\207,+0\3547C;\310\215\312pp,\023\310\224\3355\303bnXS\271\267x&\261\313\314\341\372\270\027\0354\230\312\341\222\216\343\3128\216` \022\243\024\371\202j$-\034/!\325X\241\313\241\234\300\361\234\347o.\267\256ro\016:\301d\324\224yAh*\211\304\274\263bc\313Y\241\313\n\316\t\252\307\230\265\021\034\332d\266\303S*\336\332\303'L\343\273\334\014Ew\207\034)<\212\206Z\206c.\3328\341\222\206+p\210\262\253^\322OC\315\004b\243\345T\236\200\3300\271\346y\371\373zN\355\232\355i\215b\231h\325QjJ\260\222Q QVf\264\026\302\026\"\215\n\300\326\007H\347]SB\351]c\026\"\343\377\205\r]T\214H\260&\221\020#\022\002\302x6\206\307z.x\257\203 TB\310\345\222\"X\"\361\347\235WN}\225y\265%\261I\226\372\365X\322\256\220M*\232\252i@\331\3261\230\340a\374\210\355 \"\033I\352\007\262\021A\252\223\331P\277y\353\350r\007\251Eu\000\244\230Mb5\013\004A\313=\263C\0138r\312\020\311II\256:\340\216t@5\324\023]D\327\000\3275\314V\375b\032\023N\262\300\326M\\ H\246\2547M%\266\302\372\033^\322\301\203\022FB\242\330 \026,\026\272\310\\\232\312:\310\232\310\241\254\202\032\312\032\023Y\326\305\366\216\322\203\256kH\353\212F\014\206\324S\332\036\214\220=\341\362%\234\2020DdX\211 #\353H\303\334\020\367\342{\360\303mIb\014\3065&1\021\202\230\003[\233@m\n\016\322\250\355\n\206\322)\264)\264\246\321\220\317\224""\311\207\366&\306\314a\023aD\2521j\202h\205cMyRSF\246\266\r\213 \037\210l<\031\037-|\240\200Q%\022\203*\004\260\204\203\235D\330\001\r\200\003`WJ\016\302l\001\2046\004\374i\266\013\256\354@\331$\252\3314A\023@\343H\233\306\302\205\366]q\252wM\312pK\027B\260\331\243\t\267E\305\333@;B\033H\273@\233J\355(m&=O\332\272\301\260\0217\266\001\325\rV\030\221\337\255|\210-\362\364\250\241D*\250\206\220\003H\232@\r \016\2254\241\2440\342\335\177\234wQwu\335x\354\0020\204\010\260\233\002\006#n\033\024j\026U\263\273\265\013\027\000\020vb\225yA\274A\270\265\027$\030\220\035\2216Wev@\331\\\017\365\032\021]\t\031\241U\321\232N\014\310\005[\020\t\002\254\322L\361K0N\215\324\267\222_\005w]\016\2004&\203C\200\277\364\006\332\272M\270\246\260\311&\260\212k\032\246\212\nP\375\304VCYxA\233tQrg\303\005eA\327\263\013\024\023\334\303\210\230\3247\334\200`\226\212#\026@\330Ca\023a6:\016\014\004\206U4\256\221\t\003J\016\210\243\201\014\361\023\365@P\322j\311\220\264\001.\244\013\243h\251\024\321/\033\256K\245\320\214Y\265\244t\206\227F\007\000\0264\335\250\233\"*\032Cf;\3605\305\2215\221\020\320e\021\016\035\260\205g\020\010\241tB$\333\210\266F\355{\026\203\003fn\211\260\033\013\260\033\033\031\307\010<\016\2204\211#\030\334 \235(\210\206wL\024\035P\005\273q\272\351kK\214j'\014\nO\346\010_\260n\226H\006H,\304\335\nA@\260\225\016#A\354\312'\261\355\035\200\330\330\320\030\260\241~\301\260hM\324W\306\002(\034\240*\235R#\354v\373\007~\356\203\202\350\370%K\330\341\370\277%\t\204\014w\372\222\376\360\325\325\336\205!;\2524\244Z\223\027zH\207w\302\007\232\374\037D\227\350\365\374\177\035c\371\347l\227\343|\342\265\364\346\272\330u\247\263X\177\205\365\252iu\267I\220\315v_\372\335\213g\002\rER\310\341\376\0167\334\334Q\362a\356&y\253\023,\255O\375\023\335\273\037\233\245\345\300\0136\257T\351|/\006\r\315I\017;\276\217\372\226\337c\362l\202\323C\202]JV\231\353$4ovBek]\034\327\272\220\367\272I!\000a\314\244\030\007#\322\371\025\234\"\260\255\324\2532g\355\216;e\276\331\365\314\326@\273\372v\277E\222""\272\031\365q\"&(\022\013\24753w:m]\216\236\234\202\233L22\224\355\221\005\216\330^\341$*r\265\255\376\314\33401\251\034\032l\016NViy\004\3234\366\341aT\202\277\251rr=4\343Y\336\346\327a\253\243NPj\231\265\016\242\343as\000\216uI\362\202kL\263'+n\202\371\275\223\242:4^M\251e\277lLV\t\377w>\357\374t\363\327\221-\273\"/\260\217\360\327\252Z\"\301P\331\246Z\244\177\325\006\025{\036\210!\325\235i=%\031J2\351Y\226V7g'7*\004a\274\202\032\375\235z\316}MI\224\252\247K\272:\205bW\316\311ajk^Vu\237\251\271R\231u\366\235:]\256\314\013\334\342\271\365\341)\347P\221\316\265\207\007\245\245\332e\325\236\333\264\007\356\245\226\271:>\311l)\375t\341\\\3316\033\223j\342\336\301~\022\223\334\315c\344\350w}}K\247\201\177\367\177\333\217.<\r\177\326\375;_R\256\223O)\235\334\265\262\313x\305n\333M\364\331\262\342\031<\353]%\254\002CY\214\351m\255\376\222\221U9\252;\306\3302\254\343\031-9\322\353j0\345!<\353\024=q\272G\311\326p!\340\0248\344\237\023\304,\237E\371<\260\256\270\254\031\316R\317KhL\230h\361\343\221u\204\037\317G\212\\\364\226=Q\255$\245\231\033J\255w\331\372\036T\273cy/h\272\224\303\312\217\036\240\330\231\266 \342\264;\032\313\232\327\337\224\365\324\332\321agY\364l}\202\301\026\336\335\033\231\344\214Q\377Y=e\225\007\204%$\235\t\354\316S\352\256Ef5\207x\023\362\274\216d\323\223\331\376\375a\020\346\355^\364\354[\370R\252\\\375\025\203\377c\233\222$\260\255\261\250\021\004LL\246\372\224\345\327\203\261\247yM\374,4\352'\330\313;7\273c\305\210\366hx\034\204\365\212A\030R\003LP\244!\332\330\215\006_\333\357\026\266X\332\271px\270\244p\260\306H\265Q\357\356\242R9\272\nW^={\032]\267\007A\222\232q\356n\033e\265U\272\312\271\333\231\226\370c\002\335v\337\027k\2575r\236\327\325\215U\365\257\031\177\0354\331\235tEp\321L\240\306T\261\336\224T\224\017\214\320\374\235\352:\020\350\266T\220\256\2067\351z\226\005\270\026g\257\r~<\371b:\323\307\033\3653\242f\022(\373\341\332&8vY\206\334!\343\206\252\310\225\344\007u\232[\211[p\370\313P]\022\032\013\220v\252\361\241\367\247\345\035\027""\347\273\273\335\352:\351\213\313\272\377\002\326-\237\0103\340z9\033\360\016\016\2149\342\202\246\333\026G\305\374N\256\266\262\366\327L\325\357\223\216`y \214Yre7f\315\234\370\343\217v\177 \216\275\025s\342O\260B\251\334\356\311\365\374\231~o~\377\037\336=48\036\362\311\355\254\305\371w\201\367K\314\366|P-{C\305\221\361\323\303\243\237\232\363V\217\213\250\353\256\257\227$\313\"\230\325\346rZ\371\354\262\225\266\222\345\254B\253\324T8\260\347\221\322;\305\330'`9\3546\305\017g\334\333\276<L\360G\"\267\345\347\372F\253,\017\270zb\n\037\240B\357\231\333B\264\260\320\010\216\330}\0032!\014c\213\206\244\344\022\324\227\022\240_\001\2640\224y\201_\205\212+\017\216\002\217\304*\375\237E\247\277s\001\037D)\023\346\252X-\202\037E\024\226\"c\242\224\377\263\346_qI\334\247\346\373\337?\316\317\232\322Z\241c\355\373\212\210^*\t\231U>\310\010}z6\002}\205*\246\311\256P\020S^ \266\300\335z\\_ !\367\347\340\276\357\260\303H}d1\002X\307\210\271\202\005J\010\204`k\210(k\202\211\254\242\232\350/\361\310\037\252Hp\341\300\2659\230ch\377\t;\273\335\340\344\355\266\361\244\211D\340)\240Y\001\331\250\342\r5r\322\226\200\260\343f\213\253p{\275\320\204\206\301\304\r\341\276\214\023w\024\222\033\226\331p\216{&j\021\333\nu\256\226Nt\3049d\332\311\334\225L'D4\021J\256\316]\240\251\274\340B\332CYx\021e\307\267\302\363\274\353\333\246\225uh5\264\252Tct\314s\027\226i\262\331K\270Y2(\305q\240\345\301\304\342x\363O\031r\274u1v\266\334\245\313\333EX\216\n\271U\014\202i\303M\244D7\241\272\007T\204\333\246t\307\255\264\206'\267\233v\032TE\031\241\202\010\014\330(jQEK\024\204\017\014\346`\231CY\000\305\340sMN\334p{7\2602\032\215%\273B\345\223\233f\021\232\235\300\340s\234\333c-\005(\343PS\032\025.\3475\323\3148\362v\361\267&B\205ixs\013+Crf\306\346\351\260\264\335\303\233\013\202\233\224\350\0355\224\3200h\326\314\016\014t\305\221l0\377\324a\0148z\027.\236xt\323\222\251\205\256\243\230\361\334Q\357K\313sMh\347\0033/\2335\355\016\345\004;T\254(\327\314\270\n:R\340\312\221U\266\331\346L\303L\246\245""\264\343\273V\333d\233I*\035s)2\225\307]N=\357r\026B\021\273(\250\020! F,\2148a'Z\033-\242?~\205C\327\344\350\001\216o\310\251\030\326`\310\233\312\201\266\212\272\372\350\004\341\327\024:p\341\274~\273?\341\021\300\302t\214&\000\271\010\3006D\331]\2206\326\373\310@q\353\243\256,\232\302\246\262\016\260\256\260\263\371\r}i\261l\026\322\226\212\305E\241\204\010U\001P\310U\007\001e]A]\211O\3170Z\202(\351D\322)\244\023H\357\231\204\300\006\360\013\254&\260\204\"\032\313\254\240\016\005C\374\rd5`\310\034\020j\004\"B$a\031\010\251 \254\207\370\351D\257\300f\001.\013\202\373\001\305\005\276b\210k\252.\270*k\210\032\350p\273\032\270C)\003\243\004\330?<\331V\035\356\026B\177m\024v\243D\222=x\217)\276\256\372#\236\255\367{\356\226\250\333F\261\250\261QY\275m\325&\204?\266i \227\006\224[\240'%\300S\322\207b\033\310\241\274\000\033\312\233\300o;\332CN.\304\016\230\000\033\310o\253\266&\330\211\210\020\304!\331\331\004\333\202\021\210H/\3770\374\273M\364\320\033a\326\211/\230z\233\235\rd\016>\246\rK\201=(52\256\030`\315r\364\025\033\224\030\033\224\031\216Pc\224\r\264\006\2319\362\215\324\371\274\235of\203\244\037\370y\274\205a\335\375\237f?\207\007zdN`\2212\324(\300P\342\311C\3714zvK\252\216\252\240n \217UC\226\003\016/\347\224$\200\020\200NJd\250\233$sK\271\335W~R\337\225BV\336~f\266}\273\007r\022\035\350\245\204:\360$\01463\372l\240$\023\225\004\352*'Q^\240\007*k\270\004\301\177)\351\010=,\236\036\023\361KN\232\225\363U\037\014\231\030u\245\177[\n\261A\022\033@\254\005\200r\026\261P/\205\025?\337\314\332\311tj~+\250\341Q\322\"\234 \233\211\300I\006I\024\204w\252\203\244E\242F\t$zB\373V\022\323\276h\276\010x(\215\257\365\257W\275\034\223\301Hr\235\356B\377\031\007\246\203\310\013\304\211\310\247 \035\374\016\"$\302_\321\003\177\341\2408;4\247\335\373}e\363\374?M\326G\364N\357$\373\321W\372\375\022\212\376\005\370\236\276\312R\335 B\177\364\360\237\022\376\367\374\245\233w\355\277w\355\375_\207\357a\375\377\351\374\237\374\3132Zt\377\257\034B>\277\321I}\237\307tK\372\354\323""\356\003\334z\0233\034h\237?\220W\310\007\220{\307\255\342\361\260\200\302\014H\203\"I\030?\022u\351\374\207\260<\302\220\036q\233\334\233\376r\371mR\030\374\365\276\242\223\036\240c\330\t\355\t\354\203\355\001~\374<\320\033\276\001\370\005C\270q~\372\251?a\262\202\034GM\t\n!\022\021\367\371\272j\2750zh\371\302'\277\307\276p\0211\264\225\371\027M\032M\244\373\177o%\336\272\236\227\332\375\334\273u\002`)~\010d\200\364\224:K\322\016\210t\202\36087\007v}\310\375\377Su7M\3015\266\223j2\014\201\002\033\205\024\225T\222M\315\241\275K\235\322m\323{\374f\014\032\300]n\256<\235\034\001\275\016\204~\203\003NN\247\317g\201^\001\340z;e\346\202'G\225S\265\351\003\227\327NO\277\345\262A\362]u\272t}\0161\001$\222d}\035\347\243\236\242V7\336\240\370\335I\316\352\374+\351\220\305\342 w=\177c\327\013^1{!$\222K*N>\273\2515/\330\254\266_[\036\312\371\n`\236\222\013\230\372b6^\001T\220_\276!\232hdf\232\266\205\352\177O\364~|\257\312\343%\215\261\226Z\235\203\023:8\326\225^`\362\203x\374\177\247\336\034\356!&H<\016R\215F$j\332~_\351\017\361\247\347\323\236Fw\364'\346\222k\316\3311\265\034\340\363\241\316x\017L\275\017\322\213\322~\242\204_\326\203fmT\371a[``\226\207/C\350\377\225p\375\337\325\302\026\273\370|\245\217\007\266'\032\235\216(t\300\351\300I!\220\231\035^\237\355\353|m\325\370\354\240\347\331{v\203\371\347\320\005\205\270@|\251\217\264\201\327\235p\036\270u\303\256\355d\3748Cf`\301\355\240\235\337S\327\373)\351[\270Z\322D\362!\320$\013\256\360u\254\245J\036\372$\217j\260V\025]\336\325\377\240\266\265M\005\221l&i\221_\360A\327\236f\3772\303\363\325\316\302{2\307\342\335\276\375\017\370\267\372\022\332\205\376k\252Z\244\230|[\035\361\037tG\276\346a\337\254\263\331q\256\214{\230s\341\213\213l\312\354\243\2734\211\241\201\224Y\363\311\202>\347\244MC\027\326\036\030\235\205~\213\347jCa\014\224REU\024g\246h\273[\272\272\366\353\267\335\347\216\312\357\357\367\247\343\024+\321\326\022O\205o\317\253<\226\365\356\346\314\266\322B\256\242\227\223\253\341~\2329%\215\016F\375y\r{\326\330.""\234\326:\013S]F\375k\002\332\244\223$\225~\203;&\352i`^\226\004\244cD\3323\037\013\034\300{0\372|#\344\\aP\350\255H\223@\217?\027Ko\271\310\035I\317M\375\336\235\3217=m:h\262\347\r\026<[\315\243)\344\366=\366_qr0}\005\304\350\345q0\211\\=\327Q\312\354|l/\3239\313\005ym\313D\250\263\215\031N\210\321\253]\324\312\222\323r\246\367\3122\276\315:k\266\2636em\232\013\255\225[\033\260\234\257\261\331?\375\034\323+\227\364\221u\367,\267F\026\332\267H\224\366j\221]\326>\013n\235\265}\230l\214\356\323*\323]o\215\033B\364\324\n\356\235o\261\361\254]$\357\030\250\201\213\313/\276V$\213\250\250\364\321\221\215\326\347m\332\023\332E6k\272\014\354\235\263g\331M\204\016\364\252\264\307*\350\246\t\244\244\032Ad\036\234\2263\251\341\340\324\324\361x\246\225\255\212z\246R\272`\341\307\226\370\346f\024\327\236t-\261\214\204\354\233\014q\272zV%)E8',\351\232\006\245\355m\254\264<\356rm=E\313\032\230%d\364\274VK\023^\352\336\331\253\351xhe\262\"!\350F\263\034\264\346R\226\262\271\027\250Y\337\215\363 JCCNZ\031\324\244\257\225+{\316 \265\203M\013\323^;a\020\264\3343\261\233\342\206\276Z\325\222\236\275\216<\363X\275\2230\232.\241vW\333\016Ek\265\354\267\tg`Mk\322\361ye\265\276\230c!\251\n\201u\305\266[<V\271\316r\232\236\207\0135\352,0\226%\345f\311\250N)V\236\311h\244\242\036\314\035\t\254W\324\311(\r\023\326\225\304\261\277<\315,\207\231I\030\301\216\016\333s}tv\272\3222\325;\325\224\271k\306\253mp\213o\212O:<\354p\301i/\260\261\304J\272\361\316\230\353\326J4\334\330\312\324\323\244\257|Z\341\265FV\026\233\301\207\3218\204I2\200\360\r0:\237v+\020X>\223\226\005\373\r\215+\200\304\2049uy\330_&\346\304\327\207\251<c\"\230\321\336\245+\020\332K\026\213a\351(\021\2149\nST\037\361N\305d\260\276\365\224\364e\3756e\272Zl4\230\352\323f\013u\257\267\0135N\312\\\332b\323Ae\357s\226\226XY\2479e\201\205\231\"\302\205\330D\016\345i*)W\005L\014\212\264^\305\206VgeL2\272\014-\235\3034\306}\024'E\252\352\006\202\363Di\303\020\233L\304\214\035:I\355\260\271\026N\321\213\336\313\362yRf9\322\311\200\364k""\261\276\322#\005\243D\263\246I\230\225\354\326\330\311U\020\305\205'\233\337e\273c\005m\266-V\356\214\363\212OU\036\212\3060\313\r-y~\025b\250\tX\306,\207\220\364\2159Nra\"\367\256Rq)\030\264\314\232,\305\214\006-\3279U\232\342W\304+\304\310\252v\223\337\247{\335\255\355\321jS\257N\374\036\242\023\234\342\336\273\237s\2413\323\244A \222O\203\347\3262%\266\226,-7JV\317%\246s\234\246\247\241\300\236\215Z\262\303Am\230_\205D\004\237:f[\2165-U\262)E\232T1\220\366\266#\221\004A\232m\371\276\253\336\302\270bJ\353\236\335\226c\247M\253U\231E\371E'\252\227j\275\263\327e\224\277F\210\223\346^g'\266\314\363\351\257\033Vx\243\224\355\324\365w}\311I\024Y\024G;\337\256\331\355\264\254\245]\036p\246|\320f\362T=w*\274\332\023\006:\357\033\307\315\0263\362l\225g\\\247;0\305\360{o4\316\371l\317\\\225_,t\276\353\237f\234#e\322\246\232l\254\260\215\312\250\236\321\355\0178\036\303\343 B\002v\373\357\216\007\201/=\216\355\217\270Q\342LX\202\277#\220\276\025w\350\227\246E\021\352\364\372~\234\246z\374Lq!$\014\230G\222\251\016\342\211\005\351\300\203\274o!\274d\3367\244\222.\345P\023\330\2506\034\016\"U\376\240s\344\267[7*\205Dr\371\335\204\270\303{\007\030q\231\205\271\205~\277`\r\360\377/\233\340\\\347\323\355N1\324\375\255\377\200\210G\353\241#\370\177\273\311\353\177\232v\177\237\367N%\247\260\307Y7?_\253\313\326t$\321\326\024@:\004w\371\356'/\256\323\244~\204\035H\263\255\237\233)y\203\237\207\312I;\347\267\377o\323\311_\341\377I\212\344\346\352s\037\2220\367\276\222\337\2165\374\357\217_\353\357]\002\227\331\362\007u\376\367\331\363{<~\037\014\376\305w\217\331\360\372\275~\277a\361MM\302\027\3655@,\242&\025T\013\300\024\355~\217S\326\023\325!G\203\356\330\372\260w=\317`\365\354Q\341\360\344\271\360LS\333\374T{\030\366\320\023u\021\335\020\374J\355\356Z\215\334\025\237\2006\331\233.\322$Aq0\324\333\263\010F\2266\306'\257I\020\351{w\200\215\306\031@\342F\340\271V!Di\00136O2\245}w\335\253\030\241}\367C]$\0038\027;\216CD\324\211\216^v\351D\355\226F$\246\233\363\340\323\314;\343:\222""\223\311\3343-\307\316\013N\275{K^c0\316\243e\246a^\332l\251A\265\255S2\256's0\245\263v\232\350\331\270YZ\226\337\035U\216\024\267\314Z\363/\216\231\346q\304\273PA\033f\271\02418\234\351\270\327w;\316\346\243\217)\275\271yi\301\271\2076\261\316\264\352S^\273\265.\321U\3459\262\t\266LC\261\235p\313\3015\230\014w\234.\032\016\321eU\007\031APRp7p5\326\241\273MKMD|\227\233H\034\216\003\034\344xs\370e\320\255\275fN\031\272v\366i|\247\025\202\253\317%2!\302\223\254\230S\327\251\347f\366\320|\206V\345T\346\030\030\r\007l\356o\016\226,q\246\025\014\n\360\023\001\022\213Q\225\222\311\305\2666\366\321\2633\207\023\215Gi\206_3\014\025NZ\362\226\355\271U\314\245\302\230\307-n\027+e\243cG+79\265P\342\002\335#l;\331We\013\016[d\306\361K\304\211\302e\241\220\344\336\216'B))J\251\344\355G\212\326\261\363\0037\302w=\250\377#\342\362/_\227\306\362\362y\322o]\277O\341\227\356\002\214\200L|T\364zM\014\037\327\216w\236{\246Y\351\364\010\361\3745\217\204\267\314:%]s\317\341=5\364\316\310\303\323\331`f;'Y\230n\300\035\220=!\346a\274\036/\017\225\377W\220\237\301\375?\004\221\351\373N\307\367\331\360\323\004$\026x\231\274a\344\334l\325V4z\207?\347\366\373\275\242\343\233\216\303\317~\327\037c\263;\030\361\337\324\352\010\033\n'P\024:\202\006\322\201\324\374\307+\357\364\203w{\177\247\341\262=O\214\366\256\304_\306\251\306\016\277\263\251\213\330S\374\263\362u4\376\216_\207\217\233\330\366z\300uz\337\227\252\nHCeP9\001\344\021N@\0019\001C\223\223\223\335\236\364:>\244\2071\311w/Q\273\2264[\355\324=\027|\270x\361]\326A\353\013\333v\361g\301\240\373\350\177\233\326\344*q\360\23590D\376\316*\262\346T\036\021^\021T\341U8AN\035\240\336\203\303\301'\013\360\235\036s\364M\342\376\226\371.\300MK\207\351\201\302#\302\274#j\370\3755\3419\370\t\377\003\265\300\260\273\242\002\275\021W\242*tE\003\242\240\035\023{h\350\035\003{\241\341\274\350\273o$\371\307\347\275\312\363\372\312\226K\306\376N\233\003\035!\233\2466\335\245,\316\2751\271\371\022\374\234\341]\024\024\350\240\007EW0\t\231\000\350\360pl""\204\353ku\357+nlG\376g\333\034q\311><9p\225<\274\374\200\301\314\r\31416\346c\270v\006\363t\371\316\237\223\311\3208\033\370\224x\2218\204N%N%\016\337H\354o\366\372\033\373N\016\032\351C\207\007\331lX1\343\243\311\323\342\341\007\204xG&-[\370z&\372\356\240\233\240\243\272\240n\253\272\017c\251\352\236M^\326\202\2119\246\336\315\374\332\352\355!\264\226\340\3329W\331<\320\207\261CP>\333[\355\203q\344\307\374\227%\362\363\243\253\367\377\333\244\242t\200:Ht\201\351\003\324\304p\372\335N\031\326\351`'N\025wvwz\332\230\016\233\323:f\322l#\260!\260\246\302\354&g6\267k7\371\353h\230x\357\305\247N\2277c\215\016\027c\327\217\037\341\376mv\272stC\200\315\300\304c\200\333\215\345\276~I{\375\312G\016\0077\030q\207\030e\315J\373\315\335\377\356o\337\376V\350\377M\276P+\227\373\373=^ \303\347\313\371\347\022\034H<N\322q>\331\303\307\3227ztqtN\271]\354Wq\007\006)G\027\t\326\023\375\267\337\241\351\364\n\371a\272\006\350\246\350.\353\273\331\355\213go\016\022%\305\260\331\177om\272\203A\241\201\264c\273\301\377`\351rHQ\253\237gI\315\242U\331\260\303\233a\263\230\016\373\037\364\3346Zz\226\377\017\215v\264\316\346\377\325\257\326\337\215zS?\372!\204\374Z\235i?\227\347\323G\352\353~\023\342\370\353\372g\273\233\355\305\350\373\230\352B\t\370P\375\t\230\3250%\277\205~\233\r\021\037\354\317NK\375\366\326?O\362\377\371\374\362\037w\361\254\226\177\317\222\376\356\0176\n\226i\217\343&\325=\264\240qp\032\270\360\177w\367+\3427h\323d\324\323\251\315\352\212\316\2218\202)'\234\347F\221\227\0335\343X\311\214m\274lxZ#8\374\354-\240k\306\316Y\253\025K1\2276\315\361\225'\n\357\365\224\026\235\372\364\202\364\\\212\343'\352\356\342\214\203|B\256\221\263\030\370\377n\231\332\260\013\010F\367\221\010Q\027-\343\243{0\374F\3416;\tq)^\346.\346\014U\336\001\302\221K\337\367\311\233z\330\201\240\376\307!0\301\372PW\263J\247\347\206X\273\320\021\337\201\216Ii\247\356\352\355\354ko\030\261t\257/\257\364\202\240X\354\335hW\272\351.l<]|8\357\177\355\355~\335\027\022\324\t\372\252\016\204en\263\223c\250%""\3254\023\r\333\207`u\307\251\033m'\246\336\216N_\373\277\340\356\377\247\\\241\310Q\032\340_2\247_>\306w\357\335\272\035\372Zu\326\335\370\343\332\r\342\277\251T\213\230\312`qwS\207Gnkqc'I\307\032\220\353\252\235e`\334\206,\343sgk\241\344kN\276\240\304\3403E\222\361\352uFP\366q\250t\246m\214G\2220\324\262\347\274.\265,\264R\350C9`6\001\316\337\023I\277i\250\325\310\343\312\310\004\307\342vgws\316\375\3723\273\267\275\326JG\366&\"\036\"-\231?\310\357\332\324\022$\244\005\310\270nS\224>\262\364\204\277\366\tT'\247B\347 a\305\341\317G\351u]\002>\352\003s\207\3672\254\030\252\355\017A!\010\030\322\316\244B\300\035\364l \242\242c\330\255\313i\001k\022o\257\350\372\307\373\377\212#\360\316R\222\233\376!\250\302\241z\0007\010*}*\250^\n\030\024\035\263\321\356\374\336\325y\377\033\374p\017\022v\351\332\253\265\3254\031{XPRa\021\246[3v\310\204\213\014\226\037\253\n\313\264\2235\0365\226X\333\020\273c4\331-+\264`d\204\304\205(\213\332\272\001\216\177e\356\353\335\252B\211\240\222\267\003\022\202\250\3426\033\263\003%\303\003\246\32512\247\351\236\303\276\352hc\322>\213D\365\330na\2536>\251\020\201dp\030!\021\234\207)\010\343\225.\221i\246\351\264Z\254b\312\2061\020m\021/hgo\014.c@\344\332$\021\322#\010\230\261\343f\312p\322,\"$j\005\314x\001\3044\340;l\332\303\001\rKd\310 \206Dr\0019F\360\024+\211i\306\021'\210\244mV\2064\"\033\033D\203s\223\217\002\300x\220\010\322\004\2204Xx0X\341q\226$\n6\032\023r\305\2201\252\026 @\300\262\033b\033\252\345\333\260@\232\023\031\016\341\3206\315f\0244\3606b0\351I\202d\243{Ht\300\244QA\207\234\314\267\007\006be{\233\0346a\206.Z6\370\227\002\304r\231\272S1\016\240i\214j0\250\031\247\034=[\r\266w\0133\326l\307:$/\n5jQw\t\254\n\207\022[z97\3274\213-\374/AZX9\002$\003)\003\2645\362\035\201R\031\325m\n\240:\212\244\207\014\003\323\211m\300\004\244\346\215\356\333QF\230\325(8\235\264S.\334u\251\226\306\333M\271\r\333\255\225r\325!\002\024\237QK7\332tC\314\274\202fX\201\332/\023g\033\316n\210IR\tD\240\224<R$\217\302\033\330\373\230\373\271\203""\325\350\357\370<\336o/\234\035t\022\177\247\331\365/\017e\020\235__\220Fy\316\033\325\243\267?J\234\375RX\331\247\355\371&\311D\335D\254l\257\006k\276+6v\364\265\337\024\265_\032\025\014\364M\326r\247\227\3745\354\237\314\270\356\034\330P\335\242\207\"r[E\311\354\367\347\242\342\364rl\344\366\360\3421V\333\227\312[m\037\2036\314Fm\274z7\273\327\333\236,|\377G\023L\343F\306^\243y\307\377\233\351\005\364\016\036\321Q$\233\332\377O\307U)B(\241\023\234\351!R%&\362\364\314\220;zSP\230\2235\323\212\223fL4\225\207\367\200\020L\237\300t\037\3405\260p\341Uk\373\316\333e\311F\013\222X3$}\242\004m\344\3332eOY\3617\231\275M\350oQ\352\367\037\037W\341\363yn\357\374\337s\213\310\373^G\271\313:p\001\n\356\035\262\275j\361\322\026\347\327\303p\\*\014\347\217\237\306RL\322\007\363(t\207\200h\361\013\251\347^i]<\216\300\376{\231\350\376/\346\366ki\033\n\326\367\225\021/\205\375\221H\217\016\320\356\227\333\267?\222\351\266I\r$\337\n\035\030`\355\013\016\266\226$\263\032\373q\273Mp\211e8\225k:R\257\216\r\226\232\005!q\323\016\221\273\356\366\362\331\231T\\i\204\026C0\306\334A\270d\302\025Ga\251\251\367\216\343\361%\271\3101E\371\333\037\312`h\t\017S\001\006\033\2142\260.\032+\315[yn\213\236\335@K}>H\3425nU\223K%b\235\357J9(\210\262=\r\353KMr\305\304kg\320\227\3377\210%\25054\364\364\313\251\0373\t\263P\351\3150\3479&:\346\355Z\376/\206\027\330\375/\272\310\255k\013N\364]{\006\\]\241\305&r\006\207\233\216\nm\224qf\223\321\372\360\354\366j\327\201\263z7\001\352b\250\3526f)u\205\n\021\277\3769\214|a\311\370\217\313\356\313p\007\312{\366\315ts\311Pn>\223\373\223d\\J$\256\270rb\374\"H9\321?\305l\024N^wM\300\211\014\373o)p\220\214\006\327Sd8N\352\274$\354\356\235\377\362\220j\032\003\256\023:\235\261Ke\023\232\005\220\335\202\306\324\211\n\364\016'f~\200tJ\233i\364z\234\260;{\265\264\036%2\353\201\361J\363AF(\244\343h\021\016\360\357&bM\002j-\nA\240\277\014&\034l\034\035\323\367\\e\20087\"\3012\263\306\223z\032\245de\235~T5\215\036B\254UUUC\355\232\365-));\302\344'\362\304\340\024#\020C""\177\243q\336x\317\327g\232e5\315\027\276l\023\346T\372\321E\276\377\033\024*\250U\025@\025\027\340\311\2069i\370\202\313Ub\224\267-0\374JG\314\321D\231\010R\032\373\276\250\023\327|\272h\031\304\002\035>'\3241\324\274\2702\351:c\233\316\207\235W\316\002y\325|\340\207\235\0378\236s\253\017\267\311\357\374\\\277\007\301}\335K\256\274\367~W\346~g\322~\007\267\356w\021Os\276J<y\262\350\366-k_\340\302\016\233\274=\315E\";E\317\002eB\357\355\263\362\335[\014X\017\"\002\324\026\367g\354a\232\313 s\020\001\306\247\307\371\376o\222Zl\371>j>\300\256w\313\354aYw\321e\"\022\213\204FZ\354\267\n0H\247\324\300_\253,\265_\340\262\2468>\005|9\331l\314\267N\rW\366?\222\n#\377Wa\305\310\376X\362\231\"6\032s\304m\202\326jWi\227\331(]\027N\356'u\225+\017d\336\305l\347\027\231\313\211\360\327o\267\350K\345t\227g\333\177\330\356}C$\336\016#\332\247\331\371\376\177\237\217\351\371\354=\337OE.\276\312\312\263D\336\332\313\226}\253\251YE\262\235n\240d\237\0221\347\311\217\245\337\365&x\364#\316\357a\365\351\321\336\210u\340\217\334\344\331\321j\214\257\255#*JWR\262u\215\320\242\351\343e\007\241\224\207\263\010\037\266\343\3549\351#\260)\314i\"U\216L\230\324\370\321\276n'\256\265\334E\273~\230\204\204\232\341g\034\373c%\"\313\035\253b\234Y|\371\372&<\233\376p\307G&\351\\\033\210:\337s\034\262n+\266-:\365\352\035\342\363\253>\256_\177\251iwS\027|S\226\230=]8\260\262#\203\311B~\247)\307\006B9\276\367N0\343\273\234\301\364<u\255\235U\213\2052\256\311\337]\n\rke\366F\232=\252\375\220\225g\213\331um\302\256\357nx\306\rn\0253\224(\320\343\311,{\376\211\352\305\3714\232\340{ \262\313,\303.L\357\213\257,\276e\224\262\312\331*\332\266Y\234\370\257\262\th\211a\322m\3169q\241\345\343\212[W\337\232\365\365\256\037Q\361\320\263\335\345\237#\227\302+\237\n\310I\"R\352\2258akc\257(;\002\210qW\206\255\033\251:\273=\036\254w\350\207\305v\373m\375\346I$\333\370\213\2108\274\336g\305\213,\022J\373\201\307\335\315\315\244\327}\254\212>\346\022\306F\356Q!!!\026b\225\017x\037\036\245\320\213uD%)u;\247s\236:\355""\344\357\237\226;F\327qQ\023PDo\350\360\367\274y~T\355\322;\367Y\334\360h\360\354\306\373l\365x\245)9\326\275\372g!\331\354v\227i:;3\210~\366\216\255\222\352q\341\322\025B5\017\237\342\320_}\367\231\331\3236b\272\034\037o\341\364.n\331A\246\343\2633p0%\342T-\202\014\2441U\364\335V(\301\324\337\356\374\3375\025\300~\377\347\240==\245\005$\024(\305\020\373\006\006;U:R\232~\276.\323\002\252F\352\224\252\017x\226Y\354g\3410\366\2456\256\337\tB\237UA\027*\303\370e\020%|<t\337\246\213\033\276\212\020\215p\317\010q\035\216\207\t+\374\256B\210s\025\304Lv4\241\373\357|<'Q\016\224'w6;\255\033\202\330Q\306I%?\013*\033v\024$\022\016\277b\030\336\270\013BJ?\217eD\313.\356\257\240\344\347\242n\n(\242\212~\020&\367\222\027.\365\"\rK\227\r\252V_\243\340\213,\244R\217[+\312\261\025\343\216o}\227\327\310\374\202|\200\201\362\000\201\362 \007\310#\362!\310\037\244\363e\334\373\277\023l\037\027\010\375?\267\343\n\341\347\235h\203=OO\325\203h\370\254v}\313\322\335~\313\356\335\3577\334\264&\301\222\270k\257n\344\333\362\3746\271\020\020\030\025\205l\242.\270\271'k\275o\201\255r\225\217\331\343`X\030BS\002\221Br\2051d\024DL\240e\037\020\337&V\240\315\265\246\261\202\031\225F>\247\272m\262vM\246=\020Dw\361\372\253;\263r\366\303Ac^\032D-\016\332\240\271\310/\004\032\304Wf+\006r\215\261\255c\006\r#\214X\305\267]\231X\371r\227\310\304\207llp\312\037k\027\2663h\206J\2036i\232\320[Vy\332i\263V\234!\205|\236\322uz>\266\212\3315h0\nZ4]K,\276M\361N\304Z\322\035\260A\220\0027\325h>\367\265\3145:\256\226\034X\221\203\214\226$1\221\251\215\211\t\206\000\355'\276{c\033\366\315\314V\n\364\304\ng\276\314\313\003FZ ]\324\032\305\222\302\332\007.+\027\217\342\376+\362\034M]\036I\200\"\027\327\307\226R4\327pI\264Zj\335\022\033V\367/1\325Hf\006Mj\013\257\007\341v\234_\372^~[\302\217\321\373+\324\233\262\355|\217QF#6\347{\230\336\211BV\374/b\263Sp0g\333G\036\315\032\037\345\tF\275\256ga7\275+\\\221]V\204J.Mj\265\036CP\337'\302|1\"\376\243\223D\230\356\323\254&\365\317\323Z\251J\021\361\241\341\375j\224\235b""O_l\276\300\351Y[ED$\256\346\347\371\3050\310-sj4k\302\326\361b\032\264|\251Z\004\220\330\014}\340ke+\356vy\271\254\245\321\214\240\365&\251\253\014\255\217\"\276E<\210\017\221D<\200\217\220\003\310\037\217\207\333\342>\277a\201io\273\344?\000l\366|\213\210`;\214\0079\357\367\373\377\024\242jPw\372A\336@2\0175\307\237\356J\357\266\352\223\233\374\207\246\360\265\214\320y\217g\\;\302\362-+\304\273h\367\276\267\217\024\241\220\222\361ztf\335\275\3737nZLu\371\033\352\370y\367\207\266\362\353\337\235\264_\177\037\232/\237S\250\326\260s\246\023\004\234\261\"\177\036%J\222\236j-\237B\271g<&MP\350\277\275\246\353\257\255\350*\256\220^Flp@\222\224[D\3352\223>4T)\027t\005O3\003\234b\031\010m\3308\337_ly\202~\207=\210\352\232\304%\240y\245\r\n!\341z;d\014m\250\027\241!\222+\333=!~X&lRJ\004;\275\231m2c\355\3303\215\315\354\272\364\311-S\3551XC\031hF\231\217V\360RLF\037\224\362\330\241\2324M\276\2522\300\217S\273\342i\332J\301\031\225\004]\033=t\210\211\314\221\203\224\000\267(wz\016Q\230\322\206\00566A\314n1\272\346\255\273\242R\376\232}=\251\227\351+m\320M\254\272\237ig\332p\035\335)\221[j\332\211\r6GM\356\2350|\347-\261\305\017I?_\257\244\222H\222eh\"H\360\221$\021\266\333\361}\366\206=c\327\037 \n\036D@\362\010\007\211P<B\217\220C\361\371Oo\311\326\366\236\3200\274/\270\376i\373N\340\332Y7\254\374^\016@\341'\232\234\234\242\222\343\222\363x\316\321w\321`:M\361\375=\357E\266\371\021\350\2630'}\3463\2200\nX\3743\207\365N\262\321k\301\330\235\327QHbP\026\271L\017\013\264\362\312\333\2445\205\217\243=\030|=\251Y\204\266\222r\222!\361\221/D\306`\3074\010-\322\0204\002\rR\214\035|XZcA\361\363zv\337h\207\243%N\004\356%\"\304+\233\266\023\024 4\0033v\310\202\245\0278\033?r\345\367\2400\342\r\275\341k\027\320\267\007Y4L\301\200(z\017A\266\337\nR\t\210o\010\201\311X\016X\"\204\303w\226\276J\t3?\004\320\365\317\376R\314*\262\222\366\232\276v\355\036NG\340\000\272\363u\325\365\351(\374\032\242\234\002\017\355U*\243Y\242\305\022}\257\350\375\312\252\334\357\354\214\235\345\007\235\001""\357 \236\232\217\246+\336\000\355\201\337\372w\037)\355W\233\365yC\312\035s\351;\243{~]\376>c\343w^1\373\307\223\307\345\361/\202^(\370\n\206\004\343\303,\372\314\0321~\022\237\3337\017)|\306\321\226p\322m\n\305\3502\225=\352%\036%\367\340\264\304\333{\2641p8w\375E/8\32145P\326\242h^\231\3168\206j f\222\270\t\336\343\310\260m9J\001\225\020\231zm%\345}\270C\274\242R\2270\374\037\256ws%\234\030~!\241\325\1778\222 \302\272\r\277\332\021p\242\2163\004\337\242\322\305p\324\242Zv\327\266'l^\332\217l\023\266\217m;\\\036\037\312|^\037\223\336zxB\357\017/\204>\363|\010\177\373u}\024\353\362\362\216\356;\270\356\344x\330\353\2737_\267+F\356\002og\202\242]\370\2367\023\256+\274;\243\263\354w{#\032c[\306\240H\032\322\277\005b\264&\241\005\347\220\357^M\246\352\272Q?#|\214\023\2613k\270\301\256\303n\326q\335\276\013\006&\246d\031\264\273\322\202\030\030\304W\2144\376\212\220\314\337\026\237\201\016\236\013\262\311$\231\335\332\032\333wbK$5\206\265\305\305/\256\"\273\377\003\r\2651\255\001\306aO\207\003\354v1\014\206\315\251\204\211\214\310\275gR\366\024\220\334DA\203a>[ou\316\320\024\316|\213!\n\333\"h)|P\271\217\262\344\255P\300\2144&'K+\312\262R\363\010\3013\004&\032\330\317\234\321.\223\212\304\300m`\260\021\007\023\237\213\303\365\316\227\037\324\335m\227\223\212\336\177{\226\325\013\3559l\276\207\035\025\354\325P\217\227\356\355Ye\217d\025\366_.\274\203\217~5\374W=\325tr\331\311w\261q\347o\337-t%\311\307\323b__OX\217\317\253u\335\324i\351\327\213U\324]\336\210\350\030\260;\347Cr\357\246\275O\315\257g4\250\266\033GTNk\244\020\272\343c\247\220\357A\357\366\337\223\336\230w7J\034M\333\303\320BjX\307\347\230D\260\025\2170\2678\223\022\241\023\252\350\353-\245\033*,\003\245\327\371\350X2\320\t\230\250\233\210\024\270n%\277\370;\244\244\375K\300\277\351\227\302u(\235\314\013\002J}7hx\323\336t\222\033C;\202f\350}\360e\277\340>17\263'\337L\267Z\325f\246\010tE\014\r\034\212\257c\371U\321\331?V\035\300\335O\311AG\252\273qF\370Z\016\347\0231r[\014I\234\222qD\242\"#\000L)e\207\362""\032\363\233\273\356\260\260D!mj\252\255&2J\002\356RC\177=\252Z\320=\364W\337Q\367\321\023\337\027\337_hO|\367\377\224\325\371\376\357\362\332\275\344>/\217\337\037\250\342}\363\340\207\301\355}\356`;\376\256\230q\365\242\036K\034\026C\326\200\207t\270\326\267L9\006r\317zX%\312\252\346\037\224\202\367\234\266\333V\333n\341\231\271\231\231_T\237\307\271\352\341\253J\346\016a\346\023\231\016e\346y\276>\251\313\313\372\241\326\330~\256\241\310\355\367\3015\353\347\334\372:\236\317\264b\343\342\344\031\361\027\001|Q\207\023\325\014P\220\266k\313\223\345\315\217\340i\205[\255\257\341N.\353\354:\377{\263X\355\223\2175\"D\245=^\312Y\361|D[vQj\367\347\202\205\203\330\276\333\354\272\246\365m\271R\334\251\021nX\021;\362\206\252\312o\3658\347\306i@P\365;hI1\027\t\016\023\243\2224\274\223x\311\274}VK\357\375\341\323Z\252\rM\023\202\252\"\211(,\213b\220\345\277o\310^Z\232\226\027D\245'5t\316Q\231\375?P\346\221\004\320CzRn\034F\360\327\241-\200y\303\316\336q\2179\347\374\376\343\332\177\372\377\077\077\257\320\260\364\372~_\224\360\036\246\364}\036-\337\333\374\247\337\374\037\223\240\265K\363v\2751\330E\033\326\307\223\327\351\241\362a\361\317\337\211\036Y\3702\307(\320m\360g\347\275\263\3715\227\254F\220\354x\203'`\224\352\326\270j\033\356\344\330\315$\242\205>\271\3765\243\210\300\256\005\226\354\272\371\024\253\010\207d\\\362\330\265\374==\177\177\332\370\246\\\221\345\371&\356\376\330\177]}\256B/\354z\010\r[\365\255E\310\033\201\3708=R\256\372\024\216$\334e\301\322\272r\233'\007k\035\210\207N\205G$\201\272\321\323\352\316\327w\236<\371\272\310}\0035\273\035 \216\272\210R\2641\013\372U\322k\3257n\\](B\315\205t\022E\315\177U\203y\352\350\331DZv5k\0052X\347\327\215{\3256)-\023\262N\343\361=G\035\0248\247\263\255\206\024\276\245cn&\3769\rc\2063g+1\211\347\301\376NgV\276E\2723\222U\253\255&\030\230\265\036\237B\241\226\034\366jh\370\036M\004\320$\275P\236\265U\211\222@\335\271t\336\024\014hd$@\272\222\036o\3719O\212a$\002\237:-\350\306Z\315\370\037zK\267\3047_\005\223\236\346q""\334\343\276YA\264\212R%I\305$i\013\004\2767\273\356\037\217\3410\2631{\253\235\322\035}E_\216|\302/\275\331 y{N\355\361D\247\334\334JIJWh.6\325&\314D9\221G\342\231\312\226)\237-\363\223hX\321\363p\256\300\031_\240\255\014\234\347\014}\003Q~\025U\250\243\243\2710e\276\231Om\254\233MZI:x\312\037't|\357\363\250\013\353\231\025E\3279\202i\211\215\276\032\276\354\207\245\223\344=s\314\036a\363\007\231\372\374\377\243\336\357\375\036\327\031\343\t<)\305\016\" !\324\203\307\336\373\322g\222c\355\366}\327\367\257\362|=&\363\372\207<\363\303\323$,\020\\\203\303\353\330\314~_\215\334\300\271\345 \0060L@ \022\033k\270n\333\247U\315\227\305q\030\025\002\300f\266b$\225=\340\203\364M]\332/M\345S\374\016\026\250BV|\216\014\220\320\027;\245Wt\332\006\243sJ\224\323\220nB>^.N/.\270\332X\333\3030m\000t\206\226\231\027\274\370\232\346\233\003\010\344\177[\337\312\re\322\030\342\206\272\304\223\026\373`r\205\347>d\202\332\032/\323\226\233\355w\275:#\210\340[\300T\306\216V}0\365qF\033v\270\010\256\255L\314\303\025\351\215\313\322`i\033\244\303\233]:5\213n\355\027\032\227\\X\006\362\010\220\333\n\021j\027QiaA\n\nj\225\372\275\345\370\204\004\353\252$\330\004ITT\252\203\274:Hoh\026\344\314\307\004\034~[`\ty\016$\241\010\363\216r#\177\267\224@&d(<\311\255\364\272^\275[\330\331\361\316\230\374r\3435\322\376\207\343\312#g*\244>\353\372Q<\2135E\331R\351\022\266\t=\271\016\223\2718\233\333n\211\365\362\302\365\362\352\313\363\374~]\275\255\032n\274\257\261)LS[^Q\272s0\227\307]\275\025\232\243\216\271\021\031cv\225\277h\365R\251\n!\341\313\234\371-\231o\025\271Ic`\247\276\261}p\333~\332T\271\251\333\302Zg\342\275\364\333H\324\262Pb\210\265\327\\\2520\211(\035\022\251B\347r8\342Z\267L\260R\353\355\251\002\210Z\241h\254!Q$NiV\033\226\016\035n\264\346\227\033\275\\\345\304\273)<'\314|auN\263 \241\246zlw\366\234H\\56\010\316\270\326\304\316\212\3544\301Z\275U\025RE'R]R\3114\346m\267\032\224,\006\356\210H`q\000'\\;R;\001#\323\247\247\th\331S\360\3324e \374\310\251\304\314|\360\021U.Yo\332<\370\"!;""\274\021)q'\206m\355\320\271*\360\317\002C\362t\016\262n\350K\314\222CD(\210\027a\314}\321<\303\3630|\307\313\315\376\336/\300\177'\273\325\260=\337\241\007\027\317?\222\324\354\022\016\322\361;\240\364\302\010\206E9\353\362\361\207{\342\266v\375\2673\267\305\360\267\306?\205\306\267\333\342\266\330\3665\252\216\367\004\340\210`L\265<\206\254\232\312<\275\352\312\223s\265\375=\313\365\350\013\354\001\323\262M\251\244\344L\336\370\263\014\002@3b\231\207>g\367l\221\023\023\227\226\211g\003\006\204\003\232\235\235\025AVO\334\310\207s&\243H5\275\332-\335\014\024f/L\0265~\\&\303\221M\322\034\243M\033\336*\206k\266gV\013\343\213\n\370j\251\026\343\273g$\265j#(\364\242hb\201\210o\276A\243\237\237\347[3\320\351\276{\263\254\372E\366k\346bm\305\313\337C%\312\332\275\244\354\033\236F\341\267\351\2024\260Q\231o\203.P\356\351\374FZ\003(:\263\206\264\033\003\363>\372s,\272\023\262\231@\231\240\252=NS\357W:\204\230d9\355e.\246\016\031@\304d$t\372ZR\324z\323lB\202D\017)J\024\347'\352Jjq\343 M\347@\354$H\004\200HY\005\206@\007\251/?\037\272\307LO\325\357\365\344\222\252\252\257\221\373v\r\237\267$\207t\204\235m\301\3303\203c\356:\312C\246\205\361#\336\230\342a\005\344\336\256;\313\301n\301\253\217\376\237\325m\207\002\373e,\277Y\313n\037\215\273\266\324$\376V*\255\223\344z'/\343\263\354\231rRZ6q\271\n!\354+KB\277w\257\326\307\254=\177p|_\237\371:C\326\177w\253\2640\314\336\275\336\377\222G\331\346$x\033\272\307p\245f\314\322^\362b\2011\255\367\376\233>\t\321\250\275\025\363`\017\344\250{\342=\014\371`\315\361\213\311\244%*\304\334\221Hf\200b\205\341u\014+qy\213W\027\256I\207E\367\343.\254c-\006&\212\022\214]\275\016}\024\305\234k~o~#\316\2134\\\305@\250I\211\014\001\255\016\262\036\356\361\313\022\246\310\201\265\352\365H\241\270\325\220hA\347\020\322.q\202\221\351\226rHt\221\245kAFk\211R\2104\004U\241\033\333XR\231\0371\231\2536\2334\361\3136\351\267\241\373\263cg\277\037,{\241\343\307\004\322#\021\205\nv\214\232\323!\002\352/,\263\\\365\275P{\235\212R\320\013E\002N\201o=\372\347""\212\276\033<\276\017,\374\266\304Y\036H\267\352\213\255\272\217d\354\227e\364\271\233A\247\215\"\226\310wwBM\331I:+\313\004\311\006\204\222P;\271\270\365k\313\312\323(T4\303\037^)\212\212\261\027/\223\361\327]\036\334\232\252p\237\324\313\307\277\370\361\333\271\372/\253\347\370\374'\226\367/_\"\"\"(\210\273X\232(\376\360\020H>\304\306+\343[\224Ly\330\006\223\210\263^\260\230w\005\212\243\030\207\201=O\001\340\357>\007\370\317\313\360x\276\017\347\376/\302{\247\214\333\353\256\374\355\3734 \235Y\360z\037\273\307\344\206\002\311\372|v\370h5\370\324\363\313\322\364\247\303h\317\365T)\353\362\355\374=\277\263\264z|^\361\007$m7pw\255),\324w\335\322\224?\202\0174J\264\276B\277\315\021J\242!\376\237\364\037\363J\203\213\320l\365\347\253cv\037#'\3258\351Q\360l\232}\257Pb\022\254|R\210~G\244\256\276E2\271\344\212\327\313\\&\223\327W\275.dX\267\246\347\335\254\020\272+q\302\255o#\341aS\324\326\023vt\235\276?\204\234[J*\263'\352\035F`\222\006\275\361[:\356H\031\t\222\006}\006\210g\205\317i\356h%\236\255\033nn\216\2403\036\214\203B\261u\362p8\226]g\371\rn\0105\203>^\233\372\323a\247\253\256\377\261\372)\372%\237\270\331=$\222\264\255(\224K\252\374\220@\031D\232\262\216\347\344\265\025U\263\365\017Y_.K\275\201\223_\251\324\275\231\307\266\362\374\361@b\335\343pC\241\204+S\211\217c\000u\255h\330a\321b\330\244\307\036\271rHf\260\261\212g\020\022\325f\271\233v\217b\010FH\320\311\265\220\357\325\035\033\362\216\250\"\274\206\373\034h\300M\303\253\317\262\375\332\367\242\362\3261\305\222m,\374O\r\307q\2237tGK\3439\303h~0\357\325.\3213\337\353\275{\234\321\335\221\237~\322\030\013\204/\007f\227\031\221hrJ\225\000\251\225N\277j\212\251:\2747\005U\027]JR\333BR\331\372\311\231B\325\245\2740\314\244\342fR\252\213\256\240n\272\215\360zc\332CI\314*&g(f71\335p\020@\2040\361\004\226\270\350\367U&\036\\ \\\224\202\317\001\312\020\0331y\037\213\023W^c\210>Q\342\007\020jf@:\026\375\233\254\014\200\n\037\317\312\027j\354\027\271 \032\3441\033\355\314\230n4\230\267w\225s\002\021\035XH\202\303W""\010\006!\200\022I\203\341\376N\217\364\344\360\344\324\370\271^\037\253\256\207\213\241\317a>\014\016\354\347\034\336$\227\231\250\260\344u\332\265\317\013\001\203Q\333\303lL\202a1 i\035\276^\342\367\272\275\224\254\354\004\372\211$\222Ir\035\027\237O\315\364\277\323\365:\372\247(\223I\376\233\256\333\225}\344\301}\325\363)z*8\020\021\304*!x\202\036\020\t\330\023\371\320=\244\347\233JO\023\256\244\3357\n\324\257\266\346\360\364\334\350k\301\017T\244Rq\243N\363]\343\212\353f\202h\264C\274\2033.Y)RM\242H\323/\035\"CB\212N\036y\223\227w\r\315\2464y\215\206\214m\324\327xc\004\202\243\016\322&\246$\326\035R\022\342\241@`\275\253\003\351g\373\235\265\272\0327K\013\010p\254\347\245\001pE\2724\313\206o\004\026\2556\023\262\004\212\252\312 \202\322I$\017\233\256\362_\230\361\335\034\266zy\2338]\365(\252\304Db\305E\267p\307\" \301\210\326UD\326\223\020\245\266\215\022\356a\205\214\267\332\302\355\246\2156\325\234K\245l\243m\247nL\245\r\262\230yq\034l\026VU\212\026\243AG\304.Z\3124|\356yM0\236=\037\030nfr\326l\334yX\016\021\211S#\2329b\370N\224\t\243\307\255H\351\0024\302\006T@\256(B\022\252\006cx\035\200\355\361eY(pV\271T\262`\360\331\r\230)n\230u\232,\330\031B\230p\270\0210\226\312\205\214\210\260K\226\212\n\035\334I\202\315x\303\030E\232\313b\203@D/l\302eP\346K\031\211Gw\r\031\250\333m\272\324\301+:Tk&L\310q\323-%\327L\3157X\240qP\323\215P\211y\226\365\301;\274+\255\315\314\256\3517\274\216\307Za\261\203\204\202\371a\210G#\202\362\231\010aZ\217#\010q\313{\316\365{w/\246w)|\334\301X\362\323\210Q\021\026[\007nwn\030\225\224q\345\nh\345K\2717R\250\222KD\204\3520\330#Rh\363\227h\336\260\212\300!\\\226o9\224J\325\313[B\302N\326Z\031\230\360\212E\220\003\"\020\016\037\254\355}[\2763\371\372~\204#\255\321\242\267\366\237\345M\3622w\370\376k\177a\366}\026\345h\\\337\226Ad\014\231\227}\334\231\253= \214\233\243\254\230\256\225\217\313\335^\362t\364\262\211\221\357\331\003}(I\214$6\014\021\235\037\325d\303E\016%\341sv;}\327]s\265a!@t\357\312E\205o\217wJ\3144\301c@a\016\334\362\376""\275d\345\360\331\320\334\255\275j\004\01495\325\253\030r\372N\353b\251\252$\251$(\252&\203l\001\026\215\246\232,\223\026\242y\354!\216}l\324Yh\235AL\265\217\313\001\203q~\257\315[\271\366\327\366\253\3558\221\245\t\001c0\326\317,f\035eU\271%rt\276\\\357T\362\377Z\212q'\317%\333BJxl\337\004\004x&)\305_C\t\274\236i\246\261j\005\314\266IJh\007 \346k-c\217w\333\305\313~\346\025\3145\324\267\"W\344\226\267\203\357-7\363\263\237\205\244\033Pb\231\022\036nX\240Y_]S\317L\366\306]\317z\254?r@\307\307b\251\325\220\327\264,\301\207\r\377\247\257\034\213xT\020\021\214\210\005\244O\030\224f\271$\244\224\003\240y\222\031\335\244C\222\313-\325Mf\227%59NlS\352=I/7\302z\272G\257_\263c\321n\324\272\355\255\237\206\262\023\320\311#$\201$\2218\210\372\r&a\264N3r\357\231\372X\024\222RQ\346t\310t\024B\037^\202\315\033\3175\323\227*\325\"j&\357\242\315x\274\221\324\n!P>\316]Lj\230 \013r\321 \276O\0219K\230F\t+ht\023\035;\273\310t\350U\367\352oMSX6\362\231\214\203\363\203\251\2257|\207\221S\332\037\022{J\370\375\243\311\314\373\220\375p\334;s\355\375g\305x\236\271\345\370\273\335\357S\324\207\2327%\325t\263#I*\252\252\252\221\214\032b\\\033r\346X2\323,\304\266V\332\243\003\233\253\313\253\205\315\320\331\347\\Ph\336N\034\266e,\027&f 4\215\025\2469\205\266\003F\244y\334inrk\313\252\343\n\213wn\030\n,\264\260\\\314\314\245dqf9\237\241\177\224\312\325\177E7\315\367\272\027\346\374\236\357w\323/\267G^\377&\2159\237\255;\035\372\361?k\267uY_\371\276|w\361p\262\313\247\031_\354\344\312\241@\365\371\326\272@\233\n\222\t\016\300\350\001dI9\373\203&*\222\367]3\222M_\242\272\013W\257f\322\241K+m\227\344\274\367<\221\242k,I\342\212\031\206)\261fN=p\323O\224v\321}\245\255a\346\370\227\352\343\365y\334\336!|\222$\227\347\372=\325\234\375N\377\025p\247\273\217\247e\251/\231%\315ZsG.\357\305m\233\366y\r\345\241J\254q\266\022Qx\360\222\246_[\246N\354\316\231uP\272Ng\363u\356\3554\266\026\273\2678m~\265As\2234^1\323\354\374\237\2079\2367\216\214\205\356\006N\221\006AF\313\314<\370}\030`\375\235\303\300""\330\007\010YWe\201\324\232\214v\\:\250\264\255\311G\217zo\305\273\363q9\225\016\210\353\317\251IJY\326\252\224:\266;?G\324\362\3258\353 \221S\267l#.\356Q[]\301\022\351\337\330\255.\273Og\255C\t>\274u\314\272\035\237R\2725e\372\246\323\327\235\245\210\327\257\351\225g\364h{\246\233t:\263v[\2473+-\305/\340\361\251\376\365e\014\357\335\234\245\311\310\347\rx\302t\366\335\277\272K\276\256\356\322\252Lr\355\312S\231h\212O\251\333\356\273vc\273\335\356L\346A\237$\346v\016\345\272\201S\223^M\332\253\2326f,\344;\")\223\236\360v`g\320\0335\204 Ao\205V\214\271/M\210\216Y\331\332\265\207\t\004\302\301\034:(\220\313\003V\010\351o\206\"\200\272M\347|\324\331\273\335\266\326C\215\240LL\320@@\332\370A\337\243\231\327B\325\002\2342\024\326\256\316\222r5\253$\344i,\033H\021e\227A\262\330\276\237\202\274$\263\273_ g#\264\263\206\315Z\215*\375\266\360\274\235\216\265\2125\273\313\357\014\325\343\3748cM\276YZ\254\246\021\3056\277;\270\205\224\263\274mq{e+-x\272\\G\024\350\274\257hu\t\331+~\327\316n\356\374\027=\330MU1Ej\251\0263\313\271\264\211P\344$07h\352\256\216\2712\025{Ri\023\237\301\304\335gv{W_\356\"\322\311\366\251tI\374^9c\335\177\016_\006\214\232}\273\034\201f\330\301\024\316\031G\201\232c\314I\273\350gQ\313\265n\341\305\n*P@\314^`a\344\t\017\273\010\226\304\222O\016\256\363\356\254\031\312\253wn}\330=\302\236\352\231\021\033\353\324\315\340\023(\360\335\224\217\302\004\332Pz\344\376n\332\326\021\361\233m)Qn\376\273yHN\210\350\346\016\264\370\322\2033\024\027\0208\032D\rD)\216\024\034r\t\357[\331ps\212\035\272\220P:\3405\245\303u[\235\023\342\0348\035:\207#Pl<\222\\\2752rJ\0274\342\034I\334r@\356\204\205\016\362\370*\2348p\275\265\373\n\376\177\014W4z\252\215[p\3477\216rb\361\212\373\016\277\020\263\354>?1\025\025\226\032d\213\221Ot\342\350JQ\"\"\373\233\365p\323w\357=\215\217o/%f\221O\261\246N=\\}\255\\\251\371)F\030-i\271\213\225Y\361n*C\270\312\333\351n\340~%9\201\375-\336C\351'\345\030d\374\354)\2143B\350]4\232\341$\214\027w1Eb\r<\177]\017s\212\267\"\300&q\361\000\305""\330\275\315\020\361w\231\230\343X\345\305\323Vm8\007\035\260[\306\357\222\312\305?&L'\037\315\242\304\230ivt\355\367\037\203OU\246\253K\320\250\026\251b1\210\237\260\330\226R\337\261\316U\017\257j\337\237\263P>\361\235k9\327\265>\205N\310\242\223\003\246\340\237\017\347\321{\343\0301\206\2258\253Pm\257\316B\252\256\002P\357\344\242\363\322\253\005\r\017\212\024!\253j\036o\223\363~F\004\014\370\234\220\223\2205\374\376<\217RFN\210\325\373\332\271r\352\354\231NI\207\017@\331\305\257\350\023\320\002\207\241OB\241\350T\364\003\350\007\356\365\303\345{\264}s\321,|\324\247\325\350\364\374\275\277\007\263\352\036\036\305\033\275t\365\364\272]\336\247W\262vij~\364J^\365ebrs\250\366\303\312\247\333\300\257b\205\265\223\334\366\3351\024\017\362t='4\034\005\"u\240G\201\347\234\363\315\016>\213\316{6]\244\353\332\274\211kU=\344\223\022\311,\036\314\037K\312/R\251\360\027w`\276\327\250\360\345\352\364]MW\026\335Kd]\233z\370:\346\347I/7\222m\266\022\346\313\223\333\035*\216\324\370 \276\371I|S\244\273\026\014\364\222\223\365[5Z&(\354|\223\246\227d3\330\366\240r\265W;\262\005\240\2562\2762R\311%k\315\375V\205\251\"k\261\3631Z>;\035\214]@\330\307\025\211\347\233\207M\373\027\272\346IP\241\236\205y\234Ec\005(\302\233\253? \320\326\374\372^\311l\262\310\272\364\257\202\273\026:\236sqB\177\240m\220^\305\270\340))I'\272\307\315O\032i\242\266\031&Tb\307\264\227\252\372\026J\234\0011\364M\3406L\274\300\356\372\372U\353u\241v_\256\306\265OzQ,\2732\266\312?\351O\274X\225\302\203\351o\201\007\203\343A\306\327\365\232\347\357&w\211\213\375\177\327\365z\371\317\235\313-2\305\343Bs\004\352A\241\332%KH\261T\2524(W\350\273E\364\245\267RN\225\273zx\017;%\307\301\272\275j\034]\307HIYwjGw\007\035-\316U\025u\331\202\211g\322\247t\3236`j\024+\325\006\355\307n\265m]\212\262\354c\3640\027\252ww\276'\305%\001G\t\360\257\214\342\264\005\233(\352f\265\326\356m\235~;\276'(\266\305\3122\031\270\373\036\007t\236A\304q#\3378\232A\330\020;\245\354\242\326\301\371\265AU\215\022Q\277\004?H\316\243L\212,D\213""\250d\004\310.\332\356\230;_\302\350\224\235\347\023\234\356)8\2011\326\361$\373\362\032\302\014H\207\230\243Z\346\215\251 \2252KF\252\263\300\3438\360\006pt\336QI&\261.\314B\003\270!J\024\242$\264\322\010;@\214\315\272I\351]\272\351\277T\266g\330\216<\251\t\325\322V\345\252\362\226{\376\013;u&\244\254\255\360\352\330\224\265\367\031\250\231\316\034\370c\027b\245\303\014U\365\233q\324}y\304D;\271\234\026AU)\022Z\320\342\201\307ju\335\243\033&\2533b\226\351\333\022\210\210\210\343\213\315\267\337\305;Vc\245\353^\226\201\374\236\272\347\236\r\203\363\306g\305\345g\257p4n\\\311p\335\204c\305\336\016\233T\307>\255\2362R\277\222\216\025_\232W\267\226\260/\"W\034>\236\235cm\267\333\026G\337\361\367\375]aY\023\205H\234_\245c\315\242|\375\352\370\324ev['~\212\335z\267c\305\271\021e\261f+\214\300\277\025tY\214\256\260\277\001\346\254\244\326/JN\230O\030Om\321)\336v\275\315\356\006\017p\300\307\270f\031\275\314\014\336\340f\367\007\270\341\356n\207>\263\371~8>\374\242\030<\007\264\362y(\315\354A\343\212\263\035\242bn\270\314\272=\026\214u\ty\312H\223\024$w\022\025\335\206MH{\357\272\221\254\253\0265=\340\232\257[\336\276\314\037\353\370=\227\272\271A\216\003\205\230^\320:\035\215Va\032\232H\307\275Q\247e\276\234.1\207\270\026\265\03425 \260\356\323\010\370}\014\314J\031\312M|\035\360;!\353\300\220\265SUN\304W\267\002Aj\006\014\262x\315\220\356^\2228I\304@\347\010%\243\"\035\300\311\232\022\307\014\327\347^tNpD\347Ey\321\036p\016s\237\025\305\334\375\237\364\2348\035_\263\354\346\350_\203\361\322\236s\311\321\354\t\330\346\307\327\324\256\271\206s\020\272\376\310Xc\030\221 D\022d&\004\002HJ\030\354;\024?\017\211G\212\310\334\375B\374\021_\247GT\017\032f\032\343\302!\021\005\013?\037\360\374\322\360\370\365\3260m~\257\033\014c\274\361\266\300\367\333\374\252b\036\3545\002\245\3273\370\331\231\304\t\374\204N\312CU\001;\315<\235J!\271Q\010H\2211\035\233\374~*\333\325\372$\310bZ\200\307\346\214\376\177\227\316Ou\2374\354ku\330\371rK\376S\302\217\360\317)\313\353\273~2\214\020ts<""\324\260\303Td\304\210\363\337\237\036\213\360+\376\257w\315\274#M\213\027\213\253\376\277;\334\257\0027\353\263)\275\267a\025)\204^\322VE\366[md\345%m\271|\370\320\014\007@\221sE\207N\010\344\344\243}I\225f\035\304\334\234\334\302\023!\002b\376fHk[\033\\\305\334\316.\376A\350\361'\374\231J\225\001\254\343r\251&g\207\211\273\316 \0278\206\035\215\332\332f\034\n\013\211+\245!KE1\023\253\373\272\276\356\317\223Mk\177\037\325\331\321\036\364\376\313m5\013Z\351K\t\301\035X\244vjn\233\235\023\306u\231\241P9\022\261\354,\3369\210\323\243\214\304\026\364\317L\2048\374\307\230\007\314\242\371\200\007\334\025=\301F\371\231\203\346,\221)\0375\307\303N\242>?/b<H\354\037;\260w\017\254\220v\222Go\017\262\366-\352\\49\347z\275B\302\225X/\273\300\023\r\014\351Z\336\005n\nmR\303\306\021\270\365\007\273\207\261'\036=\235\026\265\255qy\210\343U\0161S\215D\343\020x\201\016$\036!\343O&\014\034\211\236\346~*\3746\345\367\376~\\\010{\274\206\260\033\233\211x\274\035\016\363\230\201!/3\274\335\322\217\231\300\225^H\016\267C'\202ba\"\035\334w\360!\300\246\362\203\274\243\300+\300'\000\034\030\213\017\177\263\332\224\007\343\\\307/<\330\357r\257\343\331\357\367\326<\303w\374<\374\325\261\265 ~\305\254\004\264S\222\237j\020\316i\337\323\227\316p\234\376\177\344I0\315D\247\264\242\267\t~\343\322W\244!\322C\244\217I\016\223\322\354\352\352\232\217[\273cN\2177K\223\031\213w\"\360= \370z\254\353\022_HU\216\216\256[\323\024\336P\366\217\031Im\365\r\364C|C}w\323}\337\3376w\367\253\251_\027Y\353v\\=\036\023\217\024/\023m\340M\317X\350\372\250\236\350\304\357\024\021\2460\222\004\221\0060\026%-}\346\337\316n\242\333\316\335\253\225\247n\253\255$\311\002\016^Q\271\016F\3449\016M|\207\341\177\007G,\205\317\334\352\367f\307\037\031\264\033Y\254:\030\330\333\030\330\315\3058\333\267Gf\207S\237\213\247\261L5j:_\223\231\276\020\352\236\244\274\022>\237*\352\246\247\364O\352\213 \255\207\271\213\202RGm\336\352\270[a5V-\241\"\263\233$=\2239\343\201h\357\032?\321}\033\364\n\341\033\351YW\214v\232\317#\363""\252\225\210N\016\213^z\376k$V\366{`\371r\222\227\333J\305\367\335ak\n\225X\333|\324\254\271\345R\245\326\204\324\212\336Tg\266\330\n*\n'\003\213\255\324\003\255\326c\223\261\312\365\377\326\272\231z\326.\372\367Q\315\227/\\\315mNi9\275\335\033\372}=5\372v^\372u\272\324t\177\211t\373K\322\277R|\375\216\361(\366z\334\035\016Ov\231BS\365\013t\201F\312\322)/\210C_n\330\306\222\342F\257\231{\313\016\363\306%=\264I-%\336<\020\341S\337\207\327Ks\013\360\nE\207j\355J\323P\361\001\372E\231\345\245\262*a\303\337\302\376Mz\353\237~\312\370e-\213\355\247\233\027\247\213\261\342\313\360MW%~\263\035\211\207\r\343B#N\351ME\352'\306\332\022\364D\201\323\327\223\233\203\2308t\025j\244\260nw\312O\271\262\rR\373\371\026(\251\314\265f\344'\345\271\210\205EGsL;f\313N\232\017[\203M\2254\322\252\266S\232\314v\361k\2474K\213\016h\341\3157\242\341\315\315\2275\025+\221v\323\0336-\303F\375\364\\\t\320jq\320~^\026\357\245\365\352\306\300Q$\222\363c\224]i\007/4\234\233\231\332\306\255\005\250(i\312\372\210@\245(\016^r4_\273\257\200Yp\207\320\367\334\373%$\210l\270c\224\254\")\323[\355m\254\034\026\317\221\265Gb\316=Wn\214g\251\354b\376A\322\350|\031\020\356\227\363~*9\3319\247\023\235%!U\232\030\355S\265\325\263\222\313 \275zq;\027\376\007\370/\256/R\271\007\254\021dv?\220\250\016\347\035\0016\361\206\242HMr_c\341\237j\314,\302\034V95~.%j\274\357c\031\314\355\322X#<\324%\246y\307sW\235\212Z\337\371\375P_\216\246\202\227\330Cm\333\272\251%Y\232h\235\242\314H?\265G\266_\216\204\331e\310\320\314f\231\366\244\223\263\032T\350\354\306\234x\240\317m1\317O\275\323\321m\351\356v\2522\202\354`\205\004\202|\326D\224\357\316\032\263\305^\264=\263Y\257\350\274'u2}\\\034\271\311\227\323\023\r~=:\222\254\235t\236\244E\370\022a\3253s7\305\372Y\306\312\030\026\370\251\"\350\214$\005\"\216C\005\023,5Q\3129I\224\004\316\273\025\367z\300\315d\326\t\373\336\236&\212~5\256\373\313\353\343\347w\352\330\301\035\273\245|!aI[\234\260\272\371;\376\311\333~W\032T\256\263.}\032oI(\276\373\316:\330M\362\272\273\345J;""\273\273\374~\357[{\033\330{\017\361o\021\362\364y\276S\370\374\277G\307\353\273W\237\311\177u?\255\252y\251\370>\t&H\375\223o<}\252r\266\331{$\323P\343\254-\227\310\232M?s\270\251e\264\232+H\"\367q#.,\375e\366*\\\241\226\213]F1ujE\014\364DO?/\313v\031=\232V\033q\312X@=\2364\273\240\371,\364\227\326\005vyY\363\263\007\337\010\247_\306JF\322\320\335\"\026\207\242T\024\270\3769\"Z\330\263`;%\275i\235&\275\313\260\210\210\212)\n[\276j\020\341\252\344\016\r\357\203\317\265\220GR{3\364x\267\337d\201\\\245.\013\222\244!\002\036:5e\240\033\350\371}[q\n\035\340\212H!$\214\030\202f\300\276cO2\t\no\367\\\023\367]\034mH\242<;\300e\323\235\352\031\240x\340\240Q\025\242\007T\"\265j10J\367\024/\260_\004\220\2500=\255C\322<>\307m>hb\033\001T\307\023\304B\"\nm\361\200\315\200&\004\310l\275\2709\306\306LfY\2734\227\344\331\276\3326\004\210 \220\030\014E\030f\177\257\003\364\221\222\023s\335%\267\227\213\035Y\205\325\330\266\257\201{\226\013B\265Md\211\t+\322GO\005w&\307\311\242\264\350\322\252\365\030I\r\357?\036\366\247\226g\232&\334\331\254\256\356k\212\026X\216\030\232%\"\033\241\r%P\225Y\255\"8\203R\212\t\270\356\215.\004\313\252\332\376@\\\201\370\2003>w\266\275O\237\321&\232\025\"]\220s1\250P\251^so%\301~\203_L\264B\t~\355\022\340\3226\013^K\363IO\240\032d\344\364\257\331\232O\2215\326R\224_y\247\0149\305*\223\321\322N\036\346\207x\336\261L\245\341\315(a%\016z\311\245({WCO8\254UT\212\252\275\220\017E\207\262\344\356\207aN*0^\252\210\013^\227\315\353\275+\320\036\351\310;\270\000\000\000\2409p\367\327\227\273{{\367\272\365\226\256\366%\006k\226@\035\366\251\305AiCX|\235Y+\356\327\203\200~\335N:{\004->A\007|T\271\350\0076\226\332\3353\016~N\344\341\234\206\"\306X\254\nK\035\335gfk\211Sm\216f\362lu\333<)ot\257N^\216,\242\264\304\224\265\3375\261\3112\342\306\006\242\234\3519\0177m\026\222\243<;0\033\232\250\222\246\232\330\r\264Q\242n{\257\206\223\323\345\2328\375y\001\200\210\243\001\212 \251a>\331\317\314\372=r\3642u\315=|Ny:<\227\270\240\211\306A\t\023\034\\\371\2574\224V,diG""\000\344\027\265\020\364jb\235\0203\204H\301\221\221g~\030Az\371\364\301\234\225\006\206\200TD#\033\206\327F\342{\r\314\305\005\211\345\1770\323<y\"?_\365\364t@x!%\006\263;\214\304\204\316\207\207tQa\206\256\370\0220[\372\216\324\350fc\004\n\034\034M$\022\354\242X#k1]\025\020k\235K_\255\243\253CAa6\014;\205\367\242\361\010\342\261\253\332]\264m]\304\016\264\241_\277G=\323\311\262mb9=|\375}d\361\306\345\010\010\304\204D\001H\204}\277U\202\"\013\"\374O\263\022\004\336\t\277\001\312||~&y\244\263\256(*\246\371\2238t\002B\253wW\241Re\273S\250\201\245\223@\032\206@6LJ\255\2260z/8\32724MJ\370=\376\321C\023.\233\r\260d\003b\033Dp\340\260\303\212\227&!\005 \2121\034(\216\346\006\241\347S)\370>\261\250D*\243\337\327z\006\206\206\262\334\271\017\264UG_\241\221\323*e\277a\327G\200\333\313\277\211\020\303\257\272\246\022&\341y\240\243\212\036\276z\231tO \374\347\334z{\363\337~\315A\225\362\024Q$R$\203[\354-\265\262\312\310\026B\023EF\331\231\245\222\226n\301\246P\273\257_\265\2775\334\346\2344\267~\2378C\342'\300\340\367\2048\355\347d\022\247(L\014\tl\007\332W\305\267\267\265\013\n\314(\207\240\231K\001\222\220\330``\205\004\321\223\212\302c\003\214\321\000\270\264\003\207\360\311@\317{\301\003\200\204\240\232\010J\200X\311\221\203\023\243(0\231\215=*z\020\347\227\316\363\001Hx\"!u\\\320\021\32581\216jd\363\253\350\207\274oA\320\006U\000\235\036\210\010\253\312[\265j2db7\302\311=\332\301\235\333\020\355&\372q\347\207|\250\361\275\352\351s\204\275\314\324\206H\202\010\\k\272\036\003&Cg\017\023;D\360\016\206\001A\0354>\271M&Y\201\221PV\202\"\"\303N\355\024Smb\263s\306\365X\274\242!tQ\323\271\322\345W\001\360\343\034Uk\325\266E\004D5\275k\353\221iB\264U\026\201~C\343\356Eu\362a\021\354\203\224`\024.S\034\254\375\245\023[\177\204.\277R\265\r\035l*\365\314f\365\261\201\256ga\"\260\202\310\022\021R\000q\366\330a\366\366\325\037\014}\237e\335\241\226)6\t&\314P\217\330D\254F*\000\363\373\260\223\315=\326|\376\375\257\267\277\202\352\301\364\240\2120\020\014\"\242Y\001\003\n\242\027\210""\006\004L(\037B\337\204pI<k1\225F\263\032$\361\255V\267p\301L\365j\214\227\311qC`\270B\250L@\323T7\020\002\345\360\275\270\225\361\rJ\206\305V\013\016\177L\316_N\265\245\304\"@J0\034hg*8\225\353\305\347{\236>\267\271\002B@I\003\275\363\364\377O\371o\346~\224\376i\337\251\337\245\220\266\024r2\236\224\321]eX\2301(\013\225P\274\246%\202\304m\231\224\341n\356\231\211\030eS\353]\267\353y\353\326\270x\334R\332\344g\252m,\324-\265\037,\242\"\316R\210\243\025\372\311ik\215\253y\264\306f\264\230\347\031E\306\240\214t\262\304\245+\211F5\306\246\"\"\261\230\302\326\250\345\227)\217s\\\246b\351\241O/2\232\312\225\207\031U\313f\3332\330\002\343\274tS\244!/\"<H\002]\027\306\031$\231o\"\344l\" 7K\333\207\r\203[8'{\244\303d\245\032%\225;\207D9\205+&\016\253g\261\233\225\334\312\t\005\216))*%K\005\355\272\226`\224\210\211\333\000.\344\302_,;\245\243\306\251\331\233F\024n\202\354d\201\263\314\334\357aA\204:\n\244\242\332\224Jn^\tm0\366\276\266w\226Li\262\227%\342\311\302\352\311\027c\214h\020\324*\327\r\321\002\325\304\205TX\355[\264\274\246G\035\3477x3L\340\256n\\h\312r\356\323m\\\307\026UV\214Z\224\345EG\002\202\024\326\233\204\031r0\215\334\267c\211n\267\201k\346\3323\234:SE\352\256\363Z\323)\213\363\371\237\320\026\013\370H\t\020X1;\233\235n\257\253\016xvy0C\037@\353\n\205\210\235,7]\207\253\206\335KsJ\311,e\031\217\016\030\321\333\324\315N\277\200\321\215\006}\2144\306X\005\366ea\231L\250)\247\032\246X)\212\354\305\342\241K\250s\341\317\362\341\371\314DA/J\\\332\243\030\332\300\327y\365\267\255o|\221\010\214\rB\224\252\250F\260\001Cm\2033\242g\321ofk]v\024s$\247\014\025\262\035\273\"B\353lX\016\315\014l$\375\272\354\212e\210Z\226\231\263\376$\3344\271\\\013\030\033\212\257u\rP\354\214nv\014\243\307\211x\326\257\026T\236\237}qL\367b\350V\272&\r\027\353\350\336\302\233\006ku\220\352\252r+\306\274\302\365\036\266~\264\355\036oz\322\270y\374\277%\260&\235\317V0\240\177w\226\225\347\272\210o(\205H\010>\225\250\001\212&\033\210AR\322\241\002\200\211\016*\017\361\3606y\244\307(\n\215""\215\002\211%A\245\207\344!\264\323I\r-\201DD(\210#(\243@\376@%\302,\2348P2\255&\230\211`2#\020\244\003\000\320X\342\241)!\006\r\250FK\310\205\255\\\023\016\036\315\342 j\002On\261FHB\021\262'P\360q\330\303\212\265\371\250B\363\017\226\264Nm\031\2732\343@c\313 \302H1\232\313T@ A{\030\354X\3173q\222\010\254D\024\202\305\207\257\334\276\376,\315\361y\234\3657|\027q\332Zj\357\340+\236\252St\333?\231\336c[\245\374\037\205\334\265\375j\210\306\322\375\362\226\2452\336;\243\302\255\257\204l\366\225[\231;@\340\350vC\2738$F0&[\026\004F\037\212X\001X\224\332\014\rt\242\3411P\306J`\313\004\221\020\310Pl\000\265\216\245mJ\026\016}9\273\265wn\355#\017\307>\317\267\305\365~\261\237=\215\302\033k\036\217Bh\372\372\311I\272J\020\020Q\n\006Y\032\242\215\262R\250\226\255\240\217\251\366\022d\321]\251<I\026\375\334\325\r\277\206z\366\276\\\233\237d\205\265m\235\335\006\252\320\320\265Lp\316S\276\352\350V\311\251\r\306\253!T\013\005&2\232H\021\013\367/\274\341\324\277\206W\364\322\031\027\027R\320{Lsc\004\004\255\030\023\024\313:\350\244\3144\360\271\200lk=\023\245\365\251B\303;u\311\2477\2618S;\240\265\r=2b\3010P`\333$)\"\200\265\252\004\326\342P\254\0327\237\027\373w\021\246\235!\210\333\265\\\266.\222\311jE\251\365\335%\2466\326\223Zo\226\313nl\334\312z\243\005\325\344\0142\256\372a\023[\230\244\364\3126\312\262y\251J8\270R\333,9%\226\026\331\345\266\233\027\3423I]9\030C\261\313\270\2768\264\361n\031\230%\215\207[]\252z\325\242\276IW\207F4\267u\010}nJC\241\362\336n}\234\222\243NQ\204\212\260\224\354\355\317\273\305\355\265\236W\323!8\325i\177K\313m*\273\271i\245UW\347G\032\2055Ds\251*\247N\271\325\213v\214\210\306\370\274\006\204\256WF\211V\262\3212\301\246l\306\223\345\241\322A{\226]#\014\"\237\224\365Q\251/\343ey\25044\364\225\270\233\343\034\312:;U\255\267\2509T\224\223\273\244\372\243\r\265\347\\\026\t\250\215\224J\036\306dJ\323t\213\272D9\256\307S\265pq\345\226\312e\315\023\333\316\364\2272h5\335\225:x\347\304\306\243[x\021\362\334\366\256\262\232\342X\254\027\032H\333\275""\356E\313Z\232\242\351\253\262\023g\327Uo\365Y\371\335'\324\341:U\032}^\033J\332\273\271t\356\\\232^\345\232\271~E%\202l\026kJ\305$\323_j\242\205\212\305b\266\253\327\265lg_\025I\316\364r\364t\303\263&\351L\356\323\350\236\364=^\020\316\365%\372\321\245b\273H\317K\261\232\232?\n\271%4\311e\303VB\271\316\245\230\300Z=\354\3437/K&\216\254\331\2357I^\213\305\207\274\364\245\360\325\356d\3611\013%\342\021\212\352\216\334\303uq\352\347\266\375\345Hi\202!\316@\n\210\006n\345\016\223I\311\223!L\312\324j\323\n\261\033\014\2221?\314\374\3143\212X\033\325\241\337\327\361cD\340\365(\246\241\0060\030\004\331\222\214\266B\342\320(\200\230[\001\033m\260(\204\215\2436f\272WnF\351n\356N\356\271P\r\250\332Jc~\277\000\317\313\2021\010\300e\0208\267\313\301\235\360\272\365U\345$\266\2254\252\226\214\301\212 \221\021I\263\337\335F\344\033\343\337\326\177;\333\313\337\361\256\365X\345\230\025\216\001k\232\326\232\241\311'\271\347\305\020 j\316\037\365\311\231\314\017\224`\362\240\036Q\037*\017\224\017*>Q\327\362\276\217w\313q\356\316\277\321\361U\237\263\333\177\211\331\333\234\001AL\nX%C~\025\024-\321\240\367H\027%\366\261y\3169r\315\302\324?*\\3\201O\313\314\312~E\274z\316\016\370\tee\031Dc\257\004y\312\370;\003\260\005\"\256@\374\026M\315\203r\313\013\0061dO\272U\272qU7\254%%\311\247(~\326\256\342\312\032&\222\300\241\005\326L\227/\305Hs\006\227\262\307\344gd\317\n\035\014Ht\341\205@\r\"l\030\245$\022i\031\264\322h\352k*\304\371\373\232n\332\24290\333\342\254\226\347\313\324\313\327\230\346\247k\020\365\345\226*\363j]\207\263\327,\251\206\021\017\"\271\341\272\364w\341)2\345\034\214v\325CZ2S^\352_\317\260\021\202\022\224\034\036\356+\017:\233\246\307\300\233\"\t\003\310\032\026\010\210 \240,A\004?\235?W\232\357\211\344\343\317']\300\334\tR\202\356\225f\372vF\211?\261\351kl\315U=\223\306\367\261\374\024\267HRw\033Bw\313S3\006\002H\245J\010H\275;#\342\316%!\314\230o*\324\2376y6\222\330\007=\357\203\277\351\361\276\016\323m8~\\\020\354\200\277\323\004E4\307\3465\311)\247N.i\272\344\255""\232\027=\026\2574}\026\263\001\275\210,\326\035\324\304;l\"5d\314\314\327\355\236\373\257\003l\360\272\240\331_^{:,\262\335l\314\301\264\234\203\031\224\342\365\017,_\023w\347\342l\374\234\275\235\263Xh\271!\346\206\266\\\365U}\255l\271n\331\351\251\212,\027\036\346\335\247CR\365\010@J\242\367\236\nw1\331\2360\225v\350\324j\313|c\250R\343\203J\225\262\205\320\235*h\257\025\221km\243d\245\255R\251\264\304\264\312\000\221\217O\261\347\316\226ox\372\271\240\006\324\010\313!\0052\344\342T[\024s\210%\360\231:!\031\250\343\333\272\002\364\215\371\214\320\247K\306k\34762KH\250\2102\210y]\203u\0167\332[\003f\211\033\370\020\366p\023\367\266\357H3V\037\027\271@/\301\361\337\214\206[\300\001H\032\310\034\021\203\200\242S\003\362D\277h\037{!\216\376\366\27129\243\346\203Y\314D\327\365\300_]\020\017\\D_\\\024\365\321\365\333\356>\355\375\264}\377\345\374>zM\274\335>$\3117I7\022!2Gw\340\233\3151.#\300E%ld\\]\360n\376\033\274\220\310k\352\t,\344\332\224\251RJ\374\310\335\2459\006\005\035v\036\3323\302W\305\327\274\351P\357\327\241\250x\251\022\241)\325YG\357\326\241\036\302\2147\00604r6\\\0247\316X\353\305\372\036\037L\240\374\362\342S\234x\33481\345\236\374S\3216\036\261\347\305w\357S\\r\334\206\326\324\027\235\2778\262*\312\363=]p\016\207\257\272\334\336\205\243\330\004\007\351*\2215\326x\252Ng\031\016\273\353C\265\207fl\302\205\315JE\220\343b^2\225\327W\265oU\232\356\025u\004\352\334a\273\r0\333gQ\354\363\231\014z\310\036\237y\353\301aX~^\031\222TU\215\241P\224\211EF\250\204Rk\202Xr\033Cq\211\343~\270\224D\335:\026V\305\366EA\200\232\247\2459\320\344\242\321f\303\320*\005\023(nn\233\330\331\n\354\2308\241\315\006S\255\203Z\332\216\227\206\034\023\336\000P\334:p\224\363C\336\347>\035Ns.'\016\243\245b\250V\310\246\230\351)\036\234\245l;q\261\320\251C\310\204+\222\3112\022$L\223[\nc\30747\342\300t\210j\221\202\206\342\214\336\356\350\2729\276*\267\252\3470\312\246\023[\205\016\t\324O;\207\001'yCU\276\36418\016\374\351\356\"Y\322f\367\240\3403XL^\347;\031\004t\201GB\215\266<\3661""\000\331Y\r\243\020UVp\215\224h\243\261a\271\322\005\024\205\345\365\267\311\233m\356\370%\351C\025\370\020\364w\313\206\"\207}\226\313\317;\336z\247\023\317M2\224q\245\353 \267\027A\344\252\306\212C\316\212\347\007AZ$\212$\226)\241\347=\007 )\004\210\352@\345\255\003\005\212\354\021\333%x\363\007 \332J\305\223\336\266\274\035\035\235\034\335\303i\035;\007O\205\366B\324T4<\250j%\234\\0\314_p\353\016\032\t\273M\025t\240\306g\206\336h=\276\274\ng\014\371+v\037#\305\341Bq>+\354{\201\360s\331|\033g\277l\324\366\345!\254\3719Hj|\330\322\202\246\017\222\230{\030\230\032i\017B\"\022\213\356\243\243\214\004P)z&\030\315Z\271\332\313&\345\305j\255`\r\220\2011\233\231\227\247Ng\021\312\325.\022B\276\377?Kt\0162p\214\366\035\304sB\230<nqt<\216(\356u\007\253\327\216\303\324\273.\313\246\253\254:\355\021\231\252\357;v+\231\262\242\275\367\340P\300\316\243\010\351\201c\261\327qM\340]\240\310-\004\225\"\214\350(I\251\033\236\343\021\254\243\027Y\2462T\360\251}\007\301'D\210\r$\206\003\020\314\005\001\236\214\202\222m\304\304R\\\003hX(1h\017*\201\341\337\027\346%\224\356\330\260\007@\216\013[\341\204\220\347\236\232\366\255}EL\326f\231I\215\251+%\006\t\001 \220P\360\014\356l\254Fg\2153p\355\340\354uyw\241)P\345\257\013Z\035!\204n7\307$9d~\271\336\214\343\220\336\207~l\237\302r\025\017\333 \214\210\006X\007S\036\016d\240$A\376\200Z\002$\021\377`4d \271\231\372\227\320\372\231x\021FH(\263\026\034\215bI \010%x\224o\347\351\336\247;\323\345\355\372l\004QE\000\223H\004j\203\322QA\214\205(\226T\260x0+\014@P*\002\300\370!\306LU\225\325\223A\010\335\213\330\351\337fjr\235B\244f\260v\305\23553)\235*[m\261u^\014\262|W\345\002\232\213\351}\260\314\304\360\234-\026\026\244\226e\233\226U\306\313\334E\036\310\315\254\023\031\270\363y@J\013\235\342\266\316F\214\277<\010\030<\035\022\310A\005\023\243,Pe\211\200\334\301L\347?\0259e\022\020\300\333\001\303\nd\225\242d\206\026T\305\267\030c\014\3347k\026&\244\223~=\305\004\210\200F\341\244\333:8\327(_]\372\036\314\330\300\301*\207v\311E=\261\277y\306""\2705\240\266\350L\003\345x.\212+\036\233Nfr:V6&\357\030M\255\2259K \274l\002E\374\263$A&\010\271[\017t\020bliPc\010\256\305C\001\320\350^\330\271\233\337\314yv\325V\264O\t\327\000\221L\033L\251\243m0\302\333\356{\363\304\315\\D\355\021\026IJ\267\243Mp\307\034,h\306\223WF:/\312o!\215\355\210\020\344\004\256-\334\014\322f1q*\260\324\343z<\267\361\360\2729\325\256\217\351\227\216\260\333`\031\010\252\032/\351\327\352\316g\256t\354Q@\306E\005]\345\020\203j\004\361\356\357\353\364y*\014PS\363\201\327\272\357\023\340\357\336\276;\315\235V\035\264U\353\2762\010\337R\317Q\336\340\017\250\326\333\274<\313\267\233\367\307;\353{#\277\216&\216\261\316\034\352\265\2361}1\343\372b$Y\021\020`,\364\232\210\304N\201\223\322\024\252\311\214!\" cn\347^\234\277\014\365<\353m\0359~Or\022\362.T\360)mE\331\363\255\371O*USPk6\331=`\314\\\222)\312|)*\\A\252\005\232T\036\017u\314\365\332\336\301\010Z\200\232\t\315\331\231\214p\301\256\267Q\256%\314\255\275#\007\312!\206\312\355:6&\332\374-\265\033n\232\351\267{\327>g\000Y\353\351\366\020\314\004C\204\245\363\240:G\277\315;\037XpK|\032{\3649\363\351Y=\\ \233\006D\321\250V\200\214H\334\020\nH\205\210\233\271\315B\364^c,T\244\031\202\013\330\016\261:a{Ceu\2322\223\214\356\301\371E\306\346\362x\017\245\201\331) 0\002\254\002c^\036\336r\007\241\340aNq!Y\177\024F\030\263\t&\352g\211\323\020\257\r\367\034\215\242\253\0027\276\315~\363\357B\036\317\\| \006\372\260B \203\343\222\031\022F\036\262\357\320&\224Z\0324\034\"P\021\244F\002\026\266\023v\340(\311?\236C\031\274K}\371\352\032\321\232\327\226\273\357\307N'\t\344\005 \360\266Q\3130\335S\206\356\217.u+\332O\231\276=\347\327*M/O\213$\213\000\273\241\262\214\005b\344n\272\243\347[\214\014\312\366\272d\362C\311\340Ia\356\r\325\227j\364>\263\317\3477\242{\323\325=\355F`3\031\355\313\236\2129%)\034n\007\022\243C$O\204\234\221U\031\3101\365\270s\273\256\207\005\303\t\300tQ\2065-\250\201m\201m\255B\333)m\264D\266\277N\325\366\376\204)s\337\":\3762S\240\335@8\206\207d\324\200\361\010\030\241\367\206""\326\001\214a\317G\2231:\341D\354\3705J\335a\333}3\300\370wg\260P\257y\313\273\250G\241\246\014\016m=\022O\210S\361}\374>\210@L$\014\376Bs\301\242t{uk|}\0311\316k\343\307\007|\263\036F\246/}\244 m\336\325\323\327\233\276\273t\307\210m\302l(\216\206\201\024\\\365\016\264\006\0232\034}$\013s\266\226\360\nc\360\201\331Yf\323\030\265\"S\237\260\362\227o\337\262\201\357I$\014\260\255K\255\025Mc+\357K|yq\237\243\343>[n|\"\234\320>\351(\211U\321+9\\&\030C3\345\025\247X\231\327{\311\352\"\n)\021\004\354\316\013Gq\224\231\264\205\030\316m\320G\0354\245\235\353\rQ\221\201\020\256\025)\"\344d\374\207;\355\244\271\313\263\267{\331\363\240&\375k\254v$-0v\030sN\254\303o\257)\306\265\347\360\332\250\235:T\252\240\2430\242\tG\301\230\024K\233\333pEy\212\234\364R\232u\014\210\300\345\026\026\025A\306*\232x\343K\276\343\\y\333\323\247\005\364\0374J\302\332K\n\337m\267\027\301\212\250\254\253\311\024\207\267\246V(\260\263\r\256\320s\325\306\031\257RB\236\221\3060\263xu\213+\254\316\225\373,\024\031\364U\350\"\362\354q\365=1\371;\236\226\361^E\253f\213\017\325\030\366j\207\202\330\246\3365\207\031\272\251Nz\027\366\234t\332\313\273.\272\201h\n\021&\3525D\253k\352\010\300m\031\242\230_\032m\316\333\236\306\315\024\323\234N\353\004\257\214\336\372\221-\203TE\231<\256\361^c\255\373\350\301[\324\317j\255\341\343\245I\023d\235Y\016\365\345\0034ZSC\200\025\212\216U\354\2329\275\341\003*\245\000\214zo\223\331\216\2755\266\375<\274\246\235\222p\341\337\203\001&\324\024(2(\263>]\244\366HAe\355\306\326\235:=\217O\262I\277&\276\372\365\373\020\246\200%\000l\224\360p\220\0000\364\227\000\000\210\003[0KL\003\256\344h\202B\276zrCj\000\000\014cF\000\257I\304\212\351\266\3504\000\000\300\003wp\000\000\004\214\314\030\214\205\004\266\200=\027\002\017\265\334\0020\364\364<\360\014\036xyyRT\r\006\242\306\014\021\242`\0000u\3346\000\006a\263@\003\003a\222\240\000\000\001\006\000l\222\222 \t'*\311\332\000)\255\362\272\327\001\244\275=\017<\t\001H\022\3146\301\347\207\233\301\000\014\000\030\221\001\260""\000\263]8\353\270k\313\313\274\003\000b\204\313\030\202(\000A\002\301\202\000\030D\225\014\320X%H\213(\002\000\246\303F\206\000\031\206\000\363\303\317\000\363\303\315\340\274\360\357\000\030\003X\000y\347\225\347\236y\3405\r\227T\256\003\317\017<\000\005\210y\341\346\274\027\221\347^`\230\320\000\210\000\000\010\005\033F@\000\020V\232\021\345wi\254\003\245\303\006\r\246\000.\234\000\000\000\000\300\301\250,\311\250\000\001\260o%\332\234\351$\226\245M\000\033*y\327\007w\n0\314`\310\200\000`\013\311\\(\000\274\232\270\000\000`\030;\303\317\000H\000\030\000\000\0005\r!\004\020 \000\000\000\026\272kIFw\004\000\030\000\022\204\304\312\n\320V0\021\200\315\004\005y\341\326\360Y\345\364}\363\326\275\\\003\272#\247\302\335r\330\310\341.\300,\227\n\266\261\007\001\313\230\221\027@\3347\337\334\373fHNaf^Y\200\017\251\204 \260\310\302\375\007\222*\362\202,\032\204\220\221lM\251\216d\320\265\214\366'A\340\034\232\014\023\2579\021\267[\232\373{\037\t\363\224\303\270\315Y\2708\200I\204\310h\304\306\206\363dY\t\030\t\265\232\360\000q!\005\222,6\005\003\337D\220)\030\242\200\335\n\014\n\250\270\336l@!\305\005\tE\022}\327\371\022\330\277\006\244\346\252\362CV\0061\217#}\341\323\301L\303\210P\313\025\272\016\267Y\305\330\370\027\330W\330\021O`\001=\204\027\330\027\330\273\340\360\373\033^\246\337\335{\375hn\007\266\370\236\367\014\021\362\372T\033\341\362\235R\301\327\023\010\355\225\032\2412\202\361\225a\227V\205l\rv\250\353\336\272\353\324\277\"J\023\247P\240\355\235\237\2470{x:\322\3141\336\236*\025\037R\356I\345\353\3220e%\333^\201\362\352I\360\027c\340)4\212\n]I\236\237\226\030:\031\363\rh7+\222\355\334es\274\321f\270\020\270k\234[\250\301=D\372\234fkQZ\335LI\263?\306\354\314\323U\233\267\213\321>Jz1\2530\320V\227\323au\n\375\256\223!\212\243\021b(\305\207\364\217w\032\343\303\357\3643^\330\365\317\3633d\002\361\231\024\306-\035\353c\006\361\231]\341\245\262*\356\251\0168\337^2\223q\360\227\260r\033\374\r\260\036\214\363\207\271\372\020\250\006\325\367\237\007\201\005@`\266""\211L\310\344\232fR\325\222jb\341\324\277\025e\3244w@\356\202\234\340\243\335E{\252!\335\001\356\251\356\206\305\317\250\036\247\232\357T\377\267\255g\336\217\251\352O\277\321\000\337\022O\313\376(S-iD\250(F\332%\255\213\005\226\250\350vl\267\t\013\242\306\225\256hS\000\261\002J\006\204\246g@s\253\353\016O\253_\203\340`\013\3415\265\016\317^\373\357sc\365l\007L\247\371\267\342j4\001=\206\026 \221\200\301p\010R\251P\016>l\330\352\313\255\204\\1\230C&,\323\034\272g\235\311S\311<\222\321\301\016\347\245[HS\372\357\3529yz\274<8W)n\351>-\274\270r\341\267\226\235\234*\252\253\372\023\036Un\021\336\262\377A1\351F^\357\271\313\273\227\373\017B?\007\243o\350\177K\204\341\357uj\377-\264\024\303<\336\351\317j\313\247vS\333\024wp\256\035\3204\354\364~<\362\177c\024\354\373\237\r\275\337{\374O\275?j\250\322zu\2577\017\3552a\355\351^\250i\366iR\307\r%\2746\255\276\256\312\341\367%\217\341t\366i\335\363wz2\232M:z>\257^\225n\356\225\247N[N\325Y\305\036\034;\264\256\032vv\364\254>o\207\225p\364m]\274\253\225UW\311\350\224\356\254\3674\367~n\223\321\335\351\232\323\352\305\313\247\243Og\2242\312{\277\304\333NU\352\234\276\217g\rmT\362\364O\017\233\247nj\325\335\365m\016\356\033p\372\274\276\317\016\316\356\355\272L\017\225\342\370wv\212\252\256\032Ww\340\205\273?y\363G\332\217\242\252\234\276\251\362\252\016\212\257\n\323\331\267Y\253r\250)OfR\252\271\252\303;|\352\333~\tnR\036i\256E\213\005D^\252\202\250\301\336i/\215X\266,\326\365Ti\334\373\321\032^\336\317\271\350\373\325\356\213\226M\231\024\261\362z+n^_W\263\352\360\345\350\333\363E\373S\352\346\2734\345\331\267\226\336\330\257\t<\220\360\345?\240\2343a\312\242\316\351Z\257G*\362\322e:\245*\277\007*\341\365r\351<\356\227\3608W\243N\037\255\354\354\235\263ZW\206\013J\255\271`JEZ~/\337~O\253\3256gww\204\375\367H\373\250\302z\322\022u%\212\322\270\326\265N\255U9\334\331\207\027c\014\004\335>\245\230\342\246\261\267B\260\000\357\201\2035\214\204\254h\272\261K\342\276\214\270\27280'2\344\315\236M0\233\276It\364\222\014\254Nj>\033It)""\205\371\353\033Z*\340;\016\242\000/\023K\245\322\261\264\233f\332m\220\306\357\267\"\360\014Fg`\032\315\\o\217\025w\2053z4K\204\211C\270\032\351]C\264\231\213\300\241\200\332\n\355\330\254\221Y\005\036\021\360\202x@\017\n\211\337T\360\253\341<.\022\347\303\334\350\367M\317\017VW\217\357\373\036\347\210\36380C\305\310q\220\222\020\"I\026\022H\243\304\020(F\020B\202\026RQ)\376\030\303\004\306\264b\203\277\223\336y\214\322\354u\302;}\216\213\2179k0\373F\201\273\205N\375\026\n\316\303\272\252w\017\335}z\271\223\211&*p\017\217\243|\342\007\360\220EY\030\2108\0062(\320\322\3036\005%\365n\250\253!\333\217\004&\277XP\355P\232\022\033\342\247\206lf\2770U\365\002SIY7\027\206\323]\032\366\020${\365pcr{\220!\027\367\366{.`\276U\006\315\331l\202\3435\306\201\033I0\260\203\252{\352B$|k\340s\354Zt\017\343T\317\341f\273\352\371n!\335\222N\0200\223\207\026o\332\003\2763\035\361\230\030;\343\001\334`;\354\035\363\277\323\360w\364y\320v\223vvS\225\317\257\200r\2707\230\342\300r{\334\344\232`%\333\320Iy\330\030\221\374\030\375|\310\037|\020\027\323\254\241\t\341\024*\014\002\226!(\031)\ni\016\205]\251BK\017\272G\353\375\213\277Rk`\222\252\202\005\327\"v\241h\304\203i\"\350`\245\004\005V\020\231\240\014\241\355\344'\273\177\022\0201\r\223t(D\246t\231\235<8:\2043\327\262u\2402\274s\n\001P{$\355\243\na/\201\254\357\213\326\347\245\345\223\335T\311)\245j\200D\n\310\177+\241E]\361\214\027\333\256S\312&\360\373\204\210 \245\2102\202\250e\n\021\205\2347\345kwQ\240\236K\3207y\260\030\016N\032w+xO3-\030\232mo@\326\213\025Rh\3156\244-2\217\302\276\237O\262B) \300a\332\252\220\027k?\212}-}\375VD\235\022Rs_5\357%\"\314\225\250\233Z\211\"v2\005\362\375\010\232\212\334m\037(\325\255\322\301TI\031MT\240\225\n\214\223\233\230\345\024,\271\226\330\332\337\030\2011xn2\345\207\357\261\264\270f\016\221\214\361.,{\300\035\300\243\243g\010\0261\034\003\324\034\355\313~\204\265`\030\334\352\026\262\244\335\003\215x\366tn\354\t\0039\2042\272Q!\022c\264\026)\006\302Z,\013X\231\3676>$2d\023\006L\365\204:>\364h""\345k\341\324\324bo\312H\252\257:\017\253\326\247G\350d|\252\275Q2\032\366\263\023|\245-(\227B\343=\354\335M\302\020\263\312`\320*\020\016_\305\256\t\027\242?A\223a[\354~U\303\224&V\3415\234,\335\276l\322\337\262\003\333\317\325\270\350\033\031\304\241R\264K4Z\020X\301$#\261\004D\2443l\320\3611\325\267\232\356\352e\233\265\364\270\317V\255r\266H\253l\215\321ZB\241\234\036_\253 ^\206\230r\032=\034\312b\030(\212`Q\035^\356\023\260\206\035\245`\3164\326\325\023_Q0g\327\346\001\345\354{q\246}\235G\214_E\372\0226;\303\227\311\236B\300\321\017y|\237%\232\266\322\333\007\242\325n\241\035\373=\210\032\235\362\302H\026\211\014\350\340\007=\t@!<\222DJ\004\306b\250\260IG\360\210{>g\243\3571\307\227\237\253\342\272qx\307\033\023\231\335'x\221\"Db\242\2401-\t\2004\277GW\254\254\006\241\252\237\006\n\003\030\022\002\305\265&\231\264\226\306\370.\233Q[_\tZ\334\324mQ\253QZ\305\033\025%j#j\232\233%[F\332\"\321U\347w\334\365\202I\242\016\203\225\014\010\357j@\222M\324\014\247*\230i\310\266\252\267\366{=!\216X\225\244\215\203.\246\276\003\2048H\365\214\273\332\364\312*\t\030\222,Zx\273\252\365vn\353\211:u\350Q!\365\253(\367\314\036\212i)\331\312\264'7u\270\255\236\306-\341\270\232[LM7\276ta\261\324\303kO'S\246\021\to97\204R{\266\214Kn\201\313\360\325e\016\252sh^\335\204\300\0272\035\371\301\270\315\204\314{\254\017\262u\006\240\230\257%\033F\336\237\236F\007O\201\250\211\024\020\034\206\361\303\244\231\232h#\001 \025xz()\345\017F\336\2203a\263\236\355s\246\362\255\371\373T\006~\234\323\223T^\310\262\346\031\020n\027T\301\2245c\234\n\202\"!\026\n\244\205E\223E\036G\336\337\3270\222\251>\314\337-aMZ\322\032 \201\203;\256\347\310L\201Y\2733\225.\314\337}\3702!\311\004\303\361yq\353f\312\001\320\210\352\021\026\021B\272%p\n\276\216\257\217\335\375\311\327\246\276\225&D\226h\315\th\324\231I`\331\364u\365\255\3656\267\347\256\220`\304\376\023\220\332J\300>\031P\310\211\216\02060c\262,rR\225\340\024\014$\0241\002\205J\002\271\277\350\236%\361\002x\204<@\276 <A\345\321\343\353\370\373\274^""\247\311y\337\340\326\300\344P\243\274s\364\366\357\366n\305\212p\024\010\275\322,\231\032\"c!\013\n\340\013\255b\316^\317J.\266\312\367O!\334\237E\214\305q\312\330Y,l`\013\372gM\200\351\215\323\000\341\027\207\204\366}\242pG\217ds4J4\321k\026-H\020\2100\\\212Bfi!\270\217#\264Q\315\305\203\214\307%\274\335\365|\354&\223\256\303*\360\344\237\002u\214\334\031\311>Q\315G\232\t&9i\357\363_J1T\350\210\260n^P:\002\007@^\202\035\006\034\335\214\332\336_s\331\352p\335\326\346\017\203k\211v\240t`\2620T\377\010\262T\005)hf\207\332\277\231\273\030#0\0160\202\262\nA\n\224\371\375tL\210\270\020\014\202T!U\226\332\224\242\212-\003\325\032\030\216\025\210\014\232\222\260)\231\202\030\024\201FI\205+\\M\023a\250\177\2101\035\212\212\2600\326%\006\026^e\300g\344\336\336M\033r\345\267(\255\320\306\246\032\203\030\0101g)\202\021@%\206\014KJ+\300\3206b\013\000\r\244\246\326\212\2323\370\234\3145\236iDB\027DV\027D\325Jv\344\245)<\312Pa^\305;\347\245\223\037\242g\350\300\315OT\324/j\001\006\016\263\325*\300x\221\327\036\3263Vf%J\206\010\245\014`\302\014 \304\0147\030\360\365t\232M{\266\261\030\372xh\204\2545t\225u4B\353\233a\270\312\272.U`@HI\006\370\373\254)\335\010\026\220\270\231\355\300J\256K\336\252N\210d\315\004\314O\214\013>\r\204\347\206\025O\r\004\234\360\016\036\001\003\010!!\343[`\316\317\233\315\310\016<\006v\205\353=\310\211\361\353\3036\331\223\r:\t\223w\211u&$\303\233\r\203+C\203\335\321U%l\221\240\"\332\250N\244>&X\373\226\21310f\33032\006z\334\316\221\223\314e\036 \250Y\025\225\257\236\272\337\346`\006\034L2\016S\202d\343\032j\257%\351\243\347AN\202\010O\220\354\372\223\217G-\227K.U\303\300\361V\300K\017u\272q\032\221\256\240b\014\\\200\316(5\312Lm\256\311[l\245T\031\223\006\222\255M5{\226\337\253\233\032|\021\250ST\3024\321\002\262i\313\257Z\231\262\350D4M15@\207\244@c\000\351\252\257\226).\240N\271.\\\002f\212\n0\247\3322\311R\326\004\240v\210_\306\354\207p\324\240d\267\243\005\277KSm@\312\020H\205\205b\241UE\314\t\337\2777V\365\254`\365R\2127+\0062\253\231\335#}\n\234""\210{*2\004\221\020$0 C%\263\243\207\006:\312\333\227M:KN\033\272\305\375JrF\357]\235\266\347\244\016\302I\355\365\303\372\204\"0\026\004X\254L\343\236k\251\356}*\\Ar\324n\264\035\273\001\300E\364b\214\324CzB\333\300\272\254HA\333\256\352\310\353hf\346\264\352\000\230\352\256>\236\210\n!Y\005\211\244\223Z\372\324\007u\220\324\370\316g\322\347Ad\365l9\356Z\236\252U\214\275c=k\317\025\266k\305U\236 M\330\270\262\361\3256B\263\212\252?\014\220\230`g\014\r\326(\203\3011]\233W\036\336\004\277\036=\233*\241\201R\312\225\265\244\227*\332\"\034\031:\261\321.\021-\236\230]\307\322[\0325\254Qo\252\261X\214\374PbdIwE\242\302\242\352\267\206Fu\360\374?@z\001\275\000y\331\217Cz\230\217W\303\247hx>\016\331\301\372~^\235:\333f\235\331IBt\355j{\247\342%s\224\022\320\324:\206$\324\205k\n\362\334\356u\304\256r\240\243\032\271\271{\223\327d\0106!\002\342\252\372\000\244#p\304\241\251h=;\223\255\365?'Z2n\002 \202\014H\223g\200`\031\311\222\256C2Z\206sd\221\327f9 \302\032RSo\304\025\021\016\366\343\221m\267\2200\326\316\225\313KNi\247\370\017|\357m^)\3065\216\206]\303\302F\2441\004\030\037]\320\350\236s\354=]C\323\257\236\232J\336\274\316zO\346\372\376\312kT\264\264\362\271&\234\335\377\r\301\365\317~\231\027?\035\233f/\213\261\317\266\221B\306l\367\337N\321\333\355\364\244l\356;\256Cb)\311\370\361\346\352g\321+\241\346\270\265\0223\302\314\254\327f7V\335\333tSFG\r\036p]F\031\204\314\024`\313\253\313\265\262\267\256>\316OS^\375\371\315r\333\360\3437Nz\034\230\225\001\211\026v*\001@>\376n^\373\001b0\330\305\021X\317\207\360_\363:\361\3537g\246\240\007n\252\310C\315(\006Jt#\324\301\034\214QT~\222\213\370.Gz\3452\013\347\213 \022)\031 M\233\365\212\323\247_\350\225N`\247\241\352\244\276\225\275%\255I%\013\231InW\303\336\257\270gKz\252\351,^\272+/G\252\274=\035\225\345\331\345\345\335\341\313\273\314\365\370P'\231\362\367+\242iq<\016\204\232v\306e\214*q\336B\370'\305F\325:\333\315\2036\254\366Y\216\232\024O\323\346\255i\315\023\334\366]\2168\364\265SSj\037K\270\315\245\330t[q\234\267\332""\300tz\244=\017yS\222\0306H\242\222\341\026{\3111\317\301\351\266M\256\354\323O\3434\201a\243Z\325\246m\021k\347\275\256A\247m\003\312:a\222\\q \260\334Bz@\352\313{t\325\366}SF\346\320\260Q\237t\244\250F,)\240J\202\246\233@\n2I{\304\226\021MW>\0335\271\302\303\020\304F\247\335H\210Jo\nE\250\306\266\372\213\032\373&\226j\307\225\327\302};\263[\325\227*\355\023\333\250\245\223{\027Y\031)nQ{3\030\265\363\000L1\257]:\365\235qu\344\033\310\314|\014y\017'\221\335\374|4\360\366\307\273\356\352\261\264=\230>\277\207b\261E\003\023\365\257-ZU\321^\343\025h\325)\014\2165\301\206r\332YcY\200\213^\271\361IX,\223\252\221b\325`Hq\201\207\351O\357\303\010`\311\rI+\016F.$,\023\013@\240\220\337\314\374\214\t\262!\330'A\016\014\005B\t\3713\313\212a\310\216h\330\256\245\323'F\016aB\036*\032\207\020((\211\265B\313PI+^9\261k\306\267\rId\202^\376\252\351\030\014\204F6\224\265\257+\225\313\332\244\031.0-j9\210\312\253\006;\037\200\375~\013\317sm\241\311\007\240B\364\213\010@\217J\376\357.\2746\362\364\363b\272\353\266z\3678z\234\271\331\234\244\003\031\t\030\305\002A4CGs\227D4f\332\303\331\206\256\234\333{\341yE\226\212\272\3265R\210\016\320@FH\267Kj\322\216\236\352c\003`\t\275mw\276\252\317\326\277\243\004\254\353\205\025_\033\321\252\371\320\266\031d\240\355\002\001\363\272\320C!L\001b?\234\327r\363\213\n!Pq\225[\222\204\263\306\tZ\240:\241\014\314\003\242\233\370T\350D`\216\332\n\260\022E\004a\356\003\317}\303\031\017.\3105\215P\307h\035\0004\346\326\300\203\204\331\302\231vf\234\351tdr\303\275\257&mb\212D\331M\266[iThF\004\031\357hU\005QQ\315V\351G\323\364j\356'\267z5\270tqd\230>HC\324\226\255N\030(\023`\014Q\260!\027\260\302\241d\332k8\013\345$\005\270[\032\333V\256+\363\3023\344{%|\244\255\343\323\021}p\253\333W\246\343C\331a\204\252\233P\311\014!\t2L\215\204\364e.\237\205\3667\222Ad\000\361\207d!\222\034f8\252\266\226\235\204\303\027\020\244\021\235\230hg\271\351\"eRq\032l\367b_\200\205W\322\200<\373\322M\206N\216\205\036;S\363!\340\344\004\200\304\\\231\204\235\200\333<`\016\332""\326v\202\316\265\250\0010\013\001\223\330-\370e\014rY\262r\006\346JR\327t\311K\013\242`^\330E^Q(r\0308\026SZ\373\265\035.;\370i\256X\306\177\310\335\345\322c\016\2427#\237^F<`\246\315\227\345V\303\007G\005\271\035O\035)*\337\300\335\216\351u,{\367l\246E\030I\204\204\222a F\255Vqo\006\336B;\355\357\363\343e\221\317\254\312q\313)7R'\036\255-\267wy\355{bi\200\007\314T6\022Hh\262\200.S\273\010k\350\341\022 \254/\232V@\252#\366,\225\024X+\010\204\3160\003\017\261vjR\023\362}v\0045\311R\003\034\260\tw@}^\325\323\360\325m\241\001\020\r\202\245Z\370\365\250\205\"\267kv\353\245y'We\"R\302P\210\"?Z\204\262 \210\340\203L\335<\275\005WF\247.\244\r\274m\327\222\333\302E\016\206\265\214y\20418\265\313\230\\\310N\016$)U\212\002}t(\221!\024Xm(VWzBK\"\324\267\027Z\2522\024\201D\375\3375\024Z\331:\363\\;\271\366\363w\362\240\210\225P\321\243#\"Edb,\027\254\245\"\305X\265E2\230R\253i\312\023\321'\313;;\375+H\226)\322\345p\265Bk\335\322k-\237\251\332\343]^\253\034K\262\002\306\3145&\373\004\002\310\354\"\"\213\277\304\277\215\362~2C\037Q\366\374\312\025\240?\022\237\205\230\360\007\203\3007'\257\300u6\222\341\364k`l\204\032\334\003>\206ga%\253\321\020\216eT\177\"\252h:jv\327mkQx@\243\263\2257\246\202\3113\310m\222\315\214\302Pd3a7\306\202-\234\035v\r\2045\274I\301[\361\310\017\357b\376_o\365\310\301\021\0051\367\377\030AR$\010\334*j\021A2\\*\036\234\343z\231\373;\325\325\330\26602C<\356\253\347\253\006\265\215\0069\266\272d\321M\224\030r\273Y\252$\3157\277\313\276?7l\241R\333yqk\335x@\276\340=q\007\346\0143I\006\023\242\332%&\331\004\240\263T\226\334\205\241SQ.\336\304\356L\253w({\206S.cY\204C\352!\021\177\217\033x\314\231V\010\202{\202\036\261\204G\330@\316\346(g\333\231(\014C\267\315,\0146W\225\275\302L\"w\230H\225}\325\257\274\024\226\362R\256\273su\003Y\000\"\213\025\201\245\240\344\231\3723\361\201\244\026H#=\252K\220\202\024\254\363j\253\345\024\204\242VY\372 f\257\203\201\3652K\036kS\220\353\255)\205\202\033\241\367\3670Y\222\013\"6\037\335\355oN\256\311\260L$CCT\264\262>\353<""\007,\353\360Td\211\010\260\001\207\304\210V\307>\357\247\353\036\377x\364\206\347\224\003t\006\010\232Jb\310\"\247q\225\r\215\215\251ME\251\2511%\244A\212\251$H$\021\020Az\031\371\035D\237S\357F\351B\240X-\336\226P$WP#L\002\362 \271\020\206\272\301\260/\032\265\366\346\265\312\321\347rV\347\246L\004\204\313E\237^\330\013$\313`\260\024\200[|\356\215\215\274\356\242\305k\251\000 &(\260U\313\244\273\356o&\320i_+\345\227u.\244\370!\263\r\231\211 \274\232d\207\013\274\242A\230\030\205\020\264\227\004)\220\215\336@\307v\360\326/\267\270\201\266\002\006\264\003\350la\0374\350\300X\020\240\365\001E\212,I\240\014!\202+\010\300*\375C\033\207\341\317\236=2\346\330Ln*\307\035\031\252\324U\266\372\253\232\306\253\233m\362\333\330\314\245\252DX\214\022\364\013\222\004DR\322PL-d\031\006I EH\265\2032b&\265\350k\371\203\000qt@\343e\353P(k\245l.U\0020XDc\000\202\317\210\316\353(&\342f/\346pt\253\246v\264\3676\251\003H:\317;v\001?\253f\353\231v^\372\366\317B\210\301\220E\375\255L~o\311-\023\372M\035\266(\275Rc\003\213\334\014L\263\034\274w\r?\013\272\354B\220R\024\224\020\235\323M\323\001\002PA\001\201\202E0\323\003!\024\002\014\000\204B\027UI\003\032\353U\346&\233\316\231\306\206\037\275Z\206\245l]Z\330EC\021*\013\223\213o(\006\271\000\204F\355\034!b\324$\330\323\325\024Z\266\2651i\027\037\210Oh?C\260:f\332;\004\020<\223\004J`\246\014\2022fV\262\300W\363]\330*%\031\034\230J\250\364\315\313\315T\311IT\237\\\235\362|\r\372\321\230G\021\315\035\304%1Z\256\343HoU\3573!\367\tD\372\277\r\2270\265W\330\242\345xS\3357\"\"\"\306nj\022l\302qTw\337\303p\220\304=\305o\3577\201\307\230P\211FR-\020\363e\240\236d\236\357@\026z\225G\334\200u\373\242\314\223E\330)tO\203<\233\2527n\302d\312\221\241\211\332ij\260\331\"\210.5\357`#\033\037=Mg\363\236\276\207A?\037cfP\n\000\304\026A\311\343E\002\353\236\200d\034\202\364\007\030\213\372\230\260f\335\373{B6\331\217>\3406if8JVs1:\354D\206\272\274\261b\313\026\355\222\031\304I0\356:\250LC\034\n\003Z\323\025\256./p\020\302$$\t7Gv\024(\365\267'\254>n\372\275""\363\314e\365\371h\337\357z\337O'Rr\023\226V\355\205<4\027\207\224\241.\361\220C\246\017\237\365v3\314\205\010'%\357\202b\224.3\341\200\271\276k'\335F\304\216\201\206Fq\365\3438\n\001r;W\345\243\013\327\"6\037\232\345\232\332\347\257\323\337|\235\213\004F@\005$E\006A\024A\024\031\021F3\261?\243\373?\217\361\363\333\303\304\362\036W\333~\017\305\007\013)Q!_Z\236/}H\257\257(\241kw\0306+s/\327)\355\333#\023\032\0174\333\306\271\301\351\360\337\330\207Q$Wo\326\3076t>$\205\014P\222\013\025E\246\013P\221\306C CB\262\t\000\320\004\270`a\204\017\210D\227!\2767\301\017J\237 X\0135\216s\323\1779[A\265\207#\216\221q\300R@u#\321=\344\007-\t\010H\205\267\331,\306`\314\034\371j\276\3715\243<\243\023$RX_\260\332\244\365\035\033\245\007 \315E+dl\004\266\006)\236\362\315QK\341\254CHL\334\234\233\033T\207\351\323\256\265\373:\367\371v:\232<y\226\010BD\223\010xI2\371fI\342\036\270U\0327M\037\"\010\302\010\250P\023n'\245\357\343`\322\224\251\335\r\206\275=h\306%\261JQ\217Kf+J\301B\246\332\351f\030\334\037\036\221\203oG\273\350\354\356\231o\277\034\372jNY;\036\031!h*\310!\003t\364\236\023\310\333\265W\257_\324\251\366\220`\037\00354\250 \205\270\004D\"\221UkL\223\005\335Qk\373\205\237\274\236\236\264u\003f\347fH\227]\333\325\033V|z\270\2607p\336\306g.yqa\217\271y\371N\"\246\034\303\226\230\363\032\325\332\341\241J\203[\211\206\233\350\023@r6\247\004\316\207 x\202\032\016tt\324\371\224\343\345\022,\334\242i\263\2073R\211\0252CLZe\211\"O\306o\026$\025I\005\204\001aZ\361\276L?\034\336\322o\323\362\347x\030v\226\365\322Y\255\350\321\236\\A34\200f\026N\346{\370mk\330\376#H{\211>\264\025\210~.\267\303\364\347E\351\262\323\301\342\367\316?*\034\222\007[\207\217\336\277\275_\313\211\273\277\251\2578N;\356\035\t$\222I&I\222\266]d\224\206\341CE\365\267\007\031\364z\263\275\000\357z\264\007{\275}\225jJ\265\327!D\272\322\222\336\355{\320-\002_B\340D\034B\n\342UV\360\0041*\270\021p\213\205*\324]\001\264V\240\337\026\350\013P\343P6\320\201P\333`,\021-\252b\034@\271u\220\361\n\311\216\241\346f\001EC""\006\262\031l\202\231m\031Mhu\204*C\020\324\016Zn\346I\2111<x\372H\034N!OO2\244\365\313!\216!X\253\016!G\321i\351\364\230\232\324<|\312\257\252q*b\034LO\030bu\201N4X\262\346`c\211\327r\341I\215P\351u\276\016\366\026\326\266\261zb\341\305'\214$\234t\225+8\030j21\207\022P{\3155c\270.^\\\3117~c\314nksU\332\234\320\341\230\234Fr\233.\246\003\023.f\212\227\0039\242m7.\210\256\027Z\213\335\246^f\026\234\351\274\3306\332-\201X\351\231\227\233\206\032\345\356_O\216\"\014^\321/\210b\271\205(\361\325\343yn[\236\260\357\006\272\266\326Q\033m\251\311\206e2\21773R\306\026z\245h\216\025kc\301v\210(\245fd\021G\010(+H\204i\262\221\031\n\302\230%\020q\024.\264VDt\331q\304\243$EJ\224\031\233\214\264\310\025\202\340\250\333B\270\334p9\223]\341L\340\250\212\346M\233\240\235\322dL\334B\223\256\302O4\341B\235\243\350\356/i=[{P\356\214\031@\3234\020\004\n\2611\213\251\\\017C\335\312\262\304{\222\314[\200\020\312\033b\020F\202 D~\214\345\204\025T4\242/\247Sn\344F\356I\221K\230\243m\326\355**\242\353\034\2428\326\305\323r\367\327\r\336\027)\034\251\273\275\202\301$\274\307\226\332J\222\243d\302T6Q\203\226\247\362l(\262\224y\305\223\212\324z\311%8}\035\243\240\363\301\323d\220\271S\003\244\216\372\003\277?\327<\356\002Y\256\273](\023\2729\347mr\266\266\326\010\210\305\276\022\265\237\357\377\2539\305?C\277\361x\022\3557/w\236\rvX\246k\024Q\2450h\320cbdF*+\3177k\312h\"\024\276\202\224\305ShTX\212\2130e\203\nZ\270\222\311\260\246\232Z3@\024\004\323hL\004A\264\r\023\021s\n!l\007.8\231\020\300@\303!\206\025\210\233\004\246\326\205ED\324(\027Ky\332uo0I<pGy\334\327\235\270\312($31\004F\"\024\302\226\333,\265\230\305\027\316\352\005\217\313\035\014\343Z\266\377\013g\326\223\372\304\237r\251\021\020\214\202vy\262]\2041\206\024\007\333\014\353q\022\370%5E\001\225\2152P\245\366\025\347\346\265`Vjf\321w\027_\257~\217KST\003,\006HAdX\032\301\256\352\247[\330\356\340[\265V\025*\2122\231h\272\t\002+\"\324n\216\312BBAhG\224Yo\030\025\270\202\013\000~\006\266\373\267\2711\360\256\037\224(Qh\230\201\"\241Q""\365\264\300\270\231\374r\304A\202\013\030\n \233d\220\037\252X\005\217j\321o\014\017\316r!\244\376Y\220\240\301*\003\234\3163\242\010L$H\200\223\020\303\204K\323\316~\234\257\314\360n(\334X\352I\311\257`\017`\330\032a\t\373\343\026H\203\010\252\004h\332\200$\264X\254\032\250*EP\210\201\0257\367m^\352\364\376\032\350\212(Eo\330\207O\265\370\204!\2314\311>\346\334\373\342\033R\321{K-\213C\267k\210\256\305.\227\321\314\300n\245\306|]E\355\231\2406\2632\004\314\311%\304\033\255\336\265\307cK\363t>~\314M\254G%\317zD\327\"\327\257aB\327\320\315\310\253\235\333\"J\365,\34524\217 \340av\201\013`\031_r\204f\356$\302\3150|\377\031\201~9&\243\010\340\000sP\273\rT\204\255Id\266-\212\024\225T\324\226\304\222\322\247\245v\364F\214\267h\274'N=\373\371q\277\314\256|\262YQ\036\200\324O\202\301\201\001\007\234P\334(Z\032\252\202U\024\265]j\007\357\371c\333\327\267~s\274\003\353\030d\271V\342\000\220\210\256\350@\250\250\345z\213$\312\330\302\n$FW\352{\244\363}a\324\232G\033\233\362\024\223\003\002\206\221Q\213\251y%X\0063\375_\257\273\274\310\004G 5B\036\336H{\177\203\271\336fuK\"\302\210K\024\026\026\320\250\026\331\nZ\r\266\266J\326\203\006H\262\010\310TSs\\\262s\245W\320\255\364/\010\226\033(\262D\025V\006\252\206\020D>\2167\270`\014\363\276+\351\367\355\214\273$\207_\301\344N\202D\212\243\030\340\351r\307\350\327\323\373\301\274\204f\264-\322\002d\262\025\275\252\365\265\365s:\253\217\261Bo\212\332@\351\\\354\310\207\251Vi\306\3549\345>\024ijFw\335S\020a\255hL\314\304RP\306\373\277$\332QmM#fb5{Uz}\325K\245q\030~\344\010\367\272y\315\210\331\253\261\030\202\306g\353\342\364\245d\264SR\251|=k\240\2233$\177\r$\224\362\337E(\26109\333\335\261\333L\345O\321;\221\031\034P\224JV$)F\tB\327\370\213\231\224\262\201MV.\231r\027E\212\245\322\241\255\251\246\271\341[\006\\\376L8\214\204\010\201\035Gm\006\026NJ\013\006b\336\021\320J\357\007\202a\306\277\006\236H\323m\274\275\2036,\362}s<kJX\206Y,\001\034\020\247\332\001\324\237\311\200z\006\017\204=\014zX>\037\213\342\352v\327\375\017/\304e""\243OK\246\361\004\207\337\3029*M4\t8\356\223\270\353\351\354\021\002\360\246\"\353\254,\230\365\367\220H\265y\013-\260\244\020\205\364\223B\225\260\351\364\323\037\307?\233\227f\271hQ^\236\217\231a\322wB\266q%\204\257\351^a[\254\266\246\n\020\2767{\331\335c\2422RB\223\266i\213C\362\2448-E\026a)\205ES\313~\311\254\031\037\030\2736j\366l5\203\037\212\373\230\331%\305\177wy\300b\004\344Mz\205\034\223\177C\320\330\310\361S>X\343\037\247\227=\234@\323\2778\272x\232\305G\306(L\022*\016\223\\\224RN\355\210\346\220\354\305L\211\275\035\344}\006\001t\357w\275\354b\241c1\230J\004\340\345\245f\026y\037\262\241Z\357\315s\016K\031\301\311\2175d3\353D\225[v\217\201\364\327mW\217R\211\305\320V+\245\356S\323\216\305\253\020\327>7\235Lo\214Z\332'\235\327\2363\214b\373\036<\365f\310\235\316\301\200\002\314\tT\350\036\036\331\2419N^\232\316\234\031T\313j\356\333Ms\013\2651T\245\313Z\365G\366\002\203X\036F\n\366s0\241\203\326\341\202\030\203\210z\273\307f6\321\nd\364\202iRQh\346\266uy\267\006\325V\213b\010W$\245\030\232\010\337\032eLQ~\"\023F%\224\032\n\201'\274\217\265\352'h\256~\240>\233\347z\016\253\234*b\331;\261\220\300\005D\000\315\3466\337?\202t\310\254\321\245i\276\374\266\373\325\335|\226\003\357\255\273^ph\207)\235\205$\236\257\212\342O\016\221m\367\023\221f\270\244Ii\2367\261;\261z\262\2677\236\023\316\211\336lKx\241\324\261\211\227\003H\316q\022\367\326\375t\254a9+.4\341\317L4\031\351\240Y\247\350.\036\305><\234\200\240\017h('\200}\021\r!\207\r\310\263\201DIB\344\026\026\271%+\200\315\303h\3132`\262\306\341\240\301G\277\203;q\345{\255S\225\317j\315\306\342\226o\347\263e\231\350\0233B\261\005\323\037F\027\354T\241+\031\201\314X5#Bc\217^\315\231O\034\330\033A\204\307z_<\010Q\240mv\274\275[V\237{\313\363i\\1O\227\302\260\250/\3134\357Zx}\234;=\236\034>\3156\345]\333~\245yz>n\352\323\263\2247\252-\265\375\024\274\270\373<E\361\327\216\275W\3311\335\270\375\207\025\0050\316\035\335?\007\272l\341\351E\033\342\226\237\r+Of\336\317-3f\010\366\351\243\347\212r\256\317\017g\243\204""\316j\225\375\246\231\307j\341P\303\341\363m^R\237\233j\362\323\207em\266\332m\364z\270i\247g\263\247\224\244\247.\234>\034/\025J\254\tJ\235\263J\253\207\325\247gI\337U\331\312S\273\365\270wiU\247N\316\037Up\256^\025U_\333|;8|;+\302\276oLR\362\314\273+\262\245\275\263]\032M\236\357\354.+5]]4\333\303\273\321\354\375\367gg\207\262v\351EsK\246\233r\237\325r\336\251m\376\313\303j\371\271\212\200x\341_e\360|\005\373\017\247\275\201\354\341\365\034(-R\231O(\263\t\r\361S\226\365F\371\253Q\376$\313\262|[M\"\232}\351\354\341\331\313ov\235\234>\366\237\333m\362}\034\277\342\2452n\311\346\332\275\025\366i_V\223\0372\276ioG\273\305b\362\341\313\313\214\225\247um_so\342v|:\350)Z\364\257G\344\341Y\331\244?/5\302\241\224\257*\372\034\276\023\016U\\'\235\322\335\025N\3156\375\215\271p\362\341\360\301i\303\302B[l\247]h\206\223\010\003\212\313O\311\376\355\313\356|\235\236\314X\252r\374\033i?\262\250\273\264\374\2349i0\250\253b\246DSe\374\257\342\370Z~=5\365kRi\032\220\350J\276\372\355\221\273E\275\223.\244\\s\304\260\213\030i\304\251\323\273\245\247\222SlH\374\242\0021\370h%\323W\335\274?\226@\316\225\344\r\332\343T-\017e\217e\350\357\214va\037\230z=\021\032\026Q\r-\340P\371:\001\244\2056\306\334\322\265Ey\341\253-F\233`\264\272\266\351\213\330bE\002\256\257j3\030\336\360,\272\266.\306aP3\335C\2452e\267$0\340r\316\261\2042\031\330\206(j\273\264\013\000w\337\247rc\276\037w\216k\360\374\341'\263\t\324I\273\200d\3154\rj\033\201\253\266\226\312p\317\t\330\315N7\321;\265\343.\033,\\;\363\205Fn;2\321\263\212\367\2554\n\264\221#\344O'\245\021\241\267\276\250\323\231e\252\316\017k\355\256\232\323\204qD\2261\246RR3yE`\342\245\363\262\311*I\363\206\037\031\214\315\240^\332\322\373_\246\223\335\247\242\261e'\246\257P\237\"i\255\323\330\302\022\301\222\031\361\343\014\022A\022\250)\"\n\356\205\t|\341\303\263\325H\2162\265\321.\373oL\2069\030\303F\315\003m\3246|+\246C\024F\242y(\300\327{\227Xk\267\0358\343n\254\325qv\006)\233\326+7\224n\307\t\333\363\031s\313\013\350\305\234\277?3\017\215\263""\350#\005H\214\021E\031\030\3730\312y\270\237\234` \317K}}\3361\352\223\014\354\265t\330\225\\mX\357E$\373\353d\336U\255a\205\271\031\322\351\330\240I\017G\204B\242\0224\336\346{\264I\361\361\372\316\003\002j\255\355\334\310\\\000\312\247\262v~4V\267\234\371\301\020\23438l\242\214J\022_\202\313\302DD\004\273\\\230\205\030\220\240\031\025\0230\003\337/\341\353E\340}$;V\231\272>\344l\263(\312\0378\323\302JI\334\342T}\221\323\307\236\272oZ\320\242\326\204\332\240\221f\222\262\2765\231i\230n\273D\005\262\225\204\203B\305-\216\3523\006\316\331Yq\2127\336Q\222\373k\341\005\315\232\214\"cO\315j~\360\2621\0020^\302r@\232\346\370\370?Gol\225~_\237~\002\035\240l\200p\270}\\\025\252j\177\231\252p\316\270\312\234R\264\030jvK\300\203e\232#\333\243|\236P:5\274#c\374\334\3467\030q\2505h}j\201\031h\237[e\222|wR\326\014*\355R\205\016\2464\323\324\030PXe\260f\277\034y\274\274\2721\234\364u\024\254\214t\365\262\273=\217u\335\035*V\333\355k\256\3010L[\327jjT\366\325\037m\024\366\320\037l\037m\000\366\320\366\306\366\237c{\373\314\003\211\014\315\221\232\\\031\306\336\2326\304 \030#\300\272]*\314\203G\026_\362\315\277\021\276\361M\353.0Puw\023|\327\026\320\272\026\000\371\242;\350\341\350\324\356\205w\243\217\262A\024\334\273#\304\2564s6@\306q\220\343;awv\337'@\300g\24799\317^\266\330\212\221z\037\216{\363yoXLF\226\204\313VA@\020\021\237\005\034Om\3713\222\035N\214\340\212V\025\225!\214!\231\231F\270\302R\231\202#\224\212TRL\264\005%eI\205\261aZ\254\n!8\303\004\206\226\232\212\265\200\240\252B\226\205`\005\215B\255\244\273?\032\377\025\033\275\027\211\353\301.\204\200\272\204\020\241\276\205\201\214\240\220\246\212\003\371\250\022t\017\000\241Ga$\320\200C\021!\242\351U|\321+or\"\306\253\326m)[|\322\332\030\260\027eT\nB\n\006v\363.\006\025\007;\232\307\217K\326\225\321xtc\223\0259\304\205\003$\221c\344\225!\265P\262\006\030J\212((\277{\357>\2156\323\366d\236\004\016\335`\262\220\236e \036\350`\310paF\004\236\3774\266\201a\311LA\345\222N'P(1\022\007\320\207\205\223\"\036+\tXN\n$\220\372""\030PQ\320\241\317\013!\351\024\024y\257\255\006\2245\037X\273pt=\276\271g:Kh\2411\021\023\001\204\240\270\212\246B\372\275\265V\013XT\342\212\232\336\272Z\276\225]\236\242\370\213[\305/n\253]+|\343^x\341\326\340\224^q{\210\315\225\220'\002Cb$1\021\210A\022\022u\020\310\200\226\363r\020\243\267)V\004\352$\322)i\000\241 Y\323\256\331\313\246q\252\013\315f\022m\233[\340\250\325\222\364\222\225\342\255\313m{\344\237\264\234\242\22020\350\250\210\214\r\322\005\030\353\266+\255\007\002ND\222\216\275\226\227\216W#M\020\350 \033\244:\020\342\242\223w\212\250t\344*L\214\345\365\234\265n\004\005\322X\302\017\027\270R\270\216\004\210\220\313\307\347)\232T\370@Y\014^\237\006+\323\244\300\223\326Lx\374\276\266\353\251\325 \326\370fb\212\022\n.\036\212LTTQ\223\342'D\225/\325\253\236\356\271\031\2374\352k\336S\031\324\3247\323S\312VE\202\222^\333\346o<\275!\252)h\001\356\010*\204\230m'U )$\026CO\245L\271\355\270\023\021a\321!\340y\360\213\200\360\243\002j\222$\344\330\252\301Q\021\031\306\304\024UVff\226\323\332C\337\271\236\035+\245\353Qqt\253\266\272\\.`\212\010\212mH\376\310\034ti\277\036>\3240Nnm\263\016L\231lj(6\202\306\353Ub\276\264\0143\332\367\241\212\220s\267\3430\372\336\376\267\237\345\006_\317\306\000\354\212\210\260\315\331d^XS\206u\366c\003\3255v\255\250\265UZ6\353\325\023~\014\336\324\371\275Kh\016\3144\342\253E6\327U\314\327J\331\322\224\306r\212\306\331\030\013=\273Uj\374\0357\332m\303\351x3\255\334N8\353\307>:\254\201\312v[\240\236\345\262\330J\000`\302\"h\220\252\251D\251\001\233YR\322\024T\304I6\322\351.\325\322Zl\032\314\265\243R\225^]\257I\253\315#\312\355\253\253$\252\351k\224i)J\333\223+\246\212\256i\232\276\013x\257u\3556\240~\003B!\214\001j\351\006e\240n\313\204\001`\216\035\006\335\367j?&T\227\346\260\001\020\027o/\007\346}\272\265\351\235\346\360\200\221\210wj0\350\222\223\245\022\230\250\306\036\241\337\247\217\\\022\206\001\224D\3522\204D-\220\321\014W\020\373\313\001#$f$\275yY[c7\202\036y\0173;g\323\310\351\323\3132Ht\344\352\333T1\251UT\227hP$\007+""\320\243\004o\303\250\332\302.h\032)Ij\225\n\032V\327\023\255\027[*\253\254t\2267i\234\325\321t\260\275\355+\205\222\367\355\334\niR\007\274\350%\224`\362\320\223\306\0146H\037\254\237\252\200vq\337\214\002\010\221\212\235Z\317\256\333\035{d\302\035,\353\275x$\034\246\350#\256k\227\326\014\370\362\323};X\314\r\312\204\022\226:\330\356*\t\270`q\036\\\333;x\363\325\223\345\203\321\214Gu\2541'\031\347t8\026\332\032:r\315=\202\232\274\226Tb\240\261\204-\261\022\035:\356\327 \246k\021\222\321\274\302\352\256Z\220Q88eD\234\244\032Q\023\205\tJ!D\034R\215\nb\260\240c\n\242j\024\021\010\242\364p\334\267\222\362\362[%\335-F\211J!b\n\221\005\025\243\243\t\214\231J\013\251X\241@\250@\262\260R.\332n\222\030\031\303\231z=&<\032\356\253p\332\212\324\303\"^\352e\312\211\232Z\202\252\202\251\215a\233\213&[\256YJ\226Zy>@\362\022\033\317D\240z<\"\356\001\203\010\010\201l(\254B\275\355N}\333\330\342\266\257M\316\222\361\276\205o\025Z\304\257\262v,\025\273\364\214\007\025\210\271{\351\355\263\030\214k\257\035v\016-h\306\016y\3352\371K*O}\266\020KC\222\262\333\3519f\374\314\024\374l\306\2366\242Y\316V\246\220o\246\272\333\245Wr\335]v\352\271\264K\263B\025H\300\257\343\206Y\240\002\005g\325\312b4\261\221RUS\024pDE}\375\336\306\332uU\345U\261Z'\330jD4\221]\020\310m\343\341.@r\233:M\274\367\357\343\350\353\205\322\006:\032$\"\307\277\312Qr\014\307c\333\235\027\237c\256\336\330\326y\260\004CR@\231\001\205\004\234\304\"\305\212nB\3165\223(\317\330\332I\r\037N=\270\372`\026\020\236|\370\277\014'PQ\365N\223\212\254\334\276\365 }\016\026\020\364\254\275\355\317t\346B\022MB\235n\374[:\216\205Tc\003\320\321d\222\235-\211\026\363[I\314\0228\257\262T\272\373\355\234at\021B\335\372WA9\310k\256<\263V\315\316\335\017.3\375\342gzXr\320\347lb\230o\223\267\317Z\306z`\246\022Gp\372\312\373L+\357z\343\317\223p0\210\313kl\017\334\211\243\357\001R\243Q\031\037Z\001k\025i\"\024\371$.\350\242\245\006%Qm\266\210\311\\\001=\004UPD\006\212?d\357\213\347\200\236\\\020\317\351\001\373\310{]\024\375\254\266}\035\017G""\326\202\025\022oU!\362\347\342\223\321\373\350\006\300\306*\240\332Wk\242\251\237\203\321I\030\013$\332\221$r\357~[\236\021\241\026\246\234\335nsr5\246\315\230d\032\321b\305Y\241\303%\271\024\305\204\216-X\371@c\312\n\367\221\027\274\002\235\344\027\274\203\336N\266\223NC\245\313\261\366\203\320 \273K\206)\355F\351\271T\026P#\n\242\324\211t\262D\33608P\262\020O\273\302u\304\034@\300\200B@\220c\000\"\270\200\216\361L#\022\0220\221\016\236\240\025\211.:D)S\246D\002j\"\024\202\037\"<L\246\005\250\316Ut^\364\t\006w\320\n\354\221\013\323\021\325\312\026\262\006\256\342\347\323$\\\033\036\330D\036\321k\033A\202&\371\000\220`C\336*\024\224\020j$*\261i\227\016*\014\236\020\373!O\262L*\262*\350Y\207Xi\261\035\245\003\230\202\033)Fh(Ppi\013\315\256>\004\242d\024\222(\330\270\356w\003\031\206M\234\333*\227\352\000]~;\262u\365WTTdY\005\206\205\324\030\013\357&\002'#C[\016\254\266sk\0235\375\276I\275\340\317\351\364\375\233\270n\352\361\006e\321\324\251\324\374\t\341\277__vs\306\213$$\363\003\200g_\217\261\257\214\224\243\032\303\263\316!@\266XoF\364\326\240\242\014\252(\260\025RP\256\345Y\272\304\0273\262I\263\260;\310\326e\010q\253\004\222R\334\307\036\335\270\227\272N\210\312`x\366\264\241\333r)r\221\262xe\2331\344\301\304\356\351Vm\314\001\307\270\344/0\233\373\036Y-Q\212L@\021n\251(\032\"\301\204*@\243$A%K*S\354\033X?\000h\222\021\002\305\260\025$\250b\257O\017PgR\337\270;h\250v\325{j\002v\321\023\266\213\333S\266x\317\031\316s\037f\377[\200\366Ss\247\027\215\247\000\235]\343\361\366\035\335\335\271\317,\337\265;;u\270\024\216l:R\352\226\276'F\234\033\360\000U\232y\353{?\306{\311\266O\314\3401\340\013\364\343\256\333\3531\005\005\025P\236\222\311\263ef3\352\315\272\342\273\221\032\020<$\354\320\022\024\210{\351\335\356G\317g\311\354\273\271\223\335\305\315\225\371\347\243\204\351\223\237\035/\263\036+\253~Nc=\243kz\326\236\255<\230\344\023\021\240f\004\360\016\313\200\r(\255\340\222~\240x\327\312\020\231\022D2U\237\234\026)\275\221\306\206\307|\023\006\222{\001\033\026F""\033\261\245\340\314\030\263\211\221+\213\365\2410n^t\301\315s\263\006z'\227\026ZQ\226\223|\364i\313\017\306\254\tQt\254\264\302\203\333\014\3174\346\347\347\347\024W\234\021\347\000\036tD9\301^t\003\2359\326\325\317\271\307:\231\300\016\311\r\302By\365\311\305e\033\211\300F\240DD\030QE1%\010R\375\377}_\340\375\210<~\322+d\222_\020\372\370\325o\277(\375\265\3672}C\306\250\204\005\024\026\240m\317\333\236\032\006`\265\256\300\001.n\222\021\027\231\002J\244\227\211\363\264\372z\275\274\267d\311\203\031\"h\200\336\022BHK\241J\034\\@\201\304 q\000\034H\017\010\247\020\2350x\200\261\304m\375|'(\347\217b\250e0\002\037+\372\313F\213\364*\233\"&\000\251j\321\037\312\220\341\201\303 X\310\3110\274V\n\270\033\tx\340\251\035$\210;\360\344!\035\364\341\337bVR\275\273~\375\364kK+c\220(B\005\374w\371W\202\352~k\307\241\361SJ\206\010{\272\256x\025\241\330\240\r\200\212\204Qa\252~\332}w<\252\261\252\032\257\324\330\362\007&\006d\301C\244P\272\213Iuf\244\301\023\025\327\026n(j\322\330\241OkM\342\216)\010`\307d\263v\256,Uu\032g\002+\300\213\300 p\"o\212\360!\300<\017\007C\253\301\274v\t\331\323F\211.\327\333.\272\022\034l. _\270TL\007\222\230\231RHa\303\234\202\216\3141gJ\225f\247\236_\030\242\266\001\371q\363.\350\254\340\274\340S\354\343:L\231(\342\312\26337\3243%\002\344\310Q\230J+2\253\300\206\207\316m\266\333g\233\235O,t\220\001\327\300O\027\306\362\004\017r\234 \316\305(fN{\t-\n\251\222\240\305\007E\023`\362\333u\331\241\216a\3251^\010fbD\313\207!BOe\305\263\235\036\224\361\200\203E\363\235V*K\247\333\037Kt\346\327v\233\004\341^n\322\375u\003\035\317\266\276\337\317\0037\270\247\343\316NH$K\346H\226\030V4\330\277\301\242\3642v\201 \020d\024\006\331\264e\254\252\306\333b\326\251\243F6\245YcU&\262Kj\0325\276\253uU;q\355\236\330\317)\330\200\305\223\315Lo\\B\361\357\364\306\337?;\371|^H\002C)Reh\277+W@S\356l\367\016`\0049\200\016`S\231\000\346P\346\036a\301\314\274\316\257W\217\233\211:\350_M\010\241\305\356\301\34068\374\210\340\356\351\341\242\307\260\000%\324\336\251\324\241oM""\335)\3663\355I\033\n\212o\010\357\000\033\302\357#\274\273\301v\366\361\307\2336\363\313\276\347\000G:\231\020\316\3473\326l*\"aT\0148P\274\003\010\030G:]U\237\374^\014`\241\215\3028\307\030\3431\237V\214x\321W\030c\\x\314n;\031\262\376\276\2677\036\270}9\321S8\031\320\324\\\371\334\356\177\375z\274\347\007\217\207\363Q\377\257\377j\031\355\037\364\217\354\010\030?\327I\222\277\242\357\371\333\310\227\030\\\217/\036\034G\214\336\226\355#\267\2017edV\356J\021\335\313\004\010I\032\rU\232\030j\310\237\335\347\367\344\031\\\347/M\226B\257\3370\223\2202;JG\222\217\020\010\202l\211\310\342\326\313L\346^\202-\224T#N-\303k$BL if\277\345k\233|\270\352\352\317\371\207\375`\217\341\370\201\253\227\372\357\305\274\233_\365\333\375\341\232\305\222\306\332\330\231\250\305\245\206\324|\233\246\212$\324\021d\2416\242\266\210\231U\033j\223a$\331\245\265\224\262\233RIQb6\322h5b\264\226\014jm\362_\201)\322\301(\212\201\376DB@\t$\025\325?M\220\373\307B!\304\275+\253\264\226\325-\275+\177\261fd\324\232\002\215\244,J[I\252J\261h\222\320Z\215\264\205\265Q\253h\325\231\253e-\032\306\243h\264\300\254UbCU\033Q\250\266*\306\323#kE\213Qk-**,)`\212\305cX\326T\255\005\243Q\2516\321Q\264\"\225Qb5\222\262m\033c)j6\242+EDS,\025E\232\033F\314\264E\222\262F\330\321\265 \244lY4L\333\024Z\306\242\023m\030\242\0216\324Z\310\315\250\2526\215\246kE\025HlX@\325\022V\223Y\2306\204\254E\215h\213\030\321JY\n\241\225\215fTh\322QTI\032\215\243Z6\311PQ\364~\r\374]x\253\306\331\251jC\345\211z\237\351\020\002C\364\021A\007\337\"\025\001\201-I)\365\310&~\261M\234\222\224\007K\314,``\306,F\332\010BLd\014\030\306\026D\230$$,%\263uk\312U\264d\330\271\206\254\222\327m&\245n\266\315,\324JV\30656\264\255J\225+V\232i\267.\255\253?\241wKmz,nR\314mT\331smm\303XJ\211\272\037~\336\314B~\277\361_DmD\263r\220\0300\204\006\017\3442tp\232\024\r\031\"[\214\234\203&\241\n2\230\266\220\026\000\035\032H\321i\"\200\372\017%\302\207\320N[\211\177\234\023O\372\205&\2639d\220\243\324'F\267\2609\014!\377\257\231\311\255\023\214\302A\006""\023)%@\342@8\007\205\026\355J\214\202\207\307\003\376\361@$\004G\373KW\362\005\013L\020\350\322\016\254\222\304\017\344\232a\246\332>2\t-\313\014\014\205\262J\320TL\204\222\322Bta'\014:\230=)\376\347\257\333\374\354\300D~\337\367O\353@\326\337\320\316\034\351\222c9\321\205\035tHd\022\302\337\363\343\375\240-\r0\241\357\330i\234_m\271\243'\206\311q\222\246\031I\206\020\014I\2040g\220%\333^\333]\325y\253\272\224lOs5,j\tl\200\373@\n2D\231Xn\001E \202\220\030]H\020\300\026l!\t\010)\366z`\213\250\037\350\025l\014O\301\377Y\077\077\2604E;\210\332}\3676\0300\240\323\267)\236\325R\0134\017\356\036\006d\250\227Jgl\n\036G\315\263g\231\313|8C\200\303\031|\010\0056\214:\010\214  \230z\000\023\355I\224\314\240S.\260\222\304\020\360\252O\375\367\217Z@3ED\215\347\220\264Y\3740Q\026\t\364\223\301\000\365\353f\025\210\320\341\202\313qO\353%\206ll\241\246xPD\223\247\031\324\002\240\025\204\024$Y\001f\004\016\3337\025\177\271\017_\353\356I(\302]=0\022(#\033\341a\350\322\304XV6\305\203\355\311\265\226a)\200\254!\r\203\260\331\014\316g\267\226`\025\247\005\023\244_\216sg\205\206\247\264\340\032p:\234\323\332NI\204\363$\2347h\303i\nG\020\226;j\376\214\237\3506\005\223\364J|\006A)T\237\374\241>\3314/\376\206\356\232\211\211J\317\355\246O%5\311\223\014`\313b\323Rz\014AHj\002\311+\304Rc&D\250$\212\334(D\213pX\213I\374 \245\230a\210sk\025\026\332\236\216\031\336g&\250'\357{\310\365\346M8\035\205\214\233=\217\3222\020XW\031<OI\354'\257\323\245\217A\017l\nKp;#\356^\033=TI\354YNi\013\001=\250R@\230\314EC\001\216\366\343)@\027\227\320\371?/\222\037\023b\220\305u\304\270\362yf\000\376\323-\010\376b\226\314l\030\277\201b\330\2105}QW\3338\347\235!hJ\332\234\362-V\232?\2465\2060\325\212s\231^{-W\242H[\334\272Z(\244\203=\276\024\247}\371\316\312q\215\025\337FI&2{\231(\025<|9((\306p0\304NF\240\320Cm\244\326\004Q73S\230a\271:\313\023\332\302\235d,=5U&@\366\312\t\214\270\252 %\250\240\221H1\375\276\337\267\356\372\n\277\360\227\301\263\004O\354a\321\311(v\221s\371\217L ~\031\374\0104\024\232\344\251B""\007\177\231@\367\310\026Z\373z\217\2670\216\005\377g\311\303\014\014-\250\316\245\211\304\273js\205\024\371\3352J\237\327\023\271\363\361\256\033g}\0075\002\214@\250Y60d\013\235\303\347\337\333\333y-*p\004\237\026\372\366\276\300\247\202h\300\234>\211F\033\353%vkHd!\350\245\020\325'\326\313\026\n\314\0208]u!CD\302\346B@\262b\230N\022SO\211\254\370\246\303\317\237}<\203)[\004Q\231\355\036\237\217\352I\217\373\237\023\374>\326%\366\0167\332QL\254<\322\t\225\257\342^l\263dA\t d\031\304C%^\363\003\r\362\025(\240/\214kr\244\r\3418M\356\251\002\222\222p\220\262\023\242I,5\003S\355g\367{2x\374m1\354\265V\t\314=\335a\232a\317~7\214d\341\204@{\313'\266S^\034\231B\224j\250T8:\032\333Qx\302*h\300\021\003k`\024\004\372\355\370\031\213@\242@Z#\311\311\270rXB\204\244(\345\242L\2202Br\303m\312\177\346\003}M\363\221B\353\222\315\254\230.`2\030!l\003\002\377\213\363\317\230\241\002\237\233\346$\223\372\351\275\205\2342\337?\363\332\3222\267\220\201\2746\270Y-\201\206\022r!L\016\t\276\233\016\020\300\3207\266J\2641\250\335HAg\321\023\025Q\204e\216\235O.\377{\334\341\373\342Rb{-\023\"#X\253\030\226\313\026|5\035\262\246\\\017w\207\227\257\243\373|!\236\022\221\214\336\247Isc#u\036#,:d:\214\326\324\004\303'm\234\327\371BV^\rl\242\"\264q\202\371\332\005\226\301jC\212\002E\222\004\316\303|@\260\320\315xd\361\236\264\016\235\320p4\331\202\315,\267\236Vh0C\201\014\031\003\226Y\005\024\221\014A\316\305\034\231\242`V&B\301\203,\201v\310DVd2e%-!\204\356\270J\nI\376\331\317\376\037\253\357\\+\364\3757\037M\2138\022\373R\203%\206a\262}\351\367\254\\\342\013\213\275\241\301\t\177\342q\2434s\277;\336\377\373*\212\306\"\n;U\024\320U\254Ha\360\343Q\022\311$D\224n Y\026B\247D\210\224\321+\210\377\315~\010\032\312\257\241\351\037iI@\365\303\030gwh\350{\033\244\201\223\331\2203\342\222\023\325\023\201\220\363\344\227\243\r\366\222\312zl$g|\3111\213 >\233\337\t\207\200\241D*1\204X/rNE\007\035\310\260\314\273\363C\221\300\3471\213bP\236t\310\2422\276M\003\302\366\260S\0214r\320\222\231J0\202\367\206""\024\342o\033\032\3214F\030ZE\021\220\237\251\375\037\324\375\303\367\317\325\271 \246@\301\375\\P\244\376\225\314#\347\352\364\226\036\000\035d\021\200\\?\233\002\264\007,\036\322\002\306\231/\324\312\002\035\230%\"EI+\313\032\205O\017k1\237\335\371\302\027\030\345\265\266\236\331m)\276\255\222\241\230\010\235\265\024\025S\010\321\237 \335\323\017p\022>\323\033=\220\317&\355\3311\024\232'\t?\344\316\362M\t\254\204\371\362\203\212\007\203s\020\242\203bq\307J:\033WG\250\234D\336\216';T\364!:\300\225\000\317\203\205\022(&\246\301~\253\314\247LC8\025\363\306\363\267\244\313S\241\324\372\036hq\202)\267\301\342N\304@\254\246%\0022\267\340p\034X\030fh\304\266u\330u\220\236\347\231\211\310@\275\357\276\207\020x[\317#\232\206\252\032\361\007\346\374\255\374\004~\223\364G\351R_\246?T!\356d~\272\177\330\225\177e\344\310\025\260\177\345D\223\200`\020\350+\035\177\233\215\035\273t\243[\336\223\253}\253i\003j\251}\276@\373\177\0072o\276\364\336\032'\221\025D\0242\333a\365\t\230Y\341L1a\211~\231\206u\242\214\3557\273\223\325\275C9\272\232\033\314\305\035~s\256pw*$]\343j\030\326\214\250\274\360\"\305\021c\264O\213D\360\263\251\323\006\263\352\262\305@\326\226\325\016-\261\210\236\246w\327\324\025\220\302\213\004X\020\344\337\032\316\370\357\322\265(\310\006M\350\221\036\235\252\004:\246\241\240\232E\"\204\300\320\"\254\212\025\252|\320\251\352\224\\9\315&\263J\375\000\344\334\035:\201\364\306\374xl\316\251\334\230\036Q\217\214\307\321\315\206\355j\322\241\312\311\np\240Y\017\240\340`Ev@\3713\0254\324\225DHD0\317\301\370?\337\353$?\007\376\177\227\001\370%\\K\027\322\027~3\361_\2139\370\256.\033\264;\211l-!\017\365\035\231\"\204\342j\370\320g%\300\241\007ayv<\010,h\234A\321)w\273]S@\220\227\232t\013-\302\235\232bl\024\376\2307*\203\302\223\004\033feFV\254L\265x\324\024W)*|2q\304\035\354\352B\244\207R\262jax\200\351VQQ\027or\231ls\365\3601\014=\217\216\3346\236R4\3574\343\t\"\207\022\030\321\2444\357C\276s0i\223[\262BK\214\3363=&\3633;\320\320QU\022\232\021H \366\350^\306\366\353""\276\365x!\314\307(O\217]\367\224Ab\201\326Hp2\304FJtN\031\307`\251\261\232\213\013C\202mA\3275\243\t9\304\305\212\357\034\367;\313%\004\213\004\022,\221\021`EI>\r\330H\031\002\207$\0021\340g\263\016\000\345\274R\007\271\262\304Kcl\032\216\022\233\200\216\037\303\370\361\037\214\376\007\333p~?\310I!\017\3040&$\337,\304\205\347\364\315\203\006y\270_$2\034\021Pk\332|\313oi\253\233h\261\254\032\206\377Gm\353^\304\037|\014)<\236K\354<\267\372\237\262l?\262!\323\345\303\326\313 \260QY\021~\237\265\3155\207F\234\264Agm\214\324\260\266\326\324\251\224+\301/\313-y>\023\254\026L\236[;\004\227\265HZ\n\n,D\013\006\006\rm8\340\262]\247\2667\263\324Lq\357,\362\007i\227\330\362h\004g\031;\205\030\242#\252\207K\307s\246\r\346\215\316w\340\315C\0142!\310\311\t\270\302\030f\010$\327N\312\356o4\250\250\212\253\005\r\355u\271\254b$4\3125!D\212[{M\2671\203)P<\211\200t\271\001\343\247G\235\304\005FW\001\315C\222\257\000d85\016\003 [N\301\005\032(\214\360/\277\252\372\234\327z\267\301\016\316\310\227|\231\0038[\331\352\2346\236X\023\300;d2a&\231\326h`%\347\224\027]R&\030\207\333\370\307\362_\371g\342\270\374\325\371@\260\030mJ~f\021\210\010!\310\372\363n\354\360(p\236'\241\t\300@\254\222\"A\"\010\310\210\260\2342_\3318f{Y\2213\020?\rn\201\320\023\022\261\2036\263\212~\027f\373\312\341\376\227\217\024h\n\354\\\005\247\003$\300\245H\343\363k\353f\016\024\262\245n\\\024\312S\341\315w(\325|\267\334\273\353N\244\323\231\025\2745\0256\362d\002\214'\270\327\221\206\362\354\312xsL\037\226Ic\021\203\205\254j\205\2559\276\026M>\006\320\343\037sO\031Y\212Tp\344\303\217\022\337\022@\224\264\343u\013\361\335}\265%\317\360\307\201FM\362T\343\255L\356Y\210\261C\221*\003*\266\324\265%\304\235\303j7\3336\025T`1Rh\207\375;=\214\315L\363\264\212\035\2312\235\014\370\033\327Z*\312k8\353#\005\034\034Y&f\273\232\326`g\327\206\314'\016\024V\236\367GR:\037\362\203\021\375o\327\373y\227\366\000\327\341\331\370s\321^\202M\210]\347\236M\231\262\351w\376\0314Y\223l\377h\343\2167\335\014\177h\242M\320\004H+\031\021""\"2\002\301E\223\207\274\363\356z\247)\375@\362S\016r\202\260\325u\344\361e\260\\\257\353\345%\351\263|\254#-\3251\345\024b\2344\227\nju\353\232\346L\231ig\267\030|\276\314;\324^\2401\021\223P\261`\305\034\226>{~\377&\311\306[A\353L)Bu\270\243%\215\275\312\014X\217\271\373y\337\213\330\374r\371\021\352T4\327G\316\204\016R\000\000\215V\301+'qU\365\005\240\255\215\303n\214\234`\256\350\034\355\271p\2017I\271\213\231\301\210U\226\323\006\024\365\254>\226C<\207\231\347\226}j^\214\234\245\215x\0320\307M\243=\361\007_\224\323\017\223H\036\004\023y\004do\324\030d\325\021\270=fx5{\320\321\214K/\307\246?8\032a\207\330,\277\375\030\356\274\310f\300\243c\t5\013_\242\222\354\205\003V\252H\375\277\236\363\356\376\314/\333\317\271\373\022r\244\003r\325J \"\003\031|\007\273\254\377\253\232\376\336\264M\317\3553A\254\316\033\273,bZI\302B \210\220PY\007\373mAHrsvA\004\024\007<\337#\307\rv\t\246)g`\254v\310\026~n\017\032\222:\032I\005\344`\340\025$a>\355\200VN\224\022\223\371\371N\340_e}\220\217f\220%\n*\374\250\"\302_\037\035\273\024BI\202\210;\036l\273LNtr0#\317\022\036v\204g#x\314\314\025&4iO\373\007lU\017CE\235N%N\035\032(\324\201\224\352\300\254\214\264\034=\303]\372xqX\370s\003)_XK\357a$\025f\320I\310p\2015\212\300\222F3H\275M\261f\373Xsl\352\037\003&}A\271S\335\235u^\017\241\250\033If\317\177wf\214\3331\313\312fh!/\325}p\330\230O\205ge\242\033Gh\363\3337\334<\234\206\317\340\311O\254\303\324\361\223@\303\321|~\035\237\212\373\017\352\337\322\032/\352M~#~&Js\212 \202m\213TGn\205\303\0311\005\237sy;\274\207\031A\342\253\03785v&\010z\034E\214@\027T(U\204\227X\376\234\027\223\202\025\206\010=<|-\272\327\211\307\321\310P>\321\353&`\024Y\347\240=s\217\272P\364X\261\031\3431\205{\2242\212\027fp\303'\375L]\363N\367\214fpC\216\005\211\033\340T\225\230Yc\037\224\304Y\267O7\030.\373\037>\246T\233\261\202d\332\302\241\r\325\325J\201{3\240\303n\215\006\304\252\353\314\353\"\353\336O\004\024\235CXHN\240\0320\023\367\375\267\037\177.\2023\007n\250]\306h\212\341\014\275Ch\201\245U\343\000<""\275\323Xq:\303w\246`\223\262\205D\311\266\305Q-\n\214w\205\014\355ABo3\332rC\223?\202\r\310P\241\3708L\317\254\326\263\334~\017\330\177j\333\373BO\272\330\266!DDaH\201\232L\262\",X\364\357<+k@\252\304H\203\026\020\215\374\006d?sO\3340`}\343\207\242z`Hv d{\310&\353\206\306[\373\203\370\302i\320\254`\3039\313\213\017*\353\246\377\361\034\031\274\234\321\t$P\354\212\366\261\017?\007\363K\356\373t\246\2758\033SF\263P\304\037\252\223\223\342\317\2432\205\244\235\320-\334:\304{t\014WJ\207c;B\307\005t\276\371\306N[\275\245\264>9\251\214*]\006\354/\310yO\023\327\205q\272\224N\355v\252\325\005\0200\3110\203\223\034\335\0339\004\356\350`\305\350p.\370\357Me1\326\240S C)\005\t\221\n\224\017_K\007\313\r\037Bu&\037A\240k\\\"\001\302\000w\260\256M\306\013\006\253\315\032\032\343C\325\356\005\331\206\251\020\031\202\027\273Xv/\241r\214Ye\226\225\301\323\215p\001\200\321\243\330.\317\233\337n\230pJ\236\377\0339\023D\375\354\224\375\217\332\373\277^Y\367w\357\226\266K\224m\203\024TU\264?m\350\351\367\371\366|\246\234,\202\007\337\020\276\334\013\323g\253\347s\332\206\260!*\034\236x\233\244\373\3739\225\367\220^2TS!\276\305\r\020\234\375\357]\367\273\225\346\245\274\352\314\233U:8\271\271\301\223\201!\301\265C\217\352\025L\234'\206\226J\223\321l\353SS\251\rI\242C\035\211\024^^\253\315\001\256\020\325\310\260\3523H\026\222,\000\302\006[84\213\302\233\236\362'\251\251\3707\r\371\244\367\357\0079\003\323\016\006\242DQ\224\240,RAl\355\222\205$\321\332\357}t\333&\204\330N\216\266\376N\t\247\247Sn6\315$\010r\300/d\235\220\271u!\246\005\240l\222\322s\304\0165Hn\271\300\333\007(\327MW\246\205]\001B,\372\351\000$\327\r@\371p0\2024QV\215G\023\030f\247\273\226G\314\276\305/\265\246\022q\231\343\251\3158'\272N\037U\226/J\010\376\317>\357\355f\\\027\356#o\340\245\005S?l\240\237wrApX\211k\232v\036Q\260\201\373\254\375\333f\262\244\342\005:\037\215\276\241\320\356@!O\\t*{Q\327\330\2509\243f#\212X\345\302\301$\037\010P\277m\003\215V\220\273T\315\022\t\350\213\377\\F\210>\353b\237\0245\207\273\320""\307\035\306l\351/U\027~\224\0343\201\347S\022\312\030\263\035j@\244\300\255\225G\343\247 \007\365i\223\002\315P\240C\204;\357\271= \355\356\226O\237>.I\234eT\335\254\230\237=t/\036\301\347\256\271\342\357\244(v\262S6\304V\220q@\001\302\n9a\222\324eo=\272\274\266\262\232\231!\"\360\370d\253\030\314\263\257R\035x\212\214\0316\311P@\355\320p\020\260E[\212\250\221\200\320\322\370\335\007\351\352u\010\207\264\200\341\343!F\350Q,\212\0268\262\006\r\366\267\004\026\000\036\t\315\2079\220\256}8\007\222a\323w\230\3316m\350\206\233N\024\276\347\322\314\010\376\327\334\367g\341\210\225\277ps\357\005\373\337t\3354O\037\352\372X\325)\251\236\215\335W\\\022}\375%E\034:\017\266\223F\276\227^\354\003\277u\214\002\322 b\277\010*\337!`5@V\032\252\021\000\254\241\224\001L\n}\003$\261\302\201\023\214\220\370>\270\207X\271\227\324r\207\366\261,)a\250d\004\021I/P\031\007i`\004\n\314\246\232\224\366\262\272\247\323>\240\340s\214\212 lB\242\230g\241\274\221\317H\225\235^e\223\006\002Dl!\203\203\2163\217\3751\243\271\222[\312\240\241MFU\r\013O;u9(\246t+\202\346\313,\202\204*\000|\210\030\205\303\345\367\266C\234)=\330\034\310X\261\202\030\201F\025\205\031\221x\372\310z\236w%E2\331\204Y \010\207\226\024g}g6\013<\264\266\213\342:J\254\226\206\363p\224u%\341\232:\357\274\016\035\345\353\244\222\342\244\372\335\335>\205\236\214\263\242[I\250O\374\203\360\375\317\247\327\362\222\301?:\002}_=W\325U\234\331\254\030(\213 \3325A\375X\014\034\273\223\321\337-\230v_oKhx\310\260\223\030B\365\317\300yCo\204<\237_\020]\307\000\354\006\030\273G\255\014\013\001\020\232\302\334\034\203\335\262\267\241\203D\252\314U_\274k\321\"j\250\221D\326\215T\033N]\277\222\260AA\020\321\312J8H\262U\264\033\0075\336\t\221\235]<\224\022\215\250\353}\354\251\3176\006\"EN\314\030\322\315\276\373\244\016\352\036\311\363\361\201\220\370\243\314\225$\"\2048F\030\331\350\362\201\307P\350\310J\017\214\222\243\234\236\246\372\362\224o\205\361\017\022\263Ncl\013\201\211\351R\252Maz\243\021+\r,\314\346]\340#C\200\235\361\310\226""\035\322Kk'+\256\306t\0278\001\342\376\000k\r}\036\261\363\017\234\321 \264Q\373\250\373n\325\231R\326\263xXf\343J\322\325\321\267\356\030p\373\333\237\203\030\267|\372\335\215\372}\337Wp\222h\221\020\340\204U\000\020\363\340s\261\234\314\013\260X\342\273\006;\027I\330\351\221\214\271\331\272\361\006\276_-!\304\031\300\352\273\257o\357d$\0008y\330\025~\220\016\230>\212\\d\332\223f:Pu\305\033\244\352\316\246\252\007\007%u\252\207V`zQ\234\2323\r!\375\310tC\033\223\013\035\265\267]&C\247R\201\030R\254\245\242\366\234=\375\217l\247\2578\006\355\211\256Ui\350B\366\353 J`m\214)\236\331\337\001t\335\251\335\246i\205\0149.\013T\005u(voE\2000\322\210\007\336\272d%\215\216\266\252\312\330,)\305\245gE]7I\242\264\275\300\335\323)\205\203\311\266\307w\246\264nk>\r\252Q\"0j\273\tm\rfrm9.\275\177[\313\256V\006\t\365\341h\362^!\300\032\317\"\313\372\177\307\237\213\345\240\302\372/\345\n\017\242Y\311\363\300\315m\200\254D?\002\010G\355\206\305\3324\001=\220\017;\334\366\322\2728\202\351Y\024\0034\000\010\316}s\240Y\026\330\014\222\001\253\r\034A%\275\356CY\033>\332\345\262\007\273\310\357\373\222\260\254G(\245\214S{\242ZM\tc!\323T\023j\357\2667\210\032=X\351\3450\250\rc\322]\356\252\035\312\365\370\003\314\365^U\232\355\004\000\242R\300\0300\266\326\374l\372\307{\201\364\317XJ\317j?K\014\031\315\231\252`JH\03404\220\323\r\272\320m\3436\3414\200\345\220\251\026\342P\213\021\366K\004Fy\365\254\303\266\013\026\022\240,\202\310s.\005\265=O{\301\302\374\341\361\345\231CcE\007,!,qS7|\225Cr\232\201\214l\3678y\337s]8\036\2077\272s\333-B\345\344\254\211\305f\307\210R\324\207\372]|\377\206\251\212G\3435\364\327\310\276r\007\316Q\302\315\230\240$0A?H\321(\315~\360'\356\265\275)\240\311\313}\036\320\276\333>\n\212HUI\024\034\333\036\312;\303\321\247p\251N\341C\322~\357/\235\353\351\027S\307\277\007f\007\312S\250\322\312\237\330LW-=\267\377|\305\301\271\300\321\206\003\330\250f7(\002\273Q\014\235\250\301\2528\356\275\254A(;!K\177\310\313f\301\337\243\307\216\371\333%I\336\273\343&a\250R\227""\237\026N\216\351`I\254;\262p\306\013\266\210\202oXd.v:\034\016)\"\361\3136\226\034o1\233\307d\306\331<\3639\234\3372\216\033X\245\023\006t\334p-\224\351u\300\213\265\347\310\340\360B\345\363\202\311\256\310\003\240'w)\031R\026M6/\336?c\360\231\3702S\3577>\375\314>\304S\022\342\365\241\251Je\233\230\000,1l;6\304\300e}\177;\321\2124}\244UR\257\252\265\021\365Q@\245\266\001\005\002-\276\226{jx)\335\307\345 Qe\236\307\232\206&'\364~&\006k'\243h|3^\255\227ie_z\016w\002\034y\2558\207\3175y\245\237K\n\037\t({\366\317\203\235\354\377o\251Oz\224\013\334am\254j\271\235\314\362\356PuQ\205\246uP\344\330\2540\026@\266\222\024\310w9\n?\221*\341\230w\242wIhe\231gF\030\305\026\362\312\260\251\034Q\033\252g\"\213JWG\337L\256\363h\361\024o\r\311\243s\016m\005H('U\004(\206\036\001\337\257+x\226ev\372\213\317`o\240\316U\372\275A\300\227G\346\374\077\077\316\317\3105T\003\350\274.\021\364a\317\240^j:0\207\217\223\203wI\246v\355\252\264.\210\310\352\252\315\r!\332\202\202\340\0202\302@\264\232\373\342\301\n}@\212\023\254M\365\325\215 \366\243.u\246'\356\007\254>\376\322q\236\345\n~\r\241\177\335\277(\233s\211\2279\342\260\206\272\352\311:!::x\314\n\020P%o.\340a\t\377\014\305B]c\243\336^R\312\251\302\007K\225\336\314\343\306N\321IM\245\242!\265\030\311\260>*\035\216a\202\236*\2469\361\202\2579,\262\243\006]orB\331\312e\016R\2420\325\262\242\363\212\254\"\032\014\202I\270\025P>;\260&v\235L\266ai\237]/\257\254\331\357\347S\315cZ\342\"|\340\027\001Kt\312\\\3613<\325\366\304\231^\301\352\036\256\364t\214k\302[\347\302\365\221\330\3623\323.\235\307H\324a}\037?\317\361\374\310\022h\221>\237\227\350\371\306b\t\227e0\320/\332\364\276\263%2o\037\307\346\230J{\t\353\357\273\355\275\035\3704\332E\223\031%D\324*\2728S\010!\020`i\003\353\030\271\3279n\307\r\336D\201&\226\036\233\321\\\264\315\020?{^\035\363h:\004\331\315T*\006G\301\370' p\330}%\240\213\363~\023\034;e<\370\303\001M\216\311N\034\017z+\025\246\3677\202<\203\016o\275\303\252\006\034\210\006\342\035\331\220?\271\232\232L\0147\272(\226""\321D\022\320\341\022\313\016\350_Y\335\325\352\000\254\016\266\214\nid(8\r!+Lne\215`\322\372Cf\262\242\233}z\241\305\226\360\323\317\253<s\223\227\017\t\365t8F\375h\222F`\347:R\351\335W\217W\207\344\216\253\203\276\310#\305\023~\007\215\037\207\342\374?C\372>\222\027\314\2052>\205_F<\366\320\374dX\004\336\201\215Q\004\2562\337\273\254^\355\310P$\2161\310jV@\022\344\016\274\203\365\207\311@\r4/\0171\253\264Y\250\017\037'\236MB\022\n\261\323v|4\003!-\343\235\243\307\244B<\n^8+\363(\3345F\347^\227&G\3770\335\253nk{\247\243\014\260\345\224\362\365{;\034==\222z\223\261\342\305a\016\350\023\245\327:A\010\302\373))I\026\260\224^6\343m\236\226T\007\265\001\314\232\216'8\016\346\252\032O\033Px\006F!40\350\226<\270P\345\225\035\324C\017\030\001`\256&h\201\354\364`pD0\034\234\247|\211\372\201\356\242$B!\n\020c\261\022e\003\n\t9=I\210\312\210z\207\251\326\350\031~\220y\334\330{\353\200\351\3661x\204\267\242m\324\231\245\037#X\366V\373\007\243\257\244}?2 !\362\204\003\371\2123\353\252\t\206\333\003\350\216\021\037\271{\344\005\n\366\320P \266\227y\336G\217\242\356ph\002\310\252.\033\005\002>\267c\177\310>\315\332\204x'WK3\305\345\221\214#v\204.\253\201\370\357&C\200\330\325\3140\375\376v\263\000\231J\026E\204\3335.3j\240Aa;'\014\233\214\246\030\263a\3350\024\365\226:v\355X\0266\316\266\215\026\020\244\r\023\235\312)\351GL~\016\372\202\365\332O\016\337\031\rd;\024\021\206\240\263\350\351\355\303\210\277\034\0148\320\303l\317^\2766\210l\345\0266\276\356D\302z/\230`S7\327\2324\372\223\353\004\035\216\366 |\360\327C\241>\217\305\363\237\235*\0372S\347\246\325\020\315\305\365\375r\301m\301v\031\313T,}.\223\277xk\333\374M\300,:\001\021K\306t\352\3129\006\002:\273\357T\271:\210s\r\277\036\027\203\316\322\275r\360\375.Xt\253F\036\276s\003\266\0350\370kd\230\343{\264&\030\273b\252\341&\036I\252\023\245M\270\373\366I\374\222/C]\032\301\022\035\257\000\003\335\213\323\357\362\203c\307\210\310\212\227\224\002:Lf\247\026\361\302`\276F\036\004\307f\246\254\263s\024\303L\231@;\342\027\244""\202}mP\322\016\217\021\030\211\032\361\361\253)\361\311h\020\335x\250=PvX\324\261\025\271\034 Z\010`<\026\201h\227\343\311\2757\350<\363\337\325l\365A-\225\270\227\217Xv\010c\265\327\341\371\276S\362}\322\032\200/\250\202\276w\3651\365S\347\024\223\353s \346\270*\310\267H\203\261BG>\241\330\256\032\030\260a/\033\351U\310O'wn\375\332-\360Y>\020@\322\255\036\343Vi\340\356A^\r\022\035\037\257\231(\"\266\236\254\020\026\177\003\r\356\017nf\016\307\\\332\304\336^\234t\263Hi$b2\352\010\311IB)\202\316\333t\230\022&\357#g^t^\236\271q\236\356\t\210OI\345\320\021\357*yh\372\247\205\247Gu/\226\2324\t\302\2269A\365b\310v\030vX\216\016,YG\003\344^\257\036&\232\353\220WL\024;\264\030\301\357\374s\230\007\342\003\347\371\017\321\365\272\242'\327\367\206\013h\375\017\333\002\0036\317\325\2501\366?}\201\312\346\023\331hp?\036\361\203:\201\370\274\202\374\360\345\2567|\021\357\276x\207\321\361\225\244\342\253\016\004\316\330\273x\376\213\\j\356I\3074R\241\207~\312w\234\321\211ZF\371u\340\237\261Pe$i\203\352h>\247\006\372\327X\205\020\220\000\366<\027}]\254L\320vCl\320hF\013\303.\010\251\255\257d\t\326\233C\324/\241\214Az\262\305\022\002\202J\206\032\340\236,R\252\313\257N\255H.!\007\237\0312\252\317\343@>\275:\363,\236_\216\2459\362W\325\374u\3575\355 }\006\211\277\252?o\330\211\027\027\277_\361:\334\201!\267J*\3132\254\275l\246\201`|\017\007\007\214\306\337y\324\277\263\313\322q\0021\262\374\237\306 \360}(w~-\363\021\0308\004\356\302\361\343j\2734\001\037\326Bp(\205\255\037_Jg\033\207\375?L\237\327\302\352--\262s\250|!\362y(\035~ dv\306\001\227b\021\201{.\006\201C\266/n\235\263s\033\3013[\256R\373N\334\321c\234\035G\n\343=p\341\352^\203t\036\224\033\007\005\372\326\231\327=C\331\304\r\210Gc\000\227\212\365z|\277o\315\356\372\225}?\000\252\225|\004_|\203PX\274\342\005-h\333:9\360\274#\252\255\301\250\034:^\024r\253\217O0\221\323\212}o+\365Q\312\355\342v\346_1\303\001=\306+\340iN\005 \375\314\316\354s\005W\220A\301\351\340:\350\327\241\357\307\225\323\273<+\321\221\360\373FK\253\242Z""\010p\036\272\006\302\236P\363.\037\026\004\253\007X\003\027\255i\313\010\221d\\\203\300\023P\003\274|\305\303\352|tG~Vq\0175\3279\000 \037.\203\021\000[\021\303O\302b:\360\307\257`\373F\tq\364\374\021\324\272\365%\343>_\227\350\007\333I\3751\007\360\367~\227\272\377\0079\273l\241\264\330d\326\010\301\027-{\272\254\263\2643\034\253\367\236\234\265\327F{\337G\306n\312\025\331\2560;\247U\342'\375\005\010\2609\341\200+\240E\005t9\311]!c\304\0262\247\333H\235</\321\017C0\341N\211#\n\036\256\016\207\235C\320O)2h\007\366\256\t\366\372\300\023\244\204C\200\256\037\027\323\365\021\225\226\001\363\327\257\3233w\002\241\351\351.m\217Xn\013\340+\327{\330\007\344\366\237\234\376y\037\017pM\375\262f\002\031E?\262\356\346{\376\272q\321[\020\370\016\277)s\276\304\345\216\245\236_Ul\237\263\2771YD?\0079\366\354\035\353\254\324\246zI\350\201\373v\244\000iF\221\003\207\001\246k\214\tv\017\201\336\213\301x\276\3229\304c\005\226\202\004\304\204#\236\276\206\220;\213\242\034\364`M!\207\r\023\321\337\t\n\315\020\026\304\244\340c\301\32788\016Ny\341\343z\344\343[\355\301g\214_'\031\233Xj\365\000\351\203\352\\D/\341\367{\253\363\302\367\375?\300/\355\006\375\333\366\330\333fO\265i\373b\322\034t\377\262z\016\016 \276\323ZJE\210\317\006g\027\343\353-.\0064\253\276\217\211\356_\354\033\210&\233\346Wo\302\233u\364\330O\251\2258\301Qt4w\262\204i\221\340\312\205\010t\003\337lb\035\276\235i\303!\253\356\236UC\341a\004ez\026\027!#\257WkQ\322\t\036b\333\263\236@G8\206\211\317>\253\353\020?/\323\376r\373\002@\375\023\352\373g\325>\315n\306l\332N\376\030\364__\334\3429\316e\355\363~\007\250\272G\262\376\336>tCI\032#\243\322;\r\335\0000\021]\3745I]\253\361\360\240u\013BxV\034h\323\225\351\320N(\0350\276\213\322\252\346\343\323cB\273\030\330G\030\266RC\023\007]\217\002\014\032F\212\263\341\240\020\361nh\225\352\365A2\227\2220\237\267\323\353\373~j\367{P_HW\372\001}\177\3334\313[\254\344\373'\274\236\013\033+/\227\313\3268\237].\201\304c\014\2245\236\257\234\301\253\274\356\364\242X\353\2452*$ F\232""\026i\360N\225\336X\026\017\303\272l\021b\350\345\243\274\276\217\215CO\211\300k\235ee\030\217\301|2\233\362\355\004+\355,\370\260\217\rv\017^:\361\2420\212\260\030/\225\304\356\343\371\253\333\362\217\234\375?\237\365\301\000\372`\275\202\202\030\262\017\251\303\317\366k\333\235\356\017\261\306<Y\357\273n\376\313\236X\353\230@\017\022#K\034\027%P\266\273 \232\013\230\330\361I\002\032$w1/\203\223\300\026\022\3016\207\2370\270\232\023\237\014\204\014\274\254'F\n\331\017O\360\214\340\256e\024\326\002\305N\323\033(\202\271d\2102\\\353\0226%\363\344\367\321\037O\324\201\367\375?\3535=\304\243W\356\023\354h{\272\307\177\250\230\301~\035|>\304=+~\007\325\254s+\253\305\341\217U\372\207S\263J\370\3502z\036\214\020B\326\0310\212\035\003\207\300\350q\372x]q\005\317E\\^\215\203\033\272\256\274\003~\206upu;\321{\335\334%#uI\227\360\365\364<m\371\257T\034y\353\234\347\220\376O\177\324~\277\242\276\204\277I2K\030=\357X\366\277p\323\227{\033\315\352\376\314D\032\006\215\000H\370\00245G\373cX`\264P\347\024\340\272\360|\264\312E\020\274\014\035\232\363\342\016\274X9\254t\014\016\336-y\000\313\020Oxu_\0177`\217\207\242\261\307\006\340\364\037'\315\356?W\325\027\325\364\257\352=\303\3600j\273\322?S\237\016\307\273\244~\036B\310\227l\001\251Y\006\327\331u\350\006\237\261;\014\215\032\017\251\353\307~\20253\341\323\344$]\216\016\257\241\370\276S\365\037\237\350\367\375\263\371\037_\264fgA\214\3738>\264\264\357c\354\277.\307}.\274\345=\341\352\217\332,a\002\003\336\216>\357<\202\221\202\316y\357D\t\276N\263\033\002s\320\340i\016\310\266)\254?\001\006\226\327=O\370\177\376\366\375>\357\201\372\276\325~\357q~\376!\360\377.\273\321\303\202o!n\372\370\003\203B\007\244:\201\000\t\242\017\360s?\315\303@\214yD\325\220\2378\033\033\177\312c\302\331\227:\374k\275\035\034\373=\377eW\363\207\301U}\277\3002e\237w\331\256!\360\270\017\331C\035\374>\333\014\201\330\2420i\343\034\316\217\236~2\370L\245]r\310\256\"xB\317\036\200\314\363\203=9\007\362\275J\372\305{\343\351\367\177\007\321\373\265\366""\317y\367\032\373\n\373\037'?X\346\363\203\337@p\034\212\253\355.\004!\272\361\022\356\224\031:\245@\310\200uHA\366\222;\363\351\343\306\365\263\344\371?d\037\245|\276\341uf\376\204\017\322\333Y=\244Y\036\330\206\237v*\035\213\255\351\200\254a\001\373\347;\361}\255\030OF\354}e?\202\2770y\003/8\272\346\277\260\327\244\337?/\315\372\365\370\220\371\375\321O\230\375\200\277\247_\264\034\315\n\001\3574-\036\005\320\034\327\357\315\03647^;D{\376\267q\371\3602\207\002\367\217\177\315\356\037)\037\265\355\372\177o\337\355\274\2244\212K=\266\346e}]\337\215\253\361\334}\367\370\177\305\363\376\332_\211\217\243\345\301\365?\251\216\036} \006\307\323\364v9\332;\243\307\001\261\306<_\313\376\003\376?\304_\342\375o\235\330\3747\373\034\374/\257\222\276SC\346\355R\363P\261\321\032\t\034j\363/\374\273\235x%e\003\317\236\377\207\373\303\373\377\343\371\n\374/\344\374?\312\237\213\207\346\\\271\\?!\354\033\311\373\240\221\304\207H!\203\001\035x\262v\315@\236?\331\017\375\237\273\372\377\207\360\375\362\360\177KS\367\210\376\020\217\342\211O\370\242\262\364\244\235[I\313\372\3420O\201y\016\353\375#\372?_\365\007\357L\377\277\323#\367\312Jr\036\177\275\274\345a\317\364$\037\275\024_\300q\350\320\212\177W\361{\021B\333km\263\206\262Q\350\375\300\233\364\213\365\037\267\363\370\376\267\333z\201\277\331\263\322.\370/\3533\233\353\237\323\255\316\245\357\277\354\363\365\372{\347\353\362\376\377\346\375\336\377\356\375\377\255~\366'Wb\237\265\236\332\2458'\373\313\336\217JEJ\317\367\337W\303\366\177?\370~\357\350\375\262\377/\001\037\265\037\275\341\376\010%+$\020\244\177\211\373\360,\225\224W\275\237\344?\365\177\217\354\361\376\307?bK\3677\365~\367)9\277\364\251\037\345\374?\256\225w\227\365\304\313\354\375?\320/\340\277\242?\253\374Q\343h\223\377\005\374dX\2247\361o\351\210\217\323\263\274\356\207\374\217\347\227\266.B\245:\262\204\207\243E(\363\214\250\360\263\270\336v\203gnfY\307\307Z\316<eg\231v\366\314\217t\024\240h;\201\"\242P\253\004\010\267o^a\322\346\t\206\3651q\331?\253\307g""\036a\246,\333\246\302\000\332$\233\267\224\276\010s\n\235\273\257\014\220\364\316\260\236w\227\234\274R\205\333\310\316\230\t[\201DD:\232\226\245\336\006\315\253z\256\001\032.\226G\025\202\354\005Ib\272\270-\352y\272\341\3056\002\321\222\304\026\2549e\022\346\240\255CJ+8\354]\253\3025 ^Z\270,4Z\326\310\267v#x\335\241j\3354F\\\226\234\263sJ\302\205\346\307v\313\265\247I\273\227\230.\365\343W\361[\230\231K\223\226\020q\206\0141\ru1\014\3418\346\334\201\241\030F\203I0?_tfY\323\362\344\035\031z\200H\244\177\302\270\354h}\241\004\256c?\277{G\232.\031\316\271\204\006\202F\030\243\200\321(tP)P\306\236!\221\035A\355\335\214\32042\216\014T\216\221\r\"\215\246\222\031)\260\021\264\216\013[n3\t\333\216\231\254`\230Hy#d\203\212E\252\344\216\265f\307\372|\271\032\034\304Le\010\030\343B6\315\221b\302\230\346r\267%j\213Hh)\375\342\200\324\026\346m\213 \034V\350\024\0061E\246\377\264z\017\216\350\034\330yu\025\243\215M+?\303\233.\266\007\007/\311\256O\333\301(3\250\240\273\210\365\005\265\321-K\013\003\346#v\031\314H\266\234\217&\225b;\314\260\242\241aEV\nc\372W\306.\231\256l\343\231\022.\033W\375\323\177t\360pcv\335v\203\021\317q\270\256\360\022\031\226\\-t\247v \2657\254\222\322[\033\346\214\211\261\021\206'&\025re\335X2\361\203o,\3353V\017\001\030r^Btb\277\270\203,ZZP\313v`\373\312\313\n\303A\212=\"\203\336\270\346c\022\316\006\306<\005-\n\357e\230\026\3050n \260\033q\224\235\362\337E\021\245t3\2536\017X\363\341\254\332\030Vc\354\341pF\021\006\370\300\330\266\335;:\"\333]\020#\201\236\006\3064/I\303\017>\352\334\023\207\026\361'\223\007\375\273\234\010g\357\343\204\350Y\327Wjr\240\2305\311\271\205\303\207\3671ffl\266x0#z\315\302\364\3323`\260Dw&\264\032\374\363yy\325\"\313\036\226\016\351\367=\326Q\350\245g\3147\304\204\205\352?\317\276T\377jf\265\215\266\320Tkk\032\326\317\364\365_\327V\253Z\010\251 *\016MC\360\223\346s(|1\002\020\022@\002@\t\024d\020u|~\337\364\223\240x\266\321\355\261$RE\316\007\363\020$\031j\004\374\177\3217\276\2714\252\376\310,\217\340\201Pt\237\256\023""\340\327\211=g\3141\237\031\311D\204\326\271\223\313\037\370\004Mo\372\373\001p\224\177F\032C\204\206\306\203\371\2305?\274O\220H\264|P\375\322\340,q\303`\213\236\001\265\016\336\301t\031 htB\021s\257\362G\363\032\320O\300k\021\376\211\371\377Ma\207~\030!\010\030N\237\307\037\260\016\025\373a\362\377T\334\233PlmA\234\377G\300\376\220\371\177\351\\\261>[t7\306\212\206~\374\220\337!\227\372\366k\365G\315'\265\361\376_\210\202>\371\3622G\307\372W\363\247\377\207\321\245\274\347\352?\330{W\027\247\373:h\263\374\317\177\372\216n*z\177\263\177c\253\374Q\376\247\330\275\307\367{\313\275\267\375h._?\276v\377\327\312\376h6\032\374\353o\233\374N\327\346\377o6\374v\354\376\302?\337\377?nK+\356\376\037\356\374\214r\352\374\237\345\377\267{\365\373*\177\007\177\335dV\346T\223\035Y\333aZ\245is\375\236\036\277\3569\211\037b\231\360N\022>\177\265\377\252\203\377\n\304A#\321\363\377\217\370\377\\\203\257\020\227\353hu\355\370~\036\365\304\206\347l\376.\345\217\337.}\231Af\037\277\350<\233?\014.\205\326\362_sw\323W\332\277E\250\376~\373\365l-|\224\324=\230|\226\257\213`\375\263\366A\264\003\363\352\277\337\361W\355\217\354\237\226\025Ut\366\355k\177A\357\021\3611<\020\357\317j\325\245\371\340\372\320\221=X~\357\005h\004\354C\273\224\037v\036\364\302\274\204|\342t\241\365\243\372\301\375`\037pO:>%?\260OT\036\322\365\304?zr/\300o\216\310\354.\273\363\177\345\370C\373\217'\374\337\\\356\363\037\327\320\376\177[%\037T\216\377\353\177\r\327\312\t\002\370\3771V\251\331\370LF\240\277q\254\306+\376\031@sFe\216\346\206\205\321\tk\254-\356\335\343\363\241\325y!\340L\006-oH\266L\223nA\363\257\227\203r\201.\245\306\036L\370\355n\r\203\006\377S\362\240\203{4\272\235@8\300\376\215\207}\353\021\265\200\253\345\213\017\233\277\264\356\035\025\373\346\251\016\266\332\020>\325\347\267\246\236\002.'\030Y\331\323\207\007\316\0367\245\357p\026\010\202\n !\227\303c\3447\303\223iS\236M\304\353\022MOF$\023\3138k&\203\233a\322\254\202c\246X\212\014+F\201A\332\002\352\020\352\232\301\220\027>\322\036\363\230""\335\320\201\021Cx\264c\26149*\0017\242\006\270u\360\005\003{('\300dC\001\245YI\322\323[\r\303\271A\325\323r%\202\256\0326\364h\335\255\3052\250\224P\260l\210\n\010AV\277r\013\255\010\r\010p\262\363h9\215>R\200$\001\253\334\303(\336f\004#\010L[\373\031\257\365o^\216\267\251D\205\202\303\260\370\036n\270\210\320ke\215\013\002KS\033\204#\2707B\253\315\227\217h-\032^\240q+4\323\335x\350\260t\351ynB\234\315\"\255\356+\032\001\2103e\020-\206u\031E\005q\335<\335\031d\337\356\360x\276\276,\376\207~\234\354\237+\317\361\370\234\337\017\302\346[p\001\252\325KG&\315\303[\226c\313\374\204\205\230\317&Y[\230e\337\016a\026liDb\274?\033\310\255\013t8\255\355\362\363,l\312'\010D\230@y\206\377@\330\347Z\252\014Cx\341\247d\262\310#z\305\223\023zA\n6n\326\352\223ld\212\235$B\241\203\005\341)L(\0217\022\263\241\330Ss\036'\233\206\314\020m\343bD\toN\214Y1\334$f\2756\r2\010$\215\335\3301hUp\263y\002AH\345\305h+\014=\274\023\024\020l\313lQ\014h\207E\272X\017\354\356YD\304nj\320T\230qY\340\024\226\255+X\212\255\335\334\264\002A\326\332\263\001V\335\227\241\335\234\300\202HX\263\271\200\241\201L\333\206\306\001fR\262\322\2116\351\204nA\204\335\346\3551r\303\tMj\364%\271\001\251\035\310\226!\263\014\201B\030l\340H6\026\031\210`\334\314\3044\326\300\\\332\325\232\214\334\232D\311\224\306\001x\002\027\034`\265\250f\207c&\322\262\246\tL\332\261\266\246\3347i\356\253\306P;1,,Q\322\3229\257p\273\322\340\204c\255T\262\366\014\311\naj\222\035cl`ze\005\223\026\206\211\313F8\340b\257\010\307Gq\226:\316Z\262\357$\264l9\";\304\311:\265\005\221j\260\356\342\313\320.hzI\031\035\2156\344\302\0362\353\002\233\006\305\221a\266\364=F\341\023U\260\323\253\231q\233\205]^\211\214\2138\242\315d\332X\326Z\327\232\tC\010H\243\r[j\001wd\235\327\201\240\324\022\332\264\350\266\212\300B\310\221\330\026nh\324\356\344MB\254;95\252\313\277\255fjVf\215\022\01381\003\211)v\255\n\014\240#\016`\234,\343\214aE\244\214Wy\273\231\232\264e\332\326\305\265v\305\336XB\013\273\275\326/\"p\356\353\301x\344\030nM:\362\367\034\204nc""\022'\266t\343\227\221<\267\004Y0bR`:\036\021\211\004l\261h\033\333Z\262d\207v\361\005x\316\342B\324W\240\215[\373/tY@\221z\201\214\233\262\312\264\305\331\226\035\226\231\262\304\333O\207/\356^\014\034\321\273\315cE\202en\035\304\243\027.\367-K\300e\235\232\331W\242\313Z\225\213\303{//]\313\313\266\214c\016\207&Z@\270\"\260e\351\324\3644\361\261\231-\0340D1\343(!\231(\206\006\345-\315&!k\027\362]O\3166\301\342D4\221\t\2068\203|\265\321\006&_\335!\036\304\342o\227\247\204\332?\201N\002w\233e\360\343\341\253\264/Y\323\270\304q\332\227{\036Z\0135\352\021\352\333a\025\034\225\210\3158\324M\220\211)ia\254x7m\023k\030\204!\207\014\222\326\231\003,\033\334\205X$Z{\214\346\002#\334\263r\306\307\237\254\177c\231\212a\352\312\t\246\217A\220N|Ea:P\264\207l\331\344\306\360\331V\323x\177Uu\312\233\0322$\307\031\2274\335\256b\277>\3044\356\350\223\206r\332M\254\023\245\203j\343xf-.^e\250\356\316\302\223JF\310\322&E\240\336\310\024[4\202K\232V\025&\007\371\274\2663t=\n\357\230@\255\235\355\013\006\021|\370\347Y\234\035B\030\260\267\022\341d\204\"3\0226\223L=\333\320v\3671+\306f\346\354\274\320\336d\010\351F\302\331\220^\335\362q\203j\263d\273RZ\341\234\335PY\366\037\217\213q,e\235\267\320o'GM\350\3217o.]l\305v\n'\036k\2327\004y\212\302\221X\271\227ww\207X\315,\031\206\021\335qf\2729\245\r \214\311V\326NX\374\032\336\264y\266\324\021\236r\262\345\235P\032v\333\022\363y\332s\273\275\035\343\233\341\314\363\223\202y\251(\326\252\250\204w.\311\300\355\3003w@D\226\246\312\215\232d\034\331\272c\026\235\340z\020\310\265\273\031\233\267\354Y<\240\364}\344\316\374{<o\204\261\t\343N\372h\241\324\252\022\262g\365}s\256\372\2517g2e\225\032\2763\303\253\316\231\310\230l{\325\247t\026T/\275\225\266\213n\234\020\334i<\240\026Z\260\035\260\006\304\202\010@\260\021,\035V\001\315\311\324/t\316\016\341D\336\360\030\3219x\322\320\357x@,\032\242-\245 \233\220\351\302\016\242\3027\036\314\221*\255\260\021r\365\"\246\003\020\330N\326\301\005\350\207J\022\3057\003Kr\014\033!\006\364\330\260m\326e\240C""\000\214\252\334i\3324\031D\024M\333\243wF\331\261\201*\255\203\002\025\016 \360\332H\255\306\344\271\215\272\214\261\r\005\005\214\0253E#H\354*\264*\263pd\315\001a\326\326c\n\246:\262\301\001bI\227\251\240\204u\204`a\023\245$\334\020\r\005\273q\000\363\006\350$*\261\265\033\037\333\202h\003E\212&\206%T\t\232\256\013\014[\\\213\006\301\031\341\303\036\r\214\343\313)CN`y\217\230y\036\023\001N\026\025:\315\031\215\262\022\241\211n\204U\345\034,#vD\001\252+l\341\214\301OX\010E\002\201\013\273\013s\004\233\244\027\032H+\220B!z\006\345\321\2747\260n\002,B\203\321sr\024D4\030\037\242\203\202\257\217ye\254\342\222\356Y\223\024\333\2749\202\021\201\252\202\302\333\010aonY\032oV&\005\3204\321\026\220\323F\316]:\332U9wv\0302a1(\224\r\254\356\331\r\356M\235\306\371\341\245\340\333lK\3035\0064i<7\006v\301\n\222B\025n\0334\034#A\273 \020\266\263i\341c\016\221`\335\273\335\006<\032I\000A\202\352\301\202\304\027\220\271\201\303\225\2717pY\312\260\366\235\035\r\0040Er\rh\213\2661\326\006\014\301b!z\302 n\202\030e\004\014:\257(\302F\301\252\233\010\034\313\030\233 $v\362\3103]\320i\240j\254\326\344Kh\234\300\224xo\001\267\260mR't\220\314h\020\030\307\271t\014\222\006\r\\\010  #\030Yw\267\233t\342\013C\322DxiYRu\2512Jt\211)\212M\035p\376\216\217\370\314\n~*\343#\014\023\207\313\007\242\005\320\364+Y$\227\260#\324\\<\032\024\030\311x\r\214\265+N\3006p\363<\315\361\020\301\026\240\013(\2540\344\363@+\005\335\232(\002\006\335`\010M\301{\205 \214\313\321\007\263H\357\014\357\207\206L\311\201\353\"\031\311-\247\001\331\245\214O\303\347\023z\342X\017!\265\313C\024\010\"rm\350\301f$ 5f\301D\305u\02194\212\272\027\247.%`H&\00600\252\315\031\324\247\t\260G3\227|\226\023\333\300\264\"76\323\016\360`b\324)\221\243Ms\233&e\324\347\034\220]\345c\030XQ^aYP=\304\342xO\030\300\355\325\306\302\222>O\320\272Y}\016X\336\260l\326\3770[\304B\235\210\030\220t\310:\016\010 \340\320S\177\234\013z9\250r\352\020\021<#\261\374\304\306q\364\022\345\304GD\000\300tn\031\243q[\234y\267\021\265\330\230{v\340!\231""\003F3\200\320lX\020;y&\214\247\2049HViy\325&2\261`\243\014\330]\006ff!\252*\020D\202]M|\216\r\236\020L\361\265\013\336(\263\356\030&\355d\373\237\025\023\354\255\025u\224=+{\252\361\340\340\315D\r_.\211\0231\262\313\222aYy2\t\002$c\375\340\266\376\212\311\244\204\034\354w\341x~9`@\000T@\366y\306\001\323\217\344\226\021\357\020\346\252\037\013!L\234\344\3664'\221\377\020u\307\2143\2708\205\205\006\307\035\231\006\312\330\353T5\033O\345R\376&\315\237\357\375\337E\223\304\323\225\303\340n\232\324\234\316\3326\2024\271=\265Z\340\271o\032\210{\367\345Ym\2330\326@\326\"\021\206.:\035\2213d\362-\307\003=;\364\033\354\032!\302\267\233i\010y\353\322\303#\002cn#\231\214\006t\021\243L\221\377\234\202\376+\277\277\343\342\361+\302\034\362\020\354\371\273\363W3\233 \031Q=7\231p\325\205f\350D\027'\256\263\331\361-\261B\363\274\346\357`\\9\026\331}&Z\361\203aRv\316\327.m\027\n\320\277\212\226\340\323\212\253K\357\266u\241;\347J\225R\245l\251\022p\305\243L\233\2062k\244\256\326[\263v-)\345i\271\033\276B\025\361*\320\370\272+\345\277=\336\346\3547\021\276o.\030e\n\202\273\355L\303\022\206~dT\357<\031\201\337=\031\242p\333\007\004\n\264~<`1\311 \313U\367Eppu3\026\213\216\277\001\313\326?\226t\352A\003\276?a\337s\251\276+\307\215\260\362\r\273x=\213\242b\350s\240n]x9\334\256\346%\351\030\346n\225\266\232\266\3264.\303]hxro\352j:\026\350\322\335A\350?L;\020Z\003\264\307}%\2211}^]\210\001\007\020B!-\274\016m\315\233\266\215n\307\245\222\267wV\273\253Vq\215n\020\023\023&\263\252\t\034\020\213f\360b\247\026\306\332\021\351\273B\017c\377|L\026+M\360s:\265\245\\\375o\316\352Eg\234/\240\235\210\2243\257\323O\000ln\r6\267\205\257\327\376G`?\315\357;\350_c\274\2268mZ\334\237\352\254\275\010\362\032\375{\334\365>\371\275\326\355>\212\030!\206\305\260\325\306\021y,P\257,N\241\021q\371/\302]\014w\365\262\353\346\270\315\217\025\3301\352\301R\342)\305\000\373~_T\360\037\334x\003\373\370\224dBEd\231\233\304\374~\037\237\324\324\271S7=\254z\217\306g\356\373\233\334\325\337\265s\270\374c\247\344""\344\226J\202\024\007\347b\252\255\020\003\271\371a@qr\355\225{\215\255\353\370\337\325\316\257z\200\027I!\331\353\022V\211\355\035\006\365\351\231\220\313\326\004)\351l\251*\324\262T\270\224\237\2657.\343Ns\3703\240\362\342\353\226\254rH\361\246Q\250\224:\226\227\374\373\276(\357\366\377g\007@o}\351\375GpX\357\264\254]\222/x1\235\207q\032\030,C\230f\242\246Y\227\210\313\177\216\360\275y\2665\010\313\346K\313\006\205\311\2122\362,\272\323\247\r\264\367\026\270n\364\355\336\220\226j\275\271\361~g\355\376_\361\266\274\370\351\370\363\345\306\217\231\273\226P\200;;57\240\322\027\254\215\307.\210\265\2431&sl\233\307\204\217\362\031s\221dw\2639\251\"\2261h=v\030\305\035\206\226\010\256nK'\005\345\325\333{\252\300yn\257,n`'C8fl\230\365\t\032W0\223d\311G%\306/.\014Ee7v\033n\301\331z.\340\262u\351\376is1\2643\231.\355\251\210^^C\014\262%\306H\313c3\020\276i\333B\357\003\275\335\233$\3322\264\350\237\322#.\004\301\033Drp\026`&\304\242/8V^+x\364^\353\214+\333.\t\025\273\265r\265m\341\303\261\233'\\\261\240\307w\230cxp\t\254\222B\327\025Oc\\\333\345\252\343\273\300\362\307&\271xH\2757vi\332\2613w\371\355\360\347\nQ5\260\331!\220\371\036^(\2272\356\302\303\214\353\246@\030A\004f\240\021\024 0\255\335V\363v\r\326t$\215\220H 6c\331\205\247\273\270F\2064nfV\021\343o\3177o\220`w\004o\244,!dt\206a9\217n\013\217\035\371Vo\234\330\206\361\333+Xx\223V\316\307{\273r~\231\3473\2345|\313\\Z\262\323\306\340\275#^\351hbi\314Z\263M\353\223a\205n\356\354dZ\244\030\2636S\320o\017\334)\221\3757\233\307c\204\202I\320\336\014b\351Xxf\024\357\030\265wy\327\371\367\3117\233c\230\013\273\206\355\356'\374\265/\234KoN;\311\203\362\016\364b\034\006\263\236\237\315\356s\256\237\030\352\321}\0332o\354\346z\360\003\304\272\343\003\t*.\210\003\255<\034+\364`\311\233\226\3678\356\330\273\026:T\270\334\313`\232C\366@\347g\2418O\351\355\367\330Y\374\311\351\315\3537\370\270\352mS\272\226\373\241\310\266w[$\264\304\345\225jzT\326\016Vv\317U\362QuH\210#\346\353\317\rj\353\353\252)<\356\224\235\252\352r\333?E_)""\322\024\t\234\213\242\t\226\271kWTK;\037lV=\017\322\224\260\303\203\333\205\344g\3119\355\373ij>\362\276\355D\363\236\334\347\\)\3669\236w\223J\352\305\245\357\313\334\335I\316\367\2262.[\253\362k\267e\230\345\\\nF\374\2540\236#\331\n\266<\n\227=\017Ty:T\245\235+\313\240\\\252/\322\366(\351\332\375^\225\337N\233KI'@\266}\233%~\272\327\t\270\345\262\224)[G\234Nr\353\327E\266\320\355\241\317\311\336\337\026\360\033\250\225\376B\360E\235\337\325\340\207\377\361w$S\205\t\002\250\344\253p";
    PyObject *data = __Pyx_DecompressString(cstring, 57582, 2);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (70432 bytes) */
const char* const cstring = "x\332\274\275\333\222\343F\266(\366\256\257\240w\204B\255\331\255\332\352\226f\316X1\032\007H\200,\250xk\000\254VkB\301F\201 \013j\222\340 \301\352\2529v\304\361~\362\217\370\023\374\340\360\233\377\304\373K\274.y\007X\335\232}\354\356\"\220ke\"\357\271r\345\312\225+\177\030\004\311M<\213~\316\236N\345\340\177\036\210\266\t\006\207\274m\252\307\301\307\252\275\037\004\307'@\317\353c\0314\273\363\241<\266\203\266\036\334\244\313\264l\303YP\264\325C\371\342\353\253\240i\362\247\030<UX\000\323\"\337\347\215\304|1\314EU\014\212\372(\332\374\330\212\037\276\370\342}\030\215\3420z\377\305\000\376\255D9\310\007\233r\233\237\367\355\340!\337\237\313\301\266n\006\371q\360\276:\266\357\007\340~\277\335\32798Oy\223\037\312\266l\2560\216q\260\232f\227#)\356kQ\036\007wO\203e\224\245\005}\222E\311,\236\313\224G\365\341tn\377\251\324\361\3631x\265\365\276l\362cQ\212A{_\211\301Y\220\253\364cl\352\303\340\343}y\244\017\321\277\276\373\255,\332\257 0V\377\307\\\014D\331B\026G\253$\211\346\262Ta=8\326-\024$?\356J\372\25487\r\266\004G\333\336\347\355\240R\237\256\346\323x\026gQ\370^g/7y\326\201\363\301]}>n^\016\304\271\270\037\344\234\335C\376X\035\316\007\372\360x>\334A\370z;\250\340\273\274\255\240\345^\0166\234\027\372\226>\241,\\}1<o\267\020\372\241*?B\030(=\206*\037OP\367\330\247\252M)Fi\222\236\312\002\372\003\270\342\343\246\202\352B\304%\274\3548\306\273=\237\366\345\337$\374r \035\277\216\362\375>\277\003\237\277\205\263\227\330\232\207__\016\302\331\257\352{\307\033\360/\007\263\274}\306\227\223\2010/\007\267\020}_\310\347\342H\313\277\237K\350\n\177\203~\363\253\216.N)\366\376On\2618\361Q\224M;\2537%\247\373\222\002^H\035\003\364F\265\257D\213At\302\204\200\221\330B#\376*\375/\200\227\212jE\004M\251\002\311\217\343\324C\230\232\377\357\023\337\347%p\034\324\307\375\323\240h\312\234\206\362\035\367G\325\333\201\354\264\325\356\\\237\305\240:\016\016\345\241n\236\256\340+\354\245\271\020\325\356\210T\r>\336|C\361p\010\354\3152\220\214\370cS\265X\022\031\200\373;\r\353g\276""\255\216\233RRS\032\346_I|\013$C\320\0101\237p0\370\242j\2000\0146\025P\\\201C\017\373\265,m\030'7\206\\\207\263i~W\356\225\337l\271/\0373\214\031\350\327\301\004{\037\316\336\017\2068ls\3107\346C\\\205\263\253e\275\177j\353S\211\001\001L\312\272\331\224M\310dk\274\317w\200\224~^\\2\212\362\001\306\353\010\252\267|T\304\337\301]\245-T\215\225\021'\020W\310\177\375_\210\\\210\363\351T7m\271\tU\251\007_n\260\365\320\223+\004|l\332\020B\177\250\216\273s%\356\201\344\344\207\372\270\343|!\331\002\352\263\257\212\n\032\030HUu\220\000\214N\246eW\356\307\373\352X\346\r\205=B32tjjh\354\003\204=\343\347\320\003\026'\374\030\222\277\253\353}\004~@\206e\3310C.\006J+\021\262\266\242\303\251}\032\210\373\034\274i\024\320$S<\265\367\365\361*\30793\002\262\013\263\206(\232\352\0162\007\024\371t\302\367]y\237?T\020\030\247\217\301n_\337\345{\352&8\347\344\rt\241\n\272\361qw\365\005\021\357Y\220\336\220\003\377M`\212V\376\235O\007\373\272`\030\372(\324\3327\257xZ\013\223\305R\307\0206\365\351B\0142\301\264,\007\301^\324\004|#\377\021p*[Q\\\305\351\204>\313\352)\2467\343b!\265\343\357\243\307\023\366w\230\203\367-\264=\024t[\225{\230\236NOE~\022\347}y\265|\032\261kP\250\341~W\022C\001l\311\006\020E\331\215\005\376`2\336\254\335h\307y\321\326\r|$9\035\352\364\225\354<\237Y\"\230\000\026\3623ln\376\310\217X\334W\333\366w\306\312q\244\370\3453\021\327\373\007\244o\277+\346\224>\262#\255\366\345&)sA]\032\272\353\030\020\330(}\220\354\342\223`61\375{\002C*\204q\361\003v\262\343 N\001\255g@ \335\035\204\214\305\305\343T\031\247\026\205\211\377\366\355\2578\362\343.!tIE|\334\326\326\370\213\217\300\312\r\036J\254\254\301}\216\201\007\262\341\253#\022D\032\373f\252\265h\211A:\010\034\355\007@\252\201U\013\230\014\200\026S\377\303\256\005\021\333\341h4\376\300\201\337\307\3634J$\027\207\3778J$+\017\300\021m\230y\3727\001\245\023E\336l\260\007\236\032 \2148OI?\036\215\357\20304\321\004\233M7\016\230\277\034\266P\177:\013~\356\344\300b\366p\320w\"C2\330\211\355\363\006\272\256F\016\017k\202""\2629\325{\252xI\006\343#\304Ym\250\276^\"\235\206\366\202\304\277*\276\302\361\372\025\264\023N\215_\275\034\354\240\251\355\300?X\201\033\360\377\352#\177\321|\374\352b\260\217\030\016\003c@\023\216\21100\003P\013b\360S]\035MO\207\325\315\022\332\231\206\313\370|,$\311\307N\201^My\301\347\n\346<\030`;5\246\0005\320\250\001\343d5\276\037-\346\267Q2\211\3025\360\352I\220\305\363\211i\245\264\255\366{\305w\037w\2623}:\234\037u\222-\246\353\371\"\231\005\323u\364f\005_/\346\251\371|u\334\324\005\255\351\312\315\225\377m\360\237\370\026\3235A\377\343\177\373\337\033\370\r\376\362\343\240\201\225\322\021\206\341\213\273\257\261=\0148\370f\020<\376\307\277\377\267\257\373\262\321\033U\016\337v\253\322\316!\016NX\366a_\177\2174\342j\231D\213\371\364\335{E=\363-\257\210`\211\002\265\007\023\213^\351\340\240\000\274\216\013F%L4\233\n\375\340\023\\?\235\200#\200\242\323``B@S\263\375\325{\036\022\320\rt/H?T\247\3678i\021xD\016\250\004\212\322\324gh\300R\256\342\260[bw\362\2137\217&kX\031\336F\237\331\014i\026-\327\323h>\311\256?\363\213\353`\271|\267\036&Qp\023.\336\316/}\305\237\205\261\312\327j:}6\001\035\022h\0214\222\t\233\340L\016\024\333Ye\302\264\016$\000\270\370\343\223SS\300\023A\230*\307u\262\216\001\230\313\342\276\233P\350t\033\352c\315\327\203\277\3768\330@\267\371\203\354\202\3367=\305\016\006w\220\300\207M\375\361\210\215\202]\345\246y\332\327\017\300\262\003\323\266\241%\373\006\026\326Dl\240#\020a%/\035GQ\237\367\033^\301\343*\344\210+\366zP\036\367y#\227\3632Jq\312\213\362\n(\006\206\007\326fC!u<9\365\3223\212T4\333\342u\314+\240\226\330s\256\227!.\006I\026\201}U\321k\256\260\366\334\034Uw\025\365\001z?\360\272\305\275d\261\251\005p\025\202\264qp\007\354\341\007\234\322\254\342\354\231;\276\272T}\353a<\232<_\207\351\022\303\374\177W\211~\007\005\322\365n6\213\262$\036Ysa\213\243\030J\302\302\017X\005A\007d\236\261;\336\211\353x:@\266\232\252\300\371QGC\265\354\366\212\027Lo\240\026^J\3223\213\347I\224jp\224\274\377\332j\221\277\237\241\352\205\212\377\311""\317~<\017\243q<\207\t`\275\274\234\377n\236\221\251\337VG\0305\203\027\310\014\335\325\260\266\204\005g\205B;\323\257p\311S\356rD\016\312\n\306\032\315\370\342k\362y\266t=e\250H>\010\275W\2453Py\3504J\000\263K<\037\177\036\345\260\352`\026d\237\367\315r\224F\331j\271\036\007\3614\n\235\212\373\230s\223B.E\205\013z\314\364\271\202>\306+\006\252Q,\024P\347rsa\036\270\032dr\204\235\3059\337\003C\310C\026\306\315?\312\246\036\234\252\007Z\376\017r\035\301\226\370\370\352\037D\351\2560'\270\230\301\001\n\251\t\024\025\2224!\207\200\325\376\334\224\356\327\342|\347\26720\305\033\024x\034)\243~'\220\302=3#-G\304e_\215\343h\032\246\313)\020\343O2v=\323\030\3632\357\371Kds2\263\020\311\240\346\362\007\310>\tJx9n\361\3040\004\257\203$L\027\026\231\315\374\356\013\334RU\334\003K\214+\02393<t\210\202\311\230\025\251\232\323\256\243\341\273\364:\272}6\225\321}y\367\004\353\377\207N\"W}\263\270\216S%2qc_z\261\327\307\337\316;\224\033M\232|S!3\375b9\232|\375y\211\311\270\337O`%\276t\t\352\251:\225H\2047H\re\022;\225\204\032\245\023X\264\237\276\356\213\332\211\361\3752^F\277;\372\276h\355\210d\254Ib\342]\352X\273\365\3023\016\260\310\320\233a$\201\343\264\007:\216\303\372rJ*rJkj\027!,\313\223U\212\027\373\362\270\203\350\367_\3675\311\363\005\232:%Z&v2\246D\320\2556U\321~\003\024\363\033\354\003\274\243\360\273k\317D/\353\357u_b\227\333\234*1W\334\354\261>~C\363\267ZB0\241\336\234y\331rB\336\367cm1^W\235*\226\351CG\237[Lg@\274o\317\254\363\\\336\332\332\341\215\221\005\203\206\326\3428\312;\262\202Jl\007\324\024\027\354\270&\016\376\237\377\343\277\005W\316\330P\331y?\017R\213\271\035]L\036H'n\2650u\246]\250&\257\216\255\376\262f\316\004V\006g\252\035\314\237\235\244I\347}\232\331\235\340w')\2232D\375R\222&\235\367\223i\226\374\377\221\244I\347\375\330.\344x_>\3224yq\374\014^\300\007__\301|\274\257>\000]C9\tD\250c\340Pr\177\014\346\312\372c/\327\302\274\203\226\300\366\r\224\2613F\306\275\003\362\345g\344\370\322 4\361Of\310\263\0319j\t9\314\367\325?\240\237\317\200\2459\020\241""\222\024\313\036\2010\223\267y\323K\271\254(9\373^\032f\224\277x\365\r\304\262+\2776Ey.\003^E\373C\331N\347\275\237h|8\261\230\232\233\344\263\322{\246\022\235\264\246^Z\301ygR\302\255\340\r\314\362\237\223\222\341WO\247\246~\254X\224\307\374\276$|\266\207\220\004gP6\r\212}\201\253\262\2718\226\261\311\206\032\024O\305\276t\310\237\235\355\367\241W\206\260\334\356s\344\266>\247\202pI\206\235^\177]\251\332\246|\276\244L\346\233\374D\374\000\016\330\266\334=\351!R\017\004\024\016\2708\217~nt\0360oZ\366\200U\272;J\031FQ\234\033\247T\241\323\375.v\275\177\262\335\235\316\235\215\336\314\022\233\251x\310a\351~\244\245\376\233s.\252n\314/\340\213^~\305\212\353\375p4Im\001X~WqF\2011\025Rr3\254\212\036\316kX\301\247\020\376\353g\212`b\177\037\273)\301\030i\352\007H\347R\222}\314^\254\323\364\206'\261\365\310\367\303\334{dN\020';l\344\373\034\000\222.\353\211\234w\\z\246p^\262\242\013\326\001m\231o\244\334\212\327#\203\357\006/\240\353\177\337[\247V\361\336C\355:e\245\366\371\246\333@V\023b\"\303\352\033.\035\224c\007\213\232\366\336\014\261\027\034\247]\335V\342v\202\357\307nEk\352\363{*\372R=\333\211Z\351p\232N\367\004\252q_\"\351(h!\207\313YX\006\263\374[\227z\253\362&t\336t\024\237\310X''v\207\266DU\267n\035Oa\022\000^\326\244\327\233\216\251v\225\336\213\351\327_\233f\271Ba\250\030\374\013\307\366/=C\017F\236!\217\365\376\351X\037*X\225^\321\262\206j\200\272Y\201\273l\r\020\327\"\307\010\215\010I+\230\030:\207\273\222Z\256 \027\306\rn@\177So\267W\336\240\233Zs\242\333\037\014Y\372D%|\336\010w\023x\357$\325\023g\n\374)m\273=\263N\323$o\354\221\274Lo\360g\r\254\256/\r\253\213to\244\372\310\310\212\366\205\273\310\264\2274*F1x1J\236\253\204\221\275r\032}b\215f\362\371|\244v\\\357\247\351\033+\332i\231\003;(\250.\205\224\276\367Ea\276z\257d\365\235E\007b\3738\307\3621/p\321\200=T\nf\0169m\021\243p\336\314\276H+Irbi5A?FQ\013\251\212l\240\270\330\342\310B\343\034<8\234\367m\005S\266\211\302H\252s\030\003\345~\257\364\247\376\345\333o\264\347\277\320\030!\021\017)\240\360\226""\241\216\204w\014H'\004\365\304x\227S\356K\270%C\335\004\340\250\227\243\351\312\221;.G\243\353\3054Jo\336\321(mh\367\200&\225*'\005\010\\\265,\346Qo[\331\265\373\036C\231\212\236\3272\037\346\273\3672\252\367j\302\350_\000\231\221\210B\216\377NK\022\235\326{W\254\3541\255\366\234\337\021\205 a\260FXZ\035*\024\243#A:\037\217\264\361\177\337\273\\\227\253B\177\261\332\313:\350\334\275\227\302^\035\210F\374\371`\223[\n\361\334h\262\343x\217\302\353\351\033\213\355\321\202\350\351\033]HDN\337|-i=xlH\020AbX(\307\013\350\313V\233B+\234\312\177\324\325&\337\367\322\036;\311\367\323Qh\017\346mk5z\250v\r\006/ \330sE\322\261\274_\276\313\256m\371\337\2224`\006\342\036\307\222$\017\003\324\032S>[\265\327\nM\246\371\347.!\301~*\343VK8\207\272\271\262\212m\337:\247\217\356A$\035\306\242om\347\220\325I?]\375DZ\317\223W\223B\226\306\311\314\022>~\254\277Iq\265\010\344F\261\204D\\\366Hy\277Q\224W'C=RJ\241\237a\231\254T`\246\234>?U\312~\210\032MD\357\277Ie\252Z\213j\220\262\332\206\260\244@G\231\271\301\013\354F9op}\315;\\\205\273&39x?\216\2628\\Z+2(\3247\313\206\346\325\027\341\022\326\314\274\355\241\324\257\2622'\375\036\334\321 \215\004\350\007G\244J/0\246g\271F+\245\367\264\257f+S@L[\275\376DJA!\200`\3375y\363$\247!\224\217[S\221\275\247\267=7\360U3\020\345\036sc\204$yK\374\223\324\301\200i\215\024\tU\317\267\3463^=@\000\230\330H\301\371\345\240\274\332]\275\034@_Y\204\311K \272P\261\270\276\335\310m\034\177)\362\361\276\202\345%\356<\033\262\250W\300vU\310\322\177\216\032\310\272>\311\251\325\364%\255v\204\365q\244\325\316\245M\003\355\353\354\034\270\323\024\356\244\323\274z\302\255\363\235\246\323r\333S\334\323\216\341\216\207\033\361\005{\323\004\325V\307\363T\237\251\252\317B\305\342\356v\345\250$'\016uM\r%%\254\333\352\321j\003q@R\325\2470}E\323\224\024g\212\322\352\371\027u\003r\3560\276\212\300\025\314\313-\353z\233M\321\262is\\I*>_hmn\336\242\343\005\371 \230\276\r\336\245j\217N\327\224\211'\337\027\347\275\024G\340\370\205\020\242\264z#\207gECA:'R\304\275yim\203\226O""\024\340\2673\360z\330]\245v\224\232[\335\342h.o\264\230\2071*\227\330;t\231\245;\217\031\332\343\234\343\211\232\211\372C\017\323\312\366\373\377\370\367\177\347\256So\355l\371\0376\212\n.\377\343\177\375\277\376\357\377S*\237\310Y\360\375j~)S\253\276\204\010\3216\260\274\341ht\354WJ>\235\255\222\300Z\340\245Ju\ruS:\373\304@\340\265\023\205\334\006H\325F\035\014\314\374t\005\277\216j\036\373\030-\272i\016\235\273Ma\256\261\364\334\246\254\332\332\224;\310)*\306\375\016\035\302%>\023\365%\307D\343\232\362E\335~\3777\326\314JH\355\252\332\335\267\004iG<\271\316\320\261\307\307\224\\\320\266\004\250w4\316\276Rz\202\244-\212\024Ij\235\036\362\223T\"\233\326\273\321>\027B\006\234\345\355\020\367:\274\322\002\372\312S\2504>V\030[\225\223}\264r\242\245\351\217!\215\022%W2\342\034\01053\322E\362{u3\027\211\241\2202\026(]y\270\333?\375\316\250\002\371Y'\276\215\322b\0360y\376\374(=\375g'VT\254\344\034J\304\241\336T[\014M\362Y\030\033E{n~OU\250O\234d~o\226{r\372\373\252\321T\337_f\244\237\177\213\372\3710\342gR\021\272\"eSK\3621C\255%\347\204S<'\235\005\271\320\272-\233\247\001k\2544%\311\323\350\354\314\373\371\305`Z~\342\204_^\014\257\225.L\370\227\003\001\371\2439A\177v\365\305\014\211\264T\373D\277\003+[\035\016\347#\266\\\335\320\332v_\002k!\234\260\244C\"`\220\261\222\350\251\256p\005F\272\353n@\255N\203\364{\225F\tjV0sN\r1\237\377b\215\323\271\307\017\214\034\025[\303\017h^\340\225;Y@\024\274r\224\336\257]o\334\347\264\274\307\311b\030\315\343U\352\206\032\003\243Z\036\253\263\260\303\272u\255\202B\247G\016\363I\206\374\254>5\227\007284L\347T5\026\333\253\271^\345'OG\350\231\1770\342\345\020\211)\200\311\304\032F\336\017OX\025\362t\027\262\201\313o\276\377\363\367\324>M\211\213o\344\013\356\n\244\226|4\0025]\332J\251\343\016\342-qA\307\222\305\036'\244\252\326\007-I\371J\326\032\376\212\316\256\320\330^\303\3470\016\276R\212c\017$\342\033\347{Q^-X\251\217\316\211\t\\F\313\0039y\001\305\023\203\027\244u+\003\311\3438Pwx\026\001f\306\037\006\313\321U\n\235\210\030\332A""\204;8\262\216\203\026\212z\007\234\207pjY\326sU6\315\340\207\201\275\257\313Q\360&Pa\364\270\371, \305\374\342\313\315\3274\2611\305\020\327Po\373\262\361\324{\277X\302\244\215\314\351\313A\364\210*\345\264r\314\352z\377\241\342\306J\013\\\006!\345\223G\nY\307\347\213$\232\000\027\2063\302\357W\332w'\\\323y\354\003@\t\344\267>XsP:\226yN\347Q\252\271K\253<z\246\026\300q\342\224+Y\255\257~\305/\274\202#jr\206\364{\360?\345E}W\345\307\036\257i\n\253\355\036\374\254\206aS7=>\363\350m\266\230\007Sh\246F\211\024~GUQ\024\345\307\266>\006\323\221\216\301T\031\371O\372J\267\270\373\255\007\273:m\240/\366x\320Q!\2512\371;\363\207\034SJ_\272\371b\002'P\221\025O\272\374\216\002\303w\251\374\314\212Nu\264\022\365'x\036nl\355\363\317\211zR\266\236\272WO\002\277\257\370V\241\231\333Q\265\312\007\020?q\316BX\241\234u\341x\221\274\r\022\213QW\361\261\036\243Z\202\300\030\375\210{\315Z\315U\022\370$\272\215\2224\372\324\347M\211\273P\245\375\371'\n.\343\271\342\263\203/5|W\356\252\243\001K)\323\225\365\304Xs\200B\345\346w\324\365mY\310\257\254\032W\354,\035\220U\025\337=\230\343\260\275\032\340\243\334\035\330\377\306\371\370\327.\232NP\333\036@H\213jo\020x\256U\003x\304\356W\357[\017\3643\200\007\211\034\000\002\304i\027\323\367]\017\016P\224\016\274q\301\273/\037M\354xtU\001z\025\306\337`\306Ul\\B\273\263;\030$\327\214\240\203x\326!\031\205V\220{\212R\363\310*V\350\332\207\3012\036\001#\210\213>\365\031\241Qe\333\"\250\n}\250vM\336\301\262;\013\026}3\007&\005^J\213\003F\3454\207H\216;\230\004\0063\336(\251p\214J\231t0\235\315\276f\345P\374\214\316\237\242\354\2207\001.\250H\016\347\270}\300\364\327|\213\264s\300\304s\220Y\204\215i\223\350\206Q\345\240\320\026\370\237%\216Y^\367\022F;\356\317\037\253\020\233\031\244Y\032\277\366k\033Pj\2325\250n\240n\030<\237\231w\247\332\354\302\024\234\245x\346)z\200&\350\365\201\376x\352z4e/>\271N\373p*\223\313>\244\302\361q\275\r\361\276?\342\331`mO\000\330chX\346\350P\246S\241R\000r\343\177\220F,\376\200l+U>c\323\231\207\301\243\323.\212\3162""\027\270\357 ;\276\3025\245>\025\252%Q\373|\307!\302J\000U\207\356\231>\211\266<X\337\376\001\317Gz\251N\272\031!Y\352\037\364\241\005\253\333\330\336E\235\343\224\3433D\024\004S!\271\256\207s\222\361KK\247\226$\231q\016\275r\346\325~\221\025'\353\031\031M+;6\022\2421\332\304A\007l\001\273\007\266\030X\223s\343\352\274\233\230\273\001\355\270\345\271\205\3229?M\036\252_\371\t\363\021fZ\247h\034,kYK^J\271\373\317I\250\263\\\231>wB\014=L\314T=\025\036\221\201^\216\213\035\n\003K\376V+,\352\2644\326\255\323\023uZ\336\370<{\215\350eE\356>\240OCL\275\222)\263\024\273\255\255.\302$\253\257@x\322cK'{\375\200\272$\322$\002\3220U&T\204\303R\343i4\223y\247\354v\376ht\302\332mC\307\370\211\326Y\224\316\242s|\316\377\245|k^H\202\273\262e\027\322@\215m\t\260V@&\014&d\247\377[]\321\246\340\251l\266j%\376\\F\244U\202\227.x\205\321\3708\210\357\303\027\203n6\244\277:2\352\347H\320L\375\317f\004*\304L\365~\340+a\373:5d}$\363#\017As\207Q\366 \354\351\336\342I\014_\321\261\323\260:\346\362x\014w\230\026w7HQ\215m\327\254\216\372,\366\200s\302V\177\270\r\325\031\314SS\343\272\377\0074\\\"#f\227\303\371\031\037k5{k\331~!C)\030\362\226\013\247\005\244R8(\321l\322\000\205T\003\224\331\001\217\335{\222\235\375\000X\260\206\202\203\335Vh\345\003\027$\nA\325\247 \252\326\267@r\352\217\224\320\325\213\227\203o~\374\342o\277^\275\034\374O\177\375\352\353\037\362\177\3157\2335\314ZP\013\371\036\255\203<\241\314\275\202\301\324\240\204\203\2443|\366J\356\0335\252\226P\370\346\370|D-\220\373\352\204TaWJ\317\207NY_^\300\223pN\0071\300\213\257\007\300\332\342\357\333\307\273b\311\222<2\r$w\2126\020Z\332|\342s\200\364\231\345\374r38\240\314\317:\356e\371\322\221\271\262\265\270a\351t9km&\312e\374}\373\0006\254\231\377\236\005\t\264\357\313\301\235\370\361\307/\213/7\005[Z\241\303$R^\353\324\206\364W\r\363\003s\002\3128\006\225\215\3641Q~hL\020p0q\005\301\016?B\"\232\275\026W\371\035\364P@\210+:`\376#\272\317\207\243\216\362\356\334\372\250gR\251\355D\214l\226j\026{\305\346/\226a\033l|^\234\376\325G+{""2\177-\364itTs\274\313\361l\247\354\2348q\342\220\332lJH\254^Wl\004\000\\\277\331Y\304\251\002\345\311|\244\006\274\321l\001\220\364\347\313\241C\231\342\230\017\251-T?\202.A:\013\003\031F\254E}n\212\322\212\376\313\215\254Bq)Do\006T8'\013\372\343Od\242E\361z\373\\&:!.d\202\303y\231\220\037?\237\tT\203m?\331e0\244\212\375o_\376a\363\353\340K\201g\223p\020\275\034(;m\277\022\212\306Jp|R\224\327 \235\221\212K]\343\305\203\317\300\326h\266\260\374\215\300\311\243$\2537E\305\002Q\206\216\320\207J\232Z\214h\026\njY\203`\007)m\014F\337\330\035\032\213`|if\3707\264\014\205\335\0273\240\010\013\226H\271y\376 H\225`W@\225\277\332\214tO,\250r\004\361~\341\014\325ih\240=\225\216\346\0052\2234\361~\177z\202\010n\345g\277\347\253{XN\311n?x\261C\303)?\250\375M\205\204\030vd\365\010\245\346X\314\022\205\316-I\243t{\003\200\034;T+N\321\206\260\211K\370\037\006\307\352\307g<\037\236\367DkL\266?)Ct\347\033\213\316\n\356\245\316WD\030!\302\246\376\250\250d\245\r\007\262\213[\213:,\221~y\376\332O:\234\205\201\2250N^\334\2476\310\243P^\376\362\343\340\333\216\221\245\017\345\323\017\332\226\030\277m6\353Wew\214\3367\351\222\035\264\273\316NdA\310\301=\211\234\230Qm\323\214\034\\\212\036\241\2672\201\006#\357\345\340\352\352\352\327\227\003w8\376jG\220\005\213\377\334\367\377L\362T\2518\001X\375R\250\351\362Nn\003~\305\006\034\277\262\332\376p\252\240\207_\315\226\361K\032\343?\300\353\267\037\341Q\377x\254\365Bz\275\2463\014\345z\255\024\303Q\021\254m\252\207\n\"Z\257\013\\\374\201'b\351$\265\024\305\262!\260\207\2127_\200\257\264\271\2153\253\245\350Y\322\350\343X\306\203^b?\226\254\353_I\266\374\325\217?~E%\375\352\177\370\361+\346#qE\265\305\215lI\211q{\355\270s\375\244~\021\346\210\2728\255F\305\3050|\316Hj\017\335?\235\356\313\243\307\326q)\024\215\3707\222r\374[\260\270:==zH\224\340\366\240\303\331H-\337{}\303\240\027M\326\343z}\320\222\\\257G\212z\232\375>@\376\372=P\266\330\353\263j+\340r\372|\372\220i\0372\353C\362R\262\353\301\273\211]\3748\352A\306}\351\241i\226.vZ\367\225|""\226\267KK.\320\037\242\007\313K\222>\017\336\244\354\361Y\216\372\220\264\317\331\2037\"\214\036_\271\245\330\343\241\266\"{\374\322q\037\022\250_\037Z\356}\364\370\310\315\225\036\037\262\354\321\203\177\352\253\215\254w\350d}\231\301\365f\017\226W\216]\017\024\272U\305\016\276y\254</\0027\207\302\214\303KA6\371%\277J\\\362y()\315\027L]~h\376\025\031w>)\246v\305aN\375\214u\005\315\274\222E$\300\230\357\310\021f\255\016\246\235\362\350\374\227\202\354L|\365e\363\025\353\366\0357@\274\332\272\336 \331z\021\177\315\n\244\340\374\3118o\215\223\346]\003\302\312\370\370\017\003\326\016(\024\343\301\344S\261\333\300\3764x\000\204L\231|\271\371\332,\344\331%G\206\277\236\377\013\233\237\3358\353\243.n@&\342\372\3745\326\2335e\374\022+\371j\366\362q\232\353\276\344!]r\025\333\033\352\202\237\034/6>)\363}\177\232\226\017:\237\361z6\224\346\201\244\027\316-,\227Q0N\035\220\267\261F\\)\323\243,\2712\225\344y\331k\016\271\223\326S\333\237\373\221c{\327\000\300\3321@,\335K\326\250T(Gg\022\374\034\370W\31380\356q\272\240\367\350\370\366\251Lt\002\001\341\272\006\022\373l\020kO\250\317\363\031?k\277\245\343K\322\265\276|k>T\357\334\265\302/G\207\251\324F{{W\232\277\376\352\231Yf\220G\2564},\371\347\261\325\221x\020\274\0348\203A!\231\031\3278\234`\364.\273\2176I\312\001d\365\n\215\261\003Y\222(\273o\365x8=\325\332\355\345\265\214]\227\356\366\352\247\331r\375\255\253\233\362\331\037v\366\361~o\243\351x\334m\277\177.\032\352nz\\\022\004ES\333\300^\347W\336\334A`\311\374l8k\033\325\303\367\243\255\355\312_=I\263\007B\021 \027tH\027\226 D\204\264b\224\025T\255 \355\317\373F\321\177r\3640\245\313R\007$\351\251#\357x\206\252\313\020\220+\334%\357\320\000G`\322E}\322\347\237\013g\217\224\337\345\215KoKv`\206i\3253\331\232\271\221|\365\360\327\237:\003\231\260v)\014\342\302\313S\022\370\325\023j\3702\216Nb\317\2044\362\222\236\360\366G\252\037vz\244\236\302\273\263y\257\027$\247\001'i\304r@~\312H\250\307\232\372'P\3270A\256\235|\366\350\351tv,^E\\\360b\n\350!>3X\317w\314_\220:\302Y\357""\205\345RUUr\252@\215\363\253\036_62\213L\244\274\003\001\002\335\223z\251\334,\353\335Q\004\346\2667\030\261:\035?K3\010\375>\240\\\201\365n\225\241\367\037\200{W\036\033cv\335F\333\333\354\016\236\204\263\234^\363\303@\241\253\216Q_\373#\332\223e;\274\006)\017\204\331([\241\317\301k\243\331\016\266OM\252/@\027\217\025\244\321/Q\230\244\004\217R\256\344.\225j\314RS:K&\372F.\231^*\231'Il>\376k\020|\373m\360\355\253\340\325\267\301+x\276Z\037\3626\030\006\303Q0l\2030\204\2778\213o#x\257\203\351T\276\326\267\301t\025\245\010A@zZ(\345\212\027\360\230\315\202\3606\230\217\2420\230L\340/\211&d\2157\210\203\370'\370\033%S|\256\322e\220\244\0218g7\210XF\311\014^i4E\3506\216\346\363`4\r~\302<L\247\020\305u\224h\007$8\315\026\344\005\311\301\017;T0]^\007\364x\315G\310\002`\364\347a\224\244\220\370\002\246\014\014\263\270\312O\247\327\264@\0057\357\357\323]/\032\222\306\336\rL\372\336\304\265\301\200\001\364\006Wp\365\023\270ve+#\245\010_\303\227\340\306\213\021\202\3452\232\207\374\\\257\226a\220E\000L\337\255\247\213\267P\016r\256\3007\221\252@\362\365j\030E\322\371z\244\034\241r(\257\357\344\373{\371\376\243\212\344\265\216-}\365\332\002\276\377^}2\\&\3129U\001\226I\232._[\027\353\004\311,\376i\021\244\2438\246\307z\264\230\315\240\016\331\235\336\262#\214\346\320|\344\034\007\243l\221\254\343\371\230\277ZO\246\267q\312\316x\266\234J\027\264\305\317\312\251B\242\013\242\312\202X\206\232BU\311P3lkx\304\243@#\246\320U\225;\211\177\236A\266\341c\302,G\361Hf\210\017n\260\033\217\206/\302\025\003?\317 \231\361\024\362\026\343c\006\177T\342t\031\317\203Up\033\220\302\277\262\265\036\340\3208>\005'\0301H9\207\300\253\220c\304\352\225jb\326l\212\265\364\265\2175\005\355p8\014F7\370C\335\337u\3726\212\226\010\255\321\002\255v\254\3610\231\201\350\364\031\201\032oP\253\245|\031OpK\377\370\247!\017\254a0\245\241\010\225\006\177\361\210\036P#\313i4\202z\035\216&h]\204L\232\014\303p4\014\307\303p6\214\206\321j\032%C\264\3742\344\223\271C:\234\211V\003\206PS\311;~\312\026\031\306\213$""\273~\375z\030\247\030\355b>\374)\030-\206\361p:\273\235\r\247\013(9> \360p\226\314Pa\022\177X3\303\3714\035\316\263)\374\222\341\342\347\341\233\371\r \340\t(|&\360D\3042^\016\223\311|\230\ra\n\253\312\306^O\217F@\010\260\002\322\321\004\017]\343ID(\320\350\032\362\240m`*\343\023\370\206\356\000\257\267\361t\245\310\014\020\232\024*F\276\202\351h>ZL\261\212\326Ta\n@\311\301p\261\232\207\361|\002\271U\350I4G\332\244@<=\204#\206\014M\223\003\210\332\230\034o\027\3114\004\327r\221\306\031\036\333L\263`\236\205q0\301\243\004\000g\361|\025\031\033\353\032\003#-\031]\273v\306?a\374\334xG\267\321<3\340\030C\256\203a\352\243\222\010\006\037\220~\203\237\270\351L\022\027\314\034\320\263\306\335c2\3361}n\200\031\020\201\036\263\341\256\201\366O\230\211\267\314\210_(\013\232\027w\342\261\354\215\033d\006D\320@\334\224P*\236\341F\313Q2J\202\371\315z\036Ck\303\274\342\335\r\265\n\003y\027\226\232\337F\345~\037\316\370)'\024\t\310iDB0\225\350\003\241\006\205\2568\264`\275\373;FuDa|t\032\340v\374\350f\037<\0325\332\343\325C\254\374A\303\246>\034ho\346\216\207\024\271U\246\310\255NQ\022\004\361&\371\361\203rS>\321\335\326\274\211&I\242\214\231\005\312\0148\353\212\0210#\310d\004\021\315\014\361(\316xbx\325E\275\356\242\276\353\242\256c\304\245\321,^\303\\\346\307\330\203\177}\001\377\335\005<$0|\365\247p\370:\034~\037\016\377\314\273\210\362\"7\371Z\277\215\263k\240\025I\022G\t\340p\022\013\371\r\235\223fJz`\007!\307u\274\014\2434K\026\357\364\365nl\355\016i\201\242\007a<\036G\330\231\264\003M\203\377\022%\213\3652\310\340\263\271\345\361\013*\013\343\357O\177\374/\001\277\377L\357\377\362\307W\337\246\030\031:\377GB\375\371O\257\276W\216?I\277\010Y\006\355~\375\352;\355\376\356\365\367\226\373\217\332\375\247\357\377\234\006\354\3444\330\375\347?\3528!\232\327\364\376\223L\030\003\276\222\236tOS\014\324:A\226\323\267\312~\301N\273c1_\003\343\325\234\246\035`TVX[>:\\\000k9\357\342\225M\357\013f\273\373-\232[X \373\032\342\031/\350$6\205\246\r\222u\272\230\336F\016R\322t\203[\300""\304\203\264\320`R\262\005\276J\"\373F\202\361hn\203@I\275\373\nl\223\345\035\363\345\266\221\371\336\254\331\306\347\235+\0234\260\030\376\204\263\374m\344\027\325xtRsm\233k4\221\340$\302\317,l\226\000G8\315\002\033\001u\260\242F\323H\244\315\341\rL\311\362ZG\340[,\246\000\267\227Q\033\375x]\327\037\224\334\312\332s^\333n>\346\331\203\272Z\257Q\037\246Y\257/x>\342\306\277\275\225\235o6\230%\203`\232ocvh\273\257q0e\313\214\247\207\214x\017\311\303\362\325Tq\352\343i_\240\203De\207n\3309i\033\330H\271\274E\026\007\177\326\325`\010:\367\342(\244%-&\326h}[\026k\0221x\240S\215\276\207\254\3020\320U\245\235\363\274=7\371\036\202\023ROH\004a\245-\224\313mz\306\231\311r\236\037,l\203\212\014\n\014\253\203v\326[\345\364Jo\241\364\2074\311\332\021OPO\312\213\235p\t\251\301*ToM\242\307B)X\270\341\227M]\340d\253\021\256w\202\327\025P\316\330n\204\302\247\2469\325t\255\277\221\355\346\201v^$\352m\265i\357\025N\251\2161,\257G\223-D\270#\273\263\232;(\341DO\323\210\336\246\021\246-\204i\013\321m\013\341\327\275\270T\251\302\257=q\241\276\204]A\302\255 \321\255 \321SA\200[\035+\324\2726e\203\370\234\214y\240\356\357.V\262`>\272D\341OOp\247\243\213\036_\252\325.\026+\270\203e\215t\337\003OY\324M\331\357)zS\020\275)`%\235\244\016\217R\345\001\202\231\242\025\341\274\203\210S\037u>(L\261/\363\246\017w\213\"2\215a\263?1\036\26518:\027\220\325r\337L\343ec\330\220\363\241n\027\007t\203TBj6h\214!Y\214\330V{\032\226\014\251\251@Br\260\010\013!\357\266t\212\205\364\273>\322\355\214\262\n\310[\230\nc\n\317X\013'C;\341$\016\373\277\205\365\323#\330|w\237\013R\300\267`\2571\000\343\304\301\327\316\231\030Nes\260\352\t\272X\251c\023\375\305\026=\005\020^V\005\007\270\366\362\207\213 \336\346\367n\034\355\271\200\324C\241\274p\377\344#Uoq\261\272\213\270h)&\364\321T\342\036\344\270\251\017R;\244\307\367BL8\256\\\244)\263\032\007\270\"\234\2245]\3323\276\235\271\236j\207r\304\344V\017\\\254D\031N\236\t\343\211\016\217\024h\037M\177\246u\276\351bo\255\254X\025\247\304\257\365\343\254\024\367>.=""\223\261\272\216\327h2O;\010\2543<5\343z\354kqn\324(\266=\2105\244\036\022{q\325\367\245\000f2=\337\035:\t\327\373\0325+=\244*%)|9~\321c\2759\213\036Ton\021\211\265:\005\"\322\361\350\204\236\270\023p:v}\017^\336mN\312BS\0250/\350\027L\223G\302\331\224\315C\320d\334\301N\364\030\356x-\200\376\356\363S\007\237^\374\004\362\001\361\361\204\337\361I\035\037E_\t\220\007\021K\r\266\301\3467h\245c\361\324\203Z\21128\026\367u#\214'6\210_?\022m\006\242\215\221s\233F\337\347Mk\201\372\316c\005-\232J\331\326w=\230 +LX\236\332{\017\324\024Wa\307\347\375\036w\345\014\346\272DKf\235\200n\240Y\376(\271\037\215)K+\3233u\360^w2B\036\023 \030g\353+e\224\314`,\265M\013I\204\331-\017\341\024\333\330\203\264\373\230\362\341\262yHZ\356\364\341\274\030\014\0338\255\016U\333\347!\3319\343\0054\341\344\220\014\0137\323\375\231\220t\304\260\203p\233\224(5\035B\223t\312x\3010\355\3015m\371\330\351\213.\031\030\242\255\216~\257\350\270q<\230\233\263\350\265\215\266\0106O\334V\3075\210n\3375;\255:\264\010\365\000\337h\\JgM\024Q\336\343\230Q\224\227\345\210\372{\351\327\305\331S\r#\254L\223\212\177\247\204\026\326\n{\310\233\017j\2152F\255x\205'\223\305\001\020\253|W\276\356C~\347 G\366\314f\243bQ\003Wp\252\212\036?\267\223\261OXJc\0170\031w\343\214\360b\340\242L\361\310\275\205\006\372\210385\206Z\331\270\336\327\371Yl\352f\273Uk\177\327{\306\367\353\006\307\212\263\373t!\300,\337\035\253\366\274);\376l6\372\242\377\234\254R\313s\365D+:!\200\263\323\266H}\317\214\316\234I)s\325v\262\007\343\343\016%\031\256\007\2611\202\247\262\327\027}\334\206\214E\177\213\305\242\257\265\346\265\276y\331\303\317\352\007\"$\036\032\371\032\037\365\221\367\234=4\327\227[\221I\311\326\323L;\215\253F\270i\244=<\244\361z\256\233\244\317w\023\360\356\257\232\364S\375'\375D\377I?\321\177p\222\277P\321\344\325[\327\344\323\251n\306\366\325x\372\311N\232>\327IS\234=>\253u\236\355\313i\331\366\365\263\264\247\213\323\304|\221\025\364\3441\366\334\340y\231\271\241&\222\256\016\323\2505\032AM\t!\363#\220\236{\274c\202""\017`k?2\317\321a\372$\276\303\331\311qg\321f\211\261\350\262x\2165\023\035\036L\270\314\226p\230-q\211\331\022\035fK`Om\335\351W\3641A\242\217\277\021\227X\013q\231\265\020>\307 \3728\006\\\372\301\340-\217\356\260F4^\301\262\333\227\035\217\016\033A\253\343j\253\372\217\272 V\247\321\3260w\327\273'\253]\024\312j\230\363\261;\315?\224H\203Mj\365\376\t\276,\271}\022\356\005\262\013\214\367\371\016q<R\\\361<\035\325R'\266\324R\221!j)\222\350\333\030\016R\037r\350\332\366\375\001\237\023F\212HE',\363\212\317F7\261\230\245\216g|\374\255,z?\363\304\201\236\357\324\360'\035?\266\t\333A\253j\354\213\016xS\224/h\254\242\023\222G\356\307\033cl\235\020\235\234\321\007F\334\333\217\357\215P\206\360sb\243/\177\327\311G\247nx\244\361\371>~Jy\355Tj\3439H\356\244t\026\020\023E\013?Y\315\373 \204\324\375\320\000#}\264\327N\344\252\377\204\266\361\264E\341\026Zo\032(\004\tT5\200rT\005\310\035\241e\331H\261\270\361r\367\0374\226\032A\256\357\0242\0264-\341~\276\215\234\346>\216\352\333\373X\327\241\235/\205L\367\265\225\245\316\226\206\362\260\304\362\026\n\357\t3\265\327\037e\267\315:\333\025\nk6,\010#gK\022\201\020B\3647\210\263=\021\316\254\224\204\335\030\242\257n\305\2452\213n\231E_aDoa.l.\\\366\213\344\255\244\317\205\221\025.\017\273\312\227\245\037\"1<\361\225\026f\031\217\370\230\221\205\263\234(\255g\335\023\0131W\354\202\306H\371,\303\322&\tN2j\311\323\361\010\225pU\371\220\330rV\313]9\205==\2711\273\321u\2107\013\327H6\360\311 \302\rc\021\243\013\261\364\205\320\221Ha\361\263\231y.\214\037\321s\331y&\210\216\006H&-7\010\233H\0233\312SJ\270L\233j\204\332|\367\320\303'\026\312yhD\n\013\353\344\322&8\026\316\006\361\244}u9\233,\233\240\016\260B\243\347n\236%\005\320\307\273\233\032\347i\267\026\224m\035'cMy\200\365\205\323\257,T\320J\t\263\362\241\3352'\002\341W\237\350\257>\341\221\\\205\244t\334\261\177\311\013\243\375X\211\322\017\"z)\210\nb\217_\001\214\347\304h$8\310\030wu\252\215\207\345\245\342b\313\t\301\344\304es\302<\347\347\026\027p\t\327\241\233\005Vc\017inwj""\027w:\270\025\177\016gc\033\3130\027\356\212n-\225\362Y\006f,o\231\021\3112\352\"\214\220I\340\376Oy\334H\346zI\207\231Q\225\0177\033\303T\271T'b\210\022\321RW\013'\367\252\000Ck\223\253Bq\264\312u]\301\322\262)\356\237\010E;\225\344\202\345t\252\034\225(\244\323\244*\251\234r\244\332\331\307\313\3724Nc,\306Uc\034\206U\3215Y\211.\225\323\210Y.\204\342\3114\252\325n\207guw\033pq\2450\314\275\232=5\222\325\237N\243\366Q\272\317\217\325\276\202\311\233\223F\366\212\364\370\215\204\337Q\252\224 N\370@\030\206\365\243\321\260\264\247\373>\254\336\n\351z\211^\244\344k\231\267\303v\325\361r+O\361\242\002_\243\323\204\321\030d\003]\224\233\225N6.d\301\305\342e^Ri4\225out\304\322\037\265\234^\225J\266\307\316\211\335\225\224&\222t\312\256\242\234\361&N-\220'\t\r.\316-L\352\026\302\264\2343~\324L\321iN\246\236v\326\254\336\311\273\342z\3200H\361J\320\037\344\310\226\226MUo\220\227\222\245':F\375T\357\026X\315i\367c\004O\330\336\252\326%\316\354aw\366\337\315V1\272V\242\324\3725Z\234\257\032\366>\027\252n\367\264\\g\361\266Y\216)X}\260\227\271p{M#\227J\322a\323\037\236\342T\"rZ\263[Z\242\254\032\026\326\020\025\235!*z\206\250\350\035\202\342\362\020\024}CP\\\034\202\302\031\202\242;\274<\224(|\234\350 \254\270\355\221#\314\310\021=#\307\337\331\267V\020v\341\350\212-bm\027\362J\022\031\326\035 \302\033\021\242\323\367ya,{\223p\273\276\350\366u\341\367ua\367u\341\367u\\\250X\267/\030\214:i/1\326x\020=\343A\263\036J\207\201\336v\277g9\226\014D:\r\2131)\010\253\3632\346\250L\270X\317\027\331\332R\330\017\223\340-\376\370\030\007\271\360H\305b\225\220{:\221\257\365\317I0\237D\004-\027I\006\037.\226@\035\351\016\2000\325\323\252\236\215\322+)\300\205y\034\227\037i\207r\313n\221:\364U\006\244v`\2461u\251R*\251\0062\271^$Y\335\346{?IB\372\321\313LS\367$\303\317\225\340\371;\365;a\252\033 \225\r\220r\035\257f\263w\341\2730os<\210\030*\253\312\244\343@\341\351`\246s\036\324\265\375*k\314\301\251\312s\221ZC\252c\316\266ckv\304\367\013v\360=\271qM\323\272^\325f_v\r\352vl\327\366\246&""\372S\363\352\365\262\031\334\216\027\324\271\213z:\026\367M}\304\361\341x|\314\253v\214\374/\"\325\341[s\324VY,\256\217\333j\207BX\333\202\261\004\234\0060\025\027o\372\354\033K\234Q\306\262\220\324G\252\003\035z\t\233\374#\315^g\240>\244\003\243\034\364\201\002TN4\2542c\020\272'h\024\035lqA=(l\254\"C0\026l4q\257\025\324Y\357G\362.\000\252\340\352xF\252\327\347\315\026\336\373\275\232\352p\000f\312\366\203\261l\rR\317\007\305G6\212w\230l\214[g\302-\277x>\323\342r\246\3053\231\026\0273-:9$MY\334\266\352\251R\355\327\327\032\242\247h\320\3655H=\352|\362nn\213\360Hj\024\247\021\036\224\313\242i4\213\346\352\025L\243$Y$|\242v\235%1P\360\3254\300\313\213\246t|1\3729\030e\321\317\213p\225\3061\274\263x\244\016\366D?g\311*\214,\325\342h\277\257N\242\022\221\2744\231px\234\234\r\260\255\327h\247b\275V\020[\374SPS\236\032\003A\267\006\000o&\240\007.\276h\036w\241\253\277\020C&\376z\265\351\242>6\270\352\334\254\321z\374'?\213\360*\3611Jo2h\024\027\342j\034\313\003\272\363\325,J\342\321\032\217\020-\343\333E&\361\013<S\255\334\253l\026\315\026\311;\t\247PS\243\314\376\004Op\360s\035\244#h\t\t\014\203p\031$\301\014\0174I\024\236\356M\346\301|\034L\323h\034\244x\240\224\037\311x4\031G|]-<\241\266\307\221Z\262*\307\220\016\307iP\355\037Ez\025\312\035\032\020\222\226\200K.\003\005\365*\206uW\225\240\352s\014\242\312\307\233s\276A.\274\2218g8h\024\014^v\373\301\375\371\232\261Y\265\247}E\214@x\271\022n6DO6\334\031\205\021~\276\204\227\027\321IUV,\r6x\223\244d\234\301\337\3331\0357\033\307\3214LaPd\343x\036L\351\001\255\232F\263\341\364\035Cx\363\372x\272J\257\351a<\027\311(Z\253\243jk\350\006I\014\361- \322L^q$_|\262I\001t\364y\234\214\223\241\276\326\016\034\320\211\360A\347\236\215\213\370;\013$.\217a\343c!WK\365\266\374\325\251\350\361j:\305\337:\215\177\211\306\267\353\311\365\002r\352^\2669\246\213\010\370\244\"qd\264\033D\327=`H\n\342\242\201\177f,[l\037\223\331\365qS\226\223\t\022\250\233x\2167l\340\017\203\341\325\032\023y\346\234-\031H{\006\223Q\302\347\254'\241<M<\211""\026\223(K\026o\331N\200\241o\224\357(\234L\243h2\235\302o1\304sc\301\317\322\225\256f\223i\226\320\021|j\343\311r4\231\300\350\305W\331\256a\314|\3007\232\203\270\276~\275XB\253\276^\234\316\002\273\026\232KdhZ\177\304\275 \266\335\304\250E\323\336\327\273\232\305\304\327A\220\\C\263\342o\372:}\263\002\312\033\"@\365\013\216\214\316\264\001m\246\023\323\022\301\347\327$@dG\272\361P\257tRy\355\217\360\244\327u\220^_\207\343?\342\217\014\003\340\033\255\r\216\310u\033\377Bo\024\370]\343y\312\014\252K;2\340\356\323\345\"\215\256aN\270\0066\1771\277\216\227\3273\252J\272\274\204\036\274Ptoc#\017r\244\327\331\002\362\370n\231D\364H\2312\262\233\235\277\\C\343_\2670SLh5u\220\267\352\245d\264\273\307\203\025A\310\003\026=\226\207B%$\271\303V\001d\034#\345\214G\243x2\207q\326\231\371$zN\0067n#<\266\010S^*\321\213\361x\275L\026#5T%\232\216\223*\324t\245\316\326\306s:\262\237\322}\222|\245$>b\350`\206,(\314\004\226Z\251\002\330\003\232,\343'\232\0171.\2710\223\210\341H;\\\017\005\300T\022\303$D\rE\320r\201gk\343\345,NcZ\235\305\2519]\306n:P\006\316|\277\237\320\371\n\000\326|\241\243qYG\322\034\234\372\030\357\234\334d\037k\274\327q\0030_\250E\232\361)\311^c\265*\324\016\0225jh\302Wyk8%\223:\261^B\242\213\314e\243U!\004\024\347\003\356\362pG\211\226\300\214`\014\345\343)?\"B\t4\345\231s\013\2034\237A\307/>nkv\351}\005\006]\227\014\255\363(\031QpUJM\216\334(\217\266z)\342D\274\301{$\333'\002|\317\224\256\332\000'\312\250\320<\255e]vT\237\2516m\\Vk\rW\360\201\272!(\246\325\251Wr\341\226\034O\201\231\234\010\273\036D\351eZXE\025\272\250\270\361\200/\224\315]\265\265i\300\363\221?\303\331S\3332\210a\250c\355\322\307\264\355\204\364\337\270pi\0243o\3319\235\006\210&G\343\317?\375\364-\237\033\376\tbSk\272\237`\274\337\004\243_fA\362\313M\020\377t\023\2447A\030\335\20470s\372'\300o\246\253\233\305\315\315\"\275I\227\366\355\354<\207Y\030\350e\031\364<\305\233\203\217\332|\002\247\246r\340\366\314o\003F\335\004\013N\034\334\370R\242)+\224e\225\016 Mr\345\027\362{\336iqrD\330\356""\036\013\242i\020&\362\206r\215H\353\375Y\246r\205\367B\364\304'7\207\243\n\260l4\311\306>\302j\374\000\\\022_c{k\374i\240\032\327\222\214\260#,\307,:\365.\204\004F\023m\344\217bR\350\336\034\030\217n\352\273\316\r\226\036\026\312w]\241\304\365\251\353\241\nN\013f\351\240\365H\274\235\327&^\351c77S\t\332U\245{So\216\365~\337\203\237\327G\264m\256|\224\n$\017W\211\225]GBV\267a\341\272\3543\032\366Z\033\205\353#\355@\302\253\000j\007)\007qpV\364\252\233`\252\nu\257\322\262\273\014I\315\366\220\027\2506\345o\305\363\266n>\334\226\005\371\354\353]\177\345\303h\245\213\325m7\351\363\237j\301HS\023\3229\302\364\250b\351\254\033:\204\335\225\304\245>c<\234\0324h\030x.\242\333\267Do\337\022\227\372\226\350\355[B\365-rh\332Agt\373\273\232\273\206\221\030\342Iq\017\020\310\276D9\375Q\\\350\217\342b\177\024\275\375Q8\375Q\270\375Qx\375Q\364\364G\241\372\243\260\373#\211\305\205i~\322\354)\035\320\357\256\302\357\256\242\333]\205\337+\205\351\225\264z\323\216\305\221\246=\025\010\230\304q\205w\3616\\]\210\325\231\351\364K\234\302\246\323W\323`B\002o\264w\004\014\325;X\364\257'\301*M\245;\211\210\241\224P\272\032\2061\254&b\240\345\243p:\232\342\342jJ\355H;}\364\300?\230\274\310M\007\241\320\301\207'-'e\335\207\343#\335Uk\241\343\324\006lo\271\364\267\334*\254d\263\306\014)\215\027\002<\266\311Gnk\027\203\034\205\306\370\3378\301MH\344o\330\345vz\2153uBm@\2467\320<\026\231\310\n\302!\231\202\231\0234\236\244\3646\250P\341\302p\274\244\267|\301\362{h\207{C\2574yE\257w^\314\210\220\320\"@\201\r\031\007\243\3459=\222h\314VH\\Ce\214s\026\360\214\322\206B\024\022\326#\323\345\273i2\232\246\360\367&\231\246Y\220d\323\325t\005\335\314\265M=-\267-^\200\232\323%n\323z\007\177d\247H\275\257r\2440\244_ \021\233\262\203\"\313\031H\210l\014n*kXX!H\224\246\336f\005`c\210\377\327\010+=F\320e\310\032r2\304(`c\264{\347'm0\301~o#e\2165\014\354\352\226:\232\302uJa0\034\025\352\371\225\352\355\024McT\321\030a\345\234\021Na\030e\027@cd^5|\313\367\233h\324\251>\031\367Y\334k@tb\023\366\327W\252\365""\257T3]\271\242O\304\250b\222\202\316\276>Qx\325(\304\023-W(\367\224\220\016B\3628FWB\347\002'x\035\204\206%\315J\323\207\262\230\2411\312Y\260\\\002\253?\003\006|\026d\3607\272F\2135\226]B\266\177\007\317%\364\363\030\355\323P\370\237\341\017\006\326\024\r\362\360R\226e\252)\214\232`\210\362\353,N\347\341,z\027%\263\3618\234Mf\223\021\336\216\212c\201EE\263\030Ht\026\361\316\245\002\302\031\306J\202m\0275\207\23032$\305X\024\231\314Px>\213\347@\246g1\212\312g7\323\365\0102\032\306\351\002\335\3129\235-\240\014\213$\312\256W(_\237-c\370\013\302\237\360\031\313\347\010\250\025;\244e3\351y#\321h\277\223]h\302\223]\312\274\036@C\216h\250?ASX\360\"kX\352m\343\256a\215\277\214\371y\303\037\363B\007s\307p*#\225\t\232\324\222\233Y:[M\263\030e\031$\013!\010\210\321\004\\\263e*'\253Y\216[\344\312R#R%\013\244F\310\315\214 \275\275\035\n\300x2\304\231\024\001\335\224\315\261\334\253%\321\314\254\026\3019?\357m\037\035\225:B+\203\331w\261x`O\010\236-}\244\326\277r\260rz\364\321\222\025\366\321\366Q\234\036?k\272\353\361\355\213\020\307\032\340\322E\"}\255\n&V\252Qxuq\270Te\300\353g\\i\245\3018\022K\203v\244\226\204\276$\240\273\340\311B:\355\351\n\352l\264#\254C\017(\037\276\326\353M\365\260^K\347\376\224\027\037<\210\355\034+de\005o\264[\231i\306\211\234\340\356\232\231\320\334}K\313\375DG\277lDt\334\020\370xz\242\367\323\211\276\275\253\216\233\254\006\022J\000\352Vi\250\270\257O\364V7\240K\000%B\354\344\250tw\223.\034\2416\200d\304\206\337V\355=\037\2230\350\241\363\021\331\237G3\024UN\255h|\302\362(J\017$\022bP\235o\270O`\217\345\301\257\320x\342\026\326\026G\315-[~\330\274\370\005\217h\343\021\247\306\r<\217\001\3460\272,\210\316\024\372\260N\321x\360\"\301\300\251[\021\3628\214\215\270?7#-\230\264<\316w\244\177\t|k\027\371\330\203\272\255\232\366l\347\261\247\032n\231gs\020\t\036\301w0\224\240\241.W\033\331\002h\024\227\"\323rN\004H\300\211\016\276t{t\017K \361\341\311`\342\321\310\002\246+\003\330nX\364\225x\244\272\363\271\364\260\303\246O\207\273z\337\027X\3718ijd_""\034\022\007\243\346\027X\212&\365G\301\360#\254IP\334J&z\020e\257,|XH\304\210\356\347\344\006\327 +\353KT8S\016\354\3514jl\204\376\302FNy8h\020\263e\272\201B;}\203\266L\315\270\261@\312\263\304\305)0\236@q\313\023\266\374FcU\n\nq\304#\273\271\206\266\265t\312E#\273\201\244\375\364\255\003\240 R\3024\262T-i1\266\003{\331\237\235\017'1:\266{\033\216\013\037a2\243\341\235\215H*/\004!T\2209,]p\036\247M\\\215\023P\005\302\202\224\375=\013e\345\236@/\363~\234\2329\350\010\315\024N2\r\nT\007\220\230<u\216a\365\"\271\357\364z\211~\254\363\205#\362ppj\322&\t\335\006O[\035[\247\2700j\214K\367~p\247x\026\234\365\270\\:\347Q7\271\014\267\234\nm\0231\037\345\327\262\225O\022\233\331n\341\000\2434Q0\353%\"t\337;\177T\207|\207|\017\271\217H#\205\262~\303(\234=iP\331\003\016\026(r\016\3370\350L\025\026x\203\027\0060\216W\322\354V<\0230\014O\251<\342[H\257\013\240\025\223S\200\017\r\367<\224n\340\373@\0259;\357[\005\031'\361m\322m\"Q\376\326;\330l\224\323)\231\203\260\00299r\0202\320\021&T\272\227\220\317\253\223\023\352\232\371\245\032\267\350\025\357D^-\327~#\033\006}\227\332M'\225\3070s\260x\321n\027\222\333*\356K\352>w\t\257\355\341\014m\351\341RH[\205\332\013\215\007=\345\236\002u@\241fP\341M&\302\237L\204\232*\204;\t\010\227\260w8w\022\244v\311\272\360\311:!L\255J\352$,\232.l\232.<\232.\034\232.<r-|r-zH\255`\322i\r@\341\021Na\023N\321C8Ynk\2120Z,.\240U\321\273~L\t|\264fK}\217\371\374\027\205\366\351\245\360\351\245 C\237\033bS\265}J\345\346\023\242\022\352'i\266\007d\24287\202\371\010\263\"\343c\241\314\321\350\226^\251\366\323TP\271\251\217\225\033\353\340t\257o\307\307\256>B\\\210\241\007%\034@&\321\2073-\341\240\343\237n\373\320\235\0349\036\027\342\342\211\374\231\010\223Q\257\237\2176\375\314\231N4\354'\321\315lo.{\263\327\233/\033\226\367\202\371\324\303\036W(\326 \207\"\357\344\220\224\227\334CX\301~\314\033\203\000\362\351\300\016\001w1*\036\262/\252\233\274\255\303\3512gV\263\265?\266\0015\265\234i\275\257\350\262\224,\\!\361\226\207\345\025\250\370s\345f\262\335""\207\322u\356\341\255.\252|8\2509#\215b\245\371\374\325\374\325\353\371\353y\220^\303o6'\021\024<WI0\235\217&\360\307\362\377y8\017\327\313\212\036k\264\336\306.\230@\301\261\005\230\234Q<\271\036.\222y\224f\363({\273Hn\346\321\333\014\265\356\370=M\371\235A\220\267Z?\200E\372d\346<J\034\037\205O\373\220\024\230\266v\346\223t\256T\177\346\323\350\rz@R\2639\374\373\005e5\360\351\202Tp\347\2131\336\306\220\001\202\224\206\342\371\304r:\266\361\001\037i\313\3432m\276\312\201\237Ze\213.qx\305\317u\000\325\361\232\334\374\344\353}\310)\r\360\223\333(&1\250\364\013\t\322Ea\300Wer\320\0321\013~\246\267j;rS\021\300\261L\360\246\210\220\244\276QH\250\325\334Gfi\224\341\241\024xII\360|\321Q\305\262Q\324\032\311\342-\"\323w\363\321<\211G\327A\022\246\213\371<\233b#\257\246\330\264\363_\346\345\307\266>\006SWa\r\357:C\t\0030\315\300o\357K\265\353\251\336\324ru\033+n\272\334\350yC;\224\240\302\203a\265_m\206\365\346\311x\310\225\276AX\312\370\016\022E\003\006q\237\013%\3261H>of`\321\027U\013\t\032\010G\373\"\214\364\205\r\350V\032lx?\3072\232\217\246\013\274f)[$\213%uphS\345\212\347\213\267|\331\321\342m\270x;}3g]\016y\235\365z\215R\255\365Z\203\233\262<9\250\036\031\234\364\341\003\267\245\2046e\221\224[\rP\235y\020\307q\315w\227\t\351\211\0330m\333\030\210\366H\342\215\207\300-\031\013U\037\016\006\n+]\036\\\200[\237\272_\365\025\202O8\222\236\226\301d\371\035\035\002\2630\320\255$\004\253\034SPZ\362\220\202\275\373\311\337\317e\243\212/\234\022\272,\251AZY5\274\234\254\253\016\336)\202\350d\030z\035\231'\265\301X-\316,\\\252\203P/3N;\207'vh\220o;\247\003\337\032\240\261\243\240\215<\262g`\273\371\251\301\367{\013\302+\247<\220\004?\026.>\266.\344\007\300\233\251<\320\017\302wVu\020\235`-\n\032\024\002F15\214\004\331\370\202\033\204/\377^\326'\017q\026\367\n\243\030\023\005\237E\251F\024\327\274\265'\262\\\276Z~\017\363\340\362\317\370\000\252\030\341eJ\340\240\r5|\247\366F\\p\013#\177\022\331(\272\025\312A\360}=6\352:\306{\331F\3276\316J\303\306e\357\034\004\336j\224\271\037""\262f\3642H\263\370\347%\356 .\345\345X\313\321r$U\301\227#\347\312\234\345\250{\340n9\262u\323\001\352\327N\357xH\375\364\345H\251\240\243K\245:\t\227\243\213\232\317\313\221\265'\211\000\277\227y[\334\217\224-h\306\241n\314r\304n\326\360\223\2451\310.\241d\354\376I\275\2650\002\245\314\035$I\232\025\326\254lFJt>rd\350\000\312\201\005.\034S\351\014V\327\260\376dp\310\207Tm\224\225eF\2043\371VM\301u\244?\320x\365\001o\003\362\n\336\306\230\375,\205\265\333Q\037\0075M6!\263\262:!\313\367|\007\035\260\213\324A\237iK\313[Z\035D3R\006\235fd\326\317\211\r5\333\315\327\032\017\335\202\222\240\202)\224\243\343\252\220Dv\205\202\022\332\003\320\220\261\002\241P\351\241\256Q_\333\207\303\372c'\314\352\2440&\207Z\243K\201no#\203\304\320y\3552:\013q\033eb5.\264B\010\0149\000x/\240\354\273\312i\367I\222\024\301[P\317S\302\235\r\231\240\023\032/%\201\032F]i\251m\244qt\276\267\347[\231)\024\375\204\341ht\217\"\331\305\226\316\030\315\362\326\362a\203\023@>\023l\031\343\021VP\371\367{m\002\253R\211^\360\244B\330!\350`\261\266\032o\373(\275A'#a\275\025\324_[\310\313\005\264\227\206\356=\nFo\275\017m\360\363\362|\310\217\307\276\202t\274\274$\226Mu@\333\005M\313\252\342\227|\244\024\237\275=Z\355\031\007`\004Q\017\321\241\036\272J,\274\032\247L-<o\324x\\\034\367O\036\332\256\032C\210\330\236\221\315.w\323C!\374\345\344\350\243>\\VK\335R\366\344\217\355\\0F\315\3256nY=\324\255\215@\003\247'\207*\032/\22468\210N0\207x\n\233\022\362\021z\037\253Z\355\342\204\331\343\251'M\327\317\302\031\026\220\0218\273\332\325\2010\223*\013a\276\237\370\303\177\342\214i\242\310\332x\206n\304\347\310\273\362\326\315\346~u\r\254\032\217\005\027\237\\\247\006\201\364>\230\245\25198=\2577\252G\223\257\032\366\243s\263\357A\273\324\200OF!C{\272\317\227u%\004\345\212\247G\313\177X\266\317yG\233\235\326\001\340\355P\341\006p\246\036\333\317T\215\303\311x\210\005\217&\205\367'2\341Ld\004%\332\241f4\321\235\321\030u\257?\262\323\376\231\035\366|%\272\363\225\220\363\225s\007\201\215\347\021\251\326\310\227}Tk""\342\031\323Vt\303\251|\\\366y&\006\207\021\324x\327\360\004\356\254JOo\276\025\336|K\232\321g\026Y\3270\027\262q]\366\000\336;\326\242J\203\032\345\305}\351\242\242\223\250\366\252F\0201\313\037\035`^~4\360|\230\266\345I\030Dz2n\266\271,\3436\231\\\235\324[\251cKX\263\010\270tY\206\313\020\025\330\360\020[\030\217\350\270\342r<\233,I\300\266\274N\226\200\264\255).\225\224j\031/#<\354\207\357\321\204\237\257\371\225$\364\246\347\230\375\370,/\272&\214\2372~\231\300{\032\375\274\\\304\260\302\301\307z\231\304\351l\235E\363t\201g\351\336\315\027\2638\230\322}\264t\243\237\274\347p\211\307/\243$E\212\300\202D\010\356\210\266\000B1\3312Y\340\305|\313d\t\177\353\345t\225.\323h\025.\226Y\022\317f\020L-\211\336%\301,\016\371b\346\345\273[T\306\263\314'[N\252\007\003*\276\336\302(\326\336B)>\315B1\023f!<\272\355\372\220\355X\215\363<\375\250\271\003X\010j\354\356x\300\236`YB\006\236\342\210f@\357\366%\211\342\226m\260\\\257\227O\217\360C1\315z\016\203\")\267o\276}\363\352\315h\362f\026\276\231A\013\246o\346o\022XE\206x\360lD\216\030\017A&\301\024\001\247Iq\261\t>\362EGq\361\2048\376dE\222S\326 \273\225B\016A\270\262\311\333\\\271\235\023\347\nI\263<\001\242/\204\260C`\315$I\020\006\253?&\301<\304\337\367\177N\350Zv~/f\257^\177\007\313\3556\031A'\206\262E!\364\215$\036\256\240\000Q\010\335\020\317\357b\267\214^\205\374\016\246\343h*\335tN8H\336M\203wQ\302(\351\263\\\274\215\246\3234\030\242\006,\"\344\241\006\006\322\241td\213\341\342g\345LQx\030\375L\007z\343\021${\013c \222/>\307\0163\246\221\310&q8\211\350tyr\223\334\274\032G\311\r^\244\376z\230\334|\007\177\3034\271\371>\271\371#\276\377\010#\346\346\217\343\344\346O\267Ir\363_\360\361g|`GH\026\351\333d\361\226\357\"F\331/\244\023\317'J\241\025\017\201/\222\030Us\303\004\206pE\017\3320`\027\3643p\250\r\203d5\237D\353\233U\226\005\274\205\310OJ\210\\J\234\313\200\354\013\022RVS\036\362\275\301\244%\360\\\032\262\"RJ\021>X\352\257\335Ag\220^\"\302ID8\211P\027\202\030\tE\234_R\356P\313\262n\264\303\234$\320(\007\320\246""\007\025\254J\255\021\333\2525\000*\026Q\214\243\272\334n\253\002\231\032\321\343M\245(\312S\337\247x$\262\213us\205\265\031,\\\330\tpjJX\020Z\321\023U3\240W\2756\236\323\033WmO&E\177v4zE\202\016\307\003\000<S\006\363l\363\226n\336q|;\361\254N\006\344\006\364m\300\223D'M\203Y\204?\377\\+\343~I\0035\010\322\340mJ\n\221\244C\277\244\353\336)\250|\251\363)\036\310\203V!\345H\366@\025\346z\225\320\003e\212lc&\215F\001>'\014L\034Z\213\267\272\343o\211\372\347i\364\006\376H\373\375\r\253\271J\207\324\226ghv#\321\250-\257\302O%N\2274z3\344\210\206\372\023Tk\245\327x\014\371xC\032\362\352-\375\224\326<8\371y\303\221\260\326<8f\014\2472r\231\260I\025\357\347\245\375\274t\234\216i\253h|uW\344\242%\365a\005D\307\r8\345\366\206t\341%\021\330\332\004\313cX\352\3023<\312\276)7\3232\337b\274\036:\201%\222\205\226G\275L4\312|\034`\344\210E\227ue\230\364\277\332\2260\373\006(bT\2715\030\3162\337\265\250|\031\222>t)\312\351\236\235\270\257\\\261SVB\203k\346R}\311\020\177I\243\021\336\362\362\\\025D\202\034\306\035\242\214P\311\261\226\307\007\232.\031\224I\322\010\2027\016\235\364\032Mk\320\2633J\256\261\021i\322J\247\361\010B\301\314\206?}\014S\255\001\034$SQ\333~\037\272\351\374\240\215P\246\374l\034\322\207\264D\023\221.D\371v0\252\t]\244jE\027\253\230\212.\332\034\212\354\361\353\246\351Uv\307\263/\025\361L*\2427\025j\2259m\221\333u\323\277!K>\326\206,\302\213\273\337\354\017U0>\272`\373\364\t\316\t\337s\360\235\361\356\322\317\306\251\346\264qP\002\033\324G\331%R\366\027\206ts:\242vBX\255*\017\310\023KY\351\245\236\362\321\2623^\320v\320\252\377\366\234\206\367\321\346\310r\217\217\256\017\222\344k\227\226M\352\006W^='\230\225\3278H-\201\267\215E\021\202\235c\300i\023\312\016\316\022)Xx\226*X\010K\202`a\225\310\273\007\205\222\361\0364\220\016\205\264\373\201\005G|\233\260\032$\316\266=\366U\211\263\017\\k\234{\324Z\241\235\336\305\333\005\226\023\345v\347\246\324\221\270d\304\260GT\305\346~%\345\tK\366gr\016\276=I\340\265\206\260\256\357\240\371L\270\002I?\307)\010b\354FUC\004""\235\313\221\355\2546\2727\250\241\2177\347\300\3020?\340\035n\332\323\033\375D\356\234\221\346\357V($E%\242\267\032\266\305'.R\321\020i\370@9\225\345\003\037fR\243\261=\025\225%.Ud\034\177\247\213h|\272a\255\014\271\251\001wi\212\204\347\327C\013\260\372\r@\263\261\002n\343\370\230s\215\225\272\350Z\203\215\256M&,nJ\313f\3525\337@>\007\253\0238\366\031\010\303\263:\272\304EZ&\372\351\223\270H\237D?}\022\232>\211\313\364I\\\246O\242\207\352\210\013TG\370T\207\021,\305\264\021\036\031B,\3369\250\307\245\306\272S\255\255\261\343\303\232\252\210\036\252\"\372\251\212\360\250\2120TEtH\210\203\201Q4\272/\213\017\312\347\031\372!z\351\207\350\247\037\302\245\037\302P\007a\250\203p\251\2030\324\241\313\030\330\276~\325u\310\206\360\311\206\350#\033\302#\033\275bd\327\247\207g\270 \010\366\374,a\227\343\323\025\377j\357\016\005\023\035\n\306\3461p\274\234\217\232\306\010\217\226\211\036\n%.R\250\016\217gsv\222\333\326.u\272\304`4\365\0226\365\0226\365\022\016\365\0226\365\022\275\204Jhn\202\330\311\305\350&\312pU\271H\320\346\035Z*\224\307cI$\275\014\323e4\212a\231\n\257,\301\367\033\024\317b\377\033O\3234\215\3611\233\256\321R\004;\222pN\216\020V\250\220\255,\230\300\017\205e!ZeH\263\021\300!,\370\340\271Xex\260}\201\313\341,\211C\222\177A\324d\326\0165\037\247\357\214\261\007\205\215HO\022\241\031-\307Wx\016>\211\177f\307:\205\010\246Q\234\002\270\034\311\205\345j\010\313L~v\2262\022\373\213t\370:\222\210\206d\200I\036\301#\225/:\350\236\256f\351j\036b\345\244+XYOW\362\265FQbz\033\246\250\345\227\276\203E\256.\203\266\\\341\236\023\227\370wk4b:\017\246\032&\003\027\010M\337\240Vf\372.EA>kI\361\223\232\212\027~\352\244&\232\001\263\234'}\245\231\025\226\255\027(\000\265\013\265\333>\365\251Yl\t\302\242@9\325\\+A\341\344\301'\323\006\353|C\003@\002m\035\354\367\006\300\243\215\n\242\236jo\237\332\333\245j1\316/i\351\013\257\034\304ks\352\255\205w!\332`\275\024\224-\352\033\024\335\234\242\001[H\340\334j\342\345EU\236\004\325\305\3346\254\322\3073\0145\336\356KG\322{\002""\330\031t\360Rw\303\362sC\312r*Yy\327\247?\001\317\263\233\212_E\n\205\272y>n\261\335\032\253\374\222Kv?\325\266\350-\\\347+F\320A@\013k\037\2507\330\236\352d\006K\002\302k\014q\241\256\3053u-J/\344\205\272\026\317\325\265\370T]\213n]\213\236\272\026\275u-z\252V\370U+z+\221G\247\004h\010\226{\310\301\337\317\310)\022\237\201u\2535%HaC+\016\332\n\334\216\316\2661\251\316\242\273\216\205\365~\223\3466V\315j\006\271\224\326\305\321\016\256\027/]&\301\267@Y\270\375\323\261>\0003\310\006\313\265G\212I\036qW\352\250\363\315hH6=\337\t\304\010\033\257\220\306\222:\305\330\033\\&\326\371BW\227pk\305\243\241\275V\323m\254W/\342r\275\210\236z\021\227\352E\364\327\213\270P/\242\247^\304\345z\021\375\365\"\274z\201\236\250U\357\311\032\217<\024\343\335\260i]mh.?\320\326<\322'\001\177W\264!\212\216\235\276d\000\225\327%\346\026\2307\214\311\201\210\227|\"\335\343\350\021\246\244#\036\336,>`>\236P\005y[\323\371E\002\304X^i\267a0\326\227\307\021\342T\237hU%\365\310%*\255v\360\221\215;\213{?\234\272%nT\311\221\372$\254\213\022T\031\304\276,O\344@\355!}~\2320O\307b\274\207\230\025@U\221\005\013\370\013\2463\322\005\002\347p>\232H\247\241JZF\313X{\r\n\030\245\203c\005\272F\213$F\214\013\030_\262k\241\224a:\313k\232\366D:M\365Z\244\037\333\367\215\021\027\333@\267\020\256\\\331AH\r`\007%mV88I\345\\\244/g\351\370v\223s\307~\307O\225\262\343!;\033.!\247\345q\327\336wB\350\232\272\354s1\366gJ!.\224burQg\201a\222\032\226TG/4\216m\300x\226`\001\323\327\344\3175xOg\312`~S/\316&:M\023\022d\032\217@\3230\004v\232Da\325\0021+\017\247\275\025\235\350|O\225A\200,\253\364w%\360\200@\036Tf\271O\026\217\350\202$G\262\262\010\201\242\007\335\251\t\303\253hk\014[X\274\t@\317\030\026\336j|\205\222#\331\302\250ak\241\354~\325\301\365D\252\032\311B\271\313U\362P\355\343\010\377\0216mE\242\177 ^8\20107bp\262~\215\371\\\tX\024\216\300d2\017\363\303\251:\356X\327\317\302\373\321\232\3324K{\343\345Q\224\236\375\001\211\305\033?\200<?y\215\263s\306\266\r\322I:FY\355\301\266N.\306\345\311\267$V\265\236\312""\203\2076\021J\0174\244\314.<\357z\375\255\003\270\236h0KB6\325\225<\177u\000^\264+\021s\003\0309\274\302\233>\276s\351\227\003\007\307\215Wu\256\211d\205\364\007\222/\340vpV'\321\303\334\005\255v\321\222\"\230\236\317*\367j\030;\322j\2050\2613\t\220@w \034L\035\210\236\356.\334\356.\354\356.\334\356.dwgI++\3726\325\243\345e\351\\X=\255\353\331;\272\273\301Xo\303\362\343\375\242\351+\251/)}.\215+\307\313\302\370#M\364\2164qq\244u\310\2717\257\332\240jc\341\214=\361\314\3303Sq\326\234\005j\255\240\026<\304v\326\336\335\241iI\236=0\004b\271\363\221\366\360\025\227\206\257\345aS\\[\310\335\312\216'\354\361-\234\361,>5|\305\205\341+\234\341\353\261\037\227\230\216>V\243#\305upV\347\366Ji\217Z2bA&\333\2606Q\027t\341\212h\025\302\304F3\266\221\306J\240;>\331\276\0008hb\037\275\231%xaT:Z,#V\333\311\242,\221\227\200dc\364\036\247\331uv\035eAv\035'!=Hq\222L\330\343\311\366q<\315\360\006\026i\321\236/\334\230\342\233\365\201\264C*\006e\030u\262\212\2624K\203\344\006\315pRA|\005\214,\rcV\000\314R\373\336)\200\234K\234\2624\326\034I\032'\263,\265\224H\263\3242\274O\200\356\271\251\212\234\237\300\312\340=w,[7`\312\333\177\302\301@m\033\220j\324\200\0208\353UL\000,\211\3472\255O\020\2776938\223A\215\353\t\326\023J\241\226\006\347\024\276\007)\325\334l\257n\304\026R\2354\350\365\244t\231\021r\225 4h\256c\302\306\327\274\021kE\330]\201O\372\342\301\010\332\253\311R\2133\352\323~PH\241I\2410(\334\352\3335\320YX\313Aw*\326~\340\267\333\301\010\243\t\207\032\232\302\367\300\336'\221NS\022l\325#\302\236\267\353\213\274\211rXt\311\336\2507\020\367y\233\341P\267d\222A`\031\320\357z;i\230\235\273\347\216\315\262\333\300\203\211\327\031?]\276\303\333Vg\330kZ\334fw\372\036#\334b\333\rA\212>\332\245\266\025\r\306\257\026M/\035\350\265\006aL\352\362\320*\263:T\252n\020\226\263\231\206\223R\356\021\3130\331}\331\346\2263:nN8\276%J\307\215\256\364\224\373\235\204\320\272z-\312\2557\3773y{\014\355A#\204V\3042\275\341\236y[\357Y*-@dM\376\033\361\376O\231\334\213\3477\232f\226)6\365~\217fg2\336""\242\347\2015\316\241\365Q\366Cg\265\034\237\363~\377\204\026/\360n[\307G\346S\370\203Q!$\243\220Z\214\\\337\336\277B\272\243S8cQ\310\261(:c\321l\357\253\rg\371uw \022\022\242\227\262(\013\343\264\000\"\275)\304g\263x\327\335\036\324\302\033\324\302\035\324\302\035\3246\270\314\364\216\271\333\265\3156\272\323\373\2043\350\205=\350\205=\350Ew\224\013g\224\013{\224\013\177\\\213\356\270\026\336\270\026\376(\026\376(v\021K\215\341\303\205\235/\031\335\371^\036Et\341n\312V_Iso$\010\207$\010\227$\010\217\006\010\217\006\0103\336Ew\274\013=\336\205\031\357\026\244\353\327\357d&\273\3040\010\311)\010\376\2008\260\267P\352\014\303\255V\301j6\306\235\342\325<\316V\363\233\371\342\355\\\276\326h\303\\\271\307\301(Rno\223X\243\177Y\315\247\361,\316\360\200\210{.i5\247\215\362q\214\316U\032\205\275&\216V\313\3252\014\262\210\356\232\223\327\005\252\213\002qK\031~k\274rn\235\241\271v\204\342\371\"\214\322\325!oW\017eq{\033\314o\264n\372m\314\026\230\222t\232*w\212ne\353\3416\273\201\277\365m\226\360+\345\327\352vu\013q\225\005\367rp0\355\252\303Y\030H#\\kx\257\351\3741\356\035\270\220u\211Y\007O\326\376\001\253\254OK\247\264>\355@\312\3724#e\214\022\260\242\251\254x\032\355\316\357\004\275\272\354 \241\245%K\313\315\326\250m\004\364D\002\3336/\356\331\362\027\212\371\t\367x\272{\222\016~?\235(bm\252\232\000m\252\232\352A\336\365f\234^=y\267\275a\014h\336\232\336h\271\305\315Ba\366[$\310\006\260\031\340\\i\363\307\312f\365*\014\214ek\203\237\334\327d\265\320\006u8\203\277\216\227}_S\373\262X\314 \321\360\275\006\244QD\2751\376w\013@\363\016\033+\2630K\035\363\321\264/\241\236,!\212\353\005q\222\257%g\335\312\227nWp\313&\005\027\256\330_\223[\2353C\200\026\306\344x\244zG\346W%h\033GV0\265\230\004FSI\317y\022\324\330Yy\3600o\316\345\271tq\3200\016\"\234I\007\265E\234J\010\257\207\264\203\221eK\345V&\210m\3304\2131\353\2136\257$f\261\335\262\rU\361Aa\374\241\3221\261\333\213T\021Z\351\223\345>\345\246TMN\220\202H'\211\336l\267p\000\313*#\341\261:x\251\355\201\272\231-\234l\356J""\250aZ\t6#H<\037\277%mb\000\245\273W\207\220\373\016\276u\254\010\310\350\016\371\243|\321\366\350\307J\224a\365PmJ\211\345\244\016e\316\037\312\357[\025k\353D\333\232x\2172\033\370\326\001\020\260\374i\233\020\001iT\226\234\373\274(u7=u\363\244Q3\316\271\r\007L'\r\212\2235\360yO\331n\312\242:5\262K1\373\253\223\224\326b\275\256\256\260N\327\226H\247\037\333\306fM/\221X\247\347\220\255Yrp+\332\231\020\336\360\024j\020\271\014\246\304\350\201\203\214\3352\326\004PtF\211f\366\034\300\032 \332$\252\004t\277\027\246\237\023'\2422\256:\274c\211\324F\010\007\220\006;\373p\335/\273\030o\000\221\341Lr\374\275i\345$)\350\322I\276\224\324\300\262\263H\200\273\005\003s\331Q\031Ju\243(\020u\262,\304\231\003\313\327G\256w5\034\234\321`\r\006ek\023\335\310\260\341\373\243\032[\226\025M\230/>^A\277\003f\024\235\370\203\304\351\0316\371G\352\r\004\251\253\220%D\027\"\263\033o\3505.3\017)\004\355\261\324\347\223\213\242\245\0170\224\026\326\030\226\353\372\235\352\223\037\t\240T@\332X\262|\316\342\276\023\032p\027\202\013?7\324\355\310u\025\244\2438\226\356a<\017\222w\022\010\223\340\255t\262\276\245\001\026\253L\002\371fC\021d\371\235\3040'\0025\253`\253\266\324\365\031V\222\362\346\214\n\367\021\034T'\n\323\n\206\203\210\027\016\206\227Hn\302\300\3012\254\346~\206\266\250\304 \335dh\313)\004\251\235\331\335AaP_\312\302X\235\244#\215\361\321V\235\313\t\317\352\212z\316c\010Z\236r\224>\035\213\373\006\326\225\377\200\361\355z\231\314\002\306\311\310\tU2\266v%[\230\276\030\241&>\351g%\007('=\213\020\333%\022\235ZE\212\013\255J\014\252\306x\365,:\365\354\221g\215\354\253l\321S\331\302\251Y&\264\322}\276\303\373l\375l\236E\2510*\271\007M9,\243\212\262\267AE\274};\234\275\215\347\341\342\355\333\004\326vo\177~\3673\255\334\234{\246\201\211\317\3635L\377\371]\221\337\325D\\\325\315e\371&?\265\323\374\256\334\223kF\246\343\310\211kXk\220\241rj\271\337\2073\322R%\033Y\327u\375\241k\273\316\327b\355\336_\213\372\2543VjU\372\252\275J\255\2262\253\272\274\014\336s\326\374\002\0279\340\235""\302\027m\256\035q\252\234\347\203\324E\200\327C\276\371-W\246\260l\271\276'\324\267%\372\2668\337\222\345K\347ZP\370*\377M\337\233m\3378\244\334r\361\204\340\t\262\215\272V\371\376pX\267XW(1\243\307kz\256\267\374:\320K\344\320\302\371\001u\372\363#tKh\306\343\261\306] p\325\371\251\200%$\374\275>\225\255@w\321>\362\242\262giI:@\346\002\311\316U\222\362\022I\373\372\310\256\215\301\036\003\203\256u\301\274\331\301\237\310\221\363\201<\322\213$\232\333\034\227\313\214\370\230\213\003\025^\256t\345\033fL\265\274u\326\275\326\2327\027\374\035P\213\252\206\245d\303\2528\002j\344\021\365\312Pl\352\256\210\001n\362s~\206\361\322\360\023\025\336\362\363c\376\000\377\367\264X\306\251\033\027\311ww\353\207\262\270\203/\357h\215_\177<j\307z\017\3057P\203E'P\343\r\352|\222/\343\tn\351\337\000g\320\334\345\242\274#\303z@\360\356\n\034@\342\256\240\276~Wp\3676\307\310\325\031\362\273\242\340p[\016w8\335\025'\016\273\241\001|\267\331\363\213n\302%%yz\254\261I\330\365\201\235@\000\252#\014\250\235\226\t\334U\020\215\342Q\311\261\026\312\305\036\004\0367\315]]\357\327k\365TR\204;\266\027\367\244\336\324\273\035@\334\325\217w\342\216\242i\037\357\332\247;\n\322\376\003\206\007\217\020)\204\370\350\334a\355\334_\355\\1\017\311\003\010\355/\300\005E\306\337\272\311\371%\356\240)\213\002)\026\322\244\002\352\257HQ\034^ )\3509\n\\\320\300,h\334\361\363\265\243\245\204\367b\354\327\364,t\323\025P\345w\000c\335\026\272\372\n]_\305\235(\270T\205\014\004\021\356\3511\247\313\364N\002\000\310Z\261\253\340\201\253(ld~\010j\357\302\022\246\240\273\\4(,'\0217\301\324]\244\013?\001?\250\022rT\307s}Fg\275\256\350\371\033>\033H\251},6\337\026\033z\227;\230\031\350\005\371\333\220\246-\274N\355}A|\313\231v\270\013\226x\311\327\032r+]\330\210\305\246:\340O\300C\300\222\357\t\337-=\260\n\301\361\200\325\266\201@\224\024%\204\241\353-\376\320\2017\311\027\033\nE1\226TQv=\201[\331\026D7D\006O\310\007<\005\325!\337d\037R\316\301\335\324\350\211\037\266\371+|\274\306\307w\005P\n\001\344\262|D\377m\201""\204I\340\263\345q\305O\244\266\306%\330\t\265\200\256}I\017\031\004r\211\217\365\t\367A\300\331\010\214\350\261\330\356\363\035<\360\007\323V\261\325Z\314\305\366\014\r\267\343\212\333\345\207C^\220X`X\220\3518\352\t;:\221\2411\310n\027;\001\355\357\250\311\241\004\256\250\212\352\016o\014+\340\263j\363\210\277CQ\355\216\270\222\315\241\037\262sqna8\225!\331\304,\252\003\304[\300\320/\037\361IU\212d\021\036-6%\357A\025|\331NQ\201\247H+\262\201\212\000\264\021=\021\215\023O%\250v\310\001\334\022\274\232\372#B-D\010\237\313\276\n\004\246\300isM\211\177(\200|\024h\211\033\230\023\351\000F\024\230\210\203\004\241<{m\345\253\300a\206\354\275'md0\325\234?9\370\304\0009\211.JV\300 h\365I\240\355\245\260G\370=\224{~B4;\360\206I\006\346\2615\362l%\022t\300@qHBS\375\203\312wM\232B\n\005\215\203\333\372\360\020\347\006_\300\277\025\030\031\366\360=u\244Cq\200\031\034&xp\302\240\200\237\034{\340\202j\243'y!\227Q\340\220\201_C\233k\350b,V%\314\t\305A\354\212cA]\022\037{\034~\320\313\2164c\024G\034hG\331JG\312bq\304D\217\030\355\361\370\017\246<G\236M\212cS\327\370\202z\201\337\020\211]I \233mC\027\316X\370\0161buF\003]\313\246.\310\201z\364\244*\217\000j\311+\350\001X\307\202\371G\371\272\206\031\021u\355\2364\232\030k\t\335\003\223i9\341\333\273\337\n,7\332\031\002\210N\203`\247\004\362L\263\0138`\210\022_>\242\205\230\205\010y%\006\030d\004v\360n\350\211\375\371|\300\352*w9Q`\"\300XJ\370\341\220\327wiI;.\352\336JhiVzP\n\253@\217&e\215\034\322\323\370v\326Ucu\254\277\364\351\263\026\235;\355\025\346\261\3055\274{W\275g\275\302S\204\365\300\021\027A\237s\326\001\244fXG\007\245\243\200\342k\237\370z&\035\275\023\205 b\343*\340JpVc\236\2041\257\341+\340^R\310\355\252\256\\Rf\351\352\245\\Vc\351\321a\361\264~{5~\355i\032G\2767S\353\211Z\316\3235\014\307\335\231L6\342\324@}Q\356\222\200\003F\244\316\215\325q\344\331a\222\010\216h\336S#E\317\365zn\340{F\345+\253\345Y(f\005\210\023\200\307\003s\003\306\022\257\345D\263\014\026\210\203\207@\236\017\321%\237kA7\301J\240\245\233_\213""\032/}\300,\237\236\360\007\024\032\237\025\362\"\247'I-\300EU\242\356\214(\310\334U\241\017|\363\014\t \277\201\242\221\245\216\002\227C\364\200(\316-\264DQ?\260\241O&_5[\211-\340?\037s)pn\006\022\260GG[\340\322\250@\031uq\252\340oC\304\362\364\033\363\322\222\243.\330\350>\274\310@pq\"U\212\342t\246\025\014\274\333\nH\355\3379\307\222(\303\032\350CA\372(E\303\314^C\232\016,\r\322\327\267\332\367\272\366\334\351j\311\251\314\325\256\322\225\013`\343,\251\225t#U\226\316\372qV\212{\r\244gZxY\270'\3547r\307m2O\215\013\005\035(\376\350\333\215\2238\236\314x$\313{f\221,S\265\307*\252\032\346\n<l\177\276;\350TG\212\334J\350p\202Z\202\221\023\316P\002\334\177g\255\302\252\036H\323\207\224\317\245\352\366Z:;\344\000\351\330\272\331\326\273\344\326\275\340\326\310\372\372\314n\365\331\334\222\270\307zs\026\266\333\255:\226X\224\205\024\212T\252\003`(\254\374)v7\2151\337M\312#\n\t\254m\316\276\035\317\236\023\2736*\253\3479\335c\250r\313\350\333\262\360@\\\321t0\234!d\202/{\311\222O\016\252q\235\353\201\215\274\264g[\366\322\275\301\275w\006\253\373\202\225\2253\335\351\264\341\016\005Z6;\034\223h\372\226a\351@\316O9w\r\356\014\272{\304\235\035\343\016\302\253\237>\037\241\005\304\226\244X\335\360L\302q\005\320=\334M\365\250\257\177\326\016\203\244\275\003:+\177\247\272\211l_\235_\003\353\034\343.\221}or\357\035\312Rl\215cW\233\270\260E\331]\345Le\017R[:\361\2568\262n`V\026\355\234\363\370\27570;\347\321=\013vzK\336\336\216\227n\332\276\321W2\207\263\316-\316\336u\315\375\2677{77k\271\275s}\263{u\263\271\266\371\222R\200\247\020\340+\0030\274\336=\250\026\204\205\205\323\243\327U\267K\257\367&\370\301*\320\272\361\233c-\316w\2606\346\232\222\267\307\032\227\234\"Qk\020\030*b\235\021:b`p\354p\231E\253\267\006\027*\370X\177\273\266\000\\4\210B\344x<\340\037X\007\371\036\237\355\241\020\270p\304%\252(\221\331\206\344\305\266\240\035\275B\310\265#1\347\370\200\030j\236\325\305\tg\220\251\\4\025\242)\004\036\220-x\272\245\247(\350n\241\202\026<\002s\"\344\242M\320)Yf\023\004\335""\241S@\341\213\366Q\340\233\016\344\252\"\212s\001}\002\336\304P\027\342\261h_\025\355\353\242\315\357\360\007%\240s\274E{\017\365p_\303\010o\345\256\0258Z,\020T\034\254\256\365mz\340\242\323\311(Ai\037\277\205\337\375f_PV\316\233\374\2366\220\213\363\t\330\214\342\214\266\347\201#\204\267m\306\247\200\254\340\217\034\220'l`Z\030>\360\261\335\342\201\244\376\305G^X\362K\024h@\215\212\274\331\254+\261\3117\371\001\365\tr\324)\330\344(\250\201\274lJ%\336\337\224w\347\335\256l\370:-\\5\301tF\223\023>\311@\215}I\327\206gQ^\211\252\213\227\340\335\346\353o\371E\353Tr\240\374\000fV\022\025m\350T\202\334\347\222\257\336\351\3439?!=\211\330Kw\037\215}\306K\364\337\rf\t\2626h\341\006\362\016\203aS>\300_\014\361\301B\237\305YZ\274eI\267P\272\342\334\311\256\2005\t~\326hm\226\237\233\nE}(Q\204\301\200\362\260M%y\331M\245ec(\025S\2221c\226\323\270\270\210\032\234\3503\322\006'\357A\350\030\365\264\021\235\257\300\177\302\327\202\331\250T\241\036\244\322\033\313\3526\3735\217\210\315\376 ]F\023\256\243\005\267\331\253\300T_\207\315!,\333\315\2018\027\350\247\207\305\036\0372\323\207\245\344\3067\207\254\336\360\360\335\034\330N\031I\010q\351\2759l7\007\222fo\240\026\017\342c\336\250\220\370\204$\353\002\037[\370\373\026~\257\340\367\032~\337\2418q\003\243\215%\212\233\272UZV\254a\245\264\253P\210\257\305\372F\242\277i\352\023\364!\301I\021\005\331\264\033\224.lx\311\201\022J\022P\322\003\006\340\272\246U).\013)8\177y>\034\236\264\362\026\312\r\313\022W\363@\031\271\024\245\274H\220_H1\017\242\204:\300\215\016\350\203G\034\245%\016\257\r\311\356\361M\222{\255\224g\311:KV6\300\327\023z\234\017\257\2210\302\033\225\343ad\303\037\235U+\377NI\243\032\231:d\265\266\226\227\300u\025e\3230\351jJ\324\256.\333\034\205\247(;E\321iI\337\003\265*Y\311\272To\244\223%jT\323\243BV\255|,\013\245-H\242\326\362\361\004\177\020\371\226$\256(p\345{tG@nK\361\341\211\241x4\222\216\351\212\035\352=\307\002U\205\033\\\"U\230\364\351pW\357\375@\n\253\343\326\010\377;\005\343\376\033\254\252 \227\325^l""\313-7\253g0\327\261\226\273\205U/\t\330\266\312\266\211\226\036\03312K\340\326H7J~\262\377~oD\310\344\242U\344z\007#\342h\301G$\311\220\300\036\273\300V\032jPo\"\033\2114\262\000\310\315/\362\272U\022Io+\374\253\224YkX\332\302\237\274\242::\234\332'\024W\343\357\025>^\343Cl\367\200AwuBM\274\226\004\331\244\274\260Eq\341\026\355\333\301\343\203\021mo\245\305:%|Q\260\022\244li\357\036\2368\215n\371\312\333--\270\267M-\037\264\277f\\4@-\220\206)\303\306\307B\236O\352m\371\253\335\267\355\371\210\302w\250z\375\244l\312w\276'\027,C\304\026z\366\026\306\355\366\343f\267{\275\337\345\207\035\366\000\022\327\357\362\346\016x\2245\n\215\217\347\223\002q\272\336\311\235M6\225l\231O\326\266\223w\264\215D\317]\001\323\312a\207\024kGk?\334\326\205nD\217W\033\263\364-\230\257\364\217\212[\307\304\321\271p\317KY\232%\366mn\350&V\210\034Hs\265#\330\357\321\255\266\310m7\336\321q,\356\353F\360m\213\356I,}\014\253\327\216\255\322S\225\027s\342K]\323\003\223\267\177\265\234u\276\275\357l\273\177\256\035a\224\212\330\271\246+\275H\\\240\324b\245Q\"\003nk[c\326v\013yc\244}q\344N\337\352\365\244\362e\201B\301\220\311a\375\250 \241upQ\207v\342\036\347\356\252\344\272\352\270\276*.\302\313\025*R9\n\271\010\224\270\223\251zJ8\353\240$k\320\301\213.\206\250\201D\353\230\302\231\356&\014\016\237\220\272i\020\001\025W\034J\207^QJXV\233r\322R\\Y\0243W\264\332w\263\3221=\\\033pFX\376Ov8\tDa}\374\223v\352\316\201vd\224qd\2621\3245\240\354\336\\\350[R\226\260+\1777HW\366\316g\016K\371\262\304\275\022#;W\277\2414\337@Z\237a\264\013&\033\272g\035{\215<w\3557\354\354{\327d\315j\260:\3700\033\265r\260\314e;(\335\\=]\316\355n=]\315C\341\316\031\241\033\324\340\366\217ozg7\021<7\300\352\264\326\021NRP\307G*\357eq\r%\031\310\221\241\0314\253\252\373\330tl\271}O5\244\273\367^\272\227^j\303a\344\200\245\223\242.,\241T=Y!\246a\240\235\362vuX\367+\224\026e\020\002\370@\365\226[\232\004\"{\256\0354\300\330\251*J.d,'\021By\0072[6\263\355\233\331n\321o\035\234m\370\341\023XLE\205#fte\262\022\302\010\244\246""\254q-a\226d\357~;#\336\261\334~3\344\375'u\273\307t;\226\312=#\345\236}\362\036\323\344\266U\362\216A\362\377\227\275\367x\217\342\330\372\307\021\310\030\214\000\t\224H\312\022B\004[\002$\300\351\216\205D\260\261\021\022\361\332W\357\240\014\322(\264\022\\\207\273d9\313Y\316r\226\263\234\345,g\331K-\347O\340O\370\236\3179U\325U\335=\"\330~\357\373<\277\337\363H\323\335\325\251\272\302\251\023?\307E\030\217\302\220\207\021\310%\377\251\245s\013\245H\215\311\217\032J\216\2521\013\365\326^\026C\370~\261\030\212\025\261\023-\314D\275\313R\272\r\234\350\002&\356\222\2445\232\2415&=\253.\362,\207X\313\023\026\273\340G\215+,\303\261/.\336%n\322Bf\217\307o\017A\267[\207\016\215\325\205z~\217\032>Q\007\277\004tJ\305\302\350=\t<\301\021S\231;\343\301~@>\324\261\342:\214J\304\302\315\tA\350\330\000;vE97\206v\005\267CqvKp\033\227\33566\265\255.\3247\351<\201\014\346\303\031i\014\305Qfd'\366\335\t|\267\243\336\355\220w\354\2173\014\335\003\022%!4s\211\246{\234\206\235\341\202\364h\214\005/\221\362\265\365\205$\3571\227g\253\334B\207\337\247\226\231\225\265\313~\\N\301\203_r:Y\271\301\347\202\014\21765t\210\201j\024\235\247\t\273\336(\244/$,\341\243\037\222\301\201\013\241bA\030\305\200\034\305\002\034\241PF\273t\222\005\310\035F\r\320\341Xz\353\031\004$\033\nI\355\337\375\302\354\004\205\322\t?<\030\246\035\276[\261p\274\2753\315#\237\367\325\344\344\375\237\330<\253\217\024\323\023x\340\360\201Xb\206\305\202-_\245\013\005[\321.\020\235\253\003\320\024\233w*\232m\312\3161\345\246N\260\332,6\241\202\223\207J\307\256\271\014\277\312u\353\231H73\305M\340\233\275\037\\g\255\341Z\233\351F\307\251#<MH\257\001\213\\\\^\017'\226\216f\225\266RJ[\371\244\303\311\244\235,\321\2214\322\241\034\322&\2014\003O\250\312\013$n\305\254\023\221\204\023R\020\337\t\3105\271\234Z\224s\026\232\274\202\275P\355\027\202\232\26701\002@\214]q\273\3420\273P6\303K\327\275\2059\205\333?\312G\n\376(\300\327\320Y\217x\273\264\342\r\247\326\027\365\376\235)\373@\310P\260\257\017\036,Xg\344\300I\256a\345\325""\220\224\032\222B#H\2441'\252[\016\236L\256\231\004\306*\230R\206#\366\254\321\311\361c2\032U(\231\351B+\264\254Rr\016\316\313\221bu\221\"\371\"\006\361\344\257\324g6$\277:T\243\307\251\261\215\013+\3072\240\014\202\211\215\263,\373LH<\r\253\253\3441\033JV\016US\362\016K\006F\024\257\000\300\026\001_s\203Q\r\226\263\013\352l'S7\261\252\341\240U\235\264IoEB6\341\252\334\220n\360j\244@\304\204h\220k\264\304\\\311\203\306\214\231(\256\256\2255e\316\311\377\351\246\177\027\270\352Y5\240\357c-\234\006:\310+\027\307Z\343\026k\241\204\017\204\271q\2174\247\312E\302I\350#-\036\006\007\316\305b\305\324G<E\303\360\277\026\264M\200kc\201\332\270\2106r4\245\211\013\355#\345w \234\206\250\256\023\377\343DY9\2407!\004\034\027\376\306\305\2761\3007s3\001\357\2508\005$rT\033\315\212<\320\366\\3}\037\314\314r\356\007\331\245\211\250u%r\004\201Jd\007\247\210\301/\234\222\207\251\205Y\3414\265\267\233b<\037\314s\225\226\267\344\227\225/\264\035g\276O\021)\033\312$\002\321\203\002F\3757;\372k\224\177\000\3579\316\001\2269\177n\306\222\273\215\207\200J\264\251\"\272u`\267\205\375c\303\000\205p\017#\230\207\221T?6h\020\366\035[\265\024\200o\264\371A\025\315\032\354\251>UG\217\027\246yN\204hd\200C\342\000\021EP\210\\hx>b2\314tC\355\007g\024\202\264\034\310\334\037_W$\307\204.\333\361\200\262\277\"\356\\\326\2010\216.\216v\024Y\334\305\024\347\243\225\225e\326\357\251=U\265\tVU\333\231Hb\323$\2410\371\\\017\343(\004w\004\224\\\341Ujp\2460H\023\307\305.\316\350\021\242:UC\267\304\2416Y\220MVP\255\003\335\304\007\353\311Eg\361\342\022GO\302\036&\013XP\224\023\235.\203+\201\260\326\346\320^\026U\377\231\341\250re\353\204P:\027\224I\003\2453@\311V\271\006\2053Ai\374\002\275\345\2766Ih\r\272\201\331\031\036\177\020\007y\020\201\372d\304\361)=\251i7\370V\345I#{\017\024\245Wh-\262\247\356\226\021\251\200\313]\010s9\"\212k+\227\037-xp$\244\275\307\313k/\325s\330\200\342I\230\234\035Za\241/\204\301\031\\`\20691\\\363\306sb1\346\224\227\235,P\256\313]\350P\236\353\226\341\331\226\347\003\270+\373""\030\323P\216=\022\004\226\222\333\010\311A\374\306\322\034\255Ds\312\373tN\363),\355\263[\016\377\"@d\316\233\235c\017\2339\024\254\3639\374\316A\266\235|\311\002/\357\246\224\234\273\t?\244\371y\270u\314\303\245C\314\277\312\010<\237\364\350O{fF\361\343\251\204\2310\336\212\210&\271\304\360K\323\2306\274B\323VQ'\332\343\201D[\261=\317'7\274\351\371\351\305y^\377\347#\276\201\363\242Q\230\327!\002\363t\031q8\252\232\013\364\000\232\017\363\250=\375\257\315\343\013\020&\201\236[\232Y\232_\231V\036\006\363\257V\326\330~\2750\271\260\220\\HN\277\220\260\231\005\360\352\223\374\273\2008\200\005\366\367\207\227\366\302\364\002\374jh\263D\377k\236F\363Y\240\027/L/\317.Lo\323\037|\372\246\267\351\212m\204\"Nos(&UvmA\214\275\013sA,NL(\316\002>a\201\356\233\\X\234\246\005\201\027\227\245\205%\252\030\3753+\2664\263\315\361:\364\346%PQ\332\362\\N\251(\263\324\024\257\336\354l\254=C\202h\177EA#\341\377\034\374\303\261?\340XU\020\320B*\3161\000\242\211\311\022\200\267/\254\313/\255}2\230\026L\226\200`\317\261G+\017\267\224G\023\030\206\221`\3172\232H\341\235q\331\362\300yH/\237\023;\223\224\312\002\266\220\nL\331\013J+#Ns\362\313=n\001\3519\016u|\340quDO#aN\362\313\352o\255\013\227\"\213\265]`\177o\274lfA\374\304\027\304\223namyk\301\023C\031mU\\\353\364\202w\323v\3601\271\025\026<\343\206i\355~\237\"i{\301\2733-\316\035N\362\205\005O\204\345\005\317\256\216\216\312\242\035\032\030\270J\247\213H.Zq\272T\034\263\253^gf\332\002f\346\002\234\312&M`-\355#\244\2136<\352\275I\031\240\036\234\014\351w}yA\\e\026<\314\003\206\262\341\3200\376!AH\342\304\020&\306\241b\374\243\237\201\211\242Nr\300\230\016#[\360\026\275U\372\320\345\365\265\345\025\324\030\256\372\370\345P3nh\271\334c\304\234\005\366\006L.x\304c z\014\377\236\374\320pd_/z1W\022}M\377\375\370\031\300\317\345I\374\276x\221|\241\330p\275\235\024\1776s\250\247\205)\010f\212)\342\005G\037\255\274 \242\360\202H\023\"\336L\324\333Kv\342y\311\376\315\362;\265\276\375r\346\025\375y/i\016\276\204\365\363\345\332r\352\245\267B\177""\334\264/\267p\317\342\342\300\334\342\300\"{D\361\217\366\263\027fy}F\025Z\007 \300\274\303\241\034\262\207\005\346\253\305\344\322\363\351\3447\213\311\324\214\027D\330\021\371Y\204\347\273\260\232\330\005\365\303\026\r\211\355\006/\217\360\252X\344\354\014\034\037'Ar\213sK\364\227\\\341\037\2566\357M\361\357\032G\320\315-a\353\211\216`\222\372D\366\370Z\204p\2632\217\206\005\2421\020\\\267H\364|\221H9\304n\0321\364G\354\304\324\023\036<\006\031\211w&\226E\236T\007?\230+\202E\326:D\023D\343\366t\330\236e\2174\221|\274\343!\210o\212\n\347bSdR!\233#\210Br\254\337\"|\202\026W8\342xq\345\025\265\220L\224Eov\221\333\323C\343\263\177\353\342:=\223\226\350\305M\370\370rl\340\342\366\342\253\305\327K\300u2@O\n\344ir\022\313\006~_\260?7*EmL#m)\271\366R\373%\300\214D\305\336K.g\247\214Wzk&<\025\020\353\t-\326\222\331\260\274\243\267\366\225\001\267*\027\362\327\320vEk\013\210,\3532z\3636\375\201nc\243\014\341\264+\352\206%V\026F!\252\250\304\022\024\350h\222\335\257x\207\204f\336YX\227_>`\370\005\354`\221\224\370I\206\270\002'\200\177\022\237U\370$mh\242/Mq\3140\320\257\350\372~\372\037\000\2170M%K\313K\354kO\277\360\343\2415\322#\376Fm$\031\t\2659I\023*dUH\250\374\366\313f@6\227e\223\240\001B\267\0168G\346\334\234\354Hx\242\275\177G\223=\273P\311\344Rt3\360_\265o\037I\261?\326\370\375\233r|KLE<\304E\3607\345\267\301r-\257\315\316\n#m\312\225:4\221R\264\367U\370\314\275\344\034\255H\033\3233\301\tZ\357cO\374\250\360\300\370\375\254\352\nN\331\032WS:\221\324\216\031l\213\n\336M<\377sxg\250\222;\251u\263\243\226q\022\355\243E\252\251\357x\241\026\275\3439\255\371\343\362\035\346+\350\016]poy\2239%}\214\030*\263\277%1\034\372X\201\236)8\014\245Q\017\032\220\215?rr\334\201\2221e\261}4^\241\217\306aBr\276f\274b\257\215W\352\265\361J\275\006O\340pkp\231\333 \\\024\264\211\034:\3152^\271\373\307c\273\177\234\225M\273\266]\374\360\000F\213\335\233\343\366pa\207\275\245\205)\360/P\346\317\250M$PJ\225\323\362@\323\212\376\024\225\002\207\014\371\213\2433\231\210,\300\323\200\330\t""\222\223\326\227\210\n\322\212\216\377\305I,\356\033p\351$2\262$\321\254\n\247\331\201kV\007X\341H\306\270B]\265\262\300p<Kkt\353\332\362\244r\345\245\003\217\226\312\3655F\340\013@\3714 \037\273\030.\201\016\323\177\202$\034\3328\376\033(0l\245s\240\256\016(\273}\240N. \374\033\213\177*\205\210\343\344\266l^\311\346uJ\364\356D\200H\210\022T\032\353\227\375\\S4\034R\322\274zq\016\035\362\367\204\312\350\313R\317S\317\247R\317\231\260\247\246R\214\355\220\232\232M\t7\211\215\307\221\273\034O\213`V\th\345\337\027)D~`\371C]IjKAjC\350;\376i\275%\206\016k=\355-\322\315)\366U\246\266N\315l\361\017\375%\351\251[S\323K\370\245\236\244\315t\022?\274\2674\305\277\263\374+\022\005\3572g\205=\217\177P8;C?`li\363\222K\210\365\301/.\241\005\022o\343b\254\236\330\340\321\304ON\323f\r\243\317\363\340X\260\345M\341,Q4\374\342\305\340\032\260\301\275\353\\[\372\345\247\322\026\353\002\366p\347:\3126\371\306\315\255\265\324\254\n\376O\315\245\346<Z\252I\340L-\360\017\304\300\324\213\324\"8\276Mz\270\360s\202\021\220Z\002H\000\246D*\365:\245hC\212\351A\212I@\212g~j9\005\325\010\377\220t\202e?%Q\371TF\363\007\357Y~\221B\217\211\322!\005\001\n\363\312\240I*$Il&\373'\007x\213A.\260\222\006\\\022;\036lI\330\221\363\033T\241\315\324\312\244\004\376\244\270AYTP`\006)\000C\362\017\355\276\232d\307\346\324Z\212u\025\264\303\322\233\340\035\244 U\244\274\351\024\3703\376\361\320Ix0\215\205I\275\223\202\240\221ZOqk\257\003?\200+\262A\037m\260\022\014T\002\220\022x\014\213y\2137\3541\302{v\324\262`)\030(\005\332\271%\232+\263\253\037\244&\020\237\000%\245\315=\341SPb\236\306@\014\264\205\251@\264\307\000e`Y\211\321\031\236\013\036\203\215\324\340\0005\244\264Q\r;\nw\205v\245%7S\233\324\3304\333\266\327id\274\236\324PW\323\264\277\221\022?u\354z\330p\270\3142u\3572\263\303\313\317_\320\037\307|K\354\304\2626\266\321\016t[\264YY\303\201\267<\265l\002\332\227%\344{\231zY\006\327\362\002F\326\262R],\277 \022\001\360\206eY\n\020C\277\274\262\214!\242\254rz\353-\363\032,\2778@\340\n\2176\226\356yl\256/""\007j\t\266{/\363\371\r\032n\022r\276\274\271L\014\3452\260\tD\343\262\254mo\2232\264\226_\277^Y\351\207\024 B\000\342eT8\372\344\244\265#\2410\354\371\217X8z\351\n_\275&\034\266\315^\333\373l\353\261\013h=\323j\321\225\347\036\202\337\345\376\000_`Eb\323W\246I\214[\341H\261\025\"\222+\312\214\007!{%P-(\010W\232II\236M\3743@d\235wh\351\272t\177db|j\205\311\312\n\264\223\200+[YP\341\364+Z+\263\362b\205\304\326\000\005vE\350\013Vq\254\024\220[Vx\007\235\276,J\025\231\270!\254X\033\0276\204\021k\343\303:\330\260+\313\364\314\2258@C\013\3110\224\322\322 \032jP\314p~\313\0202\346$\035O\256\260\375orsV\320\016Wx \351\350o\331n\316 \266\016\3521\372\024O\344\253\025e\240\304\226W#\354x\372\014\277ayse\215&\003\375\311\035b\307\234\244\255\t\000\241}5\375\226\221VZOE*f\264 \332\"4M\360\014\344\367>5\212\354lx$\326\340\3714\362dg\206\006,\255?\352e\\\207\265\205\245M\013\306\261\002\242#\010\003C\206yL\"V\304\204\252\342s\324\221\313\004\353B\025{\243\240\026\324F\310\340\n\317Z\032\310\362`\200\315\255\257\255H\020&\017o\372\200X\014I\033<2\234\2154@\2214X\246a\000\323I\024D\272us\205\346<-\"D\202\350\227\326\003\354y+\002o&\027\257\274\332D\334\323\312\253\355\311\251\344\312\002b\345x\037=\341m,\311\2212M`W\202\331\260\267\221\"\256\376%1\221#)}\335\346:\214+\223\223\253_\254\366\013\324\304\352\272\0076\201\2126\300R\201\353Z\335\230Y{\265\212P\001\022d\327\004\212b\2151\177\205\020A\n\306\377\027\370\351\307\317\300Z\022\0018X\273\030\246b\355\271\267\006vOC\324\323\030\232\306\377rj\361\025\266\370Y\304?\324\321\002i\2616CK\020xZ\211\311\226E'\200a^\0038\033b\216\021\034([^\346e\227\265\030\352\354\2244\361\244)\230\331\226]\266n\207\302\226i\314N\241pv\n?\013Dp\371\327\300\007\311\341\344\266\332\352\343\327k\256\275{-l\354\326\251i\303)j\3651\217E\303\227q\237\255\315\274X\203R\2148\"f!\234\200j\311\311\"\277\314,\313.\177\204\265\233Xg\027\332p\006\0279\236\\\321\317\231Dh\337\344\212j\201\3244\207\366=GmyH\250\r\rh\345\272\250%\001u\"\210\037U\005\343V\001\023f4""\370\312\032~=\306\316\016\000\264y\017\336\177\010\212N\342\253\305%@e\226\261\022\314Da\266#\020\333\252\300\365u\267\013\2157\222*T\315\316\373\30696\014\322\255\216\003WQ\033\261;\374D\355X\027E\365\016#z\207\201e\325qp\322\025V\327\342\305W]\3146g}\2400{\364!0\255\354}\317\212\350\247]\356&H\205\312\027\211N\223\320Dg60\364\030\347bmN\006\031LIk\363\036\375\031-4G\275\255-\256A\013K#'%|\316Zjn\r\034\264N\t\204\355s\336.k\327\n-\002\022OL\177\202\253E;x\016\225\320\375\304+\323\302\004\263\343\032\203\000\254q\302\3465\031\027(e\350\000\215\031\260F\353y2\005c\013\376\373\3613\200\237\313kD.\327\266\274~o\300#\262\3401\253\344M\302\244D\034\255\206\031@7\322\000\344\367L\362\257'\036#j\303\264E\355\343)\262'\240\223\210\302\236\001.\3012\235P\272!\265\201b\330\323\236$j\007\275\255v\247\351\306\231i\215f@[\232\333+\230\336\2410<+}e\205\304J\025\262*\271)\225,\314b\336\275\247G\3604\033\n=)T\366=9\200\321GyDK\001;\036\204o\321\017g\026\333\263\202\375<+\300\317\213\r\366ss<\271\t\236Lv'/.\350OS\020O\202\376<7\350\017x\3707o\016\017\317c\205\372i\226\003\366\340W\254\212%\330\213\226\341\007x\244*\275\271@\223b~\321\304\336-\360GW8\363\203\250\354\325i \\\004\030h\246X\253\360\2037\223\004\346q\217\255\323\313\343\312\354\347\212[\255>\300\t\2735Q\370\343\314\306R2\225\212T8Rn?\366>\261[I\203tyg<\266X\273t\006\301\222\0252\243V\314\212\372\036\031Q+eC\215\317\204\352\205#1=;\022\323s#1\355\204\010\316\276\027\212\255\014\035z\321\200G\257B\300c\244<z\263iw\2610{n\300\243\027\304+z*T\321\013\202\022\315.\277HG\020\352\213#\021\204A\241q\022\r\212\036\334\036\367*D\030J\336\264\031/\022a\350\005\021\206^(\220\320\213\t$\254\220\243\326\315O\033M\322\346\305\205\025F\223\325znX\241i\005+\2240t\354My\341\020B\247\300\363\242\261\201\341tq8\026\014/&w\016\344\326n\347\224\273ap\177\024\261\313\234\262qJL\241\t\010\263J,\007\003Sj\361\027\246\314L\313\3410\232\222)c<#\317\3046Z)\3618o\010\377\230!z\023C\307\212o\364\342\343\033\275\330\370F\317\212o\364\302\361\215A""\201~\265\025\355\350E\242\035\205\212Z\205:\326H,\033\3669\3705\374D\302\205]f\250i\020/)\202 G\310(\217\270\320;\214j+\372\nMt\334\202\211e5\311<\035\211\351\005\261\226\236\016\216\364\202hH\336]\362\354\250G\354\363\202\262\340\351\336\216\211\202\364f\324L\324Y\007<+ \322s\002\"\343\263<\207R\036z\261q\2161Y\020\243)\020C\371\017\243\311\017#\231\017=7\354\321\213\206=zV\330\243\354Kd\211\027\016\201\364\302!\215\236\216a\014n\346C\355\016o\n\356/l.\257\233#F\343\017\302\036\203r\000Ly\321\270H\317\215\213\364t0a8.\322\213\304Ezqq\221^\245\270H/\210\213\364\254PH\317\t\205\364\354\350F\251\207S\304\013y(X\022\037\244?\304=s\177m&r\302\024H\234\244\225\311\302\343\370\310)+\236\311\321\301xAT\243\347\006EzqA\221H+\236\320\021E\352@\370\000}\244jr\313\341Uo\005l\350\255{\017Fx\200\310r\032&RVH\2449R.\035\341c\244\376S\224\334\n\236\024:`\2610v\374\244\247B%=\025\321hxR!,\025C%\3659CM\254\353o'=\305\317Y\205\264\242[G\372\021\010\234L\334\033\037\017B\t\331\247T\237\322\214*\321\375\305p\231\365A\\>\2569\363e\022\224\270>\262\252\350\223\337\315\254W<72=g\3206U\213Yg\335y\356Y\361\236A\002y'\r\252\223\003\325N\200j\247;uR\237z\221`O\317\016\366\344\203@\223\251\236\244\274\342\274\031k\352\305\006\201\006\331\353=7\264\323\213\211\376\364b\243?\203R\366\314g\367\217\240lbm\303[\207g\343r\312\210B\2218P/\210\003\365\"\301\236V\002{kW2\273{\321\350O/.\372\323*\324\221\032V\021\247\212\3678\nT~c\270O\211\004\325\361\237\236\216\371\364\254\340O\317\004\177z&\370\323s\202;=;\240\323\213\013\350\364\302\001\235^$\240\323\263\003:\235\003\032\006\303\254;\325A\230\243\013\353&\246\323\263#3\315\201x\302{3aN'\010\277\324\007\332\360\034>v(\313\017\226WY\3500z\235!@\367n1\210\200\252\230u\364\223\342t\"\241\232^\020\252\311\273\017\274 `\323\013\005l\312\361\274\\h\336\361\304\312\027\307\t\202\327\225\003\276\034\350\35349\210\017\325\364\302\241\232^\245PM\257r\250f4\261\261\027\211\330\214\313sl%9\0162\034{\273Eqz1Q\234\236\023\276\031dG\366\254PM\317\016\325\3648\274""\322\343\300J\317\204Wz\022^\351\205\302+\335,|\352H\2052xA\340dd\001\321',\352h\207FzAh\244g\205Fz\241\320H\317\212\202\364\334hG\317\n[\264\367\255\245\303\260#6\031P\234\200\331\t\370D't\321S!\213^$\316\020\231\257\206=\035a\350\305E\030zA\204\241\347D\030z*\302\320\001\r2\205.\264}\205b\275\226\202\317\344\006\262/2\037\032_\\\351^\005\264\256z\203\013]\256_\261\364V\020\244\347\004Az*6\321\225h\303E\370j\030+='\256\3213q\215zO\373\254\205\237\346\206<\352<\337\230\244V\316o\225\360[\227\212\005Q\366\202\025v\370\247\237b\2124\321s\313\307\037\204\213X\204\n\027\376\370\34337\275\270g\005Y\206\223\2509\331\323<;n\322M7\356\246\026\017%\032\217\3132\036\227b\334\311/\036\237\\\334d\0267\0314e\347\245\236\003\0221\3519\321\226^4\332\322\213D[z1\321\226\\\026\325\262=\020\235\310FJi+\254u\336\016\316\344\303\ro\346>g\023\230\016f\226\r\305\247\016\255&\030\277\237\270c+\341p<\234$rd\035\007\272=\034\021\245\r\366~\204\242\234\017~\374NSl\034\215\257\250\035\361\304\233\211\344e\367f,\r\303x\240\177\347HNl\346iV\030\022\301IK\341\365gK\340R\022\300\261\350\314\246V\206w;\331\273\235\006~\206\356\024\326\310\r\347\344\354\357\014\026\017&\214\207\205\212s\363\234XN\317\215\345t\222\310;\031\344=+:\323\263\3431=\035\217\351\205c*\275HL\245\347\304Tz&\222\322sb*=7\232\322\213\213\246\364\202hJ/.\232\322\013GSr\301\372\255\231T )r8\245\027\n\253\364\254\260J\235\3543\210\245\364\202\020J+\023\2507\343\252\037\242\261\217v!\306\365\306\232\0208ZYh\315Y\234\261*%M\3720%\310\235<\204b\311e\264pd\333\030b\242'U\0148'm\344\037\035\211\314\007?\245\304\301\313\323\301\231\236\t\316\364Tp\246\247\2023\325v\001\216kkZ\0201L*\207kzv\270\246\311\216\253\266*\237\256\025y\0319\343\224j\242\315\0071w\205\016\275p\342\336\360\261\320{\247\350\316\335G\261\351~c\013c\356\027\363E\205\207<\030\216\224\333E\262R\231\310T\263o?\316\255L\244\026\221\327G\336k\357\207\233P\205\274\332&\0137\016\326\263\203_\275\031\2139T\321\252\223\223\264\257\234fiOan\363\276r\r\261\366\265\207\004\025l""\254x\263\336\254\341m\275Y5b~\"fpV\314\235\263\333Sl\251\347\037\244[\224\035\311v\3541\034;\377\310\325\330\223\364\222\274\313e\270N\242\3128\304\212>\220?\362\345\302\212\267\010$a\211\202\341\000\014\017\216\321\242\375Q: Z\021\361/O\347\010\027oy\221\376\340\023\206=\266\230\362Obz\232\267\260?\003\006\226\017F\005\022\226\367\231d8Q(\356\221~\000\010\003\\\370\210T)dSupG\342\331\324\221\020\345\237f\205\237Rn\252\352\\\\\231t-\355?\020\313\177\360h|\332\212\267\202\365\017\224\n\372a\003\374,\210\321\\b\257-l\004\306\217\341\234\371\210}\245%\325\265\2644\202\326\371\207\252\275\236\024c\272\374\310\357\326\00252K\366\353\2340D\206\310\035\025\373\311\007\343R\310\001\002\363\313\323\262\257\335\250\334\243K\nm\326[\207\033\211\263]\336X\017\266z\007a\177|\211'\263A\276X\355o\361j(\007\252|\005\377A\357\301oM<W\260\273H\213\315:\215\210\365\345\025\361\254\340\271\206wq\r\326$\252\217\177\027f_)\304\177\265\271\255\302\212\005\377\337\312\002`'\0137\211\302M\222\360 A\270\225\034\334I\014n\222\202\353\371\"\033\236G\034x\212\337\025\221\r<\025i9\303)I\221o@9\n\253\255\312D\300\331\030\350\347%\215\231\215\347X\036\344\027\033\304\026x\306\215\000\353n(mA8K0\035#<\214\352G\213?R\031\340\277\037?\003|$\331\r\274-$2\367\244G\266\275WK\364\307\377\354\030\253wh\270\275JM\215\002\316\031;\367\341\342\346\005\036t\036\265\371z\377\372\000B\016L\000\202\212?\240\001\2131\013\227\363\344\362\244\311e\213\003\331\272\261\0328\366\326\237CM\200_z\356\324\322\n\362\014\256\0233&\300\361p\246\306\277\334/\361M\3533\030\347\353\3405LV\006\004z\341\237C\277t\206\006N\320\260\216\360d\235\230}}Y%\323Y_\006\n\266\344n\200+\n\375\257/s\025\330CE\2420h\010./.\317\275\202?\210\336\207\037\310\272\270\220\004I\377\354\035V7\312\310^\267\200\034\340v\2522C\320\010\021B\210T\305\311\225uv\201a\257\316u\352&8\251\202\340N\312;\304\325\014\000\356\342M\276\244\206\363\306\306\360\306\360\342\306\217\033\310a\273\275\261\340m\010\243\262\221\262\302\233\351`9\265\201X\236\024H\312""\364F\n\016\306\033)\270_\313o\277l\006dsY6I\331<\227\315\224l\3266V\024t\266\006\315\226\260O\371\2052\220\223Z\320\245v\256\352\r\3432\202d\027\262\362\251\264\027\241\254\027\033\206\317\241\275\211\304O\017$\320xR\0368M\3774S6h\224o\"\215+\375\253Q\2761#c{3\271\306Yei\207\372p\223\343%\345\357\326\214\326w\321\301\004\\\2639v\031[\216r\230\204\240\215\243u>\207\006V\361\226\270\006\216H\036\307^\342\007GD\225n\262\2406\252r\177B\234\333\324\341E*I\307&#R0\333\350m\316mr.\030~\246\000\024 \226\020\377\242\260yr\363\336(\037\005\366\227 \245w8\2717\216\365\r3k\233\213\233\213s\233K\233D:6S\233\364\341k\233\360\255\332\244!\202t\r\370\247\035|\322\326\032\375\361\327mm%\027\326yI\335^y\265\305\tM$\211\010S\206\2555$\211\236\346\320J\354{[k\013\364)\333H\201\274\215D\026\333\323\313\353\333\222@a{\021\361\234\223\370\331\246\2519\211\237mx\220m{\333\353\333\033\333\270\345\325\353W\010\274\234\304\317+\\\204\237W\270\3505T\352\n\336\365\265\002\245\327[q\004\014\037\362\302\031*S,\230.5\227\254\300N\210\035\270\244\275F\r\360\363\0325\300\317\353\345\327\257\361\277\214\357J\374\324\326{\377\225\264r[\337\271=7\357\205\217Y\227\035.\034G\366\tq\rqO\335\031\017\037;zd\225\360\311\275\206\330~\267\340\336\375;\223\260\334\277\273\364B\233.\265\317o./L[\307}\356c\222\353m\341\202\373V\330\200{\362\376p\350\030\316\3767\307\343\n\331R^\361\204\322\352\304\235\327F\360\230sl\313\036^\236\3069\3478z\236\250\237*\034\035\211y\222:\254x\242/z\306RJ\306\334\027\350\243bN\212\202(\356\204\366\031\21697>\032W(\352\220\2703\025\332L\334SC'\314~o\342'\347\360\346\275\320!\217\367P\2315\334\2353w\306C\207q\203\335\271\204\306\272s\034\014_\2730\271\036>\266G\250s\356\376\260{(\3433\246L\217\262\350\251\321\221h\231\034E\313\2551\021=\031\014\211\3509\031\0211\345z@DO\215\217\306\224\311p\2109\021\377m2\030\234r(\375\"\005\201}\31595\341^9\221\\\016\037W\2721\271\014\344-\247\214\244\336\360\261\342\262Q\314\2460}\212'3\352\345\016c\267\246\356\271\211\320\265T\203HA\305{\245\266n""!U/R\240\352\353\226Se\243\344\211\013\351\347B\233\373i\347\366\210\230@\305Q\352\030\032\262\366\251\370\373\342n@c\362a\342\247I\342\200\364\321\315{\356\021\317s\267\310\232\346\366\211;\343\366\021\333\210\355\002\232\322\366!f3\037\337\222\334\013z\253|\305\302\227\335__\323E4\315\355\007\205f\275}\352\376\260Sq\247~\322\010\321\022\325\216\316\tM\023\270p\370\366\367#\017\036\250\r\321%}\325\350\210}\217\264x|\211\365-\026\235\260\257\005\205\260\217\205*8%&\250\304*\034\037u\216T2\\\273\310|\205*\220yo\227\320h\370qf\313\032\r\316\221\214\006\247\310\036\r\326\t\032\r\326\221\214\006\253\000\243\301:\344n\266\216\321\307\356\241\323\307\326)\352c\273:\316[\203\216\263\n\251\237\254#\325+\366\003\255.\261\212\271K\254c\325%v\211\351\022\253\220\272\304>R]b\027\205\353\247\272\304\276\204\310Y\3708 Q\366\231\t\347\272\t\267/\351\260\302]\211\237@\326\234J\220\234c\277Q\005F\3307A\370\374ay\371\345\306\212SO{\264\271\365\264\316L8\327M\270\024\310\255\247{\202\353i\217_\252\247\375FUO\253\210i\355\344\270\365\024T\\\303\213\305\317}{\010\t\231\240\222\211\177_\374\327\215\337\374\352\266l\325\333\372=\007[\3743_\370_\014\027\373w\016\234\314\264\357\0348\362&\371\346\367\314Xf:\333\235]\315Uq\201\177\2643\333\237\275\231\373$7\226\233\313\217\345\347\nc\205\344\316\201\243o^g\3522\335\231\255\354\\n\314\257\246\307\214\026\223o\273\366\034\374\302\377\374\273b;\036\3117\237\245\007U\347F\362u|\315\017\245\304\333\226=\007\257\344\365\351\363\271\376\334\315\374'yz\304i\3774]\361\217b\325\333\216=\007OfNf/g\223\331\327\371\272\235\003'2\364\323\222I\252Z\236\311<\311\216\341\265\271\231\374`\241\271XW\244\302\2327\267\322\3273\211\235\232\303o\306\336\314\246oe\256dV\263\325\331\004\3363\237N\24672\211\314D\266.\313\227\016\277\361\322\335\351\315\314\263\354\352\316\341#;m\335\364\274\231\334\325|\025\336\206F\300\267uef\351\263\367\345\372\361\261\253~u\213\337\362E\276\n\325\357\312RY{\226\256=\217\263\227rT\263\272t3\335\323\233m\317~\231K\346V\3451\277\361K""\033\262/\363'\n\355\376\227?\226\222%:sp\247\346xz(\323\356\237\242;\3135\307\322\355\376\361\256l\";\221k\310\275,\234(\266\373\303\217\374G\217\375\307O\250\315\362\007\n\374\316\356\354H\256.\327\256\232\215n\314\255\347\257\025\372q\005\237?\225\351\314\2149m>\232oW\315\314\237C\247\375\352s\271\346|\335\333/\250\3473\017\251\252\352\364\037\231df={5W\205\247\035,\324\341y=\331G\3245\t\365\304\001z\326\225\374\257\305~uE\371@s\246*S\237yD\2354\225;N\357\352D\027\252\272\034\305-\035\364\374+\331\rTCN\264\251\023\372Sg\363\t\367\216\336\\U\256>\367\020\325vO\364\320@X\247\356\331\247O\324\253\023\347\250I\272\360 \375r}B\267\200\252\325g\205v\274\276\225z4\221\325\255\364yn5_\235\037)`d\346\367\347g\013\t\236\022V\303\370G\251\223\263]\331\331\3340_{K\267w\357\236\203m\231U\253\265\367\345\006\363u\371v{\360\314g\247sg1\236x\360\320\203\360\364/r\372.i\236-\031+\352\222\246\334g\371v|u\315\233~\214\221o0^\313z\307\257>\343\237\351\367\373\023\305\272\377\0033\344\337\231vz\300&\365\344q\214\022\376\002\252\334w\305s\245\376\267}j\216p\215\016\275\031L7e\366g\026h0$p8\224\356L?\312\\\317\016\323\263\371lCz*\323\230\331\316\256\206Z}$\337T\250\332\351@/\367\344\253\324KZ\375Vz\317p\361\313\322\254?\361\314\177\366\317\267\315{\016\036\241O\232I_\2451\331\220\231!rEs\205/O\177\222~L\237\3650{\226\236\321-M\275\231\036K\317r!z`\225\t\3334\r\272\253\205\252\002\337\265\221N\244\307\244\242g\251]1A\323\203\324\247g\271ZI\356\264\365|?\206C!aO\364\306\354f\356q\376Na\314o\243*\216\024\307\270I~(\335\366'\036\2024\016\346\351\261]\316D\276\310/\357\316\377V\244\311@\204\366\355\000\2462\235=\235\271\223}\232[\310\257*\372bQ\342\375<h\272\272y\206\3362\025\241\002z|-}2\276o\224Gqm#u\3546u\323X6\251\017V\377S\265S\215o\352O\323;\373r\237\313\204o\317R\013\037K\237\313\364\323\233qy\210\370\373\325\035\324\212'\363\375o\177\2502#\364[\274\245\254w\374\352\363\376\371/\013\375x\334\371\3349\252Y\302\351\321\231\\\277\364_\276\302\033\317(\022\366\346\025S\227\207\331\036""\"\t\324'\r\351\t\032\355\375\331Q\264\333goz\322\366`\240\207\365T\250\276yN\373\356\357\r.}\234\24569\2319\227\345\2178\235\351\3078\030x\3638=\312\335\257f\370\0265\344z\346j\266\212W\322\235fz\360\316\211~\020yT\245F\017\034\214\265q\032\371\363\364\016\367\240I:e\247\2466}\220F\326%Zky\230}\235\255\312\326g\037\347\022\345\212ghL\321\264\370\254\330\216\021\305\335\300\013\210\020\317GD\245W\235%\245\021C\325\257\356\365{\3211T\273\376|\225C\2026\344\221'\245\333:\262\3151\243sU\306f\243\232\326Gl\242\\%4\016\263*\351W\237\312\364c>\266g\017\345\364\205\255Lf\356\322\240}e\317\260g\231\r\020c\277\272\333\357\276Q8W\354\007U\245\241_&\022v\026k+\275\261l\321SLk&\03770\245wj\352\323\367\270C\344cA\237\246e\206\037\224\006\373V\177\035\257(2\271\251\335\267h\255\363\350\324U4l}\372.?w\024w\346\253T\303\005_\326\220O\3467\n\211\302\030\017\267\377T\225\253\217\247\3731\021\316\345\372\205N\017\274\031O\357OO\313\342{\350M\377\233\221\364\361tBjp]\021\205U\036\304\\\364\025\265E\225)\262\333\347\026\257 =\250f\241]\215\356\367|\3177\212\\&\250\267\222\357z\017M!\274I\275\301\214\364\032\036\344\321\007\312x\337N\257f\2523\212B\32126\220\257\213\037\005L[>\331\251>\364\346\353\314\276\0145U\227\337\365m\341\327R\377\316\311\313\371\257\375\177<\361\237$\375\344\363\267\227\260\320\216E\346\326\231\230\262Co\256\246\367\021\375m\302\254\305jq\234\316\365\342\314\361\364\rb@\372\261\\\335I\217\371\215=\206h\351\241\277\231\177T\370\246\324\344\337\0373U?\215e\317\271\254\211*\337\230_\r\226\265\301\254n\236f\277Yfu/Z\350\n\255\211\355\366\340\332\244\3669\334Dm\363\t\325\333*\337\"\272\275^ \272X\237\276\303\374\337\224\356\377o\263\035\331;\271\211|=1\322\323\205\256B\022\004\344`\256\016\334\tO\255C\374\226\036\242\023\274r^\246U\3552u{;\306jb\3470\250\373x\206Gn\242\314E\\\353_\211\224\335\314\356\347\025\177\312t\356\271\334\211|\373\237{r\320\224[4\025<321\315\353\245M6\345\266c\351>\032\356\324} \2106\321G\235x\031;A\344u\014\323Mu\230\265\271\235\276\231\321$""\275S\223\336\241\254&CmL\373\236\345\326xBFja_\032\020\033/\337n\030\253\023\271v\303\267\313\262\336\230yM\037\245\007\202\341#\337\347b\371\254E\260\265\357\272\230\251\3424F\262\276\266\347]\327vgV\337\373\271\357w\255L\336[X\236e\261\257W\327\326\245O\320h\277&t\225?M\250(\361Z\322\266=h\333\353\331\333J\014P\242\341Y\263@(\301a\210H\312\220\010\033\302}\3141ouM\310\0021\0059\356\2463D\265\211\255I\004\313\274\356\331\307\304_{\304\253\217;\034\230\231\262|\243\303\377\200\343\177T\030,6\0267Kc\241\325\207o\270i\006\241H\002\212KR\003\342\206\254\323\274\2727c\340\261,W\363f\024<\001\330\032P\356G\334.\256t6\227\177Hr\0345\343Y^/\333 \226\201\240\366\207Dg\277\372b\356\027^\323\372\260\244\322\303A\t\3062/\245\351\230P\361;\217\330r\317Y\"\375\237\227\352J\0211B1\277\252U\204\236v}]\370\305\277\373\334\177\376\322\177\271(\202\313\237\246\247\340\"\366\203\331T\004\265\337\220y\2217\007\013\215\205\325\235\317o\025\267JI\351\235\016\365\336\240G\rSAT\256N\246 :g\006T\025l\230\352\242\236\254s\227L\300\305B{\301e/\276\312\257\026\370\333\267X@\371.3\225\r\006T\213\271\375\n\215\207\tT\256h7\024^\325\001^\344p\316\255\3356-\366\007\365:\353\360\"\212\370\364\030!\261\217z\367Jn[WC\215350\203\n\\\340\357m\n\215_T\340\244\272, \213\206U1\214\230T\277\241\220\244\326=pJ\261\245\323\374\346\365\374\020\306\221%\275\361\200\374\0023+\337E\324p5\340^\353\\\262\030\324N\210\242\022;\032\350kWi\255H\032NZ\257{\003\2311\213\006\327C\304\254\017\351\024F\344\255\266\010\270j\275\365\233=\007ky\026$\301R*v\230\352\221Y\022]B\224\225\326$\000\242\314(\330\037\334x\306\377\346\201\377\340\177\374\377Y\361W~\177\273g\317\037U\267\367\322\346\366\336;{\337\016\242w\036\312\234\353\303\314\3103\2538(\037\327a\036+\035\267\221\377\321\377n\302\237\230\364'\351qI\253\013[\374\026\375\242)\177j\321_\\\002S\022\245\213<FY\250\326\244u\035/\213/kC\273*1\326\350\220\356\344\236\020\331\350+\016\027U+\035\333s\260\221\027Mg\355N\032\215\0337l\177\306H\325\371f!\332\256jB\324\027\243""\240G\035\331\317E\262\341\3527\244\237\022Y\376\325\322\336H\023?\311\215\331RS\013\221\221o\374\247DA\246D\237A\362\267\314~\036\252\255\350\330V\231\027\3260\372\224\230\233\371`\330Eh\324\252\277\2476}\210\250\350\241\032f\004\353\322u\345\352`\310U\177\372\237-(\033\312r\216\332\031\242h/q\375(8\221\241\213?{sN$SE_\216\006_\360\263\346\220\315\030?\032\254\nUv\241j\325*\241\025-\316\205\220\367\223\242\002\rI*\301\371i\255\313q\307\270\232\027\301\013>\311>\310\0063\356\\He\272\337\322\356\250K\332\263\321n\267\036\336\001\021\250\327\014\342\3401\033\320q\005\322\375\210\020S\010\264\035\316\307\341\332Mb.\223`\377\352\214\014k=\355S\0327\373\245\007\315d\320\253U\207Z\255\250\327\210Sd\212\342\020\007Y.4\021\022\242\327\300\032\341\347E-=\005\204\242#\037\352E\241\276\253NG\271\r\334\206\336\300\251\316\254\323\001\033\020\313\325]\321SY\233n\235T\n\224\320j4\026\242\313\273<\210i\251\333\270\301s\036A\253\021\323\270\035Z\"\020u\244\325\270xN\275\363\234\315\3348X,\3254fHh\225\332\270\014\034\273\236e\233\250m\251\336\223i\021\232\014\302\252\324\031\025\377\t\310a\256\222J)\207\215\220\311\342\315\311\3141\363-\324\261\320L\354\027\326\025J\030k\020S\373\236\265u5\241F\216.8\262xof\202\345\265\303\260>\027s\254\003\371\224X\324\252\312\312\323VP3=`\014\023j\276;\350ngi\255\324\335\026\233+oP\375\255T\264A\203i\262\363\220[}5\216 \340\036&\236\377\206\272\313\341\347\036\3230x\\H\024\036\027\023E\236\271\373\215*n^\253\254\211\340\031n\334\245\324\271\244U3\372\000\036\000r\021\353\177\016\026\353\240\377i\315$\243\206\024|oKp.Lj\324\2604S-r\335\274&[\352\312>|\033V\255\263F\300\266\354\001\212&\0065\t\3159\227e\342\301\336\222I\306\215x\246[\270\005\022\313\247\242\2644\275gj)\243\270I\024\033a\316_\021\317\026S\231\240\253\353\345\351\2472.3u\226\306\3339,\365\242\t\264iuk\350)f\\\251w\236\315\376\232g\255Upa\300\314$\002\023I\277\365\330F\353K\214\331\305\371\0224T\263=Z\343\025mX\327\032\241fuMBF\211\3556{0\343\344\262\2574\253\254.\003\021\3203\351T""\246?\254\265%\371\314t\316\252\314V\236\246\230\207\315\020\361\224\322\3272\312\314\210uJ\251\r\217\006\034K\302^F5_\231\020zU\023\251B@I:\365\244\210\255\000\232C\033\230\364=\215\240\2418\321\345\274\353v\376&\330L\031\325\035h\351\036KK&\225\374\241HW\320<\026\365\202\266d\234\315\256\306q\303\371miMe\355\200xER$\224\355[\334\303Xu!\202^/\260\000|K\330\025E\030\355\td\024SFUg\021/X\03660\254B+\301z!\030_\337\370\347\224\226\327\350q\333-\205\256R\005\214R\2435\211hn14Bx\347d\361@\371i\324\351y\204_175\245\2472'\262\235\206=\014\030\2205\350\323\n{\013\3556\373\360\204\247\305\367\372Dm\272:\235\250\370,\031\363P*\014\220\240\337_\370\256\220|\367\263L\217\272v>cV\004\275=\231U\2641\270\3026\022\220HP\230/&\345!I\213\001n\026\275\231#Z\214\026z\212\007JU\245\206R2\254Nm\205\232\237\365\203b\"6\rtK\330r\350\002\257\320\360\230\316^4\034\342\3567\203\252\016\005\252\206`\231\344u\247\342\003\364\220e\262\3718\370\346\340\376\363\371\220\324\327\n5E\244O\025\323!\014\350\274h\343\331\254pC\3539\330\"\n\365<\2116o\367\3579\334\230~\0109F\211\022q'\202!9B\243\2649\177,\337\257{\361\002\206p\243\345\204 \314f\263\305\373\267\205\364\270\215\241e_Q\310\340\262x\n)\357\273\024~\237\261\241\033\021\2429\275\226\251sV\333\375\241\351\307\204;\270L-o[<\226\373\335\265\2459\355i\207\213`y\366r\326\214\271\234I\272\032\321ZV?\207\373e\335t\277\352\276\340\311\266\202\373\2702\305\205\036\035\255M\340\376\261/\027\371\262\340\311\322<\230\201\373\n\221O[\247/\032\311\276\273\021j\337\254\263\252mL\2618G\235c\341\344\273i\006\216\344\032h=\271ZpX\304\031\243\267Tun\337iie\323\316e\346t\234\003\032\267U\351\006m\265\203\360D\253r]\343\356\005W\262k\271\323\3711k\300\2752\303#PO}R\030cm\302\200?\360]\261\375\377\200e^\217\247i,\231~5\325\353v\251\nk`=\311\325\367\262'i\350\336\315/\024\326\213\375\305\004&\247'J\205N\374\004\325{Q\250.\214\026{K\355%\303/\r\343\373i\232m\344o\023_;^\254\n\321\303\273\205\251b\035\277\360n\351\234?>\201u\2503\333g\311\005Z\300~@\354\304D\341X""\241\277R\371G=E\263+\003l\006]+\354^\027\315\246~G\314\370M\031\305\361\345\374\224{\2451\303\262\030e\037X\300\177\373\003\303\305\257J\257\374'O\225\001S\253\271X\206\252J\327\201\235\341!e1\007,)k\"2\315j\317\303\307\322\235\3511uJ+w\272\240\023,\007:\277zZ\r\257\010\267q\310\266\330\335\200\316-\263*\\\324\2008v)\365b\240\377\327\323\305)hL?\317TI\315\366\246\317\263\265\352\271\2669_U&qQ\032\354\313\367sM\322\327x\200}\252\026\350\313yML\332\375v\222\013\244\245\333c,\354\226(?\220?W`\276\314\326\237\207\304l}\325\273U\210\201/\r\014~\037pc\2731t>\242\331\210\361\222\357+$\242,\204\345\304&W\324\207\227\013\261\224\263\376r \177\276\360s\351\204\377`\274\314\315Z\255\365\353\226\262\275\314\346\270\365\364\200\337\320\233;\230?\346_\036-\316\225&\374\261g\376\263_\374_\376e\331\323\016\275\271N\024\241\037\266\353\327xe\031\234\245Q\321_/\204-\261\237\370W'\374\211\177\372\377\374\371\277V\025-\000\217\370\327\237\370OX\367Z\215\221\321\021\321\303)9x@\354\224\316\311\ti\355\340\256`\225g\365\225_\335\343\367\300[\260%\326\036\275s\340 \315\006\277m@<\252X\000b\355p\234\243^`7|\211Q\320\341w\014\344{\013\374\3526\315\001\266G\3148\016\237\320\013E\354\345<\257\324]~'T\372ca^\235\327\t\\C\303\247\201\230\224G\260\220_\316\367\207>\261!\320\341\321\007\250\353\217\332\322\354\001Q\202\252\3279\316s\354\254a\337\243Y\351\016\"'\035\205\204{\227\226\325.\343eq'\256\350\307\2658\302\025;L\310\t\307\027\016\237zYk\300*\251s\250yU\005\333\"\372e8B\\\223\352\264\372\255\227\375\313\303\242\226\374/\257\251Zu\266N_\247\272\321\277|\327\277Kc{\336\237_\000\251\2515\013\357\254\260\215\227\305t#\r\264i\271Tik3\273m\311u\227J\007\375\261\007\340\242YA\302VRL\313\255\364,\021\352\313\331\260\"\302#Rs\0002\352e\210\331FJe\271\371\214c&\210XX\365=\324\241\275\216\322\316\362)\275\014Y\025W(\243b\264\"z\315O0\3317\327\367\201a\312'\303b\254\315\246\365\344\252\324\013dzTwg\377\345_\036)\216\241\233O\353\225\362\014\367\205\230\"\330@\220\271N#\345Q\304\250\361\230W\320\031""\251\3647\305\023%\236\2645\306\306\371)\214}\030,F\"ju\244l\3303\3361\\O\373\247\257\370W\340\335\334\243\326w\036z\247D-\200\347n\313\352\010\026[\n\266\224\271T\215\305\243o\326\210\332\016\213\222\223\207\354n\2433\020\323;\263\343h\254\223\376I\252\300\255\342+\377\376\230\270\272\035\020\205E\017\274\020\264\217\257\370\244\r\362\252\264\037\203\224\356\001\343\247\265\324\237\373\237\337\024U$\177\374U\366@\351.l\026\307\212IKj\242\311I\264\353C\274\234\0035\351\371\374\323B\322\377\366\001\2557\304r}\230\243s\360\336\223b\232\016^u%\260\214\351!\304\032#uK3\206\351\273F\213f\021f\305\341\227\356+\273k\3250\010]P\354\270\034C\331\017\236\300o\271b<\032\003\327\343'\342\020/\n\336W\242ge\307'\365=\216NJ\336\035\322~\215\220\344;(l/NvE\364X\340s!\370\372\247p\336\036\002\366p\351a\356|\025\246\005\3254\035F\034m\316\354\315\264\253\356\254\270\014\272\376\352\304hn\025\223\305\215RBI\313R\273\2160\331\326\013\366\023\241.W \035\340\033X[\334\230\236\312\304\256\233\302\315>,\\\240W\254\225\364\\\343V\273S\030\023}B@4M\307\177\006\312J\253\342\225\374\217\354i\334\245\230M\226^\304q\343\231\014\027\307\265\341\343\334\252\264\005\367V\210\321\345\326\375\261x\241\224\362\177\236\361gf\321#\261\366\323\266\354'\026\335\007\267y\226zh[+\014+XP\251\t\177*^/qGwg\265\323\214\303 C\323\377s\321,\250\331\336\\\373\333+\252\311;L{(\033\356j\264\375\215\356\271\206\006\360?\213U\305&^\200h\342\306)\361\325r\204\366\374){#7\366q\007\320\353\257C\314?\370\246\356M7\244\201\035{\367\350\233W\360\266\253\343U\352`\261\316\362\214\263]\357\254\316\322\216\216\264\304\370}_\322b:\\X\rD\340ac\244\201Y\231G\300\006\321\340M\307le4\261p\366\313T\305]\326\256t\001\326\323\240\247\216s}\203\331\364\274\350\"v\275\216\271f\\|Qq<\375\306\205^Y\204\364]G\305E\036\374y\277\365\000\263|\201\356*\017\272\204\343OG\344\361\252\177\365\247\3226\021W\221g\224\276\344sC\265\265\305\3501\230\220\263\331\337\375\253\301\022c\\\r\316\330\336=F9\344\021\351K\252\233\276/]\203|\335k-\336\355DBX""\353r\216y\331\325\020\317p\023\336\313\3147\320\"\364\366\232r\360b\322\324\230\236\247\201\251\224E\271\204K\225\246s2\367q\227\315+\034qu\373\254\220!B\202\313.\200%\251\013Q\206\206\364\003\242\323{\263!\266D4\327\360\341a\225\202R*\343)\232\210\353\026cb\254jq\324e\313\340\303\025\324\222}h\034\2065\230{\312c\2456}\200\244\354&\351\311l2\314\215\326\034\206b\000\242\370'\020\361C\206\\#{\365\241i\3247\263\021\277\301\370\241\350\271\374:\177\022\252\003\323\356!:nZy^\374 \257\322\270\270+\021]\201\223\271h>\032\305\2715\354v\216{h-\024\317:t\315i\314\372\216l\330\026\017[\322xa\177a\272\330^\034\022\375\322A\230K\346\350\003\347\262c\352\301z\260\014\3477\013\343\305\375\305i\272rH3\026<U\344m-\212\3521\215\212.3\375l\242\231)|U\\-U\351{\336\2718\331w\355-\265\233\027\022{S!\362I\235c\206\366*\221fbD+\213\334Q\327\345\200\257P\302\242?\370Si\013\274\321\237{\232\222\n\375\201\357\245\361\210\246\022\343 <\341U,S\247*L\242*\270\243\231\357\376\271x\2724\266\323z\255p\330\037\371\305\377e\326\237\235\373\020\227\303\017vC\354\024w*\3659\027ra\246\013\226\227\252\235\276\257a\\\207\021\276Y{c\330\037#\337\376$?\246\027\310z\367\212`\036\352\013Z*_p5\377\257\342W\245\337\325\267\177Sa\275\267\304\212M\232\024\327\202\000\241\270e\2767w@\302\342:\264n\360\323\364\252\353~\032c\301j\316\362\232h*\332\232y\255\031\301@w\177@[\213\327\322\307\210\003\357\202\035\017\027s\210Pwv,\304\270wEY\300iQ\313\211\363\306V&\251\207\316G\277:\260\311[\032\236|\273%z\234\311\374\223[\244\353\343_1c\265\232\365qL\033\007\375A\310C=\177\376\003B\315\026\260Y\262|\375FT\362q\340\004\244=\375\002n\277\036cRU\247K\211\374'i\360\237\207_\020\336\335\213e*V\255\201H\250:G\202lH\217\245_\230\345\243F\207#h\342\346\320\263+\205\337J\211\322\203\322j\300\310R5\356\370w\376\345\377\353\245\377r\315_\363\240=\356\364;\256\212\030\1772s1&\020\370q\376\226\020\324\235\256\376\374i\026\177\272\316\2631\3440b\336\316\370g\006\363IQ\0070\347\205\370?\342\177\032\374\206\213b\304\267,\355\034S\331""\351w\342\016\355\244\343\254\326G,g\2731si\317\373_\252\265\177\221K\3152j?\225\031\356\210\352Z\317\nQ\311\251\247\362\245\341\247ZJei_\271\226\365\006!\021\\7\347#Q\035\330\"\270\272\353\2148\372\221\370\3467\367\372\275\327\nUb:\276&\374mv_\314p\357\024\3472\325\236\226\np0\2202\355\223Z\323\007C\373\000X'\373\244\023G\2139D\347\372B\342\347+\263\036\316i\3578b1\324\225\314}1\017 \361l\212\3727Y\266T]\361\236\374\2474\202\252\013\232\025\356\366\273\361\220\306\260\274\251E\371\371\374\024\370\260\301\374|!\371.6@\374\2256\n?\224\252Ju\352K\026\n\253a\225\225\255\242\352\361{\344\232\016\213\035\226\340\3251\314\272\361LU\020\275Zg\007\351=\322\241\\\241\0011*e\374q\203\371T\361Ni\3148\032\034\261\273\202zh\310\037\272S\n\242\025\377r\352\020\210\224\272in\026\017\227\306\340\327\257^\375\277B\230\334\227?'\351C\265\017U\342{\021\357Os\344\000\273I\034\362\017\235\346\245qP\367\331\2417_\361c\307i*\014\"8\025\352\333.v\314\312\263Lq\212m\324\237\024X\201\177\306\2110\320D\361F\221=\023\207\330\017 \022%n\315\346\241\374\257\376\360\317\376\317\013o\367\354yQ\365\035\\\322\277\333\373=6\337\357\375ao%\206h\267\370\265\353\010\323\215\341s\244Y6\013\217\374\341\307\376c\"\316\223$l\371g\251\002\305o\375\007\034A\327\243\006|\247v \353\312\032!\375\036\030\242\367>0k\324nJ\232E\341\036\375\266\241\374\037\242\tm\227\357\321\341FJ\320\353\224Y\202\030\315Q\352\264\r\243Z\rb/^AKd\374g\207\\1\254\217\372k\253\220,x\305v7r>\032\017\366\220m\r\3118\267\206>\315\355\005\367\230\271\005M_\334=\312\005\316\276\307\366\177\213\277\307\357\030\312\257B\366\275\212\341\026\365\274\327\002\023F4\275\266\355z\341\214?J\3759\347\317\315\177\304\200\201\372\224\325\351j\304\\\314\271q*\233\324\330\347\277\205\332\216i\034\352Vi\235\262\2274\036Z\253\306\373\273\242\262\350S\004\325\361\227\204\\\352\225\207\272\234\352\t\371:\217\251p-6v\250\3678\027H\340LcALz\366\323MG\313\215!\237AP\242_rQ\227\230MM\033\006\336<\024j}\224u:\253\022\001\017\247\274M\370\355\227\371p\223\276\365y""v\177v)\337\3771\367\230:G\364\242z\364(s\026\255\211C4\245\177.\265\370\217\021\213\"\216\243\306,\201x\377\307\271[\371\241\302\331\242\361\300\337O\257\305#\325PG\363\343a\030\300Xn\206\020\001\250\231\200P\301\333\375\201]\216\227\350\246@\256\tY9\\O\334}\301\244\322\372\317D\310\307\375q\236I\215h\005\224;\200^\330\206h\372\276\020\2766pk\016\220=\330\312N\334\326\020t\240\242\305\351\267\244\320\020\207\024@\205\214\n\3416<\022\017Y\365\010\303%\235\326;G\"\226J\342I\207\362\257\212\207J_\251\326\277\000\325L\243(i\0253s*\363e6\0313\035C\2077\004?\302\r\313\027E\332h\261\247T\0058\004\264\311\2501]\360\225_*a\262\236\326RF\033a3\342P\376u\221)\341E\377\3027\022\000\326\344\372O\005V\305\004Va\325\314\347iX1X\004S\020W\360\t\310\226\023ki\351\373\n\017\213}P\353\213\315b\223\035\003\037\345\276\344H\216\331b\004\025\"\032(j\014\325\372\322\236\367\277\264\376\257\270\324\212T\225K\373\336\377\322\312O\025/\216.q\353{\367\345\306K\025\374\3035\361\246\257\020Yk\271\023\312\245\266\256\341\224\350b\234\200C\252@a\304h\370\341\254\217\016\377\213Dc\307\307\302\324\347\2143}\244-.\024\222\025\257\020\203\361P\241\275\342\025\262\350\316\347\223z\300j\246\262\222\037\305\210\370r_\313\367G\003\336,\267\253\336\334!\266a_\260\024\333\356\027Za\353\326\003U\250\315\202\260\242\206\357\026Np\226\246\257\371\224Kx\362B6\022\003\247\225\230\267Ut\207\t+z\"u\265F\202Y\r\316\204\0021Gs\275b\266\265\002\235U\363\375]\367\230h\200k\342'o\356i\211\204m\334\326\232\213\212\357i\n\274E5gp\240\262\213\351\347\271_\013\327\212\375b#SOh\rvVm\267z\355\342v\255x\255\324_J\204\242{\267\213\333\245U%\"l\t\224\215U\275\216\254\t\346i\204e\304\216\260\326\226\324&\203S\301+\3105\377\332]q\030\340\201\301z1\207O\202\3740,n\305!\311\347%\327\007*\220\030\311\247\221\375K\240>xa\002O\002\371\307!u/\013'\021D\243j\362\277 \356]&\016\0306\222\211\342\031\240\2211\237Ho\377\336\377\236\226\305%\177i\335_\337x\373Ue\035\2206ul\321b\3613\007\253\367\\V\341$=\027s?\027\352\n\027\213\214=\321""\352_\273Sj\365\237\020\253\273\351o\376AR\322?\366&\366\202N\327\245\017hC\254\310\t\3474z\326\273\013\034\233\375\255\302P\221\303\361/\231\216lsFV\207\370!j\207\200'\226\366I;_\316\027\222\241\200\332^e\234\272V\250\002R\332\031A,x\226]\325\213\377\002=\272\246>}3s [\245\014#F\272\200K\034t\200\257\264-~\307\215\212l\314k\335\033\036\337eG\020\032\027B\016d\337'\356\271\301\324\365;qG\304\356\025\254\027W\341\017\204\336\024\300\270@wDC\340\2414D\274\346H\257\006\343\342\355\300\212&\304\2271\222\302=\221\027E\314\333\002Wa\037\316\346\302\274\341#\305\022\313#*\273\0041\367s\255p\270\370\264\304\254\2601Y\265\007\312\347\366l\235\253B5\256\337\203\022\334\303/QV\027\365\331\216\241\216\035\022p\242/6Hv\026\004\\.\210\263\344\325\027\036\025\007\025z\214\375t\215\212\264\001\036\316>\241\003\014\252q\202\333\240JiA\2430X ?t:\242\335\322.\373\007\304\365\270\333\357\226\226\324D\252-\253\342\2660\365{\330\177\351\205h\225,\312g-\276\323J\2250\306\322\373u\377\372\003\377\301\244?\271E\363q\273*\001\345Eb\357w{\377$l\225\262\302\347.\200\203,W:\313,\030\215c\252\304\270?\376\310\177\364\324\177:\355OK\204\277R\247\214`3\262wt\357N\353E\377\342\327\376\327\317\375\347\233T\264U\245\316Lb3\271w\021\233\305\275\177`\363\307\336{\373hso\337Sl\236\356\233\303fn\337\n6+\373V\367\275\035\2552\350#<\234\003\233k\203\016\212\\O_N?\317T\023\247\275O\303Nm\020\323\337Nsm\277\004^i*;\302\036V\237\010N\341\207\\\251\375\264g\304\353\2005&\200\221\033\021$\n\246U<\342/\312\0350\2373\233g\014M\201\215I\242\201\272s\257\013u;\235`o\206\n\347\374\341'\376\223\005\177\341\205\377\342ee\243Sg\366z.\001_\021V;*\357\357\300\177l\210\021{\036i5\211^)\201\230RI\217nE=Z\2668\036\254\021\245\203\2054)\025y7\320\316\202D\361]\027\307'A\302\252\302\010\204#}\010\nK\373\324\037\202\262\241\340\006\223}\231\177\016= \344\233\342\230\323\030-2\366?P\257k\013f\032p\t\341w\327\213\211]`Qn\262\030\002w\025u]O\366\231A\002\261\334\333T\340\321uq!\213\013hcB+W\324\207\257\220\251?\227\037\323W\364""\232\360\254\376\035\013\334\311a\272U\013\367\262\312&\031}\327\365B\235\250\210\216go\323w|\n\3115\372\034\032,\352\302\000\177\304\t\237e\002\266k\234IBC.62e\374\331p\226\201[\236\002\276 \032{\035~\204\216\260\320\226=B\"\307\\a\274\370Y\251\307\277?\341O<\364\037>r\226\375j\215\027\203\257\242\373\325\022\242\352\356\220l\013$\017\347\272\" \246\243\002\343E}\257\356\rP ,\247\277\353\"\242:~}p\036\200\002\232\027nu\363Q\033\231\264\036T\273\325o\225ol\211\204V9\221ce\022#\2570\337a\033\223yY\360O\\\324\336Xl\210kf\234L\315\240\323z\377U!\361n?\234\220\330\230\360\023\317\374g\304\335\tkw\007\224\370\316\336\273{\305}\351\303u\336\337\022\323S]\034\365\357\376\313\377\027\234\352\230\227\251\370\222\013\316\222{\315\377\362\373R\377n\252S\365\272\263\331\327`\301\376\223\330\351U\000\263\360\264z\315\204\207eQ&\261\016\331j\311,Z\021*\342\031\316MR\317\300A\354\243\370\237D\371x\375\216\372C\340\315\021\31044-^\3459\034\247\315r\304\273M\217\376'\365\022\313\"e\231\016m\"\023;\247\014\347\243\2561\300\207\225\227g^w\375\223\027r\337c\301\307\311\327\334\024\265,n\003\276\370Pa\220&-t\230~\223V\312\235#.\372,\264\222\324\352\300\301)\353\313\341*V\341\322_\374_h\345\236\t\371\364.\344\267\ns\305G\245A\177\214\226\242\247\377\201\022\262\021\220\267G \177\034\306\3171\264B\035\244\316\0328E\0359\223y\232M\362\002\315\344\242]\024\033\253J0\345\2373F\200\241=\2505OC\263\242\307\370\246\n\006v\034\346\225o\225\304\253\014\322\222\244\254\023\207\336\\K\0171\327\244<\033\341\n:\227~D\327(N@?\364\221<\243\314\026\246\255\014\303*\002\021\345\0147\272,y\200{\375\231\027oj\351_yb\036\317\016S\3413Z:\353\216\355\364\236W\370U5\307\323_\262\262\003\370\224\006'\220\341L\001,\001!\341\350\033\217\026\240\t3\020Y\375\374]z\232*\373\031\035\326]\343Hg\367A\r\351_\262\027\360ae\2133\300\000M*\357\223\241bO\351\323\322\246\377\220\346\220A@\252\344\346N\235\350\"\024\207\242j\343.\021\302~V\373q\320\274*\037>\002\023\034}\375\021A\257\374\302\325\t\331\360\342e\232\225\2117""\017\323],.\337dvL\201Nj\006\252\236\247\333e\371\310\017\273Z\">\347Y\203~\233Q@\273\005\305K_\335\314\355\250\342\232\273\255e80\r\002a\356\265?\366@\177\034}V\255\371,\025'\335\"\233@\312|\254\207\226\306961\337\241+d\356~j\007\317\010\354\312\234\001\215\370\333\337\2119\036\377N\211\213\356\265\003[\210\025\2439}`\317\221zb\275\016\037\247\037\236\330'O\211\272\314\33020\357\022D\254\340\202[\003\336z\020^K\242\235\000v\3211\025\225KS\241#=\002&\013|(4r\363\010>Tae<\357c\203\010\207`\241\007\315\225vi6<\244(\013zs\262\240\333\260\230\241z\037\305\033t\345\007B\225\207\353\355\023\355\317\333C\365z\240cd\217\274y\216\370wT\213+NkK\207\001\t\213b'\367p(\310l^\241^\367`%\306\332\376)V\240\362\261\343;G\216\342\017L\326N-\202\357\352\320\220q\240\303\247b\312L4\336n\362\032\307\351\231\225\201\341v\230d\007\276'\203\376\365;,\344\226#g\300!\231\212\332\265\354\213\257\345G\324\010\241%\026\346\354\014\261\330-\260_\226C\205\215\371\277\273&\014zd\003\007\217\346?/6\225\004\326\312*$\376\377o\256IL/!\016n\250\324\036\323Eu\274\312R]\016\321\270\226\341\023\261\245\2352(\014!}\017\354P7\213U\305\206b\262\270\252\364\211\301\n\321\221\271\235\375N\304\233\023\231\343\031\313\223\261\233d\322\r\200j*7ij\220\206\306\235\343\010mRd\277\357/t\334\350\3221\302\206H\207]9\264\372\355F\341I\361g\3041TSo\232\2508f*\256\205\334q\346\225\016h\212\026\360\036j\202\306\342j\020\002!v\261u\376\200>\260\376\030\034\035_\322\373:EpcI\364\203;\366r^;R\033/\337{\245\307$\237\224+^\001\035\025\323.\3525\264\353\205p\030\273\035AT_xPX\r\311\\k\354\256=P\030\263\237\322\373'\236\262sN\301\250G=\345\002q\267GB5\003\374\317\344\233D\271\026\224\267\236\006B\231~\206E\353EO\277\310\016\037\233\376\010\211iO\375\247\317v\032\030l\005\322\307N=d\2325,\325\364\342S$c\335\240\316:$\216A\027\031\177\207\336p!\367C\241\212D$0;\257\375\247?\373?\303C\006\345\303`\004\214\212\242%\367k\241\037F\036\213W\201@\210\205\200\276\000J\221\026\377\014\213J\312\261\2405\363G.\351D\017*W\346\033\014i\332""\217%m\202A2\271\343\301\236\327\236\022EP@K\206\004\t\037s\267\227\325D\n\230\333\272\247\031\252d\306\264j\346O\252m\"\026g\2303\"\030\375CSn?\211\265/h\250\326U\322\356D?\351\306_\376I\242ba0\243\302\330\237\370&\321\231\237\245q\265]x\275\013\350m\314G]\372\033>\252\213Y\244; N\177\246\243\244\277\021\240\375\231\311\201\023\377M$)F\327\220KJ\305\306\004\333\261\221\376Y\006\240\201Q{^\346ZD 1\316\230!\373\305\020M\257#\2459\377\341\243r\364\304\376b\362\203*.\357\372\273\253\036\2705\214\372\337\021\371\006\t)GN\3011\343?\014w\362oYKX!\220NeYw\207\320@\234>\003\026\3744\206Z\013\206\327)\034\2362e\255\227\000d\016\004Z&}]\273\376D|\340\202\002\343\237\3647\024h\252-\250\212\257\201\r\016\205\337mL\034Y\306\332o\220 \331!\250M\274\214\335\220\350\264\020C\246\273~\316\277z\273\264\277\224\004\320\275G\013\277G\353\306pnu\267\353\277\207\002\340\201v\203I\354\336\311\377fx\311]\2366R|\\\272C\003\222\206\336\321\332\035\305\362\367Z\372\276\036q\203\214\023\000\354\264,\306;\362nf\2165\0067Y\313r\244\221\223\301\000\n\240\2335\2370\230\364;\302\305\331\312/\320A\327MA\304\351\207=\276~\327\307\007\001\250\375\037\366\370\235\023'\215j]7\304\230\321\370\321:\232\200\335,@\0273\262\276\010\371\315\266\363\226\243\0078\343\304E^\344(w6_\234\310\004\306\366\3374N\252\266\324\257\213\325\321h\020\002\243gH\203\240|\016pY[4\331\310\240\245h\330i>\341|!Cef\314\322^[\267S\213\317\253\2239\333\247U\374\220\215\023:R\363\031;\314\034\204\236\265\220\254P\010\342\000\263\351e@\217g\333\303\200I\355\022\357(?e+\374\3775\233\017\225\033\203\306O\332\342\345\351!\033y\217\027\034\270\200\367\273^\024X*l\231\304\344i\006R\243\231v\231c\317\367\005\202\2658\234\261:8\327A,\354\305o\331F\317d\001\027^e\003\365&;\261\004PN\332>\372\242\260\217\370\334;\314\234\262\362\\\327\010\352\316\227\324\r\227\002\251\301\200\002\213g\344\203\314\252~K\025\326Gp\371\217\0309\242\366\270rP\2649\361>\355`!\275\3129z.\0104X\177\332\306\247:\231\351\313&L\\\265(M\313\342\263!\353\365\220\262@?""\021Jhl\t\332\225rZ\320\300\0025\324\224\265\220\037h\026\330W\334e\033\"\216\247\007\322LL\331e\001\237v\322N\004d`\327\211\307\025\002E\177u@b\253\354\356\262\213S\202\343\377\022\347\375B\357\250\007*\177m+\272V\270`\036\026_\"|\222\252+\231p\222!\257\203:\003N\251L\274\3079\241U{\330{\201eI|\204\265\264\017\374\227$l\303g\204X\215\201\017\342\221\376\027\371\246\375\305\224\340.\305\262N\263%\222\343vN\237\33191@\303\355\244 T\335\344LZ\327h\366\302\241\224F\006\233;\363U\"\037\303\313\252\0062\265z\355\347\271\2209\362\353\302\376Br\367\010\203!\222\342\357`\301\210\276\274\347\243\336\375\215J\352\362/\266$\204Q\026\342,=\014\001\222A\005\372\024\030\023\3035a\314\262\201\265\321oD\255\016\313\014d\335\337\237\330/K\224<\207\240\345mU\366\323\\\022\353\242\202\232:\227\253*\007V\262z\277\376\202%\r\017\2505\232\026\221f\204\037\350\234l\314\330\361\364\345\275\023\231S\331DYaKt\323\"')\355l\274,\030$\222;\314\ti\333\\\2158\033p:\266\027\254\251\321\363\203AR\224m\341d\016\311\333\374F1\316\025\236\021\241\255\203)\022H\nny9x\016\226\201\027\"\324(\357u&Ot\301\002-\276m\2129fX/\004 \350\033\030\367b\230F<+b\247\200\221\n\252\331\254\302\265\004\262\202\207\177l!\360\030\004\320\263\366\004\353\206\204\330\325\236b\213\210\0005\353O\374<\347\345\373\n7I\306\230\362\307h\256L\372\223/\375\227\253\376\352\206\277\261\251\327\200\0165L\034\245\254\001\236Wm{\220y\021f\025vN\236\332a\315\311)\301!\372\3534q\254\221\267\363:\315\346\1772z8\253p\264\320N\365niu\252\361q:\"\363\312\257u\354C\271\362)zi\227\202\322\272\310J\020\345\014\305fQ4e\317e\377\362\367\376\367:\303\305`\304|\337\301\2520\020\251>\270\233\031G|^.:\262\006]k>\200\200\355\210\205Q\034\315\237%\026e\264\330U\234+\251\245\020\303\001\216\000\227\363A\014x\024IJ\233\364\367\347\223\3629_\025\376(-\372\317\340\311\262\323\201\304t\337\n\202\343\200x\016\036\320.\0271\366\277w\027hs_\243\006\211\t\0258\216\315giu\372\264\264A<\020\325\214^\336DT\346rf\306\357T\236\221\354GD\247\332HJD\314\375i\301\256QR""\325\343\217\025}T\236\006\377\363o\215&\334\024B\316\253d;\270\362\267\332\016b4\365\215\371\337I8KDu\365\233\254(D\206\202\366\3541\004A\200\362\202\222\366ih\223G\231\033\2423l\217\270\355\262<g\254\356:{\350\234\343\202=\244O^K_I\257Z)\020\225\351\2746]#1\364\212\246\274=\260gpHq\213\022\306\252\336\303\250V\001\310\t\246\230\370#\263\327\355I\244#<\374\346\tg\333j\317|#|\006\274\340V\263Gh\220\374&^F\242\025j\245W\267\010\260\017\374w\333\001\002\310a+ec\270\272\226\375\212D\254/\202\374\310viB\234zC\245\303\342\007Z\363f\204\361kW\005T\264\221\325N\354\306\211n\333\346\000\245_U\240\232\362\357\000\361\374\225\275}\367\027\026K\355\245\257\375'\254^U\247gt\224\220\34319\266sa\000\206\322\235\013\320v_\000\246\343\205\033\005\227\333\215\333\375\377\233\370\235M,n\243g\251E/]\201\323\337\316\245\257\351\313.\241\235/}\245q\"vibv\006\305\205\255\203\371e\177\204V\317\227\360\201\324\236\223\303{wZ\250Y\201M\241\023\246\271\306\366\226\314\213\034\003U\374\236\033\213\261\014K\3015\345\226\240\"\r\206u\322-\340\2042t}D\3445\"i\340\370,\336\026\272\321vjOf\272Xv\252\345\310\001\305&\325r\017\362L\036d-0\272\265\266\236\310\022$\364\372S\034A\325\315\262\361\257\205\313\205\244\3702\301r]{\212\341\362\252\364\363n\000&\357]\317\023\373\223D*\234\206\304k\370\2462#n\260\255Z\355\224\365j\245\227\217\t\340\030\234\262\"C\355U\257n\247\023\364\367\004\315\222\316>\035\223*\310\201\231\204\025Rz*\034\353\332m\022Gwj\374A\023:\341\0340\350:\030x\304\220\366^\311\337B\3142\234\364\rDZk\260\263\312\363\354\335\250\2673\014j6\310j\207\376\235\216^\001\r\204\214\326\202\327\264\"\\\256J\326\262\257\271\331w]+~\307\022ks\262\212&\253A\357_\377\241t\213\026\361r\305+\304\326\274s\202\306\270\274\371\322{,\025Llz\262V\222\351\027\216\313\326\007/\036*+\\x\371\200C\204\275\322~\234\350\364\225\362\373;\215`\330\017\024\235\316\212\027\370W\312o\327q\364\250\230S\273\316J\216\273\224\277,\376\356V\331\234\304\346\276\317\r\354\021'a\202\375\241\020\226\347\364\341\335\030>\310<""\332}^\214\365\001st\006\226\327\263\227\340\245.\256p\321!\273i\314\207\221h$$n\204\207\345,Q\350\316s0\003\242/\216\210\267\352%\245\211\017&\352\230\321\023\005\364m\\\\\"\225\251\310Ma\205aX\337\314#d\\\003\022klD\021s\352t\236 \343\242C4\005\363\3518g%\261,:\377\315z\261\253^|\275v\316Xn\304F\2402\312W\366\215\3319\331\235\375\027\013-'\235\253\2423\356\214\314\n+\237\205P\221:\315h\355\337SO\313\017|\225\272b\0003\016\037O_\025Q\335\200,j\035\275\247\000@\366+\334)\333\247\022\324[\222\312\303u\374\334w\305n\t\275\352\224\343\341\342U\340z\204\206\316\017\205\232\342\017\376}\026F\340\351s\344\024\232\035\246\203&\026A\372\341\346\252v\320\324\034\347\254zI \"\257\312\n\354\034\234\346\364)\366\216\213\017\254\335\213YD\r\364\240\r\234\207\036\023\350\201\230\024+\235)\263+`\007\373\376uf\306qE\213\312\"\223\330q\316A\321\032\234+3\251\237\2401t\233?\351p=3\370j\203\345\324(\367\2701\304\224\372]\225\323\337'\204i\321\236O\237\n(\255\036\251h\207\251t\013\344{YX\036Pm\272\322\317Es\032)p\350\355eq\300\254y\363\335\233\347\351*kG\022\212L\213^Xt.\020k\254:\366\205\252\030\217\016\273{\325%8\276K\345\376\016r\222\340\203\002\305\026\232\tz\376z,\370\271\366 \035\270\370!x\331N:Qo\364\2651n\224j\251\260j\337\343\324\376\024\255e\317rZ\203\335\236\255\013\326\250\031\r\344\3414s<\232-d\261\332&\266<\231`\251\212\025\n5g\317\007\364x\244\331\234\272\265V\200\027\020\326\332\250\332\021\363\261m'\305\324\371\r\377\376\352\232\032\376\301\376$\300\35339\315C/w\306B\220\336\333q|=c\222\027\007^\333Q\023\031C\264)\n\255\022-\306\0249\367mH(c\221\375\251T2<\221\211\236\207vm\276\262;\024\355\\\257\355\177\201A\342\030\370\271z\214\263#\030\306v\303~\241\260)\371{\230\221\342\340\220\246\364\037\331\224\360\004\006\354\037\262\330g\332W\271l\364\315\315\3544\275\241\335pZ\376\232Q\205\203\347\014t\010J\354\342_*Y\306L_\313\315\324\360\222s\371\211\302\361\302\315\342g\010))\207\313\207\013\353\305\033\3009\212\031\004\345\340\233\205s\273\250@_uC\036G\217\377\177\242!/0""\204\035\322\237\\\021\357\234r\270\374ra\032\030\022\245\261\217i\310S\340\245#\r9`7\2442\210\263\353\316d\366\307|\373\177\273!5\200\257\177\346\261\377\370g\377\347_\374_\236\373\317\241G\367\347\027\375\305U\177\025\360y\025[\024.\345\010)\035/V\027o\243\335\312\341\362}\305+&\300\375C\232t\347\324\351\262\030$4\245[\315\032\346\2178\233\352LB\013\363\\R\363\346f\232}aN[i\322u\204GW~\2560Ql.\325\303\364\213 \016\\\177\327\244\262\273\312\227MH\002Jm\260\237\200n\342l\3667a2\215\267\177\22099\370\021g\300y\325\320*7\323\351L\"&\261\323!\013\364\331(\027\373\3350B\306\252\371\217\322\335\324\231oF&w\r\037\005G\320\257P\253[\206o\325\311\314\217\025\256\026kJ\367\374\247\300\364\364\347\220H]?\342t\027b\006\004\244c00\367\242\202\355\362\006\006\\\3467$\250\271\352$\204\331Q\255\263.\335o\347$\352\0351\232\203N\225\313\347S\341ew\301\300\035-t\222\220~\205\256\373\324\000 \350\245\0221\242M\315\370\013\274\030%\374\352*'\371\031b\266z\263\360\2448\246-\2051'\002\010\313\226w@\022a\346|\242\202\240\206U\336\203aq\364z\027$\221\nSQ\372h1\232md\022a\263t\3648\360\373\357\3425|\230\363_\354\027\270\234]\031\t\264\016\377\310\032hZ\250\rJ\036\363\251e\367S\241\261\253\321\026u\211Y\000\226\317U\245\331\322 L\036; +s^\212q\271\334\003\001\216\302p\036\026\236?TP\266%q\004\337_\316O\025ZKG\374GS\376\224\025^\0059\3536h\032\007F\260\252eP\345\232\267=\023\217h\037\031\025\357\005\025\320\356\315s\354\270\032:\304t\037\347p,i\240GU\177\0014U'{X\324i\340\001\247\300\244(9\231\351\021\265\256\361\021\177H+\223r\002\027\037\361j\"\242\236 \377\303G\274\347\234v!?\235\371>\373o\216nW\030\351k\254A\301bwx0\377\274P%6\346\227L:\004\252\271\007n\231;\207\007\220\232\372\277\372r\3260\262\356\314\362\313\207R\234M\262S\231\343\262r4gj\330\226\032\354t\260\314\211\264!\261]\253\302\034/\345\222.;\215^\345,:\273\255\202.\016XU%\236X\214{\320v\304K81\031\\\370\033\343D\031\225\226\022.G\234k\250\020\311\212\320\033\204\226\211\305+\366\255\1775z\232\335-\242\031\224\331\t\013g\214_""\257;\255\340\256\014\232\023\370`\267V\2404\357AT\205P^b\253\276{\360>\010p\237a\250L\244\353\323\217\250[>\201\252\237\355\362`\"\252%\362\352\2304T\231\005\353\375\000\254\331\261w\003\313\214\250\334\243\005j\220pBS\027\263\376\n'Y\032\263\263\034\213\001x\206\356]\207Z`\307r\265n\320\236kn\201\026\370Og\356\342\243+\274\276\201h4\316G\340\362\215\013F\350\271\345]8_\261+trl\212\362\247;N\037\263\236\351\177{`\317\341Z\216\324|H=?\305\272\266z\301MQ\221\262W\363cZ\213\200XP\217\341x\253\211c\256fU*\373\303UsP\032\347\227*\313]\010\031\216\334\005\355^-G\302U\232\350 /\266\366\321\314\363V\333\021\376}\246\241\310\307\263\202M\235O\356>\t\203UU\275\361\202\212p\026\204\013D\3714\005\251\263\"l\254\nB\257O\377h\244\354\250\230\320\244\340\220z\263\032 \212\1774!\272j\254L.W5\222o\200\033\001\r\375\223\000\2408\323\225\275\233c\034\342\363Z]z\311J\367\244\375\035\017\345\007\362\017\375\033?\300E\253\334\014\334\331\3307\313J<\"\341\267\3710 \322\006lz\320\324\377\243x\330\2777\343\317\244\374\324\362;\202\341\341\242>h\321\355\000\270_C\222a\320\014H\220\0208\3153\376\217\304\254\nb\312m\330\375n#&\376\213x\336\363#\3758\204/\335bg\377\303\340\332\233~*\255\3564B\347\324\324\225\275\223\033\023\330A\036Vp\206l\0223\256\3329\3536\033\307\367\353 \177\265\272\254\222\304\222\201\330b!\021\205\017F\231?8%\210\216\"\253\362MT\353\013\010\375\212 K\010\244\003[o\242>\312W\3055\306\362\3072\252\335o\270_\230\261\372C\340[4\372\2129'\334T\322*i\020\207\247\262`5\006`\014\234\203i\347t+\253\n\005J\223\341\004wN\003\325\210-n;\247\317\260\346\326\270\217\257et\004\366E\377b\202\023-\364\177]xZL\242\231\225\031\341K\016\317\375&\177\022v\243\256\2302\303P)\261Y\3151P\233\003hT\266\307\347W\265\247\360\026\030\261\210\347V\017S%\005v\373g\036\324K\315\000\243\305\224\016.\257\325\342e\017\020\342w\316\r\352T\362\007\215\317\266\354*\002CL\367\316\021X\010bU\300\2551~\265\266\203\255\266\260\316\321zw[\262\354\275\203\253@\260\007G\003\327\034\0161\026Q\013\010\003\316\345""\022\266L\327\246b\202*\302\253Z0\322aP\312\350\261r\204n\223\3541\010Z\262\304M\325@P3\251\266\351\265\234\245\025\274\313M\036\334V\027\035G\353\250\304VN*<\327\267:p\253\336\305\243Z\002\367 \202\324K\370\2445Ll\330\220A$\353.\264\007\036\347\203\254\376\374$\377\220\344&\330\363\203\316\022&p8\273\255ISE\356\212\030O\342\256\352\321_\310%\260s\014T\351\270\030\270\006\200L\360[!a\325\007\260\014\2273\263\331{\371\272\340\000\272$\032\320[0\022\273\336M\220\365l\236\001\370\031\307iR\237\317\215\005\007\027rl\360\336\020~\3032\361\036\227>p\234\332\016\260+\363\373\325\272Ni0\376/\324_\323\325\355\374\273Z}\360\377j\253\023\017@\334\323\230\"&\370\251\027\003\340\027\025=\363\273C\020K\002X\334\\lV pJ\357\036\202vr\320\215*\000\033\271\020\344\320\312\351,\237&\322\240>}W\331\362\330\211\270.\335\310a3\211 \230\003\312\310\032\345\022`\210\001\352\301?\265\370\204Z\301SyR%\276\222\237\211k\201\005\255\225\257z\237\202\266Xlw\007\300\357\254\350\000M\274\320\245Hz\3561\343\007\243\314'=Y\027\212\230\263\330\272Q?e\253]C\370#\352\"\273\017\234$\036\271*\013-Q\2751\014A\025\027g\344\\\026\364{\377n\227\031\344\333\302\256\227\231\360\213\310K\217\331\255!pO?Hd\357QN\347\310\226P4\305QvR\022_\237U\033\032\347\360\233\307\014O\316\006^\004\240\251\006\227D\336\235\254\0242\2124\342\007\257\261\261\036\221\273*`K$\210\345l\270\271U\nm\273\235\003\200V\226\216\352\031\356\256?\354z\320nP\006\016\312L\007d\272Ve\302\245\250\276Y\305\3208V,\347\r\3123\352l\200=\377\253J6\036X+b\236\256\235c\003\250\032\250}\333$\377\267\343Ybr:5\346\304[\341X_\356\204$-'b\221^$B\263\020\250!\002\2107\370\241H \276\272\341\222\276\341\"\022\032\024B\210\\`\365\2729\256}5\346\246\245\354\327\332\323\310\326\271<\244\361\331\300\030\334\311\230\252-e\277\262\336\024\200\356)U\240\021\315p\313\003\006<\3740EC,\n\274Q\302[A\013$\257j4\353\356\274\002\304\377C\353\036M\2676\246\037\244WC)y8\263\274y\321@f\314\352\254\026\334\302\330{\001\326D\310\307\250G\370\026\241\240\214\377'o\3533\2676""\304mBTB(\n|\224\024\322\252\t\250G\245\3723\211\367>@\025\240\254\263?\372}^\274Y\030\333\355\261-4\001\316\t\213)o\010\350Y\243\225L\312\"\263vr\212\376L\302\235_\366=\006}5\220\374\355{x\324\t\336P\273Atw\260\210y\236\006A\213\033\002\227[d\215b\275\254\343\016\026\361\254\311\262\255@\221\023\002\263?%\023\374\257x\3349\007\252o\200\323r-\026\272\330\037w\027E\335\333\317\366\264\264\276\235\250\002a\375]BL\004\033\3543\355\017\240\017\273\2158\244\333\020\332\366\375\231\005F\331\03220$\261\257\001\355\341,\033V\257\215\352\334\331\002<\332\037\275\352\254 ~\212\344*\326\255&^\023\032\032%+\367\204\301I3\264 \010`\210\205\367\272\340_H\024\353\234dF\016S2\210\000S\361\337j\320\260l\360\016b/\256\226\300\347\260\222+\227\366u{\254\335\207\035T`@\315\314\301\321\2648Zj\267\\\305\376\262W\231P\351a\016\366\206S\370`\261n\3277)\005\340\373\274\351\211\255+\3332\3200=\264\344@b\331,\214\305\275\351\356\337\372\246\003\326\233\276\372\223/\n\250\224@#?.\334r\272\252\\sx\347H7B\350\334\354\352\240\3512\225\217\360\313\210[\204\346\203\2759\331\336\333*\253=X\232\375\332\272^\326\301\000\232S\236\226d\366\305\272@\304\304\205X\243\327\3049\272\354.y\227\001mJ\263\246\375b\356i>Y>p\020t\256V\014\267g\000C\376,\277*\220d\263a\224\373v\023\245\002$W$\033\353\340d\223P96\227a\r\353Q=\247\271\374\214\023\275\240Zx\367\014!a\227k\243\033\332\277{\256y\016%2Yn:\221M@\021~+F\243\n\331 \252$\344+\021\317rs\264\277}\257\341K\246r\212c\3570\311\020\354\223*{\270JB\034~\276\311-\241\">v\032\233\354\312\252\0108xu\234\274\234\377\332\377\307\023\377\t\247\252\372{1\315bb\364F\013\237\007\210fNy\017\240Vid\032o\256\220\177\302;\224\224\355\374\346SP\n\351\375\323Z\352\230\021\210\000\316#m\036\357>\317z\200\334\313P\256\316\223XF\300\320\3560MK\335e\026\363\243f\262\252~l\261\313\032$\365\274b\247\034\234\332d\216\023\216V\301\301\367L\306MO\325 J\227\260\034c?\227\031\267\203\361\217~\216!\003\300\256\204]e\033N\242^\305\317\356\"\326\251\313\332\343]\352\214\\\247\232\241#[\027+""\375\251\201Yf\200Qv-bU\005\353\367j\016\203Q\3546!\274\016r\225\225\234\260\314\0162\325P\242\311x\274\315\276\370\314\001+\324QI_@4\261\3668G\020\034\257\207\004t3\343*\363\332wz`\327\3519\307\036\013\253\025\252\245\325\216.\202b\327\337\\M\327\037e(\327G\314Hg\217r\2560p\324\225Tp\273{nE2Z\377\337us\023\323n5\211@H\267\223(\207K=`;Wp2\021\371y)\210\021\251\255\333\251\3206\357\345\276\\\261\371Nf\272Y$\373L\003\230\272\355\271&\000\037\301<\376\250\306\204\375v\200-\253\0028[s\270l\265\343\214r\374R\212\221\210\3634\273*\331\336\323\354$\255\232\023\n\002\307\177z\302\244\362xW\233\302a\375l\250=5\374\022\253\320x\r9-R\223\316\304\334b;#\014A\227\300\226\037Y\305\022\342=\370o\206\366\025\247\0176Y\037\363\217I\352\014\344c\371K\"\351\305&\322\001\337\034$\234_\025\375\270\212\256\007_\361B<\200\014V@\354$\371['D/\211\3717`5\023\246\261K2\233\034U\376\334\010|4\346\351|\0231K\303\205?T\334\276vP\n\237\367\212\237\373c\023\376\304\277\374\177\211S\335<\024T\310\224rX\264\271\341G\007\016\245\337\226:K\317\374\307\n\247\270\034>}\271\260\\\032\367\357S\233?\367\237\343\365x\360p:\266\276\202\261\272\036\275\247\034>?Ul\365\357\217\373\343\324\217\2149>;\207.!\212\353\237\276\001\275I\321\001b\212\033\2476\034\204v\362\356\313\337\"\351\243YP\355*\024[\321\246\r\314=\210\301V\245\354y,|\2532\013\237'\216\027\352\344\037\245\211\250\375\251e\227\374%\370\234r\177\373G\330\224\303\310\324\255\226\373'\033\267@\220\364*\323\373N\343\226\003\254\255\260i\376VKW\244\216\037a\200\023\364\276[\357\022\306\377\212W}D\013\350TC\311\377\305\026\371;:\352\360\021P\023\342\"\016\325\210cJ\340O\331\032B^4\366h\223\222\321x$\264\261\324\230\264`]\255.\204J\361\327\342\225\342+\330[\200\273]\031\023\022\374:\377\340Cv\352\321^\216\243\202\304\020\357\234D\220\265\252\350t\225bD\017\277y\244<\000\260b\003\235e\020\241\314\201\230w2s\326o\207/O\354^\310\307\201a\324\350\307~@\360c\314b\202\271\324\253\374\236=\035\204\352 2E\316^\341D~p>\032`|'\221\345\313\026\222\206\343Y\025*X""\2435aK;\216\251\003\265\356\301\035\272\246\325o\375\202\205\272\376!b-\366\021\0174\314a\323\375\003:\tb\201\003\313vs\222P\301\301\025\235$\244\005\352\231\357\372]\344\3650N\247\026B\031\270\377\335\356\023c\372\221X^\005\222l..(\253'\014\\\17740\361\214\331\343\231\0073\233[>dDG\007\262\035\263\360T\242\236rUN\260\344 1i\213\305s\245\353VR\222\212\230\247T9\240\250\374\271\3121L\352\373U\354e\361\004#\255P\335*W\014f\325&\314}XTk!\214\327\301\303\021\326\206\247\271\227\332\016\002+\313kx\201Y\263[zi.?&&\016\234y\2114$\214%\235\310=a\307\000\023\027=\302V\000\026\340Y\035\260*\360q\210\366\037S\307M\010\240\244\271_{\234\361\371T\224\336&\2337\006r\017\030\264x\265l\n\027\363\035\371\357\340R\245\237\244\237{\"s\002P\022W%G1\216\033$\210\202\243R\005\302\253\023\316{\226\3555**\233\324\361\271:[\\\267\354\303\246\330h^\034k\227J\364\3111\367q\010\016\216\037\227\204n\253\254\270\355\342\351\245\325\350\233\352C\204'\016L\177\214\254V\320\031\005\231tu\204\262\345\302\271\rh\305\267M\372$V_\\\317\336\241\376\031\017\354\\\022\342wMr\033\333\371\264\257\022\033vMG{\302\363\203\2234Bm\320a7S\267R5\256\n\022f\373\316\261\266\354\301\\\235\370.&\255d'.P]\024\317N\251\213\216\247\277\311\266\344VC\220\260\312\\\334\254\036\352\332\242\222\226ZA\2515Z3\311H\246\0338\271L\307\030z5.\350\337\001\221Y\026\314\224\335\263p|^\361\022\341 j\261\"\326*6B\321\215\3327\253\200kg\357\3259\023\251\246\323H*\207\241m\255\303-\2033\335\375\032\216=U\327YT\275M\273$\313\316M\235_\031sWoB0\"\201\307\321\000O`\355>\024\030\200L\304\264\300^\016\360rS\313\336#\3043\3575\210\315\3534*\257H\026jk}\r\\\223\340\343\330+\261\033\362\310j5;\272\241^'\221\240\356\243o\013y4\335\314\035\244\361\363\2640W\034+\356\0262L\204\276F\014\267\275\212A\t\262\337\324\247\357I\224\360\r%\235\177\242\225*\221\002@Y\261/\355g\034k\221\3349\\+\360vAIp\225\364\343:\321Mv\310\021\254^b\n\262w-}|\320\346Hv\004\230\254c\312?\345\257{\220\222q\372\0055\302Q\322_\206\272\034\243\231\231\315\370\237\331LB\002z@""\342\2275\345k\335\365\320\200\374]\311o\024n\025\207Jg9a\021D\317\367x\333h\325\307\274N\307r\335\342\024JM\376\375\307\376\343'\357\361\266\033\037\3632\305\343\354\234\203\002\322\374\274\307\333\276\372\230\267\351l9\301\207\221\370?)z\366Kx\340o\2201\030\246\245/\027J\034,\370\253\347\350i\267%W\205\261^\211K\311e$a\206\347\342-\321\202B#\322\244\364c\307\375.f\307\341*\205\200\320\2039\343M\364\024\344\315\254\267\001]\327\036b&\277\226\361\026j\266/\0139\356\360e\002\252\354<\215E\355l\235\253\237.\333o\352wY\001Sh-\210\332!E\001z\370\3250\276\327\333Z\3728o#D\322B\003\246\177\366g8\213\352Q\316F9\"^\265Gv;0\225\3319{\221\231gg\023i:E\270\346B\013g\244\256N\356y\263`*\203Rw(E\375\254\316I\244\365\366\307\260D\326aQ8L\2032$\367\032\210\354\237\321\344pK0\330\301\254\006\214\365#0\253\307\3417cofi\024a\205\371\ny7mw\277v\326\320\234bES\214\267\260\3455\260\177\31714I]\013\306\245\361\221\3504\256\327\216\272\336\001fu\323\3272\307\367A\0277K\316\344#\226Uf\226\227$|\351\325\222q\034\256o\330i\000\373\320(\310\327=\002\243\244<++\033\3256\304| \026\206\363Y\205\372sC1\250'1\374\312N\021[w.XF\037\361$x!\316H\000\224\252\332i\303\244\327{/%I\216\225\303\320\010)&w{\264\304\201\245F\202\271\205\342V)Y\3628OK4\3338\206m\243\223g1a\033\312\354\344\213\t\2033\336\231m\337\305c\317\nz9\214%\371\360\347\222\321\016<\325\315*+\364\345\313\314,;F\306k\267\313\2340pB\222Z\206\243i\"\017\376\207\375\340k\214O\271\0258\372\274\337\203k\243\217\375\306z\352u6I\177Z\301\334\363\261O}W\374O\370\251\206\237\r:!\344\017\251\250/$bfg\217\231|K\2474\232\370I\3033\251\340\010\243T\321\314j{\340F\313\302/2\311(^\316\204.\350\364d\215\214\313\326\357\210\027x\316k\370\321\277\307s4t\335\2668\330\205\226\236}\230J\225@\024\361\221G \003\366)\322\2538\312y\366v\222\240\030\343O1\033I\033\335\310\201\321\373\n\306&u\354\370\316Q\226\003$\025e\017\232Y\t\223\001\002\215\022\245L\\\326m\205G$\300\2005:\001\267\340\345\371\355P\262\265\237W\213h\r\244\227)1\215\010\nq\320\372\r\310\242F=?k""\205\031\t\302\371c\242\261\375\327\013u\246\363\235\354\337j\247.\354\235\200t1\307\363\t\206\254\037\263<e\321\377]\312?\232\035\251\214\335Q\345\n6\262\243\212\247\\\225$n<\372\030\304Y\204\362\003\201\276tS\361\326U\306[\342h\310\037\207\305\374\223\014j.\316\024\326\335\372:\266K\377\307u\351\013\345\035\351NK\006V\345\233\325\352\220=i\254\237\213M\245\317\210\334qB\324\257\004X\330M\367\033\344\003\353\027\225\000\026\346\276\\L\352`\223\251Y}\375\r\300\376\202\004\272\227\351D\346U\025\037d\324\005\222V\252\211\271\307^\353*X-\177\305 \t)\3019\341\230\304\267\320C\217q\344\346\235\354x\356\020\327\275\247X%\"\217\350\256\353\333cv\250w%\234\037? J\263\376\354\262\277\274\2020DqMR3v\232\321\320\022.f\272R\305C\267\251xL\330\307\272\330\000s\0202\230\232\355\261wq\270\201}}s\276.\366\372Af\211\345z\203H\3169<\001\266&\004\2541\244\307S\300js~\303\271\300\375\031\253\333\240\025\345\211Y\313?G\205\003\351\003\351\375w\356<\370`h\265\373\375\372\300\345\003\036c\354\203\014\252m<\032\017\210\346\345}\n\034\247\321^\210\277H\274\321\003\264\303]\252\1776\360Dt\253\277#\030\244\271\272\270\364;\306\227\0279.O\345#\236i\237J\342\304\202\301\014\233\347\271r[Vk\213a\345\324\230\016@\223\245\233S\013S\300+n\013\004F1Y\241\320\256\304\253|\225\244\375}\244D\334\233\304,p*\254\212\305G\321\004\364\345\335\337\024\226\002\034\356wE\205\236\223,\350J4\036\310\273+\243h\375\276\220\254\2154(\032\233v\232\250\223\220\r\342\274\344\032\263\002[\\\256<\232\324\272\307\357Q4\245W\302\\\303I,\255\231\036\300Nc\231jJ\257\376\315\256]1\t#z\nG\301\377ESF\354\207\323\374\316\031 \340F\022\337\350\023=\321\023\345#Xa\217\210\366q\020:\275\0272B\230_\315\267\207\374X\037\233\000]MI\207\362\350\336\266s\222\365\276M;`\"pfS\010\255\370\320\367\004\354;V\264\204F\343\343\204\310Gx\321\025\302\236T\202\211\005\016g\215\342\244\003\203\364J2\005\344\022\002]\313\220\245\331\204\005#\376\275\370\035QWi^\255+\024J\031\017\341\026\265\027\032\007\333D\\\223\030\233\205$\276\006\307\337|""\037H5\2265\016\226\010m\215K\354\034\345\300t\216TP\016\311\300+\020\247K$w\343t\275\026[\322\220~F\003\021\213,0\334\304\035\235\265\303\3072|'\213\240\247\375\323\237\323\344\335.l\027W\255$\350\242J\030b\237R\021\263\033u^\346\253\231\275\002N\214g\2743\344\033\027\251.\016\033\271.\010\332\256\261\206\335\303\250\307\365\246\265\235\357\363/~\355\177}\2574f\345ny\367\027\376\220\253ah\022c\277k\204o@\277\177\341\033\340\243\026\307KU\245\343\245\004\\\036\306\3741\330\227\374G\317\374gHI\"qc\035\231\204\251D\004^\351,-\031S\034\235\360\270x\273tS\033`c\257\233Q`\030\303\205M\223\356\373\177\374\377\231\366\247\347\375y\006\356\257t\337Uv\345\230*\036/\016\027\275R\217\177\237\352\370\263\377\363s\3779\335&y ^\371\257~\363\177\373\335\377\375\217X+\024\253\243\305\003F\374*\035)\202\2730\320\300\007\216\261\n\030\357\264\"\3206\224\236\236\267\225\354\003\222lJ\036^\2662\204\344\005\342\236\227;\263\376\2347Y\344w\367\375lg\252\030x\202&\264w_\2570\350\362\3006\310\313\253\206t\330f\032\005~&\200\rb\252-\214E>(\242j\261,\036\215\366e\262\264\214\210\316]\177x\325Nu\315\233D\271\372\223\235\352\272\364\tb\225\260\307\232z.;\221\251S\347\032i\232\3119Z\311+\356\261\2161Ds\353\337\207\346\n\223\331\026\334u\262\302]f\251\336\026+\030\020 \336\377\215\016M\177\3377j\375]\263\212\354i%y+rw\337\207\334\275\333\227\320skiDp2\230\235\243\240\353\222\207\233I\234\2101\373E\200\352\025iG\201\2637\371M\347t\034g\233\276\304\230\215mmK \373\360\313_\027\232\213\215\254r\221\304q`\026\332\340\356\331\230a_C\336(\370\265w\203\305 \205\373\330\233)7\227K\013;\346\261\325Gif\345\262\347\351*\272p8\275\032\272tD>\204.=\306\211Um\001\343\223\3748q\331\235\014\247\207\024>\274\274rh\354Q\t\225 \031\245O\334#\342VQ\013\221\234\227\237\335\262fIb\256\206B2,A\303\030y\312<\315\030#\005\320X\026H\374\3245#>\027\n\376\016\032uO\245o\316\250%\234\025\235\3432\3615\326\303 \267~!,\362\377\261{\016(\305D\366\222\2045\010\211\033i8\264\3126\344\310\022\365~\217\320\2540$G\340\375\016|\241""\261\377$\354 M`c\020\213\203v\340\207+\231\235\032\342P\r\r\344\232\303;\207j\312\314G\376\243\352\235\310\340\273\000\332G\301\302o\251E\351\251\006\r7\254\211(B\276\000\003^\031~\375\2524\274\005\262cKB~\037\373\006\252\376<\352<\270b\356\241\017\316\007\023 \344k\201n\326\2772b\362\255X\305\222~\010b\300\373V\346O\000\372\277ge\354j\364\354\336\330_\nS\251\306i\020k\254t\261~\177\002I\342$\3058\276\321\375\300JO.3\202\033\322O\324\264\320\330\031\004z\336);\t\327o\354\007^+\356\222vX+\275q\2708(\001$\265\302/$\234\034]A\003\"\227\306\243<I\370\200\322<\310R;=\371w\201\355n\023\347\024\373\311\371F\177\350.\254\215\017\020\335-N\236Aj,\345D\036i:E}t\007\315e\307\"\275\265\215\231b\036\005\253\230t\313U\366^\350.\254\226C\307\177\325\253\200\344\"\217\036d.\344jQ\303\032\232\343\367{U\334\030\264_\225\271\224\253r\362#\021SW\016\035+\030\254\360\233\324\022\270\333G\275\022_o\365Q\337\026\264'\3117\205da\035\326\225r\350\370\375^\025\367Q\366\253Ln\210`\002%C\023*\371\027\277\311d\241\250+W<\243$\375\360+\325\202\031\370\3737g\366\373-\320N('y\204d\206i\234A\372\270\001.\306\0016\025\276\306\212\343\332\375\275\225\337Q1$\354\033\305\373\376\010z]\256xz\224e\370\346\023\316\253{\377T\372\266\240\003\227I\236\212R\311D\364\205=\177\367\013m\366\003/\034\255\3728\302\254\034\203\375/\376\001\354Zz\356\311S\221\0171\"\352._\002\226\264\321J%\315#\311\300Ls<K9t\314\254\303\216\3741O\257\014\033\227\366\034<\221\251\312\324s\246Y\201\333\354\205\317^\364\243\277Q\374\037\233\214\024\316\211Z\233u\360\217\000U,\203\262\277\307\310\276\220\373\036\234\373\333\232=\304\211\007c*\241\343\035\020z+\213\000\370\312%@\376\356\\\272\306\256tA\364\004\347\222\227(\255z\252\231\177Jg\202\355g\327\334rla\020\"1\301\3163\027\221|\320\202\326\211~\274\233\231\256\362t\212\317Lg @'\021\036\\\256x\372\021'\317<}&fP\264\304P\337\360\240\020H<\375t@\342\231\234(b\224(\207\216\025\357\023\376\316\020\223\023G\366+19\006\006\246\034:\246W\265\264\306|W\033\020J\336\361]\027e@E\026N\351""\325\207\005\3752s\3141\311\321\357R\232\247\335H\304\037\354\326oq\026\341D\277\345H\342_pW\221W)\006j\267&\374M\260\216#\234\307n\275\365\227\274*h@\243\272(\207\216\215\177B\263\240\354YF\265g\205\325bu1\004\225a_&\272\200g\202,\350\352\230\354\313\002\207\201\256|\322\225\240\264\315\243\025\240N\332\023\005\272\245\t\266B\034\0072](\016w\232\326\251\372\342\223\322\004\013/\000\231\307}?\210\221\023\221\235W\355\335\003\331\275\331^(hu\321`FYT\033\005\023\356\272\304\201+\237\010\253D}H\350\032\273DW\374\272\350\215\242VK\223\355\272\026\361\316\275q\230Z\306\231#\232\333\332\030{Nq\276\330\021\245\033\254\212\301\201\017\3547\355;-\255\026n\274sp\000)\373\032\330\356zUgG\315]\316=\317\327\024\022;u\215\361'\244\026\035\341Z\034*~Yz\2114~Q\017\354\220\016\256S@\016\001Q\000$<\2548p\004-\236+\365\227\356\260\376\365\261\200\033\0069n\364\215\017r\277\026\2068\217Qui\204\004\002\377\001]\rU\255\377\363\244?\231\364\223K\376\322\272\277\376\312\177\365\372\355\236=\377\256\032\001\332\347\310\336\273\330\334\335\373=6\337\357}\210\315\303\275\317\260y\266\367\237\330\374s\35746\323{g\261\231\335\273\206\315\332^o\257\364\372\311\340c\353\\0\315x\311?\024\376\356D\253WF\340TI\214\033T@\361:\240\235\255P\360\370\367G\033\272\315\3520\201o\356\217\233v\242\374\344\267v1\334s'C\362^A9\203\022\310\310\326\272\334\323g\334\343\3266\261\242r\240L\263\225\273\250K\257\214c\254~Qjc&?\202\324\020\177[\267&]\261\267)w\357M\231b\006\032Ct\224\310\351\376\205\362)sR\020>\006\356\252\006\217\020\277\206O\304#\233CnU\022 \006\306o\017\301u\323\242v\030\315\353\211[\245Ni\004\270&\277\177\264\230,\256F\317k|\247\366|\277\025\242\n\311v\354/\257\250\3150E*bX\315\021\266\306V\372\020\360O\225+zA\231\375\316d\306B\201s\357SA\347%\321\032hQ\006\010\231\221\223&\362/\277\352T\217\327\005V<J\313\301\035\245\346\2042y\346\334\375\003\312\303\206=\270g\304\032\305q\301\376\261\216l\207\014.\220\347\tq\271\371'M\326!\266\224\320\013\317jx\325u\tw\023Y\022\322\270\264\314\265=\007\033\224?""\326\253\334\001\252\350\024\003\211\ta\017\256i\327\204\274M{\271t\363\312X\025\365\320Q\306\265\017~\210\r\356\222\344\346\234-$\014\346{P\343\276\240\3060\257^\323\270E\221\013/U\272\320i\000\350\035\343Z\200D3\372\013\352\337'\021Nc\026j\362I\013+m\010dH\264\214\000\177\377\320\333\202\372t\241\235\216\346~/\214\375\331y\365~\303\326\277z\227a\262\336k\344\376m55\221\246\304\367Gj\"<\352\254\177\345\016\007N\3576\001\355\232\036\255-\007#\301@^9\3436\200\002\204\327\\\325{\335\024\270\303\364\320\0223\310\203\305\226HU\257\207\205\321\316\274J\233\240.i\013.\031b\275G\314\310\211\363\211k\026\317\240\212\323/p\220{\304\346\217\217\177,OH\001v\354d,\345q\345=\323\210\245\374L\346g\370\350\230`6\207\252\n\263\310k\037\256\234\314U\270\3162ON\2139\323\257n\315\374\352\237\377\316\377\016A\210\200\316\260\250F\225\375\303~\236\001\212\306\365\334\017\022\234\026\343\306(\226\025\001\212M?\201n\266\314Q*\003\231\007\342\030\372\377\332\373r\376(\216om\217\020\002l\266\001\241\r1hF\333 \020X\030I\254\306\262@,^\305&6\233;\006\304f\354;\006$\300\374\355\033\022*\234p\302\016;\354p\302\t;T\250\217\340\217\360\3269\247\226SKK2\366\375\275o\360&\226\351\251\256\256\256\256:u\326\347\201\032\237\373\365\274]\230\000\204\276\345\364\313\353\351u*f\030J\207\304\260\204\202\366X\350SOrS\240VM1ulh\325\224\236\014_\212^\202\373\223M\211x{\361\204\377N\377\273\nG\353\276\332\2275\305y+Cy\322\360\353\255]\024ouO|\347\333D\205m\351a\277c\016\335\020\226\323(\222&HsL\273G\323\321/A3%\"\220\036T\234\337B\264\r\353\3220\204\205N\021S`\370\020\321o\2212\333\313\243?F\311\325V\240\177XU\027P\272\252\302\352\0237O\243\321@\364\020bA\366\r\362h\037O\231l'\346\021\034s!-\034I\217\3501\217R\025\311\317\252\360X\243\234\201p\031\254y\274\267\322\2379\243\316\244\025\2265\260@9z\362A#\351\310\227\215\242\237Wi\260\361\3620\253\215\216\006\241\264O7\220!\240]\254\250o0rx9~\222\274$\026q\215\251\335O*G\020\016X\301\234\275AT\310WXny\325\373\224o\341\304J[\213i\021\036\330\016\331\222\335\224l""\322O\360.\335\222\260\333\253\340O[\341\0168\334:\2116\260\203\376XZ5P\021>I^5\316576g\001\327\003\314\225t\0162Fd\356;\316\214|YL\254\360\037\251\025qL\206=\234\036\236n\234hN\375?\271\304^#\365\306\014\362\361\250/\177\000\310cO4\277J\347Tj\336a\035\333\326z\n\000VV\326F};I\000\225\226\013\023PQ\3167:\233m\315y!\320Vdu\334\214\306\375\261\217\260k\310/3\324\304\357w\272\371&\275y\213\270\355Z3<\264')\353RJ\225s\r\365Ud\354%\375\342Q\372\010h(\376i\177\322\377\225\036\275\225\336\002t\226\264u8\035\026?\203^g\312\241trq4\265\002\360<x\274\251Lc\2614\316\245\347`\211\201\352\320W{\007\251q}i\037\024\247A\310x\205\001\037\311\343\310\271\260b\366\274<\346W\010\353\316\252\260[@\027\203z\252\220\037\342\251b\324\317\322g\302\232~\245q\357\000\257L\026\017\241t5+\362Y\322\001\351cMu\310\230\254P\020\255\233\211hX\347p\250\272X\263z\t\230\0242(\237\252\354\034\205\3522K\277.`i(U\350\331iJW\204,\270\234<o\236N\347n\"\336\032\314Z\343bs&\275r\225\254\315W\n\320P\027\314\250,~\206\r\266v1\221#\0106\213\343\347E\243\230\266\236k\\jJ\264\305\326\203\351A\370\347\235\364\346\203\364\301\363\364\371/`H\351<\367\002#6\333\254\223V\250X\374<AR\245\243d^r\254\033\3023\332\206\004\273\375\2248,\351\257\327\300PT\213\360\006\002\032w4\026\024\363$VN\340\202<\237\236\027g\3653q\"\377\234;\007\007\363\271\226o\340\3177-\337\266\310\3428\225\347t1=-\223\357\326\23361\220\016\314\2443\367\322{?\213\036\237+w\314\267\360\347\333\226\357Z(\024\235}\376\333;k(P9\336\026\377\322\270\320\034K?\022*W\3323\206\t\342\0337\377\317\253\367\347\323<\224\010\265n~\2771\335\006\222\037\n+\227[7\211\237\246\337W\025c\354V+1slE^nS\231)V\306\rk(d`T\210\377\003`\237\224\033*\027V\301$\362\367{\360\350D\276\267\3200\374\2703\321!1~\261x\034\372!\315\355\370\317\023LW{\214\206\021\001!\277I\253\227n\356\240\032H;\250\366Nn\364d\\\014<\306N\227\375G\370:J>\315%S&\213QE\257sk\276b\221O\335\260\315I\311HM\214'o\261n\243\031 \202,{\314h\274\000V\002<F\313\225\222_\035\324\017\213\311\222R7\343;\0064\033""\221>(1\351\026\354\366\025\264p\241F\246\214\357\013\205\253\007\264<\026\002\001v\312\016.~\312b9!\223\000T\211\216h\252N\271\356\344\237\202]\207\nk\363&\246i\215\240\2553!l\303!\315\234\252=\360J!\354\300D\242g\210\371\232\313\274\274s\251M\010)\210\232?\306\n\330\264w4\372!\031M/\310So\271\017HN\277E}\364S0\340\332\264\206^\320\265Z8q\230\300\215J\332\036\202Agf\311eZ\342,\261\371:C\323\267\030\213\324\021\330\341f\247\202?\343L\343\223\346$\224\005]\0256\n\245\371\342 \311\301\010\205;\303\360Y.\000\3351|cJ\220\326\377A\370<cO\365\332h\245\013\210\305\004p!B\005M\256\t\005m\200D9sZmX:C\224r\010A\376\".\272\227\257\250\340\t\267t:\261\006\010\325\335F{c\266\361\2004b\340\243\023\372\346\205FU\026[i%\246\321*d\323@S\255\\hq\310A \205\244\243\003\215\361\346\006\010,@\203!\331\300\340\324/&\017\033\223\342Q\023\340j\007\265\017\232\025\320\031\235\356\027Z\002\244|\210I\220\031\326\177\303\035M<\216.\236~\253\2345\267\256\264\035<\3440F\000\270\322\345\303\n\273\3512i\246VH\350\276PG\304\321\274<z8m\355\257\237N\217\310{\007\\\333\270\267fs\260\274^zQ\033\221\007\264.\316S\305\213\342\235\305h7\303\276k\024\021\"\024\300\364^\313\354(\2106\327\306\361\244\207\370<Oa\302\262\026\302\374G\360\035\207\200\341\r\224\214\035J\017\311A\2160\213j\215\034>\225&\t\300\002\240\003\2675+\000X\273\025l#\302\320|R\257\206(\237\254\371\355Bcb\230 \366\250~\367&\271q \326s\221\312}{\025\024\331\376\332[%\300\315\327\326(\307\000\274\005(\213?Qc\334\323\203^\315\3355\226?\254\002C\355\n\210y\221\210\223A\336^\214\376\275g\253\2058\300\252\264\314\n\233\215\355g\037\212.B\222,\013\341\351\204\326\036*\213pL\226M:]L]\311\311^4_\007\n=\202\374z\026\320(\207-\344\004\365\372\005\266d-\014\010\326\200\203\323\363\006\354\361\034\275^C#dt\301J\2372[\350p\236zJ\237\333\202\031\271\324G\273L\"\301i \2256\247C\302\312|\227\\V\3102Ks^\014W\254_\004\304\037\203\370B\211\201\327\242n\224\277\355\204\225e\020\314\225Zt\315|jk\226;\254r\374yJ\351g/\257\375\177\254\267\267\346\325x\213N\026""\350V\r{\304\376<\3270\352\312EU\035\352\327\353o\214fU\213\303\376\006vT\n\215\n\346\354Z\375RZG\331Kg;\373\272\217\360\376\371d\312/:dC\324\035\230\362\020e\261\036WHLr&\001\237\tV\302\020\273\313\216f+\275\375u\034|\204\273\260\364\376\357s\231\352\3549\2500\320\214\276\372V\034D)\024[\267r\024p\020$\336\006d\343tp2v+@.\222O^?`$\035\271\330\314\031\222\363Q\254\001%P\\(\342\227T\307\304\204\274\021\351P'\242\236\030\242\005\313\003\303\212(y_\355\016\026\357\236O\362\316?\212\365}\020\335M\334\215\006\034C\342\361\027\233[\304a\354\027\037\353\034U9\302\255\3515a}R\024\374*\330[W[\356\302\237\273-?\240\331%\313\231\034\3731\333\024;C\364\271\322\0243\364!JY\030J\217_\222\204_0=\207\034\0307p0\234h\234\207J+b\275\277\224\314\202@\030\010\373\344H\204v\301\251\257\032\227M\332\3350\024\n\300\031\002xzR\017\324U\253\004\262v\254^M\313'\3314\2264\236\275\202x\323\324\361b\032\311\313yBG\032\2551\026\t{\332\035\243\022)\342\215O'\227\032\312\001\000p\361\342\246m\356DQ&\3075%W\200\021t\027\207n\247W\356\245j$\2509l\367\241\3256\021\034\236\363\253\001\304S\035[\250lL\226\037\212.\305\263~Y\272N\324R-z\327l\341\255?&\355e\255\204\234\201\021\215\322W\004\326px:\202V\270\347\240\261\277XK</\374\023\223\202t\2230\034\3647\302\202\336\246Nju\255\303\277\306\316sP\365\217\210\351\276\207)'\240+\031\2520\363\037\332\021c+\333:\245W\000\r\217\301\032\202+\315(\240\316\265\333\360s\031,\312G\360\231\007\353?\304\243\311\177`\000?\245?A\r\240%:\003\336*`X.\376s\247U\025\312|\364Az\tlB\262u$\014\246\306\303\264\004\320\0360\357Ji\t\026\373\235\364\373\273\351]\000\177\206\235\376\257\270~\025\327\034$\361IWU\226\347W\001\333<@\326\335\t\260\202/5\273\301\333\247l\003\334\340e\370\340\344\210|I\216\n\020\3120\203[\201x7O5B\017Q\2530c o\246\233\251\266W\034\223ea\000\235H\3666\370y\375\025\306P\237PH\251K3\205=\211\252\026X\311\316\245\035\200Rx\251\231\327V\226:\300\200v\007\336\367\r\032\342\370M\200\305\331\"\0033\206\r\320\001\235j>D\274Q\235(\005\333\036\030\233\273\334M""\251\204^\205\020).\307\025\353\\,\260\306\254\246\016\2218/\2039oZ\337SE\216\246\310\256\007\024\000h\372U:|\"\301\027\3730=\335l7\303y\263\310\264-f4\370&\003\016@\312\352\241\220'NV\231\005\016\2721\216>q\335\220\")_\0270\317T\320\207y6y\227~\365 }P\205\254\260\234\014_\312S\365\332\007\035\247a\317\246\206\\h\213~\201lat'\237NO\177\335\264\025\232\262\266\256\031y\247\221h_\2477\037\245\217^\211\341-\344\246a\224\323-_\303\237\257\301\263{\232H.7\327s\214\371h\030394\240\305\372/l\324\020\302J\310HD\361\345\342\0018\217P^|\335\314-w\037\215G\323\263s\351\034\270[\300\021\024\232\261}\177s\026O \374\226C\312\250k@!\247\372\014$\333\303\376\370:\336\n`yZ\302\246\203\023\361C\312\200\363\241\301\035\263\254\2130w\276\216\267\001\276\205\025R\310H\333Tf\304Ex&\335+\276P8\341\323\350\264\326]\r\256t\202\333}`,\035\003\325\352\244<\334\245\355\303-\010\005\227x>\351iL6G\322k\267\322[?\246?\212\225\013\345\3450\216o\342<\234u\026\364.l\241o\020H\263@\356\370MKU7\307\204\313\2101\325Q\301\200\323\031.\035\372QL\031E\215\264\263\205O\217\332\321\267\264ku4\272\227|\323\334/\271\217\300\003\222\026\220\327\235|3\304\033'\251:\235\013\316\324Q\374\365\213\006\352\017\243\3217Zl9\006\026\215\261WN\246dI/\352(q^\005M\341\177\313\314\327\250\312&\301.\270\236\024m\004=\270T\022\226^\033\371\375,6\306\307pLh\356\306o\222\356\006\306\016J*\271G/\304\005C\204\310\316r\372JB:[\222\300\236Wf\263\230\217:\240\3226\211\245d z\002\225\027\360\373\267\200{b{9\325\346\033R\250T\326?\215t\234#\013M\365\341\325\3163o,\345\233\014\325\031\310\257\026\261ezq\002q@\003\343\343\367CK\006f\340[\250\032-7\020\342U\037.:\005\247_\241\266;\207\302m\260\354\276mV\300\200\016\272<[\232\203\210\205G\255\206,\214\363\353\361p\322\221,6\346Q1\324\347\353w\364\226\212\177\326\034k\3601\277K\360\307\303\004\016\362\006\000\316\316zY&\303\344.\200\216\024\255/UQ\027\002\371|x\260~\027\215Y\"\303\304\343\317Sp\027\275\206\247\223\357\020\031\235\224\037\215\256n\021\033(\301p)\271\333\314\343]\337\245""\337\t\215\223\316\010\031\217\233\203?s-7[T\305\013,C^\312q#\375L\314\027\257pYYw\245\217\335Q|\026\342\246\203B\255\370\256q6\275\"d\2240V\337\210\307\277\315]\202Q\\RI\3322-\373\005\374y\321\362\305\006\361\347\213\r\227\340\317\245\r\2277\3009\202\306\004\276\251\243\273\3132%\002g\372D\246\364\205.8\324~\353\271\300X.\365\247\2439~\223|\334\030i^H\257\336No\203,\243\311n\276K\357<\022\203~\254R\240\344\224\313t\363_\341\317\257-\377\335B\031t\377\374`\264\325\213#\221\255F\002h\302\215tZ\247%|\327\254\352\255\342\032\354\273\232\343\310\365r\r\223\271\316\244g\240\361\020\003f\310\240\364\356\253\347\326H\344\221(E\023\004kX\277\013Ix\036\221\372KR\357\367\245\373\276k.B\032\2048\032\372\323\32289Yzj\243\0065\313\330W\377\001\215\243\231\007X\010\310{:\225T0x\001\320:\304\304(\313@Y\335\3139p\032\246g\356\245\367\300\250\321\213w\024\312e\315\377cv\325\367\204B\234=\022#\212:\205\306p\027\335\352}\344\371\371\n\3743\035iG9-\213n\200\r\tJ\3530G\013\241p4\337\207\024\306\322\\a)\235\217\310\205\000e\331\247\231I4\211\341\223\013\215\317\025\204\315\334\nEK)u\342J\255\312\320\244)\257\0022\010\362\204\020\267[\234\030\004^\357\371A\304\352\375\036\215=K\235\264\213&\036\266\200\025X\3707\2247s\222\317$\243\000\240\201_\356lz\026pu\376\267r`\224\226\323\026?N\224B\262?\335?K`\010(d2>\264\321\021\367I\352\334\"D_\246 \326\233\266\212\016 \304\210\316\005\214\035\251\240U\205H\255\270\221\271A\310#(\364\371,\231oL\013\343\367\026\246\225\335\314\246\246\025\203\376\353F\013\327\005\325\334\227\025\275\225\365O\236\314\205\256\"1\257g\310\301\365iTu\023+@#\233\325\024\204\210L\206\033}\213\213\366!\261\177\221\216\t\234i\025\\\372\340\252z\255\222\007\371r\032\254\257\326\253!\222'\202\204\365\366\nc\355\220\260\r\314\331v]\201?K\007\265|c\261\212\016iP7\246\023\212\241H\227\344\n_\027\007\224\233[\352\342\360\n\210\345\262K?\316\214{\"\341\337\247\300\307\244\216\276\243f\\\254G\234\224\003\232\216\326\001\256\033\247\324\001\2341&=AE\025\367\324\277$}HBs\346ax\245z/""\346^\244%T\243\367\326\306|2\372Id1,F'iio\261\330\002(Q\360:6\201\310\024\240\370\037\023z\021d+l\005T\262p'8\0069\223\000\241\374riL\350\007/\304i\271\251^\345/G\226\3531Y\002\305\215\235}\265\273\372Ci\245\317\024R\2638\036\270i\337\t\033oKSr4\317\032\373\340\2212\351?\301Q\320r\021/\270\225\326\r\236O\226#\255hg\331\330\0164eg\267\305\025\375\275z1\n\350\242\263\233\273\330\205\376h\326\3156%@E\204\006G\037\023\n\243\247\3107W\251\375\206\314=c\321yC3\272\200:\362\006\310\016\245\t\026\2633\210\344{^\240\375\014)\3364\241?\222\222,\254\242\250\250#\221&\243A\334\265b\347\355\022\032\352)\361\241_5\247 \257M\245\246\020u\005\034A\267\222\n\347\177\025\273t\305,KMz\277G\216\230(\013v\002\242\325\006dM\307\325\365;\221V\030~\030\023\036\227D\032\352\027P2\337\"\261\215$\257\351\306\017+\372\237\303o\251o\304\353+\352:\023\023\220\250^\227\244t.|0\373_J\377\302\360\257\\\301\276yK\373L\246\317\301^+\361)5\211\347\306\361\257\265\177\214L\356I*\311[\241\022h\312 \2129\277F\373\347)bu\002\371\303\236\206\\g\026\363\254\371DS\276\370\320\3547n!(\003\255/K\017\216\377?\252\273\245\207\332\341\n\353\275\025,I\230\214\226\217\272e\366\336L\213&\234\311\216\274j\236K\242N\252\256 \256\361U\204{\031\204\204\007\241\304\224@\343X\221\216`\004\363k_:\257T\205\223\210U\212\005\315\310XHV\205\260\273\247#\311\001\274\033\242\203B\350\366\013\341a](.\243+^B\nN+\324g\300\374B\265\217\256\345\270\255`Ew\374P\217r8?\004\207'\2047\206\014\323\265\311\0022\355\240\216\007R2\200\017\034A\225\256\250<\251E\231\204\205,64\263}|\001\371\212\264\177\245WBVN\243\3348'\326\314\233F\316\321\252\331\262\267\326:?\204\013D\315\215`<$&_)\3340\351\372y\250\361\2754N\3469\245n3\270\346\017\357\226\324\3576\204E\234\301\272\021\211\276\350)\203E\373X\365\037\262\300\314Ug\354,\206\300\301\332\206\331\330A\203\3503\346=Ys\023\022\3612S\007\223R\242P\233\rJ\t\271?\215\242u\3309\006\320%\340t\342\034\021\354TD\035\247P\233\365\344\375X m\223^\351\220\035E0<\356\360b-\326\244b\300\001\035O\274,W\343d""\210\035\333\201\325\3773N\312\340\230\313\330-\344_+\304\010c\244^\336@\365\3650\372!\375\204=\306\303Eg\344$V\267a\351\254\302\263\016\366\217\377`\025\366\320\377gKR^\367\352\376\235o\021\271\335\005^z\273\303\373\035\007\357\221\037A\336\243\250\251\302o2n\023\177\331C\007DQ\215[\203\002iE\026l\014\212]5Y?,\021\357\211J\2112\323\000\352a'\342\303!\366w\016@\004\220\326\020f\001\321\313\313\220\315J\245\371\375\026\303\335\276@\356\316\014Z<\025t\316\0042@\000\233\267\003\324\334\366\032\242d_GN9;\032\375R|\256sI\316Gp\320\034'\005\007TT\022'\200\007\3453\344]\034\203\030\376\255ZE\207\215\315\035\224\334&\321\253M\376ET\\O3\200N\302\010\373\016C\266\36338\235`+*Z\213\317p\374\033!\25520b^\244\034\034\261wG\211\225\217\257v\307^\226\035n\356\231\217\203\2518\260\346\324\200i;\312\3754\3420\333KAb]\203E\336kyA\305E\300\236\260\306M\277\354u\364p`T\350\261\007K\317\337K\225\222\241\301z\037\221m)G\230\331Ce\313\306\222\303>\223\233\264\277J\365\274\233,\222\360\3549\363\010M-\257/\2264\213\232#p;y\002q\227r\262\262\321JL\r}\315\360o8R\333\010\030>\002\373\334\030\261c\244C\344\314\346-\016D\2715Z\034\214\212Y-$\177\220{\350\014\252\271\224J\254\031\246vj\377\026\231\345\264\267\026~\200\375%M\036\2133\017LS\016\037\200\224\362\310\306b}\3332gP\327\315 \307\246`\257Lu\032\226\020\337b(\3111j\310C|A\261z+{\2362\233\310\207\362\005E\007\251Ye\016Sb\233\322\000\354\265\270\337KG\2345\272M\270\251\253R\310Vp\266\227y\207\234\311D\032\177\262\351`0Y\210\257\023a\276Q\305\006\313\230\264\360l\253\221\246\017 l\216)\257\333,\333\004\372\246I3g\017\234-2\332\2505'\226\264\352IU\207~L\366,\375S\234\014\014\331\211\344\327\224\347\226_-\315\220\211\274'Y<\\!\371\315\335W\356\035+\266\300\2337\363p\005\200K@l\210\027l\303\334[\230\244\016HB\351\006\371\"\225\317\035\266\212\026\022\324\026,5\261\016L9\372=\370\370\266\000\335\207\326V\214\214R\352\264/\347\255\247\204\233\311\3046\267\331#/\001s]\315\326\352M\256^:\306\013Vv\356#\342\321\323\217\322T\036\016\316\020\010\227a:""\025\310\370Bd\314\372cz3\232\366\222Ep5\203J\177\236\362\312r\3562\242\\\240\213\004\330\023\322y\314b\227\333\247\250\355\025sm\020\006A\327\017{\327\355\2164\343\255\331\214\372\023\347\250\013\213cg\\\355V\372M\352\007\312\351K8\376\305\300\0161\325]\306D\262\337L.Dv\213a\266{\020\025C\267HA\326\211@\326\343uO+\177\021\005\023\273\345\016\263o\343j\304\2138\363\276R(\377\207\247\026\316GS\3442<\231d\2646\024\262&(0\257\230\223\252PLr2\232uk\336\r\376\275\030G:x&\231\365\253\342\231XP\313\227\326vG\270%\372\340\365a\360\314\327\024:\271<\324\211\337\362\216>N\251\352[\244k\264\262\217\"\023\330\037\224\016@%\301L\207\020\032$\275\272\354\371i\2130\345\177\304\326\257\3065\252\277x\331\2050vT\003>\232\002\262\246n\006l\362\247q\316Q\345\310\213\rB0/\363\013\266n{?'\306\t^\301\233\024\036\337\271\264]~\372\235\352\323\377\235\377\241\321\364\000\250\335\013_=\332\035M\205V\250|\201\177\357\226\031Rs\254\333,\333x#\373\326\254\017c\250~\026UV\331\203\214s\320\321\354v\307\253\r\227\001\344\355\243P\233\3767\202\246\350\203?\230x\245\225\320E\307f\000\303\217|e5\tn^q\363\275\300\331\202)2N\321\214\025\346\0013\271\350\225\325\250-\360$B+\2467\272\223\344\234\014&\306Uf\362\364\244QW\006\341\330\205\034j\2120HwIjnI\253\035\243\321]L\376\241\230i\355q\375'a\026\277Mz\032\2720n\265\013\316\033\223\002)\004S\332\177\0052`\017\207s@_\241Kb\"i\027\206\333d\263\270\334?\200I\321i\237\270\t\303\320\207\263\203\234\246\326w4y\327\034kN-\227\016`\231\303\263\006\345\222\210>\236\245\317^\377\365\321Gor\263\340$\236e\340z\252\022\340$\306\217^7\376\304\254\3255K\310\201.\013\013\036\344A\314\335X\206\237\344'\356\2469\252\343\201=5/\201\326x\313\216F\263\241{(i\274\240\357\332\005x\215\265\\\240H-\343\241\205\264p*=\005\251\022\260n\320\322\031W`3\222\332{\205\225\373_\210\216\246\243_\341t\032\327\355n\344H\224\201\317\207\265\261\264\367\220\020\204\335\311`\262\330x\252\334n\306x\352I&\033\207\200db\005S\231\357\327\020\256YQ*\346\213X'q\025S\017\333\010hW\356C!\257\317\246g""\305X\037\245\217\036\023\301!&\320\000;\343\026\345\365,Rr\356kL\335m\2438\224,\331}-#\326~\025_7\004\n\331W\273Z\333\014\357\036 b\301\273\305\222\354H\252\334Kv\021\265\260S\360\270$\027v\366\201$\330e{\356\310\301\203'u2\017e\371\216\343m4\272&\246\021\303\256\332[&\225\377\253Z\3110V\331\223\270\312\241\031\246\230O\314q\0312\0035\236\n\271\014\331L\344\002\2630\366\001\367Lh\326\357L\247\350\030i\330\316,1&4\202Lq:9\210\tL\322\005\202\235\210E\215\240Re.\036V\317q\231\322\373\257\240\034;p\342PN\005x\370q\275\331\235e\346Q\220\373\034\357\342\321`[O\220\341m\023\201\353\253o\217\260Xi\006L$\207\346\313\303\270\262S\017\226\017\034\005f\355\264\025\037\352H\221Q\004\337\031G|\232\336\346\365\364\312\017\351\017?\245?\335O\357c\332\2204+\323\322\351\364\364u\254\352\240\002,\211\253q\276E\241\320\177\206\205\017\233KB\256>Q\036\321,Hq\236\005\244\251\022\317\000\226\004\2033/E\227\010)\276si\261\366S}\013\351\217t\334:\225\231\\[\005>\350\242U \212\033\034s`uR\372\033\tJ3a\333T{U\350\337\372_\367xzdj\024\321\010S\317\364\nJ\265\017\222\211bk\330,\343RZ0\341\237\243\234efn\216s~\005\254F\371c\352@f\005,\265(\261\026}\365\234W\235g;\325\202/i\"\263j`\274\001\006\"32\346\254!\241\326\006\364\363\364\261X\334o\304D\006)\031\363\006\356\353\255*R\256J\333~\007!\355\277\221\237\003\317\254\026\260W>O\n\215?\010\333\r\254\313A\222G\232?\370\324\322/\030\202\305\264\356\001\203A5T\333\212C\302\250\360C\\\374\027\035,\254\231\370`r\233qTKgr\267r\366\337\360\242\331\370\361\310\221T\002\347\235t\327\005[\030`%\006-\210y\342g\010\006c\205\327\213\360\3109\211\2059\322\261\204\272\204PL\207<\371\225\251\"\211\365~C\246-\006\253~\026\001\342J\010\221\037\231\344\307E1\347\227\005\203s\r\022\347\306\200\220\236\271\260:\354\366\306\313\2731f\232\316x=\247\365\317\271\370r\202\305=;Q4/\220\2256X\237\303\022\241^\310\3564\364\303\306\247\211\250j\230\373\350\317\200a\023:\323\330\ny#\313\375#\321!8\305\221-8\035\370\"\375BU\177\214|X\245\320\312\232\225B,5\310U\301\213+VY\237""\004N\307mZ?\243=\377HV\265\273\346\262P!\374\204\030\275\020\362\177B\006r\213\2271\37598\255\245\247\264\250\376g\273\237{~\002R\203\205\302\375 }\360P\346\037\201\2254\227\016@i\307\020\363\323j+M\035\007\000\355\366Nh\257\267(\005i.=tVj\205&\205\037\364\305U`J\224\331\262\211XD\222i\302so\\#\350\207\017\205)1~\311\013\244\317A}a\343\\3\327lo\3166+\032\247\344`z\360L\362#\340t\211\211\004\2045\312n\007e\262-R\210\034\370\201\360\024\247S\3736\233\313ad\264]\2044\315\244\032\304*\222jZo|3\231]\033\000C\035\372e\2501@\244\2231\317\2432\210\345\221\035\322\033\3473\275\252\252\247)\325\264=\243)\367q\257\325\251\206\222VM\3732\233j\317\345\332\275\262\246x\316P\022\233\334\210\335\306\267\247\226\236\364\364\204\275{7)T\243\3577\tO\016\320\006\363:\271\367\374\2552\301B\255\262\306\003J\365\203\200\007\240\315\366th2~\305\270\337h\225>\215\267\300v\036\305\246\236\243\200\3251\323x\3353\234\346\001*\310L\027\266\352\300\034_\364EVA\350\0106p\264\017z\251\241\265Ok\246\214\260\236K\253\301mT\331R\370\267R\272B9U.\322\246\236\333\375\032\r\312s\004)mi\222\314$\026\321\222\333l\177\240\370\r}\006\203\252\244\231\267\340%jzr\366\007\362\344\306a\200:\220}\023\244\205\311>e\351\263c\306\366t/A\316\255\271d\270\375\026\361\313\037\2050\274\004\2139\235L\021sNE\357\255\360\243M\225\277\035\361\035\366\312\274\347\350\350^\355\251J\255\221\021\236*[\3136\032\007\343\274\326\223Z\242\255\313\233\215\242[d#H\335\244\262Z\316:t1\340>\204\326\305H<\305D\230n\321\003L\303N=\363c\241W\274\342\300%F\271\321\213Cw\320\251=\237v\007/\222\214@\202\\\032\301\016\014\374\032\346\250\207:\000\347\241\224B\272\013\177\201\033lY\346\360\324\303\nv$\321I\354\231W\252n\227\002\204u\304m\273\376^\213D\316\273\312&\233\344\241\025\314mf3\242\302\362\276\330\t\311\022\037\267Zy\201\347\010{\001\204\232PA\250\036\207Q}\333u\333\\i\331`\362\361\264(\270\231\336\234\027*\330\243\334\227\240\211}\331\362=\374\371\236y\037\263\3652\273\320\351Rs.\275v;\275Mf\274\324\313\340\003\010m\353\257\257s""\353'l\267!\322\253\246\223\223\177\257\017\265(\320\251=\010\256\n\252\316\325\370\315\350\325q\260\233\225w`B\245@8\276j}x\003\247\353\210\325\235\005\007\335a\034\016\247t\260`BAN\372\331\223\345h\033\344\204\023\274Z\316\324\207\277U\211?>&\322\"\370\330\000\361\315\215\305\337\252\373I\022\367\343|h\247\251\307\252\254\014\206}\251^\322O\245\350\21407\022>\311\210m\350\250#\004\201\201\250E)\013\334z\214=\240\304\326\0257\226\250A)\273\001=\343\260\335\300:\310\372\352\333\260\215U\303\273=z\020\037\200\272\270\3679\010m\335\002_Rm\366\257\235\037mk\007\227\335h:z6\371\243y7\275\365(}\204\300\350\177S\313>\200~\236N\314C\317gk\331\247\323\323X\335$\226\345\2446\003u]\020Ua\247_\210&\302\274\025f\037!\314\316\300\316\234i\221E\236\032\225`y\344x\262\265\361mz\005\270|@o\227\025\311\337Dy^\315\245#\224Pa\360S\255UL\344\006Y\255#\244\336\014\036\004m\230%\256\235\352\347qj7\222\207v\375--\3577N\233]\246?\034\357\021V\310\343\306\343\346\023a\017\003en\346<\355\255\235\211\266\304\373\033\2374\317\246\267\305'Y\020\357\274\250\n\351\256\300\237+\252\236\356.\n,\223\r\2162\320|/+\307\234\370>\036$EX\t\350'\232D\317\211\2560\333M\354%J\272L\001\214p\007\2054X\033\342f\346\300\232\3443\222U\257\230B\317@l\024\220\350\214\251\266\037\205zk\037\020H\227`\201\370\272\035U]\330!\256\216et\301\026\023v\261bE\365Y6\214z\204\027ug`b@\276P\210\377h\334nV\035\004\207L\002e.4\332\242G\200A\213nu\261\214\322\355HE\017\\\357@*\323:\\\377Sl\323s\271\365\240E\235L\212:\243E\315\322\000\324\250\016\221<\3714\312\210\204/\300\261.}\237\332\233\2049\235v\334`\207I\213\315\351d9v\361\0232\375uZ\307\016-\226r\324\307\256P\037\035<\313O\363s[I=\262\277\275\2652\246\"\227\225\206\245=\316(mo\310\022\243\260\343\026\244\034\021\367\334PG\350\001\212\031\357\260A\277\253\024\010r\177\270\026;\371\217\372h\340\210\301\3467\031\3758\2475Hx\327\036\253SHZF\3423yHu\327ZjE/\2559\303\333&\3571Sg%B\263\224F\351\250\336\341`\017\003\256\336\237QE+r\276Y? m\265\242jZ\310\362@0\027\372z[\252r\330""\325\233\353\004\"\325rh\035-i\317d\203\300\261-\003\224g\370\370\201@\020CHI\362d\214\371\301@\2668\275f\332\266\211\002\315L\205\252\275Fu\324\023\010\352 \315$\207\022\021\3540DNr\236\222\021\226\010\267\222\246\234\311\252\251\233V\306\373\301Y\334\344;\312\362_\tj\324A\030\246\200\324\"\026\221D\237\225\337Qv\331\315J<\014\343Q\220\214\321\037\254U\347\350\277\322\321\332\254\333\256\254Q\302\241\025\024\316\327\217\3006-\245\245\243q\321\373\034w\222\034\300l\001\312\330,\326N\321C\356\342\371\377\016\013+z\033\327\301[\207/d\304\261-\001)\273\037\244WZ\006<\030%\325H\277z\0071>.\"\260\007\004\016\264z\031Q$;\301\266\266\340=\030y\254\200\232\372O\377al\200\265\251\200\250R}\277d)\312\236\020\031\2210\341\370\206I\336\212<9M\255\242\004\235<\350\365\3504\223\275\311f&\2054\334\254L\334V;\030\0246\311z\231\351Y\316\370m\004\013V0\2630\357<\000\301\006\345\274\354\245H\250I\363*\031\322\\5\001\235KU\2515\261\200\030\0327TaY\225\325ah\321 \203\221*<Ub\237\013`\006;\317bu\276\225a\337e\375t =\000'\275\375\033b\261\311\267R\223j\220\017\255\342R\231!\273\203\033&/@\235:L\247\301D\354\351I:\353\235\"g\312\275\246\224;\017\313Q\013\230I\247\214a\220P\271CF\227\226\332\031\212\016C\252\\\253)\023\360\030+\322\347\213\337\224\r\232z\315n\312|\247k\r\2005\345;\020)\004\305\214\026\003\273\023\016[^\312!\266\233\225\370mj\035L\021\203>\240\255\"\006\271Q\355\322\034.y\202\027u\005\220|\312\001'\320\324\253T2\371\024p&v\370\203\321\0059\322\221\322\r\325\317}\201t\333\252_vaA*\375\004\352\241\336\246E\277l\320\362\317;\302\304\251\334\221\217\321\272\006\342\242\370\372\016\255\260\315\360`y\350\240\265h\352\321{j\037J\316J\363\361\0209\367\362v\367k\036\346\203\376\262\2128<24\333\016\235\315\324\213\001\006\033\211&\306O\334\242\260].)I\313\001T\207a.<\000U\032\335\010\230Crc\357\253]\256W\202\224\263\263*'\376\025f\206\217\241\270\372<\221\323\216\264p+\036X8_\207\264!g1(\3769\371`\016\233\242\004\376\271\230{\220w@\236TSff_\204\031X\r\305\202\371\334?\034\305\002t""\217UP,`\014\245u\024g[\365)\377\2708\0332\320\007\316\010\255n\360\014p\203\200&}0\354\340\377D\325\217\256Fj\376\026\327\266I\024*2\220\372\233\361\275\306\305\346\324\n\373u\231\377z\003T$\271\026\335\"\307\014\265\331\255b.+\241\027n\266\372\216\362\301\326\"n2\311E\356\026\ni\375\234u\326\345W\232\374\354\200\2600\213\360\017\304\340x\251Y\270\270\374\037D\300\216\227\321\230\035\254\331a\316\341\"\027\355\246`\020\214\330.\267!\337\020\372\242\247\232\321/\207(\350\255\007\014\017\301R\337\341z>#B\244\260\372\320\321\261\223\361i\347\354\343\207mQ\371>#Q>\264\336\327\202\345\207\241w\371\325\200\272\344\320\2346V}K\370\373r\263_\365\363\033\263\261Lb\036\353\240\205\253\340,9W\335\302\363Q\371s)\203+\316\257Vx\256r\"\327\331W\207]Z\275\256\324Vi\0379}3\213K\246\315\216\255s\234\275\241\232\373\177\374\332\301~\026\342\3315sR\271\254\247\023\344\032\225[i\271\300\243\340aI\003+\264\344\013\305\353*Jl\026\361ZMz\270\312\3424a\017k_\273\031(\372C\016C\0231E\212G\241O{$\003d\222\322\201 \207\3246%\273k9\243\310\360\222T\311\277\227_\312[\024q\355\204\261\221\027\212~\013Z5\206\223|;\000\335j\032\310\025\211h\231\016\310c\333\024Cc\231\214\362\267\347\331\377X\321\373M\340\217\345\226\215:\224.\307r\001wP\360\372VT\361|\326\257i\351\203,\272\002\230\007\275\244\271\225\345\361;\216\356\320\033\204\313\273\2272\257?~_|?\276\204g\350\345\245\237%\357\n\236\241\220c\nV\362Ed\357\235\001N\036X\177/1Cn\027\202~\224\352Svh\354\0302\370\344\222N\300h\365\236\177\024s\277\027(\212\215>\367\214\3370\273\021C\363k\214\n+\345\033S\306\364\374M\034\373bTH\025U\006\302\206Fn\035?\372\303Gb\325fn\005\223\253\316\325rl\017\335\2623\2168\000\225#\257\301\201\332k\025WVXu\256K?\260Q\231\363\035\3747\307\025lk\273\276\317V\256\357#Q\270b\332To\004\310\017\254C\004\306\036\030\310&'D\014ZB\017?\2224\026Dc\314/[\265\253\273\345Il_\2047\263}\001\357\342\243\261Q4\330\017\346\340\261/\3127\034vB\235/\311\335\036\347\265\263_\033\002[\242\274'\024o\304A\010\206\303\221;\276W\224\317$""\2213\314S-\200\213}V\2211\340\367N\220]\326]3\010\273\377\221\356\373)\205[\005\025b\3235\263\222\314\327\260:\327_\003\006\327\341\370X\256\"\361\227x[\241\256K\201\264\302\373X4\020h\330\207\224\311\373\275\264\020\333\244\225s\347\272\256\336:\352\241\374\360\322\305Tp*\352\367\230b\307\036\213\260\024\004m\256\326\215a\205)]\270+\337\300\267e\\m\320[\343a\254\301~\310M\345\037\215\243vK-\312\371iD\035\227R\213\322K(\267\232\306\r\343\351\360P\002\334V\336\226s<O\366\314;\310\021\256w\333\231\002\267\225\302l\214\234\217\355 B\310f\262\263\236\332\236@\303\214D\035\351G\263\016\355~\020q\007\323\203\022?<\203\246\027\312G\245dU\000\246\317\353c,~\024\030\361\r\207-\351pTqT\206\033\n\002\211~<\224\365\243\230\336\025\r;D\002\256\303\225\341\240\250\013\231\312\337A{_\257*\354\007=\305\373\310\241\026Zd\360-{\262\027\006{\231\222\003!\241\\\007\212\007\\?RcH\310u2\354\037W\216#\304\314\245c\342\3312~=\315\372V\301\254`\315Jk7\323X>\305e\306C\3468\200\246\021\336\014\345Wwmo}\212\205i\024\306\374\000\276\265\314\210Y\373w\231K\315\277:\315\363\230}\330H\314?O\000\004\2217m\227\244\223\203>\356\254\027\275\275\265\341i\351\031Q\305\2635]\201\260j\004I\205\0022Z\205\307\350\346\210J\337\300\016\326\000\2676\\\357\342\372|\030\266D~\333\000\211\222\347\322\263\314\335p3O\2069\000\033\346\\[\361\026\321\274\022\347\262\221']\302\270\031Cu\243\004\250\264g\304r\344\276\014\020Ly*\226\360\374\034}\010\3049P\347\302\262l\201e@\355\017\302\374\330*\007\243Td\233\270\213\037\304:\273=\344\032bO\270@9g}\216\033\224\017s\310\240\247\222\360M\313\322\254\031\001\251\026WC\t\325F\251\323;\207{C\364\316an\034\315|!\257\311\305\337\263\312\036\260yw\245\320\335\271\224C\213M\201u\274\222\274>X'c\367\035\204\2245\035fzt\314<+)\330\241\214\256-\224\354\343\272\034\345\204\032\237\217\346\327\262\002\026\240\334\364:\360&\322_\341!\225l0\373V\006\034\215j\244\356f\313\243`\303\230\264\200\212$o\320]+\300\311|\235w+\013\246\2648\240V\223\310o(\227\214\334\022\310JE\265\001\254\222_""\243\243\250\006\355\331\r\230\"\247\256\226\3249V\310\270\376E.\343\207\201\300u\367e\324\217\375\006\214J\276\214\324Z\327\321\262\277~*\312~\355~\252\\q\205*\375|\201Be\226\333\216\351\370\0146f\314?\036v0\377\343\227uK\341a\253\230\25152yh\277\315Y\375\210\"\tV\357\005\300\207\321\351\323 >\256\325:Q^\340\201k\257jW8+\030(\356i\3246@6\254\023\253\255X/\254\023\010\232\236\214^}\003\304\354>\377\020\t\370\204\235F\301,\"F\322\216\024\nZK\013d\341\311\200<\330V\366\2711\017S\252\215G\377\007\356\245U\347\332\271$\224a@\277>V\326\234|}yv\020g\373\213\250\254\263P\254 <A4r#\235\016\221)\373\"}\245)[\236\313\213\\\177-\006ocN\354\202s\324\355\202\363\000^\265\344\377\000\330\327\027u~\245\305Qg\373<\016D\201j~\346\211q\037\332\301\3565\253\310\271\327M[b\314\334\177\203\220{\007n\267\301\332\013\300\336\326\341\267.\311h\350-9r\333\306\307\020\027\026\353\203\022\243\255\033\300 u\214\333\013\376PzH\236\321\2228\020\016\305.\251\351V\035\035a@9\025Ka\206F[M\355\224\225\234\235\014/\237\252'\247t\276\307\212\311z]\353wY\261.\225\311.\226\304n\324\306s:\351\002F\271+\200\264\263\212\377M\316\330\337\275\305z\n\017h}\226T\262\356\311f\2152\036\245\233\n\265\027\364\212'\324:\375H,\353\264\223\0347\0337\377\317\253\367\347\323<\024\373\265n~\2771\335\006P\001\260\333\226[7\211\237\246\337\223\364]n\005G\311\030\204V\341\207\205\367W\227r\204o\017ZG\353\307\357\213\351'b\362\341\204\301\203~E\325\247x\030WzO\312*}\233\210\231\225\332\261\370\035\035;\263~\234\3119\260X\212\204\337\nj\305\265\362-\225\r'\317\301\216\257\271\221D\247?\335\312F\304T\343\315S\231\023@V\370i'\274\205\373\023\354[\236\255\347\3744P\253X\212\254\276\006\206D\211_\203B8\210O\215\361S@\377v\224B\365\022\230\241\250)I-\n\205\000{B\227\026 :e\363\006\022\0338\312\247\236SK\303u\347\264ds4\314\207\347\264\277^\\G+\246f\007\324tK\263v\2162\335~\332K\2533\341`\255\277\\\0057\n\313\264V\327o\200\301\n\325mO\2243\005\217\201a\300\251a*\316\276\232K\373}}\265\3323<\241\274[\215\314\037\017\302wQ.\310B""\r5\215aq\314\225-\025\213\276\334&i\023|\026\233\307uRr\037k\253\222\331\010\365\252?\236eq\255\222\325\322\240\315j\\?\036\0013-\371\231\227!\025\341\305\017[\275+\025\226\034\303\246w\371\205:\031\377\216\203'e\017\342~\315\367\274_\211\034\230k\336\314\370\035\217\352\227\227\252 of\262Fv\305c\356\330l\360C\353\304\016\277}\227r1<\014\327\333\322\316]\255\305\376\332\357\230\214y\332\202E\224\377\323\341\257\205E\3649\334\327|7\243\321\017\340\346#\0002y\333~L\264\0242\240\305\311\014\333\203\231\313w\232m\315J\363\025\322`\354\\\332F\000q:qq>\\\206Z\216\266\304y\277\322\203\2450P\213\276UZP\204\253/\263\270ky\363\026+\014\346\023]\317\350\365\324U\373\270\3565\323g\310\230j\320\236\321`\002\334\024\344\203\025S\002\266\264>\341\366P~\203\311z\325K\006h;ZX\016R\260\356hHX\300\267\342J&\2178\374\016e7\005\0106o$\000\221b\320\233\341\226\376h\324*\013K\030\351\306t\320YLQz\364\002F(m\322f\014\322H\274&\304\026\354N\273?\215\267'\025P\243\247\336__\032\251Mc.\354+\010(/{\027\277\202$\330\004\221\361\356\210\007\357O\266\010M\357\300\021(@\207?oA\367\243z\367\203\222\241\003YD\330\360(N\330\226N \372\332\2125f\245\r\243\322\364\230\234h\032\256\000\345\251\357\345=f|\274[\226\267\022\tt[\275\342\323T\035\006\343\307\352\321V\304\216\242J\375*9\247\274\345\272\016@r1\333\370W:B\245Z`}\004\247\304d0\022\272\205O\243Y\"\316o\227D\026\362\252{0vm\260\360(\374u\tI~\307\220\022\272\254\342\250U\365\214!\306$\356n<jqX\3433\034O>n\024\235\327y\")p\362\256\"*\357V\360\360\031\371\217\203u\375\355l\370F\247\376\362\276r_\262\323\233>P\237\233\207\242#\334r\010+\016\237\002Cl\245!\266\207\301\255X\213.\267\005#\004\t\366\301\337N\177\313L\334\211\214\026\254\034.\243\005!\304}\r\306\266n\201\361\031\303\215\353\316\273\221\316_\313\272\2159\244Ne=h\221\346\206W{\000\2117\251Xv\254\334u\372\236\"\007\353\267\324KF\2212M\331\377\337\222\206\003\251,\327\204\004\030\\\252:%Y\010\r\253F\306a\006\366\222\nm\tIHVi\343\026\225\t\262\3230\333\303H\006\007(\026#_$\324\342\020Y\265\217)"" \325\027\250\350\237\244\254(\267\017G@\237T&\033\363\217\311\225\277\376[\312\321v@\324qn\342f\026\205y\207`[\222C\361\261\307$\317\265\n\2053S6\3570dU\\V3\006d\311\273\202u\313\213\272\353E;N|\232\346\353\234\252\2334\304C\326\020\323\301\3618\023o\326\360\206\276v\362\325\355qH\370\005&\021\332\024\020\221\276co\355s\2435\200Ck\001N\317Oc\236W?\307\n\316Y6\351\326\367_\327L\3110u\003\316c\326O\277\205\0173\354F\005l\254\215\360P4\003\363;\262\276\353S\253\025.\177\256\340\325X\017\203un\217\\\320\250k\254\213\321\270\272\276A\374G\0021\316\376\335A|H\017\3411\220\330\3544\236\361\267!S\\\3651\024\036\305k\242\033\253\207\2651\313\363\360oth\3650\360\217{(\374\313=\030$\250\314\0252\242\301\220U\027\355V\027#Q1\270cV\377:\3660\254\333\257\255\261/\254\225\320\036\315\256\272\372\312\026\210\310#7\334\367\230\362\336W}\236\241\346\016.\277\360V\266Ga\203Pn2\010\023\246\213\003Z\231\355\257\177\256\374\n\272\213\025s\344o\212_B\256\177x\254\326\331\353yz\326\363\266\006>)\3709\327\323\205>42\227\245\337C)\334\303\033\211&\261\216\031/\377\343\036\332\377q\017\205\017\356\001s|\2374~G\202uDz>\254}\356\032\316|/\235\233\036q\263\363O\340c\234\327\300\210dX\\@k\345Bc\242\331\321\254\202\333\234\021\355E\234\213\017dFk<\r\264\343\r\254\331}\022U\201V\271\217\000g\024X\014\306\326\2725\257\256\316\3348@\200\001\n\275\006\002Y\302H\000\230\220\2556\214\370\370\322\346Z\033\250\"\214\350\031\014\233-\035K\317\352\035\365\305\350YzBBn\357^:\r:\305\312f\004%\244\034]8`\353\227#\225\312\203\000\270\371\245\375\365\334_[\325\243\260\332\246\212\225Ei\2472\257\216 \362\022]S\232Ae\205\376\255j\321\277\023\217\235n\252;\307\021\272\003x\356\266\351\"U\372m\351O\n\332\247c3P\244$\333\353dJ\331+\301F\334HO}\217%\322\310$J\277\034Cz\222\216\244\272b\272\374]\326Y\336\303jq\376\2248/;T\005{\177\212\207\276h\252\227\371T\245c\303<t\325\272d\202J\355M\204\323}\226\220C\316\020i\340\307\350\010\330\2178ph\240\263\354\364n\014.Ie\316\271N\225\021\362\230\200\307`\n\037\026k\302\237""\275B\251/A\030\026t\236\003\240)m{\1773\335\2038\227\237\244\237\220f\270\025\356\353\026\377\263\255X\337]\237\322\377^Q\353\000\356\272\265\364\224 \t\216\324\273H\306\353C\352\033JW\331\225\356B\365f\327\322\301t\3378y\357@\303\270\013e\225\240\312>\251WW\230'A\026\301I\027\202\256\024\307v\004\327\264FK\265\226W\\@\374\377\233\313\232\257\205\252\273\022\344z\231\210+\342\310\230h\354w\327\037\301\374/4f\275\225\255\367\206t\274\310\213\032\223|\305\332\032\351\027D\006\n\344\004\262\345\t\261\260\006\222\371\306\324\312\277\274\007\377\377\342\3068<\310\324\222#S\267\333a\375\266\344A\243\250\026\370@6\200\030\303$;\315\231\225\262\250c\351D0\024\336\031ph\303T\256$\007\233\201\352\014\340\357\360*\026\260M\033\230rd\030\312\327\354]\317\271\347\320e\346\324\253\267\007+\353\2552\272}\370\240!\355\364/:0\234:\354l\301\317\017\023\210\346\212\235D\220\3119\241\347-L6$\336\2707\355\245/\213\216\234\307\340~]\261\334\271\027\030\314\004uW\320\007\363\004\204\345}\027\274z\271\021\326\020(\327\237\250Z-\355|\334(l\373k\310ym\177\351>\347\354_\240h\230\203\217\346\016g\265\266\230T\360\244\301\007u\022*\325\200\370\242C\022b(\360g\377\007\036\236\274)\306|%f\337\320\002_\333\021\275\214O@\255\021\014\357)%\333\354\243\032j\013\370\352f2\253\371\301\367\327\236F\036\335\255\314\256#\027\347c\362\237\300\302~\232\344VE\302\242\026\355n\013\235d\016KT<\316\343\250b\240\263\340\301y\226\344-\217\362\236\245Y\007_\246=\376\261q\2641\313\352-\220\205\312\300J\007\371\250\320\335\203!\267\327B\335\273\331\230mT2.ZI\256\227b\364\350N!\372\330\005\033\270&\343\362\016\330\013\232\247\326pd\361\364\3329\302\307q&y\250\376sz\364RzI\250\304\257\376\372\350\243\005\007=\362\026\374\271\005 \222\237f\000\347iw\027\232q\246\026lP\373\333\360\237\224r\225\036\231\246c8\237\346\341u\313\351\310IPf\235\177\002&9X6/0\207\357\244\230\217\374\256\345\322`\375.%\261\323\317P\023\ni\t\020\031\021?\367\2137\241e\324)\224\274\203D\267\220\361\217\307\340bs\376\361\256~\232bH\235K\377\251""\177\255\353@)J\007\020\365#b\334\243'\000Ztyt2\376C\177\270\2407\000Y\271t\302#\333\233\360\003\204\026m\330\265W\356\332DG ~\035EO\260\n~\252\003:?F\262\375g\210Ghgc:8\001\245\217\311\324\272\\\1774\316\241x\213\320\236\205\376B\033H\0072\203\216NU\371x!>N\245\362\317\2431\220W:\376\201\316\024\007\230\202\374\256\217\t\205F|Mt\263j\210v\223\213\241\351\023dm\341\347*\375\312\026WW\243\r\021\332T\317a\020\253\244\3710\237%H\221\347\311\211\306\224\206\363\265\361\241\315)c\237RJ\014-\n\201\376[\303\006\023\226\001o\232\205\023\361\224-6\267\212G\303\304JT\230\347\351\364\235\364\316\223\364\t\355?\311\217\362\r\374\371\006\300\365\017\257\206X\351\303V\372\030\226\344y\232\024\347\251\204\305\315Z\264b\"\322S\3376\177I\357\002\364+\030\374&\267\205\3165\340\221\223!Nm|\377\201\254\\\220YY6@v\241\356\373\353g\343\321\344\317\346\363\364\316\323\364\351\213\364\305\313\277&\304\272J\013\307\322c\227\233E~vj\332\350\265.8>v\344[\002+\376\227\370\222\2425\264=/\341\305O\256\323\240{\356`l\024\214_\342o\033\007\232c`m\177\030n\273\211\034\3659\032\345\303\370X\374V|\236\203\304\022\260E\327(\213\245\375\225\260\264hy\221\366\376PX\025o\233\371\346A\264\n\346\3409/\204\352y\r\330\032\200\302\t\206\372+#\031\354\006\r9\355\377L\32321\200\234\277\323V\317\303\257\361\335t\352vz\373~z\377\001\034\014%\215I\277\237\374)\031\270\232\022E\323\332\301\021f\033*o\311qu\201\250'\354\234\024<\321\305\023\340\221\373\204)\361\225\020U\2777\254JE\262&\001\200\275\273Ql\234hN5o\244W\257!\234\261\330d\225\264B\325\345\224\343\203x \321\307\010\354\2165\320DA\"\214\255\273\351]\331\026\366\250\364\317\000\263\352-\320\253\226\0354\230dR2&\000\352hz\025 P\301R\0130\255\336D3t\2469Dhn\372m\240N\371Yl\001\373\033\026V\320\216\340)BF5fC\275\336N^\301O\324\033\304J\323}\237\246\237N7\306\030\374\217\237\373jRx\346\214v\240r_\027\301\225\253;4\020y\026\237\221A\205\222\355\014\236\240\005\316\242CB\302\276\005\375\344\250>[U\224_>[\006\341\240\267\262%\031\234\031\201p\327E\245\316\300l""\274\301\242\3517\224z\220\266v.\241\027\341\030\006C\027\234\314/\265\214\017\246\007\317&U+\r`o\355\270X\201\307U-\361\"\345\201\351\344\374)\036*Q\201\360\033\302\362\357h,\320\266\355\252\265\022\304\216\221\"\203Bv\277b92{\323\275G\242\252\245o\256\375X;e\020\253Xh\232J\034\261L~\234\236\350\250\311\213\263!\320\2045\260\"\215\0074I\207j\326\351\177\202,\032\3238diX\2113k5\346\024\021kwl\331U\353k\214 r\353\034\305\333(\277\216\266\254\340s\235m\313\220f\260\366\200u\361\352\372\033\337\214f\3271\212?eU\244,\002X\273s\2624~\216\3275l\306\224\262\346H\024}\363zV\206\256aRmG\326\325\266\034\355 \207F\006\216\235\205\006\251\232\017\255\007\366\256O\030\264U\315\022\342\352Q&1V\265\004\355~\235M\0132\021w\265\226BhA*Lo\355\004`\363\202\307\"\204w\242S2e\267\210\264\346\353|\014\016Z\312\346Q]\276c\316-\214\210\201\\\231\242c\316Bn\243f\307\311f\320\"\\\366\326\303\216g#\227\307\271g\306\300\376\312{\006\311zP\325\n\240\005\034CH2\356\240\273$y\362*\366AW\301\371Y\226\325%\342\317\267p\260Q\372\315<\314W\332z*9-\216\346\322\251\344Lz\361\277\322\377\022\n\365S\r\211\345\270\262\366\005\256e\263\260\356Nw\017\301Tj>\326#Q\325\301\366\003p\243\321i\320\001\364\333\356\003\340\267\320\014\305:\231k\236L#}\3136\254\236\377\325\266\004\307\330)\274\321\313\177\316\364\206\351\357\324\036\270\347A\034\244)\227K`H\217\233\216\347wd\262\353\343\031\232\355\202\234\361\376\232\337\320\242\03359B\260\270\003\310i\357H\315\334\263t\233\362\004\001\341fh)\363\205vI`\275\355\026t\255\006\364\205&\035\231\360l\236Yb\364\245\332l\260\306\233-\371Bv+9+\336\033Z5\313\353yCP\013\254\036\030E\251\277\003\213\365m\221\277\2762\010}\235\301\351\342R\351\356Z{l\320A\317?\355\200\217@\227\222\2021\364!\035X\225$\353\351\200\257nC!\240\263\021U\332\352\016\245\177I\366\210\252I\235\274OYFh\277\221\311r\031\265N\334\322{\0305\252J\033\275\224\334i\346\232\273\232c\366\246\354P\025\303\360\357\036\233U\325\200\304\265h\225Q\276:\303x3\323\277\213sqy\263\225}KF+\363Y\216\3263WR\237u\213)$""\312\270E\277u\000\307\rw\021%/\n3\314J0\\\027F\234\224E\022\210\255\213Ay\033\300\rb\205\030h\3147g\220\025\"\210\356\206RpD\030\342OT\2018\034\006yk\364\271\320\310\333\342\312\232Poz\236u`(\353\213\310E\312\251_L6vF\241\3130\004b\021\231(\277\324N|d\244Da4JcX^S\274\216@U6\253\357\206\367\033\241'>\211\252~\241\314\234e \026\261\370,l\332^\207\364g\375\262\026\221\202|-\233H\001\236\334g\301b9-\255\272Q\277[\266\"mt\255\234\275\274m\274)\351\301W\205\231\253\303\223\213\343\337B\304\325L\272PUQp\311j\230\371\002\262|$\004\364}\203X\241\245\th\243a\023B\024\315A\237\005\014\265\010\305%\366\013\271\020\313\345zuU\360c\350\264d\335\013-\346\tm\n*|\272\334\327\t\243#K5\325\206u\342\003\323\027\341\373v\205.:-\025l\320\257\365Y\215Eh\352f5!Z<\353#\237\270\315\0169\005\325\272`x\315J`\243\034\335\247R-\232<\253\022XB>\231\207\206!\237\216\220fnau\276\000[\013\356/\363\373a\205\365s\033?\224\271$\265\232\242S\0025\347`[9\353ZE\301\334|b\376\2454\214\233v\337\234\n\024\302\372\352c\205!\236\351\233]\010\262W\016X\213\323\3140PYZ\324p\275\032\0029\032gHp\254\263\341ze\205+[O\024\226\001\263i, 6\247\262\205\365f\001\\)}\252\337C\252\342\323\247\261Q\340\376^\007\033\205\211\253U\256\331'd\261\236\013j\2306\"\221\371\302\0164\311\352\302\211\316\303\323\211Q4w8D\332Z\224\330\013\224\341\356p\\\226A\213\003\212B\214\327\222|\310\2568BtD;\354\036\003\222\320\373\021>`\217\003\250p>\221\322LA>\221\232<e\177\034\215~\300\005\216u\261g\035-\265\3117\304\266I\240\001\311\256\300\363\355\223\310 \317\323\317\347(\023JC\263\320{\025<h!\003\321`\244\274\003}\240\361\342\035a\341\254\370\254f\306\202\340\315d\245\256y\3500\342\333\346\327\225\260j\257\"\000Q\034'v\212<\002\034 x\362>\333\0348\017\265\233\360>\276>/\353\243\2734\365u\241V\311\346}\235\361`\226\331\336\323\222\313\277\306\366\243\005\3033\001\311Ft} \000\303\263\333\314\234\254\236b]\323\253Mi\033\312\273f\267\363t\027S\302\257\305\331}\2574QW\337\366q4\010NQ\022v\252\3103z\035\007\244\221\352W\251l:\236\365\016H)\275""\213:-b\277s\032)Er\216B\031\275\230\3070\023\025\255\377\225uIr\267\215D\205\270\352\235|\267c\246\276\235\254s\033\217\235\2608?/T\3042\353\200\225\2436\253<\354\371\262%_O\206\000\354 \032qG\014Z\377\220H\032\0343\017C\223\346?\341/`\221\331\253`\376\016\3722\343T\013\257g\255\\\257\372\263\177]\203e;\347\252}\346t)\264n\302\365\354\252\347\355m\321\345\021X\276RU\005\273\227\306\000\177\327vh\000<\307\301\372\325\350c\241V\335N^4F0\361\320uq|\006\331\214\215k\220>\235~\177\025\221\240\211/\021\202\214\351\003H\331v\214\237\340\014[\277\370\377\330\201\214\207\203\024\220\220\037\236\303\207\230i\361\201\001(\261#-\300k\225\355J5\235\252p\234\016R\3439\240V\022J\301\361\034\274&\031\025\362\034\\L\276jT\233-\315\242][\317\247\336\"\261\010\035\273\220\r\324c\337cv\341\265\304!\312\363\021]V9\321\355{8\243\251qV\023\3740\262\232\312\025\017\307\211\003\327BJ\345V\361\244\253I.4\337\362\010b\2500:\242\004\263\232\005\344\\\260\037\243\226\351\227\010S3\035;\364\322]\001V\343L\200\001\375)^\004\300\254\246\243\352:\207d\024\2575\207d\324\242\253q\360\215%\250\242\217\2033\217\023\333\006[\313\271\257 \204\313\0012<\320\031\035\232iu(\203\2212\273\276\217\243k\375\201\364#k\250%\353\026\003 \262(l/\360Q\354\326\036]\377\001\006\t\355~\224\317B\277\300\251\0068\346\363\365\374z\347P>\252OF\322r\232I\316\244\035Q\262:\311L\372\367\001TW$\317\310\006\261,\201gN\350d\340d\231\365\311 W\357|\230U\212\230\007q\374}\031Q\333\371\376\345\3228\271\272\366\377\235\350\350\332\367q\205B\032\003;\211\253\032'\3260W\233T\310\235\346\n\342\303\253\007\001J\273Q!\345\025\372\367V\366oBi\313\252>V\225\340]\204\233\033\212,hB2\226 \267\273\356\246\216\200\031\374\274\301\\\245g\242\234\005\030R\260h\326\373k\016$\334c\362\316\204\006\240\341\230\364\375\373\\\326\277.\007g\233ni_\327-\032a\327}\312\240\007\303QV\221\002MX\347>\206M\352\200\202\373\364{.\326\235\204\246\327A\202N\257\236\233\021\223it$\273\005\t\327\333\204\345\346\2660\340\036\252\331k\307\263\"i\344:\262\312\304""\313I\177\242\231\364Jn\231\265\251\274sJ\226-MD\2038,\242\236\214\"K|\014k\032;=\215\201\222\3372 \307 q\265\213r\214\375\234\317~\007\366`D\234\375\027I=fh\270\275\321\017V:\247\325\205\235\333\250\220N\273 \335\317`\331\2243\022N\r#\305c\"X\375=0{L\323ak\302]\010\351\340\361$\347\227\3117\362!\022\021\320\301\316G{\304\3517\236\344\262T^\343\202|A\376o\004<\021\323,\324H\205\265\301\340\251\024,\322\225\350]2\331\030\024\032Tk\363<\344Y]\271\221\336\000\352\221\364\356\275\364^%\255<O\237\377BZLG\306X\254\334S&Q\253\313\375\003Hh\265\001\017O\353\037\016\242m\036\203[\371\216\325/\034\253\377Fyx03\275\377{\243Q:\315O@\337\313\007a\375\000\342`\024$\235\205\374\321\303B\275Jo\231\300\210\215\301\244\243\273\3122\321\241\350\000\367X.\213\036\241\360|\251\014\230O\336\2372\0052'e>\rj.\220\0068\006\364*\243\220^E\305\335r\n\370\200\224\312<\223\034hL4\363\230[\2473N\317\304[\304\306\343\351\267i\337X\334\036\337\002\225H\361\221\333\r\352[\204\020\273\005\236q\314\021\3731\375q\361\257\217>z\235;\017\031\271\347[~\200\077\077\264\314\303\237\371\226G-T\326\362\254\236'\372\023\2500\034\022_\000\310\323\236\211\225\277\025\265+\342H\000]\252S\037\361Jj\227\304\310Kb&\266nS\265\245\320\331V(\210:O\377\263\276;3\323\027\226NA\202\211ve\0311\250*)\3575.4\307\230\007\001\321\007\271RO\"\005^\351\021&0\236k\252\323\000\004\306\353:\326\237\332\302V\247\007\253\334\367G\334\007A%\010\363\004eC=\024\254\234\332\227Z*\2520\3771aX\177\314\223\013\214\325\257;\340X;\206C\001\014=!\2552\240v\224\031\0059\2432?\332\201\332\351\257\237\206\223H\227d\355_#\023_-\363Nd\247\2613\t^\327\245\007)\013\212\307\205Y\244\241\037b\233q_\215\353\013Jf\276\340P\276D\3348A\311%Gp\360\036\272\215\002\037\253\250g\360\026>\373\345\274\003\217O\367\224\334^Y\336\221\337+\256\211}\265\233\022(\340\2510\016g\032e\340.vl/\304\331\022\022J\252\311\2140p\304P\n\222\332}\003c\256B\335\236c\340R4\317\n\375\320\205e\264\260\240\364\354\014+\000a\246!lNrluq\2708\236%\250\237&\375\202O\304\227\333H\021V""\013X\256\215\316\327\327\312\335\304\203+\026\351\r\233\335\276Pi\010Fr\265\363\352\265\252\013\013('\312\356\275\230m`S\007Y\332\r}~Z\311h\226\371\035\350E\255\353L*Nn\205\213%s0:\035\277f\356\021\211&ck%\252\312\366x\3438\225\363\352\333i\304}\322\235\356\357?M\nNc[\210f-H\272B\315\301Vms\"\234\373\241\354\025\244E/A\342B\326\372\202XuHq-\321\377z\\{\224a\010\033\310\314\242\352\254\017\312C\215\255\267\274\rZ\\U,\314\262,4\0359%\216\304\351\244\032\236\345\017\354\207\344\321\206\272A\2778\225\036>\233\274i\346\250hu\215\352jM\226\267W\tgM\312a\235E\0032KCU:st\271\370\001\030&\272\222S%\315\275\204k\211K\224\207\203\244\361\r\301\370\330If\3733!\371bc<\227\234ot6s\315U\374\273\345\264L\375\201eJ{b\202\360\307\350\362\210\252\335\275Q;\201\202e;T\331A\000\"Ge\271\226\226\3740\236L\006\2215U(%\332\321)N\217u\365\243\355;\362\302\335H\306\264\207h\024\330QWIle\370\2248n\212|\322\263\345\377\323\"\tS]k\317&h\355\233p\300C<\346\311\352d\325\357\010n\333\306\260\257\030t\033(|\262\217u\025\365\252*\027H;=\232\250\342\177\243\337\377\026\347C\271C\003\351\200\376Hz\007\003\216\341s\022\326\241\032eV.\"\024\244\241\006\312\3237q\240PTI7\335\242\020\006\31245L0\333\233\033\233\2339\203VT\265\362IIk]\362>\232\362\251K\227C\301|\000]\237$\tE-#\316v\207\321\3675y\322c\300u\350\224\007\314\"\222\002p6\225x$\306\022\223T\2333_\273P\377\0149\000\306\002\254\000\0131\0079.e\226M\201w\244\342\266,\256\332\034Q\202V\264\014\256\324\252\014\224\265\350\215\326]\375\344fj\317|;/\300*\203\370\226\212\334S;\254\222\254a6\320\212\014\311]eB\224BsPt\342\271\347i-i\217\222\177G\207\017\371kC\362\016\327\337\305\2377\n\315\267\351\255\333N\221\350\002\251\214\376\377\230|d\235\021\260<|Xh\333\272\250\247J\233\372-{\221O\336\037\007s\313\366\301\312\027\350\253o\002n88\003\367\021\353i+fZW\324\256>_k\307\344\215M\312\335M\2376\257\215\214\221\250\310,C\371\\\231\000\356\016?+\021|.\226\344\005\230\017\3646\312g1h\222fpK\2254K2\340\276U\013\363\254;d8\203?\304\370\317orTF}\313\336\332i""\234\242\202\005\021<\357F\204\346\251p\342\010N\201W\312N\201\306q\3202\251\305V7kc\304\354E\320\232\3366\362\201\000+\222\240\001a) ?nk_\272 T\377N\225\251\003\253\276E\034Js\265\251e]\372\263\271\267vQ\242O\315\251\004\343\300%\235\374\360(\232u\"H\027\222\311\306P3\367\335\377\001W\376F\024";
    PyObject *data = __Pyx_DecompressString(cstring, 70432, 1);
    if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
    const char* const bytes = __Pyx_PyBytes_AsString(data);
    #if !CYTHON_ASSUME_SAFE_MACROS
    if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
    #endif
    #else /* compression: none (232735 bytes) */
const char* const bytes = ": ARKIMEXType | strA matrix with Any | NoneArgument to KSPSetDMActive().ArrayInt | NoneArrayScalar | None\nBasic constants:\n\n`DECIDE`\n    Use a default value for an `int` or `float` parameter.\n`DEFAULT`\n    Use a default value chosen by PETSc.\n`DETERMINE`\n    Compute a default value for an `int` or `float` parameter.\n    For tolerances this uses the default value from when\n    the object's type was set.\n`CURRENT`\n    Do not change the current value that is set.\n`UNLIMITED`\n    For a parameter that is a bound, such as the maximum\n    number of iterations, do not bound the value.\nBuffer view does not expose stridesCSRSpec | CSRIndicesSpecCSRSpec | CSRIndicesSpec | NoneCSRSpec | tuple[CSRSpec, CSRSpec]Callable[[DM, Comm], DM] | NoneCallable[[DM, DM], Mat] | NoneCallable[[DM, DM], tuple[Mat, Vec]] | NoneCallable[[DM], Mat] | NoneCallable[[DM, Sequence[int]], tuple[IS, DM]] | NoneCallable[[DM, Vec, InsertMode, Vec], None] | NoneCallable[[DM], Vec] | NoneCallable[[DM, list[DM]], tuple[list[Scatter], list[Scatter], list[Scatter]]] | NoneCallable[[DM], tuple[list[str] | None, list[IS] | None, list[DM] | None]] | NoneCallable[[DM], tuple[list[str] | None, list[IS] | None, list[IS] | None, list[DM] | None]] | NoneCan only create a buffer that is contiguous in memory.Cannot assign to read-only memoryviewCannot create writable memory view from read-only memoryviewCannot index with type 'Cannot transpose memoryview with indirect dimensionsComm | NoneDIRKType | strDMLabel | NoneDMPlexTransformType | str`DM` Boundary types.DM.PolytopeTypeDM.ReorderDefaultFlagDM.TypeDM.Type | str`DM` types.DeviceContext | NoneDeviceContext.StreamType | str | NoneDevice type {} not supportedDimension %d is not directDimsSpec | NoneDistinguishes among types of explicit and implicit equations.Distinguishes linear and nonlinear problems.DuplicateOption | boolElementType | NoneElementType | strElement types.Empty shape tuple for cython.arrayEnum describing mapping behavior when global ind""ices 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    Expect a dltensor field, pycapsule.PyCapsule can only be consumed onceExpect a dltensor or used_dltensor fieldFactored matrix ordering type.\n\n    See Also\n    --------\n    petsc.MatOrderingType\n\n    Factored matrix shift type.\n\n    See Also\n    --------\n    petsc.MatFactorShiftType\n\n    Factored matrix solver type.\n\n    See Also\n    --------\n    petsc.MatSolverType\n\n    FailedReason | strFileMode | strFileMode | str | NoneGAMGType | strGit Date:Given IS | Sequence[IS]IS | Sequence[IS] | NoneIS | Sequence[int]IS.Type | strI[0] is Indirect dimensions not supportedInfoType | NoneInput vector has no tensor informationInsertModeSpec | NoneInsertMode | NoneInsertion 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    Interpolation types.Invalid mode, expected 'c' or 'fortran', got Invalid mode: expected 'r', 'w' or 'rw'Invalid mode: expected 'rw', 'r', or 'w'Invalid shape in axis JoinMode | strKSPPostSolveFunction | NoneKSPPreSolveFunction | NoneKSP.ConvergedReasonKSP Converged Reason.\n\n    `CONVERGED_ITERATING`\n        Still iterating\n    `ITERATING`\n        Still iterating\n\n    `CONVERGED_RTOL_NORMAL_EQUATIONS`\n        Undocumented.\n    `CONVERGED_ATOL_NORMAL_EQUATIONS`\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        collinear.\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_PCSETUP_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    KSP Type.\n\n    The available types are:\n\n    `RICHARDSON`\n        The preconditioned Richardson iterative method\n        `pe""tsc.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        method. `petsc.KSPPIPEFGMRES`\n    `FGMRES`\n        Implements the Flexible Generalized Minimal Residual method.\n        `petsc.KS""PFGMRES`\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        `pets""c.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 s""elect 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    See Also\n    --------\n    petsc_options, petsc.KSPType\n\n    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    LGMap.MapMode | str | NoneLGMap.Type | strLayoutSizeSpec | NoneLinear regressor type.\n\n    See Also\n    --------\n    petsc.PetscRegressorLinearType\n    Literal['r', 'R', 'right', 'Right', 'RIGHT', 'l', 'L', 'left', 'Left', 'LEFT'] | NoneLocal to global map types.LogClass | NoneMatBlockSizeSpec | NoneMat.FactorShiftType | NoneMat | NoneMat.OrderingTypeMat | Sequence[Mat] | NoneMat.SolverType | strMat.Type | strMatrix SOR type.\n\n    See Also\n    --------\n    petsc.MatSORType\n\n    Matrix assembly type.\n\n    See Also\n    --------\n    petsc.MatAssemblyType\n\n    Matrix duplicate option.\n\n    See Also\n    --------\n    petsc.MatDuplicateOption\n\n    Matrix info type.Matrix modification structure.\n\n    See Also\n    --------\n    petsc.MatStructure\n\n    Matrix option.\n\n    See Also\n    --------\n    petsc.MatOption\n\n    Matrix type.\n""\n    See Also\n    --------\n    petsc.MatType\n\n    <MemoryView of Missing input parameters\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`.\nMust provide as many communicators as levelsMust provide both sizes and points arraysMust provide operator for USER or PYTHON typeNNZSpec | NoneNorm 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    Not for rectangular matricesNot for type {}Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.Out of bounds on buffer access (axis Out of memory. Allocated: PC.SidePETSc Error.\n\n    Attributes\n    ----------\n    ierr : int\n        PETSc error code.\n\n    PETSc.Error(%d)PetscOptionsHandlerFunction | None\nPortable, Extensible Toolkit for Scientific Computation.\nREGRESSOR solver type.\n\n    See Also\n    --------\n    petsc.PetscRegressorType\n\n    RKType | strRandom.Type | strSF | NoneSNESConvergedFunction | Literal['skip', 'default']SNESFunction | NoneSNESGuessFunction | NoneSNESJacobianFunction | NoneSNESLSPreFunction | NoneSNESMonitorFunction | NoneSNESNEWTONAL correction type.\n\n    See Also\n    --------\n    petsc.SNESNewtonALCorrectionType\n\n    SNESNGSFunction | NoneSNESObjFunction | NoneSNESUpdateFunction | NoneSNES linesearch type.\n\n    See Also\n    --------\n    petsc.SNESLineSearchType\n\n    SNES norm schedule.\n\n    See Also\n    --------\n    petsc.SNESNormSchedule\n\n    SNES solver termination reason.\n\n    See Also\n    --------\n    petsc.SNESGetConvergedReason\n\n    SNES solver type.\n\n    See Also\n    --------\n    petsc.SNESType\n\n    ""SORType | NoneScatter 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    Scatter type.\n\n    See Also\n    --------\n    petsc.VecScatterType\n\n    Sequence[Comm] | NoneSequence[IS] | NoneSequence[Mat]Sequence[Scalar]Sequence[Scalar] | NoneSequence[Sequence[Mat]]Sequence[Sequence[float]]Sequence[Stencil]Sequence[Vec]Sequence[bool]Sequence[float]Sequence[float] | NoneSequence[int]Sequence[int] | ISSequence[int] | IS | NoneSequence[int] | NoneSequence[int | float | complex]Sequence[str]Sequence | str | int | bool | NoneStencilType | NoneStencilType | strStencil location types.Stencil types.StreamType | strStructure | NoneSwarm PIC layout types.Swarm collection types.Swarm migration types.Swarm types.TAOConvergedFunction | NoneTAO Augmented Lagrangian Multiplier method (ALMM) Type.TAO Bound Constrained Conjugate Gradient (BNCG) Update Type.TAO Line Search Termination Reasons.TAO Line Search Types.TAO Term Types.TAO solver termination reason.\n\n    See Also\n    --------\n    petsc.TaoConvergedReason\n\n    TAO solver type.\n\n    See Also\n    --------\n    petsc.TaoType\n\n    TSI2Function | NoneTSI2Jacobian | NoneTSIFunction | NoneTSIJacobian | NoneTSIndicatorFunction | NoneTSMonitorFunction | NoneTSPostEventFunction | NoneTSPostStepFunction | NoneTSPreStepFunction | NoneTSRHSFunction | NoneTSRHSJacobianP | NoneTSRHSJacobian | NoneTensor dtype = {} does not match PETSc precisionThe *ARKIMEX* subtype.The *ASM* subtype.The *DIRK* subtype.The `DM` cell types.The `DM` reordering default flags.The Discrete System types.The *GAMG* subtype.The *GASM* subtype.The *HPDDM* Krylov solver type.The *HPDDM* coarse correction type.The *MG* cycle type.The *MG* subtype.The *RK* subtype.The application ordering types.The composite type.The deflat""ion space subtype.The dual space types.The field split Schur factorization type.The field split Schur subtype.The finite element types.The function space types.The index set types.The manner in which the preconditioner is applied.The method for ending time stepping.The partitioner types.The partitioning types.The patch construction type.The preconditioner method.The random number generator type.The reason the preconditioner has failed.The reason the time step is converging.The star forest types.The time stepping method.The type of device.\n\n  See Also\n  --------\n  Device, Device.create, Device.getDeviceType, Device.type, petsc.PetscDeviceType\n\n  The type of join to perform.\n\n  See Also\n  --------\n  DeviceContext, DeviceContext.join, DeviceContext.fork\n  petsc.PetscDeviceContextJoinMode\n\n  The type of stream.\n\n  See Also\n  --------\n  DeviceContext, DeviceContext.getStreamType\n  DeviceContext.setStreamType, petsc.PetscStreamType\n\n  The vector type.Transformation types.Type | NoneType | strType | str | NoneUnable to convert item to objectUnsupported PetscScalar type, Used by process: Vec | NoneVec | Sequence[Vec] | NoneVec.Type | strVec | tuple[Vec, Vec]Vector assembly option.Vector local size Viewer.FileMode | str | NoneViewer | Object | NoneViewer file mode.Viewer format.Viewer type.Window size.(, -=\n[]., ?>'):a+add_note, already registered:  and  and number or processors  and number ownership ranges  and vector local size , and vector local size array size , array size () at  at 0xbcPoints is a required argument block size block size %d must be positiveblock size not setbool | Nonebool | int | float | Scalar | Sequence[bool] | Sequence[int] | Sequence[float] | Sequence[Scalar] | str, bs==%c%dcannot place input array size , cannot register: cell indices must have two dimensions: cells.ndim=%dcollections.abc, cols.shape= column indices but column indices must have two dimensions: cols.ndim=%dcommunicator not owned<contiguous and direct><contiguous ""and indirect>converged callback already set or addedcoo_i and coo_j must have the same lengthcoordinates must have two dimensions: coordinates.ndim=%dcoordinates size must be at least %dcoords_source must have %d columnscoords_source must have two dimensions: coords_source.ndim=%dcoords_source size must be at least %dcoords_target must have %d columnscoords_target must have two dimensions: coords_target.ndim=%dcoords_target size must be at least %dcoords vertices must have two dimensions: coords.ndim=%d[%*d] %sdict[int, ArrayInt]dict[str, Any] | Nonedict[str, bool | int | str]dict[str, float]dict[str, int | float]dict[str, str]disableempty citationempty nameenableerror code %d, expected expecting a C-contiguous arrayexpecting tuple/list or dictfloat | Nonefloat | tuple[float, float]gcget1dCoordinatecArrays for DMStag not yet implemented in petsc4pygetVecArray for DMStag not yet implemented in petsc4pyghosts size  (given: global size  (got got differing extents in dimension incompatible array sizesincompatible array sizes: ni=incompatible array sizes: nv=incompatible array sizes: nv=%d incompatible with vector local size input arrays have incompatible shapes: rows.shape=int | Noneint | tuple[int, int] is not compatible with DMDA local sizes isenableditemsize <= 0 for cython.arraykey: list[DM]list[DeviceContext]list[IS]list[KSP]list[LGMap]list[Vec]list[float]list[int]list[str]list[tuple[SNESMonitorFunction, tuple[Any, ...], dict[str, Any]]]list[tuple[TAOMonitorFunction, tuple[Any, ...], dict[str, Any]]]list[tuple[TSMonitorFunction, tuple[Any, ...], dict[str, Any]]]local and global sizes cannot be both 'DECIDE'local size mpi4py.MPI, name:, nj=, no=no default __reduce__ due to non-trivial __cinit__ non-zero values not divisible by block size null communicatornumber of dimensions , nv= object>only '==' and '!='option prefix must be stringoption prefix should not have spacesoption prefix should not start with a hyphenownership range size petsc4py/PETSc/AO.pyxpetsc4py/PETS""c/Comm.pyxpetsc4py/PETSc/DMComposite.pyxpetsc4py/PETSc/DMDA.pyxpetsc4py/PETSc/DMLabel.pyxpetsc4py/PETSc/DMPlex.pyxpetsc4py/PETSc/DMShell.pyxpetsc4py/PETSc/DMStag.pyxpetsc4py/PETSc/DMSwarm.pyxpetsc4py/PETSc/DMUtils.pyxpetsc4py/PETSc/DM.pyxpetsc4py/PETSc/DS.pyxpetsc4py/PETSc/DT.pyxpetsc4py/PETSc/Device.pyxpetsc4py/PETSc/Error.pyxpetsc4py/PETSc/FE.pyxpetsc4py/PETSc/IS.pyxpetsc4py/PETSc/KSP.pyxpetsc4py/PETSc/Log.pyxpetsc4py/PETSc/MatPartitioning.pyxpetsc4py/PETSc/Mat.pyxpetsc4py/PETSc/Object.pyxpetsc4py/PETSc/Options.pyxpetsc4py/PETSc/PC.pyxpetsc4py/PETSc/PETSc.pyxpetsc4py/PETSc/Partitioner.pyxpetsc4py/PETSc/Random.pyxpetsc4py/PETSc/Regressor.pyxpetsc4py/PETSc/SF.pyxpetsc4py/PETSc/SNES.pyxpetsc4py/PETSc/Scatter.pyxpetsc4py/PETSc/Section.pyxpetsc4py/PETSc/Space.pyxpetsc4py/PETSc/Sys.pyxpetsc4py/PETSc/TAO.pyxpetsc4py/PETSc/TS.pyxpetsc4py/PETSc/Vec.pyxpetsc4py/PETSc/Viewer.pyxpetsc4py/PETSc/cyclicgc.pxipetsc4py/PETSc/petscdmcomposite.pxipetsc4py/PETSc/petscdmda.pxipetsc4py/PETSc/petscis.pxipetsc4py/PETSc/petscvec.pxi(prefix:r+readonly attributerow indices must have two dimensions: rows.ndim=%d rows requires a row pointer of length %sside '%r' not understoodsize(I) is size(J) is size(V) is size(array) is size(d_nnz) is size(o_nnz) is sizes array should have %d entries (has %d)str | Nonestr | Options | Object | None<strided and direct><strided and direct or indirect><strided and indirect>tuple[Any, ...] | Nonetuple[ArrayInt, ...]tuple[ArrayInt, ArrayInt]tuple[ArrayInt, ArrayInt, ArrayScalar]tuple[ArrayInt, ArrayScalar]tuple[ArrayInt, Section]tuple[ArrayReal, ArrayInt]tuple[ArrayReal, ArrayReal]tuple[ArrayReal, ArrayReal, ArrayReal]tuple[ArrayReal, list[Vec]]tuple[DMDA, Vec]tuple[DMPlex, SF]tuple[DM.BoundaryType, ...]tuple[DM.BoundaryType | int | str | bool, ...] | Nonetuple[DM.BoundaryType | int | str | bool, ...]tuple[IS, DM]tuple[IS, IS]tuple[LGMap, LGMap]tuple[LayoutSizeSpec, LayoutSizeSpec]tuple[Mat, Mat]tuple[Mat, Mat, Mat, Mat, Mat]tuple[Mat, Mat, SNESJacobianFunction]""tuple[Mat, Mat, TAOHessianFunction]tuple[Mat, Mat, TSI2Jacobian]tuple[Mat, Mat, TSIJacobian]tuple[Mat, Mat, TSRHSJacobian]tuple[Mat, Mat, Vec, Mat]tuple[Mat, Mat, tuple[TAOConstraintsJacobianFunction, tuple[Any, ...] | None, dict[str, Any] | None]]tuple[Mat, Vec]tuple[Object, None]tuple[SF, SF]tuple[Scalar, Scalar]tuple[Scalar, float]tuple[Scatter, Scatter]tuple[Scatter, Vec]tuple[Section, IS]tuple[Section, Vec]tuple[Sequence[int], ...]tuple[Sequence[int], ...] | Nonetuple[StencilType, int]tuple[TAOConvergedFunction, tuple[Any, ...], dict[str, Any]]tuple[TAOUpdateFunction, tuple[Any, ...], dict[str, Any]]tuple[TSPostStepFunction, tuple[Any, ...] | None, dict[str, Any] | None]tuple[TSPreStepFunction, tuple[Any, ...] | None, dict[str, Any] | None]tuple[Vec, DM]tuple[Vec, TAOGradientFunction]tuple[Vec, TAOObjectiveGradientFunction]tuple[Vec, TSI2Function]tuple[Vec, TSIFunction]tuple[Vec, TSRHSFunction]tuple[Vec, Vec]tuple[Vec, Vec] | TAOVariableBoundsFunctiontuple[Vec, list[IS]]tuple[Vec, tuple[TAOConstraintsFunction, tuple[Any, ...] | None, dict[str, Any] | None]]tuple[bool, TS]tuple[bool, bool]tuple[float, ArrayReal, ArrayReal]tuple[float, TAOTerm, Vec, Mat]tuple[float, float]tuple[float, float, float]tuple[float, float, float, float, float]tuple[float, float, float, float, float, int]tuple[float, float, float, int]tuple[float, float, str]tuple[int, ...]tuple[int, ArrayInt, ArrayInt]tuple[int, IS]tuple[int, ...] | Nonetuple[int, float]tuple[int, float, float, float, float, ConvergedReason]tuple[int, int]tuple[int, int] | Nonetuple[int, int, int]tuple[int, int] | int | Nonetuple[int, int, int, int]tuple[list[IS], list[IS]]tuple[list[Vec], list[Vec]]tuple[list[Vec], list[Vec]] | list[Vec] | Nonetuple[list, list, list]tuple[str, ...]tuple[str, IS]tuple[str, Sequence[int]]tuple[tuple[float, float], ...]tuple[tuple[int, int], ...]tuple[tuple[int, ...], tuple[int, ...]]tuple[tuple[int, ...], tuple[int, ...], tuple[int, ...]]type | dtypeunable to allocate array data.unable ""to allocate shape and strides.unhandled PetscDeviceContextJoinMode %dunhandled PetscDeviceType %dunhandled PetscStreamType %dunknown boundary type: %sunknown device type: %sunknown element type: %sunknown error handler: unknown interpolation type: %sunknown join mode: %sunknown options: %sunknown scatter mode: %sunknown shift type: %sunknown stencil location type: %sunknown stencil type: %sunknown stream type: %s, vals.shape=values must have two or more dimensions: vals.ndim=%d, vector size w+AA00A01A10A11A11_matABABCABtADDADDITIVEADD_ALLADD_ALL_VALUESADD_BCADD_BC_VALUESADD_VALUESADIOSADMMADVANCEDAGGAGGREGATIONAIAIJAIJCRLAIJCUSPARSEAIJMKLAIJPERMAIJSELLAIJVIENNACLAJALLALLGATHERALLGATHERVALLTOALLALMMALMMTypeALPHAALPHA2ALWAYSAMDANDERSONAOAOTypeAO.app2petscAO.createBasicAO.createMappingAO.createMemoryScalableAO.destroyAO.getTypeAO.petsc2appAO.viewAPPENDAPPEND_UPDATEAPPLY_LOWERAPPLY_UPPERARKIMEXARKIMEX1BEEARKIMEX2CARKIMEX2DARKIMEX2EARKIMEX3ARKIMEX4ARKIMEX5ARKIMEXA2ARKIMEXARS122ARKIMEXARS443ARKIMEXBPR3ARKIMEXL2ARKIMEXPRSSP2ARKIMEXTypeARMIJOASCIIASCII_COMMONASCII_CSVASCII_DENSEASCII_FACTOR_INFOASCII_GLVISASCII_IMPLASCII_INDEXASCII_INFOASCII_INFO_DETAILASCII_LATEXASCII_MATHEMATICAASCII_MATLABASCII_MATRIXMARKETASCII_PCICEASCII_PYTHONASCII_SYMMODUASCII_XMLASFLSASILSASMASMTypeASPINAUAVAccessModeSpecAmatAnyAp00ArrayBoolArrayComplexArrayIntArrayRealArrayScalarAssemblyTypeAtBBBACKBACKWARD_SWEEPBACK_DOWNBACK_DOWN_LEFTBACK_DOWN_RIGHTBACK_LEFTBACK_RIGHTBACK_UPBACK_UP_LEFTBACK_UP_RIGHTBAIJBAIJMKLBALANCEDBASBASICBASICSYMPLECTICBCGBCGSBCGSLBDDCBDFBDMBEBEULERBFBCGBGCRODRBGMRESBICGBINARYBINARY_MATLABBIORTH22BISECTIONBJACOBIBLMVMBLOCKBLOCKMATBMRMBNCGBNCGTypeBNLSBNTLBNTRBOXBQNKLSBQNKTLBQNKTRBQNLSBQPIPBRGNBTBarrierBoundaryTypeCCALLBACKSCGCGLSCGNECGSCHACOCHEBYSHEVCHOLESKYCHOLMODCHOWILUVIENNACLCLASSICCLASSICALCNCOLLECT_BASICCOLLECT_DMDABOUNDINGBOXCOLLECT_GENERALCOLLECT_USERCOMM_NULLCOMM_SELFCOMM_WORLDCOMPOSITECONSTANTDIAGONALCONTINUE_ITERATINGCONTINUE_SEARCHCONVERGED_ATOLCONVERGED_ATOL_NORMAL""_EQUATIONSCONVERGED_EVENTCONVERGED_FNORM_ABSCONVERGED_FNORM_RELATIVECONVERGED_GATOLCONVERGED_GRTOLCONVERGED_GTTOLCONVERGED_HAPPY_BREAKDOWNCONVERGED_ITERATINGCONVERGED_ITSCONVERGED_MINFCONVERGED_NEG_CURVECONVERGED_RTOLCONVERGED_RTOL_NORMAL_EQUATIONSCONVERGED_SNORM_RELATIVECONVERGED_STEPTOLCONVERGED_STEP_LENGTHCONVERGED_TIMECONVERGED_USERCOPY_VALUESCPCRCRANK_NICOLSONCSRIndicesSpecCUDACURRENTCUSPARSECellDMCellDM.createCellDM.destroyCellDM.getBlockSizeCellDM.getCellIDCellDM.getCoordinateFieldsCellDM.getDMCellDM.getFieldsCellDM.viewClassCloneCollectTypeCommComm.barrierComm.destroyComm.duplicateComm.getRankComm.getSizeComm.tompi4pyComplexTypeCompositeTypeConvergedReasonCvecDDADAE_IMPLICIT_INDEX1DAE_IMPLICIT_INDEX2DAE_IMPLICIT_INDEX3DAE_IMPLICIT_INDEXHIDAE_SEMI_EXPLICIT_INDEX1DAE_SEMI_EXPLICIT_INDEX2DAE_SEMI_EXPLICIT_INDEX3DAE_SEMI_EXPLICIT_INDEXHIDB16DB2DB4DB8DECIDEDEFAULTDEFAULT_WITH_BARRIERDEFLATEDDEFLATIONDENSEDENSECUDADENSEHIPDESTROYDETERMINEDGMRESDIAGDIAGONALDIFFERENTDIFFERENT_NONZERO_PATTERNDIFFERENT_NZDIRKDIRK657ADIRK658ADIRK7510SALDIRK759ADIRK8614ADIRK8616SALDIRKES122SALDIRKES213SALDIRKES324SALDIRKES325SALDIRKES648SADIRKES7510SADIRKES8516SALDIRKS212DIRKS659ADIRKS7511SALDIRKTypeDISCGRADDIVERGED_BREAKDOWNDIVERGED_BREAKDOWN_BICGDIVERGED_DTOLDIVERGED_FUNCTION_COUNTDIVERGED_FUNCTION_DOMAINDIVERGED_FUNCTION_NANORINFDIVERGED_INDEFINITE_MATDIVERGED_INDEFINITE_PCDIVERGED_INNERDIVERGED_JACOBIAN_DOMAINDIVERGED_LINEAR_SOLVEDIVERGED_LINE_SEARCHDIVERGED_LOCAL_MINDIVERGED_LS_FAILUREDIVERGED_MAXFCNDIVERGED_MAXITSDIVERGED_MAX_ITDIVERGED_NANDIVERGED_NANORINFDIVERGED_NONLINEAR_SOLVEDIVERGED_NONSYMMETRICDIVERGED_NULLDIVERGED_OBJECTIVE_DOMAINDIVERGED_OBJECTIVE_NANORINFDIVERGED_PCSETUP_FAILEDDIVERGED_STEP_REJECTEDDIVERGED_TR_DELTADIVERGED_TR_REDUCTIONDIVERGED_USERDKDMDMActiveDMBoundaryTypeDMCoarsenHookFunctionDMComposite_DMComposite_access_DMComposite_access.__enter___DMComposite_access.__exit__DMComposite.addDMDMComposite.createDMComposite.gatherDMComposite.getAccessDMComposite.getEnt""riesDMComposite.getGlobalISsDMComposite.getLGMapsDMComposite.getLocalISsDMComposite.getNumberDMComposite.scatterDMDADMDAElementTypeDMDAInterpolationTypeDMDAStencilType_DMDA_Vec_array_DMDA_Vec_array.__enter___DMDA_Vec_array.__exit__DMDA.createDMDA.createNaturalVecDMDA.duplicateDMDA.getAODMDA.getBoundaryTypeDMDA.getCoordinateNameDMDA.getCornersDMDA.getDimDMDA.getDofDMDA.getElementTypeDMDA.getElementsDMDA.getFieldNameDMDA.getGhostCornersDMDA.getGhostRangesDMDA.getInterpolationTypeDMDA.getOwnershipRangesDMDA.getProcSizesDMDA.getRangesDMDA.getRefinementFactorDMDA.getScatterDMDA.getSizesDMDA.getStencilDMDA.getStencilTypeDMDA.getStencilWidthDMDA.getVecArrayDMDA.globalToNaturalDMDA.naturalToGlobalDMDA.setBoundaryTypeDMDA.setCoordinateNameDMDA.setDimDMDA.setDofDMDA.setElementTypeDMDA.setFieldNameDMDA.setInterpolationTypeDMDA.setProcSizesDMDA.setRefinementFactorDMDA.setSizesDMDA.setStencilDMDA.setStencilTypeDMDA.setStencilWidthDMDA.setUniformCoordinatesDMInterpolationDMInterpolation.createDMInterpolation.destroyDMInterpolation.evaluateDMInterpolation.getCoordinatesDMInterpolation.getDimDMInterpolation.getDofDMInterpolation.getVectorDMInterpolation.restoreVectorDMInterpolation.setDimDMInterpolation.setDofDMInterpolation.setUpDMLabelDMLabel.addStrataDMLabel.addStrataISDMLabel.addStratumDMLabel.clearStratumDMLabel.clearValueDMLabel.computeIndexDMLabel.convertToSectionDMLabel.createDMLabel.createIndexDMLabel.destroyDMLabel.destroyIndexDMLabel.distributeDMLabel.duplicateDMLabel.filterDMLabel.gatherDMLabel.getBoundsDMLabel.getDefaultValueDMLabel.getNonEmptyStratumValuesISDMLabel.getNumValuesDMLabel.getStratumISDMLabel.getStratumSizeDMLabel.getValueDMLabel.getValueISDMLabel.hasPointDMLabel.hasStratumDMLabel.hasValueDMLabel.insertISDMLabel.permuteDMLabel.resetDMLabel.setDefaultValueDMLabel.setStratumISDMLabel.setValueDMLabel.stratumHasPointDMLabel.viewDMPlexDMPlexTransformDMPlexTransformTypeDMPlexTransform.applyDMPlexTransform.createDMPlexTransform.destroyDMPlexTransform.getTypeDMPle""xTransform.setDMDMPlexTransform.setFromOptionsDMPlexTransform.setTypeDMPlexTransform.setUpDMPlexTransform.viewDMPlex.computeCellGeometryFVMDMPlex.computeGradientClementInterpolantDMPlex.constructGhostCellsDMPlex.coordinatesLoadDMPlex.coordinatesViewDMPlex.createDMPlex.createBoxMeshDMPlex.createBoxSurfaceMeshDMPlex.createCGNSDMPlex.createCGNSFromFileDMPlex.createClosureIndexDMPlex.createCoarsePointISDMPlex.createCohesiveSubmeshDMPlex.createColoringDMPlex.createCoordinateSpaceDMPlex.createExodusDMPlex.createExodusFromFileDMPlex.createFromCellListDMPlex.createFromFileDMPlex.createGlobalToNaturalSFDMPlex.createGmshDMPlex.createNaturalVecDMPlex.createPointNumberingDMPlex.createSectionDMPlex.distributeDMPlex.distributeFieldDMPlex.distributeGetDefaultDMPlex.distributeOverlapDMPlex.distributeSetDefaultDMPlex.distributionGetNameDMPlex.distributionSetNameDMPlex.filterDMPlex.generateDMPlex.getAdjacencyDMPlex.getAdjacencyUseAnchorsDMPlex.getCellNumberingDMPlex.getCellTypeDMPlex.getCellTypeLabelDMPlex.getChartDMPlex.getConeDMPlex.getConeOrientationDMPlex.getConeSizeDMPlex.getDepthDMPlex.getDepthStratumDMPlex.getFullJoinDMPlex.getHeightStratumDMPlex.getJoinDMPlex.getMaxSizesDMPlex.getMeetDMPlex.getMigrationSFDMPlex.getMinRadiusDMPlex.getOrderingDMPlex.getPartitionerDMPlex.getPointDepthDMPlex.getPointGlobalDMPlex.getPointGlobalFieldDMPlex.getPointHeightDMPlex.getPointLocalDMPlex.getPointLocalFieldDMPlex.getRefinementLimitDMPlex.getRefinementUniformDMPlex.getSubpointISDMPlex.getSubpointMapDMPlex.getSupportDMPlex.getSupportSizeDMPlex.getTransitiveClosureDMPlex.getVecClosureDMPlex.getVertexNumberingDMPlex.globalToNaturalBeginDMPlex.globalToNaturalEndDMPlex.globalVectorLoadDMPlex.globalVectorViewDMPlex.insertConeDMPlex.insertConeOrientationDMPlex.interpolateDMPlex.isDistributedDMPlex.isSimplexDMPlex.labelCohesiveCompleteDMPlex.labelCompleteDMPlex.labelsLoadDMPlex.labelsViewDMPlex.localVectorLoadDMPlex.localVectorViewDMPlex.markBoundaryFacesDMPlex.metricAverage2DMPlex.metricAverage3DMP""lex.metricCreateDMPlex.metricCreateIsotropicDMPlex.metricCreateUniformDMPlex.metricDeterminantCreateDMPlex.metricEnforceSPDDMPlex.metricGetGradationFactorDMPlex.metricGetHausdorffNumberDMPlex.metricGetMaximumAnisotropyDMPlex.metricGetMaximumMagnitudeDMPlex.metricGetMinimumMagnitudeDMPlex.metricGetNormalizationOrderDMPlex.metricGetNumIterationsDMPlex.metricGetTargetComplexityDMPlex.metricGetVerbosityDMPlex.metricIntersection2DMPlex.metricIntersection3DMPlex.metricIsIsotropicDMPlex.metricIsUniformDMPlex.metricNoInsertionDMPlex.metricNoMovementDMPlex.metricNoSurfDMPlex.metricNoSwappingDMPlex.metricNormalizeDMPlex.metricRestrictAnisotropyFirstDMPlex.metricSetFromOptionsDMPlex.metricSetGradationFactorDMPlex.metricSetHausdorffNumberDMPlex.metricSetIsotropicDMPlex.metricSetMaximumAnisotropyDMPlex.metricSetMaximumMagnitudeDMPlex.metricSetMinimumMagnitudeDMPlex.metricSetNoInsertionDMPlex.metricSetNoMovementDMPlex.metricSetNoSurfDMPlex.metricSetNoSwappingDMPlex.metricSetNormalizationOrderDMPlex.metricSetNumIterationsDMPlex.metricSetRestrictAnisotropyFirstDMPlex.metricSetTargetComplexityDMPlex.metricSetUniformDMPlex.metricSetVerbosityDMPlex.migrateGlobalToNaturalSFDMPlex.naturalToGlobalBeginDMPlex.naturalToGlobalEndDMPlex.orientDMPlex.permuteDMPlex.rebalanceSharedPointsDMPlex.reorderGetDefaultDMPlex.reorderSetDefaultDMPlex.sectionLoadDMPlex.sectionViewDMPlex.setAdjacencyUseAnchorsDMPlex.setCellTypeDMPlex.setChartDMPlex.setConeDMPlex.setConeOrientationDMPlex.setConeSizeDMPlex.setMatClosureDMPlex.setMigrationSFDMPlex.setPartitionerDMPlex.setRefinementLimitDMPlex.setRefinementUniformDMPlex.setSupportDMPlex.setSupportSizeDMPlex.setTetGenOptionsDMPlex.setTriangleOptionsDMPlex.setVecClosureDMPlex.stratifyDMPlex.symmetrizeDMPlex.topologyLoadDMPlex.topologyViewDMPlex.uninterpolateDMPlex.vecGetClosureDMPolytopeTypeDMReorderDefaultFlagDMRestrictHookFunctionDMShellDMShell.createDMShell.setCoarsenDMShell.setCreateDomainDecompositionDMShell.setCreateDomainDecompositionScattersDMShell.setCr""eateFieldDecompositionDMShell.setCreateGlobalVectorDMShell.setCreateInjectionDMShell.setCreateInterpolationDMShell.setCreateLocalVectorDMShell.setCreateMatrixDMShell.setCreateRestrictionDMShell.setCreateSubDMDMShell.setGlobalToLocalDMShell.setGlobalToLocalVecScatterDMShell.setGlobalVectorDMShell.setLocalToGlobalDMShell.setLocalToGlobalVecScatterDMShell.setLocalToLocalDMShell.setLocalToLocalVecScatterDMShell.setLocalVectorDMShell.setMatrixDMShell.setRefineDMStagDMStagStencilLocationDMStagStencilTypeDMStag.VecSplitToDMDADMStag.createDMStag.createCompatibleDMStagDMStag.get1dCoordinatecArraysDMStag.getBoundaryTypesDMStag.getCornersDMStag.getDimDMStag.getDofDMStag.getEntriesPerElementDMStag.getGhostCornersDMStag.getGlobalSizesDMStag.getIsFirstRankDMStag.getIsLastRankDMStag.getLocalSizesDMStag.getLocationDofDMStag.getLocationSlotDMStag.getOwnershipRangesDMStag.getProcSizesDMStag.getProductCoordinateLocationSlotDMStag.getStencilTypeDMStag.getStencilWidthDMStag.getVecArrayDMStag.migrateVecDMStag.setBoundaryTypesDMStag.setCoordinateDMTypeDMStag.setDofDMStag.setGlobalSizesDMStag.setOwnershipRangesDMStag.setProcSizesDMStag.setStencilTypeDMStag.setStencilWidthDMStag.setUniformCoordinatesDMStag.setUniformCoordinatesExplicitDMStag.setUniformCoordinatesProductDMSwarmDMSwarmCollectTypeDMSwarmMigrateTypeDMSwarmPICLayoutTypeDMSwarmTypeDMSwarm.addCellDMDMSwarm.addNPointsDMSwarm.addPointDMSwarm.collectViewCreateDMSwarm.collectViewDestroyDMSwarm.computeMomentsDMSwarm.copyPointDMSwarm.createDMSwarm.createGlobalVectorFromFieldDMSwarm.createGlobalVectorFromFieldsDMSwarm.createLocalVectorFromFieldDMSwarm.createLocalVectorFromFieldsDMSwarm.destroyGlobalVectorFromFieldDMSwarm.destroyGlobalVectorFromFieldsDMSwarm.destroyLocalVectorFromFieldDMSwarm.destroyLocalVectorFromFieldsDMSwarm.finalizeFieldRegisterDMSwarm.getCellDMDMSwarm.getCellDMActiveDMSwarm.getCellDMByNameDMSwarm.getCellDMNamesDMSwarm.getFieldDMSwarm.getLocalSizeDMSwarm.getSizeDMSwarm.initializeFieldRegisterDMSwarm.insertPointUsingCe""llDMDMSwarm.migrateDMSwarm.projectFieldsDMSwarm.registerFieldDMSwarm.removePointDMSwarm.removePointAtIndexDMSwarm.restoreFieldDMSwarm.setCellDMDMSwarm.setCellDMActiveDMSwarm.setLocalSizesDMSwarm.setPointCoordinatesDMSwarm.setPointCoordinatesCellwiseDMSwarm.setPointsUniformCoordinatesDMSwarm.setTypeDMSwarm.sortGetAccessDMSwarm.sortGetIsValidDMSwarm.sortGetNumberOfPointsPerCellDMSwarm.sortGetPointsPerCellDMSwarm.sortGetSizesDMSwarm.sortRestoreAccessDMSwarm.vectorDefineFieldDMSwarm.viewFieldsXDMFDMSwarm.viewXDMFDMTypeDM.adaptLabelDM.adaptMetricDM.addCoarsenHookDM.addFieldDM.appendOptionsPrefixDM.clearDSDM.clearFieldsDM.clearLabelStratumDM.clearLabelValueDM.cloneDM.coarsenDM.coarsenHierarchyDM.convertDM.copyDSDM.copyDiscDM.copyFieldsDM.createDM.createDSDM.createFieldDecompositionDM.createGlobalVecDM.createInjectionDM.createInterpolationDM.createLabelDM.createLocalVecDM.createMassMatrixDM.createMatDM.createRestrictionDM.createSectionSFDM.createSubDMDM.destroyDM.getAppCtxDM.getAuxiliaryVecDM.getBasicAdjacencyDM.getBlockSizeDM.getBoundingBoxDM.getCellCoordinateDMDM.getCellCoordinateSectionDM.getCellCoordinatesDM.getCellCoordinatesLocalDM.getCoarseDMDM.getCoarsenLevelDM.getCoordinateDMDM.getCoordinateDimDM.getCoordinateSectionDM.getCoordinatesDM.getCoordinatesLocalDM.getCoordinatesLocalizedDM.getDSDM.getDimensionDM.getFieldDM.getFieldAdjacencyDM.getGlobalSectionDM.getGlobalVecDM.getLGMapDM.getLabelDM.getLabelIdISDM.getLabelNameDM.getLabelOutputDM.getLabelSizeDM.getLabelValueDM.getLocalBoundingBoxDM.getLocalSectionDM.getLocalVecDM.getNumFieldsDM.getNumLabelsDM.getOptionsPrefixDM.getPeriodicityDM.getPointSFDM.getRefineLevelDM.getSectionSFDM.getSparseLocalizeDM.getStratumISDM.getStratumSizeDM.getTypeDM.getUseNaturalDM.globalToLocalDM.hasLabelDM.loadDM.localToGlobalDM.localToLocalDM.localizeCoordinatesDM.refineDM.refineHierarchyDM.removeLabelDM.restoreGlobalVecDM.restoreLocalVecDM.setAppCtxDM.setAuxiliaryVecDM.setBasicAdjacencyDM.setCellCoordinateDMDM.setCellCoordinateSectionDM"".setCellCoordinatesDM.setCellCoordinatesLocalDM.setCoarseDMDM.setCoordinateDimDM.setCoordinateDiscDM.setCoordinatesDM.setCoordinatesLocalDM.setDimensionDM.setFieldDM.setFieldAdjacencyDM.setFromOptionsDM.setGlobalSectionDM.setKSPComputeOperatorsDM.setLabelOutputDM.setLabelValueDM.setLocalSectionDM.setMatTypeDM.setNumFieldsDM.setOptionsPrefixDM.setPeriodicityDM.setPointSFDM.setRefineLevelDM.setSNESFunctionDM.setSNESJacobianDM.setSectionSFDM.setSparseLocalizeDM.setTypeDM.setUpDM.setUseNaturalDM.setVecTypeDM.viewDOFDOWNDOWN_LEFTDOWN_RIGHTDO_NOT_COPY_VALUESDRAWDRAW_BASICDRAW_CONTOURDRAW_LGDRAW_LG_XRANGEDRAW_PORTSDROPDSDSTypeDS.createDS.destroyDS.getComponentsDS.getCoordinateDimensionDS.getDimensionsDS.getFieldIndexDS.getNumFieldsDS.getSpatialDimensionDS.getTotalComponentsDS.getTotalDimensionsDS.getTypeDS.setDiscretisationDS.setFromOptionsDS.setTypeDS.setUpDS.viewDUMMYDYDatatypeDeflationSpaceTypeDeviceDeviceContextDeviceContext.createDeviceContext.destroyDeviceContext.duplicateDeviceContext.forkDeviceContext.getCurrentDeviceContext.getDeviceDeviceContext.getStreamTypeDeviceContext.idleDeviceContext.joinDeviceContext.setCurrentDeviceContext.setDeviceDeviceContext.setFromOptionsDeviceContext.setStreamTypeDeviceContext.setUpDeviceContext.synchronizeDeviceContext.waitForDeviceJoinModeDeviceTypeDevice.configureDevice.createDevice.destroyDevice.getDeviceIdDevice.getDeviceTypeDevice.setDefaultTypeDevice.viewDimsSpecDrawSizeDualSpaceDualSpaceTypeDualSpace.createDualSpace.destroyDualSpace.duplicateDualSpace.getDMDualSpace.getDimensionDualSpace.getFunctionalDualSpace.getInteriorDimensionDualSpace.getLagrangeContinuityDualSpace.getLagrangeTensorDualSpace.getLagrangeTrimmedDualSpace.getNumComponentsDualSpace.getNumDofDualSpace.getOrderDualSpace.getTypeDualSpace.setDMDualSpace.setLagrangeContinuityDualSpace.setLagrangeTensorDualSpace.setLagrangeTrimmedDualSpace.setNumComponentsDualSpace.setOrderDualSpace.setSimpleDimensionDualSpace.setSimpleFunctionalDualSpace.setTypeDualSpace.setUpDu""alSpace.viewDupDuplicateOptionEIMEXEISENSTATELEMENTELEMENTALERROR_LOWER_TRIANGULARESSLEULEREXACTEXODUSIIEXOTICEXPLICITEXTRUDEElementTypeEllipsisEquationTypeErrorError.__bool__Error.__init__Error.__repr__Error.__str__EventEventDecoratorEventDecorator.<locals>.decorator.<locals>.wrapped_funcEventDecorator.<locals>.decoratorExactFinalTimeExactFinalTimeOptionFFACTOR_NUMERIC_ZEROPIVOTFACTOR_OTHERFACTOR_OUTMEMORYFACTOR_STRUCT_ZEROPIVOTFAILEDFAILED_ASCENTFAILED_BADPARAMETERFAILED_INFORNANFALSEFASFBCGSFBCGSRFCGFEFETIDPFETypeFE.createFE.createByCellFE.createDefaultFE.createLagrangeFE.destroyFE.getBasisSpaceFE.getDimensionFE.getDualSpaceFE.getFaceQuadratureFE.getNumComponentsFE.getNumDofFE.getQuadratureFE.getSpatialDimensionFE.getTileSizesFE.setBasisSpaceFE.setDualSpaceFE.setFaceQuadratureFE.setFromOptionsFE.setNumComponentsFE.setQuadratureFE.setTileSizesFE.setTypeFE.setUpFE.viewFFTFFTWFGMRESFIELDSPLITFINALFINAL_ASSEMBLYFINAL_ONLYFLUSHFLUSH_ASSEMBLYFORCE_DIAGONAL_ENTRIESFORESTFORWARDFORWARD_LOCALFORWARD_SWEEPFRFRBFROBENIUSFRONTFRONT_DOWNFRONT_DOWN_LEFTFRONT_DOWN_RIGHTFRONT_LEFTFRONT_RIGHTFRONT_UPFRONT_UP_LEFTFRONT_UP_RIGHTFULLFULL_SIZEFV_GHOSTFactorShiftTypeFailedReasonFieldSplitSchurFactTypeFieldSplitSchurPreTypeFileModeFormatFreeGGALERKINGAMGGAMGTypeGASMGASMTypeGATHERGATHERVGCRGCRODRGDGENERALGEOGETROW_UPPERTRIANGULARGHOSTEDGLEEGLLEGLOBAL_MAXGLOBAL_SUMGLTRGLVISGMRESGPCGGROPPCGGet_rankGet_sizeHH2OPUSH2OpusCompressH2OpusLowRankUpdateH2OpusOrthogonalizeHAARHALFHALFL2SQUAREDHALF_SIZEHALTED_LOWERBOUNDHALTED_MAXFCNHALTED_OTHERHALTED_RTOLHALTED_UPPERBOUNDHALTED_USERHASHHDF5HDF5_MATHDF5_PETSCHDF5_VIZHDF5_XDMFHERMITIANHERMITIANTRANSPOSEHEXAHEDRONHIPHMGHOSTHPDDMHPDDMCoarseCorrectionTypeHPDDMTypeHSHTOOLHYPREHYPRESSTRUCTHYPRESTRUCTHZHmatHtoolGetPermutationSourceHtoolGetPermutationTargetHtoolUsePermutationHtoolUseRecompressionIIBCGSICCIGNORE_LOWER_TRIANGULARIGNORE_NEGATIVE_INDICESIGNORE_OFF_PROC_ENTRIESIGNORE_ZERO_ENTRIESILUIMPLICITINBLOCKSINFINFINITYINITIAL_FINAL_ONLYINITIAL_GUESSINITIA""L_ONLYINSERTINSERT_ALLINSERT_ALL_VALUESINSERT_BCINSERT_BC_VALUESINSERT_VALUESINTERIOR_GHOSTINTERPOLATEIPMISISTypeIS.__enter__IS.__exit__IS.allGather_IS_buffer_IS_buffer.__enter___IS_buffer.__exit__IS.buildTwoSidedIS.complementIS.copyIS.createIS.createBlockIS.createGeneralIS.createStrideIS.destroyIS.differenceIS.duplicateIS.embedIS.equalIS.expandIS.getBlockIndicesIS.getBlockSizeIS.getIndicesIS.getInfoIS.getLocalSizeIS.getSizeIS.getSizesIS.getStrideIS.getTypeIS.intersectIS.invertPermutationIS.isIdentityIS.isPermutationIS.isSortedIS.loadIS.partitioningCountIS.partitioningToNumberingIS.renumberIS.setBlockIndicesIS.setBlockSizeIS.setIdentityIS.setIndicesIS.setPermutationIS.setStrideIS.setTypeIS.sortIS.sumIS.toGeneralIS.unionIS.viewITERATINGImatInfoTypeInsertModeInsertModeSpecIntTypeInterpolationTypeIntracommJJ0JACOBIJmatJoinModeJpreKACZMARZKAIJKASKADEKDKEEP_NONZERO_PATTERNKLUKOKKOSKSPKSPConvergedReasonKSPConvergenceTestFunctionKSPDMActiveKSPHPDDMTypeKSPMonitorFunctionKSPNormTypeKSPONLYKSPOperatorsFunctionKSPRHSFunctionKSPTRANSPOSEONLYKSPTypeKSP.addConvergenceTestKSP.appendOptionsPrefixKSP.buildResidualKSP.buildSolutionKSP.callConvergenceTestKSP.computeEigenvaluesKSP.computeExtremeSingularValuesKSP.createKSP.createPythonKSP.destroyKSP.getAppCtxKSP.getCGObjectiveValueKSP.getComputeEigenvaluesKSP.getComputeSingularValuesKSP.getConvergedReasonKSP.getConvergenceHistoryKSP.getConvergenceTestKSP.getDMKSP.getErrorIfNotConvergedKSP.getHPDDMTypeKSP.getInitialGuessKnollKSP.getInitialGuessNonzeroKSP.getIterationNumberKSP.getMonitorKSP.getNormTypeKSP.getOperatorsKSP.getOptionsPrefixKSP.getPCKSP.getPCSideKSP.getPythonContextKSP.getPythonTypeKSP.getResidualNormKSP.getRhsKSP.getSolutionKSP.getTolerancesKSP.getTypeKSP.getWorkVecsKSP.logConvergenceHistoryKSP.matSolveKSP.matSolveTransposeKSP.monitorKSP.monitorCancelKSP.resetKSP.setAppCtxKSP.setComputeEigenvaluesKSP.setComputeOperatorsKSP.setComputeRHSKSP.setComputeSingularValuesKSP.setConvergedReasonKSP.setConvergenceHistoryKSP.setConverge""nceTestKSP.setDMKSP.setDMActiveKSP.setErrorIfNotConvergedKSP.setFromOptionsKSP.setGMRESRestartKSP.setHPDDMTypeKSP.setInitialGuessKnollKSP.setInitialGuessNonzeroKSP.setIterationNumberKSP.setMonitorKSP.setNormTypeKSP.setOperatorsKSP.setOptionsPrefixKSP.setPCKSP.setPCSideKSP.setPostSolveKSP.setPreSolveKSP.setPythonContextKSP.setPythonTypeKSP.setResidualNormKSP.setTolerancesKSP.setTypeKSP.setUpKSP.setUpOnBlocksKSP.setUseFischerGuessKSP.solveKSP.solveTransposeKSP.viewLL1LAGRANGELASSOLAYOUT_GAUSSLAYOUT_REGULARLAYOUT_SUBDIVISIONLCDLCLLEFTLGMRESLGMapLGMapMapModeLGMapTypeLGMap.applyLGMap.applyBlockLGMap.applyBlockInverseLGMap.applyISLGMap.applyInverseLGMap.createLGMap.createISLGMap.createSFLGMap.destroyLGMap.getBlockIndicesLGMap.getBlockInfoLGMap.getBlockSizeLGMap.getIndicesLGMap.getInfoLGMap.getSizeLGMap.loadLGMap.setFromOptionsLGMap.setTypeLGMap.viewLINEARLMVMLMVMBADBROYDENLMVMBFGSLMVMBROYDENLMVMDBFGSLMVMDDFPLMVMDFPLMVMDIAGBBROYDENLMVMDQNLMVMSR1LMVMSYMBADBROYDENLMVMSYMBROYDENLOAD_BALANCELOCALLOCALREFLOCAL_BACKWARD_SWEEPLOCAL_FORWARD_SWEEPLOCAL_SYMMETRIC_SWEEPLOWERLPYLRCLSCLSQRLSTARTLULUSOLLayoutSizeSpecLeftLinearTypeLogLogClassLogClass.activateLogClass.deactivateLogClass.getActiveLogClass.getNameLogClass.setActiveLogEventLogEvent.__enter__LogEvent.__exit__LogEvent.activateLogEvent.beginLogEvent.deactivateLogEvent.endLogEvent.getActiveLogEvent.getActiveAllLogEvent.getNameLogEvent.getPerfInfoLogEvent.setActiveLogEvent.setActiveAllLogStageLogStage.__enter__LogStage.__exit__LogStage.activateLogStage.deactivateLogStage.getActiveLogStage.getNameLogStage.getVisibleLogStage.popLogStage.pushLogStage.setActiveLogStage.setVisibleLog.ClassLog.EventLog.EventDecoratorLog.StageLog.addFlopsLog.beginLog.getCPUTimeLog.getFlopsLog.getTimeLog.isActiveLog.logFlopsLog.viewLstartLvecMMAIJMAPPINGMASKMATMATCHSTEPMATHEMATICAMATLABMATPARTITIONINGMAXMAXCELLMAX_VALUESMEMORYSCALABLEMETISNDMEYERMFFDMGMGCycleTypeMGTypeMIGRATE_BASICMIGRATE_DMCELLEXACTMIGRATE_DMCELLNSCATTERMIGRATE_USERMIMEXMINRESMIRRORMKL_""CPARDISOMKL_PARDISOMLMOABMORETHUENTEMPIMPIADJMPIAIJMPIAIJCRLMPIAIJCUSPARSEMPIAIJMKLMPIAIJPERMMPIAIJSELLMPIAIJVIENNACLMPIBAIJMPIBAIJMKLMPICUDAMPIDENSEMPIDENSECUDAMPIDENSEHIPMPIHIPMPIKAIJMPIKOKKOSMPIMAIJMPISBAIJMPISELLMPIVIENNACLMPRKMSMULTIPLICATIVEMULTISTAGEMUMPSMapModeMatMatAssemblySpecMatAssemblyTypeMatBlockSizeSpecMatDuplicateOptionMatFactorShiftTypeMatHtoolKernelFunctionMatInfoTypeMatNullFunctionMatOptionMatOrderingTypeMatPartitioningMatPartitioningTypeMatPartitioning.applyMatPartitioning.createMatPartitioning.destroyMatPartitioning.getTypeMatPartitioning.setAdjacencyMatPartitioning.setFromOptionsMatPartitioning.setTypeMatPartitioning.viewMatSORTypeMatSizeSpecMatSolverTypeMatStructureMatTypeMat.H2OpusCompressMat.H2OpusLowRankUpdateMat.H2OpusOrthogonalizeMat.HtoolGetPermutationSourceMat.HtoolGetPermutationTargetMat.HtoolUsePermutationMat.HtoolUseRecompressionMat.SORMat.__div__Mat.__dlpack__Mat.__dlpack_device__Mat.__idiv__Mat.__rdiv__Mat.allocateLMVMMat.appendOptionsPrefixMat.assembleMat.assemblyBeginMat.assemblyEndMat.axpyMat.aypxMat.bindToCPUMat.boundToCPUMat.chopMat.conjugateMat.convertMat.copyMat.createMat.createAIJMat.createAIJCRLMat.createAIJWithArraysMat.createBAIJMat.createConstantDiagonalMat.createDenseMat.createDenseCUDAMat.createDiagonalMat.createH2OpusFromMatMat.createHermitianTransposeMat.createHtoolFromKernelMat.createISMat.createLRCMat.createNestMat.createNormalMat.createNormalHermitianMat.createPythonMat.createSBAIJMat.createScatterMat.createSchurComplementMat.createSubMatricesMat.createSubMatrixMat.createSubMatrixVirtualMat.createTransposeMat.createVecLeftMat.createVecRightMat.createVecsMat.destroyMat.diagonalScaleMat.duplicateMat.equalMat.factorCholeskyMat.factorICCMat.factorILUMat.factorLUMat.factorNumericCholeskyMat.factorNumericLUMat.factorSymbolicCholeskyMat.factorSymbolicICCMat.factorSymbolicILUMat.factorSymbolicLUMat.findZeroRowsMat.fixISLocalEmptyMat.getBlockSizeMat.getBlockSizesMat.getColumnIJMat.getColumnVectorMat.getDMMat.getDenseArrayM""at.getDenseColumnVecMat.getDenseLDAMat.getDenseLocalMatrixMat.getDenseSubMatrixMat.getDiagonalMat.getDiagonalBlockMat.getISAllowRepeatedMat.getISLocalMatMat.getInertiaMat.getInfoMat.getLGMapMat.getLMVMJ0Mat.getLMVMJ0KSPMat.getLRCMatsMat.getLocalSizeMat.getLocalSubMatrixMat.getMumpsCntlMat.getMumpsIcntlMat.getMumpsInfoMat.getMumpsInfogMat.getMumpsRinfoMat.getMumpsRinfogMat.getNearNullSpaceMat.getNestISsMat.getNestLocalISsMat.getNestSizeMat.getNestSubMatrixMat.getNullSpaceMat.getOptionMat.getOptionsPrefixMat.getOrderingMat.getOwnershipISMat.getOwnershipRangeMat.getOwnershipRangeColumnMat.getOwnershipRangesMat.getOwnershipRangesColumnMat.getPythonContextMat.getPythonTypeMat.getRedundantMatrixMat.getRowMat.getRowIJMat.getRowSumMat.getSchurComplementSubMatricesMat.getSizeMat.getSizesMat.getTransposeMatMat.getTransposeNullSpaceMat.getTypeMat.getValueMat.getValuesMat.getValuesCSRMat.getVecTypeMat.hermitianTransposeMat.imagPartMat.increaseOverlapMat.invertBlockDiagonalMat.isAssembledMat.isHermitianMat.isHermitianKnownMat.isLinearMat.isStructurallySymmetricMat.isSymmetricMat.isSymmetricKnownMat.isTransposeMat.kronMat.loadMat.matMatMultMat.matMultMat.matSolveMat.matTransposeMultMat.multMat.multAddMat.multHermitianMat.multHermitianAddMat.multTransposeMat.multTransposeAddMat.normMat.permuteMat.preallocatorPreallocateMat.ptapMat.rartMat.realPartMat.reorderForNonzeroDiagonalMat.resetLMVMMat.restoreDenseColumnVecMat.restoreDenseSubMatrixMat.restoreISLocalMatMat.restoreLocalSubMatrixMat.retrieveValuesMat.scaleMat.setBlockSizeMat.setBlockSizesMat.setDMMat.setDenseLDAMat.setDiagonalMat.setFromOptionsMat.setISAllowRepeatedMat.setISLocalMatMat.setISPreallocationMat.setLGMapMat.setLMVMJ0Mat.setLMVMJ0KSPMat.setLRCMatsMat.setMumpsCntlMat.setMumpsIcntlMat.setNearNullSpaceMat.setNestVecTypeMat.setNullSpaceMat.setOptionMat.setOptionsPrefixMat.setPreallocationCOOMat.setPreallocationCOOLocalMat.setPreallocationCSRMat.setPreallocationDenseMat.setPreallocationNNZMat.setPythonContextMat.setPython""TypeMat.setRandomMat.setSizesMat.setStencilMat.setTransposeNullSpaceMat.setTransposePrecursorMat.setTypeMat.setUnfactoredMat.setUpMat.setValueMat.setValueBlockedStagStencilMat.setValueBlockedStencilMat.setValueLocalMat.setValueStagStencilMat.setValueStencilMat.setValuesMat.setValuesBlockedMat.setValuesBlockedCSRMat.setValuesBlockedIJVMat.setValuesBlockedLocalMat.setValuesBlockedLocalCSRMat.setValuesBlockedLocalIJVMat.setValuesBlockedLocalRCVMat.setValuesBlockedRCVMat.setValuesCOOMat.setValuesCSRMat.setValuesIJVMat.setValuesLocalMat.setValuesLocalCSRMat.setValuesLocalIJVMat.setValuesLocalRCVMat.setValuesRCVMat.setVariableBlockSizesMat.setVecTypeMat.shiftMat.solveMat.solveAddMat.solveBackwardMat.solveForwardMat.solveTransposeMat.solveTransposeAddMat.storeValuesMat.toDLPackMat.transposeMat.transposeMatMultMat.updateLMVMMat.viewMat.zeroEntriesMat.zeroRowsMat.zeroRowsColumnsMat.zeroRowsColumnsLocalMat.zeroRowsColumnsStencilMat.zeroRowsLocalMigrateTypeModeNN1N12N2NASHNASMNATIVENATURALNCGNCGLINEARNDND_PiND_Pi_FullND_Pi_matND_full_matNEIGHBORNESTNETWORKNEWTONALNEWTONLSNEWTONTRNEW_NONZERO_ALLOCATION_ERRNEW_NONZERO_LOCATIONSNEW_NONZERO_LOCATION_ERRNGMRESNGSNINFINITYNLEQERRNLSNMNNNNZSpecNONOERRORNOFORMATNONBLOCKINGNONBLOCKING_WITH_BARRIERNONENONLINEARNONZERONORMALNORMALHERMITIANNORM_1NORM_1_AND_2NORM_2NORM_ALWAYSNORM_DEFAULTNORM_FINAL_ONLYNORM_FROBENIUSNORM_INFINITYNORM_INITIAL_FINAL_ONLYNORM_INITIAL_ONLYNORM_MAXNORM_NATURALNORM_NONENORM_PRECONDITIONEDNORM_UNPRECONDITIONEDNOTSETNOT_SET_VALUESNO_OFF_PROC_ENTRIESNO_OFF_PROC_ZERO_ROWSNO_SYNCNRICHARDSONNTLNTRNULLLOCNZNewtonALCorrectionTypeNoneNormScheduleNormTypeNormTypeSpecNotImplementedNullSpaceNullSpace.createNullSpace.createRigidBodyNullSpace.destroyNullSpace.getFunctionNullSpace.getVecsNullSpace.hasConstantNullSpace.removeNullSpace.setFunctionNullSpace.testNullSpace.viewODE_EXPLICITODE_IMPLICITOLSOPENCLOPERATOROPTION_MAXOPTION_MINOWARMIJOOWDOWLQNObjectObject.__copy__Object.__deepcopy__Object.appendOptionsPrefixObject.composeO""bject.decRefObject.destroyObject.destroyOptionsHandlersObject.getAttrObject.getClassIdObject.getClassNameObject.getCommObject.getDictObject.getIdObject.getNameObject.getOptionsPrefixObject.getRefCountObject.getTabLevelObject.getTypeObject.incRefObject.incrementTabLevelObject.queryObject.setAttrObject.setFromOptionsObject.setNameObject.setOptionsHandlerObject.setOptionsPrefixObject.setTabLevelObject.stateGetObject.stateIncreaseObject.stateSetObject.viewObject.viewFromOptionsOpOptionOptionsOptions.clearOptions.createOptions.delValueOptions.destroyOptions.getAllOptions.getBoolOptions.getBoolArrayOptions.getIntOptions.getIntArrayOptions.getRealOptions.getRealArrayOptions.getScalarOptions.getScalarArrayOptions.getStringOptions.hasNameOptions.insertStringOptions.prefixPopOptions.prefixPushOptions.setValueOptions.usedOptions.viewOrderingTypePP1P4ESTP8ESTPARDECOMPPARMETISPARMSPARTITIONINGAVERAGEPARTITIONINGCHACOPARTITIONINGCURRENTPARTITIONINGHIERARCHPARTITIONINGPARMETISPARTITIONINGPARTYPARTITIONINGPTSCOTCHPARTITIONINGSQUAREPASTIXPATCHPBJACOBIPCPCASMTypePCCompositeTypePCDeflationSpaceTypePCFailedReasonPCFieldSplitSchurFactTypePCFieldSplitSchurPreTypePCGAMGTypePCGASMTypePCGDPCHPDDMCoarseCorrectionTypePCMGCycleTypePCMGTypePCPatchConstructTypePCSidePCTypePC.addCompositePCTypePC.appendOptionsPrefixPC.applyPC.applySymmetricLeftPC.applySymmetricRightPC.applyTransposePC.createPC.createPythonPC.destroyPC.getASMSubKSPPC.getBJacobiSubKSPPC.getCompositePCPC.getDMPC.getDeflationCoarseKSPPC.getDeflationPCPC.getFactorMatrixPC.getFactorSolverTypePC.getFailedReasonPC.getFieldSplitSchurGetSubKSPPC.getFieldSplitSubISPC.getFieldSplitSubKSPPC.getHPDDMCoarseCorrectionTypePC.getHPDDMComplexitiesPC.getHPDDMSTShareSubKSPPC.getHYPRETypePC.getKSPPC.getMGCoarseSolvePC.getMGInterpolationPC.getMGLevelsPC.getMGRScalePC.getMGRestrictionPC.getMGSmootherPC.getMGSmootherDownPC.getMGSmootherUpPC.getMGTypePC.getOperatorsPC.getOptionsPrefixPC.getPatchSubKSPPC.getPythonContextPC.getPythonTypePC.getTypePC.getUseA""matPC.matApplyPC.matApplyTransposePC.resetPC.setASMLocalSubdomainsPC.setASMOverlapPC.setASMSortIndicesPC.setASMTotalSubdomainsPC.setASMTypePC.setBDDCChangeOfBasisMatPC.setBDDCCoarseningRatioPC.setBDDCDirichletBoundariesPC.setBDDCDirichletBoundariesLocalPC.setBDDCDiscreteGradientPC.setBDDCDivergenceMatPC.setBDDCDofsSplittingPC.setBDDCDofsSplittingLocalPC.setBDDCLevelsPC.setBDDCLocalAdjacencyPC.setBDDCNeumannBoundariesPC.setBDDCNeumannBoundariesLocalPC.setBDDCPrimalVerticesISPC.setBDDCPrimalVerticesLocalISPC.setCompositeTypePC.setCoordinatesPC.setDMPC.setDeflationCoarseMatPC.setDeflationCorrectionFactorPC.setDeflationInitOnlyPC.setDeflationLevelsPC.setDeflationProjectionNullSpaceMatPC.setDeflationReductionFactorPC.setDeflationSpacePC.setDeflationSpaceToComputePC.setFactorLevelsPC.setFactorOrderingPC.setFactorPivotPC.setFactorSetUpSolverTypePC.setFactorShiftPC.setFactorSolverTypePC.setFailedReasonPC.setFieldSplitFieldsPC.setFieldSplitISPC.setFieldSplitSchurFactTypePC.setFieldSplitSchurPreTypePC.setFieldSplitTypePC.setFromOptionsPC.setGAMGLevelsPC.setGAMGSmoothsPC.setGAMGTypePC.setGASMOverlapPC.setGASMTypePC.setHPDDMAuxiliaryMatPC.setHPDDMCoarseCorrectionTypePC.setHPDDMDeflationMatPC.setHPDDMHasNeumannMatPC.setHPDDMRHSMatPC.setHYPREAMSSetInteriorNodesPC.setHYPREDiscreteCurlPC.setHYPREDiscreteGradientPC.setHYPRESetAlphaPoissonMatrixPC.setHYPRESetBetaPoissonMatrixPC.setHYPRESetEdgeConstantVectorsPC.setHYPRESetInterpolationsPC.setHYPRETypePC.setMGCycleTypePC.setMGCycleTypeOnLevelPC.setMGInterpolationPC.setMGLevelsPC.setMGRPC.setMGRScalePC.setMGRestrictionPC.setMGRhsPC.setMGTypePC.setMGXPC.setOperatorsPC.setOptionsPrefixPC.setPatchCellNumberingPC.setPatchComputeFunctionPC.setPatchComputeFunctionInteriorFacetsPC.setPatchComputeOperatorPC.setPatchComputeOperatorInteriorFacetsPC.setPatchConstructTypePC.setPatchDiscretisationInfoPC.setPythonContextPC.setPythonTypePC.setReusePreconditionerPC.setSPAIBlockSizePC.setSPAICacheSizePC.setSPAIEpsilonPC.setSPAIMaxPC.setSPAIMaxNewPC.setS""PAINBStepsPC.setSPAISpPC.setSPAIVerbosePC.setTypePC.setUpPC.setUpOnBlocksPC.setUseAmatPC.viewPDPDIPMPERIODICPETSCPFMGPGMRESPHRPICPICLayoutTypePINFINITYPIPEBCGSPIPECGPIPECG2PIPECGRRPIPECRPIPEFCGPIPEFGMRESPIPEGCRPIPELCGPIPEPRCGPLEXPOINTPOINT_PRISM_TENSORPOLYNOMIALPOSITIVE_DEFINITEPOUNDERSPREALLOCATORPRECONDITIONEDPREONLYPRODUCTPRPPRP_PLUSPSEUDOPTRIMMEDPTSCOTCHPYRAMIDPYTHONPYVISTAPartitionerPartitionerTypePartitioner.createPartitioner.destroyPartitioner.getTypePartitioner.resetPartitioner.setFromOptionsPartitioner.setShellPartitionPartitioner.setTypePartitioner.setUpPartitioner.viewPatchConstructTypePmatPolytopeTypePrintProblemTypePtAP__Pyx_PyDict_NextRefQ0Q1QCGQMDQMRCGSQNQRQUADRATICQUADRILATERALQUAD_PRISM_TENSORQUARTERQUARTER_SIZEQuadQuad.createQuad.destroyQuad.duplicateQuad.getDataQuad.getNumComponentsQuad.getOrderQuad.setNumComponentsQuad.setOrderQuad.viewRRADAU5RANDRAND48RANDER48RANDOM123RARtRCMREADREDISTRIBUTEREDUNDANTREFINE1DREFINEALFELDREFINEBOUNDARYLAYERREFINEDREFINEPOWELLSABINREFINEREGULARREFINESBRREFINETOBOXREFINETOSIMPLEXRESTRICTREVERSEREVERSE_LOCALRHSRICHARDSONRIDGERIGHTRKRK1FERK2ARK2BRK3RK3BSRK4RK5BSRK5DPRK5FRK6VRRK7VRRK8VRRKTypeROSWROWLENGTHROWSCALINGVIENNACLROW_ORIENTEDRT_PiRT_Pi_FullRT_Pi_matRT_full_matRUNGE_KUTTARandomRandomTypeRandom.createRandom.destroyRandom.getIntervalRandom.getSeedRandom.getTypeRandom.getValueRandom.getValueRealRandom.setFromOptionsRandom.setIntervalRandom.setSeedRandom.setTypeRandom.viewRealTypeReasonRegressorRegressorLinearTypeRegressorTypeRegressor.createRegressor.destroyRegressor.fitRegressor.getLinearCoefficientsRegressor.getLinearInterceptRegressor.getLinearKSPRegressor.getLinearTypeRegressor.getTAORegressor.getTypeRegressor.predictRegressor.resetRegressor.setFromOptionsRegressor.setLinearFitInterceptRegressor.setLinearTypeRegressor.setLinearUseKSPRegressor.setRegularizerWeightRegressor.setTypeRegressor.setUpRegressor.viewReorderDefaultFlagRightSSAMESAME_NONZERO_PATTERNSAME_NZSAVIENNACLSAWSSBAIJSCALAPACKSCATTERSCATTER_FORWAR""DSCATTER_FORWARD_LOCALSCATTER_REVERSESCATTER_REVERSE_LOCALSCHURSCHURCOMPLEMENTSECANTSEGMENTSEG_PRISM_TENSORSELFSELFPSELLSEQSEQAIJSEQAIJCRLSEQAIJCUSPARSESEQAIJMKLSEQAIJPERMSEQAIJSELLSEQAIJVIENNACLSEQBAIJSEQBAIJMKLSEQCUDASEQCUFFTSEQDENSESEQDENSECUDASEQDENSEHIPSEQHIPSEQKAIJSEQKOKKOSSEQMAIJSEQSBAIJSEQSELLSEQVIENNACLSETUP_ERRORSFSFTypeSF.bcastBeginSF.bcastEndSF.composeSF.computeDegreeSF.createSF.createEmbeddedLeafSFSF.createEmbeddedRootSFSF.createInverseSF.createSectionSFSF.destroySF.distributeSectionSF.fetchAndOpBeginSF.fetchAndOpEndSF.gatherBeginSF.gatherEndSF.getGraphSF.getMultiSF.getTypeSF.reduceBeginSF.reduceEndSF.resetSF.scatterBeginSF.scatterEndSF.setFromOptionsSF.setGraphSF.setRankOrderSF.setTypeSF.setUpSF.viewSHAREDSHARE_NONZERO_PATTERNSHELLSIMPLESLICEDSNESSNESConvergedFunctionSNESConvergedReasonSNESFunctionSNESGuessFunctionSNESJacobianFunctionSNESLineSearchSNESLineSearchTypeSNESLineSearch.createSNESLineSearch.destroySNESLineSearch.getOrderSNESLineSearch.getTolerancesSNESLineSearch.getTypeSNESLineSearch.setFromOptionsSNESLineSearch.setOrderSNESLineSearch.setTolerancesSNESLineSearch.setTypeSNESLineSearch.viewSNESNGSFunctionSNESNewtonALCorrectionTypeSNESNormScheduleSNESObjFunctionSNESTypeSNESUpdateFunctionSNES.appendOptionsPrefixSNES.callConvergenceTestSNES.computeFunctionSNES.computeJacobianSNES.computeNGSSNES.computeObjectiveSNES.convergedSNES.createSNES.createPythonSNES.destroySNES.getApplicationContextSNES.getCompositeNumberSNES.getCompositeSNESSNES.getConvergedReasonSNES.getConvergenceHistorySNES.getConvergenceTestSNES.getDMSNES.getDivergenceToleranceSNES.getErrorIfNotConvergedSNES.getFASCoarseSolveSNES.getFASCycleSNESSNES.getFASInjectionSNES.getFASInterpolationSNES.getFASLevelsSNES.getFASRestrictionSNES.getFASSmootherSNES.getFASSmootherDownSNES.getFASSmootherUpSNES.getFunctionSNES.getFunctionEvaluationsSNES.getFunctionNormSNES.getInitialGuessSNES.getIterationNumberSNES.getJacobianSNES.getKSPSNES.getKSPFailuresSNES.getLineSearchSNES.getLinearSolveIterationsSN""ES.getMaxFunctionEvaluationsSNES.getMaxKSPFailuresSNES.getMaxStepFailuresSNES.getMonitorSNES.getNASMNumberSNES.getNASMSNESSNES.getNGSSNES.getNPCSNES.getNPCSideSNES.getNewtonALLoadParameterSNES.getNormScheduleSNES.getObjectiveSNES.getOptionsPrefixSNES.getParamsEWSNES.getPythonContextSNES.getPythonTypeSNES.getRhsSNES.getSolutionSNES.getSolutionUpdateSNES.getStepFailuresSNES.getTRTolerancesSNES.getTRUpdateParametersSNES.getTolerancesSNES.getTypeSNES.getUpdateSNES.getUseEWSNES.getUseFDSNES.getUseKSPSNES.getUseMFSNES.getVIInactiveSetSNES.getVariableBoundsSNES.hasNPCSNES.logConvergenceHistorySNES.monitorSNES.monitorCancelSNES.resetSNES.setApplicationContextSNES.setConvergedReasonSNES.setConvergenceHistorySNES.setConvergenceTestSNES.setDMSNES.setDivergenceToleranceSNES.setErrorIfNotConvergedSNES.setFASInjectionSNES.setFASInterpolationSNES.setFASLevelsSNES.setFASRScaleSNES.setFASRestrictionSNES.setForceIterationSNES.setFromOptionsSNES.setFunctionSNES.setFunctionNormSNES.setInitialGuessSNES.setIterationNumberSNES.setJacobianSNES.setKSPSNES.setLineSearchSNES.setLineSearchPreCheckSNES.setMaxFunctionEvaluationsSNES.setMaxKSPFailuresSNES.setMaxStepFailuresSNES.setMonitorSNES.setNGSSNES.setNPCSNES.setNPCSideSNES.setNewtonALCorrectionTypeSNES.setNewtonALFunctionSNES.setNormScheduleSNES.setObjectiveSNES.setOptionsPrefixSNES.setParamsEWSNES.setPatchCellNumberingSNES.setPatchComputeFunctionSNES.setPatchComputeOperatorSNES.setPatchConstructTypeSNES.setPatchDiscretisationInfoSNES.setPythonContextSNES.setPythonTypeSNES.setResetCountersSNES.setSolutionSNES.setTRTolerancesSNES.setTRUpdateParametersSNES.setTolerancesSNES.setTypeSNES.setUpSNES.setUpMatricesSNES.setUpdateSNES.setUseEWSNES.setUseFDSNES.setUseKSPSNES.setUseMFSNES.setVariableBoundsSNES.solveSNES.viewSOCKETSORSORTED_FULLSORTypeSPAISPDSPECIALSPECTRALSPQRSPRNGSSFLSSSILSSSML_BFGSSSML_BRDNSSML_DFPSSPSTAGSTANDARDSTARSTCGSTDERRSTDOUTSTEPOVERSTRIDESTRINGSTRUCTURALLY_SYMMETRICSTRUCTURE_ONLYSTRUMPACKSUBMATRIXSUBMAT_SINGLEISSUBPC_ERRORSUB""SETSUBSET_NONZERO_PATTERNSUBSET_NZSUBSET_OFF_PROC_ENTRIESSUBSPACESUCCESSSUCCESS_USERSUMSUNDIALSSUPERLUSUPERLU_DISTSVDSWARMSYCLSYMMETRICSYMMETRIC_MULTIPLICATIVESYMMETRY_ETERNALSYMMETRY_SWEEPSYMMLQSYNCSYSPFMGScalarScalarTypeScatterScatterModeScatterModeSpecScatterTypeScatter.beginScatter.copyScatter.createScatter.destroyScatter.endScatter.getTypeScatter.scatterScatter.setFromOptionsScatter.setTypeScatter.setUpScatter.toAllScatter.toZeroScatter.viewSchurFactTypeSchurPreTypeSectionSection.addConstraintDofSection.addDofSection.addFieldConstraintDofSection.addFieldDofSection.cloneSection.createSection.createGlobalSectionSection.destroySection.getChartSection.getConstrainedStorageSizeSection.getConstraintDofSection.getConstraintIndicesSection.getDofSection.getFieldComponentsSection.getFieldConstraintDofSection.getFieldConstraintIndicesSection.getFieldDofSection.getFieldNameSection.getFieldOffsetSection.getMaxDofSection.getNumFieldsSection.getOffsetSection.getOffsetRangeSection.getPermutationSection.getStorageSizeSection.resetSection.setChartSection.setConstraintDofSection.setConstraintIndicesSection.setDofSection.setFieldComponentsSection.setFieldConstraintDofSection.setFieldConstraintIndicesSection.setFieldDofSection.setFieldNameSection.setFieldOffsetSection.setNumFieldsSection.setOffsetSection.setPermutationSection.setUpSection.viewSelfSequenceSideSizeSolverTypeSpaceSpaceTypeSpace.createSpace.destroySpace.getDegreeSpace.getDimensionSpace.getNumComponentsSpace.getNumVariablesSpace.getPTrimmedFormDegreeSpace.getPointPointsSpace.getPolynomialTensorSpace.getSumConcatenateSpace.getSumNumSubspacesSpace.getSumSubspaceSpace.getTensorNumSubspacesSpace.getTensorSubspaceSpace.getTypeSpace.setDegreeSpace.setFromOptionsSpace.setNumComponentsSpace.setNumVariablesSpace.setPTrimmedFormDegreeSpace.setPointPointsSpace.setPolynomialTensorSpace.setSumConcatenateSpace.setSumNumSubspacesSpace.setSumSubspaceSpace.setTensorNumSubspacesSpace.setTensorSubspaceSpace.setTypeSpace.setUpSpace.viewSta""geStencilStencilLocationStencilTypeStreamTypeStructureSysSys.PrintSys.getDefaultCommSys.getVersionSys.getVersionInfoSys.hasExternalPackageSys.infoAllowSys.isFinalizedSys.isInitializedSys.popErrorHandlerSys.popSignalHandlerSys.pushErrorHandlerSys.registerCitationSys.setDefaultCommSys.sleepSys.splitOwnershipSys.syncFlushSys.syncPrintTAOTAOALMMTypeTAOBNCGTypeTAOConstraintsFunctionTAOConvergedReasonTAOGradientFunctionTAOHessianFunctionTAOJacobianFunctionTAOJacobianResidualFunctionTAOLSGradientFunctionTAOLSObjectiveFunctionTAOLSObjectiveGradientFunctionTAOLineSearchTAOLineSearchConvergedReasonTAOLineSearchTypeTAOLineSearch.applyTAOLineSearch.createTAOLineSearch.destroyTAOLineSearch.getOptionsPrefixTAOLineSearch.getTypeTAOLineSearch.setFromOptionsTAOLineSearch.setGradientTAOLineSearch.setInitialStepLengthTAOLineSearch.setObjectiveTAOLineSearch.setObjectiveGradientTAOLineSearch.setOptionsPrefixTAOLineSearch.setTypeTAOLineSearch.setUpTAOLineSearch.useTAORoutineTAOLineSearch.viewTAOMonitorFunctionTAOObjectiveFunctionTAOObjectiveGradientFunctionTAOResidualFunctionTAOTermTAOTermTypeTAOTerm.createTAOTerm.destroyTAOTerm.getTypeTAOTerm.setFromOptionsTAOTerm.setSolutionTemplateTAOTerm.setTypeTAOTerm.setUpTAOTerm.viewTAOTypeTAOUpdateFunctionTAO.addTermTAO.appendOptionsPrefixTAO.cancelMonitorTAO.checkConvergedTAO.computeConstraintsTAO.computeDualVariablesTAO.computeGradientTAO.computeHessianTAO.computeJacobianTAO.computeObjectiveTAO.computeObjectiveGradientTAO.computeResidualTAO.computeVariableBoundsTAO.createTAO.createPythonTAO.destroyTAO.getALMMSubsolverTAO.getALMMTypeTAO.getAppCtxTAO.getBNCGTypeTAO.getBRGNDampingVectorTAO.getBRGNSubsolverTAO.getConstraintTolerancesTAO.getConvergedReasonTAO.getConvergenceTestTAO.getEqualityConstraintsTAO.getGradientTAO.getGradientNormTAO.getHessianTAO.getInequalityConstraintsTAO.getIterationNumberTAO.getJacobianEqualityTAO.getJacobianInequalityTAO.getKSPTAO.getLMVMH0TAO.getLMVMH0KSPTAO.getLMVMMatTAO.getLineSearchTAO.getMaximumFunctionEvaluationsTA""O.getMaximumIterationsTAO.getMonitorTAO.getObjectiveTAO.getObjectiveAndGradientTAO.getObjectiveValueTAO.getOptionsPrefixTAO.getPythonContextTAO.getPythonTypeTAO.getSolutionTAO.getSolutionNormTAO.getSolutionStatusTAO.getTermTAO.getTolerancesTAO.getTypeTAO.getUpdateTAO.getVariableBoundsTAO.monitorTAO.setALMMSubsolverTAO.setALMMTypeTAO.setAppCtxTAO.setBNCGTypeTAO.setBRGNDictionaryMatrixTAO.setBRGNRegularizerHessianTAO.setBRGNRegularizerObjectiveGradientTAO.setBRGNRegularizerWeightTAO.setBRGNSmoothL1EpsilonTAO.setConstraintTolerancesTAO.setConstraintsTAO.setConvergedReasonTAO.setConvergenceTestTAO.setEqualityConstraintsTAO.setFromOptionsTAO.setGradientTAO.setGradientNormTAO.setHessianTAO.setInequalityConstraintsTAO.setInitialTrustRegionRadiusTAO.setIterationNumberTAO.setJacobianTAO.setJacobianDesignTAO.setJacobianEqualityTAO.setJacobianInequalityTAO.setJacobianResidualTAO.setJacobianStateTAO.setLMVMH0TAO.setLMVMMatTAO.setMaximumFunctionEvaluationsTAO.setMaximumIterationsTAO.setMonitorTAO.setObjectiveTAO.setObjectiveGradientTAO.setOptionsPrefixTAO.setPythonContextTAO.setPythonTypeTAO.setResidualTAO.setSolutionTAO.setStateDesignISTAO.setTolerancesTAO.setTypeTAO.setUpTAO.setUpdateTAO.setVariableBoundsTAO.solveTAO.viewTCQMRTELESCOPETENSORTETRAHEDRONTFQMRTFSTHTHETATHIRDTHIRD_SIZETRANSFORMFILTERTRANSPOSETRIANGLETRI_PRISMTRI_PRISM_TENSORTRONTRUETSTSARKIMEXTypeTSConvergedReasonTSDIRKTypeTSEquationTypeTSExactFinalTimeTSIFunctionTSIRMTSProblemTypeTSRHSFunctionTSRHSJacobianTSRKTypeTSTypeTS.adjointResetTS.adjointSetStepsTS.adjointSetUpTS.adjointSolveTS.adjointStepTS.appendOptionsPrefixTS.cloneTS.computeI2FunctionTS.computeI2JacobianTS.computeIFunctionTS.computeIJacobianTS.computeIJacobianPTS.computeRHSFunctionTS.computeRHSFunctionLinearTS.computeRHSJacobianTS.computeRHSJacobianConstantTS.computeRHSJacobianPTS.createTS.createPythonTS.createQuadratureTSTS.destroyTS.getARKIMEXTypeTS.getAlphaParamsTS.getAppCtxTS.getConvergedReasonTS.getCostGradientsTS.getCostIntegralTS.getDIRKTypeTS.ge""tDMTS.getEquationTypeTS.getEvaluationSolutionsTS.getEvaluationTimesTS.getI2FunctionTS.getI2JacobianTS.getIFunctionTS.getIJacobianTS.getKSPTS.getKSPIterationsTS.getMaxStepsTS.getMaxTimeTS.getMonitorTS.getNumEventsTS.getOptionsPrefixTS.getPostStepTS.getPreStepTS.getPrevTimeTS.getProblemTypeTS.getPythonContextTS.getPythonTypeTS.getQuadratureTSTS.getRHSFunctionTS.getRHSJacobianTS.getRKTypeTS.getSNESTS.getSNESFailuresTS.getSNESIterationsTS.getSolutionTS.getSolution2TS.getSolveTimeTS.getStepLimitsTS.getStepNumberTS.getStepRejectionsTS.getThetaTS.getThetaEndpointTS.getTimeTS.getTimeSpanSolutionsTS.getTimeStepTS.getTolerancesTS.getTypeTS.interpolateTS.loadTS.monitorTS.monitorCancelTS.removeTrajectoryTS.resetTS.restartStepTS.rollBackTS.setARKIMEXFastSlowSplitTS.setARKIMEXFullyImplicitTS.setARKIMEXTypeTS.setAlphaParamsTS.setAlphaRadiusTS.setAppCtxTS.setConvergedReasonTS.setCostGradientsTS.setDIRKTypeTS.setDMTS.setEquationTypeTS.setErrorIfStepFailsTS.setEvaluationTimesTS.setEventHandlerTS.setEventTolerancesTS.setExactFinalTimeTS.setFromOptionsTS.setI2FunctionTS.setI2JacobianTS.setIFunctionTS.setIJacobianTS.setIJacobianPTS.setMaxSNESFailuresTS.setMaxStepRejectionsTS.setMaxStepsTS.setMaxTimeTS.setMonitorTS.setOptionsPrefixTS.setPostStepTS.setPreStepTS.setProblemTypeTS.setPythonContextTS.setPythonTypeTS.setRHSFunctionTS.setRHSJacobianTS.setRHSJacobianPTS.setRHSSplitIFunctionTS.setRHSSplitIJacobianTS.setRHSSplitISTS.setRHSSplitRHSFunctionTS.setRKTypeTS.setSaveTrajectoryTS.setSolutionTS.setSolution2TS.setStepLimitsTS.setStepNumberTS.setThetaTS.setThetaEndpointTS.setTimeTS.setTimeSpanTS.setTimeStepTS.setTolerancesTS.setTypeTS.setUpTS.solveTS.stepTS.viewTWISTTTypeUUAUMFPACKUNITUNKNOWNUNKNOWN_CELLUNKNOWN_FACEUNKNOWN_NONZERO_PATTERNUNKNOWN_NZUNLIMITEDUNPRECONDITIONEDUNSPECIFIEDUNUSED_NONZERO_LOCATION_ERRUPUPDATEUPPERUP_LEFTUP_RIGHTUSERUSE_HASH_TABLEUSE_INODESUmatUvecVVANKAVIENNACLVINEWTONRSLSVINEWTONSSLSVPBJACOBIVTKVTK_VTRVTK_VTSVTK_VTUVUVecVecOptionVecSplitToDMDAVecType_Vec_LocalForm_""Vec_LocalForm.__enter___Vec_LocalForm.__exit__Vec.__div__Vec.__dlpack__Vec.__dlpack_device__Vec.__enter__Vec.__exit__Vec.__idiv__Vec.__rdiv__Vec.absVec.appendOptionsPrefixVec.assembleVec.assemblyBeginVec.assemblyEndVec.attachDLPackInfoVec.axpbyVec.axpyVec.aypxVec.bindToCPUVec.boundToCPU_Vec_buffer_Vec_buffer.__enter___Vec_buffer.__exit__Vec.chopVec.clearDLPackInfoVec.concatenateVec.conjugateVec.copyVec.createVec.createCUDAWithArraysVec.createGhostVec.createGhostWithArrayVec.createHIPWithArraysVec.createLocalVectorVec.createMPIVec.createNestVec.createSeqVec.createSharedVec.createViennaCLWithArraysVec.createWithArrayVec.createWithDLPackVec.destroyVec.dotVec.dotBeginVec.dotEndVec.dotNorm2Vec.duplicateVec.equalVec.expVec.getArrayVec.getBlockSizeVec.getBufferVec.getCLContextHandleVec.getCLMemHandleVec.getCLQueueHandleVec.getCUDAHandleVec.getDMVec.getGhostISVec.getHIPHandleVec.getLGMapVec.getLocalSizeVec.getLocalVectorVec.getNestSubVecsVec.getOffloadMaskVec.getOptionsPrefixVec.getOwnershipRangeVec.getOwnershipRangesVec.getSizeVec.getSizesVec.getSubVectorVec.getTypeVec.getValueVec.getValuesVec.getValuesStagStencilVec.ghostUpdateVec.ghostUpdateBeginVec.ghostUpdateEndVec.isaxpyVec.issetVec.loadVec.localFormVec.logVec.mDotVec.mDotBeginVec.mDotEndVec.maxVec.maxPointwiseDivideVec.maxpyVec.meanVec.minVec.mtDotVec.mtDotBeginVec.mtDotEndVec.normVec.normBeginVec.normEndVec.normalizeVec.permuteVec.placeArrayVec.pointwiseDivideVec.pointwiseMaxVec.pointwiseMaxAbsVec.pointwiseMinVec.pointwiseMultVec.reciprocalVec.resetArrayVec.restoreCLMemHandleVec.restoreCUDAHandleVec.restoreHIPHandleVec.restoreLocalVectorVec.restoreSubVectorVec.scaleVec.setVec.setArrayVec.setBlockSizeVec.setDMVec.setFromOptionsVec.setLGMapVec.setMPIGhostVec.setNestSubVecsVec.setOptionVec.setOptionsPrefixVec.setRandomVec.setSizesVec.setTypeVec.setUpVec.setValueVec.setValueLocalVec.setValuesVec.setValuesBlockedVec.setValuesBlockedLocalVec.setValuesLocalVec.setValuesStagStencilVec.shiftVec.sqrtabsVec.strideGatherVec.str""ideMaxVec.strideMinVec.strideNormVec.strideScaleVec.strideScatterVec.strideSumVec.sumVec.swapVec.tDotVec.tDotBeginVec.tDotEndVec.toDLPackVec.viewVec.waxpyVec.zeroEntriesView.MemoryViewViewerViewerDrawSizeViewerFileModeViewerFormatViewerHDF5ViewerHDF5.createViewerHDF5.getGroupViewerHDF5.getTimestepViewerHDF5.incrementTimestepViewerHDF5.popGroupViewerHDF5.popTimesteppingViewerHDF5.pushGroupViewerHDF5.pushTimesteppingViewerHDF5.setTimestepViewerTypeViewer.ASCIIViewer.BINARYViewer.DRAWViewer.STDERRViewer.STDOUTViewer.addASCIITabViewer.clearDrawViewer.createViewer.createASCIIViewer.createBinaryViewer.createDrawViewer.createHDF5Viewer.createMPIIOViewer.createPythonViewer.createVTKViewer.destroyViewer.flushViewer.getASCIITabViewer.getFileModeViewer.getFileNameViewer.getFormatViewer.getPythonContextViewer.getPythonTypeViewer.getSubViewerViewer.getTypeViewer.popASCIISynchronizedViewer.popASCIITabViewer.popFormatViewer.printfASCIIViewer.printfASCIISynchronizedViewer.pushASCIISynchronizedViewer.pushASCIITabViewer.pushFormatViewer.restoreSubViewerViewer.setASCIITabViewer.setDrawInfoViewer.setFileModeViewer.setFileNameViewer.setFromOptionsViewer.setPythonContextViewer.setPythonTypeViewer.setTypeViewer.setUpViewer.subtractASCIITabViewer.useASCIITabsViewer.viewViewer.viewObjectPythonVmatWWBMWINDOWWRITEWXYXZERO_INITIAL_GUESS___aa_maxabcabortabsactivateadaptLabeladaptMetricadaptStepaddASCIITabaddCellDMaddCoarsenHookaddCompositePCTypeaddConstraintDofaddConvergenceTestaddDMaddDofaddFieldaddFieldConstraintDofaddFieldDofaddFlopsaddNPointsaddPointaddStrataaddStrataISaddStratumaddTermaddvadjadjacencyadjointResetadjointSetStepsadjointSetUpadjointSolveadjointStepadjoint_stepsaiajallGatherallocateLMVMallocate_bufferalloptsallowalmm_typealphaalpha2alpha_falpha_malphasamatamountaname__annotate__aoapcappapp2petscappctxappendappendOptionsPrefixapplyapplyBlockapplyBlockInverseapplyISapplyInverseapplySymmetricLeftapplySymmetricRightapplyTransposeargargsarray__array_interface__array_wasmtypeassembl""eassembliesassemblyassemblyBeginassemblyEndastypeasyncio.coroutinesatexitatolattachDLPackInfoattrauauthorauthorinfoauxavavalaxpbyaxpyaypxbb_vecbackback_downback_down_leftback_down_rightback_leftback_rightback_upback_up_leftback_up_rightbarrierbasebatchSizebcCompsbcFieldbcPointsbcastBeginbcastEndbccompsbcfieldbcmpbcpointsbdLabelbdlabelbdvaluebeginbegin_argsbegin_kargsbetabindFlgbindToCPUbitsblockSizeblock_sizeblocksblocksizebndrbool__bool__boundToCPUboundaryboundary_typeboundary_typesboxbsbsizebtxbtybtypebtzbufbufferbuffer_wbuildResidualbuildSolutionbuildTwoSided__builtins__bvalbval_rabval_rsbvecccCellTypecEndcStartcaddvcallConvergenceTestcallowcalphacalpha2cancelMonitorcatol_catolcbatchSizecbdlblcbegincblockSizecblocksizecbscbufferccbeginccellccellNodeMapsccendccgidccnormccommccommsccompcconcatenatecconeOrientationcconePointcconePosccontainsccontinuousccoo_iccoo_jccoordcctxcd0cdctxcdegmaxcdegmincdegreecdepthcdestructivecdevicecdevice_idcdevice_typecdimcdimscdisplaycdistcdistancecdivtolcdmcdmaxcdmincdmscdofcdofscdosortcdtolcdtypececellcellNodeMapscellVerticescelldmcellidcellscendcentityDepthcentroidcepsceta1ceta2ceta3cexistscexoidcfcfacescfactcfieldcfieldnamecfieldnamescfieldvecscfilecfilenamecfillcfill_paramcfirstcfixcflagcflgcflopscformDegreecfunccg_typecgammacghostBcNodescgidcglobalBcNodescgroupcgseccheckConvergedchopcicibdiagcidcidxcidxmcignoreHalocignoreOutsideDomaincimodecindexcindicescinfocintdimcinterpcinvertciscisSimplexciscolciscolscisetscisfieldscisfromcisrowscistocitcitationcitscjoin_modeckcl__class____class_getitem__classidclayoutTypeclblclearclearDLPackInfoclearDSclearDrawclearFieldsclearLabelStratumclearLabelValueclearStratumclearValueclenclevelclevelsclgmcline_in_tracebackclitsclocalizationHeightclocalizedcloneclosureclowerclscltolclvecscmcmapcmatscmaxcmaxdegreecmaxitcmaxitscmaxstepcmincminradiuscminstepcmodecmpscmsgcncnamecnamelistcnccncompscndofcnfieldscnlocalcnmaxcnmincnnzcnormcnpointscnrootscnumcnumBatchescnumBlockscnumCompcnumDofcnumFieldscnumPro""cscnumSumSpacescnumTensSpacescnvarscoarsencoarsenHierarchycoarsencontextcoarsenhookcoarsenhookscobjcodecoeffscoffsetcolcol_bsizecollectViewCreatecollectViewDestroycoloringcolrngcolscolumncomegacommcommscompcompilecomplementcomposecompressedcomputecomputeCellGeometryFVMcomputeConstraintscomputeDegreecomputeDualVariablescomputeEigenvaluescomputeExtremeSingularValuescomputeFunctioncomputeGradientcomputeGradientClementInterpolantcomputeHessiancomputeI2FunctioncomputeI2JacobiancomputeIFunctioncomputeIJacobiancomputeIJacobianPcomputeIndexcomputeJacobiancomputeMomentscomputeNGScomputeObjectivecomputeObjectiveGradientcomputeRHSFunctioncomputeRHSFunctionLinearcomputeRHSJacobiancomputeRHSJacobianConstantcomputeRHSJacobianPcomputeResidualcomputeVariableBoundsconcatenateconeconeOrientationconePointconePosconfigureconformingconjugateconnzconstantconstraintsconstructGhostCellscontextcontinuousconvergedconvertconvertToSectioncoo_icoo_jcoo_vcoordcoordinatescoordinatesLoadcoordinatesViewcoordnamescoordscoords_sourcecoords_targetcopcoptscopycopyDScopyDisccopyFieldscopyPoint__copy__cordercorrection_typecorrtypecostcothercountcountscoutputcoveringPointscoverlapcpcpackagecparallelcpartcpendcpermcpicpidlistcpjcpointcpointscprefixcprojectcpstartcpuarraycputimecqordercradiuscrankcratiocrbegincreasoncreatecreateAIJcreateAIJCRLcreateAIJWithArrayscreateASCIIcreateBAIJcreateBasiccreateBinarycreateBlockcreateBoxMeshcreateBoxSurfaceMeshcreateByCellcreateCGNScreateCGNSFromFilecreateCUDAWithArrayscreateClosureIndexcreateCoarsePointIScreateCohesiveSubmeshcreateColoringcreateCompatibleDMStagcreateConstantDiagonalcreateCoordinateSpacecreateDScreateDefaultcreateDefaultSFcreateDensecreateDenseCUDAcreateDiagonalcreateDrawcreateEmbeddedLeafSFcreateEmbeddedRootSFcreateExoduscreateExodusFromFilecreateFieldDecompositioncreateFromCellListcreateFromFilecreateGeneralcreateGhostcreateGhostWithArraycreateGlobalSectioncreateGlobalToNaturalSFcreateGlobalVeccreateGlobalVectorcreateGlobalVectorFromFieldcreateGlobalV""ectorFromFieldscreateGmshcreateH2OpusFromMatcreateHDF5createHIPWithArrayscreateHermitianTransposecreateHtoolFromKernelcreateIScreateIndexcreateInjectioncreateInterpolationcreateInversecreateLRCcreateLabelcreateLagrangecreateLocalVeccreateLocalVectorcreateLocalVectorFromFieldcreateLocalVectorFromFieldscreateMPIcreateMPIIOcreateMappingcreateMassMatrixcreateMatcreateMatrixcreateMemoryScalablecreateNaturalVeccreateNaturalVectorcreateNestcreateNormalcreateNormalHermitiancreatePointNumberingcreatePythoncreateQuadratureTScreateRestrictioncreateRigidBodycreateSBAIJcreateSFcreateScattercreateSchurComplementcreateSectioncreateSectionSFcreateSeqcreateSharedcreateStridecreateSubDMcreateSubMatricescreateSubMatrixcreateSubMatrixVirtualcreateTransposecreateVTKcreateVecLeftcreateVecRightcreateVecscreateViennaCLWithArrayscreateWithArraycreateWithDLPackcreate_gveccreate_injectioncreate_interpolationcreate_lveccreate_matrixcreate_restrictioncreate_subdmcredcredundantcredundantPointscremoteOffsetscrendcrescrglblcrowscrtolcrtol_0_crtolcrtol_maxcscsanitizecscalecsctmcsdimcseccselectedcsfcshiftcsimplexcsizecsizescsortypecsparseLocalizecsrcstagecstartcstartscstatecstepcstolcstratumcstream_typecstringcsubctxscsubspaceOffsetscsuccesscsvaluecsxct1ct2ctabctabsctensorcthresholdctimestepctitlectoindxctransposectrimmedctxctx0ctxhdlctypecudahandlecuppercuseConecuseInitialGuesscvalcvalscvaluecveccvecscversioncviewercweightcweightscycle_typedd_isdadampdatadatedavecdctxdeactivatedebuggerdecRefdecodedecompdecorator__deepcopy__defaultdegreedelValuedelta_0delta_maxdelta_mindensedepthdesigndestroydestroyGlobalVectorFromFielddestroyGlobalVectorFromFieldsdestroyIndexdestroyLocalVectorFromFielddestroyLocalVectorFromFieldsdestroyOptionsHandlersdestructivedeterminantdevdevIddeveldevicedevice_iddevice_typediagdiagonalScalediagonal_fill__dict__dictdifferencedimdimsdirectiondiscdisplaydistdistancedistributedistributeFielddistributeGetDefaultdistributeOverlapdistributeSectiondistributeSetDefaultdistributionGetNam""edistributionSetNamediv__div__divtoldl_tensordlm_tensor__dlpack____dlpack_device__dltensordltypedmdmDetdmGhosteddmOlddmOverlapdmParalleldmTodm_typedmactivedmcdmcommdmfdmlabeldmsdmswarm_typedmtype__doc__dofdof0dof1dof2dof3dofsdonedosortdotdotBegindotEnddotNorm2downdown_leftdown_rightdropdsds_typedspacedtdtcoldtcountdtoldtypedtype_is_objectdualspace_typedummyduplicatedveceeigenelem_typeelementelementselemsemacsembedencodeendend_argsend_kargs__enter__entityDepthentriesentry__enum2strenumerateepeepsiloneqtypeequalequality_constraintserncerrhandlererroretaeta1eta2eta3etypeevalevaluateevaluatestepeventeventidexcexec__exit__exoidexpexpandffacesfactfactorCholeskyfactorICCfactorILUfactorLUfactorNumericCholeskyfactorNumericLUfactorSymbolicCholeskyfactorSymbolicICCfactorSymbolicILUfactorSymbolicLUfactor_mallocsfailsfefe_typefetchAndOpBeginfetchAndOpEndfgetfieldfieldNamefieldnamefieldnamesfields__file__filenamefillfill_paramfill_ratio_givenfill_ratio_neededfilter_finalizefinalizeFieldRegisterfindZeroRowsfirstfitfitinterceptfixfixISLocalEmptyflagflag1flag2flagsflgflg2flipfloatflopsflushfnormforceforkformDegreeformSNESFunctionformSNESJacobianformatfortranforwardfpointfrontfront_downfront_down_leftfront_down_rightfront_leftfront_rightfront_upfront_up_leftfront_up_rightfunfunc__func__functionfunctionalfunctoolsfvalfvecfwdgg2lgamgtypegammagarbage_cleanupgarbage_viewgasmtypegathergatherBegingatherEndgatol_gatolgcgdimgdofsgenerate__get__get1dCoordinatecArraysgetALMMSubsolvergetALMMTypegetAOgetARKIMEXTypegetASCIITabgetASMSubKSPgetAccessgetActivegetActiveAllgetAdjacencygetAdjacencyUseAnchorsgetAllgetAlphaParamsgetAppCtxgetApplicationContextgetArraygetAttrgetAuxiliaryVecgetBJacobiSubKSPgetBNCGTypegetBRGNDampingVectorgetBRGNSubsolvergetBasicAdjacencygetBasisSpacegetBlockIndicesgetBlockInfogetBlockSizegetBlockSizesgetBoolgetBoolArraygetBoundaryTypegetBoundaryTypesgetBoundingBoxgetBoundsgetBuffergetCGObjectiveValuegetCLContextHandlegetCLMemHandlegetCLQueueHandlegetCPUTimegetCUDAHandlegetCel""lCoordinateDMgetCellCoordinateSectiongetCellCoordinatesgetCellCoordinatesLocalgetCellDMgetCellDMActivegetCellDMByNamegetCellDMNamesgetCellIDgetCellNumberinggetCellTypegetCellTypeLabelgetChartgetClassIdgetClassNamegetCoarseDMgetCoarsenLevelgetColumnIJgetColumnVectorgetCommgetComponentsgetCompositeNumbergetCompositePCgetCompositeSNESgetComputeEigenvaluesgetComputeSingularValuesgetConegetConeOrientationgetConeSizegetConstrainedStorageSizegetConstraintDofgetConstraintIndicesgetConstraintTolerancesgetConvergedReasongetConvergenceHistorygetConvergenceTestgetCoordinateDMgetCoordinateDimgetCoordinateDimensiongetCoordinateFieldsgetCoordinateNamegetCoordinateSectiongetCoordinatesgetCoordinatesLocalgetCoordinatesLocalizedgetCornersgetCostGradientsgetCostIntegralgetCurrentgetDIRKTypegetDMgetDSgetDatagetDefaultCommgetDefaultGlobalSectiongetDefaultLocalSectiongetDefaultSFgetDefaultSectiongetDefaultValuegetDeflationCoarseKSPgetDeflationPCgetDegreegetDenseArraygetDenseColumnVecgetDenseLDAgetDenseLocalMatrixgetDenseSubMatrixgetDepthgetDepthStratumgetDevicegetDeviceIdgetDeviceTypegetDiagonalgetDiagonalBlockgetDictgetDimgetDimensiongetDimensionsgetDivergenceTolerancegetDofgetDualSpacegetElementTypegetElementsgetEntriesgetEntriesPerElementgetEqualityConstraintsgetEquationTypegetErrorIfNotConvergedgetEvaluationSolutionsgetEvaluationTimesgetFASCoarseSolvegetFASCycleSNESgetFASInjectiongetFASInterpolationgetFASLevelsgetFASRestrictiongetFASSmoothergetFASSmootherDowngetFASSmootherUpgetFaceQuadraturegetFactorMatrixgetFactorSolverTypegetFailedReasongetFieldgetFieldAdjacencygetFieldComponentsgetFieldConstraintDofgetFieldConstraintIndicesgetFieldDofgetFieldIndexgetFieldNamegetFieldOffsetgetFieldSplitSchurGetSubKSPgetFieldSplitSubISgetFieldSplitSubKSPgetFieldsgetFileModegetFileNamegetFlopsgetFormatgetFullJoingetFunctiongetFunctionEvaluationsgetFunctionNormgetFunctionTolerancesgetFunctionValuegetFunctionalgetGhostCornersgetGhostISgetGhostRangesgetGlobalISsgetGlobalSectiongetGlobalSizesgetGlobalVec""getGradientgetGradientNormgetGradientTolerancesgetGraphgetGroupgetHIPHandlegetHPDDMCoarseCorrectionTypegetHPDDMComplexitiesgetHPDDMSTShareSubKSPgetHPDDMTypegetHYPRETypegetHeightStratumgetHessiangetI2FunctiongetI2JacobiangetIFunctiongetIJacobiangetISAllowRepeatedgetISLocalMatgetIdgetIndicesgetInequalityConstraintsgetInertiagetInfogetInitialGuessgetInitialGuessKnollgetInitialGuessNonzerogetIntgetIntArraygetInteriorDimensiongetInterpolationTypegetIntervalgetIsFirstRankgetIsLastRankgetIterationNumbergetJacobiangetJacobianEqualitygetJacobianInequalitygetJoingetKSPgetKSPFailuresgetKSPIterationsgetLGMapgetLGMapsgetLMVMH0getLMVMH0KSPgetLMVMJ0getLMVMJ0KSPgetLMVMMatgetLRCMatsgetLabelgetLabelIdISgetLabelNamegetLabelOutputgetLabelSizegetLabelValuegetLagrangeContinuitygetLagrangeTensorgetLagrangeTrimmedgetLineSearchgetLinearCoefficientsgetLinearInterceptgetLinearKSPgetLinearSolveFailuresgetLinearSolveIterationsgetLinearTypegetLocalBoundingBoxgetLocalISsgetLocalSectiongetLocalSizegetLocalSizesgetLocalSubMatrixgetLocalVecgetLocalVectorgetLocationDofgetLocationSlotgetMGCoarseSolvegetMGInterpolationgetMGLevelsgetMGRScalegetMGRestrictiongetMGSmoothergetMGSmootherDowngetMGSmootherUpgetMGTypegetMatrixgetMaxDofgetMaxFunctionEvaluationsgetMaxKSPFailuresgetMaxLinearSolveFailuresgetMaxNonlinearStepFailuresgetMaxSizesgetMaxStepFailuresgetMaxStepsgetMaxTimegetMaximumFunctionEvaluationsgetMaximumIterationsgetMeetgetMigrationSFgetMinRadiusgetMonitorgetMultigetMumpsCntlgetMumpsIcntlgetMumpsInfogetMumpsInfoggetMumpsRinfogetMumpsRinfoggetNASMNumbergetNASMSNESgetNGSgetNPCgetNPCSidegetNamegetNearNullSpacegetNestISsgetNestLocalISsgetNestSizegetNestSubMatrixgetNestSubVecsgetNewtonALLoadParametergetNonEmptyStratumValuesISgetNonlinearStepFailuresgetNormSchedulegetNormTypegetNullSpacegetNumComponentsgetNumDofgetNumEventsgetNumFieldsgetNumLabelsgetNumValuesgetNumVariablesgetNumbergetNumberDMgetObjectivegetObjectiveAndGradientgetObjectiveValuegetOffloadMaskgetOffsetgetOffsetRangegetOperatorsgetOptiongetOp""tionsPrefixgetOrdergetOrderinggetOwnershipISgetOwnershipRangegetOwnershipRangeColumngetOwnershipRangesgetOwnershipRangesColumngetPCgetPCSidegetPTrimmedFormDegreegetParamsEWgetPartitionergetPatchSubKSPgetPerfInfogetPeriodicitygetPermutationgetPointDepthgetPointGlobalgetPointGlobalFieldgetPointHeightgetPointLocalgetPointLocalFieldgetPointPointsgetPointSFgetPolynomialTensorgetPostStepgetPreStepgetPrevTimegetProblemTypegetProcSizesgetProductCoordinateLocationSlotgetPythonContextgetPythonTypegetQuadraturegetQuadratureTSgetRHSFunctiongetRHSJacobiangetRKTypegetRangesgetRankgetRealgetRealArraygetRedundantMatrixgetRefCountgetRefineLevelgetRefinementFactorgetRefinementLimitgetRefinementUniformgetResidualNormgetRhsgetRowgetRowIJgetRowSumgetSNESgetSNESFailuresgetSNESIterationsgetScalargetScalarArraygetScattergetSchurComplementSubMatricesgetSectiongetSectionSFgetSeedgetSizegetSizesgetSolutiongetSolution2getSolutionNormgetSolutionStatusgetSolutionUpdategetSolveTimegetSparseLocalizegetSpatialDimensiongetStencilgetStencilTypegetStencilWidthgetStepFailuresgetStepLimitsgetStepNumbergetStepRejectionsgetStorageSizegetStratumISgetStratumSizegetStreamTypegetStridegetStringgetSubVectorgetSubViewergetSubpointISgetSubpointMapgetSumConcatenategetSumNumSubspacesgetSumSubspacegetSupportgetSupportSizegetTAOgetTRTolerancesgetTRUpdateParametersgetTabLevelgetTensorNumSubspacesgetTensorSubspacegetTermgetThetagetThetaEndpointgetTileSizesgetTimegetTimeSpangetTimeSpanSolutionsgetTimeStepgetTimestepgetTolerancesgetTotalComponentsgetTotalDimensionsgetTransitiveClosuregetTransposeMatgetTransposeNullSpacegetTypegetUpdategetUseAmatgetUseEWgetUseFDgetUseKSPgetUseMFgetUseNaturalgetVIInactiveSetgetValuegetValueISgetValueRealgetValuesgetValuesCSRgetValuesStagStencilgetVariableBoundsgetVecArraygetVecClosuregetVecLeftgetVecRightgetVecTypegetVecsgetVectorgetVersiongetVersionInfogetVertexNumberinggetVisiblegetWorkVecsget__getstate__ghostBcNodesghostUpdateghostUpdateBeginghostUpdateEndghostedghostsglobalBcNodesglob""alToLocalglobalToNaturalglobalToNaturalBeginglobalToNaturalEndglobalVectorLoadglobalVectorViewglobalsecgmaxgmingnormgordgpuarraygradientgroupgrtol_grtolgsecgsfgsizesgtolgttol_gttolguess_knollguess_nonzerogvgvechh_maxh_minhandlehandlerhashasConstanthasExternalPackagehasLabelhasLagrangehasNPChasNamehasPointhasStratumhasValuehas_consthausdhdlheighthermitianTransposehessianhierarchyhighhiphandlehisthmathmaxhmaxrhminhminrhostmemhpddm_typehypretypei_iiaiadjibdiagicntl_icntlicolsicompiconeididataidimidirs__idiv__idleidofidxidxappidxmidxoutidxpetscierrifieldsigignoreHaloignoreOutsideDomainihistiidx_ildailocalimimagimagPartimeximode__import__inactinblocksincRefincreaseOverlapincrementTabLevelincrementTimestepindexindicatorindicesinequality_constraintsinfoinfoAllow__init__initialguess_initializeinitializeFieldRegisterinjectinsertConeinsertConeOrientationinsertISinsertPointUsingCellDMinsertStringintinterceptinteriorinterpinterp_typeinterpolateinterpolationintersectintervalinvertinvertBlockDiagonalinvertPermutationiorderiorieipointsiremoteirowisActiveisAssembledisDistributedisFinalizedisHermitianisHermitianKnownisIdentityisInitializedisLinearisPermutationisSimplexisSortedisStructurallySymmetricisSymmetricisSymmetricKnownisTransposeisValid_is_coroutineis_fromis_idleis_localis_subis_tois_typeisappisaxpyiscoliscolorsiscolsisetisetsisets_localisetscolsisetsrowsisfieldsislsqrisotropicispermispetscisrowisrowsississetistrataisuppitemitemsitemsizeitermitsitypeivalival1ival2ival3_ivaljjajacobianjacobian_designjacobian_equalityjacobian_inequalityjacobian_statejacobianpjdxmjmatjoinjoin_modekkargskernelkernelctxkeykeyskindklasskronkspksp_typekwargsll2gl2llabellabelCohesiveCompletelabelCompletelabelNamelabelsLoadlabelsView<lambda>laneslayoutTypeldaleafSectionleafdataleafsizeleafupdateleftlengthlevellevelslgmlgmaplgmap_typelgmapclgmaprlgmclgmrlgmslinear_itslineartypelinesearchlislistlitslmaxlminloadloclocClocXlocallocalFormlocalToGloballocalToLocallocalVectorLoadlocalVectorViewlocalizationHe""ightlocalizeCoordinateslocalizedlocalseclocsloglogConvergenceHistorylogFlopslowlowerlpEndlpStartlpylsls_typelsflsizelsneslstartltogltollvlveclvecslxlylzmmDotmDotBeginmDotEnd__main__majormallocsmapmatmarkBoundaryFacesmaskmatmatApplymatApplyTransposematMatMultmatMultmatSolvematSolveTransposematTransposeMultmat_typematpartitioning_typematsmaxmaxCellmaxConeSizemaxDegreemaxDofmaxPointwiseDividemaxSupportSizemax_failsmax_funcsmax_itmax_itsmax_stepsmax_timemaxdegmaxpymaxrmaxrankmaxstepmaxvalmcmcellmeanmem1mem2memhdlmemomemorymemviewmessagemessageLength__metaclass__metricmetric1metric2metric3metricAverage2metricAverage3metricAvgmetricCreatemetricCreateIsotropicmetricCreateUniformmetricDeterminantCreatemetricEnforceSPDmetricGetGradationFactormetricGetHausdorffNumbermetricGetMaximumAnisotropymetricGetMaximumMagnitudemetricGetMinimumMagnitudemetricGetNormalizationOrdermetricGetNumIterationsmetricGetTargetComplexitymetricGetVerbositymetricIntmetricIntersection2metricIntersection3metricIsIsotropicmetricIsUniformmetricNoInsertionmetricNoMovementmetricNoSurfmetricNoSwappingmetricNormalizemetricRestrictAnisotropyFirstmetricSetFromOptionsmetricSetGradationFactormetricSetHausdorffNumbermetricSetIsotropicmetricSetMaximumAnisotropymetricSetMaximumMagnitudemetricSetMinimumMagnitudemetricSetNoInsertionmetricSetNoMovementmetricSetNoSurfmetricSetNoSwappingmetricSetNormalizationOrdermetricSetNumIterationsmetricSetRestrictAnisotropyFirstmetricSetTargetComplexitymetricSetUniformmetricSetVerbositymgtypemicromigratemigrateGlobalToNaturalSFmigrateVecminminDegreemindegminorminstepmirrormit_mitmltmodemodel__module__mommomentsmonitormonitorCancelmonitorlistmpi4pympiabortmr__mro_entries__msgmstrmtDotmtDotBeginmtDotEndmtypemultmultAddmultDiagonalBlockmultHermitianmultHermitianAddmultTransposemultTransposeAddmultirootdatannExtraxnExtraynExtraznLabelsnanadjname__name__name_namesnappnaturalToGlobalnaturalToGlobalBeginnaturalToGlobalEndnbnbcnbstepsncncellsncfncolorsncolsncompnconencooncoo_incoo_jnctxsnda""rrayndimndirsndofndofsneigneighsnelnennevents__new__newnewaonewcdmnewcommnewdanewdmnewdmcnewdmfnewdminterpnewdmlabelnewdsnewdspnewfenewisetnewkspnewlgmnewlsnewmatnewnspnewpartnewpcnewquadnewregressornewsctnewsecnewsfnewsnesnewspnewtaonewtaolsnewtaotermnewtrnewtsnewvecnewvwrnfnfieldsngngsninidxniidxnindexnjnlnleavesnlevelsnlocalnmnmaxnminnnznoInsertnoMovenoSurfnoSwapnonodesnodesPerCellnoffsetsnoinoidxnojnonenonzeronorienormnormBeginnormEndnorm_1_2norm_typenormalnormalizenormschednormtypenoutnovnp_subctxnpartnpetscnpointsnprocnprocsnpy_flagsnrnrangesnremotenrootsnrowsnsdnsizensizesnspnsubcomm_nsubcommnsuppntntermntolrntypenullnumBatchesnumBlocksnumCellsnumCompnumCornersnumCoveringPointsnumDofnumFieldsnumGhostBcsnumGhostCellsnumGlobalBcsnumIternumMessagesnumPointsnumProcsnumReductionsnumStratanumSubSpacesnumSumSpacesnumTensSpacesnumValuesnumVerticesnumprocsnvnvtxnxsnxtnznz_allocatednz_unneedednz_usednzdiagooEndoStartobjobj_copyobjectobjectiveobjgradobjpreobjsococonvergedocountsoctxoffsetoioidxoindicesojolomegaometriconnzopopenoperatoroperatorsoptionoptionsoptsord_typeorderorientorientationotherotypeououtoutputovovalovecoverlapownership_rangesozzpp1pEndpStartpackpackage__package__parallelparamsparentpartpart_typepartitioningpartitioningCountpartitioningToNumberingpbspcpc_typepconformingpcratiopdpdapdavecpdimperiodicpermpermutationpermutepetapetscpetsc2apppetsc4py.PETScpfieldpgordphaspipidlistpinteriorpjpl2lplaceArrayplevelsplexnamepmatpnamepobjpoipointpointspointwiseDividepointwiseMaxpointwiseMaxAbspointwiseMinpointwiseMultpojpoppopASCIISynchronizedpopASCIITabpopErrorHandlerpopFormatpopGrouppopSignalHandlerpopTimestepping_pop_python_vfprintfporderpositionpositive_definitepostSolvepostStepposteventpostsolvepoststeppovprprepreSolvepreStep_pre_finalizepreallocatorPreallocateprecheckpredictprefixprefixPopprefixPush__prepare__prependpresolveprestepprimvprintfASCIIprintfASCIISynchronizedproc_sizesprocsproductNumericproductSetFromOptionsproductSymbolicprojectprojectFieldsprope""rtypsizesptapptrptransptypepushpushASCIISynchronizedpushASCIITabpushErrorHandlerpushFormatpushGrouppushTimestepping_push_python_vfprintfpvpvalpy_ctxpy_sub_ctxspy_typepythonpyvec__pyx_capi____pyx_checksum__pyx_state__pyx_type__pyx_unpickle_Enum__pyx_vtable__q0q1qorderqtsquad__qualname__queryqueuehdlrradiusrandomrangesrankrank0rank1rank2rartratolrbeginrbsrdata__rdiv__readreadonlyreadyrealrealPartreasonrebalanceSharedPointsreciprocalred__reduce__reduceBeginreduceEnd__reduce_cython____reduce_ex__redundantredundantPointsrefcntrefctrefinerefineHierarchyrefine_xrefine_yrefine_zrefinementLimitrefinementUniformregisterregisterCitationregisterFieldregressor_typerejreleaseremoteremoteOffsetsremoveremoveLabelremovePointremovePointAtIndexremoveTrajectoryremove_ptsremove_sent_pointsrendrenumberreorderreorderForNonzeroDiagonalreorderGetDefaultreorderSetDefaultreplace__repr__resresetresetArrayresetLMVMreshaperesidualrestartrestartSteprestoreCLMemHandlerestoreCUDAHandlerestoreDenseColumnVecrestoreDenseSubMatrixrestoreFieldrestoreGlobalVecrestoreHIPHandlerestoreISLocalMatrestoreLocalSubMatrixrestoreLocalVecrestoreLocalVectorrestoreSubVectorrestoreSubViewerrestoreVectorrestrictAnisotropyrestrictAnisotropyFirstrestrictSizesrestrictcontextrestricthookrestricthooksrestrictionresultretrieveValuesreturnreusereversergLabelrhistrhsrhsjacobianprightrlrmaprndrnd_typerngrnormrollBackrollbackrootSectionrootdatarowrow_bsizerowmaprowrngrowsrprrtolrscalersplitrstartrtolrtol_0rtol_maxrtspanrvalrval1rval2rval3rvecrws1s2sEndsStarts_ss_issasanitizeSubMeshscale_scalescatterscatterBeginscatterEndscatter_typesdimsecsecondssectionsectionLoadsectionSFsectionViewsectiondmseedselectedselfsepsetsetALMMSubsolversetALMMTypesetARKIMEXFastSlowSplitsetARKIMEXFullyImplicitsetARKIMEXTypesetASCIITabsetASMLocalSubdomainssetASMOverlapsetASMSortIndicessetASMTotalSubdomainssetASMTypesetActivesetActiveAllsetAdjacencysetAdjacencyUseAnchorssetAlphaParamssetAlphaRadiussetAppCtxsetApplicationContextsetArraysetAttrsetAuxiliaryV""ecsetBDDCChangeOfBasisMatsetBDDCCoarseningRatiosetBDDCDirichletBoundariessetBDDCDirichletBoundariesLocalsetBDDCDiscreteGradientsetBDDCDivergenceMatsetBDDCDofsSplittingsetBDDCDofsSplittingLocalsetBDDCLevelssetBDDCLocalAdjacencysetBDDCNeumannBoundariessetBDDCNeumannBoundariesLocalsetBDDCPrimalVerticesISsetBDDCPrimalVerticesLocalISsetBNCGTypesetBRGNDictionaryMatrixsetBRGNRegularizerHessiansetBRGNRegularizerObjectiveGradientsetBRGNRegularizerWeightsetBRGNSmoothL1EpsilonsetBasicAdjacencysetBasisSpacesetBlockIndicessetBlockSizesetBlockSizessetBoundaryTypesetBoundaryTypessetCellCoordinateDMsetCellCoordinateSectionsetCellCoordinatessetCellCoordinatesLocalsetCellDMsetCellDMActivesetCellTypesetChartsetCoarseDMsetCoarsensetCompositeTypesetComputeEigenvaluessetComputeOperatorssetComputeRHSsetComputeSingularValuessetConesetConeOrientationsetConeSizesetConstraintDofsetConstraintIndicessetConstraintTolerancessetConstraintssetConvergedReasonsetConvergenceHistorysetConvergenceTestsetCoordinateDMTypesetCoordinateDimsetCoordinateDiscsetCoordinateNamesetCoordinatessetCoordinatesLocalsetCostGradientssetCreateDomainDecompositionsetCreateDomainDecompositionScatterssetCreateFieldDecompositionsetCreateGlobalVectorsetCreateInjectionsetCreateInterpolationsetCreateLocalVectorsetCreateMatrixsetCreateRestrictionsetCreateSubDMsetCurrentsetDIRKTypesetDMsetDMActivesetDSsetDefaultCommsetDefaultGlobalSectionsetDefaultLocalSectionsetDefaultSFsetDefaultSectionsetDefaultTypesetDefaultValuesetDeflationCoarseMatsetDeflationCorrectionFactorsetDeflationInitOnlysetDeflationLevelssetDeflationProjectionNullSpaceMatsetDeflationReductionFactorsetDeflationSpacesetDeflationSpaceToComputesetDegreesetDenseLDAsetDevicesetDiagonalsetDimsetDimensionsetDiscretisationsetDivergenceTolerancesetDofsetDrawInfosetDualSpacesetElementTypesetEqualityConstraintssetEquationTypesetErrorIfNotConvergedsetErrorIfStepFailssetEvaluationTimessetEventHandlersetEventTolerancessetExactFinalTimesetFASInjectionsetFASInterpolationsetFASLevelss""etFASRScalesetFASRestrictionsetFaceQuadraturesetFactorLevelssetFactorOrderingsetFactorPivotsetFactorSetUpSolverTypesetFactorShiftsetFactorSolverTypesetFailedReasonsetFieldsetFieldAdjacencysetFieldComponentssetFieldConstraintDofsetFieldConstraintIndicessetFieldDofsetFieldNamesetFieldOffsetsetFieldSplitFieldssetFieldSplitISsetFieldSplitSchurFactTypesetFieldSplitSchurPreTypesetFieldSplitTypesetFileModesetFileNamesetForceIterationsetFromOptionssetFunctionsetFunctionNormsetFunctionTolerancessetGAMGLevelssetGAMGSmoothssetGAMGTypesetGASMOverlapsetGASMTypesetGMRESRestartsetGlobalSectionsetGlobalSizessetGlobalToLocalsetGlobalToLocalVecScattersetGlobalVectorsetGradientsetGradientNormsetGraphsetHPDDMAuxiliaryMatsetHPDDMCoarseCorrectionTypesetHPDDMDeflationMatsetHPDDMHasNeumannMatsetHPDDMRHSMatsetHPDDMTypesetHYPREAMSSetInteriorNodessetHYPREDiscreteCurlsetHYPREDiscreteGradientsetHYPRESetAlphaPoissonMatrixsetHYPRESetBetaPoissonMatrixsetHYPRESetEdgeConstantVectorssetHYPRESetInterpolationssetHYPRETypesetHessiansetI2FunctionsetI2JacobiansetIFunctionsetIJacobiansetIJacobianPsetISAllowRepeatedsetISLocalMatsetISPreallocationsetIdentitysetIndicessetInequalityConstraintssetInitialsetInitialGuesssetInitialGuessKnollsetInitialGuessNonzerosetInitialStepLengthsetInitialTrustRegionRadiussetInterpolationTypesetIntervalsetIterationNumbersetJacobiansetJacobianDesignsetJacobianEqualitysetJacobianInequalitysetJacobianResidualsetJacobianStatesetKSPsetKSPComputeOperatorssetLGMapsetLMVMH0setLMVMJ0setLMVMJ0KSPsetLMVMMatsetLRCMatssetLabelOutputsetLabelValuesetLagrangeContinuitysetLagrangeTensorsetLagrangeTrimmedsetLineSearchsetLineSearchPreChecksetLinearFitInterceptsetLinearTypesetLinearUseKSPsetLocalSectionsetLocalSizessetLocalToGlobalsetLocalToGlobalVecScattersetLocalToLocalsetLocalToLocalVecScattersetLocalVectorsetMGCycleTypesetMGCycleTypeOnLevelsetMGInterpolationsetMGLevelssetMGRsetMGRScalesetMGRestrictionsetMGRhssetMGTypesetMGXsetMPIGhostsetMatClosuresetMatTypesetMatrixsetMaxFunctionEvaluationsset""MaxKSPFailuressetMaxLinearSolveFailuressetMaxNonlinearStepFailuressetMaxSNESFailuressetMaxStepFailuressetMaxStepRejectionssetMaxStepssetMaxTimesetMaximumFunctionEvaluationssetMaximumIterationssetMigrationSFsetMonitorsetMumpsCntlsetMumpsIcntlsetNGSsetNPCsetNPCSidesetNamesetNearNullSpacesetNestSubVecssetNestVecTypesetNewtonALCorrectionTypesetNewtonALFunctionsetNormSchedulesetNormTypesetNullSpacesetNumComponentssetNumFieldssetNumVariablessetObjectivesetObjectiveGradientsetOffsetsetOperatorssetOptionsetOptionsHandlersetOptionsPrefixsetOrdersetOwnershipRangessetPCsetPCSidesetPTrimmedFormDegreesetParamsEWsetPartitionersetPatchCellNumberingsetPatchComputeFunctionsetPatchComputeFunctionInteriorFacetssetPatchComputeOperatorsetPatchComputeOperatorInteriorFacetssetPatchConstructTypesetPatchDiscretisationInfosetPeriodicitysetPermutationsetPointCoordinatessetPointCoordinatesCellwisesetPointPointssetPointSFsetPointsUniformCoordinatessetPolynomialTensorsetPostSolvesetPostStepsetPreSolvesetPreStepsetPreallocationCOOsetPreallocationCOOLocalsetPreallocationCSRsetPreallocationDensesetPreallocationNNZsetProblemTypesetProcSizessetPythonContextsetPythonTypesetQuadraturesetRHSFunctionsetRHSJacobiansetRHSJacobianPsetRHSSplitIFunctionsetRHSSplitIJacobiansetRHSSplitISsetRHSSplitRHSFunctionsetRKTypesetRandomsetRankOrdersetRefinesetRefineLevelsetRefinementFactorsetRefinementLimitsetRefinementUniformsetRegularizerWeightsetResetCounterssetResidualsetResidualNormsetReusePreconditionersetSNESFunctionsetSNESJacobiansetSPAIBlockSizesetSPAICacheSizesetSPAIEpsilonsetSPAIMaxsetSPAIMaxNewsetSPAINBStepssetSPAISpsetSPAIVerbosesetSaveTrajectorysetSectionsetSectionSFsetSeedsetShellPartitionsetSimpleDimensionsetSimpleFunctionalsetSizessetSolutionsetSolution2setSolutionTemplatesetSparseLocalizesetStateDesignISsetStencilsetStencilTypesetStencilWidthsetStepLimitssetStepNumbersetStratumISsetStreamTypesetStridesetSumConcatenatesetSumNumSubspacessetSumSubspacesetSupportsetSupportSizesetTRTolerancessetTRUpdateParam""eterssetTabLevelsetTensorNumSubspacessetTensorSubspacesetTetGenOptionssetThetasetThetaEndpointsetTileSizessetTimesetTimeSpansetTimeStepsetTimestepsetTolerancessetTransposeNullSpacesetTransposePrecursorsetTriangleOptionssetTypesetUnfactoredsetUniformCoordinatessetUniformCoordinatesExplicitsetUniformCoordinatesProductsetUpsetUpMatricessetUpOnBlockssetUpdatesetUseAmatsetUseEWsetUseFDsetUseFischerGuesssetUseKSPsetUseMFsetUseNaturalsetValuesetValueBlockedStagStencilsetValueBlockedStencilsetValueLocalsetValueStagStencilsetValueStencilsetValuessetValuesBlockedsetValuesBlockedCSRsetValuesBlockedIJVsetValuesBlockedLocalsetValuesBlockedLocalCSRsetValuesBlockedLocalIJVsetValuesBlockedLocalRCVsetValuesBlockedRCVsetValuesCOOsetValuesCSRsetValuesIJVsetValuesLocalsetValuesLocalCSRsetValuesLocalIJVsetValuesLocalRCVsetValuesRCVsetValuesStagStencilsetVariableBlockSizessetVariableBoundssetVecClosuresetVecTypesetVisible__set_name__setdefault__setstate____setstate_cython__setupsfsfMigrationsfNaturalOldsf_typesfxcshapeshape_arrshape_stridesshiftshift_typeshiftamountshifttypesidesimplexsissizesizesskipsleepslocslotsmaxsminsmoothsmoothssnessnes_typesneslssolsollistsolssolvesolveAddsolveBackwardsolveForwardsolveStepsolveTransposesolveTransposeAddsolversortsortGetAccesssortGetIsValidsortGetNumberOfPointsPerCellsortGetPointsPerCellsortGetSizessortRestoreAccesssortypespspNewspaceDimspace_typespacedimsparseLocalizesplitsplitOwnershipsplitnamesqrtabsssizestagestageidstarstartstartsstartswithstatestateGetstateIncreasestateSetstaticmethodstaticpropertystaticproperty.__get__stderr__stderr__stdout__stdout___stdout_is_stderrstencil_typestencil_widthstenciltypestepstepTransposestep_numbersteplenstolstopstoreValues__str__strstratastratifystratumstratumHasPointstreamstream_typestrideGatherstrideMaxstrideMinstrideNormstrideScalestrideScatterstrideSumstridesstrides_arrstringstripstructstructurestypesubsubcomm_subcommsubctxssubdmsubkspsubmatsubmatssubminorsubsolversubspsubspaceOffsetssubtractASCIITabsubvec""sumsuppsvalsval1sval2svalssvalueswswapswidthsxsymsymmsymmetricsymmetrizesyncFlushsyncPrintsynchronizesystt1t2tDottDotBegintDotEndtabtabstaotao_almm_typetao_typetargetComplexitytargstblinetblisttcmptdimtemptensortermterm_typeterminatetestthetathresholdtimetime_steptimesteptitletoAlltoDLPacktoGeneraltoZerotoindxtol_toltolisttolrtompi4pytopologyLoadtopologyViewtr_type_tracebacktracebacktranstransposetransposeMatMulttrimmedtsts_typetsadapttspantsteptvaltwisttyp__type_registry__typenumtypestruuCuCluNuauauxuisuniformuninterpolateunionunitunnamedunpackunusedunused1unused2unused3unusedaunusedbunusedcunusedrupup_leftup_rightupdateupdateLMVMupperuseuseASCIITabsuseAnchorsuseClosureuseConeuseInitialGuessuseNaturaluseTAORoutine_useusedusekspuvecvval_valvalsvaluevaluesvarboundsvatolvclvecvecvecGetClosurevecTovec_fromvec_index_isesvec_tovec_typeveclvecmvecrvecsvecslvecsrvectorDefineFieldvectorsverbosityversionvertexCoordsvgviennaclvechandleviewviewFieldsXDMFviewFromOptionsviewObjectviewObjectPythonviewXDMFviewervlvlgvmvmatvnvolvrvrtolvstrvtolvtolrvtypevwrvwr_typewwaitForwaxpywctimeweightwidthwrapped_funcwrapswritexx_vecxdiffxdotxdotdotxlxmax_xmaxxmin_xminxnormxsxtxuxvecxyzyymax_ymaxymin_yminynormzzeroEntrieszeroRowszeroRowsColumnszeroRowsColumnsLocalzeroRowsColumnsStencilzeroRowsLocalzeropivotzerorowszmax_zmaxzmin_zminzozzzozzo_vecAO (PyObject *)\000DM (PyObject *)\000DMLabel (PyObject *)\000DMSwarmCellDM (PyObject *)\000IS (PyObject *)\000ISLocalToGlobalMapping (PyObject *)\000KSP (PyObject *)\000MPI_Comm (PyObject *)\000MPI_Comm (PyObject *, MPI_Comm)\000MPI_Comm (void)\000MPI_Comm *(PyObject *)\000Mat (PyObject *)\000MatPartitioning (PyObject *)\000PC (PyObject *)\000PetscDS (PyObject *)\000PetscDevice (PyObject *)\000PetscDeviceContext (PyObject *)\000PetscDualSpace (PyObject *)\000PetscErrorCode (PetscErrorCode)\000PetscErrorCode (int)\000PetscFE (PyObject *)\000PetscObject (PyObject *)\000PetscObject *(PyObject *)\000PetscPartitioner (PyObject *)\000PetscQuadrature (PyObject"" *)\000PetscRandom (PyObject *)\000PetscRegressor (PyObject *)\000PetscSF (PyObject *)\000PetscSection (PyObject *)\000PetscSpace (PyObject *)\000PetscViewer (PyObject *)\000PyObject *(AO)\000PyObject *(DM)\000PyObject *(DMLabel)\000PyObject *(DMSwarmCellDM)\000PyObject *(IS)\000PyObject *(ISLocalToGlobalMapping)\000PyObject *(KSP)\000PyObject *(MPI_Comm)\000PyObject *(Mat)\000PyObject *(MatPartitioning)\000PyObject *(PC)\000PyObject *(PetscDS)\000PyObject *(PetscDualSpace)\000PyObject *(PetscFE)\000PyObject *(PetscObject)\000PyObject *(PetscPartitioner)\000PyObject *(PetscQuadrature)\000PyObject *(PetscRandom)\000PyObject *(PetscRegressor)\000PyObject *(PetscSF)\000PyObject *(PetscSection)\000PyObject *(PetscSpace)\000PyObject *(PetscViewer)\000PyObject *(SNES)\000PyObject *(SNESLineSearch)\000PyObject *(TS)\000PyObject *(Tao)\000PyObject *(TaoLineSearch)\000PyObject *(TaoTerm)\000PyObject *(Vec)\000PyObject *(VecScatter)\000PyTypeObject *(int)\000SNES (PyObject *)\000SNESLineSearch (PyObject *)\000TS (PyObject *)\000Tao (PyObject *)\000TaoLineSearch (PyObject *)\000TaoTerm (PyObject *)\000Vec (PyObject *)\000VecScatter (PyObject *)\000int (PetscErrorCode)\000int (int, PyTypeObject *)\000struct PyPetscDeviceContextObject *(PetscDeviceContext)\000struct PyPetscDeviceObject *(PetscDevice)\000PyPetscAO_Get\000PyPetscDM_Get\000PyPetscDMLabel_Get\000PyPetscDMSwarmCellDM_Get\000PyPetscIS_Get\000PyPetscLGMap_Get\000PyPetscKSP_Get\000PyPetscComm_Get\000GetComm\000GetCommDefault\000PyPetscComm_GetPtr\000PyPetscMat_Get\000PyPetscMatPartitioning_Get\000PyPetscPC_Get\000PyPetscDS_Get\000PyPetscDevice_Get\000PyPetscDeviceContext_Get\000PyPetscDualSpace_Get\000CHKERR\000CHKERRMPI\000PyPetscFE_Get\000PyPetscObject_Get\000PyPetscObject_GetPtr\000PyPetscPartitioner_Get\000PyPetscQuad_Get\000PyPetscRandom_Get\000PyPetscRegressor_Get\000PyPetscSF_Get\000PyPetscSection_Get\000PyPetscSpace_Get\000PyPetscViewer_Get\000PyPetscAO_New\000PyPetscDM_New\000PyPetscDMLabel_New\000PyPetscDMSwar""mCellDM_New\000PyPetscIS_New\000PyPetscLGMap_New\000PyPetscKSP_New\000PyPetscComm_New\000PyPetscMat_New\000PyPetscMatPartitioning_New\000PyPetscPC_New\000PyPetscDS_New\000PyPetscDualSpace_New\000PyPetscFE_New\000PyPetscObject_New\000PyPetscPartitioner_New\000PyPetscQuad_New\000PyPetscRandom_New\000PyPetscRegressor_New\000PyPetscSF_New\000PyPetscSection_New\000PyPetscSpace_New\000PyPetscViewer_New\000PyPetscSNES_New\000PyPetscSNESLineSearch_New\000PyPetscTS_New\000PyPetscTAO_New\000PyPetscTAOLineSearch_New\000PyPetscTAOTerm_New\000PyPetscVec_New\000PyPetscScatter_New\000PyPetscType_Lookup\000PyPetscSNES_Get\000PyPetscSNESLineSearch_Get\000PyPetscTS_Get\000PyPetscTAO_Get\000PyPetscTAOLineSearch_Get\000PyPetscTAOTerm_Get\000PyPetscVec_Get\000PyPetscScatter_Get\000PyPetscError_Set\000PyPetscType_Register\000PyPetscDeviceContext_New\000PyPetscDevice_NewT{-^:}\320\004 \240\001\360\024\000\t\036\320\0350\3200C\3001\330\010\032\230!\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\016\210a\320\017#\2401\240D\250\005\250Q\250g\260Q\260g\270Q\270a\330\010\017\210z\230\021\230%\230w\240g\250Q\320\0040\3200F\300a\360$\000\t0\320/B\300!\3001\330\010\016\210a\320\017'\240q\250\004\250E\260\021\320\0040\3200L\310A\360\036\000\t4\2601\330\010\016\210a\320\017+\2501\250D\260\005\260Q\320\004\034\320\0340\3200@\300\001\360\"\000\t\032\230\032\2403\240a\240z\260\021\330\010\031\230\021\330\010\036\230a\330\010\032\230!\330\010\035\230X\240Q\240g\250Q\250e\2606\270\030\300\021\300!\330\010\014\210G\2209\230A\330\014\r\210Q\210f\220G\2304\230q\240\004\240A\330\010\016\210h\220a\220u\230A\230T\240\021\240!\330\010\014\210C\210s\220%\220v\230Z\240q\330\r\016\330 %\240Q\240e\2505\260\001\260\021\330\010\016\210a\210z\230\021\230$\230f\240D\250\003\2501\330\010\017\210q\320\004\036\320\0360\260\001\360\036\000\t$\2401\330\010!\240\021\330\010+\2501\330\010.\250a\330\010\021\220\030\230\021\230(\240!\240;\250a\250q\330\010\016\210a\210}\230A\230T\240\025\240k\260\031\270!\320;N\310a""\310q\330\010\t\330\014\023\2207\230!\320\033.\250a\340\014\022\220!\320\023$\240A\240T\250\025\250k\270\031\300!\320CV\320VW\320WX\320\0040\260\010\270\001\360\036\000\t%\240E\250\021\250!\330\010\016\210a\320\017.\250a\250t\2608\2701\320\0040\260\001\360\036\000\t\033\230#\230Q\330\010\016\210a\320\017'\240q\250\004\250F\260!\2601\330\010\016\210a\210z\230\021\230#\230Q\320\004)\250\030\260\021\3600\000\t\036\230U\240!\2401\330\010\016\210a\210\177\230a\230t\2405\250\001\320\0040\260\t\270\021\360\036\000\t&\240V\2501\250A\330\010\016\210a\320\0172\260!\2604\260|\3001\320\0040\260\t\270\021\340\010\030\230\001\230\024\230V\2403\240c\250\023\250F\260#\260Q\320\0040\260\001\360\036\000\t\017\210a\320\017\"\240!\2404\240u\250F\260!\320\0040\260\001\360 \000\t\017\210a\320\017$\240A\240T\250\025\250f\260A\320\0040\260\001\360\036\000\t\017\210a\320\017(\250\001\250\024\250U\260!\2601\320\0040\260\001\360\036\000\t\017\210a\320\017&\240a\240t\2505\260\003\2601\320\0040\260\001\360\024\000\t\017\210a\320\017)\250\021\250$\250f\260A\260Q\320\0040\260\001\360\024\000\t\017\210a\320\017'\240q\250\004\250F\260#\260Q\320\0040\260\n\270!\360 \000\t\037\230f\240A\240Q\330\010\016\210a\320\017/\250q\260\004\260E\270\021\320\0040\260\006\260f\270A\360\024\000\t\036\230U\240!\2401\330\010\016\210a\320\017!\240\021\240$\240f\250C\250q\260\004\260G\2701\320\0040\260\001\360(\000\t \230q\330\010\016\210a\320\017'\240q\250\003\2506\260\021\260!\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004!\240\021\360\024\000\t0\250q\330\010\016\210a\320\017\"\240!\2404\240w\250a\250q\330\010\017\210q\320\004!\240\027\250\n\260!\360\036\000\t\014\2101\330\014\023\220>\240\021\240!\340\014\023\220>\240\021\240!\320\004\035\320\0351\3201A\300\021\360\"\000\t\032\230\032\2403\240a\240z\260\021\330\010\031\230\021\330\010\036\230a\330\010\032\230!\330\010\035\230X\240Q\240g\250Q\250e\2606\270\030\300\021\300!\330\010\014\210G\2209\230A\330\014\r\210Q\210f\220G\2304""\230q\240\004\240A\330\010\016\210h\220a\220u\230A\230T\240\021\240!\330\010\014\210C\210s\220%\220v\230Z\240q\330\r\016\330 %\240Q\240e\2505\260\001\260\021\330\010\016\210a\210{\230!\2304\230v\240T\250\023\250A\330\010\017\210q\320\0041\3201B\300)\3101\360*\000\t$\2401\330\010\036\230a\330\010\013\2106\220\027\230\006\230i\240u\250A\330\010\013\2107\220#\220V\2309\240C\240q\330\010\013\2106\220\025\220c\230\026\230x\240q\330\010\016\210a\320\017!\240\021\240$\240f\250E\260\027\270\001\330\")\250\021\250&\260\001\330\010\017\210q\320\004\037\320\0371\3201C\300;\310f\320TZ\320Z[\360\030\000\t\016\210Q\210e\2205\230\001\230\025\230e\2401\240E\250\021\330\010\017\210q\220\005\220W\230A\230U\240'\250\021\250%\250q\330\010\017\210v\220Q\220f\230A\230U\240!\2404\240q\250\005\250Q\250d\260!\2605\270\001\270\021\330\010\017\210u\220A\220Q\330\010\013\2107\220'\230\021\330\014\022\220!\2206\230\021\230'\240\021\240$\240a\240w\250a\250t\2601\260G\2701\270A\330\010\016\210a\210}\230A\230T\240\026\240v\250W\260I\270Q\320 1\3201E\300Q\320\0041\3201L\310H\320TU\360$\000\t6\260Q\330\010$\240E\250\021\250!\330\010\016\210a\320\017-\250Q\250d\260%\260}\300A\320\004#\2401\3602\000\t\033\230!\330\010\034\230I\240Y\250i\260q\330\010.\250a\330\010\016\210a\320\017#\2401\240D\250\006\250a\250q\330$%\240V\2501\250G\2601\260G\2701\270A\330$%\240Q\330\010\020\220\005\220Q\220f\230F\240!\2401\330\020\026\220a\220x\230v\240Q\240a\330\020\026\220a\220x\230q\200\001\330\004\022\220!\2201\220A\320\004*\250/\270\021\360\036\000\t!\240\001\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\320\017#\2401\240D\250\005\250Q\320\004\"\240'\250\032\2601\360L\001\000\t\014\2101\330\014\023\220?\240!\2401\340\014\023\220?\240!\2401\320\004+\320+;\2701\360\036\000\t+\250)\2601\260A\330\010\016\210a\320\017!\240\021\240$\240e\2501\320\004\037\320\0371\260\021\360\036\000\t!\240\001\330\010\022\220)\2301\230I\240Q\240a\330\010\035\230Q\330\010\016\210a\210y\230\001\230\024\230U\240&\250\001\250\021\330""\010\025\220T\230\032\2401\240F\250!\330\010\n\210&\220\001\330\010\017\210q\320\004\037\320\0371\260\021\360&\000\t!\240\001\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\210y\230\001\230\024\230U\240!\320\004\037\320\0371\260\021\360\036\000\t!\240\001\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\210y\230\001\230\024\230W\240A\320\004\032\230)\2401\360\036\000\t\034\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\016\210a\210w\220a\220t\2305\240\001\320\004 \240\001\330\0301\260\021\330\0311\260\031\270!\360&\000\t\014\2107\220'\230\021\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220x\230v\240Q\330\014\020\220\t\230\021\230.\250\001\330\014\022\220!\220=\240\001\240\024\240W\250A\340\014\020\220\t\230\021\230.\250\001\330\014\022\220!\220=\240\001\240\024\240W\250A\320\0041\260\027\270\n\300!\360$\000\t\014\2101\330\014\022\220!\320\023(\250\001\250\024\250V\2604\260q\340\014\022\220!\320\023$\240A\240T\250\026\250t\2601\320\004(\320(;\2701\360&\000\t1\260\001\330\010\016\210a\320\017\"\240!\2404\240u\250A\320\0041\260\032\2701\360\036\000\t\"\240\030\250\021\250!\330\010\016\210a\320\017-\250Q\250d\260%\260q\320\004#\2401\360\026\000\t$\2401\330\010\016\210a\320\017&\240a\240t\2505\260\001\260\021\330\010\017\210v\220Q\220a\320\004\033\2301\360\030\000\t!\240\013\2501\330\010\016\210a\320\017\037\230q\240\004\240J\250a\250y\270\001\270\021\330\010\017\210u\220A\220Z\230u\240A\240Q\320\004%\320%:\270)\3001\360(\000\t\033\230!\340\010\032\230'\240\021\330\010#\2401\340\010\016\210a\210z\230\021\230$\230e\2401\240A\330\010\013\210:\220W\230A\330\014\024\220M\240\021\240!\330\014\022\220!\320\023%\240Q\240d\250%\250q\330\010\t\330\014\022\220!\220?\240!\2404\240u\250A\250U\260!\2605\270\001\270\021\330\014\027\220w\230a\230s\240!\2405\250\001\330\014\024\220J\230e\2401\240F\250%\250q\260\001\340\014\022\220!\320\023&\240a\240t\2505\260\001\260\025\260a\260u\270A\270Q\330\010\017\210q\200\001""\340\004\023\2201\320\004\"\240)\2501\360\036\000\t\014\2102\210S\220\006\220d\230#\230Q\330\010\013\2101\210E\220\023\220A\330\014\022\220!\2209\230A\230T\240\026\240q\250\001\250\021\330\014\022\220!\220<\230q\240\001\240\026\240q\250\001\250\021\330\010\016\210a\320\017\037\230q\240\004\240G\2506\260\021\260&\270\001\270\021\270!\330\010\017\210q\320\004\"\240)\2501\360\036\000\t\014\2102\210S\220\006\220d\230#\230Q\330\010\013\2101\210E\220\023\220A\330\014\022\220!\220>\240\021\240$\240f\250A\250Q\250a\330\014\022\220!\220<\230q\240\001\240\026\240q\250\001\250\021\330\010\016\210a\320\017\037\230q\240\004\240F\250!\2506\260\021\330\010\017\210q\320\004\032\230)\2401\360\036\000\t\014\2102\210W\220A\330\014\022\220!\220>\240\021\240$\240f\250A\250Q\330\010\016\210a\210x\220q\230\004\230A\320\004#\2401\360\024\000\t2\260\021\330\010\016\210a\320\017&\240a\240t\2505\260\001\260\021\330\010\017\210q\200\001\330\004\005\330\004\013\210=\230\003\2301\320\004$\320$?\270|\3101\330\0323\260=\320@X\320Xa\320ab\360.\000\t\036\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\035\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\220:\230V\2401\330\010\014\210I\220Q\320\026&\240a\330\010\016\210a\320\017$\240A\240T\250\026\250v\260V\270>\310\027\320PQ\320\004#\2401\360\024\000\t\034\2304\230q\330\010\016\210a\320\017$\240A\240T\250\027\260\001\260\026\260q\330\010\016\210a\210{\230!\2306\240\021\330\010\017\210q\320\004\030\320\0301\260\031\270!\360(\000\t\014\2104\210s\220!\330\014\022\220!\220?\240!\2404\240v\250Q\330\r\027\220q\230\005\230Q\330\014\022\220!\220?\240!\2404\240w\250i\260t\2701\340\014\024\220I\230T\240\025\240c\250\021\330\014\022\220!\220?\240\"\240I\250T\260\024\260Q\260d\270$\270a\320\004 \240\t\250\021\360 \000\t$\2401\330\010\013\2104\210s\220&\230\006\230a\330\010\013\2103\210e\2203\220d\230!\330\014\024\220A\330\r\020\220\005\220S\230\001\330""\014\024\220A\340\014\024\220A\330\010\016\210a\210|\2301\230D\240\006\240g\250Q\250c\260\021\330\010\017\210q\320\004)\250\031\260!\360 \000\t$\2401\330\010\013\2104\210s\220&\230\006\230a\330\010\013\2103\210e\2203\220d\230!\330\014\024\220A\330\r\020\220\005\220S\230\001\330\014\024\220A\340\014\024\220A\330\010\016\210a\320\017$\240A\240T\250\026\250w\260a\260s\270!\330\010\017\210q\320\004\033\2301\360\024\000\t\014\2104\210v\220S\230\001\330\014\022\220*\230A\230Q\330\010 \240\001\330\010\016\210a\320\017!\240\021\240$\240g\250Q\250i\260q\330\010\031\230\024\230Q\230e\2401\330\010\014\210I\220Q\330\010\014\210I\220Q\330\010\014\210H\220D\230\001\330\010\017\210q\320\004#\2401\360\036\000\t\034\2307\240!\330\010\016\210a\320\017 \240\001\240\024\240Z\250r\260\025\260a\260s\270!\330\010\017\210q\320\004\033\2301\360\024\000\t\034\2307\240!\330\010\016\210a\320\017\037\230q\240\004\240J\250a\250s\260!\330\010\017\210q\320\004!\240\031\250!\360\036\000\t$\2401\330\010\013\2107\220'\230\026\230z\250\026\250q\330\010\016\210a\320\017)\250\021\250$\250f\260A\320\004!\240\031\250!\360\036\000\t$\2401\330\010\013\2107\220'\230\026\230z\250\026\250q\330\010\016\210a\320\017!\240\021\240$\240l\260!\320\004!\240\031\250!\360\036\000\t$\2401\330\010\013\2107\220'\230\026\230z\250\026\250q\330\010\016\210a\210v\220Q\220d\230'\240\021\320\004!\240\031\250!\360&\000\t$\2401\330\010\013\2107\220'\230\026\230z\250\026\250q\330\010\016\210a\210v\220Q\220d\230%\230q\320\004!\240\031\250!\360\036\000\t$\2401\330\010\013\2107\220'\230\026\230z\250\026\250q\330\010\016\210a\210v\220Q\220d\230%\230q\320\004!\240\031\250!\360\036\000\t$\2401\330\010\013\2107\220'\230\026\230z\250\026\250q\330\010\016\210a\210x\220q\230\004\230G\2401\320\004*\250/\270\021\360\024\000\t$\2401\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017%\240Q\240d\250&\260\001\320\004\033\2301\360&\000\t\034\2309\240H\250A\330\010\016\210a\210~\230Q\230d\240'\250\021\250!\330\010\016\210a\210\177""\230a\230t\2407\250!\2507\260!\2601\330\010\020\220\005\220Q\220g\230U\240!\2408\2505\260\001\260\021\320\004+\2501\360\024\000\t\035\230A\330\010\034\230A\330\010\035\230Q\330\010\016\210a\320\017 \240\001\240\024\240W\250C\250s\260#\260S\270\001\270\021\330\010\017\210u\220A\220Q\320\004#\2401\360\024\000\t\035\230A\330\010\016\210a\320\017#\2401\240D\250\006\250f\260A\260V\2706\300\026\300v\310Q\330\010\017\210v\220Q\220a\320\004\033\2301\360\024\000\t\035\230D\240\001\330\010\016\210a\320\017'\240q\250\004\250G\2601\260G\2701\330\010\017\210q\320\004:\270!\360&\000\t\034\2301\330\010\030\230\001\330\010!\240\021\330\010\014\210F\220)\2301\330\014\023\2209\230A\230V\2401\240A\330\014\022\220!\320\023$\240A\240T\250\025\250g\260U\270!\320\004*\250'\260\032\2701\360 \000\t%\240F\250!\2501\330\010\016\210a\210~\230Q\230d\240%\240q\320\004-\250]\270)\3001\360*\000\t\"\240\021\330\010\024\220I\230Q\230k\250\021\250!\330\010&\240a\330\010!\240\021\330\010\016\210a\320\017(\250\001\250\024\250U\260'\270\021\270/\310\021\310!\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210u\220A\220Q\320\004?\270|\3101\330$=\270]\320Jb\320bk\320kl\360\024\000\t\036\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\035\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\320\023(\250\006\250a\330\010\014\210I\220Q\320\0261\260\021\330\010\016\210a\320\017.\250a\250t\2606\270\026\270q\330/G\300w\310a\320\004#\2401\360\"\000\t\036\230Q\330\010\035\230Q\330\010\016\210a\320\017\"\240!\2404\240u\250A\250T\260\021\260!\330\010\017\210v\220Q\220e\2306\240\021\240!\320\004\033\2301\360\024\000\t&\240Q\330\010\035\230Q\330\010\016\210a\320\017)\250\021\250$\250l\270!\2701\330\010\016\210a\320\017&\240a\240t\250<\260q\270\001\330\010\017\210w\220a\220u\230B\230c\240\021\320\004+\2501\360\024\000\t\036\230Q\330\010\016\210a\320\0174\260A\260T\270\026\270q\300\001\330\010""\017\210u\220A\220Q\320\004\033\2301\360\"\000\t!\240\r\250Q\330\010\016\210a\320\017\"\240!\2404\240x\250q\260\t\270\021\270!\330\010\017\210u\220A\220Z\230u\240A\240Q\320\004#\2401\360\036\000\t&\240Q\330\010\016\210a\320\017*\250!\2504\250x\260q\270\001\330\010\017\210v\220Q\220a\320\004#\2401\360\024\000\t\036\230Q\330\010\016\210a\320\017,\250A\250T\260\027\270\001\270\021\330\010\017\210u\220A\220Q\320\004\033\2301\360\032\000\t\036\230Q\330\010 \240\001\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\001\330\010\016\210a\320\0174\260A\260T\270\025\270a\270q\330\010\033\2301\230I\240Q\240d\250!\2504\250t\2607\270)\3001\330\010\014\210G\2209\230A\330\014\022\220!\320\0230\260\001\260\021\260$\260a\260q\330\010\016\210a\210y\230\001\230\021\330\010\017\210q\320\004\033\2301\360\024\000\t\036\230Q\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\250!\330\010\025\220Z\230q\240\006\240a\330\010\n\210&\220\001\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004#\2401\360\024\000\t\032\230\024\230Q\330\010\016\210a\320\017'\240q\250\004\250E\260\021\260$\260a\330\010\016\210a\210{\230!\2304\230q\330\010\017\210q\320\004\033\2301\360>\000\t\020\210~\230Q\230a\320\0041\260\031\270!\360&\000\t\036\230Q\230m\2501\250A\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\016\210a\320\017 \240\001\240\024\240V\2501\250F\260&\270\001\320\0041\260\035\320>R\320R`\320`p\320p~\360\000\000\177\001H\002\360\000\000H\002I\002\3606\000\t&\240U\250!\2501\330\010*\250&\260\001\260\021\330\010#\2406\250\021\250!\330\010\"\240!\330\010\016\210a\320\017*\250!\2504\250u\260N\320BT\320T_\320_`\320`a\330\010\017\210v\220Q\220a\320\004\036\320\0361\260\035\320>R\320Rc\320cl\320lm\360.\000\t$\2401\330\010\021\220\031\230!\2308\2401\240A\330\010\035\230Q\330\010\032\230!\330\010\013\2107\220'\230\026\230t\2406\250\021\330\010\032\230!\330\010\013\2107\220'\230\026\230t\2406\250\021\330\010 \240\006\240a\240q\330\010\016\210a\210z\230\021\230$\230f\240I\250X\260U\270*\300C""\300q\320\004\033\2301\360\022\000\t\026\220S\230\001\330\010\016\210a\210|\2301\230D\240\006\240a\240q\250\001\330\010\016\210a\210{\230!\2301\230A\330\010\017\210q\320\0041\260\030\270\021\360\024\000\t\036\230U\240!\2401\330\010\016\210a\320\017/\250q\260\004\260F\270!\320\004\"\240/\260\021\360\036\000\t$\2401\330\010\025\220Y\230a\230|\2501\250A\330\010\016\210a\320\017 \240\001\240\024\240X\250Q\330\010\017\210q\320\004\037\320\0371\260\036\270|\310>\320Yb\320bc\360(\000\t \230x\240q\250\006\250a\330\010 \240\001\330\010\037\230q\330\010\037\230u\240A\240Q\330\010\016\210a\320\017\037\230q\240\007\240w\250h\260a\260q\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\000\020\220\013\2301\330\013\014\330\004\005\330\004\021\220\021\340\004\025\220Z\230q\240\006\240a\330\004\007\200w\210h\220a\340\004\005\330\004\021\220\031\230!\330\004\022\220(\230!\340\004\005\330\004\031\230\021\340\004\n\210)\2201\220A\320\004#\2401\360\"\000\t\017\210a\320\017 \240\001\240\024\240\\\260\021\260&\270\001\270\021\320\004\033\2301\360\024\000\t\017\210a\320\017#\2401\240D\250\001\320\004\033\2301\360\024\000\t\017\210a\210|\2301\230D\240\001\320\004+\2501\360\036\000\t\017\210a\320\017#\2401\240D\250\005\250Q\250a\320\004 \240\001\360\030\000\t!\240\013\2501\330\010\016\210a\320\017#\2401\240D\250\005\250Q\250d\260!\330\010\016\210a\210{\230!\2304\230q\330\010\017\210q\320\004#\2401\360\024\000\t\017\210a\210|\2301\230D\240\005\240R\240q\320\004\033\2301\360\024\000\t)\250\001\330\010\016\210a\320\017#\2401\240D\250\006\250a\250q\330\010\017\210q\320\004\033\2301\360\024\000\t!\240\001\330\010\016\210a\210|\2301\230D\240\006\240a\240q\330\010\017\210q\320\004#\2401\360\"\000\t\033\230(\240!\330\010\016\210a\320\017#\2401\240D\250\006\250a\250u\260A\260Q\330\010\020\220\005\220Q\220f\230E\240\021\240!\320\0041\260\021\360\"\000\t\017\210a\320\017#\2401\240D\250\006\250a\250v\260Q\260a\320\004)\250\021\360\036\000\t\034\2301\330\010\016\210a\320\017#""\2401\240D\250\007\250q\260\006\260a\260q\330\010\017\210v\220Q\220a\320\004-\250]\270)\3001\360\"\000\t\"\240\021\330\010\021\220\021\220&\230\001\230\021\330\010\016\210a\210{\230!\2302\230Q\330\010\013\2106\220\023\220A\330\014\022\220!\320\023,\250A\250T\260\025\260g\270Q\270b\300\001\340\014\022\220!\320\023'\240q\250\004\250E\260\021\260\"\260A\320\004#\2401\360\"\000\t\017\210a\320\017\"\240!\2404\240q\320\004\033\2301\360\024\000\t\017\210a\210{\230!\2304\230q\330\010\017\210q\320\004 \240\013\2501\360\024\000\t#\240!\330\010\016\210a\210{\230!\2304\230u\240A\320\004\033\2301\360\024\000\t#\240!\330\010\016\210a\210{\230!\2304\230u\240A\240Q\330\010\017\210q\320\004#\2401\360\032\000\t\033\230!\330\010\016\210a\320\017\"\240!\2404\240u\250A\250Q\330\010\017\210u\220A\220Q\320\004\033\2301\360\024\000\t#\240!\330\010\016\210a\210{\230!\2304\230u\240A\240Q\330\010\017\210y\230\001\230\021\320\0041\260\021\360\"\000\t\017\210a\320\017\"\240!\2404\240u\250A\250V\2601\260A\320\004)\250\021\360\036\000\t\034\2301\330\010\016\210a\320\017\"\240!\2404\240v\250Q\250f\260A\260Q\330\010\017\210v\220Q\220a\320\0041\260\021\360\024\000\t\017\210a\320\017\"\240!\2404\240v\250S\260\001\320\004#\2401\360\"\000\t!\240\001\330\010\016\210a\210{\230!\2304\230v\240S\250\006\250a\250q\320\004\033\2301\360\024\000\t#\240!\340\010\016\210a\320\017*\250!\2504\250w\260a\260q\330\010\017\320\017 \240\001\240\021\320\004\033\2301\360\024\000\t\017\210a\320\017$\240A\240T\250\021\320\004 \240\001\360\024\000\t\031\230\003\2301\330\010\016\210a\210}\230A\230T\240\026\240q\250\004\250F\260!\330\010\017\210q\320\004\"\240!\360(\000\t\032\230\022\2301\330\010\016\210a\320\017,\250A\330\014\020\220\006\220d\230'\240\021\240&\250\001\330\010\017\210q\320\004\033\2301\360\032\000\t'\240a\330\010\035\230Q\330\010\016\210a\320\017\"\240!\2404\240u\250A\250Q\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\250!\330\010\017\210w\220a\220v\230Q\320\004#\2401\360\036\000\t\"\240\021\330\010""\016\210a\320\017-\250Q\330\014\020\220\007\220q\230\001\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004\037\230|\2501\360\024\000\t\017\210a\210~\230Q\230d\240'\250\021\320\004\033\2301\360\024\000\t\033\230!\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\001\330\010\017\210u\220A\220Q\320\004\033\2301\360\024\000\t#\240!\330\010\016\210a\320\017%\240Q\240d\250&\260\001\260\021\330\010\017\210y\230\001\230\021\320\004!\240\021\360\024\000\t\031\230\003\2301\330\010\016\210a\320\017 \240\001\240\024\240U\250!\2504\250q\330\010\016\210a\210{\230!\2304\230q\330\010\017\210q\320\004!\240\021\360(\000\t \230{\250)\2601\330\010\016\210a\320\017(\250\001\250\024\250W\260A\260W\270A\270W\300A\300Q\330\010\020\220\006\220a\220x\230v\240Q\240h\250f\260A\260Q\320\004\031\230\021\360\024\000\t$\2401\330\010\016\210a\320\017 \240\001\240\024\240X\250Q\250a\330\010\017\210y\230\001\230\021\320\004\033\2301\340\010\016\210a\330\010\016\210a\320\0041\260\027\270\t\300\021\360$\000\t\037\230a\330\010\016\210a\320\017+\2501\250D\260\005\260Q\320\004\033\2301\360\036\000\t\037\230a\330\010\016\210a\210|\2301\230D\240\006\240a\240q\330\010\017\210v\220Q\220a\320\004 \240\013\2501\360\024\000\t\037\230a\330\010\016\210a\210|\2301\230D\240\006\240h\250a\250q\330\010\017\210v\220Q\220a\320\004*\250)\2601\360\022\000\t'\240a\330\010\016\210a\320\0172\260!\2604\260|\3001\320\004#\2401\360\024\000\t\037\230a\330\010\016\210a\320\017\"\240!\2404\240u\250A\250Q\330\010\017\210v\220Q\220a\320\004#\2401\360\024\000\t!\240\001\330\010\036\230a\330\010\016\210a\210{\230!\2304\230v\240S\250\006\250a\250v\260Q\260a\330\010\017\210x\220q\230\007\230v\240Q\240a\320\004\033\2301\360\024\000\t\037\230a\330\010\016\210a\210}\230A\230T\240\027\250\001\250\021\330\010\017\210v\220Q\220a\320\004\033\2301\360\024\000\t\033\230(\240!\330\010\036\230a\330\010\016\210a\320\017%\240Q\240d\250&\260\001\260\024\260Q\260a\330\010\033\2301\330\010\014\210G\2209\230A\330\014""\022\220'\230\021\230)\2401\240A\240Q\240a\330\010\017\210q\320\004\033\2301\360\024\000\t\037\230a\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\001\330\010\017\210v\220Q\220a\320\004'\240|\2601\360(\000\t\037\230a\330\010\016\210a\320\017 \240\001\240\024\240V\2501\250A\340\010\030\230\001\230\024\230V\2401\330\010\017\210q\320\004\033\2301\360\026\000\t\037\230a\330\010\016\210a\210\177\230a\230t\2405\250\001\250\021\330\010\017\210v\220Q\220a\320\004#\2401\360\030\000\t#\240!\330\010\016\210a\320\017&\240a\240t\2505\260\001\260\021\330\010\017\210v\220Q\220a\320\004+\2501\360\026\000\t+\250!\330\010\016\210a\320\017.\250a\250t\2605\270\001\270\021\330\010\017\210v\220Q\220a\320\004#\2401\360\024\000\t\"\240\021\330\010\016\210a\320\017.\250a\250t\260<\270q\300\001\330\010\017\210v\220Q\220a\320\004\"\240!\360\024\000\t\033\230!\330\010\033\2301\330\010\016\210a\320\017!\240\021\240$\240e\2501\250C\250v\260Q\260a\330\010\017\210q\220\007\220q\230\001\230\021\230$\230d\240'\250\030\260\021\320\004;\2701\360\036\000\t\017\210a\320\017)\250\021\250$\250e\2608\2701\320\004#\2401\360\026\000\t\017\210a\320\017/\250q\260\004\260A\320\004#\2401\360\024\000\t\017\210a\320\017'\240q\250\004\250A\320\004 \240\001\360\014\000\t\033\230!\330\010\033\2301\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\250#\250Q\250a\330\010\017\210q\220\007\220q\230\001\230\021\230$\230d\240'\250\030\260\021\320\004+\2501\360 \000\t\017\210a\320\017\037\230q\240\004\240E\250\026\250q\320\004+\2501\360$\000\t\017\210a\320\017'\240q\250\004\250H\260D\270\001\320\004*\250)\2601\360\"\000\t#\240&\250\001\250\021\330\010\016\210a\320\017/\250q\260\004\260L\300\001\320\004(\250\001\360\024\000\t\034\2301\330\010\036\230a\330\010'\240q\330\010\016\210a\320\017'\240q\250\004\250E\260\021\260$\260a\260x\270q\300\001\330\010\036\230a\330\010\013\2105\220\003\2201\330\014\026\220a\220w\230a\230t\2401\240D\250\004\250G\2609\270A\330\010\034\230G\2401\240D\250\001\330\010\017\210w\220a\320""\004#\2401\360\024\000\t\037\230a\230q\330\010\016\210a\320\017\037\230q\240\004\240F\250!\320\004\033\2301\360\024\000\t#\240$\240a\240u\250A\340\010\016\210a\320\017*\250!\2504\250w\260a\260t\2701\330\010\017\210q\320\004\033\230>\320);\2701\360&\000\t\"\240\030\250\021\250!\330\010!\240\030\250\021\250!\330\010\016\210a\210x\220q\230\004\230F\240'\250\027\260\001\260\021\320\004#\2401\360\024\000\t\017\210a\210z\230\021\230$\230g\240T\250\021\320\004#\2401\360\034\000\t\037\230b\240\001\330\010\016\210a\210|\2301\230D\240\006\240a\320\004#\2401\360\024\000\t\027\220c\230\031\240#\240Q\330\010\016\210a\320\017#\2401\240D\250\006\250a\250r\260\026\260q\270\002\270!\330\010\016\210a\210{\230!\2302\230X\240V\2501\250K\260q\270\002\270!\330\010\020\220\004\220A\320\004#\2401\360\024\000\t\027\220c\230\031\240#\240Q\330\010\016\210a\320\017&\240a\240t\2507\260!\2602\260V\2701\270B\270a\330\010\016\210a\210{\230!\2302\230X\240V\2501\250K\260q\270\002\270!\330\010\020\220\004\220A\320\004*\250)\2601\360\"\000\t\037\230f\240A\240Q\330\010\016\210a\320\017(\250\001\250\024\250U\260!\320\004\031\230\032\2401\360\036\000\t\037\230f\240A\240Q\330\010\016\210a\210y\230\001\230\024\230U\240!\320\0041\260\035\270h\300a\360\"\000\t\037\230a\330\010\037\230u\240A\240Q\330\010\030\230\006\230a\330\010\016\210a\320\017*\250!\2504\250u\260F\270&\300\010\310\001\310\025\310a\330\010\017\210q\320\004\032\230)\2401\360\036\000\t\037\230h\240a\240v\250Q\330\010+\2501\330\010\016\210a\320\017#\2401\240G\2501\250A\330\010\022\220!\2204\220w\230d\240-\250q\330\010\017\210q\320\004\032\230)\2401\360\036\000\t\037\230h\240a\240v\250Q\330\010+\2501\330\010\016\210a\320\017\"\240!\2407\250!\2501\330\010\016\210a\210z\230\021\230$\230h\240d\250)\2601\330\010\017\210q\320\004\032\230)\2401\360\036\000\t\037\230h\240a\240v\250Q\330\010'\240q\330\010\016\210a\210}\230A\230W\240A\240Q\330\010\016\210a\210z\230\021\230$\230h\240d\250+\260Q\330\010\017\210q\320\004#\2401\360\024\000\t\037\230k\250""\021\330\010\016\210a\320\017#\2401\240D\250\006\250a\250w\260a\260q\330\010\020\220\005\220Q\220h\230e\2401\240A\320\004(\320(:\270)\3001\360*\000\t \230q\330\010\013\210:\220S\230\001\360\006\000\r\026\220U\230!\2301\330\010\037\230q\330\010\013\210:\220S\230\001\360\006\000\r\026\220U\230!\2301\330\010\016\210a\210x\220q\230\004\230E\240\030\250\030\260\022\2601\320\004*\250)\2601\360,\000\t\"\240\026\240q\250\001\330\010\016\210a\320\017,\250A\250T\260\030\270\021\320\004\033\2301\360\024\000\t \230q\330\010\016\210a\320\017$\240A\240T\250\026\250q\260\001\330\010\017\210u\220A\220Q\320\004+\2501\360\026\000\t \230q\330\010\016\210a\320\017.\250a\250t\2605\270\001\270\021\330\010\017\210v\220Q\220a\320\004*\250)\2601\360.\000\t\"\240\026\240q\250\001\330\010\016\210a\320\017'\240q\250\004\250F\260!\320\004+\2501\360\036\000\t\030\220r\230\021\330\010\016\210a\320\017+\2501\250D\260\006\260a\260t\2701\330\010\017\210q\320\004\033\2301\360\030\000\t\030\220r\230\021\330\010\016\210a\210{\230!\2304\230w\240a\240t\2501\330\010\017\210q\320\004\033\2301\360\024\000\t\030\220s\230!\330\010\016\210a\210|\2301\230D\240\006\240a\240s\250!\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004#\2401\360\036\000\t\020\210s\220!\330\010\016\210a\320\017#\2401\240D\250\006\250a\250t\2601\330\010\017\210q\320\004#\2401\360\024\000\t\030\220s\230!\330\010\016\210a\320\017$\240A\240T\250\027\260\001\260\023\260A\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\033\2301\360\024\000\t\030\220s\230!\330\010\016\210a\210~\230Q\230d\240%\240q\250\003\2501\330\010\017\210q\320\004\033\2301\360\030\000\t\030\220s\230!\330\010\016\210a\320\017'\240q\250\004\250K\260q\270\003\2701\330\010\017\210q\320\004\033\2301\360\024\000\t\030\220t\2301\230E\240\021\330\010\016\210a\210{\230!\2304\230w\240a\240t\2501\330\010\017\210q\320\004\033\2301\360\024\000\t\020\210t\2209\230A\230Q\320\004\033\2301\340\010\017\210t\2209\230A\230Q\320\004\033\2301\360\032\000\t\033\230%""\230u\240E\250\025\250e\2605\270\001\330\010\016\210a\210z\230\021\230$\230e\2401\240A\330\010\016\210a\210~\230Q\230d\240!\330\036\037\230s\240!\2403\240a\240q\330\036\037\230s\240!\2403\240a\240q\330\010\020\220\001\220\025\220a\220t\2305\240\001\240\021\240!\2401\330\021\026\220a\220t\2305\240\001\240\021\240!\2401\330\021\026\220a\220t\2305\240\001\240\021\240!\2404\240r\250\034\260Q\320\004\033\2301\360\024\000\t \230y\250\001\330\010\016\210a\320\017&\240a\240t\250<\260q\270\005\270Q\320\004\036\320\0362\3202B\300!\360\"\000\t\032\230\032\2403\240a\240z\260\021\330\010\031\230\021\330\010\036\230a\330\010\032\230!\330\010\035\230X\240Q\240g\250Q\250e\2606\270\030\300\021\300!\330\010\014\210G\2209\230A\330\014\r\210Q\210f\220G\2304\230q\240\004\240A\330\010\016\210h\220a\220u\230A\230T\240\021\240!\330\010\014\210C\210s\220%\220v\230Z\240q\330\r\016\330 %\240Q\240e\2505\260\001\260\021\330\010\016\210a\210|\2301\230D\240\006\240d\250#\250Q\320\0042\3202H\310\001\360$\000\t\024\2201\220M\240\032\2501\250J\260i\270t\3001\300A\330\010\037\230s\240!\2401\330\010#\2401\330\010\035\230X\240Q\240g\250Q\250j\270\004\270F\300(\310!\3101\330\010\014\210G\2209\230C\230y\250\001\250\026\250u\260H\270A\270S\300\001\330\010\016\210a\320\017*\250!\2504\250u\260J\270c\300\021\320\0042\3202J\310)\320ST\360&\000\t#\240*\250A\250Q\330\010\016\210a\320\017#\2401\240D\250\005\250R\250v\260T\270\022\2701\330\010\016\210a\320\017#\2401\240D\250\005\250R\250v\260T\270\022\2701\320\0042\3202J\310)\320ST\360&\000\t#\240*\250A\250Q\330\010\016\210a\320\017#\2401\240D\250\005\250R\250v\260T\270\022\2701\330\010\016\210a\320\017!\240\021\240$\240e\2502\250V\2604\260r\270\021\320\0042\3202J\310)\320ST\360&\000\t#\240*\250A\250Q\330\010\016\210a\320\017\"\240!\2404\240u\250B\250f\260D\270\003\2701\330\010\016\210a\320\017\"\240!\2404\240u\250B\250f\260D\270\003\2701\320\0042\3202M\310Q\360\024\000\t\017\210a\320\017,\250A\250T\260\027\270\001\320\004'\240{\3202C\300<\310y\320XY\360(\000""\t\033\230!\330\010\013\2102\210W\220A\330\014\020\220\001\220\021\330\010\033\2305\240\001\240\021\330\010\013\2105\220\003\2201\330\014\022\220!\320\023+\2501\250D\260\006\260d\270!\2701\330\r\022\220#\220Q\330\014\022\220!\320\023/\250q\260\004\260F\270$\270a\270q\340\014\022\220!\320\0230\260\001\260\024\260V\2704\270q\300\001\330\010\013\2102\210W\220A\330\014\022\220!\220:\230Q\230a\230q\320\004 \240\001\3602\000\t\036\320\0350\260\001\330\010\016\210a\210x\220q\230\004\230G\2401\240A\330\010\016\210a\210x\220q\230\004\230G\2401\240A\330\010\026\220b\230\001\330\010\013\2105\220\002\220+\230T\240\025\240b\250\001\330\014\022\220!\2205\230\001\230\024\230W\240D\250\007\250q\260\003\2601\340\014\022\220!\2208\2301\230D\240\007\240t\2507\260!\2603\260a\330\010\017\210q\320\004!\320!2\260!\360&\000\t#\240!\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\210{\230!\2304\230u\240A\320\0042\260)\2701\360$\000\t%\240F\250!\2501\330\010\016\210a\320\017\"\240!\2404\240u\250A\250V\2601\320\0042\260)\2701\360&\000\t\036\230Q\230m\2501\250A\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\016\210a\320\017\"\240!\2404\240w\250a\250v\260V\2701\320\0042\260)\2701\360&\000\t\036\230Q\230m\2501\250A\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\016\210a\320\017!\240\021\240$\240f\250A\250V\2606\270\021\320\0042\260*\270A\360\"\000\t\037\230f\240A\240Q\330\010\016\210a\320\017'\240q\250\004\250E\260\021\320\0042\260*\270A\360\024\000\t\"\240\026\240q\250\001\330\010\016\210a\320\017-\250Q\250d\260&\270\001\320\0042\260+\270\\\310\031\320RS\340\010\013\2105\220\004\220F\230(\240!\330\010\013\2106\220\023\220F\230(\240!\340\010\013\2104\210t\2202\320\025(\250\t\260\022\3203F\300g\310T\320QZ\320Z]\320]^\330\014\022\220*\230A\230Q\330\010\013\2109\220G\2301\330\014\027\220z\240\026\240q\340\014\026\220a\330\010\014\210I\220Q\320\0269\270\021\330\010\016\210a\320\017&\240a\240t\2505\260\005\3205T\320T[\320[\\\320\0042\260+\270\\\310\031\320RS\340\010\013\2105\220""\004\220F\230(\240!\330\010\013\2106\220\023\220F\230(\240!\340\010\013\2104\210t\2202\320\025(\250\t\260\022\3203F\300g\310T\320QZ\320Z]\320]^\330\014\022\220*\230A\230Q\330\010\013\2109\220G\2301\330\014\027\220z\240\026\240q\340\014\026\220a\330\010\014\210I\220Q\320\0269\270\021\330\010\016\210a\320\017(\250\001\250\024\250W\260E\3209X\320X_\320_`\320\0042\260!\360\"\000\t\017\210a\320\017#\2401\240D\250\005\250Q\250f\260A\260Q\320\0042\260!\360 \000\t\017\210a\320\017#\2401\240D\250\005\250T\260\021\320\0042\260!\360\"\000\t\017\210a\320\017$\240A\240T\250\026\250q\260\006\260a\260q\320\004&\320&@\300\001\360\036\000\t2\260\021\330\010\016\210a\320\017&\240a\240t\2505\260\001\330\010\t\320\004 \320 2\260!\360\036\000\t\"\240\021\330\010\"\240!\330\010\021\220\030\230\021\230(\240!\240;\250a\250q\330\010\016\210a\320\017\037\230q\240\004\240J\250k\270\021\320\004\"\320\"2\260(\270!\360\"\000\t \230u\240A\240Q\330\010!\240\021\330\010\024\220I\230Q\230k\250\021\250!\330\010\016\210a\320\017'\240q\250\004\250F\260(\270!\320\0043\2601\360\036\000\t$\320#4\260A\260Q\340\010\016\210a\320\017*\250!\2504\250w\260a\320\004\036\320\0363\2601\360\024\000\t\025\220A\220V\2301\320\0043\2601\360\"\000\t\017\210a\320\017$\240A\240T\250\025\250a\250v\260Q\260a\320\004 \320 3\2601\360\024\000\t\017\210a\320\017%\240Q\240d\250&\260\010\270\001\270\021\320\0043\2601\360\036\000\t\017\210a\320\017(\250\001\250\024\250U\260%\260q\320\0043\2601\360\024\000\t\017\210a\320\017&\240a\240t\2507\260\"\260F\270\"\270A\320\0043\2601\360\036\000\t\017\210a\320\017)\250\021\250$\250e\2603\260a\320\0043\2601\360\036\000\t\017\210a\320\017)\250\021\250$\250e\2604\260q\320\0043\2601\360\036\000\t\017\210a\320\017\037\230q\240\004\240F\250%\250q\320\0043\2601\360(\000\t \230q\330\010\016\210a\320\017*\250!\2503\250f\260A\260Q\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004\"\320\"3\2601\360\024\000\t \230u\240A\240Q\330\010\016\210a\320\017\037\230q\240\004""\240G\2508\2603\260a\320\004\037\320\0373\3203C\3001\360\"\000\t\032\230\032\2403\240a\240z\260\021\330\010\031\230\021\330\010\036\230a\330\010\032\230!\330\010\035\230X\240Q\240g\250Q\250e\2606\270\030\300\021\300!\330\010\014\210G\2209\230A\330\014\r\210Q\210f\220G\2304\230q\240\004\240A\330\010\016\210h\220a\220u\230A\230T\240\021\240!\330\010\014\210C\210s\220%\220v\230Z\240q\330\r\016\330 %\240Q\240e\2505\260\001\260\021\330\010\016\210a\210}\230A\230T\240\026\240t\2503\250a\320\004\036\320\0363\3203J\320J_\320_h\320hi\360&\000\t\020\210|\2301\230D\240\006\240f\250F\260!\320\0043\2607\270)\3001\360(\000\t \230v\240Q\240a\330\010\016\210a\320\017)\250\021\250$\250f\260G\2701\270A\320\0043\2607\270.\310\t\320QR\360*\000\t!\240\001\330\010\034\230A\330\010\013\2104\210w\220f\230G\2403\240a\330\010\016\210a\320\017%\240Q\240d\250%\250s\260&\270\010\300\001\320\0043\2608\2701\360\024\000\t\034\2301\330\010\033\2301\330\010\035\230U\240!\2401\330\010\016\210a\320\017 \240\001\240\024\240W\250C\250s\260#\260S\270\001\320\0043\2608\2701\360\036\000\t(\240u\250A\250Q\330\010\016\210a\320\017.\250a\250t\2608\2701\320\0043\2609\270A\360\036\000\t\036\230Q\330\010\013\2104\210w\220f\230G\2403\240a\330\010\016\210a\320\017*\250!\2504\250u\260A\320\004!\320!3\2609\270A\360\036\000\t*\250\034\260Q\260a\330\010\016\210a\320\017\037\230q\240\004\240F\250!\330\010\016\210a\210~\230Q\230d\240&\250\001\320\0043\2609\270A\340\010\016\210a\320\004%\240^\3203E\300Q\360\"\000\t\034\2305\240\001\240\021\330\010\035\230Z\240q\330\010 \240\001\330\010\022\220(\230!\2309\240A\240V\2501\250A\330\010\016\210a\320\017 \240\001\240\024\240W\250D\260\006\260e\2701\320\0043\260>\300\031\310!\360\"\000\t\014\2105\220\003\2206\230\027\240\007\240x\250q\330\010\036\230h\240a\240v\250Q\330\010\037\230q\330\010\016\210a\320\017\037\230q\240\007\240w\250f\260A\260Q\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004\034\320\0344\3204F\300a\360&\000\t\033\230!\330\010""\036\230a\330\010\033\2301\330\010\036\230h\240a\240x\250q\260\003\2601\260A\330\010\036\230h\240a\240w\250a\250t\2606\270\030\300\021\300!\330\010\017\210r\220\023\220C\220q\230\001\330\010\032\230!\330\010\014\210G\2209\230A\330\014\r\210Q\210f\220G\2304\230q\240\004\240A\330\010\016\210a\210x\220q\230\004\230F\240#\240S\250\001\320\004\032\320\0324\3204G\300y\320PQ\360&\000\t!\240\010\250\001\250\021\330\010&\240l\260!\2601\330\010\016\210a\210w\220a\220t\2306\240\026\240q\250\006\250a\320\0044\3204H\310\001\360\036\000\t\034\2301\330\010/\320/D\300A\300Q\330\010\016\210a\320\0175\260Q\260d\270%\270v\300Q\300a\330\010\017\210u\220A\220Q\320\004\"\320\"4\260A\360\036\000\t$\2401\330\010!\240\021\330\010+\2501\330\010.\250a\330\010\021\220\030\230\021\230(\240!\240;\250a\250q\330\010\016\210a\320\017 \240\001\240\024\240U\250+\260Y\270a\320?R\320RS\320ST\330\010\t\330\014\023\2207\230!\320\033.\250a\340\014\022\220!\320\023$\240A\240T\250\025\250k\270\031\300!\320CV\320VW\320WX\320\004\"\320\"4\260A\360\036\000\t\032\230\027\240\001\330\010\021\220\030\230\021\230(\240!\2404\240q\250\001\330\010\016\210a\210~\230Q\230d\240&\250\004\250A\320\004\"\320\"4\260A\360\030\000\t\036\230Z\240q\330\010 \240\001\330\010\022\220(\230!\2309\240A\240V\2501\250A\330\010\016\210a\320\017\"\240!\2404\240w\250f\260E\270\021\320\0044\260A\340\010\016\210a\320\017(\250\001\250\024\250W\260C\260q\320\0044\260A\340\010\016\210a\320\017&\240a\240t\2505\260\003\2601\320\004)\250\021\360\"\000\t\037\320\0364\260A\330\010\016\210a\320\017)\250\021\250$\250f\260A\260X\270Q\270a\330\010\020\220\006\220a\220y\240\006\240a\240q\320\004$\320$4\260A\360\036\000\t\017\210a\320\017\037\230q\240\004\240E\250\021\320\0044\260A\360\024\000\t\017\210a\320\017'\240q\250\004\250E\260\022\2606\270\022\2701\320\0044\260A\360$\000\t\017\210a\320\017\037\230q\240\004\240E\250\026\250v\260T\270\021\320\004\033\320\0334\260A\360&\000\t!\240\010\250\001\250\021\330\010\016\210a\210x\220q\230\004\230F\240&\250""\001\250\026\250q\260\001\320\004\"\320\"4\260A\360\"\000\t\030\220r\230\021\330\010\030\230\002\230!\330\010!\240\021\330\010\"\240!\330\010\021\220\030\230\021\230(\240!\240;\250a\250q\330\010\016\210a\210}\230A\230T\240\025\240k\260\031\270!\2704\270w\300a\300u\310A\330\010\017\210v\220Q\320\0044\260A\360\"\000\t \230u\240A\240Q\330\010\016\210a\320\017#\2401\240D\250\005\250X\260S\270\001\320\0044\260H\270A\360$\000\t'\240a\330\010\026\220c\230\021\330\010\024\220I\230Q\230k\250\021\250!\330\010\016\210a\320\0170\260\001\260\024\260U\270,\300a\300r\310\021\330\010\017\210q\320\004$\320$4\260I\270Q\360*\000\t \230v\240Q\240a\330\010\016\210a\210~\230Q\230d\240&\250\n\260!\320\004 \320 4\260N\300)\3101\360$\000\t#\240!\330\010#\2401\330\010\023\2209\230A\230Z\240q\250\001\330\010\013\2106\220\023\220F\230(\240!\330\010\013\2104\210s\220&\230\006\230a\330\010\013\2103\210e\2203\220d\230!\330\014\024\220A\330\r\020\220\005\220S\230\001\330\014\024\220A\340\014\024\220A\330\010\016\210a\210z\230\021\230$\230f\240G\2507\260!\2603\260a\330\010\017\210q\320\004\"\320\"4\260N\300,\310n\320\\e\320ef\360&\000\t \230x\240q\250\006\250a\330\010 \240\001\330\010\037\230q\330\010 \240\005\240Q\240a\330\010\016\210a\320\017!\240\021\240'\250\026\250x\260x\270q\300\001\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\0044\260O\3009\310A\360&\000\t%\240A\330\010\034\230A\330\010\016\210a\320\017\"\240!\2404\240u\250D\260\005\260\\\300\021\330\010\017\210q\320\004\"\240(\250!\3604\000\t'\240a\330\010\"\240!\330\010#\2401\330\010\037\230q\330\010\037\230q\330\010\024\220I\230Q\230k\250\021\250!\330\010\016\210a\210\177\230a\230t\2405\250\014\260A\260[\300\001\300\027\310\t\320QR\320RS\330\010\016\210a\320\017\"\240!\2404\240u\250A\250Q\330\010\034\230A\330\010\013\2106\220\023\220O\240:\250Q\330\010\013\2106\220\023\220O\240:\250Q\330\010\013\2106\220\023\220O\240:\250Q\330\010\013\2106\220\023\220O\240:\250Q\330\010\013\2106\220\023\220O\240:\250Q""\330\010\017\210x\220t\2301\340\010\t\210\021\210%\210{\230!\330\010\t\210\021\210%\210{\230!\330\010\017\210y\320\0301\260\021\260#\260S\270\t\300\021\320\004 \240\t\250\021\360 \000\t\014\2104\210s\220!\330\014\022\220!\330\r\020\220\005\220S\230\001\330\014\022\220!\220<\230q\240\004\240F\320*;\2701\270C\270q\330\010\016\210a\210|\2301\230C\230q\330\010\017\210q\320\004\031\230\021\340\010\013\2104\210u\220C\220v\230Q\330\010\016\210a\320\017\"\240!\2401\240D\250\001\330\010\017\210q\320\004\030\230\001\340\010\013\2104\210u\220C\220v\230Q\330\010\016\210a\320\017!\240\021\240!\2404\240q\330\010\017\210q\320\004\031\230\021\360\014\000\t\014\2104\210v\220S\230\001\330\014\022\220*\230A\230Q\330\010\021\220\021\220+\230Q\230d\240!\320\004\031\230\021\360\014\000\t\014\2104\210v\220S\230\001\330\014\022\220*\230A\230Q\330\010\026\220a\330\010\021\220\021\220-\230q\240\004\240G\2501\250A\330\010\017\210q\320\004\031\230\021\360\024\000\t\014\2104\210v\220S\230\017\240q\330\010\013\2104\210t\2201\330\014\022\220*\230A\230Q\330\010\016\210a\320\017\037\230q\240\001\240\024\240Q\330\010\014\210H\220A\330\010\014\210I\220Q\330\010\014\210H\220A\320\0045\3205O\310x\320WX\360\"\000\t\037\230e\2401\240A\330\010/\250q\330\010\016\210a\320\017+\2501\250D\260\005\260W\270A\320\004'\240~\3205G\300y\320PQ\360&\000\t\036\230U\240!\2401\330\010\035\230Q\330\010\035\230Q\330\010\016\210a\210~\230Q\230d\240%\240s\250$\250a\320\004'\240~\3205K\3108\320ST\360(\000\t\034\2305\240\001\240\021\330\010!\240\025\240a\240q\330\010)\250\025\250a\250q\330\010\016\210a\320\017*\250!\2504\250u\260D\270\n\300!\320\004!\320!5\260Q\3608\000\t\035\230A\330\010!\240\021\330\010\026\220h\230a\230w\240a\240t\2501\250A\330\010\016\210a\210}\230A\230T\240\025\240d\250!\320\004 \320 5\260Q\360\"\000\t\034\2305\240\001\240\021\330\010\016\210a\320\017'\240q\250\004\250H\260D\270\005\270Q\320\004$\320$5\260Q\360,\000\t*\250\021\330\010\023\2209\230A\230Z\240q\250\001\330\010\025\220R\220y\240\002\240!""\330\010\016\210a\210~\230Q\230d\240&\250\006\250a\250r\260\027\270\001\270\022\2701\330\010\020\220\004\220A\320\0045\260Q\360\036\000\t\017\210a\320\017+\2501\250D\260\005\260T\270\021\320\0045\260Q\360\"\000\t\017\210a\320\017%\240Q\240d\250%\250s\260'\270\021\270!\320\004 \320 5\260Q\360\024\000\t\032\230\021\330\010\031\230\021\330\010\036\230a\330\010\016\210a\210\177\230a\230t\2406\250\021\250!\330\010\020\220\010\230\001\230\027\240\001\240\024\240Q\240a\330\010\014\210C\210s\220%\220v\230Z\240q\330\014\r\330\r\022\220!\2205\230\005\230Q\230a\330\010\016\210a\210}\230A\230T\240\026\240q\330\010\014\210I\220Q\320\026*\250!\320\004$\320$5\260Q\360\"\000\t\"\240\025\240a\240q\330\010\016\210a\320\017\"\240!\2404\240z\260\032\2704\270q\320\004!\320!5\260Q\360\"\000\t \230u\240A\240Q\330\010\016\210a\210}\230A\230T\240\025\240h\250f\260A\320\0045\260W\270J\300a\360$\000\t\014\2101\330\014\022\220!\320\023,\250A\250T\260\026\260t\2701\340\014\022\220!\320\023(\250\001\250\024\250V\2604\260q\320\0045\260X\270Q\360&\000\t\034\2305\240\001\240\034\250Q\330\010\"\240!\330\010\016\210a\320\017\"\240!\2404\240u\250C\250v\260S\270\006\270d\300!\3007\310!\3101\330\010\t\330\014\026\220g\230Q\230g\240Q\340\014\022\220!\320\023*\250!\2504\250u\260C\260v\270S\300\006\300d\310!\3107\320RS\320ST\330\010\017\210q\320\0045\260X\270Q\360\036\000\t'\240a\330\010\034\230A\330\010\024\220I\230Q\230k\250\021\250!\330\010\016\210a\320\0171\260\021\260$\260e\270<\300q\310\001\320\0045\260X\270Q\360$\000\t'\240a\330\010\026\220c\230\021\330\010\024\220I\230Q\230k\250\021\250!\330\010\016\210a\320\0171\260\021\260$\260e\270<\300q\310\002\310!\330\010\017\210q\320\0045\260Y\270a\340\010\030\230\001\230\024\230V\2403\240c\250\023\250F\260#\260Q\320\0045\260Y\270a\340\010\016\210a\320\0045\260\\\300\031\310!\340\010\013\2105\220\004\220F\230(\240!\330\010\013\2106\220\023\220F\230(\240!\330\010\023\220:\230V\2401\330\010\014\210I\220Q\320\0264\260A\330\010\016\210a\320\017*\250!\2504\250w""\3206O\310w\320VW\320\0045\260\\\300\031\310!\340\010\013\2105\220\004\220F\230(\240!\330\010\013\2106\220\023\220F\230(\240!\330\010\023\220:\230V\2401\330\010\014\210I\220Q\320\0264\260A\330\010\016\210a\320\017(\250\001\250\024\250U\3202K\3107\320RS\320\004 \240\010\250\001\360\036\000\t\034\2305\240\001\330\010\033\2305\240\001\240\021\330\010\016\210a\320\017'\240q\250\004\250H\260D\270\001\270\025\270a\330\010\017\210q\320\0045\260\\\300\034\310Q\330\0378\270\r\320E]\320]f\320fg\360\024\000\t\036\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\035\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\035\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\320\023#\2406\250\021\330\010\014\210I\220Q\320\026,\250A\330\010\016\210a\320\017)\250\021\250$\250f\260F\270&\300\001\330*=\270W\300A\320\004!\240\030\250\021\360\036\000\t\034\2305\240\001\240\021\330\010\016\210a\320\017(\250\001\250\024\250X\260Q\320\004\"\240(\250!\360\024\000\t\034\2305\240\001\240\021\330\010\016\210a\210\177\230a\230t\2406\250\021\320\004\"\240(\250!\360\036\000\t\034\2305\240\001\240\021\330\010\016\210a\210\177\230a\230t\2406\250\021\320\0045\260^\300<\310~\320]f\320fg\360>\000\t \230x\240q\250\006\250a\330\010 \240\001\330\010\037\230q\330\010\016\210a\320\017\037\230q\240\007\240v\250V\2608\2701\270A\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\004(\250\010\260\001\360 \000\t\"\240\021\330\010\013\2105\220\007\220q\330\014\023\2209\230A\230V\2401\240A\330\010\016\210a\320\017(\250\001\250\024\250U\260!\320\004\031\230\030\240\021\360 \000\t\034\2305\240\001\240\021\330\010\037\230z\250\021\330\010\016\210a\210~\230Q\230d\240%\240q\250\010\260\001\260\021\330\010\017\210r\220\022\2207\230$\230b\240\001\240\021\330\010%\240Q\330\010%\240Q\330\010\016\210a\320\017 \240\001\240\024\240U\250$\250a\250q\330\010\016\210a\210}\230A\230T\240\025""\240d\250!\2501\330\010\017\210w\220a\220w\230a\320\004 \240\010\250\001\360 \000\t\034\2305\240\001\240\021\330\010\037\230z\250\021\330\010\016\210a\210~\230Q\230d\240%\240q\250\010\260\001\260\021\330\010\017\210r\220\022\2207\230$\230b\240\001\240\021\330\010\036\230a\330\010\016\210a\320\017#\2401\240D\250\005\250T\260\021\260!\330\010\017\210u\220A\220Q\320\004\035\230[\250\010\260\001\360$\000\t\034\2305\240\001\240\021\330\010\037\230z\250\021\330\010\016\210a\210~\230Q\230d\240%\240q\250\010\260\001\260\021\330\010\017\210r\220\022\2207\230$\230b\240\001\240\021\330\010\036\230e\2401\240A\330\010\016\210a\320\017 \240\001\240\024\240U\250$\250a\320\004$\320$6\3206H\310\001\360&\000\t\034\2305\240\001\240\021\330\010\037\230z\250\021\330\010\016\210a\210~\230Q\230d\240%\240q\250\010\260\001\260\021\330\010\017\210r\220\022\2207\230$\230b\240\001\240\021\330\010\036\230a\330\010\016\210a\320\017 \240\001\240\024\240U\250$\250a\250q\330\010\037\230q\330\010\037\230q\330\010\026\220h\230a\230}\250A\250W\260A\260Q\330\010\017\210v\220S\230\001\330\010\016\210a\320\017'\240q\250\004\250E\260\024\260Q\320\0046\3206H\310\001\360$\000\t!\240\001\330\010\032\230(\240+\250S\260\001\260\021\330\010(\250\001\330\010\035\230X\240Q\240g\250Q\250e\2606\270\030\300\021\300!\330\010\025\220T\230\021\230!\330\010\014\210G\2209\230A\330\014\025\220Q\220j\240\001\240\024\240Q\240a\330\014\027\220q\230\005\230Q\330\010\026\220c\230\021\330\010\016\210a\320\0171\260\021\260$\260e\2704\270}\310A\310R\310q\330\010\017\210q\320\004\"\320\"6\3206I\320I^\320^k\320kr\320rs\3602\000\t#\320\"5\260Q\260a\330\010\032\230-\240q\250\001\330\010\016\210a\320\017#\2401\240D\250\005\250W\260G\270<\300q\310\001\330$1\260\034\270Q\270a\330$+\250<\260q\270\r\300Q\320\004\035\320\0356\260a\360\036\000\t*\250\021\340\010\013\2106\220\027\230\001\330\014\025\320\025-\250Q\250a\330\010\016\210a\320\017/\250q\260\004\260G\2701\320\004#\320#6\260a\360\024\000\t#\240!\330\010\023\2209\230A\230Z\240q\250""\001\330\010\016\210a\210|\2301\230D\240\005\240Q\320\004#\320#6\260a\360&\000\t#\240!\330\010\023\2209\230A\230Z\240q\250\001\330\010\016\210a\210|\2301\230D\240\005\240Q\320\004#\320#6\260a\360\036\000\t\"\240\021\330\010\023\2209\230A\230Z\240q\250\001\330\010\016\210a\210}\230A\230T\240\026\240q\320\004#\320#6\260a\360&\000\t%\240A\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\210}\230A\230T\240\025\240a\320\004 \320 6\260a\360\036\000\t%\240A\330\010\023\2209\230A\230Z\240q\250\001\330\010\016\210a\320\017!\240\021\240$\240f\250A\320\004\"\320\"6\260a\360\036\000\t\033\230!\330\010/\320/D\300A\300Q\330\010\016\210a\320\017#\2401\240D\250\005\250V\2601\260A\330\010\017\210u\220A\220Q\320\004\"\320\"6\260a\360\036\000\t\035\230E\240\021\240!\330\010\030\320\030(\320(8\270\001\330\010\022\220!\2208\2301\230C\230q\240\003\2401\240A\330\010\016\210a\320\017 \240\001\240\024\240U\250#\250S\260\001\320\0046\260a\360\024\000\t\017\210a\320\017&\240a\240t\2506\260\022\2606\270\022\2701\320\0046\260a\360\024\000\t\017\210a\320\017)\250\021\250$\250e\2602\260V\2702\270Q\320\0046\260a\360\024\000\t\017\210a\320\017'\240q\250\004\250F\260#\260Q\320\004$\320$6\260a\360*\000\t!\240\010\250\001\250\021\330\010\016\210a\210y\230\001\230\024\230V\2403\240g\250V\2601\260A\320\004!\320!6\260a\360*\000\t*\250\021\330\010\"\240!\330\010\020\220\t\230\021\230'\240\021\240!\330\010\027\220r\230\021\330\010\016\210a\320\017 \240\001\240\024\240U\250&\260\007\260q\270\004\270A\330\010\017\210q\320\004%\320%6\260a\360\026\000\t \230u\240A\240Q\330\010\016\210a\320\017\"\240!\2404\240w\250h\260c\270\021\320\0046\260h\270a\360\036\000\t'\240a\330\010\034\230A\330\010\024\220I\230Q\230k\250\021\250!\330\010\016\210a\320\0172\260!\2604\260u\270L\310\001\310\021\320\004$\320$6\260i\270q\360\036\000\t*\250\034\260Q\260a\330\010\016\210a\210~\230Q\230d\240&\250\001\320\004&\320&6\260i\270q\360\"\000\t\036\230U\240!\2401\330\010\013\2107\220#\220Q\330\014\025\220S\230\001\330\010\013""\2106\220\025\220c\230\021\330\014\022\220!\220=\240\001\240\024\240V\2506\260\021\260&\270\001\330\010\016\210a\320\017!\240\021\240$\240f\250F\260&\270\001\330\010\017\210q\320\0046\260n\300I\310Q\360\"\000\t\037\230a\330\010\016\210a\320\017)\250\021\250$\250e\2601\320\0047\3207I\310\021\360\036\000\t!\240\001\330\010\032\230(\240+\250S\260\001\260\021\330\010(\250\001\330\010\035\230X\240Q\240g\250Q\250e\2606\270\030\300\021\300!\330\010\025\220T\230\021\230!\330\010\014\210G\2209\230A\330\014\025\220Q\220j\240\001\240\024\240Q\240a\330\014\027\220q\230\005\230Q\330\010\034\230A\330\010\016\210a\320\0172\260!\2604\260u\270D\300\r\310Q\310a\320\0047\3207I\310\021\360$\000\t!\240\001\330\010\032\230(\240+\250S\260\001\260\021\330\010(\250\001\330\010\035\230X\240Q\240g\250Q\250e\2606\270\030\300\021\300!\330\010\025\220T\230\021\230!\330\010\014\210G\2209\230A\330\014\025\220Q\220j\240\001\240\024\240Q\240a\330\014\027\220q\230\005\230Q\330\010\026\220c\230\021\330\010\016\210a\320\0172\260!\2604\260u\270D\300\r\310Q\310b\320PQ\330\010\017\210q\320\0047\3207K\3101\360$\000\t\034\2306\240\021\240-\250q\330\010\013\320\013\034\230A\230V\2406\250\034\260Q\260a\330\010\013\210<\220q\230\005\230S\240\003\2406\250\032\2601\330\r\016\330$'\240|\2601\260A\330\010!\240\033\250K\260q\270\005\270Q\330\010!\240\035\250l\270!\2701\330\010\016\210a\320\0171\260\021\260$\260e\270:\300Q\320\004#\2407\250)\2601\360 \000\t\037\230f\240A\240Q\330\010\016\210a\320\017!\240\021\240$\240f\250A\320\0047\260|\320C\\\320\\i\360\000\000j\001B\002\360\000\000B\002K\002\360\000\000K\002L\002\360\024\000\t\036\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\2209\230F\240!\330\010\014\210I\220Q\320\026,\250A\330\010\016\210a\320\0172\260!\2604\260v\270V\320CW\320W^\320^_\320\004'\320'7\260|\300?\320Ra\320ab\360&\000\t'\240a\330\010#\2405\250\001\250\021\330\010$\240A\330\010\013\2106\220\023""\220M\240\030\250\021\330\010\013\2106\220\023\220M\240\030\250\021\330\010\013\2106\220\023\220M\240\030\250\021\330\010\013\2106\220\023\220M\240\030\250\021\330\010\017\210v\220S\230\001\330\010\024\220I\230Q\230k\250\021\250!\330\010\016\210a\320\0170\260\001\260\024\260U\270,\300l\320RS\320\004 \320 7\260\177\300a\360&\000\t!\240\001\330\010\013\2107\220'\230\026\230z\250\025\250a\250q\330\010#\2401\330\010\013\210:\220W\230F\240-\250u\260A\260Q\330\010\016\210a\320\017\"\240!\2404\240x\250y\270\001\320\004)\250\021\360\036\000\t\034\2307\240!\330\010\016\210a\210~\230Q\230d\240*\250K\260w\270a\270s\300!\330\010\017\210q\320\004!\240\021\360\024\000\t\034\2307\240!\330\010\016\210a\320\017 \240\001\240\024\240U\250!\2503\250a\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004*\250!\360\024\000\t\034\2307\240!\330\010\016\210a\320\017)\250\021\250$\250e\2601\260C\260q\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\"\240!\360\024\000\t\034\2307\240!\330\010\016\210a\320\017!\240\021\240$\240e\2501\250C\250q\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\"\320\"7\260q\360(\000\t5\260A\330\010\025\220Y\230a\230|\2501\250A\330\010\016\210a\320\017,\250A\250T\260\026\260q\320\0047\260q\330 9\270\035\320F^\320^g\320gh\360\024\000\t\036\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\320\023$\240F\250!\330\010\014\210I\220Q\320\026-\250Q\330\010\016\210a\320\017*\250!\2504\250v\260Q\330+?\270w\300a\320\004$\320$7\260q\360\036\000\t%\240A\330\010\023\2209\230A\230Z\240q\250\001\330\010\016\210a\210}\230A\230T\240\025\240a\320\004'\320'7\260q\360\"\000\t\"\240\021\330\010\024\220I\230Q\230k\250\021\250!\330\010\016\210a\210\177\230a\230t\2405\250\007\250s\260!\320\0047\260q\360\036\000\t\017\210a\320\017#\2401\240D\250\006\250a\250u\260A\320\0047\260q\360&\000\t\017\210a\320\017\"\240!\2404\240v\250Q\250f\260A\260V\2701\270A\320""\0047\260q\360\"\000\t\017\210a\320\017\"\240!\2404\240v\250T\260\027\270\001\270\026\270q\320\004&\320&7\260q\360\036\000\t\017\210a\320\017 \240\001\240\024\240U\250!\320\0047\260q\360\024\000\t\017\210a\320\017'\240q\250\004\250A\330\010\035\230]\250!\330\010\016\210a\320\017#\2401\240D\250\006\250a\250v\260Q\260a\330\010\013\2102\210U\220#\220Q\330\014\017\210u\220C\220q\330\020\026\220a\220w\230a\230v\240R\240q\340\020\026\220a\220v\230Q\230b\240\006\240m\2601\330\010\013\2102\210U\220#\220Q\330\014\017\210u\220C\220q\330\020\026\220a\220w\230a\230v\240R\240q\340\020\026\220a\220v\230Q\230b\240\006\240m\2601\320\004&\320&7\260q\360\"\000\t \230u\240A\240Q\330\010\016\210a\320\017!\240\021\240$\240e\2508\2603\260a\320\004!\320!7\260v\270\\\310\036\320W`\320`a\360(\000\t\037\230h\240a\240v\250Q\330\010\034\230I\240W\250G\2607\270'\300\021\330\010\021\220\021\220&\230\006\230a\230u\240A\240U\250!\2503\250a\250s\260!\2603\260a\260q\330\010\022\220!\2207\230%\230q\240\003\2401\240A\330\010\022\220!\2207\230%\230q\240\003\2401\240A\360\006\000\t \230q\330\010\016\210a\210y\230\001\230\027\240\001\240\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\016\210a\210{\230!\2304\230v\240S\250\003\2503\250a\330\010\016\210a\210z\230\021\230$\230f\240A\330\010\016\210a\320\017\"\240!\2404\240v\250W\260A\330\010\013\2101\330\014\022\220!\2208\2301\230D\240\001\330\010\017\210q\320\0047\260w\270j\310\001\360$\000\t$\2401\330\010\016\210a\320\017(\250\001\250\024\250U\260!\2606\270\021\320\004#\320#7\260x\270q\360\"\000\t\034\2301\330\010\033\2305\240\001\240\021\330\010/\320/D\300A\300Q\330\010\016\210a\320\017$\240A\240T\250\025\250f\260F\270!\2701\330\010\017\210u\220A\220Q\320\004'\320'7\260x\270q\360\"\000\t\035\230E\240\021\240!\330\010\034\230E\240\021\240!\330\010\016\210a\320\017\037\230q\240\004\240F\250%\250q\320\004\035\320\0357\260y\300\013\310<\320W`\320`a\360,\000\t\032\230\026\230q\330\010 \240\010\250\001\250\021\330\010\033\230;\240a\330""\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\210:\220Q\220f\230A\330\014\022\220!\220=\240\001\240\024\240W\250D\260\005\260W\270F\300&\310\001\340\014\023\2208\2301\230F\240!\2404\240q\250\001\330\014\022\220!\220;\230a\230t\2406\250\024\250S\260\006\260f\270A\320\004\036\320\0367\260z\300\021\360\036\000\t-\320,>\270a\270q\330\010\027\220t\2301\230E\240\021\330\010\016\210a\210|\2301\230D\240\006\240f\250A\250S\260\001\330\010\017\210q\320\004+\2508\2601\3602\000\t\036\230Q\330\010\036\230e\2401\240A\330\010\016\210a\320\017!\240\021\240$\240e\2501\250A\330\010\035\230Q\330\010\016\210a\320\017+\2501\250D\260\005\260W\270A\270U\300*\310A\330\010\020\220\006\220a\220v\230W\240A\240V\250;\260g\270Q\270f\300A\320\004*\250/\270\021\360\036\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017$\240A\240T\250\025\250a\320\004*\250/\270\021\360&\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017$\240A\240T\250\025\250a\320\004*\250/\270\021\360\024\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017$\240A\240T\250\025\250a\320\004*\250/\270\021\360\024\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017%\240Q\240d\250&\260\001\320\004*\250/\270\021\360*\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017%\240Q\240d\250&\260\001\320\004*\250/\270\021\360\024\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017-\250Q\250d\260$\260a\260t\2701\320\004*\250/\270\021\360\024\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017&\240a\240t\2507\260!\320\004#\2408\2501\360\024\000\t$\2401\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017'\240q\250\004\250F\260!\320\004#\2408\2501\360\036\000\t\034\2305\240\001\240\021\330\010\033\2305\240\001\330\010\016\210a\320\017*\250!\2504\250x\260t\2701\270E\300\021\330\010\017\210q""\320\004 \240\013\2508\2601\360$\000\t\034\2305\240\001\240\021\330\010\037\230z\250\021\330\010\016\210a\210~\230Q\230d\240%\240q\250\010\260\001\260\021\330\010\017\210r\220\022\2207\230$\230b\240\001\240\021\330\010\036\230e\2401\240A\330\010\016\210a\320\017#\2401\240D\250\005\250T\260\021\320\004#\2408\2501\360\036\000\t\035\230E\240\021\240!\330\010\016\210a\320\017-\250Q\250d\260,\270a\320\004#\2408\2501\360\036\000\t\035\230E\240\021\240!\330\010\016\210a\320\017.\250a\250t\2607\270!\320\004#\2408\2501\360\036\000\t\035\230E\240\021\240!\330\010\016\210a\320\017)\250\021\250$\250h\260a\320\004+\2508\2601\360$\000\t!\240\001\330\010\024\220I\230Q\230k\250\021\250!\330\010\016\210a\320\017'\240q\250\004\250E\260\021\320\004+\2508\2601\360\024\000\t\036\230U\240!\2401\330\010\016\210a\320\017,\250A\250T\260\027\270\001\320\004(\250\013\2608\2701\360,\000\t\037\230e\2401\240A\330\010\036\230e\2401\240A\330\010\016\210a\320\017$\240A\240T\250\026\250w\260a\320\004+\2508\2601\360\024\000\t!\240\001\330\010\016\210i\220q\230\005\230Q\230a\330\010\016\210a\320\0171\260\021\260$\260f\270F\300!\320\004#\2408\2501\360.\000\t\037\230i\240q\330\010\037\230u\240A\240Q\330\010\016\210a\320\017\"\240!\2404\240u\250H\260A\260W\270A\270Q\330\010\017\210u\220A\220X\230U\240!\2401\320\004#\2408\2501\360\024\000\t \230u\240A\240Q\330\010\035\230Q\330\010\016\210a\320\017\037\230q\240\004\240F\250(\260!\2601\330\010\017\210u\220A\220Q\320\004#\2408\2501\360\036\000\t \230u\240A\240Q\330\010\035\230Q\330\010\016\210a\320\017\037\230q\240\004\240F\250(\260!\2601\330\010\017\210u\220A\220Q\320\004#\2408\2501\360\036\000\t \230u\240A\240Q\330\010\035\230Q\330\010\016\210a\320\017\037\230q\240\004\240F\250(\260!\2601\330\010\017\210v\220Q\220a\320\004#\2408\2501\360 \000\t \230u\240A\240Q\330\010\036\230a\330\010\016\210a\320\017\"\240!\2404\240u\250H\260A\260Q\330\010\017\210u\220A\220Q\320\004#\2408\2501\360\036\000\t \230u\240A\240Q\330\010\027\220s\230!\330\010\016\210a\210\177""\230a\230t\2405\250\010\260\001\260\023\260A\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004/\250|\2708\3001\360&\000\t \230u\240A\240Q\330\010\037\230u\240A\240Q\330\010\037\230q\330\010'\240q\330\010\016\210a\320\0170\260\001\260\024\260V\2708\3008\3101\310A\330\010\016\210a\320\0174\260A\260T\270\026\270x\300x\310q\320PQ\330\010\017\210w\220a\220x\230q\320\004#\2408\2501\360\036\000\t\"\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010!\240\021\330\010\016\210a\320\017\037\230q\240\004\240E\250\027\260\001\260\021\330\010\017\210q\320\004'\320'8\3208J\310!\360\"\000\t!\240\001\330\010%\240Q\330\010\023\2209\230A\230Z\240q\250\001\330\010!\240\033\250C\250q\260\001\330\010(\250\001\330\010\035\230X\240Q\240g\250Q\250k\270\026\270x\300q\310\001\330\010\025\220T\230\021\230!\330\010\014\210G\2209\230A\330\014\026\220a\220u\230I\240Q\240j\260\001\260\024\260Q\260a\330\014\027\220q\230\005\230Q\330\010\016\210a\320\017$\240A\240T\250\025\250k\270\032\3001\320\0048\3208J\310!\360\036\000\t!\240\001\330\010\032\230(\240+\250S\260\001\260\021\330\010(\250\001\330\010\035\230X\240Q\240g\250Q\250e\2606\270\030\300\021\300!\330\010\025\220T\230\021\230!\330\010\014\210G\2209\230A\330\014\025\220Q\220j\240\001\240\024\240Q\240a\330\014\027\220q\230\005\230Q\330\010\034\230A\330\010\016\210a\320\0173\2601\260D\270\005\270T\300\035\310a\310q\320\004$\320$8\3208K\320K`\320`m\320mt\320tu\360<\000\t#\320\"5\260Q\260a\330\010\032\230-\240q\250\001\330\010\016\210a\320\017%\240Q\240d\250%\250w\260g\270\\\310\021\310!\330&3\260<\270q\300\001\330&-\250\\\270\021\270-\300q\320\004)\250\037\3208I\310\037\320Xg\320gv\320v\177\360\000\000@\002A\002\360*\000\t\021\220\010\230\006\230a\330\010\013\210:\220W\230F\240)\2506\260\021\260!\330\010\013\210:\220W\230F\240)\2506\260\021\260!\330\010\013\210:\220W\230F\240)\2506\260\021\260!\330\010\016\210a\320\017(\250\001\250\024\250W\260G\2707\300!\320\004*\250.\3208J\310!\360\"\000\t \230u\240A\240Q\330\010\037\230q""\330\010\"\240!\330\010\022\220(\230!\2309\240A\240X\250Q\250a\330\010\016\210a\320\017+\2501\250D\260\006\260h\270a\330\010\016\210a\320\017/\250q\260\004\260F\270(\300!\320\004!\320!8\270\001\3600\000\t\035\230A\330\010\035\230Z\240q\330\010\013\210:\220Q\220i\230q\330\014\024\220D\230\010\240\001\330\014\022\220!\320\023)\250\021\250$\250e\2601\340\014\026\220h\230a\230y\250\001\250\026\250q\260\001\330\014\022\220!\320\023'\240q\250\004\250E\260\026\260q\330\010\017\210q\320\0048\270\001\360$\000\t\034\2301\330\010\016\210a\320\017-\250Q\250d\260&\270\001\270\026\270q\300\003\3001\300A\330\010\017\210v\220Q\220a\320\004#\320#8\270\001\360\"\000\t\034\2305\240\001\240\021\330\010\016\210a\320\017*\250!\2504\250x\260t\2705\300\001\320\004$\320$8\270\001\360\036\000\t\035\230E\240\021\240!\330\010\030\230\005\230U\240!\330\010\022\220!\2208\2301\230C\230q\240\003\2401\240A\330\010\016\210a\320\017#\2401\240D\250\005\250S\260\003\2601\320\004(\320(8\270\t\300\021\360\024\000\t\035\230M\250\021\330\010\013\2107\220'\230\026\230w\240e\2501\330\010\013\2107\220'\230\026\230w\240f\250A\330\010\016\210a\320\017\"\240!\2404\240v\250V\2601\320\004&\320&8\270\t\300\021\360\036\000\t*\250\034\260Q\260a\330\010\016\210a\320\017\037\230q\240\004\240F\250!\320\004\036\320\0368\270\r\300Y\310a\360(\000\t\"\240\025\240a\240q\330\010!\240\025\240d\250!\2501\330\010!\240\021\330\010\017\210v\220S\230\001\330\010\016\210a\210z\230\021\230$\230e\2406\250\026\250q\320\0048\270\t\300\021\340\010\016\210a\320\0048\270\001\360\036\000\t\017\210a\320\017+\2501\250D\260\005\260S\270\001\320\0048\270\001\360*\000\t\017\210a\320\017#\2401\240D\250\006\250a\250v\260Q\260f\270A\270Q\320\0048\270\001\360\"\000\t\017\210a\320\017%\240Q\240d\250%\250s\260'\270\024\270V\3006\310\027\320PQ\320\0048\270\001\360\036\000\t\017\210a\320\017-\250Q\250d\260%\260u\270A\320\0048\270\001\360\036\000\t\017\210a\320\017.\250a\250t\2605\270\004\270A\320\004&\320&8\270\001\360\036\000\t*\250\021\330\010\016""\210a\320\017!\240\021\240$\240e\2501\320\004'\320'8\270\001\360\026\000\t \230u\240A\240Q\330\010\016\210a\320\017$\240A\240T\250\027\260\010\270\003\2701\320\004%\320%8\270\t\300\021\360\"\000\t!\240\001\330\010 \240\001\330\010\017\210v\220T\230\021\230&\240\007\240w\250j\270\001\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\320\017)\250\021\250$\250d\260!\2604\260v\270Q\320\004 \320 9\3209R\320R_\320_w\360\000\000x\001A\002\360\000\000A\002B\002\360&\000\t\014\2107\220'\230\021\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220x\230v\240Q\330\014\020\220\t\230\021\230.\250\001\330\014\022\220!\220<\230q\240\004\240F\250,\260g\270Q\340\014\020\220\t\230\021\230.\250\001\330\014\022\220!\220<\230q\240\004\240F\250&\260\001\320\004#\320#9\3209S\320SV\320VY\320Yd\320d~\360\000\000\177\001B\002\360\000\000B\002E\002\360\000\000E\002F\002\330\037-\320-=\320=b\320bv\360\000\000w\001E\002\360\000\000E\002_\002\360\000\000_\002l\002\360\000\000l\002\177\002\360\000\000\177\002M\003\360\000\000M\003Y\003\360\000\000Y\003g\003\360\000\000g\003p\003\360\000\000p\003q\003\360F\001\000\t\035\230A\330\010\034\230M\250\021\330\010\020\220\010\230\001\230\027\240\001\240\025\240a\240q\330\010\017\210t\2203\220b\230\004\230D\240\003\2401\340\010\016\210a\210u\220F\230!\2305\240\006\240a\240u\250A\330\010\014\210G\2209\230E\240\026\240q\250\005\250U\260!\2601\340\010\016\210a\210u\220F\230!\2305\240\006\240a\240u\250A\330\010\014\210G\2209\230E\240\026\240q\250\005\250U\260!\2601\340\010\022\220!\220:\230Q\230e\2401\240D\250\001\250\025\250a\250t\2601\260E\270\021\270!\330\010\"\240!\330\010!\240\021\330\010-\250U\260!\2601\330\010)\250\021\330\010\037\230x\240q\250\006\250a\330\010\037\230q\330\010\016\210a\320\017\"\240!\2407\250%\250z\270\021\330#+\2508\2607\270)\320CX\320Xi\320ij\320jk\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\004#\2409\250A\3604\000\t\037\230a\330\010\026\220b""\230\001\330\010\016\210a\210w\220a\220t\2307\240$\240g\250V\2601\260C\260q\330\010\017\210q\320\004'\320':\270!\360\036\000\t\"\240\021\330\010\023\2209\230A\230Z\240q\250\001\330\010\016\210a\320\017 \240\001\240\024\240V\2501\320\004!\240\030\250\021\360\036\000\t!\240\001\330\010\023\2209\230A\230Z\240q\250\001\330\010\016\210a\210\177\230a\230t\2405\250\001\320\004#\2409\250A\360\036\000\t$\2401\330\010\013\2107\220'\230\026\230z\250\026\250q\330\010\016\210a\320\017!\240\021\240$\240i\250q\320\004+\2509\260A\360&\000\t\014\2102\210S\220\001\330\014\020\220\003\2201\330\010\013\2101\210E\220\023\220A\330\014\022\220!\320\023+\2501\250D\260\013\2701\270A\270Q\330\010\016\210a\320\017&\240a\240t\250;\260b\270\005\270Q\270f\300A\300Q\330\010\017\210q\320\004#\2409\250A\360\036\000\t\014\2107\220#\220Q\330\014\025\220S\230\001\330\010\013\2106\220\025\220c\230\021\330\014\022\220!\220=\240\001\240\024\240V\2506\260\021\260&\270\001\330\010\016\210a\210|\2301\230D\240\006\240f\250A\330\010\017\210q\320\004)\320);\2709\300A\360\"\000\t\036\230Q\330\010\035\230Q\330\010\016\210a\320\017\"\240!\2404\240u\250D\260\001\320\004*\320*;\2709\300A\360\"\000\t&\240Z\250q\260\001\330\010\016\210a\210~\230Q\230d\240&\250\004\250F\260!\320\004+\2509\260A\360\036\000\t\037\230f\240A\240Q\330\010\016\210a\320\017(\250\001\250\024\250V\2601\320\004+\2509\260A\360\024\000\t\037\230f\240A\240Q\330\010\016\210a\320\017)\250\021\250$\250g\260Q\320\004+\2509\260A\360(\000\t \230q\330\010\013\2101\330\014\024\220A\330\010\016\210a\320\017'\240q\250\004\250E\260\021\320\004+\2509\260A\360&\000\t(\240v\250Q\250a\330\010\016\210a\320\017(\250\001\250\024\250V\2601\320\0049\270\021\360\"\000\t\"\240\023\240H\250D\260\007\260z\300\021\330\010\016\210a\320\017'\240q\250\004\250E\260\021\320\004'\320'9\270\021\360\"\000\t\036\230Q\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\001\330\010 \240\001\330\010\035\230X\240Q\240g\250Q\250j\270\004\270F\300(\310!\3101\330\010\014\210G\2209\230A""\330\014\022\220!\2206\230\026\230u\240A\240\\\260\023\260A\330\010\016\210a\320\017&\240a\240t\2505\260\004\260F\270!\320\004&\320&9\270\031\300!\360\024\000\t\036\230U\240!\2401\330\010 \240\016\250h\260g\270S\300\n\310&\320PT\320TU\320UV\330\010\016\210a\320\017+\2501\250D\260\004\260A\260T\270\026\270q\320\0049\270\031\300!\340\010\016\210a\320\004'\320'9\270\021\360\036\000\t*\250\021\330\010\016\210a\320\017\"\240!\2404\240u\250A\320\0049\270\021\360$\000\t\017\210a\320\017$\240A\240T\250\025\250f\260F\270$\270a\320\004)\320)9\270\021\360\036\000\t)\250\001\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\320\0049\270\021\360*\000\t\017\210a\320\017\037\230q\240\004\240E\250\023\250F\260$\260e\2705\300\001\320\0049\270\021\360\036\000\t\017\210a\320\017/\250q\260\004\260E\270\024\270Q\320\004\037\320\0379\270\031\300!\360\036\000\t\030\220t\2301\230E\240\021\330\010\016\210a\210|\2301\230D\240\006\240a\240s\250!\340\010\033\2304\230y\250\001\250\021\330\010\013\2105\220\007\220q\330\014\017\210y\230\001\320\031-\250Q\330\010\013\2106\220\027\230\001\330\014\030\230\001\230\025\230a\330\010\017\210q\320\004(\320(<\270A\3608\000\t\035\230A\330\010!\240\021\330\010\026\220h\230a\230w\240a\240t\2501\250A\330\010\016\210a\320\017#\2401\240D\250\005\250T\260\021\320\004A\320AZ\320Zg\320g\177\360\000\000@\002I\002\360\000\000I\002J\002\360\024\000\t\014\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\2209\230F\240!\330\010\014\210I\220Q\320\026,\250A\330\010\016\210a\320\017?\270q\300\004\300F\320J^\320^e\320ef\320\004$\320$A\320AZ\320Zg\320g\177\360\000\000@\002I\002\360\000\000I\002J\002\360,\000\t\017\210a\320\017.\250a\250t\2608\320;K\3101\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\014\210I\220Q\320\026'\240z\260\026\260q\200A\330(0\260\001\360\036\000\t\014\2104\210z\230\026\230z\250\021\250!\330\010\037\230q\330\010\023\2209\230A\230Z\240q\250\001\330\010\036\230l""\250!\2501\330\010\016\210a\320\017%\240Q\240e\2501\250A\330\010\024\220A\220Z\230v\240Q\240a\200A\340\023\024\330\023\024\330\023\024\330\0230\260\001\330\016'\240q\330\017'\240y\260\001\3602\000\t \230q\330\010\037\230q\330\010\024\220H\230A\230[\250\001\250\027\260\001\260\021\340\010 \240\001\330\010 \240\001\330\010\024\220H\230A\230[\250\001\250\027\260\001\260\021\330\010\017\210v\220S\230\001\340\010 \240\001\330\010\013\210:\220W\230A\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\020\220\t\230\021\320\032,\250K\260v\270Q\330\014\017\210z\230\027\240\001\330\020\024\220I\230Q\320\0360\260\013\2706\300\021\330\020\026\220a\320\027(\250\001\250\024\250U\260)\2707\300'\310\036\320We\320el\320lm\340\020\024\220I\230Q\320\036/\250q\330\020\026\220a\320\027(\250\001\250\024\250U\260)\2707\300'\310\036\320W]\320]d\320de\340\014\022\220!\320\023$\240A\240T\250\025\250i\260w\270g\300V\3106\320QX\320XY\200A\360\006\000\0260\250q\330\016\034\230A\330\r\034\230A\330\022\037\230q\330\021\036\230a\330\014\031\230\021\330\016\035\230Y\240a\360F\001\000\t\036\230Q\330\010!\240\021\330\010\037\230q\330\010\036\230a\330\010\036\230a\330\010\035\230Q\330\010\034\230A\330\010\035\230Q\360\006\000\t\034\2308\2401\330\010\013\2105\220\007\220v\230X\240V\2501\250A\330\010\013\2104\210w\220f\230G\2406\250\021\250!\330\010\013\2109\220G\2306\240\030\250\025\250a\250q\330\010\013\2108\2207\230&\240\007\240u\250A\250Q\330\010\013\2103\210g\220V\2306\240\025\240a\240q\330\010\013\2105\220\007\220v\230V\2406\250\021\250!\340\010\013\210<\220w\230a\330\014\022\220&\230\001\230\035\240a\330\014\017\320\017 \240\001\240\026\240v\250\\\270\021\270!\330\014\017\210|\2301\230E\240\023\240C\240v\250Z\260q\330\021\022\330(+\250<\260q\270\001\330\014\023\220;\230k\250\021\250%\250q\330\014\022\220!\220?\240!\2401\240F\250!\2504\250q\260\001\330\014\017\210s\220#\220T\230\026\230z\250\021\250!\330\014\017\210u\220B\220d\230&\240\n\250!\330\0218\270\002""\270!\330\014\023\220;\230k\250\021\250%\250q\330\014\025\220]\240,\250a\250q\340\010\037\230q\330\010\016\210a\320\017%\240Q\240a\240v\250V\2608\2707\300&\310\007\310v\320UZ\320Z_\320_`\320`a\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004$\240A\360\024\000\t0\250q\330\010\016\210a\320\017$\240A\240T\250\026\250q\260\001\330\010\017\210q\320\004$\240A\360\024\000\t0\250q\330\010\016\210a\320\017%\240Q\240d\250'\260\021\260!\330\010\017\210q\200A\340\r\016\330\r\016\330\021\022\330\016\"\240)\2501\3600\000\t\035\230E\240\021\240!\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\340\010\014\210A\210U\220$\220a\220u\230D\240\001\240\025\240f\250A\250Q\330\010\014\210G\2209\230E\240\024\240Q\240e\2503\250a\250q\340\010\014\210A\210U\220$\220a\220u\230D\240\001\240\025\240f\250A\250Q\330\010\014\210G\2209\230E\240\024\240Q\240e\2503\250a\250q\340\010\020\220\001\220\025\220h\230a\230u\240H\250A\250U\260%\260q\270\001\330\010\014\210G\2209\230E\240\030\250\021\250%\250w\260a\260q\330\010%\240Z\250q\260\001\330\010\016\210a\320\0171\260\021\260$\260e\2706\300\026\300z\320QR\330\010\017\210q\200A\340\021\022\330\020\"\240)\2501\3600\000\t\037\230k\250\021\330\010\036\230k\250\021\330\010\022\220(\230!\2309\240A\240W\250A\250Q\330\010\013\2107\220#\220V\2309\240G\2501\250A\330\010\022\220(\230!\2309\240A\240W\250A\250Q\330\010\017\210v\220S\230\007\230q\330\010\016\210a\320\017*\250!\330\014\020\220\006\220g\230V\2401\330\010\017\210q\200A\340\021\022\330\020\"\240)\2501\3600\000\t\037\230k\250\021\330\010\036\230k\250\021\330\010\022\220(\230!\2309\240A\240W\250A\250Q\330\010\013\2107\220#\220V\2309\240G\2501\250A\330\010\022\220(\230!\2309\240A\240W\250A\250Q\330\010\017\210v\220S\230\007\230q\330\010\016\210a\320\017/\250q\330\014\020\220\006\220g\230V\2401\330\010\017\210q\200A\340\021\022\330\020*\250)\2601\360(\000\t\020\210|\2301\230D\240\006\240i\250q\200A\360\010\000\016\024\2201\330\r\023\2201\330\016\034\230A\330\032\033\360.""\000\t\037\230h\240a\240v\250Q\330\010\013\2109\220A\220W\230C\230q\330\014\017\210t\2206\230\030\240\021\330\014\025\220Q\220f\230E\240\022\2403\240a\240q\330\014\022\220\"\220E\230\021\330\014\026\220b\230\005\230Q\230h\240b\250\001\340\014\026\220a\330\010\035\230Q\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\210{\230!\2307\240&\250\001\200A\340\023\"\240)\2501\360\030\000\t$\2401\330\010\013\210:\220W\230F\240(\250!\340\010\016\210a\210|\2301\230D\240\006\240g\250Q\200A\360\010\000\016\024\2201\330\r\023\2201\330\017\026\220a\330\016\034\230A\330\032\033\3602\000\t\037\230h\240a\240v\250Q\330\010\013\2104\210v\220X\230Q\330\010\021\220\021\220&\230\005\230R\230s\240!\2401\330\010\016\210b\220\005\220Q\330\010\022\220\"\220E\230\021\230(\240\"\240A\330\010\035\230Q\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\320\017&\240a\240w\250f\260A\330\010\013\2107\220&\230\001\320\031/\250q\260\007\260q\200A\340\022\023\330\016\017\330\016\017\330\017(\250\001\330\020(\250\t\260\021\360.\000\t\034\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\033\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\020\220\t\230\021\320\032-\250Q\330\014\022\220!\320\023#\2401\240D\250\005\250V\2606\3209I\310\027\320PQ\340\014\022\220!\320\023#\2401\240D\250\005\250V\2606\270\026\270q\200A\340\022\023\330\016\017\330\017(\250\001\330\020(\250\t\260\021\360*\000\t\034\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\020\220\t\230\021\320\032+\2501\330\014\022\220!\220>\240\021\240$\240e\2506\260\036\270w\300a\340\014\022\220!\220>\240\021\240$\240e\2506\260\026\260q\200A\340\022\023\330\016\017\330\017(\250\001\330\020(\250\t\260\021\360*\000\t\034\2301\330\010\013\2102\210W""\220F\230'\240\021\240!\330\010\013\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\020\220\t\230\021\320\032,\250A\330\014\022\220!\220?\240!\2404\240u\250F\260/\300\027\310\001\340\014\022\220!\220?\240!\2404\240u\250F\260&\270\001\200A\340\022\023\330\016\017\330\017(\250\001\330\020(\250\t\260\021\360*\000\t\034\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\020\220\t\230\021\320\032-\250Q\330\014\022\220!\320\023#\2401\240D\250\005\250V\3203C\3007\310!\340\014\022\220!\320\023#\2401\240D\250\005\250V\2606\270\021\200A\360\006\000\016\017\330\013\023\2201\360.\000\t\034\2305\240\001\240\021\330\010/\320/D\300A\300Q\330\010\033\2301\330\010\037\230q\330\010\016\210a\320\017#\2401\240D\250\005\250S\260\006\260f\270D\300\001\300\025\300a\300q\330\010\025\220T\230\021\330\010\016\210a\210z\230\021\230\"\230H\240B\240f\250A\330\010\031\230\023\230A\330\010\016\210a\210z\230\021\230%\230x\240u\250G\2601\330\010\020\220\004\220A\200A\340\025\026\330\023\032\230!\330\016\"\240)\2501\360*\000\t\034\2306\240\021\240-\250q\330\010\013\320\013\034\230A\230V\2406\250\034\260Q\260a\330\010\013\210<\220q\230\005\230S\240\003\2406\250\032\2601\330\r\016\330$'\240|\2601\260A\330\010!\240\033\250K\260q\270\005\270Q\330\010$\240F\250!\2501\330\010%\240Z\250q\260\001\330\010!\240\035\250l\270!\2701\330\010\016\210a\320\017)\250\021\250$\250e\260:\270X\300\\\320QR\320\004,\250A\360\024\000\t\034\2301\330\010!\240\021\330\0108\270\001\330\010\016\210a\320\017!\240\021\240$\240h\250a\250v\260Q\260c\270\021\270&\300\001\300\026\300q\310\t\320QR\320RS\330\010\020\220\006\220a\220t\2306\240\021\240*\250A\320\004,\250A\330\";\2701\330#;\2709\300A\360&\000\t\014\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330""\014\027\220z\240\026\240q\330\014\020\220\t\230\021\320\0323\2601\330\014\022\220!\320\023*\250!\2504\250w\3206M\310W\320TU\340\014\020\220\t\230\021\320\0323\2601\330\014\022\220!\320\023*\250!\2504\250w\260f\270A\200A\360\010\000\017#\240)\2501\360,\000\t#\240*\250A\250Q\330\010\016\210a\320\017'\240q\250\004\250E\260\022\2606\270\024\270R\270q\330\010\016\210a\320\017%\240Q\240d\250%\250r\260\026\260t\2702\270Q\200A\360\010\000\017#\240)\2501\360(\000\t#\240*\250A\250Q\330\010\016\210a\320\017'\240q\250\004\250E\260\022\2606\270\024\270R\270q\330\010\016\210a\320\017%\240Q\240d\250%\250r\260\026\260t\2702\270Q\200A\330)1\260\021\360\036\000\t%\240A\330\010\022\220)\2301\230I\240Q\240a\330\010\035\230Q\330\010\016\210a\320\017&\240a\240z\260\021\260!\330\010\017\210v\220Q\220a\210A\340\020\023\2201\330\024\034\230A\340\024\034\230C\230u\240A\240Q\240d\250-\260w\270a\270v\320EU\320UY\320YZ\330\025\030\230\006\230a\230w\240a\330\024\033\2304\230r\240\030\250\021\200A\330\033)\320):\270&\300\013\3101\360$\000\t-\250E\260\021\260!\330\010,\250L\270\001\270\031\300&\310\007\310z\320Y\\\320\\a\320ab\330\010,\250C\250q\340\010\016\210a\320\017 \240\001\240\036\250|\2701\270F\300!\330\010\017\210q\200A\340\r\016\330\017+\2501\330\016\034\230I\240Q\3604\000\t\036\320\035-\250Q\330\010\035\230]\250!\330\010\037\230\177\250a\330\010\036\230h\240a\240v\250Q\330\010\035\230Q\330\010\013\210:\220Q\220e\2301\330\014\025\220T\230\024\230Q\330\014\017\210v\220W\230A\330\020\033\2305\240\006\240a\330\014\022\220!\220?\240!\2407\250)\2601\260A\340\014\022\220(\230!\2305\240\001\240\026\240q\250\001\330\014\017\210v\220W\230A\330\020\030\230\010\240\001\240\027\250\001\250\030\260\021\260!\330\020\027\220u\230C\230x\240q\330\014\022\220!\220=\240\001\240\027\250\006\250h\260j\300\001\300\021\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\200A\340\r\016\330\017+\2501\330\016\034\230I\240Q\360:\000\t\036\320\035-\250Q\330\010\035\230]\250!\330\010\037\230""\177\250a\330\010\036\230h\240a\240v\250Q\330\010\035\230Q\330\010\013\210:\220Q\220e\2301\330\014\025\220T\230\024\230Q\330\014\017\210v\220W\230A\330\020\033\2305\240\006\240a\330\014\022\220!\320\023+\2501\250G\2609\270A\270Q\340\014\022\220(\230!\2305\240\001\240\026\240q\250\001\330\014\017\210v\220W\230A\330\020\030\230\010\240\001\240\027\250\001\250\030\260\021\260!\330\020\027\220u\230C\230x\240q\330\014\022\220!\320\023)\250\021\250'\260\026\260x\270z\310\021\310!\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\200A\340\r\016\330\017+\2501\330\016\034\230I\240Q\360.\000\t\036\320\035-\250Q\330\010\035\230]\250!\330\010\037\230\177\250a\330\010\036\230h\240a\240v\250Q\330\010\035\230Q\330\010\013\210:\220Q\220e\2301\330\014\025\220T\230\024\230Q\330\014\017\210v\220W\230A\330\020\033\2305\240\006\240a\330\014\022\220!\320\023$\240A\240W\250I\260Q\260a\340\014\022\220(\230!\2305\240\001\240\026\240q\250\001\330\014\017\210v\220W\230A\330\020\030\230\010\240\001\240\027\250\001\250\030\260\021\260!\330\020\027\220u\230C\230x\240q\330\014\022\220!\220?\240!\2407\250&\260\010\270\n\300!\3001\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\200A\340\023\024\330\022\023\330\016\017\330\017(\250\001\330\020(\250\t\260\021\360.\000\t\"\240\021\330\010\033\2301\330\010\024\220I\230Q\230k\250\021\250!\330\010\033\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\025\220Q\220h\230k\250\036\260q\270\001\330\014\020\220\t\230\021\230'\240\021\330\014\022\220!\320\023)\250\021\250$\250e\2607\270&\300\016\310g\320UV\340\014\022\220!\320\023)\250\021\250$\250e\2607\270&\300\006\300a\200A\340\023\024\330\022\023\330\016\017\330\017(\250\001\330\020(\250\t\260\021\360.\000\t\"\240\021\330\010\033\2301\330\010\024\220I\230Q\230k\250\036\260q\270\001\330\010\033\2301\330\010\013""\2102\210W\220F\230'\240\021\240!\330\010\013\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\025\220Q\220h\230k\250\036\260q\270\001\330\014\020\220\t\230\021\230'\240\021\330\014\022\220!\320\023+\2501\250D\260\005\260W\270F\320BR\320RY\320YZ\340\014\022\220!\320\023+\2501\250D\260\005\260W\270F\300&\310\001\200A\330\010\037\230{\250!\2501\330\010\014\210I\220Q\220n\240A\330\010\017\210s\220&\230\001\200A\330\035*\250!\330\034+\2501\330\036-\250Q\330\033*\250!\330\033*\250!\330\034+\2501\330\037.\250i\260q\3606\000\t%\240A\330\010$\240A\330\010$\240A\330\010$\240A\330\010$\240A\330\010$\240A\330\010$\240A\330\010\013\210:\220W\230F\240-\250u\260A\260Q\330\010\013\210:\220W\230F\240-\250v\260Q\260a\330\010\013\210:\220W\230F\240-\250v\260Q\260a\330\010\013\210:\220W\230F\240-\250v\260Q\260a\330\010\013\210:\220W\230F\240-\250v\260Q\260a\330\010\013\210:\220W\230F\240-\250v\260Q\260a\330\010\013\210:\220W\230F\240-\250v\260Q\260a\330\010\016\210a\320\017%\240Q\330\014\020\220\007\220z\240\031\250!\330\014\024\220H\230I\240Q\320\004,\250A\330!:\270!\330\":\270)\3001\360&\000\t\014\210:\220S\230\001\330\014\020\220\t\230\021\320\032+\2501\330\014\022\220!\320\023)\250\021\250$\250g\3205H\310\006\310a\330\r\027\220s\230%\230s\240*\250C\250q\330\014\020\220\t\230\021\320\032+\2501\330\014\022\220!\320\023)\250\021\250$\250g\3205K\3106\320QR\340\014\023\2208\2301\230A\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220{\240&\250\001\330\014\020\220\t\230\021\320\032+\2501\330\014\022\220!\320\023)\250\021\250$\250g\3205E\300W\310I\320UV\200A\340\017\020\330\023\"\240)\2501\360(\000\t\036\230U\240!\2401\330\010&\240a\330\010#\2401\330\010\013\210:\220W\230F\240(\250!\340\010\016\210a\210}\230A\230T\240\026\240v\250W\260A\330\010\013\2106\220\023\220J\230g\240V\2501\250D\260\001\260\021\330\016\026\220f\230A\230T\240\021\240%\240v\250Q\250d\260!""\2601\200A\340\023\"\240)\2501\360\030\000\t'\240a\330\010#\2401\330\010\013\210:\220W\230F\240(\250!\340\010\016\210a\210w\220a\220t\2306\240\027\250\001\330\010\013\2106\220\023\220J\230g\240V\2501\250D\260\001\260\021\330\016\026\220f\230A\230T\240\021\240%\240v\250Q\250d\260!\2601\200A\340\023\"\240)\2501\360\024\000\t'\240a\330\010#\2401\330\010\013\210:\220W\230F\240(\250!\340\010\016\210a\210z\230\021\230$\230f\240G\2501\330\010\013\2106\220\023\220J\230g\240V\2501\250D\260\001\260\021\330\016\026\220f\230A\230T\240\021\240%\240v\250Q\250d\260!\2601\200A\330\031\032\360\036\000\t$\2401\330\010\016\210a\210}\230A\230Q\230a\330\010\017\210q\320\004)\320)A\300\021\340\010+\2501\330\010\016\210a\320\017$\240A\240T\250\026\250q\320\004$\240A\360\030\000\t$\2401\330\010\016\210a\320\017$\240A\240T\250\026\250q\260\001\330\010\035\230Q\330\010\016\210a\320\017!\240\021\240-\250t\2606\270\021\270!\330\010\031\230\021\330\010\016\210a\320\017\037\230}\250A\250V\2601\260A\330\010\017\210w\220a\220t\2301\230C\230q\320\004$\240A\360\024\000\t\034\2301\330\010\016\210a\320\017%\240Q\240d\250'\260\021\260!\330\010\017\210u\220A\220Q\320\004$\240A\360 \000\t$\2401\330\010\016\210a\320\017&\240a\240t\2506\260\021\260!\330\010\017\210q\200A\330\030\031\360\036\000\t$\2401\330\010\016\210a\210y\230\001\230\021\230!\330\010\017\210q\200A\340\020\021\330\020+\2501\330\021.\250i\260q\360*\000\t\014\2107\220#\220V\2309\240A\330\010\021\220\021\220+\230Z\240q\250\010\260\t\270\024\270Q\270a\330\010\021\220\021\220+\230Z\240q\250\010\260\t\270\024\270Q\270a\330\010\017\210s\220!\2208\2303\230c\240\021\240!\330\010\037\230s\240!\2401\330\010#\2401\330\010!\240\021\330\010!\240\021\330\010!\240\021\340\010\036\230h\240a\240w\250a\250z\270\024\270V\3008\3101\310A\330\010\014\210G\2209\230C\230w\240a\240v\250U\260&\270\001\270\023\270A\330\010\036\230h\240a\240w\250a\250z\270\024\270V\3008\3101\310A\330\010\014\210G\2209\230C\230w\240a\240v\250U\260&\270\001\270\023\270A\330\010\013""\2108\2207\230!\330\014\024\220A\330\014\026\220d\230!\2301\330\014\023\2203\220a\220y\240\003\2403\240a\240q\330\014\022\220!\220;\230a\230y\250\001\250\021\250\"\250A\320-?\270q\300\001\330\014\020\220\007\220y\240\003\2405\250\001\250\026\250v\260W\270A\270S\300\001\330\010\016\210a\320\017#\2401\240D\250\006\250j\270\003\2709\300I\310W\320TU\320UV\330\010\014\210G\2209\230C\230v\240Q\240k\260\021\260.\300\001\300\025\300a\300q\330\010\013\2106\220\023\220A\330\014\026\220a\220v\230R\230q\330\014\020\220\007\220y\240\001\330\020\027\220q\230\005\230V\2403\240a\330\020\023\2207\230%\230q\240\001\330\010\016\210a\320\017!\240\021\240*\250C\250q\260\001\330\010\017\210q\200A\330\0371\260\021\360,\000\t\020\210t\2201\220A\330\010\037\230s\240!\2401\330\010\032\230*\240A\330\010\037\230q\330\010 \240\001\330\010 \240\001\340\010%\240Q\330\010\022\220(\230!\2307\240!\2404\240v\250X\260Q\260a\330\010\014\210G\2209\230A\330\014\021\220\021\220&\230\006\230d\240!\2403\240a\330\010\016\210a\210~\230Q\230c\240\027\250\001\250\030\260\021\260!\330\010\030\230\003\2301\330\010\014\210G\2201\330\010\014\210G\2209\230A\330\014\023\2202\220Q\330\014\020\220\010\230\006\230a\230q\330\014\032\230'\240\021\240!\330\010\016\210a\210y\230\001\230\021\330\010\017\210v\220Q\200A\340\017\020\330\017\020\330\021#\2401\360&\000\t \230u\240A\240Q\330\010\037\230u\240A\240Q\330\010\037\230q\330\010\"\240!\330\010\022\220(\230!\2309\240A\240X\250Q\250a\330\010\016\210a\320\0170\260\001\260\024\260V\2708\3008\3101\330\010\016\210a\320\0174\260A\260T\270\026\270x\300x\310q\200A\340\0241\260\021\330\020\037\230y\250\001\360$\000\t-\250A\330\010\013\210;\220g\230Q\330\014\023\320\023%\240Q\240a\330\014\022\220!\320\023'\240q\250\004\250E\260\021\330\010\036\230a\330\010\013\2107\220'\230\021\330\014\023\2206\230\021\230!\330\014\022\220!\320\023)\250\021\250$\250e\2601\200A\360\006\000\017\020\330\017(\250\001\330\020(\250\t\260\021\3602\000\t\034\2301\330\010\013\2102\210W\220F\230'\240\021""\240!\330\010\013\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\020\220\t\230\021\320\032,\250A\330\014\022\220!\220?\240!\2404\240u\250F\260/\300\027\310\001\340\014\022\220!\220?\240!\2404\240u\250F\260&\270\001\200A\340\023\024\330\022\023\330\016\017\330\016\017\330\017(\250\001\330\020(\250\t\260\021\3602\000\t\"\240\021\330\010\033\2301\330\010\024\220I\230Q\230k\250\021\250!\330\010\033\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\033\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\025\220Q\220h\230k\250\036\260q\270\001\330\014\020\220\t\230\021\230'\240\021\330\014\022\220!\320\023)\250\021\250$\250e\2607\270&\300\006\300n\320T[\320[\\\340\014\022\220!\320\023)\250\021\250$\250e\2607\270&\300\006\300f\310A\200A\330\034\035\330\0312\260!\330\0322\260)\2701\360D\001\000\t\014\2108\2203\220f\230A\330\010\"\240$\240i\250q\260\001\330\010\013\210<\220s\230!\330\014\032\230!\330\014\020\220\t\230\021\230/\250\021\330\014\022\220!\220=\240\001\240\024\240V\250=\270\006\270a\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\2207\230\"\230I\240V\2501\200A\330\034\035\330\0312\260!\330\0322\260)\2701\360&\000\t\014\2108\2203\220f\230A\330\010\"\240$\240i\250q\260\001\330\010\013\210<\220s\230!\330\014\032\230!\330\014\020\220\t\230\021\230/\250\021\330\014\022\220!\220>\240\021\240$\240g\250^\2706\300\021\330\010\013\2106\220\023\220F\230(\240!\330\010\013\2106\220\023\220F\230(\240!\330\010\023\2209\230F\240!\330\010\023\2207\230!\2301\200A\330*2\260!\360\036\000\t2\260\021\330\010\013\210;\220c\230\021\330\014\026\320\0262\260!\330\r\030\230\003\2301\330\014\026\220a\330\r\030\230\003\2301\330\014\026\220a\330\r\030\230\003\2301\330\014\026\220a\330\r\030\230\003\2301\330""\014\026\220a\330\r\030\230\003\2301\330\014\026\220a\330\r\030\230\003\2301\330\014\026\220a\340\014\022\220*\230A\320\0356\260a\260q\330\010\016\210a\320\017$\240A\240Y\250a\200A\330\0312\260!\360 \000\t)\250\001\340\010\013\2105\220\007\220q\330\014\024\320\024,\250A\250Q\330\010\016\210a\320\0172\260!\2601\200A\340\020\021\330\030!\240\021\3602\000\t\033\230!\330\010$\240A\330\010\"\240!\330\010$\240A\330\010\031\230\033\240A\340\010\013\2104\210s\220%\220t\2309\240C\240q\330\014\022\220*\230A\230Q\330\010\013\2104\210w\220a\330\014\023\2208\2304\230y\250\001\250\021\330\014\017\210t\2203\220a\330\020\026\220j\240\001\240\021\330\014\020\220\t\230\021\320\032.\250a\340\014\017\320\017 \240\001\240\032\2501\330\020\026\320\026(\320(<\270A\270Z\300q\330\021\"\240!\240:\250Q\330\020\026\320\026(\320(<\270A\270Z\300q\340\020\026\220j\240\001\240\021\330\014\023\2203\220j\240\006\240a\330\014\017\210u\220C\220q\230\001\230\021\330\020\026\220i\230q\320 R\320RY\320YZ\320Z]\320]g\320gh\330\014\023\2203\220j\240\001\330\014\024\220C\220z\240\021\330\014\026\220c\230\032\2401\330\014\021\220\030\230\021\230'\240\021\240'\250\026\250x\260q\270\001\330\014\021\220\030\230\021\230'\240\021\240'\250\026\250x\260q\270\001\330\014\020\220\005\220U\230!\2301\330\020\031\230\021\230%\230u\240A\240Q\330\020\033\2301\230E\240\027\250\001\250\021\330\014\020\220\t\230\021\320\032/\250s\260*\270D\300\016\310c\320Q[\320[_\320_k\320kq\320qu\320uv\330\010\017\210q\200A\330\"2\260!\360\036\000\t\037\230h\240a\240v\250Q\330\010\013\2106\220\023\220A\330\014\022\220*\230A\230Q\330\010\t\330\010\035\230Q\320\004$\240A\330\032\033\330\0323\2601\330\0333\2609\270A\360*\000\t\034\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\020\220\t\230\021\320\032*\250!\330\014\022\220!\220?\240!\2404\240w\250f\260O\3007\310!\340\014\022\220!\220?\240!\2404""\240w\250f\260F\270!\200A\330\036\037\330\0323\2601\330\0333\2609\270A\360&\000\t\014\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\020\220\t\230\021\320\032*\250!\330\014\022\220!\220=\240\001\240\024\240U\250!\340\014\020\220\t\230\021\320\032*\250!\330\014\022\220!\220=\240\001\240\024\240U\250!\200A\330$3\2601\360\024\000\t-\250L\270\001\270\021\340\010\016\210a\320\017.\250a\250q\200A\330&3\3203K\320Kc\320cl\320lm\3606\000\t\"\240\023\240H\250D\260\007\260z\300\021\330\010\"\240$\240h\250e\2607\270*\300A\330\010\033\2305\240\001\240\021\330\010\036\230a\330\010\"\240!\330\010\035\230X\240Q\240h\250a\250w\260a\260q\330\010\"\240*\250A\250Q\330\010\016\210a\320\017\"\240!\2404\240u\250F\260'\270\023\270F\300$\300g\310Q\200A\340\017\020\330\020\031\230\021\360\"\000\t3\260!\330\010\035\230Q\330\010\013\2104\210w\220f\230G\2403\240a\330\010\016\210a\320\017&\240a\240t\2505\260\006\260a\200A\330$3\260<\270\177\310l\320Zi\320ij\330\"1\260\032\270?\310)\320ST\3602\000\t\021\220\010\230\010\240\006\240f\250A\330\010\013\2105\220\007\220v\230X\240V\2501\250A\330\010\013\2105\220\007\220v\230X\240V\2501\250A\330\010\013\2105\220\007\220v\230X\240V\2501\250A\330\010\013\2103\210g\220V\2306\240\026\240q\250\001\330\010\013\2103\210g\220V\2306\240\026\240q\250\001\330\010\016\210a\320\017.\250a\250t\2607\270'\300\027\310\007\310u\320TU\200A\330\t\021\220\027\230\003\2303\230e\320#5\260Q\260a\330\010\020\220\010\230\001\200A\330 !\330\0334\260A\330\0344\260I\270Q\360&\000\t\014\210:\220W\230A\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220{\240&\250\001\330\014\020\220\t\230\021\320\032+\2501\330\014\022\220!\320\023#\2401\240D\250\007\320/?\270w\300a\340\014\022\220!\320\023#\2401\240D\250\007\250v\260Q\200A\340\022\023\330\016\017\330\016\017\330\017(\250\001\330\020(\250\t\260\021\3604\000\t\034\2301\330\010\013\2102\210W\220F\230'\240""\021\240!\330\010\033\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\020\220\t\230\021\320\032+\2501\330\014\022\220!\220>\240\021\240$\240e\2506\260\026\260~\300W\310A\340\014\022\220!\220>\240\021\240$\240e\2506\260\026\260v\270Q\200A\330\010\017\320\017!\240\022\2404\240q\200A\330\031!\240\021\360*\000\t\014\2104\210v\220V\230:\240Q\240a\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010&\240a\330\010\036\230l\250!\2501\330\010\013\2106\220\027\230\006\230g\240Q\330\010\016\210a\320\017\"\240!\2407\250!\2501\330\010\013\2108\2204\220q\330\014\022\220!\320\023(\250\001\250\027\260\001\260\021\330\010\020\220\014\230A\230V\2401\330\010\017\210q\200A\360\010\00067\340\010%\240Q\330\010$\320$6\260a\330\010&\240a\330\010.\250a\330\010\035\230Q\330\010\035\230Q\330\010*\250!\330\010'\240q\330\010(\250\001\330\010\032\230!\340\010\r\210X\220Q\220d\230!\230>\250\021\250!\330\010\027\220x\230q\240\016\250a\250}\270A\270Q\330\010\030\230\010\240\001\240\037\260\001\260\036\270q\300\001\330\010\032\230(\240!\320#4\260F\270!\2701\340\010\016\210a\210{\230!\2308\240<\250q\3200B\300!\3001\330\010\016\210a\210{\230!\2308\240<\250q\3200A\300\021\300!\330\010\016\210a\210{\230!\2308\240<\250q\3200C\3001\300A\330\010\014\210E\220\025\220a\220q\330\014\020\220\001\220\026\220u\230C\230q\240\003\2401\330\014\017\210x\220w\230a\230|\2501\250C\250q\330\014\030\230\001\230\025\230h\240a\240|\2601\260D\270\006\270l\310!\310=\320XY\320YZ\330\014\030\230\001\230\025\230e\2401\240A\360\006\000\t\017\210a\320\017+\2501\250D\260\005\260Q\330,2\260%\260q\330,;\2701\330,9\270\021\330,:\270!\330\010\016\210a\210y\230\001\230\021\330\010\016\210a\210y\230\001\230\021\330\010\016\210a\210y\230\001\230\021\200A\360\010\00067\340\010%\240Q\330\010$\320$6\260a\330\010&\240a\330\010.\250a\330\010\035\230Q\330\010\035\230Q\330\010*\250!""\330\010'\240q\330\010(\250\001\330\010\032\230!\340\010\r\210X\220Q\220d\230!\230>\250\021\250!\330\010\027\220x\230q\240\016\250a\250}\270A\270Q\330\010\030\230\010\240\001\240\037\260\001\260\036\270q\300\001\330\010\032\230(\240!\320#4\260F\270!\2701\340\010\016\210a\210{\230!\2308\240<\250q\3200B\300!\3001\330\010\016\210a\210{\230!\2308\240<\250q\3200A\300\021\300!\330\010\016\210a\210{\230!\2308\240<\250q\3200C\3001\300A\330\010\014\210E\220\025\220a\220q\330\014\020\220\001\220\026\220u\230C\230q\240\003\2401\330\014\017\210x\220w\230a\230|\2501\250C\250q\330\014\030\230\001\230\025\230h\240a\240|\2601\260D\270\006\270l\310!\310=\320XY\320YZ\330\014\030\230\001\230\025\230e\2401\240A\360\006\000\t\017\210a\320\017-\250Q\250d\260'\270\021\330.4\260E\270\021\330.=\270Q\330.;\2701\330.<\270A\330\010\016\210a\210y\230\001\230\021\330\010\016\210a\210y\230\001\230\021\330\010\016\210a\210y\230\001\230\021\320\004%\320%<\270A\330\0376\260o\320E[\320[k\360\000\000l\001B\002\360\000\000B\002C\002\330\036'\240q\360>\000\t\035\230A\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\340\010\036\230j\250\001\330\010\037\230~\250Q\330\010\022\220(\230!\2309\240A\240W\250A\250Q\330\010\022\220(\230!\2308\2401\240F\250!\2501\330\010\017\210u\220C\220u\230B\230c\240\021\240!\340\010\034\230G\2401\330\010!\240\021\330\010!\240\021\330\010!\240\021\340\010\013\2108\2207\230!\330\014\026\220h\230a\230y\250\001\250\025\250a\250q\330\014\017\210x\220w\230a\330\020\032\230$\230a\230q\330\020\027\220s\230!\2309\240C\240q\330\020\032\230(\240!\2407\250!\2506\260\026\260x\270q\300\001\330\020\024\220G\2309\240A\330\024\033\2301\230F\240%\240w\250a\250|\2703\270a\330\014\017\210y\230\007\230q\330\020\033\2304\230q\240\001\330\020\027\220s\230!\230:\240S\250\001\330\020\032\230(\240!\2407\250!\2506\260\026\260x\270q\300\001\330\020\024\220G\2309\240A\330\024\034\230A\230V\2405\250\010\260\001\260\034\270S\300\001\340\020\026\220j\240\001\240\021\340\014\023\2209\230C\230q\330\014\023""\2209\230C\230q\340\010\035\230Q\330\010\013\2105\220\007\220v\230X\240T\250\021\340\010\033\2307\240!\330\010\016\210a\320\017\"\240!\2404\240u\250F\260'\270\021\330#(\250\t\260\031\270!\330#*\250!\2503\250a\330\010\017\210q\320\004\034\230A\360\024\000\t\034\2307\240!\330\010\033\2307\240!\330\010\016\210a\210~\230Q\230d\240%\240q\250\003\2506\260\021\260#\260Q\330\010\016\210a\210{\230!\2303\230a\330\010\016\210a\210{\230!\2303\230a\330\010\020\220\005\220Q\200A\330\0347\260q\330(4\260G\270:\300Q\360<\000\t \230v\240Q\240a\330\010\037\230v\240Q\240a\330\010\037\230q\330\010\035\230Q\230m\2501\250A\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\016\210a\320\017!\240\021\240$\240e\2507\260!\2606\270\024\270V\3001\330\"(\250\006\250a\320\004,\250A\330\0367\260q\330\0377\260y\300\001\360&\000\t\014\210=\230\007\230q\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220~\240V\2501\330\014\020\220\t\230\021\320\032.\250a\330\014\022\220!\320\023-\250Q\250d\260'\3209L\310G\320ST\340\014\020\220\t\230\021\320\032.\250a\330\014\022\220!\320\023-\250Q\250d\260'\270\026\270q\200A\330\031%\320%7\260y\300\001\360.\000\t\014\2104\210v\220V\230:\240Q\240a\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010%\240Q\330\010&\240a\330\010\013\2106\220\027\230\006\230j\250\001\330\010\036\230l\250!\2501\330\010\013\2106\220\027\230\006\230g\240Q\330\010\016\210a\320\017\"\240!\2407\250!\2501\330\010\013\2108\2204\220q\330\014\022\220!\320\023(\250\001\250\027\260\t\270\021\270!\330\010\020\220\014\230A\230V\2401\330\010\017\210q\200A\340\021\022\330\017(\250\001\330\020(\250\t\260\021\360&\000\t\014\2108\2203\220f\230A\330\010\"\240$\240i\250q\260\001\330\010\013\210<\220s\230!\330\014\032\230!\330\014\020\220\t\230\021\230/\250\021\330\014\022\220!\220<\230q\240\004\240E\250\034\260V\2701\330\010\013\2106\220\023\220F\230(\240!\330\010\013\2106\220\023\220F\230(\240!\330\010\023\2209\230F\240!\330\010\023\2207\230!""\2301\200A\330'8\270\t\300\021\360<\000\t\037\230a\330\010\013\2107\220#\220V\2309\240G\2501\330\010\013\2107\220#\220V\2309\240C\240q\330\010\013\2106\220\025\220c\230\021\330\014\022\220!\320\023%\240Q\240m\2603\260f\270A\270Q\330\014\022\220!\320\023%\240Q\240g\250Q\250f\260A\330\010\013\2106\220\025\220c\230\021\330\014\022\220!\320\023%\240Q\240m\2603\260f\270A\270Q\330\014\022\220!\2209\230A\230W\240A\240V\2501\330\010\016\210a\320\017$\240A\240T\250\025\250b\260\001\330%(\250\006\250c\260\021\330%+\2506\260\026\260q\330\010\020\220\010\230\001\200A\330\0358\270\001\330'.\250j\270\001\3602\000\t \230v\240Q\240a\330\010\037\230v\240Q\240a\330\010\037\230v\240Q\240a\330\010\035\230Q\230a\330\010\016\210a\320\017\"\240!\2404\240u\250G\2601\260F\270$\270f\300A\330#)\250\021\200A\340\021\022\330\016+\2509\260A\360.\000\t%\240A\330\010\013\2105\220\007\220v\230X\240Q\330\010\032\230*\240A\330\010\022\220(\230!\2309\240A\240S\250\001\250\021\330\010\035\230]\250!\330\010\013\2106\220\023\220A\330\014\022\220!\320\023.\250a\330\024\030\230\006\230g\240S\250\005\250Q\250f\260A\330\010\021\220\030\230\021\230'\240\021\240'\250\021\250&\260\001\260\021\330\010\016\210a\320\017*\250!\330\020\024\220F\230'\240\023\240E\250\021\250&\260\001\330\010\017\210q\200A\340\021\022\330\016+\2509\260A\360.\000\t%\240A\330\010\013\2105\220\007\220v\230X\240Q\330\010\032\230*\240A\330\010\022\220(\230!\2309\240A\240S\250\001\250\021\330\010\035\230]\250!\330\010\013\2106\220\023\220A\330\014\022\220!\320\023.\250a\330\024\030\230\006\230g\240S\250\005\250Q\250f\260A\330\010\021\220\030\230\021\230'\240\021\240'\250\021\250&\260\001\260\021\330\010\016\210a\320\017/\250q\330\020\024\220F\230'\240\023\240E\250\021\250&\260\001\330\010\017\210q\200A\330\035+\2509\260A\360\036\000\t\037\230h\240a\240v\250Q\330\010\016\210a\320\017%\240Q\240g\250Q\200A\330\032%\240^\2609\270A\360\032\000\t\037\230h\240a\240v\250Q\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010\035""\230V\2401\330\010\016\210a\320\017#\2401\240G\2507\260!\2606\270\021\330\010\017\210q\200A\360\006\000\024\035\230A\3600\000\t$\2401\330\010\013\2107\220#\220Q\330\014\025\220S\230\001\330\r\023\2205\230\003\2301\330\014\024\220A\330\010\016\210a\210}\230A\230T\240\026\240s\250&\260\007\260q\270\006\270a\330\010\017\210q\200A\340\023\024\330\023\024\330\023\024\330\024\034\230A\360*\000\t$\2405\250\001\320)B\300%\300q\310\001\330\010#\2405\250\001\320)C\3005\310\001\310\021\330\010\016\210a\320\017\"\240!\2404\240u\250L\270\014\300L\320PQ\200A\340\017\034\230A\330\016\033\2309\240A\360(\000\t\027\220f\230G\2401\330\010\026\220f\230G\2401\330\010\030\230\006\230f\240A\330\010\032\230*\240A\330\010\013\2103\210e\2205\230\001\230\021\330\010\013\2103\210e\2205\230\001\230\021\330\010\034\230F\240'\250\021\330\010\034\230F\240'\250\021\330\010\016\210a\210}\230A\230T\240\026\240t\2501\250D\260\004\260A\260Q\330\010\t\330\014\020\220\007\220y\240\001\330\020\025\220W\230A\230W\240A\240R\240q\250\001\330\014\020\220\007\220y\240\001\330\020\025\220W\230A\230W\240A\240R\240q\250\001\340\014\017\210s\220\"\220B\220d\230#\230S\240\001\330\020\036\230a\230t\2401\240A\330\014\017\210s\220\"\220B\220d\230#\230R\230q\330\020\036\230a\230t\2401\240A\340\010\013\2102\210T\220\023\220H\230G\2401\330\r\024\220G\2301\330\r\024\220G\2301\330\024\033\2301\200A\360\006\000\017\020\330\017\034\230A\330\016\034\230I\240Q\360B\001\000\t\037\230h\240a\240v\250Q\330\010\031\230\025\230e\2401\330\010\021\220\021\220&\230\007\230q\240\004\240A\240S\250\001\250\021\330\010\013\2103\210c\220\036\230u\240A\330\010\013\2102\210R\210s\220$\220b\230\003\2301\330\010\013\2102\210R\210s\220$\220b\230\003\2301\330\010\016\210a\320\017\"\240!\2407\250!\2503\250a\250q\330\010\014\210B\210b\220\001\330\010\014\210B\210b\220\001\330\010\020\220\005\220Q\220d\230%\230q\240\001\200A\340\020\021\330\016\017\330\017\034\230A\330\016\034\230I\240Q\360*\000\t\037\230h\240a\240v\250Q\330\010\031\230\027\240\001""\330\010\021\220\030\230\021\230(\240!\2404\240q\250\001\330\010\031\230\025\230e\2401\330\010\021\220\021\220&\230\007\230q\240\004\240A\240S\250\001\250\021\330\010\022\220!\2207\230$\230a\230s\240!\2401\330\010\037\230q\330\010\013\2103\210c\220\021\330\014\022\220!\220>\240\021\330\024\033\2303\230c\240\024\240T\250\021\250!\340\014\022\220!\320\023&\240a\330\024\033\2304\230s\240#\240T\250\024\250Q\250a\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\200A\340\021\022\330\017\034\230A\330\016\034\230I\240Q\360&\000\t\037\230h\240a\240v\250Q\330\010\033\230:\240Z\250q\330\010 \240\001\330\010!\240\021\330\010\013\2106\220\027\230\006\230e\2405\250\001\250\021\330\010\013\2103\210c\220\036\230u\240A\330\010\022\220(\230!\2309\240A\240V\2501\250A\330\010\016\210a\320\017+\2501\330\020\027\220t\2306\240\025\240d\250!\2501\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\200A\340\016\017\330\017\034\230A\330\016\034\230I\240Q\360&\000\t\037\230h\240a\240v\250Q\330\010\031\230\025\230e\2401\330\010\021\220\021\220&\230\007\230q\240\004\240A\240S\250\001\250\021\330\010\022\220!\2207\230$\230a\230s\240!\2401\330\010\013\2103\210c\220\036\230u\240A\330\010\037\230q\330\010\016\210a\210y\230\001\230\027\240\001\240\021\330\010\016\210a\210{\230!\2308\2403\240a\330\010\016\210a\210\177\230a\230x\240q\330\010\016\210a\210z\230\021\230(\240!\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\200A\340\016\017\330\017\034\230A\330\016\034\230I\240Q\360&\000\t\037\230h\240a\240v\250Q\330\010\031\230\025\230e\2401\330\010\021\220\021\220&\230\007\230q\240\004\240A\240S\250\001\250\021\330\010\022\220!\2207\230$\230a\230s\240!\2401\330\010\037\230q\330\010\016\210a\210\177\230a\230w\240c\250\023\250A\250Q\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\013\2103\210c\220\021\330\014\022\220!\220?\240!\2404\240v\250Q\330\010\017\210q\320\004$\240A\360\024\000\t\035\230A\330\010\035\230Q""\330\010 \240\001\330\010 \240\001\330\010\016\210a\320\017$\240A\240T\250\026\250q\260\001\330\010\031\230\030\240\021\240'\250\021\250&\260\006\260a\260q\330\010\031\230\030\240\021\240'\250\021\250&\260\006\260a\260q\330\010\016\210a\320\017$\240A\240T\250\026\250u\260G\2707\300!\3001\330\010\020\220\007\220q\230\001\330\010\r\210X\220Q\220b\230\001\330\010\r\210X\220Q\220b\230\001\330\010\017\210q\320\004\034\230A\360\024\000\t%\240A\330\010\016\210a\320\017$\240A\240T\250\024\250Q\250d\260!\2601\330\010\017\210v\220Q\200A\340\022,\250A\330\024!\240\021\330\016&\240a\330\017\034\230A\330\016\034\230I\240Q\3600\000\t\032\230\021\330\010\035\230Q\330\010%\240Q\330\010\013\2101\330\014\027\220\177\240n\260A\330\010\013\2109\220G\2301\330\014\027\220x\230q\240\n\250!\2504\250q\260\001\340\010\013\2105\220\003\2206\230\030\240\025\240a\240u\250E\260\021\260!\330\010\036\230h\240a\240v\250Q\330\010\031\230\025\230e\2401\330\010\021\220\021\220&\230\007\230q\240\004\240A\240S\250\001\250\021\330\010\022\220!\2207\230$\230a\230s\240!\2401\330\010\013\2103\210c\220\036\230u\240A\330\010\013\2103\210b\220\004\220F\230*\240A\330\014\r\330\r\022\220!\2205\230\005\230Q\230d\240%\240q\250\001\330\010\037\230q\330\010\013\2109\220A\220W\230C\230q\330\014\022\220!\320\023-\250Q\250g\260T\270\023\270D\300\n\310!\3101\340\014\022\220!\320\023-\250Q\250g\260T\270\023\270C\270t\300:\310Q\310a\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\340\010\013\2109\220G\2301\330\014\020\220\t\230\021\230-\240q\330\010\017\210q\200A\340\022,\250A\330\023 \240\001\330\016&\240a\330\017\034\230A\330\016\034\230I\240Q\3600\000\t\032\230\021\330\010\035\230Q\330\010%\240Q\330\010\013\2101\330\014\027\220\177\240n\260A\330\010\013\2109\220G\2301\330\014\027\220x\230q\240\n\250!\2504\250q\260\001\340\010\013\2105\220\003\2206\230\030\240\025\240a\240u\250E\260\021\260!\330\010\036\230h\240a\240v\250Q\330\010\031\230\025\230e\2401\330\010\021\220\021\220&\230\007\230q\240\004\240A\240S""\250\001\250\021\330\010\022\220!\2207\230$\230a\230s\240!\2401\330\010\013\2103\210c\220\036\230u\240A\330\010\013\2103\210b\220\004\220F\230*\240A\330\014\r\330\r\022\220!\2205\230\005\230Q\230d\240%\240q\250\001\330\010\037\230q\330\010\013\2109\220A\220W\230C\230q\330\014\022\220!\320\023,\250A\250W\260D\270\003\2704\270z\310\021\310!\340\014\022\220!\320\023,\250A\250W\260D\270\003\2703\270d\300*\310A\310Q\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\340\010\013\2109\220G\2301\330\014\020\220\t\230\021\230-\240q\330\010\017\210q\200A\340\022,\250A\330\033(\250\001\330\016&\240a\330\017\034\230A\330\016\034\230I\240Q\3602\000\t\032\230\021\330\010\035\230Q\330\010#\2401\330\010\013\2101\330\014\025\220_\240N\260!\330\010\013\2109\220G\2301\330\014\027\220x\230q\240\n\250!\2504\250q\260\001\340\010\013\2105\220\003\2206\230\030\240\025\240a\240u\250E\260\021\260!\330\010\036\230h\240a\240v\250Q\330\010\031\230\025\230e\2401\330\010\021\220\021\220&\230\007\230q\240\004\240A\240S\250\001\250\021\330\010\022\220!\2207\230$\230a\230s\240!\2401\330\010\013\2103\210c\220\036\230u\240A\330\010\013\2103\210b\220\001\330\014\022\220*\230A\320\035W\320W\\\320\\]\320]b\320bg\320gh\320hl\320lq\320qr\320rs\330\010\037\230q\330\010\013\2109\220A\220W\230C\230q\330\014\022\220!\320\0231\260\021\260'\270\024\270S\300\004\300H\310A\310Q\340\014\022\220!\320\0231\260\021\260'\270\024\270S\300\003\3004\300x\310q\320PQ\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\340\010\013\2109\220G\2301\330\014\020\220\t\230\021\230-\240q\330\010\017\210q\200A\330\033\034\340\010$\240A\330\010\016\210a\210\177\230a\230q\240\001\330\010\017\210q\200A\330\010\030\230\004\230A\330\010\017\210u\220C\220q\200A\330\010\014\210D\220\001\200A\330\010\034\230D\240\001\330\010\016\210a\320\017(\250\001\250\024\250U\260$\260g\270T\300\030\310\024\310W\320TX\320XY\330\010\014\210J\220a\220w\230a\230t\2405\250\001\250\024\250T\260\027\270\t\300\021\330\010\017\210u\220A\220T\230""\021\320\004'\240}\260A\360\036\000\t\035\230E\240\021\240!\330\010\035\230Q\330\010\032\230!\330\010\032\230!\330\010\032\230!\330\010\017\210v\220Q\220h\230a\230s\240!\2403\240a\240q\330\010\034\230A\330\010\016\210a\210z\230\021\230$\230e\2401\240A\330\010\013\2104\210s\220!\330\014\022\220!\220>\240\021\240$\240e\2501\330\010\016\210a\210\177\230a\230t\2405\250\003\2503\250a\200A\330\010\014\210E\220\021\330\010\017\210q\200A\330\010\014\210F\220!\330\010\017\210q\320\004,\250A\360<\000\t\035\230G\2401\330\010\016\210a\320\017.\250a\250t\2606\270\022\2705\300\014\310M\320Yf\320fg\320gk\320kl\330\010\017\210q\200A\330\034$\240H\250A\360\036\000\t\034\2306\240\021\240!\330\010\016\210a\210z\230\021\230!\200A\330\010\014\210H\220A\330\010\017\210q\320\004A\300\030\310\021\360(\000\t\"\240\023\240H\250D\260\007\260z\300\021\330\010\033\2305\240\001\320!1\260\021\330\010\"\240!\330\010\016\210a\320\017\"\240!\2404\240u\250F\260#\260V\2704\270q\300\007\300q\310\001\330\010\t\330\014\026\220g\230Q\230g\240Q\340\014\022\220!\320\023*\250!\2504\250u\260F\270#\270V\3004\300q\310\007\310q\320PQ\330\010\017\210q\200A\340\016\017\330\017)\250\021\330\027\030\330\027\030\330\016\034\230I\240Q\3604\000\t\014\2105\220\003\2205\230\004\230G\2407\250&\260\007\260v\270X\300Q\330\010\013\2105\220\003\2205\230\004\230G\2407\250&\260\007\260v\270X\300Q\330\010\037\230q\330\010\037\230q\330\010\036\230h\240a\240v\250Q\330\010\034\230I\240W\250G\2607\270'\300\021\330\010\021\220\021\220&\230\007\230q\240\005\240Q\240e\2501\250C\250q\260\003\2601\260C\260q\270\001\330\010\022\220!\2207\230%\230q\240\003\2401\240A\330\010\022\220!\2207\230%\230q\240\003\2401\240A\340\010\037\230q\330\010\033\2301\330\010\013\2104\210s\220%\220u\230A\330\010\013\2107\220'\230\021\330\014\023\2206\230\021\330\010\013\2107\220'\230\021\330\014\023\2206\230\021\330\010\016\210a\210{\230!\2307\240$\240c\250\023\250C\250s\260&\270\006\270a\270q\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010""\017\210q\200A\340\016\017\330\017)\250\021\330\017)\250\021\330\024!\240\021\330\016\034\230I\240Q\3604\000\t \230q\340\010\036\230h\240a\240v\250Q\340\010\034\230I\240W\250G\2607\270'\300\021\360\006\000\t\014\210;\220g\230Q\330\014\025\220Q\220f\230F\240!\2405\250\001\250\025\250a\250s\260!\2603\260a\260s\270!\2701\330\014\017\210t\2203\220n\240F\250!\330\014\017\210t\2203\220n\240F\250!\330\014\026\220a\220w\230e\2401\240C\240q\250\001\330\014\026\220a\220w\230e\2401\240C\240q\250\001\340\014\022\220!\320\023%\240Q\240g\250S\260\003\2603\260c\270\037\310\016\320Vc\320cd\320de\340\014\022\220!\320\023#\2401\240H\250E\260\021\340\014\026\220a\220~\240V\2506\260\027\270\001\270\021\330\014\017\210v\220W\230A\330\020\030\230\016\240a\240t\2506\260\021\330\020\024\220I\230Q\230m\2501\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\200A\340\016\017\330\022\023\330\027\030\330\027\030\330\020\021\330\023\031\230\021\330\016\034\230I\240Q\360V\001\000\t\037\230h\240a\240v\250Q\330\010\034\230I\240W\250G\2607\270'\300\021\330\010\021\220\021\220&\230\006\230a\230u\240A\240U\250!\2503\250a\250s\260!\2603\260a\260q\330\010\022\220!\2207\230#\230Q\230c\240\021\240!\330\010\022\220!\2207\230#\230Q\230c\240\021\240!\330\010\035\230U\240!\2401\330\010\032\230&\240\001\240\037\260\001\330\010\013\320\013\034\230A\230U\240%\240|\2601\260A\330\010\013\210<\220q\230\004\230C\230s\240&\250\n\260!\330\r\016\330&)\250\034\260Q\260a\330\010\034\230K\240{\260!\2604\260q\330\010\013\2104\210r\220\023\220F\230*\240A\330\r6\260b\270\001\330\010\013\210;\220k\240\021\240$\240c\250\023\250F\260&\270\n\300!\330\r2\260\"\260A\330\010\032\230&\240\001\240\037\260\001\330\010\013\320\013\034\230A\230U\240%\240|\2601\260A\330\010\013\210<\220q\230\004\230C\230s\240&\250\n\260!\330\r\016\330&)\250\034\260Q\260a\330\010\034\230K\240{\260!\2604\260q\330\010\013\2104\210r\220\023\220F\230*\240A\330\r6\260b\270\001\330\010\013\210;\220k\240\021\240$\240c\250\023\250F\260&""\270\n\300!\330\r2\260\"\260A\340\010\035\230Q\230h\240a\330\010\037\230q\330\010\016\210a\320\017'\240q\330\014\023\2203\220c\230\023\230C\230q\330\014\030\230\014\240A\240Q\330\014\030\230\014\240A\240Q\330\014\"\240'\250\021\330\014\r\210Q\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\014\210I\220Q\320\026.\250a\330\010\017\210q\200A\340\016\017\330\017\034\230I\240Q\360\"\000\t\032\230\025\230e\2401\330\010\021\220\021\220&\230\007\230q\240\004\240A\240S\250\001\250\021\330\010\016\210a\210{\230!\2304\230v\240S\250\001\330\010\013\2103\210c\220\021\330\014\022\220!\220?\240!\2404\240v\250Q\200A\340\017\020\330\021\022\330\016\034\230I\240Q\360&\000\t\037\230h\240a\240v\250Q\330\010\033\2305\240\001\240\021\330\010\035\230Z\240q\330\010 \240\001\330\010\037\230q\330\010\022\220(\230!\2309\240A\240V\2501\250A\330\010\016\210a\210}\230A\230W\240D\250\006\250e\2604\260q\270\001\330\010\016\210a\210z\230\021\230$\230h\240d\250(\260!\330\010\017\210q\200A\340\016\017\330\016\017\330\016\034\230I\240Q\360&\000\t\037\230h\240a\240v\250Q\330\010\034\230I\240W\250G\2607\270'\300\021\330\010\021\220\021\220&\230\006\230a\230u\240A\240U\250!\2503\250a\250s\260!\2603\260a\260q\330\010\022\220!\2207\230%\230q\240\003\2401\240A\330\010\022\220!\2207\230%\230q\240\003\2401\240A\330\010\037\230q\330\010\016\210a\320\017(\250\001\250\027\260\003\2603\260c\270\023\270F\300!\3001\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\200A\340\016\017\330\r\016\330\017)\250\021\330\016\034\230I\240Q\360:\000\t\037\230h\240a\240v\250Q\340\010\034\230I\240W\250G\2607\270'\300\021\330\010\021\220\021\220&\230\007\230q\240\005\240Q\240e\2501\250C\250q\260\003\2601\260C\260q\270\001\330\010\013\2104\210s\220.\240\006\240a\330\010\013\2104\210s\220.\240\006\240a\330\010\022\220!\2207\230%\230q\240\003\2401\240A\330\010\022\220!\2207\230%\230q\240\003\2401\240A\360\006\000\t\n\330\014\r\210T\220\024\220V\2305\240\005\240W\250A\330\020\033\2301\330""\014\020\220\004\220E\230\021\330\014\022\220&\230\006\230a\340\010\031\230\027\240\006\240j\260\001\330\010\031\230\027\240\006\240j\260\001\330\010\r\210X\220Q\220d\230!\2304\230q\240\001\330\010\r\210X\220Q\220d\230!\2304\230q\240\001\330\010\013\2103\210c\220\021\220!\2204\220v\230Z\240q\330\014\r\330\r\022\220!\2204\220u\230A\230Q\230a\230t\2405\250\001\250\021\330\010\013\2104\210w\220e\2304\230t\2407\250!\330\014\022\220(\230!\2305\240\001\240\025\240a\240q\330\014\022\220(\230!\2305\240\001\240\025\240a\240q\330\010\031\230\027\240\001\330\010\034\230J\240a\330\010\r\210X\220Q\220d\230!\2304\230q\240\001\330\010\013\2103\210c\220\025\220f\230J\240a\330\014\r\330\r\022\220!\2205\230\005\230Q\230a\330\010\013\2104\210w\220a\330\014\022\220(\230!\2305\240\001\240\025\240a\240q\340\010\037\230q\330\010\013\2109\220A\220W\230C\230q\330\014\022\220!\320\023,\250A\330\020\027\220s\230#\230S\240\003\2403\240a\240q\330\014\023\2204\220t\2301\360\010\000\r\020\210s\220#\220U\230$\230c\240\023\240E\250\024\250S\260\003\2601\330\020\026\220a\320\0275\260Q\330\024\033\2303\230c\240\023\240C\240s\250#\250S\260\004\260D\270\004\270A\270Q\330\020\027\220q\230\004\230D\240\006\240e\2505\260\001\340\020\026\220a\320\0270\260\001\330\024\033\2303\230c\240\023\240C\240s\250#\250S\260\001\260\021\330\020\026\220a\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\014\210I\220Q\220k\240\021\330\010\017\210q\200A\340\021\022\330\016\034\230I\240Q\360\"\000\t\037\230h\240a\240v\250Q\330\010\035\230Z\240q\330\010 \240\001\330\010\037\230q\330\010\022\220(\230!\2309\240A\240V\2501\250A\330\010\016\210a\210\177\230a\230w\240f\250E\260\024\260Q\260a\330\010\016\210a\210z\230\021\230$\230h\240d\250(\260!\330\010\017\210q\200A\340\016\017\330\017)\250\021\330\017)\250\021\330\016\034\230I\240Q\360,\000\t \230q\330\010\022\220!\220:\230V\2406\250\027\260\001\260\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\340\010\013\2106\220\027\230\001\330\014\024\220N""\240!\2404\240v\250Q\330\014\020\220\t\230\021\230-\240q\330\010\017\210q\200A\340\027J\310!\360\036\000\t(\240q\330\010'\240q\330\010'\240q\330\010\022\220!\220?\240!\2405\250\001\250\025\250a\250q\330\010\016\210a\320\017\"\240!\2404\240u\250E\260\025\260a\200A\360\006\000\032!\240\001\330\035$\240J\250a\360*\000\t+\250&\260\001\260\021\330\010.\250f\260A\260Q\330\010\016\210a\320\017#\2401\240D\250\013\2602\260U\320:L\310A\200A\340\030K\3101\360\036\000\t(\240q\330\010'\240q\330\010'\240q\330\010\022\220!\320\023#\2401\240E\250\021\250%\250q\260\001\330\010\016\210a\320\017%\240Q\240d\250%\250u\260E\270\021\200A\330'@\300\r\320Me\320en\320no\360\024\000\t\014\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\320\023+\2506\260\021\330\010\014\210I\220Q\320\0264\260A\330\010\016\210a\320\0171\260\021\260$\260f\270A\270Q\3302M\310W\320TU\320\004A\300\035\320Nf\320f~\360\000\000\177\001H\002\360\000\000H\002I\002\3600\000\t\"\240\023\240H\250D\260\007\260z\300\021\330\010\033\2305\240\001\240\021\330\010\036\230a\330\010\"\240!\330\010\035\230X\240Q\240h\250a\250w\260a\260q\330\010\"\240*\250A\250Q\330\010\016\210a\320\017\"\240!\2404\240u\250F\260#\260V\2704\270w\300a\200A\340\r\032\230!\330\027O\310q\330\026+\2501\330\027$\240I\250Q\3602\000\t\036\230Z\240q\330\010\032\230'\240\027\250\001\330\010\032\230'\240\027\250\001\330\010'\240q\330\010'\240q\330\010'\240q\330\010,\250A\330\010,\250A\330\010\016\210a\210{\230!\2304\230q\330\033\034\230A\330\033\034\230C\230q\240\003\2401\240A\330\033\034\230C\230q\240\003\2401\240A\330\033\034\230F\240!\2401\330\033\034\230E\240\021\240%\240q\250\001\330\033\034\230A\330\010\"\240,\250l\270!\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\004\260A\260T\270\021\270!\330\010\035\230Q\330\010\016\210a\320\017!\240\021\240-\250t\2605\270\001\270\021\340\010\013\2104\210w\220a\330\014\023\2205\230\001\230\021\330\010\013\210>\230\027\240\001\330\014\026\220a\220\177\240a\240u\250A\250U\260!""\2601\330\010\013\210>\230\027\240\001\330\014\024\220I\230Q\230a\330\010\013\210>\230\027\240\001\330\014\025\220U\230!\2301\340\010\027\220t\2301\330\010\016\210a\210|\2301\230F\240&\250\001\330\034\037\230s\240#\240S\250\003\2503\250d\260$\260a\330\034!\240\025\240e\2507\260!\330\034\035\230R\230q\330\010\016\210a\210w\220a\220r\230\021\330\010\017\210q\320\004-\320-A\300\034\310Q\3301=\270Y\300a\3602\000\t%\240A\330\010\013\210;\220g\230V\240>\260\032\2701\330\010$\240A\330\010\013\210;\220g\230V\240>\260\032\2701\330\010\035\230U\240!\2401\330\010#\2401\330\010\013\2106\220\027\230\001\330\014\027\220q\230\010\240\003\2401\320$6\260a\260q\330\014\023\2203\220a\220w\230c\240\021\330\014\020\220\005\220U\230!\2301\330\020\031\230\021\230&\240\006\240e\2501\250C\250q\330\010#\2401\330\010\013\2106\220\027\230\001\330\014\027\220q\230\010\240\003\2401\320$6\260a\260q\330\014\023\2203\220a\220w\230c\240\021\330\014\020\220\005\220U\230!\2301\330\020\031\230\021\230(\240&\250\005\250Q\250c\260\021\330\010\017\210q\320\020(\250\001\250\024\250U\260&\270\r\300Q\330)6\260a\330\010\017\210q\220\t\230\021\230!\330\010\017\210q\220\t\230\021\230!\200A\340\016\017\330\017\025\220Q\330\016\024\220A\330\016\034\230I\240Q\360*\000\t\037\230h\240a\240v\250Q\330\010\037\230u\240A\240Q\330\010\037\230u\240A\240Q\330\010\037\230u\240A\240Q\330\010\037\230q\330\010\016\210a\210~\230Q\230g\240W\250H\260G\2701\270A\330\010\016\210a\210z\230\021\230$\230h\240d\250(\260!\330\010\017\210q\200A\340\016\017\330\016-\250Q\330\016\034\230A\330\014\r\360&\000\t\037\230h\240a\240v\250Q\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010#\2408\2501\250A\330\010\"\240!\330\010\016\210a\320\017 \240\001\240\027\250\001\250\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\016\210a\320\017!\240\021\240$\240f\250A\330\010\016\210a\320\017%\240Q\240d\250&\260\001\330\010\016\210a\320\017%\240Q\240d\250&\260\001\330\010\017\210q\200A\330\037 \360\024\000\t\032""\230\024\230Q\330\010\014\210H\220A\330\010\017\210q\200A\340\016\017\330\017%\240Q\330\016\034\230I\240Q\360(\000\t\020\210t\2201\220A\330\010\013\2101\330\014\024\220D\230\001\230\021\330\014\023\2203\220a\220w\230c\240\023\240A\240Q\340\014\024\220A\330\010\036\230h\240a\240v\250Q\330\010\037\230s\240!\2401\330\010\032\230*\240A\330\010 \240\001\330\010 \240\001\340\010\022\220(\230!\2307\240!\2404\240v\250X\260Q\260a\330\010\014\210G\2209\230C\230u\240A\240V\2506\260\024\260Q\260c\270\021\330\010\013\2106\220\027\230\001\330\014\026\220h\230a\230w\240a\240t\2506\260\030\270\021\270!\330\014\020\220\007\220y\240\003\2406\250\021\250&\260\005\260U\270!\2703\270a\330\010\037\230q\330\010\016\210a\210}\230A\230W\240C\240x\250w\260a\260q\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\200A\340\017\020\330\r\016\330\024-\250Q\330\025-\250Q\330\022+\2501\330\023+\2509\260A\3602\000\t0\250}\270A\330\010\013\2106\220\027\230\001\330\014\017\210|\2303\230f\240M\260\021\330\014\017\210|\2303\230f\240N\260!\330\014\027\220w\230l\250!\330\014\020\220\t\230\021\320\032+\2501\330\014\025\220Q\220a\330\010\013\2104\210w\220a\330\014\017\210z\230\023\230F\240+\250Q\330\014\017\210z\230\023\230F\240,\250a\330\014\027\220u\230J\240a\330\014\020\220\t\230\021\230/\250\021\330\014\023\2201\220A\330\010\016\210a\320\017&\240a\240t\2505\260\010\270\001\200A\340\017\020\330\r\016\330\024-\250Q\330\025-\250Q\330\022+\2501\330\023+\2509\260A\3602\000\t0\250}\270A\330\010\021\220\021\330\010\017\210q\330\010\013\2106\220\027\230\001\330\014\017\210|\2303\230f\240M\260\021\330\014\017\210|\2303\230f\240N\260!\330\014\027\220w\230l\250!\330\014\020\220\t\230\021\320\032+\2501\330\014\025\220Q\220a\330\010\013\2104\210w\220a\330\014\017\210z\230\023\230F\240+\250Q\330\014\017\210z\230\023\230F\240,\250a\330\014\027\220u\230J\240a\330\014\020\220\t\230\021\230/\250\021\330\014\023\2201\220A\330\010\016\210a\320\017%\240Q\240d\250%\250x\260q\200A\340\017\020\330\r""\016\330\024-\250Q\330\025-\250Q\330\022+\2501\330\023+\2509\260A\3606\000\t0\250}\270A\330\010\013\2106\220\027\230\001\330\014\017\210|\2303\230f\240M\260\021\330\014\017\210|\2303\230f\240N\260!\330\014\027\220w\230l\250!\330\014\020\220\t\230\021\320\032+\2501\330\014\025\220Q\220a\330\010\013\2104\210w\220a\330\014\017\210z\230\023\230F\240+\250Q\330\014\017\210z\230\023\230F\240,\250a\330\014\027\220u\230J\240a\330\014\020\220\t\230\021\230/\250\021\330\014\023\2201\220A\330\010\016\210a\320\017&\240a\240t\2505\260\010\270\001\200A\360\006\000\020\026\220Q\330\017\025\220Q\330\016\025\220Q\330\024\033\2309\240A\3600\000\t \230u\240A\240Q\330\010\037\230u\240A\240Q\330\010\037\230q\330\010%\240Q\330\010\016\210a\320\017(\250\001\250\024\250U\260!\2606\270\030\300\030\310\027\320PQ\320\004\034\230A\360\024\000\t\036\230Q\330\010\035\230Q\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\001\330\010\035\230X\240Q\240g\250Q\250j\270\004\270F\300(\310!\3101\330\010\016\210a\320\017)\250\021\250$\250e\2601\330\010\030\230\001\330\010\034\230A\330\010\014\210G\2209\230A\330\014\024\220J\230a\230t\2401\240C\240q\330\014\021\220\026\220t\2301\230A\330\014\022\220!\220;\230a\230u\240A\330\014\023\2207\230!\2301\330\010\017\210q\200A\340\016\035\230Q\330\016\035\230Q\330\020\037\230q\330\020\035\230Y\240a\360X\001\000\t\021\220\010\230\n\240!\330\010\013\2107\220'\230\026\230z\250\026\250q\260\001\330\010\013\2107\220'\230\026\230z\250\026\250q\260\001\330\010\013\2107\220'\230\026\230z\250\026\250q\260\001\330\010 \240\001\330\010\013\2107\220'\230\026\230z\250\025\250a\250q\330\010\016\210a\320\017\037\230q\240\004\240F\250'\260\027\270\t\300\021\320\004$\240A\360\030\000\t.\250Q\330\010\016\210a\320\017#\2401\240D\250\005\250Q\250a\330\010\017\210q\320\004$\240A\360\024\000\t&\240Q\330\010\016\210a\320\017+\2501\250D\260\010\270\001\270\021\330\010\017\210u\220A\220Q\320\004$\240A\340\010\035\230Q\330\010\016\210a\320\017$\240A\240T\250\026\250q\260\001\330\010\017""\210u\220A\220Q\320\004\034\230A\360\024\000\t\036\230Q\330\010\016\210a\210}\230A\230T\240\026\240q\250\001\330\010\017\210v\220Q\220a\320\004$\240A\360\024\000\t\036\230Q\330\010\016\210a\320\017%\240Q\240d\250'\260\021\260!\330\010\017\210u\220A\220Q\320\004$\240A\360\024\000\t\036\230Q\330\010\016\210a\320\017(\250\001\250\024\250U\260!\2601\330\010\017\210u\220A\220Q\320\004$\240A\360\024\000\t\036\230Q\330\010\016\210a\320\017.\250a\250t\2607\270!\2701\330\010\017\210u\220A\220Q\320\004$\240A\360\024\000\t\036\230Q\330\010\016\210a\320\017'\240q\250\004\250E\260\021\260!\330\010\017\210u\220A\220Q\320\004$\240A\360\022\000\t&\240Q\330\010\016\210a\320\017/\250q\260\004\260L\300\001\300\021\330\010\017\210x\220q\230\001\200A\340\020\035\230Q\330\017\026\220j\240\001\360<\000\t \230q\330\010\037\230q\330\010\036\230a\330\010\r\210W\220C\220q\330\r\024\220G\2306\240\027\250\005\250Q\250a\330\010\013\2105\220\002\220#\220W\230A\330\010\013\2107\220'\230\021\330\010\033\2308\2401\240G\2501\250G\2606\270\021\270!\330\010\014\210I\220Q\220o\240Q\330\010\016\210a\320\017$\240A\240T\250\026\250v\260V\2701\320\004\034\230A\360\024\000\t\036\230Q\330\010'\240q\330\010\016\210a\320\017,\250A\330\020\024\220F\230!\2301\330\010\016\210a\320\017/\250q\330\020\024\220F\230!\2301\330\010\037\230q\330\010\t\330\014\027\220w\230a\230v\240Q\340\014\022\220!\320\0237\260q\330\024\030\230\006\230a\230q\330\010\017\210q\320\004\034\230A\360\024\000\t\036\230Q\330\010'\240q\330\010\016\210a\210~\230Q\230d\240'\250\021\250!\330\010\016\210a\210|\2301\230D\240\007\240q\250\001\330\010\037\230q\330\010\t\330\014\027\220w\230a\230v\240Q\340\014\022\220!\320\023#\2401\240D\250\007\250q\260\001\330\010\017\210q\320\004,\250A\360 \000\t\036\230Q\230a\330\010\035\230Q\230a\330\010\016\210a\210\177\230a\230t\2406\250\026\250q\200A\360\006\000\022*\250\031\260!\360&\000\t\026\220Q\220l\240,\250i\260q\270\001\330\010\016\210a\210|\2301\230D\240\006\240f\250G\2601\260A\200A\360\010\000\022*\250""\031\260!\360.\000\t\026\220Q\220l\240-\250y\270\001\270\021\330\010\016\210a\210|\2301\230D\240\006\240e\2507\260%\260w\270a\270q\200A\360\010\000\022*\250\031\260!\360.\000\t\026\220Q\220m\240=\260\t\270\021\270!\330\010\016\210a\210{\230!\2304\230v\240U\250'\260\025\260g\270Q\270a\200A\360\006\000\022*\250\031\260!\360&\000\t\026\220Q\220m\240<\250y\270\001\270\021\330\010\016\210a\320\017 \240\001\240\024\240V\2506\260\027\270\001\270\021\200A\340\016\017\330\017)\250\031\260!\360R\001\000\t\035\230I\240W\250G\2607\270'\300\021\330\010\021\220\021\220&\230\007\230q\240\005\240Q\240e\2501\250C\250q\260\003\2601\260C\260q\270\001\330\010\016\210a\210{\230!\2304\230v\240S\250\003\2503\250a\330\010\013\2104\210s\220!\330\014\017\210t\2203\220a\330\020\026\220a\320\027'\240q\250\004\250F\260%\260q\340\020\026\220a\220\177\240a\240t\2506\260\021\320\004\034\230A\360\024\000\t\026\220R\220q\330\010\016\210a\210|\2301\230D\240\005\240Q\240b\250\001\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004,\250A\360\036\000\t\026\220S\230\001\330\010\031\230\023\230A\330\010\016\210a\320\017$\240A\240T\250\025\250b\260\001\330%&\240a\240v\250Q\250e\2601\330\010\020\220\003\2201\320\004\034\230A\360*\000\t\026\220S\230\001\330\010\025\220S\230\001\330\010\025\220S\230\001\330\010\025\220S\230\001\330\010\016\210a\210}\230A\230T\240\026\240q\250\001\250\026\250q\260\001\260\026\260q\270\001\270\026\270q\300\001\300\021\330\010\016\210a\210{\230!\2301\230A\330\010\016\210a\210{\230!\2301\230A\330\010\016\210a\210{\230!\2301\230A\330\010\016\210a\210{\230!\2301\230A\330\010\020\220\003\2203\220c\230\021\320\004\034\230A\360\024\000\t\026\220S\230\001\330\010\025\220S\230\001\330\010\016\210a\210}\230A\230T\240\026\240q\250\001\250\026\250q\260\001\260\026\260v\270Q\330\010\016\210a\210{\230!\2301\230A\330\010\016\210a\210{\230!\2301\230A\330\010\036\230d\240)\2501\250A\330\010\020\220\003\2203\220a\320\004$\240A\360\024\000\t\026\220S\230\001\330\010\016\210a\320\017#""\2401\240D\250\005\250Q\250a\250q\330\010\016\210a\210{\230!\2301\230A\330\010\017\210q\320\004\034\230A\360\024\000\t\026\220S\230\001\330\010\016\210a\320\017\037\230q\240\004\240F\250!\2501\250A\330\010\016\210a\210{\230!\2301\230A\330\010\017\210q\200A\360\006\000\021\022\330\020\"\240!\360&\000\t!\240\001\330\010\032\230(\240+\250S\260\001\260\021\330\010'\240q\330\010\036\230h\240a\240w\250a\250u\260F\270(\300!\3001\330\010\021\220\024\220Q\220a\330\010\014\210G\2209\230A\330\014\025\220Q\220f\230A\230T\240\021\240!\330\014\026\220a\220u\230A\330\010\033\230;\240c\250\021\250!\330\010'\240q\330\010\036\230h\240a\240w\250a\250u\260F\270(\300!\3001\330\010\021\220\024\220Q\220a\330\010\014\210G\2209\230A\330\014\025\220Q\220f\230A\230T\240\021\240!\330\014\026\220a\220u\230A\330\010)\250\021\330\010\016\210a\320\017\"\240!\2402\240U\250$\250l\270$\270l\310!\3101\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\200A\360\n\000\036\037\360T\001\000\t \230~\250Q\330\010\013\2108\2207\230&\240\n\250'\260\021\330\010\013\2108\2207\230&\240\n\250%\250q\330\010#\2401\330\010\016\210a\320\017\037\230q\330\020\030\230\006\230i\240v\250V\2607\270!\2701\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\200A\330\010\035\230T\240\025\240a\330\010\016\210a\320\017#\2401\240F\250!\2504\250u\260A\330\010\017\210t\2201\200A\330\010\035\230T\240\025\240a\330\010\016\210a\320\017'\240q\250\006\250a\250t\2605\270\001\330\010\014\210E\220\027\230\001\200A\340\025\026\360\036\000\t\036\230T\240\021\330\010\037\230q\330\010\016\210a\320\017 \240\001\240\026\240q\250\001\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004,\320,A\300\021\360\"\000\t\036\230U\240!\2401\330\010\016\210a\320\017)\250\021\250$\250e\2606\270\023\270A\200A\360\006\000\024\025\330\016\035\230Y\240a\360B\001\000\t$\2401\330\010\036\230a\330\010\013\2107\220#\220Q\330\014\025\220S\230\001\330\r\023\2205\230\003\2301\330\014\024\220A""\330\010\013\2105\220\007\220v\230W\240F\250!\2501\330\010\016\210a\320\017\"\240!\2404\240v\250S\260\006\260g\270V\3001\300F\310!\330\010\017\210q\200A\360\006\000\024\025\330\016\035\230Y\240a\360B\001\000\t$\2401\330\010\036\230a\330\010\013\2107\220#\220Q\330\014\025\220S\230\001\330\r\023\2205\230\003\2301\330\014\024\220A\330\010\013\2105\220\007\220v\230W\240F\250!\2501\330\010\016\210a\210z\230\021\230$\230f\240C\240v\250W\260F\270!\2706\300\021\330\010\017\210q\200A\360\006\000\024\025\330\016\035\230Y\240a\360B\001\000\t$\2401\330\010\037\230q\330\010\013\2107\220#\220Q\330\014\025\220S\230\001\330\r\023\2205\230\003\2301\330\014\024\220A\330\010\013\2105\220\007\220v\230X\240V\2501\250A\330\010\016\210a\210w\220a\220t\2306\240\021\240&\250\007\250w\260a\260v\270Q\330\010\017\210q\200A\360\006\000\024\025\330\016\035\230Y\240a\360J\001\000\t$\2401\330\010\037\230q\330\010\013\2107\220#\220Q\330\014\025\220S\230\001\330\r\023\2205\230\003\2301\330\014\024\220A\330\010\013\2105\220\007\220v\230X\240V\2501\250A\330\010\016\210a\210w\220a\220t\2306\240\021\240&\250\007\250w\260a\260v\270Q\330\010\017\210q\200A\360\010\000\024\025\330\016\035\230Y\240a\360<\000\t$\2401\330\010\037\230q\330\010\013\2107\220#\220Q\330\014\025\220S\230\001\330\r\023\2205\230\003\2301\330\014\024\220A\330\010\013\2105\220\007\220v\230X\240V\2501\250A\330\010\016\210a\210}\230A\230T\240\026\240q\250\006\250a\250v\260W\270G\3001\300F\310!\330\010\017\210q\200A\340\014\r\330\016%\240Y\250a\360\"\000\t\014\2105\220\003\2206\230\027\240\005\240Q\240c\250\021\250!\330\016\025\220S\230\001\230\026\230s\240#\240Q\240a\330\010\032\230!\330\010\037\230q\330\010\017\210x\220q\230\006\230a\230s\240!\2401\340\010\035\230Q\330\010\035\230X\240Q\240g\250Q\250d\260&\270\010\300\001\300\021\330\010\014\210G\2209\230C\230s\240!\2406\250\026\250r\260\021\260#\260Q\340\010\016\210a\320\017 \240\001\240\024\240V\2503\250g\260Q\200A\330!-\250Y\260a\340\010\t\360\024\000\t\020\210q\200A\330\034\035\330&-""\250Z\260q\360.\000\t\037\230f\240A\240Q\330\010\036\230a\330\010\016\210a\320\017!\240\021\240$\240e\2506\260\021\260&\270\004\270A\330\"#\2406\250\021\200A\340\027\030\340\027\030\330\027&\240a\360J\001\000\t\036\230Q\330\010\035\230Q\230a\330\010\035\230Q\330\010\035\230Q\330\010\037\230q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\016\210a\210|\2301\230F\240&\250\006\250f\260A\260Q\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\200A\330 !\360\024\000\t\017\210a\320\017#\2401\320\004$\240A\360\024\000\t\017\210a\320\017+\2501\250D\260\001\320\004 \240\001\360\024\000\t-\250A\330\010\016\210a\320\017#\2401\240D\250\005\250Q\250a\330\010\017\210}\230A\230Q\320\004$\240A\360\024\000\t\017\210a\210|\2301\230D\240\006\240c\250\021\320\004$\240A\360\"\000\t!\240\001\330\010\016\210a\210|\2301\230D\240\006\240c\250\026\250q\260\001\320\004\031\230\021\360\024\000\t-\250A\330\010\016\210a\320\017#\2401\240D\250\010\260\001\260\021\330\010\017\210y\230\001\230\021\200A\330\026\027\360\024\000\t\017\210a\320\017#\2401\200A\330\036\037\330\032&\240a\330\0323\260=\320@X\320Xa\320ab\360.\000\t\034\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\033\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\020\220\t\230\021\320\032*\250!\330\014\022\220!\220?\240!\2404\240w\250f\260F\270/\310\027\320PQ\340\014\022\220!\220?\240!\2404\240w\250f\260F\270&\300\001\320\004\032\230!\360\024\000\t\035\230A\330\010\032\230!\330\010\032\230!\330\010\032\230!\330\010\016\210a\210{\230!\2304\230q\330\033\034\230A\330\033\034\230C\230q\240\003\2401\240A\330\033!\240\026\240q\330\033!\240\021\330\033!\240\026\240q\330\033\034\330\010\017\210v\220Q\220e\2303\230c\240\021\320\004\030\230\001\360\024\000\t\035\230A\330""\010\016\210a\210{\230!\2304\230q\330\033\034\330\033!\240\026\240q\330\033!\240\026\240q\330\033\034\230E\240\021\330\033!\240\026\240q\330\033\034\330\010\017\210u\220A\220Q\200A\330!\"\360\024\000\t\017\210a\320\017$\240A\320\004\034\230A\360\024\000\t\017\210a\210}\230A\230T\240\021\320\004$\240A\360\036\000\t\017\210a\210}\230A\230T\240\025\240a\240q\320\004,\250A\360\036\000\t\017\210a\320\017$\240A\240T\250\025\250a\250q\320\004(\250\001\360\032\000\t\035\230A\330\010\016\210a\320\017,\250A\250T\260\025\260a\260q\330\010\017\210u\220A\220Q\320\004$\240A\360\024\000\t\017\210a\210}\230A\230T\240\025\240b\250\001\330\010\t\320\004,\250A\360\036\000\t\017\210a\320\017$\240A\240T\250\025\250b\260\001\320\004!\240\033\250A\360\024\000\t\017\210a\320\017$\240A\240T\250\026\250q\320\004$\240A\360\024\000\t\033\230!\330\010\016\210a\320\017$\240A\240T\250\026\250q\260\001\330\010\017\210u\220A\220Q\320\004$\240A\360\024\000\t!\240\001\330\010\016\210a\320\017$\240A\240T\250\026\250q\260\001\330\010\017\210v\220Q\220a\320\004\034\230A\360\024\000\t\"\240\021\330\010\016\210a\210}\230A\230T\240\026\240q\250\001\330\010\017\210y\230\001\230\021\200A\340\021\036\230a\330\017\034\230A\330\022+\2501\330\016-\250Q\330\014\r\360*\000\t%\240A\330\010\"\240!\330\010\022\220)\2301\230I\240Q\240a\330\010\020\220\t\230\021\230'\240\021\240!\340\010\014\210D\220\004\220D\230\001\330\010\013\2109\220H\230F\240!\330\014\017\210t\2201\330\010\013\2105\220\010\230\006\230a\330\014\r\330\020\023\2204\220q\330\023\024\330\020\024\220D\230\001\330\010\016\210a\320\017%\240Q\240d\250!\330&0\260\001\330&)\250\023\250C\250q\200A\340\021\036\230a\330\017\034\230A\330\022+\2501\330\016-\250Q\330\016\034\230A\330\014\r\360.\000\t\037\230h\240a\240v\250Q\330\010$\240A\330\010\"\240!\330\010\022\220)\2301\230I\240Q\240a\330\010\020\220\t\230\021\230'\240\021\240!\340\010\014\210D\220\004\220D\230\001\330\010\013\2109\220H\230F\240!\330\014\017\210t\2201\330\010\013\2105\220\010\230\006\230a\330""\014\r\330\020\023\2204\220q\330\023\024\330\020\024\220D\230\001\330\010\"\240!\330\010\016\210a\320\017\"\240!\2407\250*\260A\330#&\240c\250\023\250C\250q\260\001\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\200A\340\017\020\330\016&\240a\330\017\034\230A\330\016\034\230I\240Q\3602\000\t\032\230\021\330\010\035\230Q\330\010\020\220\010\230\001\230\027\240\001\240\024\240Q\240a\330\010\013\2105\220\003\2206\230\030\240\025\240a\240u\250E\260\021\260!\330\010\036\230h\240a\240v\250Q\330\010\031\230\025\230e\2401\330\010\021\220\021\220&\230\007\230q\240\004\240A\240S\250\001\250\021\330\010\022\220!\2207\230$\230a\230s\240!\2401\330\010\013\2103\210c\220\036\230u\240A\330\010\013\2103\210b\220\004\220F\230*\240A\330\014\r\330\r\022\220!\2205\230\005\230Q\230d\240%\240q\250\001\330\010\037\230q\330\010\013\2109\220A\220W\230C\230q\330\014\022\220!\320\023(\250\001\250\027\260\004\260C\260t\2701\270A\340\014\022\220!\320\023(\250\001\250\027\260\004\260C\260s\270$\270a\270q\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\014\210I\220Q\220m\2401\330\010\017\210q\200A\340\020\021\330\017\020\330\016&\240a\330\017\034\230A\330\016\034\230I\240Q\3602\000\t\037\230h\240a\240v\250Q\330\010\031\230\027\240\001\330\010\021\220\030\230\021\230(\240!\2404\240q\250\001\330\010\031\230\021\330\010\035\230Q\330\010\020\220\010\230\001\230\027\240\001\240\024\240Q\240a\330\010\032\230%\230v\240S\250\n\260%\260q\270\001\330\010\013\2105\220\003\2206\230\030\240\025\240a\240r\250\021\250\"\250A\250T\260\025\260a\260q\330\010\031\230\025\230e\2401\330\010\021\220\021\220&\230\007\230q\240\004\240A\240S\250\001\250\021\330\010\022\220!\2207\230$\230a\230s\240!\2401\330\010\013\2103\210c\220\021\220!\2202\220Q\220d\230&\240\n\250!\330\014\r\340\r\022\220!\2205\230\005\230Q\230e\2405\250\001\250\024\250U\260!\2601\330\010\037\230q\330\010\013\2103\210c\220\021\330\014\022\220!\320\023*\250!\330\024\033\2303\230c\240\024\240T\250\024\250Q""\250a\340\014\022\220!\320\023/\250q\330\024\033\2304\230s\240#\240T\250\024\250T\260\021\260!\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\014\210I\220Q\220m\2401\330\010\017\210q\200A\360\006\000\017'\240a\330\017\034\230A\330\016\034\230I\240Q\3606\000\t%\240A\330\010\030\230\001\330\010\033\2301\330\010\034\230A\330\010\036\230a\330\010 \240\001\330\010\036\230h\240a\240v\250Q\330\010\033\2307\240'\250\021\340\010\013\2104\320\017#\2401\240A\330\014\027\220x\230{\250!\340\010\013\320\013\034\230A\230Z\240q\330\014\022\320\022$\320$8\270\001\270\032\3001\330\014\023\2203\220j\240\006\240a\330\014\017\210u\220C\220q\230\001\230\021\330\020\026\220i\230q\320 R\320RY\320YZ\320Z]\320]g\320gh\330\014\023\2203\220j\240\001\330\014\024\220C\220z\240\021\330\014\020\220\005\220U\230\"\230A\330\020\025\220R\220q\230\001\330\014\026\220c\230\032\2401\330\014\035\230Q\230j\250\001\340\014\022\220*\230A\230Q\330\010\013\2105\220\003\2206\230\030\240\025\240a\240u\250E\260\021\260!\330\010\021\220\021\220&\230\007\230q\240\004\240A\240S\250\001\250\021\330\010\022\220!\2207\230$\230a\230s\240!\2401\330\010\013\2103\210c\220\036\230u\240A\330\010\013\2103\210b\220\004\220F\230*\240A\330\014\r\330\r\022\220!\2205\230\005\230Q\230d\240%\240q\250\001\330\010\037\230q\330\010(\250\003\250:\260T\270\021\330\010\013\2107\220$\220i\230q\330\014\017\210y\230\001\230\027\240\003\2401\330\020\026\220a\320\0270\260\001\260\027\270\004\270C\270\177\310c\320Q[\320[c\320cd\320de\340\020\026\220a\320\0270\260\001\260\027\270\004\270C\270s\300/\320QT\320T^\320^f\320fg\320gh\330\r\024\220D\230\010\240\r\250Q\330\014\017\210y\230\001\230\027\240\003\2401\330\020\026\220a\320\027,\250A\250W\260D\270\003\270?\310#\310Z\320W_\320_`\320`a\340\020\026\220a\320\027,\250A\250W\260D\270\003\2703\270o\310S\320PZ\320Zb\320bc\320cd\330\r\024\220C\220q\330\014\017\210y\230\001\230\027\240\003\2401\330\020\026\220a\320\027/\250q\260\007\260t\2703\270o\310S\320PZ\320Zb\320bc\320cd\340""\020\026\220a\320\027/\250q\260\007\260t\2703\270c\300\037\320PS\320S]\320]e\320ef\320fg\340\014\022\220)\2301\320\034:\270'\300\021\300!\340\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\014\210I\220Q\220m\2401\330\010\"\240!\330\010$\240A\330\010\031\230\030\240\021\240'\250\021\250*\260G\2706\300\030\310\021\310!\330\010\031\230\030\240\021\240'\250\021\250*\260G\2706\300\030\310\021\310!\330\010\014\210E\220\025\220a\220q\330\014\025\220Q\220e\2305\240\001\240\021\330\014\027\220q\230\005\230W\240A\240Q\330\010\014\210I\220Q\320\026+\2503\250j\270\004\270N\310#\310Z\320W[\320[g\320gm\320mq\320qr\330\010\013\2103\320\016\037\230s\240!\330\014\017\320\017\037\230q\240\001\330\010\017\210q\200A\340\016\017\330\016&\240a\330\016\034\230A\330\014\r\360(\000\t\037\230h\240a\240v\250Q\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010#\2401\330\010\013\2105\220\007\220v\230X\240X\250Q\250a\330\010\"\240!\330\010\016\210a\320\017 \240\001\240\027\250\001\250\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\016\210a\320\017!\240\021\240$\240f\250A\330\010\016\210a\320\017%\240Q\240d\250&\260\001\330\010\016\210a\320\017%\240Q\240d\250&\260\001\330\010\017\210q\200A\340\016\017\330\016&\240a\330\016\034\230A\330\014\r\360&\000\t\037\230h\240a\240v\250Q\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010#\2408\2501\250A\330\010\"\240!\330\010\016\210a\320\017$\240A\240W\250G\2607\270!\2701\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\200A\340\016\017\330\016&\240a\330\016\034\230A\330\014\r\360&\000\t\037\230h\240a\240v\250Q\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010#\2408\2501\250A\330\010\"\240!\330\010\016\210a\320\017 \240\001\240\027\250\001\250\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\016\210a\320\017!\240\021\240$\240f\250A\330\010\016\210a\320\017+\2501\250D\260\006\260a\330\010\016\210a\320\017%\240Q""\240d\250&\260\001\330\010\016\210a\320\017%\240Q\240d\250&\260\001\330\010\017\210q\200A\340\016\017\330\016&\240a\330\016\034\230A\330\014\r\360&\000\t\037\230h\240a\240v\250Q\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010#\2408\2501\250A\330\010\"\240!\330\010\016\210a\320\017 \240\001\240\027\250\001\250\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\016\210a\320\017!\240\021\240$\240f\250A\330\010\016\210a\320\017%\240Q\240d\250&\260\001\330\010\016\210a\320\017%\240Q\240d\250&\260\001\330\010\017\210q\200A\340\r\016\330\014\r\330\023\024\330\013\014\330\020\026\220a\330\016\034\230I\240Q\3604\000\t\037\230h\240a\240v\250Q\330\010\035\230Q\330\010\035\230U\240!\2401\330\010\034\230E\240\021\240!\330\010\033\2305\240\001\240\021\330\010 \240\005\240Q\240a\330\010$\240F\250!\2501\330\010\016\210a\320\017$\240A\240W\250F\260%\260|\3004\300y\320PQ\320QR\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\200A\340\r\032\230!\330\r\032\230!\330\017!\240\021\330\024&\240a\330\027O\310q\330\026+\2501\330\027$\240A\330\024\033\2301\330\032=\270Q\330\016\034\230I\240Q\360d\001\000\t\033\230!\330\010\r\210V\2205\230\001\230\021\330\017\020\330\016\023\2208\2306\240\021\340\010\035\230Q\330\010\035\230Q\330\010\032\230'\320!5\260Q\330\010\032\230'\320!5\260Q\330\010\032\230'\320!5\260Q\330\010'\240q\330\010'\240q\330\010'\240q\330\010+\2501\330\010+\2501\340\010\035\230Q\330\010\035\230Q\330\010\035\230Q\330\010\035\230Q\330\010\013\2106\220\027\230\001\330\014\023\2206\230\021\230(\240!\2403\240a\240s\250!\2501\330\010\013\2107\220'\230\021\330\014\023\2206\230\021\230(\240!\2403\240a\240s\250!\2501\330\010\013\2104\210r\220\022\2204\220t\2302\230Q\330\014\023\2205\230\003\2301\340\010\013\2104\210w\220f\230G\2405\250\001\250\021\330\010\013\2104\210w\220f\230G\2405\250\001\250\021\330\010\013\2104\210r\220\036\230w\240a\330\010\013\2104\210r\220\036\230w\240a\340\010\013\320\013\034\230G\2401\330\014""\037\320\0370\260\001\260\021\33017\260q\270\003\2701\270C\270q\300\001\33012\260$\260a\260t\2701\270A\340\010\013\210>\230\027\240\001\330\014\026\220a\220\177\240a\240u\250A\250U\260!\2601\330\010\013\210=\230\007\230q\330\014\024\220I\230Q\230a\330\010\013\210>\230\027\240\001\330\014\025\220U\230!\2301\330\010\013\2106\220\024\220W\230C\230~\250Y\260a\340\010\036\230h\240a\240v\250Q\330\010\035\230Q\330\010\016\210a\210|\2301\230G\2406\250\021\330\034\037\230s\240#\240S\250\003\2503\250d\260$\260a\330\034!\240\025\240e\2507\260!\330\034\035\230Q\330\010\013\2106\220\024\220U\230\"\230C\230v\240Q\240g\250Q\250a\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\004$\240A\360\024\000\t\017\210a\320\017(\250\001\250\024\250Q\200A\340\r\016\330\014\r\330\023\024\330\020\026\220a\330\020\035\230Q\330\016\034\230I\240Q\3604\000\t\037\230h\240a\240v\250Q\330\010\035\230Q\330\010\035\230U\240!\2401\330\010\034\230E\240\021\240!\330\010 \240\005\240Q\240a\330\010$\240F\250!\2501\330\010#\2401\330\010\013\2101\330\014\025\220Y\230a\230x\240q\250\001\330\010\016\210a\320\017#\2401\240G\2506\260\025\260l\300)\3109\320TU\320UV\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\200A\340\r\016\330\014\r\330\017\020\330\020\026\220a\330\020\035\230Q\330\016\034\230I\240Q\3604\000\t\037\230h\240a\240v\250Q\330\010\035\230Q\330\010\035\230U\240!\2401\330\010\034\230E\240\021\240!\330\010 \240\005\240Q\240a\330\010-\250Q\330\010#\2401\330\010\013\2101\330\014\025\220Y\230a\230x\240q\250\001\330\010\016\210a\320\017#\2401\240G\2506\260\025\260k\300\031\310)\320ST\320TU\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\200A\360\006\000\020\027\220a\330\016\025\220Q\330\020\027\220z\240\021\360:\000\t\035\230I\240Y\250k\270\021\330\010\016\210a\210\177\230a\230z\250\027\260\001\330\010\016\210a\320\017$\240A\240Q\240g\250Q\250g\260Q\260g\270Q\270a\330\010\016\210k\230\025\230a\230x\240u\250A\250X\260U\270!""\2701\330\010\013\2106\220\023\220E\230\023\230A\330\014\022\220!\2201\330\014\017\210q\330\020\023\2207\230!\230:\240Q\330\014\017\210q\330\020\027\220y\240\001\240\021\330\020\023\2208\2303\230a\330\024\033\2304\230v\240Q\240e\2502\250R\250r\260\026\260q\340\024\033\2304\230v\240Q\240l\260\"\260B\260f\270A\330\020\023\2207\230!\2301\330\014\017\210q\330\020\031\230\031\240!\320#5\260V\2701\270A\330\020\031\230\025\230a\230q\240\001\240\026\240s\250$\250e\2607\270#\270Q\330\020\023\2207\230!\2301\330\010\017\210u\220A\220Q\320\004$\240A\360\024\000\t\017\210a\210~\230Q\230d\240&\250\001\250\021\320\004\034\230A\360\024\000\t\017\210a\320\017%\240Q\240d\250%\250q\320\004\034\230A\360\024\000\t!\240\001\330\010\016\210a\210~\230Q\230d\240'\250\021\250!\330\010\017\210q\320\004 \240\001\360&\000\t\035\230A\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\"\240!\330\010\035\230X\240Q\240g\250Q\250f\260F\270!\2701\330\010!\240\021\330\010\036\230h\240a\240w\250a\250v\260V\2701\270A\330\010\036\230a\330\010\033\2308\2401\240G\2501\250F\260&\270\001\270\021\330\010(\250\001\330\010'\240q\330\010\"\240!\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\250)\2601\260H\270A\270Q\330\010\016\210a\210{\230!\2309\240I\250X\260S\270\001\270\021\330\010\016\210a\210{\230!\2308\2408\2508\2603\260a\260q\330\010\016\210a\210{\230!\2305\240\003\2408\2503\250a\250q\330\010\020\220\007\220x\230q\320\004,\250A\360\"\000\t\017\210a\210~\230Q\230d\240%\240q\250\006\250a\250q\200A\340\023\"\240!\330\022 \240\t\250\021\360\"\000\t\037\230a\330\010\013\210:\220W\230A\330\014\023\2206\230\021\230!\330\014\022\220!\320\023'\240q\250\004\250E\260\021\330\010\036\230a\330\010\013\2109\220G\2301\330\014\023\220>\240\036\250q\330\014\022\220!\320\023+\2501\250D\260\005\260Q\320\004\034\230A\360\030\000\t\037\230a\330\010\016\210a\210|\2301\230D\240\005\240Q\240a\330\010\017\210v\220Q\220a\320\004,\250A\360\036\000\t\037\230a\330\010\016\210a\320\017#\2401\240D\250\005\250T\260\024""\260Q\260d\270!\2701\330\010\017\210u\220A\220Q\320\004$\240A\360\030\000\t'\240a\330\010\016\210a\320\017$\240A\240T\250\026\250q\260\001\330\010\035\230Q\330\010\016\210a\320\017!\240\021\240-\250t\2606\270\021\270!\330\010\031\230\021\330\010\016\210a\320\017\037\230}\250A\250V\2601\260A\330\010\017\210w\220a\220t\2301\230C\230q\320\004$\240A\340\010.\250a\330\010\016\210a\320\017$\240A\240T\250\026\250q\260\001\330\010\017\210q\320\004$\240A\360\024\000\t/\250a\330\010\016\210a\320\017$\240A\240T\250\026\250q\260\001\330\010\017\210q\200A\340\016\017\330\020&\240a\330\020&\240a\330\016\034\230I\240Q\3604\000\t\020\210q\220\004\220A\220U\230$\230g\240Q\330\010\013\2101\330\014\025\220T\230\021\230!\330\014\023\2203\220a\220x\230s\240#\240Q\240a\340\014\025\220Q\330\010\013\2101\330\014\025\220T\230\021\230!\330\014\023\2203\220a\220x\230s\240#\240Q\240d\250!\2501\340\014\025\220Q\330\010\036\230h\240a\240v\250Q\330\010 \240\003\2401\240A\330\010 \240\003\2401\240D\250\001\250\021\330\010\033\230:\240Q\330\010\033\230:\240Q\330\010!\240\021\330\010!\240\021\330\010!\240\021\340\010\022\220(\230!\2307\240!\2402\240Q\240e\2506\260\030\270\021\270!\330\010\014\210G\2209\230A\330\014\020\220\007\220y\240\001\330\020\026\220d\230!\2302\230Q\230a\330\020\025\220Q\220a\220q\230\002\230!\2305\240\001\240\026\240t\2508\2604\260w\270j\310\001\330\010\013\2107\220'\230\021\330\014\026\220h\230a\230w\240a\240u\250F\260(\270!\2701\330\014\020\220\007\220y\240\004\240G\2501\250F\260%\260v\270Q\270c\300\021\330\010\013\2107\220'\230\021\330\014\026\220h\230a\230w\240a\240u\250F\260(\270!\2701\330\014\020\220\007\220y\240\004\240G\2501\250F\260%\260v\270Q\270c\300\021\330\010\037\230q\330\010\016\210a\210}\230A\230W\240D\250\t\260\024\260Y\270g\300Q\300a\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\200A\340\014\r\330\014)\250\031\260!\360(\000\t\033\230!\330\010\036\230a\330\010\036\230a\330\010\024\220M\240\021\330\010\013\210:\220Q\220d\230&\240""\005\240Q\240a\330\010\013\210:\220Q\220d\230&\240\005\240Q\240a\330\010\013\2103\210g\220Q\330\014\020\220\n\230#\230Q\230a\330\r\020\220\007\220q\330\014\020\220\n\230#\230Q\230a\330\010\013\2103\210g\220Q\330\014\023\2203\220a\220t\2303\230l\250!\330\014\023\2208\2301\230G\2401\240J\250d\260&\270\010\300\001\300\021\330\014\020\220\007\220y\240\001\330\020\024\220A\220V\2306\240\022\2401\240C\240q\330\010\013\2103\210g\220Q\330\014\023\2203\220a\220t\2303\230l\250!\330\014\023\2208\2301\230G\2401\240J\250d\260&\270\010\300\001\300\021\330\014\020\220\007\220y\240\001\330\020\024\220A\220V\2306\240\022\2401\240C\240q\330\010\014\210I\220Q\320\0261\260\026\260q\330\010\016\210a\320\017!\240\021\240$\240e\2503\250f\260A\200A\340\016\026\220a\330\016\026\220a\330\016\026\220a\330\016\026\220a\330\016\026\220a\330\016\026\220f\230A\3604\000\t \230v\240Q\240o\260V\2701\270A\330\010\037\230v\240Q\240o\260V\2701\270A\330\010\037\230v\240Q\240o\260V\2701\270A\330\010\016\210a\320\0172\260!\2604\260u\270G\3007\310'\320QX\320X_\320_`\200A\340\016\026\220a\330\016\026\220a\330\016\026\220a\330\016\026\220a\330\016\026\220a\330\016\026\220f\230A\360F\001\000\t \230v\240Q\240o\260V\2701\270A\330\010\037\230v\240Q\240o\260V\2701\270A\330\010\037\230v\240Q\240o\260V\2701\270A\330\010\016\210a\320\017*\250!\2504\250u\260G\2707\300'\310\027\320PW\320WX\200A\340\016\026\220a\330\016\026\220a\330\016\026\220a\330\016\026\220a\330\016\026\220a\330\016\026\220f\230A\360:\000\t \230v\240Q\240o\260V\2701\270A\330\010\037\230v\240Q\240o\260V\2701\270A\330\010\037\230v\240Q\240o\260V\2701\270A\330\010\016\210a\320\017(\250\001\250\024\250Q\330)0\260\001\330)0\260\001\330)0\260\001\200A\340\016\026\220a\330\016\026\220a\330\016\026\220a\330\016\026\220a\330\016\026\220a\330\016\026\220f\230A\360<\000\t \230v\240Q\240o\260V\2701\270A\330\010\037\230v\240Q\240o\260V\2701\270A\330\010\037\230v\240Q\240o\260V\2701\270A\330\010\016\210a\320\0171\260\021\260$\260e\2707\300'\310\027\320PW\320W^""\320^_\320\004\032\230!\360.\000\t \230}\250A\330\010&\240a\330\010*\250!\330\010\016\210a\210\177\230a\230t\2405\250\001\250\030\260\021\260)\2701\270H\300A\300Q\330\010\013\2107\220#\220Q\330\014\024\220F\230!\2303\230i\240q\340\014\024\220G\2301\230I\240Q\330\010\021\220\027\230\001\230\027\240\001\240\023\320$5\260Q\330\010\021\220\026\220x\230q\240\t\250\021\330\010\017\210u\220A\220Y\230g\240Q\320\004\034\230A\360\024\000\t\037\230a\330\010\016\210a\320\017&\240a\240t\2505\260\001\260\021\330\010\017\210v\220Q\220a\320\004$\240A\360\030\000\t\037\230a\330\010\016\210a\320\017'\240q\250\004\250E\260\021\260!\330\010\017\210v\220Q\220a\200A\330\031\032\360\024\000\t\037\230a\330\010\016\210a\320\017\037\230q\240\001\240\021\330\010\017\210v\220Q\220a\320\004\034\230A\340\010\016\210a\320\017&\240a\240t\2501\320\004\034\230A\360\024\000\t\017\210a\320\017&\240a\240t\2501\320\004,\250A\360\"\000\t\017\210a\210\177\230a\230t\2406\250\021\250&\260\001\260\021\320\004\"\240!\360\024\000\t\035\230A\330\010\016\210a\320\017.\250a\250t\2607\270!\2701\330\010\017\210u\220A\220Q\200A\340\022\030\230\001\330\022\030\230\001\330\022\030\230\006\230a\360(\000\t\017\210a\210u\220E\230\021\230!\330\010\016\210a\210u\220E\230\021\230!\330\010\016\210a\210u\220E\230\021\230!\330\010\016\210a\320\017&\240a\240t\2501\330'-\250Q\250a\330'-\250Q\250a\330'-\250Q\250a\320\004\034\230A\360\024\000\t\037\230a\330\010\016\210a\210z\230\021\230$\230g\240Q\240a\330\010\017\210v\220Q\220a\320\004\"\240!\360\024\000\t\035\230A\330\010\016\210a\320\017!\240\021\240$\240e\2501\250A\330\010\017\210u\220A\220Q\320\004\031\230\021\360\024\000\t%\240A\330\010\016\210a\320\017!\240\021\240$\240f\250A\250Q\330\010\017\210y\230\001\230\021\200A\340\022\031\230\021\330\021!\240\021\330\r\026\220a\360&\000\t\037\230h\240a\240v\250Q\330\010#\2401\330\010\013\210:\220\\\240\021\330\010\032\230(\240*\250C\250q\260\001\330\010\033\2301\330\010\036\230h\240a\240w\250a\250u\260F\270(\300!\3001\330\010\014""\210G\2209\230A\330\014\r\210Q\210f\220G\2307\240!\240<\250t\2601\330\010%\240Q\330\010\016\210a\320\017!\240\021\240'\250\033\260D\270\003\2701\270A\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\200A\360\006\000\022\037\230a\330\021\036\230i\240q\360&\000\t!\240\001\330\010#\2401\330\010#\2401\330\010\022\220)\2301\230I\240Q\240a\330\010\013\2105\220\003\2206\230\027\240\001\330\010\016\210a\210z\230\021\230$\230e\2406\250\021\250!\330\010\022\220)\2301\230I\240Q\240a\330\010\013\2105\220\003\2206\230\027\240\001\330\010\016\210a\210z\230\021\230$\230e\2406\250\021\250!\330\010\030\230\006\230a\330\010\016\210a\210}\230A\230T\240\025\240f\250F\260(\270(\300!\3005\310\001\330\010\017\210q\200A\330\024\025\330\025.\250a\330\026.\250i\260q\360&\000\t\014\2104\210w\220a\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220u\230F\240!\330\014\020\220\t\230\021\230+\240Q\330\014\022\220!\220:\230Q\230d\240'\250\032\2607\270!\340\014\022\220!\220:\230Q\230d\240'\250\026\250q\320\004,\250A\360\024\000\t\017\210a\320\017)\250\021\250$\250j\270\001\270\021\200A\330\"(\250\001\330 &\240a\330\"(\250\001\330 &\240k\260\021\360*\000\t\030\220t\2301\230E\240\021\330\010 \240\005\240Q\240a\330\010\036\230e\2401\240A\330\010 \240\005\240Q\240a\330\010\036\230e\2401\240A\330\010\016\210a\320\017#\2401\240D\250\006\250i\260w\270i\300w\310a\310s\320RS\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\034\230A\360\026\000\t\017\210a\320\017\037\230q\240\004\240A\320\004$\240A\360\036\000\t\017\210a\320\017\037\230q\240\004\240E\250\023\250A\320\004$\240A\360 \000\t#\240!\330\010\016\210a\320\017'\240q\250\004\250E\260\021\260!\330\010\017\210u\220A\220Q\200A\340\016\017\330\017)\250\021\330\r\036\230a\330\r/\250q\330\016\034\230I\240Q\360D\001\000\t \230q\330\010\022\220!\220;\230f\240F\250'\260\021\260!\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\340\010\024\220A\220T\230\026\230u\240A""\330\010\017\210q\200A\340\016\017\330\017)\250\021\330\r\036\230a\330\r/\250q\330\016\034\230I\240Q\360@\001\000\t \230q\330\010\022\220!\2208\2306\240\026\240w\250a\250q\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\340\010\024\220A\220T\230\026\230u\240A\330\010\017\210q\200A\340\016\017\330\017\020\330\r\036\230a\330\r/\250q\330\016\034\230I\240Q\360>\000\t \230q\330\010\022\220!\2209\230F\240&\250\007\250q\260\001\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\340\010\024\220A\220T\230\026\230u\240A\330\010\017\210q\200A\340\016\017\330\017\020\330\r\036\230a\330\r/\250q\330\016\034\230I\240Q\360>\000\t \230q\330\010\022\220!\220:\230V\2406\250\027\260\001\260\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\340\010\024\220A\220T\230\026\230u\240A\330\010\017\210q\320\004$\240A\360\024\000\t#\240!\330\010\016\210a\320\017/\250q\260\004\260L\300\001\300\021\330\010\017\210v\220Q\220a\200A\340\r\016\330\020&\240a\330\022(\250\t\260\021\360*\000\t\033\230%\230q\240\001\330\010\032\230!\330\010\036\230a\330\010$\240A\330\010\013\2107\220'\230\021\330\014\023\2203\220a\220x\230s\240!\330\014\022\220!\220;\230a\230x\240q\250\001\320):\270!\2701\330\014\020\220\005\220U\230!\2301\330\020\025\220Q\220f\230E\240\026\240q\250\003\2501\330\010\013\2109\220G\2301\330\014\023\2203\220a\220z\240\023\240A\330\014\022\220!\220;\230a\230x\240q\250\001\320):\270!\2701\330\014\020\220\005\220U\230!\2301\330\020\033\2301\230F\240%\240x\250q\260\003\2601\330\010\016\210a\320\017&\240a\240t\2505\260\003\2607\270!\330\010\016\210a\210y\230\001\230\021\330\010\016\210a\210y\230\001\230\021\200A\340\r\016\330\016 \240\001\360*\000\t\037\230a\330\010\037\230q\330\010\016\210h\220a\220u\230F\240!\2401\330\010\017\210x\220q\230\006\230f\240A\240Q\330\010\016\210a\320\017$\240A\240T\250\026\250s\260&\270\003\2701\330\010\017\210q\200A\340\022\023\330\017&\240a\330\020'\240y\260\001\360&\000\t#\240%\240q\250\001\330\010 \240\001\330\010!\240\021\330\010""\036\230a\330\010\013\2106\220\027\230\001\330\014\024\220H\230A\230W\240A\240W\250A\250Q\330\014\017\210v\220S\230\001\330\020\026\220j\240\001\320!O\310q\330!+\2505\260\001\260\021\330\014\017\210w\220c\230\021\330\020\026\220j\240\001\240\021\330\010\013\2107\220'\230\021\330\014\025\220X\230Q\230h\240f\250A\250Q\330\010\016\210a\320\0170\260\001\260\024\260W\270A\33019\270\021\320\004$\240A\360\024\000\t\"\240\025\240a\240q\330\010!\240\025\240a\240q\330\010!\240\021\330\010\016\210a\210|\2301\230D\240\006\240c\250\021\250'\260\023\260A\260W\270A\270Q\330\010\017\210x\220q\230\001\200A\330\010\032\230$\230a\230u\240A\330\010\035\230T\240\024\240Q\240a\330\010\013\2102\210S\220\001\330\014\022\220!\320\023'\240q\250\001\330\010\013\2104\210q\220\005\220Q\330\010\017\210q\320\004\031\230\033\240A\360\024\000\t!\240\010\250\001\250\021\330\010\016\210a\210v\220Q\220d\230&\240\001\320\004$\240A\360\"\000\t\017\210a\210w\220a\220t\2306\240\021\240&\250\001\250\021\320\004\032\320\032,\250A\360\"\000\t!\240\010\250\001\250\021\330\010\016\210a\210w\220a\220t\2306\240\026\240q\250\001\200A\330\010\036\230d\240)\2501\250A\330\010\014\210I\220Q\220n\240A\330\010\017\210s\220%\220q\320\004(\320(A\300\021\360\"\000\t\037\230e\2401\240A\330\010\016\210a\320\0170\260\001\260\024\260\\\300\027\310\n\320RS\320\004$\320$<\270A\360&\000\t\037\230f\240A\240Q\330\010\016\210a\320\017#\2401\240D\250\005\250V\2601\260F\270!\2701\320\004\"\240*\250A\360\036\000\t\037\230f\240A\240Q\330\010\016\210a\320\017 \240\001\240\024\240V\2501\330\010\017\210q\320\004:\270*\300A\360 \000\t\037\230f\240A\240Q\330\010\016\210a\320\017.\250a\250t\2605\270\001\320\004\"\240*\250A\360\036\000\t\037\230f\240A\240Q\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\200A\360\010\000\017\027\220f\230A\360(\000\t\037\230f\240A\240Q\330\010\032\230%\230|\2505\260\001\330\010\016\210a\320\017+\2501\250D\260\006\260f\270D\300\001\200A\330\037 \360\036\000\t\022\220\025\220f\230I\240S\250\013\2601\260F""\270&\300\001\330\010\024\220M\240\027\250\001\250\021\330\024!\240\027\250\001\250\021\330\024!\240\027\250\001\250\021\330\024!\240\024\240Q\330\024!\240\021\330\024!\240\021\200A\340\016f\320fo\320op\360,\000\t\014\2105\220\003\2201\330\014\023\2203\220d\230'\240\023\240A\330\014\022\220!\220=\240\001\240\024\240V\2501\250D\260\006\260a\260t\2701\330\014\024\220F\230!\330\r\022\220$\220e\2305\240\t\250\031\260!\330\014\023\2203\220a\330\014\022\220!\220=\240\001\240\024\240V\2501\250D\260\006\260a\330\014\023\2201\330\r\022\220$\220e\2305\240\t\250\030\260\021\330\014\023\2203\220a\330\014\022\220!\220=\240\001\240\024\240V\2506\260\021\260$\260a\330\014\023\2201\340\014\022\220*\230A\320\0358\270\002\270!\200A\330\032(\250\t\260\021\360\026\000\t\037\230h\240a\240v\250Q\330\010\035\230V\2401\330\010\016\210g\320\025)\250\021\250!\330\010\016\210a\210{\230!\2306\240\021\330\010\017\210q\200A\340\021 \240\001\330\021 \240\001\330\017\036\230i\240q\360*\000\t \230{\250+\260Q\330\010\r\210V\2201\320\024$\240A\240T\250\025\250a\250w\260a\260w\270a\270q\330\017\020\330\010\013\2108\2207\230&\240\010\250\006\250a\250q\330\010\013\2108\2207\230&\240\010\250\006\250a\250q\330\010\013\2108\2207\230&\240\010\250\006\250a\250q\330\010\016\210a\320\017\037\230q\240\004\240F\250(\260(\270!\200A\330\030&\240i\250q\360\026\000\t\037\230h\240a\240v\250Q\330\010\035\230V\2401\330\010\016\210g\320\025'\240q\250\001\330\010\016\210a\210{\230!\2306\240\021\330\010\017\210q\200A\330\010\036\230j\250\001\250\021\330\010\014\210I\220Q\220n\240A\330\010\017\210s\220&\230\001\320\004\034\230A\360*\000\t\037\230k\250\033\260A\330\010\016\210a\210}\230A\230T\240\026\240q\250\007\250q\260\007\260q\270\001\330\010\020\220\005\220Q\220h\230e\2401\240H\250E\260\021\260!\320\004\034\230A\360\024\000\t\037\230k\250\021\330\010 \240\001\330\010 \240\001\330\010\016\210a\210~\230Q\230d\240&\250\001\250\027\260\001\260\021\330\010\036\230h\240a\240w\250a\250x\260v\270X\300Q\300a\330\010\036\230h""\240a\240w\250a\250x\260v\270X\300Q\300a\330\010\016\210a\210}\230A\230T\240\026\240y\260\001\330\010\024\220A\220V\2301\230G\2401\240D\250\004\250G\2609\270A\330\010\024\220A\220V\2301\230G\2401\240D\250\004\250G\2609\270A\330\010\017\210{\230!\200A\330%>\270m\320Kc\320cl\320lm\360\024\000\t\014\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\320\023)\250\026\250q\330\010\014\210I\220Q\320\0262\260!\330\010\016\210a\320\017/\250q\260\004\260F\270!\2701\3300I\310\027\320PQ\200A\340\026\027\330\027\037\230q\360$\000\t+\250)\2601\260A\330\010\037\230u\240A\240Q\330\010\016\210a\320\017!\240\021\240$\240e\2501\330\010\016\210a\320\017\"\240!\2404\240u\250A\320\004&\320&<\270A\360&\000\t(\240q\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\200A\340\022\023\330\016\017\330\016\017\330\r\016\330\016\027\220q\360.\000\t\034\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\033\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\020\220\t\230\021\320\032,\250A\330\014\022\220!\220?\240!\2404\240u\250F\260&\270\017\300w\310a\340\014\022\220!\220?\240!\2404\240u\250F\260&\270\006\270a\200A\330\035'\240q\360\036\000\t$\2401\330\010\016\210a\210}\230A\230Q\200A\330\035'\240q\360&\000\t$\2401\330\010\016\210a\210}\230A\230Q\200A\340\016\037\230q\330\016 \240\t\250\021\3606\000\t'\240j\260\001\260\021\330\010&\240k\260\021\260!\330\010\016\210a\320\017\"\240!\2404\240v\250W\260A\330\010\016\210a\320\017 \240\001\240\024\240V\2507\260!\200A\330 )\250\021\360\036\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\013\2104\210s\220&\230\006\230a\330\010\016\210a\210|\2301\230A\200A\360\006\000\017\020\330\022\037\230q\330\016\024\220H\230A\360&\000\t\037\230a\330\010%\240Q\330\010!\240\021\330\010\013\2106\220\027\230\001\330\010\016\210a""\210~\230Q\230a\330\010\013\2109\220G\2301\330\014\027\220y\240\001\240\032\2501\250A\330\014\023\2209\230A\230V\2401\240A\330\014\022\220!\320\023#\2401\240K\250q\200A\340\021\027\220q\330\016\034\230I\240Q\360$\000\t\037\230h\240a\240v\250Q\330\010\037\230q\330\010\016\210a\210y\230\001\230\027\240\001\240\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\016\210a\210z\230\021\230$\230f\240A\330\010\016\210a\320\017\"\240!\2404\240v\250W\260A\330\010\017\210q\200A\340\r\016\330\016'\240q\330\017(\250\001\330\030P\320PQ\330\026+\2501\330\027$\240A\330\024-\250Q\330\032=\270Q\330\016\034\230A\330\017\035\230Z\240q\360R\001\000\t\036\230U\240!\2401\360\006\000\t\036\230Q\330\010\035\320\035-\250U\260%\260q\330\010\013\2106\220\027\230\001\330\014\025\220Z\230q\240\010\250\001\250\023\250A\250S\260\001\260\021\330\014\023\2206\230\022\2301\360\006\000\t\035\230A\330\010\034\320\034/\250x\260x\270x\300q\330\010\013\2105\220\007\220q\330\014\024\220F\230!\2307\240!\2406\250\021\250&\260\001\260\026\260q\270\001\330\014\023\2205\230\002\230$\230a\230q\360\006\000\t(\240q\330\010'\240q\330\010'\240q\330\010\022\220!\320\023#\2401\240E\250\021\250%\250q\260\001\360\006\000\t \230q\330\010\013\210>\230\027\240\001\330\014\025\220U\230!\2301\330\010,\250A\330\010\013\210=\230\007\230q\330\014\024\220M\240\021\240!\360\006\000\t\037\230h\240a\240v\250Q\360\006\000\t\036\230Q\330\010\035\320\035-\320-=\320=M\310Q\330\010\013\210;\220g\230Q\330\014\025\220Z\230q\240\010\250\001\250\023\250A\250S\260\001\260\021\330\014\023\2206\230\022\2301\360\006\000\t\035\230L\250\014\260A\330\010\013\320\013\034\230G\2401\330\014\026\320\026+\2501\320,>\270f\300A\300S\310\001\310\023\310A\310S\320PQ\320QU\320UV\320VZ\320Z[\320[\\\330\014\023\2207\230\"\230A\360\006\000\t\036\230Q\330\010\013\2104\210s\220!\330\014\022\220!\220>\240\021\240'\250\025\250c\260\026\260v\270W\300H\310D\320PQ\320QR\330\010\013\2104\210s\220!\330\014\022\220!\220>\240\021\240'\250\025\250e\2603""\260c\270\023\270C\270v\300V\3106\320QX\320X`\320`d\320dh\320hi\320ij\330\010\013\2104\210s\220!\330\014\022\220!\220>\240\021\240'\250\025\250e\2605\270\003\2703\270c\300\023\300C\300s\310&\320PV\320V\\\320\\b\320bi\320iq\320qu\320uy\320y}\320}~\320~\177\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\013\2101\330\014\022\220!\2207\230!\2304\230q\330\010\017\210q\320\004$\240A\360\024\000\t(\240q\330\010\035\230Q\330\010\016\210a\320\017#\2401\240D\250\005\250Q\250d\260!\2601\330\010\034\230G\2401\240D\250\001\330\010\017\210q\320\004\034\230A\360\036\000\t \230q\330\010\016\210a\210|\2301\230D\240\005\240Q\240a\330\010\017\210v\220Q\220a\200A\330\030\031\360\024\000\t(\240q\340\010\016\210a\320\0172\260!\2601\260A\330\010\017\320\017'\240q\250\001\320\004\034\230A\360\024\000\t+\250!\330\010\037\230q\330\010\016\210a\210{\230!\2304\230q\330\033\034\330\033!\240\026\240q\330\033!\240\026\240q\330\033!\240\021\240!\330\033!\240\026\240q\330\033\034\230A\330\010\020\220\t\230\021\230(\240%\240q\250\001\320\004\034\230A\360 \000\t\030\220q\230\006\230a\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\250!\2504\250q\260\001\260\024\260Q\260a\260t\2701\270A\270Q\320\004\034\230A\360\036\000\t \230q\330\010\016\210a\320\017!\240\021\240$\240f\250A\250Q\330\010\017\210v\220Q\220a\320\004,\250A\360\026\000\t \230q\330\010\016\210a\320\017/\250q\260\004\260E\270\021\270!\330\010\017\210v\220Q\220a\200\001\330\004\014\210A\340\004\005\330\004\021\220\031\230!\330\004\005\330\004\022\220(\230!\340\004\005\330\004\031\230\021\340\004\005\330\004\021\220\026\220q\330\004\005\330\004\022\220&\230\001\330\004\005\330\004\022\220&\230\001\330\004\005\330\004\022\220&\230\001\330\004\005\330\004\026\220f\230A\200A\340\016\037\230q\330\016 \240\t\250\021\360\024\000\t'\240j\260\001\260\021\330\010&\240k\260\021\260!\330\010\016\210a\320\017\"\240!\2404\240v\250W\260A\200A\360\010\000\017 \230q\330\016 \240\t\250\021\360\032\000\t'\240j\260\001\260\021\330""\010&\240k\260\021\260!\330\010\016\210a\210}\230A\230T\240\026\240x\250v\260V\2701\330\035$\240A\200A\340\016\037\230q\330\016 \240\t\250\021\360\024\000\t'\240j\260\001\260\021\330\010&\240k\260\021\260!\330\010\016\210a\320\017 \240\001\240\024\240V\2507\260!\200A\360\010\000\017 \230q\330\016 \240\t\250\021\360\032\000\t'\240j\260\001\260\021\330\010&\240k\260\021\260!\330\010\016\210a\210\177\230a\230t\2406\250\030\260\026\260v\270Q\330\037&\240a\200A\360\010\000\017 \230q\330\016 \240\t\250\021\360*\000\t'\240j\260\001\260\021\330\010&\240k\260\021\260!\330\010\016\210a\210\177\230a\230t\2406\250\030\260\026\260v\270Q\330\037&\240a\330\010\016\210a\210}\230A\230T\240\026\240x\250v\260V\2701\330\035$\240A\200A\360\010\000\020\030\220q\330\021\"\240!\330\017\027\220q\330\r\023\2201\330\016\024\220F\230!\360\024\000\t!\240\006\240a\240q\330\010(\250\001\330\010\013\2108\2207\230!\330\014\027\320\027)\250\025\250a\250q\330\010 \240\006\240a\240q\330\010\035\230U\240!\2401\330\010\036\230e\2401\240A\330\010\016\210a\210v\220Q\220d\230&\240\001\240\026\240x\250z\270\030\300\026\300w\310a\310q\320\004)\320)<\270A\360 \000\t\032\230\026\230q\330\010\031\230\026\230q\330\010\014\210E\220\021\330\010\r\210X\220Q\220d\230!\2304\230q\240\001\330\010\r\210X\220Q\220d\230!\2304\230q\240\001\330\010\014\210A\210Q\210c\220\023\220A\330\014\022\220*\230A\230Q\330\036#\2401\240A\240Q\240e\2505\260\001\260\021\330\010\014\210A\210Q\210b\220\001\220\023\220C\220q\330\014\022\220*\230A\230Q\330\036#\2401\240E\250\025\250a\250q\260\001\260\022\2601\260A\340\010\016\210a\320\017+\2501\250D\260\005\260S\270\002\270#\270S\300\003\3001\200A\340\022\037\230q\330\020\037\230q\330\017\035\230Y\240a\360(\000\t*\250\021\330\010\013\2109\220G\2301\330\014\027\220y\240\001\240\032\2501\250A\330\014\022\220!\320\023-\250Q\250d\260%\260q\330\010\036\230a\330\010\013\2107\220'\230\021\330\014\023\2206\230\021\230!\330\014\022\220!\320\0234\260A\260T\270\025\270a\330\010\036\230a\330\010\013\2106""\220\027\230\001\330\014\023\220>\240\033\250A\330\014\022\220!\320\023+\2501\250D\260\005\260Q\200A\340\023\024\330\016'\240q\330\017'\240q\330\021\030\230\n\240!\360:\000\t\"\240\024\240Y\250a\250q\330\010\035\230V\2401\240A\330\010\013\210:\220S\230\006\230a\330\010\013\210;\220g\230V\2406\320)<\270A\270Q\330\010\016\210a\320\017$\240A\240T\250\026\250\177\270a\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\014\210I\220Q\320\026(\250\013\2606\270\021\320\004!\240\021\360\024\000\t\035\230A\330\010'\240q\330\010'\240q\330\010'\240q\330\010\016\210a\210{\230!\2304\230q\330\033\034\230A\330\033!\240\026\240q\330\033!\240\026\240q\330\033!\240\021\330\033\034\230E\240\021\240%\240q\250\001\330\033\034\330\010\017\210v\220Q\220e\2305\240\005\240Q\200A\330\010\037\230q\330\010\t\330\014\027\220t\2301\330\017\020\330\014\022\220!\330\010\016\210a\330\010\017\210x\220q\200A\340\013\014\360\010\000\014\r\330\013\014\340\016\027\220q\360@\001\000\t \230v\240Q\240a\330\010\037\230v\240Q\240a\330\010\037\230v\240Q\240a\330\010\035\230Q\230m\2501\250A\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\016\210a\320\017\"\240!\2404\240u\250G\2601\260F\270$\270f\300G\3106\320QX\320XY\330#)\250\021\200A\340\r\016\330\016'\240q\330\017'\240y\260\001\3600\000\t\014\2106\220\023\220F\230(\240!\330\010\013\2106\220\023\220F\230(\240!\330\010\023\2205\230\006\230a\330\010\014\210I\220Q\220k\240\021\330\010\016\210a\320\017\037\230q\240\004\240F\320*:\270'\300\021\200A\340\023\024\330\016\017\330\016'\240q\330\017'\240y\260\001\360*\000\t\034\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\210:\220W\230A\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220{\240&\250\001\330\014\020\220\t\230\021\320\032.\250a\330\014\022\220!\320\023$\240A\240T\250\025\250f\3204E\300W\310A\340\014\022\220!\320\023$\240A\240T\250\025\250f\260F\270!\200A\340\026\027\330\016\017\330\016'\240q\330\017'""\240y\260\001\360*\000\t\034\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\210=\230\007\230q\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220~\240V\2501\330\014\020\220\t\230\021\320\032.\250a\330\014\022\220!\320\023$\240A\240T\250\025\250f\3204E\300W\310A\340\014\022\220!\320\023$\240A\240T\250\025\250f\260F\270!\200A\340\016'\240q\330\017'\240y\260\001\360&\000\t\014\2106\220\023\220F\230(\240!\330\010\013\2106\220\023\220F\230(\240!\330\010\023\220;\230f\240A\330\010\014\210I\220Q\320\026'\240q\330\010\016\210a\320\017'\240q\250\004\250E\3201A\300\027\310\001\200A\340\025\026\330\026\027\330\016'\240q\330\017'\240y\260\001\360*\000\t\014\2106\220\023\220F\230(\240!\330\010\013\2106\220\023\220F\230(\240!\340\010\013\210<\220w\230a\330\014\036\230m\2506\260\021\340\014\033\2304\230y\250\001\250\021\330\014\017\210}\230C\230q\330\020\037\230q\240\001\330\020\026\220a\320\027'\240q\250\004\250E\3201C\3006\310\027\320PQ\340\020\034\230G\2401\240A\330\014\020\220\t\230\021\320\032.\250a\340\010\013\210=\230\007\230q\330\014\037\230~\250V\2601\340\014\034\230D\240\t\250\021\250!\330\014\017\210~\230S\240\001\330\020 \240\001\240\021\330\020\026\220a\320\027'\240q\250\004\250E\260\026\3207J\310'\320QR\340\020\035\230W\240A\240Q\330\014\020\220\t\230\021\320\032/\250q\200A\340\020\021\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\2107\220'\230\021\330\014\017\210v\220S\230\006\230g\240Q\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220x\230v\240Q\330\014\020\220\t\230\021\320\0325\260Q\330\014\022\220!\320\0235\260Q\260d\270%\270q\340\014\022\220!\320\0235\260Q\260d\270%\270q\200A\340\020\021\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\2107\220'\230\021\330\014\017\210v\220S\230\006\230g\240Q\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220x\230v\240Q\330\014\020\220\t\230\021\320\0326\260a\330\014\022\220!\320\0236\260a\260t\2705\300\001\340\014\022\220!\320\0236\260a\260t\2705\300""\001\200A\340\020\021\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\2107\220'\230\021\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220x\230v\240Q\330\014\020\220\t\230\021\230.\250\001\330\014\022\220!\320\023#\2401\240D\250\005\250Q\340\014\022\220!\320\023#\2401\240D\250\005\250Q\200A\340\021\022\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\2108\2207\230!\330\014\017\210v\220S\230\006\230g\240Q\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220y\240\006\240a\330\014\020\220\t\230\021\320\032?\270q\330\014\022\220!\320\023>\270a\270t\3005\310\001\340\014\022\220!\320\023>\270a\270t\3005\310\001\200A\340\021\022\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\2108\2207\230!\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220y\240\006\240a\330\014\020\220\t\230\021\230/\250\021\330\014\022\220!\320\023$\240A\240T\250\025\250a\340\014\022\220!\320\023$\240A\240T\250\025\250a\200A\340\021\022\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\2108\2207\230!\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220y\240\006\240a\330\014\020\220\t\230\021\230/\250\021\330\014\022\220!\220<\230q\240\004\240E\250\021\340\014\020\220\t\230\021\230/\250\021\330\014\022\220!\220<\230q\240\004\240E\250\021\200A\340\022\023\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\2109\220G\2301\330\014\022\220!\320\023*\250!\330\024\030\230\006\320\0362\260!\330\014\017\210u\220C\220v\230W\240A\330\014\017\210v\220S\230\006\230h\240a\330\014\020\220\t\230\021\320\032+\250:\260V\2701\340\014\022\220!\320\023*\250!\2504\250v\260V\2701\330\014\020\220\t\230\021\320\032*\250!\200A\340\022\023\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\2109\220G\2301\330\014\017\210u\220C\220v\230W\240A\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\020\220\t\230\021\320\032*\250!\330\014\022\220!\220>\240\021\240$\240f""\250N\270'\300\021\340\014\020\220\t\230\021\320\032*\250!\330\014\022\220!\220>\240\021\240$\240f\250F\260!\200A\330\030\031\330\016'\240q\330\017'\240y\260\001\360(\000\t\014\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\020\220\t\230\021\320\032*\250!\330\014\022\220!\320\023$\240A\240T\250\025\250o\270W\300A\340\014\022\220!\320\023$\240A\240T\250\025\250f\260A\200A\330\030\031\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\020\220\t\230\021\320\032*\250!\330\014\022\220!\320\023$\240A\240T\250\025\250o\270W\300A\340\014\022\220!\320\023$\240A\240T\250\025\250f\260A\200A\340\023\024\330\016'\240q\330\017'\240y\260\001\360F\001\000\t\014\2106\220\023\220F\230(\240!\330\010\013\2106\220\023\220F\230(\240!\330\010\023\220;\230f\240A\330\010\014\210I\220Q\320\026'\240q\330\010\016\210a\320\017%\240Q\240d\250&\3200@\300\007\300q\200A\340\032\033\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\320\013\034\230G\2401\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\320\027)\250\026\250q\330\014\020\220\t\230\021\320\0322\260!\330\014\022\220!\320\023,\250A\250T\260\025\260a\340\014\022\220!\320\023,\250A\250T\260\025\260a\200A\340\013\014\330\013\014\330\013\014\330\016\037\230q\330\020'\240y\260\001\360.\000\t\031\230\001\230\024\230V\2403\240c\250\023\250F\260(\270#\270Q\200A\340\023\024\330\016'\240q\330\017'\240y\260\001\360>\000\t*\250\021\330\010\032\230!\330\010 \240\001\330\010\013\210:\220W\230A\330\014\022\220!\320\023(\250\001\330\024\030\230\006\230o\250V\2601\330\014\017\210u\220C\220v\230W\240A\330\014\017\210v\220S\230\006\230h\240a\330\014\020\220\t\230\021\320\032,\250K\260v\270Q\360\014\000\r\023\220!\220>\240\021\240$\240f\250A\250Q\330\014\017\210y\230\003\2301\330\020\026\220a\320""\027-\250Q\250m\2704\270q\330.8\270\001\270\021\330\020\026\220a\320\0270\260\001\260\021\260!\330\020\023\2204\220q\330\024\032\230!\320\0330\260\001\260\024\260V\2701\33017\260q\340\024\032\230!\320\0330\260\001\260\024\260V\2701\33017\260q\340\020\026\220a\320\027,\250A\250T\260\026\260q\330-3\2601\330\014\020\220\t\230\021\320\032+\2501\200A\340\023\024\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\210:\220W\230A\330\014\017\210u\220C\220v\230W\240A\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220{\240&\250\001\330\014\020\220\t\230\021\320\032+\2501\330\014\022\220!\220?\240!\2404\240v\250_\270G\3001\340\014\020\220\t\230\021\320\032+\2501\330\014\022\220!\220?\240!\2404\240v\250V\2601\200A\340\034\035\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\320\013\036\230g\240Q\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\320\027+\2506\260\021\330\014\020\220\t\230\021\320\0324\260A\330\014\022\220!\320\023.\250a\250t\2605\270\001\340\014\022\220!\320\023.\250a\250t\2605\270\001\200A\340\026\027\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\210=\230\007\230q\330\014\017\210v\220S\230\006\230g\240Q\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220~\240V\2501\330\014\020\220\t\230\021\320\032.\250a\330\014\022\220!\320\023(\250\001\250\024\250U\260!\340\014\022\220!\320\023(\250\001\250\024\250U\260!\200A\340\036\037\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\320\013 \240\007\240q\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\320\027-\250V\2601\330\014\020\220\t\230\021\320\0326\260a\330\014\022\220!\320\0230\260\001\260\024\260U\270!\340\014\022\220!\320\0230\260\001\260\024\260U\270!\200A\340\027\030\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\210>\230\027\240\001\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220\177\240f\250A\330\014\020\220\t\230\021\320\032/\250q\330\014\022\220!\320\023)""\250\021\250$\250e\2601\340\014\022\220!\320\023)\250\021\250$\250e\2601\200A\340\025\026\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\210<\220w\230a\330\014\017\210v\220S\230\006\230g\240Q\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220}\240F\250!\330\014\020\220\t\230\021\320\0325\260Q\330\014\022\220!\320\023.\250a\250t\2605\270\001\340\014\022\220!\320\023.\250a\250t\2605\270\001\200A\340\025\026\330\016'\240q\330\017'\240y\260\001\360&\000\t\014\210<\220w\230a\330\014\017\210v\220S\230\006\230g\240Q\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220}\240F\250!\330\014\020\220\t\230\021\320\0326\260a\330\014\022\220!\320\023/\250q\260\004\260E\270\021\340\014\022\220!\320\023/\250q\260\004\260E\270\021\320\004,\250A\360\024\000\t\030\220r\230\021\330\010\016\210a\320\0170\260\001\260\024\260Z\270q\300\004\300A\330\010\017\210q\320\004\034\230A\360\024\000\t\030\220r\230\021\330\010\016\210a\320\017 \240\001\240\024\240Z\250q\260\004\260A\330\010\017\210q\320\004$\240A\360\024\000\t\030\220r\230\021\330\010\016\210a\320\017'\240q\250\004\250E\260\021\260$\260a\330\010\016\210a\210{\230!\2304\230q\330\010\017\210q\200A\330\010\037\230t\2401\330\010\014\210G\2209\230D\240\005\240T\250\027\260\001\260\023\260G\2701\330\010\016\210a\320\017,\250A\250T\260\025\260d\270'\300\024\300X\310T\320QX\320X\\\320\\]\330\010\014\210L\230\001\200A\330\010\017\210t\2205\230\001\200A\330\010\017\210t\2205\230\010\240\002\240(\250'\260\021\200A\330\010\017\210t\2206\230\021\320\004$\240A\360\026\000\t\020\210t\2209\230A\230Q\320\004\034\230A\360\026\000\t\020\210t\2209\230A\230Q\320\004$\240A\360\024\000\t\020\210t\2209\230A\230Q\320\004\034\230A\360\024\000\t\020\210t\2209\230A\230Q\200A\330\010\037\230t\2409\250A\250Q\330\010\014\210I\220Q\220n\240A\330\010\017\210s\220%\220q\200A\340\017\020\330\017\020\330\020\030\230\001\360(\000\t \230u\240A\240Q\330\010\037\230u\240A\240Q\330\010 \240\005\240Q\240a\330\010\016\210a\320\0170\260\001\260\024\260V\2708\3008""\3101\320\004\034\230A\360*\000\t\033\230%\230u\240E\250\025\250e\2605\270\001\330\010\016\210a\210z\230\021\230$\230e\2401\240A\330\010\016\210a\210~\230Q\230d\240!\330\036\037\230s\240!\2403\240a\240q\330\036\037\230s\240!\2403\240a\240q\330\010\020\220\001\220\025\220a\220t\2305\240\001\240\024\240U\250!\2503\250b\260\014\270A\330\021\026\220a\220t\2305\240\001\240\024\240U\250!\2503\250b\260\014\270A\320\004\034\230A\360\"\000\t\033\230%\230u\240E\250\025\250e\2605\270\013\300;\310k\320YZ\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\250#\250Q\250c\260\021\260#\260Q\260c\270\021\270#\270Q\270c\300\021\300)\3101\310I\320UV\320VW\330\010\017\210q\220\005\220Q\220d\230%\230q\240\004\240E\250\021\250#\250R\250|\2707\300%\300q\310\004\310E\320QR\320RV\320V[\320[\\\320\\_\320_a\320am\320mt\320ty\320yz\360\000\000{\001E\002\360\000\000E\002J\002\360\000\000J\002K\002\360\000\000K\002U\002\360\000\000U\002Z\002\360\000\000Z\002[\002\360\000\000[\002d\002\360\000\000d\002f\002\360\000\000f\002r\002\360\000\000r\002s\002\320\004$\240A\360\032\000\t\033\230%\230u\240E\250\021\330\010\"\240,\250l\270!\330\010\016\210a\210{\230!\2304\230q\330\033\034\230A\330\033!\240\026\240q\330\033\034\230C\230q\240\003\2401\240A\330\033!\240\021\330\033!\240\026\240q\330\033\034\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\004\260A\260T\270\021\270!\330\010\017\320\017 \240\001\240\025\240c\250\023\250C\250t\2604\260q\320\004$\240A\360\024\000\t\033\230%\230u\240E\250\021\330\010\"\240,\250l\270!\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\016\210a\320\017 \240\001\240\024\240U\250!\2503\250a\250s\260!\2601\330\010\016\210a\320\017'\240q\250\004\250E\260\021\260$\260a\260t\2701\270A\330\010\017\320\017$\240A\240U\250#\250S\260\003\2604\260t\2701\200A\330\036\037\360\024\000\t\020\210v\220Q\220a\200A\330\034\035\360\024\000\t\020\210v\220Q\220a\200A\330\037 \360*\000\t \230w\240a\330\010\030\230\003\2301\330""\010\016\210a\320\017$\240A\330\014\017\210v\220Q\220g\230V\2401\240D\250\001\330\010\020\220\t\230\021\200A\330 !\360*\000\t \230w\240a\330\010\030\230\003\2301\330\010\016\210a\320\017%\240Q\330\014\017\210v\220Q\220g\230V\2401\240D\250\001\330\010\020\220\t\230\021\200A\330\010\017\210w\220a\220v\230Q\200A\330\010\017\210x\220q\230\006\230a\200A\340\016\037\230y\250\001\3600\000\t!\240\001\330\010\035\230Q\330\010\013\2105\220\007\220v\230W\240I\250Q\250f\260A\260Q\330\010\013\2102\210S\220\005\220T\230\021\230!\2303\230c\240\025\240d\250!\2501\250C\250s\260!\330\014\022\220!\220?\240!\2404\240v\250Q\250a\330\r\016\210a\210s\220#\220Q\330\014\022\220!\320\023&\240a\240t\2506\3201F\300a\300q\330\r\016\210a\210s\220#\220Q\330\014\022\220!\320\023'\240q\250\004\250F\260!\2601\340\014\022\220*\230A\230Q\330\010\017\210~\230Q\200A\340\016\037\230y\250\001\3600\000\t!\240\001\330\010\035\230Q\330\010\013\2105\220\007\220v\230W\240I\250Q\250f\260A\260Q\330\010\013\2102\210S\220\005\220T\230\021\230!\2303\230c\240\025\240d\250!\2501\250C\250s\260!\330\014\022\220!\220>\240\021\240$\240f\250A\250Q\330\r\016\210a\210s\220#\220Q\330\014\022\220!\320\023%\240Q\240d\250&\3200E\300Q\300a\330\r\016\210a\210s\220#\220Q\330\014\022\220!\320\023&\240a\240t\2506\260\021\260!\340\014\022\220*\230A\230Q\330\010\017\210~\230Q\200A\340\016\037\230y\250\001\360,\000\t$\2401\330\010\035\230Q\330\010\017\210y\230\001\230\026\230q\240\001\330\010\013\2102\210S\220\005\220T\230\021\230!\2303\230c\240\025\240d\250!\2501\250C\250s\260!\330\014\022\220!\320\023&\240a\240t\2506\260\021\260!\330\r\016\210a\210s\220#\220Q\330\014\022\220!\320\023*\250!\2504\250v\260Q\260a\330\r\016\210a\210s\220#\220Q\330\014\022\220!\320\023+\2501\250D\260\006\260a\260q\340\014\022\220*\230A\230Q\330\010\017\210q\200A\330\010\027\220y\240\001\330\010\013\2105\220\005\220Q\330\014\031\230\021\320\032,\250A\250Q\330\014\031\230\021\320\032,\250A\250Q\330\010\017\210w\220c\230\021\230#\230Q\230e\2401\240E\250\021""\330\010\021\220\021\320\022\"\240\"\240D\250\001\330\010\014\210I\220T\230\021\330\014\025\220[\240\003\2407\250&\260\001\330\014\022\220'\230\021\230!\330\010\017\210t\2205\230\001\230\021\200A\340\021\022\330\020\021\330\016\037\230y\250\001\3608\000\t\025\220A\220T\230\026\230y\250\010\260\006\260c\270\021\200A\340\017\020\330\017\020\330\016\037\230y\250\001\3608\000\t!\240\005\240Q\240a\330\010 \240\010\250\001\250\021\330\010%\240Z\250q\260\001\330\010\016\210a\210|\2301\230D\240\006\240c\250\021\250&\260\001\260\026\260q\200A\340\017\020\330\017\020\330\016\037\230y\250\001\3608\000\t!\240\005\240Q\240a\330\010 \240\010\250\001\250\021\330\010%\240Z\250q\260\001\330\010\016\210a\320\017 \240\001\240\024\240V\2503\250a\250v\260Q\260f\270A\200A\340\016\017\330\016\017\330\020\021\330\016\037\230y\250\001\360*\000\t\025\220A\220T\230\026\230v\240V\2508\2606\270\023\270A\200A\340\016\017\330\016\017\330\020\021\330\016\037\230y\250\001\360.\000\t\025\220A\220T\230\026\230v\240V\2508\2606\270\023\270A\200A\340\021\022\330\020\021\330\016\037\230y\250\001\360@\001\000\t\025\220A\220T\230\026\230y\250\010\260\006\260c\270\021\200A\340\030\031\330\030\031\330\017\020\330\016\037\230y\250\001\360*\000\t\035\230I\240Q\330\010\"\240*\250A\250Q\330\010\032\230!\2304\230v\240S\250\003\2507\260$\260a\200A\340\r\016\330\r\016\330\017\020\330\016\037\230y\250\001\360*\000\t\035\230I\240Q\330\010\"\240*\250A\250Q\330\010\032\230!\2304\230v\240S\250\003\2507\260$\260a\200A\340\020\021\330\016\037\230y\250\001\360$\000\t!\240\017\250~\270Q\330\010\035\230Q\330\010\013\2105\220\007\220v\230W\240I\250Q\250f\260A\260Q\330\010\013\2102\210S\220\005\220T\230\021\230!\2303\230c\240\025\240d\250!\2501\250C\250s\260!\330\014\022\220!\320\023&\240a\240t\2506\260\021\260!\330\r\016\210a\210s\220#\220Q\330\014\022\220!\320\023*\250!\2504\250v\3205J\310!\3101\330\r\016\210a\210s\220#\220Q\330\014\022\220!\320\023+\2501\250D\260\006\260a\260q\340\014\022\220*\230A\230Q\200A\340\020\021""\330\016\037\230y\250\001\360$\000\t!\240\017\250~\270Q\330\010\035\230Q\330\010\013\2105\220\007\220v\230W\240I\250Q\250f\260A\260Q\330\010\013\2102\210S\220\005\220T\230\021\230!\2303\230c\240\025\240d\250!\2501\250C\250s\260!\330\014\022\220!\320\023%\240Q\240d\250&\260\001\260\021\330\r\016\210a\210s\220#\220Q\330\014\022\220!\320\023)\250\021\250$\250f\3204I\310\021\310!\330\r\016\210a\210s\220#\220Q\330\014\022\220!\320\023*\250!\2504\250v\260Q\260a\340\014\022\220*\230A\230Q\200A\340\017\020\340\016\037\230y\250\001\360.\000\t\036\230U\240!\2401\330\010%\240Z\250q\260\001\330\010\016\210a\210\177\230a\230t\2406\250\026\250s\260&\270\001\200A\340\017\020\340\016\037\230y\250\001\360.\000\t\036\230U\240!\2401\330\010%\240Z\250q\260\001\330\010\016\210a\320\017\037\230q\240\004\240F\250&\260\003\2606\270\021\200A\340\013\014\330\013\014\330\013\014\330\016\037\230y\250\001\360*\000\t\031\230\001\230\024\230V\2403\240c\250\023\250F\260#\260Q\200A\340\017\020\330\016\037\230y\250\001\360 \000\t\031\230\001\230\024\230V\2407\250!\200A\340\r\016\330\r\016\330\017\020\330\016\037\230y\250\001\360*\000\t\"\240\025\240a\240q\330\010!\240\025\240a\240q\330\010!\240\030\250\021\250!\330\010%\240Z\250q\260\001\330\010\016\210a\210|\2301\230D\240\006\240c\250\021\250'\260\023\260A\260W\270A\270V\3001\200A\340\r\016\330\r\016\330\017\020\330\016\037\230y\250\001\360*\000\t\"\240\025\240a\240q\330\010!\240\025\240a\240q\330\010!\240\030\250\021\250!\330\010%\240Z\250q\260\001\330\010\016\210a\320\017 \240\001\330\020\024\220F\230#\230Q\230g\240S\250\001\250\027\260\001\260\026\260q\320\004\035\230\\\250\033\260A\360\024\000\t!\240\001\330\010\017\210y\230\001\230\026\230q\240\001\330\010\014\210I\220Q\220g\230V\2401\320\004\035\230_\250A\360\024\000\t!\240\001\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\320\017!\240\021\240$\240d\250!\2504\250q\320\004\037\230|\320+B\320BT\320TU\3602\000\t!\240\005\240Q\240a\330\010 \240\001\330\010 \240\001\330\010 \240""\001\330\010$\240A\330\010\021\220\030\230\021\230(\240!\2409\250L\270\001\270\021\330\010\013\2106\220\027\230\001\330\014\024\220H\230A\230W\240A\240Y\250a\250q\330\014\023\2201\220A\220X\230S\240\001\340\014\023\2208\2302\230R\230s\240!\330\014\026\220h\230c\240\021\330\010\016\210a\210\177\230a\230t\2405\250\t\260\031\270(\320BU\320U^\320^_\320\004&\320&B\320B[\320[h\360\000\000i\001A\002\360\000\000A\002J\002\360\000\000J\002K\002\360&\000\t\014\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\220;\230f\240A\330\010\014\210I\220Q\320\026'\240q\330\010\016\210a\210\177\230a\230t\2406\250\037\270\007\270q\320\004B\320Bp\320pq\3600\000\t\035\230B\230a\330\010!\240\021\330\010(\250\001\330\010\013\210>\230\027\240\001\330\014\034\230H\240A\240_\260A\260Z\270q\300\001\330\010\016\210a\320\017%\240Q\240d\250%\250{\270&\300\001\330&1\260\026\260q\270\t\300\021\330\010\017\210q\320\004\031\320\031-\320-B\300)\3101\360\"\000\t\032\230\032\2403\240a\240z\260\021\330\010\031\230\021\330\010\036\230a\330\010\032\230!\330\010\035\230X\240Q\240g\250Q\250e\2606\270\030\300\021\300!\330\010\014\210G\2209\230A\330\014\r\210Q\210f\220G\2304\230q\240\004\240A\330\010\013\2104\210s\220!\330\014\022\220'\230\021\230!\330\010\016\210h\220a\220u\230A\230T\240\021\240!\330\010\014\210C\210s\220%\220v\230Z\240q\330\r\016\330 %\240Q\240e\2505\260\001\260\021\330\010\016\210a\210w\220a\220t\2306\240\024\240S\250\001\330\010\017\210q\320\004\036\320\036/\320/B\300)\3101\360\"\000\t-\250A\330\010&\240l\260!\2601\330\010\013\2107\220#\220Q\330\014\025\220T\230\021\230%\230q\330\010\013\2106\220\025\220c\230\021\330\014\022\220!\220<\230q\240\004\240F\250&\260\001\260\026\260q\340\014\022\220!\2207\230!\2304\230v\240V\2506\260\021\330\010\017\210q\320\004*\320*B\300!\360&\000\t\037\230f\240A\240Q\330\010\016\210a\320\017)\250\021\250$\250e\2606\270\021\270&\300\001\300\026\300q\320\004-\320-C\3001\360\036\000\t\024\2201\220M\240\032\2501\250J\260i\270t""\3001\300A\330\010\037\230s\240!\2401\330\010#\2401\330\010\035\230X\240Q\240g\250Q\250j\270\004\270F\300(\310!\3101\330\010\014\210G\2209\230C\230y\250\001\250\026\250u\260H\270A\270S\300\001\330\010\016\210a\320\017%\240Q\240d\250%\250z\270\023\270A\320\004!\320!C\3001\360\024\000\t\022\220\031\230!\2301\330\010#\2401\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017%\240Q\240d\250&\260\001\320\004C\3001\360@\001\000\t\027\220b\230\001\330\010\026\220b\230\001\330\010\016\210a\320\017 \240\001\240\024\240U\250&\260\006\260i\270u\300D\310\005\310Q\310c\320QV\320VW\320WZ\320Z[\330\010\017\210u\220A\320\004*\320*C\3001\360\036\000\t(\240q\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017'\240q\250\004\250E\260\021\320\004\032\320\032.\320.C\3009\310A\360\"\000\t\032\230\032\2403\240a\240z\260\021\330\010\031\230\021\330\010\036\230a\330\010\032\230!\330\010\035\230X\240Q\240g\250Q\250e\2606\270\030\300\021\300!\330\010\014\210G\2209\230A\330\014\r\210Q\210f\220G\2304\230q\240\004\240A\330\010\013\2104\210s\220!\330\014\022\220'\230\021\230!\330\010\016\210h\220a\220u\230A\230T\240\021\240!\330\010\014\210C\210s\220%\220v\230Z\240q\330\r\016\330 %\240Q\240e\2505\260\001\260\021\330\010\016\210a\210x\220q\230\004\230F\240$\240c\250\021\330\010\017\210q\320\004)\320)C\3009\310K\320Wc\320cl\320lm\360.\000\t\032\230\026\230q\330\010 \240\010\250\001\250\021\330\010\033\230;\240a\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\210:\220Q\220f\230A\330\014\022\220!\320\023,\250A\250T\260\027\270\004\270E\300\027\310\006\310f\320TU\340\014\023\2208\2301\230F\240!\2404\240q\250\001\330\014\022\220!\320\023*\250!\2504\250v\260T\270\023\270F\300&\310\001\320\004C\300<\310y\320XY\340\010\013\2105\220\004\220F\230(\240!\330\010\013\2106\220\023\220F\230(\240!\330\010\023\220:\230V\2401\330\010\014\210I\220Q\320\026D\300A\330\010\016\210a\320\0176\260a\260t\2705\320@g\320gn\320no\320\004C\300<\310y""\320XY\340\010\013\2105\220\004\220F\230(\240!\330\010\013\2106\220\023\220F\230(\240!\330\010\023\220:\230V\2401\330\010\014\210I\220Q\320\026D\300A\330\010\016\210a\320\017(\250\001\250\024\250U\3202Y\320Y`\320`a\320\004'\320'D\300A\3608\000\t\037\230a\330\010\016\210a\320\017 \240\001\240\024\240V\2501\250A\340\010\030\230\001\230\024\230V\2401\330\010\017\210q\320\004.\320.D\320DV\320VW\360$\000\t \230|\2501\330\010 \320 0\260\001\330\010\037\230q\340\010\020\220\010\230\001\230\027\240\001\240\030\250\021\250!\330\010\020\220\010\230\001\230\027\240\001\240\030\250\021\250!\340\010\013\2107\220#\220Q\330\014\022\220*\230A\230Q\340\010\017\210}\230A\330\010\016\210a\320\017*\250!\2504\250v\260V\2708\3001\330\010\017\210q\320\004/\320/D\320DY\320Yk\320kt\320tu\360\"\000\t!\240\001\330\010!\240\033\250C\250q\260\001\330\010(\250\001\330\010\035\230X\240Q\240g\250Q\250k\270\026\270x\300q\310\001\330\010$\240A\330\010\036\230h\240a\240w\250a\250{\270&\300\010\310\001\310\021\330\010&\240k\260\021\260!\330\010\025\220T\230\021\230!\330\010\014\210G\2209\230A\330\014\026\220a\220u\230I\240Q\240j\260\001\260\024\260Q\260a\330\014\027\220q\230\005\230Q\330\014\026\220a\220v\230W\240D\250\001\250\024\250Q\330\010\016\210a\320\017#\2401\240D\250\005\250R\250u\260J\270m\310<\320WX\330\010\t\320\004.\320.D\300H\310F\320RS\360*\000\t \230u\240A\240Q\330\010\036\230e\2401\240A\330\010 \240\001\330\010!\240\021\330\010\020\220\t\230\021\230'\240\021\240!\330\010\013\2105\220\003\2206\230\027\240\001\330\010\016\210a\210z\230\021\230$\230e\2406\250\021\250!\330\010\016\210a\320\017 \240\001\240\024\240U\250&\260\010\270\007\270s\300!\320\004D\300I\310Q\340\010\016\210a\320\004+\320+D\300I\310[\320Xd\320dm\320mn\360,\000\t!\240\010\250\001\250\021\330\010\036\230e\2401\240C\240q\250\001\330\010&\240a\330\010\016\210a\210{\230!\2309\240E\250\021\250\"\250A\320-F\300a\300q\330\010\014\210E\220\025\220a\220q\330\014\021\220\021\220&\230\r\240T\250\021\250#\250Q\330\010\035\230]""\250!\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\016\210a\320\017(\250\001\250\024\250V\2607\270'\300\026\300v\310Q\330\010\016\210a\210y\230\001\230\021\320\004'\320'E\320E^\320^k\360\000\000l\001D\002\360\000\000D\002M\002\360\000\000M\002N\002\360(\000\t\017\210a\320\017/\250q\260\004\260H\320<M\310Q\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\014\210I\220Q\320\026(\250\013\2606\270\021\320\004$\320$F\320F_\320_l\360\000\000m\001E\002\360\000\000E\002N\002\360\000\000N\002O\002\360*\000\t\014\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\220:\230V\2401\330\010\014\210I\220Q\320\026&\240a\330\010\016\210a\320\017$\240A\240T\250\026\250q\260\006\260n\300G\3101\320\000\024\220F\320\0321\260\021\360\026\000\005\010\200u\210E\320\021)\250\021\330\004\010\210\005\320\r#\2401\330\004\032\230!\330\004\007\200u\210C\210q\330\010\020\220\007\220q\230\014\240A\330\010\016\210a\320\017\"\240!\2401\340\010\020\220\007\220q\230\006\230a\330\010\013\2106\220\023\220A\330\014\022\220*\230A\230Q\330\010\016\210a\320\017\"\240!\2401\320\004)\250\036\260}\300F\310!\360$\000\t\037\230e\2401\240A\330\010\036\230f\240A\240Q\330\010\032\230#\230Q\330\010\016\210a\320\017(\250\001\250\024\250U\260&\270\006\270a\270v\300Q\330\010\017\210q\320\004$\240F\250,\260n\300I\310Q\360\"\000\t\037\230h\240a\240v\250Q\330\010\034\230A\330\010\016\210a\210y\230\001\230\027\240\001\240\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\016\210a\210z\230\021\230$\230f\240A\330\010\016\210a\320\017\"\240!\2404\240v\250W\260A\330\010\017\210q\320\004$\240F\250,\260n\300I\310Q\360\"\000\t\037\230h\240a\240v\250Q\330\010\035\230Q\330\010\016\210a\210x\220q\230\007\230q\240\001\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\016\210a\210y\230\001\230\024\230U\240!\330\010\016\210a\320\017!\240\021\240$\240e\2507\260!\330\010""\017\210q\320\004$\240F\250,\260n\300I\310Q\360$\000\t\037\230h\240a\240v\250Q\330\010\"\240!\330\010\016\210a\320\017 \240\001\240\027\250\001\250\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\016\210a\320\017!\240\021\240$\240f\250A\330\010\016\210a\320\017*\250!\2504\250v\260W\270A\330\010\013\2101\330\014\022\220!\320\023#\2401\240D\250\001\330\010\017\210q\320\004$\240F\250,\260n\300I\310Q\360\"\000\t\037\230h\240a\240v\250Q\330\010!\240\021\330\010\016\210a\210z\230\021\230'\240\021\240!\330\010\016\210a\210z\230\021\230$\230h\240d\250(\260!\330\010\016\210a\210{\230!\2304\230w\240a\330\010\016\210a\320\017#\2401\240D\250\007\250w\260a\330\010\017\210q\320\004$\240F\250-\260v\270V\3001\360\"\000\t \230u\240A\240Q\330\010\"\240%\240q\250\001\330\010 \240\001\330\010!\240\021\330\010#\2401\340\010\016\210a\320\017#\2401\240D\250\005\250X\260[\300\001\300\021\330\010\016\210a\210\177\230a\230z\320)<\270A\270Y\300a\300q\340\010\032\230!\2306\240\021\240(\250!\2504\250t\2607\270)\3001\330\010\017\210q\320\004F\300a\360*\000\t\017\210a\320\017 \240\001\240\024\240U\250(\260&\270\t\300\021\320\004\031\230\021\360*\000\t\035\230G\2401\330\010\032\230#\230Q\330\010\032\230#\230Q\330\010\036\230a\330\010\016\210a\210z\230\021\230$\230f\240A\240X\250Q\250d\260*\270A\270V\3006\310\021\310&\320PQ\330\010\016\210a\210{\230!\2304\230q\330\010\013\2106\220\025\220c\230\026\230v\240Q\240k\260\021\260&\270\001\330\010\013\2106\220\025\220c\230\026\230v\240Q\240k\260\021\260&\270\001\330\010\020\220\006\220a\220y\240\006\240h\250a\320\004\034\320\034-\250]\270-\320GY\320Y`\320`a\330 '\240}\260N\300)\3101\3600\000\t\031\230\006\230a\330\010!\240\021\330\010\036\230a\330\010\037\230q\330\010 \240\001\330\010%\240Q\330\010#\2401\330\010\025\220R\220q\330\010\013\2106\220\027\230\001\330\014\024\220J\230f\240A\330\010\013\2106\220\027\230\001\330\014\025\220U\230!\2301\330\010\016\210a\320\017!\240\021\240-\250t\2605\270\001\270\021\330\010\020\220\010\230""\001\230\026\230q\330\010\016\210a\210|\2301\230D\240\005\240V\2508\260=\300\013\3107\320RS\320SU\320UZ\320Z[\320[`\320`a\330\010\017\210w\220a\320\004\"\240'\320)<\270G\300:\310Q\360\"\000\t\035\230A\330\010\034\230A\330\010\034\230A\330\010\030\230\001\330\010 \240\001\330\010 \240\001\330\010\034\230A\330\010\016\210a\210{\230!\2304\230v\240W\250F\260&\270\001\270\023\270A\270T\300\021\300$\300a\300q\330\010\027\220y\240\001\330\010\013\2105\220\003\220=\240\005\240W\250A\250Q\250a\250s\260!\330\010\013\2105\220\003\220=\240\005\240W\250A\250R\250q\260\004\260A\330\010\016\210a\210\177\230a\230t\2406\250\027\260\006\260f\270A\270S\300\001\300\024\300Q\300d\310!\3101\330\010\020\220\004\220A\320\004G\300q\360\"\000\t\017\210a\320\0176\260a\260t\2705\300\004\300F\310$\310a\330\010\017\210q\320\004G\300q\360,\000\t\017\210a\320\017$\240A\240T\250\025\250f\260F\270)\3005\310\003\3101\320\004G\300q\360&\000\t\017\210a\320\017'\240q\250\004\250F\260%\260w\270e\3007\310!\3106\320QR\320\004)\320)G\300q\360\036\000\t\033\230%\320\037/\320/?\270q\330\010\034\230L\250\014\260A\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\016\210a\320\017 \240\001\240\024\240U\250!\2503\250a\250s\260!\2601\330\010\035\230Q\230h\240e\2501\250C\250q\260\003\2601\260C\260q\270\004\270A\270T\300\021\300!\330\010\016\210a\320\017'\240q\250\004\250E\260\024\260T\270\021\320\004G\300y\320PQ\360&\000\t!\240\001\330\010\013\2104\210w\220f\230J\240c\250\021\330\010\016\210a\320\017,\250A\250T\260\025\260c\270\026\270s\300!\330-.\320\004#\240<\320/G\300y\320PQ\360$\000\t!\240\005\240Q\240a\330\010 \240\001\330\010\034\230A\330\010\013\2106\220\027\230\001\330\014\017\210x\220s\230*\240C\240q\250\001\330\020\026\220j\240\001\240\021\330\014\022\220!\220;\230a\320\037/\250q\260\010\270\t\300\021\300!\330\014\r\330\020\024\220C\220x\230y\250\001\250\021\330\024\032\230!\2305\240\010\250\001\250\026\250q\330\020\026\220a\320\027'\240q\250\004\250G\2609\270A\340\020\026\220a\220y\240\001\240""\021\340\014\022\220!\320\023#\2401\240D\250\007\250y\270\001\320\004,\320,G\300y\320PQ\360*\000\t\037\230f\240A\240Q\330\010\035\230Q\230m\2501\250A\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\016\210a\320\017+\2501\250D\260\005\260V\2701\270F\300&\310\006\310a\320\004(\250\014\260H\270A\3602\000\t\037\230i\240q\330\010\037\230u\240A\240Q\330\010\037\230u\240A\240Q\330\010\016\210a\320\017'\240q\250\004\250E\260\030\270\030\300\021\300'\310\021\310!\330\010\017\210u\220A\220X\230U\240!\2401\320\004\034\230H\240A\360 \000\t\034\2305\240\001\240\021\330\010\037\230z\250\021\330\010\016\210a\210~\230Q\230d\240%\240q\250\010\260\001\260\021\330\010\017\210r\220\022\2207\230$\230b\240\001\240\021\330\010%\240Q\330\010%\240Q\330\010\016\210a\320\017#\2401\240D\250\005\250T\260\021\260!\330\010\016\210a\320\017\037\230q\240\004\240E\250\024\250Q\250a\330\010\017\210w\220a\220w\230a\320\004$\240H\250A\360 \000\t\034\2305\240\001\240\021\330\010\037\230z\250\021\330\010\016\210a\210~\230Q\230d\240%\240q\250\010\260\001\260\021\330\010\017\210r\220\022\2207\230$\230b\240\001\240\021\330\010%\240Q\330\010%\240Q\330\010\016\210a\320\017 \240\001\240\024\240U\250$\250a\250q\330\010\016\210a\320\017'\240q\250\004\250E\260\024\260Q\260a\330\010\017\210w\220a\220w\230a\320\004,\250H\260A\340\010\014\210I\220Q\220n\240A\330\010\013\2107\220'\230\021\330\014\032\230!\2307\240!\330\014\022\220!\320\023,\250A\250T\260\027\270\007\270q\340\014\022\220!\320\023,\250A\250T\260\027\270\001\320\004,\250H\260A\360\024\000\t\036\230Q\330\010!\240\021\330\010\024\220I\230Q\230k\250\021\250!\330\010\016\210a\320\017 \240\001\240\024\240U\250'\260\021\260!\330\010\017\210v\220Q\220a\320\004$\240H\250A\360\036\000\t!\240\005\240Q\240a\330\010\016\210a\210\177\230a\230t\2405\250\001\320\004$\240H\250A\360\036\000\t\036\230U\240!\2401\330\010\016\210a\210\177\230a\230t\2405\250\001\320\004,\250H\260A\360\024\000\t\036\230U\240!\2401\330\010\016\210a\320\017.\250a\250t\2607\270!\320\004$""\240H\250A\360\036\000\t\036\230U\240!\2401\330\010\016\210a\320\017!\240\021\240$\240e\2501\320\004$\240H\250A\360\036\000\t\036\230U\240!\2401\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\320\004,\250H\260A\360 \000\t\036\230U\240!\2401\330\010\016\210a\320\017'\240q\250\004\250E\260\021\320\004$\240H\250A\360\024\000\t*\250\021\330\010!\240\021\330\010\021\220\021\220&\230\001\230\021\330\010\016\210a\320\017%\240Q\240d\250%\250w\260a\260q\330\010\032\230&\240\001\330\010\013\2107\220!\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\034\230H\240A\340\010\036\230a\330\010\036\230a\330\010\035\230W\240A\240T\250\031\260&\270\001\270\024\270Q\270a\330\010\036\230a\330\010\016\210a\320\017\"\240!\2404\240v\250T\260\024\260Q\260a\330\010\017\210v\220Q\220a\320\004$\240H\250A\360\026\000\t\017\210a\320\017)\250\021\250$\250f\260E\270\021\270!\320\004$\240H\250A\360\036\000\t\"\240\025\240a\240q\330\010\016\210a\320\017\"\240!\2404\240z\260\021\320\004$\240H\250A\360\036\000\t\"\240\025\240a\240q\330\010\027\220r\230\021\330\010\016\210a\320\017\"\240!\2404\240z\260\032\2701\270D\300\001\330\010\017\210q\320\004$\240H\250A\360\036\000\t\037\230e\2401\240A\330\010\016\210a\320\017#\2401\240D\250\005\250Q\320\004$\240H\250A\360.\000\t\037\230i\240q\330\010\037\230u\240A\240Q\330\010\016\210a\320\017#\2401\240D\250\005\250X\260Q\260g\270Q\270a\330\010\017\210u\220A\220X\230U\240!\2401\320\004$\240H\250A\360\026\000\t \230u\240A\240Q\330\010\033\2304\230q\330\010\016\210a\320\017!\240\021\240$\240g\250X\260Q\260f\270A\330\010\016\210a\210{\230!\2306\240\021\330\010\017\210q\320\004$\240H\250A\360\036\000\t \230u\240A\240Q\330\010\035\230Q\330\010\016\210a\320\017 \240\001\240\024\240V\2508\2601\260A\330\010\017\210v\220Q\220a\320\004\037\230}\250H\260A\360&\000\t \230u\240A\240Q\330\010 \240\005\240Q\240a\330\010\016\210a\320\017$\240A\240T\250\026\250x\260q\320\004$\240H\250A\360\036\000\t \230u\240A\240Q\330\010\016\210a\320\017\037\230q\240\004""\240E\250\021\320\004$\240H\250A\360 \000\t \230u\240A\240Q\330\010\037\230q\330\010\016\210a\320\017#\2401\240D\250\005\250X\260Q\260a\330\010\017\210u\220A\220Q\320\004 \240\014\250H\260A\360\"\000\t \230u\240A\240Q\330\010\037\230u\240A\240Q\330\010\016\210a\320\017 \240\001\240\024\240Z\250x\260q\320\004\034\230H\240A\360$\000\t \230u\240A\320%7\260q\330\010\016\210a\320\017!\240\021\240$\240f\250H\260A\260Q\330\010\017\210u\220A\220Q\320\004*\320*H\310\001\360\036\000\t\034\2306\240\021\240-\250q\330\010\013\320\013\034\230A\230V\2406\250\034\260Q\260a\330\010\013\210<\220q\230\005\230S\240\003\2406\250\032\2601\330\r\016\330$'\240|\2601\260A\330\010\035\230[\250\013\2601\260E\270\021\330\010\035\230[\250\013\2601\260E\270\021\330\010!\240\035\250l\270!\2701\330\010\016\210a\320\017\037\230q\240\004\240E\250\026\250v\260Q\320\004H\310\t\320QR\360 \000\t\037\230f\240A\240Q\330\010\016\210a\320\0175\260Q\260d\270%\270q\320\004*\320*H\310\014\320Tm\320mz\360\000\000{\001S\002\360\000\000S\002\\\002\360\000\000\\\002]\002\360*\000\t\036\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\220=\240\006\240a\330\010\014\210I\220Q\320\026)\250\021\330\010\016\210a\320\017'\240q\250\004\250F\260&\3208I\310\027\320PQ\320\004H\310\001\360,\000\t\017\210a\320\017%\240Q\240d\250%\250v\260V\2709\300E\310\023\310A\320\004'\240}\260I\270Q\360\024\000\t$\2401\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017,\250A\250T\260\030\270\021\320\004'\240}\260I\270Q\360(\000\t\014\2106\220\023\220F\230'\240\033\250A\250T\260\021\330\016\025\220U\230!\2301\330\010 \240\001\330\010\016\210a\210{\230!\2308\2404\240q\320(:\270!\2701\330\010\016\210a\320\017\"\240!\2404\240w\250f\260A\330\010\036\230a\330\010\t\330\014\026\220g\230Q\230f\240A\340\014\022\220!\2209\230A\230Q\330\010\017\210q\320\004'\240}\260I\270Q\360\024\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330""\010\016\210a\320\017\"\240!\2404\240v\250Q\320\004<\270I\300Q\340\010\016\210a\320\004(\250\001\360\024\000\t\r\210I\220Q\320\026)\250\021\330\010\016\210a\320\0170\260\001\260\024\260T\270\021\270!\320\004$\240I\250Q\360\022\000\t!\240\001\330\010\016\210a\320\017,\250A\250T\260\034\270Q\320\004\034\230I\240Q\360\024\000\t\037\230a\330\010\016\210a\320\017#\2401\240D\250\007\250q\320\004\034\230I\240Q\360\024\000\t\037\230a\330\010\016\210a\210~\230Q\230d\240'\250\021\320\004$\240I\250Q\360\036\000\t\037\230a\330\010\016\210a\320\017!\240\021\240$\240e\2501\320\004,\250I\260Q\360\036\000\t\037\230f\240A\240Q\330\010\016\210a\320\017(\250\001\250\024\250U\260!\320\004,\250I\260Q\360\034\000\t\037\230f\240A\240Q\330\010\016\210a\320\017(\250\001\250\024\250U\260!\320\004,\250I\260Q\360 \000\t\037\230f\240A\240Q\330\010\016\210a\320\017'\240q\250\004\250E\260\021\320\004!\240\021\360\024\000\t\r\210I\220Q\320\026*\250!\330\010\017\210q\320\004!\240\037\260\001\360\036\000\t#\240!\330\010\024\220I\230Q\230k\250\021\250!\330\010\016\210a\210{\230!\2304\230w\240a\320\004!\240\037\260\001\360\036\000\t*\250\021\330\010\024\220I\230Q\230k\250\021\250!\330\010\016\210a\320\017&\240a\240t\2507\260!\320\004 \240\010\250\001\360*\000\t\r\210I\220Q\220n\240A\320\004 \240\010\250\001\360\026\000\t\r\210I\220Q\220n\240A\320\004 \240\010\250\001\340\010\014\210I\220Q\220n\240A\320\004\"\240/\260\034\270_\310I\320UV\3602\000\t \230q\330\010\037\230q\330\010\037\230q\330\010\037\230q\330\010\013\2105\220\003\2201\340\r\027\220q\230\006\230a\330\014\025\220U\230%\230q\340\014\024\220F\230!\2301\330\010\013\2105\220\003\2201\340\r\027\220q\230\006\230a\330\014\025\220U\230%\230q\340\014\024\220F\230!\2301\330\010\016\210a\210\177\230a\230t\2405\250\007\250w\260g\270Q\320\004%\240]\260-\270}\310I\320Ub\320bh\320hi\360&\000\t \230u\240A\240Q\330\010\036\230e\2401\240A\330\010 \240\001\330\010!\240\021\330\010\027\220s\230!\330\010\020\220\t\230\021\230'\240\021\240!\330\010\013\2105""\220\003\2206\230\027\240\001\330\010\016\210a\210z\230\021\230$\230e\2406\250\021\250!\330\010\016\210a\320\017 \240\001\240\024\240U\250&\260\010\270\007\270q\300\003\3001\330\010\017\210q\320\004\034\230I\240X\250Q\360\"\000\t\035\230E\240\021\240!\330\010\034\230E\240\021\240!\330\010\016\210a\320\017\037\230q\240\004\240E\250\025\250a\320\004\"\320\"<\270I\300[\320P\\\320\\e\320ef\360,\000\t\032\230\026\230q\330\010 \240\010\250\001\250\021\330\010\033\230;\240a\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\210:\220Q\220f\230A\330\014\022\220!\320\023%\240Q\240d\250'\260\024\260U\270'\300\026\300v\310Q\340\014\023\2208\2301\230F\240!\2404\240q\250\001\330\014\022\220!\320\023#\2401\240D\250\006\250d\260#\260V\2706\300\021\320\004I\310\031\320RS\360&\000\t!\240\001\330\010\036\230a\330\010(\250\001\340\010\036\230h\240a\240t\2507\260!\330\010\013\210<\220s\230!\330\014\032\230'\240\021\330\010\013\210;\220e\2303\230a\330\014\022\220!\320\023%\240Q\240g\250Q\250k\270\021\330\010\016\210a\320\017'\240q\250\004\250E\260\033\270A\330()\320)9\270\033\300A\330\010\016\210a\320\017#\2401\240K\250v\260Q\260i\270q\300\001\330\010\030\230\007\230q\240\005\240Q\240i\250q\330\010\016\210a\210y\230\001\230\021\330\010\020\220\017\230q\320\004I\310\021\360&\000\t\017\210a\320\017#\2401\240D\250\005\250W\260F\270'\300\026\300y\320PQ\330\010\017\210q\320\004J\310!\360\024\000\t\026\220R\220q\330\010\016\210a\320\017,\250A\250T\260\025\260g\270V\300;\310e\320ST\320TV\320VW\330\010\017\210q\320\004$\240J\250a\360\030\000\t\037\230f\240A\240Q\330\010\016\210a\320\017\"\240!\2404\240w\250a\320\004\"\240*\250J\260a\360\"\000\t \230u\240A\240Q\330\010\036\230f\240A\240Q\330\010\016\210a\210\177\230a\230t\2406\250\030\260\021\320\004\034\230J\240h\250a\360\"\000\t \230u\240A\240_\260E\270\021\270!\330\010\016\210a\210}\230A\230T\240\032\2508\2601\320\004\034\230K\320'9\270\021\360&\000\t\034\2305\240\001\240\021\330\010\037\230z""\250\021\330\010\016\210a\210~\230Q\230d\240%\240q\250\010\260\001\260\021\330\010\017\210r\220\022\2207\230$\230b\240\001\240\021\330\010\037\230q\330\010\037\230q\330\010\017\210x\220q\230\006\230a\230w\240a\240q\330\010\016\210a\320\017#\2401\240D\250\005\250T\260\021\330\010\016\210a\320\017\037\230q\240\004\240E\250\024\250Q\320\004\034\230K\240}\260I\270Q\360&\000\t\037\230e\2401\240A\330\010\036\230f\240A\240Q\330\010\036\230a\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2105\220\003\2201\330\014\022\220!\220=\240\001\240\024\240U\250!\2501\330\010\016\210a\210y\230\001\230\024\230U\240&\250\006\250a\320\004$\320$?\270|\320Kd\320dq\360\000\000r\001J\002\360\000\000J\002S\002\360\000\000S\002T\002\360*\000\t\036\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\220:\230V\2401\330\010\014\210I\220Q\320\026&\240a\330\010\016\210a\210~\230Q\230d\240&\250\006\250n\270G\3001\320\004+\320+<\320<L\310A\360\"\000\t \230u\240A\240Q\330\010(\250\001\330\010\016\210a\320\017&\240a\240t\2505\260\010\270\001\320\004\"\240/\260\034\270_\310L\320Xg\320gu\360\000\000v\001C\002\360\000\000C\002L\002\360\000\000L\002M\002\360<\000\t\021\220\010\230\010\240\001\330\010\037\230q\330\010\013\2107\220'\230\026\230y\250\006\250a\250q\330\010\013\2107\220'\230\026\230y\250\006\250a\250q\330\010\013\2107\220'\230\026\230y\250\006\250a\250q\330\010\013\2107\220'\230\026\230y\250\005\250Q\250a\330\010\016\210a\320\017 \240\001\240\024\240W\250G\2607\270!\330!)\250\021\320\004\"\320\"<\270L\310\001\330\0312\260-\320?W\320W`\320`a\3600\000\t\036\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\035\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\2209\230F\240!\330\010\014\210I\220Q\220o\240Q\330\010\016\210a\210}\230A\230T\240\026\240v\250V\260=\300\007\300q\320\004$\240L""\260\014\270H\300A\360&\000\t \230u\240A\320%6\260e\2701\270A\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\320\017 \240\001\240\024\240U\250'\260\030\270\021\320\004$\240L\260\r\270X\300Q\360*\000\t \230u\240A\240Q\330\010\037\230u\240A\240Q\330\010 \240\005\240Q\240a\330\010\016\210a\320\017)\250\021\250$\250f\260H\270H\300A\320\004$\240L\260\010\270\001\360(\000\t \230u\240A\240Q\330\010\037\230u\240A\240Q\330\010\037\230q\330\010\016\210a\320\017)\250\021\250$\250f\260H\270H\300A\300Q\330\010\017\210u\220A\220Q\320\004M\310Q\330$1\3201H\310\001\360:\000\t\037\230a\330\010\036\230a\330\010\036\230e\2401\240A\330\010\016\210a\320\017*\250!\2504\250u\260E\270\032\3007\310*\320TY\320Y^\320^d\320di\320ij\320\004$\240M\260\021\3602\000\t\017\210a\210~\230Q\230d\240&\250\001\320\004\034\230M\250\031\260!\360\036\000\t\014\2105\220\007\220q\330\014\022\220!\320\023%\240Q\240d\250&\260\001\330\010\016\210a\210\177\230a\230t\2401\320\004$\240M\260\021\360\036\000\t%\240A\330\010\016\210a\210}\230A\230T\240\025\240a\320\004$\240M\260\030\270\021\360\"\000\t!\240\005\240Q\240a\330\010 \240\005\240Q\240a\330\010\016\210a\320\017#\2401\240D\250\005\250Y\260a\330\010\017\210q\320\004-\250_\270M\310\037\320Xa\320ab\360*\000\t\037\320\0364\260A\330\010\013\2106\220\027\230\006\230i\240v\250Q\250a\330\010\013\2106\220\027\230\006\230i\240v\250Q\250a\330\010\016\210a\320\017)\250\021\250$\250f\260H\270A\320\004*\320*@\300\001\360\036\000\t-\250M\270\021\270!\330\010\016\210a\320\017#\2401\240D\250\005\250Q\320\004$\240M\260\030\270\021\360\034\000\t\037\230a\330\010\034\230A\330\010\"\240!\330\010#\2401\330\010\021\220\021\220'\230\021\230!\330\010\021\220\021\220(\230!\2301\330\010\016\210a\320\017\"\240!\2404\240u\250H\260A\260U\270!\330\010\036\230h\240a\240w\250a\250u\260A\260U\270\"\270D\300\006\300a\300q\330\010\016\210a\320\017$\240A\240T\250\025\250h\260i\270q\330\010\017\210q\320\004,\250M\270\031\300!\360$\000\t\"\240\025\240d\250!\2501""\330\010!\240\021\330\010\017\210v\220S\230\001\330\010\016\210a\210z\230\021\230$\230e\2406\250\021\320\004\034\230M\250\030\260\021\360\"\000\t \230u\240A\240Q\330\010 \240\005\240Q\240a\330\010\016\210a\320\017!\240\021\240$\240f\250H\260A\320\004\034\230M\250\031\260!\360$\000\t\020\210v\220Q\220d\230&\240\n\250$\250i\260v\270Q\320\004\034\230N\250)\2601\360\"\000\t\035\230A\330\010\034\230A\330\010\013\2102\210W\220F\230&\240\001\240\021\330\010\013\2102\210W\220F\230&\240\001\240\021\330\010\016\210a\210y\230\001\230\024\230W\240E\250\021\320\004\034\230N\250)\2601\360\036\000\t \230q\330\010\016\210a\320\017!\240\021\240-\250t\2605\270\001\270\021\330\010\021\220\030\230\021\230&\240\001\330\010\035\230Q\330\010\016\210a\210y\230\001\230\024\230U\240(\250!\2501\330\010\025\220Z\230q\240\006\240a\330\010\n\210&\220\001\330\010\017\210q\320\004\034\230N\320*:\270(\300!\360(\000\t\034\2305\240\001\240\021\330\010!\240\025\240a\240q\330\010#\2405\250\001\250\021\330\010\016\210a\320\017\037\230q\240\004\240E\250\024\250Z\260q\320\004N\310a\360.\000\t\017\210a\320\017$\240A\240T\250\025\250f\260F\270)\3005\310\002\310%\310s\320RS\320\004N\310a\360&\000\t\017\210a\320\017(\250\001\250\024\250U\260'\270\026\270w\300f\310I\320UV\330\010\017\210q\320\004$\240O\2601\360\036\000\t&\240Q\330\010\016\210a\210~\230Q\230d\240%\240q\320\004,\250O\2701\360\036\000\t.\250Q\330\010\037\230y\250\001\320)?\270q\300\001\330\010\016\210a\320\017%\240Q\240d\250'\260\021\320\004$\240O\2601\360\024\000\t&\240Q\330\010\027\220y\240\001\240\036\250q\260\001\330\010\016\210a\320\017 \240\001\240\024\240V\2501\320\004\034\230O\2501\360(\000\t \230u\240A\240Q\330\010\016\210a\210x\220q\230\004\230E\240\030\250\021\250!\320\004,\320,<\270O\3109\320TU\360&\000\t!\240\005\240Q\240a\330\010$\240A\330\010\"\240!\330\010\016\210a\320\017*\250!\2504\250u\260I\270\\\310\021\320\004,\320,O\320Oh\320hu\360\000\000v\001N\002\360\000\000N\002W\002\360\000\000W\002X\002\360&\000\t\014\210:\220S\230""\001\330\014\022\220!\320\023(\250\001\250\024\250V\3203N\310a\330\014\020\220\t\230\021\320\032+\2501\340\014\017\210u\220C\220v\230W\240A\330\014\017\210v\220S\230\006\230h\240a\330\014\020\220\t\230\021\320\032,\250K\260v\270Q\330\014\022\220!\320\023(\250\001\250\024\250V\260?\300!\320\004%\240_\260O\300?\320R^\320^m\320my\360\000\000z\001I\002\360\000\000I\002U\002\360\000\000U\002d\002\360\000\000d\002s\002\360\000\000s\002@\003\360\000\000@\003I\003\360\000\000I\003J\003\3600\000\t#\240!\330\010\"\240!\330\010\037\230q\330\010\037\230q\330\010\037\230q\330\010 \240\001\330\010\013\2108\2207\230&\240\013\2506\260\021\260!\330\010\013\2108\2207\230&\240\013\2506\260\021\260!\330\010\013\2105\220\007\220v\230X\240V\2501\250A\330\010\013\2105\220\007\220v\230X\240V\2501\250A\330\010\013\2105\220\007\220v\230X\240V\2501\250A\330\010\013\2108\2207\230&\240\n\250%\250q\260\001\330\010\016\210a\320\017*\250!\2504\250y\270\n\300*\310G\320SZ\320Za\320ab\320\004,\320,O\310|\320[g\360\000\000h\001A\002\360\000\000A\002N\002\360\000\000N\002f\002\360\000\000f\002o\002\360\000\000o\002p\002\360.\000\t\036\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\035\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\220:\230V\2401\330\010\014\210I\220Q\320\026/\250q\330\010\016\210a\320\017,\250A\250T\260\026\260v\270V\320CY\320Y`\320`a\320\004O\310q\360.\000\t\017\210a\320\017%\240Q\240d\250%\250v\260V\2709\300E\310\022\3105\320PS\320ST\320\004&\320&=\320=O\310q\360&\000\t'\240j\260\001\260\021\330\010\035\230Q\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\001\330\010 \240\001\330\010\035\230X\240Q\240g\250Q\250j\270\004\270F\300(\310!\3101\330\010\014\210G\2209\230A\330\014\022\220!\2206\230\026\230u\240A\240\\\260\023\260A\330\010\016\210a\320\017%\240Q\240d\250%\250x\260t\2706\300\021\320\004\035\320\035O\310w\320VW\360*\000\t#\320\"5\260Q\260a\330\010\032\230-\240q""\250\001\330\010\016\210a\210\177\230a\230t\2405\250\007\250}\270L\310\001\310\021\330\037&\240l\260!\260;\270a\320\004)\320)P\320PQ\360\"\000\t\014\2108\2207\230!\330\014\022\220!\320\023/\250q\260\004\260D\270\001\270\024\320=_\320_e\320ef\330\014\020\220\t\230\021\320\032-\250Q\340\014\020\220\t\230\021\320\032-\250Q\320\004\036\320\036P\320PW\320WX\360*\000\t#\320\"5\260Q\260a\330\010\032\230-\240q\250\001\330\010\016\210a\320\017\037\230q\240\004\240E\250\027\260\r\270\\\310\021\310!\330 '\240|\2601\260K\270q\320\004\026\320\026(\320(P\320PY\320YZ\360>\000\t-\250A\330\010,\250A\330\010\033\2305\240\001\240\021\330\010\034\230A\330\010\013\210<\220s\230!\330\014\022\220!\320\023)\250\021\250$\250g\260T\270\021\270!\340\014\033\230<\240q\250\001\330\014\022\220!\320\0237\260q\270\004\270G\300>\320QU\320UV\320VW\340\010\013\2101\330\014\026\220a\220v\230R\230q\330\014\020\220\007\220y\240\001\330\020\027\220q\230\005\230]\250!\330\021!\240\027\250\001\250\023\250H\260H\270A\270Q\330\014\022\220!\2209\230A\230Q\330\010\017\210q\320\004,\320,P\320P\\\320\\u\360\000\000v\001C\002\360\000\000C\002[\002\360\000\000[\002d\002\360\000\000d\002e\002\360,\000\t\036\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\2209\230F\240!\330\010\014\210I\220Q\220o\240Q\330\010\016\210a\320\017)\250\021\250$\250f\260F\270-\300w\310a\320\004)\320)?\320?Q\320QR\360$\000\t \230|\2501\330\010 \320 0\260\001\330\010\037\230q\340\010\020\220\010\230\001\230\027\240\001\240\030\250\021\250!\330\010\020\220\010\230\001\230\027\240\001\240\030\250\021\250!\340\010\013\2107\220#\220Q\330\014\022\220*\230A\230Q\340\010\017\210}\230A\330\010\016\210a\320\017%\240Q\240d\250&\260\006\260h\270a\330\010\017\210q\320\004\037\320\037Q\320QX\320XY\3600\000\t#\320\"5\260Q\260a\330\010\032\230-\240q\250\001\330\010\016\210a\320\017 \240\001\240\024\240U\250'\260\035\270l\310!\3101\330!(\250\014\260A\260[""\300\001\320\004Q\320QZ\320Z[\3602\000\t \320\037/\250q\330\010\013\2104\210w\220a\330\014\026\220c\230\021\330\010\016\210a\320\017'\240q\250\003\2506\260\024\260V\2703\270f\300C\300v\310Y\320VW\320WX\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004%\240Q\360V\002\000\t\037\230a\330\010\036\230a\330\010\013\2102\210W\220F\230(\240!\2401\330\010\013\2102\210W\220F\230(\240!\2401\330\010\016\210a\210x\220q\230\004\230F\240'\250\021\320\004)\320)=\270Q\360\024\000\t0\250q\330\010\016\210a\320\017$\240A\240T\250\026\250q\320\004-\250Q\360\024\000\t\033\230!\330\010\033\2301\330\010\035\230Q\330\010\t\330\014\022\220!\320\023-\250Q\250d\260%\260q\270\003\2701\270A\330\014\025\220Q\220g\230Q\230a\230q\240\004\240D\250\007\250x\260q\340\014\022\220!\2209\230A\230Q\330\010\017\210q\320\004%\240Q\360\024\000\t\033\230!\330\010\033\2301\330\010\035\230Q\330\010\t\330\014\022\220!\320\023(\250\001\250\024\250U\260!\2603\260a\260q\330\014\025\220Q\220g\230Q\230a\230q\240\004\240D\250\007\250x\260q\340\014\022\220!\2209\230A\230Q\330\010\017\210q\320\004-\250Q\360\026\000\t\034\2301\330\010\016\210a\320\0170\260\001\260\024\260U\270!\2701\330\010\017\210v\220Q\220a\320\004)\320)=\270Q\360$\000\t,\2501\330\010\016\210a\320\017#\2401\240D\250\005\250Q\320\004\035\230Q\360\024\000\t$\2401\340\010\016\210a\320\017%\240Q\240d\250)\2601\260A\330\010\017\210u\220A\220Q\320\004%\240Q\360 \000\t\032\230\022\2301\330\010\016\210a\320\017(\250\001\250\024\250U\260!\2606\270\021\330\010\017\210q\320\004%\240Q\360\036\000\t\034\2301\330\010\016\210a\320\017(\250\001\250\024\250V\2602\260U\270!\2701\330\010\017\210u\220A\220Q\320\004%\240Q\360\024\000\t\033\230)\2401\330\010\037\230q\330\010\016\210a\320\017/\250q\260\004\260F\270!\2705\300\001\300\021\330\010\033\2301\330\010\014\210G\2209\230A\330\014\022\220'\230\021\230)\2401\240B\240a\240q\330\010\017\210q\320\004\031\230\021\360 \000\t\"\240\034\250Q\330\010\"\320\"4\260A\330\010\033\2301\330\010\016""\210a\320\017,\250A\330\020\024\220F\230!\2307\240!\2407\250!\250:\260Q\260a\330\010\t\330\014\020\220\007\220y\240\001\330\020\026\220a\220u\230A\230U\240!\2407\250'\260\021\260(\270!\2704\270w\300a\300q\340\014-\250Q\330\020\024\220F\230!\2307\240!\2407\250!\250:\260Q\260a\330\010\017\210q\320\004\035\230Q\360\024\000\t\014\2104\210t\2201\220C\220s\230&\240\007\240q\330\010\037\230q\330\010\016\210a\320\017&\240a\240t\2504\250q\260\004\260A\260Q\330\010\017\210u\220A\220Q\320\004\035\230\\\320)=\270Q\360$\000\t\034\2305\240\001\240\021\330\010'\240q\330\010\016\210a\320\017 \240\001\240\024\240U\250$\250a\320\004'\240|\260=\300\t\310\021\360\"\000\t\036\230Q\330\010\013\2106\220\027\230\006\230g\240U\250!\2501\330\010\013\2104\210t\2209\230A\230Q\330\014\020\220\014\230A\230Q\330\010 \240\001\330\010\020\220\t\230\021\230'\240\021\240!\330\010!\240\021\330\010\016\210a\210z\230\021\230$\230e\2406\250\021\250!\330\010\016\210a\320\017&\240a\240t\2505\260\006\260a\320\004%\240Q\360\024\000\t\034\2307\240!\330\010*\250!\330\010\016\210a\210\177\230a\230t\2406\250\021\250!\330\010\016\210a\210\177\230a\230t\2406\250\021\250#\250Q\330\010\016\210a\320\017%\240Q\240d\250&\260\001\260\021\330\010\036\230g\240Q\240a\240q\250\004\250A\330\010\016\210j\230\005\230Q\230a\230r\240\025\240e\2501\250E\260\025\260a\260q\330\010\017\210v\220Z\230q\240\003\2403\240a\320\004\035\230Q\360$\000\t%\320$8\270\001\330\010\016\210a\320\017 \240\001\240\024\240U\250!\250=\270\001\270\021\330\010\017\210u\220A\220^\2405\250\001\250\021\320\004*\250!\360\024\000\t\036\230Q\330\010\034\230A\330\010\034\230A\330\010 \240\001\340\010\016\210a\320\017)\250\021\250$\250e\2601\260F\270!\270;\300a\300u\310A\310Q\340\010\032\230!\2306\240\021\240#\240Q\240d\250$\250g\260Y\270a\330\010\032\230!\330\010\032\230!\330\010\025\220Q\340\010\014\210G\2209\230A\330\014\017\210t\2203\220a\330\020\025\220Z\230q\240\003\2401\240C\240q\330\020\022\220&\230\003\2301\230A\330\020\026\220a\220{\240!\2402\240Q""\330\020\023\2207\230!\2301\330\020\026\220a\220y\240\001\240\021\240#\240Q\240a\340\020\023\2207\230!\2301\340\014\017\210z\230\023\230A\330\020\027\220y\240\001\240\031\250!\2501\330\020\025\220W\230A\230Q\330\020\026\220a\220y\240\001\240\031\250!\2501\340\020\025\220W\230A\230Q\340\014\022\220!\2209\230A\230Q\230c\240\021\240!\340\010\016\210a\210y\230\001\230\021\330\010\016\210a\210y\230\001\230\021\330\010\016\210a\210y\230\001\230\021\340\010\020\220\007\220w\230a\320\004\035\230Q\360\024\000\t%\240A\330\010\016\210a\210}\230A\230T\240\025\240a\240q\330\010\017\210y\230\001\230\021\320\004\031\230\021\360\"\000\t\036\230Q\330\010\034\230A\330\010!\240\021\330\010(\250\001\330\010)\250\021\330\010\016\210a\320\017%\240Q\240d\250'\260\021\260&\270\001\270\025\270a\270z\310\021\310)\320ST\320TU\330\010\017\210w\220a\220x\230q\240\006\240j\260\007\260q\270\010\300\001\300\025\300a\320\004%\240Q\360\032\000\t\035\230A\330\010\016\210a\320\017)\250\021\250$\250e\2601\260A\330\010\017\210u\220A\220Q\320\004%\240Q\360\024\000\t\035\230A\330\010\016\210a\210z\230\021\230$\230e\2401\240A\330\010\016\210a\320\017&\240a\240t\2501\330'(\250\006\250a\250q\330'(\250\006\250a\250q\330'(\250\006\250a\250q\330\010\017\210u\220A\220Q\220e\2301\230F\240!\2404\240t\2505\260\004\260A\320\004\035\230Q\360\002\000\031E\002\360\000\000E\002F\002\360\"\000\t\037\230a\330\010\036\230a\330\010\035\230W\240A\240T\250\031\260&\270\001\270\024\270Q\270a\330\010\013\2103\210c\220\021\330\014\025\220Y\230a\230q\340\014\025\220X\230S\240\t\250\021\250%\250y\270\001\270\021\270\"\270A\270Q\340\010\013\210:\220Q\220g\230Q\330\014\024\220E\230\027\240\001\330\010\013\210:\220Q\220h\230g\240Q\330\014\024\220C\220q\230\006\230h\240a\240u\250C\250q\330\033\034\230E\240\023\240H\250A\250U\260#\260Q\330\033\034\230E\240\023\240H\250A\250U\260!\330\r\027\220q\230\007\230q\330\014\024\220C\220q\230\006\230f\240A\330\r\023\2207\230!\330\014\024\220C\220q\230\001\330\010\037\230q\330\010\037\230q\330""\010\021\220\031\230!\2308\2401\240A\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017#\2401\240D\250\006\250e\2601\320\004!\240\021\360&\000\t\036\230Q\330\010\035\230Q\330\010\034\230A\330\010\016\210a\320\017#\2401\240D\250\006\250f\260A\260V\2701\270G\3001\300G\3106\320QR\330\010\020\220\006\220a\220w\230f\240A\240X\250V\2601\260A\320\004\035\230Q\360 \000\t\036\230Q\330\010\034\230A\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\001\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\001\330\010\034\230A\230V\2401\240C\240q\250\004\250D\260\007\260y\300\001\330\010\014\210G\2209\230A\330\014\022\220!\2209\230A\230Q\230c\240\021\240!\330\010\016\210a\210y\230\001\230\021\330\010\017\210q\320\004%\240Q\360\024\000\t\036\230Q\330\010\037\230~\250V\2601\330\010\013\2104\210u\220C\220q\330\014\022\220!\320\023%\240Q\240e\2501\250A\330\014\022\220!\2209\230A\230V\2401\240D\250\001\330\010\016\210a\210w\220a\220t\2306\240\026\240q\330\010\017\210q\320\004%\240Q\360\024\000\t\036\230Q\330\010\037\230~\250V\2601\330\010\013\2104\210u\220C\220q\330\014\022\220!\320\023%\240Q\240e\2501\250A\330\014\022\220!\320\023/\250q\260\006\260c\270\023\270F\320BU\320UV\320VZ\320Z[\330\010\016\210a\320\017)\250\021\250$\250f\260F\270!\330\010\017\210q\320\004%\240Q\360\036\000\t\036\230Q\330\010\037\230~\250V\2601\330\010\013\2104\210v\220S\230\001\330\014\022\220!\320\023%\240Q\240e\2501\250A\330\014\022\220!\2208\2301\230F\240!\2404\240q\330\010\016\210a\210v\220Q\220d\230'\240\026\240q\330\010\017\210q\320\004-\250Q\360 \000\t&\240Q\330\010\016\210a\320\017*\250!\2506\260\026\260q\270\001\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004\035\230Q\360\024\000\t\036\230Q\330\010\016\210a\210}\230A\230T\240\025\240a\240q\330\010\017\210u\220A\220Q\320\004)\320)=\270Q\360\024\000\t.\250Q\330\010\016\210a\320\017%\240Q\240d\250'\260\021\320\004\035\230Q\360\024\000\t\036\230Q\330\010\016\210a\320\017%\240Q\240d\250&\260\001\260\021\330""\010\017\210u\220A\220Q\320\004\035\230Q\360\026\000\t\036\230Q\330\010\016\210a\320\017 \240\001\240\024\240U\250!\2501\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\320\004-\250Q\360,\000\t\026\220R\220q\330\010\016\210a\320\017!\240\021\240$\240e\2506\260\026\260q\270\002\270!\330\010\017\210q\320\004%\240Q\360\024\000\t\026\220S\230\001\330\010\030\230\003\2301\330\010\016\210a\320\017,\250A\250T\260\026\260q\270\001\270\026\270q\300\004\300F\310&\320PQ\330\010\016\210a\210{\230!\2301\230A\330\010\016\210a\210{\230!\2304\230q\330\010(\250\004\250I\260Q\260a\330\010\020\220\003\2206\230\021\320\004\035\230Q\360&\000\t\026\220S\230\001\330\010\025\220S\230\001\330\010\016\210a\210\177\230a\230t\2407\250!\2501\250F\260!\2601\260F\270&\300\001\330\010\016\210a\210{\230!\2301\230A\330\010\016\210a\210{\230!\2301\230A\330\010\037\230t\2409\250A\250Q\330\010\020\220\003\2203\220a\320\004\035\230Q\360\034\000\t\026\220S\230\001\330\010\016\210a\210}\230A\230T\240\025\240a\240q\250\001\330\010\016\210a\210{\230!\2301\230A\330\010\017\210q\320\004%\240Q\360\024\000\t\026\220S\230\001\330\010\016\210a\320\017$\240A\240T\250\025\250a\250q\260\001\330\010\016\210a\210{\230!\2301\230A\330\010\017\210q\320\004\035\230Q\360\026\000\t\026\220S\230\001\330\010\031\230\021\330\010\016\210a\330\010\016\210a\210\177\230a\230t\2407\250!\2501\250F\260!\2605\270\001\270\021\330\010\016\210a\210{\230!\2301\230A\330\010\037\230t\2409\250A\250Q\360\006\000\t\014\2109\220G\2301\330\014\024\220C\220q\340\010\013\2104\210s\220%\220t\2307\240.\260\003\2607\270!\330\014\026\220h\230a\330\014\017\210x\220w\230a\330\020\027\220t\2301\230I\240S\250\001\330\020\030\230\003\2301\340\010\020\220\003\2201\320\004\"\240(\250(\260!\360\"\000\t\033\230#\230Q\330\010\035\230U\240!\2401\330\010\035\230U\240!\2401\330\010\016\210a\320\017\037\230q\240\004\240F\250&\260\006\260a\260v\270Q\330\010\016\210a\210{\230!\2306\240\021\330\010\017\210q\320\004)\250\021\360\026\000\t\032\230\024\230Q""\330\010\r\210U\220!\2201\330\010\016\210a\320\017#\2401\240D\250\007\250t\2601\260D\270\001\330\010\016\210a\210{\230!\2304\230q\330\010\017\210q\320\004\"\240!\360\024\000\t\036\230Q\330\010\016\210a\320\017#\2401\240D\250\007\250q\260\001\330\010\013\2108\2203\220f\230G\2401\330\016\025\220Y\230a\320\004!\240\021\360\024\000\t\036\230Q\330\010\016\210a\320\017+\2501\250D\260\007\260q\270\001\330\010\017\210u\220A\220Q\320\004*\250!\360\024\000\t\036\230Q\330\010\016\210a\320\017+\2501\250D\260\007\260q\270\001\330\010\017\210u\220A\220Q\320\004+\250:\260Q\360\022\000\t\017\210a\320\0171\260\021\260$\260l\300!\320\004=\270Q\360\036\000\t\017\210a\320\0173\2601\260D\270\005\270S\300\001\320\004\"\240!\360\024\000\t\036\230Q\330\010\016\210a\320\017*\250!\2504\250v\260Q\260a\330\010\013\2108\2203\220f\230G\2401\330\016\025\220Y\230a\320\004\"\240!\360\024\000\t\036\230Q\330\010\016\210a\320\017\"\240!\2404\240v\250Q\250a\330\010\013\2108\2203\220f\230G\2401\330\016\025\220Y\230a\320\004\"\240!\360\024\000\t\033\230#\230Q\330\010\016\210a\320\017\"\240!\2404\240v\250Q\250f\260A\330\010\016\210a\210{\230!\2306\240\021\330\010\017\210q\320\004\035\230Q\360\036\000\t\017\210a\320\017,\250A\250T\260\021\320\004\035\230Q\360*\000\t\017\210a\210}\230A\230T\240\021\320\004\035\230Q\360\024\000\t\017\210a\210}\230A\230T\240\021\320\004%\240Q\360\034\000\t\017\210a\320\017$\240A\240T\250\021\320\004\030\230\001\360\024\000\t\036\230Q\330\010\016\210a\320\017$\240A\240T\250\033\260A\260Q\330\010\017\210u\220A\220Q\320\004 \240\001\360\032\000\t\033\230#\230Q\330\010\016\210a\320\017,\250A\250T\260\033\270A\270V\3001\330\010\016\210a\210{\230!\2306\240\021\330\010\017\210q\320\004!\240\021\360\024\000\t\036\230Q\330\010\016\210a\320\017$\240A\240T\250\025\250a\250q\330\010\017\210u\220A\220Q\320\004\035\230Q\360\024\000\t\017\210a\210}\230A\230T\240\021\330\010\017\210q\320\004\"\240!\360 \000\t&\240Q\330\010\016\210a\320\017$\240A\240T\250\026\250q\260\001\330\010\017\210q""\320\004%\240Q\360 \000\t\"\240\021\330\010\016\210a\320\017,\250A\250T\260\030\270\021\270!\330\010\017\210v\220Q\220a\320\004\035\230Q\360\024\000\t\017\210a\320\017%\240Q\240d\250!\320\004\035\230Q\360\024\000\t\"\240\021\330\010!\240\021\330\010\016\210a\320\017%\240Q\240d\250&\260\001\260\027\270\001\270\021\330\010\020\220\010\230\001\230\030\240\030\250\021\250!\320\004\035\230Q\360\024\000\t\017\210a\210~\230Q\230d\240!\320\004\035\230Q\360\024\000\t#\240!\330\010\016\210a\320\017%\240Q\240d\250&\260\001\260\021\330\010\017\210q\320\004%\240Q\360\024\000\t\017\210a\320\017%\240Q\240d\250!\330\010\017\210q\320\004\035\230Q\360\024\000\t*\250\021\330\010\016\210a\210~\230Q\230d\240&\250\001\250\021\330\010\017\210q\320\004\035\230Q\360\024\000\t)\250\001\330\010\016\210a\210~\230Q\230d\240&\250\001\250\021\330\010\017\210q\320\004\035\230Q\360\024\000\t+\250!\330\010\016\210a\210~\230Q\230d\240&\250\001\250\021\330\010\017\210q\320\004\031\230\021\360\024\000\t.\250Q\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\001\330\010\017\210y\230\001\230\021\320\004%\240Q\360\024\000\t\017\210a\210~\230Q\230d\240%\240r\250\021\320\004\035\230Q\360\024\000\t\033\230!\330\010\016\210a\210~\230Q\230d\240&\250\001\250\021\330\010\017\210u\220A\220Q\320\004\035\230Q\360\024\000\t!\240\001\330\010\016\210a\320\017%\240Q\240d\250&\260\001\260\021\330\010\017\210y\230\001\230\021\320\004\031\230\021\360\024\000\t.\250Q\330\010\016\210a\320\017%\240Q\240d\250'\260\021\260!\330\010\017\210y\230\001\230\021\320\004%\240Q\360 \000\t\"\240\021\330\010\016\210a\320\017(\250\001\250\024\250U\260!\2601\330\010\017\210y\230\001\230\021\320\004(\250\001\360\036\000\t\033\230#\230Q\330\010\016\210a\320\017 \240\001\240\024\240U\250\"\250E\260\021\260&\270\001\330\010\017\210q\320\004 \240\001\360,\000\t&\240Q\330\010\016\210a\320\017 \240\001\240\024\240V\2501\250A\330\010\017\210q\320\004\031\230\021\360\024\000\t&\240Q\330\010\016\210a\320\017 \240\001\240\024\240V\2501\250A\330""\010\017\210y\230\001\230\021\320\004\035\230Q\360\024\000\t\017\210a\320\017!\240\021\240$\240a\320\004\035\230Q\360\024\000\t\037\230a\330\010\016\210a\210|\2301\230D\240\006\240a\240q\330\010\017\210v\220Q\220a\320\004\035\230Q\360\024\000\t\037\230a\330\010\016\210a\320\017\"\240!\2404\240v\250Q\250f\260F\270!\330\010\017\210v\220Q\220a\320\004\035\230Q\360\024\000\t\037\230a\330\010\016\210a\210}\230A\230T\240\025\240a\240q\330\010\017\210v\220Q\220a\320\004-\250Q\360(\000\t\037\230a\330\010\016\210a\320\017$\240A\240T\250\026\250s\260&\270\001\270\021\330\010\017\210v\220Q\220a\320\004%\240Q\360\024\000\t\037\230a\330\010\016\210a\210~\230Q\230d\240&\250\001\250\021\330\010\017\210q\320\004\025\220Q\360$\000\t\037\230a\330\010\036\230a\330\010\016\210a\210v\220Q\220d\230&\240\001\240\026\240q\250\001\330\010\020\220\005\220Q\220g\230V\2401\240A\320\004%\240Q\360\024\000\t\037\230a\330\010\016\210a\320\017)\250\021\250$\250e\2601\260A\330\010\017\210u\220A\220Q\320\004\025\220Q\360\024\000\t\017\210a\330\010\016\210a\320\017\037\230q\320\004)\250\031\260!\360\036\000\t\036\230Q\330\010\016\210a\210\177\230a\230t\2405\250\001\320\004\"\240!\360\024\000\t\036\230Q\330\010\016\210a\320\017&\240a\240t\2505\260\001\260\021\330\010\017\210u\220A\220Q\320\004-\250Q\360\024\000\t\017\210a\210\177\230a\230t\2406\250\023\250A\320\004\031\230\021\360\024\000\t\032\230\024\230Q\330\010\016\210a\320\017!\240\021\240$\240d\250!\2504\250q\260\004\260A\330\010\017\210q\320\004\"\240!\360\024\000\t\036\230Q\330\010\016\210a\320\017!\240\021\240$\240e\2501\250A\330\010\013\2108\2203\220f\230G\2401\330\016\025\220Y\230a\320\004%\240Q\360\024\000\t\033\230!\330\010\016\210a\320\017!\240\021\240$\240e\2501\250A\340\010\016\210a\320\017$\240A\240T\250\025\250f\260A\330\010\017\210u\220A\220R\220v\230Q\230d\240!\2405\250\006\250a\250t\2601\260A\330\026\032\230'\240\031\250!\320\004-\250Q\360 \000\t\017\210a\320\017!\240\021\240$\240e\2506\260\021\320\004\030\230\001\360\024\000\t""\036\230Q\330\010\016\210a\320\017!\240\021\240$\240f\250A\250Q\330\010\022\220)\2301\230A\330\010\016\210a\210y\230\001\230\021\330\010\017\210x\220q\230\t\240\024\240Q\320\004\035\230Q\360\026\000\t#\240!\330\010\016\210a\320\017)\250\021\250$\250f\260A\260Q\330\010\017\210u\220A\220Q\320\004 \240\001\360\024\000\t\036\230Q\330\010\016\210a\320\017)\250\021\250$\250f\260A\260Q\330\010\017\210u\220A\220Q\320\004(\250\001\360\024\000\t\036\230Q\330\010\016\210a\320\017)\250\021\250$\250g\260Q\260a\330\010\017\210u\220A\220Q\320\004 \240\001\360\024\000\t\036\230Q\330\010\016\210a\320\017)\250\021\250$\250g\260Q\260a\330\010\017\210u\220A\220Q\320\004(\250\001\360\024\000\t\036\230Q\330\010\016\210a\320\017)\250\021\250$\250g\260Q\260a\330\010\017\210v\220Q\220a\320\004+\250:\260Q\360\036\000\t\017\210a\320\017)\250\021\250$\250g\260V\2701\270A\320\004 \240\001\360\024\000\t \230{\250+\260Q\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\250'\260\021\260'\270\021\270!\330\010\020\220\006\220a\220x\230v\240Q\240h\250f\260A\260Q\320\004-\250Q\360\"\000\t\017\210a\320\017\037\230q\240\004\240F\250!\2506\260\021\260!\320\004 \240\001\360\024\000\t\032\230\024\230Q\330\010\016\210a\320\017'\240q\250\004\250H\260A\260T\270\021\330\010\016\210a\210{\230!\2304\230q\330\010\017\210q\320\004\025\220Q\360\024\000\t\017\210a\210v\220Q\220d\230!\320\004%\240Q\360\036\000\t\017\210a\210v\220Q\220d\230%\230v\240Q\320\004%\240Q\360.\000\t\017\210a\210v\220Q\220d\230%\230v\240Q\330\010\017\210q\320\004\025\220Q\360\024\000\t!\240\001\330\010\016\210a\210v\220Q\220d\230&\240\001\240\021\330\010\017\210x\220q\230\001\320\004%\240Q\360\"\000\t\017\210a\210w\220a\220t\2305\240\001\240\026\240q\250\001\320\004%\240Q\360*\000\t\017\210a\210x\220q\230\004\230F\240!\2406\250\021\250!\320\004\031\230\021\360\024\000\t\032\230\024\230Q\330\010\016\210a\210y\230\001\230\024\230U\240!\2404\240q\330\010\016\210a\210{\230!\2304\230q\330\010\017\210q\320\004\030\230\001\360\024\000\t\032""\230\024\230Q\330\010\016\210a\210z\230\021\230$\230g\240Q\240d\250!\330\010\016\210a\210{\230!\2304\230q\330\010\017\210q\320\004\035\230Q\360\024\000\t\027\220d\230!\2305\240\001\330\010\016\210a\210}\230A\230T\240\025\240a\240s\250!\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004%\240Q\360\024\000\t\027\220d\230!\2305\240\001\330\010\016\210a\320\017$\240A\240T\250\025\250a\250s\260!\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004%\240Q\360\"\000\t\037\230e\2401\240A\330\010\036\230f\240A\240Q\330\010\016\210a\210{\230!\2304\230w\240f\250A\320\004'\240|\260:\270Q\360\"\000\t\037\230e\2401\240A\330\010\036\230f\240A\240Q\330\010.\250a\330\010\016\210a\320\017%\240Q\240d\250&\260\006\260f\270A\270Q\330\010\017\210q\320\004#\240:\250Q\360&\000\t\037\230f\240A\240Q\330\010\016\210a\210|\2301\230D\240\005\240Q\320\004%\320%=\270Q\360&\000\t\037\230f\240A\240Q\330\010\016\210a\320\017$\240A\240T\250\025\250f\260A\260V\2701\270A\320\004+\250:\260Q\360\026\000\t\037\230f\240A\240Q\330\010\016\210a\320\017$\240A\240T\250\026\250q\320\004\035\230Q\360\024\000\t\037\230k\250\021\330\010\016\210a\210~\230Q\230d\240&\250\001\250\027\260\001\260\021\330\010\017\210u\220A\220X\230U\240!\2401\320\004\035\230Q\360\024\000\t \230q\330\010\016\210a\210}\230A\230T\240\025\240a\240q\330\010\017\210u\220A\220Q\320\004\035\230Q\360\024\000\t \230q\330\010\016\210a\210}\230A\230T\240\025\240a\240q\330\010\017\210v\220Q\220a\320\004\035\230Q\360\024\000\t \230q\330\010\016\210a\320\017%\240Q\240d\250$\250a\250t\2601\260A\330\010\017\210u\220A\220Q\320\004&\320&=\270Q\360\036\000\t(\240q\330\010\016\210a\320\017 \240\001\240\024\240U\250!\320\004'\240~\260Q\360\036\000\t(\240q\330\010\016\210a\210\177\230a\230t\2406\250\021\320\004%\240Q\360\024\000\t(\240q\330\010\016\210a\320\017'\240q\250\004\250E\260\021\260!\330\010\017\210y\230\001\230\021\320\004\035\230Q\360\024\000\t \230q\330\010\036\230l\250!\330\010\035\230Y\240j\260\001\330\010!\240\021\330\010""\016\210a\320\017%\240Q\330\014\020\220\007\220q\230\t\240\021\240(\250!\2501\330\014\r\210W\220A\220W\230A\230X\240Q\240a\330\010\020\220\016\230e\2401\240A\330\020\036\230f\240A\240Q\330\020\036\230f\240A\240Q\330\020\036\230f\240A\240Q\330\020\036\230f\240A\240Q\330\020\036\230f\240A\240Q\330\020\036\230f\240A\240Q\320\004\035\230Q\360\032\000\t\030\220s\230!\330\010\016\210a\210~\230Q\230d\240&\250\001\250\023\250A\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\035\230Q\360\024\000\t\030\220s\230!\330\010\016\210a\210~\230Q\230d\240&\250\001\250\023\250A\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\035\230Q\360\024\000\t\030\220s\230!\330\010\016\210a\210~\230Q\230d\240&\250\001\250\023\250F\260&\270\001\330\010\016\210a\210{\230!\2303\230a\330\010\037\230t\2409\250A\250Q\330\010\020\220\005\220Q\320\004\035\230Q\360\024\000\t\030\220s\230!\330\010\016\210a\210\177\230a\230t\2407\250!\2503\250a\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004%\240Q\360\024\000\t\030\220t\2301\230E\240\021\330\010\016\210a\320\017%\240Q\240d\250&\260\001\260\023\260A\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\035\230Q\360\024\000\t\020\210t\2209\230A\230Q\320\004\035\230Q\340\010\017\210t\2209\230A\230Q\320\004!\240\030\250\021\360\036\000\t\036\230Q\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\210~\230Q\230d\240%\240w\250a\250q\330\010\017\210u\220A\220Q\320\004*\250!\360 \000\t\036\230Q\230a\330\010\035\230Q\230a\330\010\016\210a\210}\230A\230T\240\026\240v\250Q\320\004)\250\030\260\021\360\036\000\t!\240\005\240Q\240a\330\010\016\210a\320\017#\2401\240D\250\005\250Q\320\004\"\240(\250!\360\036\000\t!\240\005\240Q\240a\330\010\016\210a\210}\230A\230T\240\025\240i\250q\320\004!\240\034\250[\270\001\360\"\000\t!\240\005\240Q\240a\330\010 \240\010\250\001\250\021\330\010\016\210a\210~\230Q\230d\240&\250\006\250a\320\004\"\240!\360(\000\t\032\230\030\240\024\240Q\240e\2501\330\010""\016\210a\210}\230A\230T\240\025\240d\250'\260\021\260\"\260A\330\010\017\210q\320\004-\250\\\270\031\300!\360,\000\t\036\230Q\230h\240b\250\007\250z\270\032\3001\330\010\035\230Q\230h\240b\250\007\250z\270\032\3001\330\010\035\230Q\230h\240b\250\007\250z\270\032\3001\330\010\016\210a\210}\230A\230T\240\026\240v\250Q\250f\260F\270!\320\004#\320#R\320RS\360.\000\t\037\230f\240A\240Q\330\010\016\210a\320\017\"\240!\2404\240u\250F\260!\2606\270\024\270V\3007\310!\330#$\240A\320\004 \320 R\320RY\320YZ\360.\000\t#\320\"5\260Q\260a\330\010\032\230-\240q\250\001\330\010\016\210a\320\017!\240\021\240$\240e\2507\260-\270|\3101\310A\330\")\250\034\260Q\260k\300\021\320\004,\320,R\320Rk\320kx\360\000\000y\001Q\002\360\000\000Q\002Z\002\360\000\000Z\002[\002\360,\000\t\017\210a\320\017:\270!\2704\270x\300\177\320VW\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\014\210I\220Q\320\026&\240i\250v\260Q\320\004 \240\001\360\024\000\t\026\220R\220q\330\010\016\210a\320\017#\2401\240D\250\005\250Q\250b\260\001\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004\032\230!\360\024\000\t\026\220R\220q\330\010\016\210a\320\017 \240\001\240\024\240U\250!\2502\250Q\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004 \240\010\250\001\360\036\000\t\026\220R\220q\330\010\022\220%\220q\230\001\330\010\016\210a\320\017\037\230q\240\004\240E\250\024\250Q\250b\260\001\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004\036\320\036;\320;S\320ST\360\"\000\t.\250Q\330\0105\260Z\270q\300\001\330\010 \240\003\2401\240A\340\010\016\210a\210{\230!\2309\240G\2502\320-K\3101\310A\330\010\014\210G\2209\230A\330\014\023\220;\230a\230q\330\014\025\220Q\220e\2301\320\034,\250E\260\031\270%\270w\300j\320PQ\330\010\016\210a\320\017%\240Q\240d\250'\260\032\2707\300,\310a\310q\340\010\013\210;\220c\230\021\340\014\020\220\005\220U\230!\2301\330\021!\240\033\250A\250S\260\010\270\001\360\006\000\r\023\220!\2209\230A\230Q\320\004&\320&?\320?""S\320Sg\320gh\360&\000\t#\240!\330\010\037\230x\240q\250\t\260\026\260q\270\001\330\010!\240\021\330\010\037\230x\240q\250\010\260\006\260a\260q\330\010\036\230a\330\010\037\230x\240q\250\003\2506\260\021\260!\330\010\016\210a\320\017\037\230q\240\004\240E\250\031\260(\270!\320\004 \240\001\360\024\000\t\026\220S\230\010\240\003\2401\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\250!\2506\260\021\260!\2606\270\026\270q\330\010\016\210a\210{\230!\2301\230H\240F\250!\250;\260a\260q\270\001\330\010\037\230t\2409\250A\250Q\330\010\020\220\003\2203\220a\320\004*\250!\360\022\000\t\026\220S\230\001\330\010\016\210a\320\0171\260\021\260$\260f\270A\270Q\270f\300F\310!\330\010\016\210a\210{\230!\2301\230A\330\010-\250T\260\031\270!\2701\330\010\020\220\003\2201\320\004\"\240!\360\024\000\t\036\230S\240\001\330\010\016\210a\320\017\"\240!\2404\240v\250Q\250i\260q\330\010\016\210a\210{\230!\2309\240A\330\010\017\210q\320\004)\250\021\360\024\000\t\026\220S\230\001\330\010\016\210a\320\017(\250\001\250\024\250U\260!\2601\260A\330\010\016\210a\210{\230!\2301\230A\330\010\017\210q\320\004 \240\001\360\024\000\t\026\220S\230\001\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\250!\2501\330\010\016\210a\210{\230!\2301\230A\330\010\017\210q\320\004 \240\001\360\024\000\t\026\220S\230\001\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\250!\2506\260\026\260q\330\010\016\210a\210{\230!\2301\230A\330\010\037\230t\2409\250A\250Q\330\010\020\220\003\2201\320\004(\250\001\360\022\000\t\026\220S\230\001\330\010\016\210a\320\017/\250q\260\004\260F\270!\2701\270F\300&\310\001\330\010\016\210a\210{\230!\2301\230A\330\010+\2504\250y\270\001\270\021\330\010\020\220\003\2201\320\004\036\320\036T\320TU\360(\000\t#\320\"5\260Q\260a\330\010\016\210a\320\017\037\230q\240\004\240E\250\027\260\r\270\\\310\021\310!\330 '\240|\2601\260A\320\004\032\230!\360\024\000\t\036\230T\240\021\330\010\017\210\177\230a\230q\320\004\037\320\037U\320UV\360&\000\t#\320\"5\260Q\260a\330\010\016""\210a\320\017 \240\001\240\024\240U\250'\260\035\270l\310!\3101\330!(\250\014\260A\260Q\320\004)\320)U\320UV\360$\000\t\034\2305\240\001\240\021\330\010\016\210a\320\017'\240q\250\004\250E\260\021\330\010\033\2301\330\010\034\230A\330\010!\240\021\330\010 \240\016\250a\330\010\014\210F\220)\2301\330\014\023\2209\230A\230V\2401\240A\330\014\024\220H\230A\230W\240A\240Y\250a\250q\330\014\022\220!\320\023(\250\001\250\024\250U\260!\330)2\260)\2701\320\004U\320UV\360\024\000\t\026\220R\220q\330\010\016\210a\320\017-\250Q\250e\2605\270\004\270E\300\034\310U\320R]\320]b\320bc\320ce\320ef\330\010\017\210q\320\004\"\320\"<\320<U\320Ub\320bz\360\000\000{\001D\002\360\000\000D\002E\002\360&\000\t\014\2108\2203\220f\230A\330\010\"\240$\240i\250q\260\001\330\010\013\2106\220\023\220F\230(\240!\330\010\013\2106\220\023\220F\230(\240!\330\010\013\210<\220s\230!\330\014\022\220!\220=\240\001\240\024\240V\250=\270\006\270a\330\014\020\220\t\230\021\320\032*\250\"\250I\260V\2701\340\014\027\220w\230b\240\t\250\026\250q\320\004!\240\030\250\021\360 \000\t\036\230U\240!\2401\330\010\016\210a\210|\2301\230D\240\005\240Q\320\004\032\230(\240!\360\024\000\t\036\230U\240!\2401\330\010\036\230a\330\010#\2401\330\010&\240a\330\010\016\210a\210y\230\001\230\024\230V\2406\250\021\250'\260\021\260'\270\021\270!\330\010\033\2307\240!\2407\250!\330\010\033\2307\240!\2407\250!\330\010\016\210a\210}\230A\230T\240\026\240v\250Q\250g\260Q\260g\270Q\270a\330\010\020\220\006\220a\320\004\032\230(\240!\360\036\000\t\036\230U\240!\2401\330\010\016\210a\320\017$\240A\240T\250\033\260A\320\004 \240\010\250\001\360\036\000\t\036\230U\240!\2401\330\010\016\210a\210~\230Q\230d\240%\240q\320\004\031\230\021\360\024\000\t\036\230U\240!\2401\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\017\210u\220A\220Q\320\004(\250\010\260\001\360\024\000\t\036\230U\240!\2401\330\010\016\210a\320\017&\240a\240t\2506\260\021\320\004\"\240(\250!\360\036\000\t\036\230U\240!\2401\330\010\016\210a\320\017!\240\021""\240$\240e\2501\320\004\"\240(\250!\360\"\000\t\036\230U\240!\2401\330\010 \240\001\330\010\016\210a\320\017\037\230q\240\004\240E\250\026\250q\260\001\330\010\017\210y\230\001\230\021\320\004\032\230(\240!\360\036\000\t\036\230U\240!\2401\330\010\016\210a\210z\230\021\230$\230e\2401\320\004(\250\010\260\001\360\036\000\t\036\230U\240!\2401\330\010\037\230q\330\010\035\230X\240Q\240g\250Q\250j\270\004\270F\300(\310!\3101\330\010\016\210a\320\017!\240\021\240$\240e\2503\250a\330\010\026\220a\330\010\036\230a\330\010\014\210G\2209\230A\330\014\022\220*\230A\230V\2401\240C\240q\330\014\017\210v\220V\2301\230A\330\014\025\220W\230A\230Q\330\010\017\210q\320\004'\240{\260(\270!\360\"\000\t\036\230U\240!\2401\330\010 \240\001\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\320\017$\240A\240T\250\025\250f\260A\320\004+\250>\270\036\300~\320U^\320^_\360*\000\t%\240E\250\021\250!\330\010$\240A\330\010\013\210;\220n\240H\250A\250Y\260a\330\010$\240A\330\010\013\2104\210s\220&\230\014\240C\240q\330\010\013\2103\210e\2203\220f\230H\240A\330\010\016\210a\320\017'\240q\250\004\250F\260+\270Z\300w\310a\310s\320RS\330\010\017\210q\320\004!\240\031\250!\360\024\000\t\036\230V\2401\240A\330\010\016\210a\320\017&\240a\240t\2506\260\021\320\004)\250\031\260!\360\"\000\t&\240V\2501\250A\330\010\016\210a\320\017&\240a\240t\2506\260\021\320\004)\250\031\260!\340\010\030\230\001\230\024\230V\2403\240c\250\023\250F\260#\260Q\320\004*\320*=\270V\3006\310\021\340\010\036\230f\240A\240Q\330\010\036\230e\2401\240A\330\010\016\210a\320\017(\250\001\250\024\250W\260F\270!\320\004 \320 V\320VW\360,\000\t#\320\"5\260Q\260a\330\010\016\210a\320\017!\240\021\240$\240e\2507\260-\270|\3101\310A\330\")\250\034\260Q\260a\320\004V\320VW\360*\000\t\017\210a\320\017#\2401\240D\250\005\250W\260F\270'\300\026\300w\310f\320T]\320]^\330\010\017\210q\320\004 \240\001\360\036\000\t\036\230W\240A\330\010\016\210a\320\017#\2401\240D\250\005\250Q\250e\2601\330\010\023\2201\220E\230\021\330\010\017""\210q\320\004\"\240!\360\026\000\t\036\230W\240A\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\005\260Q\330\010\016\210a\210{\230!\2305\240\001\330\010\017\210q\320\004-\250W\260J\270a\360\"\000\t\020\210\177\230a\230v\240U\250!\320\004%\240W\250J\260a\360\034\000\t'\240f\250A\250Q\330\010\016\210a\210|\2301\230D\240\006\240a\320\004!\320!W\320WX\360,\000\t#\320\"5\260Q\260a\330\010\016\210a\320\017\"\240!\2404\240u\250G\260=\300\014\310A\310Q\330#*\250,\260a\260q\320\004\031\230\033\320$@\320@W\320W`\320`a\360*\000\t\034\2305\240\001\240\021\330\010\037\230z\250\021\330\010\016\210a\210~\230Q\230d\240%\240q\250\010\260\001\260\021\330\010\017\210r\220\022\2207\230$\230b\240\001\240\021\340\010\037\230q\330\010\037\230q\330\010\017\210x\220q\230\006\230a\230w\240a\240q\330\010\016\210a\320\017 \240\001\240\024\240U\250$\250a\330\010\016\210a\210}\230A\230T\240\025\240d\250!\340\010\037\230q\330\010\037\230q\330\010\013\210<\220w\230a\330\014\032\230(\240!\240=\260\001\260\027\270\001\270\021\330\014\023\2206\230\023\230A\330\014\022\220!\320\023+\2501\250D\260\005\260T\270\021\320\004W\320We\320e\177\360\000\000@\002N\002\360\000\000N\002W\002\360\000\000W\002X\002\360>\000\t\"\240\026\240q\250\001\330\010!\240\026\240q\250\001\330\010\016\210a\320\017$\240A\240T\250\025\250f\260F\270)\3009\310G\320SY\320Yd\320de\330\010\020\220\t\230\021\320\004\035\230W\320$H\310\001\360&\000\t\037\230a\330\010\016\210a\210\177\230a\230t\2407\250!\330\010\013\2106\220\023\220G\2304\230|\2502\250Y\260a\320\004%\240W\320,?\270w\300j\320PQ\360\"\000\t\035\230A\330\010\034\320\034,\250A\330\010\030\230\001\330\010 \240\001\330\010 \240\001\330\010\034\230A\330\010\016\210a\210~\230Q\230d\240&\250\007\250v\260V\2701\270C\270q\300\004\300A\300T\310\021\310!\330\010\027\220y\240\001\330\010\013\2105\220\003\220=\240\005\240W\250A\250Q\250a\250s\260!\330\010\013\2105\220\003\220=\240\005\240W\250A\250R\250q\260\004\260A\330\010\016\210a\320\017!\240\021\240$\240f\250G\2606\270\026""\270q\300\003\3001\300D\310\001\310\024\310Q\310a\330\010\020\220\004\220A\320\004+\320+=\270^\310<\320We\320en\320no\360(\000\t \230x\240q\250\006\250a\330\010 \240\001\330\010\037\230q\330\010!\240\021\330\010\023\2209\230A\230Z\240q\250\001\330\010\016\210a\320\017'\240q\250\007\250w\260h\270a\270q\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\004)\250\034\260X\270Q\3602\000\t\037\230i\240q\330\010\037\230u\240A\240Q\330\010\037\230u\240A\240Q\330\010\016\210a\320\017(\250\001\250\024\250U\260(\270(\300!\3007\310!\3101\330\010\017\210u\220A\220X\230U\240!\2401\320\004%\240X\250Q\360\026\000\t!\240\001\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\320\017 \240\001\240\024\240W\250A\320\004%\240X\250Q\360\024\000\t!\240\001\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\210\177\230a\230t\2405\250\001\320\004%\240X\250Q\360\026\000\t!\240\001\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\320\017'\240q\250\004\250F\260!\320\004%\240X\250Q\360 \000\t!\240\001\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\320\017\037\230q\240\004\240F\250!\320\004%\240X\250Q\360\026\000\t!\240\001\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\320\017\037\230q\240\004\240F\250!\320\004\035\230X\240Q\360\024\000\t\034\2305\240\001\240\021\330\010\031\230\024\230Q\330\010\016\210a\210\177\230a\230t\2407\250$\250a\250t\2601\330\010\016\210a\210{\230!\2304\230q\330\010\017\210q\320\004\035\230X\240Q\360 \000\t\034\2305\240\001\240\021\330\010)\250\021\330\010\016\210a\320\017 \240\001\240\024\240U\250$\250a\250q\330\010\017\210u\220A\220Q\320\004\035\230X\240Q\360 \000\t\034\2305\240\001\240\021\330\010\037\230z\250\021\330\010\016\210a\210~\230Q\230d\240%\240q\250\010\260\001\260\021\330\010\017\210r\220\022\2207\230$\230b\240\001\240\021\330\010\036\230a\330\010\016\210a\320\017 \240\001\240\024\240U\250$\250a\250q\330\010\017\210u\220A\220Q\320\004\"\240+\250X\260Q\360\"\000\t!\240\005\240Q\320&7\260u\270A\270Q\330""\010\016\210a\320\017!\240\021\240$\240j\260\t\270\021\320\004-\250X\260Q\360\036\000\t!\240\005\240Q\240a\330\010\016\210a\320\017'\240q\250\004\250E\260\021\320\004\035\230X\240Q\360\036\000\t\036\230U\240!\2401\330\010\016\210a\210{\230!\2304\230u\240A\320\004-\250X\260Q\360\036\000\t\036\230U\240!\2401\330\010\016\210a\320\017 \240\001\240\024\240U\250!\320\004%\240X\250Q\360\036\000\t\036\230U\240!\2401\330\010\016\210a\210\177\230a\230t\2405\250\001\320\004%\240X\250Q\360\036\000\t\036\230U\240!\2401\330\010\016\210a\320\017!\240\021\240$\240e\2501\320\004\"\240+\250X\260Q\360&\000\t\036\230U\240!\2401\330\010 \240\001\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\320\017\037\230q\240\004\240E\250\026\250q\320\004%\240X\250Q\360\036\000\t\"\240\021\330\010\021\220\021\220&\230\001\230\021\330\010\016\210a\320\017%\240Q\240d\250%\250q\320\004\035\230X\240Q\360\024\000\t\037\230a\330\010\036\230a\330\010\035\230W\240A\240T\250\031\260&\270\001\270\024\270Q\270a\330\010\013\2103\210c\220\021\330\014\025\220Y\230a\230q\340\014\025\220X\230S\240\t\250\021\250%\250y\270\001\270\021\270\"\270A\270Q\330\010\037\230q\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017%\240Q\240d\250&\260\001\320\004\035\230X\240Q\360\036\000\t\037\230a\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\210z\230\021\230$\230e\2407\250!\2501\330\010\017\210v\220Q\220a\320\004%\240X\250Q\360\024\000\t\037\230e\2401\240A\330\010\016\210a\320\017*\250!\2504\250v\260Q\320\004%\240X\250Q\360\"\000\t\037\230e\2401\240A\330\010\016\210a\210}\230A\230T\240\025\240a\320\004%\240X\250Q\360\036\000\t\037\230e\2401\240A\330\010\016\210a\320\017&\240a\240t\2505\260\001\320\004!\240\021\360\024\000\t\036\230X\240Q\330\010'\240q\330\010\016\210a\320\017,\250A\330\020\024\220F\230!\2301\330\010\016\210a\320\0171\260\021\330\020\024\220F\230!\2301\330\010\016\210a\320\0174\260A\330\020\024\220F\230!\2301\330\010\037\230q\330\010\t\330\014\027""\220w\230a\230t\2402\240T\250\021\340\014\022\220!\320\023<\270A\330\024\030\230\006\230a\230q\330\010\017\210q\320\004!\240\021\360\024\000\t\036\230X\240Q\330\010'\240q\330\010\016\210a\210~\230Q\230d\240'\250\021\250!\330\010\016\210a\210~\230Q\230d\240'\250\021\250!\330\010\016\210a\320\017 \240\001\240\024\240W\250A\250Q\330\010\037\230q\330\010\t\330\014\027\220w\230a\230t\2402\240T\250\021\340\014\022\220!\320\023(\250\001\250\024\250W\260A\260Q\330\010\017\210q\320\004-\250X\260Q\360\036\000\t \230u\240A\240Q\330\010\016\210a\320\017\"\240!\2404\240u\250A\320\004%\240X\250Q\360\"\000\t\"\240\021\330\010\037\230u\240A\240Q\330\010\016\210a\320\017-\250Q\250b\260\005\260X\270Q\270a\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004%\240X\250Q\360$\000\t \230u\240A\240Q\330\010\016\210a\320\017%\240Q\240d\250*\260A\320\004%\240X\250Q\360\026\000\t \230u\240A\240Q\330\010\032\230$\230a\330\010\016\210a\320\017\"\240!\2404\240w\250h\260a\260u\270A\330\010\016\210a\210{\230!\2305\240\001\330\010\017\210q\320\004%\240X\250Q\360\024\000\t \230u\240A\240Q\330\010\027\220s\230!\330\010\016\210a\320\017\"\240!\2404\240w\250h\260a\260s\270!\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004%\240X\250Q\360\036\000\t \230u\240A\240Q\330\010\027\220s\230!\330\010\016\210a\320\017 \240\001\240\024\240U\250(\260!\2603\260a\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004!\240\034\250X\260Q\360\"\000\t \230u\240A\240Q\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010\026\220b\230\001\330\010\016\210a\210~\230Q\230d\240%\240w\250h\260a\260s\270!\330\010\017\210q\320\004!\240\034\250X\260Q\360\"\000\t \230u\240A\320%7\260q\330\010\037\230u\240A\240Q\330\010\016\210a\320\017&\240a\240t\2506\260\030\270\030\300\021\300!\330\010\017\210u\220A\220Q\320\004\035\230X\240Q\360\024\000\t\"\240\021\330\010\037\230w\240a\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\210z\230\021\230$\230e\2407""\250!\2507\260!\330\010\016\210a\210{\230!\2307\240!\330\010\017\210q\320\004%\240X\250Q\360 \000\t\"\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\320\017%\240Q\240d\250%\250q\320\004\035\230X\240Q\360\024\000\t!\240\001\330\010\017\210y\230\001\230\026\230q\240\001\330\010\017\210t\2209\230A\230W\240A\320\004\"\240+\250X\260V\2701\360\"\000\t\014\2104\210s\220&\230\006\230a\330\010\036\230f\240A\240Q\330\010\036\230a\330\010\016\210a\210~\230Q\230d\240&\250\003\2506\260\026\260q\270\001\330\010\017\210v\220Q\220a\320\004X\320Xf\360\000\000g\001B\002\360\000\000B\002P\002\360\000\000P\002Z\002\360\000\000Z\002[\002\360>\000\t\"\240\026\240q\250\001\330\010!\240\026\240q\250\001\330\010\016\210a\320\017%\240Q\240d\250%\250v\260V\2709\300I\310W\320TZ\320Ze\320ef\330\010\020\220\t\230\021\320\004!\240\034\250Y\260a\360L\001\000\t\034\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\033\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\016\210a\210\177\230a\230t\2406\250\026\250q\320\004!\240\034\250Y\260a\360:\000\t\034\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\033\2301\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\016\210a\210~\230Q\230d\240%\240v\250Q\320\004%\240Y\250a\360\036\000\t\014\2107\220#\220Q\330\014\025\220S\230\001\330\010\013\2106\220\025\220c\230\021\330\014\022\220!\220=\240\001\240\024\240V\2506\260\021\260&\270\001\330\010\016\210a\210~\230Q\230d\240&\250\006\250a\330\010\017\210q\320\004\035\230Y\240a\360*\000\t\014\2107\220#\220Q\330\014\025\220T\230\021\230%\230q\330\010\013\2106\220\026\220s\230!\330\014\022\220!\220;\230a\230t\2407\250!\2506\260\021\330\010\016\210a\210v\220Q\220d\230'\240\026\240q\330\010\017\210q\320\004(\250\r\260Y\270a\360$\000\t!\240\001\330\010\013\2107\220'\230\026\230z\250\025\250a\250q\330\010\027\220r\230\021\330\010\016\210a\320\017\"\240!\2404\240w\250i\260q\270\004\270A\330\010\017\210q\320\004\"\240!\360\024\000\t\036\230Y\240a\330\010\016\210a\320""\017\"\240!\2404\240v\250Q\250c\260\021\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004(\250\r\260Y\270a\360\024\000\t\017\210a\320\017\"\240!\2404\240v\250W\260A\320\004\035\230Y\240a\360\024\000\t\037\230a\330\010\016\210a\210}\230A\230T\240\027\250\001\320\004-\250Y\260a\360*\000\t'\240f\250A\250Q\330\010\016\210a\320\017*\250!\2504\250x\260q\320\004-\250Y\260a\360\"\000\t\037\230f\240A\240Q\330\010\016\210a\320\017)\250\021\250$\250e\2601\320\004\035\230Y\240a\360\024\000\t\"\240\026\240q\250\001\330\010\016\210a\210|\2301\230D\240\006\240a\320\004\035\230Y\240a\360\"\000\t\"\240\026\240q\250\001\330\010\016\210a\210|\2301\230D\240\006\240a\320\004-\250Y\260a\360.\000\t\"\240\026\240q\250\001\330\010\016\210a\320\017*\250!\2504\250v\260Q\320\004 \240\r\250Y\260a\360$\000\t\020\210v\220Q\220d\230&\240\016\250d\260)\2706\300\021\210\001\330\014\r\210Y\220f\230A\230Q\360\020\000\r\024\2201\320\004-\320-?\270~\310\\\320Yg\320gp\320pq\360(\000\t \230x\240q\250\006\250a\330\010 \240\001\330\010\037\230q\330\010!\240\021\330\010\023\2209\230A\230Z\240q\250\001\330\010\016\210a\320\017)\250\021\250'\260\027\270\010\300\001\300\021\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\004<\320<Z\320Z[\360\036\000\t7\260a\330\010\016\210a\320\017-\250Q\250d\260%\260q\320\004*\320*@\320@Z\320Z]\320]`\320`k\360\000\000l\001F\002\360\000\000F\002I\002\360\000\000I\002L\002\360\000\000L\002M\002\330*8\270\014\300N\320R[\320[\\\3602\000\t\035\230A\330\010\034\230M\250\021\330\010\020\220\010\230\001\230\027\240\001\240\025\240a\240q\330\010\017\210t\2203\220b\230\004\230D\240\003\2401\340\010\016\210a\210u\220F\230!\2305\240\006\240a\240u\250A\330\010\014\210G\2209\230E\240\026\240q\250\005\250U\260!\2601\340\010\016\210a\210u\220F\230!\2305\240\006\240a\240u\250A\330\010\014\210G\2209\230E\240\026\240q\250\005\250U\260!\2601\330\010!\240\021\330\010\037\230x\240q\250\006\250a\330\010\037\230q\330\010\016\210a\320\017)\250\021\250'\260""\025\260h\270h\300h\310i\320WX\320XY\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\004\033\230=\250\t\260\037\300\013\310?\320Zg\320gv\360\000\000w\001C\002\360\000\000C\002R\002\360\000\000R\002[\002\360\000\000[\002\\\002\360>\000\t\036\230Q\330\010\034\230A\330\010\036\230a\330\010 \240\001\330\010\037\230q\330\010\016\210a\320\017#\2401\240D\250\006\250a\250v\260Q\260d\270!\2706\300\021\300(\310!\3107\320RS\330\010\013\2104\210w\220a\330\014\023\2205\230\001\230\021\330\010\013\2102\210W\220A\330\014\021\220\026\220q\230\001\330\010\013\2104\210w\220a\330\014\023\2206\230\021\230!\330\010\013\2106\220\027\230\001\330\014\025\220V\2301\230A\330\010\013\2105\220\007\220q\330\014\024\220F\230!\2301\330\010\016\210a\210z\230\021\230$\230f\240F\250$\250f\260H\270A\320\004-\250Z\260q\360 \000\t\037\230f\240A\240Q\330\010\016\210a\320\0170\260\001\260\024\260U\270!\320\004%\240Z\250q\360\036\000\t\037\230f\240A\240Q\330\010\016\210a\210}\230A\230T\240\025\240a\320\004-\250Z\260q\360 \000\t\037\230f\240A\240Q\330\010\016\210a\320\017-\250Q\250d\260%\260q\320\004%\240Z\250q\340\010\036\230f\240A\240Q\330\010\016\210a\320\017!\240\021\240$\240f\250A\320\004%\240Z\250q\360&\000\t\037\230f\240A\240Q\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\320\004\035\230\\\250\036\260~\300Z\310q\360*\000\t \230u\240A\240Q\330\010\037\230v\240Q\240a\330\010\037\230v\240Q\240a\330\010\037\230v\240Q\240a\330\010\016\210a\210}\230A\230T\240\027\250\006\250g\260W\270A\320\004(\250\001\340\010\016\320\016!\240\021\240!\200\001\330\004\021\220\021\320\004'\240\177\260a\360D\001\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017\"\240!\2404\240v\250Q\320\004:\270!\360\036\000\t\017\210a\320\0170\260\001\260\024\260U\270$\270a\320\004&\240a\360\024\000\t0\250q\330\010\016\210a\320\017'\240q\250\004\250E\260\021\260!\330\010\017\210v\220Q\320\004\031\230\021\360\024\000\t\017\210a\320\017#\2401\240A\240T\250\021\330\010\017""\210q\320\004 \240\001\360\024\000\t\017\210a\320\017+\2501\250D\260\001\320\004(\250\001\360\036\000\t\017\210a\320\017+\2501\250D\260\013\2701\270C\270q\320\004\030\230\001\360\024\000\t\017\210a\210|\2301\230D\240\001\320\004 \240\001\360\022\000\t\017\210a\320\017+\2501\250D\260\001\320\004(\250\001\360\026\000\t!\240\001\330\010\016\210a\320\017+\2501\250D\260\005\260Q\260a\330\010\017\210u\220A\220Q\320\004\030\230\001\360\024\000\t\033\230(\240(\250(\260(\270!\330\010\016\210a\210|\2301\230D\240\005\240Q\240f\250A\250V\2601\260F\270!\2701\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\017\210v\220Q\220c\230\021\230#\230V\2406\250\026\250q\320\004)\250\021\360\036\000\t\017\210a\320\017#\2401\240D\250\005\250R\250q\320\004*\250!\360\036\000\t\017\210a\320\017#\2401\240D\250\005\250T\260\021\330\010\017\210q\320\004\031\230\021\360\024\000\t\017\210a\320\017\"\240!\2401\240D\250\001\330\010\017\210q\320\004\031\230\021\360\024\000\t\017\210a\210{\230!\2301\230D\240\001\330\010\017\210q\320\004(\250\001\360\032\000\t\017\210a\320\017#\2401\240D\250\007\250q\260\014\270A\320\004\"\240!\360\024\000\t\031\230\002\230!\330\010\016\210a\320\017#\2401\240D\250\007\250q\260\005\260Q\330\010\016\210a\210{\230!\2305\240\001\330\010\017\210q\320\004\"\240!\360\024\000\t!\240\001\330\010\016\210a\320\017#\2401\240D\250\007\250q\260\001\330\010\017\210y\230\001\230\021\320\004(\250\010\260\001\360\024\000\t\017\210a\320\017#\2401\240D\250\007\250w\260a\320\004\037\230\177\250a\360\024\000\t\"\240\021\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\320\017$\240A\240T\250\031\260!\320\004\037\230\177\250a\360\036\000\t!\240\001\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\210~\230Q\230d\240%\240q\320\004\037\230\177\250a\360\036\000\t!\240\001\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\210~\230Q\230d\240%\240q\330\010\017\210q\320\004\037\230\177\250a\360\036\000\t!\240\001\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\210y\230""\001\230\024\230U\240!\320\004\037\230\177\250a\360&\000\t!\240\001\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\210y\230\001\230\024\230U\240!\320\004'\240\177\260a\360\024\000\t$\2401\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017\"\240!\2404\240v\250Q\320\004\"\240,\250a\360\036\000\t$\2401\330\010\016\210a\210|\2301\230D\240\005\240Q\320\004\036\230a\360\024\000\t\034\2301\330\010\016\210a\320\0171\260\021\260$\260f\270A\270Q\330\010\017\210u\220A\220Q\320\004\036\230a\360\024\000\t\034\2301\330\010\016\210a\320\017\"\240!\2404\240u\250A\250Q\330\010\017\210u\220A\220Q\320\004\036\230a\360\024\000\t\033\230!\330\010\033\2301\330\010\016\210a\210~\230Q\230d\240%\240q\250\003\2506\260\021\260!\330\010\017\210q\220\007\220q\230\001\230\021\230$\230d\240'\250\030\260\021\320\004\036\230a\360\024\000\t\034\2301\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\017\210u\220A\220Q\320\004\036\230a\360\024\000\t\034\2301\330\010\016\210a\210~\230Q\230d\240'\250\021\250!\330\010\017\210u\220A\220Q\320\004&\240a\360\024\000\t\034\2301\330\010\036\230a\330\010\016\210a\320\017'\240q\250\004\250E\260\021\260$\260f\270A\270Q\330\010\036\230a\330\010\013\2105\220\003\2201\330\014\026\220a\220w\230a\230t\2401\240D\250\004\250G\2609\270A\330\010\017\210q\320\004&\240a\360\024\000\t\031\230\003\2301\330\010\016\210a\320\017&\240a\240t\2506\260\021\260$\260a\330\010\016\210a\210{\230!\2304\230q\330\010\017\210q\320\004\036\230a\360\024\000\t\034\2301\330\010\016\210a\210\177\230a\230t\2406\250\021\250!\330\010\017\210u\220A\220Q\320\004\036\230a\360\024\000\t\034\2302\230Q\330\010\016\210a\210\177\230a\230t\2406\250\021\250(\260!\330\010\017\210q\320\004\036\230a\360*\000\t#\240/\260\021\330\010\"\320\"2\260!\330\010\016\210a\320\017\"\240!\2404\240u\250A\250[\270\001\270\033\300A\300[\320PQ\320QR\330\010\017\210u\220A\220\\\240\025\240a\240|\2605\270\001\270\034\300U\310!\3101\320\004&\240a\340\010\016\320\016!\240\021\240!\320\004 \240\001""\360\024\000\t\017\210a\320\0173\2601\260D\270\001\320\004(\320(@\300\001\360\022\000\t\017\210a\320\017*\250!\2504\250|\2701\320\004\031\230\021\360\024\000\t\017\210a\320\017!\240\021\240!\2404\240q\320\004 \240\001\360\024\000\t\017\210a\320\017*\250!\2504\250q\320\004\031\230\021\360\024\000\t\017\210a\320\017!\240\021\240!\2404\240q\330\010\017\210q\320\004 \240\001\360\024\000\t+\250!\330\010\016\210a\210{\230!\2304\230q\330\033\034\330\033!\240\026\240q\330\033!\240\026\240q\330\033!\240\021\330\033!\240\026\240q\330\033\034\230A\330\010\017\210q\320\004\031\230\021\360\024\000\t\017\210a\320\017!\240\021\240!\2404\240t\2501\250A\330\010\017\210q\320\004\"\240!\360\024\000\t!\240\001\330\010\016\210a\320\017*\250!\2504\250t\2601\260D\270\001\270\021\330\010\017\210y\230\001\230\021\320\004\032\230!\360\024\000\t!\240\001\330\010\016\210a\320\017\"\240!\2404\240v\250Q\250a\330\010\017\210x\220q\230\001\320\004\"\240!\360\024\000\t!\240\001\330\010\016\210a\320\017\"\240!\2404\240v\250Q\250a\330\010\017\210y\230\001\230\021\320\004\"\240!\360\024\000\t#\240!\330\010\016\210a\320\017\"\240!\2404\240v\250Q\250a\330\010\017\210y\230\001\230\021\320\004(\250\001\360$\000\t\017\210a\210{\230!\2304\230v\240Q\240f\250A\250Q\320\004(\250\001\360(\000\t\017\210a\210{\230!\2304\230v\240Q\240f\250A\250Q\320\004*\250(\260!\360\024\000\t\032\230\021\330\010\016\210a\320\017\"\240!\2404\240v\250U\260!\320\004\031\230\021\360\024\000\t\033\230(\240!\330\010!\240\021\330\010\016\210a\320\017\"\240!\2404\240v\250V\2601\260D\270\001\270\021\330\010\027\220q\330\010\034\230A\330\010\014\210G\2209\230A\330\014\022\220#\220Q\330\014\017\210w\220a\220q\230\001\330\014\022\220!\220;\230a\230s\240!\330\014\023\2207\230!\2301\330\010\017\210q\320\004(\250\010\260\001\360\024\000\t\017\210a\320\017*\250!\2504\250v\260W\270A\320\004(\250\010\260\001\360\036\000\t\017\210a\320\017\"\240!\2404\240v\250W\260A\320\004(\250\010\260\001\360\024\000\t\017\210a\320\017\"\240!\2404\240v\250W\260A""\320\004)\320):\270!\360\024\000\t\017\210a\320\017\"\240!\2404\240w\250a\320\004\031\230\021\360\024\000\t#\240!\330\010\016\210a\210{\230!\2304\230w\240a\240q\330\010\017\210y\230\001\230\021\320\004(\250\001\360\024\000\t\017\210a\320\017*\250!\2504\250x\260s\270!\320\004.\250a\360\024\000\t6\260Q\330\010\016\210a\320\017-\250Q\250d\260%\260q\270\001\330\010\017\210q\320\004!\240\031\250!\360\036\000\t\037\230a\330\010\013\2106\220\027\230\001\330\010\016\210a\320\017(\250\001\250\024\250U\260!\320\004&\240a\360\024\000\t\034\2307\240!\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\003\2601\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004'\240\177\260a\360\024\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017#\2401\240D\250\007\250q\320\004'\240\177\260a\360\024\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017\"\240!\2404\240v\250Q\320\004*\250,\260a\360\036\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017(\250\001\250\024\250U\260!\320\004'\240\177\260a\360\036\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017!\240\021\240$\240e\2501\320\004'\240\177\260a\360\024\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017!\240\021\240$\240e\2501\320\004\031\230\021\360\024\000\t\017\210a\320\017,\250A\250Q\250d\260!\330\010\017\210q\320\004\031\230\021\360\024\000\t\017\210a\320\017$\240A\240Q\240d\250!\330\010\017\210q\320\004\032\230!\340\010\016\210a\320\017$\240A\240T\250\021\320\004\031\230\021\360\024\000\t\"\240\021\330\010\016\210a\320\017$\240A\240T\250\031\260!\2601\330\010\017\210y\230\001\230\021\320\004\032\230!\360\024\000\t\017\210a\320\017$\240A\240T\250\021\320\004 \240\001\360\024\000\t\017\210a\320\017$\240A\240T\250\021\320\004 \240\001\360\024\000\t\017\210a\320\017,\250A\250T\260\021\320\004\031\230\021\360\024\000\t)\250\001\330\010\016\210a\320\017$\240A\240T\250\034\260Q\260a\330""\010\017\210y\230\001\230\021\320\004!\240\021\360\026\000\t\"\240\021\330\010\016\210a\320\017$\240A\240T\250\025\250a\250q\330\010\017\210v\220Q\220a\320\004\031\230\021\340\010 \240\001\330\010\016\210a\320\017$\240A\240T\250\025\250a\250q\330\010\017\210y\230\001\230\021\320\004(\250\001\360\036\000\t\017\210a\320\017$\240A\240T\250\025\250b\260\001\320\004\031\230\021\360\024\000\t\033\230!\330\010\016\210a\320\017,\250A\250T\260\026\260q\270\001\330\010\017\210u\220A\220Q\320\004\"\240!\360\024\000\t#\240!\330\010\016\210a\320\017,\250A\250T\260\030\270\021\270!\330\010\017\210y\230\001\230\021\320\004\037\230\177\250a\360\036\000\t-\250A\330\010\022\220)\2301\230I\240Q\240a\330\010\016\210a\320\017#\2401\240D\250\010\260\001\320\004\036\230a\360\024\000\t\035\230A\330\010\032\230!\330\010\032\230!\330\010\032\230!\330\010\016\210a\210{\230!\2304\230q\330\033\034\230A\330\033!\240\026\240q\330\033\034\230C\230q\240\003\2401\240A\330\033!\240\021\330\033!\240\026\240q\330\033\034\330\010\017\210v\220Q\220e\2303\230c\240\021\320\004\036\230a\360\024\000\t\035\230A\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\017\210u\220A\220Q\320\004\036\230a\360\024\000\t%\240A\330\010\016\210a\320\017!\240\021\240$\240e\2501\250A\330\010\017\210v\220Q\220a\320\004\036\230a\360\016\000\t\035\230F\240!\330\010\016\210a\320\017#\2401\240D\250\005\250R\250u\260A\260U\270!\330\010\017\210q\320\004\036\230a\360\024\000\t!\240\004\240I\250Q\250a\330\010\017\210q\320\004!\240\037\260\001\360\036\000\t'\240a\330\010\024\220I\230Q\230k\250\021\250!\330\010\016\210a\210~\230Q\230d\240*\250A\320\004&\240a\360\024\000\t\035\230J\240a\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\004\260A\260Q\330\010\020\220\006\220a\220u\230F\240!\2401\320\004)\320)>\270a\360\036\000\t-\250L\270\001\270\021\340\010\016\210a\320\017.\250a\250t\2607\270!\320\004 \240\001\360\024\000\t\017\210a\320\017(\250\001\250\024\250Q\320\004 \320 >\270a\360\024\000\t.\250Q\330\010\022\220)\2301\230I""\240Q\240a\330\010\016\210a\320\017%\240Q\240d\250%\250q\320\004 \240\001\360\024\000\t\017\210a\320\017 \240\001\240\024\240Q\320\004 \240\001\360\032\000\t\017\210a\320\017 \240\001\240\024\240Q\320\004\036\230a\360 \000\t\"\240\034\250Q\330\010\"\320\"4\260A\330\010\033\2301\330\010\016\210a\320\0171\260\021\330\020\024\220F\230!\2307\240!\2407\250!\250:\260Q\260a\330\010\t\330\014\020\220\007\220y\240\001\330\020\026\220a\220u\230A\230U\240!\2407\250'\260\021\260(\270!\2704\270w\300a\300q\340\0142\260!\330\020\024\220F\230!\2307\240!\2407\250!\250:\260Q\260a\330\010\017\210q\320\004\036\230a\360\"\000\t\036\230Q\330\010\034\230A\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\001\330\010\016\210a\320\017&\240a\240t\2505\260\001\260\021\330\010\034\230A\230V\2401\240C\240q\250\004\250D\260\007\260y\300\001\330\010\014\210G\2209\230A\330\014\022\220!\2209\230A\230Q\230c\240\021\240!\330\010\016\210a\210y\230\001\230\021\330\010\017\210q\320\004.\250a\330$=\270Q\330%=\270Y\300a\360&\000\t+\250!\330\010\016\210a\320\017 \240\001\240\024\240W\250A\250Q\330\010\013\2109\220G\2301\330\014\017\210v\220S\230\006\230h\240a\330\014\017\210v\220S\230\006\230h\240a\330\014\027\220z\240\026\240q\330\014\020\220\t\230\021\320\032*\250!\340\014\022\220!\320\023,\250A\250X\260_\300H\310A\340\014\020\220\t\230\021\320\032*\250!\330\014\022\220!\320\023,\250A\250X\260V\2701\320\004\036\230a\360\024\000\t\036\230Q\330\010\016\210a\320\017\"\240!\2404\240u\250A\250Q\330\010\017\210u\220A\220Q\320\004\036\230a\360\024\000\t\036\230Q\330\010\016\210a\320\017%\240Q\240d\250(\260!\2601\330\010\017\210u\220A\220Q\320\004\036\230a\360\024\000\t\036\230Q\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\017\210u\220A\220Q\320\004\036\230a\360\024\000\t&\240Q\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\017\210y\230\001\230\021\320\004&\240a\360\024\000\t\036\230Q\330\010\016\210a\320\017&\240a\240t\2506\260\021\260!\330\010\017\210u\220A\220Q\320\004\036\230a\360""\030\000\t\036\230Q\330\010\016\210a\320\017)\250\021\250$\250l\270!\2701\330\010\017\210u\220A\220Q\320\004\031\230\021\360\024\000\t\017\210a\210~\230Q\230a\230t\2401\330\010\017\210q\320\004\031\230\021\360\024\000\t\017\210a\320\017%\240Q\240a\240t\2501\330\010\017\210q\320\004!\240\021\360\024\000\t\017\210a\320\017-\250Q\250d\260!\320\004\032\230!\360\024\000\t\017\210a\210~\230Q\230d\240!\320\004)\250\021\360\030\000\t\017\210a\320\017-\250Q\250d\260!\320\004 \240\001\360\024\000\t\017\210a\320\017-\250Q\250d\260!\320\004\"\240!\360\024\000\t!\240\001\330\010\016\210a\320\017-\250Q\250d\260,\270a\270q\330\010\017\210u\220A\220Q\320\004\032\230!\360\"\000\t\033\230'\240\021\330\010\016\210a\210~\230Q\230d\240'\250\021\250!\330\010\016\210a\210y\230\001\230\024\230W\240A\240Q\330\010\020\220\005\220Q\220d\230%\230q\240\001\320\004\032\230!\360\024\000\t\017\210a\320\017%\240Q\240d\250%\250q\320\004!\240\021\360\024\000\t*\250\021\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\001\330\010\032\230&\240\001\330\010\013\2107\220!\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\"\240!\360\030\000\t!\240\001\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\001\330\010\017\210v\220Q\220a\320\004\031\230\021\360\024\000\t!\240\001\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\017\210y\230\001\230\021\320\004)\250\021\360\036\000\t\017\210a\320\017%\240Q\240d\250%\250r\260\021\320\004\036\230a\360\024\000\t\026\220R\220q\330\010\016\210a\210~\230Q\230d\240%\240q\250\002\250!\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004\036\230a\360\024\000\t\026\220S\230\010\240\003\2401\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\250\026\250q\260\001\260\021\330\010\016\210a\210{\230!\2301\230A\330\010\016\210a\210{\230!\2301\230A\330\010\020\220\003\2201\320\004\036\230a\360\024\000\t\026\220S\230\010\240\003\2401\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\250\026\250q\260\001\260\026\260v\270Q\330\010\016\210a\210{\230!\2301""\230H\240F\250!\250;\260a\260q\270\001\330\010\037\230t\2409\250A\250Q\330\010\020\220\003\2203\220a\320\004\036\230a\360*\000\t\026\220S\230\010\240\003\2401\330\010\016\210a\210\177\230a\230t\2406\250\021\250!\2506\260\021\260!\2601\330\010\016\210a\210{\230!\2301\230A\330\010\016\210a\210{\230!\2301\230A\330\010\020\220\003\2201\320\004\036\230a\360\034\000\t\026\220S\230\001\330\010\025\220S\230\001\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\250\026\250q\260\001\260\021\330\010\016\210a\210{\230!\2301\230A\330\010\016\210a\210{\230!\2301\230A\330\010\020\220\003\2201\320\004\036\230a\360\024\000\t\026\220S\230\001\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\250\026\250v\260Q\330\010\016\210a\210{\230!\2301\230A\330\010\037\230t\2409\250A\250Q\330\010\020\220\003\2201\320\004 \240\001\360\032\000\t\017\210a\320\017(\250\001\250\024\250T\260\021\260!\320\004\036\230a\360\024\000\t\036\230U\240!\2401\330\010\016\210a\320\017\"\240!\2404\240u\250A\250Q\330\010\017\210u\220A\220Q\320\004!\240\021\360\"\000\t+\250!\330\010\016\210a\320\017 \240\001\240\024\240U\250!\2501\330\010\017\210q\320\004!\240\021\360\024\000\t+\250!\330\010\016\210a\320\017 \240\001\240\024\240U\250!\2501\330\010\017\210q\320\004!\240\021\360\032\000\t\033\230!\330\010\016\210a\320\017 \240\001\240\024\240U\250!\2501\330\010\017\210u\220A\220Q\320\004!\240\021\360\024\000\t\033\230!\330\010\016\210a\320\017 \240\001\240\024\240U\250!\2501\330\010\017\210u\220A\220Q\320\004:\270!\360&\000\t\017\210a\320\017 \240\001\240\024\240U\250&\260\006\260i\270q\320\004[\320[\\\360*\000\t\017\210a\320\017(\250\001\250\024\250U\260'\270\026\270w\300f\310G\320SY\320Yb\320bc\330\010\017\210q\320\004 \240\001\360\024\000\t\031\230\001\330\010\032\230!\330\010\016\210a\320\017 \240\001\240\024\240V\2501\250C\250q\260\001\330\010\021\220\021\330\010\014\210E\220\025\220a\220q\330\014\024\220C\220q\330\014\021\220\027\230\002\230!\2301\330\014\022\220!\320\023'\240q\250\016\260e\2701\330\014\022""\220'\230\021\230!\340\010\017\210q\320\004$\320$>\270a\360\024\000\t\"\240\021\330\010!\240\021\330\010\r\210W\220A\330\010\020\220\010\230\001\230\021\330\010\020\220\010\230\001\230\021\330\010\016\210a\320\017%\240Q\240d\250&\260\007\260q\320\004:\270!\360\024\000\t\017\210a\320\017 \240\001\240\024\240W\250J\260a\320\004\036\230a\360\026\000\t\036\230X\240Y\250a\330\010\016\210a\320\017#\2401\240D\250\006\250a\250x\260q\270\001\330\010\020\220\005\220R\220q\340\010\034\230A\330\010\032\230(\240!\2407\250!\2505\260\001\260\024\260V\2701\270A\330\010\033\2309\240A\330\010\n\210!\2105\220\001\330\010\014\210J\220l\240!\330\014\022\220!\2209\230A\230T\240\026\240t\2501\250H\260A\260W\270F\300!\330\014\016\210a\210t\2201\220E\230\022\2301\230F\240\"\240A\330\014\022\220!\220=\240\001\240\024\240V\2504\250q\260\010\270\001\270\027\300\006\300a\340\010\034\230A\330\010\032\230(\240!\2407\250!\2502\250Q\250i\260v\270Q\270a\330\010\037\230q\330\010\032\230(\240!\2407\250!\2502\250Q\250i\260v\270Q\270a\330\010$\240A\330\010'\240q\330\010\014\210J\220l\240!\330\014\022\220!\2209\230A\230T\240\026\240t\2501\250H\260A\260W\270A\270V\3001\300A\330\014\022\220!\220;\230a\230r\240\021\240\"\240A\240W\250F\260(\270%\270q\300\001\330\014\022\220!\220;\230a\230r\240\021\240\"\240A\240W\250F\260(\270%\270q\300\001\330\014\022\220!\220=\240\001\240\024\240V\2504\250q\260\010\270\001\270\027\300\001\300\026\300q\310\001\340\010\020\220\004\220D\230\001\320\004\036\230a\360\024\000\t\036\230Y\240a\330\010\016\210a\210\177\230a\230t\2406\250\021\250#\250Q\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004*\250!\360\034\000\t\017\210a\320\017)\250\021\250$\250a\320\004)\250\031\260!\360\036\000\t\037\230a\330\010\016\210a\320\017#\2401\240D\250\005\250Q\320\004(\250\001\360\026\000\t\037\230a\330\010\016\210a\320\017+\2501\250D\260\005\260Q\260a\330\010\017\210v\220Q\220a\320\004\036\230a\360\016\000\t\017\210a\320\017#\2401\240D\250\005\250R\250q\320\004 \240\001\360\024""\000\t/\250a\330\010\016\210a\210|\2301\230D\240\006\240a\240q\330\010\017\210q\320\004\032\230!\360\024\000\t\037\230a\330\010\016\210a\320\017#\2401\240D\250\007\250q\260\001\330\010\017\210v\220Q\220a\320\004*\250!\360\026\000\t\037\230a\330\010\016\210a\320\017+\2501\250D\260\007\260q\270\001\330\010\017\210v\220Q\220a\320\004&\240a\360\032\000\t!\240\001\330\010\016\210a\320\0171\260\021\260$\260l\300!\3001\330\010\017\210u\220A\220Q\320\004 \240\001\360\024\000\t\017\210a\320\017!\240\021\240$\240a\320\004\"\240!\360\024\000\t\017\210a\320\017!\240\021\240$\240a\320\004\036\230a\360\036\000\t\017\210a\320\017\"\240!\2404\240|\2602\260Q\320\004\036\230a\360\030\000\t\017\210a\320\017\"\240!\2404\240q\320\004\036\230a\360\024\000\t\017\210a\320\017\"\240!\2404\240q\320\004\032\230!\360\024\000\t'\240a\330\010\016\210a\320\017\"\240!\2404\240t\2501\250D\260\001\260\021\330\010\017\210v\220Q\320\004\036\230a\360\024\000\t!\240\t\250\021\330\010\016\210a\320\017\"\240!\2404\240u\250A\250V\2601\330\010\016\210a\210{\230!\2306\240\021\330\010\017\210q\320\004.\250a\360\036\000\t\017\210a\320\017\"\240!\2404\240u\250E\260\021\320\004*\250!\360\024\000\t'\240a\330\010\016\210a\320\017*\250!\2504\250v\260Q\260a\330\010\035\230Q\330\010\016\210a\320\017!\240\021\240-\250t\2606\270\021\270!\330\010\031\230\021\330\010\016\210a\320\017\037\230}\250A\250V\2601\260A\330\010\017\210w\220a\220t\2301\230C\230q\320\004*\250!\360\034\000\t\037\230a\330\010\016\210a\320\017*\250!\2504\250v\260Q\260a\330\010\017\210v\220Q\220a\320\004.\250a\360\026\000\t\017\210a\320\017*\250!\2504\250v\260S\270\004\270A\270Q\320\004\026\220a\360\024\000\t\"\240\021\340\010\016\210a\320\017*\250!\2504\250w\260a\260q\330\010\017\210v\220Q\220a\320\004!\240\021\360\024\000\t\037\230a\330\010\016\210a\320\017\"\240!\2404\240w\250a\250q\330\010\017\210v\220Q\220a\320\004\036\230a\360\024\000\t#\240!\330\010\016\210a\320\017\"\240!\2404\240z\260\021\260!\330\010\017\210u\220A\220Q\320\004 \240\001\360""\024\000\t\033\230(\240!\330\010\036\230a\330\010\016\210a\320\017$\240A\240T\250\025\250a\250t\2601\260A\330\010\032\230!\330\010\014\210G\2209\230A\330\014\021\220\027\230\001\230\031\240!\2401\240A\240Q\330\010\017\210q\320\004\026\220a\360\024\000\t\017\210a\320\017 \240\001\240\024\240Q\320\004\036\230a\360\024\000\t\017\210a\210~\230Q\230d\240!\320\004\032\230!\360\024\000\t\037\230a\330\010\016\210a\320\017%\240Q\240d\250)\2601\260A\330\010\017\210u\220A\220Q\320\004#\240=\260\001\360\024\000\t'\240a\330\010\016\210a\210~\230Q\230d\240&\250\001\320\004\031\230\021\360\024\000\t'\240a\330\010\016\210a\210~\230Q\230d\240*\250A\250Q\330\010\017\210y\230\001\230\021\320\004\036\230a\360\024\000\t!\240\001\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\017\210u\220A\220Q\320\004\032\230!\360\026\000\t\037\230a\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\017\210u\220A\220Q\320\004*\250!\360\026\000\t\037\230a\330\010\016\210a\320\017-\250Q\250d\260%\260q\270\001\330\010\017\210v\220Q\220a\320\004\036\230a\360\024\000\t\033\230!\330\010\016\210a\210~\230Q\230d\240'\250\021\250!\330\010\017\210u\220A\220Q\320\004\032\230!\360\024\000\t\037\230a\330\010\016\210a\210~\230Q\230d\240'\250\021\250!\330\010\017\210v\220Q\220a\320\004)\250\021\360\024\000\t\037\230a\330\010\016\210a\320\017(\250\001\250\024\250U\260!\2601\330\010\017\210v\220Q\220a\320\004\032\230!\360\024\000\t\032\230\025\230a\330\010\016\210a\320\017(\250\001\250\024\250U\260!\2603\260a\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004.\250a\360\024\000\t\017\210a\320\017 \240\001\240\024\240U\250#\250Q\320\004+\320+@\300\001\360\036\000\t\037\230a\330\010\016\210a\320\017 \240\001\240\024\240V\2501\250A\340\010\020\220\016\230a\230t\2406\250\021\330\010\014\210I\220Q\220m\2401\330\010\017\210q\320\004(\250\001\360\024\000\t\037\230a\330\010\016\210a\320\017(\250\001\250\024\250V\2601\260A\330\010\017\210v\220Q\220a\320\004.\250a\360&\000\t\017\210a\320\017 \240\001""\240\024\240V\2501\250F\260!\2601\320\004.\250a\360,\000\t\017\210a\320\017 \240\001\240\024\240V\2501\250F\260!\2601\320\004\036\230a\340\010\016\210a\330\010\016\210a\320\004&\240a\360\026\000\t\017\210a\320\017)\250\021\250$\250a\320\004\032\230&\240\006\240a\360\036\000\t\037\230a\330\010\016\210a\210{\230!\2304\230v\240S\250\001\250\021\330\010\017\210v\220Q\220a\320\004)\250\035\260a\360\036\000\t'\240a\330\010\016\210a\210~\230Q\230d\240&\250\001\320\004\036\230a\360\032\000\t\037\230a\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\017\210v\220Q\220a\320\004.\250a\360\"\000\t\037\230a\330\010\036\230a\330\010\016\210a\320\017.\250a\250t\2606\270\021\270&\300\001\300\021\330\010\017\210v\220Q\220g\230V\2401\240A\320\004\036\230a\360\024\000\t'\240a\330\010\016\210a\210\177\230a\230t\2406\250\021\250!\330\010\017\210q\320\004\036\230a\360\024\000\t\037\230a\330\010\016\210a\320\017&\240a\240t\2506\260\021\260!\330\010\017\210v\220Q\220a\320\004&\240a\360\032\000\t\037\230a\330\010\016\210a\320\017&\240a\240t\2506\260\021\260!\330\010\017\210v\220Q\220a\320\004&\240a\360 \000\t\037\230a\330\010\016\210a\320\017)\250\021\250$\250e\2601\260A\330\010\017\210v\220Q\220a\320\004&\240a\360\"\000\t\037\230a\330\010\016\210a\320\017)\250\021\250$\250e\2601\260A\330\010\017\210v\220Q\220a\320\004\"\240!\360\024\000\t\033\230!\330\010\036\230a\330\010\036\230a\330\010\016\210a\320\017!\240\021\240$\240e\2501\250C\250q\260\006\260a\260q\330\010\031\230\033\240A\330\010\013\2105\220\003\2201\330\014\021\220\021\220'\230\021\230$\230a\230t\2404\240w\250i\260q\330\010\013\2105\220\003\2201\330\014\021\220\021\220'\230\021\230$\230a\230t\2404\240w\250i\260q\330\010\020\220\004\220A\320\004&\240a\360\026\000\t\017\210a\320\017.\250a\250t\2601\320\004\036\230a\360\024\000\t\017\210a\320\017&\240a\240t\2501\320\004\036\230a\360\024\000\t!\240\001\330\010\016\210a\320\017&\240a\240t\2504\250q\260\004\260A\260Q\330\010\017\210y\230\001\230\021\320\004\032\230!\360\024""\000\t\037\230a\330\010\016\210a\210\177\230a\230t\2405\250\001\250\021\330\010\017\210v\220Q\220a\320\004\036\230a\360\024\000\t\033\230'\240\021\330\010\016\210a\210\177\230a\230t\2406\250\021\250#\250Q\250a\330\010\020\220\005\220Q\220d\230%\230q\240\001\320\004\036\230a\360\024\000\t\033\230!\330\010\016\210a\210\177\230a\230t\2406\250\021\250!\330\010\017\210u\220A\220Q\320\004\036\230a\360\024\000\t\032\230\021\330\010\016\210a\210\177\230a\230t\2406\250\021\250!\330\010\017\210u\220A\220Q\320\004\032\230!\360\024\000\t\037\230a\330\010\016\210a\210\177\230a\230t\2407\250!\2501\330\010\017\210v\220Q\220a\320\004&\240a\360\024\000\t\017\210a\210\177\230a\230t\2407\250#\250Q\320\004&\240a\360\030\000\t\033\230!\330\010\016\210a\320\017)\250\021\250$\250e\2601\260A\330\010\017\210u\220A\220Q\320\004\"\240!\360\024\000\t\037\230a\330\010\016\210a\320\017!\240\021\240$\240e\2501\250A\330\010\017\210v\220Q\220a\320\004\036\230a\360\030\000\t!\240\001\330\010\016\210a\320\017!\240\021\240$\240e\2501\250A\330\010\017\210v\220Q\220a\320\004)\250\021\360\024\000\t\037\230a\330\010\016\210a\320\017)\250\021\250$\250f\260A\260Q\330\010\017\210v\220Q\220a\320\004!\240\021\340\010\036\230a\330\010\016\210a\320\017!\240\021\240$\240f\250A\250Q\330\010\017\210v\220Q\220a\320\004(\250\001\360\024\000\t\037\230a\330\010\016\210a\320\017)\250\021\250$\250g\260Q\260a\330\010\017\210v\220Q\220a\320\004&\240a\360\036\000\t\017\210a\320\017!\240\021\240$\240j\260\004\260A\320\004\031\230\021\360\024\000\t\017\210a\320\017(\250\001\250\021\250$\250a\330\010\017\210q\320\004\031\230\021\360\024\000\t\017\210a\320\017 \240\001\240\021\240$\240a\330\010\017\210q\320\004.\250a\360(\000\t\017\210a\320\017\037\230q\240\004\240E\250\021\250&\260\001\260\021\320\004.\250a\360\036\000\t\017\210a\320\017'\240q\250\004\250E\260\024\260Q\330\010\017\210q\320\004\036\230a\360\030\000\t#\240!\330\010\016\210a\320\017'\240q\250\004\250F\260!\2601\330\010\017\210u\220A\220Q\320\004\036\230a\360\024""\000\t\017\210a\320\017\037\230q\240\004\240G\2506\260\021\330\010 \240\004\240I\250Q\250a\330\010\017\210q\320\004\031\230\021\360\024\000\t\017\210a\320\017&\240a\240q\250\004\250A\330\010\017\210q\320\004(\320(>\270a\360\024\000\t*\250\035\260a\260q\330\010\016\210a\320\017!\240\021\240$\240e\2501\320\004\"\240!\360\024\000\t\017\210a\320\017.\250a\250t\2601\320\004\032\230!\360\024\000\t\017\210a\320\017&\240a\240t\2501\320\004\032\230!\360\024\000\t\017\210a\210\177\230a\230t\2401\320\004\032\230!\360\024\000\t\033\230'\240\021\330\010\032\230'\240\021\330\010\016\210a\210\177\230a\230t\2406\250\021\250#\250Q\250a\330\010\016\210a\210z\230\021\230$\230f\240A\240S\250\001\250\021\330\010\020\220\001\220\025\220a\220t\2305\240\001\240\026\240u\250A\250T\260\025\260a\260q\320\004\032\230!\360\024\000\t\033\230'\240\021\330\010\016\210a\210\177\230a\230t\2406\250\021\250!\330\010\016\210a\210z\230\021\230$\230f\240A\240Q\330\010\020\220\005\220Q\220d\230%\230q\240\001\320\004\032\230!\360\024\000\t#\240!\330\010\016\210a\320\017&\240a\240t\2506\260\026\260q\270\001\330\010\020\220\t\230\021\230!\330\010\016\210a\210y\230\001\230\021\330\010\017\210q\320\004\031\230\021\360\024\000\t*\250\021\330\010\016\210a\320\017&\240a\240t\2507\260!\2601\330\010\017\210y\230\001\230\021\320\004\026\220a\360\034\000\t\017\210a\210v\220Q\220d\230!\320\004\036\230a\360*\000\t!\240\001\330\010\016\210a\210v\220Q\220d\230&\240\003\2406\250\021\250!\330\010\017\210x\220q\230\001\320\004\026\220a\360\024\000\t\017\210a\210v\220Q\220d\230!\330\010\017\210q\320\004\036\230a\360\036\000\t\017\210a\210w\220a\220t\2305\240\002\240!\320\004\026\220a\360\024\000\t!\240\001\330\010\016\210a\210w\220a\220t\2306\240\021\240!\330\010\017\210x\220q\230\001\320\004 \240\001\360\036\000\t\037\230a\330\010\016\210a\210w\220a\220t\2307\240$\240g\250Q\250a\330\010\017\210v\220Q\220a\320\004\033\230;\240a\360\"\000\t!\240\010\250\001\250\021\330\010\016\210a\210x\220q\230\004\230F\240!\320\004\033\230;""\240a\360\024\000\t!\240\010\250\001\250\021\330\010\016\210a\210x\220q\230\004\230F\240!\320\004\036\230a\360\024\000\t\017\210a\210x\220q\230\004\230F\240\"\240A\320\004\036\230a\360\036\000\t\017\210a\210x\220q\230\004\230F\240\"\240A\320\004\036\230a\360@\001\000\t\017\210a\210x\220q\230\004\230F\240\"\240A\320\004\036\230a\360$\000\t\017\210a\210x\220q\230\004\230F\240\"\240A\320\004 \240\001\360\036\000\t\037\230a\330\010\016\210a\210x\220q\230\004\230F\240#\240V\2501\250A\330\010\017\210v\220Q\220a\320\004 \240\001\360\024\000\t\037\230a\330\010\016\210a\210x\220q\230\004\230F\240#\240V\2501\250A\330\010\017\210v\220Q\220a\320\004#\240;\250a\360\"\000\t!\240\010\250\001\250\021\330\010\016\210a\210x\220q\230\004\230F\240#\240W\250A\320\004\032\230!\360\024\000\t\037\230a\330\010\016\210a\210x\220q\230\004\230G\2401\240A\330\010\017\210v\220Q\220a\320\004\031\230\021\360\034\000\t\037\230a\330\010\016\210a\210y\230\001\230\024\230U\240!\2401\330\010\017\210v\220Q\220a\320\004\036\230a\360\024\000\t\017\210a\210y\230\001\230\024\230W\240B\240a\320\004.\250a\360&\000\t\017\210a\210z\230\021\230$\230f\240A\240V\2501\250F\260!\2601\320\004\030\230\001\360\024\000\t\037\230a\330\010\016\210a\210z\230\021\230$\230g\240Q\240a\330\010\017\210v\220Q\220a\320\004\036\230a\360\036\000\t\027\220b\230\001\330\010\016\210a\210u\220A\220T\230\027\240\004\240G\2501\250C\250q\330\010\017\210q\320\004\031\230\021\360\024\000\t!\240\001\330\010\016\210a\320\017!\240\021\240$\240d\250!\2504\250q\260\001\330\010\017\210y\230\001\230\021\320\004 \240\001\360\024\000\t\033\230!\330\010\016\210a\320\017!\240\021\240$\240e\2501\250A\340\010\016\210a\320\017\037\230q\240\004\240E\250\026\250q\330\010\017\210u\220A\220R\220v\230Q\230d\240!\2405\250\006\250a\250t\2601\260A\330\026\032\230'\240\031\250!\320\004\"\240!\360\032\000\t\033\230!\330\010\016\210a\320\017!\240\021\240$\240e\2501\250A\330\010\017\210u\220A\220Q\320\004 \240\001\360\024\000\t*\250\021\330\010\016\210a\320\017!""\240\021\240$\240e\2501\250A\330\010\017\210v\220Q\320\004\"\240!\360\024\000\t!\240\001\330\010\016\210a\320\017!\240\021\240$\240e\2501\250A\330\010\017\210y\230\001\230\021\320\004(\250\010\260\001\360\024\000\t\017\210a\320\017!\240\021\240$\240e\2507\260!\320\004\035\320\035.\250a\360\"\000\t\037\230f\240A\240Q\330\010\016\210a\210}\230A\230T\240\025\240f\250A\250Q\320\004!\240\021\360\036\000\t\017\210a\320\017!\240\021\240$\240f\250C\250q\320\004*\250!\360\024\000\t\017\210a\320\017!\240\021\240$\240f\250C\250q\320\004)\250\021\360\036\000\t\017\210a\320\017)\250\021\250$\250f\260D\270\001\320\004\"\240!\360\024\000\t!\240\001\330\010\016\210a\320\017)\250\021\250$\250h\260a\260q\330\010\017\210u\220A\220Q\320\004.\250a\360\036\000\t\037\230h\240a\240s\250(\260$\260a\330\010\016\210a\320\017*\250!\2504\250v\260W\270A\270S\300\001\320\004 \240\001\360\024\000\t\017\210a\320\017'\240q\250\004\250A\320\004 \240\001\360\024\000\t\017\210a\320\017\037\230q\240\004\240A\320\004\032\230!\360\024\000\t\017\210a\320\017\037\230q\240\004\240A\330\010\016\210a\210~\230Q\230d\240!\320\004 \240\001\360\024\000\t\017\210a\320\017\037\230q\240\004\240A\330\010\017\210q\320\004\"\240!\360\036\000\t\017\210a\320\017\037\230q\240\004\240E\250\022\2501\320\004)\250\021\360\"\000\t\017\210a\320\017\037\230q\240\004\240E\250\022\2501\340\010\014\210H\220A\330\014\021\220\026\220q\330\014\022\220!\320\023#\2401\240D\250\005\250R\250q\320\004 \240\001\360\024\000\t)\250\001\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\250!\330\010\017\210q\320\004*\250!\360\036\000\t\017\210a\320\017\037\230q\240\004\240E\250\026\250q\320\004 \240\001\360\024\000\t\033\230!\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\250!\330\010\017\210u\220A\220Q\320\004\036\230a\360\024\000\t\033\230%\320\037/\320/?\270q\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\016\210a\320\017 \240\001\240\024\240U\250!\2503\250a\250s\260!\2601\330\010\017\210z\230\021\230%\230s\240#\240Q""\320\004\036\230a\360 \000\t\030\220q\230\006\230a\330\010\016\210a\320\017!\240\021\240$\240e\2501\250A\250T\260\021\260!\2604\260q\270\001\270\024\270Q\270a\270q\320\004\036\230a\360\024\000\t \230q\330\010\016\210a\320\017\037\230q\240\004\240G\2501\250A\330\010\017\210u\220A\220Q\320\004,\320,>\270a\360\024\000\t\032\230\026\230q\330\010\020\220\001\220\030\230\021\230$\230a\230q\330\010\016\210a\320\017'\240q\250\004\250F\260$\260a\320\004\036\230a\360\"\000\t \230q\330\010\037\230q\330\010\037\230q\330\010\037\230q\330\010\016\210a\210\177\230a\230t\2405\250\001\250\027\260\001\260\027\270\001\270\027\300\001\300\021\330\010\033\2301\330\010\013\2106\220\023\220A\330\014\023\2207\230!\2301\340\014\023\2206\230\021\230!\330\010\033\2301\330\010\013\2106\220\023\220A\330\014\023\2207\230!\2301\340\014\023\2206\230\021\230!\330\010\020\220\006\220a\320\004&\240a\360\024\000\t\030\220r\230\021\330\010\016\210a\320\017)\250\021\250$\250e\2601\260D\270\001\330\010\017\210q\320\004\036\230a\360\022\000\t\030\220s\230!\330\010\016\210a\210\177\230a\230t\2406\250\021\250#\250Q\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\036\230a\360\024\000\t\030\220s\230!\330\010\016\210a\210\177\230a\230t\2406\250\021\250#\250Q\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\036\230a\360\022\000\t\030\220s\230!\330\010\016\210a\320\017)\250\021\250$\250l\270!\2703\270a\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\036\230a\360\"\000\t \230u\240A\240Q\330\010 \240\005\240Q\240a\330\010\016\210a\320\017\"\240!\2404\240u\250A\250X\260Q\260a\330\010\020\220\005\220Q\220i\230u\240A\240Q\320\000\021\220\026\320\027.\250a\360\026\000\005\010\200u\210E\320\021)\250\021\330\004\010\210\005\320\r#\2401\330\004\032\230!\330\004\007\200u\210C\210q\330\010\017\210q\330\004\014\210G\2201\220F\230!\330\004\007\200v\210S\220\001\330\010\016\210j\230\001\230\021\330\004\n\210!\320\013\033\2301\230G\2401\320\004\026\220a\340\010\037\230w\240a\330\010""\016\210a\210~\230Q\230d\240&\250\001\250\027\260\001\330\010\017\210q\320\004\"\240(\250!\360\036\000\t\"\240\025\240a\240q\330\010\016\210a\320\017 \240\001\240\024\240U\250!\320\004\031\230\021\360\024\000\t\017\210a\210y\230\001\230\024\230Q\320\004\031\230\021\360\024\000\t!\240\001\330\010\016\210a\210y\230\001\230\024\230U\240!\2401\330\010\017\210y\230\001\230\021\320\004!\240\021\360\024\000\t!\240\001\330\010\016\210a\210y\230\001\230\024\230V\2403\240f\250A\250Q\330\010\017\210x\220q\230\001\320\004\031\230\021\360\024\000\t\033\230!\330\010\016\210a\210y\230\001\230\024\230W\240A\240Q\330\010\017\210u\220A\220Q\320\004\031\230\021\360\024\000\t!\240\001\330\010\016\210a\210y\230\001\230\024\230W\240A\240Q\330\010\017\210y\230\001\230\021\320\004\031\230\021\360\024\000\t\017\210a\210y\230\001\230\021\230$\230a\330\010\014\210F\220!\330\010\017\210q\320\004\031\230\021\360\024\000\t\017\210a\210y\230\001\230\021\230$\230a\330\010\017\210q\320\004\031\230\021\360\024\000\t\017\210a\210z\230\021\230!\2304\230q\330\010\017\210q\320\004\031\230\021\360\024\000\t\017\210a\210z\230\021\230$\230a\320\004\032\230!\360\024\000\t\017\210a\210z\230\021\230$\230a\320\004(\250\001\360\"\000\t\017\210a\210z\230\021\230$\230e\2401\240F\250!\2501\320\004!\240\021\360\036\000\t\017\210a\210z\230\021\230$\230e\2402\240Q\320\004 \240\010\250\001\360\036\000\t!\240\001\330\010!\240\021\330\010\020\220\t\230\021\230'\240\021\240!\330\010\016\210a\210z\230\021\230$\230e\2406\250\021\250!\330\010\030\230\006\230a\330\010\016\210a\210|\2301\230D\240\005\240V\2501\250E\260\021\330\010\017\210q\320\004\031\230\021\360\024\000\t\033\230!\330\010\016\210a\210z\230\021\230$\230f\240A\240Q\330\010\017\210u\220A\220Q\320\004\031\230\021\360\024\000\t\"\240\021\330\010\016\210a\210z\230\021\230$\230f\240A\240Q\330\010\017\210y\230\001\230\021\320\004\031\230\021\360\024\000\t#\240!\330\010\016\210a\210z\230\021\230$\230f\240A\240Q\330\010\017\210y\230\001\230\021\320\004\031\230\021""\360\024\000\t\033\230'\240\021\330\010\016\210a\210z\230\021\230$\230f\240A\240S\250\001\250\021\330\010\020\220\005\220Q\220d\230%\230q\240\001\320\004\"\240!\360\024\000\t!\240\001\330\010\016\210a\210z\230\021\230$\230f\240C\240v\250Q\250a\330\010\017\210x\220q\230\001\320\004!\240\021\360\024\000\t\017\210a\210z\230\021\230$\230g\240S\250\001\320\004\030\230\001\360\024\000\t\017\210a\210z\230\021\230$\230g\240V\2501\330\010\032\230$\230i\240q\250\001\330\010\017\210q\320\004*\250'\260\031\270!\360\036\000\t\027\220b\230\001\330\010\035\230Q\330\010\016\210a\320\017#\2401\240D\250\005\250U\260!\2603\260a\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004!\240\021\360\"\000\t\027\220b\230\001\330\010\035\230Q\330\010\016\210a\320\017 \240\001\240\024\240U\250!\2505\260\001\260\023\260A\330\010\016\210a\210{\230!\2303\230a\330\010\020\220\006\220a\220v\230Q\320\004\"\240'\250\021\360(\000\t\027\220b\230\001\330\010\016\210a\210|\2301\230D\240\007\240t\2507\260!\2603\260a\330\010\017\210q\320\004!\240\027\250\001\360(\000\t\027\220b\230\001\330\010\016\210a\210{\230!\2304\230w\240d\250'\260\021\260#\260Q\330\010\017\210q\320\004 \240\001\360\"\000\t\027\220b\230\001\330\010\016\210a\210~\230Q\230d\240%\240r\250\025\250a\250s\260!\330\010\017\210q\320\004 \240\001\360\024\000\t\027\220b\230\001\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\250#\250Q\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004!\240\021\360.\000\t\027\220b\230\001\330\010\016\210a\210x\220q\230\004\230G\2404\240w\250a\250s\260!\330\010\017\210q\320\004!\240\021\360\024\000\t\027\220c\230\021\330\010\016\210a\320\017#\2401\240D\250\005\250Q\250b\260\001\330\010\017\210q\320\004 \240\001\360\024\000\t\027\220c\230\021\330\010\016\210a\320\017\"\240!\2404\240u\250A\250R\250q\330\010\017\210q\320\004\"\240!\360\024\000\t\027\220c\230\021\330\010\016\210a\320\017(\250\001\250\024\250U\260!\2602\260Q\330\010\017\210q\320\004\"\240!\360\032\000\t\027\220c\230\021\330""\010\016\210a\320\017&\240a\240t\2505\260\001\260\022\2601\330\010\017\210q\320\004!\240\021\360\024\000\t\027\220d\230!\2305\240\001\330\010\016\210a\320\017 \240\001\240\024\240U\250!\2503\250a\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004!\240\030\250\021\360\024\000\t\037\230e\2401\240A\330\010\016\210a\320\017%\240Q\240d\250&\260\001\320\004 \240\010\250\001\360\024\000\t\037\230e\2401\240A\330\010\016\210a\320\017%\240Q\240d\250&\260\001\320\004\037\230{\250(\260!\360<\000\t\037\230e\2401\240A\330\010\036\230e\2401\240A\330\010\026\220b\230\001\330\010\016\210a\210|\2301\230D\240\007\240w\250g\260Q\260c\270\021\330\010\017\210q\320\004-\250]\270&\300\001\360.\000\t\037\230e\2401\240A\330\010\037\230s\240!\330\010\030\230\002\230!\330\010\016\210a\320\017,\250A\250T\260\025\260f\270A\270[\310\006\310a\310u\320TU\330\010\020\220\r\230Q\320\004!\240\031\250!\360\036\000\t\037\230f\240A\240Q\330\010\016\210a\320\017\"\240!\2404\240u\250A\320\004(\250\t\260\021\360&\000\t\037\230f\240A\240Q\330\010\016\210a\320\017%\240Q\240d\250%\250q\320\004(\250\t\260\021\360 \000\t\037\230f\240A\240Q\330\010\016\210a\320\017%\240Q\240d\250%\250q\320\004)\250\031\260!\360 \000\t\037\230f\240A\240Q\330\010\016\210a\320\017)\250\021\250$\250e\2601\330\010\t\320\004)\250\031\260!\360\036\000\t\037\230f\240A\240Q\330\010\016\210a\320\017'\240q\250\004\250F\260!\330\010\017\210q\320\004\030\230\n\240!\360\036\000\t\037\230f\240A\240Q\330\010\016\210a\210y\230\001\230\024\230V\2401\320\004\030\230\n\240!\360\024\000\t\037\230f\240A\240Q\330\010\016\210a\210y\230\001\230\024\230V\2406\250\035\260a\320\004)\250\035\260f\270A\360*\000\t\"\240\025\240a\240q\330\010\025\220R\220q\330\010!\240\021\330\010\016\210a\320\017&\240a\240t\2505\260\001\330'(\250\002\250%\250q\260\001\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\004&\240g\250Y\260a\360\024\000\t\037\230a\330\010\016\210a\320\017#\2401\240D\250\007\250q\320\004&\240g\250Z\260q\360""\036\000\t\031\230\005\230W\240A\330\010!\240\021\330\010\016\210a\210\177\230a\230t\2406\250\021\250#\250Q\330\010\016\210a\210z\230\021\230$\230f\240F\250!\2501\330\010\016\210a\210~\230Q\230d\240&\250\001\250\021\330\010\013\2101\330\014\022\220!\320\023'\240q\250\004\250F\3202G\300q\310\001\340\014\022\220!\320\023#\2401\240D\250\006\250a\250q\330\010\033\2301\330\010\034\230E\240\021\330\010\031\320\0310\260\016\270a\340\010\014\210A\210U\220*\230C\230w\240a\240u\250J\260a\330\010\014\210A\210U\220*\230C\230w\240a\240u\250K\260s\270!\2701\330\010\035\230[\250\001\250\037\270\t\300\021\330)/\250y\270\001\330)/\250z\270\027\300\001\330\010\021\220\021\220+\230Q\330\010\035\230Q\230g\240Q\330\010\013\2101\330\014\022\220!\320\023+\2501\250D\260\006\3206K\3101\310A\340\014\022\220!\320\023'\240q\250\004\250F\260!\2601\330\010\017\210q\320\004\036\230h\240a\360\036\000\t\034\2305\240\001\240\021\330\010\035\230Q\330\010\036\230a\330\010\016\210a\320\017!\240\021\240$\240e\2504\250q\260\006\260a\260q\330\010\t\330\014\030\230\007\230q\240\006\240a\340\014\022\220!\2209\230A\230Q\330\010\017\210q\320\004.\250h\260a\360\036\000\t\034\2305\240\001\240\021\330\010 \240\005\240Q\240a\330\010\016\210a\320\0172\260!\2604\260u\270D\300\001\300\021\330\010\017\210u\220A\220Q\320\004&\240h\250a\360\"\000\t\034\2305\240\001\240\021\330\010\016\210a\320\017$\240A\240T\250\025\250a\320\004&\240h\250a\360\036\000\t$\2405\250\001\250\021\330\010\016\210a\320\017'\240q\250\004\250F\260!\320\004&\240h\250a\360\036\000\t\034\2305\240\001\240\021\330\010!\240\025\240a\240q\330\010\"\240!\330\010\034\230A\330\010\016\210a\320\017*\250!\2504\250u\260D\270\001\270\032\3001\300A\330\010\022\220%\220q\230\001\330\010\014\210G\2209\230I\240W\250G\2601\260E\270\021\270(\300!\3001\330\010\017\210q\320\004&\240h\250a\360&\000\t\035\230E\240\021\240!\330\010\016\210a\320\017%\240Q\240d\250%\250q\320\004&\240h\250a\360.\000\t!\240\005\240Q\320&8\270\n\300!\330\010\016\210a\320\017$\240A\240T\250""\025\250i\260q\270\010\300\001\300\021\330\010\020\220\005\220Q\220i\230u\240A\240Q\320\004&\240h\250a\360 \000\t&\240Q\330\010\024\220I\230Q\230k\250\021\250!\330\010\016\210a\210~\230Q\230d\240%\240q\320\004\036\230h\240a\360\"\000\t!\240\005\240Q\240a\330\010 \240\001\330\010\016\210a\210|\2301\230D\240\006\240c\250\021\250&\260\001\260\021\330\010\017\210x\220q\230\001\320\004.\250h\260a\360 \000\t\036\230U\240!\2401\330\010\016\210a\320\017+\2501\250D\260\005\260Q\320\004&\240h\250a\340\010\035\230U\240!\2401\330\010\016\210a\320\017$\240A\240T\250\026\250q\320\004&\240h\250a\360\024\000\t\036\230U\240!\2401\330\010\016\210a\320\017$\240A\240T\250\026\250q\320\004&\240h\250a\360\030\000\t\036\230U\240!\2401\330\010\016\210a\320\017%\240Q\240d\250'\260\021\320\004&\240h\250a\360\024\000\t\036\230U\240!\2401\330\010\016\210a\210~\230Q\230d\240%\240q\320\004&\240h\250a\360\036\000\t\036\230U\240!\2401\330\010\016\210a\320\017 \240\001\240\024\240U\250!\320\004&\240h\250a\360\036\000\t\036\230U\240!\2401\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\320\004&\240h\250a\360\036\000\t\036\230U\240!\2401\330\010\016\210a\320\017/\250q\260\004\260L\300\001\320\004&\240h\250a\360\036\000\t'\240a\330\010\"\240!\330\010#\2401\330\010\024\220I\230Q\230k\250\021\250!\330\010\016\210a\320\017\"\240!\2404\240u\250L\270\001\270\033\300A\300W\310I\320UV\320\004&\240h\250a\360\036\000\t\"\240\025\240a\240q\330\010\036\230a\330\010\016\210a\320\017$\240A\240T\250\032\260:\270Q\270a\330\010\017\210u\220A\220Q\320\004\036\230h\240a\360\036\000\t\"\240\025\240a\240q\330\010!\240\021\330\010!\240\021\330\010\016\210a\210z\230\021\230$\230e\2406\250\021\250&\260\001\260\021\330\010\017\210u\220C\220q\330\010\034\230N\250!\2505\260\001\330\010\r\210T\220\021\220%\220q\330\010\016\210a\210{\230!\2305\240\001\330\010\020\220\007\220q\320\004&\240h\250a\360\026\000\t \230u\240A\240Q\330\010\033\2304\230q\330\010\016\210a\320\017#\2401\240D\250\007\250x\260q\270\006\270a\330\010""\016\210a\210{\230!\2306\240\021\330\010\017\210q\320\004\036\230h\240a\360\024\000\t \230u\240A\240Q\330\010\016\210a\320\017%\240Q\240d\250)\2601\320\004\036\230h\240a\360\036\000\t \230u\240A\240Q\330\010\016\210a\320\017%\240Q\240d\250,\260a\320\004\036\230h\240a\360 \000\t \230u\240A\240Q\330\010\016\210a\320\017&\240a\240t\2507\260!\320\004\036\230h\240a\360\036\000\t \230u\240A\240Q\330\010!\240\021\330\010\016\210a\210\177\230a\230t\240:\250X\260Q\260a\330\010\017\210v\220Q\220a\320\004\036\230h\240a\360\"\000\t \230u\240A\240Q\330\010!\240\021\330\010\016\210a\210\177\230a\230t\240:\250X\260Q\260a\330\010\017\210v\220Q\220a\320\004(\250\016\260h\270a\360\"\000\t \230u\240A\240Q\330\010!\240\025\240a\240q\330\010\016\210a\320\017-\250Q\250d\260&\270\010\300\001\320\004#\240;\250h\260a\360\"\000\t \230u\240A\240Q\330\010\036\230e\2401\240A\330\010\016\210a\320\017\037\230q\240\004\240F\250(\260!\320\004\036\230h\240a\360&\000\t \230u\240A\240Q\330\010\037\230q\330\010\016\210a\210\177\230a\230t\240:\250X\260Q\260a\330\010\017\210u\220A\220Q\320\004&\240h\250a\360\036\000\t \230u\240A\240Q\330\010\037\230s\240!\330\010\016\210a\320\017!\240\021\240$\240e\2508\2601\260K\270q\330\010\016\210a\210{\230!\230;\240a\330\010\017\210q\320\004\"\240,\250h\260a\360\"\000\t \230u\240A\320%5\260Q\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\210\177\230a\230t\2405\250\007\250x\260q\270\001\330\010\017\210u\220A\220Q\320\004&\240h\250a\360\036\000\t \230u\240A\320%7\260q\330\010\016\210a\320\017+\2501\250D\260\006\260h\270a\270q\330\010\017\210u\220A\220Q\320\004\033\230>\250\031\260!\360\036\000\t\037\230h\240a\240v\250Q\330\0100\260\001\330\010\016\210a\320\017$\240A\240W\250A\250Q\330\010\016\210a\320\017%\240Q\240a\240t\2501\330\010\014\210L\230\001\330\010\017\210q\320\004\033\230>\250\031\260!\360@\001\000\t\037\230h\240a\240v\250Q\330\010#\2401\330\010\016\210a\320\017!\240\021\240'\250\021\250!\330\010\016\210a\210z\230\021\230$""\230h\240d\250'\260\021\330\010\017\210q\320\004\033\230>\250\031\260!\360\036\000\t\037\230h\240a\240v\250Q\330\010\035\230Q\330\010\016\210a\210|\2301\230G\2401\240A\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\004\033\230>\250\031\260!\360\"\000\t\037\230h\240a\240v\250Q\330\010%\240Q\330\010\016\210a\320\017#\2401\240G\2501\250A\330\010\016\210a\210z\230\021\230$\230h\240d\250-\260q\330\010\017\210q\320\004\033\230>\250\031\260!\360\036\000\t\037\230h\240a\240v\250Q\330\010\035\230Q\330\010\016\210a\210}\230A\230W\240A\240Q\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\004\033\230>\250\031\260!\360\"\000\t\037\230h\240a\240v\250Q\330\010\035\230Q\330\010\016\210a\210}\230A\230W\240A\240Q\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\004\033\230>\250\031\260!\360\036\000\t\037\230h\240a\240v\250Q\330\010\035\230Q\330\010\016\210a\320\017 \240\001\240\027\250\001\250\021\330\010\016\210a\210z\230\021\230$\230a\330\010\014\210F\220!\330\010\017\210q\320\004\033\230>\250\031\260!\360&\000\t\037\230h\240a\240v\250Q\330\010\035\230Q\330\010\016\210a\210x\220q\230\007\230q\240\001\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\016\210a\210y\230\001\230\024\230U\240!\330\010\017\210q\320\004\033\230>\250\031\260!\360&\000\t\037\230h\240a\240v\250Q\330\010\035\230Q\330\010\016\210a\210x\220q\230\007\230q\240\001\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\004\033\230>\250\031\260!\360$\000\t\037\230h\240a\240v\250Q\330\010\035\230Q\330\010\016\210a\210x\220q\230\007\230q\240\001\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\004\033\230>\250\031\260!\360\036\000\t\037\230h\240a\240v\250Q\330\010\035\230Q\330\010\016\210a\210x\220q\230\007\230q\240\001\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\004\033\230>\250\031\260!\360\036\000\t\037\230h\240a\240v""\250Q\330\010)\250\021\330\010\016\210a\320\017#\2401\240G\2501\250A\330\010\016\210a\210z\230\021\230$\230h\240d\250*\260A\330\010\017\210q\320\004\033\230>\250\031\260!\360\024\000\t\037\230h\240a\240v\250Q\330\010*\250!\330\010\016\210a\320\017$\240A\240W\250A\250Q\330\010\016\210a\210z\230\021\230$\230a\330\010\014\210F\220!\330\010\017\210q\320\004\033\230>\250\031\260!\360\036\000\t\037\230h\240a\240v\250Q\330\010\016\210a\320\017$\240A\240W\250A\250T\260\021\330\010\017\210q\320\004\033\230>\250\031\260!\360\036\000\t\037\230h\240a\240v\250Q\330\010\016\210a\320\017 \240\001\240\027\250\001\250\024\250Q\330\010\017\210q\320\004\033\230>\250\031\260!\360\"\000\t\037\230h\240a\240v\250Q\330\010(\250\001\330\010\016\210a\320\017%\240Q\240g\250Q\250a\330\010\016\210a\210z\230\021\230$\230h\240d\250(\260!\330\010\017\210q\320\004\033\230>\250\031\260!\360\036\000\t\037\230h\240a\240v\250Q\330\010\"\240!\330\010\016\210a\320\017 \240\001\240\027\250\001\250\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004\033\230>\250\031\260!\360\"\000\t\037\230h\240a\240v\250Q\330\010 \240\001\330\010\016\210a\320\017\037\230q\240\007\240q\250\001\330\010\016\210a\210z\230\021\230$\230h\240d\250)\2601\330\010\017\210q\320\004#\240>\260\031\270!\360\036\000\t\037\230h\240a\240v\250Q\340\010\016\210a\320\017/\250q\260\007\260t\2701\320\004\033\230>\250\031\260!\360\036\000\t\037\230h\240a\240v\250Q\330\010!\240\021\330\010\016\210a\210z\230\021\230'\240\021\240!\330\010\016\210a\210z\230\021\230$\230h\240d\250(\260!\330\010\017\210q\320\004\033\230>\250\031\260!\360\036\000\t\037\230h\240a\240v\250Q\330\010'\240q\330\010\016\210a\320\017$\240A\240W\250A\250Q\330\010\016\210a\210z\230\021\230$\230h\240d\250(\260!\330\010\017\210q\320\004\033\230>\250\031\260!\360\036\000\t\037\230h\240a\240v\250Q\330\010\037\230q\330\010\016\210a\210x\220q\230\007\230q\240\001\330\010\016\210a\210z\230\021\230$\230h\240d\250(\260!\330\010\017\210q\320\004\033""\230>\250\031\260!\360\"\000\t\037\230h\240a\240v\250Q\330\010\037\230q\330\010\016\210a\210y\230\001\230\027\240\001\240\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004\033\230>\250\031\260!\360(\000\t\037\230h\240a\240v\250Q\330\010\037\230q\330\010\016\210a\210y\230\001\230\027\240\001\240\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004\033\230>\250\031\260!\360\024\000\t\037\230h\240a\240v\250Q\330\010\037\230q\330\010\016\210a\210y\230\001\230\027\240\001\240\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004\033\230>\250\031\260!\360\036\000\t\037\230h\240a\240v\250Q\330\010\037\230q\330\010\016\210a\210y\230\001\230\027\240\001\240\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004$\320$>\270i\300{\320R^\320^g\320gh\360.\000\t\032\230\026\230q\330\010 \240\010\250\001\250\021\330\010\033\230;\240a\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\210:\220Q\220f\230A\330\014\022\220!\320\023'\240q\250\004\250G\2604\260u\270G\3006\310\026\310q\340\014\023\2208\2301\230F\240!\2404\240q\250\001\330\014\022\220!\320\023%\240Q\240d\250&\260\004\260C\260v\270V\3001\320\004&\240i\250q\3600\000\t \230q\330\010\013\2107\220'\230\026\230z\250\026\250q\330\010\031\230\022\2301\330\010\016\210a\210\177\230a\230t\2407\250)\2601\260F\270!\330\010\017\210q\320\004\035\320\035.\250i\260q\3602\000\t\014\2105\220\003\2206\230\027\240\001\330\010\013\2105\220\010\230\006\230e\2401\330\014\022\220*\230A\230Q\340\010\034\230A\330\t\026\220k\240\026\240w\250k\3209K\3101\310A\330\010\023\220<\230s\240!\340\010+\320+=\270V\3001\300A\330\010#\2401\240J\250a\330\010\036\230a\330\010&\240a\330\010\021\220\037\240\001\360\014\000\t\014\2105\220\003\2201\330\014\017\210q\330\020\026\220a\320\027'\240q\250\004\250F\260/\300\021\300!\330\020\026\220a\320\027+\2501\250D\260\006\260a\340\020""\026\220a\320\0271\260\021\260$\260f\270O\3101\310C\310q\330\020\026\220a\320\0275\260Q\260d\270&\300\001\330\r\022\220#\220Q\330\014\017\210q\330\020\026\220a\220\177\240a\240t\2506\3201F\300a\300q\330\020\026\220a\320\027*\250!\2504\250v\260Q\340\020\026\220a\320\0270\260\001\260\024\260V\320;P\320PQ\320QT\320TU\330\020\026\220a\320\0274\260A\260T\270\026\270q\340\014\017\210q\330\020\026\220a\220{\240!\2404\240v\250_\270A\270Q\330\020\026\220a\220\177\240a\240t\2506\260\021\340\020\026\220a\320\027,\250A\250T\260\026\260\177\300a\300s\310!\330\020\026\220a\320\0270\260\001\260\024\260V\2701\330\010\021\220\030\230\030\240\021\340\010\036\230a\230y\250\001\330\010\013\210?\230!\330\010\013\210=\230\001\330\010\030\230\n\240&\250\001\250\037\270\001\270\021\270!\2701\330\010\014\210E\220\025\220a\220q\330\014\031\230\021\230%\230u\240A\240Q\330\010\014\210E\220\025\220a\220q\330\014\031\230\021\230!\2301\230H\240G\2501\250A\330\010\021\220\030\230\025\230a\330\010\021\220\031\230!\330\010\021\220\033\230N\250\"\250A\340\010!\240\021\240)\2501\330\010\r\210X\320\025,\250A\330\010\013\320\013\037\230s\240!\330\014\021\220\030\230\031\240!\330\r!\240\023\240A\330\014\021\220\030\230\031\240!\340\014\022\220*\230A\230Q\330\010\r\210Y\220j\240\001\330\010\022\220/\240\030\250\024\250Q\330\010\016\210a\320\017#\2401\240M\260\024\260Q\330\010\022\320\022%\240Q\330\010\022\220+\320\0355\260Q\330\010\017\210}\230A\230\\\250\034\260Q\320\004\036\230i\240q\340\010\013\2101\330\014\022\220!\320\023(\250\001\250\024\250Q\340\014\022\220!\320\023*\250!\2504\250q\320\004\036\230i\240q\360\036\000\t\014\2101\330\014\022\220!\320\023(\250\001\250\024\250Q\340\014\022\220!\320\023*\250!\2504\250q\320\004\035\320\035.\250i\260q\340\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2105\220\010\230\006\230e\2401\330\014\022\220*\230A\230Q\340\010\034\230A\330\t\026\220k\240\026\240w\250k\3209K\3101\310A\330\010\023\220<\230s\240!\340""\010+\320+=\270V\3001\300A\330\010#\2401\240J\250a\330\010\036\230a\330\010&\240a\330\010\021\220\037\240\001\360\014\000\t\014\2105\220\003\2201\330\014\017\210q\330\020\026\220a\320\027,\250A\250T\260\026\260\177\300a\300q\330\020\026\220a\320\0270\260\001\260\024\260V\2701\340\020\026\220a\320\0276\260a\260t\2706\300\037\320PQ\320QT\320TU\330\020\026\220a\320\027:\270!\2704\270v\300Q\330\r\022\220#\220Q\330\014\017\210q\330\020\026\220a\320\027+\2501\250D\260\006\3206K\3101\310A\330\020\026\220a\320\027/\250q\260\004\260F\270!\340\020\026\220a\320\0275\260Q\260d\270&\320@U\320UV\320VY\320YZ\330\020\026\220a\320\0279\270\021\270$\270f\300A\340\014\017\210q\330\020\026\220a\320\027'\240q\250\004\250F\260/\300\021\300!\330\020\026\220a\320\027+\2501\250D\260\006\260a\340\020\026\220a\320\0271\260\021\260$\260f\270O\3101\310C\310q\330\020\026\220a\320\0275\260Q\260d\270&\300\001\330\010\021\220\030\230\030\240\021\340\010\036\230a\230y\250\001\330\010\013\210?\230!\330\010\013\210=\230\001\330\010\030\230\n\240&\250\001\250\037\270\001\270\021\270!\2701\330\010\014\210E\220\025\220a\220q\330\014\031\230\021\230%\230u\240A\240Q\330\010\014\210E\220\025\220a\220q\330\014\031\230\021\230!\2301\230H\240G\2501\250A\330\010\021\220\030\230\025\230a\330\010\021\220\031\230!\330\010\021\220\033\230N\250\"\250A\340\010!\240\021\240)\2501\330\010\r\210X\320\025,\250A\330\010\013\320\013\037\230s\240!\330\014\021\220\030\230\031\240!\330\r!\240\023\240A\330\014\021\220\030\230\031\240!\340\014\022\220*\230A\230Q\330\010\r\210Y\220j\240\001\330\010\022\220/\240\030\250\024\250Q\330\010\016\210a\320\017#\2401\240M\260\024\260Q\330\010\022\320\022%\240Q\330\010\022\220+\320\0355\260Q\330\010\017\210}\230A\230\\\250\034\260Q\320\004.\250i\260q\360\"\000\t\014\2105\220\003\2206\230\027\240\001\330\010\016\210a\320\017)\250\021\250$\250f\260D\270\006\270d\300!\320\004\036\230i\240q\360$\000\t\014\2107\220#\220Q\330\014\025\220T\230\021\230%\230q\330\010\013\2106\220\025\220c\230\021""\330\014\022\220!\220<\230q\240\004\240F\250!\2506\260\021\330\010\016\210a\210w\220a\220t\2306\240\026\240q\330\010\017\210q\320\004&\240i\250q\360\"\000\t\036\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\016\210a\210~\230Q\230d\240'\250\026\250q\260\001\320\004.\250i\260q\340\010\030\230\001\230\024\230V\2403\240c\250\023\250F\260#\260Q\320\004 \240\016\250i\260q\360\024\000\t\017\210a\210|\2301\230D\240\006\240h\250a\320\004\"\240,\250i\260q\360\"\000\t\034\230;\240a\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\016\210a\320\017\037\230q\240\004\240F\250&\260\001\320\004\036\230i\240q\360\024\000\t\037\230a\330\010\013\2106\220\027\230\001\330\010\016\210a\320\017%\240Q\240d\250%\250q\320\004!\240\035\250i\260q\360&\000\t\027\220c\230\021\330\010!\240\021\330\010\021\220\021\220&\230\001\230\021\330\010\013\2106\220\023\220A\330\014\022\220!\320\023(\250\001\250\024\250U\260'\270\021\270\"\270A\340\014\022\220!\320\023#\2401\240D\250\005\250Q\250b\260\001\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004&\240i\250q\360\"\000\t\037\230f\240A\240Q\330\010\016\210a\320\017$\240A\240T\250\025\250a\320\004\034\320\034.\250i\260q\360\036\000\t'\240h\250a\250q\340\010\016\210a\210z\230\021\230$\230f\240G\2501\250A\330\010\017\210q\320\004&\240i\250q\360\036\000\t \230q\330\010\013\2106\220\030\230\021\330\010\016\210a\320\017\"\240!\2404\240u\250A\320\004!\240\035\250i\260q\360*\000\t \230q\330\010\013\2106\220\027\230\006\230i\240u\250A\250Q\330\010\016\210a\320\017'\240q\250\005\250X\260T\270\025\270a\270q\330\010\017\210q\320\004&\240i\250q\360 \000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\210|\2301\230D\240\006\240a\320\004&\240i\250q\360\036\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\210|\2301\230D\240\006\240a\320\004,\320,>\270i\300q\360*\000\t \230q\330\010\013\210:\220S\230\001\360\006\000\r\026\220U\230!\2301\330\010\037\230q""\330\010\013\210:\220S\230\001\360\006\000\r\026\220U\230!\2301\330\010\016\210a\210|\2301\230D\240\005\240X\250X\260R\260q\320\004!\240\035\250i\260q\360$\000\t\020\210v\220Q\220d\230&\240\017\250t\2609\270F\300!\320\004&\240j\260\001\360\024\000\t\035\230F\240!\2401\330\010\016\210a\320\0170\260\001\260\024\260X\270Q\320\004\031\230\021\360\"\000\t\037\230j\250\001\330\010\016\210a\210\177\230a\230t\2407\250!\2507\260!\2601\330\010\020\220\005\220Q\220h\230e\2401\240A\320\004.\250j\270\001\360 \000\t\037\230f\240A\240Q\330\010\016\210a\320\017-\250Q\250d\260%\260q\320\004.\250j\270\001\360\024\000\t\037\230f\240A\240Q\330\010\016\210a\320\017(\250\001\250\024\250V\2601\320\004\036\230j\250\001\360&\000\t\037\230f\240A\240Q\330\010\016\210a\210\177\230a\230t\2405\250\001\320\004#\240;\250k\270\021\360\"\000\t\034\2305\240\001\240\021\330\010\025\220Q\330\010\016\210a\320\017'\240q\250\004\250E\260\024\260^\3002\300Q\320\004!\240\021\360\024\000\t\037\230k\250\021\330\010 \240\001\330\010 \240\001\330\010\016\210a\210~\230Q\230d\240&\250\001\250\027\260\001\260\021\330\010\036\230h\240a\240w\250a\250x\260v\270X\300Q\300a\330\010\036\230h\240a\240w\250a\250x\260v\270X\300Q\300a\330\010\016\210a\320\017!\240\021\240$\240f\250I\260Q\330\010\024\220A\220V\2301\230G\2401\240D\250\004\250G\2609\270A\330\010\024\220A\220V\2301\230G\2401\240D\250\004\250G\2609\270A\330\010\017\210{\230!\320\004)\250\021\360\026\000\t\037\230k\250\021\330\010\016\210a\320\017)\250\021\250$\250f\260A\260W\270A\270Q\330\010\020\220\005\220Q\220h\230e\2401\240A\320\004&\240l\3202I\320Ig\320gu\360\000\000v\001B\002\360\000\000B\002P\002\360\000\000P\002Y\002\360\000\000Y\002Z\002\3600\000\t \230x\240q\250\006\250a\330\010 \240\001\330\010\037\230q\330\010\036\230e\2401\240A\330\010\"\240!\330\010$\240A\330\010'\240q\330\010%\240Q\330\010!\240\021\330\010'\240q\330\010\035\320\035.\250a\320/C\3001\300A\330\010\021\320\021!\240\021\240(\320*:\270!\330\010\021\320\021!\240\021\240(\320*:\270!\330""\010\013\210<\220q\230\007\230s\240#\240V\250:\260Q\330\021\022\330\"%\240\\\260\021\260!\330\010\013\210<\220q\230\010\240\003\2403\240f\250J\260a\330\021\022\330#&\240l\260!\2601\330\010\027\220{\240+\250Q\250g\260Q\330\010\027\220{\240+\250Q\250g\260Q\330\010\027\220{\240+\250Q\250h\260a\330\010\027\220{\240+\250Q\250h\260a\330\010\027\220|\240<\250q\260\001\330\010\027\220}\240L\260\001\260\021\330\010\016\210a\320\017,\250A\250W\260F\270*\300A\330-9\270\030\300\021\330-7\260~\300Q\300a\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\004\036\230l\250!\360@\001\000\t\017\210a\210|\2301\230D\240\006\240a\320\004\036\230l\250(\260!\360*\000\t \230u\240A\240Q\330\010\037\230u\240A\240Q\330\010\016\210a\210\177\230a\230t\240:\250X\260Q\320\004&\240l\260(\270!\360\"\000\t \230u\240A\240Q\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\320\017\"\240!\2404\240u\250G\2601\320\004\"\240,\250l\270(\300!\360&\000\t \230u\240A\320%6\260e\2701\270A\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\210\177\230a\230t\2405\250\007\250x\260q\320\004\036\230l\250&\260\t\270\026\270v\300Q\360&\000\t\037\230e\2401\240A\330\010\037\230u\240A\240Q\330\010\036\230e\2401\240A\330\010\016\210a\320\017 \240\001\240\024\240W\250G\2608\2701\320\004\036\230m\2501\360\036\000\t\035\230E\240\021\240!\330\010\035\230Q\330\010\032\230!\330\010\032\230!\330\010\032\230!\330\010\017\210v\220Q\220h\230a\230s\240!\2403\240a\240q\330\010\034\230A\330\010\016\210a\210z\230\021\230$\230e\2401\240A\330\010\013\2104\210s\220!\330\014\022\220!\220>\240\021\240$\240e\2501\330\010\016\210a\210|\2301\230D\240\005\240S\250\003\2501\320\004&\240m\2608\2701\360\"\000\t \230u\240A\240Q\330\010 \240\005\240Q\240a\330\010\016\210a\320\017+\2501\250D\260\006\260h\270a\320\004.\250m\2709\300A\360\"\000\t\"\240\021\330\010\021\220\021\220&\230\001\230\021\330\010\016\210a\210{\230!\2302\230Q\330\010\013\2106\220\023\220A\330""\014\022\220!\320\023-\250Q\250d\260%\260w\270a\270r\300\021\340\014\022\220!\320\023(\250\001\250\024\250U\260!\2602\260Q\320\004\036\230m\2509\260A\360$\000\t\020\210v\220Q\220d\230&\240\014\250D\260\t\270\026\270q\320\004'\240\177\260m\320C[\320[i\320iu\360\000\000v\001D\002\360\000\000D\002M\002\360\000\000M\002N\002\360.\000\t \230x\240q\250\006\250a\330\010 \240\001\330\010\037\230q\330\010!\240\021\330\010!\240\021\330\010\023\2209\230A\230Z\240q\250\001\330\010\023\2209\230A\230Z\240q\250\001\330\010\016\210a\320\017#\2401\240G\2507\260'\270\030\300\021\300!\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\004.\250m\320;N\310n\320\\e\320ef\360(\000\t!\240\001\330\010!\240\021\330\010\013\2106\220\027\230\t\240\021\240&\250\001\250\021\330\010\037\230q\330\010\016\210a\210~\230Q\230h\240e\2507\260(\270!\2701\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\330\010\017\210q\320\004#\240?\260-\270\177\310m\320[j\320js\320st\3606\000\t\037\320\0364\3204J\310!\330\010\013\2106\220\027\230\006\230i\240v\250Q\250a\330\010\013\2106\220\027\230\006\230i\240v\250Q\250a\330\010\013\2106\220\027\230\006\230i\240v\250Q\250a\330\010\016\210a\320\017\037\230q\240\004\240F\250(\260(\270!\320\004\033\230;\240n\260I\270Q\360\"\000\t\037\230h\240a\240v\250Q\330\010'\240q\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\210}\230A\230W\240G\2501\250A\330\010\016\210a\210z\230\021\230$\230h\240d\250+\260Q\330\010\017\210q\320\004&\240n\260N\300)\3101\3602\000\t\034\2305\240\001\240\021\330\010\037\230z\250\021\330\010\016\210a\210~\230Q\230d\240%\240q\250\010\260\001\260\021\330\010\017\210r\220\022\2207\230$\230b\240\001\240\021\330\010\"\240!\330\010#\2401\330\010 \240\001\330\010\016\210a\320\017)\250\021\250$\250e\2604\260z\300\021\300+\310Q\310a\330\010\t\330\014\022\220'\230\021\230!\2301\230K\240q\340\014\022\220!\320\0231\260\021\260$\260e\2704\270z\310\021\310+\320UV\320VW\330\010\017\210s\220#\220T""\230\023\230A\230S\240\001\320\004&\240o\260Q\360\036\000\t(\240q\330\010\031\230\031\240!\320#3\2601\260A\330\010\016\210a\320\017$\240A\240T\250\034\260Q\320\004&\240o\260Q\360\036\000\t(\240q\330\010\031\230\031\240!\320#3\2601\260A\330\010\016\210a\320\017$\240A\240T\250\034\260Q\330\010\017\210q\320\004&\240o\260\\\320AZ\320Zc\320cd\3600\000\t\"\240\021\330\010\036\230a\330\010\037\230q\330\010 \240\001\330\010\013\2104\210w\220a\330\014\023\2206\230\021\230!\330\010\013\2105\220\007\220q\330\014\022\220!\220>\240\021\240$\240e\2501\250A\330\014\023\2208\2301\230F\240!\2408\2501\250A\330\014\023\2206\230\023\230A\330\010\016\210a\320\017#\2401\240D\250\005\250V\2601\320\004\037\230q\3600\000\t\035\230H\240K\250x\260{\300!\330\010\036\230a\330\010\016\210a\320\017*\250!\2504\250y\270\001\270\031\300!\3009\310A\310V\320ST\320TZ\320Z[\320[a\320ab\320bc\330\010\020\220\006\220a\220z\240\026\240q\250\n\260&\270\001\270\027\300\006\300a\300w\310f\320TU\320U\\\320\\a\320ab\320bc\320\004'\240q\3600\000\t \230{\250+\260Y\270i\300q\330\010\016\210a\320\017.\250a\250t\2607\270!\2707\300!\3007\310!\3107\320RS\320SX\320XY\320YZ\330\010\020\220\006\220a\220x\230v\240Q\240h\250f\260A\260X\270V\3001\300F\310&\320PQ\320QR\320\004\037\230q\3600\000\t\036\230Y\240k\260\021\330\010\036\230a\330\010\016\210a\320\017\037\230q\240\004\240F\250!\2507\260!\2607\270!\2709\300A\300Q\330\010\020\220\006\220a\220x\230v\240Q\240h\250f\260A\260Z\270u\300A\300Q\320\004\037\230q\360\024\000\t\036\320\0350\3200C\3001\330\010\032\230!\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\016\210a\320\017\"\240!\2404\240u\250A\250W\260A\260W\270A\270Q\330\010\017\210z\230\021\230%\230w\240g\250Q\320\004\037\230q\360\024\000\t\031\230\003\2301\330\010\016\210a\210}\230A\230T\240\026\240v\250Q\250d\260!\330\010\017\210q\320\004\037\230q\360\024\000\t\034\2301\330\010\016\210a\320\017 \240\001\240\024\240W\250A\250Q\330\010\017\210u\220A\220Q\320\004/\250q\360\026\000\t2\260\021\330\010\016\210a""\320\0172\260!\2604\260u\270A\270Q\330\010\017\210v\220Q\220a\320\004\037\230q\360(\000\t\037\320\0364\3204J\310!\330\010\016\210a\320\017\037\230q\240\004\240F\250!\2508\2601\260H\270A\270Q\330\010\020\220\006\220a\220y\240\006\240a\240y\260\006\260a\260q\320\004\027\220q\340\010\013\2104\210u\220C\220v\230Q\330\010\016\210a\320\017 \240\001\240\024\240Q\330\010\017\210q\320\004+\320+?\270q\360\036\000\t\034\2305\240\001\240\021\330\010\033\2308\2408\2508\2601\330\010\016\210a\210w\220a\220v\230Q\230f\240A\240V\2501\250A\330\010\035\230Q\330\010\016\210a\320\017+\2501\250D\260\005\260V\2706\300\026\300v\310Q\310a\330\010\030\230\004\230A\230U\240!\330\010\016\210a\210z\230\021\230%\230x\240u\250F\260!\330\010\017\210q\320\004\033\320\033/\250q\360\"\000\t\034\2305\240\001\240\021\330\010\033\2308\2408\2508\2601\330\010\016\210a\210w\220a\220v\230Q\230f\240A\240V\2501\250A\330\010\016\210a\210|\2301\230D\240\005\240V\2506\260\026\260q\320\004\037\230q\360\"\000\t\034\2307\240!\330\010\016\210a\210}\230A\230T\240\032\2502\250U\260!\2603\260a\330\010\017\210q\320\004!\240\031\250!\360\036\000\t \230q\340\010\013\2107\220'\230\021\330\014\022\220&\230\001\330\010\016\210a\210\177\230a\230t\2409\250A\320\004!\240\031\250!\360\036\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\320\017#\2401\240D\250\007\250q\320\004!\240\031\250!\360\036\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\210{\230!\2304\230u\240A\320\004!\240\031\250!\360\036\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\320\017\"\240!\2404\240u\250A\320\004!\240\031\250!\360\036\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\320\017\"\240!\2404\240w\250a\320\004!\240\031\250!\360\036\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\210{\230!\2304\230z\250\021\320\004!\240\031\250!\360\036\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\210~\230Q\230d""\240&\250\001\320\004!\240\031\250!\360\036\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\210~\230Q\230d\240(\250!\320\004!\240\031\250!\360\036\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\320\017 \240\001\240\024\240V\2501\320\004!\240\031\250!\360\036\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\320\017 \240\001\240\024\240X\250Q\320\004!\240\031\250!\360\036\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\210\177\230a\230t\2404\240q\250\004\250A\320\004!\240\031\250!\360\036\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\320\017!\240\021\240$\240l\260!\320\004!\240\031\250!\360\036\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\320\017\037\230q\240\004\240F\250!\320\004!\240\031\250!\360\036\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\210v\220Q\220d\230%\230q\320\004!\240\031\250!\360\036\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\210w\220a\220t\2306\240\021\320\004!\240\031\250!\360*\000\t \230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\210w\220a\220t\2306\240\021\320\004(\250\017\260q\360\024\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017*\250!\2504\250t\2601\260D\270\001\320\004(\250\017\260q\360&\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017!\240\021\240$\240e\2501\320\004 \240\017\250q\360\036\000\t\"\240\021\330\010\023\2209\230A\230Z\240q\250\001\330\010\016\210a\210z\230\021\230$\230f\240A\320\004 \240\017\250q\360@\001\000\t\"\240\021\330\010\023\2209\230A\230Z\240q\250\001\330\010\016\210a\210z\230\021\230$\230f\240A\320\004 \240\017\250q\360\036\000\t#\240!\330\010\023\2209\230A\230Z\240q\250\001\330\010\016\210a\210z\230\021\230$\230f\240A\320\004\027\220q\360\030\000\t\034\2309\240D\250\001\250\025\250a\330\010\016\210a\320\017 \240\001\240""\024\240V\2501\250C\250q\330\010\017\210q\320\004 \240\017\250q\360\036\000\t%\240A\330\010\023\2209\230A\230Z\240q\250\001\330\010\016\210a\320\017!\240\021\240$\240f\250A\320\004\037\230q\360\024\000\t-\250A\340\010\016\210a\320\017.\250a\250t\2607\270!\2701\330\010\017\210|\2301\230A\320\004'\240q\360\024\000\t%\240A\330\010\016\210a\320\017.\250a\250t\2608\2701\270A\330\010\017\210u\220A\220Q\320\004\037\230q\360\024\000\t\032\230\023\230A\330\010\016\210a\320\017\037\230q\240\004\240F\250!\2505\260\001\330\010\016\210a\210{\230!\2305\240\001\330\010\017\210q\320\004\037\230q\360\024\000\t%\240A\330\010\037\230q\330\010\037\230q\330\010\022\220!\2204\220u\230A\230Q\330\010\016\210a\320\017#\2401\240I\250Q\250g\260Q\260a\330\010\020\220\006\220a\220x\230v\240Q\240a\320\004\027\220q\330\010\014\210H\220A\330\010\014\210N\230!\330\010\024\220I\230Q\230f\240D\250\001\320\004;\270<\300q\330\";\270=\320H`\320`i\320ij\360\024\000\t\036\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\035\230Q\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\320\023&\240f\250A\330\010\014\210I\220Q\320\026/\250q\330\010\016\210a\320\017,\250A\250T\260\026\260v\270Q\330-C\3007\310!\320\004\037\230q\360\024\000\t\035\230I\240Q\330\010\016\210a\320\017\037\230q\240\004\240F\250!\2505\260\001\260\021\330\010\020\220\005\220Q\220f\230E\240\021\240!\320\004\037\230q\360\024\000\t\r\210I\220Q\220o\240Q\330\010\016\210a\210\177\230a\230t\2401\320\004\037\230q\360\024\000\t\031\230\005\230Q\330\010\016\210a\320\017#\2401\240D\250\005\250Q\250b\260\001\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004\037\230q\360\024\000\t\032\230\024\230Q\330\010\016\210a\320\017#\2401\240D\250\005\250Q\250d\260!\330\010\016\210a\210{\230!\2304\230q\330\010\017\210q\320\004'\240q\360\024\000\t&\240Q\330\010\016\210a\320\0172\260!\2604\260|\3001\300A\330\010\017\210v\220Q\220a\320\004'\240q\360\022""\000\t\033\230#\230Q\330\010\016\210a\320\0172\260!\2604\260|\3001\300F\310!\330\010\016\210a\210{\230!\2306\240\021\330\010\017\210q\320\004\027\220q\360\024\000\t\036\230Q\330\010\016\210a\320\017\"\240!\2404\240|\2601\260A\330\010\025\220Z\230q\240\006\240a\330\010\n\210&\220\001\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004\037\230q\360\022\000\t.\250Q\330\010\016\210a\320\017*\250!\2504\250|\2701\270A\330\010\017\210q\320\004\037\230q\360\026\000\t\036\230Q\330\010\016\210a\320\017\"\240!\2404\240u\250A\250Q\330\010\016\210a\210z\230\021\230$\230h\240d\250&\260\001\320\004\037\230q\360\024\000\t\036\230Q\330\010\016\210a\210\177\230a\230t\2405\250\001\250\021\330\010\017\210u\220A\220Q\320\004\037\230q\360\036\000\t\036\230Q\330\010\016\210a\210\177\230a\230t\2405\250\001\250\021\330\010\017\210v\220Q\220a\320\004\027\220q\360\024\000\t\036\230Q\330\010\016\210a\320\017!\240\021\240$\240f\250A\250Q\330\010\025\220Z\230q\240\006\240a\330\010\n\210&\220\001\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004/\250q\360\024\000\t\036\230Q\330\010\016\210a\320\017/\250q\260\004\260F\270!\2701\330\010\017\210u\220A\220Q\320\004\037\230q\360\024\000\t!\240\r\250Q\330\010\016\210a\320\017\037\230q\240\004\240F\250!\2502\250Q\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004\027\220q\360\024\000\t\036\230Q\330\010\016\210a\210w\220a\220t\2305\240\001\240\021\330\010\025\220Z\230q\240\006\240a\330\010\n\210&\220\001\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004\027\220q\360\032\000\t\036\230Q\330\010\016\210a\210w\220a\220t\2305\240\001\240\021\330\010\025\220Z\230q\240\006\240a\330\010\n\210&\220\001\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004\027\220q\360\024\000\t\036\230Q\330\010\016\210a\210x\220q\230\004\230F\240!\2401\330\010\025\220Z\230q\240\006\240a\330\010\n\210&\220\001\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004\027\220q\360\024\000\t\036\230Q\330\010\016\210a\210y\230""\001\230\024\230W\240A\240Q\330\010\025\220Z\230q\240\006\240a\330\010\n\210&\220\001\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004'\240q\360\024\000\t&\240Q\330\010\037\230q\330\010\016\210a\320\017$\240A\240T\250\026\250q\260\006\260a\260q\330\010\017\210w\220a\220v\230Q\320\004-\320-?\270q\360\"\000\t!\240\005\240Q\240c\250\021\250!\330\010#\2401\330\010\023\2208\2301\230J\240a\240y\260\001\260\021\330\010\025\220R\220q\330\010\016\210a\320\017*\250!\2504\250u\260I\270[\310\001\310\022\3101\330\010\017\210q\320\004\037\230q\360\024\000\t\026\220Q\220d\230!\320\004\037\230q\360\032\000\t\026\220R\220q\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\002\260!\330\010\017\210q\320\004\027\220q\360\024\000\t\026\220R\220q\330\010\016\210a\210w\220a\220t\2305\240\001\240\022\2401\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004\027\220q\360\024\000\t\026\220R\220q\330\010\016\210a\210w\220a\220t\2305\240\001\240\022\2401\330\010\017\210q\320\004\027\220q\360\024\000\t\026\220R\220q\330\010\016\210a\210x\220q\230\004\230F\240!\2402\240Q\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004\027\220q\360 \000\t\026\220R\220q\330\010\016\210a\210y\230\001\230\024\230U\240!\2402\240Q\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004\037\230q\360\024\000\t\026\220S\230\010\240\003\2401\330\010\016\210a\210\177\230a\230t\2405\250\001\250\021\250&\260\001\260\021\260&\270\006\270a\330\010\016\210a\210{\230!\2301\230H\240F\250!\250;\260a\260q\270\001\330\010\037\230t\2409\250A\250Q\330\010\020\220\003\2203\220a\320\004'\240q\360\022\000\t\026\220S\230\001\330\010\030\230\003\2301\330\010\016\210a\320\017.\250a\250t\2606\270\021\270!\2706\300\021\300$\300f\310F\320RS\330\010\016\210a\210{\230!\2301\230A\330\010\016\210a\210{\230!\2304\230q\330\010*\250$\250i\260q\270\001\330\010\020\220\003\2206\230\021\320\004\037\230q\360\024\000\t\026\220S\230\001\330\010\016\210a\210\177\230a\230t\2405\250\001\250\021\250&\260\006\260a\330""\010\016\210a\210{\230!\2301\230A\330\010\037\230t\2409\250A\250Q\330\010\020\220\003\2201\320\004\027\220q\360\024\000\t\026\220T\230\021\230%\230q\330\010\016\210a\210w\220a\220t\2305\240\001\240\022\2401\330\010\017\210q\320\004'\240q\360\024\000\t\036\230Y\240a\330\010\016\210a\320\017'\240q\250\004\250F\260!\2603\260a\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004'\240q\340\010\031\230\021\330\010\021\220\024\220Y\230a\230q\330\010\013\2107\220#\220Q\330\014\022\220!\320\023,\250A\250T\260\027\270\001\270\021\330\014\025\220X\230Q\230a\330\010\017\210q\320\004\037\230q\360*\000\t\036\230Y\240i\250q\330\010\035\230Q\330\010\016\210a\320\017 \240\001\240\024\240W\250A\250W\260A\260W\270A\270Q\330!\"\240(\250!\330\010\020\220\006\220a\220x\230v\240Q\240h\250f\260A\260X\270U\300!\3001\320\004\027\220q\360\024\000\t\017\210a\210|\2301\230D\240\001\320\004'\240q\360\024\000\t\017\210a\320\017+\2501\250D\260\001\320\004\037\230q\360 \000\t\017\210a\320\017#\2401\240D\250\001\320\004'\240q\360\024\000\t\017\210a\320\017#\2401\240D\250\005\250R\250q\320\004\027\220q\360\024\000\t\017\210a\210|\2301\230D\240\001\330\010\017\210q\320\004\027\220q\360\016\000\t\017\210a\320\017#\2401\240D\250\001\330\010\017\210q\320\004\027\220q\360\024\000\t\017\210a\320\017\"\240!\2404\240q\320\004!\240\021\360\024\000\t \230q\330\010\016\210a\210{\230!\2304\230q\330\033\034\330\033!\240\026\240q\330\033!\240\026\240q\330\033!\240\021\240!\330\033!\240\026\240q\330\033\034\330\010\017\210u\220A\220Q\320\004(\250\t\260\021\360\036\000\t\"\240\026\240q\250\001\330\010\016\210a\320\017\"\240!\2404\240u\250A\320\004/\250q\360*\000\t\017\210a\210{\230!\2304\230v\240Q\240f\250A\250V\2601\260A\320\004/\250q\360\"\000\t\017\210a\320\017\"\240!\2404\240w\250a\250v\260Q\260a\320\004'\240q\360 \000\t\017\210a\320\017*\250!\2504\250w\260c\270\021\320\004\027\220q\360\024\000\t\017\210a\320\017$\240A\240T\250\021\320\004\031\230\021\360\024\000\t(\240q\330\010\016\210a\320\017$\240A""\240T\250\034\260Q\260a\330\010\017\210y\230\001\230\021\320\004'\240q\360\"\000\t\017\210a\320\017$\240A\240T\250\034\260Q\260f\270A\270Q\320\004 \240\001\360\030\000\t\"\240\026\240q\250\001\330\010\016\210a\320\017$\240A\240T\250\025\250a\250q\330\010\017\210v\220Q\220a\320\004\027\220q\360\030\000\t\017\210a\320\017 \240\001\240\024\240Q\320\004\027\220q\360\024\000\t\017\210a\320\017 \240\001\240\024\240Q\320\004\037\230q\360\030\000\t\017\210a\320\017 \240\001\240\024\240Q\320\004\037\230q\360\024\000\t\017\210a\320\017 \240\001\240\024\240Q\330\010\014\210I\220Q\220o\240Q\320\004!\240\021\360\032\000\t \230q\330\010\016\210a\320\017%\240Q\240d\250*\260A\260Q\330\010\017\210u\220A\220Q\320\004\032\230!\360\024\000\t \230q\330\010\016\210a\320\017%\240Q\240d\250,\260a\260q\330\010\017\210u\220A\220Q\320\004 \240\001\360\024\000\t\033\230%\320\037/\320/?\270q\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\016\210a\320\017#\2401\240D\250\005\250Q\250c\260\021\260#\260Q\260a\330\010\017\210z\230\021\230%\230s\240#\240Q\320\004*\250!\360\026\000\t \230q\330\010\016\210a\320\017-\250Q\250d\260%\260q\270\001\330\010\017\210v\220Q\220a\320\004/\250q\360\036\000\t\017\210a\320\017%\240Q\240d\250%\250s\260!\320\004*\250!\360(\000\t \230q\330\010\016\210a\320\017!\240\021\240#\240V\2501\250A\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004\037\230q\360\026\000\t!\240\001\330\010\016\210a\320\017 \240\001\240\024\240W\250A\250Q\330\010\017\210y\230\001\230\021\320\004!\240\021\360\024\000\t \230q\330\010\016\210a\320\017(\250\001\250\024\250X\260Q\260a\330\010\017\210u\220A\220Q\320\004\027\220q\360\024\000\t\017\210a\320\017!\240\021\240$\240a\320\004\037\230q\360\024\000\t\034\230;\240a\330\010\016\210a\320\017\"\240!\2404\240u\250A\250Q\330\010\016\210a\320\017#\2401\240D\250\005\250Q\250a\330\010\017\210w\220a\220t\2301\320\004\037\230q\360\024\000\t\037\230a\330\010\016\210a\320\017\"\240!\2404\240u\250A\250Q\330\010\017""\210v\220Q\220a\320\004\037\230q\360\024\000\t\037\230a\330\010\016\210a\210}\230A\230T\240\027\250\001\250\021\330\010\017\210v\220Q\220a\320\004'\240q\360\024\000\t\037\230a\330\010\016\210a\320\017&\240a\240t\2505\260\001\260\021\330\010\017\210v\220Q\220a\320\004\037\230q\360\024\000\t'\240a\340\010\016\210a\320\017!\240\021\240$\240i\250q\260\001\330\010\017\210|\2301\230A\320\004'\240q\360\034\000\t\037\230a\330\010\016\210a\320\017'\240q\250\004\250F\260!\2601\330\010\017\210v\220Q\220a\320\004\037\230q\360\036\000\t\037\230a\330\010\016\210a\320\017\037\230q\240\004\240F\250#\250V\2601\260A\330\010\017\210v\220Q\220a\320\004\027\220q\360\024\000\t\017\210a\320\017&\240a\240t\2501\320\004\037\230q\360\034\000\t\017\210a\210\177\230a\230t\2401\320\004\027\220q\360\024\000\t\017\210a\210\177\230a\230t\2401\320\004\027\220q\360\024\000\t\017\210a\210\177\230a\230t\2401\330\010\017\210q\320\004\037\230q\360\024\000\t!\240\001\330\010\016\210a\210\177\230a\230t\2405\250\001\250\021\330\010\017\210y\230\001\230\021\320\004\032\230!\360\024\000\t \230q\330\010\016\210a\320\017&\240a\240t\2507\260!\2601\330\010\017\210u\220A\220Q\320\004(\250\t\260\021\360\036\000\t\"\240\026\240q\250\001\330\010\016\210a\320\017.\250a\250t\260<\270q\320\004/\250q\360\024\000\t\017\210a\320\017!\240\021\240$\240e\2503\250a\320\004\031\230\021\360\024\000\t \230q\330\010\016\210a\320\017!\240\021\240$\240f\250A\250Q\330\010\017\210q\320\004\032\230!\360\024\000\t\033\230%\230q\330\010\016\210a\320\017)\250\021\250$\250f\260A\260T\270\021\330\010\016\210a\210{\230!\2304\230q\330\010\017\210q\320\004/\250q\360&\000\t\017\210a\320\017!\240\021\240$\240f\250A\250V\2601\260A\320\004/\250q\360\"\000\t\017\210a\320\017!\240\021\240$\240f\250A\250V\2601\260A\320\004'\240q\360\032\000\t\017\210a\320\017)\250\021\250$\250f\260E\270\021\320\004'\240q\360\026\000\t\017\210a\320\017/\250q\260\004\260A\320\004\027\220q\360\024\000\t\017\210a\320\017\037\230q\240\004\240A\320\004\037\230q\360\024""\000\t\017\210a\320\017\037\230q\240\004\240A\320\004\037\230q\360\032\000\t\017\210a\320\017\037\230q\240\004\240A\320\004\037\230q\360\024\000\t\017\210a\320\017\037\230q\240\004\240A\330\010\014\210I\220Q\320\026&\240a\320\004\037\230q\360\024\000\t\017\210a\320\017\037\230q\240\004\240A\330\010\014\210I\220Q\220o\240Q\320\004\027\220q\360\024\000\t\017\210a\320\017\037\230q\240\004\240A\330\010\017\210q\320\004\027\220q\360\024\000\t\"\240\021\330\010\016\210a\320\017\037\230q\240\004\240D\250\001\250\024\250Q\250a\330\010\017\210v\220Q\320\004'\240q\360\036\000\t\017\210a\320\017\037\230q\240\004\240E\250\021\250!\320\004 \240\001\360\024\000\t(\240q\330\010\016\210a\320\017\037\230q\240\004\240E\250\021\250!\330\010\017\210y\230\001\230\021\320\004\037\230q\360\026\000\t!\240\001\330\010\016\210a\320\017'\240q\250\004\250F\260!\2601\330\010\017\210y\230\001\230\021\320\004\037\230q\360\026\000\t!\240\001\330\010\016\210a\320\017\037\230q\240\004\240F\250!\2501\330\010\017\210y\230\001\230\021\320\004\030\230\001\360\024\000\t(\240q\330\010\016\210a\320\017'\240q\250\001\250\021\330\010\016\210a\210z\230\021\230$\230h\240d\250(\260!\330\010\017\210q\320\004\033\230>\250\031\260!\360\036\000\t \230q\330\010\016\210a\320\017!\240\021\240-\250t\2605\270\001\270\021\330\010\021\220\030\230\021\230&\240\001\330\010\035\230Q\330\010\016\210a\210x\220q\230\004\230E\240\030\250\021\250!\330\010\025\220Z\230q\240\006\240a\330\010\n\210&\220\001\330\010\017\210q\320\004\031\230\030\240\021\340\010\037\230q\330\010\036\230a\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\320\017\037\230q\240\004\240F\250%\250q\260\001\330\010\017\210v\220Q\220a\320\004\027\220q\360\024\000\t\017\210a\210w\220a\220t\2301\320\004\027\220q\360\024\000\t\017\210a\210w\220a\220t\2301\330\010\017\210q\320\004\037\230q\360\036\000\t\017\210a\210w\220a\220t\2306\240\023\240A\320\004\037\230q\360$\000\t!\240\001\330\010\016\210a\210w\220a\220t\2306\240\023\240F\250!\2501\330\010""\017\210x\220q\230\001\320\004\027\220q\360\024\000\t\017\210a\210x\220q\230\004\230A\320\004\027\220q\360\032\000\t\017\210a\210x\220q\230\004\230A\320\004\027\220q\360\024\000\t\017\210a\210x\220q\230\004\230A\330\010\017\210q\320\004\027\220q\360\024\000\t\017\210a\210y\230\001\230\024\230Q\320\004'\240q\360\034\000\t\037\230c\240\021\330\010\016\210a\210\177\230a\230t\2406\250\021\320\004\"\240!\360\024\000\t \230q\330\010\037\230q\330\010\016\210a\320\017\"\240!\2404\240v\250Q\250g\260Q\260a\330\010\020\220\006\220a\220x\230v\240Q\240a\320\004\037\230q\360\030\000\t\033\230%\320\037/\320/?\270q\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\016\210a\320\017\"\240!\2404\240u\250A\250S\260\001\260\023\260A\260Q\330\010\017\210z\230\021\230%\230s\240#\240Q\320\004'\240q\360\024\000\t!\240\001\330\010 \240\001\330\010\037\230q\330\010\016\210a\320\017(\250\001\250\024\250W\260A\260W\270A\270W\300A\300Q\330\010\034\230G\2401\240F\250!\330\010\034\230G\2401\240F\250!\330\010\020\220\007\220q\320\004\037\230q\360\024\000\t*\250\036\260q\330\010\016\210a\320\017 \240\001\240\024\240W\250A\250Z\260q\330\010\016\210a\210{\230!\230:\240Q\330\010\017\210q\320\004'\240q\360(\000\t \230q\330\010\016\210a\210\177\230a\230s\240&\250\001\250\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004'\240q\360\024\000\t(\240q\330\010\016\210a\320\017.\250a\250t\2608\2701\270A\330\010\017\210u\220A\220Q\320\004\032\230!\360\024\000\t\033\230%\230q\330\010\032\230%\230q\330\010\016\210a\320\017)\250\021\250$\250f\260A\260T\270\026\270q\300\004\300A\330\010\016\210a\210{\230!\2304\230q\330\010\016\210a\210{\230!\2304\230q\330\010\020\220\006\220a\320\004\"\240!\360\024\000\t\033\230!\330\010'\240q\330\010'\240q\330\010'\240q\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\005\260Q\260e\2701\270A\330\010\017\320\017\"\240!\2405\250\005\250U\260!\320\004\037\230q\360\024\000\t(\240q\330\010""\037\230q\330\010\016\210a\320\017(\250\001\250\024\250U\260!\2601\330\010\016\210a\320\017&\240a\240t\2505\260\001\260\021\330\010\016\210a\210\177\230a\230t\2405\250\001\250\030\260\026\260v\270Q\330\010\021\220\027\230\001\230\030\240\021\330\010\017\210q\320\004\037\230q\360\036\000\t\030\220r\230\021\330\010\016\210a\320\017\"\240!\2404\240u\250A\250T\260\021\330\010\023\2201\220D\230\001\330\010\017\210q\320\004/\250q\360\024\000\t\030\220s\230+\240S\250\n\260#\260Z\270s\300*\310C\310q\330\010\016\210a\320\017/\250q\260\004\260F\270!\2703\270f\300A\300T\310\026\310q\320PS\320SY\320YZ\320Z]\320]c\320cd\320dg\320gh\330\010\016\210a\210{\230!\2303\230a\330\010\016\210a\210{\230!\2304\230q\330\010\016\210a\210{\230!\2303\230a\330\010\016\210a\210{\230!\2303\230a\330\010\016\210a\210{\230!\2303\230a\330\010\017\210u\220F\230%\230u\240A\320\004'\240q\360\024\000\t\030\220s\230!\330\010\016\210a\320\017&\240a\240t\2505\260\001\260\023\260A\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\036\320\036/\250q\360(\000\t \230u\240A\240Q\330\010\016\210a\210z\230\021\230$\230e\2408\2503\250a\320\004-\320-?\270q\360\"\000\t \230u\240A\240S\250\001\250\021\330\010#\2401\330\010\023\2208\2301\230J\240a\240x\250q\260\001\330\010\025\220R\220q\330\010\016\210a\320\017*\250!\2504\250u\260H\270K\300q\310\002\310!\330\010\017\210q\320\004\"\240!\360\024\000\t\030\220r\230\021\330\010\016\210a\320\017%\240Q\240d\250%\250q\260\004\260A\330\010\016\210a\210{\230!\2304\230q\330\010\017\210q\320\004)\250\021\360\032\000\t\030\220r\230\021\330\010\016\210a\320\017(\250\001\250\024\250W\260A\260T\270\021\330\010\017\210q\320\004 \240\001\360\024\000\t\030\220r\230\021\330\010\016\210a\320\017)\250\021\250$\250f\260A\260T\270\021\330\010\016\210a\210{\230!\2304\230q\330\010\017\210q\320\004 \240\001\360\024\000\t\030\220r\230\021\330\010\027\220r\230\021\330\010\016\210a\320\017 \240\001\240\024\240V\2501\250D\260\007\260q\270\004\270A\330\010\020\220\006\220a\320\004\030""\230\001\360\022\000\t\030\220s\230!\330\010\016\210a\320\017#\2401\240D\250\014\260A\260S\270\001\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\030\230\001\360\024\000\t\030\220s\230!\330\010\016\210a\210{\230!\2304\230u\240A\240S\250\001\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004*\250!\360\036\000\t\030\220s\230!\330\010\016\210a\320\017\"\240!\2404\240u\250B\250e\2601\260C\260q\330\010\017\210q\320\004!\240\021\360\024\000\t\030\220s\230!\330\010\016\210a\320\017 \240\001\240\024\240U\250!\2503\250a\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\"\240!\360\024\000\t\030\220s\230!\330\010\016\210a\320\017!\240\021\240$\240e\2501\250C\250q\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004*\250!\360\036\000\t\030\220s\230!\330\010\016\210a\320\017!\240\021\240$\240e\2503\250e\2601\260C\260q\330\010\017\210q\320\004!\240\021\360\024\000\t\030\220s\230!\330\010\016\210a\320\017!\240\021\240$\240f\250A\250S\260\001\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004)\250\021\360\024\000\t\030\220s\230!\330\010\016\210a\320\017)\250\021\250$\250f\260A\260S\270\006\270f\300A\330\010\016\210a\210{\230!\2303\230a\330\010\036\230d\240)\2501\250A\330\010\020\220\005\220Q\320\004\030\230\001\360\024\000\t\030\220s\230!\330\010\016\210a\210x\220q\230\004\230E\240\021\240#\240Q\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\030\230\001\360\024\000\t\030\220s\230!\330\010\016\210a\210y\230\001\230\024\230V\2401\240C\240q\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004)\250\021\360\"\000\t\030\220s\230!\330\010\016\210a\210z\230\021\230$\230f\240C\240w\250c\260\027\270\001\270\023\270A\330\010\017\210q\320\004\030\230\001\360\024\000\t\030\220s\230!\330\010\016\210a\210z\230\021\230$\230g\240Q\240c\250\021\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004!\240\021\360\036\000\t\030\220t\2301\230E\240\021\330\010\016\210a\320\017!\240\021\240$\240f\250A\250S\260\001""\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\030\230\001\360\024\000\t \230t\2404\240q\250\001\330\010\036\230a\330\010\013\2104\210s\220!\330\014\022\220!\320\023*\250!\2505\260\001\260\021\330\014\022\220!\320\023)\250\021\250!\330\014\017\210v\220S\230\003\2304\230t\2401\240E\250\021\330\014\025\220Q\330\010\017\210u\220A\220Q\320\004\030\230\001\360\024\000\t \230t\2404\240q\250\001\330\010\036\230a\330\010\013\2104\210s\220!\330\014\022\220!\320\023'\240q\250\001\330\014\022\220!\320\023*\250!\2505\260\001\260\021\330\010\017\210u\220A\220Q\320\004!\240\031\250!\360\036\000\t\020\210t\2205\230\003\2301\330\010\037\230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\320\017\"\240!\2404\240w\250a\320\004!\240\031\250!\360\036\000\t\020\210t\2205\230\003\2301\330\010\037\230q\330\010\013\2107\220'\230\026\230v\240V\2501\330\010\016\210a\210\177\230a\230t\2406\250\021\320\004\031\230\021\360\024\000\t\020\210t\2209\230A\320\004!\240\021\330\010\017\210t\2209\230A\230Q\320\004!\240\021\360\024\000\t\020\210t\2209\230A\230Q\320\004\032\230(\240!\360\036\000\t\020\210t\220=\240\001\240\021\320\004\030\230\001\360\024\000\t\020\210t\220=\240\001\320\004\030\230\001\360\014\000\t\020\210t\220=\240\001\320\004(\250\010\260\001\360\026\000\t \230u\240A\240Q\330\010\033\2304\230q\330\010\016\210a\320\017%\240Q\240d\250'\260\030\270\021\270&\300\001\330\010\016\210a\210{\230!\2306\240\021\330\010\017\210q\320\004(\250\010\260\001\360\036\000\t \230u\240A\240Q\330\010!\240\023\240A\330\010\016\210a\320\017#\2401\240D\250\005\250X\260Q\260m\3001\330\010\016\210a\210{\230!\230=\250\001\330\010\017\210q\320\004!\240\030\250\021\360\036\000\t \230u\240A\240Q\330\010\032\230#\230Q\330\010\016\210a\210}\230A\230T\240\025\240h\250a\250v\260Q\330\010\016\210a\210{\230!\2306\240\021\330\010\017\210q\320\004\"\240(\250!\360\036\000\t \230u\240A\240Q\330\010\035\230Q\330\010\016\210a\210\177\230a\230t\2406\250\030\260\021\260!\330\010\017\210u\220A\220Q""\320\004\"\240(\250!\360\024\000\t \230u\240A\240Q\330\010\035\230Q\330\010\016\210a\210\177\230a\230t\2406\250\030\260\021\260!\330\010\017\210v\220Q\220a\320\004\"\240(\250!\360\036\000\t \230u\240A\240Q\330\010%\240Q\330\010\016\210a\320\017'\240q\250\004\250F\260(\270!\2701\330\010\017\210y\230\001\230\021\320\004\"\240(\250!\360\024\000\t \230u\240A\240Q\330\010\016\210a\320\017%\240Q\240d\250$\250a\250t\2601\320\004\"\240(\250!\360\036\000\t \230u\240A\240Q\330\010!\240\021\330\010\016\210a\210~\230Q\230d\240%\240x\250q\260\001\330\010\017\210y\230\001\230\021\320\004(\250\010\260\001\360\036\000\t \230u\240A\240Q\330\010\016\210a\320\017(\250\001\250\024\250U\260!\320\004 \240\010\250\001\360\036\000\t \230u\240A\240Q\330\010\016\210a\320\017 \240\001\240\024\240Z\250q\320\004 \240\010\250\001\360\036\000\t \230u\240A\240Q\330\010!\240\021\330\010\016\210a\320\017 \240\001\240\024\240Z\250x\260q\270\001\330\010\017\210v\220Q\220a\320\004)\320):\270!\360\026\000\t \230u\240A\240Q\330\010\016\210a\320\017&\240a\240t\2507\260(\270#\270Q\320\004*\250(\260!\360\"\000\t \230u\240A\240Q\330\010\037\230q\330\010'\240q\330\010\016\210a\320\017+\2501\250D\260\006\260h\270a\270q\330\010\016\210a\320\017/\250q\260\004\260F\270(\300!\3001\330\010\017\210w\220a\220x\230q\320\004)\250\030\260\021\360\024\000\t \230u\240A\240Q\330\010\027\220s\230!\330\010\016\210a\320\017&\240a\240t\2507\260(\270!\2703\270a\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004%\240\\\260\030\270\021\360\"\000\t \230u\240A\240Q\330\010\037\230u\240A\240Q\330\010#\2401\330\010\016\210a\320\017%\240Q\240d\250*\260H\270H\300A\300Q\330\010\017\210v\220Q\220a\320\004!\240\034\250]\270(\300!\360&\000\t \230u\240A\240Q\330\010\037\230u\240A\240Q\330\010 \240\005\240Q\240a\330\010\016\210a\320\017&\240a\240t\2506\260\030\270\030\300\021\320\004\037\230{\250(\260!\360(\000\t \230u\240A\240Q\330\010\037\230u\240A\240Q\330\010\016\210a\320\017#\2401\240D\250\006\250h\260a\320\004\037\230{\250(""\260!\360\"\000\t \230u\240A\240Q\330\010\037\230u\240A\240Q\330\010\016\210a\210~\230Q\230d\240%\240x\250q\320\004(\250\010\260\001\360\036\000\t \230u\240A\320%8\270\001\330\010\016\210a\320\017-\250Q\250d\260&\270\010\300\001\300\021\330\010\017\210u\220A\220Q\320\004!\240\021\360\024\000\t\033\230%\230u\240E\250\025\250e\2605\270\001\330\010\016\210a\210~\230Q\230d\240%\240q\250\001\330\010\016\210a\320\017$\240A\240T\250\025\250a\250s\260!\2603\260a\260s\270!\2703\270a\270s\300!\3001\330\010\017\210q\220\005\220Q\220d\230%\230q\240\004\240E\250\021\250#\250R\250|\2707\300%\300q\310\004\310E\320QR\320RV\320V[\320[\\\320\\_\320_a\320am\320mn\320\004 \240\001\360\026\000\t\033\230%\230u\240E\250\025\250e\2605\270\001\330\010\016\210a\210z\230\021\230$\230e\2401\240A\330\010\016\210a\320\017\"\240!\2404\240q\330#$\240C\240q\250\003\2501\250A\330#$\240C\240q\250\003\2501\250A\330\010\020\220\001\220\025\220a\220t\2305\240\001\240\021\240!\2401\330\021\026\220a\220t\2305\240\001\240\021\240!\2401\330\021\026\220a\220t\2305\240\001\240\021\240!\2404\240r\250\034\260Q\320\004!\240\021\360\034\000\t\033\230%\230u\240E\250\025\250e\2605\270\001\330\010\016\210a\210z\230\021\230$\230e\2401\240A\330\010\016\210a\320\017\"\240!\2404\240q\330#$\240C\240q\250\003\2501\250A\330#$\240C\240q\250\003\2501\250A\330\010\020\220\001\220\025\220a\220t\2305\240\001\240\024\240U\250!\2503\250b\260\014\270A\330\021\026\220a\220t\2305\240\001\240\024\240U\250!\2503\250b\260\014\270A\320\004\"\240-\250v\260Q\360 \000\t\036\230U\240!\2401\330\010\032\230#\230Q\330\010\016\210a\320\017!\240\021\240$\240e\2506\260\021\260&\270\001\330\010\017\210q\320\004\"\240-\250v\260Q\360(\000\t#\240!\330\010!\240\025\240a\240q\330\010\025\220R\220q\330\010\016\210a\320\017\037\230q\240\004\240E\250\032\2601\260B\260e\2701\270A\330\010\013\210;\220c\230\021\330\014\022\220!\220:\230Q\230d\240(\250$\250f\260A\330\014\023\2201\320\004:\270-\300v\310Q\360$\000\t\037\230e\2401\240A\330\010\032\230#\230Q\330""\010\016\210a\320\017*\250!\2504\250u\260F\270)\3006\310\021\310&\320PQ\330\010\017\210q\320\004#\240=\260\t\270\021\360$\000\t\020\210v\220Q\220d\230&\320 1\260\024\260Y\270f\300A\320\004\033\230=\250\t\260\021\360$\000\t\020\210v\220Q\220d\230&\240\t\250\024\250Y\260f\270A\320\004+\320+^\320^w\360\000\000x\001E\002\360\000\000E\002]\002\360\000\000]\002f\002\360\000\000f\002g\002\360&\000\t\027\220k\240\021\330\010\014\210J\220a\220{\240&\250\003\250:\260Q\260k\300\021\330\014\020\220\005\220Q\330\014\021\220\027\230\004\230E\240\027\250\001\330\014\022\220!\320\023'\240q\250\004\250F\260\"\260F\270\"\270A\330\014\r\330\010\013\210:\220Q\220k\240\021\330\014\021\220\033\230E\240\021\330\014\021\220\027\230\004\230E\240\027\250\001\330\014\022\220!\320\023'\240q\250\004\250F\260\"\260F\270\"\270A\330\014\r\330\010\013\2105\220\003\2206\230\027\240\001\330\010\013\2106\220\023\220F\230(\240!\330\010\023\220;\230f\240A\330\010\014\210I\220Q\320\026'\240q\330\010\016\210a\320\017*\250!\2504\250v\260_\300G\3101\320\004\"\240!\360\024\000\t \230w\240a\330\010\027\220r\230\021\330\010\016\210a\320\017&\240a\240t\250:\260Q\260g\270V\3001\300D\310\001\330\010\017\210y\230\001\320\004\037\230x\240q\3602\000\t \230u\240A\240Q\330\010\037\230q\330\010\037\230q\330\010\016\210a\210|\2301\230D\240\006\240g\250Q\250g\260Q\260a\330\010\020\220\005\220Q\220h\230f\240A\240Q\320\004\037\230x\240q\360\036\000\t\034\2305\240\001\240\021\330\010\037\230t\2401\330\010\016\210a\320\017*\250!\2504\250|\2704\270q\300\n\310!\330\010\016\210a\210{\230!\230:\240Q\330\010\017\210q\320\004\037\230x\240q\360\036\000\t\035\230E\240\021\240!\330\010\016\210a\210~\230Q\230d\240'\250\021\320\004'\240x\250q\360.\000\t!\240\005\240Q\320&8\270\n\300!\330\010\016\210a\320\017%\240Q\240d\250%\250y\270\001\270\030\300\021\300!\330\010\020\220\005\220Q\220i\230u\240A\240Q\320\004#\240<\250x\260q\360\"\000\t\036\230Q\330\010\037\230u\240A\240Q\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001""\330\010\016\210a\320\017\037\230q\240\004\240E\250\027\260\010\270\001\270\021\330\010\017\210u\220A\220Q\320\004\037\230x\240q\360$\000\t!\240\005\240Q\240a\330\010 \240\001\330\010\016\210a\210|\2301\230D\240\006\240f\250A\250Q\330\010\017\210x\220q\230\001\320\004'\240x\250q\360,\000\t\036\230U\240!\2401\330\010\035\230Q\330\010\035\230Q\330\010\016\210a\210~\230Q\230d\240%\240s\250!\2504\250q\260\001\330\010\017\210v\220Q\220e\2306\240\021\240!\320\004/\250x\260q\360\036\000\t\036\230U\240!\2401\330\010\016\210a\320\017,\250A\250T\260\025\260a\320\004'\240x\250q\360\036\000\t\036\230U\240!\2401\330\010 \240\001\330\010\016\210a\320\017$\240A\240T\250\025\250f\260A\260Q\330\010\017\210y\230\001\230\021\320\004'\240x\250q\360\"\000\t\036\230U\240!\2401\330\010\016\210a\320\017!\240\021\240$\240f\250A\320\004'\240x\250q\360\036\000\t\036\230U\240!\2401\330\010\037\230q\330\010\035\230X\240Q\240g\250Q\250j\270\004\270F\300(\310!\3101\330\010\016\210a\320\017 \240\001\240\024\240U\250#\250Q\330\010\026\220a\330\010\036\230a\330\010\014\210G\2209\230A\330\014\022\220*\230A\230V\2401\240C\240q\330\014\017\210v\220V\2301\230A\330\014\025\220W\230A\230Q\330\010\017\210q\320\004\037\230x\240q\360\024\000\t#\240!\330\010\020\220\t\230\021\230'\240\021\240!\330\010\016\210a\320\017'\240q\250\004\250F\260!\320\004/\250x\260q\360\036\000\t'\240e\2501\250A\330\010\016\210a\320\017+\2501\250D\260\010\270\001\320\004\037\230x\240q\360\036\000\t\037\230e\2401\240A\330\010\016\210a\210~\230Q\230d\240&\250\001\320\004\037\230x\240q\360\024\000\t!\240\001\330\010\016\210i\220q\230\005\230Q\230a\330\010\016\210a\320\017%\240Q\240d\250&\260\006\260a\320\004\037\230x\240q\360\024\000\t(\240u\250A\250Q\330\010\016\210a\320\017\"\240!\2404\240t\2501\250D\260\001\320\004'\240x\250q\360\"\000\t \230u\240A\240Q\330\010\016\210a\210\177\230a\230t\240:\250T\260\027\270\001\330\010\017\210q\320\004'\240x\250q\360\036\000\t \230u\240A\240Q\330\010\027\220s\230!\330\010\016\210a\320\017\"\240!""\2404\240u\250H\260A\260S\270\001\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004'\240x\250q\360\024\000\t \230u\240A\240Q\330\010\027\220s\230!\330\010\016\210a\320\017$\240A\240T\250\027\260\010\270\001\270\023\270A\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\037\230x\240q\360$\000\t \230u\240A\320%6\260a\330\010\016\210a\320\017$\240A\240T\250\026\250x\260q\270\001\330\010\017\210u\220A\220Q\320\004+\250<\260x\270q\360\"\000\t \230u\240A\320%7\260q\330\010\037\230u\240A\240Q\330\010\016\210a\320\0170\260\001\260\024\260V\2708\3008\3101\310A\330\010\017\210u\220A\220Q\320\004'\240x\250q\360 \000\t\"\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\320\017'\240q\250\004\250E\260\021\320\004\037\230x\240v\250Q\360\036\000\t\037\230f\240A\240Q\330\010\036\230a\330\010\016\210a\210~\230Q\230d\240&\250\006\250a\250q\330\010\017\210v\220Q\220a\320\004\037\230y\250\001\360.\000\t\034\2301\330\010\013\2105\220\007\220v\230V\2404\240q\330\010\026\220b\230\001\330\010\032\230!\330\010\016\210a\210z\230\021\230$\230g\240U\250!\2503\250a\250s\260!\330\010\020\220\005\220Q\220d\230!\320\004\037\230y\250\001\360 \000\t\014\2104\210s\220!\330\014\022\220!\330\r\020\220\005\220S\230\001\330\014\022\220!\220<\230q\240\004\240F\320*;\2701\270C\270q\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004\037\230y\250\001\360 \000\t\014\2104\210s\220!\330\014\022\220!\330\r\020\220\005\220S\230\001\330\014\022\220!\220<\230q\240\004\240F\320*;\2701\270C\270q\330\010\016\210a\320\017\037\230q\240\003\2401\330\010\017\210q\320\004#\240;\320.?\270y\310\001\360$\000\t\014\2105\220\003\2206\230\027\240\001\330\010\013\2105\220\010\230\006\230e\2401\330\014\022\220*\230A\230Q\330\010\025\220S\230\001\330\010\033\2305\240\001\240\021\330\010\013\2105\220\003\2201\330\014\022\220!\320\023'\240q\250\004\250F\260$\260a\260q\270\001\330\r\022\220#\220Q\330\014\022\220!\320\023+\2501\250D\260\006\260d\270!\2701\270A\340\014\022\220!""\320\023,\250A\250T\260\026\260t\2701\270A\270Q\330\010\016\210a\210{\230!\2301\230A\330\010\017\210q\320\004?\270y\310\001\360&\000\t\014\2106\220\023\220F\230(\240!\330\010\037\230q\330\010\016\210a\320\017(\250\001\250\021\250&\260\005\260W\270E\300\027\310\001\310\021\330\010\016\210a\210z\230\021\230$\230h\240d\250'\260\021\330\010\017\210q\320\004(\320(?\270y\310\001\360\036\000\t\020\320\017\"\240!\2406\250\026\250q\320\004?\270y\310\001\360*\000\t\014\2107\220#\220V\2309\240C\240q\330\016\024\220A\220Z\230q\240\001\240\026\240q\330\010\016\210a\320\017#\2401\240D\250\006\250e\2607\270%\270w\300a\300v\310Q\330\010\017\210q\320\004/\250y\270\001\360*\000\t\014\2107\220#\220V\2309\240C\240q\330\016\024\220A\220Z\230q\240\001\240\026\240q\330\010\016\210a\210\177\230a\230t\2406\250\024\250W\260A\260V\2701\330\010\017\210q\320\004*\250-\260y\300\001\360\024\000\t!\240\001\330\010\021\220\031\230!\2308\2401\240A\330\010\016\210a\320\017%\240Q\240d\250&\260\001\320\004?\270y\310\001\340\010\016\210a\320\004/\250y\270\001\340\010\016\210a\320\004\037\230y\250\001\360\036\000\t\037\230a\330\010\013\2106\220\027\230\001\330\010\016\210a\320\017&\240a\240t\2505\260\001\320\004(\250\007\250y\270\001\360&\000\t\037\230a\330\010\016\210a\320\017$\240A\240T\250\025\250a\320\004(\250\007\250y\270\001\360\036\000\t!\240\006\240a\240q\330\010\016\210a\320\017$\240A\240T\250\026\250q\320\004\"\240-\250y\270\001\360&\000\t\027\220c\230\021\330\010!\240\021\330\010\021\220\021\220&\230\001\230\021\330\010\013\2106\220\023\220A\330\014\022\220!\320\023)\250\021\250$\250e\2607\270!\2702\270Q\340\014\022\220!\320\023$\240A\240T\250\025\250a\250r\260\021\330\010\016\210a\210{\230!\2302\230Q\330\010\017\210q\320\004$\320$?\270y\310\001\360*\000\t\037\230f\240A\240Q\330\010\035\230Q\230m\2501\250A\330\010\013\2102\210W\220F\230'\240\021\240!\330\010\016\210a\320\017#\2401\240D\250\005\250V\2601\260F\270&\300\001\320\004'\240y\260\001\360\024\000\t\037\230f\240A\240Q\330\010\016\210a""\320\017$\240A\240T\250\027\260\001\320\004'\240y\260\001\360\036\000\t\037\230f\240A\240Q\330\010\016\210a\320\017%\240Q\240d\250&\260\001\330\010\017\210q\320\004/\250y\270\010\300\010\310\001\360&\000\t\037\230h\240a\240q\330\010\035\230Q\330\010\013\2102\210W\220A\330\014\023\2201\220A\330\010\016\210a\320\017%\240Q\240d\250&\260\001\260\026\260v\270Q\330\010\017\210q\320\004!\240\036\250y\270\001\360&\000\t\037\230h\240a\240v\250Q\330\010\032\230&\240\001\330\010\016\210a\320\017&\240a\240t\2506\260\027\270\001\270\023\270A\330\010\017\210q\320\004\037\230y\250\001\360*\000\t \230q\330\010\013\2101\330\014\024\220A\330\010\016\210a\210|\2301\230D\240\005\240Q\320\004\035\320\035@\300\001\360\"\000\t!\240\001\330\010 \240\001\330\010\017\210y\230\001\230\026\230q\240\001\330\010\013\2104\210w\220f\230G\2403\240d\250!\2501\330\010\016\210a\320\017!\240\021\240$\240d\250!\2504\250v\260Q\320\004 \240\010\250\001\360\036\000\t\"\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\210}\230A\230T\240\025\240a\320\004 \240\010\250\001\360\036\000\t\"\240\021\330\010!\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\210}\230A\230T\240\025\240g\250Q\250a\340\010\016\210a\210~\230Q\230a\230q\320\004 \240\010\250\001\360\024\000\t!\240\001\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\320\017%\240Q\240d\250&\260\001\320\004\032\230(\240!\360\024\000\t!\240\001\330\010 \240\001\330\010\017\210y\230\001\230\026\230q\240\001\330\010\016\210a\320\017\037\230q\240\004\240D\250\001\250\024\250V\2601\260A\330\010\013\2105\220\003\2206\230\027\240\001\330\010\032\230.\250\001\250\025\250a\330\010\013\2104\210q\220\005\220Q\330\010\016\210a\210{\230!\2303\230a\330\010\017\210q\320\004#\240=\260\t\270\021\360\"\000\t\"\240\021\330\010\017\210y\230\001\230\026\230q\240\001\330\010!\240\021\330\010\016\210a\320\017\037\230q\240\004\240E\250\027\260\001\320\004!\240\030\250\021\360\036\000\t\"\240\021\330\010\017\210y\230\001""\230\026\230q\240\001\330\010\026\220b\230\001\330\010\016\210a\210~\230Q\230d\240%\240w\250a\250s\260!\330\010\017\210q\320\004'\240|\260>\300\036\310z\320YZ\360*\000\t \230u\240A\240Q\330\010\037\230v\240Q\240a\330\010\037\230v\240Q\240a\330\010\037\230v\240Q\240a\330\010/\250q\330\010\016\210a\320\017&\240a\240t\2507\260!\330'.\250g\260W\270A\270Q\330\010\017\210q\320\004(\250\007\250z\270\021\360\"\000\t\"\240\021\330\010\013\2108\220:\230Q\330\010\016\210a\210z\230\021\230$\230f\240E\250\027\260\001\320\004 \240\007\240z\260\021\360.\000\t\035\230A\330\010\020\220\004\220I\230Q\230a\330\010\013\2106\220\023\220E\230\024\230T\240\027\250\007\250q\330\010\016\210a\210}\230A\230T\240\021\330\010\014\210I\220Q\320\026*\250!\330\010\017\210q\320\004\"\240-\250z\270\021\360\"\000\t%\240A\330\010\037\230v\240Q\240a\330\010\037\230v\240Q\240a\330\010\022\220!\2204\220u\230A\230Q\330\010\016\210a\320\017#\2401\240I\250W\260A\320\004\032\230!\360\032\000\t \230z\250\021\330\010\016\210a\320\017#\2401\240D\250\006\250a\250x\260q\270\001\330\010\017\210u\220A\220Y\230e\2401\240A\320\004\032\230!\360\"\000\t \230z\250\021\330\010\016\210a\210~\230Q\230d\240%\240q\250\010\260\001\260\021\330\010\017\210u\220A\220Y\230e\2401\240A\320\004 \240\001\360\024\000\t \230z\250\021\330\010\016\210a\320\017)\250\021\250$\250f\260A\260X\270Q\270a\330\010\017\210u\220A\220Y\230e\2401\240A\320\004\033\230<\240z\260\021\360\036\000\t\037\230e\2401\240A\330\010\036\230f\240A\240Q\330\010\016\210a\210z\230\021\230$\230f\240F\250!\320\004/\250z\270\021\360 \000\t\037\230f\240A\240Q\330\010\016\210a\320\017.\250a\250t\2605\270\001\320\004/\250z\270\021\360\014\000\t\"\240\026\240q\250\001\330\010\016\210a\320\017*\250!\2504\250v\260Q\320\004+\250<\260z\300\021\360\024\000\t!\240\001\330\010 \240\001\330\010\037\230q\330\010\036\230a\340\010\r\210W\220C\220q\330\r\024\220G\2306\240\027\250\005\250Q\250a\330\010\013\2105\220\002\220#\220W\230A\330\010\013\2107\220'\230\021\330\010\034\230H\240A""\240W\250A\250W\260F\270!\2701\330\010\034\230H\240A\240W\250A\250W\260F\270!\2701\330\010\014\210I\220Q\320\026&\240g\250Q\330\010\016\210a\320\017(\250\001\250\024\250W\260G\2707\300&\310\001O";
    PyObject *data = NULL;
    CYTHON_UNUSED_VAR(__Pyx_DecompressString);
    #endif
    PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
    Py_ssize_t pos = 0;
    for (int i = 0; i < 6870; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
      if (likely(string) && i >= 544) PyUnicode_InternInPlace(&string);
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
      stringtab[i] = string;
      pos += bytes_length;
    }
    for (int i = 6870; i < 8741; i++) {
      Py_ssize_t bytes_length = index[i].length;
      PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
      stringtab[i] = string;
      pos += bytes_length;
      if (unlikely(!string)) {
        Py_XDECREF(data);
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    Py_XDECREF(data);
    for (Py_ssize_t i = 0; i < 8741; i++) {
      if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
        __PYX_ERR(0, 1, __pyx_L1_error)
      }
    }
    #if CYTHON_IMMORTAL_CONSTANTS
    {
      PyObject **table = stringtab + 6870;
      for (Py_ssize_t i=0; i<1871; ++i) {
        #if PY_VERSION_HEX >= 0x030F0000
        PyUnstable_SetImmortal(table[i]);
        #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
        if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
        #if PY_VERSION_HEX < 0x030E0000
        if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
        #else
        if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
        #endif
        {
          Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
        }
        #else
        if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
        Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
        #endif
      }
    }
    #endif
  }
  {
    PyObject **numbertab = __pyx_mstate->__pyx_number_tab;
    double const c_constants[] = {0.,0.0,1.0};
    for (int i = 0; i < 3; i++) {
      numbertab[i] = PyFloat_FromDouble(c_constants[i]);
      if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  {
    PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 3;
    int8_t const cint_constants_1[] = {0,-1,1,2,3,4,5,6,7,8,9,10,13,17,18,19,23,32,34,43,45,46,47,48,59,83,93,96,97,109,111,112};
    int32_t const cint_constants_4[] = {136983863L};
    for (int i = 0; i < 33; i++) {
      numbertab[i] = PyLong_FromLong((i < 32 ? cint_constants_1[i - 0] : cint_constants_4[i - 32]));
      if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #if CYTHON_IMMORTAL_CONSTANTS
  {
    PyObject **table = __pyx_mstate->__pyx_number_tab;
    for (Py_ssize_t i=0; i<36; ++i) {
      #if PY_VERSION_HEX >= 0x030F0000
      PyUnstable_SetImmortal(table[i]);
      #elif CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
      if ((PY_SSIZE_T_MAX <= _Py_IMMORTAL_REFCNT_LOCAL)) break;
      #if PY_VERSION_HEX < 0x030E0000
      if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
      #else
      if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
      #endif
      {
        Py_SET_REFCNT(table[i], ((Py_ssize_t)_Py_IMMORTAL_REFCNT_LOCAL + 1));
      }
      #else
      if ((PY_SSIZE_T_MAX < _Py_IMMORTAL_INITIAL_REFCNT)) break;
      Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
      #endif
    }
  }
  #endif
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_codeobjects ### */
typedef struct {
    unsigned int argcount : 4;
    unsigned int num_posonly_args : 1;
    unsigned int num_kwonly_args : 3;
    unsigned int nlocals : 6;
    unsigned int flags : 10;
    unsigned int first_line : 13;
} __Pyx_PyCode_New_function_description;
/* NewCodeObj.proto */
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        PyObject *line_table,
        PyObject *tuple_dedup_map
);


static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
  PyObject* tuple_dedup_map = PyDict_New();
  if (unlikely(!tuple_dedup_map)) return -1;
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS), 244};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kwargs, __pyx_mstate->__pyx_n_u_name_4};
    __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_wrapped_func, __pyx_mstate->__pyx_kp_b_iso88591_A_1_A_CuAQd_wavEUUYYZ_awa_4r, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 243};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_func, __pyx_mstate->__pyx_n_u_wrapped_func, __pyx_mstate->__pyx_n_u_wrapped_func};
    __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_decorator, __pyx_mstate->__pyx_kp_b_iso88591_YfAQ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 189};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_petscis_pxi, __pyx_mstate->__pyx_n_u_enter, __pyx_mstate->__pyx_kp_b_iso88591_A_t6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 192};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exc};
    __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_petscis_pxi, __pyx_mstate->__pyx_n_u_exit, __pyx_mstate->__pyx_kp_b_iso88591_A_t5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 571};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_petscvec_pxi, __pyx_mstate->__pyx_n_u_enter, __pyx_mstate->__pyx_kp_b_iso88591_A_t6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 574};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exc};
    __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_petscvec_pxi, __pyx_mstate->__pyx_n_u_exit, __pyx_mstate->__pyx_kp_b_iso88591_A_t5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 603};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gvec};
    __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_petscvec_pxi, __pyx_mstate->__pyx_n_u_enter, __pyx_mstate->__pyx_kp_b_iso88591_A_T_a_a_1F_4uA_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 608};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exc, __pyx_mstate->__pyx_n_u_gvec};
    __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_petscvec_pxi, __pyx_mstate->__pyx_n_u_exit, __pyx_mstate->__pyx_kp_b_iso88591_A_T_a_a_q_at5_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 280};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_petscdmda_pxi, __pyx_mstate->__pyx_n_u_enter, __pyx_mstate->__pyx_kp_b_iso88591_A_HA_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 284};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exc};
    __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_petscdmda_pxi, __pyx_mstate->__pyx_n_u_exit, __pyx_mstate->__pyx_kp_b_iso88591_A_HA_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 43};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_petscdmcomposite, __pyx_mstate->__pyx_n_u_enter, __pyx_mstate->__pyx_kp_b_iso88591_A_D_a_U_gT_WTXXY_Jawat5_T_uAT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 49};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exc, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_petscdmcomposite, __pyx_mstate->__pyx_n_u_exit, __pyx_mstate->__pyx_kp_b_iso88591_A_t1_G9D_T_G1_a_AT_d_XTQXX_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 13};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ierr};
    __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Error_pyx, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_q_HA_N_IQfD, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 18};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ierr};
    __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Error_pyx, __pyx_mstate->__pyx_n_u_bool_2, __pyx_mstate->__pyx_kp_b_iso88591_A_A_uCq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Error_pyx, __pyx_mstate->__pyx_n_u_repr, __pyx_mstate->__pyx_kp_b_iso88591_A_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 25};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_csize, __pyx_mstate->__pyx_n_u_crank, __pyx_mstate->__pyx_n_u_width, __pyx_mstate->__pyx_n_u_rank, __pyx_mstate->__pyx_n_u_tblist, __pyx_mstate->__pyx_n_u_entry, __pyx_mstate->__pyx_n_u_tbline};
    __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Error_pyx, __pyx_mstate->__pyx_n_u_str, __pyx_mstate->__pyx_kp_b_iso88591_A_y_5_Q_AQ_AQ_wc_Qe1E_D_IT_7_t5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 79};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_4uCvQ_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 85};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_4uCvQ_a_1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 91};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_clear, __pyx_mstate->__pyx_kp_b_iso88591_q_4uCvQ_a_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 97};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 116};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cprefix};
    __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_prefixPush, __pyx_mstate->__pyx_kp_b_iso88591_C1_1_1_81A_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 131};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_prefixPop, __pyx_mstate->__pyx_kp_b_iso88591_1_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 144};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_pr, __pyx_mstate->__pyx_n_u_nm, __pyx_mstate->__pyx_n_u_unused, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_hasName, __pyx_mstate->__pyx_kp_b_iso88591_HA_a_a_WAT_Qa_a_a_4vT_Qa_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 153};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_key_2, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_used, __pyx_mstate->__pyx_kp_b_iso88591_q_a_y_q_a_q_F_q_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 161};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_pr, __pyx_mstate->__pyx_n_u_nm, __pyx_mstate->__pyx_n_u_unused, __pyx_mstate->__pyx_n_u_option, __pyx_mstate->__pyx_n_u_key_2, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_setValue, __pyx_mstate->__pyx_kp_b_iso88591_Q_E_E_F_a_a_WAT_Qa_3c_Yaq_XS_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 203};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_pr, __pyx_mstate->__pyx_n_u_nm, __pyx_mstate->__pyx_n_u_unused, __pyx_mstate->__pyx_n_u_option, __pyx_mstate->__pyx_n_u_key_2};
    __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_delValue, __pyx_mstate->__pyx_kp_b_iso88591_XQ_a_a_WAT_Qa_3c_Yaq_XS_y_AQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 226};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_default};
    __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_getBool, __pyx_mstate->__pyx_kp_b_iso88591_M_vQd_ivQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 246};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_default};
    __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_getBoolArray, __pyx_mstate->__pyx_kp_b_iso88591_iq_vQd_t9F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 266};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_default};
    __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_getInt, __pyx_mstate->__pyx_kp_b_iso88591_vQd_YfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 286};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_default};
    __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_getIntArray, __pyx_mstate->__pyx_kp_b_iso88591_Ya_vQd_d_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 306};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_default};
    __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_getReal, __pyx_mstate->__pyx_kp_b_iso88591_M_vQd_ivQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 326};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_default};
    __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_getRealArray, __pyx_mstate->__pyx_kp_b_iso88591_iq_vQd_t9F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 346};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_default};
    __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_getScalar, __pyx_mstate->__pyx_kp_b_iso88591_m9A_vQd_D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 366};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_default};
    __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_getScalarArray, __pyx_mstate->__pyx_kp_b_iso88591_vQd_1_YfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 386};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_default};
    __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_getString, __pyx_mstate->__pyx_kp_b_iso88591_m9A_vQd_D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 408};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_string, __pyx_mstate->__pyx_n_u_cstring};
    __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_insertString, __pyx_mstate->__pyx_kp_b_iso88591_81_1_81A_a_q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 422};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_allopts, __pyx_mstate->__pyx_n_u_options};
    __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Options_pyx, __pyx_mstate->__pyx_n_u_getAll, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_fAQ_1A_ay_xq_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 7};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_devel, __pyx_mstate->__pyx_n_u_date, __pyx_mstate->__pyx_n_u_author, __pyx_mstate->__pyx_n_u_cversion, __pyx_mstate->__pyx_n_u_major, __pyx_mstate->__pyx_n_u_minor, __pyx_mstate->__pyx_n_u_micro, __pyx_mstate->__pyx_n_u_release, __pyx_mstate->__pyx_n_u_out, __pyx_mstate->__pyx_n_u_version, __pyx_mstate->__pyx_n_u_vstr, __pyx_mstate->__pyx_n_u_s_2};
    __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_getVersion, __pyx_mstate->__pyx_kp_b_iso88591_A_a_Q_z_IYk_a_az_a_AQgQgQgQa_k_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 62};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_version, __pyx_mstate->__pyx_n_u_dev, __pyx_mstate->__pyx_n_u_date, __pyx_mstate->__pyx_n_u_author};
    __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_getVersionInfo, __pyx_mstate->__pyx_kp_b_iso88591_A_fIS_1F_M_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 88};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls};
    __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_isInitialized, __pyx_mstate->__pyx_kp_b_iso88591_A_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 101};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls};
    __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_isFinalized, __pyx_mstate->__pyx_kp_b_iso88591_A_vQa_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 116};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_comm};
    __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_getDefaultComm, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_HA_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 131};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm};
    __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_setDefaultComm, __pyx_mstate->__pyx_kp_b_iso88591_A_2_havQ_6_A_AQ_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 3, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS), 155};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_sep, __pyx_mstate->__pyx_n_u_end, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kwargs, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_format, __pyx_mstate->__pyx_n_u_message, __pyx_mstate->__pyx_n_u_m};
    __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_Print, __pyx_mstate->__pyx_kp_b_iso88591_A_1_1_A_havQ_9AWCq_t6_QfE_3aq_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 4, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS), 197};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_sep, __pyx_mstate->__pyx_n_u_end, __pyx_mstate->__pyx_n_u_flush, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kwargs, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_format, __pyx_mstate->__pyx_n_u_message, __pyx_mstate->__pyx_n_u_m};
    __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_syncPrint, __pyx_mstate->__pyx_kp_b_iso88591_A_1_1_a_A_2_havQ_4vXQ_Rs_1_b_Q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 240};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm};
    __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_syncFlush, __pyx_mstate->__pyx_kp_b_iso88591_A_9A_havQ_a_QgQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 261};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_N};
    __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_splitOwnership, __pyx_mstate->__pyx_kp_b_iso88591_A_A_IQB_havQ_e1_q_AS_3c_uA_2Rs_b, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 310};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_seconds, __pyx_mstate->__pyx_n_u_s_2};
    __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_sleep, __pyx_mstate->__pyx_kp_b_iso88591_A_HA_6_az, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 331};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_errhandler, __pyx_mstate->__pyx_n_u_handler};
    __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_pushErrorHandler, __pyx_mstate->__pyx_kp_b_iso88591_A_2_2_c_2_1_a_1_a_1_a_1_a_1_a_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 366};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls};
    __pyx_mstate_global->__pyx_codeobj_tab[49] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_popErrorHandler, __pyx_mstate->__pyx_kp_b_iso88591_A_a_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 379};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls};
    __pyx_mstate_global->__pyx_codeobj_tab[50] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_popSignalHandler, __pyx_mstate->__pyx_kp_b_iso88591_A_a_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 392};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_tval, __pyx_mstate->__pyx_n_u_cfilename, __pyx_mstate->__pyx_n_u_cmode};
    __pyx_mstate_global->__pyx_codeobj_tab[51] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_infoAllow, __pyx_mstate->__pyx_kp_b_iso88591_A_q_HA_a_Q_6_a_Qa_9G1_y_1A_9AV1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 426};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_citation, __pyx_mstate->__pyx_n_u_cit, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[52] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_registerCitation, __pyx_mstate->__pyx_kp_b_iso88591_A_0_4z_z_q_9AZq_l_1_a_Qe1A_AZvQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[52])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 449};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_package, __pyx_mstate->__pyx_n_u_cpackage, __pyx_mstate->__pyx_n_u_has};
    __pyx_mstate_global->__pyx_codeobj_tab[53] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Sys_pyx, __pyx_mstate->__pyx_n_u_hasExternalPackage, __pyx_mstate->__pyx_kp_b_iso88591_A_1_A_1IQa_Q_a_az_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 11};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_stageid, __pyx_mstate->__pyx_n_u_stage};
    __pyx_mstate_global->__pyx_codeobj_tab[54] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_Stage, __pyx_mstate->__pyx_kp_b_iso88591_A_4vV_Qa_y_q_a_l_1_6_gQ_a_7_1_84, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[54])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 45};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_classid, __pyx_mstate->__pyx_n_u_klass};
    __pyx_mstate_global->__pyx_codeobj_tab[55] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_Class, __pyx_mstate->__pyx_kp_b_iso88591_A_4vV_Qa_y_q_a_l_1_6_gQ_a_7_1_84, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[55])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 79};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_klass, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_classid, __pyx_mstate->__pyx_n_u_eventid, __pyx_mstate->__pyx_n_u_event};
    __pyx_mstate_global->__pyx_codeobj_tab[56] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_Event, __pyx_mstate->__pyx_kp_b_iso88591_A_7y_4vV_Qa_y_q_Q_a_6_j_l_1_6_gQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 117};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls};
    __pyx_mstate_global->__pyx_codeobj_tab[57] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_begin, __pyx_mstate->__pyx_kp_b_iso88591_A_a_1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 130};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[58] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_A_q_7_vV1_4s_a_a_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[58])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 151};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_flops, __pyx_mstate->__pyx_n_u_cflops};
    __pyx_mstate_global->__pyx_codeobj_tab[59] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_logFlops, __pyx_mstate->__pyx_kp_b_iso88591_A_q_1_a_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[59])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 170};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_flops, __pyx_mstate->__pyx_n_u_cflops};
    __pyx_mstate_global->__pyx_codeobj_tab[60] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_addFlops, __pyx_mstate->__pyx_kp_b_iso88591_A_q_1_a_AQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[60])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 193};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_cflops};
    __pyx_mstate_global->__pyx_codeobj_tab[61] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_getFlops, __pyx_mstate->__pyx_kp_b_iso88591_A_1_a_AQa_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 213};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_wctime};
    __pyx_mstate_global->__pyx_codeobj_tab[62] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_getTime, __pyx_mstate->__pyx_kp_b_iso88591_A_1_ay_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[62])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 233};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_cputime};
    __pyx_mstate_global->__pyx_codeobj_tab[63] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_getCPUTime, __pyx_mstate->__pyx_kp_b_iso88591_A_A_a_aq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[63])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 240};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_klass, __pyx_mstate->__pyx_n_u_decorator, __pyx_mstate->__pyx_n_u_decorator};
    __pyx_mstate_global->__pyx_codeobj_tab[64] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_EventDecorator, __pyx_mstate->__pyx_kp_b_iso88591_A_Ya_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[64])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 255};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[65] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_isActive, __pyx_mstate->__pyx_kp_b_iso88591_A_a_a_q_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[65])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 288};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[66] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_enter, __pyx_mstate->__pyx_kp_b_iso88591_A_E_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[66])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 292};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exc};
    __pyx_mstate_global->__pyx_codeobj_tab[67] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_exit, __pyx_mstate->__pyx_kp_b_iso88591_A_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[67])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 297};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[68] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_push, __pyx_mstate->__pyx_kp_b_iso88591_a_a_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[68])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 309};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[69] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_pop, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[69])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 324};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[70] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_getName, __pyx_mstate->__pyx_kp_b_iso88591_a_AT_aq_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[70])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 341};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[71] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_activate, __pyx_mstate->__pyx_kp_b_iso88591_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[71])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 353};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[72] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_deactivate, __pyx_mstate->__pyx_kp_b_iso88591_A_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[72])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 365};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[73] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_getActive, __pyx_mstate->__pyx_kp_b_iso88591_1_a_a_Qd_q_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[73])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 379};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_tval};
    __pyx_mstate_global->__pyx_codeobj_tab[74] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_setActive, __pyx_mstate->__pyx_kp_b_iso88591_iq_a_6_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[74])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 403};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[75] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_getVisible, __pyx_mstate->__pyx_kp_b_iso88591_A_a_a_at5_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[75])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 417};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_tval};
    __pyx_mstate_global->__pyx_codeobj_tab[76] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_setVisible, __pyx_mstate->__pyx_kp_b_iso88591_y_a_6_a_at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[76])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 476};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[77] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_getName, __pyx_mstate->__pyx_kp_b_iso88591_a_AT_aq_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[77])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 493};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[78] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_activate, __pyx_mstate->__pyx_kp_b_iso88591_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[78])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 497};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[79] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_deactivate, __pyx_mstate->__pyx_kp_b_iso88591_A_a_at1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[79])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 501};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[80] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_getActive, __pyx_mstate->__pyx_kp_b_iso88591_1_a_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[80])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 506};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[81] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_setActive, __pyx_mstate->__pyx_kp_b_iso88591_iq_1_Q_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[81])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 551};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[82] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_enter, __pyx_mstate->__pyx_kp_b_iso88591_A_F_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[82])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 555};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exc};
    __pyx_mstate_global->__pyx_codeobj_tab[83] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_exit, __pyx_mstate->__pyx_kp_b_iso88591_A_D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[83])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 558};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_objs, __pyx_mstate->__pyx_n_u_o};
    __pyx_mstate_global->__pyx_codeobj_tab[84] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_begin, __pyx_mstate->__pyx_kp_b_iso88591_a_q_a_a_e1AT_4q_Qaq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[84])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 577};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_objs, __pyx_mstate->__pyx_n_u_o};
    __pyx_mstate_global->__pyx_codeobj_tab[85] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_end, __pyx_mstate->__pyx_kp_b_iso88591_A_q_a_a_q_E_4q_Qat1AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[85])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 597};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[86] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_getName, __pyx_mstate->__pyx_kp_b_iso88591_a_AT_aq_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[86])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 614};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[87] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_activate, __pyx_mstate->__pyx_kp_b_iso88591_a_AT_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[87])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 626};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[88] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_deactivate, __pyx_mstate->__pyx_kp_b_iso88591_A_a_at1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[88])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 638};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[89] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_getActive, __pyx_mstate->__pyx_kp_b_iso88591_1_a_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[89])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 643};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[90] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_setActive, __pyx_mstate->__pyx_kp_b_iso88591_iq_1_Q_4q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[90])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 671};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[91] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_getActiveAll, __pyx_mstate->__pyx_kp_b_iso88591_a_a_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[91])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 676};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_tval};
    __pyx_mstate_global->__pyx_codeobj_tab[92] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_setActiveAll, __pyx_mstate->__pyx_kp_b_iso88591_a_6_a_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[92])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 705};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stage, __pyx_mstate->__pyx_n_u_info, __pyx_mstate->__pyx_n_u_cstage};
    __pyx_mstate_global->__pyx_codeobj_tab[93] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Log_pyx, __pyx_mstate->__pyx_n_u_getPerfInfo, __pyx_mstate->__pyx_kp_b_iso88591_iq_q_6_iuAQ_a_q_XT_aq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[93])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 61};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[94] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Comm_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_4vS_q_4t1_AQ_a_q_Q_HA_IQ_HA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[94])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 79};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_newcomm, __pyx_mstate->__pyx_n_u_comm};
    __pyx_mstate_global->__pyx_codeobj_tab[95] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Comm_pyx, __pyx_mstate->__pyx_n_u_duplicate, __pyx_mstate->__pyx_kp_b_iso88591_1_4vS_AQ_a_gQiq_Qe1_IQ_IQ_HD_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[95])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 99};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size};
    __pyx_mstate_global->__pyx_codeobj_tab[96] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Comm_pyx, __pyx_mstate->__pyx_n_u_getSize, __pyx_mstate->__pyx_kp_b_iso88591_4vS_AQ_a_q_G1A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[96])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 111};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rank};
    __pyx_mstate_global->__pyx_codeobj_tab[97] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Comm_pyx, __pyx_mstate->__pyx_n_u_getRank, __pyx_mstate->__pyx_kp_b_iso88591_4vS_AQ_a_q_G1A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[97])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 123};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[98] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Comm_pyx, __pyx_mstate->__pyx_n_u_barrier, __pyx_mstate->__pyx_kp_b_iso88591_4vS_AQ_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[98])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 155};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm};
    __pyx_mstate_global->__pyx_codeobj_tab[99] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Comm_pyx, __pyx_mstate->__pyx_n_u_tompi4py, __pyx_mstate->__pyx_kp_b_iso88591_T_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[99])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 32};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_obj, __pyx_mstate->__pyx_n_u_o};
    __pyx_mstate_global->__pyx_codeobj_tab[100] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_copy_2, __pyx_mstate->__pyx_kp_b_iso88591_A_auA_T_Qa_2S_q_4q_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[100])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 40};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_memo, __pyx_mstate->__pyx_n_u_obj_copy};
    __pyx_mstate_global->__pyx_codeobj_tab[101] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_deepcopy, __pyx_mstate->__pyx_kp_b_iso88591_A_q_t1_a_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[101])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 62};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[102] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_at4q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[102])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 81};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[103] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_4t1A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[103])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 94};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[104] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_a_d_4q_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[104])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 110};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[105] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_setOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_q_81A_a_4t1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[105])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 124};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[106] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_getOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_a_4t1D_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[106])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 138};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[107] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_appendOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_81A_a_Qd_at1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[107])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 152};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[108] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[108])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 167};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_objpre, __pyx_mstate->__pyx_n_u_pobj, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[109] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_viewFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_8_vT_wj_y_q_a_d_4vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[109])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 190};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_handler};
    __pyx_mstate_global->__pyx_codeobj_tab[110] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_setOptionsHandler, __pyx_mstate->__pyx_kp_b_iso88591_PPQ_87_q_D___eef_Q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[110])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 213};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[111] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_destroyOptionsHandlers, __pyx_mstate->__pyx_kp_b_iso88591_IQ_a_0_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[111])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 228};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm};
    __pyx_mstate_global->__pyx_codeobj_tab[112] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_getComm, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_d_4q_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[112])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 242};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[113] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_getName, __pyx_mstate->__pyx_kp_b_iso88591_a_d_4q_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[113])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 256};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[114] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_setName, __pyx_mstate->__pyx_kp_b_iso88591_A_y_q_a_d_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[114])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 270};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_classid};
    __pyx_mstate_global->__pyx_codeobj_tab[115] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_getClassId, __pyx_mstate->__pyx_kp_b_iso88591_A_A_a_AT_Qd_1_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[115])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 284};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[116] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_getClassName, __pyx_mstate->__pyx_kp_b_iso88591_a_a_at4q_AQ_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[116])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 298};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_refcnt};
    __pyx_mstate_global->__pyx_codeobj_tab[117] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_getRefCount, __pyx_mstate->__pyx_kp_b_iso88591_Q_4t1Cs_q_q_a_at4q_AQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[117])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 313};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cid};
    __pyx_mstate_global->__pyx_codeobj_tab[118] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_getId, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_D_Qa_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[118])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 329};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_obj, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_cobj};
    __pyx_mstate_global->__pyx_codeobj_tab[119] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_compose, __pyx_mstate->__pyx_kp_b_iso88591_y_q_4wfG3d_1_a_d_4vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[119])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 352};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_cobj, __pyx_mstate->__pyx_n_u_obj};
    __pyx_mstate_global->__pyx_codeobj_tab[120] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_query, __pyx_mstate->__pyx_kp_b_iso88591_y_q_a_q_D_V1A_5_6_a_4q_Q_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[120])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 372};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_obj, __pyx_mstate->__pyx_n_u_refct};
    __pyx_mstate_global->__pyx_codeobj_tab[121] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_incRef, __pyx_mstate->__pyx_kp_b_iso88591_t4q_a_4s_q_5_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[121])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 389};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_obj, __pyx_mstate->__pyx_n_u_refct};
    __pyx_mstate_global->__pyx_codeobj_tab[122] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_decRef, __pyx_mstate->__pyx_kp_b_iso88591_t4q_a_4s_5_vS_4t1E_Q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[122])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 408};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[123] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_getAttr, __pyx_mstate->__pyx_kp_b_iso88591_XQ_y_q_t9AWA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[123])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 422};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_attr, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[124] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_setAttr, __pyx_mstate->__pyx_kp_b_iso88591_A_y_q_IQgV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[124])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 436};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[125] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_getDict, __pyx_mstate->__pyx_kp_b_iso88591_t9A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[125])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 450};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[126] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_stateIncrease, __pyx_mstate->__pyx_kp_b_iso88591_q_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[126])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 462};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state};
    __pyx_mstate_global->__pyx_codeobj_tab[127] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_stateGet, __pyx_mstate->__pyx_kp_b_iso88591_a_a_4t1D_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[127])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 476};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_cstate};
    __pyx_mstate_global->__pyx_codeobj_tab[128] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_stateSet, __pyx_mstate->__pyx_kp_b_iso88591_xq_uAQ_a_4t1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[128])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 491};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tab, __pyx_mstate->__pyx_n_u_parent, __pyx_mstate->__pyx_n_u_ctab, __pyx_mstate->__pyx_n_u_cobj};
    __pyx_mstate_global->__pyx_codeobj_tab[129] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_incrementTabLevel, __pyx_mstate->__pyx_kp_b_iso88591_9_U_1_hgS_PTTUUV_a_1D_AT_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[129])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 505};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_clevel};
    __pyx_mstate_global->__pyx_codeobj_tab[130] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_setTabLevel, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_a_Qd_at1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[130])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 518};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_clevel};
    __pyx_mstate_global->__pyx_codeobj_tab[131] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Object_pyx, __pyx_mstate->__pyx_n_u_getTabLevel, __pyx_mstate->__pyx_kp_b_iso88591_Q_q_a_Qd_at1A_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[131])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 59};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm};
    __pyx_mstate_global->__pyx_codeobj_tab[132] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_cyclicgc_pxi, __pyx_mstate->__pyx_n_u_garbage_cleanup, __pyx_mstate->__pyx_kp_b_iso88591_F_1_uE_1_uCq_q_A_a_1_q_a_6_A_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[132])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 83};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm};
    __pyx_mstate_global->__pyx_codeobj_tab[133] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_cyclicgc_pxi, __pyx_mstate->__pyx_n_u_garbage_view, __pyx_mstate->__pyx_kp_b_iso88591_a_uE_1_uCq_q_G1F_vS_j_1G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[133])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 138};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_obj};
    __pyx_mstate_global->__pyx_codeobj_tab[134] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_1_4s_4vQ_q_Q_4wit1_IT_c_IT_Qd_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[134])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 166};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[135] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[135])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 179};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newvwr};
    __pyx_mstate_global->__pyx_codeobj_tab[136] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_a_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[136])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 200};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_cmode, __pyx_mstate->__pyx_n_u_newvwr};
    __pyx_mstate_global->__pyx_codeobj_tab[137] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_createASCII, __pyx_mstate->__pyx_kp_b_iso88591_A_a_A_havQ_y_q_1_5_vXXQa_a_az_hd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[137])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 238};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_cmode, __pyx_mstate->__pyx_n_u_newvwr};
    __pyx_mstate_global->__pyx_codeobj_tab[138] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_createBinary, __pyx_mstate->__pyx_kp_b_iso88591_A_a_A_havQ_y_q_81A_a_AWG7_1_az_h, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[138])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 271};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_cmode, __pyx_mstate->__pyx_n_u_newvwr};
    __pyx_mstate_global->__pyx_codeobj_tab[139] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_createMPIIO, __pyx_mstate->__pyx_kp_b_iso88591_A_a_A_havQ_y_q_81A_a_az_hd_a_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[139])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 308};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_cmode, __pyx_mstate->__pyx_n_u_newvwr};
    __pyx_mstate_global->__pyx_codeobj_tab[140] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_createVTK, __pyx_mstate->__pyx_kp_b_iso88591_A_a_A_havQ_y_q_81A_a_az_hd_a_fA_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[140])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 344};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_cmode, __pyx_mstate->__pyx_n_u_newvwr};
    __pyx_mstate_global->__pyx_codeobj_tab[141] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_createHDF5, __pyx_mstate->__pyx_kp_b_iso88591_A_a_A_havQ_y_q_81A_a_az_hd_a_fA_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[141])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 380};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_display, __pyx_mstate->__pyx_n_u_title, __pyx_mstate->__pyx_n_u_position, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_cdisplay, __pyx_mstate->__pyx_n_u_ctitle, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_h, __pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_newvwr};
    __pyx_mstate_global->__pyx_codeobj_tab[142] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_createDraw, __pyx_mstate->__pyx_kp_b_iso88591_A_a_A_1_Q_A_havQ_A_1IQa_D_D_9HF, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[142])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 430};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vwr_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[143] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_q_A_9AZq_a_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[143])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 449};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[144] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_A_a_fAQ_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[144])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 463};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[145] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[145])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 475};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[146] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[146])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 488};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_format};
    __pyx_mstate_global->__pyx_codeobj_tab[147] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_getFormat, __pyx_mstate->__pyx_kp_b_iso88591_1_a_1D_aq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[147])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 502};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_format};
    __pyx_mstate_global->__pyx_codeobj_tab[148] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_pushFormat, __pyx_mstate->__pyx_kp_b_iso88591_A_a_AT_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[148])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 514};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[149] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_popFormat, __pyx_mstate->__pyx_kp_b_iso88591_1_a_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[149])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 526};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_sub};
    __pyx_mstate_global->__pyx_codeobj_tab[150] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_getSubViewer, __pyx_mstate->__pyx_kp_b_iso88591_y_havQ_a_at6_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[150])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 550};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sub, __pyx_mstate->__pyx_n_u_ccomm};
    __pyx_mstate_global->__pyx_codeobj_tab[151] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_restoreSubViewer, __pyx_mstate->__pyx_kp_b_iso88591_a_has_a_a_4vWAS, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[151])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 568};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_viewer};
    __pyx_mstate_global->__pyx_codeobj_tab[152] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_STDOUT, __pyx_mstate->__pyx_kp_b_iso88591_A_havQ_V1_g_a_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[152])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 586};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_viewer};
    __pyx_mstate_global->__pyx_codeobj_tab[153] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_STDERR, __pyx_mstate->__pyx_kp_b_iso88591_A_havQ_V1_g_a_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[153])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 604};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_viewer};
    __pyx_mstate_global->__pyx_codeobj_tab[154] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_ASCII, __pyx_mstate->__pyx_kp_b_iso88591_A_9A_havQ_y_q_V1_a_1G7_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[154])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 625};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_viewer};
    __pyx_mstate_global->__pyx_codeobj_tab[155] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_BINARY, __pyx_mstate->__pyx_kp_b_iso88591_A_havQ_V1_g_a_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[155])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 643};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_viewer};
    __pyx_mstate_global->__pyx_codeobj_tab[156] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_DRAW, __pyx_mstate->__pyx_kp_b_iso88591_A_iq_havQ_V1_g_q_a_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[156])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 663};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tabs, __pyx_mstate->__pyx_n_u_ctabs};
    __pyx_mstate_global->__pyx_codeobj_tab[157] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_setASCIITab, __pyx_mstate->__pyx_kp_b_iso88591_e1A_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[157])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 676};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tabs};
    __pyx_mstate_global->__pyx_codeobj_tab[158] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_getASCIITab, __pyx_mstate->__pyx_kp_b_iso88591_Q_Q_a_Qd_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[158])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 690};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tabs, __pyx_mstate->__pyx_n_u_ctabs};
    __pyx_mstate_global->__pyx_codeobj_tab[159] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_addASCIITab, __pyx_mstate->__pyx_kp_b_iso88591_e1A_a_Qd_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[159])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 703};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tabs, __pyx_mstate->__pyx_n_u_ctabs};
    __pyx_mstate_global->__pyx_codeobj_tab[160] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_subtractASCIITab, __pyx_mstate->__pyx_kp_b_iso88591_XQ_e1A_a_4vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[160])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 716};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[161] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_pushASCIISynchronized, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[161])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 729};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[162] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_popASCIISynchronized, __pyx_mstate->__pyx_kp_b_iso88591_a_a_at1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[162])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 742};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[163] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_pushASCIITab, __pyx_mstate->__pyx_kp_b_iso88591_a_a_at1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[163])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 754};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[164] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_popASCIITab, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[164])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 766};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_flg};
    __pyx_mstate_global->__pyx_codeobj_tab[165] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_useASCIITabs, __pyx_mstate->__pyx_kp_b_iso88591_V1A_a_at6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[165])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 779};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_msg, __pyx_mstate->__pyx_n_u_cmsg};
    __pyx_mstate_global->__pyx_codeobj_tab[166] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_printfASCII, __pyx_mstate->__pyx_kp_b_iso88591_xq_iq_Qa_a_Qd_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[166])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 793};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_msg, __pyx_mstate->__pyx_n_u_cmsg};
    __pyx_mstate_global->__pyx_codeobj_tab[167] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_printfASCIISynchronized, __pyx_mstate->__pyx_kp_b_iso88591_81_iq_Qa_a_1_fF, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[167])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 809};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[168] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_flush, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[168])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 821};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mode};
    __pyx_mstate_global->__pyx_codeobj_tab[169] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_setFileMode, __pyx_mstate->__pyx_kp_b_iso88591_31_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[169])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 833};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mode};
    __pyx_mstate_global->__pyx_codeobj_tab[170] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_getFileMode, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[170])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 847};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[171] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_setFileName, __pyx_mstate->__pyx_kp_b_iso88591_y_q_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[171])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 861};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[172] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_getFileName, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_Qd_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[172])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 877};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_display, __pyx_mstate->__pyx_n_u_title, __pyx_mstate->__pyx_n_u_position, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_cdisplay, __pyx_mstate->__pyx_n_u_ctitle, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_h, __pyx_mstate->__pyx_n_u_w};
    __pyx_mstate_global->__pyx_codeobj_tab[173] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_setDrawInfo, __pyx_mstate->__pyx_kp_b_iso88591_A_a_A_1_Q_A_1IQa_D_D_9HF_t1_5_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[173])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 921};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[174] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_clearDraw, __pyx_mstate->__pyx_kp_b_iso88591_1_a_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[174])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 933};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newvwr};
    __pyx_mstate_global->__pyx_codeobj_tab[175] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_createPython, __pyx_mstate->__pyx_kp_b_iso88591_F_nIQ_havQ_a_az_hd_a_fA_a_4vWA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[175])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 961};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[176] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_setPythonContext, __pyx_mstate->__pyx_kp_b_iso88591_a_4vWA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[176])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 973};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[177] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_getPythonContext, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_4vQa_83fG1_Ya, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[177])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 988};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_py_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[178] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_setPythonType, __pyx_mstate->__pyx_kp_b_iso88591_XQ_1IQa_a_q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[178])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1003};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[179] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_getPythonType, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_F_1_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[179])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1018};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_obj};
    __pyx_mstate_global->__pyx_codeobj_tab[180] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_viewObjectPython, __pyx_mstate->__pyx_kp_b_iso88591_a_a_4vS_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[180])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1044};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_cmode, __pyx_mstate->__pyx_n_u_newvwr};
    __pyx_mstate_global->__pyx_codeobj_tab[181] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_A_havQ_y_q_81A_a_az_hd_a_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[181])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1080};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[182] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_pushTimestepping, __pyx_mstate->__pyx_kp_b_iso88591_a_at1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[182])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1092};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[183] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_popTimestepping, __pyx_mstate->__pyx_kp_b_iso88591_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[183])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1104};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ctimestep};
    __pyx_mstate_global->__pyx_codeobj_tab[184] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_getTimestep, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_fAQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[184])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1119};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_timestep};
    __pyx_mstate_global->__pyx_codeobj_tab[185] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_setTimestep, __pyx_mstate->__pyx_kp_b_iso88591_HA_a_fE, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[185])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1132};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[186] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_incrementTimestep, __pyx_mstate->__pyx_kp_b_iso88591_1_a_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[186])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1145};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_group, __pyx_mstate->__pyx_n_u_cgroup};
    __pyx_mstate_global->__pyx_codeobj_tab[187] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_pushGroup, __pyx_mstate->__pyx_kp_b_iso88591_xq_a_q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[187])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1159};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[188] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_popGroup, __pyx_mstate->__pyx_kp_b_iso88591_a_at1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[188])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1171};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cgroup, __pyx_mstate->__pyx_n_u_group};
    __pyx_mstate_global->__pyx_codeobj_tab[189] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Viewer_pyx, __pyx_mstate->__pyx_n_u_getGroup, __pyx_mstate->__pyx_kp_b_iso88591_a_at6_q_ay_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[189])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 41};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[190] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Random_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_t5_1_q_7_vV1_a_at6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[190])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 61};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[191] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Random_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[191])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 74};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm};
    __pyx_mstate_global->__pyx_codeobj_tab[192] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Random_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_a_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[192])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 93};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rnd_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[193] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Random_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_6a_A_9AZq_a_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[193])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 112};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[194] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Random_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_A_a_fAQ_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[194])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 126};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[195] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Random_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[195])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 138};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[196] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Random_pyx, __pyx_mstate->__pyx_n_u_getValue, __pyx_mstate->__pyx_kp_b_iso88591_a_4vQa_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[196])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 152};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[197] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Random_pyx, __pyx_mstate->__pyx_n_u_getValueReal, __pyx_mstate->__pyx_kp_b_iso88591_a_a_a_at6_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[197])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 166};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_seed};
    __pyx_mstate_global->__pyx_codeobj_tab[198] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Random_pyx, __pyx_mstate->__pyx_n_u_getSeed, __pyx_mstate->__pyx_kp_b_iso88591_q_a_fAQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[198])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 180};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_seed};
    __pyx_mstate_global->__pyx_codeobj_tab[199] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Random_pyx, __pyx_mstate->__pyx_n_u_setSeed, __pyx_mstate->__pyx_kp_b_iso88591_M_5_q_Qd_a_at1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[199])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 199};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sval1, __pyx_mstate->__pyx_n_u_sval2};
    __pyx_mstate_global->__pyx_codeobj_tab[200] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Random_pyx, __pyx_mstate->__pyx_n_u_getInterval, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_Qd_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[200])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 214};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_interval, __pyx_mstate->__pyx_n_u_sval1, __pyx_mstate->__pyx_n_u_sval2, __pyx_mstate->__pyx_n_u_low, __pyx_mstate->__pyx_n_u_high};
    __pyx_mstate_global->__pyx_codeobj_tab[201] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Random_pyx, __pyx_mstate->__pyx_n_u_setInterval, __pyx_mstate->__pyx_kp_b_iso88591_a_WA_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[201])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kwargs};
    __pyx_mstate_global->__pyx_codeobj_tab[202] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_get, __pyx_mstate->__pyx_kp_b_iso88591_A_t5_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[202])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS), 34};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u__29, __pyx_mstate->__pyx_n_u__30};
    __pyx_mstate_global->__pyx_codeobj_tab[203] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_lambda, __pyx_mstate->__pyx_kp_b_iso88591_11EQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[203])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 94};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_dtype, __pyx_mstate->__pyx_n_u_device_id, __pyx_mstate->__pyx_n_u_cdevice_id, __pyx_mstate->__pyx_n_u_cdevice_type, __pyx_mstate->__pyx_n_u_device};
    __pyx_mstate_global->__pyx_codeobj_tab[204] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_A_1_E_L_zY_aab_Cq_a_1F_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[204])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 120};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[205] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[205])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 132};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[206] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_configure, __pyx_mstate->__pyx_kp_b_iso88591_1_a_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[206])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 144};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[207] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_a_at9A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[207])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 165};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cdtype};
    __pyx_mstate_global->__pyx_codeobj_tab[208] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_getDeviceType, __pyx_mstate->__pyx_kp_b_iso88591_q_a_a_iq_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[208])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 180};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cdevice_id};
    __pyx_mstate_global->__pyx_codeobj_tab[209] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_getDeviceId, __pyx_mstate->__pyx_kp_b_iso88591_Q_1_a_Qd_1A_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[209])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 195};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_device_type, __pyx_mstate->__pyx_n_u_cdevice_type};
    __pyx_mstate_global->__pyx_codeobj_tab[210] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_setDefaultType, __pyx_mstate->__pyx_kp_b_iso88591_A_31_L_a_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[210])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 240};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dctx};
    __pyx_mstate_global->__pyx_codeobj_tab[211] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[211])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 255};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[212] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[212])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 268};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cstream_type};
    __pyx_mstate_global->__pyx_codeobj_tab[213] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_getStreamType, __pyx_mstate->__pyx_kp_b_iso88591_q_A_a_at7_1_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[213])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 283};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stream_type, __pyx_mstate->__pyx_n_u_cstream_type};
    __pyx_mstate_global->__pyx_codeobj_tab[214] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_setStreamType, __pyx_mstate->__pyx_kp_b_iso88591_a_L_a_at7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[214])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 302};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_device};
    __pyx_mstate_global->__pyx_codeobj_tab[215] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_getDevice, __pyx_mstate->__pyx_kp_b_iso88591_1_a_4waq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[215])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 317};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_device, __pyx_mstate->__pyx_n_u_cdevice};
    __pyx_mstate_global->__pyx_codeobj_tab[216] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_setDevice, __pyx_mstate->__pyx_kp_b_iso88591_31_4AQ_a_4wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[216])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 336};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[217] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_a_at1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[217])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 348};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_octx};
    __pyx_mstate_global->__pyx_codeobj_tab[218] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_duplicate, __pyx_mstate->__pyx_kp_b_iso88591_1_auA_a_4wat1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[218])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 363};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_is_idle};
    __pyx_mstate_global->__pyx_codeobj_tab[219] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_idle, __pyx_mstate->__pyx_kp_b_iso88591_a_a_4waq_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[219])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 378};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other, __pyx_mstate->__pyx_n_u_cother};
    __pyx_mstate_global->__pyx_codeobj_tab[220] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_waitFor, __pyx_mstate->__pyx_kp_b_iso88591_6a_6_Qa_a_q_G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[220])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 399};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_stream_type, __pyx_mstate->__pyx_n_u_csubctxs, __pyx_mstate->__pyx_n_u_cstream_type, __pyx_mstate->__pyx_n_u_cn, __pyx_mstate->__pyx_n_u_subctxs, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[221] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_fork, __pyx_mstate->__pyx_kp_b_iso88591_PPYYZ_A_A_5_A_s_gT_q_7q_G_QUUVV, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[221])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 448};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_join_mode, __pyx_mstate->__pyx_n_u_py_sub_ctxs, __pyx_mstate->__pyx_n_u_np_subctx, __pyx_mstate->__pyx_n_u_cjoin_mode, __pyx_mstate->__pyx_n_u_nctxs, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_dctx};
    __pyx_mstate_global->__pyx_codeobj_tab[222] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_join, __pyx_mstate->__pyx_kp_b_iso88591_SST_Q_5Zq_1A_a_9G2_K1A_G9A_aq_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[222])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 483};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[223] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_synchronize, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[223])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 500};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm};
    __pyx_mstate_global->__pyx_codeobj_tab[224] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_havQ_a_q_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[224])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 519};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_dctx};
    __pyx_mstate_global->__pyx_codeobj_tab[225] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_getCurrent, __pyx_mstate->__pyx_kp_b_iso88591_A_q_a_2_1A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[225])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 535};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_dctx, __pyx_mstate->__pyx_n_u_cdctx};
    __pyx_mstate_global->__pyx_codeobj_tab[226] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Device_pyx, __pyx_mstate->__pyx_n_u_setCurrent, __pyx_mstate->__pyx_kp_b_iso88591_A_2_5_q_AQ_a_2_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[226])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 45};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_buf};
    __pyx_mstate_global->__pyx_codeobj_tab[227] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_enter, __pyx_mstate->__pyx_kp_b_iso88591_A_j_IQnA_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[227])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 50};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exc, __pyx_mstate->__pyx_n_u_buf};
    __pyx_mstate_global->__pyx_codeobj_tab[228] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_exit, __pyx_mstate->__pyx_kp_b_iso88591_A_d_1A_IQnA_s_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[228])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 56};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_cviewer};
    __pyx_mstate_global->__pyx_codeobj_tab[229] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_1_7_z_q_avQd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[229])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 75};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[230] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_ay_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[230])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 88};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newiset};
    __pyx_mstate_global->__pyx_codeobj_tab[231] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_q_axq_q_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[231])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 109};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_is_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[232] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_1_1IQa_ay_WA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[232])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 128};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[233] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_ay_WAQ_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[233])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 142};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_nidx, __pyx_mstate->__pyx_n_u_idx, __pyx_mstate->__pyx_n_u_cm, __pyx_mstate->__pyx_n_u_newiset};
    __pyx_mstate_global->__pyx_codeobj_tab[234] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_createGeneral, __pyx_mstate->__pyx_kp_b_iso88591_A_IQ_havQ_Zq_q_9AV1A_a_awfE_Qa_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[234])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 171};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_nidx, __pyx_mstate->__pyx_n_u_idx, __pyx_mstate->__pyx_n_u_cm, __pyx_mstate->__pyx_n_u_newiset};
    __pyx_mstate_global->__pyx_codeobj_tab[235] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_createBlock, __pyx_mstate->__pyx_kp_b_iso88591_A_IQ_havQ_5_Zq_q_9AV1A_a_AWD_e4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[235])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 204};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_first, __pyx_mstate->__pyx_n_u_step, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_csize, __pyx_mstate->__pyx_n_u_cfirst, __pyx_mstate->__pyx_n_u_cstep, __pyx_mstate->__pyx_n_u_newiset};
    __pyx_mstate_global->__pyx_codeobj_tab[236] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_createStride, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_A_IQ_havQ_uAQ_uAQ_uAQ_q_a_Qg, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[236])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 239};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset};
    __pyx_mstate_global->__pyx_codeobj_tab[237] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_duplicate, __pyx_mstate->__pyx_kp_b_iso88591_1_t1E_a_4wat1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[237])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 253};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[238] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_copy, __pyx_mstate->__pyx_kp_b_iso88591_Ya_7_Q_T_q_6_s_at7_6_avQd_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[238])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 281};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_obj};
    __pyx_mstate_global->__pyx_codeobj_tab[239] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_load, __pyx_mstate->__pyx_kp_b_iso88591_Q_Q_V1_4vS_Qe1A_81F_4q_avQd_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[239])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 304};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset};
    __pyx_mstate_global->__pyx_codeobj_tab[240] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_allGather, __pyx_mstate->__pyx_kp_b_iso88591_1_r_a_4wat1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[240])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 320};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[241] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_toGeneral, __pyx_mstate->__pyx_kp_b_iso88591_1_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[241])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 333};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_toindx, __pyx_mstate->__pyx_n_u_ctoindx, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[242] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_buildTwoSided, __pyx_mstate->__pyx_kp_b_iso88591_iq0_q_7_z_q_1_a_at7_1F_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[242])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 363};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nlocal, __pyx_mstate->__pyx_n_u_cnlocal, __pyx_mstate->__pyx_n_u_iset};
    __pyx_mstate_global->__pyx_codeobj_tab[243] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_invertPermutation, __pyx_mstate->__pyx_kp_b_iso88591_Ya_7_z_aq_r_a_4wiq_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[243])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 387};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset};
    __pyx_mstate_global->__pyx_codeobj_tab[244] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_partitioningToNumbering, __pyx_mstate->__pyx_kp_b_iso88591_r_a_WAT_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[244])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 404};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_npart, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_counts, __pyx_mstate->__pyx_n_u_ocounts};
    __pyx_mstate_global->__pyx_codeobj_tab[245] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_partitioningCount, __pyx_mstate->__pyx_kp_b_iso88591_IQ_6_F_AT_U_1_a_84q_1_a_4wfA_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[245])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 436};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_N};
    __pyx_mstate_global->__pyx_codeobj_tab[246] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_getSize, __pyx_mstate->__pyx_kp_b_iso88591_ay_WAQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[246])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 450};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[247] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_getLocalSize, __pyx_mstate->__pyx_kp_b_iso88591_a_a_Qd_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[247])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 464};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_N};
    __pyx_mstate_global->__pyx_codeobj_tab[248] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_getSizes, __pyx_mstate->__pyx_kp_b_iso88591_a_Qd_ay_WAQ_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[248])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 486};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bs_2};
    __pyx_mstate_global->__pyx_codeobj_tab[249] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_getBlockSize, __pyx_mstate->__pyx_kp_b_iso88591_a_1_a_Qd_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[249])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 500};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_cbs};
    __pyx_mstate_global->__pyx_codeobj_tab[250] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_setBlockSize, __pyx_mstate->__pyx_kp_b_iso88591_xq_E_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[250])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 518};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[251] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_sort, __pyx_mstate->__pyx_kp_b_iso88591_a_avQd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[251])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 531};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[252] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_isSorted, __pyx_mstate->__pyx_kp_b_iso88591_a_axq_G1A_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[252])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 545};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[253] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_setPermutation, __pyx_mstate->__pyx_kp_b_iso88591_a_q_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[253])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 558};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[254] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_isPermutation, __pyx_mstate->__pyx_kp_b_iso88591_q_a_a_AT_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[254])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 572};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[255] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_setIdentity, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_AT_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[255])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 585};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[256] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_isIdentity, __pyx_mstate->__pyx_kp_b_iso88591_A_a_az_gQa_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[256])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 599};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[257] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_equal, __pyx_mstate->__pyx_kp_b_iso88591_a_awat7_gQa_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[257])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 618};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_out};
    __pyx_mstate_global->__pyx_codeobj_tab[258] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_sum, __pyx_mstate->__pyx_kp_b_iso88591_a_b_auAT_G1Cq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[258])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 637};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_out};
    __pyx_mstate_global->__pyx_codeobj_tab[259] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_expand, __pyx_mstate->__pyx_kp_b_iso88591_b_axq_G4was_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[259])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 664};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_flag1, __pyx_mstate->__pyx_n_u_flag2, __pyx_mstate->__pyx_n_u_out};
    __pyx_mstate_global->__pyx_codeobj_tab[260] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_union, __pyx_mstate->__pyx_kp_b_iso88591_2_0_axq_G1A_axq_G1A_b_5_T_b_5_W, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[260])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 699};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_out};
    __pyx_mstate_global->__pyx_codeobj_tab[261] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_intersect, __pyx_mstate->__pyx_kp_b_iso88591_b_a_4wd_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[261])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 723};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_out};
    __pyx_mstate_global->__pyx_codeobj_tab[262] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_difference, __pyx_mstate->__pyx_kp_b_iso88591_b_a_1D_t7_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[262])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 747};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nmin, __pyx_mstate->__pyx_n_u_nmax, __pyx_mstate->__pyx_n_u_cnmin, __pyx_mstate->__pyx_n_u_cnmax, __pyx_mstate->__pyx_n_u_out};
    __pyx_mstate_global->__pyx_codeobj_tab[263] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_complement, __pyx_mstate->__pyx_kp_b_iso88591_e1A_e1A_b_a_1D_wgQc_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[263])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 783};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_drop, __pyx_mstate->__pyx_n_u_bval, __pyx_mstate->__pyx_n_u_out};
    __pyx_mstate_global->__pyx_codeobj_tab[264] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_embed, __pyx_mstate->__pyx_kp_b_iso88591_9A4_a_b_awat7_gV1Cq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[264])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 814};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mult, __pyx_mstate->__pyx_n_u_mlt, __pyx_mstate->__pyx_n_u_out, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[265] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_renumber, __pyx_mstate->__pyx_kp_b_iso88591_y_1_5_vV4q_b_az_gU_3as_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[265])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 845};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_nidx, __pyx_mstate->__pyx_n_u_idx, __pyx_mstate->__pyx_n_u_cm};
    __pyx_mstate_global->__pyx_codeobj_tab[266] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_setIndices, __pyx_mstate->__pyx_kp_b_iso88591_4A_Zq_9AV1A_a_4wfE, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[266])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 862};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_oindices};
    __pyx_mstate_global->__pyx_codeobj_tab[267] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_getIndices, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_q_a_Qd_a_1D_q_q_wavQ_1D_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[267])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 883};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_nidx, __pyx_mstate->__pyx_n_u_idx, __pyx_mstate->__pyx_n_u_cm};
    __pyx_mstate_global->__pyx_codeobj_tab[268] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_setBlockIndices, __pyx_mstate->__pyx_kp_b_iso88591_3EQ_5_Zq_9AV1A_a_WD_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[268])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 906};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_oindices};
    __pyx_mstate_global->__pyx_codeobj_tab[269] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_getBlockIndices, __pyx_mstate->__pyx_kp_b_iso88591_XQ_q_a_Qd_a_Qd_a_WAQ_q_wat2T_WA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[269])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 928};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_first, __pyx_mstate->__pyx_n_u_step, __pyx_mstate->__pyx_n_u_csize, __pyx_mstate->__pyx_n_u_cfirst, __pyx_mstate->__pyx_n_u_cstep};
    __pyx_mstate_global->__pyx_codeobj_tab[270] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_setStride, __pyx_mstate->__pyx_kp_b_iso88591_l_vQ_e1A_uAQ_e1A_a_WG81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[270])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 952};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_first, __pyx_mstate->__pyx_n_u_step};
    __pyx_mstate_global->__pyx_codeobj_tab[271] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_getStride, __pyx_mstate->__pyx_kp_b_iso88591_1_9HA_a_Qd_a_at7_7_1_QgU_85, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[271])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 976};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_first, __pyx_mstate->__pyx_n_u_step};
    __pyx_mstate_global->__pyx_codeobj_tab[272] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_getInfo, __pyx_mstate->__pyx_kp_b_iso88591_j_a_at7_7_1_Qhe1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[272])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1192};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_lgmap_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[273] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_7q_5A_Ya_1A_a_AT_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[273])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1216};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[274] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_31D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[274])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1228};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_cviewer};
    __pyx_mstate_global->__pyx_codeobj_tab[275] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_1_7_z_q_a_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[275])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1247};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_obj};
    __pyx_mstate_global->__pyx_codeobj_tab[276] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_load, __pyx_mstate->__pyx_kp_b_iso88591_Q_Q_V1_4uCq_Qe1A_q_c_FBUUVVZZ_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[276])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1265};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[277] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_AQd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[277])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1278};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_nidx, __pyx_mstate->__pyx_n_u_idx, __pyx_mstate->__pyx_n_u_cm, __pyx_mstate->__pyx_n_u_newlgm};
    __pyx_mstate_global->__pyx_codeobj_tab[278] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_A_A_IQ_havQ_Zq_6_e5_3c_uA_9AV1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[278])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1313};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_newlgm};
    __pyx_mstate_global->__pyx_codeobj_tab[279] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_createIS, __pyx_mstate->__pyx_kp_b_iso88591_1_a_Q_q_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[279])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1334};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf, __pyx_mstate->__pyx_n_u_start, __pyx_mstate->__pyx_n_u_newlgm, __pyx_mstate->__pyx_n_u_cstart};
    __pyx_mstate_global->__pyx_codeobj_tab[280] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_createSF, __pyx_mstate->__pyx_kp_b_iso88591_XQ_uAQ_a_Qb_XQa_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[280])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1357};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[281] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_getSize, __pyx_mstate->__pyx_kp_b_iso88591_a_AT_q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[281])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1371};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bs_2};
    __pyx_mstate_global->__pyx_codeobj_tab[282] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_getBlockSize, __pyx_mstate->__pyx_kp_b_iso88591_a_1_a_1_fAQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[282])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1385};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_oindices};
    __pyx_mstate_global->__pyx_codeobj_tab[283] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_getIndices, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_q_a_A_F_1_a_q_F_1_q_wavQ_7q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[283])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1409};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_oindices};
    __pyx_mstate_global->__pyx_codeobj_tab[284] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_getBlockIndices, __pyx_mstate->__pyx_kp_b_iso88591_XQ_q_a_A_F_1_a_1_F_1_a_4A_F_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[284])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1435};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_nproc, __pyx_mstate->__pyx_n_u_procs, __pyx_mstate->__pyx_n_u_numprocs, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_neighs};
    __pyx_mstate_global->__pyx_codeobj_tab[285] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_getInfo, __pyx_mstate->__pyx_kp_b_iso88591_Q_4A_1_a_A_F_7_7_Qa_y_auAU_7_4w, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[285])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1464};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_nproc, __pyx_mstate->__pyx_n_u_procs, __pyx_mstate->__pyx_n_u_numprocs, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_neighs};
    __pyx_mstate_global->__pyx_codeobj_tab[286] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_getBlockInfo, __pyx_mstate->__pyx_kp_b_iso88591_a_Q_4A_1_a_1_F_7_7_Qa_y_auAU_7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[286])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1495};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_niidx, __pyx_mstate->__pyx_n_u_iidx, __pyx_mstate->__pyx_n_u_noidx, __pyx_mstate->__pyx_n_u_oidx};
    __pyx_mstate_global->__pyx_codeobj_tab[287] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_apply, __pyx_mstate->__pyx_kp_b_iso88591_A_10_k_k_9AWAQ_7_V9G1A_9AWAQ_vS, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[287])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1532};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_niidx, __pyx_mstate->__pyx_n_u_iidx, __pyx_mstate->__pyx_n_u_noidx, __pyx_mstate->__pyx_n_u_oidx};
    __pyx_mstate_global->__pyx_codeobj_tab[288] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_applyBlock, __pyx_mstate->__pyx_kp_b_iso88591_A_10_k_k_9AWAQ_7_V9G1A_9AWAQ_vS_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[288])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1569};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[289] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_applyIS, __pyx_mstate->__pyx_kp_b_iso88591_1_a_A_d_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[289])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1594};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_cmode, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_idx, __pyx_mstate->__pyx_n_u_nout, __pyx_mstate->__pyx_n_u_idxout, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[290] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_applyInverse, __pyx_mstate->__pyx_kp_b_iso88591_A_9A_A_5_vXQ_A_9AS_6_A_a_gS_QfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[290])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1633};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_cmode, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_idx, __pyx_mstate->__pyx_n_u_nout, __pyx_mstate->__pyx_n_u_idxout, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[291] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_IS_pyx, __pyx_mstate->__pyx_n_u_applyBlockInverse, __pyx_mstate->__pyx_kp_b_iso88591_A_9A_A_5_vXQ_A_9AS_6_A_a_gS_QfA_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[291])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 31};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[292] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_4uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[292])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 50};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[293] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_Qat1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[293])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 63};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newsf};
    __pyx_mstate_global->__pyx_codeobj_tab[294] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_Q_a_AWAQ_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[294])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 84};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[295] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_a_1IQa_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[295])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 103};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[296] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_a_Qd_q_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[296])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 117};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[297] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_AT_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[297])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 129};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[298] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_a_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[298])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 141};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[299] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_kp_b_iso88591_q_a_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[299])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 155};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nroots, __pyx_mstate->__pyx_n_u_nleaves, __pyx_mstate->__pyx_n_u_ilocal, __pyx_mstate->__pyx_n_u_iremote, __pyx_mstate->__pyx_n_u_local, __pyx_mstate->__pyx_n_u_remote};
    __pyx_mstate_global->__pyx_codeobj_tab[300] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_getGraph, __pyx_mstate->__pyx_kp_b_iso88591_A_a_a_at5_1HAQ_7_Q_F_3iq_G1IQ_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[300])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 190};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nroots, __pyx_mstate->__pyx_n_u_local, __pyx_mstate->__pyx_n_u_remote, __pyx_mstate->__pyx_n_u_cnroots, __pyx_mstate->__pyx_n_u_nleaves, __pyx_mstate->__pyx_n_u_nremote, __pyx_mstate->__pyx_n_u_ilocal, __pyx_mstate->__pyx_n_u_iremote};
    __pyx_mstate_global->__pyx_codeobj_tab[301] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_setGraph, __pyx_mstate->__pyx_kp_b_iso88591_BBTTU2_Qa_A_9L_6_HAWAYaq_1AXS_8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[301])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 229};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[302] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_setRankOrder, __pyx_mstate->__pyx_kp_b_iso88591_fAQ_a_4uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[302])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 247};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf};
    __pyx_mstate_global->__pyx_codeobj_tab[303] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_getMulti, __pyx_mstate->__pyx_kp_b_iso88591_Rq_a_U_2Q_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[303])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 262};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf};
    __pyx_mstate_global->__pyx_codeobj_tab[304] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_createInverse, __pyx_mstate->__pyx_kp_b_iso88591_q_Rq_a_Qd_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[304])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 279};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cdegree, __pyx_mstate->__pyx_n_u_nroots, __pyx_mstate->__pyx_n_u_degree};
    __pyx_mstate_global->__pyx_codeobj_tab[305] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_computeDegree, __pyx_mstate->__pyx_kp_b_iso88591_q_q_q_a_U_1_a_at5_a_at5_vQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[305])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 297};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_selected, __pyx_mstate->__pyx_n_u_nroots, __pyx_mstate->__pyx_n_u_cselected, __pyx_mstate->__pyx_n_u_sf};
    __pyx_mstate_global->__pyx_codeobj_tab[306] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_createEmbeddedRootSF, __pyx_mstate->__pyx_kp_b_iso88591_q_uAS_1_81Jaxq_Rq_a_4uHKq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[306])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 321};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_selected, __pyx_mstate->__pyx_n_u_nleaves, __pyx_mstate->__pyx_n_u_cselected, __pyx_mstate->__pyx_n_u_sf};
    __pyx_mstate_global->__pyx_codeobj_tab[307] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_createEmbeddedLeafSF, __pyx_mstate->__pyx_kp_b_iso88591_q_Qc_1_81Jay_Rq_a_4uI_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[307])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 345};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rootSection, __pyx_mstate->__pyx_n_u_remoteOffsets, __pyx_mstate->__pyx_n_u_leafSection, __pyx_mstate->__pyx_n_u_sectionSF, __pyx_mstate->__pyx_n_u_noffsets, __pyx_mstate->__pyx_n_u_cremoteOffsets};
    __pyx_mstate_global->__pyx_codeobj_tab[308] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_createSectionSF, __pyx_mstate->__pyx_kp_b_iso88591_BBppq0_Ba_HA_AZq_a_Qd_1_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[308])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 378};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rootSection, __pyx_mstate->__pyx_n_u_leafSection, __pyx_mstate->__pyx_n_u_lpStart, __pyx_mstate->__pyx_n_u_lpEnd, __pyx_mstate->__pyx_n_u_cremoteOffsets, __pyx_mstate->__pyx_n_u_remoteOffsets, __pyx_mstate->__pyx_n_u_ccomm};
    __pyx_mstate_global->__pyx_codeobj_tab[309] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_distributeSection, __pyx_mstate->__pyx_kp_b_iso88591_I_RS_a_hat7_s_e3a_QgQk_a_q_E_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[309])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 413};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf, __pyx_mstate->__pyx_n_u_csf};
    __pyx_mstate_global->__pyx_codeobj_tab[310] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_compose, __pyx_mstate->__pyx_kp_b_iso88591_b_a_Qd_r_as_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[310])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 434};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_unit, __pyx_mstate->__pyx_n_u_rootdata, __pyx_mstate->__pyx_n_u_leafdata, __pyx_mstate->__pyx_n_u_op, __pyx_mstate->__pyx_n_u_dtype, __pyx_mstate->__pyx_n_u_cop};
    __pyx_mstate_global->__pyx_codeobj_tab[311] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_bcastBegin, __pyx_mstate->__pyx_kp_b_iso88591_QQXXY0_5Qa_q_a_U_l_1_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[311])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 463};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_unit, __pyx_mstate->__pyx_n_u_rootdata, __pyx_mstate->__pyx_n_u_leafdata, __pyx_mstate->__pyx_n_u_op, __pyx_mstate->__pyx_n_u_dtype, __pyx_mstate->__pyx_n_u_cop};
    __pyx_mstate_global->__pyx_codeobj_tab[312] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_bcastEnd, __pyx_mstate->__pyx_kp_b_iso88591_OwVW_5Qa_q_a_at5_L_l_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[312])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 489};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_unit, __pyx_mstate->__pyx_n_u_leafdata, __pyx_mstate->__pyx_n_u_rootdata, __pyx_mstate->__pyx_n_u_op, __pyx_mstate->__pyx_n_u_dtype, __pyx_mstate->__pyx_n_u_cop};
    __pyx_mstate_global->__pyx_codeobj_tab[313] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_reduceBegin, __pyx_mstate->__pyx_kp_b_iso88591_RRYYZ_5Qa_q_a_e7_1A_Qk, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[313])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 517};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_unit, __pyx_mstate->__pyx_n_u_leafdata, __pyx_mstate->__pyx_n_u_rootdata, __pyx_mstate->__pyx_n_u_op, __pyx_mstate->__pyx_n_u_dtype, __pyx_mstate->__pyx_n_u_cop};
    __pyx_mstate_global->__pyx_codeobj_tab[314] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_reduceEnd, __pyx_mstate->__pyx_kp_b_iso88591_PPWWX_5Qa_q_a_q_E_1Kq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[314])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 543};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_unit, __pyx_mstate->__pyx_n_u_multirootdata, __pyx_mstate->__pyx_n_u_leafdata, __pyx_mstate->__pyx_n_u_dtype};
    __pyx_mstate_global->__pyx_codeobj_tab[315] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_scatterBegin, __pyx_mstate->__pyx_kp_b_iso88591_WWX_5Qa_a_4uG_AQ_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[315])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 569};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_unit, __pyx_mstate->__pyx_n_u_multirootdata, __pyx_mstate->__pyx_n_u_leafdata, __pyx_mstate->__pyx_n_u_dtype};
    __pyx_mstate_global->__pyx_codeobj_tab[316] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_scatterEnd, __pyx_mstate->__pyx_kp_b_iso88591_UUV_5Qa_a_U_l_1_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[316])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 592};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_unit, __pyx_mstate->__pyx_n_u_leafdata, __pyx_mstate->__pyx_n_u_multirootdata, __pyx_mstate->__pyx_n_u_dtype};
    __pyx_mstate_global->__pyx_codeobj_tab[317] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_gatherBegin, __pyx_mstate->__pyx_kp_b_iso88591_VVW_5Qa_a_e7_1A_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[317])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 618};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_unit, __pyx_mstate->__pyx_n_u_leafdata, __pyx_mstate->__pyx_n_u_multirootdata, __pyx_mstate->__pyx_n_u_dtype};
    __pyx_mstate_global->__pyx_codeobj_tab[318] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_gatherEnd, __pyx_mstate->__pyx_kp_b_iso88591_TTU_5Qa_a_q_E_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[318])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 642};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_unit, __pyx_mstate->__pyx_n_u_rootdata, __pyx_mstate->__pyx_n_u_leafdata, __pyx_mstate->__pyx_n_u_leafupdate, __pyx_mstate->__pyx_n_u_op, __pyx_mstate->__pyx_n_u_dtype, __pyx_mstate->__pyx_n_u_cop};
    __pyx_mstate_global->__pyx_codeobj_tab[319] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_fetchAndOpBegin, __pyx_mstate->__pyx_kp_b_iso88591_88KK_mmttu_5Qa_q_a_Qd_wg_3_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[319])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 678};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_unit, __pyx_mstate->__pyx_n_u_rootdata, __pyx_mstate->__pyx_n_u_leafdata, __pyx_mstate->__pyx_n_u_leafupdate, __pyx_mstate->__pyx_n_u_op, __pyx_mstate->__pyx_n_u_dtype, __pyx_mstate->__pyx_n_u_cop};
    __pyx_mstate_global->__pyx_codeobj_tab[320] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SF_pyx, __pyx_mstate->__pyx_n_u_fetchAndOpEnd, __pyx_mstate->__pyx_kp_b_iso88591_66II_kkrrs2_5Qa_q_a_1D_WG_q_1_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[320])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 72};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other};
    __pyx_mstate_global->__pyx_codeobj_tab[321] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_idiv, __pyx_mstate->__pyx_kp_b_iso88591_A_xq_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[321])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 98};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other};
    __pyx_mstate_global->__pyx_codeobj_tab[322] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_div_2, __pyx_mstate->__pyx_kp_b_iso88591_A_wavQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[322])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 101};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other};
    __pyx_mstate_global->__pyx_codeobj_tab[323] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_rdiv, __pyx_mstate->__pyx_kp_b_iso88591_A_xq_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[323])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 132};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_buf};
    __pyx_mstate_global->__pyx_codeobj_tab[324] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_enter, __pyx_mstate->__pyx_kp_b_iso88591_A_1_IQnA_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[324])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 137};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exc, __pyx_mstate->__pyx_n_u_buf};
    __pyx_mstate_global->__pyx_codeobj_tab[325] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_exit, __pyx_mstate->__pyx_kp_b_iso88591_A_t9AQ_IQnA_s_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[325])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 144};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[326] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_awat6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[326])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 163};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[327] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_az_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[327])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 176};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newvec};
    __pyx_mstate_global->__pyx_codeobj_tab[328] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_q_ay_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[328])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 199};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[329] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_q_9AZq_az_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[329])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 218};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_N};
    __pyx_mstate_global->__pyx_codeobj_tab[330] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setSizes, __pyx_mstate->__pyx_kp_b_iso88591_A_IQ_e1_q_AS_a_4vS_3c_4vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[330])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 247};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_newvec};
    __pyx_mstate_global->__pyx_codeobj_tab[331] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_createSeq, __pyx_mstate->__pyx_kp_b_iso88591_A_A_IQ_havQ_e1_q_AS_7_as_1_3c_uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[331])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 283};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_newvec};
    __pyx_mstate_global->__pyx_codeobj_tab[332] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_createMPI, __pyx_mstate->__pyx_kp_b_iso88591_A_A_IQ_havQ_e1_q_AS_7_as_1_3c_uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[332])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 319};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_array, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_na, __pyx_mstate->__pyx_n_u_sa, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_newvec};
    __pyx_mstate_global->__pyx_codeobj_tab[333] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_createWithArray, __pyx_mstate->__pyx_kp_b_iso88591_A_a_A_IQ2_Q_Qa_5_6_auE_havQ_e1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[333])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 370};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cpuarray, __pyx_mstate->__pyx_n_u_cudahandle, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_na, __pyx_mstate->__pyx_n_u_sa, __pyx_mstate->__pyx_n_u_gpuarray, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_newvec};
    __pyx_mstate_global->__pyx_codeobj_tab[334] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_createCUDAWithArrays, __pyx_mstate->__pyx_kp_b_iso88591_A_A_a_A_IQ0_Q_Q_1_nA_9G1_xq_4q_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[334])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 428};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cpuarray, __pyx_mstate->__pyx_n_u_hiphandle, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_na, __pyx_mstate->__pyx_n_u_sa, __pyx_mstate->__pyx_n_u_gpuarray, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_newvec};
    __pyx_mstate_global->__pyx_codeobj_tab[335] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_createHIPWithArrays, __pyx_mstate->__pyx_kp_b_iso88591_A_A_a_A_IQ0_Q_Q_1_nA_9G1_xq_4q_5_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[335])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 486};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cpuarray, __pyx_mstate->__pyx_n_u_viennaclvechandle, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_na, __pyx_mstate->__pyx_n_u_sa, __pyx_mstate->__pyx_n_u_vclvec, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_newvec};
    __pyx_mstate_global->__pyx_codeobj_tab[336] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_createViennaCLWithArrays, __pyx_mstate->__pyx_kp_b_iso88591_A_A_a_A_IQ2_Q_1_1__N_9G1_xq_4q_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[336])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 23, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 545};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dltensor, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ptr, __pyx_mstate->__pyx_n_u_bits, __pyx_mstate->__pyx_n_u_nz, __pyx_mstate->__pyx_n_u_ndim, __pyx_mstate->__pyx_n_u_shape, __pyx_mstate->__pyx_n_u_strides, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_s_2, __pyx_mstate->__pyx_n_u_newvec, __pyx_mstate->__pyx_n_u_dltype, __pyx_mstate->__pyx_n_u_shape_arr, __pyx_mstate->__pyx_n_u_strides_arr, __pyx_mstate->__pyx_n_u_s1, __pyx_mstate->__pyx_n_u_s2, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[337] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_createWithDLPack, __pyx_mstate->__pyx_kp_b_iso88591_A_a_A_IQ6_A_1_A_a_havQ_7_4_1A_x, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[337])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 643};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_dltensor, __pyx_mstate->__pyx_n_u_ctx, __pyx_mstate->__pyx_n_u_ptr, __pyx_mstate->__pyx_n_u_shape_arr, __pyx_mstate->__pyx_n_u_strides_arr, __pyx_mstate->__pyx_n_u_s1, __pyx_mstate->__pyx_n_u_s2, __pyx_mstate->__pyx_n_u_bits, __pyx_mstate->__pyx_n_u_ndim, __pyx_mstate->__pyx_n_u_shape, __pyx_mstate->__pyx_n_u_strides, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[338] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_attachDLPackInfo, __pyx_mstate->__pyx_kp_b_iso88591_A_2_A_A_A_4s_t9Cq_AQ_4wa_84y_t3a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[338])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 705};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[339] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_clearDLPackInfo, __pyx_mstate->__pyx_kp_b_iso88591_IQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[339])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 719};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stream};
    __pyx_mstate_global->__pyx_codeobj_tab[340] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_dlpack, __pyx_mstate->__pyx_kp_b_iso88591_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[340])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 722};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dltype, __pyx_mstate->__pyx_n_u_devId, __pyx_mstate->__pyx_n_u__29};
    __pyx_mstate_global->__pyx_codeobj_tab[341] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_dlpack_device, __pyx_mstate->__pyx_kp_b_iso88591_A_3e_5Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[341])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 726};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_ndim, __pyx_mstate->__pyx_n_u_device_type, __pyx_mstate->__pyx_n_u_device_id, __pyx_mstate->__pyx_n_u_shape, __pyx_mstate->__pyx_n_u_strides, __pyx_mstate->__pyx_n_u_hostmem, __pyx_mstate->__pyx_n_u_dlm_tensor, __pyx_mstate->__pyx_n_u_dl_tensor, __pyx_mstate->__pyx_n_u_a, __pyx_mstate->__pyx_n_u_shape_strides, __pyx_mstate->__pyx_n_u_ctx, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_dtype};
    __pyx_mstate_global->__pyx_codeobj_tab[342] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_toDLPack, __pyx_mstate->__pyx_kp_b_iso88591_iq2_5_6_5_e1_AQ_A_k_wk9K1A_s_V1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[342])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 819};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ghosts, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_ng, __pyx_mstate->__pyx_n_u_ig, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_newvec};
    __pyx_mstate_global->__pyx_codeobj_tab[343] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_createGhost, __pyx_mstate->__pyx_kp_b_iso88591_A_A_IQ_havQ_4q_e1_q_AS_7_as_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[343])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 16, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 861};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ghosts, __pyx_mstate->__pyx_n_u_array, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_ng, __pyx_mstate->__pyx_n_u_ig, __pyx_mstate->__pyx_n_u_na, __pyx_mstate->__pyx_n_u_sa, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_newvec};
    __pyx_mstate_global->__pyx_codeobj_tab[344] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_createGhostWithArray, __pyx_mstate->__pyx_kp_b_iso88591_A_a_A_IQ2_havQ_4q_Q_Qa_vS_q_5_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[344])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 918};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_newvec};
    __pyx_mstate_global->__pyx_codeobj_tab[345] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_createShared, __pyx_mstate->__pyx_kp_b_iso88591_A_A_IQ_havQ_e1_q_AS_7_as_1_q_a_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[345])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 952};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vecs, __pyx_mstate->__pyx_n_u_isets, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_cvecs, __pyx_mstate->__pyx_n_u_cisets, __pyx_mstate->__pyx_n_u_unused1, __pyx_mstate->__pyx_n_u_unused2, __pyx_mstate->__pyx_n_u_newvec};
    __pyx_mstate_global->__pyx_codeobj_tab[346] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_createNest, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_IQ_t1A_1_D_3awc_AQ_A_havQ_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[346])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1000};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[347] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_a_81A_a_4vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[347])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1014};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[348] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_a_4vQa_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[348])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1028};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[349] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_appendOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_81A_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[349])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1042};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[350] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[350])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1054};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[351] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_axq_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[351])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1067};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_option, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[352] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setOption, __pyx_mstate->__pyx_kp_b_iso88591_iq_a_1D_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[352])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1079};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[353] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_az_fAQ_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[353])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1093};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_N};
    __pyx_mstate_global->__pyx_codeobj_tab[354] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getSize, __pyx_mstate->__pyx_kp_b_iso88591_az_fAQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[354])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1107};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[355] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getLocalSize, __pyx_mstate->__pyx_kp_b_iso88591_a_a_at6_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[355])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1121};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_N};
    __pyx_mstate_global->__pyx_codeobj_tab[356] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getSizes, __pyx_mstate->__pyx_kp_b_iso88591_a_at6_az_fAQ_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[356])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1136};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_bs_2};
    __pyx_mstate_global->__pyx_codeobj_tab[357] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setBlockSize, __pyx_mstate->__pyx_kp_b_iso88591_5_a_at6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[357])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1149};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bs_2};
    __pyx_mstate_global->__pyx_codeobj_tab[358] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getBlockSize, __pyx_mstate->__pyx_kp_b_iso88591_a_a_at6_uAQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[358])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1163};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_low, __pyx_mstate->__pyx_n_u_high};
    __pyx_mstate_global->__pyx_codeobj_tab[359] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getOwnershipRange, __pyx_mstate->__pyx_kp_b_iso88591_1_a_1D_auAQ_QfE, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[359])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1184};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rng, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_size};
    __pyx_mstate_global->__pyx_codeobj_tab[360] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getOwnershipRanges, __pyx_mstate->__pyx_kp_b_iso88591_A_1_a_AT_q_Q_a_t6_a_AV1A_wat1Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[360])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1204};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_lvec};
    __pyx_mstate_global->__pyx_codeobj_tab[361] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_createLocalVector, __pyx_mstate->__pyx_kp_b_iso88591_1_s_a_1D_at1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[361])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1223};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_lvec, __pyx_mstate->__pyx_n_u_readonly};
    __pyx_mstate_global->__pyx_codeobj_tab[362] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getLocalVector, __pyx_mstate->__pyx_kp_b_iso88591_1_1_V4q_AT_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[362])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1246};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_lvec, __pyx_mstate->__pyx_n_u_readonly};
    __pyx_mstate_global->__pyx_codeobj_tab[363] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_restoreLocalVector, __pyx_mstate->__pyx_kp_b_iso88591_5WJa_1_AT_t1_V4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[363])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1270};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_readonly};
    __pyx_mstate_global->__pyx_codeobj_tab[364] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getBuffer, __pyx_mstate->__pyx_kp_b_iso88591_1L_1_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[364])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1313};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_readonly};
    __pyx_mstate_global->__pyx_codeobj_tab[365] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getArray, __pyx_mstate->__pyx_kp_b_iso88591_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[365])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1333};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_array};
    __pyx_mstate_global->__pyx_codeobj_tab[366] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setArray, __pyx_mstate->__pyx_kp_b_iso88591_31_AV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[366])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1345};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_array, __pyx_mstate->__pyx_n_u_nv_2, __pyx_mstate->__pyx_n_u_na, __pyx_mstate->__pyx_n_u_a};
    __pyx_mstate_global->__pyx_codeobj_tab[367] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_placeArray, __pyx_mstate->__pyx_kp_b_iso88591_5Q_a_a_at6_Qa_Cs_vZq_5_Qa_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[367])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1366};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_force, __pyx_mstate->__pyx_n_u_array};
    __pyx_mstate_global->__pyx_codeobj_tab[368] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_resetArray, __pyx_mstate->__pyx_kp_b_iso88591_z_A_IQa_6_E_T_q_a_AT_IQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[368])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1396};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flg, __pyx_mstate->__pyx_n_u_bindFlg};
    __pyx_mstate_global->__pyx_codeobj_tab[369] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_bindToCPU, __pyx_mstate->__pyx_kp_b_iso88591_Ya_q_a_1D_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[369])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1409};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flg};
    __pyx_mstate_global->__pyx_codeobj_tab[370] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_boundToCPU, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_a_AT_q_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[370])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1423};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_hdl, __pyx_mstate->__pyx_n_u_m};
    __pyx_mstate_global->__pyx_codeobj_tab[371] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getCUDAHandle, __pyx_mstate->__pyx_kp_b_iso88591_A_y_0_Q_5_vWIQfAQ_2S_T_3c_d_1Cs, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[371])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1462};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_handle, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_hdl, __pyx_mstate->__pyx_n_u_m};
    __pyx_mstate_global->__pyx_codeobj_tab[372] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_restoreCUDAHandle, __pyx_mstate->__pyx_kp_b_iso88591_A_y_Q_Q_5_vWIQfAQ_2S_T_3c_d_1Cs, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[372])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1495};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_hdl, __pyx_mstate->__pyx_n_u_m};
    __pyx_mstate_global->__pyx_codeobj_tab[373] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getHIPHandle, __pyx_mstate->__pyx_kp_b_iso88591_A_y_0_Q_5_vWIQfAQ_2S_T_3c_d_1Cs_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[373])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1534};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_handle, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_hdl, __pyx_mstate->__pyx_n_u_m};
    __pyx_mstate_global->__pyx_codeobj_tab[374] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_restoreHIPHandle, __pyx_mstate->__pyx_kp_b_iso88591_A_y_Q_Q_5_vWIQfAQ_2S_T_3c_d_1Cs_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[374])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1567};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mask};
    __pyx_mstate_global->__pyx_codeobj_tab[375] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getOffloadMask, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_V1A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[375])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1593};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ctxhdl};
    __pyx_mstate_global->__pyx_codeobj_tab[376] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getCLContextHandle, __pyx_mstate->__pyx_kp_b_iso88591_A_1_a_at6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[376])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1613};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_queuehdl};
    __pyx_mstate_global->__pyx_codeobj_tab[377] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getCLQueueHandle, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_AT_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[377])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1633};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_memhdl, __pyx_mstate->__pyx_n_u_m};
    __pyx_mstate_global->__pyx_codeobj_tab[378] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getCLMemHandle, __pyx_mstate->__pyx_kp_b_iso88591_A_y_1_Q_y_q_2S_T_3c_d_1Cs_at6_as, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[378])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1670};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[379] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_restoreCLMemHandle, __pyx_mstate->__pyx_kp_b_iso88591_A_a_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[379])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1682};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_array, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_ctx0};
    __pyx_mstate_global->__pyx_codeobj_tab[380] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_duplicate, __pyx_mstate->__pyx_kp_b_iso88591_9_t1E_a_1D_as_4y_5_q_y_Q_6_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[380])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1707};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[381] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_copy, __pyx_mstate->__pyx_kp_b_iso88591_iq_7_Q_T_q_6_c_q_F_6_awat6_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[381])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1732};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tol, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[382] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_chop, __pyx_mstate->__pyx_kp_b_iso88591_fAQ_ay_V1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[382])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1750};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_obj};
    __pyx_mstate_global->__pyx_codeobj_tab[383] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_load, __pyx_mstate->__pyx_kp_b_iso88591_Q_Q_V1_4uCq_Qe1A_9AV1D_awat6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[383])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1768};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[384] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_equal, __pyx_mstate->__pyx_kp_b_iso88591_a_axq_F_V1A_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[384])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1787};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[385] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_dot, __pyx_mstate->__pyx_kp_b_iso88591_a_avQd_6_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[385])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1812};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[386] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_dotBegin, __pyx_mstate->__pyx_kp_b_iso88591_1_a_4vS_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[386])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1832};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[387] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_dotEnd, __pyx_mstate->__pyx_kp_b_iso88591_ay_V3fAQ_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[387])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1846};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[388] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_tDot, __pyx_mstate->__pyx_kp_b_iso88591_q_awat6_F_1_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[388])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1868};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[389] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_tDotBegin, __pyx_mstate->__pyx_kp_b_iso88591_A_a_1D_c_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[389])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1888};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[390] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_tDotEnd, __pyx_mstate->__pyx_kp_b_iso88591_az_fCvQa_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[390])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1902};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vecs, __pyx_mstate->__pyx_n_u_out, __pyx_mstate->__pyx_n_u_nv_2, __pyx_mstate->__pyx_n_u_no_2, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_val, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_unused};
    __pyx_mstate_global->__pyx_codeobj_tab[391] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_mDot, __pyx_mstate->__pyx_kp_b_iso88591_B_1_3az_a_XQgQe6_G9A_QfG4q_A_4s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[391])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1935};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vecs, __pyx_mstate->__pyx_n_u_out, __pyx_mstate->__pyx_n_u_nv_2, __pyx_mstate->__pyx_n_u_no_2, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_val, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_unused};
    __pyx_mstate_global->__pyx_codeobj_tab[392] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_mDotBegin, __pyx_mstate->__pyx_kp_b_iso88591_22B_3az_a_XQgQe6_G9A_QfG4q_A_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[392])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1965};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vecs, __pyx_mstate->__pyx_n_u_out, __pyx_mstate->__pyx_n_u_nv_2, __pyx_mstate->__pyx_n_u_no_2, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_val, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_unused};
    __pyx_mstate_global->__pyx_codeobj_tab[393] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_mDotEnd, __pyx_mstate->__pyx_kp_b_iso88591_00_3az_a_XQgQe6_G9A_QfG4q_A_hau, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[393])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1996};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vecs, __pyx_mstate->__pyx_n_u_out, __pyx_mstate->__pyx_n_u_nv_2, __pyx_mstate->__pyx_n_u_no_2, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_val, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_unused};
    __pyx_mstate_global->__pyx_codeobj_tab[394] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_mtDot, __pyx_mstate->__pyx_kp_b_iso88591_C9A_3az_a_XQgQe6_G9A_QfG4q_A_4s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[394])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2029};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vecs, __pyx_mstate->__pyx_n_u_out, __pyx_mstate->__pyx_n_u_nv_2, __pyx_mstate->__pyx_n_u_no_2, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_val, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_unused};
    __pyx_mstate_global->__pyx_codeobj_tab[395] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_mtDotBegin, __pyx_mstate->__pyx_kp_b_iso88591_33C1_3az_a_XQgQe6_G9A_QfG4q_A_h, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[395])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2059};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vecs, __pyx_mstate->__pyx_n_u_out, __pyx_mstate->__pyx_n_u_nv_2, __pyx_mstate->__pyx_n_u_no_2, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_val, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_unused};
    __pyx_mstate_global->__pyx_codeobj_tab[396] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_mtDotEnd, __pyx_mstate->__pyx_kp_b_iso88591_11A_3az_a_XQgQe6_G9A_QfG4q_A_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[396])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2090};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_norm_type, __pyx_mstate->__pyx_n_u_norm_1_2, __pyx_mstate->__pyx_n_u_ntype, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[397] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_norm, __pyx_mstate->__pyx_kp_b_iso88591_A_1_a_1_WF_awat6_6_JgV1D_fAT_vQd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[397])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2112};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_norm_type, __pyx_mstate->__pyx_n_u_ntype, __pyx_mstate->__pyx_n_u_dummy};
    __pyx_mstate_global->__pyx_codeobj_tab[398] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_normBegin, __pyx_mstate->__pyx_kp_b_iso88591_A_1_1_WF_a_1D_gQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[398])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2131};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_norm_type, __pyx_mstate->__pyx_n_u_norm_1_2, __pyx_mstate->__pyx_n_u_ntype, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[399] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_normEnd, __pyx_mstate->__pyx_kp_b_iso88591_A_1_a_1_WF_az_fG1_6_JgV1D_fAT_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[399])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2151};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_sval, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[400] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_dotNorm2, __pyx_mstate->__pyx_kp_b_iso88591_1_a_a_4vS_avQa_xq_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[400])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2166};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[401] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_sum, __pyx_mstate->__pyx_kp_b_iso88591_Q_avQd_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[401])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2180};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[402] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_mean, __pyx_mstate->__pyx_kp_b_iso88591_a_awat6_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[402])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2194};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[403] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_min, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_a_avQd_q_QgV1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[403])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2217};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[404] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_max, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_a_avQd_q_QgV1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[404])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2240};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[405] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_normalize, __pyx_mstate->__pyx_kp_b_iso88591_1_a_a_1D_aq_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[405])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2259};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[406] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_reciprocal, __pyx_mstate->__pyx_kp_b_iso88591_A_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[406])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2271};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[407] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_exp, __pyx_mstate->__pyx_kp_b_iso88591_Q_avQd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[407])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2283};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[408] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_log, __pyx_mstate->__pyx_kp_b_iso88591_Q_avQd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[408])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2295};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[409] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_sqrtabs, __pyx_mstate->__pyx_kp_b_iso88591_az_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[409])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2307};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[410] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_abs, __pyx_mstate->__pyx_kp_b_iso88591_Q_avQd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[410])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2319};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[411] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_conjugate, __pyx_mstate->__pyx_kp_b_iso88591_1_a_1D_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[411])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2331};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_random, __pyx_mstate->__pyx_n_u_rnd};
    __pyx_mstate_global->__pyx_codeobj_tab[412] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setRandom, __pyx_mstate->__pyx_kp_b_iso88591_iq_q_7_vV1_a_1D_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[412])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2351};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_order, __pyx_mstate->__pyx_n_u_invert, __pyx_mstate->__pyx_n_u_cinvert};
    __pyx_mstate_global->__pyx_codeobj_tab[413] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_permute, __pyx_mstate->__pyx_kp_b_iso88591_z_8_Q_az_fE, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[413])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2372};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[414] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_zeroEntries, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_Qd_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[414])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2384};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[415] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_set, __pyx_mstate->__pyx_kp_b_iso88591_A_avQd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[415])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2397};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_idx, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_aval};
    __pyx_mstate_global->__pyx_codeobj_tab[416] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_isset, __pyx_mstate->__pyx_kp_b_iso88591_a_axq_F_WA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[416])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2417};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[417] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_scale, __pyx_mstate->__pyx_kp_b_iso88591_a_axq_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[417])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2437};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[418] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_shift, __pyx_mstate->__pyx_kp_b_iso88591_a_axq_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[418])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2457};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[419] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_swap, __pyx_mstate->__pyx_kp_b_iso88591_q_awat6_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[419])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2474};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[420] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_axpy, __pyx_mstate->__pyx_kp_b_iso88591_A_awat6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[420])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2494};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_idx, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[421] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_isaxpy, __pyx_mstate->__pyx_kp_b_iso88591_6a_ay_V3gV1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[421])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2518};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[422] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_aypx, __pyx_mstate->__pyx_kp_b_iso88591_A_awat6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[422])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2538};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_beta, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_sval1, __pyx_mstate->__pyx_n_u_sval2};
    __pyx_mstate_global->__pyx_codeobj_tab[423] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_axpby, __pyx_mstate->__pyx_kp_b_iso88591_1_axq_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[423])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2561};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[424] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_waxpy, __pyx_mstate->__pyx_kp_b_iso88591_4A_axq_F_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[424])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2583};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_alphas, __pyx_mstate->__pyx_n_u_vecs, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_a, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_unused1, __pyx_mstate->__pyx_n_u_unused2, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[425] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_maxpy, __pyx_mstate->__pyx_kp_b_iso88591_44Fa_a_1_haxq_1A_hawat6_r_Cq_G9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[425])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2613};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[426] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_pointwiseMult, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_q_F_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[426])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2632};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[427] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_pointwiseDivide, __pyx_mstate->__pyx_kp_b_iso88591_q_a_fAV1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[427])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2653};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[428] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_pointwiseMin, __pyx_mstate->__pyx_kp_b_iso88591_A_a_at6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[428])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2672};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[429] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_pointwiseMax, __pyx_mstate->__pyx_kp_b_iso88591_A_a_at6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[429])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2691};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[430] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_pointwiseMaxAbs, __pyx_mstate->__pyx_kp_b_iso88591_q_a_fAV1A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[430])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2710};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[431] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_maxPointwiseDivide, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_a_AT_s_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[431])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2734};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[432] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getValue, __pyx_mstate->__pyx_kp_b_iso88591_ha_Qa_a_1D_c_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[432])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2756};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_values};
    __pyx_mstate_global->__pyx_codeobj_tab[433] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getValues, __pyx_mstate->__pyx_kp_b_iso88591_A_1_1D_iq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[433])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2781};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_values};
    __pyx_mstate_global->__pyx_codeobj_tab[434] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getValuesStagStencil, __pyx_mstate->__pyx_kp_b_iso88591_39A_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[434])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2785};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_sval, __pyx_mstate->__pyx_n_u_caddv};
    __pyx_mstate_global->__pyx_codeobj_tab[435] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setValue, __pyx_mstate->__pyx_kp_b_iso88591_A_y_8_Qa_Zq_a_1D_c_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[435])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2822};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[436] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setValues, __pyx_mstate->__pyx_kp_b_iso88591_A_y_8_AT_y_c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[436])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2856};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[437] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setValuesBlocked, __pyx_mstate->__pyx_kp_b_iso88591_A_y_AT_y_c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[437])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2894};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[438] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setValuesStagStencil, __pyx_mstate->__pyx_kp_b_iso88591_9_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[438])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2898};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_lgmap};
    __pyx_mstate_global->__pyx_codeobj_tab[439] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setLGMap, __pyx_mstate->__pyx_kp_b_iso88591_q_a_fE, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[439])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2913};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cmap};
    __pyx_mstate_global->__pyx_codeobj_tab[440] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getLGMap, __pyx_mstate->__pyx_kp_b_iso88591_q_a_fAT_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[440])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2928};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_sval, __pyx_mstate->__pyx_n_u_caddv};
    __pyx_mstate_global->__pyx_codeobj_tab[441] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setValueLocal, __pyx_mstate->__pyx_kp_b_iso88591_A_y_8_Qa_Zq_a_V3avQfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[441])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2965};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[442] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setValuesLocal, __pyx_mstate->__pyx_kp_b_iso88591_A_y_8_AT_y_c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[442])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2999};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[443] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setValuesBlockedLocal, __pyx_mstate->__pyx_kp_b_iso88591_A_y_AT_y_c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[443])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3037};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[444] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_assemblyBegin, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_A_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[444])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3049};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[445] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_assemblyEnd, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_Qd_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[445])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3061};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[446] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_assemble, __pyx_mstate->__pyx_kp_b_iso88591_a_q_A_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[446])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3076};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[447] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_strideScale, __pyx_mstate->__pyx_kp_b_iso88591_Qa_a_Qd_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[447])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3097};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[448] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_strideSum, __pyx_mstate->__pyx_kp_b_iso88591_xq_Qa_a_1D_fAQ_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[448])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3120};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_ival1, __pyx_mstate->__pyx_n_u_ival2, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[449] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_strideMin, __pyx_mstate->__pyx_kp_b_iso88591_xq2_uAQ_q_q_a_1D_gQgQa_QhfAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[449])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3151};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_ival1, __pyx_mstate->__pyx_n_u_ival2, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[450] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_strideMax, __pyx_mstate->__pyx_kp_b_iso88591_xq2_uAQ_q_q_a_1D_gQgQa_QhfAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[450])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3182};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_norm_type, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_norm_1_2, __pyx_mstate->__pyx_n_u_ntype, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[451] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_strideNorm, __pyx_mstate->__pyx_kp_b_iso88591_A_1_U_1_a_1_WF_a_AT_vWA_6_JgV1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[451])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3214};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_caddv};
    __pyx_mstate_global->__pyx_codeobj_tab[452] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_strideScatter, __pyx_mstate->__pyx_kp_b_iso88591_A_y_U_1_Zq_a_q_F_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[452])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3245};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_caddv};
    __pyx_mstate_global->__pyx_codeobj_tab[453] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_strideGather, __pyx_mstate->__pyx_kp_b_iso88591_A_y_U_1_Zq_a_at6_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[453])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3278};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[454] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_localForm, __pyx_mstate->__pyx_kp_b_iso88591_1_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[454])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3311};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_caddv, __pyx_mstate->__pyx_n_u_csctm};
    __pyx_mstate_global->__pyx_codeobj_tab[455] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_ghostUpdateBegin, __pyx_mstate->__pyx_kp_b_iso88591_A_q_j_k_a_4vWA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[455])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3328};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_caddv, __pyx_mstate->__pyx_n_u_csctm};
    __pyx_mstate_global->__pyx_codeobj_tab[456] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_ghostUpdateEnd, __pyx_mstate->__pyx_kp_b_iso88591_A_q_j_k_a_V7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[456])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3345};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_caddv, __pyx_mstate->__pyx_n_u_csctm};
    __pyx_mstate_global->__pyx_codeobj_tab[457] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_ghostUpdate, __pyx_mstate->__pyx_kp_b_iso88591_A_q_6_j_k_a_4vWA_a_V7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[457])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3380};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ghosts, __pyx_mstate->__pyx_n_u_ng, __pyx_mstate->__pyx_n_u_ig};
    __pyx_mstate_global->__pyx_codeobj_tab[458] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setMPIGhost, __pyx_mstate->__pyx_kp_b_iso88591_4A_4q_a_Qd_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[458])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3399};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices};
    __pyx_mstate_global->__pyx_codeobj_tab[459] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getGhostIS, __pyx_mstate->__pyx_kp_b_iso88591_A_q_a_fAQ_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[459])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3420};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_subvec};
    __pyx_mstate_global->__pyx_codeobj_tab[460] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getSubVector, __pyx_mstate->__pyx_kp_b_iso88591_y_7_V9Cq_AZq_q_a_at6_WAV1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[460])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3446};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_subvec};
    __pyx_mstate_global->__pyx_codeobj_tab[461] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_restoreSubVector, __pyx_mstate->__pyx_kp_b_iso88591_7q_a_4vT_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[461])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3465};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_sx, __pyx_mstate->__pyx_n_u_output, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_pyvec};
    __pyx_mstate_global->__pyx_codeobj_tab[462] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getNestSubVecs, __pyx_mstate->__pyx_kp_b_iso88591_a_V1Cq_E_aq_Cq_1_q_e1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[462])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3487};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sx, __pyx_mstate->__pyx_n_u_idxm, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_cidxm, __pyx_mstate->__pyx_n_u_csx, __pyx_mstate->__pyx_n_u_unused, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[463] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setNestSubVecs, __pyx_mstate->__pyx_kp_b_iso88591_A_Ya_5_6_Qc_S_s_Qa_q_xq_as_1_Q_X, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[463])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3521};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[464] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_setDM, __pyx_mstate->__pyx_kp_b_iso88591_a_axq_F_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[464])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3533};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[465] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_getDM, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_axq_F_1_Zq_a_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[465])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3552};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_vecs, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_newvec, __pyx_mstate->__pyx_n_u_cvecs, __pyx_mstate->__pyx_n_u_cisets, __pyx_mstate->__pyx_n_u_unused1, __pyx_mstate->__pyx_n_u_vec_index_ises, __pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_temp};
    __pyx_mstate_global->__pyx_codeobj_tab[466] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Vec_pyx, __pyx_mstate->__pyx_n_u_concatenate, __pyx_mstate->__pyx_kp_b_iso88591_A_1_t1A_s_1_A_q_Q_7_4vXQa_G9A_d, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[466])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[467] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DT_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_4wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[467])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 28};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newquad};
    __pyx_mstate_global->__pyx_codeobj_tab[468] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DT_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_q_a_AWAQ_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[468])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 49};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_newquad};
    __pyx_mstate_global->__pyx_codeobj_tab[469] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DT_pyx, __pyx_mstate->__pyx_n_u_duplicate, __pyx_mstate->__pyx_kp_b_iso88591_1_D_a_q_G1G1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[469])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 63};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[470] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DT_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_Qat1_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[470])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 76};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cdim, __pyx_mstate->__pyx_n_u_cnc, __pyx_mstate->__pyx_n_u_cnpoints, __pyx_mstate->__pyx_n_u_cpoints, __pyx_mstate->__pyx_n_u_cweights};
    __pyx_mstate_global->__pyx_codeobj_tab[471] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DT_pyx, __pyx_mstate->__pyx_n_u_getData, __pyx_mstate->__pyx_kp_b_iso88591_Q_A_a_Qd_az_STTU_waxq_j_q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[471])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 104};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cnc};
    __pyx_mstate_global->__pyx_codeobj_tab[472] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DT_pyx, __pyx_mstate->__pyx_n_u_getNumComponents, __pyx_mstate->__pyx_kp_b_iso88591_A_a_at7_1_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[472])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 118};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nc, __pyx_mstate->__pyx_n_u_cnc};
    __pyx_mstate_global->__pyx_codeobj_tab[473] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DT_pyx, __pyx_mstate->__pyx_n_u_setNumComponents, __pyx_mstate->__pyx_kp_b_iso88591_81_E_a_at7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[473])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 136};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_corder};
    __pyx_mstate_global->__pyx_codeobj_tab[474] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DT_pyx, __pyx_mstate->__pyx_n_u_getOrder, __pyx_mstate->__pyx_kp_b_iso88591_q_a_at7_1_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[474])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 150};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_order, __pyx_mstate->__pyx_n_u_corder};
    __pyx_mstate_global->__pyx_codeobj_tab[475] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DT_pyx, __pyx_mstate->__pyx_n_u_setOrder, __pyx_mstate->__pyx_kp_b_iso88591_ha_uAQ_a_at7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[475])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 21};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[476] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_4uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[476])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 40};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[477] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_Qat1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[477])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 53};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newfe};
    __pyx_mstate_global->__pyx_codeobj_tab[478] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_Q_a_AWAQ_az_hd_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[478])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 76};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_nc, __pyx_mstate->__pyx_n_u_isSimplex, __pyx_mstate->__pyx_n_u_qorder, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newfe, __pyx_mstate->__pyx_n_u_cdim, __pyx_mstate->__pyx_n_u_cnc, __pyx_mstate->__pyx_n_u_cqorder, __pyx_mstate->__pyx_n_u_cisSimplex, __pyx_mstate->__pyx_n_u_cprefix};
    __pyx_mstate_global->__pyx_codeobj_tab[479] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_createDefault, __pyx_mstate->__pyx_kp_b_iso88591_A_a_Q_IQ4_havQ_Q_U_1_E_Qa_F_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[479])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 122};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_nc, __pyx_mstate->__pyx_n_u_ctype, __pyx_mstate->__pyx_n_u_qorder, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newfe, __pyx_mstate->__pyx_n_u_cdim, __pyx_mstate->__pyx_n_u_cnc, __pyx_mstate->__pyx_n_u_cqorder, __pyx_mstate->__pyx_n_u_cCellType, __pyx_mstate->__pyx_n_u_cprefix};
    __pyx_mstate_global->__pyx_codeobj_tab[480] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_createByCell, __pyx_mstate->__pyx_kp_b_iso88591_A_a_Q_IQ4_havQ_Q_U_1_E_Qa_Q_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[480])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 168};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_nc, __pyx_mstate->__pyx_n_u_isSimplex, __pyx_mstate->__pyx_n_u_k, __pyx_mstate->__pyx_n_u_qorder, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newfe, __pyx_mstate->__pyx_n_u_cdim, __pyx_mstate->__pyx_n_u_cnc, __pyx_mstate->__pyx_n_u_ck, __pyx_mstate->__pyx_n_u_cqorder, __pyx_mstate->__pyx_n_u_cisSimplex};
    __pyx_mstate_global->__pyx_codeobj_tab[481] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_createLagrange, __pyx_mstate->__pyx_kp_b_iso88591_A_a_IQ4_havQ_Q_U_1_E_5_Qa_F_1_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[481])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 212};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_quad};
    __pyx_mstate_global->__pyx_codeobj_tab[482] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_getQuadrature, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_a_1D_Qd_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[482])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 227};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cdim};
    __pyx_mstate_global->__pyx_codeobj_tab[483] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_getDimension, __pyx_mstate->__pyx_kp_b_iso88591_a_Q_a_4uAQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[483])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 241};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_csdim};
    __pyx_mstate_global->__pyx_codeobj_tab[484] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_getSpatialDimension, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_a_e1A_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[484])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 255};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comp};
    __pyx_mstate_global->__pyx_codeobj_tab[485] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_getNumComponents, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_at5_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[485])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 269};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comp, __pyx_mstate->__pyx_n_u_ccomp};
    __pyx_mstate_global->__pyx_codeobj_tab[486] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_setNumComponents, __pyx_mstate->__pyx_kp_b_iso88591_XQ_e1A_a_at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[486])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 287};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_numDof, __pyx_mstate->__pyx_n_u_cdim};
    __pyx_mstate_global->__pyx_codeobj_tab[487] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_getNumDof, __pyx_mstate->__pyx_kp_b_iso88591_1_a_Q_a_4uAQ_a_q_E_wavQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[487])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 306};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_blockSize, __pyx_mstate->__pyx_n_u_numBlocks, __pyx_mstate->__pyx_n_u_batchSize, __pyx_mstate->__pyx_n_u_numBatches};
    __pyx_mstate_global->__pyx_codeobj_tab[488] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_getTileSizes, __pyx_mstate->__pyx_kp_b_iso88591_a_2_a_4uA_A_PQQR_uA_a_5_U_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[488])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 332};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_blockSize, __pyx_mstate->__pyx_n_u_numBlocks, __pyx_mstate->__pyx_n_u_batchSize, __pyx_mstate->__pyx_n_u_numBatches, __pyx_mstate->__pyx_n_u_cblockSize, __pyx_mstate->__pyx_n_u_cnumBlocks, __pyx_mstate->__pyx_n_u_cbatchSize, __pyx_mstate->__pyx_n_u_cnumBatches};
    __pyx_mstate_global->__pyx_codeobj_tab[489] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_setTileSizes, __pyx_mstate->__pyx_kp_b_iso88591_A_A_5_B_q_5_C5_a_4uL_LPQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[489])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 362};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_quad};
    __pyx_mstate_global->__pyx_codeobj_tab[490] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_getFaceQuadrature, __pyx_mstate->__pyx_kp_b_iso88591_1_Q_a_q_E_a_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[490])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 377};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_quad};
    __pyx_mstate_global->__pyx_codeobj_tab[491] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_setQuadrature, __pyx_mstate->__pyx_kp_b_iso88591_a_1D_T_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[491])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 395};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_quad};
    __pyx_mstate_global->__pyx_codeobj_tab[492] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_setFaceQuadrature, __pyx_mstate->__pyx_kp_b_iso88591_a_a_q_E_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[492])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 413};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fe_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[493] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_a_1IQa_a_Qd_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[493])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 433};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sp};
    __pyx_mstate_global->__pyx_codeobj_tab[494] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_getBasisSpace, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_a_1D_Qb_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[494])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 448};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sp};
    __pyx_mstate_global->__pyx_codeobj_tab[495] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_setBasisSpace, __pyx_mstate->__pyx_kp_b_iso88591_a_1D_Rq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[495])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 465};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[496] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_AT_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[496])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 477};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[497] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_a_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[497])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 489};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dspace};
    __pyx_mstate_global->__pyx_codeobj_tab[498] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_getDualSpace, __pyx_mstate->__pyx_kp_b_iso88591_a_a_4uAV1_a_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[498])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 504};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dspace};
    __pyx_mstate_global->__pyx_codeobj_tab[499] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_FE_pyx, __pyx_mstate->__pyx_n_u_setDualSpace, __pyx_mstate->__pyx_kp_b_iso88591_0_a_4uF, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[499])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 58};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[500] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Scatter_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[500])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 77};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[501] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Scatter_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_a_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[501])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 90};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec_from, __pyx_mstate->__pyx_n_u_is_from, __pyx_mstate->__pyx_n_u_vec_to, __pyx_mstate->__pyx_n_u_is_to, __pyx_mstate->__pyx_n_u_cisfrom, __pyx_mstate->__pyx_n_u_cisto, __pyx_mstate->__pyx_n_u_newsct};
    __pyx_mstate_global->__pyx_codeobj_tab[502] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Scatter_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_A_T_Q_87_87_q_1_a_q_ivV7_1_az_hd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[502])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 146};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_scatter_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[503] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Scatter_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_O1_Q_y_q_a_V1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[503])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 160};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[504] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Scatter_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_V1A_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[504])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 174};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[505] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Scatter_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[505])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 186};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[506] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Scatter_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_a_at1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[506])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 199};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_scatter};
    __pyx_mstate_global->__pyx_codeobj_tab[507] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Scatter_pyx, __pyx_mstate->__pyx_n_u_copy, __pyx_mstate->__pyx_kp_b_iso88591_a_wa_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[507])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 205};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_scatter, __pyx_mstate->__pyx_n_u_ovec};
    __pyx_mstate_global->__pyx_codeobj_tab[508] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Scatter_pyx, __pyx_mstate->__pyx_n_u_toAll, __pyx_mstate->__pyx_kp_b_iso88591_A_wa_1_a_A_vQgV1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[508])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 233};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_scatter, __pyx_mstate->__pyx_n_u_ovec};
    __pyx_mstate_global->__pyx_codeobj_tab[509] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Scatter_pyx, __pyx_mstate->__pyx_n_u_toZero, __pyx_mstate->__pyx_kp_b_iso88591_A_wa_1_a_Q_vQgV1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[509])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 262};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec_from, __pyx_mstate->__pyx_n_u_vec_to, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_caddv, __pyx_mstate->__pyx_n_u_csctm};
    __pyx_mstate_global->__pyx_codeobj_tab[510] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Scatter_pyx, __pyx_mstate->__pyx_n_u_begin, __pyx_mstate->__pyx_kp_b_iso88591_A_q_j_k_a_at6_vQ_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[510])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 285};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec_from, __pyx_mstate->__pyx_n_u_vec_to, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_caddv, __pyx_mstate->__pyx_n_u_csctm};
    __pyx_mstate_global->__pyx_codeobj_tab[511] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Scatter_pyx, __pyx_mstate->__pyx_n_u_end, __pyx_mstate->__pyx_kp_b_iso88591_A_q_j_k_a_AT_xvV1_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[511])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 308};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec_from, __pyx_mstate->__pyx_n_u_vec_to, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_caddv, __pyx_mstate->__pyx_n_u_csctm};
    __pyx_mstate_global->__pyx_codeobj_tab[512] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Scatter_pyx, __pyx_mstate->__pyx_n_u_scatter, __pyx_mstate->__pyx_kp_b_iso88591_A_q_j_k_a_at6_vQ_a_a_AT_xvV1_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[512])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 10};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[513] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[513])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 29};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[514] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[514])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 42};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newsec};
    __pyx_mstate_global->__pyx_codeobj_tab[515] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_1_a_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[515])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 80};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sec};
    __pyx_mstate_global->__pyx_codeobj_tab[516] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_clone, __pyx_mstate->__pyx_kp_b_iso88591_q_9D_a_a_V1Cq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[516])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 96};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[517] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_a_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[517])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 110};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[518] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_kp_b_iso88591_q_a_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[518])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 122};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_numFields};
    __pyx_mstate_global->__pyx_codeobj_tab[519] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getNumFields, __pyx_mstate->__pyx_kp_b_iso88591_a_a_q_F_1_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[519])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 138};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_numFields, __pyx_mstate->__pyx_n_u_cnumFields};
    __pyx_mstate_global->__pyx_codeobj_tab[520] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_setNumFields, __pyx_mstate->__pyx_kp_b_iso88591_ha_5_a_q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[520])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 156};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_cfield, __pyx_mstate->__pyx_n_u_fieldName};
    __pyx_mstate_global->__pyx_codeobj_tab[521] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getFieldName, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_Q_a_q_F_1_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[521])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 176};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_fieldName, __pyx_mstate->__pyx_n_u_cfield, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[522] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_setFieldName, __pyx_mstate->__pyx_kp_b_iso88591_2_uAQ_IQk_a_q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[522])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 198};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_cfield, __pyx_mstate->__pyx_n_u_cnumComp};
    __pyx_mstate_global->__pyx_codeobj_tab[523] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getFieldComponents, __pyx_mstate->__pyx_kp_b_iso88591_uA_8_a_Qd_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[523])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 217};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_numComp, __pyx_mstate->__pyx_n_u_cfield, __pyx_mstate->__pyx_n_u_cnumComp};
    __pyx_mstate_global->__pyx_codeobj_tab[524] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_setFieldComponents, __pyx_mstate->__pyx_kp_b_iso88591_ha_uAQ_aq_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[524])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 238};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pStart, __pyx_mstate->__pyx_n_u_pEnd};
    __pyx_mstate_global->__pyx_codeobj_tab[525] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getChart, __pyx_mstate->__pyx_kp_b_iso88591_z_a_1D_axq_uAYe1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[525])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 255};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pStart, __pyx_mstate->__pyx_n_u_pEnd, __pyx_mstate->__pyx_n_u_cStart, __pyx_mstate->__pyx_n_u_cEnd};
    __pyx_mstate_global->__pyx_codeobj_tab[526] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_setChart, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_uAQ_a_1D_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[526])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 279};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_perm};
    __pyx_mstate_global->__pyx_codeobj_tab[527] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getPermutation, __pyx_mstate->__pyx_kp_b_iso88591_r_a_fAT_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[527])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 294};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_perm};
    __pyx_mstate_global->__pyx_codeobj_tab[528] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_setPermutation, __pyx_mstate->__pyx_kp_b_iso88591_a_fD, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[528])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 311};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cnumDof};
    __pyx_mstate_global->__pyx_codeobj_tab[529] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getDof, __pyx_mstate->__pyx_kp_b_iso88591_HA_uA_7q_a_fHAQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[529])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 333};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_numDof, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cnumDof};
    __pyx_mstate_global->__pyx_codeobj_tab[530] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_setDof, __pyx_mstate->__pyx_kp_b_iso88591_M_uAQ_Qa_a_fHA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[530])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 354};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_numDof, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cnumDof};
    __pyx_mstate_global->__pyx_codeobj_tab[531] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_addDof, __pyx_mstate->__pyx_kp_b_iso88591_M_uAQ_Qa_a_fHA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[531])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 375};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cnumDof, __pyx_mstate->__pyx_n_u_cfield};
    __pyx_mstate_global->__pyx_codeobj_tab[532] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getFieldDof, __pyx_mstate->__pyx_kp_b_iso88591_XQ_uA_7q_uAQ_a_at6_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[532])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 397};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_numDof, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cfield, __pyx_mstate->__pyx_n_u_cnumDof};
    __pyx_mstate_global->__pyx_codeobj_tab[533] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_setFieldDof, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_uAQ_Qa_a_at6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[533])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 421};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_numDof, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cfield, __pyx_mstate->__pyx_n_u_cnumDof};
    __pyx_mstate_global->__pyx_codeobj_tab[534] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_addFieldDof, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_uAQ_Qa_a_at6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[534])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 445};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cnumDof};
    __pyx_mstate_global->__pyx_codeobj_tab[535] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getConstraintDof, __pyx_mstate->__pyx_kp_b_iso88591_ha_uA_7q_a_1D_haq_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[535])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 464};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_numDof, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cnumDof};
    __pyx_mstate_global->__pyx_codeobj_tab[536] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_setConstraintDof, __pyx_mstate->__pyx_kp_b_iso88591_m81_uAQ_Qa_a_1D_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[536])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 485};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_numDof, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cnumDof};
    __pyx_mstate_global->__pyx_codeobj_tab[537] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_addConstraintDof, __pyx_mstate->__pyx_kp_b_iso88591_m81_uAQ_Qa_a_1D_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[537])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 506};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cnumDof, __pyx_mstate->__pyx_n_u_cfield};
    __pyx_mstate_global->__pyx_codeobj_tab[538] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getFieldConstraintDof, __pyx_mstate->__pyx_kp_b_iso88591_xq_uA_7q_uAQ_a_0_V881A_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[538])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 528};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_numDof, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cfield, __pyx_mstate->__pyx_n_u_cnumDof};
    __pyx_mstate_global->__pyx_codeobj_tab[539] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_setFieldConstraintDof, __pyx_mstate->__pyx_kp_b_iso88591_A_uAQ_uAQ_Qa_a_0_V881, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[539])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 557};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_numDof, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cfield, __pyx_mstate->__pyx_n_u_cnumDof};
    __pyx_mstate_global->__pyx_codeobj_tab[540] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_addFieldConstraintDof, __pyx_mstate->__pyx_kp_b_iso88591_A_uAQ_uAQ_Qa_a_0_V881, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[540])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 586};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_nindex, __pyx_mstate->__pyx_n_u_indices};
    __pyx_mstate_global->__pyx_codeobj_tab[541] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getConstraintIndices, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_q_q_a_1D_haq_a_q_F_1_waxq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[541])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 610};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_nindex, __pyx_mstate->__pyx_n_u_cindices};
    __pyx_mstate_global->__pyx_codeobj_tab[542] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_setConstraintIndices, __pyx_mstate->__pyx_kp_b_iso88591_8J_uAQ_q_9AXQa_a_1D_ha_a_q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[542])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 634};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cfield, __pyx_mstate->__pyx_n_u_nindex, __pyx_mstate->__pyx_n_u_indices};
    __pyx_mstate_global->__pyx_codeobj_tab[543] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getFieldConstraintIndices, __pyx_mstate->__pyx_kp_b_iso88591_81_uAQ_uAQ_q_q_a_0_V881A_a_4AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[543])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 661};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cfield, __pyx_mstate->__pyx_n_u_nindex, __pyx_mstate->__pyx_n_u_cindices};
    __pyx_mstate_global->__pyx_codeobj_tab[544] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_setFieldConstraintIndices, __pyx_mstate->__pyx_kp_b_iso88591_A_1_uAQ_uAQ_q_9AXQa_a_0_V881_a_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[544])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 692};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maxDof};
    __pyx_mstate_global->__pyx_codeobj_tab[545] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getMaxDof, __pyx_mstate->__pyx_kp_b_iso88591_1_q_a_AT_q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[545])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 706};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size};
    __pyx_mstate_global->__pyx_codeobj_tab[546] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getStorageSize, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_fAQ_uAQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[546])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 720};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size};
    __pyx_mstate_global->__pyx_codeobj_tab[547] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getConstrainedStorageSize, __pyx_mstate->__pyx_kp_b_iso88591_1_Q_a_4AT_q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[547])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 734};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_offset};
    __pyx_mstate_global->__pyx_codeobj_tab[548] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getOffset, __pyx_mstate->__pyx_kp_b_iso88591_xq_uA_6a_a_AT_xq_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[548])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 756};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_offset, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_coffset};
    __pyx_mstate_global->__pyx_codeobj_tab[549] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_setOffset, __pyx_mstate->__pyx_kp_b_iso88591_HA_uAQ_Qa_a_AT_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[549])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 779};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cfield, __pyx_mstate->__pyx_n_u_offset};
    __pyx_mstate_global->__pyx_codeobj_tab[550] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getFieldOffset, __pyx_mstate->__pyx_kp_b_iso88591_L_uAQ_uAQ_q_a_fHHAQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[550])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 805};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_offset, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cfield, __pyx_mstate->__pyx_n_u_coffset};
    __pyx_mstate_global->__pyx_codeobj_tab[551] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_setFieldOffset, __pyx_mstate->__pyx_kp_b_iso88591_L_XQ_uAQ_uAQ_Qa_a_fHHA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[551])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 831};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_oStart, __pyx_mstate->__pyx_n_u_oEnd};
    __pyx_mstate_global->__pyx_codeobj_tab[552] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_getOffsetRange, __pyx_mstate->__pyx_kp_b_iso88591_z_a_fAXQa_uAYe1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[552])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 846};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf, __pyx_mstate->__pyx_n_u_gsec};
    __pyx_mstate_global->__pyx_codeobj_tab[553] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Section_pyx, __pyx_mstate->__pyx_n_u_createGlobalSection, __pyx_mstate->__pyx_kp_b_iso88591_A_G1_a_at6_5_MYffggkkl_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[553])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 422};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other};
    __pyx_mstate_global->__pyx_codeobj_tab[554] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_idiv, __pyx_mstate->__pyx_kp_b_iso88591_A_xq_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[554])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 448};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other};
    __pyx_mstate_global->__pyx_codeobj_tab[555] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_div_2, __pyx_mstate->__pyx_kp_b_iso88591_A_wavQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[555])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 451};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_other};
    __pyx_mstate_global->__pyx_codeobj_tab[556] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_rdiv, __pyx_mstate->__pyx_kp_b_iso88591_A_xq_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[556])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 478};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[557] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_awat6_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[557])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 503};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[558] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_az_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[558])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 516};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[559] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_q_ay_az_hd_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[559])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 542};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[560] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_q_9AZq_az_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[560])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 561};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_rbs, __pyx_mstate->__pyx_n_u_cbs, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_N};
    __pyx_mstate_global->__pyx_codeobj_tab[561] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setSizes, __pyx_mstate->__pyx_kp_b_iso88591_A_R_IWG7_q_Qe1Cq_1Cq_a_4vS_3a_4s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[561])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 614};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_bs_2};
    __pyx_mstate_global->__pyx_codeobj_tab[562] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setBlockSize, __pyx_mstate->__pyx_kp_b_iso88591_5_a_at6_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[562])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 632};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_row_bsize, __pyx_mstate->__pyx_n_u_col_bsize, __pyx_mstate->__pyx_n_u_rbs, __pyx_mstate->__pyx_n_u_cbs};
    __pyx_mstate_global->__pyx_codeobj_tab[563] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setBlockSizes, __pyx_mstate->__pyx_kp_b_iso88591_7xq_E_E_a_q_F_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[563])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 653};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_blocks, __pyx_mstate->__pyx_n_u_nb, __pyx_mstate->__pyx_n_u_b};
    __pyx_mstate_global->__pyx_codeobj_tab[564] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setVariableBlockSizes, __pyx_mstate->__pyx_kp_b_iso88591_a_q_aq_a_q_F_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[564])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 667};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[565] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setVecType, __pyx_mstate->__pyx_kp_b_iso88591_6a_9AZq_a_AT_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[565])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 686};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[566] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getVecType, __pyx_mstate->__pyx_kp_b_iso88591_A_a_AT_q_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[566])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 700};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[567] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setNestVecType, __pyx_mstate->__pyx_kp_b_iso88591_9AZq_a_V1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[567])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 721};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_nnz, __pyx_mstate->__pyx_n_u_csr, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[568] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createAIJ, __pyx_mstate->__pyx_kp_b_iso88591_A_a_q_IQ_q_86_waq_az_hd_AT_uA_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[568])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 766};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_nnz, __pyx_mstate->__pyx_n_u_csr, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[569] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createBAIJ, __pyx_mstate->__pyx_kp_b_iso88591_A_a_q_IQ_q_9F_q_az_hd_AT_uA_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[569])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 810};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_nnz, __pyx_mstate->__pyx_n_u_csr, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[570] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createSBAIJ, __pyx_mstate->__pyx_kp_b_iso88591_A_a_q_IQ_q_V6_az_hd_AT_uA_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[570])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 854};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_nnz, __pyx_mstate->__pyx_n_u_csr, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[571] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createAIJCRL, __pyx_mstate->__pyx_kp_b_iso88591_A_a_q_IQD_q_fF_az_hd_AT_uA_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[571])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 901};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nnz, __pyx_mstate->__pyx_n_u_done};
    __pyx_mstate_global->__pyx_codeobj_tab[572] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setPreallocationNNZ, __pyx_mstate->__pyx_kp_b_iso88591_1_a_a_V1A_V1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[572])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 927};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_coo_i, __pyx_mstate->__pyx_n_u_coo_j, __pyx_mstate->__pyx_n_u_ncoo_i, __pyx_mstate->__pyx_n_u_ncoo_j, __pyx_mstate->__pyx_n_u_ccoo_i, __pyx_mstate->__pyx_n_u_ccoo_j, __pyx_mstate->__pyx_n_u_ncoo};
    __pyx_mstate_global->__pyx_codeobj_tab[573] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setPreallocationCOO, __pyx_mstate->__pyx_kp_b_iso88591_QQR_1_0_q_7_Q_AQ_A_a_Qd_ha_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[573])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 959};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_coo_i, __pyx_mstate->__pyx_n_u_coo_j, __pyx_mstate->__pyx_n_u_ncoo_i, __pyx_mstate->__pyx_n_u_ncoo_j, __pyx_mstate->__pyx_n_u_ccoo_i, __pyx_mstate->__pyx_n_u_ccoo_j, __pyx_mstate->__pyx_n_u_ncoo};
    __pyx_mstate_global->__pyx_codeobj_tab[574] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setPreallocationCOOLocal, __pyx_mstate->__pyx_kp_b_iso88591_DDVVW_1_0_q_7_Q_AQ_A_a_4vV81_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[574])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 991};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_csr, __pyx_mstate->__pyx_n_u_done};
    __pyx_mstate_global->__pyx_codeobj_tab[575] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setPreallocationCSR, __pyx_mstate->__pyx_kp_b_iso88591_DA8_a_a_V1A_V1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[575])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1025};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_fill, __pyx_mstate->__pyx_n_u_cfill};
    __pyx_mstate_global->__pyx_codeobj_tab[576] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_preallocatorPreallocate, __pyx_mstate->__pyx_kp_b_iso88591_37_1_vQa_a_fG1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[576])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 31, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1048};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_csr, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_rbs, __pyx_mstate->__pyx_n_u_cbs, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_pi, __pyx_mstate->__pyx_n_u_pj, __pyx_mstate->__pyx_n_u_pv, __pyx_mstate->__pyx_n_u_poi, __pyx_mstate->__pyx_n_u_poj, __pyx_mstate->__pyx_n_u_pov, __pyx_mstate->__pyx_n_u_ni, __pyx_mstate->__pyx_n_u_noi, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_oi, __pyx_mstate->__pyx_n_u_nj_2, __pyx_mstate->__pyx_n_u_noj, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_oj, __pyx_mstate->__pyx_n_u_nv_2, __pyx_mstate->__pyx_n_u_nov, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_ov, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[577] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createAIJWithArrays, __pyx_mstate->__pyx_kp_b_iso88591_A_IQ_havQ_IWG7_q_Qe1Cq_1Cq_4s_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[577])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1139};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_array, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[578] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createDense, __pyx_mstate->__pyx_kp_b_iso88591_A_IQ_q_V6_az_hd_6_N_4vQ_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[578])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1175};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_array, __pyx_mstate->__pyx_n_u_cudahandle, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_newmat, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_rbs, __pyx_mstate->__pyx_n_u_cbs, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_N};
    __pyx_mstate_global->__pyx_codeobj_tab[579] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createDenseCUDA, __pyx_mstate->__pyx_kp_b_iso88591_A_IQ4_q_havQ_IWG7_gQ_QfF_5_as_3a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[579])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1232};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_array, __pyx_mstate->__pyx_n_u_done};
    __pyx_mstate_global->__pyx_codeobj_tab[580] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setPreallocationDense, __pyx_mstate->__pyx_kp_b_iso88591_a_a_V1A_at6_IQm1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[580])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1256};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_scatter, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[581] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createScatter, __pyx_mstate->__pyx_kp_b_iso88591_3_5_6_xq_havQ_q_a_q_wfAQ_az_hd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[581])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1280};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[582] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createNormal, __pyx_mstate->__pyx_kp_b_iso88591_q_q_a_as_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[582])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1305};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[583] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createTranspose, __pyx_mstate->__pyx_kp_b_iso88591_q_a_V1A_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[583])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1330};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[584] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getTransposeMat, __pyx_mstate->__pyx_kp_b_iso88591_t1E_a_fAS_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[584])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1350};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[585] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createNormalHermitian, __pyx_mstate->__pyx_kp_b_iso88591_0_q_a_q_6_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[585])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1375};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[586] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createHermitianTranspose, __pyx_mstate->__pyx_kp_b_iso88591_31_q_a_3fAQ_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[586])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1400};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_U, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_Amat, __pyx_mstate->__pyx_n_u_Umat, __pyx_mstate->__pyx_n_u_cvec, __pyx_mstate->__pyx_n_u_Vmat, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[587] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createLRC, __pyx_mstate->__pyx_kp_b_iso88591_A_aJ_Q_Qa_Q_Q_q_2WF_2WF_2WF_a_1F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[587])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1454};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_isrow, __pyx_mstate->__pyx_n_u_iscol, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[588] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createSubMatrixVirtual, __pyx_mstate->__pyx_kp_b_iso88591_y_6_F_q_a_WE_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[588])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 21, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1479};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mats, __pyx_mstate->__pyx_n_u_isrows, __pyx_mstate->__pyx_n_u_iscols, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_mr, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_mc, __pyx_mstate->__pyx_n_u_nr, __pyx_mstate->__pyx_n_u_nc, __pyx_mstate->__pyx_n_u_cmats, __pyx_mstate->__pyx_n_u_cisrows, __pyx_mstate->__pyx_n_u_ciscols, __pyx_mstate->__pyx_n_u_unused1, __pyx_mstate->__pyx_n_u_unused2, __pyx_mstate->__pyx_n_u_unused3, __pyx_mstate->__pyx_n_u_newmat, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[589] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createNest, __pyx_mstate->__pyx_kp_b_iso88591_A_a_a_IQ4_q_AU_gQ_1_T_3axs_Qa_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[589])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {9, 0, 0, 22, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1546};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_coordinates, __pyx_mstate->__pyx_n_u_dist, __pyx_mstate->__pyx_n_u_eta, __pyx_mstate->__pyx_n_u_leafsize, __pyx_mstate->__pyx_n_u_maxrank, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_rtol, __pyx_mstate->__pyx_n_u_cdim, __pyx_mstate->__pyx_n_u_coords, __pyx_mstate->__pyx_n_u_cdist, __pyx_mstate->__pyx_n_u_peta, __pyx_mstate->__pyx_n_u_lsize, __pyx_mstate->__pyx_n_u_maxr, __pyx_mstate->__pyx_n_u_pbs, __pyx_mstate->__pyx_n_u_tol, __pyx_mstate->__pyx_n_u_xyz, __pyx_mstate->__pyx_n_u_nvtx, __pyx_mstate->__pyx_n_u_rl, __pyx_mstate->__pyx_n_u_cl, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[590] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createH2OpusFromMat, __pyx_mstate->__pyx_kp_b_iso88591_A_0q_A_A_q_a_YaF_Q_q_a_a_Q_A_Q_8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[590])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {8, 0, 0, 22, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1627};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_spacedim, __pyx_mstate->__pyx_n_u_coords_target, __pyx_mstate->__pyx_n_u_coords_source, __pyx_mstate->__pyx_n_u_kernel, __pyx_mstate->__pyx_n_u_kernelctx, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_rbs, __pyx_mstate->__pyx_n_u_cbs, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_sdim, __pyx_mstate->__pyx_n_u_xt, __pyx_mstate->__pyx_n_u_nxt, __pyx_mstate->__pyx_n_u_xs, __pyx_mstate->__pyx_n_u_nxs, __pyx_mstate->__pyx_n_u_py_ctx, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[591] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createHtoolFromKernel, __pyx_mstate->__pyx_kp_b_iso88591_A_IQV_havQ_IWG7_auAU_3as_3aq_7_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[591])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1717};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_lgmapr, __pyx_mstate->__pyx_n_u_lgmapc, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_lgmr, __pyx_mstate->__pyx_n_u_lgmc, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_rbs, __pyx_mstate->__pyx_n_u_cbs, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_newmat, __pyx_mstate->__pyx_n_u_bs_2};
    __pyx_mstate_global->__pyx_codeobj_tab[592] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createIS, __pyx_mstate->__pyx_kp_b_iso88591_A_IQ4_5_5_G7_vXQ_5_5_G7_vXQ_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[592])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1770};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_diag, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_rbs, __pyx_mstate->__pyx_n_u_cbs, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[593] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createConstantDiagonal, __pyx_mstate->__pyx_kp_b_iso88591_A_IQ_havQ_IWG7_auAU_3as_3aq_7_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[593])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1803};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_diag, __pyx_mstate->__pyx_n_u_dvec, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[594] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createDiagonal, __pyx_mstate->__pyx_kp_b_iso88591_A_T_q_a_q_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[594])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1826};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_context, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_rbs, __pyx_mstate->__pyx_n_u_cbs, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_newmat};
    __pyx_mstate_global->__pyx_codeobj_tab[595] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createPython, __pyx_mstate->__pyx_kp_b_iso88591_7v_W_a_havQ_IWG7_auAU_3as_3aq_7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[595])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1863};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[596] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setPythonContext, __pyx_mstate->__pyx_kp_b_iso88591_a_4vWA_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[596])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1880};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[597] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getPythonContext, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_4vQa_83fG1_Ya_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[597])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1895};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_py_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[598] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setPythonType, __pyx_mstate->__pyx_kp_b_iso88591_XQ_1IQa_a_q_F_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[598])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1915};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[599] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getPythonType, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_F_1_y_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[599])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1932};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[600] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_IQ_81A_a_4vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[600])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1946};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[601] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_a_4vQa_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[601])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1960};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[602] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_appendOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_y_81A_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[602])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1974};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[603] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[603])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1986};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[604] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_axq_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[604])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1999};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_option, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[605] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setOption, __pyx_mstate->__pyx_kp_b_iso88591_iq_a_1D_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[605])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2011};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_option, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[606] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getOption, __pyx_mstate->__pyx_kp_b_iso88591_1_a_a_1D_haq_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[606])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2025};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[607] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_az_fAQ_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[607])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2039};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_N};
    __pyx_mstate_global->__pyx_codeobj_tab[608] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getSize, __pyx_mstate->__pyx_kp_b_iso88591_az_fAS_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[608])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2053};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[609] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getLocalSize, __pyx_mstate->__pyx_kp_b_iso88591_a_a_at6_Qa_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[609])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2067};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_N};
    __pyx_mstate_global->__pyx_codeobj_tab[610] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getSizes, __pyx_mstate->__pyx_kp_b_iso88591_a_at6_Qa_az_fAS_at5_uAT_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[610])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2083};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bs_2};
    __pyx_mstate_global->__pyx_codeobj_tab[611] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getBlockSize, __pyx_mstate->__pyx_kp_b_iso88591_a_1_a_at6_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[611])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2097};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rbs, __pyx_mstate->__pyx_n_u_cbs};
    __pyx_mstate_global->__pyx_codeobj_tab[612] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getBlockSizes, __pyx_mstate->__pyx_kp_b_iso88591_q_IQ_a_q_F_5_QfE, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[612])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2111};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival1, __pyx_mstate->__pyx_n_u_ival2};
    __pyx_mstate_global->__pyx_codeobj_tab[613] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getOwnershipRange, __pyx_mstate->__pyx_kp_b_iso88591_1_k_a_1D_awaq_Qhe1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[613])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2125};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rowrng, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_size};
    __pyx_mstate_global->__pyx_codeobj_tab[614] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getOwnershipRanges, __pyx_mstate->__pyx_kp_b_iso88591_A_a_a_AT_q_Q_a_t6_a_AV1A_wat1Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[614])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2145};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival1, __pyx_mstate->__pyx_n_u_ival2};
    __pyx_mstate_global->__pyx_codeobj_tab[615] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getOwnershipRangeColumn, __pyx_mstate->__pyx_kp_b_iso88591_k_a_fAWAQ_Qhe1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[615])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2160};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_colrng, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_size};
    __pyx_mstate_global->__pyx_codeobj_tab[616] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getOwnershipRangesColumn, __pyx_mstate->__pyx_kp_b_iso88591_a_a_4vQa_Q_a_t6_a_AV1A_wat1Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[616])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2178};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_cols};
    __pyx_mstate_global->__pyx_codeobj_tab[617] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getOwnershipIS, __pyx_mstate->__pyx_kp_b_iso88591_r_r_a_V1D_q_A_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[617])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2193};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_info, __pyx_mstate->__pyx_n_u_itype, __pyx_mstate->__pyx_n_u_cinfo};
    __pyx_mstate_global->__pyx_codeobj_tab[618] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getInfo, __pyx_mstate->__pyx_kp_b_iso88591_iq_haq_az_fG1A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[618])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2213};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_copy, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[619] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_duplicate, __pyx_mstate->__pyx_kp_b_iso88591_7z_aq_t1E_a_1D_fAS_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[619])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2233};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_structure, __pyx_mstate->__pyx_n_u_copy, __pyx_mstate->__pyx_n_u_mstr};
    __pyx_mstate_global->__pyx_codeobj_tab[620] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_copy, __pyx_mstate->__pyx_kp_b_iso88591_B_1_A_l_1_7_Q_T_q_6_c_q_F_q_7_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[620])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2260};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_obj};
    __pyx_mstate_global->__pyx_codeobj_tab[621] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_load, __pyx_mstate->__pyx_kp_b_iso88591_Q_Q_V1_4uCq_Qe1A_9AV1D_awat6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[621])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2278};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat_type, __pyx_mstate->__pyx_n_u_out, __pyx_mstate->__pyx_n_u_mtype, __pyx_mstate->__pyx_n_u_reuse};
    __pyx_mstate_global->__pyx_codeobj_tab[622] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_convert, __pyx_mstate->__pyx_kp_b_iso88591_4N_1_1_9AZq_6_F_4s_a_3e3d_A_S_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[622])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2310};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_out, __pyx_mstate->__pyx_n_u_reuse};
    __pyx_mstate_global->__pyx_codeobj_tab[623] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_transpose, __pyx_mstate->__pyx_kp_b_iso88591_1_4s_a_3e3d_A_S_A_A_a_1D_gQc_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[623])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2337};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_out};
    __pyx_mstate_global->__pyx_codeobj_tab[624] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setTransposePrecursor, __pyx_mstate->__pyx_kp_b_iso88591_0_a_q_F_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[624])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2349};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_out, __pyx_mstate->__pyx_n_u_reuse};
    __pyx_mstate_global->__pyx_codeobj_tab[625] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_hermitianTranspose, __pyx_mstate->__pyx_kp_b_iso88591_1_4s_a_3e3d_A_S_A_A_a_AT_was_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[625])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2376};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_out};
    __pyx_mstate_global->__pyx_codeobj_tab[626] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_realPart, __pyx_mstate->__pyx_kp_b_iso88591_y_4s_S_q_F_1Cq_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[626])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2399};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_out};
    __pyx_mstate_global->__pyx_codeobj_tab[627] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_imagPart, __pyx_mstate->__pyx_kp_b_iso88591_y_4s_S_q_F_1Cq_a_q_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[627])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2422};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_out};
    __pyx_mstate_global->__pyx_codeobj_tab[628] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_conjugate, __pyx_mstate->__pyx_kp_b_iso88591_4s_S_q_F_1Cq_a_1Cq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[628])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2445};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_row, __pyx_mstate->__pyx_n_u_col, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[629] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_permute, __pyx_mstate->__pyx_kp_b_iso88591_s_az_fCwc_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[629])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2466};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[630] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_equal, __pyx_mstate->__pyx_kp_b_iso88591_a_axq_F_V1A_vQa_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[630])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2480};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_tol, __pyx_mstate->__pyx_n_u_rval, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[631] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_isTranspose, __pyx_mstate->__pyx_kp_b_iso88591_XV1_4s_a_fAQ_a_a_Qd_6_q_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[631])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2503};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tol, __pyx_mstate->__pyx_n_u_rval, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[632] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_isSymmetric, __pyx_mstate->__pyx_kp_b_iso88591_xvQ_fAQ_a_a_Qd_aq_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[632])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2523};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag1, __pyx_mstate->__pyx_n_u_flag2};
    __pyx_mstate_global->__pyx_codeobj_tab[633] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_isSymmetricKnown, __pyx_mstate->__pyx_kp_b_iso88591_q_q_a_4vQgQa_axvQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[633])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2538};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tol, __pyx_mstate->__pyx_n_u_rval, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[634] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_isHermitian, __pyx_mstate->__pyx_kp_b_iso88591_xvQ_fAQ_a_a_Qd_aq_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[634])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2558};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag1, __pyx_mstate->__pyx_n_u_flag2};
    __pyx_mstate_global->__pyx_codeobj_tab[635] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_isHermitianKnown, __pyx_mstate->__pyx_kp_b_iso88591_q_q_a_4vQgQa_axvQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[635])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2573};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[636] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_isStructurallySymmetric, __pyx_mstate->__pyx_kp_b_iso88591_a_a_fAQ_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[636])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2587};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[637] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_isLinear, __pyx_mstate->__pyx_kp_b_iso88591_a_a_a_4vS_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[637])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2606};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[638] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_zeroEntries, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_Qd_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[638])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2618};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_row, __pyx_mstate->__pyx_n_u_col, __pyx_mstate->__pyx_n_u_ival1, __pyx_mstate->__pyx_n_u_ival2, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[639] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getValue, __pyx_mstate->__pyx_kp_b_iso88591_A_aq_aq_a_1D_c_AWAQ_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[639])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2634};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_cols, __pyx_mstate->__pyx_n_u_values};
    __pyx_mstate_global->__pyx_codeobj_tab[640] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getValues, __pyx_mstate->__pyx_kp_b_iso88591_33JJ__hhi_1D_fF, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[640])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2655};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rstart, __pyx_mstate->__pyx_n_u_rend, __pyx_mstate->__pyx_n_u_nrows, __pyx_mstate->__pyx_n_u_AI, __pyx_mstate->__pyx_n_u_ai, __pyx_mstate->__pyx_n_u_irow, __pyx_mstate->__pyx_n_u_ncols, __pyx_mstate->__pyx_n_u_AJ, __pyx_mstate->__pyx_n_u_aj, __pyx_mstate->__pyx_n_u_AV, __pyx_mstate->__pyx_n_u_av, __pyx_mstate->__pyx_n_u_cols, __pyx_mstate->__pyx_n_u_vals};
    __pyx_mstate_global->__pyx_codeobj_tab[641] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getValuesCSR, __pyx_mstate->__pyx_kp_b_iso88591_a_XYa_a_1D_axq_Rq_A_7_5_V1A_9A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[641])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2693};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_row, __pyx_mstate->__pyx_n_u_irow, __pyx_mstate->__pyx_n_u_ncols, __pyx_mstate->__pyx_n_u_icols, __pyx_mstate->__pyx_n_u_svals, __pyx_mstate->__pyx_n_u_cols, __pyx_mstate->__pyx_n_u_vals};
    __pyx_mstate_global->__pyx_codeobj_tab[642] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getRow, __pyx_mstate->__pyx_kp_b_iso88591_U_1_a_1_a_ay_V6_7_7_7_7_a_AT_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[642])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2713};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_symmetric, __pyx_mstate->__pyx_n_u_compressed, __pyx_mstate->__pyx_n_u_shift, __pyx_mstate->__pyx_n_u_symm, __pyx_mstate->__pyx_n_u_bcmp, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_ia, __pyx_mstate->__pyx_n_u_ja, __pyx_mstate->__pyx_n_u_done, __pyx_mstate->__pyx_n_u_ai, __pyx_mstate->__pyx_n_u_aj};
    __pyx_mstate_global->__pyx_codeobj_tab[643] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getRowIJ, __pyx_mstate->__pyx_kp_b_iso88591_G_Q_A_A_A_A_a_4vWF_AT_aq_y_5_WA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[643])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2744};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_symmetric, __pyx_mstate->__pyx_n_u_compressed, __pyx_mstate->__pyx_n_u_shift, __pyx_mstate->__pyx_n_u_symm, __pyx_mstate->__pyx_n_u_bcmp, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_ia, __pyx_mstate->__pyx_n_u_ja, __pyx_mstate->__pyx_n_u_done, __pyx_mstate->__pyx_n_u_ai, __pyx_mstate->__pyx_n_u_aj};
    __pyx_mstate_global->__pyx_codeobj_tab[644] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getColumnIJ, __pyx_mstate->__pyx_kp_b_iso88591_W_wjPQ_A_A_A_a_Qd_vV1Cq_AT_y_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[644])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2774};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_row, __pyx_mstate->__pyx_n_u_col, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_ival1, __pyx_mstate->__pyx_n_u_ival2, __pyx_mstate->__pyx_n_u_sval, __pyx_mstate->__pyx_n_u_caddv};
    __pyx_mstate_global->__pyx_codeobj_tab[645] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValue, __pyx_mstate->__pyx_kp_b_iso88591_A_y_aq_aq_Zq_a_1D_c_AWAV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[645])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2806};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_cols, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[646] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValues, __pyx_mstate->__pyx_kp_b_iso88591_A_y_AT_vV86_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[646])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2834};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_C, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[647] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValuesRCV, __pyx_mstate->__pyx_kp_b_iso88591_V3c_F_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[647])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2838};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_rowmap};
    __pyx_mstate_global->__pyx_codeobj_tab[648] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValuesIJV, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_V3c_F_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[648])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2869};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_coo_v, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[649] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValuesCOO, __pyx_mstate->__pyx_kp_b_iso88591_A_y_V7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[649])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2890};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[650] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValuesCSR, __pyx_mstate->__pyx_kp_b_iso88591_A_y_V3c_F_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[650])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2918};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_cols, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[651] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValuesBlocked, __pyx_mstate->__pyx_kp_b_iso88591_A_y_AT_vV86_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[651])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2948};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_C, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[652] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValuesBlockedRCV, __pyx_mstate->__pyx_kp_b_iso88591_0_V3c_F_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[652])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2952};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_rowmap};
    __pyx_mstate_global->__pyx_codeobj_tab[653] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValuesBlockedIJV, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_V3c_F_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[653])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2983};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[654] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValuesBlockedCSR, __pyx_mstate->__pyx_kp_b_iso88591_A_y_V3c_F_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[654])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3011};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rmap, __pyx_mstate->__pyx_n_u_cmap};
    __pyx_mstate_global->__pyx_codeobj_tab[655] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setLGMap, __pyx_mstate->__pyx_kp_b_iso88591_iq_5_6_a_fD_d, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[655])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3031};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cmap, __pyx_mstate->__pyx_n_u_rmap};
    __pyx_mstate_global->__pyx_codeobj_tab[656] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getLGMap, __pyx_mstate->__pyx_kp_b_iso88591_q_q_a_fAT_q_A_a_4q_a_4q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[656])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3048};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_row, __pyx_mstate->__pyx_n_u_col, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_ival1, __pyx_mstate->__pyx_n_u_ival2, __pyx_mstate->__pyx_n_u_sval, __pyx_mstate->__pyx_n_u_caddv};
    __pyx_mstate_global->__pyx_codeobj_tab[657] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValueLocal, __pyx_mstate->__pyx_kp_b_iso88591_A_y_aq_aq_Zq_a_F_QgS_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[657])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3081};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_cols, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[658] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValuesLocal, __pyx_mstate->__pyx_kp_b_iso88591_A_y_AT_vV86_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[658])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3109};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_C, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[659] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValuesLocalRCV, __pyx_mstate->__pyx_kp_b_iso88591_iq_V3c_F_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[659])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3113};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_rowmap};
    __pyx_mstate_global->__pyx_codeobj_tab[660] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValuesLocalIJV, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_V3c_F_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[660])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3144};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[661] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValuesLocalCSR, __pyx_mstate->__pyx_kp_b_iso88591_A_y_V3c_F_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[661])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3172};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_cols, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[662] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValuesBlockedLocal, __pyx_mstate->__pyx_kp_b_iso88591_A_y_AT_vV86_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[662])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3202};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_C, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[663] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValuesBlockedLocalRCV, __pyx_mstate->__pyx_kp_b_iso88591_5Ya_V3c_F_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[663])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3206};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_rowmap};
    __pyx_mstate_global->__pyx_codeobj_tab[664] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValuesBlockedLocalIJV, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_V3c_F_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[664])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3237};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[665] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValuesBlockedLocalCSR, __pyx_mstate->__pyx_kp_b_iso88591_A_y_V3c_F_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[665])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3269};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dims, __pyx_mstate->__pyx_n_u_starts, __pyx_mstate->__pyx_n_u_dof, __pyx_mstate->__pyx_n_u_ndim, __pyx_mstate->__pyx_n_u_ndof, __pyx_mstate->__pyx_n_u_cdims, __pyx_mstate->__pyx_n_u_cstarts};
    __pyx_mstate_global->__pyx_codeobj_tab[666] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setStencil, __pyx_mstate->__pyx_kp_b_iso88591_11C_fTZZ_Qe5_e1E_q_WAU_q_vQfAU, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[666])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3289};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_row, __pyx_mstate->__pyx_n_u_col, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_im};
    __pyx_mstate_global->__pyx_codeobj_tab[667] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValueStencil, __pyx_mstate->__pyx_kp_b_iso88591_A_y_IQ_AQ_4vS_7_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[667])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3319};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_row, __pyx_mstate->__pyx_n_u_col, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[668] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValueStagStencil, __pyx_mstate->__pyx_kp_b_iso88591_8_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[668])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3323};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_row, __pyx_mstate->__pyx_n_u_col, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_im};
    __pyx_mstate_global->__pyx_codeobj_tab[669] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValueBlockedStencil, __pyx_mstate->__pyx_kp_b_iso88591_A_y_IQ_AQ_4vS_7_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[669])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3353};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_row, __pyx_mstate->__pyx_n_u_col, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_addv};
    __pyx_mstate_global->__pyx_codeobj_tab[670] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setValueBlockedStagStencil, __pyx_mstate->__pyx_kp_b_iso88591_y_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[670])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3357};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_diag, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_ni, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_sval, __pyx_mstate->__pyx_n_u_xvec, __pyx_mstate->__pyx_n_u_bvec};
    __pyx_mstate_global->__pyx_codeobj_tab[671] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_zeroRows, __pyx_mstate->__pyx_kp_b_iso88591_7y_W_a_q_a_2WF_2WF_QfA_WD_WF_81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[671])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3390};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_diag, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_ni, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_sval, __pyx_mstate->__pyx_n_u_xvec, __pyx_mstate->__pyx_n_u_bvec};
    __pyx_mstate_global->__pyx_codeobj_tab[672] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_zeroRowsLocal, __pyx_mstate->__pyx_kp_b_iso88591_I_P_eef_q_a_2WF_2WF_QfA_Qd_U_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[672])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3423};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_diag, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_ni, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_sval, __pyx_mstate->__pyx_n_u_xvec, __pyx_mstate->__pyx_n_u_bvec};
    __pyx_mstate_global->__pyx_codeobj_tab[673] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_zeroRowsColumns, __pyx_mstate->__pyx_kp_b_iso88591_i_R_ggh_q_a_2WF_2WF_QfA_q_G4uG6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[673])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3457};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_diag, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_ni, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_sval, __pyx_mstate->__pyx_n_u_xvec, __pyx_mstate->__pyx_n_u_bvec};
    __pyx_mstate_global->__pyx_codeobj_tab[674] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_zeroRowsColumnsLocal, __pyx_mstate->__pyx_kp_b_iso88591_C9KWccllm_q_a_2WF_2WF_QfA_AT_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[674])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3491};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rows, __pyx_mstate->__pyx_n_u_diag, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_sval, __pyx_mstate->__pyx_n_u_nrows, __pyx_mstate->__pyx_n_u_crows, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_xvec, __pyx_mstate->__pyx_n_u_bvec};
    __pyx_mstate_global->__pyx_codeobj_tab[675] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_zeroRowsColumnsStencil, __pyx_mstate->__pyx_kp_b_iso88591_DI_Xddmmn_e1Cq_a_a_9E_A_Faq_E_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[675])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3525};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[676] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_storeValues, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_Qd_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[676])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3537};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[677] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_retrieveValues, __pyx_mstate->__pyx_kp_b_iso88591_a_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[677])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3549};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_assembly, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[678] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_assemblyBegin, __pyx_mstate->__pyx_kp_b_iso88591_8_Qa_a_q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[678])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3567};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_assembly, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[679] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_assemblyEnd, __pyx_mstate->__pyx_kp_b_iso88591_6iq_Qa_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[679])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3585};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_assembly, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[680] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_assemble, __pyx_mstate->__pyx_kp_b_iso88591_39A_Qa_a_q_F_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[680])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3604};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[681] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_isAssembled, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_a_1D_aq_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[681])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3618};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_zerorows};
    __pyx_mstate_global->__pyx_codeobj_tab[682] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_findZeroRows, __pyx_mstate->__pyx_kp_b_iso88591_a_2Q_a_at6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[682])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3632};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_side, __pyx_mstate->__pyx_n_u_vecr, __pyx_mstate->__pyx_n_u_vecl};
    __pyx_mstate_global->__pyx_codeobj_tab[683] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createVecs, __pyx_mstate->__pyx_kp_b_iso88591_A_ffoop_5_1_3d_A_V1D_at1_F_e5_3a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[683])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3671};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vecr};
    __pyx_mstate_global->__pyx_codeobj_tab[684] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createVecRight, __pyx_mstate->__pyx_kp_b_iso88591_1_a_AT_q_F_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[684])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3685};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vecl};
    __pyx_mstate_global->__pyx_codeobj_tab[685] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createVecLeft, __pyx_mstate->__pyx_kp_b_iso88591_q_1_a_AT_vQd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[685])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3705};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_column, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[686] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getColumnVector, __pyx_mstate->__pyx_kp_b_iso88591_6iq_U_1_7_Q_S_6_c_V6_a_fF_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[686])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3730};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nsubcomm, __pyx_mstate->__pyx_n_u_subcomm, __pyx_mstate->__pyx_n_u_out, __pyx_mstate->__pyx_n_u_nsubcomm_2, __pyx_mstate->__pyx_n_u_subcomm_2, __pyx_mstate->__pyx_n_u_reuse};
    __pyx_mstate_global->__pyx_codeobj_tab[687] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getRedundantMatrix, __pyx_mstate->__pyx_kp_b_iso88591_U___E_A_nHAYa_A_4s_Cq_3e3fHA_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[687])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3760};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[688] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getDiagonal, __pyx_mstate->__pyx_kp_b_iso88591_Ya_7_Q_S_6_c_V6_a_Qd_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[688])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3782};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[689] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getRowSum, __pyx_mstate->__pyx_kp_b_iso88591_9A_7_Q_S_6_c_V6_a_1D_fA_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[689])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3804};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_diag, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_caddv};
    __pyx_mstate_global->__pyx_codeobj_tab[690] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setDiagonal, __pyx_mstate->__pyx_kp_b_iso88591_9A_Zq_a_Qd_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[690])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3824};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_L, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_vecl, __pyx_mstate->__pyx_n_u_vecr};
    __pyx_mstate_global->__pyx_codeobj_tab[691] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_diagonalScale, __pyx_mstate->__pyx_kp_b_iso88591_iq_a_2WF_2WF_a_q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[691])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3846};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_cibdiag, __pyx_mstate->__pyx_n_u_ibdiag};
    __pyx_mstate_global->__pyx_codeobj_tab[692] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_invertBlockDiagonal, __pyx_mstate->__pyx_kp_b_iso88591_Q_7_a_at6_a_at6_Q_a_Qd_gQaq_A_j, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[692])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3867};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nsp};
    __pyx_mstate_global->__pyx_codeobj_tab[693] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setNullSpace, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_at6_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[693])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3879};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nsp};
    __pyx_mstate_global->__pyx_codeobj_tab[694] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getNullSpace, __pyx_mstate->__pyx_kp_b_iso88591_a_Ya_a_at6_Q_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[694])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3894};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nsp};
    __pyx_mstate_global->__pyx_codeobj_tab[695] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setTransposeNullSpace, __pyx_mstate->__pyx_kp_b_iso88591_6a_a_q_F_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[695])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3906};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nsp};
    __pyx_mstate_global->__pyx_codeobj_tab[696] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getTransposeNullSpace, __pyx_mstate->__pyx_kp_b_iso88591_q_Ya_a_q_F_3a_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[696])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3921};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nsp};
    __pyx_mstate_global->__pyx_codeobj_tab[697] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setNearNullSpace, __pyx_mstate->__pyx_kp_b_iso88591_1_a_4vS, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[697])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3933};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nsp};
    __pyx_mstate_global->__pyx_codeobj_tab[698] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getNearNullSpace, __pyx_mstate->__pyx_kp_b_iso88591_Ya_a_4vQc_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[698])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3950};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[699] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_mult, __pyx_mstate->__pyx_kp_b_iso88591_A_awat6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[699])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3969};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[700] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_multAdd, __pyx_mstate->__pyx_kp_b_iso88591_a_az_fAV1F_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[700])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3990};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[701] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_multTranspose, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_q_F_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[701])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4009};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[702] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_multTransposeAdd, __pyx_mstate->__pyx_kp_b_iso88591_7q_a_4vQfAV1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[702])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4030};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[703] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_multHermitian, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_q_F_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[703])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4049};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[704] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_multHermitianAdd, __pyx_mstate->__pyx_kp_b_iso88591_7q_a_4vQfAV1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[704])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {8, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4072};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_omega, __pyx_mstate->__pyx_n_u_sortype, __pyx_mstate->__pyx_n_u_shift, __pyx_mstate->__pyx_n_u_its, __pyx_mstate->__pyx_n_u_lits, __pyx_mstate->__pyx_n_u_comega, __pyx_mstate->__pyx_n_u_csortype, __pyx_mstate->__pyx_n_u_cshift, __pyx_mstate->__pyx_n_u_cits, __pyx_mstate->__pyx_n_u_clits};
    __pyx_mstate_global->__pyx_codeobj_tab[705] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_SOR, __pyx_mstate->__pyx_kp_b_iso88591_A_q_q_1_F_aq_87_aq_aq_U_1_e1A_av, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[705])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4101};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_submat};
    __pyx_mstate_global->__pyx_codeobj_tab[706] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getDiagonalBlock, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_4vQfA_a_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[706])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4116};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_overlap, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[707] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_increaseOverlap, __pyx_mstate->__pyx_kp_b_iso88591_0_fA_U_1_a_fCq_G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[707])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4129};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isrow, __pyx_mstate->__pyx_n_u_iscol, __pyx_mstate->__pyx_n_u_submat, __pyx_mstate->__pyx_n_u_reuse, __pyx_mstate->__pyx_n_u_ciscol};
    __pyx_mstate_global->__pyx_codeobj_tab[708] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createSubMatrix, __pyx_mstate->__pyx_kp_b_iso88591_11B_1_1_a_6_iuA_7_V9Cq_6_c_xq_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[708])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4159};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isrows, __pyx_mstate->__pyx_n_u_iscols, __pyx_mstate->__pyx_n_u_submats, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_reuse, __pyx_mstate->__pyx_n_u_cisrows, __pyx_mstate->__pyx_n_u_ciscols, __pyx_mstate->__pyx_n_u_cmats, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_unused1, __pyx_mstate->__pyx_n_u_unused2};
    __pyx_mstate_global->__pyx_codeobj_tab[709] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createSubMatrices, __pyx_mstate->__pyx_kp_b_iso88591_A_1_iq_7_V9A_Zq_Qa_Zq_Qa_s_83c_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[709])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4216};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_A00, __pyx_mstate->__pyx_n_u_Ap00, __pyx_mstate->__pyx_n_u_A01, __pyx_mstate->__pyx_n_u_A10, __pyx_mstate->__pyx_n_u_A11, __pyx_mstate->__pyx_n_u_newmat, __pyx_mstate->__pyx_n_u_A11_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[710] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createSchurComplement, __pyx_mstate->__pyx_kp_b_iso88591_QQZZ_2_q_4wa_c_a_q_6_V3fCvYVWWX, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[710])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4250};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_A00, __pyx_mstate->__pyx_n_u_Ap00, __pyx_mstate->__pyx_n_u_A01, __pyx_mstate->__pyx_n_u_A10, __pyx_mstate->__pyx_n_u_A11};
    __pyx_mstate_global->__pyx_codeobj_tab[711] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getSchurComplementSubMatrices, __pyx_mstate->__pyx_kp_b_iso88591_q_s_S_Zs_Cq_a_q_F_3fAT_qPSSYYZZ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[711])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4271};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isrow, __pyx_mstate->__pyx_n_u_iscol, __pyx_mstate->__pyx_n_u_submat};
    __pyx_mstate_global->__pyx_codeobj_tab[712] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getLocalSubMatrix, __pyx_mstate->__pyx_kp_b_iso88591_y_7_V9Cq_AZq_q_a_1D_e7_wavQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[712])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4297};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isrow, __pyx_mstate->__pyx_n_u_iscol, __pyx_mstate->__pyx_n_u_submat};
    __pyx_mstate_global->__pyx_codeobj_tab[713] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_restoreLocalSubMatrix, __pyx_mstate->__pyx_kp_b_iso88591_Gq_a_q_F_we7_6QR, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[713])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4320};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_norm_type, __pyx_mstate->__pyx_n_u_norm_1_2, __pyx_mstate->__pyx_n_u_ntype, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[714] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_norm, __pyx_mstate->__pyx_kp_b_iso88591_A_1_a_1_WF_awat6_6_JgV1D_fAT_vQd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[714])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4342};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[715] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_scale, __pyx_mstate->__pyx_kp_b_iso88591_a_axq_F_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[715])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4355};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_sval};
    __pyx_mstate_global->__pyx_codeobj_tab[716] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_shift, __pyx_mstate->__pyx_kp_b_iso88591_a_axq_F_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[716])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4368};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tol, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[717] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_chop, __pyx_mstate->__pyx_kp_b_iso88591_fAQ_ay_V6_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[717])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4381};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_random, __pyx_mstate->__pyx_n_u_rnd};
    __pyx_mstate_global->__pyx_codeobj_tab[718] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setRandom, __pyx_mstate->__pyx_kp_b_iso88591_iq_q_7_vV1_a_1D_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[718])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4400};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_X, __pyx_mstate->__pyx_n_u_structure, __pyx_mstate->__pyx_n_u_sval, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[719] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_axpy, __pyx_mstate->__pyx_kp_b_iso88591_44GyPQ_l_1_awat6_q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[719])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4423};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_X, __pyx_mstate->__pyx_n_u_structure, __pyx_mstate->__pyx_n_u_sval, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[720] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_aypx, __pyx_mstate->__pyx_kp_b_iso88591_44GyPQ_l_1_awat6_q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[720])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4448};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_fill, __pyx_mstate->__pyx_n_u_reuse, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[721] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_matMult, __pyx_mstate->__pyx_kp_b_iso88591_A_YaB_1_a_7_Q_S_5_1_A_5_vWF_1_az, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[721])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4495};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_fill, __pyx_mstate->__pyx_n_u_reuse, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[722] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_matTransposeMult, __pyx_mstate->__pyx_kp_b_iso88591_A_YaB_1_a_7_Q_S_5_1_A_5_vWF_1_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[722])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4542};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_fill, __pyx_mstate->__pyx_n_u_reuse, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[723] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_transposeMatMult, __pyx_mstate->__pyx_kp_b_iso88591_A_YaB_1_a_7_Q_S_5_1_A_5_vWF_1_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[723])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4589};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_fill, __pyx_mstate->__pyx_n_u_reuse, __pyx_mstate->__pyx_n_u_cfill};
    __pyx_mstate_global->__pyx_codeobj_tab[724] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_ptap, __pyx_mstate->__pyx_kp_b_iso88591_A_YaJ_1_q_7_Q_S_5_1_A_5_vXV1A_aw, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[724])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4640};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_fill, __pyx_mstate->__pyx_n_u_reuse, __pyx_mstate->__pyx_n_u_cfill};
    __pyx_mstate_global->__pyx_codeobj_tab[725] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_rart, __pyx_mstate->__pyx_kp_b_iso88591_A_YaB_1_q_7_Q_S_5_1_A_5_vXV1A_aw, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[725])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4687};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_B, __pyx_mstate->__pyx_n_u_C, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_fill, __pyx_mstate->__pyx_n_u_reuse, __pyx_mstate->__pyx_n_u_cfill};
    __pyx_mstate_global->__pyx_codeobj_tab[726] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_matMatMult, __pyx_mstate->__pyx_kp_b_iso88591_A_Ya_1_q_7_Q_S_5_1_A_5_vXV1A_a_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[726])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4732};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_reuse};
    __pyx_mstate_global->__pyx_codeobj_tab[727] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_kron, __pyx_mstate->__pyx_kp_b_iso88591_A_A0_1_7_Q_S_5_1_A_a_AT_s_q_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[727])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4767};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flg, __pyx_mstate->__pyx_n_u_bindFlg};
    __pyx_mstate_global->__pyx_codeobj_tab[728] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_bindToCPU, __pyx_mstate->__pyx_kp_b_iso88591_Ya_q_a_1D_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[728])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4787};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flg};
    __pyx_mstate_global->__pyx_codeobj_tab[729] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_boundToCPU, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_a_AT_q_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[729])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4803};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ord_type, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_rp, __pyx_mstate->__pyx_n_u_cp};
    __pyx_mstate_global->__pyx_codeobj_tab[730] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getOrdering, __pyx_mstate->__pyx_kp_b_iso88591_5Q_9AZq_Ry_a_Qd_ar_1_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[730])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4831};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isrow, __pyx_mstate->__pyx_n_u_iscol, __pyx_mstate->__pyx_n_u_atol, __pyx_mstate->__pyx_n_u_rval, __pyx_mstate->__pyx_n_u_rp, __pyx_mstate->__pyx_n_u_cp};
    __pyx_mstate_global->__pyx_codeobj_tab[731] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_reorderForNonzeroDiagonal, __pyx_mstate->__pyx_kp_b_iso88591_A_fA_fAQ_5_a_1D_fD, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[731])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4859};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isrow, __pyx_mstate->__pyx_n_u_iscol, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_info};
    __pyx_mstate_global->__pyx_codeobj_tab[732] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_factorLU, __pyx_mstate->__pyx_kp_b_iso88591_A_Qm_a_4vU_gQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[732])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4889};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_isrow, __pyx_mstate->__pyx_n_u_iscol, __pyx_mstate->__pyx_n_u_options};
    __pyx_mstate_global->__pyx_codeobj_tab[733] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_factorSymbolicLU, __pyx_mstate->__pyx_kp_b_iso88591_DIQ_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[733])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4893};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_options};
    __pyx_mstate_global->__pyx_codeobj_tab[734] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_factorNumericLU, __pyx_mstate->__pyx_kp_b_iso88591_y_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[734])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4897};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isrow, __pyx_mstate->__pyx_n_u_iscol, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_info};
    __pyx_mstate_global->__pyx_codeobj_tab[735] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_factorILU, __pyx_mstate->__pyx_kp_b_iso88591_A_Ql_y_a_1D_e7_waq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[735])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4927};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isrow, __pyx_mstate->__pyx_n_u_iscol, __pyx_mstate->__pyx_n_u_options};
    __pyx_mstate_global->__pyx_codeobj_tab[736] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_factorSymbolicILU, __pyx_mstate->__pyx_kp_b_iso88591_IQ_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[736])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4931};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isperm, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_info};
    __pyx_mstate_global->__pyx_codeobj_tab[737] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_factorCholesky, __pyx_mstate->__pyx_kp_b_iso88591_A_Qm_y_a_V6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[737])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4956};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isperm, __pyx_mstate->__pyx_n_u_options};
    __pyx_mstate_global->__pyx_codeobj_tab[738] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_factorSymbolicCholesky, __pyx_mstate->__pyx_kp_b_iso88591_8_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[738])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4960};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_options};
    __pyx_mstate_global->__pyx_codeobj_tab[739] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_factorNumericCholesky, __pyx_mstate->__pyx_kp_b_iso88591_5Ya_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[739])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4964};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isperm, __pyx_mstate->__pyx_n_u_options, __pyx_mstate->__pyx_n_u_info};
    __pyx_mstate_global->__pyx_codeobj_tab[740] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_factorICC, __pyx_mstate->__pyx_kp_b_iso88591_A_Ql_iq_a_1D_fG1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[740])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4989};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isperm, __pyx_mstate->__pyx_n_u_options};
    __pyx_mstate_global->__pyx_codeobj_tab[741] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_factorSymbolicICC, __pyx_mstate->__pyx_kp_b_iso88591_39A_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[741])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4993};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival1, __pyx_mstate->__pyx_n_u_ival2, __pyx_mstate->__pyx_n_u_ival3};
    __pyx_mstate_global->__pyx_codeobj_tab[742] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getInertia, __pyx_mstate->__pyx_kp_b_iso88591_A_k_A_a_AT_q_q_q_Qhe1HE, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[742])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5018};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[743] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setUnfactored, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_A_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[743])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5032};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_allow, __pyx_mstate->__pyx_n_u_callow};
    __pyx_mstate_global->__pyx_codeobj_tab[744] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setISAllowRepeated, __pyx_mstate->__pyx_kp_b_iso88591_y_aq_a_AT_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[744])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5050};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_callow};
    __pyx_mstate_global->__pyx_codeobj_tab[745] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getISAllowRepeated, __pyx_mstate->__pyx_kp_b_iso88591_A_a_AT_q_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[745])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5064};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fix, __pyx_mstate->__pyx_n_u_cfix};
    __pyx_mstate_global->__pyx_codeobj_tab[746] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_fixISLocalEmpty, __pyx_mstate->__pyx_kp_b_iso88591_7_1_fAQ_a_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[746])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5083};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_local};
    __pyx_mstate_global->__pyx_codeobj_tab[747] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getISLocalMat, __pyx_mstate->__pyx_kp_b_iso88591_q_A_a_q_F_5_a_5_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[747])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5098};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_local};
    __pyx_mstate_global->__pyx_codeobj_tab[748] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_restoreISLocalMat, __pyx_mstate->__pyx_kp_b_iso88591_7q_a_1D_auA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[748])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5115};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_local};
    __pyx_mstate_global->__pyx_codeobj_tab[749] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setISLocalMat, __pyx_mstate->__pyx_kp_b_iso88591_31_a_q_F_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[749])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5132};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nnz, __pyx_mstate->__pyx_n_u_onnz, __pyx_mstate->__pyx_n_u_cnnz, __pyx_mstate->__pyx_n_u_connz};
    __pyx_mstate_global->__pyx_codeobj_tab[750] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setISPreallocation, __pyx_mstate->__pyx_kp_b_iso88591_A_a_q_hauF_1_xq_fAQ_a_AT_s_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[750])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5165};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_U, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_V};
    __pyx_mstate_global->__pyx_codeobj_tab[751] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getLRCMats, __pyx_mstate->__pyx_kp_b_iso88591_A_S_S_S_S_a_AT_q_q_q_q_a_1A_a_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[751])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5197};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_U, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_Amat, __pyx_mstate->__pyx_n_u_cvec, __pyx_mstate->__pyx_n_u_Vmat};
    __pyx_mstate_global->__pyx_codeobj_tab[752] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setLRCMats, __pyx_mstate->__pyx_kp_b_iso88591_Qhb_z_1_Qhb_z_1_Qhb_z_1_a_AT_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[752])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5226};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[753] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_H2OpusOrthogonalize, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_Qd_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[753])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5239};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tol, __pyx_mstate->__pyx_n_u_tol_2};
    __pyx_mstate_global->__pyx_codeobj_tab[754] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_H2OpusCompress, __pyx_mstate->__pyx_kp_b_iso88591_A_fAQ_a_V1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[754])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5258};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_U, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_s_2, __pyx_mstate->__pyx_n_u_s_3, __pyx_mstate->__pyx_n_u_vmat};
    __pyx_mstate_global->__pyx_codeobj_tab[755] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_H2OpusLowRankUpdate, __pyx_mstate->__pyx_kp_b_iso88591_y_haq_Q_2WA_1A_a_Qd_vQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[755])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5286};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset};
    __pyx_mstate_global->__pyx_codeobj_tab[756] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_HtoolGetPermutationSource, __pyx_mstate->__pyx_kp_b_iso88591_1_r_a_1D_at1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[756])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5305};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset};
    __pyx_mstate_global->__pyx_codeobj_tab[757] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_HtoolGetPermutationTarget, __pyx_mstate->__pyx_kp_b_iso88591_1_r_a_1D_at1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[757])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5324};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_use, __pyx_mstate->__pyx_n_u_use_2};
    __pyx_mstate_global->__pyx_codeobj_tab[758] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_HtoolUsePermutation, __pyx_mstate->__pyx_kp_b_iso88591_y_fAQ_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[758])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5343};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_use, __pyx_mstate->__pyx_n_u_use_2};
    __pyx_mstate_global->__pyx_codeobj_tab[759] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_HtoolUseRecompression, __pyx_mstate->__pyx_kp_b_iso88591_fAQ_a_q_F_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[759])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5364};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_M};
    __pyx_mstate_global->__pyx_codeobj_tab[760] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getLMVMJ0, __pyx_mstate->__pyx_kp_b_iso88591_1_S_a_1D_aq_a_1A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[760])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5378};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_J0, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[761] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setLMVMJ0, __pyx_mstate->__pyx_kp_b_iso88591_1_b_a_1D_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[761])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5395};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ksp};
    __pyx_mstate_global->__pyx_codeobj_tab[762] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getLMVMJ0KSP, __pyx_mstate->__pyx_kp_b_iso88591_a_s_a_at6_Q_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[762])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5409};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ksp, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[763] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setLMVMJ0KSP, __pyx_mstate->__pyx_kp_b_iso88591_q_c_a_at6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[763])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5426};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_xvec, __pyx_mstate->__pyx_n_u_fvec};
    __pyx_mstate_global->__pyx_codeobj_tab[764] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_allocateLMVM, __pyx_mstate->__pyx_kp_b_iso88591_A_Qa_Qa_a_at6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[764])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5446};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_xvec, __pyx_mstate->__pyx_n_u_fvec};
    __pyx_mstate_global->__pyx_codeobj_tab[765] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_updateLMVM, __pyx_mstate->__pyx_kp_b_iso88591_Qa_Qa_a_AT_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[765])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5466};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_destructive, __pyx_mstate->__pyx_n_u_cdestructive};
    __pyx_mstate_global->__pyx_codeobj_tab[766] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_resetLMVM, __pyx_mstate->__pyx_kp_b_iso88591_WJa_fAQ_a_1D_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[766])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5485};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_icntl, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_icntl_2, __pyx_mstate->__pyx_n_u_ival_2};
    __pyx_mstate_global->__pyx_codeobj_tab[767] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setMumpsIcntl, __pyx_mstate->__pyx_kp_b_iso88591_ha_uAQ_e1A_a_q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[767])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5506};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_icntl, __pyx_mstate->__pyx_n_u_icntl_2, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[768] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getMumpsIcntl, __pyx_mstate->__pyx_kp_b_iso88591_81_uAQ_Q_a_q_F_1_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[768])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5521};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_icntl, __pyx_mstate->__pyx_n_u_val, __pyx_mstate->__pyx_n_u_icntl_2, __pyx_mstate->__pyx_n_u_val_2};
    __pyx_mstate_global->__pyx_codeobj_tab[769] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setMumpsCntl, __pyx_mstate->__pyx_kp_b_iso88591_Ja_uAQ_fAQ_a_at6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[769])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5542};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_icntl, __pyx_mstate->__pyx_n_u_icntl_2, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[770] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getMumpsCntl, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_Q_a_at6_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[770])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5557};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_icntl, __pyx_mstate->__pyx_n_u_icntl_2, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[771] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getMumpsInfo, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_Q_a_at6_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[771])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5577};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_icntl, __pyx_mstate->__pyx_n_u_icntl_2, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[772] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getMumpsInfog, __pyx_mstate->__pyx_kp_b_iso88591_81_uAQ_Q_a_q_F_1_uAQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[772])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5597};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_icntl, __pyx_mstate->__pyx_n_u_icntl_2, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[773] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getMumpsRinfo, __pyx_mstate->__pyx_kp_b_iso88591_81_uAQ_Q_a_q_F_1_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[773])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5617};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_icntl, __pyx_mstate->__pyx_n_u_icntl_2, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[774] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getMumpsRinfog, __pyx_mstate->__pyx_kp_b_iso88591_HA_uAQ_Q_a_V81A_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[774])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5639};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[775] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_solveForward, __pyx_mstate->__pyx_kp_b_iso88591_A_a_at6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[775])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5658};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[776] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_solveBackward, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_q_F_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[776])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5677};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[777] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_solve, __pyx_mstate->__pyx_kp_b_iso88591_Q_axq_F_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[777])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5700};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[778] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_solveTranspose, __pyx_mstate->__pyx_kp_b_iso88591_a_a_V1F_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[778])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5721};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[779] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_solveAdd, __pyx_mstate->__pyx_kp_b_iso88591_q_a_4vQfAV1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[779])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5744};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[780] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_solveTransposeAdd, __pyx_mstate->__pyx_kp_b_iso88591_8_a_1D_avQfAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[780])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5767};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_B, __pyx_mstate->__pyx_n_u_X};
    __pyx_mstate_global->__pyx_codeobj_tab[781] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_matSolve, __pyx_mstate->__pyx_kp_b_iso88591_a_4vQfAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[781])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5789};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_lda, __pyx_mstate->__pyx_n_u_ilda};
    __pyx_mstate_global->__pyx_codeobj_tab[782] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setDenseLDA, __pyx_mstate->__pyx_kp_b_iso88591_xq_e1A_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[782])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5807};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_lda};
    __pyx_mstate_global->__pyx_codeobj_tab[783] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getDenseLDA, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_Qd_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[783])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5821};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_readonly, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_lda, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_typenum, __pyx_mstate->__pyx_n_u_itemsize, __pyx_mstate->__pyx_n_u_flags, __pyx_mstate->__pyx_n_u_dims, __pyx_mstate->__pyx_n_u_strides, __pyx_mstate->__pyx_n_u_array};
    __pyx_mstate_global->__pyx_codeobj_tab[784] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getDenseArray, __pyx_mstate->__pyx_kp_b_iso88591_gZq_WA_a_at6_Q_az_fF_1_a_Qd_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[784])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5862};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[785] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getDenseLocalMatrix, __pyx_mstate->__pyx_kp_b_iso88591_Q_t1E_a_Qd_A_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[785])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5877};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rbegin, __pyx_mstate->__pyx_n_u_rend, __pyx_mstate->__pyx_n_u_cbegin, __pyx_mstate->__pyx_n_u_cend, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_crbegin, __pyx_mstate->__pyx_n_u_crend, __pyx_mstate->__pyx_n_u_ccbegin, __pyx_mstate->__pyx_n_u_ccend};
    __pyx_mstate_global->__pyx_codeobj_tab[786] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getDenseSubMatrix, __pyx_mstate->__pyx_kp_b_iso88591_A_a_k_t1E_Qa_e1A_Qa_e1A_a_1D_iwi, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[786])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5911};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_v};
    __pyx_mstate_global->__pyx_codeobj_tab[787] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_restoreDenseSubMatrix, __pyx_mstate->__pyx_kp_b_iso88591_0_Q_a_q_F_1_az_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[787])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5930};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_i_2};
    __pyx_mstate_global->__pyx_codeobj_tab[788] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getDenseColumnVec, __pyx_mstate->__pyx_kp_b_iso88591_y_5_6_5_e1_AQ_S_5_5_1_q_F_aq_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[788])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5962};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_V, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_i_2};
    __pyx_mstate_global->__pyx_codeobj_tab[789] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_restoreDenseColumnVec, __pyx_mstate->__pyx_kp_b_iso88591_2C_yXY_2WA_5_5_1_1D_d_1_Q_q_F_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[789])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5997};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nrows, __pyx_mstate->__pyx_n_u_ncols};
    __pyx_mstate_global->__pyx_codeobj_tab[790] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getNestSize, __pyx_mstate->__pyx_kp_b_iso88591_Q_k_a_Qd_uAXU_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[790])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6011};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nrows, __pyx_mstate->__pyx_n_u_ncols, __pyx_mstate->__pyx_n_u_cisrows, __pyx_mstate->__pyx_n_u_ciscols, __pyx_mstate->__pyx_n_u_unusedr, __pyx_mstate->__pyx_n_u_unusedc, __pyx_mstate->__pyx_n_u_isetsrows, __pyx_mstate->__pyx_n_u_isetscols, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[791] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getNestISs, __pyx_mstate->__pyx_kp_b_iso88591_A_k_a_Qd_hawaxvXQa_hawaxvXQa_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[791])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6032};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nrows, __pyx_mstate->__pyx_n_u_ncols, __pyx_mstate->__pyx_n_u_cisrows, __pyx_mstate->__pyx_n_u_ciscols, __pyx_mstate->__pyx_n_u_unusedr, __pyx_mstate->__pyx_n_u_unusedc, __pyx_mstate->__pyx_n_u_isetsrows, __pyx_mstate->__pyx_n_u_isetscols, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[792] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getNestLocalISs, __pyx_mstate->__pyx_kp_b_iso88591_k_a_Qd_hawaxvXQa_hawaxvXQa_a_fI, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[792])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6053};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_j, __pyx_mstate->__pyx_n_u_submat, __pyx_mstate->__pyx_n_u_idxm, __pyx_mstate->__pyx_n_u_jdxm};
    __pyx_mstate_global->__pyx_codeobj_tab[793] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getNestSubMatrix, __pyx_mstate->__pyx_kp_b_iso88591_Q_U_1_U_1_a_q_F_avQ_a_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[793])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6079};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[794] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getDM, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_axq_F_1_Zq_a_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[794])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6096};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[795] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setDM, __pyx_mstate->__pyx_kp_b_iso88591_a_axq_F_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[795])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6177};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stream};
    __pyx_mstate_global->__pyx_codeobj_tab[796] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_dlpack, __pyx_mstate->__pyx_kp_b_iso88591_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[796])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6180};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dltype, __pyx_mstate->__pyx_n_u_devId, __pyx_mstate->__pyx_n_u__29};
    __pyx_mstate_global->__pyx_codeobj_tab[797] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_dlpack_device, __pyx_mstate->__pyx_kp_b_iso88591_A_3e_5Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[797])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6184};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_ndim, __pyx_mstate->__pyx_n_u_device_type, __pyx_mstate->__pyx_n_u_device_id, __pyx_mstate->__pyx_n_u_shape, __pyx_mstate->__pyx_n_u_strides, __pyx_mstate->__pyx_n_u_hostmem, __pyx_mstate->__pyx_n_u_dlm_tensor, __pyx_mstate->__pyx_n_u_dl_tensor, __pyx_mstate->__pyx_n_u_a, __pyx_mstate->__pyx_n_u_shape_strides, __pyx_mstate->__pyx_n_u_ctx, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_dtype};
    __pyx_mstate_global->__pyx_codeobj_tab[798] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_toDLPack, __pyx_mstate->__pyx_kp_b_iso88591_iq_5_6_5_6_5_e1_AQ_A_k_wk9K1A_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[798])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6276};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[799] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[799])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6295};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[800] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[800])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6308};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_constant, __pyx_mstate->__pyx_n_u_vectors, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_has_const, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_nv_2, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_unused2, __pyx_mstate->__pyx_n_u_newnsp};
    __pyx_mstate_global->__pyx_codeobj_tab[801] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_A_a_havQ_1_Cq_1_hawauF_1_G9A_QfG, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[801])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6344};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_coords, __pyx_mstate->__pyx_n_u_newnsp};
    __pyx_mstate_global->__pyx_codeobj_tab[802] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_createRigidBody, __pyx_mstate->__pyx_kp_b_iso88591_Q_Q_a_6_q_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[802])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6365};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs};
    __pyx_mstate_global->__pyx_codeobj_tab[803] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_setFunction, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_9G1_2_uCvWA_vS_ha_V1_4vV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[803])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6399};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[804] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_hasConstant, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_a_4vQfF_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[804])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6413};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_nv_2, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_vectors};
    __pyx_mstate_global->__pyx_codeobj_tab[805] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getVecs, __pyx_mstate->__pyx_kp_b_iso88591_a_4vV1D_q_A_G9A_Q_waq_as_7_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[805])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6435};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[806] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_getFunction, __pyx_mstate->__pyx_kp_b_iso88591_Q_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[806])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6449};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[807] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_remove, __pyx_mstate->__pyx_kp_b_iso88591_a_fCq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[807])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6466};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[808] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Mat_pyx, __pyx_mstate->__pyx_n_u_test, __pyx_mstate->__pyx_kp_b_iso88591_q_a_a_q_F_V1A_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[808])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 29};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[809] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_MatPartitioning_p, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_t5_1_q_7_vV1_a_4wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[809])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 49};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[810] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_MatPartitioning_p, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_Qat1_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[810])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 62};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm};
    __pyx_mstate_global->__pyx_codeobj_tab[811] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_MatPartitioning_p, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_a_AWAT_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[811])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 81};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_matpartitioning_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[812] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_MatPartitioning_p, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_O1_Q_y_q_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[812])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 100};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[813] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_MatPartitioning_p, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_Qd_y_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[813])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 114};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[814] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_MatPartitioning_p, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_AT_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[814])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 126};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_adj};
    __pyx_mstate_global->__pyx_codeobj_tab[815] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_MatPartitioning_p, __pyx_mstate->__pyx_n_u_setAdjacency, __pyx_mstate->__pyx_kp_b_iso88591_q_a_4wc, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[815])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 144};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_partitioning};
    __pyx_mstate_global->__pyx_codeobj_tab[816] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_MatPartitioning_p, __pyx_mstate->__pyx_n_u_apply, __pyx_mstate->__pyx_kp_b_iso88591_a_1D_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[816])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 230};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[817] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_avQd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[817])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 249};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[818] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_ay_a_F_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[818])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 263};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newpc};
    __pyx_mstate_global->__pyx_codeobj_tab[819] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_Q_axq_q_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[819])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 288};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pc_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[820] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_a_1IQa_ay_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[820])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 307};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[821] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_ay_U_1_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[821])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 321};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[822] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_a_81A_a_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[822])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 340};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[823] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_a_e1A_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[823])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 354};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[824] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_appendOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_81A_a_AT_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[824])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 373};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[825] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_q_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[825])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 385};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_amat, __pyx_mstate->__pyx_n_u_pmat};
    __pyx_mstate_global->__pyx_codeobj_tab[826] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setOperators, __pyx_mstate->__pyx_kp_b_iso88591_Ya_1_2WF_1_2WF_a_Qd_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[826])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 420};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_P};
    __pyx_mstate_global->__pyx_codeobj_tab[827] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getOperators, __pyx_mstate->__pyx_kp_b_iso88591_a_S_1_a_Qd_q_q_a_1A_a_1A_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[827])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 436};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_cflag};
    __pyx_mstate_global->__pyx_codeobj_tab[828] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setUseAmat, __pyx_mstate->__pyx_kp_b_iso88591_y_q_1_A_a_1D_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[828])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 462};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cflag};
    __pyx_mstate_global->__pyx_codeobj_tab[829] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getUseAmat, __pyx_mstate->__pyx_kp_b_iso88591_A_q_a_1D_Qa_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[829])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 481};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_cflag};
    __pyx_mstate_global->__pyx_codeobj_tab[830] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setReusePreconditioner, __pyx_mstate->__pyx_kp_b_iso88591_9A_q_1_A_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[830])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 506};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_reason, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[831] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setFailedReason, __pyx_mstate->__pyx_kp_b_iso88591_Q_q_a_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[831])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 524};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_reason};
    __pyx_mstate_global->__pyx_codeobj_tab[832] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getFailedReason, __pyx_mstate->__pyx_kp_b_iso88591_a_U_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[832])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 545};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[833] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_awat1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[833])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 557};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[834] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_kp_b_iso88591_q_awat1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[834])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 569};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[835] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setUpOnBlocks, __pyx_mstate->__pyx_kp_b_iso88591_q_a_at1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[835])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 585};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[836] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_apply, __pyx_mstate->__pyx_kp_b_iso88591_Q_awat5_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[836])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 604};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[837] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_matApply, __pyx_mstate->__pyx_kp_b_iso88591_az_e1F_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[837])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 623};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[838] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_applyTranspose, __pyx_mstate->__pyx_kp_b_iso88591_a_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[838])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 645};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[839] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_matApplyTranspose, __pyx_mstate->__pyx_kp_b_iso88591_1_a_4uAV1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[839])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 664};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[840] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_applySymmetricLeft, __pyx_mstate->__pyx_kp_b_iso88591_2_a_1D_QfAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[840])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 683};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[841] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_applySymmetricRight, __pyx_mstate->__pyx_kp_b_iso88591_31_a_AT_avQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[841])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 704};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[842] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getDM, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_awat5_Zq_a_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[842])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 721};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[843] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setDM, __pyx_mstate->__pyx_kp_b_iso88591_a_awat5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[843])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 738};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_coordinates, __pyx_mstate->__pyx_n_u_xyz, __pyx_mstate->__pyx_n_u_nvtx, __pyx_mstate->__pyx_n_u_ndim, __pyx_mstate->__pyx_n_u_coords};
    __pyx_mstate_global->__pyx_codeobj_tab[844] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setCoordinates, __pyx_mstate->__pyx_kp_b_iso88591_H_6_q_AV6_Qa_q_S_6_1_1A_1E_1E_l, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[844])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 765};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newpc};
    __pyx_mstate_global->__pyx_codeobj_tab[845] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_createPython, __pyx_mstate->__pyx_kp_b_iso88591_F_nIQ_havQ_Q_axq_q_az_hd_ay_U_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[845])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 790};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[846] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setPythonContext, __pyx_mstate->__pyx_kp_b_iso88591_a_e7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[846])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 802};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[847] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getPythonContext, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_e1A_83fG1_Ya, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[847])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 817};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_py_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[848] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setPythonType, __pyx_mstate->__pyx_kp_b_iso88591_XQ_1IQa_a_at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[848])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 831};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[849] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getPythonType, __pyx_mstate->__pyx_kp_b_iso88591_q_a_at5_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[849])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 847};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[850] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getBJacobiSubKSP, __pyx_mstate->__pyx_kp_b_iso88591_1_a_e1CvQa_q_q_d, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[850])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 864};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_asmtype, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[851] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setASMType, __pyx_mstate->__pyx_kp_b_iso88591_a_1_a_1D_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[851])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 882};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_overlap, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[852] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setASMOverlap, __pyx_mstate->__pyx_kp_b_iso88591_XQ_U_1_a_at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[852])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 900};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nsd, __pyx_mstate->__pyx_n_u_is_sub, __pyx_mstate->__pyx_n_u_is_local, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_isets, __pyx_mstate->__pyx_n_u_isets_local};
    __pyx_mstate_global->__pyx_codeobj_tab[853] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setASMLocalSubdomains, __pyx_mstate->__pyx_kp_b_iso88591_A_a_q_a_A_7_3axs_axq_1_U_1_QfE_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[853])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 943};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nsd, __pyx_mstate->__pyx_n_u_is_sub, __pyx_mstate->__pyx_n_u_is_local, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_isets, __pyx_mstate->__pyx_n_u_isets_local};
    __pyx_mstate_global->__pyx_codeobj_tab[854] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setASMTotalSubdomains, __pyx_mstate->__pyx_kp_b_iso88591_A_a_q_a_A_7_3axs_axq_1_U_1_QfE_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[854])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 986};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[855] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getASMSubKSP, __pyx_mstate->__pyx_kp_b_iso88591_a_1_a_Qd_q_6_q_q_d, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[855])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1001};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dosort, __pyx_mstate->__pyx_n_u_cdosort};
    __pyx_mstate_global->__pyx_codeobj_tab[856] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setASMSortIndices, __pyx_mstate->__pyx_kp_b_iso88591_q_a_4uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[856])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1021};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gasmtype, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[857] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setGASMType, __pyx_mstate->__pyx_kp_b_iso88591_M_A_a_AT_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[857])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1039};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_overlap, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[858] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setGASMOverlap, __pyx_mstate->__pyx_kp_b_iso88591_ha_U_1_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[858])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1059};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gamgtype, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[859] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setGAMGType, __pyx_mstate->__pyx_kp_b_iso88591_7q_A_9AZq_a_AT_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[859])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1078};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_levels, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[860] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setGAMGLevels, __pyx_mstate->__pyx_kp_b_iso88591_HA_U_1_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[860])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1096};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_smooths, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[861] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setGAMGSmooths, __pyx_mstate->__pyx_kp_b_iso88591_ha_U_1_a_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[861])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1116};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[862] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getHYPREType, __pyx_mstate->__pyx_kp_b_iso88591_a_Q_a_Qd_q_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[862])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1130};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_hypretype, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[863] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setHYPREType, __pyx_mstate->__pyx_kp_b_iso88591_ha_Q_IQk_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[863])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1150};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[864] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setHYPREDiscreteCurl, __pyx_mstate->__pyx_kp_b_iso88591_q_a_Qd_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[864])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1167};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[865] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setHYPREDiscreteGradient, __pyx_mstate->__pyx_kp_b_iso88591_31_a_e3a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[865])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1184};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[866] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setHYPRESetAlphaPoissonMatrix, __pyx_mstate->__pyx_kp_b_iso88591_8_a_1D_S, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[866])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1201};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_pmat};
    __pyx_mstate_global->__pyx_codeobj_tab[867] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setHYPRESetBetaPoissonMatrix, __pyx_mstate->__pyx_kp_b_iso88591_39A_Q_4wfG3a_a_4uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[867])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1220};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_RT_Pi_Full, __pyx_mstate->__pyx_n_u_RT_Pi, __pyx_mstate->__pyx_n_u_ND_Pi_Full, __pyx_mstate->__pyx_n_u_ND_Pi, __pyx_mstate->__pyx_n_u_RT_full_mat, __pyx_mstate->__pyx_n_u_ND_full_mat, __pyx_mstate->__pyx_n_u_idim, __pyx_mstate->__pyx_n_u_RT_Pi_mat, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_ND_Pi_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[868] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setHYPRESetInterpolations, __pyx_mstate->__pyx_kp_b_iso88591_A_Q1_Ya2_A_gV_1_A_gV_1_U_1_1_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[868])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1268};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ozz, __pyx_mstate->__pyx_n_u_zoz, __pyx_mstate->__pyx_n_u_zzo, __pyx_mstate->__pyx_n_u_zzo_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[869] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setHYPRESetEdgeConstantVectors, __pyx_mstate->__pyx_kp_b_iso88591_GyPQ_4wfJc_a_AT_c_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[869])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1292};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_interior};
    __pyx_mstate_global->__pyx_codeobj_tab[870] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setHYPREAMSSetInteriorNodes, __pyx_mstate->__pyx_kp_b_iso88591_1_a_e81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[870])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1311};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_solver, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[871] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setFactorSolverType, __pyx_mstate->__pyx_kp_b_iso88591_C1_q_81A_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[871])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1330};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[872] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getFactorSolverType, __pyx_mstate->__pyx_kp_b_iso88591_Q_q_a_q_E_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[872])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1344};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[873] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setFactorSetUpSolverType, __pyx_mstate->__pyx_kp_b_iso88591_a_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[873])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1360};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ord_type, __pyx_mstate->__pyx_n_u_nzdiag, __pyx_mstate->__pyx_n_u_reuse, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_rval, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[874] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setFactorOrdering, __pyx_mstate->__pyx_kp_b_iso88591_A_q_q_Ya_9G1_y_1A_Qd_q_a_7_6_4AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[874])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1397};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_zeropivot, __pyx_mstate->__pyx_n_u_inblocks, __pyx_mstate->__pyx_n_u_rval, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[875] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setFactorPivot, __pyx_mstate->__pyx_kp_b_iso88591_A_a_WA_6_q_E_a_9G1_q_1D_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[875])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1426};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_shift_type, __pyx_mstate->__pyx_n_u_amount, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[876] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setFactorShift, __pyx_mstate->__pyx_kp_b_iso88591_A_1_y_A_gQ_Qa_q_E_a_7_6_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[876])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1456};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_levels, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[877] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setFactorLevels, __pyx_mstate->__pyx_kp_b_iso88591_ha_U_1_a_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[877])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1474};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[878] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getFactorMatrix, __pyx_mstate->__pyx_kp_b_iso88591_s_a_U_3a_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[878])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1491};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ctype, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[879] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setFieldSplitType, __pyx_mstate->__pyx_kp_b_iso88591_9_a_4uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[879])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 1509};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fields, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[880] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setFieldSplitIS, __pyx_mstate->__pyx_kp_b_iso88591_1_F_1_9AV1A_AT_gU, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[880])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 1535};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bsize, __pyx_mstate->__pyx_n_u_fields, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_nfields, __pyx_mstate->__pyx_n_u_ifields};
    __pyx_mstate_global->__pyx_codeobj_tab[881] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setFieldSplitFields, __pyx_mstate->__pyx_kp_b_iso88591_UUV_5_a_q_E_1_A_a_F_1_9AV1A_HAW, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[881])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1565};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_subksp, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[882] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getFieldSplitSubKSP, __pyx_mstate->__pyx_kp_b_iso88591_Q_1_Q_U_3aq_QgQaq_D_xq_9AQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[882])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1585};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_subksp, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[883] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getFieldSplitSchurGetSubKSP, __pyx_mstate->__pyx_kp_b_iso88591_Q_1_Q_Qd_q_1A_QgQaq_D_xq_9AQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[883])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1605};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_splitname, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[884] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getFieldSplitSubIS, __pyx_mstate->__pyx_kp_b_iso88591_HA_Q_IQk_a_U_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[884])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1621};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ctype, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[885] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setFieldSplitSchurFactType, __pyx_mstate->__pyx_kp_b_iso88591_00LA_41_a_1D_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[885])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1639};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ptype, __pyx_mstate->__pyx_n_u_pre, __pyx_mstate->__pyx_n_u_pval, __pyx_mstate->__pyx_n_u_pmat};
    __pyx_mstate_global->__pyx_codeobj_tab[886] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setFieldSplitSchurPreType, __pyx_mstate->__pyx_kp_b_iso88591_A_3_Q_4wfG3a_a_at5_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[886])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1666};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ctype, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[887] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setCompositeType, __pyx_mstate->__pyx_kp_b_iso88591_8_a_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[887])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1684};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_pc, __pyx_mstate->__pyx_n_u_cn};
    __pyx_mstate_global->__pyx_codeobj_tab[888] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getCompositePC, __pyx_mstate->__pyx_kp_b_iso88591_Rq_q_a_q_E_Qb_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[888])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1705};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pc_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[889] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_addCompositePCType, __pyx_mstate->__pyx_kp_b_iso88591_1IQa_a_1D_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[889])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1726};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ksp};
    __pyx_mstate_global->__pyx_codeobj_tab[890] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getKSP, __pyx_mstate->__pyx_kp_b_iso88591_s_a_4uAS_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[890])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1743};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[891] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getMGType, __pyx_mstate->__pyx_kp_b_iso88591_1_a_4uAQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[891])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1757};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mgtype, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[892] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setMGType, __pyx_mstate->__pyx_kp_b_iso88591_1_a_4uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[892])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1770};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_levels};
    __pyx_mstate_global->__pyx_codeobj_tab[893] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getMGLevels, __pyx_mstate->__pyx_kp_b_iso88591_Q_q_a_AT_aq_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[893])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1784};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_levels, __pyx_mstate->__pyx_n_u_clevels};
    __pyx_mstate_global->__pyx_codeobj_tab[894] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setMGLevels, __pyx_mstate->__pyx_kp_b_iso88591_Qa_a_AT_iq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[894])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1802};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ksp};
    __pyx_mstate_global->__pyx_codeobj_tab[895] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getMGCoarseSolve, __pyx_mstate->__pyx_kp_b_iso88591_s_a_e1Cq_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[895])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1817};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_clevel};
    __pyx_mstate_global->__pyx_codeobj_tab[896] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setMGInterpolation, __pyx_mstate->__pyx_kp_b_iso88591_4A_uAQ_a_1D_XS, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[896])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1837};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_clevel, __pyx_mstate->__pyx_n_u_interpolation};
    __pyx_mstate_global->__pyx_codeobj_tab[897] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getMGInterpolation, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_A_a_1D_XQm1_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[897])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1858};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_clevel};
    __pyx_mstate_global->__pyx_codeobj_tab[898] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setMGRestriction, __pyx_mstate->__pyx_kp_b_iso88591_7q_uAQ_a_e83a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[898])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1878};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_clevel, __pyx_mstate->__pyx_n_u_restriction};
    __pyx_mstate_global->__pyx_codeobj_tab[899] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getMGRestriction, __pyx_mstate->__pyx_kp_b_iso88591_ha_uAQ_s_a_e81Kq_a_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[899])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1899};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_rscale, __pyx_mstate->__pyx_n_u_clevel};
    __pyx_mstate_global->__pyx_codeobj_tab[900] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setMGRScale, __pyx_mstate->__pyx_kp_b_iso88591_5Q_uAQ_a_AT_hfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[900])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1919};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_clevel, __pyx_mstate->__pyx_n_u_rscale};
    __pyx_mstate_global->__pyx_codeobj_tab[901] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getMGRScale, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_Q_a_AT_havQ_a_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[901])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1940};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_clevel, __pyx_mstate->__pyx_n_u_ksp};
    __pyx_mstate_global->__pyx_codeobj_tab[902] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getMGSmoother, __pyx_mstate->__pyx_kp_b_iso88591_81_uAQ_s_a_at5_A_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[902])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1961};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_clevel, __pyx_mstate->__pyx_n_u_ksp};
    __pyx_mstate_global->__pyx_codeobj_tab[903] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getMGSmootherDown, __pyx_mstate->__pyx_kp_b_iso88591_xq_uAQ_s_a_4uHAS_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[903])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1982};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_clevel, __pyx_mstate->__pyx_n_u_ksp};
    __pyx_mstate_global->__pyx_codeobj_tab[904] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getMGSmootherUp, __pyx_mstate->__pyx_kp_b_iso88591_XQ_uAQ_s_a_U_3a_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[904])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2003};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cycle_type, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[905] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setMGCycleType, __pyx_mstate->__pyx_kp_b_iso88591_9_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[905])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2021};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_cycle_type, __pyx_mstate->__pyx_n_u_clevel, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[906] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setMGCycleTypeOnLevel, __pyx_mstate->__pyx_kp_b_iso88591_LA_uAQ_a_at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[906])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2042};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_rhs, __pyx_mstate->__pyx_n_u_clevel};
    __pyx_mstate_global->__pyx_codeobj_tab[907] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setMGRhs, __pyx_mstate->__pyx_kp_b_iso88591_q_uAQ_az_e83a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[907])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2065};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_clevel};
    __pyx_mstate_global->__pyx_codeobj_tab[908] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setMGX, __pyx_mstate->__pyx_kp_b_iso88591_O1_uAQ_axq_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[908])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2088};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_clevel};
    __pyx_mstate_global->__pyx_codeobj_tab[909] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setMGR, __pyx_mstate->__pyx_kp_b_iso88591_O1_uAQ_axq_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[909])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2113};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_csr, __pyx_mstate->__pyx_n_u_oi, __pyx_mstate->__pyx_n_u_oj, __pyx_mstate->__pyx_n_u_ni, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_nj_2, __pyx_mstate->__pyx_n_u_j};
    __pyx_mstate_global->__pyx_codeobj_tab[910] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setBDDCLocalAdjacency, __pyx_mstate->__pyx_kp_b_iso88591_A_q_q_E_XQd_4q_XQd_4q_AQc_A_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[910])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2143};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_div, __pyx_mstate->__pyx_n_u_trans, __pyx_mstate->__pyx_n_u_l2l, __pyx_mstate->__pyx_n_u_ptrans, __pyx_mstate->__pyx_n_u_pl2l};
    __pyx_mstate_global->__pyx_codeobj_tab[911] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setBDDCDivergenceMat, __pyx_mstate->__pyx_kp_b_iso88591_37_QR_A_4wfG3a_a_Qd_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[911])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2169};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_G, __pyx_mstate->__pyx_n_u_order, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_gord, __pyx_mstate->__pyx_n_u_conforming, __pyx_mstate->__pyx_n_u_porder, __pyx_mstate->__pyx_n_u_pfield, __pyx_mstate->__pyx_n_u_pgord, __pyx_mstate->__pyx_n_u_pconforming};
    __pyx_mstate_global->__pyx_codeobj_tab[912] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setBDDCDiscreteGradient, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_Q_Q_9A0_uAQ_uAQ_q_Q_a_U_6_PQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[912])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2205};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_T_2, __pyx_mstate->__pyx_n_u_interior, __pyx_mstate->__pyx_n_u_pinterior};
    __pyx_mstate_global->__pyx_codeobj_tab[913] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setBDDCChangeOfBasisMat, __pyx_mstate->__pyx_kp_b_iso88591_7wj_1_a_U_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[913])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2226};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_primv};
    __pyx_mstate_global->__pyx_codeobj_tab[914] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setBDDCPrimalVerticesIS, __pyx_mstate->__pyx_kp_b_iso88591_31_a_U_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[914])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2243};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_primv};
    __pyx_mstate_global->__pyx_codeobj_tab[915] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setBDDCPrimalVerticesLocalIS, __pyx_mstate->__pyx_kp_b_iso88591_8_a_Qd_uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[915])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2260};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cratio, __pyx_mstate->__pyx_n_u_pcratio};
    __pyx_mstate_global->__pyx_codeobj_tab[916] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setBDDCCoarseningRatio, __pyx_mstate->__pyx_kp_b_iso88591_XQ_Qa_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[916])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2278};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_levels, __pyx_mstate->__pyx_n_u_plevels};
    __pyx_mstate_global->__pyx_codeobj_tab[917] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setBDDCLevels, __pyx_mstate->__pyx_kp_b_iso88591_HA_Qa_a_at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[917])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2296};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bndr};
    __pyx_mstate_global->__pyx_codeobj_tab[918] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setBDDCDirichletBoundaries, __pyx_mstate->__pyx_kp_b_iso88591_5Q_a_1D_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[918])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2313};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bndr};
    __pyx_mstate_global->__pyx_codeobj_tab[919] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setBDDCDirichletBoundariesLocal, __pyx_mstate->__pyx_kp_b_iso88591_a_0_U_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[919])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2330};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bndr};
    __pyx_mstate_global->__pyx_codeobj_tab[920] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setBDDCNeumannBoundaries, __pyx_mstate->__pyx_kp_b_iso88591_31_a_e4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[920])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2347};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bndr};
    __pyx_mstate_global->__pyx_codeobj_tab[921] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setBDDCNeumannBoundariesLocal, __pyx_mstate->__pyx_kp_b_iso88591_8_a_at5_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[921])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2364};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isfields, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_cisfields, __pyx_mstate->__pyx_n_u_unused};
    __pyx_mstate_global->__pyx_codeobj_tab[922] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setBDDCDofsSplitting, __pyx_mstate->__pyx_kp_b_iso88591_C1_1M_1Jit1A_s_1_1_XQgQj_F_1_G9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[922])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2386};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isfields, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_cisfields, __pyx_mstate->__pyx_n_u_unused};
    __pyx_mstate_global->__pyx_codeobj_tab[923] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setBDDCDofsSplittingLocal, __pyx_mstate->__pyx_kp_b_iso88591_22H_1M_1Jit1A_s_1_1_XQgQj_F_1_G, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[923])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2412};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[924] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getPatchSubKSP, __pyx_mstate->__pyx_kp_b_iso88591_1_a_q_E_Qa_q_q_d, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[924])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2423};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sec};
    __pyx_mstate_global->__pyx_codeobj_tab[925] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setPatchCellNumbering, __pyx_mstate->__pyx_kp_b_iso88591_4A_a_at5_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[925])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2427};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dms, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_cellNodeMaps, __pyx_mstate->__pyx_n_u_subspaceOffsets, __pyx_mstate->__pyx_n_u_ghostBcNodes, __pyx_mstate->__pyx_n_u_globalBcNodes, __pyx_mstate->__pyx_n_u_numSubSpaces, __pyx_mstate->__pyx_n_u_numGhostBcs, __pyx_mstate->__pyx_n_u_numGlobalBcs, __pyx_mstate->__pyx_n_u_nodesPerCell, __pyx_mstate->__pyx_n_u_ccellNodeMaps, __pyx_mstate->__pyx_n_u_cdms, __pyx_mstate->__pyx_n_u_cbs, __pyx_mstate->__pyx_n_u_csubspaceOffsets, __pyx_mstate->__pyx_n_u_cghostBcNodes, __pyx_mstate->__pyx_n_u_cglobalBcNodes, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u__29, __pyx_mstate->__pyx_n_u_nodes};
    __pyx_mstate_global->__pyx_codeobj_tab[926] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setPatchDiscretisationInfo, __pyx_mstate->__pyx_kp_b_iso88591_A_67_Q_6a_a_a_Q_Q_q_XQd_xq_a_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[926])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2468};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_operator, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[927] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setPatchComputeOperator, __pyx_mstate->__pyx_kp_b_iso88591_5_5_F_6_F_V1_IQ_4A_a_U2K7RS, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[927])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2476};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_operator, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[928] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setPatchComputeOperatorInteriorF, __pyx_mstate->__pyx_kp_b_iso88591_C_yXY_5_F_6_F_V1_IQ_DA_a_6at5_g, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[928])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2484};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[929] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setPatchComputeFunction, __pyx_mstate->__pyx_kp_b_iso88591_5_5_F_6_F_V1_IQ_4A_a_U2K7RS, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[929])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2492};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[930] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setPatchComputeFunctionInteriorF, __pyx_mstate->__pyx_kp_b_iso88591_C_yXY_5_F_6_F_V1_IQ_DA_a_U2YY_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[930])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2500};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_typ, __pyx_mstate->__pyx_n_u_operator, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[931] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setPatchConstructType, __pyx_mstate->__pyx_kp_b_iso88591_2_RS_5_F_6_F_4t2_3FgTQZZ_AQ_9G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[931])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2516};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_uis, __pyx_mstate->__pyx_n_u_uaux};
    __pyx_mstate_global->__pyx_codeobj_tab[932] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setHPDDMAuxiliaryMat, __pyx_mstate->__pyx_kp_b_iso88591_8_a_Qd_s_V6_PQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[932])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2535};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_B};
    __pyx_mstate_global->__pyx_codeobj_tab[933] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setHPDDMRHSMat, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[933])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2552};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gc, __pyx_mstate->__pyx_n_u_oc};
    __pyx_mstate_global->__pyx_codeobj_tab[934] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getHPDDMComplexities, __pyx_mstate->__pyx_kp_b_iso88591_a_Ja_a_Qd_q_AQ_auF_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[934])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2566};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_has, __pyx_mstate->__pyx_n_u_phas};
    __pyx_mstate_global->__pyx_codeobj_tab[935] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setHPDDMHasNeumannMat, __pyx_mstate->__pyx_kp_b_iso88591_a_a_1D_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[935])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2584};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_correction_type, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[936] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setHPDDMCoarseCorrectionType, __pyx_mstate->__pyx_kp_b_iso88591_ZZ_7a_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[936])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2602};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[937] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getHPDDMCoarseCorrectionType, __pyx_mstate->__pyx_kp_b_iso88591_a_6Q_a_Qd_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[937])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2616};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[938] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getHPDDMSTShareSubKSP, __pyx_mstate->__pyx_kp_b_iso88591_q_a_a_at5_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[938])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2630};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_uis, __pyx_mstate->__pyx_n_u_U};
    __pyx_mstate_global->__pyx_codeobj_tab[939] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setHPDDMDeflationMat, __pyx_mstate->__pyx_kp_b_iso88591_5Q_a_Qd_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[939])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2651};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_val, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[940] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setSPAIEpsilon, __pyx_mstate->__pyx_kp_b_iso88591_A_fAQ_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[940])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2669};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nbsteps, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[941] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setSPAINBSteps, __pyx_mstate->__pyx_kp_b_iso88591_ha_U_1_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[941])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2687};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maxval, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[942] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setSPAIMax, __pyx_mstate->__pyx_kp_b_iso88591_U_1_a_1D_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[942])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2706};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maxval, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[943] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setSPAIMaxNew, __pyx_mstate->__pyx_kp_b_iso88591_HA_U_1_a_at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[943])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2724};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[944] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setSPAIBlockSize, __pyx_mstate->__pyx_kp_b_iso88591_U_1_a_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[944])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2742};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[945] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setSPAICacheSize, __pyx_mstate->__pyx_kp_b_iso88591_XQ_U_1_a_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[945])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2760};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[946] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setSPAIVerbose, __pyx_mstate->__pyx_kp_b_iso88591_HA_U_1_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[946])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2778};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sym, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[947] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setSPAISp, __pyx_mstate->__pyx_kp_b_iso88591_XQ_U_1_a_4uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[947])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2798};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flg, __pyx_mstate->__pyx_n_u_cflg};
    __pyx_mstate_global->__pyx_codeobj_tab[948] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setDeflationInitOnly, __pyx_mstate->__pyx_kp_b_iso88591_fAQ_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[948])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2820};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_levels, __pyx_mstate->__pyx_n_u_clevels};
    __pyx_mstate_global->__pyx_codeobj_tab[949] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setDeflationLevels, __pyx_mstate->__pyx_kp_b_iso88591_Qa_a_1D_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[949])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2838};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_red, __pyx_mstate->__pyx_n_u_cred};
    __pyx_mstate_global->__pyx_codeobj_tab[950] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setDeflationReductionFactor, __pyx_mstate->__pyx_kp_b_iso88591_xq_U_1_a_AT_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[950])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2856};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fact, __pyx_mstate->__pyx_n_u_cfact};
    __pyx_mstate_global->__pyx_codeobj_tab[951] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setDeflationCorrectionFactor, __pyx_mstate->__pyx_kp_b_iso88591_1_1_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[951])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2874};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_space_type, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_csize, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[952] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setDeflationSpaceToCompute, __pyx_mstate->__pyx_kp_b_iso88591_55OxWX_e1A_q_a_1D_WA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[952])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2895};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_W, __pyx_mstate->__pyx_n_u_transpose, __pyx_mstate->__pyx_n_u_ctranspose};
    __pyx_mstate_global->__pyx_codeobj_tab[953] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setDeflationSpace, __pyx_mstate->__pyx_kp_b_iso88591_2_1_F_1_a_4uAV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[953])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2916};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[954] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setDeflationProjectionNullSpaceM, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_31D_S, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[954])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2933};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[955] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_setDeflationCoarseMat, __pyx_mstate->__pyx_kp_b_iso88591_0_a_at5_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[955])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2950};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ksp};
    __pyx_mstate_global->__pyx_codeobj_tab[956] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getDeflationCoarseKSP, __pyx_mstate->__pyx_kp_b_iso88591_q_s_a_at5_A_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[956])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2965};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_apc};
    __pyx_mstate_global->__pyx_codeobj_tab[957] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PC_pyx, __pyx_mstate->__pyx_n_u_getDeflationPC, __pyx_mstate->__pyx_kp_b_iso88591_b_a_q_E_Q_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[957])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 435};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[958] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_awat6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[958])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 454};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[959] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_az_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[959])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 467};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newksp};
    __pyx_mstate_global->__pyx_codeobj_tab[960] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_q_ay_az_hd_q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[960])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 483};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ksp_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[961] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_q_9AZq_az_fA_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[961])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 519};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[962] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_az_fAQ_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[962])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 533};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[963] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_aD_81A_a_4vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[963])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 571};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[964] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_a_4vQa_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[964])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 585};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[965] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_appendOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_81A_a_Qd_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[965])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 610};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[966] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[966])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 627};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_appctx};
    __pyx_mstate_global->__pyx_codeobj_tab[967] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setAppCtx, __pyx_mstate->__pyx_kp_b_iso88591_IQnA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[967])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 650};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[968] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getAppCtx, __pyx_mstate->__pyx_kp_b_iso88591_1_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[968])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 664};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[969] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getDM, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_axq_F_1_Zq_a_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[969])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 681};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[970] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setDM, __pyx_mstate->__pyx_kp_b_iso88591_a_axq_F_A_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[970])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 715};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dmactive, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_cflag};
    __pyx_mstate_global->__pyx_codeobj_tab[971] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setDMActive, __pyx_mstate->__pyx_kp_b_iso88591_4IQ_vQa_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[971])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 741};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rhs, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[972] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setComputeRHS, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_0_6_F_6_F_5_a_IQk_a_q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[972])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 775};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_operators, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[973] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setComputeOperators, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_F_6_F_6_F_fA_IQ_q_a_Qd_0_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[973])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 820};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_amat, __pyx_mstate->__pyx_n_u_pmat};
    __pyx_mstate_global->__pyx_codeobj_tab[974] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setOperators, __pyx_mstate->__pyx_kp_b_iso88591_YaL_1_2WF_1_2WF_a_at6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[974])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 864};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_P};
    __pyx_mstate_global->__pyx_codeobj_tab[975] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getOperators, __pyx_mstate->__pyx_kp_b_iso88591_a_S_1_a_at6_6_1_a_1A_a_1A_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[975])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 891};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pc};
    __pyx_mstate_global->__pyx_codeobj_tab[976] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setPC, __pyx_mstate->__pyx_kp_b_iso88591_a_axq_F_A_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[976])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 911};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pc};
    __pyx_mstate_global->__pyx_codeobj_tab[977] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getPC, __pyx_mstate->__pyx_kp_b_iso88591_q_Rq_axq_F_2Q_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[977])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 928};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rtol, __pyx_mstate->__pyx_n_u_atol, __pyx_mstate->__pyx_n_u_divtol, __pyx_mstate->__pyx_n_u_max_it, __pyx_mstate->__pyx_n_u_crtol, __pyx_mstate->__pyx_n_u_catol, __pyx_mstate->__pyx_n_u_cdivtol, __pyx_mstate->__pyx_n_u_cmaxits};
    __pyx_mstate_global->__pyx_codeobj_tab[978] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setTolerances, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_Q_q_YaX_7_z_q_7_z_q_7_z_q_7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[978])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 985};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_crtol, __pyx_mstate->__pyx_n_u_catol, __pyx_mstate->__pyx_n_u_cdivtol, __pyx_mstate->__pyx_n_u_cmaxits};
    __pyx_mstate_global->__pyx_codeobj_tab[979] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getTolerances, __pyx_mstate->__pyx_kp_b_iso88591_q0_Yk_a_a_q_F_7_7_9AQ_axvQhfAZu, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[979])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1014};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_converged, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_normtype, __pyx_mstate->__pyx_n_u_cctx, __pyx_mstate->__pyx_n_u_islsqr};
    __pyx_mstate_global->__pyx_codeobj_tab[980] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setConvergenceTest, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_WA_oV1_uCvWA_vS_ha_KvQ_fAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[980])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1079};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_converged, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_prepend, __pyx_mstate->__pyx_n_u_oconverged, __pyx_mstate->__pyx_n_u_pre};
    __pyx_mstate_global->__pyx_codeobj_tab[981] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_addConvergenceTest, __pyx_mstate->__pyx_kp_b_iso88591_A_q_q_Yaq_V1A_S_a_gV6_AQ_a_AT_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[981])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1122};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[982] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getConvergenceTest, __pyx_mstate->__pyx_kp_b_iso88591_A_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[982])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1135};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_its, __pyx_mstate->__pyx_n_u_rnorm, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_rval, __pyx_mstate->__pyx_n_u_reason};
    __pyx_mstate_global->__pyx_codeobj_tab[983] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_callConvergenceTest, __pyx_mstate->__pyx_kp_b_iso88591_Q_e1A_fAQ_a_a_Qd_fAQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[983])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1158};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_length, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_hist};
    __pyx_mstate_global->__pyx_codeobj_tab[984] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setConvergenceHistory, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_j_q_q_a_WCq_G6_Qa_5_WA_7_81G, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[984])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1202};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_size};
    __pyx_mstate_global->__pyx_codeobj_tab[985] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getConvergenceHistory, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_q_a_AT_q_aq_wavQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[985])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1217};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rnorm, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[986] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_logConvergenceHistory, __pyx_mstate->__pyx_kp_b_iso88591_Q_fAQ_a_AT_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[986])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1233};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_monitor, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_monitorlist};
    __pyx_mstate_global->__pyx_codeobj_tab[987] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setMonitor, __pyx_mstate->__pyx_kp_b_iso88591_A_2_2_1D_83fA_iq_s_V_a_5_6_6_F_7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[987])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1280};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[988] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getMonitor, __pyx_mstate->__pyx_kp_b_iso88591_A_t9AQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[988])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1293};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[989] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_monitorCancel, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_A_IQoQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[989])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1308};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_its, __pyx_mstate->__pyx_n_u_rnorm, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[990] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_monitor, __pyx_mstate->__pyx_kp_b_iso88591_z_e1A_fAQ_az_fF, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[990])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1329};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_side};
    __pyx_mstate_global->__pyx_codeobj_tab[991] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setPCSide, __pyx_mstate->__pyx_kp_b_iso88591_l_a_1D_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[991])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1363};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_side};
    __pyx_mstate_global->__pyx_codeobj_tab[992] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getPCSide, __pyx_mstate->__pyx_kp_b_iso88591_1_a_1D_aq_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[992])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1377};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_normtype};
    __pyx_mstate_global->__pyx_codeobj_tab[993] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setNormType, __pyx_mstate->__pyx_kp_b_iso88591_M_2_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[993])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1404};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_normtype};
    __pyx_mstate_global->__pyx_codeobj_tab[994] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getNormType, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_Qd_q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[994])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1418};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_compute};
    __pyx_mstate_global->__pyx_codeobj_tab[995] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setComputeEigenvalues, __pyx_mstate->__pyx_kp_b_iso88591_1_q_a_q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[995])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1444};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[996] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getComputeEigenvalues, __pyx_mstate->__pyx_kp_b_iso88591_q_a_a_q_F_1_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[996])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1462};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_compute};
    __pyx_mstate_global->__pyx_codeobj_tab[997] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setComputeSingularValues, __pyx_mstate->__pyx_kp_b_iso88591_Ya_q_a_4vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[997])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1488};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[998] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getComputeSingularValues, __pyx_mstate->__pyx_kp_b_iso88591_a_a_4vQa_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[998])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1508};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_guess_nonzero};
    __pyx_mstate_global->__pyx_codeobj_tab[999] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setInitialGuessNonzero, __pyx_mstate->__pyx_kp_b_iso88591_9A_vQa_a_V1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[999])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1530};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1000] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getInitialGuessNonzero, __pyx_mstate->__pyx_kp_b_iso88591_a_a_V1A_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1000])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1544};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_guess_knoll};
    __pyx_mstate_global->__pyx_codeobj_tab[1001] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setInitialGuessKnoll, __pyx_mstate->__pyx_kp_b_iso88591_V1A_a_at6_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1001])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1564};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1002] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getInitialGuessKnoll, __pyx_mstate->__pyx_kp_b_iso88591_a_a_a_at6_vQa_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1002])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1581};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_model, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_ival1, __pyx_mstate->__pyx_n_u_ival2};
    __pyx_mstate_global->__pyx_codeobj_tab[1003] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setUseFischerGuess, __pyx_mstate->__pyx_kp_b_iso88591_81_e1A_e1A_a_AT_wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1003])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1609};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1004] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_axq_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1004])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1621};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1005] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_kp_b_iso88591_q_axq_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1005])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1636};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1006] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setUpOnBlocks, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_A_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1006])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1651};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_presolve, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1007] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setPreSolve, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_9G1_uCvWA_vS_ha_z_q_fN_fF, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1007])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1684};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_postsolve, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1008] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setPostSolve, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_WA_uCvWA_vS_ha_1_4v_G1_1_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1008])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1717};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_b_vec, __pyx_mstate->__pyx_n_u_x_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1009] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_solve, __pyx_mstate->__pyx_kp_b_iso88591_QV_a_a_2WF_1_2WF_1_axq_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1009])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1798};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[1010] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_solveTranspose, __pyx_mstate->__pyx_kp_b_iso88591_a_a_V1F_1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1010])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1822};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_B, __pyx_mstate->__pyx_n_u_X};
    __pyx_mstate_global->__pyx_codeobj_tab[1011] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_matSolve, __pyx_mstate->__pyx_kp_b_iso88591_a_4vQfAQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1011])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1844};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_B, __pyx_mstate->__pyx_n_u_X};
    __pyx_mstate_global->__pyx_codeobj_tab[1012] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_matSolveTranspose, __pyx_mstate->__pyx_kp_b_iso88591_1_a_1D_avQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1012])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1863};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_its, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1013] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setIterationNumber, __pyx_mstate->__pyx_kp_b_iso88591_ha_U_1_a_AT_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1013])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1868};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1014] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getIterationNumber, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_a_AT_q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1014])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1874};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rnorm, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1015] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setResidualNorm, __pyx_mstate->__pyx_kp_b_iso88591_Zq_fAQ_a_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1015])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1879};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1016] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getResidualNorm, __pyx_mstate->__pyx_kp_b_iso88591_a_a_fAQ_vQa_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1016])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1885};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_reason, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[1017] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setConvergedReason, __pyx_mstate->__pyx_kp_b_iso88591_A_1_a_AT_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1017])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1890};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_reason};
    __pyx_mstate_global->__pyx_codeobj_tab[1018] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getConvergedReason, __pyx_mstate->__pyx_kp_b_iso88591_A_a_a_AT_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1018])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1896};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1019] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getCGObjectiveValue, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1019])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1910};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_hpddm_type, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[1020] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setHPDDMType, __pyx_mstate->__pyx_kp_b_iso88591_Q_q_a_at6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1020])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1928};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1021] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getHPDDMType, __pyx_mstate->__pyx_kp_b_iso88591_a_a_a_at6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1021])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1942};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_ernc};
    __pyx_mstate_global->__pyx_codeobj_tab[1022] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setErrorIfNotConverged, __pyx_mstate->__pyx_kp_b_iso88591_9A_fAQ_a_V1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1022])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1960};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1023] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getErrorIfNotConverged, __pyx_mstate->__pyx_kp_b_iso88591_a_a_V1A_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1023])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1974};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1024] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getRhs, __pyx_mstate->__pyx_kp_b_iso88591_s_ay_V1Cq_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1024])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1989};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1025] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getSolution, __pyx_mstate->__pyx_kp_b_iso88591_Q_s_a_Qd_A_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1025])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2007};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_right, __pyx_mstate->__pyx_n_u_left, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_L, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_nr, __pyx_mstate->__pyx_n_u_nl, __pyx_mstate->__pyx_n_u_vr, __pyx_mstate->__pyx_n_u_vl, __pyx_mstate->__pyx_n_u_vecsr, __pyx_mstate->__pyx_n_u_vecsl};
    __pyx_mstate_global->__pyx_codeobj_tab[1026] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getWorkVecs, __pyx_mstate->__pyx_kp_b_iso88591_A_A_9A_fG1_fG1_fA_A_3e5_3e5_F_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1026])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2055};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[1027] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_buildSolution, __pyx_mstate->__pyx_kp_b_iso88591_1_2S_d_Q_1E_A_fAQa_q_q_a_q_F_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1027])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2077};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_r};
    __pyx_mstate_global->__pyx_codeobj_tab[1028] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_buildResidual, __pyx_mstate->__pyx_kp_b_iso88591_1_2S_d_Q_1E_A_9AT_q_q_q_a_q_G6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1028])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2099};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_its, __pyx_mstate->__pyx_n_u_neig, __pyx_mstate->__pyx_n_u_rdata, __pyx_mstate->__pyx_n_u_idata, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_eigen};
    __pyx_mstate_global->__pyx_codeobj_tab[1029] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_computeEigenvalues, __pyx_mstate->__pyx_kp_b_iso88591_A_A_Q_a_AT_q_aq_aq_a_AT_uG7_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1029])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2122};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_smax, __pyx_mstate->__pyx_n_u_smin};
    __pyx_mstate_global->__pyx_codeobj_tab[1030] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_computeExtremeSingularValues, __pyx_mstate->__pyx_kp_b_iso88591_a_a_a_a_at6_vQgV1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1030])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2146};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_restart, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1031] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setGMRESRestart, __pyx_mstate->__pyx_kp_b_iso88591_xq_U_1_a_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1031])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2168};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newksp};
    __pyx_mstate_global->__pyx_codeobj_tab[1032] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_createPython, __pyx_mstate->__pyx_kp_b_iso88591_A_q_IQ_havQ_q_ay_az_hd_az_fA_a_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1032])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2197};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1033] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setPythonContext, __pyx_mstate->__pyx_kp_b_iso88591_Ya_a_4vWA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1033])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2209};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1034] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getPythonContext, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_4vQa_83fG1_Ya_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1034])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2224};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_py_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1035] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_setPythonType, __pyx_mstate->__pyx_kp_b_iso88591_XQ_1IQa_a_q_F_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1035])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2239};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1036] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_KSP_pyx, __pyx_mstate->__pyx_n_u_getPythonType, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_F_1_y_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1036])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 129};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_cviewer};
    __pyx_mstate_global->__pyx_codeobj_tab[1037] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_1_7_z_q_axq_G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1037])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 148};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1038] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_1D_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1038])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 161};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newsnes};
    __pyx_mstate_global->__pyx_codeobj_tab[1039] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_az_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1039])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 182};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_snes_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1040] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_IQk_a_4wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1040])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 201};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1041] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_a_4waq_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1041])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 215};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1042] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_a_81A_a_1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1042])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 229};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1043] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_a_1D_q_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1043])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 243};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1044] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_appendOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_81A_a_at7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1044])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 257};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1045] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1045])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 271};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_appctx};
    __pyx_mstate_global->__pyx_codeobj_tab[1046] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setApplicationContext, __pyx_mstate->__pyx_kp_b_iso88591_HA_IQnA_7_7_AT_q_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1046])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 280};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ctx, __pyx_mstate->__pyx_n_u_appctx};
    __pyx_mstate_global->__pyx_codeobj_tab[1047] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getApplicationContext, __pyx_mstate->__pyx_kp_b_iso88591_q_Yaq_7_Q_AT_XQa_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1047])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 295};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1048] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getDM, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_ay_WAQ_Zq_a_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1048])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 312};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1049] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setDM, __pyx_mstate->__pyx_kp_b_iso88591_a_ay_WBa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1049])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 326};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_delta_min, __pyx_mstate->__pyx_n_u_delta_max, __pyx_mstate->__pyx_n_u_delta_0, __pyx_mstate->__pyx_n_u_cdmin, __pyx_mstate->__pyx_n_u_cdmax, __pyx_mstate->__pyx_n_u_cd0};
    __pyx_mstate_global->__pyx_codeobj_tab[1050] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setTRTolerances, __pyx_mstate->__pyx_kp_b_iso88591_8I_Xggvv_A_a_WF_6_WF_6_WF_6_a_W, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1050])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 353};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cdmin, __pyx_mstate->__pyx_n_u_cdmax, __pyx_mstate->__pyx_n_u_cd0};
    __pyx_mstate_global->__pyx_codeobj_tab[1051] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getTRTolerances, __pyx_mstate->__pyx_kp_b_iso88591_1_a_WAWAWAQ_axvQhfAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1051])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 377};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_eta1, __pyx_mstate->__pyx_n_u_eta2, __pyx_mstate->__pyx_n_u_eta3, __pyx_mstate->__pyx_n_u_t1, __pyx_mstate->__pyx_n_u_t2, __pyx_mstate->__pyx_n_u_ceta1, __pyx_mstate->__pyx_n_u_ceta2, __pyx_mstate->__pyx_n_u_ceta3, __pyx_mstate->__pyx_n_u_ct1, __pyx_mstate->__pyx_n_u_ct2};
    __pyx_mstate_global->__pyx_codeobj_tab[1052] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setTRUpdateParameters, __pyx_mstate->__pyx_kp_b_iso88591_A_3_lZiij_1_ST2_fA_5_vXV1A_5_vXV, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1052])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 412};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ceta1, __pyx_mstate->__pyx_n_u_ceta2, __pyx_mstate->__pyx_n_u_ceta3, __pyx_mstate->__pyx_n_u_ct1, __pyx_mstate->__pyx_n_u_ct2};
    __pyx_mstate_global->__pyx_codeobj_tab[1053] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getTRUpdateParameters, __pyx_mstate->__pyx_kp_b_iso88591_q0_Yiq_a_at7_7_7_7RSSXXYYZ_axvQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1053])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 442};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_clevel};
    __pyx_mstate_global->__pyx_codeobj_tab[1054] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setFASInterpolation, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_a_at7_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1054])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 456};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_clevel, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[1055] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getFASInterpolation, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_s_a_at7_3a_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1055])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 472};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_clevel};
    __pyx_mstate_global->__pyx_codeobj_tab[1056] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setFASRestriction, __pyx_mstate->__pyx_kp_b_iso88591_8_uAQ_a_AT_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1056])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 486};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_clevel, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[1057] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getFASRestriction, __pyx_mstate->__pyx_kp_b_iso88591_xq_uAQ_s_a_AT_A_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1057])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 502};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_clevel};
    __pyx_mstate_global->__pyx_codeobj_tab[1058] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setFASInjection, __pyx_mstate->__pyx_kp_b_iso88591_6a_uAQ_a_4whc, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1058])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 516};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_clevel, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[1059] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getFASInjection, __pyx_mstate->__pyx_kp_b_iso88591_XQ_uAQ_s_a_4whas_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1059])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 532};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_clevel};
    __pyx_mstate_global->__pyx_codeobj_tab[1060] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setFASRScale, __pyx_mstate->__pyx_kp_b_iso88591_31_uAQ_a_q_G83a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1060])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 545};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_levels, __pyx_mstate->__pyx_n_u_comms, __pyx_mstate->__pyx_n_u_clevels, __pyx_mstate->__pyx_n_u_ccomms, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_comm};
    __pyx_mstate_global->__pyx_codeobj_tab[1061] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setFASLevels, __pyx_mstate->__pyx_kp_b_iso88591_GyPQ_Qa_A_6_xs_Cq_j_a_q_Cxy_5_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1061])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 579};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_levels};
    __pyx_mstate_global->__pyx_codeobj_tab[1062] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getFASLevels, __pyx_mstate->__pyx_kp_b_iso88591_a_q_a_q_G1A_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1062])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 593};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_clevel, __pyx_mstate->__pyx_n_u_lsnes};
    __pyx_mstate_global->__pyx_codeobj_tab[1063] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getFASCycleSNES, __pyx_mstate->__pyx_kp_b_iso88591_XQ_uAQ_a_a_4whauA_a_5_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1063])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 610};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_smooth};
    __pyx_mstate_global->__pyx_codeobj_tab[1064] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getFASCoarseSolve, __pyx_mstate->__pyx_kp_b_iso88591_1_4q_a_AT_q_a_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1064])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 625};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_clevel, __pyx_mstate->__pyx_n_u_smooth};
    __pyx_mstate_global->__pyx_codeobj_tab[1065] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getFASSmoother, __pyx_mstate->__pyx_kp_b_iso88591_HA_uAQ_4q_a_gXQfA_a_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1065])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 642};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_clevel, __pyx_mstate->__pyx_n_u_smooth};
    __pyx_mstate_global->__pyx_codeobj_tab[1066] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getFASSmootherDown, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_4q_a_Qd_a_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1066])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 659};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_clevel, __pyx_mstate->__pyx_n_u_smooth};
    __pyx_mstate_global->__pyx_codeobj_tab[1067] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getFASSmootherUp, __pyx_mstate->__pyx_kp_b_iso88591_ha_uAQ_4q_a_1D_xq_a_a_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1067])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 678};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_snes};
    __pyx_mstate_global->__pyx_codeobj_tab[1068] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getNPC, __pyx_mstate->__pyx_kp_b_iso88591_Q_az_gQd_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1068])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 693};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1069] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_hasNPC, __pyx_mstate->__pyx_kp_b_iso88591_a_az_gQa_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1069])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 707};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_snes};
    __pyx_mstate_global->__pyx_codeobj_tab[1070] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setNPC, __pyx_mstate->__pyx_kp_b_iso88591_1_az_gT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1070])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 719};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_side};
    __pyx_mstate_global->__pyx_codeobj_tab[1071] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setNPCSide, __pyx_mstate->__pyx_kp_b_iso88591_1_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1071])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 731};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_side};
    __pyx_mstate_global->__pyx_codeobj_tab[1072] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getNPCSide, __pyx_mstate->__pyx_kp_b_iso88591_A_a_Qd_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1072])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 747};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_precheck, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_snesls, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1073] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setLineSearchPreCheck, __pyx_mstate->__pyx_kp_b_iso88591_a_Q_Ya_a_WAQ_9G1_vS_ha_vS_ha_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1073])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 781};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_initialguess, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1074] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setInitialGuess, __pyx_mstate->__pyx_kp_b_iso88591_A_7q_7y_q_vS_ha_vS_ha_V1_a_Qd_9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1074])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 812};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1075] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getInitialGuess, __pyx_mstate->__pyx_kp_b_iso88591_t9AQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1075])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 824};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_fvec, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1076] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setFunction, __pyx_mstate->__pyx_kp_b_iso88591_A_31_39A_1_2WF_9G1_vS_ha_vS_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1076])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 859};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fun, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_ctx, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1077] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getFunction, __pyx_mstate->__pyx_kp_b_iso88591_Q_S_a_a_at7_1F_5_a_1A_t9AQ_9G1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1077])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 889};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_update, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1078] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setUpdate, __pyx_mstate->__pyx_kp_b_iso88591_1_1_7_vS_ha_vS_ha_xvQ_WA_WA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1078])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 920};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1079] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getUpdate, __pyx_mstate->__pyx_kp_b_iso88591_1_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1079])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 932};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_jacobian, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_Jmat, __pyx_mstate->__pyx_n_u_Pmat, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1080] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setJacobian, __pyx_mstate->__pyx_kp_b_iso88591_A_a_3_XXaab_1_2WF_1_2WF_9G1_vS_h, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1080])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 971};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_jacobian};
    __pyx_mstate_global->__pyx_codeobj_tab[1081] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getJacobian, __pyx_mstate->__pyx_kp_b_iso88591_Q_S_S_a_at7_1F_1F_a_1A_a_1A_t9A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1081])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 998};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_objective, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1082] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setObjective, __pyx_mstate->__pyx_kp_b_iso88591_A_4A_4IQ_WA_vS_ha_vS_ha_1_1D_wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1082])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1029};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_objective};
    __pyx_mstate_global->__pyx_codeobj_tab[1083] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getObjective, __pyx_mstate->__pyx_kp_b_iso88591_a_a_q_G6_IQa_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1083])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1043};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_f};
    __pyx_mstate_global->__pyx_codeobj_tab[1084] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_computeFunction, __pyx_mstate->__pyx_kp_b_iso88591_q_a_4wavQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1084])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1062};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_jmat, __pyx_mstate->__pyx_n_u_pmat};
    __pyx_mstate_global->__pyx_codeobj_tab[1085] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_computeJacobian, __pyx_mstate->__pyx_kp_b_iso88591_2_1_Qm1A_2WF_a_4wavV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1085])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1085};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_o};
    __pyx_mstate_global->__pyx_codeobj_tab[1086] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_computeObjective, __pyx_mstate->__pyx_kp_b_iso88591_1_a_1D_q_aq_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1086])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1104};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ngs, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1087] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setNGS, __pyx_mstate->__pyx_kp_b_iso88591_A_a_iq_4wa_vS_ha_vS_ha_uF_Q_Qd_7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1087])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1135};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ngs};
    __pyx_mstate_global->__pyx_codeobj_tab[1088] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getNGS, __pyx_mstate->__pyx_kp_b_iso88591_az_gV1_iq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1088])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1149};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_bvec};
    __pyx_mstate_global->__pyx_codeobj_tab[1089] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_computeNGS, __pyx_mstate->__pyx_kp_b_iso88591_iq_Q_2WF_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1089])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1172};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rtol, __pyx_mstate->__pyx_n_u_atol, __pyx_mstate->__pyx_n_u_stol, __pyx_mstate->__pyx_n_u_max_it, __pyx_mstate->__pyx_n_u_crtol, __pyx_mstate->__pyx_n_u_catol, __pyx_mstate->__pyx_n_u_cstol, __pyx_mstate->__pyx_n_u_cmaxit};
    __pyx_mstate_global->__pyx_codeobj_tab[1090] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setTolerances, __pyx_mstate->__pyx_kp_b_iso88591_LXggu_v_C_C_L_L_M_q_7_y_aq_7_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1090])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1211};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_crtol, __pyx_mstate->__pyx_n_u_catol, __pyx_mstate->__pyx_n_u_cstol, __pyx_mstate->__pyx_n_u_cmaxit};
    __pyx_mstate_global->__pyx_codeobj_tab[1091] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getTolerances, __pyx_mstate->__pyx_kp_b_iso88591_q_Yiq_Q_a_WAWAWAQ_axvQhfAXU_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1091])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1238};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dtol};
    __pyx_mstate_global->__pyx_codeobj_tab[1092] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setDivergenceTolerance, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_gV1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1092])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1255};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cdtol};
    __pyx_mstate_global->__pyx_codeobj_tab[1093] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getDivergenceTolerance, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_gQa_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1093])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1269};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_normsched};
    __pyx_mstate_global->__pyx_codeobj_tab[1094] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setNormSchedule, __pyx_mstate->__pyx_kp_b_iso88591_a_4wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1094])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1281};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_normsched};
    __pyx_mstate_global->__pyx_codeobj_tab[1095] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getNormSchedule, __pyx_mstate->__pyx_kp_b_iso88591_0q_a_4waq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1095])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1295};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_converged, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1096] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setConvergenceTest, __pyx_mstate->__pyx_kp_b_iso88591_A_1_S_1_g5H_a_s_s_Cq_1_g5K6QR_8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1096])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1330};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1097] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getConvergenceTest, __pyx_mstate->__pyx_kp_b_iso88591_A_t9AQ_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1097])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1342};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_its, __pyx_mstate->__pyx_n_u_xnorm, __pyx_mstate->__pyx_n_u_ynorm, __pyx_mstate->__pyx_n_u_fnorm, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_rval1, __pyx_mstate->__pyx_n_u_rval2, __pyx_mstate->__pyx_n_u_rval3, __pyx_mstate->__pyx_n_u_reason};
    __pyx_mstate_global->__pyx_codeobj_tab[1098] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_callConvergenceTest, __pyx_mstate->__pyx_kp_b_iso88591_zYZ_uAQ_vQa_vQa_vQa_q_a_at7_gWA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1098])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1372};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_its, __pyx_mstate->__pyx_n_u_xnorm, __pyx_mstate->__pyx_n_u_ynorm, __pyx_mstate->__pyx_n_u_fnorm, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_rval1, __pyx_mstate->__pyx_n_u_rval2, __pyx_mstate->__pyx_n_u_rval3};
    __pyx_mstate_global->__pyx_codeobj_tab[1099] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_converged, __pyx_mstate->__pyx_kp_b_iso88591_Zq_uAQ_vQa_vQa_vQa_a_AT_gWA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1099])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1399};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_length, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_n_u_rdata, __pyx_mstate->__pyx_n_u_idata, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_rhist, __pyx_mstate->__pyx_n_u_ihist};
    __pyx_mstate_global->__pyx_codeobj_tab[1100] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setConvergenceHistory, __pyx_mstate->__pyx_kp_b_iso88591_z_q_a_WCq_G6_Qa_5_WA_7_HAWAWF_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1100])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1423};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rdata, __pyx_mstate->__pyx_n_u_idata, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_rhist, __pyx_mstate->__pyx_n_u_ihist};
    __pyx_mstate_global->__pyx_codeobj_tab[1101] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getConvergenceHistory, __pyx_mstate->__pyx_kp_b_iso88591_q_q_a_WAWAWAQ_G1F_G1F_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1101])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1441};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_norm, __pyx_mstate->__pyx_n_u_linear_its, __pyx_mstate->__pyx_n_u_rval, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1102] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_logConvergenceHistory, __pyx_mstate->__pyx_kp_b_iso88591_V6_fAQ_e1A_a_WF, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1102])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1447};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1103] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setResetCounters, __pyx_mstate->__pyx_kp_b_iso88591_gYa_a_a_1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1103])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1462};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_monitor, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_monitorlist, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1104] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setMonitor, __pyx_mstate->__pyx_kp_b_iso88591_A_2_2_1_83fA_iq_s_g_6_6_F_6_F_9F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1104])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1495};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1105] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getMonitor, __pyx_mstate->__pyx_kp_b_iso88591_A_t9AQ_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1105])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1507};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1106] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_monitorCancel, __pyx_mstate->__pyx_kp_b_iso88591_q_a_Q_IQoQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1106])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1522};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_its, __pyx_mstate->__pyx_n_u_rnorm, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1107] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_monitor, __pyx_mstate->__pyx_kp_b_iso88591_Q_e1A_fAQ_a_4wfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1107])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1545};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_max_funcs, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1108] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setMaxFunctionEvaluations, __pyx_mstate->__pyx_kp_b_iso88591_381_1_1_U_1_a_WCs_S, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1108])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1560};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1109] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getMaxFunctionEvaluations, __pyx_mstate->__pyx_kp_b_iso88591_1_A_A_Q_a_WCs_S_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1109])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1576};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1110] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getFunctionEvaluations, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_gQa_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1110])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1590};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_max_fails, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1111] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setMaxStepFailures, __pyx_mstate->__pyx_kp_b_iso88591_HA_U_1_a_at7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1111])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1603};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1112] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getMaxStepFailures, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_a_at7_1_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1112])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1617};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1113] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getStepFailures, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_1D_q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1113])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1631};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_max_fails, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1114] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setMaxKSPFailures, __pyx_mstate->__pyx_kp_b_iso88591_81_U_1_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1114])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1644};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1115] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getMaxKSPFailures, __pyx_mstate->__pyx_kp_b_iso88591_1_Q_a_AT_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1115])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1658};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1116] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getKSPFailures, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_gQa_uAQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1116])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1681};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1117] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_ay_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1117])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1693};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1118] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setUpMatrices, __pyx_mstate->__pyx_kp_b_iso88591_q_a_Q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1118])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1707};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1119] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_kp_b_iso88591_q_ay_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1119])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1719};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_b, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_rhs, __pyx_mstate->__pyx_n_u_sol};
    __pyx_mstate_global->__pyx_codeobj_tab[1120] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_solve, __pyx_mstate->__pyx_kp_b_iso88591_N_1_A_A_2WF_2WF_ay_WE, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1120])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1742};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_reason, __pyx_mstate->__pyx_n_u_eval};
    __pyx_mstate_global->__pyx_codeobj_tab[1121] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setConvergedReason, __pyx_mstate->__pyx_kp_b_iso88591_Q_Q_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1121])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1755};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_reason};
    __pyx_mstate_global->__pyx_codeobj_tab[1122] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getConvergedReason, __pyx_mstate->__pyx_kp_b_iso88591_A_0q_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1122])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1769};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_ernc};
    __pyx_mstate_global->__pyx_codeobj_tab[1123] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setErrorIfNotConverged, __pyx_mstate->__pyx_kp_b_iso88591_9A_fAQ_a_gQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1123])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1782};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1124] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getErrorIfNotConverged, __pyx_mstate->__pyx_kp_b_iso88591_a_a_gQa_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1124])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1796};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_its, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1125] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setIterationNumber, __pyx_mstate->__pyx_kp_b_iso88591_ha_U_1_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1125])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1811};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1126] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getIterationNumber, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_a_Qd_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1126])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1825};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_force, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1127] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setForceIteration, __pyx_mstate->__pyx_kp_b_iso88591_y_fAQ_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1127])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1838};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_norm, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1128] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setFunctionNorm, __pyx_mstate->__pyx_kp_b_iso88591_Ja_fAQ_a_4wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1128])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1853};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1129] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getFunctionNorm, __pyx_mstate->__pyx_kp_b_iso88591_a_a_4waq_vQa_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1129])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1867};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1130] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getLinearSolveIterations, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_1D_q_uAQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1130])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1881};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1131] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getRhs, __pyx_mstate->__pyx_kp_b_iso88591_s_az_gQc_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1131])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1896};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1132] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getSolution, __pyx_mstate->__pyx_kp_b_iso88591_Q_s_a_at7_3a_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1132])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1911};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1133] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setSolution, __pyx_mstate->__pyx_kp_b_iso88591_a_a_at7_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1133])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1923};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1134] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getSolutionUpdate, __pyx_mstate->__pyx_kp_b_iso88591_1_s_a_AT_A_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1134])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1940};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ksp};
    __pyx_mstate_global->__pyx_codeobj_tab[1135] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setKSP, __pyx_mstate->__pyx_kp_b_iso88591_az_gS, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1135])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1952};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ksp};
    __pyx_mstate_global->__pyx_codeobj_tab[1136] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getKSP, __pyx_mstate->__pyx_kp_b_iso88591_s_az_gQc_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1136])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS), 1967};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_targs, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1137] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setUseEW, __pyx_mstate->__pyx_kp_b_iso88591_W_H_a_a_at7_6_G4_2Ya, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1137])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1990};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1138] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getUseEW, __pyx_mstate->__pyx_kp_b_iso88591_a_a_at7_1_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1138])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {8, 0, 0, 15, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2004};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_version, __pyx_mstate->__pyx_n_u_rtol_0, __pyx_mstate->__pyx_n_u_rtol_max, __pyx_mstate->__pyx_n_u_gamma, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_alpha2, __pyx_mstate->__pyx_n_u_threshold, __pyx_mstate->__pyx_n_u_cversion, __pyx_mstate->__pyx_n_u_crtol_0, __pyx_mstate->__pyx_n_u_crtol_max, __pyx_mstate->__pyx_n_u_cgamma, __pyx_mstate->__pyx_n_u_calpha, __pyx_mstate->__pyx_n_u_calpha2, __pyx_mstate->__pyx_n_u_cthreshold};
    __pyx_mstate_global->__pyx_codeobj_tab[1139] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setParamsEW, __pyx_mstate->__pyx_kp_b_iso88591_A_1_Q_1_iq6_A_A_A_A_A_A_A_WF_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1139])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2056};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_version, __pyx_mstate->__pyx_n_u_rtol_0, __pyx_mstate->__pyx_n_u_rtol_max, __pyx_mstate->__pyx_n_u_gamma, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_alpha2, __pyx_mstate->__pyx_n_u_threshold};
    __pyx_mstate_global->__pyx_codeobj_tab[1140] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getParamsEW, __pyx_mstate->__pyx_kp_b_iso88591_Q_q_l_Yj_a_Q_q_1_WAWAXQa_e1A_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1140])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2081};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1141] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setUseKSP, __pyx_mstate->__pyx_kp_b_iso88591_Ya_a_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1141])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2094};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1142] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getUseKSP, __pyx_mstate->__pyx_kp_b_iso88591_1_a_a_AT_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1142])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2110};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1143] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setUseMF, __pyx_mstate->__pyx_kp_b_iso88591_IQ_a_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1143])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2123};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1144] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getUseMF, __pyx_mstate->__pyx_kp_b_iso88591_a_a_Qd_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1144])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2137};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1145] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setUseFD, __pyx_mstate->__pyx_kp_b_iso88591_IQ_a_a_1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1145])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2150};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1146] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getUseFD, __pyx_mstate->__pyx_kp_b_iso88591_a_a_1D_q_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1146])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2166};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_xl, __pyx_mstate->__pyx_n_u_xu};
    __pyx_mstate_global->__pyx_codeobj_tab[1147] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setVariableBounds, __pyx_mstate->__pyx_kp_b_iso88591_31_a_at7_F_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1147])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2178};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_xl, __pyx_mstate->__pyx_n_u_xu};
    __pyx_mstate_global->__pyx_codeobj_tab[1148] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getVariableBounds, __pyx_mstate->__pyx_kp_b_iso88591_1_c_Q_a_at7_2V1Ba_a_2XV1Kq_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1148])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2193};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_inact};
    __pyx_mstate_global->__pyx_codeobj_tab[1149] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getVIInactiveSet, __pyx_mstate->__pyx_kp_b_iso88591_a_1D_q_Q_a_5_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1149])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2210};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newsnes};
    __pyx_mstate_global->__pyx_codeobj_tab[1150] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_createPython, __pyx_mstate->__pyx_kp_b_iso88591_F_nIQ_havQ_az_az_hd_a_4wa_a_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1150])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2235};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1151] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setPythonContext, __pyx_mstate->__pyx_kp_b_iso88591_a_1D_wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1151])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2247};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1152] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getPythonContext, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_1D_q_83fG1_Ya, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1152])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2262};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_py_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1153] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setPythonType, __pyx_mstate->__pyx_kp_b_iso88591_XQ_1IQa_a_WA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1153])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2277};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1154] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getPythonType, __pyx_mstate->__pyx_kp_b_iso88591_q_a_WAQ_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1154])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2294};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_cn, __pyx_mstate->__pyx_n_u_snes};
    __pyx_mstate_global->__pyx_codeobj_tab[1155] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getCompositeSNES, __pyx_mstate->__pyx_kp_b_iso88591_Q_U_1_a_1D_t1D_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1155])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2311};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cn};
    __pyx_mstate_global->__pyx_codeobj_tab[1156] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getCompositeNumber, __pyx_mstate->__pyx_kp_b_iso88591_A_1_a_Qd_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1156])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2327};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_cn, __pyx_mstate->__pyx_n_u_snes};
    __pyx_mstate_global->__pyx_codeobj_tab[1157] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getNASMSNES, __pyx_mstate->__pyx_kp_b_iso88591_XQ_5_Q_a_at7_at1_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1157])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2343};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cn};
    __pyx_mstate_global->__pyx_codeobj_tab[1158] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getNASMNumber, __pyx_mstate->__pyx_kp_b_iso88591_q_1_a_WAQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1158])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2359};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sec};
    __pyx_mstate_global->__pyx_codeobj_tab[1159] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setPatchCellNumbering, __pyx_mstate->__pyx_kp_b_iso88591_4A_a_WCq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1159])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 20, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2363};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dms, __pyx_mstate->__pyx_n_u_bs_2, __pyx_mstate->__pyx_n_u_cellNodeMaps, __pyx_mstate->__pyx_n_u_subspaceOffsets, __pyx_mstate->__pyx_n_u_ghostBcNodes, __pyx_mstate->__pyx_n_u_globalBcNodes, __pyx_mstate->__pyx_n_u_numSubSpaces, __pyx_mstate->__pyx_n_u_numGhostBcs, __pyx_mstate->__pyx_n_u_numGlobalBcs, __pyx_mstate->__pyx_n_u_nodesPerCell, __pyx_mstate->__pyx_n_u_ccellNodeMaps, __pyx_mstate->__pyx_n_u_cdms, __pyx_mstate->__pyx_n_u_cbs, __pyx_mstate->__pyx_n_u_csubspaceOffsets, __pyx_mstate->__pyx_n_u_cghostBcNodes, __pyx_mstate->__pyx_n_u_cglobalBcNodes, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u__29, __pyx_mstate->__pyx_n_u_nodes};
    __pyx_mstate_global->__pyx_codeobj_tab[1160] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setPatchDiscretisationInfo, __pyx_mstate->__pyx_kp_b_iso88591_A_67_Q_6a_a_a_Q_Q_q_XQd_xq_a_AQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1160])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2404};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_operator, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1161] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setPatchComputeOperator, __pyx_mstate->__pyx_kp_b_iso88591_5_5_F_6_F_V1_IQ_4A_a_4w6OwVW, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1161])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2412};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1162] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setPatchComputeFunction, __pyx_mstate->__pyx_kp_b_iso88591_5_5_F_6_F_V1_IQ_4A_a_4w6OwVW, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1162])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2420};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_typ, __pyx_mstate->__pyx_n_u_operator, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1163] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setPatchConstructType, __pyx_mstate->__pyx_kp_b_iso88591_2_RS_5_F_6_F_4t2_3FgTQZZ_AQ_9G1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1163])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2619};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_linesearch};
    __pyx_mstate_global->__pyx_codeobj_tab[1164] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getLineSearch, __pyx_mstate->__pyx_kp_b_iso88591_q_q_a_WAZq_a_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1164])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2634};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_linesearch};
    __pyx_mstate_global->__pyx_codeobj_tab[1165] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setLineSearch, __pyx_mstate->__pyx_kp_b_iso88591_a_WJa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1165])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2656};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1166] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setNewtonALFunction, __pyx_mstate->__pyx_kp_b_iso88591_A_1_9A_9G1_vS_ha_vS_ha_z_q_31_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1166])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2687};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_load};
    __pyx_mstate_global->__pyx_codeobj_tab[1167] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getNewtonALLoadParameter, __pyx_mstate->__pyx_kp_b_iso88591_a_a_1D_q_vQa_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1167])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2702};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_corrtype};
    __pyx_mstate_global->__pyx_codeobj_tab[1168] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setNewtonALCorrectionType, __pyx_mstate->__pyx_kp_b_iso88591_22MQ_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1168])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2751};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newls};
    __pyx_mstate_global->__pyx_codeobj_tab[1169] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_a_1G1A_az_hd_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1169])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2772};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1170] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1170])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2784};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_cviewer};
    __pyx_mstate_global->__pyx_codeobj_tab[1171] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_9A_1_7_z_q_a_iq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1171])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2803};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[1172] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_a_AT_1_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1172])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2817};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ls_type, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[1173] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_a_1IQa_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1173])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2831};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rtol, __pyx_mstate->__pyx_n_u_atol, __pyx_mstate->__pyx_n_u_minstep, __pyx_mstate->__pyx_n_u_ltol, __pyx_mstate->__pyx_n_u_maxstep, __pyx_mstate->__pyx_n_u_max_its};
    __pyx_mstate_global->__pyx_codeobj_tab[1174] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getTolerances, __pyx_mstate->__pyx_kp_b_iso88591_q0_HKx_a_a_4y_9AVSTTZZ_aabbc_az, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1174])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2860};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_minstep, __pyx_mstate->__pyx_n_u_maxstep, __pyx_mstate->__pyx_n_u_rtol, __pyx_mstate->__pyx_n_u_atol, __pyx_mstate->__pyx_n_u_ltol, __pyx_mstate->__pyx_n_u_max_its, __pyx_mstate->__pyx_n_u_cminstep, __pyx_mstate->__pyx_n_u_cmaxstep, __pyx_mstate->__pyx_n_u_crtol, __pyx_mstate->__pyx_n_u_catol, __pyx_mstate->__pyx_n_u_cltol, __pyx_mstate->__pyx_n_u_cmaxits};
    __pyx_mstate_global->__pyx_codeobj_tab[1175] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setTolerances, __pyx_mstate->__pyx_kp_b_iso88591_O_R_mmy_z_I_I_U_U_d_d_s_s_I_I, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1175])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2898};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_order};
    __pyx_mstate_global->__pyx_codeobj_tab[1176] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_getOrder, __pyx_mstate->__pyx_kp_b_iso88591_a_a_Qd_1A_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1176])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2912};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_order, __pyx_mstate->__pyx_n_u_iorder};
    __pyx_mstate_global->__pyx_codeobj_tab[1177] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_setOrder, __pyx_mstate->__pyx_kp_b_iso88591_ha_uAQ_a_Qd_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1177])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2925};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1178] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_SNES_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_AQd_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1178])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 167};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_cviewer};
    __pyx_mstate_global->__pyx_codeobj_tab[1179] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_1_7_z_q_avQd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1179])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 190};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer};
    __pyx_mstate_global->__pyx_codeobj_tab[1180] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_load, __pyx_mstate->__pyx_kp_b_iso88591_Q_avQd_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1180])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 207};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1181] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_ay_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1181])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 220};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newts};
    __pyx_mstate_global->__pyx_codeobj_tab[1182] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_Q_axq_q_az_hd_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1182])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 244};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ts};
    __pyx_mstate_global->__pyx_codeobj_tab[1183] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_clone, __pyx_mstate->__pyx_kp_b_iso88591_q_Rq_awat5_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1183])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 258};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ts_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1184] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_a_1IQa_ay_U_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1184])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 281};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ts_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1185] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setRKType, __pyx_mstate->__pyx_kp_b_iso88591_2_1IQa_a_4uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1185])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 304};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ts_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1186] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setARKIMEXType, __pyx_mstate->__pyx_kp_b_iso88591_A_q_1IQa_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1186])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 327};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1187] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setARKIMEXFullyImplicit, __pyx_mstate->__pyx_kp_b_iso88591_IQ_fAQ_a_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1187])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 345};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1188] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setARKIMEXFastSlowSplit, __pyx_mstate->__pyx_kp_b_iso88591_IQ_fAQ_a_U_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1188])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 362};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1189] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_ay_U_1_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1189])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 376};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1190] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getRKType, __pyx_mstate->__pyx_kp_b_iso88591_1_a_4uAQ_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1190])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 390};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1191] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getARKIMEXType, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_E_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1191])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 404};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ts_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1192] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setDIRKType, __pyx_mstate->__pyx_kp_b_iso88591_6a_A_1IQa_a_AT_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1192])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 427};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1193] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getDIRKType, __pyx_mstate->__pyx_kp_b_iso88591_Q_A_a_AT_aq_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1193])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 441};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ptype};
    __pyx_mstate_global->__pyx_codeobj_tab[1194] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setProblemType, __pyx_mstate->__pyx_kp_b_iso88591_4A_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1194])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 458};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ptype};
    __pyx_mstate_global->__pyx_codeobj_tab[1195] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getProblemType, __pyx_mstate->__pyx_kp_b_iso88591_a_q_E_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1195])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 472};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_eqtype};
    __pyx_mstate_global->__pyx_codeobj_tab[1196] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setEquationType, __pyx_mstate->__pyx_kp_b_iso88591_7q_a_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1196])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 489};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_eqtype};
    __pyx_mstate_global->__pyx_codeobj_tab[1197] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getEquationType, __pyx_mstate->__pyx_kp_b_iso88591_a_U_1_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1197])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 503};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1198] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_q_81A_a_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1198])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 526};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1199] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_a_e1A_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1199])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 540};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1200] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_appendOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_81A_a_AT_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1200])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 563};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1201] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_q_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1201])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 577};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_appctx};
    __pyx_mstate_global->__pyx_codeobj_tab[1202] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setAppCtx, __pyx_mstate->__pyx_kp_b_iso88591_IQnA_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1202])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 590};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1203] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getAppCtx, __pyx_mstate->__pyx_kp_b_iso88591_1_t9AQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1203])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 596};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_fvec, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1204] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setRHSFunction, __pyx_mstate->__pyx_kp_b_iso88591_A_1_2WF_9G1_vS_ha_vS_ha_z_q_Q_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1204])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 633};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_jacobian, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_Jmat, __pyx_mstate->__pyx_n_u_Pmat, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1205] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setRHSJacobian, __pyx_mstate->__pyx_kp_b_iso88591_A_1_2WF_1_2WF_9G1_vS_ha_vS_ha_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1205])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 675};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_time};
    __pyx_mstate_global->__pyx_codeobj_tab[1206] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_computeRHSFunction, __pyx_mstate->__pyx_kp_b_iso88591_A_fAQ_a_1D_V1F_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1206])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 697};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_time};
    __pyx_mstate_global->__pyx_codeobj_tab[1207] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_computeRHSFunctionLinear, __pyx_mstate->__pyx_kp_b_iso88591_B_fAQ_a_e6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1207])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 719};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_time, __pyx_mstate->__pyx_n_u_jmat, __pyx_mstate->__pyx_n_u_pmat};
    __pyx_mstate_global->__pyx_codeobj_tab[1208] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_computeRHSJacobian, __pyx_mstate->__pyx_kp_b_iso88591_y_fAQ_Qm1A_2WF_a_1D_V1F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1208])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 745};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_time, __pyx_mstate->__pyx_n_u_jmat, __pyx_mstate->__pyx_n_u_pmat};
    __pyx_mstate_global->__pyx_codeobj_tab[1209] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_computeRHSJacobianConstant, __pyx_mstate->__pyx_kp_b_iso88591_GyPQ_fAQ_Qm1A_2WF_a_1D_V1F_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1209])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 771};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_function};
    __pyx_mstate_global->__pyx_codeobj_tab[1210] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getRHSFunction, __pyx_mstate->__pyx_kp_b_iso88591_S_a_q_E_6_q_a_1A_t9AQ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1210])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 787};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_jacobian};
    __pyx_mstate_global->__pyx_codeobj_tab[1211] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getRHSJacobian, __pyx_mstate->__pyx_kp_b_iso88591_S_1_a_q_E_6_6_q_a_1HF_aq_t9AQ_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1211])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 805};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_fvec, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1212] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setIFunction, __pyx_mstate->__pyx_kp_b_iso88591_A_1_2WF_9G1_vS_ha_vS_ha_z_q_1_e6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1212])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 842};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_jacobian, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_Jmat, __pyx_mstate->__pyx_n_u_Pmat, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1213] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setIJacobian, __pyx_mstate->__pyx_kp_b_iso88591_A_4_1_2WF_1_2WF_9G1_vS_ha_vS_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1213])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 887};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_jacobian, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_Jmat, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1214] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setIJacobianP, __pyx_mstate->__pyx_kp_b_iso88591_A_2_1_2WF_9G1_vS_ha_vS_ha_z_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1214])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 928};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_xdot, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_imex, __pyx_mstate->__pyx_n_u_rval, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1215] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_computeIFunction, __pyx_mstate->__pyx_kp_b_iso88591_A_Zq_fAQ_a_a_e6_A_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1215])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {8, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 958};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_xdot, __pyx_mstate->__pyx_n_u_a, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_imex, __pyx_mstate->__pyx_n_u_rval1, __pyx_mstate->__pyx_n_u_rval2, __pyx_mstate->__pyx_n_u_bval, __pyx_mstate->__pyx_n_u_jmat, __pyx_mstate->__pyx_n_u_pmat};
    __pyx_mstate_global->__pyx_codeobj_tab[1216] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_computeIJacobian, __pyx_mstate->__pyx_kp_b_iso88591_A_7q_4G_Q_vQa_vQa_q_Qm1A_2WF_a_e, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1216])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 998};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_xdot, __pyx_mstate->__pyx_n_u_a, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_imex, __pyx_mstate->__pyx_n_u_rval1, __pyx_mstate->__pyx_n_u_rval2, __pyx_mstate->__pyx_n_u_bval, __pyx_mstate->__pyx_n_u_jmat};
    __pyx_mstate_global->__pyx_codeobj_tab[1217] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_computeIJacobianP, __pyx_mstate->__pyx_kp_b_iso88591_A_8_j_2_vQa_vQa_vQa_Qa_a_4uG1F_f, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1217])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1032};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_function};
    __pyx_mstate_global->__pyx_codeobj_tab[1218] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getIFunction, __pyx_mstate->__pyx_kp_b_iso88591_a_S_a_Qd_q_vQ_a_1A_t9AQ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1218])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1048};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_jacobian};
    __pyx_mstate_global->__pyx_codeobj_tab[1219] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getIJacobian, __pyx_mstate->__pyx_kp_b_iso88591_a_S_1_a_Qd_q_q_vQ_a_1HF_aq_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1219])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1064};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_fvec, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1220] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setI2Function, __pyx_mstate->__pyx_kp_b_iso88591_A_1_2WF_9G1_vS_ha_vS_ha_z_q_A_4u, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1220])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1101};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_jacobian, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_Jmat, __pyx_mstate->__pyx_n_u_Pmat, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1221] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setI2Jacobian, __pyx_mstate->__pyx_kp_b_iso88591_A_q_1_2WF_1_2WF_9G1_vS_ha_vS_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1221])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1143};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_xdot, __pyx_mstate->__pyx_n_u_xdotdot, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1222] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_computeI2Function, __pyx_mstate->__pyx_kp_b_iso88591_RRS_fAQ_a_4uF_6_V7_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1222])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {9, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1170};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_xdot, __pyx_mstate->__pyx_n_u_xdotdot, __pyx_mstate->__pyx_n_u_v, __pyx_mstate->__pyx_n_u_a, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_rval1, __pyx_mstate->__pyx_n_u_rval2, __pyx_mstate->__pyx_n_u_rval3, __pyx_mstate->__pyx_n_u_jmat, __pyx_mstate->__pyx_n_u_pmat};
    __pyx_mstate_global->__pyx_codeobj_tab[1223] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_computeI2Jacobian, __pyx_mstate->__pyx_kp_b_iso88591_A_q_vQa_vQa_vQa_Qm1A_2WF_a_4uG1F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1223])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1219};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_function};
    __pyx_mstate_global->__pyx_codeobj_tab[1224] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getI2Function, __pyx_mstate->__pyx_kp_b_iso88591_q_S_a_at5_a_a_1A_t9AQ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1224])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1235};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_jacobian};
    __pyx_mstate_global->__pyx_codeobj_tab[1225] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getI2Jacobian, __pyx_mstate->__pyx_kp_b_iso88591_q_S_1_a_at5_a_a_1HF_aq_t9AQ_3a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1225])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1252};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_splitname, __pyx_mstate->__pyx_n_u_iss, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1226] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setRHSSplitIS, __pyx_mstate->__pyx_kp_b_iso88591_7q_IQk_a_at5_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1226])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1273};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_splitname, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_aname, __pyx_mstate->__pyx_n_u_rvec, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1227] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setRHSSplitRHSFunction, __pyx_mstate->__pyx_kp_b_iso88591_A_1_IQk_q_1_2WF_9G1_vS_ha_vS_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1227])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1317};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_splitname, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_r, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_aname, __pyx_mstate->__pyx_n_u_rvec, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1228] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setRHSSplitIFunction, __pyx_mstate->__pyx_kp_b_iso88591_A_1_IQk_1_2WF_9G1_vS_ha_vS_ha_z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1228])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1361};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_splitname, __pyx_mstate->__pyx_n_u_jacobian, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_aname, __pyx_mstate->__pyx_n_u_Jmat, __pyx_mstate->__pyx_n_u_Pmat, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1229] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setRHSSplitIJacobian, __pyx_mstate->__pyx_kp_b_iso88591_A_2_1_IQk_1_2WF_1_2WF_9G1_vS_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1229])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1412};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_u};
    __pyx_mstate_global->__pyx_codeobj_tab[1230] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setSolution, __pyx_mstate->__pyx_kp_b_iso88591_A_a_AT_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1230])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1429};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_u};
    __pyx_mstate_global->__pyx_codeobj_tab[1231] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getSolution, __pyx_mstate->__pyx_kp_b_iso88591_Q_S_a_AT_aq_a_1A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1231])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1448};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_u, __pyx_mstate->__pyx_n_u_v};
    __pyx_mstate_global->__pyx_codeobj_tab[1232] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setSolution2, __pyx_mstate->__pyx_kp_b_iso88591_A_a_Qd_q_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1232])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1467};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_u, __pyx_mstate->__pyx_n_u_v};
    __pyx_mstate_global->__pyx_codeobj_tab[1233] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getSolution2, __pyx_mstate->__pyx_kp_b_iso88591_a_S_S_a_Qd_q_q_a_1A_a_1A_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1233])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1490};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tspan, __pyx_mstate->__pyx_n_u_nt, __pyx_mstate->__pyx_n_u_rtspan, __pyx_mstate->__pyx_n_u_unused};
    __pyx_mstate_global->__pyx_codeobj_tab[1234] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setEvaluationTimes, __pyx_mstate->__pyx_kp_b_iso88591_A8_A_hawat1A_a_1D_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1234])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1523};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rtspan, __pyx_mstate->__pyx_n_u_nt, __pyx_mstate->__pyx_n_u_tspan};
    __pyx_mstate_global->__pyx_codeobj_tab[1235] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getEvaluationTimes, __pyx_mstate->__pyx_kp_b_iso88591_A_q_Q_a_1D_Qd_1_G1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1235])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1539};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nt, __pyx_mstate->__pyx_n_u_sols, __pyx_mstate->__pyx_n_u_rtspan, __pyx_mstate->__pyx_n_u_sollist, __pyx_mstate->__pyx_n_u_tspan, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[1236] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getEvaluationSolutions, __pyx_mstate->__pyx_kp_b_iso88591_1_a_q_a_q_E_axq_a_5_1_awat1D_G9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1236])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1561};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tspan, __pyx_mstate->__pyx_n_u_nt, __pyx_mstate->__pyx_n_u_rtspan, __pyx_mstate->__pyx_n_u_unused};
    __pyx_mstate_global->__pyx_codeobj_tab[1237] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setTimeSpan, __pyx_mstate->__pyx_kp_b_iso88591_5Q8_A_hawat1A_a_AT_d, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1237])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1596};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nt, __pyx_mstate->__pyx_n_u_sols, __pyx_mstate->__pyx_n_u_sollist, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[1238] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getTimeSpanSolutions, __pyx_mstate->__pyx_kp_b_iso88591_a_1_a_a_q_E_fAQ_a_5_1_awat1D_G9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1238])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1616};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_snes};
    __pyx_mstate_global->__pyx_codeobj_tab[1239] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getSNES, __pyx_mstate->__pyx_kp_b_iso88591_Q_ay_U_4q_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1239])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1631};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ksp};
    __pyx_mstate_global->__pyx_codeobj_tab[1240] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getKSP, __pyx_mstate->__pyx_kp_b_iso88591_s_axq_E_Q_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1240])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1648};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1241] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getDM, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_awat5_Zq_a_a_2Q_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1241])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1668};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1242] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setDM, __pyx_mstate->__pyx_kp_b_iso88591_a_awat5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1242])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1687};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1243] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setTime, __pyx_mstate->__pyx_kp_b_iso88591_1_fAQ_ay_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1243])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1705};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1244] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getTime, __pyx_mstate->__pyx_kp_b_iso88591_a_ay_U_1_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1244])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1723};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1245] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getPrevTime, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_a_AT_aq_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1245])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1737};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1246] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getSolveTime, __pyx_mstate->__pyx_kp_b_iso88591_a_a_a_Qd_q_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1246])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1754};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_time_step, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1247] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setTimeStep, __pyx_mstate->__pyx_kp_b_iso88591_Zq_fAQ_a_AT_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1247])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1772};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tstep};
    __pyx_mstate_global->__pyx_codeobj_tab[1248] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getTimeStep, __pyx_mstate->__pyx_kp_b_iso88591_Q_q_a_AT_aq_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1248])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1786};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_step_number, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1249] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setStepNumber, __pyx_mstate->__pyx_kp_b_iso88591_0_U_1_a_at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1249])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1813};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1250] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getStepNumber, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_a_at5_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1250])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1827};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_max_time, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1251] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setMaxTime, __pyx_mstate->__pyx_kp_b_iso88591_Q_fAQ_a_1D_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1251])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1849};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1252] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getMaxTime, __pyx_mstate->__pyx_kp_b_iso88591_A_a_a_1D_Qa_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1252])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1865};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_max_steps, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1253] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setMaxSteps, __pyx_mstate->__pyx_kp_b_iso88591_XQ_e1A_a_AT_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1253])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1885};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1254] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getMaxSteps, __pyx_mstate->__pyx_kp_b_iso88591_Q_Q_a_AT_aq_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1254])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1899};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[1255] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getSNESIterations, __pyx_mstate->__pyx_kp_b_iso88591_1_a_4uAQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1255])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1916};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[1256] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getKSPIterations, __pyx_mstate->__pyx_kp_b_iso88591_a_e1A_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1256])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1933};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_rej};
    __pyx_mstate_global->__pyx_codeobj_tab[1257] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setMaxStepRejections, __pyx_mstate->__pyx_kp_b_iso88591_ha_E_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1257])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1955};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[1258] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getStepRejections, __pyx_mstate->__pyx_kp_b_iso88591_1_a_4uAQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1258])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1972};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_fails};
    __pyx_mstate_global->__pyx_codeobj_tab[1259] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setMaxSNESFailures, __pyx_mstate->__pyx_kp_b_iso88591_HA_e1A_a_1D_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1259])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1990};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[1260] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getSNESFailures, __pyx_mstate->__pyx_kp_b_iso88591_a_U_1_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1260])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2007};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1261] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setErrorIfStepFails, __pyx_mstate->__pyx_kp_b_iso88591_y_a_a_AT_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1261])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2029};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rtol, __pyx_mstate->__pyx_n_u_atol, __pyx_mstate->__pyx_n_u_rrtol, __pyx_mstate->__pyx_n_u_ratol, __pyx_mstate->__pyx_n_u_vrtol, __pyx_mstate->__pyx_n_u_vatol};
    __pyx_mstate_global->__pyx_codeobj_tab[1262] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setTolerances, __pyx_mstate->__pyx_kp_b_iso88591_IUV2_q_q_q_q_5_1_q_a_U_q_F_1_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1262])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2072};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rrtol, __pyx_mstate->__pyx_n_u_ratol, __pyx_mstate->__pyx_n_u_vrtol, __pyx_mstate->__pyx_n_u_vatol, __pyx_mstate->__pyx_n_u_rtol, __pyx_mstate->__pyx_n_u_atol};
    __pyx_mstate_global->__pyx_codeobj_tab[1263] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getTolerances, __pyx_mstate->__pyx_kp_b_iso88591_a_q_q_q_q_a_at5_1_6_A_7_1_6_1_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1263])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2106};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_option, __pyx_mstate->__pyx_n_u_oval};
    __pyx_mstate_global->__pyx_codeobj_tab[1264] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setExactFinalTime, __pyx_mstate->__pyx_kp_b_iso88591_1_1_a_4uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1264])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2128};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_reason, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1265] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setConvergedReason, __pyx_mstate->__pyx_kp_b_iso88591_Q_1_a_1D_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1265])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2149};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_reason};
    __pyx_mstate_global->__pyx_codeobj_tab[1266] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getConvergedReason, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_a_1D_Qa_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1266])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2167};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_monitor, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_monitorlist, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1267] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setMonitor, __pyx_mstate->__pyx_kp_b_iso88591_A_83fA_iq_s_q_E_V1_6_F_6_F_9F_7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1267])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2201};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1268] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getMonitor, __pyx_mstate->__pyx_kp_b_iso88591_A_t9AQ_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1268])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2213};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1269] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_monitorCancel, __pyx_mstate->__pyx_kp_b_iso88591_q_IQoQ_a_at1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1269])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2228};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_step, __pyx_mstate->__pyx_n_u_time, __pyx_mstate->__pyx_n_u_u, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_rval, __pyx_mstate->__pyx_n_u_uvec};
    __pyx_mstate_global->__pyx_codeobj_tab[1270] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_monitor, __pyx_mstate->__pyx_kp_b_iso88591_K_IQ_e1A_fAQ_a_2WF_5_1_U_1_ay_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1270])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2257};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_direction, __pyx_mstate->__pyx_n_u_terminate, __pyx_mstate->__pyx_n_u_indicator, __pyx_mstate->__pyx_n_u_postevent, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_ndirs, __pyx_mstate->__pyx_n_u_idirs, __pyx_mstate->__pyx_n_u_nterm, __pyx_mstate->__pyx_n_u_iterm, __pyx_mstate->__pyx_n_u_nevents};
    __pyx_mstate_global->__pyx_codeobj_tab[1271] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setEventHandler, __pyx_mstate->__pyx_kp_b_iso88591_A_0_q_y_2_q_q_HA_HA_vS_WA_vS_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1271])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2312};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tol, __pyx_mstate->__pyx_n_u_vtol, __pyx_mstate->__pyx_n_u_nevents, __pyx_mstate->__pyx_n_u_tolr, __pyx_mstate->__pyx_n_u_ntolr, __pyx_mstate->__pyx_n_u_vtolr};
    __pyx_mstate_global->__pyx_codeobj_tab[1272] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setEventTolerances, __pyx_mstate->__pyx_kp_b_iso88591_o_AZZccd0_a_q_4wa_6_5_q_e1A_81F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1272])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2348};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nevents};
    __pyx_mstate_global->__pyx_codeobj_tab[1273] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getNumEvents, __pyx_mstate->__pyx_kp_b_iso88591_a_a_Qd_q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1273])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2364};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prestep, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1274] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setPreStep, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_87_vS_ha_vS_ha_y_a_q_E_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1274])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2397};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1275] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getPreStep, __pyx_mstate->__pyx_kp_b_iso88591_A_t9AQ_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1275])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2409};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_poststep, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1276] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setPostStep, __pyx_mstate->__pyx_kp_b_iso88591_A_31_39A_9G1_vS_ha_vS_ha_z_q_U_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1276])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2441};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1277] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getPostStep, __pyx_mstate->__pyx_kp_b_iso88591_Q_t9AQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1277])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2445};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1278] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_awat1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1278])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2457};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1279] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_kp_b_iso88591_q_awat1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1279])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2469};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1280] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_step, __pyx_mstate->__pyx_kp_b_iso88591_a_avQd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1280])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2485};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1281] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_restartStep, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_AT_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1281])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2508};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1282] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_rollBack, __pyx_mstate->__pyx_kp_b_iso88591_az_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1282])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2520};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_u, __pyx_mstate->__pyx_n_u_uvec};
    __pyx_mstate_global->__pyx_codeobj_tab[1283] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_solve, __pyx_mstate->__pyx_kp_b_iso88591_1_1_2WF_awat5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1283])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2539};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_u, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1284] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_interpolate, __pyx_mstate->__pyx_kp_b_iso88591_a_fAQ_a_AT_fAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1284])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2559};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_hmin, __pyx_mstate->__pyx_n_u_hmax, __pyx_mstate->__pyx_n_u_tsadapt, __pyx_mstate->__pyx_n_u_hminr, __pyx_mstate->__pyx_n_u_hmaxr};
    __pyx_mstate_global->__pyx_codeobj_tab[1285] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setStepLimits, __pyx_mstate->__pyx_kp_b_iso88591_z_A_vQa_vQa_4uAQ_a_1IWA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1285])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2582};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tsadapt, __pyx_mstate->__pyx_n_u_hminr, __pyx_mstate->__pyx_n_u_hmaxr};
    __pyx_mstate_global->__pyx_codeobj_tab[1286] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getStepLimits, __pyx_mstate->__pyx_kp_b_iso88591_q_A_q_q_4uAQ_a_1IQgQa_axvQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1286])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2601};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1287] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setSaveTrajectory, __pyx_mstate->__pyx_kp_b_iso88591_1_a_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1287])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2620};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1288] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_removeTrajectory, __pyx_mstate->__pyx_kp_b_iso88591_a_a_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1288])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2632};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cost};
    __pyx_mstate_global->__pyx_codeobj_tab[1289] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getCostIntegral, __pyx_mstate->__pyx_kp_b_iso88591_1_a_U_4q_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1289])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2647};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vl, __pyx_mstate->__pyx_n_u_vm, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_vecl, __pyx_mstate->__pyx_n_u_vecm, __pyx_mstate->__pyx_n_u_mem1, __pyx_mstate->__pyx_n_u_mem2, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[1290] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setCostGradients, __pyx_mstate->__pyx_kp_b_iso88591_A_a_a_M_Qd_Qa_Qd_Qa_3gQ_Qa_q_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1290])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2693};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_vecl, __pyx_mstate->__pyx_n_u_vecm, __pyx_mstate->__pyx_n_u_vl, __pyx_mstate->__pyx_n_u_vm, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[1291] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getCostGradients, __pyx_mstate->__pyx_kp_b_iso88591_a_a_a_e1Cq_aq_A_5_1_at4wiq_5_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1291])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2714};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_jacobianp, __pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_Amat, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1292] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setRHSJacobianP, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_1_2WF_WA_vS_ha_vS_ha_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1292])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2751};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_forward, __pyx_mstate->__pyx_n_u_qts, __pyx_mstate->__pyx_n_u_fwd};
    __pyx_mstate_global->__pyx_codeobj_tab[1293] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_createQuadratureTS, __pyx_mstate->__pyx_kp_b_iso88591_b_Q_a_1D_U_3a_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1293])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2772};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_qts, __pyx_mstate->__pyx_n_u_fwd};
    __pyx_mstate_global->__pyx_codeobj_tab[1294] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getQuadratureTS, __pyx_mstate->__pyx_kp_b_iso88591_b_Q_a_U_5_A_a_3a_avQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1294])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2795};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rhsjacobianp, __pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_Amat, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1295] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setRHSJacobianP, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_1_2WF_q_vS_ha_vS_ha_V1_a_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1295])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2832};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_t, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1296] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_computeRHSJacobianP, __pyx_mstate->__pyx_kp_b_iso88591_Q_fAQ_a_AT_fAV1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1296])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2854};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_adjoint_steps, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1297] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_adjointSetSteps, __pyx_mstate->__pyx_kp_b_iso88591_XQ_U_1_a_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1297])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2872};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1298] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_adjointSetUp, __pyx_mstate->__pyx_kp_b_iso88591_a_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1298])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2884};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1299] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_adjointSolve, __pyx_mstate->__pyx_kp_b_iso88591_a_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1299])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2896};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1300] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_adjointStep, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_AT_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1300])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2908};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1301] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_adjointReset, __pyx_mstate->__pyx_kp_b_iso88591_a_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1301])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2922};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newts};
    __pyx_mstate_global->__pyx_codeobj_tab[1302] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_createPython, __pyx_mstate->__pyx_kp_b_iso88591_F_nIQ_havQ_Q_axq_q_az_hd_ay_U_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1302])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2947};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1303] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setPythonContext, __pyx_mstate->__pyx_kp_b_iso88591_a_e7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1303])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2959};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1304] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getPythonContext, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_e1A_83fG1_Ya, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1304])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2974};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_py_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1305] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setPythonType, __pyx_mstate->__pyx_kp_b_iso88591_XQ_1IQa_a_at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1305])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2988};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1306] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getPythonType, __pyx_mstate->__pyx_kp_b_iso88591_q_a_at5_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1306])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3004};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_theta, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1307] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setTheta, __pyx_mstate->__pyx_kp_b_iso88591_j_fAQ_a_at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1307])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3026};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1308] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getTheta, __pyx_mstate->__pyx_kp_b_iso88591_a_a_at5_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1308])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3040};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1309] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setThetaEndpoint, __pyx_mstate->__pyx_kp_b_iso88591_IQ_a_a_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1309])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3058};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1310] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getThetaEndpoint, __pyx_mstate->__pyx_kp_b_iso88591_a_a_e1A_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1310])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3074};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_radius, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1311] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setAlphaRadius, __pyx_mstate->__pyx_kp_b_iso88591_Zq_fAQ_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1311])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3096};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_alpha_m, __pyx_mstate->__pyx_n_u_alpha_f, __pyx_mstate->__pyx_n_u_gamma, __pyx_mstate->__pyx_n_u_rval1, __pyx_mstate->__pyx_n_u_rval2, __pyx_mstate->__pyx_n_u_rval3};
    __pyx_mstate_global->__pyx_codeobj_tab[1312] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_setAlphaParams, __pyx_mstate->__pyx_kp_b_iso88591_A_iq_Q_V1_AT_awawaq_87_aq_87_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1312])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3129};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rval1, __pyx_mstate->__pyx_n_u_rval2, __pyx_mstate->__pyx_n_u_rval3};
    __pyx_mstate_global->__pyx_codeobj_tab[1313] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TS_pyx, __pyx_mstate->__pyx_n_u_getAlphaParams, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_q_E_axvQhfAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1313])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 120};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[1314] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_awat6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1314])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 139};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1315] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_az_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1315])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 152};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newtao};
    __pyx_mstate_global->__pyx_codeobj_tab[1316] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_q_ay_az_hd_q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1316])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 173};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tao_type, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[1317] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_q_9AZq_az_fA_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1317])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 192};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[1318] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_az_fAQ_y_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1318])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 206};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cprefix};
    __pyx_mstate_global->__pyx_codeobj_tab[1319] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_a_1_81A_a_4vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1319])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 220};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cprefix};
    __pyx_mstate_global->__pyx_codeobj_tab[1320] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_appendOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_1_81A_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1320])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 234};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix};
    __pyx_mstate_global->__pyx_codeobj_tab[1321] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_a_4vQa_y_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1321])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 248};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1322] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1322])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 260};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1323] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_axq_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1323])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 274};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_radius, __pyx_mstate->__pyx_n_u_cradius};
    __pyx_mstate_global->__pyx_codeobj_tab[1324] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setInitialTrustRegionRadius, __pyx_mstate->__pyx_kp_b_iso88591_2_A_q_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1324])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 289};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_appctx};
    __pyx_mstate_global->__pyx_codeobj_tab[1325] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setAppCtx, __pyx_mstate->__pyx_kp_b_iso88591_IQnA_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1325])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 293};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1326] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getAppCtx, __pyx_mstate->__pyx_kp_b_iso88591_1_t9AQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1326])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 297};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[1327] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setSolution, __pyx_mstate->__pyx_kp_b_iso88591_A_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1327])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 309};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_objective, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1328] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setObjective, __pyx_mstate->__pyx_kp_b_iso88591_BB_h_i_A_A_J_J_K_5_6_6_F_fA_IQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1328])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 334};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_residual, __pyx_mstate->__pyx_n_u_R, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1329] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setResidual, __pyx_mstate->__pyx_kp_b_iso88591_FF__l_m_E_E_N_N_O_5_6_6_F_V1_IQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1329])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 361};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_jacobian, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_Jmat, __pyx_mstate->__pyx_n_u_Pmat, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1330] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setJacobianResidual, __pyx_mstate->__pyx_kp_b_iso88591_O_g_h_A_A_N_N_f_f_o_o_p_Q_2WF_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1330])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 394};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gradient, __pyx_mstate->__pyx_n_u_g, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_gvec, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1331] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setGradient, __pyx_mstate->__pyx_kp_b_iso88591_Kddq_r_J_J_S_S_T_Q_2WF_5_6_6_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1331])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 423};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_objective};
    __pyx_mstate_global->__pyx_codeobj_tab[1332] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getObjective, __pyx_mstate->__pyx_kp_b_iso88591_a_IQa_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1332])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 436};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_gradient};
    __pyx_mstate_global->__pyx_codeobj_tab[1333] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getGradient, __pyx_mstate->__pyx_kp_b_iso88591_Q_s_a_Qd_F_a_3a_t9AQ_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1333])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 452};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_objgrad, __pyx_mstate->__pyx_n_u_g, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_gvec, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1334] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setObjectiveGradient, __pyx_mstate->__pyx_kp_b_iso88591_PP_u_v_C_C_d_d_e_Q_2WF_5_6_6_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1334])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 482};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_objgrad};
    __pyx_mstate_global->__pyx_codeobj_tab[1335] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getObjectiveAndGradient, __pyx_mstate->__pyx_kp_b_iso88591_s_a_fAS_fA_a_3a_d_1A_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1335])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 498};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_varbounds, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_xl, __pyx_mstate->__pyx_n_u_xu, __pyx_mstate->__pyx_n_u_ol, __pyx_mstate->__pyx_n_u_ou, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1336] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setVariableBounds, __pyx_mstate->__pyx_kp_b_iso88591_w_x_E_E_f_f_g_k_Ja_Qk_Q_E_q_F_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1336])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 534};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_constraints, __pyx_mstate->__pyx_n_u_C, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_Cvec, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1337] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setConstraints, __pyx_mstate->__pyx_kp_b_iso88591_H_Tmmz_S_S_Q_2WF_5_6_6_F_a_IQ_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1337])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 563};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_hessian, __pyx_mstate->__pyx_n_u_H, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_Hmat, __pyx_mstate->__pyx_n_u_Pmat, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1338] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setHessian, __pyx_mstate->__pyx_kp_b_iso88591_L_2_WW_a0_Q_2WF_Q_2WF_5_6_6_F_9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1338])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 598};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_hessian};
    __pyx_mstate_global->__pyx_codeobj_tab[1339] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getHessian, __pyx_mstate->__pyx_kp_b_iso88591_A_S_S_a_AT_q_q_vQ_a_1A_a_1A_d_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1339])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 616};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_jacobian, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_Jmat, __pyx_mstate->__pyx_n_u_Pmat, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1340] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setJacobian, __pyx_mstate->__pyx_kp_b_iso88591_1_3_XXaab_Q_2WF_Q_2WF_5_6_6_F_V, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1340])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 650};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_design, __pyx_mstate->__pyx_n_u_s_is, __pyx_mstate->__pyx_n_u_d_is};
    __pyx_mstate_global->__pyx_codeobj_tab[1341] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setStateDesignIS, __pyx_mstate->__pyx_kp_b_iso88591_8_M_7_we1_7_wfA_a_4vV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1341])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 665};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_jacobian_state, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_I, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_Jmat, __pyx_mstate->__pyx_n_u_Pmat, __pyx_mstate->__pyx_n_u_Imat, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1342] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setJacobianState, __pyx_mstate->__pyx_kp_b_iso88591_5_Q_8_E_ffg_Q_2WF_Q_2WF_Q_2WF_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1342])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 689};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_jacobian_design, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_Jmat, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1343] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setJacobianDesign, __pyx_mstate->__pyx_kp_b_iso88591_7q_9_F_ggh_Q_2WF_5_6_6_F_F_IQ_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1343])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 709};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_M};
    __pyx_mstate_global->__pyx_codeobj_tab[1344] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getLMVMMat, __pyx_mstate->__pyx_kp_b_iso88591_A_S_a_q_F_1A_a_1A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1344])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 724};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[1345] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setLMVMMat, __pyx_mstate->__pyx_kp_b_iso88591_1_aq_a_q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1345])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 737};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_equality_constraints, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1346] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setEqualityConstraints, __pyx_mstate->__pyx_kp_b_iso88591_A_mKccllm_5_6_6_F_q_IQ_2_a_q_F_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1346])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 755};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_equality_constraints};
    __pyx_mstate_global->__pyx_codeobj_tab[1347] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getEqualityConstraints, __pyx_mstate->__pyx_kp_b_iso88591_S_a_q_F_1F_a_1A_4y_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1347])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 770};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_jacobian_equality, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_Jmat, __pyx_mstate->__pyx_n_u_Pmat, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1348] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setJacobianEquality, __pyx_mstate->__pyx_kp_b_iso88591_q_H_iij_Q_2WF_Q_2WF_5_6_6_F_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1348])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 792};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_Jpre, __pyx_mstate->__pyx_n_u_jacobian_equality};
    __pyx_mstate_global->__pyx_codeobj_tab[1349] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getJacobianEquality, __pyx_mstate->__pyx_kp_b_iso88591_Q_S_1_a_AT_q_q_F_PQ_a_1A_a_4q_I, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1349])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 810};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_inequality_constraints, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1350] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setInequalityConstraints, __pyx_mstate->__pyx_kp_b_iso88591_A_Meenno_5_6_6_F_6_IQ_4A_a_1_fAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1350])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 828};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_inequality_constraints};
    __pyx_mstate_global->__pyx_codeobj_tab[1351] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getInequalityConstraints, __pyx_mstate->__pyx_kp_b_iso88591_S_a_1_fAQfF_a_1A_T_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1351])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 843};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_jacobian_inequality, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_Jmat, __pyx_mstate->__pyx_n_u_Pmat, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1352] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setJacobianInequality, __pyx_mstate->__pyx_kp_b_iso88591_1_Jbbkkl_Q_2WF_Q_2WF_5_6_6_F_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1352])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 865};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_Jpre, __pyx_mstate->__pyx_n_u_jacobian_inequality};
    __pyx_mstate_global->__pyx_codeobj_tab[1353] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getJacobianInequality, __pyx_mstate->__pyx_kp_b_iso88591_q_S_1_a_at6_6_fFRS_a_1A_a_4q_iq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1353])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 882};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_update, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1354] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setUpdate, __pyx_mstate->__pyx_kp_b_iso88591_99RR__w_x_A_A_B_7_vS_ha_vS_ha_x, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1354])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 911};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1355] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getUpdate, __pyx_mstate->__pyx_kp_b_iso88591_1_t9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1355])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 925};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_f};
    __pyx_mstate_global->__pyx_codeobj_tab[1356] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_computeObjective, __pyx_mstate->__pyx_kp_b_iso88591_1_a_4vQfAQ_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1356])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 944};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_f};
    __pyx_mstate_global->__pyx_codeobj_tab[1357] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_computeResidual, __pyx_mstate->__pyx_kp_b_iso88591_q_a_fAV1A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1357])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 963};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_g};
    __pyx_mstate_global->__pyx_codeobj_tab[1358] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_computeGradient, __pyx_mstate->__pyx_kp_b_iso88591_q_a_fAV1A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1358])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 982};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_g, __pyx_mstate->__pyx_n_u_f};
    __pyx_mstate_global->__pyx_codeobj_tab[1359] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_computeObjectiveGradient, __pyx_mstate->__pyx_kp_b_iso88591_8_1_a_Qd_q_1A_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1359])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1004};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_xl, __pyx_mstate->__pyx_n_u_xu};
    __pyx_mstate_global->__pyx_codeobj_tab[1360] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_computeDualVariables, __pyx_mstate->__pyx_kp_b_iso88591_6a_a_at6_6_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1360])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1016};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_xl, __pyx_mstate->__pyx_n_u_xu, __pyx_mstate->__pyx_n_u_Lvec, __pyx_mstate->__pyx_n_u_Uvec};
    __pyx_mstate_global->__pyx_codeobj_tab[1361] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_computeVariableBounds, __pyx_mstate->__pyx_kp_b_iso88591_7q_a_q_A_a_1D_avQa_2U_Q_uCq_awa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1361])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1040};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[1362] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_computeConstraints, __pyx_mstate->__pyx_kp_b_iso88591_2_a_AT_q_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1362])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1059};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_H, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_hmat, __pyx_mstate->__pyx_n_u_pmat};
    __pyx_mstate_global->__pyx_codeobj_tab[1363] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_computeHessian, __pyx_mstate->__pyx_kp_b_iso88591_1_Qm1A_2WF_a_V1F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1363])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1082};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_J, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_jmat, __pyx_mstate->__pyx_n_u_pmat};
    __pyx_mstate_global->__pyx_codeobj_tab[1364] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_computeJacobian, __pyx_mstate->__pyx_kp_b_iso88591_2_1_Qm1A_2WF_a_fAV6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1364])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1107};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gatol, __pyx_mstate->__pyx_n_u_grtol, __pyx_mstate->__pyx_n_u_gttol, __pyx_mstate->__pyx_n_u_gatol_2, __pyx_mstate->__pyx_n_u_grtol_2, __pyx_mstate->__pyx_n_u_gttol_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1365] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setTolerances, __pyx_mstate->__pyx_kp_b_iso88591_m_jjsst6_44J_6_ivQa_6_ivQa_6_iv, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1365])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1140};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gatol_2, __pyx_mstate->__pyx_n_u_grtol_2, __pyx_mstate->__pyx_n_u_gttol_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1366] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getTolerances, __pyx_mstate->__pyx_kp_b_iso88591_q_44J_a_q_F_81HAQ_ay_ay_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1366])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1164};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mit, __pyx_mstate->__pyx_n_u_mit_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1367] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setMaximumIterations, __pyx_mstate->__pyx_kp_b_iso88591_U_1_a_at6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1367])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1177};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mit_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1368] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getMaximumIterations, __pyx_mstate->__pyx_kp_b_iso88591_a_Q_a_at6_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1368])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1191};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mit, __pyx_mstate->__pyx_n_u_mit_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1369] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setMaximumFunctionEvaluations, __pyx_mstate->__pyx_kp_b_iso88591_1_U_1_a_q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1369])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1204};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mit_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1370] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getMaximumFunctionEvaluations, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_a_q_F_1_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1370])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1218};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_catol, __pyx_mstate->__pyx_n_u_crtol, __pyx_mstate->__pyx_n_u_catol_2, __pyx_mstate->__pyx_n_u_crtol_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1371] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setConstraintTolerances, __pyx_mstate->__pyx_kp_b_iso88591_M_Xaab_4A_6_ivQa_6_ivQa_a_fHA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1371])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1244};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_catol_2, __pyx_mstate->__pyx_n_u_crtol_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1372] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getConstraintTolerances, __pyx_mstate->__pyx_kp_b_iso88591_4A_a_fAXQa_ay_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1372])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1265};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_converged, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs};
    __pyx_mstate_global->__pyx_codeobj_tab[1373] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setConvergenceTest, __pyx_mstate->__pyx_kp_b_iso88591_OOhhu_v_N_N_W_W_X_S_V3Na_1_uCvW, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1373])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1293};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1374] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getConvergenceTest, __pyx_mstate->__pyx_kp_b_iso88591_A_t9AQ_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1374])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1305};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_reason, __pyx_mstate->__pyx_n_u_creason};
    __pyx_mstate_global->__pyx_codeobj_tab[1375] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setConvergedReason, __pyx_mstate->__pyx_kp_b_iso88591_Q_0q_a_AT_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1375])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1318};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_creason};
    __pyx_mstate_global->__pyx_codeobj_tab[1376] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getConvergedReason, __pyx_mstate->__pyx_kp_b_iso88591_A_0q_a_AT_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1376])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1332};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_monitor, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_monitorlist};
    __pyx_mstate_global->__pyx_codeobj_tab[1377] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setMonitor, __pyx_mstate->__pyx_kp_b_iso88591_UUbbz_D_D_E_83fA_iq_6_F_6_F_s_V, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1377])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1361};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1378] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getMonitor, __pyx_mstate->__pyx_kp_b_iso88591_A_t9AQ_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1378])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1373};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1379] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_cancelMonitor, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_A_IQ_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1379])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1387};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_its, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_res, __pyx_mstate->__pyx_n_u_cnorm, __pyx_mstate->__pyx_n_u_step, __pyx_mstate->__pyx_n_u_cits, __pyx_mstate->__pyx_n_u_cf, __pyx_mstate->__pyx_n_u_cres, __pyx_mstate->__pyx_n_u_ccnorm, __pyx_mstate->__pyx_n_u_cstep};
    __pyx_mstate_global->__pyx_codeobj_tab[1380] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_monitor, __pyx_mstate->__pyx_kp_b_iso88591_Zggv_w_C_C_R_R_Q_A_a_q_a_1D_avQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1380])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1438};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[1381] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_solve, __pyx_mstate->__pyx_kp_b_iso88591_1_2WA_fAQ_axq_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1381])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1457};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1382] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getSolution, __pyx_mstate->__pyx_kp_b_iso88591_Q_s_a_Qd_A_a_3a_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1382])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1472};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[1383] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setGradientNorm, __pyx_mstate->__pyx_kp_b_iso88591_a_fCq_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1383])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1484};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[1384] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getGradientNorm, __pyx_mstate->__pyx_kp_b_iso88591_s_a_fAS_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1384])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1499};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[1385] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setLMVMH0, __pyx_mstate->__pyx_kp_b_iso88591_A_a_1D_c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1385])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1511};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[1386] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getLMVMH0, __pyx_mstate->__pyx_kp_b_iso88591_1_s_a_1D_as_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1386])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1526};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ksp};
    __pyx_mstate_global->__pyx_codeobj_tab[1387] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getLMVMH0KSP, __pyx_mstate->__pyx_kp_b_iso88591_a_s_a_at6_Q_a_3a_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1387])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1541};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_xl, __pyx_mstate->__pyx_n_u_xu};
    __pyx_mstate_global->__pyx_codeobj_tab[1388] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getVariableBounds, __pyx_mstate->__pyx_kp_b_iso88591_1_c_Q_a_1D_ar_q_a_2XV1Kq_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1388])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1556};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cg_type, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[1389] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setBNCGType, __pyx_mstate->__pyx_kp_b_iso88591_a_a_Qd_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1389])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1569};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cg_type};
    __pyx_mstate_global->__pyx_codeobj_tab[1390] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getBNCGType, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_Qd_q_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1390])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1583};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_its, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1391] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setIterationNumber, __pyx_mstate->__pyx_kp_b_iso88591_ha_U_1_a_AT_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1391])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1596};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_its};
    __pyx_mstate_global->__pyx_codeobj_tab[1392] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getIterationNumber, __pyx_mstate->__pyx_kp_b_iso88591_A_a_AT_q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1392])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1610};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fval};
    __pyx_mstate_global->__pyx_codeobj_tab[1393] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getObjectiveValue, __pyx_mstate->__pyx_kp_b_iso88591_1_A_a_1D_fAV6_vQ_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1393])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1626};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_reason};
    __pyx_mstate_global->__pyx_codeobj_tab[1394] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getConvergedReason, __pyx_mstate->__pyx_kp_b_iso88591_A_a_a_AT_q_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1394])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1640};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gnorm, __pyx_mstate->__pyx_n_u_cnorm, __pyx_mstate->__pyx_n_u_fval};
    __pyx_mstate_global->__pyx_codeobj_tab[1395] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getSolutionNorm, __pyx_mstate->__pyx_kp_b_iso88591_Q_Q_A_a_1D_fAV1G1G6QR_awfAXV1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1395])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1665};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_its, __pyx_mstate->__pyx_n_u_fval, __pyx_mstate->__pyx_n_u_gnorm, __pyx_mstate->__pyx_n_u_cnorm, __pyx_mstate->__pyx_n_u_xdiff, __pyx_mstate->__pyx_n_u_reason};
    __pyx_mstate_global->__pyx_codeobj_tab[1396] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getSolutionStatus, __pyx_mstate->__pyx_kp_b_iso88591_12_IYiq_a_a_1D_aq_V1G1G1A_Q_QfF, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1396])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1700};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_reason};
    __pyx_mstate_global->__pyx_codeobj_tab[1397] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_checkConverged, __pyx_mstate->__pyx_kp_b_iso88591_a_a_1D_aq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1397])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1714};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ksp};
    __pyx_mstate_global->__pyx_codeobj_tab[1398] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getKSP, __pyx_mstate->__pyx_kp_b_iso88591_s_ay_V1Cq_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1398])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1731};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_term, __pyx_mstate->__pyx_n_u_params, __pyx_mstate->__pyx_n_u_mapmat, __pyx_mstate->__pyx_n_u_scale_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1399] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getTerm, __pyx_mstate->__pyx_kp_b_iso88591_G1_Q_Q_a_az_fAXQd_AV6_PQ_a_4q_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1399])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1762};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_scale, __pyx_mstate->__pyx_n_u_term, __pyx_mstate->__pyx_n_u_params, __pyx_mstate->__pyx_n_u_mapmat, __pyx_mstate->__pyx_n_u_cprefix, __pyx_mstate->__pyx_n_u_ctype, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_cscale};
    __pyx_mstate_global->__pyx_codeobj_tab[1400] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_addTerm, __pyx_mstate->__pyx_kp_b_iso88591_1_RRccllm_1_81A_Q_7_t6_7_t6_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1400])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1797};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_subsolver};
    __pyx_mstate_global->__pyx_codeobj_tab[1401] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getALMMSubsolver, __pyx_mstate->__pyx_kp_b_iso88591_S_a_4vQiq_a_9A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1401])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1812};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_almm_type};
    __pyx_mstate_global->__pyx_codeobj_tab[1402] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getALMMType, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_Qd_q_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1402])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1826};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_subsolver, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[1403] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setALMMSubsolver, __pyx_mstate->__pyx_kp_b_iso88591_a_4vU, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1403])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1839};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tao_almm_type, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[1404] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setALMMType, __pyx_mstate->__pyx_kp_b_iso88591_a_a_a_Qd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1404])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1859};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_subsolver};
    __pyx_mstate_global->__pyx_codeobj_tab[1405] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getBRGNSubsolver, __pyx_mstate->__pyx_kp_b_iso88591_S_a_4vQiq_a_9A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1405])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1874};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_objgrad, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1406] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setBRGNRegularizerObjectiveGradi, __pyx_mstate->__pyx_kp_b_iso88591_AAZZgg_I_I_J_5_6_6_F_9F_IQ_A_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1406])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1890};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_hessian, __pyx_mstate->__pyx_n_u_H, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_Hmat, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1407] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setBRGNRegularizerHessian, __pyx_mstate->__pyx_kp_b_iso88591_7_C_i_j_B_B_K_K_L_Q_2WF_5_6_6_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1407])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1908};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_weight, __pyx_mstate->__pyx_n_u_cweight};
    __pyx_mstate_global->__pyx_codeobj_tab[1408] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setBRGNRegularizerWeight, __pyx_mstate->__pyx_kp_b_iso88591_z_q_a_4vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1408])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1917};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_epsilon, __pyx_mstate->__pyx_n_u_ceps};
    __pyx_mstate_global->__pyx_codeobj_tab[1409] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setBRGNSmoothL1Epsilon, __pyx_mstate->__pyx_kp_b_iso88591_j_fAQ_a_V1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1409])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1930};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_D};
    __pyx_mstate_global->__pyx_codeobj_tab[1410] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setBRGNDictionaryMatrix, __pyx_mstate->__pyx_kp_b_iso88591_0_a_fAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1410])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1942};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_damp};
    __pyx_mstate_global->__pyx_codeobj_tab[1411] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getBRGNDampingVector, __pyx_mstate->__pyx_kp_b_iso88591_a_1_a_at6_a_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1411])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1957};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_tao};
    __pyx_mstate_global->__pyx_codeobj_tab[1412] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_createPython, __pyx_mstate->__pyx_kp_b_iso88591_F_nIQ_havQ_A_ay_az_hd_az_fA_a_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1412])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1982};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1413] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setPythonContext, __pyx_mstate->__pyx_kp_b_iso88591_a_4vWA_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1413])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1994};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1414] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getPythonContext, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_4vQa_83fG1_Ya_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1414])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2009};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_py_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1415] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setPythonType, __pyx_mstate->__pyx_kp_b_iso88591_XQ_1IQa_a_q_F_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1415])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2024};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1416] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getPythonType, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_F_1_y_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1416])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2039};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ls};
    __pyx_mstate_global->__pyx_codeobj_tab[1417] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getLineSearch, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_a_q_F_2Q_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1417])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2230};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[1418] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_XQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1418])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2249};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1419] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_1AT_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1419])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2262};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newtaols};
    __pyx_mstate_global->__pyx_codeobj_tab[1420] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_1_havQ_1_a_7_1_az_hd_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1420])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2283};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ls_type, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[1421] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_a_A_1IQa_a_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1421])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2302};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[1422] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_A_a_1D_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1422])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2316};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1423] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_4q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1423])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2328};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1424] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_a_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1424])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2340};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cprefix};
    __pyx_mstate_global->__pyx_codeobj_tab[1425] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_IQ_1_81A_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1425])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2354};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix};
    __pyx_mstate_global->__pyx_codeobj_tab[1426] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_a_AT_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1426])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2368};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_objective, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs};
    __pyx_mstate_global->__pyx_codeobj_tab[1427] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setObjective, __pyx_mstate->__pyx_kp_b_iso88591_EE_k_l_D_D_M_M_N_a_q_H_MQ_5_6_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1427])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2393};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gradient, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs};
    __pyx_mstate_global->__pyx_codeobj_tab[1428] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setGradient, __pyx_mstate->__pyx_kp_b_iso88591_AAZZgg_I_I_J_a_at8_K1_5_6_6_F_I, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1428])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2420};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_objgrad, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs};
    __pyx_mstate_global->__pyx_codeobj_tab[1429] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setObjectiveGradient, __pyx_mstate->__pyx_kp_b_iso88591_RRkkx_y_Q_Q_Z_Z_a_4x_VW_5_6_6_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1429])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2447};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tao};
    __pyx_mstate_global->__pyx_codeobj_tab[1430] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_useTAORoutine, __pyx_mstate->__pyx_kp_b_iso88591_a_4xs, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1430])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2459};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_g, __pyx_mstate->__pyx_n_u_s_2, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_steplen, __pyx_mstate->__pyx_n_u_reason};
    __pyx_mstate_global->__pyx_codeobj_tab[1431] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_apply, __pyx_mstate->__pyx_kp_b_iso88591_A_1_8_a_havQc_q_QRRS_at6_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1431])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2475};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_s_2, __pyx_mstate->__pyx_n_u_cs};
    __pyx_mstate_global->__pyx_codeobj_tab[1432] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setInitialStepLength, __pyx_mstate->__pyx_kp_b_iso88591_j_F_1_a_0_XQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1432])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2518};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[1433] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_4z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1433])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2537};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1434] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_Qat1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1434])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2550};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newtaoterm};
    __pyx_mstate_global->__pyx_codeobj_tab[1435] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_1_havQ_q_a_AWAQ_az_hd_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1435])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2571};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_term_type, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[1436] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_a_IQk_a_Qd_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1436])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2590};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[1437] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_a_a_Qd_AQ_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1437])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2604};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1438] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_AT_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1438])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2616};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1439] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_a_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1439])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2628};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_x};
    __pyx_mstate_global->__pyx_codeobj_tab[1440] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_TAO_pyx, __pyx_mstate->__pyx_n_u_setSolutionTemplate, __pyx_mstate->__pyx_kp_b_iso88591_A_a_j, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1440])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 21};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_cviewer};
    __pyx_mstate_global->__pyx_codeobj_tab[1441] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_AO_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_1_7_z_q_avQd_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1441])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 40};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1442] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_AO_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_ay_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1442])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 53};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_app, __pyx_mstate->__pyx_n_u_petsc, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_isapp, __pyx_mstate->__pyx_n_u_ispetsc, __pyx_mstate->__pyx_n_u_napp, __pyx_mstate->__pyx_n_u_idxapp, __pyx_mstate->__pyx_n_u_npetsc, __pyx_mstate->__pyx_n_u_idxpetsc, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newao};
    __pyx_mstate_global->__pyx_codeobj_tab[1443] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_AO_pyx, __pyx_mstate->__pyx_n_u_createBasic, __pyx_mstate->__pyx_kp_b_iso88591_A_1_IQ4_Q_a_havQ_Q_Qe1_T_Q_vWA_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1443])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 102};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_app, __pyx_mstate->__pyx_n_u_petsc, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_isapp, __pyx_mstate->__pyx_n_u_ispetsc, __pyx_mstate->__pyx_n_u_napp, __pyx_mstate->__pyx_n_u_idxapp, __pyx_mstate->__pyx_n_u_npetsc, __pyx_mstate->__pyx_n_u_idxpetsc, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newao};
    __pyx_mstate_global->__pyx_codeobj_tab[1444] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_AO_pyx, __pyx_mstate->__pyx_n_u_createMemoryScalable, __pyx_mstate->__pyx_kp_b_iso88591_A_1_IQ_Q_a_havQ_Q_Qe1_T_Q_vWA_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1444])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 154};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_app, __pyx_mstate->__pyx_n_u_petsc, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_isapp, __pyx_mstate->__pyx_n_u_ispetsc, __pyx_mstate->__pyx_n_u_napp, __pyx_mstate->__pyx_n_u_idxapp, __pyx_mstate->__pyx_n_u_npetsc, __pyx_mstate->__pyx_n_u_idxpetsc, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newao};
    __pyx_mstate_global->__pyx_codeobj_tab[1445] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_AO_pyx, __pyx_mstate->__pyx_n_u_createMapping, __pyx_mstate->__pyx_kp_b_iso88591_A_1_IQ_Q_a_havQ_Q_Qe1_T_Q_vWA_5_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1445])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 200};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1446] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_AO_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_ay_U_1_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1446])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 214};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_nidx, __pyx_mstate->__pyx_n_u_idx};
    __pyx_mstate_global->__pyx_codeobj_tab[1447] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_AO_pyx, __pyx_mstate->__pyx_n_u_app2petsc, __pyx_mstate->__pyx_kp_b_iso88591_8_0_A_Zq_Qiq_D_e1_hay_q_q_E_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1447])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 248};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indices, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_nidx, __pyx_mstate->__pyx_n_u_idx};
    __pyx_mstate_global->__pyx_codeobj_tab[1448] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_AO_pyx, __pyx_mstate->__pyx_n_u_petsc2app, __pyx_mstate->__pyx_kp_b_iso88591_8_0_A_Zq_Qiq_D_e1_hay_q_q_E_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1448])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 76};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[1449] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_avQd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1449])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 95};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer};
    __pyx_mstate_global->__pyx_codeobj_tab[1450] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_load, __pyx_mstate->__pyx_kp_b_iso88591_Q_avQd_vQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1450])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 121};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1451] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_ay_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1451])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 134};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1452] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_Q_axq_q_az_hd_q_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1452])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 155};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1453] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_clone, __pyx_mstate->__pyx_kp_b_iso88591_q_T_q_awat5_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1453])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 169};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1454] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_1_1IQa_ay_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1454])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 192};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1455] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_ay_U_1_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1455])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 206};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim};
    __pyx_mstate_global->__pyx_codeobj_tab[1456] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getDimension, __pyx_mstate->__pyx_kp_b_iso88591_a_A_a_Qd_q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1456])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 220};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_cdim};
    __pyx_mstate_global->__pyx_codeobj_tab[1457] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setDimension, __pyx_mstate->__pyx_kp_b_iso88591_U_1_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1457])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 238};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim};
    __pyx_mstate_global->__pyx_codeobj_tab[1458] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getCoordinateDim, __pyx_mstate->__pyx_kp_b_iso88591_A_a_e1A_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1458])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 252};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_cdim};
    __pyx_mstate_global->__pyx_codeobj_tab[1459] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setCoordinateDim, __pyx_mstate->__pyx_kp_b_iso88591_HA_U_1_a_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1459])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 270};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1460] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_a_81A_a_e1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1460])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 284};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1461] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_a_e1A_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1461])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 298};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_prefix, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1462] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_appendOptionsPrefix, __pyx_mstate->__pyx_kp_b_iso88591_81A_a_AT_a_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1462])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 312};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1463] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_q_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1463])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 324};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1464] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_awat1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1464])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 339};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_appctx};
    __pyx_mstate_global->__pyx_codeobj_tab[1465] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setAppCtx, __pyx_mstate->__pyx_kp_b_iso88591_IQnA_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1465])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 343};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1466] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getAppCtx, __pyx_mstate->__pyx_kp_b_iso88591_1_t9AQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1466])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 349};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_uN};
    __pyx_mstate_global->__pyx_codeobj_tab[1467] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getUseNatural, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_a_at5_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1467])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 368};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_useNatural, __pyx_mstate->__pyx_n_u_uN};
    __pyx_mstate_global->__pyx_codeobj_tab[1468] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setUseNatural, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1468])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 386};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_useCone, __pyx_mstate->__pyx_n_u_useClosure, __pyx_mstate->__pyx_n_u_uC, __pyx_mstate->__pyx_n_u_uCl};
    __pyx_mstate_global->__pyx_codeobj_tab[1469] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setBasicAdjacency, __pyx_mstate->__pyx_kp_b_iso88591_9A_Q_Q_a_4uD, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1469])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 407};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_uC, __pyx_mstate->__pyx_n_u_uCl};
    __pyx_mstate_global->__pyx_codeobj_tab[1470] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getBasicAdjacency, __pyx_mstate->__pyx_kp_b_iso88591_1_Q_Q_a_4uAT_vQe6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1470])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 429};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_useCone, __pyx_mstate->__pyx_n_u_useClosure, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_uC, __pyx_mstate->__pyx_n_u_uCl};
    __pyx_mstate_global->__pyx_codeobj_tab[1471] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setFieldAdjacency, __pyx_mstate->__pyx_kp_b_iso88591_5GyPQ_U_1_Q_Q_a_Qd_s_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1471])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 453};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_uC, __pyx_mstate->__pyx_n_u_uCl};
    __pyx_mstate_global->__pyx_codeobj_tab[1472] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getFieldAdjacency, __pyx_mstate->__pyx_kp_b_iso88591_xq_U_1_Q_Q_a_Qd_s_4q_vQe6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1472])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 483};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fields, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_subdm, __pyx_mstate->__pyx_n_u_ifields, __pyx_mstate->__pyx_n_u_numFields};
    __pyx_mstate_global->__pyx_codeobj_tab[1473] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_createSubDM, __pyx_mstate->__pyx_kp_b_iso88591_4A_r_aq_a_AT_k_4wauA_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1473])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 510};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_aux, __pyx_mstate->__pyx_n_u_label, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_part, __pyx_mstate->__pyx_n_u_cvalue, __pyx_mstate->__pyx_n_u_cpart, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_clbl};
    __pyx_mstate_global->__pyx_codeobj_tab[1474] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setAuxiliaryVec, __pyx_mstate->__pyx_kp_b_iso88591_DHFRS_uAQ_e1A_5_6_az_e6_a_U_s, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1474])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 540};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_label, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_part, __pyx_mstate->__pyx_n_u_cvalue, __pyx_mstate->__pyx_n_u_cpart, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_clbl, __pyx_mstate->__pyx_n_u_aux};
    __pyx_mstate_global->__pyx_codeobj_tab[1475] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getAuxiliaryVec, __pyx_mstate->__pyx_kp_b_iso88591_IUbbhhi_uAQ_e1A_s_5_6_az_e6_a_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1475])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 570};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_numFields, __pyx_mstate->__pyx_n_u_cnum};
    __pyx_mstate_global->__pyx_codeobj_tab[1476] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setNumFields, __pyx_mstate->__pyx_kp_b_iso88591_ha_U_1_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1476])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 583};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cnum};
    __pyx_mstate_global->__pyx_codeobj_tab[1477] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getNumFields, __pyx_mstate->__pyx_kp_b_iso88591_a_Q_a_Qd_q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1477])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 597};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_label, __pyx_mstate->__pyx_n_u_cidx, __pyx_mstate->__pyx_n_u_cobj, __pyx_mstate->__pyx_n_u_clbl};
    __pyx_mstate_global->__pyx_codeobj_tab[1478] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setField, __pyx_mstate->__pyx_kp_b_iso88591_8_Ya_aq_d_1_vS_az_e6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1478])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 623};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_cidx, __pyx_mstate->__pyx_n_u_cobj, __pyx_mstate->__pyx_n_u_clbl, __pyx_mstate->__pyx_n_u_field};
    __pyx_mstate_global->__pyx_codeobj_tab[1479] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getField, __pyx_mstate->__pyx_kp_b_iso88591_ha_aq_az_e6_uCq_N_5_T_q_a_5_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1479])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 648};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_label, __pyx_mstate->__pyx_n_u_cobj, __pyx_mstate->__pyx_n_u_clbl};
    __pyx_mstate_global->__pyx_codeobj_tab[1480] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_addField, __pyx_mstate->__pyx_kp_b_iso88591_M_d_1_vS_az_e6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1480])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 671};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1481] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_clearFields, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_AT_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1481])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 683};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm, __pyx_mstate->__pyx_n_u_minDegree, __pyx_mstate->__pyx_n_u_maxDegree, __pyx_mstate->__pyx_n_u_mindeg, __pyx_mstate->__pyx_n_u_maxdeg};
    __pyx_mstate_global->__pyx_codeobj_tab[1482] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_copyFields, __pyx_mstate->__pyx_kp_b_iso88591_iq_q_S_U_1_q_S_U_1_a_1D_XXRq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1482])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 716};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1483] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_createDS, __pyx_mstate->__pyx_kp_b_iso88591_az_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1483])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 728};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1484] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_clearDS, __pyx_mstate->__pyx_kp_b_iso88591_ay_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1484])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 740};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ds};
    __pyx_mstate_global->__pyx_codeobj_tab[1485] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getDS, __pyx_mstate->__pyx_kp_b_iso88591_q_Rq_awat5_1_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1485])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 755};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm, __pyx_mstate->__pyx_n_u_minDegree, __pyx_mstate->__pyx_n_u_maxDegree, __pyx_mstate->__pyx_n_u_mindeg, __pyx_mstate->__pyx_n_u_maxdeg};
    __pyx_mstate_global->__pyx_codeobj_tab[1486] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_copyDS, __pyx_mstate->__pyx_kp_b_iso88591_1_q_S_U_1_q_S_U_1_axq_E_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1486])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 788};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1487] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_copyDisc, __pyx_mstate->__pyx_kp_b_iso88591_az_e2Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1487])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 807};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_bs_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1488] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getBlockSize, __pyx_mstate->__pyx_kp_b_iso88591_a_1_a_Qd_q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1488])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 821};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec_type, __pyx_mstate->__pyx_n_u_vtype};
    __pyx_mstate_global->__pyx_codeobj_tab[1489] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setVecType, __pyx_mstate->__pyx_kp_b_iso88591_6a_9AZq_a_1D_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1489])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 835};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vg};
    __pyx_mstate_global->__pyx_codeobj_tab[1490] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_createGlobalVec, __pyx_mstate->__pyx_kp_b_iso88591_c_a_1D_Qb_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1490])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 849};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vl};
    __pyx_mstate_global->__pyx_codeobj_tab[1491] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_createLocalVec, __pyx_mstate->__pyx_kp_b_iso88591_c_a_4uARq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1491])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 863};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_vg, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1492] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getGlobalVec, __pyx_mstate->__pyx_kp_b_iso88591_y_c_6_A_e7_2Q_AT_ar_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1492])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 892};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vg, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1493] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_restoreGlobalVec, __pyx_mstate->__pyx_kp_b_iso88591_m9A_a_2Q_6_A_Qd_war_U_2Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1493])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 917};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_vl, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1494] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getLocalVec, __pyx_mstate->__pyx_kp_b_iso88591_iq_c_6_A_U_A_1D_Qb_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1494])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 946};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vl, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1495] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_restoreLocalVec, __pyx_mstate->__pyx_kp_b_iso88591_1_a_2Q_6_A_AT_gQb_q_E_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1495])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 971};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vg, __pyx_mstate->__pyx_n_u_vl, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_im};
    __pyx_mstate_global->__pyx_codeobj_tab[1496] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_globalToLocal, __pyx_mstate->__pyx_kp_b_iso88591_22J_ST_AQ_a_1D_RvT_1_a_1D_RvT_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1496])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 994};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vl, __pyx_mstate->__pyx_n_u_vg, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_im};
    __pyx_mstate_global->__pyx_codeobj_tab[1497] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_localToGlobal, __pyx_mstate->__pyx_kp_b_iso88591_22J_ST_AQ_a_1D_RvT_1_a_e2V4r, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1497])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1017};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vl, __pyx_mstate->__pyx_n_u_vlg, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_im};
    __pyx_mstate_global->__pyx_codeobj_tab[1498] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_localToLocal, __pyx_mstate->__pyx_kp_b_iso88591_22J_ST_AQ_a_4uBfD_1_a_4uBfD_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1498])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1040};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_lgm};
    __pyx_mstate_global->__pyx_codeobj_tab[1499] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getLGMap, __pyx_mstate->__pyx_kp_b_iso88591_a_a_U_3a_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1499])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1057};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1500] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getCoarseDM, __pyx_mstate->__pyx_kp_b_iso88591_Q_d_5_a_AT_as_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1500])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1072};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1501] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setCoarseDM, __pyx_mstate->__pyx_kp_b_iso88591_A_a_AT_b, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1501])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1085};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1502] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getCoordinateDM, __pyx_mstate->__pyx_kp_b_iso88591_d_5_a_U_3a_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1502])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1100};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sec};
    __pyx_mstate_global->__pyx_codeobj_tab[1503] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getCoordinateSection, __pyx_mstate->__pyx_kp_b_iso88591_a_7_a_Qd_q_1_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1503])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1115};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[1504] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setCoordinates, __pyx_mstate->__pyx_kp_b_iso88591_q_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1504])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1132};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[1505] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getCoordinates, __pyx_mstate->__pyx_kp_b_iso88591_S_a_q_E_1_a_1A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1505])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1147};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[1506] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setCoordinatesLocal, __pyx_mstate->__pyx_kp_b_iso88591_A_a_AT_aq_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1506])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1164};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[1507] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getCoordinatesLocal, __pyx_mstate->__pyx_kp_b_iso88591_Q_S_a_AT_aq_a_1A_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1507])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1179};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1508] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setCellCoordinateDM, __pyx_mstate->__pyx_kp_b_iso88591_A_a_AT_b_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1508])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1196};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1509] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getCellCoordinateDM, __pyx_mstate->__pyx_kp_b_iso88591_Q_d_5_a_AT_as_a_3a_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1509])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1211};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_sec, __pyx_mstate->__pyx_n_u_cdim};
    __pyx_mstate_global->__pyx_codeobj_tab[1510] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setCellCoordinateSection, __pyx_mstate->__pyx_kp_b_iso88591_A_U_1_a_e6_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1510])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1231};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sec};
    __pyx_mstate_global->__pyx_codeobj_tab[1511] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getCellCoordinateSection, __pyx_mstate->__pyx_kp_b_iso88591_7_a_e1Cq_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1511])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1246};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[1512] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setCellCoordinates, __pyx_mstate->__pyx_kp_b_iso88591_1_a_1D_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1512])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1263};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[1513] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getCellCoordinates, __pyx_mstate->__pyx_kp_b_iso88591_A_S_a_1D_Qaq_a_1A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1513])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1278};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[1514] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setCellCoordinatesLocal, __pyx_mstate->__pyx_kp_b_iso88591_0_a_U_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1514])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1295};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_c};
    __pyx_mstate_global->__pyx_codeobj_tab[1515] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getCellCoordinatesLocal, __pyx_mstate->__pyx_kp_b_iso88591_S_a_U_1A_a_1A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1515])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1310};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_disc, __pyx_mstate->__pyx_n_u_localized, __pyx_mstate->__pyx_n_u_project, __pyx_mstate->__pyx_n_u_clocalized, __pyx_mstate->__pyx_n_u_pr};
    __pyx_mstate_global->__pyx_codeobj_tab[1516] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setCoordinateDisc, __pyx_mstate->__pyx_kp_b_iso88591_4O9A_A_A_a_4uD_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1516])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1334};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1517] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getCoordinatesLocalized, __pyx_mstate->__pyx_kp_b_iso88591_a_a_U_1_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1517])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1348};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1518] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getSparseLocalize, __pyx_mstate->__pyx_kp_b_iso88591_1_a_a_4uAQ_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1518])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1362};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_cflag};
    __pyx_mstate_global->__pyx_codeobj_tab[1519] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setSparseLocalize, __pyx_mstate->__pyx_kp_b_iso88591_iq_q_6_a_4uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1519])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1381};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_gmin, __pyx_mstate->__pyx_n_u_gmax, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[1520] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getBoundingBox, __pyx_mstate->__pyx_kp_b_iso88591_a_e1A_a_q_E_q_uARvQd_5_at1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1520])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1398};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_lmin, __pyx_mstate->__pyx_n_u_lmax, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[1521] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getLocalBoundingBox, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_e1A_a_AT_fA_uARvQd_5_at1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1521])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1415};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1522] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_localizeCoordinates, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_AT_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1522])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1432};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_MAXCELL, __pyx_mstate->__pyx_n_u_mcell, __pyx_mstate->__pyx_n_u_LSTART, __pyx_mstate->__pyx_n_u_lstart, __pyx_mstate->__pyx_n_u_LPY, __pyx_mstate->__pyx_n_u_lpy, __pyx_mstate->__pyx_n_u_maxCell, __pyx_mstate->__pyx_n_u_Lstart, __pyx_mstate->__pyx_n_u_L};
    __pyx_mstate_global->__pyx_codeobj_tab[1523] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getPeriodicity, __pyx_mstate->__pyx_kp_b_iso88591_A_a_Qd_q_XQgQfF_1_hawavV1A_a_81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1523])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1468};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maxCell, __pyx_mstate->__pyx_n_u_Lstart, __pyx_mstate->__pyx_n_u_L, __pyx_mstate->__pyx_n_u_MAXCELL, __pyx_mstate->__pyx_n_u_unuseda, __pyx_mstate->__pyx_n_u_LSTART, __pyx_mstate->__pyx_n_u_unusedb, __pyx_mstate->__pyx_n_u_LPY, __pyx_mstate->__pyx_n_u_unusedc};
    __pyx_mstate_global->__pyx_codeobj_tab[1524] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setPeriodicity, __pyx_mstate->__pyx_kp_b_iso88591_SSggh_xq_q_xq_aq_a_xq_6_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1524])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1495};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat_type, __pyx_mstate->__pyx_n_u_mtype};
    __pyx_mstate_global->__pyx_codeobj_tab[1525] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setMatType, __pyx_mstate->__pyx_kp_b_iso88591_6a_9AZq_a_1D_Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1525])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1518};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[1526] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_createMat, __pyx_mstate->__pyx_kp_b_iso88591_1_s_a_Qd_q_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1526])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1532};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dmf, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[1527] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_createMassMatrix, __pyx_mstate->__pyx_kp_b_iso88591_s_a_e3e1Cq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1527])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1551};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm, __pyx_mstate->__pyx_n_u_A, __pyx_mstate->__pyx_n_u_scale};
    __pyx_mstate_global->__pyx_codeobj_tab[1528] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_createInterpolation, __pyx_mstate->__pyx_kp_b_iso88591_A_S_A_a_AT_b_avQe1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1528])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1572};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm, __pyx_mstate->__pyx_n_u_inject};
    __pyx_mstate_global->__pyx_codeobj_tab[1529] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_createInjection, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_U_E_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1529])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1591};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[1530] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_createRestriction, __pyx_mstate->__pyx_kp_b_iso88591_s_a_4uBe1Cq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1530])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1610};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm_type, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1531] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_convert, __pyx_mstate->__pyx_kp_b_iso88591_1_1IQa_Q_ay_U_T_1F_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1531])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1633};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_dmcomm, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1532] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_refine, __pyx_mstate->__pyx_kp_b_iso88591_q_a_t5_Q_axq_E_Zq_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1532])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1657};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_dmcomm, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1533] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_coarsen, __pyx_mstate->__pyx_kp_b_iso88591_N_1_q_a_t5_Q_ay_U_1_Zq_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1533])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1681};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nlevels, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_newdmf, __pyx_mstate->__pyx_n_u_unused, __pyx_mstate->__pyx_n_u_dmf, __pyx_mstate->__pyx_n_u_hierarchy};
    __pyx_mstate_global->__pyx_codeobj_tab[1534] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_refineHierarchy, __pyx_mstate->__pyx_kp_b_iso88591_xq_U_1_q_XQgQj_F_1_a_U_Q_a_a_G9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1534])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1708};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nlevels, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_newdmc, __pyx_mstate->__pyx_n_u_unused, __pyx_mstate->__pyx_n_u_dmc, __pyx_mstate->__pyx_n_u_hierarchy};
    __pyx_mstate_global->__pyx_codeobj_tab[1535] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_coarsenHierarchy, __pyx_mstate->__pyx_kp_b_iso88591_U_1_q_XQgQj_F_1_a_e3a_a_a_G9A_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1535])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1735};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[1536] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getRefineLevel, __pyx_mstate->__pyx_kp_b_iso88591_a_q_E_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1536])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1749};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_level, __pyx_mstate->__pyx_n_u_clevel};
    __pyx_mstate_global->__pyx_codeobj_tab[1537] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setRefineLevel, __pyx_mstate->__pyx_kp_b_iso88591_HA_uAQ_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1537])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1767};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[1538] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getCoarsenLevel, __pyx_mstate->__pyx_kp_b_iso88591_a_U_1_uAQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1538])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1783};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_label, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_clbl, __pyx_mstate->__pyx_n_u_newdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1539] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_adaptLabel, __pyx_mstate->__pyx_kp_b_iso88591_az_e6_a_a_1D_V1E_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1539])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1806};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_metric, __pyx_mstate->__pyx_n_u_bdLabel, __pyx_mstate->__pyx_n_u_rgLabel, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_cbdlbl, __pyx_mstate->__pyx_n_u_crglbl, __pyx_mstate->__pyx_n_u_newdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1540] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_adaptMetric, __pyx_mstate->__pyx_kp_b_iso88591_A_a_iq_1_1_1IQa_5_6_az_e6_1IQa_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1540])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1842};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_dmlabel};
    __pyx_mstate_global->__pyx_codeobj_tab[1541] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getLabel, __pyx_mstate->__pyx_kp_b_iso88591_XQ_wa_y_q_az_e7_7_a_7_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1541])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1861};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sec};
    __pyx_mstate_global->__pyx_codeobj_tab[1542] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setLocalSection, __pyx_mstate->__pyx_kp_b_iso88591_a_a_U_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1542])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1873};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sec};
    __pyx_mstate_global->__pyx_codeobj_tab[1543] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getLocalSection, __pyx_mstate->__pyx_kp_b_iso88591_7_a_U_3a_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1543])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1888};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sec};
    __pyx_mstate_global->__pyx_codeobj_tab[1544] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setGlobalSection, __pyx_mstate->__pyx_kp_b_iso88591_q_a_e3a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1544])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1900};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sec};
    __pyx_mstate_global->__pyx_codeobj_tab[1545] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getGlobalSection, __pyx_mstate->__pyx_kp_b_iso88591_7_a_e1Cq_a_3a_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1545])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1924};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_localsec, __pyx_mstate->__pyx_n_u_globalsec};
    __pyx_mstate_global->__pyx_codeobj_tab[1546] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_createSectionSF, __pyx_mstate->__pyx_kp_b_iso88591_Fa_a_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1546])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1947};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf};
    __pyx_mstate_global->__pyx_codeobj_tab[1547] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getSectionSF, __pyx_mstate->__pyx_kp_b_iso88591_a_Rq_a_Qd_q_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1547])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1962};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf};
    __pyx_mstate_global->__pyx_codeobj_tab[1548] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setSectionSF, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_Qd_r, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1548])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1978};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf};
    __pyx_mstate_global->__pyx_codeobj_tab[1549] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getPointSF, __pyx_mstate->__pyx_kp_b_iso88591_A_Rq_a_1D_Qb_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1549])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1993};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf};
    __pyx_mstate_global->__pyx_codeobj_tab[1550] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setPointSF, __pyx_mstate->__pyx_kp_b_iso88591_1_a_1D_Rq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1550])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2005};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nLabels};
    __pyx_mstate_global->__pyx_codeobj_tab[1551] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getNumLabels, __pyx_mstate->__pyx_kp_b_iso88591_a_a_Qd_q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1551])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2019};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_cindex, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1552] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getLabelName, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_a_Qd_xq_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1552])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2039};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1553] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_hasLabel, __pyx_mstate->__pyx_kp_b_iso88591_XQ_a_y_q_az_e7_1_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1553])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2060};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1554] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_createLabel, __pyx_mstate->__pyx_kp_b_iso88591_y_q_a_AT_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1554])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2079};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_clbl};
    __pyx_mstate_global->__pyx_codeobj_tab[1555] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_removeLabel, __pyx_mstate->__pyx_kp_b_iso88591_y_q_a_AT_gQa_a_Qaq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1555])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2101};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1556] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getLabelValue, __pyx_mstate->__pyx_kp_b_iso88591_ha_uA_5Q_y_q_a_at5_xq_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1556])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2124};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cvalue, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1557] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setLabelValue, __pyx_mstate->__pyx_kp_b_iso88591_l_uA_6e1A_y_q_a_at5_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1557])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2148};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cvalue, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1558] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_clearLabelValue, __pyx_mstate->__pyx_kp_b_iso88591_L_HA_uA_6e1A_y_q_a_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1558])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2172};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1559] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getLabelSize, __pyx_mstate->__pyx_kp_b_iso88591_Q_y_q_a_Qd_waq_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1559])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2193};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_lis};
    __pyx_mstate_global->__pyx_codeobj_tab[1560] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getLabelIdIS, __pyx_mstate->__pyx_kp_b_iso88591_y_q_b_a_Qd_was_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1560])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2214};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_cvalue, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1561] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getStratumSize, __pyx_mstate->__pyx_kp_b_iso88591_xq_Q_uAQ_y_q_a_q_E_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1561])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2238};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_cvalue, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_sis};
    __pyx_mstate_global->__pyx_codeobj_tab[1562] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getStratumIS, __pyx_mstate->__pyx_kp_b_iso88591_XQ_uAQ_y_q_b_a_Qd_whas_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1562])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2262};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_cvalue, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1563] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_clearLabelStratum, __pyx_mstate->__pyx_kp_b_iso88591_l_uAQ_y_q_a_4uG1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1563])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2284};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_output, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_coutput};
    __pyx_mstate_global->__pyx_codeobj_tab[1564] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setLabelOutput, __pyx_mstate->__pyx_kp_b_iso88591_y_q_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1564])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2306};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_coutput};
    __pyx_mstate_global->__pyx_codeobj_tab[1565] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_getLabelOutput, __pyx_mstate->__pyx_kp_b_iso88591_81_y_q_a_q_E_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1565])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2332};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_operators, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1566] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setKSPComputeOperators, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_6_F_6_F_fA_IQ_q_a_q_E1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1566])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2360};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_clen, __pyx_mstate->__pyx_n_u_cis, __pyx_mstate->__pyx_n_u_cdm, __pyx_mstate->__pyx_n_u_cnamelist, __pyx_mstate->__pyx_n_u_isets, __pyx_mstate->__pyx_n_u_dms, __pyx_mstate->__pyx_n_u_names, __pyx_mstate->__pyx_n_u_dm, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[1567] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_createFieldDecomposition, __pyx_mstate->__pyx_kp_b_iso88591_Q_A_A_a_e1F_auAQ_6_Qd_gYa_Q_G9A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1567])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2407};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_function, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1568] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setSNESFunction, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_9G1_vS_ha_vS_ha_z_q_AT_oWA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1568])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2439};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_jacobian, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1569] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_setSNESJacobian, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_9G1_vS_ha_vS_ha_z_q_AT_oWA_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1569])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2470};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_coarsenhook, __pyx_mstate->__pyx_n_u_restricthook, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_coarsencontext, __pyx_mstate->__pyx_n_u_coarsenhooks, __pyx_mstate->__pyx_n_u_restrictcontext, __pyx_mstate->__pyx_n_u_restricthooks};
    __pyx_mstate_global->__pyx_codeobj_tab[1570] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DM_pyx, __pyx_mstate->__pyx_n_u_addCoarsenHook, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_6_F_6_F_wa_m6_4y_Cq_q_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1570])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 21};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[1571] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DS_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_4uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1571])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 40};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1572] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DS_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_Qat1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1572])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 53};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newds};
    __pyx_mstate_global->__pyx_codeobj_tab[1573] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DS_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_Q_a_AWAQ_az_hd_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1573])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 76};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ds_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1574] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DS_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_a_1IQa_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1574])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 95};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1575] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DS_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_a_Qd_q_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1575])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 109};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1576] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DS_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_AT_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1576])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 121};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1577] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DS_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_a_1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1577])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 136};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim};
    __pyx_mstate_global->__pyx_codeobj_tab[1578] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DS_pyx, __pyx_mstate->__pyx_n_u_getSpatialDimension, __pyx_mstate->__pyx_kp_b_iso88591_Q_A_a_e1A_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1578])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 153};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim};
    __pyx_mstate_global->__pyx_codeobj_tab[1579] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DS_pyx, __pyx_mstate->__pyx_n_u_getCoordinateDimension, __pyx_mstate->__pyx_kp_b_iso88591_A_a_AT_aq_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1579])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 170};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nf};
    __pyx_mstate_global->__pyx_codeobj_tab[1580] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DS_pyx, __pyx_mstate->__pyx_n_u_getNumFields, __pyx_mstate->__pyx_kp_b_iso88591_a_1_a_4uAQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1580])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 184};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_disc, __pyx_mstate->__pyx_n_u_field};
    __pyx_mstate_global->__pyx_codeobj_tab[1581] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DS_pyx, __pyx_mstate->__pyx_n_u_getFieldIndex, __pyx_mstate->__pyx_kp_b_iso88591_A_a_a_1D_T_Qd_1_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1581])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 203};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tdim};
    __pyx_mstate_global->__pyx_codeobj_tab[1582] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DS_pyx, __pyx_mstate->__pyx_n_u_getTotalDimensions, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_a_q_E_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1582])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 217};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tcmp};
    __pyx_mstate_global->__pyx_codeobj_tab[1583] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DS_pyx, __pyx_mstate->__pyx_n_u_getTotalComponents, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_a_U_1_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1583])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 231};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nf, __pyx_mstate->__pyx_n_u_dims};
    __pyx_mstate_global->__pyx_codeobj_tab[1584] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DS_pyx, __pyx_mstate->__pyx_n_u_getDimensions, __pyx_mstate->__pyx_kp_b_iso88591_q_a_a_4uAQ_a_1D_Qa_wat1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1584])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 246};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nf, __pyx_mstate->__pyx_n_u_cmps};
    __pyx_mstate_global->__pyx_codeobj_tab[1585] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DS_pyx, __pyx_mstate->__pyx_n_u_getComponents, __pyx_mstate->__pyx_kp_b_iso88591_q_a_a_4uAQ_a_1D_Qa_wat1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1585])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 261};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_disc, __pyx_mstate->__pyx_n_u_cf, __pyx_mstate->__pyx_n_u_fe};
    __pyx_mstate_global->__pyx_codeobj_tab[1586] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DS_pyx, __pyx_mstate->__pyx_n_u_setDiscretisation, __pyx_mstate->__pyx_kp_b_iso88591_k_5_Q_a_q_E_2Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1586])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {11, 0, 0, 34, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 32};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_dof, __pyx_mstate->__pyx_n_u_sizes, __pyx_mstate->__pyx_n_u_proc_sizes, __pyx_mstate->__pyx_n_u_boundary_type, __pyx_mstate->__pyx_n_u_stencil_type, __pyx_mstate->__pyx_n_u_stencil_width, __pyx_mstate->__pyx_n_u_setup, __pyx_mstate->__pyx_n_u_ownership_ranges, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_arg, __pyx_mstate->__pyx_n_u_ndim, __pyx_mstate->__pyx_n_u_ndof, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_lx, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_ly, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_lz, __pyx_mstate->__pyx_n_u_btx, __pyx_mstate->__pyx_n_u_bty, __pyx_mstate->__pyx_n_u_btz, __pyx_mstate->__pyx_n_u_stype, __pyx_mstate->__pyx_n_u_swidth, __pyx_mstate->__pyx_n_u_gsizes, __pyx_mstate->__pyx_n_u_psizes, __pyx_mstate->__pyx_n_u_gdim, __pyx_mstate->__pyx_n_u_pdim, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newda};
    __pyx_mstate_global->__pyx_codeobj_tab[1587] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_A_a_Oq_1_A_1_Q_IQd_V5_86_Q_Q_5Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1587])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 23, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 148};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dof, __pyx_mstate->__pyx_n_u_boundary_type, __pyx_mstate->__pyx_n_u_stencil_type, __pyx_mstate->__pyx_n_u_stencil_width, __pyx_mstate->__pyx_n_u_ndim, __pyx_mstate->__pyx_n_u_ndof, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_btx, __pyx_mstate->__pyx_n_u_bty, __pyx_mstate->__pyx_n_u_btz, __pyx_mstate->__pyx_n_u_stype, __pyx_mstate->__pyx_n_u_swidth, __pyx_mstate->__pyx_n_u_lx, __pyx_mstate->__pyx_n_u_ly, __pyx_mstate->__pyx_n_u_lz, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_da};
    __pyx_mstate_global->__pyx_codeobj_tab[1588] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_duplicate, __pyx_mstate->__pyx_kp_b_iso88591_A_Oq_1_IQ2_Zq_q_q_q_A_A_a_4q_A_C, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1588])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 217};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim};
    __pyx_mstate_global->__pyx_codeobj_tab[1589] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_setDim, __pyx_mstate->__pyx_kp_b_iso88591_t_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1589])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 234};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1590] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getDim, __pyx_mstate->__pyx_kp_b_iso88591_t_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1590])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 246};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dof, __pyx_mstate->__pyx_n_u_ndof};
    __pyx_mstate_global->__pyx_codeobj_tab[1591] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_setDof, __pyx_mstate->__pyx_kp_b_iso88591_U_1_az_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1591])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 264};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dof};
    __pyx_mstate_global->__pyx_codeobj_tab[1592] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getDof, __pyx_mstate->__pyx_kp_b_iso88591_A_a_4q_q_q_E_q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1592])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 284};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sizes, __pyx_mstate->__pyx_n_u_gsizes, __pyx_mstate->__pyx_n_u_gdim, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_dim};
    __pyx_mstate_global->__pyx_codeobj_tab[1593] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_setSizes, __pyx_mstate->__pyx_kp_b_iso88591_m1_E_Q_vQhas_3aq_A_az_e1A_4s_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1593])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 311};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_P};
    __pyx_mstate_global->__pyx_codeobj_tab[1594] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getSizes, __pyx_mstate->__pyx_kp_b_iso88591_A_a_4q_A_Cq_1A_q_q_vQe3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1594])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 334};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_proc_sizes, __pyx_mstate->__pyx_n_u_psizes, __pyx_mstate->__pyx_n_u_pdim, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_dim};
    __pyx_mstate_global->__pyx_codeobj_tab[1595] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_setProcSizes, __pyx_mstate->__pyx_kp_b_iso88591_A_E_Q_vQhas_3aq_A_az_e1A_4s_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1595])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 361};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p};
    __pyx_mstate_global->__pyx_codeobj_tab[1596] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getProcSizes, __pyx_mstate->__pyx_kp_b_iso88591_a_A_a_4q_A_q_Cq_1A_q_vQe3c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1596])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 384};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_boundary_type, __pyx_mstate->__pyx_n_u_btx, __pyx_mstate->__pyx_n_u_bty, __pyx_mstate->__pyx_n_u_btz};
    __pyx_mstate_global->__pyx_codeobj_tab[1597] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_setBoundaryType, __pyx_mstate->__pyx_kp_b_iso88591_A_J_q_q_q_5_aq_a_4uE_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1597])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 407};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_btx, __pyx_mstate->__pyx_n_u_bty, __pyx_mstate->__pyx_n_u_btz};
    __pyx_mstate_global->__pyx_codeobj_tab[1598] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getBoundaryType, __pyx_mstate->__pyx_kp_b_iso88591_A_q_q_q_a_4q_A_q_q_E_q_vQe5_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1598])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 430};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stencil_type, __pyx_mstate->__pyx_n_u_stype};
    __pyx_mstate_global->__pyx_codeobj_tab[1599] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_setStencilType, __pyx_mstate->__pyx_kp_b_iso88591_1_1A_a_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1599])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 448};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stype};
    __pyx_mstate_global->__pyx_codeobj_tab[1600] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getStencilType, __pyx_mstate->__pyx_kp_b_iso88591_a_4q_q_q_q_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1600])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 468};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stencil_width, __pyx_mstate->__pyx_n_u_swidth};
    __pyx_mstate_global->__pyx_codeobj_tab[1601] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_setStencilWidth, __pyx_mstate->__pyx_kp_b_iso88591_XQ_uAQ_a_4uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1601])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 486};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_swidth};
    __pyx_mstate_global->__pyx_codeobj_tab[1602] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getStencilWidth, __pyx_mstate->__pyx_kp_b_iso88591_q_a_4q_q_q_q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1602])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 506};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stencil_type, __pyx_mstate->__pyx_n_u_stencil_width, __pyx_mstate->__pyx_n_u_stype, __pyx_mstate->__pyx_n_u_swidth};
    __pyx_mstate_global->__pyx_codeobj_tab[1603] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_setStencil, __pyx_mstate->__pyx_kp_b_iso88591_A_q_1A_uAQ_a_e1_a_4uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1603])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 532};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stype, __pyx_mstate->__pyx_n_u_swidth};
    __pyx_mstate_global->__pyx_codeobj_tab[1604] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getStencil, __pyx_mstate->__pyx_kp_b_iso88591_A_q_a_4q_q_q_q_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1604])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 555};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_z, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p};
    __pyx_mstate_global->__pyx_codeobj_tab[1605] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getRanges, __pyx_mstate->__pyx_kp_b_iso88591_1_uE_e5_az_e1A_a_Qd_s_3aq_s_3aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1605])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 577};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_z, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p};
    __pyx_mstate_global->__pyx_codeobj_tab[1606] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getGhostRanges, __pyx_mstate->__pyx_kp_b_iso88591_uE_e5_az_e1A_a_4q_Cq_1A_Cq_1A_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1606])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 597};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_lx, __pyx_mstate->__pyx_n_u_ly, __pyx_mstate->__pyx_n_u_lz};
    __pyx_mstate_global->__pyx_codeobj_tab[1607] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getOwnershipRanges, __pyx_mstate->__pyx_kp_b_iso88591_A_uE_l_a_4q_A_q_Cq_1A_q_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1607])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 622};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_z, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p};
    __pyx_mstate_global->__pyx_codeobj_tab[1608] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getCorners, __pyx_mstate->__pyx_kp_b_iso88591_A_uE_e5_az_e1A_a_Qd_s_3aq_s_3aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1608])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 651};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_z, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p};
    __pyx_mstate_global->__pyx_codeobj_tab[1609] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getGhostCorners, __pyx_mstate->__pyx_kp_b_iso88591_uE_e5_az_e1A_a_4q_Cq_1A_Cq_1A_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1609])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 675};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1610] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_setFieldName, __pyx_mstate->__pyx_kp_b_iso88591_XQ_U_1_y_q_a_q_E_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1610])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 699};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1611] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getFieldName, __pyx_mstate->__pyx_kp_b_iso88591_U_1_a_q_E_q_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1611])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 723};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_readonly};
    __pyx_mstate_global->__pyx_codeobj_tab[1612] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getVecArray, __pyx_mstate->__pyx_kp_b_iso88591_WJa_avU, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1612])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 744};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_xmin, __pyx_mstate->__pyx_n_u_xmax, __pyx_mstate->__pyx_n_u_ymin, __pyx_mstate->__pyx_n_u_ymax, __pyx_mstate->__pyx_n_u_zmin, __pyx_mstate->__pyx_n_u_zmax, __pyx_mstate->__pyx_n_u_xmin_2, __pyx_mstate->__pyx_n_u_xmax_2, __pyx_mstate->__pyx_n_u_ymin_2, __pyx_mstate->__pyx_n_u_ymax_2, __pyx_mstate->__pyx_n_u_zmin_2, __pyx_mstate->__pyx_n_u_zmax_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1613] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_setUniformCoordinates, __pyx_mstate->__pyx_kp_b_iso88591_A_a_a_a_a_a_fA_vQoV1A_vQoV1A_vQo, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1613])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 788};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1614] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_setCoordinateName, __pyx_mstate->__pyx_kp_b_iso88591_U_1_y_q_a_AT_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1614])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 810};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1615] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getCoordinateName, __pyx_mstate->__pyx_kp_b_iso88591_xq_U_1_a_AT_fAQ_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1615])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 832};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vn};
    __pyx_mstate_global->__pyx_codeobj_tab[1616] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_createNaturalVec, __pyx_mstate->__pyx_kp_b_iso88591_c_a_at5_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1616])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 849};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vg, __pyx_mstate->__pyx_n_u_vn, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_im};
    __pyx_mstate_global->__pyx_codeobj_tab[1617] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_globalToNatural, __pyx_mstate->__pyx_kp_b_iso88591_A_1_AQ_a_q_E_6_Rq_a_Qd_r_t2Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1617])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 879};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vn, __pyx_mstate->__pyx_n_u_vg, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_im};
    __pyx_mstate_global->__pyx_codeobj_tab[1618] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_naturalToGlobal, __pyx_mstate->__pyx_kp_b_iso88591_A_1_AQ_a_q_E_6_Rq_a_Qd_r_t2Q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1618])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 909};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ao};
    __pyx_mstate_global->__pyx_codeobj_tab[1619] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getAO, __pyx_mstate->__pyx_kp_b_iso88591_q_Rq_ay_U_2Q_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1619])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 930};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_l2g, __pyx_mstate->__pyx_n_u_g2l};
    __pyx_mstate_global->__pyx_codeobj_tab[1620] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getScatter, __pyx_mstate->__pyx_kp_b_iso88591_A_7_7_a_Qd_q_6_Q_a_3a_a_3a_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1620])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 949};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_refine_x, __pyx_mstate->__pyx_n_u_refine_y, __pyx_mstate->__pyx_n_u_refine_z, __pyx_mstate->__pyx_n_u_refine};
    __pyx_mstate_global->__pyx_codeobj_tab[1621] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_setRefinementFactor, __pyx_mstate->__pyx_kp_b_iso88591_A_a_auE_auE_auE_a_at1_Qa_Qa_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1621])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 981};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_refine, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[1622] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getRefinementFactor, __pyx_mstate->__pyx_kp_b_iso88591_Q_A_az_e1A_a_at1_aq_aq_aq_uAQe1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1622])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 999};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_interp_type, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1623] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_setInterpolationType, __pyx_mstate->__pyx_kp_b_iso88591_00Fa_0_B_1_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1623])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1020};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1624] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getInterpolationType, __pyx_mstate->__pyx_kp_b_iso88591_a_0q_a_q_E_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1624])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1036};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_elem_type, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1625] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_setElementType, __pyx_mstate->__pyx_kp_b_iso88591_a_aq_a_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1625])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1050};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1626] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getElementType, __pyx_mstate->__pyx_kp_b_iso88591_a_e1A_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1626])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1064};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_elem_type, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_etype, __pyx_mstate->__pyx_n_u_nel, __pyx_mstate->__pyx_n_u_nen, __pyx_mstate->__pyx_n_u_elems, __pyx_mstate->__pyx_n_u_elements};
    __pyx_mstate_global->__pyx_codeobj_tab[1627] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMDA_pyx, __pyx_mstate->__pyx_n_u_getElements, __pyx_mstate->__pyx_kp_b_iso88591_1_1_az_e1A_WA_M_Qd_q_4uAU_5_was, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1627])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 14};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1628] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_Q_a_1G1A_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1628])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 17, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 35};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_cells, __pyx_mstate->__pyx_n_u_coords, __pyx_mstate->__pyx_n_u_interpolate, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_interp, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_cdim, __pyx_mstate->__pyx_n_u_numCells, __pyx_mstate->__pyx_n_u_numCorners, __pyx_mstate->__pyx_n_u_cellVertices, __pyx_mstate->__pyx_n_u_numVertices, __pyx_mstate->__pyx_n_u_spaceDim, __pyx_mstate->__pyx_n_u_vertexCoords, __pyx_mstate->__pyx_n_u_npy_flags};
    __pyx_mstate_global->__pyx_codeobj_tab[1629] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createFromCellList, __pyx_mstate->__pyx_kp_b_iso88591_l2IIggu_v_B_B_P_P_Y_Y_Z_0_xq_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1629])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {10, 0, 0, 22, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 90};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_faces, __pyx_mstate->__pyx_n_u_lower, __pyx_mstate->__pyx_n_u_upper, __pyx_mstate->__pyx_n_u_simplex, __pyx_mstate->__pyx_n_u_periodic, __pyx_mstate->__pyx_n_u_interpolate, __pyx_mstate->__pyx_n_u_localizationHeight, __pyx_mstate->__pyx_n_u_sparseLocalize, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_cfaces, __pyx_mstate->__pyx_n_u_clower, __pyx_mstate->__pyx_n_u_cupper, __pyx_mstate->__pyx_n_u_btype, __pyx_mstate->__pyx_n_u_csimplex, __pyx_mstate->__pyx_n_u_cinterp, __pyx_mstate->__pyx_n_u_clocalizationHeight, __pyx_mstate->__pyx_n_u_csparseLocalize, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1630] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createBoxMesh, __pyx_mstate->__pyx_kp_b_iso88591_99SSVVYYdd_B_B_E_E_F_bbv_w_E_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1630])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 149};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_faces, __pyx_mstate->__pyx_n_u_lower, __pyx_mstate->__pyx_n_u_upper, __pyx_mstate->__pyx_n_u_interpolate, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_cfaces, __pyx_mstate->__pyx_n_u_clower, __pyx_mstate->__pyx_n_u_cupper, __pyx_mstate->__pyx_n_u_cinterp, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1631] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createBoxSurfaceMesh, __pyx_mstate->__pyx_kp_b_iso88591_ZZ_k_l_F_F_I_I_L_L_M_8_NR_2_A_M, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1631])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 192};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_plexname, __pyx_mstate->__pyx_n_u_interpolate, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_interp, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_cfile, __pyx_mstate->__pyx_n_u_pname};
    __pyx_mstate_global->__pyx_codeobj_tab[1632] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createFromFile, __pyx_mstate->__pyx_kp_b_iso88591_mC_iiu_v_D_D_M_M_N_xq_a_q_9AZq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1632])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 226};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cgid, __pyx_mstate->__pyx_n_u_interpolate, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_interp, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_ccgid};
    __pyx_mstate_global->__pyx_codeobj_tab[1633] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createCGNS, __pyx_mstate->__pyx_kp_b_iso88591_1_Ybbc_xq_a_q_uAQ_a_q_whaq_az_h, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1633])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 254};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_interpolate, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_interp, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_cfile};
    __pyx_mstate_global->__pyx_codeobj_tab[1634] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createCGNSFromFile, __pyx_mstate->__pyx_kp_b_iso88591_Weenno_xq_a_q_9AZq_a_q_whaq_az, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1634])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 283};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_interpolate, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_interp, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_cfile};
    __pyx_mstate_global->__pyx_codeobj_tab[1635] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createExodusFromFile, __pyx_mstate->__pyx_kp_b_iso88591_Yggppq_xq_a_q_9AZq_a_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1635])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 312};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_exoid, __pyx_mstate->__pyx_n_u_interpolate, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_interp, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_cexoid};
    __pyx_mstate_global->__pyx_codeobj_tab[1636] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createExodus, __pyx_mstate->__pyx_kp_b_iso88591_4N_n_eef_xq_a_q_Qa_a_xxq_az_hd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1636])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 339};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_interpolate, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_interp, __pyx_mstate->__pyx_n_u_newdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1637] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createGmsh, __pyx_mstate->__pyx_kp_b_iso88591_5_ffg_xq_a_q_a_q_vV81A_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1637])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 377};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_degree, __pyx_mstate->__pyx_n_u_localized, __pyx_mstate->__pyx_n_u_project, __pyx_mstate->__pyx_n_u_cdegree, __pyx_mstate->__pyx_n_u_clocalized, __pyx_mstate->__pyx_n_u_cproject};
    __pyx_mstate_global->__pyx_codeobj_tab[1638] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createCoordinateSpace, __pyx_mstate->__pyx_kp_b_iso88591_O9TU_Qa_A_a_4uI, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1638])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 401};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_hasLagrange, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_cvalue, __pyx_mstate->__pyx_n_u_subdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1639] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createCohesiveSubmesh, __pyx_mstate->__pyx_kp_b_iso88591_1_ha_a_uAQ_a_a_4uF_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1639])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 424};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_depth, __pyx_mstate->__pyx_n_u_distance, __pyx_mstate->__pyx_n_u_cdepth, __pyx_mstate->__pyx_n_u_cdistance, __pyx_mstate->__pyx_n_u_ncolors, __pyx_mstate->__pyx_n_u_iscolors, __pyx_mstate->__pyx_n_u_coloring, __pyx_mstate->__pyx_n_u_isets, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[1640] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createColoring, __pyx_mstate->__pyx_kp_b_iso88591_F_vV1_uAQ_q_1_a_1D_X_a_az_AYaq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1640])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 453};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_label, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_ignoreHalo, __pyx_mstate->__pyx_n_u_sanitizeSubMesh, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_subdm, __pyx_mstate->__pyx_n_u_clbl, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_dmcomm, __pyx_mstate->__pyx_n_u_cvalue, __pyx_mstate->__pyx_n_u_cignoreHalo, __pyx_mstate->__pyx_n_u_csanitize, __pyx_mstate->__pyx_n_u_sf};
    __pyx_mstate_global->__pyx_codeobj_tab[1641] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_kp_b_iso88591_GYY_a_N_10_a_a_q_Q_1_Rq_6_JfA_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1641])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 495};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pStart, __pyx_mstate->__pyx_n_u_pEnd};
    __pyx_mstate_global->__pyx_codeobj_tab[1642] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getChart, __pyx_mstate->__pyx_kp_b_iso88591_z_a_Qd_q_uAYe1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1642])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 516};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pStart, __pyx_mstate->__pyx_n_u_pEnd, __pyx_mstate->__pyx_n_u_cStart, __pyx_mstate->__pyx_n_u_cEnd};
    __pyx_mstate_global->__pyx_codeobj_tab[1643] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setChart, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_uAQ_a_Qd_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1643])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 537};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_pStart, __pyx_mstate->__pyx_n_u_pEnd, __pyx_mstate->__pyx_n_u_csize};
    __pyx_mstate_global->__pyx_codeobj_tab[1644] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getConeSize, __pyx_mstate->__pyx_kp_b_iso88591_XQ_5_z_a_Qd_q_r_7_b_a_a_U_aq_uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1644])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 561};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_pStart, __pyx_mstate->__pyx_n_u_pEnd, __pyx_mstate->__pyx_n_u_csize};
    __pyx_mstate_global->__pyx_codeobj_tab[1645] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setConeSize, __pyx_mstate->__pyx_kp_b_iso88591_5_z_a_Qd_q_r_7_b_e1A_a_U_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1645])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 586};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_pStart, __pyx_mstate->__pyx_n_u_pEnd, __pyx_mstate->__pyx_n_u_ncone, __pyx_mstate->__pyx_n_u_icone};
    __pyx_mstate_global->__pyx_codeobj_tab[1646] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getCone, __pyx_mstate->__pyx_kp_b_iso88591_5_z_a_Qd_q_r_7_b_Q_Q_a_U_aq_a_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1646])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 612};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_cone, __pyx_mstate->__pyx_n_u_orientation, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_pStart, __pyx_mstate->__pyx_n_u_pEnd, __pyx_mstate->__pyx_n_u_ncone, __pyx_mstate->__pyx_n_u_icone, __pyx_mstate->__pyx_n_u_norie, __pyx_mstate->__pyx_n_u_iorie};
    __pyx_mstate_global->__pyx_codeobj_tab[1647] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setCone, __pyx_mstate->__pyx_kp_b_iso88591_WW_a_5_z_a_Qd_q_r_7_b_q_q_xq_aw, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1647])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 651};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_conePos, __pyx_mstate->__pyx_n_u_conePoint, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_cconePos, __pyx_mstate->__pyx_n_u_cconePoint};
    __pyx_mstate_global->__pyx_codeobj_tab[1648] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_insertCone, __pyx_mstate->__pyx_kp_b_iso88591_N_5_aq_5_a_q_E_Zq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1648])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 676};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_conePos, __pyx_mstate->__pyx_n_u_coneOrientation, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_cconePos, __pyx_mstate->__pyx_n_u_cconeOrientation};
    __pyx_mstate_global->__pyx_codeobj_tab[1649] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_insertConeOrientation, __pyx_mstate->__pyx_kp_b_iso88591_5K8ST_5_aq_aq_a_4uD, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1649])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 701};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_pStart, __pyx_mstate->__pyx_n_u_pEnd, __pyx_mstate->__pyx_n_u_norie, __pyx_mstate->__pyx_n_u_iorie};
    __pyx_mstate_global->__pyx_codeobj_tab[1650] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getConeOrientation, __pyx_mstate->__pyx_kp_b_iso88591_HA_5_z_a_Qd_q_r_7_b_Q_Q_a_U_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1650])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 727};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_orientation, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_pStart, __pyx_mstate->__pyx_n_u_pEnd, __pyx_mstate->__pyx_n_u_ncone, __pyx_mstate->__pyx_n_u_norie, __pyx_mstate->__pyx_n_u_iorie};
    __pyx_mstate_global->__pyx_codeobj_tab[1651] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setConeOrientation, __pyx_mstate->__pyx_kp_b_iso88591_66H_5_z_a_Qd_q_r_7_b_a_a_U_aq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1651])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 758};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_ctype, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[1652] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setCellType, __pyx_mstate->__pyx_kp_b_iso88591_Q_5_q_a_U_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1652])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 780};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[1653] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getCellType, __pyx_mstate->__pyx_kp_b_iso88591_XQ_5_a_U_aq_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1653])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 801};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_label};
    __pyx_mstate_global->__pyx_codeobj_tab[1654] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getCellTypeLabel, __pyx_mstate->__pyx_kp_b_iso88591_WA_a_Qd_q_Q_a_5_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1654])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 817};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_pStart, __pyx_mstate->__pyx_n_u_pEnd, __pyx_mstate->__pyx_n_u_ssize};
    __pyx_mstate_global->__pyx_codeobj_tab[1655] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getSupportSize, __pyx_mstate->__pyx_kp_b_iso88591_5_z_a_Qd_q_r_7_b_a_a_1D_T_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1655])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 841};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_size, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_pStart, __pyx_mstate->__pyx_n_u_pEnd, __pyx_mstate->__pyx_n_u_ssize};
    __pyx_mstate_global->__pyx_codeobj_tab[1656] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setSupportSize, __pyx_mstate->__pyx_kp_b_iso88591_81_5_z_a_Qd_q_r_7_b_e1A_a_1D_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1656])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 866};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_pStart, __pyx_mstate->__pyx_n_u_pEnd, __pyx_mstate->__pyx_n_u_nsupp, __pyx_mstate->__pyx_n_u_isupp};
    __pyx_mstate_global->__pyx_codeobj_tab[1657] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getSupport, __pyx_mstate->__pyx_kp_b_iso88591_HA_5_z_a_Qd_q_r_7_b_Q_Q_a_1D_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1657])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 892};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_supp, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_pStart, __pyx_mstate->__pyx_n_u_pEnd, __pyx_mstate->__pyx_n_u_nsupp, __pyx_mstate->__pyx_n_u_isupp};
    __pyx_mstate_global->__pyx_codeobj_tab[1658] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setSupport, __pyx_mstate->__pyx_kp_b_iso88591_K_9_5_z_a_Qd_q_r_7_b_q_q_xq_awa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1658])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 921};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_maxConeSize, __pyx_mstate->__pyx_n_u_maxSupportSize};
    __pyx_mstate_global->__pyx_codeobj_tab[1659] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getMaxSizes, __pyx_mstate->__pyx_kp_b_iso88591_Q_8_a_U_uA_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1659])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 943};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1660] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_symmetrize, __pyx_mstate->__pyx_kp_b_iso88591_A_a_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1660])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 956};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1661] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_stratify, __pyx_mstate->__pyx_kp_b_iso88591_a_Qd_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1661])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 968};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1662] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_orient, __pyx_mstate->__pyx_kp_b_iso88591_a_1D_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1662])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 980};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset};
    __pyx_mstate_global->__pyx_codeobj_tab[1663] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getCellNumbering, __pyx_mstate->__pyx_kp_b_iso88591_r_a_Qd_q_A_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1663])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 995};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset};
    __pyx_mstate_global->__pyx_codeobj_tab[1664] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getVertexNumbering, __pyx_mstate->__pyx_kp_b_iso88591_A_r_a_q_E_a_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1664])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1010};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset};
    __pyx_mstate_global->__pyx_codeobj_tab[1665] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createPointNumbering, __pyx_mstate->__pyx_kp_b_iso88591_a_r_a_e1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1665])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1024};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_depth};
    __pyx_mstate_global->__pyx_codeobj_tab[1666] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getDepth, __pyx_mstate->__pyx_kp_b_iso88591_a_a_Qd_q_uAQ_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1666])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1039};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_svalue, __pyx_mstate->__pyx_n_u_csvalue, __pyx_mstate->__pyx_n_u_sStart, __pyx_mstate->__pyx_n_u_sEnd};
    __pyx_mstate_global->__pyx_codeobj_tab[1667] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getDepthStratum, __pyx_mstate->__pyx_kp_b_iso88591_ha_Q_8_a_AT_iq_QiuAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1667])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1066};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_svalue, __pyx_mstate->__pyx_n_u_csvalue, __pyx_mstate->__pyx_n_u_sStart, __pyx_mstate->__pyx_n_u_sEnd};
    __pyx_mstate_global->__pyx_codeobj_tab[1668] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getHeightStratum, __pyx_mstate->__pyx_kp_b_iso88591_xq_Q_8_a_Qd_y_QiuAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1668])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1093};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_depth};
    __pyx_mstate_global->__pyx_codeobj_tab[1669] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getPointDepth, __pyx_mstate->__pyx_kp_b_iso88591_81_uAQ_a_a_4uHAQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1669])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1114};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_height};
    __pyx_mstate_global->__pyx_codeobj_tab[1670] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getPointHeight, __pyx_mstate->__pyx_kp_b_iso88591_HA_uAQ_q_a_1D_XQa_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1670])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1135};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_points, __pyx_mstate->__pyx_n_u_numPoints, __pyx_mstate->__pyx_n_u_ipoints, __pyx_mstate->__pyx_n_u_numCoveringPoints, __pyx_mstate->__pyx_n_u_coveringPoints};
    __pyx_mstate_global->__pyx_codeobj_tab[1671] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getMeet, __pyx_mstate->__pyx_kp_b_iso88591_0_1_1_a_aq_a_AT_k_Naq_7_a_AT_k, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1671])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1161};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_points, __pyx_mstate->__pyx_n_u_numPoints, __pyx_mstate->__pyx_n_u_ipoints, __pyx_mstate->__pyx_n_u_numCoveringPoints, __pyx_mstate->__pyx_n_u_coveringPoints};
    __pyx_mstate_global->__pyx_codeobj_tab[1672] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getJoin, __pyx_mstate->__pyx_kp_b_iso88591_0_1_1_a_aq_a_AT_k_Naq_7_a_AT_k, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1672])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1187};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_points, __pyx_mstate->__pyx_n_u_numPoints, __pyx_mstate->__pyx_n_u_ipoints, __pyx_mstate->__pyx_n_u_numCoveringPoints, __pyx_mstate->__pyx_n_u_coveringPoints};
    __pyx_mstate_global->__pyx_codeobj_tab[1673] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getFullJoin, __pyx_mstate->__pyx_kp_b_iso88591_4A_1_1_a_aq_a_U_Ya_RRSST_7_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1673])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1213};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_useCone, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_pStart, __pyx_mstate->__pyx_n_u_pEnd, __pyx_mstate->__pyx_n_u_cuseCone, __pyx_mstate->__pyx_n_u_numPoints, __pyx_mstate->__pyx_n_u_points, __pyx_mstate->__pyx_n_u_out};
    __pyx_mstate_global->__pyx_codeobj_tab[1674] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getTransitiveClosure, __pyx_mstate->__pyx_kp_b_iso88591_nN_12_5_z_a_Qd_q_r_7_b_1_a_e4z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1674])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1252};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sec, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_csize, __pyx_mstate->__pyx_n_u_cvals, __pyx_mstate->__pyx_n_u_closure};
    __pyx_mstate_global->__pyx_codeobj_tab[1675] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_vecGetClosure, __pyx_mstate->__pyx_kp_b_iso88591_5XQ_5_Q_a_4uCvS_d_7_1_gQgQ_4uCv, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1675])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1280};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sec, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_csec, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_csize, __pyx_mstate->__pyx_n_u_cvals, __pyx_mstate->__pyx_n_u_closure};
    __pyx_mstate_global->__pyx_codeobj_tab[1676] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getVecClosure, __pyx_mstate->__pyx_kp_b_iso88591_A_HD_z_5_1_a_4uF_V4q_q_gQgQ_4uF, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1676])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 12, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1310};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sec, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_csec, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_csize, __pyx_mstate->__pyx_n_u_cvals, __pyx_mstate->__pyx_n_u_unused, __pyx_mstate->__pyx_n_u_im};
    __pyx_mstate_global->__pyx_codeobj_tab[1677] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setVecClosure, __pyx_mstate->__pyx_kp_b_iso88591_A_Nff_H_H_I_0_HD_z_5_a_XQhawaq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1677])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 14, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1342};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sec, __pyx_mstate->__pyx_n_u_gsec, __pyx_mstate->__pyx_n_u_mat, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_values, __pyx_mstate->__pyx_n_u_addv, __pyx_mstate->__pyx_n_u_csec, __pyx_mstate->__pyx_n_u_cgsec, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_csize, __pyx_mstate->__pyx_n_u_cvals, __pyx_mstate->__pyx_n_u_unused, __pyx_mstate->__pyx_n_u_im};
    __pyx_mstate_global->__pyx_codeobj_tab[1678] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setMatClosure, __pyx_mstate->__pyx_kp_b_iso88591_A_33KKccllm6_HD_z_he7_A_5_a_XQha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1678])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1379};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_boundary, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_interpolate, __pyx_mstate->__pyx_n_u_interp, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_newdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1679] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_generate, __pyx_mstate->__pyx_kp_b_iso88591_m_Nn_eef_6_q_a_Qhe7_1_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1679])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1407};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_opts, __pyx_mstate->__pyx_n_u_copts};
    __pyx_mstate_global->__pyx_codeobj_tab[1680] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setTriangleOptions, __pyx_mstate->__pyx_kp_b_iso88591_xq_y_q_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1680])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1427};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_opts, __pyx_mstate->__pyx_n_u_copts};
    __pyx_mstate_global->__pyx_codeobj_tab[1681] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setTetGenOptions, __pyx_mstate->__pyx_kp_b_iso88591_XQ_y_q_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1681])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1447};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_label, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_clbl};
    __pyx_mstate_global->__pyx_codeobj_tab[1682] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_markBoundaryFaces, __pyx_mstate->__pyx_kp_b_iso88591_Q_6_gU_1_4t9AQ_AQ_az_e6_a_at5_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1682])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1474};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_label};
    __pyx_mstate_global->__pyx_codeobj_tab[1683] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_labelComplete, __pyx_mstate->__pyx_kp_b_iso88591_a_a_4uE, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1683])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1491};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_label, __pyx_mstate->__pyx_n_u_bdlabel, __pyx_mstate->__pyx_n_u_bdvalue, __pyx_mstate->__pyx_n_u_flip, __pyx_mstate->__pyx_n_u_split, __pyx_mstate->__pyx_n_u_subdm, __pyx_mstate->__pyx_n_u_flg, __pyx_mstate->__pyx_n_u_flg2, __pyx_mstate->__pyx_n_u_val};
    __pyx_mstate_global->__pyx_codeobj_tab[1684] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_labelCohesiveComplete, __pyx_mstate->__pyx_kp_b_iso88591_MQ_11H_a_a_e1A_a_4uE_7_TYY_ddii, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1684])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1526};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_useAnchors, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1685] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setAdjacencyUseAnchors, __pyx_mstate->__pyx_kp_b_iso88591_1_a_a_1D_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1685])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1547};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1686] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getAdjacencyUseAnchors, __pyx_mstate->__pyx_kp_b_iso88591_a_a_1D_Qa_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1686])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1562};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_cp, __pyx_mstate->__pyx_n_u_nadj, __pyx_mstate->__pyx_n_u_iadj, __pyx_mstate->__pyx_n_u_adjacency};
    __pyx_mstate_global->__pyx_codeobj_tab[1687] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getAdjacency, __pyx_mstate->__pyx_kp_b_iso88591_ha_5_Q_a_a_e4q_aq_q_a_9AQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1687])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1587};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_part};
    __pyx_mstate_global->__pyx_codeobj_tab[1688] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setPartitioner, __pyx_mstate->__pyx_kp_b_iso88591_2_a_1D_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1688])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1605};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_part};
    __pyx_mstate_global->__pyx_codeobj_tab[1689] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getPartitioner, __pyx_mstate->__pyx_kp_b_iso88591_1_a_1D_Qd_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1689])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1622};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_entityDepth, __pyx_mstate->__pyx_n_u_useInitialGuess, __pyx_mstate->__pyx_n_u_parallel, __pyx_mstate->__pyx_n_u_centityDepth, __pyx_mstate->__pyx_n_u_cuseInitialGuess, __pyx_mstate->__pyx_n_u_cparallel, __pyx_mstate->__pyx_n_u_csuccess};
    __pyx_mstate_global->__pyx_codeobj_tab[1690] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_rebalanceSharedPoints, __pyx_mstate->__pyx_kp_b_iso88591_1_RR_pp_H_H_I_6_U_1_6_a_4uNBTT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1690])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1656};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_overlap, __pyx_mstate->__pyx_n_u_dmParallel, __pyx_mstate->__pyx_n_u_coverlap, __pyx_mstate->__pyx_n_u_sf};
    __pyx_mstate_global->__pyx_codeobj_tab[1691] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_distribute, __pyx_mstate->__pyx_kp_b_iso88591_vQ_aq_Rq_a_q_E_1Be1A_c_Qd_fA_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1691])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1684};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_overlap, __pyx_mstate->__pyx_n_u_coverlap, __pyx_mstate->__pyx_n_u_sf, __pyx_mstate->__pyx_n_u_dmOverlap};
    __pyx_mstate_global->__pyx_codeobj_tab[1692] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_distributeOverlap, __pyx_mstate->__pyx_kp_b_iso88591_fA_aq_Rq_a_at5_q_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1692])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1713};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1693] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_isDistributed, __pyx_mstate->__pyx_kp_b_iso88591_q_a_a_4uAQ_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1693])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1727};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1694] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_isSimplex, __pyx_mstate->__pyx_kp_b_iso88591_1_a_a_at5_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1694])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1742};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dist};
    __pyx_mstate_global->__pyx_codeobj_tab[1695] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_distributeGetDefault, __pyx_mstate->__pyx_kp_b_iso88591_a_a_a_e1A_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1695])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1762};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_dist};
    __pyx_mstate_global->__pyx_codeobj_tab[1696] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_distributeSetDefault, __pyx_mstate->__pyx_kp_b_iso88591_fAQ_a_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1696])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1782};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1697] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_distributionSetName, __pyx_mstate->__pyx_kp_b_iso88591_5_q_9AV1A_a_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1697])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1803};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1698] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_distributionGetName, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_U_1_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1698])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1823};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_newdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1699] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_interpolate, __pyx_mstate->__pyx_kp_b_iso88591_Q_Q_a_U_1_az_hd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1699])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1838};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_newdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1700] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_uninterpolate, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_a_4uAQ_az_hd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1700])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1853};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf, __pyx_mstate->__pyx_n_u_sec, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_newsec, __pyx_mstate->__pyx_n_u_newvec, __pyx_mstate->__pyx_n_u_ccomm};
    __pyx_mstate_global->__pyx_codeobj_tab[1701] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_distributeField, __pyx_mstate->__pyx_kp_b_iso88591_A_8_a_7_V9G1_7_V9Cq_6_c_Qm3fAQ_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1701])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1898};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cminradius};
    __pyx_mstate_global->__pyx_codeobj_tab[1702] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getMinRadius, __pyx_mstate->__pyx_kp_b_iso88591_a_A_a_e1A_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1702])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1912};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fpoint};
    __pyx_mstate_global->__pyx_codeobj_tab[1703] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createCoarsePointIS, __pyx_mstate->__pyx_kp_b_iso88591_Q_1_a_U_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1703])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 21, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1932};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_numComp, __pyx_mstate->__pyx_n_u_numDof, __pyx_mstate->__pyx_n_u_bcField, __pyx_mstate->__pyx_n_u_bcComps, __pyx_mstate->__pyx_n_u_bcPoints, __pyx_mstate->__pyx_n_u_perm, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_ncomp, __pyx_mstate->__pyx_n_u_ndof, __pyx_mstate->__pyx_n_u_icomp, __pyx_mstate->__pyx_n_u_idof, __pyx_mstate->__pyx_n_u_nbc, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_bcfield, __pyx_mstate->__pyx_n_u_bccomps, __pyx_mstate->__pyx_n_u_bcpoints, __pyx_mstate->__pyx_n_u_unused1, __pyx_mstate->__pyx_n_u_unused2, __pyx_mstate->__pyx_n_u_cperm, __pyx_mstate->__pyx_n_u_sec};
    __pyx_mstate_global->__pyx_codeobj_tab[1704] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createSection, __pyx_mstate->__pyx_kp_b_iso88591_A_6oE_k_l_B_B_C_q_A_a_Qd_q_j_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1704])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2008};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_start, __pyx_mstate->__pyx_n_u_end, __pyx_mstate->__pyx_n_u_cpoint};
    __pyx_mstate_global->__pyx_codeobj_tab[1705] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getPointLocal, __pyx_mstate->__pyx_kp_b_iso88591_81_iq_uAQ_a_4uHAWAQ_uAXU_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1705])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2036};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_start, __pyx_mstate->__pyx_n_u_end, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cfield};
    __pyx_mstate_global->__pyx_codeobj_tab[1706] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getPointLocalField, __pyx_mstate->__pyx_kp_b_iso88591_HA2_iq_uAQ_uAQ_a_q_E_uAXU_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1706])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2067};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_start, __pyx_mstate->__pyx_n_u_end, __pyx_mstate->__pyx_n_u_cpoint};
    __pyx_mstate_global->__pyx_codeobj_tab[1707] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getPointGlobal, __pyx_mstate->__pyx_kp_b_iso88591_HA_iq_uAQ_a_1D_XQgQa_uAXU_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1707])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2095};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_start, __pyx_mstate->__pyx_n_u_end, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cfield};
    __pyx_mstate_global->__pyx_codeobj_tab[1708] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getPointGlobalField, __pyx_mstate->__pyx_kp_b_iso88591_XQ2_iq_uAQ_uAQ_a_U_7_1_uAXU_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1708])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2126};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sec, __pyx_mstate->__pyx_n_u_csec};
    __pyx_mstate_global->__pyx_codeobj_tab[1709] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createClosureIndex, __pyx_mstate->__pyx_kp_b_iso88591_9_HD_z_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1709])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2148};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_refinementUniform, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1710] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setRefinementUniform, __pyx_mstate->__pyx_kp_b_iso88591_6nIQ_a_a_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1710])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2168};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag};
    __pyx_mstate_global->__pyx_codeobj_tab[1711] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getRefinementUniform, __pyx_mstate->__pyx_kp_b_iso88591_a_a_a_e1A_vQa_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1711])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2189};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_refinementLimit, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1712] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setRefinementLimit, __pyx_mstate->__pyx_kp_b_iso88591_2_A_fAQ_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1712])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2209};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1713] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getRefinementLimit, __pyx_mstate->__pyx_kp_b_iso88591_A_a_a_q_E_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1713])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2225};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_otype, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_label, __pyx_mstate->__pyx_n_u_perm};
    __pyx_mstate_global->__pyx_codeobj_tab[1714] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getOrdering, __pyx_mstate->__pyx_kp_b_iso88591_6a_r_a_U_q_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1714])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2253};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_perm, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1715] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_permute, __pyx_mstate->__pyx_kp_b_iso88591_Qe1_a_AT_d_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1715])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2277};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_reorder};
    __pyx_mstate_global->__pyx_codeobj_tab[1716] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_reorderGetDefault, __pyx_mstate->__pyx_kp_b_iso88591_1_2_a_at5_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1716])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2291};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_reorder};
    __pyx_mstate_global->__pyx_codeobj_tab[1717] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_reorderSetDefault, __pyx_mstate->__pyx_kp_b_iso88591_2_a_at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1717])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2312};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cell, __pyx_mstate->__pyx_n_u_cdim, __pyx_mstate->__pyx_n_u_ccell, __pyx_mstate->__pyx_n_u_vol, __pyx_mstate->__pyx_n_u_centroid, __pyx_mstate->__pyx_n_u_normal};
    __pyx_mstate_global->__pyx_codeobj_tab[1718] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_computeCellGeometryFVM, __pyx_mstate->__pyx_kp_b_iso88591_812_Q_e1A_a_e1A_Q_a_1D_WAU_A_av, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1718])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2344};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_labelName, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_numGhostCells, __pyx_mstate->__pyx_n_u_dmGhosted};
    __pyx_mstate_global->__pyx_codeobj_tab[1719] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_constructGhostCells, __pyx_mstate->__pyx_kp_b_iso88591_1_IQk_a_a_U_az_hd_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1719])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2373};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset};
    __pyx_mstate_global->__pyx_codeobj_tab[1720] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getSubpointIS, __pyx_mstate->__pyx_kp_b_iso88591_q_r_a_4uAT_1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1720])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2393};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_label};
    __pyx_mstate_global->__pyx_codeobj_tab[1721] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getSubpointMap, __pyx_mstate->__pyx_kp_b_iso88591_WA_a_1D_Qe1_1E_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1721])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2415};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1722] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_a_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1722])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2428};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_uniform, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1723] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetUniform, __pyx_mstate->__pyx_kp_b_iso88591_fAQ_a_Qd_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1723])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2447};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_uniform};
    __pyx_mstate_global->__pyx_codeobj_tab[1724] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricIsUniform, __pyx_mstate->__pyx_kp_b_iso88591_a_AT_aq_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1724])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2462};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isotropic, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1725] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetIsotropic, __pyx_mstate->__pyx_kp_b_iso88591_IQ_fAQ_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1725])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2481};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isotropic};
    __pyx_mstate_global->__pyx_codeobj_tab[1726] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricIsIsotropic, __pyx_mstate->__pyx_kp_b_iso88591_1_1_a_at5_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1726])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2496};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_restrictAnisotropyFirst, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1727] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetRestrictAnisotropyFirst, __pyx_mstate->__pyx_kp_b_iso88591_H_QR_fAQ_a_5Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1727])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2515};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_restrictAnisotropyFirst};
    __pyx_mstate_global->__pyx_codeobj_tab[1728] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricRestrictAnisotropyFirst, __pyx_mstate->__pyx_kp_b_iso88591_q_2_a_2_4uAQ_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1728])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2530};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_noInsert, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1729] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetNoInsertion, __pyx_mstate->__pyx_kp_b_iso88591_Ya_fAQ_a_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1729])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2550};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_noInsert};
    __pyx_mstate_global->__pyx_codeobj_tab[1730] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricNoInsertion, __pyx_mstate->__pyx_kp_b_iso88591_1_a_at5_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1730])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2566};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_noSwap, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1731] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetNoSwapping, __pyx_mstate->__pyx_kp_b_iso88591_1_fAQ_a_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1731])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2586};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_noSwap};
    __pyx_mstate_global->__pyx_codeobj_tab[1732] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricNoSwapping, __pyx_mstate->__pyx_kp_b_iso88591_a_Qd_q_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1732])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2602};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_noMove, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1733] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetNoMovement, __pyx_mstate->__pyx_kp_b_iso88591_1_fAQ_a_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1733])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2622};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_noMove};
    __pyx_mstate_global->__pyx_codeobj_tab[1734] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricNoMovement, __pyx_mstate->__pyx_kp_b_iso88591_a_Qd_q_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1734])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2638};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_noSurf, __pyx_mstate->__pyx_n_u_bval};
    __pyx_mstate_global->__pyx_codeobj_tab[1735] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetNoSurf, __pyx_mstate->__pyx_kp_b_iso88591_iq_fAQ_a_AT_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1735])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2658};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_noSurf};
    __pyx_mstate_global->__pyx_codeobj_tab[1736] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricNoSurf, __pyx_mstate->__pyx_kp_b_iso88591_a_a_e1A_vQa_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1736])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2674};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_verbosity, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1737] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetVerbosity, __pyx_mstate->__pyx_kp_b_iso88591_HA_U_1_a_q_E_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1737])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2693};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_verbosity};
    __pyx_mstate_global->__pyx_codeobj_tab[1738] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricGetVerbosity, __pyx_mstate->__pyx_kp_b_iso88591_A_a_q_E_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1738])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2713};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_numIter, __pyx_mstate->__pyx_n_u_ival};
    __pyx_mstate_global->__pyx_codeobj_tab[1739] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetNumIterations, __pyx_mstate->__pyx_kp_b_iso88591_ha_U_1_a_1D_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1739])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2732};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_numIter};
    __pyx_mstate_global->__pyx_codeobj_tab[1740] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricGetNumIterations, __pyx_mstate->__pyx_kp_b_iso88591_a_1D_Qa_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1740])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2747};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_h_min, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1741] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetMinimumMagnitude, __pyx_mstate->__pyx_kp_b_iso88591_z_fAQ_a_at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1741])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2766};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_h_min};
    __pyx_mstate_global->__pyx_codeobj_tab[1742] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricGetMinimumMagnitude, __pyx_mstate->__pyx_kp_b_iso88591_1_q_a_at5_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1742])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2781};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_h_max, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1743] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetMaximumMagnitude, __pyx_mstate->__pyx_kp_b_iso88591_z_fAQ_a_at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1743])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2800};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_h_max};
    __pyx_mstate_global->__pyx_codeobj_tab[1744] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricGetMaximumMagnitude, __pyx_mstate->__pyx_kp_b_iso88591_1_q_a_at5_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1744])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2815};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_a_max, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1745] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetMaximumAnisotropy, __pyx_mstate->__pyx_kp_b_iso88591_0_fAQ_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1745])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2834};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_a_max};
    __pyx_mstate_global->__pyx_codeobj_tab[1746] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricGetMaximumAnisotropy, __pyx_mstate->__pyx_kp_b_iso88591_A_q_a_q_E_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1746])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2849};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_targetComplexity, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1747] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetTargetComplexity, __pyx_mstate->__pyx_kp_b_iso88591_A_fAQ_a_at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1747])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2868};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_targetComplexity};
    __pyx_mstate_global->__pyx_codeobj_tab[1748] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricGetTargetComplexity, __pyx_mstate->__pyx_kp_b_iso88591_1_a_at5_vQa_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1748])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2883};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1749] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetNormalizationOrder, __pyx_mstate->__pyx_kp_b_iso88591_Zq_fAQ_a_0_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1749])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2902};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p};
    __pyx_mstate_global->__pyx_codeobj_tab[1750] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricGetNormalizationOrder, __pyx_mstate->__pyx_kp_b_iso88591_Q_1_a_0_U_1_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1750])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2917};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_beta, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1751] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetGradationFactor, __pyx_mstate->__pyx_kp_b_iso88591_Zq_fAQ_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1751])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2936};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_beta};
    __pyx_mstate_global->__pyx_codeobj_tab[1752] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricGetGradationFactor, __pyx_mstate->__pyx_kp_b_iso88591_a_a_Qd_q_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1752])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2951};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_hausd, __pyx_mstate->__pyx_n_u_rval};
    __pyx_mstate_global->__pyx_codeobj_tab[1753] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricSetHausdorffNumber, __pyx_mstate->__pyx_kp_b_iso88591_j_fAQ_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1753])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2970};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_hausd};
    __pyx_mstate_global->__pyx_codeobj_tab[1754] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricGetHausdorffNumber, __pyx_mstate->__pyx_kp_b_iso88591_q_a_Qd_q_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1754])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2985};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_metric};
    __pyx_mstate_global->__pyx_codeobj_tab[1755] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricCreate, __pyx_mstate->__pyx_kp_b_iso88591_vQ_U_1_Q_a_e6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1755])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3006};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_alpha, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_rval, __pyx_mstate->__pyx_n_u_metric};
    __pyx_mstate_global->__pyx_codeobj_tab[1756] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricCreateUniform, __pyx_mstate->__pyx_kp_b_iso88591_F_e1A_fAQ_Q_a_U_avQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1756])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3030};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_indicator, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_metric};
    __pyx_mstate_global->__pyx_codeobj_tab[1757] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricCreateIsotropic, __pyx_mstate->__pyx_kp_b_iso88591_vQ_e1A_Q_a_4uF_6_PQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1757])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3053};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_field, __pyx_mstate->__pyx_n_u_ival, __pyx_mstate->__pyx_n_u_determinant, __pyx_mstate->__pyx_n_u_dmDet};
    __pyx_mstate_global->__pyx_codeobj_tab[1758] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricDeterminantCreate, __pyx_mstate->__pyx_kp_b_iso88591_e1A_s_a_AT_fA_auTU_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1758])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3082};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_metric, __pyx_mstate->__pyx_n_u_ometric, __pyx_mstate->__pyx_n_u_determinant, __pyx_mstate->__pyx_n_u_restrictSizes, __pyx_mstate->__pyx_n_u_restrictAnisotropy, __pyx_mstate->__pyx_n_u_bval_rs, __pyx_mstate->__pyx_n_u_bval_ra};
    __pyx_mstate_global->__pyx_codeobj_tab[1759] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricEnforceSPD, __pyx_mstate->__pyx_kp_b_iso88591_XXf_g_B_B_P_P_Z_Z_q_q_a_Qd_vV9I, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1759])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3118};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_metric, __pyx_mstate->__pyx_n_u_ometric, __pyx_mstate->__pyx_n_u_determinant, __pyx_mstate->__pyx_n_u_restrictSizes, __pyx_mstate->__pyx_n_u_restrictAnisotropy, __pyx_mstate->__pyx_n_u_bval_rs, __pyx_mstate->__pyx_n_u_bval_ra};
    __pyx_mstate_global->__pyx_codeobj_tab[1760] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricNormalize, __pyx_mstate->__pyx_kp_b_iso88591_WWee_N_N_W_W_X_q_q_a_AT_fF_9GSY, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1760])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3154};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_metric1, __pyx_mstate->__pyx_n_u_metric2, __pyx_mstate->__pyx_n_u_metricAvg};
    __pyx_mstate_global->__pyx_codeobj_tab[1761] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricAverage2, __pyx_mstate->__pyx_kp_b_iso88591_I_a_1D_WF_yPQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1761])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3176};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_metric1, __pyx_mstate->__pyx_n_u_metric2, __pyx_mstate->__pyx_n_u_metric3, __pyx_mstate->__pyx_n_u_metricAvg};
    __pyx_mstate_global->__pyx_codeobj_tab[1762] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricAverage3, __pyx_mstate->__pyx_kp_b_iso88591_VVW_a_1D_WF_wfT_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1762])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3200};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_metric1, __pyx_mstate->__pyx_n_u_metric2, __pyx_mstate->__pyx_n_u_metricInt};
    __pyx_mstate_global->__pyx_codeobj_tab[1763] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricIntersection2, __pyx_mstate->__pyx_kp_b_iso88591_Na_a_U_wfIUV_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1763])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3222};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_metric1, __pyx_mstate->__pyx_n_u_metric2, __pyx_mstate->__pyx_n_u_metric3, __pyx_mstate->__pyx_n_u_metricInt};
    __pyx_mstate_global->__pyx_codeobj_tab[1764] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_metricIntersection3, __pyx_mstate->__pyx_kp_b_iso88591_a_U_wfGSYYbbc_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1764])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3246};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_locX, __pyx_mstate->__pyx_n_u_locC};
    __pyx_mstate_global->__pyx_codeobj_tab[1765] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_computeGradientClementInterpolan, __pyx_mstate->__pyx_kp_b_iso88591_Gq_a_6at5_F_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1765])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3268};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer};
    __pyx_mstate_global->__pyx_codeobj_tab[1766] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_topologyView, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_e6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1766])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3286};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer};
    __pyx_mstate_global->__pyx_codeobj_tab[1767] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_coordinatesView, __pyx_mstate->__pyx_kp_b_iso88591_0_a_AT_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1767])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3304};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer};
    __pyx_mstate_global->__pyx_codeobj_tab[1768] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_labelsView, __pyx_mstate->__pyx_kp_b_iso88591_1_a_q_E_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1768])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3322};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_sectiondm};
    __pyx_mstate_global->__pyx_codeobj_tab[1769] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_sectionView, __pyx_mstate->__pyx_kp_b_iso88591_a_U_iq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1769])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3343};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_sectiondm, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1770] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_globalVectorView, __pyx_mstate->__pyx_kp_b_iso88591_H_a_Qd_vV9E_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1770])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3367};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_sectiondm, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1771] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_localVectorView, __pyx_mstate->__pyx_kp_b_iso88591_Gq_a_AT_fF_5_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1771])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3393};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_sf};
    __pyx_mstate_global->__pyx_codeobj_tab[1772] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_topologyLoad, __pyx_mstate->__pyx_kp_b_iso88591_Q_Rq_a_e6_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1772])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3419};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_sfxc};
    __pyx_mstate_global->__pyx_codeobj_tab[1773] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_coordinatesLoad, __pyx_mstate->__pyx_kp_b_iso88591_9_a_AT_fF_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1773])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3439};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_sfxc};
    __pyx_mstate_global->__pyx_codeobj_tab[1774] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_labelsLoad, __pyx_mstate->__pyx_kp_b_iso88591_4A_a_q_E_vT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1774])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3459};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_sectiondm, __pyx_mstate->__pyx_n_u_sfxc, __pyx_mstate->__pyx_n_u_gsf, __pyx_mstate->__pyx_n_u_lsf};
    __pyx_mstate_global->__pyx_codeobj_tab[1775] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_sectionLoad, __pyx_mstate->__pyx_kp_b_iso88591_C1_b_b_a_U_iuD_QcQVVWWZZ_uA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1775])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3496};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_sectiondm, __pyx_mstate->__pyx_n_u_sf, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1776] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_globalVectorLoad, __pyx_mstate->__pyx_kp_b_iso88591_Oq_a_Qd_vV9E_5PSST, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1776])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3521};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_sectiondm, __pyx_mstate->__pyx_n_u_sf, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1777] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_localVectorLoad, __pyx_mstate->__pyx_kp_b_iso88591_Na_a_AT_fF_5_sRS, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1777])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3546};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nv_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1778] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createNaturalVec, __pyx_mstate->__pyx_kp_b_iso88591_c_a_U_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1778])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3560};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nv_2, __pyx_mstate->__pyx_n_u_gv};
    __pyx_mstate_global->__pyx_codeobj_tab[1779] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_naturalToGlobalBegin, __pyx_mstate->__pyx_kp_b_iso88591_6a_a_e2V2Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1779])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3572};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nv_2, __pyx_mstate->__pyx_n_u_gv};
    __pyx_mstate_global->__pyx_codeobj_tab[1780] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_naturalToGlobalEnd, __pyx_mstate->__pyx_kp_b_iso88591_4A_a_q_E_6_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1780])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3584};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gv, __pyx_mstate->__pyx_n_u_nv_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1781] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_globalToNaturalBegin, __pyx_mstate->__pyx_kp_b_iso88591_6a_a_e2V2Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1781])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3596};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gv, __pyx_mstate->__pyx_n_u_nv_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1782] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_globalToNaturalEnd, __pyx_mstate->__pyx_kp_b_iso88591_4A_a_q_E_6_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1782])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3608};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf};
    __pyx_mstate_global->__pyx_codeobj_tab[1783] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setMigrationSF, __pyx_mstate->__pyx_kp_b_iso88591_q_a_1D_Rq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1783])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3620};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf};
    __pyx_mstate_global->__pyx_codeobj_tab[1784] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getMigrationSF, __pyx_mstate->__pyx_kp_b_iso88591_Rq_a_1D_Qb_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1784])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3635};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_section, __pyx_mstate->__pyx_n_u_sfMigration, __pyx_mstate->__pyx_n_u_sf};
    __pyx_mstate_global->__pyx_codeobj_tab[1785] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_createGlobalToNaturalSF, __pyx_mstate->__pyx_kp_b_iso88591_J_Rq_a_AT_gV_eSTTVVW_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1785])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3649};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dmOld, __pyx_mstate->__pyx_n_u_sfNaturalOld, __pyx_mstate->__pyx_n_u_sfMigration, __pyx_mstate->__pyx_n_u_sf};
    __pyx_mstate_global->__pyx_codeobj_tab[1786] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_migrateGlobalToNaturalSF, __pyx_mstate->__pyx_kp_b_iso88591_UUV_Rq_a_Qe5_E_UR_bbcceef_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1786])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3687};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm, __pyx_mstate->__pyx_n_u_newdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1787] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_apply, __pyx_mstate->__pyx_kp_b_iso88591_a_F_a_1D_RuAU_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1787])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3698};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newtr};
    __pyx_mstate_global->__pyx_codeobj_tab[1788] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_a_AWAQ_az_a_F_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1788])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3715};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1789] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_Qat1_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1789])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3728};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1790] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_Qd_q_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1790])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3742};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1791] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_a_1D_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1791])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3752};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tr_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1792] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_a_Q_1IQa_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1792])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3766};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1793] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setDM, __pyx_mstate->__pyx_kp_b_iso88591_a_a_1D_Rq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1793])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3775};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1794] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_AT_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1794])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3787};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[1795] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMPlex_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_4uA_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1795])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {11, 0, 0, 39, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 50};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_dofs, __pyx_mstate->__pyx_n_u_sizes, __pyx_mstate->__pyx_n_u_boundary_types, __pyx_mstate->__pyx_n_u_stencil_type, __pyx_mstate->__pyx_n_u_stencil_width, __pyx_mstate->__pyx_n_u_proc_sizes, __pyx_mstate->__pyx_n_u_ownership_ranges, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_n_u_ndim, __pyx_mstate->__pyx_n_u_gsizes, __pyx_mstate->__pyx_n_u_nsizes, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_P, __pyx_mstate->__pyx_n_u_cdofs, __pyx_mstate->__pyx_n_u_ndofs, __pyx_mstate->__pyx_n_u_dof0, __pyx_mstate->__pyx_n_u_dof1, __pyx_mstate->__pyx_n_u_dof2, __pyx_mstate->__pyx_n_u_dof3, __pyx_mstate->__pyx_n_u_btx, __pyx_mstate->__pyx_n_u_bty, __pyx_mstate->__pyx_n_u_btz, __pyx_mstate->__pyx_n_u_swidth, __pyx_mstate->__pyx_n_u_stype, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_psizes, __pyx_mstate->__pyx_n_u_nprocs, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_lx, __pyx_mstate->__pyx_n_u_ly, __pyx_mstate->__pyx_n_u_lz, __pyx_mstate->__pyx_n_u_nranges, __pyx_mstate->__pyx_n_u_newda};
    __pyx_mstate_global->__pyx_codeobj_tab[1796] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_A_q_PPQ_1_A_Q_Q_A_ZqR_U_1_Q_U_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1796])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 163};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_swidth, __pyx_mstate->__pyx_n_u_sw};
    __pyx_mstate_global->__pyx_codeobj_tab[1797] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_setStencilWidth, __pyx_mstate->__pyx_kp_b_iso88591_ha_5_a_AT_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1797])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 183};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stenciltype, __pyx_mstate->__pyx_n_u_stype};
    __pyx_mstate_global->__pyx_codeobj_tab[1798] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_setStencilType, __pyx_mstate->__pyx_kp_b_iso88591_M_a_1D_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1798])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 201};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_boundary_types, __pyx_mstate->__pyx_n_u_btx, __pyx_mstate->__pyx_n_u_bty, __pyx_mstate->__pyx_n_u_btz};
    __pyx_mstate_global->__pyx_codeobj_tab[1799] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_setBoundaryTypes, __pyx_mstate->__pyx_kp_b_iso88591_A_K1_q_q_q_1E_q_a_Qd_uE, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1799])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 224};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dofs, __pyx_mstate->__pyx_n_u_gdofs, __pyx_mstate->__pyx_n_u_dof0, __pyx_mstate->__pyx_n_u_dof1, __pyx_mstate->__pyx_n_u_dof2, __pyx_mstate->__pyx_n_u_dof3};
    __pyx_mstate_global->__pyx_codeobj_tab[1800] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_setDof, __pyx_mstate->__pyx_kp_b_iso88591_q_5_8881_awavQfAV1A_a_1D_V6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1800])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 246};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sizes, __pyx_mstate->__pyx_n_u_gsizes, __pyx_mstate->__pyx_n_u_M, __pyx_mstate->__pyx_n_u_N, __pyx_mstate->__pyx_n_u_P};
    __pyx_mstate_global->__pyx_codeobj_tab[1801] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_setGlobalSizes, __pyx_mstate->__pyx_kp_b_iso88591_8_E_U_81Cq_1A_a_1D_S_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1801])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 266};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sizes, __pyx_mstate->__pyx_n_u_psizes, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p};
    __pyx_mstate_global->__pyx_codeobj_tab[1802] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_setProcSizes, __pyx_mstate->__pyx_kp_b_iso88591_6a_E_8_81Cq_1A_a_U_S, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1802])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 286};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ranges, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_lx, __pyx_mstate->__pyx_n_u_ly, __pyx_mstate->__pyx_n_u_lz};
    __pyx_mstate_global->__pyx_codeobj_tab[1803] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_setOwnershipRanges, __pyx_mstate->__pyx_kp_b_iso88591_Gq_q_L_A_a_Qd_q_a_U_3as_1_Qhe1C, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1803])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 310};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1804] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getDim, __pyx_mstate->__pyx_kp_b_iso88591_t_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1804])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 318};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_epe};
    __pyx_mstate_global->__pyx_codeobj_tab[1805] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getEntriesPerElement, __pyx_mstate->__pyx_kp_b_iso88591_a_a_e1A_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1805])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 334};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_swidth};
    __pyx_mstate_global->__pyx_codeobj_tab[1806] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getStencilWidth, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_AT_aq_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1806])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 348};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_dof0, __pyx_mstate->__pyx_n_u_dof1, __pyx_mstate->__pyx_n_u_dof2, __pyx_mstate->__pyx_n_u_dof3};
    __pyx_mstate_global->__pyx_codeobj_tab[1807] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getDof, __pyx_mstate->__pyx_kp_b_iso88591_a_1D_QfAV1F_1_a_Qd_q_vQc_V6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1807])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 363};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_z, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_nExtrax, __pyx_mstate->__pyx_n_u_nExtray, __pyx_mstate->__pyx_n_u_nExtraz};
    __pyx_mstate_global->__pyx_codeobj_tab[1808] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getCorners, __pyx_mstate->__pyx_kp_b_iso88591_A_uE_e5_kYZ_a_Qd_q_a_q_E_Qc_Qc, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1808])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 385};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_y, __pyx_mstate->__pyx_n_u_z, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p};
    __pyx_mstate_global->__pyx_codeobj_tab[1809] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getGhostCorners, __pyx_mstate->__pyx_kp_b_iso88591_uE_e5_a_Qd_q_a_AT_as_3as_3as_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1809])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 400};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p};
    __pyx_mstate_global->__pyx_codeobj_tab[1810] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getLocalSizes, __pyx_mstate->__pyx_kp_b_iso88591_q_q_a_Qd_q_a_4uAS_AQ_z_s_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1810])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 417};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p};
    __pyx_mstate_global->__pyx_codeobj_tab[1811] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getGlobalSizes, __pyx_mstate->__pyx_kp_b_iso88591_q_a_Qd_q_a_1D_Qc_Qa_z_s_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1811])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 432};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p};
    __pyx_mstate_global->__pyx_codeobj_tab[1812] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getProcSizes, __pyx_mstate->__pyx_kp_b_iso88591_a_q_a_Qd_q_a_U_3as_1_z_s_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1812])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 447};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stype};
    __pyx_mstate_global->__pyx_codeobj_tab[1813] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getStencilType, __pyx_mstate->__pyx_kp_b_iso88591_A_a_1D_Qa_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1813])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 461};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_m, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_p, __pyx_mstate->__pyx_n_u_lx, __pyx_mstate->__pyx_n_u_ly, __pyx_mstate->__pyx_n_u_lz};
    __pyx_mstate_global->__pyx_codeobj_tab[1814] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getOwnershipRanges, __pyx_mstate->__pyx_kp_b_iso88591_A_uE_l_a_Qd_q_a_U_3as_1_a_q_E_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1814])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 478};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_btx, __pyx_mstate->__pyx_n_u_bty, __pyx_mstate->__pyx_n_u_btz};
    __pyx_mstate_global->__pyx_codeobj_tab[1815] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getBoundaryTypes, __pyx_mstate->__pyx_kp_b_iso88591_q_q_q_a_Qd_q_a_Qd_q_Qe1A_5_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1815])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 496};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rank0, __pyx_mstate->__pyx_n_u_rank1, __pyx_mstate->__pyx_n_u_rank2, __pyx_mstate->__pyx_n_u_dim};
    __pyx_mstate_global->__pyx_codeobj_tab[1816] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getIsFirstRank, __pyx_mstate->__pyx_kp_b_iso88591_00C1_a_Qd_q_a_1D_QgQgQa_z_wgQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1816])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 512};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_rank0, __pyx_mstate->__pyx_n_u_rank1, __pyx_mstate->__pyx_n_u_rank2, __pyx_mstate->__pyx_n_u_dim};
    __pyx_mstate_global->__pyx_codeobj_tab[1817] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getIsLastRank, __pyx_mstate->__pyx_kp_b_iso88591_q_00C1_a_Qd_q_a_4uAWAWAQ_z_wgQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1817])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 530};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_xmin, __pyx_mstate->__pyx_n_u_xmax, __pyx_mstate->__pyx_n_u_ymin, __pyx_mstate->__pyx_n_u_ymax, __pyx_mstate->__pyx_n_u_zmin, __pyx_mstate->__pyx_n_u_zmax, __pyx_mstate->__pyx_n_u_xmin_2, __pyx_mstate->__pyx_n_u_xmax_2, __pyx_mstate->__pyx_n_u_ymin_2, __pyx_mstate->__pyx_n_u_ymax_2, __pyx_mstate->__pyx_n_u_zmin_2, __pyx_mstate->__pyx_n_u_zmax_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1818] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_setUniformCoordinatesExplicit, __pyx_mstate->__pyx_kp_b_iso88591_A_a_a_a_a_a_fA4_vQoV1A_vQoV1A_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1818])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 568};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_xmin, __pyx_mstate->__pyx_n_u_xmax, __pyx_mstate->__pyx_n_u_ymin, __pyx_mstate->__pyx_n_u_ymax, __pyx_mstate->__pyx_n_u_zmin, __pyx_mstate->__pyx_n_u_zmax, __pyx_mstate->__pyx_n_u_xmin_2, __pyx_mstate->__pyx_n_u_xmax_2, __pyx_mstate->__pyx_n_u_ymin_2, __pyx_mstate->__pyx_n_u_ymax_2, __pyx_mstate->__pyx_n_u_zmin_2, __pyx_mstate->__pyx_n_u_zmax_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1819] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_setUniformCoordinatesProduct, __pyx_mstate->__pyx_kp_b_iso88591_A_a_a_a_a_a_fA_vQoV1A_vQoV1A_vQo_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1819])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 610};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_xmin, __pyx_mstate->__pyx_n_u_xmax, __pyx_mstate->__pyx_n_u_ymin, __pyx_mstate->__pyx_n_u_ymax, __pyx_mstate->__pyx_n_u_zmin, __pyx_mstate->__pyx_n_u_zmax, __pyx_mstate->__pyx_n_u_xmin_2, __pyx_mstate->__pyx_n_u_xmax_2, __pyx_mstate->__pyx_n_u_ymin_2, __pyx_mstate->__pyx_n_u_ymax_2, __pyx_mstate->__pyx_n_u_zmin_2, __pyx_mstate->__pyx_n_u_zmax_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1820] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_setUniformCoordinates, __pyx_mstate->__pyx_kp_b_iso88591_A_a_a_a_a_a_fAF_vQoV1A_vQoV1A_vQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1820])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 657};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dmtype, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1821] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_setCoordinateDMType, __pyx_mstate->__pyx_kp_b_iso88591_a_81A_a_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1821])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 678};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_loc, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_slot, __pyx_mstate->__pyx_n_u_comp, __pyx_mstate->__pyx_n_u_sloc};
    __pyx_mstate_global->__pyx_codeobj_tab[1822] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getLocationSlot, __pyx_mstate->__pyx_kp_b_iso88591_7xq_1_5_DAQ_a_AT_fF_1_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1822])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 701};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_loc, __pyx_mstate->__pyx_n_u_slot, __pyx_mstate->__pyx_n_u_sloc};
    __pyx_mstate_global->__pyx_codeobj_tab[1823] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getProductCoordinateLocationSlot, __pyx_mstate->__pyx_kp_b_iso88591_44H_1_DAQ_a_5Qd_vQa_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1823])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 721};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_loc, __pyx_mstate->__pyx_n_u_dof, __pyx_mstate->__pyx_n_u_sloc};
    __pyx_mstate_global->__pyx_codeobj_tab[1824] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getLocationDof, __pyx_mstate->__pyx_kp_b_iso88591_6a_DAQ_a_1D_V1A_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1824])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 743};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_dmTo, __pyx_mstate->__pyx_n_u_vecTo};
    __pyx_mstate_global->__pyx_codeobj_tab[1825] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_migrateVec, __pyx_mstate->__pyx_kp_b_iso88591_9_a_q_E_F_e5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1825])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 766};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dofs, __pyx_mstate->__pyx_n_u_gdofs, __pyx_mstate->__pyx_n_u_dof0, __pyx_mstate->__pyx_n_u_dof1, __pyx_mstate->__pyx_n_u_dof2, __pyx_mstate->__pyx_n_u_dof3, __pyx_mstate->__pyx_n_u_newda, __pyx_mstate->__pyx_n_u_newdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1826] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_createCompatibleDMStag, __pyx_mstate->__pyx_kp_b_iso88591_q_5_8881_awavQfAV1A_Q_a_1D_V6_v, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1826])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 790};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec, __pyx_mstate->__pyx_n_u_loc, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_pc, __pyx_mstate->__pyx_n_u_sloc, __pyx_mstate->__pyx_n_u_pda, __pyx_mstate->__pyx_n_u_pdavec, __pyx_mstate->__pyx_n_u_da, __pyx_mstate->__pyx_n_u_davec};
    __pyx_mstate_global->__pyx_codeobj_tab[1827] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_VecSplitToDMDA, __pyx_mstate->__pyx_kp_b_iso88591_A_1_5_DAQ_1_q_a_1D_S_fD_aq_T_az, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1827])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 828};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1828] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_getVecArray, __pyx_mstate->__pyx_kp_b_iso88591_a_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1828])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 832};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1829] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMStag_pyx, __pyx_mstate->__pyx_n_u_get1dCoordinatecArrays, __pyx_mstate->__pyx_kp_b_iso88591__31, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1829])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 6};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1830] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMComposite_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_Q_a_az_a_F_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1830])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 28};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_item};
    __pyx_mstate_global->__pyx_codeobj_tab[1831] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMComposite_pyx, __pyx_mstate->__pyx_n_u_addDM, __pyx_mstate->__pyx_kp_b_iso88591_a_q_E_1_HA_q_1D_Rq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1831])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 51};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[1832] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMComposite_pyx, __pyx_mstate->__pyx_n_u_getNumber, __pyx_mstate->__pyx_kp_b_iso88591_1_a_Qd_q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1832])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 66};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_cdms, __pyx_mstate->__pyx_n_u_unused, __pyx_mstate->__pyx_n_u_entry, __pyx_mstate->__pyx_n_u_entries};
    __pyx_mstate_global->__pyx_codeobj_tab[1833] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMComposite_pyx, __pyx_mstate->__pyx_n_u_getEntries, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_Q_a_Qd_q_XQgQj_F_1_a_e1_A_G, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1833])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 90};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gvec, __pyx_mstate->__pyx_n_u_lvecs, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_clvecs, __pyx_mstate->__pyx_n_u_unused};
    __pyx_mstate_global->__pyx_codeobj_tab[1834] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMComposite_pyx, __pyx_mstate->__pyx_n_u_scatter, __pyx_mstate->__pyx_kp_b_iso88591_9_Q_a_Qd_q_XQgQj_F_1_G9A_6_uA_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1834])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 115};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gvec, __pyx_mstate->__pyx_n_u_imode, __pyx_mstate->__pyx_n_u_lvecs, __pyx_mstate->__pyx_n_u_cimode, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_clvecs, __pyx_mstate->__pyx_n_u_unused};
    __pyx_mstate_global->__pyx_codeobj_tab[1835] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMComposite_pyx, __pyx_mstate->__pyx_n_u_gather, __pyx_mstate->__pyx_kp_b_iso88591_Oq_j_Q_a_Qd_q_XQgQj_F_1_G9A_6_u, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1835])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 143};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_cis, __pyx_mstate->__pyx_n_u_isets, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[1836] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMComposite_pyx, __pyx_mstate->__pyx_n_u_getGlobalISs, __pyx_mstate->__pyx_kp_b_iso88591_a_Q_A_a_Qd_q_a_at5_AV1Cq_D_y_G9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1836])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 170};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_cis, __pyx_mstate->__pyx_n_u_isets, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[1837] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMComposite_pyx, __pyx_mstate->__pyx_n_u_getLocalISs, __pyx_mstate->__pyx_kp_b_iso88591_Q_Q_A_a_Qd_q_a_Qd_q_AV1Cq_D_y_G, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1837])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 196};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_clgm, __pyx_mstate->__pyx_n_u_lgms, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[1838] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMComposite_pyx, __pyx_mstate->__pyx_n_u_getLGMaps, __pyx_mstate->__pyx_kp_b_iso88591_1_Q_a_Qd_q_a_4AT_aq_1IQd_4t7_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1838])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 219};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gvec, __pyx_mstate->__pyx_n_u_locs};
    __pyx_mstate_global->__pyx_codeobj_tab[1839] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMComposite_pyx, __pyx_mstate->__pyx_n_u_getAccess, __pyx_mstate->__pyx_kp_b_iso88591_y_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1839])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1840] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_Q_a_AWAQ_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1840])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 25};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mat};
    __pyx_mstate_global->__pyx_codeobj_tab[1841] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setMatrix, __pyx_mstate->__pyx_kp_b_iso88591_A_a_q_E_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1841])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 42};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gv};
    __pyx_mstate_global->__pyx_codeobj_tab[1842] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setGlobalVector, __pyx_mstate->__pyx_kp_b_iso88591_a_Qd_r, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1842])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 59};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_lv};
    __pyx_mstate_global->__pyx_codeobj_tab[1843] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setLocalVector, __pyx_mstate->__pyx_kp_b_iso88591_a_AT_b, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1843])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 76};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_create_gvec, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1844] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setCreateGlobalVector, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_wa_vS_gQ_vS_ha_F_6a_q_E_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1844])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 108};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_create_lvec, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1845] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setCreateLocalVector, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_wa_vS_gQ_vS_ha_F_5Q_at5_at, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1845])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 140};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_begin, __pyx_mstate->__pyx_n_u_end, __pyx_mstate->__pyx_n_u_begin_args, __pyx_mstate->__pyx_n_u_begin_kargs, __pyx_mstate->__pyx_n_u_end_args, __pyx_mstate->__pyx_n_u_end_kargs, __pyx_mstate->__pyx_n_u_cbegin, __pyx_mstate->__pyx_n_u_cend, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1846] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setGlobalToLocal, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_Q_1_9A6_0_A_6_3fM_3fN_wl_1_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1846])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 189};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_gtol};
    __pyx_mstate_global->__pyx_codeobj_tab[1847] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setGlobalToLocalVecScatter, __pyx_mstate->__pyx_kp_b_iso88591_a_0_U_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1847])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 206};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_begin, __pyx_mstate->__pyx_n_u_end, __pyx_mstate->__pyx_n_u_begin_args, __pyx_mstate->__pyx_n_u_begin_kargs, __pyx_mstate->__pyx_n_u_end_args, __pyx_mstate->__pyx_n_u_end_kargs, __pyx_mstate->__pyx_n_u_cbegin, __pyx_mstate->__pyx_n_u_cend, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1848] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setLocalToGlobal, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_Q_1_9A2_0_A_6_3fM_3fN_wl_1_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1848])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 253};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ltog};
    __pyx_mstate_global->__pyx_codeobj_tab[1849] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setLocalToGlobalVecScatter, __pyx_mstate->__pyx_kp_b_iso88591_a_0_U_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1849])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 270};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_begin, __pyx_mstate->__pyx_n_u_end, __pyx_mstate->__pyx_n_u_begin_args, __pyx_mstate->__pyx_n_u_begin_kargs, __pyx_mstate->__pyx_n_u_end_args, __pyx_mstate->__pyx_n_u_end_kargs, __pyx_mstate->__pyx_n_u_cbegin, __pyx_mstate->__pyx_n_u_cend, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1850] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setLocalToLocal, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_Q_1_9A2_0_A_q_6_3fM_3fN_wl_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1850])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 319};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ltol};
    __pyx_mstate_global->__pyx_codeobj_tab[1851] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setLocalToLocalVecScatter, __pyx_mstate->__pyx_kp_b_iso88591_9_a_q_E_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1851])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 336};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_create_matrix, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1852] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setCreateMatrix, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_vS_ha_vS_ha_fA_q_e1_e1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1852])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 368};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_coarsen, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1853] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setCoarsen, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_87_vS_ha_vS_ha_y_a_AT_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1853])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 400};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_refine, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1854] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setRefine, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_7_vS_ha_vS_ha_xvQ_1D_Q_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1854])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 432};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_create_interpolation, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1855] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setCreateInterpolation, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_q_vS_ha_vS_ha_V1_6a_0_U_0, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1855])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 464};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_create_injection, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1856] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setCreateInjection, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_G1_vS_ha_vS_ha_q_2_AT_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1856])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 496};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_create_restriction, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1857] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setCreateRestriction, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_gQ_vS_ha_vS_ha_6_4A_at5_at, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1857])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 528};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_decomp, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1858] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setCreateFieldDecomposition, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_7_vS_gQ_vS_ha_xvQ_5Q_5Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1858])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 560};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_decomp, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1859] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setCreateDomainDecomposition, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_7_vS_gQ_vS_ha_xvQ_6a_6at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1859])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 592};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_scatter, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1860] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setCreateDomainDecompositionScat, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_87_vS_gQ_vS_ha_y_a_q_at5_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1860])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 624};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_create_subdm, __pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_kargs, __pyx_mstate->__pyx_n_u_context};
    __pyx_mstate_global->__pyx_codeobj_tab[1861] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMShell_pyx, __pyx_mstate->__pyx_n_u_setCreateSubDM, __pyx_mstate->__pyx_kp_b_iso88591_A_q_y_q_vS_gQ_vS_ha_V1_a_U_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1861])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 8};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1862] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_Qat1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1862])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 21};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[1863] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_4z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1863])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 40};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newdmlabel, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1864] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_nIQ_havQ_q_y_q_a_AWG1A_az_hd_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1864])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 65};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_new_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1865] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_duplicate, __pyx_mstate->__pyx_kp_b_iso88591_1_7_a_q_Jas_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1865])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 79};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1866] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_kp_b_iso88591_q_a_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1866])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 91};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_cvalue};
    __pyx_mstate_global->__pyx_codeobj_tab[1867] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_insertIS, __pyx_mstate->__pyx_kp_b_iso88591_xq_uAQ_a_at_T_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1867])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 112};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cvalue};
    __pyx_mstate_global->__pyx_codeobj_tab[1868] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_setValue, __pyx_mstate->__pyx_kp_b_iso88591_l_uAQ_uAQ_a_at_XQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1868])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 137};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cvalue};
    __pyx_mstate_global->__pyx_codeobj_tab[1869] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_getValue, __pyx_mstate->__pyx_kp_b_iso88591_ha_uAQ_q_a_at_XQa_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1869])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 161};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cvalue};
    __pyx_mstate_global->__pyx_codeobj_tab[1870] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_getDefaultValue, __pyx_mstate->__pyx_kp_b_iso88591_q_a_Qd_AQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1870])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 178};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_cvalue};
    __pyx_mstate_global->__pyx_codeobj_tab[1871] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_setDefaultValue, __pyx_mstate->__pyx_kp_b_iso88591_XQ_uAQ_a_Qd_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1871])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 199};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cvalue};
    __pyx_mstate_global->__pyx_codeobj_tab[1872] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_clearValue, __pyx_mstate->__pyx_kp_b_iso88591_HA_uAQ_uAQ_a_Zxq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1872])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 220};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_cvalue};
    __pyx_mstate_global->__pyx_codeobj_tab[1873] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_addStratum, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_a_Zq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1873])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 238};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_strata, __pyx_mstate->__pyx_n_u_istrata, __pyx_mstate->__pyx_n_u_numStrata};
    __pyx_mstate_global->__pyx_codeobj_tab[1874] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_addStrata, __pyx_mstate->__pyx_kp_b_iso88591_2_aq_a_q_Jk, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1874])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 258};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset};
    __pyx_mstate_global->__pyx_codeobj_tab[1875] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_addStrataIS, __pyx_mstate->__pyx_kp_b_iso88591_a_a_j_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1875])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 275};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_numValues};
    __pyx_mstate_global->__pyx_codeobj_tab[1876] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_getNumValues, __pyx_mstate->__pyx_kp_b_iso88591_a_a_4z_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1876])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 289};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset};
    __pyx_mstate_global->__pyx_codeobj_tab[1877] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_getValueIS, __pyx_mstate->__pyx_kp_b_iso88591_A_r_a_Zq_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1877])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 303};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cvalue, __pyx_mstate->__pyx_n_u_ccontains};
    __pyx_mstate_global->__pyx_codeobj_tab[1878] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_stratumHasPoint, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_uAQ_1_a_Qd_HHAQ_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1878])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 326};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_cvalue, __pyx_mstate->__pyx_n_u_cexists};
    __pyx_mstate_global->__pyx_codeobj_tab[1879] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_hasStratum, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_a_Zxq_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1879])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 346};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stratum, __pyx_mstate->__pyx_n_u_cstratum, __pyx_mstate->__pyx_n_u_csize};
    __pyx_mstate_global->__pyx_codeobj_tab[1880] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_getStratumSize, __pyx_mstate->__pyx_kp_b_iso88591_ha_aq_a_a_AT_Qa_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1880])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 366};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stratum, __pyx_mstate->__pyx_n_u_cstratum, __pyx_mstate->__pyx_n_u_iset};
    __pyx_mstate_global->__pyx_codeobj_tab[1881] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_getStratumIS, __pyx_mstate->__pyx_kp_b_iso88591_HA_aq_r_a_4z_1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1881])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 386};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stratum, __pyx_mstate->__pyx_n_u_iset, __pyx_mstate->__pyx_n_u_cstratum};
    __pyx_mstate_global->__pyx_codeobj_tab[1882] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_setStratumIS, __pyx_mstate->__pyx_kp_b_iso88591_5Q_aq_a_4z_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1882])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 406};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stratum, __pyx_mstate->__pyx_n_u_cstratum};
    __pyx_mstate_global->__pyx_codeobj_tab[1883] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_clearStratum, __pyx_mstate->__pyx_kp_b_iso88591_HA_aq_a_4z, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1883])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 424};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1884] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_computeIndex, __pyx_mstate->__pyx_kp_b_iso88591_a_a_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1884])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 438};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pStart, __pyx_mstate->__pyx_n_u_pEnd, __pyx_mstate->__pyx_n_u_cpstart, __pyx_mstate->__pyx_n_u_cpend};
    __pyx_mstate_global->__pyx_codeobj_tab[1885] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_createIndex, __pyx_mstate->__pyx_kp_b_iso88591_XQ_Q_7uAQ_a_j, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1885])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 458};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1886] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_destroyIndex, __pyx_mstate->__pyx_kp_b_iso88591_a_a_4q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1886])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 470};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_value, __pyx_mstate->__pyx_n_u_cvalue, __pyx_mstate->__pyx_n_u_cexists};
    __pyx_mstate_global->__pyx_codeobj_tab[1887] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_hasValue, __pyx_mstate->__pyx_kp_b_iso88591_ha_uAQ_a_at_XQa_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1887])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 490};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_point, __pyx_mstate->__pyx_n_u_cpoint, __pyx_mstate->__pyx_n_u_cexists};
    __pyx_mstate_global->__pyx_codeobj_tab[1888] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_hasPoint, __pyx_mstate->__pyx_kp_b_iso88591_ha_uAQ_a_at_XQa_vQa_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1888])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 512};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cpstart, __pyx_mstate->__pyx_n_u_cpend};
    __pyx_mstate_global->__pyx_codeobj_tab[1889] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_getBounds, __pyx_mstate->__pyx_kp_b_iso88591_1_1_a_q_Jay_uAZuAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1889])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 528};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_start, __pyx_mstate->__pyx_n_u_end, __pyx_mstate->__pyx_n_u_cstart, __pyx_mstate->__pyx_n_u_cend};
    __pyx_mstate_global->__pyx_codeobj_tab[1890] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_filter, __pyx_mstate->__pyx_kp_b_iso88591_Jha_uA_E_a_AT_81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1890])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 548};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_permutation, __pyx_mstate->__pyx_n_u_new_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1891] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_permute, __pyx_mstate->__pyx_kp_b_iso88591_7_a_Qd_Kwas_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1891])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 567};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf, __pyx_mstate->__pyx_n_u_new_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1892] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_distribute, __pyx_mstate->__pyx_kp_b_iso88591_1_7_a_Zr_as_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1892])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 586};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sf, __pyx_mstate->__pyx_n_u_new_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1893] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_gather, __pyx_mstate->__pyx_kp_b_iso88591_q_7_a_AT_2U_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1893])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 607};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_section, __pyx_mstate->__pyx_n_u_iset};
    __pyx_mstate_global->__pyx_codeobj_tab[1894] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_convertToSection, __pyx_mstate->__pyx_kp_b_iso88591_wa_r_a_at_QgV1D_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1894])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 622};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_iset};
    __pyx_mstate_global->__pyx_codeobj_tab[1895] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMLabel_pyx, __pyx_mstate->__pyx_n_u_getNonEmptyStratumValuesIS, __pyx_mstate->__pyx_kp_b_iso88591_A_r_a_0_Zq_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1895])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 39};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1896] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_Q_axq_q_az_hd_ay_U_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1896])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 65};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fieldname, __pyx_mstate->__pyx_n_u_cfieldname, __pyx_mstate->__pyx_n_u_vg};
    __pyx_mstate_global->__pyx_codeobj_tab[1897] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_createGlobalVectorFromField, __pyx_mstate->__pyx_kp_b_iso88591_5XQ_a_c_IQk_a_1_e_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1897])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 89};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fieldname, __pyx_mstate->__pyx_n_u_cfieldname, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1898] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_destroyGlobalVectorFromField, __pyx_mstate->__pyx_kp_b_iso88591_6ha_a_A_IQk_a_2_4uL, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1898])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 109};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fieldnames, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_nf, __pyx_mstate->__pyx_n_u_cfieldnames, __pyx_mstate->__pyx_n_u_unused, __pyx_mstate->__pyx_n_u_vg};
    __pyx_mstate_global->__pyx_codeobj_tab[1899] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_createGlobalVectorFromFields, __pyx_mstate->__pyx_kp_b_iso88591_77I_S_XQgQe6_T_G9A_Qj_Qa_q_Q_c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1899])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 139};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fieldnames, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_nf, __pyx_mstate->__pyx_n_u_cfieldnames, __pyx_mstate->__pyx_n_u_unused, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1900] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_destroyGlobalVectorFromFields, __pyx_mstate->__pyx_kp_b_iso88591_88J_S_XQgQe6_T_G9A_Qj_Qa_q_Q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1900])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 165};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fieldname, __pyx_mstate->__pyx_n_u_cfieldname, __pyx_mstate->__pyx_n_u_vl};
    __pyx_mstate_global->__pyx_codeobj_tab[1901] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_createLocalVectorFromField, __pyx_mstate->__pyx_kp_b_iso88591_4HA_a_c_IQk_a_0_U_ar_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1901])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 189};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fieldname, __pyx_mstate->__pyx_n_u_cfieldname, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1902] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_destroyLocalVectorFromField, __pyx_mstate->__pyx_kp_b_iso88591_5XQ_a_A_IQk_a_1_e_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1902])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 209};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fieldnames, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_nf, __pyx_mstate->__pyx_n_u_cfieldnames, __pyx_mstate->__pyx_n_u_unused, __pyx_mstate->__pyx_n_u_vl};
    __pyx_mstate_global->__pyx_codeobj_tab[1903] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_createLocalVectorFromFields, __pyx_mstate->__pyx_kp_b_iso88591_66H_S_XQgQe6_T_G9A_Qj_Qa_q_Q_c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1903])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 239};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fieldnames, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_nf, __pyx_mstate->__pyx_n_u_cfieldnames, __pyx_mstate->__pyx_n_u_unused, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[1904] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_destroyLocalVectorFromFields, __pyx_mstate->__pyx_kp_b_iso88591_77I_S_XQgQe6_T_G9A_Qj_Qa_q_Q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1904])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 265};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1905] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_initializeFieldRegister, __pyx_mstate->__pyx_kp_b_iso88591_a_Qd_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1905])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 279};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1906] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_finalizeFieldRegister, __pyx_mstate->__pyx_kp_b_iso88591_q_a_1D_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1906])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 291};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nlocal, __pyx_mstate->__pyx_n_u_buffer, __pyx_mstate->__pyx_n_u_cnlocal, __pyx_mstate->__pyx_n_u_cbuffer};
    __pyx_mstate_global->__pyx_codeobj_tab[1907] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_setLocalSizes, __pyx_mstate->__pyx_kp_b_iso88591_M_Qa_Qa_a_1D_Ya_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1907])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 313};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fieldname, __pyx_mstate->__pyx_n_u_blocksize, __pyx_mstate->__pyx_n_u_dtype, __pyx_mstate->__pyx_n_u_cfieldname, __pyx_mstate->__pyx_n_u_cblocksize, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[1908] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_registerField, __pyx_mstate->__pyx_kp_b_iso88591_7_Raab_a_5_A_6_M_6_M_6_M_6_M_vS, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1908])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 343};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fieldname, __pyx_mstate->__pyx_n_u_cfieldname, __pyx_mstate->__pyx_n_u_blocksize, __pyx_mstate->__pyx_n_u_ctype, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_nlocal, __pyx_mstate->__pyx_n_u_typenum, __pyx_mstate->__pyx_n_u_s_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1909] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_getField, __pyx_mstate->__pyx_kp_b_iso88591_4_a_1_q_q_IQk_a_at5_A_QRRS_a_4u, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1909])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 389};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fieldname, __pyx_mstate->__pyx_n_u_cfieldname, __pyx_mstate->__pyx_n_u_blocksize, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[1910] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_restoreField, __pyx_mstate->__pyx_kp_b_iso88591_ha_a_1_IQk_a_4uL_AWIUV, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1910])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 410};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fieldname, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1911] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_vectorDefineField, __pyx_mstate->__pyx_kp_b_iso88591_81_IQk_a_q_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1911])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 432};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1912] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_addPoint, __pyx_mstate->__pyx_kp_b_iso88591_a_at1_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1912])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 444};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_npoints, __pyx_mstate->__pyx_n_u_cnpoints};
    __pyx_mstate_global->__pyx_codeobj_tab[1913] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_addNPoints, __pyx_mstate->__pyx_kp_b_iso88591_aq_a_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1913])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 462};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1914] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_removePoint, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1914])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 474};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_index, __pyx_mstate->__pyx_n_u_cindex};
    __pyx_mstate_global->__pyx_codeobj_tab[1915] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_removePointAtIndex, __pyx_mstate->__pyx_kp_b_iso88591_uAQ_a_U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1915])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 492};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pi, __pyx_mstate->__pyx_n_u_pj, __pyx_mstate->__pyx_n_u_cpi, __pyx_mstate->__pyx_n_u_cpj};
    __pyx_mstate_global->__pyx_codeobj_tab[1916] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_copyPoint, __pyx_mstate->__pyx_kp_b_iso88591_IXQ_E_E_a_q_E_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1916])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 513};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size};
    __pyx_mstate_global->__pyx_codeobj_tab[1917] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_getLocalSize, __pyx_mstate->__pyx_kp_b_iso88591_a_U_1_a_4uAQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1917])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 527};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_size};
    __pyx_mstate_global->__pyx_codeobj_tab[1918] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_getSize, __pyx_mstate->__pyx_kp_b_iso88591_U_1_a_Qd_q_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1918])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 541};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_remove_sent_points, __pyx_mstate->__pyx_n_u_remove_pts};
    __pyx_mstate_global->__pyx_codeobj_tab[1919] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_migrate, __pyx_mstate->__pyx_kp_b_iso88591_1_F_1_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1919])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 560};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1920] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_collectViewCreate, __pyx_mstate->__pyx_kp_b_iso88591_1_a_q_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1920])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 572};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1921] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_collectViewDestroy, __pyx_mstate->__pyx_kp_b_iso88591_A_a_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1921])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 584};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1922] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_setCellDM, __pyx_mstate->__pyx_kp_b_iso88591_a_q_E_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1922])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 601};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1923] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_getCellDM, __pyx_mstate->__pyx_kp_b_iso88591_1_Q_a_q_E_Zq_a_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1923])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 618};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dmswarm_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1924] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_O1_Q_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1924])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 11, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 636};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_min, __pyx_mstate->__pyx_n_u_max, __pyx_mstate->__pyx_n_u_npoints, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_cmin, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_cmax, __pyx_mstate->__pyx_n_u_cnpoints, __pyx_mstate->__pyx_n_u_cmode};
    __pyx_mstate_global->__pyx_codeobj_tab[1925] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_setPointsUniformCoordinates, __pyx_mstate->__pyx_kp_b_iso88591_A_10_E_a_Qd_q_AU_auD_fAQ_G9E_Qe3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1925])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 680};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_coordinates, __pyx_mstate->__pyx_n_u_redundant, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_xyz, __pyx_mstate->__pyx_n_u_cnpoints, __pyx_mstate->__pyx_n_u_credundant, __pyx_mstate->__pyx_n_u_cmode, __pyx_mstate->__pyx_n_u_coords};
    __pyx_mstate_global->__pyx_codeobj_tab[1926] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_setPointCoordinates, __pyx_mstate->__pyx_kp_b_iso88591_A_1_6_q_AV6_Qa_q_S_6_1_1A_Kq_Q_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1926])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 716};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_layoutType, __pyx_mstate->__pyx_n_u_fill_param, __pyx_mstate->__pyx_n_u_clayoutType, __pyx_mstate->__pyx_n_u_cfill_param};
    __pyx_mstate_global->__pyx_codeobj_tab[1927] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_insertPointUsingCellDM, __pyx_mstate->__pyx_kp_b_iso88591_11LHTU_6Q_E_a_Qd_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1927])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 738};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_coordinates, __pyx_mstate->__pyx_n_u_xyz, __pyx_mstate->__pyx_n_u_cnpoints, __pyx_mstate->__pyx_n_u_coords};
    __pyx_mstate_global->__pyx_codeobj_tab[1928] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_setPointCoordinatesCellwise, __pyx_mstate->__pyx_kp_b_iso88591_77K1_6_q_AV6_Qa_q_S_6_1_1A_Kq_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1928])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 765};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_fieldnames, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_cfilename, __pyx_mstate->__pyx_n_u_cnfields, __pyx_mstate->__pyx_n_u_cfieldnames, __pyx_mstate->__pyx_n_u_unused, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[1929] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_viewFieldsXDMF, __pyx_mstate->__pyx_kp_b_iso88591_88J_Q_9AZq_Cq_XQgQk_xq_T_G9A_au, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1929])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 794};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_filename, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1930] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_viewXDMF, __pyx_mstate->__pyx_kp_b_iso88591_9AZq_a_at5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1930])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 813};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1931] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_sortGetAccess, __pyx_mstate->__pyx_kp_b_iso88591_q_a_1D_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1931])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 831};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1932] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_sortRestoreAccess, __pyx_mstate->__pyx_kp_b_iso88591_1_a_q_A_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1932])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 843};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_e, __pyx_mstate->__pyx_n_u_ce, __pyx_mstate->__pyx_n_u_cnpoints, __pyx_mstate->__pyx_n_u_cpidlist, __pyx_mstate->__pyx_n_u_pidlist, __pyx_mstate->__pyx_n_u_npoints, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[1933] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_sortGetPointsPerCell, __pyx_mstate->__pyx_kp_b_iso88591_ha_5_aq_A_a_4uD_1A_q_G9IWG1E_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1933])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 867};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_e, __pyx_mstate->__pyx_n_u_ce, __pyx_mstate->__pyx_n_u_npoints};
    __pyx_mstate_global->__pyx_codeobj_tab[1934] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_sortGetNumberOfPointsPerCell, __pyx_mstate->__pyx_kp_b_iso88591_ha_5_Qa_a_2_4uD_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1934])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 887};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isValid};
    __pyx_mstate_global->__pyx_codeobj_tab[1935] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_sortGetIsValid, __pyx_mstate->__pyx_kp_b_iso88591_q_a_AT_aq_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1935])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 903};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ncells, __pyx_mstate->__pyx_n_u_npoints};
    __pyx_mstate_global->__pyx_codeobj_tab[1936] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_sortGetSizes, __pyx_mstate->__pyx_kp_b_iso88591_a_uAQ_Qa_a_4uAXQa_QiuAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1936])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 925};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm, __pyx_mstate->__pyx_n_u_fieldnames, __pyx_mstate->__pyx_n_u_vecs, __pyx_mstate->__pyx_n_u_mode, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_cnfields, __pyx_mstate->__pyx_n_u_cfieldnames, __pyx_mstate->__pyx_n_u_unused, __pyx_mstate->__pyx_n_u_cfieldvecs, __pyx_mstate->__pyx_n_u_unused2, __pyx_mstate->__pyx_n_u_cmode, __pyx_mstate->__pyx_n_u_i};
    __pyx_mstate_global->__pyx_codeobj_tab[1937] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_projectFields, __pyx_mstate->__pyx_kp_b_iso88591_DDYYkkttu_Cq_XQgQk_xq_A_hawa_k, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1937])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 957};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_celldm};
    __pyx_mstate_global->__pyx_codeobj_tab[1938] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_addCellDM, __pyx_mstate->__pyx_kp_b_iso88591_a_q_E_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1938])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 974};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_cname};
    __pyx_mstate_global->__pyx_codeobj_tab[1939] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_setCellDMActive, __pyx_mstate->__pyx_kp_b_iso88591_XQ_a_Qd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1939])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 993};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_newcdm, __pyx_mstate->__pyx_n_u_cdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1940] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_getCellDMActive, __pyx_mstate->__pyx_kp_b_iso88591_a_Qd_q_7_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1940])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1010};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_name, __pyx_mstate->__pyx_n_u_newcdm, __pyx_mstate->__pyx_n_u_cname, __pyx_mstate->__pyx_n_u_cdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1941] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_getCellDMByName, __pyx_mstate->__pyx_kp_b_iso88591_HA_a_Qd_waq_7_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1941])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1029};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_nc, __pyx_mstate->__pyx_n_u_c, __pyx_mstate->__pyx_n_u_names};
    __pyx_mstate_global->__pyx_codeobj_tab[1942] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_getCellDMNames, __pyx_mstate->__pyx_kp_b_iso88591_a_a_AT_at1A_G9A_1AQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1942])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1047};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_coord, __pyx_mstate->__pyx_n_u_weight, __pyx_mstate->__pyx_n_u_mom, __pyx_mstate->__pyx_n_u_cbs, __pyx_mstate->__pyx_n_u_ccoord, __pyx_mstate->__pyx_n_u_cweight, __pyx_mstate->__pyx_n_u_moments};
    __pyx_mstate_global->__pyx_codeobj_tab[1943] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_computeMoments, __pyx_mstate->__pyx_kp_b_iso88591_M_a_A_1_1_a_4uHAU_hawauAU_D_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1943])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1090};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[1944] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_V1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1944])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1109};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1945] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_1AT_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1945])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 13, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1122};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm, __pyx_mstate->__pyx_n_u_fields, __pyx_mstate->__pyx_n_u_coords, __pyx_mstate->__pyx_n_u_cval, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_nf, __pyx_mstate->__pyx_n_u_fieldnames, __pyx_mstate->__pyx_n_u_unuseda, __pyx_mstate->__pyx_n_u_nc, __pyx_mstate->__pyx_n_u_coordnames, __pyx_mstate->__pyx_n_u_unusedb, __pyx_mstate->__pyx_n_u_newcdm};
    __pyx_mstate_global->__pyx_codeobj_tab[1946] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_A_S_q_hawauF_1_Qa_G9A_QfAT_auA_c, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1946])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1165};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1947] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_getDM, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_a_fAQ_Zq_a_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1947])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1182};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cellid};
    __pyx_mstate_global->__pyx_codeobj_tab[1948] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_getCellID, __pyx_mstate->__pyx_kp_b_iso88591_1_a_Qd_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1948])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1196};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sw, __pyx_mstate->__pyx_n_u_bs_2};
    __pyx_mstate_global->__pyx_codeobj_tab[1949] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_getBlockSize, __pyx_mstate->__pyx_kp_b_iso88591_Q_1_a_V2U_1_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1949])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1215};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_nf, __pyx_mstate->__pyx_n_u_f, __pyx_mstate->__pyx_n_u_fields};
    __pyx_mstate_global->__pyx_codeobj_tab[1950] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_getFields, __pyx_mstate->__pyx_kp_b_iso88591_1_a_a_Qd_Qa_1_G9A_1AQa_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1950])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1233};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_ncf, __pyx_mstate->__pyx_n_u_cf, __pyx_mstate->__pyx_n_u_fields};
    __pyx_mstate_global->__pyx_codeobj_tab[1951] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMSwarm_pyx, __pyx_mstate->__pyx_n_u_getCoordinateFields, __pyx_mstate->__pyx_kp_b_iso88591_Q_1_q_a_q_F_5_1_G9A_1Baq_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1951])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 26};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[1952] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Partitioner_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_1D_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1952])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 45};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1953] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Partitioner_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_aq_A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1953])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 58};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newpart};
    __pyx_mstate_global->__pyx_codeobj_tab[1954] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Partitioner_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_a_QgQa_az_hd_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1954])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 81};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_part_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1955] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Partitioner_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_IQk_a_at7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1955])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 100};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1956] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Partitioner_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_a_at7_1_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1956])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 114};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1957] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Partitioner_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_Qd_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1957])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 126};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1958] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Partitioner_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1958])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 138};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1959] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Partitioner_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_kp_b_iso88591_q_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1959])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 150};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_numProcs, __pyx_mstate->__pyx_n_u_sizes, __pyx_mstate->__pyx_n_u_points, __pyx_mstate->__pyx_n_u_cnumProcs, __pyx_mstate->__pyx_n_u_csizes, __pyx_mstate->__pyx_n_u_cpoints, __pyx_mstate->__pyx_n_u_nsize};
    __pyx_mstate_global->__pyx_codeobj_tab[1960] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Partitioner_pyx, __pyx_mstate->__pyx_n_u_setShellPartition, __pyx_mstate->__pyx_kp_b_iso88591_A_a_y_q_a_6_HAWAWAQ_vS_j_Oq_5_wc, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1960])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 24};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1961] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_a_at1_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1961])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 36};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newsp};
    __pyx_mstate_global->__pyx_codeobj_tab[1962] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_a_q_q_az_hd_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1962])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 59};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1963] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_a_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1963])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 72};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[1964] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_Qd_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1964])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 91};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1965] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1965])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 103};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cdim};
    __pyx_mstate_global->__pyx_codeobj_tab[1966] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getDimension, __pyx_mstate->__pyx_kp_b_iso88591_a_Q_a_Qd_1_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1966])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 117};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cdegmax, __pyx_mstate->__pyx_n_u_cdegmin};
    __pyx_mstate_global->__pyx_codeobj_tab[1967] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getDegree, __pyx_mstate->__pyx_kp_b_iso88591_1_Q_a_4xq_uAZuAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1967])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 138};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_degree, __pyx_mstate->__pyx_n_u_maxDegree, __pyx_mstate->__pyx_n_u_cdegree, __pyx_mstate->__pyx_n_u_cmaxdegree};
    __pyx_mstate_global->__pyx_codeobj_tab[1968] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setDegree, __pyx_mstate->__pyx_kp_b_iso88591_7_a_7_z_aq_1_WF_uAQ_a_4xy, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1968])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 163};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cnvars};
    __pyx_mstate_global->__pyx_codeobj_tab[1969] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getNumVariables, __pyx_mstate->__pyx_kp_b_iso88591_q_a_XQa_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1969])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 177};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_cn};
    __pyx_mstate_global->__pyx_codeobj_tab[1970] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setNumVariables, __pyx_mstate->__pyx_kp_b_iso88591_5_a_XQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1970])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 195};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cncomps};
    __pyx_mstate_global->__pyx_codeobj_tab[1971] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getNumComponents, __pyx_mstate->__pyx_kp_b_iso88591_a_haq_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1971])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 209};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nc, __pyx_mstate->__pyx_n_u_cnc};
    __pyx_mstate_global->__pyx_codeobj_tab[1972] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setNumComponents, __pyx_mstate->__pyx_kp_b_iso88591_81_E_a_ha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1972])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 227};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1973] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_1_a_XQa_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1973])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 241};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_space_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[1974] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_1_Ya_1A_a_XQ_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1974])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 261};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_concatenate};
    __pyx_mstate_global->__pyx_codeobj_tab[1975] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getSumConcatenate, __pyx_mstate->__pyx_kp_b_iso88591_1_Q_a_4xq_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1975])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 280};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_concatenate, __pyx_mstate->__pyx_n_u_cconcatenate};
    __pyx_mstate_global->__pyx_codeobj_tab[1976] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setSumConcatenate, __pyx_mstate->__pyx_kp_b_iso88591_Ya_fAQ_a_4xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1976])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 304};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_numSumSpaces};
    __pyx_mstate_global->__pyx_codeobj_tab[1977] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getSumNumSubspaces, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_a_1D_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1977])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 318};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_s_2, __pyx_mstate->__pyx_n_u_subsp, __pyx_mstate->__pyx_n_u_cs};
    __pyx_mstate_global->__pyx_codeobj_tab[1978] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getSumSubspace, __pyx_mstate->__pyx_kp_b_iso88591_5_5_a_q_HD_a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1978])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 338};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_s_2, __pyx_mstate->__pyx_n_u_subsp, __pyx_mstate->__pyx_n_u_cs};
    __pyx_mstate_global->__pyx_codeobj_tab[1979] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setSumSubspace, __pyx_mstate->__pyx_kp_b_iso88591_5Q_5_a_q_HD_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1979])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 358};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_numSumSpaces, __pyx_mstate->__pyx_n_u_cnumSumSpaces};
    __pyx_mstate_global->__pyx_codeobj_tab[1980] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setSumNumSubspaces, __pyx_mstate->__pyx_kp_b_iso88591_xq_e1A_a_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1980])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 376};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cnumTensSpaces};
    __pyx_mstate_global->__pyx_codeobj_tab[1981] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getTensorNumSubspaces, __pyx_mstate->__pyx_kp_b_iso88591_q_q_a_at81A_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1981])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 390};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_s_2, __pyx_mstate->__pyx_n_u_subsp, __pyx_mstate->__pyx_n_u_cs};
    __pyx_mstate_global->__pyx_codeobj_tab[1982] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setTensorSubspace, __pyx_mstate->__pyx_kp_b_iso88591_8_5_a_4xt5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1982])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 410};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_s_2, __pyx_mstate->__pyx_n_u_cs, __pyx_mstate->__pyx_n_u_subsp};
    __pyx_mstate_global->__pyx_codeobj_tab[1983] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getTensorSubspace, __pyx_mstate->__pyx_kp_b_iso88591_81_5_5_a_4xt1E_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1983])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 430};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_numTensSpaces, __pyx_mstate->__pyx_n_u_cnumTensSpaces};
    __pyx_mstate_global->__pyx_codeobj_tab[1984] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setTensorNumSubspaces, __pyx_mstate->__pyx_kp_b_iso88591_381_uAQ_a_at81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1984])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 448};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ctensor};
    __pyx_mstate_global->__pyx_codeobj_tab[1985] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getPolynomialTensor, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_AT_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1985])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 468};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tensor, __pyx_mstate->__pyx_n_u_ctensor};
    __pyx_mstate_global->__pyx_codeobj_tab[1986] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setPolynomialTensor, __pyx_mstate->__pyx_kp_b_iso88591_1_q_a_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1986])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 493};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_quad};
    __pyx_mstate_global->__pyx_codeobj_tab[1987] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setPointPoints, __pyx_mstate->__pyx_kp_b_iso88591_1_a_q_HD, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1987])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 513};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_quad};
    __pyx_mstate_global->__pyx_codeobj_tab[1988] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getPointPoints, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_q_HAT_a_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1988])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 528};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_formDegree, __pyx_mstate->__pyx_n_u_cformDegree};
    __pyx_mstate_global->__pyx_codeobj_tab[1989] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setPTrimmedFormDegree, __pyx_mstate->__pyx_kp_b_iso88591_0_E_a_at81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1989])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 546};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cformDegree};
    __pyx_mstate_global->__pyx_codeobj_tab[1990] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getPTrimmedFormDegree, __pyx_mstate->__pyx_kp_b_iso88591_q_A_a_at81A_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1990])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 582};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1991] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_a_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1991])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 594};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newdsp};
    __pyx_mstate_global->__pyx_codeobj_tab[1992] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_Q_a_1G1A_az_hd_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1992])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 617};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_vwr};
    __pyx_mstate_global->__pyx_codeobj_tab[1993] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_q_7_vV1_a_l, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1993])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 636};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1994] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_AQd_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1994])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 649};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_spNew};
    __pyx_mstate_global->__pyx_codeobj_tab[1995] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_duplicate, __pyx_mstate->__pyx_kp_b_iso88591_1_y_a_at_q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1995])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 662};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_newdm, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1996] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getDM, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_a_4_1A_Zq_a_a_2Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1996])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 679};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm};
    __pyx_mstate_global->__pyx_codeobj_tab[1997] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setDM, __pyx_mstate->__pyx_kp_b_iso88591_a_a_4_2Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1997])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 696};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cdim};
    __pyx_mstate_global->__pyx_codeobj_tab[1998] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getDimension, __pyx_mstate->__pyx_kp_b_iso88591_a_Q_a_l_1_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1998])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 712};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cncomps};
    __pyx_mstate_global->__pyx_codeobj_tab[1999] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getNumComponents, __pyx_mstate->__pyx_kp_b_iso88591_a_Qd_aq_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1999])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 726};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_nc, __pyx_mstate->__pyx_n_u_cnc};
    __pyx_mstate_global->__pyx_codeobj_tab[2000] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setNumComponents, __pyx_mstate->__pyx_kp_b_iso88591_81_E_a_Qd_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2000])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 744};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[2001] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_q_a_AT_Qa_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2001])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 758};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dualspace_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[2002] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_oQ_q_31A_a_AT_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2002])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 778};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_corder};
    __pyx_mstate_global->__pyx_codeobj_tab[2003] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getOrder, __pyx_mstate->__pyx_kp_b_iso88591_q_a_Qd_aq_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2003])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 792};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_order, __pyx_mstate->__pyx_n_u_corder};
    __pyx_mstate_global->__pyx_codeobj_tab[2004] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setOrder, __pyx_mstate->__pyx_kp_b_iso88591_ha_uAQ_a_Qd_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2004])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 810};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cndof, __pyx_mstate->__pyx_n_u_cdim};
    __pyx_mstate_global->__pyx_codeobj_tab[2005] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getNumDof, __pyx_mstate->__pyx_kp_b_iso88591_1_Q_Q_a_l_1_a_at_q_wauBc, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2005])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 826};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_i, __pyx_mstate->__pyx_n_u_ci, __pyx_mstate->__pyx_n_u_functional};
    __pyx_mstate_global->__pyx_codeobj_tab[2006] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getFunctional, __pyx_mstate->__pyx_kp_b_iso88591_xq_5_t1_a_4_4q_a_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2006])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 847};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cintdim};
    __pyx_mstate_global->__pyx_codeobj_tab[2007] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getInteriorDimension, __pyx_mstate->__pyx_kp_b_iso88591_a_a_1_l_1_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2007])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 864};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ccontinuous};
    __pyx_mstate_global->__pyx_codeobj_tab[2008] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getLagrangeContinuity, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_a_2_4_1A_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2008])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 878};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_continuous, __pyx_mstate->__pyx_n_u_ccontinuous};
    __pyx_mstate_global->__pyx_codeobj_tab[2009] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setLagrangeContinuity, __pyx_mstate->__pyx_kp_b_iso88591_0_V1A_a_2_4_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2009])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 896};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ctensor};
    __pyx_mstate_global->__pyx_codeobj_tab[2010] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getLagrangeTensor, __pyx_mstate->__pyx_kp_b_iso88591_1_a_at_q_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2010])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 910};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tensor, __pyx_mstate->__pyx_n_u_ctensor};
    __pyx_mstate_global->__pyx_codeobj_tab[2011] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setLagrangeTensor, __pyx_mstate->__pyx_kp_b_iso88591_q_a_at_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2011])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 928};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ctrimmed};
    __pyx_mstate_global->__pyx_codeobj_tab[2012] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_getLagrangeTrimmed, __pyx_mstate->__pyx_kp_b_iso88591_A_a_q_L_vQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2012])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 942};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_trimmed, __pyx_mstate->__pyx_n_u_ctrimmed};
    __pyx_mstate_global->__pyx_codeobj_tab[2013] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setLagrangeTrimmed, __pyx_mstate->__pyx_kp_b_iso88591_1_a_q_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2013])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 962};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_cdim};
    __pyx_mstate_global->__pyx_codeobj_tab[2014] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setSimpleDimension, __pyx_mstate->__pyx_kp_b_iso88591_ha_U_1_a_q_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2014])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 980};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_func, __pyx_mstate->__pyx_n_u_functional, __pyx_mstate->__pyx_n_u_cfunc};
    __pyx_mstate_global->__pyx_codeobj_tab[2015] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Space_pyx, __pyx_mstate->__pyx_n_u_setSimpleFunctional, __pyx_mstate->__pyx_kp_b_iso88591_A_e1A_a_0_RS, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2015])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 13};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newdminterp};
    __pyx_mstate_global->__pyx_codeobj_tab[2016] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMUtils_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_havQ_0_a_AWAQ_a_Qat1_L_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2016])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 35};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[2017] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMUtils_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_Qat1_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2017])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 48};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm, __pyx_mstate->__pyx_n_u_x, __pyx_mstate->__pyx_n_u_v};
    __pyx_mstate_global->__pyx_codeobj_tab[2018] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMUtils_pyx, __pyx_mstate->__pyx_n_u_evaluate, __pyx_mstate->__pyx_kp_b_iso88591_9A_2S_1_1E_A_1D_1AQ_a_at_b_QfAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2018])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 74};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_coords};
    __pyx_mstate_global->__pyx_codeobj_tab[2019] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMUtils_pyx, __pyx_mstate->__pyx_n_u_getCoordinates, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_AT_AV1_a_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2019])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 92};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cdim};
    __pyx_mstate_global->__pyx_codeobj_tab[2020] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMUtils_pyx, __pyx_mstate->__pyx_n_u_getDim, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_AT_AQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2020])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 106};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cdof};
    __pyx_mstate_global->__pyx_codeobj_tab[2021] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMUtils_pyx, __pyx_mstate->__pyx_n_u_getDof, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_AT_AQ_uAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2021])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 120};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dim, __pyx_mstate->__pyx_n_u_cdim};
    __pyx_mstate_global->__pyx_codeobj_tab[2022] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMUtils_pyx, __pyx_mstate->__pyx_n_u_setDim, __pyx_mstate->__pyx_kp_b_iso88591_U_1_a_AT_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2022])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 138};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dof, __pyx_mstate->__pyx_n_u_cdof};
    __pyx_mstate_global->__pyx_codeobj_tab[2023] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMUtils_pyx, __pyx_mstate->__pyx_n_u_setDof, __pyx_mstate->__pyx_kp_b_iso88591_U_1_a_AT_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2023])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 156};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_dm, __pyx_mstate->__pyx_n_u_redundantPoints, __pyx_mstate->__pyx_n_u_ignoreOutsideDomain, __pyx_mstate->__pyx_n_u_credundantPoints, __pyx_mstate->__pyx_n_u_cignoreOutsideDomain};
    __pyx_mstate_global->__pyx_codeobj_tab[2024] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMUtils_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_A_Ja_fAQ_a_1D_2U_LA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2024])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 185};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[2025] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMUtils_pyx, __pyx_mstate->__pyx_n_u_getVector, __pyx_mstate->__pyx_kp_b_iso88591_1_s_a_q_Kq_1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2025])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 201};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_vec};
    __pyx_mstate_global->__pyx_codeobj_tab[2026] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_DMUtils_pyx, __pyx_mstate->__pyx_n_u_restoreVector, __pyx_mstate->__pyx_kp_b_iso88591_a_1D_1Cq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2026])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 42};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_viewer, __pyx_mstate->__pyx_n_u_cviewer};
    __pyx_mstate_global->__pyx_codeobj_tab[2027] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_view, __pyx_mstate->__pyx_kp_b_iso88591_1_7_z_q_a_l, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2027])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 61};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_ccomm, __pyx_mstate->__pyx_n_u_newregressor};
    __pyx_mstate_global->__pyx_codeobj_tab[2028] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_mstate->__pyx_kp_b_iso88591_1_havQ_1_a_1G1A_4wd_q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2028])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 82};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_weight};
    __pyx_mstate_global->__pyx_codeobj_tab[2029] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_setRegularizerWeight, __pyx_mstate->__pyx_kp_b_iso88591_Q_a_1_l, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2029])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 93};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[2030] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_setFromOptions, __pyx_mstate->__pyx_kp_b_iso88591_a_1D_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2030])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 104};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[2031] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_setUp, __pyx_mstate->__pyx_kp_b_iso88591_q_a_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2031])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 116};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_X, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[2032] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_fit, __pyx_mstate->__pyx_kp_b_iso88591_1_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2032])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 135};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_X, __pyx_mstate->__pyx_n_u_y};
    __pyx_mstate_global->__pyx_codeobj_tab[2033] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_predict, __pyx_mstate->__pyx_kp_b_iso88591_q_a_AT_QfAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2033])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 154};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_tao};
    __pyx_mstate_global->__pyx_codeobj_tab[2034] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_getTAO, __pyx_mstate->__pyx_kp_b_iso88591_s_a_1D_AS_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2034])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 168};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[2035] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_mstate->__pyx_kp_b_iso88591_q_a_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2035])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 180};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[2036] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_destroy, __pyx_mstate->__pyx_kp_b_iso88591_a_AQd_q_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2036])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 193};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_regressor_type, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[2037] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_setType, __pyx_mstate->__pyx_kp_b_iso88591_oQ_q_31A_a_AT_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2037])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 212};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ctype};
    __pyx_mstate_global->__pyx_codeobj_tab[2038] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_getType, __pyx_mstate->__pyx_kp_b_iso88591_a_AT_Qa_y, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2038])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 228};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_fitintercept};
    __pyx_mstate_global->__pyx_codeobj_tab[2039] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_setLinearFitIntercept, __pyx_mstate->__pyx_kp_b_iso88591_1_a_a_2_4_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2039])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 240};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flag, __pyx_mstate->__pyx_n_u_useksp};
    __pyx_mstate_global->__pyx_codeobj_tab[2040] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_setLinearUseKSP, __pyx_mstate->__pyx_kp_b_iso88591_IQ_a_AT_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2040])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 252};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ksp};
    __pyx_mstate_global->__pyx_codeobj_tab[2041] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_getLinearKSP, __pyx_mstate->__pyx_kp_b_iso88591_a_s_a_l_3a_a_3a_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2041])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 266};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_coeffs};
    __pyx_mstate_global->__pyx_codeobj_tab[2042] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_getLinearCoefficients, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_a_2_4_1F_a_6_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2042])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 280};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_intercept};
    __pyx_mstate_global->__pyx_codeobj_tab[2043] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_getLinearIntercept, __pyx_mstate->__pyx_kp_b_iso88591_A_Q_a_q_L_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2043])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 293};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_lineartype};
    __pyx_mstate_global->__pyx_codeobj_tab[2044] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_setLinearType, __pyx_mstate->__pyx_kp_b_iso88591_a_4_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2044])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 304};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_cval};
    __pyx_mstate_global->__pyx_codeobj_tab[2045] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_Regressor_pyx, __pyx_mstate->__pyx_n_u_getLinearType, __pyx_mstate->__pyx_kp_b_iso88591_q_Q_a_4_1A_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2045])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 594};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_args, __pyx_mstate->__pyx_n_u_comm, __pyx_mstate->__pyx_n_u_atexit, __pyx_mstate->__pyx_n_u_ready};
    __pyx_mstate_global->__pyx_codeobj_tab[2046] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PETSc_pyx, __pyx_mstate->__pyx_n_u_initialize, __pyx_mstate->__pyx_kp_b_iso88591_1_Zq_a_wha_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2046])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 612};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[2047] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PETSc_pyx, __pyx_mstate->__pyx_n_u_pre_finalize, __pyx_mstate->__pyx_kp_b_iso88591_1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2047])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 617};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[2048] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PETSc_pyx, __pyx_mstate->__pyx_n_u_finalize, __pyx_mstate->__pyx_kp_b_iso88591_A_q_fA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2048])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 640};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[2049] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PETSc_pyx, __pyx_mstate->__pyx_n_u_push_python_vfprintf, __pyx_mstate->__pyx_kp_b_iso88591_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2049])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 644};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[2050] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PETSc_pyx, __pyx_mstate->__pyx_n_u_pop_python_vfprintf, __pyx_mstate->__pyx_kp_b_iso88591__32, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2050])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {0, 0, 0, 0, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 648};
    PyObject* const varnames[] = {0};
    __pyx_mstate_global->__pyx_codeobj_tab[2051] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_petsc4py_PETSc_PETSc_pyx, __pyx_mstate->__pyx_n_u_stdout_is_stderr, __pyx_mstate->__pyx_kp_b_iso88591_1_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2051])) goto bad;
  }
  Py_DECREF(tuple_dedup_map);
  return 0;
  bad:
  Py_DECREF(tuple_dedup_map);
  return -1;
}
/* #### Code section: init_globals ### */

static int __Pyx_InitGlobals(void) {
  /* PythonCompatibility.init */
  if (likely(__Pyx_init_co_variables() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* AssertionsEnabled.init */
  if (likely(__Pyx_init_assertions_enabled() == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CommonTypesMetaclass.init */
  if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CachedMethodType.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
  {
      PyObject *typesModule=NULL;
      typesModule = PyImport_ImportModule("types");
      if (typesModule) {
          __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
          Py_DECREF(typesModule);
      }
  } // error handling follows
  #endif
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CythonFunctionShared.init */
  if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
  
  if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cleanup_globals ### */

static void __Pyx_CleanupGlobals(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  /* CachedMethodType.cleanup */
  #if CYTHON_COMPILING_IN_LIMITED_API
  Py_CLEAR(__pyx_mstate_global->__Pyx_CachedMethodType);
  #endif
  
/* CodeObjectCache.cleanup */
  {
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
    if (code_cache->entries) {
        __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
        int i, count = code_cache->count;
        code_cache->count = 0;
        code_cache->max_count = 0;
        code_cache->entries = NULL;
        for (i=0; i<count; i++) {
            Py_DECREF(entries[i].code_object);
        }
        PyMem_Free(entries);
    }
  }
  
Py_CLEAR(__pyx_mstate->__pyx_umethod_PyDict_Type_get.method);
  Py_CLEAR(__pyx_mstate->__pyx_umethod_PyDict_Type_items.method);
  Py_CLEAR(__pyx_mstate->__pyx_umethod_PyDict_Type_keys.method);
  Py_CLEAR(__pyx_mstate->__pyx_umethod_PyDict_Type_pop.method);
  Py_CLEAR(__pyx_mstate->__pyx_umethod_PyDict_Type_values.method);
  Py_CLEAR(__pyx_mstate->__pyx_umethod_PyList_Type_pop.method);
  for (size_t i=0; i<4; ++i) { Py_CLEAR(__pyx_mstate->__pyx_slice[i]); }
  for (size_t i=0; i<213; ++i) { Py_CLEAR(__pyx_mstate->__pyx_tuple[i]); }
}
/* #### Code section: cleanup_module ### */
static void __pyx_module_cleanup(CYTHON_UNUSED PyObject *self) {
  __pyx_mstatetype *__pyx_mstate;
  #if CYTHON_USE_MODULE_STATE
  if (!__Pyx_State_FindModule(&__pyx_moduledef)) return;
  #endif
  __pyx_mstate = __Pyx_PyModule_GetState(self);
  /*--- Global cleanup code ---*/
  Py_CLEAR(indirect_contiguous);
  Py_CLEAR(contiguous);
  Py_CLEAR(indirect);
  Py_CLEAR(strided);
  Py_CLEAR(generic);
  Py_CLEAR(__pyx_collections_abc_Sequence);
  Py_CLEAR(__pyx_v_8petsc4py_5PETSc_tracebacklist);
  Py_CLEAR(__pyx_v_8petsc4py_5PETSc_dMatOps);
  Py_CLEAR(__pyx_v_8petsc4py_5PETSc_module_cache);
  Py_CLEAR(__pyx_v_8petsc4py_5PETSc_type_registry);
  Py_CLEAR(__pyx_v_8petsc4py_5PETSc___COMM_WORLD__);
  Py_CLEAR(__pyx_v_8petsc4py_5PETSc___COMM_SELF__);
  Py_CLEAR(__pyx_v_8petsc4py_5PETSc___COMM_NULL__);
  Py_CLEAR(__pyx_v_8petsc4py_5PETSc_event_registry);
  Py_CLEAR(__pyx_v_8petsc4py_5PETSc_class_registry);
  Py_CLEAR(__pyx_v_8petsc4py_5PETSc_stage_registry);
  Py_CLEAR(__pyx_v_8petsc4py_5PETSc_functools);
  Py_CLEAR(__pyx_v_8petsc4py_5PETSc_citations_registry);
  Py_CLEAR(__pyx_v_8petsc4py_5PETSc_appctx_registry);
  Py_CLEAR(__pyx_v_8petsc4py_5PETSc_PetscError);
  __Pyx_CleanupGlobals(__pyx_mstate);
  /*--- Type import cleanup code ---*/
  Py_CLEAR(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_dtype);
  Py_CLEAR(__pyx_mstate->__pyx_ptype_8petsc4py_5PETSc_ndarray);
  /*--- Builtin cleanup code ---*/
  Py_CLEAR(__pyx_builtin_object);
  Py_CLEAR(__pyx_builtin_property);
  Py_CLEAR(__pyx_builtin_staticmethod);
  Py_CLEAR(__pyx_builtin_NotImplemented);
  Py_CLEAR(__pyx_builtin_Ellipsis);
  Py_CLEAR(__pyx_builtin_enumerate);
  Py_CLEAR(__pyx_builtin_open);
  Py_CLEAR(__pyx_builtin_compile);
  /*--- Intern cleanup code ---*/
  Py_CLEAR(__pyx_mstate->__pyx_empty_tuple);
  #if CYTHON_USE_FREELISTS
  while (__pyx_mstate->__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator > 0) {
    PyObject* o = (PyObject*)__pyx_mstate->__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator[--__pyx_mstate->__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct__EventDecorator];
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
  #endif
  #if CYTHON_USE_FREELISTS
  while (__pyx_mstate->__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator > 0) {
    PyObject* o = (PyObject*)__pyx_mstate->__pyx_freelist_8petsc4py_5PETSc___pyx_scope_struct_1_decorator[--__pyx_mstate->__pyx_freecount_8petsc4py_5PETSc___pyx_scope_struct_1_decorator];
    PyTypeObject *tp = Py_TYPE(o);
    #if CYTHON_USE_TYPE_SLOTS
    (*tp->tp_free)(o);
    #else
    freefunc tp_free = (freefunc)PyType_GetSlot(tp, Py_tp_free);
    if (tp_free) tp_free(o);
    #endif
    #if CYTHON_USE_TYPE_SPECS
    Py_DECREF(tp);
    #endif
  }
  #endif
  Py_CLEAR(__pyx_mstate->__pyx_cython_runtime);
  Py_CLEAR(__pyx_mstate->__pyx_b);
  Py_CLEAR(__pyx_mstate->__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 (used by PyObjectGetAttrStrNoError) */
#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);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 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 (used by PyObjectGetAttrStrNoError) */
#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 (used by PyObjectGetAttrStrNoError) */
#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);
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
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 >= 0x030d0000
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
    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_mstate_global->__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
            "name '%U' is not defined", name);
    }
    return result;
}

/* TupleAndListFromArray (used by fastcall) */
#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    Py_ssize_t i;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    for (i = 0; i < n; i++) {
        Py_INCREF(src[i]);
        if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
            Py_DECREF(res);
            return NULL;
        }
    }
    return res;
}
#elif 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) {
        return __Pyx_NewRef(__pyx_mstate_global->__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 (used by UnicodeEquals) */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\
        !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS)
    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 (used by fastcall) */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    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 (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length, length2;
        int kind;
        void *data1, *data2;
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        #endif
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length < 0)) return -1;
        #endif
        length2 = __Pyx_PyUnicode_GET_LENGTH(s2);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length2 < 0)) return -1;
        #endif
        if (length != length2) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
            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));
            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_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    return (equals == Py_EQ);
return_ne:
    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 = __Pyx_PyTuple_GET_SIZE(kwnames);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(n == -1)) return NULL;
    #endif
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        if (s == namei) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs;
    PyObject *dict;
#if !CYTHON_ASSUME_SAFE_SIZE
    nkwargs = PyTuple_Size(kwnames);
    if (unlikely(nkwargs < 0)) return NULL;
#else
    nkwargs = PyTuple_GET_SIZE(kwnames);
#endif
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
#if !CYTHON_ASSUME_SAFE_MACROS
        PyObject *key = PyTuple_GetItem(kwnames, i);
        if (!key) goto bad;
#else
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
#endif
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    const char* function_name,
    PyObject *kw)
{
#if CYTHON_COMPILING_IN_PYPY && !defined(PyArg_ValidateKeywordArguments)
    CYTHON_UNUSED_VAR(function_name);
    CYTHON_UNUSED_VAR(kw);
    return 0;
#else
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
#if PY_VERSION_HEX >= 0x03090000
        CYTHON_UNUSED_VAR(function_name);
#else
        Py_ssize_t kwsize;
        #if CYTHON_ASSUME_SAFE_SIZE
        kwsize = PyTuple_GET_SIZE(kw);
        #else
        kwsize = PyTuple_Size(kw);
        if (unlikely(kwsize < 0)) return -1;
        #endif
        for (Py_ssize_t pos = 0; pos < kwsize; pos++) {
            PyObject* key = NULL;
            #if CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kw, pos);
            #else
            key = PyTuple_GetItem(kw, pos);
            if (unlikely(!key)) return -1;
            #endif
            if (unlikely(!PyUnicode_Check(key))) {
                PyErr_Format(PyExc_TypeError,
                    "%.200s() keywords must be strings", function_name);
                return -1;
            }
        }
#endif
    } else {
        if (unlikely(!PyArg_ValidateKeywordArguments(kw))) return -1;
    }
    return 0;
#endif
}

/* PyObjectCall (used by PyObjectFastCall) */
#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 (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    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 (used by PyObjectFastCall) */
#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 (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    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 (used by PyObjectCallOneArg) */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*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
#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
  #if PY_VERSION_HEX < 0x03090000
    #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable)
  #elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
    PyTypeObject *tp = Py_TYPE(callable);
    #if defined(__Pyx_CyFunction_USED)
    if (__Pyx_CyFunction_CheckExact(callable)) {
        return __Pyx_CyFunction_func_vectorcall(callable);
    }
    #endif
    if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
        return NULL;
    }
    assert(PyCallable_Check(callable));
    Py_ssize_t offset = tp->tp_vectorcall_offset;
    assert(offset > 0);
    vectorcallfunc ptr;
    memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
    return ptr;
}
  #else
    #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
  #endif
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *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 (kwargs == NULL) {
        #if CYTHON_VECTORCALL
          #if CYTHON_COMPILING_IN_LIMITED_API
            return PyObject_Vectorcall(func, args, _nargs, NULL);
          #else
            vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
            if (f) {
                return f(func, args, _nargs, NULL);
            }
          #endif
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_mstate_global->__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
}

/* PyObjectCallOneArg (used by CallUnboundCMethod0) */
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);
}

/* UnpackUnboundCMethod (used by CallUnboundCMethod0) */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) {
        return _PyObject_Vectorcall
            (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames);
}
#else
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
    return
#if PY_VERSION_HEX < 0x03090000
    _PyObject_Vectorcall
#else
    PyObject_Vectorcall
#endif
        (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
}
#endif
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
     METH_VARARGS | METH_KEYWORDS,
#else
     METH_FASTCALL | METH_KEYWORDS,
#endif
     NULL
};
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method, *result=NULL;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    result = method;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    {
        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);
            result = unbound_method;
        }
    }
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    if (unlikely(target->method)) {
        Py_DECREF(result);
    } else
#endif
    target->method = result;
    return 0;
}

/* CallUnboundCMethod0 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        if (likely(cfunc->flag == METH_NOARGS))
            return __Pyx_CallCFunction(cfunc, self, NULL);
        if (likely(cfunc->flag == METH_FASTCALL))
            return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
        if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
            return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
        if (cfunc->flag == METH_VARARGS)
            return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
        return __Pyx__CallUnboundCMethod0(cfunc, self);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *result;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
    result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
    return result;
}

/* py_dict_items (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
}

/* py_dict_values (used by OwnedDictNext) */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
}

/* OwnedDictNext (used by ParseKeywordsImpl) */
#if CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
    PyObject *next = NULL;
    if (!*ppos) {
        if (pvalue) {
            PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
            if (unlikely(!dictview)) goto bad;
            *ppos = PyObject_GetIter(dictview);
            Py_DECREF(dictview);
        } else {
            *ppos = PyObject_GetIter(p);
        }
        if (unlikely(!*ppos)) goto bad;
    }
    next = PyIter_Next(*ppos);
    if (!next) {
        if (PyErr_Occurred()) goto bad;
        return 0;
    }
    if (pkey && pvalue) {
        *pkey = __Pyx_PySequence_ITEM(next, 0);
        if (unlikely(*pkey)) goto bad;
        *pvalue = __Pyx_PySequence_ITEM(next, 1);
        if (unlikely(*pvalue)) goto bad;
        Py_DECREF(next);
    } else if (pkey) {
        *pkey = next;
    } else {
        assert(pvalue);
        *pvalue = next;
    }
    return 1;
  bad:
    Py_XDECREF(next);
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
    PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
#else
    PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
#endif
    if (pkey) *pkey = NULL;
    if (pvalue) *pvalue = NULL;
    return 0;
}
#else // !CYTHON_AVOID_BORROWED_REFS
static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
    int result = PyDict_Next(p, ppos, pkey, pvalue);
    if (likely(result == 1)) {
        if (pkey) Py_INCREF(*pkey);
        if (pvalue) Py_INCREF(*pvalue);
    }
    return result;
}
#endif

/* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
        }
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    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)) {
        PyObject *result = NULL;
        PyObject *args = PyTuple_New(2);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
        return result;
    }
#endif
    {
        PyObject *args[4] = {NULL, self, arg1, arg2};
        return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
    }
}

/* ParseKeywordsImpl (used by ParseKeywords) */
static int __Pyx_ValidateDuplicatePosArgs(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char* function_name)
{
    PyObject ** const *name = argnames;
    while (name != first_kw_arg) {
        PyObject *key = **name;
        int found = PyDict_Contains(kwds, key);
        if (unlikely(found)) {
            if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
            goto bad;
        }
        name++;
    }
    return 0;
bad:
    return -1;
}
#if CYTHON_USE_UNICODE_INTERNALS
static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
    int kind;
    Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
    if (len != PyUnicode_GET_LENGTH(s2)) return 0;
    kind = PyUnicode_KIND(s1);
    if (kind != PyUnicode_KIND(s2)) return 0;
    const void *data1 = PyUnicode_DATA(s1);
    const void *data2 = PyUnicode_DATA(s2);
    return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
}
#endif
static int __Pyx_MatchKeywordArg_str(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    #if CYTHON_USE_UNICODE_INTERNALS
    Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
    if (unlikely(key_hash == -1)) {
        key_hash = PyObject_Hash(key);
        if (unlikely(key_hash == -1))
            goto bad;
    }
    #endif
    name = first_kw_arg;
    while (*name) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) {
                *index_found = (size_t) (name - argnames);
                return 1;
            }
        }
        #endif
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
            if (__Pyx_UnicodeKeywordsEqual(name_str, key))
                goto arg_passed_twice;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            if (unlikely(name_str == key)) goto arg_passed_twice;
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) goto arg_passed_twice;
        }
        #endif
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
bad:
    return -1;
}
static int __Pyx_MatchKeywordArg_nostr(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
    name = first_kw_arg;
    while (*name) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (cmp == 1) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        if (unlikely(cmp == -1)) goto bad;
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (unlikely(cmp != 0)) {
            if (cmp == 1) goto arg_passed_twice;
            else goto bad;
        }
        name++;
    }
    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;
bad:
    return -1;
}
static CYTHON_INLINE int __Pyx_MatchKeywordArg(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    return likely(PyUnicode_CheckExact(key)) ?
        __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
        __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
}
static void __Pyx_RejectUnknownKeyword(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char *function_name)
{
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos = NULL;
    #else
    Py_ssize_t pos = 0;
    #endif
    PyObject *key = NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(kwds);
    while (
        #if CYTHON_AVOID_BORROWED_REFS
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL)
        #else
        PyDict_Next(kwds, &pos, &key, NULL)
        #endif
    ) {
        PyObject** const *name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (!*name) {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp != 1) {
                if (cmp == 0) {
                    PyErr_Format(PyExc_TypeError,
                        "%s() got an unexpected keyword argument '%U'",
                        function_name, key);
                }
                #if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(key);
                #endif
                break;
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        #endif
    }
    __Pyx_END_CRITICAL_SECTION();
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(pos);
    #endif
    assert(PyErr_Occurred());
}
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t extracted = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    name = first_kw_arg;
    while (*name && num_kwargs > extracted) {
        PyObject * key = **name;
        PyObject *value;
        int found = 0;
        #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        found = PyDict_GetItemRef(kwds, key, &value);
        #else
        value = PyDict_GetItemWithError(kwds, key);
        if (value) {
            Py_INCREF(value);
            found = 1;
        } else {
            if (unlikely(PyErr_Occurred())) goto bad;
        }
        #endif
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            extracted++;
        }
        name++;
    }
    if (num_kwargs > extracted) {
        if (ignore_unknown_kwargs) {
            if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
                goto bad;
        } else {
            __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
            goto bad;
        }
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t len;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    if (PyDict_Update(kwds2, kwds) < 0) goto bad;
    name = first_kw_arg;
    while (*name) {
        PyObject *key = **name;
        PyObject *value;
#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
        int found = PyDict_Pop(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
        }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        int found = PyDict_GetItemRef(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
        }
#else
    #if CYTHON_COMPILING_IN_CPYTHON
        value = _PyDict_Pop(kwds2, key, kwds2);
    #else
        value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
    #endif
        if (value == kwds2) {
            Py_DECREF(value);
        } else {
            if (unlikely(!value)) goto bad;
            values[name-argnames] = value;
        }
#endif
        name++;
    }
    len = PyDict_Size(kwds2);
    if (len > 0) {
        return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
    } else if (unlikely(len == -1)) {
        goto bad;
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject *key = NULL;
    PyObject** const * name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
#if CYTHON_AVOID_BORROWED_REFS
        key = __Pyx_PySequence_ITEM(kwds, pos);
#else
        key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
#endif
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!key)) goto bad;
#endif
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            PyObject *value = kwvalues[pos];
            values[name-argnames] = __Pyx_NewRef(value);
        } else {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp == 1) {
                PyObject *value = kwvalues[pos];
                values[index_found] = __Pyx_NewRef(value);
            } else {
                if (unlikely(cmp == -1)) goto bad;
                if (kwds2) {
                    PyObject *value = kwvalues[pos];
                    if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                } else if (!ignore_unknown_kwargs) {
                    goto invalid_keyword;
                }
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        key = NULL;
        #endif
    }
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    goto bad;
bad:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(key);
    #endif
    return -1;
}

/* ParseKeywords */
static int __Pyx_ParseKeywords(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)))
        return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
    else if (kwds2)
        return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
    else
        return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
}

/* RaiseArgTupleInvalid */
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)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* ArgTypeTestFunc (used by ArgTypeTest) */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
    int from_annotation_subclass = 0;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (!exact) {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    } else if (exact == 2) {
        if (__Pyx_TypeCheck(obj, type)) {
            from_annotation_subclass = 1;
            extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
        }
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")"
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        "%s%U"
#endif
        , name, type_name, obj_type_name
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        , (from_annotation_subclass ? ". " : ""), extra_info
#endif
        );
#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    if (exact == 2 && from_annotation_subclass) {
        PyObject *res;
        PyObject *vargs[2];
        vargs[0] = PyErr_GetRaisedException();
        vargs[1] = extra_info;
        res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
        Py_XDECREF(res);
        PyErr_SetRaisedException(vargs[0]);
    }
#endif
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* RaiseException */
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;
}

/* PyObjectFastCallMethod */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
    PyObject *result;
    PyObject *attr = PyObject_GetAttr(args[0], name);
    if (unlikely(!attr))
        return NULL;
    result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
    Py_DECREF(attr);
    return result;
}
#endif

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(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 (used by CIntToPyUnicode) */
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 (used by COrdinalToPyUnicode) */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, const 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;
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
    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 = PySequence_Repeat(padding, uoffset - prepend_sign);
                    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 = PyUnicode_Concat(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyUnicode_Concat(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* COrdinalToPyUnicode (used by CIntToPyUnicode) */
static CYTHON_INLINE int __Pyx_CheckUnicodeValue(int value) {
    return value <= 1114111;
}
static PyObject* __Pyx_PyUnicode_FromOrdinal_Padded(int value, Py_ssize_t ulength, char padding_char) {
    Py_ssize_t padding_length = ulength - 1;
    if (likely((padding_length <= 250) && (value < 0xD800 || value > 0xDFFF))) {
        char chars[256];
        if (value <= 255) {
            memset(chars, padding_char, (size_t) padding_length);
            chars[ulength-1] = (char) value;
            return PyUnicode_DecodeLatin1(chars, ulength, NULL);
        }
        char *cpos = chars + sizeof(chars);
        if (value < 0x800) {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xc0 | (value & 0x1f));
        } else if (value < 0x10000) {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xe0 | (value & 0x0f));
        } else {
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0x80 | (value & 0x3f));
            value >>= 6;
            *--cpos = (char) (0xf0 | (value & 0x07));
        }
        cpos -= padding_length;
        memset(cpos, padding_char, (size_t) padding_length);
        return PyUnicode_DecodeUTF8(cpos, chars + sizeof(chars) - cpos, NULL);
    }
    if (value <= 127 && CYTHON_USE_UNICODE_INTERNALS) {
        const char chars[1] = {(char) value};
        return __Pyx_PyUnicode_BuildFromAscii(ulength, chars, 1, 0, padding_char);
    }
    {
        PyObject *uchar, *padding_uchar, *padding, *result;
        padding_uchar = PyUnicode_FromOrdinal(padding_char);
        if (unlikely(!padding_uchar)) return NULL;
        padding = PySequence_Repeat(padding_uchar, padding_length);
        Py_DECREF(padding_uchar);
        if (unlikely(!padding)) return NULL;
        uchar = PyUnicode_FromOrdinal(value);
        if (unlikely(!uchar)) {
            Py_DECREF(padding);
            return NULL;
        }
        result = PyUnicode_Concat(padding, uchar);
        Py_DECREF(padding);
        Py_DECREF(uchar);
        return result;
    }
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char) {
#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 (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                    !(sizeof(value) <= 2 || value & ~ (int) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
        PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
        return NULL;
    }
    if (width <= 1) {
        return PyUnicode_FromOrdinal((int) value);
    }
    return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
}
static CYTHON_INLINE PyObject* __Pyx____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_uchar___Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char) {
#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 (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                    !(sizeof(value) <= 2 || value & ~ (Py_ssize_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
        PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
        return NULL;
    }
    if (width <= 1) {
        return PyUnicode_FromOrdinal((int) value);
    }
    return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
}
static CYTHON_INLINE PyObject* __Pyx____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** values, 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;
    if (max_char > 1114111) max_char = 1114111;
    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);
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
        goto overflow;
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = values[i];
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (__Pyx_PyUnicode_READY(uval) == (-1))
            goto bad;
        #endif
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(ulength < 0)) goto bad;
        #endif
        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 (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 || 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
    Py_ssize_t i;
    PyObject *result = NULL;
    PyObject *value_tuple = PyTuple_New(value_count);
    if (unlikely(!value_tuple)) return NULL;
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    for (i=0; i<value_count; i++) {
        Py_INCREF(values[i]);
        if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
    }
    result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
bad:
    Py_DECREF(value_tuple);
    return result;
#endif
}

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_Check(n)))
        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,
                                                              int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS)) {
        return __Pyx_PyList_GetItemRefFast(o, wrapped_i, unsafe_shared);
    } else
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        return __Pyx_NewRef(PyList_GET_ITEM(o, wrapped_i));
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_SIZE && 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)))) {
        return __Pyx_NewRef(PyTuple_GET_ITEM(o, wrapped_i));
    }
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
#else
    (void)wraparound;
    (void)boundscheck;
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)) {
            return __Pyx_PyList_GetItemRefFast(o, n, unsafe_shared);
        } else if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            return __Pyx_NewRef(PyList_GET_ITEM(o, n));
        }
    } else
    #if !CYTHON_AVOID_BORROWED_REFS
    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)))) {
            return __Pyx_NewRef(PyTuple_GET_ITEM(o, n));
        }
    } else
    #endif
#endif
#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
    {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (!is_list && mm && mm->mp_subscript) {
            PyObject *r, *key = PyLong_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (is_list || 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
    (void)wraparound;
    (void)boundscheck;
    return __Pyx_GetItemInt_Generic(o, PyLong_FromSsize_t(i));
}

/* 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, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        __Pyx_TypeName index_type_name = __Pyx_PyType_GetFullyQualifiedName(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_mstate_global->__pyx_n_u_class_getitem);
        if (!meth) {
            PyErr_Clear();
        } else {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(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

/* RejectKeywords */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
    PyObject *key = NULL;
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) {
        key = __Pyx_PySequence_ITEM(kwds, 0);
    } else {
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *pos = NULL;
#else
        Py_ssize_t pos = 0;
#endif
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
        if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
#endif
        __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL);
#if CYTHON_AVOID_BORROWED_REFS
        Py_XDECREF(pos);
#endif
    }
    if (likely(key)) {
        PyErr_Format(PyExc_TypeError,
            "%s() got an unexpected keyword argument '%U'",
            function_name, key);
        Py_DECREF(key);
    }
}

/* DivInt[Py_ssize_t] */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b, int b_is_constant) {
    Py_ssize_t q = a / b;
    Py_ssize_t r = a - q*b;
    Py_ssize_t adapt_python = (b_is_constant ?
        ((r != 0) & ((r < 0) ^ (b < 0))) :
        ((r != 0) & ((r ^ b) < 0))
    );
    return q - adapt_python;
}

/* GetAttr3 */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
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 >= 0x030d0000
    int res = PyObject_GetOptionalAttr(o, n, &r);
    return (res != 0) ? r : __Pyx_NewRef(d);
#else
  #if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_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 (used by GetModuleGlobalName) */
#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_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        if (!PyErr_Occurred())
            PyErr_SetNone(PyExc_NameError);
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
    PyErr_Clear();
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear();
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return result;
    }
#else
    result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__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_GetFullyQualifiedName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetFullyQualifiedName(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 (used by SaveResetException) */
#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 >= 0x030C0000
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
  #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
#elif __PYX_LIMITED_VERSION_HEX > 0x030C0000
    local_value = PyErr_GetRaisedException();
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
#if __PYX_LIMITED_VERSION_HEX > 0x030C0000
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
#else
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000
    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);
#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    PyErr_SetHandledException(local_value);
    Py_XDECREF(local_value);
    Py_XDECREF(local_type);
    Py_XDECREF(local_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
#endif
}

/* 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

/* HasAttr (used by ImportImpl) */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!PyUnicode_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_PyObject_GetAttrStrNoError(o, n);
    if (!r) {
        return (unlikely(PyErr_Occurred())) ? -1 : 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}
#endif

/* ImportImpl (used by Import) */
static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
    PyObject *imported_module = PyImport_GetModule(qualname);
    if (unlikely(!imported_module)) {
        *module = NULL;
        if (PyErr_Occurred()) {
            return -1;
        }
        return 0;
    }
    *module = imported_module;
    return 1;
}
static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
    PyObject *imported_module;
    PyObject *top_level_package_name;
    Py_ssize_t i;
    int status, module_found;
    Py_ssize_t dot_index;
    module_found = __Pyx__Import_GetModule(qualname, &imported_module);
    if (unlikely(!module_found || module_found == -1)) {
        *module = NULL;
        return module_found;
    }
    if (imported_names) {
        for (i = 0; i < len_imported_names; i++) {
            PyObject *imported_name = imported_names[i];
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
            int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
#else
            int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
            if (unlikely(has_imported_attribute == -1)) goto error;
#endif
            if (!has_imported_attribute) {
                goto not_found;
            }
        }
        *module = imported_module;
        return 1;
    }
    dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
    if (dot_index == -1) {
        *module = imported_module;
        return 1;
    }
    if (unlikely(dot_index == -2)) goto error;
    top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
    if (unlikely(!top_level_package_name)) goto error;
    Py_DECREF(imported_module);
    status = __Pyx__Import_GetModule(top_level_package_name, module);
    Py_DECREF(top_level_package_name);
    return status;
error:
    Py_DECREF(imported_module);
    *module = NULL;
    return -1;
not_found:
    Py_DECREF(imported_module);
    *module = NULL;
    return 0;
}
static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *from_list = 0;
    int module_found;
    if (!qualname) {
        qualname = name;
    }
    module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
    if (likely(module_found == 1)) {
        return module;
    } else if (unlikely(module_found == -1)) {
        return NULL;
    }
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    if (imported_names) {
#if CYTHON_COMPILING_IN_CPYTHON
        from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
        if (unlikely(!from_list))
            goto bad;
#else
        from_list = PyList_New(len_imported_names);
        if (unlikely(!from_list)) goto bad;
        for (Py_ssize_t i=0; i<len_imported_names; ++i) {
            if (PyList_SetItem(from_list, i, __Pyx_NewRef(imported_names[i])) < 0) goto bad;
        }
#endif
    }
    if (level == -1) {
        const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
        if (package_sep != (0)) {
            module = PyImport_ImportModuleLevelObject(
                name, moddict, empty_dict, from_list, 1);
            if (unlikely(!module)) {
                if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                    goto bad;
                PyErr_Clear();
            }
        }
        level = 0;
    }
    if (!module) {
        module = PyImport_ImportModuleLevelObject(
            name, moddict, empty_dict, from_list, level);
    }
bad:
    Py_XDECREF(from_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
    return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
}

/* 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);
}
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);
    }
}
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);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* PySequenceMultiply */
#if CYTHON_USE_TYPE_SLOTS
static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
    PyObject *result, *pymul = PyLong_FromSsize_t(mul);
    if (unlikely(!pymul))
        return NULL;
    result = PyNumber_Multiply(seq, pymul);
    Py_DECREF(pymul);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
    PyTypeObject *type = Py_TYPE(seq);
    if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
        return type->tp_as_sequence->sq_repeat(seq, mul);
    } else {
        return __Pyx_PySequence_Multiply_Generic(seq, mul);
    }
}
#endif

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    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;
}

/* PyObjectFormat */
#if CYTHON_USE_UNICODE_WRITER
static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
    int ret;
    _PyUnicodeWriter writer;
    if (likely(PyFloat_CheckExact(obj))) {
        _PyUnicodeWriter_Init(&writer);
        ret = _PyFloat_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else if (likely(PyLong_CheckExact(obj))) {
        _PyUnicodeWriter_Init(&writer);
        ret = _PyLong_FormatAdvancedWriter(
            &writer,
            obj,
            format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
    } else {
        return PyObject_Format(obj, format_spec);
    }
    if (unlikely(ret == -1)) {
        _PyUnicodeWriter_Dealloc(&writer);
        return NULL;
    }
    return _PyUnicodeWriter_Finish(&writer);
}
#endif

/* 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,
                                               int wraparound, int boundscheck, int unsafe_shared) {
    CYTHON_MAYBE_UNUSED_VAR(unsafe_shared);
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE && !CYTHON_AVOID_BORROWED_REFS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared))) {
            Py_INCREF(v);
            return PyList_SetItem(o, n, v);
        } else if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
            PyObject* old;
            Py_INCREF(v);
            old = PyList_GET_ITEM(o, n);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 0;
        }
    } else
#endif
#if CYTHON_USE_TYPE_SLOTS && !CYTHON_COMPILING_IN_PYPY
    {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (!is_list && mm && mm->mp_ass_subscript) {
            int r;
            PyObject *key = PyLong_FromSsize_t(i);
            if (unlikely(!key)) return -1;
            r = mm->mp_ass_subscript(o, key, v);
            Py_DECREF(key);
            return r;
        }
        if (is_list || 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
    (void)wraparound;
    (void)boundscheck;
    return __Pyx_SetItemInt_Generic(o, PyLong_FromSsize_t(i), v);
}

/* RaiseUnboundLocalError */
static 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, int b_is_constant) {
    long q = a / b;
    long r = a - q*b;
    long adapt_python = (b_is_constant ?
        ((r != 0) & ((r < 0) ^ (b < 0))) :
        ((r != 0) & ((r ^ b) < 0))
    );
    return q - adapt_python;
}

/* PyObjectCall2Args (used by PyObjectCallMethod1) */
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 (used by PyObjectCallMethod1) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
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))
#else
        #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
#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_GetFullyQualifiedName(tp);
    PyErr_Format(PyExc_AttributeError,
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
    __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;
}
#endif

/* PyObjectCallMethod1 (used by StringJoin) */
#if !(CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000)))
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 >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[2] = {obj, arg};
    (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_LIMITED_API && PY_VERSION_HEX >= 0x030e0000 || defined(PyBytes_Join)
    return PyBytes_Join(sep, values);
#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyBytes_Join)
    return _PyBytes_Join(sep, values);
#else
    return __Pyx_PyObject_CallMethod1(sep, __pyx_mstate_global->__pyx_n_u_join, values);
#endif
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_size_t(size_t value, Py_ssize_t width, char padding_char) {
#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 (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                    !(sizeof(value) <= 2 || value & ~ (size_t) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
        PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
        return NULL;
    }
    if (width <= 1) {
        return PyUnicode_FromOrdinal((int) value);
    }
    return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
}
static CYTHON_INLINE PyObject* __Pyx____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 (used by decode_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_mstate_global->__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);
    }
}

/* 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, CYTHON_UNUSED int wraparound) {
    __Pyx_TypeName obj_type_name;
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#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 = PyLong_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 = PyLong_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_GetFullyQualifiedName(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;
}

/* 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, CYTHON_UNUSED int wraparound) {
    __Pyx_TypeName obj_type_name;
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_ass_subscript))
#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 = PyLong_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 = PyLong_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_GetFullyQualifiedName(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;
}

/* 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
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
    else state = (PyGILState_STATE)0;
    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(0);
    }
    ctx = PyUnicode_FromString(name);
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
    if (nogil)
        PyGILState_Release(state);
}

/* 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_mstate_global->__pyx_n_u_pop, py_ix);
}
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
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, PyLong_FromSsize_t(ix));
    } else {
        return __Pyx__PyObject_PopIndex(L, py_ix);
    }
}
#endif

/* 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_mstate_global->__pyx_kp_u__2);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400) ||\
                CYTHON_COMPILING_IN_GRAAL
        {
            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, "cannot import name %S", name);
    }
    return value;
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    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);
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* CallUnboundCMethod1 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    int was_initialized =  __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return __Pyx_CallCFunction(cfunc, self, arg);
        } else if (flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, &arg, 1);
        } else if (flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, &arg, 1, NULL);
        }
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod1(&tmp_cfunc, self, arg);
    }
#endif
    PyObject* result = __Pyx__CallUnboundCMethod1(cfunc, self, arg);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *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)) {
        PyObject *args = PyTuple_New(1);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
    } else
#endif
    {
        result = __Pyx_PyObject_Call2Args(cfunc->method, self, arg);
    }
    return result;
}

/* dict_getitem_default */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if !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 (PyBytes_CheckExact(key) || PyUnicode_CheckExact(key) || PyLong_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_mstate_global->__pyx_umethod_PyDict_Type_get, d, key);
        else
            value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_get, d, key, default_value);
    }
    return value;
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_uchar___Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char) {
#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 (unlikely(!(is_unsigned || value == 0 || value > 0) ||
                    !(sizeof(value) <= 2 || value & ~ (long) 0x01fffff || __Pyx_CheckUnicodeValue((int) value)))) {
        PyErr_SetString(PyExc_OverflowError, "%c arg not in range(0x110000)");
        return NULL;
    }
    if (width <= 1) {
        return PyUnicode_FromOrdinal((int) value);
    }
    return __Pyx_PyUnicode_FromOrdinal_Padded((int) value, width, padding_char);
}
static CYTHON_INLINE PyObject* __Pyx____Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(long)*3+2];
    char *dpos, *end = digits + sizeof(long)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    long remaining;
#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 (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 = (long) (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 = (long) (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 = (long) (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);
}

/* 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 >= 0x030d00A2 || defined(PyDict_Pop)
    PyObject *value;
    if (PyDict_Pop(d, key, &value) == 0) {
        if (default_value) {
            Py_INCREF(default_value);
        } else {
            PyErr_SetObject(PyExc_KeyError, key);
        }
        value = default_value;
    }
    return value;
#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
    return _PyDict_Pop(d, key, default_value);
#else
    if (default_value) {
        return __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, d, key, default_value);
    } else {
        return __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, d, key);
    }
#endif
}

/* py_dict_keys */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) {
    return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_keys, d);
}

/* PyLongCompare */
static CYTHON_INLINE int __Pyx_PyLong_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 1;
    }
    #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;
        double a = __Pyx_PyFloat_AS_DOUBLE(op1);
        return ((double)a == (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* PyLongBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_Fallback___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, int inplace) {
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject* __Pyx_Unpacked___Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    long a;
    const PY_LONG_LONG llb = intval;
    PY_LONG_LONG lla;
    if (unlikely(__Pyx_PyLong_IsZero(op1))) {
        return __Pyx_NewRef(op2);
    }
    const int is_positive = __Pyx_PyLong_IsPos(op1);
    const digit* digits = __Pyx_PyLong_Digits(op1);
    const Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
    if (likely(size == 1)) {
        a = (long) digits[0];
        if (!is_positive) a *= -1;
    } else {
        switch (size) {
            case 2:
                if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                    a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if (!is_positive) a *= -1;
                    goto calculate_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]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            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]));
                    if (!is_positive) a *= -1;
                    goto calculate_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]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
            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]));
                    if (!is_positive) a *= -1;
                    goto calculate_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]));
                    if (!is_positive) lla *= -1;
                    goto calculate_long_long;
                }
                break;
        }
        return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    calculate_long:
        {
            long x;
            x = a + b;
            return PyLong_FromLong(x);
        }
    calculate_long_long:
        {
            PY_LONG_LONG llx;
            llx = lla + llb;
            return PyLong_FromLongLong(llx);
        }
    
}
#endif
static PyObject* __Pyx_Float___Pyx_PyLong_AddObjC(PyObject *float_val, long intval, int zerodivision_check) {
    CYTHON_UNUSED_VAR(zerodivision_check);
    const long b = intval;
    double a = __Pyx_PyFloat_AS_DOUBLE(float_val);
        double result;
        
        result = ((double)a) + (double)b;
        return PyFloat_FromDouble(result);
}
static CYTHON_INLINE PyObject* __Pyx_PyLong_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        return __Pyx_Unpacked___Pyx_PyLong_AddObjC(op1, op2, intval, inplace, zerodivision_check);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        return __Pyx_Float___Pyx_PyLong_AddObjC(op1, intval, zerodivision_check);
    }
    return __Pyx_Fallback___Pyx_PyLong_AddObjC(op1, op2, inplace);
}
#endif

/* PyObjectCallNoArg (used by pyfrozenset_new) */
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);
}

/* pyfrozenset_new (used by PySetContains) */
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 ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
#if CYTHON_COMPILING_IN_LIMITED_API
            || __Pyx_get_runtime_version() >= 0x030A0000
#endif
            )
            return result;
        {
            Py_ssize_t size = __Pyx_PySet_GET_SIZE(result);
            if (likely(size > 0))
                return result;
#if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely(size < 0)) {
                Py_DECREF(result);
                return NULL;
            }
#endif
        }
        Py_DECREF(result);
#endif
    }
    return __Pyx_PyObject_CallNoArg((PyObject*) &PyFrozenSet_Type);
}

/* 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_mstate_global->__pyx_n_u_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* RaiseClosureNameError */
static 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);
    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

/* dict_setdefault (used by FetchCommonType) */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
    PyObject* value;
#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
    PyDict_SetDefaultRef(d, key, default_value, &value);
#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    PyObject *args[] = {d, key, default_value};
    value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
#else
    value = PyDict_SetDefault(d, key, default_value);
    if (unlikely(!value)) return NULL;
    Py_INCREF(value);
#endif
    return value;
}

/* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */
#if CYTHON_COMPILING_IN_LIMITED_API
static Py_ssize_t __Pyx_GetTypeDictOffset(void) {
    PyObject *tp_dictoffset_o;
    Py_ssize_t tp_dictoffset;
    tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__");
    if (unlikely(!tp_dictoffset_o)) return -1;
    tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
    Py_DECREF(tp_dictoffset_o);
    if (unlikely(tp_dictoffset == 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' doesn't have a dictoffset");
        return -1;
    } else if (unlikely(tp_dictoffset < 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' has an unexpected negative dictoffset. "
            "Please report this as Cython bug");
        return -1;
    }
    return tp_dictoffset;
}
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
    static Py_ssize_t tp_dictoffset = 0;
    if (unlikely(tp_dictoffset == 0)) {
        tp_dictoffset = __Pyx_GetTypeDictOffset();
        if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
            tp_dictoffset = 0; // try again next time?
            return NULL;
        }
    }
    return *(PyObject**)((char*)tp + tp_dictoffset);
}
#endif

/* SetItemOnTypeDict (used by FixUpExtensionType) */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_SetItem(tp_dict, k, v);
    if (likely(!result)) {
        PyType_Modified(tp);
        if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
            PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name,  (PyObject *) tp, k, NULL);
            if (!setNameResult) return -1;
            Py_DECREF(setNameResult);
        }
    }
    return result;
}

/* FixUpExtensionType (used by FetchCommonType) */
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if __PYX_LIMITED_VERSION_HEX > 0x030900B1
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#else
    const PyType_Slot *slot = spec->slots;
    int changed = 0;
#if !CYTHON_COMPILING_IN_LIMITED_API
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
#if !CYTHON_COMPILING_IN_CPYTHON
        const
#endif  // !CYTHON_COMPILING_IN_CPYTHON)
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
                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);
                    type->tp_vectorcall_offset = memb->offset;
                    changed = 1;
                }
#endif  // CYTHON_METH_FASTCALL
#if !CYTHON_COMPILING_IN_PYPY
                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;
                    int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                    Py_DECREF(descr);
                    if (unlikely(set_item_result < 0)) {
                        return -1;
                    }
                    changed = 1;
                }
#endif  // !CYTHON_COMPILING_IN_PYPY
            }
            memb++;
        }
    }
#endif  // !CYTHON_COMPILING_IN_LIMITED_API
#if !CYTHON_COMPILING_IN_PYPY
    slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_getset)
        slot++;
    if (slot && slot->slot == Py_tp_getset) {
        PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc;
        while (getset && getset->name) {
            if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) {
                PyObject *descr = PyDescr_NewGetSet(type, getset);
                if (unlikely(!descr))
                    return -1;
                #if CYTHON_COMPILING_IN_LIMITED_API
                PyObject *pyname = PyUnicode_FromString(getset->name);
                if (unlikely(!pyname)) {
                    Py_DECREF(descr);
                    return -1;
                }
                int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr);
                Py_DECREF(pyname);
                #else
                CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
                int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
                #endif
                Py_DECREF(descr);
                if (unlikely(set_item_result < 0)) {
                    return -1;
                }
                changed = 1;
            }
            ++getset;
        }
    }
#else
    CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
#endif  // !CYTHON_COMPILING_IN_PYPY
    if (changed)
        PyType_Modified(type);
#endif  // PY_VERSION_HEX > 0x030900B1
    return 0;
}

/* AddModuleRef (used by FetchSharedCythonModule) */
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
      PyObject *module_dict = PyImport_GetModuleDict();
      PyObject *m;
      if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
          return NULL;
      }
      if (m != NULL && PyModule_Check(m)) {
          return m;
      }
      Py_XDECREF(m);
      m = PyModule_NewObject(name);
      if (m == NULL)
          return NULL;
      if (PyDict_CheckExact(module_dict)) {
          PyObject *new_m;
          (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
          Py_DECREF(m);
          return new_m;
      } else {
           if (PyObject_SetItem(module_dict, name, m) != 0) {
                Py_DECREF(m);
                return NULL;
            }
            return m;
      }
  }
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *py_name = PyUnicode_FromString(name);
      if (!py_name) return NULL;
      PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
      Py_DECREF(py_name);
      return module;
  }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif

/* FetchSharedCythonModule (used by FetchCommonType) */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
}

/* FetchCommonType (used by CommonTypesMetaclass) */
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
    if (result && metaclass) {
        PyObject *old_tp = (PyObject*)Py_TYPE(result);
    Py_INCREF((PyObject*)metaclass);
#if __PYX_LIMITED_VERSION_HEX >= 0x03090000
        Py_SET_TYPE(result, metaclass);
#else
        result->ob_type = metaclass;
#endif
        Py_DECREF(old_tp);
    }
    return result;
}
#else
#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
#endif
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t expected_basicsize) {
    Py_ssize_t basicsize;
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (expected_basicsize == 0) {
        return 0; // size is inherited, nothing useful to check
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
    if (unlikely(!py_basicsize)) return -1;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = NULL;
    if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
#else
    basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
#endif
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
    int get_item_ref_result;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    py_object_name = PyUnicode_FromString(object_name);
    if (!py_object_name) return NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) goto done;
    abi_module_dict = PyModule_GetDict(abi_module);
    if (!abi_module_dict) goto done;
    get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
    if (get_item_ref_result == 1) {
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else if (unlikely(get_item_ref_result == -1)) {
        goto bad;
    }
    cached_type = __Pyx_PyType_FromMetaclass(
        metaclass,
        CYTHON_USE_MODULE_STATE ? module : 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;
    new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
    if (unlikely(new_cached_type != cached_type)) {
        if (unlikely(!new_cached_type)) goto bad;
        Py_DECREF(cached_type);
        cached_type = new_cached_type;
        if (__Pyx_VerifyCachedType(
                cached_type,
                object_name,
                spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else {
        Py_DECREF(new_cached_type);
    }
done:
    Py_XDECREF(abi_module);
    Py_DECREF(py_object_name);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CommonTypesMetaclass (used by CythonFunctionShared) */
static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
    return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
}
#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
    PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
    return NULL;
}
static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
    PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
    return -1;
}
#endif
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
    {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
    {0, 0, 0, 0, 0}
};
static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
    {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
    #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
    {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
    #endif
    {0, 0}
};
static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
    __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
    0,
    0,
    Py_TPFLAGS_IMMUTABLETYPE |
    Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT,
    __pyx_CommonTypesMetaclass_slots
};
static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    PyObject *bases = PyTuple_Pack(1, &PyType_Type);
    if (unlikely(!bases)) {
        return -1;
    }
    mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
    Py_DECREF(bases);
    if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
        return -1;
    }
    return 0;
}

/* CallTypeTraverse (used by CythonFunctionShared) */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
    if (__Pyx_get_runtime_version() < 0x03090000) return 0;
    #endif
    if (!always_call) {
        PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
        unsigned long flags = PyType_GetFlags(base);
        if (flags & Py_TPFLAGS_HEAPTYPE) {
            return 0;
        }
    }
    Py_VISIT((PyObject*)Py_TYPE(o));
    return 0;
}
#endif

/* PyMethodNew (used by CythonFunctionShared) */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    PyObject *result;
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    {
        PyObject *args[] = {func, self};
        result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
    }
    #else
    result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
    #endif
    return result;
}
#else
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);
}
#endif

/* PyVectorcallFastCallDict (used by CythonFunctionShared) */
#if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
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;
    #if CYTHON_AVOID_BORROWED_REFS
    PyObject *pos;
    #else
    Py_ssize_t pos;
    #endif
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    #if !CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t nkw = PyDict_Size(kw);
    if (unlikely(nkw == -1)) return NULL;
    #else
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    #endif
    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 = 0;
    i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
        keys_are_strings &=
        #if CYTHON_COMPILING_IN_LIMITED_API
            PyType_GetFlags(Py_TYPE(key));
        #else
            Py_TYPE(key)->tp_flags;
        #endif
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
        #else
        PyTuple_SET_ITEM(kwnames, i, key);
        #endif
        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:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(pos);
    #endif
    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)
{
    Py_ssize_t kw_size =
        likely(kw == NULL) ?
        0 :
#if !CYTHON_ASSUME_SAFE_SIZE
        PyDict_Size(kw);
#else
        PyDict_GET_SIZE(kw);
#endif
    if (kw_size == 0) {
        return vc(func, args, nargs, NULL);
    }
#if !CYTHON_ASSUME_SAFE_SIZE
    else if (unlikely(kw_size == -1)) {
        return NULL;
    }
#endif
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared (used by CythonFunction) */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
    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;
}
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
        int result;
        PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func_2);
        if (unlikely(!newFunc)) {
            PyErr_Clear(); // It's only an optimization, so don't throw an error
            return 0;
        }
        result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
        Py_DECREF(newFunc);
        return result;
    }
    return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if (PyMethod_Check(func)) {
        func = PyMethod_GET_FUNCTION(func);
    }
    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_locked(__pyx_CyFunctionObject *op)
{
    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) {
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
            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 PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) {
    PyObject *result;
    CYTHON_UNUSED_VAR(closure);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_doc_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
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_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#else
        op->func_name = PyUnicode_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 PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_name_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    Py_INCREF(op->func_qualname);
    result = op->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
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;
}
#endif
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_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    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 PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_defaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    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_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    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 PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_kwdefaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int __Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value);
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_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    __Pyx_END_CRITICAL_SECTION();
    if (unlikely(__Pyx_CyFunction_set_annotate_in_dict_if_exists((PyObject*) op, Py_None) < 0)) return -1;
    return 0;
}
static int
__Pyx_CyFunction_get_dict_if_exists(PyObject *op_in, PyObject **dict) {
    /* Return 1 if the function dict exists, 0 otherwise.  This cannot fail:
     * _PyObject_GetDictPtr() may clear errors internally, but never reports them. */
#if CYTHON_COMPILING_IN_PYPY
    *dict = PyObject_GenericGetDict(op_in, NULL);
#elif CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030C0000
    *dict = ((__pyx_CyFunctionObject*) op_in)->func_dict;
#else
    PyObject **dictptr = _PyObject_GetDictPtr(op_in);
    *dict = likely(dictptr) ? *dictptr : NULL;
#endif
    return *dict ? 1 : 0;
}
static int
__Pyx_CyFunction_get_annotate_from_dict_if_exists(PyObject *op_in, PyObject **annotate) {
    PyObject *dict;
    int dict_found;
    *annotate = NULL;
    dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
    if (!dict_found) return 0;
    return __Pyx_PyDict_GetItemRef(dict, __pyx_mstate_global->__pyx_n_u_annotate, annotate);
}
static int
__Pyx_CyFunction_set_annotate_in_dict_if_exists(PyObject *op_in, PyObject *value) {
    PyObject *dict;
    int dict_found;
    dict_found = __Pyx_CyFunction_get_dict_if_exists(op_in, &dict);
    if (!dict_found) return 0;
    return PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
}
static int
__Pyx_CyFunction_set_annotate_in_dict(PyObject *op_in, PyObject *value) {
    PyObject *dict;
    int result;
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    dict = __Pyx_CyFunction_get_dict((__pyx_CyFunctionObject*) op_in, NULL);
#else
    dict = PyObject_GenericGetDict(op_in, NULL);
#endif
    if (unlikely(!dict)) return -1;
    result = PyDict_SetItem(dict, __pyx_mstate_global->__pyx_n_u_annotate, value);
    Py_DECREF(dict);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    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_annotations(PyObject *op_in, void *context) {
    PyObject *annotate = NULL;
    PyObject *result = NULL;
    __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    result = __Pyx_XNewRef(op->func_annotations);
    __Pyx_END_CRITICAL_SECTION();
    if (result) return result;
    if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
    if (!annotate || annotate == Py_None) {
        Py_XDECREF(annotate);
        __Pyx_BEGIN_CRITICAL_SECTION(op_in);
        result = __Pyx_CyFunction_get_annotations_locked(op);
        __Pyx_END_CRITICAL_SECTION();
        return result;
    }
    PyObject *format = PyLong_FromLong(1L);  // annotationlib.Format.VALUE
    if (likely(format)) {
        result = __Pyx_PyObject_CallOneArg(annotate, format);
        Py_DECREF(format);
    }
    Py_DECREF(annotate);
    if (unlikely(!result)) return NULL;
    if (unlikely(!PyDict_Check(result))) {
        PyErr_SetString(PyExc_TypeError, "__annotate__ must return a dict");
        Py_DECREF(result);
        return NULL;
    }
    __Pyx_BEGIN_CRITICAL_SECTION(op_in);
    __Pyx_Py_XDECREF_SET(op->func_annotations, __Pyx_NewRef(result));
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyObject *__Pyx_CyFunction_annotate_impl(PyObject *self, PyObject *args) {
    CYTHON_UNUSED_VAR(args);
    if (unlikely(!self)) {
        PyErr_SetString(PyExc_SystemError, "cython __annotate__ called without 'self' argument");
    }
    Py_XINCREF(self);
    return self;
}
static PyMethodDef __Pyx_CyFunction_annotate_method = {
    "__annotate__",
    (PyCFunction)(void (*)(void))__Pyx_CyFunction_annotate_impl,
    METH_VARARGS,
    "Placeholder __annotate__ function to allow 'functools.wraps' to work "
    "on Cython functions."
};
static PyObject *
__Pyx_CyFunction_get_annotate(PyObject *op_in, void *context) {
    PyObject *annotate = NULL;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(__Pyx_CyFunction_get_annotate_from_dict_if_exists(op_in, &annotate) < 0)) return NULL;
    if (annotate) return annotate;
    PyObject *annotations = __Pyx_CyFunction_get_annotations(op_in, NULL);
    if (unlikely(!annotations)) return NULL;
    PyObject *method = PyCFunction_New(
        &__Pyx_CyFunction_annotate_method,
        annotations);
    Py_DECREF(annotations);
    return method;
}
static int
__Pyx_CyFunction_set_annotate(PyObject *op_in, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        PyErr_SetString(PyExc_TypeError, "__annotate__ cannot be deleted");
        return -1;
    }
    if (unlikely(value != Py_None && !PyCallable_Check(value))) {
        PyErr_SetString(PyExc_TypeError, "__annotate__ must be callable or None");
        return -1;
    }
    if (value != Py_None) {
        __pyx_CyFunctionObject *op = (__pyx_CyFunctionObject*) op_in;
        __Pyx_BEGIN_CRITICAL_SECTION(op_in);
        Py_CLEAR(op->func_annotations);
        __Pyx_END_CRITICAL_SECTION();
    }
    return __Pyx_CyFunction_set_annotate_in_dict(op_in, value);
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
    int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
    if (is_coroutine) {
        PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_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(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(is_coroutine_value)) {
            return is_coroutine_value;
        }
ignore:
        PyErr_Clear();
    }
    return __Pyx_PyBool_FromLong(is_coroutine);
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    result = __Pyx_CyFunction_get_is_coroutine_value(op);
    if (unlikely(!result))
        return NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    if (op->func_is_coroutine) {
        Py_DECREF(result);
        result = __Pyx_NewRef(op->func_is_coroutine);
    } else {
        op->func_is_coroutine = __Pyx_NewRef(result);
    }
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        py_name, message, size);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        name, message, size);
#endif
}
static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s",
        py_name, message);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s",
        name, message);
#endif
}
#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[] = {
    {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
    {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
    {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
#else
    {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
    {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
#endif
    {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {"__annotate__", (getter)__Pyx_CyFunction_get_annotate, (setter)__Pyx_CyFunction_set_annotate, 0, 0},
    {"_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
    {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#endif
#if CYTHON_METH_FASTCALL
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {"__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)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(args);
    __Pyx_BEGIN_CRITICAL_SECTION(m);
    Py_INCREF(m->func_qualname);
    result = m->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if 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
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_dict = NULL;
#endif
    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 = 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
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func_dict);
#elif PY_VERSION_HEX < 0x030d0000
    _PyObject_ClearManagedDict((PyObject*)m);
#else
    PyObject_ClearManagedDict((PyObject*)m);
#endif
    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 PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    Py_CLEAR(m->defaults);
    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)
{
    {
        int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
#if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func_dict);
#else
    {
        int e =
#if PY_VERSION_HEX < 0x030d0000
            _PyObject_VisitManagedDict
#else
            PyObject_VisitManagedDict
#endif
                ((PyObject*)m, visit, arg);
        if (e != 0) return e;
    }
#endif
    __Pyx_VISIT_CONST(m->func_name);
    __Pyx_VISIT_CONST(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    __Pyx_VISIT_CONST(m->func_code);
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_annotations);
    Py_VISIT(m->func_is_coroutine);
    Py_VISIT(m->defaults);
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
    PyObject *repr;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
    __Pyx_END_CRITICAL_SECTION();
    return repr;
}
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;
    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(*)(void))meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            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);
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes no arguments", size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            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;
            }
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes exactly one argument", size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
    __Pyx_CyFunction_raise_type_error(
        (__pyx_CyFunctionObject*)func, "takes no keyword arguments");
    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 && CYTHON_VECTORCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
        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_SIZE
        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);
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
            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 && CYTHON_VECTORCALL
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)) {
            __Pyx_CyFunction_raise_type_error(
                cyfunc, "needs an argument");
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
        __Pyx_CyFunction_raise_type_error(
            cyfunc, "takes no keyword arguments");
        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;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes no arguments", nargs);
        return NULL;
    }
    return 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;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes exactly one argument", nargs);
        return NULL;
    }
    return 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;
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))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;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    #if PY_VERSION_HEX < 0x030e00A6
    size_t nargs_value = (size_t) nargs;
    #else
    Py_ssize_t nargs_value = nargs;
    #endif
    return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
}
#endif
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 CYTHON_METH_FASTCALL
#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
    Py_TPFLAGS_HAVE_VECTORCALL |
#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
#endif // CYTHON_METH_FASTCALL
#if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
    Py_TPFLAGS_MANAGED_DICT |
#endif
    Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
static int __pyx_CyFunction_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
        mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
    if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
    if (unlikely(!m->defaults))
        return NULL;
    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_mstate_global->__pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* PyObjectCallMethod0 (used by pop) */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
#if CYTHON_VECTORCALL && (__PYX_LIMITED_VERSION_HEX >= 0x030C0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x03090000))
    PyObject *args[1] = {obj};
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_CallNoArg;
    return PyObject_VectorcallMethod(method_name, args, 1 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    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;
#endif
}

/* 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_mstate_global->__pyx_n_u_pop);
}
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
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_mstate_global->__pyx_umethod_PyList_Type_pop, L);
}
#endif

/* DictGetItem */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    if (unlikely(__Pyx_PyDict_GetItemRef(d, key, &value) == 0)) { // no value, no error
        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 value;
}
#endif

/* PyObjectVectorCallKwBuilder (used by PyObjectVectorCallMethodKwBuilder) */
#if CYTHON_VECTORCALL
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_PyObject_FastCallDict;
    Py_INCREF(key);
    if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1;
    args[n] = value;
    return 0;
}
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_VectorcallBuilder_AddArgStr;
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n);
}
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    PyObject *pyKey = PyUnicode_FromString(key);
    if (!pyKey) return -1;
    return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n);
}
#else // CYTHON_VECTORCALL
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) {
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return PyDict_SetItem(builder, key, value);
}
#endif

/* PyObjectVectorCallMethodKwBuilder */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) {
    PyObject *result;
    PyObject *obj = PyObject_GetAttr(args[0], name);
    if (unlikely(!obj))
        return NULL;
    result = __Pyx_Object_Vectorcall_CallFromBuilder(obj, args+1, nargsf-1, kwnames);
    Py_DECREF(obj);
    return result;
}
#endif

/* PyLongCompare */
static CYTHON_INLINE PyObject* __Pyx_PyLong_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 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;
        double a = __Pyx_PyFloat_AS_DOUBLE(op1);
        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_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);
}
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice_locked(
            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_PyList_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(src);
    result = __Pyx_PyList_GetSlice_locked(src, start, stop);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
#endif // CYTHON_COMPILING_IN_CPYTHON

/* 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;
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyObject* s = 0;
    char *code = 0;
#endif
    if (!globals || globals == Py_None) {
        globals = __pyx_mstate_global->__pyx_d;
    }
#if !CYTHON_COMPILING_IN_LIMITED_API
    else if (unlikely(!PyDict_Check(globals))) {
        __Pyx_TypeName globals_type_name =
            __Pyx_PyType_GetFullyQualifiedName(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;
    }
#endif
    if (!locals || locals == Py_None) {
        locals = globals;
    }
#if !CYTHON_COMPILING_IN_LIMITED_API
    if (__Pyx_PyDict_GetItemStr(globals, __pyx_mstate_global->__pyx_n_u_builtins) == NULL) {
        if (unlikely(PyDict_SetItem(globals, __pyx_mstate_global->__pyx_n_u_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 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;
        cf.cf_feature_version = PY_MINOR_VERSION;
        if (PyUnicode_Check(o)) {
            cf.cf_flags = PyCF_SOURCE_IS_UTF8;
            s = PyUnicode_AsUTF8String(o);
            if (unlikely(!s)) goto bad;
            o = s;
        } else if (unlikely(!PyBytes_Check(o))) {
            __Pyx_TypeName o_type_name = __Pyx_PyType_GetFullyQualifiedName(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;
        }
        code = PyBytes_AS_STRING(o);
        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;
#else // CYTHON_COMPILING_IN_LIMITED_API
    {
        PyObject *builtins, *exec, *exec_str;
        builtins = PyEval_GetBuiltins();
        if (!builtins) return NULL;
        exec_str = PyUnicode_FromStringAndSize("exec", 4);
        if (!exec_str) return NULL;
        exec = PyObject_GetItem(builtins, exec_str);
        Py_DECREF(exec_str);
        if (!exec) return NULL;
        result = PyObject_CallFunctionObjArgs(exec, o, globals, locals, NULL);
        Py_DECREF(exec);
        return result;
    }
#endif
}

/* 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_mstate_global->__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);
    }
}

/* AllocateExtensionType */
static PyObject *__Pyx_AllocateExtensionType(PyTypeObject *t, int is_final) {
    if (is_final || likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
        allocfunc alloc_func = __Pyx_PyType_GetSlot(t, tp_alloc, allocfunc);
        return alloc_func(t, 0);
    } else {
        newfunc tp_new = __Pyx_PyType_TryGetSlot(&PyBaseObject_Type, tp_new, newfunc);
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (!tp_new) {
            PyObject *new_str = PyUnicode_FromString("__new__");
            if (likely(new_str)) {
                PyObject *o = PyObject_CallMethodObjArgs((PyObject *)&PyBaseObject_Type, new_str, t, NULL);
                Py_DECREF(new_str);
                return o;
            } else
                return NULL;
        } else
    #endif
        return tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
    }
}

/* FunctionExport */
static int __Pyx_ExportFunction(PyObject *api_dict, const char *name, void (*f)(void), const char *sig) {
    PyObject *cobj;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    tmp.fp = f;
    cobj = PyCapsule_New(tmp.p, sig, 0);
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(api_dict, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    return 0;
bad:
    Py_XDECREF(cobj);
    return -1;
}

/* GetApiDict */
static PyObject *__Pyx_ApiExport_GetApiDict(void) {
    PyObject *d;
    if (__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_pyx_capi, &d) == -1)
        return NULL;
    if (!d) {
        d = PyDict_New();
        if (!d)
            goto bad;
        if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_pyx_capi, d) < 0)
            goto bad;
    }
    return d;
bad:
    Py_XDECREF(d);
    return NULL;
}

/* ValidateBasesTuple (used by PyType_Ready) */
#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_SIZE
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (unlikely(n < 0)) return -1;
#endif
    for (i = 1; i < n; i++)
    {
        PyTypeObject *b;
#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
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(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
            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_GetFullyQualifiedName(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
              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 */
CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
    while (t) {
        PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
        if (bases) {
            return 1;
        }
        t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
    }
    return 0;
}
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || 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;
    if (!__Pyx_PyType_HasMultipleInheritance(t)) {
        return PyType_Ready(t);
    }
    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 !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 (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
                !CYTHON_COMPILING_IN_GRAAL
        gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__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_mstate_global->__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 !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_mstate_global->__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_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
#else
    if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
#endif
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* GetVTable (used by MergeVTables) */
static void* __Pyx_GetVtable(PyTypeObject *type) {
    void* ptr;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
#else
    PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_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 */
static int __Pyx_MergeVtables(PyTypeObject *type) {
    int i=0;
    Py_ssize_t size;
    void** base_vtables;
    __Pyx_TypeName tp_base_name = NULL;
    __Pyx_TypeName base_name = NULL;
    void* unknown = (void*)-1;
    PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
    int base_depth = 0;
    {
        PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        while (base) {
            base_depth += 1;
            base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
        }
    }
    base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1));
    base_vtables[0] = unknown;
#if CYTHON_COMPILING_IN_LIMITED_API
    size = PyTuple_Size(bases);
    if (size < 0) goto other_failure;
#else
    size = PyTuple_GET_SIZE(bases);
#endif
    for (i = 1; i < size; i++) {
        PyObject *basei;
        void* base_vtable;
#if CYTHON_AVOID_BORROWED_REFS
        basei = PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#else
        basei = PyTuple_GET_ITEM(bases, i);
#endif
        base_vtable = __Pyx_GetVtable((PyTypeObject*)basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
        if (base_vtable != NULL) {
            int j;
            PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
            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 = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
            }
        }
    }
    PyErr_Clear();
    PyMem_Free(base_vtables);
    return 0;
bad:
    {
        PyTypeObject* basei = NULL;
        PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        tp_base_name = __Pyx_PyType_GetFullyQualifiedName(tp_base);
#if CYTHON_AVOID_BORROWED_REFS
        basei = (PyTypeObject*)PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto really_bad;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto really_bad;
#else
        basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
#endif
        base_name = __Pyx_PyType_GetFullyQualifiedName(basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
    }
    PyErr_Format(PyExc_TypeError,
        "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
really_bad: // bad has failed!
#endif
    __Pyx_DECREF_TypeName(tp_base_name);
    __Pyx_DECREF_TypeName(base_name);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
other_failure:
#endif
    PyMem_Free(base_vtables);
    return -1;
}

/* TypeImport */
#ifndef __PYX_HAVE_RT_ImportType_3_2_8
#define __PYX_HAVE_RT_ImportType_3_2_8
static PyTypeObject *__Pyx_ImportType_3_2_8(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_2_8 check_size)
{
    PyObject *result = 0;
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#if defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && 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 !( defined(Py_LIMITED_API) || (defined(CYTHON_COMPILING_IN_LIMITED_API) && CYTHON_COMPILING_IN_LIMITED_API) )
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#else
    if (size == 0) {
        return (PyTypeObject *)result;
    }
    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_2_8 &&
            ((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_2_8 && (size_t)basicsize > size) {
        if (PyErr_WarnFormat(NULL, 0,
                "%.200s.%.200s size changed, may indicate binary incompatibility. "
                "Expected %zd from C header, got %zd from PyObject",
                module_name, class_name, size, basicsize) < 0) {
            goto bad;
        }
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return NULL;
}
#endif

/* DelItemOnTypeDict (used by SetupReduce) */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_DelItem(tp_dict, k);
    if (likely(!result)) PyType_Modified(tp);
    return result;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
            if (likely(reduce_cython)) {
                ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_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_GetFullyQualifiedName((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;
}

/* Py3UpdateBases */
static PyObject*
__Pyx_PEP560_update_bases(PyObject *bases)
{
    Py_ssize_t i, j, size_bases;
    PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL;
#if CYTHON_ASSUME_SAFE_SIZE
    size_bases = PyTuple_GET_SIZE(bases);
#else
    size_bases = PyTuple_Size(bases);
    if (size_bases < 0) return NULL;
#endif
    for (i = 0; i < size_bases; i++) {
#if CYTHON_AVOID_BORROWED_REFS
        Py_CLEAR(base);
#endif
#if CYTHON_ASSUME_SAFE_MACROS
        base = PyTuple_GET_ITEM(bases, i);
#else
        base = PyTuple_GetItem(bases, i);
        if (!base) goto error;
#endif
#if CYTHON_AVOID_BORROWED_REFS
        Py_INCREF(base);
#endif
        if (PyType_Check(base)) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_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++) {
                PyObject *base_from_list;
#if CYTHON_ASSUME_SAFE_MACROS
                base_from_list = PyTuple_GET_ITEM(bases, j);
                PyList_SET_ITEM(new_bases, j, base_from_list);
                Py_INCREF(base_from_list);
#else
                base_from_list = PyTuple_GetItem(bases, j);
                if (!base_from_list) goto error;
                Py_INCREF(base_from_list);
                if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error;
#endif
            }
        }
#if CYTHON_ASSUME_SAFE_SIZE
        j = PyList_GET_SIZE(new_bases);
#else
        j = PyList_Size(new_bases);
        if (j < 0) goto error;
#endif
        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);
#if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(base);
#endif
    return result;
error:
    Py_XDECREF(new_bases);
#if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(base);
#endif
    return NULL;
}

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases;
#if CYTHON_ASSUME_SAFE_SIZE
    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 (!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) {
        metaclass = &PyType_Type;
    }
    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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
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_mstate_global->__pyx_n_u_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, mkw);
    Py_XDECREF(owned_metaclass);
    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 (__Pyx_TypeCheck(method, &PyMethodDescr_Type))
#endif
    {
#if CYTHON_COMPILING_IN_LIMITED_API
        return PyErr_Format(
            PyExc_SystemError,
            "Cython cannot yet handle classmethod on a MethodDescriptorType (%S) in limited API mode. "
            "This is most likely a classmethod in a cdef class method with binding=False. "
            "Try setting 'binding' to True.",
            method);
#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
        PyTypeObject *d_type = GraalPyDescrObject_GetType(method);
        return PyDescr_NewClassMethod(d_type, GraalPyMethodDescrObject_GetMethod(method));
#elif CYTHON_COMPILING_IN_GRAAL
        PyTypeObject *d_type = PyDescrObject_GetType(method);
        return PyDescr_NewClassMethod(d_type, PyMethodDescrObject_GetMethod(method));
#else
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        PyTypeObject *d_type = descr->d_common.d_type;
        return PyDescr_NewClassMethod(d_type, descr->d_method);
#endif
    }
#endif
#if !CYTHON_COMPILING_IN_LIMITED_API
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else {
        return PyClassMethod_New(method);
    }
#else
    {
        PyObject *func=NULL;
        PyObject *builtins, *classmethod, *classmethod_str, *result=NULL;
        if (__Pyx_TypeCheck(method, __pyx_mstate_global->__Pyx_CachedMethodType)) {
            func = PyObject_GetAttrString(method, "__func__");
            if (!func) goto bad;
        } else {
            func = method;
            Py_INCREF(func);
        }
        builtins = PyEval_GetBuiltins(); // borrowed
        if (unlikely(!builtins)) goto bad;
        classmethod_str = PyUnicode_FromString("classmethod");
        if (unlikely(!classmethod_str)) goto bad;
        classmethod = PyObject_GetItem(builtins, classmethod_str);
        Py_DECREF(classmethod_str);
        if (unlikely(!classmethod)) goto bad;
        result = PyObject_CallFunctionObjArgs(classmethod, func, NULL);
        Py_DECREF(classmethod);
        bad:
        Py_XDECREF(func);
        return result;
    }
#endif
}

/* 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_mstate_global->__pyx_n_u_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 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 (used by AddTraceback) */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
#else
PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
    PyObject **dict_ptr = _PyObject_GetDictPtr(o);
    return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
}
#endif
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline = NULL;
    PyObject *ptype, *pvalue, *ptraceback;
    PyObject *cython_runtime_dict;
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
    cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, cython_runtime_dict,
            __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
    }
    if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    Py_XDECREF(use_cline);
    Py_XDECREF(cython_runtime_dict);
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache (used by AddTraceback) */
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 __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
    __Pyx_CachedCodeObjectType* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = code_cache->entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__find_code_object;
    return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
    if (old_count < 0) {
        __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
        return NULL;
    }
#endif
    __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
#endif
    return result;
#endif
}
static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
{
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            code_cache->entries = entries;
            code_cache->max_count = 64;
            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(code_cache->entries, code_cache->count, code_line);
    if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
        __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_INCREF(code_object);
        Py_DECREF(tmp);
        return;
    }
    if (code_cache->count == code_cache->max_count) {
        int new_max = code_cache->max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        code_cache->entries = entries;
        code_cache->max_count = new_max;
    }
    for (i=code_cache->count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    code_cache->count++;
    Py_INCREF(code_object);
}
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__insert_code_object;
    return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type expected = 0;
    if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
        return;
    }
#endif
    __pyx__insert_code_object(code_cache, code_line, code_object);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
#endif
#endif
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #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 = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    return NULL;
}
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) {
        c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!code_object) {
        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;
        if (c_line) {
            py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        } else {
            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;
        __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
    } else {
        dict = PyDict_New();
    }
    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 (c_line) {
        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;
    }
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_funcname);
    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_mstate_global->__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

/* MemviewRefcount */
#include <stdio.h>
#ifndef _Py_NO_RETURN
#define _Py_NO_RETURN
#endif
_Py_NO_RETURN
static void __pyx_fatalerror(const char *fmt, ...) {
    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);
    }
}

/* 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);
}

/* 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((PyObject*)memview);
    }
    retval = 0;
    goto no_fail;
fail:
    memviewslice->memview = 0;
    memviewslice->data = 0;
    retval = -1;
no_fail:
    __Pyx_RefNannyFinishContext();
    return retval;
}

/* SliceMemoryviewSlice */
static void __pyx_memoryview_slice_memviewslice_err_dim(PyObject *error, const char* msg, int dim) {
    PyGILState_STATE gilstate = PyGILState_Ensure();
    PyErr_Format(error, msg, dim);
    PyGILState_Release(gilstate);
}
static CYTHON_INLINE int __pyx_memoryview_slice_memviewslice(
        __Pyx_memviewslice *dst,
        Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
        int dim, int new_ndim, int *suboffset_dim,
        Py_ssize_t start, Py_ssize_t stop, Py_ssize_t step,
        int have_start, int have_stop, int have_step,
        int is_slice) {
    if (!is_slice) {
        if (start < 0) {
            start += shape;
        }
        if (unlikely(!(0 <= start && start < shape))) {
            __pyx_memoryview_slice_memviewslice_err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim);
            return -1;
        }
    } else {
        int negative_step;
        if (have_step) {
            negative_step = step < 0;
            if (unlikely(step == 0)) {
                __pyx_memoryview_slice_memviewslice_err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim);
                return -1;
            }
        } else {
            negative_step = 0;
            step = 1;
        }
        if (have_start) {
            if (start < 0) {
                start += shape;
                if (start < 0) {
                    start = 0;
                }
            } else if (start >= shape) {
                start = negative_step ? (shape - 1) : shape;
            }
        } else {
            start = negative_step ? (shape - 1) : 0;
        }
        if (have_stop) {
            if (stop < 0) {
                stop += shape;
                if (stop < 0) {
                    stop = 0;
                }
            } else if (stop > shape) {
                stop = shape;
            }
        } else {
            stop = negative_step ? -1 : shape;
        }
        Py_ssize_t new_shape = (stop - start) / step;
        if ((stop - start) - step * new_shape) {
            ++new_shape;
        }
        if (new_shape < 0) {
            new_shape = 0;
        }
        dst->strides[new_ndim] = stride * step;
        dst->shape[new_ndim] = new_shape;
        dst->suboffsets[new_ndim] = suboffset;
    }
    if (suboffset_dim[0] < 0) {
        dst->data += start * stride;
    } else {
        dst->suboffsets[suboffset_dim[0]] += start * stride;
    }
    if (suboffset >= 0) {
        if (!is_slice) {
            if (likely(new_ndim == 0)) {
                dst->data = ((char **)(dst->data))[0] + suboffset;
            } else {
                __pyx_memoryview_slice_memviewslice_err_dim(
                    PyExc_IndexError,
                    "All dimensions preceding dimension %d must be indexed and not sliced",
                    dim);
                return -1;
            }
        } else {
            suboffset_dim[0] = new_ndim;
        }
    }
    return 0;
}

/* 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 (used by BufferFormatCheck) */
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 (used by MemviewSliceValidateAndInit) */
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              const __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);
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    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;
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
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);
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
    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;
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
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);
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
    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 {
    const __Pyx_StructField* field = ctx->head->field;
    const __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 {
    const __Pyx_StructField* field = ctx->head->field;
    const __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 (used by MemviewSliceValidateAndInit) */
  static int
  __pyx_typeinfo_cmp(const __Pyx_TypeInfo *a, const __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++) {
                  const __Pyx_StructField *field_a = a->fields + i;
                  const __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 (used by ObjectToMemviewSlice) */
  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,
                  const __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((PyObject*)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 = __Pyx_MEMSLICE_INIT;
      __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_PyLong_From_PetscInt(*(PetscInt const *) itemp);
  }
  static CYTHON_INLINE int __pyx_memview_set_nn_PetscInt(char *itemp, PyObject *obj) {
      PetscInt value = __Pyx_PyLong_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_PyLong_From_int(s.count); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_mstate_global->__pyx_n_u_count, member) < 0)) goto bad;
    Py_DECREF(member);
    member = PyFloat_FromDouble(s.flops); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_mstate_global->__pyx_n_u_flops, member) < 0)) goto bad;
    Py_DECREF(member);
    member = PyFloat_FromDouble(s.time); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_mstate_global->__pyx_n_u_time, member) < 0)) goto bad;
    Py_DECREF(member);
    member = PyFloat_FromDouble(s.numMessages); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_mstate_global->__pyx_n_u_numMessages, member) < 0)) goto bad;
    Py_DECREF(member);
    member = PyFloat_FromDouble(s.messageLength); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_mstate_global->__pyx_n_u_messageLength, member) < 0)) goto bad;
    Py_DECREF(member);
    member = PyFloat_FromDouble(s.numReductions); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_mstate_global->__pyx_n_u_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_PyLong_From_uint8_t(s.code); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_mstate_global->__pyx_n_u_code, member) < 0)) goto bad;
    Py_DECREF(member);
    member = __Pyx_PyLong_From_uint8_t(s.bits); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_mstate_global->__pyx_n_u_bits, member) < 0)) goto bad;
    Py_DECREF(member);
    member = __Pyx_PyLong_From_uint16_t(s.lanes); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_block_size_2, member) < 0)) goto bad;
    Py_DECREF(member);
    member = PyFloat_FromDouble(s.nz_allocated); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_memory, member) < 0)) goto bad;
    Py_DECREF(member);
    member = PyFloat_FromDouble(s.assemblies); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_mstate_global->__pyx_n_u_assemblies, member) < 0)) goto bad;
    Py_DECREF(member);
    member = PyFloat_FromDouble(s.mallocs); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_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_mstate_global->__pyx_n_u_factor_mallocs, member) < 0)) goto bad;
    Py_DECREF(member);
    return res;
    bad:
    Py_XDECREF(member);
    Py_DECREF(res);
    return NULL;
  }
  /* MemviewSliceCopy */
  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 = __Pyx_MEMSLICE_INIT;
      struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
      Py_buffer *buf = &from_memview->view;
      PyObject *shape_tuple = 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++) {
          PyObject *temp_int = PyLong_FromSsize_t(from_mvs->shape[i]);
          if(unlikely(!temp_int)) {
              goto fail;
          } else {
  #if CYTHON_ASSUME_SAFE_MACROS
              PyTuple_SET_ITEM(shape_tuple, i, temp_int);
  #else
              if (PyTuple_SetItem(shape_tuple, i, temp_int) < 0) {
                  goto fail;
              }
  #endif
          }
      }
      array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, 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((PyObject *) new_mvs.memview);
      new_mvs.memview = NULL;
      new_mvs.data = NULL;
  no_fail:
      __Pyx_XDECREF(shape_tuple);
      __Pyx_XDECREF((PyObject *) array_obj);
      __Pyx_RefNannyFinishContext();
      return new_mvs;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE int __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
          int val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (int) -1;
          val = __Pyx_PyLong_As_int(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          int val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (int) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (int) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (int) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          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;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((int) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long 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 (!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
          if (unlikely(ret))
              return (int) -1;
          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_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(int) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(int),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(InsertMode) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(InsertMode) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(InsertMode),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(ScatterMode) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(ScatterMode) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(ScatterMode),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(NormType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(NormType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(NormType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(int) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(int),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscViewerFormat) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscViewerFormat) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PetscViewerFormat),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscFileMode) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscFileMode) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PetscFileMode),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscDeviceType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscDeviceType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PetscDeviceType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscStreamType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscStreamType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PetscStreamType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscDeviceContextJoinMode) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscDeviceContextJoinMode) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PetscDeviceContextJoinMode),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(ISGlobalToLocalMappingMode) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(ISGlobalToLocalMappingMode) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(ISGlobalToLocalMappingMode),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(VecOption) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(VecOption) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(VecOption),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(MatOption) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(MatOption) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(MatOption),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(MatAssemblyType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(MatAssemblyType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(MatAssemblyType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(MatInfoType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(MatInfoType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(MatInfoType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(MatStructure) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(MatStructure) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(MatStructure),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(MatDuplicateOption) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(MatDuplicateOption) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(MatDuplicateOption),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(MatFactorShiftType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(MatFactorShiftType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(MatFactorShiftType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(MatSORType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(MatSORType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(MatSORType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PCSide) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PCSide) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PCSide),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PCASMType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PCASMType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PCASMType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PCGASMType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PCGASMType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PCGASMType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PCMGType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PCMGType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PCMGType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PCMGCycleType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PCMGCycleType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PCMGCycleType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PCCompositeType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PCCompositeType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PCCompositeType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PCFieldSplitSchurPreType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PCFieldSplitSchurPreType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PCFieldSplitSchurPreType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PCFieldSplitSchurFactType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PCFieldSplitSchurFactType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PCFieldSplitSchurFactType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PCPatchConstructType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PCPatchConstructType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PCPatchConstructType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PCHPDDMCoarseCorrectionType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PCHPDDMCoarseCorrectionType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PCHPDDMCoarseCorrectionType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PCDeflationSpaceType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PCDeflationSpaceType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PCDeflationSpaceType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PCFailedReason) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PCFailedReason) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PCFailedReason),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(KSPNormType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(KSPNormType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(KSPNormType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(KSPConvergedReason) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(KSPConvergedReason) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(KSPConvergedReason),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(KSPHPDDMType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(KSPHPDDMType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(KSPHPDDMType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_KSPDMActive(KSPDMActive value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const KSPDMActive neg_one = (KSPDMActive) -1, const_zero = (KSPDMActive) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(KSPDMActive) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(KSPDMActive) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(KSPDMActive) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(KSPDMActive) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(KSPDMActive) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(KSPDMActive),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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(KSPDMActive));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(SNESNormSchedule) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(SNESNormSchedule) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(SNESNormSchedule),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(SNESConvergedReason) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(SNESConvergedReason) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(SNESConvergedReason),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_SNESNewtonALCorrectionType(SNESNewtonALCorrectionType value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const SNESNewtonALCorrectionType neg_one = (SNESNewtonALCorrectionType) -1, const_zero = (SNESNewtonALCorrectionType) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(SNESNewtonALCorrectionType) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(SNESNewtonALCorrectionType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(SNESNewtonALCorrectionType) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(SNESNewtonALCorrectionType) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(SNESNewtonALCorrectionType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(SNESNewtonALCorrectionType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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(SNESNewtonALCorrectionType));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(TSProblemType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(TSProblemType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(TSProblemType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(TSEquationType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(TSEquationType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(TSEquationType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(TSExactFinalTimeOption) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(TSExactFinalTimeOption) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(TSExactFinalTimeOption),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(TSConvergedReason) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(TSConvergedReason) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(TSConvergedReason),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(TaoConvergedReason) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(TaoConvergedReason) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(TaoConvergedReason),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(TaoBNCGType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(TaoBNCGType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(TaoBNCGType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_TaoALMMType(TaoALMMType value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const TaoALMMType neg_one = (TaoALMMType) -1, const_zero = (TaoALMMType) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(TaoALMMType) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(TaoALMMType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(TaoALMMType) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(TaoALMMType) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(TaoALMMType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(TaoALMMType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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(TaoALMMType));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(TaoLineSearchConvergedReason) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(TaoLineSearchConvergedReason) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(TaoLineSearchConvergedReason),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(DMBoundaryType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(DMBoundaryType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(DMBoundaryType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(DMPolytopeType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(DMPolytopeType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(DMPolytopeType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_DMReorderDefaultFlag(DMReorderDefaultFlag value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const DMReorderDefaultFlag neg_one = (DMReorderDefaultFlag) -1, const_zero = (DMReorderDefaultFlag) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(DMReorderDefaultFlag) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(DMReorderDefaultFlag) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(DMReorderDefaultFlag) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(DMReorderDefaultFlag) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(DMReorderDefaultFlag) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(DMReorderDefaultFlag),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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(DMReorderDefaultFlag));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(DMDAStencilType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(DMDAStencilType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(DMDAStencilType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(DMDAInterpolationType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(DMDAInterpolationType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(DMDAInterpolationType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(DMDAElementType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(DMDAElementType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(DMDAElementType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(DMStagStencilType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(DMStagStencilType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(DMStagStencilType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(DMStagStencilLocation) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(DMStagStencilLocation) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(DMStagStencilLocation),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(DMSwarmType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(DMSwarmType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(DMSwarmType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(DMSwarmMigrateType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(DMSwarmMigrateType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(DMSwarmMigrateType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(DMSwarmCollectType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(DMSwarmCollectType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(DMSwarmCollectType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(DMSwarmPICLayoutType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(DMSwarmPICLayoutType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(DMSwarmPICLayoutType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_PetscRegressorLinearType(PetscRegressorLinearType value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const PetscRegressorLinearType neg_one = (PetscRegressorLinearType) -1, const_zero = (PetscRegressorLinearType) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(PetscRegressorLinearType) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(PetscRegressorLinearType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(PetscRegressorLinearType) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(PetscRegressorLinearType) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(PetscRegressorLinearType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PetscRegressorLinearType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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(PetscRegressorLinearType));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(long) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(long),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscInt) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscInt) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PetscInt),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE PetscInt __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PetscInt val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PetscInt) -1;
          val = __Pyx_PyLong_As_PetscInt(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PetscInt) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscInt, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PetscInt) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscInt, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PetscInt val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (PetscInt) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (PetscInt) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (PetscInt) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          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;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((PetscInt) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long 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 (!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
          if (unlikely(ret))
              return (PetscInt) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          InsertMode val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (InsertMode) -1;
          val = __Pyx_PyLong_As_InsertMode(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(InsertMode) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(InsertMode, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(InsertMode) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(InsertMode, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          InsertMode val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (InsertMode) -1;
  #endif
          if (unlikely(ret))
              return (InsertMode) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          ScatterMode val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (ScatterMode) -1;
          val = __Pyx_PyLong_As_ScatterMode(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(ScatterMode) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(ScatterMode, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(ScatterMode) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(ScatterMode, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          ScatterMode val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (ScatterMode) -1;
  #endif
          if (unlikely(ret))
              return (ScatterMode) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PetscFileMode val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PetscFileMode) -1;
          val = __Pyx_PyLong_As_PetscFileMode(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PetscFileMode) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscFileMode, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PetscFileMode) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscFileMode, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PetscFileMode val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PetscFileMode) -1;
  #endif
          if (unlikely(ret))
              return (PetscFileMode) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PetscDeviceType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PetscDeviceType) -1;
          val = __Pyx_PyLong_As_PetscDeviceType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PetscDeviceType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscDeviceType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PetscDeviceType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscDeviceType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PetscDeviceType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PetscDeviceType) -1;
  #endif
          if (unlikely(ret))
              return (PetscDeviceType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PetscStreamType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PetscStreamType) -1;
          val = __Pyx_PyLong_As_PetscStreamType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PetscStreamType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscStreamType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PetscStreamType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscStreamType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PetscStreamType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PetscStreamType) -1;
  #endif
          if (unlikely(ret))
              return (PetscStreamType) -1;
          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;
  }
  
/* TypeInfoToFormat */
  static struct __pyx_typeinfo_string __Pyx_TypeInfoToFormat(const __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 PetscDeviceContextJoinMode __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PetscDeviceContextJoinMode val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PetscDeviceContextJoinMode) -1;
          val = __Pyx_PyLong_As_PetscDeviceContextJoinMode(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PetscDeviceContextJoinMode) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscDeviceContextJoinMode, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PetscDeviceContextJoinMode) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscDeviceContextJoinMode, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PetscDeviceContextJoinMode val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PetscDeviceContextJoinMode) -1;
  #endif
          if (unlikely(ret))
              return (PetscDeviceContextJoinMode) -1;
          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;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE int64_t __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
          int64_t val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (int64_t) -1;
          val = __Pyx_PyLong_As_int64_t(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          int64_t val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (int64_t) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (int64_t) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (int64_t) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          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;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((int64_t) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long 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 (!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
          if (unlikely(ret))
              return (int64_t) -1;
          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_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscMemType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscMemType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PetscMemType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(int64_t),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE MatStructure __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
          MatStructure val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (MatStructure) -1;
          val = __Pyx_PyLong_As_MatStructure(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(MatStructure) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(MatStructure, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(MatStructure) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(MatStructure, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          MatStructure val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (MatStructure) -1;
  #endif
          if (unlikely(ret))
              return (MatStructure) -1;
          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 MatDuplicateOption __Pyx_PyLong_As_MatDuplicateOption(PyObject *x) {
  #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 (unlikely(!PyLong_Check(x))) {
          MatDuplicateOption val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (MatDuplicateOption) -1;
          val = __Pyx_PyLong_As_MatDuplicateOption(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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(MatDuplicateOption, __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(MatDuplicateOption) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(MatDuplicateOption, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(MatDuplicateOption) >= 2 * PyLong_SHIFT)) {
                              return (MatDuplicateOption) (((((MatDuplicateOption)digits[1]) << PyLong_SHIFT) | (MatDuplicateOption)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(MatDuplicateOption) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(MatDuplicateOption, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(MatDuplicateOption) >= 3 * PyLong_SHIFT)) {
                              return (MatDuplicateOption) (((((((MatDuplicateOption)digits[2]) << PyLong_SHIFT) | (MatDuplicateOption)digits[1]) << PyLong_SHIFT) | (MatDuplicateOption)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(MatDuplicateOption) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(MatDuplicateOption, 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(MatDuplicateOption) >= 4 * PyLong_SHIFT)) {
                              return (MatDuplicateOption) (((((((((MatDuplicateOption)digits[3]) << PyLong_SHIFT) | (MatDuplicateOption)digits[2]) << PyLong_SHIFT) | (MatDuplicateOption)digits[1]) << PyLong_SHIFT) | (MatDuplicateOption)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 (MatDuplicateOption) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(MatDuplicateOption) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(MatDuplicateOption, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(MatDuplicateOption) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(MatDuplicateOption, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(MatDuplicateOption, __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(MatDuplicateOption) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(MatDuplicateOption, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(MatDuplicateOption) - 1 > 2 * PyLong_SHIFT)) {
                              return (MatDuplicateOption) (((MatDuplicateOption)-1)*(((((MatDuplicateOption)digits[1]) << PyLong_SHIFT) | (MatDuplicateOption)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(MatDuplicateOption) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(MatDuplicateOption, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(MatDuplicateOption) - 1 > 2 * PyLong_SHIFT)) {
                              return (MatDuplicateOption) ((((((MatDuplicateOption)digits[1]) << PyLong_SHIFT) | (MatDuplicateOption)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(MatDuplicateOption) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(MatDuplicateOption, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(MatDuplicateOption) - 1 > 3 * PyLong_SHIFT)) {
                              return (MatDuplicateOption) (((MatDuplicateOption)-1)*(((((((MatDuplicateOption)digits[2]) << PyLong_SHIFT) | (MatDuplicateOption)digits[1]) << PyLong_SHIFT) | (MatDuplicateOption)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(MatDuplicateOption) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(MatDuplicateOption, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(MatDuplicateOption) - 1 > 3 * PyLong_SHIFT)) {
                              return (MatDuplicateOption) ((((((((MatDuplicateOption)digits[2]) << PyLong_SHIFT) | (MatDuplicateOption)digits[1]) << PyLong_SHIFT) | (MatDuplicateOption)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(MatDuplicateOption) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(MatDuplicateOption, 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(MatDuplicateOption) - 1 > 4 * PyLong_SHIFT)) {
                              return (MatDuplicateOption) (((MatDuplicateOption)-1)*(((((((((MatDuplicateOption)digits[3]) << PyLong_SHIFT) | (MatDuplicateOption)digits[2]) << PyLong_SHIFT) | (MatDuplicateOption)digits[1]) << PyLong_SHIFT) | (MatDuplicateOption)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(MatDuplicateOption) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(MatDuplicateOption, 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(MatDuplicateOption) - 1 > 4 * PyLong_SHIFT)) {
                              return (MatDuplicateOption) ((((((((((MatDuplicateOption)digits[3]) << PyLong_SHIFT) | (MatDuplicateOption)digits[2]) << PyLong_SHIFT) | (MatDuplicateOption)digits[1]) << PyLong_SHIFT) | (MatDuplicateOption)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(MatDuplicateOption) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(MatDuplicateOption, long, PyLong_AsLong(x))
          } else if ((sizeof(MatDuplicateOption) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(MatDuplicateOption, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          MatDuplicateOption val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (MatDuplicateOption) -1;
  #endif
          if (unlikely(ret))
              return (MatDuplicateOption) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to MatDuplicateOption");
      return (MatDuplicateOption) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to MatDuplicateOption");
      return (MatDuplicateOption) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE MatAssemblyType __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
          MatAssemblyType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (MatAssemblyType) -1;
          val = __Pyx_PyLong_As_MatAssemblyType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(MatAssemblyType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(MatAssemblyType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(MatAssemblyType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(MatAssemblyType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          MatAssemblyType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (MatAssemblyType) -1;
  #endif
          if (unlikely(ret))
              return (MatAssemblyType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          MatInfoType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (MatInfoType) -1;
          val = __Pyx_PyLong_As_MatInfoType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(MatInfoType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(MatInfoType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(MatInfoType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(MatInfoType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          MatInfoType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (MatInfoType) -1;
  #endif
          if (unlikely(ret))
              return (MatInfoType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          MatFactorShiftType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (MatFactorShiftType) -1;
          val = __Pyx_PyLong_As_MatFactorShiftType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(MatFactorShiftType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(MatFactorShiftType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(MatFactorShiftType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(MatFactorShiftType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          MatFactorShiftType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (MatFactorShiftType) -1;
  #endif
          if (unlikely(ret))
              return (MatFactorShiftType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          KSPConvergedReason val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (KSPConvergedReason) -1;
          val = __Pyx_PyLong_As_KSPConvergedReason(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(KSPConvergedReason) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(KSPConvergedReason, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(KSPConvergedReason) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(KSPConvergedReason, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          KSPConvergedReason val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (KSPConvergedReason) -1;
  #endif
          if (unlikely(ret))
              return (KSPConvergedReason) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          SNESConvergedReason val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (SNESConvergedReason) -1;
          val = __Pyx_PyLong_As_SNESConvergedReason(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(SNESConvergedReason) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(SNESConvergedReason, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(SNESConvergedReason) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(SNESConvergedReason, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          SNESConvergedReason val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (SNESConvergedReason) -1;
  #endif
          if (unlikely(ret))
              return (SNESConvergedReason) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          TaoConvergedReason val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (TaoConvergedReason) -1;
          val = __Pyx_PyLong_As_TaoConvergedReason(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(TaoConvergedReason) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(TaoConvergedReason, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(TaoConvergedReason) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(TaoConvergedReason, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          TaoConvergedReason val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (TaoConvergedReason) -1;
  #endif
          if (unlikely(ret))
              return (TaoConvergedReason) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          DMBoundaryType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (DMBoundaryType) -1;
          val = __Pyx_PyLong_As_DMBoundaryType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(DMBoundaryType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMBoundaryType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(DMBoundaryType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMBoundaryType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          DMBoundaryType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (DMBoundaryType) -1;
  #endif
          if (unlikely(ret))
              return (DMBoundaryType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          DMDAStencilType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (DMDAStencilType) -1;
          val = __Pyx_PyLong_As_DMDAStencilType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(DMDAStencilType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMDAStencilType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(DMDAStencilType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMDAStencilType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          DMDAStencilType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (DMDAStencilType) -1;
  #endif
          if (unlikely(ret))
              return (DMDAStencilType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          DMDAInterpolationType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (DMDAInterpolationType) -1;
          val = __Pyx_PyLong_As_DMDAInterpolationType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(DMDAInterpolationType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMDAInterpolationType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(DMDAInterpolationType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMDAInterpolationType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          DMDAInterpolationType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (DMDAInterpolationType) -1;
  #endif
          if (unlikely(ret))
              return (DMDAInterpolationType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          DMDAElementType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (DMDAElementType) -1;
          val = __Pyx_PyLong_As_DMDAElementType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(DMDAElementType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMDAElementType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(DMDAElementType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMDAElementType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          DMDAElementType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (DMDAElementType) -1;
  #endif
          if (unlikely(ret))
              return (DMDAElementType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          DMStagStencilType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (DMStagStencilType) -1;
          val = __Pyx_PyLong_As_DMStagStencilType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(DMStagStencilType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(DMStagStencilType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          DMStagStencilType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (DMStagStencilType) -1;
  #endif
          if (unlikely(ret))
              return (DMStagStencilType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          DMStagStencilLocation val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (DMStagStencilLocation) -1;
          val = __Pyx_PyLong_As_DMStagStencilLocation(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(DMStagStencilLocation) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilLocation, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(DMStagStencilLocation) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMStagStencilLocation, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          DMStagStencilLocation val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (DMStagStencilLocation) -1;
  #endif
          if (unlikely(ret))
              return (DMStagStencilLocation) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PetscClassId val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PetscClassId) -1;
          val = __Pyx_PyLong_As_PetscClassId(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PetscClassId) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscClassId, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PetscClassId) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscClassId, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PetscClassId val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (PetscClassId) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (PetscClassId) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (PetscClassId) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          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;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((PetscClassId) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long 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 (!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
          if (unlikely(ret))
              return (PetscClassId) -1;
          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_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscLogStage) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscLogStage) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PetscLogStage),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscClassId) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscClassId) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PetscClassId),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscLogEvent) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscLogEvent) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PetscLogEvent),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(MPI_Fint) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(MPI_Fint) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(MPI_Fint),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE PetscViewerFormat __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PetscViewerFormat val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PetscViewerFormat) -1;
          val = __Pyx_PyLong_As_PetscViewerFormat(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PetscViewerFormat) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscViewerFormat, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PetscViewerFormat) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscViewerFormat, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PetscViewerFormat val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PetscViewerFormat) -1;
  #endif
          if (unlikely(ret))
              return (PetscViewerFormat) -1;
          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_PyLong_From_PetscInt64(PetscInt64 value) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const PetscInt64 neg_one = (PetscInt64) -1, const_zero = (PetscInt64) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (is_unsigned) {
          if (sizeof(PetscInt64) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(PetscInt64) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(PetscInt64) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(PetscInt64) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(PetscInt64) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PetscInt64),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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(PetscInt64));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE PetscInt64 __Pyx_PyLong_As_PetscInt64(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const PetscInt64 neg_one = (PetscInt64) -1, const_zero = (PetscInt64) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          PetscInt64 val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PetscInt64) -1;
          val = __Pyx_PyLong_As_PetscInt64(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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(PetscInt64, __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(PetscInt64) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscInt64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(PetscInt64) >= 2 * PyLong_SHIFT)) {
                              return (PetscInt64) (((((PetscInt64)digits[1]) << PyLong_SHIFT) | (PetscInt64)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(PetscInt64) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscInt64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(PetscInt64) >= 3 * PyLong_SHIFT)) {
                              return (PetscInt64) (((((((PetscInt64)digits[2]) << PyLong_SHIFT) | (PetscInt64)digits[1]) << PyLong_SHIFT) | (PetscInt64)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(PetscInt64) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscInt64, 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(PetscInt64) >= 4 * PyLong_SHIFT)) {
                              return (PetscInt64) (((((((((PetscInt64)digits[3]) << PyLong_SHIFT) | (PetscInt64)digits[2]) << PyLong_SHIFT) | (PetscInt64)digits[1]) << PyLong_SHIFT) | (PetscInt64)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 (PetscInt64) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(PetscInt64) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscInt64, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(PetscInt64) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscInt64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(PetscInt64, __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(PetscInt64) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscInt64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(PetscInt64) - 1 > 2 * PyLong_SHIFT)) {
                              return (PetscInt64) (((PetscInt64)-1)*(((((PetscInt64)digits[1]) << PyLong_SHIFT) | (PetscInt64)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(PetscInt64) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscInt64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(PetscInt64) - 1 > 2 * PyLong_SHIFT)) {
                              return (PetscInt64) ((((((PetscInt64)digits[1]) << PyLong_SHIFT) | (PetscInt64)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(PetscInt64) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscInt64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(PetscInt64) - 1 > 3 * PyLong_SHIFT)) {
                              return (PetscInt64) (((PetscInt64)-1)*(((((((PetscInt64)digits[2]) << PyLong_SHIFT) | (PetscInt64)digits[1]) << PyLong_SHIFT) | (PetscInt64)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(PetscInt64) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscInt64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(PetscInt64) - 1 > 3 * PyLong_SHIFT)) {
                              return (PetscInt64) ((((((((PetscInt64)digits[2]) << PyLong_SHIFT) | (PetscInt64)digits[1]) << PyLong_SHIFT) | (PetscInt64)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(PetscInt64) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscInt64, 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(PetscInt64) - 1 > 4 * PyLong_SHIFT)) {
                              return (PetscInt64) (((PetscInt64)-1)*(((((((((PetscInt64)digits[3]) << PyLong_SHIFT) | (PetscInt64)digits[2]) << PyLong_SHIFT) | (PetscInt64)digits[1]) << PyLong_SHIFT) | (PetscInt64)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(PetscInt64) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscInt64, 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(PetscInt64) - 1 > 4 * PyLong_SHIFT)) {
                              return (PetscInt64) ((((((((((PetscInt64)digits[3]) << PyLong_SHIFT) | (PetscInt64)digits[2]) << PyLong_SHIFT) | (PetscInt64)digits[1]) << PyLong_SHIFT) | (PetscInt64)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(PetscInt64) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscInt64, long, PyLong_AsLong(x))
          } else if ((sizeof(PetscInt64) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscInt64, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PetscInt64 val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (PetscInt64) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (PetscInt64) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (PetscInt64) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          val = (PetscInt64) 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(PetscInt64) * 8 - chunk_size; bits += chunk_size) {
              PyObject *tmp, *digit;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((PetscInt64) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long idigit = PyLong_AsLong(stepval);
              if (unlikely(idigit < 0)) goto done;
              remaining_bits = ((int) sizeof(PetscInt64) * 8) - bits - (is_unsigned ? 0 : 1);
              if (unlikely(idigit >= (1L << remaining_bits)))
                  goto raise_overflow;
              val |= ((PetscInt64) idigit) << bits;
          }
          if (!is_unsigned) {
              if (unlikely(val & (((PetscInt64) 1) << (sizeof(PetscInt64) * 8 - 1))))
                  goto raise_overflow;
              if (is_negative)
                  val = ~val;
          }
          ret = 0;
      done:
          Py_XDECREF(shift);
          Py_XDECREF(mask);
          Py_XDECREF(stepval);
  #endif
          if (unlikely(ret))
              return (PetscInt64) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to PetscInt64");
      return (PetscInt64) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to PetscInt64");
      return (PetscInt64) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE ISGlobalToLocalMappingMode __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
          ISGlobalToLocalMappingMode val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (ISGlobalToLocalMappingMode) -1;
          val = __Pyx_PyLong_As_ISGlobalToLocalMappingMode(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(ISGlobalToLocalMappingMode) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(ISGlobalToLocalMappingMode, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(ISGlobalToLocalMappingMode) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(ISGlobalToLocalMappingMode, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          ISGlobalToLocalMappingMode val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (ISGlobalToLocalMappingMode) -1;
  #endif
          if (unlikely(ret))
              return (ISGlobalToLocalMappingMode) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          size_t val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (size_t) -1;
          val = __Pyx_PyLong_As_size_t(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          size_t val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (size_t) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (size_t) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (size_t) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          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;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((size_t) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long 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 (!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
          if (unlikely(ret))
              return (size_t) -1;
          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_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(uint8_t) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(uint8_t),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(uint16_t) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(uint16_t),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) -1;
          val = __Pyx_PyLong_As_enum____pyx_t_8petsc4py_5PETSc_PetscDLDeviceType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } 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))
          }
      } 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))
          } 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))
          }
      }
      {
          enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) -1;
  #endif
          if (unlikely(ret))
              return (enum __pyx_t_8petsc4py_5PETSc_PetscDLDeviceType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          VecOption val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (VecOption) -1;
          val = __Pyx_PyLong_As_VecOption(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(VecOption) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(VecOption, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(VecOption) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(VecOption, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          VecOption val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (VecOption) -1;
  #endif
          if (unlikely(ret))
              return (VecOption) -1;
          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_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscOffloadMask) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(PetscOffloadMask) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(PetscOffloadMask),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntFromPy */
  static CYTHON_INLINE NormType __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
          NormType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (NormType) -1;
          val = __Pyx_PyLong_As_NormType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(NormType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(NormType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(NormType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(NormType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          NormType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (NormType) -1;
  #endif
          if (unlikely(ret))
              return (NormType) -1;
          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 DMPolytopeType __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
          DMPolytopeType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (DMPolytopeType) -1;
          val = __Pyx_PyLong_As_DMPolytopeType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(DMPolytopeType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMPolytopeType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(DMPolytopeType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMPolytopeType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          DMPolytopeType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (DMPolytopeType) -1;
  #endif
          if (unlikely(ret))
              return (DMPolytopeType) -1;
          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 MatOption __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
          MatOption val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (MatOption) -1;
          val = __Pyx_PyLong_As_MatOption(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(MatOption) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(MatOption, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(MatOption) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(MatOption, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          MatOption val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (MatOption) -1;
  #endif
          if (unlikely(ret))
              return (MatOption) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PCFailedReason val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PCFailedReason) -1;
          val = __Pyx_PyLong_As_PCFailedReason(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PCFailedReason) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCFailedReason, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PCFailedReason) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCFailedReason, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PCFailedReason val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PCFailedReason) -1;
  #endif
          if (unlikely(ret))
              return (PCFailedReason) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PCASMType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PCASMType) -1;
          val = __Pyx_PyLong_As_PCASMType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PCASMType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCASMType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PCASMType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCASMType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PCASMType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PCASMType) -1;
  #endif
          if (unlikely(ret))
              return (PCASMType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PCGASMType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PCGASMType) -1;
          val = __Pyx_PyLong_As_PCGASMType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PCGASMType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCGASMType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PCGASMType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCGASMType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PCGASMType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PCGASMType) -1;
  #endif
          if (unlikely(ret))
              return (PCGASMType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PCCompositeType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PCCompositeType) -1;
          val = __Pyx_PyLong_As_PCCompositeType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PCCompositeType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCCompositeType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PCCompositeType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCCompositeType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PCCompositeType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PCCompositeType) -1;
  #endif
          if (unlikely(ret))
              return (PCCompositeType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PCFieldSplitSchurFactType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PCFieldSplitSchurFactType) -1;
          val = __Pyx_PyLong_As_PCFieldSplitSchurFactType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PCFieldSplitSchurFactType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurFactType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PCFieldSplitSchurFactType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurFactType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PCFieldSplitSchurFactType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PCFieldSplitSchurFactType) -1;
  #endif
          if (unlikely(ret))
              return (PCFieldSplitSchurFactType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PCFieldSplitSchurPreType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PCFieldSplitSchurPreType) -1;
          val = __Pyx_PyLong_As_PCFieldSplitSchurPreType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PCFieldSplitSchurPreType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurPreType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PCFieldSplitSchurPreType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCFieldSplitSchurPreType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PCFieldSplitSchurPreType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PCFieldSplitSchurPreType) -1;
  #endif
          if (unlikely(ret))
              return (PCFieldSplitSchurPreType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PCMGType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PCMGType) -1;
          val = __Pyx_PyLong_As_PCMGType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PCMGType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCMGType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PCMGType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCMGType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PCMGType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PCMGType) -1;
  #endif
          if (unlikely(ret))
              return (PCMGType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PCMGCycleType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PCMGCycleType) -1;
          val = __Pyx_PyLong_As_PCMGCycleType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PCMGCycleType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCMGCycleType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PCMGCycleType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCMGCycleType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PCMGCycleType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PCMGCycleType) -1;
  #endif
          if (unlikely(ret))
              return (PCMGCycleType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PCPatchConstructType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PCPatchConstructType) -1;
          val = __Pyx_PyLong_As_PCPatchConstructType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PCPatchConstructType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCPatchConstructType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PCPatchConstructType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCPatchConstructType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PCPatchConstructType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PCPatchConstructType) -1;
  #endif
          if (unlikely(ret))
              return (PCPatchConstructType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PCHPDDMCoarseCorrectionType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PCHPDDMCoarseCorrectionType) -1;
          val = __Pyx_PyLong_As_PCHPDDMCoarseCorrectionType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PCHPDDMCoarseCorrectionType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCHPDDMCoarseCorrectionType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PCHPDDMCoarseCorrectionType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCHPDDMCoarseCorrectionType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PCHPDDMCoarseCorrectionType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PCHPDDMCoarseCorrectionType) -1;
  #endif
          if (unlikely(ret))
              return (PCHPDDMCoarseCorrectionType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PCDeflationSpaceType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PCDeflationSpaceType) -1;
          val = __Pyx_PyLong_As_PCDeflationSpaceType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PCDeflationSpaceType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCDeflationSpaceType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PCDeflationSpaceType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCDeflationSpaceType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PCDeflationSpaceType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PCDeflationSpaceType) -1;
  #endif
          if (unlikely(ret))
              return (PCDeflationSpaceType) -1;
          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 KSPDMActive __Pyx_PyLong_As_KSPDMActive(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const KSPDMActive neg_one = (KSPDMActive) -1, const_zero = (KSPDMActive) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          KSPDMActive val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (KSPDMActive) -1;
          val = __Pyx_PyLong_As_KSPDMActive(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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(KSPDMActive, __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(KSPDMActive) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(KSPDMActive, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(KSPDMActive) >= 2 * PyLong_SHIFT)) {
                              return (KSPDMActive) (((((KSPDMActive)digits[1]) << PyLong_SHIFT) | (KSPDMActive)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(KSPDMActive) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(KSPDMActive, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(KSPDMActive) >= 3 * PyLong_SHIFT)) {
                              return (KSPDMActive) (((((((KSPDMActive)digits[2]) << PyLong_SHIFT) | (KSPDMActive)digits[1]) << PyLong_SHIFT) | (KSPDMActive)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(KSPDMActive) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(KSPDMActive, 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(KSPDMActive) >= 4 * PyLong_SHIFT)) {
                              return (KSPDMActive) (((((((((KSPDMActive)digits[3]) << PyLong_SHIFT) | (KSPDMActive)digits[2]) << PyLong_SHIFT) | (KSPDMActive)digits[1]) << PyLong_SHIFT) | (KSPDMActive)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 (KSPDMActive) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(KSPDMActive) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(KSPDMActive, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(KSPDMActive) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(KSPDMActive, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(KSPDMActive, __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(KSPDMActive) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(KSPDMActive, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(KSPDMActive) - 1 > 2 * PyLong_SHIFT)) {
                              return (KSPDMActive) (((KSPDMActive)-1)*(((((KSPDMActive)digits[1]) << PyLong_SHIFT) | (KSPDMActive)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(KSPDMActive) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(KSPDMActive, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(KSPDMActive) - 1 > 2 * PyLong_SHIFT)) {
                              return (KSPDMActive) ((((((KSPDMActive)digits[1]) << PyLong_SHIFT) | (KSPDMActive)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(KSPDMActive) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(KSPDMActive, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(KSPDMActive) - 1 > 3 * PyLong_SHIFT)) {
                              return (KSPDMActive) (((KSPDMActive)-1)*(((((((KSPDMActive)digits[2]) << PyLong_SHIFT) | (KSPDMActive)digits[1]) << PyLong_SHIFT) | (KSPDMActive)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(KSPDMActive) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(KSPDMActive, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(KSPDMActive) - 1 > 3 * PyLong_SHIFT)) {
                              return (KSPDMActive) ((((((((KSPDMActive)digits[2]) << PyLong_SHIFT) | (KSPDMActive)digits[1]) << PyLong_SHIFT) | (KSPDMActive)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(KSPDMActive) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(KSPDMActive, 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(KSPDMActive) - 1 > 4 * PyLong_SHIFT)) {
                              return (KSPDMActive) (((KSPDMActive)-1)*(((((((((KSPDMActive)digits[3]) << PyLong_SHIFT) | (KSPDMActive)digits[2]) << PyLong_SHIFT) | (KSPDMActive)digits[1]) << PyLong_SHIFT) | (KSPDMActive)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(KSPDMActive) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(KSPDMActive, 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(KSPDMActive) - 1 > 4 * PyLong_SHIFT)) {
                              return (KSPDMActive) ((((((((((KSPDMActive)digits[3]) << PyLong_SHIFT) | (KSPDMActive)digits[2]) << PyLong_SHIFT) | (KSPDMActive)digits[1]) << PyLong_SHIFT) | (KSPDMActive)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(KSPDMActive) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(KSPDMActive, long, PyLong_AsLong(x))
          } else if ((sizeof(KSPDMActive) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(KSPDMActive, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          KSPDMActive val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (KSPDMActive) -1;
  #endif
          if (unlikely(ret))
              return (KSPDMActive) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to KSPDMActive");
      return (KSPDMActive) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to KSPDMActive");
      return (KSPDMActive) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE PCSide __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
          PCSide val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PCSide) -1;
          val = __Pyx_PyLong_As_PCSide(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(PCSide) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCSide, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(PCSide) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PCSide, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PCSide val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PCSide) -1;
  #endif
          if (unlikely(ret))
              return (PCSide) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          KSPNormType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (KSPNormType) -1;
          val = __Pyx_PyLong_As_KSPNormType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(KSPNormType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(KSPNormType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(KSPNormType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(KSPNormType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          KSPNormType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (KSPNormType) -1;
  #endif
          if (unlikely(ret))
              return (KSPNormType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          KSPHPDDMType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (KSPHPDDMType) -1;
          val = __Pyx_PyLong_As_KSPHPDDMType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(KSPHPDDMType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(KSPHPDDMType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(KSPHPDDMType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(KSPHPDDMType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          KSPHPDDMType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (KSPHPDDMType) -1;
  #endif
          if (unlikely(ret))
              return (KSPHPDDMType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          SNESNormSchedule val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (SNESNormSchedule) -1;
          val = __Pyx_PyLong_As_SNESNormSchedule(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(SNESNormSchedule) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(SNESNormSchedule, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(SNESNormSchedule) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(SNESNormSchedule, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          SNESNormSchedule val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (SNESNormSchedule) -1;
  #endif
          if (unlikely(ret))
              return (SNESNormSchedule) -1;
          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 SNESNewtonALCorrectionType __Pyx_PyLong_As_SNESNewtonALCorrectionType(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const SNESNewtonALCorrectionType neg_one = (SNESNewtonALCorrectionType) -1, const_zero = (SNESNewtonALCorrectionType) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          SNESNewtonALCorrectionType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (SNESNewtonALCorrectionType) -1;
          val = __Pyx_PyLong_As_SNESNewtonALCorrectionType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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(SNESNewtonALCorrectionType, __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(SNESNewtonALCorrectionType) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(SNESNewtonALCorrectionType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(SNESNewtonALCorrectionType) >= 2 * PyLong_SHIFT)) {
                              return (SNESNewtonALCorrectionType) (((((SNESNewtonALCorrectionType)digits[1]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(SNESNewtonALCorrectionType) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(SNESNewtonALCorrectionType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(SNESNewtonALCorrectionType) >= 3 * PyLong_SHIFT)) {
                              return (SNESNewtonALCorrectionType) (((((((SNESNewtonALCorrectionType)digits[2]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[1]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(SNESNewtonALCorrectionType) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(SNESNewtonALCorrectionType, 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(SNESNewtonALCorrectionType) >= 4 * PyLong_SHIFT)) {
                              return (SNESNewtonALCorrectionType) (((((((((SNESNewtonALCorrectionType)digits[3]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[2]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[1]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)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 (SNESNewtonALCorrectionType) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(SNESNewtonALCorrectionType) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(SNESNewtonALCorrectionType, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(SNESNewtonALCorrectionType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(SNESNewtonALCorrectionType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(SNESNewtonALCorrectionType, __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(SNESNewtonALCorrectionType) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(SNESNewtonALCorrectionType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(SNESNewtonALCorrectionType) - 1 > 2 * PyLong_SHIFT)) {
                              return (SNESNewtonALCorrectionType) (((SNESNewtonALCorrectionType)-1)*(((((SNESNewtonALCorrectionType)digits[1]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(SNESNewtonALCorrectionType) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(SNESNewtonALCorrectionType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(SNESNewtonALCorrectionType) - 1 > 2 * PyLong_SHIFT)) {
                              return (SNESNewtonALCorrectionType) ((((((SNESNewtonALCorrectionType)digits[1]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(SNESNewtonALCorrectionType) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(SNESNewtonALCorrectionType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(SNESNewtonALCorrectionType) - 1 > 3 * PyLong_SHIFT)) {
                              return (SNESNewtonALCorrectionType) (((SNESNewtonALCorrectionType)-1)*(((((((SNESNewtonALCorrectionType)digits[2]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[1]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(SNESNewtonALCorrectionType) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(SNESNewtonALCorrectionType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(SNESNewtonALCorrectionType) - 1 > 3 * PyLong_SHIFT)) {
                              return (SNESNewtonALCorrectionType) ((((((((SNESNewtonALCorrectionType)digits[2]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[1]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(SNESNewtonALCorrectionType) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(SNESNewtonALCorrectionType, 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(SNESNewtonALCorrectionType) - 1 > 4 * PyLong_SHIFT)) {
                              return (SNESNewtonALCorrectionType) (((SNESNewtonALCorrectionType)-1)*(((((((((SNESNewtonALCorrectionType)digits[3]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[2]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[1]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(SNESNewtonALCorrectionType) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(SNESNewtonALCorrectionType, 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(SNESNewtonALCorrectionType) - 1 > 4 * PyLong_SHIFT)) {
                              return (SNESNewtonALCorrectionType) ((((((((((SNESNewtonALCorrectionType)digits[3]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[2]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[1]) << PyLong_SHIFT) | (SNESNewtonALCorrectionType)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(SNESNewtonALCorrectionType) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(SNESNewtonALCorrectionType, long, PyLong_AsLong(x))
          } else if ((sizeof(SNESNewtonALCorrectionType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(SNESNewtonALCorrectionType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          SNESNewtonALCorrectionType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (SNESNewtonALCorrectionType) -1;
  #endif
          if (unlikely(ret))
              return (SNESNewtonALCorrectionType) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to SNESNewtonALCorrectionType");
      return (SNESNewtonALCorrectionType) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to SNESNewtonALCorrectionType");
      return (SNESNewtonALCorrectionType) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE TSProblemType __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
          TSProblemType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (TSProblemType) -1;
          val = __Pyx_PyLong_As_TSProblemType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(TSProblemType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(TSProblemType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(TSProblemType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(TSProblemType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          TSProblemType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (TSProblemType) -1;
  #endif
          if (unlikely(ret))
              return (TSProblemType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          TSEquationType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (TSEquationType) -1;
          val = __Pyx_PyLong_As_TSEquationType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(TSEquationType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(TSEquationType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(TSEquationType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(TSEquationType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          TSEquationType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (TSEquationType) -1;
  #endif
          if (unlikely(ret))
              return (TSEquationType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          TSExactFinalTimeOption val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (TSExactFinalTimeOption) -1;
          val = __Pyx_PyLong_As_TSExactFinalTimeOption(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(TSExactFinalTimeOption) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(TSExactFinalTimeOption, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(TSExactFinalTimeOption) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(TSExactFinalTimeOption, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          TSExactFinalTimeOption val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (TSExactFinalTimeOption) -1;
  #endif
          if (unlikely(ret))
              return (TSExactFinalTimeOption) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          TSConvergedReason val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (TSConvergedReason) -1;
          val = __Pyx_PyLong_As_TSConvergedReason(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(TSConvergedReason) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(TSConvergedReason, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(TSConvergedReason) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(TSConvergedReason, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          TSConvergedReason val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (TSConvergedReason) -1;
  #endif
          if (unlikely(ret))
              return (TSConvergedReason) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          TaoBNCGType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (TaoBNCGType) -1;
          val = __Pyx_PyLong_As_TaoBNCGType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(TaoBNCGType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(TaoBNCGType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(TaoBNCGType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(TaoBNCGType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          TaoBNCGType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (TaoBNCGType) -1;
  #endif
          if (unlikely(ret))
              return (TaoBNCGType) -1;
          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;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE TaoALMMType __Pyx_PyLong_As_TaoALMMType(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const TaoALMMType neg_one = (TaoALMMType) -1, const_zero = (TaoALMMType) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          TaoALMMType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (TaoALMMType) -1;
          val = __Pyx_PyLong_As_TaoALMMType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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(TaoALMMType, __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(TaoALMMType) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(TaoALMMType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(TaoALMMType) >= 2 * PyLong_SHIFT)) {
                              return (TaoALMMType) (((((TaoALMMType)digits[1]) << PyLong_SHIFT) | (TaoALMMType)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(TaoALMMType) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(TaoALMMType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(TaoALMMType) >= 3 * PyLong_SHIFT)) {
                              return (TaoALMMType) (((((((TaoALMMType)digits[2]) << PyLong_SHIFT) | (TaoALMMType)digits[1]) << PyLong_SHIFT) | (TaoALMMType)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(TaoALMMType) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(TaoALMMType, 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(TaoALMMType) >= 4 * PyLong_SHIFT)) {
                              return (TaoALMMType) (((((((((TaoALMMType)digits[3]) << PyLong_SHIFT) | (TaoALMMType)digits[2]) << PyLong_SHIFT) | (TaoALMMType)digits[1]) << PyLong_SHIFT) | (TaoALMMType)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 (TaoALMMType) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(TaoALMMType) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(TaoALMMType, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(TaoALMMType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(TaoALMMType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(TaoALMMType, __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(TaoALMMType) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(TaoALMMType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(TaoALMMType) - 1 > 2 * PyLong_SHIFT)) {
                              return (TaoALMMType) (((TaoALMMType)-1)*(((((TaoALMMType)digits[1]) << PyLong_SHIFT) | (TaoALMMType)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(TaoALMMType) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(TaoALMMType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(TaoALMMType) - 1 > 2 * PyLong_SHIFT)) {
                              return (TaoALMMType) ((((((TaoALMMType)digits[1]) << PyLong_SHIFT) | (TaoALMMType)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(TaoALMMType) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(TaoALMMType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(TaoALMMType) - 1 > 3 * PyLong_SHIFT)) {
                              return (TaoALMMType) (((TaoALMMType)-1)*(((((((TaoALMMType)digits[2]) << PyLong_SHIFT) | (TaoALMMType)digits[1]) << PyLong_SHIFT) | (TaoALMMType)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(TaoALMMType) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(TaoALMMType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(TaoALMMType) - 1 > 3 * PyLong_SHIFT)) {
                              return (TaoALMMType) ((((((((TaoALMMType)digits[2]) << PyLong_SHIFT) | (TaoALMMType)digits[1]) << PyLong_SHIFT) | (TaoALMMType)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(TaoALMMType) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(TaoALMMType, 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(TaoALMMType) - 1 > 4 * PyLong_SHIFT)) {
                              return (TaoALMMType) (((TaoALMMType)-1)*(((((((((TaoALMMType)digits[3]) << PyLong_SHIFT) | (TaoALMMType)digits[2]) << PyLong_SHIFT) | (TaoALMMType)digits[1]) << PyLong_SHIFT) | (TaoALMMType)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(TaoALMMType) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(TaoALMMType, 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(TaoALMMType) - 1 > 4 * PyLong_SHIFT)) {
                              return (TaoALMMType) ((((((((((TaoALMMType)digits[3]) << PyLong_SHIFT) | (TaoALMMType)digits[2]) << PyLong_SHIFT) | (TaoALMMType)digits[1]) << PyLong_SHIFT) | (TaoALMMType)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(TaoALMMType) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(TaoALMMType, long, PyLong_AsLong(x))
          } else if ((sizeof(TaoALMMType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(TaoALMMType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          TaoALMMType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (TaoALMMType) -1;
  #endif
          if (unlikely(ret))
              return (TaoALMMType) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to TaoALMMType");
      return (TaoALMMType) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to TaoALMMType");
      return (TaoALMMType) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE DMReorderDefaultFlag __Pyx_PyLong_As_DMReorderDefaultFlag(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const DMReorderDefaultFlag neg_one = (DMReorderDefaultFlag) -1, const_zero = (DMReorderDefaultFlag) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          DMReorderDefaultFlag val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (DMReorderDefaultFlag) -1;
          val = __Pyx_PyLong_As_DMReorderDefaultFlag(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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(DMReorderDefaultFlag, __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(DMReorderDefaultFlag) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(DMReorderDefaultFlag, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(DMReorderDefaultFlag) >= 2 * PyLong_SHIFT)) {
                              return (DMReorderDefaultFlag) (((((DMReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(DMReorderDefaultFlag) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(DMReorderDefaultFlag, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(DMReorderDefaultFlag) >= 3 * PyLong_SHIFT)) {
                              return (DMReorderDefaultFlag) (((((((DMReorderDefaultFlag)digits[2]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(DMReorderDefaultFlag) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(DMReorderDefaultFlag, 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(DMReorderDefaultFlag) >= 4 * PyLong_SHIFT)) {
                              return (DMReorderDefaultFlag) (((((((((DMReorderDefaultFlag)digits[3]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[2]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMReorderDefaultFlag)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 (DMReorderDefaultFlag) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(DMReorderDefaultFlag) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMReorderDefaultFlag, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(DMReorderDefaultFlag) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMReorderDefaultFlag, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(DMReorderDefaultFlag, __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(DMReorderDefaultFlag) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(DMReorderDefaultFlag, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(DMReorderDefaultFlag) - 1 > 2 * PyLong_SHIFT)) {
                              return (DMReorderDefaultFlag) (((DMReorderDefaultFlag)-1)*(((((DMReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(DMReorderDefaultFlag) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(DMReorderDefaultFlag, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(DMReorderDefaultFlag) - 1 > 2 * PyLong_SHIFT)) {
                              return (DMReorderDefaultFlag) ((((((DMReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(DMReorderDefaultFlag) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(DMReorderDefaultFlag, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(DMReorderDefaultFlag) - 1 > 3 * PyLong_SHIFT)) {
                              return (DMReorderDefaultFlag) (((DMReorderDefaultFlag)-1)*(((((((DMReorderDefaultFlag)digits[2]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(DMReorderDefaultFlag) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(DMReorderDefaultFlag, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(DMReorderDefaultFlag) - 1 > 3 * PyLong_SHIFT)) {
                              return (DMReorderDefaultFlag) ((((((((DMReorderDefaultFlag)digits[2]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(DMReorderDefaultFlag) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(DMReorderDefaultFlag, 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(DMReorderDefaultFlag) - 1 > 4 * PyLong_SHIFT)) {
                              return (DMReorderDefaultFlag) (((DMReorderDefaultFlag)-1)*(((((((((DMReorderDefaultFlag)digits[3]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[2]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(DMReorderDefaultFlag) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(DMReorderDefaultFlag, 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(DMReorderDefaultFlag) - 1 > 4 * PyLong_SHIFT)) {
                              return (DMReorderDefaultFlag) ((((((((((DMReorderDefaultFlag)digits[3]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[2]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[1]) << PyLong_SHIFT) | (DMReorderDefaultFlag)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(DMReorderDefaultFlag) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMReorderDefaultFlag, long, PyLong_AsLong(x))
          } else if ((sizeof(DMReorderDefaultFlag) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMReorderDefaultFlag, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          DMReorderDefaultFlag val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (DMReorderDefaultFlag) -1;
  #endif
          if (unlikely(ret))
              return (DMReorderDefaultFlag) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to DMReorderDefaultFlag");
      return (DMReorderDefaultFlag) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to DMReorderDefaultFlag");
      return (DMReorderDefaultFlag) -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE DMSwarmType __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
          DMSwarmType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (DMSwarmType) -1;
          val = __Pyx_PyLong_As_DMSwarmType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(DMSwarmType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMSwarmType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(DMSwarmType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMSwarmType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          DMSwarmType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (DMSwarmType) -1;
  #endif
          if (unlikely(ret))
              return (DMSwarmType) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          DMSwarmPICLayoutType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (DMSwarmPICLayoutType) -1;
          val = __Pyx_PyLong_As_DMSwarmPICLayoutType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(DMSwarmPICLayoutType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMSwarmPICLayoutType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(DMSwarmPICLayoutType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(DMSwarmPICLayoutType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          DMSwarmPICLayoutType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (DMSwarmPICLayoutType) -1;
  #endif
          if (unlikely(ret))
              return (DMSwarmPICLayoutType) -1;
          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;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE PetscRegressorLinearType __Pyx_PyLong_As_PetscRegressorLinearType(PyObject *x) {
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic push
  #pragma GCC diagnostic ignored "-Wconversion"
  #endif
      const PetscRegressorLinearType neg_one = (PetscRegressorLinearType) -1, const_zero = (PetscRegressorLinearType) 0;
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  #pragma GCC diagnostic pop
  #endif
      const int is_unsigned = neg_one > const_zero;
      if (unlikely(!PyLong_Check(x))) {
          PetscRegressorLinearType val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (PetscRegressorLinearType) -1;
          val = __Pyx_PyLong_As_PetscRegressorLinearType(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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(PetscRegressorLinearType, __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(PetscRegressorLinearType) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscRegressorLinearType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(PetscRegressorLinearType) >= 2 * PyLong_SHIFT)) {
                              return (PetscRegressorLinearType) (((((PetscRegressorLinearType)digits[1]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[0]));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(PetscRegressorLinearType) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscRegressorLinearType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(PetscRegressorLinearType) >= 3 * PyLong_SHIFT)) {
                              return (PetscRegressorLinearType) (((((((PetscRegressorLinearType)digits[2]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[1]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[0]));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(PetscRegressorLinearType) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscRegressorLinearType, 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(PetscRegressorLinearType) >= 4 * PyLong_SHIFT)) {
                              return (PetscRegressorLinearType) (((((((((PetscRegressorLinearType)digits[3]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[2]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[1]) << PyLong_SHIFT) | (PetscRegressorLinearType)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 (PetscRegressorLinearType) -1;
              if (unlikely(result == 1))
                  goto raise_neg_overflow;
          }
  #endif
          if ((sizeof(PetscRegressorLinearType) <= sizeof(unsigned long))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscRegressorLinearType, unsigned long, PyLong_AsUnsignedLong(x))
          } else if ((sizeof(PetscRegressorLinearType) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscRegressorLinearType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } else {
  #if CYTHON_USE_PYLONG_INTERNALS
          if (__Pyx_PyLong_IsCompact(x)) {
              __PYX_VERIFY_RETURN_INT(PetscRegressorLinearType, __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(PetscRegressorLinearType) - 1 > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscRegressorLinearType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(PetscRegressorLinearType) - 1 > 2 * PyLong_SHIFT)) {
                              return (PetscRegressorLinearType) (((PetscRegressorLinearType)-1)*(((((PetscRegressorLinearType)digits[1]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[0])));
                          }
                      }
                      break;
                  case 2:
                      if ((8 * sizeof(PetscRegressorLinearType) > 1 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscRegressorLinearType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(PetscRegressorLinearType) - 1 > 2 * PyLong_SHIFT)) {
                              return (PetscRegressorLinearType) ((((((PetscRegressorLinearType)digits[1]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[0])));
                          }
                      }
                      break;
                  case -3:
                      if ((8 * sizeof(PetscRegressorLinearType) - 1 > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscRegressorLinearType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(PetscRegressorLinearType) - 1 > 3 * PyLong_SHIFT)) {
                              return (PetscRegressorLinearType) (((PetscRegressorLinearType)-1)*(((((((PetscRegressorLinearType)digits[2]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[1]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[0])));
                          }
                      }
                      break;
                  case 3:
                      if ((8 * sizeof(PetscRegressorLinearType) > 2 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscRegressorLinearType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                          } else if ((8 * sizeof(PetscRegressorLinearType) - 1 > 3 * PyLong_SHIFT)) {
                              return (PetscRegressorLinearType) ((((((((PetscRegressorLinearType)digits[2]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[1]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[0])));
                          }
                      }
                      break;
                  case -4:
                      if ((8 * sizeof(PetscRegressorLinearType) - 1 > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscRegressorLinearType, 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(PetscRegressorLinearType) - 1 > 4 * PyLong_SHIFT)) {
                              return (PetscRegressorLinearType) (((PetscRegressorLinearType)-1)*(((((((((PetscRegressorLinearType)digits[3]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[2]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[1]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[0])));
                          }
                      }
                      break;
                  case 4:
                      if ((8 * sizeof(PetscRegressorLinearType) > 3 * PyLong_SHIFT)) {
                          if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                              __PYX_VERIFY_RETURN_INT(PetscRegressorLinearType, 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(PetscRegressorLinearType) - 1 > 4 * PyLong_SHIFT)) {
                              return (PetscRegressorLinearType) ((((((((((PetscRegressorLinearType)digits[3]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[2]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[1]) << PyLong_SHIFT) | (PetscRegressorLinearType)digits[0])));
                          }
                      }
                      break;
              }
          }
  #endif
          if ((sizeof(PetscRegressorLinearType) <= sizeof(long))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscRegressorLinearType, long, PyLong_AsLong(x))
          } else if ((sizeof(PetscRegressorLinearType) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(PetscRegressorLinearType, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          PetscRegressorLinearType val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyErr_SetString(PyExc_RuntimeError,
                          "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
          val = (PetscRegressorLinearType) -1;
  #endif
          if (unlikely(ret))
              return (PetscRegressorLinearType) -1;
          return val;
      }
  raise_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "value too large to convert to PetscRegressorLinearType");
      return (PetscRegressorLinearType) -1;
  raise_neg_overflow:
      PyErr_SetString(PyExc_OverflowError,
          "can't convert negative value to PetscRegressorLinearType");
      return (PetscRegressorLinearType) -1;
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_From_char(char value) {
  #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 (is_unsigned) {
          if (sizeof(char) < sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(char) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
              return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  #endif
          }
      } else {
          if (sizeof(char) <= sizeof(long)) {
              return PyLong_FromLong((long) value);
          } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(char),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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(char));
          if (!py_bytes) goto limited_bad;
          order_str = PyUnicode_FromString(little ? "little" : "big");
          if (!order_str) goto limited_bad;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* CIntToPy */
  static CYTHON_INLINE PyObject* __Pyx_PyLong_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 PyLong_FromLong((long) value);
          } else if (sizeof(MatProductType) <= sizeof(unsigned long)) {
              return PyLong_FromUnsignedLong((unsigned long) value);
  #if !CYTHON_COMPILING_IN_PYPY
          } 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 PyLong_FromLong((long) value);
          } else if (sizeof(MatProductType) <= sizeof(PY_LONG_LONG)) {
              return PyLong_FromLongLong((PY_LONG_LONG) value);
          }
      }
      {
          unsigned char *bytes = (unsigned char *)&value;
  #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
          if (is_unsigned) {
              return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
          } else {
              return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
          }
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
          int one = 1; int little = (int)*(unsigned char *)&one;
          return _PyLong_FromByteArray(bytes, sizeof(MatProductType),
                                       little, !is_unsigned);
  #else
          int one = 1; int little = (int)*(unsigned char *)&one;
          PyObject *from_bytes, *result = NULL, *kwds = NULL;
          PyObject *py_bytes = 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;
          {
              PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
              if (!is_unsigned) {
                  kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                  if (!kwds) goto limited_bad;
                  if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
              }
              result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
          }
          limited_bad:
          Py_XDECREF(kwds);
          Py_XDECREF(order_str);
          Py_XDECREF(py_bytes);
          Py_XDECREF(from_bytes);
          return result;
  #endif
      }
  }
  
/* UpdateUnpickledDict */
  static int __Pyx__UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
      PyObject *state_dict = __Pyx_PySequence_ITEM(state, index);
      if (unlikely(!state_dict)) {
          return -1;
      }
      int non_empty = PyObject_IsTrue(state_dict);
      if (non_empty == 0) {
          Py_DECREF(state_dict);
          return 0;
      } else if (unlikely(non_empty == -1)) {
          return -1;
      }
      PyObject *dict;
      #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
      dict = PyObject_GetAttrString(obj, "__dict__");
      #else
      dict = PyObject_GenericGetDict(obj, NULL);
      #endif
      if (unlikely(!dict)) {
          Py_DECREF(state_dict);
          return -1;
      }
      int result;
      if (likely(PyDict_CheckExact(dict))) {
          result = PyDict_Update(dict, state_dict);
      } else {
          PyObject *obj_result = __Pyx_PyObject_CallMethod1(dict, __pyx_mstate_global->__pyx_n_u_update, state_dict);
          if (likely(obj_result)) {
              Py_DECREF(obj_result);
              result = 0;
          } else {
              result = -1;
          }
      }
      Py_DECREF(state_dict);
      Py_DECREF(dict);
      return result;
  }
  static int __Pyx_UpdateUnpickledDict(PyObject *obj, PyObject *state, Py_ssize_t index) {
      Py_ssize_t state_size = __Pyx_PyTuple_GET_SIZE(state);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely(state_size == -1)) return -1;
      #endif
      if (state_size <= index) {
          return 0;
      }
      return __Pyx__UpdateUnpickledDict(obj, state, index);
  }
  
/* CheckUnpickleChecksum */
  static void __Pyx_RaiseUnpickleChecksumError(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
      PyObject *pickle_module = PyImport_ImportModule("pickle");
      if (unlikely(!pickle_module)) return;
      PyObject *pickle_error = PyObject_GetAttrString(pickle_module, "PickleError");
      Py_DECREF(pickle_module);
      if (unlikely(!pickle_error)) return;
      if (checksum2 == checksum1) {
          PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x) = (%s))",
              checksum, checksum1, members);
      } else if (checksum3 == checksum2) {
          PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x) = (%s))",
              checksum, checksum1, checksum2, members);
      } else {
          PyErr_Format(pickle_error, "Incompatible checksums (0x%x vs (0x%x, 0x%x, 0x%x) = (%s))",
              checksum, checksum1, checksum2, checksum3, members);
      }
      Py_DECREF(pickle_error);
  }
  static int __Pyx_CheckUnpickleChecksum(long checksum, long checksum1, long checksum2, long checksum3, const char *members) {
      int found = 0;
      found |= checksum1 == checksum;
      found |= checksum2 == checksum;
      found |= checksum3 == checksum;
      if (likely(found))
          return 0;
      __Pyx_RaiseUnpickleChecksumError(checksum, checksum1, checksum2, checksum3, members);
      return -1;
  }
  
/* CIntFromPy */
  static CYTHON_INLINE long __Pyx_PyLong_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 (unlikely(!PyLong_Check(x))) {
          long val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (long) -1;
          val = __Pyx_PyLong_As_long(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          long val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (long) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (long) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (long) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          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;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((long) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long 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 (!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
          if (unlikely(ret))
              return (long) -1;
          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_PyLong_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 (unlikely(!PyLong_Check(x))) {
          char val;
          PyObject *tmp = __Pyx_PyNumber_Long(x);
          if (!tmp) return (char) -1;
          val = __Pyx_PyLong_As_char(tmp);
          Py_DECREF(tmp);
          return val;
      }
      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))
          } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
          }
      } 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))
          } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) {
              __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
          }
      }
      {
          char val;
          int ret = -1;
  #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
          Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
              x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
          if (unlikely(bytes_copied == -1)) {
          } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
              goto raise_overflow;
          } else {
              ret = 0;
          }
  #elif 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 *)x,
                                      bytes, sizeof(val),
                                      is_little, !is_unsigned);
  #else
          PyObject *v;
          PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
          int bits, remaining_bits, is_negative = 0;
          int chunk_size = (sizeof(long) < 8) ? 30 : 62;
          if (likely(PyLong_CheckExact(x))) {
              v = __Pyx_NewRef(x);
          } else {
              v = PyNumber_Long(x);
              if (unlikely(!v)) return (char) -1;
              assert(PyLong_CheckExact(v));
          }
          {
              int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
              if (unlikely(result < 0)) {
                  Py_DECREF(v);
                  return (char) -1;
              }
              is_negative = result == 1;
          }
          if (is_unsigned && unlikely(is_negative)) {
              Py_DECREF(v);
              goto raise_neg_overflow;
          } else if (is_negative) {
              stepval = PyNumber_Invert(v);
              Py_DECREF(v);
              if (unlikely(!stepval))
                  return (char) -1;
          } else {
              stepval = v;
          }
          v = NULL;
          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;
              long idigit;
              digit = PyNumber_And(stepval, mask);
              if (unlikely(!digit)) goto done;
              idigit = PyLong_AsLong(digit);
              Py_DECREF(digit);
              if (unlikely(idigit < 0)) goto done;
              val |= ((char) idigit) << bits;
              tmp = PyNumber_Rshift(stepval, shift);
              if (unlikely(!tmp)) goto done;
              Py_DECREF(stepval); stepval = tmp;
          }
          Py_DECREF(shift); shift = NULL;
          Py_DECREF(mask); mask = NULL;
          {
              long 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 (!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
          if (unlikely(ret))
              return (char) -1;
          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 && __PYX_LIMITED_VERSION_HEX < 0x030d0000
  static __Pyx_TypeName
  __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
  {
      PyObject *module = NULL, *name = NULL, *result = NULL;
      #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
      name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                                 __pyx_mstate_global->__pyx_n_u_qualname);
      #else
      name = PyType_GetQualName(tp);
      #endif
      if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
      module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                                 __pyx_mstate_global->__pyx_n_u_module);
      if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
      if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
          result = name;
          name = NULL;
          goto done;
      }
      result = PyUnicode_FromFormat("%U.%U", module, name);
      if (unlikely(result == NULL)) goto bad;
    done:
      Py_XDECREF(name);
      Py_XDECREF(module);
      return result;
    bad:
      PyErr_Clear();
      if (name) {
          result = name;
          name = NULL;
      } else {
          result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__28);
      }
      goto done;
  }
  #endif
  
/* GetRuntimeVersion */
  #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
  void __Pyx_init_runtime_version(void) {
      if (__Pyx_cached_runtime_version == 0) {
          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;
          }
          __Pyx_cached_runtime_version = version;
      }
  }
  #endif
  static unsigned long __Pyx_get_runtime_version(void) {
  #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
      return Py_Version & ~0xFFUL;
  #else
      return __Pyx_cached_runtime_version;
  #endif
  }
  
/* CheckBinaryVersion */
  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);
      }
  }
  
/* NewCodeObj */
  #if CYTHON_COMPILING_IN_LIMITED_API
      static 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;
          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;
          #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, "iiiiiOOOOOOiOOO", 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, "iiiiiiOOOOOOiOOO", 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, "iiiiiiOOOOOOOiOOOO", 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;
      }
  #elif PY_VERSION_HEX >= 0x030B0000
    static 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;
      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, __pyx_mstate_global->__pyx_empty_bytes);
      #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
      if (likely(result))
          result->_co_firsttraceable = 0;
      #endif
      return result;
    }
  #elif !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
  static PyObject* __Pyx_PyCode_New(
          const __Pyx_PyCode_New_function_description descr,
          PyObject * const *varnames,
          PyObject *filename,
          PyObject *funcname,
          PyObject *line_table,
          PyObject *tuple_dedup_map
  ) {
      PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
      Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
      PyObject *varnames_tuple = PyTuple_New(var_count);
      if (unlikely(!varnames_tuple)) return NULL;
      for (Py_ssize_t i=0; i < var_count; i++) {
          Py_INCREF(varnames[i]);
          if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
      }
      #if CYTHON_COMPILING_IN_LIMITED_API
      varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
      if (!varnames_tuple_dedup) {
          if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
          varnames_tuple_dedup = varnames_tuple;
      }
      #else
      varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
      if (unlikely(!varnames_tuple_dedup)) goto done;
      #endif
      #if CYTHON_AVOID_BORROWED_REFS
      Py_INCREF(varnames_tuple_dedup);
      #endif
      if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
          Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely(line_table_length == -1)) goto done;
          #endif
          Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
          code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
          if (unlikely(!code_bytes)) goto done;
          char* c_code_bytes = PyBytes_AsString(code_bytes);
          if (unlikely(!c_code_bytes)) goto done;
          memset(c_code_bytes, 0, (size_t) code_len);
      }
      code_obj = (PyObject*) __Pyx__PyCode_New(
          (int) descr.argcount,
          (int) descr.num_posonly_args,
          (int) descr.num_kwonly_args,
          (int) descr.nlocals,
          0,
          (int) descr.flags,
          code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
          __pyx_mstate_global->__pyx_empty_tuple,
          __pyx_mstate_global->__pyx_empty_tuple,
          varnames_tuple_dedup,
          __pyx_mstate_global->__pyx_empty_tuple,
          __pyx_mstate_global->__pyx_empty_tuple,
          filename,
          funcname,
          (int) descr.first_line,
          (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
      );
  done:
      Py_XDECREF(code_bytes);
      #if CYTHON_AVOID_BORROWED_REFS
      Py_XDECREF(varnames_tuple_dedup);
      #endif
      Py_DECREF(varnames_tuple);
      return code_obj;
  }
  
/* DecompressString */
  static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
      PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
      const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
      PyObject *methodname = PyUnicode_FromString("decompress");
      if (unlikely(!methodname)) return NULL;
      #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
      if (algo == 3) {
          PyObject *fromlist = Py_BuildValue("[O]", methodname);
          if (unlikely(!fromlist)) goto bad;
          module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
          Py_DECREF(fromlist);
      } else
      #endif
          module = PyImport_ImportModule(module_name);
      if (unlikely(!module)) goto import_failed;
      decompress = PyObject_GetAttr(module, methodname);
      if (unlikely(!decompress)) goto import_failed;
      {
          #ifdef __cplusplus
              char *memview_bytes = const_cast<char*>(s);
          #else
              #if defined(__clang__)
                #pragma clang diagnostic push
                #pragma clang diagnostic ignored "-Wcast-qual"
              #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
                #pragma GCC diagnostic push
                #pragma GCC diagnostic ignored "-Wcast-qual"
              #endif
              char *memview_bytes = (char*) s;
              #if defined(__clang__)
                #pragma clang diagnostic pop
              #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
                #pragma GCC diagnostic pop
              #endif
          #endif
          #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
          int memview_flags = 0x100;
          #else
          int memview_flags = PyBUF_READ;
          #endif
          compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
      }
      if (unlikely(!compressed_bytes)) {
          Py_DECREF(decompress);
          goto bad;
      }
      decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
      Py_DECREF(compressed_bytes);
      Py_DECREF(decompress);
      Py_DECREF(module);
      Py_DECREF(methodname);
      return decompressed;
  import_failed:
      PyErr_Format(PyExc_ImportError,
          "Failed to import '%.20s.decompress' - cannot initialise module strings. "
          "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
          module_name, algo);
  bad:
      Py_XDECREF(module);
      Py_DECREF(methodname);
      return NULL;
  }
  
#include <string.h>
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_UTF8
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    {
        const char* result;
        Py_ssize_t unicode_length;
        CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
        #else
        result = PyUnicode_AsUTF8AndSize(o, length);
        #endif
        #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        unicode_length = PyUnicode_GetLength(o);
        if (unlikely(unicode_length < 0)) return NULL;
        if (unlikely(unicode_length != *length)) {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
        #endif
        return result;
    }
#else
#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_UTF8
    if (PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
    if (PyByteArray_Check(o)) {
#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
#else
        *length = PyByteArray_Size(o);
        if (*length == -1) return NULL;
        return PyByteArray_AsString(o);
#endif
    } else
    {
        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_LongWrongResultType(PyObject* result) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
    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;
    }
    PyErr_Format(PyExc_TypeError,
                 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
                 result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  PyObject *res = NULL;
  if (likely(PyLong_Check(x)))
      return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  if (likely(m && m->nb_int)) {
      res = m->nb_int(x);
  }
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
      res = PyNumber_Long(x);
  }
#endif
  if (likely(res)) {
      if (unlikely(!PyLong_CheckExact(res))) {
          return __Pyx_PyNumber_LongWrongResultType(res);
      }
  }
  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 (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 = PyLong_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);
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyLong_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
    CYTHON_UNUSED_VAR(b);
    return __Pyx_NewRef(Py_None);
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return __Pyx_NewRef(b ? Py_True: Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
    return PyLong_FromSize_t(ival);
}


  /* MultiPhaseInitModuleState */
  #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
  #ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  #if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
    #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
  #else
    #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
  #endif
  #endif
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
  #error "Module state with PEP489 requires atomics. Currently that's one of\
   C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
  #endif
  #if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  #define __Pyx_ModuleStateLookup_Lock()
  #define __Pyx_ModuleStateLookup_Unlock()
  #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
  static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
  #define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
  #define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
  #elif defined(__cplusplus) && __cplusplus >= 201103L
  #include <mutex>
  static std::mutex __Pyx_ModuleStateLookup_mutex;
  #define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
  #define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
  #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
  #include <threads.h>
  static mtx_t __Pyx_ModuleStateLookup_mutex;
  static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
  static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
      mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
  }
  #define __Pyx_ModuleStateLookup_Lock()\
    call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
    mtx_lock(&__Pyx_ModuleStateLookup_mutex)
  #define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
  #elif defined(HAVE_PTHREAD_H)
  #include <pthread.h>
  static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
  #define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
  #define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
  #elif defined(_WIN32)
  #include <Windows.h>  // synchapi.h on its own doesn't work
  static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
  #define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
  #define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
  #else
  #error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
   Requires C standard >= C11, or C++ standard >= C++11,\
   or pthreads, or the Windows 32 API, or Python >= 3.13."
  #endif
  typedef struct {
      int64_t id;
      PyObject *module;
  } __Pyx_InterpreterIdAndModule;
  typedef struct {
      char interpreter_id_as_index;
      Py_ssize_t count;
      Py_ssize_t allocated;
      __Pyx_InterpreterIdAndModule table[1];
  } __Pyx_ModuleStateLookupData;
  #define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
  #endif
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
  #else
  static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
  #endif
  static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
          __Pyx_InterpreterIdAndModule* table,
          Py_ssize_t count,
          int64_t interpreterId) {
      __Pyx_InterpreterIdAndModule* begin = table;
      __Pyx_InterpreterIdAndModule* end = begin + count;
      if (begin->id == interpreterId) {
          return begin;
      }
      while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
          __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
          if (halfway->id == interpreterId) {
              return halfway;
          }
          if (halfway->id < interpreterId) {
              begin = halfway;
          } else {
              end = halfway;
          }
      }
      for (; begin < end; ++begin) {
          if (begin->id >= interpreterId) return begin;
      }
      return begin;
  }
  static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
      int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
      if (interpreter_id == -1) return NULL;
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
      __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
      {
          __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
          if (likely(data)) {
              __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
              if (likely(data == new_data)) {
                  goto read_finished;
              }
          }
          __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
          __Pyx_ModuleStateLookup_Lock();
          __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
          data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
          __Pyx_ModuleStateLookup_Unlock();
      }
    read_finished:;
  #else
      __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
  #endif
      __Pyx_InterpreterIdAndModule* found = NULL;
      if (unlikely(!data)) goto end;
      if (data->interpreter_id_as_index) {
          if (interpreter_id < data->count) {
              found = data->table+interpreter_id;
          }
      } else {
          found = __Pyx_State_FindModuleStateLookupTableLowerBound(
              data->table, data->count, interpreter_id);
      }
    end:
      {
          PyObject *result=NULL;
          if (found && found->id == interpreter_id) {
              result = found->module;
          }
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
          __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
  #endif
          return result;
      }
  }
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
      while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
  }
  #else
  #define __Pyx_ModuleStateLookup_wait_until_no_readers()
  #endif
  static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
      Py_ssize_t to_allocate = (*old_data)->allocated;
      while (to_allocate <= interpreter_id) {
          if (to_allocate == 0) to_allocate = 1;
          else to_allocate *= 2;
      }
      __Pyx_ModuleStateLookupData *new_data = *old_data;
      if (to_allocate != (*old_data)->allocated) {
           new_data = (__Pyx_ModuleStateLookupData *)realloc(
              *old_data,
              sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
          if (!new_data) {
              PyErr_NoMemory();
              return -1;
          }
          for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
              new_data->table[i].id = i;
              new_data->table[i].module = NULL;
          }
          new_data->allocated = to_allocate;
      }
      new_data->table[interpreter_id].module = module;
      if (new_data->count < interpreter_id+1) {
          new_data->count = interpreter_id+1;
      }
      *old_data = new_data;
      return 0;
  }
  static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
      __Pyx_InterpreterIdAndModule *read = data->table;
      __Pyx_InterpreterIdAndModule *write = data->table;
      __Pyx_InterpreterIdAndModule *end = read + data->count;
      for (; read<end; ++read) {
          if (read->module) {
              write->id = read->id;
              write->module = read->module;
              ++write;
          }
      }
      data->count = write - data->table;
      for (; write<end; ++write) {
          write->id = 0;
          write->module = NULL;
      }
      data->interpreter_id_as_index = 0;
  }
  static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
      int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
      if (interpreter_id == -1) return -1;
      int result = 0;
      __Pyx_ModuleStateLookup_Lock();
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
      __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
              __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
  #else
      __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
  #endif
      __Pyx_ModuleStateLookupData *new_data = old_data;
      if (!new_data) {
          new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
          if (!new_data) {
              result = -1;
              PyErr_NoMemory();
              goto end;
          }
          new_data->allocated = 1;
          new_data->interpreter_id_as_index = 1;
      }
      __Pyx_ModuleStateLookup_wait_until_no_readers();
      if (new_data->interpreter_id_as_index) {
          if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
              result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
              goto end;
          }
          __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
      }
      {
          Py_ssize_t insert_at = 0;
          {
              __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
                  new_data->table, new_data->count, interpreter_id);
              assert(lower_bound);
              insert_at = lower_bound - new_data->table;
              if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
                  lower_bound->module = module;
                  goto end;  // already in table, nothing more to do
              }
          }
          if (new_data->count+1 >= new_data->allocated) {
              Py_ssize_t to_allocate = (new_data->count+1)*2;
              new_data =
                  (__Pyx_ModuleStateLookupData*)realloc(
                      new_data,
                      sizeof(__Pyx_ModuleStateLookupData) +
                      (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
              if (!new_data) {
                  result = -1;
                  new_data = old_data;
                  PyErr_NoMemory();
                  goto end;
              }
              new_data->allocated = to_allocate;
          }
          ++new_data->count;
          int64_t last_id = interpreter_id;
          PyObject *last_module = module;
          for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
              int64_t current_id = new_data->table[i].id;
              new_data->table[i].id = last_id;
              last_id = current_id;
              PyObject *current_module = new_data->table[i].module;
              new_data->table[i].module = last_module;
              last_module = current_module;
          }
      }
    end:
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
      __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
  #else
      __Pyx_ModuleStateLookup_data = new_data;
  #endif
      __Pyx_ModuleStateLookup_Unlock();
      return result;
  }
  static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
      int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
      if (interpreter_id == -1) return -1;
      __Pyx_ModuleStateLookup_Lock();
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
      __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
              __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
  #else
      __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
  #endif
      if (data->interpreter_id_as_index) {
          if (interpreter_id < data->count) {
              data->table[interpreter_id].module = NULL;
          }
          goto done;
      }
      {
          __Pyx_ModuleStateLookup_wait_until_no_readers();
          __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
              data->table, data->count, interpreter_id);
          if (!lower_bound) goto done;
          if (lower_bound->id != interpreter_id) goto done;
          __Pyx_InterpreterIdAndModule *end = data->table+data->count;
          for (;lower_bound<end-1; ++lower_bound) {
              lower_bound->id = (lower_bound+1)->id;
              lower_bound->module = (lower_bound+1)->module;
          }
      }
      --data->count;
      if (data->count == 0) {
          free(data);
          data = NULL;
      }
    done:
  #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
      __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
  #else
      __Pyx_ModuleStateLookup_data = data;
  #endif
      __Pyx_ModuleStateLookup_Unlock();
      return 0;
  }
  #endif
  
/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
